Chakshu123's picture
Duplicate from HighCWu/anime-colorization-with-hint
41ddeab
import{S as pe,i as ke,s as ve,ae as te,P as we,c as M,m as N,l as T,j as y,k as B,o as S,Z as ye,R as je,T as ze,a as D,B as Ae,f as C,U as Be,V as Ce,D as E,E as H,n as G,aa as Ge,I as F,e as w,b as h,M as L,Y as J,d as A,g as j,t as ne,h as ie,C as oe,A as De,ai as Ie,x as U}from"./index.396f4a72.js";import{B as Re}from"./BlockLabel.37da86a3.js";import{M as Le}from"./ModifyUpload.2cfe71e4.js";import{n as K}from"./utils.27234e1d.js";import{I as Y}from"./Image.4a41f1aa.js";function O(t,e,l){const i=t.slice();return i[30]=e[l][0],i[31]=e[l][1],i[33]=l,i}function Q(t,e,l){const i=t.slice();return i[30]=e[l],i[34]=e,i[33]=l,i}function W(t){let e,l;return e=new Re({props:{show_label:t[1],Icon:Y,label:t[2]||"Gallery",disable:typeof t[6].container=="boolean"&&!t[6].container}}),{c(){M(e.$$.fragment)},m(i,o){N(e,i,o),l=!0},p(i,o){const n={};o[0]&2&&(n.show_label=i[1]),o[0]&4&&(n.label=i[2]||"Gallery"),o[0]&64&&(n.disable=typeof i[6].container=="boolean"&&!i[6].container),e.$set(n)},i(i){l||(y(e.$$.fragment,i),l=!0)},o(i){B(e.$$.fragment,i),l=!1},d(i){S(e,i)}}}function Me(t){let e,l,i,o,n,r,a=t[7]!==null&&X(t);const p=[Te,Se],m=[];function g(f,c){return f[10].length===0?0:1}return i=g(t),o=m[i]=p[i](t),{c(){a&&a.c(),e=D(),l=w("div"),o.c(),h(l,"class","overflow-y-auto h-full p-2"),te(()=>t[27].call(l)),A(l,"min-h-[350px]",t[6].height!=="auto"),A(l,"max-h-[55vh]",t[6].height!=="auto"),A(l,"xl:min-h-[450px]",t[6].height!=="auto")},m(f,c){a&&a.m(f,c),C(f,e,c),C(f,l,c),m[i].m(l,null),n=Ie(l,t[27].bind(l)),r=!0},p(f,c){f[7]!==null?a?(a.p(f,c),c[0]&128&&y(a,1)):(a=X(f),a.c(),y(a,1),a.m(e.parentNode,e)):a&&(E(),B(a,1,1,()=>{a=null}),H());let z=i;i=g(f),i===z?m[i].p(f,c):(E(),B(m[z],1,1,()=>{m[z]=null}),H(),o=m[i],o?o.p(f,c):(o=m[i]=p[i](f),o.c()),y(o,1),o.m(l,null)),c[0]&64&&A(l,"min-h-[350px]",f[6].height!=="auto"),c[0]&64&&A(l,"max-h-[55vh]",f[6].height!=="auto"),c[0]&64&&A(l,"xl:min-h-[450px]",f[6].height!=="auto")},i(f){r||(y(a),y(o),r=!0)},o(f){B(a),B(o),r=!1},d(f){a&&a.d(f),f&&G(e),f&&G(l),m[i].d(),n()}}}function Ne(t){let e,l,i,o;return i=new Y({}),{c(){e=w("div"),l=w("div"),M(i.$$.fragment),h(l,"class","h-5 dark:text-white opacity-50"),h(e,"class","h-full min-h-[15rem] flex justify-center items-center")},m(n,r){C(n,e,r),j(e,l),N(i,l,null),o=!0},p:U,i(n){o||(y(i.$$.fragment,n),o=!0)},o(n){B(i.$$.fragment,n),o=!1},d(n){n&&G(e),S(i)}}}function X(t){let e,l,i,o,n,r,a,p,m,g,f,c,z;l=new Le({}),l.$on("clear",t[21]);let s=t[10][t[7]][1]&&$(t),b=t[10],k=[];for(let u=0;u<b.length;u+=1)k[u]=x(Q(t,b,u));return{c(){e=w("div"),M(l.$$.fragment),i=D(),o=w("img"),p=D(),s&&s.c(),m=D(),g=w("div");for(let u=0;u<k.length;u+=1)k[u].c();h(o,"class","w-full object-contain h-[calc(100%-50px)"),L(o.src,n=t[10][t[7]][0].data)||h(o,"src",n),h(o,"alt",r=t[10][t[7]][1]||""),h(o,"title",a=t[10][t[7]][1]||null),J(o,"height","calc(100% - "+(t[10][t[7]][1]?"80px":"60px")+")"),h(g,"class","absolute h-[60px] overflow-x-scroll scroll-hide w-full bottom-0 flex gap-1.5 items-center py-2 text-sm px-3 justify-center"),h(e,"class","absolute group inset-0 z-10 flex flex-col bg-white/90 dark:bg-gray-900 backdrop-blur h-full"),A(e,"min-h-[350px]",t[6].height!=="auto"),A(e,"max-h-[55vh]",t[6].height!=="auto"),A(e,"xl:min-h-[450px]",t[6].height!=="auto")},m(u,d){C(u,e,d),N(l,e,null),j(e,i),j(e,o),j(e,p),s&&s.m(e,null),j(e,m),j(e,g);for(let v=0;v<k.length;v+=1)k[v].m(g,null);t[25](g),f=!0,c||(z=[T(o,"click",t[22]),T(e,"keydown",t[16])],c=!0)},p(u,d){if((!f||d[0]&1152&&!L(o.src,n=u[10][u[7]][0].data))&&h(o,"src",n),(!f||d[0]&1152&&r!==(r=u[10][u[7]][1]||""))&&h(o,"alt",r),(!f||d[0]&1152&&a!==(a=u[10][u[7]][1]||null))&&h(o,"title",a),(!f||d[0]&1152)&&J(o,"height","calc(100% - "+(u[10][u[7]][1]?"80px":"60px")+")"),u[10][u[7]][1]?s?s.p(u,d):(s=$(u),s.c(),s.m(e,m)):s&&(s.d(1),s=null),d[0]&3200){b=u[10];let v;for(v=0;v<b.length;v+=1){const I=Q(u,b,v);k[v]?k[v].p(I,d):(k[v]=x(I),k[v].c(),k[v].m(g,null))}for(;v<k.length;v+=1)k[v].d(1);k.length=b.length}d[0]&64&&A(e,"min-h-[350px]",u[6].height!=="auto"),d[0]&64&&A(e,"max-h-[55vh]",u[6].height!=="auto"),d[0]&64&&A(e,"xl:min-h-[450px]",u[6].height!=="auto")},i(u){f||(y(l.$$.fragment,u),f=!0)},o(u){B(l.$$.fragment,u),f=!1},d(u){u&&G(e),S(l),s&&s.d(),oe(k,u),t[25](null),c=!1,De(z)}}}function $(t){let e,l,i=t[10][t[7]][1]+"",o;return{c(){e=w("div"),l=w("div"),o=ne(i),h(l,"class","dark:text-gray-200 font-semibold px-3 py-1 max-w-full truncate"),h(e,"class","bottom-[50px] absolute z-[5] flex justify-center w-full")},m(n,r){C(n,e,r),j(e,l),j(l,o)},p(n,r){r[0]&1152&&i!==(i=n[10][n[7]][1]+"")&&ie(o,i)},d(n){n&&G(e)}}}function x(t){let e,l,i,o,n,r,a,p=t[33],m,g;const f=()=>t[23](e,p),c=()=>t[23](null,p);function z(){return t[24](t[33])}return{c(){e=w("button"),l=w("img"),r=D(),h(l,"class","h-full w-full overflow-hidden object-contain"),L(l.src,i=t[30][0].data)||h(l,"src",i),h(l,"title",o=t[30][1]||null),h(l,"alt",n=t[30][1]||null),h(e,"class",a="gallery-item !flex-none !h-9 !w-9 transition-all duration-75 "+(t[7]===t[33]?"!ring-2 !ring-orange-500 hover:!ring-orange-500":"scale-90 transform")+" svelte-1g9btlg")},m(s,b){C(s,e,b),j(e,l),j(e,r),f(),m||(g=T(e,"click",z),m=!0)},p(s,b){t=s,b[0]&1024&&!L(l.src,i=t[30][0].data)&&h(l,"src",i),b[0]&1024&&o!==(o=t[30][1]||null)&&h(l,"title",o),b[0]&1024&&n!==(n=t[30][1]||null)&&h(l,"alt",n),b[0]&128&&a!==(a="gallery-item !flex-none !h-9 !w-9 transition-all duration-75 "+(t[7]===t[33]?"!ring-2 !ring-orange-500 hover:!ring-orange-500":"scale-90 transform")+" svelte-1g9btlg")&&h(e,"class",a),p!==t[33]&&(c(),p=t[33],f())},d(s){s&&G(e),c(),m=!1,g()}}}function Se(t){let e,l,i=t[10],o=[];for(let n=0;n<i.length;n+=1)o[n]=le(O(t,i,n));return{c(){e=w("div");for(let n=0;n<o.length;n+=1)o[n].c();h(e,"class",l="grid gap-2 "+t[13]+" svelte-1g9btlg"),A(e,"pt-6",t[1])},m(n,r){C(n,e,r);for(let a=0;a<o.length;a+=1)o[a].m(e,null)},p(n,r){if(r[0]&17536){i=n[10];let a;for(a=0;a<i.length;a+=1){const p=O(n,i,a);o[a]?o[a].p(p,r):(o[a]=le(p),o[a].c(),o[a].m(e,null))}for(;a<o.length;a+=1)o[a].d(1);o.length=i.length}r[0]&8192&&l!==(l="grid gap-2 "+n[13]+" svelte-1g9btlg")&&h(e,"class",l),r[0]&8194&&A(e,"pt-6",n[1])},i:U,o:U,d(n){n&&G(e),oe(o,n)}}}function Te(t){let e,l,i,o;return i=new Y({}),{c(){e=w("div"),l=w("div"),M(i.$$.fragment),h(l,"class","h-5 dark:text-white opacity-50"),h(e,"class","h-full min-h-[15rem] flex justify-center items-center")},m(n,r){C(n,e,r),j(e,l),N(i,l,null),o=!0},p:U,i(n){o||(y(i.$$.fragment,n),o=!0)},o(n){B(i.$$.fragment,n),o=!1},d(n){n&&G(e),S(i)}}}function ee(t){let e,l,i=t[31]+"",o;return{c(){e=w("div"),l=w("div"),o=ne(i),h(l,"class","bg-gray-50 dark:bg-gray-700 dark:text-gray-200 text-xs border-t border-l dark:border-gray-600 font-semibold px-3 py-1 rounded-tl-lg group-hover:opacity-50 max-w-full truncate"),h(e,"class","bottom-0 absolute z-[5] flex justify-end w-full")},m(n,r){C(n,e,r),j(e,l),j(l,o)},p(n,r){r[0]&1024&&i!==(i=n[31]+"")&&ie(o,i)},d(n){n&&G(e)}}}function le(t){let e,l,i,o,n,r,a,p,m=t[31]&&ee(t);function g(){return t[26](t[33])}return{c(){e=w("button"),l=w("img"),n=D(),m&&m.c(),r=D(),h(l,"alt",i=t[31]||""),h(l,"class","h-full w-full overflow-hidden object-contain"),L(l.src,o=typeof t[30]=="string"?t[30]:t[30].data)||h(l,"src",o),h(e,"class","gallery-item group svelte-1g9btlg")},m(f,c){C(f,e,c),j(e,l),j(e,n),m&&m.m(e,null),j(e,r),a||(p=T(e,"click",g),a=!0)},p(f,c){t=f,c[0]&1024&&i!==(i=t[31]||"")&&h(l,"alt",i),c[0]&1024&&!L(l.src,o=typeof t[30]=="string"?t[30]:t[30].data)&&h(l,"src",o),t[31]?m?m.p(t,c):(m=ee(t),m.c(),m.m(e,r)):m&&(m.d(1),m=null)},d(f){f&&G(e),m&&m.d(),a=!1,p()}}}function qe(t){let e,l,i,o,n,r,a;const p=[t[0]];let m={};for(let s=0;s<p.length;s+=1)m=je(m,p[s]);e=new ze({props:m});let g=t[1]&&W(t);const f=[Ne,Me],c=[];function z(s,b){return s[5]===null||s[10]===null?0:1}return o=z(t),n=c[o]=f[o](t),{c(){M(e.$$.fragment),l=D(),g&&g.c(),i=D(),n.c(),r=Ae()},m(s,b){N(e,s,b),C(s,l,b),g&&g.m(s,b),C(s,i,b),c[o].m(s,b),C(s,r,b),a=!0},p(s,b){const k=b[0]&1?Be(p,[Ce(s[0])]):{};e.$set(k),s[1]?g?(g.p(s,b),b[0]&2&&y(g,1)):(g=W(s),g.c(),y(g,1),g.m(i.parentNode,i)):g&&(E(),B(g,1,1,()=>{g=null}),H());let u=o;o=z(s),o===u?c[o].p(s,b):(E(),B(c[u],1,1,()=>{c[u]=null}),H(),n=c[o],n?n.p(s,b):(n=c[o]=f[o](s),n.c()),y(n,1),n.m(r.parentNode,r))},i(s){a||(y(e.$$.fragment,s),y(g),y(n),a=!0)},o(s){B(e.$$.fragment,s),B(g),B(n),a=!1},d(s){S(e,s),s&&G(l),g&&g.d(s),s&&G(i),c[o].d(s),s&&G(r)}}}function Ee(t){let e,l,i,o;return te(t[20]),e=new we({props:{visible:t[4],variant:"solid",color:"grey",padding:!1,elem_id:t[3],disable:typeof t[6].container=="boolean"&&!t[6].container,$$slots:{default:[qe]},$$scope:{ctx:t}}}),{c(){M(e.$$.fragment)},m(n,r){N(e,n,r),l=!0,i||(o=T(window,"resize",t[20]),i=!0)},p(n,r){const a={};r[0]&16&&(a.visible=n[4]),r[0]&8&&(a.elem_id=n[3]),r[0]&64&&(a.disable=typeof n[6].container=="boolean"&&!n[6].container),r[0]&64999|r[1]&16&&(a.$$scope={dirty:r,ctx:n}),e.$set(a)},i(n){l||(y(e.$$.fragment,n),l=!0)},o(n){B(e.$$.fragment,n),l=!1},d(n){S(e,n),i=!1,o()}}}function He(t,e,l){let i,o,n,r,a,{loading_status:p}=e,{show_label:m}=e,{label:g}=e,{root:f}=e,{root_url:c}=e,{elem_id:z=""}=e,{visible:s=!0}=e,{value:b=null}=e,{style:k={}}=e,u=null,d=null;function v(_){switch(_.code){case"Escape":_.preventDefault(),l(7,d=null);break;case"ArrowLeft":_.preventDefault(),l(7,d=o);break;case"ArrowRight":_.preventDefault(),l(7,d=n);break}}let I=[],R;async function ae(_){if(typeof _!="number")return;await Ge(),I[_].focus();const{left:P,width:he}=R.getBoundingClientRect(),{left:be,width:de}=I[_].getBoundingClientRect(),Z=be-P+de/2-he/2+R.scrollLeft;R.scrollTo({left:Z<0?0:Z,behavior:"smooth"})}let q=0,V=0;function se(){l(9,V=window.innerHeight)}const re=()=>l(7,d=null),fe=()=>l(7,d=n);function ue(_,P){F[_?"unshift":"push"](()=>{I[P]=_,l(11,I)})}const _e=_=>l(7,d=_);function ce(_){F[_?"unshift":"push"](()=>{R=_,l(12,R)})}const me=_=>l(7,d=r?_:d);function ge(){q=this.clientHeight,l(8,q)}return t.$$set=_=>{"loading_status"in _&&l(0,p=_.loading_status),"show_label"in _&&l(1,m=_.show_label),"label"in _&&l(2,g=_.label),"root"in _&&l(17,f=_.root),"root_url"in _&&l(18,c=_.root_url),"elem_id"in _&&l(3,z=_.elem_id),"visible"in _&&l(4,s=_.visible),"value"in _&&l(5,b=_.value),"style"in _&&l(6,k=_.style)},t.$$.update=()=>{t.$$.dirty[0]&393248&&l(10,i=b===null?null:b.map(_=>Array.isArray(_)?[K(_[0],c??f),_[1]]:[K(_,c??f),null])),t.$$.dirty[0]&524320&&u!==b&&(l(7,d=null),l(19,u=b)),t.$$.dirty[0]&1152&&(o=((d??0)+(i?.length??0)-1)%(i?.length??0)),t.$$.dirty[0]&1152&&l(15,n=((d??0)+1)%(i?.length??0)),t.$$.dirty[0]&128&&ae(d),t.$$.dirty[0]&768&&l(14,r=V>=q),t.$$.dirty[0]&64&&l(13,{classes:a}=ye(k,["grid"]),a)},[p,m,g,z,s,b,k,d,q,V,i,I,R,a,r,n,v,f,c,u,se,re,fe,ue,_e,ce,me,ge]}class Ue extends pe{constructor(e){super(),ke(this,e,He,Ee,ve,{loading_status:0,show_label:1,label:2,root:17,root_url:18,elem_id:3,visible:4,value:5,style:6},null,[-1,-1])}}var Ke=Ue;const Oe=["static"],Qe=t=>({type:"Array<{ name: string } | [{ name: string }, string]>",description:"list of objects with filename and optional caption"});export{Ke as Component,Qe as document,Oe as modes};
//# sourceMappingURL=index.50b5507a.js.map