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;ut[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{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