@storecraft/dashboard 1.0.0 → 1.0.1
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/lib/index.cjs +2 -2
- package/dist/lib/index.js +2 -3
- package/dist/lib/index.umd.cjs +2 -2
- package/dist/website/a.html +12 -5
- package/dist/website/assets/index-YfK3rjdH.js +801 -0
- package/dist/website/index.html +1 -1
- package/dist/website/index2.mjs +67697 -0
- package/package.json +3 -2
package/dist/lib/index.cjs
CHANGED
@@ -140,7 +140,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An err
|
|
140
140
|
text-gray-600 dark:text-gray-400
|
141
141
|
text-base font-semibold tracking-tight`,loading:c,onClick:d,...l})}):null},Yn=({from:t,to:e,rounded:n="rounded-lg",stroke:r="border-2",children:i,text:s="what",className:a="h-10",btnClassName:o="",...l})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:a,children:f.jsx("button",{className:`h-full w-full align-middle text-center px-3
|
142
142
|
rounded-md shelf-button-color-soft
|
143
|
-
whitespace-nowrap ${o}`,children:i??s,...l})}),pR=({from:t,to:e,rounded:n="rounded-lg",stroke:r,...i})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:"w-fit h-fit",children:f.jsx(fR,{...i})}),sf=({Icon:t,from:e="#973cff",to:n="rgb(236 72 153)",...r})=>{const i=btoa(`gradient_${e}_${n}`);return f.jsxs(f.Fragment,{children:[f.jsx("svg",{width:"0",height:"0",className:"absolute",children:f.jsxs("linearGradient",{id:i,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[f.jsx("stop",{stopColor:e,offset:"0%"}),f.jsx("stop",{stopColor:n,offset:"100%"})]})}),f.jsx(t,{style:{fill:`url(#${i})`},...r})]})},WT="3.7.7",mR=WT,cu=typeof Buffer=="function",u8=typeof TextDecoder=="function"?new TextDecoder:void 0,d8=typeof TextEncoder=="function"?new TextEncoder:void 0,gR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c1=Array.prototype.slice.call(gR),Kf=(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(c1),vR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,wn=String.fromCharCode.bind(String),f8=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),YT=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),GT=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),KT=t=>{let e,n,r,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((n=t.charCodeAt(o++))>255||(r=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|r<<8|i,s+=c1[e>>18&63]+c1[e>>12&63]+c1[e>>6&63]+c1[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},iy=typeof btoa=="function"?t=>btoa(t):cu?t=>Buffer.from(t,"binary").toString("base64"):KT,_4=cu?t=>Buffer.from(t).toString("base64"):t=>{let n=[];for(let r=0,i=t.length;r<i;r+=4096)n.push(wn.apply(null,t.subarray(r,r+4096)));return iy(n.join(""))},rp=(t,e=!1)=>e?YT(_4(t)):_4(t),yR=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?wn(192|e>>>6)+wn(128|e&63):wn(224|e>>>12&15)+wn(128|e>>>6&63)+wn(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return wn(240|e>>>18&7)+wn(128|e>>>12&63)+wn(128|e>>>6&63)+wn(128|e&63)}},xR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,qT=t=>t.replace(xR,yR),h8=cu?t=>Buffer.from(t,"utf8").toString("base64"):d8?t=>_4(d8.encode(t)):t=>iy(qT(t)),Nc=(t,e=!1)=>e?YT(h8(t)):h8(t),p8=t=>Nc(t,!0),_R=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,bR=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return wn((n>>>10)+55296)+wn((n&1023)+56320);case 3:return wn((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return wn((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},QT=t=>t.replace(_R,bR),XT=t=>{if(t=t.replace(/\s+/g,""),!vR.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",r,i;for(let s=0;s<t.length;)e=Kf[t.charAt(s++)]<<18|Kf[t.charAt(s++)]<<12|(r=Kf[t.charAt(s++)])<<6|(i=Kf[t.charAt(s++)]),n+=r===64?wn(e>>16&255):i===64?wn(e>>16&255,e>>8&255):wn(e>>16&255,e>>8&255,e&255);return n},sy=typeof atob=="function"?t=>atob(GT(t)):cu?t=>Buffer.from(t,"base64").toString("binary"):XT,ZT=cu?t=>f8(Buffer.from(t,"base64")):t=>f8(sy(t).split("").map(e=>e.charCodeAt(0))),JT=t=>ZT(eC(t)),wR=cu?t=>Buffer.from(t,"base64").toString("utf8"):u8?t=>u8.decode(ZT(t)):t=>QT(sy(t)),eC=t=>GT(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),b4=t=>wR(eC(t)),ER=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},tC=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),nC=function(){const t=(e,n)=>Object.defineProperty(String.prototype,e,tC(n));t("fromBase64",function(){return b4(this)}),t("toBase64",function(e){return Nc(this,e)}),t("toBase64URI",function(){return Nc(this,!0)}),t("toBase64URL",function(){return Nc(this,!0)}),t("toUint8Array",function(){return JT(this)})},rC=function(){const t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,tC(n));t("toBase64",function(e){return rp(this,e)}),t("toBase64URI",function(){return rp(this,!0)}),t("toBase64URL",function(){return rp(this,!0)})},kR=()=>{nC(),rC()},TR={version:WT,VERSION:mR,atob:sy,atobPolyfill:XT,btoa:iy,btoaPolyfill:KT,fromBase64:b4,toBase64:Nc,encode:Nc,encodeURI:p8,encodeURL:p8,utob:qT,btou:QT,decode:b4,isValid:ER,fromUint8Array:rp,toUint8Array:JT,extendString:nC,extendUint8Array:rC,extendBuiltins:kR},m8=t=>t.toLowerCase().split(" ").join("-"),w4=async()=>{let t;try{t=await navigator.clipboard.readText(),console.log("Content read from clipboard: ",t)}catch(e){console.error("Failed to read: ",e)}return t},E4=async t=>{try{await navigator.clipboard.writeText(t),console.log("Content copied to clipboard")}catch(e){console.error("Failed to copy: ",e)}},iC=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,CR=t=>JSON.parse(TR.decode(decodeURIComponent(t)));var ay=Nn.GenIcon,SR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.00488 4C2.00488 3.44772 2.4526 3 3.00488 3H21.0049C21.5572 3 22.0049 3.44772 22.0049 4V9.5C20.6242 9.5 19.5049 10.6193 19.5049 12C19.5049 13.3807 20.6242 14.5 22.0049 14.5V20C22.0049 20.5523 21.5572 21 21.0049 21H3.00488C2.4526 21 2.00488 20.5523 2.00488 20V4ZM8.09024 19C8.29615 18.4174 8.85177 18 9.50488 18C10.158 18 10.7136 18.4174 10.9195 19H20.0049V16.0322C18.5232 15.2959 17.5049 13.7669 17.5049 12C17.5049 10.2331 18.5232 8.70411 20.0049 7.96776V5H10.9195C10.7136 5.5826 10.158 6 9.50488 6C8.85177 6 8.29615 5.5826 8.09024 5H4.00488V19H8.09024ZM9.50488 11C8.67646 11 8.00488 10.3284 8.00488 9.5C8.00488 8.67157 8.67646 8 9.50488 8C10.3333 8 11.0049 8.67157 11.0049 9.5C11.0049 10.3284 10.3333 11 9.50488 11ZM9.50488 16C8.67646 16 8.00488 15.3284 8.00488 14.5C8.00488 13.6716 8.67646 13 9.50488 13C10.3333 13 11.0049 13.6716 11.0049 14.5C11.0049 15.3284 10.3333 16 9.50488 16Z"}}]})(e)},NR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 13C18.3221 13 16.7514 13.4592 15.4068 14.2587C16.5908 15.6438 17.5269 17.2471 18.1465 19H20V13ZM16.0037 19C14.0446 14.3021 9.4079 11 4 11V19H16.0037ZM4 9C7.82914 9 11.3232 10.4348 13.9738 12.7961C15.7047 11.6605 17.7752 11 20 11V3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H6V1H8V5H4V9ZM18 1V5H10V3H16V1H18ZM16.5 10C15.6716 10 15 9.32843 15 8.5C15 7.67157 15.6716 7 16.5 7C17.3284 7 18 7.67157 18 8.5C18 9.32843 17.3284 10 16.5 10Z"}}]})(e)},AR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(e)},k0=Nn.GenIcon,DR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},OR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"16"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},MR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"}},{tag:"polyline",attr:{points:"7 3 7 8 15 8"}}]})(e)},PR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(e)};const IR="@storecraft/dashboard",LR="1.0.0",RR="Storecraft Official Dashboard",jR="MIT",FR="Tomer Shalev (https://github.com/store-craft)",BR="https://github.com/store-craft/storecraft",HR={type:"git",url:"https://github.com/store-craft/storecraft.git",directory:"packages/dashboard"},zR=["commerce","dashboard","react","storecraft"],UR="module",$R="./src/index.jsx",VR={".":{import:"./dist/lib/index.js",require:"./dist/lib/index.umd.cjs",types:"./dist/lib/src/index.d.ts"}},WR={start:"npm run dashboard:dev","dashboard:dev":"vite","dashboard:build":"vite build && npm run dashboard:lib:build","dashboard:lib:build":"vite build -c vite.lib.config.js","dashboard:lint":"eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0","dashboard:preview":"vite preview","dashboard:publish":"npm publish --access public","dashboard:analyze":"npx vite-bundle-visualizer -c vite.lib.config.js",prepublishOnly:"npm run dashboard:build"},YR={"@storecraft/core":"^1.0.0","@storecraft/sdk":"^0.1.0","@storecraft/sdk-react-hooks":"^0.1.0","@uiw/react-md-editor":"^3.18.1","@monaco-editor/react":"^4.6.0","monaco-editor":"^0.48.0","chart.js":"^4.2.0",handlebars:"^4.7.8","js-base64":"^3.7.5",marked:"^5.0.2",react:"18.2.0","react-datepicker":"^4.10.0","react-dom":"18.2.0","react-drag-drop-container":"^6.1.1","react-icons":"^4.9.0","react-image-crop":"^10.0.7","react-inspector":"^6.0.1","react-router-dom":"^6.14.1"},GR={"@types/react":"^18.2.66","@types/react-datepicker":"^6.2.0","@types/react-dom":"^18.2.22","@types/react-image-crop":"^8.1.6","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-flexbugs-fixes":"^5.0.2","postcss-import":"^14.1.0","postcss-preset-env":"^7.7.2",sass:"^1.58.3","tailwind-scrollbar":"^2.1.0",tailwindcss:"^3.4.3",vite:"^5.2.0","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-dts":"^3.9.1"},KR=["dist"],qR={name:IR,private:"false",version:LR,description:RR,license:jR,author:FR,homepage:BR,repository:HR,keywords:zR,type:UR,module:$R,exports:VR,scripts:WR,dependencies:YR,devDependencies:GR,files:KR},QR=({...t})=>{const e=({})=>f.jsxs("div",{className:`rounded-lg my-auto b
|
143
|
+
whitespace-nowrap ${o}`,children:i??s,...l})}),pR=({from:t,to:e,rounded:n="rounded-lg",stroke:r,...i})=>f.jsx(lt,{from:t,to:e,rounded:n,stroke:r,className:"w-fit h-fit",children:f.jsx(fR,{...i})}),sf=({Icon:t,from:e="#973cff",to:n="rgb(236 72 153)",...r})=>{const i=btoa(`gradient_${e}_${n}`);return f.jsxs(f.Fragment,{children:[f.jsx("svg",{width:"0",height:"0",className:"absolute",children:f.jsxs("linearGradient",{id:i,x1:"100%",y1:"100%",x2:"0%",y2:"0%",children:[f.jsx("stop",{stopColor:e,offset:"0%"}),f.jsx("stop",{stopColor:n,offset:"100%"})]})}),f.jsx(t,{style:{fill:`url(#${i})`},...r})]})},WT="3.7.7",mR=WT,cu=typeof Buffer=="function",u8=typeof TextDecoder=="function"?new TextDecoder:void 0,d8=typeof TextEncoder=="function"?new TextEncoder:void 0,gR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c1=Array.prototype.slice.call(gR),Kf=(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(c1),vR=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,wn=String.fromCharCode.bind(String),f8=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),YT=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),GT=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),KT=t=>{let e,n,r,i,s="";const a=t.length%3;for(let o=0;o<t.length;){if((n=t.charCodeAt(o++))>255||(r=t.charCodeAt(o++))>255||(i=t.charCodeAt(o++))>255)throw new TypeError("invalid character found");e=n<<16|r<<8|i,s+=c1[e>>18&63]+c1[e>>12&63]+c1[e>>6&63]+c1[e&63]}return a?s.slice(0,a-3)+"===".substring(a):s},iy=typeof btoa=="function"?t=>btoa(t):cu?t=>Buffer.from(t,"binary").toString("base64"):KT,_4=cu?t=>Buffer.from(t).toString("base64"):t=>{let n=[];for(let r=0,i=t.length;r<i;r+=4096)n.push(wn.apply(null,t.subarray(r,r+4096)));return iy(n.join(""))},rp=(t,e=!1)=>e?YT(_4(t)):_4(t),yR=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?wn(192|e>>>6)+wn(128|e&63):wn(224|e>>>12&15)+wn(128|e>>>6&63)+wn(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return wn(240|e>>>18&7)+wn(128|e>>>12&63)+wn(128|e>>>6&63)+wn(128|e&63)}},xR=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,qT=t=>t.replace(xR,yR),h8=cu?t=>Buffer.from(t,"utf8").toString("base64"):d8?t=>_4(d8.encode(t)):t=>iy(qT(t)),Nc=(t,e=!1)=>e?YT(h8(t)):h8(t),p8=t=>Nc(t,!0),_R=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,bR=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),n=e-65536;return wn((n>>>10)+55296)+wn((n&1023)+56320);case 3:return wn((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return wn((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},QT=t=>t.replace(_R,bR),XT=t=>{if(t=t.replace(/\s+/g,""),!vR.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,n="",r,i;for(let s=0;s<t.length;)e=Kf[t.charAt(s++)]<<18|Kf[t.charAt(s++)]<<12|(r=Kf[t.charAt(s++)])<<6|(i=Kf[t.charAt(s++)]),n+=r===64?wn(e>>16&255):i===64?wn(e>>16&255,e>>8&255):wn(e>>16&255,e>>8&255,e&255);return n},sy=typeof atob=="function"?t=>atob(GT(t)):cu?t=>Buffer.from(t,"base64").toString("binary"):XT,ZT=cu?t=>f8(Buffer.from(t,"base64")):t=>f8(sy(t).split("").map(e=>e.charCodeAt(0))),JT=t=>ZT(eC(t)),wR=cu?t=>Buffer.from(t,"base64").toString("utf8"):u8?t=>u8.decode(ZT(t)):t=>QT(sy(t)),eC=t=>GT(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),b4=t=>wR(eC(t)),ER=t=>{if(typeof t!="string")return!1;const e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},tC=t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),nC=function(){const t=(e,n)=>Object.defineProperty(String.prototype,e,tC(n));t("fromBase64",function(){return b4(this)}),t("toBase64",function(e){return Nc(this,e)}),t("toBase64URI",function(){return Nc(this,!0)}),t("toBase64URL",function(){return Nc(this,!0)}),t("toUint8Array",function(){return JT(this)})},rC=function(){const t=(e,n)=>Object.defineProperty(Uint8Array.prototype,e,tC(n));t("toBase64",function(e){return rp(this,e)}),t("toBase64URI",function(){return rp(this,!0)}),t("toBase64URL",function(){return rp(this,!0)})},kR=()=>{nC(),rC()},TR={version:WT,VERSION:mR,atob:sy,atobPolyfill:XT,btoa:iy,btoaPolyfill:KT,fromBase64:b4,toBase64:Nc,encode:Nc,encodeURI:p8,encodeURL:p8,utob:qT,btou:QT,decode:b4,isValid:ER,fromUint8Array:rp,toUint8Array:JT,extendString:nC,extendUint8Array:rC,extendBuiltins:kR},m8=t=>t.toLowerCase().split(" ").join("-"),w4=async()=>{let t;try{t=await navigator.clipboard.readText(),console.log("Content read from clipboard: ",t)}catch(e){console.error("Failed to read: ",e)}return t},E4=async t=>{try{await navigator.clipboard.writeText(t),console.log("Content copied to clipboard")}catch(e){console.error("Failed to copy: ",e)}},iC=()=>"maxTouchPoints"in navigator?navigator.maxTouchPoints>0:!1,CR=t=>JSON.parse(TR.decode(decodeURIComponent(t)));var ay=Nn.GenIcon,SR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M2.00488 4C2.00488 3.44772 2.4526 3 3.00488 3H21.0049C21.5572 3 22.0049 3.44772 22.0049 4V9.5C20.6242 9.5 19.5049 10.6193 19.5049 12C19.5049 13.3807 20.6242 14.5 22.0049 14.5V20C22.0049 20.5523 21.5572 21 21.0049 21H3.00488C2.4526 21 2.00488 20.5523 2.00488 20V4ZM8.09024 19C8.29615 18.4174 8.85177 18 9.50488 18C10.158 18 10.7136 18.4174 10.9195 19H20.0049V16.0322C18.5232 15.2959 17.5049 13.7669 17.5049 12C17.5049 10.2331 18.5232 8.70411 20.0049 7.96776V5H10.9195C10.7136 5.5826 10.158 6 9.50488 6C8.85177 6 8.29615 5.5826 8.09024 5H4.00488V19H8.09024ZM9.50488 11C8.67646 11 8.00488 10.3284 8.00488 9.5C8.00488 8.67157 8.67646 8 9.50488 8C10.3333 8 11.0049 8.67157 11.0049 9.5C11.0049 10.3284 10.3333 11 9.50488 11ZM9.50488 16C8.67646 16 8.00488 15.3284 8.00488 14.5C8.00488 13.6716 8.67646 13 9.50488 13C10.3333 13 11.0049 13.6716 11.0049 14.5C11.0049 15.3284 10.3333 16 9.50488 16Z"}}]})(e)},NR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M20 13C18.3221 13 16.7514 13.4592 15.4068 14.2587C16.5908 15.6438 17.5269 17.2471 18.1465 19H20V13ZM16.0037 19C14.0446 14.3021 9.4079 11 4 11V19H16.0037ZM4 9C7.82914 9 11.3232 10.4348 13.9738 12.7961C15.7047 11.6605 17.7752 11 20 11V3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H6V1H8V5H4V9ZM18 1V5H10V3H16V1H18ZM16.5 10C15.6716 10 15 9.32843 15 8.5C15 7.67157 15.6716 7 16.5 7C17.3284 7 18 7.67157 18 8.5C18 9.32843 17.3284 10 16.5 10Z"}}]})(e)},AR=function(e){return ay({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M3 13H11V3H3V13ZM3 21H11V15H3V21ZM13 21H21V11H13V21ZM13 3V9H21V3H13Z"}}]})(e)},k0=Nn.GenIcon,DR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},OR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"}},{tag:"line",attr:{x1:"12",y1:"8",x2:"12",y2:"16"}},{tag:"line",attr:{x1:"8",y1:"12",x2:"16",y2:"12"}}]})(e)},MR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z"}},{tag:"polyline",attr:{points:"17 21 17 13 7 13 7 21"}},{tag:"polyline",attr:{points:"7 3 7 8 15 8"}}]})(e)},PR=function(e){return k0({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"}},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"}}]})(e)};const IR="@storecraft/dashboard",LR="1.0.1",RR="Storecraft Official Dashboard",jR="MIT",FR="Tomer Shalev (https://github.com/store-craft)",BR="https://github.com/store-craft/storecraft",HR={type:"git",url:"https://github.com/store-craft/storecraft.git",directory:"packages/dashboard"},zR=["commerce","dashboard","react","storecraft"],UR="module",$R="./src/index.jsx",VR={".":{import:"./dist/lib/index.js",require:"./dist/lib/index.umd.cjs",types:"./dist/lib/src/index.d.ts"}},WR={start:"npm run dashboard:dev","dashboard:dev":"vite","dashboard:build":"vite build && npm run dashboard:lib:build","dashboard:lib:build":"vite build -c vite.lib.config.js","dashboard:lint":"eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0","dashboard:preview":"vite preview","dashboard:publish":"npm publish --access public","dashboard:analyze":"npx vite-bundle-visualizer -c vite.lib.config.js",prepublishOnly:"npm run dashboard:build"},YR={"@storecraft/core":"^1.0.0","@storecraft/sdk":"^0.1.0","@storecraft/sdk-react-hooks":"^0.1.0","@uiw/react-md-editor":"^3.18.1","@monaco-editor/react":"^4.6.0","monaco-editor":"^0.48.0","chart.js":"^4.2.0",handlebars:"^4.7.8","js-base64":"^3.7.5",marked:"^5.0.2",react:"18.2.0","react-datepicker":"^4.10.0","react-dom":"18.2.0","react-drag-drop-container":"^6.1.1","react-icons":"^4.9.0","react-image-crop":"^10.0.7","react-inspector":"^6.0.1","react-router-dom":"^6.14.1"},GR={"@types/react":"^18.2.66","@types/react-datepicker":"^6.2.0","@types/react-dom":"^18.2.22","@types/react-image-crop":"^8.1.6","@vitejs/plugin-react":"^4.2.1",autoprefixer:"^10.4.19",eslint:"^8.57.0","eslint-plugin-react":"^7.34.1","eslint-plugin-react-hooks":"^4.6.0","eslint-plugin-react-refresh":"^0.4.6",postcss:"^8.4.38","postcss-flexbugs-fixes":"^5.0.2","postcss-import":"^14.1.0","postcss-preset-env":"^7.7.2",sass:"^1.58.3","tailwind-scrollbar":"^2.1.0",tailwindcss:"^3.4.3",vite:"^5.2.0","vite-plugin-css-injected-by-js":"^3.5.1","vite-plugin-dts":"^3.9.1"},KR=["dist"],qR={name:IR,version:LR,description:RR,license:jR,author:FR,homepage:BR,repository:HR,keywords:zR,type:UR,module:$R,exports:VR,scripts:WR,dependencies:YR,devDependencies:GR,files:KR},QR=({...t})=>{const e=({})=>f.jsxs("div",{className:`rounded-lg my-auto b
|
144
144
|
bg-pink-50 dark:bg-pink-50/10 w-fit text-sm
|
145
145
|
text-pink-500 -tracking-wideset
|
146
146
|
py-0 px-1 --border font-semibold`,children:[f.jsx("div",{children:"docs",className:"inline-block -translate-y-px --inline"}),f.jsx("span",{children:" 📖"})]});return f.jsxs("div",{className:`relative w-full h-16 flex flex-row
|
@@ -170,7 +170,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An err
|
|
170
170
|
`+l+` |
|
171
171
|
`+s.line+" | "+c+`
|
172
172
|
`+l+" | "+Ug("",i.column-1," ")+Ug("",d,"^")}else e+=`
|
173
|
-
at `+a}return e};Vc.buildMessage=function(t,e){var n={literal:function(c){return'"'+i(c.text)+'"'},class:function(c){var u=c.parts.map(function(d){return Array.isArray(d)?s(d[0])+"-"+s(d[1]):s(d)});return"["+(c.inverted?"^":"")+u.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function r(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(c){return n[c.type](c)}function o(c){var u=c.map(a),d,h;if(u.sort(),u.length>0){for(d=1,h=1;d<u.length;d++)u[d-1]!==u[d]&&(u[h]=u[d],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+o(t)+" but "+l(e)+" found."};function sj(t,e){e=e!==void 0?e:{};var n={},r=e.grammarSource,i={expression:zn},s=zn,a="|",o="-",l="(",c=")",u="'",d='"',h=/^[^"' ()|&]/,p=/^[^']/,m=/^[^"]/,g=/^[ ]/,v=je("expression"),y=je("sum term"),x=gn("|",!1),_=je("product term"),w=gn("&",!1),T=je("subexpression"),S=gn("-",!1),E=je("term"),N=gn("(",!1),O=gn(")",!1),A=je("variable"),j=Zn(['"',"'"," ","(",")","|","&"],!0,!1),$=je("variable 1"),K=gn("'",!1),J=Zn(["'"],!0,!1),B=gn('"',!1),U=Zn(['"'],!0,!1),Y=je("whitespace character(s)"),L=Zn([" "],!1,!1),z=function(W,te){return v8("|",W,te)},D=function(W,te){return v8("&",W,te)},G=function(W){return{op:"!",args:[W]}},X=function(W){return W.group=!0,W},P=function(W){return{op:"LEAF",value:zr().trim()}},ie=function(W){return{op:"LEAF",value:zr().trim().slice(1,-1)}},V=0,ce=0,Ae=[{line:1,column:1}],_e=0,Ne=[],ge=0,Wt;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');s=i[e.startRule]}function zr(){return t.substring(ce,V)}function gn(W,te){return{type:"literal",text:W,ignoreCase:te}}function Zn(W,te,ue){return{type:"class",parts:W,inverted:te,ignoreCase:ue}}function qi(){return{type:"end"}}function je(W){return{type:"other",description:W}}function Ur(W){var te=Ae[W],ue;if(te)return te;for(ue=W-1;!Ae[ue];)ue--;for(te=Ae[ue],te={line:te.line,column:te.column};ue<W;)t.charCodeAt(ue)===10?(te.line++,te.column=1):te.column++,ue++;return Ae[W]=te,te}function vn(W,te,ue){var et=Ur(W),Xe=Ur(te),yi={source:r,start:{offset:W,line:et.line,column:et.column},end:{offset:te,line:Xe.line,column:Xe.column}};return yi}function ze(W){V<_e||(V>_e&&(_e=V,Ne=[]),Ne.push(W))}function Hn(W,te,ue){return new Vc(Vc.buildMessage(W,te),W,te,ue)}function zn(){var W;return ge++,W=Mo(),ge--,W===n&&ge===0&&ze(v),W}function Mo(){var W,te,ue,et;return ge++,W=V,te=ya(),te!==n?(t.charCodeAt(V)===124?(ue=a,V++):(ue=n,ge===0&&ze(x)),ue!==n?(et=Mo(),et!==n?(ce=W,W=z(te,et)):(V=W,W=n)):(V=W,W=n)):(V=W,W=n),W===n&&(W=ya()),ge--,W===n&&(te=n,ge===0&&ze(y)),W}function ya(){var W,te,ue;return ge++,W=V,te=xa(),te!==n?(t.charCodeAt(V)===38?V++:ge===0&&ze(w),ue=ya(),ue!==n?(ce=W,W=D(te,ue)):(V=W,W=n)):(V=W,W=n),W===n&&(W=xa()),ge--,W===n&&(te=n,ge===0&&ze(_)),W}function xa(){var W,te,ue;return ge++,W=V,ne(),t.charCodeAt(V)===45?(te=o,V++):(te=n,ge===0&&ze(S)),te!==n?(ue=Po(),ue!==n?(ne(),ce=W,W=G(ue)):(V=W,W=n)):(V=W,W=n),W===n&&(W=Po()),ge--,W===n&&ge===0&&ze(T),W}function Po(){var W,te,ue,et;return ge++,W=q(),W===n&&(W=Hl()),W===n&&(W=V,ne(),t.charCodeAt(V)===40?(te=l,V++):(te=n,ge===0&&ze(N)),te!==n?(ue=zn(),ue!==n?(t.charCodeAt(V)===41?(et=c,V++):(et=n,ge===0&&ze(O)),et!==n?(ne(),ce=W,W=X(ue)):(V=W,W=n)):(V=W,W=n)):(V=W,W=n)),ge--,W===n&&ge===0&&ze(E),W}function Hl(){var W,te,ue;if(ge++,W=V,ne(),te=[],h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ge===0&&ze(j)),ue!==n)for(;ue!==n;)te.push(ue),h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ge===0&&ze(j));else te=n;return te!==n?(ue=ne(),ce=W,W=P()):(V=W,W=n),ge--,W===n&&ge===0&&ze(A),W}function q(){var W,te,ue,et,Xe;if(ge++,W=V,ne(),te=V,t.charCodeAt(V)===39?(ue=u,V++):(ue=n,ge===0&&ze(K)),ue!==n){if(et=[],p.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(J)),Xe!==n)for(;Xe!==n;)et.push(Xe),p.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(J));else et=n;et!==n?(t.charCodeAt(V)===39?(Xe=u,V++):(Xe=n,ge===0&&ze(K)),Xe!==n?(ue=[ue,et,Xe],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;if(te===n)if(te=V,t.charCodeAt(V)===34?(ue=d,V++):(ue=n,ge===0&&ze(B)),ue!==n){if(et=[],m.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(U)),Xe!==n)for(;Xe!==n;)et.push(Xe),m.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(U));else et=n;et!==n?(t.charCodeAt(V)===34?(Xe=d,V++):(Xe=n,ge===0&&ze(B)),Xe!==n?(ue=[ue,et,Xe],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;return te!==n?(ue=ne(),ce=W,W=ie()):(V=W,W=n),ge--,W===n&&ge===0&&ze($),W}function ne(){var W,te;for(ge++,W=[],g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ge===0&&ze(L));te!==n;)W.push(te),g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ge===0&&ze(L));return ge--,te=n,ge===0&&ze(Y),W}if(Wt=s(),Wt!==n&&V===t.length)return Wt;throw Wt!==n&&V<t.length&&ze(qi()),Hn(Ne,_e<t.length?t.charAt(_e):null,_e<t.length?vn(_e,_e+1):vn(_e,_e))}const aj=new Uint8Array(3);crypto.getRandomValues(aj);class oj extends Error{constructor(e,n=400){super(JSON.stringify(e,null,2)),this.code=n,this.message=e;try{this.message_string=JSON.stringify(this.message,null,2)}catch{this.message_string=":("}}toString(){return this.message_string}}const qf=(t,e,n=400)=>{if(!t)throw new oj([{message:e}],n)},lj=(t,e="-")=>{if(typeof t!="string")return;let n=t.trim();if(n!==""&&(n=n.toLowerCase().match(/[\p{L}\d]+/gu).join(e),n.length!=0))return n},sC="sortBy",aC="order",k4="limit",T4="limitToLast",C4="vql",oC="startAt",lC="startAfter",cC="endAt",uC="endBefore",dC="expand",Qf=(t="")=>{if(!t)return;const e=/(^[^\w]+)/g,n=/([^\w]+$)/g;let r=t.match(e),i=t.match(n),s=t.substring((r==null?void 0:r[0].length)??0);if(s=s.substring(0,s.length-((i==null?void 0:i[0].length)??0)),s!=="")return s.split(",").map(a=>{const o=a.split(":");return[o[0].trim(),o.slice(1).join(":").trim()]})},cj=(t,e=["*"])=>{var n,r;return((r=(n=t.get(dC))==null?void 0:n.replace(/[()]/g,"").split(","))==null?void 0:r.map(i=>i.trim()).filter(Boolean))??e},uj=t=>(t??"(updated_at, id)").replace(/[()]/g,"").split(",").map(e=>e.trim()).filter(Boolean),dj=(t="desc")=>t==="asc"?"asc":"desc",fj=t=>{t=t instanceof URLSearchParams?t:new URLSearchParams(t);const e={};e.expand=cj(t),e.limit=parseInt(t.get(k4))?Math.abs(parseInt(t.get(k4))):void 0,e.limitToLast=parseInt(t.get(T4))?Math.abs(parseInt(t.get(T4))):void 0,!e.limitToLast&&!e.limit&&(e.limit=5);try{const a=t.get(C4);a&&(e.vqlParsed=sj(a))}catch(a){console.log(a),qf(!1,"VQL parsing failed",401)}e.vql=t.get(C4),e.startAt=Qf(t.get(oC)),e.startAfter=Qf(t.get(lC)),qf(!(e.startAt&&e.startAfter),"Cannot set both startAt and startAfter",401),e.endAt=Qf(t.get(cC)),e.endBefore=Qf(t.get(uC)),qf(!(e.endAt&&e.endBefore),"Cannot set both endAt and endAfter",401);const n=e.startAt||e.startAfter,r=e.endAt||e.endBefore,i=((n==null?void 0:n.length)??0)<((r==null?void 0:r.length)??0)?n:r,s=i===n?r:n;if(n&&r)for(let a=0;a<i.length;a++){const o=i[a][0],l=s[a][0];qf(o===l,`non matching keys \`${o}\`!==\`${l}\` in range cursors`,401)}return e.sortBy=uj(t.get(sC)),e.order=dj(t.get(aC)),s&&(s!=null&&s.length)&&(e.sortBy=s.map(([a,o],l)=>a)),e},S4=t=>"("+t.join(",")+")",hj=t=>{const e=t.map(n=>`${n[0]}:${n[1]}`);return S4(e)},us=t=>{const e=new URLSearchParams;return t.order=(t==null?void 0:t.order)??"desc",t.sortBy=(t==null?void 0:t.sortBy)??["updated_at","id"],t.expand=(t==null?void 0:t.expand)??["*"],!t.limit&&!t.limitToLast&&(t.limit=5),[{cursor:t.endAt,key:cC},{cursor:t.endBefore,key:uC},{cursor:t.startAt,key:oC},{cursor:t.startAfter,key:lC}].filter(n=>{var r;return!!n.cursor&&((r=n.cursor)==null?void 0:r.length)}).forEach(n=>{e.set(n.key,hj(n.cursor))}),e.set(aC,t.order),e.set(sC,S4(t.sortBy)),e.set(dC,S4(t.expand)),t.vql&&e.set(C4,t.vql),t.limit&&e.set(k4,t.limit.toString()),t.limitToLast&&e.set(T4,t.limitToLast.toString()),e},y8=t=>{if(typeof t!="string")return;let e=t.trim();if(e!==""&&(e=e.toLowerCase().match(/[\p{L}\d]+/gu).join("-"),e.length!=0))return e},x8=(t,e)=>{if(!t)throw e},ip=(t,e)=>{var r;let n=(r=t==null?void 0:t.endpoint)==null?void 0:r.trim();return n=n.endsWith("/")?n.slice(0,-1):n,e=e.startsWith("/")?e.slice(1):e,n?`${n}/api/${e}`:`/api/${e}`},Pa=async(t,e,n={})=>{const r=await t.auth.working_auth_token(),i=(t.auth.authStrategy==="apikey"?"Basic":"Bearer")+` ${r}`;return await fetch(ip(t.config,e),{...n,headers:{...(n==null?void 0:n.headers)??{},Authorization:i}})},ar=async(t,e,n={})=>{const r=await Pa(t,e,n),i=r.ok;let s;try{s=await r.json()}catch(a){console.log("fetchApiWithAuth.json()",a)}if(!i)throw s;return s};async function N1(t,e,n){return ar(t,`${e}/${n}`,{method:"get"})}async function fC(t,e,n){return ar(t,`${e}`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async function oy(t,e,n){return ar(t,`${e}/${n}`,{method:"delete"})}async function T0(t,e,n={}){const r=us(n);return ar(t,`${e}?${r.toString()}`,{method:"get"})}var Gd,Kd;class Rr{constructor(e,n){yr(this,Gd,void 0);yr(this,Kd,void 0);_a(this,Gd,e),_a(this,Kd,n)}async get(e){return N1(this.sdk,this.base_name,e)}async upsert(e){return fC(this.sdk,this.base_name,e)}async remove(e){return oy(this.sdk,this.base_name,e)}async list(e){return T0(this.sdk,this.base_name,e)}get base_name(){return vt(this,Kd)}get sdk(){return vt(this,Gd)}}Gd=new WeakMap,Kd=new WeakMap;typeof TextDecoder=="function"&&new TextDecoder;typeof TextEncoder=="function"&&new TextEncoder;const pj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mj=Array.prototype.slice.call(pj);(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(mj);String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);var st;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(st||(st={}));var N4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(N4||(N4={}));const ve=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fa=t=>{switch(typeof t){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return isNaN(t)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(t)?ve.array:t===null?ve.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ve.promise:typeof Map<"u"&&t instanceof Map?ve.map:typeof Set<"u"&&t instanceof Set?ve.set:typeof Date<"u"&&t instanceof Date?ve.date:ve.object;default:return ve.unknown}},le=st.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gj=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ri extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ri.create=t=>new Ri(t);const pd=(t,e)=>{let n;switch(t.code){case le.invalid_type:t.received===ve.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case le.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,st.jsonStringifyReplacer)}`;break;case le.unrecognized_keys:n=`Unrecognized key(s) in object: ${st.joinValues(t.keys,", ")}`;break;case le.invalid_union:n="Invalid input";break;case le.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${st.joinValues(t.options)}`;break;case le.invalid_enum_value:n=`Invalid enum value. Expected ${st.joinValues(t.options)}, received '${t.received}'`;break;case le.invalid_arguments:n="Invalid function arguments";break;case le.invalid_return_type:n="Invalid function return type";break;case le.invalid_date:n="Invalid date";break;case le.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:st.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case le.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case le.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case le.custom:n="Invalid input";break;case le.invalid_intersection_types:n="Intersection results could not be merged";break;case le.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case le.not_finite:n="Number must be finite";break;default:n=e.defaultError,st.assertNever(t)}return{message:n}};let hC=pd;function vj(t){hC=t}function um(){return hC}const dm=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(a,{data:e,defaultError:o}).message;return{...i,path:s,message:i.message||o}},yj=[];function ye(t,e){const n=dm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,um(),pd].filter(r=>!!r)});t.common.issues.push(n)}class jn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Pe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return jn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Pe;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const Pe=Object.freeze({status:"aborted"}),pC=t=>({status:"dirty",value:t}),Gn=t=>({status:"valid",value:t}),A4=t=>t.status==="aborted",D4=t=>t.status==="dirty",md=t=>t.status==="valid",fm=t=>typeof Promise<"u"&&t instanceof Promise;var Ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ce||(Ce={}));class _s{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _8=(t,e)=>{if(md(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ri(t.common.issues);return this._error=n,this._error}}};function Le(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:r??o.defaultError}:{message:n??o.defaultError},description:i}}class Fe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Fa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Fa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new jn,ctx:{common:e.parent.common,data:e.data,parsedType:Fa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fa(e)},s=this._parseSync({data:e,path:i.path,parent:i});return _8(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fa(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(fm(i)?i:Promise.resolve(i));return _8(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:le.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Hi({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return na.create(this,this._def)}nullable(){return bl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ji.create(this,this._def)}promise(){return Yc.create(this,this._def)}or(e){return xd.create([this,e],this._def)}and(e){return _d.create(this,e,this._def)}transform(e){return new Hi({...Le(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Td({...Le(this._def),innerType:this,defaultValue:n,typeName:De.ZodDefault})}brand(){return new gC({typeName:De.ZodBranded,type:this,...Le(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new gm({...Le(this._def),innerType:this,catchValue:n,typeName:De.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return af.create(this,e)}readonly(){return ym.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xj=/^c[^\s-]{8,}$/i,_j=/^[a-z][a-z0-9]*$/,bj=/^[0-9A-HJKMNP-TV-Z]{26}$/,wj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ej=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $g;const Tj=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Cj=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Sj=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Nj(t,e){return!!((e==="v4"||!e)&&Tj.test(t)||(e==="v6"||!e)&&Cj.test(t))}class Pi extends Fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ve.string){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.string,received:s.parsedType}),Pe}const r=new jn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?ye(i,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&ye(i,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ej.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"email",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")$g||($g=new RegExp(kj,"u")),$g.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"emoji",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")wj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"uuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")_j.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid2",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")bj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ulid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ye(i,{validation:"url",code:le.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"regex",code:le.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Sj(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Nj(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ip",code:le.invalid_string,message:s.message}),r.dirty()):st.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:le.invalid_string,...Ce.errToObj(r)})}_addCheck(e){return new Pi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ce.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...Ce.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ce.errToObj(n)})}nonempty(e){return this.min(1,Ce.errToObj(e))}trim(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Pi.create=t=>{var e;return new Pi({checks:[],typeName:De.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};function Aj(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}class fo extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ve.number){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.number,received:s.parsedType}),Pe}let r;const i=new jn;for(const s of this._def.checks)s.kind==="int"?st.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Aj(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_finite,message:s.message}),i.dirty()):st.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ce.toString(n))}setLimit(e,n,r,i){return new fo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(e){return new fo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&st.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}fo.create=t=>new fo({checks:[],typeName:De.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class ho extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ve.bigint){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.bigint,received:s.parsedType}),Pe}let r;const i=new jn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):st.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ce.toString(n))}setLimit(e,n,r,i){return new ho({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(e){return new ho({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ho.create=t=>{var e;return new ho({checks:[],typeName:De.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};class gd extends Fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ve.boolean){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.boolean,received:r.parsedType}),Pe}return Gn(e.data)}}gd.create=t=>new gd({typeName:De.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class xl extends Fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ve.date){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.date,received:s.parsedType}),Pe}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_date}),Pe}const r=new jn;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):st.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}xl.create=t=>new xl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:De.ZodDate,...Le(t)});class hm extends Fe{_parse(e){if(this._getType(e)!==ve.symbol){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.symbol,received:r.parsedType}),Pe}return Gn(e.data)}}hm.create=t=>new hm({typeName:De.ZodSymbol,...Le(t)});class vd extends Fe{_parse(e){if(this._getType(e)!==ve.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.undefined,received:r.parsedType}),Pe}return Gn(e.data)}}vd.create=t=>new vd({typeName:De.ZodUndefined,...Le(t)});class yd extends Fe{_parse(e){if(this._getType(e)!==ve.null){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.null,received:r.parsedType}),Pe}return Gn(e.data)}}yd.create=t=>new yd({typeName:De.ZodNull,...Le(t)});class Wc extends Fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Gn(e.data)}}Wc.create=t=>new Wc({typeName:De.ZodAny,...Le(t)});class ol extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gn(e.data)}}ol.create=t=>new ol({typeName:De.ZodUnknown,...Le(t)});class la extends Fe{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:le.invalid_type,expected:ve.never,received:n.parsedType}),Pe}}la.create=t=>new la({typeName:De.ZodNever,...Le(t)});class pm extends Fe{_parse(e){if(this._getType(e)!==ve.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.void,received:r.parsedType}),Pe}return Gn(e.data)}}pm.create=t=>new pm({typeName:De.ZodVoid,...Le(t)});class ji extends Fe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ve.array)return ye(n,{code:le.invalid_type,expected:ve.array,received:n.parsedType}),Pe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(ye(n,{code:a?le.too_big:le.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ye(n,{code:le.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ye(n,{code:le.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new _s(n,a,n.path,o)))).then(a=>jn.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new _s(n,a,n.path,o)));return jn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new ji({...this._def,minLength:{value:e,message:Ce.toString(n)}})}max(e,n){return new ji({...this._def,maxLength:{value:e,message:Ce.toString(n)}})}length(e,n){return new ji({...this._def,exactLength:{value:e,message:Ce.toString(n)}})}nonempty(e){return this.min(1,e)}}ji.create=(t,e)=>new ji({type:t,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...Le(e)});function Zl(t){if(t instanceof Pt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=na.create(Zl(r))}return new Pt({...t._def,shape:()=>e})}else return t instanceof ji?new ji({...t._def,type:Zl(t.element)}):t instanceof na?na.create(Zl(t.unwrap())):t instanceof bl?bl.create(Zl(t.unwrap())):t instanceof bs?bs.create(t.items.map(e=>Zl(e))):t}class Pt extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=st.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ve.object){const c=this._getOrReturnCtx(e);return ye(c,{code:le.invalid_type,expected:ve.object,received:c.parsedType}),Pe}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof la&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||o.push(c);const l=[];for(const c of a){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _s(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof la){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(ye(i,{code:le.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _s(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>jn.mergeObjectSync(r,c)):jn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Ce.errToObj,new Pt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,a,o;const l=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=Ce.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new Pt({...this._def,unknownKeys:"strip"})}passthrough(){return new Pt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Pt({...this._def,catchall:e})}pick(e){const n={};return st.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Pt({...this._def,shape:()=>n})}omit(e){const n={};return st.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Pt({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(e){const n={};return st.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Pt({...this._def,shape:()=>n})}required(e){const n={};return st.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof na;)s=s._def.innerType;n[r]=s}}),new Pt({...this._def,shape:()=>n})}keyof(){return mC(st.objectKeys(this.shape))}}Pt.create=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strip",catchall:la.create(),typeName:De.ZodObject,...Le(e)});Pt.strictCreate=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strict",catchall:la.create(),typeName:De.ZodObject,...Le(e)});Pt.lazycreate=(t,e)=>new Pt({shape:t,unknownKeys:"strip",catchall:la.create(),typeName:De.ZodObject,...Le(e)});class xd extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Ri(o.ctx.common.issues));return ye(n,{code:le.invalid_union,unionErrors:a}),Pe}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Ri(l));return ye(n,{code:le.invalid_union,unionErrors:o}),Pe}}get options(){return this._def.options}}xd.create=(t,e)=>new xd({options:t,typeName:De.ZodUnion,...Le(e)});const sp=t=>t instanceof wd?sp(t.schema):t instanceof Hi?sp(t.innerType()):t instanceof Ed?[t.value]:t instanceof po?t.options:t instanceof kd?Object.keys(t.enum):t instanceof Td?sp(t._def.innerType):t instanceof vd?[void 0]:t instanceof yd?[null]:null;class C0 extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.object)return ye(n,{code:le.invalid_type,expected:ve.object,received:n.parsedType}),Pe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ye(n,{code:le.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const a=sp(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,s)}}return new C0({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Le(r)})}}function O4(t,e){const n=Fa(t),r=Fa(e);if(t===e)return{valid:!0,data:t};if(n===ve.object&&r===ve.object){const i=st.objectKeys(e),s=st.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=O4(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===ve.array&&r===ve.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=O4(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ve.date&&r===ve.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _d extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(A4(s)||A4(a))return Pe;const o=O4(s.value,a.value);return o.valid?((D4(s)||D4(a))&&n.dirty(),{status:n.value,value:o.data}):(ye(r,{code:le.invalid_intersection_types}),Pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_d.create=(t,e,n)=>new _d({left:t,right:e,typeName:De.ZodIntersection,...Le(n)});class bs extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.array)return ye(r,{code:le.invalid_type,expected:ve.array,received:r.parsedType}),Pe;if(r.data.length<this._def.items.length)return ye(r,{code:le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pe;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new _s(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>jn.mergeArray(n,a)):jn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new bs({...this._def,rest:e})}}bs.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bs({items:t,typeName:De.ZodTuple,rest:null,...Le(e)})};class bd extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.object)return ye(r,{code:le.invalid_type,expected:ve.object,received:r.parsedType}),Pe;const i=[],s=this._def.keyType,a=this._def.valueType;for(const o in r.data)i.push({key:s._parse(new _s(r,o,r.path,o)),value:a._parse(new _s(r,r.data[o],r.path,o))});return r.common.async?jn.mergeObjectAsync(n,i):jn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Fe?new bd({keyType:e,valueType:n,typeName:De.ZodRecord,...Le(r)}):new bd({keyType:Pi.create(),valueType:e,typeName:De.ZodRecord,...Le(n)})}}class mm extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.map)return ye(r,{code:le.invalid_type,expected:ve.map,received:r.parsedType}),Pe;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new _s(r,o,r.path,[c,"key"])),value:s._parse(new _s(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}mm.create=(t,e,n)=>new mm({valueType:e,keyType:t,typeName:De.ZodMap,...Le(n)});class _l extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.set)return ye(r,{code:le.invalid_type,expected:ve.set,received:r.parsedType}),Pe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ye(r,{code:le.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ye(r,{code:le.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Pe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>s._parse(new _s(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new _l({...this._def,minSize:{value:e,message:Ce.toString(n)}})}max(e,n){return new _l({...this._def,maxSize:{value:e,message:Ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_l.create=(t,e)=>new _l({valueType:t,minSize:null,maxSize:null,typeName:De.ZodSet,...Le(e)});class Ac extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.function)return ye(n,{code:le.invalid_type,expected:ve.function,received:n.parsedType}),Pe;function r(o,l){return dm({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,um(),pd].filter(c=>!!c),issueData:{code:le.invalid_arguments,argumentsError:l}})}function i(o,l){return dm({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,um(),pd].filter(c=>!!c),issueData:{code:le.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Yc){const o=this;return Gn(async function(...l){const c=new Ri([]),u=await o._def.args.parseAsync(l,s).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,s).catch(p=>{throw c.addIssue(i(d,p)),c})})}else{const o=this;return Gn(function(...l){const c=o._def.args.safeParse(l,s);if(!c.success)throw new Ri([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),d=o._def.returns.safeParse(u,s);if(!d.success)throw new Ri([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ac({...this._def,args:bs.create(e).rest(ol.create())})}returns(e){return new Ac({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ac({args:e||bs.create([]).rest(ol.create()),returns:n||ol.create(),typeName:De.ZodFunction,...Le(r)})}}class wd extends Fe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}wd.create=(t,e)=>new wd({getter:t,typeName:De.ZodLazy,...Le(e)});class Ed extends Fe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(n,{received:n.data,code:le.invalid_literal,expected:this._def.value}),Pe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ed.create=(t,e)=>new Ed({value:t,typeName:De.ZodLiteral,...Le(e)});function mC(t,e){return new po({values:t,typeName:De.ZodEnum,...Le(e)})}class po extends Fe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(n,{expected:st.joinValues(r),received:n.parsedType,code:le.invalid_type}),Pe}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(n,{received:n.data,code:le.invalid_enum_value,options:r}),Pe}return Gn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return po.create(e)}exclude(e){return po.create(this.options.filter(n=>!e.includes(n)))}}po.create=mC;class kd extends Fe{_parse(e){const n=st.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ve.string&&r.parsedType!==ve.number){const i=st.objectValues(n);return ye(r,{expected:st.joinValues(i),received:r.parsedType,code:le.invalid_type}),Pe}if(n.indexOf(e.data)===-1){const i=st.objectValues(n);return ye(r,{received:r.data,code:le.invalid_enum_value,options:i}),Pe}return Gn(e.data)}get enum(){return this._def.values}}kd.create=(t,e)=>new kd({values:t,typeName:De.ZodNativeEnum,...Le(e)});class Yc extends Fe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.promise&&n.common.async===!1)return ye(n,{code:le.invalid_type,expected:ve.promise,received:n.parsedType}),Pe;const r=n.parsedType===ve.promise?n.data:Promise.resolve(n.data);return Gn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Yc.create=(t,e)=>new Yc({type:t,typeName:De.ZodPromise,...Le(e)});class Hi extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Pe:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Pe:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!md(a))return a;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>md(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):a);st.assertNever(i)}}Hi.create=(t,e,n)=>new Hi({schema:t,typeName:De.ZodEffects,effect:e,...Le(n)});Hi.createWithPreprocess=(t,e,n)=>new Hi({schema:e,effect:{type:"preprocess",transform:t},typeName:De.ZodEffects,...Le(n)});class na extends Fe{_parse(e){return this._getType(e)===ve.undefined?Gn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}na.create=(t,e)=>new na({innerType:t,typeName:De.ZodOptional,...Le(e)});class bl extends Fe{_parse(e){return this._getType(e)===ve.null?Gn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bl.create=(t,e)=>new bl({innerType:t,typeName:De.ZodNullable,...Le(e)});class Td extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Td.create=(t,e)=>new Td({innerType:t,typeName:De.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Le(e)});class gm extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return fm(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}gm.create=(t,e)=>new gm({innerType:t,typeName:De.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Le(e)});class vm extends Fe{_parse(e){if(this._getType(e)!==ve.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.nan,received:r.parsedType}),Pe}return{status:"valid",value:e.data}}}vm.create=t=>new vm({typeName:De.ZodNaN,...Le(t)});const Dj=Symbol("zod_brand");class gC extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class af extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Pe:s.status==="dirty"?(n.dirty(),pC(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Pe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new af({in:e,out:n,typeName:De.ZodPipeline})}}class ym extends Fe{_parse(e){const n=this._def.innerType._parse(e);return md(n)&&(n.value=Object.freeze(n.value)),n}}ym.create=(t,e)=>new ym({innerType:t,typeName:De.ZodReadonly,...Le(e)});const vC=(t,e={},n)=>t?Wc.create().superRefine((r,i)=>{var s,a;if(!t(r)){const o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0,c=typeof o=="string"?{message:o}:o;i.addIssue({code:"custom",...c,fatal:l})}}):Wc.create(),Oj={object:Pt.lazycreate};var De;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(De||(De={}));const Mj=(t,e={message:`Input not instance of ${t.name}`})=>vC(n=>n instanceof t,e),yC=Pi.create,xC=fo.create,Pj=vm.create,Ij=ho.create,_C=gd.create,Lj=xl.create,Rj=hm.create,jj=vd.create,Fj=yd.create,Bj=Wc.create,Hj=ol.create,zj=la.create,Uj=pm.create,$j=ji.create,Vj=Pt.create,Wj=Pt.strictCreate,Yj=xd.create,Gj=C0.create,Kj=_d.create,qj=bs.create,Qj=bd.create,Xj=mm.create,Zj=_l.create,Jj=Ac.create,eF=wd.create,tF=Ed.create,nF=po.create,rF=kd.create,iF=Yc.create,b8=Hi.create,sF=na.create,aF=bl.create,oF=Hi.createWithPreprocess,lF=af.create,cF=()=>yC().optional(),uF=()=>xC().optional(),dF=()=>_C().optional(),fF={string:t=>Pi.create({...t,coerce:!0}),number:t=>fo.create({...t,coerce:!0}),boolean:t=>gd.create({...t,coerce:!0}),bigint:t=>ho.create({...t,coerce:!0}),date:t=>xl.create({...t,coerce:!0})},hF=Pe;var k=Object.freeze({__proto__:null,defaultErrorMap:pd,setErrorMap:vj,getErrorMap:um,makeIssue:dm,EMPTY_PATH:yj,addIssueToContext:ye,ParseStatus:jn,INVALID:Pe,DIRTY:pC,OK:Gn,isAborted:A4,isDirty:D4,isValid:md,isAsync:fm,get util(){return st},get objectUtil(){return N4},ZodParsedType:ve,getParsedType:Fa,ZodType:Fe,ZodString:Pi,ZodNumber:fo,ZodBigInt:ho,ZodBoolean:gd,ZodDate:xl,ZodSymbol:hm,ZodUndefined:vd,ZodNull:yd,ZodAny:Wc,ZodUnknown:ol,ZodNever:la,ZodVoid:pm,ZodArray:ji,ZodObject:Pt,ZodUnion:xd,ZodDiscriminatedUnion:C0,ZodIntersection:_d,ZodTuple:bs,ZodRecord:bd,ZodMap:mm,ZodSet:_l,ZodFunction:Ac,ZodLazy:wd,ZodLiteral:Ed,ZodEnum:po,ZodNativeEnum:kd,ZodPromise:Yc,ZodEffects:Hi,ZodTransformer:Hi,ZodOptional:na,ZodNullable:bl,ZodDefault:Td,ZodCatch:gm,ZodNaN:vm,BRAND:Dj,ZodBranded:gC,ZodPipeline:af,ZodReadonly:ym,custom:vC,Schema:Fe,ZodSchema:Fe,late:Oj,get ZodFirstPartyTypeKind(){return De},coerce:fF,any:Bj,array:$j,bigint:Ij,boolean:_C,date:Lj,discriminatedUnion:Gj,effect:b8,enum:nF,function:Jj,instanceof:Mj,intersection:Kj,lazy:eF,literal:tF,map:Xj,nan:Pj,nativeEnum:rF,never:zj,null:Fj,nullable:aF,number:xC,object:Vj,oboolean:dF,onumber:uF,optional:sF,ostring:cF,pipeline:lF,preprocess:oF,promise:iF,record:Qj,set:Zj,strictObject:Wj,string:yC,symbol:Rj,transformer:b8,tuple:qj,undefined:jj,union:Yj,unknown:Hj,void:Uj,NEVER:hF,ZodIssueCode:le,quotelessJson:gj,ZodError:Ri});k.object({general_store_name:k.string().optional().describe("The store name\n`platform.env.SC_GENERAL_STORE_NAME` environment"),general_store_website:k.string().optional().describe("The store `website`\n`platform.env.SC_GENERAL_STORE_WEBSITE` environment"),general_store_logo_url:k.string().optional().describe("The store `logo` url\n`platform.env.SC_GENERAL_STORE_LOGO_URL` environment"),general_store_description:k.string().optional().describe("The store `description`\n`platform.env.SC_GENERAL_STORE_DESCRIPTION` environment"),general_store_support_email:k.string().optional().describe("The store support email\n`platform.env.SC_GENERAL_STORE_SUPPORT_EMAIL` environment"),general_confirm_email_base_url:k.string().optional().describe("The store `email-confirm`\n`platform.env.SC_GENERAL_STORE_CONFIRM_EMAIL_BASE_URL` environment"),auth_admins_emails:k.array(k.string()).optional().describe("Seed admin emails, if absent will be infered at init by\n`platform.env.SC_AUTH_ADMIN_EMAILS` environment as CSV of emails"),auth_password_hash_rounds:k.number().optional().describe("password hash rounds, if absent will be infered at init by\n`platform.env.SC_AUTH_PASS_HASH_ROUNDS` environment"),auth_secret_access_token:k.string().describe("access token signing secret, if absent will be infered\nat init by `platform.env.SC_AUTH_SECRET_ACCESS_TOKEN` environment"),auth_secret_refresh_token:k.string().describe("refresh token signing secret, if absent will be infered at\ninit by `platform.env.SC_AUTH_SECRET_REFRESH_TOKEN` environment"),checkout_reserve_stock_on:k.union([k.literal("checkout_create"),k.literal("checkout_complete"),k.literal("never")]).optional().describe("(Optional) automatically reserve stock, we recommend to use `never`.\nDepending on your needs you can alter this setting.\nif absent will be infered at init by `platform.env.SC_CHECKOUT_RESERVE_STOCK_ON`\nenvironment and then will default to `never`.").default("never"),storage_rewrite_urls:k.string().optional().describe("(Optional) Once object `storage` is used, you may have connected a\n**CDN** to buckets to take advantage of faster assets serving instead of serving\nfrom your server / the storage service directly. If you are using an cloud based\nstorage service such as AWS S3, it is very recommended to attach the bucket to\na **CDN** for super fast and efficient serving.\n\nTake note, most cloud based storage services and `storecraft` drivers support creating\n`presigned` urls for `download` / `upload`, which essentially delegate these operations\nto the storage services. However, **CDN** is always the best choice for assets serving\ncost and latency wise.\n\nif absent will be infered at init by `platform.env.SC_STORAGE_REWRITE_URLS` environment.").default("undefined")}).describe("Basic config for `storecraft`");const pF=k.object({message:k.string().optional(),code:k.string().optional(),expected:k.string().optional(),received:k.string().optional(),path:k.array(k.string()).optional()});k.object({messages:k.array(pF).optional()});const Xf=k.string(),Zf=k.string(),ly=k.object({created_at:k.string().optional().describe("ISO string creation time"),updated_at:k.string().optional().describe("ISO string update time")}).describe("Timestamps");k.object({search:k.array(k.string()).optional()}).describe("searchable");const mF=k.object({id:k.string().optional().describe("ID")}).describe("with `id`"),gF=k.object({id:k.string().describe("ID")}).describe("with `id`"),ui=k.object({id:k.string().optional().describe("Optional `id`"),handle:k.string().optional().describe("Optional `handle`")}),vF=k.object({key:k.string().describe("The key"),value:k.string().optional().describe("The value")}).describe("Attribute type, a key/value storage"),yF=k.object({iss:k.string(),sub:k.string(),aud:k.string(),exp:k.number(),nbf:k.number(),iat:k.number(),jti:k.string(),roles:k.array(k.string()).describe("User roles and authorizations")}),cy=k.object({email:k.string().email().describe("Email of user"),password:k.string().min(4).max(20).describe("password")}).describe("Auth base type"),xF=k.union([k.literal("admin"),k.literal("user"),k.string()]).describe("Role of authenticated user");cy.describe("Sign in type");cy.describe("Sign up type");k.object({refresh_token:k.string().describe("A refresh token")}).describe("Refresh token input type");const w8=k.object({token:k.string().describe("a token (`access` or `refresh`)"),claims:yF.partial().describe("Claims the `JSON Web Token` holds")}).describe("API token with parsed claims");k.object({apikey:k.string().describe("The `apikey` is `base64_uri(apikey@storecraft.api:{password})`.\nIt will be shown only once to the user, at the `backend`, the password hash\nwill be saved, thus, the real password is only known to the user.")}).describe("Result of `auth` `apikey` creation");k.object({token_type:k.string().describe("The type of token, should be `bearer` or `refresh`"),user_id:k.string().describe("the `ID` of user, example `au_....`"),access_token:w8.describe("The access token"),refresh_token:w8.describe("The refresh token")}).describe("Result of `auth` request for `signin` / `signup` / `refresh`");const _F=mF.extend(ly.shape).extend({handle:k.string().describe("The key name"),values:k.array(k.string()).describe("List of values, related to the key")});_F.omit({id:!0,handle:!0}).and(ui).describe("Tag upsert type");const bC=k.object({option_id:k.string().describe("Variant option id"),value_id:k.string().describe("Variant selected value id")}).describe("Variant option selection type"),bF=k.object({id:k.string().describe("The `id` of the entity"),value:k.string().describe("The text value of the entity")}).describe("Identifiable text entity type"),Xs=k.object({id:k.string().describe("The `id` of the entity"),handle:k.string().describe("The `handle` of the entity")}).describe("both `id` and `handle` of entity required"),E8=k.object({Auto:k.object({id:k.literal(0),name:k.string().optional(),name2:k.literal("automatic")}),Manual:k.object({id:k.literal(1),name:k.string().optional(),name2:k.literal("manual")})}).describe(`Discounts can be manual(coupon) or automatic types,
|
173
|
+
at `+a}return e};Vc.buildMessage=function(t,e){var n={literal:function(c){return'"'+i(c.text)+'"'},class:function(c){var u=c.parts.map(function(d){return Array.isArray(d)?s(d[0])+"-"+s(d[1]):s(d)});return"["+(c.inverted?"^":"")+u.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(c){return c.description}};function r(c){return c.charCodeAt(0).toString(16).toUpperCase()}function i(c){return c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function s(c){return c.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(u){return"\\x0"+r(u)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(u){return"\\x"+r(u)})}function a(c){return n[c.type](c)}function o(c){var u=c.map(a),d,h;if(u.sort(),u.length>0){for(d=1,h=1;d<u.length;d++)u[d-1]!==u[d]&&(u[h]=u[d],h++);u.length=h}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}function l(c){return c?'"'+i(c)+'"':"end of input"}return"Expected "+o(t)+" but "+l(e)+" found."};function sj(t,e){e=e!==void 0?e:{};var n={},r=e.grammarSource,i={expression:zn},s=zn,a="|",o="-",l="(",c=")",u="'",d='"',h=/^[^"' ()|&]/,p=/^[^']/,m=/^[^"]/,g=/^[ ]/,v=je("expression"),y=je("sum term"),x=gn("|",!1),_=je("product term"),w=gn("&",!1),T=je("subexpression"),S=gn("-",!1),E=je("term"),N=gn("(",!1),O=gn(")",!1),A=je("variable"),j=Zn(['"',"'"," ","(",")","|","&"],!0,!1),$=je("variable 1"),K=gn("'",!1),J=Zn(["'"],!0,!1),B=gn('"',!1),U=Zn(['"'],!0,!1),Y=je("whitespace character(s)"),L=Zn([" "],!1,!1),z=function(W,te){return v8("|",W,te)},D=function(W,te){return v8("&",W,te)},G=function(W){return{op:"!",args:[W]}},X=function(W){return W.group=!0,W},P=function(W){return{op:"LEAF",value:zr().trim()}},ie=function(W){return{op:"LEAF",value:zr().trim().slice(1,-1)}},V=0,ce=0,Ae=[{line:1,column:1}],_e=0,Ne=[],ge=0,Wt;if("startRule"in e){if(!(e.startRule in i))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');s=i[e.startRule]}function zr(){return t.substring(ce,V)}function gn(W,te){return{type:"literal",text:W,ignoreCase:te}}function Zn(W,te,ue){return{type:"class",parts:W,inverted:te,ignoreCase:ue}}function qi(){return{type:"end"}}function je(W){return{type:"other",description:W}}function Ur(W){var te=Ae[W],ue;if(te)return te;for(ue=W-1;!Ae[ue];)ue--;for(te=Ae[ue],te={line:te.line,column:te.column};ue<W;)t.charCodeAt(ue)===10?(te.line++,te.column=1):te.column++,ue++;return Ae[W]=te,te}function vn(W,te,ue){var et=Ur(W),Xe=Ur(te),yi={source:r,start:{offset:W,line:et.line,column:et.column},end:{offset:te,line:Xe.line,column:Xe.column}};return yi}function ze(W){V<_e||(V>_e&&(_e=V,Ne=[]),Ne.push(W))}function Hn(W,te,ue){return new Vc(Vc.buildMessage(W,te),W,te,ue)}function zn(){var W;return ge++,W=Mo(),ge--,W===n&&ge===0&&ze(v),W}function Mo(){var W,te,ue,et;return ge++,W=V,te=ya(),te!==n?(t.charCodeAt(V)===124?(ue=a,V++):(ue=n,ge===0&&ze(x)),ue!==n?(et=Mo(),et!==n?(ce=W,W=z(te,et)):(V=W,W=n)):(V=W,W=n)):(V=W,W=n),W===n&&(W=ya()),ge--,W===n&&(te=n,ge===0&&ze(y)),W}function ya(){var W,te,ue;return ge++,W=V,te=xa(),te!==n?(t.charCodeAt(V)===38?V++:ge===0&&ze(w),ue=ya(),ue!==n?(ce=W,W=D(te,ue)):(V=W,W=n)):(V=W,W=n),W===n&&(W=xa()),ge--,W===n&&(te=n,ge===0&&ze(_)),W}function xa(){var W,te,ue;return ge++,W=V,ne(),t.charCodeAt(V)===45?(te=o,V++):(te=n,ge===0&&ze(S)),te!==n?(ue=Po(),ue!==n?(ne(),ce=W,W=G(ue)):(V=W,W=n)):(V=W,W=n),W===n&&(W=Po()),ge--,W===n&&ge===0&&ze(T),W}function Po(){var W,te,ue,et;return ge++,W=q(),W===n&&(W=Hl()),W===n&&(W=V,ne(),t.charCodeAt(V)===40?(te=l,V++):(te=n,ge===0&&ze(N)),te!==n?(ue=zn(),ue!==n?(t.charCodeAt(V)===41?(et=c,V++):(et=n,ge===0&&ze(O)),et!==n?(ne(),ce=W,W=X(ue)):(V=W,W=n)):(V=W,W=n)):(V=W,W=n)),ge--,W===n&&ge===0&&ze(E),W}function Hl(){var W,te,ue;if(ge++,W=V,ne(),te=[],h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ge===0&&ze(j)),ue!==n)for(;ue!==n;)te.push(ue),h.test(t.charAt(V))?(ue=t.charAt(V),V++):(ue=n,ge===0&&ze(j));else te=n;return te!==n?(ue=ne(),ce=W,W=P()):(V=W,W=n),ge--,W===n&&ge===0&&ze(A),W}function q(){var W,te,ue,et,Xe;if(ge++,W=V,ne(),te=V,t.charCodeAt(V)===39?(ue=u,V++):(ue=n,ge===0&&ze(K)),ue!==n){if(et=[],p.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(J)),Xe!==n)for(;Xe!==n;)et.push(Xe),p.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(J));else et=n;et!==n?(t.charCodeAt(V)===39?(Xe=u,V++):(Xe=n,ge===0&&ze(K)),Xe!==n?(ue=[ue,et,Xe],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;if(te===n)if(te=V,t.charCodeAt(V)===34?(ue=d,V++):(ue=n,ge===0&&ze(B)),ue!==n){if(et=[],m.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(U)),Xe!==n)for(;Xe!==n;)et.push(Xe),m.test(t.charAt(V))?(Xe=t.charAt(V),V++):(Xe=n,ge===0&&ze(U));else et=n;et!==n?(t.charCodeAt(V)===34?(Xe=d,V++):(Xe=n,ge===0&&ze(B)),Xe!==n?(ue=[ue,et,Xe],te=ue):(V=te,te=n)):(V=te,te=n)}else V=te,te=n;return te!==n?(ue=ne(),ce=W,W=ie()):(V=W,W=n),ge--,W===n&&ge===0&&ze($),W}function ne(){var W,te;for(ge++,W=[],g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ge===0&&ze(L));te!==n;)W.push(te),g.test(t.charAt(V))?(te=t.charAt(V),V++):(te=n,ge===0&&ze(L));return ge--,te=n,ge===0&&ze(Y),W}if(Wt=s(),Wt!==n&&V===t.length)return Wt;throw Wt!==n&&V<t.length&&ze(qi()),Hn(Ne,_e<t.length?t.charAt(_e):null,_e<t.length?vn(_e,_e+1):vn(_e,_e))}const aj=new Uint8Array(3);crypto.getRandomValues(aj);class oj extends Error{constructor(e,n=400){super(JSON.stringify(e,null,2)),this.code=n,this.message=e;try{this.message_string=JSON.stringify(this.message,null,2)}catch{this.message_string=":("}}toString(){return this.message_string}}const qf=(t,e,n=400)=>{if(!t)throw new oj([{message:e}],n)},lj=(t,e="-")=>{if(typeof t!="string")return;let n=t.trim();if(n!==""&&(n=n.toLowerCase().match(/[\p{L}\d]+/gu).join(e),n.length!=0))return n},sC="sortBy",aC="order",k4="limit",T4="limitToLast",C4="vql",oC="startAt",lC="startAfter",cC="endAt",uC="endBefore",dC="expand",Qf=(t="")=>{if(!t)return;const e=/(^[^\w]+)/g,n=/([^\w]+$)/g;let r=t.match(e),i=t.match(n),s=t.substring((r==null?void 0:r[0].length)??0);if(s=s.substring(0,s.length-((i==null?void 0:i[0].length)??0)),s!=="")return s.split(",").map(a=>{const o=a.split(":");return[o[0].trim(),o.slice(1).join(":").trim()]})},cj=(t,e=["*"])=>{var n,r;return((r=(n=t.get(dC))==null?void 0:n.replace(/[()]/g,"").split(","))==null?void 0:r.map(i=>i.trim()).filter(Boolean))??e},uj=t=>(t??"(updated_at, id)").replace(/[()]/g,"").split(",").map(e=>e.trim()).filter(Boolean),dj=(t="desc")=>t==="asc"?"asc":"desc",fj=t=>{t=t instanceof URLSearchParams?t:new URLSearchParams(t);const e={};e.expand=cj(t),e.limit=parseInt(t.get(k4))?Math.abs(parseInt(t.get(k4))):void 0,e.limitToLast=parseInt(t.get(T4))?Math.abs(parseInt(t.get(T4))):void 0,!e.limitToLast&&!e.limit&&(e.limit=5);try{const a=t.get(C4);a&&(e.vqlParsed=sj(a))}catch(a){console.log(a),qf(!1,"VQL parsing failed",401)}e.vql=t.get(C4),e.startAt=Qf(t.get(oC)),e.startAfter=Qf(t.get(lC)),qf(!(e.startAt&&e.startAfter),"Cannot set both startAt and startAfter",401),e.endAt=Qf(t.get(cC)),e.endBefore=Qf(t.get(uC)),qf(!(e.endAt&&e.endBefore),"Cannot set both endAt and endAfter",401);const n=e.startAt||e.startAfter,r=e.endAt||e.endBefore,i=((n==null?void 0:n.length)??0)<((r==null?void 0:r.length)??0)?n:r,s=i===n?r:n;if(n&&r)for(let a=0;a<i.length;a++){const o=i[a][0],l=s[a][0];qf(o===l,`non matching keys \`${o}\`!==\`${l}\` in range cursors`,401)}return e.sortBy=uj(t.get(sC)),e.order=dj(t.get(aC)),s&&(s!=null&&s.length)&&(e.sortBy=s.map(([a,o],l)=>a)),e},S4=t=>"("+t.join(",")+")",hj=t=>{const e=t.map(n=>`${n[0]}:${n[1]}`);return S4(e)},us=t=>{const e=new URLSearchParams;return t.order=(t==null?void 0:t.order)??"desc",t.sortBy=(t==null?void 0:t.sortBy)??["updated_at","id"],t.expand=(t==null?void 0:t.expand)??["*"],!t.limit&&!t.limitToLast&&(t.limit=5),[{cursor:t.endAt,key:cC},{cursor:t.endBefore,key:uC},{cursor:t.startAt,key:oC},{cursor:t.startAfter,key:lC}].filter(n=>{var r;return!!n.cursor&&((r=n.cursor)==null?void 0:r.length)}).forEach(n=>{e.set(n.key,hj(n.cursor))}),e.set(aC,t.order),e.set(sC,S4(t.sortBy)),e.set(dC,S4(t.expand)),t.vql&&e.set(C4,t.vql),t.limit&&e.set(k4,t.limit.toString()),t.limitToLast&&e.set(T4,t.limitToLast.toString()),e},y8=t=>{if(typeof t!="string")return;let e=t.trim();if(e!==""&&(e=e.toLowerCase().match(/[\p{L}\d]+/gu).join("-"),e.length!=0))return e},x8=(t,e)=>{if(!t)throw e},ip=(t,e)=>{var r;let n=(r=t==null?void 0:t.endpoint)==null?void 0:r.trim();return n=n!=null&&n.endsWith("/")?n.slice(0,-1):n,e=e!=null&&e.startsWith("/")?e.slice(1):e,n?`${n}/api/${e}`:`/api/${e}`},Pa=async(t,e,n={})=>{const r=await t.auth.working_auth_token(),i=(t.auth.authStrategy==="apikey"?"Basic":"Bearer")+` ${r}`;return await fetch(ip(t.config,e),{...n,headers:{...(n==null?void 0:n.headers)??{},Authorization:i}})},ar=async(t,e,n={})=>{const r=await Pa(t,e,n),i=r.ok;let s;try{s=await r.json()}catch(a){console.log("fetchApiWithAuth.json()",a)}if(!i)throw s;return s};async function N1(t,e,n){return ar(t,`${e}/${n}`,{method:"get"})}async function fC(t,e,n){return ar(t,`${e}`,{method:"post",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}})}async function oy(t,e,n){return ar(t,`${e}/${n}`,{method:"delete"})}async function T0(t,e,n={}){const r=us(n);return ar(t,`${e}?${r.toString()}`,{method:"get"})}var Gd,Kd;class Rr{constructor(e,n){yr(this,Gd,void 0);yr(this,Kd,void 0);_a(this,Gd,e),_a(this,Kd,n)}async get(e){return N1(this.sdk,this.base_name,e)}async upsert(e){return fC(this.sdk,this.base_name,e)}async remove(e){return oy(this.sdk,this.base_name,e)}async list(e){return T0(this.sdk,this.base_name,e)}get base_name(){return vt(this,Kd)}get sdk(){return vt(this,Gd)}}Gd=new WeakMap,Kd=new WeakMap;typeof TextDecoder=="function"&&new TextDecoder;typeof TextEncoder=="function"&&new TextEncoder;const pj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mj=Array.prototype.slice.call(pj);(t=>{let e={};return t.forEach((n,r)=>e[n]=r),e})(mj);String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);var st;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(st||(st={}));var N4;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(N4||(N4={}));const ve=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fa=t=>{switch(typeof t){case"undefined":return ve.undefined;case"string":return ve.string;case"number":return isNaN(t)?ve.nan:ve.number;case"boolean":return ve.boolean;case"function":return ve.function;case"bigint":return ve.bigint;case"symbol":return ve.symbol;case"object":return Array.isArray(t)?ve.array:t===null?ve.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?ve.promise:typeof Map<"u"&&t instanceof Map?ve.map:typeof Set<"u"&&t instanceof Set?ve.set:typeof Date<"u"&&t instanceof Date?ve.date:ve.object;default:return ve.unknown}},le=st.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),gj=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ri extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,l=0;for(;l<a.path.length;){const c=a.path[l];l===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(a))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ri.create=t=>new Ri(t);const pd=(t,e)=>{let n;switch(t.code){case le.invalid_type:t.received===ve.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case le.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,st.jsonStringifyReplacer)}`;break;case le.unrecognized_keys:n=`Unrecognized key(s) in object: ${st.joinValues(t.keys,", ")}`;break;case le.invalid_union:n="Invalid input";break;case le.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${st.joinValues(t.options)}`;break;case le.invalid_enum_value:n=`Invalid enum value. Expected ${st.joinValues(t.options)}, received '${t.received}'`;break;case le.invalid_arguments:n="Invalid function arguments";break;case le.invalid_return_type:n="Invalid function return type";break;case le.invalid_date:n="Invalid date";break;case le.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:st.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case le.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case le.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case le.custom:n="Invalid input";break;case le.invalid_intersection_types:n="Intersection results could not be merged";break;case le.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case le.not_finite:n="Number must be finite";break;default:n=e.defaultError,st.assertNever(t)}return{message:n}};let hC=pd;function vj(t){hC=t}function um(){return hC}const dm=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};let o="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)o=c(a,{data:e,defaultError:o}).message;return{...i,path:s,message:i.message||o}},yj=[];function ye(t,e){const n=dm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,um(),pd].filter(r=>!!r)});t.common.issues.push(n)}class jn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Pe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return jn.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Pe;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const Pe=Object.freeze({status:"aborted"}),pC=t=>({status:"dirty",value:t}),Gn=t=>({status:"valid",value:t}),A4=t=>t.status==="aborted",D4=t=>t.status==="dirty",md=t=>t.status==="valid",fm=t=>typeof Promise<"u"&&t instanceof Promise;var Ce;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ce||(Ce={}));class _s{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _8=(t,e)=>{if(md(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ri(t.common.issues);return this._error=n,this._error}}};function Le(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(a,o)=>a.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:r??o.defaultError}:{message:n??o.defaultError},description:i}}class Fe{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Fa(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Fa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new jn,ctx:{common:e.parent.common,data:e.data,parsedType:Fa(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(fm(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fa(e)},s=this._parseSync({data:e,path:i.path,parent:i});return _8(i,s)}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Fa(e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(fm(i)?i:Promise.resolve(i));return _8(r,s)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const a=e(i),o=()=>s.addIssue({code:le.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Hi({schema:this,typeName:De.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return na.create(this,this._def)}nullable(){return bl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ji.create(this,this._def)}promise(){return Yc.create(this,this._def)}or(e){return xd.create([this,e],this._def)}and(e){return _d.create(this,e,this._def)}transform(e){return new Hi({...Le(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Td({...Le(this._def),innerType:this,defaultValue:n,typeName:De.ZodDefault})}brand(){return new gC({typeName:De.ZodBranded,type:this,...Le(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new gm({...Le(this._def),innerType:this,catchValue:n,typeName:De.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return af.create(this,e)}readonly(){return ym.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xj=/^c[^\s-]{8,}$/i,_j=/^[a-z][a-z0-9]*$/,bj=/^[0-9A-HJKMNP-TV-Z]{26}$/,wj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ej=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $g;const Tj=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Cj=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Sj=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Nj(t,e){return!!((e==="v4"||!e)&&Tj.test(t)||(e==="v6"||!e)&&Cj.test(t))}class Pi extends Fe{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==ve.string){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.string,received:s.parsedType}),Pe}const r=new jn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?ye(i,{code:le.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&ye(i,{code:le.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")Ej.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"email",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")$g||($g=new RegExp(kj,"u")),$g.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"emoji",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")wj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"uuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")_j.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid2",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")bj.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ulid",code:le.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ye(i,{validation:"url",code:le.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"regex",code:le.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Sj(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:le.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?Nj(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ip",code:le.invalid_string,message:s.message}),r.dirty()):st.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:le.invalid_string,...Ce.errToObj(r)})}_addCheck(e){return new Pi({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ce.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ce.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ce.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ce.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ce.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ce.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ce.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ce.errToObj(e)})}datetime(e){var n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(n=e==null?void 0:e.offset)!==null&&n!==void 0?n:!1,...Ce.errToObj(e==null?void 0:e.message)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...Ce.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...Ce.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...Ce.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...Ce.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...Ce.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...Ce.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...Ce.errToObj(n)})}nonempty(e){return this.min(1,Ce.errToObj(e))}trim(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Pi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Pi.create=t=>{var e;return new Pi({checks:[],typeName:De.ZodString,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};function Aj(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}class fo extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==ve.number){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.number,received:s.parsedType}),Pe}let r;const i=new jn;for(const s of this._def.checks)s.kind==="int"?st.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?Aj(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_finite,message:s.message}),i.dirty()):st.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ce.toString(n))}setLimit(e,n,r,i){return new fo({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(e){return new fo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ce.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:Ce.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ce.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ce.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&st.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}fo.create=t=>new fo({checks:[],typeName:De.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class ho extends Fe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==ve.bigint){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.bigint,received:s.parsedType}),Pe}let r;const i=new jn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:le.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):st.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,Ce.toString(n))}gt(e,n){return this.setLimit("min",e,!1,Ce.toString(n))}lte(e,n){return this.setLimit("max",e,!0,Ce.toString(n))}lt(e,n){return this.setLimit("max",e,!1,Ce.toString(n))}setLimit(e,n,r,i){return new ho({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:Ce.toString(i)}]})}_addCheck(e){return new ho({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ce.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ce.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:Ce.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ho.create=t=>{var e;return new ho({checks:[],typeName:De.ZodBigInt,coerce:(e=t==null?void 0:t.coerce)!==null&&e!==void 0?e:!1,...Le(t)})};class gd extends Fe{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==ve.boolean){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.boolean,received:r.parsedType}),Pe}return Gn(e.data)}}gd.create=t=>new gd({typeName:De.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Le(t)});class xl extends Fe{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==ve.date){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_type,expected:ve.date,received:s.parsedType}),Pe}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return ye(s,{code:le.invalid_date}),Pe}const r=new jn;let i;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:le.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):st.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xl({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:Ce.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:Ce.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}xl.create=t=>new xl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:De.ZodDate,...Le(t)});class hm extends Fe{_parse(e){if(this._getType(e)!==ve.symbol){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.symbol,received:r.parsedType}),Pe}return Gn(e.data)}}hm.create=t=>new hm({typeName:De.ZodSymbol,...Le(t)});class vd extends Fe{_parse(e){if(this._getType(e)!==ve.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.undefined,received:r.parsedType}),Pe}return Gn(e.data)}}vd.create=t=>new vd({typeName:De.ZodUndefined,...Le(t)});class yd extends Fe{_parse(e){if(this._getType(e)!==ve.null){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.null,received:r.parsedType}),Pe}return Gn(e.data)}}yd.create=t=>new yd({typeName:De.ZodNull,...Le(t)});class Wc extends Fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Gn(e.data)}}Wc.create=t=>new Wc({typeName:De.ZodAny,...Le(t)});class ol extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Gn(e.data)}}ol.create=t=>new ol({typeName:De.ZodUnknown,...Le(t)});class la extends Fe{_parse(e){const n=this._getOrReturnCtx(e);return ye(n,{code:le.invalid_type,expected:ve.never,received:n.parsedType}),Pe}}la.create=t=>new la({typeName:De.ZodNever,...Le(t)});class pm extends Fe{_parse(e){if(this._getType(e)!==ve.undefined){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.void,received:r.parsedType}),Pe}return Gn(e.data)}}pm.create=t=>new pm({typeName:De.ZodVoid,...Le(t)});class ji extends Fe{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==ve.array)return ye(n,{code:le.invalid_type,expected:ve.array,received:n.parsedType}),Pe;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,o=n.data.length<i.exactLength.value;(a||o)&&(ye(n,{code:a?le.too_big:le.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ye(n,{code:le.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ye(n,{code:le.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,o)=>i.type._parseAsync(new _s(n,a,n.path,o)))).then(a=>jn.mergeArray(r,a));const s=[...n.data].map((a,o)=>i.type._parseSync(new _s(n,a,n.path,o)));return jn.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new ji({...this._def,minLength:{value:e,message:Ce.toString(n)}})}max(e,n){return new ji({...this._def,maxLength:{value:e,message:Ce.toString(n)}})}length(e,n){return new ji({...this._def,exactLength:{value:e,message:Ce.toString(n)}})}nonempty(e){return this.min(1,e)}}ji.create=(t,e)=>new ji({type:t,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...Le(e)});function Zl(t){if(t instanceof Pt){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=na.create(Zl(r))}return new Pt({...t._def,shape:()=>e})}else return t instanceof ji?new ji({...t._def,type:Zl(t.element)}):t instanceof na?na.create(Zl(t.unwrap())):t instanceof bl?bl.create(Zl(t.unwrap())):t instanceof bs?bs.create(t.items.map(e=>Zl(e))):t}class Pt extends Fe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=st.objectKeys(e);return this._cached={shape:e,keys:n}}_parse(e){if(this._getType(e)!==ve.object){const c=this._getOrReturnCtx(e);return ye(c,{code:le.invalid_type,expected:ve.object,received:c.parsedType}),Pe}const{status:r,ctx:i}=this._processInputParams(e),{shape:s,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof la&&this._def.unknownKeys==="strip"))for(const c in i.data)a.includes(c)||o.push(c);const l=[];for(const c of a){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _s(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof la){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of o)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")o.length>0&&(ye(i,{code:le.unrecognized_keys,keys:o}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of o){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _s(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>jn.mergeObjectSync(r,c)):jn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Ce.errToObj,new Pt({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var i,s,a,o;const l=(a=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(o=Ce.errToObj(e).message)!==null&&o!==void 0?o:l}:{message:l}}}:{}})}strip(){return new Pt({...this._def,unknownKeys:"strip"})}passthrough(){return new Pt({...this._def,unknownKeys:"passthrough"})}extend(e){return new Pt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Pt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new Pt({...this._def,catchall:e})}pick(e){const n={};return st.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Pt({...this._def,shape:()=>n})}omit(e){const n={};return st.objectKeys(this.shape).forEach(r=>{e[r]||(n[r]=this.shape[r])}),new Pt({...this._def,shape:()=>n})}deepPartial(){return Zl(this)}partial(e){const n={};return st.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}),new Pt({...this._def,shape:()=>n})}required(e){const n={};return st.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof na;)s=s._def.innerType;n[r]=s}}),new Pt({...this._def,shape:()=>n})}keyof(){return mC(st.objectKeys(this.shape))}}Pt.create=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strip",catchall:la.create(),typeName:De.ZodObject,...Le(e)});Pt.strictCreate=(t,e)=>new Pt({shape:()=>t,unknownKeys:"strict",catchall:la.create(),typeName:De.ZodObject,...Le(e)});Pt.lazycreate=(t,e)=>new Pt({shape:t,unknownKeys:"strip",catchall:la.create(),typeName:De.ZodObject,...Le(e)});class xd extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return n.common.issues.push(...o.ctx.common.issues),o.result;const a=s.map(o=>new Ri(o.ctx.common.issues));return ye(n,{code:le.invalid_union,unionErrors:a}),Pe}if(n.common.async)return Promise.all(r.map(async s=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let s;const a=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&a.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(l=>new Ri(l));return ye(n,{code:le.invalid_union,unionErrors:o}),Pe}}get options(){return this._def.options}}xd.create=(t,e)=>new xd({options:t,typeName:De.ZodUnion,...Le(e)});const sp=t=>t instanceof wd?sp(t.schema):t instanceof Hi?sp(t.innerType()):t instanceof Ed?[t.value]:t instanceof po?t.options:t instanceof kd?Object.keys(t.enum):t instanceof Td?sp(t._def.innerType):t instanceof vd?[void 0]:t instanceof yd?[null]:null;class C0 extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.object)return ye(n,{code:le.invalid_type,expected:ve.object,received:n.parsedType}),Pe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(ye(n,{code:le.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){const i=new Map;for(const s of n){const a=sp(s.shape[e]);if(!a)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(i.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);i.set(o,s)}}return new C0({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Le(r)})}}function O4(t,e){const n=Fa(t),r=Fa(e);if(t===e)return{valid:!0,data:t};if(n===ve.object&&r===ve.object){const i=st.objectKeys(e),s=st.objectKeys(t).filter(o=>i.indexOf(o)!==-1),a={...t,...e};for(const o of s){const l=O4(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(n===ve.array&&r===ve.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let s=0;s<t.length;s++){const a=t[s],o=e[s],l=O4(a,o);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===ve.date&&r===ve.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class _d extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(s,a)=>{if(A4(s)||A4(a))return Pe;const o=O4(s.value,a.value);return o.valid?((D4(s)||D4(a))&&n.dirty(),{status:n.value,value:o.data}):(ye(r,{code:le.invalid_intersection_types}),Pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,a])=>i(s,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}_d.create=(t,e,n)=>new _d({left:t,right:e,typeName:De.ZodIntersection,...Le(n)});class bs extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.array)return ye(r,{code:le.invalid_type,expected:ve.array,received:r.parsedType}),Pe;if(r.data.length<this._def.items.length)return ye(r,{code:le.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pe;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:le.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new _s(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(s).then(a=>jn.mergeArray(n,a)):jn.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new bs({...this._def,rest:e})}}bs.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new bs({items:t,typeName:De.ZodTuple,rest:null,...Le(e)})};class bd extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.object)return ye(r,{code:le.invalid_type,expected:ve.object,received:r.parsedType}),Pe;const i=[],s=this._def.keyType,a=this._def.valueType;for(const o in r.data)i.push({key:s._parse(new _s(r,o,r.path,o)),value:a._parse(new _s(r,r.data[o],r.path,o))});return r.common.async?jn.mergeObjectAsync(n,i):jn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof Fe?new bd({keyType:e,valueType:n,typeName:De.ZodRecord,...Le(r)}):new bd({keyType:Pi.create(),valueType:e,typeName:De.ZodRecord,...Le(n)})}}class mm extends Fe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.map)return ye(r,{code:le.invalid_type,expected:ve.map,received:r.parsedType}),Pe;const i=this._def.keyType,s=this._def.valueType,a=[...r.data.entries()].map(([o,l],c)=>({key:i._parse(new _s(r,o,r.path,[c,"key"])),value:s._parse(new _s(r,l,r.path,[c,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}})}else{const o=new Map;for(const l of a){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Pe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),o.set(c.value,u.value)}return{status:n.value,value:o}}}}mm.create=(t,e,n)=>new mm({valueType:e,keyType:t,typeName:De.ZodMap,...Le(n)});class _l extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==ve.set)return ye(r,{code:le.invalid_type,expected:ve.set,received:r.parsedType}),Pe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ye(r,{code:le.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ye(r,{code:le.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function a(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Pe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const o=[...r.data.values()].map((l,c)=>s._parse(new _s(r,l,r.path,c)));return r.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,n){return new _l({...this._def,minSize:{value:e,message:Ce.toString(n)}})}max(e,n){return new _l({...this._def,maxSize:{value:e,message:Ce.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}_l.create=(t,e)=>new _l({valueType:t,minSize:null,maxSize:null,typeName:De.ZodSet,...Le(e)});class Ac extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.function)return ye(n,{code:le.invalid_type,expected:ve.function,received:n.parsedType}),Pe;function r(o,l){return dm({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,um(),pd].filter(c=>!!c),issueData:{code:le.invalid_arguments,argumentsError:l}})}function i(o,l){return dm({data:o,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,um(),pd].filter(c=>!!c),issueData:{code:le.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Yc){const o=this;return Gn(async function(...l){const c=new Ri([]),u=await o._def.args.parseAsync(l,s).catch(p=>{throw c.addIssue(r(l,p)),c}),d=await Reflect.apply(a,this,u);return await o._def.returns._def.type.parseAsync(d,s).catch(p=>{throw c.addIssue(i(d,p)),c})})}else{const o=this;return Gn(function(...l){const c=o._def.args.safeParse(l,s);if(!c.success)throw new Ri([r(l,c.error)]);const u=Reflect.apply(a,this,c.data),d=o._def.returns.safeParse(u,s);if(!d.success)throw new Ri([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Ac({...this._def,args:bs.create(e).rest(ol.create())})}returns(e){return new Ac({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new Ac({args:e||bs.create([]).rest(ol.create()),returns:n||ol.create(),typeName:De.ZodFunction,...Le(r)})}}class wd extends Fe{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}wd.create=(t,e)=>new wd({getter:t,typeName:De.ZodLazy,...Le(e)});class Ed extends Fe{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return ye(n,{received:n.data,code:le.invalid_literal,expected:this._def.value}),Pe}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ed.create=(t,e)=>new Ed({value:t,typeName:De.ZodLiteral,...Le(e)});function mC(t,e){return new po({values:t,typeName:De.ZodEnum,...Le(e)})}class po extends Fe{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(n,{expected:st.joinValues(r),received:n.parsedType,code:le.invalid_type}),Pe}if(this._def.values.indexOf(e.data)===-1){const n=this._getOrReturnCtx(e),r=this._def.values;return ye(n,{received:n.data,code:le.invalid_enum_value,options:r}),Pe}return Gn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e){return po.create(e)}exclude(e){return po.create(this.options.filter(n=>!e.includes(n)))}}po.create=mC;class kd extends Fe{_parse(e){const n=st.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==ve.string&&r.parsedType!==ve.number){const i=st.objectValues(n);return ye(r,{expected:st.joinValues(i),received:r.parsedType,code:le.invalid_type}),Pe}if(n.indexOf(e.data)===-1){const i=st.objectValues(n);return ye(r,{received:r.data,code:le.invalid_enum_value,options:i}),Pe}return Gn(e.data)}get enum(){return this._def.values}}kd.create=(t,e)=>new kd({values:t,typeName:De.ZodNativeEnum,...Le(e)});class Yc extends Fe{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==ve.promise&&n.common.async===!1)return ye(n,{code:le.invalid_type,expected:ve.promise,received:n.parsedType}),Pe;const r=n.parsedType===ve.promise?n.data:Promise.resolve(n.data);return Gn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Yc.create=(t,e)=>new Yc({type:t,typeName:De.ZodPromise,...Le(e)});class Hi extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const a=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(o=>this._def.schema._parseAsync({data:o,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=o=>{const l=i.refinement(o,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Pe:(o.status==="dirty"&&n.dirty(),a(o.value),{status:n.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?Pe:(o.status==="dirty"&&n.dirty(),a(o.value).then(()=>({status:n.value,value:o.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!md(a))return a;const o=i.transform(a.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>md(a)?Promise.resolve(i.transform(a.value,s)).then(o=>({status:n.value,value:o})):a);st.assertNever(i)}}Hi.create=(t,e,n)=>new Hi({schema:t,typeName:De.ZodEffects,effect:e,...Le(n)});Hi.createWithPreprocess=(t,e,n)=>new Hi({schema:e,effect:{type:"preprocess",transform:t},typeName:De.ZodEffects,...Le(n)});class na extends Fe{_parse(e){return this._getType(e)===ve.undefined?Gn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}na.create=(t,e)=>new na({innerType:t,typeName:De.ZodOptional,...Le(e)});class bl extends Fe{_parse(e){return this._getType(e)===ve.null?Gn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}bl.create=(t,e)=>new bl({innerType:t,typeName:De.ZodNullable,...Le(e)});class Td extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Td.create=(t,e)=>new Td({innerType:t,typeName:De.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Le(e)});class gm extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return fm(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ri(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}gm.create=(t,e)=>new gm({innerType:t,typeName:De.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Le(e)});class vm extends Fe{_parse(e){if(this._getType(e)!==ve.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:le.invalid_type,expected:ve.nan,received:r.parsedType}),Pe}return{status:"valid",value:e.data}}}vm.create=t=>new vm({typeName:De.ZodNaN,...Le(t)});const Dj=Symbol("zod_brand");class gC extends Fe{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class af extends Fe{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Pe:s.status==="dirty"?(n.dirty(),pC(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Pe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new af({in:e,out:n,typeName:De.ZodPipeline})}}class ym extends Fe{_parse(e){const n=this._def.innerType._parse(e);return md(n)&&(n.value=Object.freeze(n.value)),n}}ym.create=(t,e)=>new ym({innerType:t,typeName:De.ZodReadonly,...Le(e)});const vC=(t,e={},n)=>t?Wc.create().superRefine((r,i)=>{var s,a;if(!t(r)){const o=typeof e=="function"?e(r):typeof e=="string"?{message:e}:e,l=(a=(s=o.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0,c=typeof o=="string"?{message:o}:o;i.addIssue({code:"custom",...c,fatal:l})}}):Wc.create(),Oj={object:Pt.lazycreate};var De;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(De||(De={}));const Mj=(t,e={message:`Input not instance of ${t.name}`})=>vC(n=>n instanceof t,e),yC=Pi.create,xC=fo.create,Pj=vm.create,Ij=ho.create,_C=gd.create,Lj=xl.create,Rj=hm.create,jj=vd.create,Fj=yd.create,Bj=Wc.create,Hj=ol.create,zj=la.create,Uj=pm.create,$j=ji.create,Vj=Pt.create,Wj=Pt.strictCreate,Yj=xd.create,Gj=C0.create,Kj=_d.create,qj=bs.create,Qj=bd.create,Xj=mm.create,Zj=_l.create,Jj=Ac.create,eF=wd.create,tF=Ed.create,nF=po.create,rF=kd.create,iF=Yc.create,b8=Hi.create,sF=na.create,aF=bl.create,oF=Hi.createWithPreprocess,lF=af.create,cF=()=>yC().optional(),uF=()=>xC().optional(),dF=()=>_C().optional(),fF={string:t=>Pi.create({...t,coerce:!0}),number:t=>fo.create({...t,coerce:!0}),boolean:t=>gd.create({...t,coerce:!0}),bigint:t=>ho.create({...t,coerce:!0}),date:t=>xl.create({...t,coerce:!0})},hF=Pe;var k=Object.freeze({__proto__:null,defaultErrorMap:pd,setErrorMap:vj,getErrorMap:um,makeIssue:dm,EMPTY_PATH:yj,addIssueToContext:ye,ParseStatus:jn,INVALID:Pe,DIRTY:pC,OK:Gn,isAborted:A4,isDirty:D4,isValid:md,isAsync:fm,get util(){return st},get objectUtil(){return N4},ZodParsedType:ve,getParsedType:Fa,ZodType:Fe,ZodString:Pi,ZodNumber:fo,ZodBigInt:ho,ZodBoolean:gd,ZodDate:xl,ZodSymbol:hm,ZodUndefined:vd,ZodNull:yd,ZodAny:Wc,ZodUnknown:ol,ZodNever:la,ZodVoid:pm,ZodArray:ji,ZodObject:Pt,ZodUnion:xd,ZodDiscriminatedUnion:C0,ZodIntersection:_d,ZodTuple:bs,ZodRecord:bd,ZodMap:mm,ZodSet:_l,ZodFunction:Ac,ZodLazy:wd,ZodLiteral:Ed,ZodEnum:po,ZodNativeEnum:kd,ZodPromise:Yc,ZodEffects:Hi,ZodTransformer:Hi,ZodOptional:na,ZodNullable:bl,ZodDefault:Td,ZodCatch:gm,ZodNaN:vm,BRAND:Dj,ZodBranded:gC,ZodPipeline:af,ZodReadonly:ym,custom:vC,Schema:Fe,ZodSchema:Fe,late:Oj,get ZodFirstPartyTypeKind(){return De},coerce:fF,any:Bj,array:$j,bigint:Ij,boolean:_C,date:Lj,discriminatedUnion:Gj,effect:b8,enum:nF,function:Jj,instanceof:Mj,intersection:Kj,lazy:eF,literal:tF,map:Xj,nan:Pj,nativeEnum:rF,never:zj,null:Fj,nullable:aF,number:xC,object:Vj,oboolean:dF,onumber:uF,optional:sF,ostring:cF,pipeline:lF,preprocess:oF,promise:iF,record:Qj,set:Zj,strictObject:Wj,string:yC,symbol:Rj,transformer:b8,tuple:qj,undefined:jj,union:Yj,unknown:Hj,void:Uj,NEVER:hF,ZodIssueCode:le,quotelessJson:gj,ZodError:Ri});k.object({general_store_name:k.string().optional().describe("The store name\n`platform.env.SC_GENERAL_STORE_NAME` environment"),general_store_website:k.string().optional().describe("The store `website`\n`platform.env.SC_GENERAL_STORE_WEBSITE` environment"),general_store_logo_url:k.string().optional().describe("The store `logo` url\n`platform.env.SC_GENERAL_STORE_LOGO_URL` environment"),general_store_description:k.string().optional().describe("The store `description`\n`platform.env.SC_GENERAL_STORE_DESCRIPTION` environment"),general_store_support_email:k.string().optional().describe("The store support email\n`platform.env.SC_GENERAL_STORE_SUPPORT_EMAIL` environment"),general_confirm_email_base_url:k.string().optional().describe("The store `email-confirm`\n`platform.env.SC_GENERAL_STORE_CONFIRM_EMAIL_BASE_URL` environment"),auth_admins_emails:k.array(k.string()).optional().describe("Seed admin emails, if absent will be infered at init by\n`platform.env.SC_AUTH_ADMIN_EMAILS` environment as CSV of emails"),auth_password_hash_rounds:k.number().optional().describe("password hash rounds, if absent will be infered at init by\n`platform.env.SC_AUTH_PASS_HASH_ROUNDS` environment"),auth_secret_access_token:k.string().describe("access token signing secret, if absent will be infered\nat init by `platform.env.SC_AUTH_SECRET_ACCESS_TOKEN` environment"),auth_secret_refresh_token:k.string().describe("refresh token signing secret, if absent will be infered at\ninit by `platform.env.SC_AUTH_SECRET_REFRESH_TOKEN` environment"),checkout_reserve_stock_on:k.union([k.literal("checkout_create"),k.literal("checkout_complete"),k.literal("never")]).optional().describe("(Optional) automatically reserve stock, we recommend to use `never`.\nDepending on your needs you can alter this setting.\nif absent will be infered at init by `platform.env.SC_CHECKOUT_RESERVE_STOCK_ON`\nenvironment and then will default to `never`.").default("never"),storage_rewrite_urls:k.string().optional().describe("(Optional) Once object `storage` is used, you may have connected a\n**CDN** to buckets to take advantage of faster assets serving instead of serving\nfrom your server / the storage service directly. If you are using an cloud based\nstorage service such as AWS S3, it is very recommended to attach the bucket to\na **CDN** for super fast and efficient serving.\n\nTake note, most cloud based storage services and `storecraft` drivers support creating\n`presigned` urls for `download` / `upload`, which essentially delegate these operations\nto the storage services. However, **CDN** is always the best choice for assets serving\ncost and latency wise.\n\nif absent will be infered at init by `platform.env.SC_STORAGE_REWRITE_URLS` environment.").default("undefined")}).describe("Basic config for `storecraft`");const pF=k.object({message:k.string().optional(),code:k.string().optional(),expected:k.string().optional(),received:k.string().optional(),path:k.array(k.string()).optional()});k.object({messages:k.array(pF).optional()});const Xf=k.string(),Zf=k.string(),ly=k.object({created_at:k.string().optional().describe("ISO string creation time"),updated_at:k.string().optional().describe("ISO string update time")}).describe("Timestamps");k.object({search:k.array(k.string()).optional()}).describe("searchable");const mF=k.object({id:k.string().optional().describe("ID")}).describe("with `id`"),gF=k.object({id:k.string().describe("ID")}).describe("with `id`"),ui=k.object({id:k.string().optional().describe("Optional `id`"),handle:k.string().optional().describe("Optional `handle`")}),vF=k.object({key:k.string().describe("The key"),value:k.string().optional().describe("The value")}).describe("Attribute type, a key/value storage"),yF=k.object({iss:k.string(),sub:k.string(),aud:k.string(),exp:k.number(),nbf:k.number(),iat:k.number(),jti:k.string(),roles:k.array(k.string()).describe("User roles and authorizations")}),cy=k.object({email:k.string().email().describe("Email of user"),password:k.string().min(4).max(20).describe("password")}).describe("Auth base type"),xF=k.union([k.literal("admin"),k.literal("user"),k.string()]).describe("Role of authenticated user");cy.describe("Sign in type");cy.describe("Sign up type");k.object({refresh_token:k.string().describe("A refresh token")}).describe("Refresh token input type");const w8=k.object({token:k.string().describe("a token (`access` or `refresh`)"),claims:yF.partial().describe("Claims the `JSON Web Token` holds")}).describe("API token with parsed claims");k.object({apikey:k.string().describe("The `apikey` is `base64_uri(apikey@storecraft.api:{password})`.\nIt will be shown only once to the user, at the `backend`, the password hash\nwill be saved, thus, the real password is only known to the user.")}).describe("Result of `auth` `apikey` creation");k.object({token_type:k.string().describe("The type of token, should be `bearer` or `refresh`"),user_id:k.string().describe("the `ID` of user, example `au_....`"),access_token:w8.describe("The access token"),refresh_token:w8.describe("The refresh token")}).describe("Result of `auth` request for `signin` / `signup` / `refresh`");const _F=mF.extend(ly.shape).extend({handle:k.string().describe("The key name"),values:k.array(k.string()).describe("List of values, related to the key")});_F.omit({id:!0,handle:!0}).and(ui).describe("Tag upsert type");const bC=k.object({option_id:k.string().describe("Variant option id"),value_id:k.string().describe("Variant selected value id")}).describe("Variant option selection type"),bF=k.object({id:k.string().describe("The `id` of the entity"),value:k.string().describe("The text value of the entity")}).describe("Identifiable text entity type"),Xs=k.object({id:k.string().describe("The `id` of the entity"),handle:k.string().describe("The `handle` of the entity")}).describe("both `id` and `handle` of entity required"),E8=k.object({Auto:k.object({id:k.literal(0),name:k.string().optional(),name2:k.literal("automatic")}),Manual:k.object({id:k.literal(1),name:k.string().optional(),name2:k.literal("manual")})}).describe(`Discounts can be manual(coupon) or automatic types,
|
174
174
|
see <a href='#DiscountApplicationEnum'>#DiscountApplicationEnum</a>`),wC=k.array(k.object({id:k.string().optional().describe("`p_in_collections` filter, `id` of collection"),title:k.string().optional().describe("`p_in_collections` filter, `title` of collection"),handle:k.string().optional().describe("`p_in_collections` filter, `handle` of the collection")})).describe("Filter for product in collections"),wF=wC.describe("Filter for product not in collections"),EC=k.array(k.object({id:k.string().optional().describe("`p_in_products` filter, `id` of `product`"),title:k.string().optional().describe("`p_in_products` filter, `title` of `product`"),handle:k.string().optional().describe("`p_in_products` filter, `handle` of the `product`")})).describe("Filter for product discount, product in handles"),EF=EC.describe("Filter for product discount, product not in handles"),kF=k.array(k.string()).describe("Filter for product discount, product has tags"),TF=k.array(k.string()).describe("Filter for product discount, NOT has tags"),CF=k.any().describe(`Filter for product discount,
|
175
175
|
that chooses all products`),SF=k.object({from:k.number().optional().describe("`p_in_price_range` filter From price"),to:k.number().describe("`p_in_price_range` filter To price")}).describe("Filter for product discount, product in price range"),NF=k.object({from:k.number().optional().describe("`o_subtotal_in_range` filter From price"),to:k.number().optional().describe("`o_subtotal_in_range` filter To price")}).describe("Filter for order discount, subtotal in range"),AF=k.object({from:k.number().optional().describe("`o_items_count_in_range` filter From count"),to:k.number().optional().describe("`o_items_count_in_range` filter To count")}).describe("Filter for order discount, items count in range"),DF=k.object({from:k.string().optional().describe("`o_date_in_range` filter From date `ISO` format"),to:k.string().optional().describe("`o_date_in_range` filter To date `ISO` format")}).describe("Filter for order discount, subtotal in range"),OF=k.array(k.object({id:k.string().describe("`id` of `customer`"),email:k.string().optional().describe("(optional) `email` of `customer`"),firstname:k.string().optional().describe("(optional) readable `name` of `customer`"),lastname:k.string().optional().describe("(optional) readable `name` of `customer`")})).describe("Filter for order discount, order has customer id"),$r=k.object({any:k.object({id:k.number(),type:k.string(),op:k.string(),name:k.string().optional()}),p_in_collections:k.object({id:k.literal(0),type:k.literal("product"),op:k.literal("p-in-collections"),name:k.string().optional()}),p_not_in_collections:k.object({id:k.literal(1),type:k.literal("product"),op:k.literal("p-not-in-collections"),name:k.string().optional()}),p_in_products:k.object({id:k.literal(2),type:k.literal("product"),op:k.literal("p-in-products"),name:k.string().optional()}),p_not_in_products:k.object({id:k.literal(3),type:k.literal("product"),op:k.literal("p-not-in-products"),name:k.string().optional()}),p_in_tags:k.object({id:k.literal(4),type:k.literal("product"),op:k.literal("p-in-tags"),name:k.string().optional()}),p_not_in_tags:k.object({id:k.literal(5),type:k.literal("product"),op:k.literal("p-not-in-tags"),name:k.string().optional()}),p_all:k.object({id:k.literal(6),type:k.literal("product"),op:k.literal("p-all"),name:k.string().optional()}),p_in_price_range:k.object({id:k.literal(7),type:k.literal("product"),op:k.literal("p-in-price-range"),name:k.string().optional()}),o_subtotal_in_range:k.object({id:k.literal(100),type:k.literal("order"),op:k.literal("o-subtotal-in-range"),name:k.string().optional()}),o_items_count_in_range:k.object({id:k.literal(101),type:k.literal("order"),op:k.literal("o-items-count-in-range"),name:k.string().optional()}),o_date_in_range:k.object({id:k.literal(102),type:k.literal("order"),op:k.literal("o-date-in-range"),name:k.string().optional()}),o_has_customer:k.object({id:k.literal(103),type:k.literal("order"),op:k.literal("o-has-customer"),name:k.string().optional()})}),MF=k.object({fixed:k.number().describe("`RegularDiscountExtra` params, Fixed price addition"),percent:k.number().describe("`RegularDiscountExtra` params, Percents off")}).describe("Parameters of a regular discount"),PF=k.object({fixed:k.number().describe("`OrderDiscountExtra` params, Fixed price addition"),percent:k.number().describe("`OrderDiscountExtra` params, Percents off"),free_shipping:k.boolean().optional().describe("`OrderDiscountExtra` params, Do we have free shipping ?")}).describe("Parameters of order discount"),IF=k.object({fixed:k.number().describe("`BulkDiscountExtra` params, Fixed price addition"),percent:k.number().describe("`BulkDiscountExtra` params, Percents off"),qty:k.number().describe("`BulkDiscountExtra` params, The integer quantity\nfor which the discount is given"),recursive:k.boolean().optional().describe("`BulkDiscountExtra` params, Apply the discount as\nmany times as possible")}).describe("Parameters of bulk discount"),LF=k.object({fixed:k.number().describe("`BundleDiscountExtra` params, Fixed price addition"),percent:k.number().describe("`BundleDiscountExtra` params, Percents off"),recursive:k.boolean().optional().describe("`BundleDiscountExtra` params, Apply the discount\nas many times as possible")}).describe("Parameters of bulk discount"),Ul=k.object({regular:k.object({id:k.literal(0),type:k.literal("regular"),name:k.string().optional()}),bulk:k.object({id:k.literal(1),type:k.literal("bulk"),name:k.string().optional()}),buy_x_get_y:k.object({id:k.literal(2),type:k.literal("buy_x_get_y"),name:k.string().optional()}),order:k.object({id:k.literal(3),type:k.literal("order"),name:k.string().optional()}),bundle:k.object({id:k.literal(4),type:k.literal("bundle"),name:k.string().optional()}),any:k.object({id:k.number(),type:k.string(),name:k.string().optional()})}).describe(`Discount meta data,
|
176
176
|
see <a href='#DiscountMetaEnum'>#DiscountMetaEnum</a>`),kC=k.object({firstname:k.string().optional().describe("First name of recipient"),lastname:k.string().optional().describe("Last name of recipient"),phone_number:k.string().regex(/^([+]?d{1,2}[-s]?|)d{3}[-s]?d{3}[-s]?d{4}$ Invalid phone number/).optional().describe("The phone number of the recipient"),company:k.string().optional().describe("Optional company name of recipient"),street1:k.string().optional().describe("Street address 1"),street2:k.string().optional().describe("Street address 2"),city:k.string().optional().describe("City"),country:k.string().optional().describe("Country"),state:k.string().optional().describe("State"),zip_code:k.string().optional().describe("ZIP code"),postal_code:k.string().optional().describe("Postal code")}).describe("Address type"),RF=k.union([k.literal("route"),k.literal("url")]).describe("'route' means routing inside admin panel 'url' is linking to a url"),jF=k.object({collection:k.string().describe("Which collection"),document:k.string().describe("Which document")}).describe("route inside admin panel action params"),FF=k.object({new_window:k.boolean().optional().describe("Ppen the url in new window"),url:k.string().describe("The url to open")}).describe("Action params for actions of type 'url'"),BF=k.object({firstname:k.string().optional().describe("First name"),lastname:k.string().optional().describe("Last name"),phone_number:k.string().optional().describe("Phone number"),email:k.string().optional().describe("Email"),customer_id:k.string().optional().describe("Customer `id`")}).describe("Order buyer info"),HF=k.object({id:k.string().describe("`id`"),title:k.string().min(3,"Title should be longer than 3").optional().describe("title"),message:k.union([k.literal("shipping-method-not-found"),k.literal("product-not-exists"),k.literal("product-out-of-stock"),k.literal("product-not-enough-stock"),k.literal("product-inactive")]).optional().describe("message")}).describe(`Checkouts or draft orders might be validated
|
package/dist/lib/index.js
CHANGED
@@ -10063,7 +10063,7 @@ var ay = Nn.GenIcon, CR = function(e) {
|
|
10063
10063
|
}, MR = function(e) {
|
10064
10064
|
return k0({ tag: "svg", attr: { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "circle", attr: { cx: "12", cy: "12", r: "3" } }, { tag: "path", attr: { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" } }] })(e);
|
10065
10065
|
};
|
10066
|
-
const PR = "@storecraft/dashboard", IR = "1.0.
|
10066
|
+
const PR = "@storecraft/dashboard", IR = "1.0.1", LR = "Storecraft Official Dashboard", RR = "MIT", jR = "Tomer Shalev (https://github.com/store-craft)", FR = "https://github.com/store-craft/storecraft", BR = {
|
10067
10067
|
type: "git",
|
10068
10068
|
url: "https://github.com/store-craft/storecraft.git",
|
10069
10069
|
directory: "packages/dashboard"
|
@@ -10132,7 +10132,6 @@ const PR = "@storecraft/dashboard", IR = "1.0.0", LR = "Storecraft Official Dash
|
|
10132
10132
|
"dist"
|
10133
10133
|
], KR = {
|
10134
10134
|
name: PR,
|
10135
|
-
private: "false",
|
10136
10135
|
version: IR,
|
10137
10136
|
description: LR,
|
10138
10137
|
license: RR,
|
@@ -10721,7 +10720,7 @@ const qf = (t, e, n = 400) => {
|
|
10721
10720
|
}, ip = (t, e) => {
|
10722
10721
|
var r;
|
10723
10722
|
let n = (r = t == null ? void 0 : t.endpoint) == null ? void 0 : r.trim();
|
10724
|
-
return n = n.endsWith("/") ? n.slice(0, -1) : n, e = e.startsWith("/") ? e.slice(1) : e, n ? `${n}/api/${e}` : `/api/${e}`;
|
10723
|
+
return n = n != null && n.endsWith("/") ? n.slice(0, -1) : n, e = e != null && e.startsWith("/") ? e.slice(1) : e, n ? `${n}/api/${e}` : `/api/${e}`;
|
10725
10724
|
}, Pa = async (t, e, n = {}) => {
|
10726
10725
|
const r = await t.auth.working_auth_token(), i = (t.auth.authStrategy === "apikey" ? "Basic" : "Bearer") + ` ${r}`;
|
10727
10726
|
return await fetch(
|