@t4h.framework/vite-panel-plugin 0.3.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @t4h.framework/vite-panel-plugin
2
2
 
3
+ ## 0.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#168](https://github.com/tech4humans-brasil/framework/pull/168) [`2efe608`](https://github.com/tech4humans-brasil/framework/commit/2efe60810d5e1dc2538d9ddd95c23be72140e969) Thanks [@gusteycamargo](https://github.com/gusteycamargo)! - The workflow details fall back to the app authorization when the workflow
8
+ carries an empty one. The manifest may send `authorization` as `""` for a
9
+ workflow that declares none, and `??` kept the empty string, showing the
10
+ workflow as having its own authorization instead of the app's.
11
+
3
12
  ## 0.3.0
4
13
 
5
14
  ### Minor Changes
@@ -41,4 +41,4 @@ Supported values: ["extend", "clamp", "identity", Extrapolatation.CLAMP, Extrapo
41
41
  extrapolateLeft: Extrapolation.CLAMP,
42
42
  extrapolateRight: Extrapolation.IDENTITY
43
43
  }})`);return Object.assign(t,e),t}function dj(e,t,n){"worklet";let{leftEdgeInput:r,rightEdgeInput:i,leftEdgeOutput:a,rightEdgeOutput:o}=t;if(i-r===0)return a;let s=a+(e-r)/(i-r)*(o-a),c=o>=a?1:-1;return c*s<c*a?cj(n.extrapolateLeft,c,s,a,o,e):c*s>c*o?cj(n.extrapolateRight,c,s,a,o,e):s}function fj(e,t,n,r){"worklet";if(t.length<2||n.length<2)throw new Y(`Interpolation input and output ranges should contain at least two values.`);let i=uj(r),a=t.length,o={leftEdgeInput:t[0],rightEdgeInput:t[1],leftEdgeOutput:n[0],rightEdgeOutput:n[1]};if(a>2){if(e>t[a-1])o.leftEdgeInput=t[a-2],o.rightEdgeInput=t[a-1],o.leftEdgeOutput=n[a-2],o.rightEdgeOutput=n[a-1];else for(let r=1;r<a;++r)if(e<=t[r]){o.leftEdgeInput=t[r-1],o.rightEdgeInput=t[r],o.leftEdgeOutput=n[r-1],o.rightEdgeOutput=n[r];break}}return dj(e,o,i)}Yw(EC);var pj=oj,mj=Symbol(`reanimated-component`),hj=new Map;function gj(e){if(!hj.has(e)){let t=pj.createAnimatedComponent(e);hj.set(e,t)}return hj.get(e)}function _j({as:e,...t}){let n=gj(e);return(0,O.jsx)(n,{...t})}_j.of=function(e){return mj in e?e[mj]:gj(e)};function vj(e,t,n=[]){let r=PA(e);return(0,b.useEffect)(()=>{let e=t(r);if(typeof e==`function`)return e;e!==void 0&&(r.value=e)},n),r}var yj=1e3;function bj(e,t){let n=(0,b.useRef)(e);return vj(n.current,r=>{if(r.value=n.current,e===n.current)return;r.value=YE(e,t);let i=++yj;return r.addListener(i,e=>{n.current=e}),()=>{r.removeListener(i)}},[e])}function xj(e,t){return bj(w(e),t)}var Sj=new Sa(`size`).use(Number).map({xs:8,sm:16,md:24,lg:48,xl:96}).setToStyle(e=>({width:e,height:e})).setDefault(`md`),Cj=new Sa(`color`).use(String).setToStyle(e=>({borderTopColor:e})),wj=new ay().add(q.collection).add(Sj).add(Cj);function Tj(e){let t=PA(`0deg`),n=VA(()=>({transform:[{rotateZ:t.value}]}),[t]);(0,b.useEffect)(()=>{t.value=vD(YE(`360deg`,{duration:1e3,easing:fE.linear}),-1)},[t]);let[r,i,a]=ly(wj,e);return(0,O.jsx)(pj.View,{style:[Ej.spinner,r,i,n],...a})}var Ej=yl.create({spinner:{borderWidth:2,borderColor:`transparent`,borderTopColor:`blue`,borderRadius:`100%`}}),Dj;(function(e){e.Solid=`solid`,e.Outline=`outline`,e.Ghost=`ghost`,e.SolidPrimary=`solid.primary`,e.OutlinePrimary=`outline.primary`,e.GhostPrimary=`ghost.primary`})(Dj||={});var Oj=200;function kj(e){let t=vj(+!e.isLoading,()=>YE(+!e.isLoading,{duration:Oj}),[e.isLoading]),n=vj(+!!e.isLoading,()=>YE(+!!e.isLoading,{duration:Oj}),[e.isLoading]),r=(0,b.useMemo)(()=>e.isDisabled?`${e.appearance}.disabled`:e.isLoading?e.isSelected?`${e.appearance}.selected.loading`:`${e.appearance}.loading`:e.isSelected?e.isPressed?`${e.appearance}.selected.pressed`:e.isHovered?`${e.appearance}.selected.hovered`:`${e.appearance}.selected`:e.isPressed?`${e.appearance}.pressed`:e.isHovered?`${e.appearance}.hovered`:e.appearance,[e]);return{tag:r,contentOpacity:t,spinnerOpacity:n,borderColor:xj(`button.${r}.color.border`,{duration:Oj}),backgroundColor:xj(`button.${r}.color.background`,{duration:Oj}),color:xj(`button.${r}.color.text`,{duration:Oj})}}var Aj=(0,b.createContext)({isLoading:!1,addLoading:()=>()=>{}}),jj;(function(e){function t(e){return!(typeof e!=`object`||!e||!(Symbol.iterator in e)||typeof e[Symbol.iterator]!=`function`)}function n(e,n){return t(e)?Array.from(e).map(n):[n(e,0)]}e.map=n})(jj||={});function Mj({children:e,isLoading:t=!1}){let[n,r]=(0,b.useState)([]),i=(0,b.useCallback)(()=>{let e=Symbol();return r(t=>[...t,e]),()=>{r(t=>t.toSpliced(t.indexOf(e),1))}},[]),a=(0,b.useMemo)(()=>!!n.length||t,[n,t]),o=(0,b.useMemo)(()=>({isLoading:a,addLoading:i}),[a,i]);return(0,O.jsx)(Aj.Provider,{value:o,children:jj.map(e,e=>typeof e==`function`?e(o):e)})}var Nj=class{key;tokens;constructor(e,t){this.key=e,this.tokens=t}parseTokenValue(e){return typeof e==`string`?this.parseTokenValue([e]):e.map(e=>e.startsWith(`!`)?`@button.${this.key}.${e.replace(`!`,``)}`:e)}toRecord(){return Object.fromEntries(Object.entries(this.tokens).map(([e,t])=>[`button.${this.key}.${e}`,this.parseTokenValue(t)]))}register(){E.get().tokens.set(this.toRecord())}};new Nj(Dj.Solid,{"color.text":`#1C2024`,"color.background":`#EEEEEE`,"color.border":`!color.background`,"disabled.color.text":`#A1A1A1`,"disabled.color.background":`#F5F5F5`,"disabled.color.border":`!disabled.color.background`,"hovered.color.text":`!color.text`,"hovered.color.background":`#E0E0E0`,"hovered.color.border":`!hovered.color.background`,"pressed.color.text":`!color.text`,"pressed.color.background":`#D6D6D6`,"pressed.color.border":`!pressed.color.background`,"selected.color.text":`!color.text`,"selected.color.background":`#CFCFCF`,"selected.color.border":`!selected.color.background`,"loading.color.text":`!color.text`,"loading.color.background":`#EEEEEE`,"loading.color.border":`!loading.color.background`,"selected.loading.color.text":`!color.text`,"selected.loading.color.background":`#CFCFCF`,"selected.loading.color.border":`!selected.loading.color.background`,"selected.hovered.color.text":`!color.text`,"selected.hovered.color.background":`#C2C2C2`,"selected.hovered.color.border":`!selected.hovered.color.background`,"selected.pressed.color.text":`!color.text`,"selected.pressed.color.background":`#B6B6B6`,"selected.pressed.color.border":`!selected.pressed.color.background`,"space.x":`@space.150`,"space.y":`@space.100`}).register(),new Nj(Dj.SolidPrimary,{"color.text":`#FFFFFF`,"color.background":`#443EE3`,"color.border":`!color.background`,"disabled.color.text":`#BFBFEF`,"disabled.color.background":`#D6D6F5`,"disabled.color.border":`!disabled.color.background`,"hovered.color.text":`!color.text`,"hovered.color.background":`#3C38CC`,"hovered.color.border":`!hovered.color.background`,"pressed.color.text":`!color.text`,"pressed.color.background":`#3431B8`,"pressed.color.border":`!pressed.color.background`,"selected.color.text":`!color.text`,"selected.color.background":`#2F2DAA`,"selected.color.border":`!selected.color.background`,"loading.color.text":`!color.text`,"loading.color.background":`#443EE3`,"loading.color.border":`!loading.color.background`,"selected.loading.color.text":`!color.text`,"selected.loading.color.background":`#2F2DAA`,"selected.loading.color.border":`!selected.loading.color.background`,"selected.hovered.color.text":`!color.text`,"selected.hovered.color.background":`#2A2898`,"selected.hovered.color.border":`!selected.hovered.color.background`,"selected.pressed.color.text":`!color.text`,"selected.pressed.color.background":`#252486`,"selected.pressed.color.border":`!selected.pressed.color.background`,"space.x":`@space.150`,"space.y":`@space.100`}).register(),new Nj(Dj.OutlinePrimary,{"color.text":`#443EE3`,"color.background":`#FFFFFF`,"color.border":`#443EE3`,"disabled.color.text":`#BFBFEF`,"disabled.color.background":`#FFFFFF`,"disabled.color.border":`#D6D6F5`,"hovered.color.text":`#3C38CC`,"hovered.color.background":`#F5F5FF`,"hovered.color.border":`#3C38CC`,"pressed.color.text":`#3431B8`,"pressed.color.background":`#ECECFF`,"pressed.color.border":`#3431B8`,"selected.color.text":`#2F2DAA`,"selected.color.background":`#E6E6FF`,"selected.color.border":`#2F2DAA`,"loading.color.text":`#443EE3`,"loading.color.background":`#FFFFFF`,"loading.color.border":`#443EE3`,"selected.loading.color.text":`#2F2DAA`,"selected.loading.color.background":`#E6E6FF`,"selected.loading.color.border":`#2F2DAA`,"selected.hovered.color.text":`#2A2898`,"selected.hovered.color.background":`#E0E0FF`,"selected.hovered.color.border":`#2A2898`,"selected.pressed.color.text":`#252486`,"selected.pressed.color.background":`#DADAFE`,"selected.pressed.color.border":`#252486`,"space.x":`@space.150`,"space.y":`@space.100`}).register(),new Nj(Dj.Outline,{"color.text":`#1C2024`,"color.background":`#FFFFFF`,"color.border":`!color.text`,"disabled.color.text":`#A1A1A1`,"disabled.color.background":`#FFFFFF`,"disabled.color.border":`#D1D1D1`,"hovered.color.text":`!color.text`,"hovered.color.background":`#F5F5F5`,"hovered.color.border":`!color.text`,"pressed.color.text":`!color.text`,"pressed.color.background":`#EEEEEE`,"pressed.color.border":`!color.text`,"selected.color.text":`!color.text`,"selected.color.background":`#EAEAEA`,"selected.color.border":`!color.text`,"loading.color.text":`!color.text`,"loading.color.background":`#FFFFFF`,"loading.color.border":`!color.text`,"selected.loading.color.text":`!color.text`,"selected.loading.color.background":`#EAEAEA`,"selected.loading.color.border":`!color.text`,"selected.hovered.color.text":`!color.text`,"selected.hovered.color.background":`#E0E0E0`,"selected.hovered.color.border":`!color.text`,"selected.pressed.color.text":`!color.text`,"selected.pressed.color.background":`#D6D6D6`,"selected.pressed.color.border":`!color.text`,"space.x":`@space.150`,"space.y":`@space.100`}).register(),new Nj(Dj.Ghost,{"color.text":`#1C2024`,"color.background":`#FFFFFF00`,"color.border":`!color.background`,"disabled.color.text":`#A1A1A1`,"disabled.color.background":`!color.background`,"disabled.color.border":`!color.background`,"hovered.color.text":`#1C2024`,"hovered.color.background":`!color.background`,"hovered.color.border":`!color.background`,"pressed.color.text":`#1C2024`,"pressed.color.background":`!color.background`,"pressed.color.border":`!color.background`,"selected.color.text":`#1C2024`,"selected.color.background":`!color.background`,"selected.color.border":`!color.background`,"loading.color.text":`#1C2024`,"loading.color.background":`!color.background`,"loading.color.border":`!color.background`,"selected.loading.color.text":`#1C2024`,"selected.loading.color.background":`!color.background`,"selected.loading.color.border":`!color.background`,"selected.hovered.color.text":`#1C2024`,"selected.hovered.color.background":`!color.background`,"selected.hovered.color.border":`!color.background`,"selected.pressed.color.text":`#1C2024`,"selected.pressed.color.background":`!color.background`,"selected.pressed.color.border":`!color.background`,"space.y":`@space.050`,"space.x":`@space.050`}).register(),new Nj(Dj.GhostPrimary,{"color.text":`#443EE3`,"color.background":`#FFFFFF00`,"color.border":`!color.background`,"disabled.color.text":`#BFBFEF`,"disabled.color.background":`!color.background`,"disabled.color.border":`!color.background`,"hovered.color.text":`#443EE3`,"hovered.color.background":`!color.background`,"hovered.color.border":`!color.background`,"pressed.color.text":`#443EE3`,"pressed.color.background":`!color.background`,"pressed.color.border":`!color.background`,"selected.color.text":`#2F2DAA`,"selected.color.background":`!color.background`,"selected.color.border":`!color.background`,"loading.color.text":`#443EE3`,"loading.color.background":`!color.background`,"loading.color.border":`!color.background`,"selected.loading.color.text":`#2F2DAA`,"selected.loading.color.background":`!color.background`,"selected.loading.color.border":`!color.background`,"selected.hovered.color.text":`#2A2898`,"selected.hovered.color.background":`!color.background`,"selected.hovered.color.border":`!color.background`,"selected.pressed.color.text":`#252486`,"selected.pressed.color.background":`!color.background`,"selected.pressed.color.border":`!color.background`,"space.y":`@space.050`,"space.x":`@space.050`}).register(),E.get().tokens.set({"button.font.weight":`normal`,"button.font.lineHeight":`md`,"button.font.size":`sm`,"button.icon.size":`md`});function Pj({onHoverIn:e,onHoverOut:t,onPressIn:n,onPressOut:r}={}){let[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),c=(0,b.useCallback)(t=>{a(!0),e?.(t)},[e]),l=(0,b.useCallback)(e=>{a(!1),t?.(e)},[t]),u=(0,b.useCallback)(e=>{s(!0),n?.(e)},[n]),d=(0,b.useCallback)(e=>{s(!1),r?.(e)},[r]);return(0,b.useMemo)(()=>({isHovered:i,isPressed:o,props:{onHoverIn:c,onHoverOut:l,onPressIn:u,onPressOut:d}}),[i,o,c,l,u,d])}function Fj({children:e,onHoverIn:t,onHoverOut:n,onPressIn:r,onPressOut:i,...a}){let{isHovered:o,isPressed:s,props:c}=Pj({onHoverIn:t,onHoverOut:n,onPressIn:r,onPressOut:i});return(0,O.jsx)(dv,{...a,...c,children:e({isHovered:o,isPressed:s})})}function Ij({state:e,action:t,onPress:n}){let{props:r}=Pj(),i=(0,b.useCallback)(()=>{n?.()},[n]);return(0,O.jsx)(q,{...r,as:_j.of(dv),row:!0,align:!0,onPress:i,children:t(e)})}var Lj=pj.createAnimatedComponent(dv);function Rj({iconBefore:e,iconAfter:t,actionBefore:n,actionsAfter:r,shouldFitContainer:i=!1,appearance:a=Dj.Solid,children:o,isLoading:s=!1,isSelected:c=!1,isDisabled:l=!1,onPress:u,icon:d,text:f,style:p}){let m=(0,b.useId)(),[h,g]=(0,b.useState)(!1),_=o??d??f,[v,y]=(0,b.useState)(!1),[x,S]=(0,b.useState)(!1),C=(0,b.useContext)(Aj),{addLoading:w}=C,T=(0,b.useMemo)(()=>s||C.isLoading||h,[s,h,C.isLoading]),E=(0,b.useMemo)(()=>!l&&!T,[l,T]),D=(0,b.useMemo)(()=>({appearance:a,isSelected:c,isDisabled:l,isHovered:v,isPressed:x,isLoading:T}),[a,l,v,T,x,c]),k=(0,b.useCallback)(()=>y(!0),[]),ee=(0,b.useCallback)(()=>y(!1),[]),A=(0,b.useCallback)(()=>S(!0),[]),te=(0,b.useCallback)(()=>S(!1),[]),{tag:ne,backgroundColor:re,borderColor:ie,color:j,contentOpacity:M,spinnerOpacity:ae}=kj(D),oe=(0,b.useCallback)(e=>{if(!E)return;let t=u?.(e);if(!t)return;g(!0);let n=w();Promise.resolve(t).catch(()=>void 0).finally(()=>g(!1)).finally(()=>n())},[E,w,u]),se=VA(()=>({backgroundColor:re.value,borderColor:ie.value}),[re,ie]),N=VA(()=>({opacity:M.value}),[M]),ce=VA(()=>({color:j.value}),[j]),le=VA(()=>({opacity:ae.value,borderTopColor:j.value}),[j,ae]),ue=(0,b.useMemo)(()=>typeof p==`function`?p(D):p,[p,D]);return(0,O.jsxs)(q,{as:Lj,rounded:!0,align:!0,justify:!0,alignSelf:i?void 0:`start`,disabled:l,px:`button.${a}.space.x`,py:`button.${a}.space.y`,position:`relative`,borderWidth:1,onHoverIn:k,onHoverOut:ee,onPressIn:A,onPressOut:te,onPress:oe,style:[se,ue],children:[T&&(0,O.jsx)(Tj,{size:`sm`,position:`absolute`,style:le}),(0,O.jsxs)(q,{align:!0,justify:!0,as:pj.View,flexDirection:`row`,gap:`space.100`,style:N,children:[e&&(0,O.jsx)(_j,{as:e,size:`button.icon.size`,fill:`button.${ne}.color.text`}),!!n?.length&&(0,O.jsx)(q,{row:!0,align:!0,gap:`space.050`,children:n.map(({action:e,onPress:t},n)=>(0,O.jsx)(Ij,{state:D,action:e,onPress:t},`${m}:buttons:actions:before:${n}`))}),typeof _==`string`?(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,weight:`button.font.weight`,height:`button.font.lineHeight`,size:`button.font.size`,style:ce,children:_}):typeof _==`function`?tx.isIconComponent(_)?(0,O.jsx)(_j,{as:_,size:`button.icon.size`,fill:`button.${ne}.color.text`}):_(D):_,!!r?.length&&(0,O.jsx)(q,{row:!0,align:!0,gap:`space.050`,children:r.map(({action:e,onPress:t},n)=>(0,O.jsx)(Ij,{state:D,action:e,onPress:t},`${m}:buttons:actions:after:${n}`))}),t&&(0,O.jsx)(_j,{as:t,size:`button.icon.size`,fill:`button.${ne}.color.text`})]})]})}Rj.Group=Mj;var zj=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`M10 11H7.101l.001-.009a4.956 4.956 0 0 1 .752-1.787 5.054 5.054 0 0 1 2.2-1.811c.302-.128.617-.226.938-.291a5.078 5.078 0 0 1 2.018 0 4.978 4.978 0 0 1 2.525 1.361l1.416-1.412a7.036 7.036 0 0 0-2.224-1.501 6.921 6.921 0 0 0-1.315-.408 7.079 7.079 0 0 0-2.819 0 6.94 6.94 0 0 0-1.316.409 7.04 7.04 0 0 0-3.08 2.534 6.978 6.978 0 0 0-1.054 2.505c-.028.135-.043.273-.063.41H2l4 4 4-4zm4 2h2.899l-.001.008a4.976 4.976 0 0 1-2.103 3.138 4.943 4.943 0 0 1-1.787.752 5.073 5.073 0 0 1-2.017 0 4.956 4.956 0 0 1-1.787-.752 5.072 5.072 0 0 1-.74-.61L7.05 16.95a7.032 7.032 0 0 0 2.225 1.5c.424.18.867.317 1.315.408a7.07 7.07 0 0 0 2.818 0 7.031 7.031 0 0 0 4.395-2.945 6.974 6.974 0 0 0 1.053-2.503c.027-.135.043-.273.063-.41H22l-4-4-4 4z`})})),Bj={body:{fontSize:13,color:J.muted,fontFamily:`Inter, sans-serif`},label:{fontSize:11,color:J.muted,fontWeight:`700`,fontFamily:`Inter, sans-serif`,style:{letterSpacing:.5,textTransform:`uppercase`}},mono:{fontSize:12,color:J.text,fontFamily:`JetBrains Mono, monospace`,lineHeight:1.6},title:{fontSize:16,color:J.text,fontWeight:`600`,fontFamily:`Sora, Inter, sans-serif`}};function Z({variant:e=`body`,...t}){let n=(0,b.useMemo)(()=>{let n={...Bj[e],...t},r=t.fontSize??n.fontSize;return typeof n.lineHeight==`number`&&typeof r==`number`?{...n,fontSize:r,lineHeight:r*n.lineHeight}:n},[t,e]);return(0,O.jsx)(fx,{...n})}var Vj=()=>{};function Hj(e){let t=0;for(let n of e.getAll())t=Math.max(t,n.state.dataUpdatedAt);return t}function Uj(e=!0){let t=A().getQueryCache();return(0,b.useSyncExternalStore)((0,b.useCallback)(n=>e?t.subscribe(n):Vj,[t,e]),()=>e?Hj(t):0)}function Wj(e){return new Date(e).getTime()}function Gj(e){let t=Math.floor(e/60),n=e%60;return`${t}m ${String(n).padStart(2,`0`)}s`}function Kj(e){return e<0?`0ms`:e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:Gj(Math.round(e/1e3))}function qj(e){let t=Math.max(e,0);return t<6e4?`${(t/1e3).toFixed(1)}s`:Gj(Math.floor(t/1e3))}function Jj(e,t){return`${e} ${t}${e===1?``:`s`} ago`}function Yj(e,t=Date.now()){let n=Math.round((t-Wj(e))/1e3);return n<60?`just now`:n<3600?Jj(Math.floor(n/60),`min`):n<86400?Jj(Math.floor(n/3600),`hour`):new Date(e).toLocaleDateString()}function Xj(e){return new Date(e).toLocaleTimeString()}function Zj(e){return e===void 0?`undefined`:JSON.stringify(e,null,2)}function Qj(e){if(e==null)return`Rejected without a reason.`;if(typeof e==`object`&&`message`in e){let{message:t,stack:n}=e;if(typeof n==`string`)return n;if(typeof t==`string`)return t}return Zj(e)}function $j(e){navigator.clipboard?.writeText(e).catch(console.error)}function eM(e){return e.length>12?`${e.slice(0,12)}…`:e}function tM(){let e=A(),t=_t(),n=Uj();return iS?null:(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[n>0&&(0,O.jsx)(Z,{fontSize:11,children:`Last update at ${Xj(new Date(n).toISOString())}`}),(0,O.jsx)(Rj,{appearance:`ghost`,iconBefore:zj,text:`Refresh`,isLoading:t>0,onPress:()=>void e.invalidateQueries()})]})}var nM={idle:J.muted,starting:J.info,ready:J.brand,exited:J.error};function rM(){let{data:e}=mt(wS.manifest()),{data:t}=mt({...wS.state(),enabled:rS.capabilities.rebuild}),n=e?.id??rS.project??null,r=t?.state??`idle`;return(0,O.jsxs)(q,{position:`absolute`,top:0,left:240,right:0,h:48,bg:J.background,borderBottomWidth:1,borderColor:J.border,row:!0,align:`center`,justify:`space-between`,ph:16,style:{zIndex:50},children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[rS.capabilities.rebuild&&(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,bg:J.panel,ph:10,pv:4,rounded:2,borderWidth:1,borderColor:J.border,children:[(0,O.jsx)(q,{w:7,h:7,rounded:4,bg:nM[r]}),(0,O.jsx)(fx,{fontSize:12,color:J.muted,fontFamily:`JetBrains Mono, monospace`,children:`App: ${r}`})]}),(0,O.jsx)(hS,{children:`project ${n??`...`}`}),Object.entries(rS.metadata).map(([e,t])=>(0,O.jsx)(hS,{children:`${e} ${t}`},e))]}),(0,O.jsx)(tM,{})]})}function iM({children:e}){return(0,O.jsxs)(q,{bg:`#0b1326`,h:`100vh`,children:[(0,O.jsx)(dS,{}),(0,O.jsx)(rM,{}),(0,O.jsx)(q,{ml:240,mt:48,flex:1,overflow:`auto`,children:e})]})}function aM(e,t,n){switch(t){case`manifest`:ES(e,n);break;case`build:status`:DS(e,`starting`);break;case`app:exit`:DS(e,`exited`);break;case`run:created`:OS(e,n);break;case`run:updated`:kS(e,n)}}function oM(){let e=A();return(0,b.useEffect)(()=>{if(!iS)return;let t=xS.events();for(let n of _S)t.addEventListener(n,t=>{let r=t.data;aM(e,n,r?JSON.parse(r):null)});return()=>t.close()},[e]),null}var sM=tx(e=>(0,O.jsxs)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:[(0,O.jsx)(Jx,{d:`M11.953 2C6.465 2 2 6.486 2 12s4.486 10 10 10 10-4.486 10-10S17.493 2 11.953 2zM12 20c-4.411 0-8-3.589-8-8s3.567-8 7.953-8C16.391 4 20 7.589 20 12s-3.589 8-8 8z`}),(0,O.jsx)(Jx,{d:`M11 7h2v7h-2zm0 8h2v2h-2z`})]})),cM=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m11.293 17.293 1.414 1.414L19.414 12l-6.707-6.707-1.414 1.414L15.586 11H6v2h9.586z`})}));function lM({to:e,label:t,icon:n,accent:r=!1}){let i=r?`#48BA80`:`#8896b3`;return(0,O.jsx)(sa,{to:e,style:{textDecoration:`none`},children:(0,O.jsxs)(q,{ph:12,pv:6,borderWidth:1,borderColor:r?`#48BA8050`:`#2d3449`,rounded:2,bg:r?`#1a3328`:`#0b1326`,row:!0,align:`center`,gap:6,style:{cursor:`pointer`},children:[n&&(0,O.jsx)(n,{size:14,fill:i}),(0,O.jsx)(fx,{fontSize:13,color:i,children:t})]})})}function uM({stat:e}){return(0,O.jsxs)(q,{bg:`#131b2e`,rounded:4,borderWidth:1,borderColor:`#2d3449`,p:16,row:!0,align:`center`,justify:`space-between`,flex:1,minW:0,children:[(0,O.jsxs)(q,{children:[(0,O.jsx)(Z,{fontSize:11,color:`#8896b3`,fontFamily:`Inter, sans-serif`,fontWeight:`700`,style:{letterSpacing:.5,textTransform:`uppercase`,marginBottom:6},children:e.label}),(0,O.jsx)(Z,{fontSize:28,fontWeight:`700`,color:`#dae2fd`,fontFamily:`Sora, Inter, sans-serif`,lineHeight:1,children:e.value})]}),(0,O.jsx)(q,{w:40,h:40,rounded:20,bg:`#222a3d`,center:!0,children:(0,O.jsx)(e.icon,{size:20,fill:e.color})})]})}function dM(){let e=mt(wS.manifest()),t=mt(wS.waitingActivities({limit:1})),n=mt(wS.runs({limit:1})),r=mt(wS.runs({status:`rejected`,limit:1})),i=e.isPending||t.isPending||n.isPending||r.isPending,a=e.data?.workflows.length??0,o=e.data?.id??`–`,s=t.data?.count??0,c=[{label:`Workflows`,value:a,icon:Zx,color:`#7bd0ff`},{label:`Pending Activities`,value:s,icon:Xx,color:`#48BA80`},{label:`Runs`,value:n.data?.count??0,icon:$x,color:`#dae2fd`},{label:`Rejected Runs`,value:r.data?.count??0,icon:sM,color:`#ffb4ab`}];return(0,O.jsxs)(q,{flex:1,p:24,gap:24,children:[(0,O.jsxs)(q,{borderBottomWidth:1,borderColor:`#2d344950`,pb:16,row:!0,align:`flex-end`,justify:`space-between`,children:[(0,O.jsxs)(q,{children:[(0,O.jsx)(Z,{fontSize:24,fontWeight:`700`,color:`#dae2fd`,children:`Overview`}),(0,O.jsx)(q,{row:!0,align:`center`,gap:8,mt:6,children:(0,O.jsx)(q,{bg:`#131b2e`,ph:8,pv:2,rounded:2,borderWidth:1,borderColor:`#2d3449`,children:(0,O.jsxs)(Z,{fontSize:12,color:`#8896b3`,fontFamily:`JetBrains Mono, monospace`,children:[`App ID: `,o]})})})]}),(0,O.jsxs)(q,{row:!0,gap:8,children:[(0,O.jsx)(lM,{to:`/runs`,label:`Runs`,icon:$x}),(0,O.jsx)(lM,{to:`/workflows`,label:`Browse Workflows`,icon:Zx,accent:!0})]})]}),i?(0,O.jsx)(q,{flex:1,center:!0,children:(0,O.jsx)(Tj,{})}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{row:!0,gap:16,children:[(0,O.jsxs)(q,{flex:2,bg:`#131b2e`,rounded:4,borderWidth:1,borderColor:`#2d3449`,overflow:`hidden`,children:[(0,O.jsxs)(q,{p:20,flex:1,children:[(0,O.jsx)(Z,{fontSize:20,fontWeight:`700`,color:`#dae2fd`,children:o}),(0,O.jsx)(Z,{fontSize:13,color:`#8896b3`,lineHeight:1.6,children:e.data?.description??(rS.capabilities.rebuild?`T4H Framework application running locally.`:`No description.`)})]}),(0,O.jsx)(q,{bg:`#0f1929`,ph:20,pv:10,borderTopWidth:1,borderColor:`#2d3449`,children:(0,O.jsxs)(Z,{fontSize:12,color:`#8896b3`,fontFamily:`JetBrains Mono, monospace`,children:[a,` workflow`,a===1?``:`s`,` `,`registered`,rS.capabilities.rebuild&&` · runs reset on every rebuild`]})})]}),(0,O.jsx)(sa,{to:`/inbox`,style:{textDecoration:`none`,flex:1},children:(0,O.jsxs)(q,{flex:1,bg:`#131b2e`,rounded:4,borderWidth:1,borderColor:`#2d3449`,overflow:`hidden`,h:`100%`,style:{cursor:`pointer`},children:[(0,O.jsxs)(q,{p:20,flex:1,justify:`space-between`,children:[(0,O.jsx)(Z,{fontSize:11,color:`#8896b3`,fontWeight:`700`,fontFamily:`Inter, sans-serif`,children:`INBOX`}),(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{fontSize:40,fontWeight:`700`,color:`#dae2fd`,lineHeight:1,children:s}),(0,O.jsx)(Z,{fontSize:13,color:`#8896b3`,children:`Activities waiting for an external advance`})]})]}),(0,O.jsxs)(q,{ph:20,pv:10,bg:s>0?`#3b0f1220`:`#0f1929`,borderTopWidth:1,borderColor:`#2d3449`,row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{fontSize:13,color:s>0?`#ffb4ab`:`#48BA80`,fontFamily:`Inter, sans-serif`,children:s>0?`${s} pending`:`All clear`}),(0,O.jsx)(cM,{size:16,fill:`#8896b3`})]})]})})]}),(0,O.jsx)(q,{row:!0,gap:16,children:c.map(e=>(0,O.jsx)(uM,{stat:e},e.label))})]})]})}var fM=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m10 15.586-3.293-3.293-1.414 1.414L10 18.414l9.707-9.707-1.414-1.414z`})})),pM=tx(e=>(0,O.jsxs)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:[(0,O.jsx)(Jx,{d:`M12 5c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8zm0 14c-3.309 0-6-2.691-6-6s2.691-6 6-6 6 2.691 6 6-2.691 6-6 6z`}),(0,O.jsx)(Jx,{d:`M11 9h2v5h-2zM9 2h6v2H9zm10.293 5.707-2-2 1.414-1.414 2 2z`})]}));function mM(e){return{style:{cursor:`pointer`},onStartShouldSetResponder:()=>!0,onResponderRelease:e}}function hM({children:e,color:t=J.muted,onPress:n}){return(0,O.jsx)(q,{bg:J.raised,ph:8,pv:2,rounded:2,alignSelf:`flex-start`,...n?mM(n):{},children:(0,O.jsx)(Z,{variant:`mono`,color:t,children:e})})}function gM({icon:e,children:t}){return(0,O.jsxs)(q,{flex:1,center:!0,gap:12,p:20,children:[(0,O.jsx)(e,{size:32,fill:J.border}),(0,O.jsx)(Z,{fontSize:14,children:t})]})}function _M({isSelected:e,onSelect:t,children:n}){return(0,O.jsx)(q,{p:14,gap:8,borderBottomWidth:1,borderLeftWidth:2,borderColor:J.border,bg:e?`${J.brandSubtle}20`:`transparent`,...mM(t),style:{borderLeftColor:e?J.brand:`transparent`,cursor:`pointer`},children:n})}var vM=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`M13.293 6.293 7.586 12l5.707 5.707 1.414-1.414L10.414 12l4.293-4.293z`})})),yM=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`M10.707 17.707 16.414 12l-5.707-5.707-1.414 1.414L13.586 12l-4.293 4.293z`})}));function bM({count:e,offset:t,limit:n,onChange:r}){if(e<=n&&t===0)return null;let i=Math.min(t+1,e),a=Math.min(t+n,e);return(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,ph:12,pv:6,borderTopWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:e===0?`Nothing to show`:`${i}–${a} of ${e}`}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:4,children:[(0,O.jsx)(Rj,{appearance:`ghost`,icon:vM,isDisabled:t===0,onPress:()=>r(Math.max(t-n,0))}),(0,O.jsx)(Rj,{appearance:`ghost`,icon:yM,isDisabled:t+n>=e,onPress:()=>r(t+n)})]})]})}function xM({side:e,children:t}){return(0,O.jsxs)(q,{row:!0,h:`calc(100vh - 48px)`,overflow:`hidden`,children:[(0,O.jsx)(q,{w:`34%`,minW:320,maxW:460,borderRightWidth:1,borderColor:J.border,bg:J.background,children:e}),(0,O.jsx)(q,{flex:1,overflow:`hidden`,children:t})]})}var SM=tx(e=>(0,O.jsxs)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:[(0,O.jsx)(Jx,{d:`m13 3 3.293 3.293-7 7 1.414 1.414 7-7L21 11V3z`}),(0,O.jsx)(Jx,{d:`M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z`})]}));function CM({children:e,color:t=J.brand}){return(0,O.jsx)(q,{ph:6,pv:2,rounded:2,bg:`${t}15`,borderWidth:1,borderColor:`${t}30`,alignSelf:`flex-start`,children:(0,O.jsx)(Z,{variant:`label`,color:t,children:e})})}function wM({value:e,color:t=J.text}){return(0,O.jsx)(q,{bg:J.background,rounded:4,borderWidth:1,borderColor:J.border,p:16,overflow:`auto`,children:(0,O.jsx)(Z,{variant:`mono`,color:t,children:e})})}var TM=1e3;function EM(e){return Math.abs(e)<6e4?100:TM}function DM(e){return e<6e4?TM:e<36e5?5*TM:30*TM}var OM=new Map;function kM(e){let t=OM.get(e);if(t)return t;let n={now:Date.now(),timer:null,subscribers:new Set};return OM.set(e,n),n}function AM(e){e.now=Date.now();for(let t of e.subscribers)t()}function jM(e,t){return e-t%e}function MM(e,t){t.timer=setTimeout(()=>{MM(e,t),AM(t)},jM(e,Date.now()))}var NM=!1;function PM(){NM||(NM=!0,document.addEventListener(`visibilitychange`,()=>{if(document.visibilityState===`visible`)for(let e of OM.values())e.subscribers.size>0&&AM(e)}))}function FM(e,t){let n=kM(e);return n.subscribers.add(t),n.timer||(n.now=Date.now(),MM(e,n)),PM(),()=>{n.subscribers.delete(t),!(n.subscribers.size>0||!n.timer)&&(clearTimeout(n.timer),n.timer=null)}}var IM=()=>{};function LM({initialTime:e,isActive:t=!0,intervalInMs:n=100}={}){let r=(0,b.useMemo)(()=>e??Date.now(),[e]),i=(0,b.useSyncExternalStore)((0,b.useCallback)(e=>t?FM(n,e):IM,[t,n]),()=>kM(n).now);return(t?i:Date.now())-r}function RM({to:e,children:t,...n}){let r=Wj(e),i=-LM({initialTime:r,isActive:r>Date.now(),intervalInMs:EM(r-Date.now())});return(0,O.jsx)(Z,{...n,children:t(i>0?qj(i):null)})}function zM({label:e,children:t}){return(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:e}),typeof t==`string`?(0,O.jsx)(Z,{variant:`mono`,children:t}):t]})}function BM(e){return typeof e==`string`||e instanceof String}function VM(e){var t;return typeof e==`object`&&!!e&&(e==null||(t=e.constructor)==null?void 0:t.name)===`Object`}function HM(e,t){return Array.isArray(t)?HM(e,(e,n)=>t.includes(n)):Object.entries(e).reduce((e,n)=>{let[r,i]=n;return t(i,r)&&(e[r]=i),e},{})}var Q={NONE:`NONE`,LEFT:`LEFT`,FORCE_LEFT:`FORCE_LEFT`,RIGHT:`RIGHT`,FORCE_RIGHT:`FORCE_RIGHT`};function UM(e){switch(e){case Q.LEFT:return Q.FORCE_LEFT;case Q.RIGHT:return Q.FORCE_RIGHT;default:return e}}function WM(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,`\\$1`)}function GM(e,t){if(t===e)return!0;let n=Array.isArray(t),r=Array.isArray(e),i;if(n&&r){if(t.length!=e.length)return!1;for(i=0;i<t.length;i++)if(!GM(t[i],e[i]))return!1;return!0}if(n!=r)return!1;if(t&&e&&typeof t==`object`&&typeof e==`object`){let n=t instanceof Date,r=e instanceof Date;if(n&&r)return t.getTime()==e.getTime();if(n!=r)return!1;let a=t instanceof RegExp,o=e instanceof RegExp;if(a&&o)return t.toString()==e.toString();if(a!=o)return!1;let s=Object.keys(t);for(i=0;i<s.length;i++)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=0;i<s.length;i++)if(!GM(e[s[i]],t[s[i]]))return!1;return!0}return t&&e&&typeof t==`function`&&typeof e==`function`?t.toString()===e.toString():!1}var KM=class{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Q.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?Q.RIGHT:Q.LEFT}};function qM(e,t){return new qM.InputMask(e,t)}function JM(e){if(e==null)throw Error(`mask property should be defined`);return e instanceof RegExp?qM.MaskedRegExp:BM(e)?qM.MaskedPattern:e===Date?qM.MaskedDate:e===Number?qM.MaskedNumber:Array.isArray(e)||e===Array?qM.MaskedDynamic:qM.Masked&&e.prototype instanceof qM.Masked?e:qM.Masked&&e instanceof qM.Masked?e.constructor:e instanceof Function?qM.MaskedFunction:(console.warn(`Mask not found for mask`,e),qM.Masked)}function YM(e){if(!e)throw Error(`Options in not defined`);if(qM.Masked){if(e.prototype instanceof qM.Masked)return{mask:e};let{mask:t=void 0,...n}=e instanceof qM.Masked?{mask:e}:VM(e)&&e.mask instanceof qM.Masked?e:{};if(t){let e=t.mask;return{...HM(t,(e,t)=>!t.startsWith(`_`)),mask:t.constructor,_mask:e,...n}}}return VM(e)?{...e}:{mask:e}}function XM(e){if(qM.Masked&&e instanceof qM.Masked)return e;let t=YM(e),n=JM(t.mask);if(!n)throw Error(`Masked class is not found for provided mask `+t.mask+`, appropriate module needs to be imported manually before creating mask.`);return t.mask===n&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new n(t)}qM.createMask=XM;var ZM=class{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,t){if(!(e==null||t==null||e===this.selectionStart&&t===this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}};qM.MaskElement=ZM;var QM=90,$M=89,eN=class extends ZM{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e;return(e=this.input).getRootNode?.call(e)??document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener(`keydown`,this._onKeydown),this.input.addEventListener(`input`,this._onInput),this.input.addEventListener(`beforeinput`,this._onBeforeinput),this.input.addEventListener(`compositionend`,this._onCompositionEnd),this.input.addEventListener(`drop`,e.drop),this.input.addEventListener(`click`,e.click),this.input.addEventListener(`focus`,e.focus),this.input.addEventListener(`blur`,e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===QM&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===$M&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===QM&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType===`historyUndo`&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType===`historyRedo`&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener(`keydown`,this._onKeydown),this.input.removeEventListener(`input`,this._onInput),this.input.removeEventListener(`beforeinput`,this._onBeforeinput),this.input.removeEventListener(`compositionend`,this._onCompositionEnd),this.input.removeEventListener(`drop`,this._handlers.drop),this.input.removeEventListener(`click`,this._handlers.click),this.input.removeEventListener(`focus`,this._handlers.focus),this.input.removeEventListener(`blur`,this._handlers.commit),this._handlers={}}};qM.HTMLMaskElement=eN;var tN=class extends eN{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart==null?this.value.length:this.input.selectionStart}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}};qM.HTMLMaskElement=eN;var nN=class extends eN{get _unsafeSelectionStart(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||n==null||n<r?n:r}get _unsafeSelectionEnd(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),n=t&&t.anchorOffset,r=t&&t.focusOffset;return r==null||n==null||n>r?n:r}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;let n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,t);let r=this.rootElement,i=r.getSelection&&r.getSelection();i&&(i.removeAllRanges(),i.addRange(n))}get value(){return this.input.textContent||``}set value(e){this.input.textContent=e}};qM.HTMLContenteditableMaskElement=nN;var rN=class e{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>e.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}};rN.MAX_LENGTH=100,qM.InputMask=class{constructor(e,t){this.el=e instanceof ZM?e:e.isContentEditable&&e.tagName!==`INPUT`&&e.tagName!==`TEXTAREA`?new nN(e):new tN(e),this.masked=XM(t),this._listeners={},this._value=``,this._unmaskedValue=``,this._rawInputValue=``,this.history=new rN,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(e){return e==null||this.masked?.maskEquals(e)}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof qM.Masked)&&this.masked.constructor===JM(e)){this.masked.updateOptions({mask:e});return}let t=e instanceof qM.Masked?e:XM({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl(`auto`))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl(`auto`))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl(`auto`))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){let n=this._listeners[e];n&&n.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){let t=this.masked.unmaskedValue,n=this.masked.value,r=this.masked.rawInputValue,i=this.displayValue,a=this.unmaskedValue!==t||this.value!==n||this._rawInputValue!==r;this._unmaskedValue=t,this._value=n,this._rawInputValue=r,this.el.value!==i&&(this.el.value=i),e===`auto`?this.alignCursor():e!=null&&(this.cursorPos=e),a&&this._fireChangeEvents(),!this._historyChanging&&(a||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){let{mask:t,...n}=e,r=!this.maskEquals(t),i=this.masked.optionsIsChanged(n);r&&(this.mask=t),i&&this.masked.updateOptions(n),(r||i)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent(`accept`,this._inputEvent),this.masked.isComplete&&this._fireEvent(`complete`,this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Q.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;let n=this._listeners[e].indexOf(t);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();let t=new KM({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,r=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,i=n===this.masked.rawInputValue?t.removeDirection:Q.NONE,a=this.masked.nearestInputPos(t.startChangePos+r,i);i!==Q.NONE&&(a=this.masked.nearestInputPos(a,Q.NONE)),this.updateControl(a),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};var iN=class e{static normalize(t){return Array.isArray(t)?t:[t,new e]}constructor(e){Object.assign(this,{inserted:``,rawInserted:``,tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}};qM.ChangeDetails=iN;var aN=class{constructor(e,t,n){e===void 0&&(e=``),t===void 0&&(t=0),this.value=e,this.from=t,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return``;let t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return``;let e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}},oN=class e{constructor(t){this._value=``,this._update({...e.DEFAULTS,...t}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=``}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){t===void 0&&(t={input:!0}),this.reset(),this.append(e,t,``),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new aN(this.extractInput(e,t),e)}appendTail(e){return BM(e)&&(e=new aN(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new iN({inserted:e,rawInserted:e})):new iN}_appendChar(e,t,n){t===void 0&&(t={});let r=this.state,i;if([e,i]=this.doPrepareChar(e,t),e&&(i=i.aggregate(this._appendCharRaw(e,t)),!i.rawInserted&&this.autofix===`pad`)){let n=this.state;this.state=r;let a=this.pad(t),o=this._appendCharRaw(e,t);a=a.aggregate(o),o.rawInserted||a.equals(i)?i=a:this.state=n}if(i.inserted){let e,a=this.doValidate(t)!==!1;if(a&&n!=null){let t=this.state;if(this.overwrite===!0){e=n.state;for(let e=0;e<i.rawInserted.length;++e)n.unshift(this.displayValue.length-i.tailShift)}let r=this.appendTail(n);if(a=r.rawInserted.length===n.toString().length,!(a&&r.inserted)&&this.overwrite===`shift`){this.state=t,e=n.state;for(let e=0;e<i.rawInserted.length;++e)n.shift();r=this.appendTail(n),a=r.rawInserted.length===n.toString().length}a&&r.inserted&&(this.state=t)}a||(i=new iN,this.state=r,n&&e&&(n.state=e))}return i}_appendPlaceholder(){return new iN}_appendEager(){return new iN}append(e,t,n){if(!BM(e))throw Error(`value should be string`);let r=BM(n)?new aN(String(n)):n;t!=null&&t.tail&&(t._beforeTailState=this.state);let i;[e,i]=this.doPrepare(e,t);for(let n=0;n<e.length;++n){let a=this._appendChar(e[n],t,r);if(!a.rawInserted&&!this.doSkipInvalid(e[n],t,r))break;i.aggregate(a)}return(this.eager===!0||this.eager===`append`)&&t!=null&&t.input&&e&&i.aggregate(this._appendEager()),r!=null&&(i.tailShift+=this.appendTail(r).tailShift),i}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new iN}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;let t=this.rawInputValue,n=this.value,r=e();return this.rawInputValue=t,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},``),this.doCommit()),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;let t=this.state,n=e(this);return this.state=t,delete this._isolated,n}doSkipInvalid(e,t,n){return!!this.skipInvalid}doPrepare(e,t){return t===void 0&&(t={}),iN.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return t===void 0&&(t={}),iN.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,n,r,i){n===void 0&&(n=``),r===void 0&&(r=Q.NONE),i===void 0&&(i={input:!0});let a=e+t,o=this.extractTail(a),s=this.eager===!0||this.eager===`remove`,c;s&&(r=UM(r),c=this.extractInput(0,a,{raw:!0}));let l=e,u=new iN;if(r!==Q.NONE&&(l=this.nearestInputPos(e,t>1&&e!==0&&!s?Q.NONE:r),u.tailShift=l-e),u.aggregate(this.remove(l)),s&&r!==Q.NONE&&c===this.rawInputValue){if(r===Q.FORCE_LEFT){let e;for(;c===this.rawInputValue&&(e=this.displayValue.length);)u.aggregate(new iN({tailShift:-1})).aggregate(this.remove(e-1))}else r===Q.FORCE_RIGHT&&o.unshift()}return u.aggregate(this.append(n,i,o))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!GM(this,e)}typedValueEquals(t){let n=this.typedValue;return t===n||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(n)||(this.format?this.format(t,this)===this.format(this.typedValue,this):!1)}pad(e){return new iN}};oN.DEFAULTS={skipInvalid:!0},oN.EMPTY_VALUES=[void 0,null,``],qM.Masked=oN;var sN=class e{constructor(e,t){e===void 0&&(e=[]),t===void 0&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join(``)}extend(t){if(!String(t))return;t=BM(t)?new aN(String(t)):t;let n=this.chunks[this.chunks.length-1],r=n&&(n.stop===t.stop||t.stop==null)&&t.from===n.from+n.toString().length;if(t instanceof aN)r?n.extend(t.toString()):this.chunks.push(t);else if(t instanceof e){if(t.stop==null){let e;for(;t.chunks.length&&t.chunks[0].stop==null;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof qM.MaskedPattern))return new aN(this.toString()).appendTo(t);let n=new iN;for(let r=0;r<this.chunks.length;++r){let i=this.chunks[r],a=t._mapPosToBlock(t.displayValue.length),o=i.stop,s;if(o!=null&&(!a||a.index<=o)&&((i instanceof e||t._stops.indexOf(o)>=0)&&n.aggregate(t._appendPlaceholder(o)),s=i instanceof e&&t._blocks[o]),s){let e=s.appendTail(i);n.aggregate(e);let r=i.toString().slice(e.rawInserted.length);r&&n.aggregate(t.append(r,{tail:!0}))}else n.aggregate(t.append(i.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){let{chunks:n,...r}=t;Object.assign(this,r),this.chunks=n.map(t=>{let n=`chunks`in t?new e:new aN;return n.state=t,n})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return``;let t=e==null?e:e-this.from,n=0;for(;n<this.chunks.length;){let e=this.chunks[n],r=e.unshift(t);if(e.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return``}shift(){if(!this.chunks.length)return``;let e=this.chunks.length-1;for(;0<=e;){let t=this.chunks[e],n=t.shift();if(t.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return``}},cN=class{constructor(e,t){this.masked=e,this._log=[];let{offset:n,index:r}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){let e=this._log.pop();return e&&(this.state=e),e}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(t=this.block)?.displayValue.length||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,Q.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Q.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Q.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,Q.FORCE_RIGHT),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Q.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Q.NONE),!0})}},lN=class{constructor(e){Object.assign(this,e),this._value=``,this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:``}get rawInputValue(){return this._isRawInput?this.value:``}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=``}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new iN}nearestInputPos(e,t){t===void 0&&(t=Q.NONE);let n=this._value.length;switch(t){case Q.LEFT:case Q.FORCE_LEFT:return 0;case Q.NONE:case Q.RIGHT:case Q.FORCE_RIGHT:default:return n}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(e,t)||``}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new iN;let n=this.eager===!0||this.eager===`append`,r=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!n)&&!t.tail,i=new iN({inserted:this.char,rawInserted:r?this.char:``});return this._value=this.char,this._isRawInput=r&&(t.raw||t.input),i}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let e=new iN;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new aN(``)}appendTail(e){return BM(e)&&(e=new aN(String(e))),e.appendTo(this)}append(e,t,n){let r=this._appendChar(e[0],t);return n!=null&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}},uN=class{constructor(e){let{parent:t,isOptional:n,placeholderChar:r,displayChar:i,lazy:a,eager:o,...s}=e;this.masked=XM(s),Object.assign(this,{parent:t,isOptional:n,placeholderChar:r,displayChar:i,lazy:a,eager:o})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),e===0&&t>=1?(this.isFilled=!1,this.masked.remove(e,t)):new iN}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:``)}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(t===void 0&&(t={}),this.isFilled)return new iN;let n=this.masked.state,r=this.masked._appendChar(e,this.currentMaskFlags(t));return r.inserted&&this.doValidate(t)===!1&&(r=new iN,this.masked.state=n),!r.inserted&&!this.isOptional&&!this.lazy&&!t.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(e,t,n){return this.masked.append(e,this.currentMaskFlags(t),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new iN:(this.isFilled=!0,new iN({inserted:this.placeholderChar}))}_appendEager(){return new iN}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.masked.extractInput(e,t,n)}nearestInputPos(e,t){t===void 0&&(t=Q.NONE);let n=this.value.length,r=Math.min(Math.max(e,0),n);switch(t){case Q.LEFT:case Q.FORCE_LEFT:return this.isComplete?r:0;case Q.RIGHT:case Q.FORCE_RIGHT:return this.isComplete?r:n;case Q.NONE:default:return r}}totalInputPositions(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(e==null||(t=e._beforeTailState)==null?void 0:t.masked)||e?._beforeTailState}}pad(e){return new iN}};uN.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},qM.MaskedRegExp=class extends oN{updateOptions(e){super.updateOptions(e)}_update(e){let t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}};var dN=class e extends oN{constructor(t){super({...e.DEFAULTS,...t,definitions:Object.assign({},uN.DEFAULT_DEFINITIONS,t?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){let t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let n=this.mask;if(!n||!t)return;let r=!1,i=!1;for(let a=0;a<n.length;++a){if(this.blocks){let e=n.slice(a),t=Object.keys(this.blocks).filter(t=>e.indexOf(t)===0);t.sort((e,t)=>t.length-e.length);let r=t[0];if(r){let{expose:e,repeat:t,...n}=YM(this.blocks[r]),i={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...n,repeat:t,parent:this},o=t==null?XM(i):new qM.RepeatBlock(i);o&&(this._blocks.push(o),e&&(this.exposeBlock=o),this._maskedBlocks[r]||(this._maskedBlocks[r]=[]),this._maskedBlocks[r].push(this._blocks.length-1)),a+=r.length-1;continue}}let o=n[a],s=o in t;if(o===e.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o===`{`||o===`}`){r=!r;continue}if(o===`[`||o===`]`){i=!i;continue}if(o===e.ESCAPE_CHAR){if(++a,o=n[a],!o)break;s=!1}let c=s?new uN({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...YM(t[o]),parent:this}):new lN({char:o,eager:this.eager,isUnmasking:r});this._blocks.push(c)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}let{_blocks:t,...n}=e;this._blocks.forEach((e,n)=>e.state=t[n]),super.state=n}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,``)}set unmaskedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,``)}set value(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,``)}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){let e=new iN,t=this._mapPosToBlock(this.displayValue.length)?.index;if(t==null)return e;this._blocks[t].isFilled&&++t;for(let n=t;n<this._blocks.length;++n){let t=this._blocks[n]._appendEager();if(!t.inserted)break;e.aggregate(t)}return e}_appendCharRaw(e,t){t===void 0&&(t={});let n=this._mapPosToBlock(this.displayValue.length),r=new iN;if(!n)return r;for(let a=n.index,o;o=this._blocks[a];++a){var i;let n=o._appendChar(e,{...t,_beforeTailState:(i=t._beforeTailState)==null||(i=i._blocks)==null?void 0:i[a]});if(r.aggregate(n),n.consumed)break}return r}extractTail(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=new sN;return e===t||this._forEachBlocksInRange(e,t,(e,t,r,i)=>{let a=e.extractTail(r,i);a.stop=this._findStopBefore(t),a.from=this._blockStartPos(t),a instanceof sN&&(a.blockIndex=t),n.extend(a)}),n}extractInput(e,t,n){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),n===void 0&&(n={}),e===t)return``;let r=``;return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{r+=e.extractInput(i,a,n)}),r}_findStopBefore(e){let t;for(let n=0;n<this._stops.length;++n){let r=this._stops[n];if(r<=e)t=r;else break}return t}_appendPlaceholder(e){let t=new iN;if(this.lazy&&e==null)return t;let n=this._mapPosToBlock(this.displayValue.length);if(!n)return t;let r=n.index,i=e??this._blocks.length;return this._blocks.slice(r,i).forEach(n=>{(!n.lazy||e!=null)&&t.aggregate(n._appendPlaceholder(n._blocks?.length))}),t}_mapPosToBlock(e){let t=``;for(let n=0;n<this._blocks.length;++n){let r=this._blocks[n],i=t.length;if(t+=r.displayValue,e<=t.length)return{index:n,offset:e-i}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+=t.displayValue.length,0)}_forEachBlocksInRange(e,t,n){t===void 0&&(t=this.displayValue.length);let r=this._mapPosToBlock(e);if(r){let e=this._mapPosToBlock(t),i=e&&r.index===e.index,a=r.offset,o=e&&i?e.offset:this._blocks[r.index].displayValue.length;if(n(this._blocks[r.index],r.index,a,o),e&&!i){for(let t=r.index+1;t<e.index;++t)n(this._blocks[t],t,0,this._blocks[t].displayValue.length);n(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,r,i)=>{n.aggregate(e.remove(r,i))}),n}nearestInputPos(e,t){if(t===void 0&&(t=Q.NONE),!this._blocks.length)return 0;let n=new cN(this,e);if(t===Q.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(t===Q.LEFT||t===Q.FORCE_LEFT){if(t===Q.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),t===Q.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:t===Q.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return t===Q.RIGHT||t===Q.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:t===Q.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,Q.LEFT))):e}totalInputPositions(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,t,(e,t,r,i)=>{n+=e.totalInputPositions(r,i)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){let t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){let t=new iN;return this._forEachBlocksInRange(0,this.displayValue.length,n=>t.aggregate(n.pad(e))),t}};dN.DEFAULTS={...oN.DEFAULTS,lazy:!0,placeholderChar:`_`},dN.STOP_CHAR="`",dN.ESCAPE_CHAR=`\\`,dN.InputDefinition=uN,dN.FixedDefinition=lN,qM.MaskedPattern=dN;var fN=class extends dN{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){let{to:t=this.to||0,from:n=this.from||0,maxLength:r=this.maxLength||0,autofix:i=this.autofix,...a}=e;this.to=t,this.from=n,this.maxLength=Math.max(String(t).length,r),this.autofix=i;let o=String(this.from).padStart(this.maxLength,`0`),s=String(this.to).padStart(this.maxLength,`0`),c=0;for(;c<s.length&&s[c]===o[c];)++c;a.mask=s.slice(0,c).replace(/0/g,`\\0`)+`0`.repeat(this.maxLength-c),super._update(a)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t=``,n=``,[,r,i]=e.match(/^(\D*)(\d*)(\D*)/)||[];return i&&(t=`0`.repeat(r.length)+i,n=`9`.repeat(r.length)+i),t=t.padEnd(this.maxLength,`0`),n=n.padEnd(this.maxLength,`9`),[t,n]}doPrepareChar(e,t){t===void 0&&(t={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,``),t),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,t){if(t===void 0&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);let n=String(this.from).padStart(this.maxLength,`0`),r=String(this.to).padStart(this.maxLength,`0`),[i,a]=this.boundaries(this.value+e);return Number(a)<this.from?super._appendCharRaw(n[this.value.length],t):Number(i)>this.to?!t.tail&&this.autofix===`pad`&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(r[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){let t=this.value;if(t.search(/[^0]/)===-1&&t.length<=this._matchFrom)return!0;let[n,r]=this.boundaries(t);return this.from<=Number(r)&&Number(n)<=this.to&&super.doValidate(e)}pad(e){let t=new iN;if(this.value.length===this.maxLength)return t;let n=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let n=0;n<r;++n)t.aggregate(super._appendCharRaw(`0`,e));n.split(``).forEach(e=>this._appendCharRaw(e))}return t}};qM.MaskedRange=fN;var pN="d{.}`m{.}`Y",mN=class e extends dN{static extractPatternOptions(e){let{mask:t,pattern:n,...r}=e;return{...r,mask:BM(t)?t:n}}constructor(t){super(e.extractPatternOptions({...e.DEFAULTS,...t}))}updateOptions(e){super.updateOptions(e)}_update(t){let{mask:n,pattern:r,blocks:i,...a}={...e.DEFAULTS,...t},o=Object.assign({},e.GET_DEFAULT_BLOCKS());t.min&&(o.Y.from=t.min.getFullYear()),t.max&&(o.Y.to=t.max.getFullYear()),t.min&&t.max&&o.Y.from===o.Y.to&&(o.m.from=t.min.getMonth()+1,o.m.to=t.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=t.min.getDate(),o.d.to=t.max.getDate())),Object.assign(o,this.blocks,i),super._update({...a,mask:BM(n)?n:r,blocks:o})}doValidate(e){let t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&t!=null&&(this.min==null||this.min<=t)&&(this.max==null||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(t){return super.optionsIsChanged(e.extractPatternOptions(t))}};mN.GET_DEFAULT_BLOCKS=()=>({d:{mask:fN,from:1,to:31,maxLength:2},m:{mask:fN,from:1,to:12,maxLength:2},Y:{mask:fN,from:1900,to:9999}}),mN.DEFAULTS={...dN.DEFAULTS,mask:Date,pattern:pN,format:(e,t)=>e?[String(e.getDate()).padStart(2,`0`),String(e.getMonth()+1).padStart(2,`0`),e.getFullYear()].join(`.`):``,parse:(e,t)=>{let[n,r,i]=e.split(`.`).map(Number);return new Date(i,r-1,n)}},qM.MaskedDate=mN;var hN=class e extends oN{constructor(t){super({...e.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),`mask`in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{let{expose:t,...n}=YM(e),r=XM({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...n});return t&&(this.exposeMask=r),r}):[])}_appendCharRaw(e,t){t===void 0&&(t={});let n=this._applyDispatch(e,t);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),n}_applyDispatch(e,t,n){e===void 0&&(e=``),t===void 0&&(t={}),n===void 0&&(n=``);let r=t.tail&&t._beforeTailState!=null?t._beforeTailState._value:this.value,i=this.rawInputValue,a=t.tail&&t._beforeTailState!=null?t._beforeTailState._rawInputValue:i,o=i.slice(a.length),s=this.currentMask,c=new iN,l=s?.state;return this.currentMask=this.doDispatch(e,{...t},n),this.currentMask&&(this.currentMask===s?l&&(this.currentMask.state=l):(this.currentMask.reset(),a&&(this.currentMask.append(a,{raw:!0}),c.tailShift=this.currentMask.value.length-r.length),o&&(c.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift))),c}_appendPlaceholder(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){let t=new iN;return e&&t.aggregate(this._applyDispatch(``,{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){return{...e,_beforeTailState:e._beforeTailState?.currentMaskRef===this.currentMask&&e._beforeTailState?.currentMask||e._beforeTailState}}doDispatch(e,t,n){return t===void 0&&(t={}),n===void 0&&(n=``),this.dispatch(e,this,t,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){t===void 0&&(t={});let[n,r]=super.doPrepare(e,t);if(this.currentMask){let e;[n,e]=super.doPrepare(n,this.currentMaskFlags(t)),r=r.aggregate(e)}return[n,r]}doPrepareChar(e,t){t===void 0&&(t={});let[n,r]=super.doPrepareChar(e,t);if(this.currentMask){let e;[n,e]=super.doPrepareChar(n,this.currentMaskFlags(t)),r=r.aggregate(e)}return[n,r]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:``}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:``}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:``}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:``}get isComplete(){return!!this.currentMask?.isComplete}get isFilled(){return!!this.currentMask?.isFilled}remove(e,t){let n=new iN;return this.currentMask&&n.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),n}get state(){return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:this.currentMask?.state}}set state(e){let{compiledMasks:t,currentMaskRef:n,currentMask:r,...i}=e;t&&this.compiledMasks.forEach((e,n)=>e.state=t[n]),n!=null&&(this.currentMask=n,this.currentMask.state=r),super.state=i}extractInput(e,t,n){return this.currentMask?this.currentMask.extractInput(e,t,n):``}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,n)=>{if(!e[n])return;let{mask:r,...i}=e[n];return GM(t,i)&&t.maskEquals(r)}):super.maskEquals(e)}typedValueEquals(e){return!!this.currentMask?.typedValueEquals(e)}};hN.DEFAULTS={...oN.DEFAULTS,dispatch:(e,t,n,r)=>{if(!t.compiledMasks.length)return;let i=t.rawInputValue,a=t.compiledMasks.map((a,o)=>{let s=t.currentMask===a,c=s?a.displayValue.length:a.nearestInputPos(a.displayValue.length,Q.FORCE_LEFT);return a.rawInputValue===i?s||a.remove(c):(a.reset(),a.append(i,{raw:!0})),a.append(e,t.currentMaskFlags(n)),a.appendTail(r),{index:o,weight:a.rawInputValue.length,totalInputPositions:a.totalInputPositions(0,Math.max(c,a.nearestInputPos(a.displayValue.length,Q.FORCE_LEFT)))}});return a.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[a[0].index]}},qM.MaskedDynamic=hN;var gN=class e extends dN{constructor(t){super({...e.DEFAULTS,...t})}updateOptions(e){super.updateOptions(e)}_update(e){let{enum:t,...n}=e;if(t){let e=t.map(e=>e.length),r=Math.min(...e),i=Math.max(...e)-r;n.mask=`*`.repeat(r),i&&(n.mask+=`[`+`*`.repeat(i)+`]`),this.enum=t}super._update(n)}_appendCharRaw(e,t){t===void 0&&(t={});let n=Math.min(this.nearestInputPos(0,Q.FORCE_RIGHT),this.value.length),r=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,n));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(e,n)=>{let i=r[0][n];n>=this.value.length||i===e.value||(e.reset(),e._appendChar(i,t))});let e=super._appendCharRaw(r[0][this.value.length],t);return r.length===1&&r[0].slice(this.unmaskedValue.length).split(``).forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new iN({skip:!this.isComplete})}extractTail(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),new aN(``,e)}remove(e,t){if(e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),e===t)return new iN;let n=Math.min(super.nearestInputPos(0,Q.FORCE_RIGHT),this.value.length),r;for(r=e;r>=0&&!(this.enum.filter(e=>this.matchValue(e,this.value.slice(n,r),n)).length>1);--r);let i=super.remove(r,t);return i.tailShift+=r-e,i}get isComplete(){return this.enum.indexOf(this.value)>=0}};gN.DEFAULTS={...dN.DEFAULTS,matchValue:(e,t,n)=>e.indexOf(t,n)===n},qM.MaskedEnum=gN,qM.MaskedFunction=class extends oN{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}};var _N,vN=class e extends oN{constructor(t){super({...e.DEFAULTS,...t})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e=`^`+(this.allowNegative?`[+|\\-]?`:``),t=(this.scale?`(`+WM(this.radix)+`\\d{0,`+this.scale+`})?`:``)+`$`;this._numberRegExp=RegExp(e+`\\d*`+t),this._mapToRadixRegExp=RegExp(`[`+this.mapToRadix.map(WM).join(``)+`]`,`g`),this._thousandsSeparatorRegExp=new RegExp(WM(this.thousandsSeparator),`g`)}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,``)}_insertThousandsSeparators(e){let t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){t===void 0&&(t={});let[n,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!n&&(r.skip=!0),n&&!this.allowPositive&&!this.value&&n!==`-`&&r.aggregate(this._appendChar(`-`)),[n,r]}_separatorsCount(e,t){t===void 0&&(t=!1);let n=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,t&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,n))}_appendCharRaw(t,n){n===void 0&&(n={});let r=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,i=this._separatorsCountFromSlice(r);this._value=this._removeThousandsSeparators(this.value);let a=this._value;this._value+=t;let o=this.number,s=!isNaN(o),c=!1;if(s){let t;this.min!=null&&this.min<0&&this.number<this.min&&(t=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(t=this.max),t!=null&&(this.autofix?(this._value=this.format(t,this).replace(e.UNMASKED_RADIX,this.radix),c||=a===this._value&&!n.tail):s=!1),s&&=!!this._value.match(this._numberRegExp)}let l;s?l=new iN({inserted:this._value.slice(a.length),rawInserted:c?``:t,skip:c}):(this._value=a,l=new iN),this._value=this._insertThousandsSeparators(this._value);let u=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(u);return l.tailShift+=(d-i)*this.thousandsSeparator.length,l}_findSeparatorAround(e){if(this.thousandsSeparator){let t=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,t);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,t){let n=this._findSeparatorAround(e);n>=0&&(e=n);let r=this._findSeparatorAround(t);return r>=0&&(t=r+this.thousandsSeparator.length),[e,t]}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);let n=this.value.slice(0,e),r=this.value.slice(t),i=this._separatorsCount(n.length);return this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+r)),new iN({tailShift:(this._separatorsCountFromSlice(n)-i)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case Q.NONE:case Q.LEFT:case Q.FORCE_LEFT:{let n=this._findSeparatorAround(e-1);if(n>=0){let r=n+this.thousandsSeparator.length;if(e<r||this.value.length<=r||t===Q.FORCE_LEFT)return n}break}case Q.RIGHT:case Q.FORCE_RIGHT:{let t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){let e=this.number,t=e;this.min!=null&&(t=Math.max(t,this.min)),this.max!=null&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){let t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,n,r)=>t+r),e.length&&!/\d$/.test(t[0])&&(t[0]+=`0`),t.length>1&&(t[1]=t[1].replace(/0*$/,``),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;let t=e.split(this.radix);return t.length<2&&t.push(``),t[1]=t[1].padEnd(this.scale,`0`),t.join(this.radix)}doSkipInvalid(t,n,r){n===void 0&&(n={});let i=this.scale===0&&t!==this.thousandsSeparator&&(t===this.radix||t===e.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,n,r)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,e.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(e.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return this.min!=null&&this.min<0||this.max!=null&&this.max<0}get allowPositive(){return this.min!=null&&this.min>0||this.max!=null&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||e.EMPTY_VALUES.includes(t)&&e.EMPTY_VALUES.includes(this.typedValue))&&(t!==0||this.value!==``)}};_N=vN,vN.UNMASKED_RADIX=`.`,vN.EMPTY_VALUES=[...oN.EMPTY_VALUES,0],vN.DEFAULTS={...oN.DEFAULTS,mask:Number,radix:`,`,thousandsSeparator:``,mapToRadix:[_N.UNMASKED_RADIX],min:-(2**53-1),max:2**53-1,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString(`en-US`,{useGrouping:!1,maximumFractionDigits:20})},qM.MaskedNumber=vN;var yN={MASKED:`value`,UNMASKED:`unmaskedValue`,TYPED:`typedValue`};function bN(e,t,n){t===void 0&&(t=yN.MASKED),n===void 0&&(n=yN.MASKED);let r=XM(e);return e=>r.runIsolated(r=>(r[t]=e,r[n]))}function xN(e,t,n,r){return bN(t,n,r)(e)}qM.PIPE_TYPE=yN,qM.createPipe=bN,qM.pipe=xN,qM.RepeatBlock=class extends dN{get repeatFrom(){return(Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)??0}get repeatTo(){return(Array.isArray(this.repeat)?this.repeat[1]:this.repeat)??1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){let{repeat:t,...n}=YM(e);this._blockOpts=Object.assign({},this._blockOpts,n);let r=XM(this._blockOpts);this.repeat=t??r.repeat??this.repeat??1/0,super._update({mask:`m`.repeat(Math.max(this.repeatTo===1/0&&this._blocks?.length||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(XM(this._blockOpts)),this.mask+=`m`,this._blocks[this._blocks.length-1]}_appendCharRaw(e,t){t===void 0&&(t={});let n=new iN;for(let s=(r=(i=this._mapPosToBlock(this.displayValue.length))?.index)??Math.max(this._blocks.length-1,0),c,l;c=(a=this._blocks[s])??(l=!l&&this._allocateBlock(s));++s){var r,i,a,o;let u=c._appendChar(e,{...t,_beforeTailState:(o=t._beforeTailState)==null||(o=o._blocks)==null?void 0:o[s]});if(u.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(u),u.consumed)break}return n}_trimEmptyTail(e,t){e===void 0&&(e=0);let n=Math.max(this._mapPosToBlock(e)?.index||0,this.repeatFrom,0),r;t!=null&&(r=this._mapPosToBlock(t)?.index),r??=this._blocks.length-1;let i=0;for(let e=r;n<=e&&!this._blocks[e].unmaskedValue;--e,++i);i&&(this._blocks.splice(r-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){e===void 0&&(e=0),t===void 0&&(t=this.displayValue.length);let n=super.remove(e,t);return this._trimEmptyTail(e,t),n}totalInputPositions(e,t){return e===void 0&&(e=0),t==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}};try{globalThis.IMask=qM}catch{}var SN=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m21.426 11.095-17-8A.999.999 0 0 0 3.03 4.242L4.969 12 3.03 19.758a.998.998 0 0 0 1.396 1.147l17-8a1 1 0 0 0 0-1.81zM5.481 18.197l.839-3.357L12 12 6.32 9.16l-.839-3.357L18.651 12l-13.17 6.197z`})}));function CN({placeholder:e,value:t,defaultValue:n,mask:r,onChange:i,onChangeText:a,isReadOnly:o=!1,actions:s,enableSubmitButton:c=!1,enableEmptySubmit:l=!1,submitButtonIcon:u=SN,onSubmit:d,onSubmitEditing:f,onFocus:p,onBlur:m,onKeyPress:h,style:g,nativeTextInputStyle:_,isMultiline:v=!1,maxLines:y,minLines:x,...S}){let w=(0,b.useRef)(null),T=(0,b.useId)(),[E,D]=(0,b.useState)(!1),[k,ee]=(0,b.useState)(()=>t===void 0?n===void 0?``:n:t),[A,te]=(0,b.useState)(0),ne=(0,b.useMemo)(()=>!o&&E,[E,o]),re=(0,b.useCallback)(e=>{te(e.nativeEvent.layout.height)},[]),ie=(0,b.useMemo)(()=>{if(v)return 17*(y??1)},[v,y]),j=(0,b.useMemo)(()=>{if(v)return 17*(x??1)},[v,x]),M=(0,b.useMemo)(()=>{if(v)return Math.min(Math.max(A,17,j),ie)},[v,A,j,ie]),ae=(0,b.useMemo)(()=>r?Array.isArray(r)?r:[r]:[],Array.isArray(r)?r:[r]),oe=(0,b.useMemo)(()=>{if(ae.length)return XM({mask:ae})},[ae]),se=(0,b.useMemo)(()=>{let e=t===void 0?k===void 0?``:k:t;return oe?(oe.resolve(e),oe.value):e},[oe,t,k]),N=C(),ce=(0,b.useCallback)(e=>{D(!0),p?.(e)},[p]),le=(0,b.useCallback)(e=>{D(!1),m?.(e)},[m]),ue=(0,b.useCallback)(e=>{oe&&oe.resolve(e);let t=oe?oe.unmaskedValue:e;i?.(t,oe?.value),ee(t),a?.(t)},[oe,i,a]),de=xj(ne?`text-input.color.outline.focused`:`text-input.color.outline.blured`,{duration:300}),fe=VA(()=>({borderColor:de.value}),[de]),pe=(0,b.useCallback)(()=>{w.current?.focus()},[]),me=(0,b.useCallback)(e=>{if(l||se)return d?.(se,e)},[se,d,l]),he=(0,b.useCallback)(e=>{me?.(e),f?.(e)},[me,f]),ge=(0,b.useCallback)(e=>!v||e.nativeEvent.key!==`Enter`||e.nativeEvent.shiftKey?h?.(e):(e.preventDefault(),me?.(e)),[me,v,h]);return(0,O.jsxs)(q,{as:_j.of(dv),px:`text-input.padding-x`,py:`text-input.padding-y`,bg:`text-input.color.background`,borderWidth:1,style:[fe,g],row:!0,rounded:!0,align:`end`,onPress:pe,gap:`space.050`,children:[(0,O.jsxs)(q,{position:`relative`,flex:1,children:[v&&(0,O.jsx)(fx,{onLayout:re,style:[{opacity:0,position:`absolute`,insetInline:0,lineHeight:17,zIndex:-1}],children:se?.length?se:` `}),(0,O.jsx)(q,{ref:w,...S,as:vv,multiline:v,placeholder:e,placeholderTextColor:N.tokens.get(`text-input.color.placeholder`),value:se,onChangeText:ue,onFocus:ce,onBlur:le,onKeyPress:ge,style:[{outlineStyle:`none`},{padding:0},{fontSize:N.tokens.get(`text-input.font.size`),color:N.tokens.get(`text-input.color.text`),fontFamily:N.tokens.get(`font.family.body`)},{height:M},_],readOnly:o,focusable:!o,onSubmitEditing:he})]}),s?.map(({onPress:e,icon:t,isDisabled:n=!1,isHidden:r=!1},i)=>r?null:(0,O.jsx)(q,{as:dv,onPress:e,disabled:n,children:(0,O.jsx)(t,{fill:`text-input.action.color.icon`,size:`md`})},`text-input:${T}:actions:${i}`)),c&&(0,O.jsx)(q,{as:dv,onPress:me,children:(0,O.jsx)(u,{fill:`text-input.action.color.icon`,size:`md`})})]})}E.get().tokens.set({"text-input.padding-x":`@space.150`,"text-input.padding-y":`@space.100`,"text-input.color.outline.blured":`#FFFFFF00`,"text-input.color.outline.focused":`@color.background.brand.bold`,"text-input.color.placeholder":[`@color.text.subtlest`,`#8B8D98`],"text-input.color.text":`@color.text`,"text-input.color.background":`#F7F7F7`,"text-input.font.size":[`@font-size.body.medium`,`14`],"text-input.action.color.icon":`#8B8D98`});function wN({value:e,onChange:t,minLines:n=8,maxLines:r=40,error:i}){return(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(CN,{value:e,onChange:t,isMultiline:!0,minLines:n,maxLines:r,autoCapitalize:`none`,autoCorrect:!1,style:{backgroundColor:J.background}}),i&&(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:i})]})}function TN({title:e,actions:t,children:n}){return(0,O.jsxs)(q,{gap:12,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{variant:`title`,children:e}),t&&(0,O.jsx)(q,{row:!0,align:`center`,gap:12,children:t})]}),n]})}function EN(){let e=A();return vt({mutationFn:({activityId:e,payload:t})=>xS.advanceActivity(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`activities`,`waiting`]}),e.invalidateQueries({queryKey:[`runs`]})}})}function DN(e){if(e instanceof gS){let t=Array.isArray(e.details)?e.details.map(e=>typeof e==`string`?e:Zj(e)):[];return[e.message,...t].join(`
44
- `)}return String(e)}function ON(e){if(!e)return{};if(`default`in e)return e.default;if(`const`in e)return e.const;if(Array.isArray(e.examples)&&e.examples.length)return e.examples[0];if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];let t=e.anyOf??e.oneOf??e.allOf;if(t?.[0])return ON(t[0]);switch(Array.isArray(e.type)?e.type[0]:e.type){case`object`:return Object.fromEntries(Object.entries(e.properties??{}).map(([e,t])=>[e,ON(t)]));case`array`:{let t=Array.isArray(e.items)?e.items[0]:e.items;return t?[ON(t)]:[]}case`string`:return typeof e.format==`string`?kN(e.format):``;case`number`:case`integer`:return typeof e.minimum==`number`?e.minimum:0;case`boolean`:return!1;case`null`:return null;default:return e.properties?ON({...e,type:`object`}):null}}function kN(e){switch(e){case`date-time`:return new Date().toISOString();case`date`:return new Date().toISOString().slice(0,10);case`email`:return`name@example.com`;case`uri`:case`url`:return`https://example.com`;case`uuid`:return`00000000-0000-0000-0000-000000000000`;default:return``}}function AN({activity:e,appId:t}){let[n,r]=(0,b.useState)(()=>Zj(ON(e.schema??null))),[i,a]=(0,b.useState)(null),o=EN(),s=`${oS(`advance`,{project:t??void 0,workflow:e.workflowId,run:e.run,activity:e.id})}?token=<callback token>`,c=()=>{let e=n.trim();return e===``?void 0:JSON.parse(e)};return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,justify:`space-between`,align:`flex-start`,gap:12,children:[(0,O.jsxs)(q,{gap:8,flex:1,minW:0,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:e.type}),(0,O.jsxs)(q,{row:!0,gap:8,style:{flexWrap:`wrap`},children:[(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`activity ${e.id}`}),(0,O.jsx)(hM,{onPress:()=>$j(e.run),children:`run ${e.run}`})]})]}),(0,O.jsx)(sa,{to:`/runs/${e.run}?activity=${e.id}`,style:{textDecoration:`none`},children:(0,O.jsx)(Rj,{appearance:`outline`,text:`Open run`,iconAfter:SM})})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Advance`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Rj,{appearance:rS.capabilities.advance?`ghost`:`outline`,text:`Copy as curl`,onPress:()=>{try{$j(cS(`advance`,s,c())),a(null)}catch(e){a(DN(e))}}}),rS.capabilities.advance&&(0,O.jsx)(Rj,{appearance:`solid`,text:o.isPending?`Advancing…`:`Advance activity`,isDisabled:o.isPending,onPress:async()=>{let t;try{t=c()}catch(e){a(DN(e));return}try{await o.mutateAsync({activityId:e.id,payload:t}),a(null)}catch(e){a(DN(e))}}})]}),children:(0,O.jsxs)(q,{gap:12,children:[(0,O.jsx)(Z,{variant:`label`,children:`Payload`}),(0,O.jsx)(wN,{value:n,onChange:r,error:i,minLines:5}),(0,O.jsx)(Z,{fontSize:12,children:rS.capabilities.advance?`The payload is validated against the schema below before the activity resumes.`:`This host advances through the callback URL: copy the curl, replace the token with the one from the activity, and add any auth the activity declared.`})]})}),(0,O.jsx)(TN,{title:`Details`,children:(0,O.jsxs)(q,{gap:16,children:[(0,O.jsx)(zM,{label:`Workflow`,children:e.workflowId}),(0,O.jsx)(zM,{label:`Pending`,children:e.pending}),(0,O.jsx)(zM,{label:`Times out at`,children:e.timeoutAt===void 0?`never (waits for an external advance)`:(0,O.jsx)(RM,{to:e.timeoutAt,variant:`mono`,children:t=>`${new Date(e.timeoutAt??``).toLocaleString()} (${t===null?`timing out…`:`in ${t}`})`})}),(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Route`}),(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.warn,children:sS(`advance`)}),(0,O.jsx)(Z,{variant:`mono`,children:s})]})]})]})}),(0,O.jsx)(TN,{title:`Expected payload schema`,children:(0,O.jsx)(wM,{value:e.schema?Zj(e.schema):`No schema: any payload is accepted.`,color:e.schema?J.text:J.muted})})]})]})}function jN(e){return Math.max(Math.ceil(e/25)-1,0)*25}function MN(){let[e,t]=(0,b.useState)(0),[n,r]=(0,b.useState)(null),{data:i}=mt(wS.manifest()),{data:a,isPending:o,refetch:s}=mt(wS.waitingActivities({limit:25,offset:e})),c=a?.activities??[],l=a?.count??0,u=Math.min(e,jN(l)),d=c.find(e=>e.id===n)??c[0];return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,justify:`space-between`,align:`center`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Waiting activities`}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(hM,{children:`${l} waiting`}),(0,O.jsx)(Rj,{appearance:`ghost`,text:`Refresh`,onPress:()=>void s()})]})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:o?(0,O.jsx)(Tj,{}):c.length===0?(0,O.jsxs)(q,{p:20,row:!0,align:`center`,gap:8,children:[(0,O.jsx)(fM,{size:16,fill:J.brand}),(0,O.jsx)(Z,{color:J.brand,fontSize:14,children:`All clear — nothing is waiting.`})]}):c.map(e=>(0,O.jsxs)(_M,{isSelected:e.id===d?.id,onSelect:()=>r(e.id),children:[(0,O.jsxs)(q,{row:!0,justify:`space-between`,align:`flex-start`,gap:8,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:e.id===d?.id?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:e.type}),(0,O.jsx)(Z,{fontSize:11,children:e.workflowId})]}),(0,O.jsxs)(q,{row:!0,justify:`space-between`,align:`center`,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:eM(e.id)}),e.timeoutAt&&(0,O.jsxs)(q,{row:!0,align:`center`,gap:4,children:[(0,O.jsx)(pM,{size:12,fill:J.muted}),(0,O.jsx)(Z,{fontSize:12,children:new Date(e.timeoutAt).toLocaleTimeString()})]})]})]},e.id))}),(0,O.jsx)(bM,{count:l,offset:u,limit:25,onChange:t})]}),children:d?(0,O.jsx)(AN,{activity:d,appId:i?.id??null},d.id):(0,O.jsx)(gM,{icon:Xx,children:c.length===0?`Nothing is waiting`:`Select an activity to inspect it`})})}function NN({option:e,getOptionLabel:t,textColor:n,...r}){let i=t(e,r),a=bj(n,{duration:300}),o=VA(()=>({color:a.value}),[a]);return typeof i==`string`?(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontWeight:`select.option.label.font.weight`,style:o,children:i}):i}E.get().tokens.set({"select.option.label.color.text":`#1c2024`,"select.option.label.font.weight":`400`});var PN={getOptionKey:(e,t,n)=>`select:${n}:options:${t}`,getOptionLabel:e=>typeof e==`object`?e?`label`in e?e.label:String(e):null:String(e),getOptionValue:e=>typeof e==`object`?e||null:e,getOptionIsSelected:(e,t,n)=>t.isMulti?t.value.includes(e)?!0:t.value.some(t=>n(t)===n(e)):t.value===void 0||t.value===null?!1:t.value===e||n(t.value)===n(e),filterOption:(e,t,n)=>{if(typeof e!=`object`||typeof e.label!=`string`)return!0;if(Array.isArray(n.value)){if(n.value.includes(e))return!1}else if(n.value===e)return!1;return e.label.toLowerCase().includes(t.toLowerCase())},getOptionIsDisabled:e=>typeof e==`object`&&`disabled`in e&&!!e.disabled,displayBackgroundColor:`text-input.color.background`,displayTextColor:`select.option.label.color.text`,displayPlaceholderColor:`text-input.color.placeholder`,displayBorderColor:e=>e.isMenuOpen?`text-input.color.outline.focused`:`text-input.color.outline.blured`,menuBorderColor:e=>e.isMenuOpen?`text-input.color.outline.focused`:`text-input.color.outline.blured`,menuOptionLabelTextColor:`select.option.label.color.text`,menuOptionLabelBackgroundColor:`#00000000`};function FN(e,t,n,{menuOptionLabelTextColor:r=PN.menuOptionLabelTextColor,menuOptionLabelBackgroundColor:i=PN.menuOptionLabelBackgroundColor}){return C(a=>{function o(r){if(!r)return;let i=r;return typeof i==`function`&&(i=i(e,n,t)),a.tokens.has(i)?a.tokens.get(i):i}return{menuOptionLabelText:o(r),menuOptionLabelBackground:o(i)}})}function IN({option:e,selectState:t,getOptionIsSelected:n,getOptionIsDisabled:r,getOptionIsClearable:i,getOptionLabel:a,getOptionValue:o,onSelectOptionPress:s,menuOptionLabelTextColor:c,menuOptionLabelBackgroundColor:l}){let{isHovered:u,isPressed:d,props:f}=Pj(),p=(0,b.useCallback)(t=>s(e,t),[s,e]),m=(0,b.useMemo)(()=>n(e,t,o),[n,o,e,t]),h=(0,b.useMemo)(()=>r(e,t),[r,e,t]),g=(0,b.useMemo)(()=>i(e),[i,e]),_=(0,b.useMemo)(()=>({isHovered:u,isPressed:d,isSelected:m,isDisabled:h,isClearable:g}),[u,d,m,h,g]),v=FN(e,t,_,{menuOptionLabelTextColor:c,menuOptionLabelBackgroundColor:l}),y=bj(v.menuOptionLabelBackground,{duration:300}),x=VA(()=>({backgroundColor:y.value}),[y]);return(0,O.jsx)(q,{as:_j.of(dv),...f,onPress:p,px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,style:x,children:(0,O.jsx)(NN,{option:e,getOptionLabel:a,textColor:v.menuOptionLabelText,..._})})}E.get().tokens.set({"select.menu.option.space.x":`@space.150`,"select.menu.option.space.y":`@space.100`,"select.menu.option.color.background":`#FFF`,"select.menu.option.color.border":`@color.background.brand.bold`});function LN({options:e,selectId:t,selectState:n,isLoading:r,noOptionsMessage:i,loadingMessage:a,getOptionLabel:o,getOptionValue:s,getOptionKey:c,getOptionIsSelected:l,getOptionIsDisabled:u,getOptionIsClearable:d,onSelectOptionPress:f,onLoadMoreRequest:p,menuOptionLabelTextColor:m,menuOptionLabelBackgroundColor:h}){return(0,O.jsx)(gp,{data:e,keyExtractor:(e,n)=>c(e,n,t),style:{maxHeight:200},renderItem:({item:e})=>(0,O.jsx)(IN,{option:e,selectState:n,getOptionLabel:o,getOptionValue:s,getOptionIsSelected:l,getOptionIsDisabled:u,getOptionIsClearable:d,onSelectOptionPress:f,menuOptionLabelTextColor:m,menuOptionLabelBackgroundColor:h}),ListEmptyComponent:r?null:(0,O.jsx)(q,{px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,children:typeof i==`string`?(0,O.jsx)(fx,{children:i}):i}),ListFooterComponent:r?(0,O.jsx)(q,{px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,children:typeof a==`string`?(0,O.jsx)(fx,{children:a}):a}):null,onEndReached:p})}E.get().tokens.set({"select.menu.color.background":`#FFF`,"select.menu.color.border":`@color.background.brand.bold`,"select.menu.space.margin.top":`@space.025`});var RN=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z`})})),$;(function(e){e.Grey=`grey`,e.Blue=`blue`,e.Brand=`brand`})($||={}),E.get().tokens.set({"%tag.removable.color.border":`#FFEBE6`,"%tag.removable.color.text":`#BF2600`,"%tag.removable.color.background":`#FFEBE6`}).set({[`tag.${$.Grey}.color.background`]:`#E8E8EC`,[`tag.${$.Grey}.color.border`]:`#E8E8EC`,[`tag.${$.Grey}.color.text`]:`#60646C`,[`tag.${$.Grey}.hovered.color.background`]:`@tag.${$.Grey}.color.background`,[`tag.${$.Grey}.hovered.color.border`]:`#60646C`,[`tag.${$.Grey}.hovered.color.text`]:`@tag.${$.Grey}.color.text`,[`tag.${$.Grey}.pressed.color.background`]:`@tag.${$.Grey}.hovered.color.background`,[`tag.${$.Grey}.pressed.color.border`]:`@tag.${$.Grey}.hovered.color.border`,[`tag.${$.Grey}.pressed.color.text`]:`@tag.${$.Grey}.hovered.color.text`,[`tag.${$.Grey}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Grey}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Grey}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Grey}.removable.pressed.color.background`]:`@tag.${$.Grey}.removable.hovered.color.background`,[`tag.${$.Grey}.removable.pressed.color.border`]:`@tag.${$.Grey}.removable.hovered.color.border`,[`tag.${$.Grey}.removable.pressed.color.text`]:`@tag.${$.Grey}.removable.hovered.color.text`}).set({[`tag.${$.Blue}.color.background`]:`#EDF1FF`,[`tag.${$.Blue}.color.border`]:`#EDF1FF`,[`tag.${$.Blue}.color.text`]:`#494CDF`,[`tag.${$.Blue}.hovered.color.background`]:`@tag.${$.Blue}.color.background`,[`tag.${$.Blue}.hovered.color.border`]:`#494CDF`,[`tag.${$.Blue}.hovered.color.text`]:`@tag.${$.Blue}.color.text`,[`tag.${$.Blue}.pressed.color.background`]:`@tag.${$.Blue}.hovered.color.background`,[`tag.${$.Blue}.pressed.color.border`]:`@tag.${$.Blue}.hovered.color.border`,[`tag.${$.Blue}.pressed.color.text`]:`@tag.${$.Blue}.hovered.color.text`,[`tag.${$.Blue}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Blue}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Blue}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Blue}.removable.pressed.color.background`]:`@tag.${$.Blue}.removable.hovered.color.background`,[`tag.${$.Blue}.removable.pressed.color.border`]:`@tag.${$.Blue}.removable.hovered.color.border`,[`tag.${$.Blue}.removable.pressed.color.text`]:`@tag.${$.Blue}.removable.hovered.color.text`}).set({[`tag.${$.Brand}.color.background`]:`#EDF1FF`,[`tag.${$.Brand}.color.border`]:`#EDF1FF`,[`tag.${$.Brand}.color.text`]:`@color.background.brand.bold`,[`tag.${$.Brand}.hovered.color.background`]:`@tag.${$.Brand}.color.background`,[`tag.${$.Brand}.hovered.color.border`]:`@color.background.brand.bold`,[`tag.${$.Brand}.hovered.color.text`]:`@tag.${$.Brand}.color.text`,[`tag.${$.Brand}.pressed.color.background`]:`@tag.${$.Brand}.hovered.color.background`,[`tag.${$.Brand}.pressed.color.border`]:`@tag.${$.Brand}.hovered.color.border`,[`tag.${$.Brand}.pressed.color.text`]:`@tag.${$.Brand}.hovered.color.text`,[`tag.${$.Brand}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Brand}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Brand}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Brand}.removable.pressed.color.background`]:`@tag.${$.Brand}.removable.hovered.color.background`,[`tag.${$.Brand}.removable.pressed.color.border`]:`@tag.${$.Brand}.removable.hovered.color.border`,[`tag.${$.Brand}.removable.pressed.color.text`]:`@tag.${$.Brand}.removable.hovered.color.text`});function zN({isPressable:e=!1,isRemovable:t=!1,onPress:n,onRemove:r,color:i=`brand`,children:a}){let o=Pj(),s=Pj(),c=(0,b.useMemo)(()=>({isHovered:o.isHovered,isPressed:o.isPressed,isPressable:e,isRemovable:t,isRemovableHovered:s.isHovered,isRemovablePressed:s.isPressed}),[o.isHovered,o.isPressed,e,t,s.isHovered,s.isPressed]),l=(0,b.useMemo)(()=>{let e=`tag`;return e+=`.${i}`,c.isRemovablePressed?e+=`.removable.pressed`:c.isRemovableHovered?e+=`.removable.hovered`:c.isPressed?e+=`.pressed`:c.isHovered&&(e+=`.hovered`),e},[i,c]),u=xj(`${l}.color.background`,{duration:300}),d=xj(`${l}.color.border`,{duration:300}),f=xj(`${l}.color.text`,{duration:300}),p=VA(()=>({color:f.value}),[f]),m=(()=>{let e=a;return typeof e==`function`&&(e=e(c)),typeof e==`string`?(0,O.jsx)(fx,{as:pj.Text,bold:!0,style:p,children:e}):e})(),h=(0,b.useCallback)(e=>{e.stopPropagation(),r?.(e)},[r]);return(0,O.jsxs)(q,{...o.props,as:_j.of(dv),row:!0,rounded:!0,h:`fit-content`,borderWidth:1,disabled:!e,style:VA(()=>({backgroundColor:u.value,borderColor:d.value}),[u,d]),align:!0,onPress:n,children:[(0,O.jsx)(q,{py:`space.050`,pl:`space.075`,pr:t?`0`:`space.075`,children:m}),t&&(0,O.jsx)(q,{...s.props,as:_j.of(dv),px:`space.050`,onPress:h,children:(0,O.jsx)(RN,{fill:`${l}.color.text`,size:`sm`})})]})}function BN({children:e,onOutsidePress:t}){return e(VN(t,[t]))}function VN(e,t=[]){let n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(e);return(0,b.useEffect)(()=>{i.current=e},t),(0,b.useEffect)(()=>{if(r.current){if(Yl.OS===`web`){let e=r.current;n.current=e.getBoundingClientRect();let t=t=>{e.contains(t.target)||i.current(t)};return document.addEventListener(`mousedown`,t),()=>{document.removeEventListener(`mousedown`,t)}}throw Error(`Not implement for native platforms`)}},[]),(0,b.useCallback)(e=>{r.current=e},[])}var HN=(0,b.createContext)(null);function UN({defaultIsOpen:e=!1,isOpen:t,render:n,onOpenRequest:r,onCloseRequest:i,children:a,shouldFitContainer:o=!1,wrapperProps:s,position:c=`vertical`,animationDuration:l=200,...u}){let d=(0,b.useRef)(null),[f,p]=(0,b.useState)(0),[m,h]=(0,b.useState)(0),[g,_]=(0,b.useState)(`bottom`),[v,y]=(0,b.useState)(e),x=(0,b.useMemo)(()=>t===void 0?v:t,[t,v]),S=(0,b.useCallback)(()=>{i?.(),y(!1)},[i]),C=(0,b.useCallback)(()=>{r?.(),y(!0)},[r]),w=(0,b.useCallback)(()=>{x?S():C()},[x,S,C]),T=(0,b.useMemo)(()=>({isOpen:x,animationDuration:l,toggle:w,close:S,open:C}),[x,w,S,C,l]),E=(0,b.useCallback)(()=>{x&&S()},[S,x]);(0,b.useEffect)(()=>{if(!d.current)return;let e=d.current,t=new ResizeObserver(e=>{for(let t of e)p(t.contentRect.height)});return e.measure((e,t,n,r)=>{p(r),h(n),r>(window.innerHeight||globalThis?.screen?.height||0)-(t+r)?_(`top`):_(`bottom`)}),t.observe(e),()=>t.disconnect()},[]);let[D,k]=(0,b.useState)(!1),ee=vj(+!!x,()=>(k(!0),YE(+!!x,{duration:l},e=>{e&&x&&k(!1)})),[x]),A=(0,b.useMemo)(()=>c===`vertical`?g:c,[c,g]),te=(0,b.useMemo)(()=>A===`left`||A===`right`,[A]),ne=(0,b.useMemo)(()=>{if(A===`top`)return{right:0,top:0};if(A===`left`)return{left:0};if(A===`bottom`)return{right:0,top:`100%`,width:o?`100%`:`auto`};if(A===`right`)return{left:`100%`,top:0};throw Error(`Invalid position: ${A}`)},[A,o]),re=VA(()=>{if(A===`top`)return{opacity:fj(ee.value,[0,1],[0,1]),height:fj(ee.value,[0,1],[0,f]),transform:[{translateY:fj(ee.value,[0,1],[0,-f])}]};if(A===`left`)return{opacity:fj(ee.value,[0,1],[0,1]),width:fj(ee.value,[0,1],[0,m]),transform:[{translateX:fj(ee.value,[0,1],[0,-m])}]};if(A===`bottom`)return{opacity:fj(ee.value,[0,1],[0,1]),height:fj(ee.value,[0,1],[0,f])};if(A===`right`)return{opacity:fj(ee.value,[0,1],[0,1]),width:fj(ee.value,[0,1],[0,m])};throw Error(`Invalid position: ${A}`)},[f,A,m,ee]);return(0,O.jsx)(BN,{onOutsidePress:E,children:e=>(0,O.jsx)(q,{ref:e,position:`relative`,...u,children:(0,O.jsxs)(HN.Provider,{value:T,children:[n(T),(0,O.jsx)(q,{as:pj.View,position:`absolute`,overflow:D?`hidden`:`visible`,...s,style:[{zIndex:10},ne,re,s?.style],children:(0,O.jsx)(Ed,{ref:d,style:{alignSelf:`flex-start`,width:te?void 0:`100%`},children:typeof a==`function`?a(T):a})})]})})})}var WN=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m11.998 17 7-8h-14z`})}));function GN({size:e=`md`,fill:t,animationDuration:n}){let{isOpen:r,animationDuration:i}=(0,b.useContext)(HN),a=vj(r?`180deg`:`0deg`,()=>YE(r?`180deg`:`0deg`,{duration:n??i}),[r,n,i]),o=VA(()=>({transform:[{rotate:a.value}]}),[a]);return(0,O.jsx)(pj.View,{style:o,children:(0,O.jsx)(WN,{size:e,fill:t})})}function KN({selectId:e,value:t,search:n,placeholder:r,isSearchable:i,isLoading:a,isDisabled:o,isClearable:s,enableCaretIndicator:c,getOptionKey:l,getOptionLabel:u,getOptionIsClearable:d,onOptionRemoveRequest:f,onOpenMenuRequest:p,onSearch:m,onClearRequest:h,displayBackgroundColor:g,displayBorderColor:_,displayPlaceholderColor:v,displayCaretIndicatorColor:y}){let x=bj(_,{duration:300}),S=bj(g,{duration:300}),C=bj(v,{duration:300}),w=VA(()=>({color:C.value}),[C]),T=VA(()=>({backgroundColor:S.value,borderColor:x.value}),[S,x]),E=(0,b.useMemo)(()=>!(!o&&i),[o,i]);return(0,O.jsxs)(q,{as:pj.View,row:!0,align:!0,rounded:!0,px:t.length?`space.100`:`text-input.padding-x`,py:t.length?3:`text-input.padding-y`,borderWidth:1,style:T,children:[(0,O.jsxs)(q,{flex:1,row:!0,align:!0,flexWrap:`wrap`,gap:`select.display.multi.space.gap`,children:[!t.length&&(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontFamily:`text-input.font.family`,fontSize:`text-input.font.size`,style:w,children:r}),t.map((t,n)=>{let r=d(t)&&!o;return(0,O.jsx)(zN,{color:o?`grey`:`brand`,isRemovable:r,onRemove:()=>f(t),children:e=>u(t,{isHovered:e.isHovered,isPressed:e.isPressed,isClearable:r,isDisabled:!1,isSelected:!0})},`${l(t,n,e)}:multi-option-selected`)}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(CN,{value:n,onChange:m,isReadOnly:E,editable:!E,onFocus:p,style:{borderWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,backgroundColor:`transparent`}})})]}),(0,O.jsxs)(q,{row:!0,align:!0,children:[a&&(0,O.jsx)(Tj,{size:`sm`}),s&&!o&&!!t.length&&(0,O.jsx)(Fj,{onPress:h,children:()=>(0,O.jsx)(RN,{size:`md`})}),c&&(0,O.jsx)(GN,{fill:y})]})]})}E.get().tokens.set({"select.display.multi.space.gap":`@space.050`,"select.display.multi.color.border":`@color.background.brand.bold`});function qN({value:e,search:t,isDisabled:n,isLoading:r,isClearable:i,isMenuOpen:a,isSearchable:o,enableCaretIndicator:s,placeholder:c,getOptionLabel:l,onSearch:u,onClearRequest:d,onOpenMenuRequest:f,displayBackgroundColor:p,displayBorderColor:m,displayTextColor:h,displayCaretIndicatorColor:g,displayPlaceholderColor:_}){let v=bj(m,{duration:300}),y=bj(p,{duration:300}),x=bj(_,{duration:300}),S=VA(()=>({color:x.value}),[x]),C=VA(()=>({backgroundColor:y.value,borderColor:v.value}),[y,v]),w=(0,b.useMemo)(()=>!(!n&&o),[n,o]),T=(0,b.useRef)(null);return(0,b.useEffect)(()=>{a&&T.current?.focus()},[a]),(0,O.jsxs)(q,{as:pj.View,position:`relative`,rounded:!0,px:`text-input.padding-x`,py:`text-input.padding-y`,borderWidth:1,style:C,children:[!t&&(0,O.jsxs)(q,{position:`absolute`,inset:0,px:`text-input.padding-x`,py:`text-input.padding-y`,row:!0,children:[!e&&(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontFamily:`text-input.font.family`,fontSize:`text-input.font.size`,style:S,children:c}),e&&(0,O.jsx)(NN,{option:e,getOptionLabel:l,isHovered:!1,isPressed:!1,isDisabled:!1,isSelected:!0,isClearable:!1,textColor:h})]}),(0,O.jsxs)(q,{row:!0,children:[(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(CN,{ref:T,value:t,onChange:u,isReadOnly:w,onFocus:f,style:{borderWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,backgroundColor:`transparent`}})}),(0,O.jsxs)(q,{ml:`auto`,row:!0,gap:`space.100`,children:[r&&(0,O.jsx)(Tj,{size:`sm`}),i&&!n&&e&&(0,O.jsx)(Fj,{onPress:d,children:()=>(0,O.jsx)(RN,{size:`md`})}),s&&(0,O.jsx)(GN,{fill:g})]})]})]})}function JN({isMulti:e,isMenuOpen:t,isDisabled:n,isClearable:r,value:i,placeholder:a,isSearchable:o,enableCaretIndicator:s,search:c,selectId:l,isLoading:u,getOptionLabel:d,getOptionIsClearable:f,getOptionKey:p,onOpenMenuRequest:m,onSearch:h,onOptionRemoveRequest:g,onClearRequest:_,displayBackgroundColor:v,displayBorderColor:y,displayTextColor:b,displayCaretIndicatorColor:x,displayPlaceholderColor:S}){return e?(0,O.jsx)(KN,{selectId:l,isClearable:r,isDisabled:n,isMenuOpen:t,isSearchable:o,isLoading:u,displayCaretIndicatorColor:x,enableCaretIndicator:s,value:i,getOptionLabel:d,getOptionIsClearable:f,getOptionKey:p,search:c,placeholder:a,onSearch:h,onClearRequest:_,onOptionRemoveRequest:g,displayBackgroundColor:v,displayBorderColor:y,displayPlaceholderColor:S,onOpenMenuRequest:m}):(0,O.jsx)(qN,{isClearable:r,isDisabled:n,isSearchable:o,isLoading:u,isMenuOpen:t,onClearRequest:_,value:i,placeholder:a,search:c,getOptionLabel:d,onSearch:h,onOpenMenuRequest:m,displayBackgroundColor:v,displayBorderColor:y,displayTextColor:b,enableCaretIndicator:s,displayCaretIndicatorColor:x,displayPlaceholderColor:S})}function YN({onSelectInputPress:e,...t}){return(0,O.jsx)(dv,{onPress:e,children:(0,O.jsx)(JN,{...t})})}function XN(e,{displayTextColor:t=PN.displayTextColor,displayBackgroundColor:n=PN.displayBackgroundColor,displayBorderColor:r=PN.displayBorderColor,displayCaretIndicatorColor:i,menuBorderColor:a=PN.menuBorderColor,displayPlaceholderColor:o=PN.displayPlaceholderColor}){return C(s=>{function c(t){if(!t)return;let n=t;return typeof n==`function`&&(n=n(e)),s.tokens.has(n)?s.tokens.get(n):n}return{displayText:c(t),displayBackground:c(n),displayBorder:c(r),displayCaretIndicator:c(i),displayPlaceholder:c(o),menuBorder:c(a)}})}function ZN({options:e,value:t,isLoading:n,isMulti:r=!1,isMenuOpen:i,isSearchable:a=!1,enableCaretIndicator:o=!1,placeholder:s=`...`,isClearable:c=!1,closeMenuOnSelect:l=!r,noOptionsMessage:u=`No options...`,loadingMessage:d=`Loading...`,isDisabled:f=!1,isEager:p=!1,filterOption:m=PN.filterOption,getOptionKey:h=PN.getOptionKey,getOptionLabel:g=PN.getOptionLabel,getOptionValue:_=PN.getOptionValue,getOptionIsSelected:v=PN.getOptionIsSelected,getOptionIsDisabled:y=PN.getOptionIsDisabled,getMenuOptionLabel:x=g,getDisplayOptionLabel:S=g,onChange:C,onSearch:w,onLoadMoreRequest:T,displayBackgroundColor:E,displayBorderColor:D,displayTextColor:k,displayCaretIndicatorColor:ee,displayPlaceholderColor:A,menuBorderColor:te,menuOptionLabelTextColor:ne,menuOptionLabelBackgroundColor:re}){let ie=(0,b.useId)(),[j,M]=(0,b.useState)(()=>{if(typeof e==`function`)return[];if(e===void 0)throw Error(`options is required`);return e}),[ae,oe]=(0,b.useState)(()=>t===void 0?r?[]:null:t);(0,b.useEffect)(()=>{t!==void 0&&oe(t)},[t,oe]);let[se,N]=(0,b.useState)(``),[ce,le]=(0,b.useState)(()=>typeof j==`function`),[ue,de]=(0,b.useState)(!1),fe=(0,b.useMemo)(()=>i===void 0?!f&&ue:i,[ue,f,i]),pe=(0,b.useMemo)(()=>n===void 0?ce:n,[n,ce]),me=(0,b.useMemo)(()=>!!c,[c]),he=(0,b.useMemo)(()=>({options:j,value:ae,isLoading:pe,isMenuOpen:fe,isMulti:r,isClearable:me}),[j,ae,pe,fe,r,me]),ge=(0,b.useMemo)(()=>j.filter(e=>m(e,se,he)).filter(e=>!v(e,he,_)),[j,m,v,_,se,he]),_e=(0,b.useCallback)(e=>typeof c==`function`?c(e):r?!0:c,[r,c]),P=(0,b.useCallback)(e=>{oe(e),C?.(e),l&&de(!1)},[C,l]),ve=(0,b.useCallback)(e=>{let t=Array.isArray(ae)?ae.includes(e)?ae.toSpliced(ae.indexOf(e),1):[...ae,e]:e;P(t)},[ae,P]),F=(0,b.useCallback)(e=>ve(e),[ve]),ye=(0,b.useCallback)(e=>{N(e),w?.(e)},[w]),I=(0,b.useCallback)(e=>F(e),[F]),be=(0,b.useCallback)(()=>P(typeof c==`function`?Array.isArray(ae)?ae.filter(e=>!_e(e)):null:Array.isArray(ae)?[]:null),[P,c,ae,_e]);(0,b.useEffect)(()=>{if(typeof e!=`function`)return M(e);f||(p||fe)&&(le(!0),Promise.resolve(e(se)).then(e=>M(e)).finally(()=>le(!1)))},[e,fe,f,se,p]),(0,b.useEffect)(()=>{se!==``&&!fe&&ye(``)},[fe,se,ye]);let xe=(0,b.useCallback)(()=>{de(!0)},[]),L=(0,b.useCallback)(()=>{de(!1)},[]),Se=XN(he,{displayBackgroundColor:E,displayBorderColor:D,displayTextColor:k,displayCaretIndicatorColor:ee,displayPlaceholderColor:A,menuBorderColor:te}),Ce=bj(Se.menuBorder,{duration:300}),we=VA(()=>({borderColor:Ce.value}),[Ce]),Te=(0,b.useMemo)(()=>typeof o==`function`?o(he):o,[o,he]);return(0,O.jsx)(UN,{shouldFitContainer:!0,flex:1,isOpen:fe,onOpenRequest:xe,onCloseRequest:L,position:`vertical`,wrapperProps:{rounded:!0,borderWidth:1,style:we,bg:`white`,marginTop:-1,overflow:`hidden`},render:({open:e})=>(0,O.jsx)(YN,{isDisabled:f,isMenuOpen:fe,isMulti:r,enableCaretIndicator:Te,isSearchable:a,isLoading:pe,isClearable:me,selectId:ie,value:ae,placeholder:s,search:se,getOptionKey:h,getOptionLabel:S,getOptionIsClearable:_e,onSearch:ye,onSelectInputPress:e,onOpenMenuRequest:xe,onOptionRemoveRequest:I,onClearRequest:be,displayBackgroundColor:Se.displayBackground,displayBorderColor:Se.displayBorder,displayTextColor:Se.displayText,displayCaretIndicatorColor:Se.displayCaretIndicator,displayPlaceholderColor:Se.displayPlaceholder}),children:(0,O.jsx)(LN,{isMenuOpen:fe,isLoading:pe,options:ge,selectId:ie,selectState:he,noOptionsMessage:u,loadingMessage:d,getOptionLabel:x,getOptionValue:_,getOptionKey:h,getOptionIsSelected:v,getOptionIsDisabled:y,getOptionIsClearable:_e,onSelectOptionPress:F,onLoadMoreRequest:T,menuOptionLabelTextColor:ne,menuOptionLabelBackgroundColor:re})})}function QN({isChecked:e,size:t=`md`,onChange:n}){let[r,i]=(0,b.useState)(!1),a=(0,b.useMemo)(()=>e===void 0?r:e,[e,r]),[o,s]=(0,b.useMemo)(()=>{let e=(()=>{if(t===`sm`)return 16;if(t===`md`)return 18;throw Error(`Invalid size`)})();return[e,e*2]},[t]),c=(0,b.useMemo)(()=>o-4,[o]),l=(0,b.useMemo)(()=>s-c-4,[s,c]),u=vj(+!!a,()=>YE(+!!a,{duration:200}),[a]),d=xj(a?`switch.checked.background.color`:`switch.background.color`,{duration:200}),f=VA(()=>({transform:[{translateX:u.value*l}]}),[u,l]),p=VA(()=>({backgroundColor:d.value}),[d]),m=(0,b.useCallback)(()=>{i(!r),n?.(!r)},[n,r]);return(0,O.jsx)(q,{as:_j.of(dv),h:o,w:s,rounded:`full`,p:2,position:`relative`,onPress:m,style:p,children:(0,O.jsx)(q,{as:pj.View,position:`absolute`,rounded:`full`,w:c,h:c,bg:`#FFF`,style:f})})}E.get().tokens.set({"switch.background.color":`#74788D`,"switch.checked.background.color":`@color.background.brand.bold`});function $N({at:e,...t}){let n=Wj(e),r=LM({initialTime:n,intervalInMs:DM(Date.now()-n)});return(0,O.jsx)(Z,{...t,children:Yj(e,n+r)})}function eP({run:e,isSelected:t,onSelect:n}){return(0,O.jsxs)(_M,{isSelected:t,onSelect:n,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:t?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:e.workflow}),(0,O.jsx)($N,{at:e.createdAt,fontSize:12})]}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(CM,{color:fS[e.status],children:pS[e.status]}),e.parentWorkflowRun&&(0,O.jsx)(CM,{color:J.muted,children:`child`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,numberOfLines:1,children:e.id})]})]})}var tP=tx(e=>(0,O.jsxs)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:[(0,O.jsx)(Jx,{d:`M12 5c-3.859 0-7 3.141-7 7s3.141 7 7 7 7-3.141 7-7-3.141-7-7-7zm0 12c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z`}),(0,O.jsx)(Jx,{d:`M12 9c-1.627 0-3 1.373-3 3s1.373 3 3 3 3-1.373 3-3-1.373-3-3-3z`})]}));function nP(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function rP(e,t){return nP(e,t)??t}function iP(e,t,n){try{return e(t)}catch(e){return n?St(25,t,e,n):St(24,t,e),null}}function aP(e){function t(t){if(t===void 0)return null;let n=Array.isArray(t);return n&&t[0]===void 0?null:(t=n?t[0]:typeof t==`string`?t:``,iP(e.parse,t))}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var oP=aP({parse:e=>e,serialize:String}),sP=aP({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)});aP({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),aP({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return t<`0`||!(t.length&1)?t:`0`+t}}),aP({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});var cP=aP({parse:e=>e.toLowerCase()===`true`,serialize:String});function lP(e,t){return e.valueOf()===t.valueOf()}aP({parse:e=>{let t=new Date(parseInt(e));return+t==+t?t:null},serialize:e=>``+e.valueOf(),eq:lP}),aP({parse:e=>{let t=new Date(e);return+t==+t&&uP.parse(e)?t:null},serialize:e=>e.toISOString(),eq:lP});var uP=aP({parse:e=>{let t=new Date(e.slice(0,10));return+t==+t&&uP.serialize(t)===e.slice(0,10)?t:null},serialize:e=>e.toISOString().slice(0,10),eq:lP});function dP(e){return aP({parse:t=>{let n=t;return e.includes(n)?n:null},serialize:String})}function fP(e,{clearOnDefault:t=!0,urlKeys:n={},processUrlSearchParams:r}={}){function i(i,a={}){let[o,s,c]=pP(i)?mP(i):[``,new URLSearchParams,``],l=pP(i)?a:i;if(l===null){for(let t of Object.keys(e)){let e=rP(n,t);s.delete(e)}return r&&(s=r(s)),o+Tt(s)+c}for(let r of Object.keys(e)){let i=e[r],a=nP(l,r);if(a===void 0)continue;let o=rP(n,r),c=i.defaultValue!==void 0&&a!==null&&(i.eq??an)(a,i.defaultValue);if(a===null||(i.clearOnDefault??t??!0)&&c)s.delete(o);else{let e=i.serialize(a);s=Bt(s,o,e)}}return r&&(s=r(s)),o+Tt(s)+c}return i}function pP(e){return typeof e==`string`||e instanceof URLSearchParams||e instanceof URL}function mP(e){if(typeof e==`string`){let[t=``,...n]=e.split(`#`),r=n.length?`#`+n.join(`#`):``,[i=``,...a]=t.split(`?`);return[i,new URLSearchParams(a.join(`?`)),r]}if(e instanceof URLSearchParams)return[``,new URLSearchParams(e),``];{let t=e.href.length-e.search.length-e.hash.length,n=e.href.slice(0,t).replace(/[?#]+$/,``),r=e.hash||(e.href.endsWith(`#`)?`#`:``);return[n,new URLSearchParams(e.searchParams),r]}}var hP=kt(`sync-emitter`,()=>Ht()),gP={},_P=(e,t)=>e===`defaultValue`?void 0:t;function vP(e,t={}){let n=(0,b.useId)(),r=Pt(),i=Ft(),{history:a=r?.history??`replace`,scroll:o=r?.scroll??!1,shallow:s=r?.shallow??!0,throttleMs:c=Rt.timeMs,limitUrlUpdates:l=r?.limitUrlUpdates,clearOnDefault:u=r?.clearOnDefault??!0,startTransition:d,urlKeys:f=gP}=t,p=Object.keys(e).join(`,`),m=(0,b.useRef)(e),h=m.current,g=JSON.stringify(Object.entries(h),_P)===JSON.stringify(Object.entries(e),_P)&&Object.entries(e).every(([e,t])=>{if(h[e]?.startTransition!==t.startTransition)return!1;let n=h[e]?.defaultValue,r=t.defaultValue;return Object.is(n,r)?!0:n!==void 0&&r!==void 0&&t.eq?.(n,r)===!0})?h:e;m.current=g;let _=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,rP(f,e)])),[p,JSON.stringify(f)]),v=Object.values(_),y=Nt(v),x=y.searchParams,S=(0,b.useRef)(null),C=(0,b.useRef)(null),w=$t(v),[T]=(0,b.useState)(()=>{let t={},[,n]=yP(e,_,x,w,t);return[n,t]}),E=(0,b.useRef)(T[1]),[D,O]=(0,b.useState)(T[0]),k=(0,b.useRef)(D),ee=e=>JSON.stringify([v.map(t=>[t,e.getAll(t)]),w]),A=ee(x),te=()=>{let[t,r]=yP(e,_,x,w,E.current,k.current);return t&&(xt(1,n,p,r),k.current=r,O(r)),t},ne=Object.keys(E.current).join(`&`)!==v.join(`&`),re=C.current===null||C.current===(y.pathname??location.pathname);if(ne)S.current=A,te(),E.current=Object.fromEntries(Object.entries(_).map(([t,n])=>[n,e[t]?.type===`multi`?x.getAll(n):x.get(n)]));else{let e=!1;re&&S.current!==A&&(S.current=A,e=te()),!e&&D!==k.current&&(re||y.pathname===void 0&&S.current===ee(new URLSearchParams(location.search)))&&O(k.current)}(0,b.useEffect)(()=>{C.current=y.pathname??location.pathname,te()},[A,y.pathname]),(0,b.useEffect)(()=>{let t=[];for(let[r,i]of Object.entries(_)){let a=({state:t,query:a})=>{O(o=>Object.is(o[r]??null,t)?(xt(2,n,p,i,t,e[r]?.defaultValue,k.current),o):(k.current={...k.current,[r]:t},E.current[i]=a,xt(3,n,p,i,t,e[r]?.defaultValue,k.current),k.current))};xt(4,n,i,p),hP.on(i,a),t.push([i,a])}return()=>{for(let[e,r]of t)xt(5,n,e,p),hP.off(e,r)}},[p,_]);let ie=(0,b.useCallback)((e,t={})=>{let r=(typeof e==`function`?e(bP(k.current,g)):e)??Object.fromEntries(Object.keys(g).map(e=>[e,null]));xt(6,n,p,r);let f,m=0,h=[];for(let[e,n]of Object.entries(r)){let r=nP(g,e),p=_[e];if(!r||p===void 0||n===void 0)continue;(t.clearOnDefault??r.clearOnDefault??u)&&n!==null&&r.defaultValue!==void 0&&(r.eq??an)(n,r.defaultValue)&&(n=null);let v=n===null?null:(r.serialize??String)(n);hP.emit(p,{state:n,query:v});let b={key:p,query:v,options:{history:t.history??r.history??a,shallow:t.shallow??r.shallow??s,scroll:t.scroll??r.scroll??o,startTransition:t.startTransition??r.startTransition??d}},x=t.limitUrlUpdates??r.limitUrlUpdates??l;if(x?.method===`debounce`){let e=x.timeMs??Rt.timeMs,t=Qt.push(b,e,y,i);m<e&&(f=t,m=e)}else{let e=x?.timeMs??t.throttleMs??r.throttleMs??c;h.push(Qt.abort(p)),Jt.push(b,e)}}let v=h.length?Jt.flush(y,i):Jt.getPendingPromise(y);for(let e of h)v=e(v);return f??v},[p,a,s,o,c,l?.method,l?.timeMs,d,u,g,_,y.updateUrl,y.getSearchParamsSnapshot,y.rateLimitFactor,i]);return[(0,b.useMemo)(()=>bP(D,g),[D,g]),ie]}function yP(e,t,n,r,i={},a={}){let o=!1,s=Object.entries(e).reduce((e,[s,c])=>{let l=t[s],u=nP(r,l),d=c.type===`multi`?[]:null,f=u===void 0?c.type===`multi`?n.getAll(l):n.get(l):u,p=nP(a,s);return p!==void 0&&on(nP(i,l)??d,f)?(e[s]=p,e):(o=!0,e[s]=(zt(f)?null:iP(c.parse,f,l))??null,i[l]=f,e)},{});return o||=Object.keys(s).length!==Object.keys(a).length,[o,s]}function bP(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]?.defaultValue??null]))}function xP(e,t={}){let{parse:n=e=>e,type:r,serialize:i,eq:a,defaultValue:o,...s}=t,c={parse:n,type:r,serialize:i,eq:a,defaultValue:o},[{[e]:l},u]=vP({[e]:c},s);return[l,(0,b.useCallback)((t,n={})=>u(n=>({[e]:typeof t==`function`?t(n[e]):t}),n),[e,u])]}function SP(){return xP(`activity`)}function CP({text:e,label:t=`Copy`}){return(0,O.jsx)(Rj,{appearance:`ghost`,text:t,onPress:()=>$j(e)})}function wP({initialTime:e,isRunning:t,intervalInMs:n=100}){let r=t&&iS;return Uj(t&&!r),LM({initialTime:e,isActive:r,intervalInMs:n})}function TP({from:e,to:t=null,...n}){let r=Wj(e),i=wP({initialTime:r,isRunning:t===null,intervalInMs:EM(Date.now()-r)});return t===null?(0,O.jsx)(Z,{...n,children:qj(i)}):(0,O.jsx)(Z,{...n,children:Kj(Wj(t)-r)})}function EP({status:e,size:t=14}){let n=fS[e];return e===`running`?(0,O.jsx)(Tj,{size:t,color:n}):(0,O.jsx)(e===`fulfilled`?fM:RN,{size:t,fill:n})}function DP({label:e,children:t}){return(0,O.jsxs)(q,{gap:6,flex:1,minW:120,children:[(0,O.jsx)(Z,{variant:`label`,children:e}),t]})}function OP({log:e}){let t=mS[e.level]??J.text,n=e.args.map(e=>typeof e==`string`?e:Zj(e)).join(` `);return(0,O.jsxs)(q,{row:!0,gap:12,align:`flex-start`,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.dim,children:Xj(e.at)}),(0,O.jsx)(Z,{variant:`mono`,color:t,children:`[${e.level.toUpperCase()}]`}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(Z,{variant:`mono`,color:t,children:n})})]})}function kP({runId:e}){let[t,n]=(0,b.useState)(0),{data:r}=mt(wS.runLogs(e,{limit:25,offset:t})),i=r?.logs??[],a=r?.count??0;return(0,O.jsxs)(TN,{title:`Logs`,actions:(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${a} entries`}),children:[r?i.length===0?(0,O.jsx)(Z,{children:`Nothing was logged by this run.`}):(0,O.jsx)(q,{bg:J.background,gap:4,children:i.map((e,n)=>(0,O.jsx)(OP,{log:e},`${t}-${n}`))}):(0,O.jsx)(Tj,{}),(0,O.jsx)(bM,{count:a,offset:t,limit:25,onChange:n})]})}function AP(e){return e.status===`running`?null:e.updatedAt}function jP(e){return e===null?null:Wj(e)}var MP=.6;function NP({scale:e,from:t,to:n,color:r,isPulsing:i=!1}){let a=wP({initialTime:e.start,isRunning:e.end===null||n===null,intervalInMs:250}),o=e.start+a,s=Math.max((e.end??o)-e.start,1),c=n??o,l=Math.min(Math.max((t-e.start)/s*100,0),100),u=Math.max((Math.max(c,t)-t)/s*100,MP);return(0,O.jsx)(q,{h:10,bg:J.raised,rounded:5,position:`relative`,flex:1,children:(0,O.jsx)(q,{position:`absolute`,top:0,bottom:0,left:`${l}%`,w:`${Math.min(u,100-l)}%`,bg:r,rounded:5,style:i?{opacity:.85}:void 0})})}var PP=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`M14 13H8V5H6v9a1 1 0 0 0 1 1h7v3l5-4-5-4v3z`})})),FP=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m9 19 8-7-8-7z`})}));function IP({isExpanded:e}){return(0,O.jsx)(e?WN:FP,{size:12,fill:J.muted})}function LP({to:e,children:t,fontSize:n=12,style:r}){return(0,O.jsx)(sa,{to:e,style:{textDecoration:`none`,...r},children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:4,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.info,fontSize:n,children:t}),(0,O.jsx)(SM,{size:n,fill:J.info})]})})}var RP=3;function zP({child:e,scale:t,depth:n}){let[r,i]=(0,b.useState)(!1),a=fS[e.status],o=n<RP,{data:s}=mt({...wS.run(e.id),enabled:r}),c=AP(e);return(0,O.jsxs)(q,{gap:6,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,pv:8,bg:`${J.panel}80`,rounded:4,borderWidth:1,borderColor:`${J.border}80`,...o?mM(()=>i(e=>!e)):{},children:[(0,O.jsxs)(q,{flex:1,minW:0,row:!0,align:`center`,gap:8,children:[o&&(0,O.jsx)(IP,{isExpanded:r}),(0,O.jsx)(PP,{size:12,fill:J.dim}),(0,O.jsx)(Z,{variant:`mono`,numberOfLines:1,children:e.workflow}),(0,O.jsx)(CM,{color:a,children:pS[e.status]}),(0,O.jsx)(LP,{to:`/runs/${e.id}`,fontSize:11,style:{marginLeft:`auto`},children:`open`})]}),(0,O.jsx)(q,{w:`42%`,children:(0,O.jsx)(NP,{scale:t,from:Wj(e.createdAt),to:jP(c),color:a,isPulsing:e.status===`running`})}),(0,O.jsx)(q,{w:72,align:`flex-end`,children:(0,O.jsx)(TP,{from:e.createdAt,to:c,variant:`mono`,color:J.muted})})]}),r&&(0,O.jsx)(q,{ml:24,children:s?(0,O.jsx)(ZP,{run:s,scale:t,depth:n+1,focusedActivityId:null}):(0,O.jsx)(Tj,{})})]})}function BP({activityId:e,scale:t,depth:n}){let{data:r,fetchNextPage:i,isFetchingNextPage:a}=yt(wS.childRuns(e));if(!r)return(0,O.jsx)(Tj,{});let o=r.pages.flatMap(e=>e.runs),s=r.pages.at(-1)?.count??0,c=s-o.length;return(0,O.jsxs)(q,{ml:24,gap:6,children:[o.map(e=>(0,O.jsx)(zP,{child:e,scale:t,depth:n},e.id)),c>0&&(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${o.length} of ${s} child runs`}),(0,O.jsx)(Rj,{appearance:`ghost`,text:`Show ${Math.min(c,15)} more`,isLoading:a,onPress:()=>void i()})]})]})}function VP({pending:e}){return e.timeoutAt===null?(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`no timeout`}):e.status===`pending`?(0,O.jsx)(RM,{to:e.timeoutAt,variant:`mono`,color:J.muted,children:e=>e===null?`timing out…`:`times out in ${e}`}):(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`timeout was ${Xj(e.timeoutAt)}`})}function HP({pending:e}){return(0,O.jsxs)(q,{bg:J.background,p:12,gap:8,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(CM,{color:e.status===`pending`?J.info:fS[e.status],children:e.status}),(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`pending ${e.id}`})]}),(0,O.jsx)(VP,{pending:e})]}),e.schema&&(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Expected payload schema`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.schema)})]}),(0,O.jsxs)(q,{row:!0,gap:16,children:[(0,O.jsxs)(q,{flex:1,gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Result`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.result)})]}),(0,O.jsxs)(q,{flex:1,gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Payload received`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.payload)})]})]})]})}function UP({runId:e,activityId:t}){let[n,r]=(0,b.useState)(0),{data:i}=mt(wS.runActivityPendings(e,t,{limit:25,offset:n}));return i?i.count===0?null:(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Async steps`}),i.pendings.map(e=>(0,O.jsx)(HP,{pending:e},e.id)),(0,O.jsx)(bM,{count:i.count,offset:n,limit:25,onChange:r})]}):(0,O.jsx)(Tj,{})}var WP={completed:{label:`Completed`,color:J.brand},waiting:{label:`Waiting`,color:J.info},running:{label:`Running`,color:J.info},failed:{label:`Failed`,color:J.error}};function GP(e){return e.status===`fulfilled`?`completed`:e.status===`rejected`?`failed`:e.kind===`async`&&e.pendingStatus===`pending`?`waiting`:`running`}function KP(e,t){return e.settledAt??AP(t)}function qP({activity:e,index:t,run:n,scale:r,depth:i,isFocused:a}){let[o,s]=(0,b.useState)(a),c=(0,b.useRef)(null),{data:l}=mt({...wS.runActivity(n.id,e.id),enabled:o}),u=GP(e),{label:d,color:f}=WP[u],p=KP(e,n),m=u===`running`||u===`waiting`;return(0,b.useEffect)(()=>{a&&(s(!0),c.current?.scrollIntoView?.({block:`center`}))},[a]),(0,O.jsxs)(q,{gap:6,children:[(0,O.jsxs)(q,{ref:c,row:!0,align:`center`,gap:12,ph:12,pv:10,bg:J.panel,rounded:4,borderWidth:1,borderColor:a?J.brand:J.border,...mM(()=>s(e=>!e)),children:[(0,O.jsxs)(q,{flex:1,minW:0,row:!0,align:`center`,gap:8,children:[(0,O.jsx)(IP,{isExpanded:o}),(0,O.jsx)(Z,{variant:`mono`,fontSize:13,fontWeight:`600`,numberOfLines:1,children:e.type}),(0,O.jsx)(CM,{color:f,children:d}),(0,O.jsx)(CM,{color:J.muted,children:e.kind}),e.hasChildren&&(0,O.jsx)(CM,{color:J.info,children:`child runs`})]}),(0,O.jsx)(q,{w:`42%`,children:(0,O.jsx)(NP,{scale:r,from:Wj(e.createdAt),to:jP(p),color:f,isPulsing:m})}),(0,O.jsx)(q,{w:72,align:`flex-end`,children:(0,O.jsx)(TP,{from:e.createdAt,to:p,variant:`mono`,color:J.muted})})]}),o&&(0,O.jsxs)(q,{p:16,gap:16,rounded:4,borderWidth:1,borderColor:J.border,bg:`${J.panel}80`,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,style:{flexWrap:`wrap`},children:[(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`activity ${e.id}`}),(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:11,children:`click to copy`})]}),(0,O.jsxs)(q,{row:!0,gap:16,children:[(0,O.jsx)(DP,{label:`Started`,children:(0,O.jsx)(Z,{variant:`mono`,children:Xj(e.createdAt)})}),(0,O.jsx)(DP,{label:`Completed`,children:(0,O.jsx)(Z,{variant:`mono`,children:e.settledAt?Xj(e.settledAt):`—`})}),(0,O.jsx)(DP,{label:`Position`,children:(0,O.jsx)(Z,{variant:`mono`,children:String(t)})})]}),l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Input`}),(0,O.jsx)(wM,{value:Zj(l.input)})]}),u===`failed`?(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Rejection`}),(0,O.jsx)(wM,{value:Qj(l.output),color:J.error})]}):(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Output`}),(0,O.jsx)(wM,{value:u===`completed`?Zj(l.output):`Not completed yet.`,color:u===`completed`?J.text:J.muted})]}),e.kind===`async`&&(0,O.jsx)(UP,{runId:n.id,activityId:e.id})]}):(0,O.jsx)(Tj,{})]}),o&&e.hasChildren&&(0,O.jsx)(BP,{activityId:e.id,scale:r,depth:i})]})}var JP=[0,.25,.5,.75,1];function YP({scale:e}){let t=wP({initialTime:e.start,isRunning:e.end===null,intervalInMs:250}),n=Math.max((e.end??e.start+t)-e.start,1);return(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,pb:4,children:[(0,O.jsx)(q,{flex:1,minW:0}),(0,O.jsx)(q,{w:`42%`,row:!0,justify:`space-between`,children:JP.map(e=>(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:10,children:Kj(n*e)},e))}),(0,O.jsx)(q,{w:72})]})}function XP({run:e,activities:t,scale:n,depth:r,focusedActivityId:i}){return t.length===0?(0,O.jsx)(Z,{children:e.status===`running`?`No activity pushed yet.`:`This run finished without pushing any activity.`}):(0,O.jsxs)(q,{gap:6,children:[r===0&&(0,O.jsx)(YP,{scale:n}),t.map((t,a)=>(0,O.jsx)(qP,{activity:t,index:a,run:e,scale:n,depth:r,isFocused:t.id===i},t.id))]})}function ZP({run:e,scale:t,depth:n,focusedActivityId:r}){let[i,a]=(0,b.useState)(0),{data:o}=mt(wS.runActivities(e.id,{limit:25,offset:i}));return o?(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(XP,{run:e,activities:[...o.activities].reverse(),scale:t,depth:n,focusedActivityId:r}),(0,O.jsx)(bM,{count:o.count,offset:i,limit:25,onChange:a})]}):(0,O.jsx)(Tj,{})}function QP({runId:e}){let t=Jr(),[n]=SP(),{data:r,error:i}=mt(wS.run(e)),a=r?.status===`running`;if(i)return(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:String(i)})});if(!r)return(0,O.jsx)(Tj,{});let o=Wj(r.createdAt),s=a?null:Wj(r.updatedAt),c={start:o,end:s},l=fS[r.status],u=Qj(r.output);return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,gap:16,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,flex:1,minW:0,children:[(0,O.jsx)(sa,{to:`/workflows/${encodeURIComponent(r.workflow)}`,style:{textDecoration:`none`},children:(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:r.workflow})}),(0,O.jsx)(hM,{onPress:()=>$j(r.id),children:`run ${r.id}`})]}),(0,O.jsxs)(q,{row:!0,gap:8,children:[rS.capabilities.trigger&&(0,O.jsx)(Rj,{appearance:`outline`,text:`Run again`,onPress:()=>t(`/workflows/${encodeURIComponent(r.workflow)}`,{state:{input:r.input}})}),(0,O.jsx)(Rj,{appearance:`outline`,text:`Copy run JSON`,onPress:()=>$j(Zj(r))})]})]}),(0,O.jsxs)(q,{row:!0,gap:16,style:{flexWrap:`wrap`},children:[(0,O.jsx)(DP,{label:`Status`,children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:6,children:[(0,O.jsx)(EP,{status:r.status}),(0,O.jsx)(Z,{fontSize:14,fontWeight:`600`,color:l,children:pS[r.status]})]})}),(0,O.jsx)(DP,{label:`Duration`,children:(0,O.jsx)(TP,{from:r.createdAt,to:AP(r),variant:`mono`,fontSize:14})}),(0,O.jsx)(DP,{label:`Start time`,children:(0,O.jsx)(Z,{variant:`mono`,fontSize:14,children:new Date(r.createdAt).toLocaleString()})}),r.parentWorkflowRun&&(0,O.jsx)(DP,{label:`Parent run`,children:(0,O.jsx)(sa,{to:`/runs/${r.parentWorkflowRun}${r.parentWorkflowRunActivity?`?activity=${r.parentWorkflowRunActivity}`:``}`,style:{textDecoration:`none`},children:(0,O.jsx)(Z,{variant:`mono`,fontSize:14,color:J.info,children:r.parentWorkflowRun})})})]})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Initial Input`,actions:(0,O.jsx)(CP,{text:Zj(r.input),label:`Copy JSON`}),children:(0,O.jsx)(wM,{value:Zj(r.input)})}),(0,O.jsx)(TN,{title:`Execution Trace`,actions:s===null?(0,O.jsxs)(q,{row:!0,align:`center`,gap:6,children:[(0,O.jsx)(tP,{size:12,fill:J.info}),(0,O.jsx)(Z,{variant:`mono`,color:J.info,children:`live`})]}):(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${Kj(s-o)} total`}),children:(0,O.jsx)(ZP,{run:r,scale:c,depth:0,focusedActivityId:n})}),(0,O.jsx)(kP,{runId:r.id}),(0,O.jsx)(TN,{title:r.status===`rejected`?`Rejection`:`Final Output`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Z,{variant:`mono`,color:l,children:`Status: ${r.status}`}),r.status!==`running`&&(0,O.jsx)(CP,{text:r.status===`rejected`?u:Zj(r.output),label:`Copy Result`})]}),children:r.status===`running`?(0,O.jsx)(wM,{value:`Still running…`,color:J.muted}):r.status===`rejected`?(0,O.jsx)(wM,{value:u,color:J.error}):(0,O.jsx)(wM,{value:Zj(r.output)})})]})]})}var $P=[`running`,`fulfilled`,`rejected`],eF=[{value:`15m`,label:`Last 15 minutes`,durationInMs:9e5},{value:`1h`,label:`Last hour`,durationInMs:36e5},{value:`24h`,label:`Last 24 hours`,durationInMs:864e5}],tF=eF.map(e=>e.value),nF={status:dP($P),workflow:oP.withDefault(``),q:oP.withDefault(``),period:dP(tF),rootOnly:cP.withDefault(!0),page:sP.withDefault(1)},rF=fP(nF);function iF(e){return{status:e.status??void 0,workflow:e.workflow||void 0,id:e.q||void 0,rootOnly:e.rootOnly||void 0,createdWithinInMs:eF.find(t=>t.value===e.period)?.durationInMs,limit:25,offset:(Math.max(e.page,1)-1)*25}}function aF(){return vP(nF,{history:`replace`})}var oF=[{label:`Any status`,value:``},{label:pS.running,value:`running`},{label:pS.fulfilled,value:`fulfilled`},{label:pS.rejected,value:`rejected`}],sF=[{label:`Any time`,value:``},...eF.map(({value:e,label:t})=>({value:e,label:t}))],cF={displayBackgroundColor:J.background,displayBorderColor:J.border,displayTextColor:J.text,displayPlaceholderColor:J.dim,displayCaretIndicatorColor:J.muted,menuBorderColor:J.border,menuOptionLabelBackgroundColor:J.panel,menuOptionLabelTextColor:J.text};function lF(){let{runId:e}=Xr(),t=Jr(),[n,r]=aF(),{data:i,isPending:a}=mt(wS.runs(iF(n))),{data:o}=mt(wS.manifest()),s=i?.runs??[],c=i?.count??0,l=(n.page-1)*25,u=e=>void r({...e,page:null}),d=[{label:`Any workflow`,value:``},...(o?.workflows??[]).map(({id:e})=>({label:e,value:e}))],f=e=>t(rF(`/runs/${e}`,n));return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,gap:8,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Runs`}),(0,O.jsx)(hM,{children:`${c} total`})]}),(0,O.jsxs)(q,{row:!0,gap:8,children:[(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(ZN,{options:oF,value:oF.find(e=>e.value===(n.status??``)),onChange:e=>u({status:e?.value||null}),...cF})}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(ZN,{options:sF,value:sF.find(e=>e.value===(n.period??``)),onChange:e=>u({period:e?.value||null}),...cF})})]}),(0,O.jsx)(ZN,{options:d,value:d.find(e=>e.value===n.workflow),onChange:e=>u({workflow:e?.value??``}),isSearchable:!0,...cF}),(0,O.jsx)(CN,{value:n.q,onChange:e=>u({q:e}),placeholder:`Run id starts with…`,autoCapitalize:`none`,autoCorrect:!1,style:{backgroundColor:J.background}}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(QN,{size:`sm`,isChecked:n.rootOnly,onChange:e=>u({rootOnly:e})}),(0,O.jsx)(Z,{fontSize:12,children:`Root runs only (children stay inside their parent)`})]})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:a?(0,O.jsx)(Tj,{}):s.length===0?(0,O.jsxs)(q,{p:20,gap:6,children:[(0,O.jsx)(Z,{children:c===0&&!n.status&&!n.workflow&&!n.q?rS.capabilities.rebuild?`No runs since the last build.`:`No runs yet.`:`No runs match the filters.`}),(0,O.jsx)(Z,{fontSize:12,color:J.dim,children:rS.capabilities.rebuild?`Start one from the Workflows page; runs reset on every rebuild.`:`Start one from the Workflows page.`})]}):s.map(t=>(0,O.jsx)(eP,{run:t,isSelected:t.id===e,onSelect:()=>f(t.id)},t.id))}),(0,O.jsx)(bM,{count:c,offset:l,limit:25,onChange:e=>void r({page:e===0?null:e/25+1})})]}),children:e?(0,O.jsx)(QP,{runId:e}):(0,O.jsx)(gM,{icon:$x,children:`Select a run to inspect its trace`})})}function uF(){let e=A();return vt({mutationFn:({workflowId:e,input:t})=>xS.runWorkflow(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`runs`]})}})}var dF=5;function fF(e){return`t4h-panel:payloads:${e}`}function pF(e){try{let t=localStorage.getItem(fF(e)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function mF(e,t){let n=[t,...pF(e).filter(e=>e!==t)].slice(0,dF);try{localStorage.setItem(fF(e),JSON.stringify(n))}catch(e){console.error(`Failed to save recent payloads:`,e)}return n}var hF=5;function gF({workflow:e,manifest:t}){let n=Jr(),r=Gr().state?.input,[i,a]=(0,b.useState)(()=>pF(e.id)),[o,s]=(0,b.useState)(()=>r===void 0?i[0]??Zj(ON(e.schema)):Zj(r)),[c,l]=(0,b.useState)(null),u=uF(),d=mt(wS.runs({workflow:e.id,limit:hF})),f=()=>Zj(ON(e.schema)),p=()=>{let e=o.trim();return e===``?void 0:JSON.parse(e)},m=oS(`runs`,{project:t.id,workflow:e.id}),h=()=>{try{navigator.clipboard?.writeText(cS(`runs`,m,p())).catch(console.error),l(null)}catch(e){l(DN(e))}},g=async()=>{let t;try{t=p()}catch(e){l(DN(e));return}try{let{id:r}=await u.mutateAsync({workflowId:e.id,input:t});a(mF(e.id,Zj(t))),l(null),n(`/runs/${r}`)}catch(e){l(DN(e))}},_=e.authorization??t.authorization;return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,gap:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:e.id}),(0,O.jsxs)(q,{row:!0,gap:8,children:[e.authorization&&(0,O.jsx)(CM,{color:J.warn,children:`own authorization`}),(0,O.jsx)(CM,{color:e.schema?J.brand:J.muted,children:e.schema?`typed input`:`untyped input`})]})]}),(0,O.jsx)(Z,{children:e.description??`No description declared on this workflow.`})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Run`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Rj,{appearance:`ghost`,text:`Reset to example`,onPress:()=>s(f())}),(0,O.jsx)(Rj,{appearance:rS.capabilities.trigger?`ghost`:`outline`,text:`Copy as curl`,onPress:h}),rS.capabilities.trigger&&(0,O.jsx)(Rj,{appearance:`solid`,text:u.isPending?`Running…`:`Run workflow`,isDisabled:u.isPending,onPress:g})]}),children:(0,O.jsxs)(q,{gap:12,children:[(0,O.jsx)(Z,{variant:`label`,children:`Input body`}),(0,O.jsx)(wN,{value:o,onChange:s,error:c}),i.length>0&&(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Recent payloads`}),(0,O.jsx)(q,{row:!0,gap:6,style:{flexWrap:`wrap`},children:i.map((e,t)=>(0,O.jsx)(hM,{color:J.text,onPress:()=>s(e),children:e.replaceAll(/\s+/g,` `).slice(0,60)},t))})]}),!rS.capabilities.trigger&&(0,O.jsx)(Z,{fontSize:12,children:`This host only accepts authorized requests: copy the curl, add the credentials the authorization expects and send it.`})]})}),(0,O.jsx)(TN,{title:`Routes`,actions:_?(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`auth: ${_.pathToModule}`}):(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:`no authorization declared`}),children:(0,O.jsxs)(q,{bg:J.background,gap:8,children:[(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.info,children:sS(`runs`)}),(0,O.jsx)(Z,{variant:`mono`,children:m})]}),(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.warn,children:sS(`advance`)}),(0,O.jsx)(Z,{variant:`mono`,children:oS(`advance`,{project:t.id,workflow:e.id})})]})]})}),(0,O.jsx)(TN,{title:`Input schema`,actions:e.schema?(0,O.jsx)(CP,{text:Zj(e.schema),label:`Copy JSON`}):void 0,children:(0,O.jsx)(wM,{value:e.schema?Zj(e.schema):`No schema: any JSON body is accepted.`,color:e.schema?J.text:J.muted})}),(0,O.jsx)(TN,{title:`Recent runs`,actions:(0,O.jsx)(LP,{to:`/runs?workflow=${encodeURIComponent(e.id)}&rootOnly=false`,children:`View all`}),children:d.isPending?(0,O.jsx)(Tj,{}):(d.data?.runs.length??0)===0?(0,O.jsx)(Z,{children:rS.capabilities.rebuild?`No runs of this workflow since the last build.`:`No runs of this workflow yet.`}):(0,O.jsx)(q,{bg:J.background,gap:8,children:d.data?.runs.map(e=>(0,O.jsx)(sa,{to:`/runs/${e.id}`,style:{textDecoration:`none`},children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,children:[(0,O.jsx)(CM,{color:fS[e.status],children:pS[e.status]}),(0,O.jsx)(Z,{variant:`mono`,color:J.text,children:e.id}),(0,O.jsx)(Z,{fontSize:12,children:Yj(e.createdAt)})]})},e.id))})})]})]})}function _F(e){let t=e.schema?.properties;if(!t)return e.schema?`schema`:`any input`;let n=new Set(e.schema?.required??[]);return Object.keys(t).map(e=>n.has(e)?e:`${e}?`).join(`, `)}function vF(){let{workflowId:e}=Xr(),t=Jr(),{data:n,error:r}=mt(wS.manifest()),i=n?.workflows.find(t=>t.id===e);return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Workflows`}),(0,O.jsx)(hM,{children:`${n?.workflows.length??0} registered`})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:r?(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:String(r)})}):n?n.workflows.length===0?(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{children:`The app declares no workflows.`})}):n.workflows.map(n=>(0,O.jsxs)(_M,{isSelected:n.id===e,onSelect:()=>t(`/workflows/${encodeURIComponent(n.id)}`),children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:n.id===e?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:n.id}),n.description&&(0,O.jsx)(Z,{fontSize:12,numberOfLines:2,children:n.description}),(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:11,numberOfLines:1,children:_F(n)})]},n.id)):(0,O.jsx)(Tj,{})})]}),children:n&&i?(0,O.jsx)(gF,{workflow:i,manifest:n},i.id):(0,O.jsx)(gM,{icon:Zx,children:n&&e?`Workflow "${e}" is not in the manifest`:`Select a workflow to run it or read its schema`})})}E.get().tokens.set({"space.0":0,"space.025":2,"space.050":4,"space.075":6,"space.100":8,"space.150":12,"space.200":16,"space.250":20,"space.300":24,"space.400":32,"space.500":40,"space.600":48,"space.700":56,"space.800":64,"space.900":72,"space.1000":80});var yF=E.get().fork(`t4h:light`);yF.tokens.set({"font.family.body":`Inter`,"font.family.heading":`Sora`,"color.background.neutral":`#EEE`,"color.background.neutral:hovered":`#DDD`,"color.background.neutral:pressed":`#CCC`,"color.neutral":`#eaeaea`,"%color.neutral.darker":`#bababa`,"color.background.brand.bold":`#443ee3`,"color.background.brand.bold:hovered":`#3330b4`,"color.background.brand.bold:pressed":`#222080`,"color.text.inverse":`#FFF`,"color.text":`#292A2E`,"button.outline.color.border":`#8c8c8c`,"button.outline.color.border:hovered":`@color.background.brand.bold`,"button.outline.color.border:pressed":`@color.background.brand.bold:hovered`,"button.outline.color.text":`@button.outline.color.border`,"button.outline.color.text:hovered":`@color.background.brand.bold`,"button.outline.color.text:pressed":`@color.background.brand.bold:hovered`,"button.outline.color.text:selected":`@color.text.inverse`,"button.outline.color.background:selected":`@color.background.brand.bold`,"button.outline.primary.hovered.color.background":`#edf1ff`});var bF=yF.fork(`dark`);bF.tokens.set({"color.background":`#0b1326`,"color.background.neutral":`#131b2e`,"color.background.neutral.subtle":`#171f33`,"color.surface":`#1a2235`,"color.surface.raised":`#222a3d`,"color.text":`#dae2fd`,"color.text.subtle":`#8896b3`,"color.text.placeholder":`#525f7a`,"color.text.inverse":`#0b1326`,"color.background.brand.bold":`#48BA80`,"color.background.brand.subtle":`#1a3328`,"color.text.brand":`#48BA80`,"color.border.brand":`#48BA80`,"color.border":`#2d3449`,"color.border.strong":`#464554`,"color.background.error.bold":`#ffb4ab`,"color.background.error.subtle":`#3b0f12`,"color.text.error":`#ffb4ab`,"color.text.success":`#4ade80`,"color.background.success.bold":`#4ade80`,"text-input.color.background":`#131b2e`,"text-input.color.text":`#dae2fd`,"text-input.color.outline.focused":`#48BA80`,"text-input.color.outline.blured":`#2d3449`,"button.solid.color.background":`#48BA80`,"button.solid.color.text":`#0b1326`,"button.solid.hovered.color.background":`#5fcb8f`,"button.solid.pressed.color.background":`#3fa872`,"button.solid.selected.color.background":`#3fa872`,"button.solid.selected.hovered.color.background":`#5fcb8f`,"button.solid.selected.pressed.color.background":`#369663`,"button.solid.loading.color.background":`#48BA80`,"button.solid.selected.loading.color.background":`#3fa872`,"button.solid.disabled.color.background":`#1a3328`,"button.solid.disabled.color.text":`#525f7a`,"button.outline.color.text":`#dae2fd`,"button.outline.color.border":`#2d3449`,"button.outline.color.background":`#0b1326`,"button.outline.hovered.color.border":`#48BA80`,"button.outline.hovered.color.background":`#131b2e`,"button.outline.pressed.color.border":`#48BA80`,"button.outline.pressed.color.background":`#1a3328`,"button.outline.selected.color.background":`#1a3328`,"button.outline.selected.hovered.color.background":`#222a3d`,"button.outline.selected.pressed.color.background":`#222a3d`,"button.outline.loading.color.background":`#0b1326`,"button.outline.selected.loading.color.background":`#1a3328`,"button.outline.disabled.color.text":`#525f7a`,"button.outline.disabled.color.border":`#2d3449`,"button.outline.disabled.color.background":`#0b1326`,"button.ghost.color.text":`#dae2fd`,"button.ghost.hovered.color.text":`#48BA80`,"button.ghost.pressed.color.text":`#3fa872`,"button.ghost.selected.color.text":`#48BA80`,"button.ghost.selected.hovered.color.text":`#5fcb8f`,"button.ghost.selected.pressed.color.text":`#3fa872`,"button.ghost.loading.color.text":`#dae2fd`,"button.ghost.selected.loading.color.text":`#48BA80`,"button.ghost.disabled.color.text":`#525f7a`});var xF=TS();document.title=rS.title;function SF(){return(0,O.jsx)(te,{client:xF,children:(0,O.jsxs)(k,{theme:bF,children:[(0,O.jsx)(oM,{}),(0,O.jsx)(oa,{basename:rS.basePath||void 0,children:(0,O.jsx)(ba,{children:(0,O.jsx)(iM,{children:(0,O.jsxs)(bi,{children:[(0,O.jsx)(vi,{path:`/`,element:(0,O.jsx)(dM,{})}),(0,O.jsx)(vi,{path:`/workflows`,element:(0,O.jsx)(vF,{})}),(0,O.jsx)(vi,{path:`/workflows/:workflowId`,element:(0,O.jsx)(vF,{})}),(0,O.jsx)(vi,{path:`/runs`,element:(0,O.jsx)(lF,{})}),(0,O.jsx)(vi,{path:`/runs/:runId`,element:(0,O.jsx)(lF,{})}),(0,O.jsx)(vi,{path:`/inbox`,element:(0,O.jsx)(MN,{})})]})})})})]})})}var CF=document.getElementById(`root`);if(!CF)throw Error(`#root element not found`);(0,y.createRoot)(CF).render((0,O.jsx)(b.StrictMode,{children:(0,O.jsx)(SF,{})}));
44
+ `)}return String(e)}function ON(e){if(!e)return{};if(`default`in e)return e.default;if(`const`in e)return e.const;if(Array.isArray(e.examples)&&e.examples.length)return e.examples[0];if(Array.isArray(e.enum)&&e.enum.length)return e.enum[0];let t=e.anyOf??e.oneOf??e.allOf;if(t?.[0])return ON(t[0]);switch(Array.isArray(e.type)?e.type[0]:e.type){case`object`:return Object.fromEntries(Object.entries(e.properties??{}).map(([e,t])=>[e,ON(t)]));case`array`:{let t=Array.isArray(e.items)?e.items[0]:e.items;return t?[ON(t)]:[]}case`string`:return typeof e.format==`string`?kN(e.format):``;case`number`:case`integer`:return typeof e.minimum==`number`?e.minimum:0;case`boolean`:return!1;case`null`:return null;default:return e.properties?ON({...e,type:`object`}):null}}function kN(e){switch(e){case`date-time`:return new Date().toISOString();case`date`:return new Date().toISOString().slice(0,10);case`email`:return`name@example.com`;case`uri`:case`url`:return`https://example.com`;case`uuid`:return`00000000-0000-0000-0000-000000000000`;default:return``}}function AN({activity:e,appId:t}){let[n,r]=(0,b.useState)(()=>Zj(ON(e.schema??null))),[i,a]=(0,b.useState)(null),o=EN(),s=`${oS(`advance`,{project:t??void 0,workflow:e.workflowId,run:e.run,activity:e.id})}?token=<callback token>`,c=()=>{let e=n.trim();return e===``?void 0:JSON.parse(e)};return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,justify:`space-between`,align:`flex-start`,gap:12,children:[(0,O.jsxs)(q,{gap:8,flex:1,minW:0,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:e.type}),(0,O.jsxs)(q,{row:!0,gap:8,style:{flexWrap:`wrap`},children:[(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`activity ${e.id}`}),(0,O.jsx)(hM,{onPress:()=>$j(e.run),children:`run ${e.run}`})]})]}),(0,O.jsx)(sa,{to:`/runs/${e.run}?activity=${e.id}`,style:{textDecoration:`none`},children:(0,O.jsx)(Rj,{appearance:`outline`,text:`Open run`,iconAfter:SM})})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Advance`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Rj,{appearance:rS.capabilities.advance?`ghost`:`outline`,text:`Copy as curl`,onPress:()=>{try{$j(cS(`advance`,s,c())),a(null)}catch(e){a(DN(e))}}}),rS.capabilities.advance&&(0,O.jsx)(Rj,{appearance:`solid`,text:o.isPending?`Advancing…`:`Advance activity`,isDisabled:o.isPending,onPress:async()=>{let t;try{t=c()}catch(e){a(DN(e));return}try{await o.mutateAsync({activityId:e.id,payload:t}),a(null)}catch(e){a(DN(e))}}})]}),children:(0,O.jsxs)(q,{gap:12,children:[(0,O.jsx)(Z,{variant:`label`,children:`Payload`}),(0,O.jsx)(wN,{value:n,onChange:r,error:i,minLines:5}),(0,O.jsx)(Z,{fontSize:12,children:rS.capabilities.advance?`The payload is validated against the schema below before the activity resumes.`:`This host advances through the callback URL: copy the curl, replace the token with the one from the activity, and add any auth the activity declared.`})]})}),(0,O.jsx)(TN,{title:`Details`,children:(0,O.jsxs)(q,{gap:16,children:[(0,O.jsx)(zM,{label:`Workflow`,children:e.workflowId}),(0,O.jsx)(zM,{label:`Pending`,children:e.pending}),(0,O.jsx)(zM,{label:`Times out at`,children:e.timeoutAt===void 0?`never (waits for an external advance)`:(0,O.jsx)(RM,{to:e.timeoutAt,variant:`mono`,children:t=>`${new Date(e.timeoutAt??``).toLocaleString()} (${t===null?`timing out…`:`in ${t}`})`})}),(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Route`}),(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.warn,children:sS(`advance`)}),(0,O.jsx)(Z,{variant:`mono`,children:s})]})]})]})}),(0,O.jsx)(TN,{title:`Expected payload schema`,children:(0,O.jsx)(wM,{value:e.schema?Zj(e.schema):`No schema: any payload is accepted.`,color:e.schema?J.text:J.muted})})]})]})}function jN(e){return Math.max(Math.ceil(e/25)-1,0)*25}function MN(){let[e,t]=(0,b.useState)(0),[n,r]=(0,b.useState)(null),{data:i}=mt(wS.manifest()),{data:a,isPending:o,refetch:s}=mt(wS.waitingActivities({limit:25,offset:e})),c=a?.activities??[],l=a?.count??0,u=Math.min(e,jN(l)),d=c.find(e=>e.id===n)??c[0];return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,justify:`space-between`,align:`center`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Waiting activities`}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(hM,{children:`${l} waiting`}),(0,O.jsx)(Rj,{appearance:`ghost`,text:`Refresh`,onPress:()=>void s()})]})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:o?(0,O.jsx)(Tj,{}):c.length===0?(0,O.jsxs)(q,{p:20,row:!0,align:`center`,gap:8,children:[(0,O.jsx)(fM,{size:16,fill:J.brand}),(0,O.jsx)(Z,{color:J.brand,fontSize:14,children:`All clear — nothing is waiting.`})]}):c.map(e=>(0,O.jsxs)(_M,{isSelected:e.id===d?.id,onSelect:()=>r(e.id),children:[(0,O.jsxs)(q,{row:!0,justify:`space-between`,align:`flex-start`,gap:8,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:e.id===d?.id?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:e.type}),(0,O.jsx)(Z,{fontSize:11,children:e.workflowId})]}),(0,O.jsxs)(q,{row:!0,justify:`space-between`,align:`center`,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:eM(e.id)}),e.timeoutAt&&(0,O.jsxs)(q,{row:!0,align:`center`,gap:4,children:[(0,O.jsx)(pM,{size:12,fill:J.muted}),(0,O.jsx)(Z,{fontSize:12,children:new Date(e.timeoutAt).toLocaleTimeString()})]})]})]},e.id))}),(0,O.jsx)(bM,{count:l,offset:u,limit:25,onChange:t})]}),children:d?(0,O.jsx)(AN,{activity:d,appId:i?.id??null},d.id):(0,O.jsx)(gM,{icon:Xx,children:c.length===0?`Nothing is waiting`:`Select an activity to inspect it`})})}function NN({option:e,getOptionLabel:t,textColor:n,...r}){let i=t(e,r),a=bj(n,{duration:300}),o=VA(()=>({color:a.value}),[a]);return typeof i==`string`?(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontWeight:`select.option.label.font.weight`,style:o,children:i}):i}E.get().tokens.set({"select.option.label.color.text":`#1c2024`,"select.option.label.font.weight":`400`});var PN={getOptionKey:(e,t,n)=>`select:${n}:options:${t}`,getOptionLabel:e=>typeof e==`object`?e?`label`in e?e.label:String(e):null:String(e),getOptionValue:e=>typeof e==`object`?e||null:e,getOptionIsSelected:(e,t,n)=>t.isMulti?t.value.includes(e)?!0:t.value.some(t=>n(t)===n(e)):t.value===void 0||t.value===null?!1:t.value===e||n(t.value)===n(e),filterOption:(e,t,n)=>{if(typeof e!=`object`||typeof e.label!=`string`)return!0;if(Array.isArray(n.value)){if(n.value.includes(e))return!1}else if(n.value===e)return!1;return e.label.toLowerCase().includes(t.toLowerCase())},getOptionIsDisabled:e=>typeof e==`object`&&`disabled`in e&&!!e.disabled,displayBackgroundColor:`text-input.color.background`,displayTextColor:`select.option.label.color.text`,displayPlaceholderColor:`text-input.color.placeholder`,displayBorderColor:e=>e.isMenuOpen?`text-input.color.outline.focused`:`text-input.color.outline.blured`,menuBorderColor:e=>e.isMenuOpen?`text-input.color.outline.focused`:`text-input.color.outline.blured`,menuOptionLabelTextColor:`select.option.label.color.text`,menuOptionLabelBackgroundColor:`#00000000`};function FN(e,t,n,{menuOptionLabelTextColor:r=PN.menuOptionLabelTextColor,menuOptionLabelBackgroundColor:i=PN.menuOptionLabelBackgroundColor}){return C(a=>{function o(r){if(!r)return;let i=r;return typeof i==`function`&&(i=i(e,n,t)),a.tokens.has(i)?a.tokens.get(i):i}return{menuOptionLabelText:o(r),menuOptionLabelBackground:o(i)}})}function IN({option:e,selectState:t,getOptionIsSelected:n,getOptionIsDisabled:r,getOptionIsClearable:i,getOptionLabel:a,getOptionValue:o,onSelectOptionPress:s,menuOptionLabelTextColor:c,menuOptionLabelBackgroundColor:l}){let{isHovered:u,isPressed:d,props:f}=Pj(),p=(0,b.useCallback)(t=>s(e,t),[s,e]),m=(0,b.useMemo)(()=>n(e,t,o),[n,o,e,t]),h=(0,b.useMemo)(()=>r(e,t),[r,e,t]),g=(0,b.useMemo)(()=>i(e),[i,e]),_=(0,b.useMemo)(()=>({isHovered:u,isPressed:d,isSelected:m,isDisabled:h,isClearable:g}),[u,d,m,h,g]),v=FN(e,t,_,{menuOptionLabelTextColor:c,menuOptionLabelBackgroundColor:l}),y=bj(v.menuOptionLabelBackground,{duration:300}),x=VA(()=>({backgroundColor:y.value}),[y]);return(0,O.jsx)(q,{as:_j.of(dv),...f,onPress:p,px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,style:x,children:(0,O.jsx)(NN,{option:e,getOptionLabel:a,textColor:v.menuOptionLabelText,..._})})}E.get().tokens.set({"select.menu.option.space.x":`@space.150`,"select.menu.option.space.y":`@space.100`,"select.menu.option.color.background":`#FFF`,"select.menu.option.color.border":`@color.background.brand.bold`});function LN({options:e,selectId:t,selectState:n,isLoading:r,noOptionsMessage:i,loadingMessage:a,getOptionLabel:o,getOptionValue:s,getOptionKey:c,getOptionIsSelected:l,getOptionIsDisabled:u,getOptionIsClearable:d,onSelectOptionPress:f,onLoadMoreRequest:p,menuOptionLabelTextColor:m,menuOptionLabelBackgroundColor:h}){return(0,O.jsx)(gp,{data:e,keyExtractor:(e,n)=>c(e,n,t),style:{maxHeight:200},renderItem:({item:e})=>(0,O.jsx)(IN,{option:e,selectState:n,getOptionLabel:o,getOptionValue:s,getOptionIsSelected:l,getOptionIsDisabled:u,getOptionIsClearable:d,onSelectOptionPress:f,menuOptionLabelTextColor:m,menuOptionLabelBackgroundColor:h}),ListEmptyComponent:r?null:(0,O.jsx)(q,{px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,children:typeof i==`string`?(0,O.jsx)(fx,{children:i}):i}),ListFooterComponent:r?(0,O.jsx)(q,{px:`select.menu.option.space.x`,py:`select.menu.option.space.y`,children:typeof a==`string`?(0,O.jsx)(fx,{children:a}):a}):null,onEndReached:p})}E.get().tokens.set({"select.menu.color.background":`#FFF`,"select.menu.color.border":`@color.background.brand.bold`,"select.menu.space.margin.top":`@space.025`});var RN=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m16.192 6.344-4.243 4.242-4.242-4.242-1.414 1.414L10.535 12l-4.242 4.242 1.414 1.414 4.242-4.242 4.243 4.242 1.414-1.414L13.364 12l4.242-4.242z`})})),$;(function(e){e.Grey=`grey`,e.Blue=`blue`,e.Brand=`brand`})($||={}),E.get().tokens.set({"%tag.removable.color.border":`#FFEBE6`,"%tag.removable.color.text":`#BF2600`,"%tag.removable.color.background":`#FFEBE6`}).set({[`tag.${$.Grey}.color.background`]:`#E8E8EC`,[`tag.${$.Grey}.color.border`]:`#E8E8EC`,[`tag.${$.Grey}.color.text`]:`#60646C`,[`tag.${$.Grey}.hovered.color.background`]:`@tag.${$.Grey}.color.background`,[`tag.${$.Grey}.hovered.color.border`]:`#60646C`,[`tag.${$.Grey}.hovered.color.text`]:`@tag.${$.Grey}.color.text`,[`tag.${$.Grey}.pressed.color.background`]:`@tag.${$.Grey}.hovered.color.background`,[`tag.${$.Grey}.pressed.color.border`]:`@tag.${$.Grey}.hovered.color.border`,[`tag.${$.Grey}.pressed.color.text`]:`@tag.${$.Grey}.hovered.color.text`,[`tag.${$.Grey}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Grey}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Grey}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Grey}.removable.pressed.color.background`]:`@tag.${$.Grey}.removable.hovered.color.background`,[`tag.${$.Grey}.removable.pressed.color.border`]:`@tag.${$.Grey}.removable.hovered.color.border`,[`tag.${$.Grey}.removable.pressed.color.text`]:`@tag.${$.Grey}.removable.hovered.color.text`}).set({[`tag.${$.Blue}.color.background`]:`#EDF1FF`,[`tag.${$.Blue}.color.border`]:`#EDF1FF`,[`tag.${$.Blue}.color.text`]:`#494CDF`,[`tag.${$.Blue}.hovered.color.background`]:`@tag.${$.Blue}.color.background`,[`tag.${$.Blue}.hovered.color.border`]:`#494CDF`,[`tag.${$.Blue}.hovered.color.text`]:`@tag.${$.Blue}.color.text`,[`tag.${$.Blue}.pressed.color.background`]:`@tag.${$.Blue}.hovered.color.background`,[`tag.${$.Blue}.pressed.color.border`]:`@tag.${$.Blue}.hovered.color.border`,[`tag.${$.Blue}.pressed.color.text`]:`@tag.${$.Blue}.hovered.color.text`,[`tag.${$.Blue}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Blue}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Blue}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Blue}.removable.pressed.color.background`]:`@tag.${$.Blue}.removable.hovered.color.background`,[`tag.${$.Blue}.removable.pressed.color.border`]:`@tag.${$.Blue}.removable.hovered.color.border`,[`tag.${$.Blue}.removable.pressed.color.text`]:`@tag.${$.Blue}.removable.hovered.color.text`}).set({[`tag.${$.Brand}.color.background`]:`#EDF1FF`,[`tag.${$.Brand}.color.border`]:`#EDF1FF`,[`tag.${$.Brand}.color.text`]:`@color.background.brand.bold`,[`tag.${$.Brand}.hovered.color.background`]:`@tag.${$.Brand}.color.background`,[`tag.${$.Brand}.hovered.color.border`]:`@color.background.brand.bold`,[`tag.${$.Brand}.hovered.color.text`]:`@tag.${$.Brand}.color.text`,[`tag.${$.Brand}.pressed.color.background`]:`@tag.${$.Brand}.hovered.color.background`,[`tag.${$.Brand}.pressed.color.border`]:`@tag.${$.Brand}.hovered.color.border`,[`tag.${$.Brand}.pressed.color.text`]:`@tag.${$.Brand}.hovered.color.text`,[`tag.${$.Brand}.removable.hovered.color.background`]:`@%tag.removable.color.background`,[`tag.${$.Brand}.removable.hovered.color.border`]:`@%tag.removable.color.border`,[`tag.${$.Brand}.removable.hovered.color.text`]:`@%tag.removable.color.text`,[`tag.${$.Brand}.removable.pressed.color.background`]:`@tag.${$.Brand}.removable.hovered.color.background`,[`tag.${$.Brand}.removable.pressed.color.border`]:`@tag.${$.Brand}.removable.hovered.color.border`,[`tag.${$.Brand}.removable.pressed.color.text`]:`@tag.${$.Brand}.removable.hovered.color.text`});function zN({isPressable:e=!1,isRemovable:t=!1,onPress:n,onRemove:r,color:i=`brand`,children:a}){let o=Pj(),s=Pj(),c=(0,b.useMemo)(()=>({isHovered:o.isHovered,isPressed:o.isPressed,isPressable:e,isRemovable:t,isRemovableHovered:s.isHovered,isRemovablePressed:s.isPressed}),[o.isHovered,o.isPressed,e,t,s.isHovered,s.isPressed]),l=(0,b.useMemo)(()=>{let e=`tag`;return e+=`.${i}`,c.isRemovablePressed?e+=`.removable.pressed`:c.isRemovableHovered?e+=`.removable.hovered`:c.isPressed?e+=`.pressed`:c.isHovered&&(e+=`.hovered`),e},[i,c]),u=xj(`${l}.color.background`,{duration:300}),d=xj(`${l}.color.border`,{duration:300}),f=xj(`${l}.color.text`,{duration:300}),p=VA(()=>({color:f.value}),[f]),m=(()=>{let e=a;return typeof e==`function`&&(e=e(c)),typeof e==`string`?(0,O.jsx)(fx,{as:pj.Text,bold:!0,style:p,children:e}):e})(),h=(0,b.useCallback)(e=>{e.stopPropagation(),r?.(e)},[r]);return(0,O.jsxs)(q,{...o.props,as:_j.of(dv),row:!0,rounded:!0,h:`fit-content`,borderWidth:1,disabled:!e,style:VA(()=>({backgroundColor:u.value,borderColor:d.value}),[u,d]),align:!0,onPress:n,children:[(0,O.jsx)(q,{py:`space.050`,pl:`space.075`,pr:t?`0`:`space.075`,children:m}),t&&(0,O.jsx)(q,{...s.props,as:_j.of(dv),px:`space.050`,onPress:h,children:(0,O.jsx)(RN,{fill:`${l}.color.text`,size:`sm`})})]})}function BN({children:e,onOutsidePress:t}){return e(VN(t,[t]))}function VN(e,t=[]){let n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(e);return(0,b.useEffect)(()=>{i.current=e},t),(0,b.useEffect)(()=>{if(r.current){if(Yl.OS===`web`){let e=r.current;n.current=e.getBoundingClientRect();let t=t=>{e.contains(t.target)||i.current(t)};return document.addEventListener(`mousedown`,t),()=>{document.removeEventListener(`mousedown`,t)}}throw Error(`Not implement for native platforms`)}},[]),(0,b.useCallback)(e=>{r.current=e},[])}var HN=(0,b.createContext)(null);function UN({defaultIsOpen:e=!1,isOpen:t,render:n,onOpenRequest:r,onCloseRequest:i,children:a,shouldFitContainer:o=!1,wrapperProps:s,position:c=`vertical`,animationDuration:l=200,...u}){let d=(0,b.useRef)(null),[f,p]=(0,b.useState)(0),[m,h]=(0,b.useState)(0),[g,_]=(0,b.useState)(`bottom`),[v,y]=(0,b.useState)(e),x=(0,b.useMemo)(()=>t===void 0?v:t,[t,v]),S=(0,b.useCallback)(()=>{i?.(),y(!1)},[i]),C=(0,b.useCallback)(()=>{r?.(),y(!0)},[r]),w=(0,b.useCallback)(()=>{x?S():C()},[x,S,C]),T=(0,b.useMemo)(()=>({isOpen:x,animationDuration:l,toggle:w,close:S,open:C}),[x,w,S,C,l]),E=(0,b.useCallback)(()=>{x&&S()},[S,x]);(0,b.useEffect)(()=>{if(!d.current)return;let e=d.current,t=new ResizeObserver(e=>{for(let t of e)p(t.contentRect.height)});return e.measure((e,t,n,r)=>{p(r),h(n),r>(window.innerHeight||globalThis?.screen?.height||0)-(t+r)?_(`top`):_(`bottom`)}),t.observe(e),()=>t.disconnect()},[]);let[D,k]=(0,b.useState)(!1),ee=vj(+!!x,()=>(k(!0),YE(+!!x,{duration:l},e=>{e&&x&&k(!1)})),[x]),A=(0,b.useMemo)(()=>c===`vertical`?g:c,[c,g]),te=(0,b.useMemo)(()=>A===`left`||A===`right`,[A]),ne=(0,b.useMemo)(()=>{if(A===`top`)return{right:0,top:0};if(A===`left`)return{left:0};if(A===`bottom`)return{right:0,top:`100%`,width:o?`100%`:`auto`};if(A===`right`)return{left:`100%`,top:0};throw Error(`Invalid position: ${A}`)},[A,o]),re=VA(()=>{if(A===`top`)return{opacity:fj(ee.value,[0,1],[0,1]),height:fj(ee.value,[0,1],[0,f]),transform:[{translateY:fj(ee.value,[0,1],[0,-f])}]};if(A===`left`)return{opacity:fj(ee.value,[0,1],[0,1]),width:fj(ee.value,[0,1],[0,m]),transform:[{translateX:fj(ee.value,[0,1],[0,-m])}]};if(A===`bottom`)return{opacity:fj(ee.value,[0,1],[0,1]),height:fj(ee.value,[0,1],[0,f])};if(A===`right`)return{opacity:fj(ee.value,[0,1],[0,1]),width:fj(ee.value,[0,1],[0,m])};throw Error(`Invalid position: ${A}`)},[f,A,m,ee]);return(0,O.jsx)(BN,{onOutsidePress:E,children:e=>(0,O.jsx)(q,{ref:e,position:`relative`,...u,children:(0,O.jsxs)(HN.Provider,{value:T,children:[n(T),(0,O.jsx)(q,{as:pj.View,position:`absolute`,overflow:D?`hidden`:`visible`,...s,style:[{zIndex:10},ne,re,s?.style],children:(0,O.jsx)(Ed,{ref:d,style:{alignSelf:`flex-start`,width:te?void 0:`100%`},children:typeof a==`function`?a(T):a})})]})})})}var WN=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m11.998 17 7-8h-14z`})}));function GN({size:e=`md`,fill:t,animationDuration:n}){let{isOpen:r,animationDuration:i}=(0,b.useContext)(HN),a=vj(r?`180deg`:`0deg`,()=>YE(r?`180deg`:`0deg`,{duration:n??i}),[r,n,i]),o=VA(()=>({transform:[{rotate:a.value}]}),[a]);return(0,O.jsx)(pj.View,{style:o,children:(0,O.jsx)(WN,{size:e,fill:t})})}function KN({selectId:e,value:t,search:n,placeholder:r,isSearchable:i,isLoading:a,isDisabled:o,isClearable:s,enableCaretIndicator:c,getOptionKey:l,getOptionLabel:u,getOptionIsClearable:d,onOptionRemoveRequest:f,onOpenMenuRequest:p,onSearch:m,onClearRequest:h,displayBackgroundColor:g,displayBorderColor:_,displayPlaceholderColor:v,displayCaretIndicatorColor:y}){let x=bj(_,{duration:300}),S=bj(g,{duration:300}),C=bj(v,{duration:300}),w=VA(()=>({color:C.value}),[C]),T=VA(()=>({backgroundColor:S.value,borderColor:x.value}),[S,x]),E=(0,b.useMemo)(()=>!(!o&&i),[o,i]);return(0,O.jsxs)(q,{as:pj.View,row:!0,align:!0,rounded:!0,px:t.length?`space.100`:`text-input.padding-x`,py:t.length?3:`text-input.padding-y`,borderWidth:1,style:T,children:[(0,O.jsxs)(q,{flex:1,row:!0,align:!0,flexWrap:`wrap`,gap:`select.display.multi.space.gap`,children:[!t.length&&(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontFamily:`text-input.font.family`,fontSize:`text-input.font.size`,style:w,children:r}),t.map((t,n)=>{let r=d(t)&&!o;return(0,O.jsx)(zN,{color:o?`grey`:`brand`,isRemovable:r,onRemove:()=>f(t),children:e=>u(t,{isHovered:e.isHovered,isPressed:e.isPressed,isClearable:r,isDisabled:!1,isSelected:!0})},`${l(t,n,e)}:multi-option-selected`)}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(CN,{value:n,onChange:m,isReadOnly:E,editable:!E,onFocus:p,style:{borderWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,backgroundColor:`transparent`}})})]}),(0,O.jsxs)(q,{row:!0,align:!0,children:[a&&(0,O.jsx)(Tj,{size:`sm`}),s&&!o&&!!t.length&&(0,O.jsx)(Fj,{onPress:h,children:()=>(0,O.jsx)(RN,{size:`md`})}),c&&(0,O.jsx)(GN,{fill:y})]})]})}E.get().tokens.set({"select.display.multi.space.gap":`@space.050`,"select.display.multi.color.border":`@color.background.brand.bold`});function qN({value:e,search:t,isDisabled:n,isLoading:r,isClearable:i,isMenuOpen:a,isSearchable:o,enableCaretIndicator:s,placeholder:c,getOptionLabel:l,onSearch:u,onClearRequest:d,onOpenMenuRequest:f,displayBackgroundColor:p,displayBorderColor:m,displayTextColor:h,displayCaretIndicatorColor:g,displayPlaceholderColor:_}){let v=bj(m,{duration:300}),y=bj(p,{duration:300}),x=bj(_,{duration:300}),S=VA(()=>({color:x.value}),[x]),C=VA(()=>({backgroundColor:y.value,borderColor:v.value}),[y,v]),w=(0,b.useMemo)(()=>!(!n&&o),[n,o]),T=(0,b.useRef)(null);return(0,b.useEffect)(()=>{a&&T.current?.focus()},[a]),(0,O.jsxs)(q,{as:pj.View,position:`relative`,rounded:!0,px:`text-input.padding-x`,py:`text-input.padding-y`,borderWidth:1,style:C,children:[!t&&(0,O.jsxs)(q,{position:`absolute`,inset:0,px:`text-input.padding-x`,py:`text-input.padding-y`,row:!0,children:[!e&&(0,O.jsx)(fx,{as:pj.Text,numberOfLines:1,ellipsizeMode:`tail`,fontFamily:`text-input.font.family`,fontSize:`text-input.font.size`,style:S,children:c}),e&&(0,O.jsx)(NN,{option:e,getOptionLabel:l,isHovered:!1,isPressed:!1,isDisabled:!1,isSelected:!0,isClearable:!1,textColor:h})]}),(0,O.jsxs)(q,{row:!0,children:[(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(CN,{ref:T,value:t,onChange:u,isReadOnly:w,onFocus:f,style:{borderWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,backgroundColor:`transparent`}})}),(0,O.jsxs)(q,{ml:`auto`,row:!0,gap:`space.100`,children:[r&&(0,O.jsx)(Tj,{size:`sm`}),i&&!n&&e&&(0,O.jsx)(Fj,{onPress:d,children:()=>(0,O.jsx)(RN,{size:`md`})}),s&&(0,O.jsx)(GN,{fill:g})]})]})]})}function JN({isMulti:e,isMenuOpen:t,isDisabled:n,isClearable:r,value:i,placeholder:a,isSearchable:o,enableCaretIndicator:s,search:c,selectId:l,isLoading:u,getOptionLabel:d,getOptionIsClearable:f,getOptionKey:p,onOpenMenuRequest:m,onSearch:h,onOptionRemoveRequest:g,onClearRequest:_,displayBackgroundColor:v,displayBorderColor:y,displayTextColor:b,displayCaretIndicatorColor:x,displayPlaceholderColor:S}){return e?(0,O.jsx)(KN,{selectId:l,isClearable:r,isDisabled:n,isMenuOpen:t,isSearchable:o,isLoading:u,displayCaretIndicatorColor:x,enableCaretIndicator:s,value:i,getOptionLabel:d,getOptionIsClearable:f,getOptionKey:p,search:c,placeholder:a,onSearch:h,onClearRequest:_,onOptionRemoveRequest:g,displayBackgroundColor:v,displayBorderColor:y,displayPlaceholderColor:S,onOpenMenuRequest:m}):(0,O.jsx)(qN,{isClearable:r,isDisabled:n,isSearchable:o,isLoading:u,isMenuOpen:t,onClearRequest:_,value:i,placeholder:a,search:c,getOptionLabel:d,onSearch:h,onOpenMenuRequest:m,displayBackgroundColor:v,displayBorderColor:y,displayTextColor:b,enableCaretIndicator:s,displayCaretIndicatorColor:x,displayPlaceholderColor:S})}function YN({onSelectInputPress:e,...t}){return(0,O.jsx)(dv,{onPress:e,children:(0,O.jsx)(JN,{...t})})}function XN(e,{displayTextColor:t=PN.displayTextColor,displayBackgroundColor:n=PN.displayBackgroundColor,displayBorderColor:r=PN.displayBorderColor,displayCaretIndicatorColor:i,menuBorderColor:a=PN.menuBorderColor,displayPlaceholderColor:o=PN.displayPlaceholderColor}){return C(s=>{function c(t){if(!t)return;let n=t;return typeof n==`function`&&(n=n(e)),s.tokens.has(n)?s.tokens.get(n):n}return{displayText:c(t),displayBackground:c(n),displayBorder:c(r),displayCaretIndicator:c(i),displayPlaceholder:c(o),menuBorder:c(a)}})}function ZN({options:e,value:t,isLoading:n,isMulti:r=!1,isMenuOpen:i,isSearchable:a=!1,enableCaretIndicator:o=!1,placeholder:s=`...`,isClearable:c=!1,closeMenuOnSelect:l=!r,noOptionsMessage:u=`No options...`,loadingMessage:d=`Loading...`,isDisabled:f=!1,isEager:p=!1,filterOption:m=PN.filterOption,getOptionKey:h=PN.getOptionKey,getOptionLabel:g=PN.getOptionLabel,getOptionValue:_=PN.getOptionValue,getOptionIsSelected:v=PN.getOptionIsSelected,getOptionIsDisabled:y=PN.getOptionIsDisabled,getMenuOptionLabel:x=g,getDisplayOptionLabel:S=g,onChange:C,onSearch:w,onLoadMoreRequest:T,displayBackgroundColor:E,displayBorderColor:D,displayTextColor:k,displayCaretIndicatorColor:ee,displayPlaceholderColor:A,menuBorderColor:te,menuOptionLabelTextColor:ne,menuOptionLabelBackgroundColor:re}){let ie=(0,b.useId)(),[j,M]=(0,b.useState)(()=>{if(typeof e==`function`)return[];if(e===void 0)throw Error(`options is required`);return e}),[ae,oe]=(0,b.useState)(()=>t===void 0?r?[]:null:t);(0,b.useEffect)(()=>{t!==void 0&&oe(t)},[t,oe]);let[se,N]=(0,b.useState)(``),[ce,le]=(0,b.useState)(()=>typeof j==`function`),[ue,de]=(0,b.useState)(!1),fe=(0,b.useMemo)(()=>i===void 0?!f&&ue:i,[ue,f,i]),pe=(0,b.useMemo)(()=>n===void 0?ce:n,[n,ce]),me=(0,b.useMemo)(()=>!!c,[c]),he=(0,b.useMemo)(()=>({options:j,value:ae,isLoading:pe,isMenuOpen:fe,isMulti:r,isClearable:me}),[j,ae,pe,fe,r,me]),ge=(0,b.useMemo)(()=>j.filter(e=>m(e,se,he)).filter(e=>!v(e,he,_)),[j,m,v,_,se,he]),_e=(0,b.useCallback)(e=>typeof c==`function`?c(e):r?!0:c,[r,c]),P=(0,b.useCallback)(e=>{oe(e),C?.(e),l&&de(!1)},[C,l]),ve=(0,b.useCallback)(e=>{let t=Array.isArray(ae)?ae.includes(e)?ae.toSpliced(ae.indexOf(e),1):[...ae,e]:e;P(t)},[ae,P]),F=(0,b.useCallback)(e=>ve(e),[ve]),ye=(0,b.useCallback)(e=>{N(e),w?.(e)},[w]),I=(0,b.useCallback)(e=>F(e),[F]),be=(0,b.useCallback)(()=>P(typeof c==`function`?Array.isArray(ae)?ae.filter(e=>!_e(e)):null:Array.isArray(ae)?[]:null),[P,c,ae,_e]);(0,b.useEffect)(()=>{if(typeof e!=`function`)return M(e);f||(p||fe)&&(le(!0),Promise.resolve(e(se)).then(e=>M(e)).finally(()=>le(!1)))},[e,fe,f,se,p]),(0,b.useEffect)(()=>{se!==``&&!fe&&ye(``)},[fe,se,ye]);let xe=(0,b.useCallback)(()=>{de(!0)},[]),L=(0,b.useCallback)(()=>{de(!1)},[]),Se=XN(he,{displayBackgroundColor:E,displayBorderColor:D,displayTextColor:k,displayCaretIndicatorColor:ee,displayPlaceholderColor:A,menuBorderColor:te}),Ce=bj(Se.menuBorder,{duration:300}),we=VA(()=>({borderColor:Ce.value}),[Ce]),Te=(0,b.useMemo)(()=>typeof o==`function`?o(he):o,[o,he]);return(0,O.jsx)(UN,{shouldFitContainer:!0,flex:1,isOpen:fe,onOpenRequest:xe,onCloseRequest:L,position:`vertical`,wrapperProps:{rounded:!0,borderWidth:1,style:we,bg:`white`,marginTop:-1,overflow:`hidden`},render:({open:e})=>(0,O.jsx)(YN,{isDisabled:f,isMenuOpen:fe,isMulti:r,enableCaretIndicator:Te,isSearchable:a,isLoading:pe,isClearable:me,selectId:ie,value:ae,placeholder:s,search:se,getOptionKey:h,getOptionLabel:S,getOptionIsClearable:_e,onSearch:ye,onSelectInputPress:e,onOpenMenuRequest:xe,onOptionRemoveRequest:I,onClearRequest:be,displayBackgroundColor:Se.displayBackground,displayBorderColor:Se.displayBorder,displayTextColor:Se.displayText,displayCaretIndicatorColor:Se.displayCaretIndicator,displayPlaceholderColor:Se.displayPlaceholder}),children:(0,O.jsx)(LN,{isMenuOpen:fe,isLoading:pe,options:ge,selectId:ie,selectState:he,noOptionsMessage:u,loadingMessage:d,getOptionLabel:x,getOptionValue:_,getOptionKey:h,getOptionIsSelected:v,getOptionIsDisabled:y,getOptionIsClearable:_e,onSelectOptionPress:F,onLoadMoreRequest:T,menuOptionLabelTextColor:ne,menuOptionLabelBackgroundColor:re})})}function QN({isChecked:e,size:t=`md`,onChange:n}){let[r,i]=(0,b.useState)(!1),a=(0,b.useMemo)(()=>e===void 0?r:e,[e,r]),[o,s]=(0,b.useMemo)(()=>{let e=(()=>{if(t===`sm`)return 16;if(t===`md`)return 18;throw Error(`Invalid size`)})();return[e,e*2]},[t]),c=(0,b.useMemo)(()=>o-4,[o]),l=(0,b.useMemo)(()=>s-c-4,[s,c]),u=vj(+!!a,()=>YE(+!!a,{duration:200}),[a]),d=xj(a?`switch.checked.background.color`:`switch.background.color`,{duration:200}),f=VA(()=>({transform:[{translateX:u.value*l}]}),[u,l]),p=VA(()=>({backgroundColor:d.value}),[d]),m=(0,b.useCallback)(()=>{i(!r),n?.(!r)},[n,r]);return(0,O.jsx)(q,{as:_j.of(dv),h:o,w:s,rounded:`full`,p:2,position:`relative`,onPress:m,style:p,children:(0,O.jsx)(q,{as:pj.View,position:`absolute`,rounded:`full`,w:c,h:c,bg:`#FFF`,style:f})})}E.get().tokens.set({"switch.background.color":`#74788D`,"switch.checked.background.color":`@color.background.brand.bold`});function $N({at:e,...t}){let n=Wj(e),r=LM({initialTime:n,intervalInMs:DM(Date.now()-n)});return(0,O.jsx)(Z,{...t,children:Yj(e,n+r)})}function eP({run:e,isSelected:t,onSelect:n}){return(0,O.jsxs)(_M,{isSelected:t,onSelect:n,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:t?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:e.workflow}),(0,O.jsx)($N,{at:e.createdAt,fontSize:12})]}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(CM,{color:fS[e.status],children:pS[e.status]}),e.parentWorkflowRun&&(0,O.jsx)(CM,{color:J.muted,children:`child`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,numberOfLines:1,children:e.id})]})]})}var tP=tx(e=>(0,O.jsxs)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:[(0,O.jsx)(Jx,{d:`M12 5c-3.859 0-7 3.141-7 7s3.141 7 7 7 7-3.141 7-7-3.141-7-7-7zm0 12c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z`}),(0,O.jsx)(Jx,{d:`M12 9c-1.627 0-3 1.373-3 3s1.373 3 3 3 3-1.373 3-3-1.373-3-3-3z`})]}));function nP(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function rP(e,t){return nP(e,t)??t}function iP(e,t,n){try{return e(t)}catch(e){return n?St(25,t,e,n):St(24,t,e),null}}function aP(e){function t(t){if(t===void 0)return null;let n=Array.isArray(t);return n&&t[0]===void 0?null:(t=n?t[0]:typeof t==`string`?t:``,iP(e.parse,t))}return{type:`single`,eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide(n){return t(n)??e}}},withOptions(e){return{...this,...e}}}}var oP=aP({parse:e=>e,serialize:String}),sP=aP({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>``+Math.round(e)});aP({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>``+Math.round(e+1)}),aP({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return t<`0`||!(t.length&1)?t:`0`+t}}),aP({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});var cP=aP({parse:e=>e.toLowerCase()===`true`,serialize:String});function lP(e,t){return e.valueOf()===t.valueOf()}aP({parse:e=>{let t=new Date(parseInt(e));return+t==+t?t:null},serialize:e=>``+e.valueOf(),eq:lP}),aP({parse:e=>{let t=new Date(e);return+t==+t&&uP.parse(e)?t:null},serialize:e=>e.toISOString(),eq:lP});var uP=aP({parse:e=>{let t=new Date(e.slice(0,10));return+t==+t&&uP.serialize(t)===e.slice(0,10)?t:null},serialize:e=>e.toISOString().slice(0,10),eq:lP});function dP(e){return aP({parse:t=>{let n=t;return e.includes(n)?n:null},serialize:String})}function fP(e,{clearOnDefault:t=!0,urlKeys:n={},processUrlSearchParams:r}={}){function i(i,a={}){let[o,s,c]=pP(i)?mP(i):[``,new URLSearchParams,``],l=pP(i)?a:i;if(l===null){for(let t of Object.keys(e)){let e=rP(n,t);s.delete(e)}return r&&(s=r(s)),o+Tt(s)+c}for(let r of Object.keys(e)){let i=e[r],a=nP(l,r);if(a===void 0)continue;let o=rP(n,r),c=i.defaultValue!==void 0&&a!==null&&(i.eq??an)(a,i.defaultValue);if(a===null||(i.clearOnDefault??t??!0)&&c)s.delete(o);else{let e=i.serialize(a);s=Bt(s,o,e)}}return r&&(s=r(s)),o+Tt(s)+c}return i}function pP(e){return typeof e==`string`||e instanceof URLSearchParams||e instanceof URL}function mP(e){if(typeof e==`string`){let[t=``,...n]=e.split(`#`),r=n.length?`#`+n.join(`#`):``,[i=``,...a]=t.split(`?`);return[i,new URLSearchParams(a.join(`?`)),r]}if(e instanceof URLSearchParams)return[``,new URLSearchParams(e),``];{let t=e.href.length-e.search.length-e.hash.length,n=e.href.slice(0,t).replace(/[?#]+$/,``),r=e.hash||(e.href.endsWith(`#`)?`#`:``);return[n,new URLSearchParams(e.searchParams),r]}}var hP=kt(`sync-emitter`,()=>Ht()),gP={},_P=(e,t)=>e===`defaultValue`?void 0:t;function vP(e,t={}){let n=(0,b.useId)(),r=Pt(),i=Ft(),{history:a=r?.history??`replace`,scroll:o=r?.scroll??!1,shallow:s=r?.shallow??!0,throttleMs:c=Rt.timeMs,limitUrlUpdates:l=r?.limitUrlUpdates,clearOnDefault:u=r?.clearOnDefault??!0,startTransition:d,urlKeys:f=gP}=t,p=Object.keys(e).join(`,`),m=(0,b.useRef)(e),h=m.current,g=JSON.stringify(Object.entries(h),_P)===JSON.stringify(Object.entries(e),_P)&&Object.entries(e).every(([e,t])=>{if(h[e]?.startTransition!==t.startTransition)return!1;let n=h[e]?.defaultValue,r=t.defaultValue;return Object.is(n,r)?!0:n!==void 0&&r!==void 0&&t.eq?.(n,r)===!0})?h:e;m.current=g;let _=(0,b.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,rP(f,e)])),[p,JSON.stringify(f)]),v=Object.values(_),y=Nt(v),x=y.searchParams,S=(0,b.useRef)(null),C=(0,b.useRef)(null),w=$t(v),[T]=(0,b.useState)(()=>{let t={},[,n]=yP(e,_,x,w,t);return[n,t]}),E=(0,b.useRef)(T[1]),[D,O]=(0,b.useState)(T[0]),k=(0,b.useRef)(D),ee=e=>JSON.stringify([v.map(t=>[t,e.getAll(t)]),w]),A=ee(x),te=()=>{let[t,r]=yP(e,_,x,w,E.current,k.current);return t&&(xt(1,n,p,r),k.current=r,O(r)),t},ne=Object.keys(E.current).join(`&`)!==v.join(`&`),re=C.current===null||C.current===(y.pathname??location.pathname);if(ne)S.current=A,te(),E.current=Object.fromEntries(Object.entries(_).map(([t,n])=>[n,e[t]?.type===`multi`?x.getAll(n):x.get(n)]));else{let e=!1;re&&S.current!==A&&(S.current=A,e=te()),!e&&D!==k.current&&(re||y.pathname===void 0&&S.current===ee(new URLSearchParams(location.search)))&&O(k.current)}(0,b.useEffect)(()=>{C.current=y.pathname??location.pathname,te()},[A,y.pathname]),(0,b.useEffect)(()=>{let t=[];for(let[r,i]of Object.entries(_)){let a=({state:t,query:a})=>{O(o=>Object.is(o[r]??null,t)?(xt(2,n,p,i,t,e[r]?.defaultValue,k.current),o):(k.current={...k.current,[r]:t},E.current[i]=a,xt(3,n,p,i,t,e[r]?.defaultValue,k.current),k.current))};xt(4,n,i,p),hP.on(i,a),t.push([i,a])}return()=>{for(let[e,r]of t)xt(5,n,e,p),hP.off(e,r)}},[p,_]);let ie=(0,b.useCallback)((e,t={})=>{let r=(typeof e==`function`?e(bP(k.current,g)):e)??Object.fromEntries(Object.keys(g).map(e=>[e,null]));xt(6,n,p,r);let f,m=0,h=[];for(let[e,n]of Object.entries(r)){let r=nP(g,e),p=_[e];if(!r||p===void 0||n===void 0)continue;(t.clearOnDefault??r.clearOnDefault??u)&&n!==null&&r.defaultValue!==void 0&&(r.eq??an)(n,r.defaultValue)&&(n=null);let v=n===null?null:(r.serialize??String)(n);hP.emit(p,{state:n,query:v});let b={key:p,query:v,options:{history:t.history??r.history??a,shallow:t.shallow??r.shallow??s,scroll:t.scroll??r.scroll??o,startTransition:t.startTransition??r.startTransition??d}},x=t.limitUrlUpdates??r.limitUrlUpdates??l;if(x?.method===`debounce`){let e=x.timeMs??Rt.timeMs,t=Qt.push(b,e,y,i);m<e&&(f=t,m=e)}else{let e=x?.timeMs??t.throttleMs??r.throttleMs??c;h.push(Qt.abort(p)),Jt.push(b,e)}}let v=h.length?Jt.flush(y,i):Jt.getPendingPromise(y);for(let e of h)v=e(v);return f??v},[p,a,s,o,c,l?.method,l?.timeMs,d,u,g,_,y.updateUrl,y.getSearchParamsSnapshot,y.rateLimitFactor,i]);return[(0,b.useMemo)(()=>bP(D,g),[D,g]),ie]}function yP(e,t,n,r,i={},a={}){let o=!1,s=Object.entries(e).reduce((e,[s,c])=>{let l=t[s],u=nP(r,l),d=c.type===`multi`?[]:null,f=u===void 0?c.type===`multi`?n.getAll(l):n.get(l):u,p=nP(a,s);return p!==void 0&&on(nP(i,l)??d,f)?(e[s]=p,e):(o=!0,e[s]=(zt(f)?null:iP(c.parse,f,l))??null,i[l]=f,e)},{});return o||=Object.keys(s).length!==Object.keys(a).length,[o,s]}function bP(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]?.defaultValue??null]))}function xP(e,t={}){let{parse:n=e=>e,type:r,serialize:i,eq:a,defaultValue:o,...s}=t,c={parse:n,type:r,serialize:i,eq:a,defaultValue:o},[{[e]:l},u]=vP({[e]:c},s);return[l,(0,b.useCallback)((t,n={})=>u(n=>({[e]:typeof t==`function`?t(n[e]):t}),n),[e,u])]}function SP(){return xP(`activity`)}function CP({text:e,label:t=`Copy`}){return(0,O.jsx)(Rj,{appearance:`ghost`,text:t,onPress:()=>$j(e)})}function wP({initialTime:e,isRunning:t,intervalInMs:n=100}){let r=t&&iS;return Uj(t&&!r),LM({initialTime:e,isActive:r,intervalInMs:n})}function TP({from:e,to:t=null,...n}){let r=Wj(e),i=wP({initialTime:r,isRunning:t===null,intervalInMs:EM(Date.now()-r)});return t===null?(0,O.jsx)(Z,{...n,children:qj(i)}):(0,O.jsx)(Z,{...n,children:Kj(Wj(t)-r)})}function EP({status:e,size:t=14}){let n=fS[e];return e===`running`?(0,O.jsx)(Tj,{size:t,color:n}):(0,O.jsx)(e===`fulfilled`?fM:RN,{size:t,fill:n})}function DP({label:e,children:t}){return(0,O.jsxs)(q,{gap:6,flex:1,minW:120,children:[(0,O.jsx)(Z,{variant:`label`,children:e}),t]})}function OP({log:e}){let t=mS[e.level]??J.text,n=e.args.map(e=>typeof e==`string`?e:Zj(e)).join(` `);return(0,O.jsxs)(q,{row:!0,gap:12,align:`flex-start`,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.dim,children:Xj(e.at)}),(0,O.jsx)(Z,{variant:`mono`,color:t,children:`[${e.level.toUpperCase()}]`}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(Z,{variant:`mono`,color:t,children:n})})]})}function kP({runId:e}){let[t,n]=(0,b.useState)(0),{data:r}=mt(wS.runLogs(e,{limit:25,offset:t})),i=r?.logs??[],a=r?.count??0;return(0,O.jsxs)(TN,{title:`Logs`,actions:(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${a} entries`}),children:[r?i.length===0?(0,O.jsx)(Z,{children:`Nothing was logged by this run.`}):(0,O.jsx)(q,{bg:J.background,gap:4,children:i.map((e,n)=>(0,O.jsx)(OP,{log:e},`${t}-${n}`))}):(0,O.jsx)(Tj,{}),(0,O.jsx)(bM,{count:a,offset:t,limit:25,onChange:n})]})}function AP(e){return e.status===`running`?null:e.updatedAt}function jP(e){return e===null?null:Wj(e)}var MP=.6;function NP({scale:e,from:t,to:n,color:r,isPulsing:i=!1}){let a=wP({initialTime:e.start,isRunning:e.end===null||n===null,intervalInMs:250}),o=e.start+a,s=Math.max((e.end??o)-e.start,1),c=n??o,l=Math.min(Math.max((t-e.start)/s*100,0),100),u=Math.max((Math.max(c,t)-t)/s*100,MP);return(0,O.jsx)(q,{h:10,bg:J.raised,rounded:5,position:`relative`,flex:1,children:(0,O.jsx)(q,{position:`absolute`,top:0,bottom:0,left:`${l}%`,w:`${Math.min(u,100-l)}%`,bg:r,rounded:5,style:i?{opacity:.85}:void 0})})}var PP=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`M14 13H8V5H6v9a1 1 0 0 0 1 1h7v3l5-4-5-4v3z`})})),FP=tx(e=>(0,O.jsx)(Yx,{width:24,height:24,viewBox:`0 0 24 24`,...e,children:(0,O.jsx)(Jx,{d:`m9 19 8-7-8-7z`})}));function IP({isExpanded:e}){return(0,O.jsx)(e?WN:FP,{size:12,fill:J.muted})}function LP({to:e,children:t,fontSize:n=12,style:r}){return(0,O.jsx)(sa,{to:e,style:{textDecoration:`none`,...r},children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:4,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.info,fontSize:n,children:t}),(0,O.jsx)(SM,{size:n,fill:J.info})]})})}var RP=3;function zP({child:e,scale:t,depth:n}){let[r,i]=(0,b.useState)(!1),a=fS[e.status],o=n<RP,{data:s}=mt({...wS.run(e.id),enabled:r}),c=AP(e);return(0,O.jsxs)(q,{gap:6,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,pv:8,bg:`${J.panel}80`,rounded:4,borderWidth:1,borderColor:`${J.border}80`,...o?mM(()=>i(e=>!e)):{},children:[(0,O.jsxs)(q,{flex:1,minW:0,row:!0,align:`center`,gap:8,children:[o&&(0,O.jsx)(IP,{isExpanded:r}),(0,O.jsx)(PP,{size:12,fill:J.dim}),(0,O.jsx)(Z,{variant:`mono`,numberOfLines:1,children:e.workflow}),(0,O.jsx)(CM,{color:a,children:pS[e.status]}),(0,O.jsx)(LP,{to:`/runs/${e.id}`,fontSize:11,style:{marginLeft:`auto`},children:`open`})]}),(0,O.jsx)(q,{w:`42%`,children:(0,O.jsx)(NP,{scale:t,from:Wj(e.createdAt),to:jP(c),color:a,isPulsing:e.status===`running`})}),(0,O.jsx)(q,{w:72,align:`flex-end`,children:(0,O.jsx)(TP,{from:e.createdAt,to:c,variant:`mono`,color:J.muted})})]}),r&&(0,O.jsx)(q,{ml:24,children:s?(0,O.jsx)(ZP,{run:s,scale:t,depth:n+1,focusedActivityId:null}):(0,O.jsx)(Tj,{})})]})}function BP({activityId:e,scale:t,depth:n}){let{data:r,fetchNextPage:i,isFetchingNextPage:a}=yt(wS.childRuns(e));if(!r)return(0,O.jsx)(Tj,{});let o=r.pages.flatMap(e=>e.runs),s=r.pages.at(-1)?.count??0,c=s-o.length;return(0,O.jsxs)(q,{ml:24,gap:6,children:[o.map(e=>(0,O.jsx)(zP,{child:e,scale:t,depth:n},e.id)),c>0&&(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,children:[(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${o.length} of ${s} child runs`}),(0,O.jsx)(Rj,{appearance:`ghost`,text:`Show ${Math.min(c,15)} more`,isLoading:a,onPress:()=>void i()})]})]})}function VP({pending:e}){return e.timeoutAt===null?(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`no timeout`}):e.status===`pending`?(0,O.jsx)(RM,{to:e.timeoutAt,variant:`mono`,color:J.muted,children:e=>e===null?`timing out…`:`times out in ${e}`}):(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`timeout was ${Xj(e.timeoutAt)}`})}function HP({pending:e}){return(0,O.jsxs)(q,{bg:J.background,p:12,gap:8,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(CM,{color:e.status===`pending`?J.info:fS[e.status],children:e.status}),(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`pending ${e.id}`})]}),(0,O.jsx)(VP,{pending:e})]}),e.schema&&(0,O.jsxs)(q,{gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Expected payload schema`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.schema)})]}),(0,O.jsxs)(q,{row:!0,gap:16,children:[(0,O.jsxs)(q,{flex:1,gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Result`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.result)})]}),(0,O.jsxs)(q,{flex:1,gap:4,children:[(0,O.jsx)(Z,{variant:`label`,children:`Payload received`}),(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:Zj(e.payload)})]})]})]})}function UP({runId:e,activityId:t}){let[n,r]=(0,b.useState)(0),{data:i}=mt(wS.runActivityPendings(e,t,{limit:25,offset:n}));return i?i.count===0?null:(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Async steps`}),i.pendings.map(e=>(0,O.jsx)(HP,{pending:e},e.id)),(0,O.jsx)(bM,{count:i.count,offset:n,limit:25,onChange:r})]}):(0,O.jsx)(Tj,{})}var WP={completed:{label:`Completed`,color:J.brand},waiting:{label:`Waiting`,color:J.info},running:{label:`Running`,color:J.info},failed:{label:`Failed`,color:J.error}};function GP(e){return e.status===`fulfilled`?`completed`:e.status===`rejected`?`failed`:e.kind===`async`&&e.pendingStatus===`pending`?`waiting`:`running`}function KP(e,t){return e.settledAt??AP(t)}function qP({activity:e,index:t,run:n,scale:r,depth:i,isFocused:a}){let[o,s]=(0,b.useState)(a),c=(0,b.useRef)(null),{data:l}=mt({...wS.runActivity(n.id,e.id),enabled:o}),u=GP(e),{label:d,color:f}=WP[u],p=KP(e,n),m=u===`running`||u===`waiting`;return(0,b.useEffect)(()=>{a&&(s(!0),c.current?.scrollIntoView?.({block:`center`}))},[a]),(0,O.jsxs)(q,{gap:6,children:[(0,O.jsxs)(q,{ref:c,row:!0,align:`center`,gap:12,ph:12,pv:10,bg:J.panel,rounded:4,borderWidth:1,borderColor:a?J.brand:J.border,...mM(()=>s(e=>!e)),children:[(0,O.jsxs)(q,{flex:1,minW:0,row:!0,align:`center`,gap:8,children:[(0,O.jsx)(IP,{isExpanded:o}),(0,O.jsx)(Z,{variant:`mono`,fontSize:13,fontWeight:`600`,numberOfLines:1,children:e.type}),(0,O.jsx)(CM,{color:f,children:d}),(0,O.jsx)(CM,{color:J.muted,children:e.kind}),e.hasChildren&&(0,O.jsx)(CM,{color:J.info,children:`child runs`})]}),(0,O.jsx)(q,{w:`42%`,children:(0,O.jsx)(NP,{scale:r,from:Wj(e.createdAt),to:jP(p),color:f,isPulsing:m})}),(0,O.jsx)(q,{w:72,align:`flex-end`,children:(0,O.jsx)(TP,{from:e.createdAt,to:p,variant:`mono`,color:J.muted})})]}),o&&(0,O.jsxs)(q,{p:16,gap:16,rounded:4,borderWidth:1,borderColor:J.border,bg:`${J.panel}80`,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,style:{flexWrap:`wrap`},children:[(0,O.jsx)(hM,{onPress:()=>$j(e.id),children:`activity ${e.id}`}),(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:11,children:`click to copy`})]}),(0,O.jsxs)(q,{row:!0,gap:16,children:[(0,O.jsx)(DP,{label:`Started`,children:(0,O.jsx)(Z,{variant:`mono`,children:Xj(e.createdAt)})}),(0,O.jsx)(DP,{label:`Completed`,children:(0,O.jsx)(Z,{variant:`mono`,children:e.settledAt?Xj(e.settledAt):`—`})}),(0,O.jsx)(DP,{label:`Position`,children:(0,O.jsx)(Z,{variant:`mono`,children:String(t)})})]}),l?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Input`}),(0,O.jsx)(wM,{value:Zj(l.input)})]}),u===`failed`?(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Rejection`}),(0,O.jsx)(wM,{value:Qj(l.output),color:J.error})]}):(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Output`}),(0,O.jsx)(wM,{value:u===`completed`?Zj(l.output):`Not completed yet.`,color:u===`completed`?J.text:J.muted})]}),e.kind===`async`&&(0,O.jsx)(UP,{runId:n.id,activityId:e.id})]}):(0,O.jsx)(Tj,{})]}),o&&e.hasChildren&&(0,O.jsx)(BP,{activityId:e.id,scale:r,depth:i})]})}var JP=[0,.25,.5,.75,1];function YP({scale:e}){let t=wP({initialTime:e.start,isRunning:e.end===null,intervalInMs:250}),n=Math.max((e.end??e.start+t)-e.start,1);return(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,ph:12,pb:4,children:[(0,O.jsx)(q,{flex:1,minW:0}),(0,O.jsx)(q,{w:`42%`,row:!0,justify:`space-between`,children:JP.map(e=>(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:10,children:Kj(n*e)},e))}),(0,O.jsx)(q,{w:72})]})}function XP({run:e,activities:t,scale:n,depth:r,focusedActivityId:i}){return t.length===0?(0,O.jsx)(Z,{children:e.status===`running`?`No activity pushed yet.`:`This run finished without pushing any activity.`}):(0,O.jsxs)(q,{gap:6,children:[r===0&&(0,O.jsx)(YP,{scale:n}),t.map((t,a)=>(0,O.jsx)(qP,{activity:t,index:a,run:e,scale:n,depth:r,isFocused:t.id===i},t.id))]})}function ZP({run:e,scale:t,depth:n,focusedActivityId:r}){let[i,a]=(0,b.useState)(0),{data:o}=mt(wS.runActivities(e.id,{limit:25,offset:i}));return o?(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(XP,{run:e,activities:[...o.activities].reverse(),scale:t,depth:n,focusedActivityId:r}),(0,O.jsx)(bM,{count:o.count,offset:i,limit:25,onChange:a})]}):(0,O.jsx)(Tj,{})}function QP({runId:e}){let t=Jr(),[n]=SP(),{data:r,error:i}=mt(wS.run(e)),a=r?.status===`running`;if(i)return(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:String(i)})});if(!r)return(0,O.jsx)(Tj,{});let o=Wj(r.createdAt),s=a?null:Wj(r.updatedAt),c={start:o,end:s},l=fS[r.status],u=Qj(r.output);return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,gap:16,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,flex:1,minW:0,children:[(0,O.jsx)(sa,{to:`/workflows/${encodeURIComponent(r.workflow)}`,style:{textDecoration:`none`},children:(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:r.workflow})}),(0,O.jsx)(hM,{onPress:()=>$j(r.id),children:`run ${r.id}`})]}),(0,O.jsxs)(q,{row:!0,gap:8,children:[rS.capabilities.trigger&&(0,O.jsx)(Rj,{appearance:`outline`,text:`Run again`,onPress:()=>t(`/workflows/${encodeURIComponent(r.workflow)}`,{state:{input:r.input}})}),(0,O.jsx)(Rj,{appearance:`outline`,text:`Copy run JSON`,onPress:()=>$j(Zj(r))})]})]}),(0,O.jsxs)(q,{row:!0,gap:16,style:{flexWrap:`wrap`},children:[(0,O.jsx)(DP,{label:`Status`,children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:6,children:[(0,O.jsx)(EP,{status:r.status}),(0,O.jsx)(Z,{fontSize:14,fontWeight:`600`,color:l,children:pS[r.status]})]})}),(0,O.jsx)(DP,{label:`Duration`,children:(0,O.jsx)(TP,{from:r.createdAt,to:AP(r),variant:`mono`,fontSize:14})}),(0,O.jsx)(DP,{label:`Start time`,children:(0,O.jsx)(Z,{variant:`mono`,fontSize:14,children:new Date(r.createdAt).toLocaleString()})}),r.parentWorkflowRun&&(0,O.jsx)(DP,{label:`Parent run`,children:(0,O.jsx)(sa,{to:`/runs/${r.parentWorkflowRun}${r.parentWorkflowRunActivity?`?activity=${r.parentWorkflowRunActivity}`:``}`,style:{textDecoration:`none`},children:(0,O.jsx)(Z,{variant:`mono`,fontSize:14,color:J.info,children:r.parentWorkflowRun})})})]})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Initial Input`,actions:(0,O.jsx)(CP,{text:Zj(r.input),label:`Copy JSON`}),children:(0,O.jsx)(wM,{value:Zj(r.input)})}),(0,O.jsx)(TN,{title:`Execution Trace`,actions:s===null?(0,O.jsxs)(q,{row:!0,align:`center`,gap:6,children:[(0,O.jsx)(tP,{size:12,fill:J.info}),(0,O.jsx)(Z,{variant:`mono`,color:J.info,children:`live`})]}):(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`${Kj(s-o)} total`}),children:(0,O.jsx)(ZP,{run:r,scale:c,depth:0,focusedActivityId:n})}),(0,O.jsx)(kP,{runId:r.id}),(0,O.jsx)(TN,{title:r.status===`rejected`?`Rejection`:`Final Output`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Z,{variant:`mono`,color:l,children:`Status: ${r.status}`}),r.status!==`running`&&(0,O.jsx)(CP,{text:r.status===`rejected`?u:Zj(r.output),label:`Copy Result`})]}),children:r.status===`running`?(0,O.jsx)(wM,{value:`Still running…`,color:J.muted}):r.status===`rejected`?(0,O.jsx)(wM,{value:u,color:J.error}):(0,O.jsx)(wM,{value:Zj(r.output)})})]})]})}var $P=[`running`,`fulfilled`,`rejected`],eF=[{value:`15m`,label:`Last 15 minutes`,durationInMs:9e5},{value:`1h`,label:`Last hour`,durationInMs:36e5},{value:`24h`,label:`Last 24 hours`,durationInMs:864e5}],tF=eF.map(e=>e.value),nF={status:dP($P),workflow:oP.withDefault(``),q:oP.withDefault(``),period:dP(tF),rootOnly:cP.withDefault(!0),page:sP.withDefault(1)},rF=fP(nF);function iF(e){return{status:e.status??void 0,workflow:e.workflow||void 0,id:e.q||void 0,rootOnly:e.rootOnly||void 0,createdWithinInMs:eF.find(t=>t.value===e.period)?.durationInMs,limit:25,offset:(Math.max(e.page,1)-1)*25}}function aF(){return vP(nF,{history:`replace`})}var oF=[{label:`Any status`,value:``},{label:pS.running,value:`running`},{label:pS.fulfilled,value:`fulfilled`},{label:pS.rejected,value:`rejected`}],sF=[{label:`Any time`,value:``},...eF.map(({value:e,label:t})=>({value:e,label:t}))],cF={displayBackgroundColor:J.background,displayBorderColor:J.border,displayTextColor:J.text,displayPlaceholderColor:J.dim,displayCaretIndicatorColor:J.muted,menuBorderColor:J.border,menuOptionLabelBackgroundColor:J.panel,menuOptionLabelTextColor:J.text};function lF(){let{runId:e}=Xr(),t=Jr(),[n,r]=aF(),{data:i,isPending:a}=mt(wS.runs(iF(n))),{data:o}=mt(wS.manifest()),s=i?.runs??[],c=i?.count??0,l=(n.page-1)*25,u=e=>void r({...e,page:null}),d=[{label:`Any workflow`,value:``},...(o?.workflows??[]).map(({id:e})=>({label:e,value:e}))],f=e=>t(rF(`/runs/${e}`,n));return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,gap:8,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Runs`}),(0,O.jsx)(hM,{children:`${c} total`})]}),(0,O.jsxs)(q,{row:!0,gap:8,children:[(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(ZN,{options:oF,value:oF.find(e=>e.value===(n.status??``)),onChange:e=>u({status:e?.value||null}),...cF})}),(0,O.jsx)(q,{flex:1,children:(0,O.jsx)(ZN,{options:sF,value:sF.find(e=>e.value===(n.period??``)),onChange:e=>u({period:e?.value||null}),...cF})})]}),(0,O.jsx)(ZN,{options:d,value:d.find(e=>e.value===n.workflow),onChange:e=>u({workflow:e?.value??``}),isSearchable:!0,...cF}),(0,O.jsx)(CN,{value:n.q,onChange:e=>u({q:e}),placeholder:`Run id starts with…`,autoCapitalize:`none`,autoCorrect:!1,style:{backgroundColor:J.background}}),(0,O.jsxs)(q,{row:!0,align:`center`,gap:8,children:[(0,O.jsx)(QN,{size:`sm`,isChecked:n.rootOnly,onChange:e=>u({rootOnly:e})}),(0,O.jsx)(Z,{fontSize:12,children:`Root runs only (children stay inside their parent)`})]})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:a?(0,O.jsx)(Tj,{}):s.length===0?(0,O.jsxs)(q,{p:20,gap:6,children:[(0,O.jsx)(Z,{children:c===0&&!n.status&&!n.workflow&&!n.q?rS.capabilities.rebuild?`No runs since the last build.`:`No runs yet.`:`No runs match the filters.`}),(0,O.jsx)(Z,{fontSize:12,color:J.dim,children:rS.capabilities.rebuild?`Start one from the Workflows page; runs reset on every rebuild.`:`Start one from the Workflows page.`})]}):s.map(t=>(0,O.jsx)(eP,{run:t,isSelected:t.id===e,onSelect:()=>f(t.id)},t.id))}),(0,O.jsx)(bM,{count:c,offset:l,limit:25,onChange:e=>void r({page:e===0?null:e/25+1})})]}),children:e?(0,O.jsx)(QP,{runId:e}):(0,O.jsx)(gM,{icon:$x,children:`Select a run to inspect its trace`})})}function uF(){let e=A();return vt({mutationFn:({workflowId:e,input:t})=>xS.runWorkflow(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`runs`]})}})}var dF=5;function fF(e){return`t4h-panel:payloads:${e}`}function pF(e){try{let t=localStorage.getItem(fF(e)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function mF(e,t){let n=[t,...pF(e).filter(e=>e!==t)].slice(0,dF);try{localStorage.setItem(fF(e),JSON.stringify(n))}catch(e){console.error(`Failed to save recent payloads:`,e)}return n}var hF=5;function gF({workflow:e,manifest:t}){let n=Jr(),r=Gr().state?.input,[i,a]=(0,b.useState)(()=>pF(e.id)),[o,s]=(0,b.useState)(()=>r===void 0?i[0]??Zj(ON(e.schema)):Zj(r)),[c,l]=(0,b.useState)(null),u=uF(),d=mt(wS.runs({workflow:e.id,limit:hF})),f=()=>Zj(ON(e.schema)),p=()=>{let e=o.trim();return e===``?void 0:JSON.parse(e)},m=oS(`runs`,{project:t.id,workflow:e.id}),h=()=>{try{navigator.clipboard?.writeText(cS(`runs`,m,p())).catch(console.error),l(null)}catch(e){l(DN(e))}},g=async()=>{let t;try{t=p()}catch(e){l(DN(e));return}try{let{id:r}=await u.mutateAsync({workflowId:e.id,input:t});a(mF(e.id,Zj(t))),l(null),n(`/runs/${r}`)}catch(e){l(DN(e))}},_=e.authorization||t.authorization;return(0,O.jsxs)(q,{h:`100%`,children:[(0,O.jsxs)(q,{p:20,gap:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,children:[(0,O.jsxs)(q,{row:!0,align:`center`,justify:`space-between`,gap:12,children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:18,fontWeight:`600`,children:e.id}),(0,O.jsxs)(q,{row:!0,gap:8,children:[e.authorization&&(0,O.jsx)(CM,{color:J.warn,children:`own authorization`}),(0,O.jsx)(CM,{color:e.schema?J.brand:J.muted,children:e.schema?`typed input`:`untyped input`})]})]}),(0,O.jsx)(Z,{children:e.description??`No description declared on this workflow.`})]}),(0,O.jsxs)(q,{flex:1,overflow:`auto`,p:20,gap:32,children:[(0,O.jsx)(TN,{title:`Run`,actions:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Rj,{appearance:`ghost`,text:`Reset to example`,onPress:()=>s(f())}),(0,O.jsx)(Rj,{appearance:rS.capabilities.trigger?`ghost`:`outline`,text:`Copy as curl`,onPress:h}),rS.capabilities.trigger&&(0,O.jsx)(Rj,{appearance:`solid`,text:u.isPending?`Running…`:`Run workflow`,isDisabled:u.isPending,onPress:g})]}),children:(0,O.jsxs)(q,{gap:12,children:[(0,O.jsx)(Z,{variant:`label`,children:`Input body`}),(0,O.jsx)(wN,{value:o,onChange:s,error:c}),i.length>0&&(0,O.jsxs)(q,{gap:6,children:[(0,O.jsx)(Z,{variant:`label`,children:`Recent payloads`}),(0,O.jsx)(q,{row:!0,gap:6,style:{flexWrap:`wrap`},children:i.map((e,t)=>(0,O.jsx)(hM,{color:J.text,onPress:()=>s(e),children:e.replaceAll(/\s+/g,` `).slice(0,60)},t))})]}),!rS.capabilities.trigger&&(0,O.jsx)(Z,{fontSize:12,children:`This host only accepts authorized requests: copy the curl, add the credentials the authorization expects and send it.`})]})}),(0,O.jsx)(TN,{title:`Routes`,actions:_?(0,O.jsx)(Z,{variant:`mono`,color:J.muted,children:`auth: ${_.pathToModule}`}):(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:`no authorization declared`}),children:(0,O.jsxs)(q,{bg:J.background,gap:8,children:[(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.info,children:sS(`runs`)}),(0,O.jsx)(Z,{variant:`mono`,children:m})]}),(0,O.jsxs)(q,{row:!0,gap:12,align:`center`,children:[(0,O.jsx)(CM,{color:J.warn,children:sS(`advance`)}),(0,O.jsx)(Z,{variant:`mono`,children:oS(`advance`,{project:t.id,workflow:e.id})})]})]})}),(0,O.jsx)(TN,{title:`Input schema`,actions:e.schema?(0,O.jsx)(CP,{text:Zj(e.schema),label:`Copy JSON`}):void 0,children:(0,O.jsx)(wM,{value:e.schema?Zj(e.schema):`No schema: any JSON body is accepted.`,color:e.schema?J.text:J.muted})}),(0,O.jsx)(TN,{title:`Recent runs`,actions:(0,O.jsx)(LP,{to:`/runs?workflow=${encodeURIComponent(e.id)}&rootOnly=false`,children:`View all`}),children:d.isPending?(0,O.jsx)(Tj,{}):(d.data?.runs.length??0)===0?(0,O.jsx)(Z,{children:rS.capabilities.rebuild?`No runs of this workflow since the last build.`:`No runs of this workflow yet.`}):(0,O.jsx)(q,{bg:J.background,gap:8,children:d.data?.runs.map(e=>(0,O.jsx)(sa,{to:`/runs/${e.id}`,style:{textDecoration:`none`},children:(0,O.jsxs)(q,{row:!0,align:`center`,gap:12,children:[(0,O.jsx)(CM,{color:fS[e.status],children:pS[e.status]}),(0,O.jsx)(Z,{variant:`mono`,color:J.text,children:e.id}),(0,O.jsx)(Z,{fontSize:12,children:Yj(e.createdAt)})]})},e.id))})})]})]})}function _F(e){let t=e.schema?.properties;if(!t)return e.schema?`schema`:`any input`;let n=new Set(e.schema?.required??[]);return Object.keys(t).map(e=>n.has(e)?e:`${e}?`).join(`, `)}function vF(){let{workflowId:e}=Xr(),t=Jr(),{data:n,error:r}=mt(wS.manifest()),i=n?.workflows.find(t=>t.id===e);return(0,O.jsx)(xM,{side:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(q,{p:12,borderBottomWidth:1,borderColor:J.border,bg:J.panel,row:!0,align:`center`,justify:`space-between`,children:[(0,O.jsx)(Z,{variant:`label`,children:`Workflows`}),(0,O.jsx)(hM,{children:`${n?.workflows.length??0} registered`})]}),(0,O.jsx)(q,{flex:1,overflow:`auto`,children:r?(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{variant:`mono`,color:J.error,children:String(r)})}):n?n.workflows.length===0?(0,O.jsx)(q,{p:20,children:(0,O.jsx)(Z,{children:`The app declares no workflows.`})}):n.workflows.map(n=>(0,O.jsxs)(_M,{isSelected:n.id===e,onSelect:()=>t(`/workflows/${encodeURIComponent(n.id)}`),children:[(0,O.jsx)(Z,{variant:`mono`,fontSize:13,color:n.id===e?J.brand:J.text,fontWeight:`600`,numberOfLines:1,children:n.id}),n.description&&(0,O.jsx)(Z,{fontSize:12,numberOfLines:2,children:n.description}),(0,O.jsx)(Z,{variant:`mono`,color:J.dim,fontSize:11,numberOfLines:1,children:_F(n)})]},n.id)):(0,O.jsx)(Tj,{})})]}),children:n&&i?(0,O.jsx)(gF,{workflow:i,manifest:n},i.id):(0,O.jsx)(gM,{icon:Zx,children:n&&e?`Workflow "${e}" is not in the manifest`:`Select a workflow to run it or read its schema`})})}E.get().tokens.set({"space.0":0,"space.025":2,"space.050":4,"space.075":6,"space.100":8,"space.150":12,"space.200":16,"space.250":20,"space.300":24,"space.400":32,"space.500":40,"space.600":48,"space.700":56,"space.800":64,"space.900":72,"space.1000":80});var yF=E.get().fork(`t4h:light`);yF.tokens.set({"font.family.body":`Inter`,"font.family.heading":`Sora`,"color.background.neutral":`#EEE`,"color.background.neutral:hovered":`#DDD`,"color.background.neutral:pressed":`#CCC`,"color.neutral":`#eaeaea`,"%color.neutral.darker":`#bababa`,"color.background.brand.bold":`#443ee3`,"color.background.brand.bold:hovered":`#3330b4`,"color.background.brand.bold:pressed":`#222080`,"color.text.inverse":`#FFF`,"color.text":`#292A2E`,"button.outline.color.border":`#8c8c8c`,"button.outline.color.border:hovered":`@color.background.brand.bold`,"button.outline.color.border:pressed":`@color.background.brand.bold:hovered`,"button.outline.color.text":`@button.outline.color.border`,"button.outline.color.text:hovered":`@color.background.brand.bold`,"button.outline.color.text:pressed":`@color.background.brand.bold:hovered`,"button.outline.color.text:selected":`@color.text.inverse`,"button.outline.color.background:selected":`@color.background.brand.bold`,"button.outline.primary.hovered.color.background":`#edf1ff`});var bF=yF.fork(`dark`);bF.tokens.set({"color.background":`#0b1326`,"color.background.neutral":`#131b2e`,"color.background.neutral.subtle":`#171f33`,"color.surface":`#1a2235`,"color.surface.raised":`#222a3d`,"color.text":`#dae2fd`,"color.text.subtle":`#8896b3`,"color.text.placeholder":`#525f7a`,"color.text.inverse":`#0b1326`,"color.background.brand.bold":`#48BA80`,"color.background.brand.subtle":`#1a3328`,"color.text.brand":`#48BA80`,"color.border.brand":`#48BA80`,"color.border":`#2d3449`,"color.border.strong":`#464554`,"color.background.error.bold":`#ffb4ab`,"color.background.error.subtle":`#3b0f12`,"color.text.error":`#ffb4ab`,"color.text.success":`#4ade80`,"color.background.success.bold":`#4ade80`,"text-input.color.background":`#131b2e`,"text-input.color.text":`#dae2fd`,"text-input.color.outline.focused":`#48BA80`,"text-input.color.outline.blured":`#2d3449`,"button.solid.color.background":`#48BA80`,"button.solid.color.text":`#0b1326`,"button.solid.hovered.color.background":`#5fcb8f`,"button.solid.pressed.color.background":`#3fa872`,"button.solid.selected.color.background":`#3fa872`,"button.solid.selected.hovered.color.background":`#5fcb8f`,"button.solid.selected.pressed.color.background":`#369663`,"button.solid.loading.color.background":`#48BA80`,"button.solid.selected.loading.color.background":`#3fa872`,"button.solid.disabled.color.background":`#1a3328`,"button.solid.disabled.color.text":`#525f7a`,"button.outline.color.text":`#dae2fd`,"button.outline.color.border":`#2d3449`,"button.outline.color.background":`#0b1326`,"button.outline.hovered.color.border":`#48BA80`,"button.outline.hovered.color.background":`#131b2e`,"button.outline.pressed.color.border":`#48BA80`,"button.outline.pressed.color.background":`#1a3328`,"button.outline.selected.color.background":`#1a3328`,"button.outline.selected.hovered.color.background":`#222a3d`,"button.outline.selected.pressed.color.background":`#222a3d`,"button.outline.loading.color.background":`#0b1326`,"button.outline.selected.loading.color.background":`#1a3328`,"button.outline.disabled.color.text":`#525f7a`,"button.outline.disabled.color.border":`#2d3449`,"button.outline.disabled.color.background":`#0b1326`,"button.ghost.color.text":`#dae2fd`,"button.ghost.hovered.color.text":`#48BA80`,"button.ghost.pressed.color.text":`#3fa872`,"button.ghost.selected.color.text":`#48BA80`,"button.ghost.selected.hovered.color.text":`#5fcb8f`,"button.ghost.selected.pressed.color.text":`#3fa872`,"button.ghost.loading.color.text":`#dae2fd`,"button.ghost.selected.loading.color.text":`#48BA80`,"button.ghost.disabled.color.text":`#525f7a`});var xF=TS();document.title=rS.title;function SF(){return(0,O.jsx)(te,{client:xF,children:(0,O.jsxs)(k,{theme:bF,children:[(0,O.jsx)(oM,{}),(0,O.jsx)(oa,{basename:rS.basePath||void 0,children:(0,O.jsx)(ba,{children:(0,O.jsx)(iM,{children:(0,O.jsxs)(bi,{children:[(0,O.jsx)(vi,{path:`/`,element:(0,O.jsx)(dM,{})}),(0,O.jsx)(vi,{path:`/workflows`,element:(0,O.jsx)(vF,{})}),(0,O.jsx)(vi,{path:`/workflows/:workflowId`,element:(0,O.jsx)(vF,{})}),(0,O.jsx)(vi,{path:`/runs`,element:(0,O.jsx)(lF,{})}),(0,O.jsx)(vi,{path:`/runs/:runId`,element:(0,O.jsx)(lF,{})}),(0,O.jsx)(vi,{path:`/inbox`,element:(0,O.jsx)(MN,{})})]})})})})]})})}var CF=document.getElementById(`root`);if(!CF)throw Error(`#root element not found`);(0,y.createRoot)(CF).render((0,O.jsx)(b.StrictMode,{children:(0,O.jsx)(SF,{})}));
@@ -42,7 +42,7 @@
42
42
  background: #464554;
43
43
  }
44
44
  </style>
45
- <script type="module" crossorigin src="./assets/index-CzyBnYka.js"></script>
45
+ <script type="module" crossorigin src="./assets/index-B5sjdSCA.js"></script>
46
46
  </head>
47
47
  <body>
48
48
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t4h.framework/vite-panel-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Panel UI plugin for T4H Framework",
5
5
  "homepage": "https://github.com/tech4humans-brasil/framework/tree/main/packages/vite-panel-plugin",
6
6
  "bugs": "https://github.com/tech4humans-brasil/framework/issues",