@webflow/webflow-cli 2.2.0-next.0 → 2.3.0-next.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/CHANGELOG.md +15 -0
- package/dist/index.js +118 -109
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var Ty=Object.create;var ha=Object.defineProperty;var Iy=Object.getOwnPropertyDescriptor;var Oy=Object.getOwnPropertyNames;var Ry=Object.getPrototypeOf,$y=Object.prototype.hasOwnProperty;var k=(e,t)=>()=>(e&&(t=e(e=0)),t);var wa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),pd=(e,t)=>{for(var r in t)ha(e,r,{get:t[r],enumerable:!0})},Py=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oy(t))!$y.call(e,o)&&o!==r&&ha(e,o,{get:()=>t[o],enumerable:!(n=Iy(t,o))||n.enumerable});return e};var h=(e,t,r)=>(r=e!=null?Ty(Ry(e)):{},Py(t||!e||!e.__esModule?ha(r,"default",{value:e,enumerable:!0}):r,e));var md,fe,ya,Pt,ne,Ze,P,Q,T,ie=k(()=>{"use strict";md=e=>`\x1B[1;48;2;20;110;245;97m ${e} \x1B[0m`,fe=e=>`\x1B[38;2;167;209;255m${e}\x1B[0m`,ya=e=>`\x1B[38;2;196;175;255m${e}\x1B[0m`,Pt=e=>`\x1B[38;2;255;156;156m${e}\x1B[0m`,ne=e=>`\x1B[38;2;255;209;102m${e}\x1B[0m`,Ze=e=>`\x1B[97m${e}\x1B[0m`,P=e=>`\x1B[38;2;121;224;156m${e}\x1B[0m`,Q=e=>`\x1B[1m${e}\x1B[0m`,T=e=>`\x1B[38;2;185;185;185m${e}\x1B[0m`});function My(){let e=new Map;for(let[t,r]of Object.entries(ue)){for(let[n,o]of Object.entries(r))ue[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=ue[n],e.set(o[0],o[1]);Object.defineProperty(ue,t,{value:r,enumerable:!1})}return Object.defineProperty(ue,"codes",{value:e,enumerable:!1}),ue.color.close="\x1B[39m",ue.bgColor.close="\x1B[49m",ue.color.ansi=gd(),ue.color.ansi256=hd(),ue.color.ansi16m=wd(),ue.bgColor.ansi=gd(10),ue.bgColor.ansi256=hd(10),ue.bgColor.ansi16m=wd(10),Object.defineProperties(ue,{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=>ue.rgbToAnsi256(...ue.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)=>ue.ansi256ToAnsi(ue.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ue.ansi256ToAnsi(ue.hexToAnsi256(t)),enumerable:!1}}),ue}var gd,hd,wd,ue,cx,Ly,By,ux,Wy,gt,yd=k(()=>{"use strict";gd=(e=0)=>t=>`\x1B[${t+e}m`,hd=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wd=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ue={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},cx=Object.keys(ue.modifier),Ly=Object.keys(ue.color),By=Object.keys(ue.bgColor),ux=[...Ly,...By];Wy=My(),gt=Wy});function rt(e,t=globalThis.Deno?globalThis.Deno.args:fi.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 Uy(){if("FORCE_COLOR"in me)return me.FORCE_COLOR==="true"?1:me.FORCE_COLOR==="false"?0:me.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(me.FORCE_COLOR,10),3)}function Vy(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Hy(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=Uy();n!==void 0&&(pi=n);let o=r?pi:n;if(o===0)return 0;if(r){if(rt("color=16m")||rt("color=full")||rt("color=truecolor"))return 3;if(rt("color=256"))return 2}if("TF_BUILD"in me&&"AGENT_NAME"in me)return 1;if(e&&!t&&o===void 0)return 0;let i=o||0;if(me.TERM==="dumb")return i;if(fi.default.platform==="win32"){let s=bd.default.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in me)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in me)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in me)||me.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(me.TEAMCITY_VERSION)?1:0;if(me.COLORTERM==="truecolor"||me.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in me){let s=Number.parseInt((me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(me.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(me.TERM)||"COLORTERM"in me?1:i}function Dd(e,t={}){let r=Hy(e,{streamIsTTY:e&&e.isTTY,...t});return Vy(r)}var fi,bd,Da,me,pi,Jy,vd,Ed=k(()=>{"use strict";fi=h(require("process"),1),bd=h(require("os"),1),Da=h(require("tty"),1);({env:me}=fi.default);rt("no-color")||rt("no-colors")||rt("color=false")||rt("color=never")?pi=0:(rt("color")||rt("colors")||rt("color=true")||rt("color=always"))&&(pi=1);Jy={stdout:Dd({isTTY:Da.default.isatty(1)}),stderr:Dd({isTTY:Da.default.isatty(2)})},vd=Jy});function Fd(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 xd(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
4
|
`)+r,o=n+1,n=e.indexOf(`
|
|
5
|
-
`,o)}while(n!==-1);return i+=e.slice(o),i}var
|
|
6
|
-
`);return i!==-1&&(t=
|
|
7
|
-
${t}`,Ey=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Fy=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),xy=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=vy.bind(null,n,t.toString());Object.defineProperty(o,"name",Fy);let{writable:i,enumerable:s,configurable:a}=Ey;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var si,cd,ud,dd=x(()=>{"use strict";ld();si=new WeakMap,cd=(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(si.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 ca(i,e),si.set(i,n),i};cd.callCount=e=>{if(!si.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return si.get(e)};ud=cd});var wr,fd=x(()=>{"use strict";wr=[];wr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&wr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&wr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var ai,ua,da,Cy,fa,li,_y,pa,ma,ga,pd,NF,BF,md=x(()=>{"use strict";fd();ai=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",ua=Symbol.for("signal-exit emitter"),da=globalThis,Cy=Object.defineProperty.bind(Object),fa=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(da[ua])return da[ua];Cy(da,ua,{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}},li=class{},_y=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),pa=class extends li{onExit(){return()=>{}}load(){}unload(){}},ma=class extends li{#s=ga.platform==="win32"?"SIGINT":"SIGHUP";#r=new fa;#e;#o;#f;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let r of wr)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.#f=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!ai(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 wr)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,wr.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.#f,this.#r.count-=1)}#n(t){return ai(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)):0}#p(t,...r){let n=this.#o;if(t==="exit"&&ai(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)}},ga=globalThis.process,{onExit:pd,load:NF,unload:BF}=_y(ai(ga)?new ma(ga):new pa)});var Zn,gd,ky,hd,wd=x(()=>{"use strict";Zn=h(require("process"),1);dd();md();gd=Zn.default.stderr.isTTY?Zn.default.stderr:Zn.default.stdout.isTTY?Zn.default.stdout:void 0,ky=gd?ud(()=>{pd(()=>{gd.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},hd=ky});var ha,ci,nn,wa,yd=x(()=>{"use strict";ha=h(require("process"),1);wd();ci=!1,nn={};nn.show=(e=ha.default.stderr)=>{e.isTTY&&(ci=!1,e.write("\x1B[?25h"))};nn.hide=(e=ha.default.stderr)=>{e.isTTY&&(hd(),ci=!0,e.write("\x1B[?25l"))};nn.toggle=(e,t)=>{e!==void 0&&(ci=e),ci?nn.show(t):nn.hide(t)};wa=nn});var Dd=ra((JF,Sy)=>{Sy.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 ya=ra((GF,vd)=>{"use strict";var ui=Object.assign({},Dd()),bd=Object.keys(ui);Object.defineProperty(ui,"random",{get(){let e=Math.floor(Math.random()*bd.length),t=bd[e];return ui[t]}});vd.exports=ui});function Da(){return Xe.default.platform!=="win32"?Xe.default.env.TERM!=="linux":!!Xe.default.env.CI||!!Xe.default.env.WT_SESSION||!!Xe.default.env.TERMINUS_SUBLIME||Xe.default.env.ConEmuTask==="{cmd::Cmder}"||Xe.default.env.TERM_PROGRAM==="Terminus-Sublime"||Xe.default.env.TERM_PROGRAM==="vscode"||Xe.default.env.TERM==="xterm-256color"||Xe.default.env.TERM==="alacritty"||Xe.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Xe,Ed=x(()=>{"use strict";Xe=h(require("process"),1)});var Ay,Ty,Iy,Yn,Fd=x(()=>{"use strict";la();Ed();Ay={info:ut.blue("\u2139"),success:ut.green("\u2714"),warning:ut.yellow("\u26A0"),error:ut.red("\u2716")},Ty={info:ut.blue("i"),success:ut.green("\u221A"),warning:ut.yellow("\u203C"),error:ut.red("\xD7")},Iy=Da()?Ay:Ty,Yn=Iy});function ba({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 xd=x(()=>{"use strict"});function va(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Oy,"")}var Oy,Cd=x(()=>{"use strict";xd();Oy=ba()});function Ea({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 _d=x(()=>{"use strict"});function Fa(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(Ry,"")}var Ry,kd=x(()=>{"use strict";_d();Ry=Ea()});var di,fi,xa,Ca,Xn,Sd=x(()=>{"use strict";di=[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],fi=[12288,12288,65281,65376,65504,65510],xa=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ca=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Xn=[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 pi,Ad=x(()=>{"use strict";pi=(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 Uy(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(Td>=o&&Td<=i)return[o,i];i-o>r-t&&(t=o,r=i)}return[t,r]}var $y,Py,jy,Ny,ax,lx,cx,ux,By,Ly,Td,My,Wy,Id,Od,Rd,$d=x(()=>{"use strict";Sd();Ad();$y=di[0],Py=di.at(-1),jy=fi[0],Ny=fi.at(-1),ax=xa[0],lx=xa.at(-1),cx=Ca[0],ux=Ca.at(-1),By=Xn[0],Ly=Xn.at(-1),Td=19968,[My,Wy]=Uy(Xn);Id=e=>e<$y||e>Py?!1:pi(di,e),Od=e=>e<jy||e>Ny?!1:pi(fi,e),Rd=e=>e>=My&&e<=Wy?!0:e<By||e>Ly?!1:pi(Xn,e)});function Vy(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Pd(e,{ambiguousAsWide:t=!1}={}){return Vy(e),Od(e)||Rd(e)||t&&Id(e)?2:1}var jd=x(()=>{"use strict";$d()});var Nd,Bd=x(()=>{"use strict";Nd=()=>/[#*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 _a(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=Fa(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of Hy.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)&&!Jy.test(s)){if(Nd().test(s)){o+=2;continue}o+=Pd(a,i)}}return o}var Hy,Jy,Ld=x(()=>{"use strict";kd();jd();Bd();Hy=new Intl.Segmenter,Jy=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function ka({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var Md=x(()=>{"use strict"});function Aa(){let{env:e}=Sa.default,{TERM:t,TERM_PROGRAM:r}=e;return Sa.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 Sa,Wd=x(()=>{"use strict";Sa=h(require("process"),1)});var dt,Gy,Ta,zy,Ia,Ud=x(()=>{"use strict";dt=h(require("process"),1),Gy=3,Ta=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(){dt.default.platform==="win32"||!dt.default.stdin.isTTY||(dt.default.stdin.setRawMode(!0),dt.default.stdin.on("data",this.#o),dt.default.stdin.resume())}#e(){dt.default.stdin.isTTY&&(dt.default.stdin.off("data",this.#o),dt.default.stdin.pause(),dt.default.stdin.setRawMode(!1))}#o(t){t[0]===Gy&&dt.default.emit("SIGINT")}},zy=new Ta,Ia=zy});function Ra(e){return new Oa(e)}var Qn,eo,qy,Oa,Vd=x(()=>{"use strict";Qn=h(require("process"),1);la();yd();eo=h(ya(),1);Fd();Cd();Ld();Md();Wd();Ud();qy=h(ya(),1),Oa=class{#s=0;#r=!1;#e=0;#o=-1;#f=0;#t;#i;#n;#p;#g;#c;#u;#d;#h;#a;#l;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:Qn.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.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:ka({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,Qn.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.#d}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.#d=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(!Aa())this.#i=eo.default.line;else if(t===void 0)this.#i=eo.default.dots;else if(t!=="default"&&eo.default[t])this.#i=eo.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}#w(t=this.#a,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#y(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.#w(this.#a,"-"),n=this.#y(this.#l,"-"),o=" ".repeat(this.#d)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of va(o).split(`
|
|
8
|
-
`))this.#e+=Math.max(1,Math.ceil(
|
|
9
|
-
`),this)}stop(){return this.#c?(clearInterval(this.#
|
|
10
|
-
`;return this.stop(),this.#n.write(d),this}}});function ja(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),mi.default.platform==="darwin"?Ky(e):mi.default.platform==="win32"?Zy(e):Yy(e)}var ue,$a,mi,Ht,Pa,on,Ky,Zy,Yy,Hd=x(()=>{"use strict";ue=h(require("path"),1),$a=h(require("os"),1),mi=h(require("process"),1),Ht=$a.default.homedir(),Pa=$a.default.tmpdir(),{env:on}=mi.default,Ky=e=>{let t=ue.default.join(Ht,"Library");return{data:ue.default.join(t,"Application Support",e),config:ue.default.join(t,"Preferences",e),cache:ue.default.join(t,"Caches",e),log:ue.default.join(t,"Logs",e),temp:ue.default.join(Pa,e)}},Zy=e=>{let t=on.APPDATA||ue.default.join(Ht,"AppData","Roaming"),r=on.LOCALAPPDATA||ue.default.join(Ht,"AppData","Local");return{data:ue.default.join(r,e,"Data"),config:ue.default.join(t,e,"Config"),cache:ue.default.join(r,e,"Cache"),log:ue.default.join(r,e,"Log"),temp:ue.default.join(Pa,e)}},Yy=e=>{let t=ue.default.basename(Ht);return{data:ue.default.join(on.XDG_DATA_HOME||ue.default.join(Ht,".local","share"),e),config:ue.default.join(on.XDG_CONFIG_HOME||ue.default.join(Ht,".config"),e),cache:ue.default.join(on.XDG_CACHE_HOME||ue.default.join(Ht,".cache"),e),log:ue.default.join(on.XDG_STATE_HOME||ue.default.join(Ht,".local","state"),e),temp:ue.default.join(Pa,t,e)}}});function gi(){return/[<>:"/\\|?*\u0000-\u001F]/g}function Jd(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var Gd=x(()=>{"use strict"});function to(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(gi().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(Qy,o),e=e.replace(gi(),o),e=e.replace(r,o),e=e.replace(eD,""),o.length>0&&(!(e[0]===".")&&e[0]==="."&&(e=o+e),e[e.length-1]==="."&&(e+=o)),e=Jd().test(e)?e+o:e;let i=typeof t.maxLength=="number"?t.maxLength:Xy;if(e.length>i){let s=e.lastIndexOf(".");if(s===-1)e=e.slice(0,i);else{let a=e.slice(0,s),c=e.slice(s);e=a.slice(0,Math.max(1,i-c.length))+c}}return e}var Xy,Qy,eD,Na=x(()=>{"use strict";Gd();Xy=100,Qy=/^\.+(\\|\/)|^\.+$/,eD=/\.+$/});var tD,zd=x(()=>{"use strict";tD=h(require("path"),1);Na()});var qd=x(()=>{"use strict";Na();zd()});var hi,Ba=x(()=>{"use strict";hi="webflow.json"});var yr,La=x(()=>{"use strict";yr=class extends Error{constructor(t){super(`Manifest config for key "${t}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Yd(e){Kd=e}function rD(){return process.env.CI==="true"||!process.stdout.isTTY}function G(){return Kd||rD()}function ft(){return!G()}function Xd(e){Zd=e}function Qd(){return Zd}var Kd,Zd,ve=x(()=>{"use strict";Kd=!1});function Dr(){let e=Qd();if(e){if(e.endsWith(".json"))return{path:e,isUserDefined:!0};try{if((0,ef.statSync)(e)?.isDirectory())return{path:(0,tf.join)(e,hi),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:`./${hi}`,isUserDefined:!1}}var ef,tf,Ma=x(()=>{"use strict";ef=require("fs"),tf=require("path");Ba();ve()});var rf,nD,oD,Wa,nf=x(()=>{"use strict";rf=h(require("ajv")),nD=new rf.default,oD={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"},camelCaseVariantNames:{type:"boolean"}},required:[]}}},Wa=nD.compile(oD)});function of(e){return e instanceof Error?e:new Error("Unknown error")}function V(){let{path:e}=Dr();if(!(0,wi.existsSync)(e))return{manifest:{},manifestPath:e};let t;try{t=(0,wi.readFileSync)(e,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${of(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: ${of(o).message}`)}if(!Wa(n)){let o=Wa.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:e}}var wi,ro=x(()=>{"use strict";wi=require("fs");Ma();nf()});function no(e,t){let r=e[t];if(!r)throw new yr(t);return r}var sf=x(()=>{"use strict";La()});function de(e){let t=V(),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 c=o[s];o[s]={...typeof c=="object"&&c!==null?c:{},...a}}}return(0,af.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var af,Ua=x(()=>{"use strict";af=require("fs");ro()});var ye=x(()=>{"use strict";Ba();La();ro();Ma();sf();Ua()});var yi=ra((cC,iD)=>{iD.exports={name:"@webflow/webflow-cli",version:"2.2.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:deploy":"bash regression/run-local.sh","test:regression":"jest --config regression/jest.config.js --testTimeout=420000","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/cosmic-deploy-contract":"^1.0.2","@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.5.16","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.5.16","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 Tt(){try{return yi().version}catch{return"unknown"}}function wt(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=oo.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");t=t.replace(o,"~/REDACTED_PII")}let n=oo.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 Va(e){if(e.stack)return wt(e.stack)}function Jt(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]=wt(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Jt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Jt(s):typeof s=="string"?wt(s):s):r[n]=o}return r}function lf(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${oo.default.type()} ${oo.default.release()}`}}function Ha(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`${e}-${t}`}var oo,io=x(()=>{"use strict";oo=h(require("os"))});var I,D,_e,sn,Ja,Ie,me,Di,Ga,br,$=x(()=>{"use strict";ie();I=P("\u2713"),D=At("\u2716"),_e=fe("\u2139"),sn=P("\u279C"),Ja=At("\u279C"),Ie="\u279C",me=oe("\u26A0"),Di=T("\u2732"),Ga=P("\u2732"),br=oe("[Deprecated]")});var Gt,za=x(()=>{"use strict";ye();io();b();ie();$();Gt=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 V(),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()?(l.info(`${_e} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(l.info(`${Ga} ${T("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),l.info(`${Ga} ${T("To opt out, run")} ${P("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:Tt()}}};await de(r),l.info(`${I} 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 W(e,t){let n={"User-Agent":`webflow-cli@${Tt()}`};return(0,cf.default)(e,{...t,headers:{...t?.headers,...n}})}var cf,Qe=x(()=>{"use strict";cf=h(require("node-fetch"));q()});var uf,df=x(()=>{"use strict";uf=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 qa,_,bi,an,so,Ka,ao,lo,ln,se=x(()=>{"use strict";df();qa=(e,t)=>(uf(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),_=process.env.WEBFLOW_API_HOST?qa("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",bi=process.env.WEBFLOW_CDN_API_HOST?qa("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",an=process.env.WEBFLOW_HOST?qa("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",so="wf-manifest.json",Ka="mf-manifest.json",ao="@webflow_renderer",lo="ssr-bundle.tar",ln="index.js"});var C,Za=x(()=>{"use strict";za();io();b();Qe();se();C=class e{config;consentManager;sessionId;platformInfo;constructor(t){this.config=t,this.consentManager=Gt.getInstance(),this.sessionId=Ha(),this.platformInfo=lf()}async sendEvent(t){try{if(!await this.isEnabled())return;let r=this.enrichEvent(t),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){l.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:Va(t),context:r,metadata:n?Jt(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?Jt(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=Gt.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:Tt(),command:this.config.suppressCommand?void 0: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=wt(r.message)),r.stack&&(r.stack=wt(r.stack)),r.context&&(r.context=wt(r.context)),r.metadata&&(r.metadata=Jt(r.metadata)),r.data&&(r.data=Jt(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 W(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||_,authToken:t.authToken,siteId:t.siteId,commandType:"devlink"})}static forExport(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"export"})}static forCloud(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,projectId:t.projectId,commandType:"cloud"})}static forExtension(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"extension"})}static forCodeLibraries(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"library"})}static forCms(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"cms"})}static forAssets(t){return new e({host:t.host||_,authToken:t.authToken,siteId:t.siteId,commandType:"assets"})}static forSites(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"sites"})}static forApps(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"apps"})}static forForms(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"forms"})}static forAppsEnvVars(t){return new e({host:t.host||_,authToken:t.authToken,commandType:"apps_env_vars",suppressCommand:!0})}}});var ff=x(()=>{"use strict"});function pf(e){return async(t,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,c=process.memoryUsage().heapUsed;return await e.sendPerformance(t,a,{memoryDelta:c-i,...n}),s}catch(s){let a=Date.now()-o;throw await e.sendPerformance(t,a,{failed:1,...n}),s}}}var q=x(()=>{"use strict";Za();za();ff();io();io()});var Xa,Ya,sD,It,Qa=x(()=>{"use strict";Xa=Symbol("webflow-cli-warn"),Ya=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]===
|
|
5
|
+
`,o)}while(n!==-1);return i+=e.slice(o),i}var _d=k(()=>{"use strict"});function eo(e){return zy(e)}var Cd,kd,ba,ln,Qn,Sd,cn,Gy,zy,va,Ky,qy,Ea,mi,Zy,Yy,wx,ht,Fa=k(()=>{"use strict";yd();Ed();_d();({stdout:Cd,stderr:kd}=vd),ba=Symbol("GENERATOR"),ln=Symbol("STYLER"),Qn=Symbol("IS_EMPTY"),Sd=["ansi","ansi","ansi256","ansi16m"],cn=Object.create(null),Gy=(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=Cd?Cd.level:0;e.level=t.level===void 0?r:t.level},zy=e=>{let t=(...r)=>r.join(" ");return Gy(t,e),Object.setPrototypeOf(t,eo.prototype),t};Object.setPrototypeOf(eo.prototype,Function.prototype);for(let[e,t]of Object.entries(gt))cn[e]={get(){let r=mi(this,Ea(t.open,t.close,this[ln]),this[Qn]);return Object.defineProperty(this,e,{value:r}),r}};cn.visible={get(){let e=mi(this,this[ln],!0);return Object.defineProperty(this,"visible",{value:e}),e}};va=(e,t,r,...n)=>e==="rgb"?t==="ansi16m"?gt[r].ansi16m(...n):t==="ansi256"?gt[r].ansi256(gt.rgbToAnsi256(...n)):gt[r].ansi(gt.rgbToAnsi(...n)):e==="hex"?va("rgb",t,r,...gt.hexToRgb(...n)):gt[r][e](...n),Ky=["rgb","hex","ansi256"];for(let e of Ky){cn[e]={get(){let{level:r}=this;return function(...n){let o=Ea(va(e,Sd[r],"color",...n),gt.color.close,this[ln]);return mi(this,o,this[Qn])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);cn[t]={get(){let{level:r}=this;return function(...n){let o=Ea(va(e,Sd[r],"bgColor",...n),gt.bgColor.close,this[ln]);return mi(this,o,this[Qn])}}}}qy=Object.defineProperties(()=>{},{...cn,level:{enumerable:!0,get(){return this[ba].level},set(e){this[ba].level=e}}}),Ea=(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}},mi=(e,t,r)=>{let n=(...o)=>Zy(n,o.length===1?""+o[0]:o.join(" "));return Object.setPrototypeOf(n,qy),n[ba]=e,n[ln]=t,n[Qn]=r,n},Zy=(e,t)=>{if(e.level<=0||!t)return e[Qn]?"":t;let r=e[ln];if(r===void 0)return t;let{openAll:n,closeAll:o}=r;if(t.includes("\x1B"))for(;r!==void 0;)t=Fd(t,r.close,r.open),r=r.parent;let i=t.indexOf(`
|
|
6
|
+
`);return i!==-1&&(t=xd(t,o,n,i)),n+t+o};Object.defineProperties(eo.prototype,cn);Yy=eo(),wx=eo({level:kd?kd.level:0}),ht=Yy});function xa(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))Xy(e,t,o,r);return eD(e,t),oD(e,t,n),e}var Xy,Qy,eD,tD,rD,nD,oD,Ad=k(()=>{"use strict";Xy=(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);!Qy(o,i)&&n||Object.defineProperty(e,r,i)},Qy=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)},eD=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},tD=(e,t)=>`/* Wrapped ${e}*/
|
|
7
|
+
${t}`,rD=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),nD=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),oD=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=tD.bind(null,n,t.toString());Object.defineProperty(o,"name",nD);let{writable:i,enumerable:s,configurable:a}=rD;Object.defineProperty(e,"toString",{value:o,writable:i,enumerable:s,configurable:a})}});var gi,Td,Id,Od=k(()=>{"use strict";Ad();gi=new WeakMap,Td=(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(gi.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 xa(i,e),gi.set(i,n),i};Td.callCount=e=>{if(!gi.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return gi.get(e)};Id=Td});var Er,Rd=k(()=>{"use strict";Er=[];Er.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Er.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Er.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});var hi,_a,Ca,iD,ka,wi,sD,Sa,Aa,Ta,$d,xx,_x,Pd=k(()=>{"use strict";Rd();hi=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",_a=Symbol.for("signal-exit emitter"),Ca=globalThis,iD=Object.defineProperty.bind(Object),ka=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ca[_a])return Ca[_a];iD(Ca,_a,{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}},wi=class{},sD=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Sa=class extends wi{onExit(){return()=>{}}load(){}unload(){}},Aa=class extends wi{#s=Ta.platform==="win32"?"SIGINT":"SIGHUP";#r=new ka;#e;#o;#p;#t={};#i=!1;constructor(t){super(),this.#e=t,this.#t={};for(let r of Er)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.#p=t.reallyExit,this.#o=t.emit}onExit(t,r){if(!hi(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 Er)try{let r=this.#t[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#f(t,...r),this.#e.reallyExit=t=>this.#n(t)}}unload(){this.#i&&(this.#i=!1,Er.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.#p,this.#r.count-=1)}#n(t){return hi(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#p.call(this.#e,this.#e.exitCode)):0}#f(t,...r){let n=this.#o;if(t==="exit"&&hi(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)}},Ta=globalThis.process,{onExit:$d,load:xx,unload:_x}=sD(hi(Ta)?new Aa(Ta):new Sa)});var to,jd,aD,Nd,Ld=k(()=>{"use strict";to=h(require("process"),1);Od();Pd();jd=to.default.stderr.isTTY?to.default.stderr:to.default.stdout.isTTY?to.default.stdout:void 0,aD=jd?Id(()=>{$d(()=>{jd.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},Nd=aD});var Ia,yi,un,Oa,Bd=k(()=>{"use strict";Ia=h(require("process"),1);Ld();yi=!1,un={};un.show=(e=Ia.default.stderr)=>{e.isTTY&&(yi=!1,e.write("\x1B[?25h"))};un.hide=(e=Ia.default.stderr)=>{e.isTTY&&(Nd(),yi=!0,e.write("\x1B[?25l"))};un.toggle=(e,t)=>{e!==void 0&&(yi=e),yi?un.show(t):un.hide(t)};Oa=un});var Md=wa((Ox,lD)=>{lD.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 Ra=wa((Rx,Ud)=>{"use strict";var Di=Object.assign({},Md()),Wd=Object.keys(Di);Object.defineProperty(Di,"random",{get(){let e=Math.floor(Math.random()*Wd.length),t=Wd[e];return Di[t]}});Ud.exports=Di});function $a(){return nt.default.platform!=="win32"?nt.default.env.TERM!=="linux":!!nt.default.env.CI||!!nt.default.env.WT_SESSION||!!nt.default.env.TERMINUS_SUBLIME||nt.default.env.ConEmuTask==="{cmd::Cmder}"||nt.default.env.TERM_PROGRAM==="Terminus-Sublime"||nt.default.env.TERM_PROGRAM==="vscode"||nt.default.env.TERM==="xterm-256color"||nt.default.env.TERM==="alacritty"||nt.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var nt,Vd=k(()=>{"use strict";nt=h(require("process"),1)});var cD,uD,dD,ro,Hd=k(()=>{"use strict";Fa();Vd();cD={info:ht.blue("\u2139"),success:ht.green("\u2714"),warning:ht.yellow("\u26A0"),error:ht.red("\u2716")},uD={info:ht.blue("i"),success:ht.green("\u221A"),warning:ht.yellow("\u203C"),error:ht.red("\xD7")},dD=$a()?cD:uD,ro=dD});function Pa({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 Jd=k(()=>{"use strict"});function ja(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(pD,"")}var pD,Gd=k(()=>{"use strict";Jd();pD=Pa()});function Na({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 zd=k(()=>{"use strict"});function La(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return!e.includes("\x1B")&&!e.includes("\x9B")?e:e.replace(fD,"")}var fD,Kd=k(()=>{"use strict";zd();fD=Na()});var bi,vi,Ba,Ma,no,qd=k(()=>{"use strict";bi=[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],vi=[12288,12288,65281,65376,65504,65510],Ba=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Ma=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],no=[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 Ei,Zd=k(()=>{"use strict";Ei=(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 ED(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(Yd>=o&&Yd<=i)return[o,i];i-o>r-t&&(t=o,r=i)}return[t,r]}var mD,gD,hD,wD,Kx,qx,Zx,Yx,yD,DD,Yd,bD,vD,Xd,Qd,ep,tp=k(()=>{"use strict";qd();Zd();mD=bi[0],gD=bi.at(-1),hD=vi[0],wD=vi.at(-1),Kx=Ba[0],qx=Ba.at(-1),Zx=Ma[0],Yx=Ma.at(-1),yD=no[0],DD=no.at(-1),Yd=19968,[bD,vD]=ED(no);Xd=e=>e<mD||e>gD?!1:Ei(bi,e),Qd=e=>e<hD||e>wD?!1:Ei(vi,e),ep=e=>e>=bD&&e<=vD?!0:e<yD||e>DD?!1:Ei(no,e)});function FD(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function rp(e,{ambiguousAsWide:t=!1}={}){return FD(e),Qd(e)||ep(e)||t&&Xd(e)?2:1}var np=k(()=>{"use strict";tp()});var op,ip=k(()=>{"use strict";op=()=>/[#*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 Wa(e,t={}){if(typeof e!="string"||e.length===0)return 0;let{ambiguousIsNarrow:r=!0,countAnsiEscapeCodes:n=!1}=t;if(n||(e=La(e)),e.length===0)return 0;let o=0,i={ambiguousAsWide:!r};for(let{segment:s}of xD.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)&&!_D.test(s)){if(op().test(s)){o+=2;continue}o+=rp(a,i)}}return o}var xD,_D,sp=k(()=>{"use strict";Kd();np();ip();xD=new Intl.Segmenter,_D=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u")});function Ua({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}var ap=k(()=>{"use strict"});function Ha(){let{env:e}=Va.default,{TERM:t,TERM_PROGRAM:r}=e;return Va.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 Va,lp=k(()=>{"use strict";Va=h(require("process"),1)});var wt,CD,Ja,kD,Ga,cp=k(()=>{"use strict";wt=h(require("process"),1),CD=3,Ja=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(){wt.default.platform==="win32"||!wt.default.stdin.isTTY||(wt.default.stdin.setRawMode(!0),wt.default.stdin.on("data",this.#o),wt.default.stdin.resume())}#e(){wt.default.stdin.isTTY&&(wt.default.stdin.off("data",this.#o),wt.default.stdin.pause(),wt.default.stdin.setRawMode(!1))}#o(t){t[0]===CD&&wt.default.emit("SIGINT")}},kD=new Ja,Ga=kD});function Ka(e){return new za(e)}var oo,io,SD,za,up=k(()=>{"use strict";oo=h(require("process"),1);Fa();Bd();io=h(Ra(),1);Hd();Gd();sp();ap();lp();cp();SD=h(Ra(),1),za=class{#s=0;#r=!1;#e=0;#o=-1;#p=0;#t;#i;#n;#f;#g;#c;#u;#d;#h;#a;#l;color;constructor(t){typeof t=="string"&&(t={text:t}),this.#t={color:"cyan",stream:oo.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.#c=typeof this.#t.isEnabled=="boolean"?this.#t.isEnabled:Ua({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,oo.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.#d}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.#d=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(!Ha())this.#i=io.default.line;else if(t===void 0)this.#i=io.default.dots;else if(t!=="default"&&io.default[t])this.#i=io.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.#f!==void 0}#w(t=this.#a,r=" "){return typeof t=="string"&&t!==""?t+r:typeof t=="function"?t()+r:""}#y(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.#w(this.#a,"-"),n=this.#y(this.#l,"-"),o=" ".repeat(this.#d)+r+"--"+this.#h+"--"+n;this.#e=0;for(let i of ja(o).split(`
|
|
8
|
+
`))this.#e+=Math.max(1,Math.ceil(Wa(i,{countAnsiEscapeCodes:!0})/t))}get isEnabled(){return this.#c&&!this.#u}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#c=t}get isSilent(){return this.#u}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#u=t}frame(){let t=Date.now();(this.#o===-1||t-this.#p>=this.interval)&&(this.#o=++this.#o%this.#i.frames.length,this.#p=t);let{frames:r}=this.#i,n=r[this.#o];this.color&&(n=ht[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.#c||!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.#d||this.lastIndent!==this.#d)&&this.#n.cursorTo(this.#d),this.lastIndent=this.#d,this.#s=0,this}render(){return this.#u?this:(this.clear(),this.#n.write(this.frame()),this.#s=this.#e,this)}start(t){return t&&(this.text=t),this.#u?this:this.#c?this.isSpinning?this:(this.#t.hideCursor&&Oa.hide(this.#n),this.#t.discardStdin&&oo.default.stdin.isTTY&&(this.#r=!0,Ga.start()),this.render(),this.#f=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#n.write(`- ${this.text}
|
|
9
|
+
`),this)}stop(){return this.#c?(clearInterval(this.#f),this.#f=void 0,this.#o=0,this.clear(),this.#t.hideCursor&&Oa.show(this.#n),this.#t.discardStdin&&oo.default.stdin.isTTY&&this.#r&&(Ga.stop(),this.#r=!1),this):this}succeed(t){return this.stopAndPersist({symbol:ro.success,text:t})}fail(t){return this.stopAndPersist({symbol:ro.error,text:t})}warn(t){return this.stopAndPersist({symbol:ro.warning,text:t})}info(t){return this.stopAndPersist({symbol:ro.info,text:t})}stopAndPersist(t={}){if(this.#u)return this;let r=t.prefixText??this.#a,n=this.#w(r," "),o=t.symbol??" ",i=t.text??this.text,a=typeof i=="string"?(o?" ":"")+i:"",c=t.suffixText??this.#l,u=this.#y(c," "),p=n+o+a+u+`
|
|
10
|
+
`;return this.stop(),this.#n.write(p),this}}});function Ya(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),Fi.default.platform==="darwin"?AD(e):Fi.default.platform==="win32"?TD(e):ID(e)}var de,qa,Fi,Zt,Za,dn,AD,TD,ID,dp=k(()=>{"use strict";de=h(require("path"),1),qa=h(require("os"),1),Fi=h(require("process"),1),Zt=qa.default.homedir(),Za=qa.default.tmpdir(),{env:dn}=Fi.default,AD=e=>{let t=de.default.join(Zt,"Library");return{data:de.default.join(t,"Application Support",e),config:de.default.join(t,"Preferences",e),cache:de.default.join(t,"Caches",e),log:de.default.join(t,"Logs",e),temp:de.default.join(Za,e)}},TD=e=>{let t=dn.APPDATA||de.default.join(Zt,"AppData","Roaming"),r=dn.LOCALAPPDATA||de.default.join(Zt,"AppData","Local");return{data:de.default.join(r,e,"Data"),config:de.default.join(t,e,"Config"),cache:de.default.join(r,e,"Cache"),log:de.default.join(r,e,"Log"),temp:de.default.join(Za,e)}},ID=e=>{let t=de.default.basename(Zt);return{data:de.default.join(dn.XDG_DATA_HOME||de.default.join(Zt,".local","share"),e),config:de.default.join(dn.XDG_CONFIG_HOME||de.default.join(Zt,".config"),e),cache:de.default.join(dn.XDG_CACHE_HOME||de.default.join(Zt,".cache"),e),log:de.default.join(dn.XDG_STATE_HOME||de.default.join(Zt,".local","state"),e),temp:de.default.join(Za,t,e)}}});function xi(){return/[<>:"/\\|?*\u0000-\u001F]/g}function pp(){return/^(con|prn|aux|nul|com\d|lpt\d)$/i}var fp=k(()=>{"use strict"});function so(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(xi().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(RD,o),e=e.replace(xi(),o),e=e.replace(r,o),e=e.replace($D,""),o.length>0&&(!(e[0]===".")&&e[0]==="."&&(e=o+e),e[e.length-1]==="."&&(e+=o)),e=pp().test(e)?e+o:e;let i=typeof t.maxLength=="number"?t.maxLength:OD;if(e.length>i){let s=e.lastIndexOf(".");if(s===-1)e=e.slice(0,i);else{let a=e.slice(0,s),c=e.slice(s);e=a.slice(0,Math.max(1,i-c.length))+c}}return e}var OD,RD,$D,Xa=k(()=>{"use strict";fp();OD=100,RD=/^\.+(\\|\/)|^\.+$/,$D=/\.+$/});var PD,mp=k(()=>{"use strict";PD=h(require("path"),1);Xa()});var gp=k(()=>{"use strict";Xa();mp()});var _i,Qa=k(()=>{"use strict";_i="webflow.json"});var Fr,el=k(()=>{"use strict";Fr=class extends Error{constructor(t){super(`Manifest config for key "${t}" not found`),this.name="ManifestConfigKeyNotFoundError"}}});function Dp(e){hp=e}function jD(){return process.env.CI==="true"||!process.stdout.isTTY}function H(){return hp||jD()}function yt(){return!H()}function bp(e){wp=e}function vp(){return wp}function Ep(e){yp=e}function Fp(){return yp}var hp,wp,yp,be=k(()=>{"use strict";hp=!1,wp=!1});function xr(){let e=Fp();if(e){if(e.endsWith(".json"))return{path:e,isUserDefined:!0};try{if((0,xp.statSync)(e)?.isDirectory())return{path:(0,_p.join)(e,_i),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:`./${_i}`,isUserDefined:!1}}var xp,_p,tl=k(()=>{"use strict";xp=require("fs"),_p=require("path");Qa();be()});var Cp,ND,LD,rl,kp=k(()=>{"use strict";Cp=h(require("ajv")),ND=new Cp.default,LD={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"},camelCaseVariantNames:{type:"boolean"}},required:[]}}},rl=ND.compile(LD)});function Sp(e){return e instanceof Error?e:new Error("Unknown error")}function J(){let{path:e}=xr();if(!(0,Ci.existsSync)(e))return{manifest:{},manifestPath:e};let t;try{t=(0,Ci.readFileSync)(e,"utf8")}catch(o){throw new Error(`Failed to read manifest file: ${Sp(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: ${Sp(o).message}`)}if(!rl(n)){let o=rl.errors?.map(i=>`${i.instancePath} ${i.message}`).join(", ")||"Unknown error";throw new Error(`Invalid manifest: ${o}.`)}return{manifest:n,manifestPath:e}}var Ci,ao=k(()=>{"use strict";Ci=require("fs");tl();kp()});function lo(e,t){let r=e[t];if(!r)throw new Fr(t);return r}var Ap=k(()=>{"use strict";el()});function pe(e){let t=J(),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 c=o[s];o[s]={...typeof c=="object"&&c!==null?c:{},...a}}}return(0,Tp.writeFileSync)(n,JSON.stringify(o,null,2),"utf-8"),o}var Tp,nl=k(()=>{"use strict";Tp=require("fs");ao()});var ve=k(()=>{"use strict";Qa();el();ao();tl();Ap();nl()});var ki=wa((Z_,BD)=>{BD.exports={name:"@webflow/webflow-cli",version:"2.3.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:deploy":"bash regression/run-local.sh","test:regression":"jest --config regression/jest.config.js --testTimeout=420000","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":"2.5.1","@rspack/core":"^1.7.8","@webflow/cosmic-deploy-contract":"^1.0.2","@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.5.16","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:{"@module-federation/sdk":"2.5.1","@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:"^7.0.6","eslint-config-custom":"*",express:"^4.18.1",jest:"^29.3.1",nock:"13.3.1",tar:"^7.5.16","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 jt(){try{return ki().version}catch{return"unknown"}}function Ft(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=co.default.homedir();if(r){let o=new RegExp(r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");t=t.replace(o,"~/REDACTED_PII")}let n=co.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 ol(e){if(e.stack)return Ft(e.stack)}function Yt(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]=Ft(o):typeof o=="object"&&o!==null&&!Array.isArray(o)?r[n]=Yt(o):Array.isArray(o)?r[n]=o.map(s=>typeof s=="object"&&s!==null?Yt(s):typeof s=="string"?Ft(s):s):r[n]=o}return r}function Ip(){return{platform:process.platform,nodeVersion:process.version,arch:process.arch,os:`${co.default.type()} ${co.default.release()}`}}function il(){let e=Date.now().toString(36),t=Math.random().toString(36).substring(2,8);return`${e}-${t}`}var co,uo=k(()=>{"use strict";co=h(require("os"))});var O,D,Oe,pn,sl,Pe,ge,Si,al,_r,$=k(()=>{"use strict";ie();O=P("\u2713"),D=Pt("\u2716"),Oe=fe("\u2139"),pn=P("\u279C"),sl=Pt("\u279C"),Pe="\u279C",ge=ne("\u26A0"),Si=T("\u2732"),al=P("\u2732"),_r=ne("[Deprecated]")});var Xt,ll=k(()=>{"use strict";ve();uo();v();ie();$();Xt=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 J(),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()?(l.info(`${Oe} Telemetry is disabled because the DO_NOT_TRACK environment variable is set.`),!1):(l.info(`${al} ${T("Telemetry is enabled. We collect usage data and error reports to improve the Webflow CLI.")}`),l.info(`${al} ${T("To opt out, run")} ${P("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:jt()}}};await pe(r),l.info(`${O} 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 j(e,t){let n={"User-Agent":`webflow-cli@${jt()}`};return(0,Op.default)(e,{...t,headers:{...t?.headers,...n}})}var Op,ot=k(()=>{"use strict";Op=h(require("node-fetch"));W()});var Rp,$p=k(()=>{"use strict";Rp=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 cl,F,Ai,fn,po,ul,fo,mo,mn,se=k(()=>{"use strict";$p();cl=(e,t)=>(Rp(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),F=process.env.WEBFLOW_API_HOST?cl("WEBFLOW_API_HOST",process.env.WEBFLOW_API_HOST):"https://api.webflow.com",Ai=process.env.WEBFLOW_CDN_API_HOST?cl("WEBFLOW_CDN_API_HOST",process.env.WEBFLOW_CDN_API_HOST):"https://api-cdn.webflow.com",fn=process.env.WEBFLOW_HOST?cl("WEBFLOW_HOST",process.env.WEBFLOW_HOST):"https://webflow.com",po="wf-manifest.json",ul="mf-manifest.json",fo="@webflow_renderer",mo="ssr-bundle.tar",mn="index.js"});var b,dl=k(()=>{"use strict";ll();uo();v();ot();se();b=class e{config;consentManager;sessionId;platformInfo;constructor(t){this.config=t,this.consentManager=Xt.getInstance(),this.sessionId=il(),this.platformInfo=Ip()}async sendEvent(t){try{if(!await this.isEnabled())return;let r=this.enrichEvent(t),n=this.sanitizeEvent(r);await this.transmitEvent(n)}catch(r){l.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:ol(t),context:r,metadata:n?Yt(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?Yt(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=Xt.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:jt(),command:this.config.suppressCommand?void 0: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=Ft(r.message)),r.stack&&(r.stack=Ft(r.stack)),r.context&&(r.context=Ft(r.context)),r.metadata&&(r.metadata=Yt(r.metadata)),r.data&&(r.data=Yt(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 j(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||F,authToken:t.authToken,siteId:t.siteId,commandType:"devlink"})}static forExport(t){return new e({host:t.host||F,authToken:t.authToken,siteId:t.siteId,commandType:"export"})}static forCloud(t){return new e({host:t.host||F,authToken:t.authToken,siteId:t.siteId,projectId:t.projectId,commandType:"cloud"})}static forExtension(t){return new e({host:t.host||F,authToken:t.authToken,siteId:t.siteId,commandType:"extension"})}static forCodeLibraries(t){return new e({host:t.host||F,authToken:t.authToken,commandType:"library"})}static forCms(t){return new e({host:t.host||F,authToken:t.authToken,siteId:t.siteId,commandType:"cms"})}static forAssets(t){return new e({host:t.host||F,authToken:t.authToken,siteId:t.siteId,commandType:"assets"})}static forSites(t){return new e({host:t.host||F,authToken:t.authToken,commandType:"sites"})}static forApps(t){return new e({host:t.host||F,authToken:t.authToken,commandType:"apps"})}static forForms(t){return new e({host:t.host||F,authToken:t.authToken,commandType:"forms"})}static forAppsEnvVars(t){return new e({host:t.host||F,authToken:t.authToken,commandType:"apps_env_vars",suppressCommand:!0})}}});var Pp=k(()=>{"use strict"});function jp(e){return async(t,r,n)=>{let o=Date.now(),i=process.memoryUsage().heapUsed;try{let s=await r(),a=Date.now()-o,c=process.memoryUsage().heapUsed;return await e.sendPerformance(t,a,{memoryDelta:c-i,...n}),s}catch(s){let a=Date.now()-o;throw await e.sendPerformance(t,a,{failed:1,...n}),s}}}var W=k(()=>{"use strict";dl();ll();Pp();uo();uo()});var fl,pl,MD,Nt,ml=k(()=>{"use strict";fl=Symbol("webflow-cli-warn"),pl=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]===fl){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
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
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("")})}},
|
|
17
|
-
`)),
|
|
18
|
-
${D} ${T("An error occurred. See logs for more information:")}`),console.info(` ${
|
|
19
|
-
${
|
|
16
|
+
`).slice(0,3).forEach(n=>{console.log(` ${n}`)})),console.log("")})}},MD=new pl,Nt=MD});function it(e){return e.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,"")}function Bp(e,t){if(!e)return t;let r=parseInt(e,10);return isNaN(r)||r<=0?t:r}function Qt(e){ho.push(Ft(e)),ho.length>VD&&ho.shift()}function Mp(e){hl=e}function Np(e){return Qt(`DEBUG: ${e}`),e}function JD(e){return Qt(`INFO: ${e}`),e}function GD(e){return Qt(`WARN: ${e}`),e}function zD(e,t){let r=e instanceof Error?e.stack||e.message:e,n=t?.prefix?`${t.prefix} `:"";Qt(`ERROR: ${n}${r}`),wl=!0;let o=e instanceof Error?e.message:String(e);return Pt(`${n}${o}`)}function KD(e){return Qt(`SUCCESS: ${e}`),P(e)}function YD(e){let t=Ka({text:`${e}...`,indent:1}).start(),r=!1,n=o=>i=>{if(Qt(`${qD[o]||"INFO"}: ${i||e}`),o==="fail"&&(wl=!0),o==="update"){t.text=i||e;return}r||(r=!0,t.stopAndPersist({symbol:ZD[o],text:T(i||e)}))};return{succeed:n("succeed"),fail:n("fail"),warn:n("warn"),info:n("info"),neutral:n("neutral"),update:n("update"),stop:()=>{r||(r=!0,t.stop())}}}function XD(){let e=gn.default.readdirSync(Ye).filter(t=>t.endsWith(".log")).map(t=>({name:t,time:gn.default.statSync(Ti.default.join(Ye,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);for(;e.length>=UD;)try{let t=e.pop();if(!t)break;gn.default.removeSync(Ti.default.join(Ye,t.name))}catch{}}function yl(e){try{let t=process.argv.slice(2).join(" ");if(/^(log|library\s+log)(\s|$)/.test(t))return;gn.default.ensureDirSync(Ye),XD(),ho.unshift(`CLI Version: ${jt()}`,`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()}`,...hl?[`Sync ID: ${hl}`]:[],"");let r=ho.map(it);gn.default.writeFileSync(gl,r.join(`
|
|
17
|
+
`)),wl&&(console.info(`
|
|
18
|
+
${D} ${T("An error occurred. See logs for more information:")}`),console.info(` ${sl} Latest log: ${gl}`),console.info(` ${sl} All logs: ${Ye}`)),(process.env.DEBUG||process.argv.includes("--verbose"))&&(console.info(`
|
|
19
|
+
${O} Command completed successfully. Logs written to:`),console.info(` ${pn} Latest log: ${gl}`),console.info(` ${pn} All logs: ${Ye}`))}catch(t){console.error("Failed to write logs:",t)}}var gn,Ti,CC,WD,Ye,UD,VD,HD,gl,ho,wl,hl,qD,ZD,hn,Lp,go,QD,l,v=k(()=>{"use strict";gn=h(require("fs-extra")),Ti=h(require("path")),CC=require("source-map-support/register");up();dp();gp();W();ie();ml();$();WD=Ya("webflow-cli"),Ye=WD.log;UD=Bp(process.env.MAX_PERSISTED_LOGS,50),VD=Bp(process.env.MAX_IN_MEMORY_LOGS,1e3),HD=`${so(new Date().toISOString(),{replacement:"_"}).replace(/\./g,"_")}-debug.log`,gl=Ti.default.join(Ye,HD);ho=[],wl=!1;qD={succeed:"INFO",fail:"ERROR",warn:"WARN",info:"INFO",neutral:"INFO",update:"INFO"},ZD={succeed:O,fail:D,warn:ge,info:Oe,neutral:" ",update:void 0};hn=!1;process.on("uncaughtException",e=>{hn||(hn=!0,Qt(`UNCAUGHT EXCEPTION: ${e?.stack}`),yl(1)),Nt.displayGrouped(),Nt.stop(),process.exit(1)});process.on("unhandledRejection",e=>{hn||(hn=!0,Qt(`UNHANDLED REJECTION: ${e instanceof Error?e.stack:String(e)}`),yl(1)),Nt.displayGrouped(),Nt.stop(),process.exit(1)});process.on("exit",e=>{hn||(hn=!0,yl(e))});Lp=!0,go=e=>{let t=e.split(`
|
|
20
20
|
`).map(r=>r.length?` ${r}`:r).join(`
|
|
21
|
-
`);return
|
|
22
|
-
`+t):t},
|
|
23
|
-
`);try{return await e()}catch(t){throw t instanceof Error&&
|
|
24
|
-
`:`${
|
|
25
|
-
`,answer:e=>` ${T(e)}`}},
|
|
26
|
-
`,answer:e=>T(e)}},
|
|
27
|
-
`:
|
|
21
|
+
`);return Lp?(Lp=!1,`
|
|
22
|
+
`+t):t},QD={debug:e=>{let t=Np(e);process.env.DEBUG&&console.debug(go(t))},trace:e=>{let t=Np(e);process.env.DEBUG&&console.debug(t)},dir:e=>console.dir(e,{depth:100}),info:e=>console.info(go(JD(e))),warn:e=>console.warn(go(GD(e)),fl),error:(e,t)=>{console.error(go(zD(e,t)))},success:e=>console.log(go(KD(e))),spinner:YD},l=QD});async function wn(e){process.stdout.write(`
|
|
23
|
+
`);try{return await e()}catch(t){throw t instanceof Error&&sb.test(t.message)&&(l.debug(t.message),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&process.stdin.setRawMode(!1),process.exit(130)),t}}async function Ne(e){return H()?e.default??!1:wn(()=>je.confirm({...e,theme:tb}))}async function Ce(e){if(H())return"default"in e?e.default:null;let t=e.choices.map(r=>{if(!r||typeof r!="object"||je.Separator.isSeparator(r)||r.type==="separator")return r;let n=r.name??String(r.value??"");return{...r,name:` ${T(n)}`}});return wn(()=>je.select({...e,choices:t,theme:nb}))}async function ke(e){return H()?e.default!==void 0?await e.validate?.(e.default)!==!0?null:e.default:null:wn(()=>je.input({...e,theme:Vp}))}async function Gp(e){return H()?null:wn(()=>je.password({...e,theme:Vp}))}async function Oi(e){if(H()){let r=[];return await e.validate?.(r)!==!0?null:r}let t=e.choices.map(r=>{if(!r||typeof r!="object"||r.type==="separator"||je.Separator.isSeparator(r))return r;let n=r.name??String(r.value??"");return{...r,name:` ${T(n)}`}});return wn(()=>je.checkbox({...e,choices:t,theme:ob}))}async function Ri(e){if(H())return"default"in e?e.default:null;let t=(async(r,n)=>(await e.source(r,n)).map(i=>!i||typeof i!="object"||je.Separator.isSeparator(i)?i:{...i,name:` ${T(i.name??"")}`}));return wn(()=>je.search({...e,source:t,theme:ib}))}var je,tb,Vp,wo,Hp,vl,El,Jp,rb,nb,ob,ib,sb,Se=k(()=>{"use strict";je=h(require("@inquirer/prompts"));be();v();ie();tb={prefix:` ${fe("?")}`,style:{message:(e,t)=>t==="done"?`${Q(e)}
|
|
24
|
+
`:`${Q(e)}
|
|
25
|
+
`,answer:e=>` ${T(e)}`}},Vp={prefix:` ${fe("?")}`,style:{message:e=>`${Q(e)}
|
|
26
|
+
`,answer:e=>T(e)}},wo=2,Hp=1,vl=(e,t)=>t==="done"?`${Q(e)}
|
|
27
|
+
`:Q(e),El=e=>` ${T(it(e).trim())}`,Jp=e=>{let t=it(e),r=t.slice(0,wo),n=t.slice(wo+1+Hp);return fe(`${r} ${n}`)},rb=e=>{let t=it(e),r=t.slice(0,wo),n=t[wo+2],o=t.slice(wo+3+Hp);return fe(`${r} ${n} ${o}`)},nb={prefix:` ${fe("?")}`,style:{message:vl,answer:El,highlight:Jp,keysHelpTip:e=>` ${e.map(([t,r])=>`${T(t)} ${T(r)}`).join(" ")}`},icon:{cursor:` ${fe("\u23F5")}`}},ob={prefix:` ${fe("?")}`,style:{message:vl,answer:El,highlight:rb,keysHelpTip:e=>` ${e.map(([t,r])=>`${T(t)} ${T(r)}`).join(" ")}`},icon:{cursor:` ${fe("\u23F5")}`,checked:` ${P("\u25C9")}`,unchecked:` ${T("\u25EF")}`}},ib={prefix:` ${fe("?")}`,style:{message:vl,answer:El,highlight:Jp,searchTerm:e=>fe(e)},icon:{cursor:` ${fe("\u23F5")}`}},sb=/SIGINT/i});function st(){return!0}var Ar=k(()=>{"use strict"});function Lt({apiToken:e,siteId:t,directory:r}){let n=Do.resolve(r?Do.join(r,".env"):Do.join(process.cwd(),".env"));r&&!Tr.existsSync(r)&&Tr.mkdirSync(r,{recursive:!0}),Tr.existsSync(n)||Tr.writeFileSync(n,`# automatically generated at ${new Date().toISOString()}`,{encoding:"utf8"}),$i.default.config({path:n,quiet:!0}),e&&$i.default.set("WEBFLOW_API_TOKEN",e,{path:n,encrypt:!1}),t&&$i.default.set("WEBFLOW_SITE_ID",t,{path:n,encrypt:!1})}var Tr,Do,$i,Xp=k(()=>{"use strict";Tr=h(require("fs")),Do=h(require("path")),$i=h(require("@dotenvx/dotenvx"))});var d,x=k(()=>{"use strict";d=class e extends Error{prefix;skipLogging;isUserError;missingFlag;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),this.missingFlag=r?.missingFlag,t instanceof Error?(this.cause=t,this.stack=t.stack):Error.captureStackTrace&&Error.captureStackTrace(this,e)}}});function rr(){let e=ub();return Ir.default.join(e,cb)}function ub(){if(process.platform==="win32"){let r=process.env.APPDATA??Ir.default.join(xl.default.homedir(),"AppData","Roaming");return Ir.default.join(r,"webflow")}let t=process.env.XDG_CONFIG_HOME??Ir.default.join(xl.default.homedir(),".config");return Ir.default.join(t,"webflow")}function bo(){let e=rr();try{if(!tr.default.existsSync(e))return null;let t=tr.default.readFileSync(e,"utf8");return JSON.parse(t)}catch{return null}}function _l(e){let t=rr(),r=Ir.default.dirname(t);tr.default.existsSync(r)||tr.default.mkdirSync(r,{recursive:!0,mode:448}),tr.default.writeFileSync(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384})}function Cl(){let e=rr();try{tr.default.existsSync(e)&&tr.default.unlinkSync(e)}catch{}}var tr,xl,Ir,cb,kl=k(()=>{"use strict";tr=h(require("fs")),xl=h(require("os")),Ir=h(require("path")),cb="auth.json"});var vo,Sl=k(()=>{"use strict";se();vo={serverUrl:fn,timeoutMs:300*1e3}});var Qp,ef,tf,rf,db,nf,pb,of,sf=k(()=>{"use strict";Qp=require("crypto"),ef=h(require("open"));Sl();v();ot();tf=e=>{let t=new Uint8Array(e);return Qp.webcrypto.getRandomValues(t),Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")},rf=({pollId:e,clientId:t,scope:r})=>`${vo.serverUrl}/oauth/webflow/initiate?pollId=${e}&clientId=${t}&scope=${encodeURIComponent(r.join(" "))}`,db=e=>`${vo.serverUrl}/oauth/webflow/poll?pollId=${e}`,nf=async e=>{let t=l.spinner("Browser opened for authentication");try{await new Promise(r=>setTimeout(r,3e3)),await(0,ef.default)(e),t.succeed()}catch{t.fail(),l.warn(`Could not automatically open browser. Please open this URL manually: ${e}`)}},pb=async e=>{let t=db(e),r=await j(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()},of=(e,t)=>{let r=l.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 pb(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 lf(){return[...fb,...st()?["cloud_apps:read"]:[]].sort()}function Eo(){if(process.env.WEBFLOW_API_TOKEN)return process.env.WEBFLOW_API_TOKEN;let e=bo();if(e?.accessToken)return e.accessToken;let t=process.env.WEBFLOW_WORKSPACE_API_TOKEN??process.env.WEBFLOW_SITE_API_TOKEN??null;return t&&!af&&(af=!0,l.warn(`${ge} WEBFLOW_SITE_API_TOKEN / WEBFLOW_WORKSPACE_API_TOKEN are deprecated. Please use WEBFLOW_API_TOKEN instead. Run ${P("webflow auth login --force")} to update your .env file.`)),t}async function E(e){if(e?.apiToken&&!e.force)return e.apiToken;if(!e?.force){let o=Eo();if(o)return o}if(H())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 t=
|
|
30
|
-
`})}}async function
|
|
29
|
+
2. Set it as the WEBFLOW_API_TOKEN environment variable in your CI/CD pipeline`);let t=tf(16),r=mb(),n=lf();try{let o=rf({pollId:t,clientId:r,scope:n});await nf(o);let i=await of(t,vo.timeoutMs);return _l({accessToken:i,scopes:n,createdAt:new Date().toISOString()}),l.info(`${O} Credentials saved: ${rr()}`),i}catch(o){throw new d(o)}}function mb(){return"fbab9abdbeeb35bb2554a1b83b8bd060d719f22eca26ff9119b87608c87c0074"}var fb,af,Al=k(()=>{"use strict";be();v();$();x();kl();Sl();sf();ie();Ar();fb=["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"];af=!1});function Fo(e){return process.env.WEBFLOW_SITE_ID??e.siteId??null}async function xo(e){try{let r=await new cf.WebflowClient({accessToken:e,environment:{base:`${F}/v2`,dataApi:`${F}/v2`,contentDeliveryApi:`${Ai}/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 Tl(e){let t=e.map(n=>({name:`${n.displayName} (${n.shortName})`,value:n})),r=await Ri({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 l.warn(`Auto fallback to first site: ${e[0].displayName}`),e[0]}return r}var cf,Pi=k(()=>{"use strict";cf=require("webflow-api");Se();v();se();se();x()});var Or,nr,Il=k(()=>{"use strict";x();Or=class extends d{constructor(t){super(t),this.name="NoWebflowSitesError"}},nr=class extends d{constructor(t){super(t),this.name="NoWebflowWorkspacesError"}}});async function Ee(e,t){let r=t?.site??Fo(e);if(H()&&!r)throw new d(`No site ID configured for this project.
|
|
31
31
|
Run ${P("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
|
|
33
|
-
${n} ${t.content}`)}}var
|
|
34
|
-
`+D})}throw new
|
|
35
|
-
${
|
|
36
|
-
`);return}let{code:c}=await
|
|
37
|
-
Would you like to update it?`,default:!1})){r=l.spinner("Updating");let
|
|
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
|
|
32
|
+
or provide --site and --api-token when running a CLI command`);let n=await E({apiToken:t?.apiToken,force:t?.force});if(!r||t?.force){let o=await xo(n);if(o.length===0)throw new Or("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 Tl(o):o[0];r=i.id;let s=pe({siteId:r});return e.siteId=s.siteId,l.info(`${O} Site ID updated in webflow.json`),{siteId:r,siteName:i.displayName,accessToken:n}}return{siteId:r,accessToken:n}}var uf=k(()=>{"use strict";ve();be();Al();Pi();x();Il();$();ie();v()});async function Ol(e){let t=new df.WebflowClient({accessToken:e,environment:{base:`${F}/v2`,dataApi:`${F}/v2`}});try{return await t.token.authorizedBy()}catch{return null}}var df,pf=k(()=>{"use strict";df=require("webflow-api");se()});var U=k(()=>{"use strict";Xp();Al();uf();Pi();Pi();kl();pf();Il()});function kb(e,t){if(e.includes("..")||Dt.isAbsolute(e))throw new Error(`Invalid file path: "${e}" - path traversal not allowed`);let r=Dt.resolve(t,e),n=Dt.resolve(t);if(!r.startsWith(n+Dt.sep)&&r!==n)throw new Error(`Invalid file path: "${e}" - resolves outside root directory`)}async function zi(e,t,r){let n=Dt.join(process.cwd(),t);r&&(0,ir.existsSync)(n)&&await(0,Gi.rm)(n,{recursive:!0,force:!0}),(0,ir.existsSync)(n)||await(0,Gi.mkdir)(n);for(let o of e){kb(o.path,n);let i=Sb(n,o.path);if(o.path.includes("/")){let s=o.path.substring(0,o.path.lastIndexOf("/"));Ab(n,s)}(0,ir.writeFileSync)(i,o.content,{flag:"w+"})}}function Sb(e,t){return Dt.join(e,...t.split("/"))}function Ab(e,t){let r=t.split("/"),n=e;for(let o of r)n=Dt.join(n,o),(0,ir.existsSync)(n)||(0,ir.mkdirSync)(n)}var ir,Gi,Dt,Vl=k(()=>{"use strict";ir=require("fs"),Gi=require("fs/promises"),Dt=h(require("path"))});function qi(e){for(let t of e??[]){let r=l[t.status]??l.info,n=Rb[t.status]??Oe;r(`
|
|
33
|
+
${n} ${t.content}`)}}var Rb,Gl=k(()=>{"use strict";v();$();Rb={info:Oe,warn:ge,success:O}});function Kl(e){let{manifestPath:t}=J();return(0,qf.writeFileSync)(t,JSON.stringify(e,null,2),"utf-8"),e}var qf,Zf=k(()=>{"use strict";qf=require("fs");ao()});function Zi(e,t){try{let r=ql(),n=Zl(Object.values(e)),o=t?.force;return n&&r&&!o}catch{return!1}}var Yf,Xf,ql,Zl,Yi=k(()=>{"use strict";Yf=require("path"),Xf=require("fs-extra");ql=()=>{try{return(0,Xf.existsSync)((0,Yf.join)(process.cwd(),"tsconfig.json"))}catch{return!1}},Zl=e=>e.some(t=>t.endsWith(".ts")||t.endsWith(".tsx"))});function $b(e){let{export:t,...r}=e;return t?r["devlink-export"]!=null?(Kl(r),r):(l.warn(`${ge} The 'export' key in webflow.json is deprecated. Use 'devlink-export' instead. Your configuration will be migrated automatically.`),r["devlink-export"]={...t},Kl(r),r):r}function tm(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 nm(e){e=$b(e);let t=e["devlink-export"]||{},r=!1,n=t.rootDir;n||(H()?n=Qf:(r=!0,n=await ke({message:"Enter the root directory for exported components:",default:Qf,validate:p=>!p||p.trim()===""?"Root directory is required":!0})));let o=t.ts;o===void 0&&(Nb()?o=!0:H()?o=!1:(r=!0,o=await Ne({message:"Use TypeScript?",default:!0})));let i=t.cssScopes;i===void 0&&(H()?i=em:(r=!0,i=await Ne({message:"Use DevLink style isolation (scoped wrapper + @scope)?",default:em}))),t.components&&tm(t.components,"components"),t.componentGroups&&tm(t.componentGroups,"componentGroups");let s=t.components,a=t.componentGroups;!s&&!a&&(H()?(s=Xi,a=Qi):(r=!0,await Ne({message:"Do you want to export all components?",default:!0})?(s=Xi,a=Qi):(s=await ke({message:"Enter regex pattern to filter components (e.g., 'Button|Card' for specific):",default:Xi,validate:f=>{try{return new RegExp(f),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}}),a=await ke({message:"Enter regex pattern to filter component groups (e.g., 'mygroup'):",default:Qi,validate:f=>{try{return new RegExp(f),!0}catch{return"Invalid regex pattern. Please enter a valid regular expression."}}})))),s=s||Xi,a=a||Qi;let c=t.relativeHrefRoot;c===void 0&&(c=Pb);let u={...t,rootDir:n,components:s,componentGroups:a,ts:o,cssScopes:i,relativeHrefRoot:c};return(!t.rootDir||t.ts===void 0||t.cssScopes===void 0||!t.components||!t.componentGroups||t.relativeHrefRoot===void 0)&&jb(u),{config:u,wasPrompted:r}}function jb(e){pe({"devlink-export":{...e}}),l.info(`${O} Devlink Export configuration updated in webflow.json`)}function Nb(){try{let e=process.cwd();if(ql())return!0;let t=["src","app","pages","components"];for(let r of t){let n=rm.join(e,r);if(es.existsSync(n)&&Zl(es.readdirSync(n)))return!0}}catch{}return!1}var es,rm,Qf,Xi,Qi,em,Pb,om=k(()=>{"use strict";es=h(require("fs")),rm=h(require("path"));Se();be();v();$();x();nl();Zf();Yi();Qf="./webflow",Xi=".*",Qi=".*",em=!0,Pb="/"});function $r(e){let t=e;for(let r=0;r<8&&t instanceof Error;r+=1){if(t.code===Xl)return!0;t=t.cause}return!1}async function am(e){if(e.ok)return;let t=await e.text().catch(()=>"");l.debug(`Server error response (HTTP ${e.status}): ${t||"<empty>"}`);let r,n;try{let o=JSON.parse(t);r=o.message,n=o.code}catch{}throw new ko(r||`Request failed (HTTP ${e.status}).`,{code:n})}async function Ql(e,t,r,n){let o=await Lb(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 Lb(e,t,r,n){let{taskId:o,polling:i}=await Bb(e,t,r,n);return Mb(e,t,r,o,i)}async function Bb(e,t,r,n){let o=await(0,Yl.default)(`${F}/v2/devlink/${e}/export`,{method:"POST",headers:{Authorization:`Bearer ${r}`,"Content-Type":"application/json",[sm]:t},body:JSON.stringify(n),timeout:6e4});return o.ok||await am(o),await o.json()}async function Mb(e,t,r,n,o){let{initialDelayMs:i,maxBackoffMs:s,backoffMultiplier:a,timeoutMs:c}=o,u=Date.now()+c,p=i;do{let f=await(0,Yl.default)(`${F}/v2/devlink/${e}/export/${n}`,{headers:{Authorization:`Bearer ${r}`,[sm]:t},timeout:6e4});f.ok||await am(f);let m=await f.json();if(m.status==="finished")return m.result;if(m.status==="failed")throw new ko("The export task failed. Please try again or report a bug.");await(0,im.setTimeout)(p),p=Math.min(p*a,s)}while(Date.now()<u);throw new ko(`Export task timed out after ${c}ms. Please try again.`)}var Yl,im,sm,Xl,ko,ec=k(()=>{"use strict";Yl=h(require("node-fetch")),im=require("timers/promises");v();se();x();sm="X-WF-Sync-Id",Xl="devlink_export_not_entitled",ko=class extends Error{code;constructor(t,r){super(t),this.code=r?.code}}});var lm,cm=k(()=>{"use strict";Se();v();lm=async(e,t)=>{if(!t)return;await Ne({message:`Ready to export components to ${e.rootDir}?`,default:!0})||(l.info("Export cancelled."),process.exit(0))}});function um(e,t,r){let i=new Intl.PluralRules("en-US").select(e)==="one"&&e===1?t:r||`${t}s`;return`${e} ${i}`}var dm=k(()=>{"use strict"});async function ts(e){let t=Date.now(),r;try{let{manifest:n}=J(),{siteId:o,accessToken:i}=await Ee(n,e),s=(0,pm.randomUUID)();Mp(s);let{config:a,wasPrompted:c}=await nm(n);l.info(`${O} Export configuration loaded!`),await lm(a,c);let u=b.forExport({authToken:i,siteId:o});r=l.spinner("Exporting components"),await u.sendUsage("devlink_export_start",{cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot});try{let{files:p,messages:f,metadata:m}=await Ql(a,i,o,s),g=m.exportCoverage==="full";await zi(p,a.rootDir,g),r.succeed(`${um(m.componentCount,"component")} exported to ${a.rootDir}`),qi(f);let w=Date.now()-t;await u.sendUsage("devlink_export_success",{duration:w,cssScopes:a.cssScopes,ts:a.ts,relativeHrefRoot:a.relativeHrefRoot})}catch(p){let f=p instanceof Error?p.message:String(p);throw e?.silentNotEntitled&&$r(p)?r.stop():r.fail(`Components export failed: ${f}`),await u.sendError(p instanceof Error?p:new Error(String(p)),"devlink_export_failure",{cssScopes:a.cssScopes,ts:a.ts}),p}}catch(n){if(!(e?.silentNotEntitled&&$r(n))){let i="Export failed: "+(n instanceof Error?n.message:n);r?r.fail(i):l.error(i,{prefix:`
|
|
34
|
+
`+D})}throw new d(n,{skipLogging:!0})}}var pm,fm=k(()=>{"use strict";pm=require("crypto");om();ec();cm();W();U();ve();dm();v();x();Vl();$();Gl()});var mm={};pd(mm,{DEVLINK_EXPORT_NOT_ENTITLED_CODE:()=>Xl,exportComponents:()=>ts,isDevlinkNotEntitledError:()=>$r});var rs=k(()=>{"use strict";fm();ec()});var fd=Symbol.for("@webflow/webflow-cli/suppress-deprecation");function jy(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 Ny(e=process){if(e[fd])return;e[fd]=!0;let t=e.emit;e.emit=function(n,...o){return n==="warning"&&jy(o[0])?!1:t.call(this,n,...o)}}Ny();var Cy=require("commander");var Fy=require("commander");ie();v();var Wp=require("child_process"),Up=require("fs"),Dl=h(require("semver"));v();var bl="@webflow/webflow-cli",Cr="@webflow/data-types",Ii="@webflow/react",eb=[bl,Cr,Ii],kr=class{getInstalledDependencies(){try{let t=(0,Wp.execSync)(`npm ls ${eb.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 l.debug(`Failed to get installed dependencies: ${t}`),{}}}getRequiredDependencies(t){let r=JSON.parse((0,Up.readFileSync)(require.resolve(`${t}/package.json`),"utf8"));return{...r.dependencies,...r.devDependencies}}checkCLIAndDataTypes(t){let r=t[Cr];if(!r)return;let o=this.getRequiredDependencies(bl)[Cr];if(!Dl.default.satisfies(r,o))throw new Error(`Version mismatch: ${bl} requires ${Cr} v${o} but found v${r}`)}checkReactAndDataTypes(t){let r=t[Cr],n=t[Ii];if(!(!r||!n)&&!Dl.default.eq(r,n))throw new Error(`Version mismatch: ${Ii} and ${Cr} must be on the same version. Found ${Ii}@${n} and ${Cr}@${r}`)}run(){let t=this.getInstalledDependencies();this.checkCLIAndDataTypes(t),this.checkReactAndDataTypes(t)}};var Zp=require("fs-extra");Se();var Yp=require("@dotenvx/dotenvx"),Sr=h(require("semver"));v();var zp=require("child_process"),Kp=require("util"),ab=(0,Kp.promisify)(zp.exec);async function er(e,t){try{let{stdout:r,stderr:n}=await ab(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}}}be();var Fl=h(ki());$();ie();(0,Yp.config)({quiet:!0,ignore:["MISSING_ENV_FILE"]});var qp={npm:{updateCommand:"npm install",update:async e=>await er(`npm install ${e}`),getOutdated:async e=>{let{stdout:t}=await er(`npm outdated --json ${e}`);return JSON.parse(t)},lockFile:"package-lock.json",globalFlag:"--global",supported:!0},pnpm:{updateCommand:"pnpm add",update:async e=>await er(`pnpm add ${e}`),getOutdated:async e=>{let{stdout:t}=await er(`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}},lb=["@webflow/webflow-cli","@webflow/data-types","@webflow/react","@webflow/emotion-utils","@webflow/styled-components-utils"],yo=class{packageManager;constructor(){this.packageManager=this.getPackagerManagerInfo()}getPackagerManagerInfo(){for(let[,t]of Object.entries(qp))if((0,Zp.existsSync)(t.lockFile))return t;return qp.npm}async listOutdatedPackages(t="local",r=lb){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} ${Pe} ${a})`,value:i})),o=await Oi({message:`New versions of the following ${fe("@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;l.info(`${Oe} New versions of the following ${fe("@webflow")} packages are available:`),Object.entries(t).forEach(([s,{current:a,latest:c}])=>{l.info(T(` ${Si} ${s} (${a} ${Pe} ${c})`))});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`);l.info(`
|
|
35
|
+
${Pe} To update, run:`),o.length>0&&l.info(P(` ${r} ${o.join(" ")}`)),i.length>0&&l.info(P(` ${r} ${n} ${i.join(" ")}`)),l.info("")}shouldSkipUpdateChecks(){return!this.packageManager.supported||process.env.WEBFLOW_SKIP_UPDATE_CHECKS==="true"}getDistTag(){let t=Sr.prerelease(Fl.default.version);return t&&t.length>0&&typeof t[0]=="string"?t[0]:"latest"}async promptPrerelease(t){let r;try{r=l.spinner("Checking for updates (to disable, use --skip-update-check)");let{stdout:n,code:o}=await er(`npm view @webflow/webflow-cli@${t} version`);if(o!==0||!n.trim()){r.succeed("Up to date");return}let i=n.trim(),s=Fl.default.version;if(!Sr.valid(i)||!Sr.valid(s)){r.succeed("Up to date");return}if(!Sr.gt(i,s)){r.succeed("All @webflow packages are up to date");return}if(r.succeed(),!process.stdin.isTTY||H()){l.info(`${Oe} A new version of @webflow/webflow-cli@${t} is available.`);let{code:f}=await er("npm ls @webflow/webflow-cli --json"),g=(f===0?"local":"global")==="global"?" --global":"";l.info(`${Pe} To update, run: `+P(`${this.packageManager.updateCommand}${g} @webflow/webflow-cli@${t}`)+`
|
|
36
|
+
`);return}let{code:c}=await er("npm ls @webflow/webflow-cli --json"),u=c===0?"local":"global";if(await Ne({message:`A new version of @webflow/webflow-cli@${t} is available.
|
|
37
|
+
Would you like to update it?`,default:!1})){r=l.spinner("Updating");let f=u==="global"?` ${this.packageManager.globalFlag}`:"";try{await this.packageManager.update(`${f} @webflow/webflow-cli@${t}`),r.succeed("Updated successfully")}catch{let g=u==="global"?` ${this.packageManager.globalFlag}`:"";r.fail("Update failed. Manually run: "+P(`${this.packageManager.updateCommand}${g} @webflow/webflow-cli@${t}`))}}}catch(n){r?.fail("Failed to check for updates"),l.debug(String(n))}}async prompt(){if(this.shouldSkipUpdateChecks())return;let t=this.getDistTag();if(t!=="latest")return this.promptPrerelease(t);let r;try{r=l.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||H()){this.showUpdateSuggestions(n);return}let s=await this.showUpdatePrompt(n);if(s.length>0){r=l.spinner("Updating");let{local:a,global:c}=s.reduce((m,g)=>(m[n[g].installationType==="global"?"global":"local"].push(g),m),{local:[],global:[]}),{update:u,globalFlag:p,updateCommand:f}=this.packageManager;try{a.length>0&&await u(`${a.map(m=>`${m}@latest`).join(" ")}`),c.length>0&&await u(`${p} ${c.map(m=>`${m}@latest`).join(" ")}`),r.succeed("Updated successfully")}catch{r.fail("Update failed. Manually run: "+P(`${f} ${s.map(g=>`${g}@latest`).join(" ")}`))}}}catch(n){r?.fail("Failed to check for updates"),l.debug(String(n))}}};be();Ar();ml();dl();Se();W();U();be();ve();v();x();$();ie();var mf=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(H()){l.info(`${D} No-input mode enabled. Aborting OAuth authentication`);return}let{manifest:n}=J();if(!r.force&&Eo()){let i=Fo(n);l.info(`${O} Webflow credentials already exist:`),i&&l.info(` Site ID: ${i}`),l.info(" API Token: [hidden]"),l.info(`
|
|
38
|
+
Use --force flag to reauthenticate anyway`);return}try{let o=await E({force:r.force});Lt({apiToken:o}),l.info(`
|
|
39
|
+
You can now use other Webflow CLI commands that require authentication`)}catch(o){throw new d(o,{prefix:`${D} Authentication failed:`})}}),t.command("status").description("Show current authentication status").action(async()=>{let r=bo(),n=r?.accessToken??Eo();if(!n){l.info(`${D} Not logged in. Run ${P("webflow auth login")} to authenticate.`),process.exitCode=1;return}try{let o=await Ol(n);if(!o){l.info(`${D} Token is invalid or expired. Run ${P("webflow auth login --force")} to reauthenticate.`),process.exitCode=1;return}l.info(`${O} Logged in as ${o.firstName} ${o.lastName} (${o.email})`),r?.scopes?.length&&l.info(` Scopes: ${r.scopes.join(", ")}`),l.info(` Session: ${rr()}`)}catch(o){throw new d(o,{prefix:`${D} Failed to fetch auth status:`})}}),t.command("logout").description("Log out and remove stored credentials").action(async()=>{Cl(),l.info(`${O} Logged out. Session file removed.`),l.info(`${Pe} Run ${P("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=Xt.getInstance();if(r.status){let s=await n.getTelemetryStatus();l.info(ff(s.enabled));return}if(r.enable){await n.setGlobalPreference(!0),l.info(Rl(!0));return}if(r.disable){await n.setGlobalPreference(!1),l.info(Rl(!1));return}let o=await n.getTelemetryStatus();if(l.info(ff(o.enabled)),H()){l.info("\u{1F4A1} When --no-input mode is enabled please provide --enable or --disable option");return}let i=await Ce({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),l.info(Rl(s))}})},Rl=e=>`${O} Telemetry ${e?"enabled":"disabled"} for all Webflow CLI commands`,ff=e=>`${Oe} Telemetry status: ${e?`enabled ${O}`:`disabled ${D}`}`;var $f=h(require("http")),Pf=h(require("node-fetch")),jf=h(require("serve-handler")),Nf=require("fs"),Lf=h(require("path")),Bf=require("commander");var hf=h(require("archiver")),Pl=require("commander"),Li=require("fs");var gf=require("cosmiconfig"),$l=require("commander"),ji=async(e,t)=>{let r=await gb(t),n=r.config.apiVersion;return n&&typeof n!="string"&&$l.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}}},gb=async e=>{let r=await(0,gf.cosmiconfig)("webflow",{searchPlaces:[e]}).search();return r||$l.program.error(`No ${e} file was found. Run this command within your extension folder.`),r};var wf=h(require("mime-types")),Ni=h(require("path")),hb=5*1024*1024,wb=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"]),yf=async(e,t,r)=>{let{config:n,filepath:o}=await ji(e,t),i=Ni.join(o,".."),s=!0,a=!1,c=p=>{let f=p.name,m=wf.default.lookup(f);return f==="index.html"&&(a=!0),f&&f.endsWith(".DS_Store")||!m?!1:wb.has(m)?p:(console.log(`Invalid file type: ${m} for file: ${f}`),s=!1,!1)},u=p=>{(0,Li.unlink)(r,f=>{f&&console.error(`Failed to delete file: ${f}`),Pl.program.error(p)})};return console.log(`Packaging the contents of the ${n.publicDir} folder into ${r}...`),new Promise(p=>{let f=(0,hf.default)("zip",{zlib:{level:9}}),m=(0,Li.createWriteStream)(Ni.join(i,r));m.on("close",()=>{p(void 0)}),f.directory(Ni.join(i,n.publicDir),!1,c),f.file(o,{name:t}),f.pipe(m),f.finalize(),f.on("warning",g=>{console.log(g)}),f.on("error",g=>{Pl.program.error(g.message)}),f.on("finish",()=>{if(!a){u("Could not find index.html in your `publicDir`, all Designer Extension code needs to be inside of `publicDir`");return}if(!s){u("Bundling failed due to invalid file types");return}if(!f.pointer()||f.pointer()===0){u("Bundling failed with no output");return}if(f.pointer()>=hb){u("Bundling failed due to the bundle exceeding 5MB");return}console.log(`${f.pointer()} total bytes written`),console.log(`Done! ${r} is ready for you to upload to your Webflow app.`)})})};var _o=h(require("path")),xt=h(require("fs/promises")),Wi=h(require("fs")),bf=require("url"),ak=require("dotenv/config"),vf=["js","cjs","json"],Ll=process.cwd(),Ef=".webflowrc",Mt=_o.extname(Wi.readdirSync(Ll).find(e=>e.includes(Ef))??"").replace(/\./g,""),Bt=_o.join(Ll,`${Ef}${Mt&&`.${Mt}`}`),Ff=Wi.existsSync(Bt),jl=class extends Error{constructor(){super(`Missing extension for .webflowrc file. The supported extensions are: ${vf.join(", ")}`)}},Bi=class extends Error{constructor(){super(`Unsupported extension for .webflowrc: ${Mt}. The supported extensions are: ${vf.join(", ")}`)}},Mi=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)}},Nl=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 yb(e){return(await import(process.platform==="win32"&&e?.match(/[a-zA-Z]:[\\\/]/)?(0,bf.pathToFileURL)(e).href:e)).default}function Df(e,t){let r=t.filter(n=>!e[n]);if(r.length)throw new Nl(r.join(", "))}async function yn(e=[],t=!1){if(!Ff){if(t)return{};throw new Mi(Bt)}if(!Mt)throw new jl;switch(Mt){case"js":case"cjs":{await xt.access(Bt);let r=await yb(Bt);return Df(r,e),r}case"json":{let r=JSON.parse(await xt.readFile(Bt,"utf8"));return Df(r,e),r}default:throw new Bi}}function Db(e,t){if(Mt==="js"||Mt==="cjs"){let n=new RegExp(`${t}: process.env.([\\w]+),`,"gi").exec(e);if(n)return n[1]}}function bb(e,t,r){let n=Db(t,r);if(n){let o=new RegExp(`${r}: ".*?",`,"g");return e.replace(o,`${r}: process.env.${n},`)}return e}async function vb(e){let t=["authToken","host","siteId"],r=await xt.readFile(Bt,"utf-8");for(let n of t)e=bb(e,r,n);return e}async function Eb(){try{let e=_o.join(Ll,"package.json");return await xt.access(e),JSON.parse(await xt.readFile(e,"utf-8"))?.type==="module"}catch{return!1}}async function xf(e){if(!Ff)throw new Mi(Bt);let t=JSON.stringify(e,null,2);switch(Mt){case"js":case"cjs":{let r=await vb(t.replace(/"([^"]+)":/g,"$1:")),n=await Eb()&&Mt==="js"?"export default ":"module.exports = ";return xt.writeFile(Bt,n+r)}case"json":return xt.writeFile(Bt,t);default:throw new Bi}}var or=h(require("fs")),at=h(require("path"));var Co="webflow.json",_f="index.html",Cf="bundle.zip",Bl="public",Ml="extension-scaffolds",Ui="default";var kf="package.json",Sf="wf-placeholder-name",Wl=e=>JSON.stringify(e,null,2),Af=e=>{let t="\u2500".repeat(e.length+2);return"\u256D"+t+`\u256E
|
|
40
40
|
\u2502 `+e+` \u2502
|
|
41
|
-
\u2570`+t+"\u256F"};var
|
|
42
|
-
`)},
|
|
41
|
+
\u2570`+t+"\u256F"};var Tf=async(e,t="./",r=Ui,n)=>{let o=n[r];try{for(let i of o){let s=at.join(t,i),a=_b(s,r,e);if(i.includes(kf)||i.includes(Co))await xb(i,a,e);else{let c=await or.promises.readFile(i);await Rf(a,c)}}}catch(i){console.error("Error writing file, ",i)}},If=async()=>{let e={},t=at.resolve(__dirname),r=at.join(t,Ml),n=await or.promises.readdir(r);for(let o of n){let i=at.join(r,o),s=await Of(i);e[o]=s}return e},Of=async e=>{let t=[];try{let r=await or.promises.readdir(e);for(let n of r){let o=at.join(e,n);if((await or.promises.stat(o)).isDirectory()){let s=await Of(o);t.push(...s)}else t.push(o)}}catch(r){console.error(`Error reading ${at}, `,r)}return t},Rf=async(e,t)=>{try{await or.promises.mkdir(at.dirname(e),{recursive:!0}),await or.promises.writeFile(e,t)}catch(r){console.error("Error writing file ",r)}},xb=async(e,t,r)=>or.promises.readFile(e,"utf8").then(async n=>{let o=n.replace(Sf,r);await Rf(t,o)}),_b=(e,t,r)=>{let n=at.join(Ml,t),o=e.indexOf(n);if(o!==-1){let i=e.substring(o+n.length+1);return at.join(r,i)}return""};var Vi=async()=>await If(),Mf=async()=>{let e=await Vi(),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"')},Wf=async(e,t=Ui)=>{let r=`./${e}`;console.log(`Scaffolding your new extension named: ${e}...`);let n=await Vi();await Tf(e,r,t,n),console.log(`Done! Check out ${r}/README.md for steps on how to develop your extension.`)},Uf=()=>yf(Bl,Co,Cf),Vf=async e=>{let{config:t,filepath:r}=await ji(Bl,Co),n=Lf.join(r,"..",t.publicDir,_f),i=(await yn([],!0)).extensionTemplateDomain||"webflow-ext.com",s=t.apiVersion==="2"?"template/v2":"template",a=Object.keys(t.featureFlags||{}).map(g=>t.featureFlags?.[g]===!0?`ff_on=${g}`:`ff_off=${g}`).join("&"),c=a?`&${a}`:"",p=await(await(0,Pf.default)(`https://${i}/${s}?name=${t.name}${c}`)).text(),f=new $f.Server((g,w)=>{if(g.url==="/"){Nf.promises.readFile(n,{encoding:"utf-8"}).catch(I=>{Bf.program.error(I.message)}).then(I=>{let C=p.replace("{{ui}}",I);return w.writeHead(200,{"Content-Length":Buffer.byteLength(C),"Content-Type":"text/html"}),w.end(C)});return}if(g.url==="/__webflow")return w.writeHead(200,{"Content-Length":Buffer.byteLength(Wl(t)),"Content-Type":"application/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"*"}),w.end(Wl(t));(0,jf.default)(g,w,{public:t.publicDir,cleanUrls:!1,directoryListing:!1})}),m=Cb(e);f.listen(m),console.log(Af(`Serving your extension at http://localhost:${m}`)+`
|
|
42
|
+
`)},Cb=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};Se();x();var Hf=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(Mf),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 Vi(),i=Object.keys(o),s=await ke({message:"What would you like to name your Designer Extension?",default:r,validate:c=>c.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 Ce({message:"Which project template would you like to use?",choices:i.map(c=>({name:c,value:c})),default:n||"default"});await Wf(s,a)}),t.command("bundle").description("Prepare package that can be uploaded to Webflow.").action(Uf),t.command("serve").description("Serve your extension locally.").argument("[port]","The port to serve your extension on").action(Vf)};var zl=h(require("process"));v();se();ve();var Gf=h(require("fs"));x();async function Ji(e){let{authToken:t,siteId:r}=e||{},{path:n,isUserDefined:o}=xr(),i=Gf.existsSync(n),s=!1;try{let{manifest:a}=J();s=!0,o&&l.info(`Using manifest file: ${n}`);try{let c=lo(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
|
|
45
|
+
webflow auth login`);return Jf(c?.relativeHrefRoot),{...c,host:F,authToken:t,siteId:r,cssModules:!!c?.cssModules,components:Hi(c?.components),fileExtensions:c?.fileExtensions,...e}}catch(c){throw new d(c,{prefix:`Failed to read devlink config from manifest file: ${n}
|
|
46
46
|
`})}}catch(a){if(o||i||s){let c=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
|
|
48
|
+
`;throw new d(a,{prefix:c})}}try{let a=[];t||a.push("authToken"),r||a.push("siteId");let c=await yn(a);return Jf(c?.relativeHrefRoot),{...c,host:c.host||F,cssModules:!!c?.cssModules,components:Hi(c?.components),fileExtensions:c?.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
|
|
51
|
+
in your project root.`),new d(a)}}function Jf(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 Hi(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>`^${t}$`).join("|")}Vl();ot();x();var Dn=class extends Error{};function Tb(e){try{let t=JSON.parse(e);if(t.msg&&typeof t.msg=="string")return t.msg}catch{}return null}async function Ib(e){switch(e.status){case 400:{let t=await e.text(),r=Tb(t);throw new Dn(r||"Bad request: The server rejected the request due to invalid input. Please check your configuration and try again.")}case 401:throw new Dn("Your access token is invalid for the provided siteId. Double check your configs in your .webflowrc configuration file.");case 404:throw new Dn("You're not currently enrolled in the DevLink beta. You can apply for access here: https://webflow.com/devlink");default:throw new Dn(`Something went wrong (HTTP ${e.status}).`)}}async function Ob(e){try{let{siteId:t,host:r,authToken:n,...o}=e,i=await j(`${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():Ib(i)}catch(t){throw new d(t,{skipLogging:!0})}}async function Hl(e){try{let t=await Ob(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 zi(t.files,e.rootDir,r),{messages:t.messages}}catch(t){throw t instanceof d?t:new d(t,{skipLogging:!0})}}var Rr=h(require("process"));v();ve();ot();var Jl=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;j(`${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:Rr.default.platform,node:Rr.default.version})})}async storeChoice(t){try{return pe({devlink:{allowTelemetry:t}})}catch{let n=await yn();await xf({...n,allowTelemetry:t})}}async prompt(){let t=this.config;l.error(this.error),t.allowTelemetry===!0?this.sendTelemetry():t.allowTelemetry===void 0&&(await this.storeChoice(!0),this.sendTelemetry())}};function Ki(e){return async function(r){Rr.default.removeListener("uncaughtException",Ki),Rr.default.removeListener("unhandledRejection",Ki);let n=await Ji(e);if(!n)return;await new Jl(n,r).prompt()}}function zf(e){Rr.default.on("uncaughtException",Ki(e)),Rr.default.on("unhandledRejection",Ki(e))}W();v();U();ve();Gl();async function Kf(e,t){let r=Date.now(),{manifest:n}=J(),{accessToken:o,siteId:i}=await Ee(n,{site:t?.site,apiToken:t?.apiToken}),s={...o?{authToken:o}:{},...i?{siteId:i}:{},...e&&e.length>0?{components:Hi(e),overwriteModule:!1}:{overwriteModule:!0}};zf(s);let a=await Ji(s);if(!a)return zl.default.exit();let c;try{c=b.forDevlinkSync(a)}catch(p){l.debug(`Failed to initialize telemetry: ${p}`)}await c?.sendUsage("devlink_sync_start",{specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot});let u=l.spinner(`Exporting components into ${a.rootDir}`);try{let{messages:p}=await Hl(a);u.succeed(`Successfully exported components into ${a.rootDir} folder`),qi(p);let f=Date.now()-r;await c?.sendUsage("devlink_sync_success",{duration:f,specificComponents:e&&e.length>0,componentCount:e?.length||0,cssModules:a.cssModules,overwriteModule:a.overwriteModule,relativeHrefRoot:a.relativeHrefRoot})}catch(p){let f=p instanceof Error?p.message:String(p);u.fail(`Failed to export components: ${f}`);let m=Date.now()-r;throw await c?.sendError(p instanceof Error?p:new Error(String(p)),"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:zl.default.argv.slice(2)}),p}}rs();var cr=require("commander");var bs=require("path"),kn=require("@webflow/data-types");se();var ns=require("fs"),tc=h(require("md5"));function So(e,t){try{let r=(0,ns.statSync)(e),n=(0,ns.readFileSync)(e);return{value:n,meta:{title:e.replace(/^.*[\\\/]/,""),fileHash:(0,tc.default)(n),size:r.size,...t||{}}}}catch{throw new Error(`File '${e}' not found`)}}function Ao(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,tc.default)(o),size:n,...r}}}catch{throw new Error(`Error parsing '${t}' inline file`)}}var gm=h(require("node-fetch")),hm=h(require("form-data"));async function To(e,t){let r={...t.fields,file:e.value},n=new hm.default;Object.entries(r).forEach(([i,s])=>{n.append(i,s)});let o=await(0,gm.default)("https://"+t.fields.bucket+".s3.amazonaws.com",{method:"POST",body:n});Wb(o)}function Wb(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}`)}}v();ve();W();se();ot();ie();function Ub({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:`${F}/v2/sites/${t}`,authToken:e}}return{baseUrl:`${F}/v2/workspaces`,authToken:e}}function Vb(e){if(e)return JSON.stringify(Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)))}async function Hb(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 ${P("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 sr({endpoint:e,method:t="GET",body:r,options:n}){let{baseUrl:o,authToken:i}=Ub(n),s=`${o.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`,a=await j(s,{method:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:Vb(r)});return await Hb(a),a.json()}async function rc({options:e}){return(await sr({endpoint:"/code_libraries",options:e})).payload.workspaces[0]}async function nc({name:e,description:t,slug:r,options:n}){return(await sr({method:"POST",endpoint:"/code_library/init",body:{name:e,description:t,slug:r},options:n})).payload}async function oc({resourceId:e,files:t,options:r}){return(await sr({method:"POST",endpoint:`/code_library/${e}/files`,body:{files:t},options:r})).payload}async function ic({resourceId:e,codeModule:t,components:r,options:n}){return(await sr({method:"POST",endpoint:`/code_library/${e}/share`,body:{codeModule:t,components:r},options:n})).payload}var ag=require("path"),lg=h(require("webpack-merge")),Pr=require("@webflow/data-types");se();v();var Dm=require("memfs/lib/volume"),Io=require("@webflow/data-types");var _t="./tmp_entry",wm="components";function os(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 Jb(e){let t=os(e);return/^[a-zA-Z]/.test(t.charAt(0))?t:"_"+t}function ym(e,t){let r=e.map(({name:c,path:u,isDefaultExport:p})=>p?`import ${c} from "${u}";`:`import { ${c} } from "${u}";`).join(`
|
|
52
52
|
`),n=e.filter(c=>c.type==="internal").map(({name:c,exportKey:u})=>`${u}: ${c}`).join(", "),o=e.filter(c=>c.type==="component").map(({name:c,exportKey:u})=>`"${u}": ${c}`).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 Kp(e,t,r){let n={},o=`${Dt}/Client.js`,i=`${Dt}/Server.js`;n[o]=zp([{name:"ClientRenderer",path:e.client,exportKey:"Renderer",type:"internal"}],_o.Environment.Client);let s={},a=u=>{let d=ub(u);return s[d]?(s[d]+=1,`${d}${s[d]}`):(s[d]=1,d)};n[i]=zp([{name:"ServerRenderer",path:e.server,exportKey:"Renderer",type:"internal"},...Object.entries(t).filter(([u])=>r[u]?.ssr??!0).map(([u,d])=>{let p=a(u),m=d.startsWith(Dt)?d.replace(`${Dt}/`,"./"):d;return{name:p,path:m,exportKey:u,isDefaultExport:!0,type:"component"}})],_o.Environment.Server);let c={[_o.Environment.Client]:o,[_o.Environment.Server]:i};return{entryPointsVolume:qp.Volume.fromJSON(n),paths:c}}var Bm=require("memfs/lib/volume");var em=h(require("archiver")),mn=require("path");se();var ko=require("@webflow/data-types");se();b();var rr=e=>e.endsWith("/")||/%2F$/i.test(e)?e:`${e}/`;var Zp=2;function Yp(e){let t={type:ko.ModuleLoader.FEDERATION,version:Zp,entry:Ka,renderer:ao,components:e};return{title:so,content:JSON.stringify(t)}}function Xp(e){let t={type:ko.ModuleLoader.SSR,version:Zp,entry:ln,components:e};return{title:so,content:JSON.stringify(t)}}function Qp(e){let t=`/${ko.Environment.Client}/${Ka}`;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===ao||(i[a]={css:[]},s.assets.css.sync.forEach(c=>{i[a].css.push(`${rr(o)}${c}`)})),i},{})}}catch(r){l.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var Zi=require("@webflow/data-types"),db=/\.css$/i;async function tm(e,t,r){let n=!1;return new Promise(async(o,i)=>{e.length===0&&i(new Error("No assets to bundle"));let s=`/${Zi.Environment.Server}/${lo}`,a=(0,em.default)("tar",{gzip:!1}),c=t.createWriteStream(s);a.on("error",p=>(n=!0,i(p))),c.on("close",()=>{if(!n)try{let p={type:"asset",name:lo,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return e.forEach(m=>{let g=(0,mn.resolve)((0,mn.join)(`/${Zi.Environment.Server}`,m.name));t.existsSync(g)&&t.rmSync(g)}),o([p])}catch(p){return i(p)}finally{n=!0}}),a.pipe(c);let{title:u,content:d}=Xp(r);a.append(d,{name:u}),e.forEach(p=>{if(!db.test(p.name))try{let m=(0,mn.resolve)((0,mn.join)(`/${Zi.Environment.Server}`,p.name)),g=t.readFileSync(m,"utf8");a.append(g,{name:p.name})}catch(m){return n=!0,i(m)}}),await a.finalize()})}var rm=require("@webflow/data-types");async function nm(e,t,r){let{title:n,content:o}=Yp(r);await t.promises.writeFile(`/${rm.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 Am=require("@rspack/core"),Tm=h(require("fork-ts-checker-webpack-plugin")),Im=require("ts-checker-rspack-plugin"),Om=h(require("mini-css-extract-plugin")),Rm=require("@webflow/data-types");var im=require("webpack"),zl=h(require("mini-css-extract-plugin")),sm=h(require("tsconfig-paths-webpack-plugin")),am=require("tsconfig-paths"),ql=require("@webflow/data-types"),lm=require("path");se();var om=h(require("postcss-selector-parser")),Gl=()=>({postcssPlugin:"CSSinShadowDOM",Once(e){e.walkRules(t=>{t.selector=(0,om.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(t.selector)})}});Gl.postcss=!0;Gl.postcssPlugin="CSSinShadowDOM";var Yi=Gl;function fb(){return(0,am.loadConfig)(process.cwd()).resultType==="success"}function cm({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:zl.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 zl.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[fb()?new sm.default:null].filter(Boolean)},performance:{hints:!1}};if(t===ql.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,lm.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===ql.Environment.Server)return{...s,plugins:[...s.plugins||[],new im.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:ln,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var um=require("@module-federation/enhanced"),Kl=require("@webflow/data-types");function dm({libraryName:e,env:t,exposes:r}){if(t===Kl.Environment.Client)return{plugins:[new um.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===Kl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}function fm(){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 Xi(){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 Qi=require("@rspack/core"),pm=require("tsconfig-paths"),Zl=require("@webflow/data-types"),mm=require("path");se();function pb(){let e=(0,pm.loadConfig)(process.cwd());if(e.resultType==="success")return e.configFileAbsolutePath}function gm({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:Qi.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 Qi.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=pb();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(t===Zl.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,mm.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===Zl.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new Qi.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:ln,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var hm=require("@module-federation/enhanced/rspack"),Yl=require("@webflow/data-types");function wm({libraryName:e,env:t,exposes:r}){if(t===Yl.Environment.Client)return{plugins:[new hm.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===Yl.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}var gb=h(require("fs")),ym=require("unionfs"),Dm=require("webpack");function mb(e){return{name:e.name,size:e.size,emitted:e.emitted,info:e.info}}function es(e){let t=e.toJson();return{hasErrors:()=>e.hasErrors(),hasWarnings:()=>e.hasWarnings(),toString:r=>e.toString(r),toJson:()=>({...t,assets:(t.assets??[]).map(mb)})}}async function bm({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((s,a)=>(s.use(a),s),new ym.Union().use(gb));return new Promise((s,a)=>{let c=(0,Dm.webpack)(e);c.inputFileSystem=i,r&&(c.outputFileSystem=r),n&&(c.outputPath=n),c.run((u,d)=>{c.close(p=>{u||p?a(u||p):d?d.hasErrors()||o&&d.hasWarnings()?a(new Error(d.toString("errors-warnings"))):s(es(d)):a(new Error("Webpack stats are undefined"))})})})}var hb=h(require("fs")),Xl=h(require("webpack-merge")),vm=require("memfs"),Em=require("unionfs"),Fm=require("@rspack/core");async function ts({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((a,c)=>(a.use(c),a),new Em.Union().use(hb)),s=e;return t.length>0&&(s=(0,Xl.default)(s,{experiments:{...e.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,Xl.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,c)=>{let u=(0,Fm.rspack)(s);u.inputFileSystem=i,r&&(u.outputFileSystem=(0,vm.createFsFromVolume)(r)),n&&(u.outputPath=n),u.run((d,p)=>{u.close(m=>{d||m?c(d||m):p?p.hasErrors()||o&&p.hasWarnings()?c(new Error(p.toString("errors-warnings"))):a(es(p)):c(new Error("Rspack stats are undefined"))})})})}var Cm=require("@module-federation/enhanced");var gn=h(require("webpack-merge"));b();function nr(e){return e!==null&&typeof e=="object"&&"constructor"in e?e.constructor.name??"":""}function xm(e,t){let r=Object.entries(e).filter(([n])=>!t.includes(n));return Object.fromEntries(r)}function ns(e){let{deduplicatePluginNames:t,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=e;return function(s,a,c){let u=["entry","output","target"],d=wb(s),p=Array.isArray(c)?rs(...c.map(d)):rs(d(c));Object.keys(p).some(Y=>u.includes(Y))&&l.warn(`Cannot override blocked properties: ${u.join(", ")}`);let g={...xm(p,[...u,"ModuleFederationPlugin","module","plugins"]),module:xm(p.module??{},["rules"])},y=(0,gn.default)(a,g),F=p.plugins??[];o&&(F=F.filter(o));let R=a.plugins??[],ee=(0,gn.mergeWithCustomize)({customizeArray:(0,gn.unique)("plugins",t,Y=>nr(Y))})({plugins:F},{plugins:R}).plugins,E=p?.ModuleFederationPlugin?.shared,Z=ee?.map(Y=>{if(nr(Y)==="ModuleFederationPlugin"){let M=n(Y);return new r({...M,...E?{shared:E}:{}})}return Y});y.plugins=Z;let he=p.module?.rules;if(he&&typeof he=="function"){let Y=a.module?.rules??[];y.module={...y.module??{},rules:he(Y)}}return y}}function rs(...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,...c}=n;if(t.module={...t.module,...c},a){let u=t.module?.rules;u?t.module.rules=d=>{let p=u(d);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 wb(e){return t=>typeof t=="function"?t(e):t}var yb=ns({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:Cm.ModuleFederationPlugin,getPluginOptions:e=>e._options??{}});function _m(e,t,r){return yb(e,t,r)}var km=require("@module-federation/enhanced/rspack");var Db=ns({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:km.ModuleFederationPlugin,getPluginOptions:e=>e._options??{},filterOverridePlugins:e=>nr(e)!=="MiniCssExtractPlugin"});function Sm(e,t,r){return Db(e,t,r)}var Ql={[Rm.Framework.React]:{generateWebpackBundlerConfig:fm,generateRspackBundlerConfig:Xi}},bb={webpack:{generateBaseConfig:cm,getFrameworkConfig:(e,t)=>Ql[e].generateWebpackBundlerConfig(t),generateFederationConfig:dm,mergeConfigs:(e,t,r)=>_m(e,t,r),bundle:e=>bm({...e,config:e.config}),typeCheckerPlugin:Tm.default,hashFunction:"md5",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>nr(t)==="MiniCssExtractPlugin"?new Om.default({filename:"[name].[contenthash].css"}):t)})},rspack:{generateBaseConfig:gm,getFrameworkConfig:(e,t)=>Ql[e].generateRspackBundlerConfig(t),generateFederationConfig:wm,mergeConfigs:(e,t,r)=>Sm(e,t,r),bundle:e=>ts({...e,config:e.config}),typeCheckerPlugin:Im.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>nr(t)==="CssExtractRspackPlugin"?new Am.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):t)})}},hn=e=>bb[e],$m=e=>!!Ql[e];var Pm={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 os(e){let t=e.bundler??"webpack";l.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=Kp(e.renderer,e.componentsFiles,e.componentsOptions),o=Bm.Volume.fromJSON({"/Server":null,"/Client":null});l.debug("Generating bundling config...");let i=e.overrideConfig??{};Object.keys(i).length&&l.debug("Found bundle config overrides. Merging...");let s=hn(t),a=R=>{let j=vb({env:R,mode:e.dev?"development":"production",framework:e.framework,publicPath:e.publicPath,components:e.componentsFiles,entryPaths:n,libraryName:e.libraryIdentifier,bundler:t}),ee=s.mergeConfigs(R,j,i);return e?.debugBundler&&(l.info(`${t} config for env ${R}:`),l.dir(ee)),ee},c={sourceVolumes:[...e.sourceVolumes,r],outputVolume:o,failOnWarnings:e.failOnWarnings},[u,d]=await Promise.all([s.bundle({...c,config:a(Ar.Environment.Server),outputPath:`/${Ar.Environment.Server}`}),s.bundle({...c,config:a(Ar.Environment.Client),outputPath:`/${Ar.Environment.Client}`})]);e?.debugBundler&&(l.debug(o.toTree()),l.debug(`Server Bundler Stats: ${u.toString(Pm)}`),l.debug(`Client Bundler Stats: ${d.toString(Pm)}`));let p=Qp(o);l.debug("Packaging server bundle...");let m=await tm(u.toJson().assets||[],o,p);l.debug("Packaging client bundle...");let g=await nm(d.toJson().assets||[],o,p),y=R=>j=>[j,R];return{outputFiles:[...m.map(y(Ar.Environment.Server)),...g.map(y(Ar.Environment.Client))],outputVolume:o}}function vb({env:e,mode:t="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:c="webpack"}){if(!$m(r))throw new Error(`Unknown framework: ${r}`);let u=Object.entries({[ao]:i[e],...o}).reduce((y,[F,R])=>({...y,[`./${F}`]:`./${(0,jm.relative)(process.cwd(),R)}`}),{}),d=hn(c),p=d.generateBaseConfig({entry:i[e],env:e,mode:t,libraryName:s,publicPath:n,outputPath:a}),m=d.getFrameworkConfig(r,e),g=d.generateFederationConfig({exposes:u,env:e,libraryName:s});return(0,Nm.default)(p,m,g)}var Wm=h(require("path")),tc=require("memfs/lib/volume"),rc=h(require("webpack-merge")),Um=h(require("webpack-node-externals")),rt=require("@webflow/data-types");var Eb=h(require("fs")),wn=require("path"),yn=require("webpack");function Fb(e,t=Eb){let r=(0,wn.join)(process.cwd(),"node_modules",e);for(;r!==(0,wn.dirname)(r)&&r!=="node_modules";){let n=(0,wn.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,wn.dirname)(r)}return null}var is=class{apply(t){t.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:yn.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,c,u]=i.split("."),d=o[a]?.sources??{},p=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(g=>{if(g.startsWith("external")){let y=g.match(/^external \S+ "(.+)"$/)?.[1];if(!y)throw new Error(`Could not extract package name from ${g}`);let F=Fb(y,r.inputFileSystem);if(!F)throw new Error(`Could not find package information for ${y}`);F&&p.add(F)}}),o[a]={sources:{...d,[`./${a}.${u}`]:c},dependencies:p},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new yn.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new yn.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var Lm=h(require("module")),Mm=require("jsdom"),ec="__webflowCliImportModuleWindow__";function xb(e){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(e),n=!!r,o=`module[${JSON.stringify(ec)}]`,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 bm(e,t,r){let n={},o=`${_t}/Client.js`,i=`${_t}/Server.js`;n[o]=ym([{name:"ClientRenderer",path:e.client,exportKey:"Renderer",type:"internal"}],Io.Environment.Client);let s={},a=u=>{let p=Jb(u);return s[p]?(s[p]+=1,`${p}${s[p]}`):(s[p]=1,p)};n[i]=ym([{name:"ServerRenderer",path:e.server,exportKey:"Renderer",type:"internal"},...Object.entries(t).filter(([u])=>r[u]?.ssr??!0).map(([u,p])=>{let f=a(u),m=p.startsWith(_t)?p.replace(`${_t}/`,"./"):p;return{name:f,path:m,exportKey:u,isDefaultExport:!0,type:"component"}})],Io.Environment.Server);let c={[Io.Environment.Client]:o,[Io.Environment.Server]:i};return{entryPointsVolume:Dm.Volume.fromJSON(n),paths:c}}var cg=require("memfs/lib/volume");var _m=h(require("archiver")),bn=require("path");se();var Oo=require("@webflow/data-types");se();v();var ar=e=>e.endsWith("/")||/%2F$/i.test(e)?e:`${e}/`;var vm=2;function Em(e){let t={type:Oo.ModuleLoader.FEDERATION,version:vm,entry:ul,renderer:fo,components:e};return{title:po,content:JSON.stringify(t)}}function Fm(e){let t={type:Oo.ModuleLoader.SSR,version:vm,entry:mn,components:e};return{title:po,content:JSON.stringify(t)}}function xm(e){let t=`/${Oo.Environment.Client}/${ul}`;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===fo||(i[a]={css:[]},s.assets.css.sync.forEach(c=>{i[a].css.push(`${ar(o)}${c}`)})),i},{})}}catch(r){l.error(r,{prefix:"Failed to extract components metadata from MF manifest:"})}return{}}var is=require("@webflow/data-types"),Gb=/\.css$/i;async function Cm(e,t,r){let n=!1;return new Promise(async(o,i)=>{e.length===0&&i(new Error("No assets to bundle"));let s=`/${is.Environment.Server}/${mo}`,a=(0,_m.default)("tar",{gzip:!1}),c=t.createWriteStream(s);a.on("error",f=>(n=!0,i(f))),c.on("close",()=>{if(!n)try{let f={type:"asset",name:mo,info:{},size:a.pointer(),emitted:!0,comparedForEmit:!1,cached:!1};return e.forEach(m=>{let g=(0,bn.resolve)((0,bn.join)(`/${is.Environment.Server}`,m.name));t.existsSync(g)&&t.rmSync(g)}),o([f])}catch(f){return i(f)}finally{n=!0}}),a.pipe(c);let{title:u,content:p}=Fm(r);a.append(p,{name:u}),e.forEach(f=>{if(!Gb.test(f.name))try{let m=(0,bn.resolve)((0,bn.join)(`/${is.Environment.Server}`,f.name)),g=t.readFileSync(m,"utf8");a.append(g,{name:f.name})}catch(m){return n=!0,i(m)}}),await a.finalize()})}var km=require("@webflow/data-types");async function Sm(e,t,r){let{title:n,content:o}=Em(r);await t.promises.writeFile(`/${km.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 eg=require("@rspack/core"),tg=h(require("fork-ts-checker-webpack-plugin")),rg=require("ts-checker-rspack-plugin"),ng=h(require("mini-css-extract-plugin")),og=require("@webflow/data-types");var Tm=require("webpack"),ac=h(require("mini-css-extract-plugin")),Im=h(require("tsconfig-paths-webpack-plugin")),Om=require("tsconfig-paths"),lc=require("@webflow/data-types"),Rm=require("path");se();var Am=h(require("postcss-selector-parser")),sc=()=>({postcssPlugin:"CSSinShadowDOM",Once(e){e.walkRules(t=>{t.selector=(0,Am.default)(r=>{r.walkPseudos(n=>{n.value===":root"&&(n.value=":host")})}).processSync(t.selector)})}});sc.postcss=!0;sc.postcssPlugin="CSSinShadowDOM";var ss=sc;function zb(){return(0,Om.loadConfig)(process.cwd()).resultType==="success"}function $m({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:ac.default.loader},{ident:"css-loader",loader:require.resolve("css-loader"),options:{importLoaders:1}},{ident:"postcss-loader",loader:require.resolve("postcss-loader"),options:{postcssOptions:{plugins:[ss]}}}]},{test:/\.(png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$/i,type:"asset/resource",generator:{filename:"[hash]-[name][ext]"}}]},plugins:[new ac.default({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:{plugins:[zb()?new Im.default:null].filter(Boolean)},performance:{hints:!1}};if(t===lc.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,Rm.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===lc.Environment.Server)return{...s,plugins:[...s.plugins||[],new Tm.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:mn,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var Pm=require("@module-federation/enhanced"),cc=require("@webflow/data-types");function jm({libraryName:e,env:t,exposes:r}){if(t===cc.Environment.Client)return{plugins:[new Pm.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===cc.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}function Nm(){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 as(){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 ls=require("@rspack/core"),Lm=require("tsconfig-paths"),uc=require("@webflow/data-types"),Bm=require("path");se();function Kb(){let e=(0,Lm.loadConfig)(process.cwd());if(e.resultType==="success")return e.configFileAbsolutePath}function Mm({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:ls.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:[ss]}}}],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 ls.rspack.CssExtractRspackPlugin({filename:"[contenthash].css",chunkFilename:"[contenthash].css",runtime:!1})],resolve:(()=>{let a=Kb();return a?{tsConfig:{configFile:a}}:{}})(),performance:{hints:!1}};if(t===uc.Environment.Client)return{...s,entry:()=>({}),output:{path:i?(0,Bm.join)(process.cwd(),i,t):"/",publicPath:n,clean:!0,uniqueName:o},target:"web"};if(t===uc.Environment.Server)return{...s,plugins:[...Array.isArray(s.plugins)?s.plugins:[],new ls.rspack.optimize.LimitChunkCountPlugin({maxChunks:1})],entry:e,output:{filename:mn,library:{type:"commonjs2"}},optimization:{splitChunks:!1},target:"async-node"};throw new Error(`Unknown environment ${t}`)}var Wm=require("@module-federation/enhanced/rspack"),dc=require("@webflow/data-types");function Um({libraryName:e,env:t,exposes:r}){if(t===dc.Environment.Client)return{plugins:[new Wm.ModuleFederationPlugin({name:e,filename:"remoteEntry.js",exposes:r,dts:!1,experiments:{optimization:{disableSnapshot:!0}}})]};if(t===dc.Environment.Server)return{};throw new Error(`Unknown environment ${t}`)}var Zb=h(require("fs")),Vm=require("unionfs"),Hm=require("webpack");function qb(e){return{name:e.name,size:e.size,emitted:e.emitted,info:e.info}}function cs(e){let t=e.toJson();return{hasErrors:()=>e.hasErrors(),hasWarnings:()=>e.hasWarnings(),toString:r=>e.toString(r),toJson:()=>({...t,assets:(t.assets??[]).map(qb)})}}async function Jm({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((s,a)=>(s.use(a),s),new Vm.Union().use(Zb));return new Promise((s,a)=>{let c=(0,Hm.webpack)(e);c.inputFileSystem=i,r&&(c.outputFileSystem=r),n&&(c.outputPath=n),c.run((u,p)=>{c.close(f=>{u||f?a(u||f):p?p.hasErrors()||o&&p.hasWarnings()?a(new Error(p.toString("errors-warnings"))):s(cs(p)):a(new Error("Webpack stats are undefined"))})})})}var Yb=h(require("fs")),pc=h(require("webpack-merge")),Gm=require("memfs"),zm=require("unionfs"),Km=require("@rspack/core");async function us({config:e,sourceVolumes:t=[],outputVolume:r,outputPath:n,failOnWarnings:o=!0}){let i=t.reduce((a,c)=>(a.use(c),a),new zm.Union().use(Yb)),s=e;return t.length>0&&(s=(0,pc.default)(s,{experiments:{...e.experiments,useInputFileSystem:[/./]}})),r&&(s=(0,pc.default)(s,{output:{clean:!1,...n&&{path:n}}})),new Promise((a,c)=>{let u=(0,Km.rspack)(s);u.inputFileSystem=i,r&&(u.outputFileSystem=(0,Gm.createFsFromVolume)(r)),n&&(u.outputPath=n),u.run((p,f)=>{u.close(m=>{p||m?c(p||m):f?f.hasErrors()||o&&f.hasWarnings()?c(new Error(f.toString("errors-warnings"))):a(cs(f)):c(new Error("Rspack stats are undefined"))})})})}var Zm=require("@module-federation/enhanced");var vn=h(require("webpack-merge"));v();function lr(e){return e!==null&&typeof e=="object"&&"constructor"in e?e.constructor.name??"":""}function qm(e,t){let r=Object.entries(e).filter(([n])=>!t.includes(n));return Object.fromEntries(r)}function Xb(e,t){return e instanceof t||lr(e)==="ModuleFederationPlugin"}function ps(e){let{deduplicatePluginNames:t,ModuleFederationPluginClass:r,getPluginOptions:n,filterOverridePlugins:o}=e;return function(s,a,c){let u=["entry","output","target"],p=Qb(s),f=Array.isArray(c)?ds(...c.map(p)):ds(p(c));Object.keys(f).some(X=>u.includes(X))&&l.warn(`Cannot override blocked properties: ${u.join(", ")}`);let g={...qm(f,[...u,"ModuleFederationPlugin","module","plugins"]),module:qm(f.module??{},["rules"])},w=(0,vn.default)(a,g),I=f.plugins??[];o&&(I=I.filter(o));let C=a.plugins??[],Z=(0,vn.mergeWithCustomize)({customizeArray:(0,vn.unique)("plugins",t,X=>lr(X))})({plugins:I},{plugins:C}).plugins,S=f?.ModuleFederationPlugin?.shared,oe=Z?.map(X=>{if(Xb(X,r)){let M=n(X);return new r({...M,...S?{shared:S}:{}})}return X});w.plugins=oe;let ye=f.module?.rules;if(ye&&typeof ye=="function"){let X=a.module?.rules??[];w.module={...w.module??{},rules:ye(X)}}return w}}function ds(...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,...c}=n;if(t.module={...t.module,...c},a){let u=t.module?.rules;u?t.module.rules=p=>{let f=u(p);return a(f)}:t.module.rules=a}}o?.shared&&(t.ModuleFederationPlugin={shared:{...t.ModuleFederationPlugin?.shared,...o.shared}}),i&&(t.plugins=[...t.plugins??[],...i])}return t}function Qb(e){return t=>typeof t=="function"?t(e):t}var ev=ps({deduplicatePluginNames:["ModuleFederationPlugin","MiniCssExtractPlugin"],ModuleFederationPluginClass:Zm.ModuleFederationPlugin,getPluginOptions:e=>e._options??{}});function Ym(e,t,r){return ev(e,t,r)}var Xm=require("@module-federation/enhanced/rspack");var tv=ps({deduplicatePluginNames:["ModuleFederationPlugin","CssExtractRspackPlugin"],ModuleFederationPluginClass:Xm.ModuleFederationPlugin,getPluginOptions:e=>e._options??{},filterOverridePlugins:e=>lr(e)!=="MiniCssExtractPlugin"});function Qm(e,t,r){return tv(e,t,r)}var fc={[og.Framework.React]:{generateWebpackBundlerConfig:Nm,generateRspackBundlerConfig:as}},rv={webpack:{generateBaseConfig:$m,getFrameworkConfig:(e,t)=>fc[e].generateWebpackBundlerConfig(t),generateFederationConfig:jm,mergeConfigs:(e,t,r)=>Ym(e,t,r),bundle:e=>Jm({...e,config:e.config}),typeCheckerPlugin:tg.default,hashFunction:"md5",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>lr(t)==="MiniCssExtractPlugin"?new ng.default({filename:"[name].[contenthash].css"}):t)})},rspack:{generateBaseConfig:Mm,getFrameworkConfig:(e,t)=>fc[e].generateRspackBundlerConfig(t),generateFederationConfig:Um,mergeConfigs:(e,t,r)=>Qm(e,t,r),bundle:e=>us({...e,config:e.config}),typeCheckerPlugin:rg.TsCheckerRspackPlugin,hashFunction:"md4",replaceCssPlugin:e=>({...e,plugins:e.plugins?.map(t=>lr(t)==="CssExtractRspackPlugin"?new eg.CssExtractRspackPlugin({filename:"[name].[contenthash].css"}):t)})}},En=e=>rv[e],ig=e=>!!fc[e];var sg={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 fs(e){let t=e.bundler??"webpack";l.debug("Generating entry points...");let{entryPointsVolume:r,paths:n}=bm(e.renderer,e.componentsFiles,e.componentsOptions),o=cg.Volume.fromJSON({"/Server":null,"/Client":null});l.debug("Generating bundling config...");let i=e.overrideConfig??{};Object.keys(i).length&&l.debug("Found bundle config overrides. Merging...");let s=En(t),a=C=>{let q=nv({env:C,mode:e.dev?"development":"production",framework:e.framework,publicPath:e.publicPath,components:e.componentsFiles,entryPaths:n,libraryName:e.libraryIdentifier,bundler:t}),Z=s.mergeConfigs(C,q,i);return e?.debugBundler&&(l.info(`${t} config for env ${C}:`),l.dir(Z)),Z},c={sourceVolumes:[...e.sourceVolumes,r],outputVolume:o,failOnWarnings:e.failOnWarnings},[u,p]=await Promise.all([s.bundle({...c,config:a(Pr.Environment.Server),outputPath:`/${Pr.Environment.Server}`}),s.bundle({...c,config:a(Pr.Environment.Client),outputPath:`/${Pr.Environment.Client}`})]);e?.debugBundler&&(l.debug(o.toTree()),l.debug(`Server Bundler Stats: ${u.toString(sg)}`),l.debug(`Client Bundler Stats: ${p.toString(sg)}`));let f=xm(o);l.debug("Packaging server bundle...");let m=await Cm(u.toJson().assets||[],o,f);l.debug("Packaging client bundle...");let g=await Sm(p.toJson().assets||[],o,f),w=C=>q=>[q,C];return{outputFiles:[...m.map(w(Pr.Environment.Server)),...g.map(w(Pr.Environment.Client))],outputVolume:o}}function nv({env:e,mode:t="production",framework:r,publicPath:n,components:o,entryPaths:i,libraryName:s,outputPath:a,bundler:c="webpack"}){if(!ig(r))throw new Error(`Unknown framework: ${r}`);let u=Object.entries({[fo]:i[e],...o}).reduce((w,[I,C])=>({...w,[`./${I}`]:`./${(0,ag.relative)(process.cwd(),C)}`}),{}),p=En(c),f=p.generateBaseConfig({entry:i[e],env:e,mode:t,libraryName:s,publicPath:n,outputPath:a}),m=p.getFrameworkConfig(r,e),g=p.generateFederationConfig({exposes:u,env:e,libraryName:s});return(0,lg.default)(f,m,g)}var pg=h(require("path")),gc=require("memfs/lib/volume"),hc=h(require("webpack-merge")),fg=h(require("webpack-node-externals")),lt=require("@webflow/data-types");var ov=h(require("fs")),Fn=require("path"),xn=require("webpack");function iv(e,t=ov){let r=(0,Fn.join)(process.cwd(),"node_modules",e);for(;r!==(0,Fn.dirname)(r)&&r!=="node_modules";){let n=(0,Fn.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,Fn.dirname)(r)}return null}var ms=class{apply(t){t.hooks.compilation.tap("ProcessSourceMapsPlugin",function(r){r.hooks.processAssets.tap({name:"ProcessSourceMapsPlugin",stage:xn.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,c,u]=i.split("."),p=o[a]?.sources??{},f=o[a]?.dependencies??new Set;JSON.parse(s.source().toString()).sources.forEach(g=>{if(g.startsWith("external")){let w=g.match(/^external \S+ "(.+)"$/)?.[1];if(!w)throw new Error(`Could not extract package name from ${g}`);let I=iv(w,r.inputFileSystem);if(!I)throw new Error(`Could not find package information for ${w}`);I&&f.add(I)}}),o[a]={sources:{...p,[`./${a}.${u}`]:c},dependencies:f},r.deleteAsset(i)}),Object.entries(o).forEach(([i,{sources:s,dependencies:a}])=>{r.emitAsset(`${i}.js.map`,new xn.sources.RawSource(JSON.stringify({sources:s,dependencies:[...a]})))})}catch(n){r.errors.push(new xn.WebpackError(`[ProcessSourceMapsPlugin] Could not process source maps: ${n instanceof Error?n.stack:String(n)}`))}})})}};var ug=h(require("module")),dg=require("jsdom"),mc="__webflowCliImportModuleWindow__";function sv(e){let r=/^(?:\ufeff?\s*)(?:'use strict'|"use strict");?\s*(?:\r?\n|\r)?/.exec(e),n=!!r,o=`module[${JSON.stringify(mc)}]`,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?e.slice(0,r[0].length)+s+e.slice(r[0].length):s+e}function
|
|
57
|
-
`)}function
|
|
58
|
-
`)}async function
|
|
56
|
+
`;return r?e.slice(0,r[0].length)+s+e.slice(r[0].length):s+e}function Ro(e,t){let r=e.readFileSync(t,"utf-8"),o=new dg.JSDOM("<!DOCTYPE html><html><body></body></html>",{url:"http://localhost/",pretendToBeVisual:!0}).window,i=sv(r),s=new ug.default(t,module);Object.defineProperty(s,mc,{value:o,enumerable:!1,configurable:!0,writable:!1});try{return s._compile(i,t),s}finally{Reflect.deleteProperty(s,mc),o.close()}}function av(e,t){let r=`/${t}.js`,n=Ro(e,r),o=n.exports.default||n.exports;if(o&&typeof o=="object")try{return(0,lt.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 lv({declarations:e,sources:t,overrideConfig:r={},performTypeCheck:n,bundler:o="webpack"}){let i=new gc.Volume,s=En(o),a=(0,hc.default)(s.generateBaseConfig({entry:e,env:lt.Environment.Client,publicPath:"/",libraryName:"metadata"}),s.getFrameworkConfig(lt.Framework.React,lt.Environment.Client),{entry:e,mode:"development",output:{path:"/",library:{type:"commonjs2"}},target:"node",plugins:n?[new s.typeCheckerPlugin]:[]}),c=s.mergeConfigs(lt.Environment.Client,a,r);return await s.bundle({outputPath:"/",config:c,sourceVolumes:t?[t]:[],outputVolume:i,failOnWarnings:!1}),i}async function cv({declarations:e,sources:t,overrideConfig:r={},bundler:n}){let o=new gc.Volume,i=En(n),s=(0,hc.default)(i.generateBaseConfig({entry:e,env:lt.Environment.Client,publicPath:"/",libraryName:"source-maps"}),i.getFrameworkConfig(lt.Framework.React,lt.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 ms],externals:[(0,fg.default)()]}),a=i.mergeConfigs(lt.Environment.Client,s,r);return a=i.replaceCssPlugin(a),await i.bundle({outputPath:"/",config:a,sourceVolumes:t?[t]:[],outputVolume:o,failOnWarnings:!1}),o}function uv(e){return Object.entries(e.toJSON()).reduce((t,[r,n])=>{if(r.endsWith(".map")&&n?.length){let o=pg.default.basename(r).split(".")[0];t[o]=n}return t},{})}async function gs({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n=!1,skipSourceMaps:o=!1,bundler:i="webpack"}){let[s,a]=await Promise.all([lv({declarations:e,sources:t,overrideConfig:r,performTypeCheck:n,bundler:i}),o||i==="rspack"?Promise.resolve(null):cv({declarations:e,sources:t,overrideConfig:r,bundler:i})]),{metadata:c,options:u}=Object.keys(e).reduce((f,m)=>{let g=av(s,m);return f.metadata[m]=g,f.options[m]=g.options||{},f},{metadata:{},options:{}});return{sourceMaps:a?uv(a):{},metadata:c,options:u}}function mg(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]}]))}Se();var hg=h(require("md5"));be();ie();$();var wc=" ",wg=`${wc}${Si} `;function dv(e){return e==="added"?` ${P("(Added)")}`:e==="removed"?` ${ne("(Removed)")}`:e==="changed"?` ${fe("(Changed)")}`:""}function gg(e){if(!e)return"";let t=JSON.parse(e);return(0,hg.default)(JSON.stringify([...Object.values(t.sources),...t.dependencies.filter(r=>!r.includes("@webflow/data-types")&&!r.includes("@webflow/react"))].sort()))}function pv({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 c=e[s],u=gg(r[s]),p=a.displayName&&c.displayName!==a.displayName,f=u&&a.hash&&u!==gg(a.hash),m=p||f;o[s]={component:c,status:m?"changed":"unchanged",previousName:p?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:c})=>{let u=s.displayName??"Unknown Component",p=c?`${c} ${Pe} ${u}`:u;return`${T(`${wg}${p}`)}${dv(a)}`}).sort().join(`
|
|
57
|
+
`)}function fv({componentsMetadata:e}){return Object.values(e).map(r=>`${T(wg+(r.displayName??"Unknown Component"))}`).sort().join(`
|
|
58
|
+
`)}async function yg({libraryConfig:e,componentsMetadata:t,existingCodeLibraries:r,sourceMaps:n,workspaceInfo:o}){if(H())return Promise.resolve(!0);let i=e.id?r.find(({profile:p})=>p.slug===e.id):null,s=i&&i.profile.status==="ACTIVE",a=s?pv({componentsMetadata:t,latestVersion:i,sourceMaps:n}):fv({componentsMetadata:t}),c=s?`Ready to update ${fe(e.name)} on ${ya(o.name)}?`:`Ready to share ${fe(e.name)} with ${ya(o.name)}?`;return await Ne({message:`${c}
|
|
59
59
|
|
|
60
|
-
${
|
|
60
|
+
${wc}${T("Code components:")}
|
|
61
61
|
${a}
|
|
62
62
|
|
|
63
|
-
${
|
|
63
|
+
${wc}Confirm to proceed`})}var hs=require("path"),vg=require("memfs/lib/volume");var Dg=h(require("fast-glob")),mv=e=>{let t=e.split("/");return t[t.length-1]},gv=e=>mv(e).split(".")[0];async function bg(e,t){return(await Dg.default.glob(e,{absolute:!0,...t||{}})).reduce((n,o)=>{let i=gv(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 ws(e){let t=await bg(e.components,{cwd:(0,hs.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}=hv(t,e.renderer.client,e.globals);return{componentsFiles:r,componentsVolume:n}}function hv(e,t,r){let n={},o={};return Object.entries(e).forEach(([i,s])=>{let a=(0,hs.extname)(s),c=`${_t}/${wm}/${i}${a}`;n[i]=c,o[c]=wv(t,s,r)}),{componentsFiles:n,componentsVolume:vg.Volume.fromJSON(o)}}function wv(e,t,r){return r?`
|
|
64
64
|
import { applyDecorators } from "${e}";
|
|
65
65
|
import componentDefinition from "${t}";
|
|
66
66
|
const globals = require("${r}") || {};
|
|
@@ -82,51 +82,51 @@ export default decoratedDefinition;
|
|
|
82
82
|
`.trim():`
|
|
83
83
|
import componentDefinition from "${t}";
|
|
84
84
|
export default {...componentDefinition};
|
|
85
|
-
`.trim()}
|
|
85
|
+
`.trim()}U();Yi();var Eg=require("@webflow/data-types"),ys={renderer:{client:"@webflow/react",server:"@webflow/react/server"},components:["**/*.webflow.@(js|jsx|mjs|ts|tsx)"],framework:Eg.Framework.React};var _n=require("path"),Cn=require("fs");Se();v();ve();function Wt(e){return e.replace(/\\/g,"/")}be();x();ie();$();function Fg(e){let t={...e};if(e.globals){let r=(0,_n.resolve)(process.cwd(),e.globals);if(!(0,Cn.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.`);t.globals=
|
|
87
|
+
Please ensure the file exists or remove the 'globals' field from your manifest.`);t.globals=Wt(r)}if(e.bundleConfig){let r=(0,_n.resolve)(process.cwd(),e.bundleConfig);if(!(0,Cn.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.`);t.bundleConfig=
|
|
89
|
+
Please ensure the file exists or remove the 'bundleConfig' field from your manifest.`);t.bundleConfig=Wt(r)}if(typeof e.renderer=="string"){let r=(0,_n.resolve)(process.cwd(),e.renderer);(0,Cn.existsSync)(r)&&(t.renderer=Wt(r))}else if(typeof e.renderer=="object"&&typeof t.renderer=="object"){if(typeof e.renderer.client=="string"){let r=(0,_n.resolve)(process.cwd(),e.renderer.client);(0,Cn.existsSync)(r)&&(t.renderer={...t.renderer,client:Wt(r)})}if(typeof e.renderer.server=="string"){let r=(0,_n.resolve)(process.cwd(),e.renderer.server);(0,Cn.existsSync)(r)&&(t.renderer={...t.renderer,server:Wt(r)})}}return t}async function yv({initialData:e}){let t=await ke({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 ke({message:"Enter a description for your code library",default:e?.description??""});if(!await Ne({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 Dv({existingCodeLibraries:e}){let t={name:"[Create new code library]",value:null},n=[...e].sort((i,s)=>{let a=i.resource.codeLibraryResource.manifest.name??"",c=s.resource.codeLibraryResource.manifest.name??"",u=a.localeCompare(c,void 0,{sensitivity:"base"});return u!==0?u: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 c={id:s.slug,name:i.codeLibraryResource.manifest.name,description:i.codeLibraryResource.manifest.description};return{name:a,value:c}});return await Ri({message:"Select an existing code library (or create new):",source:i=>{if(!i)return[t,...n];let s=i.toLowerCase(),a=n.filter(c=>{let u=c.value?.id??"",p=c.value?.name??"",f=c.value?.description??"";return u.toLowerCase().includes(s)||p.toLowerCase().includes(s)||f.toLowerCase().includes(s)});return[t,...a]},pageSize:15})}async function yc({initialData:e,existingCodeLibraries:t}){let r,n={components:ys.components},o=t.length>0?await Dv({existingCodeLibraries:t}):null;if(o)r={...n,...o,...e,id:o.id};else{let a=await yv({initialData:e});r={...n,...e,...a}}let i=Fg(r);pe({library:i}),l.info(`${O} Library configuration updated in webflow.json`);let{path:s}=xr();return{libraryManifest:i,manifestPath:s}}async function xg({existingCodeLibraries:e}){let t=l.spinner("Looking for webflow.json manifest");try{let{manifest:r,manifestPath:n}=J(),o=lo(r,"library");if(!o.id){if(yt())return t.succeed(),yc({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&&yt())return t.succeed(),yc({initialData:o,existingCodeLibraries:e});i||(i=o.id),t.succeed();let s=Fg({...o,name:i});return Promise.resolve({libraryManifest:s,manifestPath:n})}catch(r){if(r instanceof Fr&&yt())return t.info(r.message),yc({existingCodeLibraries:e});throw t.fail(),r}}var Dc=require("memfs/lib/volume"),kg=h(require("webpack-merge"));var Sg="/client-renderer.js",Ag="/server-renderer.js",_g=`${_t}/test-renderers${Sg}`,Cg=`${_t}/test-renderers${Ag}`,bv=new Set(["@webflow/react"]),vv=new Set(["@webflow/react/server","@webflow/emotion-utils/server","@webflow/styled-components-utils/server"]);async function Tg(e){if(!e.client||!e.server)throw new Error("Invalid renderer configuration. Both client and server renderers must be specified.");if(bv.has(e.client)&&vv.has(e.server))return;let t=await xv(e);Ev(e.client,t),Fv(e.server,t)}function Ev(e,t){let r=Ro(t,Sg);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 Fv(e,t){let r=Ro(t,Ag);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 xv(e){let t=new Dc.Volume,r=Wt(e.client),n=Wt(e.server),o={[_g]:`
|
|
90
90
|
export * from "${r}";
|
|
91
|
-
`,[
|
|
91
|
+
`,[Cg]:`
|
|
92
92
|
export * from "${n}";
|
|
93
|
-
`},i=(0,
|
|
93
|
+
`},i=(0,kg.default)(as(),{entry:{"client-renderer":_g,"server-renderer":Cg},mode:"development",output:{path:"/",filename:"[name].js",library:{type:"commonjs2"}},target:"node"});return await us({config:i,sourceVolumes:[Dc.Volume.fromJSON(o)],outputVolume:t,failOnWarnings:!1}),t}async function Ds({existingCodeLibraries:e}){let{libraryManifest:t,manifestPath:r}=await xg({existingCodeLibraries:e}),{renderer:n,...o}=ys,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 Tg(i),{...o,...t,renderer:i,manifestPath:r}}x();$();async function _v(e,t){let{trackPerformance:r,libraryConfig:n}=e;return await r("collect_metadata",async()=>{let{componentsFiles:o,componentsVolume:i}=await ws(n);l.debug(`Components: ${JSON.stringify(o,null,2)}`);let{sourceMaps:s,metadata:a,options:c}=await gs({declarations:o,sources:i,overrideConfig:e.overrideConfig,performTypeCheck:Zi(o,t),bundler:t?.bundler});return l.debug(`Metadata: ${JSON.stringify(a,null,2)}`),l.debug(`Source Maps:
|
|
94
94
|
|
|
95
|
-
${Object.entries(s).reduce((u,[
|
|
95
|
+
${Object.entries(s).reduce((u,[p,f])=>(u+=`${p}: ${JSON.stringify(JSON.parse(f),null,2)}
|
|
96
96
|
|
|
97
|
-
`,u),"")}`),{componentsFiles:o,componentsVolume:i,componentsMetadata:a,componentsOptions:c,sourceMaps:s}})}async function
|
|
97
|
+
`,u),"")}`),{componentsFiles:o,componentsVolume:i,componentsMetadata:a,componentsOptions:c,sourceMaps:s}})}async function Cv(e,t,r,n,o,i,s){let{trackPerformance:a,libraryConfig:c}=e;return await a("generate_library_bundle",async()=>await fs({libraryIdentifier:`_${o}`,renderer:c.renderer,framework:c.framework,publicPath:ar(i[kn.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 kv(e,t,r,n){let{trackPerformance:o,apiOptions:i}=e;return await o("upload_files",async()=>{let s=t.map(([c,u])=>{let p=(0,bs.resolve)((0,bs.join)(`/${u}`,`${c.name}`));return Ao(r.readFileSync(p,"utf8").toString(),p,{bundleEnvironment:u})}),{signatures:a}=await oc({resourceId:n,files:s.map(({meta:c})=>c),options:i});await Promise.all(a.map(async c=>{let u=s.find(p=>p.meta.fileHash===c.hash);if(!u)throw new Error(`File not found: ${c.hash}`);await To(u,c.value)}))})}async function Sv(e,t,r,n,o){let{trackPerformance:i,libraryConfig:s,apiOptions:a}=e;return await i("share_library",async()=>{let c={clientModule:{bundleUrl:ar(o[kn.Environment.Client])+po,loaderType:kn.ModuleLoader.FEDERATION},serverModule:{bundleUrl:ar(o[kn.Environment.Server])+mo}},u=mg(t,{framework:s.framework,sourceMaps:r}),{taskId:p}=await ic({resourceId:n,codeModule:c,components:Object.values(u),options:a});l.debug(JSON.stringify({taskId:p},null,2))})}async function bc(e){e?.verbose&&(process.env.DEBUG="true");let t,r=Date.now(),n=await E({apiToken:e?.apiToken});l.debug("Initializing telemetry service...");let o=b.forCodeLibraries({authToken:n}),i=jp(o);try{l.debug("Checking dependencies versions..."),new kr().run();let s={apiToken:n};t=l.spinner("Initializing");let a=await i("get_code_libraries",async()=>await rc({options:s})),{workspace:c,libraries:u}=a;t.succeed(),l.debug("Parsing library config...");let p=await Ds({existingCodeLibraries:u}),f=p.bundleConfig?require(p.bundleConfig):{},m={trackPerformance:i,apiOptions:s,libraryConfig:p,overrideConfig:f};t=l.spinner("Collecting metadata");let{componentsFiles:g,componentsVolume:w,componentsMetadata:I,componentsOptions:C,sourceMaps:q}=await _v(m,e);if(t.succeed(),!await yg({libraryConfig:p,componentsMetadata:I,existingCodeLibraries:u,sourceMaps:q,workspaceInfo:c}))return;t=l.spinner("Creating code library");let{resourceId:S,profileSlug:oe,workspace:ye,s3Urls:X,cdnUrls:M}=await i("init_code_library",async()=>await nc({name:p.name,slug:p.id,description:p.description,options:s}));t.succeed(),l.debug(JSON.stringify({resourceId:S,profileSlug:oe,s3Urls:X,cdnUrls:M},null,2)),await o.sendUsage("library_initialized",{libraryName:p.name,framework:p.framework,resourceId:S,profileSlug:oe}),p.id||(pe({library:{id:oe}}),l.info(`${O} Library ID updated in webflow.json`)),t=l.spinner("Compiling code components");let{outputFiles:Xn,outputVolume:fa}=await Cv(m,g,w,C,S,M,e);t.succeed(),await o.sendUsage("bundle_generated",{libraryName:p.name,componentCount:Object.keys(g).length,resourceId:S,profileSlug:oe}),t=l.spinner("Uploading files"),await kv(m,Xn,fa,S),t.succeed(),await o.sendUsage("files_uploaded",{libraryName:p.name,fileCount:Xn.length,resourceId:S,profileSlug:oe}),t=l.spinner("Sharing library"),await Sv(m,I,q,S,M),t.succeed(),l.success(`Code library shared successfully${ye?.slug?`: ${fn}/dashboard/workspace/${ye?.slug}/shared-libraries-and-templates`:"!"}`);let ma=Date.now()-r;await o.sendUsage("share_library",{duration:ma,componentCount:Object.keys(g).length,libraryName:p.name,framework:p.framework,resourceId:S,profileSlug:oe})}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 vs=h(require("fs")),Sn=require("path");v();Yi();x();var Av="CodeLibrary",Tv="dist",Iv="http://localhost/";async function vc(e){e.verbose&&(process.env.DEBUG="true");let t;try{l.debug("Checking dependencies versions..."),new kr().run(),l.debug("Looking for manifest...");let r=await Ds({existingCodeLibraries:[]}),n=os(r.name)||Av,o=`_${e.libraryId||n}`;e?.debugBundler&&l.debug(`Library Config: ${JSON.stringify(r,null,2)}`),t=l.spinner("Collecting metadata");let{componentsFiles:i,componentsVolume:s}=await ws(r);e?.debugBundler&&l.debug(`Components: ${JSON.stringify(i,null,2)}`);let a=r.bundleConfig?require(r.bundleConfig):{},{sourceMaps:c,metadata:u,options:p}=await gs({declarations:i,sources:s,overrideConfig:a,performTypeCheck:Zi(i,e),skipSourceMaps:!e?.debugBundler,bundler:e.bundler});e?.debugBundler&&(l.debug(`Metadata: ${JSON.stringify(u,null,2)}`),l.debug(`Source Maps:
|
|
98
98
|
|
|
99
|
-
${Object.entries(c).reduce((g,[
|
|
99
|
+
${Object.entries(c).reduce((g,[w,I])=>(g+=`${w}: ${JSON.stringify(JSON.parse(I),null,2)}
|
|
100
100
|
|
|
101
|
-
`,g),"")}`)),t.succeed(),t=l.spinner("Generating library bundle");let{outputFiles:
|
|
101
|
+
`,g),"")}`)),t.succeed(),t=l.spinner("Generating library bundle");let{outputFiles:f,outputVolume:m}=await fs({libraryIdentifier:o,renderer:r.renderer,framework:r.framework,publicPath:ar(e.publicPath||Iv),sourceVolumes:[s],componentsFiles:i,componentsOptions:p,debugBundler:e?.debugBundler,dev:e?.dev,overrideConfig:a,failOnWarnings:!e.force,bundler:e.bundler});t.succeed(),t=l.spinner("Writing to disk"),f.forEach(([g,w])=>{let I=(0,Sn.join)(`/${w}`,`${g.name}`),C=Ao(m.readFileSync(I,"utf8").toString(),I,{bundleEnvironment:w}),q=(0,Sn.join)(process.cwd(),e.outputPath||Tv);vs.default.existsSync((0,Sn.join)(q,`${w}`))||vs.default.mkdirSync((0,Sn.join)(q,`${w}`),{recursive:!0}),vs.default.writeFileSync((0,Sn.join)(q,w,g.name),C.value.toString())}),t.succeed(),l.success("Code Library bundled successfully!")}catch(r){throw t?.fail(),new d(r)}}v();$();var $o=h(require("fs-extra")),Ec=h(require("path"));v();$();function Ov(){try{if(!$o.default.existsSync(Ye))return null;let e=$o.default.readdirSync(Ye).filter(t=>t.endsWith(".log")).map(t=>({name:t,path:Ec.default.join(Ye,t),time:$o.default.statSync(Ec.default.join(Ye,t)).mtime.getTime()})).sort((t,r)=>r.time-t.time);if(e.length===0)return null;for(let t of e)try{let n=$o.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 Fc(){let e=Ov();e&&l.info(`${pn} Latest log: ${e}`),l.info(`${pn} All logs: ${Ye}`)}async function Ig(e){e.command("log").description("Display the logs directory and path to the latest log file, if available.").action(Fc)}var he=require("commander"),xc=()=>new he.Option("--no-input","Avoid prompting or doing anything interactive. Use this for CI/CD pipelines. Auto-enabled when CI=true or no TTY is detected."),_c=()=>new he.Option("--manifest <path>","Path to a manifest.json file or directory containing webflow.json. Default: ./webflow.json"),Cc=()=>new he.Option("--skip-update-check","Skip checking for @webflow packages updates"),kc=()=>new he.Option("--verbose","Display more information for debugging purposes."),Po=()=>new he.Option("--api-token <token>","API token. Default: value set in WEBFLOW_API_TOKEN env variable."),Xe=()=>new he.Option("-s, --site <site-id>","Site ID. Default: value set in webflow.json config."),Y=()=>new he.Option("--json","Output as JSON"),jo=()=>new he.Option("--app-id <id>","Cloud app ID. Default: value set in webflow.json (cloud.app_id)."),No=()=>new he.Option("--environment-id <id>","Environment ID. Default: value set in webflow.json (cloud.environment_id)."),Sc=()=>new he.Option("--secret","Mark the variable(s) as secret. Secret values are encrypted and never displayed."),Ae=()=>new he.Option("--dry-run","Preview without executing"),Og=()=>new he.Option("-y, --yes","Skip confirmation prompt"),Es=()=>new he.Option("--order <dir>","Sort direction: asc or desc").default("asc"),xe=e=>new he.Option("--fields <fields>",`Comma-separated fields to display (${e.join(", ")})`),Fs=e=>new he.Option("--sort-by <field>",`Sort by: ${e.join(", ")}`),xs=()=>new he.Option("--limit <n>","Maximum number of items to return (default 100)").default("100").argParser(parseInt),_s=()=>new he.Option("--offset <n>","Number of items to skip (default 0)").default("0").argParser(parseInt),Rv=100,Cs=e=>{let t=Number(e);if(!Number.isInteger(t)||t<=0)throw new he.InvalidArgumentError("must be a positive integer.");return t},Ac=()=>new he.Option("--limit <n>","Max log lines to return (default: 100)").default(Rv).argParser(Cs),$v=20,Rg=()=>new he.Option("--limit <n>","Max deployments to return, most recent first (default: 20)").default($v).argParser(Cs),Lo=e=>async(t,r)=>{let o={...r.parent?.opts()||{},...t};await e(o)};ie();var Pv=`${ne("[Deprecated]")} The 'library' commands will be removed in the next major release.`,jv=()=>{l.warn(`${ge} ${ne("webflow library share")} is deprecated and will be removed in the next major release.
|
|
102
102
|
Use ${P("webflow devlink import")} instead.
|
|
103
|
-
`)},
|
|
103
|
+
`)},Nv=()=>{l.warn(`${ge} ${ne("webflow library bundle")} is deprecated and will be removed in the next major release.
|
|
104
104
|
Use ${P("webflow devlink bundle")} instead.
|
|
105
|
-
`)},
|
|
105
|
+
`)},Lv=()=>{l.warn(`${ge} ${ne("webflow library log")} is deprecated and will be removed in the next major release.
|
|
106
106
|
Use ${P("webflow log")} instead.
|
|
107
|
-
`)},tv="Import a library of Code Components into your Webflow Workspace.",rv="Bundle a library of Code Components for local development.",ag=()=>new or.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),lg=()=>new or.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),cg=()=>new or.Option("--dev","Bundle in development mode for debugging purposes."),ug=()=>new or.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),nv=()=>new or.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),ov=()=>new or.Option("--public-path <path>","Set the public path for the bundle."),iv=()=>new or.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function gc(e,t){return e.command(t).description(tv).addOption(To()).addOption(ag()).addOption(lg()).addOption(cg()).addOption(ug()).action(Ro(sc))}function hc(e,t){return e.command(t).description(rv).addOption(nv()).addOption(ov()).addOption(iv()).addOption(ag()).addOption(lg()).addOption(cg()).addOption(ug()).action(Ro(ac))}var dg=e=>{let t=e.command("library").description(Yb);gc(t,"share").description(`${oe("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",Xb),hc(t,"bundle").description(`${oe("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",Qb),t.command("log").description(`${oe("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",ev).action(cc)};ie();var fg=e=>{let t=e.command("devlink").description("CLI for managing your Webflow Components.");t.command("sync").description(`${oe("[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(To()).addOption(qe()).action(Fp),gc(t,"import"),hc(t,"bundle"),t.command("export").description("Export Webflow Components from your Webflow Site.").addOption(To()).addOption(qe()).action(Ro(Gi))};var Bt=h(require("fs")),nt=h(require("path"));b();K();var ae={New:"new",Existing:"existing"},pg="cli",jt=3,Nt=39,ws="astro",mg="cloud-scaffolds";var gg="package.json",Tr="webflow.json",ys="wf-placeholder-name",hg="CLOUD_MOUNT_PATH",wg="gitignore";function wc(e){return!e.siteId}var $o=async(e,t,r=ws,n,o,i)=>{try{let s,a;if("content"in n){let c=n.content;s=c.files,a=u=>nt.relative(c.extractionRoot,u).replace(/\\/g,"/")}else{let u=n[r];if(!u)throw new Error(`Scaffold "${r}" not found`);s=u;let d=nt.join(mg,r);a=p=>p.split(d)[1]?.substring(1).replace(/\\/g,"/")??""}for(let c of s)try{let u=nt.join(e,a(c)),d=c.includes("next.config.ts"),p=c.includes("astro.config.mjs"),m=d||p;if(c.includes(Tr)&&Bt.existsSync(u))continue;if(c.includes(gg)||c.includes(Tr)){let y=(await Bt.promises.readFile(c,"utf8")).replace(ys,e);await Ds(u,y)}else if(m){let g=await Bt.promises.readFile(c,"utf8");await Ds(u,g.replace(hg,t))}else if(nt.basename(u).toLowerCase()===wg){let g=await Bt.promises.readFile(c,"utf8"),y=nt.join(nt.dirname(u),".gitignore");await Ds(y,g)}else{let g=await Bt.promises.readFile(c);await Ds(u,g)}}catch(u){l.error(`Error processing file ${c}: ${u}`)}if(o&&i)try{Ot({siteId:o,apiToken:i,directory:e})}catch(c){l.error(`Error creating .env file: ${c}`)}}catch(s){throw l.error(`Error applying scaffold: ${s}`),s}};var Ds=async(e,t)=>{try{await Bt.promises.mkdir(nt.dirname(e),{recursive:!0}),await Bt.promises.writeFile(e,t)}catch(r){throw l.error(`Error writing file ${e}: ${r}`),r}};var ir=h(require("fs")),yg=h(require("fs-extra")),sr=h(require("path")),Ec=h(require("os")),Dg=h(require("tar"));var xe=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var Po={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2",betaRef:"astro7"}},"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",betaRef:"astro7"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function jo(e){let t=Po[e];if(!t){let r=Object.keys(Po);throw new xe(`Unsupported framework: "${e}". Supported: ${r.join(", ")}`,e,r)}return t}function yc(){return Object.keys(Po)}function Dc(){return[...new Set(yc().map(e=>e.replace(/-minimal$/,"")))]}function bc(){return["astro","nextjs"]}function vc(e){let r=`${e.replace(/-minimal$/,"")}-minimal`;if(!Po[r]){let n=yc();throw new xe(`No minimal scaffold for "${e}". Supported: ${n.join(", ")}`,r,n)}return r}b();var sv="https://github.com";async function Fc(e){let t=e.endsWith("-minimal")?e:vc(e);return bs(t)}async function bs(e){return jo(e).source.type==="github"?av(e):bg(e)}async function bg(e){let t=jo(e);if(t.source.type!=="local")throw new xe(`Scaffold "${e}" does not have a local source`,e);let r=sr.isAbsolute(t.source.path)?t.source.path:sr.join(__dirname,t.source.path);if(!ir.existsSync(r))throw new xe(`Scaffold directory not found: ${r}`,e);let n=await xc(r);return{scaffoldId:e,files:n,extractionRoot:r}}async function av(e){let t=jo(e);if(t.source.type!=="github")throw new xe(`Scaffold "${e}" does not have a GitHub source`,e);let r=(Kt()?t.source.betaRef:void 0)??t.source.ref??"main",n=`${sv}/${t.source.repo}/archive/${r}.tar.gz`,o=await ir.promises.mkdtemp(sr.join(Ec.tmpdir(),`webflow-scaffold-${e}-`)),i=l.spinner(`Downloading scaffold (${t.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(g){throw i.fail("Download failed"),new xe(`Failed to fetch scaffold from GitHub: ${g instanceof Error?g.message:String(g)}. Repo: ${t.source.repo}, ref: ${r}`,e)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new xe(`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 c=l.spinner("Unpacking scaffold");try{await lv(a,o),c.succeed("Scaffold ready")}catch(g){throw c.fail("Unpack failed"),g}let u=await ir.promises.readdir(o),d=u[0];if(!d||u.length!==1)throw new xe(`Unexpected tarball structure for ${t.source.repo}`,e);let p=sr.join(o,d),m=await xc(p);return{scaffoldId:e,files:m,extractionRoot:p}}catch(s){try{yg.default.removeSync(o)}catch{}throw s instanceof xe?s:new xe(`Failed to fetch scaffold "${e}": ${s instanceof Error?s.message:String(s)}`,e)}}async function lv(e,t){let r=sr.join(Ec.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await ir.promises.writeFile(r,new Uint8Array(e.buffer,e.byteOffset,e.byteLength));try{await Dg.extract({file:r,cwd:t})}finally{await ir.promises.unlink(r).catch(()=>{})}}async function xc(e){let t=[],r=await ir.promises.readdir(e,{withFileTypes:!0});for(let n of r){let o=sr.join(e,n.name);n.isDirectory()?t.push(...await xc(o)):t.push(o)}return t}var Kc=h(require("fs-extra"));K();q();var U=h(require("fs")),te=h(require("path")),Go=require("child_process"),nh=h(require("tar"));var Pe=h(require("fs")),ht=h(require("path"));var L={};Ju(L,{BRAND:()=>$v,DIRTY:()=>Ir,EMPTY_PATH:()=>fv,INVALID:()=>N,NEVER:()=>yE,OK:()=>$e,ParseStatus:()=>Ae,Schema:()=>z,ZodAny:()=>cr,ZodArray:()=>Ut,ZodBigInt:()=>Rr,ZodBoolean:()=>$r,ZodBranded:()=>Bo,ZodCatch:()=>Jr,ZodDate:()=>Pr,ZodDefault:()=>Hr,ZodDiscriminatedUnion:()=>Fs,ZodEffects:()=>st,ZodEnum:()=>Ur,ZodError:()=>Le,ZodFirstPartyTypeKind:()=>B,ZodFunction:()=>Cs,ZodIntersection:()=>Lr,ZodIssueCode:()=>w,ZodLazy:()=>Mr,ZodLiteral:()=>Wr,ZodMap:()=>Sn,ZodNaN:()=>Tn,ZodNativeEnum:()=>Vr,ZodNever:()=>mt,ZodNull:()=>Nr,ZodNullable:()=>Et,ZodNumber:()=>Or,ZodObject:()=>Me,ZodOptional:()=>ot,ZodParsedType:()=>k,ZodPipeline:()=>Lo,ZodPromise:()=>ur,ZodReadonly:()=>Gr,ZodRecord:()=>xs,ZodSchema:()=>z,ZodSet:()=>An,ZodString:()=>lr,ZodSymbol:()=>_n,ZodTransformer:()=>st,ZodTuple:()=>vt,ZodType:()=>z,ZodUndefined:()=>jr,ZodUnion:()=>Br,ZodUnknown:()=>Wt,ZodVoid:()=>kn,addIssueToContext:()=>v,any:()=>Vv,array:()=>zv,bigint:()=>Bv,boolean:()=>Ig,coerce:()=>wE,custom:()=>Sg,date:()=>Lv,datetimeRegex:()=>_g,defaultErrorMap:()=>Lt,discriminatedUnion:()=>Yv,effect:()=>cE,enum:()=>sE,function:()=>nE,getErrorMap:()=>Fn,getParsedType:()=>bt,instanceof:()=>jv,intersection:()=>Xv,isAborted:()=>vs,isAsync:()=>xn,isDirty:()=>Es,isValid:()=>ar,late:()=>Pv,lazy:()=>oE,literal:()=>iE,makeIssue:()=>No,map:()=>tE,nan:()=>Nv,nativeEnum:()=>aE,never:()=>Jv,null:()=>Uv,nullable:()=>dE,number:()=>Tg,object:()=>qv,objectUtil:()=>Cc,oboolean:()=>hE,onumber:()=>gE,optional:()=>uE,ostring:()=>mE,pipeline:()=>pE,preprocess:()=>fE,promise:()=>lE,quotelessJson:()=>cv,record:()=>eE,set:()=>rE,setErrorMap:()=>dv,strictObject:()=>Kv,string:()=>Ag,symbol:()=>Mv,transformer:()=>cE,tuple:()=>Qv,undefined:()=>Wv,union:()=>Zv,unknown:()=>Hv,util:()=>Q,void:()=>Gv});var Q;(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})(Q||(Q={}));var Cc;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Cc||(Cc={}));var k=Q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),bt=e=>{switch(typeof e){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(e)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":return Array.isArray(e)?k.array:e===null?k.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?k.promise:typeof Map<"u"&&e instanceof Map?k.map:typeof Set<"u"&&e instanceof Set?k.set:typeof Date<"u"&&e instanceof Date?k.date:k.object;default:return k.unknown}};var w=Q.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"]),cv=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Le=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,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};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,Q.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()}};Le.create=e=>new Le(e);var uv=(e,t)=>{let r;switch(e.code){case w.invalid_type:e.received===k.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,Q.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${Q.joinValues(e.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Q.joinValues(e.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${Q.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.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}"`:Q.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case w.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 w.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 w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=t.defaultError,Q.assertNever(e)}return{message:r}},Lt=uv;var vg=Lt;function dv(e){vg=e}function Fn(){return vg}var No=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="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},fv=[];function v(e,t){let r=Fn(),n=No({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Lt?void 0:Lt].filter(o=>!!o)});e.common.issues.push(n)}var Ae=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 N;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 N;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}}},N=Object.freeze({status:"aborted"}),Ir=e=>({status:"dirty",value:e}),$e=e=>({status:"valid",value:e}),vs=e=>e.status==="aborted",Es=e=>e.status==="dirty",ar=e=>e.status==="valid",xn=e=>typeof Promise<"u"&&e instanceof Promise;var O;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(O||(O={}));var it=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}},Eg=(e,t)=>{if(ar(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 Le(e.common.issues);return this._error=r,this._error}}};function H(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:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}var z=class{get description(){return this._def.description}_getType(t){return bt(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ae,ctx:{common:t.parent.common,data:t.data,parsedType:bt(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(xn(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:bt(t)},o=this._parseSync({data:t,path:n.path,parent:n});return Eg(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:bt(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return ar(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=>ar(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:bt(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(xn(o)?o:Promise.resolve(o));return Eg(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:w.custom,...n(o)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!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 st({schema:this,typeName:B.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 ot.create(this,this._def)}nullable(){return Et.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ut.create(this)}promise(){return ur.create(this,this._def)}or(t){return Br.create([this,t],this._def)}and(t){return Lr.create(this,t,this._def)}transform(t){return new st({...H(this._def),schema:this,typeName:B.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Hr({...H(this._def),innerType:this,defaultValue:r,typeName:B.ZodDefault})}brand(){return new Bo({typeName:B.ZodBranded,type:this,...H(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Jr({...H(this._def),innerType:this,catchValue:r,typeName:B.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Lo.create(this,t)}readonly(){return Gr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},pv=/^c[^\s-]{8,}$/i,mv=/^[0-9a-z]+$/,gv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hv=/^[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,wv=/^[a-z0-9_-]{21}$/i,yv=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Dv=/^[-+]?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)?)??$/,bv=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,vv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_c,Ev=/^(?:(?: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])$/,Fv=/^(?:(?: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])$/,xv=/^(([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]))$/,Cv=/^(([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])$/,_v=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kv=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,xg="((\\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])))",Sv=new RegExp(`^${xg}$`);function Cg(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 Av(e){return new RegExp(`^${Cg(e)}$`)}function _g(e){let t=`${xg}T${Cg(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 Tv(e,t){return!!((t==="v4"||!t)&&Ev.test(e)||(t==="v6"||!t)&&xv.test(e))}function Iv(e,t){if(!yv.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 Ov(e,t){return!!((t==="v4"||!t)&&Fv.test(e)||(t==="v6"||!t)&&Cv.test(e))}var lr=class e extends z{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==k.string){let i=this._getOrReturnCtx(t);return v(i,{code:w.invalid_type,expected:k.string,received:i.parsedType}),N}let n=new Ae,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),v(o,{code:w.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),v(o,{code:w.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?v(o,{code:w.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&v(o,{code:w.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")bv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"email",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")_c||(_c=new RegExp(vv,"u")),_c.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"emoji",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")hv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"uuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")wv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"nanoid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")pv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")mv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"cuid2",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")gv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"ulid",code:w.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),v(o,{validation:"url",code:w.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),v(o,{validation:"regex",code:w.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),v(o,{code:w.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),v(o,{code:w.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),v(o,{code:w.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?_g(i).test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{code:w.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?Sv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{code:w.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?Av(i).test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{code:w.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?Dv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"duration",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Tv(t.data,i.version)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"ip",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?Iv(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"jwt",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Ov(t.data,i.version)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"cidr",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?_v.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"base64",code:w.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?kv.test(t.data)||(o=this._getOrReturnCtx(t,o),v(o,{validation:"base64url",code:w.invalid_string,message:i.message}),n.dirty()):Q.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:w.invalid_string,...O.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...O.errToObj(t)})}url(t){return this._addCheck({kind:"url",...O.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...O.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...O.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...O.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...O.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...O.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...O.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...O.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...O.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...O.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...O.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...O.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,...O.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,...O.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...O.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...O.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...O.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...O.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...O.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...O.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...O.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...O.errToObj(r)})}nonempty(t){return this.min(1,O.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}};lr.create=e=>new lr({checks:[],typeName:B.ZodString,coerce:e?.coerce??!1,...H(e)});function Rv(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 Or=class e extends z{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)!==k.number){let i=this._getOrReturnCtx(t);return v(i,{code:w.invalid_type,expected:k.number,received:i.parsedType}),N}let n,o=new Ae;for(let i of this._def.checks)i.kind==="int"?Q.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),v(n,{code:w.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),v(n,{code:w.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),v(n,{code:w.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Rv(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),v(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),v(n,{code:w.not_finite,message:i.message}),o.dirty()):Q.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,O.toString(r))}gt(t,r){return this.setLimit("min",t,!1,O.toString(r))}lte(t,r){return this.setLimit("max",t,!0,O.toString(r))}lt(t,r){return this.setLimit("max",t,!1,O.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:O.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:O.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:O.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:O.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.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"&&Q.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)}};Or.create=e=>new Or({checks:[],typeName:B.ZodNumber,coerce:e?.coerce||!1,...H(e)});var Rr=class e extends z{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)!==k.bigint)return this._getInvalidInput(t);let n,o=new Ae;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),v(n,{code:w.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),v(n,{code:w.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),v(n,{code:w.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):Q.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return v(r,{code:w.invalid_type,expected:k.bigint,received:r.parsedType}),N}gte(t,r){return this.setLimit("min",t,!0,O.toString(r))}gt(t,r){return this.setLimit("min",t,!1,O.toString(r))}lte(t,r){return this.setLimit("max",t,!0,O.toString(r))}lt(t,r){return this.setLimit("max",t,!1,O.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:O.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:O.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:O.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}};Rr.create=e=>new Rr({checks:[],typeName:B.ZodBigInt,coerce:e?.coerce??!1,...H(e)});var $r=class extends z{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==k.boolean){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.boolean,received:n.parsedType}),N}return $e(t.data)}};$r.create=e=>new $r({typeName:B.ZodBoolean,coerce:e?.coerce||!1,...H(e)});var Pr=class e extends z{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==k.date){let i=this._getOrReturnCtx(t);return v(i,{code:w.invalid_type,expected:k.date,received:i.parsedType}),N}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return v(i,{code:w.invalid_date}),N}let n=new Ae,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),v(o,{code:w.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),v(o,{code:w.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Q.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:O.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:O.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}};Pr.create=e=>new Pr({checks:[],coerce:e?.coerce||!1,typeName:B.ZodDate,...H(e)});var _n=class extends z{_parse(t){if(this._getType(t)!==k.symbol){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.symbol,received:n.parsedType}),N}return $e(t.data)}};_n.create=e=>new _n({typeName:B.ZodSymbol,...H(e)});var jr=class extends z{_parse(t){if(this._getType(t)!==k.undefined){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.undefined,received:n.parsedType}),N}return $e(t.data)}};jr.create=e=>new jr({typeName:B.ZodUndefined,...H(e)});var Nr=class extends z{_parse(t){if(this._getType(t)!==k.null){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.null,received:n.parsedType}),N}return $e(t.data)}};Nr.create=e=>new Nr({typeName:B.ZodNull,...H(e)});var cr=class extends z{constructor(){super(...arguments),this._any=!0}_parse(t){return $e(t.data)}};cr.create=e=>new cr({typeName:B.ZodAny,...H(e)});var Wt=class extends z{constructor(){super(...arguments),this._unknown=!0}_parse(t){return $e(t.data)}};Wt.create=e=>new Wt({typeName:B.ZodUnknown,...H(e)});var mt=class extends z{_parse(t){let r=this._getOrReturnCtx(t);return v(r,{code:w.invalid_type,expected:k.never,received:r.parsedType}),N}};mt.create=e=>new mt({typeName:B.ZodNever,...H(e)});var kn=class extends z{_parse(t){if(this._getType(t)!==k.undefined){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.void,received:n.parsedType}),N}return $e(t.data)}};kn.create=e=>new kn({typeName:B.ZodVoid,...H(e)});var Ut=class e extends z{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==k.array)return v(r,{code:w.invalid_type,expected:k.array,received:r.parsedType}),N;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(v(r,{code:s?w.too_big:w.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&&(v(r,{code:w.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&&(v(r,{code:w.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 it(r,s,r.path,a)))).then(s=>Ae.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new it(r,s,r.path,a)));return Ae.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:O.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:O.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:O.toString(r)}})}nonempty(t){return this.min(1,t)}};Ut.create=(e,t)=>new Ut({type:e,minLength:null,maxLength:null,exactLength:null,typeName:B.ZodArray,...H(t)});function Cn(e){if(e instanceof Me){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ot.create(Cn(n))}return new Me({...e._def,shape:()=>t})}else return e instanceof Ut?new Ut({...e._def,type:Cn(e.element)}):e instanceof ot?ot.create(Cn(e.unwrap())):e instanceof Et?Et.create(Cn(e.unwrap())):e instanceof vt?vt.create(e.items.map(t=>Cn(t))):e}var Me=class e extends z{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=Q.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==k.object){let u=this._getOrReturnCtx(t);return v(u,{code:w.invalid_type,expected:k.object,received:u.parsedType}),N}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mt&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let d=i[u],p=o.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new it(o,p,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof mt){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:o.data[d]}});else if(u==="strict")a.length>0&&(v(o,{code:w.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 d of a){let p=o.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new it(o,p,o.path,d)),alwaysSet:d in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let p=await d.key,m=await d.value;u.push({key:p,value:m,alwaysSet:d.alwaysSet})}return u}).then(u=>Ae.mergeObjectSync(n,u)):Ae.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return O.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:O.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:B.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 Q.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 Q.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Cn(this)}partial(t){let r={};for(let n of Q.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 Q.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ot;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return kg(Q.objectKeys(this.shape))}};Me.create=(e,t)=>new Me({shape:()=>e,unknownKeys:"strip",catchall:mt.create(),typeName:B.ZodObject,...H(t)});Me.strictCreate=(e,t)=>new Me({shape:()=>e,unknownKeys:"strict",catchall:mt.create(),typeName:B.ZodObject,...H(t)});Me.lazycreate=(e,t)=>new Me({shape:e,unknownKeys:"strip",catchall:mt.create(),typeName:B.ZodObject,...H(t)});var Br=class extends z{_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 Le(a.ctx.common.issues));return v(r,{code:w.invalid_union,unionErrors:s}),N}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 c of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,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(c=>new Le(c));return v(r,{code:w.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};Br.create=(e,t)=>new Br({options:e,typeName:B.ZodUnion,...H(t)});var Mt=e=>e instanceof Mr?Mt(e.schema):e instanceof st?Mt(e.innerType()):e instanceof Wr?[e.value]:e instanceof Ur?e.options:e instanceof Vr?Q.objectValues(e.enum):e instanceof Hr?Mt(e._def.innerType):e instanceof jr?[void 0]:e instanceof Nr?[null]:e instanceof ot?[void 0,...Mt(e.unwrap())]:e instanceof Et?[null,...Mt(e.unwrap())]:e instanceof Bo||e instanceof Gr?Mt(e.unwrap()):e instanceof Jr?Mt(e._def.innerType):[],Fs=class e extends z{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==k.object)return v(r,{code:w.invalid_type,expected:k.object,received:r.parsedType}),N;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}):(v(r,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),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=Mt(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:B.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...H(n)})}};function kc(e,t){let r=bt(e),n=bt(t);if(e===t)return{valid:!0,data:e};if(r===k.object&&n===k.object){let o=Q.objectKeys(t),i=Q.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=kc(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===k.array&&n===k.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],c=kc(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===k.date&&n===k.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Lr=class extends z{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(vs(i)||vs(s))return N;let a=kc(i.value,s.value);return a.valid?((Es(i)||Es(s))&&r.dirty(),{status:r.value,value:a.data}):(v(n,{code:w.invalid_intersection_types}),N)};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}))}};Lr.create=(e,t,r)=>new Lr({left:e,right:t,typeName:B.ZodIntersection,...H(r)});var vt=class e extends z{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==k.array)return v(n,{code:w.invalid_type,expected:k.array,received:n.parsedType}),N;if(n.data.length<this._def.items.length)return v(n,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new it(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Ae.mergeArray(r,s)):Ae.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};vt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vt({items:e,typeName:B.ZodTuple,rest:null,...H(t)})};var xs=class e extends z{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!==k.object)return v(n,{code:w.invalid_type,expected:k.object,received:n.parsedType}),N;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new it(n,a,n.path,a)),value:s._parse(new it(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ae.mergeObjectAsync(r,o):Ae.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof z?new e({keyType:t,valueType:r,typeName:B.ZodRecord,...H(n)}):new e({keyType:lr.create(),valueType:t,typeName:B.ZodRecord,...H(r)})}},Sn=class extends z{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!==k.map)return v(n,{code:w.invalid_type,expected:k.map,received:n.parsedType}),N;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new it(n,a,n.path,[u,"key"])),value:i._parse(new it(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return N;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return N;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};Sn.create=(e,t,r)=>new Sn({valueType:t,keyType:e,typeName:B.ZodMap,...H(r)});var An=class e extends z{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==k.set)return v(n,{code:w.invalid_type,expected:k.set,received:n.parsedType}),N;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(v(n,{code:w.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&&(v(n,{code:w.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(c){let u=new Set;for(let d of c){if(d.status==="aborted")return N;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new it(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:O.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:O.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};An.create=(e,t)=>new An({valueType:e,minSize:null,maxSize:null,typeName:B.ZodSet,...H(t)});var Cs=class e extends z{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==k.function)return v(r,{code:w.invalid_type,expected:k.function,received:r.parsedType}),N;function n(a,c){return No({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Fn(),Lt].filter(u=>!!u),issueData:{code:w.invalid_arguments,argumentsError:c}})}function o(a,c){return No({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Fn(),Lt].filter(u=>!!u),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof ur){let a=this;return $e(async function(...c){let u=new Le([]),d=await a._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),p=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(p,i).catch(g=>{throw u.addIssue(o(p,g)),u})})}else{let a=this;return $e(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new Le([n(c,u.error)]);let d=Reflect.apply(s,this,u.data),p=a._def.returns.safeParse(d,i);if(!p.success)throw new Le([o(d,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:vt.create(t).rest(Wt.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||vt.create([]).rest(Wt.create()),returns:r||Wt.create(),typeName:B.ZodFunction,...H(n)})}},Mr=class extends z{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})}};Mr.create=(e,t)=>new Mr({getter:e,typeName:B.ZodLazy,...H(t)});var Wr=class extends z{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return v(r,{received:r.data,code:w.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wr.create=(e,t)=>new Wr({value:e,typeName:B.ZodLiteral,...H(t)});function kg(e,t){return new Ur({values:e,typeName:B.ZodEnum,...H(t)})}var Ur=class e extends z{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return v(r,{expected:Q.joinValues(n),received:r.parsedType,code:w.invalid_type}),N}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 v(r,{received:r.data,code:w.invalid_enum_value,options:n}),N}return $e(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})}};Ur.create=kg;var Vr=class extends z{_parse(t){let r=Q.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==k.string&&n.parsedType!==k.number){let o=Q.objectValues(r);return v(n,{expected:Q.joinValues(o),received:n.parsedType,code:w.invalid_type}),N}if(this._cache||(this._cache=new Set(Q.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=Q.objectValues(r);return v(n,{received:n.data,code:w.invalid_enum_value,options:o}),N}return $e(t.data)}get enum(){return this._def.values}};Vr.create=(e,t)=>new Vr({values:e,typeName:B.ZodNativeEnum,...H(t)});var ur=class extends z{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==k.promise&&r.common.async===!1)return v(r,{code:w.invalid_type,expected:k.promise,received:r.parsedType}),N;let n=r.parsedType===k.promise?r.data:Promise.resolve(r.data);return $e(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};ur.create=(e,t)=>new ur({type:e,typeName:B.ZodPromise,...H(t)});var st=class extends z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===B.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=>{v(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 N;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?N:c.status==="dirty"?Ir(c.value):r.value==="dirty"?Ir(c.value):c});{if(r.value==="aborted")return N;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?N:a.status==="dirty"?Ir(a.value):r.value==="dirty"?Ir(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c 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"?N:(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"?N:(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(!ar(s))return N;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=>ar(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):N);Q.assertNever(o)}};st.create=(e,t,r)=>new st({schema:e,typeName:B.ZodEffects,effect:t,...H(r)});st.createWithPreprocess=(e,t,r)=>new st({schema:t,effect:{type:"preprocess",transform:e},typeName:B.ZodEffects,...H(r)});var ot=class extends z{_parse(t){return this._getType(t)===k.undefined?$e(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ot.create=(e,t)=>new ot({innerType:e,typeName:B.ZodOptional,...H(t)});var Et=class extends z{_parse(t){return this._getType(t)===k.null?$e(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Et.create=(e,t)=>new Et({innerType:e,typeName:B.ZodNullable,...H(t)});var Hr=class extends z{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===k.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Hr.create=(e,t)=>new Hr({innerType:e,typeName:B.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...H(t)});var Jr=class extends z{_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 xn(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Le(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Le(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Jr.create=(e,t)=>new Jr({innerType:e,typeName:B.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...H(t)});var Tn=class extends z{_parse(t){if(this._getType(t)!==k.nan){let n=this._getOrReturnCtx(t);return v(n,{code:w.invalid_type,expected:k.nan,received:n.parsedType}),N}return{status:"valid",value:t.data}}};Tn.create=e=>new Tn({typeName:B.ZodNaN,...H(e)});var $v=Symbol("zod_brand"),Bo=class extends z{_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}},Lo=class e extends z{_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"?N:i.status==="dirty"?(r.dirty(),Ir(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"?N: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:B.ZodPipeline})}},Gr=class extends z{_parse(t){let r=this._def.innerType._parse(t),n=o=>(ar(o)&&(o.value=Object.freeze(o.value)),o);return xn(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Gr.create=(e,t)=>new Gr({innerType:e,typeName:B.ZodReadonly,...H(t)});function Fg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function Sg(e,t={},r){return e?cr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Fg(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Fg(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):cr.create()}var Pv={object:Me.lazycreate},B;(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"})(B||(B={}));var jv=(e,t={message:`Input not instance of ${e.name}`})=>Sg(r=>r instanceof e,t),Ag=lr.create,Tg=Or.create,Nv=Tn.create,Bv=Rr.create,Ig=$r.create,Lv=Pr.create,Mv=_n.create,Wv=jr.create,Uv=Nr.create,Vv=cr.create,Hv=Wt.create,Jv=mt.create,Gv=kn.create,zv=Ut.create,qv=Me.create,Kv=Me.strictCreate,Zv=Br.create,Yv=Fs.create,Xv=Lr.create,Qv=vt.create,eE=xs.create,tE=Sn.create,rE=An.create,nE=Cs.create,oE=Mr.create,iE=Wr.create,sE=Ur.create,aE=Vr.create,lE=ur.create,cE=st.create,uE=ot.create,dE=Et.create,fE=st.createWithPreprocess,pE=Lo.create,mE=()=>Ag().optional(),gE=()=>Tg().optional(),hE=()=>Ig().optional(),wE={string:(e=>lr.create({...e,coerce:!0})),number:(e=>Or.create({...e,coerce:!0})),boolean:(e=>$r.create({...e,coerce:!0})),bigint:(e=>Rr.create({...e,coerce:!0})),date:(e=>Pr.create({...e,coerce:!0}))};var yE=N;function _s(e,t=!1){let r=e.length,n=0,o="",i=0,s=16,a=0,c=0,u=0,d=0,p=0;function m(E,Z){let he=0,Y=0;for(;he<E||!Z;){let M=e.charCodeAt(n);if(M>=48&&M<=57)Y=Y*16+M-48;else if(M>=65&&M<=70)Y=Y*16+M-65+10;else if(M>=97&&M<=102)Y=Y*16+M-97+10;else break;n++,he++}return he<E&&(Y=-1),Y}function g(E){n=E,o="",i=0,s=16,p=0}function y(){let E=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&In(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&In(e.charCodeAt(n)))for(n++;n<e.length&&In(e.charCodeAt(n));)n++;else return p=3,e.substring(E,n);let Z=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&&In(e.charCodeAt(n))){for(n++;n<e.length&&In(e.charCodeAt(n));)n++;Z=n}else p=3;return e.substring(E,Z)}function F(){let E="",Z=n;for(;;){if(n>=r){E+=e.substring(Z,n),p=2;break}let he=e.charCodeAt(n);if(he===34){E+=e.substring(Z,n),n++;break}if(he===92){if(E+=e.substring(Z,n),n++,n>=r){p=2;break}switch(e.charCodeAt(n++)){case 34:E+='"';break;case 92:E+="\\";break;case 47:E+="/";break;case 98:E+="\b";break;case 102:E+="\f";break;case 110:E+=`
|
|
108
|
-
`;break;case 114:
|
|
109
|
-
`),a++,u=n,s=14;switch(
|
|
110
|
-
`+" ".repeat(t)),"\r":new Array(
|
|
111
|
-
`+" ".repeat(t))}," ":{"\n":new Array(
|
|
112
|
-
`+" ".repeat(t)),"\r":new Array(
|
|
113
|
-
`+" ".repeat(t))}};var
|
|
107
|
+
`)},Bv="Import a library of Code Components into your Webflow Workspace.",Mv="Bundle a library of Code Components for local development.",$g=()=>new cr.Option("-f, --force","Force the bundler to finish compiling, even if there are warnings or type errors."),Pg=()=>new cr.Option("--debug-bundler","Display final bundler configurations for debugging purposes."),jg=()=>new cr.Option("--dev","Bundle in development mode for debugging purposes."),Ng=()=>new cr.Option("--bundler <engine>","Bundler to use: webpack or rspack (experimental). Default: webpack").choices(["webpack","rspack"]).default("webpack").hideHelp(),Wv=()=>new cr.Option("--library-id <id>","Set the library identifier to use for the bundle.").hideHelp(),Uv=()=>new cr.Option("--public-path <path>","Set the public path for the bundle."),Vv=()=>new cr.Option("--output-path <path>","Override the output path for the bundle. Default is './dist'");function Tc(e,t){return e.command(t).description(Bv).addOption(Po()).addOption($g()).addOption(Pg()).addOption(jg()).addOption(Ng()).action(Lo(bc))}function Ic(e,t){return e.command(t).description(Mv).addOption(Wv()).addOption(Uv()).addOption(Vv()).addOption($g()).addOption(Pg()).addOption(jg()).addOption(Ng()).action(Lo(vc))}var Lg=e=>{let t=e.command("library").description(Pv);Tc(t,"share").description(`${ne("[Deprecated]")} Use 'webflow devlink import' instead.`).hook("preAction",jv),Ic(t,"bundle").description(`${ne("[Deprecated]")} Use 'webflow devlink bundle' instead.`).hook("preAction",Nv),t.command("log").description(`${ne("[Deprecated]")} Use 'webflow log' instead.`).hook("preAction",Lv).action(Fc)};ie();var Bg=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(Po()).addOption(Xe()).action(Kf),Tc(t,"import"),Ic(t,"bundle"),t.command("export").description("Export Webflow Components from your Webflow Site.").addOption(Po()).addOption(Xe()).action(Lo(ts))};var Ht=h(require("fs")),ct=h(require("path"));v();U();var ae={New:"new",Existing:"existing"},Mg="cli",Ut=3,Vt=39,ks="astro",Wg="cloud-scaffolds";var Ug="package.json",jr="webflow.json",Ss="wf-placeholder-name",Vg="CLOUD_MOUNT_PATH",Hg="gitignore";function Oc(e){return!e.siteId}var Bo=async(e,t,r=ks,n,o,i)=>{try{let s,a;if("content"in n){let c=n.content;s=c.files,a=u=>ct.relative(c.extractionRoot,u).replace(/\\/g,"/")}else{let u=n[r];if(!u)throw new Error(`Scaffold "${r}" not found`);s=u;let p=ct.join(Wg,r);a=f=>f.split(p)[1]?.substring(1).replace(/\\/g,"/")??""}for(let c of s)try{let u=ct.join(e,a(c)),p=c.includes("next.config.ts"),f=c.includes("astro.config.mjs"),m=p||f;if(c.includes(jr)&&Ht.existsSync(u))continue;if(c.includes(Ug)||c.includes(jr)){let w=(await Ht.promises.readFile(c,"utf8")).replace(Ss,e);await As(u,w)}else if(m){let g=await Ht.promises.readFile(c,"utf8");await As(u,g.replace(Vg,t))}else if(ct.basename(u).toLowerCase()===Hg){let g=await Ht.promises.readFile(c,"utf8"),w=ct.join(ct.dirname(u),".gitignore");await As(w,g)}else{let g=await Ht.promises.readFile(c);await As(u,g)}}catch(u){l.error(`Error processing file ${c}: ${u}`)}if(o&&i)try{Lt({siteId:o,apiToken:i,directory:e})}catch(c){l.error(`Error creating .env file: ${c}`)}}catch(s){throw l.error(`Error applying scaffold: ${s}`),s}};var As=async(e,t)=>{try{await Ht.promises.mkdir(ct.dirname(e),{recursive:!0}),await Ht.promises.writeFile(e,t)}catch(r){throw l.error(`Error writing file ${e}: ${r}`),r}};var ur=h(require("fs")),Jg=h(require("fs-extra")),dr=h(require("path")),Nc=h(require("os")),Gg=h(require("tar"));var Te=class extends Error{constructor(r,n,o){super(r);this.scaffoldId=n;this.supportedIds=o;this.name="ScaffoldError"}};var Mo={"astro-minimal":{id:"astro-minimal",name:"Astro",source:{type:"github",repo:"Webflow-Examples/hello-world-astro",ref:"v2",betaRef:"astro7"}},"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",betaRef:"astro7"}},nextjs:{id:"nextjs",name:"Next.js (site-attached)",source:{type:"github",repo:"Webflow-Examples/hello-world-nextjs-devlink",ref:"v1"}}};function Wo(e){let t=Mo[e];if(!t){let r=Object.keys(Mo);throw new Te(`Unsupported framework: "${e}". Supported: ${r.join(", ")}`,e,r)}return t}function Rc(){return Object.keys(Mo)}function $c(){return[...new Set(Rc().map(e=>e.replace(/-minimal$/,"")))]}function Pc(){return["astro","nextjs"]}function jc(e){let r=`${e.replace(/-minimal$/,"")}-minimal`;if(!Mo[r]){let n=Rc();throw new Te(`No minimal scaffold for "${e}". Supported: ${n.join(", ")}`,r,n)}return r}v();Ar();var Hv="https://github.com";async function Lc(e){let t=e.endsWith("-minimal")?e:jc(e);return Ts(t)}async function Ts(e){return Wo(e).source.type==="github"?Jv(e):zg(e)}async function zg(e){let t=Wo(e);if(t.source.type!=="local")throw new Te(`Scaffold "${e}" does not have a local source`,e);let r=dr.isAbsolute(t.source.path)?t.source.path:dr.join(__dirname,t.source.path);if(!ur.existsSync(r))throw new Te(`Scaffold directory not found: ${r}`,e);let n=await Bc(r);return{scaffoldId:e,files:n,extractionRoot:r}}async function Jv(e){let t=Wo(e);if(t.source.type!=="github")throw new Te(`Scaffold "${e}" does not have a GitHub source`,e);let r=(st()?t.source.betaRef:void 0)??t.source.ref??"main",n=`${Hv}/${t.source.repo}/archive/${r}.tar.gz`,o=await ur.promises.mkdtemp(dr.join(Nc.tmpdir(),`webflow-scaffold-${e}-`)),i=l.spinner(`Downloading scaffold (${t.source.repo}@${r})`);try{let s;try{s=await fetch(n,{redirect:"follow",headers:{"User-Agent":"webflow-cli"}})}catch(g){throw i.fail("Download failed"),new Te(`Failed to fetch scaffold from GitHub: ${g instanceof Error?g.message:String(g)}. Repo: ${t.source.repo}, ref: ${r}`,e)}if(!s.ok)throw i.fail(`GitHub returned ${s.status} ${s.statusText}`),new Te(`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 c=l.spinner("Unpacking scaffold");try{await Gv(a,o),c.succeed("Scaffold ready")}catch(g){throw c.fail("Unpack failed"),g}let u=await ur.promises.readdir(o),p=u[0];if(!p||u.length!==1)throw new Te(`Unexpected tarball structure for ${t.source.repo}`,e);let f=dr.join(o,p),m=await Bc(f);return{scaffoldId:e,files:m,extractionRoot:f}}catch(s){try{Jg.default.removeSync(o)}catch{}throw s instanceof Te?s:new Te(`Failed to fetch scaffold "${e}": ${s instanceof Error?s.message:String(s)}`,e)}}async function Gv(e,t){let r=dr.join(Nc.tmpdir(),`webflow-scaffold-${Date.now()}.tar.gz`);await ur.promises.writeFile(r,new Uint8Array(e.buffer,e.byteOffset,e.byteLength));try{await Gg.extract({file:r,cwd:t})}finally{await ur.promises.unlink(r).catch(()=>{})}}async function Bc(e){let t=[],r=await ur.promises.readdir(e,{withFileTypes:!0});for(let n of r){let o=dr.join(e,n.name);n.isDirectory()?t.push(...await Bc(o)):t.push(o)}return t}var du=h(require("fs-extra"));U();W();var V=h(require("fs")),te=h(require("path")),Yo=require("child_process"),Th=h(require("tar"));var Be=h(require("fs")),Et=h(require("path"));var B={};pd(B,{BRAND:()=>yE,DIRTY:()=>Nr,EMPTY_PATH:()=>Zv,INVALID:()=>N,NEVER:()=>rF,OK:()=>Le,ParseStatus:()=>Re,Schema:()=>K,ZodAny:()=>mr,ZodArray:()=>Kt,ZodBigInt:()=>Br,ZodBoolean:()=>Mr,ZodBranded:()=>Vo,ZodCatch:()=>Yr,ZodDate:()=>Wr,ZodDefault:()=>Zr,ZodDiscriminatedUnion:()=>Rs,ZodEffects:()=>pt,ZodEnum:()=>Kr,ZodError:()=>We,ZodFirstPartyTypeKind:()=>L,ZodFunction:()=>Ps,ZodIntersection:()=>Jr,ZodIssueCode:()=>y,ZodLazy:()=>Gr,ZodLiteral:()=>zr,ZodMap:()=>$n,ZodNaN:()=>jn,ZodNativeEnum:()=>qr,ZodNever:()=>bt,ZodNull:()=>Vr,ZodNullable:()=>St,ZodNumber:()=>Lr,ZodObject:()=>Ue,ZodOptional:()=>ut,ZodParsedType:()=>A,ZodPipeline:()=>Ho,ZodPromise:()=>gr,ZodReadonly:()=>Xr,ZodRecord:()=>$s,ZodSchema:()=>K,ZodSet:()=>Pn,ZodString:()=>fr,ZodSymbol:()=>On,ZodTransformer:()=>pt,ZodTuple:()=>kt,ZodType:()=>K,ZodUndefined:()=>Ur,ZodUnion:()=>Hr,ZodUnknown:()=>zt,ZodVoid:()=>Rn,addIssueToContext:()=>_,any:()=>kE,array:()=>IE,bigint:()=>EE,boolean:()=>oh,coerce:()=>tF,custom:()=>th,date:()=>FE,datetimeRegex:()=>Qg,defaultErrorMap:()=>Jt,discriminatedUnion:()=>PE,effect:()=>zE,enum:()=>HE,function:()=>WE,getErrorMap:()=>An,getParsedType:()=>Ct,instanceof:()=>bE,intersection:()=>jE,isAborted:()=>Is,isAsync:()=>Tn,isDirty:()=>Os,isValid:()=>pr,late:()=>DE,lazy:()=>UE,literal:()=>VE,makeIssue:()=>Uo,map:()=>BE,nan:()=>vE,nativeEnum:()=>JE,never:()=>AE,null:()=>CE,nullable:()=>qE,number:()=>nh,object:()=>OE,objectUtil:()=>Mc,oboolean:()=>eF,onumber:()=>QE,optional:()=>KE,ostring:()=>XE,pipeline:()=>YE,preprocess:()=>ZE,promise:()=>GE,quotelessJson:()=>zv,record:()=>LE,set:()=>ME,setErrorMap:()=>qv,strictObject:()=>RE,string:()=>rh,symbol:()=>xE,transformer:()=>zE,tuple:()=>NE,undefined:()=>_E,union:()=>$E,unknown:()=>SE,util:()=>ee,void:()=>TE});var ee;(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})(ee||(ee={}));var Mc;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Mc||(Mc={}));var A=ee.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ct=e=>{switch(typeof e){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(e)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(e)?A.array:e===null?A.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?A.promise:typeof Map<"u"&&e instanceof Map?A.map:typeof Set<"u"&&e instanceof Set?A.set:typeof Date<"u"&&e instanceof Date?A.date:A.object;default:return A.unknown}};var y=ee.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"]),zv=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),We=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,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};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,ee.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()}};We.create=e=>new We(e);var Kv=(e,t)=>{let r;switch(e.code){case y.invalid_type:e.received===A.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ee.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:r=`Unrecognized key(s) in object: ${ee.joinValues(e.keys,", ")}`;break;case y.invalid_union:r="Invalid input";break;case y.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ee.joinValues(e.options)}`;break;case y.invalid_enum_value:r=`Invalid enum value. Expected ${ee.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}"`:ee.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,ee.assertNever(e)}return{message:r}},Jt=Kv;var Kg=Jt;function qv(e){Kg=e}function An(){return Kg}var Uo=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="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:t,defaultError:a}).message;return{...o,path:i,message:a}},Zv=[];function _(e,t){let r=An(),n=Uo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Jt?void 0:Jt].filter(o=>!!o)});e.common.issues.push(n)}var Re=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 N;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 N;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}}},N=Object.freeze({status:"aborted"}),Nr=e=>({status:"dirty",value:e}),Le=e=>({status:"valid",value:e}),Is=e=>e.status==="aborted",Os=e=>e.status==="dirty",pr=e=>e.status==="valid",Tn=e=>typeof Promise<"u"&&e instanceof Promise;var R;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(R||(R={}));var dt=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}},qg=(e,t)=>{if(pr(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 We(e.common.issues);return this._error=r,this._error}}};function G(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:c}=e;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}var K=class{get description(){return this._def.description}_getType(t){return Ct(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ct(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Re,ctx:{common:t.parent.common,data:t.data,parsedType:Ct(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Tn(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:Ct(t)},o=this._parseSync({data:t,path:n.path,parent:n});return qg(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ct(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return pr(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=>pr(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:Ct(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(Tn(o)?o:Promise.resolve(o));return qg(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(c=>c?!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 pt({schema:this,typeName:L.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 ut.create(this,this._def)}nullable(){return St.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kt.create(this)}promise(){return gr.create(this,this._def)}or(t){return Hr.create([this,t],this._def)}and(t){return Jr.create(this,t,this._def)}transform(t){return new pt({...G(this._def),schema:this,typeName:L.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Zr({...G(this._def),innerType:this,defaultValue:r,typeName:L.ZodDefault})}brand(){return new Vo({typeName:L.ZodBranded,type:this,...G(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Yr({...G(this._def),innerType:this,catchValue:r,typeName:L.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Ho.create(this,t)}readonly(){return Xr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Yv=/^c[^\s-]{8,}$/i,Xv=/^[0-9a-z]+$/,Qv=/^[0-9A-HJKMNP-TV-Z]{26}$/i,eE=/^[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,tE=/^[a-z0-9_-]{21}$/i,rE=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,nE=/^[-+]?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)?)??$/,oE=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iE="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Wc,sE=/^(?:(?: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])$/,aE=/^(?:(?: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])$/,lE=/^(([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]))$/,cE=/^(([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])$/,uE=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dE=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yg="((\\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])))",pE=new RegExp(`^${Yg}$`);function Xg(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 fE(e){return new RegExp(`^${Xg(e)}$`)}function Qg(e){let t=`${Yg}T${Xg(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 mE(e,t){return!!((t==="v4"||!t)&&sE.test(e)||(t==="v6"||!t)&&lE.test(e))}function gE(e,t){if(!rE.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 hE(e,t){return!!((t==="v4"||!t)&&aE.test(e)||(t==="v6"||!t)&&cE.test(e))}var fr=class e extends K{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==A.string){let i=this._getOrReturnCtx(t);return _(i,{code:y.invalid_type,expected:A.string,received:i.parsedType}),N}let n=new Re,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),_(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),_(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?_(o,{code:y.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&_(o,{code:y.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")oE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"email",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Wc||(Wc=new RegExp(iE,"u")),Wc.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"emoji",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")eE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"uuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")tE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"nanoid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Yv.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"cuid",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")Xv.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"cuid2",code:y.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")Qv.test(t.data)||(o=this._getOrReturnCtx(t,o),_(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),_(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),_(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),_(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),_(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),_(o,{code:y.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Qg(i).test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{code:y.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?pE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{code:y.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?fE(i).test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{code:y.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?nE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"duration",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?mE(t.data,i.version)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"ip",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?gE(t.data,i.alg)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"jwt",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?hE(t.data,i.version)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"cidr",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?uE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"base64",code:y.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?dE.test(t.data)||(o=this._getOrReturnCtx(t,o),_(o,{validation:"base64url",code:y.invalid_string,message:i.message}),n.dirty()):ee.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,...R.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...R.errToObj(t)})}url(t){return this._addCheck({kind:"url",...R.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...R.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...R.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...R.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...R.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...R.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...R.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...R.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...R.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...R.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...R.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...R.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,...R.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,...R.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...R.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...R.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...R.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...R.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...R.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...R.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...R.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...R.errToObj(r)})}nonempty(t){return this.min(1,R.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}};fr.create=e=>new fr({checks:[],typeName:L.ZodString,coerce:e?.coerce??!1,...G(e)});function wE(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 Lr=class e extends K{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)!==A.number){let i=this._getOrReturnCtx(t);return _(i,{code:y.invalid_type,expected:A.number,received:i.parsedType}),N}let n,o=new Re;for(let i of this._def.checks)i.kind==="int"?ee.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),_(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),_(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),_(n,{code:y.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?wE(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),_(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),_(n,{code:y.not_finite,message:i.message}),o.dirty()):ee.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:R.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:R.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:R.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:R.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"&&ee.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)}};Lr.create=e=>new Lr({checks:[],typeName:L.ZodNumber,coerce:e?.coerce||!1,...G(e)});var Br=class e extends K{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)!==A.bigint)return this._getInvalidInput(t);let n,o=new Re;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),_(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),_(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),_(n,{code:y.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):ee.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return _(r,{code:y.invalid_type,expected:A.bigint,received:r.parsedType}),N}gte(t,r){return this.setLimit("min",t,!0,R.toString(r))}gt(t,r){return this.setLimit("min",t,!1,R.toString(r))}lte(t,r){return this.setLimit("max",t,!0,R.toString(r))}lt(t,r){return this.setLimit("max",t,!1,R.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:R.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:R.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:R.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:R.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:R.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:R.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}};Br.create=e=>new Br({checks:[],typeName:L.ZodBigInt,coerce:e?.coerce??!1,...G(e)});var Mr=class extends K{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==A.boolean){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.boolean,received:n.parsedType}),N}return Le(t.data)}};Mr.create=e=>new Mr({typeName:L.ZodBoolean,coerce:e?.coerce||!1,...G(e)});var Wr=class e extends K{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==A.date){let i=this._getOrReturnCtx(t);return _(i,{code:y.invalid_type,expected:A.date,received:i.parsedType}),N}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return _(i,{code:y.invalid_date}),N}let n=new Re,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),_(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),_(o,{code:y.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ee.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:R.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:R.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}};Wr.create=e=>new Wr({checks:[],coerce:e?.coerce||!1,typeName:L.ZodDate,...G(e)});var On=class extends K{_parse(t){if(this._getType(t)!==A.symbol){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.symbol,received:n.parsedType}),N}return Le(t.data)}};On.create=e=>new On({typeName:L.ZodSymbol,...G(e)});var Ur=class extends K{_parse(t){if(this._getType(t)!==A.undefined){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.undefined,received:n.parsedType}),N}return Le(t.data)}};Ur.create=e=>new Ur({typeName:L.ZodUndefined,...G(e)});var Vr=class extends K{_parse(t){if(this._getType(t)!==A.null){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.null,received:n.parsedType}),N}return Le(t.data)}};Vr.create=e=>new Vr({typeName:L.ZodNull,...G(e)});var mr=class extends K{constructor(){super(...arguments),this._any=!0}_parse(t){return Le(t.data)}};mr.create=e=>new mr({typeName:L.ZodAny,...G(e)});var zt=class extends K{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Le(t.data)}};zt.create=e=>new zt({typeName:L.ZodUnknown,...G(e)});var bt=class extends K{_parse(t){let r=this._getOrReturnCtx(t);return _(r,{code:y.invalid_type,expected:A.never,received:r.parsedType}),N}};bt.create=e=>new bt({typeName:L.ZodNever,...G(e)});var Rn=class extends K{_parse(t){if(this._getType(t)!==A.undefined){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.void,received:n.parsedType}),N}return Le(t.data)}};Rn.create=e=>new Rn({typeName:L.ZodVoid,...G(e)});var Kt=class e extends K{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==A.array)return _(r,{code:y.invalid_type,expected:A.array,received:r.parsedType}),N;if(o.exactLength!==null){let s=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(s||a)&&(_(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&&(_(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&&(_(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 dt(r,s,r.path,a)))).then(s=>Re.mergeArray(n,s));let i=[...r.data].map((s,a)=>o.type._parseSync(new dt(r,s,r.path,a)));return Re.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:R.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:R.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:R.toString(r)}})}nonempty(t){return this.min(1,t)}};Kt.create=(e,t)=>new Kt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:L.ZodArray,...G(t)});function In(e){if(e instanceof Ue){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ut.create(In(n))}return new Ue({...e._def,shape:()=>t})}else return e instanceof Kt?new Kt({...e._def,type:In(e.element)}):e instanceof ut?ut.create(In(e.unwrap())):e instanceof St?St.create(In(e.unwrap())):e instanceof kt?kt.create(e.items.map(t=>In(t))):e}var Ue=class e extends K{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=ee.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==A.object){let u=this._getOrReturnCtx(t);return _(u,{code:y.invalid_type,expected:A.object,received:u.parsedType}),N}let{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof bt&&this._def.unknownKeys==="strip"))for(let u in o.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let p=i[u],f=o.data[u];c.push({key:{status:"valid",value:u},value:p._parse(new dt(o,f,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof bt){let u=this._def.unknownKeys;if(u==="passthrough")for(let p of a)c.push({key:{status:"valid",value:p},value:{status:"valid",value:o.data[p]}});else if(u==="strict")a.length>0&&(_(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 p of a){let f=o.data[p];c.push({key:{status:"valid",value:p},value:u._parse(new dt(o,f,o.path,p)),alwaysSet:p in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let p of c){let f=await p.key,m=await p.value;u.push({key:f,value:m,alwaysSet:p.alwaysSet})}return u}).then(u=>Re.mergeObjectSync(n,u)):Re.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return R.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:R.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:L.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 ee.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 ee.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return In(this)}partial(t){let r={};for(let n of ee.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 ee.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ut;)i=i._def.innerType;r[n]=i}return new e({...this._def,shape:()=>r})}keyof(){return eh(ee.objectKeys(this.shape))}};Ue.create=(e,t)=>new Ue({shape:()=>e,unknownKeys:"strip",catchall:bt.create(),typeName:L.ZodObject,...G(t)});Ue.strictCreate=(e,t)=>new Ue({shape:()=>e,unknownKeys:"strict",catchall:bt.create(),typeName:L.ZodObject,...G(t)});Ue.lazycreate=(e,t)=>new Ue({shape:e,unknownKeys:"strip",catchall:bt.create(),typeName:L.ZodObject,...G(t)});var Hr=class extends K{_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 We(a.ctx.common.issues));return _(r,{code:y.invalid_union,unionErrors:s}),N}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 c of n){let u={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:u});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,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(c=>new We(c));return _(r,{code:y.invalid_union,unionErrors:a}),N}}get options(){return this._def.options}};Hr.create=(e,t)=>new Hr({options:e,typeName:L.ZodUnion,...G(t)});var Gt=e=>e instanceof Gr?Gt(e.schema):e instanceof pt?Gt(e.innerType()):e instanceof zr?[e.value]:e instanceof Kr?e.options:e instanceof qr?ee.objectValues(e.enum):e instanceof Zr?Gt(e._def.innerType):e instanceof Ur?[void 0]:e instanceof Vr?[null]:e instanceof ut?[void 0,...Gt(e.unwrap())]:e instanceof St?[null,...Gt(e.unwrap())]:e instanceof Vo||e instanceof Xr?Gt(e.unwrap()):e instanceof Yr?Gt(e._def.innerType):[],Rs=class e extends K{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==A.object)return _(r,{code:y.invalid_type,expected:A.object,received:r.parsedType}),N;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}):(_(r,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),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=Gt(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:L.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...G(n)})}};function Uc(e,t){let r=Ct(e),n=Ct(t);if(e===t)return{valid:!0,data:e};if(r===A.object&&n===A.object){let o=ee.objectKeys(t),i=ee.objectKeys(e).filter(a=>o.indexOf(a)!==-1),s={...e,...t};for(let a of i){let c=Uc(e[a],t[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===A.array&&n===A.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],c=Uc(s,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===A.date&&n===A.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Jr=class extends K{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(i,s)=>{if(Is(i)||Is(s))return N;let a=Uc(i.value,s.value);return a.valid?((Os(i)||Os(s))&&r.dirty(),{status:r.value,value:a.data}):(_(n,{code:y.invalid_intersection_types}),N)};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}))}};Jr.create=(e,t,r)=>new Jr({left:e,right:t,typeName:L.ZodIntersection,...G(r)});var kt=class e extends K{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==A.array)return _(n,{code:y.invalid_type,expected:A.array,received:n.parsedType}),N;if(n.data.length<this._def.items.length)return _(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&n.data.length>this._def.items.length&&(_(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 c=this._def.items[a]||this._def.rest;return c?c._parse(new dt(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>Re.mergeArray(r,s)):Re.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};kt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new kt({items:e,typeName:L.ZodTuple,rest:null,...G(t)})};var $s=class e extends K{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!==A.object)return _(n,{code:y.invalid_type,expected:A.object,received:n.parsedType}),N;let o=[],i=this._def.keyType,s=this._def.valueType;for(let a in n.data)o.push({key:i._parse(new dt(n,a,n.path,a)),value:s._parse(new dt(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Re.mergeObjectAsync(r,o):Re.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof K?new e({keyType:t,valueType:r,typeName:L.ZodRecord,...G(n)}):new e({keyType:fr.create(),valueType:t,typeName:L.ZodRecord,...G(r)})}},$n=class extends K{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!==A.map)return _(n,{code:y.invalid_type,expected:A.map,received:n.parsedType}),N;let o=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new dt(n,a,n.path,[u,"key"])),value:i._parse(new dt(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,p=await c.value;if(u.status==="aborted"||p.status==="aborted")return N;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,p=c.value;if(u.status==="aborted"||p.status==="aborted")return N;(u.status==="dirty"||p.status==="dirty")&&r.dirty(),a.set(u.value,p.value)}return{status:r.value,value:a}}}};$n.create=(e,t,r)=>new $n({valueType:t,keyType:e,typeName:L.ZodMap,...G(r)});var Pn=class e extends K{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==A.set)return _(n,{code:y.invalid_type,expected:A.set,received:n.parsedType}),N;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(_(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&&(_(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(c){let u=new Set;for(let p of c){if(p.status==="aborted")return N;p.status==="dirty"&&r.dirty(),u.add(p.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>i._parse(new dt(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:R.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:R.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:L.ZodSet,...G(t)});var Ps=class e extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==A.function)return _(r,{code:y.invalid_type,expected:A.function,received:r.parsedType}),N;function n(a,c){return Uo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,An(),Jt].filter(u=>!!u),issueData:{code:y.invalid_arguments,argumentsError:c}})}function o(a,c){return Uo({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,An(),Jt].filter(u=>!!u),issueData:{code:y.invalid_return_type,returnTypeError:c}})}let i={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof gr){let a=this;return Le(async function(...c){let u=new We([]),p=await a._def.args.parseAsync(c,i).catch(g=>{throw u.addIssue(n(c,g)),u}),f=await Reflect.apply(s,this,p);return await a._def.returns._def.type.parseAsync(f,i).catch(g=>{throw u.addIssue(o(f,g)),u})})}else{let a=this;return Le(function(...c){let u=a._def.args.safeParse(c,i);if(!u.success)throw new We([n(c,u.error)]);let p=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(p,i);if(!f.success)throw new We([o(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:kt.create(t).rest(zt.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||kt.create([]).rest(zt.create()),returns:r||zt.create(),typeName:L.ZodFunction,...G(n)})}},Gr=class extends K{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})}};Gr.create=(e,t)=>new Gr({getter:e,typeName:L.ZodLazy,...G(t)});var zr=class extends K{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return _(r,{received:r.data,code:y.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:t.data}}get value(){return this._def.value}};zr.create=(e,t)=>new zr({value:e,typeName:L.ZodLiteral,...G(t)});function eh(e,t){return new Kr({values:e,typeName:L.ZodEnum,...G(t)})}var Kr=class e extends K{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return _(r,{expected:ee.joinValues(n),received:r.parsedType,code:y.invalid_type}),N}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 _(r,{received:r.data,code:y.invalid_enum_value,options:n}),N}return Le(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=eh;var qr=class extends K{_parse(t){let r=ee.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==A.string&&n.parsedType!==A.number){let o=ee.objectValues(r);return _(n,{expected:ee.joinValues(o),received:n.parsedType,code:y.invalid_type}),N}if(this._cache||(this._cache=new Set(ee.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=ee.objectValues(r);return _(n,{received:n.data,code:y.invalid_enum_value,options:o}),N}return Le(t.data)}get enum(){return this._def.values}};qr.create=(e,t)=>new qr({values:e,typeName:L.ZodNativeEnum,...G(t)});var gr=class extends K{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==A.promise&&r.common.async===!1)return _(r,{code:y.invalid_type,expected:A.promise,received:r.parsedType}),N;let n=r.parsedType===A.promise?r.data:Promise.resolve(r.data);return Le(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};gr.create=(e,t)=>new gr({type:e,typeName:L.ZodPromise,...G(t)});var pt=class extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===L.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=>{_(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 N;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?N:c.status==="dirty"?Nr(c.value):r.value==="dirty"?Nr(c.value):c});{if(r.value==="aborted")return N;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?N:a.status==="dirty"?Nr(a.value):r.value==="dirty"?Nr(a.value):a}}if(o.type==="refinement"){let s=a=>{let c=o.refinement(a,i);if(n.common.async)return Promise.resolve(c);if(c 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"?N:(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"?N:(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(!pr(s))return N;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=>pr(s)?Promise.resolve(o.transform(s.value,i)).then(a=>({status:r.value,value:a})):N);ee.assertNever(o)}};pt.create=(e,t,r)=>new pt({schema:e,typeName:L.ZodEffects,effect:t,...G(r)});pt.createWithPreprocess=(e,t,r)=>new pt({schema:t,effect:{type:"preprocess",transform:e},typeName:L.ZodEffects,...G(r)});var ut=class extends K{_parse(t){return this._getType(t)===A.undefined?Le(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ut.create=(e,t)=>new ut({innerType:e,typeName:L.ZodOptional,...G(t)});var St=class extends K{_parse(t){return this._getType(t)===A.null?Le(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};St.create=(e,t)=>new St({innerType:e,typeName:L.ZodNullable,...G(t)});var Zr=class extends K{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===A.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Zr.create=(e,t)=>new Zr({innerType:e,typeName:L.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...G(t)});var Yr=class extends K{_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 Tn(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new We(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new We(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Yr.create=(e,t)=>new Yr({innerType:e,typeName:L.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...G(t)});var jn=class extends K{_parse(t){if(this._getType(t)!==A.nan){let n=this._getOrReturnCtx(t);return _(n,{code:y.invalid_type,expected:A.nan,received:n.parsedType}),N}return{status:"valid",value:t.data}}};jn.create=e=>new jn({typeName:L.ZodNaN,...G(e)});var yE=Symbol("zod_brand"),Vo=class extends K{_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 K{_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"?N:i.status==="dirty"?(r.dirty(),Nr(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"?N: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:L.ZodPipeline})}},Xr=class extends K{_parse(t){let r=this._def.innerType._parse(t),n=o=>(pr(o)&&(o.value=Object.freeze(o.value)),o);return Tn(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Xr.create=(e,t)=>new Xr({innerType:e,typeName:L.ZodReadonly,...G(t)});function Zg(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function th(e,t={},r){return e?mr.create().superRefine((n,o)=>{let i=e(n);if(i instanceof Promise)return i.then(s=>{if(!s){let a=Zg(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!i){let s=Zg(t,n),a=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:a})}}):mr.create()}var DE={object:Ue.lazycreate},L;(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"})(L||(L={}));var bE=(e,t={message:`Input not instance of ${e.name}`})=>th(r=>r instanceof e,t),rh=fr.create,nh=Lr.create,vE=jn.create,EE=Br.create,oh=Mr.create,FE=Wr.create,xE=On.create,_E=Ur.create,CE=Vr.create,kE=mr.create,SE=zt.create,AE=bt.create,TE=Rn.create,IE=Kt.create,OE=Ue.create,RE=Ue.strictCreate,$E=Hr.create,PE=Rs.create,jE=Jr.create,NE=kt.create,LE=$s.create,BE=$n.create,ME=Pn.create,WE=Ps.create,UE=Gr.create,VE=zr.create,HE=Kr.create,JE=qr.create,GE=gr.create,zE=pt.create,KE=ut.create,qE=St.create,ZE=pt.createWithPreprocess,YE=Ho.create,XE=()=>rh().optional(),QE=()=>nh().optional(),eF=()=>oh().optional(),tF={string:(e=>fr.create({...e,coerce:!0})),number:(e=>Lr.create({...e,coerce:!0})),boolean:(e=>Mr.create({...e,coerce:!0})),bigint:(e=>Br.create({...e,coerce:!0})),date:(e=>Wr.create({...e,coerce:!0}))};var rF=N;function js(e,t=!1){let r=e.length,n=0,o="",i=0,s=16,a=0,c=0,u=0,p=0,f=0;function m(S,oe){let ye=0,X=0;for(;ye<S||!oe;){let M=e.charCodeAt(n);if(M>=48&&M<=57)X=X*16+M-48;else if(M>=65&&M<=70)X=X*16+M-65+10;else if(M>=97&&M<=102)X=X*16+M-97+10;else break;n++,ye++}return ye<S&&(X=-1),X}function g(S){n=S,o="",i=0,s=16,f=0}function w(){let S=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&Nn(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&Nn(e.charCodeAt(n)))for(n++;n<e.length&&Nn(e.charCodeAt(n));)n++;else return f=3,e.substring(S,n);let oe=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&&Nn(e.charCodeAt(n))){for(n++;n<e.length&&Nn(e.charCodeAt(n));)n++;oe=n}else f=3;return e.substring(S,oe)}function I(){let S="",oe=n;for(;;){if(n>=r){S+=e.substring(oe,n),f=2;break}let ye=e.charCodeAt(n);if(ye===34){S+=e.substring(oe,n),n++;break}if(ye===92){if(S+=e.substring(oe,n),n++,n>=r){f=2;break}switch(e.charCodeAt(n++)){case 34:S+='"';break;case 92:S+="\\";break;case 47:S+="/";break;case 98:S+="\b";break;case 102:S+="\f";break;case 110:S+=`
|
|
108
|
+
`;break;case 114:S+="\r";break;case 116:S+=" ";break;case 117:let M=m(4,!0);M>=0?S+=String.fromCharCode(M):f=4;break;default:f=5}oe=n;continue}if(ye>=0&&ye<=31)if(Jo(ye)){S+=e.substring(oe,n),f=2;break}else f=6;n++}return S}function C(){if(o="",f=0,i=n,c=a,p=u,n>=r)return i=r,s=17;let S=e.charCodeAt(n);if(Vc(S)){do n++,o+=String.fromCharCode(S),S=e.charCodeAt(n);while(Vc(S));return s=15}if(Jo(S))return n++,o+=String.fromCharCode(S),S===13&&e.charCodeAt(n)===10&&(n++,o+=`
|
|
109
|
+
`),a++,u=n,s=14;switch(S){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=I(),s=10;case 47:let oe=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<r&&!Jo(e.charCodeAt(n));)n++;return o=e.substring(oe,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;let ye=r-1,X=!1;for(;n<ye;){let M=e.charCodeAt(n);if(M===42&&e.charCodeAt(n+1)===47){n+=2,X=!0;break}n++,Jo(M)&&(M===13&&e.charCodeAt(n)===10&&n++,a++,u=n)}return X||(n++,f=1),o=e.substring(oe,n),s=13}return o+=String.fromCharCode(S),n++,s=16;case 45:if(o+=String.fromCharCode(S),n++,n===r||!Nn(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&&q(S);)n++,S=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(S),n++,s=16}}function q(S){if(Vc(S)||Jo(S))return!1;switch(S){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function Z(){let S;do S=C();while(S>=12&&S<=15);return S}return{setPosition:g,getPosition:()=>n,scan:t?Z:C,getToken:()=>s,getTokenValue:()=>o,getTokenOffset:()=>i,getTokenLength:()=>n-i,getTokenStartLine:()=>c,getTokenStartCharacter:()=>i-p,getTokenError:()=>f}}function Vc(e){return e===32||e===9}function Jo(e){return e===10||e===13}function Nn(e){return e>=48&&e<=57}var ih;(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"})(ih||(ih={}));var oF=new Array(20).fill(0).map((e,t)=>" ".repeat(t)),Ln=200,iF={" ":{"\n":new Array(Ln).fill(0).map((e,t)=>`
|
|
110
|
+
`+" ".repeat(t)),"\r":new Array(Ln).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Ln).fill(0).map((e,t)=>`\r
|
|
111
|
+
`+" ".repeat(t))}," ":{"\n":new Array(Ln).fill(0).map((e,t)=>`
|
|
112
|
+
`+" ".repeat(t)),"\r":new Array(Ln).fill(0).map((e,t)=>"\r"+" ".repeat(t)),"\r\n":new Array(Ln).fill(0).map((e,t)=>`\r
|
|
113
|
+
`+" ".repeat(t))}};var Ns;(function(e){e.DEFAULT={allowTrailingComma:!1}})(Ns||(Ns={}));function sh(e,t=[],r=Ns.DEFAULT){let n=null,o=[],i=[];function s(c){Array.isArray(o)?o.push(c):n!==null&&(o[n]=c)}return ah(e,{onObjectBegin:()=>{let c={};s(c),i.push(o),o=c,n=null},onObjectProperty:c=>{n=c},onObjectEnd:()=>{o=i.pop()},onArrayBegin:()=>{let c=[];s(c),i.push(o),o=c,n=null},onArrayEnd:()=>{o=i.pop()},onLiteralValue:s,onError:(c,u,p)=>{t.push({error:c,offset:u,length:p})}},r),o[0]}function ah(e,t,r=Ns.DEFAULT){let n=js(e,!1),o=[],i=0;function s(re){return re?()=>i===0&&re(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function a(re){return re?Fe=>i===0&&re(Fe,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function c(re){return re?Fe=>i===0&&re(Fe,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}function u(re){return re?()=>{i>0?i++:re(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice())===!1&&(i=1)}:()=>!0}function p(re){return re?()=>{i>0&&i--,i===0&&re(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter())}:()=>!0}let f=u(t.onObjectBegin),m=c(t.onObjectProperty),g=p(t.onObjectEnd),w=u(t.onArrayBegin),I=p(t.onArrayEnd),C=c(t.onLiteralValue),q=a(t.onSeparator),Z=s(t.onComment),S=a(t.onError),oe=r&&r.disallowComments,ye=r&&r.allowTrailingComma;function X(){for(;;){let re=n.scan();switch(n.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:oe||M(11);break;case 2:M(12);break;case 6:M(16);break}switch(re){case 12:case 13:oe?M(10):Z();break;case 16:M(1);break;case 15:case 14:break;default:return re}}}function M(re,Fe=[],dd=[]){if(S(re),Fe.length+dd.length>0){let di=n.getToken();for(;di!==17;){if(Fe.indexOf(di)!==-1){X();break}else if(dd.indexOf(di)!==-1)break;di=X()}}}function Xn(re){let Fe=n.getTokenValue();return re?C(Fe):(m(Fe),o.push(Fe)),X(),!0}function fa(){switch(n.getToken()){case 11:let re=n.getTokenValue(),Fe=Number(re);isNaN(Fe)&&(M(2),Fe=0),C(Fe);break;case 7:C(null);break;case 8:C(!0);break;case 9:C(!1);break;default:return!1}return X(),!0}function ma(){return n.getToken()!==10?(M(3,[],[2,5]),!1):(Xn(!1),n.getToken()===6?(q(":"),X(),ga()||M(4,[],[2,5])):M(5,[],[2,5]),o.pop(),!0)}function Sy(){f(),X();let re=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(re||M(4,[],[]),q(","),X(),n.getToken()===2&&ye)break}else re&&M(6,[],[]);ma()||M(4,[],[2,5]),re=!0}return g(),n.getToken()!==2?M(7,[2],[]):X(),!0}function Ay(){w(),X();let re=!0,Fe=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(Fe||M(4,[],[]),q(","),X(),n.getToken()===4&&ye)break}else Fe&&M(6,[],[]);re?(o.push(0),re=!1):o[o.length-1]++,ga()||M(4,[],[4,5]),Fe=!0}return I(),re||o.pop(),n.getToken()!==4?M(8,[4],[]):X(),!0}function ga(){switch(n.getToken()){case 3:return Ay();case 1:return Sy();case 10:return Xn(!0);default:return fa()}}return X(),n.getToken()===17?r.allowEmptyContent?!0:(M(4,[],[]),!1):ga()?(n.getToken()!==17&&M(9,[],[]),!0):(M(4,[],[]),!1)}var lh;(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"})(lh||(lh={}));var ch;(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"})(ch||(ch={}));var Qr=sh;var uh;(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"})(uh||(uh={}));var Jn=h(require("fs")),Eh=h(require("path")),Fh=require("@webflow/cosmic-deploy-contract");var Bn=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
115
|
How to fix: ${this.remediation}`),this.documentationUrl&&(t+=`
|
|
116
116
|
|
|
117
|
-
Documentation: ${this.documentationUrl}`),t}},le=class extends
|
|
117
|
+
Documentation: ${this.documentationUrl}`),t}},le=class extends Bn{constructor(t,r){super(t,r),this.name="FrameworkValidationError"}};var en=class extends Bn{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}`),t}},
|
|
119
|
+
Config file: ${this.configFile}`),t}},hr=class extends Bn{constructor(t,r){super(t,r),this.name="FrameworkDetectionError"}};var Je=h(require("path")),zo=h(require("fs"));var dh=h(require("semver")),Ve=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()}getFrameworkVersion(){}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]}resolveFrameworkVersion(t){let r=this.getDependencyVersion(t);if(r)return dh.default.coerce(r)?.version}get log(){return this.ctx.log}get cwd(){return this.ctx.cwd}};var wh=h(require("semver")),we=h(require("fs")),At=h(require("path"));var tn=h(require("semver"));function pF(){return process.version.slice(1)}function fF(e){let t=tn.coerce(e);return t?t.major:null}function mF(e,t){let r=tn.coerce(e),n=tn.coerce(t);return!r||!n?!1:tn.gte(r,n)}function wr(e,t,r){let n=pF(),o=t.minimum;if(mF(n,o))e.debug(`Node.js version ${n} meets requirement ${o}`);else{let i=fF(o),s=`${r} requires Node.js ${o} or higher. Current version: ${n}`;if(t.severity==="error")throw new le(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/"});e.warn(`${s}. Build may fail or behave unexpectedly.`)}}var
|
|
123
|
-
`));let i=
|
|
124
|
-
`));let i=
|
|
125
|
-
`));let i=
|
|
126
|
-
`)):
|
|
122
|
+
nvm use ${i}`,documentationUrl:"https://nodejs.org/en/download/"});e.warn(`${s}. Build may fail or behave unexpectedly.`)}}var Ls=h(require("fs")),ph=h(require("path"));var fh=B.object({name:B.string().optional(),version:B.string().optional(),dependencies:B.record(B.string()).optional(),devDependencies:B.record(B.string()).optional()});function Go(e){let t=ph.default.join(e,"package.json");if(!Ls.statSync(t,{throwIfNoEntry:!1}))return;let r=Ls.readFileSync(t).toString("utf8"),n;try{n=JSON.parse(r)}catch(o){throw new le("package.json was not valid JSON",{cause:o})}try{return fh.parse(n)}catch(o){throw new le("package.json schema validation failed",{cause:o})}}var Bs=h(require("fs")),mh=h(require("path"));var Ms=B.object({cloud:B.object({contract_version:B.string().optional(),framework:B.string().optional(),framework_version:B.string().optional(),entrypoint_path:B.string().optional(),deployment_type:B.enum(["spa","ssg","ssr","ssr-spa-combo"]).optional(),skip_no_bundle:B.boolean().optional(),assets_path_prefix:B.string().optional(),assets_source_skip_mount_path:B.boolean().optional()}).passthrough().optional()}).passthrough();function Mn(e,t,r="webflow.json"){let n=mh.default.join(t,r);if(!Bs.statSync(n,{throwIfNoEntry:!1}))return r.endsWith(".json")?Mn(e,t,r+"c"):void 0;let o=Bs.readFileSync(n).toString("utf8"),i;try{i=Qr(o)}catch(s){e?.error(`loaded but could not parse as JSONC ${n} ${JSON.stringify(o)}: ${s}`);return}try{let s=Ms.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 gh=require("child_process"),hh=["--no-update-notifier","--no-progress","--no-audit","--no-fund"];async function Ie(e){let{log:t,cwd:r,args:n}=e,o={...process.env,...e.env||{},WRANGLER_SEND_METRICS:"false",NEXT_TELEMETRY_DISABLED:"1"},i=[...hh,...n];t.debug(`npm ${i.join(" ")} (in ${r})`),(0,gh.execSync)(`npm ${i.map(s=>JSON.stringify(s)).join(" ")}`,{cwd:r,env:o,stdio:"inherit"})}function vt(e){if(!e)return null;let t=wh.coerce(e);return t?t.major:null}function rn(e,t,r,n){let o=n?.exclude?Array.isArray(n.exclude)?n.exclude:[n.exclude]:[],i=At.basename(t);if(o.some(c=>i===c))return e.trace(`Skipping excluded: ${t}`),0;let s=we.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 c=we.readdirSync(t),u=0;for(let p of c)u+=rn(e,At.join(t,p),At.join(r,p),n);return u}let a=At.dirname(r);return we.existsSync(a)||we.mkdirSync(a,{recursive:!0}),e.trace(`Copying file: ${t} -> ${r}`),we.copyFileSync(t,r),1}function He(e){return we.existsSync(e)}function Qe(...e){for(let t of e)if(we.existsSync(t))return t;return e[0]??""}async function Tt(e,t,r,n){if(!we.existsSync(t))throw new en(`Template not found: ${t}`,{configFile:t});let o=we.readFileSync(t,"utf8");e.debug(`envsubst: ${t} -> ${r}`);let i=n||process.env,s=o.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(c,u)=>i[u]??"").replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(c,u)=>i[u]??""),a=At.dirname(r);we.existsSync(a)||we.mkdirSync(a,{recursive:!0}),we.writeFileSync(r,s)}function It(e,t,r,n){for(let o of n){let i=At.join(t,`${r}.${o}`);if(we.existsSync(i)){let s=At.join(t,`clouduser.${r}.${o}`);return e.info(`Renaming user config: ${r}.${o} -> clouduser.${r}.${o}`),we.renameSync(i,s),s}}return null}var Jc=Qe(Je.join(__dirname,"templates","astro","v5"),Je.join(__dirname,"templates","v5")),yh=Qe(Je.join(__dirname,"templates","astro"),Je.join(__dirname,"templates")),nn=class extends Ve{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=vt(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&&wr(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new le("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 le('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^5.0.0"});let i=vt(o);if(i!==null&&i>=6)throw new le(`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 Ie({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 Ie({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:Je.join(Jc,"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 Je.join(Jc,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,Je.join(yh,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;It(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"),zo.writeFileSync(Je.join(r,"clouduser.astro.config.mjs"),`export default {};
|
|
123
|
+
`));let i=Je.join(yh,"astro.config.webflow.ts");He(i)&&(t.info("Copying astro.config.webflow.ts..."),zo.copyFileSync(i,Je.join(r,"astro.config.webflow.ts")));let s=Je.join(Jc,"astro.config.mjs.template"),a=Je.join(r,"astro.config.mjs");t.info("Generating astro.config.mjs from template..."),await Tt(t,s,a,{...process.env,...n});let c=this.getWebflowLoader();He(c.templatePath)&&(t.info(`Copying ${c.destinationName}...`),zo.copyFileSync(c.templatePath,Je.join(r,c.destinationName)))}getBuildCommand(){return"astro build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("astro")}static getOutputDeployMetadata(){return{staticAssetsPath:"dist",staticAssetsExclude:["_worker.js"],workerEntryPath:"dist/_worker.js/index.js",deploymentType:"ssr",dryRunEntryPath:"./index.js"}}};var Ge=h(require("path")),Ko=h(require("fs"));var Gc=Qe(Ge.join(__dirname,"templates","astro","v6"),Ge.join(__dirname,"templates","v6")),Dh=Qe(Ge.join(__dirname,"templates","astro"),Ge.join(__dirname,"templates")),on=class extends Ve{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=vt(o);return i!==null&&i>=7?{detected:!1}: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&&wr(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new le("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 le('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^6.0.0"});let i=vt(o);if(i!==null&&i<6)throw new le(`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"});if(i!==null&&i>=7)throw new le(`Astro ${i}.x detected but Astro6Builder was selected. This is likely a configuration error.`,{remediation:"Use Astro7Builder for Astro 7.x, or downgrade: 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 Ie({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 Ie({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 Ie({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:Ge.join(Gc,"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 Ge.join(Gc,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,Ge.join(Dh,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;It(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"),Ko.writeFileSync(Ge.join(r,"clouduser.astro.config.mjs"),`export default {};
|
|
124
|
+
`));let i=Ge.join(Dh,"astro.config.webflow.ts");He(i)&&(t.info("Copying astro.config.webflow.ts..."),Ko.copyFileSync(i,Ge.join(r,"astro.config.webflow.ts")));let s=Ge.join(Gc,"astro.config.mjs.template"),a=Ge.join(r,"astro.config.mjs");t.info("Generating astro.config.mjs from template (Astro 6)..."),await Tt(t,s,a,{...process.env,...n});let c=this.getWebflowLoader();He(c.templatePath)&&(t.info(`Copying ${c.destinationName}...`),Ko.copyFileSync(c.templatePath,Ge.join(r,c.destinationName)))}getBuildCommand(){return"astro build"}getNodeVersionRequirement(){return{minimum:"22.12.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("astro")}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 ze=h(require("path")),qo=h(require("fs"));var zc=Qe(ze.join(__dirname,"templates","astro","v7"),ze.join(__dirname,"templates","v7")),bh=Qe(ze.join(__dirname,"templates","astro"),ze.join(__dirname,"templates")),Wn=class extends Ve{static frameworkName="astro";get info(){return{name:"astro",version:"7.x",displayName:"Astro 7"}}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=vt(o);return i!==null&&i>=7?{detected:!0,reason:`Found astro@${o} (Astro ${i}.x)`}:{detected:!1}}async validate(){let{log:t,packageJson:r}=this.ctx,n=this.getNodeVersionRequirement();n&&wr(t,n,this.info.displayName);let o=r.dependencies?.astro||r.devDependencies?.astro;if(!o)throw new le("Astro is not installed in this project.",{remediation:"Install Astro by running: npm install astro@^7.0.0",documentationUrl:"https://docs.astro.build/en/install/"});if(o==="latest")throw new le('Astro version "latest" is not supported by Webflow Cloud.',{remediation:"Please specify a version, e.g.: npm install astro@^7.0.0"});let i=vt(o);if(i!==null&&i<7)throw new le(`Astro ${i}.x detected but Astro7Builder was selected. This is likely a configuration error.`,{remediation:"Use Astro6Builder for Astro 6.x, or upgrade: npm install astro@^7.0.0"});t.info(`Validated Astro 7 project: astro@${o}`)}getCloudflareAdapter(){return{name:"@astrojs/cloudflare",version:"^14.1.0",peerDependencies:["@cloudflare/vite-plugin"]}}getRequiredIntegrations(){return[{name:"@astrojs/react",version:"^6.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 Ie({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 Ie({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 Ie({log:t,cwd:r,args:["install","--save",`${o.name}@${o.version}`]}))}getWebflowLoader(){return{templatePath:ze.join(zc,"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 ze.join(zc,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,ze.join(bh,"astro.config.webflow.ts")]}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx;It(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"),qo.writeFileSync(ze.join(r,"clouduser.astro.config.mjs"),`export default {};
|
|
125
|
+
`));let i=ze.join(bh,"astro.config.webflow.ts");He(i)&&(t.info("Copying astro.config.webflow.ts..."),qo.copyFileSync(i,ze.join(r,"astro.config.webflow.ts")));let s=ze.join(zc,"astro.config.mjs.template"),a=ze.join(r,"astro.config.mjs");t.info("Generating astro.config.mjs from template (Astro 7)..."),await Tt(t,s,a,{...process.env,...n});let c=this.getWebflowLoader();He(c.templatePath)&&(t.info(`Copying ${c.destinationName}...`),qo.copyFileSync(c.templatePath,ze.join(r,c.destinationName)))}getBuildCommand(){return"astro build"}getNodeVersionRequirement(){return{minimum:"22.12.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("astro")}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 De=h(require("path")),ft=h(require("fs"));var Un=Qe(De.join(__dirname,"templates","nextjs"),De.join(__dirname,"templates")),Vn=class extends Ve{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 le("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 Ie({log:t,cwd:r,args:["install","--save",n.name]}))}getWebflowLoader(){return{templatePath:De.join(Un,"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 De.join(Un,"wrangler.json")}getAdditionalConfigFiles(){return[this.getWebflowLoader().templatePath,De.join(Un,"open-next.config.ts")]}findOpenNextConfig(){let t="open-next.config.ts";if(ft.existsSync(De.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..."),!ft.existsSync(t))throw new en(`open-next.config.ts template not found at ${t}. This is a Webflow Cloud build system error.`,{configFile:t});let i=De.join(n,"open-next.config.ts");ft.copyFileSync(t,i),r.info("open-next.config.ts created successfully")}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=It(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"),ft.writeFileSync(De.join(r,"clouduser.next.config.ts"),`export default {};
|
|
126
|
+
`)):De.extname(o)!==".ts"&&(t.info(`writing clouduser.next.config.d.ts shim for ${De.basename(o)}`),ft.writeFileSync(De.join(r,"clouduser.next.config.d.ts"),`import type { UserNextConfig } from './next.config.webflow';
|
|
127
127
|
declare const config: UserNextConfig;
|
|
128
128
|
export default config;
|
|
129
|
-
`));let i=
|
|
129
|
+
`));let i=De.join(Un,"next.config.webflow.ts");He(i)&&(t.info("Copying next.config.webflow.ts..."),ft.copyFileSync(i,De.join(r,"next.config.webflow.ts")));let s=De.join(Un,"next.config.ts.template"),a=De.join(r,"next.config.ts");t.info("Generating next.config.ts from template..."),await Tt(t,s,a,{...process.env,...n});let c=this.getWebflowLoader();He(c.templatePath)&&(t.info(`Copying ${c.destinationName}...`),ft.copyFileSync(c.templatePath,De.join(r,c.destinationName)));let u=De.join(Un,"open-next.config.ts");this.ensureOpenNextConfig(u)}getBuildCommand(){return"opennextjs-cloudflare build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("next")}static getOutputDeployMetadata(){return{staticAssetsPath:".open-next/assets",workerEntryPath:".open-next/worker.js",deploymentType:"ssr",dryRunEntryPath:"./worker.js"}}static detectFromBuiltOutput(t){return ft.statSync(De.join(t,"./worker.js"),{throwIfNoEntry:!1})?.isFile()??!1}};var et=h(require("path")),mt=h(require("fs"));var Ws=Qe(et.join(__dirname,"templates","vite"),et.join(__dirname,"templates")),Hn=class extends Ve{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 le("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=vt(o);i!==null&&i<6&&(t.warn("Upgrading vite to ^6.1.0 (required by @cloudflare/vite-plugin)..."),await Ie({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 Ie({log:t,cwd:r,args:["install","--save",s.name]}));let a=this.getRequiredIntegrations();for(let c of a)if(!this.hasDependency(c.name)){t.info(`Installing ${c.name}...`);let u=c.dev?["install","--save-dev",c.name]:["install","--save",c.name];await Ie({log:t,cwd:r,args:u})}}getWebflowLoader(){return null}getUserConfigPatterns(){return["vite.config.mjs","vite.config.cjs","vite.config.js","vite.config.ts"]}getWranglerTemplatePath(){return et.join(Ws,"wrangler.json")}getAdditionalConfigFiles(){return[et.join(Ws,"vite.config.webflow.ts")]}hasCustomWorkerEntry(){let{log:t,cwd:r}=this.ctx;for(let n of["wrangler.json","wrangler.jsonc"]){let o=et.join(r,n);if(mt.existsSync(o)){try{let i=mt.readFileSync(o,"utf8"),s=Qr(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=et.join(r,"src","worker.ts");if(mt.existsSync(n)){t.info("src/worker.ts already exists, skipping creation");return}t.warn("src/worker.ts does not exist, creating a minimal worker..."),mt.mkdirSync(et.join(r,"src"),{recursive:!0}),mt.writeFileSync(n,`/// <reference types="@cloudflare/workers-types" />
|
|
130
130
|
|
|
131
131
|
interface Env {
|
|
132
132
|
ASSETS: Fetcher;
|
|
@@ -137,65 +137,74 @@ export default {
|
|
|
137
137
|
return env.ASSETS.fetch(request);
|
|
138
138
|
},
|
|
139
139
|
} satisfies ExportedHandler<Env>;
|
|
140
|
-
`)}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=this.hasCustomWorkerEntry();
|
|
141
|
-
`));let s=
|
|
142
|
-
`)}function
|
|
143
|
-
${
|
|
144
|
-
${
|
|
145
|
-
${
|
|
146
|
-
${X(Ge(`${n}${o}`))}`)}async function oh(e=process.cwd(),t,r,n){let o=Wo(e);if(!o)throw new Error("No package.json file found");let i=$n(l,e),s={...n?{COSMIC_MOUNT_PATH:n}:{},...t?{COSMIC_DEPLOY_URL:t}:{},...r&&!t?{COSMIC_DEPLOY_URL:$E(r)}:{}};return Rc({cwd:e,log:l,packageJson:o,userEnv:s},i)}async function ih(e,t={}){let r=t.projectPath||process.cwd(),n=Date.now(),o=te.join(r,".tmp",`webflow-build-${n}`),i=t.outputDir||te.join(o,"output"),s=t.mountPath||"/app",a=Date.now(),c=jc(r),u=t.telemetry,d=e.getBuildCommand(),p=e.getOutputDeployMetadata();await u?.sendUsage("cloud_build_start",{framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:c}),U.mkdirSync(o,{recursive:!0});try{Vt("\u{1F527}","Configure framework"),l.info(`Framework: ${e.info.displayName}`),l.info(`Mount path: ${s}`),l.info(`Deployment type: ${p.deploymentType}`);let m=e.getNodeVersionRequirement();m&&fr(l,m,e.info.displayName),l.info("Validating framework requirements..."),await e.validate(),l.info("Installing framework dependencies..."),await e.installDependencies(),Vt("\u2699\uFE0F ","Configure wrangler"),await th(e,r),l.info("Preparing framework configuration..."),await e.prepareConfig(),$c(l,r,e.info.name,e),Vt("\u{1F4E6}","Install dependencies"),await RE(r,e.info.name,t.telemetry),rh(r),Vt("\u{1F3D7}\uFE0F ","Build app"),l.info(`running ${d}...`),await PE(r,d,t.telemetry),await e.postBuild(),Vt("\u{1F9EA}","Wrangler dry-run"),await jE(r,i),Vt("\u{1F4C1}","Copy assets"),await NE(r,i,e,s),Vt("\u{1F381}","Create tarball");let g=await BE(i),y=Date.now()-a;return l.info(`${I} Build completed in ${(y/1e3).toFixed(1)}s`),await u?.sendUsage("cloud_build_success",{duration:y,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:c}),g}catch(m){let g=Date.now()-a;throw await u?.sendError(m instanceof Error?m:new Error(String(m)),"cloud_build_failure",{duration:g,framework:e.info.name,buildCommand:d,deploymentType:p.deploymentType,mountPath:s,cloudflareBindings:c}),m}}function jc(e){let t=te.join(e,"wrangler.json");if(!U.existsSync(t))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(U.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 sh(e){try{let t=te.dirname(e);t.includes(".tmp/webflow-build-")&&(Vt("\u{1F9F9}","Clean up build artifacts"),U.rmSync(t,{recursive:!0,force:!0}))}catch(t){l.warn(`Warning: Failed to clean up build artifacts: ${t}`)}}function ah(e,t){try{Vt("\u{1F9F9}","Revert framework configuration");let r=t.getUserConfigPatterns(),n=new Set;for(let s of r){let a=te.extname(s).slice(1),c=te.basename(s,`.${a}`);if(!n.has(c)){n.add(c);for(let u of["mjs","cjs","js","ts"]){let d=te.join(e,`clouduser.${c}.${u}`),p=te.join(e,`${c}.${u}`);if(U.existsSync(d)){l.info(`restoring /${c}.${u} from /clouduser.${c}.${u}...`),U.existsSync(p)&&U.unlinkSync(p),U.renameSync(d,p);break}}}}for(let s of[".jsonc",".json"]){let a=te.join(e,`clouduser.wrangler${s}`);if(U.existsSync(a)){l.info(`restoring user wrangler${s} from backup...`);let c=te.join(e,"wrangler.json");U.existsSync(c)&&U.unlinkSync(c);let u=te.join(e,`wrangler${s}`);U.renameSync(a,u);break}}let o=te.join(e,"clouduser");U.existsSync(o)&&(l.info("cleaning up clouduser directory..."),U.rmSync(o,{recursive:!0,force:!0}));for(let s of t.getAdditionalConfigFiles()){let a=te.join(e,te.basename(s));U.existsSync(a)&&(l.info(`cleaning up additional config file ${a}...`),U.unlinkSync(a))}let i=t.getWebflowLoader();if(i){let s=te.join(e,i.destinationName);U.existsSync(s)&&(l.info(`cleaning up ${i.destinationName}...`),U.unlinkSync(s))}}catch(r){l.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function RE(e,t,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=te.join(e,"package-lock.json");try{U.existsSync(i)?(l.info("Running npm ci --include=dev..."),(0,Go.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"})):(l.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,Go.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:U.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:U.existsSync(i)}),s}}function $E(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 PE(e,t,r){let n=Date.now();try{(0,Go.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 jE(e,t){U.mkdirSync(t,{recursive:!0});let r=te.join(e,"wrangler.json"),n=te.join(e,"wrangler.jsonc");if(!U.existsSync(r)&&!U.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,Go.execSync)(`npx wrangler@${OE} deploy --dry-run --outdir="${t}"`,{cwd:e,stdio:"inherit"})}async function NE(e,t,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,c=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&c&&(r.info.name==="nextjs"||r.info.name==="astro")){let g=te.join(e,i);if(U.existsSync(g)&&U.statSync(g).isDirectory()){let F=U.readdirSync(g,{withFileTypes:!0}).find(R=>!(!R.isDirectory()||s&&R.name===s||r.info.name==="astro"&&(R.name==="_routes.json"||R.name==="_worker.js")));F&&(i=`${i}/${F.name}`)}}let u=te.join(t,"assets",c||"");U.mkdirSync(u,{recursive:!0});let d=te.join(e,i);if(U.existsSync(d)&&U.statSync(d).isDirectory()){l.info(`copying assets from /${i} to output/assets...`);try{s?(l.info(`excluding ${s}`),Zr(l,d,u,{exclude:s})):Zr(l,d,u)}catch(g){l.error(g,{prefix:"Failed to copy assets:"})}}else l.info("No assets to copy or assets directory not found");let p=te.join(e,"webflow.json");U.existsSync(p)?(l.info("including webflow.json in output..."),U.copyFileSync(p,te.join(t,"webflow.json"))):l.warn("webflow.json not found at project root; deploy may fail framework detection");let m=null;for(let g of[".json",".jsonc"]){let y=te.join(e,`clouduser.wrangler${g}`);if(U.existsSync(y)){m=y;break}}if(m){l.info("including user wrangler config in output..."),U.copyFileSync(m,te.join(t,"clouduser.wrangler.json"));let g=te.join(e,"clouduser","migrations");if(U.existsSync(g)){l.info("copying migrations from clouduser/migrations to output/migrations...");let y=te.join(t,"migrations");Zr(l,g,y)}}}async function BE(e){let t=`${e}.tar.gz`;try{return await nh.create({gzip:!0,file:t,cwd:te.dirname(e)},[te.basename(e)]),l.info(`Tarball created: ${t}`),t}catch(r){throw new f(r,{prefix:"Failed to create tarball:"})}}ye();se();b();var LE="DUPLICATE_ENVIRONMENT_MOUNT",ME="ENVIRONMENT_MOUNT_MISMATCH",WE="DUPLICATE_ENVIRONMENT_BRANCH",UE="INVALID_MOUNT_PATH_FORMAT",VE="INVALID_PROJECT_ID",lh={[LE]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[ME]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[WE]:"An environment with this branch already exists for this app.",[UE]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[VE]:"Invalid app ID. This app may have been deleted or belongs to a different site. Please remove the 'app_id' field (or the legacy 'project_id' field) from your webflow.json and redeploy to create a new app."};function ch(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(l.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 lh)if(r.includes(i))return lh[i];return`An unknown error occurred. Error code: ${t.code||"N/A"}, Message: ${t.msg||"No message provided"}`}var Mn=h(require("fs")),Nc=require("child_process"),fh=h(require("semver"));b();S();$();function HE(e){if(!e)return"unknown";let t=fh.default.coerce(e)?.major;return t!==void 0?String(t):"unknown"}var uh=104857600;function dh(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 JE(){try{let e=(0,Nc.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,Nc.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 Bc(e,t,r){let n=await fetch(`${_}${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=ch(i);throw new Error(s)}return n.json()}async function ph(e,t,r,n){let{manifest:o}=V(),i=o.cloud||{},s=i.app_id??i.project_id,a=i.framework;if(!a)throw new f("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let c=HE(i.framework_version),u=await GE({siteId:e.siteId,apiToken:e.accessToken,framework:a,frameworkVersion:c,mountPath:r,environment:t,projectId:s,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:JE()});return!s&&u.project_id&&(de({cloud:{...i,app_id:u.project_id}}),l.info(`${I} App ID updated in webflow.json`)),u}async function GE(e){let{siteId:t,framework:r,frameworkVersion:n,mountPath:o,environment:i,version:s,projectId:a,projectName:c,description:u,directory:d}=e,p={framework:r,framework_version:n,mount_path:o,environment:i,version:s};a&&(p.project_id=a),c&&(p.project_name=c),u&&(p.description=u),d&&(p.app_path=d);let m=t?`/cosmic/${t}/cli-deploy-init`:"/cosmic/cli-deploy-init";return Bc(e.apiToken,m,{method:"POST",body:p})}async function mh(e,t){let{siteId:r,accessToken:n}=e,o=r?`/cosmic/${r}/cli-project-environments/${t}`:`/cosmic/cli-project-environments/${t}`;return Bc(n,o,{method:"GET"})}async function gh(e){let{siteId:t,accessToken:r}=e,n=t?`/cosmic/${t}/cli-projects`:"/cosmic/cli-projects";return Bc(r,n,{method:"GET"})}async function hh(e,t){if(!Mn.existsSync(e))throw new Error(`Tarball not found at ${e}`);let r=Mn.statSync(e);if(r.size>uh)throw new Error(`Build output is too large (${dh(r.size)}). Maximum allowed size is ${dh(uh)}.`);let n=Mn.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(([c,u])=>{i.append(c,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 c=await a.text();throw new f(c,{prefix:`${D} Upload failed with response:`})}}async function wh(e,t){if(!e||e==="undefined")throw new f("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 f(`Failed to trigger deployment: ${n.status} ${n.statusText}`)}var yh=require("webflow-api");se();se();S();function Lc(e){return new yh.WebflowClient({accessToken:e,environment:{base:`${_}/v2`,dataApi:`${_}/v2`,contentDeliveryApi:`${bi}/v2`}})}async function zo(e,t){try{let n=await Lc(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 f(r,{prefix:"Error fetching site details:"})}}async function Mc(e,t){try{return{customDomains:(await Lc(e).sites.getCustomDomain(t)).customDomains?.map(o=>({id:o.id||"",url:o.url||""}))||[]}}catch(r){throw new f(r,{prefix:"Error fetching custom domains:"})}}async function Wc(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 f(t,{prefix:`Failed to fetch manifest from ${e}:`})}}function Uc(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 Dh(e,t,r){try{let n=Lc(e),o=await zo(e,t),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(c=>c.url===s);a?.id&&i.push(a.id)}await n.sites.publish(t,{customDomains:i,publishToWebflowSubdomain:r?.publishToWebflowSubdomain??!0})}catch(n){throw new f(n,{prefix:"Error publishing site:"})}}ke();b();async function bh(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=l.spinner("Validating mount path configuration");try{let s=await zo(o,n),a=await Mc(o,n),c=[`${s.shortName}.webflow.io`,...a.customDomains?.map(y=>y.url)||[]],u=0;i.update(`Validating ${c.length} domain(s) for mount path: ${t}... (0/${c.length})`);let d=c.map(async y=>{try{let F=await Wc(y),R=Array.isArray(F.cosmic)?F.cosmic.map(ee=>ee.mountPath).filter(ee=>typeof ee=="string"):[],j=Uc(F,t,r);return{domain:y,mountPaths:R,isValid:j===!0}}catch(F){return{domain:y,mountPaths:[],isValid:!1,error:F instanceof Error?F.message:String(F)}}finally{u++,i.update(`Validating ${c.length} domain(s) for mount path: ${t}... (${u}/${c.length})`)}}),p=await Promise.all(d),m=p.some(y=>!y.isValid),g=p.every(y=>y.isValid);return i.succeed("Mount path validation completed"),{isValid:g,domains:p,needsPublishing:m}}catch(s){throw i.fail("Mount path validation failed"),s}}async function vh(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)return[];try{let i=await zo(o,n),s=await Mc(o,n),c=[`${i.shortName}.webflow.io`,...s.customDomains?.map(d=>d.url)||[]].map(async d=>{try{let p=await Wc(d),m=Uc(p,t,r);return{domain:d,isValid:m}}catch(p){return l.debug(`Could not verify mount path for ${d}: ${p}`),{domain:d,isValid:!1}}});return(await Promise.all(c)).filter(d=>d.isValid).map(d=>d.domain)}catch(i){return l.debug(`Error getting valid domains: ${i}`),[]}}function Eh(e,t){return e.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${t}`)}async function Fh(e){let t=e.map(n=>({name:n,value:n,checked:!0})),r=await Fi({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 xh(){return await Be({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 Vc(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=l.spinner(`Publishing site to ${t.length} domain(s)`);try{let s=`${(await zo(n,r)).shortName}.webflow.io`,a=t.includes(s),c=t.filter(u=>u!==s);await Dh(n,r,{domains:c,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")}}b();ie();var Qr=h(require("path"));ye();se();ve();var Ch="apps";function Hc(e){Ch=e}function Wn(){return Ch}var Ns=h(require("fs"));S();se();ke();S();b();async function $s(e){let t=await fetch(`${_}/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 f(`Missing required scopes for workspace access.
|
|
140
|
+
`)}async prepareConfig(){let{log:t,cwd:r,userEnv:n}=this.ctx,o=this.hasCustomWorkerEntry();It(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"),mt.writeFileSync(et.join(r,"clouduser.vite.config.ts"),`export default {};
|
|
141
|
+
`));let s=et.join(Ws,"vite.config.webflow.ts");He(s)&&(t.info("Copying vite.config.webflow.ts..."),mt.copyFileSync(s,et.join(r,"vite.config.webflow.ts")));let a=et.join(Ws,"vite.config.ts.template"),c=et.join(r,"vite.config.ts");t.info("Generating vite.config.ts from template..."),await Tt(t,a,c,{...process.env,...n}),o||this.ensureWorkerEntry()}getBuildCommand(){return"vite build"}getNodeVersionRequirement(){return{minimum:"18.0.0",severity:"error"}}getFrameworkVersion(){return this.resolveFrameworkVersion("vite")}static getOutputDeployMetadata(){return{staticAssetsPath:"dist/client",workerEntryPath:"./src/worker.ts",deploymentType:"ssr-spa-combo",usesAssetsBinding:!0}}};var vh=[Wn,on,nn,Vn,Hn],Zo=["astro","nextjs","vite"];function Us(e,t){for(let r of vh){let n=r.detect(e,t);if(n.detected)return{Builder:r,result:n}}return null}function Kc(e,t){let r=Us(e.packageJson,t);if(!r)throw new hr("Could not detect framework from package.json or webflow.json",{remediation:`Create a webflow.json file with: { "cloud": { "framework": "astro" } } (or one of: ${Zo.join(", ")})`});return e.log.info(`Detected framework: ${r.result.reason}`),new r.Builder(e)}function qc(e,t,r,n){let o=Eh.join(t,"webflow.json"),i={cloud:{}};if(Jn.existsSync(o))try{let a=Jn.readFileSync(o,"utf8"),c=JSON.parse(a),u=Ms.safeParse(c);if(u.success)i=u.data;else{let p=u.error.issues.map(f=>`${f.path.join(".")}: ${f.message}`).join(", ");e.warn(`webflow.json has schema issues (will be corrected): ${p}`),i=c}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.contract_version="1",s.deployment_type=a.deploymentType,s.entrypoint_path=a.dryRunEntryPath??"./index.js",s.skip_no_bundle=a.skipNoBundle===!0;let c=n.getFrameworkVersion();c&&(s.framework_version=c),a.assetsSourceSkipMountPath&&(s.assets_source_skip_mount_path=!0),(0,Fh.validateForDeploy)(i)}e.info(`Creating webflow.json with framework: ${r}`),Jn.writeFileSync(o,JSON.stringify(i,null,2))}function xh(e,t){let r=Mn(e,t);if(r?.cloud?.framework)return r.cloud.framework;let n=Go(t);if(!n)throw new hr("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=Us(n,r);if(!o)throw new hr("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}`),qc(e,t,i),i}v();var _h=B.object({name:B.string(),main:B.string().optional(),compatibility_date:B.string(),compatibility_flags:B.array(B.string()).optional(),placement:B.object({mode:B.string()}).passthrough().optional(),assets:B.object({directory:B.string(),binding:B.string().optional()}).passthrough().optional(),d1_databases:B.array(B.object({database_name:B.string(),database_id:B.string(),binding:B.string(),migrations_dir:B.string().optional()}).passthrough()).default([]),kv_namespaces:B.array(B.object({binding:B.string(),id:B.string()}).passthrough()).default([]),r2_buckets:B.array(B.object({binding:B.string(),bucket_name:B.string()}).passthrough()).default([])}).passthrough();function Ch(e){return e.issues.map(t=>` - ${t.path.length>0?t.path.join("."):"<root>"}: ${t.message}`).join(`
|
|
142
|
+
`)}function kh(e,t="wrangler.json"){let r=Et.join(e,t);if(!Be.existsSync(r)){if(t.endsWith(".json"))return l.warn(`/${t} not found, checking for /${t}c`),kh(e,t+"c");l.warn(`/${t} not found`);return}let n=Be.readFileSync(r,"utf8");l.info(`reading /${t}...`);let o;try{o=Qr(n)}catch(s){l.error(`/${t} loaded but could not parse as JSONC: ${s}`);return}let i=_h.safeParse(o);if(!i.success){l.error(`/${t} loaded but schema validation failed:
|
|
143
|
+
${Ch(i.error)}`);return}return l.info(`successfully loaded /${t}`),i.data}async function Sh(e,t){let r=null,n=null,o=Et.join(t,"wrangler.json"),i=Et.join(t,"wrangler.jsonc");Be.existsSync(o)?(r=o,n=".json"):Be.existsSync(i)&&(r=i,n=".jsonc"),r&&n&&(l.info(`saving user-provided wrangler JSON as /clouduser.wrangler${n}...`),Be.copyFileSync(r,Et.join(t,`clouduser.wrangler${n}`)));let s=r?kh(t,Et.basename(r)):null,a=e.getWranglerTemplatePath(),c=Et.join(t,"wrangler.json");if(!Be.existsSync(a))throw new Error(`Wrangler template not found at ${a}. Make sure the template is properly copied during build.`);if(l.info(`copying wrangler template for ${e.info.name} to /wrangler.json`),Be.copyFileSync(a,c),!s)return;let u=JSON.parse(Be.readFileSync(c,"utf8"));if(s.kv_namespaces&&s.kv_namespaces.length>0&&(u.kv_namespaces=s.kv_namespaces,l.info(`merged ${s.kv_namespaces.length} KV namespace(s) into template`)),s.r2_buckets&&s.r2_buckets.length>0&&(u.r2_buckets=s.r2_buckets,l.info(`merged ${s.r2_buckets.length} R2 bucket(s) into template`)),s.d1_databases&&s.d1_databases.length>0&&(u.d1_databases=s.d1_databases,l.info(`merged ${s.d1_databases.length} D1 database(s) into template`)),Be.writeFileSync(c,JSON.stringify(u,null,2)),s.d1_databases.length!==0)for(let p in s.d1_databases){let f=s.d1_databases[p];if(!f.migrations_dir){l.info(`skipping migrations for database ${p} in wrangler.json; migrations dir is not defined`);continue}let m=f.migrations_dir,g=Et.join(t,m);if(!Be.existsSync(g)){l.info(`skipping migrations for database ${p} in wrangler.json; migrations dir (/${m}) does not exist`);continue}let w=Et.join(t,"clouduser","migrations",m),I=rn(l,g,w);I>0?l.info(`copied ${I} migrations to /clouduser/migrations/${m}`):l.info(`skipping migrations for database ${p} in wrangler.json; migrations dir (/${m}) is empty`)}}function gF(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 Ah(e){let t=null;for(let s of[".json",".jsonc"]){let a=Et.join(e,`clouduser.wrangler${s}`);if(Be.existsSync(a)){t=a;break}}if(!t)return;let r=Be.readFileSync(t,"utf8"),n;try{n=Qr(r)}catch(s){throw new Error(`Failed to parse wrangler config at ${t} as JSONC: ${s}`)}let o=_h.safeParse(n);if(!o.success)throw new Error(`Invalid wrangler config at ${t}:
|
|
144
|
+
${Ch(o.error)}`);let i=o.data;if(i.r2_buckets&&i.r2_buckets.length>0){l.info(`validating ${i.r2_buckets.length} object storage bucket name(s)...`);for(let s of i.r2_buckets)gF(s.bucket_name)}}v();x();$();ie();var hF="4.82.1",Vs=60;function qt(e,t){let r=Math.min(Vs,process.stdout.columns??Vs),n=`\u2500\u2500\u2500 ${e} ${t} `,o="\u2500".repeat(Math.max(0,r-n.length));l.info(`
|
|
145
|
+
${Q(`${n}${o}`)}`)}function Zc(e,t){let r=Math.min(Vs,process.stdout.columns??Vs),n=`\u2550\u2550\u2550 ${e} ${t} `,o="\u2550".repeat(Math.max(0,r-n.length));l.info(`
|
|
146
|
+
${Q(Ze(`${n}${o}`))}`)}async function Ih(e=process.cwd(),t,r,n){let o=Go(e);if(!o)throw new Error("No package.json file found");let i=Mn(l,e),s={...n?{COSMIC_MOUNT_PATH:n}:{},...t?{COSMIC_DEPLOY_URL:t}:{},...r&&!t?{COSMIC_DEPLOY_URL:yF(r)}:{}};return Kc({cwd:e,log:l,packageJson:o,userEnv:s},i)}async function Oh(e,t={}){let r=t.projectPath||process.cwd(),n=Date.now(),o=te.join(r,".tmp",`webflow-build-${n}`),i=t.outputDir||te.join(o,"output"),s=t.mountPath||"/app",a=Date.now(),c=Yc(r),u=t.telemetry,p=e.getBuildCommand(),f=e.getOutputDeployMetadata();await u?.sendUsage("cloud_build_start",{framework:e.info.name,buildCommand:p,deploymentType:f.deploymentType,mountPath:s,cloudflareBindings:c}),V.mkdirSync(o,{recursive:!0});try{qt("\u{1F527}","Configure framework"),l.info(`Framework: ${e.info.displayName}`),l.info(`Mount path: ${s}`),l.info(`Deployment type: ${f.deploymentType}`);let m=e.getNodeVersionRequirement();m&&wr(l,m,e.info.displayName),l.info("Validating framework requirements..."),await e.validate(),l.info("Installing framework dependencies..."),await e.installDependencies(),qt("\u2699\uFE0F ","Configure wrangler"),await Sh(e,r),l.info("Preparing framework configuration..."),await e.prepareConfig(),qc(l,r,e.info.name,e),qt("\u{1F4E6}","Install dependencies"),await wF(r,e.info.name,t.telemetry),Ah(r),qt("\u{1F3D7}\uFE0F ","Build app"),l.info(`running ${p}...`),await DF(r,p,t.telemetry),await e.postBuild(),qt("\u{1F9EA}","Wrangler dry-run"),await bF(r,i),qt("\u{1F4C1}","Copy assets"),await vF(r,i,e,s),qt("\u{1F381}","Create tarball");let g=await EF(i),w=Date.now()-a;return l.info(`${O} Build completed in ${(w/1e3).toFixed(1)}s`),await u?.sendUsage("cloud_build_success",{duration:w,framework:e.info.name,buildCommand:p,deploymentType:f.deploymentType,mountPath:s,cloudflareBindings:c}),g}catch(m){let g=Date.now()-a;throw await u?.sendError(m instanceof Error?m:new Error(String(m)),"cloud_build_failure",{duration:g,framework:e.info.name,buildCommand:p,deploymentType:f.deploymentType,mountPath:s,cloudflareBindings:c}),m}}function Yc(e){let t=te.join(e,"wrangler.json");if(!V.existsSync(t))return{hasKV:!1,hasD1:!1,hasR2:!1,hasVars:!1,kvCount:0,d1Count:0,r2Count:0,varCount:0};try{let r=JSON.parse(V.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 Rh(e){try{let t=te.dirname(e);t.includes(".tmp/webflow-build-")&&(qt("\u{1F9F9}","Clean up build artifacts"),V.rmSync(t,{recursive:!0,force:!0}))}catch(t){l.warn(`Warning: Failed to clean up build artifacts: ${t}`)}}function $h(e,t){try{qt("\u{1F9F9}","Revert framework configuration");let r=t.getUserConfigPatterns(),n=new Set;for(let s of r){let a=te.extname(s).slice(1),c=te.basename(s,`.${a}`);if(!n.has(c)){n.add(c);for(let u of["mjs","cjs","js","ts"]){let p=te.join(e,`clouduser.${c}.${u}`),f=te.join(e,`${c}.${u}`);if(V.existsSync(p)){l.info(`restoring /${c}.${u} from /clouduser.${c}.${u}...`),V.existsSync(f)&&V.unlinkSync(f),V.renameSync(p,f);break}}}}for(let s of[".jsonc",".json"]){let a=te.join(e,`clouduser.wrangler${s}`);if(V.existsSync(a)){l.info(`restoring user wrangler${s} from backup...`);let c=te.join(e,"wrangler.json");V.existsSync(c)&&V.unlinkSync(c);let u=te.join(e,`wrangler${s}`);V.renameSync(a,u);break}}let o=te.join(e,"clouduser");V.existsSync(o)&&(l.info("cleaning up clouduser directory..."),V.rmSync(o,{recursive:!0,force:!0}));for(let s of t.getAdditionalConfigFiles()){let a=te.join(e,te.basename(s));V.existsSync(a)&&(l.info(`cleaning up additional config file ${a}...`),V.unlinkSync(a))}let i=t.getWebflowLoader();if(i){let s=te.join(e,i.destinationName);V.existsSync(s)&&(l.info(`cleaning up ${i.destinationName}...`),V.unlinkSync(s))}}catch(r){l.warn(`Warning: Failed to cleanup framework configuration: ${r}`)}}async function wF(e,t,r){let n=Date.now(),o=["--no-update-notifier","--no-progress"],i=te.join(e,"package-lock.json");try{V.existsSync(i)?(l.info("Running npm ci --include=dev..."),(0,Yo.execSync)(`npm ci --include=dev ${o.join(" ")}`,{cwd:e,stdio:"inherit"})):(l.info("Warning: No package-lock.json found, installing dependencies with npm install --include=dev"),(0,Yo.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:V.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:V.existsSync(i)}),s}}function yF(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 DF(e,t,r){let n=Date.now();try{(0,Yo.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 bF(e,t){V.mkdirSync(t,{recursive:!0});let r=te.join(e,"wrangler.json"),n=te.join(e,"wrangler.jsonc");if(!V.existsSync(r)&&!V.existsSync(n))throw new Error("Missing wrangler configuration: wrangler.json or wrangler.jsonc file is required");(0,Yo.execSync)(`npx wrangler@${hF} deploy --dry-run --outdir="${t}"`,{cwd:e,stdio:"inherit"})}async function vF(e,t,r,n){let o=r.getOutputDeployMetadata(),i=o.staticAssetsPath,s=o.staticAssetsExclude?.[0],a=o.assetsSourceSkipMountPath===!0,c=n.replace(/\/+$/,"").replace(/^\/+/,"");if(!a&&c&&(r.info.name==="nextjs"||r.info.name==="astro")){let g=te.join(e,i);if(V.existsSync(g)&&V.statSync(g).isDirectory()){let I=V.readdirSync(g,{withFileTypes:!0}).find(C=>!(!C.isDirectory()||s&&C.name===s||r.info.name==="astro"&&(C.name==="_routes.json"||C.name==="_worker.js")));I&&(i=`${i}/${I.name}`)}}let u=te.join(t,"assets",c||"");V.mkdirSync(u,{recursive:!0});let p=te.join(e,i);if(V.existsSync(p)&&V.statSync(p).isDirectory()){l.info(`copying assets from /${i} to output/assets...`);try{s?(l.info(`excluding ${s}`),rn(l,p,u,{exclude:s})):rn(l,p,u)}catch(g){l.error(g,{prefix:"Failed to copy assets:"})}}else l.info("No assets to copy or assets directory not found");let f=te.join(e,"webflow.json");V.existsSync(f)?(l.info("including webflow.json in output..."),V.copyFileSync(f,te.join(t,"webflow.json"))):l.warn("webflow.json not found at project root; deploy may fail framework detection");let m=null;for(let g of[".json",".jsonc"]){let w=te.join(e,`clouduser.wrangler${g}`);if(V.existsSync(w)){m=w;break}}if(m){l.info("including user wrangler config in output..."),V.copyFileSync(m,te.join(t,"clouduser.wrangler.json"));let g=te.join(e,"clouduser","migrations");if(V.existsSync(g)){l.info("copying migrations from clouduser/migrations to output/migrations...");let w=te.join(t,"migrations");rn(l,g,w)}}}async function EF(e){let t=`${e}.tar.gz`;try{return await Th.create({gzip:!0,file:t,cwd:te.dirname(e)},[te.basename(e)]),l.info(`Tarball created: ${t}`),t}catch(r){throw new d(r,{prefix:"Failed to create tarball:"})}}ve();se();v();var FF="DUPLICATE_ENVIRONMENT_MOUNT",xF="ENVIRONMENT_MOUNT_MISMATCH",_F="DUPLICATE_ENVIRONMENT_BRANCH",CF="INVALID_MOUNT_PATH_FORMAT",kF="INVALID_PROJECT_ID",Ph={[FF]:"An environment with this mount path already exists for this site. Please choose a different mount path.",[xF]:"This environment already exists with a different mount path. Please create a new environment or use the existing environment's mount path.",[_F]:"An environment with this branch already exists for this app.",[CF]:"Mount path format is invalid. It must start with a / and be followed by at least one character (e.g., /app).",[kF]:"Invalid app ID. This app may have been deleted or belongs to a different site. Please remove the 'app_id' field (or the legacy 'project_id' field) from your webflow.json and redeploy to create a new app."};function jh(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(l.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 Ph)if(r.includes(i))return Ph[i];return`An unknown error occurred. Error code: ${t.code||"N/A"}, Message: ${t.msg||"No message provided"}`}var zn=h(require("fs")),Qc=require("child_process"),Bh=h(require("semver"));v();x();$();x();be();v();x();function Gn(e,t){if(!e||e.trim()==="")throw new d(`Invalid ${t}: value is empty.`,{isUserError:!0})}var SF={siteId:{missingFlag:"siteId",flagHint:"--site",env:"WEBFLOW_SITE_ID",manifest:e=>e.siteId},appId:{missingFlag:"appId",flagHint:"--app-id",env:"WEBFLOW_APP_ID",manifest:e=>e.cloud?.app_id??e.cloud?.project_id},environmentId:{missingFlag:"environmentId",flagHint:"--environment-id",env:"WEBFLOW_APP_ENVIRONMENT_ID",manifest:e=>e.cloud?.environment_id},workspaceId:{missingFlag:"workspaceId",flagHint:"--workspace-id",env:"WEBFLOW_WORKSPACE_ID",manifest:e=>e.cloud?.workspace_id}};function Xc(e){return typeof e=="string"&&e.trim()!==""}async function tt(e,t={}){let r=SF[e],{flagValue:n,manifest:o,flagName:i,prompt:s}=t,a=t.isNoInput??H(),c=t.json??vp();if(Xc(n))return Gn(n,e),n;let u=process.env[r.env];if(Xc(u))return Gn(u,e),u;let p=r.manifest(o??{});if(Xc(p))return c||l.info(`Using ${e} from webflow.json`),Gn(p,e),p;if(!a&&s){let m=await s();return Gn(m,e),m}let f=i??r.flagHint;throw new d(`Missing required ${e}. Pass ${f}, set ${r.env}, or add it to webflow.json.`,{isUserError:!0,missingFlag:r.missingFlag})}x();var AF=/[\x00-\x1f?#%/\\]/;function Xo(e,t){if(!e||e.trim()==="")throw new d(`Invalid ${t}: value is empty.`,{isUserError:!0});if(AF.test(e)||e.includes(".."))throw new d(`Invalid ${t}: "${e}" contains disallowed characters.`,{isUserError:!0})}function _e(e,t){Xo(e,t)}function TF(e){if(!e)return"unknown";let t=Bh.default.coerce(e)?.major;return t!==void 0?String(t):"unknown"}var Nh=104857600;function Lh(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 IF(){try{let e=(0,Qc.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,Qc.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 eu(e,t,r){let n=await fetch(`${F}${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=jh(i);throw new Error(s)}return n.json()}async function Mh(e,t,r,n){let{manifest:o}=J(),i=o.cloud||{},s=i.framework,a;try{a=await tt("appId",{flagValue:n?.appId,manifest:o})}catch(p){if(p instanceof d&&p.missingFlag==="appId")a=void 0;else throw p}if(!s)throw new d("No framework specified in webflow.json. Please ensure your webflow.json has a cloud.framework property");let c=TF(i.framework_version),u=await OF({siteId:e.siteId,apiToken:e.accessToken,framework:s,frameworkVersion:c,mountPath:r,environment:t,projectId:a,projectName:n?.projectName,description:n?.description,directory:n?.directory,version:IF()});return!a&&u.project_id&&(pe({cloud:{...i,app_id:u.project_id}}),l.info(`${O} App ID updated in webflow.json`)),u}async function OF(e){let{siteId:t,framework:r,frameworkVersion:n,mountPath:o,environment:i,version:s,projectId:a,projectName:c,description:u,directory:p}=e,f={framework:r,framework_version:n,mount_path:o,environment:i,version:s};a&&(f.project_id=a),c&&(f.project_name=c),u&&(f.description=u),p&&(f.app_path=p);let m=t?`/cosmic/${t}/cli-deploy-init`:"/cosmic/cli-deploy-init";return eu(e.apiToken,m,{method:"POST",body:f})}async function Wh(e,t){let{siteId:r,accessToken:n}=e,o=r?`/cosmic/${r}/cli-project-environments/${t}`:`/cosmic/cli-project-environments/${t}`;return eu(n,o,{method:"GET"})}async function Uh(e){let{siteId:t,accessToken:r}=e,n=t?`/cosmic/${t}/cli-projects`:"/cosmic/cli-projects";return eu(r,n,{method:"GET"})}async function Vh(e,t){if(!zn.existsSync(e))throw new Error(`Tarball not found at ${e}`);let r=zn.statSync(e);if(r.size>Nh)throw new Error(`Build output is too large (${Lh(r.size)}). Maximum allowed size is ${Lh(Nh)}.`);let n=zn.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(([c,u])=>{i.append(c,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 c=await a.text();throw new d(c,{prefix:`${D} Upload failed with response:`})}}async function Hh(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 Jh=require("webflow-api");se();se();x();function tu(e){return new Jh.WebflowClient({accessToken:e,environment:{base:`${F}/v2`,dataApi:`${F}/v2`,contentDeliveryApi:`${Ai}/v2`}})}async function Qo(e,t){try{let n=await tu(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 ru(e,t){try{return{customDomains:(await tu(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 nu(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 ou(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 Gh(e,t,r){try{let n=tu(e),o=await Qo(e,t),i=[];if(r?.domains&&r.domains.length>0)for(let s of r.domains){let a=o.customDomains?.find(c=>c.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:"})}}Se();v();async function zh(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=l.spinner("Validating mount path configuration");try{let s=await Qo(o,n),a=await ru(o,n),c=[`${s.shortName}.webflow.io`,...a.customDomains?.map(w=>w.url)||[]],u=0;i.update(`Validating ${c.length} domain(s) for mount path: ${t}... (0/${c.length})`);let p=c.map(async w=>{try{let I=await nu(w),C=Array.isArray(I.cosmic)?I.cosmic.map(Z=>Z.mountPath).filter(Z=>typeof Z=="string"):[],q=ou(I,t,r);return{domain:w,mountPaths:C,isValid:q===!0}}catch(I){return{domain:w,mountPaths:[],isValid:!1,error:I instanceof Error?I.message:String(I)}}finally{u++,i.update(`Validating ${c.length} domain(s) for mount path: ${t}... (${u}/${c.length})`)}}),f=await Promise.all(p),m=f.some(w=>!w.isValid),g=f.every(w=>w.isValid);return i.succeed("Mount path validation completed"),{isValid:g,domains:f,needsPublishing:m}}catch(s){throw i.fail("Mount path validation failed"),s}}async function Kh(e,t,r){let{siteId:n,accessToken:o}=e;if(!n)return[];try{let i=await Qo(o,n),s=await ru(o,n),c=[`${i.shortName}.webflow.io`,...s.customDomains?.map(p=>p.url)||[]].map(async p=>{try{let f=await nu(p),m=ou(f,t,r);return{domain:p,isValid:m}}catch(f){return l.debug(`Could not verify mount path for ${p}: ${f}`),{domain:p,isValid:!1}}});return(await Promise.all(c)).filter(p=>p.isValid).map(p=>p.domain)}catch(i){return l.debug(`Error getting valid domains: ${i}`),[]}}function qh(e,t){return e.map(r=>`${r.startsWith("localhost")||r.startsWith("127.0.0.1")?"http":"https"}://${r}${t}`)}async function Zh(e){let t=e.map(n=>({name:n,value:n,checked:!0})),r=await Oi({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 Yh(){return await Ne({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 iu(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=l.spinner(`Publishing site to ${t.length} domain(s)`);try{let s=`${(await Qo(n,r)).shortName}.webflow.io`,a=t.includes(s),c=t.filter(u=>u!==s);await Gh(n,r,{domains:c,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")}}v();ie();var sn=h(require("path"));ve();se();be();var Xh="apps";function su(e){Xh=e}function Kn(){return Xh}var zs=h(require("fs"));x();se();Se();x();v();async function Hs(e){let t=await fetch(`${F}/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.
|
|
147
147
|
${o.message??""}
|
|
148
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`):new
|
|
149
|
-
${o.message}`:""))}return(await t.json()).workspaces}async function
|
|
148
|
+
Re-run 'webflow auth login' to grant the necessary permissions.`):new d(`Failed to fetch workspaces: ${t.status} ${t.statusText}`+(o.message?`
|
|
149
|
+
${o.message}`:""))}return(await t.json()).workspaces}async function Js(e){if(e.length===1)return e[0];let t=await Ce({message:"Select the workspace for this app:",choices:e.map(r=>({name:r.name,value:r}))});return t||(l.warn(`Auto fallback to first workspace: ${e[0].name}`),e[0])}rs();$();v();$();ie();async function au(e,t){l.warn(`${ge} ${ne("webflow cloud create")} is deprecated and will be removed in the next major release.
|
|
150
150
|
Use ${P("webflow cloud init")} instead.
|
|
151
|
-
`);let{framework:r}=t;if(!(await
|
|
152
|
-
- `);throw new
|
|
151
|
+
`);let{framework:r}=t;if(!(await qn()).find(i=>i===r)){l.error(`Framework ${r} not found`);return}await Gs(e,"/app",r,void 0,ae.Existing,void 0)}v();async function lu(){let e=await qn();l.info("Available app templates:"),e.length>0?e.forEach(t=>l.info(`- ${t}`)):l.info("No templates found.")}U();x();be();Se();v();$();var Qh=h(require("path"));function yr(e){if(!e||e.trim()==="")return"/";let t=Qh.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 ei(e){return!(!e||e.trim()===""||!e.startsWith("/")||e.includes(".."))}ie();v();$();function ti(e,t){l.warn(`${ge} ${ne(e)} is deprecated; use ${P(t)} instead.`)}async function cu(e){if(e.appName!==void 0&&e.projectName!==void 0)throw new d("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");e.projectName!==void 0&&ti("--project-name","--app-name");let t=e.appName??e.projectName;if(e.workspaceId&&e.siteId)throw new d("--workspace-id and --site-id are mutually exclusive. Pass exactly one.");if(e.new&&e.siteId)throw new d("--new and --site-id are mutually exclusive. Use --site-id to connect to an existing site, or --new to create a standalone app.");let r=process.stdin.isTTY,n;r&&yt()&&(n=await E());let o=!1;if(n&&!e.new&&!e.siteId)try{(await xo(n)).length===0&&(l.info(`${Oe} No existing Webflow sites in your workspace \u2014 starting a new app.`),o=!0)}catch(g){l.debug(`Skipped sites lookup in cloud init preflight: ${g}`)}let i=await qn(),s={};if(r&&yt()){if(!e.new&&!o&&(s.initMode=await Ce({message:"Where do you want to deploy this app?",choices:[{name:"New domain",value:ae.New},{name:"Existing site",value:ae.Existing}],default:ae.New})),e?.framework||(s.scaffoldName=await Ce({message:"Which framework would you like to use?",choices:i.map(w=>({name:w,value:w})),default:"astro"})),!t){let w=await ke({message:"What would you like to name your app?",validate:I=>{let C=I.trim();return C===""?"App name cannot be empty":C.length<Ut||C.length>Vt?`App name must be between ${Ut} and ${Vt} characters`:!0}});if(w==null)throw new d("When --no-input mode is enabled please provide the --app-name option.");s.appName=w}let g=e.new||o||s.initMode===ae.New;if(!e.mount&&!g){let w=await ke({message:"What path do you want to use locally? (e.g., /app)",default:"/app"});s.mountPath=yr(w)}}let a=t||s.appName,c=e.framework||s.scaffoldName,u=e.new||o?ae.New:s.initMode??(e.siteId?ae.Existing:H()?ae.New:ae.Existing),p=u===ae.New?e.mount||s.mountPath||"/":e.mount||s.mountPath||"/app",f=e.siteId,m=yr(p);if(!a||typeof a!="string"||a.trim()==="")throw new d("--app-name cannot be empty");if(a.length<Ut||a.length>Vt)throw new d(`--app-name must be between ${Ut} and ${Vt} characters`);if(!c)throw new d("--framework is required");if(!i.includes(c)){let g=i.join(`
|
|
152
|
+
- `);throw new d(`--framework "${c}" not found
|
|
153
153
|
|
|
154
154
|
Available frameworks:
|
|
155
|
-
- ${g}`)}if(typeof m!="string"||!
|
|
155
|
+
- ${g}`)}if(typeof m!="string"||!ei(m))throw new d("Invalid mount path: "+m);if(u===ae.Existing&&!f&&(!r||H()))throw new d("--site-id is required when connecting to an existing site in non-interactive mode.");await Gs(a,m,c,f,u,e.workspaceId)}var iw=h(require("path"));U();x();be();Se();v();$();ve();W();var ew=require("crypto");se();x();async function tw(e){let{accessToken:t,workspaceId:r,displayName:n,description:o,appPath:i}=e,a={requestId:(0,ew.randomUUID)(),cloudApp:{displayName:n,description:o,appPath:i,source:{type:"CLI",cli:{sourceUrl:Mg}}}},c=`${F}/cosmic/workspaces/${r}/cloudApps`,u=await fetch(c,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json","Accept-Version":"1.0.0"},body:JSON.stringify(a)});if(!u.ok){let p=await u.text();throw RF(u.status,u.statusText,p)}return u.json()}function RF(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.
|
|
156
156
|
${n.msg??""}
|
|
157
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`):new
|
|
158
|
-
Upgrade your plan or remove unused apps to create a new one.`):new
|
|
159
|
-
${n.msg}`:""))}function
|
|
157
|
+
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.publicErrorCode==="workspace_unhosted_project_limit"?new d($F(n.planName,n.limit)):n.msg?.includes("No new sites can be created")?new d(`Failed to create app: your workspace has reached its app limit.
|
|
158
|
+
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?`
|
|
159
|
+
${n.msg}`:""))}function $F(e,t){let r="Upgrade your plan or remove unused apps to create a new one.",n=t===1?"Cloud app":"Cloud apps";return e&&typeof t=="number"&&t>0?`Your "${e}" workspace is limited to ${t} ${n}.
|
|
160
160
|
${r}`:typeof t=="number"&&t>0?`Your workspace is limited to ${t} ${n}.
|
|
161
161
|
${r}`:e?`Your "${e}" workspace has reached its Cloud app limit.
|
|
162
162
|
${r}`:`Failed to create app: your workspace has reached its app limit.
|
|
163
|
-
`+r}
|
|
163
|
+
`+r}ve();x();be();Se();U();async function ow(e={}){PF(e);let t=await jF(e,J().manifest);return{credentials:t.credentials,workspaceId:t.workspaceId,manifest:J().manifest}}function PF(e){if(e.siteId&&e.workspaceId)throw new d("--site-id and --workspace-id are mutually exclusive. Pass exactly one.")}async function jF(e,t){if(e.siteId)return rw(t,e.siteId);if(e.workspaceId)return nw(e.workspaceId);try{let r=await tt("siteId",{manifest:t});return rw(t,r)}catch(r){if(!(r instanceof d)||r.missingFlag!=="siteId")throw r}try{let r=await tt("workspaceId",{manifest:t});return nw(r)}catch(r){if(!(r instanceof d)||r.missingFlag!=="workspaceId")throw r}if(H()||!yt())throw new d(`No identity configured for this app.
|
|
164
164
|
Pass one of:
|
|
165
165
|
--site-id <id> (deploy to an existing Webflow site)
|
|
166
166
|
--workspace-id <id> (create a new Cloud app)
|
|
167
|
-
Or run 'webflow cloud init' to scaffold a new app.`);return
|
|
168
|
-
Use --app-name to provide a valid name.`);let
|
|
169
|
-
No existing apps found. A new app will be created during deployment.`)}catch(
|
|
170
|
-
Available frameworks: ${s.supportedIds.join(", ")}`),new
|
|
171
|
-
Available frameworks: ${s.supportedIds.join(", ")}`),new
|
|
172
|
-
Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?
|
|
173
|
-
\u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await
|
|
174
|
-
|
|
175
|
-
${
|
|
176
|
-
Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},
|
|
167
|
+
Or run 'webflow cloud init' to scaffold a new app.`);return LF(t)}async function rw(e,t){return{credentials:await Ee(e,{site:t})}}async function nw(e){let t=await E();return{workspaceId:e,credentials:{accessToken:t,siteId:""}}}async function NF(){let e=await E(),t=await Hs(e);if(t.length===0)throw new nr("No workspaces found in your account. Please make sure you have at least one workspace.");let r=await Js(t);return pe({cloud:{workspace_id:r.id}}),{workspaceId:r.id,credentials:{accessToken:e,siteId:""}}}async function LF(e){let t=await Ce({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"?NF():{credentials:await Ee(e,{})}}async function uu(e){try{if(e.appName!==void 0&&e.projectName!==void 0)throw new d("--app-name and --project-name are aliases of the same option. Pass exactly one (--app-name is preferred; --project-name is deprecated).");if(e.appId!==void 0&&e.projectId!==void 0)throw new d("--app-id and --project-id are aliases of the same option. Pass exactly one (--app-id is preferred; --project-id is deprecated).");e.projectName!==void 0&&ti("--project-name","--app-name"),e.projectId!==void 0&&ti("--project-id","--app-id");let t=e.appName??e.projectName,r=e.appId??e.projectId;if(e.directory)try{process.chdir(e.directory),l.info(`Changed directory to: ${e.directory}`)}catch(w){throw l.error(`Error: Could not change to directory ${e.directory}`),new d(w)}if(e.framework){if(!Zo.includes(e.framework))throw new d(`Framework "${e.framework}" is not supported. Allowed: ${Zo.join(", ")}.`);pe({cloud:{framework:e.framework}})}let n=await ow({siteId:e.siteId,workspaceId:e.workspaceId}),{workspaceId:o}=n,{credentials:i,manifest:s}=n,a=!!o;if(o){let w=iw.default.basename(process.cwd()).trim(),I=w.length>=Ut&&w.length<=Vt,C=t??(I?w:"Cloud App");if(C.length<Ut||C.length>Vt)throw new d(`App name must be between ${Ut} and ${Vt} characters (got ${C.length}).
|
|
168
|
+
Use --app-name to provide a valid name.`);let q=l.spinner("Creating Cloud app...");try{let S=await tw({accessToken:i.accessToken,workspaceId:o,displayName:C});q.succeed(`Cloud app created: ${S.cloudApp.displayName}`),pe({siteId:S.cloudApp.siteId,cloud:{...s.cloud,app_id:S.cloudApp.project.id,environment_id:S.cloudApp.environment.id}}),Lt({siteId:S.cloudApp.siteId,directory:"."}),process.env.WEBFLOW_SITE_ID=S.cloudApp.siteId,{manifest:s}=J()}catch(S){throw q.fail("Failed to create app"),new d(S,{prefix:"Could not create app:"})}let Z=s.siteId;if(!Z)throw new d("Expected siteId in manifest after Cloud app creation.");i={accessToken:i.accessToken,siteId:Z}}let c;try{c=b.forCloud({authToken:i.accessToken,siteId:i.siteId})}catch(w){l.debug(`Failed to initialize telemetry: ${w}`)}let u;try{u=await tt("appId",{flagValue:r,manifest:s})}catch(w){if(w instanceof d&&w.missingFlag==="appId")u=void 0;else throw w}let p,f,m=t,g=e.description;if(e.environment&&e.mount){if(p=e.environment,f=yr(e.mount),!ei(f))throw new d("Invalid mount path: "+f)}else{let w=[];if(!u){if(!m&&H())throw new d("When --no-input mode is enabled, provide --app-name to create an app, or provide --app-id, set WEBFLOW_APP_ID, or set cloud.app_id in webflow.json to deploy to an existing app.");try{let C=await Uh(i);if(C.projects.length>0){let q=await Ce({message:"Select an app to deploy to:",choices:[...C.projects.map(Z=>({name:`${Z.name} (${Z.description||"No description"})`,value:Z.id})),{name:"Create new app",value:null}]});q?(u=q,pe({cloud:{app_id:q}}),l.info(`${O} App ID updated in webflow.json`)):l.info("Creating a new app will be handled during deployment.")}else l.info(`
|
|
169
|
+
No existing apps found. A new app will be created during deployment.`)}catch(C){l.warn("Could not fetch existing apps. A new app will be created during deployment."),l.warn(C instanceof Error?C.message:String(C))}}if(!u&&!m&&(m=await ke({message:"What would you like to name your new app?",default:"New Webflow Cloud App",validate:C=>C.trim()===""?"App name cannot be empty":!0})),u)try{let q=(await Wh(i,u)).environments.map(Z=>({name:`${Z.branch} (${Z.mount})`,value:{branch:Z.branch,mount:Z.mount}}));w.push(...q)}catch(C){throw new d(C,{prefix:"Error fetching app environments:"})}w.push({name:"Create new environment",value:null});let I=await Ce({message:"Select an environment to deploy to:",choices:w});if(I)p=I.branch,f=yr(I.mount);else if(e.environment?p=e.environment:p=await ke({message:"What environment would you like to deploy to?",default:"main",validate:C=>C.trim()===""?"Environment cannot be empty":!0}),e.mount)f=yr(e.mount);else{let C=await ke({message:"What path should this environment be mounted at? (e.g., /app)",default:"/app"});f=yr(C)}}if(!ei(f))throw new d("Invalid mount path: "+f);await sw(i,p,f,{projectName:m,description:g,directory:e.directory,skipMountPathCheck:a||e.skipMountPathCheck,autoPublish:e.autoPublish,telemetry:c,appId:u})}catch(t){throw new d(t,{prefix:"Error during deployment setup:"})}}var ri=null;process.once("exit",()=>ri?.());var aw=(e,t,r)=>t instanceof Or?"no-sites":t instanceof nr?"no-workspaces":e==="auth"?"auth":e==="workspaces"&&r===ae.New?"no-workspaces":"unknown",qn=async()=>{try{let e=$c(),t=Pc();return[...new Set([...e,...t])]}catch(e){return l.error(e,{prefix:"Failed to get available scaffolds:"}),[]}},BF=async(e,t,r)=>{let n;if("content"in r)n=r.content.files;else{let c=r[t];if(!c)throw new Error(`Scaffold "${t}" not found`);n=c}let o=n.find(c=>c.includes(jr));if(!o)throw new Error(`No ${jr} found in scaffold "${t}"`);await zs.promises.mkdir(e,{recursive:!0});let s=(await zs.promises.readFile(o,"utf8")).replace(Ss,e),a=sn.join(e,jr);await zs.promises.writeFile(a,s,"utf8")},Gs=async(e,t,r=ks,n,o=ae.Existing,i)=>{if(o===ae.New){try{let s=await Lc(r);await MF(e,t,s.scaffoldId,{content:s},r,i)}catch(s){if(s instanceof Te){let a=s.message;throw s.supportedIds?.length&&(a+=`
|
|
170
|
+
Available frameworks: ${s.supportedIds.join(", ")}`),new d(a)}throw s}return}try{let s=await Ts(r);await WF(e,t,r,{content:s},n)}catch(s){if(s instanceof Te){let a=s.message;throw s.supportedIds?.length&&(a+=`
|
|
171
|
+
Available frameworks: ${s.supportedIds.join(", ")}`),new d(a)}throw s}},MF=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,c=a?sn.dirname(a.extractionRoot):null,u="auth",p=!1,f=!1,m=null;try{let g=Date.now(),w=await E();u="workspaces";let I;if(i)I={id:i};else{let Z=await Hs(w);if(Z.length===0)throw new nr("No workspaces found in your account. Please make sure you have at least one workspace.");I=await Js(Z)}u="scaffold",await Bo(e,t,r,n,void 0,void 0),f=!0,process.chdir(s);let C=o??r;pe({cloud:{framework:C,workspace_id:I.id}}),Lt({apiToken:w,directory:"."}),process.env.WEBFLOW_API_TOKEN=w;let q=Date.now()-g;try{await b.forCloud({authToken:w}).sendUsage("project_init",{scaffold:C,scaffoldName:C,initMode:ae.New,workspaceId:I.id,totalDuration:q,mountPath:t,namespace:Kn()})}catch{}p=!0}catch(g){if(m=g,g instanceof d||g instanceof Error&&g.message.includes("OAuth")){try{await Bo(e,t,r,n),process.chdir(s),pe({cloud:{framework:o??r}}),Lt({directory:"."}),f=!0}catch{}throw l.error(g),new d(g,{skipLogging:!0})}throw g}finally{if(c)try{du.default.removeSync(c)}catch{}if(p){let g=cw(e,ae.New);ri=()=>l.info(g)}else{let g=aw(u,m,ae.New),w=uw(e,ae.New,g,f);ri=()=>l.info(w)}}},WF=async(e,t,r,n,o)=>{let i=`./${e}`,s=null,a=!1,c="content"in n&&typeof n.content=="object"&&"extractionRoot"in n.content?n.content:null,u=c?sn.dirname(c.extractionRoot):null,p="auth",f=!1,m=!1,g=null;try{let w=Date.now();await BF(e,r,n),process.chdir(i);let{manifest:I}=J(),C=await Ee(I,{site:o}),q=C.accessToken,Z=C.siteId;if(s=b.forCloud({authToken:q,siteId:Z}),p="scaffold",await Bo(".",t,r,n,Z,q),m=!0,p="devlink",Z){l.info(`${Oe} Running devlink export to fetch your Webflow components`);try{await UF({site:Z,apiToken:q}),a=!0}catch(oe){$r(oe)?l.info(`${Oe} Skipped component export \u2014 requires a paid Site or Workspace plan. Upgrade at https://webflow.com/pricing.`):l.error(oe,{prefix:"Failed to run devlink export:"})}}let S=Date.now()-w;await s?.sendUsage("project_init",{scaffold:r,scaffoldName:r,devlinkSyncStatus:a,totalDuration:S,mountPath:t,namespace:Kn()}),f=!0}catch(w){g=w,l.error(w);try{await Bo(".",t,r,n),m=!0}catch{}throw new d(w,{skipLogging:!0})}finally{if(u)try{du.default.removeSync(u)}catch{}if(f){let w=cw(e,ae.Existing);ri=()=>l.info(w)}else{let w=aw(p,g,ae.Existing),I=uw(e,ae.Existing,w,m);ri=()=>l.info(I)}}},UF=async e=>{let{exportComponents:t}=await Promise.resolve().then(()=>(rs(),mm));await t({site:e.site,apiToken:e.apiToken,silentNotEntitled:!0})},VF=e=>{if(e?.skipMountPathCheck!==void 0)return e.skipMountPathCheck;try{let{manifest:t}=J();return Oc(t)?!0:t.cloud?.skipMountPathCheck===!0}catch{return!1}},HF=async(e,t,r,n)=>{l.info(fe("Validating mount path configuration..."));let o=await zh(e,t,r);if(o.isValid)l.info(P("Mount path validation passed"));else if(l.info(T(`
|
|
172
|
+
Mount path validation results:`)),o.domains.forEach(i=>{let s=i.isValid?O:ge,a=i.isValid?P(`${i.domain} (mountPath: ${i.mountPaths[0]})`):ne(`${i.domain} (no matching mountPath)`);l.info(`${s} ${a}`),i.error&&l.debug(` Error: ${i.error}`)}),o.needsPublishing)if(n){l.info("\u{1F680} Auto-publishing site to update mount path configuration...");let i=o.domains.filter(s=>!s.isValid).map(s=>s.domain);await iu(e,i)}else if(await Yh()&&yt()){let s=o.domains.filter(c=>!c.isValid).map(c=>c.domain),a=await Zh(s);await iu(e,a)}else l.warn("\u26A0\uFE0F Continuing with deployment without publishing...")},JF=async(e,t,r,n)=>{Zc("\u{1F3D7}\uFE0F ","Building app");let o=await Oh(e,{mountPath:r,telemetry:n?.telemetry,deployUrl:t.deploy_url,environmentId:t.environment_id});Zc("\u{1F4E4}","Uploading build artifacts");let i=Date.now();await Vh(o,t.upload_url);let s=Date.now()-i;return l.info(`${O} Upload completed in ${(s/1e3).toFixed(1)}s`),o},GF=async(e,t,r,n)=>{l.success(`
|
|
173
|
+
\u{1F310} Your cloud app will soon be available at:`);try{let o=n?.domainsOverride??await Kh(e,t,r),i=qh(o??[],t);i?.length>0?i.forEach(s=>{l.info(` ${s}`)}):l.warn(" No domains found with the correct mount path configuration yet.")}catch(o){l.warn(` Could not determine deployment links: ${o instanceof Error?o.message:o}`)}},zF=e=>{e.site_slug?l.success(`Visit your deployment:
|
|
174
|
+
|
|
175
|
+
${fn}/dashboard/sites/${e.site_slug}/webflow-cloud/projects/${e.project_id}/environments/${e.environment_id}/deployments/${e.deployment_id}`):l.info(`
|
|
176
|
+
Visit the webflow Cloud dashboard to view your deployment: https://webflow.com/dashboard/sites`)},KF=async(e,t,r,n,o)=>{try{if(await Hh(t.completion_url,!!n),n)l.error(`
|
|
177
177
|
${D} Deployment failed due to build error.`);else{l.success(`
|
|
178
|
-
${
|
|
179
|
-
`)},
|
|
178
|
+
${O} Deployment triggered successfully!`);let i;try{let{manifest:s}=J();Oc(s)&&(i=[`${o?.projectName??sn.basename(process.cwd())}.webflow.io`])}catch(s){l.debug(`Could not read manifest for standalone deploy link hint: ${s instanceof Error?s.message:String(s)}`)}await GF(e,r,t.environment_id,i!==void 0?{domainsOverride:i}:void 0),zF(t)}}catch(i){throw new d(i,{prefix:"Failed to trigger deployment:"})}},qF=(e,t)=>{e&&$h(process.cwd(),e),t&&Rh(t)},sw=async(e,t,r,n)=>{let o=null,i=null,s=Date.now(),a=null,c=null,u=Yc(process.cwd()),p=n?.telemetry;await p?.sendUsage("cloud_deploy_start",{environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,cloudflareBindings:u,namespace:Kn()});try{xh(l,process.cwd()),o=await Mh(e,t,r,n),l.info("\u{1F527} Detecting framework..."),a=await Ih(process.cwd(),o.deploy_url,o.environment_id,r),l.info(`Framework: ${a.info.displayName}`),l.info(`Build command: ${a.getBuildCommand()}`),VF(n)?l.info("\u23ED\uFE0F Skipping mount path validation..."):await HF(e,r,o.environment_id,n?.autoPublish),i=await JF(a,o,r,n),l.info(`Starting deployment process for environment: ${t} at mount path: ${r}`);let f=Date.now()-s;await p?.sendUsage("cloud_deploy_success",{duration:f,environment:t,mountPath:r,projectName:n?.projectName,hasDescription:!!n?.description,hasDirectory:!!n?.directory,framework:a.info.name,buildCommand:a.getBuildCommand(),cloudflareBindings:u,namespace:Kn()})}catch(f){c=f instanceof Error?f:new Error(String(f)),l.error(c,{prefix:"Error during deployment initialization:"});let m=Date.now()-s;await p?.sendError(c,"cloud_deploy_failure",{duration:m,environment:t,mountPath:r,projectName:n?.projectName,cloudflareBindings:u,argv:process.argv.slice(2),namespace:Kn()})}finally{if(qF(a,i),o&&await KF(e,o,r,c,{projectName:n?.projectName}),c)throw new d(c,{skipLogging:!0})}},lw=e=>{let t=Math.max(...e.map(i=>it(i).length)),r=T(`\u250C${"\u2500".repeat(t+2)}\u2510`),n=T(`\u2514${"\u2500".repeat(t+2)}\u2518`),o=e.map(i=>{let s=" ".repeat(t-it(i).length);return`${T("\u2502")} ${i}${s} ${T("\u2502")}`});return[r,...o,n].join(`
|
|
179
|
+
`)},cw=(e,t)=>{let r=[Ze(`${Pe} Get started with the following commands:`),P(`cd ${e}`),P("npm install"),P("npm run dev"),P("webflow cloud deploy")];return t!==ae.New&&(r.push(""),r.push(Ze(`${Pe} Run the following command to export Webflow components when they update:`)),r.push(P("webflow devlink export"))),lw(r)},uw=(e,t,r,n=!0)=>{let o=[],i=t===ae.New?"webflow cloud init --new":"webflow cloud init",s=c=>n?`App scaffold created at ${e}/ but ${c}`:c.charAt(0).toUpperCase()+c.slice(1),a=n?[P(`cd ${e}`)]:[];switch(r){case"auth":o.push(Ze(`${Pe} ${s("Webflow authentication did not complete.")}`),"",Ze(n?"To finish setup:":"To retry:"),...a,P("webflow auth login"),P(i));break;case"no-sites":o.push(Ze(`${Pe} ${s("no Webflow sites were found in your account.")}`),"",Ze(n?"Create a site in the Webflow Designer, then:":"Create a site in the Webflow Designer, then rerun:"),...a,P("webflow cloud init"));break;case"no-workspaces":o.push(Ze(`${Pe} ${s("no Webflow workspaces were found in your account.")}`),"",Ze(n?"Create a workspace, then:":"Create a workspace, then rerun:"),...a,P("webflow cloud init --new"));break;default:o.push(Ze(`${Pe} ${s("setup did not complete.")}`),"",Ze(n?"To retry setup:":"To retry:"),...a,P(i));break}return lw(o)};$();Ar();var an=require("commander");ie();v();$();Ar();function dw(e,t,r){st()&&e==="cloud"&&(r.json||l.warn(`${ge} ${ne(`webflow cloud ${t}`)} is deprecated \u2014 use ${ne(`webflow apps ${t}`)} instead.`))}function Ks(e,{namespace:t}){e.command("init").description("Bootstrap a new Webflow Cloud app").addOption(new an.Option("-n, --app-name <name>","App name")).addOption(new an.Option("--project-name <name>",`${_r} Use --app-name instead.`)).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(r,n)=>{su(t),dw(t,"init",r),await ZF(r,n)})}function qs(e,{namespace:t}){e.command("deploy").description("Deploy your Webflow Cloud app").option("-e, --environment <environment>","Environment name").option("-m, --mount <mount>","Mount path (e.g., /app)").addOption(new an.Option("-n, --app-name <name>","App name (for new apps)")).addOption(new an.Option("--project-name <name>",`${_r} Use --app-name instead.`)).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)").addOption(new an.Option("-a, --app-id <appId>","App ID (skips app picker)")).addOption(new an.Option("--project-id <appId>",`${_r} Use --app-id instead.`)).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(r,n)=>{su(t),dw(t,"deploy",r),await YF(r,n)})}var ZF=cu,YF=uu;var pw=e=>{let t=st(),r=e.command("cloud").description(t?`${_r} Use 'webflow apps' instead. Create and manage Webflow Cloud apps`:"Create and manage Webflow Cloud apps");r.command("create").description(`${_r} Use 'webflow ${t?"apps":"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(au),r.command("list").description("Get list of app templates that can be used for `init`").action(lu),Ks(r,{namespace:"cloud"}),qs(r,{namespace:"cloud"})};U();x();v();$();W();se();x();ot();var XF="1.0.0";function Ke(e){return{Authorization:`Bearer ${e}`,Accept:"application/json","Accept-Version":XF}}async function Ot(e){let t={};try{t=JSON.parse(await e.text())}catch{}return e.status===403&&t.publicErrorCode==="missing_scopes"?new d(`Missing required scopes for apps.
|
|
180
180
|
${t.msg??""}
|
|
181
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`,{isUserError:!0}):new
|
|
182
|
-
${t.msg}`:""))}async function
|
|
181
|
+
Re-run 'webflow auth login' to grant the necessary permissions.`,{isUserError:!0}):new d(`${e.status} ${e.statusText}`+(t.msg?`
|
|
182
|
+
${t.msg}`:""))}async function Zs(e){let t=await j(`${F}/cosmic/apps`,{headers:Ke(e)});if(!t.ok)throw await Ot(t);return(await t.json()).apps??[]}async function Ys(e,t){_e(t,"appId");let r=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}`,{headers:Ke(e)});if(!r.ok)throw await Ot(r);return await r.json()}async function fw(e,t,r){_e(t,"appId");let n=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}`,{method:"PATCH",headers:{...Ke(e),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!n.ok)throw await Ot(n);return await n.json()}async function mw(e,t){_e(t,"appId");let r=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}`,{method:"DELETE",headers:Ke(e)});if(!r.ok)throw await Ot(r);return await r.json()}async function gw(e,t,r={}){_e(t,"appId");let n=[];r.limit!==void 0&&Number.isFinite(r.limit)&&n.push(`limit=${encodeURIComponent(String(r.limit))}`),r.cursor&&n.push(`cursor=${encodeURIComponent(r.cursor)}`);let o=`${F}/cosmic/apps/${encodeURIComponent(t)}/domains${n.length>0?`?${n.join("&")}`:""}`,i=await j(o,{headers:Ke(e)});if(!i.ok)throw await Ot(i);let s=await i.json();return{customDomains:s.customDomains??[],nextCursor:s.nextCursor??null}}async function Xs(e,t){_e(t,"appId");let r=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}/environments`,{headers:Ke(e)});if(!r.ok)throw await Ot(r);return await r.json()}function hw(e={}){let t=[];return e.limit!==void 0&&Number.isFinite(e.limit)&&t.push(`limit=${encodeURIComponent(String(e.limit))}`),e.cursor!==void 0&&t.push(`cursor=${encodeURIComponent(e.cursor)}`),e.since!==void 0&&t.push(`since=${encodeURIComponent(e.since)}`),e.q!==void 0&&t.push(`q=${encodeURIComponent(e.q)}`),t.length>0?`?${t.join("&")}`:""}async function ww(e,t,r,n,o={}){_e(t,"appId"),_e(r,"environmentId"),Xo(n,"deploymentId");let i=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}/environments/${encodeURIComponent(r)}/deployments/${encodeURIComponent(n)}/buildLogs${hw(o)}`,{headers:Ke(e)});if(!i.ok)throw await Ot(i);return await i.json()}async function yw(e,t,r,n={}){_e(t,"appId"),_e(r,"environmentId");let o=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}/environments/${encodeURIComponent(r)}/logs${hw(n)}`,{headers:Ke(e)});if(!o.ok)throw await Ot(o);return await o.json()}async function Qs(e,t,r,n={}){_e(t,"appId"),_e(r,"environmentId");let o=n.limit!==void 0&&Number.isFinite(n.limit)?`?limit=${encodeURIComponent(String(n.limit))}`:"",i=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}/environments/${encodeURIComponent(r)}/deployments${o}`,{headers:Ke(e)});if(!i.ok)throw await Ot(i);let s=await i.json();return Array.isArray(s)?s:s?.deployments??[]}async function Dw(e,t,r,n){_e(t,"appId"),_e(r,"environmentId"),Xo(n,"deploymentId");let o=await j(`${F}/cosmic/apps/${encodeURIComponent(t)}/environments/${encodeURIComponent(r)}/deployments/${encodeURIComponent(n)}`,{headers:Ke(e)});if(!o.ok)throw await Ot(o);return await o.json()}ie();x();v();function qe(e){let t=Object.fromEntries(e.map(r=>[r.toLowerCase(),r]));return r=>{let n=[],o=[];for(let i of r){let s=t[i.toLowerCase()];s?n.push(s):o.push(i)}return{valid:n,invalid:o}}}function ce(e,t,r){let n=e.split(",").map(s=>s.trim()),{valid:o,invalid:i}=t(n);if(o.length===0)throw new d(`No valid fields specified. Available: ${r.join(", ")}`,{isUserError:!0});return i.length>0&&l.warn(`Unknown field(s): ${i.join(", ")}. Available: ${r.join(", ")}`),o}v();var bw=(e,t)=>e+" ".repeat(Math.max(0,t-it(e).length));function $e(e,t){let r=e.map((s,a)=>Math.max(it(s).length,...t.map(c=>it(String(c[a])).length))),n=r.map(s=>"\u2500".repeat(s+2)).join("\u2500"),o=e.map((s,a)=>bw(s,r[a]+2)).join(""),i=t.map(s=>s.map((a,c)=>bw(String(a),r[c]+2)).join("")).join(`
|
|
183
183
|
`);return`${o}
|
|
184
184
|
${n}
|
|
185
|
-
${i}`}var
|
|
185
|
+
${i}`}var vw=["id","name","description","siteId","appPath","createdAt","siteName","shortName"],Ew=["id","url","lastPublished","fullSiteCompiledAt"],Fw=["id","branch","mount","deployUrl","latestDeploymentStatus","lastDeploymentSucceededAt","lastVariableModifiedAt","createdAt","updatedAt"],ea="id,name,siteId,createdAt",pu="id,name,description,siteId,appPath,createdAt",ta="id,url,lastPublished",ra="id,branch,deployUrl,latestDeploymentStatus,createdAt",QF=new Set(["createdAt","updatedAt","lastPublished","fullSiteCompiledAt","lastDeploymentSucceededAt","lastVariableModifiedAt","buildStartedAt","buildFinishedAt","deployFinishedAt","buildRunningAt","deployStartedAt","buildFailedAt","deployFailedAt"]);function ex(e,t){return e==null||e===""?T("\u2014"):QF.has(t)?new Date(String(e)).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):String(e).replace(/\s*[\r\n]+\s*/g," ")}function ni(e,t,r){if(e.length===0)return T(r);let n=t.map(i=>Q(i)),o=e.map(i=>t.map(s=>ex(i[s],s)));return $e(n,o)}var na=qe(vw),xw=qe(Ew),_w=qe(Fw);function Dr(){return vw}function oi(){return Ew}function ii(){return Fw}function oa(e,t=ea.split(",")){return ni(e,t,"No apps found.")}function Cw(e,t=ta.split(",")){return ni(e,t,"No domains found.")}function kw(e,t=ra.split(",")){return ni(e,t,"No environments found.")}function Sw(e){return e.siteName?`Permanently delete app "${e.name}" (attached to site "${e.siteName}", ${e.id}). This cannot be undone.`:`Archive standalone app "${e.name}" (${e.id}).`}async function fu(e){let t=await E(),r=b.forApps({authToken:t}),n=Date.now();try{let o=await Zs(t);if(await r.sendUsage("apps_list",{duration:Date.now()-n,count:o.length}),e.json){l.info(JSON.stringify(o,null,2));return}if(o.length===0){l.info("No apps found.");return}let i=ce(e.fields,na,Dr());l.info(oa(o,i))}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"apps_list",{duration:Date.now()-n}),new d(o,{prefix:`${D} Failed to list apps:`}))}}U();x();v();$();W();ve();x();be();Se();async function ia(e,t={}){let r=await Zs(e);if(r.length===0)throw new d("No apps found in this workspace.",{isUserError:!0});if(r.length===1)return r[0].id;if(H()||t.json){let o=r.map(i=>` ${i.id} (${i.name})`).join(`
|
|
186
|
+
`);throw new d(`This workspace has multiple apps. Pass the app id to choose one:
|
|
187
|
+
${o}`,{isUserError:!0,missingFlag:"appId"})}let n=await Ce({message:"Select an app:",choices:r.map(o=>({name:`${o.name} (${o.id})`,value:o.id}))});if(!n)throw new d("No app selected.",{isUserError:!0});return n}async function Rt(e,t,r){let{manifest:n}=J();return tt("appId",{flagValue:t,manifest:n,isNoInput:!1,json:r.json,prompt:()=>ia(e,{json:r.json})})}async function mu(e,t){let r=await E(),n=await Rt(r,e,t),o=b.forApps({authToken:r}),i=Date.now();try{let s=await Ys(r,n);if(await o.sendUsage("apps_get",{duration:Date.now()-i}),t.json){l.info(JSON.stringify(s,null,2));return}let a=ce(t.fields,na,Dr());l.info(oa([s],a))}catch(s){throw s instanceof d&&s.isUserError?s:(await o.sendError(s instanceof Error?s:new Error(String(s)),"apps_get",{duration:Date.now()-i}),new d(s,{prefix:`${D} Failed to get app:`}))}}U();x();v();$();W();async function gu(e,t){let r=await E(),n=await Rt(r,e,t),o=b.forApps({authToken:r}),i=Date.now();try{let s=await gw(r,n,{limit:t.limit,cursor:t.cursor});if(await o.sendUsage("apps_domains",{duration:Date.now()-i,count:s.customDomains.length}),t.json){l.info(JSON.stringify(s,null,2));return}if(s.customDomains.length===0){l.info("No domains found.");return}let a=ce(t.fields,xw,oi()),c=Cw(s.customDomains,a);s.nextCursor&&(c+=`
|
|
188
|
+
|
|
189
|
+
More: pass --cursor ${s.nextCursor}`),l.info(c)}catch(s){throw s instanceof d&&s.isUserError?s:(await o.sendError(s instanceof Error?s:new Error(String(s)),"apps_domains",{duration:Date.now()-i}),new d(s,{prefix:`${D} Failed to get app domains:`}))}}U();x();v();$();W();async function hu(e,t){let r=await E(),n=await Rt(r,e,t),o=t.json?void 0:ce(t.fields,_w,ii()),i=b.forApps({authToken:r}),s=Date.now();try{let a=await Xs(r,n);if(await i.sendUsage("apps_environments_list",{duration:Date.now()-s,count:a.length}),t.json){l.info(JSON.stringify(a,null,2));return}if(a.length===0){l.info("No environments found.");return}l.info(kw(a,o))}catch(a){throw a instanceof d&&a.isUserError?a:(await i.sendError(a instanceof Error?a:new Error(String(a)),"apps_environments_list",{duration:Date.now()-s}),new d(a,{prefix:`${D} Failed to list app environments:`}))}}U();x();v();$();W();ie();var wu=["timestamp","message","phase"],si="timestamp,message",sa=qe(wu);function br(){return wu}function tx(e,t){return e==null||e===""?T("\u2014"):t==="timestamp"?new Date(String(e)).toLocaleString():String(e)}function rx(e,t=si.split(",")){return e.map(r=>t.map(n=>tx(r[n],n)).join(" ")).join(`
|
|
190
|
+
`)}function aa(e,t,r){if(t.json)return JSON.stringify({logs:e.logs,nextCursor:e.nextCursor},null,2);if(e.logs.length===0)return"No logs found.";let n=rx(e.logs,r);return e.nextCursor?`${n}
|
|
191
|
+
|
|
192
|
+
More: pass --cursor ${e.nextCursor}`:n}function Aw(e){return e[0]?.id}ve();x();be();Se();async function Tw(e,t,r={}){let n=await Xs(e,t);if(n.length===0)throw new d("No environments found for this app.",{isUserError:!0});if(n.length===1)return n[0].id;if(H()||r.json){let i=n.map(s=>` ${s.id} (${s.branch})`).join(`
|
|
193
|
+
`);throw new d(`This app has multiple environments. Pass the environment id to choose one:
|
|
194
|
+
${i}`,{isUserError:!0,missingFlag:"environmentId"})}let o=await Ce({message:"Select an environment:",choices:n.map(i=>({name:`${i.branch} (${i.id})`,value:i.id}))});if(!o)throw new d("No environment selected.",{isUserError:!0});return o}async function Me(e,t){let{manifest:r}=J(),n=await tt("appId",{flagValue:t.appId,manifest:r,isNoInput:!1,json:t.json,prompt:()=>ia(e,{json:t.json})}),o=await tt("environmentId",{flagValue:t.environmentId,manifest:r,isNoInput:!1,json:t.json,prompt:()=>Tw(e,n,{json:t.json})});return{appId:n,envId:o}}async function yu(e,t){let r=await E(),{appId:n,envId:o}=await Me(r,{json:t.json}),i=t.json?void 0:ce(t.fields,sa,br()),s=b.forApps({authToken:r}),a=Date.now();try{let c=e;if(!c){let p=await Qs(r,n,o,{limit:1});if(c=Aw(p),!c)throw new d("No deployments found for this environment.",{isUserError:!0})}let u=await ww(r,n,o,c,{limit:t.limit,cursor:t.cursor,since:t.since,q:t.q});await s.sendUsage("apps_logs_build",{duration:Date.now()-a,count:u.logs.length}),l.info(aa(u,t,i))}catch(c){throw c instanceof d&&c.isUserError?c:(await s.sendError(c instanceof Error?c:new Error(String(c)),"apps_logs_build",{duration:Date.now()-a}),new d(c,{prefix:`${D} Failed to read build logs:`}))}}U();x();v();$();W();async function Du(e,t){let r=await E(),{appId:n,envId:o}=await Me(r,{environmentId:e,json:t.json}),i=t.json?void 0:ce(t.fields,sa,br()),s=b.forApps({authToken:r}),a=Date.now();try{let c=await yw(r,n,o,{limit:t.limit,cursor:t.cursor,since:t.since,q:t.q});await s.sendUsage("apps_logs_runtime",{duration:Date.now()-a,count:c.logs.length}),l.info(aa(c,t,i))}catch(c){throw c instanceof d&&c.isUserError?c:(await s.sendError(c instanceof Error?c:new Error(String(c)),"apps_logs_runtime",{duration:Date.now()-a}),new d(c,{prefix:`${D} Failed to read runtime logs:`}))}}U();x();v();$();W();var Iw=["id","status","sourceType","commitHash","commitMessage","buildStartedAt","buildFinishedAt","deployFinishedAt","framework"],ai="id,status,sourceType,commitHash,buildStartedAt",la=qe(Iw);function vr(){return Iw}function ca(e,t=ai.split(",")){return ni(e,t,"No deployments found.")}async function bu(e){let t=await E(),{appId:r,envId:n}=await Me(t,{json:e.json}),o=e.json?void 0:ce(e.fields,la,vr()),i=b.forApps({authToken:t}),s=Date.now();try{let a=await Qs(t,r,n,{limit:e.limit});if(await i.sendUsage("apps_deployments_list",{duration:Date.now()-s,count:a.length}),e.json){l.info(JSON.stringify(a,null,2));return}if(a.length===0){l.info("No deployments found.");return}l.info(ca(a,o))}catch(a){throw a instanceof d&&a.isUserError?a:(await i.sendError(a instanceof Error?a:new Error(String(a)),"apps_deployments_list",{duration:Date.now()-s}),new d(a,{prefix:`${D} Failed to list deployments:`}))}}U();x();v();$();W();async function vu(e,t){let r=await E(),{appId:n,envId:o}=await Me(r,{json:t.json}),i=t.json?void 0:ce(t.fields,la,vr()),s=b.forApps({authToken:r}),a=Date.now();try{let c=await Dw(r,n,o,e);if(await s.sendUsage("apps_deployments_get",{duration:Date.now()-a}),t.json){l.info(JSON.stringify(c,null,2));return}l.info(ca([c],i))}catch(c){throw c instanceof d&&c.isUserError?c:(await s.sendError(c instanceof Error?c:new Error(String(c)),"apps_deployments_get",{duration:Date.now()-a}),new d(c,{prefix:`${D} Failed to get deployment:`}))}}U();x();v();$();W();async function Eu(e,t){if(t.name===void 0&&t.description===void 0)throw new d("Provide --name or --description",{isUserError:!0});let r=await E(),n=await Rt(r,e,t);if(_e(n,"appId"),t.dryRun){l.info(`Dry run \u2014 would update app: ${n}`),t.name!==void 0&&l.info(` Name: ${t.name}`),t.description!==void 0&&l.info(` Description: ${t.description}`),l.info("Dry run complete \u2014 no changes made.");return}let o=b.forApps({authToken:r}),i=Date.now();try{let s=await fw(r,n,{name:t.name,description:t.description});if(await o.sendUsage("apps_update",{duration:Date.now()-i,dryRun:!1}),t.json){l.info(JSON.stringify(s,null,2));return}l.info(`${O} App updated: ${s.id}`),s.name&&l.info(` Name: ${s.name}`),s.description!=null&&l.info(` Description: ${s.description}`)}catch(s){throw s instanceof d&&s.isUserError?s:(await o.sendError(s instanceof Error?s:new Error(String(s)),"apps_update",{duration:Date.now()-i}),new d(s,{prefix:`${D} Failed to update app:`}))}}U();x();be();Se();v();$();W();async function Fu(e,t){let r=await E(),n=await Rt(r,e,t);if(_e(n,"appId"),!t.dryRun&&!t.yes&&(H()||t.json))throw new d("Refusing to delete without confirmation. Pass --yes.",{isUserError:!0,missingFlag:"yes"});if(t.dryRun||!t.yes){let s=await Ys(r,n),a=Sw(s);if(t.dryRun){l.info(`Dry run \u2014 would delete app ${n}`),l.info(` ${a}`),l.info("Dry run complete \u2014 no changes made.");return}if(!await Ne({message:`${a} Continue?`})){l.info("Aborted.");return}}let o=b.forApps({authToken:r}),i=Date.now();try{let s=await mw(r,n);if(await o.sendUsage("apps_delete",{duration:Date.now()-i,dryRun:!1}),t.json){l.info(JSON.stringify(s,null,2));return}l.info(s.message)}catch(s){throw s instanceof d&&s.isUserError?s:(await o.sendError(s instanceof Error?s:new Error(String(s)),"apps_delete",{duration:Date.now()-i}),new d(s,{prefix:`${D} Failed to delete app:`}))}}U();x();v();$();W();se();x();ot();var Zn=100;function xu(e,t){return`${F}/cosmic/apps/${encodeURIComponent(e)}/environments/${encodeURIComponent(t)}/variables`}async function _u(e,t){let r={};try{r=JSON.parse(await e.text())}catch{}let n=r.msg??r.message;return e.status===403&&r.publicErrorCode==="missing_scopes"?new d(`Missing required scopes for Cloud app environment variables.
|
|
186
195
|
${n??""}
|
|
187
|
-
Re-run 'webflow auth login' to grant the necessary permissions.`,{isUserError:!0}):new
|
|
188
|
-
${n}`:""),{isUserError:e.status>=400&&e.status<500})}async function
|
|
189
|
-
`);return(0,Yh.parse)(t)}ve();ye();S();ke();async function Qh(e,t){let r=await Us(e,t);if(r.length===0)throw new f("No environments found for this app.",{isUserError:!0});let n=await Ee({message:"Select an environment:",choices:r.map(o=>({name:`${o.branch} (${o.id})`,value:o.id}))});if(!n)throw new f("No environment selected.",{isUserError:!0});return n}async function hr(e,t){let{manifest:r}=V(),n=await Vn("appId",{flagValue:t.appId,manifest:r,isNoInput:G(),json:t.json,prompt:()=>qs(e)}),o=await Vn("environmentId",{flagValue:t.environmentId,manifest:r,isNoInput:G(),json:t.json,prompt:()=>Qh(e,n)});return{appId:n,envId:o}}async function uu(e){let t=await A(),r=C.forAppsEnvVars({authToken:t}),n=Date.now();try{let{appId:o,envId:i}=await hr(t,e),s=await iu(t,o,i);if(await r.sendUsage("apps_env_vars_list",{duration:Date.now()-n,variableCount:s.length}),e.json){l.info(JSON.stringify(s,null,2));return}if(s.length===0){l.info("No environment variables found.");return}let a=Ne(e.fields,au,Gn());l.info(lu(s,a))}catch(o){throw o instanceof f&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"apps_env_vars_list",{duration:Date.now()-n}),new f(o,{prefix:`${D} Failed to list environment variables:`}))}}K();S();b();$();q();S();ve();ke();b();$();async function ew(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}function du(e){l.warn(`${me} Passing a secret as a command-line argument exposes it in your shell history and process list. Pipe it via stdin (e.g. \`printf %s "$VALUE" | webflow apps env-vars set ${e} --secret\`) or omit the value to be prompted.`)}async function tw(e,t){if(e!==void 0)return t.secret&&!t.json&&du(t.key),{value:e,source:"arg"};if(!process.stdin.isTTY){let r=await ew();if(r==="")throw new f(`No value for ${t.key} received on stdin.`,{isUserError:!0});return{value:r,source:"stdin"}}if(!G()){let r=t.secret?await Ff({message:`Enter the value for ${t.key}:`}):await Fe({message:`Enter the value for ${t.key}:`});if(r===null||r==="")throw new f(`No value provided for ${t.key}.`,{isUserError:!0});return{value:r,source:"prompt"}}throw new f(`No value provided for ${t.key}. Pass it as an argument, pipe it via stdin, or run interactively (without --no-input).`,{isUserError:!0})}async function fu(e,t,r){let n=r.secret?" (secret)":"",o=await A(),i=C.forAppsEnvVars({authToken:o}),s=Date.now(),{appId:a,envId:c}=await hr(o,r);if(r.dryRun){t!==void 0&&r.secret&&!r.json&&du(e),r.json?l.info(JSON.stringify({key:e,...r.secret?{isSecret:!0}:{},appId:a,environmentId:c,dryRun:!0},null,2)):(l.info(`Would set ${e}${n} on app ${a}, environment ${c}.`),l.info("Dry run \u2014 no changes made."));return}try{let{value:u,source:d}=await tw(t,{key:e,secret:r.secret,json:r.json}),p={[e]:{value:u,...r.secret?{isSecret:!0}:{}}},m=await Qo(o,a,c,p,!0),g=[...m.created,...m.updated,...m.skipped].find(F=>F.key===e);if(!g){let F=m.errors.find(R=>R.key===e);throw new f(F?`Failed to set ${e}: ${F.error}`:`Set did not apply to ${e}.`,{isUserError:!!F})}let y=g.isSecret;if(await i.sendUsage("apps_env_vars_set",{duration:Date.now()-s,mode:r.secret?"secret":"plain",valueSource:d}),r.json){l.info(JSON.stringify({key:e,isSecret:y,status:"set"},null,2));return}l.info(`${I} Set ${e}${y?" (secret)":""}`)}catch(u){throw u instanceof f&&u.isUserError?u:(await i.sendError(u instanceof Error?u:new Error(String(u)),"apps_env_vars_set",{duration:Date.now()-s}),new f(u,{prefix:`${D} Failed to set environment variable:`}))}}K();S();b();$();q();async function pu(e,t){let r=await A(),n=C.forAppsEnvVars({authToken:r}),o=Date.now(),{appId:i,envId:s}=await hr(r,t);if(t.dryRun){t.json?l.info(JSON.stringify({key:e,appId:i,environmentId:s,dryRun:!0},null,2)):(l.info(`Would delete ${e} from app ${i}, environment ${s}.`),l.info("Dry run \u2014 no changes made."));return}try{if(await su(r,i,s,e),await n.sendUsage("apps_env_vars_delete",{duration:Date.now()-o}),t.json){l.info(JSON.stringify({key:e,status:"deleted"},null,2));return}l.info(`${I} Deleted ${e}`)}catch(a){throw a instanceof f&&a.isUserError?a:(await n.sendError(a instanceof Error?a:new Error(String(a)),"apps_env_vars_delete",{duration:Date.now()-o}),new f(a,{prefix:`${D} Failed to delete environment variable:`}))}}var rw=require("fs"),nw=require("path");K();S();b();$();q();function mu(e){return e.map(({id:t,environmentId:r,key:n,isSecret:o})=>({id:t,environmentId:r,key:n,isSecret:o}))}async function gu(e,t){let r=await A(),n=C.forAppsEnvVars({authToken:r}),o=Date.now(),{appId:i,envId:s}=await hr(r,t),a;try{a=(0,rw.readFileSync)((0,nw.resolve)(e),"utf8")}catch{throw new f(`Could not read file: ${e}`,{isUserError:!0})}let c=cu(a),u=Object.keys(c);if(u.length===0)throw new f(`No variables found in ${e}.`,{isUserError:!0});if(u.length>Jn)throw new f(`Cannot import more than ${Jn} variables at once (${e} has ${u.length}).`,{isUserError:!0});let d={};for(let p of u)d[p]={value:c[p],...t.secret?{isSecret:!0}:{}};if(t.dryRun){if(t.json)l.info(JSON.stringify({appId:i,environmentId:s,secret:!!t.secret,variables:u,dryRun:!0},null,2));else{l.info(`Would import ${u.length} variable(s)${t.secret?" as secrets":""} into app ${i}, environment ${s}:`);for(let p of u)l.info(` ${p}=********`);l.info("Dry run \u2014 no changes made.")}return}try{let p=await Qo(r,i,s,d,!0);if(await n.sendUsage("apps_env_vars_import",{duration:Date.now()-o,variableCount:u.length,createdCount:p.created.length,updatedCount:p.updated.length,skippedCount:p.skipped.length,errorCount:p.errors.length,mode:t.secret?"secret":"plain"}),t.json)l.info(JSON.stringify({created:mu(p.created),updated:mu(p.updated),skipped:mu(p.skipped),errors:p.errors},null,2));else{l.info(`${I} Imported: ${p.created.length} created, ${p.updated.length} updated, ${p.skipped.length} skipped, ${p.errors.length} failed`);for(let m of p.errors)l.warn(` ${m.key}: ${m.error}`)}if(p.errors.length>0)throw new f(`Import completed with ${p.errors.length} error(s).`,{isUserError:!0,skipLogging:!0})}catch(p){throw p instanceof f&&p.isUserError?p:(await n.sendError(p instanceof Error?p:new Error(String(p)),"apps_env_vars_import",{duration:Date.now()-o}),new f(p,{prefix:`${D} Failed to import environment variables:`}))}}var ow=e=>{let t=e.command("apps").description("Manage Webflow Cloud apps");Bs(t,{namespace:"apps"}),Ls(t,{namespace:"apps"}),t.command("list").description("List all apps in your Webflow workspace").addOption(re()).addOption(je([...gr()]).default(Vs)).action(Qc),t.command("get").description("Get details for a specific app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(re()).addOption(je([...gr()]).default(Yc)).action(eu),t.command("domains").description("List domains and live URLs for an app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(je([...Yo()]).default(Hs)).addOption(re()).action(tu),t.command("environments").description("Manage the environments of a Webflow Cloud app").command("list").description("List the environments of an app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(je([...Xo()]).default(Js)).addOption(re()).action(ru);let n=t.command("env-vars").description("Manage Webflow Cloud app environment variables");n.command("list").description("List environment variables for a Cloud app environment").addOption(Io()).addOption(Oo()).addOption(re()).addOption(je([...Gn()]).default(ei.join(","))).action(uu),n.command("set").description("Create or update an environment variable. Use --secret to encrypt the value. Use --dry-run to preview.").argument("<key>","Variable name").argument("[value]","Variable value. Omit to read from piped stdin or be prompted (recommended for secrets, keeps them out of shell history).").addOption(Io()).addOption(Oo()).addOption(mc()).addOption(Re()).addOption(re()).action(fu),n.command("delete").description("Delete an environment variable. Use --dry-run to preview before executing.").argument("<key>","Variable name").addOption(Io()).addOption(Oo()).addOption(Re()).addOption(re()).action(pu),n.command("import").description("Bulk import environment variables from a .env file. Use --secret to mark every key secret. Use --dry-run to preview.").argument("<file>","Path to a .env (KEY=value) file").addOption(Io()).addOption(Oo()).addOption(mc()).addOption(Re()).addOption(re()).action(gu)};se();S();Qe();S();function J(e,t){if(!/^[a-f0-9]{24}$/.test(e))throw new f(`Invalid ${t}: "${e}" is not a valid resource ID.`,{isUserError:!0})}async function St(e){try{let t=await e.json();return t.message??t.error??`${e.status} ${e.statusText}`}catch{return`${e.status} ${e.statusText}`}}async function iw(e,t){J(t,"siteId");let r=await W(`${_}/v2/sites/${t}/collections`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok){let o=await St(r);throw r.status>=400&&r.status<500?new f(o,{isUserError:!0}):new f(`Failed to list collections: ${o}`)}return(await r.json()).collections??[]}async function sw(e,t){J(t,"collectionId");let r=await W(`${_}/v2/collections/${t}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(r.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!r.ok)throw new f(`Failed to get collection: ${await St(r)}`);let n=await r.json();return{...n,fields:n.fields??[]}}async function aw(e,t,r){J(t,"siteId");let n={displayName:r.displayName,singularName:r.singularName};r.slug&&(n.slug=r.slug);let o=await W(`${_}/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 St(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create collection: ${i}`)}return await o.json()}async function lw(e,t,r){J(t,"collectionId");let n=await W(`${_}/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 St(n);throw n.status===404?new f(`Collection "${t}" not found`,{isUserError:!0}):n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to create field: ${o}`)}return await n.json()}async function hu(e,t,r={}){J(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 W(`${_}/v2/collections/${t}/items${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Collection "${t}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to list items: ${await St(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 cw(e,t,r,n){J(t,"collectionId"),J(r,"itemId");let o=n?`?cmsLocaleId=${encodeURIComponent(n)}`:"",i=await W(`${_}/v2/collections/${t}/items/${r}${o}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(i.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!i.ok)throw new f(`Failed to get item: ${await St(i)}`);return await i.json()}async function wu(e,t,r,n=!1){J(t,"collectionId");let o=await W(`${_}/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 St(o);throw o.status>=400&&o.status<500?new f(i,{isUserError:!0}):new f(`Failed to create item: ${i}`)}return await o.json()}async function yu(e,t,r,n){J(t,"collectionId"),J(r,"itemId");let o=await W(`${_}/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 f(`Item "${r}" not found`,{isUserError:!0});if(!o.ok)throw new f(`Failed to update item: ${await St(o)}`);return await o.json()}async function uw(e,t,r){J(t,"collectionId"),J(r,"itemId");let n=await W(`${_}/v2/collections/${t}/items/${r}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(n.status===404)throw new f(`Item "${r}" not found`,{isUserError:!0});if(!n.ok)throw new f(`Failed to delete item: ${await St(n)}`)}async function dw(e,t,r){J(t,"collectionId"),r.forEach(o=>J(o,"itemId"));let n=await W(`${_}/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 St(n);throw n.status>=400&&n.status<500?new f(o,{isUserError:!0}):new f(`Failed to publish items: ${o}`)}return await n.json()}ie();K();ye();async function Ks(e){if(e.site)return{token:await A(),siteId:e.site};let{manifest:t}=V(),r=await De(t);return{token:r.accessToken,siteId:r.siteId}}function fw(e,t=["id","displayName","slug"]){if(e.length===0)return T("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 At(`Invalid fields. Available: ${r.join(", ")}`);let i=o.map(a=>X(a)),s=e.map(a=>o.map(c=>{let u=a[c];return u?c==="lastUpdated"?new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):u:T("\u2014")}));return Te(i,s)}function pw(e){let t=[`${X("Collection:")} ${e.displayName}`,`${X("ID:")} ${e.id}`,`${X("Slug:")} ${e.slug}`,`${X("Singular:")} ${e.singularName}`,`${X("Updated:")} ${new Date(e.lastUpdated).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,"",X("Fields:")];if(e.fields.length===0)return t.push(T(" No fields defined.")),t.join(`
|
|
190
|
-
`);let r=["NAME","SLUG","TYPE","REQUIRED"].map(o=>
|
|
191
|
-
`)}function
|
|
192
|
-
Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof
|
|
193
|
-
Showing ${c}\u2013${u}${
|
|
194
|
-
`):"",s=n.map(c=>
|
|
195
|
-
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(
|
|
196
|
+
Re-run 'webflow auth login' to grant the necessary permissions.`,{isUserError:!0}):new d(`${t}: ${e.status} ${e.statusText}`+(n?`
|
|
197
|
+
${n}`:""),{isUserError:e.status>=400&&e.status<500})}async function Cu(e,t,r){let n=await j(xu(t,r),{headers:Ke(e)});if(!n.ok)throw await _u(n,"Failed to list environment variables");return(await n.json()).variables??[]}async function ku(e,t,r,n){let o=await j(`${xu(t,r)}/${encodeURIComponent(n)}`,{method:"DELETE",headers:Ke(e)});if(!o.ok)throw await _u(o,"Failed to delete environment variable")}async function li(e,t,r,n,o){let i=Object.keys(n).length;if(i>Zn)throw new d(`Cannot import more than ${Zn} variables at once (received ${i}).`,{isUserError:!0});let s=await j(`${xu(t,r)}/bulk`,{method:"POST",headers:{...Ke(e),"Content-Type":"application/json"},body:JSON.stringify({variables:n,overwriteExisting:o})});if(!s.ok)throw await _u(s,"Failed to import environment variables");return await s.json()}var Ow=require("dotenv");ie();var Rw=["key","isSecret","value","id","environmentId"],ci=["key","isSecret"];function Yn(){return Rw}var Su=qe(Rw);function nx(e,t){switch(t){case"value":return e.isSecret?T("(secret)"):e.value!==""?e.value:T("\u2014");case"isSecret":return e.isSecret?"yes":"no";default:return e[t]!==""?String(e[t]):T("\u2014")}}function Au(e,t=ci){if(e.length===0)return T("No environment variables found.");let r=t.map(o=>Q(o)),n=e.map(o=>t.map(i=>nx(o,i)));return $e(r,n)}function Tu(e){let t=e.split(/\r?\n/).map(r=>r.replace(/^\s*export\s+/,"")).join(`
|
|
198
|
+
`);return(0,Ow.parse)(t)}async function Iu(e){let t=await E(),r=b.forAppsEnvVars({authToken:t}),n=Date.now();try{let{appId:o,envId:i}=await Me(t,e),s=await Cu(t,o,i);if(await r.sendUsage("apps_env_vars_list",{duration:Date.now()-n,variableCount:s.length}),e.json){l.info(JSON.stringify(s,null,2));return}if(s.length===0){l.info("No environment variables found.");return}let a=ce(e.fields,Su,Yn());l.info(Au(s,a))}catch(o){throw o instanceof d&&o.isUserError?o:(await r.sendError(o instanceof Error?o:new Error(String(o)),"apps_env_vars_list",{duration:Date.now()-n}),new d(o,{prefix:`${D} Failed to list environment variables:`}))}}U();x();v();$();W();x();be();Se();v();$();async function $w(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf8").replace(/\r?\n$/,"")}function Ou(e){l.warn(`${ge} Passing a secret as a command-line argument exposes it in your shell history and process list. Pipe it via stdin (e.g. \`printf %s "$VALUE" | webflow apps env-vars set ${e} --secret\`) or omit the value to be prompted.`)}async function Pw(e,t){if(e!==void 0)return t.secret&&!t.json&&Ou(t.key),{value:e,source:"arg"};if(!process.stdin.isTTY){let r=await $w();if(r==="")throw new d(`No value for ${t.key} received on stdin.`,{isUserError:!0});return{value:r,source:"stdin"}}if(!H()){let r=t.secret?await Gp({message:`Enter the value for ${t.key}:`}):await ke({message:`Enter the value for ${t.key}:`});if(r===null||r==="")throw new d(`No value provided for ${t.key}.`,{isUserError:!0});return{value:r,source:"prompt"}}throw new d(`No value provided for ${t.key}. Pass it as an argument, pipe it via stdin, or run interactively (without --no-input).`,{isUserError:!0})}async function Ru(e,t,r){let n=r.secret?" (secret)":"",o=await E(),i=b.forAppsEnvVars({authToken:o}),s=Date.now(),{appId:a,envId:c}=await Me(o,r);if(r.dryRun){t!==void 0&&r.secret&&!r.json&&Ou(e),r.json?l.info(JSON.stringify({key:e,...r.secret?{isSecret:!0}:{},appId:a,environmentId:c,dryRun:!0},null,2)):(l.info(`Would set ${e}${n} on app ${a}, environment ${c}.`),l.info("Dry run \u2014 no changes made."));return}try{let{value:u,source:p}=await Pw(t,{key:e,secret:r.secret,json:r.json}),f={[e]:{value:u,...r.secret?{isSecret:!0}:{}}},m=await li(o,a,c,f,!0),g=[...m.created,...m.updated,...m.skipped].find(I=>I.key===e);if(!g){let I=m.errors.find(C=>C.key===e);throw new d(I?`Failed to set ${e}: ${I.error}`:`Set did not apply to ${e}.`,{isUserError:!!I})}let w=g.isSecret;if(await i.sendUsage("apps_env_vars_set",{duration:Date.now()-s,mode:r.secret?"secret":"plain",valueSource:p}),r.json){l.info(JSON.stringify({key:e,isSecret:w,status:"set"},null,2));return}l.info(`${O} Set ${e}${w?" (secret)":""}`)}catch(u){throw u instanceof d&&u.isUserError?u:(await i.sendError(u instanceof Error?u:new Error(String(u)),"apps_env_vars_set",{duration:Date.now()-s}),new d(u,{prefix:`${D} Failed to set environment variable:`}))}}U();x();v();$();W();async function $u(e,t){let r=await E(),n=b.forAppsEnvVars({authToken:r}),o=Date.now(),{appId:i,envId:s}=await Me(r,t);if(t.dryRun){t.json?l.info(JSON.stringify({key:e,appId:i,environmentId:s,dryRun:!0},null,2)):(l.info(`Would delete ${e} from app ${i}, environment ${s}.`),l.info("Dry run \u2014 no changes made."));return}try{if(await ku(r,i,s,e),await n.sendUsage("apps_env_vars_delete",{duration:Date.now()-o}),t.json){l.info(JSON.stringify({key:e,status:"deleted"},null,2));return}l.info(`${O} Deleted ${e}`)}catch(a){throw a instanceof d&&a.isUserError?a:(await n.sendError(a instanceof Error?a:new Error(String(a)),"apps_env_vars_delete",{duration:Date.now()-o}),new d(a,{prefix:`${D} Failed to delete environment variable:`}))}}var jw=require("fs"),Nw=require("path");U();x();v();$();W();function Pu(e){return e.map(({id:t,environmentId:r,key:n,isSecret:o})=>({id:t,environmentId:r,key:n,isSecret:o}))}async function ju(e,t){let r=await E(),n=b.forAppsEnvVars({authToken:r}),o=Date.now(),{appId:i,envId:s}=await Me(r,t),a;try{a=(0,jw.readFileSync)((0,Nw.resolve)(e),"utf8")}catch{throw new d(`Could not read file: ${e}`,{isUserError:!0})}let c=Tu(a),u=Object.keys(c);if(u.length===0)throw new d(`No variables found in ${e}.`,{isUserError:!0});if(u.length>Zn)throw new d(`Cannot import more than ${Zn} variables at once (${e} has ${u.length}).`,{isUserError:!0});let p={};for(let f of u)p[f]={value:c[f],...t.secret?{isSecret:!0}:{}};if(t.dryRun){if(t.json)l.info(JSON.stringify({appId:i,environmentId:s,secret:!!t.secret,variables:u,dryRun:!0},null,2));else{l.info(`Would import ${u.length} variable(s)${t.secret?" as secrets":""} into app ${i}, environment ${s}:`);for(let f of u)l.info(` ${f}=********`);l.info("Dry run \u2014 no changes made.")}return}try{let f=await li(r,i,s,p,!0);if(await n.sendUsage("apps_env_vars_import",{duration:Date.now()-o,variableCount:u.length,createdCount:f.created.length,updatedCount:f.updated.length,skippedCount:f.skipped.length,errorCount:f.errors.length,mode:t.secret?"secret":"plain"}),t.json)l.info(JSON.stringify({created:Pu(f.created),updated:Pu(f.updated),skipped:Pu(f.skipped),errors:f.errors},null,2));else{l.info(`${O} Imported: ${f.created.length} created, ${f.updated.length} updated, ${f.skipped.length} skipped, ${f.errors.length} failed`);for(let m of f.errors)l.warn(` ${m.key}: ${m.error}`)}if(f.errors.length>0)throw new d(`Import completed with ${f.errors.length} error(s).`,{isUserError:!0,skipLogging:!0})}catch(f){throw f instanceof d&&f.isUserError?f:(await n.sendError(f instanceof Error?f:new Error(String(f)),"apps_env_vars_import",{duration:Date.now()-o}),new d(f,{prefix:`${D} Failed to import environment variables:`}))}}Ar();var Lw=e=>{let t=e.command("apps").description("Manage Webflow Cloud apps");Ks(t,{namespace:"apps"}),qs(t,{namespace:"apps"}),t.command("list").description("List all apps in your Webflow workspace").addOption(Y()).addOption(xe([...Dr()]).default(ea)).action(fu),t.command("get").description("Get details for a specific app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(Y()).addOption(xe([...Dr()]).default(pu)).action(mu),t.command("domains").description("List domains and live URLs for an app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(xe([...oi()]).default(ta)).addOption(Y()).option("--limit <n>","Max number of domains to return (server caps at 100)",Cs).option("--cursor <cursor>","Pagination cursor from a previous nextCursor").action(gu),st()&&(t.command("update").description("Update an app's name or description. Use --dry-run to preview.").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").option("--name <name>","New app name").option("--description <description>","New app description").addOption(Y()).addOption(Ae()).action(Eu),t.command("delete").description("Delete (or archive) an app. Use --dry-run to preview.").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(Og()).addOption(Y()).addOption(Ae()).action(Fu)),t.command("environments").description("Manage the environments of a Webflow Cloud app").command("list").description("List the environments of an app").argument("[appId]","App ID (defaults to webflow.json or WEBFLOW_APP_ID)").addOption(xe([...ii()]).default(ra)).addOption(Y()).action(hu);let n=t.command("deployments").description("Inspect Webflow Cloud deployments");n.command("list").description("List the most recent deployments of an environment (newest first). Resolves the app + environment from WEBFLOW_APP_ID / WEBFLOW_APP_ENVIRONMENT_ID, webflow.json, or an interactive picker.").addOption(Rg()).addOption(Y()).addOption(xe([...vr()]).default(ai)).action(bu),n.command("get").description("Get details for a specific deployment. Resolves the app + environment from WEBFLOW_APP_ID / WEBFLOW_APP_ENVIRONMENT_ID, webflow.json, or an interactive picker.").argument("<depId>","Deployment ID").addOption(Y()).addOption(xe([...vr()]).default(ai)).action(vu);let o=t.command("logs").description("Read Webflow Cloud app logs");o.command("build").description("Read the build logs of a deployment. Resolves the app + environment from WEBFLOW_APP_ID / WEBFLOW_APP_ENVIRONMENT_ID, webflow.json, or an interactive picker.").argument("[depId]","Deployment ID (defaults to the latest deployment)").addOption(Y()).addOption(xe([...br()]).default(si)).option("--since <iso>","Only logs at or after this ISO datetime").option("--q <text>","Substring filter on the log message").addOption(Ac()).option("--cursor <cursor>","Pagination cursor from a previous nextCursor").action(yu),o.command("runtime").description("Read the runtime logs of an environment. Resolves the app from WEBFLOW_APP_ID / webflow.json (or a picker); the environment from the [envId] argument, WEBFLOW_APP_ENVIRONMENT_ID, webflow.json, or a picker.").argument("[envId]","Environment ID (defaults to the only env; required if the app has several)").addOption(Y()).addOption(xe([...br()]).default(si)).option("--since <iso>","Only logs at or after this ISO datetime").option("--q <text>","Substring filter on the log message").addOption(Ac()).option("--cursor <cursor>","Pagination cursor from a previous nextCursor").action(Du);let i=t.command("env-vars").description("Manage Webflow Cloud app environment variables");i.command("list").description("List environment variables for a Cloud app environment").addOption(jo()).addOption(No()).addOption(Y()).addOption(xe([...Yn()]).default(ci.join(","))).action(Iu),i.command("set").description("Create or update an environment variable. Use --secret to encrypt the value. Use --dry-run to preview.").argument("<key>","Variable name").argument("[value]","Variable value. Omit to read from piped stdin or be prompted (recommended for secrets, keeps them out of shell history).").addOption(jo()).addOption(No()).addOption(Sc()).addOption(Ae()).addOption(Y()).action(Ru),i.command("delete").description("Delete an environment variable. Use --dry-run to preview before executing.").argument("<key>","Variable name").addOption(jo()).addOption(No()).addOption(Ae()).addOption(Y()).action($u),i.command("import").description("Bulk import environment variables from a .env file. Use --secret to mark every key secret. Use --dry-run to preview.").argument("<file>","Path to a .env (KEY=value) file").addOption(jo()).addOption(No()).addOption(Sc()).addOption(Ae()).addOption(Y()).action(ju)};se();x();ot();x();function z(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 $t(e){try{let t=await e.json();return t.message??t.error??`${e.status} ${e.statusText}`}catch{return`${e.status} ${e.statusText}`}}async function Bw(e,t){z(t,"siteId");let r=await j(`${F}/v2/sites/${t}/collections`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!r.ok){let o=await $t(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 Mw(e,t){z(t,"collectionId");let r=await j(`${F}/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 $t(r)}`);let n=await r.json();return{...n,fields:n.fields??[]}}async function Ww(e,t,r){z(t,"siteId");let n={displayName:r.displayName,singularName:r.singularName};r.slug&&(n.slug=r.slug);let o=await j(`${F}/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 $t(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 Uw(e,t,r){z(t,"collectionId");let n=await j(`${F}/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 $t(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={}){z(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 j(`${F}/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 $t(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 Vw(e,t,r,n){z(t,"collectionId"),z(r,"itemId");let o=n?`?cmsLocaleId=${encodeURIComponent(n)}`:"",i=await j(`${F}/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 $t(i)}`);return await i.json()}async function Lu(e,t,r,n=!1){z(t,"collectionId");let o=await j(`${F}/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 $t(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 Bu(e,t,r,n){z(t,"collectionId"),z(r,"itemId");let o=await j(`${F}/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 $t(o)}`);return await o.json()}async function Hw(e,t,r){z(t,"collectionId"),z(r,"itemId");let n=await j(`${F}/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 $t(n)}`)}async function Jw(e,t,r){z(t,"collectionId"),r.forEach(o=>z(o,"itemId"));let n=await j(`${F}/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 $t(n);throw n.status>=400&&n.status<500?new d(o,{isUserError:!0}):new d(`Failed to publish items: ${o}`)}return await n.json()}ie();U();ve();async function ua(e){if(e.site)return{token:await E(),siteId:e.site};let{manifest:t}=J(),r=await Ee(t);return{token:r.accessToken,siteId:r.siteId}}function Gw(e,t=["id","displayName","slug"]){if(e.length===0)return T("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 Pt(`Invalid fields. Available: ${r.join(", ")}`);let i=o.map(a=>Q(a)),s=e.map(a=>o.map(c=>{let u=a[c];return u?c==="lastUpdated"?new Date(u).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):u:T("\u2014")}));return $e(i,s)}function zw(e){let t=[`${Q("Collection:")} ${e.displayName}`,`${Q("ID:")} ${e.id}`,`${Q("Slug:")} ${e.slug}`,`${Q("Singular:")} ${e.singularName}`,`${Q("Updated:")} ${new Date(e.lastUpdated).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}`,"",Q("Fields:")];if(e.fields.length===0)return t.push(T(" No fields defined.")),t.join(`
|
|
199
|
+
`);let r=["NAME","SLUG","TYPE","REQUIRED"].map(o=>Q(o)),n=e.fields.map(o=>[o.displayName,o.slug,o.type,o.isRequired?"yes":"no"]);return t.push($e(r,n)),t.join(`
|
|
200
|
+
`)}function Kw(e,t=["id","isDraft","lastUpdated"]){if(e.length===0)return T("No items found.");let r=t.map(o=>Q(o)),n=e.map(o=>t.map(i=>{if(i==="fieldData")return JSON.stringify(o.fieldData);if(i==="isDraft")return o.isDraft?ne("draft"):P("live");if(i==="isArchived")return o.isArchived?T("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"}):T("\u2014")}let s=o[i];return s==null?T("\u2014"):String(s)}));return $e(r,n)}x();v();$();function da(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})}W();async function Mu(e){let{token:t,siteId:r}=await ua(e),n=b.forCms({authToken:t,siteId:r}),o=Date.now();try{let i=await Bw(t,r);if(await n.sendUsage("cms_collections_list",{duration:Date.now()-o,count:i.length}),i.length===0){l.info("No collections found.");return}let s=["displayName","slug","lastUpdated"];if(s.includes(e.sortBy)||(l.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=da(i,e.sortBy,e.order);if(e.json){l.info(JSON.stringify(a,null,2));return}let c=e.fields.split(",").map(u=>u.trim());l.info(Gw(a,c))}catch(i){if(i instanceof d&&i.isUserError){l.info(`${D} ${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:`${D} Failed to list collections:`})}}U();x();v();$();W();async function Wu(e,t){let r=await E(),n=b.forCms({authToken:r}),o=Date.now();try{let i=await Mw(r,e);if(await n.sendUsage("cms_collections_get",{duration:Date.now()-o}),t.json){l.info(JSON.stringify(i,null,2));return}l.info(zw(i))}catch(i){if(i instanceof d&&i.isUserError){l.info(`${D} ${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:`${D} Failed to get collection:`})}}x();v();$();W();async function Uu(e){let t=e.singularName??e.name,r=e.slug??e.name.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"");if(e.dryRun){l.info("Dry run \u2014 would create collection:"),l.info(JSON.stringify({displayName:e.name,singularName:t,slug:r},null,2)),l.info("Dry run complete \u2014 no changes made.");return}let{token:n,siteId:o}=await ua(e),i=b.forCms({authToken:n,siteId:o}),s=Date.now();try{let a=await Ww(n,o,{displayName:e.name,singularName:t,slug:r});if(await i.sendUsage("cms_collections_create",{duration:Date.now()-s}),e.json){l.info(JSON.stringify(a,null,2));return}l.info(`${O} Collection created: ${a.id}`),l.info(` Name: ${a.displayName}`),l.info(` Slug: ${a.slug}`),l.info(`
|
|
201
|
+
Next: add fields with "webflow cms fields create --collection ${a.id} --name <name> --type <type>"`)}catch(a){if(a instanceof d&&a.isUserError){l.info(`${D} ${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:`${D} Failed to create collection:`})}}U();x();v();$();W();async function Vu(e){if(e.dryRun){l.info("Dry run \u2014 would create field:"),l.info(JSON.stringify({collectionId:e.collection,displayName:e.name,type:e.type,isRequired:e.required??!1},null,2)),l.info("Dry run complete \u2014 no changes made.");return}let t=await E(),r=b.forCms({authToken:t}),n=Date.now();try{let o=await Uw(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){l.info(JSON.stringify(o,null,2));return}l.info(`${O} Field created: ${o.id}`),l.info(` Name: ${o.displayName}`),l.info(` Type: ${o.type}`),l.info(` Slug: ${o.slug}`)}catch(o){if(o instanceof d&&o.isUserError){l.info(`${D} ${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:`${D} Failed to create field:`})}}U();x();v();$();W();async function Hu(e){let t=await E(),r=b.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){l.info("No items found.");return}if(e.json){l.info(JSON.stringify(s,null,2));return}let a=e.fields.split(",").map(f=>f.trim());l.info(Kw(s.items,a));let c=i+1,u=i+s.items.length;if(s.items.length>=o||i>0){let f=s.total>0?` of ${s.total}`:"";l.info(`
|
|
202
|
+
Showing ${c}\u2013${u}${f} items. Use --offset ${u} to load next page.`)}}catch(s){if(s instanceof d&&s.isUserError){l.info(`${D} ${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:`${D} Failed to list items:`})}}U();x();v();$();W();async function Ju(e){let t=await E(),r=b.forCms({authToken:t}),n=Date.now();try{let o=await Vw(t,e.collection,e.item,e.locale);if(await r.sendUsage("cms_items_get",{duration:Date.now()-n}),e.json){l.info(JSON.stringify(o,null,2));return}let i=o.isArchived?"archived":o.isDraft?"draft":"live";l.info(`${o.id} [${i}]`),l.info(` Last updated: ${new Date(o.lastUpdated).toLocaleString()}`),o.lastPublished&&l.info(` Last published: ${new Date(o.lastPublished).toLocaleString()}`),l.info(" Fields:"),l.info(JSON.stringify(o.fieldData,null,4).replace(/^/gm," "))}catch(o){if(o instanceof d&&o.isUserError){l.info(`${D} ${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:`${D} Failed to get item:`})}}U();x();v();$();W();async function Gu(e){let t;try{t=JSON.parse(e.data)}catch{throw new d(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){l.info("Dry run \u2014 would create item:"),l.info(JSON.stringify({fieldData:t,isDraft:e.draft??!1},null,2)),l.info("Dry run complete \u2014 no changes made.");return}let r=await E(),n=b.forCms({authToken:r}),o=Date.now();try{let i=await Lu(r,e.collection,t,e.draft??!1);if(await n.sendUsage("cms_items_create",{duration:Date.now()-o,dryRun:!1}),e.json){l.info(JSON.stringify(i,null,2));return}l.info(`${O} Item created: ${i.id}`)}catch(i){if(i instanceof d&&i.isUserError){l.info(`${D} ${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:`${D} Failed to create item:`})}}U();x();v();$();W();async function zu(e){let t;try{t=JSON.parse(e.data)}catch{throw new d(`Invalid JSON for --data: ${e.data}`)}if(e.dryRun){l.info("Dry run \u2014 would update item:"),l.info(JSON.stringify({collectionId:e.collection,itemId:e.item,fieldData:t},null,2)),l.info("Dry run complete \u2014 no changes made.");return}let r=await E(),n=b.forCms({authToken:r}),o=Date.now();try{let i=await Bu(r,e.collection,e.item,t);if(await n.sendUsage("cms_items_update",{duration:Date.now()-o,dryRun:!1}),e.json){l.info(JSON.stringify(i,null,2));return}l.info(`${O} Item updated: ${i.id}`)}catch(i){if(i instanceof d&&i.isUserError){l.info(`${D} ${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:`${D} Failed to update item:`})}}U();x();v();$();W();async function Ku(e){if(e.dryRun){l.info(`Dry run \u2014 would delete item ${e.item} from collection ${e.collection}`),l.info("Dry run complete \u2014 no changes made.");return}let t=await E(),r=b.forCms({authToken:t}),n=Date.now();try{await Hw(t,e.collection,e.item),await r.sendUsage("cms_items_delete",{duration:Date.now()-n,dryRun:!1}),l.info(`${O} Item deleted: ${e.item}`)}catch(o){if(o instanceof d&&o.isUserError){l.info(`${D} ${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:`${D} Failed to delete item:`})}}U();x();v();$();W();async function qu(e){let t=e.items.split(",").map(i=>i.trim());if(e.dryRun){l.info(`Dry run \u2014 would publish ${t.length} item(s) in collection ${e.collection}:`),t.forEach(i=>l.info(` ${i}`)),l.info("Dry run complete \u2014 no changes made.");return}let r=await E(),n=b.forCms({authToken:r}),o=Date.now();try{let i=await Jw(r,e.collection,t);if(await n.sendUsage("cms_items_publish",{duration:Date.now()-o,itemCount:t.length,dryRun:!1}),e.json){l.info(JSON.stringify(i,null,2));return}let s=i.publishedItemIds?.length??0;l.info(`${O} Published ${s} item(s)`),i.errors?.length&&i.errors.forEach(a=>l.warn(` ${a.itemId}: ${a.message}`))}catch(i){if(i instanceof d&&i.isUserError){l.info(`${D} ${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:`${D} Failed to publish items:`})}}var qw=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(Xe()).addOption(Y()).addOption(xe(["id","displayName","singularName","slug","lastUpdated"]).default("id,displayName,slug")).addOption(Fs(["displayName","slug","lastUpdated"]).default("displayName")).addOption(Es()).action(Mu),r.command("get").description("Get details and field schema for a CMS collection").argument("<collectionId>","Collection ID").addOption(Y()).action(Wu),r.command("create").description("Create a new CMS collection on a site. Use --dry-run to preview.").addOption(Xe()).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(Ae()).addOption(Y()).action(Uu),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(Ae()).addOption(Y()).action(Vu);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(xs()).addOption(_s()).addOption(Y()).addOption(xe(["id","isDraft","isArchived","lastUpdated","fieldData"]).default("id,isDraft,lastUpdated")).action(Hu),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(Y()).action(Ju),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(Ae()).addOption(Y()).action(Gu),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(Ae()).addOption(Y()).action(zu),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(Ae()).action(Ku),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(Ae()).addOption(Y()).action(qu)};U();ie();x();v();$();ve();W();se();ot();x();x();ie();var Zw={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 pa(e,t){let r=e.split(".").pop()?.toLowerCase()??"",n=Zw[r];if(!n){let o=Object.keys(Zw).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 Zu=["id","displayName","originalFileName","contentType","size","lastUpdated"];function Yw(e,t=["id","displayName","lastUpdated","size"]){if(e.length===0)return T("No assets found.");let r=Object.fromEntries(Zu.map(c=>[c.toLowerCase(),c])),n=t.map(c=>r[c.toLowerCase()]).filter(c=>c!=null);if(n.length===0)return Pt(`Invalid fields. Available: ${Zu.join(", ")}`);let o=t.filter(c=>r[c.toLowerCase()]==null),i=o.length>0?ne(`Warning: unknown field(s) ignored: ${o.join(", ")}. Available: ${Zu.join(", ")}
|
|
203
|
+
`):"",s=n.map(c=>Q(c)),a=e.map(c=>n.map(u=>{let p=c[u];if(p==null||u==="size"&&p===0)return T("\u2014");if(u==="size")return ox(Number(p));if(u==="lastUpdated"){let m=new Date(String(p)),g=String(m.getMonth()+1).padStart(2,"0"),w=String(m.getDate()).padStart(2,"0"),I=String(m.getFullYear()).slice(-2),C=String(m.getHours()).padStart(2,"0"),q=String(m.getMinutes()).padStart(2,"0");return`${g}/${w}/${I} ${C}:${q}`}let f=String(p);return u==="displayName"&&f.length>40?T("\u2026")+f.slice(-39):f}));return i+$e(s,a)}function ox(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Xw(e){if(e.length===0)return T("No folders found.");let t=[...e].sort((o,i)=>o.displayName.localeCompare(i.displayName)),r=["id","displayName","assets","lastUpdated"].map(o=>Q(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 $e(r,n)}async function Qw(e,t,r={}){if(z(t,"siteId"),r.folderId){z(r.folderId,"folderId");let a=await ix(e,r.folderId),c=new Set(a.assets);if(c.size===0)return{assets:[],pagination:{total:0,limit:0,offset:0}};let u=[],p=0,f=100;for(;;){let C=await j(`${F}/v2/sites/${t}/assets?limit=${f}&offset=${p}`,{headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}});if(!C.ok)throw new d(`Failed to list assets: ${C.status} ${C.statusText}`);let q=await C.json(),Z=q.assets??[];u.push(...Z);let S=q.pagination?.total??0;if(p+=Z.length,p>=S||Z.length===0)break}let m=u.filter(C=>c.has(C.id)),g=r.offset??0,w=r.limit??m.length,I=m.slice(g,g+w);return{assets:I,pagination:{total:m.length,limit:I.length,offset:g}}}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 j(`${F}/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 ey(e,t,r,n,o){z(t,"siteId"),o&&z(o,"folderId");let i=So(r);pa(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 c=await j(`${F}/v2/sites/${t}/assets`,{method:"POST",headers:{Authorization:`Bearer ${e}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)});if(!c.ok)throw new d(`Failed to initiate asset upload: ${c.status} ${c.statusText}`);let u=await c.json(),p={fields:u.uploadDetails,_id:u.id,s3Url:u.hostedUrl??"",url:u.uploadUrl??"",contentType:u.contentType??"",origFileName:u.originalFileName??i.meta.title,success_action_redirect:"",createdOn:"",updatedOn:""};try{await To(i,p)}catch(f){throw await j(`${F}/v2/assets/${p._id}`,{method:"DELETE",headers:{Authorization:`Bearer ${e}`,Accept:"application/json"}}).catch(()=>{}),f}return{id:p._id,hostedUrl:p.s3Url,displayName:s,originalFileName:i.meta.title}}async function ty(e,t,r){z(t,"assetId");let n=await j(`${F}/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 ix(e,t){z(t,"folderId");let r=await j(`${F}/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 ry(e,t){z(t,"siteId");let r=await j(`${F}/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 ny(e,t,r,n){z(t,"siteId"),n&&z(n,"parentFolderId");let o={displayName:r};n&&(o.parentFolder=n);let i=await j(`${F}/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 E(),r=e.site;else{let{manifest:i}=J(),s=await Ee(i);t=s.accessToken,r=s.siteId}let n=b.forAssets({authToken:t,siteId:r}),o=Date.now();try{let{assets:i,pagination:s}=await Qw(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){l.info("No assets found.");return}let a=["displayName","originalFileName","contentType","size","lastUpdated"],c=e.sortBy;a.includes(c)||(l.warn(`Unknown --sort-by "${e.sortBy}". Valid fields: ${a.join(", ")}. Defaulting to displayName.`),c="displayName");let u=e.order;["asc","desc"].includes(e.order)||(l.warn(`Unknown --order "${e.order}". Valid values: asc, desc. Defaulting to asc.`),u="asc");let p=da(i,c,u);if(e.json){l.info(JSON.stringify({assets:p,pagination:s},null,2));return}let f=e.fields.split(",").map(g=>g.trim());l.info(Yw(p,f));let m=(e.offset??0)+i.length;m<s.total&&l.info(T(`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:`${D} Failed to list assets:`})}}U();x();v();$();ve();W();async function Xu(e,t){let r=So(e);if(pa(r.meta.title,r.meta.size),t.dryRun){l.info(`Dry run \u2014 would upload: ${e} (validated)`),t.name&&l.info(` Display name: ${t.name}`),t.folder&&l.info(` Folder: ${t.folder}`),l.info("Dry run complete \u2014 no changes made.");return}let n,o;if(t.site)n=await E(),o=t.site;else{let{manifest:a}=J(),c=await Ee(a);n=c.accessToken,o=c.siteId}let i=b.forAssets({authToken:n,siteId:o}),s=Date.now();try{let a=await ey(n,o,e,t.name,t.folder);if(await i.sendUsage("assets_upload",{duration:Date.now()-s,dryRun:!1}),t.json){l.info(JSON.stringify(a,null,2));return}l.info(`${O} Asset uploaded: ${a.id}`),a.hostedUrl&&l.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:`${D} Failed to upload asset:`})}}U();x();v();$();W();async function Qu(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){l.info(`Dry run \u2014 would update asset: ${e}`),t.altText&&l.info(` Alt text: ${t.altText}`),t.displayName&&l.info(` Display name: ${t.displayName}`),l.info("Dry run complete \u2014 no changes made.");return}let r=await E(),n=b.forAssets({authToken:r}),o=Date.now();try{let i=await ty(r,e,{altText:t.altText,displayName:t.displayName});if(await n.sendUsage("assets_update",{duration:Date.now()-o,dryRun:!1}),t.json){l.info(JSON.stringify(i,null,2));return}l.info(`${O} Asset updated: ${i.id}`),i.displayName&&l.info(` Display name: ${i.displayName}`),i.altText&&l.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:`${D} Failed to update asset:`})}}U();x();v();$();ve();W();async function ed(e){let t,r;if(e.site)t=await E(),r=e.site;else{let{manifest:i}=J(),s=await Ee(i);t=s.accessToken,r=s.siteId}let n=b.forAssets({authToken:t,siteId:r}),o=Date.now();try{let i=await ry(t,r);if(await n.sendUsage("assets_folders_list",{duration:Date.now()-o,count:i.length}),e.json){l.info(JSON.stringify(i,null,2));return}l.info(Xw(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:`${D} Failed to list folders:`})}}U();x();v();$();ao();W();async function td(e,t){let r,n;if(t.site)r=await E(),n=t.site;else{let{manifest:s}=J(),a=await Ee(s);r=a.accessToken,n=a.siteId}let o=b.forAssets({authToken:r,siteId:n}),i=Date.now();try{let s=await ny(r,n,e,t.parent);if(await o.sendUsage("assets_folders_create",{duration:Date.now()-i}),t.json){l.info(JSON.stringify(s,null,2));return}l.info(`${O} Folder created: ${s.id}`),l.info(` Name: ${s.displayName}`),s.parentFolder&&l.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:`${D} Failed to create folder:`})}}var oy=e=>{let t=e.command("assets").description("Manage Webflow site assets");t.command("list").description("List all assets for a site").addOption(Xe()).option("--folder <folderId>","Filter by folder ID").addOption(Y()).addOption(xe(["id","displayName","originalFileName","contentType","size","lastUpdated"]).default("id,displayName,lastUpdated,size")).addOption(xs()).addOption(_s()).addOption(Fs(["displayName","originalFileName","contentType","size","lastUpdated"]).default("displayName")).addOption(Es()).action(Yu),t.command("upload").description(`Upload a file as an asset. Use --dry-run to preview before uploading.
|
|
204
|
+
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(Xe()).option("--name <displayName>","Display name for the asset (defaults to filename)").option("--folder <folderId>","Upload into a folder").addOption(Ae()).addOption(Y()).action(Xu),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(Ae()).addOption(Y()).action(Qu);let r=t.command("folders").description("Manage asset folders");r.command("list").description("List all asset folders for a site").addOption(Xe()).addOption(Y()).action(ed),r.command("create").description("Create a new asset folder").argument("<name>","Display name for the folder").addOption(Xe()).option("--parent <folderId>","Parent folder ID (creates a nested folder)").addOption(Y()).action(td)};U();x();v();$();W();se();x();ot();ot();x();async function ui(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 c=await j(a.toString(),{headers:{Authorization:`Bearer ${t}`,Accept:"application/json"}});if(!c.ok)throw new d(`${n}: ${c.status} ${c.statusText}`);let u=await c.json(),p=u[r]??[];o.push(...p);let f=u.pagination?.total??p.length;if(i+=p.length,i>=f||p.length<s)break}return o}async function iy(e,t){z(t,"siteId");let r=await j(`${F}/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 sy(e){return ui(`${F}/v2/sites`,e,"sites","Failed to list sites")}async function ay(e,t){z(t,"siteId");let r=await j(`${F}/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 ly(e,t,r=[],n){z(t,"siteId"),n&&z(n,"pageId");let o=r.length>0?{customDomains:r}:{publishToWebflowSubdomain:!0};n&&(o.pageId=n);let i=await j(`${F}/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()}x();ie();var rd=["id","displayName","shortName","lastPublished","lastUpdated","timeZone"],cy=qe(rd);function uy(){return rd}function dy(e,t=["id","displayName","lastPublished"]){if(e.length===0)return T("No sites found.");if(t.length===0)throw new d(`No valid fields specified. Available: ${rd.join(", ")}`,{isUserError:!0});let r=t.map(o=>Q(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:T("\u2014")}));return $e(r,n)}function py(e){if(e.length===0)return T("No custom domains configured.");let t=[Q("id"),Q("url"),Q("lastPublished")],r=e.map(n=>[n.id,n.url,n.lastPublished?new Date(n.lastPublished).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):T("\u2014")]);return $e(t,r)}async function nd(e){let t=await E(),r=b.forSites({authToken:t}),n=Date.now();try{let o=await sy(t);if(await r.sendUsage("sites_list",{duration:Date.now()-n,count:o.length}),e.json){l.info(JSON.stringify(o,null,2));return}if(o.length===0){l.info("No sites found.");return}let i=ce(e.fields,cy,uy());l.info(dy(o,i))}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:`${D} Failed to list sites:`}))}}U();x();v();$();W();async function od(e,t){let r=await E(),n=b.forSites({authToken:r}),o=Date.now();try{let i=await iy(r,e);if(await n.sendUsage("sites_get",{duration:Date.now()-o}),t.json){l.info(JSON.stringify(i,null,2));return}l.info(`${i.displayName} (${i.id})`),l.info(` Short name: ${i.shortName}`),l.info(` Time zone: ${i.timeZone}`),i.lastPublished&&l.info(` Published: ${new Date(i.lastPublished).toLocaleString()}`),i.previewUrl&&l.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:`${D} Failed to get site:`}))}}U();x();v();$();W();async function id(e){let t=await E(),r=b.forSites({authToken:t}),n=Date.now();try{let o=await ay(t,e.site);if(await r.sendUsage("sites_domains",{duration:Date.now()-n,count:o.length}),e.json){l.info(JSON.stringify(o,null,2));return}l.info(py(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:`${D} Failed to get custom domains:`}))}}U();x();v();$();W();async function sd(e){if(z(e.site,"siteId"),e.dryRun){l.info(`Would publish ${e.page?`page ${e.page} on`:"site"} ${e.site}`),e.domains?l.info(` Custom domains: ${e.domains}`):l.info(" Domains: Webflow subdomain");return}let t=await E(),r=b.forSites({authToken:t}),n=Date.now();try{let o=e.domains?e.domains.split(",").map(c=>c.trim()):[],i=await ly(t,e.site,o,e.page);if(await r.sendUsage("sites_publish",{duration:Date.now()-n,dryRun:!1,publishScope:i.publishScope}),e.json){l.info(JSON.stringify(i,null,2));return}let s=i.publishScope==="page"?"Page":"Site";l.info(`${O} ${s} published successfully`);let a=i.customDomains??[];a.length>0?a.forEach(c=>{let u=c.lastPublished?` (${new Date(c.lastPublished).toLocaleString()})`:"";l.info(` Live at: https://${c.url}${u}`)}):i.publishToWebflowSubdomain&&l.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:`${D} Failed to publish site:`}))}}var fy=e=>{let t=e.command("sites").description("Manage Webflow sites");t.command("list").description("List all sites in your Webflow workspace").addOption(Y()).addOption(xe(["id","displayName","shortName","lastPublished","lastUpdated","timeZone"]).default("id,displayName,lastPublished")).action(nd),t.command("get").description("Get details for a specific site").argument("<siteId>","Site ID").addOption(Y()).action(od),t.command("domains").description("List custom domains configured for a site").requiredOption("--site <siteId>","Site ID").addOption(Y()).action(id),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(Ae()).addOption(Y()).action(sd)};U();x();v();$();W();se();async function my(e,t){return z(t,"siteId"),ui(`${F}/v2/sites/${t}/forms`,e,"forms","Failed to list forms")}async function gy(e,t,r){return z(t,"siteId"),z(r,"formId"),ui(`${F}/v2/sites/${t}/forms/${r}/submissions`,e,"formSubmissions","Failed to list submissions")}x();ie();var ad=["id","displayName","name","slug","createdOn","lastUpdated"],hy=qe(ad);function wy(){return ad}function yy(e,t=["id","displayName","slug"]){if(e.length===0)return T("No forms found.");if(t.length===0)throw new d(`No valid fields specified. Available: ${ad.join(", ")}`,{isUserError:!0});let r=t.map(o=>Q(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:T("\u2014")}));return $e(r,n)}function Dy(e){if(e.length===0)return T("No submissions found.");let t=Array.from(new Set(e.flatMap(o=>Object.keys(o.formResponse)))),r=["id","dateSubmitted",...t].map(o=>Q(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?T("\u2014"):typeof s=="object"?JSON.stringify(s):String(s)})]);return $e(r,n)}function by(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(`
|
|
196
205
|
`)?`"${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(`
|
|
197
|
-
`)}async function
|
|
198
|
-
`).flatMap(o=>o.startsWith("Usage:")?["",
|
|
206
|
+
`)}async function ld(e){z(e.site,"siteId");let t=await E(),r=b.forForms({authToken:t}),n=Date.now();try{let o=await my(t,e.site);if(await r.sendUsage("forms_list",{duration:Date.now()-n,count:o.length}),e.json){l.info(JSON.stringify(o,null,2));return}if(o.length===0){l.info("No forms found.");return}let i=ce(e.fields,hy,wy());l.info(yy(o,i))}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:`${D} Failed to list forms:`}))}}var vy=h(require("fs"));U();x();v();$();W();async function cd(e){z(e.site,"siteId"),z(e.form,"formId"),e.output&&e.json&&l.warn("--json is ignored when --output is set.");let t=await E(),r=b.forForms({authToken:t}),n=Date.now();try{let o=await gy(t,e.site,e.form);if(await r.sendUsage("forms_submissions",{duration:Date.now()-n,count:o.length}),o.length===0){l.info("No submissions found.");return}if(e.output){let i=by(o);vy.default.writeFileSync(e.output,i,"utf8"),l.info(`${O} ${o.length} submission${o.length===1?"":"s"} written to ${e.output}`);return}if(e.json){l.info(JSON.stringify(o,null,2));return}l.info(Dy(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:`${D} Failed to fetch submissions:`})}}var Ey=e=>{let t=e.command("forms").description("Manage Webflow forms");t.command("list").description("List all forms for a site").addOption(Xe()).addOption(Y()).addOption(xe(["id","displayName","name","slug","createdOn","lastUpdated"]).default("id,displayName,slug")).action(ld),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(cd)};var xy=h(ki());function ud(e,t){t.forEach(r=>{e.addOption(r())}),e.commands.forEach(r=>ud(r,t))}function _y(e){let t=xy.default.version;e.name("webflow").description("Webflow CLI").version(t,"-v, --version").configureHelp({formatHelp(r,n){return Fy.Help.prototype.formatHelp.call(this,r,n).split(`
|
|
207
|
+
`).flatMap(o=>o.startsWith("Usage:")?["",Q(o)]:/^(Options:|Commands:|Arguments:)/.test(o)?[Q(o)]:/^Webflow CLI$/.test(o)?[md(o)]:o.trim()===""?[o]:[T(o)]).map(o=>o.trim()===""?o:` ${o}`).join(`
|
|
199
208
|
`)+`
|
|
200
|
-
`}}).addOption(
|
|
209
|
+
`}}).addOption(xc()).addOption(_c()).addOption(Cc()).addOption(kc()).showHelpAfterError(),e.hook("preAction",async(r,n)=>{let o=r.opts();o.input||Dp(!0),n.opts().json&&bp(!0),Nt.start(),o.manifest&&Ep(o.manifest);try{await b.promptForConsentIfNeeded()}catch(i){l.debug(`Failed to check telemetry preference: ${i}`)}try{o.skipUpdateCheck||await new yo().prompt()}catch(i){l.debug(`Failed to check for package updates: ${i}`)}}),e.hook("postAction",async()=>{Nt.displayGrouped(),Nt.stop()}),mf(e),qw(e),Hf(e),Bg(e),pw(e),st()&&Lw(e),Lg(e),oy(e),fy(e),Ey(e),Ig(e),e.commands.forEach(r=>{ud(r,[xc,_c,Cc,kc])})}v();x();var ky=new Cy.Command;_y(ky);ky.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 l.error(e,{prefix:e.prefix})}else l.error(e);process.exit(1)});
|
|
201
210
|
//# sourceMappingURL=index.js.map
|