@miravo/cli-linux-x64 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +199 -0
- package/README.md +5 -0
- package/console-dist/assets/AnimatePresence-CVhkybDC.js +9 -0
- package/console-dist/assets/activity-DP0Us3HU.js +1 -0
- package/console-dist/assets/api-Bef9FEIU.js +1 -0
- package/console-dist/assets/arrow-right-DrKCU9WM.js +1 -0
- package/console-dist/assets/arrow-up-down-CBuv2TSF.js +1 -0
- package/console-dist/assets/auth-screen-backdrop-OrOL41MR.js +1 -0
- package/console-dist/assets/badge-tnWgSITj.js +1 -0
- package/console-dist/assets/catalog-CurT8GX7.js +1 -0
- package/console-dist/assets/catalog-Dq3afUeM.js +1 -0
- package/console-dist/assets/catalog-template-icons-b6a6Gty-.js +1 -0
- package/console-dist/assets/checkbox-Xly18Uyz.js +1 -0
- package/console-dist/assets/chunk-OE4NN4TA-m2UhO8Q2.js +3 -0
- package/console-dist/assets/circle-question-mark-Q_q7JZnT.js +1 -0
- package/console-dist/assets/combobox-gGNWoksU.js +1 -0
- package/console-dist/assets/control-DbOdtp7Q.js +1 -0
- package/console-dist/assets/control-O0UYo7WO.js +1 -0
- package/console-dist/assets/createLucideIcon-Yddw9eHa.js +1 -0
- package/console-dist/assets/deploy-tab-BjWxHSsV.js +1 -0
- package/console-dist/assets/dialog-DD0yn-KA.js +1 -0
- package/console-dist/assets/dist-jROhexoH.js +2 -0
- package/console-dist/assets/download-BPgKzo-_.js +1 -0
- package/console-dist/assets/engine-store-BUO-9Dsh.js +1 -0
- package/console-dist/assets/events-40FcPI5G.js +1 -0
- package/console-dist/assets/events-Dq2kZb5H.js +1 -0
- package/console-dist/assets/fira-code-cyrillic-ext-wght-normal-DhYMMuQd.woff2 +0 -0
- package/console-dist/assets/fira-code-cyrillic-wght-normal-Y3u8pIsh.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-ext-wght-normal-wWus70Ix.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-wght-normal-B2SviObF.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-ext-wght-normal-Dvfvaomy.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-wght-normal-CHoedHDv.woff2 +0 -0
- package/console-dist/assets/fira-code-symbols2-wght-normal-CE6EOz_n.woff2 +0 -0
- package/console-dist/assets/fleet-C4qL3Z_E.js +1 -0
- package/console-dist/assets/fleet-CcWeGysy.js +1 -0
- package/console-dist/assets/get-error-message-DhCjoSSJ.js +1 -0
- package/console-dist/assets/index-0Q8wjuZr.js +12 -0
- package/console-dist/assets/index-BswNf6_7.css +2 -0
- package/console-dist/assets/input-BCiRHEmc.js +1 -0
- package/console-dist/assets/instance-detail-4xiHIeF2.js +1 -0
- package/console-dist/assets/label-xIWEC6lW.js +1 -0
- package/console-dist/assets/login-B9bEXW-9.js +132 -0
- package/console-dist/assets/models-6X-8K2W2.js +1 -0
- package/console-dist/assets/models-wWuV5zGw.js +1 -0
- package/console-dist/assets/not-found-ZSvYdbVs.js +1 -0
- package/console-dist/assets/platform-targets-BbVxaqAc.js +1 -0
- package/console-dist/assets/platforms-C5DxJAky.js +1 -0
- package/console-dist/assets/platforms-DrizMC87.js +1 -0
- package/console-dist/assets/proxy-CgM57W61.js +1 -0
- package/console-dist/assets/query-keys-Co1J4HmV.js +1 -0
- package/console-dist/assets/rolldown-runtime-COnpUsM8.js +1 -0
- package/console-dist/assets/route-preload-Dz8gP8hl.js +2 -0
- package/console-dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/console-dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/console-dist/assets/select-4wihIkEE.js +1 -0
- package/console-dist/assets/select-display-items-DUJCelf2.js +1 -0
- package/console-dist/assets/server-D7sb2mj5.js +1 -0
- package/console-dist/assets/shallow-ODRQsuRf.js +1 -0
- package/console-dist/assets/skeleton-C6iEH-9E.js +1 -0
- package/console-dist/assets/tabs-Bwhx891Q.js +1 -0
- package/console-dist/assets/tags-CbYqG-S1.js +1 -0
- package/console-dist/assets/tags-Z8A51KqE.js +4 -0
- package/console-dist/assets/tooltip-TtanriwA.js +1 -0
- package/console-dist/assets/transition-nav-link-CuWixOOd.js +1 -0
- package/console-dist/assets/transition-types-CMW7IObN.js +1 -0
- package/console-dist/assets/triangle-alert-DPtblpQC.js +1 -0
- package/console-dist/assets/use-engine-command-mutation-CQc8tXfc.js +1 -0
- package/console-dist/assets/use-platform-stream-7982hIDJ.js +2 -0
- package/console-dist/assets/use-transition-navigate-C3Y3EWRr.js +1 -0
- package/console-dist/assets/validation-4FJlp2qx.js +1 -0
- package/console-dist/assets/vendor-charts-CAZdaPlq.js +60 -0
- package/console-dist/assets/vendor-table-wd8JuMmT.js +4 -0
- package/console-dist/assets/vendor-ui-mizMYESS.js +1 -0
- package/console-dist/favicon.svg +1 -0
- package/console-dist/index.html +80 -0
- package/console-dist/miravo-logo.png +0 -0
- package/console-dist/miravo-logo.webp +0 -0
- package/miravo +0 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. Please also get an
|
|
185
|
+
information on the current year at http://www.apache.org/licenses/
|
|
186
|
+
|
|
187
|
+
Copyright 2026 Amine Amaach
|
|
188
|
+
|
|
189
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
190
|
+
you may not use this file except in compliance with the License.
|
|
191
|
+
You may obtain a copy of the License at
|
|
192
|
+
|
|
193
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
194
|
+
|
|
195
|
+
Unless required by applicable law or agreed to in writing, software
|
|
196
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
197
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
198
|
+
See the License for the specific language governing permissions and
|
|
199
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-COnpUsM8.js";import{s as t}from"./vendor-charts-CAZdaPlq.js";import{at as n}from"./vendor-ui-mizMYESS.js";import{c as r,d as i,f as a,i as o,p as s,r as c,u as l}from"./proxy-CgM57W61.js";var u=n(),d=e(t(),1);function f(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function p(...e){return t=>{let n=!1,r=e.map(e=>{let r=f(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():f(e[t],null)}}}}function m(...e){return d.useCallback(p(...e),e)}var h=class extends d.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(r(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=r(e)&&e.offsetWidth||0,i=r(e)&&e.offsetHeight||0,a=getComputedStyle(t),o=this.props.sizeRef.current;o.height=parseFloat(a.height),o.width=parseFloat(a.width),o.top=t.offsetTop,o.left=t.offsetLeft,o.right=n-o.width-o.left,o.bottom=i-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}};function g({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let s=(0,d.useId)(),c=(0,d.useRef)(null),l=(0,d.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:f}=(0,d.useContext)(o),p=m(c,e.props?.ref??e?.ref);return(0,d.useInsertionEffect)(()=>{let{width:e,height:o,top:u,left:d,right:p,bottom:m}=l.current;if(t||a===!1||!c.current||!e||!o)return;let h=n===`left`?`left: ${d}`:`right: ${p}`,g=r===`bottom`?`bottom: ${m}`:`top: ${u}`;c.current.dataset.motionPopId=s;let _=document.createElement(`style`);f&&(_.nonce=f);let v=i??document.head;return v.appendChild(_),_.sheet&&_.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${s}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${e}px !important;
|
|
5
|
+
height: ${o}px !important;
|
|
6
|
+
${h}px !important;
|
|
7
|
+
${g}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{c.current?.removeAttribute(`data-motion-pop-id`),v.contains(_)&&v.removeChild(_)}},[t]),(0,u.jsx)(h,{isPresent:t,childRef:c,sizeRef:l,pop:a,children:a===!1?e:d.cloneElement(e,{ref:p})})}var _=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s,anchorX:c,anchorY:f,root:p})=>{let m=a(v),h=(0,d.useId)(),_=!0,y=(0,d.useMemo)(()=>(_=!1,{id:h,initial:t,isPresent:n,custom:i,onExitComplete:e=>{m.set(e,!0);for(let e of m.values())if(!e)return;r&&r()},register:e=>(m.set(e,!1),()=>m.delete(e))}),[n,m,r]);return o&&_&&(y={...y}),(0,d.useMemo)(()=>{m.forEach((e,t)=>m.set(t,!1))},[n]),d.useEffect(()=>{!n&&!m.size&&r&&r()},[n]),e=(0,u.jsx)(g,{pop:s===`popLayout`,isPresent:n,anchorX:c,anchorY:f,root:p,children:e}),(0,u.jsx)(l.Provider,{value:y,children:e})};function v(){return new Map}var y=e=>e.key||``;function b(e){let t=[];return d.Children.forEach(e,e=>{(0,d.isValidElement)(e)&&t.push(e)}),t}var x=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:l=`sync`,propagate:f=!1,anchorX:p=`left`,anchorY:m=`top`,root:h})=>{let[g,v]=c(f),x=(0,d.useMemo)(()=>b(e),[e]),S=f&&!g?[]:x.map(y),C=(0,d.useRef)(!0),w=(0,d.useRef)(x),T=a(()=>new Map),E=(0,d.useRef)(new Set),[D,O]=(0,d.useState)(x),[k,A]=(0,d.useState)(x);i(()=>{C.current=!1,w.current=x;for(let e=0;e<k.length;e++){let t=y(k[e]);S.includes(t)?(T.delete(t),E.current.delete(t)):T.get(t)!==!0&&T.set(t,!1)}},[k,S.length,S.join(`-`)]);let j=[];if(x!==D){let e=[...x];for(let t=0;t<k.length;t++){let n=k[t],r=y(n);S.includes(r)||(e.splice(t,0,n),j.push(n))}return l===`wait`&&j.length&&(e=j),A(b(e)),O(x),null}let{forceRender:M}=(0,d.useContext)(s);return(0,u.jsx)(u.Fragment,{children:k.map(e=>{let i=y(e),a=f&&!g?!1:x===k||S.includes(i);return(0,u.jsx)(_,{isPresent:a,initial:!C.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:l,root:h,onExitComplete:a?void 0:()=>{if(E.current.has(i))return;if(T.has(i))E.current.add(i),T.set(i,!0);else return;let e=!0;T.forEach(t=>{t||(e=!1)}),e&&(M?.(),A(w.current),f&&v?.(),r&&r())},anchorX:p,anchorY:m,children:e},i)})})};export{x as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Yddw9eHa.js";var t=e(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-COnpUsM8.js";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},n=new class extends t{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},r={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},i=new class{#e=r;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function a(e){setTimeout(e,0)}var o=typeof window>`u`||`Deno`in globalThis;function s(){}function c(e,t){return typeof e==`function`?e(t):e}function l(e){return typeof e==`number`&&e>=0&&e!==1/0}function u(e,t){return Math.max(e+(t||0)-Date.now(),0)}function d(e,t){return typeof e==`function`?e(t):e}function f(e,t){return typeof e==`function`?e(t):e}function p(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ee(o,t.options))return!1}else if(!ne(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function m(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(te(t.options.mutationKey)!==te(a))return!1}else if(!ne(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ee(e,t){return(t?.queryKeyHashFn||te)(e)}function te(e){return JSON.stringify(e,(e,t)=>se(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ne(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>ne(e[n],t[n])):!1}var re=Object.prototype.hasOwnProperty;function ie(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=oe(e)&&oe(t);if(!r&&!(se(e)&&se(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:re.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ie(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ae(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function oe(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function se(e){if(!ce(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ce(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ce(e){return Object.prototype.toString.call(e)===`[object Object]`}function le(e){return new Promise(t=>{i.setTimeout(t,e)})}function ue(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ie(e,t)}function de(e){return e}function fe(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function pe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var me=Symbol();function he(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===me?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ge(e,t){return typeof e==`function`?e(...t):!!e}function _e(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var ve=(()=>{let e=()=>o;return{isServer(){return e()},setIsServer(t){e=t}}})();function ye(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function be(e){let t;if(e.then(e=>(t=e,e),s)?.catch(s),t!==void 0)return{data:t}}function xe(e){return e}function Se(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Ce(e,t,n){let r=()=>{let r=e.promise?.then(t).catch(e=>n(e)?Promise.reject(Error(`redacted`)):Promise.reject(e));return r?.catch(s),r};return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t(e.state.data)}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:r()},...e.meta&&{meta:e.meta}}}function we(e){return e.state.isPaused}function Te(e){return e.state.status===`success`}function Ee(e){return!0}function De(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??we,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[Se(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Te,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors??Ee,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData??xe;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Ce(e,o,a)]:[])}}function Oe(e,t,n){if(typeof t!=`object`||!t)return;let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData??xe,o=t.mutations||[],c=t.queries||[];o.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),c.forEach(({queryKey:t,state:r,queryHash:o,meta:c,promise:l,dehydratedAt:u})=>{let d=l?be(l):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a(f),m=i.get(o),ee=m?.state.status===`pending`,te=m?.state.fetchStatus===`fetching`;if(m){let e=d&&u!==void 0&&u>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:c},{...r,data:p,fetchStatus:`idle`,status:p===void 0?r.status:`success`});l&&!ee&&!te&&(u===void 0||u>m.state.dataUpdatedAt)&&m.fetch(void 0,{initialPromise:Promise.resolve(l).then(a)}).catch(s)})}var ke=a;function Ae(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ke,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var h=Ae(),je=new class extends t{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Me(e){return Math.min(1e3*2**e,3e4)}function Ne(e){return(e??`online`)===`online`?je.isOnline():!0}var Pe=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Fe(e){let t=!1,r=0,i,a=ye(),o=()=>a.status!==`pending`,s=t=>{if(!o()){let n=new Pe(t);p(n),e.onCancel?.(n)}},c=()=>{t=!0},l=()=>{t=!1},u=()=>n.isFocused()&&(e.networkMode===`always`||je.isOnline())&&e.canRun(),d=()=>Ne(e.networkMode)&&e.canRun(),f=e=>{o()||(i?.(),a.resolve(e))},p=e=>{o()||(i?.(),a.reject(e))},m=()=>new Promise(t=>{i=e=>{(o()||u())&&t(e)},e.onPause?.()}).then(()=>{i=void 0,o()||e.onContinue?.()}),ee=()=>{if(o())return;let n,i=r===0?e.initialPromise:void 0;try{n=i??e.fn()}catch(e){n=Promise.reject(e)}Promise.resolve(n).then(f).catch(n=>{if(o())return;let i=e.retry??(ve.isServer()?0:3),a=e.retryDelay??Me,s=typeof a==`function`?a(r,n):a,c=i===!0||typeof i==`number`&&r<i||typeof i==`function`&&i(r,n);if(t||!c){p(n);return}r++,e.onFail?.(r,n),le(s).then(()=>u()?void 0:m()).then(()=>{t?p(n):ee()})})};return{promise:a,status:()=>a.status,cancel:s,continue:()=>(i?.(),a),cancelRetry:c,continueRetry:l,canStart:d,start:()=>(d()?ee():m().then(ee),a)}}var Ie=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),l(this.gcTime)&&(this.#e=i.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ve.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(i.clearTimeout(this.#e),this.#e=void 0)}},Le=class extends Ie{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Be(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Be(this.options);e.data!==void 0&&(this.setState(ze(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=ue(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(s).catch(s):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>f(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===me||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>d(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!u(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=he(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Fe({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Pe&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Pe){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Re(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ze(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),h.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Re(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ne(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ze(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Be(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}function Ve(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{_e(e,()=>t.signal,()=>n=!0)},u=he(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?pe:fe;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Ue:He,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:He(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function He(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ue(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function We(e,t){return t?He(e,t)!=null:!1}function Ge(e,t){return!t||!e.getPreviousPageParam?!1:Ue(e,t)!=null}var Ke=class extends Ie{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||qe(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Fe({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),h.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function qe(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Je=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Ke({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ye(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ye(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ye(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Ye(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){h.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>m(t,e))}findAll(e={}){return this.getAll().filter(t=>m(e,t))}notify(e){h.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return h.batch(()=>Promise.all(e.map(e=>e.continue().catch(s))))}};function Ye(e){return e.options.scope?.id}var Xe=class extends t{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ee(r,t),a=this.get(i);return a||(a=new Le({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){h.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>p(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>p(e,t)):t}notify(e){h.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){h.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){h.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ze=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Xe,this.#t=e.mutationCache||new Je,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=n.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=je.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(d(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=c(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return h.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;h.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return h.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=h.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(s).catch(s)}invalidateQueries(e,t={}){return h.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=h.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(s)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(s)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(d(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s).catch(s)}fetchInfiniteQuery(e){return e.behavior=Ve(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s).catch(s)}ensureInfiniteQueryData(e){return e.behavior=Ve(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return je.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(te(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ne(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(te(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ne(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ee(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===me&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},g;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(g||={});var Qe;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Qe||={});var _=g.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),v=e=>{switch(typeof e){case`undefined`:return _.undefined;case`string`:return _.string;case`number`:return Number.isNaN(e)?_.nan:_.number;case`boolean`:return _.boolean;case`function`:return _.function;case`bigint`:return _.bigint;case`symbol`:return _.symbol;case`object`:return Array.isArray(e)?_.array:e===null?_.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?_.promise:typeof Map<`u`&&e instanceof Map?_.map:typeof Set<`u`&&e instanceof Set?_.set:typeof Date<`u`&&e instanceof Date?_.date:_.object;default:return _.unknown}},y=g.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),$e=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`),b=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,g.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};b.create=e=>new b(e);var et=(e,t)=>{let n;switch(e.code){case y.invalid_type:n=e.received===_.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case y.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,g.jsonStringifyReplacer)}`;break;case y.unrecognized_keys:n=`Unrecognized key(s) in object: ${g.joinValues(e.keys,`, `)}`;break;case y.invalid_union:n=`Invalid input`;break;case y.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${g.joinValues(e.options)}`;break;case y.invalid_enum_value:n=`Invalid enum value. Expected ${g.joinValues(e.options)}, received '${e.received}'`;break;case y.invalid_arguments:n=`Invalid function arguments`;break;case y.invalid_return_type:n=`Invalid function return type`;break;case y.invalid_date:n=`Invalid date`;break;case y.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:g.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case y.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case y.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case y.custom:n=`Invalid input`;break;case y.invalid_intersection_types:n=`Intersection results could not be merged`;break;case y.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case y.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,g.assertNever(e)}return{message:n}},tt=et;function nt(e){tt=e}function rt(){return tt}var it=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},at=[];function x(e,t){let n=rt(),r=it({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===et?void 0:et].filter(e=>!!e)});e.common.issues.push(r)}var S=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return C;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return C;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},C=Object.freeze({status:`aborted`}),ot=e=>({status:`dirty`,value:e}),w=e=>({status:`valid`,value:e}),st=e=>e.status===`aborted`,ct=e=>e.status===`dirty`,lt=e=>e.status===`valid`,ut=e=>typeof Promise<`u`&&e instanceof Promise,T;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(T||={});var E=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},dt=(e,t)=>{if(lt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new b(e.common.issues),this._error}}};function D(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var O=class{get description(){return this._def.description}_getType(e){return v(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:v(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new S,ctx:{common:e.parent.common,data:e.data,parsedType:v(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ut(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:v(e)};return dt(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:v(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return lt(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>lt(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:v(e)},r=this._parse({data:e,path:n.path,parent:n});return dt(n,await(ut(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:y.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new M({schema:this,typeName:P.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return N.create(this,this._def)}nullable(){return fn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Jt.create(this)}promise(){return dn.create(this,this._def)}or(e){return Xt.create([this,e],this._def)}and(e){return $t.create(this,e,this._def)}transform(e){return new M({...D(this._def),schema:this,typeName:P.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new pn({...D(this._def),innerType:this,defaultValue:t,typeName:P.ZodDefault})}brand(){return new _n({typeName:P.ZodBranded,type:this,...D(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new mn({...D(this._def),innerType:this,catchValue:t,typeName:P.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return vn.create(this,e)}readonly(){return yn.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ft=/^c[^\s-]{8,}$/i,pt=/^[0-9a-z]+$/,mt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ht=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gt=/^[a-z0-9_-]{21}$/i,_t=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,vt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,yt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,bt=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,xt,St=/^(?:(?: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])$/,Ct=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Tt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Et=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Dt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ot=`((\\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])))`,kt=RegExp(`^${Ot}$`);function At(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function jt(e){return RegExp(`^${At(e)}$`)}function Mt(e){let t=`${Ot}T${At(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Nt(e,t){return!!((t===`v4`||!t)&&St.test(e)||(t===`v6`||!t)&&wt.test(e))}function Pt(e,t){if(!_t.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Ft(e,t){return!!((t===`v4`||!t)&&Ct.test(e)||(t===`v6`||!t)&&Tt.test(e))}var It=class e extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.string,received:t.parsedType}),C}let t=new S,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?x(n,{code:y.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&x(n,{code:y.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)yt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`email`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)xt||=new RegExp(bt,`u`),xt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`emoji`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)ht.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`uuid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)gt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`nanoid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)ft.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`cuid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)pt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`cuid2`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)mt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`ulid`,code:y.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),x(n,{validation:`url`,code:y.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`regex`,code:y.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Mt(r).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?kt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?jt(r).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:y.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?vt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`duration`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Nt(e.data,r.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`ip`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Pt(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`jwt`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Ft(e.data,r.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`cidr`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Et.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`base64`,code:y.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Dt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:`base64url`,code:y.invalid_string,message:r.message}),t.dirty()):g.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:y.invalid_string,...T.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...T.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...T.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...T.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...T.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...T.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...T.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...T.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...T.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...T.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...T.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...T.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...T.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...T.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...T.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...T.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...T.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...T.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...T.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...T.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...T.errToObj(t)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};It.create=e=>new It({checks:[],typeName:P.ZodString,coerce:e?.coerce??!1,...D(e)});function Lt(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Rt=class e extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.number,received:t.parsedType}),C}let t,n=new S;for(let r of this._def.checks)r.kind===`int`?g.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:y.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Lt(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_finite,message:r.message}),n.dirty()):g.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,T.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,T.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,T.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,T.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:T.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:T.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:T.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:T.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:T.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&g.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};Rt.create=e=>new Rt({checks:[],typeName:P.ZodNumber,coerce:e?.coerce||!1,...D(e)});var zt=class e extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let t,n=new S;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),x(t,{code:y.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):g.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.bigint,received:t.parsedType}),C}gte(e,t){return this.setLimit(`min`,e,!0,T.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,T.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,T.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,T.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:T.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:T.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};zt.create=e=>new zt({checks:[],typeName:P.ZodBigInt,coerce:e?.coerce??!1,...D(e)});var Bt=class extends O{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.boolean,received:t.parsedType}),C}return w(e.data)}};Bt.create=e=>new Bt({typeName:P.ZodBoolean,coerce:e?.coerce||!1,...D(e)});var Vt=class e extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.date,received:t.parsedType}),C}if(Number.isNaN(e.data.getTime()))return x(this._getOrReturnCtx(e),{code:y.invalid_date}),C;let t=new S,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:y.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):g.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};Vt.create=e=>new Vt({checks:[],coerce:e?.coerce||!1,typeName:P.ZodDate,...D(e)});var Ht=class extends O{_parse(e){if(this._getType(e)!==_.symbol){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.symbol,received:t.parsedType}),C}return w(e.data)}};Ht.create=e=>new Ht({typeName:P.ZodSymbol,...D(e)});var Ut=class extends O{_parse(e){if(this._getType(e)!==_.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.undefined,received:t.parsedType}),C}return w(e.data)}};Ut.create=e=>new Ut({typeName:P.ZodUndefined,...D(e)});var Wt=class extends O{_parse(e){if(this._getType(e)!==_.null){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.null,received:t.parsedType}),C}return w(e.data)}};Wt.create=e=>new Wt({typeName:P.ZodNull,...D(e)});var Gt=class extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return w(e.data)}};Gt.create=e=>new Gt({typeName:P.ZodAny,...D(e)});var Kt=class extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return w(e.data)}};Kt.create=e=>new Kt({typeName:P.ZodUnknown,...D(e)});var k=class extends O{_parse(e){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.never,received:t.parsedType}),C}};k.create=e=>new k({typeName:P.ZodNever,...D(e)});var qt=class extends O{_parse(e){if(this._getType(e)!==_.undefined){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.void,received:t.parsedType}),C}return w(e.data)}};qt.create=e=>new qt({typeName:P.ZodVoid,...D(e)});var Jt=class e extends O{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==_.array)return x(t,{code:y.invalid_type,expected:_.array,received:t.parsedType}),C;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(x(t,{code:e?y.too_big:y.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(x(t,{code:y.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(x(t,{code:y.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new E(t,e,t.path,n)))).then(e=>S.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new E(t,e,t.path,n)));return S.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:T.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:T.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:T.toString(n)}})}nonempty(e){return this.min(1,e)}};Jt.create=(e,t)=>new Jt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...D(t)});function Yt(e){if(e instanceof A){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=N.create(Yt(r))}return new A({...e._def,shape:()=>t})}else if(e instanceof Jt)return new Jt({...e._def,type:Yt(e.element)});else if(e instanceof N)return N.create(Yt(e.unwrap()));else if(e instanceof fn)return fn.create(Yt(e.unwrap()));else if(e instanceof en)return en.create(e.items.map(e=>Yt(e)));else return e}var A=class e extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape();return this._cached={shape:e,keys:g.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==_.object){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.object,received:t.parsedType}),C}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof k&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new E(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof k){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(x(n,{code:y.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new E(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>S.mergeObjectSync(t,e)):S.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return T.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:T.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:P.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of g.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of g.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return Yt(this)}partial(t){let n={};for(let e of g.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of g.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof N;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return cn(g.objectKeys(this.shape))}};A.create=(e,t)=>new A({shape:()=>e,unknownKeys:`strip`,catchall:k.create(),typeName:P.ZodObject,...D(t)}),A.strictCreate=(e,t)=>new A({shape:()=>e,unknownKeys:`strict`,catchall:k.create(),typeName:P.ZodObject,...D(t)}),A.lazycreate=(e,t)=>new A({shape:e,unknownKeys:`strip`,catchall:k.create(),typeName:P.ZodObject,...D(t)});var Xt=class extends O{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new b(e.ctx.common.issues));return x(t,{code:y.invalid_union,unionErrors:n}),C}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new b(e));return x(t,{code:y.invalid_union,unionErrors:i}),C}}get options(){return this._def.options}};Xt.create=(e,t)=>new Xt({options:e,typeName:P.ZodUnion,...D(t)});var j=e=>e instanceof on?j(e.schema):e instanceof M?j(e.innerType()):e instanceof sn?[e.value]:e instanceof ln?e.options:e instanceof un?g.objectValues(e.enum):e instanceof pn?j(e._def.innerType):e instanceof Ut?[void 0]:e instanceof Wt?[null]:e instanceof N?[void 0,...j(e.unwrap())]:e instanceof fn?[null,...j(e.unwrap())]:e instanceof _n||e instanceof yn?j(e.unwrap()):e instanceof mn?j(e._def.innerType):[],Zt=class e extends O{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.object)return x(t,{code:y.invalid_type,expected:_.object,received:t.parsedType}),C;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(x(t,{code:y.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=j(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:P.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...D(r)})}};function Qt(e,t){let n=v(e),r=v(t);if(e===t)return{valid:!0,data:e};if(n===_.object&&r===_.object){let n=g.objectKeys(t),r=g.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Qt(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===_.array&&r===_.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Qt(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===_.date&&r===_.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var $t=class extends O{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(st(e)||st(r))return C;let i=Qt(e.value,r.value);return i.valid?((ct(e)||ct(r))&&t.dirty(),{status:t.value,value:i.data}):(x(n,{code:y.invalid_intersection_types}),C)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};$t.create=(e,t,n)=>new $t({left:e,right:t,typeName:P.ZodIntersection,...D(n)});var en=class e extends O{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return x(n,{code:y.invalid_type,expected:_.array,received:n.parsedType}),C;if(n.data.length<this._def.items.length)return x(n,{code:y.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),C;!this._def.rest&&n.data.length>this._def.items.length&&(x(n,{code:y.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new E(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>S.mergeArray(t,e)):S.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};en.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new en({items:e,typeName:P.ZodTuple,rest:null,...D(t)})};var tn=class e extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return x(n,{code:y.invalid_type,expected:_.object,received:n.parsedType}),C;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new E(n,e,n.path,e)),value:a._parse(new E(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?S.mergeObjectAsync(t,r):S.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof O?new e({keyType:t,valueType:n,typeName:P.ZodRecord,...D(r)}):new e({keyType:It.create(),valueType:t,typeName:P.ZodRecord,...D(n)})}},nn=class extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return x(n,{code:y.invalid_type,expected:_.map,received:n.parsedType}),C;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new E(n,e,n.path,[a,`key`])),value:i._parse(new E(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return C;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return C;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};nn.create=(e,t,n)=>new nn({valueType:t,keyType:e,typeName:P.ZodMap,...D(n)});var rn=class e extends O{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return x(n,{code:y.invalid_type,expected:_.set,received:n.parsedType}),C;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(x(n,{code:y.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(x(n,{code:y.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return C;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new E(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:T.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:T.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};rn.create=(e,t)=>new rn({valueType:e,minSize:null,maxSize:null,typeName:P.ZodSet,...D(t)});var an=class e extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.function)return x(t,{code:y.invalid_type,expected:_.function,received:t.parsedType}),C;function n(e,n){return it({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rt(),et].filter(e=>!!e),issueData:{code:y.invalid_arguments,argumentsError:n}})}function r(e,n){return it({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,rt(),et].filter(e=>!!e),issueData:{code:y.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof dn){let e=this;return w(async function(...t){let o=new b([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return w(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new b([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new b([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:en.create(t).rest(Kt.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||en.create([]).rest(Kt.create()),returns:n||Kt.create(),typeName:P.ZodFunction,...D(r)})}},on=class extends O{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};on.create=(e,t)=>new on({getter:e,typeName:P.ZodLazy,...D(t)});var sn=class extends O{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:y.invalid_literal,expected:this._def.value}),C}return{status:`valid`,value:e.data}}get value(){return this._def.value}};sn.create=(e,t)=>new sn({value:e,typeName:P.ZodLiteral,...D(t)});function cn(e,t){return new ln({values:e,typeName:P.ZodEnum,...D(t)})}var ln=class e extends O{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return x(t,{expected:g.joinValues(n),received:t.parsedType,code:y.invalid_type}),C}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return x(t,{received:t.data,code:y.invalid_enum_value,options:n}),C}return w(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};ln.create=cn;var un=class extends O{_parse(e){let t=g.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){let e=g.objectValues(t);return x(n,{expected:g.joinValues(e),received:n.parsedType,code:y.invalid_type}),C}if(this._cache||=new Set(g.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=g.objectValues(t);return x(n,{received:n.data,code:y.invalid_enum_value,options:e}),C}return w(e.data)}get enum(){return this._def.values}};un.create=(e,t)=>new un({values:e,typeName:P.ZodNativeEnum,...D(t)});var dn=class extends O{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==_.promise&&t.common.async===!1?(x(t,{code:y.invalid_type,expected:_.promise,received:t.parsedType}),C):w((t.parsedType===_.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};dn.create=(e,t)=>new dn({type:e,typeName:P.ZodPromise,...D(t)});var M=class extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{x(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return C;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?C:r.status===`dirty`||t.value===`dirty`?ot(r.value):r});{if(t.value===`aborted`)return C;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?C:r.status===`dirty`||t.value===`dirty`?ot(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?C:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?C:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!lt(e))return C;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>lt(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):C);g.assertNever(r)}};M.create=(e,t,n)=>new M({schema:e,typeName:P.ZodEffects,effect:t,...D(n)}),M.createWithPreprocess=(e,t,n)=>new M({schema:t,effect:{type:`preprocess`,transform:e},typeName:P.ZodEffects,...D(n)});var N=class extends O{_parse(e){return this._getType(e)===_.undefined?w(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};N.create=(e,t)=>new N({innerType:e,typeName:P.ZodOptional,...D(t)});var fn=class extends O{_parse(e){return this._getType(e)===_.null?w(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};fn.create=(e,t)=>new fn({innerType:e,typeName:P.ZodNullable,...D(t)});var pn=class extends O{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:P.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...D(t)});var mn=class extends O{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ut(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new b(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new b(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};mn.create=(e,t)=>new mn({innerType:e,typeName:P.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...D(t)});var hn=class extends O{_parse(e){if(this._getType(e)!==_.nan){let t=this._getOrReturnCtx(e);return x(t,{code:y.invalid_type,expected:_.nan,received:t.parsedType}),C}return{status:`valid`,value:e.data}}};hn.create=e=>new hn({typeName:P.ZodNaN,...D(e)});var gn=Symbol(`zod_brand`),_n=class extends O{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},vn=class e extends O{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?C:e.status===`dirty`?(t.dirty(),ot(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?C:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:P.ZodPipeline})}},yn=class extends O{_parse(e){let t=this._def.innerType._parse(e),n=e=>(lt(e)&&(e.value=Object.freeze(e.value)),e);return ut(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};yn.create=(e,t)=>new yn({innerType:e,typeName:P.ZodReadonly,...D(t)});function bn(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function xn(e,t={},n){return e?Gt.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=bn(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=bn(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):Gt.create()}var Sn={object:A.lazycreate},P;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(P||={});var Cn=(e,t={message:`Input not instance of ${e.name}`})=>xn(t=>t instanceof e,t),F=It.create,I=Rt.create,wn=hn.create,Tn=zt.create,L=Bt.create,En=Vt.create,Dn=Ht.create,On=Ut.create,kn=Wt.create,An=Gt.create,R=Kt.create,jn=k.create,Mn=qt.create,z=Jt.create,B=A.create,Nn=A.strictCreate,V=Xt.create,H=Zt.create,Pn=$t.create,Fn=en.create,U=tn.create,In=nn.create,Ln=rn.create,Rn=an.create,zn=on.create,W=sn.create,G=ln.create,Bn=un.create,Vn=dn.create,Hn=M.create,Un=N.create,Wn=fn.create,Gn=M.createWithPreprocess,Kn=vn.create,qn=()=>F().optional(),Jn=()=>I().optional(),Yn=()=>L().optional(),Xn={string:(e=>It.create({...e,coerce:!0})),number:(e=>Rt.create({...e,coerce:!0})),boolean:(e=>Bt.create({...e,coerce:!0})),bigint:(e=>zt.create({...e,coerce:!0})),date:(e=>Vt.create({...e,coerce:!0}))},Zn=C,Qn=e({BRAND:()=>gn,DIRTY:()=>ot,EMPTY_PATH:()=>at,INVALID:()=>C,NEVER:()=>Zn,OK:()=>w,ParseStatus:()=>S,Schema:()=>O,ZodAny:()=>Gt,ZodArray:()=>Jt,ZodBigInt:()=>zt,ZodBoolean:()=>Bt,ZodBranded:()=>_n,ZodCatch:()=>mn,ZodDate:()=>Vt,ZodDefault:()=>pn,ZodDiscriminatedUnion:()=>Zt,ZodEffects:()=>M,ZodEnum:()=>ln,ZodError:()=>b,ZodFirstPartyTypeKind:()=>P,ZodFunction:()=>an,ZodIntersection:()=>$t,ZodIssueCode:()=>y,ZodLazy:()=>on,ZodLiteral:()=>sn,ZodMap:()=>nn,ZodNaN:()=>hn,ZodNativeEnum:()=>un,ZodNever:()=>k,ZodNull:()=>Wt,ZodNullable:()=>fn,ZodNumber:()=>Rt,ZodObject:()=>A,ZodOptional:()=>N,ZodParsedType:()=>_,ZodPipeline:()=>vn,ZodPromise:()=>dn,ZodReadonly:()=>yn,ZodRecord:()=>tn,ZodSchema:()=>O,ZodSet:()=>rn,ZodString:()=>It,ZodSymbol:()=>Ht,ZodTransformer:()=>M,ZodTuple:()=>en,ZodType:()=>O,ZodUndefined:()=>Ut,ZodUnion:()=>Xt,ZodUnknown:()=>Kt,ZodVoid:()=>qt,addIssueToContext:()=>x,any:()=>An,array:()=>z,bigint:()=>Tn,boolean:()=>L,coerce:()=>Xn,custom:()=>xn,date:()=>En,datetimeRegex:()=>Mt,defaultErrorMap:()=>et,discriminatedUnion:()=>H,effect:()=>Hn,enum:()=>G,function:()=>Rn,getErrorMap:()=>rt,getParsedType:()=>v,instanceof:()=>Cn,intersection:()=>Pn,isAborted:()=>st,isAsync:()=>ut,isDirty:()=>ct,isValid:()=>lt,late:()=>Sn,lazy:()=>zn,literal:()=>W,makeIssue:()=>it,map:()=>In,nan:()=>wn,nativeEnum:()=>Bn,never:()=>jn,null:()=>kn,nullable:()=>Wn,number:()=>I,object:()=>B,objectUtil:()=>Qe,oboolean:()=>Yn,onumber:()=>Jn,optional:()=>Un,ostring:()=>qn,pipeline:()=>Kn,preprocess:()=>Gn,promise:()=>Vn,quotelessJson:()=>$e,record:()=>U,set:()=>Ln,setErrorMap:()=>nt,strictObject:()=>Nn,string:()=>F,symbol:()=>Dn,transformer:()=>Hn,tuple:()=>Fn,undefined:()=>On,union:()=>V,unknown:()=>R,util:()=>g,void:()=>Mn}),$n=B({username:F().min(1),password:F().min(1)}),er=B({ok:W(!0),changePassword:L()}),tr=B({oldPassword:F().min(1),newPassword:F().min(6)}),nr=B({ok:W(!0)}),rr=B({authenticated:L(),username:F().optional()});B({username:F(),passwordHash:F()});var ir=B({state:G([`healthy`,`busy`,`saturated`]),pendingWorkCount:I().finite().int().nonnegative(),completedLastTick:I().finite().int().nonnegative()}),ar=B({connected:L(),messagesPublished:I().finite().int().nonnegative(),messagesAttempted:I().finite().int().nonnegative(),messagesFiltered:I().finite().int().nonnegative(),errorsCount:I().finite().int().nonnegative(),lastPublishMs:I().finite().nonnegative(),health:ir.optional()});B({name:F().min(1),enabled:L().default(!0)}).passthrough();var or=B({name:F().min(1),enabled:L(),pending:L().optional(),endpoint:F().optional(),config:U(F(),R())}),K=B({environmentName:F().min(1).optional(),core:B({state:G([`idle`,`running`,`paused`,`stopped`]),tickCount:I().int().nonnegative(),simulationTimeSeconds:I().finite().nonnegative(),instanceCount:I().int().nonnegative(),memberValueCount:I().int().nonnegative(),quarantinedInstanceCount:I().int().nonnegative(),engineErrorsCount:I().int().nonnegative(),tickOverrunsCount:I().int().nonnegative(),circuitBreakerTripsCount:I().int().nonnegative(),uptimeMs:I().finite().nonnegative(),actualTicksPerSecond:I().finite().nonnegative()}),fleet:B({modelBreakdown:z(B({model:F().min(1),count:I().int().nonnegative()})),lifecycleBreakdown:U(F(),I().int().nonnegative()),activeFaultCount:I().int().nonnegative(),faultBreakdown:z(B({fault:F().min(1),count:I().int().nonnegative()}))}),adapters:z(B({name:F().min(1),metrics:ar}))}),sr=B({environmentName:F().min(1).optional(),models:z(B({name:F().min(1),memberCount:I().int().nonnegative(),faultCount:I().int().nonnegative(),faultNames:z(F().min(1)),hasLifecycle:L()})),instances:z(B({id:F().min(1),model:F().min(1),browsePath:z(F().min(1)),lifecycleStage:F().min(1),operatingHours:I().finite().nonnegative(),activeFaults:z(F().min(1)),isQuarantined:L()})),config:B({seed:I().int().nonnegative(),tickIntervalMs:I().int().positive(),timeMultiplier:I().finite().positive(),adapters:z(F().min(1)),template:B({name:F().min(1),path:F().min(1)}).optional()}),availableAdapters:z(or).optional()}),cr=B({templateRunId:I().int().nonnegative(),templateName:F().min(1),prefix:F().min(1),instanceIds:z(F().min(1)),models:z(F().min(1)),templatePath:F().min(1).optional()}),lr=B({state:sr,metrics:K,runningTemplates:z(cr),revision:I().int().nonnegative()}),ur=H(`authenticated`,[B({authenticated:W(!1)}),B({authenticated:W(!0),username:F().min(1),runtime:lr})]),dr=B({instanceId:F().min(1),memberName:F().min(1),value:V([I().finite(),F(),L()]),quality:G([`good`,`bad`,`uncertain`]),timestamp:I().finite().optional()}),fr=H(`kind`,[B({kind:W(`fault:triggered`),instanceId:F().min(1),fault:F().min(1),effects:U(F(),R())}),B({kind:W(`fault:cleared`),instanceId:F().min(1),fault:F().min(1)}),B({kind:W(`lifecycle:changed`),instanceId:F().min(1),from:F().min(1),to:F().min(1),operatingHours:I().finite().nonnegative()}),B({kind:W(`instance:created`),id:F().min(1),assetType:F().min(1),browsePath:z(F().min(1))}),B({kind:W(`instance:removed`),id:F().min(1)}),B({kind:W(`engine:state`),from:K.shape.core.shape.state,to:K.shape.core.shape.state}),B({kind:W(`adapter:enabled`),name:F().min(1),endpoint:F().min(1)}),B({kind:W(`adapter:disabled`),name:F().min(1)})]),pr=B({core:B({memberValueCount:K.shape.core.shape.memberValueCount,quarantinedInstanceCount:K.shape.core.shape.quarantinedInstanceCount,engineErrorsCount:K.shape.core.shape.engineErrorsCount,tickOverrunsCount:K.shape.core.shape.tickOverrunsCount,circuitBreakerTripsCount:K.shape.core.shape.circuitBreakerTripsCount,uptimeMs:K.shape.core.shape.uptimeMs,actualTicksPerSecond:K.shape.core.shape.actualTicksPerSecond}),adapters:K.shape.adapters}),mr=H(`type`,[B({type:W(`runtime:snapshot`),snapshot:lr}),B({type:W(`runtime:tick`),revision:I().int().nonnegative(),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),delta:z(dr),instanceCount:I().int().nonnegative(),metrics:pr}),B({type:W(`runtime:event`),revision:I().int().nonnegative(),event:fr}),B({type:W(`runtime:resync-required`),revision:I().int().nonnegative(),reason:F().min(1)})]),hr=1883,gr=4840,_r=1e4,q=/^[a-zA-Z0-9_-]{1,64}$/,vr=/^\$param\.(\S+)$/,yr=1e3,J=B({correlationId:F().optional()}),br=J.extend({type:W(`spawn`),model:F().min(1),count:I().int().positive().max(_r),variation:I().min(0).max(1).optional(),unsBasePath:F().min(1).optional(),parameterOverrides:U(F(),I().finite()).optional(),startingHours:I().nonnegative().finite().optional()}),xr=J.extend({type:W(`removeInstance`),instanceId:F().min(1)}),Sr=J.extend({type:W(`setParameter`),instanceId:F().min(1),parameter:F().min(1),value:I().finite()}),Cr=J.extend({type:W(`triggerFault`),instanceId:F().min(1),fault:F().min(1)}),wr=J.extend({type:W(`clearFault`),instanceId:F().min(1),fault:F().min(1)}),Tr=J.extend({type:W(`pause`)}),Er=J.extend({type:W(`resume`)}),Dr=J.extend({type:W(`setSpeed`),multiplier:I().positive().finite().max(yr)}),Or=J.extend({type:W(`unquarantine`),instanceId:F().min(1)}),kr=J.extend({type:W(`invokeMethod`),instanceId:F().min(1),method:F().min(1),arguments:U(F().min(1),V([I().finite(),F(),L()])).optional()}),Ar=J.extend({type:W(`loadTemplate`),templatePath:F().min(1),count:I().int().positive().default(1)}),jr=J.extend({type:W(`unloadTemplateRun`),templateRunId:I().int().positive()}),Mr=J.extend({type:W(`resetEnvironment`),clearPersistence:L().optional()}),Nr=J.extend({type:W(`enableAdapter`),adapter:F().min(1),config:U(F(),R()).optional()}),Pr=J.extend({type:W(`disableAdapter`),adapter:F().min(1)}),Fr=H(`type`,[br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr]),Ir=B({success:L(),command:F(),correlationId:F().optional(),message:F(),data:R().optional(),error:F().optional()}),Lr=G([`Boolean`,`Int32`,`UInt16`,`UInt32`,`Double`,`Float`,`String`]);G([`variable`,`property`]);var Rr=G([`read`,`readwrite`,`write`]),zr=G([`>`,`>=`,`<`,`<=`,`==`,`!=`]),Br=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,Vr=H(`type`,[B({type:W(`threshold`),member:F().regex(q,Br),operator:zr,threshold:I().finite()}).strict(),B({type:W(`lifecycle-stage`)}).strict(),B({type:W(`health-state`)}).strict(),B({type:W(`fault-active`)}).strict(),B({type:W(`fault-count`)}).strict(),B({type:W(`active-fault-code`),fallback:F().default(``)}).strict(),B({type:W(`availability-state`),member:F().regex(q,Br),operator:zr.default(`>`),threshold:I().finite().default(0),running_state:F().default(`running`),stopped_state:F().default(`stopped`),faulted_state:F().default(`faulted`)}).strict()]),Hr=`%.A.Hz.L.L/h.L/min.L/s.N.V.bar.cfm.count.degC.h.kN.kVA.kW.kWh.m.m/s.m3.m3/h.mm.mm/min.mm/s.ppm.pu.rpm.s`.split(`.`),Ur=G(Hr);new Set(Hr);var Wr=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`;G([`float`,`int`,`string`,`bool`]);var Gr=H(`type`,[B({type:W(`float`),default:I().finite(),min:I().finite().optional(),max:I().finite().optional(),unit:Ur.optional()}),B({type:W(`int`),default:I().int().safe(),min:I().int().safe().optional(),max:I().int().safe().optional(),unit:Ur.optional()}),B({type:W(`string`),default:F(),unit:Ur.optional()}),B({type:W(`bool`),default:L(),unit:Ur.optional()})]),Kr=V([B({member:F()}),B({previous_member:F()}),B({param:F()}),B({generator:zn(()=>bi)})]),qr=F().regex(vr,`Must be a $param.X parameter reference`),Y=V([I(),qr]),Jr=V([I().finite(),qr]),Yr={initial_value:I().default(0),gain:Y.default(1),bias:Y.default(0),min:I().nullable().default(null),max:I().nullable().default(null),input:Kr},Xr=B({type:W(`sine`),center:Y,amplitude:I().positive(),period:I().positive()}).strict(),Zr=B({type:W(`random-walk`),min:I(),max:I(),step:I().positive()}).strict(),Qr=B({type:W(`noise`),center:Y,stddev:I().positive()}).strict(),$r=B({type:W(`step`),values:z(I()).min(1),interval:I().positive()}).strict(),ei=B({type:W(`correlated`),source:F().regex(q,Wr),factor:Jr,offset:Jr,power:I().int().positive().optional()}).strict(),ti=B({from:F(),to:F(),probability:I().min(0).max(1).optional(),on:F().optional()}),ni=B({type:W(`state-machine`),states:z(F()).min(1),initial:F(),transitions:z(ti).min(1)}).strict(),ri=B({type:W(`ramp`),start_value:I().default(0),rate:I(),duration:I().nonnegative(),start_time:I().default(0),min:I().nullable().default(null),max:I().nullable().default(null)}).strict(),ii=B({type:W(`mean-reverting-noise`),mean:Y,tau:I().positive(),sigma:I().positive(),initial_value:I().optional(),min:I().nullable().default(null),max:I().nullable().default(null)}).strict(),ai=B({time:I().nonnegative(),value:I()}),oi=B({type:W(`timetable`),points:z(ai).min(2),repeat:L().default(!1),interpolation:G([`linear`,`step`]).default(`linear`)}).strict(),si=B({type:W(`waveform`),shape:G([`sawtooth`,`triangle`,`square`,`pulse`]),center:Y,amplitude:I().positive(),period:I().positive(),duty_cycle:I().min(0).max(1).default(.5)}).strict(),ci=B({type:W(`chirp`),center:Y,amplitude:I().positive(),start_freq_hz:I().positive(),end_freq_hz:I().positive(),sweep_duration:I().positive(),sweep:G([`linear`,`exponential`]).default(`linear`),repeat:L().default(!0)}).strict(),li=B({type:W(`impulse`),baseline:I().default(0),amplitude:I(),probability:I().min(0).max(1).optional(),interval:I().positive().optional(),decay:I().min(0).max(1).optional(),duration:I().int().positive().default(1)}).strict(),ui=B({type:W(`first-order-lag`),tau:I().positive(),...Yr}).strict(),di=B({type:W(`integrator`),initial_value:I().default(0),gain:I().default(1),bias_rate:I().default(0),min:I().default(-1/0),max:I().default(1/0),wrap:L().default(!1),wrap_at:I().nullable().default(null),input:Kr}).strict(),fi=B({type:W(`transport-delay`),delay:V([I().nonnegative(),qr]),initial_value:I().default(0),interpolation:G([`linear`,`zoh`]).default(`linear`),input:Kr}).strict(),pi=B({type:W(`slew-rate-limiter`),rate_up:I().positive(),rate_down:I().positive().optional(),initial_value:I().default(0),min:I().nullable().default(null),max:I().nullable().default(null),input:Kr}).strict(),mi=B({type:W(`second-order`),natural_freq_hz:I().positive(),damping_ratio:I().positive(),initial_velocity:I().default(0),...Yr}).strict(),hi=B({type:W(`hysteresis-relay`),on_threshold:Y,off_threshold:Y,output_on:V([I(),F()]).default(1),output_off:V([I(),F()]).default(0),initial_state:G([`on`,`off`]).default(`off`),mode:G([`rising`,`falling`]).default(`rising`),input:Kr}).strict(),gi=B({weight:Y.default(1),input:Kr}),_i=B({type:W(`weighted-sum`),bias:Y.default(0),terms:z(gi).min(1),min:I().nullable().default(null),max:I().nullable().default(null)}).strict(),vi=B({type:W(`gate`),enabled_member:F().regex(q,Wr),input:Kr,disabled_value:V([I(),F(),L()])}).strict(),yi=H(`type`,[Xr,Zr,Qr,$r,ei,ni,ri,ii,oi,si,ci,li]),bi=H(`type`,[Xr,Zr,Qr,$r,ei,ni,ri,ii,oi,si,ci,li,B({type:W(`health-dependent`),stages:U(F(),yi)}).strict(),ui,di,fi,pi,mi,hi,_i,vi]),xi=B({multiplier:I().finite().optional(),offset:I().finite().optional()}),Si=B({stages:z(B({name:F().min(1),duration_hours:Fn([I().nonnegative(),I().nonnegative()]).refine(([e,t])=>e<=t,{message:`duration_hours max must be greater than or equal to min.`}),effects:U(F(),xi)})).min(1)}),Ci=B({multiplier:I().finite().optional(),offset:I().finite().optional(),spike:I().finite().optional(),duration_ticks:I().int().positive().optional(),onset_ticks:I().int().positive().optional(),recovery_ticks:I().int().positive().optional()}),wi=B({condition:F().optional(),lifecycle_stage:F().optional(),probability:I().min(0).max(1)}),Ti=B({name:F().regex(q,Wr),trigger:wi,effects:U(F(),V([Ci,F()]))}),Ei=B({type:W(`first-order-lag`),tau:I().positive(),...Yr}).strict(),Di=di,Oi=fi,ki=pi,Ai=hi,ji=mi,Mi=_i,Ni=vi,Pi=H(`type`,[Xr,Zr,Qr,$r,ei,ni,ri,ii,oi,si,ci,li,B({type:W(`health-dependent`),stages:U(F(),yi)}).strict(),Ei,Di,Oi,ki,ji,Ai,Mi,Ni]),X=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,Fi=z(F().min(1)).min(1),Ii=B({data_type:Lr,unit:Ur.optional(),description:F().optional(),enum_values:Fi.optional()}).strict(),Li=V([B({member:F().regex(q,X),value:V([I(),F(),L()])}).strict(),B({member:F().regex(q,X),argument:F().regex(q,X)}).strict()]),Ri=B({type:W(`set-members`),writes:z(Li).min(1)}).strict(),zi=V([B({parameter:F().regex(q,X),value:I().finite()}).strict(),B({parameter:F().regex(q,X),argument:F().regex(q,X)}).strict()]),Bi=H(`type`,[Ri,B({type:W(`set-parameters`),writes:z(zi).min(1)}).strict(),B({type:W(`clear-faults`)}).strict()]),Vi=B({description:F().optional(),input_arguments:U(F().regex(q,X),Ii).optional(),output_arguments:U(F().regex(q,X),Ii).optional(),runtime:Bi.optional()}).strict(),Hi=U(F().regex(q,X),Vi);function Z(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ui(e){if(typeof e==`string`)return vr.exec(e)?.[1]}function Wi(e,t,n){if(!Z(e)||e.type!==`weighted-sum`)return;let r=e.terms;if(Array.isArray(r))for(let e=0;e<r.length;e++){let i=r[e];Z(i)&&n(i,[...t,`terms`,e])}}function Gi(e,t,n){if(!Z(e))return;let r=[...t,`member`],i=[...t,`previous_member`],a=[...t,`param`],o=[...t,`generator`];typeof e.member==`string`&&n.onMember?.(e.member,r),typeof e.previous_member==`string`&&n.onPreviousMember?.(e.previous_member,i),typeof e.param==`string`&&n.onParam?.(e.param,a),`generator`in e&&n.onGenerator?.(e.generator,o)}function Ki(e,t,n,r){return{onMember:e,onPreviousMember:t,onParam:n,onGenerator:r}}function qi(e,t,n,r,i,a){Gi(e,t,Ki(n,r,i,a))}function Ji(e){return e===`Double`||e===`Float`||e===`Int32`||e===`UInt16`||e===`UInt32`}function Yi(e){return e===`Int32`||e===`UInt16`||e===`UInt32`}function Xi(e,t){switch(t){case`Boolean`:return typeof e==`boolean`;case`String`:return typeof e==`string`;case`Double`:case`Float`:return typeof e==`number`&&Number.isFinite(e);case`Int32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=-2147483648&&e<=2147483647;case`UInt16`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=65535;case`UInt32`:return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0&&e<=4294967295;default:return!1}}function Zi(e,t,n){e.unit!==void 0&&(e.data_type===`Boolean`||e.data_type===`String`)&&t.addIssue({code:y.custom,path:[...n,`unit`],message:`Members with data_type "${e.data_type}" must not declare engineering units. Fix: remove the unit or use a numeric data_type.`}),e.enum_values&&e.data_type!==`String`&&t.addIssue({code:y.custom,path:[...n,`enum_values`],message:`enum_values is only valid for String members. Fix: remove enum_values or change data_type to "String".`})}function Qi(e,t,n,r){if(Z(e)&&typeof e.type==`string`)switch(e.type){case`correlated`:typeof e.source==`string`&&n.push({member:e.source,path:[...t,`source`],previousTick:!1}),Q(e.factor,[...t,`factor`],r),Q(e.offset,[...t,`offset`],r);return;case`sine`:case`noise`:case`waveform`:case`chirp`:Q(e.center,[...t,`center`],r);return;case`mean-reverting-noise`:Q(e.mean,[...t,`mean`],r);return;case`first-order-lag`:case`second-order`:Q(e.gain,[...t,`gain`],r),Q(e.bias,[...t,`bias`],r),$i(e.input,[...t,`input`],n,r);return;case`transport-delay`:Q(e.delay,[...t,`delay`],r),$i(e.input,[...t,`input`],n,r);return;case`slew-rate-limiter`:case`integrator`:$i(e.input,[...t,`input`],n,r);return;case`hysteresis-relay`:Q(e.on_threshold,[...t,`on_threshold`],r),Q(e.off_threshold,[...t,`off_threshold`],r),$i(e.input,[...t,`input`],n,r);return;case`weighted-sum`:Q(e.bias,[...t,`bias`],r),Wi(e,t,(e,t)=>{Q(e.weight,[...t,`weight`],r),$i(e.input,[...t,`input`],n,r)});return;case`gate`:n.push({member:String(e.enabled_member),path:[...t,`enabled_member`],previousTick:!1}),$i(e.input,[...t,`input`],n,r);return;case`health-dependent`:{let i=e.stages;if(!Z(i))return;for(let[e,a]of Object.entries(i))Qi(a,[...t,`stages`,e],n,r);return}default:return}}function $i(e,t,n,r){qi(e,t,(e,t)=>n.push({member:e,path:t,previousTick:!1}),(e,t)=>n.push({member:e,path:t,previousTick:!0}),(e,t)=>r.push({param:e,path:t}),(e,t)=>Qi(e,t,n,r))}function Q(e,t,n){let r=Ui(e);r!==void 0&&n.push({param:r,path:t})}function ea(e,t,n){if(!Z(e))return;let r=e.type;(r===`threshold`||r===`availability-state`)&&typeof e.member==`string`&&n.push({member:e.member,path:[...t,`member`],previousTick:!1})}function ta(e,t,n){if(!Z(e))return;let r=e.type;if(typeof r!=`string`)return;if(r===`integrator`&&e.wrap===!0&&(typeof e.wrap_at!=`number`||!Number.isFinite(e.wrap_at)||e.wrap_at<=0)&&n.addIssue({code:y.custom,path:[...t,`wrap_at`],message:`wrap_at must be a finite number greater than 0 when wrap is true. Fix: Set wrap_at to a positive number, or set wrap to false.`}),r===`health-dependent`){let r=e.stages;if(Z(r))for(let[e,i]of Object.entries(r))ta(i,[...t,`stages`,e],n)}function i(e,t){!Z(e)||!(`generator`in e)||ta(e.generator,[...t,`generator`],n)}i(e.input,[...t,`input`]),Wi(e,t,(e,t)=>{i(e.input,[...t,`input`])})}function na(e){switch(e){case`Boolean`:return!1;case`String`:return``;case`Double`:case`Float`:case`Int32`:case`UInt16`:case`UInt32`:return 0;default:return 0}}var ra=z(H(`type`,[B({type:W(`white_noise`),strength:I().min(0).max(1),scale:I().positive().optional()}).strict(),B({type:W(`drift`),tau:I().positive(),sigma:I().min(0).max(1),scale:I().positive().optional()}).strict(),B({type:W(`outlier`),probability:I().min(0).max(1),magnitude:I().positive(),scale:I().positive().optional()}).strict(),B({type:W(`gap`),probability:I().min(0).max(1),duration:I().int().positive().default(10)}).strict(),B({type:W(`noise_burst`),probability:I().min(0).max(1),duration:I().int().positive().default(5),strength:I().min(0).max(1),scale:I().positive().optional()}).strict()])).min(1).optional(),ia=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,aa=F().regex(vr,`Must be a $param.X parameter reference`),oa=V([I(),F(),L()]),sa=B({name:F().regex(q,ia),description:F().optional(),namespace:F().optional()}),ca=H(`kind`,[B({kind:W(`variable`),data_type:Lr,access:Rr,unit:Ur.optional(),enum_values:Fi.optional(),eu_range:Fn([I(),I()]).refine(([e,t])=>e<=t,{message:`eu_range[0] (min) must be <= eu_range[1] (max).`}).optional(),generator:Pi.optional(),binding:Vr.optional(),default:oa.optional(),observation_effects:ra}).strict(),B({kind:W(`property`),data_type:Lr,access:Rr,unit:Ur.optional(),enum_values:Fi.optional(),default:V([oa,aa]).optional()}).strict()]),la=U(F().regex(q,ia),ca).refine(e=>Object.keys(e).length>=1,{message:`Members map must have at least 1 member.`}).refine(e=>Object.keys(e).length<=256,{message:`Members map must have at most 256 members.`}),ua=B({schema_version:W(`2`),model:sa,parameters:U(F(),Gr).optional(),members:la,methods:Hi.optional(),lifecycle:Si.optional(),faults:z(Ti).optional()}).superRefine((e,t)=>{let n=Object.keys(e.members),r=new Map;for(let e=0;e<n.length;e++){let t=n[e];t!==void 0&&r.set(t,e)}let i=new Set(Object.keys(e.parameters??{})),a=new Set(Object.entries(e.parameters??{}).filter(([,e])=>e.type===`float`||e.type===`int`).map(([e])=>e));for(let o=0;o<n.length;o++){let s=n[o];if(s===void 0)continue;let c=e.members[s];if(!c||(Zi(c,t,[`members`,s]),c.kind===`variable`&&c.generator!==void 0&&c.binding!==void 0&&t.addIssue({code:y.custom,path:[`members`,s,`binding`],message:`Variable members cannot define both "generator" and "binding". Fix: keep one source of value generation.`}),c.kind===`variable`&&c.binding!==void 0&&c.access!==`read`&&t.addIssue({code:y.custom,path:[`members`,s,`access`],message:`Variable members with a "binding" must use access "read". Fix: change access to "read" or remove the binding.`}),c.kind!==`variable`||!c.generator&&!c.binding))continue;let l=[],u=[],d=[`members`,s,`generator`];if(c.generator&&Qi(c.generator,d,l,u),c.binding&&ea(c.binding,[`members`,s,`binding`],l),c.generator&&(ta(c.generator,d,t),c.generator.type===`gate`)){let n=e.members[c.generator.enabled_member];n&&n.data_type!==`Boolean`&&t.addIssue({code:y.custom,path:[`members`,s,`generator`,`enabled_member`],message:`Gate generator for "${s}" references "${c.generator.enabled_member}", but "${c.generator.enabled_member}" is not Boolean. Fix: use a Boolean command/state member for enabled_member.`}),Xi(c.generator.disabled_value,c.data_type)||t.addIssue({code:y.custom,path:[`members`,s,`generator`,`disabled_value`],message:`Gate generator disabled_value for "${s}" does not match data_type "${c.data_type}". Fix: use a compatible disabled_value literal.`})}for(let e of l){let n=r.get(e.member);if(n===void 0){t.addIssue({code:y.custom,path:[...e.path],message:`Member "${s}" references member "${e.member}", but "${e.member}" is not defined. Fix: Define "${e.member}" in members, or change the reference to a parameter.`});continue}!e.previousTick&&n>=o&&t.addIssue({code:y.custom,path:[...e.path],message:`Member "${s}" references member "${e.member}" which is defined later (or is itself). Members are evaluated in declaration order. Fix: Move "${e.member}" above "${s}".`})}for(let n of u)i.has(n.param)?a.has(n.param)||t.addIssue({code:y.custom,path:[...n.path],message:`Member "${s}" references parameter "${n.param}" in a numeric position, but "${n.param}" has type "${e.parameters?.[n.param]?.type}". Only float and int parameters can be used as generator coefficients or inputs. Fix: Change "${n.param}" to type "float" or "int".`}):t.addIssue({code:y.custom,path:[...n.path],message:`Member "${s}" references parameter "${n.param}", but "${n.param}" is not defined. Fix: Define "${n.param}" under parameters, or replace "$param.${n.param}" with a literal value.`});if(c.binding)switch(c.binding.type){case`threshold`:c.data_type!==`Boolean`&&t.addIssue({code:y.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "threshold" must use data_type "Boolean". Fix: change data_type to "Boolean".`}),da(s,c.binding.member,e,t,[`members`,s,`binding`,`member`]);break;case`availability-state`:c.data_type!==`String`&&t.addIssue({code:y.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "availability-state" must use data_type "String". Fix: change data_type to "String".`}),da(s,c.binding.member,e,t,[`members`,s,`binding`,`member`]);break;case`lifecycle-stage`:case`health-state`:case`active-fault-code`:c.data_type!==`String`&&t.addIssue({code:y.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "${c.binding.type}" must use data_type "String". Fix: change data_type to "String".`});break;case`fault-active`:c.data_type!==`Boolean`&&t.addIssue({code:y.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "fault-active" must use data_type "Boolean". Fix: change data_type to "Boolean".`});break;case`fault-count`:c.data_type!==`Int32`&&c.data_type!==`UInt16`&&c.data_type!==`UInt32`&&t.addIssue({code:y.custom,path:[`members`,s,`data_type`],message:`Members using binding.type "fault-count" must use an integer data_type (Int32, UInt16, or UInt32). Fix: change data_type to an integer type.`});break;default:c.binding}if(c.kind===`variable`&&c.observation_effects){Ji(c.data_type)||t.addIssue({code:y.custom,path:[`members`,s,`observation_effects`],message:`Observation effects on "${s}" require a numeric data_type (Double, Float, Int32, UInt16, or UInt32). Member has data_type "${c.data_type}", which cannot be degraded by noise, gaps, or drift. Fix: remove observation_effects, or change data_type to a numeric type.`}),c.access!==`read`&&t.addIssue({code:y.custom,path:[`members`,s,`observation_effects`],message:`Observation effects on "${s}" require access "read". Observation effects corrupt values — they must not be applied to command targets or setpoints. Fix: change access to "read" or remove observation_effects.`});for(let e=0;e<c.observation_effects.length;e++){let n=c.observation_effects[e];n&&(n.type===`white_noise`||n.type===`drift`||n.type===`outlier`||n.type===`noise_burst`)&&!(`scale`in n&&n.scale!==void 0)&&!c.eu_range&&t.addIssue({code:y.custom,path:[`members`,s,`observation_effects`,e],message:`Member "${s}" uses relative observation effect "${n.type}" but has no eu_range and no explicit scale. Fix: add eu_range: [min, max] to the member, or add scale: <number> to the effect.`})}}}function o(n,i,a){if(!r.has(n)){t.addIssue({code:y.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is not a defined member. Fix: Change "${n}" to a valid member name.`});return}let o=e.members[n];o&&o.kind!==`variable`&&t.addIssue({code:y.custom,path:[...i],message:`${a} has effect on "${n}", but "${n}" is a property (kind: "property"). Effects can only target variable members.`})}if(e.lifecycle){let t=[`lifecycle`,`stages`];for(let n of e.lifecycle.stages)for(let e of Object.keys(n.effects))o(e,t,`Lifecycle stage "${n.name}"`)}if(e.faults)for(let t=0;t<e.faults.length;t++){let n=e.faults[t];if(!n)continue;let r=[`faults`,t,`effects`];for(let e of Object.keys(n.effects))o(e,r,`Fault "${n.name}"`)}for(let r of n){let n=e.members[r];if(!n||n.kind!==`property`||typeof n.default!=`string`)continue;let a=Ui(n.default);a!==void 0&&!i.has(a)&&t.addIssue({code:y.custom,path:[`members`,r,`default`],message:`Property "${r}" default references parameter "${a}", but "${a}" is not defined. Fix: Define "${a}" under parameters, or use a literal value.`})}if(e.methods)for(let[n,r]of Object.entries(e.methods))fa(n,r.input_arguments,t,[`methods`,n,`input_arguments`]),fa(n,r.output_arguments,t,[`methods`,n,`output_arguments`]),pa(n,r,e,t,[`methods`,n,`runtime`])});function da(e,t,n,r,i){let a=n.members[t];a&&(Ji(a.data_type)||r.addIssue({code:y.custom,path:[...i],message:`Member "${e}" binding references "${t}", but "${t}" is not numeric. Fix: bind to a numeric member or change the source member data_type.`}))}function fa(e,t,n,r){if(t)for(let[i,a]of Object.entries(t))a.unit!==void 0&&(a.data_type===`Boolean`||a.data_type===`String`)&&n.addIssue({code:y.custom,path:[...r,i,`unit`],message:`Method "${e}" argument "${i}" uses data_type "${a.data_type}" and must not declare an engineering unit. Fix: remove the unit or use a numeric data_type.`}),a.enum_values&&a.data_type!==`String`&&n.addIssue({code:y.custom,path:[...r,i,`enum_values`],message:`Method "${e}" argument "${i}" can only use enum_values with data_type "String". Fix: remove enum_values or change the data_type.`})}function pa(e,t,n,r,i){let a=t.runtime;if(a)switch(a.type){case`clear-faults`:return;case`set-parameters`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.parameters?.[s.parameter];if(!l){r.addIssue({code:y.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}", but "${s.parameter}" is not defined. Fix: target a declared parameter.`});continue}if(l.type!==`float`&&l.type!==`int`){r.addIssue({code:y.custom,path:[...c,`parameter`],message:`Method "${e}" runtime targets parameter "${s.parameter}" of type "${l.type}". Fix: use set-parameters only with float or int parameters.`});continue}if(`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}Ji(n.data_type)||r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" must be numeric to write parameter "${s.parameter}". Fix: use Double, Float, Int32, UInt16, or UInt32.`}),l.type===`int`&&!Yi(n.data_type)&&r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" but parameter "${s.parameter}" is type "int". Fix: use Int32, UInt16, or UInt32 so runtime writes stay integer-safe.`});continue}l.type===`int`&&!Number.isSafeInteger(s.value)&&r.addIssue({code:y.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for integer parameter "${s.parameter}" must be a safe integer. Fix: use a whole-number literal.`})}return;case`set-members`:for(let o=0;o<a.writes.length;o++){let s=a.writes[o];if(!s)continue;let c=[...i,`writes`,o],l=n.members[s.member];if(!l){r.addIssue({code:y.custom,path:[...c,`member`],message:`Method "${e}" runtime targets member "${s.member}", but "${s.member}" is not defined. Fix: target a declared member.`});continue}if(l.kind!==`variable`&&r.addIssue({code:y.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is a property. Fix: target a writable variable member.`}),l.access!==`readwrite`&&l.access!==`write`&&r.addIssue({code:y.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but "${s.member}" is not writable. Fix: set access to "readwrite" or "write".`}),l.kind===`variable`&&l.binding&&r.addIssue({code:y.custom,path:[...c,`member`],message:`Method "${e}" runtime targets "${s.member}", but bound members are computed at runtime. Fix: write to a command/setpoint member without a binding.`}),`argument`in s){let n=t.input_arguments?.[s.argument];if(!n){r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime references input argument "${s.argument}", but that argument is not defined. Fix: declare the input argument or use a literal value.`});continue}if(Xi(na(n.data_type),l.data_type)||r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" uses data_type "${n.data_type}" which does not match target member "${s.member}" data_type "${l.data_type}". Fix: align the argument and target member data types.`}),n.enum_values&&l.enum_values){let t=n.enum_values.filter(e=>!l.enum_values?.includes(e));t.length>0&&r.addIssue({code:y.custom,path:[...c,`argument`],message:`Method "${e}" runtime argument "${s.argument}" allows values [${t.join(`, `)}] that are not valid for target member "${s.member}". Fix: align enum_values between the argument and target member.`})}continue}Xi(s.value,l.data_type)||r.addIssue({code:y.custom,path:[...c,`value`],message:`Method "${e}" runtime literal for "${s.member}" does not match data_type "${l.data_type}". Fix: use a compatible literal value.`}),l.enum_values&&typeof s.value==`string`&&!l.enum_values.includes(s.value)&&r.addIssue({code:y.custom,path:[...c,`value`],message:`Method "${e}" runtime literal "${s.value}" is not allowed for member "${s.member}". Fix: use one of [${l.enum_values.join(`, `)}].`})}return;default:}}var ma=`Must be 1-64 chars and contain only letters, numbers, underscores, or hyphens.`,ha=G([`mqtt`,`opcua`,`modbus`]),ga=z(ha).min(1),_a=B({model:F().min(1),count:I().int().positive().max(_r).default(1),variation:I().min(0).max(1).default(0),parameters:U(F(),I().finite()).optional(),starting_hours:I().finite().nonnegative().optional(),protocol_scope:ga.optional()}),va=B({name:F().regex(q,ma),twins:z(_a).min(1),protocol_scope:ga.optional()}),ya=B({name:F().regex(q,ma),lines:z(va).min(1),protocol_scope:ga.optional()}),ba=V([B({enterprise:F().regex(q,ma),site:F().regex(q,ma)}),B({prefix:F().regex(q,ma)})]),xa=B({maxAttempts:I().finite().int().min(0).default(0),initialDelayMs:I().finite().int().positive().default(1e3),maxDelayMs:I().finite().int().positive().default(3e4)}),Sa=B({enabled:L().default(!1),deadband:I().finite().nonnegative().default(0)}),Ca=G([`base`,`full`]),wa=B({embedded:L().default(!0),port:I().int().min(0).max(65535).default(1883),external:F().optional(),retain:L().default(!1),username:F().optional(),password:F().optional(),reconnect:xa.optional(),rbe:Sa.optional(),metadata:Ca.default(`base`),drain_budget:I().int().min(512).max(65536).optional(),batch_size:I().int().min(64).max(16384).optional(),broker_concurrency:I().int().min(10).max(5e3).optional()}).refine(e=>!(e.embedded&&e.external),{message:`Cannot use both 'embedded: true' and 'external' URL. Set 'embedded: false' when using an external broker.`}).refine(e=>!e.password||e.username,{message:`Cannot set 'password' without 'username'.`}),Ta=B({port:I().int().min(0).max(65535).default(gr),host:F().default(`0.0.0.0`),security:G([`none`]).default(`none`),buildInfo:B({productName:F().default(`Miravo`)}).optional(),write_budget:I().int().min(512).max(65536).optional()}),Ea=B({port:I().int().min(0).max(65535).default(502),host:F().default(`0.0.0.0`)}),Da=B({mqtt:wa.optional(),opcua:Ta.optional(),modbus:Ea.optional()}),Oa=G([`real-time`,`accelerated`]),ka=B({tick_interval_ms:I().int().positive().default(1e3),time_mode:Oa.default(`real-time`),time_multiplier:I().positive().default(1),seed:I().int().optional(),overrun_threshold_multiplier:I().min(1).max(10).optional()});B({kind:W(`MiravoTemplate`),version:W(`1`),name:F().min(1),description:F().optional(),models:z(ua).optional(),namespace:ba.optional(),areas:z(ya).min(1),protocols:Da.optional(),settings:ka.optional()});var Aa=B({name:F().min(1),description:F().nullable(),memberCount:I().int().nonnegative(),methodCount:I().int().nonnegative(),faultCount:I().int().nonnegative(),hasLifecycle:L(),lifecycleStageCount:I().int().nonnegative(),source:F().min(1)}),ja=B({model:F().min(1),count:I().int().nonnegative(),variation:I().finite().nonnegative(),parameters:U(F().min(1),I().finite()).optional(),protocol_scope:z(ha).optional()}),Ma=B({name:F().min(1),twins:z(ja),protocol_scope:z(ha).optional()}),Na=B({name:F().min(1),lines:z(Ma),protocol_scope:z(ha).optional()}),Pa=B({id:F().min(1),name:F().min(1),description:F().nullable(),category:F().min(1),models:z(F().min(1)),instanceCount:I().int().nonnegative(),memberCount:I().int().nonnegative(),source:F().min(1)}),Fa=Pa,Ia=Pa.extend({topology:z(Na),namespace:B({enterprise:F().min(1).optional(),site:F().min(1).optional(),prefix:F().min(1).optional()}).optional(),settings:B({tickIntervalMs:I().int().positive().optional(),timeMultiplier:I().finite().positive().optional()}).optional()}),La=G([`idle`,`running`,`paused`,`stopped`]),Ra=B({events:z(H(`type`,[B({id:I().int().nonnegative(),type:W(`fault:triggered`),instanceId:F().min(1),fault:F().min(1),effects:U(F(),R()),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`fault:cleared`),instanceId:F().min(1),fault:F().min(1),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`lifecycle:changed`),instanceId:F().min(1),from:F().min(1),to:F().min(1),operatingHours:I().finite().nonnegative(),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`instance:created`),instanceId:F().min(1),assetType:F().min(1),browsePath:z(F().min(1)),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`instance:removed`),instanceId:F().min(1),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`engine:state-changed`),from:La,to:La,tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`platform:resource`),operationId:F().min(1),operationType:G([`apply`,`cleanup`]),templateId:F().min(1),targetLabel:F().min(1),hostname:F().min(1),phase:F().min(1),resourceType:F().min(1),resourceName:F().min(1),action:F().min(1),status:G([`success`,`failed`]),error:F().optional(),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()}),B({id:I().int().nonnegative(),type:W(`platform:operation`),operationId:F().min(1),operationType:G([`apply`,`cleanup`]),templateId:F().min(1),targetLabel:F().min(1),hostname:F().min(1),applied:I().int().nonnegative(),failed:I().int().nonnegative(),duration:I().int().nonnegative(),tick:I().int().nonnegative(),simulationTime:I().finite().nonnegative(),timestamp:I().finite().nonnegative()})])),nextCursor:I().int().nonnegative().nullable(),hasMore:L()}),za=V([I().finite(),F(),L()]),Ba=Fn([I().finite(),I().finite()]),Va=B({name:F().min(1),dataType:F().min(1),description:F().nullable()}),Ha=B({description:F().nullable(),inputArguments:z(Va),outputArguments:z(Va)}),Ua=B({id:F().min(1),assetType:F().min(1),browsePath:z(F().min(1)),lifecycleStage:F().min(1),operatingHours:I().finite().nonnegative(),activeFaults:z(F().min(1)),isQuarantined:L(),parameters:U(F().min(1),B({value:za,type:F().min(1),unit:F().optional()})),members:U(F().min(1),B({value:za,quality:G([`good`,`bad`,`uncertain`]),timestamp:I().finite(),meta:B({kind:F().min(1),dataType:F().min(1),access:F().min(1),unit:F().nullable(),euRange:Ba.nullable()})})),methods:U(F().min(1),Ha)}),Wa=B({enabled:L(),port:I().int().positive().optional()}),Ga=B({instance:F().min(1),browsePath:F(),member:F().min(1),model:F().min(1),dataType:F().min(1),unit:F().optional(),euRange:Fn([I().finite(),I().finite()]).optional(),access:F().min(1),kind:G([`variable`,`property`]),protocols:U(F(),U(F(),R()))}),Ka=B({template:F().min(1).optional(),generatedAt:F().datetime(),protocols:U(F(),Wa),tags:z(Ga),summary:B({totalTags:I().int().nonnegative(),totalInstances:I().int().nonnegative(),enabledProtocols:z(F().min(1))})}),qa=B({name:F().min(1),description:F().nullable(),parameters:U(F().min(1),B({type:F().min(1),default:za,unit:F().optional()})),members:U(F().min(1),B({kind:F().min(1),dataType:F().min(1),access:F().min(1),unit:F().nullable(),euRange:Ba.nullable(),default:za.nullable()})),methods:U(F().min(1),Ha),faults:z(F().min(1)),lifecycle:B({stages:z(F().min(1)),totalHours:I().finite().nonnegative()}).nullable()}),Ja=G([`devices`,`models`,`instances`]),Ya=G([`create`,`update`,`replace`,`delete`,`blocked`]),Xa=G([`device`,`model`,`instance`,`param-sync`]),Za=G([`apply`,`cleanup`]),Qa=G([`success`,`partial`,`blocked`,`noop`,`failed`]);G([`device`,`model`,`instance`,`param-sync`]),G([`create`,`update`,`replace`,`delete`]);var $a=B({area:F().min(1).optional(),line:F().min(1).optional(),instance:F().min(1).optional()}),eo=B({action:Ya,resourceType:Xa,name:F().min(1),resourceId:F().min(1).optional(),protocol:ha.optional(),endpoint:F().min(1).optional(),detail:F().min(1).optional(),blockReason:F().min(1).optional()}),to=B({sourceMode:G([`static`,`managed`]),targetHost:F().min(1),sourceHostname:F().min(1).optional(),scope:z(Ja),filters:$a,entries:z(eo)}),no=B({plan:to}),ro=B({targetId:F().min(1),template:F().min(1).optional(),model:F().min(1).optional(),protocol:ha.optional(),scope:z(Ja).optional(),area:F().min(1).optional(),line:F().min(1).optional(),instance:F().min(1).optional(),ifUnmanaged:G([`fail`,`skip`]).optional(),deviceName:F().min(1).optional()}),io=B({plan:to,applied:I().int().nonnegative(),failed:I().int().nonnegative(),error:F().min(1).optional()}),ao=B({targetId:F().min(1),template:F().min(1).optional(),allManaged:L().optional(),scope:z(Ja).optional(),area:F().min(1).optional(),line:F().min(1).optional(),instance:F().min(1).optional()}),oo=B({plan:to,deleted:I().int().nonnegative(),failed:I().int().nonnegative(),error:F().min(1).optional()}),so=B({create:I().int().nonnegative(),update:I().int().nonnegative(),replace:I().int().nonnegative(),delete:I().int().nonnegative(),failed:I().int().nonnegative(),total:I().int().nonnegative()}),co=B({device:so,model:so,instance:so,"param-sync":so}),lo=B({operations:z(B({schemaVersion:W(1),operationId:F().min(1),operationType:Za,status:Qa,templateId:F().min(1),targetId:F().min(1),targetLabel:F().min(1),hostname:F().min(1),scope:z(F().min(1)),filters:$a,successCount:I().int().nonnegative(),failedCount:I().int().nonnegative(),blockedCount:I().int().nonnegative(),startedAt:I().int().nonnegative(),completedAt:I().int().nonnegative(),durationMs:I().int().nonnegative(),resourceCounts:co,error:F().min(1).optional()})),total:I().int().nonnegative(),hasMore:L()}),uo=B({type:Za.optional(),targetId:F().min(1).optional(),limit:Xn.number().int().positive().max(500).optional(),offset:Xn.number().int().nonnegative().optional()}),fo=B({cancelled:W(!0)}),po=B({operationId:F().min(1),type:Za,template:F().min(1).optional(),model:F().min(1).optional(),environment:F().min(1),totalPlanned:I().int().nonnegative(),attempt:I().int().positive().optional(),maxAttempts:I().int().positive().optional()}),mo=B({operationId:F().min(1),phase:Xa,total:I().int().nonnegative()}),ho=B({operationId:F().min(1),phase:Xa,name:F().min(1),action:Ya,status:G([`success`,`failed`]),error:F().min(1).optional(),index:I().int().positive(),of:I().int().positive()}),go=B({operationId:F().min(1),applied:I().int().nonnegative().optional(),deleted:I().int().nonnegative().optional(),failed:I().int().nonnegative(),duration:I().int().nonnegative(),plan:to}),_o=go,vo=go,yo=B({operationId:F().min(1),attempt:I().int().positive(),maxAttempts:I().int().positive(),delayMs:I().int().nonnegative(),error:F().min(1)}),bo=B({message:F().min(1)}),xo=H(`event`,[B({event:W(`started`),data:po}),B({event:W(`phase`),data:mo}),B({event:W(`resource`),data:ho}),B({event:W(`complete`),data:_o}),B({event:W(`cancelled`),data:vo}),B({event:W(`retrying`),data:yo}),B({event:W(`error`),data:bo})]),So=`litmus-edge`,Co=B({id:F().min(1),platformId:F().min(1),label:F().min(1),hostname:F().min(1),apiToken:F().min(1),sourceHostname:F().min(1),lastUsedAt:I().int().nonnegative().optional()}),wo=B({targets:z(Co)}),To=B({platformId:F().min(1).default(So),label:F().min(1),hostname:F().min(1),apiToken:F().min(1),sourceHostname:F().min(1)}),Eo=B({platformId:F().min(1).optional(),label:F().min(1).optional(),hostname:F().min(1).optional(),apiToken:F().min(1).optional(),sourceHostname:F().min(1).optional()}),Do=B({targetId:F().min(1).optional(),hostname:F().min(1),apiToken:F().min(1).optional(),sourceHostname:F().min(1)}).superRefine((e,t)=>{!e.targetId&&!e.apiToken&&t.addIssue({code:y.custom,message:`apiToken is required when targetId is omitted.`,path:[`apiToken`]})}),Oo=H(`connected`,[B({connected:W(!0),hostname:F().min(1),sourceHostname:F().min(1)}),B({connected:W(!1),error:F().min(1)})]),ko=B({status:G([`ok`,`fail`]),environmentState:K.shape.core.shape.state,tickCount:I().int().nonnegative(),mqttEnabled:L(),mqttConnected:L().nullable(),opcuaEnabled:L(),opcuaConnected:L().nullable(),modbusEnabled:L(),modbusConnected:L().nullable(),stalled:L(),reason:F().optional(),environmentName:F().min(1).optional(),runId:F().min(1).optional()}),Ao=B({reason:F().min(1).optional()}),jo=B({status:W(`shutting_down`)}),Mo=B({id:F().min(1)}),No=B({name:F().min(1)}),Po=B({id:F().min(1)}),Fo=B({operationId:F().min(1)}),Io=B({id:F().min(1)}),Lo=B({type:G([`fault:triggered`,`fault:cleared`,`lifecycle:changed`,`instance:created`,`instance:removed`,`engine:state-changed`,`platform:resource`,`platform:operation`]).optional(),instanceId:F().min(1).optional(),limit:Xn.number().int().positive().max(1e3).optional(),cursor:Xn.number().int().nonnegative().optional()}),Ro=B({host:F().min(1),protocol:ha.optional()}),zo=U(F(),R()),Bo=[{method:`GET`,path:`/openapi.json`,operationId:`openApiDocument`,auth:`none`,response:{kind:`json`,schema:U(F(),R())},description:`Generated OpenAPI document for the Miravo admin API.`},{method:`GET`,path:`/healthz`,operationId:`health`,auth:`none`,response:{kind:`json`,schema:ko},description:`Liveness probe for the Miravo admin server.`},{method:`GET`,path:`/readyz`,operationId:`readiness`,auth:`none`,response:{kind:`json`,schema:ko},description:`Readiness probe for the Miravo admin server.`},{method:`GET`,path:`/metrics`,operationId:`metrics`,auth:`required`,response:{kind:`json`,schema:K},description:`Engine metrics snapshot.`},{method:`GET`,path:`/state`,operationId:`state`,auth:`required`,response:{kind:`json`,schema:sr},description:`Engine state snapshot.`},{method:`GET`,path:`/bootstrap`,operationId:`bootstrap`,auth:`none`,response:{kind:`json`,schema:ur},description:`Console bootstrap payload.`},{method:`POST`,path:`/commands`,operationId:`commands`,auth:`required`,body:Fr,response:{kind:`json`,schema:Ir},description:`Execute an engine command.`},{method:`POST`,path:`/shutdown`,operationId:`shutdown`,auth:`required`,body:Ao,response:{kind:`json`,schema:jo},description:`Request graceful shutdown.`},{method:`GET`,path:`/instances/:id`,operationId:`instanceDetail`,auth:`required`,params:Mo,response:{kind:`json`,schema:Ua},description:`Inspect a running instance.`},{method:`GET`,path:`/models/:name`,operationId:`modelDetail`,auth:`required`,params:No,response:{kind:`json`,schema:qa},description:`Inspect a registered model schema.`},{method:`GET`,path:`/events`,operationId:`events`,auth:`required`,query:Lo,response:{kind:`json`,schema:Ra},description:`Read paginated event log entries.`},{method:`GET`,path:`/catalog/models`,operationId:`catalogModels`,auth:`required`,response:{kind:`json`,schema:z(Aa)},description:`List catalog models.`},{method:`GET`,path:`/catalog/models/:name/le-dt.json`,operationId:`catalogModelLeDt`,auth:`required`,params:No,response:{kind:`json`,schema:zo},description:`Download LE Digital Twin JSON for a catalog model.`},{method:`GET`,path:`/catalog/models/:name/yaml`,operationId:`catalogModelYaml`,auth:`required`,params:No,response:{kind:`yaml`},description:`Read raw YAML for a catalog model.`},{method:`GET`,path:`/catalog/models/:name`,operationId:`catalogModelDetail`,auth:`required`,params:No,response:{kind:`json`,schema:qa},description:`Read catalog model schema.`},{method:`GET`,path:`/catalog/templates/:id/le-template.json`,operationId:`catalogTemplateLeTemplateJson`,auth:`required`,params:Po,query:Ro,response:{kind:`passthrough`},description:`Download LE template JSON export.`},{method:`GET`,path:`/catalog/templates/:id/le-tags.csv`,operationId:`catalogTemplateLeTagsCsv`,auth:`required`,params:Po,query:Ro,response:{kind:`passthrough`},description:`Download LE tags CSV export.`},{method:`GET`,path:`/catalog/templates/:id/yaml`,operationId:`catalogTemplateYaml`,auth:`required`,params:Po,response:{kind:`yaml`},description:`Read raw YAML for a catalog template.`},{method:`GET`,path:`/catalog/templates/:id`,operationId:`catalogTemplateDetail`,auth:`required`,params:Po,response:{kind:`json`,schema:Ia},description:`Read catalog template detail.`},{method:`GET`,path:`/catalog/templates`,operationId:`catalogTemplates`,auth:`required`,response:{kind:`json`,schema:z(Fa)},description:`List catalog templates.`},{method:`GET`,path:`/running-templates`,operationId:`runningTemplates`,auth:`required`,response:{kind:`json`,schema:z(cr)},description:`List running template runs.`},{method:`GET`,path:`/manifest`,operationId:`manifest`,auth:`required`,response:{kind:`json`,schema:Ka},description:`Read unified protocol manifest.`},{method:`POST`,path:`/auth/login`,operationId:`authLogin`,auth:`none`,body:$n,response:{kind:`json`,schema:er},description:`Authenticate and create an admin session.`},{method:`POST`,path:`/auth/logout`,operationId:`authLogout`,auth:`none`,response:{kind:`json`,schema:nr},description:`Destroy the current admin session.`},{method:`PUT`,path:`/auth/password`,operationId:`authPassword`,auth:`required`,body:tr,response:{kind:`json`,schema:nr},description:`Change the admin password.`},{method:`GET`,path:`/auth/status`,operationId:`authStatus`,auth:`none`,response:{kind:`json`,schema:rr},description:`Check the current session status.`},{method:`GET`,path:`/ws`,operationId:`runtimeWebSocket`,auth:`required`,response:{kind:`passthrough`},description:`Upgrade to the runtime WebSocket stream.`},{method:`GET`,path:`/platforms/le/operations`,operationId:`platformOperations`,auth:`required`,query:uo,response:{kind:`json`,schema:lo},description:`List persisted platform operation summaries.`},{method:`GET`,path:`/platforms/le/targets`,operationId:`platformTargets`,auth:`required`,response:{kind:`json`,schema:wo},description:`List saved LE targets.`},{method:`POST`,path:`/platforms/le/targets`,operationId:`platformTargetCreate`,auth:`required`,body:To,response:{kind:`json`,schema:Co},description:`Create an LE target.`},{method:`POST`,path:`/platforms/le/targets/test`,operationId:`platformConnectionTest`,auth:`required`,body:Do,response:{kind:`json`,schema:Oo},description:`Test LE target connectivity.`},{method:`GET`,path:`/platforms/le/targets/:id`,operationId:`platformTargetDetail`,auth:`required`,params:Io,response:{kind:`json`,schema:Co},description:`Read one LE target.`},{method:`PUT`,path:`/platforms/le/targets/:id`,operationId:`platformTargetById`,auth:`required`,params:Io,body:Eo,response:{kind:`json`,schema:Co},description:`Update one LE target.`},{method:`DELETE`,path:`/platforms/le/targets/:id`,operationId:`platformTargetDelete`,auth:`required`,params:Io,response:{kind:`json`,schema:B({message:F().min(1)})},description:`Delete one LE target.`},{method:`POST`,path:`/platforms/le/plan`,operationId:`platformPlan`,auth:`required`,body:ro,response:{kind:`json`,schema:no},description:`Preview an LE apply plan.`},{method:`POST`,path:`/platforms/le/apply`,operationId:`platformApply`,auth:`required`,body:ro,response:{kind:`json`,schema:io},additionalSuccessResponses:{207:io},description:`Apply a platform plan.`},{method:`POST`,path:`/platforms/le/cleanup/plan`,operationId:`platformCleanupPlan`,auth:`required`,body:ao,response:{kind:`json`,schema:no},description:`Preview an LE cleanup plan.`},{method:`POST`,path:`/platforms/le/cleanup`,operationId:`platformCleanup`,auth:`required`,body:ao,response:{kind:`json`,schema:oo},additionalSuccessResponses:{207:oo},description:`Execute LE cleanup.`},{method:`POST`,path:`/platforms/le/operations/:operationId/cancel`,operationId:`platformOperationCancel`,auth:`required`,params:Fo,response:{kind:`json`,schema:fo},description:`Cancel an in-flight streaming LE operation.`},{method:`POST`,path:`/platforms/le/apply/stream`,operationId:`platformApplyStream`,auth:`required`,body:ro,response:{kind:`passthrough`},description:`Stream LE apply progress over SSE.`},{method:`POST`,path:`/platforms/le/cleanup/stream`,operationId:`platformCleanupStream`,auth:`required`,body:ao,response:{kind:`passthrough`},description:`Stream LE cleanup progress over SSE.`}],Vo=B({code:G([`UNAUTHORIZED`,`NOT_FOUND`,`INVALID_REQUEST`,`INTERNAL_ERROR`]),message:F(),hint:F().optional()}),Ho={UNAUTHORIZED:401,NOT_FOUND:404,INVALID_REQUEST:400,INTERNAL_ERROR:500},Uo=class extends Error{code;status;hint;constructor(e){super(e.message),this.name=`ApiError`,this.code=e.code,this.status=e.status??Ho[e.code],this.hint=e.hint}static is(e){return e instanceof Error&&e.name===`ApiError`}};function Wo(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 Go(e,t){return e?._def?.typeName===t}function Ko(e,t){let n=e.ZodType.prototype[t];e.ZodType.prototype[t]=function(...e){let t=n.apply(this,e);return t._def.openapi=this._def.openapi,t}}function qo(e){if(e.ZodType.prototype.openapi!==void 0)return;e.ZodType.prototype.openapi=function(e,t){let n=(typeof e==`string`?t:e)??{},{param:r}=n,i=Wo(n,[`param`]),a=Object.assign(Object.assign({},this._def.openapi?._internal),typeof e==`string`?{refId:e}:void 0),o=Object.assign(Object.assign(Object.assign({},this._def.openapi?.metadata),i),this._def.openapi?.metadata?.param||r?{param:Object.assign(Object.assign({},this._def.openapi?.metadata?.param),r)}:void 0),s=new this.constructor(Object.assign(Object.assign({},this._def),{openapi:Object.assign(Object.assign({},Object.keys(a).length>0?{_internal:a}:void 0),Object.keys(o).length>0?{metadata:o}:void 0)}));if(Go(this,`ZodObject`)){let e=this.extend;s.extend=function(...t){let n=e.apply(this,t);return n._def.openapi={_internal:{extendedFrom:this._def.openapi?._internal?.refId?{refId:this._def.openapi?._internal?.refId,schema:this}:this._def.openapi?._internal?.extendedFrom},metadata:n._def.openapi?.metadata},n}}return s},Ko(e,`optional`),Ko(e,`nullable`),Ko(e,`default`),Ko(e,`transform`),Ko(e,`refine`);let t=e.ZodObject.prototype.deepPartial;e.ZodObject.prototype.deepPartial=function(){let e=this._def.shape(),n=t.apply(this),r=n._def.shape();return Object.entries(r).forEach(([t,n])=>{n._def.openapi=e[t]?._def?.openapi}),n._def.openapi=void 0,n};let n=e.ZodObject.prototype.pick;e.ZodObject.prototype.pick=function(...e){let t=n.apply(this,e);return t._def.openapi=void 0,t};let r=e.ZodObject.prototype.omit;e.ZodObject.prototype.omit=function(...e){let t=r.apply(this,e);return t._def.openapi=void 0,t}}var Jo=class{constructor(e){this.parents=e,this._definitions=[]}get definitions(){return[...this.parents?.flatMap(e=>e.definitions)??[],...this._definitions]}register(e,t){let n=this.schemaWithRefId(e,t);return this._definitions.push({type:`schema`,schema:n}),n}registerParameter(e,t){let n=this.schemaWithRefId(e,t),r=n._def.openapi?.metadata,i=n.openapi(Object.assign(Object.assign({},r),{param:Object.assign(Object.assign({},r?.param),{name:r?.param?.name??e})}));return this._definitions.push({type:`parameter`,schema:i}),i}registerPath(e){this._definitions.push({type:`route`,route:e})}registerWebhook(e){this._definitions.push({type:`webhook`,webhook:e})}registerComponent(e,t,n){return this._definitions.push({type:`component`,componentType:e,name:t,component:n}),{name:t,ref:{$ref:`#/components/${e}/${t}`}}}schemaWithRefId(e,t){return t.openapi(e)}};qo(Qn),new Jo,H(`type`,[br.openapi(`SpawnCommand`),xr.openapi(`RemoveInstanceCommand`),Sr.openapi(`SetParameterCommand`),Cr.openapi(`TriggerFaultCommand`),wr.openapi(`ClearFaultCommand`),Tr.openapi(`PauseCommand`),Er.openapi(`ResumeCommand`),Dr.openapi(`SetSpeedCommand`),Or.openapi(`UnquarantineCommand`),kr.openapi(`InvokeMethodCommand`),Ar.openapi(`LoadTemplateCommand`),jr.openapi(`UnloadTemplateRunCommand`),Mr.openapi(`ResetEnvironmentCommand`),Nr.openapi(`EnableAdapterCommand`),Pr.openapi(`DisableAdapterCommand`)]).openapi(`EngineCommand`);var Yo=new Map(Bo.map(e=>[`${e.method} ${e.path}`,e]));function $(e,t){let n=Yo.get(`${e} ${t}`);if(!n)throw Error(`Missing admin route definition for ${e} ${t}`);return n}var Xo={authLogin:$(`POST`,`/auth/login`),authLogout:$(`POST`,`/auth/logout`),authPassword:$(`PUT`,`/auth/password`),authStatus:$(`GET`,`/auth/status`),bootstrap:$(`GET`,`/bootstrap`),catalogModelDetail:$(`GET`,`/catalog/models/:name`),catalogModelLeDt:$(`GET`,`/catalog/models/:name/le-dt.json`),catalogModels:$(`GET`,`/catalog/models`),catalogModelYaml:$(`GET`,`/catalog/models/:name/yaml`),catalogTemplateDetail:$(`GET`,`/catalog/templates/:id`),catalogTemplateLeTagsCsv:$(`GET`,`/catalog/templates/:id/le-tags.csv`),catalogTemplateLeTemplateJson:$(`GET`,`/catalog/templates/:id/le-template.json`),catalogTemplates:$(`GET`,`/catalog/templates`),catalogTemplateYaml:$(`GET`,`/catalog/templates/:id/yaml`),commands:$(`POST`,`/commands`),events:$(`GET`,`/events`),health:$(`GET`,`/healthz`),instanceDetail:$(`GET`,`/instances/:id`),manifest:$(`GET`,`/manifest`),metrics:$(`GET`,`/metrics`),modelDetail:$(`GET`,`/models/:name`),openApiDocument:$(`GET`,`/openapi.json`),platformApply:$(`POST`,`/platforms/le/apply`),platformApplyStream:$(`POST`,`/platforms/le/apply/stream`),platformCleanup:$(`POST`,`/platforms/le/cleanup`),platformCleanupPlan:$(`POST`,`/platforms/le/cleanup/plan`),platformCleanupStream:$(`POST`,`/platforms/le/cleanup/stream`),platformConnectionTest:$(`POST`,`/platforms/le/targets/test`),platformOperationCancel:$(`POST`,`/platforms/le/operations/:operationId/cancel`),platformOperations:$(`GET`,`/platforms/le/operations`),platformPlan:$(`POST`,`/platforms/le/plan`),platformTargetById:$(`PUT`,`/platforms/le/targets/:id`),platformTargetCreate:$(`POST`,`/platforms/le/targets`),platformTargetDelete:$(`DELETE`,`/platforms/le/targets/:id`),platformTargetDetail:$(`GET`,`/platforms/le/targets/:id`),platformTargets:$(`GET`,`/platforms/le/targets`),readiness:$(`GET`,`/readyz`),runningTemplates:$(`GET`,`/running-templates`),runtimeWebSocket:$(`GET`,`/ws`),shutdown:$(`POST`,`/shutdown`),state:$(`GET`,`/state`)},Zo=new Ze({defaultOptions:{queries:{staleTime:3e4,gcTime:10*6e4,retry:(e,t)=>{if(t instanceof Error&&t.message===`Session expired`)return!1;if(Uo.is(t)){let e=t.status;if(e>=400&&e<500)return!1}return e<2},refetchOnWindowFocus:!1}}}),Qo=`miravo:query-cache:v1`,$o=5*6e4;function es(e){try{let t=sessionStorage.getItem(Qo);if(!t)return;let n=JSON.parse(t);if(typeof n!=`object`||!n)return;let r=n;if(typeof r.timestamp!=`number`)return;if(Date.now()-r.timestamp>$o){sessionStorage.removeItem(Qo);return}Oe(e,r.state)}catch{}}function ts(e){try{let t=De(e,{shouldDehydrateQuery:e=>e.state.status===`success`}),n={timestamp:Date.now(),state:t};sessionStorage.setItem(Qo,JSON.stringify(n))}catch{}}function ns(e){let t=null,n=e.getQueryCache().subscribe(()=>{t&&clearTimeout(t),t=setTimeout(()=>ts(e),500)});return()=>{t&&clearTimeout(t),n()}}function rs(){try{sessionStorage.removeItem(Qo)}catch{}}var is=e({AdminRoutes:()=>Xo,BASE_URL:()=>``,CommandError:()=>os,changePassword:()=>ps,fetchBlob:()=>_s,fetchJSON:()=>hs,fetchText:()=>vs,getBootstrap:()=>ms,login:()=>ls,logout:()=>us,postCommand:()=>gs,redirectToLoginInApp:()=>as,requestJSON:()=>fs});function as(){typeof window>`u`||(Zo.removeQueries({queryKey:[`bootstrap`]}),rs(),window.location.pathname!==`/login`&&(window.history.pushState({},``,`/login`),window.dispatchEvent(new PopStateEvent(`popstate`))))}var os=class extends Error{result;constructor(e){super(e.message),this.name=`CommandError`,this.result=e}};function ss(e,t){let n=`${e} ${t}`;return e===502||e===503||e===504?`${n} — the Miravo server may not be running, or a reverse proxy cannot reach it.`:n}async function cs(e){try{let t=await e.json(),n=Vo.safeParse(t);if(n.success)return new Uo({code:n.data.code,status:e.status,message:n.data.message,hint:n.data.hint})}catch{}return Error(ss(e.status,e.statusText))}async function ls(e,t){return fs(`/auth/login`,Xo.authLogin,{body:{username:e,password:t}})}async function us(){await fs(`/auth/logout`,Xo.authLogout)}function ds(e,t){if(e.response.kind!==`json`)throw Error(`requestJSON requires a JSON route definition for ${e.method} ${e.path}`);return e.additionalSuccessResponses?.[t]??e.response.schema}async function fs(e,t,n={}){let{body:r,init:i}=n,a={method:t.method,credentials:`include`,...i};if(t.body){let e=t.body.safeParse(r);if(!e.success)throw Error(`Invalid request for ${t.method} ${t.path}: ${e.error.message}`);a.headers={"content-type":`application/json`,...i?.headers??{}},a.body=JSON.stringify(e.data)}else if(r!==void 0)throw Error(`Route ${t.method} ${t.path} does not accept a JSON body.`);let o=await fetch(`${e}`,a);if(o.status===401&&t.auth===`required`)throw as(),Error(`Session expired`);if(!o.ok)throw await cs(o);let s;try{s=await o.json()}catch{throw Error(`Invalid JSON response for ${t.method} ${t.path}`)}let c=ds(t,o.status).safeParse(s);if(!c.success)throw Error(`Invalid response for ${t.method} ${t.path}: ${c.error.message}`);return c.data}async function ps(e,t){return fs(`/auth/password`,Xo.authPassword,{body:{oldPassword:e,newPassword:t}})}async function ms(){return fs(`/bootstrap`,Xo.bootstrap)}async function hs(e,t){return fs(e,t)}async function gs(e){let t=await fs(`/commands`,Xo.commands,{body:e});if(!t.success)throw new os(t);return t}async function _s(e,t){if(t.response.kind!==`passthrough`)throw Error(`fetchBlob requires a passthrough route definition for ${t.method} ${t.path}`);let n=await fetch(`${e}`,{credentials:`include`});if(n.status===401&&t.auth===`required`)throw as(),Error(`Session expired`);if(!n.ok)throw Error(ss(n.status,n.statusText));return n.blob()}async function vs(e,t){if(t.response.kind!==`yaml`)throw Error(`fetchText requires a YAML route definition for ${t.method} ${t.path}`);let n=await fetch(`${e}`,{credentials:`include`});if(n.status===401&&t.auth===`required`)throw as(),Error(`Session expired`);if(!n.ok)throw Error(ss(n.status,n.statusText));return n.text()}export{U as A,ve as B,mr as C,W as D,G as E,Ge as F,f as G,de as H,Ve as I,ge as J,d as K,Re as L,V as M,R as N,I as O,We as P,t as Q,h as R,gr as S,L as T,s as U,l as V,ue as W,i as X,u as Y,n as Z,Xo as _,hs as a,xo as b,ls as c,as as d,fs as f,Zo as g,ns as h,_s as i,F as j,B as k,us as l,es as m,is as n,vs as o,rs as p,ae as q,ps as r,ms as s,os as t,gs as u,Uo as v,z as w,hr as x,Vo as y,ye as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Yddw9eHa.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-Yddw9eHa.js";var t=e(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{at as e}from"./vendor-ui-mizMYESS.js";import{n as t}from"./createLucideIcon-Yddw9eHa.js";var n=e();function r(){return(0,n.jsxs)(`div`,{className:`pointer-events-none absolute inset-0 overflow-hidden`,"aria-hidden":!0,children:[(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--amber`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__glow auth-screen-loader__glow--cyan`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__grid`}),(0,n.jsx)(`div`,{className:`auth-screen-loader__vignette`})]})}function i({className:e,children:i}){return(0,n.jsxs)(`div`,{className:t(`relative w-full overflow-hidden bg-background`,e),children:[(0,n.jsx)(r,{}),(0,n.jsx)(`div`,{className:`relative z-10 min-h-0`,children:i})]})}export{i as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as e,it as t}from"./vendor-ui-mizMYESS.js";import{n}from"./createLucideIcon-Yddw9eHa.js";import{i as r}from"./input-BCiRHEmc.js";var i=r(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-[var(--miravo-radius-pill)] border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[background-color,border-color,color] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 bg-destructive/20 focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function a({className:r,variant:a=`default`,render:o,...s}){return e({defaultTagName:`span`,props:t({className:n(i({variant:a}),r)},s),render:o,state:{slot:`badge`,variant:a}})}export{i as n,a as t};
|