SOURCE / PINNED RELEASE
Made of little things.
Comic Upload
- Release
- 31cb8fadd74a…
- Author-recorded commit
- Not provided
- License
- Check the original source
The hash-verified playable HTML, which may contain bundled or minified code. This view does not execute it.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Comic Upload</title>
<script type="module" crossorigin>function ut(){const e=new Map;function t(o,i){if(e.has(o))throw new Error(`NAP domain "${o}" is already registered`);e.set(o,i)}function r(o){const i=o.type.indexOf(".");if(i<=0)return!1;const s=o.type.slice(0,i),u=e.get(s);return u?(u(o),!0):!1}function n(){return Array.from(e.keys())}return{registerNap:t,dispatch:r,getRegisteredDomains:n}}var ct=ut(),ft=ct.registerNap,dt="theme";function Pe(){var t;const e=window;if(!((t=e.napplet)!=null&&t.theme))throw new Error("window.napplet.theme is unavailable -- runtime did not inject this domain");return e.napplet.theme}function mt(){return Pe().get()}function gt(e){return Pe().onChanged(e)}ft(dt,e=>{});function vt(){const e=window;if(!e.napplet)throw new Error("window.napplet is unavailable -- runtime did not inject the napplet namespace");return e.napplet}function p(e){const r=vt()[e];if(!r)throw new Error(`window.napplet.${String(e)} is unavailable -- runtime did not inject this domain`);return r}var Te={getPublicKey(){return p("identity").getPublicKey()},onChanged(e){return p("identity").onChanged(e)},getRelays(){return p("identity").getRelays()},getProfile(){return p("identity").getProfile()},getFollows(){return p("identity").getFollows()},getList(e){return p("identity").getList(e)},getZaps(){return p("identity").getZaps()},getMutes(){return p("identity").getMutes()},getBlocked(){return p("identity").getBlocked()},getBadges(){return p("identity").getBadges()}},ht={getEvent(e,t){return p("outbox").getEvent(e,t)},query(e,t){return p("outbox").query(e,t)},subscribe(e,t){return p("outbox").subscribe(e,t)},publish(e,t){return p("outbox").publish(e,t)},resolveRelays(e){return p("outbox").resolveRelays(e)}},me={info(){return p("upload").info()},upload(e){return p("upload").upload(e)},status(e){return p("upload").status(e)},onStatus(e){return p("upload").onStatus(e)}};const pt=/^#[0-9a-f]{6}$/i;function Me(e){return pt.test(e)}function V(e,t){if(!Me(e))throw new Error(`${t} must be a #rrggbb color`)}function W(e){return{r:Number.parseInt(e.slice(1,3),16),g:Number.parseInt(e.slice(3,5),16),b:Number.parseInt(e.slice(5,7),16)}}function ne(e){return Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0")}function Ne({r:e,g:t,b:r}){return`#${ne(e)}${ne(t)}${ne(r)}`}function bt({r:e,g:t,b:r}){const n=e/255,o=t/255,i=r/255,s=Math.max(n,o,i),u=Math.min(n,o,i),f=(s+u)/2;if(s===u)return{h:0,s:0,l:f};const d=s-u,h=f>.5?d/(2-s-u):d/(s+u);let l;return s===n?l=(o-i)/d+(o<i?6:0):s===o?l=(i-n)/d+2:l=(n-o)/d+4,{h:l*60,s:h,l:f}}function oe(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function yt({h:e,s:t,l:r}){if(t===0){const s=r*255;return{r:s,g:s,b:s}}const n=e/360,o=r<.5?r*(1+t):r+t-r*t,i=2*r-o;return{r:oe(i,o,n+1/3)*255,g:oe(i,o,n)*255,b:oe(i,o,n-1/3)*255}}function Be(e,t){const r=bt(W(e));return Ne(yt({...r,l:Math.max(0,Math.min(1,r.l+t))}))}function ie(e,t,r){const n=W(e),o=W(t);return Ne({r:n.r*(1-r)+o.r*r,g:n.g*(1-r)+o.g*r,b:n.b*(1-r)+o.b*r})}function Ae(e){const{r:t,g:r,b:n}=W(e),[o,i,s]=[t,r,n].map(u=>{const f=u/255;return f<=.03928?f/12.92:((f+.055)/1.055)**2.4});return .2126*o+.7152*i+.0722*s}function ae(e){return Ae(e)>.5?"#111827":"#ffffff"}function wt(e){return V(e.background,"background"),Ae(e.background)<=.56}function Ct(e){V(e.background,"background"),V(e.text,"text"),V(e.primary,"primary");const t=wt(e),r=Be(e.background,t?.05:-.04),n=Be(e.background,t?.1:-.08),o=ie(e.background,e.text,t?.18:.12),i=ie(e.background,e.primary,t?.26:.18),s=ie(e.primary,e.text,.22);return{"color-scheme":t?"dark":"light","--color-base-100":e.background,"--color-base-200":r,"--color-base-300":n,"--color-base-content":e.text,"--color-primary":e.primary,"--color-primary-content":ae(e.primary),"--color-secondary":i,"--color-secondary-content":e.text,"--color-accent":s,"--color-accent-content":ae(s),"--color-neutral":o,"--color-neutral-content":ae(o),"--color-info":t?"#38bdf8":"#0284c7","--color-info-content":t?"#082f49":"#ffffff","--color-success":t?"#22c55e":"#16a34a","--color-success-content":t?"#052e16":"#ffffff","--color-warning":t?"#facc15":"#d97706","--color-warning-content":t?"#422006":"#ffffff","--color-error":t?"#f87171":"#dc2626","--color-error-content":t?"#450a0a":"#ffffff"}}function Fe(e){return{...Ct(e),"--radius-selector":"0.25rem","--radius-field":"0.25rem","--radius-box":"0.375rem","--size-selector":"0.21875rem","--size-field":"0.21875rem","--border":"1px","--depth":"0","--noise":"0"}}const xt="napplet-runtime",St={background:"#14110c",text:"#f5f1e8",primary:"#9be564"};function se(e){document.documentElement.setAttribute("data-theme",xt);const t=document.documentElement.style;for(const[r,n]of Object.entries(e))t.setProperty(r,n)}function $e(e){var o,i;const t={},r=(i=(o=e.fonts)==null?void 0:o.body)==null?void 0:i.name;typeof r=="string"&&r.trim()&&(t["--gm-font-body"]=r);const n={background:e.colors.background,text:e.colors.text,primary:e.colors.primary};return Object.values(n).every(s=>typeof s=="string"&&Me(s))&&Object.assign(t,Fe(n)),t}function Lt(){se(Fe(St));const e=globalThis.napplet;if(!(e!=null&&e.theme))return{close:()=>{}};try{mt().then(r=>se($e(r))).catch(()=>{})}catch{}let t=null;try{t=gt(r=>se($e(r)))}catch{}return{close:()=>t==null?void 0:t.close()}}const kt=Lt;var w=Uint8Array,U=Uint16Array,Et=Int32Array,Oe=new w([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ue=new w([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),It=new w([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),je=function(e,t){for(var r=new U(31),n=0;n<31;++n)r[n]=t+=1<<e[n-1];for(var o=new Et(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)o[i]=i-r[n]<<5|n;return{b:r,r:o}},ze=je(Oe,2),Re=ze.b,Tt=ze.r;Re[28]=258,Tt[258]=28;var Bt=je(Ue,0),$t=Bt.b,fe=new U(32768);for(var g=0;g<32768;++g){var P=(g&43690)>>1|(g&21845)<<1;P=(P&52428)>>2|(P&13107)<<2,P=(P&61680)>>4|(P&3855)<<4,fe[g]=((P&65280)>>8|(P&255)<<8)>>1}var R=(function(e,t,r){for(var n=e.length,o=0,i=new U(t);o<n;++o)e[o]&&++i[e[o]-1];var s=new U(t);for(o=1;o<t;++o)s[o]=s[o-1]+i[o-1]<<1;var u;if(r){u=new U(1<<t);var f=15-t;for(o=0;o<n;++o)if(e[o])for(var d=o<<4|e[o],h=t-e[o],l=s[e[o]-1]++<<h,m=l|(1<<h)-1;l<=m;++l)u[fe[l]>>f]=d}else for(u=new U(n),o=0;o<n;++o)e[o]&&(u[o]=fe[s[e[o]-1]++]>>15-e[o]);return u}),D=new w(288);for(var g=0;g<144;++g)D[g]=8;for(var g=144;g<256;++g)D[g]=9;for(var g=256;g<280;++g)D[g]=7;for(var g=280;g<288;++g)D[g]=8;var De=new w(32);for(var g=0;g<32;++g)De[g]=5;var Pt=R(D,9,1),Mt=R(De,5,1),le=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},k=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(t&7)&r},ue=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},Nt=function(e){return(e+7)/8|0},ge=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new w(e.subarray(t,r))},At=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],y=function(e,t,r){var n=new Error(t||At[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,y),!r)throw n;return n},Ft=function(e,t,r,n){var o=e.length,i=n?n.length:0;if(!o||t.f&&!t.l)return r||new w(0);var s=!r,u=s||t.i!=2,f=t.i;s&&(r=new w(o*3));var d=function(ke){var Ee=r.length;if(ke>Ee){var Ie=new w(Math.max(Ee*2,ke));Ie.set(r),r=Ie}},h=t.f||0,l=t.p||0,m=t.b||0,x=t.l,A=t.d,N=t.m,I=t.n,K=o*8;do{if(!x){h=k(e,l,1);var G=k(e,l+1,3);if(l+=3,G)if(G==1)x=Pt,A=Mt,N=9,I=5;else if(G==2){var Q=k(e,l,31)+257,pe=k(e,l+10,15)+4,be=Q+k(e,l+5,31)+1;l+=14;for(var j=new w(be),J=new w(19),S=0;S<pe;++S)J[It[S]]=k(e,l+S*3,7);l+=pe*3;for(var ye=le(J),ot=(1<<ye)-1,it=R(J,ye,1),S=0;S<be;){var we=it[k(e,l,ot)];l+=we&15;var T=we>>4;if(T<16)j[S++]=T;else{var F=0,_=0;for(T==16?(_=3+k(e,l,3),l+=2,F=j[S-1]):T==17?(_=3+k(e,l,7),l+=3):T==18&&(_=11+k(e,l,127),l+=7);_--;)j[S++]=F}}var Ce=j.subarray(0,Q),$=j.subarray(Q);N=le(Ce),I=le($),x=R(Ce,N,1),A=R($,I,1)}else y(1);else{var T=Nt(l)+4,X=e[T-4]|e[T-3]<<8,Y=T+X;if(Y>o){f&&y(0);break}u&&d(m+X),r.set(e.subarray(T,Y),m),t.b=m+=X,t.p=l=Y*8,t.f=h;continue}if(l>K){f&&y(0);break}}u&&d(m+131072);for(var at=(1<<N)-1,st=(1<<I)-1,ee=l;;ee=l){var F=x[ue(e,l)&at],O=F>>4;if(l+=F&15,l>K){f&&y(0);break}if(F||y(2),O<256)r[m++]=O;else if(O==256){ee=l,x=null;break}else{var xe=O-254;if(O>264){var S=O-257,z=Oe[S];xe=k(e,l,(1<<z)-1)+Re[S],l+=z}var te=A[ue(e,l)&st],re=te>>4;te||y(3),l+=te&15;var $=$t[re];if(re>3){var z=Ue[re];$+=ue(e,l)&(1<<z)-1,l+=z}if(l>K){f&&y(0);break}u&&d(m+131072);var Se=m+xe;if(m<$){var Le=i-$,lt=Math.min($,Se);for(Le+m<0&&y(3);m<lt;++m)r[m]=n[Le+m]}for(;m<Se;++m)r[m]=r[m-$]}}t.l=x,t.p=ee,t.b=m,t.f=h,x&&(h=1,t.m=N,t.d=A,t.n=I)}while(!h);return m!=r.length&&s?ge(r,0,m):r.subarray(0,m)},Ot=new w(0),B=function(e,t){return e[t]|e[t+1]<<8},L=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},ce=function(e,t){return L(e,t)+L(e,t+4)*4294967296};function Ut(e,t){return Ft(e,{i:2},t&&t.out,t&&t.dictionary)}var de=typeof TextDecoder<"u"&&new TextDecoder,jt=0;try{de.decode(Ot,{stream:!0}),jt=1}catch{}var zt=function(e){for(var t="",r=0;;){var n=e[r++],o=(n>127)+(n>223)+(n>239);if(r+o>e.length)return{s:t,r:ge(e,r-1)};o?o==3?(n=((n&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|n>>10,56320|n&1023)):o&1?t+=String.fromCharCode((n&31)<<6|e[r++]&63):t+=String.fromCharCode((n&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(n)}};function Rt(e,t){if(t){for(var r="",n=0;n<e.length;n+=16384)r+=String.fromCharCode.apply(null,e.subarray(n,n+16384));return r}else{if(de)return de.decode(e);var o=zt(e),i=o.s,r=o.r;return r.length&&y(8),i}}var Dt=function(e,t){return t+30+B(e,t+26)+B(e,t+28)},Zt=function(e,t,r){var n=B(e,t+28),o=B(e,t+30),i=Rt(e.subarray(t+46,t+46+n),!(B(e,t+8)&2048)),s=t+46+n,u=qt(e,s,o,r,L(e,t+20),L(e,t+24),L(e,t+42)),f=u[0],d=u[1],h=u[2];return[B(e,t+10),f,d,i,s+o+B(e,t+32),h]},qt=function(e,t,r,n,o,i,s){var u=o==4294967295,f=i==4294967295,d=s==4294967295,h=t+r,l=u+f+d;if(n&&l){for(;t+4<h;t+=4+B(e,t+2))if(B(e,t)==1)return[u?ce(e,t+4+8*f):o,f?ce(e,t+4):i,d?ce(e,t+4+8*(f+u)):s,1];n<2&&y(13)}return[o,i,s,0]};function _t(e,t){for(var r={},n=e.length-22;L(e,n)!=101010256;--n)(!n||e.length-n>65558)&&y(13);var o=B(e,n+8);if(!o)return{};var i=L(e,n+16),s=L(e,n-20)==117853008;if(s){var u=L(e,n-12);s=L(e,u)==101075792,s&&(o=L(e,u+32),i=L(e,u+48))}for(var f=0;f<o;++f){var d=Zt(e,i,s),h=d[0],l=d[1],m=d[2],x=d[3],A=d[4],N=d[5],I=Dt(e,N);i=A,h?h==8?r[x]=Ut(e.subarray(I,I+l),{out:new w(m)}):y(14,"unknown compression type "+h):r[x]=ge(e,I,I+l)}return r}const Vt=35641,Ze="application/vnd.comicbook+zip",Z=["Series","Number","Title","Publisher","Volume","Count","LanguageISO","Year","Month","Day","PageCount","Genre","Writer","Penciller","Inker","Colorist","Letterer","CoverArtist","Editor","Manga","BlackAndWhite","AgeRating","StoryArc","Character","Team","Location","Web"],Wt=["Series","Number","Title","Publisher","LanguageISO"],qe=new Set(["Genre","Writer","Penciller","Inker","Colorist","Letterer","CoverArtist","Editor","StoryArc","Character","Team","Location"]);function v(e,t){var r,n;return((n=(r=e[t])==null?void 0:r[0])==null?void 0:n.trim())??""}function Ht(e,t,r){const n=Kt(t,r);n.length>0?e[t]=n:delete e[t]}function Kt(e,t){const r=t.trim();return r?qe.has(e)?r.split(/[;,]/).map(n=>n.trim()).filter(Boolean):[r]:[]}function H(e){return Wt.filter(t=>!v(e,t))}function Gt(e){return e.replaceAll("<","<").replaceAll(">",">").replaceAll(""",'"').replaceAll("'","'").replaceAll("&","&")}function _e(e,t){const r=t.trim();return r?qe.has(e)?r.split(/[;,]/).map(n=>n.trim()).filter(Boolean):[r]:[]}function Xt(e){var n;if(typeof DOMParser>"u")return null;const t=new DOMParser().parseFromString(e,"application/xml");if(t.querySelector("parsererror"))return null;const r={};for(const o of Z){const i=t.querySelector(o),s=(n=i==null?void 0:i.textContent)==null?void 0:n.trim();if(!s)continue;const u=_e(o,s);u.length>0&&(r[o]=u)}return r}function Yt(e){const t={};for(const r of Z){const n=new RegExp(`<${r}(?:\\s[^>]*)?>([\\s\\S]*?)<\\/${r}>`,"i").exec(e);if(!(n!=null&&n[1]))continue;const o=_e(r,Gt(n[1]));o.length>0&&(t[r]=o)}return t}function Qt(e){return Xt(e)??Yt(e)}const Jt=new Set([".jpg",".jpeg",".png",".webp",".gif"]),er=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});function Ve(e){const t=e.lastIndexOf(".");return t===-1?"":e.slice(t).toLocaleLowerCase()}function tr(e){const t=Ve(e);return t===".png"?"image/png":t===".webp"?"image/webp":t===".gif"?"image/gif":"image/jpeg"}function rr(e){const t=_t(new Uint8Array(e)),r=Object.keys(t).filter(u=>!u.endsWith("/")),n=r.find(u=>{var f;return((f=u.split("/").at(-1))==null?void 0:f.toLocaleLowerCase())==="comicinfo.xml"}),o=r.filter(u=>Jt.has(Ve(u))).sort((u,f)=>er.compare(u,f))[0];if(!o)throw new Error("No cover image candidate was found in the CBZ.");const i=n?Qt(new TextDecoder().decode(t[n])):{},s=t[o];return{metadata:i,comicInfoFound:!!n,cover:new Blob([s],{type:tr(o)}),coverName:o,entryCount:r.length}}const We=/[^\p{L}\p{N}]+/gu;function He(e){return e.normalize("NFKC").trim().replace(/\s+/g," ").toLocaleLowerCase().replaceAll("&","and").replaceAll("'","").replaceAll("’","").replace(We,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function nr(e){const t=e.normalize("NFKC").trim().toLocaleLowerCase();return(/^\d+$/.test(t)?String(Number(t)):t).replace(We,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function or(e){return e.normalize("NFKC").trim().toLocaleLowerCase()}function ir(e){const t=He(e);return t==="yesandrighttoleft"||t==="yes-and-right-to-left"?"yes-and-right-to-left":t==="true"||t==="yes"?"yes":t==="false"||t==="no"?"no":t==="unknown"?"unknown":t}function E(e,t){return e==="number"?nr(t):e==="language"?or(t):e==="manga"||e==="black-and-white"?ir(t):He(t)}const ar={Publisher:"publisher",Series:"series",Number:"number",Volume:"volume",Count:"count",LanguageISO:"language",Year:"year",Month:"month",PageCount:"page-count",Genre:"genre",Manga:"manga",BlackAndWhite:"black-and-white",Writer:"writer",Penciller:"penciller",Inker:"inker",Colorist:"colorist",Letterer:"letterer",CoverArtist:"cover-artist",Editor:"editor"};function Ke(e){return["cbz",E("publisher",v(e,"Publisher")),E("series",v(e,"Series")),E("volume",v(e,"Volume")),E("number",v(e,"Number")),E("language",v(e,"LanguageISO"))].join(":")}function sr(e){return[E("publisher",v(e,"Publisher")),E("series",v(e,"Series")),E("volume",v(e,"Volume")),E("number",v(e,"Number")),E("language",v(e,"LanguageISO"))].join("|")}function lr(e){const t=[];for(const[n,o]of Object.entries(ar))for(const i of e[n]??[]){const s=E(o,i);s&&t.push(["c",`${o}:${s}`])}const r=sr(e);return r.replaceAll("|","")&&t.push(["c",`issue:${r}`]),t}function ur(e){var r;const t=[];for(const n of Z){const o=(r=e[n])==null?void 0:r.map(i=>i.trim()).filter(Boolean);o!=null&&o.length&&t.push([n,...o])}return t}function ve(e){var h,l;const t=v(e,"Series"),r=v(e,"Number"),n=v(e,"Title"),o=v(e,"Publisher"),i=v(e,"Year"),s=(h=e.Writer)==null?void 0:h.join(", "),u=(l=e.Penciller)==null?void 0:l.join(", "),f=[`${t}${r?` #${r}`:""}${i?` (${i})`:""}`.trim()];n&&f.push(n);const d=[o?`Published by ${o}`:"",s?`written by ${s}`:"",u?`pencilled by ${u}`:""].filter(Boolean).join(", ");return d&&f.push("",`${d}.`),f.filter((m,x)=>m||f[x-1]).join(`
`)}function cr(e,t=Math.floor(Date.now()/1e3)){const n=[["d",Ke(e.metadata)],["url",e.cbz.url],["m",Ze],["x",e.cbz.sha256],["size",String(e.cbz.size)],["thumb",e.thumbnail.url,e.thumbnail.sha256]];for(const o of e.cbz.fallbackUrls??[])n.push(["fallback",o]);return n.push(...lr(e.metadata)),n.push(...ur(e.metadata)),n.push(["alt",`${v(e.metadata,"Series")} #${v(e.metadata,"Number")}, ${v(e.metadata,"Publisher")}`]),{kind:Vt,created_at:t,content:e.content.trim()||ve(e.metadata),tags:n}}async function Ge(e){const t=e instanceof Blob?await e.arrayBuffer():e,r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r),n=>n.toString(16).padStart(2,"0")).join("")}const fr=kt(),a={file:null,fileBuffer:null,parsed:null,metadata:{},content:"",coverObjectUrl:null,identityPubkey:"",busy:!1,publishedEventId:null,step:0},Xe=["Select","Required fields","Optional details","Cover","Publish"],Ye=Xe.length-1,c={fileInput:b("#fileInput"),dropZone:b("#dropZone"),fileMeta:b("#fileMeta"),coverPreview:b("#coverPreview"),coverCaption:b("#coverCaption"),form:b("#metadataForm"),contentText:b("#contentText"),identityStatus:b("#identityStatus"),derivedSummary:b("#derivedSummary"),publishButton:b("#publishButton"),statusLog:b("#statusLog"),stepLabel:b("#stepLabel"),backButton:b("#backButton"),nextButton:b("#nextButton"),steps:[...document.querySelectorAll(".flow-step")],dots:[...document.querySelectorAll("[data-dot]")]};function b(e){const t=document.querySelector(e);if(!t)throw new Error(`Missing element ${e}`);return t}function C(e){c.statusLog.textContent=e}function Qe(e){return document.getElementById(e)}function q(){const e={};for(const t of Z){const r=Qe(t);r&&Ht(e,t,r.value)}return e}function dr(e){var t;for(const r of Z){const n=Qe(r);n&&(n.value=((t=e[r])==null?void 0:t.join(", "))??"")}c.contentText.value=ve(e)}function mr(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function M(){a.metadata=q(),a.content=c.contentText.value;const e=H(a.metadata);a.file?a.identityPubkey?e.length>0?c.derivedSummary.textContent=`Required: ${e.join(", ")}`:c.derivedSummary.textContent=`${v(a.metadata,"Series")} #${v(a.metadata,"Number")} is ready.`:c.derivedSummary.textContent="Connect an identity to publish.":c.derivedSummary.textContent="Choose a CBZ to begin.",c.publishButton.disabled=a.busy||!a.file||!a.parsed||!a.identityPubkey||e.length>0,c.publishButton.textContent=a.busy?"Publishing...":"Publish",et()}function Je(e){return e===0?!!(a.file&&a.parsed):e===1?H(q()).length===0:!0}function he(e){a.step=Math.max(0,Math.min(Ye,e)),et()}function et(){c.stepLabel.textContent=Xe[a.step];for(const e of c.steps)e.hidden=Number(e.dataset.step)!==a.step;for(const e of c.dots)e.classList.toggle("active",Number(e.dataset.dot)<=a.step);c.backButton.disabled=a.busy||a.step===0,c.nextButton.hidden=a.step===Ye,c.nextButton.disabled=a.busy||!Je(a.step)}function gr(e,t){a.coverObjectUrl&&URL.revokeObjectURL(a.coverObjectUrl),a.coverObjectUrl=URL.createObjectURL(e),c.coverPreview.src=a.coverObjectUrl,c.coverPreview.hidden=!1,c.coverCaption.textContent=t}async function tt(e){a.busy=!0,M(),C("Reading CBZ...");try{const t=await e.arrayBuffer(),r=rr(t);a.file=e,a.fileBuffer=t,a.parsed=r,a.metadata=r.metadata,a.publishedEventId=null,dr(r.metadata),gr(r.cover,"Cover ready"),c.fileMeta.textContent=`${e.name} · ${mr(e.size)}`,C(r.comicInfoFound?"Metadata found. Confirm the required fields.":"Add the required fields to continue."),he(1)}catch(t){a.file=null,a.fileBuffer=null,a.parsed=null,C(t instanceof Error?t.message:"Could not parse the selected CBZ.")}finally{a.busy=!1,M()}}function vr(){var t;const e=(t=c.fileInput.files)==null?void 0:t[0];e&&tt(e)}function hr(e){return new Promise(t=>setTimeout(t,e))}async function rt(e,t){if(e.status==="complete"||!e.ok||e.status==="failed"||e.status==="cancelled")return e;C(`${t} upload started...`);for(let r=0;r<120;r+=1){const n=await me.status(e.uploadId);if(n.bytesTotal&&n.bytesSent!==void 0&&C(`${t} upload ${Math.round(n.bytesSent/n.bytesTotal*100)}%...`),n.status==="complete"||n.status==="failed"||n.status==="cancelled")return n;await hr(1e3)}return{...e,ok:!1,status:"failed",error:`${t} upload timed out.`,uploadId:e.uploadId,rail:e.rail}}async function pr(e){const t=await br(e),n=Math.min(1,512/t.naturalWidth),o=Math.max(1,Math.round(t.naturalWidth*n)),i=Math.max(1,Math.round(t.naturalHeight*n)),s=document.createElement("canvas");s.width=o,s.height=i;const u=s.getContext("2d");if(!u)throw new Error("Could not create thumbnail canvas.");return u.drawImage(t,0,0,o,i),new Promise((f,d)=>{s.toBlob(h=>{h?f(h):d(new Error("Could not encode thumbnail."))},"image/jpeg",.86)})}function br(e){return new Promise((t,r)=>{const n=URL.createObjectURL(e),o=new Image;o.onload=()=>{URL.revokeObjectURL(n),t(o)},o.onerror=()=>{URL.revokeObjectURL(n),r(new Error("Could not decode the cover image."))},o.src=n})}function nt(e,t){if(!e.ok||e.status!=="complete"||!e.url)throw new Error(e.error||`${t} upload failed.`);return e}async function yr(e,t){C("Generating thumbnail...");const r=await pr(t),n=await Ge(r);C("Uploading thumbnail...");const o=await me.upload({data:r,filename:`${Ke(e)}-thumb.jpg`,mimeType:"image/jpeg",caption:`Cover thumbnail for ${v(e,"Series")} #${v(e,"Number")}`}),i=nt(await rt(o,"Thumbnail"),"Thumbnail");return{url:i.url,sha256:i.sha256??n,size:i.size,mimeType:i.mimeType}}async function wr(e,t,r){const n=await Ge(t);C("Uploading CBZ archive...");const o=await me.upload({data:e,filename:e.name,mimeType:Ze,noTransform:!0,caption:`${v(r,"Series")} #${v(r,"Number")}`}),i=nt(await rt(o,"CBZ"),"CBZ");return{url:i.url,sha256:i.sha256??n,size:i.size??e.size,mimeType:i.mimeType,fallbackUrls:i.fallbackUrls}}async function Cr(){a.metadata=q(),a.content=c.contentText.value;const e=H(a.metadata);if(e.length>0)throw new Error(`Missing required fields: ${e.join(", ")}`);if(!a.file||!a.fileBuffer||!a.parsed)throw new Error("Select a valid CBZ first.");if(!a.identityPubkey)throw new Error("Connect an identity in the shell before publishing.");a.busy=!0,M();try{const t=await yr(a.metadata,a.parsed.cover),r=await wr(a.file,a.fileBuffer,a.metadata),n=cr({metadata:a.metadata,content:a.content,cbz:r,thumbnail:t});C("Publishing comic event...");const o=await ht.publish(n);if(!o.ok||!o.eventId)throw new Error(o.error??"Publish failed.");a.publishedEventId=o.eventId,C("Published.")}finally{a.busy=!1,M()}}async function xr(){try{const e=await Te.getPublicKey();a.identityPubkey=e,c.identityStatus.textContent=e?"Identity connected":"No identity",Te.onChanged(t=>{a.identityPubkey=t,c.identityStatus.textContent=t?"Identity connected":"No identity",M()})}catch(e){c.identityStatus.textContent="Identity unavailable",C(e instanceof Error?e.message:"Identity unavailable.")}finally{M()}}c.fileInput.addEventListener("change",vr);c.dropZone.addEventListener("dragover",e=>{e.preventDefault(),c.dropZone.classList.add("dragging")});c.dropZone.addEventListener("dragleave",()=>c.dropZone.classList.remove("dragging"));c.dropZone.addEventListener("drop",e=>{var r;e.preventDefault(),c.dropZone.classList.remove("dragging");const t=(r=e.dataTransfer)==null?void 0:r.files[0];t&&tt(t)});c.form.addEventListener("input",()=>{a.metadata=q(),c.contentText.value.trim()||(c.contentText.value=ve(a.metadata)),M()});c.contentText.addEventListener("input",M);c.backButton.addEventListener("click",()=>he(a.step-1));c.nextButton.addEventListener("click",()=>{if(!Je(a.step)){const e=H(q());C(e.length>0?`Add ${e.join(", ")} to continue.`:"Choose a CBZ to continue.");return}he(a.step+1)});c.publishButton.addEventListener("click",()=>{Cr().catch(e=>C(e instanceof Error?e.message:"Publish failed."))});window.addEventListener("beforeunload",()=>{a.coverObjectUrl&&URL.revokeObjectURL(a.coverObjectUrl),fr.close()});xr();</script>
<style rel="stylesheet" crossorigin>@layer theme,base,components,utilities;@layer theme{@theme default{ --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; --color-red-50: oklch(97.1% .013 17.38); --color-red-100: oklch(93.6% .032 17.717); --color-red-200: oklch(88.5% .062 18.334); --color-red-300: oklch(80.8% .114 19.571); --color-red-400: oklch(70.4% .191 22.216); --color-red-500: oklch(63.7% .237 25.331); --color-red-600: oklch(57.7% .245 27.325); --color-red-700: oklch(50.5% .213 27.518); --color-red-800: oklch(44.4% .177 26.899); --color-red-900: oklch(39.6% .141 25.723); --color-red-950: oklch(25.8% .092 26.042); --color-orange-50: oklch(98% .016 73.684); --color-orange-100: oklch(95.4% .038 75.164); --color-orange-200: oklch(90.1% .076 70.697); --color-orange-300: oklch(83.7% .128 66.29); --color-orange-400: oklch(75% .183 55.934); --color-orange-500: oklch(70.5% .213 47.604); --color-orange-600: oklch(64.6% .222 41.116); --color-orange-700: oklch(55.3% .195 38.402); --color-orange-800: oklch(47% .157 37.304); --color-orange-900: oklch(40.8% .123 38.172); --color-orange-950: oklch(26.6% .079 36.259); --color-amber-50: oklch(98.7% .022 95.277); --color-amber-100: oklch(96.2% .059 95.617); --color-amber-200: oklch(92.4% .12 95.746); --color-amber-300: oklch(87.9% .169 91.605); --color-amber-400: oklch(82.8% .189 84.429); --color-amber-500: oklch(76.9% .188 70.08); --color-amber-600: oklch(66.6% .179 58.318); --color-amber-700: oklch(55.5% .163 48.998); --color-amber-800: oklch(47.3% .137 46.201); --color-amber-900: oklch(41.4% .112 45.904); --color-amber-950: oklch(27.9% .077 45.635); --color-yellow-50: oklch(98.7% .026 102.212); --color-yellow-100: oklch(97.3% .071 103.193); --color-yellow-200: oklch(94.5% .129 101.54); --color-yellow-300: oklch(90.5% .182 98.111); --color-yellow-400: oklch(85.2% .199 91.936); --color-yellow-500: oklch(79.5% .184 86.047); --color-yellow-600: oklch(68.1% .162 75.834); --color-yellow-700: oklch(55.4% .135 66.442); --color-yellow-800: oklch(47.6% .114 61.907); --color-yellow-900: oklch(42.1% .095 57.708); --color-yellow-950: oklch(28.6% .066 53.813); --color-lime-50: oklch(98.6% .031 120.757); --color-lime-100: oklch(96.7% .067 122.328); --color-lime-200: oklch(93.8% .127 124.321); --color-lime-300: oklch(89.7% .196 126.665); --color-lime-400: oklch(84.1% .238 128.85); --color-lime-500: oklch(76.8% .233 130.85); --color-lime-600: oklch(64.8% .2 131.684); --color-lime-700: oklch(53.2% .157 131.589); --color-lime-800: oklch(45.3% .124 130.933); --color-lime-900: oklch(40.5% .101 131.063); --color-lime-950: oklch(27.4% .072 132.109); --color-green-50: oklch(98.2% .018 155.826); --color-green-100: oklch(96.2% .044 156.743); --color-green-200: oklch(92.5% .084 155.995); --color-green-300: oklch(87.1% .15 154.449); --color-green-400: oklch(79.2% .209 151.711); --color-green-500: oklch(72.3% .219 149.579); --color-green-600: oklch(62.7% .194 149.214); --color-green-700: oklch(52.7% .154 150.069); --color-green-800: oklch(44.8% .119 151.328); --color-green-900: oklch(39.3% .095 152.535); --color-green-950: oklch(26.6% .065 152.934); --color-emerald-50: oklch(97.9% .021 166.113); --color-emerald-100: oklch(95% .052 163.051); --color-emerald-200: oklch(90.5% .093 164.15); --color-emerald-300: oklch(84.5% .143 164.978); --color-emerald-400: oklch(76.5% .177 163.223); --color-emerald-500: oklch(69.6% .17 162.48); --color-emerald-600: oklch(59.6% .145 163.225); --color-emerald-700: oklch(50.8% .118 165.612); --color-emerald-800: oklch(43.2% .095 166.913); --color-emerald-900: oklch(37.8% .077 168.94); --color-emerald-950: oklch(26.2% .051 172.552); --color-teal-50: oklch(98.4% .014 180.72); --color-teal-100: oklch(95.3% .051 180.801); --color-teal-200: oklch(91% .096 180.426); --color-teal-300: oklch(85.5% .138 181.071); --color-teal-400: oklch(77.7% .152 181.912); --color-teal-500: oklch(70.4% .14 182.503); --color-teal-600: oklch(60% .118 184.704); --color-teal-700: oklch(51.1% .096 186.391); --color-teal-800: oklch(43.7% .078 188.216); --color-teal-900: oklch(38.6% .063 188.416); --color-teal-950: oklch(27.7% .046 192.524); --color-cyan-50: oklch(98.4% .019 200.873); --color-cyan-100: oklch(95.6% .045 203.388); --color-cyan-200: oklch(91.7% .08 205.041); --color-cyan-300: oklch(86.5% .127 207.078); --color-cyan-400: oklch(78.9% .154 211.53); --color-cyan-500: oklch(71.5% .143 215.221); --color-cyan-600: oklch(60.9% .126 221.723); --color-cyan-700: oklch(52% .105 223.128); --color-cyan-800: oklch(45% .085 224.283); --color-cyan-900: oklch(39.8% .07 227.392); --color-cyan-950: oklch(30.2% .056 229.695); --color-sky-50: oklch(97.7% .013 236.62); --color-sky-100: oklch(95.1% .026 236.824); --color-sky-200: oklch(90.1% .058 230.902); --color-sky-300: oklch(82.8% .111 230.318); --color-sky-400: oklch(74.6% .16 232.661); --color-sky-500: oklch(68.5% .169 237.323); --color-sky-600: oklch(58.8% .158 241.966); --color-sky-700: oklch(50% .134 242.749); --color-sky-800: oklch(44.3% .11 240.79); --color-sky-900: oklch(39.1% .09 240.876); --color-sky-950: oklch(29.3% .066 243.157); --color-blue-50: oklch(97% .014 254.604); --color-blue-100: oklch(93.2% .032 255.585); --color-blue-200: oklch(88.2% .059 254.128); --color-blue-300: oklch(80.9% .105 251.813); --color-blue-400: oklch(70.7% .165 254.624); --color-blue-500: oklch(62.3% .214 259.815); --color-blue-600: oklch(54.6% .245 262.881); --color-blue-700: oklch(48.8% .243 264.376); --color-blue-800: oklch(42.4% .199 265.638); --color-blue-900: oklch(37.9% .146 265.522); --color-blue-950: oklch(28.2% .091 267.935); --color-indigo-50: oklch(96.2% .018 272.314); --color-indigo-100: oklch(93% .034 272.788); --color-indigo-200: oklch(87% .065 274.039); --color-indigo-300: oklch(78.5% .115 274.713); --color-indigo-400: oklch(67.3% .182 276.935); --color-indigo-500: oklch(58.5% .233 277.117); --color-indigo-600: oklch(51.1% .262 276.966); --color-indigo-700: oklch(45.7% .24 277.023); --color-indigo-800: oklch(39.8% .195 277.366); --color-indigo-900: oklch(35.9% .144 278.697); --color-indigo-950: oklch(25.7% .09 281.288); --color-violet-50: oklch(96.9% .016 293.756); --color-violet-100: oklch(94.3% .029 294.588); --color-violet-200: oklch(89.4% .057 293.283); --color-violet-300: oklch(81.1% .111 293.571); --color-violet-400: oklch(70.2% .183 293.541); --color-violet-500: oklch(60.6% .25 292.717); --color-violet-600: oklch(54.1% .281 293.009); --color-violet-700: oklch(49.1% .27 292.581); --color-violet-800: oklch(43.2% .232 292.759); --color-violet-900: oklch(38% .189 293.745); --color-violet-950: oklch(28.3% .141 291.089); --color-purple-50: oklch(97.7% .014 308.299); --color-purple-100: oklch(94.6% .033 307.174); --color-purple-200: oklch(90.2% .063 306.703); --color-purple-300: oklch(82.7% .119 306.383); --color-purple-400: oklch(71.4% .203 305.504); --color-purple-500: oklch(62.7% .265 303.9); --color-purple-600: oklch(55.8% .288 302.321); --color-purple-700: oklch(49.6% .265 301.924); --color-purple-800: oklch(43.8% .218 303.724); --color-purple-900: oklch(38.1% .176 304.987); --color-purple-950: oklch(29.1% .149 302.717); --color-fuchsia-50: oklch(97.7% .017 320.058); --color-fuchsia-100: oklch(95.2% .037 318.852); --color-fuchsia-200: oklch(90.3% .076 319.62); --color-fuchsia-300: oklch(83.3% .145 321.434); --color-fuchsia-400: oklch(74% .238 322.16); --color-fuchsia-500: oklch(66.7% .295 322.15); --color-fuchsia-600: oklch(59.1% .293 322.896); --color-fuchsia-700: oklch(51.8% .253 323.949); --color-fuchsia-800: oklch(45.2% .211 324.591); --color-fuchsia-900: oklch(40.1% .17 325.612); --color-fuchsia-950: oklch(29.3% .136 325.661); --color-pink-50: oklch(97.1% .014 343.198); --color-pink-100: oklch(94.8% .028 342.258); --color-pink-200: oklch(89.9% .061 343.231); --color-pink-300: oklch(82.3% .12 346.018); --color-pink-400: oklch(71.8% .202 349.761); --color-pink-500: oklch(65.6% .241 354.308); --color-pink-600: oklch(59.2% .249 .584); --color-pink-700: oklch(52.5% .223 3.958); --color-pink-800: oklch(45.9% .187 3.815); --color-pink-900: oklch(40.8% .153 2.432); --color-pink-950: oklch(28.4% .109 3.907); --color-rose-50: oklch(96.9% .015 12.422); --color-rose-100: oklch(94.1% .03 12.58); --color-rose-200: oklch(89.2% .058 10.001); --color-rose-300: oklch(81% .117 11.638); --color-rose-400: oklch(71.2% .194 13.428); --color-rose-500: oklch(64.5% .246 16.439); --color-rose-600: oklch(58.6% .253 17.585); --color-rose-700: oklch(51.4% .222 16.935); --color-rose-800: oklch(45.5% .188 13.697); --color-rose-900: oklch(41% .159 10.272); --color-rose-950: oklch(27.1% .105 12.094); --color-slate-50: oklch(98.4% .003 247.858); --color-slate-100: oklch(96.8% .007 247.896); --color-slate-200: oklch(92.9% .013 255.508); --color-slate-300: oklch(86.9% .022 252.894); --color-slate-400: oklch(70.4% .04 256.788); --color-slate-500: oklch(55.4% .046 257.417); --color-slate-600: oklch(44.6% .043 257.281); --color-slate-700: oklch(37.2% .044 257.287); --color-slate-800: oklch(27.9% .041 260.031); --color-slate-900: oklch(20.8% .042 265.755); --color-slate-950: oklch(12.9% .042 264.695); --color-gray-50: oklch(98.5% .002 247.839); --color-gray-100: oklch(96.7% .003 264.542); --color-gray-200: oklch(92.8% .006 264.531); --color-gray-300: oklch(87.2% .01 258.338); --color-gray-400: oklch(70.7% .022 261.325); --color-gray-500: oklch(55.1% .027 264.364); --color-gray-600: oklch(44.6% .03 256.802); --color-gray-700: oklch(37.3% .034 259.733); --color-gray-800: oklch(27.8% .033 256.848); --color-gray-900: oklch(21% .034 264.665); --color-gray-950: oklch(13% .028 261.692); --color-zinc-50: oklch(98.5% 0 0); --color-zinc-100: oklch(96.7% .001 286.375); --color-zinc-200: oklch(92% .004 286.32); --color-zinc-300: oklch(87.1% .006 286.286); --color-zinc-400: oklch(70.5% .015 286.067); --color-zinc-500: oklch(55.2% .016 285.938); --color-zinc-600: oklch(44.2% .017 285.786); --color-zinc-700: oklch(37% .013 285.805); --color-zinc-800: oklch(27.4% .006 286.033); --color-zinc-900: oklch(21% .006 285.885); --color-zinc-950: oklch(14.1% .005 285.823); --color-neutral-50: oklch(98.5% 0 0); --color-neutral-100: oklch(97% 0 0); --color-neutral-200: oklch(92.2% 0 0); --color-neutral-300: oklch(87% 0 0); --color-neutral-400: oklch(70.8% 0 0); --color-neutral-500: oklch(55.6% 0 0); --color-neutral-600: oklch(43.9% 0 0); --color-neutral-700: oklch(37.1% 0 0); --color-neutral-800: oklch(26.9% 0 0); --color-neutral-900: oklch(20.5% 0 0); --color-neutral-950: oklch(14.5% 0 0); --color-stone-50: oklch(98.5% .001 106.423); --color-stone-100: oklch(97% .001 106.424); --color-stone-200: oklch(92.3% .003 48.717); --color-stone-300: oklch(86.9% .005 56.366); --color-stone-400: oklch(70.9% .01 56.259); --color-stone-500: oklch(55.3% .013 58.071); --color-stone-600: oklch(44.4% .011 73.639); --color-stone-700: oklch(37.4% .01 67.558); --color-stone-800: oklch(26.8% .007 34.298); --color-stone-900: oklch(21.6% .006 56.043); --color-stone-950: oklch(14.7% .004 49.25); --color-mauve-50: oklch(98.5% 0 0); --color-mauve-100: oklch(96% .003 325.6); --color-mauve-200: oklch(92.2% .005 325.62); --color-mauve-300: oklch(86.5% .012 325.68); --color-mauve-400: oklch(71.1% .019 323.02); --color-mauve-500: oklch(54.2% .034 322.5); --color-mauve-600: oklch(43.5% .029 321.78); --color-mauve-700: oklch(36.4% .029 323.89); --color-mauve-800: oklch(26.3% .024 320.12); --color-mauve-900: oklch(21.2% .019 322.12); --color-mauve-950: oklch(14.5% .008 326); --color-olive-50: oklch(98.8% .003 106.5); --color-olive-100: oklch(96.6% .005 106.5); --color-olive-200: oklch(93% .007 106.5); --color-olive-300: oklch(88% .011 106.6); --color-olive-400: oklch(73.7% .021 106.9); --color-olive-500: oklch(58% .031 107.3); --color-olive-600: oklch(46.6% .025 107.3); --color-olive-700: oklch(39.4% .023 107.4); --color-olive-800: oklch(28.6% .016 107.4); --color-olive-900: oklch(22.8% .013 107.4); --color-olive-950: oklch(15.3% .006 107.1); --color-mist-50: oklch(98.7% .002 197.1); --color-mist-100: oklch(96.3% .002 197.1); --color-mist-200: oklch(92.5% .005 214.3); --color-mist-300: oklch(87.2% .007 219.6); --color-mist-400: oklch(72.3% .014 214.4); --color-mist-500: oklch(56% .021 213.5); --color-mist-600: oklch(45% .017 213.2); --color-mist-700: oklch(37.8% .015 216); --color-mist-800: oklch(27.5% .011 216.9); --color-mist-900: oklch(21.8% .008 223.9); --color-mist-950: oklch(14.8% .004 228.8); --color-taupe-50: oklch(98.6% .002 67.8); --color-taupe-100: oklch(96% .002 17.2); --color-taupe-200: oklch(92.2% .005 34.3); --color-taupe-300: oklch(86.8% .007 39.5); --color-taupe-400: oklch(71.4% .014 41.2); --color-taupe-500: oklch(54.7% .021 43.1); --color-taupe-600: oklch(43.8% .017 39.3); --color-taupe-700: oklch(36.7% .016 35.7); --color-taupe-800: oklch(26.8% .011 36.5); --color-taupe-900: oklch(21.4% .009 43.1); --color-taupe-950: oklch(14.7% .004 49.3); --color-black: #000; --color-white: #fff; --spacing: .25rem; --breakpoint-sm: 40rem; --breakpoint-md: 48rem; --breakpoint-lg: 64rem; --breakpoint-xl: 80rem; --breakpoint-2xl: 96rem; --container-3xs: 16rem; --container-2xs: 18rem; --container-xs: 20rem; --container-sm: 24rem; --container-md: 28rem; --container-lg: 32rem; --container-xl: 36rem; --container-2xl: 42rem; --container-3xl: 48rem; --container-4xl: 56rem; --container-5xl: 64rem; --container-6xl: 72rem; --container-7xl: 80rem; --text-xs: .75rem; --text-xs--line-height: calc(1 / .75); --text-sm: .875rem; --text-sm--line-height: calc(1.25 / .875); --text-base: 1rem; --text-base--line-height: 1.5 ; --text-lg: 1.125rem; --text-lg--line-height: calc(1.75 / 1.125); --text-xl: 1.25rem; --text-xl--line-height: calc(1.75 / 1.25); --text-2xl: 1.5rem; --text-2xl--line-height: calc(2 / 1.5); --text-3xl: 1.875rem; --text-3xl--line-height: 1.2 ; --text-4xl: 2.25rem; --text-4xl--line-height: calc(2.5 / 2.25); --text-5xl: 3rem; --text-5xl--line-height: 1; --text-6xl: 3.75rem; --text-6xl--line-height: 1; --text-7xl: 4.5rem; --text-7xl--line-height: 1; --text-8xl: 6rem; --text-8xl--line-height: 1; --text-9xl: 8rem; --text-9xl--line-height: 1; --font-weight-thin: 100; --font-weight-extralight: 200; --font-weight-light: 300; --font-weight-normal: 400; --font-weight-medium: 500; --font-weight-semibold: 600; --font-weight-bold: 700; --font-weight-extrabold: 800; --font-weight-black: 900; --tracking-tighter: -.05em; --tracking-tight: -.025em; --tracking-normal: 0em; --tracking-wide: .025em; --tracking-wider: .05em; --tracking-widest: .1em; --leading-tight: 1.25; --leading-snug: 1.375; --leading-normal: 1.5; --leading-relaxed: 1.625; --leading-loose: 2; --radius-xs: .125rem; --radius-sm: .25rem; --radius-md: .375rem; --radius-lg: .5rem; --radius-xl: .75rem; --radius-2xl: 1rem; --radius-3xl: 1.5rem; --radius-4xl: 2rem; --shadow-2xs: 0 1px rgb(0 0 0 / .05); --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / .05); --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1); --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1); --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25); --inset-shadow-2xs: inset 0 1px rgb(0 0 0 / .05); --inset-shadow-xs: inset 0 1px 1px rgb(0 0 0 / .05); --inset-shadow-sm: inset 0 2px 4px rgb(0 0 0 / .05); --drop-shadow-xs: 0 1px 1px rgb(0 0 0 / .05); --drop-shadow-sm: 0 1px 2px rgb(0 0 0 / .15); --drop-shadow-md: 0 3px 3px rgb(0 0 0 / .12); --drop-shadow-lg: 0 4px 4px rgb(0 0 0 / .15); --drop-shadow-xl: 0 9px 7px rgb(0 0 0 / .1); --drop-shadow-2xl: 0 25px 25px rgb(0 0 0 / .15); --text-shadow-2xs: 0px 1px 0px rgb(0 0 0 / .15); --text-shadow-xs: 0px 1px 1px rgb(0 0 0 / .2); --text-shadow-sm: 0px 1px 0px rgb(0 0 0 / .075), 0px 1px 1px rgb(0 0 0 / .075), 0px 2px 2px rgb(0 0 0 / .075); --text-shadow-md: 0px 1px 1px rgb(0 0 0 / .1), 0px 1px 2px rgb(0 0 0 / .1), 0px 2px 4px rgb(0 0 0 / .1); --text-shadow-lg: 0px 1px 2px rgb(0 0 0 / .1), 0px 3px 2px rgb(0 0 0 / .1), 0px 4px 8px rgb(0 0 0 / .1); --ease-in: cubic-bezier(.4, 0, 1, 1); --ease-out: cubic-bezier(0, 0, .2, 1); --ease-in-out: cubic-bezier(.4, 0, .2, 1); --animate-spin: spin 1s linear infinite; --animate-ping: ping 1s cubic-bezier(0, 0, .2, 1) infinite; --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite; --animate-bounce: bounce 1s infinite; @keyframes spin { to { transform: rotate(360deg); } } @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } } @keyframes pulse { 50% { opacity: .5; } } @keyframes bounce { 0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(.8, 0, 1, 1); } 50% { transform: none; animation-timing-function: cubic-bezier(0, 0, .2, 1); } } --blur-xs: 4px; --blur-sm: 8px; --blur-md: 12px; --blur-lg: 16px; --blur-xl: 24px; --blur-2xl: 40px; --blur-3xl: 64px; --perspective-dramatic: 100px; --perspective-near: 300px; --perspective-normal: 500px; --perspective-midrange: 800px; --perspective-distant: 1200px; --aspect-video: 16 / 9; --default-transition-duration: .15s; --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1); --default-font-family: --theme(--font-sans, initial); --default-font-feature-settings: --theme( --font-sans--font-feature-settings, initial ); --default-font-variation-settings: --theme( --font-sans--font-variation-settings, initial ); --default-mono-font-family: --theme(--font-mono, initial); --default-mono-font-feature-settings: --theme( --font-mono--font-feature-settings, initial ); --default-mono-font-variation-settings: --theme( --font-mono--font-variation-settings, initial ); }@theme default inline reference{ --blur: 8px; --shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1); --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / .05); --drop-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 1px 1px rgb(0 0 0 / .06); --radius: .25rem; --max-width-prose: 65ch; }}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:--theme(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:--theme(--default-font-feature-settings,normal);font-variation-settings:--theme(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:--theme(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:--theme(--default-mono-font-feature-settings,normal);font-variation-settings:--theme(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{@tailwind utilities;}@plugin "daisyui"{themes: light --default,dark --prefersdark; logs: false;}@plugin "daisyui/theme"{name: "napplet-runtime"; default: false; prefersdark: false; color-scheme: dark; --color-base-100: #14110c; --color-base-200: #241f16; --color-base-300: #342c1f; --color-base-content: #f5f1e8; --color-primary: #9be564; --color-primary-content: #111827; --color-secondary: #374823; --color-secondary-content: #f5f1e8; --color-accent: #afe881; --color-accent-content: #111827; --color-neutral: #3d3934; --color-neutral-content: #ffffff; --color-info: #38bdf8; --color-info-content: #082f49; --color-success: #22c55e; --color-success-content: #052e16; --color-warning: #facc15; --color-warning-content: #422006; --color-error: #f87171; --color-error-content: #450a0a; --radius-selector: .25rem; --radius-field: .25rem; --radius-box: .375rem; --size-selector: .21875rem; --size-field: .21875rem; --border: 1px; --depth: 0; --noise: 0;}:root{--gm-font-body: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;color-scheme:dark}html,body,#app{width:100%;height:100%;margin:0}body{background:var(--color-base-100);color:var(--color-base-content);color-scheme:inherit;font-family:var(--gm-font-body)}*,*:before,*:after{box-sizing:border-box}button,input,textarea,select{font:inherit}::selection{background:color-mix(in srgb,var(--color-primary) 38%,transparent)}:root{--napplet-text-selection: text}*{box-sizing:border-box}:where(html,body){margin:0;min-width:0;width:100%;height:100%}body{background:var(--color-base-100);color:var(--color-base-content);font-family:var(--gm-font-body, ui-sans-serif, system-ui, sans-serif)}button,input,select,textarea{font:inherit}.comic-app{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:clamp(.35rem,1.6vmin,.55rem);width:100%;height:100%;min-width:0;min-height:0;padding:clamp(.4rem,2vmin,.65rem);overflow:hidden}.topline,.nav-row,.file-pick,.flow-step[data-step="4"]{display:flex;align-items:center;gap:clamp(.35rem,1.6vmin,.55rem);min-width:0}#stepLabel{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--color-base-content);font-size:clamp(.82rem,2.6vmin,.95rem);font-weight:900}#identityStatus,#fileMeta,#derivedSummary,.status-line,.flow-step p,.cover-frame figcaption{color:color-mix(in srgb,var(--color-base-content) 72%,transparent);font-size:clamp(.68rem,2.2vmin,.78rem)}#identityStatus,#fileMeta,#derivedSummary,.status-line{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.steps{display:grid;grid-template-columns:repeat(5,1fr);gap:clamp(.18rem,1vmin,.28rem)}.steps span{height:clamp(.16rem,.8vmin,.22rem);border-radius:999px;background:var(--color-base-300)}.steps span.active{background:var(--color-primary)}.flow{min-height:0;overflow:hidden}.flow-step{height:100%;min-height:0;overflow:auto}.flow-step[hidden]{display:none}.file-pick{height:100%;justify-content:center;flex-direction:column;padding:clamp(.55rem,3vmin,1rem);border:1px dashed color-mix(in srgb,var(--color-primary) 52%,transparent);border-radius:var(--radius-box, .375rem);background:var(--color-base-200);text-align:center;cursor:pointer}.file-pick input{position:absolute;width:1px;height:1px;opacity:0}.file-action,button{border:0;border-radius:var(--radius-field, .25rem);background:var(--color-primary);color:var(--color-primary-content);padding:clamp(.42rem,1.8vmin,.55rem) clamp(.58rem,2.4vmin,.78rem);font-weight:900;white-space:nowrap;font-size:clamp(.78rem,2.4vmin,.95rem)}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}.metadata-form{display:grid;gap:clamp(.38rem,1.6vmin,.55rem)}.required-fields{grid-template-columns:repeat(auto-fit,minmax(min(11rem,100%),1fr))}.optional-fields{grid-template-columns:repeat(auto-fit,minmax(min(9rem,100%),1fr))}label{display:grid;gap:.22rem;min-width:0;color:color-mix(in srgb,var(--color-base-content) 82%,transparent);font-size:clamp(.66rem,2vmin,.72rem);font-weight:760}input,select,textarea{width:100%;min-width:0;border:1px solid color-mix(in srgb,var(--color-base-content) 20%,transparent);border-radius:var(--radius-field, .25rem);background:var(--color-base-200);color:var(--color-base-content);padding:clamp(.36rem,1.6vmin,.46rem) clamp(.42rem,1.8vmin,.52rem);font-size:clamp(.78rem,2.4vmin,.92rem)}textarea{resize:vertical}.wide{grid-column:1 / -1}.cover-step{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:clamp(.35rem,1.5vmin,.5rem)}.cover-frame{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:clamp(.24rem,1.2vmin,.35rem);min-height:0;margin:0}.cover-frame img{display:block;width:100%;height:100%;min-height:0;max-height:100%;object-fit:contain;border-radius:var(--radius-box, .375rem);background:var(--color-base-200)}.flow-step[data-step="4"]{justify-content:space-between}#derivedSummary{flex:1}.nav-row{justify-content:space-between}.status-line{min-height:1.1rem}input:focus,select:focus,textarea:focus,button:focus-visible,.file-pick:focus-within .file-action{outline:2px solid color-mix(in srgb,var(--color-primary) 80%,transparent);outline-offset:2px}.dragging{background:color-mix(in srgb,var(--color-primary) 12%,var(--color-base-200))}@media(max-width:620px){.flow-step[data-step="4"],.nav-row{display:grid;grid-template-columns:1fr}}@media(max-width:320px){.topline,.nav-row,.flow-step[data-step="4"]{display:grid;grid-template-columns:1fr}#identityStatus{display:none}}@media(max-height:360px){.comic-app{grid-template-rows:auto minmax(0,1fr) auto}.steps,.status-line{display:none}.file-pick{min-height:0}.flow-step p,.cover-frame figcaption{display:none}}@media(max-height:240px){.comic-app{padding:.35rem;gap:.3rem}.topline{display:none}}</style>
<meta name="napplet-type" content="comic-upload">
<meta name="napplet-requires" content="identity,outbox,theme,upload">
</head>
<body>
<main id="app" class="comic-app" aria-label="Comic Upload">
<div class="topline" aria-label="Upload progress">
<span id="stepLabel">Select</span>
<output id="identityStatus">Checking identity...</output>
</div>
<div class="steps" aria-hidden="true">
<span data-dot="0"></span>
<span data-dot="1"></span>
<span data-dot="2"></span>
<span data-dot="3"></span>
<span data-dot="4"></span>
</div>
<form id="metadataForm" class="flow" aria-label="Comic upload workflow">
<section class="flow-step" data-step="0" aria-label="Select comic archive">
<label id="dropZone" class="file-pick">
<input id="fileInput" type="file" accept=".cbz,application/vnd.comicbook+zip,application/x-cbz,application/zip" />
<span class="file-action">Select CBZ</span>
<span id="fileMeta">No file selected</span>
</label>
<p>Choose a CBZ. ComicInfo.xml will be used when present.</p>
</section>
<section class="flow-step" data-step="1" aria-label="Required comic metadata" hidden>
<div class="metadata-form required-fields">
<label>Series *<input id="Series" name="Series" autocomplete="off" required /></label>
<label>Number *<input id="Number" name="Number" autocomplete="off" required /></label>
<label>Title *<input id="Title" name="Title" autocomplete="off" required /></label>
<label>Publisher *<input id="Publisher" name="Publisher" autocomplete="off" required /></label>
<label>LanguageISO *<input id="LanguageISO" name="LanguageISO" autocomplete="off" placeholder="en" required /></label>
</div>
<p id="requiredHint">These fields identify the published comic.</p>
</section>
<section class="flow-step" data-step="2" aria-label="Optional comic metadata" hidden>
<div class="metadata-form optional-fields">
<label>Volume<input id="Volume" name="Volume" inputmode="numeric" autocomplete="off" /></label>
<label>Count<input id="Count" name="Count" inputmode="numeric" autocomplete="off" /></label>
<label>Year<input id="Year" name="Year" inputmode="numeric" autocomplete="off" /></label>
<label>Month<input id="Month" name="Month" inputmode="numeric" autocomplete="off" /></label>
<label>Day<input id="Day" name="Day" inputmode="numeric" autocomplete="off" /></label>
<label>PageCount<input id="PageCount" name="PageCount" inputmode="numeric" autocomplete="off" /></label>
<label>Genre<input id="Genre" name="Genre" autocomplete="off" placeholder="Superhero, Action" /></label>
<label>Writer<input id="Writer" name="Writer" autocomplete="off" /></label>
<label>Penciller<input id="Penciller" name="Penciller" autocomplete="off" /></label>
<label>Inker<input id="Inker" name="Inker" autocomplete="off" /></label>
<label>Colorist<input id="Colorist" name="Colorist" autocomplete="off" /></label>
<label>Letterer<input id="Letterer" name="Letterer" autocomplete="off" /></label>
<label>CoverArtist<input id="CoverArtist" name="CoverArtist" autocomplete="off" /></label>
<label>Editor<input id="Editor" name="Editor" autocomplete="off" /></label>
<label>Manga<select id="Manga" name="Manga"><option value=""></option><option>No</option><option>Yes</option><option>YesAndRightToLeft</option><option>Unknown</option></select></label>
<label>BlackAndWhite<select id="BlackAndWhite" name="BlackAndWhite"><option value=""></option><option>No</option><option>Yes</option><option>Unknown</option></select></label>
<label>AgeRating<input id="AgeRating" name="AgeRating" autocomplete="off" /></label>
<label>StoryArc<input id="StoryArc" name="StoryArc" autocomplete="off" /></label>
<label>Character<input id="Character" name="Character" autocomplete="off" /></label>
<label>Team<input id="Team" name="Team" autocomplete="off" /></label>
<label>Location<input id="Location" name="Location" autocomplete="off" /></label>
<label>Web<input id="Web" name="Web" autocomplete="off" /></label>
<label class="wide">Description<textarea id="contentText" rows="4"></textarea></label>
</div>
</section>
<section class="flow-step cover-step" data-step="3" aria-label="Cover thumbnail" hidden>
<figure class="cover-frame">
<img id="coverPreview" alt="Cover preview" hidden />
<figcaption id="coverCaption">Cover thumbnail required</figcaption>
</figure>
<p>The selected cover will be converted to a thumbnail before publishing.</p>
</section>
<section class="flow-step" data-step="4" aria-label="Publish comic" hidden>
<output id="derivedSummary">Select a CBZ to begin.</output>
<button id="publishButton" type="button" disabled>Publish</button>
</section>
</form>
<div class="nav-row">
<button id="backButton" type="button">Back</button>
<button id="nextButton" type="button">Next</button>
</div>
<output id="statusLog" class="status-line">Ready.</output>
</main>
</body>
</html>
