@puddle-code/cli 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -6
- package/dist/index.js +38 -4
- package/dist/public/assets/{Dashboard-CK6pd6yc.js → Dashboard-BM1e1IRo.js} +1 -1
- package/dist/public/assets/EditorTabClose-CNtFdbsv.js +1 -0
- package/dist/public/assets/{LazyTerminal-YJYBkGGG.js → LazyTerminal-DUhe0i1g.js} +2 -2
- package/dist/public/assets/{ModelRefcount-qiBWxl8V.js → ModelRefcount-Cyy3E7YD.js} +1 -1
- package/dist/public/assets/{PaneEditorBody-CSxRXAbs.js → PaneEditorBody-TJhlQjZL.js} +3 -3
- package/dist/public/assets/PdfViewer-BJyMmihS.js +2 -0
- package/dist/public/assets/SettingsDialog-CNrX86pI.js +1 -0
- package/dist/public/assets/{Terminal-UR8urwx4.js → Terminal-B2mNzf_l.js} +2 -2
- package/dist/public/assets/Workspace-CG6XSaGb.js +8 -0
- package/dist/public/assets/api-BBFo3oc-.js +73 -0
- package/dist/public/assets/{buffer-store-C_9Ib5qf.js → buffer-store-REUK09wT.js} +3 -3
- package/dist/public/assets/chevron-down-DPOlcAF_.js +1 -0
- package/dist/public/assets/context-menu-c8LcYf-D.js +1 -0
- package/dist/public/assets/createLucideIcon-C6JENrH3.js +1 -0
- package/dist/public/assets/{cssMode-gGXxIWCL.js → cssMode-NZqvaXck.js} +1 -1
- package/dist/public/assets/dialog-DI1-uj7G.js +41 -0
- package/dist/public/assets/dist-CKuo36qW.js +1 -0
- package/dist/public/assets/{drafts-DJULaAJ0.js → drafts-CHfAOffT.js} +1 -1
- package/dist/public/assets/file-links-DJ4ZSTa-.js +1 -0
- package/dist/public/assets/{htmlMode-C2tT4YRo.js → htmlMode-Dj8iZBJ7.js} +1 -1
- package/dist/public/assets/index-Bh-CbzNs.js +10 -0
- package/dist/public/assets/index-RKRvjeap.css +2 -0
- package/dist/public/assets/{jsonMode-BphVURBo.js → jsonMode-DGMOJ1wP.js} +1 -1
- package/dist/public/assets/media-refresh-store-Df-ybzK5.js +1 -0
- package/dist/public/assets/session-seed-sdkQigYG.js +1 -0
- package/dist/public/assets/{tsMode-B6jh6JrU.js → tsMode-DRA0sEgo.js} +1 -1
- package/dist/public/assets/{use-find-controls-B_INkoQ4.js → use-find-controls-BN4SzWfk.js} +1 -1
- package/dist/public/assets/x-C-HTKvar.js +1 -0
- package/dist/public/index.html +7 -7
- package/package.json +1 -1
- package/dist/public/assets/EditorTabClose-NXE25Hkk.js +0 -1
- package/dist/public/assets/PdfViewer-CNMgA3ee.js +0 -2
- package/dist/public/assets/SettingsDialog-DA4x9Y9W.js +0 -1
- package/dist/public/assets/Workspace-DbEp1PKp.js +0 -8
- package/dist/public/assets/api-IpGGhtRp.js +0 -73
- package/dist/public/assets/chevron-down-DNyOBhEl.js +0 -1
- package/dist/public/assets/context-menu-Ca0Uv2BE.js +0 -1
- package/dist/public/assets/dialog-CFa2VFV0.js +0 -41
- package/dist/public/assets/dist-DEu2RD64.js +0 -1
- package/dist/public/assets/file-links-CcWnhnkT.js +0 -1
- package/dist/public/assets/index-C_32FmnW.css +0 -2
- package/dist/public/assets/index-fAfi8H1Y.js +0 -10
- package/dist/public/assets/jsx-runtime-ffCh33zF.js +0 -1
- package/dist/public/assets/media-refresh-store-CDq91uhk.js +0 -1
- package/dist/public/assets/session-seed-D2FbVBft.js +0 -1
- package/dist/public/assets/x-cVj9N3GX.js +0 -1
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n}from"./jsx-runtime-ffCh33zF.js";var r=e(t(),1),i=e(n(),1);function a(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var o=e=>{switch(e){case`success`:return l;case`info`:return d;case`warning`:return u;case`error`:return f;default:return null}},s=Array(12).fill(0),c=({visible:e,className:t})=>r.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},r.createElement(`div`,{className:`sonner-spinner`},s.map((e,t)=>r.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),l=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),u=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),d=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),f=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},r.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),p=r.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},r.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),r.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),ee=()=>{let[e,t]=r.useState(document.hidden);return r.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},te=1,m=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:te++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0||e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let i=Promise.resolve(e instanceof Function?e():e),a=n!==void 0,o,s=i.then(async e=>{if(o=[`resolve`,e],r.isValidElement(e))a=!1,this.create({id:n,type:`default`,message:e});else if(re(e)&&!e.ok){a=!1;let i=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){a=!1;let i=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){a=!1;let i=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof i==`object`&&!r.isValidElement(i)?i:{message:i};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||te++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ne=(e,t)=>{let n=t?.id||te++;return m.addToast({title:e,...t,id:n}),n},re=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,h=Object.assign(ne,{success:m.success,info:m.info,warning:m.warning,error:m.error,custom:m.custom,message:m.message,promise:m.promise,dismiss:m.dismiss,loading:m.loading},{getHistory:()=>m.toasts,getToasts:()=>m.getActiveToasts()});a(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function ie(e){return e.label!==void 0}var ae=3,oe=`24px`,se=`16px`,ce=4e3,le=356,ue=14,de=45,fe=200;function g(...e){return e.filter(Boolean).join(` `)}function pe(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var me=e=>{let{invert:t,toast:n,unstyled:i,interacting:a,setHeights:s,visibleToasts:l,heights:u,index:d,toasts:f,expanded:te,removeToast:m,defaultRichColors:ne,closeButton:re,style:h,cancelButtonStyle:ae,actionButtonStyle:oe,className:se=``,descriptionClassName:le=``,duration:ue,position:me,gap:he,expandByDefault:ge,classNames:_,icons:v,closeButtonAriaLabel:_e=`Close toast`}=e,[y,ve]=r.useState(null),[ye,b]=r.useState(null),[x,S]=r.useState(!1),[be,C]=r.useState(!1),[w,xe]=r.useState(!1),[Se,Ce]=r.useState(!1),[we,Te]=r.useState(!1),[Ee,T]=r.useState(0),[E,D]=r.useState(0),De=r.useRef(n.duration||ue||ce),Oe=r.useRef(null),O=r.useRef(null),ke=d===0,Ae=d+1<=l,k=n.type,je=n.dismissible!==!1,Me=n.className||``,Ne=n.descriptionClassName||``,A=r.useMemo(()=>u.findIndex(e=>e.toastId===n.id)||0,[u,n.id]),j=r.useMemo(()=>n.closeButton??re,[n.closeButton,re]),Pe=r.useMemo(()=>n.duration||ue||ce,[n.duration,ue]),Fe=r.useRef(0),Ie=r.useRef(0),Le=r.useRef(0),Re=r.useRef(null),[ze,Be]=me.split(`-`),Ve=r.useMemo(()=>u.reduce((e,t,n)=>n>=A?e:e+t.height,0),[u,A]),He=ee(),Ue=n.invert||t,We=k===`loading`;Ie.current=r.useMemo(()=>A*he+Ve,[A,Ve]),r.useEffect(()=>{De.current=Pe},[Pe]),r.useEffect(()=>{S(!0)},[]),r.useEffect(()=>{let e=O.current;if(e){let t=e.getBoundingClientRect().height;return D(t),s(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>s(e=>e.filter(e=>e.toastId!==n.id))}},[s,n.id]),r.useLayoutEffect(()=>{if(!x)return;let e=O.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,D(r),s(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[x,n.title,n.description,s,n.id,n.jsx,n.action,n.cancel]);let M=r.useCallback(()=>{C(!0),T(Ie.current),s(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},fe)},[n,m,s,Ie]);r.useEffect(()=>{if(n.promise&&k===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return te||a||He?(()=>{if(Le.current<Fe.current){let e=new Date().getTime()-Fe.current;De.current-=e}Le.current=new Date().getTime()})():De.current!==1/0&&(Fe.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),M()},De.current)),()=>clearTimeout(e)},[te,a,n,k,He,M]),r.useEffect(()=>{n.delete&&(M(),n.onDismiss==null||n.onDismiss.call(n,n))},[M,n.delete]);function Ge(){return v?.loading?r.createElement(`div`,{className:g(_?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":k===`loading`},v.loading):r.createElement(c,{className:g(_?.loader,n?.classNames?.loader),visible:k===`loading`})}let N=n.icon||v?.[k]||o(k);return r.createElement(`li`,{tabIndex:0,ref:O,className:g(se,Me,_?.toast,n?.classNames?.toast,_?.default,_?.[k],n?.classNames?.[k]),"data-sonner-toast":``,"data-rich-colors":n.richColors??ne,"data-styled":!(n.jsx||n.unstyled||i),"data-mounted":x,"data-promise":!!n.promise,"data-swiped":we,"data-removed":be,"data-visible":Ae,"data-y-position":ze,"data-x-position":Be,"data-index":d,"data-front":ke,"data-swiping":w,"data-dismissible":je,"data-type":k,"data-invert":Ue,"data-swipe-out":Se,"data-swipe-direction":ye,"data-expanded":!!(te||ge&&x),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${be?Ee:Ie.current}px`,"--initial-height":ge?`auto`:`${E}px`,...h,...n.style},onDragEnd:()=>{xe(!1),ve(null),Re.current=null},onPointerDown:e=>{e.button!==2&&(We||!je||(Oe.current=new Date,T(Ie.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(xe(!0),Re.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(Se||!je)return;Re.current=null;let e=Number(O.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(O.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-Oe.current?.getTime(),i=y===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=de||a>.11){T(Ie.current),n.onDismiss==null||n.onDismiss.call(n,n),b(y===`x`?e>0?`right`:`left`:t>0?`down`:`up`),M(),Ce(!0);return}else{var o,s;(o=O.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=O.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}Te(!1),xe(!1),ve(null)},onPointerMove:t=>{var n,r;if(!Re.current||!je||window.getSelection()?.toString().length>0)return;let i=t.clientY-Re.current.y,a=t.clientX-Re.current.x,o=e.swipeDirections??pe(me);!y&&(Math.abs(a)>1||Math.abs(i)>1)&&ve(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(y===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(y===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&Te(!0),(n=O.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=O.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},j&&!n.jsx&&k!==`loading`?r.createElement(`button`,{"aria-label":_e,"data-disabled":We,"data-close-button":!0,onClick:We||!je?()=>{}:()=>{M(),n.onDismiss==null||n.onDismiss.call(n,n)},className:g(_?.closeButton,n?.classNames?.closeButton)},v?.close??p):null,(k||n.icon||n.promise)&&n.icon!==null&&(v?.[k]!==null||n.icon)?r.createElement(`div`,{"data-icon":``,className:g(_?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||Ge():null,n.type===`loading`?null:N):null,r.createElement(`div`,{"data-content":``,className:g(_?.content,n?.classNames?.content)},r.createElement(`div`,{"data-title":``,className:g(_?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?r.createElement(`div`,{"data-description":``,className:g(le,Ne,_?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),r.isValidElement(n.cancel)?n.cancel:n.cancel&&ie(n.cancel)?r.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||ae,onClick:e=>{ie(n.cancel)&&je&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),M())},className:g(_?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,r.isValidElement(n.action)?n.action:n.action&&ie(n.action)?r.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||oe,onClick:e=>{ie(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&M())},className:g(_?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function he(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function ge(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?se:oe;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var _=r.forwardRef(function(e,t){let{id:n,invert:a,position:o=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:ee,duration:te,style:ne,visibleToasts:re=ae,toastOptions:h,dir:ie=he(),gap:oe=ue,icons:se,containerAriaLabel:ce=`Notifications`}=e,[de,fe]=r.useState([]),g=r.useMemo(()=>n?de.filter(e=>e.toasterId===n):de.filter(e=>!e.toasterId),[de,n]),pe=r.useMemo(()=>Array.from(new Set([o].concat(g.filter(e=>e.position).map(e=>e.position)))),[g,o]),[_,v]=r.useState([]),[_e,y]=r.useState(!1),[ve,ye]=r.useState(!1),[b,x]=r.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),S=r.useRef(null),be=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),C=r.useRef(null),w=r.useRef(!1),xe=r.useCallback(e=>{fe(t=>(t.find(t=>t.id===e.id)?.delete||m.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return r.useEffect(()=>m.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{fe(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{i.flushSync(()=>{fe(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[de]),r.useEffect(()=>{if(p!==`system`){x(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?x(`dark`):x(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{x(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{x(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),r.useEffect(()=>{de.length<=1&&y(!1)},[de]),r.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;y(!0),(t=S.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===S.current||S.current?.contains(document.activeElement))&&y(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),r.useEffect(()=>{if(S.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,w.current=!1)}},[S.current]),r.createElement(`section`,{ref:t,"aria-label":`${ce} ${be}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},pe.map((t,n)=>{let[i,o]=t.split(`-`);return g.length?r.createElement(`ol`,{key:t,dir:ie===`auto`?he():ie,tabIndex:-1,ref:S,className:u,"data-sonner-toaster":!0,"data-sonner-theme":b,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${_[0]?.height||0}px`,"--width":`${le}px`,"--gap":`${oe}px`,...ne,...ge(d,f)},onBlur:e=>{w.current&&!e.currentTarget.contains(e.relatedTarget)&&(w.current=!1,C.current&&=(C.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||w.current||(w.current=!0,C.current=e.relatedTarget)},onMouseEnter:()=>y(!0),onMouseMove:()=>y(!0),onMouseLeave:()=>{ve||y(!1)},onDragEnd:()=>y(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ye(!0)},onPointerUp:()=>ye(!1)},g.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>r.createElement(me,{key:n.id,icons:se,index:i,toast:n,defaultRichColors:ee,duration:h?.duration??te,className:h?.className,descriptionClassName:h?.descriptionClassName,invert:a,visibleToasts:re,closeButton:h?.closeButton??l,interacting:ve,position:t,style:h?.style,unstyled:h?.unstyled,classNames:h?.classNames,cancelButtonStyle:h?.cancelButtonStyle,actionButtonStyle:h?.actionButtonStyle,closeButtonAriaLabel:h?.closeButtonAriaLabel,removeToast:xe,toasts:g.filter(e=>e.position==n.position),heights:_.filter(e=>e.position==n.position),setHeights:v,expandByDefault:c,gap:oe,expanded:_e,swipeDirections:e.swipeDirections}))):null}))});function v(e){let t=new Set;return{get:()=>localStorage.getItem(e),set(n){n===null?localStorage.removeItem(e):localStorage.setItem(e,n);for(let e of t)e()},subscribe(e){return t.add(e),()=>t.delete(e)}}}var _e=v(`puddle.token`);function y(){let e=/[#&]token=([0-9a-fA-F]+)/.exec(window.location.hash);if(!e)return;_e.set(e[1]);let t=new URL(window.location.href);t.hash=``,history.replaceState(null,``,t)}function ve(){_e.set(null)}var ye;function b(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var x=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},S=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ye=globalThis).__zod_globalConfig??(ye.__zod_globalConfig={});var be=globalThis.__zod_globalConfig;function C(e){return e&&Object.assign(be,e),be}function w(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function xe(e,t){return typeof t==`bigint`?t.toString():t}function Se(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function Ce(e){return e==null}function we(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Te(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ee=Symbol(`evaluating`);function T(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ee)return r===void 0&&(r=Ee,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function D(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function De(e){return JSON.stringify(e)}function Oe(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var O=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ke(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ae=Se(()=>{if(be.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function k(e){if(ke(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(ke(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function je(e){return k(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Me=new Set([`string`,`number`,`symbol`]);function Ne(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function A(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Pe(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var Fe={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ie(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return A(e,D(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return E(this,`shape`,e),e},checks:[]}))}function Le(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return A(e,D(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return E(this,`shape`,r),r},checks:[]}))}function Re(e,t){if(!k(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return A(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return E(this,`shape`,n),n}}))}function ze(e,t){if(!k(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return A(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return E(this,`shape`,n),n}}))}function Be(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return A(e,D(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return E(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ve(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return A(t,D(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return E(this,`shape`,i),i},checks:[]}))}function He(e,t,n){return A(t,D(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return E(this,`shape`,i),i}}))}function Ue(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function We(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function M(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ge(e){return typeof e==`string`?e:e?.message}function N(e,t,n){let r=e.message?e.message:Ge(e.inst?._zod.def?.error?.(e))??Ge(t?.error?.(e))??Ge(n.customError?.(e))??Ge(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function Ke(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function qe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Je=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,xe,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ye=b(`$ZodError`,Je),Xe=b(`$ZodError`,Je,{Parent:Error});function Ze(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Qe(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var $e=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new x;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>N(e,a,C())));throw O(t,i?.callee),t}return o.value},et=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>N(e,a,C())));throw O(t,i?.callee),t}return o.value},tt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new x;return a.issues.length?{success:!1,error:new(e??Ye)(a.issues.map(e=>N(e,i,C())))}:{success:!0,data:a.value}},nt=tt(Xe),rt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>N(e,i,C())))}:{success:!0,data:a.value}},it=rt(Xe),at=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return $e(e)(t,n,i)},ot=e=>(t,n,r)=>$e(e)(t,n,r),st=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return et(e)(t,n,i)},ct=e=>async(t,n,r)=>et(e)(t,n,r),lt=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return tt(e)(t,n,i)},ut=e=>(t,n,r)=>tt(e)(t,n,r),dt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rt(e)(t,n,i)},ft=e=>async(t,n,r)=>rt(e)(t,n,r),pt=/^[cC][0-9a-z]{6,}$/,mt=/^[0-9a-z]+$/,ht=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,gt=/^[0-9a-vA-V]{20}$/,_t=/^[A-Za-z0-9]{27}$/,vt=/^[a-zA-Z0-9_-]{21}$/,yt=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bt=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,xt=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,St=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ct=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function wt(){return new RegExp(Ct,`u`)}var Tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Et=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Dt=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ot=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,At=/^[A-Za-z0-9_-]*$/,jt=/^https?$/,Mt=/^\+[1-9]\d{6,14}$/,Nt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Pt=RegExp(`^${Nt}$`);function Ft(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function It(e){return RegExp(`^${Ft(e)}$`)}function Lt(e){let t=Ft({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Nt}T(?:${r})$`)}var Rt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},zt=/^-?\d+$/,Bt=/^-?\d+(?:\.\d+)?$/,Vt=/^(?:true|false)$/i,Ht=/^[^A-Z]*$/,Ut=/^[^a-z]*$/,P=b(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wt={number:`number`,bigint:`bigint`,object:`date`},Gt=b(`$ZodCheckLessThan`,(e,t)=>{P.init(e,t);let n=Wt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Kt=b(`$ZodCheckGreaterThan`,(e,t)=>{P.init(e,t);let n=Wt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qt=b(`$ZodCheckMultipleOf`,(e,t)=>{P.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):Te(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Jt=b(`$ZodCheckNumberFormat`,(e,t)=>{P.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Fe[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=zt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Yt=b(`$ZodCheckMaxLength`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=Ke(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Xt=b(`$ZodCheckMinLength`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=Ke(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Zt=b(`$ZodCheckLengthEquals`,(e,t)=>{var n;P.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!Ce(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=Ke(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Qt=b(`$ZodCheckStringFormat`,(e,t)=>{var n,r;P.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),$t=b(`$ZodCheckRegex`,(e,t)=>{Qt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),en=b(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ht,Qt.init(e,t)}),tn=b(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ut,Qt.init(e,t)}),nn=b(`$ZodCheckIncludes`,(e,t)=>{P.init(e,t);let n=Ne(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),rn=b(`$ZodCheckStartsWith`,(e,t)=>{P.init(e,t);let n=RegExp(`^${Ne(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),an=b(`$ZodCheckEndsWith`,(e,t)=>{P.init(e,t);let n=RegExp(`.*${Ne(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),on=b(`$ZodCheckOverwrite`,(e,t)=>{P.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),sn=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
-
`))}},cn={major:4,minor:4,patch:3},F=b(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=cn;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=Ue(e),i;for(let a of t){if(a._zod.def.when){if(We(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new x;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ue(e,t))});else{if(e.issues.length===t)continue;r||=Ue(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ue(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new x;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new x;return o.then(e=>t(e,r,a))}return t(o,r,a)}}T(e,`~standard`,()=>({validate:t=>{try{let n=nt(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return it(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),ln=b(`$ZodString`,(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rt(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),I=b(`$ZodStringFormat`,(e,t)=>{Qt.init(e,t),ln.init(e,t)}),un=b(`$ZodGUID`,(e,t)=>{t.pattern??=bt,I.init(e,t)}),dn=b(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=xt(e)}else t.pattern??=xt();I.init(e,t)}),fn=b(`$ZodEmail`,(e,t)=>{t.pattern??=St,I.init(e,t)}),pn=b(`$ZodURL`,(e,t)=>{I.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===jt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),mn=b(`$ZodEmoji`,(e,t)=>{t.pattern??=wt(),I.init(e,t)}),hn=b(`$ZodNanoID`,(e,t)=>{t.pattern??=vt,I.init(e,t)}),gn=b(`$ZodCUID`,(e,t)=>{t.pattern??=pt,I.init(e,t)}),_n=b(`$ZodCUID2`,(e,t)=>{t.pattern??=mt,I.init(e,t)}),vn=b(`$ZodULID`,(e,t)=>{t.pattern??=ht,I.init(e,t)}),yn=b(`$ZodXID`,(e,t)=>{t.pattern??=gt,I.init(e,t)}),bn=b(`$ZodKSUID`,(e,t)=>{t.pattern??=_t,I.init(e,t)}),xn=b(`$ZodISODateTime`,(e,t)=>{t.pattern??=Lt(t),I.init(e,t)}),Sn=b(`$ZodISODate`,(e,t)=>{t.pattern??=Pt,I.init(e,t)}),Cn=b(`$ZodISOTime`,(e,t)=>{t.pattern??=It(t),I.init(e,t)}),wn=b(`$ZodISODuration`,(e,t)=>{t.pattern??=yt,I.init(e,t)}),Tn=b(`$ZodIPv4`,(e,t)=>{t.pattern??=Tt,I.init(e,t),e._zod.bag.format=`ipv4`}),En=b(`$ZodIPv6`,(e,t)=>{t.pattern??=Et,I.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Dn=b(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Dt,I.init(e,t)}),On=b(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ot,I.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function kn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var An=b(`$ZodBase64`,(e,t)=>{t.pattern??=kt,I.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{kn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function jn(e){if(!At.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return kn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Mn=b(`$ZodBase64URL`,(e,t)=>{t.pattern??=At,I.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{jn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Nn=b(`$ZodE164`,(e,t)=>{t.pattern??=Mt,I.init(e,t)});function Pn(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Fn=b(`$ZodJWT`,(e,t)=>{I.init(e,t),e._zod.check=n=>{Pn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),In=b(`$ZodNumber`,(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??Bt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Ln=b(`$ZodNumberFormat`,(e,t)=>{Jt.init(e,t),In.init(e,t)}),Rn=b(`$ZodBoolean`,(e,t)=>{F.init(e,t),e._zod.pattern=Vt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),zn=b(`$ZodUnknown`,(e,t)=>{F.init(e,t),e._zod.parse=e=>e}),Bn=b(`$ZodNever`,(e,t)=>{F.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Vn(e,t,n){e.issues.length&&t.issues.push(...M(n,e.issues)),t.value[n]=e.value}var Hn=b(`$ZodArray`,(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Vn(t,n,e))):Vn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Un(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...M(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Wn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=Pe(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Gn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Un(e,n,i,t,u,d))):Un(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Kn=b(`$ZodObject`,(e,t)=>{if(F.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=Se(()=>Wn(t));T(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=ke,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Un(n,t,e,s,r,i))):Un(a,t,e,s,r,i)}return i?Gn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),qn=b(`$ZodObjectJIT`,(e,t)=>{Kn.init(e,t);let n=e._zod.parse,r=Se(()=>Wn(t)),i=e=>{let t=new sn([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=De(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=De(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
4
|
-
if (${n}.issues.length) {
|
|
5
|
-
if (${o} in input) {
|
|
6
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
7
|
-
...iss,
|
|
8
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
9
|
-
})));
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (${n}.value === undefined) {
|
|
14
|
-
if (${o} in input) {
|
|
15
|
-
newResult[${o}] = undefined;
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
newResult[${o}] = ${n}.value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
`):c?t.write(`
|
|
22
|
-
if (${n}.issues.length) {
|
|
23
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
24
|
-
...iss,
|
|
25
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
26
|
-
})));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (${n}.value === undefined) {
|
|
30
|
-
if (${o} in input) {
|
|
31
|
-
newResult[${o}] = undefined;
|
|
32
|
-
}
|
|
33
|
-
} else {
|
|
34
|
-
newResult[${o}] = ${n}.value;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
`):t.write(`
|
|
38
|
-
const ${n}_present = ${o} in input;
|
|
39
|
-
if (${n}.issues.length) {
|
|
40
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
41
|
-
...iss,
|
|
42
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
43
|
-
})));
|
|
44
|
-
}
|
|
45
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
46
|
-
payload.issues.push({
|
|
47
|
-
code: "invalid_type",
|
|
48
|
-
expected: "nonoptional",
|
|
49
|
-
input: undefined,
|
|
50
|
-
path: [${o}]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (${n}_present) {
|
|
55
|
-
if (${n}.value === undefined) {
|
|
56
|
-
newResult[${o}] = undefined;
|
|
57
|
-
} else {
|
|
58
|
-
newResult[${o}] = ${n}.value;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ke,s=!be.jitless,c=s&&Ae.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Gn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Jn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ue(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>N(e,r,C())))}),t)}var Yn=b(`$ZodUnion`,(e,t)=>{F.init(e,t),T(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),T(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),T(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),T(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>we(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Jn(t,r,e,i)):Jn(o,r,e,i)}}),Xn=b(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Yn.init(e,t);let n=e._zod.parse;T(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Se(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ke(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Zn=b(`$ZodIntersection`,(e,t)=>{F.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>$n(e,t,n)):$n(e,i,a)}});function Qn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(k(e)&&k(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Qn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Qn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $n(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Ue(e))return e;let o=Qn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var er=b(`$ZodRecord`,(e,t)=>{F.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!k(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>N(e,r,C())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...M(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...M(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&Bt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>N(e,r,C())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...M(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...M(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),tr=b(`$ZodEnum`,(e,t)=>{F.init(e,t);let n=w(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Me.has(typeof e)).map(e=>typeof e==`string`?Ne(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),nr=b(`$ZodLiteral`,(e,t)=>{if(F.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Ne(e):e?Ne(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),rr=b(`$ZodTransform`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new S(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new x;return n.value=i,n.fallback=!0,n}});function ir(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var ar=b(`$ZodOptional`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),T(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${we(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>ir(e,r)):ir(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),or=b(`$ZodExactOptional`,(e,t)=>{ar.init(e,t),T(e._zod,`values`,()=>t.innerType._zod.values),T(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),sr=b(`$ZodNullable`,(e,t)=>{F.init(e,t),T(e._zod,`optin`,()=>t.innerType._zod.optin),T(e._zod,`optout`,()=>t.innerType._zod.optout),T(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${we(e.source)}|null)$`):void 0}),T(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),cr=b(`$ZodDefault`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>lr(e,t)):lr(r,t)}});function lr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ur=b(`$ZodPrefault`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),dr=b(`$ZodNonOptional`,(e,t)=>{F.init(e,t),T(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>fr(t,e)):fr(i,e)}});function fr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var pr=b(`$ZodCatch`,(e,t)=>{F.init(e,t),e._zod.optin=`optional`,T(e._zod,`optout`,()=>t.innerType._zod.optout),T(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>N(e,n,C()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>N(e,n,C()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),mr=b(`$ZodPipe`,(e,t)=>{F.init(e,t),T(e._zod,`values`,()=>t.in._zod.values),T(e._zod,`optin`,()=>t.in._zod.optin),T(e._zod,`optout`,()=>t.out._zod.optout),T(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>hr(e,t.in,n)):hr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>hr(e,t.out,n)):hr(r,t.out,n)}});function hr(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var gr=b(`$ZodReadonly`,(e,t)=>{F.init(e,t),T(e._zod,`propValues`,()=>t.innerType._zod.propValues),T(e._zod,`values`,()=>t.innerType._zod.values),T(e._zod,`optin`,()=>t.innerType?._zod?.optin),T(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(_r):_r(r)}});function _r(e){return e.value=Object.freeze(e.value),e}var vr=b(`$ZodLazy`,(e,t)=>{F.init(e,t),T(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),T(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),T(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),T(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),T(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),yr=b(`$ZodCustom`,(e,t)=>{P.init(e,t),F.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>br(t,n,r,e));br(i,n,r,e)}});function br(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(qe(e))}}var xr,Sr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Cr(){return new Sr}(xr=globalThis).__zod_globalRegistry??(xr.__zod_globalRegistry=Cr());var wr=globalThis.__zod_globalRegistry;function Tr(e,t){return new e({type:`string`,...j(t)})}function Er(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...j(t)})}function Dr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...j(t)})}function Or(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...j(t)})}function kr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...j(t)})}function Ar(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...j(t)})}function jr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...j(t)})}function Mr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}function Nr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...j(t)})}function Pr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...j(t)})}function Fr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...j(t)})}function Ir(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...j(t)})}function Lr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...j(t)})}function Rr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...j(t)})}function zr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...j(t)})}function Br(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...j(t)})}function Vr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...j(t)})}function Hr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...j(t)})}function Ur(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...j(t)})}function Wr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...j(t)})}function Gr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...j(t)})}function Kr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...j(t)})}function qr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...j(t)})}function Jr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...j(t)})}function Yr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...j(t)})}function Xr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...j(t)})}function Zr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...j(t)})}function Qr(e,t){return new e({type:`number`,checks:[],...j(t)})}function $r(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...j(t)})}function ei(e,t){return new e({type:`boolean`,...j(t)})}function ti(e){return new e({type:`unknown`})}function ni(e,t){return new e({type:`never`,...j(t)})}function ri(e,t){return new Gt({check:`less_than`,...j(t),value:e,inclusive:!1})}function ii(e,t){return new Gt({check:`less_than`,...j(t),value:e,inclusive:!0})}function ai(e,t){return new Kt({check:`greater_than`,...j(t),value:e,inclusive:!1})}function oi(e,t){return new Kt({check:`greater_than`,...j(t),value:e,inclusive:!0})}function si(e,t){return new qt({check:`multiple_of`,...j(t),value:e})}function ci(e,t){return new Yt({check:`max_length`,...j(t),maximum:e})}function li(e,t){return new Xt({check:`min_length`,...j(t),minimum:e})}function ui(e,t){return new Zt({check:`length_equals`,...j(t),length:e})}function di(e,t){return new $t({check:`string_format`,format:`regex`,...j(t),pattern:e})}function fi(e){return new en({check:`string_format`,format:`lowercase`,...j(e)})}function pi(e){return new tn({check:`string_format`,format:`uppercase`,...j(e)})}function mi(e,t){return new nn({check:`string_format`,format:`includes`,...j(t),includes:e})}function hi(e,t){return new rn({check:`string_format`,format:`starts_with`,...j(t),prefix:e})}function gi(e,t){return new an({check:`string_format`,format:`ends_with`,...j(t),suffix:e})}function _i(e){return new on({check:`overwrite`,tx:e})}function vi(e){return _i(t=>t.normalize(e))}function yi(){return _i(e=>e.trim())}function bi(){return _i(e=>e.toLowerCase())}function xi(){return _i(e=>e.toUpperCase())}function Si(){return _i(e=>Oe(e))}function Ci(e,t,n){return new e({type:`array`,element:t,...j(n)})}function wi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...j(n)})}function Ti(e,t){let n=Ei(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(qe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(qe(r))}},e(t.value,t)),t);return n}function Ei(e,t){let n=new P({check:`custom`,...j(t)});return n._zod.check=e,n}function Di(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??wr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function L(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,L(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&R(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Oi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
63
|
-
|
|
64
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ki(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:ji(t,`input`,e.processors),output:ji(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function R(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return R(r.element,n);if(r.type===`set`)return R(r.valueType,n);if(r.type===`lazy`)return R(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return R(r.innerType,n);if(r.type===`intersection`)return R(r.left,n)||R(r.right,n);if(r.type===`record`||r.type===`map`)return R(r.keyType,n)||R(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:R(r.in,n)||R(r.out,n);if(r.type===`object`){for(let e in r.shape)if(R(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(R(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(R(e,n))return!0;return!!(r.rest&&R(r.rest,n))}return!1}var Ai=(e,t={})=>n=>{let r=Di({...n,processors:t});return L(e,r),Oi(r,e),ki(r,e)},ji=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Di({...i??{},target:a,io:t,processors:n});return L(e,o),Oi(o,e),ki(o,e)},Mi={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ni=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Mi[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Pi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Fi=(e,t,n,r)=>{n.type=`boolean`},Ii=(e,t,n,r)=>{n.not={}},Li=(e,t,n,r)=>{let i=e._zod.def,a=w(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ri=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},zi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Bi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Vi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=L(a.element,t,{...r,path:[...r.path,`items`]})},Hi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=L(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=L(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ui=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>L(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Wi=(e,t,n,r)=>{let i=e._zod.def,a=L(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=L(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Gi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=L(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=L(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=L(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ki=(e,t,n,r)=>{let i=e._zod.def,a=L(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},qi=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ji=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Yi=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Xi=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Zi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;L(o,t,r);let s=t.seen.get(e);s.ref=o},Qi=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},$i=(e,t,n,r)=>{let i=e._zod.def;L(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ea=(e,t,n,r)=>{let i=e._zod.innerType;L(i,t,r);let a=t.seen.get(e);a.ref=i},ta=b(`ZodISODateTime`,(e,t)=>{xn.init(e,t),H.init(e,t)});function na(e){return Jr(ta,e)}var ra=b(`ZodISODate`,(e,t)=>{Sn.init(e,t),H.init(e,t)});function ia(e){return Yr(ra,e)}var aa=b(`ZodISOTime`,(e,t)=>{Cn.init(e,t),H.init(e,t)});function oa(e){return Xr(aa,e)}var sa=b(`ZodISODuration`,(e,t)=>{wn.init(e,t),H.init(e,t)});function ca(e){return Zr(sa,e)}var z=b(`ZodError`,(e,t)=>{Ye.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Qe(e,t)},flatten:{value:t=>Ze(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,xe,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xe,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),la=$e(z),ua=et(z),da=tt(z),fa=rt(z),pa=at(z),ma=ot(z),ha=st(z),ga=ct(z),_a=lt(z),va=ut(z),ya=dt(z),ba=ft(z),xa=new WeakMap;function Sa(e,t,n){let r=Object.getPrototypeOf(e),i=xa.get(r);if(i||(i=new Set,xa.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var B=b(`ZodType`,(e,t)=>(F.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ji(e,`input`),output:ji(e,`output`)}}),e.toJSONSchema=Ai(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>la(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>da(e,t,n),e.parseAsync=async(t,n)=>ua(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>fa(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>pa(e,t,n),e.decode=(t,n)=>ma(e,t,n),e.encodeAsync=async(t,n)=>ha(e,t,n),e.decodeAsync=async(t,n)=>ga(e,t,n),e.safeEncode=(t,n)=>_a(e,t,n),e.safeDecode=(t,n)=>va(e,t,n),e.safeEncodeAsync=async(t,n)=>ya(e,t,n),e.safeDecodeAsync=async(t,n)=>ba(e,t,n),Sa(e,`ZodType`,{check(...e){let t=this.def;return this.clone(D(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return A(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Io(e,t))},superRefine(e,t){return this.check(Lo(e,t))},overwrite(e){return this.check(_i(e))},optional(){return go(this)},exactOptional(){return vo(this)},nullable(){return bo(this)},nullish(){return go(bo(this))},nonoptional(e){return Eo(this,e)},array(){return G(this)},or(e){return ro([this,e])},and(e){return so(this,e)},transform(e){return Ao(this,mo(e))},default(e){return So(this,e)},prefault(e){return wo(this,e)},catch(e){return Oo(this,e)},pipe(e){return Ao(this,e)},readonly(){return Mo(this)},describe(e){let t=this.clone();return wr.add(t,{description:e}),t},meta(...e){if(e.length===0)return wr.get(this);let t=this.clone();return wr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return wr.get(e)?.description},configurable:!0}),e)),Ca=b(`_ZodString`,(e,t)=>{ln.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Sa(e,`_ZodString`,{regex(...e){return this.check(di(...e))},includes(...e){return this.check(mi(...e))},startsWith(...e){return this.check(hi(...e))},endsWith(...e){return this.check(gi(...e))},min(...e){return this.check(li(...e))},max(...e){return this.check(ci(...e))},length(...e){return this.check(ui(...e))},nonempty(...e){return this.check(li(1,...e))},lowercase(e){return this.check(fi(e))},uppercase(e){return this.check(pi(e))},trim(){return this.check(yi())},normalize(...e){return this.check(vi(...e))},toLowerCase(){return this.check(bi())},toUpperCase(){return this.check(xi())},slugify(){return this.check(Si())}})}),wa=b(`ZodString`,(e,t)=>{ln.init(e,t),Ca.init(e,t),e.email=t=>e.check(Er(Ta,t)),e.url=t=>e.check(Mr(ka,t)),e.jwt=t=>e.check(qr(Wa,t)),e.emoji=t=>e.check(Nr(Aa,t)),e.guid=t=>e.check(Dr(Ea,t)),e.uuid=t=>e.check(Or(Da,t)),e.uuidv4=t=>e.check(kr(Da,t)),e.uuidv6=t=>e.check(Ar(Da,t)),e.uuidv7=t=>e.check(jr(Da,t)),e.nanoid=t=>e.check(Pr(ja,t)),e.guid=t=>e.check(Dr(Ea,t)),e.cuid=t=>e.check(Fr(Ma,t)),e.cuid2=t=>e.check(Ir(Na,t)),e.ulid=t=>e.check(Lr(Pa,t)),e.base64=t=>e.check(Wr(Va,t)),e.base64url=t=>e.check(Gr(Ha,t)),e.xid=t=>e.check(Rr(Fa,t)),e.ksuid=t=>e.check(zr(Ia,t)),e.ipv4=t=>e.check(Br(La,t)),e.ipv6=t=>e.check(Vr(Ra,t)),e.cidrv4=t=>e.check(Hr(za,t)),e.cidrv6=t=>e.check(Ur(Ba,t)),e.e164=t=>e.check(Kr(Ua,t)),e.datetime=t=>e.check(na(t)),e.date=t=>e.check(ia(t)),e.time=t=>e.check(oa(t)),e.duration=t=>e.check(ca(t))});function V(e){return Tr(wa,e)}var H=b(`ZodStringFormat`,(e,t)=>{I.init(e,t),Ca.init(e,t)}),Ta=b(`ZodEmail`,(e,t)=>{fn.init(e,t),H.init(e,t)}),Ea=b(`ZodGUID`,(e,t)=>{un.init(e,t),H.init(e,t)}),Da=b(`ZodUUID`,(e,t)=>{dn.init(e,t),H.init(e,t)});function Oa(e){return Or(Da,e)}var ka=b(`ZodURL`,(e,t)=>{pn.init(e,t),H.init(e,t)}),Aa=b(`ZodEmoji`,(e,t)=>{mn.init(e,t),H.init(e,t)}),ja=b(`ZodNanoID`,(e,t)=>{hn.init(e,t),H.init(e,t)}),Ma=b(`ZodCUID`,(e,t)=>{gn.init(e,t),H.init(e,t)}),Na=b(`ZodCUID2`,(e,t)=>{_n.init(e,t),H.init(e,t)}),Pa=b(`ZodULID`,(e,t)=>{vn.init(e,t),H.init(e,t)}),Fa=b(`ZodXID`,(e,t)=>{yn.init(e,t),H.init(e,t)}),Ia=b(`ZodKSUID`,(e,t)=>{bn.init(e,t),H.init(e,t)}),La=b(`ZodIPv4`,(e,t)=>{Tn.init(e,t),H.init(e,t)}),Ra=b(`ZodIPv6`,(e,t)=>{En.init(e,t),H.init(e,t)}),za=b(`ZodCIDRv4`,(e,t)=>{Dn.init(e,t),H.init(e,t)}),Ba=b(`ZodCIDRv6`,(e,t)=>{On.init(e,t),H.init(e,t)}),Va=b(`ZodBase64`,(e,t)=>{An.init(e,t),H.init(e,t)}),Ha=b(`ZodBase64URL`,(e,t)=>{Mn.init(e,t),H.init(e,t)}),Ua=b(`ZodE164`,(e,t)=>{Nn.init(e,t),H.init(e,t)}),Wa=b(`ZodJWT`,(e,t)=>{Fn.init(e,t),H.init(e,t)}),Ga=b(`ZodNumber`,(e,t)=>{In.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),Sa(e,`ZodNumber`,{gt(e,t){return this.check(ai(e,t))},gte(e,t){return this.check(oi(e,t))},min(e,t){return this.check(oi(e,t))},lt(e,t){return this.check(ri(e,t))},lte(e,t){return this.check(ii(e,t))},max(e,t){return this.check(ii(e,t))},int(e){return this.check(qa(e))},safe(e){return this.check(qa(e))},positive(e){return this.check(ai(0,e))},nonnegative(e){return this.check(oi(0,e))},negative(e){return this.check(ri(0,e))},nonpositive(e){return this.check(ii(0,e))},multipleOf(e,t){return this.check(si(e,t))},step(e,t){return this.check(si(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function U(e){return Qr(Ga,e)}var Ka=b(`ZodNumberFormat`,(e,t)=>{Ln.init(e,t),Ga.init(e,t)});function qa(e){return $r(Ka,e)}var Ja=b(`ZodBoolean`,(e,t)=>{Rn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r)});function W(e){return ei(Ja,e)}var Ya=b(`ZodUnknown`,(e,t)=>{zn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Xa(){return ti(Ya)}var Za=b(`ZodNever`,(e,t)=>{Bn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r)});function Qa(e){return ni(Za,e)}var $a=b(`ZodArray`,(e,t)=>{Hn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.element=t.element,Sa(e,`ZodArray`,{min(e,t){return this.check(li(e,t))},nonempty(e){return this.check(li(1,e))},max(e,t){return this.check(ci(e,t))},length(e,t){return this.check(ui(e,t))},unwrap(){return this.element}})});function G(e,t){return Ci($a,e,t)}var eo=b(`ZodObject`,(e,t)=>{qn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),T(e,`shape`,()=>t.shape),Sa(e,`ZodObject`,{keyof(){return q(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Xa()})},loose(){return this.clone({...this._zod.def,catchall:Xa()})},strict(){return this.clone({...this._zod.def,catchall:Qa()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Re(this,e)},safeExtend(e){return ze(this,e)},merge(e){return Be(this,e)},pick(e){return Ie(this,e)},omit(e){return Le(this,e)},partial(...e){return Ve(ho,this,e[0])},required(...e){return He(To,this,e[0])}})});function K(e,t){return new eo({type:`object`,shape:e??{},...j(t)})}function to(e,t){return new eo({type:`object`,shape:e,catchall:Xa(),...j(t)})}var no=b(`ZodUnion`,(e,t)=>{Yn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.options=t.options});function ro(e,t){return new no({type:`union`,options:e,...j(t)})}var io=b(`ZodDiscriminatedUnion`,(e,t)=>{no.init(e,t),Xn.init(e,t)});function ao(e,t,n){return new io({type:`union`,options:t,discriminator:e,...j(n)})}var oo=b(`ZodIntersection`,(e,t)=>{Zn.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r)});function so(e,t){return new oo({type:`intersection`,left:e,right:t})}var co=b(`ZodRecord`,(e,t)=>{er.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function lo(e,t,n){return!t||!t._zod?new co({type:`record`,keyType:V(),valueType:e,...j(t)}):new co({type:`record`,keyType:e,valueType:t,...j(n)})}var uo=b(`ZodEnum`,(e,t)=>{tr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new uo({...t,checks:[],...j(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new uo({...t,checks:[],...j(r),entries:i})}});function q(e,t){return new uo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...j(t)})}var fo=b(`ZodLiteral`,(e,t)=>{nr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function J(e,t){return new fo({type:`literal`,values:Array.isArray(e)?e:[e],...j(t)})}var po=b(`ZodTransform`,(e,t)=>{rr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new S(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(qe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(qe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function mo(e){return new po({type:`transform`,transform:e})}var ho=b(`ZodOptional`,(e,t)=>{ar.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function go(e){return new ho({type:`optional`,innerType:e})}var _o=b(`ZodExactOptional`,(e,t)=>{or.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$i(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vo(e){return new _o({type:`optional`,innerType:e})}var yo=b(`ZodNullable`,(e,t)=>{sr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bo(e){return new yo({type:`nullable`,innerType:e})}var xo=b(`ZodDefault`,(e,t)=>{cr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function So(e,t){return new xo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():je(t)}})}var Co=b(`ZodPrefault`,(e,t)=>{ur.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wo(e,t){return new Co({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():je(t)}})}var To=b(`ZodNonOptional`,(e,t)=>{dr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eo(e,t){return new To({type:`nonoptional`,innerType:e,...j(t)})}var Do=b(`ZodCatch`,(e,t)=>{pr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Oo(e,t){return new Do({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var ko=b(`ZodPipe`,(e,t)=>{mr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zi(e,t,n,r),e.in=t.in,e.out=t.out});function Ao(e,t){return new ko({type:`pipe`,in:e,out:t})}var jo=b(`ZodReadonly`,(e,t)=>{gr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mo(e){return new jo({type:`readonly`,innerType:e})}var No=b(`ZodLazy`,(e,t)=>{vr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ea(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Po(e){return new No({type:`lazy`,getter:e})}var Fo=b(`ZodCustom`,(e,t)=>{yr.init(e,t),B.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r)});function Io(e,t={}){return wi(Fo,e,t)}function Lo(e,t){return Ti(e,t)}var Ro=K({error:K({code:V(),message:V(),details:lo(V(),Xa()).optional()})}),Y=na({offset:!0}),X=U().int().positive(),Z=Oa(),zo=V().regex(/^[0-9a-f]{10}$/),Q=V().regex(/^[0-9a-f]{10}$/);K({version:V(),protocol:K({major:U().int().nonnegative(),minor:U().int().nonnegative()})}),ro([K({nonce:V().min(16),state:q([`working`,`waiting_input`])}),K({nonce:V().min(16),event:q([`session_start`,`session_end`]),agent_session_ref:V().min(1).optional(),cwd:V().min(1),source:q([`startup`,`resume`,`clear`,`fork`,`compact`,`exit`,`other`]),parent_agent_session_ref:V().min(1).optional(),native_title:V().optional(),native_created_at:na({offset:!0}).optional(),native_updated_at:na({offset:!0}).optional()})]);var $={port:U().int().min(1).max(65535),autoResume:W(),fetchIntervalMinutes:U().int().min(1),logMaxBytes:U().int().min(64*1024),replayBytes:U().int().min(1024),uiStateRetentionDays:U().int().min(1),agentPath:V(),displayName:V().max(64)};K({port:$.port.default(7434),autoResume:$.autoResume.default(!0),fetchIntervalMinutes:$.fetchIntervalMinutes.default(15),logMaxBytes:$.logMaxBytes.default(10*1024*1024),replayBytes:$.replayBytes.default(256*1024),uiStateRetentionDays:$.uiStateRetentionDays.default(90),agentPath:$.agentPath.default(`~/.local/bin:~/bin:/opt/homebrew/bin:/usr/local/bin`),displayName:$.displayName.default(``)}),K($).partial(),K({entries:G(K({path:V(),name:V(),is_git:W()}))}),K({username:V(),hostname:V(),home:V(),displayName:V().optional()});var Bo=V().min(1).max(64).regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/,`letters, digits, dot, underscore and hyphen only`),Vo=`puddle/`,Ho=`[puddle onboarding] This is a freshly created git worktree for this task. Before starting, set up the environment:
|
|
65
|
-
|
|
66
|
-
1. Standing setup rules for this repository (user-authored):
|
|
67
|
-
{{rules}}
|
|
68
|
-
|
|
69
|
-
2. Inspect the codebase for setup requirements (README, CONTRIBUTING, lockfiles, .tool-versions, pyproject.toml, package.json, …).
|
|
70
|
-
3. Apply what the rules above settle without asking. Ask the user about anything they leave open, stating trade-offs where relevant (e.g. a symlinked .venv saves gigabytes per worktree, but parallel sessions then share mutable dependency state).
|
|
71
|
-
4. If the user states a standing rule for all future worktrees ("always…", "never…", "from now on…"), write the complete updated rules to \`.puddle/onboarding-notes.md\` in this worktree — full replacement, user-owned prose; record their decision, don't invent policy.
|
|
72
|
-
|
|
73
|
-
Then proceed with the task below (or await instructions if none is given).`,Uo=`[puddle] You are joining an existing branch and worktree that other agents may be working in concurrently. Files can change underneath you, so re-check the working tree before you act, and avoid disruptive git operations (resetting, force-pushing, or deleting the branch) that would disrupt work already in progress by others.`,Wo=`This session was interrupted (daemon or machine restart). Processes you started are gone; re-verify your environment before continuing.`,Go=[[`name`,`the resolved display name: user rename, else agent name, else sequence, else id`],[`title`,`the user rename override only (empty when unset)`],[`agentName`,`the agent's own session name (empty when the agent has not named it)`],[`sequence`,`the terminal-title name the process set (empty when it set none)`],[`branch`,`the git branch`],[`cwd`,`the worktree directory's name`],[`id`,`the first 8 characters of the session id`],[`status`,`the session status (running, waiting_input, …)`],[`agent`,`the agent type (empty for terminal sessions)`],[`separator`,`an em dash that appears only between two non-empty neighbours`]],Ko="${name}",qo=[`navy`,`gold`,`blue`,`green`,`red`,`violet`,`cyan`];K({id:Q,name:Bo,branch_prefix:V(),icon:V().nullable().default(null),icon_colour:V().nullable().default(null),created_at:Y}),K({name:Bo,branch_prefix:V().max(64).optional()}),K({name:Bo.optional(),branch_prefix:V().max(64).optional(),icon:V().max(64).nullable().optional(),icon_colour:V().max(32).nullable().optional()});var Jo=to({baseBranch:V().optional(),separateBranch:W().optional(),separateWorktree:W().optional()}),Yo=to({agent:Jo.optional(),terminal:Jo.optional()});to({allowSkipPermissions:W().default(!1),captureSessionEnv:W().default(!0),terminalAppShortcuts:W().default(!0),onboardingTemplate:V().optional(),concurrentTemplate:V().optional(),restartTemplate:V().optional(),tabTitleTemplate:V().optional(),projectOrder:G(V()).optional(),sessionDefaults:Yo.optional(),hotkeys:lo(V(),V()).optional()}),lo(V(),Xa());var Xo=V().regex(/^untitled-\d+\.md$/);K({name:Xo}),K({name:Xo,content:V(),mtime_ms:U()}),K({content:V()}),K({mtime_ms:U()}),K({id:X,profile_id:Q,agent_type:V(),label:V(),config_dir:V(),skip_permissions_default:W(),logged_in:W(),created_at:Y}),K({profile_id:Q,agent_type:V().min(1),label:Bo,skip_permissions_default:W().optional(),import_dir:V().min(1).optional()}),K({label:Bo.optional(),skip_permissions_default:W().optional()}),K({stream:V(),term:V(),hint:V().optional()}),to({account_id:X,logged_in:W(),session_count:U().int().nonnegative(),active_session_count:U().int().nonnegative(),last_activity_at:Y.nullable(),agent_usage:K({input_tokens:U().int().nonnegative(),output_tokens:U().int().nonnegative(),cache_read_input_tokens:U().int().nonnegative(),cache_creation_input_tokens:U().int().nonnegative(),message_count:U().int().nonnegative()}).nullable(),live_usage:K({captured_at:Y,context_used_percentage:U().nullable(),total_cost_usd:U().nullable(),model:V().nullable()}).nullable(),subscription:K({windows:G(K({key:V(),label:V(),used_percentage:U(),resets:V().nullable()}))}).nullable()}),K({id:V(),display_name:V(),capabilities:K({resume:W(),skip_permissions:W()}),binary:V().optional(),available:W().optional()}),K({id:X,path:V(),default_base_branch:V(),onboarding_notes:V().nullable(),fetch_enabled:W(),last_fetched_at:Y.nullable()}).extend({orphan_worktrees:G(V())}),K({path:V().min(1),default_base_branch:V().min(1).optional(),onboarding_notes:V().nullable().optional(),fetch_enabled:W().optional()}),K({branches:G(K({name:V(),is_session:W(),session_title:V().nullable()}))});var Zo=K({path:V(),branch:V().nullable(),is_primary:W(),dirty:W().optional(),local_only:W().optional()}),Qo=K({name:V(),local_only:W()});K({worktrees:G(Zo),orphan_branches:G(Qo)}),K({default_base_branch:V().min(1).optional(),onboarding_notes:V().nullable().optional(),fetch_enabled:W().optional()});var $o=q([`starting`,`running`,`waiting_input`,`exited`,`interrupted`,`archived`]),es=q([`agent`,`terminal`]),ts=K({id:Z,project_id:zo,account_id:X.nullable(),worktree_path:V(),base_branch:V(),branch:V(),separate_branch:W(),kind:es,agent_type:V().nullable(),agent_session_ref:V().nullable(),conversation_id:X.nullable().optional(),parent_conversation_id:X.nullable().optional(),title:V().nullable(),agent_title:V().nullable().optional(),conversation_missing:W().optional(),branch_owner:W().optional(),native_sync:q([`pending`,`full`,`fallback`]).optional(),osc_title:V().nullable().optional(),status:$o,cwd:V().nullable().optional(),skip_permissions:W(),created_at:Y,updated_at:Y,last_activity_at:Y.nullable(),worktree_missing:W().optional(),stale_running:W().optional(),git_summary:K({ahead:U().int().nonnegative(),behind:U().int().nonnegative(),dirty_files:U().int().nonnegative()}).nullable().optional()});K({project_id:zo,account_id:X.optional(),kind:es.optional(),base_branch:V().min(1).optional(),branch:V().min(1).max(200).optional(),separate_branch:W().optional(),separate_worktree:W().optional(),join_worktree:V().optional(),cwd:V().optional(),title:V().min(1).max(200).optional(),prompt:V().optional(),skip_permissions:W().optional()}),K({title:V().max(200)}),K({account_id:X}),K({account_id:X}),K({vars:G(K({name:V(),bytes:U().int().nonnegative(),value:V().optional()}))}),K({cleared:U().int().nonnegative()}),K({force:W().default(!1),delete_branch:W().default(!1)});var ns=V().min(1).max(5),rs=K({id:zo,profile_id:Q,repo_id:X,name:V(),abbrev:ns.nullable().default(null),archived:W().default(!1),created_at:Y,updated_at:Y});K({profile_id:Q,repo_id:X,name:V().min(1).max(100),abbrev:ns.optional()}),K({name:V().min(1).max(100).optional(),abbrev:ns.optional(),archived:W().optional()}),K({project:rs,sessions:G(ts)});var is=q([`project`,`profile`]);K({id:X,profile_id:Q,scope:is,project_id:zo.nullable(),title:V().nullable(),body:V(),tags:G(V()),agent_type:V().nullable(),position:U(),created_at:Y,updated_at:Y}),K({profile_id:Q,scope:is,project_id:zo.optional(),title:V().max(200).optional(),body:V().min(1),tags:G(V()).optional(),agent_type:V().optional()}),K({scope:is.optional(),project_id:zo.nullable().optional(),title:V().max(200).nullable().optional(),body:V().min(1).optional(),tags:G(V()).optional(),agent_type:V().nullable().optional(),position:U().optional()});var as=q([`on_demand`,`eager`]),os=K({session:Z,path:V().min(1),root:V().min(1).optional()}),ss=V().regex(/^[a-z][a-z0-9_-]*$/);K({providers:G(K({id:ss,display_name:V().min(1),extensions:G(V().regex(/^[a-z0-9]+$/)).min(1),input_extensions:G(V().regex(/^[a-z0-9]+$/)).min(1),available:W(),executor:V().min(1).nullable(),eager:W()}))});var cs=K({source:os,provider:ss.optional()}),ls=K({role:V().min(1),media_type:V().min(1),file:os}),us=K({source:os,severity:q([`error`,`warning`,`info`]),message:V().min(1),line:U().int().positive(),column:U().int().positive().optional(),end_line:U().int().positive().optional(),end_column:U().int().positive().optional()}),ds=K({source:os.optional(),output:V().optional(),diagnostics:G(us).optional()}),fs=ds.extend({message:V().min(1)}),ps=K({provider:ss,executor:V().min(1),revision:U().int().nonnegative(),source:os,artifacts:G(ls),navigation:K({kind:V().min(1)}).optional()});cs.extend({mode:as}),K({provider:ss,mode:as,state:q([`idle`,`running`,`succeeded`,`failed`]),revision:U().int().nonnegative(),result:ps.nullable(),error:fs.nullable()});var ms=`00000000-0000-0000-0000-000000000000`,hs=K({session:Z,path:V(),kind:q([`file`,`diff`,`commit`,`external`,`untitled`]).optional(),sha:V().optional(),git_area:q([`staged`,`unstaged`]).optional(),root:V().optional(),view:q([`source`,`preview`,`linked`,`locked`]).optional(),compile_mode:as.optional(),generated_by:ss.optional()}),gs=ao(`type`,[K({type:J(`editor`),tab:hs}),K({type:J(`terminal`),session:Z})]),_s=K({kind:J(`leaf`),id:V(),tabs:G(gs).default([]),activeKey:V().nullable().default(null),previewKey:V().nullable().default(null)}),vs=Po(()=>ao(`kind`,[_s,K({kind:J(`split`),id:V(),direction:q([`row`,`col`]),children:G(vs),sizes:G(U())})])),ys=to({layout_tree:vs.nullable().default(null),active_session:Z.nullable().default(null),layout_ref:X.nullable().default(null)}),bs=to({session_tabs:G(Z).default([]),active_session:Z.nullable().default(null),editor_tabs:G(hs).default([]),layout:to({}).default({}),explorer_pin:Z.nullable().default(null),active_editor_tab:hs.nullable().default(null),explorer_open:W().default(!0),sidebar_mode:q([`files`,`diff`,`history`,`changes`,`search`,`worktrees`]).default(`files`),sidebar_collapsed:W().default(!1),sessions_collapsed:W().default(!1),right_panel:q([`sessions`,`scratchpad`]).optional(),session_order:G(Z).default([]),layout_tree:vs.nullable().default(null),layout_mode:q([`profile`,`project`]).optional(),project_layouts:lo(V(),ys).default({}),layout_ref:X.nullable().default(null)});K({ui_state:bs}),K({ui_state:bs,updated_at:Y});var xs=q([`project`,`profile`]);K({id:X,profile_id:Q,scope:xs,project_id:zo.nullable(),name:V(),layout_tree:vs.nullable(),active_session:Z.nullable(),created_at:Y,updated_at:Y}),K({profile_id:Q,scope:xs,project_id:zo.optional(),name:V().min(1).max(200),layout_tree:vs.nullable(),active_session:Z.nullable().optional()}),K({name:V().min(1).max(200).optional(),layout_tree:vs.nullable().optional(),active_session:Z.nullable().optional()}),os.extend({root:V().min(1),page:U().int().positive(),x:U().finite().nonnegative(),y:U().finite().nonnegative()});var Ss=os.extend({line:U().int().positive(),column:U().int().nonnegative().optional()}),Cs=q([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);K({mime:Cs,data:V().min(1)}),K({path:V()}),K({path:V(),line:U().int().nullable(),kind:q([`file`,`dir`]).optional(),relative_path:V().optional(),root:V().optional()});var ws=K({name:V(),type:q([`file`,`dir`,`symlink`]),size:U().int().nonnegative().nullable(),symlink:W().default(!1)});K({path:V(),entries:G(ws)}),K({path:V(),content:V().nullable(),binary:W(),size:U().int().nonnegative(),mtime_ms:U()}),K({content:V(),expected_mtime_ms:U().optional()}),K({path:V(),mtime_ms:U(),size:U().int().nonnegative()}),K({files:G(K({path:V(),size:U().int().nonnegative()}))}),K({path:V().min(1),kind:q([`file`,`dir`])}),K({from:V().min(1),to:V().min(1)}),K({from:V().min(1),to:V().min(1)}),K({operation:q([`copy`,`move`]),source:K({session_id:Z,root:V().optional()}),from:V().min(1),to:V().min(1)}),K({path:V().min(1)}),K({ok:J(!0),path:V()});var Ts=q([`added`,`modified`,`deleted`,`renamed`]),Es=q([`staged`,`unstaged`]),Ds=K({path:V(),status:Ts,old_path:V().nullable()});K({against:V(),base_ref:V().nullable(),entries:G(Ds),area:Es.optional()});var Os=q([`untracked`,`modified`,`added`,`deleted`,`renamed`,`conflicted`,`ignored`]),ks=K({path:V(),status:Os});K({entries:G(ks)});var As=K({path:V(),status:Os.exclude([`ignored`]),old_path:V().nullable()});K({repositories:G(K({root:V(),relative_path:V(),name:V(),owning:W(),submodule:W(),initialised:W(),head:V().nullable(),branch:V().nullable(),detached:W(),upstream:V().nullable(),ahead:U().int().nonnegative(),behind:U().int().nonnegative(),has_remote:W(),staged:G(As),unstaged:G(As),conflicts:G(As)})),entries:G(ks)});var js=K({repository:V().min(1)});js.extend({paths:G(V().min(1)).min(1)}),js.extend({message:V().trim().min(1),stage_all:W().optional()}),js.extend({set_upstream:W().optional()}),K({ok:J(!0),sha:V().optional()}),K({path:V(),content:V().nullable(),binary:W(),exists:W()}),K({path:V(),repository:V().nullable(),repository_path:V().nullable(),head:V().nullable(),content:V().nullable(),binary:W(),exists:W(),tracked:W(),ignored:W()}),K({path:V(),ref:V(),content:V().nullable(),binary:W()});var Ms=K({sha:V(),subject:V(),author_name:V(),author_email:V(),authored_at:Y,parents:G(V()).optional()});K({commits:G(Ms),has_more:W()}),K({commit:Ms.extend({body:V()}),parents:G(V()),files:G(Ds)});var Ns=K({line:U().int().positive(),text:V()}),Ps=K({path:V(),matches:G(Ns)});K({query:V(),files:G(V()),content:G(Ps),truncated:W()}),K({ports:G(K({port:U().int().min(1).max(65535),pid:U().int(),command:V(),address:V()})),scanned_at:Y});var Fs=K({status:J(`refreshing`)}),Is=V().regex(/^(agent|shell-[0-9]+)$/),Ls=`home`,Rs={cols:U().int().min(2).max(1e3),rows:U().int().min(2).max(500)};ao(`t`,[K({t:J(`auth`),token:V()}),K({t:J(`attach`),session:V(),term:Is,...Rs}),K({t:J(`stdin`),session:V(),term:Is,data:V()}),K({t:J(`resize`),session:V(),term:Is,...Rs}),K({t:J(`detach`),session:V(),term:Is}),K({t:J(`spawn-shell`),session:V()}),K({t:J(`kill-shell`),session:V(),term:Is}),K({t:J(`subscribe-status`)}),K({t:J(`theme`),fg:V().regex(/^#[0-9a-fA-F]{6}$/),bg:V().regex(/^#[0-9a-fA-F]{6}$/)})]);var zs=class extends Error{status;code;details;constructor(e,t,n,r){super(n),this.status=e,this.code=t,this.details=r,this.name=`ApiError`}};async function Bs(e,t,n){let r=_e.get(),i=await fetch(t,{method:e,headers:{...r?{authorization:`Bearer ${r}`}:{},...n===void 0?{}:{"content-type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)});if(i.status===401)throw ve(),new zs(401,`unauthorised`,`invalid or expired token`);if(i.status!==204){if(!i.ok){let n=Ro.safeParse(await i.json().catch(()=>null));throw n.success?new zs(i.status,n.data.error.code,n.data.error.message,n.data.error.details):new zs(i.status,`unknown`,`${e} ${t} failed with ${i.status}`)}return await i.json()}}function Vs(){let e=_e.get();return e?{authorization:`Bearer ${e}`}:{}}async function Hs(e,t,n){let r=await fetch(t,{...n,method:e,headers:{...Vs(),...n?.headers}});if(r.status===401)throw ve(),new zs(401,`unauthorised`,`invalid or expired token`);if(!r.ok){let n=Ro.safeParse(await r.json().catch(()=>null));throw n.success?new zs(r.status,n.data.error.code,n.data.error.message,n.data.error.details):new zs(r.status,`unknown`,`${e} ${t} failed with ${r.status}`)}return r}export{v as C,_e as S,h as T,Wo as _,Ls as a,Go as b,Ss as c,bs as d,ds as f,Ho as g,Uo as h,Vs as i,ms as l,Vo as m,Bs as n,Fs as o,fs as p,Hs as r,Cs as s,zs as t,gs as u,Ko as v,_ as w,y as x,qo as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./x-cVj9N3GX.js";var t=e(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);export{t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{A as r,C as i,D as a,S as o,T as s,_ as c,b as l,d as u,f as d,g as f,k as p,m,p as h,v as g,w as _,x as ee,y as v}from"./dialog-CFa2VFV0.js";import{_ as y,g as b,h as x,m as S,p as C,v as w,y as T}from"./LazyTerminal-YJYBkGGG.js";import{n as E,r as D}from"./x-cVj9N3GX.js";import{n as O,r as k,t as te}from"./dist-DEu2RD64.js";var A=E(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),j=E(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]);function ne(e){let t=Date.parse(e.created_at);return Number.isNaN(t)?0:t}function M(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(t.id)?r:i).push(t);return r.sort((e,t)=>n.get(e.id)-n.get(t.id)),i.sort((e,t)=>ne(t)-ne(e)),[...i,...r]}function N(e,t,n){if(t===n)return[...e];let r=e.filter(e=>e!==t),i=r.indexOf(n);return i===-1?[...e]:(r.splice(i,0,t),r)}function P(e,t,n){if(t===n)return null;let r=e.find(e=>e.sessions.some(e=>e.id===t));if(!r||!r.sessions.some(e=>e.id===n))return null;let i=e.flatMap(e=>e.sessions.map(e=>e.id)),a=N(i,t,n);return a.some((e,t)=>e!==i[t])?a:null}function re(e,t){let n=new Set(e);return[...e,...t.filter(e=>!n.has(e))]}var F=e(t(),1),I=!1;function ie(){let[e,t]=F.useState(I);return F.useEffect(()=>{I||(I=!0,t(!0))},[]),e}var L=F.useSyncExternalStore;function ae(){return()=>{}}function oe(){return L(ae,()=>!0,()=>!1)}var se=typeof L==`function`?oe:ie,R=n(),ce=`rovingFocusGroup.onEntryFocus`,le={bubbles:!1,cancelable:!0},z=`RovingFocusGroup`,[ue,de,fe]=O(z),[pe,me]=a(z,[fe]),[he,ge]=pe(z),_e=F.forwardRef((e,t)=>(0,R.jsx)(ue.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ue.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(ve,{...e,ref:t})})}));_e.displayName=z;var ve=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:a,loop:s=!1,dir:c,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:h=!1,...g}=e,_=F.useRef(null),ee=p(t,_),v=te(c),[y,b]=f({prop:l,defaultProp:u??null,onChange:d,caller:z}),[x,S]=F.useState(!1),C=o(m),w=de(n),T=F.useRef(!1),[E,D]=F.useState(0);return F.useEffect(()=>{let e=_.current;if(e)return e.addEventListener(ce,C),()=>e.removeEventListener(ce,C)},[C]),(0,R.jsx)(he,{scope:n,orientation:a,dir:v,loop:s,currentTabStopId:y,onItemFocus:F.useCallback(e=>b(e),[b]),onItemShiftTab:F.useCallback(()=>S(!0),[]),onFocusableItemAdd:F.useCallback(()=>D(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>D(e=>e-1),[]),children:(0,R.jsx)(i.div,{tabIndex:x||E===0?-1:0,"data-orientation":a,...g,ref:ee,style:{outline:`none`,...e.style},onMouseDown:r(e.onMouseDown,()=>{T.current=!0}),onFocus:r(e.onFocus,e=>{let t=!T.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(ce,le);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=w().filter(e=>e.focusable);we([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),h)}}T.current=!1}),onBlur:r(e.onBlur,()=>S(!1))})})}),ye=`RovingFocusGroupItem`,be=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:s,children:c,...u}=e,d=v(),f=s||d,p=ge(ye,n),m=p.currentTabStopId===f,h=de(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:ee}=p,y=se();return l(()=>{if(!(!y||!a))return g(),()=>_()},[y,a,g,_]),F.useEffect(()=>{if(!(y||!a))return g(),()=>_()},[y,a,g,_]),(0,R.jsx)(ue.ItemSlot,{scope:n,id:f,focusable:a,active:o,children:(0,R.jsx)(i.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:r(e.onMouseDown,e=>{a?p.onItemFocus(f):e.preventDefault()}),onFocus:r(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:r(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Ce(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Te(n,r+1):n.slice(r+1)}setTimeout(()=>we(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:ee!=null}):c})})});be.displayName=ye;var xe={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Se(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Ce(e,t,n){let r=Se(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return xe[r]}function we(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Te(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ee=_e,De=be,Oe=[`Enter`,` `],ke=[`ArrowDown`,`PageUp`,`Home`],Ae=[`ArrowUp`,`PageDown`,`End`],je=[...ke,...Ae],Me={ltr:[...Oe,`ArrowRight`],rtl:[...Oe,`ArrowLeft`]},Ne={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B=`Menu`,[V,Pe,Fe]=O(B),[H,Ie]=a(B,[Fe,T,me]),U=T(),Le=me(),[Re,W]=H(B),[ze,G]=H(B),Be=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:s=!0}=e,c=U(t),[l,u]=F.useState(null),d=F.useRef(!1),f=o(a),p=te(i);return F.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),F.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,R.jsx)(w,{...c,children:(0,R.jsx)(Re,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,R.jsx)(ze,{scope:t,onClose:F.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};Be.displayName=B;var Ve=`MenuAnchor`,He=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,R.jsx)(x,{...i,...r,ref:t})});He.displayName=Ve;var Ue=`MenuPortal`,[We,Ge]=H(Ue,{forceMount:void 0}),Ke=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=W(Ue,t);return(0,R.jsx)(We,{scope:t,forceMount:n,children:(0,R.jsx)(c,{present:n||a.open,children:(0,R.jsx)(g,{asChild:!0,container:i,children:r})})})};Ke.displayName=Ue;var K=`MenuContent`,[qe,Je]=H(K),Ye=F.forwardRef((e,t)=>{let n=Ge(K,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=W(K,e.__scopeMenu),o=G(K,e.__scopeMenu);return(0,R.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(c,{present:r||a.open,children:(0,R.jsx)(V.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Xe,{...i,ref:t}):(0,R.jsx)(Ze,{...i,ref:t})})})})}),Xe=F.forwardRef((e,t)=>{let n=W(K,e.__scopeMenu),i=F.useRef(null),a=p(t,i);return F.useEffect(()=>{let e=i.current;if(e)return u(e)},[]),(0,R.jsx)($e,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:r(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ze=F.forwardRef((e,t)=>{let n=W(K,e.__scopeMenu);return(0,R.jsx)($e,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Qe=s(`MenuContent.ScrollLock`),$e=F.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:_,onDismiss:v,disableOutsideScroll:b,...x}=e,S=W(K,n),C=G(K,n),w=U(n),T=Le(n),E=Pe(n),[D,O]=F.useState(null),k=F.useRef(null),te=p(t,k,S.onContentChange),A=F.useRef(0),j=F.useRef(``),ne=F.useRef(0),M=F.useRef(null),N=F.useRef(`right`),P=F.useRef(0),re=b?d:F.Fragment,I=b?{as:Qe,allowPinchZoom:!0}:void 0,ie=e=>{let t=j.current+e,n=E().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Nt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){j.current=t,window.clearTimeout(A.current),t!==``&&(A.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};F.useEffect(()=>()=>window.clearTimeout(A.current),[]),h();let L=F.useCallback(e=>N.current===M.current?.side&&Ft(e,M.current?.area),[]);return(0,R.jsx)(qe,{scope:n,searchRef:j,onItemEnter:F.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:F.useCallback(e=>{L(e)||(k.current?.focus(),O(null))},[L]),onTriggerLeave:F.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:F.useCallback(e=>{M.current=e},[]),children:(0,R.jsx)(re,{...I,children:(0,R.jsx)(m,{asChild:!0,trapped:a,onMountAutoFocus:r(o,e=>{e.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,R.jsx)(ee,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:_,onDismiss:v,children:(0,R.jsx)(Ee,{asChild:!0,...T,dir:C.dir,orientation:`vertical`,loop:i,currentTabStopId:D,onCurrentTabStopIdChange:O,onEntryFocus:r(l,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(y,{role:`menu`,"aria-orientation":`vertical`,"data-state":kt(S.open),"data-radix-menu-content":``,dir:C.dir,...w,...x,ref:te,style:{outline:`none`,...x.style},onKeyDown:r(x.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ie(e.key));let i=k.current;if(e.target!==i||!je.includes(e.key))return;e.preventDefault();let a=E().filter(e=>!e.disabled).map(e=>e.ref.current);Ae.includes(e.key)&&a.reverse(),jt(a)}),onBlur:r(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(A.current),j.current=``)}),onPointerMove:r(e.onPointerMove,Z(e=>{let t=e.target,n=P.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>P.current?`right`:`left`;N.current=t,P.current=e.clientX}}))})})})})})})});Ye.displayName=K;var et=`MenuGroup`,tt=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(i.div,{role:`group`,...r,ref:t})});tt.displayName=et;var nt=`MenuLabel`,rt=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(i.div,{...r,ref:t})});rt.displayName=nt;var q=`MenuItem`,it=`menu.itemSelect`,J=F.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=F.useRef(null),s=G(q,e.__scopeMenu),c=Je(q,e.__scopeMenu),l=p(t,o),u=F.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(it,{bubbles:!0,cancelable:!0});e.addEventListener(it,e=>i?.(e),{once:!0}),_(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,R.jsx)(at,{...a,ref:l,disabled:n,onClick:r(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:r(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:r(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||Oe.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});J.displayName=q;var at=F.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:a=!1,textValue:o,...s}=e,c=Je(q,n),l=Le(n),u=F.useRef(null),d=p(t,u),[f,m]=F.useState(!1),[h,g]=F.useState(``);return F.useEffect(()=>{let e=u.current;e&&g((e.textContent??``).trim())},[s.children]),(0,R.jsx)(V.ItemSlot,{scope:n,disabled:a,textValue:o??h,children:(0,R.jsx)(De,{asChild:!0,...l,focusable:!a,children:(0,R.jsx)(i.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":a||void 0,"data-disabled":a?``:void 0,...s,ref:d,onPointerMove:r(e.onPointerMove,Z(e=>{a?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:r(e.onPointerLeave,Z(e=>c.onItemLeave(e))),onFocus:r(e.onFocus,()=>m(!0)),onBlur:r(e.onBlur,()=>m(!1))})})})}),ot=`MenuCheckboxItem`,st=F.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:i,...a}=e;return(0,R.jsx)(ht,{scope:e.__scopeMenu,checked:n,children:(0,R.jsx)(J,{role:`menuitemcheckbox`,"aria-checked":X(n)?`mixed`:n,...a,ref:t,"data-state":At(n),onSelect:r(a.onSelect,()=>i?.(X(n)?!0:!n),{checkForDefaultPrevented:!1})})})});st.displayName=ot;var ct=`MenuRadioGroup`,[lt,ut]=H(ct,{value:void 0,onValueChange:()=>{}}),dt=F.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=o(r);return(0,R.jsx)(lt,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(tt,{...i,ref:t})})});dt.displayName=ct;var ft=`MenuRadioItem`,pt=F.forwardRef((e,t)=>{let{value:n,...i}=e,a=ut(ft,e.__scopeMenu),o=n===a.value;return(0,R.jsx)(ht,{scope:e.__scopeMenu,checked:o,children:(0,R.jsx)(J,{role:`menuitemradio`,"aria-checked":o,...i,ref:t,"data-state":At(o),onSelect:r(i.onSelect,()=>a.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pt.displayName=ft;var mt=`MenuItemIndicator`,[ht,gt]=H(mt,{checked:!1}),_t=F.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...a}=e,o=gt(mt,n);return(0,R.jsx)(c,{present:r||X(o.checked)||o.checked===!0,children:(0,R.jsx)(i.span,{...a,ref:t,"data-state":At(o.checked)})})});_t.displayName=mt;var vt=`MenuSeparator`,yt=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,R.jsx)(i.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});yt.displayName=vt;var bt=`MenuArrow`,xt=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=U(n);return(0,R.jsx)(b,{...i,...r,ref:t})});xt.displayName=bt;var St=`MenuSub`,[Ct,wt]=H(St),Tt=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=W(St,t),s=U(t),[c,l]=F.useState(null),[u,d]=F.useState(null),f=o(i);return F.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,R.jsx)(w,{...s,children:(0,R.jsx)(Re,{scope:t,open:r,onOpenChange:f,content:u,onContentChange:d,children:(0,R.jsx)(Ct,{scope:t,contentId:v(),triggerId:v(),trigger:c,onTriggerChange:l,children:n})})})};Tt.displayName=St;var Y=`MenuSubTrigger`,Et=F.forwardRef((e,t)=>{let n=W(Y,e.__scopeMenu),i=G(Y,e.__scopeMenu),a=wt(Y,e.__scopeMenu),o=Je(Y,e.__scopeMenu),s=F.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=F.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);F.useEffect(()=>d,[d]),F.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=p(t,a.onTriggerChange);return(0,R.jsx)(He,{asChild:!0,...u,children:(0,R.jsx)(at,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":kt(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:r(e.onPointerMove,Z(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:r(e.onPointerLeave,Z(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:r(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Me[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Et.displayName=Y;var Dt=`MenuSubContent`,Ot=F.forwardRef((e,t)=>{let n=Ge(K,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=W(K,e.__scopeMenu),l=G(K,e.__scopeMenu),u=wt(Dt,e.__scopeMenu),d=F.useRef(null),f=p(t,d);return(0,R.jsx)(V.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(c,{present:i||s.open,children:(0,R.jsx)(V.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)($e,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:f,align:a,side:l.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&d.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:r(e.onFocusOutside,e=>{e.target!==u.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:r(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:r(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Ne[l.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),u.trigger?.focus(),e.preventDefault())})})})})})});Ot.displayName=Dt;function kt(e){return e?`open`:`closed`}function X(e){return e===`indeterminate`}function At(e){return X(e)?`indeterminate`:e?`checked`:`unchecked`}function jt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Mt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Nt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Mt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Pt(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Ft(e,t){return t?Pt({x:e.clientX,y:e.clientY},t):!1}function Z(e){return t=>t.pointerType===`mouse`?e(t):void 0}var It=Be,Lt=He,Rt=Ke,zt=Ye,Bt=tt,Vt=rt,Ht=J,Ut=st,Wt=dt,Gt=pt,Kt=_t,qt=yt,Jt=xt,Yt=Tt,Xt=Et,Zt=Ot,Q=`ContextMenu`,[Qt,$t]=a(Q,[Ie]),$=Ie(),[en,tn]=Qt(Q),nn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=F.useRef(!1);{let e=F.useRef(!1);F.useEffect(()=>{i===!0&&!s.current&&!e.current&&(e.current=!0,console.warn("ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport."))},[i])}let[c,l]=f({prop:i,defaultProp:!1,onChange:r,caller:Q}),u=$(t);return(0,R.jsx)(en,{scope:t,open:c,onOpenChange:l,modal:o,hasInteractedRef:s,children:(0,R.jsx)(It,{...u,dir:a,open:c,onOpenChange:l,modal:o,children:n})})};nn.displayName=Q;var rn=`ContextMenuTrigger`,an=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:a=!1,...o}=e,s=tn(rn,n),c=$(n),[l,u]=F.useState({x:0,y:0}),d=F.useMemo(()=>({current:{getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...l})}}),[l]),f=F.useRef(0),p=F.useCallback(()=>window.clearTimeout(f.current),[]),m=e=>{s.hasInteractedRef.current=!0,u({x:e.clientX,y:e.clientY}),s.onOpenChange(!0)};return F.useEffect(()=>p,[p]),F.useEffect(()=>void(a&&p()),[a,p]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Lt,{...c,virtualRef:d}),(0,R.jsx)(i.span,{"data-state":s.open?`open`:`closed`,"data-disabled":a?``:void 0,...o,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:a?e.onContextMenu:r(e.onContextMenu,e=>{p(),m(e),e.preventDefault()}),onPointerDown:a?e.onPointerDown:r(e.onPointerDown,Pn(e=>{p(),s.open&&s.onOpenChange(!1),f.current=window.setTimeout(()=>m(e),700)})),onPointerMove:a?e.onPointerMove:r(e.onPointerMove,Pn(p)),onPointerCancel:a?e.onPointerCancel:r(e.onPointerCancel,Pn(p)),onPointerUp:a?e.onPointerUp:r(e.onPointerUp,Pn(p))})]})});an.displayName=rn;var on=`ContextMenuPortal`,sn=e=>{let{__scopeContextMenu:t,...n}=e,r=$(t);return(0,R.jsx)(Rt,{...r,...n})};sn.displayName=on;var cn=`ContextMenuContent`,ln=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=tn(cn,n),a=$(n),o=F.useRef(!1);return(0,R.jsx)(zt,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});ln.displayName=cn;var un=`ContextMenuGroup`,dn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Bt,{...i,...r,ref:t})});dn.displayName=un;var fn=`ContextMenuLabel`,pn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Vt,{...i,...r,ref:t})});pn.displayName=fn;var mn=`ContextMenuItem`,hn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Ht,{...i,...r,ref:t})});hn.displayName=mn;var gn=`ContextMenuCheckboxItem`,_n=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Ut,{...i,...r,ref:t})});_n.displayName=gn;var vn=`ContextMenuRadioGroup`,yn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Wt,{...i,...r,ref:t})});yn.displayName=vn;var bn=`ContextMenuRadioItem`,xn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Gt,{...i,...r,ref:t})});xn.displayName=bn;var Sn=`ContextMenuItemIndicator`,Cn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Kt,{...i,...r,ref:t})});Cn.displayName=Sn;var wn=`ContextMenuSeparator`,Tn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(qt,{...i,...r,ref:t})});Tn.displayName=wn;var En=`ContextMenuArrow`,Dn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Jt,{...i,...r,ref:t})});Dn.displayName=En;var On=`ContextMenuSub`,kn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=$(t),[s,c]=f({prop:i,defaultProp:a??!1,onChange:r,caller:On});return(0,R.jsx)(Yt,{...o,open:s,onOpenChange:c,children:n})};kn.displayName=On;var An=`ContextMenuSubTrigger`,jn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Xt,{...i,...r,ref:t})});jn.displayName=An;var Mn=`ContextMenuSubContent`,Nn=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=$(n);return(0,R.jsx)(Zt,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Nn.displayName=Mn;function Pn(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Fn=nn,In=an,Ln=sn,Rn=ln,zn=hn,Bn=Tn,Vn=kn,Hn=jn,Un=Nn,Wn=Fn,Gn=In,Kn=Vn;function qn({className:e,...t}){return(0,R.jsx)(Ln,{children:(0,R.jsx)(Rn,{className:D(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function Jn({className:e,...t}){return(0,R.jsx)(zn,{className:D(S,C,`[&_svg]:size-3.5`,e),...t})}function Yn({className:e,children:t,...n}){return(0,R.jsxs)(Hn,{className:D(S,C,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,R.jsx)(k,{className:`ml-auto`})]})}function Xn({className:e,...t}){return(0,R.jsx)(Ln,{children:(0,R.jsx)(Un,{className:D(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function Zn({className:e,...t}){return(0,R.jsx)(Bn,{className:D(`-mx-1 my-1 h-px bg-border`,e),...t})}function Qn(){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:e=>{e.preventDefault(),e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY,button:2}))}}}export{N as A,Yt as C,re as D,Ie as E,A as M,P as O,qt as S,Xt as T,Vt as _,Kn as a,Gt as b,Gn as c,Jt as d,Ut as f,Kt as g,Ht as h,Zn as i,j,M as k,Qn as l,Bt as m,qn as n,Xn as o,zt as p,Jn as r,Yn as s,Wn as t,Lt as u,Rt as v,Zt as w,It as x,Wt as y};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{i,r as a,t as o}from"./x-cVj9N3GX.js";var s=e(t(),1),c=r();typeof window<`u`&&window.document&&window.document.createElement;function l(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}function u(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function d(...e){return t=>{let n=!1,r=e.map(e=>{let r=u(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():u(e[t],null)}}}}function f(...e){return s.useCallback(d(...e),e)}function p(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,l=n?.[e]?.[a]||i,u=s.useMemo(()=>o,Object.values(o));return(0,c.jsx)(l.Provider,{value:u,children:r})};o.displayName=t+`Provider`;function l(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,l]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,m(i,...t)]}function m(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function h(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];S(r)&&typeof w==`function`&&(r=w(r._payload)),s.Children.forEach(r,e=>{if(te(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;S(n)&&typeof w==`function`&&(n=w(n._payload)),a=ee(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?b(a):void 0,u=f(n,l);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=y(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var g=h(`Slot`),_=Symbol.for(`radix.slottable`);function v(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=_,t}var ee=(e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null};function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function te(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_}var x=Symbol.for(`react.lazy`);function S(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===x&&`_payload`in e&&C(e._payload)}function C(e){return typeof e==`object`&&!!e&&`then`in e}var ne=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,re=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,w=s.use,T=e(n(),1),E=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=h(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function D(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}function O(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ie=`DismissableLayer`,ae=`dismissableLayer.update`,oe=`dismissableLayer.pointerDownOutside`,se=`dismissableLayer.focusOutside`,ce,le=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ue=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:u,onDismiss:d,...p}=e,m=s.useContext(le),[h,g]=s.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=s.useState({}),ee=f(t,g),y=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),te=b?y.indexOf(b):-1,x=h?y.indexOf(h):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,C=x>=te,ne=s.useRef(!1),re=he(e=>{a?.(e),u?.(e),e.defaultPrevented||d?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:ne,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return C&&!t},[m.branches,C])}),w=ge(e=>{if(r&&ne.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(o?.(e),u?.(e),e.defaultPrevented||d?.())},_),T=h?x===y.length-1:!1,D=O(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return s.useEffect(()=>{if(T)return _.addEventListener(`keydown`,D,{capture:!0}),()=>_.removeEventListener(`keydown`,D,{capture:!0})},[_,T,D]),s.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ce=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),_e(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=ce))}},[h,_,n,m]),s.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),_e())},[h,m]),s.useEffect(()=>{let e=()=>v({});return document.addEventListener(ae,e),()=>document.removeEventListener(ae,e)},[]),(0,c.jsx)(E.div,{...p,ref:ee,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:l(e.onFocusCapture,w.onFocusCapture),onBlurCapture:l(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,re.onPointerDownCapture)})});ue.displayName=ie;var de=`DismissableLayerBranch`,fe=s.forwardRef((e,t)=>{let n=s.useContext(le),r=s.useRef(null),i=f(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(E.div,{...e,ref:i})});fe.displayName=de;function pe(){let e=s.useContext(le),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var me=()=>!0;function he(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=me}=t,c=O(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ve(oe,c,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:()=>l.current=!0}}function ge(e,t=globalThis?.document){let n=O(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&ve(se,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _e(){let e=new CustomEvent(ae);document.dispatchEvent(e)}function ve(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?D(i,a):i.dispatchEvent(a)}var k=globalThis?.document?s.useLayoutEffect:()=>{},ye=s.useId||(()=>void 0),be=0;function A(e){let[t,n]=s.useState(ye());return k(()=>{e||n(e=>e??String(be++))},[e]),e||(t?`radix-${t}`:``)}var xe=`Portal`,Se=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);k(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?T.createPortal((0,c.jsx)(E.div,{...r,ref:t}),o):null});Se.displayName=xe;function Ce(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}var j=e=>{let{present:t,children:n}=e,r=we(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Ee(r.ref,De(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null};j.displayName=`Presence`;function we(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Ce(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??M(r.current),o.current=void 0):a.current=`none`},[c]),k(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=M(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),k(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=M(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=M(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=M(t)}else r.current=null;n(e)},[])}}function Te(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ee(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Te(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Te(n[e],null)}}},[])}function M(e){return e?.animationName||`none`}function De(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Oe=s.useInsertionEffect||k;function ke({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ae({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=je(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function Ae({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return Oe(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function je(e){return typeof e==`function`}var Me=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ne=i,Pe=((e,t)=>n=>{if(t?.variants==null)return Ne(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Me(t)||Me(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ne(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors duration-150 disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-action text-action-ink hover:bg-action-hover active:opacity-85`,secondary:`bg-elevated text-fg hover:bg-border/70 active:bg-border`,ghost:`text-fg-secondary hover:bg-elevated hover:text-fg active:bg-border/70`,danger:`bg-danger text-ground hover:opacity-90 active:opacity-80`},size:{default:`h-8 px-3 text-sm`,sm:`h-7 px-2 text-xs`,lg:`h-9 px-4 text-sm`,icon:`h-8 w-8`}},defaultVariants:{variant:`default`,size:`default`}});function Fe({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,c.jsx)(r?g:`button`,{className:a(Pe({variant:t,size:n}),e),...i})}var Ie=`focusScope.autoFocusOnMount`,Le=`focusScope.autoFocusOnUnmount`,Re={bubbles:!1,cancelable:!0},ze=`FocusScope`,Be=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,u]=s.useState(null),d=O(i),p=O(a),m=s.useRef(null),h=f(t,u),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(g.paused||!l)return;let t=e.target;l.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,g.paused]),s.useEffect(()=>{if(l){qe.add(g);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Ie,Re);l.addEventListener(Ie,d),l.dispatchEvent(t),t.defaultPrevented||(Ve(Xe(Ue(l)),{select:!0}),document.activeElement===e&&N(l))}return()=>{l.removeEventListener(Ie,d),setTimeout(()=>{let t=new CustomEvent(Le,Re);l.addEventListener(Le,p),l.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),l.removeEventListener(Le,p),qe.remove(g)},0)}}},[l,d,p,g]);let _=s.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=He(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,c.jsx)(E.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});Be.displayName=ze;function Ve(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function He(e){let t=Ue(e);return[We(t,e),We(t.reverse(),e)]}function Ue(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function We(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ge(r,{upTo:t})))return r}function Ge(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Ke(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ke(e)&&t&&e.select()}}var qe=Je();function Je(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ye(e,t),e.unshift(t)},remove(t){e=Ye(e,t),e[0]?.resume()}}}function Ye(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Xe(e){return e.filter(e=>e.tagName!==`A`)}var P=0,F=null;function Ze(){s.useEffect(()=>{F||={start:Qe(),end:Qe()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function Qe(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var I=function(){return I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},I.apply(this,arguments)};function $e(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function et(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,tt=`with-scroll-bars-hidden`,nt=`--removed-body-scroll-bar-size`;function z(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function rt(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var it=typeof window<`u`?s.useLayoutEffect:s.useEffect,at=new WeakMap;function ot(e,t){var n=rt(t||null,function(t){return e.forEach(function(e){return z(e,t)})});return it(function(){var t=at.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||z(e,null)}),i.forEach(function(e){r.has(e)||z(e,a)})}at.set(n,e)},[e]),n}function st(e){return e}function ct(e,t){t===void 0&&(t=st);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function lt(e){e===void 0&&(e={});var t=ct(null);return t.options=I({async:!0,ssr:!1},e),t}var ut=function(e){var t=e.sideCar,n=$e(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,I({},n))};ut.isSideCarExport=!0;function dt(e,t){return e.useMedium(t),ut}var ft=lt(),pt=function(){},B=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:pt,onWheelCapture:pt,onTouchMoveCapture:pt}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,ee=v===void 0?`div`:v,y=e.gapMode,b=$e(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),te=p,x=ot([n,t]),S=I(I({},b),i);return s.createElement(s.Fragment,null,d&&s.createElement(te,{sideCar:ft,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:y}),o?s.cloneElement(s.Children.only(c),I(I({},S),{ref:x})):s.createElement(ee,I({},S,{className:l,ref:x}),c))});B.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},B.classNames={fullWidth:R,zeroRight:L};var mt,ht=function(){if(mt)return mt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function gt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ht();return t&&e.setAttribute(`nonce`,t),e}function _t(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var yt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gt())&&(_t(t,n),vt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bt=function(){var e=yt();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},xt=function(){var e=bt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},St={left:0,top:0,right:0,gap:0},Ct=function(e){return parseInt(e||``,10)||0},wt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ct(n),Ct(r),Ct(i)]},Tt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return St;var t=wt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Et=xt(),V=`data-scroll-locked`,Dt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${tt} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${V}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${L} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${R} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${L} .${L} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${R} .${R} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${V}] {
|
|
36
|
-
${nt}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},Ot=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},kt=function(){s.useEffect(function(){return document.body.setAttribute(V,(Ot()+1).toString()),function(){var e=Ot()-1;e<=0?document.body.removeAttribute(V):document.body.setAttribute(V,e.toString())}},[])},At=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;kt();var a=s.useMemo(function(){return Tt(i)},[i]);return s.createElement(Et,{styles:Dt(a,!t,i,n?``:`!important`)})},jt=!1;if(typeof window<`u`)try{var H=Object.defineProperty({},"passive",{get:function(){return jt=!0,!0}});window.addEventListener(`test`,H,H),window.removeEventListener(`test`,H,H)}catch{jt=!1}var U=jt?{passive:!1}:!1,Mt=function(e){return e.tagName===`TEXTAREA`},Nt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Mt(e)&&n[t]===`visible`)},Pt=function(e){return Nt(e,`overflowY`)},Ft=function(e){return Nt(e,`overflowX`)},It=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zt(e,r)){var i=Bt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Lt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Rt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zt=function(e,t){return e===`v`?Pt(t):Ft(t)},Bt=function(e,t){return e===`v`?Lt(t):Rt(t)},Vt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ht=function(e,t,n,r,i){var a=Vt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Bt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},W=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ut=function(e){return[e.deltaX,e.deltaY]},Wt=function(e){return e&&`current`in e?e.current:e},Gt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Kt=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},qt=0,G=[];function Jt(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(qt++)[0],a=s.useState(xt)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=et([e.lockRef.current],(e.shards||[]).map(Wt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=W(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=It(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=It(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ht(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!G.length||G[G.length-1]!==a)){var r=`deltaY`in n?Ut(n):W(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Gt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Wt).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Yt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=W(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Ut(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,W(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return G.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,U),document.addEventListener(`touchmove`,l,U),document.addEventListener(`touchstart`,d,U),function(){G=G.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,U),document.removeEventListener(`touchmove`,l,U),document.removeEventListener(`touchstart`,d,U)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:Kt(i)}):null,m?s.createElement(At,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Yt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xt=dt(ft,Jt),Zt=s.forwardRef(function(e,t){return s.createElement(B,I({},e,{ref:t,sideCar:Xt}))});Zt.classNames=B.classNames;var Qt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},K=new WeakMap,q=new WeakMap,J={},$t=0,en=function(e){return e&&(e.host||en(e.parentNode))},tn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=en(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},nn=function(e,t,n,r){var i=tn(t,Array.isArray(e)?e:[e]);J[n]||(J[n]=new WeakMap);var a=J[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(K.get(e)||0)+1,l=(a.get(e)||0)+1;K.set(e,c),a.set(e,l),o.push(e),c===1&&i&&q.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$t++,function(){o.forEach(function(e){var t=K.get(e)-1,i=a.get(e)-1;K.set(e,t),a.set(e,i),t||(q.has(e)||e.removeAttribute(r),q.delete(e)),i||e.removeAttribute(n)}),$t--,$t||(K=new WeakMap,K=new WeakMap,q=new WeakMap,J={})}},rn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),nn(r,i,n,`aria-hidden`)):function(){return null}},Y=`Dialog`,[an,on]=p(Y),[sn,X]=an(Y),cn=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=s.useRef(null),u=s.useRef(null),[d,f]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:Y});return(0,c.jsx)(sn,{scope:t,triggerRef:l,contentRef:u,contentId:A(),titleId:A(),descriptionId:A(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};cn.displayName=Y;var ln=`DialogTrigger`,un=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(ln,n),a=f(t,i.triggerRef);return(0,c.jsx)(E.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Dn(i.open),...r,ref:a,onClick:l(e.onClick,i.onOpenToggle)})});un.displayName=ln;var dn=`DialogPortal`,[fn,pn]=an(dn,{forceMount:void 0}),mn=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=X(dn,t);return(0,c.jsx)(fn,{scope:t,forceMount:n,children:s.Children.map(r,e=>(0,c.jsx)(j,{present:n||a.open,children:(0,c.jsx)(Se,{asChild:!0,container:i,children:e})}))})};mn.displayName=dn;var Z=`DialogOverlay`,hn=s.forwardRef((e,t)=>{let n=pn(Z,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Z,e.__scopeDialog);return a.modal?(0,c.jsx)(j,{present:r||a.open,children:(0,c.jsx)(_n,{...i,ref:t})}):null});hn.displayName=Z;var gn=h(`DialogOverlay.RemoveScroll`),_n=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Z,n),a=f(t,pe());return(0,c.jsx)(Zt,{as:gn,allowPinchZoom:!0,shards:[i.contentRef],children:(0,c.jsx)(E.div,{"data-state":Dn(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),Q=`DialogContent`,$=s.forwardRef((e,t)=>{let n=pn(Q,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Q,e.__scopeDialog);return(0,c.jsx)(j,{present:r||a.open,children:a.modal?(0,c.jsx)(vn,{...i,ref:t}):(0,c.jsx)(yn,{...i,ref:t})})});$.displayName=Q;var vn=s.forwardRef((e,t)=>{let n=X(Q,e.__scopeDialog),r=s.useRef(null),i=f(t,n.contentRef,r);return s.useEffect(()=>{let e=r.current;if(e)return rn(e)},[]),(0,c.jsx)(bn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault())})}),yn=s.forwardRef((e,t)=>{let n=X(Q,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return(0,c.jsx)(bn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),bn=s.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=X(Q,n);return Ze(),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Be,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,c.jsx)(ue,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Dn(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),xn=`DialogTitle`,Sn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(xn,n);return(0,c.jsx)(E.h2,{id:i.titleId,...r,ref:t})});Sn.displayName=xn;var Cn=`DialogDescription`,wn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Cn,n);return(0,c.jsx)(E.p,{id:i.descriptionId,...r,ref:t})});wn.displayName=Cn;var Tn=`DialogClose`,En=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Tn,n);return(0,c.jsx)(E.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});En.displayName=Tn;function Dn(e){return e?`open`:`closed`}var On=cn;function kn({className:e,children:t,wide:n=!1,...r}){return(0,c.jsxs)(mn,{children:[(0,c.jsx)(hn,{className:`fixed inset-0 z-50 bg-ground/70 backdrop-blur-[2px]`}),(0,c.jsxs)($,{className:a(`fixed left-1/2 top-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg bg-elevated p-5 shadow-2xl`,n?`max-w-3xl`:`max-w-md`,e),...r,children:[t,(0,c.jsxs)(En,{className:`absolute right-3.5 top-3.5 rounded-sm text-fg-muted transition-colors hover:text-fg`,children:[(0,c.jsx)(o,{className:`size-4`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function An({className:e,...t}){return(0,c.jsx)(`div`,{className:a(`flex flex-col gap-1`,e),...t})}function jn({className:e,...t}){return(0,c.jsx)(Sn,{className:a(`text-lg font-semibold text-fg`,e),...t})}function Mn({className:e,...t}){return(0,c.jsx)(wn,{className:a(`text-sm text-fg-secondary`,e),...t})}function Nn({className:e,...t}){return(0,c.jsx)(`div`,{className:a(`flex justify-end gap-2`,e),...t})}export{l as A,E as C,p as D,v as E,d as O,O as S,h as T,j as _,An as a,k as b,$ as c,rn as d,Zt as f,ke as g,Fe as h,Nn as i,f as k,hn as l,Be as m,kn as n,jn as o,Ze as p,Mn as r,cn as s,On as t,mn as u,Se as v,D as w,ue as x,A as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{D as r,T as i,k as a}from"./dialog-CFa2VFV0.js";import{n as o}from"./x-cVj9N3GX.js";var s=o(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),c=e(t(),1),l=n();function u(e){let t=e+`CollectionProvider`,[n,o]=r(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=i(f),m=c.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=a(t,u(f,n).collectionRef);return(0,l.jsx)(p,{ref:i,children:r})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=a(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...i}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:r})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,o]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}export{u as n,s as r,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./api-IpGGhtRp.js";import{n as t}from"./x-cVj9N3GX.js";import{r as n}from"./index-fAfi8H1Y.js";var r=t(`case-sensitive`,[[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M22 9v7`,key:`pvm9v3`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}],[`circle`,{cx:`18.5`,cy:`12.5`,r:`3.5`,key:`z97x68`}]]),i=t(`regex`,[[`path`,{d:`M17 3v10`,key:`15fgeh`}],[`path`,{d:`m12.67 5.5 8.66 5`,key:`1gpheq`}],[`path`,{d:`m12.67 10.5 8.66-5`,key:`1dkfa6`}],[`path`,{d:`M9 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-2z`,key:`swwfx4`}]]),a=t(`whole-word`,[[`circle`,{cx:`7`,cy:`12`,r:`3`,key:`12clwm`}],[`path`,{d:`M10 9v6`,key:`17i7lo`}],[`circle`,{cx:`17`,cy:`12`,r:`3`,key:`gl7c2s`}],[`path`,{d:`M14 7v8`,key:`dl84cr`}],[`path`,{d:`M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1`,key:`lt2kga`}]]);function o(){return n.get()}function s(e,t){return e.kind===`file`&&e.root!==void 0&&e.root!==t?e.root:null}var c=/(?:^|[\s"'`([<])((?:(?:\/|\.{1,2}\/|~\/)(?:[\w.+@~-]+\/)*[\w.+@~-]+|(?:[\w.+@~-]+\/)+[\w.+@~-]*|[\w.+@~-]+\.[A-Za-z]\w{0,11}))(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,l=new Set([`.`,`,`,`;`,`:`,`)`,`]`,`'`,`"`]);function u(e){let t=[],n=new RegExp(c.source,c.flags),r;for(;r=n.exec(e);){let e=r.indices,n=r[1];if(!e?.[1]||n===void 0)continue;let i=e[1][0],a=e[1][1],o=n;for(o.startsWith(`@`)&&(o=o.slice(1),i++);o.length>0&&l.has(o[o.length-1]);)o=o.slice(0,-1),a--;if(o.length===0)continue;let s=r[2]===void 0?void 0:Number.parseInt(r[2],10),c=r[3]===void 0?void 0:Number.parseInt(r[3],10),u=c!==void 0&&e[3]?e[3][1]:s!==void 0&&e[2]?e[2][1]:a;t.push({path:o,line:s,column:c,start:i,end:u})}return t}var d=class{fetcher;now;positiveTtlMs;negativeTtlMs;maxEntries;maxConcurrent;entries=new Map;inflight=new Map;inUse=0;waiters=[];constructor(e){this.fetcher=e.fetcher,this.now=e.now??Date.now,this.positiveTtlMs=e.positiveTtlMs??15e3,this.negativeTtlMs=e.negativeTtlMs??5e3,this.maxEntries=e.maxEntries??500,this.maxConcurrent=e.maxConcurrent??4}resolve(e,t,n){let r=`${e}\0${t}`,i=this.entries.get(r);if(i){if(this.now()<i.expiresAt)return Promise.resolve(i.value);this.entries.delete(r)}let a=this.inflight.get(r);if(a)return a;let o=this.withSlot(()=>this.fetcher(e,t,n)).then(e=>(this.store(r,e),e)).finally(()=>{this.inflight.delete(r)});return this.inflight.set(r,o),o}store(e,t){let n=t?this.positiveTtlMs:this.negativeTtlMs;for(this.entries.set(e,{value:t,expiresAt:this.now()+n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}async withSlot(e){this.inUse>=this.maxConcurrent&&await new Promise(e=>this.waiters.push(e)),this.inUse++;try{return await e()}finally{this.inUse--,this.waiters.shift()?.()}}};function f(e,t){if(!e||t<1)return!1;let n=Math.min(e.length,t)-1;if(n<0)return!1;let r=e.getCell(n);return r!==void 0&&r.getWidth()>0&&r.getChars().length>0}function p(e,t,n,r){let i=t;for(;i>0&&(e.getLine(i)?.isWrapped||r&&f(e.getLine(i-1),n));)i--;let a=``;for(let t=i;;t++){let o=e.getLine(t);if(!o||t!==i&&!o.isWrapped&&!(r&&f(e.getLine(t-1),n))||(a+=o.translateToString(!0,0,n),a.length>2048))break}return{text:a,startRow:i}}function m(e,t,n,r,i){let a=e.getNullCell(),o=t,s=n,c=r;for(;c>=0;){let t=e.getLine(o);if(!t)return null;let n=Math.min(t.length,i);for(;s<n;s++){if(t.getCell(s,a),a.getWidth()&&(c-=a.getChars().length||1,s===n-1&&a.getChars()===``)){let t=e.getLine(o+1);t?.isWrapped&&(t.getCell(0,a),a.getWidth()===2&&(c+=1))}if(c<0)return{row:o,col:s}}o++,s=0}return{row:o,col:s}}function h(e,t,n){let r=[p(e,t,n,!0),p(e,t,n,!1)],i=new Set,a=[];for(let o of r)for(let r of u(o.text)){let s=m(e,o.startRow,0,r.start,n),c=m(e,s?.row??o.startRow,s?.col??0,r.end-r.start-1,n);if(!s||!c||s.row>t||c.row<t)continue;let l=`${r.path}\0${r.line??``}\0${r.column??``}\0${s.row}:${s.col}-${c.row}:${c.col}`;i.has(l)||(i.add(l),a.push({candidate:r,start:s,end:c,text:o.text.slice(r.start,r.end)}))}return a.sort((e,t)=>{let r=(e.end.row-e.start.row)*n+e.end.col-e.start.col;return(t.end.row-t.start.row)*n+t.end.col-t.start.col-r})}async function g(t,n,r,i){let a=new URLSearchParams({path:n});return r!==void 0&&a.set(`line`,String(r)),i!==void 0&&a.set(`root`,i),e(`GET`,`/api/worktrees/${t}/resolve?${a}`)}function _(e,t,n){let r=e.kind??`file`;return{kind:r,path:e.path,...e.root===void 0?{}:{root:e.root},...e.relative_path===void 0?{}:{relativePath:e.relative_path},...r===`file`&&t!==void 0?{line:Math.max(1,t)}:{},...r===`file`&&n!==void 0?{column:n}:{}}}async function v(e,t,n){return _(await g(e,t,n?.line,n?.root),n?.line,n?.column)}async function y(e,t,n){try{return await g(e,t,n)}catch{return null}}function b(e,t,n){let r=new d({fetcher:y});return e.registerLinkProvider({provideLinks(i,a){let o=e.buffer.active,s=h(o,i-1,e.cols);if(s.length===0){a(void 0);return}Promise.all(s.map(async({candidate:e,start:i,end:a,text:o})=>{let s=await r.resolve(t,e.path,e.line);return s?{range:{start:{x:i.col+1,y:i.row+1},end:{x:a.col+1,y:a.row+1}},text:o,decorations:{underline:!0,pointerCursor:!0},activate:t=>{!t.metaKey&&!t.ctrlKey||n(_(s,e.line,e.column))}}:null})).then(e=>{let t=e.filter(e=>e!==null);a(t.length>0?t:void 0)})}})}export{a,o as i,b as n,i as o,v as r,r as s,s as t};
|