wicked-studio 0.15.0 → 0.16.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.
- package/README.md +63 -3
- package/dist/apps-standalone/fixture.html +12 -0
- package/dist/apps-standalone/fixture.js +10 -0
- package/dist/apps-standalone/runtime.css +139 -0
- package/dist/apps-standalone/runtime.js +1 -0
- package/dist/assets/{KnowledgeGraph-Cpm46tEp.js → KnowledgeGraph-AtkRlS3c.js} +1 -1
- package/dist/assets/index-CdbCAs7s.css +32 -0
- package/dist/assets/index-DU_8o4uq.js +1104 -0
- package/dist/editors/wicked-apps/editor.json +1 -1
- package/dist/editors/wicked-apps/index.html +2 -2
- package/dist/editors/wicked-deck/editor.json +1 -1
- package/dist/editors/wicked-deck/index.html +14 -1
- package/dist/editors/wicked-doc/editor.json +1 -1
- package/dist/editors/wicked-doc/index.html +1 -1
- package/dist/editors/wicked-insights/editor.json +1 -1
- package/dist/editors/wicked-insights/index.html +1 -1
- package/dist/editors/wicked-page/editor.json +10 -1
- package/dist/editors/wicked-page/index.html +2 -2
- package/dist/editors/wicked-video/editor.json +7 -2
- package/dist/editors/wicked-video/index.html +14 -11
- package/dist/index.html +2 -2
- package/dist/testid-inventory.json +2069 -242
- package/package.json +9 -3
- package/dist/assets/index-BRBwWQMH.css +0 -32
- package/dist/assets/index-CVrWDGRP.js +0 -1097
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="en"><head><meta charset="utf-8">
|
|
3
3
|
<meta name="wicked-editor" content="wicked-video">
|
|
4
|
-
<meta name="wicked-editor-version" content="0.
|
|
4
|
+
<meta name="wicked-editor-version" content="0.16.0">
|
|
5
5
|
<title>Video</title>
|
|
6
6
|
<style>
|
|
7
7
|
:root{--surface-base:#fff;--surface-card:#f6f7f9;--surface-raised:#fff;--ink-high:#0d1117;--ink-body:#2b333d;--ink-muted:#5b6673;--border:#d5dae1;--accent:#224a5e;--font-sans:system-ui,sans-serif}
|
|
@@ -12,17 +12,20 @@ button,input,select,textarea{font:inherit;color:inherit}button{border:1px solid
|
|
|
12
12
|
.transport{display:flex;align-items:center;gap:12px}.chips{display:flex;gap:6px;overflow-x:auto;flex:none}.chip{border-radius:999px;white-space:nowrap;padding:5px 9px}.timeline{display:flex;gap:4px;min-height:52px;flex:none}.segment-box{position:relative;min-width:32px}.segment{width:100%;height:52px;text-align:left;overflow:hidden;white-space:nowrap;background:var(--surface-card);border-top:3px solid var(--video-accent,var(--accent))}.trim-handle{position:absolute;top:2px;bottom:2px;width:10px;cursor:ew-resize;padding:0;background:var(--accent);touch-action:none;border:0}.trim-handle[data-edge=in]{left:0}.trim-handle[data-edge=out]{right:0}.editor-fields{display:grid;gap:10px;margin-top:16px}.buttons{display:flex;gap:6px;flex-wrap:wrap}label{display:grid;gap:5px;color:var(--ink-muted)}input,select,textarea{width:100%;padding:7px;border:1px solid var(--border);border-radius:5px;background:var(--surface-raised);color:var(--ink-high)}.trim-fields{display:grid;grid-template-columns:1fr 1fr;gap:8px}.hint,.status{font-size:12px;color:var(--ink-muted);line-height:1.5;margin:8px 0}.inspectors{padding:16px;border-left:1px solid var(--border);overflow:auto;background:var(--surface-card)}.inspectors textarea{resize:vertical;min-height:100px}.summary{line-height:1.6;white-space:pre-line}.video-editor[data-mode=advanced][data-surface=full]{grid-template-columns:240px minmax(0,1fr) 280px}
|
|
13
13
|
.video-editor[data-surface=card]{grid-template-columns:1fr}.video-editor[data-surface=card] .work{padding:0;gap:6px}.video-editor[data-surface=card] .player{border-radius:0;max-height:calc(100vh - 70px);flex:1;min-height:0}.video-editor[data-surface=card] .transport{padding:0 8px}.video-editor[data-surface=options]{grid-template-columns:1fr}.video-editor[data-surface=options] .chapters{border:0}
|
|
14
14
|
.timeline{position:relative}.timeline[data-proof=true]{padding-bottom:24px}.check-track{position:absolute;bottom:0;left:10px;right:10px;height:20px}.check-mark{position:absolute;transform:translateX(-50%);padding:0 3px;height:20px;min-width:12px;border:0;border-radius:2px;border-left:2px solid currentColor;background:var(--surface-raised);color:var(--ink-muted)}.check-mark[data-state=FAIL],.chapter-verdict[data-verdict=FAIL],#check-list [data-state=FAIL]{color:var(--status-fail)}.check-mark[data-state=PASS],.chapter-verdict[data-verdict=PASS]{color:var(--status-ok)}#proof{margin-bottom:20px}#check-list{font-size:12px;line-height:1.5;overflow-wrap:anywhere}textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
15
|
+
.review-tab{padding:16px;overflow:auto;min-width:0}.review-tab .findings{list-style:decimal;padding-left:18px;gap:6px;font-size:12px;line-height:1.5;overflow-wrap:anywhere;margin-bottom:12px}.review-tab .findings [data-state=FAIL]{color:var(--status-fail)}.sheets{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:12px}.sheet{margin:0;display:grid;gap:6px}.sheet img{width:100%;display:block;border:1px solid var(--border);border-radius:6px;background:var(--surface-card)}.sheet figcaption{font-size:12px;color:var(--ink-muted)}
|
|
15
16
|
@media(max-width:850px){.video-editor[data-mode=advanced][data-surface=full]{grid-template-columns:200px minmax(0,1fr)}.inspectors{grid-column:2;border-left:0}.video-editor[data-surface=full]{grid-template-columns:200px minmax(0,1fr)}}
|
|
16
|
-
</style></head><body><script>var wickedEditor=(function(Z){"use strict";var Ut=Object.defineProperty;var Dt=(Z,G,re)=>G in Z?Ut(Z,G,{enumerable:!0,configurable:!0,writable:!0,value:re}):Z[G]=re;var ut=(Z,G,re)=>Dt(Z,typeof G!="symbol"?G+"":G,re);const G={"Alt+J":{verb:"navigate",what:"next card or row"},"Alt+K":{verb:"navigate",what:"previous card or row"},"Alt+/":{verb:"navigate",what:"the keyboard shortcuts overlay"},"Alt+P":{verb:"navigate",what:"peek at the top item that needs you"},"Alt+G":{verb:"navigate",what:"jump to the top item that needs you"},"Alt+B":{verb:"navigate",what:"back to where you were"},"Alt+T":{verb:"navigate",what:"the run’s evidence timeline"},"Alt+U":{verb:"navigate",what:"the run’s unit list"},"Alt+A":{verb:"approve",what:"approve the open gate"},"Alt+R":{verb:"decide",what:"reject the open gate"},"Alt+X":{verb:"decide",what:"select a gate for batch resolution"},"Alt+N":{verb:"compose",what:"compose a steer note"}},re=new Set(["Escape","Mod+K","Tab","Shift+Tab"]);function pt(t){if(re.has(t))return!0;const n=G[ft(t)];return n!==void 0&&n.verb==="navigate"}function ft(t){const n=/^alt\+(.)$/i.exec(t);return n===null?t:`Alt+${n[1].toUpperCase()}`}const K="wicked.editor",q=1,He=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ht=["card","options","full"];function Xe(t){return t==="inline"?"card":t==="pane"?"options":"full"}function mt(t){const n=He(t)?t:{},l=n.size==="inline"||n.size==="full"?n.size:"pane",c=n.protocol===2?2:1,a=c===2&&typeof n.tab=="string"?n.tab:null,v=c===2&&ht.includes(n.surface)?n.surface:Xe(l),b=v==="options"&&a===null?"full":v,y=c===2&&(n.mode==="simple"||n.mode==="advanced")?n.mode:null;return{protocol:c,surface:b,tab:a,mode:y,size:l}}function bt(t,n,l){return{editor:t,version:n,protocol:[1,2],surfaces:l}}function vt(t,n){const l=document.querySelector('meta[name="wicked-editor-version"]')?.getAttribute("content")??"0.0.0";parent.postMessage({p:K,v:q,type:"plugin.ready",payload:bt(t,l,n)},"*")}function yt(t,n,l){const c=t.metaKey||t.ctrlKey;let a=null;if(t.key==="Escape")a="Escape";else if(c&&!t.altKey&&t.key.toLowerCase()==="k")a="Mod+K";else if(t.altKey&&!c&&/^Key[A-Z]$/.test(t.code)&&pt(`Alt+${t.code.slice(3)}`))a=`Alt+${t.code.slice(3)}`;else if(t.key==="Tab"){const v=Array.from(n.querySelectorAll("button, input, select, textarea, [tabindex]")).filter(y=>y.tabIndex>=0&&!y.matches(":disabled")&&y.closest("[hidden]")===null),b=v.indexOf(t.target);(t.shiftKey?b<=0:b===-1||b===v.length-1)&&(a=t.shiftKey?"Shift+Tab":"Tab")}return a===null?!1:(t.preventDefault(),t.stopPropagation(),l(a),!0)}class gt{constructor(n,l){ut(this,"revs",new Map);this.port=n,this.h=l}reply(n,l){this.port.postMessage({p:K,v:q,re:n,ok:!0,payload:l})}refuse(n,l,c){this.port.postMessage({p:K,v:q,re:n,ok:!1,error:{code:l,message:c}})}bump(n){const l=(this.revs.get(n)??0)+1;return this.revs.set(n,l),l}values(n,l){this.port.postMessage({p:K,v:q,type:"options.values",payload:{tab:n,rev:this.bump(n),values:l}})}height(n){this.port.postMessage({p:K,v:q,type:"ui.height",payload:{px:Math.round(n)}})}dispatch(n){const l=He(n.payload)?n.payload:{},c=typeof n.id=="string"?n.id:null;switch(n.type){case"host.surface":{const a=l.surface;return(a==="card"||a==="options"||a==="full")&&this.h.surface?.(a,l.mode==="simple"||l.mode==="advanced"?l.mode:null),!0}case"host.mode":{if(c===null)return!0;const a=l.mode;return a!=="simple"&&a!=="advanced"?(this.refuse(c,"bad_request","mode is simple or advanced"),!0):(this.reply(c,{mode:this.h.mode?.(a)??a}),!0)}case"host.action":{if(c===null)return!0;const a=l.id;return typeof a!="string"||this.h.action===void 0?(this.reply(c,{handled:!1}),!0):(Promise.resolve(this.h.action(a)).then(v=>this.reply(c,{handled:v.handled===!0,...typeof v.status=="string"?{status:v.status.slice(0,120)}:{}}),()=>this.reply(c,{handled:!1})),!0)}case"host.tab":return typeof l.tab=="string"&&this.h.tab?.(l.tab),!0;case"host.selection":return Array.isArray(l.anchors)&&this.h.selection?.(l.anchors),!0;case"options.changed":{if(c===null)return!0;const a=l.tab,v=l.id;return typeof a!="string"||typeof v!="string"||this.h.optionsChanged===void 0?(this.refuse(c,"unsupported","no controls here"),!0):(Promise.resolve(this.h.optionsChanged(a,v,l.value)).then(b=>this.reply(c,{applied:b.applied,rev:this.bump(a),values:b.values,...b.reason!==void 0?{reason:b.reason.slice(0,120)}:{}}),b=>this.refuse(c,"unavailable",b instanceof Error?b.message.slice(0,120):"failed")),!0)}default:return!1}}}const Ze={card:{interactive:!0,aspect:"16:9",actions:[{id:"prev",label:"Previous chapter",verb:"plugin"},{id:"next",label:"Next chapter",verb:"plugin",primary:!0},{id:"ask",label:"Ask about this",verb:"host:ask"},{id:"export",label:"Export",verb:"host:export"}]},options:{tabs:[{id:"chapters",label:"Chapters",render:"plugin"},{id:"captions",label:"Captions",render:"controls",controls:[{id:"on",label:"Captions",type:"toggle"},{id:"burn",label:"Burn into video",type:"toggle"},{id:"position",label:"Position",type:"segmented",options:[{id:"bottom",label:"Bottom"},{id:"top",label:"Top"}]},{id:"size",label:"Text size",type:"range",min:18,max:72,step:2},{id:"lines",label:"Max lines",type:"range",min:1,max:3,step:1},{id:"wrap",label:"Line length",type:"range",min:20,max:80,step:1},{id:"look",label:"Look",type:"segmented",options:[{id:"bar",label:"Bar"},{id:"outline",label:"Outline"},{id:"plain",label:"Plain"}]}]},{id:"theme",label:"Theme",render:"controls",controls:[{id:"palette",label:"Colours",type:"select",options:[{id:"studio",label:"Studio skin · default"},{id:"corporate",label:"Corporate Light"},{id:"midnight",label:"Midnight Purple"},{id:"warm",label:"Warm Dark"},{id:"custom",label:"Custom"}]},{id:"title",label:"Title card",type:"toggle"},{id:"titletext",label:"Title",type:"text",maxChars:80},{id:"end",label:"End card",type:"toggle"},{id:"endtext",label:"End card text",type:"text",maxChars:80},{id:"background",label:"Background",type:"color"},{id:"foreground",label:"Text colour",type:"color"},{id:"accent",label:"Accent",type:"color"},{id:"font",label:"Font",type:"select",options:[{id:"inter",label:"Inter"},{id:"roboto",label:"Roboto"},{id:"source-sans",label:"Source Sans 3"},{id:"plex",label:"IBM Plex Sans"},{id:"system",label:"System"},{id:"archivo",label:"Archivo"}]}]}]},full:{modes:["simple","advanced"],default:"simple"}},Ge={corporate:{background:"#FFFFFF",foreground:"#1E293B",accent:"#0891B2"},midnight:{background:"#0A0A0F",foreground:"#FFFFFF",accent:"#A100FF"},warm:{background:"#1A1A2E",foreground:"#F8F8F2",accent:"#FFD93D"}},kt=(t,n)=>["background","foreground","accent"].every(l=>t[l].toLowerCase()===n[l].toLowerCase());function be(t){if(t.palette===void 0||t.palette==="skin")return"studio";for(const[n,l]of Object.entries(Ge))if(kt(t,l))return n;return"custom"}function Re(t,n,l){const c=be(t)==="studio"?l??n??t:t;return{background:c.background,foreground:c.foreground,accent:c.accent}}const Pe={inter:"Inter",roboto:"Roboto","source-sans":"Source Sans 3",plex:"IBM Plex Sans",system:"system-ui",archivo:"Archivo"};function le(t,n,l=null,c){const a=t.captions,v=t.theme;if(n==="captions")return{on:a.on,burn:a.burnIn,position:a.position,size:a.size,lines:a.maxLines,wrap:a.wrapChars,look:a.style};if(n==="theme"){const b=Re(v,l,c),y=be(v)==="studio"?c?.font??v.font:v.font;return{palette:be(v),title:v.titleCard.on,titletext:v.titleCard.title,end:v.endCard.on,endtext:v.endCard.title,background:b.background,foreground:b.foreground,accent:b.accent,font:Object.keys(Pe).find(k=>Pe[k]===y)??"system"}}return{}}function St(t,n,l,c){const a=JSON.parse(JSON.stringify(t));if(n==="captions"){const v={on:"on",burn:"burnIn",position:"position",size:"size",lines:"maxLines",wrap:"wrapChars",look:"style"};Object.assign(a.captions,{[v[l]]:c})}else if(n==="theme")switch(l){case"title":a.theme.titleCard.on=c;break;case"titletext":a.theme.titleCard.title=c;break;case"end":a.theme.endCard.on=c;break;case"endtext":a.theme.endCard.title=c;break;case"font":a.theme.font=Pe[c],a.theme.palette="custom";break;case"palette":a.theme.palette=c==="studio"?"skin":"custom",(c==="corporate"||c==="midnight"||c==="warm")&&Object.assign(a.theme,Ge[c]);break;default:Object.assign(a.theme,{[l]:c,palette:"custom"})}return a}const R={actions:4,tabs:5,controls:12,options:8,labelChars:24,maxChars:200},Te=/^[a-z][a-z0-9-]{0,31}$/u,xt=/^[A-Za-z0-9 ·'-]{1,24}$/u,At=["approve","accept","deliver","merge","send","launch","delete","remove","stop","deny","allow","grant","install"],$t={а:"a",е:"e",о:"o",р:"p",с:"c",у:"y",х:"x",і:"i",ј:"j",ѕ:"s","ԁ":"d","ӏ":"l",α:"a",ε:"e",ο:"o",ρ:"p",ν:"v",τ:"t",κ:"k",ι:"i",μ:"m",0:"o",1:"l",3:"e",4:"a",5:"s",7:"t"};function Ct(t){const n=t.normalize("NFKD").replace(/\p{M}+/gu,"").toLowerCase();let l="";for(const c of n)l+=$t[c]??c;return l.split(/[^a-z]+/u).filter(c=>c!=="")}function wt(t){return Ct(t).some(n=>At.some(l=>n.startsWith(l)))}const ee=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Le=t=>typeof t=="number"&&Number.isFinite(t),m=t=>({ok:!1,reason:t}),Et=/(?:[A-Za-z][0-9]|[0-9][A-Za-z])/u;function Fe(t,n){return typeof t!="string"||!xt.test(t)?`${n}: a label is 1 to ${R.labelChars} plain characters`:Et.test(t)?`${n}: a word in a label is letters or digits, not both`:wt(t)?`${n}: "${t}" uses a word only the host's own controls may use`:null}function Me(t,n){const l=new Set;for(const c of t){if(l.has(c.id))return`${n}: the id "${c.id}" is used twice`;l.add(c.id)}return null}const te=(t,n,l)=>{for(const c of Object.keys(t))if(!n.includes(c))return`${l}: unknown field "${c}"`;return null};function Tt(t,n){if(!ee(t))return m(`${n}: not an object`);const l=te(t,["id","label","type","options","min","max","step","maxChars"],n);if(l!==null)return m(l);if(typeof t.id!="string"||!Te.test(t.id))return m(`${n}: a bad id`);const c=Fe(t.label,n);if(c!==null)return m(c);const a=t.type;if(a!=="toggle"&&a!=="segmented"&&a!=="select"&&a!=="color"&&a!=="text"&&a!=="range")return m(`${n}: an unknown control type`);const v={id:t.id,label:t.label,type:a};if(a==="segmented"||a==="select"){const b=t.options;if(!Array.isArray(b)||b.length<2||b.length>R.options)return m(`${n}: ${a} needs 2 to ${R.options} options`);const y=[];for(const[V,g]of b.entries()){if(!ee(g)||typeof g.id!="string"||!Te.test(g.id))return m(`${n}.options[${V}]: a bad id`);const A=Fe(g.label,`${n}.options[${V}]`);if(A!==null)return m(A);const C=te(g,["id","label"],`${n}.options[${V}]`);if(C!==null)return m(C);y.push({id:g.id,label:g.label})}const k=Me(y,`${n}.options`);if(k!==null)return m(k);v.options=y}else if(t.options!==void 0)return m(`${n}: only select and segmented take options`);if(a==="range"){const{min:b,max:y,step:k}=t;if(!Le(b)||!Le(y)||!Le(k))return m(`${n}: range needs finite min, max and step`);if(!(b<y)||!(k>0)||k>y-b)return m(`${n}: range needs min < max and 0 < step ≤ max - min`);if(Math.abs(b)>1e9||Math.abs(y)>1e9||k<1e-6||(y-b)/k>1e6)return m(`${n}: range bounds are within ±1e9, step ≥ 1e-6, at most 1e6 steps`);if(k<Math.max(Math.abs(b),Math.abs(y))*1e-12)return m(`${n}: range step is too fine for its bounds`);v.min=b,v.max=y,v.step=k}else if(t.min!==void 0||t.max!==void 0||t.step!==void 0)return m(`${n}: only range takes min, max and step`);if(a==="text"){const b=t.maxChars===void 0?R.maxChars:t.maxChars;if(!Number.isInteger(b)||b<1||b>R.maxChars)return m(`${n}: maxChars is 1 to ${R.maxChars}`);v.maxChars=b}else if(t.maxChars!==void 0)return m(`${n}: only text takes maxChars`);return{ok:!0,value:v}}function Lt(t){if(!ee(t))return m("surfaces: not an object");const n=te(t,["card","options","full"],"surfaces");if(n!==null)return m(n);const l=t.card;if(!ee(l))return m("surfaces.card is required");const c=te(l,["interactive","aspect","actions"],"surfaces.card");if(c!==null)return m(c);const a=l.interactive===void 0?!1:l.interactive;if(typeof a!="boolean")return m("surfaces.card.interactive: a boolean");const v=l.aspect===void 0?"16:9":l.aspect;if(v!=="16:9"&&v!=="4:3"&&v!=="auto")return m("surfaces.card.aspect: 16:9, 4:3 or auto");const b=l.actions===void 0?[]:l.actions;if(!Array.isArray(b)||b.length>R.actions)return m(`surfaces.card.actions: at most ${R.actions}`);const y=[];for(const[A,C]of b.entries()){const T=`surfaces.card.actions[${A}]`;if(!ee(C))return m(`${T}: not an object`);const M=te(C,["id","label","primary","verb"],T);if(M!==null)return m(M);if(typeof C.id!="string"||!Te.test(C.id))return m(`${T}: a bad id`);const i=Fe(C.label,T);if(i!==null)return m(i);const $=C.verb;if($!=="plugin"&&$!=="host:export"&&$!=="host:ask")return m(`${T}: verb is plugin, host:export or host:ask`);const I=C.primary===void 0?!1:C.primary;if(typeof I!="boolean")return m(`${T}: primary is a boolean`);y.push({id:C.id,label:C.label,primary:I,verb:$})}const k=Me(y,"surfaces.card.actions");if(k!==null)return m(k);let V=null;if(t.options!==void 0){const A=t.options;if(!ee(A))return m("surfaces.options: not an object");const C=te(A,["tabs"],"surfaces.options");if(C!==null)return m(C);const T=A.tabs;if(!Array.isArray(T)||T.length<1||T.length>R.tabs)return m(`surfaces.options.tabs: 1 to ${R.tabs}`);const M=[];for(const[$,I]of T.entries()){const O=`surfaces.options.tabs[${$}]`;if(!ee(I))return m(`${O}: not an object`);const _=te(I,["id","label","render","controls"],O);if(_!==null)return m(_);if(typeof I.id!="string"||!Te.test(I.id))return m(`${O}: a bad id`);const W=Fe(I.label,O);if(W!==null)return m(W);const j=I.render;if(j!=="plugin"&&j!=="controls")return m(`${O}: render is plugin or controls`);const ie={id:I.id,label:I.label,render:j};if(j==="controls"){const ae=I.controls;if(!Array.isArray(ae)||ae.length<1||ae.length>R.controls)return m(`${O}.controls: 1 to ${R.controls}`);const D=[];for(const[ve,N]of ae.entries()){const H=Tt(N,`${O}.controls[${ve}]`);if(!H.ok)return H;D.push(H.value)}const ne=Me(D,`${O}.controls`);if(ne!==null)return m(ne);ie.controls=D}else if(I.controls!==void 0)return m(`${O}: a plugin-rendered tab has no controls`);M.push(ie)}const i=Me(M,"surfaces.options.tabs");if(i!==null)return m(i);V={tabs:M}}let g=null;if(t.full!==void 0){const A=t.full;if(!ee(A))return m("surfaces.full: not an object");const C=te(A,["modes","default"],"surfaces.full");if(C!==null)return m(C);let T=null;if(A.modes!==void 0){const i=A.modes;if(!Array.isArray(i)||i.length!==2||i[0]!=="simple"||i[1]!=="advanced")return m('surfaces.full.modes: exactly ["simple","advanced"]');T=["simple","advanced"]}const M=A.default===void 0?"simple":A.default;if(M!=="simple"&&M!=="advanced")return m("surfaces.full.default: simple or advanced");if(T===null&&A.default!==void 0)return m("surfaces.full.default needs modes");g={modes:T,default:M}}return{ok:!0,value:{card:{interactive:a,aspect:v,actions:y},options:V,full:g}}}const Je=String.raw`(?:\d{1,3}(?:\.\d+)?%?|\.\d+%?)`,Ft=new RegExp(String.raw`^(?:#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgba?|hsla?)\(\s*${Je}(?:\s*,\s*${Je}){2,3}\s*\))$`,"iu");function Mt(t,n){switch(t.type){case"toggle":return typeof n=="boolean";case"segmented":case"select":return typeof n=="string"&&(t.options??[]).some(l=>l.id===n);case"color":return typeof n=="string"&&n.length<=64&&Ft.test(n);case"text":return typeof n=="string"&&n.length<=(t.maxChars??R.maxChars)&&!/[\r\n]/u.test(n);case"range":{if(!Le(n)||t.min===void 0||t.max===void 0||t.step===void 0||n<t.min||n>t.max)return!1;const l=Math.round((n-t.min)/t.step);return Math.abs(n-(t.min+l*t.step))<=t.step*.001}}}const je=Lt(Ze);if(!je.ok)throw new Error(je.reason);const Ot=je.value;function Ye(){document.body.insertAdjacentHTML("afterbegin",`<main id="video-editor" class="video-editor" data-testid="video-editor" tabindex="0">
|
|
17
|
-
<aside id="chapters" class="chapters"><h2>Chapters</h2><ol id="chapter-list"></ol><div id="editor-fields" class="editor-fields"></div><p id="hint" class="hint"></p></aside>
|
|
17
|
+
@media(max-width:600px){.video-editor[data-surface=full],.video-editor[data-mode=advanced][data-surface=full]{grid-template-columns:minmax(0,1fr);grid-template-rows:auto;align-content:start;height:auto;min-height:100%}.video-editor[data-surface=full] .segment-box{flex:1 1 100%!important}.video-editor[data-surface=full] .segment{height:40px}.video-editor[data-surface=full] .work{order:-1;padding:8px;overflow:visible}.video-editor[data-surface=full] .chapters{border-right:0;border-top:1px solid var(--border)}.video-editor[data-surface=full] .inspectors{grid-column:auto;border-left:0;border-top:1px solid var(--border)}.video-editor[data-surface=full] .player{max-height:none}.timeline{flex-wrap:wrap}.chips{flex-wrap:wrap;overflow-x:visible}.sheets{grid-template-columns:1fr}}
|
|
18
|
+
</style></head><body><script>var wickedEditor=(function(G){"use strict";var Vt=Object.defineProperty;var _t=(G,Z,re)=>Z in G?Vt(G,Z,{enumerable:!0,configurable:!0,writable:!0,value:re}):G[Z]=re;var ht=(G,Z,re)=>_t(G,typeof Z!="symbol"?Z+"":Z,re);const Z={"Alt+J":{verb:"navigate",what:"next card or row"},"Alt+K":{verb:"navigate",what:"previous card or row"},"Alt+/":{verb:"navigate",what:"the keyboard shortcuts overlay"},"Alt+P":{verb:"navigate",what:"peek at the top item that needs you"},"Alt+G":{verb:"navigate",what:"jump to the top item that needs you"},"Alt+B":{verb:"navigate",what:"back to where you were"},"Alt+T":{verb:"navigate",what:"the run’s evidence timeline"},"Alt+U":{verb:"navigate",what:"the run’s unit list"},"Alt+A":{verb:"approve",what:"approve the open gate"},"Alt+R":{verb:"decide",what:"reject the open gate"},"Alt+X":{verb:"decide",what:"select a gate for batch resolution"},"Alt+N":{verb:"compose",what:"compose a steer note"}},re=new Set(["Escape","Mod+K","Tab","Shift+Tab"]);function mt(t){if(re.has(t))return!0;const n=Z[bt(t)];return n!==void 0&&n.verb==="navigate"}function bt(t){const n=/^alt\+(.)$/i.exec(t);return n===null?t:`Alt+${n[1].toUpperCase()}`}const V="wicked.editor",_=1,Ge=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),vt=["card","options","full"];function Ze(t){return t==="inline"?"card":t==="pane"?"options":"full"}function yt(t){const n=Ge(t)?t:{},l=n.size==="inline"||n.size==="full"?n.size:"pane",u=n.protocol===2?2:1,s=u===2&&typeof n.tab=="string"?n.tab:null,v=u===2&&vt.includes(n.surface)?n.surface:Ze(l),b=v==="options"&&s===null?"full":v,y=u===2&&(n.mode==="simple"||n.mode==="advanced")?n.mode:null;return{protocol:u,surface:b,tab:s,mode:y,size:l}}function gt(t,n,l){return{editor:t,version:n,protocol:[1,2],surfaces:l}}function kt(t,n){const l=document.querySelector('meta[name="wicked-editor-version"]')?.getAttribute("content")??"0.0.0";parent.postMessage({p:V,v:_,type:"plugin.ready",payload:gt(t,l,n)},"*")}function St(t,n,l){const u=t.metaKey||t.ctrlKey;let s=null;if(t.key==="Escape")s="Escape";else if(u&&!t.altKey&&t.key.toLowerCase()==="k")s="Mod+K";else if(t.altKey&&!u&&/^Key[A-Z]$/.test(t.code)&&mt(`Alt+${t.code.slice(3)}`))s=`Alt+${t.code.slice(3)}`;else if(t.key==="Tab"){const v=Array.from(n.querySelectorAll("button, input, select, textarea, [tabindex]")).filter(y=>y.tabIndex>=0&&!y.matches(":disabled")&&y.closest("[hidden]")===null),b=v.indexOf(t.target);(t.shiftKey?b<=0:b===-1||b===v.length-1)&&(s=t.shiftKey?"Shift+Tab":"Tab")}return s===null?!1:(t.preventDefault(),t.stopPropagation(),l(s),!0)}class xt{constructor(n,l){ht(this,"revs",new Map);this.port=n,this.h=l}reply(n,l){this.port.postMessage({p:V,v:_,re:n,ok:!0,payload:l})}refuse(n,l,u){this.port.postMessage({p:V,v:_,re:n,ok:!1,error:{code:l,message:u}})}bump(n){const l=(this.revs.get(n)??0)+1;return this.revs.set(n,l),l}values(n,l){this.port.postMessage({p:V,v:_,type:"options.values",payload:{tab:n,rev:this.bump(n),values:l}})}height(n){this.port.postMessage({p:V,v:_,type:"ui.height",payload:{px:Math.round(n)}})}dispatch(n){const l=Ge(n.payload)?n.payload:{},u=typeof n.id=="string"?n.id:null;switch(n.type){case"host.surface":{const s=l.surface;return(s==="card"||s==="options"||s==="full")&&this.h.surface?.(s,l.mode==="simple"||l.mode==="advanced"?l.mode:null),!0}case"host.mode":{if(u===null)return!0;const s=l.mode;return s!=="simple"&&s!=="advanced"?(this.refuse(u,"bad_request","mode is simple or advanced"),!0):(this.reply(u,{mode:this.h.mode?.(s)??s}),!0)}case"host.action":{if(u===null)return!0;const s=l.id;return typeof s!="string"||this.h.action===void 0?(this.reply(u,{handled:!1}),!0):(Promise.resolve(this.h.action(s)).then(v=>this.reply(u,{handled:v.handled===!0,...typeof v.status=="string"?{status:v.status.slice(0,120)}:{}}),()=>this.reply(u,{handled:!1})),!0)}case"host.tab":return typeof l.tab=="string"&&this.h.tab?.(l.tab),!0;case"host.selection":return Array.isArray(l.anchors)&&this.h.selection?.(l.anchors),!0;case"options.changed":{if(u===null)return!0;const s=l.tab,v=l.id;return typeof s!="string"||typeof v!="string"||this.h.optionsChanged===void 0?(this.refuse(u,"unsupported","no controls here"),!0):(Promise.resolve(this.h.optionsChanged(s,v,l.value)).then(b=>this.reply(u,{applied:b.applied,rev:this.bump(s),values:b.values,...b.reason!==void 0?{reason:b.reason.slice(0,120)}:{}}),b=>this.refuse(u,"unavailable",b instanceof Error?b.message.slice(0,120):"failed")),!0)}default:return!1}}}const Je={card:{interactive:!0,aspect:"16:9",actions:[{id:"prev",label:"Previous chapter",verb:"plugin"},{id:"next",label:"Next chapter",verb:"plugin",primary:!0},{id:"ask",label:"Ask about this",verb:"host:ask"},{id:"export",label:"Export",verb:"host:export"}]},options:{tabs:[{id:"chapters",label:"Chapters",render:"plugin"},{id:"sheets",label:"Review",render:"plugin"},{id:"captions",label:"Captions",render:"controls",controls:[{id:"on",label:"Captions",type:"toggle"},{id:"burn",label:"Burn into video",type:"toggle"},{id:"position",label:"Position",type:"segmented",options:[{id:"bottom",label:"Bottom"},{id:"top",label:"Top"}]},{id:"size",label:"Text size",type:"range",min:18,max:72,step:2},{id:"lines",label:"Max lines",type:"range",min:1,max:3,step:1},{id:"wrap",label:"Line length",type:"range",min:20,max:80,step:1},{id:"look",label:"Look",type:"segmented",options:[{id:"bar",label:"Bar"},{id:"outline",label:"Outline"},{id:"plain",label:"Plain"}]}]},{id:"theme",label:"Theme",render:"controls",controls:[{id:"palette",label:"Colours",type:"select",options:[{id:"studio",label:"Studio skin · default"},{id:"corporate",label:"Corporate Light"},{id:"midnight",label:"Midnight Purple"},{id:"warm",label:"Warm Dark"},{id:"custom",label:"Custom"}]},{id:"title",label:"Title card",type:"toggle"},{id:"titletext",label:"Title",type:"text",maxChars:80},{id:"end",label:"End card",type:"toggle"},{id:"endtext",label:"End card text",type:"text",maxChars:80},{id:"background",label:"Background",type:"color"},{id:"foreground",label:"Text colour",type:"color"},{id:"accent",label:"Accent",type:"color"},{id:"font",label:"Font",type:"select",options:[{id:"inter",label:"Inter"},{id:"roboto",label:"Roboto"},{id:"source-sans",label:"Source Sans 3"},{id:"plex",label:"IBM Plex Sans"},{id:"system",label:"System"},{id:"archivo",label:"Archivo"}]}]}]},full:{modes:["simple","advanced"],default:"simple"}},Ye={corporate:{background:"#FFFFFF",foreground:"#1E293B",accent:"#0891B2"},midnight:{background:"#0A0A0F",foreground:"#FFFFFF",accent:"#A100FF"},warm:{background:"#1A1A2E",foreground:"#F8F8F2",accent:"#FFD93D"}},wt=(t,n)=>["background","foreground","accent"].every(l=>t[l].toLowerCase()===n[l].toLowerCase());function ve(t){if(t.palette===void 0||t.palette==="skin")return"studio";for(const[n,l]of Object.entries(Ye))if(wt(t,l))return n;return"custom"}function Ie(t,n,l){const u=ve(t)==="studio"?l??n??t:t;return{background:u.background,foreground:u.foreground,accent:u.accent}}const Pe={inter:"Inter",roboto:"Roboto","source-sans":"Source Sans 3",plex:"IBM Plex Sans",system:"system-ui",archivo:"Archivo"};function le(t,n,l=null,u){const s=t.captions,v=t.theme;if(n==="captions")return{on:s.on,burn:s.burnIn,position:s.position,size:s.size,lines:s.maxLines,wrap:s.wrapChars,look:s.style};if(n==="theme"){const b=Ie(v,l,u),y=ve(v)==="studio"?u?.font??v.font:v.font;return{palette:ve(v),title:v.titleCard.on,titletext:v.titleCard.title,end:v.endCard.on,endtext:v.endCard.title,background:b.background,foreground:b.foreground,accent:b.accent,font:Object.keys(Pe).find(x=>Pe[x]===y)??"system"}}return{}}function At(t,n,l,u){const s=JSON.parse(JSON.stringify(t));if(n==="captions"){const v={on:"on",burn:"burnIn",position:"position",size:"size",lines:"maxLines",wrap:"wrapChars",look:"style"};Object.assign(s.captions,{[v[l]]:u})}else if(n==="theme")switch(l){case"title":s.theme.titleCard.on=u;break;case"titletext":s.theme.titleCard.title=u;break;case"end":s.theme.endCard.on=u;break;case"endtext":s.theme.endCard.title=u;break;case"font":s.theme.font=Pe[u],s.theme.palette="custom";break;case"palette":s.theme.palette=u==="studio"?"skin":"custom",(u==="corporate"||u==="midnight"||u==="warm")&&Object.assign(s.theme,Ye[u]);break;default:Object.assign(s.theme,{[l]:u,palette:"custom"})}return s}const I={actions:4,tabs:5,controls:12,options:8,labelChars:24,maxChars:200},Te=/^[a-z][a-z0-9-]{0,31}$/u,$t=/^[A-Za-z0-9 ·'-]{1,24}$/u,Ct=["approve","accept","deliver","merge","send","launch","delete","remove","stop","deny","allow","grant","install"],Et={а:"a",е:"e",о:"o",р:"p",с:"c",у:"y",х:"x",і:"i",ј:"j",ѕ:"s","ԁ":"d","ӏ":"l",α:"a",ε:"e",ο:"o",ρ:"p",ν:"v",τ:"t",κ:"k",ι:"i",μ:"m",0:"o",1:"l",3:"e",4:"a",5:"s",7:"t"};function Lt(t){const n=t.normalize("NFKD").replace(/\p{M}+/gu,"").toLowerCase();let l="";for(const u of n)l+=Et[u]??u;return l.split(/[^a-z]+/u).filter(u=>u!=="")}function Tt(t){return Lt(t).some(n=>Ct.some(l=>n.startsWith(l)))}const ee=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),Fe=t=>typeof t=="number"&&Number.isFinite(t),m=t=>({ok:!1,reason:t}),Ft=/(?:[A-Za-z][0-9]|[0-9][A-Za-z])/u;function Me(t,n){return typeof t!="string"||!$t.test(t)?`${n}: a label is 1 to ${I.labelChars} plain characters`:Ft.test(t)?`${n}: a word in a label is letters or digits, not both`:Tt(t)?`${n}: "${t}" uses a word only the host's own controls may use`:null}function Oe(t,n){const l=new Set;for(const u of t){if(l.has(u.id))return`${n}: the id "${u.id}" is used twice`;l.add(u.id)}return null}const te=(t,n,l)=>{for(const u of Object.keys(t))if(!n.includes(u))return`${l}: unknown field "${u}"`;return null};function Mt(t,n){if(!ee(t))return m(`${n}: not an object`);const l=te(t,["id","label","type","options","min","max","step","maxChars"],n);if(l!==null)return m(l);if(typeof t.id!="string"||!Te.test(t.id))return m(`${n}: a bad id`);const u=Me(t.label,n);if(u!==null)return m(u);const s=t.type;if(s!=="toggle"&&s!=="segmented"&&s!=="select"&&s!=="color"&&s!=="text"&&s!=="range")return m(`${n}: an unknown control type`);const v={id:t.id,label:t.label,type:s};if(s==="segmented"||s==="select"){const b=t.options;if(!Array.isArray(b)||b.length<2||b.length>I.options)return m(`${n}: ${s} needs 2 to ${I.options} options`);const y=[];for(const[W,k]of b.entries()){if(!ee(k)||typeof k.id!="string"||!Te.test(k.id))return m(`${n}.options[${W}]: a bad id`);const w=Me(k.label,`${n}.options[${W}]`);if(w!==null)return m(w);const $=te(k,["id","label"],`${n}.options[${W}]`);if($!==null)return m($);y.push({id:k.id,label:k.label})}const x=Oe(y,`${n}.options`);if(x!==null)return m(x);v.options=y}else if(t.options!==void 0)return m(`${n}: only select and segmented take options`);if(s==="range"){const{min:b,max:y,step:x}=t;if(!Fe(b)||!Fe(y)||!Fe(x))return m(`${n}: range needs finite min, max and step`);if(!(b<y)||!(x>0)||x>y-b)return m(`${n}: range needs min < max and 0 < step ≤ max - min`);if(Math.abs(b)>1e9||Math.abs(y)>1e9||x<1e-6||(y-b)/x>1e6)return m(`${n}: range bounds are within ±1e9, step ≥ 1e-6, at most 1e6 steps`);if(x<Math.max(Math.abs(b),Math.abs(y))*1e-12)return m(`${n}: range step is too fine for its bounds`);v.min=b,v.max=y,v.step=x}else if(t.min!==void 0||t.max!==void 0||t.step!==void 0)return m(`${n}: only range takes min, max and step`);if(s==="text"){const b=t.maxChars===void 0?I.maxChars:t.maxChars;if(!Number.isInteger(b)||b<1||b>I.maxChars)return m(`${n}: maxChars is 1 to ${I.maxChars}`);v.maxChars=b}else if(t.maxChars!==void 0)return m(`${n}: only text takes maxChars`);return{ok:!0,value:v}}function Ot(t){if(!ee(t))return m("surfaces: not an object");const n=te(t,["card","options","full"],"surfaces");if(n!==null)return m(n);const l=t.card;if(!ee(l))return m("surfaces.card is required");const u=te(l,["interactive","aspect","actions"],"surfaces.card");if(u!==null)return m(u);const s=l.interactive===void 0?!1:l.interactive;if(typeof s!="boolean")return m("surfaces.card.interactive: a boolean");const v=l.aspect===void 0?"16:9":l.aspect;if(v!=="16:9"&&v!=="4:3"&&v!=="auto")return m("surfaces.card.aspect: 16:9, 4:3 or auto");const b=l.actions===void 0?[]:l.actions;if(!Array.isArray(b)||b.length>I.actions)return m(`surfaces.card.actions: at most ${I.actions}`);const y=[];for(const[w,$]of b.entries()){const L=`surfaces.card.actions[${w}]`;if(!ee($))return m(`${L}: not an object`);const F=te($,["id","label","primary","verb"],L);if(F!==null)return m(F);if(typeof $.id!="string"||!Te.test($.id))return m(`${L}: a bad id`);const o=Me($.label,L);if(o!==null)return m(o);const A=$.verb;if(A!=="plugin"&&A!=="host:export"&&A!=="host:ask")return m(`${L}: verb is plugin, host:export or host:ask`);const N=$.primary===void 0?!1:$.primary;if(typeof N!="boolean")return m(`${L}: primary is a boolean`);y.push({id:$.id,label:$.label,primary:N,verb:A})}const x=Oe(y,"surfaces.card.actions");if(x!==null)return m(x);let W=null;if(t.options!==void 0){const w=t.options;if(!ee(w))return m("surfaces.options: not an object");const $=te(w,["tabs"],"surfaces.options");if($!==null)return m($);const L=w.tabs;if(!Array.isArray(L)||L.length<1||L.length>I.tabs)return m(`surfaces.options.tabs: 1 to ${I.tabs}`);const F=[];for(const[A,N]of L.entries()){const O=`surfaces.options.tabs[${A}]`;if(!ee(N))return m(`${O}: not an object`);const B=te(N,["id","label","render","controls"],O);if(B!==null)return m(B);if(typeof N.id!="string"||!Te.test(N.id))return m(`${O}: a bad id`);const H=Me(N.label,O);if(H!==null)return m(H);const U=N.render;if(U!=="plugin"&&U!=="controls")return m(`${O}: render is plugin or controls`);const oe={id:N.id,label:N.label,render:U};if(U==="controls"){const ae=N.controls;if(!Array.isArray(ae)||ae.length<1||ae.length>I.controls)return m(`${O}.controls: 1 to ${I.controls}`);const K=[];for(const[ye,R]of ae.entries()){const X=Mt(R,`${O}.controls[${ye}]`);if(!X.ok)return X;K.push(X.value)}const ne=Oe(K,`${O}.controls`);if(ne!==null)return m(ne);oe.controls=K}else if(N.controls!==void 0)return m(`${O}: a plugin-rendered tab has no controls`);F.push(oe)}const o=Oe(F,"surfaces.options.tabs");if(o!==null)return m(o);W={tabs:F}}let k=null;if(t.full!==void 0){const w=t.full;if(!ee(w))return m("surfaces.full: not an object");const $=te(w,["modes","default"],"surfaces.full");if($!==null)return m($);let L=null;if(w.modes!==void 0){const o=w.modes;if(!Array.isArray(o)||o.length!==2||o[0]!=="simple"||o[1]!=="advanced")return m('surfaces.full.modes: exactly ["simple","advanced"]');L=["simple","advanced"]}const F=w.default===void 0?"simple":w.default;if(F!=="simple"&&F!=="advanced")return m("surfaces.full.default: simple or advanced");if(L===null&&w.default!==void 0)return m("surfaces.full.default needs modes");k={modes:L,default:F}}return{ok:!0,value:{card:{interactive:s,aspect:v,actions:y},options:W,full:k}}}const Qe=String.raw`(?:\d{1,3}(?:\.\d+)?%?|\.\d+%?)`,Rt=new RegExp(String.raw`^(?:#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgba?|hsla?)\(\s*${Qe}(?:\s*,\s*${Qe}){2,3}\s*\))$`,"iu");function Nt(t,n){switch(t.type){case"toggle":return typeof n=="boolean";case"segmented":case"select":return typeof n=="string"&&(t.options??[]).some(l=>l.id===n);case"color":return typeof n=="string"&&n.length<=64&&Rt.test(n);case"text":return typeof n=="string"&&n.length<=(t.maxChars??I.maxChars)&&!/[\r\n]/u.test(n);case"range":{if(!Fe(n)||t.min===void 0||t.max===void 0||t.step===void 0||n<t.min||n>t.max)return!1;const l=Math.round((n-t.min)/t.step);return Math.abs(n-(t.min+l*t.step))<=t.step*.001}}}const Ue=Ot(Je);if(!Ue.ok)throw new Error(Ue.reason);const jt=Ue.value;function et(){document.body.insertAdjacentHTML("afterbegin",`<main id="video-editor" class="video-editor" data-testid="video-editor" tabindex="0">
|
|
19
|
+
<aside id="chapters" class="chapters"><h2>Chapters</h2><ol id="chapter-list"></ol><div id="editor-fields" class="editor-fields"></div></aside>
|
|
18
20
|
<section id="work" class="work"><div class="player"><video id="player" data-testid="video-player" playsinline preload="metadata" aria-label="Video"></video><div id="unavailable" class="unavailable">The video isn't available here</div><img id="poster" data-testid="video-poster" class="poster" alt="" hidden><div id="caption" class="caption"></div></div>
|
|
19
21
|
<div class="transport"><button id="play" data-testid="video-play" type="button">Play</button><span id="count"></span></div><div id="chips" class="chips" aria-label="Chapter chips"></div><div id="timeline" class="timeline" aria-label="Chapter timeline"></div><p id="status" class="status" role="status"></p></section>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
${
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
<section id="review-tab" class="review-tab" data-testid="video-review" hidden><h2>Review</h2><p id="review-line" class="summary" data-testid="video-review-line"></p><ol id="review-findings" class="findings" aria-label="Findings"></ol><div id="review-sheets" class="sheets" aria-label="Contact sheets"></div></section>
|
|
23
|
+
<aside id="inspectors" class="inspectors"><section id="proof"><h2>Checks</h2><p id="proof-summary" class="summary"></p><ol id="check-list" aria-label="Checks"></ol></section><h2>Text</h2><textarea id="say" aria-label="Chapter caption text" readonly></textarea><h2>Theme</h2><p id="theme-summary" class="summary"></p></aside></main>`);const t=e=>document.getElementById(e),n=t("video-editor"),l=t("chapter-list"),u=t("editor-fields"),s=t("player"),v=t("chips"),b=t("timeline"),y=t("caption");let x=null,W=null,k="card",w="simple",$="chapters",L=1,F=[],o=null,A=null,N=0,O=!1,B=!1,H=null,U=null,oe="",ae=0,K=null,ne=0,ye=0,R=!1,X=null,ge=!1,tt=null,ke=[],ze=0;const ce=new Map,Re=(e,i)=>x?.postMessage({p:V,v:_,type:e,payload:i}),de=(e,i)=>new Promise(r=>{if(x===null||B){r({ok:!1,error:{code:"unavailable",message:"No host here."}});return}const c=`wv-${++N}`,d=setTimeout(()=>{ce.delete(c),r({ok:!1,error:{code:"timeout",message:"The host has not answered; check Versions."}})},1e4);ce.set(c,{resolve:r,timer:d}),x.postMessage({p:V,v:_,type:e,id:c,payload:i})}),Se=()=>o?.chapters.find(e=>e.id===A),De=e=>o?.chapters.find(i=>i.startSec>=0&&e>=i.startSec&&(i.durationSec<0||e<i.startSec+i.durationSec)),nt=e=>e!==void 0&&e.startSec>=0&&o!==null&&o.style.captions.on&&(R||!(o.style.captions.burnIn&&o.ffmpeg?.burnIn)),z=()=>F.includes("artifact.write")&&!O&&!B,ue=()=>k==="options"||w==="advanced",Ne=e=>{t("status").textContent=e,Re("ui.status",{line:e.replace(/[\r\n]/g," ").slice(0,120)})},Be=()=>{if(L===2&&o!==null)for(const e of["captions","theme"])W?.values(e,le(o.style,e,J,o.resolvedTheme))};let J=null;const Ke=e=>{if(typeof e!="string"||e===""||e.length>200||/url\(/i.test(e))return null;const i=document.createElement("span");i.style.color=e,document.body.append(i);const r=getComputedStyle(i).color;return i.remove(),/^rgba?\(\s*\d/.test(r)?r.replace(/\s+/g," "):null},it=e=>{if(typeof e!="object"||e===null)return;const i=e,r=Ke(i["--surface-raised"]??i["--surface-base"]),c=Ke(i["--ink-high"]),d=Ke(i["--accent"]);r!==null&&c!==null&&d!==null&&(J={background:r,foreground:c,accent:d});for(const[a,p]of Object.entries(e))typeof p=="string"&&/^--[a-z0-9-]+$/.test(a)&&p.length<=200&&!/url\(/i.test(p)&&document.documentElement.style.setProperty(a,p)},qe=()=>{K!==null&&URL.revokeObjectURL(K),K=null,s.removeAttribute("src")};let q=null;async function It(e){const i=await de("artifact.media",{ref:"poster"});if(B||e!==ne)return;const r=i.payload?.blob,c=i.payload?.type,d=t("poster");if(q!==null&&(URL.revokeObjectURL(q),q=null),!i.ok||!(r instanceof Blob)||typeof c!="string"||!c.startsWith("image/")||typeof URL.createObjectURL!="function"){d.hidden=!0;return}q=URL.createObjectURL(r),d.src=q,d.alt=o?.proof?.verdict==="FAIL"?"The moment the walkthrough failed":"The recording's still",d.hidden=!1,t("unavailable").textContent=o?.proof?.verdict==="FAIL"?"No video: this is the moment it failed":"The video isn't available here"}async function ie(e="video",i){const r=++ne;if(ge=!0,!F.includes("media.read")){ge=!1,qe(),t("unavailable").hidden=!1;return}const c=await de("artifact.media",{ref:e});if(B||r!==ne)return;qe();const d=c.payload?.blob,a=c.payload?.type;if(!c.ok||!(d instanceof Blob)||typeof a!="string"||!a.startsWith("video/")||typeof URL.createObjectURL!="function"){ge=!1,t("unavailable").hidden=!1,It(r);return}t("poster").hidden=!0,q!==null&&(URL.revokeObjectURL(q),q=null,t("poster").removeAttribute("src")),K=URL.createObjectURL(d),s.src=K,t("unavailable").hidden=!0,_e(),s.onloadedmetadata=()=>{if(!(B||r!==ne)){if(ge=!1,!R&&o!==null&&Number.isFinite(s.duration)){for(const[p,f]of o.chapters.entries())if(f.startSec>=0&&f.durationSec<0){const g=o.chapters.slice(p+1).find(S=>S.startSec>=0)?.startSec??s.duration;f.durationSec=Math.max(0,g-f.startSec),f.outSec=f.inSec+f.durationSec}C()}if(s.currentTime=X??i??(R?Se()?.inSec??0:Math.max(0,Se()?.startSec??0)),X!==null){X=null;const p=De(s.currentTime);p!==void 0&&(A=p.id),C()}}}}const Y=(e,i,r)=>{const c=document.createElement("button");return c.type="button",c.textContent=e,c.onclick=i,r!==void 0&&(c.dataset.testid=r),c};function pe(e,i=!0){o?.chapters.some(r=>r.id===e&&r.startSec>=0)&&(X=null,A=e,R&&(R=!1,ie()),s.currentTime=Se()?.startSec??0,C(),i&&F.includes("selection.chip")&&Re("selection.set",{anchors:[{kind:"chapter",id:e}]}))}function Pt(e){if(!Number.isFinite(e)||e<0||(X=e,o===null))return;const i=De(e);i!==void 0&&(A=i.id),R?(R=!1,ie()):!ge&&K!==null&&s.readyState>=1&&(s.currentTime=e,X=null),C()}function Ve(e,i){const r=o?.chapters??[],c=r.findIndex(p=>p.id===e),d=c+i;if(d<0||d>=r.length)return;const a=r.filter(p=>p.id!==e);se({op:"chapter-move",chapter:e,after:d===0?null:a[d-1].id})}async function fe(){const e=++ye,i=await de("artifact.read",{});if(B||e!==ye)return!1;const r=i.payload?.content;if(!i.ok||r?.type!=="demo-cut"||!Array.isArray(r.chapters))return Ne(i.error?.message??"No cut is available here."),!1;if(o!==null&&r.version<o.version)return!1;const c=o?.version;return o=r,c!==o.version&&(R=!1),o.chapters.some(d=>d.id===A&&d.startSec>=0)||(A=o.chapters.find(d=>d.startSec>=0)?.id??null),C(),Be(),k!=="options"&&c!==o.version&&ie(),!0}async function se(e,i=o?.version){if(!(!z()||o===null||i===void 0)){O=!0,C();try{const r=await de("version.write",{base:i,ops:[e],summary:`chapter ${o.chapters.findIndex(c=>c.id===e.chapter)+1}`});r.ok?(await fe(),e.op==="chapter-take"&&k!=="options"&&(R=!0,ie({chapter:e.chapter}))):(Ne(r.error?.message??"The chapter could not be saved."),r.error?.code==="head_moved"&&await fe())}finally{O=!1,C()}}}function ot(e){if(!z()||o===null||U!==null)return;U=e.id,oe=e.title,ae=o.version,C();const i=u.querySelector('[data-testid="video-rename-input"]');i?.focus(),i?.select()}function Ut(){const e=o?.chapters.find(r=>r.id===U);if(e===void 0)return U=null,null;const i=document.createElement("input");return i.value=oe,i.maxLength=80,i.setAttribute("aria-label","Chapter title"),i.dataset.testid="video-rename-input",i.oninput=()=>{oe=i.value},i.onkeydown=r=>{r.key==="Escape"?(r.preventDefault(),r.stopPropagation(),U=null,C()):r.key==="Enter"&&(r.preventDefault(),r.stopPropagation(),U=null,i.value.trim()&&!/[\r\n]/.test(i.value)&&i.value!==e.title?se({op:"chapter-rename",chapter:e.id,title:i.value},ae):C())},i}function _e(){if(o===null)return;const e=o.style,i=Se();y.hidden=!nt(i),y.dataset.position=e.captions.position,y.dataset.look=e.captions.style;const r=[];let c="";for(const p of(i?.say??"").split(/\s+/))c&&(c+" "+p).length>e.captions.wrapChars?(r.push(c),c=p):c+=(c?" ":"")+p;c&&r.push(c),y.textContent=r.slice(0,e.captions.maxLines).join(`
|
|
24
|
+
`),y.style.fontSize=`max(9px, ${e.captions.size/19.2}cqw)`,y.style.maxHeight=`${e.captions.maxLines*1.3+.8}em`;const d=Ie(e.theme,J,o.resolvedTheme),a={background:d.background,foreground:d.foreground,accent:d.accent,font:ve(e.theme)==="studio"?o.resolvedTheme?.font??e.theme.font:e.theme.font};for(const[p,f]of Object.entries(a))n.style.setProperty(`--video-${p}`,f)}function at(e,i){const r=Y("",()=>{},`video-trim-${i}`);r.className="trim-handle",r.dataset.edge=i,r.setAttribute("role","slider"),r.setAttribute("aria-label",`${i==="in"?"In":"Out"} trim`);const c=o?.takes[e.id]?.find(a=>a.file===e.take)?.durationSec??e.outSec;r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax",String(c)),r.setAttribute("aria-valuenow",String(i==="in"?e.inSec:e.outSec));const d=e.durationSec<=0||e.outSec-e.inSec<=0;return r.disabled=!z()||d,r.onpointerdown=a=>{if(!z()||o===null||d)return;a.preventDefault(),a.stopPropagation();const p=o.version,f=a.clientX,g=r.parentElement.getBoundingClientRect().width||1;let S=e.inSec,j=e.outSec;const he=Q=>{const Ce=(Q-f)/g*e.durationSec;i==="in"?S=Math.max(0,Math.min(e.outSec-.5,e.inSec+Ce)):j=Math.max(e.inSec+.5,Math.min(c,e.outSec+Ce)),r.setAttribute("aria-valuenow",(i==="in"?S:j).toFixed(2));const Ee=u.querySelector(`[data-testid="video-${i}"]`);Ee&&(Ee.value=(i==="in"?S:j).toFixed(2))},xe=Q=>he(Q.clientX),we=Q=>{he(Q.clientX),Ae(),(S!==e.inSec||j!==e.outSec)&&se({op:"chapter-trim",chapter:e.id,inSec:S,outSec:j},p)},Ae=()=>{window.removeEventListener("pointermove",xe),window.removeEventListener("pointerup",we),window.removeEventListener("pointercancel",$e)},$e=()=>{Ae(),C()};window.addEventListener("pointermove",xe),window.addEventListener("pointerup",we),window.addEventListener("pointercancel",$e,{once:!0})},r.onkeydown=a=>{if(!z()||d||!["ArrowLeft","ArrowRight"].includes(a.key))return;a.preventDefault(),a.stopPropagation();const p=a.key==="ArrowLeft"?-.1:.1,f=i==="in"?Math.max(0,Math.min(e.outSec-.5,e.inSec+p)):e.inSec,g=i==="out"?Math.max(e.inSec+.5,Math.min(c,e.outSec+p)):e.outSec;(f!==e.inSec||g!==e.outSec)&&se({op:"chapter-trim",chapter:e.id,inSec:f,outSec:g})},r}function zt(){const e=o?.proof,i=t("check-list");if(i.replaceChildren(),t("proof").hidden=e===void 0,e===void 0||o===null)return;t("proof-summary").textContent=`${e.verdict??"Pending"}${e.failedAtSec===null?"":` · Failed at ${e.failedAtSec.toFixed(1)}s`}`;const r=!R&&Number.isFinite(s.duration)&&s.duration>0?s.duration:Math.max(1,...o.chapters.filter(a=>a.startSec>=0).map(a=>a.startSec+Math.max(0,a.durationSec)),...e.checks.map(a=>a.atSec??0),e.failedAtSec??0),c=document.createElement("div");c.className="check-track",c.setAttribute("aria-label","Check timeline");const d=(a,p,f,g)=>{if(a<0||!Number.isFinite(a)||r<=0)return;const S=Y(p==="FAIL"?"✗":p==="PASS"?"✓":"·",()=>{R&&(R=!1,ie("video",a)),s.currentTime=a,s.dispatchEvent(new Event("timeupdate"))},g);S.className="check-mark",S.dataset.state=p,S.dataset.sec=String(a),S.style.left=`${Math.min(100,a/r*100)}%`,S.title=`${a.toFixed(1)}s · ${f}`,S.setAttribute("aria-label",S.title),c.append(S)};for(const a of e.checks){const p=o.chapters.find(S=>S.id===a.chapter)?.title??a.chapter,f=`${a.state} · ${p} · ${a.text}`,g=document.createElement("li");g.dataset.testid="video-check",g.dataset.state=a.state,g.textContent=`${f}${a.atSec===null?"":` · ${a.atSec.toFixed(1)}s`}`,i.append(g),a.atSec!==null&&d(a.atSec,a.state,f,"video-check-mark")}e.failedAtSec!==null&&!e.checks.some(a=>a.state==="FAIL"&&a.atSec===e.failedAtSec)&&d(e.failedAtSec,"FAIL","Failed","video-failure-mark"),b.dataset.proof=String(c.childElementCount>0),b.append(c)}function Dt(){const e=t("review-tab");if(e.hidden=k!=="options"||$!=="sheets",e.hidden||o===null)return;const i=o.review;t("review-line").textContent=i?.line??"This is an edited cut. The take’s own review is on its run.";const r=t("review-findings");r.replaceChildren();for(const d of o.proof?.checks??[]){const a=document.createElement("li");a.dataset.testid="video-finding",a.dataset.state=d.state;const p=o.chapters.find(g=>g.id===d.chapter)?.title,f=d.atSec===null?null:Math.max(0,Math.round(d.atSec));a.textContent=`${f===null?"":`${Math.floor(f/60)}:${String(f%60).padStart(2,"0")} · `}${p===void 0?"":`${p} · `}${d.text}`,r.append(a)}const c=`${o.version}|${(i?.sheets??[]).map(d=>d.name).join(",")}`;tt!==c&&(tt=c,Bt(i?.sheets??[]))}async function Bt(e){const i=++ze,r=t("review-sheets");for(const c of ke)URL.revokeObjectURL(c);if(ke=[],r.replaceChildren(),e.length===0){const c=document.createElement("p");c.className="hint",c.textContent="No contact sheets yet.",r.append(c);return}if(F.includes("media.read"))for(const c of e){const d=document.createElement("figure");d.className="sheet",d.dataset.testid="video-sheet",d.dataset.sheet=c.name;const a=document.createElement("figcaption");a.textContent=c.label,d.append(a),r.append(d);const p=await de("artifact.media",{ref:{sheet:c.name}});if(B||i!==ze)return;const f=p.payload?.blob,g=p.payload?.type;if(!p.ok||!(f instanceof Blob)||typeof g!="string"||!g.startsWith("image/")||typeof URL.createObjectURL!="function"){a.textContent=`${c.label} · not available`;continue}const S=URL.createObjectURL(f);ke.push(S);const j=document.createElement("img");j.src=S,j.alt=c.label,d.prepend(j)}}function C(){const e=document.activeElement,i=u.querySelector('[data-testid="video-rename-input"]');i!==null&&(oe=i.value);const r=e===i,c=i?.selectionStart,d=i?.selectionEnd,a=e?.dataset.chapter,p=e?.dataset.testid;if(n.dataset.surface=k,n.dataset.mode=w,n.dataset.head=String(o?.version??0),n.dataset.current=A??"",t("chapters").hidden=k==="card"||k==="options"&&$!=="chapters",t("work").hidden=k==="options",t("inspectors").hidden=k!=="full"||w!=="advanced",Dt(),b.hidden=k!=="full",v.hidden=k!=="card",l.replaceChildren(),v.replaceChildren(),b.replaceChildren(),u.replaceChildren(),b.dataset.proof="false",o===null)return;if(U!==null){const h=Ut();h!==null&&(u.prepend(h),r&&(h.focus(),h.setSelectionRange(c??null,d??null)))}o.chapters.forEach((h,E)=>{const P=document.createElement("li"),M=Y("",()=>pe(h.id),"video-chapter");M.className="chapter",M.dataset.chapter=h.id,M.disabled=h.startSec<0,M.disabled&&(M.title="Not in this recording");const T=document.createElement("span");T.className="number",T.textContent=String(E+1);const je=document.createElement("span");je.textContent=h.title;const He=document.createElement("span");if(He.className="duration",He.textContent=h.durationSec<0?"—":`${h.durationSec.toFixed(1)}s`,M.append(T,je,He),M.setAttribute("aria-current",String(h.id===A)),M.setAttribute("aria-label",`Chapter ${E+1}: ${h.title}`),h.verdict==="PASS"||h.verdict==="FAIL"){const D=document.createElement("span");D.className="chapter-verdict",D.dataset.verdict=h.verdict,D.textContent=h.verdict==="PASS"?"✓":"✗",D.setAttribute("aria-label",h.verdict),M.append(D)}M.ondblclick=()=>{ue()&&ot(h)},P.draggable=ue()&&z(),P.ondragstart=D=>{H=h.id,D.dataTransfer?.setData("text/plain",h.id)},P.ondragover=D=>{ue()&&z()&&D.preventDefault()},P.ondrop=D=>{if(D.preventDefault(),H===null||H===h.id||!ue())return;const ut=o.chapters.filter(Xe=>Xe.id!==H),pt=ut.findIndex(Xe=>Xe.id===h.id),ft=P.getBoundingClientRect(),qt=D.clientY>=ft.top+ft.height/2?h.id:pt===0?null:ut[pt-1].id;se({op:"chapter-move",chapter:H,after:qt}),H=null},P.ondragend=()=>{H=null},P.append(M),l.append(P);const me=Y(`${E+1} · ${h.title}`,()=>pe(h.id),"video-chip");me.className="chip",me.setAttribute("aria-current",String(h.id===A)),v.append(me),me.disabled=h.startSec<0,me.disabled&&(me.title="Not in this recording");const Le=document.createElement("div");Le.className="segment-box",Le.style.flex=String(h.durationSec<0?1:h.durationSec);const be=Y(`${E+1} · ${h.title}`,()=>pe(h.id),"video-segment");be.className="segment",be.setAttribute("aria-current",String(h.id===A)),Le.append(be),be.disabled=h.startSec<0,be.disabled&&(be.title="Not in this recording"),w==="advanced"&&h.id===A&&Le.append(at(h,"in"),at(h,"out")),b.append(Le)}),zt();const f=Se();t("count").textContent=f===void 0?"No chapters":`${o.chapters.findIndex(h=>h.id===f.id)+1} of ${o.chapters.length}`,t("say").value=f?.say??"";const g=o.style.theme,S=Ie(g,J,o.resolvedTheme),j=ve(g);if(t("theme-summary").textContent=`${j==="studio"?"Studio skin (default)":j==="custom"?"Custom colours":"Preset: "+j}
|
|
25
|
+
${j==="studio"?o.resolvedTheme?.font??g.font:g.font}
|
|
26
|
+
Background ${S.background}
|
|
27
|
+
Text ${S.foreground}
|
|
28
|
+
Accent ${S.accent}
|
|
29
|
+
Title card: ${g.titleCard.on?g.titleCard.title:"Off"}
|
|
30
|
+
End card: ${g.endCard.on?g.endCard.title:"Off"}`,_e(),a!==void 0&&Array.from(l.querySelectorAll("[data-chapter]")).find(h=>h.dataset.chapter===a)?.focus(),!ue()||k==="card"||f===void 0)return;const he=document.createElement("div");he.className="buttons";const xe=Y("Rename",()=>ot(f),"video-rename"),we=Y("Move up",()=>Ve(f.id,-1),"video-move-up"),Ae=Y("Move down",()=>Ve(f.id,1),"video-move-down");xe.disabled=!z(),we.disabled=!z()||o.chapters[0]?.id===f.id,Ae.disabled=!z()||o.chapters.at(-1)?.id===f.id,he.append(xe,we,Ae),u.append(he);const $e=o.version,Q=document.createElement("div");Q.className="trim-fields";const Ce=(h,E,P)=>{const M=document.createElement("label");M.textContent=h;const T=document.createElement("input");return T.type="number",T.step="0.1",T.min="0",T.value=String(E),T.dataset.testid=P,T.setAttribute("aria-label",h),T.disabled=!z(),T.max=String(o.takes[f.id]?.find(je=>je.file===f.take)?.durationSec??f.outSec),M.append(T),Q.append(M),T},Ee=Ce("In (seconds)",f.inSec,"video-in"),We=Ce("Out (seconds)",f.outSec,"video-out"),ct=()=>{const h=Ee.valueAsNumber,E=We.valueAsNumber;if(!(h===f.inSec&&E===f.outSec)){if(!Number.isFinite(h)||!Number.isFinite(E)||h<0||E-h<.5||E>Number(We.max)){Ne("Keep at least 0.5 seconds within this take.");return}se({op:"chapter-trim",chapter:f.id,inSec:h,outSec:E},$e)}};Ee.onchange=ct,We.onchange=ct,u.append(Q);const dt=o.takes[f.id]??[];if(dt.length>1){const h=document.createElement("label");h.textContent="Take";const E=document.createElement("select");E.setAttribute("aria-label","Take"),E.dataset.testid="video-take",E.disabled=!z(),dt.forEach((P,M)=>{const T=document.createElement("option");T.value=P.file,T.textContent=`Take ${M+1} · ${P.durationSec.toFixed(1)}s`,E.append(T)}),E.value=f.take,E.onchange=()=>{E.value!==f.take&&se({op:"chapter-take",chapter:f.id,take:E.value},$e)},h.append(E),u.append(h),k!=="options"&&u.append(Y("Preview take",()=>{R=!0,ie({chapter:f.id})},"video-preview-take"))}if(p!==void 0&&!p.includes("rename-input")){const h=n.querySelector(`[data-testid="${p}"]`);h&&!h.disabled&&!h.closest("[hidden]")&&h.focus()}}async function Kt(e,i,r){const c=jt.options?.tabs.find(d=>d.id===e)?.controls?.find(d=>d.id===i);if(o===null||c===void 0||!Nt(c,r)||!F.includes("artifact.theme")||typeof r=="string"&&/[\r\n]/.test(r))return{applied:!1,values:o===null?{}:le(o.style,e,J,o.resolvedTheme),reason:"That style change is not available."};if(O)return{applied:!1,values:le(o.style,e,J,o.resolvedTheme),reason:"A cut is being saved."};O=!0,C();try{for(let d=0;d<2;d++){const a=At(o.style,e,i,r),p=await de("theme.set",{base:o.version,tokens:{kind:"video-style",style:a}});if(p.ok){const f=await fe();return{applied:f,values:le(o.style,e,J,o.resolvedTheme),...f?{}:{reason:"The saved style could not be read."}}}if(!(p.error?.code==="head_moved"&&d===0&&await fe()))return Be(),{applied:!1,values:le(o.style,e,J,o.resolvedTheme),reason:p.error?.message??"Style was not changed."}}return{applied:!1,values:le(o.style,e,J,o.resolvedTheme)}}finally{O=!1,C()}}const st=()=>{t("play").textContent=s.paused?"Play":"Pause"};s.onplay=st,s.onpause=st,t("play").onclick=()=>{K!==null&&(s.paused?s.play().catch(()=>Ne("The video isn't available here")):s.pause())},s.onerror=()=>{t("unavailable").hidden=!1},s.ontimeupdate=()=>{if(o===null||R)return;const e=De(s.currentTime);e!==void 0&&e.id!==A&&(A=e.id,C()),y.hidden=!nt(e)},n.onkeydown=e=>{const i=e.target,r=e.metaKey||e.ctrlKey;if(!St(e,n,c=>Re("ui.key",{key:c}))&&!i.closest("input,textarea,select")&&e.key!=="Tab"){if(e.altKey&&!r&&["ArrowUp","ArrowDown"].includes(e.key)&&ue()&&A!==null){e.preventDefault(),Ve(A,e.key==="ArrowUp"?-1:1);return}if(!(r||e.altKey)){if(["ArrowLeft","ArrowRight","Home","End"].includes(e.key)&&o!==null){e.preventDefault();const c=o.chapters.filter(f=>f.startSec>=0),d=c.findIndex(f=>f.id===A),a=e.key==="Home"?0:e.key==="End"?c.length-1:Math.max(0,Math.min(c.length-1,d+(e.key==="ArrowRight"?1:-1))),p=c[a];p&&pe(p.id);return}i.closest("button")&&[" ","Enter"].includes(e.key)||e.key.length===1&&(e.preventDefault(),Re("ui.typed",{grapheme:e.key}))}}};function rt(){B=!0,++ne,++ye,++ze,qe(),q!==null&&(URL.revokeObjectURL(q),q=null);for(const e of ke)URL.revokeObjectURL(e);ke=[];for(const{timer:e,resolve:i}of ce.values())clearTimeout(e),i({ok:!1,error:{code:"unavailable",message:"Editor closed."}});ce.clear(),x?.close(),window.removeEventListener("message",lt)}function lt(e){const i=e.data;if(x!==null||i?.p!==V||i.v!==_||i.type!=="host.hello"||!e.ports[0])return;const r=yt(i.payload),c=i.payload;k=r.surface,w=r.mode??"simple",$=r.tab??"chapters",L=r.protocol,F=Array.isArray(c.grants)?c.grants.filter(d=>typeof d=="string"):[],it(c.theme),x=e.ports[0],W=new xt(x,{surface(d,a){const p=k;k=d,a!==null&&(w=a),C(),p==="options"&&d!=="options"&&ie()},mode(d){return w=d,C(),w},action(d){const a=o?.chapters.filter(S=>S.startSec>=0)??[];if(!["next","prev"].includes(d)||o===null||a.length===0)return{handled:!1};const p=a.findIndex(S=>S.id===A),f=Math.max(0,Math.min(a.length-1,p+(d==="next"?1:-1))),g=a[f];return pe(g.id),{handled:!0,status:`Chapter ${o.chapters.indexOf(g)+1} of ${o.chapters.length} · ${g.title}`}},tab(d){$=d,C()},selection(d){const a=d.find(p=>typeof p=="object"&&p!==null&&["chapter","time"].includes(p.kind));a?.kind==="time"&&typeof a.atSec=="number"?Pt(a.atSec):typeof a?.id=="string"&&pe(a.id,!1)},optionsChanged:Kt}),x.onmessage=d=>{const a=d.data;if(a?.p!==V||a.v!==_)return;if(typeof a.re=="string"){const f=ce.get(a.re);if(f===void 0)return;clearTimeout(f.timer),ce.delete(a.re),f.resolve({ok:a.ok===!0,...a.payload!==void 0?{payload:a.payload}:{},...a.error===void 0?{}:{error:a.error}});return}if(L===2&&W?.dispatch(a))return;const p=a.payload??{};switch(a.type){case"host.ping":a.id&&x?.postMessage({p:V,v:_,re:a.id,ok:!0,payload:{}});break;case"host.size":if(p.size==="inline"||p.size==="pane"||p.size==="full"){const f=k;k=L===1&&p.size==="pane"?"full":Ze(p.size),C(),f==="options"&&k!=="options"&&ie()}break;case"host.theme":it(p.theme),Be(),_e(),C();break;case"artifact.changed":(typeof p.head!="number"||o===null||p.head>o.version)&&fe();break;case"host.teardown":rt();break;case"selection.cleared":A=null,C();break}},x.start(),C(),fe()}window.addEventListener("message",lt),window.addEventListener("pagehide",rt,{once:!0}),C(),kt("wicked-video",Je)}return et(),G.start=et,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"}),G})({});
|
|
28
31
|
</script></body></html>
|
package/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>wicked-studio</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/assets/favicon-BJA6hF2f.svg" />
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DU_8o4uq.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CdbCAs7s.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|