shotops-mcp 0.9.9 → 0.10.0

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.
@@ -0,0 +1,282 @@
1
+ "use strict";(()=>{var R="shotops/widgetPayload";var S=`
2
+ :root {
3
+ color-scheme: light dark;
4
+ --sf-ink: #15151a;
5
+ --sf-muted: #6c6b76;
6
+ --sf-soft: #f1f0f4;
7
+ --sf-surface: rgba(255, 255, 255, 0.72);
8
+ --sf-line: rgba(24, 22, 31, 0.12);
9
+ --sf-accent: #7657dc;
10
+ --sf-accent-ink: #fff;
11
+ --sf-shadow: 0 18px 44px rgba(26, 19, 46, 0.14);
12
+ }
13
+ @media (prefers-color-scheme: dark) {
14
+ :root {
15
+ --sf-ink: #f4f2f7;
16
+ --sf-muted: #aaa7b3;
17
+ --sf-soft: #24222a;
18
+ --sf-surface: rgba(26, 24, 31, 0.78);
19
+ --sf-line: rgba(255, 255, 255, 0.12);
20
+ --sf-accent: #a58bf2;
21
+ --sf-accent-ink: #17131f;
22
+ --sf-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
23
+ }
24
+ }
25
+ * { box-sizing: border-box; }
26
+ html, body { margin: 0; min-width: 0; background: transparent; }
27
+ button, a { font: inherit; }
28
+ .sf-root {
29
+ color: var(--sf-ink);
30
+ padding: 14px;
31
+ font: 14px/1.42 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
32
+ }
33
+ .sf-shell {
34
+ overflow: hidden;
35
+ border: 1px solid var(--sf-line);
36
+ border-radius: 18px;
37
+ background: var(--sf-surface);
38
+ box-shadow: var(--sf-shadow);
39
+ }
40
+ .sf-head {
41
+ display: flex;
42
+ align-items: flex-start;
43
+ justify-content: space-between;
44
+ gap: 14px;
45
+ padding: 16px 16px 13px;
46
+ border-bottom: 1px solid var(--sf-line);
47
+ }
48
+ .sf-eyebrow {
49
+ margin: 0 0 3px;
50
+ color: var(--sf-muted);
51
+ font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
52
+ letter-spacing: .13em;
53
+ text-transform: uppercase;
54
+ }
55
+ .sf-title { margin: 0; font-size: 17px; line-height: 1.25; letter-spacing: -.025em; }
56
+ .sf-sub { margin: 4px 0 0; color: var(--sf-muted); font-size: 12px; }
57
+ .sf-badge {
58
+ flex: 0 0 auto;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ gap: 6px;
62
+ min-height: 26px;
63
+ padding: 5px 9px;
64
+ border-radius: 999px;
65
+ background: var(--sf-soft);
66
+ color: var(--sf-muted);
67
+ font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
68
+ letter-spacing: .04em;
69
+ text-transform: uppercase;
70
+ }
71
+ .sf-dot { width: 6px; height: 6px; border-radius: 50%; background: #51ad76; box-shadow: 0 0 0 3px rgba(81,173,118,.14); }
72
+ .sf-download, .sf-open {
73
+ border: 0;
74
+ border-radius: 9px;
75
+ cursor: pointer;
76
+ text-decoration: none;
77
+ transition: transform 140ms ease, opacity 140ms ease;
78
+ }
79
+ .sf-download {
80
+ padding: 6px 8px;
81
+ background: var(--sf-soft);
82
+ color: var(--sf-ink);
83
+ font-size: 11px;
84
+ font-weight: 650;
85
+ }
86
+ .sf-download:hover, .sf-open:hover { transform: translateY(-1px); }
87
+ .sf-download:focus-visible, .sf-open:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
88
+ .sf-meta {
89
+ display: flex;
90
+ flex-wrap: wrap;
91
+ gap: 8px 16px;
92
+ padding: 12px 16px 14px;
93
+ border-top: 1px solid var(--sf-line);
94
+ }
95
+ .sf-stat { min-width: 70px; }
96
+ .sf-k { color: var(--sf-muted); font: 500 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .06em; }
97
+ .sf-v { margin-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
98
+ .sf-actions { margin-left: auto; align-self: center; }
99
+ .sf-open {
100
+ display: inline-flex;
101
+ align-items: center;
102
+ min-height: 34px;
103
+ padding: 8px 11px;
104
+ background: var(--sf-accent);
105
+ color: var(--sf-accent-ink);
106
+ font-size: 12px;
107
+ font-weight: 700;
108
+ }
109
+ .sf-note {
110
+ margin: 0;
111
+ padding: 11px 16px;
112
+ border-top: 1px solid var(--sf-line);
113
+ color: var(--sf-muted);
114
+ font-size: 11px;
115
+ }
116
+ .sf-empty { padding: 18px 16px; color: var(--sf-muted); }
117
+ @media (max-width: 440px) {
118
+ .sf-root { padding: 8px; }
119
+ .sf-head { padding: 14px; }
120
+ .sf-meta { padding-inline: 14px; }
121
+ .sf-actions { width: 100%; margin-left: 0; }
122
+ .sf-open { justify-content: center; width: 100%; }
123
+ }
124
+ @media (prefers-reduced-motion: reduce) {
125
+ .sf-download, .sf-open { transition: none; }
126
+ }
127
+ `;function r(n,e,o){let t=document.createElement(n);return e&&(t.className=e),o!==void 0&&(t.textContent=o),t}function u(n,e,o){let t=r("div","sf-stat");t.append(r("div","sf-k",e),r("div","sf-v",o)),n.append(t)}var te="2026-01-26",oe="shotops-widget",re=4e3;function A(){return typeof window.openai<"u"}function z(){return window.parent!==window}var se=1,L=new Map;window.addEventListener("message",n=>{if(n.source!==window.parent)return;let e=n.data;if(!e||e.jsonrpc!=="2.0"||e.method||typeof e.id!="number")return;let o=L.get(e.id);o&&(L.delete(e.id),e.error?o.reject(new Error(e.error?.message??"MCP Apps request failed")):o.resolve(e.result))},{passive:!0});function D(n,e){let o=se++;return new Promise((t,s)=>{L.set(o,{resolve:t,reject:s}),window.parent.postMessage({jsonrpc:"2.0",id:o,method:n,params:e},"*")})}function W(n,e){window.parent.postMessage({jsonrpc:"2.0",method:n,params:e},"*")}var C=null;function I(){if(A()||!z())return Promise.resolve();if(!C){let n=D("ui/initialize",{capabilities:{},clientInfo:{name:oe,version:"1.0.0"},protocolVersion:te,appCapabilities:{availableDisplayModes:["inline"]}});C=new Promise(e=>{let o=setTimeout(e,re);n.then(()=>{clearTimeout(o),e()},()=>{clearTimeout(o),e()})}).then(()=>{W("ui/notifications/initialized",{}),ie()})}return C}var H="";function F(){let n=Math.ceil(document.documentElement.clientWidth||0),e=Math.ceil(document.body?.getBoundingClientRect().height??0),o=`${n}x${e}`;o!==H&&(H=o,W("ui/notifications/size-changed",{width:n,height:e}))}function ie(){if(typeof ResizeObserver>"u"||!document.body)return;let n=0;new ResizeObserver(()=>{n||(n=requestAnimationFrame(()=>{n=0,F()}))}).observe(document.body)}function ae(){return!!window.openai?.openExternal||!A()&&z()}function O(){if(window.openai?.notifyIntrinsicHeight){window.openai.notifyIntrinsicHeight();return}A()||!z()||I().then(F)}async function U(n){if(window.openai?.openExternal){await window.openai.openExternal({href:n});return}if(!A()&&z())try{await I(),await D("ui/open-link",{url:n});return}catch{}window.open(n,"_blank","noopener,noreferrer")}function T(n,e,o,t){let s=e;try{let p=new URL(e);/\/storage\/v1\/object\/sign\//.test(p.pathname)&&(p.searchParams.set("download",o),s=p.toString())}catch{}let i=r("a",t,n);return i.href=s,i.download=o,i.rel="noopener noreferrer",/^https?:/i.test(e)?(i.target="_blank",i.addEventListener("click",p=>{ae()&&(p.preventDefault(),U(s))}),i):(!A()&&z()&&(i.style.display="none"),i)}function E(n,e,o){let t=r("button",o,n);return t.type="button",t.addEventListener("click",()=>{U(e)}),t}function b(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function pe(n){if(!Array.isArray(n.content))return null;let e=[];for(let o of n.content){let t=b(o);if(!t)continue;if(t.type==="image"&&typeof t.data=="string"&&t.mimeType==="image/png"){e.push(t.data);continue}if(t.type==="resource_link"&&typeof t.uri=="string"&&t.mimeType==="image/png"){e.push({url:t.uri});continue}let s=b(t.resource);t.type==="resource"&&s&&typeof s.uri=="string"&&s.mimeType==="image/png"&&e.push({url:s.uri})}if(e.length>0)return{ok:!0,count:e.length,output:typeof e[0]=="string"?"inline":"urls",panels:e};if(n.isError===!0){let o=n.content.map(t=>b(t)).find(t=>t?.type==="text"&&typeof t.text=="string")?.text;return{ok:!1,...typeof o=="string"?{note:o}:{}}}return null}function q(n,e=0){let o=b(n);if(!o||e>6)return null;let t=b(o[R]);if(t)return t;let s=b(o._meta),i=b(s?.[R]);if(i)return i;for(let p of["mcp_tool_result","call_tool_result","tool_result","result"]){let x=q(o[p],e+1);if(x)return x}return null}function $(n,e=!0,o=0){let t=b(n);if(!t||o>6)return e?n:null;for(let i of["structuredContent","structured_content"]){let p=b(t[i]);if(p)return p}for(let i of["mcp_tool_result","call_tool_result","tool_result","result"]){if(t[i]===void 0)continue;let p=$(t[i],!1,o+1);if(p)return p}let s=pe(t);return s||(e?n:null)}function Y(n,e=0){let o=b(n);if(!o||e>6)return null;let t=typeof o.status=="string"?o.status.toLowerCase():"";if(["failed","failure","error","cancelled","canceled"].includes(t))return"failure";if(["complete","completed","success","succeeded"].includes(t))return"success";for(let s of["mcp_tool_result","call_tool_result","tool_result","result"]){let i=Y(o[s],e+1);if(i)return i}return null}function le(n){let e=b(n.detail);return b(e?.globals)}function de(n){return q(n)??$(n,!1)}function ue(n){if(!n||typeof n!="object")return n;let e=n;return e.structuredContent&&typeof e.structuredContent=="object"?e.structuredContent:$(n)}function G(n){I();let e=document.createElement("style");e.textContent=n.css;let o=r("div","sf-root");o.id=n.rootId,o.append(r("div","sf-empty",n.loading)),document.body.append(e,o);let t=!1,s=l=>{let a=ue(l);!a||typeof a!="object"||n.accept&&!n.accept(a)||(t=!0,n.render(o,a))},i=l=>s(de(l));window.addEventListener("message",l=>{if(l.source!==window.parent)return;let a=l.data;!a||a.jsonrpc!=="2.0"||a.method!=="ui/notifications/tool-result"||(s(a.params?.structuredContent),t||i(a.params))},{passive:!0}),window.addEventListener("openai:set_globals",l=>{let a=le(l);a&&(s(a.toolOutput),t||i(a.toolResponseMetadata))},{passive:!0});let p=100,x=500,w=2e3,g=5*6e4,y=2e3,d=0,m=null,c=!1,h=()=>{if(typeof window>"u"||(s(window.openai?.toolOutput),t||i(window.openai?.toolResponseMetadata),t))return;let l=Y(window.openai?.toolResponseMetadata);if(l&&m===null&&(m=d),l&&!c&&(l==="failure"||d-(m??d)>=y)&&(c=!0,o.replaceChildren(r("div","sf-empty",n.terminal??n.empty))),d>=g){c||o.replaceChildren(r("div","sf-empty",n.terminal??n.empty));return}let a=d<w?p:x;d+=a,setTimeout(h,a)};h()}function ce(n){return n<1024?`${n} B`:n<1024*1024?`${Math.round(n/1024)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function M(n){if(typeof n.zipBase64=="string"&&n.zipBase64.length>0){let e=n.zipBase64.endsWith("==")?2:n.zipBase64.endsWith("=")?1:0;return{href:`data:application/zip;base64,${n.zipBase64}`,size:ce(Math.max(0,n.zipBase64.length*3/4-e))}}return typeof n.zipUrl=="string"&&n.zipUrl.length>0?{href:n.zipUrl,size:null}:null}function K(n){if(!n)return"Anyone with the link can download it. Links last 14 days.";let e=new Date(n);if(Number.isNaN(e.getTime()))return"Anyone with the link can download it. Links last 14 days.";let o=e.toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"}),t=Math.ceil((e.getTime()-Date.now())/864e5);return t<=0?`This link has expired (${o}). Emit the bundle again for a fresh one.`:`Anyone with the link can download it. Expires ${o} \u2014 ${t} day${t===1?"":"s"} from now.`}function V(n){let e=n.length>0?n:["en-US"],o=["fastlane/"],t=e.slice(0,3);return t.forEach(s=>{o.push(` screenshots/${s}/ the PNGs, named in strip order`)}),e.length>t.length&&o.push(` screenshots/\u2026 +${e.length-t.length} more locale folder(s)`),o.push(" Deliverfile pre-filled, ready to run"),o.push("README.md how to upload with your own key"),o.join(`
128
+ `)}function _(n){if(!n.operationId||!n.status)return null;let e=n.progress,o=typeof e?.panelsTotal=="number"&&e.panelsTotal>0,t=Math.max(0,Number((o?e?.panelsCompleted:e?.completed)??0)),s=Math.max(t,Number((o?e?.panelsTotal:e?.total)??0)),i={accepted:["Production accepted","ShotOps is preparing the durable render.","Accepted",!1],queued:["Production queued","The render is safely queued and can outlive this conversation.","Queued",!1],running:["Production rendering","ShotOps is rendering and checkpointing the final assets.","Running",!1],cancel_requested:["Cancellation requested","Work already in flight will stop at the next safe checkpoint.","Cancelling",!1],failed:["Production could not finish","The operation stopped without returning a partial asset set.","Failed",!0],cancelled:["Production cancelled","Unfinished work stopped and the remaining reservation was released.","Cancelled",!0],succeeded:["Production finished","The durable operation succeeded; request its result for fresh download links.","Succeeded",!0]},[p,x,w,g]=i[n.status];return{title:p,detail:x,badge:w,terminal:g,completed:t,total:s}}var Z=`${S}
129
+ .sf-body { padding: 15px 16px 4px; }
130
+ .sf-zip {
131
+ display: flex;
132
+ align-items: center;
133
+ gap: 13px;
134
+ padding: 13px;
135
+ border: 1px solid var(--sf-line);
136
+ border-radius: 13px;
137
+ background: var(--sf-soft);
138
+ }
139
+ .sf-zip-icon {
140
+ flex: 0 0 auto;
141
+ display: grid;
142
+ place-content: center;
143
+ width: 38px;
144
+ height: 38px;
145
+ border-radius: 10px;
146
+ background: var(--sf-accent);
147
+ color: var(--sf-accent-ink);
148
+ font: 700 15px/1 ui-sans-serif, system-ui, sans-serif;
149
+ }
150
+ .sf-zip-text { min-width: 0; flex: 1 1 auto; }
151
+ .sf-zip-name {
152
+ overflow: hidden;
153
+ text-overflow: ellipsis;
154
+ white-space: nowrap;
155
+ font: 650 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
156
+ }
157
+ .sf-zip-sub { margin-top: 2px; color: var(--sf-muted); font-size: 11px; }
158
+ .sf-get {
159
+ flex: 0 0 auto;
160
+ display: inline-flex;
161
+ align-items: center;
162
+ min-height: 36px;
163
+ padding: 9px 13px;
164
+ border: 0;
165
+ border-radius: 9px;
166
+ background: var(--sf-accent);
167
+ color: var(--sf-accent-ink);
168
+ font-size: 12px;
169
+ font-weight: 700;
170
+ text-decoration: none;
171
+ cursor: pointer;
172
+ transition: transform 140ms ease;
173
+ }
174
+ .sf-get:hover { transform: translateY(-1px); }
175
+ .sf-get:focus-visible { outline: 2px solid var(--sf-accent); outline-offset: 2px; }
176
+ .sf-inside { margin: 14px 0 0; }
177
+ .sf-inside-k {
178
+ margin: 0 0 7px;
179
+ color: var(--sf-muted);
180
+ font: 500 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
181
+ text-transform: uppercase;
182
+ letter-spacing: .06em;
183
+ }
184
+ .sf-tree {
185
+ margin: 0;
186
+ padding: 11px 13px;
187
+ border: 1px solid var(--sf-line);
188
+ border-radius: 11px;
189
+ overflow-x: auto;
190
+ color: var(--sf-muted);
191
+ font: 11px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace;
192
+ white-space: pre;
193
+ }
194
+ .sf-share {
195
+ display: flex;
196
+ align-items: center;
197
+ gap: 10px;
198
+ margin-top: 12px;
199
+ padding: 11px 13px;
200
+ border: 1px dashed var(--sf-line);
201
+ border-radius: 11px;
202
+ }
203
+ .sf-share-text { min-width: 0; flex: 1 1 auto; font-size: 12px; }
204
+ .sf-share-sub { margin-top: 2px; color: var(--sf-muted); font-size: 11px; }
205
+ .sf-custody {
206
+ margin: 0;
207
+ padding: 12px 16px 14px;
208
+ color: var(--sf-muted);
209
+ font-size: 11px;
210
+ line-height: 1.5;
211
+ }
212
+ @media (max-width: 440px) {
213
+ .sf-body { padding-inline: 14px; }
214
+ .sf-zip, .sf-share { flex-wrap: wrap; }
215
+ .sf-get { width: 100%; justify-content: center; }
216
+ .sf-custody { padding-inline: 14px; }
217
+ }
218
+ @media (prefers-reduced-motion: reduce) {
219
+ .sf-get { transition: none; }
220
+ }
221
+ `,fe="You upload this yourself. ShotOps never holds your Apple credentials, never creates an App Store version, and never submits anything for review.";function ge(n,e){return T("Download .zip",n.href,e,"sf-get")}function Q(n,e){n.replaceChildren();let o=_(e);if(o&&!M(e)){let f=r("section","sf-shell"),k=r("header","sf-head"),N=r("div");N.append(r("p","sf-eyebrow","ShotOps / durable production"),r("h2","sf-title",o.title),r("p","sf-sub",o.detail));let j=r("span","sf-badge");j.append(r("span","sf-dot"),document.createTextNode(o.badge)),k.append(N,j),f.append(k);let P=r("footer","sf-meta");u(P,"Progress",o.total>0?`${o.completed}/${o.total}`:"Waiting"),typeof e.progress?.attempt=="number"&&u(P,"Attempt",String(e.progress.attempt)),typeof e.contract?.cost?.reserved=="number"&&u(P,"Reserved",String(e.contract.cost.reserved)),typeof e.contract?.cost?.released=="number"&&u(P,"Released",String(e.contract.cost.released)),f.append(P,r("p","sf-note",`Operation ${e.operationId}. Reconnect with production_operation.`)),n.append(f),O();return}let t=Array.isArray(e.locales)&&e.locales.length>0?e.locales:e.locale?[e.locale]:[],s=typeof e.panelCount=="number"?e.panelCount:0,i=typeof e.totalPanelCount=="number"?e.totalPanelCount:s*Math.max(1,t.length),p=r("section","sf-shell"),x=r("header","sf-head"),w=r("div");w.append(r("p","sf-eyebrow","ShotOps"),r("h2","sf-title","Your screenshot bundle is ready"),r("p","sf-sub",t.length>1?`${i} screenshots across ${t.length} locales, laid out the way fastlane deliver expects.`:"Laid out the way fastlane deliver expects \u2014 download it and upload with your own key."));let g=r("span","sf-badge");g.append(r("span","sf-dot"),document.createTextNode(e.output==="urls"?"Download link":"Inline zip")),x.append(w,g),p.append(x);let y=r("div","sf-body"),d=M(e),m=r("div","sf-zip");m.append(r("div","sf-zip-icon","ZIP"));let c=r("div","sf-zip-text");c.append(r("div","sf-zip-name",e.filename??"fastlane-bundle.zip"));let h=d?.size?` \xB7 ${d.size}`:"";c.append(r("div","sf-zip-sub",i>0?`${i} screenshot${i===1?"":"s"}${h}`:`Bundle${h}`)),m.append(c),d&&m.append(ge(d,e.filename??"fastlane-bundle.zip")),y.append(m);let l=r("div","sf-inside");if(l.append(r("p","sf-inside-k","What's inside")),l.append(r("pre","sf-tree",V(t))),y.append(l),e.shareLink?.url){let f=r("div","sf-share"),k=r("div","sf-share-text");k.append(document.createTextNode("Share link")),k.append(r("div","sf-share-sub",K(e.shareLink.expiresAt))),f.append(k,E("Open \u2197",e.shareLink.url,"sf-open")),y.append(f)}p.append(y);let a=r("footer","sf-meta");if(e.bundleId&&u(a,"Bundle ID",e.bundleId),t.length>0&&u(a,t.length===1?"Locale":"Locales",t.join(", ")),Array.isArray(e.outputs)&&e.outputs.length>0&&u(a,"Devices",e.outputs.join(", ")),s>0&&t.length>1&&u(a,"Per locale",String(s)),e.openUrl){let f=r("div","sf-actions");f.append(E("Open in ShotOps \u2197",e.openUrl,"sf-open")),a.append(f)}a.childElementCount>0&&p.append(a);let v=[e.note,e.projectNote].filter(Boolean).join(" ");v&&p.append(r("p","sf-note",v)),p.append(r("p","sf-custody",fe)),n.append(p),O()}var J=`${S}
222
+ .sf-rail {
223
+ display: grid;
224
+ grid-auto-flow: column;
225
+ grid-auto-columns: clamp(142px, 38vw, 210px);
226
+ gap: 12px;
227
+ overflow-x: auto;
228
+ padding: 15px 16px 18px;
229
+ scroll-snap-type: x proximity;
230
+ scrollbar-width: thin;
231
+ scrollbar-color: var(--sf-line) transparent;
232
+ }
233
+ .sf-panel { min-width: 0; scroll-snap-align: start; }
234
+ .sf-frame {
235
+ position: relative;
236
+ aspect-ratio: var(--sf-ratio, 1320 / 2868);
237
+ overflow: hidden;
238
+ border: 1px solid var(--sf-line);
239
+ border-radius: 0; /* square, as exported: the stores round corners when they display, not us */
240
+ background:
241
+ linear-gradient(135deg, rgba(118,87,220,.22), transparent 42%),
242
+ linear-gradient(180deg, #1b1930, #0d111a);
243
+ }
244
+ .sf-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
245
+ .sf-index {
246
+ position: absolute;
247
+ top: 8px;
248
+ left: 8px;
249
+ min-width: 25px;
250
+ padding: 5px 7px;
251
+ border: 1px solid rgba(255,255,255,.22);
252
+ border-radius: 999px;
253
+ background: rgba(12,11,17,.62);
254
+ color: #fff;
255
+ backdrop-filter: blur(10px);
256
+ font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
257
+ text-align: center;
258
+ }
259
+ .sf-expired {
260
+ position: absolute;
261
+ inset: 0;
262
+ display: none;
263
+ place-content: center;
264
+ padding: 18px;
265
+ color: rgba(255,255,255,.72);
266
+ text-align: center;
267
+ font-size: 12px;
268
+ }
269
+ .sf-frame.is-error .sf-expired { display: grid; }
270
+ .sf-frame.is-error img { display: none; }
271
+ .sf-panel-foot {
272
+ display: flex;
273
+ align-items: center;
274
+ justify-content: space-between;
275
+ gap: 8px;
276
+ padding-top: 8px;
277
+ }
278
+ .sf-panel-name { color: var(--sf-muted); font: 600 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
279
+ @media (max-width: 440px) {
280
+ .sf-rail { padding-inline: 14px; grid-auto-columns: min(64vw, 190px); }
281
+ }
282
+ `;function X(n){if(typeof n=="string"){let e=n.startsWith("data:")?n:`data:image/png;base64,${n}`;return{src:e,href:e}}return typeof n?.url=="string"&&n.url.length>0?{src:n.url,href:n.url}:null}function me(n,e){return T("Download PNG",n,`shotops-panel-${String(e+1).padStart(2,"0")}.png`,"sf-download")}function ee(n,e){n.replaceChildren();let o=_(e);if(o&&(!Array.isArray(e.panels)||e.panels.length===0)){let d=r("section","sf-shell"),m=r("header","sf-head"),c=r("div");c.append(r("p","sf-eyebrow","ShotOps / durable production"),r("h2","sf-title",o.title),r("p","sf-sub",o.detail));let h=r("span","sf-badge");h.append(r("span","sf-dot"),document.createTextNode(o.badge)),m.append(c,h),d.append(m);let l=r("footer","sf-meta");u(l,"Progress",o.total>0?`${o.completed}/${o.total}`:"Waiting"),typeof e.progress?.attempt=="number"&&u(l,"Attempt",String(e.progress.attempt)),typeof e.contract?.cost?.reserved=="number"&&u(l,"Reserved",String(e.contract.cost.reserved)),typeof e.contract?.cost?.released=="number"&&u(l,"Released",String(e.contract.cost.released)),d.append(l,r("p","sf-note",`Operation ${e.operationId}. Reconnect with production_operation.`)),n.append(d),O();return}let t=r("section","sf-shell"),s=r("header","sf-head"),i=r("div"),p=Array.isArray(e.panels)?e.panels:[],x=typeof e.count=="number"?e.count:p.length;i.append(r("p","sf-eyebrow","ShotOps / App Store"),r("h2","sf-title",x===1?"Your panel is ready":`Your ${x}-panel strip is ready`),r("p","sf-sub","Swipe through the final panels, then open or download each PNG."));let w=r("span","sf-badge");if(w.append(r("span","sf-dot"),document.createTextNode(e.output==="urls"?"Full-size links":"Inline result")),s.append(i,w),t.append(s),p.length>0){let d=r("div","sf-rail");e.panelWidth&&e.panelHeight&&d.style.setProperty("--sf-ratio",`${e.panelWidth} / ${e.panelHeight}`),p.forEach((m,c)=>{let h=X(m),l=r("article","sf-panel"),a=r("div","sf-frame");if(a.append(r("span","sf-index",String(c+1).padStart(2,"0"))),h){let f=r("img");f.src=h.src,f.alt=`Rendered App Store panel ${c+1} of ${p.length}`,f.loading=c===0?"eager":"lazy",f.addEventListener("error",()=>a.classList.add("is-error")),a.append(f)}else a.classList.add("is-error");a.append(r("div","sf-expired","Preview unavailable. Ask ShotOps to render this panel again."));let v=r("div","sf-panel-foot");v.append(r("span","sf-panel-name",`Panel ${String(c+1).padStart(2,"0")}`)),h&&v.append(me(h.href,c)),l.append(a,v),d.append(l)}),t.append(d)}else t.append(r("div","sf-empty","The render completed, but no panel previews were returned."));let g=r("footer","sf-meta");if(e.panelWidth&&e.panelHeight&&u(g,"Canvas",`${e.panelWidth}\xD7${e.panelHeight}`),e.panelPresetId&&u(g,"Preset",e.panelPresetId),e.locale&&u(g,"Locale",e.locale),typeof e.renderMs=="number"&&u(g,"Render",`${(e.renderMs/1e3).toFixed(1)}s`),e.openUrl){let d=r("div","sf-actions");d.append(E("Open in ShotOps \u2197",e.openUrl,"sf-open")),g.append(d)}g.childElementCount>0&&t.append(g);let y=[e.note,e.projectNote].filter(Boolean).join(" ");y&&t.append(r("p","sf-note",y)),n.append(t),O()}function ne(n){if(typeof n.operationId=="string"&&typeof n.status=="string"||n.ok===!1)return!0;if(n.ok!==!0)return!1;let e=Array.isArray(n.panels)?n.panels:[];return(typeof n.count=="number"?n.count:e.length)===0||e.length>0&&e.every(t=>X(t)!==null)}var B=document.createElement("style");document.head.append(B);function he(n){return!!M(n)||n.contract?.operation?.kind==="bundle"}G({css:S,rootId:"shotops-operation",loading:"Checking ShotOps production\u2026",empty:"No ShotOps production result is available.",terminal:"The production check finished, but ChatGPT did not deliver its result. Refresh ShotOps and try again.",accept:n=>!!M(n)||ne(n),render:(n,e)=>{n.replaceChildren(),he(e)?(B.textContent=Z,Q(n,e)):(B.textContent=J,ee(n,e))}});})();
@@ -124,7 +124,7 @@ button, a { font: inherit; }
124
124
  @media (prefers-reduced-motion: reduce) {
125
125
  .sf-download, .sf-open { transition: none; }
126
126
  }
127
- `;function r(n,e,o){let t=document.createElement(n);return e&&(t.className=e),o!==void 0&&(t.textContent=o),t}function h(n,e,o){let t=r("div","sf-stat");t.append(r("div","sf-k",e),r("div","sf-v",o)),n.append(t)}var D="2026-01-26",U="shotops-widget",B=4e3;function y(){return typeof window.openai<"u"}function v(){return window.parent!==window}var G=1,_=new Map;window.addEventListener("message",n=>{if(n.source!==window.parent)return;let e=n.data;if(!e||e.jsonrpc!=="2.0"||e.method||typeof e.id!="number")return;let o=_.get(e.id);o&&(_.delete(e.id),e.error?o.reject(new Error(e.error?.message??"MCP Apps request failed")):o.resolve(e.result))},{passive:!0});function C(n,e){let o=G++;return new Promise((t,i)=>{_.set(o,{resolve:t,reject:i}),window.parent.postMessage({jsonrpc:"2.0",id:o,method:n,params:e},"*")})}function I(n,e){window.parent.postMessage({jsonrpc:"2.0",method:n,params:e},"*")}var P=null;function A(){if(y()||!v())return Promise.resolve();if(!P){let n=C("ui/initialize",{capabilities:{},clientInfo:{name:U,version:"1.0.0"},protocolVersion:D,appCapabilities:{availableDisplayModes:["inline"]}});P=new Promise(e=>{let o=setTimeout(e,B);n.then(()=>{clearTimeout(o),e()},()=>{clearTimeout(o),e()})}).then(()=>{I("ui/notifications/initialized",{}),Y()})}return P}var E="";function L(){let n=Math.ceil(document.documentElement.clientWidth||0),e=Math.ceil(document.body?.getBoundingClientRect().height??0),o=`${n}x${e}`;o!==E&&(E=o,I("ui/notifications/size-changed",{width:n,height:e}))}function Y(){if(typeof ResizeObserver>"u"||!document.body)return;let n=0;new ResizeObserver(()=>{n||(n=requestAnimationFrame(()=>{n=0,L()}))}).observe(document.body)}function K(){return!!window.openai?.openExternal||!y()&&v()}function O(){if(window.openai?.notifyIntrinsicHeight){window.openai.notifyIntrinsicHeight();return}y()||!v()||A().then(L)}async function H(n){if(window.openai?.openExternal){await window.openai.openExternal({href:n});return}if(!y()&&v())try{await A(),await C("ui/open-link",{url:n});return}catch{}window.open(n,"_blank","noopener,noreferrer")}function z(n,e,o,t){let i=e;try{let p=new URL(e);/\/storage\/v1\/object\/sign\//.test(p.pathname)&&(p.searchParams.set("download",o),i=p.toString())}catch{}let s=r("a",t,n);return s.href=i,s.download=o,s.rel="noopener noreferrer",/^https?:/i.test(e)?(s.target="_blank",s.addEventListener("click",p=>{K()&&(p.preventDefault(),H(i))}),s):(!y()&&v()&&(s.style.display="none"),s)}function j(n,e,o){let t=r("button",o,n);return t.type="button",t.addEventListener("click",()=>{H(e)}),t}function c(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function V(n){if(!Array.isArray(n.content))return null;let e=[];for(let o of n.content){let t=c(o);if(!t)continue;if(t.type==="image"&&typeof t.data=="string"&&t.mimeType==="image/png"){e.push(t.data);continue}if(t.type==="resource_link"&&typeof t.uri=="string"&&t.mimeType==="image/png"){e.push({url:t.uri});continue}let i=c(t.resource);t.type==="resource"&&i&&typeof i.uri=="string"&&i.mimeType==="image/png"&&e.push({url:i.uri})}if(e.length>0)return{ok:!0,count:e.length,output:typeof e[0]=="string"?"inline":"urls",panels:e};if(n.isError===!0){let o=n.content.map(t=>c(t)).find(t=>t?.type==="text"&&typeof t.text=="string")?.text;return{ok:!1,...typeof o=="string"?{note:o}:{}}}return null}function N(n,e=0){let o=c(n);if(!o||e>6)return null;let t=c(o[M]);if(t)return t;let i=c(o._meta),s=c(i?.[M]);if(s)return s;for(let p of["mcp_tool_result","call_tool_result","tool_result","result"]){let m=N(o[p],e+1);if(m)return m}return null}function T(n,e=!0,o=0){let t=c(n);if(!t||o>6)return e?n:null;for(let s of["structuredContent","structured_content"]){let p=c(t[s]);if(p)return p}for(let s of["mcp_tool_result","call_tool_result","tool_result","result"]){if(t[s]===void 0)continue;let p=T(t[s],!1,o+1);if(p)return p}let i=V(t);return i||(e?n:null)}function W(n,e=0){let o=c(n);if(!o||e>6)return null;let t=typeof o.status=="string"?o.status.toLowerCase():"";if(["failed","failure","error","cancelled","canceled"].includes(t))return"failure";if(["complete","completed","success","succeeded"].includes(t))return"success";for(let i of["mcp_tool_result","call_tool_result","tool_result","result"]){let s=W(o[i],e+1);if(s)return s}return null}function Q(n){let e=c(n.detail);return c(e?.globals)}function Z(n){return N(n)??T(n,!1)}function J(n){if(!n||typeof n!="object")return n;let e=n;return e.structuredContent&&typeof e.structuredContent=="object"?e.structuredContent:T(n)}function $(n){A();let e=document.createElement("style");e.textContent=n.css;let o=r("div","sf-root");o.id=n.rootId,o.append(r("div","sf-empty",n.loading)),document.body.append(e,o);let t=!1,i=l=>{let a=J(l);!a||typeof a!="object"||n.accept&&!n.accept(a)||(t=!0,n.render(o,a))},s=l=>i(Z(l));window.addEventListener("message",l=>{if(l.source!==window.parent)return;let a=l.data;!a||a.jsonrpc!=="2.0"||a.method!=="ui/notifications/tool-result"||(i(a.params?.structuredContent),t||s(a.params))},{passive:!0}),window.addEventListener("openai:set_globals",l=>{let a=Q(l);a&&(i(a.toolOutput),t||s(a.toolResponseMetadata))},{passive:!0});let p=100,m=500,x=2e3,f=5*6e4,k=2e3,d=0,b=null,u=!1,g=()=>{if(typeof window>"u"||(i(window.openai?.toolOutput),t||s(window.openai?.toolResponseMetadata),t))return;let l=W(window.openai?.toolResponseMetadata);if(l&&b===null&&(b=d),l&&!u&&(l==="failure"||d-(b??d)>=k)&&(u=!0,o.replaceChildren(r("div","sf-empty",n.terminal??n.empty))),d>=f){u||o.replaceChildren(r("div","sf-empty",n.terminal??n.empty));return}let a=d<x?p:m;d+=a,setTimeout(g,a)};g()}function q(n){if(!n.operationId||!n.status)return null;let e=n.progress,o=typeof e?.panelsTotal=="number"&&e.panelsTotal>0,t=Math.max(0,Number((o?e?.panelsCompleted:e?.completed)??0)),i=Math.max(t,Number((o?e?.panelsTotal:e?.total)??0)),s={accepted:["Production accepted","ShotOps is preparing the durable render.","Accepted",!1],queued:["Production queued","The render is safely queued and can outlive this conversation.","Queued",!1],running:["Production rendering","ShotOps is rendering and checkpointing the final assets.","Running",!1],cancel_requested:["Cancellation requested","Work already in flight will stop at the next safe checkpoint.","Cancelling",!1],failed:["Production could not finish","The operation stopped without returning a partial asset set.","Failed",!0],cancelled:["Production cancelled","Unfinished work stopped and the remaining reservation was released.","Cancelled",!0],succeeded:["Production finished","The durable operation succeeded; request its result for fresh download links.","Succeeded",!0]},[p,m,x,f]=s[n.status];return{title:p,detail:m,badge:x,terminal:f,completed:t,total:i}}var X=`${R}
127
+ `;function r(n,e,o){let t=document.createElement(n);return e&&(t.className=e),o!==void 0&&(t.textContent=o),t}function h(n,e,o){let t=r("div","sf-stat");t.append(r("div","sf-k",e),r("div","sf-v",o)),n.append(t)}var G="2026-01-26",Y="shotops-widget",K=4e3;function y(){return typeof window.openai<"u"}function v(){return window.parent!==window}var V=1,_=new Map;window.addEventListener("message",n=>{if(n.source!==window.parent)return;let e=n.data;if(!e||e.jsonrpc!=="2.0"||e.method||typeof e.id!="number")return;let o=_.get(e.id);o&&(_.delete(e.id),e.error?o.reject(new Error(e.error?.message??"MCP Apps request failed")):o.resolve(e.result))},{passive:!0});function C(n,e){let o=V++;return new Promise((t,i)=>{_.set(o,{resolve:t,reject:i}),window.parent.postMessage({jsonrpc:"2.0",id:o,method:n,params:e},"*")})}function I(n,e){window.parent.postMessage({jsonrpc:"2.0",method:n,params:e},"*")}var P=null;function A(){if(y()||!v())return Promise.resolve();if(!P){let n=C("ui/initialize",{capabilities:{},clientInfo:{name:Y,version:"1.0.0"},protocolVersion:G,appCapabilities:{availableDisplayModes:["inline"]}});P=new Promise(e=>{let o=setTimeout(e,K);n.then(()=>{clearTimeout(o),e()},()=>{clearTimeout(o),e()})}).then(()=>{I("ui/notifications/initialized",{}),Q()})}return P}var T="";function L(){let n=Math.ceil(document.documentElement.clientWidth||0),e=Math.ceil(document.body?.getBoundingClientRect().height??0),o=`${n}x${e}`;o!==T&&(T=o,I("ui/notifications/size-changed",{width:n,height:e}))}function Q(){if(typeof ResizeObserver>"u"||!document.body)return;let n=0;new ResizeObserver(()=>{n||(n=requestAnimationFrame(()=>{n=0,L()}))}).observe(document.body)}function Z(){return!!window.openai?.openExternal||!y()&&v()}function O(){if(window.openai?.notifyIntrinsicHeight){window.openai.notifyIntrinsicHeight();return}y()||!v()||A().then(L)}async function H(n){if(window.openai?.openExternal){await window.openai.openExternal({href:n});return}if(!y()&&v())try{await A(),await C("ui/open-link",{url:n});return}catch{}window.open(n,"_blank","noopener,noreferrer")}function z(n,e,o,t){let i=e;try{let p=new URL(e);/\/storage\/v1\/object\/sign\//.test(p.pathname)&&(p.searchParams.set("download",o),i=p.toString())}catch{}let s=r("a",t,n);return s.href=i,s.download=o,s.rel="noopener noreferrer",/^https?:/i.test(e)?(s.target="_blank",s.addEventListener("click",p=>{Z()&&(p.preventDefault(),H(i))}),s):(!y()&&v()&&(s.style.display="none"),s)}function N(n,e,o){let t=r("button",o,n);return t.type="button",t.addEventListener("click",()=>{H(e)}),t}function c(n){return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function J(n){if(!Array.isArray(n.content))return null;let e=[];for(let o of n.content){let t=c(o);if(!t)continue;if(t.type==="image"&&typeof t.data=="string"&&t.mimeType==="image/png"){e.push(t.data);continue}if(t.type==="resource_link"&&typeof t.uri=="string"&&t.mimeType==="image/png"){e.push({url:t.uri});continue}let i=c(t.resource);t.type==="resource"&&i&&typeof i.uri=="string"&&i.mimeType==="image/png"&&e.push({url:i.uri})}if(e.length>0)return{ok:!0,count:e.length,output:typeof e[0]=="string"?"inline":"urls",panels:e};if(n.isError===!0){let o=n.content.map(t=>c(t)).find(t=>t?.type==="text"&&typeof t.text=="string")?.text;return{ok:!1,...typeof o=="string"?{note:o}:{}}}return null}function j(n,e=0){let o=c(n);if(!o||e>6)return null;let t=c(o[M]);if(t)return t;let i=c(o._meta),s=c(i?.[M]);if(s)return s;for(let p of["mcp_tool_result","call_tool_result","tool_result","result"]){let m=j(o[p],e+1);if(m)return m}return null}function E(n,e=!0,o=0){let t=c(n);if(!t||o>6)return e?n:null;for(let s of["structuredContent","structured_content"]){let p=c(t[s]);if(p)return p}for(let s of["mcp_tool_result","call_tool_result","tool_result","result"]){if(t[s]===void 0)continue;let p=E(t[s],!1,o+1);if(p)return p}let i=J(t);return i||(e?n:null)}function W(n,e=0){let o=c(n);if(!o||e>6)return null;let t=typeof o.status=="string"?o.status.toLowerCase():"";if(["failed","failure","error","cancelled","canceled"].includes(t))return"failure";if(["complete","completed","success","succeeded"].includes(t))return"success";for(let i of["mcp_tool_result","call_tool_result","tool_result","result"]){let s=W(o[i],e+1);if(s)return s}return null}function X(n){let e=c(n.detail);return c(e?.globals)}function ee(n){return j(n)??E(n,!1)}function ne(n){if(!n||typeof n!="object")return n;let e=n;return e.structuredContent&&typeof e.structuredContent=="object"?e.structuredContent:E(n)}function $(n){A();let e=document.createElement("style");e.textContent=n.css;let o=r("div","sf-root");o.id=n.rootId,o.append(r("div","sf-empty",n.loading)),document.body.append(e,o);let t=!1,i=l=>{let a=ne(l);!a||typeof a!="object"||n.accept&&!n.accept(a)||(t=!0,n.render(o,a))},s=l=>i(ee(l));window.addEventListener("message",l=>{if(l.source!==window.parent)return;let a=l.data;!a||a.jsonrpc!=="2.0"||a.method!=="ui/notifications/tool-result"||(i(a.params?.structuredContent),t||s(a.params))},{passive:!0}),window.addEventListener("openai:set_globals",l=>{let a=X(l);a&&(i(a.toolOutput),t||s(a.toolResponseMetadata))},{passive:!0});let p=100,m=500,x=2e3,f=5*6e4,k=2e3,d=0,b=null,u=!1,g=()=>{if(typeof window>"u"||(i(window.openai?.toolOutput),t||s(window.openai?.toolResponseMetadata),t))return;let l=W(window.openai?.toolResponseMetadata);if(l&&b===null&&(b=d),l&&!u&&(l==="failure"||d-(b??d)>=k)&&(u=!0,o.replaceChildren(r("div","sf-empty",n.terminal??n.empty))),d>=f){u||o.replaceChildren(r("div","sf-empty",n.terminal??n.empty));return}let a=d<x?p:m;d+=a,setTimeout(g,a)};g()}function q(n){if(!n.operationId||!n.status)return null;let e=n.progress,o=typeof e?.panelsTotal=="number"&&e.panelsTotal>0,t=Math.max(0,Number((o?e?.panelsCompleted:e?.completed)??0)),i=Math.max(t,Number((o?e?.panelsTotal:e?.total)??0)),s={accepted:["Production accepted","ShotOps is preparing the durable render.","Accepted",!1],queued:["Production queued","The render is safely queued and can outlive this conversation.","Queued",!1],running:["Production rendering","ShotOps is rendering and checkpointing the final assets.","Running",!1],cancel_requested:["Cancellation requested","Work already in flight will stop at the next safe checkpoint.","Cancelling",!1],failed:["Production could not finish","The operation stopped without returning a partial asset set.","Failed",!0],cancelled:["Production cancelled","Unfinished work stopped and the remaining reservation was released.","Cancelled",!0],succeeded:["Production finished","The durable operation succeeded; request its result for fresh download links.","Succeeded",!0]},[p,m,x,f]=s[n.status];return{title:p,detail:m,badge:x,terminal:f,completed:t,total:i}}var F=`${R}
128
128
  .sf-rail {
129
129
  display: grid;
130
130
  grid-auto-flow: column;
@@ -185,4 +185,4 @@ button, a { font: inherit; }
185
185
  @media (max-width: 440px) {
186
186
  .sf-rail { padding-inline: 14px; grid-auto-columns: min(64vw, 190px); }
187
187
  }
188
- `;function F(n){if(typeof n=="string"){let e=n.startsWith("data:")?n:`data:image/png;base64,${n}`;return{src:e,href:e}}return typeof n?.url=="string"&&n.url.length>0?{src:n.url,href:n.url}:null}function ee(n,e){return z("Download PNG",n,`shotops-panel-${String(e+1).padStart(2,"0")}.png`,"sf-download")}function ne(n,e){n.replaceChildren();let o=q(e);if(o&&(!Array.isArray(e.panels)||e.panels.length===0)){let d=r("section","sf-shell"),b=r("header","sf-head"),u=r("div");u.append(r("p","sf-eyebrow","ShotOps / durable production"),r("h2","sf-title",o.title),r("p","sf-sub",o.detail));let g=r("span","sf-badge");g.append(r("span","sf-dot"),document.createTextNode(o.badge)),b.append(u,g),d.append(b);let l=r("footer","sf-meta");h(l,"Progress",o.total>0?`${o.completed}/${o.total}`:"Waiting"),typeof e.progress?.attempt=="number"&&h(l,"Attempt",String(e.progress.attempt)),typeof e.contract?.cost?.reserved=="number"&&h(l,"Reserved",String(e.contract.cost.reserved)),typeof e.contract?.cost?.released=="number"&&h(l,"Released",String(e.contract.cost.released)),d.append(l,r("p","sf-note",`Operation ${e.operationId}. Reconnect with production_operation.`)),n.append(d),O();return}let t=r("section","sf-shell"),i=r("header","sf-head"),s=r("div"),p=Array.isArray(e.panels)?e.panels:[],m=typeof e.count=="number"?e.count:p.length;s.append(r("p","sf-eyebrow","ShotOps / App Store"),r("h2","sf-title",m===1?"Your panel is ready":`Your ${m}-panel strip is ready`),r("p","sf-sub","Swipe through the final panels, then open or download each PNG."));let x=r("span","sf-badge");if(x.append(r("span","sf-dot"),document.createTextNode(e.output==="urls"?"Full-size links":"Inline result")),i.append(s,x),t.append(i),p.length>0){let d=r("div","sf-rail");e.panelWidth&&e.panelHeight&&d.style.setProperty("--sf-ratio",`${e.panelWidth} / ${e.panelHeight}`),p.forEach((b,u)=>{let g=F(b),l=r("article","sf-panel"),a=r("div","sf-frame");if(a.append(r("span","sf-index",String(u+1).padStart(2,"0"))),g){let w=r("img");w.src=g.src,w.alt=`Rendered App Store panel ${u+1} of ${p.length}`,w.loading=u===0?"eager":"lazy",w.addEventListener("error",()=>a.classList.add("is-error")),a.append(w)}else a.classList.add("is-error");a.append(r("div","sf-expired","Preview unavailable. Ask ShotOps to render this panel again."));let S=r("div","sf-panel-foot");S.append(r("span","sf-panel-name",`Panel ${String(u+1).padStart(2,"0")}`)),g&&S.append(ee(g.href,u)),l.append(a,S),d.append(l)}),t.append(d)}else t.append(r("div","sf-empty","The render completed, but no panel previews were returned."));let f=r("footer","sf-meta");if(e.panelWidth&&e.panelHeight&&h(f,"Canvas",`${e.panelWidth}\xD7${e.panelHeight}`),e.panelPresetId&&h(f,"Preset",e.panelPresetId),e.locale&&h(f,"Locale",e.locale),typeof e.renderMs=="number"&&h(f,"Render",`${(e.renderMs/1e3).toFixed(1)}s`),e.openUrl){let d=r("div","sf-actions");d.append(j("Open in ShotOps \u2197",e.openUrl,"sf-open")),f.append(d)}f.childElementCount>0&&t.append(f);let k=[e.note,e.projectNote].filter(Boolean).join(" ");k&&t.append(r("p","sf-note",k)),n.append(t),O()}function te(n){if(typeof n.operationId=="string"&&typeof n.status=="string"||n.ok===!1)return!0;if(n.ok!==!0)return!1;let e=Array.isArray(n.panels)?n.panels:[];return(typeof n.count=="number"?n.count:e.length)===0||e.length>0&&e.every(t=>F(t)!==null)}$({css:X,rootId:"shotops-result",loading:"Loading ShotOps panels\u2026",empty:"No ShotOps render result is available.",terminal:"The render finished, but ChatGPT did not deliver its panel data. Refresh ShotOps and try again.",accept:te,render:ne});})();
188
+ `;function D(n){if(typeof n=="string"){let e=n.startsWith("data:")?n:`data:image/png;base64,${n}`;return{src:e,href:e}}return typeof n?.url=="string"&&n.url.length>0?{src:n.url,href:n.url}:null}function te(n,e){return z("Download PNG",n,`shotops-panel-${String(e+1).padStart(2,"0")}.png`,"sf-download")}function U(n,e){n.replaceChildren();let o=q(e);if(o&&(!Array.isArray(e.panels)||e.panels.length===0)){let d=r("section","sf-shell"),b=r("header","sf-head"),u=r("div");u.append(r("p","sf-eyebrow","ShotOps / durable production"),r("h2","sf-title",o.title),r("p","sf-sub",o.detail));let g=r("span","sf-badge");g.append(r("span","sf-dot"),document.createTextNode(o.badge)),b.append(u,g),d.append(b);let l=r("footer","sf-meta");h(l,"Progress",o.total>0?`${o.completed}/${o.total}`:"Waiting"),typeof e.progress?.attempt=="number"&&h(l,"Attempt",String(e.progress.attempt)),typeof e.contract?.cost?.reserved=="number"&&h(l,"Reserved",String(e.contract.cost.reserved)),typeof e.contract?.cost?.released=="number"&&h(l,"Released",String(e.contract.cost.released)),d.append(l,r("p","sf-note",`Operation ${e.operationId}. Reconnect with production_operation.`)),n.append(d),O();return}let t=r("section","sf-shell"),i=r("header","sf-head"),s=r("div"),p=Array.isArray(e.panels)?e.panels:[],m=typeof e.count=="number"?e.count:p.length;s.append(r("p","sf-eyebrow","ShotOps / App Store"),r("h2","sf-title",m===1?"Your panel is ready":`Your ${m}-panel strip is ready`),r("p","sf-sub","Swipe through the final panels, then open or download each PNG."));let x=r("span","sf-badge");if(x.append(r("span","sf-dot"),document.createTextNode(e.output==="urls"?"Full-size links":"Inline result")),i.append(s,x),t.append(i),p.length>0){let d=r("div","sf-rail");e.panelWidth&&e.panelHeight&&d.style.setProperty("--sf-ratio",`${e.panelWidth} / ${e.panelHeight}`),p.forEach((b,u)=>{let g=D(b),l=r("article","sf-panel"),a=r("div","sf-frame");if(a.append(r("span","sf-index",String(u+1).padStart(2,"0"))),g){let w=r("img");w.src=g.src,w.alt=`Rendered App Store panel ${u+1} of ${p.length}`,w.loading=u===0?"eager":"lazy",w.addEventListener("error",()=>a.classList.add("is-error")),a.append(w)}else a.classList.add("is-error");a.append(r("div","sf-expired","Preview unavailable. Ask ShotOps to render this panel again."));let S=r("div","sf-panel-foot");S.append(r("span","sf-panel-name",`Panel ${String(u+1).padStart(2,"0")}`)),g&&S.append(te(g.href,u)),l.append(a,S),d.append(l)}),t.append(d)}else t.append(r("div","sf-empty","The render completed, but no panel previews were returned."));let f=r("footer","sf-meta");if(e.panelWidth&&e.panelHeight&&h(f,"Canvas",`${e.panelWidth}\xD7${e.panelHeight}`),e.panelPresetId&&h(f,"Preset",e.panelPresetId),e.locale&&h(f,"Locale",e.locale),typeof e.renderMs=="number"&&h(f,"Render",`${(e.renderMs/1e3).toFixed(1)}s`),e.openUrl){let d=r("div","sf-actions");d.append(N("Open in ShotOps \u2197",e.openUrl,"sf-open")),f.append(d)}f.childElementCount>0&&t.append(f);let k=[e.note,e.projectNote].filter(Boolean).join(" ");k&&t.append(r("p","sf-note",k)),n.append(t),O()}function B(n){if(typeof n.operationId=="string"&&typeof n.status=="string"||n.ok===!1)return!0;if(n.ok!==!0)return!1;let e=Array.isArray(n.panels)?n.panels:[];return(typeof n.count=="number"?n.count:e.length)===0||e.length>0&&e.every(t=>D(t)!==null)}$({css:F,rootId:"shotops-result",loading:"Loading ShotOps panels\u2026",empty:"No ShotOps render result is available.",terminal:"The render finished, but ChatGPT did not deliver its panel data. Refresh ShotOps and try again.",accept:B,render:U});})();