videobook 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/asset-media-projection.js +161 -0
  3. package/dist/command-reference.js +3 -1
  4. package/dist/diagnostics.js +1 -1
  5. package/dist/generation-reference-mentions.js +19 -0
  6. package/dist/goal-plan-v3.js +11 -1
  7. package/dist/goal-plan.js +1 -1
  8. package/dist/goal-store.js +2 -2
  9. package/dist/har-capture.js +36 -3
  10. package/dist/jobs/_image-edit-adapter.js +2 -0
  11. package/dist/jobs/assess-media-probes.js +94 -0
  12. package/dist/jobs/complete-provider-task.js +2 -5
  13. package/dist/jobs/generate-media.js +3 -2
  14. package/dist/jobs/image-subjects.js +2 -0
  15. package/dist/jobs/kie-paygate.js +3 -3
  16. package/dist/jobs/register-all.js +2 -0
  17. package/dist/jobs/run-notebook.js +16 -1
  18. package/dist/library-asset-projection.js +141 -0
  19. package/dist/lightning-defaults.js +4 -4
  20. package/dist/media/catalog.js +8 -2
  21. package/dist/media/descriptor.js +7 -4
  22. package/dist/media/frontier-gaps.js +0 -1
  23. package/dist/media/har-endpoint.js +25 -0
  24. package/dist/media/json-schema.js +3 -0
  25. package/dist/media/preferred-defaults.js +161 -0
  26. package/dist/media/prompt-dialects.js +9 -1
  27. package/dist/media-library.js +158 -153
  28. package/dist/notebook-sticky-settings.js +60 -0
  29. package/dist/tools/reconcile-project-work.js +34 -181
  30. package/dist/tools/videobook-domain.js +16 -1
  31. package/dist/usage-providers.js +3 -3
  32. package/package.json +15 -15
  33. package/ui/assets/{alive-captions-Cj8C1tCN.js → alive-captions-CnLK22ED.js} +1 -1
  34. package/ui/assets/confirm-bodies-BaalBxp1.js +1 -0
  35. package/ui/assets/{fullscreen-DyEncSdm.js → fullscreen-DTJQJ6dX.js} +1 -1
  36. package/ui/assets/{goal-ui-BdFeoSWh.js → goal-ui-CN-kZTEO.js} +1 -1
  37. package/ui/assets/index-CTPstLYq.css +1 -0
  38. package/ui/assets/index-Dp81yChE.js +37 -0
  39. package/ui/assets/inspector-jeyma7HL.js +1 -0
  40. package/ui/assets/{jobs-ui-BudI4w0r.js → jobs-ui-D6S3LJ4j.js} +1 -1
  41. package/ui/assets/{music-video-CT4C55ok.js → music-video-CDqr0X6G.js} +1 -1
  42. package/ui/assets/{ui-mq0uIS5P.css → ui-BBM3YCY6.css} +1 -1
  43. package/ui/assets/ui-Cqs1-YNg.js +2 -0
  44. package/ui/assets/vendor-BWf-WCsY.js +19 -0
  45. package/ui/assets/{vendor-flow-nqTFQmTh.js → vendor-flow-DPvi8ynA.js} +1 -1
  46. package/ui/assets/vendor-icons-D3KrGMJY.js +1 -0
  47. package/ui/assets/{vendor-mcp-D_C3EZPv.js → vendor-mcp-BSR9acpG.js} +2 -2
  48. package/ui/assets/videobook-b9VODNOA.js +21 -0
  49. package/ui/index.html +14 -14
  50. package/ui/assets/confirm-bodies-BxWXwDf0.js +0 -1
  51. package/ui/assets/index-DWfR79lA.css +0 -1
  52. package/ui/assets/index-QZ8lbemN.js +0 -37
  53. package/ui/assets/inspector-BC6xWkJU.js +0 -1
  54. package/ui/assets/ui-z5r-p0K9.js +0 -2
  55. package/ui/assets/vendor-D8XcMav4.js +0 -19
  56. package/ui/assets/vendor-icons-CGqhCIXV.js +0 -1
  57. package/ui/assets/videobook-CsW453sb.js +0 -21
@@ -0,0 +1 @@
1
+ import{c as de,a as je,j as t}from"./vendor-react-Dj7D1fD4.js";import{c2 as Gt,c3 as Kt,c4 as Yt,c5 as Xt,i as Jt,c6 as Zt,c7 as el,c8 as It,c9 as Lt,ca as Ft,cb as tl,cc as ll,ad as sl,cd as nl,ce as il,cf as al,cg as rl,ch as pt,ci as ol,cj as xt,ck as cl,cl as dl,cm as ml,b2 as ul,E as hl,cn as fl,b3 as pl,co as xl,cp as Mt,ae as gl,cq as bl,Y as vl,cr as jl,bK as yl,b5 as wl,b6 as Nl,cs as Sl,ct as Cl,cu as kl,cv as Je,cw as gt,cx as bt,cy as Pl,cz as _l,cA as vt,cB as El,cC as $l,cD as Al,cE as Rl,cF as Tl,cG as Il,cH as Ll,bg as Fl,cI as Ml,x as Dl,cJ as Ol,cK as Hl,cL as Ul,cM as Vl,cN as Ql,cO as ql,cP as Bl,cQ as Dt,cR as zl,cS as jt,cT as yt,cU as wt,cV as Wl,cW as Gl,cX as Nt,cY as St,cZ as Kl,c_ as Yl,c$ as Xl,d0 as Jl,d1 as Zl,d2 as mt,d3 as es,d4 as Ot,d5 as ts,d6 as ls,d7 as ss,d8 as ns,d9 as is}from"./videobook-b9VODNOA.js";import{P as as,I as rs,V as os,a as cs,D as ds,R as ms,G as Ct,M as Ht}from"./ui-Cqs1-YNg.js";import{F as Ut,ab as ft,c as ut,x as Vt,g as us,h as hs,X as Qt,m as fs,i as ps,k as xs,w as gs,V as bs,ah as vs,ac as js,_ as kt}from"./vendor-icons-D3KrGMJY.js";function Sn(i){const e=de.c(40),{review:s,onChange:l,disabled:n}=i,a=je.useRef(null),r=je.useRef(null),u=je.useRef(!1),[c,p]=je.useState(null),o=s.suggestion,f=o?.startSeconds??0,d=o?.endSeconds??0,m=o?.fps??30;let h;e[0]!==d||e[1]!==o||e[2]!==f?(h=o?Gt(f,d,o.durationSeconds):null,e[0]=d,e[1]=o,e[2]=f,e[3]=h):h=e[3];const x=h;let g;e[4]!==d||e[5]!==m?(g=()=>{const N=a.current;if(!N)return;N.pause(),r.current=null;let E=0;const I=()=>{!N.seeking&&r.current==="hook"&&N.currentTime>=d-.5/m&&(u.current?(r.current="full",N.currentTime=0,N.play().catch(()=>p("Press Play to resume the preview."))):(r.current=null,N.pause())),E=requestAnimationFrame(I)};return E=requestAnimationFrame(I),()=>{cancelAnimationFrame(E),N.pause()}},e[4]=d,e[5]=m,e[6]=g):g=e[6];let S;e[7]!==d||e[8]!==m||e[9]!==s.mediaUrl||e[10]!==f?(S=[s.mediaUrl,f,d,m],e[7]=d,e[8]=m,e[9]=s.mediaUrl,e[10]=f,e[11]=S):S=e[11],je.useEffect(g,S);let j;e[12]!==f?(j=async N=>{const E=a.current;if(E){p(null),u.current=N,r.current="hook",E.currentTime=f;try{await E.play()}catch{p("Unable to play this preview. Try Play again.")}}},e[12]=f,e[13]=j):j=e[13];const C=j;let y;e[14]!==d||e[15]!==m||e[16]!==l||e[17]!==f?(y=(N,E)=>{if(N.key!=="ArrowLeft"&&N.key!=="ArrowRight")return;N.preventDefault();const I=(N.key==="ArrowRight"?1:-1)*(N.shiftKey?1:1/m);l(E==="start"?f+I:f,E==="end"?d+I:d)},e[14]=d,e[15]=m,e[16]=l,e[17]=f,e[18]=y):y=e[18];const k=y;let w;e[19]===Symbol.for("react.memo_cache_sentinel")?(w=()=>{r.current==="hook"&&u.current&&a.current?(r.current="full",a.current.currentTime=0,a.current.play().catch(()=>p("Press Play to resume the preview."))):r.current=null},e[19]=w):w=e[19];let b;e[20]!==s.mediaUrl?(b=t.jsx("video",{ref:a,src:s.mediaUrl,"aria-label":"Cold-open preview",controls:!0,playsInline:!0,preload:"metadata",onEnded:w}),e[20]=s.mediaUrl,e[21]=b):b=e[21];let v;e[22]!==n||e[23]!==d||e[24]!==m||e[25]!==x||e[26]!==k||e[27]!==l||e[28]!==C||e[29]!==o||e[30]!==f?(v=o?t.jsxs(t.Fragment,{children:[t.jsx("p",{children:o.reason}),t.jsxs("div",{className:"cold-open-bounds",children:[t.jsxs("label",{children:["Start (seconds)",t.jsx("input",{type:"number","aria-label":"Highlight start",step:1/m,min:0,max:o.durationSeconds,value:Number.isFinite(f)?f:"",disabled:n,onKeyDown:N=>k(N,"start"),onChange:N=>l(N.target.valueAsNumber,d)})]}),t.jsxs("label",{children:["End (seconds)",t.jsx("input",{type:"number","aria-label":"Highlight end",step:1/m,min:0,max:o.durationSeconds,value:Number.isFinite(d)?d:"",disabled:n,onKeyDown:N=>k(N,"end"),onChange:N=>l(f,N.target.valueAsNumber)})]})]}),t.jsxs("div",{className:"cold-open-playback",children:[t.jsx("button",{type:"button",disabled:n||!!x,onClick:()=>{C(!1)},children:"Play highlight"}),t.jsx("button",{type:"button",disabled:n||!!x,onClick:()=>{C(!0)},children:"Preview cold open"})]}),t.jsx("p",{children:x??`${(d-f).toFixed(2)}s highlight → full ${o.durationSeconds.toFixed(2)}s clip · ${(o.durationSeconds+d-f).toFixed(2)}s total`}),t.jsx("small",{children:"← → nudge one frame · Shift + ← → nudge one second"})]}):t.jsx("p",{children:"AI will suggest a 2–5 second highlight. Review its timing before creating the copy. Analysis uses your configured provider and may incur charges."}),e[22]=n,e[23]=d,e[24]=m,e[25]=x,e[26]=k,e[27]=l,e[28]=C,e[29]=o,e[30]=f,e[31]=v):v=e[31];let _;e[32]!==c?(_=c&&t.jsx("p",{role:"alert",children:c}),e[32]=c,e[33]=_):_=e[33];let $;e[34]!==v||e[35]!==_?($=t.jsxs("div",{className:"cold-open-controls",children:[v,_]}),e[34]=v,e[35]=_,e[36]=$):$=e[36];let A;return e[37]!==$||e[38]!==b?(A=t.jsxs("div",{className:"cold-open-review-body",children:[b,$]}),e[37]=$,e[38]=b,e[39]=A):A=e[39],A}const ys={en:"EN",th:"TH · ไทย"};function ws(i){if(!i)return"Media details unavailable";const e=[i.duration?sl(i.duration):null,i.width&&i.height?`${i.width}×${i.height}`:null].filter(Boolean);return e.length?e.join(" · "):i.type}function Ns(i){const e=de.c(34),{post:s,asset:l,onOpenPost:n}=i,a=!!s.definition.source?.snapshotArtifactId;let r;e[0]!==l||e[1]!==s.address?(r=l?.mediaUrl&&l.type==="image"?t.jsx("img",{src:l.mediaUrl,alt:""}):l?.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,muted:!0,playsInline:!0,preload:"metadata","aria-label":`${s.address} clip`}):t.jsx("span",{className:"post-delivery-media-fallback",children:t.jsx(Ut,{size:18,"aria-hidden":"true"})}),e[0]=l,e[1]=s.address,e[2]=r):r=e[2];const u=r,c=`post-delivery-post${a?"":" post-delivery-post-blocked"}`,p=`Post ${s.address}`;let o;e[3]!==u?(o=t.jsx("div",{className:"post-delivery-media",children:u}),e[3]=u,e[4]=o):o=e[4];const f=l?.label??s.label;let d;e[5]!==s.address||e[6]!==f?(d=t.jsxs("strong",{children:[s.address," · ",f]}),e[5]=s.address,e[6]=f,e[7]=d):d=e[7];let m;e[8]!==l?(m=ws(l),e[8]=l,e[9]=m):m=e[9];let h;e[10]!==m?(h=t.jsx("span",{children:m}),e[10]=m,e[11]=h):h=e[11];let x;e[12]!==a||e[13]!==s.definition.createdAt?(x=a?t.jsxs("span",{children:["Clip saved ",new Date(s.definition.createdAt).toLocaleString()]}):t.jsxs("span",{className:"post-delivery-warning",children:[t.jsx(ft,{size:12,"aria-hidden":"true"}),"No saved source clip"]}),e[12]=a,e[13]=s.definition.createdAt,e[14]=x):x=e[14];let g;e[15]!==s.runtime.icloud?.completedAt?(g=s.runtime.icloud?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(ut,{size:12,"aria-hidden":"true"}),"Already on iPhone; saving again checks the files"]}),e[15]=s.runtime.icloud?.completedAt,e[16]=g):g=e[16];let S;e[17]!==s.runtime.dropbox?.completedAt?(S=s.runtime.dropbox?.completedAt&&t.jsxs("span",{className:"post-delivery-done",children:[t.jsx(ut,{size:12,"aria-hidden":"true"}),"Already in Dropbox; uploading again checks the files"]}),e[17]=s.runtime.dropbox?.completedAt,e[18]=S):S=e[18];let j;e[19]!==a||e[20]!==n?(j=!a&&t.jsx("button",{type:"button",onClick:n,children:"Choose a clip in the Post panel"}),e[19]=a,e[20]=n,e[21]=j):j=e[21];let C;e[22]!==g||e[23]!==S||e[24]!==j||e[25]!==d||e[26]!==h||e[27]!==x?(C=t.jsxs("div",{className:"post-delivery-post-copy",children:[d,h,x,g,S,j]}),e[22]=g,e[23]=S,e[24]=j,e[25]=d,e[26]=h,e[27]=x,e[28]=C):C=e[28];let y;return e[29]!==C||e[30]!==c||e[31]!==p||e[32]!==o?(y=t.jsxs("article",{className:c,"aria-label":p,children:[o,C]}),e[29]=C,e[30]=c,e[31]=p,e[32]=o,e[33]=y):y=e[33],y}function Ss(i){const e=de.c(17),{review:s,disabled:l,onCopyChange:n,onLanguage:a}=i,r=s.copy;let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"post-delivery-heading",children:"Platform"}),e[0]=u):u=e[0];let c;e[1]!==r||e[2]!==l||e[3]!==n?(c=al.map(h=>t.jsx("button",{type:"button","aria-pressed":r.platform===h.id,disabled:l,onClick:()=>n({...r,platform:h.id}),children:h.label},h.id)),e[1]=r,e[2]=l,e[3]=n,e[4]=c):c=e[4];let p;e[5]!==c?(p=t.jsxs("div",{className:"post-copy-group",children:[u,t.jsx("div",{className:"post-delivery-switch",role:"group","aria-label":"Platform",children:c})]}),e[5]=c,e[6]=p):p=e[6];let o;e[7]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("span",{className:"post-delivery-heading",children:"Language"}),e[7]=o):o=e[7];let f;e[8]!==r||e[9]!==l||e[10]!==a?(f=rl.map(h=>t.jsx("button",{type:"button","aria-pressed":r.language===h,disabled:l,onClick:()=>a(h),children:ys[h]},h)),e[8]=r,e[9]=l,e[10]=a,e[11]=f):f=e[11];let d;e[12]!==f?(d=t.jsxs("div",{className:"post-copy-group",children:[o,t.jsx("div",{className:"post-delivery-switch",role:"group","aria-label":"Caption language",children:f})]}),e[12]=f,e[13]=d):d=e[13];let m;return e[14]!==p||e[15]!==d?(m=t.jsxs("div",{className:"post-copy-toolbar",children:[p,d]}),e[14]=p,e[15]=d,e[16]=m):m=e[16],m}function Cs(i){const e=de.c(21),{copy:s,disabled:l,onCopyChange:n}=i,a=s.tracks[s.language];if(!a||a.versions.length<2)return null;const r=l||a.index===0;let u;e[0]!==s||e[1]!==n?(u=()=>n(pt(s,-1)),e[0]=s,e[1]=n,e[2]=u):u=e[2];let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(us,{size:12,"aria-hidden":"true"}),e[3]=c):c=e[3];let p;e[4]!==r||e[5]!==u?(p=t.jsx("button",{type:"button","aria-label":"Previous caption version",disabled:r,onClick:u,children:c}),e[4]=r,e[5]=u,e[6]=p):p=e[6];const o=a.index+1;let f;e[7]!==o||e[8]!==a.versions.length?(f=t.jsxs("small",{children:["v",o,"/",a.versions.length]}),e[7]=o,e[8]=a.versions.length,e[9]=f):f=e[9];const d=l||a.index===a.versions.length-1;let m;e[10]!==s||e[11]!==n?(m=()=>n(pt(s,1)),e[10]=s,e[11]=n,e[12]=m):m=e[12];let h;e[13]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(hs,{size:12,"aria-hidden":"true"}),e[13]=h):h=e[13];let x;e[14]!==d||e[15]!==m?(x=t.jsx("button",{type:"button","aria-label":"Next caption version",disabled:d,onClick:m,children:h}),e[14]=d,e[15]=m,e[16]=x):x=e[16];let g;return e[17]!==x||e[18]!==p||e[19]!==f?(g=t.jsxs("span",{className:"post-copy-versions",children:[p,f,x]}),e[17]=x,e[18]=p,e[19]=f,e[20]=g):g=e[20],g}function ks(i){const e=de.c(37),{copy:s,disabled:l,onCopyChange:n}=i,[a,r]=je.useState("");let u,c,p,o,f,d,m,h;if(e[0]!==s||e[1]!==l||e[2]!==a||e[3]!==n){h=It(s)?.tags??[];let y;e[12]!==s||e[13]!==a||e[14]!==n?(y=()=>{a.trim()&&(n(ol(s,a)),r(""))},e[12]=s,e[13]=a,e[14]=n,e[15]=y):y=e[15],u=y,c=b=>{b.key==="Enter"||b.key===","?(b.preventDefault(),u()):b.key==="Backspace"&&!a&&h.length&&n(xt(s,h[h.length-1]))},d="post-copy-tags";let k;e[16]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("label",{htmlFor:"post-delivery-tag",children:"Tags"}),e[16]=k):k=e[16],m=t.jsxs("div",{className:"post-delivery-label-row",children:[k,t.jsxs("small",{children:[h.length," · added after the caption"]})]}),p="post-copy-tag-field",o=s.language;let w;e[17]!==s||e[18]!==l||e[19]!==n?(w=b=>t.jsxs("span",{className:"post-copy-tag",children:["#",b,t.jsx("button",{type:"button","aria-label":`Remove tag ${b}`,disabled:l,onClick:()=>n(xt(s,b)),children:t.jsx(Qt,{size:11,"aria-hidden":"true"})})]},b),e[17]=s,e[18]=l,e[19]=n,e[20]=w):w=e[20],f=h.map(w),e[0]=s,e[1]=l,e[2]=a,e[3]=n,e[4]=u,e[5]=c,e[6]=p,e[7]=o,e[8]=f,e[9]=d,e[10]=m,e[11]=h}else u=e[4],c=e[5],p=e[6],o=e[7],f=e[8],d=e[9],m=e[10],h=e[11];const x=h.length?"+ tag":"Add a tag, then Enter";let g;e[21]===Symbol.for("react.memo_cache_sentinel")?(g=y=>r(y.target.value),e[21]=g):g=e[21];let S;e[22]!==u||e[23]!==l||e[24]!==a||e[25]!==c||e[26]!==x?(S=t.jsx("input",{id:"post-delivery-tag",type:"text",value:a,disabled:l,spellCheck:!1,placeholder:x,onChange:g,onKeyDown:c,onBlur:u}),e[22]=u,e[23]=l,e[24]=a,e[25]=c,e[26]=x,e[27]=S):S=e[27];let j;e[28]!==p||e[29]!==o||e[30]!==f||e[31]!==S?(j=t.jsxs("div",{className:p,lang:o,children:[f,S]}),e[28]=p,e[29]=o,e[30]=f,e[31]=S,e[32]=j):j=e[32];let C;return e[33]!==d||e[34]!==m||e[35]!==j?(C=t.jsxs("div",{className:d,children:[m,j]}),e[33]=d,e[34]=m,e[35]=j,e[36]=C):C=e[36],C}function Ps(i){const e=de.c(34),{copy:s,disabled:l,onCopyChange:n,onRegen:a}=i;let r;e[0]!==s||e[1]!==n?(r=w=>n({...s,prompt:s.prompt.trim()?`${s.prompt.trim()}, ${w.toLowerCase()}`:w}),e[0]=s,e[1]=n,e[2]=r):r=e[2];const u=r;let c;e[3]!==l||e[4]!==a?(c=w=>{w.key!=="Enter"||w.metaKey||w.ctrlKey||(w.preventDefault(),l||a())},e[3]=l,e[4]=a,e[5]=c):c=e[5];const p=c;let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("label",{htmlFor:"post-delivery-astra",children:"Regen with Astra"}),e[6]=o):o=e[6];const f=Ft[s.platform],d=Lt[s.language];let m;e[7]!==f||e[8]!==d?(m=t.jsxs("div",{className:"post-delivery-label-row",children:[o,t.jsxs("small",{children:["video analysis + your note · ",f," · ",d]})]}),e[7]=f,e[8]=d,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==n?(h=w=>n({...s,prompt:w.target.value}),e[10]=s,e[11]=n,e[12]=h):h=e[12];let x;e[13]!==s.prompt||e[14]!==l||e[15]!==p||e[16]!==h?(x=t.jsx("input",{id:"post-delivery-astra",type:"text",value:s.prompt,disabled:l,maxLength:1e3,placeholder:"Tell Astra how to rewrite — punchier hook, mention the rain, 3 tags…",onChange:h,onKeyDown:p}),e[13]=s.prompt,e[14]=l,e[15]=p,e[16]=h,e[17]=x):x=e[17];let g;e[18]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Vt,{size:12,"aria-hidden":"true"}),e[18]=g):g=e[18];let S;e[19]!==l||e[20]!==a?(S=t.jsxs("button",{type:"button",className:"post-copy-regen-button",disabled:l,onClick:a,children:[g,"Regen post"]}),e[19]=l,e[20]=a,e[21]=S):S=e[21];let j;e[22]!==S||e[23]!==x?(j=t.jsxs("div",{className:"post-copy-regen-row",children:[x,S]}),e[22]=S,e[23]=x,e[24]=j):j=e[24];let C;e[25]!==u||e[26]!==l?(C=nl.map(w=>t.jsx("button",{type:"button",disabled:l,onClick:()=>u(w),children:w},w)),e[25]=u,e[26]=l,e[27]=C):C=e[27];let y;e[28]!==C?(y=t.jsx("div",{className:"post-copy-presets",children:C}),e[28]=C,e[29]=y):y=e[29];let k;return e[30]!==j||e[31]!==y||e[32]!==m?(k=t.jsxs("div",{className:"post-copy-regen",children:[m,j,y]}),e[30]=j,e[31]=y,e[32]=m,e[33]=k):k=e[33],k}function _s(i){const e=de.c(84),{post:s,review:l,busy:n,onCopyChange:a,onLanguage:r,onRegen:u}=i;let c;e[0]!==s?(c=Zt(s),e[0]=s,e[1]=c):c=e[1];const p=c,o=l.copy,f=o.drafting?.language===o.language,d=n||p;let m,h,x,g,S,j,C,y,k,w,b;if(e[2]!==o||e[3]!==d||e[4]!==a||e[5]!==r||e[6]!==l){const V=el(o);let U;e[18]!==o?(U=It(o),e[18]=o,e[19]=U):U=e[19],b=U;const B=b&&b.origin!=="saved"&&b.origin!=="edited";m="post-delivery-caption";const L=d||!!o.drafting;e[20]!==a||e[21]!==r||e[22]!==l||e[23]!==L?(h=t.jsx(Ss,{review:l,disabled:L,onCopyChange:a,onLanguage:r}),e[20]=a,e[21]=r,e[22]=l,e[23]=L,e[24]=h):h=e[24],k="post-delivery-label-row";let H;e[25]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx("label",{htmlFor:"post-delivery-caption",children:"Caption"}),e[25]=H):H=e[25];let T;e[26]!==B?(T=B&&t.jsxs("span",{className:"post-copy-badge",children:[t.jsx(Vt,{size:10,"aria-hidden":"true"}),"Auto · from video analysis"]}),e[26]=B,e[27]=T):T=e[27],e[28]!==T?(w=t.jsxs("span",{className:"post-copy-caption-label",children:[H,T]}),e[28]=T,e[29]=w):w=e[29],C="post-copy-caption-meta";const O=d||!!o.drafting;e[30]!==o||e[31]!==a||e[32]!==O?(y=t.jsx(Cs,{copy:o,disabled:O,onCopyChange:a}),e[30]=o,e[31]=a,e[32]=O,e[33]=y):y=e[33],x=V.over||V.length>il?"confirm-field-error":void 0,g=V.length.toLocaleString(),S=" / ",j=V.limit.toLocaleString(),e[2]=o,e[3]=d,e[4]=a,e[5]=r,e[6]=l,e[7]=m,e[8]=h,e[9]=x,e[10]=g,e[11]=S,e[12]=j,e[13]=C,e[14]=y,e[15]=k,e[16]=w,e[17]=b}else m=e[7],h=e[8],x=e[9],g=e[10],S=e[11],j=e[12],C=e[13],y=e[14],k=e[15],w=e[16],b=e[17];let v;e[34]!==x||e[35]!==g||e[36]!==S||e[37]!==j?(v=t.jsxs("small",{className:x,children:[g,S,j]}),e[34]=x,e[35]=g,e[36]=S,e[37]=j,e[38]=v):v=e[38];let _;e[39]!==v||e[40]!==C||e[41]!==y?(_=t.jsxs("span",{className:C,children:[y,v]}),e[39]=v,e[40]=C,e[41]=y,e[42]=_):_=e[42];let $;e[43]!==_||e[44]!==k||e[45]!==w?($=t.jsxs("div",{className:k,children:[w,_]}),e[43]=_,e[44]=k,e[45]=w,e[46]=$):$=e[46];let A;e[47]!==n||e[48]!==o||e[49]!==f||e[50]!==p||e[51]!==a||e[52]!==s||e[53]!==b?.body?(A=f?t.jsxs("div",{className:"post-copy-drafting",role:"status",children:["Astra is writing the ",Lt[o.language]," caption for ",Ft[o.platform],"…"]}):t.jsx("textarea",{id:"post-delivery-caption",lang:o.language,value:p?s.definition.caption:b?.body??"",disabled:n,readOnly:p,placeholder:"Write the caption that ships with this clip…",onChange:V=>a(tl(o,{body:V.target.value}))}),e[47]=n,e[48]=o,e[49]=f,e[50]=p,e[51]=a,e[52]=s,e[53]=b?.body,e[54]=A):A=e[54];let N;e[55]!==o.error?(N=o.error&&t.jsx("small",{className:"confirm-field-error",children:o.error}),e[55]=o.error,e[56]=N):N=e[56];let E;e[57]!==o||e[58]!==d||e[59]!==f||e[60]!==p||e[61]!==a?(E=!p&&t.jsx(ks,{copy:o,disabled:d||f,onCopyChange:a}),e[57]=o,e[58]=d,e[59]=f,e[60]=p,e[61]=a,e[62]=E):E=e[62];let I;e[63]!==o||e[64]!==p||e[65]!==s?(I=p?"Frozen at the first delivery. Create a new Post to change it.":`${ll(o)} · Saved to ${s.address} and written to caption.txt${s.definition.credits?" with its credits":""}.`,e[63]=o,e[64]=p,e[65]=s,e[66]=I):I=e[66];let F;e[67]!==I?(F=t.jsx("small",{children:I}),e[67]=I,e[68]=F):F=e[68];let M;e[69]!==n||e[70]!==o||e[71]!==p||e[72]!==a||e[73]!==u?(M=!p&&t.jsx(Ps,{copy:o,disabled:n||!!o.drafting,onCopyChange:a,onRegen:u}),e[69]=n,e[70]=o,e[71]=p,e[72]=a,e[73]=u,e[74]=M):M=e[74];let D;return e[75]!==m||e[76]!==h||e[77]!==$||e[78]!==A||e[79]!==N||e[80]!==E||e[81]!==F||e[82]!==M?(D=t.jsxs("div",{className:m,children:[h,$,A,N,E,F,M]}),e[75]=m,e[76]=h,e[77]=$,e[78]=A,e[79]=N,e[80]=E,e[81]=F,e[82]=M,e[83]=D):D=e[83],D}function Es(i){const e=de.c(19),{review:s,busy:l,onConnect:n,onCheckConnection:a}=i,r=s.connection;if(!r){let x;return e[0]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("p",{className:"post-delivery-account",children:"Checking Dropbox…"}),e[0]=x):x=e[0],x}if(r.connected){let x;return e[1]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("p",{className:"post-delivery-account post-delivery-account-ready",children:[t.jsx(ut,{size:12,"aria-hidden":"true"}),"Dropbox connected"]}),e[1]=x):x=e[1],x}const u=s.connecting||r.pending?"Waiting for Dropbox approval…":"Dropbox not connected";let c;e[2]!==u?(c=t.jsx("span",{children:u}),e[2]=u,e[3]=c):c=e[3];const p=l||s.connecting||!r.hasCredentials;let o;e[4]!==n||e[5]!==p?(o=t.jsx("button",{type:"button",disabled:p,onClick:n,children:"Connect Dropbox ↗"}),e[4]=n,e[5]=p,e[6]=o):o=e[6];let f;e[7]!==l||e[8]!==a?(f=t.jsx("button",{type:"button",disabled:l,onClick:a,children:"Check again"}),e[7]=l,e[8]=a,e[9]=f):f=e[9];let d;e[10]!==o||e[11]!==f?(d=t.jsxs("div",{children:[o,f]}),e[10]=o,e[11]=f,e[12]=d):d=e[12];let m;e[13]!==r.error?(m=r.error&&t.jsx("small",{className:"confirm-field-error",children:r.error}),e[13]=r.error,e[14]=m):m=e[14];let h;return e[15]!==c||e[16]!==d||e[17]!==m?(h=t.jsxs("div",{className:"post-delivery-account post-delivery-account-missing",children:[c,d,m]}),e[15]=c,e[16]=d,e[17]=m,e[18]=h):h=e[18],h}function $s(i){return i.trim().replace(/\/+$/u,"")||"…"}function Cn(i){const e=de.c(66),s=i.review.destination==="icloud",l=s?i.review.icloudFolder:i.review.dropboxFolder;let n;e[0]!==s||e[1]!==i.review.dropboxFolder||e[2]!==i.review.icloudFolder?(n=s?Kt(i.review.icloudFolder):Yt(i.review.dropboxFolder),e[0]=s,e[1]=i.review.dropboxFolder,e[2]=i.review.icloudFolder,e[3]=n):n=e[3];const a=n;let r;e[4]!==i.review.icloud?(r=Xt(i.review.icloud),e[4]=i.review.icloud,e[5]=r):r=e[5];const u=r;let c;e[6]!==s||e[7]!==i.review.receipt||e[8]!==i.review.sync?.error||e[9]!==i.review.sync?.phase?(c=i.review.receipt&&s?Jt(i.review.sync?.phase??null,i.review.sync?.error):null,e[6]=s,e[7]=i.review.receipt,e[8]=i.review.sync?.error,e[9]=i.review.sync?.phase,e[10]=c):c=e[10];const p=c,o=i.review.icloud&&!i.review.icloud.available?i.review.icloud.reason??"iCloud Drive isn't available on this Mac.":null;let f;e[11]!==i.asset||e[12]!==i.onOpenPost||e[13]!==i.post?(f=t.jsx(Ns,{post:i.post,asset:i.asset,onOpenPost:i.onOpenPost}),e[11]=i.asset,e[12]=i.onOpenPost,e[13]=i.post,e[14]=f):f=e[14];let d;e[15]!==i.busy||e[16]!==i.onCopyChange||e[17]!==i.onLanguage||e[18]!==i.onRegen||e[19]!==i.post||e[20]!==i.review?(d=t.jsx(_s,{post:i.post,review:i.review,busy:i.busy,onCopyChange:i.onCopyChange,onLanguage:i.onLanguage,onRegen:i.onRegen}),e[15]=i.busy,e[16]=i.onCopyChange,e[17]=i.onLanguage,e[18]=i.onRegen,e[19]=i.post,e[20]=i.review,e[21]=d):d=e[21];let m;e[22]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("span",{className:"post-delivery-heading",children:"Destination"}),e[22]=m):m=e[22];let h;e[23]!==i?(h=()=>i.onDestination("icloud"),e[23]=i,e[24]=h):h=e[24];let x;e[25]!==s||e[26]!==i.busy||e[27]!==h?(x=t.jsx("button",{type:"button","aria-pressed":s,disabled:i.busy,onClick:h,children:"iCloud · iPhone"}),e[25]=s,e[26]=i.busy,e[27]=h,e[28]=x):x=e[28];const g=!s;let S;e[29]!==i?(S=()=>i.onDestination("dropbox"),e[29]=i,e[30]=S):S=e[30];let j;e[31]!==i.busy||e[32]!==g||e[33]!==S?(j=t.jsx("button",{type:"button","aria-pressed":g,disabled:i.busy,onClick:S,children:"Dropbox"}),e[31]=i.busy,e[32]=g,e[33]=S,e[34]=j):j=e[34];let C;e[35]!==j||e[36]!==x?(C=t.jsxs("div",{className:"post-delivery-switch",role:"group","aria-label":"Destination",children:[x,j]}),e[35]=j,e[36]=x,e[37]=C):C=e[37];let y;e[38]!==o?(y=o&&t.jsxs("p",{className:"post-delivery-warning",children:[t.jsx(ft,{size:12,"aria-hidden":"true"}),o]}),e[38]=o,e[39]=y):y=e[39];let k;e[40]!==l||e[41]!==a||e[42]!==s||e[43]!==i||e[44]!==u?(k=s?t.jsxs(t.Fragment,{children:[u&&t.jsx("p",{className:i.review.icloud?.shared===!1?"post-delivery-warning":"post-delivery-done",children:u}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:A=>i.onFolderChange(A.target.value)}),t.jsxs("small",{children:["Appears on iPhone in Files › Shared › Videobook › ",$s(l)]})]}):t.jsxs(t.Fragment,{children:[t.jsx(Es,{review:i.review,busy:i.busy,onConnect:i.onConnect,onCheckConnection:i.onCheckConnection}),t.jsx("label",{className:"confirm-field",htmlFor:"post-delivery-folder",children:"Folder"}),t.jsx("input",{id:"post-delivery-folder",type:"text",value:l,disabled:i.busy,spellCheck:!1,"aria-invalid":a?!0:void 0,onChange:A=>i.onFolderChange(A.target.value)}),t.jsx("small",{children:"Uploads clip and caption.txt here. Other files in the folder are kept."})]}),e[40]=l,e[41]=a,e[42]=s,e[43]=i,e[44]=u,e[45]=k):k=e[45];let w;e[46]!==i.review.receipt?(w=i.review.receipt&&t.jsx("p",{className:"post-delivery-receipt",children:i.review.receipt}),e[46]=i.review.receipt,e[47]=w):w=e[47];let b;e[48]!==p?(b=p&&t.jsx("p",{className:"post-delivery-progress",children:p}),e[48]=p,e[49]=b):b=e[49];let v;e[50]!==i.busy||e[51]!==i.onLink||e[52]!==i.post||e[53]!==i.review.copy?(v=!i.post.runtime.url&&t.jsx(as,{post:i.post,disabled:i.busy||!!i.review.copy.drafting,className:"post-delivery-link",onLink:i.onLink}),e[50]=i.busy,e[51]=i.onLink,e[52]=i.post,e[53]=i.review.copy,e[54]=v):v=e[54];let _;e[55]!==C||e[56]!==y||e[57]!==k||e[58]!==w||e[59]!==b||e[60]!==v?(_=t.jsxs("div",{className:"post-delivery-destination",children:[m,C,y,k,w,b,v]}),e[55]=C,e[56]=y,e[57]=k,e[58]=w,e[59]=b,e[60]=v,e[61]=_):_=e[61];let $;return e[62]!==_||e[63]!==f||e[64]!==d?($=t.jsxs("div",{className:"post-delivery-body",children:[f,d,_]}),e[62]=_,e[63]=f,e[64]=d,e[65]=$):$=e[65],$}const As=new Map;function Pt(i){const e=i.cell.inputs;return e&&typeof e.generationMode=="string"?e.generationMode:""}function Rs(i,e){const s=new Map;for(const l of i)if(l.asset)for(const n of[l.cellId,`@${l.address}`,l.asset.artifactId,`@${l.asset.artifactId}`,l.asset.mediaUrl,l.asset.thumbnailUrl])n&&s.set(n,l.asset);for(const l of Mt(e).urlPlaceholders){const n=s.get(l.reference);n&&s.set(l.url,n)}return s}function _t(i){const e=de.c(25),{badge:s,busy:l,onClick:n,source:a,title:r}=i;let u;e[0]!==s?(u=t.jsx("span",{className:"generation-review-source-badge",children:s}),e[0]=s,e[1]=u):u=e[1];let c;e[2]!==a.asset||e[3]!==a.type?(c=a.asset??{type:a.type,mediaUrl:null,thumbnailUrl:null,duration:null},e[2]=a.asset,e[3]=a.type,e[4]=c):c=e[4];let p;e[5]!==c?(p=t.jsx("span",{className:"generation-review-source-preview",children:t.jsx(Ht,{asset:c,eager:!0})}),e[5]=c,e[6]=p):p=e[6];const o=a.mention??a.address;let f;e[7]!==o?(f=t.jsxs("strong",{children:["@",o]}),e[7]=o,e[8]=f):f=e[8];const d=a.mention?`@${a.address} · `:"";let m;e[9]!==a.targetLabel||e[10]!==a.type?(m=a.targetLabel??a.type.replaceAll("_"," "),e[9]=a.targetLabel,e[10]=a.type,e[11]=m):m=e[11];let h;e[12]!==d||e[13]!==m?(h=t.jsxs("small",{children:[d,m]}),e[12]=d,e[13]=m,e[14]=h):h=e[14];let x;e[15]!==f||e[16]!==h?(x=t.jsxs("span",{className:"generation-review-source-copy",children:[f,h]}),e[15]=f,e[16]=h,e[17]=x):x=e[17];let g;return e[18]!==l||e[19]!==n||e[20]!==u||e[21]!==p||e[22]!==x||e[23]!==r?(g=t.jsxs("button",{type:"button",className:"generation-review-source",disabled:l,onClick:n,title:r,children:[u,p,x]}),e[18]=l,e[19]=n,e[20]=u,e[21]=p,e[22]=x,e[23]=r,e[24]=g):g=e[24],g}function kn(i){const e=de.c(153),{actions:s,busy:l,draft:n,modes:a,preview:r,previewError:u,previewLoading:c,previewStale:p,sources:o,sourceOptions:f,voiceCatalog:d,promptEditor:m,promptHistory:h,inputFooter:x,compatibleModeIds:g,sourceVisible:S,notebookId:j,doltArtifactAssets:C,onActionChange:y,onAddSource:k,onModeChange:w,onPromptChange:b,onRefreshPreview:v,onRemoveSource:_,onSelectSource:$,onSettingChange:A}=i,N=S===void 0?!1:S,E=j===void 0?"":j,[I,F]=je.useState(!1),M=cl(n.cell.type,Pt(n),n.action.operation,o),D=dl(s,M);let V;e[0]!==n?(V=ml(n),e[0]=n,e[1]=V):V=e[1];const U=V;let B;e[2]!==n.cell.inputs?(B=n.cell.inputs??{},e[2]=n.cell.inputs,e[3]=B):B=e[3];let L;e[4]!==n.action.model||e[5]!==B?(L=ul(n.action.model,B),e[4]=n.action.model,e[5]=B,e[6]=L):L=e[6];const H=L,T=hl();let O;e[7]!==d?(O=()=>{d&&d.ensureLoaded().catch(qs)},e[7]=d,e[8]=O):O=e[8];const Y=O;let X;e[9]!==d?(X=()=>{d&&d.refresh().catch(Qs)},e[9]=d,e[10]=X):X=e[10];const te=X;let W;e[11]!==n.action.controls||e[12]!==n.cell.type?(W=n.cell.type==="generate_audio"?n.action.controls.find(Vs):void 0,e[11]=n.action.controls,e[12]=n.cell.type,e[13]=W):W=e[13];const z=W;let G;e[14]!==d?.voices||e[15]!==z?(G=z?d?.voices??[]:[],e[14]=d?.voices,e[15]=z,e[16]=G):G=e[16];const K=G,Z=K.length>0,ge=typeof U.voice_id=="string"?U.voice_id:"";let se;e[17]!==n.action.model?(se=fl(n.action.model),e[17]=n.action.model,e[18]=se):se=e[18];const be=se,ne=n.cell.inputs?.generationMode??n.cell.inputs?.mode;let pe;e[19]!==n.action.model||e[20]!==ne?(pe=pl(n.action.model,ne),e[19]=n.action.model,e[20]=ne,e[21]=pe):pe=e[21];const oe=pe,we=oe?n.action.controls.filter(Us):be?n.action.controls.filter(Hs):n.action.controls,ie=Z?n.action.controls.filter(Os):we,me=ie.filter(Ds),ce=ie.filter(Ms);let le;e[22]!==r?(le=yl(r),e[22]=r,e[23]=le):le=e[23];const J=le;let ue;e[24]!==r||e[25]!==o?(ue=Rs(o,r),e[24]=r,e[25]=o,e[26]=ue):ue=e[26];const ae=ue,re=xl(r),Se=p?[]:Mt(r).promptLeaks;let ve;e[27]!==n.action.model||e[28]!==n.action.provider||e[29]!==n.action.tool||e[30]!==n.cell.inputs||e[31]!==n.cell.prompt||e[32]!==J?(ve=J??{status:"unresolved_draft",message:"The server preview has not resolved this draft yet.",payload:null,draft:{tool:n.action.tool,provider:n.action.provider,model:n.action.model,prompt:n.cell.prompt,inputs:n.cell.inputs??{}}},e[27]=n.action.model,e[28]=n.action.provider,e[29]=n.action.tool,e[30]=n.cell.inputs,e[31]=n.cell.prompt,e[32]=J,e[33]=ve):ve=e[33];const ye=ve;let Ce;e[34]!==n.cell||e[35]!==E||e[36]!==N?(Ce=N?gl(E,n.cell).length:0,e[34]=n.cell,e[35]=E,e[36]=N,e[37]=Ce):Ce=e[37];const xe=Ce;let Ne;e[38]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("span",{className:"confirm-section-label",children:"Inputs"}),e[38]=Ne):Ne=e[38];let fe;if(e[39]!==l||e[40]!==_||e[41]!==$||e[42]!==o){let q;e[44]!==l||e[45]!==_||e[46]!==$?(q=Be=>t.jsxs("div",{className:"generation-review-source-wrap",children:[t.jsx(_t,{badge:"Input",busy:l,source:Be,title:`Select @${Be.address} on the board`,onClick:()=>$(Be.cellId)}),t.jsx("button",{type:"button",className:"generation-review-source-remove",disabled:l,"aria-label":`Remove @${Be.address} input`,title:`Remove @${Be.address} input`,onClick:()=>_(Be.cellId,Be.targetInput),children:t.jsx(Qt,{size:11,"aria-hidden":"true"})})]},`${Be.cellId}:${Be.targetInput??""}`),e[44]=l,e[45]=_,e[46]=$,e[47]=q):q=e[47],fe=o.map(q),e[39]=l,e[40]=_,e[41]=$,e[42]=o,e[43]=fe}else fe=e[43];let ee;e[48]!==o.length?(ee=o.length===0&&t.jsxs("div",{className:"generation-review-text-input",children:[t.jsx("span",{children:"Input"}),t.jsx("strong",{children:"Prompt only"}),t.jsx("small",{children:"No source media attached"})]}),e[48]=o.length,e[49]=ee):ee=e[49];let Ee;e[50]!==l||e[51]!==I||e[52]!==f.length?(Ee=f.length>0&&t.jsxs("button",{type:"button",className:"generation-review-source-add",disabled:l,"aria-expanded":I,onClick:()=>F(Fs),children:[t.jsx(fs,{size:14,"aria-hidden":"true"}),t.jsx("span",{children:"Add input"})]}),e[50]=l,e[51]=I,e[52]=f.length,e[53]=Ee):Ee=e[53];let $e;e[54]!==fe||e[55]!==ee||e[56]!==Ee?($e=t.jsxs("div",{className:"generation-review-sources",children:[fe,ee,Ee]}),e[54]=fe,e[55]=ee,e[56]=Ee,e[57]=$e):$e=e[57];let ke;e[58]!==l||e[59]!==k||e[60]!==I||e[61]!==f?(ke=I&&f.length>0&&t.jsx("div",{className:"generation-review-sources generation-review-source-options","aria-label":"Available input cells",children:f.map(q=>t.jsx(_t,{badge:"Add",busy:l,source:q,title:`Add @${q.address} as ${q.targetLabel??"input"}`,onClick:()=>{k(q.cellId,q.targetInput),F(!1)}},`${q.cellId}:${q.targetInput??""}`))}),e[58]=l,e[59]=k,e[60]=I,e[61]=f,e[62]=ke):ke=e[62];let Re;e[63]!==x||e[64]!==$e||e[65]!==ke?(Re=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Inputs",children:[Ne,$e,ke,x]}),e[63]=x,e[64]=$e,e[65]=ke,e[66]=Re):Re=e[66];let Te;e[67]===Symbol.for("react.memo_cache_sentinel")?(Te=t.jsx("span",{className:"confirm-section-label",children:"Model"}),e[67]=Te):Te=e[67];const Oe=n.action.id,De=l||s.length===0;let Pe;e[68]!==y?(Pe=q=>y(q.target.value),e[68]=y,e[69]=Pe):Pe=e[69];const ze=D.map(Is);let _e;e[70]!==n.action.id||e[71]!==De||e[72]!==Pe||e[73]!==ze?(_e=t.jsxs("label",{children:[Te,t.jsx("select",{"aria-label":"Generation model",value:Oe,disabled:De,onChange:Pe,children:ze})]}),e[70]=n.action.id,e[71]=De,e[72]=Pe,e[73]=ze,e[74]=_e):_e=e[74];let Fe;e[75]!==l||e[76]!==g||e[77]!==n||e[78]!==a||e[79]!==w?(Fe=a.length>1&&t.jsxs("label",{children:[t.jsx("span",{className:"confirm-section-label",children:"Type"}),t.jsx("select",{"aria-label":"Generation type",value:Pt(n),disabled:l,onChange:q=>w(q.target.value),children:a.map(q=>t.jsxs("option",{value:q.id,children:[bl(q.id),g&&!g.has(q.id)?" · check inputs":""]},q.id))})]}),e[75]=l,e[76]=g,e[77]=n,e[78]=a,e[79]=w,e[80]=Fe):Fe=e[80];let Ie;e[81]!==_e||e[82]!==Fe?(Ie=t.jsxs("section",{className:"generation-review-model-section","aria-label":"Model",children:[_e,Fe]}),e[81]=_e,e[82]=Fe,e[83]=Ie):Ie=e[83];let Le;e[84]!==l||e[85]!==n.action.controls||e[86]!==be||e[87]!==A||e[88]!==U||e[89]!==o?(Le=be&&t.jsx(rs,{sources:o,settings:U,controls:n.action.controls,busy:l,onChange:A}),e[84]=l,e[85]=n.action.controls,e[86]=be,e[87]=A,e[88]=U,e[89]=o,e[90]=Le):Le=e[90];let He;e[91]!==oe?(He=oe&&t.jsx("p",{className:"muted",children:wl}),e[91]=oe,e[92]=He):He=e[92];let P;e[93]!==H?(P=H&&t.jsx("p",{className:"muted",children:Nl}),e[93]=H,e[94]=P):P=e[94];let he;e[95]!==l||e[96]!==Y||e[97]!==H||e[98]!==A||e[99]!==U?(he=q=>t.jsx(Ct,{control:q,settings:U,busy:l||q.name==="aspect_ratio"&&!!H,toggleClassName:"generation-review-toggle",onFocus:q.name==="voice_id"?Y:void 0,onChange:Be=>A(q.name,Be)},q.name),e[95]=l,e[96]=Y,e[97]=H,e[98]=A,e[99]=U,e[100]=he):he=e[100];let Ue;e[101]!==l||e[102]!==A||e[103]!==T||e[104]!==te||e[105]!==ge||e[106]!==Z||e[107]!==d||e[108]!==z||e[109]!==K?(Ue=z&&d&&t.jsxs("section",{className:"generation-review-voice-section","aria-label":"Voice",children:[t.jsx("span",{className:"confirm-section-label",children:"Voice"}),Z&&t.jsx("div",{className:"generation-review-voices",role:"listbox","aria-label":"ElevenLabs voices","data-testid":"generation-review-voices",children:t.jsx(os,{voices:K,selectedVoiceId:ge,playingVoiceId:T.playingVoiceId,disabled:l,onSelect:q=>{vl(q),A("voice_id",q)},onTogglePreview:T.toggle})}),d.loading&&K.length===0&&t.jsx("small",{children:"Loading voices…"}),d.error&&t.jsx("small",{role:"alert",children:d.error}),t.jsx("button",{type:"button",disabled:l||d.loading,onClick:te,children:d.loading?"Loading voices…":d.error?"Retry voices":Z?"Refresh voices":"Load voices"}),d?.warning&&t.jsx("small",{children:d.warning})]}),e[101]=l,e[102]=A,e[103]=T,e[104]=te,e[105]=ge,e[106]=Z,e[107]=d,e[108]=z,e[109]=K,e[110]=Ue):Ue=e[110];const Ge=m??t.jsxs("div",{className:"generation-review-prompt-field",children:[t.jsxs("div",{className:"confirm-section-heading",children:[t.jsx("span",{children:"Prompt"}),h&&t.jsx(cs,{history:h,disabled:l})]}),t.jsx("textarea",{rows:3,"aria-label":"Prompt",value:n.cell.prompt??"","aria-invalid":Se.length>0,disabled:l,onChange:q=>b(q.target.value),onKeyDown:q=>{h?.handlePromptKeyDown(q)}})]}),Ke=Se.length>0&&t.jsx("div",{className:"generation-review-reference-errors",role:"alert",children:Se.map(Ts)});let Ze;e[111]!==Ge||e[112]!==Ke?(Ze=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Prompt",children:[Ge,Ke]}),e[111]=Ge,e[112]=Ke,e[113]=Ze):Ze=e[113];let et;e[114]!==C||e[115]!==xe||e[116]!==n.cell||e[117]!==E||e[118]!==N?(et=N&&t.jsxs("section",{className:"confirm-section generation-review-dolt-section","aria-label":"Dolt source",children:[t.jsxs("div",{className:"confirm-section-heading",children:[t.jsx("span",{children:"Dolt source"}),t.jsxs("strong",{children:["cells · ",xe," columns"]})]}),t.jsx("div",{className:"generation-review-dolt",tabIndex:0,"aria-label":"Dolt source preview",children:t.jsx(ds,{notebookId:E,cell:n.cell,artifactAssets:C??As,heading:!1})})]}),e[114]=C,e[115]=xe,e[116]=n.cell,e[117]=E,e[118]=N,e[119]=et):et=e[119];const Ye=N?"MCP payload":"Payload",Xe=N?"MCP payload":"Payload";let Ve;e[120]!==Xe?(Ve=t.jsx("span",{children:Xe}),e[120]=Xe,e[121]=Ve):Ve=e[121];let Qe;e[122]!==c||e[123]!==p?(Qe=(p||c)&&t.jsx("small",{className:"generation-review-json-stale",role:"status",children:"Updating…"}),e[122]=c,e[123]=p,e[124]=Qe):Qe=e[124];let We;e[125]!==Ve||e[126]!==Qe?(We=t.jsxs("div",{className:"confirm-section-heading",children:[Ve,Qe]}),e[125]=Ve,e[126]=Qe,e[127]=We):We=e[127];const R=N?"MCP payload preview":"Generation payload preview";let Q;e[128]!==ae||e[129]!==u||e[130]!==ye||e[131]!==c||e[132]!==J?.payload||e[133]!==N?(Q=c?t.jsx("span",{className:"generation-review-json-status",role:"status",children:"Loading preview…"}):u?t.jsx("span",{className:"generation-review-json-status generation-review-json-error",role:"alert",children:u}):t.jsx(ms,{value:N?ye:J?.payload??null,ariaLabel:N?"MCP payload JSON":"Generation payload JSON",artifactAssets:ae,mediaDisplay:"preview"}),e[128]=ae,e[129]=u,e[130]=ye,e[131]=c,e[132]=J?.payload,e[133]=N,e[134]=Q):Q=e[134];let Ae;e[135]!==c||e[136]!==R||e[137]!==Q?(Ae=t.jsx("div",{className:"generation-review-json",tabIndex:0,"aria-label":R,"aria-busy":c,children:Q}),e[135]=c,e[136]=R,e[137]=Q,e[138]=Ae):Ae=e[138];let Me;e[139]!==Ye||e[140]!==We||e[141]!==Ae?(Me=t.jsxs("section",{className:"confirm-section generation-review-source-section","aria-label":Ye,children:[We,Ae]}),e[139]=Ye,e[140]=We,e[141]=Ae,e[142]=Me):Me=e[142];let qe;e[143]===Symbol.for("react.memo_cache_sentinel")?(qe=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[143]=qe):qe=e[143];const lt=c||p?"…":!u&&re.usd!==null&&!re.unknown?`$${re.usd.toFixed(re.usd<.01?4:2)}`:"—";let tt;e[144]!==lt?(tt=t.jsx("strong",{children:lt}),e[144]=lt,e[145]=tt):tt=e[145];const nt=c||p?"Updating estimate…":u||re.unknown||re.usd===null?"Cost estimate unavailable":jl(re.warnings)?"Historical average per call; this request can differ":"Estimated provider cost";let at;e[146]!==nt?(at=t.jsx("small",{children:nt}),e[146]=nt,e[147]=at):at=e[147];let rt;return e[148]!==l||e[149]!==v||e[150]!==u||e[151]!==c?(rt=u&&t.jsxs("button",{type:"button",disabled:l||c,onClick:v,children:[t.jsx(xs,{size:10,"aria-hidden":"true"}),"Retry preview"]}),e[148]=l,e[149]=v,e[150]=u,e[151]=c,e[152]=rt):rt=e[152],t.jsxs("div",{className:"confirm-generation","data-view":N?"source":"form",children:[Re,t.jsxs("div",{className:"confirm-section generation-review-editor",hidden:N===!0,children:[Ie,Le,t.jsxs("section",{className:"generation-review-settings-section","aria-label":"Settings",children:[He,P,t.jsxs("div",{className:"generation-review-settings",children:[me.map(he),ie.length===0&&t.jsx("span",{className:"generation-review-defaults",children:"Provider defaults"})]}),ce.length>0&&t.jsx("div",{className:"generation-review-toggles",children:ce.map(q=>t.jsx(Ct,{control:q,settings:U,busy:l,toggleClassName:"generation-review-toggle",onChange:Be=>A(q.name,Be)},q.name))})]}),Ue,Ze]}),et,Me,t.jsxs("section",{className:"confirm-section generation-review-estimate-section","aria-label":"Estimate",children:[qe,tt,t.jsx("span",{children:re.currency}),at,rt]})]})}function Ts(i){return t.jsxs("span",{title:i.message,children:[t.jsx(ps,{size:12,"aria-hidden":"true"}),t.jsx("code",{children:i.token}),i.message]},`${i.token}:${i.code}`)}function Is(i){return t.jsx("optgroup",{label:i.label,children:i.rows.map(Ls)},i.label)}function Ls(i){const{action:e,ranking:s}=i;return t.jsxs("option",{value:e.id,disabled:e.available===!1,children:[s?`#${s.rank} · `:"",e.title," · ",e.providerLabel,s?` · Elo ${s.elo} · ${s.priceLabel}`:"",e.available===!1?" · unavailable":""]},e.id)}function Fs(i){return!i}function Ms(i){return i.kind==="boolean"}function Ds(i){return i.kind!=="boolean"}function Os(i){return i.name!=="voice_id"}function Hs(i){return!["start_time","resume_time","duration"].includes(i.name)}function Us(i){return!["duration","aspect_ratio"].includes(i.name)}function Vs(i){return i.name==="voice_id"}function Qs(){}function qs(){}function Bs(i){return`$${i.toFixed(i<.01?4:2)}`}function Pn(i){const e=de.c(66),{busy:s,clip:l,choices:n,languageCode:a,diarize:r,tagAudioEvents:u,estimateUsd:c,estimateLoading:p,estimateUnavailable:o,onClipChange:f,onLanguageChange:d,onDiarizeChange:m,onTagAudioEventsChange:h}=i,x=!p&&c!==null&&!o;let g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx("span",{className:"confirm-section-label",children:"Clip"}),e[0]=g):g=e[0];let S;e[1]!==l?(S=t.jsxs("section",{className:"confirm-section generation-review-input-section","aria-label":"Clip",children:[g,l?t.jsxs("div",{className:"generation-review-source",children:[t.jsx("span",{className:"generation-review-source-badge",children:"Input"}),t.jsx("span",{className:"generation-review-source-preview",children:t.jsx(Ht,{asset:{type:l.type,mediaUrl:l.mediaUrl,thumbnailUrl:l.thumbnailUrl,duration:l.duration},eager:!0})}),t.jsxs("span",{className:"generation-review-source-copy",children:[t.jsx("strong",{children:l.label}),t.jsx("small",{children:l.type})]})]}):t.jsxs("div",{className:"generation-review-text-input",children:[t.jsx("span",{children:"Input"}),t.jsx("strong",{children:"No clip"}),t.jsx("small",{children:"Choose a video or audio clip"})]})]}),e[1]=l,e[2]=S):S=e[2];let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx("span",{children:"Clip"}),e[3]=j):j=e[3];const C=l?.artifactId??"";let y;e[4]!==f?(y=K=>f(K.target.value||null),e[4]=f,e[5]=y):y=e[5];let k;e[6]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx("option",{value:"",children:"Choose a clip"}),e[6]=k):k=e[6];let w;e[7]!==n?(w=n.map(zs),e[7]=n,e[8]=w):w=e[8];let b;e[9]!==s||e[10]!==C||e[11]!==y||e[12]!==w?(b=t.jsx("section",{className:"generation-review-settings-section","aria-label":"Clip choice",children:t.jsx("div",{className:"generation-review-settings",children:t.jsxs("label",{children:[j,t.jsxs("select",{"aria-label":"Clip",value:C,disabled:s,onChange:y,children:[k,w]})]})})}),e[9]=s,e[10]=C,e[11]=y,e[12]=w,e[13]=b):b=e[13];let v;e[14]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("div",{className:"confirm-section-heading",children:t.jsx("span",{children:"Language"})}),e[14]=v):v=e[14];let _;e[15]!==d?(_=K=>d(K.target.value),e[15]=d,e[16]=_):_=e[16];let $;e[17]!==s||e[18]!==a||e[19]!==_?($=t.jsxs("div",{className:"generation-review-prompt-field",children:[v,t.jsx("textarea",{rows:3,"aria-label":"Language",placeholder:"Auto-detect",value:a,disabled:s,onChange:_})]}),e[17]=s,e[18]=a,e[19]=_,e[20]=$):$=e[20];let A;e[21]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx("p",{className:"muted",children:"Leave blank to auto-detect. ElevenLabs returns word timing when an audio track and key are available. Otherwise OpenAI returns a plain transcript."}),e[21]=A):A=e[21];let N;e[22]!==$?(N=t.jsxs("section",{className:"generation-review-prompt-section","aria-label":"Language",children:[$,A]}),e[22]=$,e[23]=N):N=e[23];let E;e[24]!==m?(E=K=>m(K.target.checked),e[24]=m,e[25]=E):E=e[25];let I;e[26]!==s||e[27]!==r||e[28]!==E?(I=t.jsx("input",{type:"checkbox",checked:r,disabled:s,onChange:E}),e[26]=s,e[27]=r,e[28]=E,e[29]=I):I=e[29];let F;e[30]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx("span",{children:"Diarize speakers"}),e[30]=F):F=e[30];let M;e[31]!==I?(M=t.jsxs("label",{className:"generation-review-toggle",children:[I,F]}),e[31]=I,e[32]=M):M=e[32];let D;e[33]!==h?(D=K=>h(K.target.checked),e[33]=h,e[34]=D):D=e[34];let V;e[35]!==s||e[36]!==D||e[37]!==u?(V=t.jsx("input",{type:"checkbox",checked:u,disabled:s,onChange:D}),e[35]=s,e[36]=D,e[37]=u,e[38]=V):V=e[38];let U;e[39]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx("span",{children:"Tag audio events"}),e[39]=U):U=e[39];let B;e[40]!==V?(B=t.jsxs("label",{className:"generation-review-toggle",children:[V,U]}),e[40]=V,e[41]=B):B=e[41];let L;e[42]!==M||e[43]!==B?(L=t.jsxs("div",{className:"generation-review-toggles",children:[M,B]}),e[42]=M,e[43]=B,e[44]=L):L=e[44];let H;e[45]!==N||e[46]!==L||e[47]!==b?(H=t.jsxs("div",{className:"generation-review-editor",children:[b,N,L]}),e[45]=N,e[46]=L,e[47]=b,e[48]=H):H=e[48];let T;e[49]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{className:"confirm-section-label",children:"Estimate"}),e[49]=T):T=e[49];let O;e[50]!==p||e[51]!==c||e[52]!==x?(O=p?"…":x&&c!==null?Bs(c):"—",e[50]=p,e[51]=c,e[52]=x,e[53]=O):O=e[53];let Y;e[54]!==O?(Y=t.jsx("strong",{children:O}),e[54]=O,e[55]=Y):Y=e[55];let X;e[56]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx("span",{children:"USD"}),e[56]=X):X=e[56];const te=p?"Updating estimate…":x?"Estimated provider cost":"Cost estimate unavailable";let W;e[57]!==te?(W=t.jsx("small",{children:te}),e[57]=te,e[58]=W):W=e[58];let z;e[59]!==Y||e[60]!==W?(z=t.jsxs("section",{className:"confirm-section generation-review-estimate-section","aria-label":"Estimate",children:[T,Y,X,W]}),e[59]=Y,e[60]=W,e[61]=z):z=e[61];let G;return e[62]!==S||e[63]!==H||e[64]!==z?(G=t.jsxs("div",{className:"confirm-transcribe",children:[S,H,z]}),e[62]=S,e[63]=H,e[64]=z,e[65]=G):G=e[65],G}function zs(i){return t.jsxs("option",{value:i.artifactId,children:[i.label," · ",i.type]},i.artifactId)}function Et(i){const e=de.c(28),{label:s,mediaUrl:l,muted:n,playbackRate:a,windows:r}=i,u=je.useRef(null),c=je.useRef(null),p=je.useRef(0);let o;e[0]!==r?(o=r.map(Ys).join("|"),e[0]=r,e[1]=o):o=e[1];const f=o;let d;e[2]!==a||e[3]!==f?(d=()=>{const b=u.current;if(!b)return;const v=f.split("|").flatMap(Ks);p.current=0;const _=v[0]?.startSeconds??0,$=()=>{b.currentTime=_,c.current=_,b.playbackRate=a,b.play().catch(Gs)};let A=0,N,E=!1;const I=()=>{N!==void 0&&typeof b.cancelVideoFrameCallback=="function"&&(b.cancelVideoFrameCallback(N),N=void 0),A&&(cancelAnimationFrame(A),A=0)},F=()=>{if(E)return;const D=Al({activeWindowIndex:p.current,currentTimeSeconds:b.currentTime,pendingSeekSeconds:c.current,windows:v});D.type==="seek"?(b.currentTime=D.timeSeconds,c.current=D.timeSeconds,p.current=D.windowIndex,b.play().catch(Ws)):c.current!==null&&Math.abs(b.currentTime-c.current)<=.03333333333333333&&(c.current=null),M()},M=()=>{if(!E){if(typeof b.requestVideoFrameCallback=="function"){N=b.requestVideoFrameCallback(()=>F());return}A=requestAnimationFrame(()=>F())}};return b.readyState>=HTMLMediaElement.HAVE_METADATA?$():b.addEventListener("loadedmetadata",$,{once:!0}),M(),()=>{E=!0,I(),b.removeEventListener("loadedmetadata",$)}},e[2]=a,e[3]=f,e[4]=d):d=e[4];let m;e[5]!==l||e[6]!==a||e[7]!==f?(m=[l,a,f],e[5]=l,e[6]=a,e[7]=f,e[8]=m):m=e[8],je.useEffect(d,m);let h,x;e[9]!==a?(h=()=>{const b=u.current;b&&(b.playbackRate=a)},x=[a],e[9]=a,e[10]=h,e[11]=x):(h=e[10],x=e[11]),je.useEffect(h,x);let g;e[12]!==r?(g=r[0]?`${Je(r[0].startSeconds)}–${Je(r[r.length-1].endSeconds)}`:"",e[12]=r,e[13]=g):g=e[13];const S=g;let j;e[14]!==s?(j=t.jsx("span",{children:s}),e[14]=s,e[15]=j):j=e[15];let C;e[16]!==S?(C=t.jsx("strong",{children:S}),e[16]=S,e[17]=C):C=e[17];let y;e[18]!==j||e[19]!==C?(y=t.jsxs("div",{className:"confirm-split-loop-heading",children:[j,C]}),e[18]=j,e[19]=C,e[20]=y):y=e[20];let k;e[21]!==s||e[22]!==l||e[23]!==n?(k=t.jsx("video",{ref:u,"aria-label":s,src:l,muted:n,playsInline:!0,preload:"auto"}),e[21]=s,e[22]=l,e[23]=n,e[24]=k):k=e[24];let w;return e[25]!==k||e[26]!==y?(w=t.jsxs("section",{className:"confirm-split-loop",children:[y,k]}),e[25]=k,e[26]=y,e[27]=w):w=e[27],w}function Ws(){}function Gs(){}function Ks(i){const[e,s]=i.split(":").map(Number);return Number.isFinite(e)&&Number.isFinite(s)&&s>e?[{startSeconds:e,endSeconds:s}]:[]}function Ys(i){return`${i.startSeconds}:${i.endSeconds}`}const Xs=[-1,-.1,-.01,.01,.1,1],Js=[-1,-.1,.1,1];function _n(i){const e=de.c(178),{cutPointsSeconds:s,mediaUrl:l,onChange:n,outputMode:a,selectedIndex:r,sourceDurationSeconds:u,sourceFps:c}=i,p=je.useRef(null),[o,f]=je.useState(!1),[d,m]=je.useState("in"),[h,x]=je.useState(null),[g,S]=je.useState(null),[j,C]=je.useState(null),[y,k]=je.useState(null);let w;e[0]!==s||e[1]!==u?(w=Sl({cutPointsSeconds:s,sourceDurationSeconds:u}),e[0]=s,e[1]=u,e[2]=w):w=e[2];const b=w,v=b[r]??b[0];let _;e[3]!==c?(_=_l(c),e[3]=c,e[4]=_):_=e[4];const $=_;let A;e[5]!==v||e[6]!==u?(A=v?Cl({segment:v,sourceDurationSeconds:u}):{segment:{startSeconds:0,endSeconds:0},surroundings:[]},e[5]=v,e[6]=u,e[7]=A):A=e[7];const N=A,E=v?`${v.startSeconds}:${v.endSeconds}`:"";let I;e[8]!==h||e[9]!==v?.startSeconds?(I=h??v?.startSeconds.toFixed(3)??"",e[8]=h,e[9]=v?.startSeconds,e[10]=I):I=e[10];const F=I;let M;e[11]!==g||e[12]!==v?.endSeconds?(M=g??v?.endSeconds.toFixed(3)??"",e[11]=g,e[12]=v?.endSeconds,e[13]=M):M=e[13];const D=M;let V;e[14]!==E||e[15]!==v?.durationSeconds||e[16]!==y?(V=y?.key===E?y.value:kl(v?.durationSeconds??1),e[14]=E,e[15]=v?.durationSeconds,e[16]=y,e[17]=V):V=e[17];const U=V;let B;e[18]!==n||e[19]!==a?(B=R=>{C(null),x(null),S(null),n({cutPointsSeconds:R.cutPointsSeconds,outputMode:R.outputMode??a,selectedIndex:R.selectedIndex})},e[18]=n,e[19]=a,e[20]=B):B=e[20];const L=B;let H;e[21]!==L?(H=R=>{x(null),S(null),L(R)},e[21]=L,e[22]=H):H=e[22];const T=H;let O;e[23]!==T||e[24]!==s||e[25]!==r||e[26]!==u?(O=R=>{T(gt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[23]=T,e[24]=s,e[25]=r,e[26]=u,e[27]=O):O=e[27];const Y=O;let X;e[28]!==T||e[29]!==s||e[30]!==r||e[31]!==u?(X=R=>{T(bt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))},e[28]=T,e[29]=s,e[30]=r,e[31]=u,e[32]=X):X=e[32];const te=X;let W;e[33]!==T||e[34]!==s||e[35]!==v||e[36]!==r||e[37]!==u?(W=(R,Q)=>{if(!v)return;const Ae=Math.round(Number(R)*1e3)/1e3,Me=Math.round(Number(Q)*1e3)/1e3;if(!Number.isFinite(Ae)||!Number.isFinite(Me)){C("Enter start and end times in seconds");return}const qe=vt({cutPointsSeconds:s,endSeconds:Me,index:r,sourceDurationSeconds:u,startSeconds:Ae});if(qe.cutPointsSeconds.length===s.length&&qe.cutPointsSeconds.every((lt,tt)=>lt===s[tt])&&(Ae!==v.startSeconds||Me!==v.endSeconds)){C(`Choose a range from ${Je(v.startSeconds)} that stays inside neighbouring pieces`),x(null),S(null);return}T(qe)},e[33]=T,e[34]=s,e[35]=v,e[36]=r,e[37]=u,e[38]=W):W=e[38];const z=W;let G;e[39]!==T||e[40]!==s||e[41]!==v||e[42]!==r||e[43]!==u?(G=R=>{const Q=p.current?.currentTime;!v||typeof Q!="number"||!Number.isFinite(Q)||T(vt({cutPointsSeconds:s,endSeconds:R==="out"?Q:v.endSeconds,index:r,sourceDurationSeconds:u,startSeconds:R==="in"?Q:v.startSeconds}))},e[39]=T,e[40]=s,e[41]=v,e[42]=r,e[43]=u,e[44]=G):G=e[44];const K=G;let Z;e[45]!==d||e[46]!==Y||e[47]!==te?(Z=R=>{if(R.key!=="ArrowLeft"&&R.key!=="ArrowRight"||R.target instanceof HTMLInputElement)return;R.preventDefault();const Q=R.key==="ArrowLeft"?-1:1,Ae=R.altKey?.01:R.shiftKey?1:.1;d==="out"?te(Q*Ae):Y(Q*Ae)},e[45]=d,e[46]=Y,e[47]=te,e[48]=Z):Z=e[48];const ge=Z,se=U?.25:1,be=a==="remove"?"JOIN PREVIEW":"SURROUNDINGS";let ne;e[49]!==a||e[50]!==b.length||e[51]!==v?(ne=v?a==="all"?`Apply creates ${b.length} cells`:a==="keep"?`Apply creates 1 cell: ${Je(v.startSeconds)}-${Je(v.endSeconds)}`:`Apply creates 1 cell without ${Je(v.startSeconds)}-${Je(v.endSeconds)}`:"",e[49]=a,e[50]=b.length,e[51]=v,e[52]=ne):ne=e[52];const pe=ne;let oe;e[53]!==s||e[54]!==$||e[55]!==r?(oe=(R,Q,Ae)=>t.jsxs("div",{className:"confirm-split-nudges",children:[Xs.map(Me=>{const qe=Ae(Me),lt=qe.cutPointsSeconds.every((tt,nt)=>tt===s[nt])&&qe.selectedIndex===r;return t.jsxs("button",{type:"button",disabled:lt,onFocus:()=>m(R),onClick:()=>Q(Me),children:[Me>0?"+":"−",Math.abs(Me),"s"]},`${R}:${Me}`)}),$!==null&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button","aria-label":"Previous frame",title:"Previous frame",onFocus:()=>m(R),onClick:()=>Q(-$),children:"◂"}),t.jsx("button",{type:"button","aria-label":"Next frame",title:"Next frame",onFocus:()=>m(R),onClick:()=>Q($),children:"▸"})]})]}),e[53]=s,e[54]=$,e[55]=r,e[56]=oe):oe=e[56];const we=oe;let ie;e[57]===Symbol.for("react.memo_cache_sentinel")?(ie=t.jsx("span",{children:"Source"}),e[57]=ie):ie=e[57];let me;e[58]!==u?(me=Je(u),e[58]=u,e[59]=me):me=e[59];let ce;e[60]!==me?(ce=t.jsxs("div",{className:"confirm-section-heading",children:[ie,t.jsxs("strong",{children:[me," total"]})]}),e[60]=me,e[61]=ce):ce=e[61];let le;e[62]!==l?(le=t.jsx("video",{ref:p,src:l,controls:!0,playsInline:!0,preload:"metadata"}),e[62]=l,e[63]=le):le=e[63];let J;e[64]!==K?(J=t.jsx("button",{type:"button",onClick:()=>K("in"),children:"SET IN HERE"}),e[64]=K,e[65]=J):J=e[65];let ue;e[66]!==K?(ue=t.jsx("button",{type:"button",onClick:()=>K("out"),children:"SET OUT HERE"}),e[66]=K,e[67]=ue):ue=e[67];let ae;e[68]!==J||e[69]!==ue?(ae=t.jsxs("div",{className:"confirm-actions-row",children:[J,ue]}),e[68]=J,e[69]=ue,e[70]=ae):ae=e[70];let re;e[71]!==ce||e[72]!==le||e[73]!==ae?(re=t.jsxs("section",{className:"confirm-section","aria-label":"Source player",children:[ce,le,ae]}),e[71]=ce,e[72]=le,e[73]=ae,e[74]=re):re=e[74];let Se;e[75]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("span",{className:"confirm-section-label",children:"Pieces"}),e[75]=Se):Se=e[75];let ve;if(e[76]!==s||e[77]!==L||e[78]!==b||e[79]!==r){let R;e[81]!==s||e[82]!==L||e[83]!==r?(R=Q=>t.jsxs("button",{type:"button",role:"listitem",className:Q.index===r?"active":void 0,"aria-pressed":Q.index===r,onClick:()=>L({cutPointsSeconds:s,selectedIndex:Q.index}),children:[String(Q.index+1).padStart(2,"0")," ",Je(Q.startSeconds),"-",Je(Q.endSeconds)]},`${Q.startSeconds}:${Q.endSeconds}`),e[81]=s,e[82]=L,e[83]=r,e[84]=R):R=e[84],ve=b.map(R),e[76]=s,e[77]=L,e[78]=b,e[79]=r,e[80]=ve}else ve=e[80];let ye;e[85]!==ve?(ye=t.jsx("div",{className:"confirm-chips",role:"list",children:ve}),e[85]=ve,e[86]=ye):ye=e[86];const Ce=!v||v.durationSeconds<.04;let xe;e[87]!==T||e[88]!==s||e[89]!==r||e[90]!==u?(xe=()=>T(El({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[87]=T,e[88]=s,e[89]=r,e[90]=u,e[91]=xe):xe=e[91];let Ne;e[92]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx(gs,{size:12,"aria-hidden":"true"}),e[92]=Ne):Ne=e[92];let fe;e[93]!==Ce||e[94]!==xe?(fe=t.jsxs("button",{type:"button",disabled:Ce,onClick:xe,children:[Ne,"Split piece in half"]}),e[93]=Ce,e[94]=xe,e[95]=fe):fe=e[95];const ee=r>=b.length-1;let Ee;e[96]!==T||e[97]!==s||e[98]!==r||e[99]!==u?(Ee=()=>T($l({cutPointsSeconds:s,index:r,sourceDurationSeconds:u})),e[96]=T,e[97]=s,e[98]=r,e[99]=u,e[100]=Ee):Ee=e[100];let $e;e[101]!==ee||e[102]!==Ee?($e=t.jsx("button",{type:"button",disabled:ee,onClick:Ee,children:"Merge with next"}),e[101]=ee,e[102]=Ee,e[103]=$e):$e=e[103];let ke;e[104]!==fe||e[105]!==$e?(ke=t.jsxs("div",{className:"confirm-actions-row",children:[fe,$e]}),e[104]=fe,e[105]=$e,e[106]=ke):ke=e[106];let Re;e[107]!==ye||e[108]!==ke?(Re=t.jsxs("section",{className:"confirm-section","aria-label":"Pieces",children:[Se,ye,ke]}),e[107]=ye,e[108]=ke,e[109]=Re):Re=e[109];let Te;e[110]!==re||e[111]!==Re?(Te=t.jsxs("div",{className:"confirm-split-column",children:[re,Re]}),e[110]=re,e[111]=Re,e[112]=Te):Te=e[112];let Oe;e[113]===Symbol.for("react.memo_cache_sentinel")?(Oe=t.jsx("span",{children:"Loops"}),e[113]=Oe):Oe=e[113];let De;e[114]===Symbol.for("react.memo_cache_sentinel")?(De=()=>f(Zs),e[114]=De):De=e[114];let Pe;e[115]!==o?(Pe=o?t.jsx(bs,{size:13}):t.jsx(vs,{size:13}),e[115]=o,e[116]=Pe):Pe=e[116];const ze=o?"Sound on":"Sound off";let _e;e[117]!==o||e[118]!==Pe||e[119]!==ze?(_e=t.jsxs("div",{className:"confirm-section-heading",children:[Oe,t.jsxs("button",{type:"button","aria-pressed":o,onClick:De,children:[Pe,ze]})]}),e[117]=o,e[118]=Pe,e[119]=ze,e[120]=_e):_e=e[120];const Fe=!o;let Ie;e[121]!==N.segment?(Ie=[N.segment],e[121]=N.segment,e[122]=Ie):Ie=e[122];let Le;e[123]!==l||e[124]!==se||e[125]!==Fe||e[126]!==Ie?(Le=t.jsx(Et,{label:"SEGMENT",mediaUrl:l,muted:Fe,playbackRate:se,windows:Ie}),e[123]=l,e[124]=se,e[125]=Fe,e[126]=Ie,e[127]=Le):Le=e[127];const He=!o;let P;e[128]!==l||e[129]!==se||e[130]!==be||e[131]!==He||e[132]!==N.surroundings?(P=t.jsx(Et,{label:be,mediaUrl:l,muted:He,playbackRate:se,windows:N.surroundings}),e[128]=l,e[129]=se,e[130]=be,e[131]=He,e[132]=N.surroundings,e[133]=P):P=e[133];let he;e[134]!==Le||e[135]!==P?(he=t.jsxs("div",{className:"confirm-split-loops",children:[Le,P]}),e[134]=Le,e[135]=P,e[136]=he):he=e[136];let Ue;e[137]!==T||e[138]!==z||e[139]!==s||e[140]!==F||e[141]!==we||e[142]!==Y||e[143]!==te||e[144]!==D||e[145]!==E||e[146]!==v||e[147]!==r||e[148]!==U||e[149]!==u?(Ue=v&&t.jsxs("div",{className:"confirm-split-bounds",children:[t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"IN"}),t.jsx("input",{type:"number","aria-label":"IN seconds",step:"0.001",value:F,onFocus:()=>m("in"),onChange:R=>x(R.target.value),onBlur:()=>z(F,D),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),z(F,D))}}),we("in",Y,R=>gt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))]}),t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"OUT"}),t.jsx("input",{type:"number","aria-label":"OUT seconds",step:"0.001",value:D,onFocus:()=>m("out"),onChange:R=>S(R.target.value),onBlur:()=>z(F,D),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),z(F,D))}}),we("out",te,R=>bt({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}))]}),t.jsxs("div",{className:"confirm-split-bound",children:[t.jsx("span",{children:"MOVE"}),t.jsxs("output",{"aria-label":"Piece duration",children:[v.durationSeconds.toFixed(3),"s"]}),t.jsxs("div",{className:"confirm-split-nudges",children:[Js.map(R=>{const Q=Pl({cutPointsSeconds:s,deltaSeconds:R,index:r,sourceDurationSeconds:u}),Ae=Q.cutPointsSeconds.every((Me,qe)=>Me===s[qe]);return t.jsxs("button",{type:"button",disabled:Ae,onClick:()=>T(Q),children:[R>0?"+":"−",Math.abs(R),"s"]},`move:${R}`)}),t.jsx("button",{type:"button","aria-pressed":U,onClick:()=>k({key:E,value:!U}),children:"Slow ×0.25"})]})]})]}),e[137]=T,e[138]=z,e[139]=s,e[140]=F,e[141]=we,e[142]=Y,e[143]=te,e[144]=D,e[145]=E,e[146]=v,e[147]=r,e[148]=U,e[149]=u,e[150]=Ue):Ue=e[150];let Ge;e[151]!==j?(Ge=j&&t.jsx("p",{className:"confirm-field-error",role:"alert",children:j}),e[151]=j,e[152]=Ge):Ge=e[152];let Ke;e[153]!==_e||e[154]!==he||e[155]!==Ue||e[156]!==Ge?(Ke=t.jsxs("section",{className:"confirm-section","aria-label":"Loops",children:[_e,he,Ue,Ge]}),e[153]=_e,e[154]=he,e[155]=Ue,e[156]=Ge,e[157]=Ke):Ke=e[157];let Ze;e[158]===Symbol.for("react.memo_cache_sentinel")?(Ze=t.jsx("span",{className:"confirm-section-label",children:"Output"}),e[158]=Ze):Ze=e[158];let et;e[159]===Symbol.for("react.memo_cache_sentinel")?(et=[["keep","KEEP segment"],["remove","REMOVE segment"],["all","ALL pieces"]],e[159]=et):et=e[159];let Ye;e[160]!==s||e[161]!==L||e[162]!==a||e[163]!==b.length||e[164]!==r?(Ye=t.jsx("div",{className:"confirm-chips",children:et.map(R=>{const[Q,Ae]=R;return t.jsx("button",{type:"button",className:a===Q?"active":void 0,"aria-pressed":a===Q,disabled:Q==="remove"&&b.length<2,onClick:()=>L({cutPointsSeconds:s,outputMode:Q,selectedIndex:r}),children:Ae},Q)})}),e[160]=s,e[161]=L,e[162]=a,e[163]=b.length,e[164]=r,e[165]=Ye):Ye=e[165];let Xe;e[166]!==pe?(Xe=t.jsx("p",{className:"confirm-help",children:pe}),e[166]=pe,e[167]=Xe):Xe=e[167];let Ve;e[168]!==Ye||e[169]!==Xe?(Ve=t.jsxs("section",{className:"confirm-section","aria-label":"Output mode",children:[Ze,Ye,Xe]}),e[168]=Ye,e[169]=Xe,e[170]=Ve):Ve=e[170];let Qe;e[171]!==Ke||e[172]!==Ve?(Qe=t.jsxs("div",{className:"confirm-split-column",children:[Ke,Ve]}),e[171]=Ke,e[172]=Ve,e[173]=Qe):Qe=e[173];let We;return e[174]!==ge||e[175]!==Te||e[176]!==Qe?(We=t.jsxs("div",{className:"confirm-split",onKeyDown:ge,children:[Te,Qe]}),e[174]=ge,e[175]=Te,e[176]=Qe,e[177]=We):We=e[177],We}function Zs(i){return!i}function qt(i){const e=de.c(3),{prompt:s}=i;if(!s.trim())return null;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx("b",{"aria-hidden":"true",children:"›"}),e[0]=l):l=e[0];let n;return e[1]!==s?(n=t.jsxs("p",{className:"confirm-prompt-echo",children:[l,t.jsx("span",{children:s})]}),e[1]=s,e[2]=n):n=e[2],n}function Bt({columns:i,settings:e}){return t.jsx("dl",{className:"confirm-settings","aria-label":"Action settings",style:{gridTemplateColumns:`repeat(${i}, minmax(0, 1fr))`},children:e.map(s=>t.jsxs("div",{className:[s.wide?"confirm-setting-wide":"",s.tone==="warning"?"confirm-setting-warning":""].join(" ").trim()||void 0,children:[t.jsx("dt",{children:s.label}),t.jsx("dd",{children:s.value})]},s.label))})}function En(i){const e=de.c(125),{asset:s,busy:l,connection:n,draft:a,onChange:r,onConnect:u,onThreadCreditsChange:c,onThreadOptionsChange:p,onThreadPromptChange:o,prompt:f,settings:d,sourceLabel:m,threadReview:h}=i,x=s?.type==="video"||s?.type==="final",g=s?.type==="image"?s.mediaUrl??s.thumbnailUrl:null,S=a.scheduledFor!==null;let j;e[0]!==a.postText?(j=a.postText.trim(),e[0]=a.postText,e[1]=j):j=e[1];const C=j==="",y=Rl(n?.status??null);let k;e[2]!==n?(k=n?.status?Tl(n.status):null,e[2]=n,e[3]=k):k=e[3];const w=k,b=a.postText.length>y;let v,_,$,A,N,E,I,F,M,D;if(e[4]!==w||e[5]!==s||e[6]!==l||e[7]!==n||e[8]!==a.orientation||e[9]!==a.postText||e[10]!==a.scheduledFor||e[11]!==g||e[12]!==y||e[13]!==r||e[14]!==u||e[15]!==c||e[16]!==p||e[17]!==o||e[18]!==f||e[19]!==S||e[20]!==d||e[21]!==m||e[22]!==h||e[23]!==b||e[24]!==C||e[25]!==x){const B=h?Il(h):[];let L;e[36]!==h?(L=h?Ll(h.context):!1,e[36]=h,e[37]=L):L=e[37];const H=L;let T;e[38]!==n?(T=n?.status?Fl(n.status,{connecting:n.connecting}):null,e[38]=n,e[39]=T):T=e[39];const O=T,Y=O!==null&&O.tone!=="connected";_="confirm-routed confirm-post";let X;e[40]!==f?(X=t.jsx(qt,{prompt:f}),e[40]=f,e[41]=X):X=e[41];let te;e[42]!==d?(te=t.jsx(Bt,{columns:2,settings:d}),e[42]=d,e[43]=te):te=e[43],e[44]!==X||e[45]!==te?($=t.jsxs("div",{className:"confirm-routed-main",children:[X,te]}),e[44]=X,e[45]=te,e[46]=$):$=e[46],A="x-post-preview",N="X post preview";let W,z;e[47]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx("span",{"aria-hidden":"true",children:"X"}),z=t.jsx("strong",{children:"Post preview"}),e[47]=W,e[48]=z):(W=e[47],z=e[48]),e[49]!==m?(E=t.jsxs("header",{children:[W,t.jsxs("div",{children:[z,t.jsx("small",{children:m})]})]}),e[49]=m,e[50]=E):E=e[50],e[51]!==l||e[52]!==n||e[53]!==O||e[54]!==u||e[55]!==Y?(I=Y&&O&&t.jsxs("div",{className:`x-post-connection x-post-connection-${O.tone}`,role:"status","aria-label":"X connection",children:[t.jsxs("div",{children:[t.jsx("strong",{children:O.label}),t.jsx("span",{children:O.detail}),n?.connecting&&n.authorizeUrl&&t.jsx("a",{href:n.authorizeUrl,target:"_blank",rel:"noopener noreferrer",children:"Open the X authorization page"})]}),u&&(O.actionLabel||n?.connecting)&&t.jsx("button",{type:"button",disabled:l||n?.connecting,onClick:u,children:n?.connecting?"Waiting…":O.actionLabel})]}),e[51]=l,e[52]=n,e[53]=O,e[54]=u,e[55]=Y,e[56]=I):I=e[56],e[57]!==s||e[58]!==g||e[59]!==m||e[60]!==x?(F=t.jsx("div",{className:"x-post-preview-media",children:x&&s?.mediaUrl?t.jsx("video",{src:s.mediaUrl,poster:s.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata"}):g?t.jsx("img",{src:g,alt:`${m} post preview`}):t.jsxs("div",{className:"x-post-preview-fallback",children:[t.jsx(Ut,{size:28,"aria-hidden":"true"}),t.jsx("span",{children:"Media preview unavailable"})]})}),e[57]=s,e[58]=g,e[59]=m,e[60]=x,e[61]=F):F=e[61];let G;e[62]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx("label",{htmlFor:"x-post-title",children:"Title"}),e[62]=G):G=e[62];const K=C||b;let Z;e[63]!==r?(Z=ee=>r({postText:ee.target.value}),e[63]=r,e[64]=Z):Z=e[64];let ge;e[65]!==l||e[66]!==a.postText||e[67]!==K||e[68]!==Z?(ge=t.jsx("textarea",{id:"x-post-title","aria-invalid":K,disabled:l,placeholder:"Title (required)",required:!0,rows:3,value:a.postText,onChange:Z}),e[65]=l,e[66]=a.postText,e[67]=K,e[68]=Z,e[69]=ge):ge=e[69];const se=C||b?"confirm-field-error":void 0,be=C?"A title is required":`${a.postText.length}/${y} characters`;let ne;e[70]!==se||e[71]!==be?(ne=t.jsx("small",{className:se,children:be}),e[70]=se,e[71]=be,e[72]=ne):ne=e[72];let pe;e[73]!==w?(pe=w&&t.jsx("small",{className:"x-post-account",children:w}),e[73]=w,e[74]=pe):pe=e[74],e[75]!==ge||e[76]!==ne||e[77]!==pe?(M=t.jsxs("div",{className:"x-post-preview-copy",children:[G,ge,ne,pe]}),e[75]=ge,e[76]=ne,e[77]=pe,e[78]=M):M=e[78];let oe;e[79]===Symbol.for("react.memo_cache_sentinel")?(oe=t.jsx("span",{children:"Publish"}),e[79]=oe):oe=e[79];const we=S?"schedule":"now";let ie;e[80]!==r?(ie=ee=>r({scheduledFor:ee.target.value==="schedule"?Ql():null}),e[80]=r,e[81]=ie):ie=e[81];let me,ce;e[82]===Symbol.for("react.memo_cache_sentinel")?(me=t.jsx("option",{value:"now",children:"Now"}),ce=t.jsx("option",{value:"schedule",children:"Schedule"}),e[82]=me,e[83]=ce):(me=e[82],ce=e[83]);let le;e[84]!==l||e[85]!==we||e[86]!==ie?(le=t.jsxs("label",{className:"confirm-field",children:[oe,t.jsxs("select",{"aria-label":"Publish timing",disabled:l,value:we,onChange:ie,children:[me,ce]})]}),e[84]=l,e[85]=we,e[86]=ie,e[87]=le):le=e[87];let J;e[88]===Symbol.for("react.memo_cache_sentinel")?(J=t.jsx("span",{children:"Orientation"}),e[88]=J):J=e[88];const ue=l||s?.type==="image",ae=a.orientation??"source";let re;e[89]!==r?(re=ee=>r({orientation:ee.target.value==="portrait"||ee.target.value==="landscape"?ee.target.value:null}),e[89]=r,e[90]=re):re=e[90];let Se,ve,ye;e[91]===Symbol.for("react.memo_cache_sentinel")?(Se=t.jsx("option",{value:"source",children:"Keep source"}),ve=t.jsx("option",{value:"portrait",children:"Portrait"}),ye=t.jsx("option",{value:"landscape",children:"Landscape"}),e[91]=Se,e[92]=ve,e[93]=ye):(Se=e[91],ve=e[92],ye=e[93]);let Ce;e[94]!==ue||e[95]!==ae||e[96]!==re?(Ce=t.jsxs("select",{"aria-label":"Video orientation",disabled:ue,value:ae,onChange:re,children:[Se,ve,ye]}),e[94]=ue,e[95]=ae,e[96]=re,e[97]=Ce):Ce=e[97];let xe;e[98]!==s?.type?(xe=s?.type==="image"&&t.jsx("small",{children:"Video posts only"}),e[98]=s?.type,e[99]=xe):xe=e[99];let Ne;e[100]!==Ce||e[101]!==xe?(Ne=t.jsxs("label",{className:"confirm-field",children:[J,Ce,xe]}),e[100]=Ce,e[101]=xe,e[102]=Ne):Ne=e[102];let fe;e[103]!==l||e[104]!==a.scheduledFor||e[105]!==r||e[106]!==S?(fe=S&&t.jsxs("label",{className:"confirm-field",children:[t.jsx("span",{children:"Date and time"}),t.jsx("input",{"aria-label":"Schedule date and time",disabled:l,required:!0,type:"datetime-local",value:Dl(a.scheduledFor??""),onChange:ee=>r({scheduledFor:Ml(ee.target.value)})}),t.jsx("small",{children:"Uses your local timezone"})]}),e[103]=l,e[104]=a.scheduledFor,e[105]=r,e[106]=S,e[107]=fe):fe=e[107],e[108]!==le||e[109]!==Ne||e[110]!==fe?(D=t.jsxs("div",{className:"x-post-preview-options",role:"group","aria-label":"Post options",children:[le,Ne,fe]}),e[108]=le,e[109]=Ne,e[110]=fe,e[111]=D):D=e[111],v=x&&h&&t.jsxs("section",{className:"x-post-thread","aria-label":"How it was made thread",children:[t.jsxs("label",{className:"x-post-thread-master",children:[t.jsx("input",{type:"checkbox",checked:h.options.enabled,disabled:l||h.loading||!H,onChange:ee=>p?.({enabled:ee.target.checked})}),t.jsxs("span",{children:[t.jsx("strong",{children:"Add how-it-was-made thread"}),t.jsx("small",{children:"Reply with the prompt and input images, then thank the original video"})]})]}),h.loading?t.jsx("small",{children:"Loading generation details…"}):h.error?t.jsx("small",{className:"confirm-field-error",children:h.error}):H?h.options.enabled?t.jsxs("div",{className:"x-post-thread-steps",children:[h.context.steps.map((ee,Ee)=>t.jsx(ln,{busy:l,index:Ee,maxCharacters:y,prompt:Ol(h,ee),reply:B.find($e=>$e.stepId===ee.id)??null,step:ee,stepCount:h.context.steps.length,onPromptChange:o},ee.id)),h.context.credits.length>0&&t.jsx(nn,{busy:l,maxCharacters:y,replyCount:B.filter(en).length,text:Hl(h),onChange:c}),B.length===0&&t.jsx("small",{className:"confirm-field-error",children:Ul})]}):null:t.jsx("small",{children:"No generation details were found."})]}),e[4]=w,e[5]=s,e[6]=l,e[7]=n,e[8]=a.orientation,e[9]=a.postText,e[10]=a.scheduledFor,e[11]=g,e[12]=y,e[13]=r,e[14]=u,e[15]=c,e[16]=p,e[17]=o,e[18]=f,e[19]=S,e[20]=d,e[21]=m,e[22]=h,e[23]=b,e[24]=C,e[25]=x,e[26]=v,e[27]=_,e[28]=$,e[29]=A,e[30]=N,e[31]=E,e[32]=I,e[33]=F,e[34]=M,e[35]=D}else v=e[26],_=e[27],$=e[28],A=e[29],N=e[30],E=e[31],I=e[32],F=e[33],M=e[34],D=e[35];let V;e[112]!==v||e[113]!==A||e[114]!==N||e[115]!==E||e[116]!==I||e[117]!==F||e[118]!==M||e[119]!==D?(V=t.jsxs("article",{className:A,"aria-label":N,children:[E,I,F,M,D,v]}),e[112]=v,e[113]=A,e[114]=N,e[115]=E,e[116]=I,e[117]=F,e[118]=M,e[119]=D,e[120]=V):V=e[120];let U;return e[121]!==_||e[122]!==$||e[123]!==V?(U=t.jsxs("div",{className:_,children:[$,V]}),e[121]=_,e[122]=$,e[123]=V,e[124]=U):U=e[124],U}function en(i){return i.stepId===null}function zt(i){return i===0?"nothing to post":`posts as ${i} ${i===1?"reply":"replies"}`}function tn(i){const e=Vl(i.images).length;return e===i.images.length?"Input images":`Input images · first ${e} of ${i.images.length} attach`}function ln(i){const e=de.c(37),{busy:s,index:l,maxCharacters:n,onPromptChange:a,prompt:r,reply:u,step:c,stepCount:p}=i,o=`x-post-thread-prompt-${l}`,f=u?.text.length??0,d=f>n,m=p>1?`Generation step ${l+1}`:"Generation step";let h;e[0]!==l||e[1]!==p?(h=p>1&&t.jsxs("small",{className:"x-post-thread-step-ordinal",children:["Step ",l+1," of ",p]}),e[0]=l,e[1]=p,e[2]=h):h=e[2];let x;e[3]!==c.model?(x=c.model&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:"Model"}),t.jsxs("p",{className:"x-post-thread-model",children:[t.jsx("span",{children:c.model.label}),c.model.provider&&t.jsxs("small",{children:["via ",c.model.provider]})]})]}),e[3]=c.model,e[4]=x):x=e[4];let g;e[5]!==o?(g=t.jsx("label",{className:"x-post-thread-label",htmlFor:o,children:"Prompt"}),e[5]=o,e[6]=g):g=e[6];const S=d?"confirm-field-error":void 0,j=u?1:0;let C;e[7]!==j?(C=zt(j),e[7]=j,e[8]=C):C=e[8];let y;e[9]!==n||e[10]!==f||e[11]!==S||e[12]!==C?(y=t.jsxs("small",{className:S,children:[f,"/",n," characters with heading"," · ",C]}),e[9]=n,e[10]=f,e[11]=S,e[12]=C,e[13]=y):y=e[13];let k;e[14]!==g||e[15]!==y?(k=t.jsxs("div",{className:"x-post-thread-field-head",children:[g,y]}),e[14]=g,e[15]=y,e[16]=k):k=e[16];let w;e[17]!==a||e[18]!==c.id?(w=A=>a?.(c.id,A.target.value),e[17]=a,e[18]=c.id,e[19]=w):w=e[19];let b;e[20]!==s||e[21]!==r||e[22]!==o||e[23]!==w||e[24]!==d?(b=t.jsx("textarea",{id:o,"aria-invalid":d,disabled:s,rows:4,value:r,onChange:w}),e[20]=s,e[21]=r,e[22]=o,e[23]=w,e[24]=d,e[25]=b):b=e[25];let v;e[26]!==b||e[27]!==k?(v=t.jsxs("div",{className:"x-post-thread-field",children:[k,b]}),e[26]=b,e[27]=k,e[28]=v):v=e[28];let _;e[29]!==c?(_=c.images.length>0&&t.jsxs("div",{className:"x-post-thread-field",children:[t.jsx("span",{className:"x-post-thread-label",children:tn(c)}),t.jsx("div",{className:"x-post-thread-images",children:c.images.map(sn)})]}),e[29]=c,e[30]=_):_=e[30];let $;return e[31]!==m||e[32]!==v||e[33]!==_||e[34]!==h||e[35]!==x?($=t.jsxs("article",{className:"x-post-thread-step","aria-label":m,children:[h,x,v,_]}),e[31]=m,e[32]=v,e[33]=_,e[34]=h,e[35]=x,e[36]=$):$=e[36],$}function sn(i){return t.jsxs("figure",{children:[t.jsx("img",{src:i.thumbnailUrl??i.mediaUrl??void 0,alt:i.label}),t.jsx("figcaption",{children:i.label})]},i.assetId)}function nn(i){const e=de.c(18),{busy:s,maxCharacters:l,onChange:n,replyCount:a,text:r}=i,u=r.length>l;let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("label",{className:"x-post-thread-label",htmlFor:"x-post-thread-credits",children:"Credits"}),e[0]=c):c=e[0];const p=u?"confirm-field-error":void 0,o=r.length;let f;e[1]!==a?(f=zt(a),e[1]=a,e[2]=f):f=e[2];let d;e[3]!==l||e[4]!==p||e[5]!==f||e[6]!==r.length?(d=t.jsxs("div",{className:"x-post-thread-field-head",children:[c,t.jsxs("small",{className:p,children:[o,"/",l," characters · ",f]})]}),e[3]=l,e[4]=p,e[5]=f,e[6]=r.length,e[7]=d):d=e[7];let m;e[8]!==n?(m=g=>n?.(g.target.value),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==s||e[11]!==m||e[12]!==r||e[13]!==u?(h=t.jsx("textarea",{id:"x-post-thread-credits","aria-invalid":u,disabled:s,rows:2,value:r,onChange:m}),e[10]=s,e[11]=m,e[12]=r,e[13]=u,e[14]=h):h=e[14];let x;return e[15]!==d||e[16]!==h?(x=t.jsx("article",{className:"x-post-thread-step","aria-label":"Credits",children:t.jsxs("div",{className:"x-post-thread-field",children:[d,h]})}),e[15]=d,e[16]=h,e[17]=x):x=e[17],x}function an(i){const e=de.c(15),{effectiveSpeed:s,mediaUrl:l,thumbnailUrl:n}=i,a=je.useRef(null),[r,u]=je.useState(!1),c=s&&s>0?s:1;let p;e[0]!==c?(p=()=>{const j=a.current;if(!j)return;const C=()=>u(!0),y=()=>u(!1);j.defaultPlaybackRate=c;const k=()=>{j.defaultPlaybackRate=c,j.playbackRate=c,j.muted=!0,j.play().catch(()=>u(!1))};return j.addEventListener("play",C),j.addEventListener("pause",y),j.readyState>=HTMLMediaElement.HAVE_METADATA?k():j.addEventListener("loadedmetadata",k,{once:!0}),()=>{j.removeEventListener("loadedmetadata",k),j.removeEventListener("play",C),j.removeEventListener("pause",y),j.pause()}},e[0]=c,e[1]=p):p=e[1];let o;e[2]!==l||e[3]!==c?(o=[l,c],e[2]=l,e[3]=c,e[4]=o):o=e[4],je.useEffect(p,o);let f;e[5]!==s?(f=s?`preview at ${ql(s)}×`:"source preview",e[5]=s,e[6]=f):f=e[6];const d=f,m=n??void 0;let h;e[7]!==l||e[8]!==m?(h=t.jsx("video",{ref:a,src:l,poster:m,controls:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto"}),e[7]=l,e[8]=m,e[9]=h):h=e[9];const x=r?`Live ${d} — source not yet changed`:`Press Play for ${d} — source not yet changed`;let g;e[10]!==x?(g=t.jsx("small",{children:x}),e[10]=x,e[11]=g):g=e[11];let S;return e[12]!==h||e[13]!==g?(S=t.jsxs(t.Fragment,{children:[h,g]}),e[12]=h,e[13]=g,e[14]=S):S=e[14],S}function $n(i){const e=de.c(14),{prompt:s,settings:l,speedPreview:n}=i,a=n===void 0?null:n,r=a?2:Math.min(6,Math.max(1,l.length)),u=`confirm-routed${a?" confirm-routed-with-preview":""}`;let c;e[0]!==s?(c=t.jsx(qt,{prompt:s}),e[0]=s,e[1]=c):c=e[1];let p;e[2]!==r||e[3]!==l?(p=t.jsx(Bt,{columns:r,settings:l}),e[2]=r,e[3]=l,e[4]=p):p=e[4];let o;e[5]!==c||e[6]!==p?(o=t.jsxs("div",{className:"confirm-routed-main",children:[c,p]}),e[5]=c,e[6]=p,e[7]=o):o=e[7];let f;e[8]!==a?(f=a&&t.jsx("div",{className:"confirm-routed-preview","aria-label":"Speed change preview",children:a.unavailableReason===null?t.jsx(an,{effectiveSpeed:a.effectiveSpeed,mediaUrl:a.mediaUrl??"",thumbnailUrl:a.thumbnailUrl},a.mediaUrl??"speed-preview"):t.jsx("p",{className:"confirm-routed-preview-fallback",children:`Preview unavailable — ${a.unavailableReason}.`})}),e[8]=a,e[9]=f):f=e[9];let d;return e[10]!==u||e[11]!==o||e[12]!==f?(d=t.jsxs("div",{className:u,children:[o,f]}),e[10]=u,e[11]=o,e[12]=f,e[13]=d):d=e[13],d}function An(i){const e=de.c(19),{busy:s,onToggleSuggestion:l,plan:n,previews:a}=i;let r;e[0]!==n.confirmation.reason?(r=t.jsx("p",{children:n.confirmation.reason}),e[0]=n.confirmation.reason,e[1]=r):r=e[1];let u;e[2]!==s||e[3]!==l||e[4]!==n.suggestions?(u=n.suggestions&&t.jsxs("fieldset",{className:"confirm-plan-suggestions",children:[t.jsx("legend",{children:"Include suggestions"}),n.suggestions.map(d=>t.jsxs("label",{children:[t.jsx("input",{type:"checkbox",checked:d.included,disabled:s,onChange:()=>l(d.suggestionId)}),t.jsxs("span",{children:[t.jsx("strong",{children:d.label}),d.detail&&t.jsx("small",{children:d.detail})]})]},d.suggestionId))]}),e[2]=s,e[3]=l,e[4]=n.suggestions,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsxs("div",{className:"confirm-plan-context",children:[r,u]}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;if(e[9]!==n.stages||e[10]!==a){let d;e[12]!==a?(d=m=>{const h=m.kind==="edit"?a[m.stageId]:void 0;return t.jsxs("li",{children:[t.jsx("span",{children:m.kind.toUpperCase()}),t.jsx("strong",{children:m.summary}),h&&t.jsxs(t.Fragment,{children:[t.jsxs("small",{children:[h.diff.changedClipIds.length," clips · duration ",h.diff.beforeDurationFrames," → ",h.diff.afterDurationFrames," frames"]}),h.warnings.map((x,g)=>t.jsxs("p",{className:"confirm-stage-warning",children:[t.jsx(ft,{size:11,"aria-hidden":"true"}),x.message]},`${m.stageId}:warning:${g}`)),h.conflicts.map((x,g)=>t.jsxs("p",{className:"confirm-stage-conflict",children:[t.jsx(js,{size:11,"aria-hidden":"true"}),x.message]},`${m.stageId}:conflict:${g}`))]}),m.kind==="queued"&&t.jsxs("small",{children:[m.provider&&m.model?`${m.provider} · ${m.model}`:m.tool,m.estimatedCostUsd!==void 0?` · estimated $${m.estimatedCostUsd.toFixed(4)}`:m.estimateUnavailable?" · cost estimate unavailable":""]})]},m.stageId)},e[12]=a,e[13]=d):d=e[13],p=n.stages.map(d),e[9]=n.stages,e[10]=a,e[11]=p}else p=e[11];let o;e[14]!==p?(o=t.jsx("ol",{className:"confirm-stages","aria-label":"Planned stages",children:p}),e[14]=p,e[15]=o):o=e[15];let f;return e[16]!==c||e[17]!==o?(f=t.jsxs("div",{className:"confirm-plan",children:[c,o]}),e[16]=c,e[17]=o,e[18]=f):f=e[18],f}function Rn(i){const e=de.c(12),{kindLabel:s,reason:l,stageTitle:n}=i;let a;e[0]!==l?(a=t.jsx("div",{className:"confirm-plan-context",children:t.jsx("p",{children:l})}),e[0]=l,e[1]=a):a=e[1];let r;e[2]!==s?(r=t.jsx("span",{children:s}),e[2]=s,e[3]=r):r=e[3];let u;e[4]!==n?(u=t.jsx("strong",{children:n}),e[4]=n,e[5]=u):u=e[5];let c;e[6]!==r||e[7]!==u?(c=t.jsx("ol",{className:"confirm-stages","aria-label":"Planned stages",children:t.jsxs("li",{children:[r,u]})}),e[6]=r,e[7]=u,e[8]=c):c=e[8];let p;return e[9]!==a||e[10]!==c?(p=t.jsxs("div",{className:"confirm-plan",children:[a,c]}),e[9]=a,e[10]=c,e[11]=p):p=e[11],p}const $t={"top-left":"Top left","top-center":"Top center","top-right":"Top right","middle-left":"Middle left","middle-center":"Middle center","middle-right":"Middle right","bottom-left":"Bottom left","bottom-center":"Bottom center","bottom-right":"Bottom right"},Wt=["fe2601bf8","8209bd208","ba34532e8","ba6ee3ae8","ba95bfae8","824f55208","feaaaabf8","00ccb8800","33c3ed680","646dcd668","8abc29c48","f976883d0","2bd10cc08","246bc6840","3ae7049a0","78227f738","1fa124fc0","b072db3a8","f715de7b0","a150ca198","7aac44a60","ed6a62858","060607bf8","5d2a6a4c8","aa0132f80","0087658f0","fe9a35ac0","8277d98f8","ba51bbff0","bacc3e160","ba9403e00","824b0bc28","fe263c180"],dt=Wt.length;function rn(){const i=[];for(let e=0;e<dt;e+=1){const s=Wt[e];for(let l=0;l<dt;l+=1)(Number.parseInt(s.charAt(Math.floor(l/4)),16)&8>>l%4)!==0&&i.push(`M${l} ${e}h1v1h-1z`)}return i.join("")}const on=rn(),At=28,cn=16,dn={center:"Centered","above-qr":"Above QR","on-qr":"On QR","below-qr":"Below QR"};function mn(){const i=de.c(1);let e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("svg",{className:"watermark-preview-qr-modules",viewBox:`0 0 ${dt} ${dt}`,shapeRendering:"crispEdges",children:t.jsx("path",{d:on,fill:"currentColor"})}),i[0]=e):e=i[0],e}function un(i){const e=de.c(5),{platform:s}=i,l=`watermark-preview-platform-icon watermark-preview-${s}-icon`,n=Zl[s];let a;e[0]!==n?(a=t.jsx("path",{d:n,fill:"currentColor"}),e[0]=n,e[1]=a):a=e[1];let r;return e[2]!==l||e[3]!==a?(r=t.jsx("svg",{className:l,viewBox:"0 0 24 24","aria-hidden":"true",children:a}),e[2]=l,e[3]=a,e[4]=r):r=e[4],r}function ot(i){return Math.round(i*100)}function hn(i){return i>0?`${i.toFixed(1)}s`:"Off"}function fn(i,e,s){if(s<=0)return{left:0,width:100};const l=it(i/s*100,0,100),n=it((e??s)/s*100,l,100);return{left:l,width:n-l}}function it(i,e,s){return Math.min(s,Math.max(e,i))}function Rt(i){return Number.isFinite(i)?`${i.toFixed(1)}s`:"0.0s"}function ht(i,e){return cn*(Math.min(i,e)/e)}function pn(i,e,s){const[l,n]=i.split("-"),a=[],r={aspectRatio:"1 / 1",height:`${ht(e,s)}%`};n==="left"&&(r.left="2%"),n==="right"&&(r.right="2%"),n==="center"&&(r.left="50%",a.push("translateX(-50%)"));const u=`${2*(e/s)}%`;return l==="top"&&(r.top=u),l==="bottom"&&(r.bottom=u),l==="middle"&&(r.top="50%",a.push("translateY(-50%)")),a.length>0&&(r.transform=a.join(" ")),r}function xn(i,e,s,l,n,a){const r=Ot(l);if(n==="center")return{aspectRatio:`${mt} / ${r}`,height:`${ht(i,e)*(r/es)}%`,top:`${s}%`,left:"50%",transform:"translate(-50%, -50%)"};const[u,c]=a.split("-"),p=ht(i,e),o=p*(e/i),f=p*(r/mt),d=2*(i/e),m=Math.max(.4,p*.06);let h=c==="left"?2:c==="right"?98-o:50-o/2;const x=u==="top"?d:u==="bottom"?100-d-p:50-p/2;let g=n==="above-qr"?x-f-m:n==="below-qr"?x+p+m:x+(p-f)/2;return h=it(h,2,98-o),g=it(g,d,100-d-f),{aspectRatio:`${mt} / ${r}`,width:`${o}%`,height:"auto",top:`${g}%`,left:`${h}%`}}function gn(i,e,s){const l=(Ot(e)-2)/2*(s/100);return{paddingInline:`${i/At}em`,borderRadius:`${l/At}em`}}function ct(i){const e=de.c(16),{busy:s,checked:l,description:n,disabled:a,label:r,onChange:u}=i,p=s||(a===void 0?!1:a);let o;e[0]!==u?(o=g=>u(g.target.checked),e[0]=u,e[1]=o):o=e[1];let f;e[2]!==l||e[3]!==p||e[4]!==o?(f=t.jsx("input",{type:"checkbox",checked:l,disabled:p,onChange:o}),e[2]=l,e[3]=p,e[4]=o,e[5]=f):f=e[5];let d;e[6]!==r?(d=t.jsx("strong",{children:r}),e[6]=r,e[7]=d):d=e[7];let m;e[8]!==n?(m=t.jsx("small",{children:n}),e[8]=n,e[9]=m):m=e[9];let h;e[10]!==d||e[11]!==m?(h=t.jsxs("span",{className:"confirm-toggle-copy",children:[d,m]}),e[10]=d,e[11]=m,e[12]=h):h=e[12];let x;return e[13]!==f||e[14]!==h?(x=t.jsxs("label",{className:"confirm-toggle",children:[f,h]}),e[13]=f,e[14]=h,e[15]=x):x=e[15],x}function st(i){const e=de.c(19),{busy:s,id:l,label:n,max:a,min:r,onChange:u,output:c,value:p}=i;let o;e[0]!==l||e[1]!==n?(o=t.jsx("label",{htmlFor:l,children:n}),e[0]=l,e[1]=n,e[2]=o):o=e[2];let f;e[3]!==l||e[4]!==c?(f=t.jsx("output",{htmlFor:l,children:c}),e[3]=l,e[4]=c,e[5]=f):f=e[5];let d;e[6]!==u?(d=x=>u(Number(x.target.value)),e[6]=u,e[7]=d):d=e[7];let m;e[8]!==s||e[9]!==l||e[10]!==a||e[11]!==r||e[12]!==d||e[13]!==p?(m=t.jsx("input",{id:l,type:"range",min:r,max:a,step:"1",value:p,disabled:s,onChange:d}),e[8]=s,e[9]=l,e[10]=a,e[11]=r,e[12]=d,e[13]=p,e[14]=m):m=e[14];let h;return e[15]!==o||e[16]!==f||e[17]!==m?(h=t.jsxs("div",{className:"confirm-range",children:[o,f,m]}),e[15]=o,e[16]=f,e[17]=m,e[18]=h):h=e[18],h}function Tt(i){const e=de.c(102),{busy:s,currentTime:l,duration:n,endSeconds:a,idPrefix:r,label:u,onChange:c,playhead:p,startSeconds:o}=i;let f;e[0]!==n||e[1]!==a||e[2]!==o?(f=ts(o,a,n),e[0]=n,e[1]=a,e[2]=o,e[3]=f):f=e[3];const d=f;let m;e[4]!==n||e[5]!==a||e[6]!==o?(m=fn(o,a,n),e[4]=n,e[5]=a,e[6]=o,e[7]=m):m=e[7];const h=m,x=a??(n>0?n:null),g=`${u} timing`;let S;e[8]!==u?(S=t.jsx("span",{children:u}),e[8]=u,e[9]=S):S=e[9];const j=`${h.left}%`,C=`${h.width}%`;let y;e[10]!==j||e[11]!==C?(y=t.jsx("span",{className:"watermark-timeline-window",style:{left:j,width:C}}),e[10]=j,e[11]=C,e[12]=y):y=e[12];const k=`${p}%`;let w;e[13]!==k?(w=t.jsx("span",{className:"watermark-timeline-playhead",style:{left:k}}),e[13]=k,e[14]=w):w=e[14];let b;e[15]!==y||e[16]!==w?(b=t.jsxs("div",{className:"watermark-timeline","aria-hidden":"true",children:[y,w]}),e[15]=y,e[16]=w,e[17]=b):b=e[17];let v;e[18]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{children:"Start (s)"}),e[18]=v):v=e[18];const _=`${r}-start`,$=`${u} start`,A=n>0?n:void 0;let N;e[19]!==a||e[20]!==c?(N=ae=>c(Math.max(0,Number(ae.target.value)||0),a),e[19]=a,e[20]=c,e[21]=N):N=e[21];let E;e[22]!==s||e[23]!==o||e[24]!==_||e[25]!==$||e[26]!==A||e[27]!==N?(E=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[v,t.jsx("input",{id:_,"aria-label":$,type:"number",min:"0",max:A,step:"0.1",value:o,disabled:s,onChange:N})]}),e[22]=s,e[23]=o,e[24]=_,e[25]=$,e[26]=A,e[27]=N,e[28]=E):E=e[28];let I;e[29]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx("span",{children:"End (s)"}),e[29]=I):I=e[29];const F=`${r}-end`,M=`${u} end`,D=!d,V=n>0?n:void 0,U=a??"";let B;e[30]!==n?(B=n>0?n.toFixed(1):"Clip end",e[30]=n,e[31]=B):B=e[31];let L;e[32]!==c||e[33]!==o?(L=ae=>c(o,ae.target.value===""?null:Math.max(0,Number(ae.target.value)||0)),e[32]=c,e[33]=o,e[34]=L):L=e[34];let H;e[35]!==s||e[36]!==F||e[37]!==M||e[38]!==D||e[39]!==V||e[40]!==U||e[41]!==B||e[42]!==L?(H=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[I,t.jsx("input",{id:F,"aria-label":M,"aria-invalid":D,type:"number",min:"0",max:V,step:"0.1",value:U,placeholder:B,disabled:s,onChange:L})]}),e[35]=s,e[36]=F,e[37]=M,e[38]=D,e[39]=V,e[40]=U,e[41]=B,e[42]=L,e[43]=H):H=e[43];let T;e[44]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx("span",{children:"Duration (s)"}),e[44]=T):T=e[44];const O=`${r}-duration`,Y=`${u} duration`,X=!d,te=n>0?Math.max(0,n-o):void 0;let W;e[45]!==o||e[46]!==x?(W=x===null?"":Number(Math.max(0,x-o).toFixed(6)),e[45]=o,e[46]=x,e[47]=W):W=e[47];let z;e[48]!==n||e[49]!==c||e[50]!==o?(z=ae=>c(o,ae.target.value===""?null:Number(Math.min(n>0?n:1/0,o+Math.max(0,Number(ae.target.value)||0)).toFixed(6))),e[48]=n,e[49]=c,e[50]=o,e[51]=z):z=e[51];let G;e[52]!==s||e[53]!==O||e[54]!==Y||e[55]!==X||e[56]!==te||e[57]!==W||e[58]!==z?(G=t.jsxs("label",{className:"confirm-watermark-timing-field",children:[T,t.jsx("input",{id:O,"aria-label":Y,"aria-invalid":X,type:"number",min:"0",max:te,step:"any",value:W,placeholder:"Clip end",disabled:s,onChange:z})]}),e[52]=s,e[53]=O,e[54]=Y,e[55]=X,e[56]=te,e[57]=W,e[58]=z,e[59]=G):G=e[59];const K=`Set ${u} start from playhead`;let Z;e[60]!==l||e[61]!==a||e[62]!==c?(Z=()=>c(a===null?l:Math.min(l,Math.max(0,a-.1)),a),e[60]=l,e[61]=a,e[62]=c,e[63]=Z):Z=e[63];let ge;e[64]===Symbol.for("react.memo_cache_sentinel")?(ge=t.jsx(kt,{size:8,"aria-hidden":"true"}),e[64]=ge):ge=e[64];let se;e[65]!==s||e[66]!==K||e[67]!==Z?(se=t.jsxs("button",{type:"button","aria-label":K,disabled:s,onClick:Z,children:[ge,"Start"]}),e[65]=s,e[66]=K,e[67]=Z,e[68]=se):se=e[68];const be=`Set ${u} end from playhead`;let ne;e[69]!==l||e[70]!==c||e[71]!==o?(ne=()=>c(o,Math.max(l,o+.1)),e[69]=l,e[70]=c,e[71]=o,e[72]=ne):ne=e[72];let pe;e[73]===Symbol.for("react.memo_cache_sentinel")?(pe=t.jsx(kt,{size:8,"aria-hidden":"true"}),e[73]=pe):pe=e[73];let oe;e[74]!==s||e[75]!==be||e[76]!==ne?(oe=t.jsxs("button",{type:"button","aria-label":be,disabled:s,onClick:ne,children:[pe,"End"]}),e[74]=s,e[75]=be,e[76]=ne,e[77]=oe):oe=e[77];const we=`Use whole clip for ${u}`;let ie;e[78]!==c?(ie=()=>c(0,null),e[78]=c,e[79]=ie):ie=e[79];let me;e[80]!==s||e[81]!==we||e[82]!==ie?(me=t.jsx("button",{type:"button","aria-label":we,disabled:s,onClick:ie,children:"Whole"}),e[80]=s,e[81]=we,e[82]=ie,e[83]=me):me=e[83];let ce;e[84]!==se||e[85]!==oe||e[86]!==me?(ce=t.jsxs("div",{className:"confirm-watermark-timing-actions",children:[se,oe,me]}),e[84]=se,e[85]=oe,e[86]=me,e[87]=ce):ce=e[87];let le;e[88]!==b||e[89]!==E||e[90]!==H||e[91]!==G||e[92]!==S||e[93]!==ce?(le=t.jsxs("div",{className:"confirm-watermark-timing-row",children:[S,b,E,H,G,ce]}),e[88]=b,e[89]=E,e[90]=H,e[91]=G,e[92]=S,e[93]=ce,e[94]=le):le=e[94];let J;e[95]!==u||e[96]!==d?(J=!d&&t.jsxs("p",{className:"confirm-field-error",children:[u," end time must be after its start time."]}),e[95]=u,e[96]=d,e[97]=J):J=e[97];let ue;return e[98]!==g||e[99]!==le||e[100]!==J?(ue=t.jsxs("div",{className:"confirm-watermark-timing",role:"group","aria-label":g,children:[le,J]}),e[98]=g,e[99]=le,e[100]=J,e[101]=ue):ue=e[101],ue}function bn(i){const e=de.c(228),{busy:s,state:l,onChange:n,onMediaMetadata:a}=i,[r,u]=je.useState(0),c=l.identities[l.platform];let p,o,f;e[0]!==c.handle||e[1]!==l.platform?(p=Bl(c.handle),o=Dt[l.platform],f=zl(p||"<handle>",l.platform),e[0]=c.handle,e[1]=l.platform,e[2]=p,e[3]=o,e[4]=f):(p=e[2],o=e[3],f=e[4]);const d=f,m=l.durationSeconds??0,h=l.includeHandle&&!p;let x;e[5]!==p||e[6]!==l.includeQr||e[7]!==l.url?(x=l.includeQr&&!l.url.trim()&&!p,e[5]=p,e[6]=l.includeQr,e[7]=l.url,e[8]=x):x=e[8];const g=x;let S;e[9]!==r||e[10]!==m||e[11]!==l.fadeSeconds||e[12]!==l.qrEndSeconds||e[13]!==l.qrOpacity||e[14]!==l.qrStartSeconds?(S=jt(r,l.qrStartSeconds,l.qrEndSeconds,m,l.qrOpacity,l.fadeSeconds),e[9]=r,e[10]=m,e[11]=l.fadeSeconds,e[12]=l.qrEndSeconds,e[13]=l.qrOpacity,e[14]=l.qrStartSeconds,e[15]=S):S=e[15];const j=S;let C;e[16]!==r||e[17]!==m||e[18]!==l.fadeSeconds||e[19]!==l.handleEndSeconds||e[20]!==l.handleOpacity||e[21]!==l.handleStartSeconds?(C=jt(r,l.handleStartSeconds,l.handleEndSeconds,m,l.handleOpacity,l.fadeSeconds),e[16]=r,e[17]=m,e[18]=l.fadeSeconds,e[19]=l.handleEndSeconds,e[20]=l.handleOpacity,e[21]=l.handleStartSeconds,e[22]=C):C=e[22];const y=C,k=l.position==="auto"?"bottom-right":l.position,w=l.width!==null&&l.width>0?l.width:16,b=l.height!==null&&l.height>0?l.height:9;let v;e[23]!==r||e[24]!==m?(v=m>0?it(r/m*100,0,100):0,e[23]=r,e[24]=m,e[25]=v):v=e[25];const _=v;let $;e[26]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{children:"Preview"}),e[26]=$):$=e[26];let A;e[27]!==r?(A=Rt(r),e[27]=r,e[28]=A):A=e[28];let N;e[29]!==m?(N=m>0?Rt(m):"—",e[29]=m,e[30]=N):N=e[30];let E;e[31]!==A||e[32]!==N?(E=t.jsxs("div",{className:"confirm-section-heading",children:[$,t.jsxs("strong",{children:[A," / ",N]})]}),e[31]=A,e[32]=N,e[33]=E):E=e[33];let I;e[34]!==s||e[35]!==r||e[36]!==m||e[37]!==n||e[38]!==_||e[39]!==l.includeQr||e[40]!==l.qrEndSeconds||e[41]!==l.qrStartSeconds?(I=l.includeQr&&t.jsx(Tt,{busy:s,currentTime:r,duration:m,endSeconds:l.qrEndSeconds,idPrefix:"watermark-qr-timing",label:"QR",playhead:_,startSeconds:l.qrStartSeconds,onChange:(P,he)=>n({qrStartSeconds:P,qrEndSeconds:he})}),e[34]=s,e[35]=r,e[36]=m,e[37]=n,e[38]=_,e[39]=l.includeQr,e[40]=l.qrEndSeconds,e[41]=l.qrStartSeconds,e[42]=I):I=e[42];let F;e[43]!==s||e[44]!==r||e[45]!==m||e[46]!==n||e[47]!==_||e[48]!==l.handleEndSeconds||e[49]!==l.handleStartSeconds||e[50]!==l.includeHandle?(F=l.includeHandle&&t.jsx(Tt,{busy:s,currentTime:r,duration:m,endSeconds:l.handleEndSeconds,idPrefix:"watermark-handle-timing",label:"Handle",playhead:_,startSeconds:l.handleStartSeconds,onChange:(P,he)=>n({handleStartSeconds:P,handleEndSeconds:he})}),e[43]=s,e[44]=r,e[45]=m,e[46]=n,e[47]=_,e[48]=l.handleEndSeconds,e[49]=l.handleStartSeconds,e[50]=l.includeHandle,e[51]=F):F=e[51];let M;e[52]!==I||e[53]!==F?(M=t.jsxs("div",{className:"confirm-watermark-timings",children:[I,F]}),e[52]=I,e[53]=F,e[54]=M):M=e[54];const D=`${w} / ${b}`,V=w/b;let U;e[55]!==D||e[56]!==V?(U={aspectRatio:D,"--watermark-preview-ratio":V},e[55]=D,e[56]=V,e[57]=U):U=e[57];const B=U;let L;e[58]!==a||e[59]!==l.mediaUrl||e[60]!==l.thumbnailUrl?(L=l.mediaUrl?t.jsx("video",{src:l.mediaUrl,poster:l.thumbnailUrl??void 0,controls:!0,playsInline:!0,preload:"metadata",onLoadedMetadata:P=>{const he=P.currentTarget;Number.isFinite(he.duration)&&he.duration>0&&he.videoWidth>0&&he.videoHeight>0&&a({durationSeconds:he.duration,width:he.videoWidth,height:he.videoHeight})},onTimeUpdate:P=>u(P.currentTarget.currentTime),onSeeked:P=>u(P.currentTarget.currentTime)}):l.thumbnailUrl?t.jsx("img",{src:l.thumbnailUrl,alt:""}):t.jsx("span",{className:"watermark-preview-empty",children:"Video preview unavailable"}),e[58]=a,e[59]=l.mediaUrl,e[60]=l.thumbnailUrl,e[61]=L):L=e[61];let H;e[62]!==b||e[63]!==k||e[64]!==w||e[65]!==j||e[66]!==l.includeQr?(H=l.includeQr&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-qr",style:{...pn(k,w,b),opacity:j},"aria-hidden":"true",children:t.jsx(mn,{})}),e[62]=b,e[63]=k,e[64]=w,e[65]=j,e[66]=l.includeQr,e[67]=H):H=e[67];let T;e[68]!==p||e[69]!==y||e[70]!==b||e[71]!==k||e[72]!==w||e[73]!==l.handlePadding||e[74]!==l.handlePaddingY||e[75]!==l.handlePlacement||e[76]!==l.handleRounding||e[77]!==l.handleVerticalPercent||e[78]!==l.includeHandle||e[79]!==l.includeHandleBorder||e[80]!==l.includePlatformIcon||e[81]!==l.includeQr||e[82]!==l.platform?(T=l.includeHandle&&t.jsx("span",{className:"watermark-preview-overlay watermark-preview-handle",style:{...xn(w,b,l.handleVerticalPercent,l.handlePaddingY,l.includeQr?l.handlePlacement:"center",k),opacity:y},"aria-hidden":"true",children:t.jsxs("span",{className:`watermark-preview-handle-pill${l.includeHandleBorder?"":" without-border"}`,style:gn(l.handlePadding,l.handlePaddingY,l.handleRounding),children:[l.includePlatformIcon&&t.jsx(un,{platform:l.platform}),t.jsx("span",{children:p||"handle"})]})}),e[68]=p,e[69]=y,e[70]=b,e[71]=k,e[72]=w,e[73]=l.handlePadding,e[74]=l.handlePaddingY,e[75]=l.handlePlacement,e[76]=l.handleRounding,e[77]=l.handleVerticalPercent,e[78]=l.includeHandle,e[79]=l.includeHandleBorder,e[80]=l.includePlatformIcon,e[81]=l.includeQr,e[82]=l.platform,e[83]=T):T=e[83];let O;e[84]!==l.includeQr||e[85]!==l.position?(O=l.includeQr&&l.position==="auto"&&t.jsx("span",{className:"watermark-auto-preview",children:"AUTO · QR previewing bottom right"}),e[84]=l.includeQr,e[85]=l.position,e[86]=O):O=e[86];let Y;e[87]!==B||e[88]!==L||e[89]!==H||e[90]!==T||e[91]!==O?(Y=t.jsxs("div",{className:"watermark-video-stage",style:B,children:[L,H,T,O]}),e[87]=B,e[88]=L,e[89]=H,e[90]=T,e[91]=O,e[92]=Y):Y=e[92];let X;e[93]!==M||e[94]!==Y||e[95]!==E?(X=t.jsxs("section",{className:"confirm-section confirm-watermark-preview","aria-label":"Preview",children:[E,M,Y]}),e[93]=M,e[94]=Y,e[95]=E,e[96]=X):X=e[96];let te;e[97]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsx("span",{className:"confirm-section-label",children:"Identity"}),e[97]=te):te=e[97];let W;e[98]===Symbol.for("react.memo_cache_sentinel")?(W=t.jsx("span",{children:"Platform"}),e[98]=W):W=e[98];const z=l.platform;let G;e[99]!==n?(G=P=>{const he=P.target.value;ls(he)&&n({platform:he})},e[99]=n,e[100]=G):G=e[100];let K;e[101]===Symbol.for("react.memo_cache_sentinel")?(K=ss.map(vn),e[101]=K):K=e[101];let Z;e[102]!==s||e[103]!==l.platform||e[104]!==G?(Z=t.jsxs("label",{className:"confirm-field",children:[W,t.jsx("select",{value:z,disabled:s,onChange:G,children:K})]}),e[102]=s,e[103]=l.platform,e[104]=G,e[105]=Z):Z=e[105];const ge=l.includeHandle&&!l.includeQr;let se;e[106]!==n?(se=P=>n({includeHandle:P}),e[106]=n,e[107]=se):se=e[107];let be;e[108]!==s||e[109]!==l.includeHandle||e[110]!==ge||e[111]!==se?(be=t.jsx(ct,{busy:s,checked:l.includeHandle,description:"Centered account badge",disabled:ge,label:"Include handle",onChange:se}),e[108]=s,e[109]=l.includeHandle,e[110]=ge,e[111]=se,e[112]=be):be=e[112];let ne;e[113]!==s||e[114]!==p||e[115]!==h||e[116]!==c.handle||e[117]!==c.recent||e[118]!==n||e[119]!==o||e[120]!==l.includeHandle||e[121]!==l.loadingConfig?(ne=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"confirm-field",children:[t.jsxs("span",{children:[o," handle"]}),t.jsxs("div",{className:`confirm-handle-field${h?" invalid":""}`,children:[t.jsx("span",{"aria-hidden":"true",children:"@"}),t.jsx("input",{type:"text",value:c.handle,placeholder:l.loadingConfig?"Loading…":"handle","aria-invalid":h,disabled:s,onChange:P=>n({handle:P.target.value})})]}),h&&t.jsx("span",{className:"confirm-field-error",children:"Required while Include handle is on"})]}),c.recent.length>0&&t.jsx("div",{className:"confirm-chips",role:"group","aria-label":"Recent handles",children:c.recent.map(P=>t.jsxs("button",{type:"button",className:P===p?"active":"","aria-pressed":P===p,disabled:s,onClick:()=>n({handle:P}),children:["@",P]},P))})]}),e[113]=s,e[114]=p,e[115]=h,e[116]=c.handle,e[117]=c.recent,e[118]=n,e[119]=o,e[120]=l.includeHandle,e[121]=l.loadingConfig,e[122]=ne):ne=e[122];const pe=l.includeQr&&!l.includeHandle;let oe;e[123]!==n?(oe=P=>n({includeQr:P,...P?{}:{handlePlacement:"center"}}),e[123]=n,e[124]=oe):oe=e[124];let we;e[125]!==s||e[126]!==l.includeQr||e[127]!==pe||e[128]!==oe?(we=t.jsx(ct,{busy:s,checked:l.includeQr,description:"Separately placed scannable link",disabled:pe,label:"Include QR code",onChange:oe}),e[125]=s,e[126]=l.includeQr,e[127]=pe,e[128]=oe,e[129]=we):we=e[129];let ie;e[130]!==s||e[131]!==g||e[132]!==n||e[133]!==l.includeQr||e[134]!==l.url||e[135]!==d?(ie=l.includeQr&&t.jsxs("label",{className:"confirm-field",children:[t.jsx("span",{children:"QR link"}),t.jsx("input",{type:"text",value:l.url,placeholder:d,"aria-invalid":g,disabled:s,onChange:P=>n({url:P.target.value})}),g&&t.jsx("span",{className:"confirm-field-error",children:"Enter a link, or a handle it can point to"})]}),e[130]=s,e[131]=g,e[132]=n,e[133]=l.includeQr,e[134]=l.url,e[135]=d,e[136]=ie):ie=e[136];let me;e[137]!==s||e[138]!==n||e[139]!==l.includeHandle||e[140]!==l.saveDefault?(me=l.includeHandle&&t.jsxs("label",{className:"confirm-check",children:[t.jsx("input",{type:"checkbox",checked:l.saveDefault,disabled:s,onChange:P=>n({saveDefault:P.target.checked})}),"Save as default handle"]}),e[137]=s,e[138]=n,e[139]=l.includeHandle,e[140]=l.saveDefault,e[141]=me):me=e[141];let ce;e[142]!==Z||e[143]!==be||e[144]!==ne||e[145]!==we||e[146]!==ie||e[147]!==me?(ce=t.jsxs("section",{className:"confirm-section","aria-label":"Identity",children:[te,Z,be,ne,we,ie,me]}),e[142]=Z,e[143]=be,e[144]=ne,e[145]=we,e[146]=ie,e[147]=me,e[148]=ce):ce=e[148];let le;e[149]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx("span",{className:"confirm-section-label",children:"Appearance"}),e[149]=le):le=e[149];let J;e[150]!==s||e[151]!==n||e[152]!==o||e[153]!==l.handlePadding||e[154]!==l.handlePaddingY||e[155]!==l.handleRounding||e[156]!==l.includeHandle||e[157]!==l.includeHandleBorder||e[158]!==l.includePlatformIcon?(J=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsx(ct,{busy:s,checked:l.includePlatformIcon,description:`${o} mark before the handle`,label:`Show ${o} icon`,onChange:P=>n({includePlatformIcon:P})}),t.jsx(ct,{busy:s,checked:l.includeHandleBorder,description:"Outline around the pill",label:"Handle border",onChange:P=>n({includeHandleBorder:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-x",label:"Handle padding X",min:wt,max:yt,output:`${l.handlePadding}px`,value:l.handlePadding,onChange:P=>n({handlePadding:P})}),t.jsx(st,{busy:s,id:"watermark-handle-padding-y",label:"Handle padding Y",min:wt,max:yt,output:`${l.handlePaddingY}px`,value:l.handlePaddingY,onChange:P=>n({handlePaddingY:P})}),t.jsx(st,{busy:s,id:"watermark-handle-rounding",label:"Corner rounding",min:Gl,max:Wl,output:`${l.handleRounding}%`,value:l.handleRounding,onChange:P=>n({handleRounding:P})})]}),e[150]=s,e[151]=n,e[152]=o,e[153]=l.handlePadding,e[154]=l.handlePaddingY,e[155]=l.handleRounding,e[156]=l.includeHandle,e[157]=l.includeHandleBorder,e[158]=l.includePlatformIcon,e[159]=J):J=e[159];let ue;e[160]!==s||e[161]!==n||e[162]!==l.includeQr||e[163]!==l.qrOpacity?(ue=l.includeQr&&t.jsx(st,{busy:s,id:"watermark-qr-opacity",label:"QR opacity",min:St*100,max:Nt*100,output:`${ot(l.qrOpacity)}%`,value:ot(l.qrOpacity),onChange:P=>n({qrOpacity:P/100})}),e[160]=s,e[161]=n,e[162]=l.includeQr,e[163]=l.qrOpacity,e[164]=ue):ue=e[164];let ae;e[165]!==s||e[166]!==n||e[167]!==l.handleOpacity||e[168]!==l.includeHandle?(ae=l.includeHandle&&t.jsx(st,{busy:s,id:"watermark-handle-opacity",label:"Handle opacity",min:St*100,max:Nt*100,output:`${ot(l.handleOpacity)}%`,value:ot(l.handleOpacity),onChange:P=>n({handleOpacity:P/100})}),e[165]=s,e[166]=n,e[167]=l.handleOpacity,e[168]=l.includeHandle,e[169]=ae):ae=e[169];let re;e[170]!==l.fadeSeconds?(re=hn(l.fadeSeconds),e[170]=l.fadeSeconds,e[171]=re):re=e[171];let Se;e[172]!==l.fadeSeconds?(Se=Math.round(l.fadeSeconds*10),e[172]=l.fadeSeconds,e[173]=Se):Se=e[173];let ve;e[174]!==n?(ve=P=>n({fadeSeconds:P/10}),e[174]=n,e[175]=ve):ve=e[175];let ye;e[176]!==s||e[177]!==re||e[178]!==Se||e[179]!==ve?(ye=t.jsx(st,{busy:s,id:"watermark-fade",label:"Fade in/out",min:is*10,max:ns*10,output:re,value:Se,onChange:ve}),e[176]=s,e[177]=re,e[178]=Se,e[179]=ve,e[180]=ye):ye=e[180];let Ce;e[181]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("small",{className:"confirm-help",children:"Fades only where a watermark starts or ends inside the clip."}),e[181]=Ce):Ce=e[181];let xe;e[182]!==J||e[183]!==ue||e[184]!==ae||e[185]!==ye?(xe=t.jsxs("section",{className:"confirm-section","aria-label":"Appearance",children:[le,J,ue,ae,ye,Ce]}),e[182]=J,e[183]=ue,e[184]=ae,e[185]=ye,e[186]=xe):xe=e[186];let Ne;e[187]===Symbol.for("react.memo_cache_sentinel")?(Ne=t.jsx("span",{className:"confirm-section-label",children:"Position"}),e[187]=Ne):Ne=e[187];let fe;e[188]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("span",{children:"QR position"}),e[188]=fe):fe=e[188];const ee=`confirm-chip${l.position==="auto"?" active":""}`,Ee=l.position==="auto",$e=s||!l.includeQr;let ke;e[189]!==n?(ke=()=>n({position:"auto"}),e[189]=n,e[190]=ke):ke=e[190];let Re;e[191]!==ee||e[192]!==Ee||e[193]!==$e||e[194]!==ke?(Re=t.jsxs("div",{className:"confirm-watermark-qr-position-heading",children:[fe,t.jsx("button",{type:"button",className:ee,"aria-pressed":Ee,disabled:$e,onClick:ke,children:"Auto"})]}),e[191]=ee,e[192]=Ee,e[193]=$e,e[194]=ke,e[195]=Re):Re=e[195];let Te;e[196]!==s||e[197]!==n||e[198]!==l.includeQr||e[199]!==l.position?(Te=Kl.map(P=>t.jsx("button",{type:"button",className:l.position===P?"active":"","aria-label":$t[P],"aria-pressed":l.position===P,title:$t[P],disabled:s||!l.includeQr,onClick:()=>n({position:P}),children:t.jsx("span",{})},P)),e[196]=s,e[197]=n,e[198]=l.includeQr,e[199]=l.position,e[200]=Te):Te=e[200];let Oe;e[201]!==Te?(Oe=t.jsx("div",{className:"confirm-position-grid",role:"group","aria-label":"QR position",children:Te}),e[201]=Te,e[202]=Oe):Oe=e[202];let De;e[203]!==Re||e[204]!==Oe?(De=t.jsxs("div",{className:"confirm-watermark-qr-position",children:[Re,Oe]}),e[203]=Re,e[204]=Oe,e[205]=De):De=e[205];let Pe;e[206]!==s||e[207]!==n||e[208]!==l.handlePlacement||e[209]!==l.handleVerticalPercent||e[210]!==l.includeHandle||e[211]!==l.includeQr?(Pe=l.includeHandle&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"confirm-watermark-handle-placement",children:[t.jsx("span",{children:"Handle placement"}),t.jsx("div",{className:"confirm-chips",role:"group","aria-label":"Handle placement",children:Yl.map(P=>{const Ue=s||P!=="center"&&!l.includeQr;return t.jsx("button",{type:"button",className:l.handlePlacement===P?"active":"","aria-pressed":l.handlePlacement===P,disabled:Ue,onClick:()=>n({handlePlacement:P}),children:dn[P]},P)})})]}),l.handlePlacement==="center"&&t.jsx(st,{busy:s,id:"watermark-handle-vertical",label:"Handle vertical position",min:Jl,max:Xl,output:`${l.handleVerticalPercent}% from top`,value:l.handleVerticalPercent,onChange:P=>n({handleVerticalPercent:P})})]}),e[206]=s,e[207]=n,e[208]=l.handlePlacement,e[209]=l.handleVerticalPercent,e[210]=l.includeHandle,e[211]=l.includeQr,e[212]=Pe):Pe=e[212];const ze=l.includeQr&&l.includeHandle?l.handlePlacement==="center"?"Auto places the QR away from faces and text. The handle stays horizontally centered.":"Auto places the QR away from faces and text. The handle sits with the QR.":l.includeQr?"Auto places the QR away from faces and text.":"The handle stays horizontally centered.";let _e;e[213]!==ze?(_e=t.jsx("small",{className:"confirm-help",children:ze}),e[213]=ze,e[214]=_e):_e=e[214];let Fe;e[215]!==Pe||e[216]!==_e?(Fe=t.jsxs("div",{className:"confirm-watermark-handle-position",children:[Pe,_e]}),e[215]=Pe,e[216]=_e,e[217]=Fe):Fe=e[217];let Ie;e[218]!==De||e[219]!==Fe?(Ie=t.jsxs("section",{className:"confirm-section confirm-watermark-position","aria-label":"Position",children:[Ne,De,Fe]}),e[218]=De,e[219]=Fe,e[220]=Ie):Ie=e[220];let Le;e[221]!==ce||e[222]!==xe||e[223]!==Ie?(Le=t.jsxs("div",{className:"confirm-watermark-controls",children:[ce,xe,Ie]}),e[221]=ce,e[222]=xe,e[223]=Ie,e[224]=Le):Le=e[224];let He;return e[225]!==X||e[226]!==Le?(He=t.jsxs("div",{className:"confirm-watermark",children:[X,Le]}),e[225]=X,e[226]=Le,e[227]=He):He=e[227],He}function vn(i){return t.jsx("option",{value:i,children:Dt[i]},i)}const Tn=Object.freeze(Object.defineProperty({__proto__:null,WatermarkBody:bn},Symbol.toStringTag,{value:"Module"}));export{Sn as C,kn as G,Rn as N,Cn as P,$n as R,_n as S,Pn as T,Tn as W,An as a,En as b};
@@ -1 +1 @@
1
- import{a as i,j as t,b as ce,c as Q}from"./vendor-react-Dj7D1fD4.js";import{B as ue,l as de}from"./ui-z5r-p0K9.js";import{by as W,dO as me,dP as fe,dQ as pe}from"./videobook-CsW453sb.js";import{ap as he,a2 as be,X as xe}from"./vendor-icons-CGqhCIXV.js";function X(n){const e=Q.c(7),{address:u,asset:a}=n;let o;e[0]!==u?(o=t.jsxs("strong",{children:["@",u]}),e[0]=u,e[1]=o):o=e[1];let l;e[2]!==a?(l=me(a).map(ye),e[2]=a,e[3]=l):l=e[3];let c;return e[4]!==o||e[5]!==l?(c=t.jsxs("p",{className:"media-fullscreen-details",children:[o,l]}),e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function ye(n){return t.jsx("span",{children:n},n)}function ge(n){return n instanceof HTMLElement&&(n.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName))}function je(n){const e=Q.c(11),{address:u,playbackUrl:a,posterUrl:o,videoRef:l}=n;if(!a){let d;e[0]!==u||e[1]!==o?(d=o?t.jsx("img",{src:o,alt:`@${u} poster`}):null,e[0]=u,e[1]=o,e[2]=d):d=e[2];let h,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("strong",{children:"Playback unavailable"}),b=t.jsx("p",{children:"This video has a preview image but no playable media yet."}),e[3]=h,e[4]=b):(h=e[3],b=e[4]);let x;return e[5]!==d?(x=t.jsxs("div",{className:"notebook-media-unavailable",role:"status",children:[d,h,b]}),e[5]=d,e[6]=x):x=e[6],x}const c=o??void 0;let p;return e[7]!==a||e[8]!==c||e[9]!==l?(p=t.jsx("video",{ref:l,src:a,poster:c,controls:!0,tabIndex:0,controlsList:"nofullscreen nodownload noremoteplayback",disablePictureInPicture:!0,playsInline:!0,autoPlay:!0,preload:"auto"},a),e[7]=a,e[8]=c,e[9]=l,e[10]=p):p=e[10],p}function Ne({asset:n,address:e,initialMode:u="view",subjectMap:a=null,subjectMapLoading:o=!1,analysisUnavailableReason:l=null,composerPortalRef:c,actionsOpen:p=!1,returnFocus:d=null,initialRegions:h,initialInstruction:b="",onInstructionChange:x,replacementCandidates:G=[],imageEditModels:J,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,onAnalyzeSubjects:ee,onCaptureFrame:w,onEditingChange:te,onEditSubjects:A,onSubmitEditInstruction:M,onClose:T}){const g=i.useRef(null),$=i.useRef(null),j=i.useRef(null),U=i.useRef(null),N=i.useRef(null),y=i.useRef(!1),m=n.type==="video"||n.type==="final",R=n.mediaUrl,D=n.thumbnailUrl,v=R??D,L=m||!!v,P=!m&&!!(A||M),[se,C]=i.useState(m?"view":u),[ne,re]=i.useState(b),[F,B]=i.useState(!1),[S,I]=i.useState(null),E=se==="edit"&&!m;if(i.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),i.useEffect(()=>{if(!L)return;const s=g.current;if(!s)return;U.current=d??(document.activeElement instanceof HTMLElement?document.activeElement:null);const r=document.querySelector(".app-shell"),k=r?.inert??!1,f=r?.getAttribute("aria-hidden")??null,ie=document.body.style.overflow;return r&&(r.inert=!0,r.setAttribute("aria-hidden","true")),document.body.style.overflow="hidden",s.showModal(),j.current?.focus(),()=>{s.close(),r&&(r.inert=k,f===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",f)),document.body.style.overflow=ie;const V=N.current;if(V){N.current=null,V();return}const O=U.current;W(O),requestAnimationFrame(()=>W(O))}},[L,d]),!m&&!v)return null;const K=s=>{if(!g.current)return;const r=pe(g.current);(s==="first"?r[0]:r.at(-1))?.focus({preventScroll:!0})},z=s=>{s.detail>0&&(N.current=fe()),T()},q=()=>{C("view"),requestAnimationFrame(()=>j.current?.focus())},oe=async()=>{const s=$.current;if(!s||!w||F)return;const r=Number.isFinite(s.duration)?s.duration:null,k=Math.max(0,r===null?s.currentTime:Math.min(s.currentTime,Math.max(0,r-.05)));B(!0),I(null);try{const f=await w(k);y.current&&I({tone:"success",text:`Frame saved to ${f}`})}catch(f){y.current&&I({tone:"error",text:f instanceof Error?f.message:String(f)})}finally{y.current&&B(!1)}},ae=s=>{E||s.defaultPrevented||ge(s.target)||s.metaKey||s.ctrlKey||s.altKey||!P||s.key.toLowerCase()!=="e"||(s.preventDefault(),C("edit"))},le=t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"media-fullscreen-chrome",children:[t.jsx(X,{address:e,asset:n}),t.jsxs("div",{className:"notebook-media-fullscreen-actions",children:[P&&t.jsxs("button",{type:"button",className:"media-fullscreen-edit","aria-keyshortcuts":"E",onClick:()=>C("edit"),children:[t.jsx(he,{size:16}),"Edit image"]}),m&&R&&w&&t.jsxs("button",{type:"button",className:"notebook-media-capture-button",disabled:F,onClick:()=>{oe()},children:[F?t.jsx(ue,{size:16}):t.jsx(be,{size:16}),"Extract frame"]}),t.jsx("button",{ref:j,type:"button",className:"notebook-media-fullscreen-close",onClick:z,"aria-label":"Close fullscreen preview","aria-keyshortcuts":"Escape","data-composer-focus":"return",children:t.jsx(xe,{size:20})}),S&&t.jsx("p",{className:`notebook-media-capture-status ${S.tone}`,role:"status",children:S.text})]})]}),t.jsx("div",{className:"media-fullscreen-stage",children:m?t.jsx(je,{address:e,playbackUrl:R,posterUrl:D,videoRef:$}):t.jsx("img",{src:v??"",alt:`@${e}`})}),P&&t.jsxs("p",{className:"media-fullscreen-keys","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("kbd",{children:"E"})," edit"]}),t.jsxs("span",{children:[t.jsx("kbd",{children:"Esc"})," close"]})]})]}),H=t.jsxs("dialog",{ref:g,className:`notebook-media-fullscreen ${E?"image-editor":"media-viewer"}${m?" playback-only":""}`,role:"dialog","aria-modal":"true","aria-label":`Fullscreen preview for @${e}`,onKeyDown:ae,onCancel:s=>{s.preventDefault(),E?q():T()},children:[p&&t.jsx("div",{ref:c,className:"notebook-media-composer-host actions-only","aria-label":"Media actions input"}),t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("last")}),E?t.jsx(de,{address:e,mediaUrl:v??"",width:a?.width??n.width??1e3,height:a?.height??n.height??1e3,details:t.jsx(X,{address:e,asset:n}),subjectMap:a,subjectMapLoading:o,analysisUnavailableReason:l,initialRegions:h,instruction:ne,onInstructionChange:s=>{re(s),x?.(s)},replacementCandidates:G,imageEditModels:J,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,closeRef:j,onAnalyzeSubjects:ee,onEditingChange:te,onEditSubjects:A,onSubmitInstruction:M,onBack:q,onClose:z}):le,t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("first")})]});return typeof document>"u"?H:ce.createPortal(H,document.body)}export{Ne as N};
1
+ import{a as i,j as t,b as ce,c as Q}from"./vendor-react-Dj7D1fD4.js";import{B as ue,l as de}from"./ui-Cqs1-YNg.js";import{by as X,dP as me,dQ as fe,dR as pe}from"./videobook-b9VODNOA.js";import{ao as he,a2 as be,X as xe}from"./vendor-icons-D3KrGMJY.js";function O(n){const e=Q.c(7),{address:u,asset:a}=n;let o;e[0]!==u?(o=t.jsxs("strong",{children:["@",u]}),e[0]=u,e[1]=o):o=e[1];let l;e[2]!==a?(l=me(a).map(ye),e[2]=a,e[3]=l):l=e[3];let c;return e[4]!==o||e[5]!==l?(c=t.jsxs("p",{className:"media-fullscreen-details",children:[o,l]}),e[4]=o,e[5]=l,e[6]=c):c=e[6],c}function ye(n){return t.jsx("span",{children:n},n)}function ge(n){return n instanceof HTMLElement&&(n.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(n.tagName))}function je(n){const e=Q.c(11),{address:u,playbackUrl:a,posterUrl:o,videoRef:l}=n;if(!a){let d;e[0]!==u||e[1]!==o?(d=o?t.jsx("img",{src:o,alt:`@${u} poster`}):null,e[0]=u,e[1]=o,e[2]=d):d=e[2];let h,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("strong",{children:"Playback unavailable"}),b=t.jsx("p",{children:"This video has a preview image but no playable media yet."}),e[3]=h,e[4]=b):(h=e[3],b=e[4]);let x;return e[5]!==d?(x=t.jsxs("div",{className:"notebook-media-unavailable",role:"status",children:[d,h,b]}),e[5]=d,e[6]=x):x=e[6],x}const c=o??void 0;let p;return e[7]!==a||e[8]!==c||e[9]!==l?(p=t.jsx("video",{ref:l,src:a,poster:c,controls:!0,tabIndex:0,controlsList:"nofullscreen nodownload noremoteplayback",disablePictureInPicture:!0,playsInline:!0,autoPlay:!0,preload:"auto"},a),e[7]=a,e[8]=c,e[9]=l,e[10]=p):p=e[10],p}function Ne({asset:n,address:e,initialMode:u="view",subjectMap:a=null,subjectMapLoading:o=!1,analysisUnavailableReason:l=null,composerPortalRef:c,actionsOpen:p=!1,returnFocus:d=null,initialRegions:h,initialInstruction:b="",onInstructionChange:x,replacementCandidates:G=[],imageEditModels:J,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,onAnalyzeSubjects:ee,onCaptureFrame:w,onEditingChange:te,onEditSubjects:A,onSubmitEditInstruction:M,onClose:T}){const g=i.useRef(null),$=i.useRef(null),j=i.useRef(null),U=i.useRef(null),N=i.useRef(null),y=i.useRef(!1),m=n.type==="video"||n.type==="final",R=n.mediaUrl,D=n.thumbnailUrl,v=R??D,L=m||!!v,P=!m&&!!(A||M),[se,C]=i.useState(m?"view":u),[ne,re]=i.useState(b),[F,B]=i.useState(!1),[S,I]=i.useState(null),E=se==="edit"&&!m;if(i.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]),i.useEffect(()=>{if(!L)return;const s=g.current;if(!s)return;U.current=d??(document.activeElement instanceof HTMLElement?document.activeElement:null);const r=document.querySelector(".app-shell"),k=r?.inert??!1,f=r?.getAttribute("aria-hidden")??null,ie=document.body.style.overflow;return r&&(r.inert=!0,r.setAttribute("aria-hidden","true")),document.body.style.overflow="hidden",s.showModal(),j.current?.focus(),()=>{s.close(),r&&(r.inert=k,f===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",f)),document.body.style.overflow=ie;const V=N.current;if(V){N.current=null,V();return}const W=U.current;X(W),requestAnimationFrame(()=>X(W))}},[L,d]),!m&&!v)return null;const K=s=>{if(!g.current)return;const r=pe(g.current);(s==="first"?r[0]:r.at(-1))?.focus({preventScroll:!0})},z=s=>{s.detail>0&&(N.current=fe()),T()},q=()=>{C("view"),requestAnimationFrame(()=>j.current?.focus())},oe=async()=>{const s=$.current;if(!s||!w||F)return;const r=Number.isFinite(s.duration)?s.duration:null,k=Math.max(0,r===null?s.currentTime:Math.min(s.currentTime,Math.max(0,r-.05)));B(!0),I(null);try{const f=await w(k);y.current&&I({tone:"success",text:`Frame saved to ${f}`})}catch(f){y.current&&I({tone:"error",text:f instanceof Error?f.message:String(f)})}finally{y.current&&B(!1)}},ae=s=>{E||s.defaultPrevented||ge(s.target)||s.metaKey||s.ctrlKey||s.altKey||!P||s.key.toLowerCase()!=="e"||(s.preventDefault(),C("edit"))},le=t.jsxs(t.Fragment,{children:[t.jsxs("header",{className:"media-fullscreen-chrome",children:[t.jsx(O,{address:e,asset:n}),t.jsxs("div",{className:"notebook-media-fullscreen-actions",children:[P&&t.jsxs("button",{type:"button",className:"media-fullscreen-edit","aria-keyshortcuts":"E",onClick:()=>C("edit"),children:[t.jsx(he,{size:16}),"Edit image"]}),m&&R&&w&&t.jsxs("button",{type:"button",className:"notebook-media-capture-button",disabled:F,onClick:()=>{oe()},children:[F?t.jsx(ue,{size:16}):t.jsx(be,{size:16}),"Extract frame"]}),t.jsx("button",{ref:j,type:"button",className:"notebook-media-fullscreen-close",onClick:z,"aria-label":"Close fullscreen preview","aria-keyshortcuts":"Escape","data-composer-focus":"return",children:t.jsx(xe,{size:20})}),S&&t.jsx("p",{className:`notebook-media-capture-status ${S.tone}`,role:"status",children:S.text})]})]}),t.jsx("div",{className:"media-fullscreen-stage",children:m?t.jsx(je,{address:e,playbackUrl:R,posterUrl:D,videoRef:$}):t.jsx("img",{src:v??"",alt:`@${e}`})}),P&&t.jsxs("p",{className:"media-fullscreen-keys","aria-hidden":"true",children:[t.jsxs("span",{children:[t.jsx("kbd",{children:"E"})," edit"]}),t.jsxs("span",{children:[t.jsx("kbd",{children:"Esc"})," close"]})]})]}),H=t.jsxs("dialog",{ref:g,className:`notebook-media-fullscreen ${E?"image-editor":"media-viewer"}${m?" playback-only":""}`,role:"dialog","aria-modal":"true","aria-label":`Fullscreen preview for @${e}`,onKeyDown:ae,onCancel:s=>{s.preventDefault(),E?q():T()},children:[p&&t.jsx("div",{ref:c,className:"notebook-media-composer-host actions-only","aria-label":"Media actions input"}),t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("last")}),E?t.jsx(de,{address:e,mediaUrl:v??"",width:a?.width??n.width??1e3,height:a?.height??n.height??1e3,details:t.jsx(O,{address:e,asset:n}),subjectMap:a,subjectMapLoading:o,analysisUnavailableReason:l,initialRegions:h,instruction:ne,onInstructionChange:s=>{re(s),x?.(s)},replacementCandidates:G,imageEditModels:J,imageEditModelsLoading:Y,defaultImageEditModelId:Z,onEstimateImageEditCost:_,closeRef:j,onAnalyzeSubjects:ee,onEditingChange:te,onEditSubjects:A,onSubmitInstruction:M,onBack:q,onClose:z}):le,t.jsx("span",{className:"sr-only",tabIndex:0,"aria-hidden":"true",onFocus:()=>K("first")})]});return typeof document>"u"?H:ce.createPortal(H,document.body)}export{Ne as N};
@@ -1,2 +1,2 @@
1
- import{c as Xe,a as Ie,j as t}from"./vendor-react-Dj7D1fD4.js";import{dR as It,dS as Dt,aj as Rt,dT as Gt,dU as Lt,dV as Ot,dW as Kt,dX as Bt,dY as Ht,dZ as Wt,d_ as At,d$ as Ft,e0 as dt,e1 as Ut,e2 as $t,e3 as ft,e4 as qt,e5 as Mt,e6 as xt,e7 as zt,e8 as Yt,e9 as Xt,ea as Et,c2 as Jt,eb as Zt,ec as ht,ed as Qt,ee as _t,ef as es}from"./videobook-CsW453sb.js";import{b as ts}from"./vendor-D8XcMav4.js";import{m as ss,n as ls,o as as,p as ns,q as os,r as Tt}from"./ui-z5r-p0K9.js";import{af as jt,Y as is,m as rs,X as cs}from"./vendor-icons-CGqhCIXV.js";import{C as ds}from"./confirm-bodies-BxWXwDf0.js";function ms(n){const e=Xe.c(15),{row:s}=n,l=Rt(s.startedAt);let a;e[0]!==l||e[1]!==s.detail||e[2]!==s.state?(a=s.state==="generating"?l===null?"Generating":Gt(l):s.detail,e[0]=l,e[1]=s.detail,e[2]=s.state,e[3]=a):a=e[3];const v=a;let h;e[4]!==s.number?(h=t.jsx("span",{className:"goal-tile-row-number",children:s.number}),e[4]=s.number,e[5]=h):h=e[5];let j;e[6]!==s.title?(j=t.jsx("span",{className:"goal-tile-row-title",children:s.title}),e[6]=s.title,e[7]=j):j=e[7];let f;e[8]!==v?(f=t.jsx("span",{className:"goal-tile-row-state",children:v}),e[8]=v,e[9]=f):f=e[9];let C;return e[10]!==s.state||e[11]!==h||e[12]!==j||e[13]!==f?(C=t.jsxs("li",{className:"goal-tile-row","data-state":s.state,children:[h,j,f]}),e[10]=s.state,e[11]=h,e[12]=j,e[13]=f,e[14]=C):C=e[14],C}function wt(){return document.activeElement instanceof HTMLElement?document.activeElement:null}function Ds(n){const e=Xe.c(91),{id:s,data:l,selected:a}=n,v=Ie.useContext(ss),h=Ie.useContext(ls),j=Ie.useContext(as),f=Ie.useContext(ns);let C,c,G,x,i,o,w,r,V,u,m,k,E,M,L,D,b;if(e[0]!==f||e[1]!==l.deleting||e[2]!==l.highlighted||e[3]!==l.inputs||e[4]!==l.label||e[5]!==l.revealing||e[6]!==l.slot||e[7]!==v||e[8]!==s||e[9]!==h||e[10]!==j||e[11]!==a){const N=v.get(s)??null;b=It(N,Dt(l.inputs),l.label);let S;e[29]!==l.slot?(S=ts(l.slot),e[29]=l.slot,e[30]=S):S=e[30],C=S;const me=a&&j===s;let pe;e[31]!==f||e[32]!==s?(pe=K=>{K.preventDefault(),K.stopPropagation(),f.open(s,{x:K.clientX,y:K.clientY},wt())},e[31]=f,e[32]=s,e[33]=pe):pe=e[33];const le=pe;let _;e[34]!==f||e[35]!==s?(_=K=>{if(K.key!=="ContextMenu"&&!(K.shiftKey&&K.key==="F10"))return;K.preventDefault(),K.stopPropagation();const Q=K.currentTarget.getBoundingClientRect();f.open(s,{x:Q.left+Math.min(Q.width-12,40),y:Q.top+40},wt())},e[34]=f,e[35]=s,e[36]=_):_=e[36];const Z=_,ce=a?"cell-node-selected":"",ge=me?"cell-node-primary":"",re=b.chip.tone==="attention"?"cell-node-error":"",ae=l.deleting?"cell-node-deleting":"",ne=l.revealing?"cell-node-created":"",oe=l.highlighted?"cell-node-highlight":"";let ye;e[37]!==ce||e[38]!==ge||e[39]!==re||e[40]!==ae||e[41]!==ne||e[42]!==oe?(ye=["cell-node","cell-kind-goal","cell-family-goal",ce,ge,re,ae,ne,oe].filter(Boolean),e[37]=ce,e[38]=ge,e[39]=re,e[40]=ae,e[41]=ne,e[42]=oe,e[43]=ye):ye=e[43],D=ye.join(" "),G=`${C} goal: ${b.title}`,x=me?"primary":a?"selected":void 0,i=b.chip.tone,o=f.openCellId===s?"true":void 0,w=le,r=Z,M="cell-node-shell";let te;e[44]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsxs("span",{className:"cell-node-type","aria-label":"GOAL",children:[t.jsx(jt,{size:14}),t.jsx("span",{className:"cell-node-type-label","aria-hidden":"true",children:"GOAL"})]}),e[44]=te):te=e[44],L=t.jsxs("header",{className:"cell-node-header",children:[te,(b.shotsLabel||b.aspectRatio)&&t.jsxs("span",{className:"cell-generation-chips",children:[b.shotsLabel&&t.jsx("span",{className:"cell-aspect-ratio",title:"Shots",children:b.shotsLabel}),b.aspectRatio&&t.jsx("span",{className:"cell-aspect-ratio",title:"Aspect ratio",children:b.aspectRatio})]})]}),c="goal-tile-body",V=t.jsx("strong",{className:"goal-tile-title",title:b.title,children:b.title}),u=b.styleLabel&&t.jsx("span",{className:"cell-aspect-ratio goal-style-chip",title:"Goal style",children:b.styleLabel}),m=N&&N.characters.length>0&&t.jsxs("span",{className:"goal-tile-characters",children:[N.characters.length," reference",N.characters.length===1?"":"s"]}),k=b.thumbnails.length>0&&t.jsx("span",{className:"goal-tile-thumbnails",children:b.thumbnails.map(K=>{const Q=h.get(K.artifactId),ue=Q?.thumbnailUrl??Q?.mediaUrl;return ue?t.jsx("img",{src:ue,alt:K.label},K.artifactId):null})}),E=b.planning?t.jsxs(t.Fragment,{children:[b.note&&t.jsx("p",{className:"goal-tile-brief",children:b.note}),t.jsxs("span",{className:"goal-tile-placeholder","aria-hidden":"true",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("ol",{className:"goal-tile-rows",children:[b.rows.map(ps),b.hiddenRows>0&&t.jsxs("li",{className:"goal-tile-more",children:["+",b.hiddenRows," more"]})]}),b.note&&t.jsx("p",{className:"goal-tile-note","data-tone":b.noteTone,children:b.note})]}),e[0]=f,e[1]=l.deleting,e[2]=l.highlighted,e[3]=l.inputs,e[4]=l.label,e[5]=l.revealing,e[6]=l.slot,e[7]=v,e[8]=s,e[9]=h,e[10]=j,e[11]=a,e[12]=C,e[13]=c,e[14]=G,e[15]=x,e[16]=i,e[17]=o,e[18]=w,e[19]=r,e[20]=V,e[21]=u,e[22]=m,e[23]=k,e[24]=E,e[25]=M,e[26]=L,e[27]=D,e[28]=b}else C=e[12],c=e[13],G=e[14],x=e[15],i=e[16],o=e[17],w=e[18],r=e[19],V=e[20],u=e[21],m=e[22],k=e[23],E=e[24],M=e[25],L=e[26],D=e[27],b=e[28];const Y=`${b.progressPercent}%`;let U;e[45]!==Y?(U=t.jsx("span",{className:"goal-tile-progress","aria-hidden":"true",children:t.jsx("span",{style:{width:Y}})}),e[45]=Y,e[46]=U):U=e[46];let O;e[47]!==c||e[48]!==U||e[49]!==V||e[50]!==u||e[51]!==m||e[52]!==k||e[53]!==E?(O=t.jsxs("div",{className:c,children:[V,u,m,k,E,U]}),e[47]=c,e[48]=U,e[49]=V,e[50]=u,e[51]=m,e[52]=k,e[53]=E,e[54]=O):O=e[54];let d;e[55]!==C?(d=t.jsx("strong",{children:C}),e[55]=C,e[56]=d):d=e[56];let p;e[57]!==b.chip.label||e[58]!==b.chip.tone?(p=t.jsx("span",{className:"goal-tile-chip","data-tone":b.chip.tone,children:b.chip.label}),e[57]=b.chip.label,e[58]=b.chip.tone,e[59]=p):p=e[59];const A=`Open ${C} cell menu`,R=f.openCellId===s;let P;e[60]!==s?(P=os(s),e[60]=s,e[61]=P):P=e[61];let B;e[62]!==f||e[63]!==s?(B=N=>{N.preventDefault(),N.stopPropagation();const S=N.currentTarget.getBoundingClientRect();f.open(s,{x:S.right-4,y:S.bottom+4},N.currentTarget)},e[62]=f,e[63]=s,e[64]=B):B=e[64];let H;e[65]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(is,{size:16,"aria-hidden":"true"}),e[65]=H):H=e[65];let z;e[66]!==A||e[67]!==R||e[68]!==P||e[69]!==B?(z=t.jsx("button",{type:"button",className:"cell-context-menu-trigger nodrag","aria-label":A,"aria-haspopup":"menu","aria-expanded":R,"aria-controls":P,title:"Cell actions",onClick:B,children:H}),e[66]=A,e[67]=R,e[68]=P,e[69]=B,e[70]=z):z=e[70];let $;e[71]!==p||e[72]!==z?($=t.jsxs("span",{className:"cell-node-footer-actions",children:[p,z]}),e[71]=p,e[72]=z,e[73]=$):$=e[73];let W;e[74]!==d||e[75]!==$?(W=t.jsxs("footer",{className:"cell-node-footer",children:[d,$]}),e[74]=d,e[75]=$,e[76]=W):W=e[76];let I;e[77]!==O||e[78]!==W||e[79]!==M||e[80]!==L?(I=t.jsxs("section",{className:M,children:[L,O,W]}),e[77]=O,e[78]=W,e[79]=M,e[80]=L,e[81]=I):I=e[81];let X;return e[82]!==G||e[83]!==x||e[84]!==i||e[85]!==o||e[86]!==w||e[87]!==r||e[88]!==I||e[89]!==D?(X=t.jsx("article",{className:D,"aria-label":G,"data-selection":x,"data-goal-tone":i,"data-context-menu-open":o,onContextMenu:w,onKeyDown:r,children:I}),e[82]=G,e[83]=x,e[84]=i,e[85]=o,e[86]=w,e[87]=r,e[88]=I,e[89]=D,e[90]=X):X=e[90],X}function ps(n){return t.jsx(ms,{row:n},n.key)}function Pt(n){const e=Xe.c(7),{text:s,short:l}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"goal-status-long",children:s}),e[0]=s,e[1]=a):a=e[1];let v;e[2]!==l?(v=t.jsx("span",{className:"goal-status-short",children:l}),e[2]=l,e[3]=v):v=e[3];let h;return e[4]!==a||e[5]!==v?(h=t.jsxs(t.Fragment,{children:[a,v]}),e[4]=a,e[5]=v,e[6]=h):h=e[6],h}function Ks(n){const e=Xe.c(47),{goal:s,disabled:l,onOpen:a}=n,v=l===void 0?!1:l,h=Lt(s),j=h.active?.state==="generating"?h.active.startedAt:null,f=Rt(j);let C;e[0]!==f||e[1]!==s?(C=Ot(s,f),e[0]=f,e[1]=s,e[2]=C):C=e[2];const c=C;let G;e[3]!==s?(G=It(s,s.plan,void 0),e[3]=s,e[4]=G):G=e[4];const{styleLabel:x}=G;let i;e[5]!==s?(i=Kt(s),e[5]=s,e[6]=i):i=e[6];const o=i;let w;e[7]!==s||e[8]!==o?(w={key:o,goal:s},e[7]=s,e[8]=o,e[9]=w):w=e[9];const[r,V]=Ie.useState(w),[u,m]=Ie.useState(null);r.key!==o&&(V({key:o,goal:s}),m(Bt(r.goal,s)));let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=N=>{N.animationName==="goal-status-roll-in"&&m(null)},e[10]=k):k=e[10];const E=k,M=h.total>0&&h.phase!=="planning"&&h.phase!=="review",L="goal-status",D=u?.tone,b="button",Y="goal-status-button",U=`Goal ${s.address??""}${x?` · ${x}`:""}: ${c.text}. Open the goal panel`,O=s.plan?.title??s.brief;let d,p;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(jt,{size:13,"aria-hidden":"true",className:"goal-status-flag"}),p=t.jsx("span",{className:"goal-status-kind","aria-hidden":"true",children:"Goal"}),e[11]=d,e[12]=p):(d=e[11],p=e[12]);let A;e[13]!==x?(A=x&&t.jsx("span",{className:"goal-status-style","aria-hidden":"true",children:x}),e[13]=x,e[14]=A):A=e[14];let R;e[15]!==c.short||e[16]!==c.text||e[17]!==u?(R=t.jsx("span",{className:"goal-status-text","aria-hidden":"true",children:u?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"goal-status-roll goal-status-roll-in",onAnimationEnd:E,children:t.jsx(Pt,{text:c.text,short:c.short})},`in:${u.id}`),t.jsx("span",{className:"goal-status-roll goal-status-roll-out",children:u.from},`out:${u.id}`)]}):t.jsx("span",{className:"goal-status-roll",children:t.jsx(Pt,{text:c.text,short:c.short})})}),e[15]=c.short,e[16]=c.text,e[17]=u,e[18]=R):R=e[18];let P;e[19]!==c.busy?(P=c.busy&&t.jsx("span",{className:"goal-status-spinner","aria-hidden":"true"}),e[19]=c.busy,e[20]=P):P=e[20];const B=M&&t.jsx("span",{className:"goal-status-ticks","aria-hidden":"true",children:h.shots.map(us)});let H;e[21]!==c.action?(H=c.action&&t.jsx("span",{className:"goal-status-action","aria-hidden":"true",children:c.action}),e[21]=c.action,e[22]=H):H=e[22];let z;e[23]!==v||e[24]!==a||e[25]!==U||e[26]!==O||e[27]!==d||e[28]!==p||e[29]!==A||e[30]!==R||e[31]!==P||e[32]!==B||e[33]!==H?(z=t.jsxs("button",{type:b,className:Y,disabled:v,"aria-label":U,title:O,onClick:a,children:[d,p,A,R,P,B,H]}),e[23]=v,e[24]=a,e[25]=U,e[26]=O,e[27]=d,e[28]=p,e[29]=A,e[30]=R,e[31]=P,e[32]=B,e[33]=H,e[34]=z):z=e[34];let $;e[35]!==c.announce?($=t.jsx("span",{className:"sr-only",role:"status",children:c.announce}),e[35]=c.announce,e[36]=$):$=e[36];let W;e[37]!==c.tone||e[38]!==z||e[39]!==$||e[40]!==D?(W=t.jsxs("div",{className:L,"data-tone":c.tone,"data-wake":D,children:[z,$]}),e[37]=c.tone,e[38]=z,e[39]=$,e[40]=D,e[41]=W):W=e[41];let I;e[42]!==u?(I=u&&t.jsx("span",{className:"command-transmit-scan goal-status-scan","aria-hidden":"true"},`scan:${u.id}`),e[42]=u,e[43]=I):I=e[43];let X;return e[44]!==W||e[45]!==I?(X=t.jsxs(t.Fragment,{children:[W,I]}),e[44]=W,e[45]=I,e[46]=X):X=e[46],X}function us(n){return t.jsx("i",{"data-state":n.state},n.index)}function Ye(n){const e=Xe.c(22),{label:s,name:l,value:a,budget:v,wordLimit:h,maxLength:j,disabled:f,placeholder:C,onChange:c}=n,G=l===void 0?s:l,x=j===void 0?6e3:j,i=Ht(a),o=h??Wt[v];let w;e[0]!==s?(w=t.jsx("span",{children:s}),e[0]=s,e[1]=w):w=e[1];let r;e[2]!==a?(r=a.split(`
1
+ import{c as Xe,a as Ie,j as t}from"./vendor-react-Dj7D1fD4.js";import{dS as It,dT as Dt,aj as Rt,dU as Gt,dV as Lt,dW as Ot,dX as Kt,dY as Bt,dZ as Ht,d_ as Wt,d$ as At,e0 as Ft,e1 as dt,e2 as Ut,e3 as $t,e4 as ft,e5 as qt,e6 as Mt,e7 as xt,e8 as zt,e9 as Yt,ea as Xt,eb as Et,c2 as Jt,ec as Zt,ed as ht,ee as Qt,ef as _t,eg as es}from"./videobook-b9VODNOA.js";import{b as ts}from"./vendor-BWf-WCsY.js";import{m as ss,n as ls,o as as,p as ns,q as os,r as Tt}from"./ui-Cqs1-YNg.js";import{ae as jt,Y as is,m as rs,X as cs}from"./vendor-icons-D3KrGMJY.js";import{C as ds}from"./confirm-bodies-BaalBxp1.js";function ms(n){const e=Xe.c(15),{row:s}=n,l=Rt(s.startedAt);let a;e[0]!==l||e[1]!==s.detail||e[2]!==s.state?(a=s.state==="generating"?l===null?"Generating":Gt(l):s.detail,e[0]=l,e[1]=s.detail,e[2]=s.state,e[3]=a):a=e[3];const v=a;let h;e[4]!==s.number?(h=t.jsx("span",{className:"goal-tile-row-number",children:s.number}),e[4]=s.number,e[5]=h):h=e[5];let j;e[6]!==s.title?(j=t.jsx("span",{className:"goal-tile-row-title",children:s.title}),e[6]=s.title,e[7]=j):j=e[7];let f;e[8]!==v?(f=t.jsx("span",{className:"goal-tile-row-state",children:v}),e[8]=v,e[9]=f):f=e[9];let C;return e[10]!==s.state||e[11]!==h||e[12]!==j||e[13]!==f?(C=t.jsxs("li",{className:"goal-tile-row","data-state":s.state,children:[h,j,f]}),e[10]=s.state,e[11]=h,e[12]=j,e[13]=f,e[14]=C):C=e[14],C}function wt(){return document.activeElement instanceof HTMLElement?document.activeElement:null}function Ds(n){const e=Xe.c(91),{id:s,data:l,selected:a}=n,v=Ie.useContext(ss),h=Ie.useContext(ls),j=Ie.useContext(as),f=Ie.useContext(ns);let C,c,G,x,i,o,w,r,V,u,m,k,E,M,L,D,b;if(e[0]!==f||e[1]!==l.deleting||e[2]!==l.highlighted||e[3]!==l.inputs||e[4]!==l.label||e[5]!==l.revealing||e[6]!==l.slot||e[7]!==v||e[8]!==s||e[9]!==h||e[10]!==j||e[11]!==a){const N=v.get(s)??null;b=It(N,Dt(l.inputs),l.label);let S;e[29]!==l.slot?(S=ts(l.slot),e[29]=l.slot,e[30]=S):S=e[30],C=S;const me=a&&j===s;let pe;e[31]!==f||e[32]!==s?(pe=K=>{K.preventDefault(),K.stopPropagation(),f.open(s,{x:K.clientX,y:K.clientY},wt())},e[31]=f,e[32]=s,e[33]=pe):pe=e[33];const le=pe;let _;e[34]!==f||e[35]!==s?(_=K=>{if(K.key!=="ContextMenu"&&!(K.shiftKey&&K.key==="F10"))return;K.preventDefault(),K.stopPropagation();const Q=K.currentTarget.getBoundingClientRect();f.open(s,{x:Q.left+Math.min(Q.width-12,40),y:Q.top+40},wt())},e[34]=f,e[35]=s,e[36]=_):_=e[36];const Z=_,ce=a?"cell-node-selected":"",ge=me?"cell-node-primary":"",re=b.chip.tone==="attention"?"cell-node-error":"",ae=l.deleting?"cell-node-deleting":"",ne=l.revealing?"cell-node-created":"",oe=l.highlighted?"cell-node-highlight":"";let ye;e[37]!==ce||e[38]!==ge||e[39]!==re||e[40]!==ae||e[41]!==ne||e[42]!==oe?(ye=["cell-node","cell-kind-goal","cell-family-goal",ce,ge,re,ae,ne,oe].filter(Boolean),e[37]=ce,e[38]=ge,e[39]=re,e[40]=ae,e[41]=ne,e[42]=oe,e[43]=ye):ye=e[43],D=ye.join(" "),G=`${C} goal: ${b.title}`,x=me?"primary":a?"selected":void 0,i=b.chip.tone,o=f.openCellId===s?"true":void 0,w=le,r=Z,M="cell-node-shell";let te;e[44]===Symbol.for("react.memo_cache_sentinel")?(te=t.jsxs("span",{className:"cell-node-type","aria-label":"GOAL",children:[t.jsx(jt,{size:14}),t.jsx("span",{className:"cell-node-type-label","aria-hidden":"true",children:"GOAL"})]}),e[44]=te):te=e[44],L=t.jsxs("header",{className:"cell-node-header",children:[te,(b.shotsLabel||b.aspectRatio)&&t.jsxs("span",{className:"cell-generation-chips",children:[b.shotsLabel&&t.jsx("span",{className:"cell-aspect-ratio",title:"Shots",children:b.shotsLabel}),b.aspectRatio&&t.jsx("span",{className:"cell-aspect-ratio",title:"Aspect ratio",children:b.aspectRatio})]})]}),c="goal-tile-body",V=t.jsx("strong",{className:"goal-tile-title",title:b.title,children:b.title}),u=b.styleLabel&&t.jsx("span",{className:"cell-aspect-ratio goal-style-chip",title:"Goal style",children:b.styleLabel}),m=N&&N.characters.length>0&&t.jsxs("span",{className:"goal-tile-characters",children:[N.characters.length," reference",N.characters.length===1?"":"s"]}),k=b.thumbnails.length>0&&t.jsx("span",{className:"goal-tile-thumbnails",children:b.thumbnails.map(K=>{const Q=h.get(K.artifactId),ue=Q?.thumbnailUrl??Q?.mediaUrl;return ue?t.jsx("img",{src:ue,alt:K.label},K.artifactId):null})}),E=b.planning?t.jsxs(t.Fragment,{children:[b.note&&t.jsx("p",{className:"goal-tile-brief",children:b.note}),t.jsxs("span",{className:"goal-tile-placeholder","aria-hidden":"true",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("ol",{className:"goal-tile-rows",children:[b.rows.map(ps),b.hiddenRows>0&&t.jsxs("li",{className:"goal-tile-more",children:["+",b.hiddenRows," more"]})]}),b.note&&t.jsx("p",{className:"goal-tile-note","data-tone":b.noteTone,children:b.note})]}),e[0]=f,e[1]=l.deleting,e[2]=l.highlighted,e[3]=l.inputs,e[4]=l.label,e[5]=l.revealing,e[6]=l.slot,e[7]=v,e[8]=s,e[9]=h,e[10]=j,e[11]=a,e[12]=C,e[13]=c,e[14]=G,e[15]=x,e[16]=i,e[17]=o,e[18]=w,e[19]=r,e[20]=V,e[21]=u,e[22]=m,e[23]=k,e[24]=E,e[25]=M,e[26]=L,e[27]=D,e[28]=b}else C=e[12],c=e[13],G=e[14],x=e[15],i=e[16],o=e[17],w=e[18],r=e[19],V=e[20],u=e[21],m=e[22],k=e[23],E=e[24],M=e[25],L=e[26],D=e[27],b=e[28];const Y=`${b.progressPercent}%`;let U;e[45]!==Y?(U=t.jsx("span",{className:"goal-tile-progress","aria-hidden":"true",children:t.jsx("span",{style:{width:Y}})}),e[45]=Y,e[46]=U):U=e[46];let O;e[47]!==c||e[48]!==U||e[49]!==V||e[50]!==u||e[51]!==m||e[52]!==k||e[53]!==E?(O=t.jsxs("div",{className:c,children:[V,u,m,k,E,U]}),e[47]=c,e[48]=U,e[49]=V,e[50]=u,e[51]=m,e[52]=k,e[53]=E,e[54]=O):O=e[54];let d;e[55]!==C?(d=t.jsx("strong",{children:C}),e[55]=C,e[56]=d):d=e[56];let p;e[57]!==b.chip.label||e[58]!==b.chip.tone?(p=t.jsx("span",{className:"goal-tile-chip","data-tone":b.chip.tone,children:b.chip.label}),e[57]=b.chip.label,e[58]=b.chip.tone,e[59]=p):p=e[59];const A=`Open ${C} cell menu`,R=f.openCellId===s;let P;e[60]!==s?(P=os(s),e[60]=s,e[61]=P):P=e[61];let B;e[62]!==f||e[63]!==s?(B=N=>{N.preventDefault(),N.stopPropagation();const S=N.currentTarget.getBoundingClientRect();f.open(s,{x:S.right-4,y:S.bottom+4},N.currentTarget)},e[62]=f,e[63]=s,e[64]=B):B=e[64];let H;e[65]===Symbol.for("react.memo_cache_sentinel")?(H=t.jsx(is,{size:16,"aria-hidden":"true"}),e[65]=H):H=e[65];let z;e[66]!==A||e[67]!==R||e[68]!==P||e[69]!==B?(z=t.jsx("button",{type:"button",className:"cell-context-menu-trigger nodrag","aria-label":A,"aria-haspopup":"menu","aria-expanded":R,"aria-controls":P,title:"Cell actions",onClick:B,children:H}),e[66]=A,e[67]=R,e[68]=P,e[69]=B,e[70]=z):z=e[70];let $;e[71]!==p||e[72]!==z?($=t.jsxs("span",{className:"cell-node-footer-actions",children:[p,z]}),e[71]=p,e[72]=z,e[73]=$):$=e[73];let W;e[74]!==d||e[75]!==$?(W=t.jsxs("footer",{className:"cell-node-footer",children:[d,$]}),e[74]=d,e[75]=$,e[76]=W):W=e[76];let I;e[77]!==O||e[78]!==W||e[79]!==M||e[80]!==L?(I=t.jsxs("section",{className:M,children:[L,O,W]}),e[77]=O,e[78]=W,e[79]=M,e[80]=L,e[81]=I):I=e[81];let X;return e[82]!==G||e[83]!==x||e[84]!==i||e[85]!==o||e[86]!==w||e[87]!==r||e[88]!==I||e[89]!==D?(X=t.jsx("article",{className:D,"aria-label":G,"data-selection":x,"data-goal-tone":i,"data-context-menu-open":o,onContextMenu:w,onKeyDown:r,children:I}),e[82]=G,e[83]=x,e[84]=i,e[85]=o,e[86]=w,e[87]=r,e[88]=I,e[89]=D,e[90]=X):X=e[90],X}function ps(n){return t.jsx(ms,{row:n},n.key)}function Pt(n){const e=Xe.c(7),{text:s,short:l}=n;let a;e[0]!==s?(a=t.jsx("span",{className:"goal-status-long",children:s}),e[0]=s,e[1]=a):a=e[1];let v;e[2]!==l?(v=t.jsx("span",{className:"goal-status-short",children:l}),e[2]=l,e[3]=v):v=e[3];let h;return e[4]!==a||e[5]!==v?(h=t.jsxs(t.Fragment,{children:[a,v]}),e[4]=a,e[5]=v,e[6]=h):h=e[6],h}function Ks(n){const e=Xe.c(47),{goal:s,disabled:l,onOpen:a}=n,v=l===void 0?!1:l,h=Lt(s),j=h.active?.state==="generating"?h.active.startedAt:null,f=Rt(j);let C;e[0]!==f||e[1]!==s?(C=Ot(s,f),e[0]=f,e[1]=s,e[2]=C):C=e[2];const c=C;let G;e[3]!==s?(G=It(s,s.plan,void 0),e[3]=s,e[4]=G):G=e[4];const{styleLabel:x}=G;let i;e[5]!==s?(i=Kt(s),e[5]=s,e[6]=i):i=e[6];const o=i;let w;e[7]!==s||e[8]!==o?(w={key:o,goal:s},e[7]=s,e[8]=o,e[9]=w):w=e[9];const[r,V]=Ie.useState(w),[u,m]=Ie.useState(null);r.key!==o&&(V({key:o,goal:s}),m(Bt(r.goal,s)));let k;e[10]===Symbol.for("react.memo_cache_sentinel")?(k=N=>{N.animationName==="goal-status-roll-in"&&m(null)},e[10]=k):k=e[10];const E=k,M=h.total>0&&h.phase!=="planning"&&h.phase!=="review",L="goal-status",D=u?.tone,b="button",Y="goal-status-button",U=`Goal ${s.address??""}${x?` · ${x}`:""}: ${c.text}. Open the goal panel`,O=s.plan?.title??s.brief;let d,p;e[11]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(jt,{size:13,"aria-hidden":"true",className:"goal-status-flag"}),p=t.jsx("span",{className:"goal-status-kind","aria-hidden":"true",children:"Goal"}),e[11]=d,e[12]=p):(d=e[11],p=e[12]);let A;e[13]!==x?(A=x&&t.jsx("span",{className:"goal-status-style","aria-hidden":"true",children:x}),e[13]=x,e[14]=A):A=e[14];let R;e[15]!==c.short||e[16]!==c.text||e[17]!==u?(R=t.jsx("span",{className:"goal-status-text","aria-hidden":"true",children:u?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"goal-status-roll goal-status-roll-in",onAnimationEnd:E,children:t.jsx(Pt,{text:c.text,short:c.short})},`in:${u.id}`),t.jsx("span",{className:"goal-status-roll goal-status-roll-out",children:u.from},`out:${u.id}`)]}):t.jsx("span",{className:"goal-status-roll",children:t.jsx(Pt,{text:c.text,short:c.short})})}),e[15]=c.short,e[16]=c.text,e[17]=u,e[18]=R):R=e[18];let P;e[19]!==c.busy?(P=c.busy&&t.jsx("span",{className:"goal-status-spinner","aria-hidden":"true"}),e[19]=c.busy,e[20]=P):P=e[20];const B=M&&t.jsx("span",{className:"goal-status-ticks","aria-hidden":"true",children:h.shots.map(us)});let H;e[21]!==c.action?(H=c.action&&t.jsx("span",{className:"goal-status-action","aria-hidden":"true",children:c.action}),e[21]=c.action,e[22]=H):H=e[22];let z;e[23]!==v||e[24]!==a||e[25]!==U||e[26]!==O||e[27]!==d||e[28]!==p||e[29]!==A||e[30]!==R||e[31]!==P||e[32]!==B||e[33]!==H?(z=t.jsxs("button",{type:b,className:Y,disabled:v,"aria-label":U,title:O,onClick:a,children:[d,p,A,R,P,B,H]}),e[23]=v,e[24]=a,e[25]=U,e[26]=O,e[27]=d,e[28]=p,e[29]=A,e[30]=R,e[31]=P,e[32]=B,e[33]=H,e[34]=z):z=e[34];let $;e[35]!==c.announce?($=t.jsx("span",{className:"sr-only",role:"status",children:c.announce}),e[35]=c.announce,e[36]=$):$=e[36];let W;e[37]!==c.tone||e[38]!==z||e[39]!==$||e[40]!==D?(W=t.jsxs("div",{className:L,"data-tone":c.tone,"data-wake":D,children:[z,$]}),e[37]=c.tone,e[38]=z,e[39]=$,e[40]=D,e[41]=W):W=e[41];let I;e[42]!==u?(I=u&&t.jsx("span",{className:"command-transmit-scan goal-status-scan","aria-hidden":"true"},`scan:${u.id}`),e[42]=u,e[43]=I):I=e[43];let X;return e[44]!==W||e[45]!==I?(X=t.jsxs(t.Fragment,{children:[W,I]}),e[44]=W,e[45]=I,e[46]=X):X=e[46],X}function us(n){return t.jsx("i",{"data-state":n.state},n.index)}function Ye(n){const e=Xe.c(22),{label:s,name:l,value:a,budget:v,wordLimit:h,maxLength:j,disabled:f,placeholder:C,onChange:c}=n,G=l===void 0?s:l,x=j===void 0?6e3:j,i=Ht(a),o=h??Wt[v];let w;e[0]!==s?(w=t.jsx("span",{children:s}),e[0]=s,e[1]=w):w=e[1];let r;e[2]!==a?(r=a.split(`
2
2
  `),e[2]=a,e[3]=r):r=e[3];const V=Math.max(2,r.length);let u;e[4]!==c?(u=L=>c(L.target.value),e[4]=c,e[5]=u):u=e[5];let m;e[6]!==f||e[7]!==x||e[8]!==G||e[9]!==C||e[10]!==V||e[11]!==u||e[12]!==a?(m=t.jsx("textarea",{"aria-label":G,value:a,maxLength:x,rows:V,disabled:f,placeholder:C,onChange:u}),e[6]=f,e[7]=x,e[8]=G,e[9]=C,e[10]=V,e[11]=u,e[12]=a,e[13]=m):m=e[13];const k=i>o?" · Shorter prompts are easier to review":"";let E;e[14]!==o||e[15]!==k||e[16]!==i?(E=t.jsxs("small",{className:"goal-panel-muted",children:[i," / ",o," words",k]}),e[14]=o,e[15]=k,e[16]=i,e[17]=E):E=e[17];let M;return e[18]!==w||e[19]!==m||e[20]!==E?(M=t.jsxs("label",{className:"goal-prompt-input",children:[w,m,E]}),e[18]=w,e[19]=m,e[20]=E,e[21]=M):M=e[21],M}function ct(n){const e=Xe.c(17),{artifactId:s,cellId:l,label:a,resolveAsset:v,onOpen:h,fullResolution:j}=n,f=j===void 0?!1:j;let C;e[0]!==s||e[1]!==v?(C=v(s),e[0]=s,e[1]=v,e[2]=C):C=e[2];const c=C,G=f?c?.mediaUrl??c?.thumbnailUrl:c?.thumbnailUrl??c?.mediaUrl,x=!l;let i;e[3]!==l||e[4]!==h?(i=()=>{l&&h(l)},e[3]=l,e[4]=h,e[5]=i):i=e[5];const o=`Open ${a}`;let w;e[6]!==a||e[7]!==G?(w=G?t.jsx("img",{src:G,alt:a}):t.jsx("span",{className:"goal-media-pending",children:"Preview pending"}),e[6]=a,e[7]=G,e[8]=w):w=e[8];let r;e[9]!==a?(r=t.jsx("span",{children:a}),e[9]=a,e[10]=r):r=e[10];let V;return e[11]!==x||e[12]!==i||e[13]!==o||e[14]!==w||e[15]!==r?(V=t.jsxs("button",{type:"button",className:"goal-media",disabled:x,onClick:i,"aria-label":o,children:[w,r]}),e[11]=x,e[12]=i,e[13]=o,e[14]=w,e[15]=r,e[16]=V):V=e[16],V}function Vt(n){const e=Xe.c(118),{goal:s,stage:l,index:a,prompt:v,disabled:h,canGenerate:j,resolveAsset:f,onOpen:C,onPromptChange:c,onRegenerate:G,onRevise:x,onSelect:i}=n,[o,w]=Ie.useState("");let r,V,u,m,k,E,M,L,D,b,Y,U,O,d,p,A,R,P,B,H;if(e[0]!==j||e[1]!==h||e[2]!==o||e[3]!==s||e[4]!==a||e[5]!==C||e[6]!==x||e[7]!==i||e[8]!==f||e[9]!==l){Y=Symbol.for("react.early_return_sentinel");e:{const ee=s.stages[l]?.outputs.find(q=>q.index===a);if(!ee){Y=null;break e}let Se;e[30]!==s.plan?(Se=At(s.plan),e[30]=s.plan,e[31]=Se):Se=e[31],V=Math.max(1,Se.length),u=l==="storyboards"&&a>=V,L=l==="storyboards"&&!u,E=s.plan&&"storyboardLayout"in s.plan&&s.plan.storyboardLayout==="six-panel",m=l==="videos"?`Video ${a+1}`:l==="frame"?E?"Scene":"Full frame":`${u?"Ending frame":"Storyboard"} ${a%V+1}`;const ke=Ft(s,l,a);let xe;e[32]!==s||e[33]!==a||e[34]!==l?(xe=dt(s,l,a),e[32]=s,e[33]=a,e[34]=l,e[35]=xe):xe=e[35],M=xe;let be;if(e[36]!==s||e[37]!==a||e[38]!==l){const q=Ut(s,l,a);be=q===null?" · estimate unavailable":` · $${q.toFixed(2)}`,e[36]=s,e[37]=a,e[38]=l,e[39]=be}else be=e[39];r=be;const ve=f(ee.artifactId);let ie;e[40]!==o?(ie=!!o.trim()&&!o.includes("@"),e[40]=o,e[41]=ie):ie=e[41],H=ie;let de;e[42]!==j||e[43]!==h||e[44]!==o||e[45]!==x||e[46]!==H?(de=()=>{!h&&j&&H&&x(o.trim())},e[42]=j,e[43]=h,e[44]=o,e[45]=x,e[46]=H,e[47]=de):de=e[47],k=de,A="goal-still-card",R=m,P=l,B=L,e[48]!==ve||e[49]!==m||e[50]!==C||e[51]!==ee||e[52]!==f||e[53]!==l||e[54]!==L?(b=l==="videos"&&ve?.mediaUrl?t.jsx("video",{className:"goal-video-preview","aria-label":m,src:ve.mediaUrl,poster:ve.thumbnailUrl??void 0,controls:!0,preload:"metadata"}):t.jsx(ct,{artifactId:ee.artifactId,cellId:ee.cellId,label:m,resolveAsset:f,onOpen:C,fullResolution:L}),e[48]=ve,e[49]=m,e[50]=C,e[51]=ee,e[52]=f,e[53]=l,e[54]=L,e[55]=b):b=e[55],d="goal-still-tools",e[56]!==M||e[57]!==L?(p=L&&!M&&t.jsx("p",{className:"goal-panel-muted",children:"Read left to right, then top to bottom."}),e[56]=M,e[57]=L,e[58]=p):p=e[58],D="goal-versions",U=`${m} versions`,O=ke.map((q,Re)=>{const Ce=q.artifactId?f(q.artifactId):null,Ge=Ce?.thumbnailUrl??Ce?.mediaUrl,$e=`v${ke.length-Re}`;return t.jsxs("button",{type:"button",className:"goal-version","aria-label":`${m} ${$e}`,"aria-pressed":q.current,title:q.feedback??"Fresh generation",disabled:h||!q.artifactId||q.status!=="completed",onClick:()=>{q.artifactId&&i(q.artifactId)},children:[Ge&&t.jsx("img",{src:Ge,alt:""}),t.jsx("span",{children:$e})]},`${q.chainId}:${q.stepId}`)})}e[0]=j,e[1]=h,e[2]=o,e[3]=s,e[4]=a,e[5]=C,e[6]=x,e[7]=i,e[8]=f,e[9]=l,e[10]=r,e[11]=V,e[12]=u,e[13]=m,e[14]=k,e[15]=E,e[16]=M,e[17]=L,e[18]=D,e[19]=b,e[20]=Y,e[21]=U,e[22]=O,e[23]=d,e[24]=p,e[25]=A,e[26]=R,e[27]=P,e[28]=B,e[29]=H}else r=e[10],V=e[11],u=e[12],m=e[13],k=e[14],E=e[15],M=e[16],L=e[17],D=e[18],b=e[19],Y=e[20],U=e[21],O=e[22],d=e[23],p=e[24],A=e[25],R=e[26],P=e[27],B=e[28],H=e[29];if(Y!==Symbol.for("react.early_return_sentinel"))return Y;let z;e[59]!==D||e[60]!==U||e[61]!==O?(z=t.jsx("div",{className:D,"aria-label":U,children:O}),e[59]=D,e[60]=U,e[61]=O,e[62]=z):z=e[62];let $;e[63]!==M?($=M&&t.jsx("p",{className:"goal-panel-warning",role:"status",children:M}),e[63]=M,e[64]=$):$=e[64];const W=`What should change in ${m}?`;let I;e[65]===Symbol.for("react.memo_cache_sentinel")?(I=ee=>w(ee.target.value),e[65]=I):I=e[65];let X;e[66]!==k?(X=ee=>{ee.key!=="Enter"||ee.metaKey||ee.ctrlKey||ee.nativeEvent.isComposing||(ee.preventDefault(),ee.stopPropagation(),k())},e[66]=k,e[67]=X):X=e[67];let N;e[68]!==h||e[69]!==o||e[70]!==W||e[71]!==X?(N=t.jsx("input",{"aria-label":W,placeholder:"What should change?",value:o,maxLength:300,disabled:h,onChange:I,onKeyDown:X}),e[68]=h,e[69]=o,e[70]=W,e[71]=X,e[72]=N):N=e[72];const S=h||!j||!H;let me;e[73]!==r||e[74]!==k||e[75]!==S?(me=t.jsxs("button",{type:"button",className:"goal-panel-button",disabled:S,onClick:k,children:["Revise",r]}),e[73]=r,e[74]=k,e[75]=S,e[76]=me):me=e[76];const pe=h||!j;let le;e[77]!==r||e[78]!==G||e[79]!==pe?(le=t.jsxs("button",{type:"button",className:"goal-panel-button",disabled:pe,onClick:G,children:["Regenerate",r]}),e[77]=r,e[78]=G,e[79]=pe,e[80]=le):le=e[80];let _;e[81]!==N||e[82]!==me||e[83]!==le?(_=t.jsxs("div",{className:"goal-revise-row",children:[N,me,le]}),e[81]=N,e[82]=me,e[83]=le,e[84]=_):_=e[84];let Z;e[85]!==o?(Z=o.includes("@")&&t.jsx("p",{className:"goal-panel-muted",children:"Describe the change without @ references."}),e[85]=o,e[86]=Z):Z=e[86];let ce;e[87]===Symbol.for("react.memo_cache_sentinel")?(ce=t.jsx("summary",{children:"Prompt"}),e[87]=ce):ce=e[87];const ge=l==="videos"?"Video directions":l==="frame"?E?"Scene prompt":"Full frame prompt":u?"Ending frame prompt":"Storyboard prompt",re=l==="videos"?`Shot ${a+1} video prompt`:l==="frame"?E?"Scene prompt":"Full frame prompt":`Shot ${a%V+1} ${u?"ending frame":"storyboard"} prompt`,ae=L&&E?48:void 0,ne=l==="videos"?"video":l==="frame"?"frame":u?"ending":"storyboard";let oe;e[88]!==h||e[89]!==c||e[90]!==v||e[91]!==ge||e[92]!==re||e[93]!==ae||e[94]!==ne?(oe=t.jsx(Ye,{label:ge,name:re,wordLimit:ae,budget:ne,value:v,disabled:h,onChange:c}),e[88]=h,e[89]=c,e[90]=v,e[91]=ge,e[92]=re,e[93]=ae,e[94]=ne,e[95]=oe):oe=e[95];const ye=h||!j;let te;e[96]!==r||e[97]!==G||e[98]!==ye?(te=t.jsxs("button",{type:"button",className:"goal-panel-button",disabled:ye,onClick:G,children:["Save and regenerate",r]}),e[96]=r,e[97]=G,e[98]=ye,e[99]=te):te=e[99];let K;e[100]!==oe||e[101]!==te?(K=t.jsxs("details",{className:"goal-disclosure",children:[ce,oe,te]}),e[100]=oe,e[101]=te,e[102]=K):K=e[102];let Q;e[103]!==z||e[104]!==$||e[105]!==_||e[106]!==Z||e[107]!==K||e[108]!==d||e[109]!==p?(Q=t.jsxs("div",{className:d,children:[p,z,$,_,Z,K]}),e[103]=z,e[104]=$,e[105]=_,e[106]=Z,e[107]=K,e[108]=d,e[109]=p,e[110]=Q):Q=e[110];let ue;return e[111]!==b||e[112]!==Q||e[113]!==A||e[114]!==R||e[115]!==P||e[116]!==B?(ue=t.jsxs("section",{className:A,"aria-label":R,"data-stage":P,"data-storyboard":B,children:[b,Q]}),e[111]=b,e[112]=Q,e[113]=A,e[114]=R,e[115]=P,e[116]=B,e[117]=ue):ue=e[117],ue}const hs=[{value:"9:16",label:"Portrait · 9:16"},{value:"16:9",label:"Landscape · 16:9"},{value:"1:1",label:"Square · 1:1"}];function fs(n){const e=Xe.c(187),{goal:s,plan:l,disabled:a,onSave:v,onApprove:h,onRegenerate:j,onRevise:f,onSelect:C,resolveAsset:c,onSelectCell:G,onPreviewCell:x}=n;let i;e[0]!==l?(i=()=>({...l,shots:l.shots.map(xs)}),e[0]=l,e[1]=i):i=e[1];const[o,w]=Ie.useState(i);let r,V,u,m,k,E,M,L,D,b,Y,U,O;if(e[2]!==a||e[3]!==o||e[4]!==s||e[5]!==h||e[6]!==x||e[7]!==j||e[8]!==f||e[9]!==C||e[10]!==G||e[11]!==c||e[12]!==l){m={...o,shots:o.shots.map(ys)},V=!$t(m,l),O=!!(m.title.trim()&&m.continuity.trim()&&m.frame.prompt.trim())&&m.shots.every(vs);const N=s.stage==="assembly"?"videos":s.stage,S=N==="frame",me=ft(o.style.id);let pe;e[26]!==o.style?(pe=qt(o.style,"frame"),e[26]=o.style,e[27]=pe):pe=e[27];const le=pe;let _;e[28]!==o.frame||e[29]!==s||e[30]!==S||e[31]!==l.frame?(_=!S&&(!!dt(s,"frame",0)||o.frame.prompt!==l.frame.prompt),e[28]=o.frame,e[29]=s,e[30]=S,e[31]=l.frame,e[32]=_):_=e[32],L=_;let Z;e[33]!==o.frameContinuity||e[34]!==o.shots||e[35]!==s||e[36]!==l.shots||e[37]!==N?(Z=N==="videos"&&o.shots.some((g,F)=>dt(s,"storyboards",F)||g.storyboardPrompt!==l.shots[F]?.storyboardPrompt||g.videoPrompt!==l.shots[F]?.videoPrompt||g.durationSeconds!==l.shots[F]?.durationSeconds||g.title!==l.shots[F]?.title||o.frameContinuity&&(dt(s,"storyboards",F+o.shots.length)||(g.endingPrompt??g.videoPrompt)!==(l.shots[F]?.endingPrompt??l.shots[F]?.videoPrompt))),e[33]=o.frameContinuity,e[34]=o.shots,e[35]=s,e[36]=l.shots,e[37]=N,e[38]=Z):Z=e[38],M=Z,r=!a&&O&&!L&&!M,u=s.estimate[N];let ce;e[39]!==u.usd?(ce=u.usd===null?"":` · $${u.usd.toFixed(2)}`,e[39]=u.usd,e[40]=ce):ce=e[40],E=`${S?"Generate frame":N==="storyboards"?"Use this frame · Generate storyboards":"Use these storyboards · Generate videos"}${ce}`,k=()=>{r&&h(m)};let ge;e[41]===Symbol.for("react.memo_cache_sentinel")?(ge=(g,F)=>w(fe=>({...fe,shots:fe.shots.map((Ke,rt)=>rt===g?{...Ke,...F}:Ke)})),e[41]=ge):ge=e[41];const re=ge,ae=(g,F)=>{const fe=g==="storyboards"&&F>=m.shots.length,Ke=F%m.shots.length,rt=g==="frame"?o.frame.prompt:fe?o.shots[Ke].endingPrompt??"":o.shots[Ke].storyboardPrompt;return t.jsx(Vt,{goal:s,stage:g,index:F,prompt:rt,disabled:a,canGenerate:O,resolveAsset:c,onOpen:x,onPromptChange:ze=>g==="frame"?w({...o,frame:{prompt:ze}}):re(Ke,fe?{endingPrompt:ze.trim()?ze:null}:{storyboardPrompt:ze}),onRegenerate:()=>j(m,g,F),onRevise:ze=>f(m,g,F,ze),onSelect:ze=>C(g,F,ze)},`${g}:${F}`)};let ne;e[42]===Symbol.for("react.memo_cache_sentinel")?(ne=t.jsx("span",{className:"sr-only",children:"Video title"}),e[42]=ne):ne=e[42];let oe;e[43]!==o?(oe=g=>w({...o,title:g.target.value}),e[43]=o,e[44]=oe):oe=e[44];let ye;e[45]!==a||e[46]!==o.title||e[47]!==oe?(ye=t.jsxs("label",{children:[ne,t.jsx("input",{value:o.title,maxLength:120,disabled:a,onChange:oe})]}),e[45]=a,e[46]=o.title,e[47]=oe,e[48]=ye):ye=e[48];let te;e[49]!==a||e[50]!==o||e[51]!==S?(te=hs.map(g=>t.jsx("button",{type:"button",role:"radio","aria-checked":o.aspectRatio===g.value,className:"goal-panel-button",disabled:a||!S,onClick:()=>w({...o,aspectRatio:g.value}),children:g.label},g.value)),e[49]=a,e[50]=o,e[51]=S,e[52]=te):te=e[52];let K;e[53]!==te?(K=t.jsx("div",{className:"goal-formats",role:"radiogroup","aria-label":"Format",children:te}),e[53]=te,e[54]=K):K=e[54];let Q;e[55]!==a||e[56]!==o||e[57]!==S?(Q=Mt.map(g=>t.jsx("button",{type:"button",role:"radio","aria-checked":o.style.id===g,className:"goal-panel-button",disabled:a||!S,title:ft(g).summary,onClick:()=>w({...o,style:{id:g,options:xt(g)}}),children:ft(g).label},g)),e[55]=a,e[56]=o,e[57]=S,e[58]=Q):Q=e[58];let ue;e[59]!==Q?(ue=t.jsx("div",{className:"goal-formats goal-styles",role:"radiogroup","aria-label":"Style",children:Q}),e[59]=Q,e[60]=ue):ue=e[60];const ee=me.options.length>0&&t.jsx("div",{className:"goal-style-options",children:me.options.map(g=>t.jsxs("label",{children:[t.jsx("span",{children:g.label}),t.jsx("select",{"aria-label":g.label,value:o.style.options[g.key],disabled:a||!S,onChange:F=>{const fe={...o.style.options,[g.key]:F.target.value};g.key==="delivery"&&delete fe.camera,w({...o,style:{id:me.id,options:xt(me.id,fe)}})},children:g.choices.map(bs)})]},g.key))});let Se;e[61]!==ye||e[62]!==K||e[63]!==ue||e[64]!==ee?(Se=t.jsxs("div",{className:"goal-plan-heading",children:[ye,K,ue,ee]}),e[61]=ye,e[62]=K,e[63]=ue,e[64]=ee,e[65]=Se):Se=e[65];const ke=Se;let xe;e[66]===Symbol.for("react.memo_cache_sentinel")?(xe=t.jsx("summary",{children:"Advanced"}),e[66]=xe):xe=e[66];const be=N==="videos"&&ke;let ve;if(e[67]!==s.characters||e[68]!==G||e[69]!==c){let g;e[71]!==G||e[72]!==c?(g=F=>t.jsx(ct,{artifactId:F.artifactId,cellId:F.cellId,label:`${F.address} · ${F.label}`,resolveAsset:c,onOpen:G},F.cellId),e[71]=G,e[72]=c,e[73]=g):g=e[73],ve=s.characters.map(g),e[67]=s.characters,e[68]=G,e[69]=c,e[70]=ve}else ve=e[70];let ie;e[74]!==ve?(ie=t.jsx("div",{className:"goal-characters","aria-label":"Character images",children:ve}),e[74]=ve,e[75]=ie):ie=e[75];let de;e[76]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx("span",{children:"Image model"}),e[76]=de):de=e[76];const q=a||!S;let Re;e[77]!==o?(Re=g=>w({...o,imageModel:g.target.value}),e[77]=o,e[78]=Re):Re=e[78];let Ce,Ge,$e;e[79]===Symbol.for("react.memo_cache_sentinel")?(Ce=t.jsx("option",{value:"nano-banana-2-1",children:"Nano Banana 2.1"}),Ge=t.jsx("option",{value:"sunburst",children:"GPT Image 2.5 Sunburst"}),$e=t.jsx("option",{value:"flare",children:"GPT Image 2.5 Flare"}),e[79]=Ce,e[80]=Ge,e[81]=$e):(Ce=e[79],Ge=e[80],$e=e[81]);let Le;e[82]!==o.imageModel||e[83]!==q||e[84]!==Re?(Le=t.jsxs("label",{children:[de,t.jsxs("select",{"aria-label":"Image model",value:o.imageModel,disabled:q,onChange:Re,children:[Ce,Ge,$e]})]}),e[82]=o.imageModel,e[83]=q,e[84]=Re,e[85]=Le):Le=e[85];let Fe;e[86]===Symbol.for("react.memo_cache_sentinel")?(Fe=t.jsx("span",{children:"Image resolution"}),e[86]=Fe):Fe=e[86];const Te=a||!S;let we;e[87]!==o?(we=g=>w({...o,imageResolution:g.target.value}),e[87]=o,e[88]=we):we=e[88];let Be,We;e[89]===Symbol.for("react.memo_cache_sentinel")?(Be=t.jsx("option",{value:"1K",children:"1K"}),We=t.jsx("option",{value:"2K",children:"2K"}),e[89]=Be,e[90]=We):(Be=e[89],We=e[90]);let Oe;e[91]!==o.imageResolution||e[92]!==Te||e[93]!==we?(Oe=t.jsxs("label",{children:[Fe,t.jsxs("select",{"aria-label":"Image resolution",value:o.imageResolution,disabled:Te,onChange:we,children:[Be,We]})]}),e[91]=o.imageResolution,e[92]=Te,e[93]=we,e[94]=Oe):Oe=e[94];let Ve;e[95]===Symbol.for("react.memo_cache_sentinel")?(Ve=t.jsx("span",{children:"Video resolution"}),e[95]=Ve):Ve=e[95];let Ae;e[96]!==o?(Ae=g=>w({...o,videoResolution:g.target.value}),e[96]=o,e[97]=Ae):Ae=e[97];let Pe,Ue;e[98]===Symbol.for("react.memo_cache_sentinel")?(Pe=t.jsx("option",{value:"480p",children:"480p"}),Ue=t.jsx("option",{value:"720p",children:"720p"}),e[98]=Pe,e[99]=Ue):(Pe=e[98],Ue=e[99]);let Ne;e[100]!==a||e[101]!==o.videoResolution||e[102]!==Ae?(Ne=t.jsxs("label",{children:[Ve,t.jsxs("select",{"aria-label":"Video resolution",value:o.videoResolution,disabled:a,onChange:Ae,children:[Pe,Ue]})]}),e[100]=a,e[101]=o.videoResolution,e[102]=Ae,e[103]=Ne):Ne=e[103];let Me;e[104]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx("span",{children:"Ending frames"}),e[104]=Me):Me=e[104];const st=o.frameContinuity?"on":"off",J=a||!S;let je;e[105]!==o?(je=g=>w({...o,frameContinuity:g.target.value==="on"}),e[105]=o,e[106]=je):je=e[106];let he,Je;e[107]===Symbol.for("react.memo_cache_sentinel")?(he=t.jsx("option",{value:"off",children:"Off · Storyboards only"}),Je=t.jsx("option",{value:"on",children:"On · Add ending references"}),e[107]=he,e[108]=Je):(he=e[107],Je=e[108]);let De;e[109]!==st||e[110]!==J||e[111]!==je?(De=t.jsxs("label",{children:[Me,t.jsxs("select",{"aria-label":"Ending frames",value:st,disabled:J,onChange:je,children:[he,Je]})]}),e[109]=st,e[110]=J,e[111]=je,e[112]=De):De=e[112];let Ee;e[113]!==Le||e[114]!==Oe||e[115]!==Ne||e[116]!==De?(Ee=t.jsxs("div",{className:"goal-advanced-options",children:[Le,Oe,Ne,De]}),e[113]=Le,e[114]=Oe,e[115]=Ne,e[116]=De,e[117]=Ee):Ee=e[117];let He;e[118]!==o.frameContinuity||e[119]!==o.shots.length?(He=o.frameContinuity&&t.jsxs("p",{className:"goal-panel-muted",children:["Adds ",o.shots.length," ending images to guide the final poses alongside each storyboard."]}),e[118]=o.frameContinuity,e[119]=o.shots.length,e[120]=He):He=e[120];let Ze;e[121]!==le?(Ze=le&&t.jsxs("p",{className:"goal-panel-muted goal-style-anchors",children:[t.jsx("strong",{children:"Style anchors"})," ",le]}),e[121]=le,e[122]=Ze):Ze=e[122];const lt=a||!S;let Qe;e[123]!==o?(Qe=g=>w({...o,continuity:g}),e[123]=o,e[124]=Qe):Qe=e[124];let qe;e[125]!==o.continuity||e[126]!==lt||e[127]!==Qe?(qe=t.jsx(Ye,{label:"Characters and visual style",value:o.continuity,budget:"continuity",maxLength:3e3,disabled:lt,onChange:Qe}),e[125]=o.continuity,e[126]=lt,e[127]=Qe,e[128]=qe):qe=e[128];let _e;e[129]!==a||e[130]!==o||e[131]!==S?(_e=S&&t.jsx(Ye,{label:"Full frame prompt",value:o.frame.prompt,budget:"frame",disabled:a,onChange:g=>w({...o,frame:{prompt:g}})}),e[129]=a,e[130]=o,e[131]=S,e[132]=_e):_e=e[132];let et;e[133]!==a||e[134]!==o.frameContinuity||e[135]!==o.shots||e[136]!==S?(et=S&&o.frameContinuity&&o.shots.map((g,F)=>t.jsx(Ye,{label:`Shot ${F+1} ending frame prompt`,value:g.endingPrompt??"",placeholder:"Final moment from the video prompt",budget:"ending",disabled:a,onChange:fe=>re(F,{endingPrompt:fe.trim()?fe:null})},g.editorId)),e[133]=a,e[134]=o.frameContinuity,e[135]=o.shots,e[136]=S,e[137]=et):et=e[137];let nt;e[138]!==be||e[139]!==ie||e[140]!==Ee||e[141]!==He||e[142]!==Ze||e[143]!==qe||e[144]!==_e||e[145]!==et?(nt=t.jsxs("details",{className:"goal-disclosure goal-advanced",children:[xe,t.jsxs("div",{className:"goal-editor-settings",children:[be,ie,Ee,He,Ze,qe,_e,et]})]}),e[138]=be,e[139]=ie,e[140]=Ee,e[141]=He,e[142]=Ze,e[143]=qe,e[144]=_e,e[145]=et,e[146]=nt):nt=e[146];const at=nt;let ot;e[147]===Symbol.for("react.memo_cache_sentinel")?(ot=t.jsx("span",{children:"Shots"}),e[147]=ot):ot=e[147];let tt;e[148]!==a||e[149]!==o||e[150]!==S?(tt=S&&t.jsxs("button",{type:"button",className:"goal-panel-button",disabled:a||o.shots.length>=8,onClick:()=>w({...o,shots:[...o.shots,{editorId:crypto.randomUUID(),title:`Shot ${o.shots.length+1}`,storyboardPrompt:"",endingPrompt:null,videoPrompt:"",durationSeconds:10}]}),children:[t.jsx(rs,{size:12,"aria-hidden":"true"}),"Add shot"]}),e[148]=a,e[149]=o,e[150]=S,e[151]=tt):tt=e[151];const it=t.jsxs("div",{className:"goal-editor-shots",children:[t.jsxs("div",{className:"goal-editor-shots-head",children:[ot,t.jsxs("small",{children:[o.shots.length," clips · ",zt(m),"s planned"]}),tt]}),t.jsx("ol",{className:"goal-editor-shot-list",children:o.shots.map((g,F)=>t.jsxs("li",{className:"goal-editor-shot",children:[t.jsxs("div",{className:"goal-editor-shot-head",children:[t.jsx("span",{className:"goal-editor-shot-number",children:String(F+1).padStart(2,"0")}),t.jsx("input",{"aria-label":`Shot ${F+1} title`,value:g.title,maxLength:120,disabled:a,onChange:fe=>re(F,{title:fe.target.value})}),t.jsxs("span",{className:"goal-editor-seconds",children:[t.jsx("input",{type:"number",min:4,max:30,step:1,"aria-label":`Shot ${F+1} seconds`,value:g.durationSeconds,disabled:a,onChange:fe=>re(F,{durationSeconds:Number(fe.target.value)})}),t.jsx("span",{"aria-hidden":"true",children:"s"})]}),S&&t.jsx("button",{type:"button",className:"goal-editor-remove","aria-label":`Remove shot ${F+1}`,disabled:a||o.shots.length===1,onClick:()=>w({...o,shots:o.shots.filter((fe,Ke)=>Ke!==F)}),children:t.jsx(cs,{size:14,"aria-hidden":"true"})})]}),N==="videos"?ae("storyboards",F):t.jsx(Ye,{label:"Storyboard prompt",name:`Shot ${F+1} storyboard prompt`,value:g.storyboardPrompt,budget:"storyboard",disabled:a,onChange:fe=>re(F,{storyboardPrompt:fe})}),N==="videos"&&m.frameContinuity&&ae("storyboards",F+m.shots.length),t.jsx(Ye,{label:"Video prompt",name:`Shot ${F+1} video prompt`,value:g.videoPrompt,budget:"video",disabled:a,onChange:fe=>re(F,{videoPrompt:fe})})]},g.editorId))})]});D="goal-editor",b=N,Y=g=>{g.key!=="Enter"||!(g.metaKey||g.ctrlKey)||g.nativeEvent.isComposing||(g.preventDefault(),k())},U=S?t.jsxs(t.Fragment,{children:[ke,it,t.jsxs("div",{className:"goal-plan-extras",children:[at,t.jsx("p",{className:"goal-panel-muted goal-brief-line",children:s.brief})]})]}):N==="storyboards"?t.jsxs(t.Fragment,{children:[ae("frame",0),t.jsxs("details",{className:"goal-disclosure",children:[t.jsx("summary",{children:"Plan"}),ke,it,at]})]}):t.jsxs(t.Fragment,{children:[it,t.jsxs("details",{className:"goal-disclosure",children:[t.jsx("summary",{children:"Back to frame"}),ae("frame",0)]}),at]}),e[2]=a,e[3]=o,e[4]=s,e[5]=h,e[6]=x,e[7]=j,e[8]=f,e[9]=C,e[10]=G,e[11]=c,e[12]=l,e[13]=r,e[14]=V,e[15]=u,e[16]=m,e[17]=k,e[18]=E,e[19]=M,e[20]=L,e[21]=D,e[22]=b,e[23]=Y,e[24]=U,e[25]=O}else r=e[13],V=e[14],u=e[15],m=e[16],k=e[17],E=e[18],M=e[19],L=e[20],D=e[21],b=e[22],Y=e[23],U=e[24],O=e[25];const d=V?"Changes will be saved before generation.":"Approves this stage only.";let p;e[152]!==d?(p=t.jsx("span",{children:d}),e[152]=d,e[153]=p):p=e[153];let A;e[154]!==u.warnings?(A=u.warnings.map(gs),e[154]=u.warnings,e[155]=A):A=e[155];let R;e[156]!==O?(R=!O&&t.jsx("span",{role:"status",className:"goal-panel-warning",children:"Complete all prompts and give each shot a whole duration from 4 to 30 seconds."}),e[156]=O,e[157]=R):R=e[157];let P;e[158]!==M||e[159]!==L?(P=(L||M)&&t.jsx("span",{role:"status",className:"goal-panel-warning",children:"Regenerate or revise the changed stills before continuing."}),e[158]=M,e[159]=L,e[160]=P):P=e[160];let B;e[161]!==P||e[162]!==p||e[163]!==A||e[164]!==R?(B=t.jsxs("div",{className:"goal-panel-bar-copy",children:[p,A,R,P]}),e[161]=P,e[162]=p,e[163]=A,e[164]=R,e[165]=B):B=e[165];let H;e[166]!==V||e[167]!==a||e[168]!==v||e[169]!==m||e[170]!==O?(H=V&&t.jsx("button",{type:"button",className:"goal-panel-button",disabled:a||!O,onClick:()=>v(m),children:"Save plan"}),e[166]=V,e[167]=a,e[168]=v,e[169]=m,e[170]=O,e[171]=H):H=e[171];const z=!r;let $;e[172]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx("span",{"aria-hidden":"true",children:"↵"}),e[172]=$):$=e[172];let W;e[173]!==k||e[174]!==E||e[175]!==z?(W=t.jsxs("button",{type:"button",className:"goal-panel-primary",disabled:z,title:"⌘↵ approves this stage",onClick:k,children:[E,$]}),e[173]=k,e[174]=E,e[175]=z,e[176]=W):W=e[176];let I;e[177]!==B||e[178]!==H||e[179]!==W?(I=t.jsxs("div",{className:"goal-panel-bar",children:[B,H,W]}),e[177]=B,e[178]=H,e[179]=W,e[180]=I):I=e[180];let X;return e[181]!==I||e[182]!==D||e[183]!==b||e[184]!==Y||e[185]!==U?(X=t.jsxs("div",{className:D,"data-review":b,onKeyDown:Y,children:[U,I]}),e[181]=I,e[182]=D,e[183]=b,e[184]=Y,e[185]=U,e[186]=X):X=e[186],X}function gs(n){return t.jsx("span",{children:n},n)}function bs(n){return t.jsx("option",{value:n.value,children:n.label},n.value)}function vs(n){return n.title.trim()&&n.storyboardPrompt.trim()&&n.videoPrompt.trim()&&Number.isInteger(n.durationSeconds)&&n.durationSeconds>=4&&n.durationSeconds<=30}function ys(n){const{editorId:e,...s}=n;return s}function xs(n){return{...n,editorId:crypto.randomUUID()}}function kt(n){return n==null?" · estimate unavailable":` · $${n.toFixed(2)}`}function js(n,e){const s=n.stages[e]?.outputs[0];return s?s.versions.find(l=>l.current)?.basePrompt??n.stages[e]?.attempts?.find(l=>l.artifactId===s.artifactId)?.basePrompt??null:null}function Ss(n){const e=Xe.c(175),{goal:s,plan:l,disabled:a,resolveAsset:v,onPreviewCell:h,onRun:j,onAction:f}=n;let C;e[0]!==s.finish||e[1]!==s.stage?(C=()=>s.finish?"finish":s.stage==="videos"?"video":"scene",e[0]=s.finish,e[1]=s.stage,e[2]=C):C=e[2];const[c,G]=Ie.useState(C),[x,i]=Ie.useState(l.title),[o,w]=Ie.useState(l.scene.prompt),[r,V]=Ie.useState(l.video.prompt),u=s.coldOpen;let m;e[3]!==u?.endSeconds||e[4]!==u?.sourceObjectHash||e[5]!==u?.startSeconds?(m=()=>({start:u?.startSeconds??0,end:u?.endSeconds??0,hash:u?.sourceObjectHash??""}),e[3]=u?.endSeconds,e[4]=u?.sourceObjectHash,e[5]=u?.startSeconds,e[6]=m):m=e[6];const[k,E]=Ie.useState(m);u&&u.sourceObjectHash!==k.hash&&E({start:u.startSeconds,end:u.endSeconds,hash:u.sourceObjectHash});let M;e[7]!==x?(M=x.trim(),e[7]=x,e[8]=M):M=e[8];const L=M;let D;e[9]!==o?(D=o.trim(),e[9]=o,e[10]=D):D=e[10];const b=D;let Y;e[11]!==r?(Y=r.trim(),e[11]=r,e[12]=Y):Y=e[12];const U=Y,O=L!==l.title||b!==l.scene.prompt||U!==l.video.prompt,d=!!(L&&b&&U);let p;e[13]!==s?(p=js(s,"frame"),e[13]=s,e[14]=p):p=e[14];const A=p,R=s.stages.frame?.outputs[0],P=s.stages.videos?.outputs[0],B=!!R&&(b!==l.scene.prompt||A!==null&&A!==l.scene.prompt),H=U!==l.video.prompt,z=s.status==="running",$=s.finish?.status==="running",W=s.finish?.status==="failed",I=s.finish?.sourceArtifactId??P?.artifactId??null;let X;e[15]!==v||e[16]!==I?(X=I?v(I):null,e[15]=v,e[16]=I,e[17]=X):X=e[17];const N=X,S=u?.durationSeconds??N?.duration??null,me=u?.analysisUsd??0;let pe;e[18]!==s.finalArtifactId||e[19]!==v?(pe=s.finalArtifactId?v(s.finalArtifactId):null,e[18]=s.finalArtifactId,e[19]=v,e[20]=pe):pe=e[20];const le=pe,_=!!(s.finalArtifactId&&le?.mediaUrl);let Z;e[21]!==b||e[22]!==l.scene?(Z={...l.scene,prompt:b},e[21]=b,e[22]=l.scene,e[23]=Z):Z=e[23];let ce;e[24]!==U||e[25]!==l.video?(ce={...l.video,prompt:U},e[24]=U,e[25]=l.video,e[26]=ce):ce=e[26];let ge;e[27]!==L||e[28]!==l||e[29]!==ce||e[30]!==Z?(ge={...l,title:L,scene:Z,video:ce},e[27]=L,e[28]=l,e[29]=ce,e[30]=Z,e[31]=ge):ge=e[31];const re=ge,ae=k.hash?k.start:u?.startSeconds??0,ne=k.hash?k.end:u?.endSeconds??(S==null?0:Math.min(S,2.3));let oe;e[32]!==S||e[33]!==ne||e[34]!==ae?(oe=S==null?null:Jt(ae,ne,S),e[32]=S,e[33]=ne,e[34]=ae,e[35]=oe):oe=e[35];const ye=oe;let te;e[36]!==s.estimate.frame.usd?(te=kt(s.estimate.frame.usd),e[36]=s.estimate.frame.usd,e[37]=te):te=e[37];const K=te;let Q;e[38]!==s.estimate.videos.usd?(Q=kt(s.estimate.videos.usd),e[38]=s.estimate.videos.usd,e[39]=Q):Q=e[39];const ue=Q,ee=s.status==="review"&&d&&!a&&!z&&!$,Se=ee&&!B&&!!R,ke=!!I&&S!=null&&!ye&&!O&&!B&&!a&&!z&&!$&&(s.status==="review"||s.status==="completed"||W);let xe;e[40]!==O||e[41]!==re||e[42]!==s||e[43]!==f||e[44]!==j?(xe=(J,je)=>{j(async()=>{const he=O?await f({action:"update",revision:s.revision,plan:re}):s;await f({action:J,revision:he.revision,stage:je,index:0})})},e[40]=O,e[41]=re,e[42]=s,e[43]=f,e[44]=j,e[45]=xe):xe=e[45];const be=xe;let ve;e[46]!==u?.sourceObjectHash||e[47]!==S||e[48]!==ne||e[49]!==ae||e[50]!==N||e[51]!==I?(ve=I&&S!=null&&N?.mediaUrl?{sourceArtifactId:I,sourceObjectHash:u?.sourceObjectHash??N.objectHash??I,durationSeconds:S,fps:N.fps&&N.fps>0?N.fps:24,startSeconds:ae,endSeconds:ne,reason:"A 2.3 second highlight from the start of this video. Review the range before finishing. Analysis is free.",model:"lightning"}:null,e[46]=u?.sourceObjectHash,e[47]=S,e[48]=ne,e[49]=ae,e[50]=N,e[51]=I,e[52]=ve):ve=e[52];const ie=ve;let de;e[53]!==s.bookId||e[54]!==s.goalId||e[55]!==s.notebookId||e[56]!==l.title||e[57]!==N||e[58]!==I||e[59]!==ie?(de=ie&&I&&N?.mediaUrl?{bookId:s.bookId,notebookId:s.notebookId,assetId:I,label:l.title,mediaUrl:N.mediaUrl,requestId:s.goalId,suggestion:ie}:null,e[53]=s.bookId,e[54]=s.goalId,e[55]=s.notebookId,e[56]=l.title,e[57]=N,e[58]=I,e[59]=ie,e[60]=de):de=e[60];const q=de;let Re;e[61]!==a||e[62]!==s||e[63]!==f||e[64]!==j||e[65]!==v?(Re=(J,je)=>Ft(s,J,0).map((he,Je,De)=>{const Ee=he.artifactId?v(he.artifactId):null,He=`v${De.length-Je}`;return t.jsxs("button",{type:"button",className:"goal-version","aria-label":`${je} ${He}`,"aria-pressed":he.current,disabled:a||!he.artifactId||he.status!=="completed",onClick:()=>{he.artifactId&&j(()=>f({action:"select",revision:s.revision,stage:J,index:0,artifact_id:he.artifactId}))},children:[(Ee?.thumbnailUrl??Ee?.mediaUrl)&&t.jsx("img",{src:Ee.thumbnailUrl??Ee.mediaUrl??"",alt:""}),t.jsx("span",{children:He})]},`${he.chainId}:${he.stepId}`)}),e[61]=a,e[62]=s,e[63]=f,e[64]=j,e[65]=v,e[66]=Re):Re=e[66];const Ce=Re;let Ge;e[67]===Symbol.for("react.memo_cache_sentinel")?(Ge=[["scene","Scene"],["video","Video"],["finish","Finish"]],e[67]=Ge):Ge=e[67];let $e;e[68]!==c?($e=t.jsx("nav",{className:"goal-stage-tabs","aria-label":"Goal stages",children:Ge.map(J=>{const[je,he]=J;return t.jsx("button",{type:"button",className:"goal-panel-button","aria-pressed":c===je,onClick:()=>G(je),children:he},je)})}),e[68]=c,e[69]=$e):$e=e[69];let Le;e[70]!==l.aspectRatio||e[71]!==l.video.durationSeconds?(Le=t.jsxs("p",{className:"goal-panel-muted",children:[l.video.durationSeconds,"s video · ",l.aspectRatio," · Seedance 2.5"]}),e[70]=l.aspectRatio,e[71]=l.video.durationSeconds,e[72]=Le):Le=e[72];let Fe;e[73]!==s.stage||e[74]!==z?(Fe=z&&t.jsx("p",{role:"status",children:s.stage==="videos"?"Generating the video.":"Generating the scene."}),e[73]=s.stage,e[74]=z,e[75]=Fe):Fe=e[75];let Te;e[76]!==a||e[77]!==$||e[78]!==h||e[79]!==l.scene.imageRefs||e[80]!==v||e[81]!==R||e[82]!==o||e[83]!==x||e[84]!==Ce||e[85]!==c?(Te=c==="scene"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"goal-reference-grid","aria-label":"Scene references",children:l.scene.imageRefs.map(J=>t.jsx(ct,{artifactId:J.artifactId,cellId:J.cellId,label:`${J.slot} · ${J.address}`,resolveAsset:v,onOpen:h},J.slot))}),R&&t.jsx(ct,{artifactId:R.artifactId,cellId:R.cellId,label:"Approved scene",resolveAsset:v,onOpen:h}),R&&t.jsx("div",{className:"goal-versions","aria-label":"Scene versions",children:Ce("frame","Scene")}),t.jsxs("label",{children:[t.jsx("span",{children:"Title"}),t.jsx("input",{"aria-label":"Video title",value:x,maxLength:120,disabled:a||$,onChange:J=>i(J.target.value)})]}),t.jsx(Ye,{label:"Scene prompt",value:o,budget:"frame",wordLimit:Yt,disabled:a||$,onChange:w})]}),e[76]=a,e[77]=$,e[78]=h,e[79]=l.scene.imageRefs,e[80]=v,e[81]=R,e[82]=o,e[83]=x,e[84]=Ce,e[85]=c,e[86]=Te):Te=e[86];let we;e[87]!==a||e[88]!==$||e[89]!==h||e[90]!==l.video.imageRefs||e[91]!==l.video.videoRefs||e[92]!==v||e[93]!==B||e[94]!==R||e[95]!==N||e[96]!==I||e[97]!==Ce||e[98]!==P||e[99]!==r||e[100]!==c?(we=c==="video"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"goal-reference-grid","aria-label":"Video references",children:[...l.video.imageRefs,...l.video.videoRefs].map(J=>t.jsx(ct,{artifactId:J.artifactId,cellId:J.cellId,label:`${J.slot} · ${J.address}`,resolveAsset:v,onOpen:h},J.slot))}),R&&t.jsx(ct,{artifactId:R.artifactId,cellId:R.cellId,label:"Approved scene",resolveAsset:v,onOpen:h}),P&&N?.mediaUrl&&P.artifactId===I?t.jsx("video",{className:"goal-video-preview","aria-label":"Approved video",src:N.mediaUrl,poster:N.thumbnailUrl??void 0,controls:!0,preload:"metadata"}):P&&t.jsx(ct,{artifactId:P.artifactId,cellId:P.cellId,label:"Approved video",resolveAsset:v,onOpen:h}),P&&t.jsx("div",{className:"goal-versions","aria-label":"Video versions",children:Ce("videos","Video")}),t.jsx(Ye,{label:"Video prompt",value:r,budget:"video",wordLimit:Xt,disabled:a||$,onChange:V}),!R&&t.jsx("p",{className:"goal-panel-muted",children:"Generate the scene before the video."}),B&&t.jsx("p",{role:"status",className:"goal-panel-warning",children:"Refresh the scene before continuing."})]}),e[87]=a,e[88]=$,e[89]=h,e[90]=l.video.imageRefs,e[91]=l.video.videoRefs,e[92]=v,e[93]=B,e[94]=R,e[95]=N,e[96]=I,e[97]=Ce,e[98]=P,e[99]=r,e[100]=c,e[101]=we):we=e[101];let Be;e[102]!==me||e[103]!==u?.sourceObjectHash||e[104]!==O||e[105]!==a||e[106]!==le||e[107]!==W||e[108]!==$||e[109]!==s.finalArtifactId||e[110]!==s.finish||e[111]!==_||e[112]!==k.hash||e[113]!==q||e[114]!==I||e[115]!==H||e[116]!==P||e[117]!==c?(Be=c==="finish"&&t.jsxs(t.Fragment,{children:[t.jsxs("p",{children:["Finishing analysis · $",me.toFixed(2)]}),!I&&t.jsx("p",{className:"goal-panel-muted",children:"Approve the video before finishing it."}),$&&t.jsx("p",{role:"status",children:"Rendering the cold open, then burning the saved watermark."}),W&&t.jsx("p",{role:"alert",children:s.finish?.error??"Finishing failed"}),_&&le?.mediaUrl&&t.jsx("video",{className:"goal-video-preview","aria-label":"Finished video",src:le.mediaUrl,poster:le.thumbnailUrl??void 0,controls:!0,preload:"metadata"}),s.finalArtifactId&&!_&&!$&&t.jsx("p",{role:"status",children:"The finished video is not playable yet."}),!$&&q&&t.jsx(ds,{review:q,disabled:a||$,onChange:(J,je)=>E({start:J,end:je,hash:k.hash||u?.sourceObjectHash||I||""})}),!$&&I&&!q&&t.jsx("p",{role:"status",children:"The video is not playable yet."}),O&&(s.finish||P)&&t.jsx("p",{className:"goal-panel-warning",children:"Saving a prompt clears the cold open."}),H&&t.jsx("p",{className:"goal-panel-muted",children:"Save the video prompt before finishing."})]}),e[102]=me,e[103]=u?.sourceObjectHash,e[104]=O,e[105]=a,e[106]=le,e[107]=W,e[108]=$,e[109]=s.finalArtifactId,e[110]=s.finish,e[111]=_,e[112]=k.hash,e[113]=q,e[114]=I,e[115]=H,e[116]=P,e[117]=c,e[118]=Be):Be=e[118];const We=O?"Saving a prompt clears the cold open. Settings stay with this goal.":$?"The cold open renders first, then the saved watermark is burned onto a copy.":"Approves this step only.";let Oe;e[119]!==We?(Oe=t.jsx("div",{className:"goal-panel-bar-copy",children:t.jsx("span",{children:We})}),e[119]=We,e[120]=Oe):Oe=e[120];let Ve;e[121]!==O||e[122]!==a||e[123]!==re||e[124]!==$||e[125]!==s.revision||e[126]!==f||e[127]!==j||e[128]!==d?(Ve=O&&t.jsx("button",{type:"button",className:"goal-panel-button",disabled:a||!d||$,onClick:()=>j(()=>f({action:"update",revision:s.revision,plan:re})),children:"Save"}),e[121]=O,e[122]=a,e[123]=re,e[124]=$,e[125]=s.revision,e[126]=f,e[127]=j,e[128]=d,e[129]=Ve):Ve=e[129];let Ae;e[130]!==ee||e[131]!==s.status||e[132]!==be||e[133]!==K||e[134]!==R||e[135]!==c?(Ae=c==="scene"&&s.status==="review"&&t.jsxs("button",{type:"button",className:"goal-panel-primary",disabled:!ee,onClick:()=>be(R?"regenerate":"approve","frame"),children:[R?"Regenerate scene":"Generate scene",K]}),e[130]=ee,e[131]=s.status,e[132]=be,e[133]=K,e[134]=R,e[135]=c,e[136]=Ae):Ae=e[136];let Pe;e[137]!==Se||e[138]!==s.status||e[139]!==be||e[140]!==ue||e[141]!==P||e[142]!==c?(Pe=c==="video"&&s.status==="review"&&t.jsxs("button",{type:"button",className:"goal-panel-primary",disabled:!Se,onClick:()=>be(P?"regenerate":"approve","videos"),children:[P?"Regenerate video":"Generate video",ue]}),e[137]=Se,e[138]=s.status,e[139]=be,e[140]=ue,e[141]=P,e[142]=c,e[143]=Pe):Pe=e[143];let Ue;e[144]!==ke||e[145]!==W||e[146]!==$||e[147]!==s.status||e[148]!==f||e[149]!==j||e[150]!==ne||e[151]!==ae||e[152]!==c?(Ue=c==="finish"&&!$&&(s.status==="review"||s.status==="completed"||W)&&t.jsx("button",{type:"button",className:"goal-panel-primary",disabled:!ke,onClick:()=>j(()=>f({action:"finish",start_seconds:ae,end_seconds:ne})),children:"Finish"}),e[144]=ke,e[145]=W,e[146]=$,e[147]=s.status,e[148]=f,e[149]=j,e[150]=ne,e[151]=ae,e[152]=c,e[153]=Ue):Ue=e[153];let Ne;e[154]!==a||e[155]!==s||e[156]!==f||e[157]!==j?(Ne=Et(s)&&t.jsx("button",{type:"button",className:"goal-panel-primary",disabled:a,onClick:()=>j(()=>f({action:"retry"})),children:"Retry"}),e[154]=a,e[155]=s,e[156]=f,e[157]=j,e[158]=Ne):Ne=e[158];let Me;e[159]!==Oe||e[160]!==Ve||e[161]!==Ae||e[162]!==Pe||e[163]!==Ue||e[164]!==Ne?(Me=t.jsxs("div",{className:"goal-panel-bar",children:[Oe,Ve,Ae,Pe,Ue,Ne]}),e[159]=Oe,e[160]=Ve,e[161]=Ae,e[162]=Pe,e[163]=Ue,e[164]=Ne,e[165]=Me):Me=e[165];let st;return e[166]!==$e||e[167]!==Le||e[168]!==Fe||e[169]!==Te||e[170]!==we||e[171]!==Be||e[172]!==Me||e[173]!==c?(st=t.jsxs("div",{className:"goal-editor goal-simple","data-review":c,children:[$e,Le,Fe,Te,we,Be,Me]}),e[166]=$e,e[167]=Le,e[168]=Fe,e[169]=Te,e[170]=we,e[171]=Be,e[172]=Me,e[173]=c,e[174]=st):st=e[174],st}const Ns=[{id:"frame",label:"Scene"},{id:"storyboards",label:"Storyboard"},{id:"videos",label:"Video"}];function Cs(n){const e=Xe.c(254),{goal:s,plan:l,disabled:a,onSave:v,onApprove:h,onRegenerate:j,onRevise:f,onSelect:C,resolveAsset:c,onPreviewCell:G}=n;let x;e[0]!==l?(x=()=>l,e[0]=l,e[1]=x):x=e[1];const[i,o]=Ie.useState(x);let w;e[2]!==l.shots?(w=()=>l.shots.map(Gs),e[2]=l.shots,e[3]=w):w=e[3];const[r,V]=Ie.useState(w);let u;e[4]!==s.stage||e[5]!==s.stages.videos?.outputs||e[6]!==s.status?(u=()=>s.status==="completed"||s.stages.videos?.outputs.length?"videos":s.stage==="videos"?"storyboards":"frame",e[4]=s.stage,e[5]=s.stages.videos?.outputs,e[6]=s.status,e[7]=u):u=e[7];const[m,k]=Ie.useState(u);let E,M,L,D,b,Y,U,O,d,p,A,R,P,B,H,z,$,W,I,X,N,S,me,pe,le,_,Z;if(e[8]!==a||e[9]!==i||e[10]!==s||e[11]!==h||e[12]!==G||e[13]!==j||e[14]!==f||e[15]!==C||e[16]!==c||e[17]!==l||e[18]!==r||e[19]!==m){p={...i,shots:r.map(ks)},D=!$t(p,l),U=!s.stages.frame?.outputs.length,Z=!!(p.title.trim()&&p.continuity.trim()&&p.frame.prompt.trim())&&r.every(Ps);let ie;e[47]!==i.aspectRatio||e[48]!==i.imageModel||e[49]!==i.imageResolution||e[50]!==i.style||e[51]!==l.aspectRatio||e[52]!==l.imageModel||e[53]!==l.imageResolution||e[54]!==l.style?(ie=i.aspectRatio!==l.aspectRatio||i.imageModel!==l.imageModel||i.imageResolution!==l.imageResolution||!Zt(i.style,l.style),e[47]=i.aspectRatio,e[48]=i.imageModel,e[49]=i.imageResolution,e[50]=i.style,e[51]=l.aspectRatio,e[52]=l.imageModel,e[53]=l.imageResolution,e[54]=l.style,e[55]=ie):ie=e[55];const de=ie;let q;e[56]!==i.frameContinuity||e[57]!==i.imageModel||e[58]!==i.imageResolution||e[59]!==i.videoResolution||e[60]!==l.frameContinuity||e[61]!==l.imageModel||e[62]!==l.imageResolution||e[63]!==l.shots||e[64]!==l.videoResolution||e[65]!==r?(q=i.imageModel!==l.imageModel||i.imageResolution!==l.imageResolution||i.videoResolution!==l.videoResolution||i.frameContinuity!==l.frameContinuity||r.length!==l.shots.length||r.some((y,T)=>y.durationSeconds!==l.shots[T]?.durationSeconds),e[56]=i.frameContinuity,e[57]=i.imageModel,e[58]=i.imageResolution,e[59]=i.videoResolution,e[60]=l.frameContinuity,e[61]=l.imageModel,e[62]=l.imageResolution,e[63]=l.shots,e[64]=l.videoResolution,e[65]=r,e[66]=q):q=e[66],A=q;let Re;e[67]!==i.continuity||e[68]!==i.frame||e[69]!==i.referenceRoles||e[70]!==s||e[71]!==U||e[72]!==l.continuity||e[73]!==l.frame||e[74]!==l.referenceRoles||e[75]!==de?(Re=!U&&(!!dt(s,"frame",0)||de||i.frame.prompt!==l.frame.prompt||i.continuity!==l.continuity||JSON.stringify(i.referenceRoles)!==JSON.stringify(l.referenceRoles)),e[67]=i.continuity,e[68]=i.frame,e[69]=i.referenceRoles,e[70]=s,e[71]=U,e[72]=l.continuity,e[73]=l.frame,e[74]=l.referenceRoles,e[75]=de,e[76]=Re):Re=e[76],Y=Re;let Ce;if(e[77]!==i.frameContinuity||e[78]!==s||e[79]!==l.shots||e[80]!==l.storyboardLayout||e[81]!==r){let y;e[83]!==i.frameContinuity||e[84]!==s||e[85]!==l.shots||e[86]!==l.storyboardLayout||e[87]!==r.length?(y=(T,se)=>dt(s,"storyboards",se)||T.storyboardPrompt!==l.shots[se]?.storyboardPrompt||T.durationSeconds!==l.shots[se]?.durationSeconds||T.title!==l.shots[se]?.title||l.storyboardLayout!=="six-panel"&&T.videoPrompt!==l.shots[se]?.videoPrompt||i.frameContinuity&&(dt(s,"storyboards",se+r.length)||(T.endingPrompt??T.videoPrompt)!==(l.shots[se]?.endingPrompt??l.shots[se]?.videoPrompt)),e[83]=i.frameContinuity,e[84]=s,e[85]=l.shots,e[86]=l.storyboardLayout,e[87]=r.length,e[88]=y):y=e[88],Ce=r.some(y),e[77]=i.frameContinuity,e[78]=s,e[79]=l.shots,e[80]=l.storyboardLayout,e[81]=r,e[82]=Ce}else Ce=e[82];E=Ce,d=s.stage==="assembly"?"videos":s.stage,M=s.status==="review"&&Z&&!a&&!A&&(d==="frame"||!Y)&&(d!=="videos"||!E),b=s.estimate[d];let Ge;e[89]!==b.usd?(Ge=b.usd===null?" · estimate unavailable":` · $${b.usd.toFixed(2)}`,e[89]=b.usd,e[90]=Ge):Ge=e[90],L=Ge;const $e=`Use scene · Generate storyboard${r.length>1?"s":""}`,Le=`Use storyboard${r.length>1?"s":""} · Generate video${r.length>1?"s":""}`;let Fe;e[91]!==$e||e[92]!==Le?(Fe={frame:"Generate scene",storyboards:$e,videos:Le},e[91]=$e,e[92]=Le,e[93]=Fe):Fe=e[93],O=Fe;let Te;e[94]===Symbol.for("react.memo_cache_sentinel")?(Te=(y,T)=>V(se=>se.map((Ct,yt)=>yt===y?{...Ct,...T}:Ct)),e[94]=Te):Te=e[94],_=Te;let we;e[95]!==i.frame||e[96]!==r?(we=(y,T)=>y==="frame"?i.frame.prompt:y==="storyboards"&&T>=r.length?r[T%r.length].endingPrompt??"":y==="storyboards"?r[T].storyboardPrompt:r[T].videoPrompt,e[95]=i.frame,e[96]=r,e[97]=we):we=e[97];const Be=we;let We;e[98]!==i||e[99]!==r.length?(We=(y,T,se)=>y==="frame"?o({...i,frame:{prompt:se}}):_(T%r.length,y==="videos"?{videoPrompt:se}:T>=r.length?{endingPrompt:se||null}:{storyboardPrompt:se}),e[98]=i,e[99]=r.length,e[100]=We):We=e[100];const Oe=We,Ve=(y,T)=>t.jsx(Vt,{goal:s,stage:y,index:T,prompt:Be(y,T),disabled:a,canGenerate:Z&&!A&&(y==="frame"||!Y)&&(y!=="videos"||!E),resolveAsset:c,onOpen:G,onPromptChange:se=>Oe(y,T,se),onRegenerate:()=>j(p,y,T),onRevise:se=>f(p,y,T,se),onSelect:se=>C(y,T,se)},`${y}:${r[T%r.length]?.editorId??"scene"}:${T>=r.length}`),Ae=ft(i.style.id);R="goal-editor goal-simple",P=m,B=y=>{y.key!=="Enter"||!(y.metaKey||y.ctrlKey)||y.nativeEvent.isComposing||(y.preventDefault(),M&&h(p))};let Pe;e[101]!==s.stages||e[102]!==m?(Pe=Ns.map(y=>t.jsxs("button",{type:"button",className:"goal-panel-button","aria-pressed":m===y.id,onClick:()=>k(y.id),children:[y.label,s.stages[y.id]?.outputs.length?s.stages[y.id]?.outputs.some(ws)?" · Needs refresh":" ✓":""]},y.id)),e[101]=s.stages,e[102]=m,e[103]=Pe):Pe=e[103],e[104]!==Pe?(H=t.jsx("nav",{className:"goal-stage-tabs","aria-label":"Goal stages",children:Pe}),e[104]=Pe,e[105]=H):H=e[105],z=t.jsxs("p",{className:"goal-panel-muted",children:[r.length===1?`${r[0].durationSeconds}s video`:`${r.length} clips`," · ",p.aspectRatio," · Seedance 2.5"]}),$=m==="frame"&&(U?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"goal-reference-grid","aria-label":"Reference images",children:s.characters.map((y,T)=>t.jsxs("div",{children:[t.jsx(ct,{artifactId:y.artifactId,cellId:y.cellId,label:`Reference ${T+1} · ${y.address}`,resolveAsset:c,onOpen:G}),t.jsxs("label",{children:[t.jsx("span",{children:"Role"}),t.jsxs("select",{"aria-label":`Reference ${T+1} role`,value:i.referenceRoles?.[T]??"reference",disabled:a,onChange:se=>o({...i,referenceRoles:s.characters.map((Ct,yt)=>yt===T?se.target.value:i.referenceRoles?.[yt]??"reference")}),children:[t.jsx("option",{value:"scene",children:"Scene screenshot"}),t.jsx("option",{value:"character",children:"Character"}),t.jsx("option",{value:"prop",children:"Prop"}),t.jsx("option",{value:"reference",children:"Reference"})]})]})]},y.cellId))}),t.jsx(Ye,{label:"Scene prompt",value:i.frame.prompt,budget:"frame",disabled:a,onChange:y=>Oe("frame",0,y)})]}):Ve("frame",0)),W=m!=="frame"&&t.jsx("div",{className:"goal-simple-outputs",children:r.map((y,T)=>t.jsxs("div",{children:[r.length>1&&t.jsx("p",{className:"goal-panel-muted",children:y.title}),s.stages[m]?.outputs.some(se=>se.index===T)?Ve(m,T):t.jsx(Ye,{label:m==="storyboards"?"Storyboard prompt":"Video directions",name:`Shot ${T+1} ${m==="storyboards"?"storyboard":"video"} prompt`,value:Be(m,T),budget:m==="storyboards"?"storyboard":"video",wordLimit:m==="storyboards"&&p.storyboardLayout==="six-panel"?48:void 0,disabled:a,onChange:se=>Oe(m,T,se)}),m==="storyboards"&&p.frameContinuity&&Ve(m,T+r.length)]},y.editorId))}),e[106]!==p||e[107]!==m?(I=m==="storyboards"&&t.jsxs("p",{className:"goal-panel-muted",children:[p.storyboardLayout==="six-panel"?"Six beats · 2 columns × 3 rows":"Four beats · 2 × 2"," · timestamps and camera notes below each picture."]}),e[106]=p,e[107]=m,e[108]=I):I=e[108],pe="goal-disclosure goal-advanced",e[109]===Symbol.for("react.memo_cache_sentinel")?(le=t.jsx("summary",{children:"Advanced"}),e[109]=le):le=e[109],X="goal-editor-settings";let Ue;e[110]===Symbol.for("react.memo_cache_sentinel")?(Ue=t.jsx("span",{children:"Title"}),e[110]=Ue):Ue=e[110];let Ne;e[111]!==i?(Ne=y=>o({...i,title:y.target.value}),e[111]=i,e[112]=Ne):Ne=e[112],e[113]!==a||e[114]!==i.title||e[115]!==Ne?(N=t.jsxs("label",{children:[Ue,t.jsx("input",{"aria-label":"Video title",value:i.title,disabled:a,maxLength:120,onChange:Ne})]}),e[113]=a,e[114]=i.title,e[115]=Ne,e[116]=N):N=e[116];let Me;e[117]===Symbol.for("react.memo_cache_sentinel")?(Me=t.jsx("span",{children:"Style"}),e[117]=Me):Me=e[117];const st=i.style.id;let J;e[118]!==i?(J=y=>{const T=y.target.value;o({...i,style:{id:T,options:xt(T)}})},e[118]=i,e[119]=J):J=e[119];let je;e[120]===Symbol.for("react.memo_cache_sentinel")?(je=Mt.map($s),e[120]=je):je=e[120];let he;e[121]!==a||e[122]!==i.style.id||e[123]!==J?(he=t.jsxs("label",{children:[Me,t.jsx("select",{"aria-label":"Style",value:st,disabled:a,onChange:J,children:je})]}),e[121]=a,e[122]=i.style.id,e[123]=J,e[124]=he):he=e[124];let Je;e[125]===Symbol.for("react.memo_cache_sentinel")?(Je=t.jsx("span",{children:"Format"}),e[125]=Je):Je=e[125];let De;e[126]!==i?(De=y=>o({...i,aspectRatio:y.target.value}),e[126]=i,e[127]=De):De=e[127];let Ee,He,Ze;e[128]===Symbol.for("react.memo_cache_sentinel")?(Ee=t.jsx("option",{value:"9:16",children:"Portrait · 9:16"}),He=t.jsx("option",{value:"16:9",children:"Landscape · 16:9"}),Ze=t.jsx("option",{value:"1:1",children:"Square · 1:1"}),e[128]=Ee,e[129]=He,e[130]=Ze):(Ee=e[128],He=e[129],Ze=e[130]);let lt;e[131]!==a||e[132]!==i.aspectRatio||e[133]!==De?(lt=t.jsxs("label",{children:[Je,t.jsxs("select",{"aria-label":"Format",value:i.aspectRatio,disabled:a,onChange:De,children:[Ee,He,Ze]})]}),e[131]=a,e[132]=i.aspectRatio,e[133]=De,e[134]=lt):lt=e[134];let Qe;e[135]===Symbol.for("react.memo_cache_sentinel")?(Qe=t.jsx("span",{children:"Image model"}),e[135]=Qe):Qe=e[135];let qe;e[136]!==i?(qe=y=>o({...i,imageModel:y.target.value}),e[136]=i,e[137]=qe):qe=e[137];let _e,et,nt;e[138]===Symbol.for("react.memo_cache_sentinel")?(_e=t.jsx("option",{value:"nano-banana-2-1",children:"Nano Banana 2.1"}),et=t.jsx("option",{value:"sunburst",children:"GPT Image 2.5 Sunburst"}),nt=t.jsx("option",{value:"flare",children:"GPT Image 2.5 Flare"}),e[138]=_e,e[139]=et,e[140]=nt):(_e=e[138],et=e[139],nt=e[140]);let at;e[141]!==a||e[142]!==i.imageModel||e[143]!==qe?(at=t.jsxs("label",{children:[Qe,t.jsxs("select",{"aria-label":"Image model",value:i.imageModel,disabled:a,onChange:qe,children:[_e,et,nt]})]}),e[141]=a,e[142]=i.imageModel,e[143]=qe,e[144]=at):at=e[144];let ot;e[145]===Symbol.for("react.memo_cache_sentinel")?(ot=t.jsx("span",{children:"Image resolution"}),e[145]=ot):ot=e[145];let tt;e[146]!==i?(tt=y=>o({...i,imageResolution:y.target.value}),e[146]=i,e[147]=tt):tt=e[147];let it,g;e[148]===Symbol.for("react.memo_cache_sentinel")?(it=t.jsx("option",{value:"1K",children:"1K"}),g=t.jsx("option",{value:"2K",children:"2K"}),e[148]=it,e[149]=g):(it=e[148],g=e[149]);let F;e[150]!==a||e[151]!==i.imageResolution||e[152]!==tt?(F=t.jsxs("label",{children:[ot,t.jsxs("select",{"aria-label":"Image resolution",value:i.imageResolution,disabled:a,onChange:tt,children:[it,g]})]}),e[150]=a,e[151]=i.imageResolution,e[152]=tt,e[153]=F):F=e[153];let fe;e[154]===Symbol.for("react.memo_cache_sentinel")?(fe=t.jsx("span",{children:"Video resolution"}),e[154]=fe):fe=e[154];let Ke;e[155]!==i?(Ke=y=>o({...i,videoResolution:y.target.value}),e[155]=i,e[156]=Ke):Ke=e[156];let rt,ze;e[157]===Symbol.for("react.memo_cache_sentinel")?(rt=t.jsx("option",{value:"480p",children:"480p"}),ze=t.jsx("option",{value:"720p",children:"720p"}),e[157]=rt,e[158]=ze):(rt=e[157],ze=e[158]);let mt;e[159]!==a||e[160]!==i.videoResolution||e[161]!==Ke?(mt=t.jsxs("label",{children:[fe,t.jsxs("select",{"aria-label":"Video resolution",value:i.videoResolution,disabled:a,onChange:Ke,children:[rt,ze]})]}),e[159]=a,e[160]=i.videoResolution,e[161]=Ke,e[162]=mt):mt=e[162];let gt;e[163]===Symbol.for("react.memo_cache_sentinel")?(gt=t.jsx("span",{children:"Ending frames"}),e[163]=gt):gt=e[163];const St=i.frameContinuity?"on":"off",Nt=a||!U;let pt;e[164]!==i?(pt=y=>o({...i,frameContinuity:y.target.value==="on"}),e[164]=i,e[165]=pt):pt=e[165];let bt,vt;e[166]===Symbol.for("react.memo_cache_sentinel")?(bt=t.jsx("option",{value:"off",children:"Off"}),vt=t.jsx("option",{value:"on",children:"Add ending references"}),e[166]=bt,e[167]=vt):(bt=e[166],vt=e[167]);let ut;e[168]!==St||e[169]!==Nt||e[170]!==pt?(ut=t.jsxs("label",{children:[gt,t.jsxs("select",{"aria-label":"Ending frames",value:St,disabled:Nt,onChange:pt,children:[bt,vt]})]}),e[168]=St,e[169]=Nt,e[170]=pt,e[171]=ut):ut=e[171],e[172]!==he||e[173]!==lt||e[174]!==at||e[175]!==F||e[176]!==mt||e[177]!==ut?(S=t.jsxs("div",{className:"goal-advanced-options",children:[he,lt,at,F,mt,ut]}),e[172]=he,e[173]=lt,e[174]=at,e[175]=F,e[176]=mt,e[177]=ut,e[178]=S):S=e[178],me=Ae.options.map(y=>t.jsxs("label",{children:[t.jsx("span",{children:y.label}),t.jsx("select",{"aria-label":y.label,value:i.style.options[y.key],disabled:a,onChange:T=>{const se={...i.style.options,[y.key]:T.target.value};y.key==="delivery"&&delete se.camera,o({...i,style:{id:Ae.id,options:xt(Ae.id,se)}})},children:y.choices.map(Rs)})]},y.key)),e[8]=a,e[9]=i,e[10]=s,e[11]=h,e[12]=G,e[13]=j,e[14]=f,e[15]=C,e[16]=c,e[17]=l,e[18]=r,e[19]=m,e[20]=E,e[21]=M,e[22]=L,e[23]=D,e[24]=b,e[25]=Y,e[26]=U,e[27]=O,e[28]=d,e[29]=p,e[30]=A,e[31]=R,e[32]=P,e[33]=B,e[34]=H,e[35]=z,e[36]=$,e[37]=W,e[38]=I,e[39]=X,e[40]=N,e[41]=S,e[42]=me,e[43]=pe,e[44]=le,e[45]=_,e[46]=Z}else E=e[20],M=e[21],L=e[22],D=e[23],b=e[24],Y=e[25],U=e[26],O=e[27],d=e[28],p=e[29],A=e[30],R=e[31],P=e[32],B=e[33],H=e[34],z=e[35],$=e[36],W=e[37],I=e[38],X=e[39],N=e[40],S=e[41],me=e[42],pe=e[43],le=e[44],_=e[45],Z=e[46];let ce;e[179]!==i?(ce=ie=>o({...i,continuity:ie}),e[179]=i,e[180]=ce):ce=e[180];let ge;e[181]!==a||e[182]!==i.continuity||e[183]!==ce?(ge=t.jsx(Ye,{label:"Continuity",value:i.continuity,budget:"continuity",disabled:a,onChange:ce}),e[181]=a,e[182]=i.continuity,e[183]=ce,e[184]=ge):ge=e[184];let re;e[185]!==a||e[186]!==U||e[187]!==p||e[188]!==r||e[189]!==_?(re=r.map((ie,de)=>t.jsxs("div",{className:"goal-editor-settings",children:[t.jsxs("label",{children:[t.jsxs("span",{children:["Clip ",de+1," duration"]}),t.jsx("input",{type:"number","aria-label":`Shot ${de+1} seconds`,min:4,max:30,value:ie.durationSeconds,disabled:a,onChange:q=>_(de,{durationSeconds:Number(q.target.value)})})]}),t.jsx(Ye,{label:`Clip ${de+1} storyboard`,value:ie.storyboardPrompt,budget:"storyboard",wordLimit:p.storyboardLayout==="six-panel"?48:void 0,disabled:a,onChange:q=>_(de,{storyboardPrompt:q})}),t.jsx(Ye,{label:`Clip ${de+1} motion and sound`,value:ie.videoPrompt,budget:"video",disabled:a,onChange:q=>_(de,{videoPrompt:q})}),U&&r.length>1&&t.jsxs("button",{type:"button",className:"goal-panel-button",disabled:a,onClick:()=>V(r.filter(q=>q.editorId!==ie.editorId)),children:["Remove clip ",de+1]})]},ie.editorId)),e[185]=a,e[186]=U,e[187]=p,e[188]=r,e[189]=_,e[190]=re):re=e[190];let ae;e[191]!==a||e[192]!==U||e[193]!==r?(ae=U&&t.jsx("button",{type:"button",className:"goal-panel-button",disabled:a||r.length>=8,onClick:()=>V([...r,{...r.at(-1),title:`Clip ${r.length+1}`,editorId:crypto.randomUUID()}]),children:"Add clip"}),e[191]=a,e[192]=U,e[193]=r,e[194]=ae):ae=e[194];let ne;e[195]!==ge||e[196]!==re||e[197]!==ae||e[198]!==X||e[199]!==N||e[200]!==S||e[201]!==me?(ne=t.jsxs("div",{className:X,children:[N,S,me,ge,re,ae]}),e[195]=ge,e[196]=re,e[197]=ae,e[198]=X,e[199]=N,e[200]=S,e[201]=me,e[202]=ne):ne=e[202];let oe;e[203]!==ne||e[204]!==pe||e[205]!==le?(oe=t.jsxs("details",{className:pe,children:[le,ne]}),e[203]=ne,e[204]=pe,e[205]=le,e[206]=oe):oe=e[206];const ye=D?"Changes will be saved before generation.":s.status==="completed"?"Choose any stage to revise it. Earlier versions stay available.":"Approves this stage only.";let te;e[207]!==ye?(te=t.jsx("span",{children:ye}),e[207]=ye,e[208]=te):te=e[208];let K;e[209]!==Z?(K=!Z&&t.jsx("span",{className:"goal-panel-warning",children:"Complete the prompts and choose a whole duration from 4 to 30 seconds."}),e[209]=Z,e[210]=K):K=e[210];let Q;e[211]!==A?(Q=A&&t.jsx("span",{className:"goal-panel-warning",children:"Save the plan to refresh cost estimates before generating."}),e[211]=A,e[212]=Q):Q=e[212];let ue;e[213]!==E||e[214]!==Y?(ue=Y?t.jsx("span",{role:"status",className:"goal-panel-warning",children:"Refresh the scene before continuing."}):E&&t.jsx("span",{role:"status",className:"goal-panel-warning",children:"Refresh the changed storyboard before generating video."}),e[213]=E,e[214]=Y,e[215]=ue):ue=e[215];let ee;e[216]!==b.warnings||e[217]!==s.status?(ee=s.status==="review"&&b.warnings.map(Is),e[216]=b.warnings,e[217]=s.status,e[218]=ee):ee=e[218];let Se;e[219]!==te||e[220]!==K||e[221]!==Q||e[222]!==ue||e[223]!==ee?(Se=t.jsxs("div",{className:"goal-panel-bar-copy",children:[te,K,Q,ue,ee]}),e[219]=te,e[220]=K,e[221]=Q,e[222]=ue,e[223]=ee,e[224]=Se):Se=e[224];let ke;e[225]!==D||e[226]!==a||e[227]!==v||e[228]!==p||e[229]!==Z?(ke=D&&t.jsx("button",{type:"button",className:"goal-panel-button",disabled:a||!Z,onClick:()=>v(p),children:"Save plan"}),e[225]=D,e[226]=a,e[227]=v,e[228]=p,e[229]=Z,e[230]=ke):ke=e[230];let xe;e[231]!==M||e[232]!==L||e[233]!==s.status||e[234]!==O||e[235]!==d||e[236]!==h||e[237]!==p?(xe=s.status==="review"&&t.jsxs("button",{type:"button",className:"goal-panel-primary",disabled:!M,onClick:()=>h(p),children:[O[d],L]}),e[231]=M,e[232]=L,e[233]=s.status,e[234]=O,e[235]=d,e[236]=h,e[237]=p,e[238]=xe):xe=e[238];let be;e[239]!==Se||e[240]!==ke||e[241]!==xe?(be=t.jsxs("div",{className:"goal-panel-bar",children:[Se,ke,xe]}),e[239]=Se,e[240]=ke,e[241]=xe,e[242]=be):be=e[242];let ve;return e[243]!==R||e[244]!==P||e[245]!==B||e[246]!==H||e[247]!==z||e[248]!==$||e[249]!==W||e[250]!==I||e[251]!==oe||e[252]!==be?(ve=t.jsxs("div",{className:R,"data-review":P,onKeyDown:B,children:[H,z,$,W,I,oe,be]}),e[243]=R,e[244]=P,e[245]=B,e[246]=H,e[247]=z,e[248]=$,e[249]=W,e[250]=I,e[251]=oe,e[252]=be,e[253]=ve):ve=e[253],ve}function Is(n){return t.jsx("span",{children:n},n)}function Rs(n){return t.jsx("option",{value:n.value,children:n.label},n.value)}function $s(n){return t.jsx("option",{value:n,children:ft(n).label},n)}function ws(n){return n.stale}function Ps(n){return n.title.trim()&&n.storyboardPrompt.trim()&&n.videoPrompt.trim()&&Number.isInteger(n.durationSeconds)&&n.durationSeconds>=4&&n.durationSeconds<=30}function ks(n){const{editorId:e,...s}=n;return s}function Gs(n){return{...n,editorId:crypto.randomUUID()}}function Ls(n,e){n.key!=="Enter"||!(n.metaKey||n.ctrlKey)||n.nativeEvent.isComposing||(n.preventDefault(),e())}function Os(n){const e=Xe.c(26),{shot:s,onSelectCell:l}=n,a=Rt(s.state==="generating"?s.startedAt:null);let v;e[0]!==a||e[1]!==s.state?(v=s.state==="generating"&&a!==null?`Generating ${Gt(a)}`:es(s.state),e[0]=a,e[1]=s.state,e[2]=v):v=e[2];const h=v;let j;e[3]!==s.number?(j=t.jsx("span",{className:"goal-progress-number",children:s.number}),e[3]=s.number,e[4]=j):j=e[4];let f;e[5]!==s.prompt||e[6]!==s.title?(f=t.jsx("span",{className:"goal-progress-title",title:s.prompt,children:s.title}),e[5]=s.prompt,e[6]=s.title,e[7]=f):f=e[7];const C=s.seconds>0?`${s.seconds}s`:"Image";let c;e[8]!==C?(c=t.jsx("span",{className:"goal-progress-seconds",children:C}),e[8]=C,e[9]=c):c=e[9];let G;e[10]!==l||e[11]!==s.address||e[12]!==s.cellId?(G=s.cellId&&s.address?t.jsx("button",{type:"button",className:"goal-progress-address",onClick:()=>l(s.cellId),children:s.address}):t.jsx("span",{"aria-hidden":"true",children:"—"}),e[10]=l,e[11]=s.address,e[12]=s.cellId,e[13]=G):G=e[13];let x;e[14]!==h?(x=t.jsx("span",{className:"goal-progress-state",children:h}),e[14]=h,e[15]=x):x=e[15];let i;e[16]!==s.error?(i=s.error&&t.jsx("span",{className:"goal-progress-error",children:s.error}),e[16]=s.error,e[17]=i):i=e[17];let o;return e[18]!==s.state||e[19]!==j||e[20]!==f||e[21]!==c||e[22]!==G||e[23]!==x||e[24]!==i?(o=t.jsxs("li",{className:"goal-progress-shot","data-state":s.state,children:[j,f,c,G,x,i]}),e[18]=s.state,e[19]=j,e[20]=f,e[21]=c,e[22]=G,e[23]=x,e[24]=i,e[25]=o):o=e[25],o}function As(n){const e=Xe.c(9),{goal:s}=n;let l;e[0]!==s.plan?(l=ht(s.plan)&&s.plan.storyboardLayout==="six-panel",e[0]=s.plan,e[1]=l):l=e[1];const a=l,v=a?s.stage==="frame"?0:s.stage==="storyboards"?1:2:s.status==="planning"?0:s.stage==="frame"?1:s.stage==="storyboards"?2:s.stage==="videos"?3:4;let h;e[2]!==s.plan||e[3]!==a?(h=a?["Scene","Storyboard","Video"]:["Plan","Full frame","Storyboards","Videos",...At(s.plan).length===1?[]:["Combine"]],e[2]=s.plan,e[3]=a,e[4]=h):h=e[4];const j=h;let f;return e[5]!==v||e[6]!==s.status||e[7]!==j?(f=t.jsx("ol",{className:"goal-stepper","aria-label":"Goal stages",children:j.map((C,c)=>t.jsx("li",{"data-state":s.status==="completed"||c<v?"done":c===v?"current":"pending","aria-current":c===v?"step":void 0,children:C},C))}),e[5]=v,e[6]=s.status,e[7]=j,e[8]=f):f=e[8],f}function Bs({goal:n,connected:e,onAction:s,onPreview:l,onSelectCell:a,onPreviewCell:v,resolveAsset:h}){const[j,f]=Ie.useState(!1),C=Ie.useRef(!1),[c,G]=Ie.useState(null),x=Lt(n),i=Ot(n),o=It(n,n.plan,void 0),w=n.plan&&"version"in n.plan&&n.plan.version===3?n.plan:null,r=j||!e,V=ht(n.plan)&&(n.plan.storyboardLayout==="six-panel"||n.status==="completed")&&["review","completed","failed","interrupted"].includes(n.status),u=async d=>{if(!(!e||C.current)){C.current=!0,f(!0),G(null);try{await d()}catch(p){G(p instanceof Error?p.message:String(p))}finally{C.current=!1,f(!1)}}},m=d=>{u(()=>s({...d,goal_id:n.goalId}))},k=(d,p,A,R,P)=>{u(async()=>{const B=ht(n.plan)&&!$t(p,n.plan)?await s({action:"update",goal_id:n.goalId,revision:n.revision,plan:p}):n;d!=="update"&&await s({action:d,goal_id:n.goalId,revision:B.revision,...A?{stage:A,index:R}:{},...P?{feedback:P}:{}})})},E=n.status==="planning"||n.status==="running",M=["completed","failed","interrupted","cancelled"].includes(n.status),L=n.status==="completed",D=Et(n),b=n.steps.filter(d=>d.id!=="assemble"&&d.status!=="completed").map(d=>Ut(n,x.stage,x.stage==="frame"?0:Number(/\d+$/u.exec(d.id)?.[0])-1)),Y=n.chainId===null||b.some(d=>d===null)?" · estimate unavailable":` · $${b.reduce((d,p)=>d+(p??0),0).toFixed(2)}`,U=L?n.assembly?"Preview sequence":"Open clip":D?`Retry ${n.chainId===null?"planning":x.stage==="frame"?"frame":x.stage}${Y}`:null,O=()=>{if(!r){if(L&&n.assembly){u(()=>l(n.assembly.startFrame));return}if(L){const d=n.stages.videos?.outputs[0]?.cellId??n.steps.find(p=>p.outputCellId)?.outputCellId;d&&v(d);return}m({action:"retry"})}};return t.jsxs("div",{className:"composer-notebook-dock inspector goal-panel","data-tone":i.tone,children:[t.jsxs("header",{children:[t.jsxs("span",{className:"inspector-cell-title goal-panel-title",children:[t.jsx(jt,{size:14,className:"goal-panel-flag"}),t.jsx("strong",{children:"GOAL"}),n.address&&t.jsx("code",{className:"inspector-cell-address",children:n.address}),t.jsx("span",{className:"goal-panel-name",title:o.title,children:o.title}),t.jsx("span",{className:"goal-tile-chip","data-tone":o.chip.tone,children:o.chip.label})]}),t.jsxs("div",{className:"inspector-header-actions",children:[t.jsxs("div",{className:"inspector-generation-header-actions",children:[x.phase==="review"&&t.jsx("button",{type:"button",disabled:r,onClick:()=>m({action:"cancel"}),children:w&&n.finish?.status==="running"?"Stop finishing":"Discard goal"}),E&&t.jsx("button",{type:"button",disabled:r,onClick:()=>m({action:"cancel"}),children:Qt(n)}),M&&t.jsx("button",{type:"button",disabled:r||!!n.dismissedAt,onClick:()=>m({action:"dismiss"}),children:"Dismiss"})]}),t.jsx(Tt,{})]})]}),t.jsxs("div",{className:"goal-panel-body",children:[n.planVersion===2&&!V&&t.jsx(As,{goal:n}),w&&n.status!=="planning"&&t.jsx(Ss,{goal:n,plan:w,disabled:r,resolveAsset:h,onPreviewCell:v,onRun:d=>{u(d)},onAction:d=>s({...d,goal_id:n.goalId})},`${n.goalId}:${n.revision}`),!e&&t.jsx("p",{role:"status",className:"goal-panel-muted",children:"Reconnecting. Your goal is saved; generation continues on the server."}),c&&t.jsx("p",{role:"alert",className:"goal-panel-error",children:c}),n.error&&(x.phase==="failed"||x.phase==="interrupted")&&t.jsx("p",{role:"alert",className:"goal-panel-error",children:n.error}),n.combined?.error&&t.jsx("p",{role:"alert",className:"goal-panel-error",children:n.combined.error}),x.phase==="planning"&&t.jsxs("div",{className:"goal-panel-planning",children:[t.jsx("p",{className:"goal-panel-brief",children:n.brief}),t.jsx("p",{className:"goal-panel-muted",children:o.styleLabel==="Match source"?"Planning the scene, storyboard and video from your references…":o.styleLabel?`Planning ${o.styleLabel==="IG Influencer"?"an":"a"} ${o.styleLabel} sequence…`:"Planning the scene, storyboard and video from your reference images…"}),t.jsxs("span",{className:"goal-tile-placeholder","aria-hidden":"true",children:[t.jsx("i",{}),t.jsx("i",{}),t.jsx("i",{})]})]}),V&&ht(n.plan)&&t.jsx(Cs,{goal:n,plan:n.plan,disabled:r,resolveAsset:h,onPreviewCell:v,onSave:d=>k("update",d),onApprove:d=>k("approve",d),onRegenerate:(d,p,A)=>k("regenerate",d,p,A),onRevise:(d,p,A,R)=>k("revise",d,p,A,R),onSelect:(d,p,A)=>m({action:"select",revision:n.revision,stage:d,index:p,artifact_id:A})},`${n.goalId}:${n.revision}:${n.stage}`),!V&&x.phase==="review"&&ht(n.plan)&&t.jsx(fs,{goal:n,plan:n.plan,disabled:r,resolveAsset:h,onSelectCell:a,onPreviewCell:v,onSave:d=>k("update",d),onApprove:d=>k("approve",d),onRegenerate:(d,p,A)=>k("regenerate",d,p,A),onRevise:(d,p,A,R)=>k("revise",d,p,A,R),onSelect:(d,p,A)=>m({action:"select",stage:d,index:p,artifact_id:A})},`${n.goalId}:${n.revision}:${n.stage}`),!w&&x.phase!=="planning"&&x.phase!=="review"&&(!V||D)&&t.jsxs("div",{onKeyDown:d=>Ls(d,O),children:[t.jsxs("div",{className:"goal-progress-summary",children:[t.jsx("progress",{max:Math.max(1,x.total),value:L?x.total:x.done,"aria-label":"Completed stage outputs"}),t.jsxs("span",{children:[x.done," of ",x.total," ready · ",_t(x.stage)]})]}),t.jsx("ol",{className:"goal-progress-list",children:x.shots.map(d=>t.jsx(Os,{shot:d,onSelectCell:a},d.index))}),t.jsxs("div",{className:"goal-panel-bar",children:[t.jsx("div",{className:"goal-panel-bar-copy",children:t.jsx("span",{children:L?n.assembly?"Clips were appended in order to the timeline.":"Your clip is ready in the notebook.":n.status==="cancelled"?"Remaining work is stopped. Requests already submitted may still finish.":"Outputs appear in the notebook as they finish. You can collapse this panel."})}),U&&t.jsx("button",{type:"button",className:"goal-panel-primary",disabled:r,onClick:O,children:U})]})]}),L&&n.assemblyStale&&t.jsxs("div",{className:"goal-panel-bar",children:[t.jsx("span",{className:"goal-panel-bar-copy",children:"The timeline uses earlier video versions."}),t.jsx("button",{type:"button",className:"goal-panel-button",disabled:r,onClick:()=>m({action:"assemble"}),children:"Assemble selected versions"})]}),L&&n.assembly&&!n.assemblyStale&&n.planVersion===2&&t.jsxs("div",{className:"goal-panel-bar",children:[t.jsx("span",{className:"goal-panel-bar-copy",children:"Create one video with all clips and their sound. Rendered locally."}),n.combined?.status==="completed"?t.jsx("button",{type:"button",className:"goal-panel-button",onClick:()=>v(n.combined.cellId),children:"Open combined video"}):t.jsx("button",{type:"button",className:"goal-panel-button",disabled:r||n.combined?.status==="running",onClick:()=>m({action:"combine"}),children:n.combined?.status==="running"?"Combining clips…":n.combined?.status==="failed"?"Retry combining clips":"Combine into one video"})]})]})]})}function Hs(){const n=Xe.c(3);let e;n[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("span",{className:"inspector-cell-title goal-panel-title",children:[t.jsx(jt,{size:14,className:"goal-panel-flag"}),t.jsx("strong",{children:"GOAL"})]}),n[0]=e):e=n[0];let s;n[1]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("header",{children:[e,t.jsx("div",{className:"inspector-header-actions",children:t.jsx(Tt,{})})]}),n[1]=s):s=n[1];let l;return n[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsxs("div",{className:"composer-notebook-dock inspector goal-panel",children:[s,t.jsx("div",{className:"goal-panel-body",children:t.jsx("p",{role:"status",className:"goal-panel-muted",children:"Loading the goal…"})})]}),n[2]=l):l=n[2],l}export{Bs as G,Hs as a,Ds as b,Ks as c};