kaizen-agent 1.87.4 → 1.88.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.
Files changed (57) hide show
  1. package/cli/activity.ts +2 -1
  2. package/cli/state.ts +15 -0
  3. package/cli/task-service.ts +23 -6
  4. package/cli/tasks.ts +4 -3
  5. package/cli/whats-new.json +26 -0
  6. package/package.json +1 -1
  7. package/web/components/decision/decision-bar.tsx +77 -26
  8. package/web/components/decision/index.ts +1 -0
  9. package/web/components/decision/plan-text.tsx +17 -0
  10. package/web/components/phone/phone-home.tsx +19 -14
  11. package/web/components/rail/rail-list.tsx +27 -4
  12. package/web/components/shared/action-menu.tsx +19 -2
  13. package/web/components/shared/index.ts +1 -0
  14. package/web/components/shared/panel-frame.tsx +212 -0
  15. package/web/components/shell/rail.tsx +5 -3
  16. package/web/components/task/agent-chip.tsx +56 -0
  17. package/web/components/task/agent-mark.tsx +34 -0
  18. package/web/components/task/changes-view.tsx +26 -0
  19. package/web/components/task/chat-bubble.tsx +8 -3
  20. package/web/components/task/composer.tsx +78 -0
  21. package/web/components/task/conversation.tsx +65 -0
  22. package/web/components/task/index.ts +12 -0
  23. package/web/components/task/plan-view.tsx +50 -0
  24. package/web/components/task/reference-files.tsx +24 -0
  25. package/web/components/task/result-view.tsx +3 -1
  26. package/web/components/task/review-view.tsx +40 -0
  27. package/web/components/task/saved-results.tsx +38 -0
  28. package/web/components/task/task-panel.tsx +143 -0
  29. package/web/components/task/task-phone.tsx +211 -0
  30. package/web/components/task/task-row.tsx +2 -2
  31. package/web/components/task/task-tabs.tsx +77 -0
  32. package/web/dist/annotate.js +1 -1
  33. package/web/dist/board.css +7 -5
  34. package/web/dist/board.js +59 -58
  35. package/web/dist/boot.js +1 -1
  36. package/web/dist/notebook.css +2 -2
  37. package/web/dist/notebook.js +33 -32
  38. package/web/dist/popup.css +1 -1
  39. package/web/dist/popup.js +1 -1
  40. package/web/dist/term.js +1 -1
  41. package/web/dist/ui.css +2 -2
  42. package/web/dist/video.js +18 -18
  43. package/web/lib/core/index.ts +1 -0
  44. package/web/lib/core/use-phone.ts +15 -0
  45. package/web/lib/router/route-rules.ts +17 -4
  46. package/web/lib/server/types.ts +1 -0
  47. package/web/lib/task/conversation.ts +56 -0
  48. package/web/lib/task/index.ts +5 -0
  49. package/web/lib/task/task-progress.ts +21 -0
  50. package/web/lib/task/task-tabs.ts +29 -0
  51. package/web/lib/task/tasks.ts +40 -1
  52. package/web/lib/task/use-task-page.ts +123 -0
  53. package/web/lib/task/use-task-run.ts +50 -0
  54. package/web/pages/board/panel.tsx +99 -4
  55. package/web/pages/task-page.tsx +319 -350
  56. package/web/ui/legacy/board.css +5 -3
  57. package/web/ui/theme.css +4 -0
package/web/dist/video.js CHANGED
@@ -1,5 +1,5 @@
1
- /* kaizen video page afd2e1864afda466 -- generated by bun run build:web from web/video/video.ts; do not edit */
2
- (()=>{var vo=Object.create;var{getPrototypeOf:ko,defineProperty:zn,getOwnPropertyNames:xo}=Object;var Kn=Object.prototype.hasOwnProperty;function So(e){return this[e]}var To,Eo,j=(e,t,r)=>{var a=e!=null&&typeof e==="object";if(a){var o=t?To??=new WeakMap:Eo??=new WeakMap,i=o.get(e);if(i)return i}r=e!=null?vo(ko(e)):{};let p=t||!e||!e.__esModule||!Kn.call(e,"default")?zn(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let f of xo(e))if(!Kn.call(p,f))zn(p,f,{get:So.bind(e,f),enumerable:!0})}if(a)o.set(e,p);return p};var et=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fn=et(function(S,tt){(function(){function e(n,s){Object.defineProperty(a.prototype,n,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",s[0],s[1])}})}function t(n){if(n===null||typeof n!=="object")return null;return n=$n&&n[$n]||n["@@iterator"],typeof n==="function"?n:null}function r(n,s){n=(n=n.constructor)&&(n.displayName||n.name)||"ReactClass";var d=n+"."+s;Cn[d]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",s,n),Cn[d]=!0)}function a(n,s,d){this.props=n,this.context=s,this.refs=_t,this.updater=d||Mn}function o(){}function i(n,s,d){this.props=n,this.context=s,this.refs=_t,this.updater=d||Mn}function p(){}function f(n){return""+n}function b(n){try{f(n);var s=!1}catch(g){s=!0}if(s){s=console;var d=s.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return d.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),f(n)}}function R(n){if(n==null)return null;if(typeof n==="function")return n.$$typeof===go?null:n.displayName||n.name||null;if(typeof n==="string")return n;switch(n){case Lt:return"Fragment";case kn:return"Profiler";case vn:return"StrictMode";case Tn:return"Suspense";case mo:return"SuspenseList";case En:return"Activity";case Rn:return"ViewTransition"}if(typeof n==="object")switch(typeof n.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case wn:return"Portal";case xn:return n.displayName||"Context";case Nt:return(n._context.displayName||"Context")+".Consumer";case Sn:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Dt:return s=n.displayName||null,s!==null?s:R(n.type)||"Memo";case Pe:s=n._payload,n=n._init;try{return R(n(s))}catch(d){}}return null}function O(n){if(n===Lt)return"<>";if(typeof n==="object"&&n!==null&&n.$$typeof===Pe)return"<...>";try{var s=R(n);return s?"<"+s+">":"<...>"}catch(d){return"<...>"}}function L(){var n=M.A;return n===null?null:n.getOwner()}function h(){return Error("react-stack-top-frame")}function c(n){if(Je.call(n,"key")){var s=Object.getOwnPropertyDescriptor(n,"key").get;if(s&&s.isReactWarning)return!1}return n.key!==void 0}function l(n,s){function d(){Ln||(Ln=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",s))}d.isReactWarning=!0,Object.defineProperty(n,"key",{get:d,configurable:!0})}function x(){var n=R(this.type);return Dn[n]||(Dn[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function T(n,s,d,u,g,P){var w=d.ref;return n={$$typeof:Pt,type:n,key:s,props:d,_owner:u},(w!==void 0?w:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:x}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function _(n,s){return s=T(n.type,s,n.props,n._owner,n._debugStack,n._debugTask),n._store&&(s._store.validated=n._store.validated),s}function Z(n){ee(n)?n._store&&(n._store.validated=1):typeof n==="object"&&n!==null&&n.$$typeof===Pe&&(n._payload.status==="fulfilled"?ee(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function ee(n){return typeof n==="object"&&n!==null&&n.$$typeof===Pt}function B(n){var s={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(d){return s[d]})}function Oe(n,s){return typeof n==="object"&&n!==null&&n.key!=null?(b(n.key),B(""+n.key)):s.toString(36)}function po(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status==="string"?n.then(p,p):(n.status="pending",n.then(function(s){n.status==="pending"&&(n.status="fulfilled",n.value=s)},function(s){n.status==="pending"&&(n.status="rejected",n.reason=s)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function be(n,s,d,u,g){var P=typeof n;if(P==="undefined"||P==="boolean")n=null;var w=!1;if(n===null)w=!0;else switch(P){case"bigint":case"string":case"number":w=!0;break;case"object":switch(n.$$typeof){case Pt:case wn:w=!0;break;case Pe:return w=n._init,be(w(n._payload),s,d,u,g)}}if(w){w=n,g=g(w);var C=u===""?"."+Oe(w,0):u;return An(g)?(d="",C!=null&&(d=C.replace(In,"$&/")+"/"),be(g,s,d,"",function(ie){return ie})):g!=null&&(ee(g)&&(g.key!=null&&(w&&w.key===g.key||b(g.key)),d=_(g,d+(g.key==null||w&&w.key===g.key?"":(""+g.key).replace(In,"$&/")+"/")+C),u!==""&&w!=null&&ee(w)&&w.key==null&&w._store&&!w._store.validated&&(d._store.validated=2),g=d),s.push(g)),1}if(w=0,C=u===""?".":u+":",An(n))for(var A=0;A<n.length;A++)u=n[A],P=C+Oe(u,A),w+=be(u,s,d,P,g);else if(A=t(n),typeof A==="function")for(A===n.entries&&(_n||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),_n=!0),n=A.call(n),A=0;!(u=n.next()).done;)u=u.value,P=C+Oe(u,A++),w+=be(u,s,d,P,g);else if(P==="object"){if(typeof n.then==="function")return be(po(n),s,d,u,g);throw s=String(n),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}return w}function qe(n,s,d){if(n==null)return n;var u=[],g=0;return be(n,u,"","",function(P){return s.call(d,P,g++)}),u}function fo(n){if(n._status===-1){var s=null,d=null,u=n._ioInfo;u!=null&&(u.start=u.end=performance.now(),u.value=new Promise(function(w,C){s=w,d=C})),u=n._result;var g=u();if(g.then(function(w){if(n._status===0||n._status===-1){n._status=1,n._result=w;var C=n._ioInfo;if(C!=null){C.end=performance.now();var A=w==null?void 0:w.default;s(A),C.value.status="fulfilled",C.value.value=A}g.status===void 0&&(g.status="fulfilled",g.value=w)}},function(w){if(n._status===0||n._status===-1){n._status=2,n._result=w;var C=n._ioInfo;C!=null&&(C.end=performance.now(),C.value.then(p,p),d(w),C.value.status="rejected",C.value.reason=w),g.status===void 0&&(g.status="rejected",g.reason=w)}}),u=n._ioInfo,u!=null){var P=g.displayName;typeof P==="string"&&(u.name=P)}n._status===-1&&(n._status=0,n._result=g)}if(n._status===1)return u=n._result,u===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
1
+ /* kaizen video page 1376ef13d4c5d273 -- generated by bun run build:web from web/video/video.ts; do not edit */
2
+ (()=>{var ko=Object.create;var{getPrototypeOf:xo,defineProperty:zn,getOwnPropertyNames:So}=Object;var Kn=Object.prototype.hasOwnProperty;function To(e){return this[e]}var Eo,Ro,j=(e,t,r)=>{var a=e!=null&&typeof e==="object";if(a){var o=t?Eo??=new WeakMap:Ro??=new WeakMap,i=o.get(e);if(i)return i}r=e!=null?ko(xo(e)):{};let p=t||!e||!e.__esModule||!Kn.call(e,"default")?zn(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let f of So(e))if(!Kn.call(p,f))zn(p,f,{get:To.bind(e,f),enumerable:!0})}if(a)o.set(e,p);return p};var et=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fn=et(function(S,tt){(function(){function e(n,s){Object.defineProperty(a.prototype,n,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",s[0],s[1])}})}function t(n){if(n===null||typeof n!=="object")return null;return n=$n&&n[$n]||n["@@iterator"],typeof n==="function"?n:null}function r(n,s){n=(n=n.constructor)&&(n.displayName||n.name)||"ReactClass";var d=n+"."+s;Cn[d]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",s,n),Cn[d]=!0)}function a(n,s,d){this.props=n,this.context=s,this.refs=_t,this.updater=d||Mn}function o(){}function i(n,s,d){this.props=n,this.context=s,this.refs=_t,this.updater=d||Mn}function p(){}function f(n){return""+n}function b(n){try{f(n);var s=!1}catch(g){s=!0}if(s){s=console;var d=s.error,u=typeof Symbol==="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return d.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",u),f(n)}}function R(n){if(n==null)return null;if(typeof n==="function")return n.$$typeof===ho?null:n.displayName||n.name||null;if(typeof n==="string")return n;switch(n){case Lt:return"Fragment";case kn:return"Profiler";case vn:return"StrictMode";case Tn:return"Suspense";case go:return"SuspenseList";case En:return"Activity";case Rn:return"ViewTransition"}if(typeof n==="object")switch(typeof n.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case wn:return"Portal";case xn:return n.displayName||"Context";case Nt:return(n._context.displayName||"Context")+".Consumer";case Sn:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case Dt:return s=n.displayName||null,s!==null?s:R(n.type)||"Memo";case Pe:s=n._payload,n=n._init;try{return R(n(s))}catch(d){}}return null}function O(n){if(n===Lt)return"<>";if(typeof n==="object"&&n!==null&&n.$$typeof===Pe)return"<...>";try{var s=R(n);return s?"<"+s+">":"<...>"}catch(d){return"<...>"}}function L(){var n=M.A;return n===null?null:n.getOwner()}function h(){return Error("react-stack-top-frame")}function c(n){if(Je.call(n,"key")){var s=Object.getOwnPropertyDescriptor(n,"key").get;if(s&&s.isReactWarning)return!1}return n.key!==void 0}function l(n,s){function d(){Ln||(Ln=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",s))}d.isReactWarning=!0,Object.defineProperty(n,"key",{get:d,configurable:!0})}function x(){var n=R(this.type);return Dn[n]||(Dn[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function T(n,s,d,u,g,P){var w=d.ref;return n={$$typeof:Pt,type:n,key:s,props:d,_owner:u},(w!==void 0?w:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:x}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(n,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:g}),Object.defineProperty(n,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function _(n,s){return s=T(n.type,s,n.props,n._owner,n._debugStack,n._debugTask),n._store&&(s._store.validated=n._store.validated),s}function Z(n){ee(n)?n._store&&(n._store.validated=1):typeof n==="object"&&n!==null&&n.$$typeof===Pe&&(n._payload.status==="fulfilled"?ee(n._payload.value)&&n._payload.value._store&&(n._payload.value._store.validated=1):n._store&&(n._store.validated=1))}function ee(n){return typeof n==="object"&&n!==null&&n.$$typeof===Pt}function H(n){var s={"=":"=0",":":"=2"};return"$"+n.replace(/[=:]/g,function(d){return s[d]})}function Oe(n,s){return typeof n==="object"&&n!==null&&n.key!=null?(b(n.key),H(""+n.key)):s.toString(36)}function fo(n){switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:switch(typeof n.status==="string"?n.then(p,p):(n.status="pending",n.then(function(s){n.status==="pending"&&(n.status="fulfilled",n.value=s)},function(s){n.status==="pending"&&(n.status="rejected",n.reason=s)})),n.status){case"fulfilled":return n.value;case"rejected":throw n.reason}}throw n}function be(n,s,d,u,g){var P=typeof n;if(P==="undefined"||P==="boolean")n=null;var w=!1;if(n===null)w=!0;else switch(P){case"bigint":case"string":case"number":w=!0;break;case"object":switch(n.$$typeof){case Pt:case wn:w=!0;break;case Pe:return w=n._init,be(w(n._payload),s,d,u,g)}}if(w){w=n,g=g(w);var C=u===""?"."+Oe(w,0):u;return An(g)?(d="",C!=null&&(d=C.replace(In,"$&/")+"/"),be(g,s,d,"",function(le){return le})):g!=null&&(ee(g)&&(g.key!=null&&(w&&w.key===g.key||b(g.key)),d=_(g,d+(g.key==null||w&&w.key===g.key?"":(""+g.key).replace(In,"$&/")+"/")+C),u!==""&&w!=null&&ee(w)&&w.key==null&&w._store&&!w._store.validated&&(d._store.validated=2),g=d),s.push(g)),1}if(w=0,C=u===""?".":u+":",An(n))for(var A=0;A<n.length;A++)u=n[A],P=C+Oe(u,A),w+=be(u,s,d,P,g);else if(A=t(n),typeof A==="function")for(A===n.entries&&(_n||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),_n=!0),n=A.call(n),A=0;!(u=n.next()).done;)u=u.value,P=C+Oe(u,A++),w+=be(u,s,d,P,g);else if(P==="object"){if(typeof n.then==="function")return be(fo(n),s,d,u,g);throw s=String(n),Error("Objects are not valid as a React child (found: "+(s==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":s)+"). If you meant to render a collection of children, use an array instead.")}return w}function qe(n,s,d){if(n==null)return n;var u=[],g=0;return be(n,u,"","",function(P){return s.call(d,P,g++)}),u}function mo(n){if(n._status===-1){var s=null,d=null,u=n._ioInfo;u!=null&&(u.start=u.end=performance.now(),u.value=new Promise(function(w,C){s=w,d=C})),u=n._result;var g=u();if(g.then(function(w){if(n._status===0||n._status===-1){n._status=1,n._result=w;var C=n._ioInfo;if(C!=null){C.end=performance.now();var A=w==null?void 0:w.default;s(A),C.value.status="fulfilled",C.value.value=A}g.status===void 0&&(g.status="fulfilled",g.value=w)}},function(w){if(n._status===0||n._status===-1){n._status=2,n._result=w;var C=n._ioInfo;C!=null&&(C.end=performance.now(),C.value.then(p,p),d(w),C.value.status="rejected",C.value.reason=w),g.status===void 0&&(g.status="rejected",g.reason=w)}}),u=n._ioInfo,u!=null){var P=g.displayName;typeof P==="string"&&(u.name=P)}n._status===-1&&(n._status=0,n._result=g)}if(n._status===1)return u=n._result,u===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
3
3
 
4
4
  Your code should look like:
5
5
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -11,11 +11,11 @@ Your code should look like:
11
11
  1. You might have mismatching versions of React and the renderer (such as React DOM)
12
12
  2. You might be breaking the Rules of Hooks
13
13
  3. You might have more than one copy of React in the same app
14
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n}function hn(){M.asyncTransitions--}function yn(n){var s=M.T,d={};d.types=s!==null?s.types:null,d._updatedFibers=new Set,M.T=d;try{var u=n(),g=M.S;g!==null&&g(d,u),typeof u==="object"&&u!==null&&typeof u.then==="function"&&(M.asyncTransitions++,u.then(hn,hn),u.then(p,jn))}catch(P){jn(P)}finally{s===null&&d._updatedFibers&&(n=d._updatedFibers.size,d._updatedFibers.clear(),10<n&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),s!==null&&d.types!==null&&(s.types!==null&&s.types!==d.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),s.types=d.types),M.T=s}}function bn(n){var s=M.T;if(s!==null){var d=s.types;d===null?s.types=[n]:d.indexOf(n)===-1&&d.push(n)}else M.asyncTransitions===0&&console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."),yn(bn.bind(null,n))}function Ve(n){if(Xe===null)try{var s=("require"+Math.random()).slice(0,7);Xe=(tt&&tt[s]).call(tt,"timers").setImmediate}catch(d){Xe=function(u){Bn===!1&&(Bn=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var g=new MessageChannel;g.port1.onmessage=u,g.port2.postMessage(void 0)}}return Xe(n)}function Ae(n){return 1<n.length&&typeof AggregateError==="function"?AggregateError(n):n[0]}function Ye(n,s){s!==Qe-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Qe=s}function Ot(n,s,d){var u=M.actQueue;if(u!==null)if(u.length!==0)try{At(u),Ve(function(){return Ot(n,s,d)});return}catch(g){M.thrownErrors.push(g)}else M.actQueue=null;0<M.thrownErrors.length?(u=Ae(M.thrownErrors),M.thrownErrors.length=0,d(u)):s(n)}function At(n){if(!It){It=!0;var s=0;try{for(;s<n.length;s++){var d=n[s];do{M.didUsePromise=!1;var u=d(!1);if(u!==null){if(M.didUsePromise){n[s]=d,n.splice(0,s);return}d=u}else break}while(1)}n.length=0}catch(g){n.splice(0,s+1),M.thrownErrors.push(g)}finally{It=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Pt=Symbol.for("react.transitional.element"),wn=Symbol.for("react.portal"),Lt=Symbol.for("react.fragment"),vn=Symbol.for("react.strict_mode"),kn=Symbol.for("react.profiler"),Nt=Symbol.for("react.consumer"),xn=Symbol.for("react.context"),Sn=Symbol.for("react.forward_ref"),Tn=Symbol.for("react.suspense"),mo=Symbol.for("react.suspense_list"),Dt=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),En=Symbol.for("react.activity"),Rn=Symbol.for("react.view_transition"),$n=Symbol.iterator,Cn={},Mn={isMounted:function(){return!1},enqueueForceUpdate:function(n){r(n,"forceUpdate")},enqueueReplaceState:function(n){r(n,"replaceState")},enqueueSetState:function(n){r(n,"setState")}},On=Object.assign,_t={};Object.freeze(_t),a.prototype.isReactComponent={},a.prototype.setState=function(n,s){if(typeof n!=="object"&&typeof n!=="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,s,"setState")},a.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};var q={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Le in q)q.hasOwnProperty(Le)&&e(Le,q[Le]);o.prototype=a.prototype,q=i.prototype=new o,q.constructor=i,On(q,a.prototype),q.isPureReactComponent=!0;var An=Array.isArray,go=Symbol.for("react.client.reference"),M={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Je=Object.prototype.hasOwnProperty,Pn=console.createTask?console.createTask:function(){return null};q={react_stack_bottom_frame:function(n){return n()}};var Ln,Nn,Dn={},ho=q.react_stack_bottom_frame.bind(q,h)(),yo=Pn(O(h)),_n=!1,In=/\/+/g,jn=typeof reportError==="function"?reportError:function(n){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n==="object"&&n!==null&&typeof n.message==="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",n);return}console.error(n)},Bn=!1,Xe=null,Qe=0,Ze=!1,It=!1,Hn=typeof queueMicrotask==="function"?function(n){queueMicrotask(function(){return queueMicrotask(n)})}:Ve;q=Object.freeze({__proto__:null,c:function(n){return I().useMemoCache(n)}});var Le={map:qe,forEach:function(n,s,d){qe(n,function(){s.apply(this,arguments)},d)},count:function(n){var s=0;return qe(n,function(){s++}),s},toArray:function(n){return qe(n,function(s){return s})||[]},only:function(n){if(!ee(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};S.Activity=En,S.Children=Le,S.Component=a,S.Fragment=Lt,S.Profiler=kn,S.PureComponent=i,S.StrictMode=vn,S.Suspense=Tn,S.ViewTransition=Rn,S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,S.__COMPILER_RUNTIME=q,S.act=function(n){var s=M.actQueue,d=Qe;Qe++;var u=M.actQueue=s!==null?s:[],g=!1;try{var P=n()}catch(A){M.thrownErrors.push(A)}if(0<M.thrownErrors.length)throw Ye(s,d),n=Ae(M.thrownErrors),M.thrownErrors.length=0,n;if(P!==null&&typeof P==="object"&&typeof P.then==="function"){var w=P;return Hn(function(){g||Ze||(Ze=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A,ie){g=!0,w.then(function(we){if(Ye(s,d),d===0){try{At(u),Ve(function(){return Ot(we,A,ie)})}catch(wo){M.thrownErrors.push(wo)}if(0<M.thrownErrors.length){var bo=Ae(M.thrownErrors);M.thrownErrors.length=0,ie(bo)}}else A(we)},function(we){Ye(s,d),0<M.thrownErrors.length?(we=Ae(M.thrownErrors),M.thrownErrors.length=0,ie(we)):ie(we)})}}}var C=P;if(Ye(s,d),d===0&&(At(u),u.length!==0&&Hn(function(){g||Ze||(Ze=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),M.actQueue=null),0<M.thrownErrors.length)throw n=Ae(M.thrownErrors),M.thrownErrors.length=0,n;return{then:function(A,ie){g=!0,d===0?(M.actQueue=u,Ve(function(){return Ot(C,A,ie)})):A(C)}}},S.addTransitionType=bn,S.cache=function(n){return function(){return n.apply(null,arguments)}},S.cacheSignal=function(){return null},S.captureOwnerStack=function(){var n=M.getCurrentStack;return n===null?null:n()},S.cloneElement=function(n,s,d){if(n===null||n===void 0)throw Error("The argument must be a React element, but you passed "+n+".");var u=On({},n.props),{key:g,_owner:P}=n;if(s!=null){var w;e:{if(Je.call(s,"ref")&&(w=Object.getOwnPropertyDescriptor(s,"ref").get)&&w.isReactWarning){w=!1;break e}w=s.ref!==void 0}w&&(P=L()),c(s)&&(b(s.key),g=""+s.key);for(C in s)!Je.call(s,C)||C==="key"||C==="__self"||C==="__source"||C==="ref"&&s.ref===void 0||(u[C]=s[C])}var C=arguments.length-2;if(C===1)u.children=d;else if(1<C){w=Array(C);for(var A=0;A<C;A++)w[A]=arguments[A+2];u.children=w}u=T(n.type,g,u,P,n._debugStack,n._debugTask);for(g=2;g<arguments.length;g++)Z(arguments[g]);return u},S.createContext=function(n){return n={$$typeof:xn,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:Nt,_context:n},n._currentRenderer=null,n._currentRenderer2=null,n},S.createElement=function(n,s,d){for(var u=2;u<arguments.length;u++)Z(arguments[u]);var g;u={};var P=null;if(s!=null)for(g in Nn||!("__self"in s)||"key"in s||(Nn=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),c(s)&&(b(s.key),P=""+s.key),s)Je.call(s,g)&&g!=="key"&&g!=="__self"&&g!=="__source"&&(u[g]=s[g]);var w=arguments.length-2;if(w===1)u.children=d;else if(1<w){for(var C=Array(w),A=0;A<w;A++)C[A]=arguments[A+2];Object.freeze&&Object.freeze(C),u.children=C}if(n&&n.defaultProps)for(g in w=n.defaultProps,w)u[g]===void 0&&(u[g]=w[g]);return P&&l(u,typeof n==="function"?n.displayName||n.name||"Unknown":n),(g=1e4>M.recentlyCreatedOwnerStacks++)?(C=Error.stackTraceLimit,Error.stackTraceLimit=10,w=Error("react-stack-top-frame"),Error.stackTraceLimit=C):w=ho,T(n,P,u,L(),w,g?Pn(O(n)):yo)},S.createRef=function(){var n={current:null};return Object.seal(n),n},S.forwardRef=function(n){n!=null&&n.$$typeof===Dt?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof n!=="function"?console.error("forwardRef requires a render function but was given %s.",n===null?"null":typeof n):n.length!==0&&n.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",n.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),n!=null&&n.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var s={$$typeof:Sn,render:n},d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(u){d=u,n.name||n.displayName||(Object.defineProperty(n,"name",{value:u}),n.displayName=u)}}),s},S.isValidElement=ee,S.lazy=function(n){n={_status:-1,_result:n};var s={$$typeof:Pe,_payload:n,_init:fo},d={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return n._ioInfo=d,s._debugInfo=[{awaited:d}],s},S.memo=function(n,s){n==null&&console.error("memo: The first argument must be a component. Instead received: %s",n===null?"null":typeof n),s={$$typeof:Dt,type:n,compare:s===void 0?null:s};var d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(u){d=u,n.name||n.displayName||(Object.defineProperty(n,"name",{value:u}),n.displayName=u)}}),s},S.startTransition=yn,S.unstable_useCacheRefresh=function(){return I().useCacheRefresh()},S.use=function(n){return I().use(n)},S.useActionState=function(n,s,d){return I().useActionState(n,s,d)},S.useCallback=function(n,s){return I().useCallback(n,s)},S.useContext=function(n){var s=I();return n.$$typeof===Nt&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),s.useContext(n)},S.useDebugValue=function(n,s){return I().useDebugValue(n,s)},S.useDeferredValue=function(n,s){return I().useDeferredValue(n,s)},S.useEffect=function(n,s){return n==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useEffect(n,s)},S.useEffectEvent=function(n){return I().useEffectEvent(n)},S.useId=function(){return I().useId()},S.useImperativeHandle=function(n,s,d){return I().useImperativeHandle(n,s,d)},S.useInsertionEffect=function(n,s){return n==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useInsertionEffect(n,s)},S.useLayoutEffect=function(n,s){return n==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useLayoutEffect(n,s)},S.useMemo=function(n,s){return I().useMemo(n,s)},S.useOptimistic=function(n,s){return I().useOptimistic(n,s)},S.useReducer=function(n,s,d){return I().useReducer(n,s,d)},S.useRef=function(n){return I().useRef(n)},S.useState=function(n){return I().useState(n)},S.useSyncExternalStore=function(n,s,d){return I().useSyncExternalStore(n,s,d)},S.useTransition=function(){return I().useTransition()},S.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var H=et(function(Ro,Gn){Gn.exports=Fn()});var Qn=et(function(z){(function(){function e(){}function t(c){return""+c}function r(c,l,x){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;if(T==null)T=null;else if(T===L)T=L;else{try{t(T);var _=!1}catch(Z){_=!0}_&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object"),t(T)),T=""+T}return{$$typeof:R,key:T,children:c,containerInfo:l,implementation:x}}function a(c,l){if(c==="font")return"";if(typeof l==="string")return l==="use-credentials"?l:""}function o(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":'something with type "'+typeof c+'"'}function i(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":typeof c==="string"?JSON.stringify(c):typeof c==="number"?"`"+c+"`":'something with type "'+typeof c+'"'}function p(){var c=h.H;return c===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
14
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),n}function hn(){M.asyncTransitions--}function yn(n){var s=M.T,d={};d.types=s!==null?s.types:null,d._updatedFibers=new Set,M.T=d;try{var u=n(),g=M.S;g!==null&&g(d,u),typeof u==="object"&&u!==null&&typeof u.then==="function"&&(M.asyncTransitions++,u.then(hn,hn),u.then(p,jn))}catch(P){jn(P)}finally{s===null&&d._updatedFibers&&(n=d._updatedFibers.size,d._updatedFibers.clear(),10<n&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),s!==null&&d.types!==null&&(s.types!==null&&s.types!==d.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),s.types=d.types),M.T=s}}function bn(n){var s=M.T;if(s!==null){var d=s.types;d===null?s.types=[n]:d.indexOf(n)===-1&&d.push(n)}else M.asyncTransitions===0&&console.error("addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."),yn(bn.bind(null,n))}function Ve(n){if(Xe===null)try{var s=("require"+Math.random()).slice(0,7);Xe=(tt&&tt[s]).call(tt,"timers").setImmediate}catch(d){Xe=function(u){Bn===!1&&(Bn=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var g=new MessageChannel;g.port1.onmessage=u,g.port2.postMessage(void 0)}}return Xe(n)}function Ae(n){return 1<n.length&&typeof AggregateError==="function"?AggregateError(n):n[0]}function Ye(n,s){s!==Qe-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Qe=s}function Ot(n,s,d){var u=M.actQueue;if(u!==null)if(u.length!==0)try{At(u),Ve(function(){return Ot(n,s,d)});return}catch(g){M.thrownErrors.push(g)}else M.actQueue=null;0<M.thrownErrors.length?(u=Ae(M.thrownErrors),M.thrownErrors.length=0,d(u)):s(n)}function At(n){if(!It){It=!0;var s=0;try{for(;s<n.length;s++){var d=n[s];do{M.didUsePromise=!1;var u=d(!1);if(u!==null){if(M.didUsePromise){n[s]=d,n.splice(0,s);return}d=u}else break}while(1)}n.length=0}catch(g){n.splice(0,s+1),M.thrownErrors.push(g)}finally{It=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Pt=Symbol.for("react.transitional.element"),wn=Symbol.for("react.portal"),Lt=Symbol.for("react.fragment"),vn=Symbol.for("react.strict_mode"),kn=Symbol.for("react.profiler"),Nt=Symbol.for("react.consumer"),xn=Symbol.for("react.context"),Sn=Symbol.for("react.forward_ref"),Tn=Symbol.for("react.suspense"),go=Symbol.for("react.suspense_list"),Dt=Symbol.for("react.memo"),Pe=Symbol.for("react.lazy"),En=Symbol.for("react.activity"),Rn=Symbol.for("react.view_transition"),$n=Symbol.iterator,Cn={},Mn={isMounted:function(){return!1},enqueueForceUpdate:function(n){r(n,"forceUpdate")},enqueueReplaceState:function(n){r(n,"replaceState")},enqueueSetState:function(n){r(n,"setState")}},On=Object.assign,_t={};Object.freeze(_t),a.prototype.isReactComponent={},a.prototype.setState=function(n,s){if(typeof n!=="object"&&typeof n!=="function"&&n!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,s,"setState")},a.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};var q={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Le in q)q.hasOwnProperty(Le)&&e(Le,q[Le]);o.prototype=a.prototype,q=i.prototype=new o,q.constructor=i,On(q,a.prototype),q.isPureReactComponent=!0;var An=Array.isArray,ho=Symbol.for("react.client.reference"),M={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},Je=Object.prototype.hasOwnProperty,Pn=console.createTask?console.createTask:function(){return null};q={react_stack_bottom_frame:function(n){return n()}};var Ln,Nn,Dn={},yo=q.react_stack_bottom_frame.bind(q,h)(),bo=Pn(O(h)),_n=!1,In=/\/+/g,jn=typeof reportError==="function"?reportError:function(n){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n==="object"&&n!==null&&typeof n.message==="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",n);return}console.error(n)},Bn=!1,Xe=null,Qe=0,Ze=!1,It=!1,Hn=typeof queueMicrotask==="function"?function(n){queueMicrotask(function(){return queueMicrotask(n)})}:Ve;q=Object.freeze({__proto__:null,c:function(n){return I().useMemoCache(n)}});var Le={map:qe,forEach:function(n,s,d){qe(n,function(){s.apply(this,arguments)},d)},count:function(n){var s=0;return qe(n,function(){s++}),s},toArray:function(n){return qe(n,function(s){return s})||[]},only:function(n){if(!ee(n))throw Error("React.Children.only expected to receive a single React element child.");return n}};S.Activity=En,S.Children=Le,S.Component=a,S.Fragment=Lt,S.Profiler=kn,S.PureComponent=i,S.StrictMode=vn,S.Suspense=Tn,S.ViewTransition=Rn,S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,S.__COMPILER_RUNTIME=q,S.act=function(n){var s=M.actQueue,d=Qe;Qe++;var u=M.actQueue=s!==null?s:[],g=!1;try{var P=n()}catch(A){M.thrownErrors.push(A)}if(0<M.thrownErrors.length)throw Ye(s,d),n=Ae(M.thrownErrors),M.thrownErrors.length=0,n;if(P!==null&&typeof P==="object"&&typeof P.then==="function"){var w=P;return Hn(function(){g||Ze||(Ze=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(A,le){g=!0,w.then(function(we){if(Ye(s,d),d===0){try{At(u),Ve(function(){return Ot(we,A,le)})}catch(vo){M.thrownErrors.push(vo)}if(0<M.thrownErrors.length){var wo=Ae(M.thrownErrors);M.thrownErrors.length=0,le(wo)}}else A(we)},function(we){Ye(s,d),0<M.thrownErrors.length?(we=Ae(M.thrownErrors),M.thrownErrors.length=0,le(we)):le(we)})}}}var C=P;if(Ye(s,d),d===0&&(At(u),u.length!==0&&Hn(function(){g||Ze||(Ze=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),M.actQueue=null),0<M.thrownErrors.length)throw n=Ae(M.thrownErrors),M.thrownErrors.length=0,n;return{then:function(A,le){g=!0,d===0?(M.actQueue=u,Ve(function(){return Ot(C,A,le)})):A(C)}}},S.addTransitionType=bn,S.cache=function(n){return function(){return n.apply(null,arguments)}},S.cacheSignal=function(){return null},S.captureOwnerStack=function(){var n=M.getCurrentStack;return n===null?null:n()},S.cloneElement=function(n,s,d){if(n===null||n===void 0)throw Error("The argument must be a React element, but you passed "+n+".");var u=On({},n.props),{key:g,_owner:P}=n;if(s!=null){var w;e:{if(Je.call(s,"ref")&&(w=Object.getOwnPropertyDescriptor(s,"ref").get)&&w.isReactWarning){w=!1;break e}w=s.ref!==void 0}w&&(P=L()),c(s)&&(b(s.key),g=""+s.key);for(C in s)!Je.call(s,C)||C==="key"||C==="__self"||C==="__source"||C==="ref"&&s.ref===void 0||(u[C]=s[C])}var C=arguments.length-2;if(C===1)u.children=d;else if(1<C){w=Array(C);for(var A=0;A<C;A++)w[A]=arguments[A+2];u.children=w}u=T(n.type,g,u,P,n._debugStack,n._debugTask);for(g=2;g<arguments.length;g++)Z(arguments[g]);return u},S.createContext=function(n){return n={$$typeof:xn,_currentValue:n,_currentValue2:n,_threadCount:0,Provider:null,Consumer:null},n.Provider=n,n.Consumer={$$typeof:Nt,_context:n},n._currentRenderer=null,n._currentRenderer2=null,n},S.createElement=function(n,s,d){for(var u=2;u<arguments.length;u++)Z(arguments[u]);var g;u={};var P=null;if(s!=null)for(g in Nn||!("__self"in s)||"key"in s||(Nn=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),c(s)&&(b(s.key),P=""+s.key),s)Je.call(s,g)&&g!=="key"&&g!=="__self"&&g!=="__source"&&(u[g]=s[g]);var w=arguments.length-2;if(w===1)u.children=d;else if(1<w){for(var C=Array(w),A=0;A<w;A++)C[A]=arguments[A+2];Object.freeze&&Object.freeze(C),u.children=C}if(n&&n.defaultProps)for(g in w=n.defaultProps,w)u[g]===void 0&&(u[g]=w[g]);return P&&l(u,typeof n==="function"?n.displayName||n.name||"Unknown":n),(g=1e4>M.recentlyCreatedOwnerStacks++)?(C=Error.stackTraceLimit,Error.stackTraceLimit=10,w=Error("react-stack-top-frame"),Error.stackTraceLimit=C):w=yo,T(n,P,u,L(),w,g?Pn(O(n)):bo)},S.createRef=function(){var n={current:null};return Object.seal(n),n},S.forwardRef=function(n){n!=null&&n.$$typeof===Dt?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof n!=="function"?console.error("forwardRef requires a render function but was given %s.",n===null?"null":typeof n):n.length!==0&&n.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",n.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),n!=null&&n.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var s={$$typeof:Sn,render:n},d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(u){d=u,n.name||n.displayName||(Object.defineProperty(n,"name",{value:u}),n.displayName=u)}}),s},S.isValidElement=ee,S.lazy=function(n){n={_status:-1,_result:n};var s={$$typeof:Pe,_payload:n,_init:mo},d={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return n._ioInfo=d,s._debugInfo=[{awaited:d}],s},S.memo=function(n,s){n==null&&console.error("memo: The first argument must be a component. Instead received: %s",n===null?"null":typeof n),s={$$typeof:Dt,type:n,compare:s===void 0?null:s};var d;return Object.defineProperty(s,"displayName",{enumerable:!1,configurable:!0,get:function(){return d},set:function(u){d=u,n.name||n.displayName||(Object.defineProperty(n,"name",{value:u}),n.displayName=u)}}),s},S.startTransition=yn,S.unstable_useCacheRefresh=function(){return I().useCacheRefresh()},S.use=function(n){return I().use(n)},S.useActionState=function(n,s,d){return I().useActionState(n,s,d)},S.useCallback=function(n,s){return I().useCallback(n,s)},S.useContext=function(n){var s=I();return n.$$typeof===Nt&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),s.useContext(n)},S.useDebugValue=function(n,s){return I().useDebugValue(n,s)},S.useDeferredValue=function(n,s){return I().useDeferredValue(n,s)},S.useEffect=function(n,s){return n==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useEffect(n,s)},S.useEffectEvent=function(n){return I().useEffectEvent(n)},S.useId=function(){return I().useId()},S.useImperativeHandle=function(n,s,d){return I().useImperativeHandle(n,s,d)},S.useInsertionEffect=function(n,s){return n==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useInsertionEffect(n,s)},S.useLayoutEffect=function(n,s){return n==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),I().useLayoutEffect(n,s)},S.useMemo=function(n,s){return I().useMemo(n,s)},S.useOptimistic=function(n,s){return I().useOptimistic(n,s)},S.useReducer=function(n,s,d){return I().useReducer(n,s,d)},S.useRef=function(n){return I().useRef(n)},S.useState=function(n){return I().useState(n)},S.useSyncExternalStore=function(n,s,d){return I().useSyncExternalStore(n,s,d)},S.useTransition=function(){return I().useTransition()},S.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var B=et(function($o,Gn){Gn.exports=Fn()});var Qn=et(function(z){(function(){function e(){}function t(c){return""+c}function r(c,l,x){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;if(T==null)T=null;else if(T===L)T=L;else{try{t(T);var _=!1}catch(Z){_=!0}_&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol==="function"&&Symbol.toStringTag&&T[Symbol.toStringTag]||T.constructor.name||"Object"),t(T)),T=""+T}return{$$typeof:R,key:T,children:c,containerInfo:l,implementation:x}}function a(c,l){if(c==="font")return"";if(typeof l==="string")return l==="use-credentials"?l:""}function o(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":'something with type "'+typeof c+'"'}function i(c){return c===null?"`null`":c===void 0?"`undefined`":c===""?"an empty string":typeof c==="string"?JSON.stringify(c):typeof c==="number"?"`"+c+"`":'something with type "'+typeof c+'"'}function p(){var c=h.H;return c===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
15
15
  1. You might have mismatching versions of React and the renderer (such as React DOM)
16
16
  2. You might be breaking the Rules of Hooks
17
17
  3. You might have more than one copy of React in the same app
18
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var f=H(),b={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},R=Symbol.for("react.portal"),O=Symbol.for("react.recoverable"),L=Symbol.for("react.optimistic_key"),h=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),z.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,z.browser=function(c){return{$$typeof:O,_reason:c}},z.createPortal=function(c,l){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error("Target container is not a DOM element.");return r(c,l,null,x)},z.flushSync=function(c){var l=h.T,x=b.p;try{if(h.T=null,b.p=2,c)return c()}finally{h.T=l,b.p=x,b.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},z.preconnect=function(c,l){typeof c==="string"&&c?l!=null&&typeof l!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(l)):l!=null&&typeof l.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",o(l.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c)),typeof c==="string"&&(l?(l=l.crossOrigin,l=typeof l==="string"?l==="use-credentials"?l:"":void 0):l=null,b.d.C(c,l))},z.prefetchDNS=function(c){if(typeof c!=="string"||!c)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c));else if(1<arguments.length){var l=arguments[1];typeof l==="object"&&l.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(l)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(l))}typeof c==="string"&&b.d.D(c)},z.preinit=function(c,l){if(typeof c==="string"&&c?l==null||typeof l!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(l)):l.as!=="style"&&l.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(l.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c)),typeof c==="string"&&l&&typeof l.as==="string"){var x=l.as,T=a(x,l.crossOrigin),_=typeof l.integrity==="string"?l.integrity:void 0,Z=typeof l.fetchPriority==="string"?l.fetchPriority:void 0;x==="style"?b.d.S(c,typeof l.precedence==="string"?l.precedence:void 0,{crossOrigin:T,integrity:_,fetchPriority:Z}):x==="script"&&b.d.X(c,{crossOrigin:T,integrity:_,fetchPriority:Z,nonce:typeof l.nonce==="string"?l.nonce:void 0})}},z.preinitModule=function(c,l){var x="";if(typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l!==void 0&&typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":l&&("as"in l)&&l.as!=="script"&&(x+=" The `as` option encountered was "+i(l.as)+"."),x)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",x);else switch(x=l&&typeof l.as==="string"?l.as:"script",x){case"script":break;default:x=i(x),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',x,c)}if(typeof c==="string")if(typeof l==="object"&&l!==null){if(l.as==null||l.as==="script")x=a(l.as,l.crossOrigin),b.d.M(c,{crossOrigin:x,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0})}else l==null&&b.d.M(c)},z.preload=function(c,l){var x="";if(typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l==null||typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":typeof l.as==="string"&&l.as||(x+=" The `as` option encountered was "+o(l.as)+"."),x&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',x),typeof c==="string"&&typeof l==="object"&&l!==null&&typeof l.as==="string"){x=l.as;var T=a(x,l.crossOrigin);b.d.L(c,x,{crossOrigin:T,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,type:typeof l.type==="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy==="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet==="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes==="string"?l.imageSizes:void 0,media:typeof l.media==="string"?l.media:void 0})}},z.preloadModule=function(c,l){var x="";typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l!==void 0&&typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":l&&("as"in l)&&typeof l.as!=="string"&&(x+=" The `as` option encountered was "+o(l.as)+"."),x&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',x),typeof c==="string"&&(l?(x=a(l.as,l.crossOrigin),b.d.m(c,{as:typeof l.as==="string"&&l.as!=="script"?l.as:void 0,crossOrigin:x,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0})):b.d.m(c))},z.requestFormReset=function(c){b.d.r(c)},z.unstable_batchedUpdates=function(c,l){return c(l)},z.useFormState=function(c,l,x){return p().useFormState(c,l,x)},z.useFormStatus=function(){return p().useHostTransitionStatus()},z.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Ne=et(function(Mo,Zn){Zn.exports=Qn()});var Un=(e)=>{let t,r=new Set,a=(R,O)=>{let L=typeof R==="function"?R(t):R;if(!Object.is(L,t)){let h=t;t=(O!=null?O:typeof L!=="object"||L===null)?L:Object.assign({},t,L),r.forEach((c)=>c(t,h))}},o=()=>t,f={setState:a,getState:o,getInitialState:()=>b,subscribe:(R)=>(r.add(R),()=>r.delete(R))},b=t=e(a,o,f);return f},Wn=(e)=>e?Un(e):Un;var nt=j(H(),1);var $o=(e)=>e;function Co(e,t=$o){let r=nt.default.useSyncExternalStore(e.subscribe,nt.default.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return nt.default.useDebugValue(r),r}var qn=(e)=>{let t=Wn(e),r=(a)=>Co(t,a);return Object.assign(r,t),r},E=(e)=>e?qn(e):qn;var te=E()(()=>({state:{project:null,projects:[],cards:[],now:Date.now(),all:!1,dir:null},loaded:!1,all:typeof location>"u"?!0:new URLSearchParams(location.search).get("all")!=="0",dir:null,every:null,tasks:null,sources:null,shells:[],changed:0})),{getState:F,setState:ue}=te,ve=(e,t)=>te.subscribe((r,a)=>e(r)!==e(a)?t(e(r),e(a)):void 0);var Vn=2000,Yn=2000,Jn=30000,Xn=(e)=>e.replace(/"now":\d+\}$/,"");var ke=j(H(),1),Ao=j(Ne(),1);function Oo(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}var qa=Array(12).fill(0);var Po=1,Lo=100,er=(e)=>{var t;return typeof(e==null?void 0:e.id)==="number"||(e==null?void 0:(t=e.id)==null?void 0:t.length)>0?e.id:Po++};class tr{constructor(){this.subscribe=(e)=>(this.subscribers.push(e),this.getActiveToasts().forEach((t)=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=(e)=>{this.subscribers.forEach((t)=>t(e))},this.addToast=(e)=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Lo;if(e<=0)return;this.toasts=this.toasts.filter((t)=>{if(e>0&&this.dismissedToasts.has(t.id))return this.dismissedToasts.delete(t.id),e--,!1;return!0})},this.create=(e)=>{let{message:t,...r}=e,a=er(e),o=this.pendingDismissals.get(a);if(o!==void 0)cancelAnimationFrame(o),this.pendingDismissals.delete(a),this.dismissedToasts.delete(a);let i=this.dismissedToasts.has(a),p=e.dismissible===void 0?!0:e.dismissible;if(i)this.dismissedToasts.delete(a),this.toasts=this.toasts.filter((b)=>b.id!==a);if(i?void 0:this.toasts.find((b)=>b.id===a))this.toasts=this.toasts.map((b)=>{if(b.id===a)return this.publish({...b,...e,id:a,title:t}),{...b,...e,id:a,dismissible:p,title:t};return b});else this.addToast({title:t,...r,dismissible:p,id:a});return a},this.dismiss=(e)=>{if(e===void 0||e===null)return this.getActiveToasts().forEach((r)=>{this.dismissedToasts.add(r.id),this.subscribers.forEach((a)=>a({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);if(t!==void 0)cancelAnimationFrame(t);return this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach((r)=>r({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r=void 0;if(t.loading!==void 0)r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!=="function"?t.description:void 0});let a=Promise.resolve(e instanceof Function?e():e),o=r!==void 0,i,p=a.then(async(b)=>{if(i=["resolve",b],ke.default.isValidElement(b))o=!1,this.create({id:r,type:"default",message:b});else if(Do(b)&&!b.ok){o=!1;let O=typeof t.error==="function"?await t.error(`HTTP error! status: ${b.status}`):t.error,L=typeof t.description==="function"?await t.description(`HTTP error! status: ${b.status}`):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"error",description:L,...c})}else if(b instanceof Error){o=!1;let O=typeof t.error==="function"?await t.error(b):t.error,L=typeof t.description==="function"?await t.description(b):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"error",description:L,...c})}else if(t.success!==void 0){o=!1;let O=typeof t.success==="function"?await t.success(b):t.success,L=typeof t.description==="function"?await t.description(b):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"success",description:L,...c})}}).catch(async(b)=>{if(i=["reject",b],t.error!==void 0){o=!1;let R=typeof t.error==="function"?await t.error(b):t.error,O=typeof t.description==="function"?await t.description(b):t.description,h=typeof R==="object"&&!ke.default.isValidElement(R)?R:{message:R};this.create({id:r,type:"error",description:O,...h})}}).finally(()=>{if(o)this.dismiss(r),r=void 0;t.finally==null||t.finally.call(t)}),f=()=>new Promise((b,R)=>p.then(()=>i[0]==="reject"?R(i[1]):b(i[1])).catch(R));if(typeof r!=="string"&&typeof r!=="number")return{unwrap:f};else return Object.assign(r,{unwrap:f})},this.custom=(e,t)=>{let r=er(t);return this.create({...t,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter((e)=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}var V=new tr,No=(e,t)=>V.message(e,t),Do=(e)=>e&&typeof e==="object"&&("ok"in e)&&typeof e.ok==="boolean"&&("status"in e)&&typeof e.status==="number",_o=No,Io=()=>V.toasts,jo=()=>V.getActiveToasts(),Bo=Object.assign(_o,{success:V.success,info:V.info,warning:V.warning,error:V.error,custom:V.custom,message:V.message,promise:V.promise,dismiss:V.dismiss,loading:V.loading},{getHistory:Io,getToasts:jo});Oo("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");var ti=E()(()=>({open:null}));var Ho=[];function pe(e){Promise.allSettled(Ho.map((t)=>t())).then(()=>location.href=e)}var ce=()=>matchMedia("(max-width:640px)").matches;function sr(){let e=new Map,t=new Map;return(r,a,o,i)=>{let p=e.get(r);if(e.set(r,a),p&&a!==p)t.set(r,i);return p!==void 0&&!!a&&a!==p&&!(o&&i-(t.get(r)??-1/0)<60000)}}var ar=E()(()=>({tasks:[],tasksLoaded:!1,tasksError:"",filter:"all",query:"",scope:"",taskId:"",taskDir:"",page:null,pageError:"",pending:!1,receipt:"",draft:""})),{getState:xi,setState:Si}=ar;var zo=["Adara","Alya","Bellatrix","Beryllium","Cobalt","Fluorine","Krypton","Palladium","Rubidium","Xenon"],$i=["off",...zo,"chime","bell","pop"];var Bt;addEventListener("pointerdown",()=>{try{Bt=Bt||new AudioContext,Bt.resume()}catch(e){}},{once:!0});var Ko=["settings","sources","terminal","board","tasks","task","run","chat","device"];function ir(e,t){let r=e==="icebox"?"sources":e==="ws"?"run":e==="ideas"?"tasks":e??"";if(!Ko.includes(r))r="home";if(t?r==="board"||r==="sources":r==="chat"||r==="device")r="home";return r}var Uo=(e,t)=>ir(new URLSearchParams(e).get("view"),t),lr=(e,t,r)=>r?"board":Uo(e,t);var cr=(e,t)=>e==="task"?t?"device":"tasks":e==="run"&&t?"device":e,Wo={sources:"Icebox",tasks:"Tasks",task:"Task",run:"Run",terminal:"Terminal",chat:"Chat",device:"Runs"},dr=(e,t)=>e==="home"?t?"kaizen":"Chat":Wo[e]??"Board",ur=(e,t)=>e==="tasks"?"tasks":e==="task"?"task":e==="sources"?"icebox":e==="home"&&!t||e==="chat"?"home":"",pr=(e)=>e==="tasks"?"tasks":e==="task"?"task":e==="sources"?"icebox":"";function fr(e){let t=new URLSearchParams(e);if(t.get("view")!=="run"&&t.get("view")!=="ws")return null;let r=t.get("dir");if(!r)return null;return{dir:r,...t.get("ws")?{ws:t.get("ws")}:{},...t.get("id")?{id:t.get("id")}:{},...t.get("idea")!==null?{idea:t.get("idea")}:{}}}var qo=j(Ne(),1);var Vo=(e,t)=>({view:e,lit:cr(e,t),title:dr(e,t),mark:e==="home"&&t,page:pr(e)}),Yo=(e,t,r)=>{let a=ur(t,r);return a&&!e.includes(a)?[...e,a]:e},Jo=()=>{let e=typeof location>"u"?"":location.search,t=typeof matchMedia>"u"?!1:ce(),r=lr(e,t,typeof document<"u"&&document.documentElement.hasAttribute("data-kit"));return{...Vo(r,t),seen:Yo([],r,t),search:e,run:fr(e),menu:!1,visit:0}},rt=E()(Jo),ot=rt.getState;var Xo=j(H(),1);var Qo=(e)=>({cards:e.cards,projects:[...e.projects,...e.rail??[]],agents:e.agents??[]}),Kt=0;function Zo(e,t={}){Kt++,ue({every:e,...t})}var mr="",Ht=!1,st=!1,gr=0,hr;async function De(){if(Ht){st=!0;return}let e=gr+Vn-Date.now();if(e>0){hr??=setTimeout(()=>{hr=void 0,De()},e);return}gr=Date.now(),Ht=!0;do{st=!1;let t=Kt;try{let r=await fetch("/state?all=1");if(!r.ok)continue;let a=await r.text(),o=Xn(a);if(o===mr)continue;if(!st&&t===Kt){mr=o;let i=JSON.parse(a);Zo(Qo(i))}}catch{}}while(st);Ht=!1}var yr=0,zt=!1;async function br(){if(zt||Date.now()-yr<Yn)return;zt=!0,yr=Date.now();try{let e=await fetch("/tasks?all=1");if(e.ok)ue({tasks:(await e.json()).tasks??[]})}catch{}finally{zt=!1}}var wr=0;async function es(e=!1){if(!e&&Date.now()-wr<Jn)return;wr=Date.now();try{let t=await fetch("/sources");if(t.ok)ue({sources:await t.json()})}catch{}}async function vr(){try{return ue({shells:await(await fetch("/shells")).json()}),!0}catch{return!1}}function kr(e=!1){return br(),ve((t)=>t.every,()=>{if(es(),br(),e)vr()})}var ts=j(H(),1);var ns={cards:[],projects:[],agents:[],tasks:null};var xe=()=>{let{every:e,tasks:t}=te.getState();return e?{...e,tasks:t}:{...ns,tasks:t}};var os=E()(()=>({open:null})),ss=0,Se=(e={})=>os.setState({open:{...e,n:++ss}});var as=new Map,is=(e)=>e.key+"@"+(e.born??0);var xr=(e,t=as)=>{let r=new Set(e.map(is));for(let a of t.keys())if(!r.has(a))t.delete(a)};var Sr={dirs:[],running:!0,done:!1};var _e=(e,t)=>{let r=t?.find((a)=>a.dir===e)?.label||e.replace(/[\\/]\.kaizen$/,"");return r.split(/[\\/]/).pop()||r};var at=(e,t)=>{try{return JSON.parse(localStorage.getItem(e)||"null")??t}catch{return t}};ve((e)=>e.every,(e)=>e&&xr(e.agents));var it={filt:"kz-rail-filter2",folded:"kz-rail-folded",pins:"kz-ws-pins",open:"kz-wsopen"},cs=E()(()=>({filt:{...Sr,...at(it.filt,{})},folded:at(it.folded,[]),pins:at(it.pins,[]),open:at(it.open,{}),q:"",tick:0}));var ps=(e)=>typeof e==="string"&&/[\\/]\.kaizen[\\/]home$/.test(e),Ie=(e,t)=>ps(e)?"/?view=board&homews=1":`/?view=ws&dir=${encodeURIComponent(e)}&ws=${encodeURIComponent(t)}`,Tr=()=>xe().projects.filter((e)=>e.workspaces?.some((t)=>t.branch)).map((e)=>({dir:e.dir,name:_e(e.dir,xe().projects)}));var fs=j(H(),1);var ms=E()(()=>({shown:(()=>{try{return JSON.parse(localStorage.getItem("kz-show")??"null")||[]}catch{return[]}})()}));var Jl=E()(()=>({at:null}));var tc=typeof location<"u"&&new URLSearchParams(location.search).has("all");var Te={add:()=>{},search:()=>{}};var Ut=j(H(),1);var Rr=E()(()=>({dark:!1,min:!1,setup:null,openSetup:null,look:0})),{getState:hs,setState:ys}=Rr;var Wc=E()(()=>({on:!1}));var bs=j(H(),1);var ws=j(H(),1),Qc=typeof matchMedia==="function"?matchMedia("(max-width:640px)"):null;var vs=j(H(),1);var $r=(e,t,r)=>{try{return JSON.parse(e().getItem(t)??"null")??r}catch{return r}},Wt=E()(()=>({snap:null,tab:(()=>{try{return localStorage.getItem("kz-ideas-tab")==="backlog"?"backlog":"ideas"}catch{return"ideas"}})(),sev:null,order:$r(()=>localStorage,"kz-order",{}),picking:!1,picked:[],unfolded:[],kidsOpen:[],form:(()=>{let e=$r(()=>sessionStorage,"kz-form",null);return e?{mode:e[0],key:e[1]??void 0}:null})(),popup:null,filter:null,query:(()=>{try{return sessionStorage.getItem("kz-d:bq")??""}catch{return""}})(),archive:!1,mode:(()=>{try{return localStorage.getItem("kz-board-mode")==="runs"?"runs":"ws"}catch{return"ws"}})(),flash:[],names:{}})),{getState:Be,setState:Ee}=Wt,ks=(e)=>{Ee({form:e});try{sessionStorage.setItem("kz-form",JSON.stringify(e&&["new","edit","reject"].includes(e.mode)?[e.mode,e.key??null]:null))}catch{}};var Cr=()=>Be().form?.mode==="new"&&ks(null);var xs="kz-runtabs";function Ss(e){let t=Array.isArray(e.screens)&&e.screens.every((o)=>o?.tree)?e.screens:[],{split:r,...a}=e;return{...a,tabs:(e.tabs??[]).filter((o)=>o&&o.kind!=="run"),hidden:(e.hidden??[]).filter((o)=>typeof o==="string"&&!o.startsWith("rn:")),screens:t,on:e.on??null}}function Ts(e){try{let t=JSON.parse(e||"{}");return Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r==="object").map(([r,a])=>[r,Ss(a)]))}catch{return{}}}var Es=()=>{try{return Ts(localStorage.getItem(xs))}catch{return{}}};var Ft=E()(()=>({all:Es(),dragging:null,target:null,browse:null,previewTick:0})),wd=Ft.setState;var Rs="kz-sent",He=E()(()=>({body:"",term:null,terms:[],head:null,tabs:[],tab:"",wantTab:"request",ptabs:[],runDoc:null,footer:null,doc:null,fix:null,off:[],open:!1,docked:!1,wide:!1,parked:!1,pn:!1,ro:!1,instant:!1,title:"",titleTip:"",top:0,openKey:null,card:null,openN:0,fetchAsk:0,drawAsk:0,keepNext:!1,hit:null,wantTerm:null,wantPty:null,sent:(()=>{try{return JSON.parse(sessionStorage.getItem(Rs)??"[]")||[]}catch{return[]}})()})),{getState:ne,setState:re}=He;var $s="kz-rflip";function Cs(){try{return!ce()&&localStorage.getItem($s)==="1"}catch{return!1}}var Or=E()(()=>({message:null,screens:[],on:null,split:!1,agents:[],defAgent:"",pty:!0,titles:{},items:[],wsk:null,ws:null,history:[],empty:!1,menu:null,hint:!1,notes:null,picker:null,kept:{},recent:[],flip:Cs(),awaiting:!1,focus:{id:null,n:0}}));var ct=Or.setState;var Md=E()(()=>({file:null}));var ru=E()(()=>({st:{}}));var Lr=E()(()=>({snap:null,ui:{},busy:null,busyRun:null,confirm:null}));var{getState:Ns,setState:Nr}=Lr;var Dr=E()(()=>({ctx:null,card:null,shells:[],agents:[],defAgent:"",noPty:!1,elsewhere:[],selectTerm:null})),{getState:ut,setState:Yt}=Dr;var Qt=j(H(),1);var Br=E()(()=>({view:null,files:{},refocus:null})),{getState:ia,setState:Hr}=Br;var Em=" "+String.fromCharCode(10);var ca=j(H(),1);function zr(e,t){let r=e&&"dir"in e?e:null;Cr(),Ee({popup:{kind:"new",dir:r?.dir??null,choose:!!r,text:t}})}var pa=j(Ne(),1);var Gg=E()(()=>({sheet:null}));var lh=E()(()=>({mode:null,net:{self:null,computers:[],tailscale:!1},usage:[],allDevices:!1}));var ft=j(H(),1);var va=j(Ne(),1);var fa=[["grid","Grid","lgrid"],["cols","Side by side","lcols"],["rows","Stacked","lrows"]],Ur="kz-terms";var Kr={mode:"grid",order:[],hidden:[],max:null,sizes:{}};function mt(e){try{let t={...Kr,...JSON.parse(e||"{}")};return fa.some((r)=>r[0]===t.mode)?t:{...t,mode:"grid"}}catch{return Kr}}var ma=()=>{try{return mt(localStorage.getItem(Ur))}catch{return mt(null)}},ze=E()(()=>({showing:!1,seen:!1,all:new Map,lay:typeof localStorage>"u"?mt(null):ma(),pick:null})),ga=ze.setState;var ya=j(H(),1);var Wr=j(H(),1);var wa=j(H(),1);var Jy=sr();var Fr=E()(()=>({open:!1,newTask:()=>{}}));var Ke=()=>!1,ka=(e)=>Ke()?void(location.href=e):pe(e);function xa(e){if(!Ke())return void ka("/?view=board");zr(void 0,e)}var gt=Fr;function Zt(){if(Ke())return Gr();ht().then((e)=>{gt=e.useSearch,Gr()},()=>pe("/?view=board&search=1"))}function Gr(){gt.setState({open:!0,newTask:xa})}var qr=()=>gt.getState().open?gt.setState({open:!1}):Zt();function Vr(e){Ke=()=>e,Te.search=Zt;let t=/Mac|iP(hone|ad)/.test(navigator.platform),r;if(Ke()&&new URLSearchParams(location.search).get("search")==="1"){let o=new URLSearchParams(location.search);o.delete("search"),history.replaceState(null,"",location.pathname+(o.toString()?"?"+o:"")+location.hash),r=setTimeout(Zt,400)}let a=(o)=>{if(o.ctrlKey&&o.shiftKey&&o.code==="Space")return o.preventDefault(),o.stopPropagation(),void qr();if(o.target?.closest?.(".xterm"))return;let i=t?o.metaKey:o.ctrlKey,p=o.key.toLowerCase();if(i&&!o.altKey&&(p==="k"&&!o.shiftKey||t&&p==="j"&&!o.shiftKey))o.preventDefault(),o.stopPropagation(),qr()};return addEventListener("keydown",a,!0),()=>(clearTimeout(r),removeEventListener("keydown",a,!0))}var Yr=()=>document.documentElement.hasAttribute("data-kit");var Jr=()=>window.kzKit?Promise.resolve(window.kzKit):Promise.reject(Error("this page has no kit"));var Ce=!1;async function ht(){let e=await Jr();return e.setHost({gitProjects:Tr,wsHref:Ie,navigate:pe,pickProject:async(t)=>{await fetch("/cd",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dir:t})}).catch(()=>null);try{localStorage.setItem("kz-proj",t)}catch{}pe("/notebook?dir="+encodeURIComponent(t))}}),e}function Sa(e){if(Ce)return Se(e);let t=new URLSearchParams({view:"board",add:e.start??"1"});if(e.dir)t.set("adddir",e.dir);ht().then((r)=>r.openAdd(e),()=>pe("/?"+t))}function Ta(){let e=new URLSearchParams(location.search),t=e.get("add");if(!t||!Ce)return;let r=e.get("adddir");return e.delete("add"),e.delete("adddir"),history.replaceState(null,"",location.pathname+(e.toString()?"?"+e:"")+location.hash),setTimeout(()=>Se({dir:r,...t==="ws"||t==="folder"||t==="clone"||t==="create"?{start:t}:{}}),400)}var Ea=()=>document.getAnimations().forEach((e)=>{if(e.animationName?.startsWith("si-")&&e.startTime!==0)e.startTime=0});function Xr(e={}){Ce=!!e.board;let t=Vr(Ce),r=!1,a=(f)=>f.nodeType===1&&(f.classList.contains("si")||f.querySelector(".si")),o=new MutationObserver((f)=>{if(r||!f.some((b)=>[...b.addedNodes].some(a)))return;r=!0,requestAnimationFrame(()=>{r=!1,Ea()})});o.observe(document.body,{childList:!0,subtree:!0});let i=kr(Ce);if(!Ce&&Yr())ht().catch(()=>{});let p=Ta();if(e.video){if(e.video.add)e.video.add.onclick=Te.add;if(e.video.search)e.video.search.onclick=(f)=>(f.preventDefault(),Te.search())}return()=>(o.disconnect(),i(),t(),clearTimeout(p))}Te.add=()=>{let e=new URLSearchParams(location.search);Sa({dir:["run","ws"].includes(e.get("view")??"")?e.get("dir"):Ra()})};function Ra(){try{let e=JSON.parse(localStorage.getItem("kz-rail-filter2")||"{}").dirs;return Array.isArray(e)&&e.length===1?e[0]:null}catch{return null}}var We={TikTok:"9x16","Instagram Reels":"9x16","YouTube Shorts":"9x16","WhatsApp Status":"9x16",YouTube:"16x9","Instagram feed":"4x5"},nn={"9x16":[1080,1920],"16x9":[1920,1080],"4x5":[1080,1350]},xt=["#b4462f","#a8720a","#2d50a5","#0f8fa3","#1f9d55","#7a4fb5","#c2416b","#5b6b8c"],k=(e)=>document.getElementById(e),m=(e)=>String(e??"").replace(/[&<>"']/g,(t)=>`&#${t.charCodeAt(0)};`),W=(e)=>e==null?"":`${Math.floor(e/60)}:${String(Math.round(e%60)).padStart(2,"0")}`,Me=(e)=>(e??"9x16").replace("x",":"),Q=(e,t)=>`/video/f/${e.place}/${encodeURIComponent(e.name)}/${t.split("/").map(encodeURIComponent).join("/")}`,rn={draft:"Draft",queued:"Queued",building:"Building preview",rendering:"Rendering",ready:"Ready",failed:"Failed"},Fe=[],on=[],sn=[],no=(e,t)=>on.filter((r)=>r.place===e&&r.name===t).sort((r,a)=>a.at-r.at)[0],me="",Qr;function D(e){let t=k("toast");t.textContent=e,t.classList.add("on"),clearTimeout(Qr),Qr=setTimeout(()=>t.classList.remove("on"),3200)}async function Y(e,t){let r=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.error||a.why||`${r.status}`);return a}async function ae(){let e;try{e=await fetch("/video/list")}catch{D("The board is not running");return}let t=await e.json();if(Fe=t.videos,on=t.agents??[],sn=t.places,k("emptyhow").innerHTML=`Videos are folders under <code>videos/</code> in ${t.places.map((r)=>`<code>${m(r.dir)}</code>`).join(" or ")}. Ask the kaizen-video skill to make one, and it shows up here.`,an(),K)ro(),uo();mn()}function $a(){return Fe.flatMap((e)=>{let t=e.outputs.filter((o)=>o.kind!=="history"&&o.kind!=="trying"),r=t.length?t:[null],a=new Map;for(let o of r)if(!a.has(o?.format??e.formats[0]))a.set(o?.format??e.formats[0],o);return[...a].map(([o,i])=>({v:e,f:o,o:i}))})}function an(){let e=k("q").value.trim().toLowerCase().split(/\s+/).filter(Boolean),t=$a(),r=t.filter(({v:o})=>{let i=[o.title,o.name,o.text,o.preset,o.where,o.mode,...o.platforms].join(" ").toLowerCase();return(me==="busy"?["queued","building","rendering"].includes(o.status):!me||o.status===me)&&e.every((f)=>i.includes(f))}),a=on.filter((o)=>o.alive&&!Fe.some((i)=>i.place===o.place&&i.name===o.name)&&e.every((i)=>o.name.includes(i))&&(!me||me==="busy"||me==="draft"));k("grid").removeAttribute("aria-busy"),k("grid").innerHTML=a.map((o)=>`<article class="vid" tabindex="0" data-p="${o.place}" data-n="${m(o.name)}" aria-label="${m(o.name)}, being made">
18
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),c}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var f=B(),b={d:{f:e,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:e,C:e,L:e,m:e,X:e,S:e,M:e},p:0,findDOMNode:null},R=Symbol.for("react.portal"),O=Symbol.for("react.recoverable"),L=Symbol.for("react.optimistic_key"),h=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map==="function"&&Map.prototype!=null&&typeof Map.prototype.forEach==="function"&&typeof Set==="function"&&Set.prototype!=null&&typeof Set.prototype.clear==="function"&&typeof Set.prototype.forEach==="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),z.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=b,z.browser=function(c){return{$$typeof:O,_reason:c}},z.createPortal=function(c,l){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error("Target container is not a DOM element.");return r(c,l,null,x)},z.flushSync=function(c){var l=h.T,x=b.p;try{if(h.T=null,b.p=2,c)return c()}finally{h.T=l,b.p=x,b.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},z.preconnect=function(c,l){typeof c==="string"&&c?l!=null&&typeof l!=="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",i(l)):l!=null&&typeof l.crossOrigin!=="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",o(l.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c)),typeof c==="string"&&(l?(l=l.crossOrigin,l=typeof l==="string"?l==="use-credentials"?l:"":void 0):l=null,b.d.C(c,l))},z.prefetchDNS=function(c){if(typeof c!=="string"||!c)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c));else if(1<arguments.length){var l=arguments[1];typeof l==="object"&&l.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(l)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",i(l))}typeof c==="string"&&b.d.D(c)},z.preinit=function(c,l){if(typeof c==="string"&&c?l==null||typeof l!=="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",i(l)):l.as!=="style"&&l.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',i(l.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",o(c)),typeof c==="string"&&l&&typeof l.as==="string"){var x=l.as,T=a(x,l.crossOrigin),_=typeof l.integrity==="string"?l.integrity:void 0,Z=typeof l.fetchPriority==="string"?l.fetchPriority:void 0;x==="style"?b.d.S(c,typeof l.precedence==="string"?l.precedence:void 0,{crossOrigin:T,integrity:_,fetchPriority:Z}):x==="script"&&b.d.X(c,{crossOrigin:T,integrity:_,fetchPriority:Z,nonce:typeof l.nonce==="string"?l.nonce:void 0})}},z.preinitModule=function(c,l){var x="";if(typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l!==void 0&&typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":l&&("as"in l)&&l.as!=="script"&&(x+=" The `as` option encountered was "+i(l.as)+"."),x)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",x);else switch(x=l&&typeof l.as==="string"?l.as:"script",x){case"script":break;default:x=i(x),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',x,c)}if(typeof c==="string")if(typeof l==="object"&&l!==null){if(l.as==null||l.as==="script")x=a(l.as,l.crossOrigin),b.d.M(c,{crossOrigin:x,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0})}else l==null&&b.d.M(c)},z.preload=function(c,l){var x="";if(typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l==null||typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":typeof l.as==="string"&&l.as||(x+=" The `as` option encountered was "+o(l.as)+"."),x&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',x),typeof c==="string"&&typeof l==="object"&&l!==null&&typeof l.as==="string"){x=l.as;var T=a(x,l.crossOrigin);b.d.L(c,x,{crossOrigin:T,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,type:typeof l.type==="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy==="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet==="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes==="string"?l.imageSizes:void 0,media:typeof l.media==="string"?l.media:void 0})}},z.preloadModule=function(c,l){var x="";typeof c==="string"&&c||(x+=" The `href` argument encountered was "+o(c)+"."),l!==void 0&&typeof l!=="object"?x+=" The `options` argument encountered was "+o(l)+".":l&&("as"in l)&&typeof l.as!=="string"&&(x+=" The `as` option encountered was "+o(l.as)+"."),x&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',x),typeof c==="string"&&(l?(x=a(l.as,l.crossOrigin),b.d.m(c,{as:typeof l.as==="string"&&l.as!=="script"?l.as:void 0,crossOrigin:x,integrity:typeof l.integrity==="string"?l.integrity:void 0,nonce:typeof l.nonce==="string"?l.nonce:void 0,fetchPriority:typeof l.fetchPriority==="string"?l.fetchPriority:void 0})):b.d.m(c))},z.requestFormReset=function(c){b.d.r(c)},z.unstable_batchedUpdates=function(c,l){return c(l)},z.useFormState=function(c,l,x){return p().useFormState(c,l,x)},z.useFormStatus=function(){return p().useHostTransitionStatus()},z.version="19.3.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var Ne=et(function(Oo,Zn){Zn.exports=Qn()});var Un=(e)=>{let t,r=new Set,a=(R,O)=>{let L=typeof R==="function"?R(t):R;if(!Object.is(L,t)){let h=t;t=(O!=null?O:typeof L!=="object"||L===null)?L:Object.assign({},t,L),r.forEach((c)=>c(t,h))}},o=()=>t,f={setState:a,getState:o,getInitialState:()=>b,subscribe:(R)=>(r.add(R),()=>r.delete(R))},b=t=e(a,o,f);return f},Wn=(e)=>e?Un(e):Un;var nt=j(B(),1);var Co=(e)=>e;function Mo(e,t=Co){let r=nt.default.useSyncExternalStore(e.subscribe,nt.default.useCallback(()=>t(e.getState()),[e,t]),()=>t(e.getInitialState()));return nt.default.useDebugValue(r),r}var qn=(e)=>{let t=Wn(e),r=(a)=>Mo(t,a);return Object.assign(r,t),r},E=(e)=>e?qn(e):qn;var te=E()(()=>({state:{project:null,projects:[],cards:[],now:Date.now(),all:!1,dir:null},loaded:!1,all:typeof location>"u"?!0:new URLSearchParams(location.search).get("all")!=="0",dir:null,every:null,tasks:null,sources:null,shells:[],changed:0})),{getState:F,setState:ue}=te,ve=(e,t)=>te.subscribe((r,a)=>e(r)!==e(a)?t(e(r),e(a)):void 0);var Vn=2000,Yn=2000,Jn=30000,Xn=(e)=>e.replace(/"now":\d+\}$/,"");var ke=j(B(),1),Po=j(Ne(),1);function Ao(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}var Va=Array(12).fill(0);var Lo=1,No=100,er=(e)=>{var t;return typeof(e==null?void 0:e.id)==="number"||(e==null?void 0:(t=e.id)==null?void 0:t.length)>0?e.id:Lo++};class tr{constructor(){this.subscribe=(e)=>(this.subscribers.push(e),this.getActiveToasts().forEach((t)=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=(e)=>{this.subscribers.forEach((t)=>t(e))},this.addToast=(e)=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-No;if(e<=0)return;this.toasts=this.toasts.filter((t)=>{if(e>0&&this.dismissedToasts.has(t.id))return this.dismissedToasts.delete(t.id),e--,!1;return!0})},this.create=(e)=>{let{message:t,...r}=e,a=er(e),o=this.pendingDismissals.get(a);if(o!==void 0)cancelAnimationFrame(o),this.pendingDismissals.delete(a),this.dismissedToasts.delete(a);let i=this.dismissedToasts.has(a),p=e.dismissible===void 0?!0:e.dismissible;if(i)this.dismissedToasts.delete(a),this.toasts=this.toasts.filter((b)=>b.id!==a);if(i?void 0:this.toasts.find((b)=>b.id===a))this.toasts=this.toasts.map((b)=>{if(b.id===a)return this.publish({...b,...e,id:a,title:t}),{...b,...e,id:a,dismissible:p,title:t};return b});else this.addToast({title:t,...r,dismissible:p,id:a});return a},this.dismiss=(e)=>{if(e===void 0||e===null)return this.getActiveToasts().forEach((r)=>{this.dismissedToasts.add(r.id),this.subscribers.forEach((a)=>a({id:r.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);if(t!==void 0)cancelAnimationFrame(t);return this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach((r)=>r({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r=void 0;if(t.loading!==void 0)r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!=="function"?t.description:void 0});let a=Promise.resolve(e instanceof Function?e():e),o=r!==void 0,i,p=a.then(async(b)=>{if(i=["resolve",b],ke.default.isValidElement(b))o=!1,this.create({id:r,type:"default",message:b});else if(_o(b)&&!b.ok){o=!1;let O=typeof t.error==="function"?await t.error(`HTTP error! status: ${b.status}`):t.error,L=typeof t.description==="function"?await t.description(`HTTP error! status: ${b.status}`):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"error",description:L,...c})}else if(b instanceof Error){o=!1;let O=typeof t.error==="function"?await t.error(b):t.error,L=typeof t.description==="function"?await t.description(b):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"error",description:L,...c})}else if(t.success!==void 0){o=!1;let O=typeof t.success==="function"?await t.success(b):t.success,L=typeof t.description==="function"?await t.description(b):t.description,c=typeof O==="object"&&!ke.default.isValidElement(O)?O:{message:O};this.create({id:r,type:"success",description:L,...c})}}).catch(async(b)=>{if(i=["reject",b],t.error!==void 0){o=!1;let R=typeof t.error==="function"?await t.error(b):t.error,O=typeof t.description==="function"?await t.description(b):t.description,h=typeof R==="object"&&!ke.default.isValidElement(R)?R:{message:R};this.create({id:r,type:"error",description:O,...h})}}).finally(()=>{if(o)this.dismiss(r),r=void 0;t.finally==null||t.finally.call(t)}),f=()=>new Promise((b,R)=>p.then(()=>i[0]==="reject"?R(i[1]):b(i[1])).catch(R));if(typeof r!=="string"&&typeof r!=="number")return{unwrap:f};else return Object.assign(r,{unwrap:f})},this.custom=(e,t)=>{let r=er(t);return this.create({...t,jsx:e(r),id:r,type:void 0}),r},this.getActiveToasts=()=>this.toasts.filter((e)=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}}var V=new tr,Do=(e,t)=>V.message(e,t),_o=(e)=>e&&typeof e==="object"&&("ok"in e)&&typeof e.ok==="boolean"&&("status"in e)&&typeof e.status==="number",Io=Do,jo=()=>V.toasts,Bo=()=>V.getActiveToasts(),Ho=Object.assign(Io,{success:V.success,info:V.info,warning:V.warning,error:V.error,custom:V.custom,message:V.message,promise:V.promise,dismiss:V.dismiss,loading:V.loading},{getHistory:jo,getToasts:Bo});Ao("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");var ni=E()(()=>({open:null}));var zo=[];function pe(e){Promise.allSettled(zo.map((t)=>t())).then(()=>location.href=e)}var ne=()=>matchMedia("(max-width:640px)").matches;function sr(){let e=new Map,t=new Map;return(r,a,o,i)=>{let p=e.get(r);if(e.set(r,a),p&&a!==p)t.set(r,i);return p!==void 0&&!!a&&a!==p&&!(o&&i-(t.get(r)??-1/0)<60000)}}var ar=E()(()=>({tasks:[],tasksLoaded:!1,tasksError:"",filter:"all",query:"",scope:"",taskId:"",taskDir:"",page:null,pageError:"",pending:!1,receipt:"",draft:""})),{getState:Si,setState:Ti}=ar;var ir=j(B(),1);var Ko=["Adara","Alya","Bellatrix","Beryllium","Cobalt","Fluorine","Krypton","Palladium","Rubidium","Xenon"],Oi=["off",...Ko,"chime","bell","pop"];var Bt;addEventListener("pointerdown",()=>{try{Bt=Bt||new AudioContext,Bt.resume()}catch(e){}},{once:!0});var Uo=["settings","sources","terminal","board","tasks","task","run","chat","device"];function lr(e,t){let r=e==="icebox"?"sources":e==="ws"?"run":e==="ideas"?"tasks":e??"";if(!Uo.includes(r))r="home";if(t?r==="board"||r==="sources":r==="chat"||r==="device")r="home";return r}var Wo=(e,t)=>lr(new URLSearchParams(e).get("view"),t),cr=(e,t,r)=>r?"board":Wo(e,t);var dr=(e,t)=>e==="task"?t?"device":"tasks":e==="run"&&t?"device":e,Fo={sources:"Icebox",tasks:"Tasks",task:"Task",run:"Run",terminal:"Terminal",chat:"Chat",device:"Tasks"},ur=(e,t)=>e==="home"?t?"kaizen":"Chat":Fo[e]??"Board",pr=(e,t)=>e==="tasks"?"tasks":e==="task"?"task":e==="sources"?"icebox":e==="home"&&!t||e==="chat"?"home":"",fr=(e)=>e==="tasks"?"tasks":e==="task"?"task":e==="sources"?"icebox":"";function mr(e){let t=new URLSearchParams(e);if(t.get("view")!=="run"&&t.get("view")!=="ws")return null;let r=t.get("dir");if(!r)return null;return{dir:r,...t.get("ws")?{ws:t.get("ws")}:{},...t.get("id")?{id:t.get("id")}:{},...t.get("idea")!==null?{idea:t.get("idea")}:{}}}var Vo=j(Ne(),1);var Yo=(e,t)=>({view:e,lit:dr(e,t),title:ur(e,t),mark:e==="home"&&t,page:fr(e)}),Jo=(e,t,r)=>{let a=pr(t,r);return a&&!e.includes(a)?[...e,a]:e},Xo=()=>{let e=typeof location>"u"?"":location.search,t=typeof matchMedia>"u"?!1:ne(),r=cr(e,t,typeof document<"u"&&document.documentElement.hasAttribute("data-kit"));return{...Yo(r,t),seen:Jo([],r,t),search:e,run:mr(e),menu:!1,visit:0}},rt=E()(Xo),ot=rt.getState;var Qo=j(B(),1);var Zo=(e)=>({cards:e.cards,projects:[...e.projects,...e.rail??[]],agents:e.agents??[]}),Kt=0;function es(e,t={}){Kt++,ue({every:e,...t})}var gr="",Ht=!1,st=!1,hr=0,yr;async function De(){if(Ht){st=!0;return}let e=hr+Vn-Date.now();if(e>0){yr??=setTimeout(()=>{yr=void 0,De()},e);return}hr=Date.now(),Ht=!0;do{st=!1;let t=Kt;try{let r=await fetch("/state?all=1");if(!r.ok)continue;let a=await r.text(),o=Xn(a);if(o===gr)continue;if(!st&&t===Kt){gr=o;let i=JSON.parse(a);es(Zo(i))}}catch{}}while(st);Ht=!1}var br=0,zt=!1;async function wr(){if(zt||Date.now()-br<Yn)return;zt=!0,br=Date.now();try{let e=await fetch("/tasks?all=1");if(e.ok)ue({tasks:(await e.json()).tasks??[]})}catch{}finally{zt=!1}}var vr=0;async function ts(e=!1){if(!e&&Date.now()-vr<Jn)return;vr=Date.now();try{let t=await fetch("/sources");if(t.ok)ue({sources:await t.json()})}catch{}}async function kr(){try{return ue({shells:await(await fetch("/shells")).json()}),!0}catch{return!1}}function xr(e=!1){return wr(),ve((t)=>t.every,()=>{if(ts(),wr(),e)kr()})}var ns=j(B(),1);var rs={cards:[],projects:[],agents:[],tasks:null};var xe=()=>{let{every:e,tasks:t}=te.getState();return e?{...e,tasks:t}:{...rs,tasks:t}};var ss=E()(()=>({open:null})),as=0,Se=(e={})=>ss.setState({open:{...e,n:++as}});var is=new Map,ls=(e)=>e.key+"@"+(e.born??0);var Sr=(e,t=is)=>{let r=new Set(e.map(ls));for(let a of t.keys())if(!r.has(a))t.delete(a)};var Tr={dirs:[],running:!0,done:!1};var _e=(e,t)=>{let r=t?.find((a)=>a.dir===e)?.label||e.replace(/[\\/]\.kaizen$/,"");return r.split(/[\\/]/).pop()||r};var at=(e,t)=>{try{return JSON.parse(localStorage.getItem(e)||"null")??t}catch{return t}};ve((e)=>e.every,(e)=>e&&Sr(e.agents));var it={filt:"kz-rail-filter2",folded:"kz-rail-folded",pins:"kz-ws-pins",open:"kz-wsopen"},ds=E()(()=>({filt:{...Tr,...at(it.filt,{})},folded:at(it.folded,[]),pins:at(it.pins,[]),open:at(it.open,{}),q:"",tick:0}));var fs=(e)=>typeof e==="string"&&/[\\/]\.kaizen[\\/]home$/.test(e),Ie=(e,t)=>fs(e)?"/?view=board&homews=1":`/?view=ws&dir=${encodeURIComponent(e)}&ws=${encodeURIComponent(t)}`,Er=()=>xe().projects.filter((e)=>e.workspaces?.some((t)=>t.branch)).map((e)=>({dir:e.dir,name:_e(e.dir,xe().projects)}));var ms=j(B(),1);var gs=E()(()=>({shown:(()=>{try{return JSON.parse(localStorage.getItem("kz-show")??"null")||[]}catch{return[]}})()}));var ec=E()(()=>({at:null}));var sc=typeof location<"u"&&new URLSearchParams(location.search).has("all");var Te={add:()=>{},search:()=>{}};var Ut=j(B(),1);var $r=E()(()=>({dark:!1,min:!1,setup:null,openSetup:null,look:0})),{getState:ys,setState:bs}=$r;var Vc=E()(()=>({on:!1}));var ws=j(B(),1);var vs=j(B(),1),nd=typeof matchMedia==="function"?matchMedia("(max-width:640px)"):null;var ks=j(B(),1);var Cr=(e,t,r)=>{try{return JSON.parse(e().getItem(t)??"null")??r}catch{return r}},Wt=E()(()=>({snap:null,tab:(()=>{try{return localStorage.getItem("kz-ideas-tab")==="backlog"?"backlog":"ideas"}catch{return"ideas"}})(),sev:null,order:Cr(()=>localStorage,"kz-order",{}),picking:!1,picked:[],unfolded:[],kidsOpen:[],form:(()=>{let e=Cr(()=>sessionStorage,"kz-form",null);return e?{mode:e[0],key:e[1]??void 0}:null})(),popup:null,filter:null,query:(()=>{try{return sessionStorage.getItem("kz-d:bq")??""}catch{return""}})(),archive:!1,mode:(()=>{try{return localStorage.getItem("kz-board-mode")==="runs"?"runs":"ws"}catch{return"ws"}})(),flash:[],names:{}})),{getState:Be,setState:Ee}=Wt,xs=(e)=>{Ee({form:e});try{sessionStorage.setItem("kz-form",JSON.stringify(e&&["new","edit","reject"].includes(e.mode)?[e.mode,e.key??null]:null))}catch{}};var Mr=()=>Be().form?.mode==="new"&&xs(null);var Ss="kz-runtabs";function Ts(e){let t=Array.isArray(e.screens)&&e.screens.every((o)=>o?.tree)?e.screens:[],{split:r,...a}=e;return{...a,tabs:(e.tabs??[]).filter((o)=>o&&o.kind!=="run"),hidden:(e.hidden??[]).filter((o)=>typeof o==="string"&&!o.startsWith("rn:")),screens:t,on:e.on??null}}function Es(e){try{let t=JSON.parse(e||"{}");return Object.fromEntries(Object.entries(t).filter(([,r])=>r&&typeof r==="object").map(([r,a])=>[r,Ts(a)]))}catch{return{}}}var Rs=()=>{try{return Es(localStorage.getItem(Ss))}catch{return{}}};var Ft=E()(()=>({all:Rs(),dragging:null,target:null,browse:null,previewTick:0})),Sd=Ft.setState;var $s="kz-sent",He=E()(()=>({body:"",term:null,terms:[],head:null,tabs:[],tab:"",wantTab:"request",ptabs:[],runDoc:null,footer:null,doc:null,fix:null,off:[],open:!1,docked:!1,wide:!1,parked:!1,pn:!1,ro:!1,instant:!1,title:"",titleTip:"",top:0,openKey:null,card:null,openN:0,fetchAsk:0,drawAsk:0,keepNext:!1,hit:null,wantTerm:null,wantPty:null,sent:(()=>{try{return JSON.parse(sessionStorage.getItem($s)??"[]")||[]}catch{return[]}})()})),{getState:re,setState:oe}=He;var Cs="kz-rflip";function Ms(){try{return!ne()&&localStorage.getItem(Cs)==="1"}catch{return!1}}var Ar=E()(()=>({message:null,screens:[],on:null,split:!1,agents:[],defAgent:"",pty:!0,titles:{},items:[],wsk:null,ws:null,history:[],empty:!1,menu:null,hint:!1,notes:null,picker:null,kept:{},recent:[],flip:Ms(),awaiting:!1,focus:{id:null,n:0}}));var ct=Ar.setState;var Ld=E()(()=>({file:null}));var iu=E()(()=>({st:{}}));var Nr=E()(()=>({snap:null,ui:{},busy:null,busyRun:null,confirm:null}));var{getState:Ds,setState:Dr}=Nr;var _r=E()(()=>({ctx:null,card:null,shells:[],agents:[],defAgent:"",noPty:!1,elsewhere:[],selectTerm:null})),{getState:ut,setState:Yt}=_r;var Qt=j(B(),1);var Hr=E()(()=>({view:null,files:{},refocus:null})),{getState:la,setState:zr}=Hr;var Mm=" "+String.fromCharCode(10);var da=j(B(),1);function Kr(e,t){let r=e&&"dir"in e?e:null;Mr(),Ee({popup:{kind:"new",dir:r?.dir??null,choose:!!r,text:t}})}var fa=j(Ne(),1);var Jg=E()(()=>({sheet:null}));var ph=E()(()=>({mode:null,net:{self:null,computers:[],tailscale:!1},usage:[],allDevices:!1}));var ft=j(B(),1);var ka=j(Ne(),1);var ma=[["grid","Grid","lgrid"],["cols","Side by side","lcols"],["rows","Stacked","lrows"]],Wr="kz-terms";var Ur={mode:"grid",order:[],hidden:[],max:null,sizes:{}};function mt(e){try{let t={...Ur,...JSON.parse(e||"{}")};return ma.some((r)=>r[0]===t.mode)?t:{...t,mode:"grid"}}catch{return Ur}}var ga=()=>{try{return mt(localStorage.getItem(Wr))}catch{return mt(null)}},ze=E()(()=>({showing:!1,seen:!1,all:new Map,lay:typeof localStorage>"u"?mt(null):ga(),pick:null})),ha=ze.setState;var ba=j(B(),1);var Fr=j(B(),1);var va=j(B(),1);var eb=sr();var Gr=E()(()=>({open:!1,newTask:()=>{}}));var Ke=()=>!1,xa=(e)=>Ke()?void(location.href=e):pe(e);function Sa(e){if(!Ke())return void xa("/?view=board");Kr(void 0,e)}var gt=Gr;function Zt(){if(Ke())return qr();ht().then((e)=>{gt=e.useSearch,qr()},()=>pe("/?view=board&search=1"))}function qr(){gt.setState({open:!0,newTask:Sa})}var Vr=()=>gt.getState().open?gt.setState({open:!1}):Zt();function Yr(e){Ke=()=>e,Te.search=Zt;let t=/Mac|iP(hone|ad)/.test(navigator.platform),r;if(Ke()&&new URLSearchParams(location.search).get("search")==="1"){let o=new URLSearchParams(location.search);o.delete("search"),history.replaceState(null,"",location.pathname+(o.toString()?"?"+o:"")+location.hash),r=setTimeout(Zt,400)}let a=(o)=>{if(o.ctrlKey&&o.shiftKey&&o.code==="Space")return o.preventDefault(),o.stopPropagation(),void Vr();if(o.target?.closest?.(".xterm"))return;let i=t?o.metaKey:o.ctrlKey,p=o.key.toLowerCase();if(i&&!o.altKey&&(p==="k"&&!o.shiftKey||t&&p==="j"&&!o.shiftKey))o.preventDefault(),o.stopPropagation(),Vr()};return addEventListener("keydown",a,!0),()=>(clearTimeout(r),removeEventListener("keydown",a,!0))}var Jr=()=>document.documentElement.hasAttribute("data-kit");var Xr=()=>window.kzKit?Promise.resolve(window.kzKit):Promise.reject(Error("this page has no kit"));var Ce=!1;async function ht(){let e=await Xr();return e.setHost({gitProjects:Er,wsHref:Ie,navigate:pe,pickProject:async(t)=>{await fetch("/cd",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({dir:t})}).catch(()=>null);try{localStorage.setItem("kz-proj",t)}catch{}pe("/notebook?dir="+encodeURIComponent(t))}}),e}function Ta(e){if(Ce)return Se(e);let t=new URLSearchParams({view:"board",add:e.start??"1"});if(e.dir)t.set("adddir",e.dir);ht().then((r)=>r.openAdd(e),()=>pe("/?"+t))}function Ea(){let e=new URLSearchParams(location.search),t=e.get("add");if(!t||!Ce)return;let r=e.get("adddir");return e.delete("add"),e.delete("adddir"),history.replaceState(null,"",location.pathname+(e.toString()?"?"+e:"")+location.hash),setTimeout(()=>Se({dir:r,...t==="ws"||t==="folder"||t==="clone"||t==="create"?{start:t}:{}}),400)}var Ra=()=>document.getAnimations().forEach((e)=>{if(e.animationName?.startsWith("si-")&&e.startTime!==0)e.startTime=0});function Qr(e={}){Ce=!!e.board;let t=Yr(Ce),r=!1,a=(f)=>f.nodeType===1&&(f.classList.contains("si")||f.querySelector(".si")),o=new MutationObserver((f)=>{if(r||!f.some((b)=>[...b.addedNodes].some(a)))return;r=!0,requestAnimationFrame(()=>{r=!1,Ra()})});o.observe(document.body,{childList:!0,subtree:!0});let i=xr(Ce);if(!Ce&&Jr())ht().catch(()=>{});let p=Ea();if(e.video){if(e.video.add)e.video.add.onclick=Te.add;if(e.video.search)e.video.search.onclick=(f)=>(f.preventDefault(),Te.search())}return()=>(o.disconnect(),i(),t(),clearTimeout(p))}Te.add=()=>{let e=new URLSearchParams(location.search);Ta({dir:["run","ws"].includes(e.get("view")??"")?e.get("dir"):$a()})};function $a(){try{let e=JSON.parse(localStorage.getItem("kz-rail-filter2")||"{}").dirs;return Array.isArray(e)&&e.length===1?e[0]:null}catch{return null}}var We={TikTok:"9x16","Instagram Reels":"9x16","YouTube Shorts":"9x16","WhatsApp Status":"9x16",YouTube:"16x9","Instagram feed":"4x5"},nn={"9x16":[1080,1920],"16x9":[1920,1080],"4x5":[1080,1350]},xt=["#b4462f","#a8720a","#2d50a5","#0f8fa3","#1f9d55","#7a4fb5","#c2416b","#5b6b8c"],k=(e)=>document.getElementById(e),m=(e)=>String(e??"").replace(/[&<>"']/g,(t)=>`&#${t.charCodeAt(0)};`),W=(e)=>e==null?"":`${Math.floor(e/60)}:${String(Math.round(e%60)).padStart(2,"0")}`,Me=(e)=>(e??"9x16").replace("x",":"),Q=(e,t)=>`/video/f/${e.place}/${encodeURIComponent(e.name)}/${t.split("/").map(encodeURIComponent).join("/")}`,rn={draft:"Draft",queued:"Queued",building:"Building preview",rendering:"Rendering",ready:"Ready",failed:"Failed"},Fe=[],on=[],sn=[],ro=(e,t)=>on.filter((r)=>r.place===e&&r.name===t).sort((r,a)=>a.at-r.at)[0],me="",Zr;function D(e){let t=k("toast");t.textContent=e,t.classList.add("on"),clearTimeout(Zr),Zr=setTimeout(()=>t.classList.remove("on"),3200)}async function Y(e,t){let r=await fetch(e,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.error||a.why||`${r.status}`);return a}async function ie(){let e;try{e=await fetch("/video/list")}catch{D("The board is not running");return}let t=await e.json();if(Fe=t.videos,on=t.agents??[],sn=t.places,k("emptyhow").innerHTML=`Videos are folders under <code>videos/</code> in ${t.places.map((r)=>`<code>${m(r.dir)}</code>`).join(" or ")}. Ask the kaizen-video skill to make one, and it shows up here.`,an(),K)oo(),po();mn()}function Ca(){return Fe.flatMap((e)=>{let t=e.outputs.filter((o)=>o.kind!=="history"&&o.kind!=="trying"),r=t.length?t:[null],a=new Map;for(let o of r)if(!a.has(o?.format??e.formats[0]))a.set(o?.format??e.formats[0],o);return[...a].map(([o,i])=>({v:e,f:o,o:i}))})}function an(){let e=k("q").value.trim().toLowerCase().split(/\s+/).filter(Boolean),t=Ca(),r=t.filter(({v:o})=>{let i=[o.title,o.name,o.text,o.preset,o.where,o.mode,...o.platforms].join(" ").toLowerCase();return(me==="busy"?["queued","building","rendering"].includes(o.status):!me||o.status===me)&&e.every((f)=>i.includes(f))}),a=on.filter((o)=>o.alive&&!Fe.some((i)=>i.place===o.place&&i.name===o.name)&&e.every((i)=>o.name.includes(i))&&(!me||me==="busy"||me==="draft"));k("grid").removeAttribute("aria-busy"),k("grid").innerHTML=a.map((o)=>`<article class="vid" tabindex="0" data-p="${o.place}" data-n="${m(o.name)}" aria-label="${m(o.name)}, being made">
19
19
  <div class="thumb making" style="--ar:9/16"><span class="t">${o.asking?"Claude is asking you something":"Claude is making this"}</span></div>
20
20
  <div class="meta"><b>${m(o.name)}</b><div class="plats"><i class="where">${m(sn[o.place]?.label??"")}</i></div>
21
21
  <span class="pill ${o.asking?"draft":"building"}">${o.asking?"Needs your answer":"Being made"}</span></div></article>`).join("")+r.map(({v:o,f:i,o:p})=>{let[f,b]=nn[i],R=p?.thumb?Q(o,p.thumb):o.poster?Q(o,o.poster):"",O=o.platforms.filter((c)=>We[c]===i),L=o.job&&(o.job.state==="running"||o.job.state==="queued"),h=L&&o.job.total?Math.round(o.job.step/o.job.total*100):0;return`<article class="vid" tabindex="0" data-p="${o.place}" data-n="${m(o.name)}" aria-label="${m(o.name)}, ${Me(i)}">
@@ -25,9 +25,9 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
25
25
  ${L?`<span class="bar" style="width:${Math.max(6,h)}%"></span>`:""}</div>
26
26
  <div class="meta"><b>${m(o.name)}</b>
27
27
  <div class="plats">${O.map((c)=>`<i>${m(c)}</i>`).join("")}<i class="where" title="Where it lives">${m(o.where)}</i></div>
28
- <span class="pill ${o.status}">${rn[o.status]}${o.preset?` · ${m(o.preset)}`:""}</span></div></article>`}).join(""),k("nores").hidden=!t.length||!!r.length||!!a.length,k("empty").hidden=!!t.length||!!a.length}k("grid").addEventListener("click",(e)=>{let t=e.target.closest(".vid");if(t)Ge(Number(t.dataset.p),t.dataset.n)});k("grid").addEventListener("keydown",(e)=>{let t=e.target.closest(".vid");if(t&&(e.key==="Enter"||e.key===" "))e.preventDefault(),Ge(Number(t.dataset.p),t.dataset.n)});k("q").addEventListener("input",an);k("fstat").addEventListener("click",(e)=>{let t=e.target.closest(".chip");if(!t)return;me=t.dataset.f;for(let r of k("fstat").querySelectorAll(".chip"))r.classList.toggle("on",r===t);an()});var K=null,U=null,de=new Map,J=new Set,se=0,St=!1,yt="";function Ge(e,t){let r=e==null?"":`#${e}/${encodeURIComponent(t)}`;if(location.hash!==r)history.pushState(null,"",r||location.pathname);$t()}function $t(){let e=location.hash.match(/^#(\d+)\/(.+)$/);K=e?{place:Number(e[1]),name:decodeURIComponent(e[2])}:null;let t=location.hash==="#new";if(k("lib").hidden=!!K||t,k("edit").hidden=!K,k("wiz").hidden=!t,U=null,de=new Map,X="form",N=null,y=null,k("sendp").innerHTML="",K&&!ye())Ue(),k("editbody").innerHTML=`<div class="edskel" aria-busy="true"><span class="skel" style="aspect-ratio:9/16"></span>
29
- <div style="display:grid;gap:10px"><span class="skel" style="height:36px;width:180px"></span><span class="skel" style="height:56px"></span><span class="skel" style="height:56px"></span><span class="skel" style="height:56px"></span></div></div>`;if(K)ro(!0);else Ue(),k("editbody").innerHTML="";if(t)gn();mn()}addEventListener("popstate",$t);var ye=()=>K&&Fe.find((e)=>e.place===K.place&&e.name===K.name);async function ro(e=!1){let t=ye();if(!t){Ue();let i=K&&no(K.place,K.name);if(i)k("editbody").innerHTML=`<div class="crumb"><button data-back>‹ Back to videos</button></div>
30
- <div class="ehead"><h2>${m(i.name)}</h2></div><p class="note">Claude is setting this video up. Answer its questions above; the editor opens here once the video has its storyboard.</p>`;else if(Fe.length)k("editbody").innerHTML='<p class="blank">That video is gone. <button class="btn" data-back>Back to videos</button></p>';return}let r=JSON.stringify([t.job&&[t.job.id,t.job.state,t.job.step],t.outputs.map((i)=>[i.file,i.kind]),t.builtAt,t.revising]);if(!e&&(U||t.mode!=="film")&&r===yt)return;let a=yt&&t.job?.state==="done"&&r!==yt;yt=r;let o=e||!k("edit").querySelector(".ed");if(t.mode==="film"){let i=await fetch(`/video/film?p=${t.place}&name=${encodeURIComponent(t.name)}`);if(!i.ok){Ue(),k("editbody").innerHTML=`<p class="blank">Could not read this film's film.json.</p>`;return}U=await i.json()}if(o)J=new Set(U?.platforms.length?U.platforms:t.platforms);if(o)Ca(t);else if(ao(t),cn(t),dn(t),a&&!N)oo(t)}function Ca(e){pn=!1;let t=U?.format??e.formats[0]??"9x16",[r,a]=e.size??nn[t],o=U?.beats??[];se=o.reduce((p,f)=>Math.max(p,f.start+(f.len??0)),0)||e.seconds||0;let i=Ue();if(k("editbody").innerHTML=`
28
+ <span class="pill ${o.status}">${rn[o.status]}${o.preset?` · ${m(o.preset)}`:""}</span></div></article>`}).join(""),k("nores").hidden=!t.length||!!r.length||!!a.length,k("empty").hidden=!!t.length||!!a.length}k("grid").addEventListener("click",(e)=>{let t=e.target.closest(".vid");if(t)Ge(Number(t.dataset.p),t.dataset.n)});k("grid").addEventListener("keydown",(e)=>{let t=e.target.closest(".vid");if(t&&(e.key==="Enter"||e.key===" "))e.preventDefault(),Ge(Number(t.dataset.p),t.dataset.n)});k("q").addEventListener("input",an);k("fstat").addEventListener("click",(e)=>{let t=e.target.closest(".chip");if(!t)return;me=t.dataset.f;for(let r of k("fstat").querySelectorAll(".chip"))r.classList.toggle("on",r===t);an()});var K=null,U=null,de=new Map,J=new Set,ae=0,St=!1,yt="";function Ge(e,t){let r=e==null?"":`#${e}/${encodeURIComponent(t)}`;if(location.hash!==r)history.pushState(null,"",r||location.pathname);$t()}function $t(){let e=location.hash.match(/^#(\d+)\/(.+)$/);K=e?{place:Number(e[1]),name:decodeURIComponent(e[2])}:null;let t=location.hash==="#new";if(k("lib").hidden=!!K||t,k("edit").hidden=!K,k("wiz").hidden=!t,U=null,de=new Map,X="form",N=null,y=null,k("sendp").innerHTML="",K&&!ye())Ue(),k("editbody").innerHTML=`<div class="edskel" aria-busy="true"><span class="skel" style="aspect-ratio:9/16"></span>
29
+ <div style="display:grid;gap:10px"><span class="skel" style="height:36px;width:180px"></span><span class="skel" style="height:56px"></span><span class="skel" style="height:56px"></span><span class="skel" style="height:56px"></span></div></div>`;if(K)oo(!0);else Ue(),k("editbody").innerHTML="";if(t)gn();mn()}addEventListener("popstate",$t);var ye=()=>K&&Fe.find((e)=>e.place===K.place&&e.name===K.name);async function oo(e=!1){let t=ye();if(!t){Ue();let i=K&&ro(K.place,K.name);if(i)k("editbody").innerHTML=`<div class="crumb"><button data-back>‹ Back to videos</button></div>
30
+ <div class="ehead"><h2>${m(i.name)}</h2></div><p class="note">Claude is setting this video up. Answer its questions above; the editor opens here once the video has its storyboard.</p>`;else if(Fe.length)k("editbody").innerHTML='<p class="blank">That video is gone. <button class="btn" data-back>Back to videos</button></p>';return}let r=JSON.stringify([t.job&&[t.job.id,t.job.state,t.job.step],t.outputs.map((i)=>[i.file,i.kind]),t.builtAt,t.revising]);if(!e&&(U||t.mode!=="film")&&r===yt)return;let a=yt&&t.job?.state==="done"&&r!==yt;yt=r;let o=e||!k("edit").querySelector(".ed");if(t.mode==="film"){let i=await fetch(`/video/film?p=${t.place}&name=${encodeURIComponent(t.name)}`);if(!i.ok){Ue(),k("editbody").innerHTML=`<p class="blank">Could not read this film's film.json.</p>`;return}U=await i.json()}if(o)J=new Set(U?.platforms.length?U.platforms:t.platforms);if(o)Ma(t);else if(io(t),cn(t),dn(t),a&&!N)so(t)}function Ma(e){pn=!1;let t=U?.format??e.formats[0]??"9x16",[r,a]=e.size??nn[t],o=U?.beats??[];ae=o.reduce((p,f)=>Math.max(p,f.start+(f.len??0)),0)||e.seconds||0;let i=Ue();if(k("editbody").innerHTML=`
31
31
  <div class="crumb"><button data-back>‹ Back to videos</button></div>
32
32
  <div class="ehead"><h2>${m(e.name)}</h2><span class="pill ${e.status}" id="stat">${rn[e.status]}</span>
33
33
  <div class="acts">${e.mode==="film"?'<button class="btn" id="stillsBtn" title="Build the film and take three still frames">Preview stills</button>':""}
@@ -35,7 +35,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
35
35
  <div class="ed">
36
36
  <div class="player">
37
37
  <div class="screen" style="--ar:${r}/${a}" id="screen">${e.built?`<iframe id="frame" title="Preview" src="${m(Q(e,"v/film/index.html"))}" width="${r}" height="${a}"></iframe>`:'<div class="none">No preview yet. Press <b>Preview stills</b> or save a change to build it.</div>'}</div>
38
- <div class="ctrl"><button class="play" id="play" aria-label="Play" ${e.built?"":"disabled"}><svg><use href="#i-play"/></svg></button><span id="time">0:00 / ${W(se)}</span><span class="sp"></span><span id="shape">${e.built?`Draft · ${m(e.preset)}`:`${Me(t)} · ${m(e.preset)}`}</span></div>
38
+ <div class="ctrl"><button class="play" id="play" aria-label="Play" ${e.built?"":"disabled"}><svg><use href="#i-play"/></svg></button><span id="time">0:00 / ${W(ae)}</span><span class="sp"></span><span id="shape">${e.built?`Draft · ${m(e.preset)}`:`${Me(t)} · ${m(e.preset)}`}</span></div>
39
39
  ${o.length?`<div class="strip" id="strip">${o.map((p,f)=>`<button style="flex:${Math.max(1,p.len??1)};--c:${xt[f%xt.length]}" data-b="${f}" title="${m(p.kind)} ${W(p.start)}">${f+1}</button>`).join("")}<span class="head" id="head" style="left:0"></span></div>`:""}
40
40
  <div class="stills" id="stills">${(U?.stills??[]).map((p)=>`<a href="${m(Q(e,p))}" target="_blank" rel="noopener"><img src="${m(Q(e,p))}?t=${Date.now()}" alt="Still frame"></a>`).join("")}</div>
41
41
  </div>
@@ -45,7 +45,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
45
45
  <div class="termpane" id="termpane" role="tabpanel" aria-labelledby="tab-term"><p class="note tnone">No Claude session for this video yet. Ask Claude for a change in the Form tab and it opens here.</p></div>
46
46
  <div class="beats" id="formpane" role="tabpanel" aria-labelledby="tab-form">
47
47
  <div id="job"></div>
48
- ${e.mode==="film"?o.map((p,f)=>Ma(p,f)).join(""):'<p class="note">A video made from your footage. Its words come from what you said; change them by asking the kaizen-video skill. Render it again here.</p>'}
48
+ ${e.mode==="film"?o.map((p,f)=>Oa(p,f)).join(""):'<p class="note">A video made from your footage. Its words come from what you said; change them by asking the kaizen-video skill. Render it again here.</p>'}
49
49
  <div class="savebar"><div class="chips" id="plats" role="group" aria-label="Where it goes">${Object.keys(We).map((p)=>`<button class="chip${J.has(p)?" on":""}" data-p="${m(p)}">${m(p)}</button>`).join("")}</div>
50
50
  ${e.mode==="film"?'<button class="btn pri" id="save">Save changes</button>':""}</div>
51
51
  <p class="note" id="platnote"></p>
@@ -54,21 +54,21 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
54
54
  <div class="files" id="files"></div>
55
55
  </div>
56
56
  </div>
57
- </div>`,k("termpane").append(i),fn(),ln(),so(),ao(e),cn(e),dn(e),N)vt(e)}function Ma(e,t){let r={...e,...de.get(t)},a=(p,f)=>typeof e[p]==="string"?`<label>${f}<input data-i="${t}" data-k="${p}" value="${m(r[p])}" maxlength="400"></label>`:"",o=Array.isArray(e.items)?`<label>List, one per line<textarea data-i="${t}" data-k="items">${m((r.items??[]).join(`
57
+ </div>`,k("termpane").append(i),fn(),ln(),ao(),io(e),cn(e),dn(e),N)vt(e)}function Oa(e,t){let r={...e,...de.get(t)},a=(p,f)=>typeof e[p]==="string"?`<label>${f}<input data-i="${t}" data-k="${p}" value="${m(r[p])}" maxlength="400"></label>`:"",o=Array.isArray(e.items)?`<label>List, one per line<textarea data-i="${t}" data-k="items">${m((r.items??[]).join(`
58
58
  `))}</textarea></label>`:"",i=a("kick","Small line above")+a("title","Words on screen")+a("sub","Line below")+o;return`<div class="beat" data-b="${t}"><button><span class="sw" style="--c:${xt[t%xt.length]}"></span><span class="k">${m(e.kind)}</span>
59
59
  <span class="tm">${W(e.start)}–${W(e.start+(e.len??0))}</span><span class="tx">${m(r.title??r.kick??e.line.replace(/\[[^\]]*\]\s*/g,""))}</span></button>
60
60
  <div class="form">${i||'<p class="note">No words on screen in this beat.</p>'}
61
- ${e.line?`<div class="said">Said: ${m(e.line.replace(/\[[^\]]*\]\s*/g,""))}<br><span class="note">Changing what is said records the voice again; ask Claude for that.</span></div>`:""}</div></div>`}function ln(){let e=document.getElementById("frame"),t=document.getElementById("screen");if(e&&t)e.style.transform=`scale(${t.clientWidth/Number(e.width)})`}addEventListener("resize",ln);function oo(e){let t=document.getElementById("screen");if(!t)return;let[r,a]=e.size??nn[U?.format??"9x16"];t.style.setProperty("--ar",`${r}/${a}`),t.innerHTML=`<iframe id="frame" title="Preview" src="${m(Q(e,"v/film/index.html"))}?t=${Date.now()}" width="${r}" height="${a}"></iframe>`,k("play").disabled=!1,ln();let o=document.getElementById("stills");if(o&&U)o.innerHTML=U.stills.map((i)=>`<a href="${m(Q(e,i))}" target="_blank" rel="noopener"><img src="${m(Q(e,i))}?t=${Date.now()}" alt="Still frame"></a>`).join("")}function so(){let e=[...new Set([...J].map((r)=>We[r]))],t=document.getElementById("platnote");if(t)t.textContent=J.size?`Render makes ${e.length} file${e.length>1?"s":""}: ${e.map((r)=>Me(r)).join(", ")}`:"Pick where it goes, then Render."}function ao(e){let t=document.getElementById("job"),r=document.getElementById("stat");if(r)r.className=`pill ${e.status}`,r.textContent=rn[e.status];let a=!!e.job&&(e.job.state==="running"||e.job.state==="queued");for(let f of["render","stillsBtn","save"]){let b=document.getElementById(f);if(b)b.disabled=a}if(!t)return;let o=e.job;if(!o||o.state==="done"||o.state==="cancelled"){t.innerHTML="";return}let i=o.total?Math.round(o.step/o.total*100):0,p=o.state==="queued"?"Waiting for another video to finish":o.state==="failed"?o.error??"Failed":`${o.label[o.step]??"Working"} (step ${o.step+1} of ${o.total})`;t.innerHTML=`<div class="job"><div class="row"><b>${m(p)}</b><span class="sp"></span>${a?`<button class="btn" data-cancel="${o.id}">Cancel</button>`:""}</div>
61
+ ${e.line?`<div class="said">Said: ${m(e.line.replace(/\[[^\]]*\]\s*/g,""))}<br><span class="note">Changing what is said records the voice again; ask Claude for that.</span></div>`:""}</div></div>`}function ln(){let e=document.getElementById("frame"),t=document.getElementById("screen");if(e&&t)e.style.transform=`scale(${t.clientWidth/Number(e.width)})`}addEventListener("resize",ln);function so(e){let t=document.getElementById("screen");if(!t)return;let[r,a]=e.size??nn[U?.format??"9x16"];t.style.setProperty("--ar",`${r}/${a}`),t.innerHTML=`<iframe id="frame" title="Preview" src="${m(Q(e,"v/film/index.html"))}?t=${Date.now()}" width="${r}" height="${a}"></iframe>`,k("play").disabled=!1,ln();let o=document.getElementById("stills");if(o&&U)o.innerHTML=U.stills.map((i)=>`<a href="${m(Q(e,i))}" target="_blank" rel="noopener"><img src="${m(Q(e,i))}?t=${Date.now()}" alt="Still frame"></a>`).join("")}function ao(){let e=[...new Set([...J].map((r)=>We[r]))],t=document.getElementById("platnote");if(t)t.textContent=J.size?`Render makes ${e.length} file${e.length>1?"s":""}: ${e.map((r)=>Me(r)).join(", ")}`:"Pick where it goes, then Render."}function io(e){let t=document.getElementById("job"),r=document.getElementById("stat");if(r)r.className=`pill ${e.status}`,r.textContent=rn[e.status];let a=!!e.job&&(e.job.state==="running"||e.job.state==="queued");for(let f of["render","stillsBtn","save"]){let b=document.getElementById(f);if(b)b.disabled=a}if(!t)return;let o=e.job;if(!o||o.state==="done"||o.state==="cancelled"){t.innerHTML="";return}let i=o.total?Math.round(o.step/o.total*100):0,p=o.state==="queued"?"Waiting for another video to finish":o.state==="failed"?o.error??"Failed":`${o.label[o.step]??"Working"} (step ${o.step+1} of ${o.total})`;t.innerHTML=`<div class="job"><div class="row"><b>${m(p)}</b><span class="sp"></span>${a?`<button class="btn" data-cancel="${o.id}">Cancel</button>`:""}</div>
62
62
  ${a?`<div class="prog"><i style="width:${Math.max(4,i)}%"></i></div>`:""}
63
63
  ${o.state==="failed"&&U?.log?`<pre>${m(U.log.split(`
64
64
  `).slice(-25).join(`
65
- `))}</pre>`:""}</div>`}var N=null,io=(e)=>e.split("/")[1]??"",ge=(e)=>e.preset??io(e.file),Oa=(e)=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),lo=(e)=>e.built&&e.outputs.some((t)=>ge(t)===e.preset&&t.kind!=="history"&&t.at>=e.builtAt);function Tt(e,t){let r=e.outputs.filter((p)=>p.letter&&p.kind==="current"),a=r.find((p)=>p.letter===t);if(!a)return e.name;let o=r.filter((p)=>ge(p)===ge(a)),i=o.indexOf(a);return`${e.name} · ${ge(a)}${o.length>1&&i>0?` (${i+1})`:""}`}function bt(e,t,r,a,o,i=""){return`<div class="file ver${i}${N===t.file?" on":""}" data-show="${m(t.file)}">
65
+ `))}</pre>`:""}</div>`}var N=null,lo=(e)=>e.split("/")[1]??"",ge=(e)=>e.preset??lo(e.file),Aa=(e)=>new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),co=(e)=>e.built&&e.outputs.some((t)=>ge(t)===e.preset&&t.kind!=="history"&&t.at>=e.builtAt);function Tt(e,t){let r=e.outputs.filter((p)=>p.letter&&p.kind==="current"),a=r.find((p)=>p.letter===t);if(!a)return e.name;let o=r.filter((p)=>ge(p)===ge(a)),i=o.indexOf(a);return`${e.name} · ${ge(a)}${o.length>1&&i>0?` (${i+1})`:""}`}function bt(e,t,r,a,o,i=""){return`<div class="file ver${i}${N===t.file?" on":""}" data-show="${m(t.file)}">
66
66
  <button class="vname" data-show="${m(t.file)}" aria-pressed="${N===t.file}">${r}</button>
67
67
  <span class="vfacts">${a}</span>
68
68
  <span class="acts">${o}</span></div>`}var wt=(e,t)=>`<a href="${m(Q(e,t.file))}" target="_blank" rel="noopener">Open</a>${t.srt?`<a href="${m(Q(e,t.srt))}" target="_blank" rel="noopener">Captions</a>`:""}`,fe=(e,t,r,a="btn",o,i)=>`<button class="${a}" data-vact="${e}" data-l="${m(t)}"${o!=null?` data-n="${o}"`:""}${i?` aria-label="${m(i)}"`:""}>${r}</button>`;function cn(e){let t=document.getElementById("files");if(!t)return;if(N&&!e.outputs.some((f)=>f.file===N))N=null;let r=(f)=>f.seconds!=null?` · ${W(f.seconds)}`:"",a=e.built?`<div class="file ver${N?"":" on"}" data-show="">
69
69
  <button class="vname" data-show="" aria-pressed="${!N}"><span class="pill draft">Draft</span><b>${m(e.preset)}</b></button>
70
70
  <span class="vfacts">${e.revising?`revising ${m(Tt(e,e.revising))}; a render becomes its next v`:"live preview, not rendered"}</span>
71
- ${e.revising?`<span class="acts">${fe("new",e.revising,"Make a new version instead","btn ghost")}</span>`:""}</div>`:"",i=[...new Set(e.outputs.filter((f)=>f.letter).map((f)=>f.letter))].map((f)=>{let b=e.outputs.filter((T)=>T.letter===f),R=b.find((T)=>T.kind==="current"),O=b.find((T)=>T.kind==="trying"),L=b.filter((T)=>T.kind==="history").sort((T,_)=>_.rev-T.rev);if(!R)return"";let h=Tt(e,f),c=bt(e,R,`<b>${m(h)}</b><span class="pill ver-l">v${R.rev}</span>`,`${r(R).slice(3)}${e.revising===f?`${R.seconds!=null?" · ":""}in the draft`:""}`,(R.recipe?fe("revise",f,"Revise","btn",void 0,`Revise ${h}`):"")+wt(e,R)+`<button class="btn" data-sendfile="${m(R.file)}">Send</button>`+fe("delete",f,"Delete","btn danger",void 0,`Delete ${h} and its history`)),l=O?bt(e,O,`<span class="pill draft">Trying</span><b>v${O.rev}</b>`,`from v${m((O.from??"").replace(/^[a-z]+/,"")||String(R.rev))}${r(O)} · compare, then keep or revert`,fe("keep",f,"Keep","btn pri",void 0,`Keep v${O.rev} as ${h}`)+fe("revert",f,"Revert","btn",void 0,`Revert ${h} to v${R.rev}`)+wt(e,O)," sub"):"",x=L.length?`<details class="hist"${L.some((T)=>T.file===N)?" open":""}><summary>Earlier versions (${L.length})</summary>${L.map((T)=>bt(e,T,`<b>v${T.rev}</b>`,`${Oa(T.at)}${r(T)}`,fe("restore",f,"Restore","btn",T.rev,`Restore v${T.rev} as ${h}`)+wt(e,T)+fe("delete",f,"Delete","btn danger",T.rev,`Delete v${T.rev} of ${h}`)," sub")).join("")}</details>`:"";return`<div class="vgroup">${c}${l}${x}</div>`}),p=e.outputs.filter((f)=>!f.letter).map((f)=>bt(e,f,`<span class="pill ready">${Me(f.format)}</span><b>${m(ge(f))} · ${m(f.file.split("/").pop())}</b>`,f.kind==="new"?`just rendered; becoming a version${r(f)}`:r(f).slice(3),wt(e,f)+(f.kind==="new"?"":`<button class="btn" data-sendfile="${m(f.file)}">Send</button><button class="btn danger" data-delfile="${m(f.file)}" aria-label="Delete ${m(ge(f))} version">Delete</button>`)));t.innerHTML=a||e.outputs.length?'<p class="note" style="margin:0">Versions</p>'+a+i.join("")+p.join(""):""}function dn(e){let t=document.getElementById("render"),r=document.getElementById("rdone");if(!t||!r)return;let a=!!N||lo(e);t.hidden=a,r.hidden=!a,r.textContent=N?"Rendered version":"Rendered",t.textContent=e.revising?"Render new v":"Render final"}function vt(e){let t=document.getElementById("screen"),r=document.getElementById("shape"),a=document.getElementById("play"),o=N&&e.outputs.find((i)=>i.file===N);if(!t)return;if(t.closest(".player")?.classList.toggle("file",!!o),!o){if(N=null,e.built)oo(e);if(r)r.textContent=`Draft · ${e.preset}`;let i=document.getElementById("time"),p=document.getElementById("play");if(i)i.textContent=`0:00 / ${W(se)}`;if(p)St=!1,p.innerHTML='<svg><use href="#i-play"/></svg>',p.setAttribute("aria-label","Play")}else{if(t.innerHTML=`<video id="vid" src="${m(Q(e,o.file))}" controls playsinline preload="metadata" aria-label="Rendered ${m(ge(o))} video"></video>`,a)a.disabled=!0;let i=document.getElementById("time");if(i)i.textContent=o.seconds!=null?W(o.seconds):"";if(r)r.textContent=`${o.letter?`${Tt(e,o.letter)} · v${o.rev}${o.kind==="trying"?" (trying)":o.kind==="history"?" (history)":""}`:"Rendered · ${presetIn(o)}"}${o.seconds!=null?` · ${W(o.seconds)}`:""}`}cn(e),dn(e)}var y=null;function Aa(e){let t=ye();if(!t)return;if(y={file:e,via:y?.via??"localsend",devices:y?.devices??null,devNote:y?.devNote??null,dev:y?.dev??"",chats:y?.chats??null,chatErr:null,chat:y?.chat??"",text:y?.text||t.title||t.name,searching:!1},he(),k("sendp").scrollIntoView({behavior:"smooth",block:"nearest"}),y.via==="localsend"&&!y.devices)tn(!1);else if(y.via==="whatsapp"&&!y.chats)co()}async function tn(e){if(!y)return;y.searching=!0,he();try{let t=await(await fetch(`/video/devices${e?"?fresh=1":""}`)).json();if(y){if(y.devices=t.devices,y.devNote=t.note,!t.devices.some((r)=>r.id===y.dev))y.dev=t.devices[0]?.id??""}}catch{D("The board is not running")}if(y)y.searching=!1,he()}async function co(){if(!y)return;try{let e=await(await fetch("/video/chats")).json();if(y){if(y.chats=e.chats,y.chatErr=e.error??null,!e.chats.some((t)=>t.id===y.chat))y.chat=e.chats[0]?.id??""}}catch{D("The board is not running")}he()}function he(){let e=k("sendp"),t=ye();if(!y||!t){e.innerHTML="";return}let r=(o)=>o.deviceModel||o.deviceType||"",a=y.via==="localsend";e.innerHTML=`<div class="sendp"><div class="row"><h3>Send</h3>
71
+ ${e.revising?`<span class="acts">${fe("new",e.revising,"Make a new version instead","btn ghost")}</span>`:""}</div>`:"",i=[...new Set(e.outputs.filter((f)=>f.letter).map((f)=>f.letter))].map((f)=>{let b=e.outputs.filter((T)=>T.letter===f),R=b.find((T)=>T.kind==="current"),O=b.find((T)=>T.kind==="trying"),L=b.filter((T)=>T.kind==="history").sort((T,_)=>_.rev-T.rev);if(!R)return"";let h=Tt(e,f),c=bt(e,R,`<b>${m(h)}</b><span class="pill ver-l">v${R.rev}</span>`,`${r(R).slice(3)}${e.revising===f?`${R.seconds!=null?" · ":""}in the draft`:""}`,(R.recipe?fe("revise",f,"Revise","btn",void 0,`Revise ${h}`):"")+wt(e,R)+`<button class="btn" data-sendfile="${m(R.file)}">Send</button>`+fe("delete",f,"Delete","btn danger",void 0,`Delete ${h} and its history`)),l=O?bt(e,O,`<span class="pill draft">Trying</span><b>v${O.rev}</b>`,`from v${m((O.from??"").replace(/^[a-z]+/,"")||String(R.rev))}${r(O)} · compare, then keep or revert`,fe("keep",f,"Keep","btn pri",void 0,`Keep v${O.rev} as ${h}`)+fe("revert",f,"Revert","btn",void 0,`Revert ${h} to v${R.rev}`)+wt(e,O)," sub"):"",x=L.length?`<details class="hist"${L.some((T)=>T.file===N)?" open":""}><summary>Earlier versions (${L.length})</summary>${L.map((T)=>bt(e,T,`<b>v${T.rev}</b>`,`${Aa(T.at)}${r(T)}`,fe("restore",f,"Restore","btn",T.rev,`Restore v${T.rev} as ${h}`)+wt(e,T)+fe("delete",f,"Delete","btn danger",T.rev,`Delete v${T.rev} of ${h}`)," sub")).join("")}</details>`:"";return`<div class="vgroup">${c}${l}${x}</div>`}),p=e.outputs.filter((f)=>!f.letter).map((f)=>bt(e,f,`<span class="pill ready">${Me(f.format)}</span><b>${m(ge(f))} · ${m(f.file.split("/").pop())}</b>`,f.kind==="new"?`just rendered; becoming a version${r(f)}`:r(f).slice(3),wt(e,f)+(f.kind==="new"?"":`<button class="btn" data-sendfile="${m(f.file)}">Send</button><button class="btn danger" data-delfile="${m(f.file)}" aria-label="Delete ${m(ge(f))} version">Delete</button>`)));t.innerHTML=a||e.outputs.length?'<p class="note" style="margin:0">Versions</p>'+a+i.join("")+p.join(""):""}function dn(e){let t=document.getElementById("render"),r=document.getElementById("rdone");if(!t||!r)return;let a=!!N||co(e);t.hidden=a,r.hidden=!a,r.textContent=N?"Rendered version":"Rendered",t.textContent=e.revising?"Render new v":"Render final"}function vt(e){let t=document.getElementById("screen"),r=document.getElementById("shape"),a=document.getElementById("play"),o=N&&e.outputs.find((i)=>i.file===N);if(!t)return;if(t.closest(".player")?.classList.toggle("file",!!o),!o){if(N=null,e.built)so(e);if(r)r.textContent=`Draft · ${e.preset}`;let i=document.getElementById("time"),p=document.getElementById("play");if(i)i.textContent=`0:00 / ${W(ae)}`;if(p)St=!1,p.innerHTML='<svg><use href="#i-play"/></svg>',p.setAttribute("aria-label","Play")}else{if(t.innerHTML=`<video id="vid" src="${m(Q(e,o.file))}" controls playsinline preload="metadata" aria-label="Rendered ${m(ge(o))} video"></video>`,a)a.disabled=!0;let i=document.getElementById("time");if(i)i.textContent=o.seconds!=null?W(o.seconds):"";if(r)r.textContent=`${o.letter?`${Tt(e,o.letter)} · v${o.rev}${o.kind==="trying"?" (trying)":o.kind==="history"?" (history)":""}`:"Rendered · ${presetIn(o)}"}${o.seconds!=null?` · ${W(o.seconds)}`:""}`}cn(e),dn(e)}var y=null;function Pa(e){let t=ye();if(!t)return;if(y={file:e,via:y?.via??"localsend",devices:y?.devices??null,devNote:y?.devNote??null,dev:y?.dev??"",chats:y?.chats??null,chatErr:null,chat:y?.chat??"",text:y?.text||t.title||t.name,searching:!1},he(),k("sendp").scrollIntoView({behavior:"smooth",block:"nearest"}),y.via==="localsend"&&!y.devices)tn(!1);else if(y.via==="whatsapp"&&!y.chats)uo()}async function tn(e){if(!y)return;y.searching=!0,he();try{let t=await(await fetch(`/video/devices${e?"?fresh=1":""}`)).json();if(y){if(y.devices=t.devices,y.devNote=t.note,!t.devices.some((r)=>r.id===y.dev))y.dev=t.devices[0]?.id??""}}catch{D("The board is not running")}if(y)y.searching=!1,he()}async function uo(){if(!y)return;try{let e=await(await fetch("/video/chats")).json();if(y){if(y.chats=e.chats,y.chatErr=e.error??null,!e.chats.some((t)=>t.id===y.chat))y.chat=e.chats[0]?.id??""}}catch{D("The board is not running")}he()}function he(){let e=k("sendp"),t=ye();if(!y||!t){e.innerHTML="";return}let r=(o)=>o.deviceModel||o.deviceType||"",a=y.via==="localsend";e.innerHTML=`<div class="sendp"><div class="row"><h3>Send</h3>
72
72
  <label class="sr" for="sfile">File</label><select class="sel" id="sfile">${t.outputs.flatMap((o)=>[o.file,o.srt,o.thumb]).filter(Boolean).map((o)=>`<option value="${m(o)}"${o===y.file?" selected":""}>${m(o.split("/").pop())}</option>`).join("")}</select>
73
73
  <span class="sp"></span><button class="ib" data-sclose aria-label="Close send">✕</button></div>
74
74
  <div class="chips" role="tablist"><button class="chip${a?" on":""}" role="tab" aria-selected="${a}" data-via="localsend">LocalSend</button><button class="chip${a?"":" on"}" role="tab" aria-selected="${!a}" data-via="whatsapp">WhatsApp <small>via Hermes</small></button></div>
@@ -80,9 +80,9 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
80
80
  ${y.chatErr?`<span class="note">${m(y.chatErr)}</span>`:y.chats?`<label>Chat<select class="sel" id="schat">${y.chats.map((o)=>`<option value="${m(o.id)}"${o.id===y.chat?" selected":""}>${m(o.name)}${o.type?` (${m(o.type)})`:""}</option>`).join("")}</select></label>`:'<span class="note">Asking Hermes for its chats…</span>'}
81
81
  <label>Message<textarea id="stext" maxlength="1000">${m(y.text)}</textarea></label>
82
82
  <div class="row"><span class="sp"></span><button class="btn pri" data-sgo ${y.chat?"":"disabled"}>Send on WhatsApp</button></div></div>`}
83
- <div id="sendst"></div></div>`,uo()}var Pa=(e)=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});function uo(){let e=document.getElementById("sendst"),t=ye();if(!e||!t)return;let r=t.send,a=(i)=>i.state==="sent"?`Sent to ${i.to}`:i.state==="failed"?i.error??"Failed":i.state==="waiting"?i.via==="localsend"?`Waiting for ${i.to} to accept…`:`Hermes is sending to ${i.to}…`:`Sending to ${i.to}… ${i.pct}%`,o=!!r&&(r.state==="waiting"||r.state==="uploading");e.innerHTML=(r?`<div class="job sendres ${r.state}" role="status"><div class="row"><b>${m(a(r))}</b></div>${o&&r.via==="localsend"?`<div class="prog"><i style="width:${Math.max(4,r.pct)}%"></i></div>`:""}</div>`:"")+(t.sends.length?`<p class="note" style="margin:0">Recent sends</p><ul class="sends">${t.sends.map((i)=>`<li><span class="pill ${i.state==="sent"?"ready":"failed"}">${i.state==="sent"?"Sent":"Failed"}</span> ${m(i.file.split("/").pop())} → ${m(i.to)}${i.via==="whatsapp"?" (WhatsApp)":""}, ${Pa(i.at)}${i.state==="failed"&&i.error?` <span class="note">${m(i.error)}</span>`:""}</li>`).join("")}</ul>`:"");for(let i of document.querySelectorAll("#sendp [data-sgo]"))if(o)i.disabled=!0}k("sendp").addEventListener("click",async(e)=>{let t=e.target,r=ye();if(!y||!r)return;if(t.closest("[data-sclose]"))return y=null,he();let a=t.closest("[data-via]");if(a)return y.via=a.dataset.via,he(),y.via==="localsend"?y.devices?void 0:tn(!1):y.chats?void 0:co();let o=t.closest("[data-dev]");if(o)return y.dev=o.dataset.dev,he();if(t.closest("[data-search]"))return tn(!0);if(!t.closest("[data-sgo]"))return;try{await Y("/video/send",{p:r.place,name:r.name,file:y.file,via:y.via,to:y.via==="localsend"?y.dev:y.chat,text:y.text}),D(y.via==="localsend"?"Accept it on the device":"Hermes is sending it")}catch(i){D(i instanceof Error?i.message:String(i))}ae()});k("sendp").addEventListener("change",(e)=>{let t=e.target;if(!y)return;if(t.id==="sfile")y.file=t.value;if(t.id==="schat")y.chat=t.value});k("sendp").addEventListener("input",(e)=>{let t=e.target;if(y&&t.id==="stext")y.text=t.value});function Zr(e,t=!0){document.querySelectorAll(".beat").forEach((a)=>a.classList.toggle("open",Number(a.dataset.b)===e)),document.querySelectorAll("#strip button").forEach((a)=>a.classList.toggle("on",Number(a.dataset.b)===e));let r=U?.beats[e];if(pn=!0,t&&r)un({kz:"seek",t:r.start+Math.min(1.2,(r.len??0)/2)})}var un=(e)=>document.getElementById("frame")?.contentWindow?.postMessage(e,location.origin);addEventListener("message",(e)=>{if(e.origin!==location.origin||e.data?.kz!=="time")return;let{t,dur:r,on:a}=e.data;se=r||se;let o=document.getElementById("time"),i=document.getElementById("head");if(o)o.textContent=`${W(t)} / ${W(se)}`;if(i&&se)i.style.left=`${t/se*100}%`;if(a!==St){St=a;let p=document.getElementById("play");if(p)p.innerHTML=`<svg><use href="#i-${a?"pause":"play"}"/></svg>`,p.setAttribute("aria-label",a?"Pause":"Play")}});k("edit").addEventListener("keydown",(e)=>{if(!e.target.closest("[data-tab]")||e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault(),X=X==="form"?"term":"form",fn(),document.querySelector(`[data-tab=${X}]`)?.focus()});k("edit").addEventListener("click",async(e)=>{let t=e.target,r=ye();if(t.closest("[data-back]"))return Ge(null);let a=t.closest("[data-tab]");if(a)return X=a.dataset.tab,fn();if(!r)return;let o=t.closest(".beat>button");if(o)return Zr(Number(o.parentElement.dataset.b));let i=t.closest("#strip button");if(i)return Zr(Number(i.dataset.b));if(t.closest("#play"))return un({kz:St?"pause":"play"});let p=t.closest("[data-show]");if(p&&(t.closest(".vname")||!t.closest("a, button"))){let h=p.dataset.show||null;if(h===N)return;return N=h,vt(r)}let f=t.closest("#plats .chip");if(f){let h=f.dataset.p;return J.has(h)?J.delete(h):J.add(h),f.classList.toggle("on",J.has(h)),so()}let b=t.closest("[data-sendfile]");if(b)return Aa(b.dataset.sendfile);let R=t.closest("[data-vact]");if(R){let h=R.dataset.vact,c=R.dataset.l,l=R.dataset.n?Number(R.dataset.n):void 0,x=r.outputs.find((B)=>B.letter===c&&B.kind==="trying"),T=r.outputs.find((B)=>B.letter===c&&B.kind==="current"),_=Tt(r,c),Z=de.size>0||r.built&&!lo(r),ee=h==="revise"?Z?`The draft has changes that are not rendered. Revising ${_} replaces the draft with ${_}'s recipe, and those changes are lost. Go on?`:null:h==="keep"?`Keep v${x?.rev} as ${_}? The current v${T?.rev} moves to ${_}'s history, where you can restore it.`:h==="revert"?`Revert ${_}? The try v${x?.rev} is deleted from disk${T?.recipe?`, and the draft goes back to ${_}${Z?"; its changes that are not rendered are lost":""}`:""}.`:h==="restore"?`Restore v${l} for ${_}? The current v${T?.rev} moves to the history.${r.revising===c&&r.outputs.find((B)=>B.letter===c&&B.rev===l)?.recipe?` The draft becomes v${l}${Z?"; its changes that are not rendered are lost":""}.`:""}`:h==="delete"?l!=null?`Delete v${l} from ${_}'s history? Its video, captions and thumbnail are removed from disk.`:`Delete ${_} with its try and its whole history? Every one of its videos is removed from disk. Other versions and the draft stay.`:null;if(ee&&!confirm(ee))return;try{let B=await Y("/video/version",{p:r.place,name:r.name,action:h,letter:c,n:l,all:h==="delete"&&l==null});if(h==="revise"||h==="revert")de=new Map,N=null;if(h==="delete"&&N&&r.outputs.find((Oe)=>Oe.file===N)?.letter===c&&(l==null||N.includes(`/${c}/${l}/`)))N=null;if(D(h==="revise"?`The draft is now ${_}. Change it, then render a try.`:h==="keep"?`Kept: ${_} is now v${x?.rev}`:h==="revert"?`Reverted ${_}`:h==="restore"?`Version ${c} is v${l} again`:h==="new"?"The next render makes a new version":"Deleted"),B.note)D(B.note);vt(r),ae()}catch(B){D(B instanceof Error?B.message:String(B))}return}let O=t.closest("[data-delfile]");if(O){let h=O.dataset.delfile,c=r.outputs.find((l)=>l.file===h);if(!c||!confirm(`Delete the ${io(h)} version (${h.split("/").pop()})? Its rendered video${c.srt?", captions":""}${c.thumb?", thumbnail":""} are removed from disk. The draft and other versions stay.`))return;try{if(await Y("/video/delete",{p:r.place,name:r.name,file:h}),N===h)N=null,vt(r);D("Version deleted"),ae()}catch(l){D(l instanceof Error?l.message:String(l))}return}let L=t.closest("[data-cancel]");try{if(L)await Y("/video/cancel",{id:Number(L.dataset.cancel)}),D("Cancelled");else if(t.closest("#save")){let h=[...de].map(([c,l])=>({i:c,...l}));await Y("/video/save",{p:r.place,name:r.name,edits:h,platforms:[...J]}),de=new Map,D(h.length?"Saved. Building the preview…":"Saved")}else if(t.closest("#stillsBtn"))await Y("/video/job",{p:r.place,name:r.name,kind:"preview"}),D("Building the film and taking stills…");else if(t.closest("#askgo")){let h=k("askin").value.trim();if(!h)return D("Write what to change first");let c=await Y("/video/ask",{p:r.place,name:r.name,text:h});k("askin").value="",D(c.pty?"Claude is on it. Its terminal is at the top of the page.":"Claude opened in a terminal window."),scrollTo({top:0,behavior:"smooth"})}else if(t.closest("#render")){if(!J.size)return D("Pick where it goes first");if(r.mode==="film")await Y("/video/save",{p:r.place,name:r.name,edits:[],platforms:[...J],build:!1});let h=await Y("/video/job",{p:r.place,name:r.name,kind:"render",platforms:[...J]});D(`Rendering ${h.job.total} file${h.job.total>1?"s":""}. You can leave this page.`)}else return}catch(h){D(h instanceof Error?h.message:String(h))}ae()});k("edit").addEventListener("input",(e)=>{let t=e.target,r=Number(t.dataset.i),a=t.dataset.k;if(!a||!U)return;let o=de.get(r)??{};if(o[a]=a==="items"?t.value.split(`
84
- `).map((i)=>i.trim()).filter(Boolean):t.value,de.set(r,o),a==="title"){let i=t.closest(".beat")?.querySelector(".tx");if(i)i.textContent=t.value}});var pn=!1;document.addEventListener("load",(e)=>{if(e.target.id==="frame"&&!pn)un({kz:"seek",t:Math.min(1.5,se/2)})},!0);var eo=null,La=()=>eo??=new Promise((e,t)=>{let r=document.createElement("link");r.rel="stylesheet",r.href="/term.css",document.head.append(r);let a=document.createElement("script");a.src="/term.js",a.onload=()=>e(window.kzTerm),a.onerror=()=>{eo=null,t(Error("terminal failed to load"))},document.head.append(a)}),oe=null,X="form";function Ue(){let e=k("dock");if(e.parentElement!==k("edit"))k("edit").prepend(e);return e}function fn(){let e=document.getElementById("formpane"),t=document.getElementById("termpane");if(!e||!t)return;e.hidden=X!=="form",t.hidden=X!=="term";for(let r of document.querySelectorAll("[data-tab]"))r.setAttribute("aria-selected",String(r.dataset.tab===X)),r.tabIndex=r.dataset.tab===X?0:-1;if(X==="term")mn()}async function mn(){let e=k("dock"),t=K&&no(K.place,K.name);if(!t){oe?.off(),oe=null,e.innerHTML="",document.querySelector("[data-tab=term]")?.classList.remove("ask");let i=document.getElementById("tdotsr");if(i)i.textContent="";return}if(oe?.key!==t.pty&&!document.getElementById("term")?.dataset.pty?.includes(t.pty))oe?.off(),oe=null,e.innerHTML=`<div class="agentbar" id="abar"></div><div class="term" id="term" data-pty="${m(t.pty)}"></div>`;let r=!e.closest("#termpane")||X==="term";if(oe?.key!==t.pty&&r){let i={key:t.pty,off:()=>{}};oe=i;try{let p=await La(),f=document.getElementById("term");if(f&&oe===i)i.off=p(f,t.pty,()=>ae())}catch{oe={key:t.pty,off:()=>{}};let p=document.getElementById("term");if(p)p.textContent="The terminal could not load. Open it on the board instead."}}document.querySelector("[data-tab=term]")?.classList.toggle("ask",t.alive&&t.asking);let a=document.getElementById("tdotsr");if(a)a.textContent=t.alive&&t.asking?" (Claude is asking you something)":"";let o=document.getElementById("abar");if(!o)return;o.className="agentbar"+(t.alive&&t.asking?" asking":""),o.innerHTML=`<b>${!t.alive?"Claude finished. Its terminal stays here for a few minutes.":t.asking?"Claude is asking you something: answer in the terminal below.":"Claude is working on this video."}</b>
85
- <a class="btn" href="/?view=terminal" target="_blank" rel="noopener">Open on the board</a>`}var Na={id:"Indonesian",en:"English"},v={source:"brief",brief:"",folder:"",assets:"",preset:"",platforms:new Set(["TikTok"]),seconds:60,language:"id",place:0},to=[],kt={},Et=15,Rt=300,en=(e)=>`${(e-Et)/(Rt-Et)*100}%`;async function gn(){try{let r=await(await fetch(`/video/presets?p=${v.place}`)).json();to=r.presets,kt=r.limits}catch{D("The board is not running");return}let e=to.filter((r)=>!r.hidden&&(r.kind==="film"||r.kind==="template"===(v.source==="brief"))),t=v.source==="brief"?"film":"footage";if(!e.some((r)=>r.name===v.preset))v.preset=(e.find((r)=>r.kind===t)??e.find((r)=>r.kind==="template")??e[0])?.name??"";k("wiz").innerHTML=`
83
+ <div id="sendst"></div></div>`,po()}var La=(e)=>new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});function po(){let e=document.getElementById("sendst"),t=ye();if(!e||!t)return;let r=t.send,a=(i)=>i.state==="sent"?`Sent to ${i.to}`:i.state==="failed"?i.error??"Failed":i.state==="waiting"?i.via==="localsend"?`Waiting for ${i.to} to accept…`:`Hermes is sending to ${i.to}…`:`Sending to ${i.to}… ${i.pct}%`,o=!!r&&(r.state==="waiting"||r.state==="uploading");e.innerHTML=(r?`<div class="job sendres ${r.state}" role="status"><div class="row"><b>${m(a(r))}</b></div>${o&&r.via==="localsend"?`<div class="prog"><i style="width:${Math.max(4,r.pct)}%"></i></div>`:""}</div>`:"")+(t.sends.length?`<p class="note" style="margin:0">Recent sends</p><ul class="sends">${t.sends.map((i)=>`<li><span class="pill ${i.state==="sent"?"ready":"failed"}">${i.state==="sent"?"Sent":"Failed"}</span> ${m(i.file.split("/").pop())} → ${m(i.to)}${i.via==="whatsapp"?" (WhatsApp)":""}, ${La(i.at)}${i.state==="failed"&&i.error?` <span class="note">${m(i.error)}</span>`:""}</li>`).join("")}</ul>`:"");for(let i of document.querySelectorAll("#sendp [data-sgo]"))if(o)i.disabled=!0}k("sendp").addEventListener("click",async(e)=>{let t=e.target,r=ye();if(!y||!r)return;if(t.closest("[data-sclose]"))return y=null,he();let a=t.closest("[data-via]");if(a)return y.via=a.dataset.via,he(),y.via==="localsend"?y.devices?void 0:tn(!1):y.chats?void 0:uo();let o=t.closest("[data-dev]");if(o)return y.dev=o.dataset.dev,he();if(t.closest("[data-search]"))return tn(!0);if(!t.closest("[data-sgo]"))return;try{await Y("/video/send",{p:r.place,name:r.name,file:y.file,via:y.via,to:y.via==="localsend"?y.dev:y.chat,text:y.text}),D(y.via==="localsend"?"Accept it on the device":"Hermes is sending it")}catch(i){D(i instanceof Error?i.message:String(i))}ie()});k("sendp").addEventListener("change",(e)=>{let t=e.target;if(!y)return;if(t.id==="sfile")y.file=t.value;if(t.id==="schat")y.chat=t.value});k("sendp").addEventListener("input",(e)=>{let t=e.target;if(y&&t.id==="stext")y.text=t.value});function eo(e,t=!0){document.querySelectorAll(".beat").forEach((a)=>a.classList.toggle("open",Number(a.dataset.b)===e)),document.querySelectorAll("#strip button").forEach((a)=>a.classList.toggle("on",Number(a.dataset.b)===e));let r=U?.beats[e];if(pn=!0,t&&r)un({kz:"seek",t:r.start+Math.min(1.2,(r.len??0)/2)})}var un=(e)=>document.getElementById("frame")?.contentWindow?.postMessage(e,location.origin);addEventListener("message",(e)=>{if(e.origin!==location.origin||e.data?.kz!=="time")return;let{t,dur:r,on:a}=e.data;ae=r||ae;let o=document.getElementById("time"),i=document.getElementById("head");if(o)o.textContent=`${W(t)} / ${W(ae)}`;if(i&&ae)i.style.left=`${t/ae*100}%`;if(a!==St){St=a;let p=document.getElementById("play");if(p)p.innerHTML=`<svg><use href="#i-${a?"pause":"play"}"/></svg>`,p.setAttribute("aria-label",a?"Pause":"Play")}});k("edit").addEventListener("keydown",(e)=>{if(!e.target.closest("[data-tab]")||e.key!=="ArrowLeft"&&e.key!=="ArrowRight")return;e.preventDefault(),X=X==="form"?"term":"form",fn(),document.querySelector(`[data-tab=${X}]`)?.focus()});k("edit").addEventListener("click",async(e)=>{let t=e.target,r=ye();if(t.closest("[data-back]"))return Ge(null);let a=t.closest("[data-tab]");if(a)return X=a.dataset.tab,fn();if(!r)return;let o=t.closest(".beat>button");if(o)return eo(Number(o.parentElement.dataset.b));let i=t.closest("#strip button");if(i)return eo(Number(i.dataset.b));if(t.closest("#play"))return un({kz:St?"pause":"play"});let p=t.closest("[data-show]");if(p&&(t.closest(".vname")||!t.closest("a, button"))){let h=p.dataset.show||null;if(h===N)return;return N=h,vt(r)}let f=t.closest("#plats .chip");if(f){let h=f.dataset.p;return J.has(h)?J.delete(h):J.add(h),f.classList.toggle("on",J.has(h)),ao()}let b=t.closest("[data-sendfile]");if(b)return Pa(b.dataset.sendfile);let R=t.closest("[data-vact]");if(R){let h=R.dataset.vact,c=R.dataset.l,l=R.dataset.n?Number(R.dataset.n):void 0,x=r.outputs.find((H)=>H.letter===c&&H.kind==="trying"),T=r.outputs.find((H)=>H.letter===c&&H.kind==="current"),_=Tt(r,c),Z=de.size>0||r.built&&!co(r),ee=h==="revise"?Z?`The draft has changes that are not rendered. Revising ${_} replaces the draft with ${_}'s recipe, and those changes are lost. Go on?`:null:h==="keep"?`Keep v${x?.rev} as ${_}? The current v${T?.rev} moves to ${_}'s history, where you can restore it.`:h==="revert"?`Revert ${_}? The try v${x?.rev} is deleted from disk${T?.recipe?`, and the draft goes back to ${_}${Z?"; its changes that are not rendered are lost":""}`:""}.`:h==="restore"?`Restore v${l} for ${_}? The current v${T?.rev} moves to the history.${r.revising===c&&r.outputs.find((H)=>H.letter===c&&H.rev===l)?.recipe?` The draft becomes v${l}${Z?"; its changes that are not rendered are lost":""}.`:""}`:h==="delete"?l!=null?`Delete v${l} from ${_}'s history? Its video, captions and thumbnail are removed from disk.`:`Delete ${_} with its try and its whole history? Every one of its videos is removed from disk. Other versions and the draft stay.`:null;if(ee&&!confirm(ee))return;try{let H=await Y("/video/version",{p:r.place,name:r.name,action:h,letter:c,n:l,all:h==="delete"&&l==null});if(h==="revise"||h==="revert")de=new Map,N=null;if(h==="delete"&&N&&r.outputs.find((Oe)=>Oe.file===N)?.letter===c&&(l==null||N.includes(`/${c}/${l}/`)))N=null;if(D(h==="revise"?`The draft is now ${_}. Change it, then render a try.`:h==="keep"?`Kept: ${_} is now v${x?.rev}`:h==="revert"?`Reverted ${_}`:h==="restore"?`Version ${c} is v${l} again`:h==="new"?"The next render makes a new version":"Deleted"),H.note)D(H.note);vt(r),ie()}catch(H){D(H instanceof Error?H.message:String(H))}return}let O=t.closest("[data-delfile]");if(O){let h=O.dataset.delfile,c=r.outputs.find((l)=>l.file===h);if(!c||!confirm(`Delete the ${lo(h)} version (${h.split("/").pop()})? Its rendered video${c.srt?", captions":""}${c.thumb?", thumbnail":""} are removed from disk. The draft and other versions stay.`))return;try{if(await Y("/video/delete",{p:r.place,name:r.name,file:h}),N===h)N=null,vt(r);D("Version deleted"),ie()}catch(l){D(l instanceof Error?l.message:String(l))}return}let L=t.closest("[data-cancel]");try{if(L)await Y("/video/cancel",{id:Number(L.dataset.cancel)}),D("Cancelled");else if(t.closest("#save")){let h=[...de].map(([c,l])=>({i:c,...l}));await Y("/video/save",{p:r.place,name:r.name,edits:h,platforms:[...J]}),de=new Map,D(h.length?"Saved. Building the preview…":"Saved")}else if(t.closest("#stillsBtn"))await Y("/video/job",{p:r.place,name:r.name,kind:"preview"}),D("Building the film and taking stills…");else if(t.closest("#askgo")){let h=k("askin").value.trim();if(!h)return D("Write what to change first");let c=await Y("/video/ask",{p:r.place,name:r.name,text:h});k("askin").value="",D(c.pty?"Claude is on it. Its terminal is at the top of the page.":"Claude opened in a terminal window."),scrollTo({top:0,behavior:"smooth"})}else if(t.closest("#render")){if(!J.size)return D("Pick where it goes first");if(r.mode==="film")await Y("/video/save",{p:r.place,name:r.name,edits:[],platforms:[...J],build:!1});let h=await Y("/video/job",{p:r.place,name:r.name,kind:"render",platforms:[...J]});D(`Rendering ${h.job.total} file${h.job.total>1?"s":""}. You can leave this page.`)}else return}catch(h){D(h instanceof Error?h.message:String(h))}ie()});k("edit").addEventListener("input",(e)=>{let t=e.target,r=Number(t.dataset.i),a=t.dataset.k;if(!a||!U)return;let o=de.get(r)??{};if(o[a]=a==="items"?t.value.split(`
84
+ `).map((i)=>i.trim()).filter(Boolean):t.value,de.set(r,o),a==="title"){let i=t.closest(".beat")?.querySelector(".tx");if(i)i.textContent=t.value}});var pn=!1;document.addEventListener("load",(e)=>{if(e.target.id==="frame"&&!pn)un({kz:"seek",t:Math.min(1.5,ae/2)})},!0);var to=null,Na=()=>to??=new Promise((e,t)=>{let r=document.createElement("link");r.rel="stylesheet",r.href="/term.css",document.head.append(r);let a=document.createElement("script");a.src="/term.js",a.onload=()=>e(window.kzTerm),a.onerror=()=>{to=null,t(Error("terminal failed to load"))},document.head.append(a)}),se=null,X="form";function Ue(){let e=k("dock");if(e.parentElement!==k("edit"))k("edit").prepend(e);return e}function fn(){let e=document.getElementById("formpane"),t=document.getElementById("termpane");if(!e||!t)return;e.hidden=X!=="form",t.hidden=X!=="term";for(let r of document.querySelectorAll("[data-tab]"))r.setAttribute("aria-selected",String(r.dataset.tab===X)),r.tabIndex=r.dataset.tab===X?0:-1;if(X==="term")mn()}async function mn(){let e=k("dock"),t=K&&ro(K.place,K.name);if(!t){se?.off(),se=null,e.innerHTML="",document.querySelector("[data-tab=term]")?.classList.remove("ask");let i=document.getElementById("tdotsr");if(i)i.textContent="";return}if(se?.key!==t.pty&&!document.getElementById("term")?.dataset.pty?.includes(t.pty))se?.off(),se=null,e.innerHTML=`<div class="agentbar" id="abar"></div><div class="term" id="term" data-pty="${m(t.pty)}"></div>`;let r=!e.closest("#termpane")||X==="term";if(se?.key!==t.pty&&r){let i={key:t.pty,off:()=>{}};se=i;try{let p=await Na(),f=document.getElementById("term");if(f&&se===i)i.off=p(f,t.pty,()=>ie())}catch{se={key:t.pty,off:()=>{}};let p=document.getElementById("term");if(p)p.textContent="The terminal could not load. Open it on the board instead."}}document.querySelector("[data-tab=term]")?.classList.toggle("ask",t.alive&&t.asking);let a=document.getElementById("tdotsr");if(a)a.textContent=t.alive&&t.asking?" (Claude is asking you something)":"";let o=document.getElementById("abar");if(!o)return;o.className="agentbar"+(t.alive&&t.asking?" asking":""),o.innerHTML=`<b>${!t.alive?"Claude finished. Its terminal stays here for a few minutes.":t.asking?"Claude is asking you something: answer in the terminal below.":"Claude is working on this video."}</b>
85
+ <a class="btn" href="/?view=terminal" target="_blank" rel="noopener">Open on the board</a>`}var Da={id:"Indonesian",en:"English"},v={source:"brief",brief:"",folder:"",assets:"",preset:"",platforms:new Set(["TikTok"]),seconds:60,language:"id",place:0},no=[],kt={},Et=15,Rt=300,en=(e)=>`${(e-Et)/(Rt-Et)*100}%`;async function gn(){try{let r=await(await fetch(`/video/presets?p=${v.place}`)).json();no=r.presets,kt=r.limits}catch{D("The board is not running");return}let e=no.filter((r)=>!r.hidden&&(r.kind==="film"||r.kind==="template"===(v.source==="brief"))),t=v.source==="brief"?"film":"footage";if(!e.some((r)=>r.name===v.preset))v.preset=(e.find((r)=>r.kind===t)??e.find((r)=>r.kind==="template")??e[0])?.name??"";k("wiz").innerHTML=`
86
86
  <div class="crumb"><button data-back>‹ Back to videos</button></div>
87
87
  <div class="ehead"><h2>New video</h2></div>
88
88
  <form class="card" id="wform" novalidate>
@@ -101,8 +101,8 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
101
101
  <div class="ticks"><span style="left:0">0:15</span><span class="m-hide" style="left:${en(60)}">1:00</span><span style="left:${en(120)}">2:00</span><span style="left:${en(180)}">3:00</span><span style="left:100%">5:00</span></div>
102
102
  <p class="note" id="wlennote"></p></div>
103
103
  <div class="two">
104
- <label>Language<select class="sel" id="wlang">${Object.entries(Na).map(([r,a])=>`<option value="${r}"${r===v.language?" selected":""}>${a}</option>`).join("")}</select></label>
104
+ <label>Language<select class="sel" id="wlang">${Object.entries(Da).map(([r,a])=>`<option value="${r}"${r===v.language?" selected":""}>${a}</option>`).join("")}</select></label>
105
105
  <label>Save in<select class="sel" id="wplace">${sn.map((r)=>`<option value="${r.i}"${r.i===v.place?" selected":""}>${m(r.label==="library"?`Video library (${r.dir})`:`${r.label} (${r.dir})`)}</option>`).join("")}</select></label>
106
106
  </div>
107
107
  <div class="foot"><button type="button" class="btn" data-back>Cancel</button><button type="submit" class="btn pri" id="wgo">Generate draft</button></div>
108
- </form>`,Ct()}function Ct(){let e=[...new Set([...v.platforms].map((o)=>We[o]))],t=document.getElementById("wplatnote");if(t)t.textContent=v.platforms.size?`Makes ${e.length} file${e.length>1?"s":""}: ${e.map((o)=>Me(o)).join(", ")}`:"Pick at least one.";let r=[...v.platforms].filter((o)=>kt[o]&&v.seconds>kt[o]).map((o)=>`${o} takes at most ${W(kt[o])}`),a=document.getElementById("wlennote");if(a)a.textContent=r.length?`Too long: ${r.join(", ")}`:`About ${Math.round(v.seconds*2.3)} words of narration`,a.className="note"+(r.length?" warn-t":"")}k("new").addEventListener("click",()=>{if(location.hash!=="#new")history.pushState(null,"","#new");$t()});k("wiz").addEventListener("click",async(e)=>{let t=e.target;if(t.closest("[data-back]"))return Ge(null);let r=t.closest("[data-src]");if(r)return Mt(),v.source=r.dataset.src,gn();let a=t.closest("[data-preset]");if(a){v.preset=a.dataset.preset;for(let i of k("wiz").querySelectorAll("[data-preset]"))i.classList.toggle("on",i===a);return}let o=t.closest("[data-plat]");if(o){let i=o.dataset.plat;return v.platforms.has(i)?v.platforms.delete(i):v.platforms.add(i),o.classList.toggle("on",v.platforms.has(i)),Ct()}if(t.closest("#wpicka")){try{let i=await Y("/pick-folder",{});if(i.path)v.assets=i.path,k("wassets").value=i.path}catch(i){D(i instanceof Error?i.message:String(i))}return}if(t.closest("#wpick"))try{let i=await Y("/pick-folder",{});if(i.path)v.folder=i.path,k("wfolder").value=i.path}catch(i){D(i instanceof Error?i.message:String(i))}});var Mt=()=>{let e=document.getElementById("wbrief"),t=document.getElementById("wfolder");if(e)v.brief=e.value;if(t)v.folder=t.value;let r=document.getElementById("wassets");if(r)v.assets=r.value};k("wiz").addEventListener("input",(e)=>{let t=e.target;if(t.id==="wlen")v.seconds=Number(t.value),k("wlentxt").value=W(v.seconds),Ct();else if(t.id==="wbrief"||t.id==="wfolder"||t.id==="wassets")Mt()});k("wiz").addEventListener("change",(e)=>{let t=e.target;if(t.id==="wlentxt"){let[r,a]=t.value.includes(":")?t.value.split(":").map(Number):[0,Number(t.value)];v.seconds=Math.min(600,Math.max(Et,Math.round((r*60+a||60)/5)*5)),t.value=W(v.seconds),k("wlen").value=String(Math.min(Rt,v.seconds)),Ct()}else if(t.id==="wlang")v.language=t.value;else if(t.id==="wplace")Mt(),v.place=Number(t.value),gn()});k("wiz").addEventListener("submit",async(e)=>{e.preventDefault(),Mt();let t=k("wgo");t.disabled=!0;try{let r=await Y("/video/new",{p:v.place,source:v.source,brief:v.brief,folder:v.folder,assets:v.source==="brief"?v.assets:"",preset:v.preset,platforms:[...v.platforms],seconds:v.seconds,language:v.language});v.brief="",v.folder="",v.assets="",await ae(),Ge(v.place,r.name),D(r.pty?"Claude started. Answer its questions in the terminal at the top.":"Claude opened in a terminal window.")}catch(r){D(r instanceof Error?r.message:String(r))}finally{t.disabled=!1}});function Da(){let e=new EventSource("/events");e.onmessage=()=>{ae(),De()}}setInterval(()=>{if(K&&document.visibilityState==="visible")ae()},5000);$t();ae();Xr();De();Da();})();
108
+ </form>`,Ct()}function Ct(){let e=[...new Set([...v.platforms].map((o)=>We[o]))],t=document.getElementById("wplatnote");if(t)t.textContent=v.platforms.size?`Makes ${e.length} file${e.length>1?"s":""}: ${e.map((o)=>Me(o)).join(", ")}`:"Pick at least one.";let r=[...v.platforms].filter((o)=>kt[o]&&v.seconds>kt[o]).map((o)=>`${o} takes at most ${W(kt[o])}`),a=document.getElementById("wlennote");if(a)a.textContent=r.length?`Too long: ${r.join(", ")}`:`About ${Math.round(v.seconds*2.3)} words of narration`,a.className="note"+(r.length?" warn-t":"")}k("new").addEventListener("click",()=>{if(location.hash!=="#new")history.pushState(null,"","#new");$t()});k("wiz").addEventListener("click",async(e)=>{let t=e.target;if(t.closest("[data-back]"))return Ge(null);let r=t.closest("[data-src]");if(r)return Mt(),v.source=r.dataset.src,gn();let a=t.closest("[data-preset]");if(a){v.preset=a.dataset.preset;for(let i of k("wiz").querySelectorAll("[data-preset]"))i.classList.toggle("on",i===a);return}let o=t.closest("[data-plat]");if(o){let i=o.dataset.plat;return v.platforms.has(i)?v.platforms.delete(i):v.platforms.add(i),o.classList.toggle("on",v.platforms.has(i)),Ct()}if(t.closest("#wpicka")){try{let i=await Y("/pick-folder",{});if(i.path)v.assets=i.path,k("wassets").value=i.path}catch(i){D(i instanceof Error?i.message:String(i))}return}if(t.closest("#wpick"))try{let i=await Y("/pick-folder",{});if(i.path)v.folder=i.path,k("wfolder").value=i.path}catch(i){D(i instanceof Error?i.message:String(i))}});var Mt=()=>{let e=document.getElementById("wbrief"),t=document.getElementById("wfolder");if(e)v.brief=e.value;if(t)v.folder=t.value;let r=document.getElementById("wassets");if(r)v.assets=r.value};k("wiz").addEventListener("input",(e)=>{let t=e.target;if(t.id==="wlen")v.seconds=Number(t.value),k("wlentxt").value=W(v.seconds),Ct();else if(t.id==="wbrief"||t.id==="wfolder"||t.id==="wassets")Mt()});k("wiz").addEventListener("change",(e)=>{let t=e.target;if(t.id==="wlentxt"){let[r,a]=t.value.includes(":")?t.value.split(":").map(Number):[0,Number(t.value)];v.seconds=Math.min(600,Math.max(Et,Math.round((r*60+a||60)/5)*5)),t.value=W(v.seconds),k("wlen").value=String(Math.min(Rt,v.seconds)),Ct()}else if(t.id==="wlang")v.language=t.value;else if(t.id==="wplace")Mt(),v.place=Number(t.value),gn()});k("wiz").addEventListener("submit",async(e)=>{e.preventDefault(),Mt();let t=k("wgo");t.disabled=!0;try{let r=await Y("/video/new",{p:v.place,source:v.source,brief:v.brief,folder:v.folder,assets:v.source==="brief"?v.assets:"",preset:v.preset,platforms:[...v.platforms],seconds:v.seconds,language:v.language});v.brief="",v.folder="",v.assets="",await ie(),Ge(v.place,r.name),D(r.pty?"Claude started. Answer its questions in the terminal at the top.":"Claude opened in a terminal window.")}catch(r){D(r instanceof Error?r.message:String(r))}finally{t.disabled=!1}});function _a(){let e=new EventSource("/events");e.onmessage=()=>{ie(),De()}}setInterval(()=>{if(K&&document.visibilityState==="visible")ie()},5000);$t();ie();Qr();De();_a();})();