vendor: 6,832 bytes, line 1
1import{D as $e,p as g,i as O,e as fe,b as _e,f as be,d as et,S as tt,C as it,r as We,t as rt,u as nt,G as at,g as Le}from"./i18n-DhLovEFo.js";import{M as ue,aa as le,a5 as ke,W as st,as as ot,Q as ie,T as re,S as H,a3 as lt,t as we,X as l,a as E,O as ce,a8 as V,$ as D,a1 as ne,N as G,R as K,G as Ie,ap as ut,a9 as ve,Y as M}from"./index-9Ev7iYt6.js";import{b as Re}from"./size-COeWeQdF.js";import{s as Xe}from"./snippet-xbRfGdXG.js";import{s as xe}from"./select-BigU4G0v.js";import{d as ct}from"./dispatch-kxCwF96_.js";import{I as ye}from"./ScrollFade.svelte_svelte_type_style_lang-ogAEaD61.js";import{B as je}from"./BlockLabel-CqQRDPfZ.js";import{D as Oe}from"./DownloadLink-hEoT-mAd.js";import{E as Ge}from"./Empty-B_oS1nZx.js";import{C as Ne}from"./Clear-D8pztZ4O.js";import{D as Fe}from"./Download-BvDI8Efl.js";import{I as Me}from"./Image-BtruDAal.js";import{U as dt}from"./Undo-DTF74Pc_.js";import{I as ht}from"./IconButtonWrapper-DATTLsrh.js";import{F as gt}from"./FullscreenButton-CgU9eLeA.js";import{r as ft,l as _t}from"./StreamingBar.svelte_svelte_type_style_lang-D07DuzRz.js";import{i as Pe,S as Ce}from"./index-BKfLiH8b.js";import{U as Be}from"./Upload-yxDsxAyc.js";import{B as Ue}from"./Block-MCGnkHAA.js";import{U as mt}from"./UploadText-CYZU968p.js";import"./Maximize-DX4p_OSq.js";import"./html-CfSn455r.js";import"./index-B_pwUImq.js";import"./actions-DWbx7e_v.js";function vt(r){return r}function De(r,e){if(r===e||r!==r)return()=>r;const t=typeof r;if(t!==typeof e||Array.isArray(r)!==Array.isArray(e))throw new Error("Cannot interpolate values of different type");if(Array.isArray(r)){const n=e.map((s,i)=>De(r[i],s));return s=>n.map(i=>i(s))}if(t==="object"){if(!r||!e)throw new Error("Object cannot be null");if(Pe(r)&&Pe(e)){const i=r.getTime(),c=e.getTime()-i;return d=>new Date(i+d*c)}const n=Object.keys(e),s={};return n.forEach(i=>{s[i]=De(r[i],e[i])}),i=>{const u={};return n.forEach(c=>{u[c]=s[c](i)}),u}}if(t==="number"){const n=e-r;return s=>r+s*n}return()=>e}function pt(r,e={}){const t=$e(r);let n,s=r;function i(u,c){if(s=u,r==null)return t.set(r=u),Promise.resolve();let d=n,p=!1,{delay:m=0,duration:X=400,easing:h=vt,interpolate:W=De}={...e,...c};if(X===0)return d&&(d.abort(),d=null),t.set(r=s),Promise.resolve();const b=ft.now()+m;let x;return n=_t(I=>{if(I<b)return!0;p||(x=W(r,u),typeof X=="function"&&(X=X(r,u)),p=!0),d&&(d.abort(),d=null);const k=I-b;return k>X?(t.set(r=u),!1):(t.set(r=x(h(k/X))),!0)}),n.promise}return{set:i,update:(u,c)=>i(u(s,r),c),subscribe:t.subscribe}}function bt(r){let e;for(;e=r.sourceEvent;)r=e;return r}function Ae(r,e){if(r=bt(r),e===void 0&&(e=r.currentTarget),e){var t=e.ownerSVGElement||e;if(t.createSVGPoint){var n=t.createSVGPoint();return n.x=r.clientX,n.y=r.clientY,n=n.matrixTransform(e.getScreenCTM().inverse()),[n.x,n.y]}if(e.getBoundingClientRect){var s=e.getBoundingClientRect();return[r.clientX-s.left-e.clientLeft,r.clientY-s.top-e.clientTop]}}return[r.pageX,r.pageY]}const wt={passive:!1},ze={capture:!0,passive:!1};function Ee(r){r.stopImmediatePropagation()}function me(r){r.preventDefault(),r.stopImmediatePropagation()}function yt(r){var e=r.document.documentElement,t=xe(r).on("dragstart.drag",me,ze);"onselectstart"in e?t.on("selectstart.drag",me,ze):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function xt(r,e){var t=r.document.documentElement,n=xe(r).on("dragstart.drag",null);e&&(n.on("click.drag",me,ze),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in t?n.on("selectstart.drag",null):(t.style.MozUserSelect=t.__noselect,delete t.__noselect)}const Ye=r=>()=>r;function Se(r,{sourceEvent:e,subject:t,target:n,identifier:s,active:i,x:u,y:c,dx:d,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:r,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}Se.prototype.on=function(){var r=this._.on.apply(this._,arguments);return r===this._?this:r};function zt(r){return!r.ctrlKey&&!r.button}function Yt(){return this.parentNode}function Xt(r,e){return e??{x:r.x,y:r.y}}function Mt(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tt(){var r=zt,e=Yt,t=Xt,n=Mt,s={},i=ct("start","drag","end"),u=0,c,d,p,m,X=0;function h(a){a.on("mousedown.drag",W).filter(n).on("touchstart.drag",I).on("touchmove.drag",k,wt).on("touchend.drag touchcancel.drag",L).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function W(a,f){if(!(m||!r.call(this,a,f))){var z=C(this,e.call(this,a,f),a,f,"mouse");z&&(xe(a.view).on("mousemove.drag",b,ze).on("mouseup.drag",x,ze),yt(a.view),Ee(a),p=!1,c=a.clientX,d=a.clientY,z("start",a))}}function b(a){if(me(a),!p){var f=a.clientX-c,z=a.clientY-d;p=f*f+z*z>X}s.mouse("drag",a)}function x(a){xe(a.view).on("mousemove.drag mouseup.drag",null),xt(a.view,p),me(a),s.mouse("end",a)}function I(a,f){if(r.call(this,a,f)){var z=a.changedTouches,Y=e.call(this,a,f),o=z.length,T,S;for(T=0;T<o;++T)(S=C(this,Y,a,f,z[T].identifier,z[T]))&&(Ee(a),S("start",a,z[T]))}}function k(a){var f=a.changedTouches,z=f.length,Y,o;for(Y=0;Y<z;++Y)(o=s[f[Y].identifier])&&(me(a),o("drag",a,f[Y]))}function L(a){var f=a.changedTouches,z=f.length,Y,o;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),Y=0;Y<z;++Y)(o=s[f[Y].identifier])&&(Ee(a),o("end",a,f[Y]))}function C(a,f,z,Y,o,T){var S=i.copy(),y=Ae(T||z,f),B,P,Q;if((Q=t.call(a,new Se("beforestart",{sourceEvent:z,target:h,identifier:o,active:u,x:y[0],y:y[1],dx:0,dy:0,dispatch:S}),Y))!=null)return B=Q.x-y[0]||0,P=Q.y-y[1]||0,function ae(_,J,Z){var de=y,U;switch(_){case"start":s[o]=ae,U=u++;break;case"end":delete s[o],--u;case"drag":y=Ae(Z||J,f),U=u;break}S.call(_,a,new Se(_,{sourceEvent:J,subject:Q,target:h,identifier:o,active:U,x:y[0]+B,y:y[1]+P,dx:y[0]-de[0],dy:y[1]-de[1],dispatch:S}),Y)}}return h.filter=function(a){return arguments.length?(r=typeof a=="function"?a:Ye(!!a),h):r},h.container=function(a){return arguments.length?(e=typeof a=="function"?a:Ye(a),h):e},h.subject=function(a){return arguments.length?(t=typeof a=="function"?a:Ye(a),h):t},h.touchable=function(a){return arguments.length?(n=typeof a=="function"?a:Ye(!!a),h):n},h.on=function(){var a=i.on.apply(i,arguments);return a===i?h:a},h.clickDistance=function(a){return arguments.length?(X=(a=+a)*a,h):Math.sqrt(X)},h}var Et=K('<div class="wrap svelte-b2bl92" role="none"><div class="content svelte-b2bl92"><!></div> <div data-testid="slider" role="none"><span><span class="icon left svelte-b2bl92">
1â¢</span><span class="icon center svelte-b2bl92"></span><span class="icon right svelte-b2bl92">â¢</span></span> <div class="inner svelte-b2bl92"></div></div></div>');function He(r,e){ue(e,!0);function t(_,J,Z){return Math.min(Math.max(_,J),Z)}let n=g(e,"position",15,.5),s=g(e,"disabled",3,!1),i=g(e,"slider_color",3,"var(--border-color-primary)"),u=g(e,"image_size",23,()=>({top:0,left:0,width:0,height:0})),c=g(e,"el",15,void 0),d=g(e,"parent_el",15,void 0),p,m=V(0),X=V(!1),h=V(0);function W(_){D(h,d()?.getBoundingClientRect().width||0,!0),_===0&&(u().width=c()?.getBoundingClientRect().width||0),D(m,t(u().width*n()+u().left,0,l(h)),!0)}function b(_,J){const Z=Math.pow(10,J);return Math.round((_+Number.EPSILON)*Z)/Z}function x(_){D(m,t(_,0,l(h)),!0),n(b((_-u().left)/u().width,5))}function I(_){s()||(D(X,!0),x(_.x))}function k(_){s()||x(_.x)}function L(){s()||D(X,!1)}function C(_){D(m,t(u().width*_+u().left,0,l(h)),!0)}le(()=>{W(u().width)}),le(()=>{C(n())}),ke(()=>{W(u().width);const _=Tt().on("start",I).on("drag",k).on("end",L);xe(p).call(_)});var a=Et();st("resize",ot,()=>W(u().width));var f=ie(a),z=ie(f);{var Y=_=>{var J=ne(),Z=G(J);Xe(Z,()=>e.children),E(_,J)};O(z,_=>{e.children&&_(Y)})}re(f),fe(f,_=>c(_),()=>c());var o=H(f,2);let T;var S=ie(o);let y;var B=H(ie(S));let P;lt(),re(S);var Q=H(S,2);let ae;re(o),fe(o,_=>p=_,()=>p),re(a),fe(a,_=>d(_),()=>d()),we(()=>{T=_e(o,1,"outer svelte-b2bl92",null,T,{disabled:s(),grab:l(X)}),be(o,`transform: translateX(${l(m)??""}px)`),y=_e(S,1,"icon-wrap svelte-b2bl92",null,y,{active:l(X),disabled:s()}),P=be(B,"",P,{"--color":i()}),ae=be(Q,"",ae,{"--color":i()})}),E(r,a),ce()}var Rt=K("<img/>");function Te(r,e){ue(e,!0);let t=g(e,"src",3,void 0),n=g(e,"fullscreen",3,!1),s=g(e,"fixed",3,!1),i=g(e,"transform",3,"translate(0px, 0px) scale(1)"),u=g(e,"img_el",15),c=g(e,"hidden",3,!1),d=g(e,"variant",3,"upload"),p=g(e,"max_height",3,500),m=We(e,["$$slots","$$events","$$legacy","src","fullscreen","fixed","transform","img_el","hidden","variant","max_height","onload"]);function X(b){if(!b)return{top:0,left:0,width:0,height:0};const x=b.parentElement?.getBoundingClientRect();if(!x)return{top:0,left:0,width:0,height:0};const I=b.naturalWidth/b.naturalHeight,k=x.width/x.height;let L,C;I>k?(L=x.width,C=x.width/I):(C=x.height,L=x.height*I);const a=(x.width-L)/2;return{top:(x.height-C)/2,left:a,width:L,height:C}}ke(()=>{const b=new ResizeObserver(async x=>{for(const I of x)await Ie(),e.onload?.(X(u()))});return b.observe(u()),()=>{b.disconnect()}});var h=Rt(),W=()=>e.onload?.(X(u()));et(h,()=>({src:t(),"data-testid":"imageslider-image",...m,onload:W,[it]:{fixed:s(),hidden:c(),preview:d()==="preview",slider:d()==="upload",fullscreen:n(),small:!n()},[tt]:{transform:i(),"max-height":p()&&!n()?`${p()}px`:null}}),void 0,void 0,void 0,"svelte-j3ek2n"),fe(h,b=>u(b),()=>u()),ut(h),E(r,h),ce()}class Dt{container;image;scale;offsetX;offsetY;isDragging;lastX;lastY;initial_left_padding;initial_top_padding;initial_width;initial_height;subscribers;handleImageLoad;real_image_size={top:0,left:0,width:0,height:0};last_touch_distance;constructor(e,t){this.container=e,this.image=t,this.scale=1,this.offsetX=0,this.offsetY=0,this.isDragging=!1,this.lastX=0,this.lastY=0,this.initial_left_padding=0,this.initial_top_padding=0,this.initial_width=0,this.initial_height=0,this.subscribers=[],this.last_touch_distance=0,this.handleWheel=this.handleWheel.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.handleImageLoad=this.init.bind(this),this.handleTouchStart=this.handleTouchStart.bind(this),this.handleTouchMove=this.handleTouchMove.bind(this),this.handleTouchEnd=this.handleTouchEnd.bind(this),this.image.addEventListener("load",this.handleImageLoad),this.container.addEventListener("wheel",this.handleWheel),this.container.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("mouseup",this.handleMouseUp),this.container.addEventListener("touchstart",this.handleTouchStart),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("touchend",this.handleTouchEnd),new ResizeObserver(s=>{for(const i of s)i.target===this.container&&(this.handleResize(),this.get_image_size(this.image))}).observe(this.container)}handleResize(){this.init()}init(){const e=this.container.getBoundingClientRect(),t=this.image.getBoundingClientRect();this.initial_left_padding=t.left-e.left,this.initial_top_padding=t.top-e.top,this.initial_width=t.width,this.initial_height=t.height,this.reset_zoom(),this.updateTransform()}reset_zoom(){this.scale=1,this.offsetX=0,this.offsetY=0,this.updateTransform()}handleMouseDown(e){const t=this.image.getBoundingClientRect();if(e.clientX>=t.left&&e.clientX<=t.right&&e.clientY>
vendor: 5,024 bytes, line 1
1=t.top&&e.clientY<=t.bottom){if(e.preventDefault(),this.scale===1)return;this.isDragging=!0,this.lastX=e.clientX,this.lastY=e.clientY,this.image.style.cursor="grabbing"}}handleMouseMove(e){if(!this.isDragging)return;const t=e.clientX-this.lastX,n=e.clientY-this.lastY;this.offsetX+=t,this.offsetY+=n,this.lastX=e.clientX,this.lastY=e.clientY,this.updateTransform(),this.updateTransform()}handleMouseUp(){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1,this.image.style.cursor=this.scale>1?"grab":"zoom-in")}async handleWheel(e){e.preventDefault();const t=this.container.getBoundingClientRect(),n=this.image.getBoundingClientRect();if(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)return;const s=1.05,i=this.scale,u=-Math.sign(e.deltaY)>0?Math.min(15,i*s):Math.max(1,i/s);if(u===i)return;const c=e.clientX-t.left-this.initial_left_padding,d=e.clientY-t.top-this.initial_top_padding;this.scale=u,this.offsetX=this.compute_new_offset({cursor_position:c,current_offset:this.offsetX,new_scale:u,old_scale:i}),this.offsetY=this.compute_new_offset({cursor_position:d,current_offset:this.offsetY,new_scale:u,old_scale:i}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.image.style.cursor=this.scale>1?"grab":"zoom-in"}compute_new_position({position:e,scale:t,anchor_position:n}){return e-(e-n)*(t/this.scale)}compute_new_offset({cursor_position:e,current_offset:t,new_scale:n,old_scale:s}){return e-n/s*(e-t)}constrain_to_bounds(e=!1){if(this.scale===1){this.offsetX=0,this.offsetY=0;return}const t={top:this.real_image_size.top*this.scale+this.offsetY,left:this.real_image_size.left*this.scale+this.offsetX,width:this.real_image_size.width*this.scale,height:this.real_image_size.height*this.scale,bottom:this.real_image_size.top*this.scale+this.offsetY+this.real_image_size.height*this.scale,right:this.real_image_size.left*this.scale+this.offsetX+this.real_image_size.width*this.scale},n=this.real_image_size.left+this.real_image_size.width,s=this.real_image_size.top+this.real_image_size.height;e&&(t.top>this.real_image_size.top?this.offsetY=this.calculate_position(this.real_image_size.top,0,"y"):t.bottom<s&&(this.offsetY=this.calculate_position(s,1,"y")),t.left>this.real_image_size.left?this.offsetX=this.calculate_position(this.real_image_size.left,0,"x"):t.right<n&&(this.offsetX=this.calculate_position(n,1,"x")))}updateTransform(){this.notify({x:this.offsetX,y:this.offsetY,scale:this.scale})}destroy(){this.container.removeEventListener("wheel",this.handleWheel),this.container.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),this.container.removeEventListener("touchstart",this.handleTouchStart),document.removeEventListener("touchmove",this.handleTouchMove),document.removeEventListener("touchend",this.handleTouchEnd),this.image.removeEventListener("load",this.handleImageLoad)}subscribe(e){this.subscribers.push(e)}unsubscribe(e){this.subscribers=this.subscribers.filter(t=>t!==e)}notify({x:e,y:t,scale:n}){this.subscribers.forEach(s=>s({x:e,y:t,scale:n}))}handleTouchStart(e){e.preventDefault();const t=this.image.getBoundingClientRect(),n=e.touches[0];if(n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom){if(e.touches.length===1&&this.scale>1)this.isDragging=!0,this.lastX=n.clientX,this.lastY=n.clientY;else if(e.touches.length===2){const s=e.touches[0],i=e.touches[1];this.last_touch_distance=Math.hypot(i.clientX-s.clientX,i.clientY-s.clientY)}}}get_image_size(e){if(!e)return;const t=e.parentElement?.getBoundingClientRect();if(!t)return;const n=e.naturalWidth/e.naturalHeight,s=t.width/t.height;let i,u;n>s?(i=t.width,u=t.width/n):(u=t.height,i=t.height*n);const c=(t.width-i)/2,d=(t.height-u)/2;this.real_image_size={top:d,left:c,width:i,height:u}}handleTouchMove(e){if(e.touches.length===1&&this.isDragging){e.preventDefault();const t=e.touches[0],n=t.clientX-this.lastX,s=t.clientY-this.lastY;this.offsetX+=n,this.offsetY+=s,this.lastX=t.clientX,this.lastY=t.clientY,this.updateTransform()}else if(e.touches.length===2){e.preventDefault();const t=e.touches[0],n=e.touches[1],s=Math.hypot(n.clientX-t.clientX,n.clientY-t.clientY);if(this.last_touch_distance===0){this.last_touch_distance=s;return}const i=s/this.last_touch_distance,u=this.scale,c=Math.min(15,Math.max(1,u*i));if(c===u){this.last_touch_distance=s;return}const d=this.container.getBoundingClientRect(),p=(t.clientX+n.clientX)/2-d.left-this.initial_left_padding,m=(t.clientY+n.clientY)/2-d.top-this.initial_top_padding;this.scale=c,this.offsetX=this.compute_new_offset({cursor_position:p,current_offset:this.offsetX,new_scale:c,old_scale:u}),this.offsetY=this.compute_new_offset({cursor_position:m,current_offset:this.offsetY,new_scale:c,old_scale:u}),this.updateTransform(),this.constrain_to_bounds(),this.updateTransform(),this.last_touch_distance=s,this.image.style.cursor=this.scale>
11?"grab":"zoom-in"}}handleTouchEnd(e){this.isDragging&&(this.constrain_to_bounds(!0),this.updateTransform(),this.isDragging=!1),e.touches.length===0&&(this.last_touch_distance=0)}calculate_position(e,t,n){if(this.container.getBoundingClientRect(),n==="x"){const s=e,i=this.real_image_size.left+t*this.real_image_size.width;return s-i*this.scale}if(n==="y"){const s=e,i=this.real_image_size.top+t*this.real_image_size.height;return s-i*this.scale}return 0}}var St=K("<!> <!> <!> <!>",1),kt=K("<!> <!>",1),It=K('<div class="image-container svelte-1880bc6"><!> <div><!></div></div>'),Lt=K("<!> <!>",1);function Pt(r,e){ue(e,!0);const t=()=>nt(a,"$transform",n),[n,s]=rt();let i=g(e,"value",31,()=>ve([null,null])),u=g(e,"label",3,void 0),c=g(e,"show_download_button",3,!0),d=g(e,"position",15,.5),p=g(e,"layer_images",3,!0),m=g(e,"show_single",3,!1),X=g(e,"show_fullscreen_button",3,!0),h=g(e,"fullscreen",15,!1),W=g(e,"buttons",3,null),b=g(e,"on_custom_button_click",3,null),x=g(e,"el_width",15,0),I=g(e,"interactive",3,!0),k=V(void 0),L=V(void 0),C,a=pt({x:0,y:0,z:1},{duration:75}),f,z=V(0),Y=V(0),o=V(ve({top:0,left:0,width:0,height:0})),T=M(()=>y(d(),l(Y),l(o).width,l(o).left,t().x,t().z)),S=M(()=>p()?`clip-path: inset(0 0 0 ${l(T)*100}%)`:"");function y(v,A,N,w,j,F){return(v*N+w-j)/F/A}let B=null,P=null;function Q(v,A){!v||!A||(B?.destroy(),P?.disconnect(),D(z,v?.getBoundingClientRect().width||0,!0),D(Y,A?.getBoundingClientRect().width||0,!0),B=new Dt(A,v),B.subscribe(({x:N,y:w,scale:j})=>{a.set({x:N,y:w,z:j})}),P=new ResizeObserver(N=>{for(const w of N)w.target===A&&D(Y,w.contentRect.width,!0),w.target===v&&D(z,w.contentRect.width,!0)}),P.observe(A),P.observe(v))}le(()=>{Q(l(k),l(L))}),ke(()=>()=>{B?.destroy(),P?.disconnect()});let ae;function _(v){D(o,v,!0)}var J=Lt(),Z=G(J);{let v=M(()=>u()||e.i18n("image.image"));je(Z,{get show_label(){return e.show_label},get Icon(){return Me},get label(){return l(v)}})}var de=H(Z,2);{var U=v=>{Ge(v,{unpadded_box:!0,size:"large",children:(A,N)=>{Me(A)},$$slots:{default:!0}})},$=v=>{var A=It(),N=ie(A);ht(N,{get buttons(){return W()},get on_custom_button_click(){return b()},children:(R,te)=>{var q=St(),se=G(q);{let ee=M(()=>e.i18n("common.undo")),oe=M(()=>t().z===1);ye(se,{get Icon(){return dt},get label(){return l(ee)},get disabled(){return l(oe)},onclick:()=>B?.reset_zoom()})}var he=H(se,2);{var pe=ee=>{gt(ee,{get fullscreen(){return h()},onclick:oe=>{h(oe),e.onfullscreen?.(oe)}})};O(he,ee=>{X()&&ee(pe)})}var ge=H(he,2);{var Ve=ee=>{{let oe=M(()=>i()[1]?.url),Ke=M(()=>i()[1]?.orig_name||"image");Oe(ee,{get href(){return l(oe)},get download(){return l(Ke)},children:(Qe,Vt)=>{{let Ze=M(()=>e.i18n("common.download"));ye(Qe,{get Icon(){return Fe},get label(){return l(Ze)}})}},$$slots:{default:!0}})}};O(ge,ee=>{c()&&ee(Ve)})}var Je=H(ge,2);{var qe=ee=>{ye(ee,{get Icon(){return Ne},label:"Remove Image",onclick:oe=>{i([null,null]),e.onclear?.(),oe.stopPropagation()}})};O(Je,ee=>{I()&&ee(qe)})}E(R,q)},$$slots:{default:!0}});var w=H(N,2);let j;var F=ie(w);He(F,{get slider_color(){return e.slider_color},get image_size(){return l(o)},get position(){return d()},set position(R){d(R)},get el(){return l(L)},set el(R){D(L,R,!0)},get parent_el(){return f},set parent_el(R){f=R},children:(R,te)=>{var q=kt(),se=G(q);{let pe=M(()=>i()?.[0]?.url);Te(se,{get src(){return l(pe)},alt:"",loading:"lazy",variant:"preview",get transform(){return`translate(${t().x??""}px, ${t().y??""}px) scale(${t().z??""})`},get fullscreen(){return h()},get max_height(){return e.max_height},onload:_,get img_el(){return l(k)},set img_el(ge){D(k,ge,!0)}})}var he=H(se,2);{let pe=M(()=>!i()?.[1]?.url),ge=M(()=>i()?.[1]?.url);Te(he,{variant:"preview",get fixed(){return p()},get hidden(){return l(pe)},get src(){return l(ge)},alt:"",loading:"lazy",get style(){return`${l(S)??""}; background: var(--block-background-fill);`},get transform(){return`translate(${t().x??""}px, ${t().y??""}px) scale(${t().z??""})`},get fullscreen(){return h()},get max_height(){return e.max_height},onload:_})}E(R,q)},$$slots:{default:!0}}),re(w),fe(w,R=>ae=R,()=>ae),re(A),fe(A,R=>C=R,()=>C),we(()=>j=_e(w,1,"slider-wrap svelte-1880bc6",null,j,{limit_height:!h()})),Re(w,"clientWidth",x),E(v,A)};O(de,v=>{(i()===null||i()[0]===null||i()[1]===null)&&!m()?v(U):v($,!1)})}E(r,J),ce(),s()}var Ct=K('<div class="svelte-2ufkjh"><!></div>');function Bt(r,e){ue(e,!0);var t=Ct(),n=ie(t);ye(n,{get Icon(){return Ne}
1,label:"Remove Image",onclick:s=>{e.onremove_image?.(),s.stopPropagation()}}),re(t),E(r,t),ce()}var Ut=K('<div class="icon-buttons svelte-1c8zs50"><!></div>'),At=K("<div><!></div>"),Wt=K("<div><!></div>"),jt=K("<div><!> <!></div>"),Ot=K('<!> <div data-testid="image" class="image-container svelte-1c8zs50"><!> <!> <!></div>',1);function Gt(r,e){ue(e,!0);let t=g(e,"value",31,()=>ve([null,null])),n=g(e,"label",3,void 0),s=g(e,"position",15,.5),i=g(e,"upload_count",3,2),u=g(e,"show_download_button",3,!0),c=g(e,"max_file_size",3,null),d=g(e,"upload_promise",15),p=g(e,"dragging",15,!1),m=V(ve(t()||[null,null])),X,h=V(0),W=V(0);async function b(o,T){const S=Array.isArray(o)?o:[o],y=[t()[0],t()[1]];S.length>1?y[T]=S[0]:y[T]=S[T],t(y),await Ie(),e.onupload?.(y)}let x="";le(()=>{JSON.stringify(t())!==x&&(x=JSON.stringify(t()),D(m,t(),!0))}),le(()=>{e.ondrag?.(p())});var I=Ot(),k=G(I);{let o=M(()=>n()||e.i18n("image.image"));je(k,{get show_label(){return e.show_label},get Icon(){return Me},get label(){return l(o)}})}var L=H(k,2),C=ie(L);{var a=o=>{Bt(o,{onremove_image:()=>{s(.5),t([null,null]),e.onclear?.()}})};O(C,o=>{(t()?.[0]?.url||t()?.[1]?.url)&&o(a)})}var f=H(C,2);{var z=o=>{var T=Ut(),S=ie(T);{var y=B=>{{let P=M(()=>t()[1].orig_name||"image");Oe(B,{get href(){return t()[1].url},get download(){return l(P)},children:(Q,ae)=>{ye(Q,{get Icon(){return Fe}})},$$slots:{default:!0}})}};O(S,B=>{u()&&B(y)})}re(T),E(o,T)};O(f,o=>{t()?.[1]?.url&&o(z)})}var Y=H(f,2);{let o=M(()=>i()==2||!t()?.[0]);He(Y,{get disabled(){return l(o)},get slider_color(){return e.slider_color},get position(){return s()},set position(T){s(T)},children:(T,S)=>
1{var y=jt();let B,P;var Q=ie(y);{var ae=U=>{var $=At();let v;var A=ie($);{let N=M(()=>!!t()?.[0]);Be(A,{filetype:"image/*",onload:w=>b(w,0),get disable_click(){return l(N)},get root(){return e.root},file_count:"multiple",get upload(){return e.upload},get stream_handler(){return e.stream_handler},get max_file_size(){return c()},get upload_promise(){return d()},set upload_promise(w){d(w)},get dragging(){return p()},set dragging(w){p(w)},children:(w,j)=>{var F=ne(),R=G(F);{var te=q=>{var se=ne(),he=G(se);Xe(he,()=>e.children),E(q,se)};O(R,q=>{e.children&&q(te)})}E(w,F)},$$slots:{default:!0}})}re($),we(()=>v=_e($,1,"wrap svelte-1c8zs50",null,v,{"half-wrap":i()===1})),E(U,$)},_=U=>{{let $=M(()=>l(m)[0]?.url);Te(U,{variant:"upload",get src(){return l($)},alt:"",get max_height(){return e.max_height},get img_el(){return X},set img_el(v){X=v}})}};O(Q,U=>{l(m)?.[0]?U(_,!1):U(ae)})}var J=H(Q,2);{var Z=U=>{{let $=M(()=>!!t()?.[1]);Be(U,{filetype:"image/*",onload:v=>b(v,1),get disable_click(){return l($)},get root(){return e.root},file_count:"multiple",get upload(){return e.upload},get stream_handler(){return e.stream_handler},get max_file_size(){return c()},get upload_promise(){return d()},set upload_promise(v){d(v)},get dragging(){return p()},set dragging(v){p(v)},children:(v,A)=>{var N=ne(),w=G(N);{var j=F=>{var R=ne(),te=G(R);Xe(te,()=>e.children),E(F,R)};O(w,F=>{e.children&&F(j)})}E(v,N)},$$slots:{default:!0}})}},de=U=>
1{var $=ne(),v=G($);{var A=w=>{var j=Wt();let F,R;var te=ie(j);Ge(te,{unpadded_box:!0,size:"large",children:(q,se)=>{Me(q)},$$slots:{default:!0}}),re(j),we(()=>{F=_e(j,1,"empty-wrap fixed svelte-1c8zs50",null,F,{"white-icon":!t()?.[0]?.url}),R=be(j,"",R,{width:`${l(h)*(1-s())}px`,transform:`translateX(${l(h)*s()}px)`})}),E(w,j)},N=w=>{var j=ne(),F=G(j);{var R=te=>{{let q=M(()=>i()===1);Te(te,{variant:"upload",get src(){return l(m)[1].url},alt:"",get fixed(){return l(q)},transform:"translate(0px, 0px) scale(1)",get max_height(){return e.max_height}})}};O(F,te=>{l(m)?.[1]&&te(R)},!0)}E(w,j)};O(v,w=>{!l(m)?.[1]&&i()===1?w(A):w(N,!1)},!0)}E(U,$)};O(J,U=>{!l(m)?.[1]&&i()===2?U(Z):U(de,!1)})}re(y),we(()=>{B=_e(y,1,"upload-wrap svelte-1c8zs50",null,B,{"side-by-side":i()===2}),P=be(y,"",P,{display:i()===2?"flex":"block"})}),E(T,y)},$$slots:{default:!0}})}re(L),Re(L,"clientWidth",o=>D(h,o)),Re(L,"clientHeight",o=>D(W,o)),E(r,I),ce()}function Nt(r,e){ue(e,!0);let t=g(e,"value",31,()=>ve([null,null])),n=g(e,"upload_count",3,1),s=g(e,"dragging",15,!1),i=g(e,"max_file_size",3,null),u=g(e,"upload_promise",15);Gt(r,{slider_color:"var(--border-color-primary)",position:.5,get root(){return e.root},get onclear(){return e.onclear},ondrag:c=>{s(c),e.ondrag?.(c)},get onupload(){return e.onupload},get label(){return e.label},get show_label(){return e.show_label},get upload_count(){return n()},get stream_handler(){return e.stream_handler},get upload(){return e.upload},get max_file_size(){return i()},get max_height(){return e.max_height},get i18n(){return e.i18n},get upload_promise(){return u()},set upload_promise(c){u(c)},get value(){return t()},set value(c){t(c)},get dragging(){return s()},set dragging(c){s(c)},children:(c,d)=>{var p=ne(),m=G(p);{var X=h=>{var W=ne(),b=G(W);Xe(b,()=>e.children),E(h,W)};O(m,h=>{e.children&&h(X)})}E(c,p)},$$slots:{default:!0}}),ce()}var Ft=K("<!> <!>",1),Ht=K("<!> <!>",1);function bi(r,e){ue(e,!0);let t=V(void 0);class n extends at{async get_data(){return l(t)&&(await l(t),await Ie()),await super.get_data()}}const s=We(e,["$$slots","$$events","$$legacy"]),i=new n(s);let u=V(!1),c=V(!1),d=V(ve(i.props.value??[null,null])),p=M(()=>Math.max(0,Math.min(100,i.props.slider_position))/100);i.watch_for_change(),le(()=>{D(d,i.props.value??[null,null],!0)}),le(()=>{i.props.value=l(d)});var m=ne(),X=G(m);{var h=b=>{{let x=M(()=>l(c)?"focus":"base"),I=M(()=>i.props.height||void 0);Ue(b,{get visible(){return i.shared.visible},variant:"solid",get border_mode(){return l(x)},padding:!1,get elem_id(){return i.shared.elem_id},get elem_classes(){return i.shared.elem_classes},get height(){return l(I)},get width(){return i.props.width},allow_overflow:!1,get container(){return i.shared.container},get scale(){return i.shared.scale},get min_width(){return i.shared.min_width},get fullscreen(){return l(u)},set fullscreen(k){D(u,k,!0)},children:(k,L)=>{var C=Ft(),a=G(C);Ce(a,Le({get autoscroll(){return i.shared.autoscroll},get i18n(){return i.i18n}},()=>i.shared.loading_status));var f=H(a,2);{let z=M(()=>i.props.buttons.some(o=>typeof o=="string"&&o==="download")),Y=M(()=>i.props.buttons.some(o=>typeof o=="string"&&o==="fullscreen"));Pt(f,{onclear:()=>{i.dispatch("clear"),i.dispatch("input")},onfullscreen:o=>{D(u,o,!0)},get fullscreen(){return l(u)},get interactive(){return i.shared.interactive},get label(){return i.shared.label},get show_label(){return i.shared.show_label},get show_download_button(){return l(z)},get i18n(){return i.i18n},get show_fullscreen_button(){return l(Y)},get buttons(){return i.props.buttons},on_custom_button_click:o=>{i.dispatch("custom_button_click",{id:o})},get position(){return l(p)},get slider_color(){return i.props.slider_color},get max_height(){return i.props.max_height},get value(){return l(d)},set value(o){D(d,o,!0)}})}
1E(k,C)},$$slots:{default:!0}})}},W=b=>{{let x=M(()=>l(d)?.[0]||l(d)?.[1]?"solid":"dashed"),I=M(()=>l(c)?"focus":"base"),k=M(()=>i.props.height||void 0);Ue(b,{get visible(){return i.shared.visible},get variant(){return l(x)},get border_mode(){return l(I)},padding:!1,get elem_id(){return i.shared.elem_id},get elem_classes(){return i.shared.elem_classes},get height(){return l(k)},get width(){return i.props.width},allow_overflow:!1,get container(){return i.shared.container},get scale(){return i.shared.scale},get min_width(){return i.shared.min_width},children:(L,C)=>{var a=Ht(),f=G(a);Ce(f,Le({get autoscroll(){return i.shared.autoscroll},get i18n(){return i.i18n}},()=>i.shared.loading_status,{on_clear_status:()=>i.dispatch("clear_status",i.shared.loading_status)}));var z=H(f,2);{let Y=M(()=>i.shared.client?.stream);Nt(z,{get root(){return i.shared.root},onclear:()=>{i.dispatch("clear"),i.dispatch("input")},ondrag:o=>D(c,o,!0),onupload:()=>{i.dispatch("upload"),i.dispatch("input")},get label(){return i.shared.label},get show_label(){return i.shared.show_label},get upload_count(){return i.props.upload_count},get max_file_size(){return i.shared.max_file_size},get i18n(){return i.i18n},upload:(...o)=>i.shared.client.upload(...o),get stream_handler(){return l(Y)},get max_height(){return i.props.max_height},get upload_promise(){return l(t)},set upload_promise(o){D(t,o,!0)},get value(){return l(d)},set value(o){D(d,o,!0)},get dragging(){return l(c)},set dragging(o){D(c,o,!0)},children:(o,T)=>{var S=ne(),y=G(S);{var B=P=>{mt(P,{get i18n(){return i.i18n},type:"image",get placeholder(){return i.props.placeholder}})};O(y,P=>{P(B)})}E(o,S)},$$slots:{default:!0}})}E(L,a)},$$slots:{default:!0}})}};O(X,b=>{!i.shared.interactive||l(d)?.[1]&&l(d)?.[0]?b(h):b(W,!1)})}E(r,m),ce()}export{bi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.