prismic 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builders-hKD4IrLX-cdTCGdwG.mjs → builders-hKD4IrLX-CiOmsZQP.mjs} +1 -1
- package/dist/index.mjs +119 -58
- package/dist/nextjs-c8JOjFCt.mjs +413 -0
- package/dist/nuxt-BhwnOusi.mjs +90 -0
- package/dist/string-CFNpwnbk.mjs +7 -0
- package/dist/sveltekit-BW5_-HtZ.mjs +263 -0
- package/package.json +1 -1
- package/src/adapters/index.ts +6 -0
- package/src/adapters/nextjs.templates.ts +170 -38
- package/src/adapters/nextjs.ts +33 -3
- package/src/adapters/nuxt.templates.ts +48 -0
- package/src/adapters/nuxt.ts +42 -20
- package/src/adapters/sveltekit.templates.ts +92 -35
- package/src/adapters/sveltekit.ts +38 -3
- package/src/auth.ts +1 -2
- package/src/clients/locale.ts +64 -0
- package/src/clients/user.ts +1 -0
- package/src/clients/wroom.ts +212 -0
- package/src/commands/gen-setup.ts +38 -0
- package/src/commands/gen-types.ts +35 -0
- package/src/commands/gen.ts +18 -0
- package/src/commands/init.ts +7 -1
- package/src/commands/locale-add.ts +47 -0
- package/src/commands/locale-list.ts +43 -0
- package/src/commands/locale-remove.ts +45 -0
- package/src/commands/locale-set-master.ts +61 -0
- package/src/commands/locale.ts +28 -0
- package/src/commands/repo-create.ts +60 -0
- package/src/commands/repo-list.ts +58 -0
- package/src/commands/repo-set-api-access.ts +53 -0
- package/src/commands/repo-set-name.ts +46 -0
- package/src/commands/repo-view.ts +74 -0
- package/src/commands/repo.ts +33 -0
- package/src/commands/sync.ts +4 -2
- package/src/commands/token-create.ts +55 -0
- package/src/commands/token-delete.ts +61 -0
- package/src/commands/token-list.ts +67 -0
- package/src/commands/token.ts +23 -0
- package/src/config.ts +53 -0
- package/src/env.ts +2 -0
- package/src/index.ts +20 -0
- package/src/lib/codegen.ts +6 -5
- package/src/lib/url.ts +7 -0
- package/dist/nextjs-DrbOdw3q.mjs +0 -318
- package/dist/nuxt-DO5Kp4yy.mjs +0 -59
- package/dist/string-CnZrLYLV.mjs +0 -7
- package/dist/sveltekit-KHG7YUoX.mjs +0 -236
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";import{access as t,mkdir as n,readFile as r,rm as i,writeFile as a}from"node:fs/promises";import{fileURLToPath as o,pathToFileURL as s}from"node:url";import*as c from"fs";import l from"fs";import u,{basename as d,dirname as f,normalize as p,posix as m,relative as h,resolve as g,sep as ee}from"path";import{fileURLToPath as _}from"url";import{createRequire as v}from"module";import{delimiter as y,dirname as te,normalize as b,relative as x,resolve as S}from"node:path";import{spawn as C}from"node:child_process";import{cwd as w}from"node:process";import{PassThrough as T}from"node:stream";import E from"node:readline";var D=Object.create,O=Object.defineProperty,ne=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,re=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty,A=(e,t)=>()=>(e&&(t=e(e=0)),t),j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),M=(e,t)=>{let n={};for(var r in e)O(n,r,{get:e[r],enumerable:!0});return t&&O(n,Symbol.toStringTag,{value:`Module`}),n},N=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=k(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ie.call(e,s)&&s!==n&&O(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=ne(t,s))||r.enumerable});return e},P=(e,t,n)=>(n=e==null?{}:D(re(e)),N(t||!e||!e.__esModule?O(n,`default`,{value:e,enumerable:!0}):n,e)),F=e=>ie.call(e,`module.exports`)?e[`module.exports`]:N(O({},`__esModule`,{value:!0}),e),I=e(import.meta.url);const L=/([\p{Ll}\d])(\p{Lu})/gu,R=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,z=/(\d)\p{Ll}|(\p{L})\d/u,B=/[^\p{L}\d]+/giu,V=`$1\0$2`;function H(e){let t=e.trim();t=t.replace(L,V).replace(R,V),t=t.replace(B,`\0`);let n=0,r=t.length;for(;t.charAt(n)===`\0`;)n++;if(n===r)return[];for(;t.charAt(r-1)===`\0`;)r--;return t.slice(n,r).split(/\0/g)}function ae(e){let t=H(e);for(let e=0;e<t.length;e++){let n=t[e],r=z.exec(n);if(r){let i=r.index+(r[1]??r[2]).length;t.splice(e,1,n.slice(0,i),n.slice(i))}}return t}function U(e,t){let[n,r,i]=ce(e,t),a=W(t?.locale),o=G(t?.locale),s=t?.mergeAmbiguousCharacters?oe(a,o):se(a,o);return n+r.map(s).join(t?.delimiter??``)+i}function W(e){return e===!1?e=>e.toLowerCase():t=>t.toLocaleLowerCase(e)}function G(e){return e===!1?e=>e.toUpperCase():t=>t.toLocaleUpperCase(e)}function oe(e,t){return n=>`${t(n[0])}${e(n.slice(1))}`}function se(e,t){return(n,r)=>{let i=n[0];return(r>0&&i>=`0`&&i<=`9`?`_`+i:t(i))+e(n.slice(1))}}function ce(e,t={}){let n=t.split??(t.separateNumbers?ae:H),r=t.prefixCharacters??``,i=t.suffixCharacters??``,a=0,o=e.length;for(;a<e.length;){let t=e.charAt(a);if(!r.includes(t))break;a++}for(;o>a;){let t=o-1,n=e.charAt(t);if(!i.includes(n))break;o=t}return[e.slice(0,a),n(e.slice(a,o)),e.slice(o)]}var le=v(import.meta.url);function ue(e){let t=p(e);return t.length>1&&t[t.length-1]===ee&&(t=t.substring(0,t.length-1)),t}const de=/[\\/]/g;function fe(e,t){return e.replace(de,t)}const pe=/^[a-z]:[\\/]$/i;function me(e){return e===`/`||pe.test(e)}function he(e,t){let{resolvePaths:n,normalizePath:r,pathSeparator:i}=t,a=process.platform===`win32`&&e.includes(`/`)||e.startsWith(`.`);return n&&(e=g(e)),(r||a)&&(e=ue(e)),e===`.`?``:fe(e[e.length-1]===i?e:e+i,i)}function ge(e,t){return t+e}function _e(e,t){return function(n,r){return r.startsWith(e)?r.slice(e.length)+n:fe(h(e,r),t.pathSeparator)+t.pathSeparator+n}}function ve(e){return e}function ye(e,t,n){return t+e+n}function be(e,t){let{relativePaths:n,includeBasePath:r}=t;return n&&e?_e(e,t):r?ge:ve}function xe(e){return function(t,n){n.push(t.substring(e.length)||`.`)}}function Se(e){return function(t,n,r){let i=t.substring(e.length)||`.`;r.every(e=>e(i,!0))&&n.push(i)}}const Ce=(e,t)=>{t.push(e||`.`)},we=(e,t,n)=>{let r=e||`.`;n.every(e=>e(r,!0))&&t.push(r)},Te=()=>{};function Ee(e,t){let{includeDirs:n,filters:r,relativePaths:i}=t;return n?i?r&&r.length?Se(e):xe(e):r&&r.length?we:Ce:Te}const De=(e,t,n,r)=>{r.every(t=>t(e,!1))&&n.files++},Oe=(e,t,n,r)=>{r.every(t=>t(e,!1))&&t.push(e)},ke=(e,t,n,r)=>{n.files++},Ae=(e,t)=>{t.push(e)},je=()=>{};function Me(e){let{excludeFiles:t,filters:n,onlyCounts:r}=e;return t?je:n&&n.length?r?De:Oe:r?ke:Ae}const Ne=e=>e,Pe=()=>[``].slice(0,0);function Fe(e){return e.group?Pe:Ne}const Ie=(e,t,n)=>{e.push({directory:t,files:n,dir:t})},Le=()=>{};function Re(e){return e.group?Ie:Le}const ze=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue(),i.realpath(e,(o,s)=>{if(o)return r.dequeue(a?null:o,t);i.stat(s,(i,o)=>{if(i)return r.dequeue(a?null:i,t);if(o.isDirectory()&&He(e,s,t))return r.dequeue(null,t);n(o,s),r.dequeue(null,t)})})},Be=function(e,t,n){let{queue:r,fs:i,options:{suppressErrors:a}}=t;r.enqueue();try{let r=i.realpathSync(e),a=i.statSync(r);if(a.isDirectory()&&He(e,r,t))return;n(a,r)}catch(e){if(!a)throw e}};function Ve(e,t){return!e.resolveSymlinks||e.excludeSymlinks?null:t?Be:ze}function He(e,t,n){if(n.options.useRealPaths)return Ue(t,n);let r=f(e),i=1;for(;r!==n.root&&i<2;){let e=n.symlinks.get(r);e&&(e===t||e.startsWith(t)||t.startsWith(e))?i++:r=f(r)}return n.symlinks.set(e,t),i>1}function Ue(e,t){return t.visited.includes(e+t.options.pathSeparator)}const We=e=>e.counts,Ge=e=>e.groups,Ke=e=>e.paths,qe=e=>e.paths.slice(0,e.options.maxFiles),Je=(e,t,n)=>(Qe(t,n,e.counts,e.options.suppressErrors),null),Ye=(e,t,n)=>(Qe(t,n,e.paths,e.options.suppressErrors),null),Xe=(e,t,n)=>(Qe(t,n,e.paths.slice(0,e.options.maxFiles),e.options.suppressErrors),null),Ze=(e,t,n)=>(Qe(t,n,e.groups,e.options.suppressErrors),null);function Qe(e,t,n,r){t(e&&!r?e:null,n)}function $e(e,t){let{onlyCounts:n,group:r,maxFiles:i}=e;return n?t?We:Je:r?t?Ge:Ze:i?t?qe:Xe:t?Ke:Ye}const et={withFileTypes:!0},tt=(e,t,n,r,i)=>{if(e.queue.enqueue(),r<0)return e.queue.dequeue(null,e);let{fs:a}=e;e.visited.push(t),e.counts.directories++,a.readdir(t||`.`,et,(t,a=[])=>{i(a,n,r),e.queue.dequeue(e.options.suppressErrors?null:t,e)})},nt=(e,t,n,r,i)=>{let{fs:a}=e;if(r<0)return;e.visited.push(t),e.counts.directories++;let o=[];try{o=a.readdirSync(t||`.`,et)}catch(t){if(!e.options.suppressErrors)throw t}i(o,n,r)};function rt(e){return e?nt:tt}var it=class{count=0;constructor(e){this.onQueueEmpty=e}enqueue(){return this.count++,this.count}dequeue(e,t){this.onQueueEmpty&&(--this.count<=0||e)&&(this.onQueueEmpty(e,t),e&&(t.controller.abort(),this.onQueueEmpty=void 0))}},at=class{_files=0;_directories=0;set files(e){this._files=e}get files(){return this._files}set directories(e){this._directories=e}get directories(){return this._directories}get dirs(){return this._directories}},ot=class{aborted=!1;abort(){this.aborted=!0}},st=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(e,t,n){this.isSynchronous=!n,this.callbackInvoker=$e(t,this.isSynchronous),this.root=he(e,t),this.state={root:me(this.root)?this.root:this.root.slice(0,-1),paths:[``].slice(0,0),groups:[],counts:new at,options:t,queue:new it((e,t)=>this.callbackInvoker(t,e,n)),symlinks:new Map,visited:[``].slice(0,0),controller:new ot,fs:t.fs||c},this.joinPath=be(this.root,t),this.pushDirectory=Ee(this.root,t),this.pushFile=Me(t),this.getArray=Fe(t),this.groupFiles=Re(t),this.resolveSymlink=Ve(t,this.isSynchronous),this.walkDirectory=rt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(e,t,n)=>{let{paths:r,options:{filters:i,resolveSymlinks:a,excludeSymlinks:o,exclude:s,maxFiles:c,signal:l,useRealPaths:u,pathSeparator:p},controller:m}=this.state;if(m.aborted||l&&l.aborted||c&&r.length>c)return;let h=this.getArray(this.state.paths);for(let c=0;c<e.length;++c){let l=e[c];if(l.isFile()||l.isSymbolicLink()&&!a&&!o){let e=this.joinPath(l.name,t);this.pushFile(e,h,this.state.counts,i)}else if(l.isDirectory()){let e=ye(l.name,t,this.state.options.pathSeparator);if(s&&s(l.name,e))continue;this.pushDirectory(e,r,i),this.walkDirectory(this.state,e,e,n-1,this.walk)}else if(this.resolveSymlink&&l.isSymbolicLink()){let e=ge(l.name,t);this.resolveSymlink(e,this.state,(t,r)=>{if(t.isDirectory()){if(r=he(r,this.state.options),s&&s(l.name,u?r:e+p))return;this.walkDirectory(this.state,r,u?r:e+p,n-1,this.walk)}else{r=u?r:e;let t=d(r),n=he(f(r),this.state.options);r=this.joinPath(t,n),this.pushFile(r,h,this.state.counts,i)}})}}this.groupFiles(this.state.groups,t,h)}};function ct(e,t){return new Promise((n,r)=>{lt(e,t,(e,t)=>{if(e)return r(e);n(t)})})}function lt(e,t,n){new st(e,t,n).start()}function ut(e,t){return new st(e,t).start()}var dt=class{constructor(e,t){this.root=e,this.options=t}withPromise(){return ct(this.root,this.options)}withCallback(e){lt(this.root,this.options,e)}sync(){return ut(this.root,this.options)}};let ft=null;try{le.resolve(`picomatch`),ft=le(`picomatch`)}catch{}var pt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:ee,filters:[]};globFunction;constructor(e){this.options={...this.options,...e},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(e){return this.options.pathSeparator=e,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(e){return this.options.maxDepth=e,this}withMaxFiles(e){return this.options.maxFiles=e,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:e=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=e,this.withFullPaths()}withAbortSignal(e){return this.options.signal=e,this}normalize(){return this.options.normalizePath=!0,this}filter(e){return this.options.filters.push(e),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(e){return this.options.exclude=e,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(e){return new dt(e||`.`,this.options)}withGlobFunction(e){return this.globFunction=e,this}crawlWithOptions(e,t){return this.options={...this.options,...t},new dt(e||`.`,this.options)}glob(...e){return this.globFunction?this.globWithOptions(e):this.globWithOptions(e,{dot:!0})}globWithOptions(e,...t){let n=this.globFunction||ft;if(!n)throw Error(`Please specify a glob function to use glob matching.`);var r=this.globCache[e.join(`\0`)];return r||(r=n(e,...t),this.globCache[e.join(`\0`)]=r),this.options.filters.push(e=>r(e)),this}},mt=j(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:{alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),ht=j((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=mt();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),gt=j(((e,t)=>{let n=ht(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:ee}=mt(),_=e=>e===l||e===a,v=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let y=t||{},te=e.length-1,b=y.parts===!0||y.scanToEnd===!0,x=[],S=[],C=[],w=e,T=-1,E=0,D=0,O=!1,ne=!1,k=!1,re=!1,ie=!1,A=!1,j=!1,M=!1,N=!1,P=!1,F=0,I,L,R={value:``,depth:0,isGlob:!1},z=()=>T>=te,B=()=>w.charCodeAt(T+1),V=()=>(I=L,w.charCodeAt(++T));for(;T<te;){L=V();let e;if(L===a){j=R.backslashes=!0,L=V(),L===u&&(A=!0);continue}if(A===!0||L===u){for(F++;z()!==!0&&(L=V());){if(L===a){j=R.backslashes=!0,V();continue}if(L===u){F++;continue}if(A!==!0&&L===s&&(L=V())===s){if(O=R.isBrace=!0,k=R.isGlob=!0,P=!0,b===!0)continue;break}if(A!==!0&&L===o){if(O=R.isBrace=!0,k=R.isGlob=!0,P=!0,b===!0)continue;break}if(L===h&&(F--,F===0)){A=!1,O=R.isBrace=!0,P=!0;break}}if(b===!0)continue;break}if(L===l){if(x.push(T),S.push(R),R={value:``,depth:0,isGlob:!1},P===!0)continue;if(I===s&&T===E+1){E+=2;continue}D=T+1;continue}if(y.noext!==!0&&(L===p||L===i||L===r||L===m||L===c)&&B()===d){if(k=R.isGlob=!0,re=R.isExtglob=!0,P=!0,L===c&&T===E&&(N=!0),b===!0){for(;z()!==!0&&(L=V());){if(L===a){j=R.backslashes=!0,L=V();continue}if(L===g){k=R.isGlob=!0,P=!0;break}}continue}break}if(L===r){if(I===r&&(ie=R.isGlobstar=!0),k=R.isGlob=!0,P=!0,b===!0)continue;break}if(L===m){if(k=R.isGlob=!0,P=!0,b===!0)continue;break}if(L===f){for(;z()!==!0&&(e=V());){if(e===a){j=R.backslashes=!0,V();continue}if(e===ee){ne=R.isBracket=!0,k=R.isGlob=!0,P=!0;break}}if(b===!0)continue;break}if(y.nonegate!==!0&&L===c&&T===E){M=R.negated=!0,E++;continue}if(y.noparen!==!0&&L===d){if(k=R.isGlob=!0,b===!0){for(;z()!==!0&&(L=V());){if(L===d){j=R.backslashes=!0,L=V();continue}if(L===g){P=!0;break}}continue}break}if(k===!0){if(P=!0,b===!0)continue;break}}y.noext===!0&&(re=!1,k=!1);let H=w,ae=``,U=``;E>0&&(ae=w.slice(0,E),w=w.slice(E),D-=E),H&&k===!0&&D>0?(H=w.slice(0,D),U=w.slice(D)):k===!0?(H=``,U=w):H=w,H&&H!==``&&H!==`/`&&H!==w&&_(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),y.unescape===!0&&(U&&=n.removeBackslashes(U),H&&j===!0&&(H=n.removeBackslashes(H)));let W={prefix:ae,input:e,start:E,base:H,glob:U,isBrace:O,isBracket:ne,isGlob:k,isExtglob:re,isGlobstar:ie,negated:M,negatedExtglob:N};if(y.tokens===!0&&(W.maxDepth=0,_(L)||S.push(R),W.tokens=S),y.parts===!0||y.tokens===!0){let t;for(let n=0;n<x.length;n++){let r=t?t+1:E,i=x[n],a=e.slice(r,i);y.tokens&&(n===0&&E!==0?(S[n].isPrefix=!0,S[n].value=ae):S[n].value=a,v(S[n]),W.maxDepth+=S[n].depth),(n!==0||a!==``)&&C.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);C.push(n),y.tokens&&(S[S.length-1].value=n,v(S[S.length-1]),W.maxDepth+=S[S.length-1].depth)}W.slashes=x,W.parts=C}return W}})),_t=j(((e,t)=>{let n=mt(),r=ht(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let f={...t},p=typeof f.maxLength==`number`?Math.min(i,f.maxLength):i,m=e.length;if(m>p)throw SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);let h={type:`bos`,value:``,output:f.prepend||``},g=[h],ee=f.capture?``:`?:`,_=n.globChars(f.windows),v=n.extglobChars(_),{DOT_LITERAL:y,PLUS_LITERAL:te,SLASH_LITERAL:b,ONE_CHAR:x,DOTS_SLASH:S,NO_DOT:C,NO_DOT_SLASH:w,NO_DOTS_SLASH:T,QMARK:E,QMARK_NO_DOT:D,STAR:O,START_ANCHOR:ne}=_,k=e=>`(${ee}(?:(?!${ne}${e.dot?S:y}).)*?)`,re=f.dot?``:C,ie=f.dot?E:D,A=f.bash===!0?k(f):O;f.capture&&(A=`(${A})`),typeof f.noext==`boolean`&&(f.noextglob=f.noext);let j={input:e,index:-1,start:0,dot:f.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:g};e=r.removePrefix(e,j),m=e.length;let M=[],N=[],P=[],F=h,I,L=()=>j.index===m-1,R=j.peek=(t=1)=>e[j.index+t],z=j.advance=()=>e[++j.index]||``,B=()=>e.slice(j.index+1),V=(e=``,t=0)=>{j.consumed+=e,j.index+=t},H=e=>{j.output+=e.output==null?e.value:e.output,V(e.value)},ae=()=>{let e=1;for(;R()===`!`&&(R(2)!==`(`||R(3)===`?`);)z(),j.start++,e++;return e%2==0?!1:(j.negated=!0,j.start++,!0)},U=e=>{j[e]++,P.push(e)},W=e=>{j[e]--,P.pop()},G=e=>{if(F.type===`globstar`){let t=j.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||M.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(j.output=j.output.slice(0,-F.output.length),F.type=`star`,F.value=`*`,F.output=A,j.output+=F.output)}if(M.length&&e.type!==`paren`&&(M[M.length-1].inner+=e.value),(e.value||e.output)&&H(e),F&&F.type===`text`&&e.type===`text`){F.output=(F.output||F.value)+e.value,F.value+=e.value;return}e.prev=F,g.push(e),F=e},oe=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=F,n.parens=j.parens,n.output=j.output;let r=(f.capture?`(`:``)+n.open;U(`parens`),G({type:e,value:t,output:j.output?``:x}),G({type:`paren`,extglob:!0,value:z(),output:r}),M.push(n)},se=e=>{let n=e.close+(f.capture?`)`:``),r;if(e.type===`negate`){let i=A;e.inner&&e.inner.length>1&&e.inner.includes(`/`)&&(i=k(f)),(i!==A||L()||/^\)+$/.test(B()))&&(n=e.close=`)$))${i}`),e.inner.includes(`*`)&&(r=B())&&/^\.[^\\/.]+$/.test(r)&&(n=e.close=`)${d(r,{...t,fastpaths:!1}).output})${i})`),e.prev.type===`bos`&&(j.negatedExtglob=!0)}G({type:`paren`,extglob:!0,value:I,output:n}),W(`parens`)};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?E.repeat(a.length):``):o===0?ie+(a?E.repeat(a.length):``):E.repeat(r.length):i===`.`?y.repeat(r.length):i===`*`?t?t+i+(a?A:``):A:t?e:`\\${e}`);return n===!0&&(i=f.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&f.contains===!0?(j.output=e,j):(j.output=r.wrapOutput(i,j,t),j)}for(;!L();){if(I=z(),I===`\0`)continue;if(I===`\\`){let e=R();if(e===`/`&&f.bash!==!0||e===`.`||e===`;`)continue;if(!e){I+=`\\`,G({type:`text`,value:I});continue}let t=/^\\+/.exec(B()),n=0;if(t&&t[0].length>2&&(n=t[0].length,j.index+=n,n%2!=0&&(I+=`\\`)),f.unescape===!0?I=z():I+=z(),j.brackets===0){G({type:`text`,value:I});continue}}if(j.brackets>0&&(I!==`]`||F.value===`[`||F.value===`[^`)){if(f.posix!==!1&&I===`:`){let e=F.value.slice(1);if(e.includes(`[`)&&(F.posix=!0,e.includes(`:`))){let e=F.value.lastIndexOf(`[`),t=F.value.slice(0,e),n=a[F.value.slice(e+2)];if(n){F.value=t+n,j.backtrack=!0,z(),!h.output&&g.indexOf(F)===1&&(h.output=x);continue}}}(I===`[`&&R()!==`:`||I===`-`&&R()===`]`)&&(I=`\\${I}`),I===`]`&&(F.value===`[`||F.value===`[^`)&&(I=`\\${I}`),f.posix===!0&&I===`!`&&F.value===`[`&&(I=`^`),F.value+=I,H({value:I});continue}if(j.quotes===1&&I!==`"`){I=r.escapeRegex(I),F.value+=I,H({value:I});continue}if(I===`"`){j.quotes=j.quotes===1?0:1,f.keepQuotes===!0&&G({type:`text`,value:I});continue}if(I===`(`){U(`parens`),G({type:`paren`,value:I});continue}if(I===`)`){if(j.parens===0&&f.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=M[M.length-1];if(e&&j.parens===e.parens+1){se(M.pop());continue}G({type:`paren`,value:I,output:j.parens?`)`:`\\)`}),W(`parens`);continue}if(I===`[`){if(f.nobracket===!0||!B().includes(`]`)){if(f.nobracket!==!0&&f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I=`\\${I}`}else U(`brackets`);G({type:`bracket`,value:I});continue}if(I===`]`){if(f.nobracket===!0||F&&F.type===`bracket`&&F.value.length===1){G({type:`text`,value:I,output:`\\${I}`});continue}if(j.brackets===0){if(f.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));G({type:`text`,value:I,output:`\\${I}`});continue}W(`brackets`);let e=F.value.slice(1);if(F.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(I=`/${I}`),F.value+=I,H({value:I}),f.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(F.value);if(j.output=j.output.slice(0,-F.value.length),f.literalBrackets===!0){j.output+=t,F.value=t;continue}F.value=`(${ee}${t}|${F.value})`,j.output+=F.value;continue}if(I===`{`&&f.nobrace!==!0){U(`braces`);let e={type:`brace`,value:I,output:`(`,outputIndex:j.output.length,tokensIndex:j.tokens.length};N.push(e),G(e);continue}if(I===`}`){let e=N[N.length-1];if(f.nobrace===!0||!e){G({type:`text`,value:I,output:I});continue}let t=`)`;if(e.dots===!0){let e=g.slice(),n=[];for(let t=e.length-1;t>=0&&(g.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,f),j.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=j.output.slice(0,e.outputIndex),r=j.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,I=t=`\\}`,j.output=n;for(let e of r)j.output+=e.output||e.value}G({type:`brace`,value:I,output:t}),W(`braces`),N.pop();continue}if(I===`|`){M.length>0&&M[M.length-1].conditions++,G({type:`text`,value:I});continue}if(I===`,`){let e=I,t=N[N.length-1];t&&P[P.length-1]===`braces`&&(t.comma=!0,e=`|`),G({type:`comma`,value:I,output:e});continue}if(I===`/`){if(F.type===`dot`&&j.index===j.start+1){j.start=j.index+1,j.consumed=``,j.output=``,g.pop(),F=h;continue}G({type:`slash`,value:I,output:b});continue}if(I===`.`){if(j.braces>0&&F.type===`dot`){F.value===`.`&&(F.output=y);let e=N[N.length-1];F.type=`dots`,F.output+=I,F.value+=I,e.dots=!0;continue}if(j.braces+j.parens===0&&F.type!==`bos`&&F.type!==`slash`){G({type:`text`,value:I,output:y});continue}G({type:`dot`,value:I,output:y});continue}if(I===`?`){if(!(F&&F.value===`(`)&&f.noextglob!==!0&&R()===`(`&&R(2)!==`?`){oe(`qmark`,I);continue}if(F&&F.type===`paren`){let e=R(),t=I;(F.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(B()))&&(t=`\\${I}`),G({type:`text`,value:I,output:t});continue}if(f.dot!==!0&&(F.type===`slash`||F.type===`bos`)){G({type:`qmark`,value:I,output:D});continue}G({type:`qmark`,value:I,output:E});continue}if(I===`!`){if(f.noextglob!==!0&&R()===`(`&&(R(2)!==`?`||!/[!=<:]/.test(R(3)))){oe(`negate`,I);continue}if(f.nonegate!==!0&&j.index===0){ae();continue}}if(I===`+`){if(f.noextglob!==!0&&R()===`(`&&R(2)!==`?`){oe(`plus`,I);continue}if(F&&F.value===`(`||f.regex===!1){G({type:`plus`,value:I,output:te});continue}if(F&&(F.type===`bracket`||F.type===`paren`||F.type===`brace`)||j.parens>0){G({type:`plus`,value:I});continue}G({type:`plus`,value:te});continue}if(I===`@`){if(f.noextglob!==!0&&R()===`(`&&R(2)!==`?`){G({type:`at`,extglob:!0,value:I,output:``});continue}G({type:`text`,value:I});continue}if(I!==`*`){(I===`$`||I===`^`)&&(I=`\\${I}`);let e=o.exec(B());e&&(I+=e[0],j.index+=e[0].length),G({type:`text`,value:I});continue}if(F&&(F.type===`globstar`||F.star===!0)){F.type=`star`,F.star=!0,F.value+=I,F.output=A,j.backtrack=!0,j.globstar=!0,V(I);continue}let t=B();if(f.noextglob!==!0&&/^\([^?]/.test(t)){oe(`star`,I);continue}if(F.type===`star`){if(f.noglobstar===!0){V(I);continue}let n=F.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(f.bash===!0&&(!i||t[0]&&t[0]!==`/`)){G({type:`star`,value:I,output:``});continue}let o=j.braces>0&&(n.type===`comma`||n.type===`brace`),s=M.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){G({type:`star`,value:I,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[j.index+4];if(n&&n!==`/`)break;t=t.slice(3),V(`/**`,3)}if(n.type===`bos`&&L()){F.type=`globstar`,F.value+=I,F.output=k(f),j.output=F.output,j.globstar=!0,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&L()){j.output=j.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=k(f)+(f.strictSlashes?`)`:`|$)`),F.value+=I,j.globstar=!0,j.output+=n.output+F.output,V(I);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;j.output=j.output.slice(0,-(n.output+F.output).length),n.output=`(?:${n.output}`,F.type=`globstar`,F.output=`${k(f)}${b}|${b}${e})`,F.value+=I,j.output+=n.output+F.output,j.globstar=!0,V(I+z()),G({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){F.type=`globstar`,F.value+=I,F.output=`(?:^|${b}|${k(f)}${b})`,j.output=F.output,j.globstar=!0,V(I+z()),G({type:`slash`,value:`/`,output:``});continue}j.output=j.output.slice(0,-F.output.length),F.type=`globstar`,F.output=k(f),F.value+=I,j.output+=F.output,j.globstar=!0,V(I);continue}let n={type:`star`,value:I,output:A};if(f.bash===!0){n.output=`.*?`,(F.type===`bos`||F.type===`slash`)&&(n.output=re+n.output),G(n);continue}if(F&&(F.type===`bracket`||F.type===`paren`)&&f.regex===!0){n.output=I,G(n);continue}(j.index===j.start||F.type===`slash`||F.type===`dot`)&&(F.type===`dot`?(j.output+=w,F.output+=w):f.dot===!0?(j.output+=T,F.output+=T):(j.output+=re,F.output+=re),R()!==`*`&&(j.output+=x,F.output+=x)),G(n)}for(;j.brackets>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));j.output=r.escapeLast(j.output,`[`),W(`brackets`)}for(;j.parens>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));j.output=r.escapeLast(j.output,`(`),W(`parens`)}for(;j.braces>0;){if(f.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));j.output=r.escapeLast(j.output,`{`),W(`braces`)}if(f.strictSlashes!==!0&&(F.type===`star`||F.type===`bracket`)&&G({type:`maybe_slash`,value:``,output:`${b}?`}),j.backtrack===!0){j.output=``;for(let e of j.tokens)j.output+=e.output==null?e.value:e.output,e.suffix&&(j.output+=e.suffix)}return j};d.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:ee}=n.globChars(a.windows),_=a.dot?m:p,v=a.dot?h:p,y=a.capture?``:`?:`,te={negated:!1,prefix:``},b=a.bash===!0?`.*?`:g;a.capture&&(b=`(${b})`);let x=e=>e.noglobstar===!0?b:`(${y}(?:(?!${ee}${e.dot?f:l}).)*?)`,S=e=>{switch(e){case`*`:return`${_}${d}${b}`;case`.*`:return`${l}${d}${b}`;case`*.*`:return`${_}${b}${l}${d}${b}`;case`*/*`:return`${_}${b}${u}${d}${v}${b}`;case`**`:return _+x(a);case`**/*`:return`(?:${_}${x(a)}${u})?${v}${d}${b}`;case`**/*.*`:return`(?:${_}${x(a)}${u})?${v}${b}${l}${d}${b}`;case`**/.*`:return`(?:${_}${x(a)}${u})?${l}${d}${b}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=S(t[1]);return n?n+l+t[2]:void 0}}},C=S(r.removePrefix(e,te));return C&&a.strictSlashes!==!0&&(C+=`${u}?`),C},t.exports=d})),vt=j(((e,t)=>{let n=gt(),r=_t(),i=ht(),a=mt(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),r?p:!0)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e)),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),yt=P(j(((e,t)=>{let n=vt(),r=ht();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);const bt=Array.isArray,xt=process.platform===`win32`,St=/^(\/?\.\.)+$/;function Ct(e,t={}){let n=e.length,r=Array(n),i=Array(n),a=!t.noglobstar;for(let a=0;a<n;a++){let n=kt(e[a]);r[a]=n;let o=n.length,s=Array(o);for(let e=0;e<o;e++)s[e]=(0,yt.default)(n[e],t);i[a]=s}return t=>{let n=t.split(`/`);if(n[0]===`..`&&St.test(t))return!0;for(let t=0;t<e.length;t++){let e=r[t],o=i[t],s=n.length,c=Math.min(s,e.length),l=0;for(;l<c;){let t=e[l];if(t.includes(`/`))return!0;if(!o[l](n[l]))break;if(a&&t===`**`)return!0;l++}if(l===s)return!0}return!1}}const wt=/^[A-Z]:\/$/i,Tt=xt?e=>wt.test(e):e=>e===`/`;function Et(e,t,n){if(e===t||t.startsWith(`${e}/`)){if(n){let t=Tt(e)?e.length:e.length+1;return(e,n)=>e.slice(t,n?-1:void 0)||`.`}let r=t.slice(e.length+1);return r?(e,t)=>{if(e===`.`)return r;let n=`${r}/${e}`;return t?n.slice(0,-1):n}:(e,t)=>t&&e!==`.`?e.slice(0,-1):e}return n?t=>m.relative(e,t)||`.`:n=>m.relative(e,`${t}/${n}`)||`.`}function Dt(e,t){if(t.startsWith(`${e}/`)){let n=t.slice(e.length+1);return e=>`${n}/${e}`}return n=>{let r=m.relative(e,`${t}/${n}`);return n.endsWith(`/`)&&r!==``?`${r}/`:r||`.`}}const Ot={parts:!0};function kt(e){let t=yt.default.scan(e,Ot);return t.parts?.length?t.parts:[e]}const At=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,jt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Mt=xt?e=>e.replace(jt,`\\$&`):e=>e.replace(At,`\\$&`);function Nt(e,t){if(t?.caseSensitiveMatch===!1)return!0;let n=yt.default.scan(e);return n.isGlob||n.negated}function Pt(...e){console.log(`[tinyglobby ${new Date().toLocaleTimeString(`es`)}]`,...e)}const Ft=/^(\/?\.\.)+/,It=/\\(?=[()[\]{}!*+?@|])/g,Lt=/\\/g;function Rt(e,t,n,r,i){let a=e;e.endsWith(`/`)&&(a=e.slice(0,-1)),!a.endsWith(`*`)&&t&&(a+=`/**`);let o=Mt(n);a=u.isAbsolute(a.replace(It,``))?m.relative(o,a):m.normalize(a);let s=Ft.exec(a),c=kt(a);if(s?.[0]){let e=(s[0].length+1)/3,t=0,i=o.split(`/`);for(;t<e&&c[t+e]===i[i.length+t-e];)a=a.slice(0,(e-t-1)*3)+a.slice((e-t)*3+c[t+e].length+1)||`.`,t++;let l=m.join(n,s[0].slice(t*3));!l.startsWith(`.`)&&r.root.length>l.length&&(r.root=l,r.depthOffset=-e+t)}if(!i&&r.depthOffset>=0){r.commonPath??=c;let e=[],t=Math.min(r.commonPath.length,c.length);for(let n=0;n<t;n++){let t=c[n];if(t===`**`&&!c[n+1]){e.pop();break}if(t!==r.commonPath[n]||Nt(t)||n===c.length-1)break;e.push(t)}r.depthOffset=e.length,r.commonPath=e,r.root=e.length>0?m.join(n,...e):n}return a}function zt({patterns:e=[`**/*`],ignore:t=[],expandDirectories:n=!0},r,i){typeof e==`string`&&(e=[e]),typeof t==`string`&&(t=[t]);let a=[],o=[];for(let e of t)e&&(e[0]!==`!`||e[1]===`(`)&&o.push(Rt(e,n,r,i,!0));for(let t of e)t&&(t[0]!==`!`||t[1]===`(`?a.push(Rt(t,n,r,i,!1)):(t[1]!==`!`||t[2]===`(`)&&o.push(Rt(t.slice(1),n,r,i,!0)));return{match:a,ignore:o}}function Bt(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];e[n]=t(r)}return e}function Vt(e){return e?e instanceof URL?_(e).replace(Lt,`/`):u.resolve(e).replace(Lt,`/`):process.cwd().replace(Lt,`/`)}function Ht(e,t={}){let n=process.env.TINYGLOBBY_DEBUG?{...t,debug:!0}:t,r=Vt(n.cwd);if(n.debug&&Pt(`globbing with:`,{patterns:e,options:n,cwd:r}),Array.isArray(e)&&e.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let i={root:r,commonPath:null,depthOffset:0},a=zt({...n,patterns:e},r,i);n.debug&&Pt(`internal processing patterns:`,a);let o={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},s=(0,yt.default)(a.match,{...o,ignore:a.ignore}),c=(0,yt.default)(a.ignore,o),u=Ct(a.match,o),d=Et(r,i.root,n.absolute),f=n.absolute?d:Et(r,i.root,!0),p={filters:[n.debug?(e,t)=>{let n=d(e,t),r=s(n);return r&&Pt(`matched ${n}`),r}:(e,t)=>s(d(e,t))],exclude:n.debug?(e,t)=>{let n=f(t,!0),r=n!==`.`&&!u(n)||c(n);return Pt(r?`skipped ${t}`:`crawling ${t}`),r}:(e,t)=>{let n=f(t,!0);return n!==`.`&&!u(n)||c(n)},fs:n.fs?{readdir:n.fs.readdir||l.readdir,readdirSync:n.fs.readdirSync||l.readdirSync,realpath:n.fs.realpath||l.realpath,realpathSync:n.fs.realpathSync||l.realpathSync,stat:n.fs.stat||l.stat,statSync:n.fs.statSync||l.statSync}:void 0,pathSeparator:`/`,relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(p.maxDepth=Math.round(n.deep-i.depthOffset)),n.absolute&&(p.relativePaths=!1,p.resolvePaths=!0,p.includeBasePath=!0),n.followSymbolicLinks===!1&&(p.resolveSymlinks=!1,p.excludeSymlinks=!0),n.onlyDirectories?(p.excludeFiles=!0,p.includeDirs=!0):n.onlyFiles===!1&&(p.includeDirs=!0),i.root=i.root.replace(Lt,``);let m=i.root;n.debug&&Pt(`internal properties:`,i);let h=r!==m&&!n.absolute&&Dt(r,i.root);return[new pt(p).crawl(m),h]}async function Ut(e,t){if(e&&t?.patterns)throw Error(`Cannot pass patterns as both an argument and an option`);let n=bt(e)||typeof e==`string`,r=n?t:e,[i,a]=Ht(n?e:e.patterns,r);return a?Bt(await i.withPromise(),a):i.withPromise()}Object.freeze({status:`aborted`});function K(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var Wt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const Gt={};function Kt(e){return e&&Object.assign(Gt,e),Gt}function qt(e,t){return typeof t==`bigint`?t.toString():t}function Jt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function Yt(e){return e==null}function Xt(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}const Zt=Symbol(`evaluating`);function q(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Zt)return r===void 0&&(r=Zt,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Qt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function $t(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const en=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function tn(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nn(e){if(tn(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(tn(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function rn(e){return nn(e)?{...e}:Array.isArray(e)?[...e]:e}function an(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function J(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function on(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function sn(e,t){if(!nn(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return an(e,$t(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Qt(this,`shape`,n),n}}))}function cn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ln(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function un(e){return typeof e==`string`?e:e?.message}function dn(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=un(e.inst?._zod.def?.error?.(e))??un(t?.error?.(e))??un(n.customError?.(e))??un(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function fn(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}const pn=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,qt,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},mn=K(`$ZodError`,pn),hn=K(`$ZodError`,pn,{Parent:Error}),gn=(e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Wt;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>dn(e,a,Kt())));throw en(t,i?.callee),t}return o.value})(hn),_n=(e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>dn(e,a,Kt())));throw en(t,i?.callee),t}return o.value})(hn),vn=(e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Wt;return a.issues.length?{success:!1,error:new(e??mn)(a.issues.map(e=>dn(e,i,Kt())))}:{success:!0,data:a.value}})(hn),yn=(e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>dn(e,i,Kt())))}:{success:!0,data:a.value}})(hn),bn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,xn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Sn=/^-?\d+(?:\.\d+)?$/,Cn=/^(?:true|false)$/i,wn=K(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tn=K(`$ZodCheckMinLength`,(e,t)=>{var n;wn.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Yt(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=fn(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),En=K(`$ZodCheckStringFormat`,(e,t)=>{var n,r;wn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Dn={major:4,minor:3,patch:6},Y=K(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Dn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=cn(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Wt;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=cn(e,t))});else{if(e.issues.length===t)continue;r||=cn(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(cn(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Wt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Wt;return o.then(e=>t(e,r,a))}return t(o,r,a)}}q(e,`~standard`,()=>({validate:t=>{try{let n=vn(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return yn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),On=K(`$ZodString`,(e,t)=>{Y.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??xn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),kn=K(`$ZodStringFormat`,(e,t)=>{En.init(e,t),On.init(e,t)}),An=K(`$ZodURL`,(e,t)=>{kn.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),jn=K(`$ZodNumber`,(e,t)=>{Y.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Mn=K(`$ZodBoolean`,(e,t)=>{Y.init(e,t),e._zod.pattern=Cn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}});function Nn(e,t,n){e.issues.length&&t.issues.push(...ln(n,e.issues)),t.value[n]=e.value}const Pn=K(`$ZodArray`,(e,t)=>{Y.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Nn(t,n,e))):Nn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Fn(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...ln(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function In(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=on(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ln(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout===`optional`;for(let i in t){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Fn(e,n,i,t,u))):Fn(a,n,i,t,u)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Rn=K(`$ZodObject`,(e,t)=>{if(Y.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=Jt(()=>In(t));q(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=tn,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optout===`optional`,i=n._zod.run({value:s[e],issues:[]},o);i instanceof Promise?c.push(i.then(n=>Fn(n,t,e,s,r))):Fn(i,t,e,s,r)}return i?Ln(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),zn=K(`$ZodRecord`,(e,t)=>{Y.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!nn(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){s.add(typeof e==`number`?e.toString():e);let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...ln(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...ln(e,o.issues)),n.value[e]=o.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Sn.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>dn(e,r,Kt())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...ln(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...ln(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}});function Bn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Vn=K(`$ZodOptional`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,q(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),q(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Xt(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Bn(t,e.value)):Bn(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hn=K(`$ZodNullable`,(e,t)=>{Y.init(e,t),q(e._zod,`optin`,()=>t.innerType._zod.optin),q(e._zod,`optout`,()=>t.innerType._zod.optout),q(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Xt(e.source)}|null)$`):void 0}),q(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Un=K(`$ZodDefault`,(e,t)=>{Y.init(e,t),e._zod.optin=`optional`,q(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Wn(e,t)):Wn(r,t)}});function Wn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Gn=K(`$ZodPipe`,(e,t)=>{Y.init(e,t),q(e._zod,`values`,()=>t.in._zod.values),q(e._zod,`optin`,()=>t.in._zod.optin),q(e._zod,`optout`,()=>t.out._zod.optout),q(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Kn(e,t.in,n)):Kn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Kn(e,t.out,n)):Kn(r,t.out,n)}});function Kn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const qn=K(`$ZodCodec`,(e,t)=>{Y.init(e,t),q(e._zod,`values`,()=>t.in._zod.values),q(e._zod,`optin`,()=>t.in._zod.optin),q(e._zod,`optout`,()=>t.out._zod.optout),q(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Jn(e,t,n)):Jn(r,t,n)}else{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Jn(e,t,n)):Jn(r,t,n)}}});function Jn(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Yn(e,r,t.out,n)):Yn(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Yn(e,r,t.in,n)):Yn(e,r,t.in,n)}}function Yn(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}var Xn,Zn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Qn(){return new Zn}(Xn=globalThis).__zod_globalRegistry??(Xn.__zod_globalRegistry=Qn()),globalThis.__zod_globalRegistry;function $n(e,t){return new e({type:`string`,...J(t)})}function er(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...J(t)})}function tr(e,t){return new e({type:`number`,checks:[],...J(t)})}function nr(e,t){return new e({type:`boolean`,...J(t)})}function rr(e,t){return new Tn({check:`min_length`,...J(t),minimum:e})}function ir(e,t){let n=J(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??qn,c=e.Boolean??Mn,l=new s({type:`pipe`,in:new(e.String??On)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:o.has(r)?!1:(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l}const X=K(`ZodMiniType`,(e,t)=>{if(!e._zod)throw Error(`Uninitialized schema in ZodMiniType.`);Y.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>gn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>vn(e,t,n),e.parseAsync=async(t,n)=>_n(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>yn(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]},{parent:!0}),e.with=e.check,e.clone=(t,n)=>an(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.apply=t=>t(e)}),ar=K(`ZodMiniString`,(e,t)=>{On.init(e,t),X.init(e,t)});function Z(e){return $n(ar,e)}const or=K(`ZodMiniStringFormat`,(e,t)=>{kn.init(e,t),ar.init(e,t)}),sr=K(`ZodMiniURL`,(e,t)=>{An.init(e,t),or.init(e,t)});function cr(e){return er(sr,e)}function lr(e){return er(sr,{protocol:/^https?$/,hostname:bn,...J(e)})}const ur=K(`ZodMiniNumber`,(e,t)=>{jn.init(e,t),X.init(e,t)});function dr(e){return tr(ur,e)}const fr=K(`ZodMiniBoolean`,(e,t)=>{Mn.init(e,t),X.init(e,t)});function pr(e){return nr(fr,e)}const mr=K(`ZodMiniArray`,(e,t)=>{Pn.init(e,t),X.init(e,t)});function hr(e,t){return new mr({type:`array`,element:e,...J(t)})}const gr=K(`ZodMiniObject`,(e,t)=>{Rn.init(e,t),X.init(e,t),q(e,`shape`,()=>t.shape)});function _r(e,t){return new gr({type:`object`,shape:e??{},...J(t)})}function vr(e,t){return sn(e,t)}const yr=K(`ZodMiniRecord`,(e,t)=>{zn.init(e,t),X.init(e,t)});function br(e,t,n){return new yr({type:`record`,keyType:e,valueType:t,...J(n)})}const xr=K(`ZodMiniOptional`,(e,t)=>{Vn.init(e,t),X.init(e,t)});function Q(e){return new xr({type:`optional`,innerType:e})}const Sr=K(`ZodMiniNullable`,(e,t)=>{Hn.init(e,t),X.init(e,t)});function Cr(e){return new Sr({type:`nullable`,innerType:e})}const wr=K(`ZodMiniDefault`,(e,t)=>{Un.init(e,t),X.init(e,t)});function Tr(e,t){return new wr({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():rn(t)}})}const Er=K(`ZodMiniPipe`,(e,t)=>{Gn.init(e,t),X.init(e,t)}),Dr=K(`ZodMiniCodec`,(e,t)=>{Er.init(e,t),qn.init(e,t)}),Or=(...e)=>ir({Codec:Dr,Boolean:fr,String:ar},...e);function kr(e){let t=new URL(e);return t.pathname.endsWith(`/`)||(t.pathname+=`/`),t}function Ar(e,t){return x(o(e),o(t))}async function jr(e,n={}){let{start:r=s(process.cwd()),stop:i}=n,a=kr(r);for(;;){let n=new URL(e,a);try{return await t(n),n}catch{}if(typeof i==`string`){let e=new URL(i,a);try{await t(e);return}catch{}}else if(i instanceof URL&&i.href===a.href)return;let r=new URL(`..`,a);if(r.href===a.href)return;a=r}}async function Mr(e){try{return await t(e),!0}catch{return!1}}async function Nr(e,t){await n(new URL(`.`,e),{recursive:!0}),await a(e,t)}async function Pr(e,t={}){let{schema:n}=t,i=await r(e,`utf8`),a=JSON.parse(i);return n?gn(n,a):a}function Fr(e){return JSON.stringify(e,null,2)}const Ir=/^(?:( )+|\t+)/,Lr=`space`;function Rr(e,t,n){return e&&t===Lr&&n===1}function zr(e,t){let n=new Map,r=0,i,a;for(let o of e.split(/\n/g)){if(!o)continue;let e=o.match(Ir);if(e===null)r=0,i=``;else{let o=e[0].length,s=e[1]?Lr:`tab`;if(Rr(t,s,o))continue;s!==i&&(r=0),i=s;let c=1,l=0,u=o-r;if(r=o,u===0)c=0,l=1;else{let e=Math.abs(u);if(Rr(t,s,e))continue;a=Br(s,e)}let d=n.get(a);n.set(a,d===void 0?[1,0]:[d[0]+c,d[1]+l])}}return n}function Br(e,t){return(e===Lr?`s`:`t`)+String(t)}function Vr(e){return{type:e[0]===`s`?Lr:`tab`,amount:Number(e.slice(1))}}function Hr(e){let t,n=0,r=0;for(let[i,[a,o]]of e)(a>n||a===n&&o>r)&&(n=a,r=o,t=i);return t}function Ur(e,t){return(e===Lr?` `:` `).repeat(t)}function Wr(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);let t=zr(e,!0);t.size===0&&(t=zr(e,!1));let n=Hr(t),r,i=0,a=``;return n!==void 0&&({type:r,amount:i}=Vr(n),a=Ur(r,i)),{amount:i,type:r,indent:a}}var Gr=Object.create,Kr=Object.defineProperty,qr=Object.getOwnPropertyDescriptor,Jr=Object.getOwnPropertyNames,Yr=Object.getPrototypeOf,Xr=Object.prototype.hasOwnProperty,$=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Zr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Jr(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Xr.call(e,s)&&s!==n&&Kr(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=qr(t,s))||r.enumerable});return e},Qr=(e,t,n)=>(n=e==null?{}:Gr(Yr(e)),Zr(t||!e||!e.__esModule?Kr(n,`default`,{value:e,enumerable:!0}):n,e)),$r=v(import.meta.url);const ei=/^path$/i,ti={key:`PATH`,value:``};function ni(e){for(let t in e){if(!Object.prototype.hasOwnProperty.call(e,t)||!ei.test(t))continue;let n=e[t];return n?{key:t,value:n}:ti}return ti}function ri(e,t){let n=t.value.split(y),r=e,i;do n.push(S(r,`node_modules`,`.bin`)),i=r,r=te(r);while(r!==i);return{key:t.key,value:n.join(y)}}function ii(e,t){let n={...process.env,...t},r=ri(e,ni(n));return n[r.key]=r.value,n}const ai=e=>{let t=e.length,n=new T,r=()=>{--t===0&&n.emit(`end`)};for(let t of e)t.pipe(n,{end:!1}),t.on(`end`,r);return n};var oi=$((e,t)=>{t.exports=a,a.sync=o;var n=$r(`fs`);function r(e,t){var n=t.pathExt===void 0?process.env.PATHEXT:t.pathExt;if(!n||(n=n.split(`;`),n.indexOf(``)!==-1))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function i(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:r(t,n)}function a(e,t,r){n.stat(e,function(n,a){r(n,n?!1:i(a,e,t))})}function o(e,t){return i(n.statSync(e),e,t)}}),si=$((e,t)=>{t.exports=r,r.sync=i;var n=$r(`fs`);function r(e,t,r){n.stat(e,function(e,n){r(e,e?!1:a(n,t))})}function i(e,t){return a(n.statSync(e),t)}function a(e,t){return e.isFile()&&o(e,t)}function o(e,t){var n=e.mode,r=e.uid,i=e.gid,a=t.uid===void 0?process.getuid&&process.getuid():t.uid,o=t.gid===void 0?process.getgid&&process.getgid():t.gid,s=64,c=8,l=1,u=s|c;return n&l||n&c&&i===o||n&s&&r===a||n&u&&a===0}}),ci=$((e,t)=>{$r(`fs`);var n=process.platform===`win32`||global.TESTING_WINDOWS?oi():si();t.exports=r,r.sync=i;function r(e,t,i){if(typeof t==`function`&&(i=t,t={}),!i){if(typeof Promise!=`function`)throw TypeError(`callback not provided`);return new Promise(function(n,i){r(e,t||{},function(e,t){e?i(e):n(t)})})}n(e,t||{},function(e,n){e&&(e.code===`EACCES`||t&&t.ignoreErrors)&&(e=null,n=!1),i(e,n)})}function i(e,t){try{return n.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code===`EACCES`)return!1;throw e}}}),li=$((e,t)=>{let n=process.platform===`win32`||process.env.OSTYPE===`cygwin`||process.env.OSTYPE===`msys`,r=$r(`path`),i=n?`;`:`:`,a=ci(),o=e=>Object.assign(Error(`not found: ${e}`),{code:`ENOENT`}),s=(e,t)=>{let r=t.colon||i,a=e.match(/\//)||n&&e.match(/\\/)?[``]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||``).split(r)],o=n?t.pathExt||process.env.PATHEXT||`.EXE;.CMD;.BAT;.COM`:``,s=n?o.split(r):[``];return n&&e.indexOf(`.`)!==-1&&s[0]!==``&&s.unshift(``),{pathEnv:a,pathExt:s,pathExtExe:o}},c=(e,t,n)=>{typeof t==`function`&&(n=t,t={}),t||={};let{pathEnv:i,pathExt:c,pathExtExe:l}=s(e,t),u=[],d=n=>new Promise((a,s)=>{if(n===i.length)return t.all&&u.length?a(u):s(o(e));let c=i[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,d=r.join(l,e);a(f(!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d,n,0))}),f=(e,n,r)=>new Promise((i,o)=>{if(r===c.length)return i(d(n+1));let s=c[r];a(e+s,{pathExt:l},(a,o)=>{if(!a&&o)if(t.all)u.push(e+s);else return i(e+s);return i(f(e,n,r+1))})});return n?d(0).then(e=>n(null,e),n):d(0)};t.exports=c,c.sync=(e,t)=>{t||={};let{pathEnv:n,pathExt:i,pathExtExe:c}=s(e,t),l=[];for(let o=0;o<n.length;o++){let s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,d=r.join(u,e),f=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;for(let e=0;e<i.length;e++){let n=f+i[e];try{if(a.sync(n,{pathExt:c}))if(t.all)l.push(n);else return n}catch{}}}if(t.all&&l.length)return l;if(t.nothrow)return null;throw o(e)}}),ui=$((e,t)=>{let n=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)===`win32`?Object.keys(t).reverse().find(e=>e.toUpperCase()===`PATH`)||`Path`:`PATH`};t.exports=n,t.exports.default=n}),di=$((e,t)=>{let n=$r(`path`),r=li(),i=ui();function a(e,t){let a=e.options.env||process.env,o=process.cwd(),s=e.options.cwd!=null,c=s&&process.chdir!==void 0&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch{}let l;try{l=r.sync(e.command,{path:a[i({env:a})],pathExt:t?n.delimiter:void 0})}catch{}finally{c&&process.chdir(o)}return l&&=n.resolve(s?e.options.cwd:``,l),l}function o(e){return a(e)||a(e,!0)}t.exports=o}),fi=$((e,t)=>{let n=/([()\][%!^"`<>&|;, *?])/g;function r(e){return e=e.replace(n,`^$1`),e}function i(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,`$1$1\\"`),e=e.replace(/(\\*)$/,`$1$1`),e=`"${e}"`,e=e.replace(n,`^$1`),t&&(e=e.replace(n,`^$1`)),e}t.exports.command=r,t.exports.argument=i}),pi=$((e,t)=>{t.exports=/^#!(.*)/}),mi=$((e,t)=>{let n=pi();t.exports=(e=``)=>{let t=e.match(n);if(!t)return null;let[r,i]=t[0].replace(/#! ?/,``).split(` `),a=r.split(`/`).pop();return a===`env`?i:i?`${a} ${i}`:a}}),hi=$((e,t)=>{let n=$r(`fs`),r=mi();function i(e){let t=Buffer.alloc(150),i;try{i=n.openSync(e,`r`),n.readSync(i,t,0,150,0),n.closeSync(i)}catch{}return r(t.toString())}t.exports=i}),gi=$((e,t)=>{let n=$r(`path`),r=di(),i=fi(),a=hi(),o=process.platform===`win32`,s=/\.(?:com|exe)$/i,c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function l(e){e.file=r(e);let t=e.file&&a(e.file);return t?(e.args.unshift(e.file),e.command=t,r(e)):e.file}function u(e){if(!o)return e;let t=l(e),r=!s.test(t);if(e.options.forceShell||r){let r=c.test(t);e.command=n.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map(e=>i.argument(e,r)),e.args=[`/d`,`/s`,`/c`,`"${[e.command].concat(e.args).join(` `)}"`],e.command=process.env.comspec||`cmd.exe`,e.options.windowsVerbatimArguments=!0}return e}function d(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:u(r)}t.exports=d}),_i=$((e,t)=>{let n=process.platform===`win32`;function r(e,t){return Object.assign(Error(`${t} ${e.command} ENOENT`),{code:`ENOENT`,errno:`ENOENT`,syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function i(e,t){if(!n)return;let r=e.emit;e.emit=function(n,i){if(n===`exit`){let n=a(i,t,`spawn`);if(n)return r.call(e,`error`,n)}return r.apply(e,arguments)}}function a(e,t){return n&&e===1&&!t.file?r(t.original,`spawn`):null}function o(e,t){return n&&e===1&&!t.file?r(t.original,`spawnSync`):null}t.exports={hookChildProcess:i,verifyENOENT:a,verifyENOENTSync:o,notFoundError:r}}),vi=Qr($((e,t)=>{let n=$r(`child_process`),r=gi(),i=_i();function a(e,t,a){let o=r(e,t,a),s=n.spawn(o.command,o.args,o.options);return i.hookChildProcess(s,o),s}function o(e,t,a){let o=r(e,t,a),s=n.spawnSync(o.command,o.args,o.options);return s.error=s.error||i.verifyENOENTSync(s.status,o),s}t.exports=a,t.exports.spawn=a,t.exports.sync=o,t.exports._parse=r,t.exports._enoent=i})(),1),yi=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(e,t){super(`Process exited with non-zero status (${e.exitCode})`),this.result=e,this.output=t}};const bi={timeout:void 0,persist:!1},xi={windowsHide:!0};function Si(e,t){return{command:b(e),args:t??[]}}function Ci(e){let t=new AbortController;for(let n of e){if(n.aborted)return t.abort(),n;n.addEventListener(`abort`,()=>{t.abort(n.reason)},{signal:t.signal})}return t.signal}async function wi(e){let t=``;for await(let n of e)t+=n.toString();return t}var Ti=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(e,t,n){this._options={...bi,...n},this._command=e,this._args=t??[],this._processClosed=new Promise(e=>{this._resolveClose=e})}kill(e){return this._process?.kill(e)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(e,t,n){return Di(e,t,{...n,stdin:this})}async*[Symbol.asyncIterator](){let e=this._process;if(!e)return;let t=[];this._streamErr&&t.push(this._streamErr),this._streamOut&&t.push(this._streamOut);let n=ai(t),r=E.createInterface({input:n});for await(let e of r)yield e.toString();if(await this._processClosed,e.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new yi(this)}async _waitForOutput(){let e=this._process;if(!e)throw Error(`No process was started`);let[t,n]=await Promise.all([this._streamOut?wi(this._streamOut):``,this._streamErr?wi(this._streamErr):``]);if(await this._processClosed,this._options?.stdin&&await this._options.stdin,e.removeAllListeners(),this._thrownError)throw this._thrownError;let r={stderr:n,stdout:t,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new yi(this,r);return r}then(e,t){return this._waitForOutput().then(e,t)}_streamOut;_streamErr;spawn(){let e=w(),t=this._options,n={...xi,...t.nodeOptions},r=[];this._resetState(),t.timeout!==void 0&&r.push(AbortSignal.timeout(t.timeout)),t.signal!==void 0&&r.push(t.signal),t.persist===!0&&(n.detached=!0),r.length>0&&(n.signal=Ci(r)),n.env=ii(e,n.env);let{command:i,args:a}=Si(this._command,this._args),o=(0,vi._parse)(i,a,n),s=C(o.command,o.args,o.options);if(s.stderr&&(this._streamErr=s.stderr),s.stdout&&(this._streamOut=s.stdout),this._process=s,s.once(`error`,this._onError),s.once(`close`,this._onClose),t.stdin!==void 0&&s.stdin&&t.stdin.process){let{stdout:e}=t.stdin.process;e&&e.pipe(s.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(e=>{this._resolveClose=e}),this._thrownError=void 0}_onError=e=>{if(e.name===`AbortError`&&(!(e.cause instanceof Error)||e.cause.name!==`TimeoutError`)){this._aborted=!0;return}this._thrownError=e};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const Ei=(e,t,n)=>{let r=new Ti(e,t,n);return r.spawn(),r},Di=Ei,Oi=_r({dependencies:Q(br(Z(),Z())),devDependencies:Q(br(Z(),Z())),peerDependencies:Q(br(Z(),Z())),packageManager:Q(Z())});async function ki(){return await Pr(await Ai(),{schema:Oi})}async function Ai(){let e=await jr(`package.json`);if(!e)throw new ji;return e}var ji=class extends Error{name=`MissingPackageJson`;message=`Could not find a package.json file.`};async function Mi(e){let t=await Ai(),n=await r(t,`utf8`),i=Wr(n).indent||` `,o=JSON.parse(n);o.dependencies=Object.fromEntries(Object.entries({...o.dependencies,...e}).sort(([e],[t])=>e.localeCompare(t))),await a(t,JSON.stringify(o,null,i)+`
|
|
2
|
+
`)}async function Ni(e,t=`latest`){let n=new URL(`${e}/${t}`,`https://registry.npmjs.org/`),{version:r}=await(await fetch(n)).json();return r}const Pi={npm:[`npm`,`install`],yarn:[`yarn`,`install`],pnpm:[`pnpm`,`install`],bun:[`bun`,`install`]};async function Fi(){let e=await Ai(),t=new URL(`.`,e),[n,...r]=Pi[await Li()];await Ei(n,r,{nodeOptions:{cwd:o(t),stdio:`inherit`},throwOnError:!0})}const Ii={"bun.lock":`bun`,"bun.lockb":`bun`,"pnpm-lock.yaml":`pnpm`,"yarn.lock":`yarn`,"package-lock.json":`npm`};async function Li(){let e=await Ri();if(e)return e;let t=await Ai();for(let e in Ii){let n=Ii[e];if(await Mr(new URL(e,t)))return n}return`npm`}async function Ri(){try{let e=await ki();if(!e.packageManager)return;let t=e.packageManager.split(`@`)[0];return t in Pi?t:void 0}catch{return}}const zi=`prismic.config.json`,Bi=`slicemachine.config.json`,Vi=_r({repositoryName:Z(),documentAPIEndpoint:Q(cr()),libraries:Q(hr(Z())),routes:Q(hr(_r({type:Z(),path:Z(),uid:Q(Z()),lang:Q(Z()),resolvers:Q(br(Z(),Z()))})))}),Hi=_r({repositoryName:Z(),libraries:Q(hr(Z()))});async function Ui(e){let t=await Yi();return await a(t,Fr(e)),t}async function Wi(){let e=await qi();try{let t=await r(e,`utf8`);return gn(Vi,JSON.parse(t))}catch(e){throw e instanceof mn?new Gi(e.issues):new Gi}}var Gi=class extends Error{name=`InvalidPrismicConfig`;message=`${zi} is invalid.`;issues;constructor(e=[]){super(),this.issues=e}};async function Ki(e){let t=await qi(),n={...await Wi(),...e};return await a(t,Fr(n)),n}async function qi(){let e=await jr(zi,{stop:`package.json`});if(!e)throw new Ji;return e}var Ji=class extends Error{name=`MissingPrismicConfig`;message=`Could not find a ${zi} file.`};async function Yi(){try{let e=await Ai();return new URL(zi,e)}catch(e){throw e instanceof ji?new Xi(void 0,{cause:e}):e}}var Xi=class extends Error{name=`UnknownProjectRoot`};async function Zi(e){let{routes:t=[]}=await Wi();if(t.some(t=>t.type===e.id))return;let n=ea(e),r={type:e.id,path:n};await Ki({routes:[...t,r].sort((e,t)=>e.type.localeCompare(t.type))})}async function Qi(e){if(e.format===`page`){let{routes:t=[]}=await Wi();if(t.some(t=>t.type===e.id))return;await Zi(e)}else await $i(e.id)}async function $i(e){let{routes:t=[]}=await Wi(),n=t.filter(t=>t.type!==e);t.length!==n.length&&await Ki({routes:n})}function ea(e){let{id:t,repeatable:n}=e,r=t.replaceAll(`_`,`-`).toLowerCase();return n?t===`page`?`/:uid`:`/${r}/:uid`:t===`homepage`?`/`:`/${r}`}async function ta(){let e=await ia();try{let t=await r(e,`utf8`);return gn(Hi,JSON.parse(t))}catch(e){throw e instanceof mn?new na(e.issues):new na}}var na=class extends Error{name=`InvalidLegacySliceMachineConfig`;message=`${Bi} is invalid.`;issues;constructor(e=[]){super(),this.issues=e}};async function ra(){await i(await ia())}async function ia(){let e=await jr(Bi,{stop:`package.json`});if(!e)throw new aa;return e}var aa=class extends Error{name=`MissingLegacySliceMachineConfig`;message=`Could not find a ${Bi} file.`};async function oa(){let e;try{e=await qi()}catch(t){if(t instanceof Ji)e=await Yi();else throw t}return new URL(`.`,e)}async function sa(){try{return await ca()}catch{return}}async function ca(){return(await Wi()).repositoryName}async function la(){let e=(await Wi()).libraries;if(!e||e.length<1)return;let t=await oa();return e.map(e=>kr(new URL(e.replace(/^\//,``),t)))}async function ua(){let e=await oa();return await Mr(new URL(`tsconfig.json`,e))}async function da(){let{dependencies:e,devDependencies:t,peerDependencies:n}=await ki(),r={...e,...t,...n};if(`next`in r){let{NextJsAdapter:e}=await import(`./nextjs-c8JOjFCt.mjs`);return new e}if(`nuxt`in r){let{NuxtAdapter:e}=await import(`./nuxt-BhwnOusi.mjs`);return new e}if(`@sveltejs/kit`in r){let{SvelteKitAdapter:e}=await import(`./sveltekit-BW5_-HtZ.mjs`);return new e}throw new fa}var fa=class extends Error{message=`No supported framework found (Next.js, Nuxt, or SvelteKit required)`},pa=class{async initProject(){let e=await this.getSliceLibraries();for(let t of e)await this.createSliceIndexFile(t);await this.setupProject(),await this.onProjectInitialized()}async getSliceLibraries(){return await la()||[await this.getDefaultSliceLibrary()]}async getSlices(){let e=[],t=await this.getSliceLibraries();for(let n of t){let t=new URL(`*/model.json`,n),r=Array.from(await Ut(o(t),{absolute:!0}),e=>s(e)),i=await Promise.all(r.map(async e=>({library:n,directory:new URL(`.`,e),model:await Pr(e)})));e.push(...i)}return e.sort((e,t)=>e.model.id.toLowerCase().localeCompare(t.model.id.toLowerCase()))}async getSlice(e){let t=(await this.getSlices()).find(t=>t.model.id===e);if(!t)throw Error(`No slice found with ID: ${e}`);return t}async createSlice(e,t){t??=await this.getDefaultSliceLibrary(),await ma(e,t),await this.createSliceIndexFile(t),await this.onSliceCreated(e,t)}async updateSlice(e){await ma(e,(await this.getSlice(e.id)).library),await this.onSliceUpdated(e)}async deleteSlice(e){let t=await this.getSlice(e);await i(t.directory,{recursive:!0}),await this.createSliceIndexFile(t.library),await this.onSliceDeleted(e)}async getCustomTypes(){let e=await oa(),t=new URL(`customtypes/`,e),n=new URL(`*/index.json`,t),r=Array.from(await Ut(o(n),{absolute:!0}),e=>s(e));return(await Promise.all(r.map(async e=>({directory:new URL(`.`,e),model:await Pr(e)})))).sort((e,t)=>e.model.id.toLowerCase().localeCompare(t.model.id.toLowerCase()))}async getCustomType(e){let t=(await this.getCustomTypes()).find(t=>t.model.id===e);if(!t)throw Error(`No custom type found with ID: ${e}`);return t}async createCustomType(e){await ha(e),e.format===`page`&&await Zi(e),await this.onCustomTypeCreated(e)}async updateCustomType(e){await ha(e),await Qi(e),await this.onCustomTypeUpdated(e)}async deleteCustomType(e){await i((await this.getCustomType(e)).directory,{recursive:!0}),await $i(e),await this.onCustomTypeDeleted(e)}};async function ma(e,t){let n=U(e.name),r=new URL(n,kr(t));await Nr(new URL(`model.json`,kr(r)),Fr(e))}async function ha(e){let t=await oa(),n=new URL(`customtypes/`,t);await Nr(new URL(`${e.id}/index.json`,n),Fr(e))}function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _a(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ga(Object(n),!0).forEach(function(t){va(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function va(e,t,n){return t=ya(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ya(e){var t=ba(e,`string`);return typeof t==`symbol`?t:String(t)}function ba(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var xa=Sa({});function Sa(e){return t.withOptions=t=>Sa(_a(_a({},e),t)),t;function t(t,...n){let r=typeof t==`string`?[t]:t.raw,{alignValues:i=!1,escapeSpecialCharacters:a=Array.isArray(t),trimWhitespace:o=!0}=e,s=``;for(let e=0;e<r.length;e++){let t=r[e];if(a&&(t=t.replace(/\\\n[ \t]*/g,``).replace(/\\`/g,"`").replace(/\\\$/g,`$`).replace(/\\\{/g,`{`)),s+=t,e<n.length){let t=i?Ca(n[e],s):n[e];s+=t}}let c=s.split(`
|
|
3
|
+
`),l=null;for(let e of c){let t=e.match(/^(\s+)\S+/);if(t){let e=t[1].length;l=l?Math.min(l,e):e}}if(l!==null){let e=l;s=c.map(t=>t[0]===` `||t[0]===` `?t.slice(e):t).join(`
|
|
4
|
+
`)}return o&&(s=s.trim()),a&&(s=s.replace(/\\n/g,`
|
|
5
|
+
`).replace(/\\t/g,` `).replace(/\\r/g,`\r`).replace(/\\v/g,`\v`).replace(/\\b/g,`\b`).replace(/\\f/g,`\f`).replace(/\\0/g,`\0`).replace(/\\x([\da-fA-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/\\u([\da-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))),typeof Bun<`u`&&(s=s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,(e,t,n)=>{let r=t??n??``;return String.fromCodePoint(parseInt(r,16))})),s}}function Ca(e,t){if(typeof e!=`string`||!e.includes(`
|
|
6
|
+
`))return e;let n=t.slice(t.lastIndexOf(`
|
|
7
|
+
`)+1).match(/^(\s+)/);if(n){let t=n[1];return e.replace(/\n/g,`\n${t}`)}return e}const wa=xa.withOptions({alignValues:!0});export{pr as A,rr as B,Fr as C,Ar as D,kr as E,_r as F,M as G,U as H,Q as I,P as J,I as K,br as L,lr as M,Cr as N,Tr as O,dr as P,Z as R,Fi as S,Nr as T,j as U,gn as V,A as W,ta as _,ua as a,Ai as b,sa as c,Ji as d,Xi as f,Wi as g,ra as h,da as i,vr as j,hr as k,na as l,Ui as m,pa as n,oa as o,ea as p,F as q,fa as r,ca as s,wa as t,Gi as u,Ki as v,Mr as w,Ni as x,Mi as y,Or as z};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import{E as e,H as t,T as n,a as r,b as i,n as a,o,p as s,t as c,w as l,x as u,y as d}from"./string-CFNpwnbk.mjs";import{n as f}from"./builders-hKD4IrLX-CiOmsZQP.mjs";import{createRequire as p}from"node:module";import{writeFile as m}from"node:fs/promises";import{fileURLToPath as h}from"node:url";import{relative as g}from"node:path";function _(e){let{typescript:t}=e;return t?c`
|
|
2
|
+
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
3
|
+
import { type CreateClientConfig, enableAutoPreviews } from '@prismicio/svelte/kit';
|
|
4
|
+
import prismicConfig from "../../prismic.config.json";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The project's Prismic repository name.
|
|
8
|
+
*/
|
|
9
|
+
export const repositoryName = prismicConfig.repositoryName;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Creates a Prismic client for the project's repository. The client is used to
|
|
13
|
+
* query content from the Prismic API.
|
|
14
|
+
*
|
|
15
|
+
* @param config - Configuration for the Prismic client.
|
|
16
|
+
*/
|
|
17
|
+
export const createClient = ({ cookies, ...config }: CreateClientConfig = {}) => {
|
|
18
|
+
const client = baseCreateClient(repositoryName, {
|
|
19
|
+
routes: prismicConfig.routes,
|
|
20
|
+
...config,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
enableAutoPreviews({ client, cookies });
|
|
24
|
+
|
|
25
|
+
return client;
|
|
26
|
+
};
|
|
27
|
+
`:c`
|
|
28
|
+
import { createClient as baseCreateClient } from "@prismicio/client";
|
|
29
|
+
import { enableAutoPreviews } from '@prismicio/svelte/kit';
|
|
30
|
+
import prismicConfig from "../../prismic.config.json";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The project's Prismic repository name.
|
|
34
|
+
*/
|
|
35
|
+
export const repositoryName = prismicConfig.repositoryName;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Creates a Prismic client for the project's repository. The client is used to
|
|
39
|
+
* query content from the Prismic API.
|
|
40
|
+
*
|
|
41
|
+
* @param {import('@prismicio/svelte/kit').CreateClientConfig} config - Configuration for the Prismic client.
|
|
42
|
+
*/
|
|
43
|
+
export const createClient = ({ cookies, ...config } = {}) => {
|
|
44
|
+
const client = baseCreateClient(repositoryName, {
|
|
45
|
+
routes: prismicConfig.routes,
|
|
46
|
+
...config,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
enableAutoPreviews({ client, cookies });
|
|
50
|
+
|
|
51
|
+
return client;
|
|
52
|
+
};
|
|
53
|
+
`}function v(e){let{version:t}=e,n=c`
|
|
54
|
+
<script>
|
|
55
|
+
import { SliceSimulator, SliceZone } from '@prismicio/svelte';
|
|
56
|
+
import { components } from '$lib/slices';
|
|
57
|
+
<\/script>
|
|
58
|
+
|
|
59
|
+
<!-- Slot syntax is used for backward compatibility with Svelte <=4. -->
|
|
60
|
+
<SliceSimulator let:slices>
|
|
61
|
+
<SliceZone {slices} {components} />
|
|
62
|
+
</SliceSimulator>
|
|
63
|
+
`,r=c`
|
|
64
|
+
<script>
|
|
65
|
+
import { SliceSimulator, SliceZone } from '@prismicio/svelte';
|
|
66
|
+
import { components } from '$lib/slices';
|
|
67
|
+
<\/script>
|
|
68
|
+
|
|
69
|
+
<SliceSimulator let:slices>
|
|
70
|
+
<SliceZone {slices} {components} />
|
|
71
|
+
</SliceSimulator>
|
|
72
|
+
`;return t<=4?r:n}function y(e){let{typescript:t}=e;return t?c`
|
|
73
|
+
import { redirectToPreviewURL } from '@prismicio/svelte/kit';
|
|
74
|
+
import { createClient } from '$lib/prismicio';
|
|
75
|
+
import type { RequestHandler } from "./$types";
|
|
76
|
+
|
|
77
|
+
export const GET: RequestHandler = async ({ fetch, request, cookies }) => {
|
|
78
|
+
const client = createClient({ fetch });
|
|
79
|
+
|
|
80
|
+
return await redirectToPreviewURL({ client, request, cookies });
|
|
81
|
+
}
|
|
82
|
+
`:c`
|
|
83
|
+
import { redirectToPreviewURL } from '@prismicio/svelte/kit';
|
|
84
|
+
import { createClient } from '$lib/prismicio';
|
|
85
|
+
|
|
86
|
+
/* @type {import("./$types").RequestHandler} */
|
|
87
|
+
export async function GET({ fetch, request, cookies }) {
|
|
88
|
+
const client = createClient({ fetch });
|
|
89
|
+
|
|
90
|
+
return await redirectToPreviewURL({ client, request, cookies });
|
|
91
|
+
}
|
|
92
|
+
`}function b(e){let{version:t}=e,n=c`
|
|
93
|
+
<script>
|
|
94
|
+
import { isFilled, asImageSrc } from '@prismicio/client';
|
|
95
|
+
import { PrismicPreview } from '@prismicio/svelte/kit';
|
|
96
|
+
import { page } from '$app/state';
|
|
97
|
+
import { repositoryName } from '$lib/prismicio';
|
|
98
|
+
|
|
99
|
+
const { children } = $props();
|
|
100
|
+
<\/script>
|
|
101
|
+
|
|
102
|
+
<svelte:head>
|
|
103
|
+
<title>{page.data.page?.data.meta_title}</title>
|
|
104
|
+
<meta property="og:title" content={page.data.page?.data.meta_title} />
|
|
105
|
+
{#if isFilled.keyText(page.data.page?.data.meta_description)}
|
|
106
|
+
<meta name="description" content={page.data.page.data.meta_description} />
|
|
107
|
+
<meta property="og:description" content={page.data.page.data.meta_description} />
|
|
108
|
+
{/if}
|
|
109
|
+
{#if isFilled.image(page.data.page?.data.meta_image)}
|
|
110
|
+
<meta property="og:image" content={asImageSrc(page.data.page.data.meta_image)} />
|
|
111
|
+
{/if}
|
|
112
|
+
</svelte:head>
|
|
113
|
+
{@render children()}
|
|
114
|
+
<PrismicPreview {repositoryName} />
|
|
115
|
+
`,r=c`
|
|
116
|
+
<script>
|
|
117
|
+
import { isFilled, asImageSrc } from '@prismicio/client';
|
|
118
|
+
import { PrismicPreview } from '@prismicio/svelte/kit';
|
|
119
|
+
import { page } from '$app/state';
|
|
120
|
+
import { repositoryName } from '$lib/prismicio';
|
|
121
|
+
<\/script>
|
|
122
|
+
|
|
123
|
+
<svelte:head>
|
|
124
|
+
<title>{page.data.page?.data.meta_title}</title>
|
|
125
|
+
<meta property="og:title" content={page.data.page?.data.meta_title} />
|
|
126
|
+
{#if isFilled.keyText(page.data.page?.data.meta_description)}
|
|
127
|
+
<meta name="description" content={page.data.page.data.meta_description} />
|
|
128
|
+
<meta property="og:description" content={page.data.page.data.meta_description} />
|
|
129
|
+
{/if}
|
|
130
|
+
{#if isFilled.image(page.data.page?.data.meta_image)}
|
|
131
|
+
<meta property="og:image" content={asImageSrc(page.data.page.data.meta_image)} />
|
|
132
|
+
{/if}
|
|
133
|
+
</svelte:head>
|
|
134
|
+
<slot />
|
|
135
|
+
<PrismicPreview {repositoryName} />
|
|
136
|
+
`;return t<=4?r:n}function x(e){let{typescript:t}=e;return t?c`
|
|
137
|
+
<script lang="ts">
|
|
138
|
+
import { SliceZone } from "@prismicio/svelte";
|
|
139
|
+
import { components } from "$lib/slices";
|
|
140
|
+
import type { PageProps } from "./$types";
|
|
141
|
+
|
|
142
|
+
const { data }: PageProps = $props();
|
|
143
|
+
<\/script>
|
|
144
|
+
|
|
145
|
+
<SliceZone slices={data.page.data.slices} {components} />
|
|
146
|
+
`:c`
|
|
147
|
+
<script>
|
|
148
|
+
import { SliceZone } from "@prismicio/svelte";
|
|
149
|
+
import { components } from "$lib/slices";
|
|
150
|
+
|
|
151
|
+
const { data } = $props();
|
|
152
|
+
<\/script>
|
|
153
|
+
|
|
154
|
+
<SliceZone slices={data.page.data.slices} {components} />
|
|
155
|
+
`}function S(e){let{model:t,typescript:n}=e;return t.repeatable?n?c`
|
|
156
|
+
import type { PageServerLoad } from "./$types";
|
|
157
|
+
import { createClient } from "$lib/prismicio";
|
|
158
|
+
|
|
159
|
+
export const load: PageServerLoad = async ({ params, fetch, cookies }) => {
|
|
160
|
+
const client = createClient({ fetch, cookies });
|
|
161
|
+
const page = await client.getByUID("${t.id}", params.uid);
|
|
162
|
+
|
|
163
|
+
return { page };
|
|
164
|
+
};
|
|
165
|
+
`:c`
|
|
166
|
+
import { createClient } from "$lib/prismicio";
|
|
167
|
+
|
|
168
|
+
/** @type {import("./$types").PageServerLoad} */
|
|
169
|
+
export async function load({ params, fetch, cookies }) {
|
|
170
|
+
const client = createClient({ fetch, cookies });
|
|
171
|
+
const page = await client.getByUID("${t.id}", params.uid);
|
|
172
|
+
|
|
173
|
+
return { page };
|
|
174
|
+
}
|
|
175
|
+
`:n?c`
|
|
176
|
+
import type { PageServerLoad } from "./$types";
|
|
177
|
+
import { createClient } from "$lib/prismicio";
|
|
178
|
+
|
|
179
|
+
export const load: PageServerLoad = async ({ fetch, cookies }) => {
|
|
180
|
+
const client = createClient({ fetch, cookies });
|
|
181
|
+
const page = await client.getSingle("${t.id}");
|
|
182
|
+
|
|
183
|
+
return { page };
|
|
184
|
+
};
|
|
185
|
+
`:c`
|
|
186
|
+
import { createClient } from "$lib/prismicio";
|
|
187
|
+
|
|
188
|
+
/* @type {import("./$types").PageServerLoad} */
|
|
189
|
+
export async function load({ fetch, cookies }) {
|
|
190
|
+
const client = createClient({ fetch, cookies });
|
|
191
|
+
const page = await client.getSingle("${t.id}");
|
|
192
|
+
|
|
193
|
+
return { page };
|
|
194
|
+
}
|
|
195
|
+
`}const C=c`
|
|
196
|
+
<section data-slice-type={slice.slice_type} data-slice-variation={slice.variation}>
|
|
197
|
+
Placeholder component for {slice.slice_type} (variation: {slice.variation}) slices.
|
|
198
|
+
<br />
|
|
199
|
+
<strong>You can edit this slice directly in your code editor.</strong>
|
|
200
|
+
</section>
|
|
201
|
+
`;function w(e){let{name:n,typescript:r,version:i}=e,a=t(n),o=c`
|
|
202
|
+
<script lang="ts">
|
|
203
|
+
import type { Content } from '@prismicio/client';
|
|
204
|
+
import type { SliceComponentProps } from '@prismicio/svelte';
|
|
205
|
+
|
|
206
|
+
type Props = SliceComponentProps<Content.${a}Slice>;
|
|
207
|
+
|
|
208
|
+
const { slice }: Props = $props();
|
|
209
|
+
<\/script>
|
|
210
|
+
|
|
211
|
+
${C}
|
|
212
|
+
`,s=c`
|
|
213
|
+
<script>
|
|
214
|
+
/* @typedef {import("@prismicio/client").Content} Content */
|
|
215
|
+
/* @typedef {import("@prismicio/svelte").SliceComponentProps} SliceComponentProps */
|
|
216
|
+
|
|
217
|
+
/* @type {SliceComponentProps<Content.${a}Slice>} */
|
|
218
|
+
const { slice } = $props();
|
|
219
|
+
<\/script>
|
|
220
|
+
|
|
221
|
+
${C}
|
|
222
|
+
`,l=c`
|
|
223
|
+
<script lang="ts">
|
|
224
|
+
import type { Content } from '@prismicio/client';
|
|
225
|
+
|
|
226
|
+
export let slice: Content.${a}Slice;
|
|
227
|
+
<\/script>
|
|
228
|
+
|
|
229
|
+
${C}
|
|
230
|
+
`,u=c`
|
|
231
|
+
<script>
|
|
232
|
+
/** @type {import("@prismicio/client").Content.${a}Slice} */
|
|
233
|
+
export let slice;
|
|
234
|
+
<\/script>
|
|
235
|
+
|
|
236
|
+
${C}
|
|
237
|
+
`;return r?i<=4?l:o:i<=4?u:s}var T=class extends a{id=`sveltekit`;async setupProject(){await d({"@prismicio/client":`^${await u(`@prismicio/client`)}`,"@prismicio/svelte":`^${await u(`@prismicio/svelte`)}`}),await E(),await D(),await O(),await k(),await A(),await j(),await M(),await P()}onProjectInitialized(){}async onSliceCreated(i,a){let o=t(i.name),s=new URL(o,e(a));await n(new URL(`index.svelte`,e(s)),w({name:i.name,typescript:await r(),version:await I()}))}onSliceUpdated(){}onSliceDeleted(){}async onCustomTypeCreated(e){e.format===`page`&&await N(e)}onCustomTypeUpdated(){}onCustomTypeDeleted(){}async createSliceIndexFile(e){let r=(await this.getSlices()).filter(t=>t.library.href===e.href),i=r.map(n=>`import ${t(n.model.name)} from "./${g(h(e),h(n.directory))}/index.svelte";`),a=r.map(e=>{let n=t(e.model.name);return`${e.model.id}: ${n}`}),o=c`
|
|
238
|
+
// Code generated by Prismic. DO NOT EDIT.
|
|
239
|
+
|
|
240
|
+
${i.join(`
|
|
241
|
+
`)}
|
|
242
|
+
|
|
243
|
+
export const components = {
|
|
244
|
+
${a.join(`,
|
|
245
|
+
`)}
|
|
246
|
+
};
|
|
247
|
+
`,s=`index.${await F()}`;await n(new URL(s,e),o)}async getDefaultSliceLibrary(){let e=await o();return new URL(`src/lib/slices/`,e)}};async function E(){let e=await F(),t=await o(),i=new URL(`src/lib/prismicio.${e}`,t);await l(i)||await n(i,_({typescript:await r()}))}async function D(){let e=await o(),t=new URL(`src/routes/slice-simulator/+page.svelte`,e);await l(t)||await n(t,v({version:await I()}))}async function O(){let e=await F(),t=await o(),r=new URL(`src/params/preview.${e}`,t);await l(r)||await n(r,c`
|
|
248
|
+
export function match(param) {
|
|
249
|
+
return param === 'preview';
|
|
250
|
+
}
|
|
251
|
+
`)}async function k(){let e=await F(),t=await o(),i=new URL(`src/routes/api/preview/+server.${e}`,t);await l(i)||await n(i,y({typescript:await r()}))}async function A(){let e=await o(),t=new URL(`src/routes/[[preview=preview]]/README.md`,e);await l(t)||await n(t,c`
|
|
252
|
+
This directory adds support for optional \`/preview\` routes. Do not remove this directory.
|
|
253
|
+
|
|
254
|
+
All routes within this directory will be served using the following URLs:
|
|
255
|
+
|
|
256
|
+
- \`/example-route\` (prerendered)
|
|
257
|
+
- \`/preview/example-route\` (server-rendered)
|
|
258
|
+
|
|
259
|
+
See <https://prismic.io/docs/svelte-preview> for more information.
|
|
260
|
+
`)}async function j(){let e=await F(),t=await o(),r=new URL(`src/routes/+layout.server.${e}`,t);await l(r)||await n(r,c`
|
|
261
|
+
export const prerender = "auto";
|
|
262
|
+
`)}async function M(){let e=await o(),t=new URL(`src/routes/+layout.svelte`,e);await l(t)||await n(t,b({version:await I()}))}async function N(e){let t=s(e).split(`/`).filter(Boolean).map(e=>e.startsWith(`:`)?`[${e.slice(1)}]`:e).join(`/`),i=await o(),a=await F(),c=new URL(`src/routes/[[preview=preview]]/${t}/`,i),u=new URL(`+page.svelte`,c);await l(u)||await n(u,x({typescript:await r()}));let d=new URL(`+page.server.${a}`,c);await l(d)||await n(d,S({model:e,typescript:await r()}))}async function P(){let e=await o(),t=new URL(`vite.config.js`,e);if(await l(t)||(t=new URL(`vite.config.ts`,e)),!await l(t))return;let n=t.pathname,r=await f(n);if(r.exports.default.$type!==`function-call`)return;let i=r.exports.default.$args[0];i.server??={},i.server.fs??={},i.server.fs.allow??=[],i.server.fs.allow.includes(`./prismic.config.json`)||i.server.fs.allow.push(`./prismic.config.json`);let a=r.generate().code.replace(/\n\s*\n(?=\s*server:)/,`
|
|
263
|
+
`);await m(t,a)}async function F(){return await r()?`ts`:`js`}async function I(){let{version:e}=p(await i())(`svelte/package.json`),t=Number.parseInt(e.split(`.`)[0]);return Number.isNaN(t)?1/0:t}export{T as SvelteKitAdapter};
|
package/package.json
CHANGED
package/src/adapters/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { rm } from "node:fs/promises";
|
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
6
|
import { glob } from "tinyglobby";
|
|
7
7
|
|
|
8
|
+
import { addRoute, removeRoute, updateRoute } from "../config";
|
|
8
9
|
import { readJsonFile, writeFileRecursive } from "../lib/file";
|
|
9
10
|
import { stringify } from "../lib/json";
|
|
10
11
|
import { readPackageJson } from "../lib/packageJson";
|
|
@@ -47,6 +48,7 @@ export abstract class Adapter {
|
|
|
47
48
|
abstract onCustomTypeUpdated(model: CustomType): Promise<void> | void;
|
|
48
49
|
abstract onCustomTypeDeleted(id: string): Promise<void> | void;
|
|
49
50
|
|
|
51
|
+
abstract setupProject(): Promise<void>;
|
|
50
52
|
abstract createSliceIndexFile(library: URL): Promise<void>;
|
|
51
53
|
abstract getDefaultSliceLibrary(): Promise<URL>;
|
|
52
54
|
|
|
@@ -55,6 +57,7 @@ export abstract class Adapter {
|
|
|
55
57
|
for (const library of libraries) {
|
|
56
58
|
await this.createSliceIndexFile(library);
|
|
57
59
|
}
|
|
60
|
+
await this.setupProject();
|
|
58
61
|
await this.onProjectInitialized();
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -148,17 +151,20 @@ export abstract class Adapter {
|
|
|
148
151
|
|
|
149
152
|
async createCustomType(model: CustomType): Promise<void> {
|
|
150
153
|
await upsertCustomTypeModel(model);
|
|
154
|
+
if (model.format === "page") await addRoute(model);
|
|
151
155
|
await this.onCustomTypeCreated(model);
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
async updateCustomType(model: CustomType): Promise<void> {
|
|
155
159
|
await upsertCustomTypeModel(model);
|
|
160
|
+
await updateRoute(model);
|
|
156
161
|
await this.onCustomTypeUpdated(model);
|
|
157
162
|
}
|
|
158
163
|
|
|
159
164
|
async deleteCustomType(id: string): Promise<void> {
|
|
160
165
|
const customType = await this.getCustomType(id);
|
|
161
166
|
await rm(customType.directory, { recursive: true });
|
|
167
|
+
await removeRoute(id);
|
|
162
168
|
await this.onCustomTypeDeleted(id);
|
|
163
169
|
}
|
|
164
170
|
}
|