PageSourceSearch

https://aanlyn.solidariteit.co.za/build/assets/index-DZmR65BL.js

js solidariteit.co.za collected 2026-09-24 22:32:04 UTC 681,512 bytes, 115 lines download raw bytes

1const mw=(e,t)=>{if(e.getUint16(t)!==65506)return;const n=e.getUint16(t+2);if(new TextDecoder().decode(e.buffer.slice(t+4,t+15))!=="ICC_PROFILE")return;t+=18;function r(f){return String.fromCharCode(l.getUint8(f),l.getUint8(f+1),l.getUint8(f+2),l.getUint8(f+3))}function a(f,d,m){const{buffer:g}=l;let p,y;if(f==="text")p=d+8,y=d+m-7;else if(f==="desc"){const w=l.getUint32(d+8);p=d+12,y=d+w+12}else if(f==="mluc"){const w=l.getUint32(d+20),_=l.getUint32(d+24);p=d+_,y=d+_+w}else return;return new TextDecoder().decode(g.slice(p,y)).replace(/\u0000|\x00/g,"")}const l=new DataView(e.buffer.slice(t,t+n)),s=l.getUint32(128),c=[];let u=132;for(let f=0;f<s;f++){const d=l.getUint32(u),m=l.getUint32(u+4);if(m>l.byteLength)break;const g=l.getUint32(u+8),p=r(m),y=a(p,m,g);if(d===J1){c.push({address:d,offset:m,size:g,type:p,value:y});break}u+=12}return{read:f=>{const d=c.find(m=>m.address===f);return d?d.value:void 0},write:(f,d)=>{}}},b0=(e,t,n,i,o=!0)=>{const r=[];let a=t;const l=Math.min(e.byteLength,t+n-16);for(;a<l;a+=12){const s=a;e.getUint16(s,o)===i&&r.push(s)}return r},gw=(e,t)=>{if(e.getUint16(t)!==65505)return;const n=e.getUint16(t+2);if(t+=4,e.getUint32(t)!==1165519206)return;t+=6;const i=e.getUint16(t);if(i!==18761&&i!==19789)return;const o=i===18761;if(t+=2,e.getUint16(t,o)===42)return t+=e.getUint32(t+2,o),{read:r=>{const a=b0(e,t,n,r,o);if(a.length)return e.getUint16(a[0]+8,o)},write:(r,a)=>{const l=b0(e,t,n,r,o);return l.length?(l.forEach(s=>e.setUint16(s+8,a,o)),!0):!1}}};var st=(...e)=>{};const bw=[{value:65504,name:"jfif",getTags:st},{value:65498,name:"sos",getTags:st},{value:65505,subvalue:17784,name:"exif",getTags:gw},{value:65505,subvalue:26740,name:"xmp",getTags:st},{value:65506,subvalue:19792,name:"mpf",getTags:st},{value:65506,name:"app2",getTags:mw}],pw=65496,yw=255;var Sw=e=>{if(e.getUint16(0)!==pw)return;const t=e.byteLength;let n=2,i,o;for(;n<t&&e.getUint8(n)===yw;){i=e.getUint16(n);const r=bw.find(a=>a.value===i?a.subvalue?a.subvalue===e.getUint16(n+2+2):!0:!1);if(r){const{name:a,getTags:l}=r;if(o||(o={}),!o[a]){let s=n;o[a]={offset:n,size:e.getUint16(n+2),getTags:()=>l(e,s)}}}if(i===65498)break;n+=2+e.getUint16(n+2)}return o};const Vu=274,J1=1684370275,ny=e=>{if(!e)return;const t=new DataView(e);return Sw(t)},iy=(e,t)=>{const n=ny(e);if(n)return Object.entries(t).reduce((i,[o,r])=>{if(!n[o])return i;const a=n[o].getTags();if(!a)return i;for(const l of r){const s=a.read(l);i[o]={...i[o],[l]:s}}return i},{})},ww=(e,t)=>{const n=ny(e);n&&Object.entries(t).forEach(([i,o])=>{if(!n[i])return;const r=n[i].getTags();r&&o.forEach(([a,l])=>{r.write(a,l)})})},p0="__pqina_webapi__";var Cm=e=>window[p0]?window[p0][e]:window[e];const _w={ArrayBuffer:"readAsArrayBuffer"};var Pm=(e,t=st,n={})=>new Promise((i,o)=>{const{dataFormat:r=_w.ArrayBuffer}=n,a=new(Cm("FileReader"));a.onload=()=>i(a.result),a.onerror=()=>o(a.error),a.onprogress=t,a[r](e)}),Tw=async(e,t=[0,e.size],n)=>await Pm(e.slice(...t),n),kw=async(e,t,n=[0,e.size],i)=>{const o=await Tw(e,n,i);return iy(o,t)};let l1=null;var zo=()=>(l1===null&&(l1=typeof window<"u"&&typeof window.document<"u"),l1);let $f=null;var Zd=()=>new Promise(e=>{if($f===null){const t="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";let n=zo()?new Image:{};n.onload=()=>{$f=n.naturalWidth===1,n=void 0,e($f)},n.src=t;return}return e($f)}),xc=(e,t)=>{const{colorSpace:n="srgb"}=t||{};return e.getContext("2d",{colorSpace:n}).getImageData(0,0,e.width,e.height)},Nt=e=>typeof e=="string";function oy(e,t){t.split(";").forEach(n=>{const[i,o]=n.split(":");if(!i.length||!o)return;const[r,a]=o.split("!important");e.style.setProperty(i,r,Nt(a)?"important":void 0)})}var ci=(e,t,n=[])=>{const i=document.createElement(e),o=Object.getOwnPropertyDescriptors(i.__proto__);for(const r in t)r==="style"?oy(i,t[r]):o[r]&&o[r].set||/textContent|innerHTML/.test(r)||typeof t[r]=="function"?i[r]=t[r]:i.setAttribute(r,t[r]);
1return n.forEach(r=>i.appendChild(r)),i};const Cw={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]};var Pw=(e,t,n=-1)=>(n===-1&&(n=1),Cw[n](e,t)),Wi=e=>{e.width=1,e.height=1;const t=e.getContext("2d");t&&t.clearRect(0,0,1,1)},Cc=e=>"data"in e,Mm=e=>zo()?RegExp(e).test(window.navigator.userAgent):void 0;let s1=null;var Xd=()=>(s1===null&&(s1=Mm(/Android/)),s1),ry=(e,t)=>{const n=ci("canvas",{width:e.width,height:e.height});return n.getContext("2d",t).drawImage(e,0,0),n},Vs=async(e,t=1)=>{const n=e instanceof ImageData&&e.colorSpace||"srgb",i=await Zd(),[o,r]=i||t<5?[e.width,e.height]:[e.height,e.width],a=ci("canvas",{width:o,height:r}),l=a.getContext("2d",{willReadFrequently:!0,colorSpace:n});if(Cc(e)&&!i&&t>1){const s=ci("canvas",{width:e.width,height:e.height});s.getContext("2d",{willReadFrequently:!0,colorSpace:n}).putImageData(e,0,0),e=s}if(!i&&t>1&&l.transform.apply(l,Pw(e.width,e.height,t)),Cc(e)){if(l.putImageData(e,0,0),Xd())return ry(a)}else l.drawImage(e,0,0);return e instanceof HTMLCanvasElement&&Wi(e),a},ay=async(e,t=1)=>t===1||await Zd()?e:xc(await Vs(e,t)),ls=e=>typeof e=="object";const y0=e=>e instanceof HTMLElement?e:ls(e)?ly(e):e,ly=e=>{let t;return Array.isArray(e)?(t=[],e.forEach((n,i)=>{t[i]=y0(n)})):(t={},e!==null&&Object.keys(e).forEach(n=>{const i=e[n];t[n]=y0(i)})),t};var xn=e=>typeof e=="function",sy=(e,t)=>{const{width:n,height:i,canvasMemoryLimit:o,contextOptions:r}=t||{};let a=n||e.naturalWidth,l=i||e.naturalHeight;!a&&!l&&(a=300,l=150);const s=a*l;if(o&&s>o){const f=Math.sqrt(o)/Math.sqrt(s);a=Math.floor(a*f),l=Math.floor(l*f)}const c=ci("canvas");return c.width=a,c.height=l,c.getContext("2d",r).drawImage(e,0,0,a,l),c},Mw=(e,t)=>new Promise((n,i)=>{const o=()=>n(sy(e,t));e.complete&&e.width?o():(e.onload=o,e.onerror=()=>i(new Error("Failed to load image")))}),Rw=async(e,t)=>{const n=ci("img",{src:URL.createObjectURL(e)}),i=await Mw(n,t);return URL.revokeObjectURL(n.src),i},cy=()=>"createImageBitmap"in window,Iw=()=>"OffscreenCanvas"in window,uy=e=>/svg/.test(e.type),Yr=()=>Math.random().toString(36).substring(2,9),Ew=e=>new Blob(["(",typeof e=="function"?e.toString():e,")()"],{type:"application/javascript"});const Aw=e=>`function () {self.onmessage = function (message) {(${e.toString()}).apply(null, message.data.content.concat([function (err, response) {
2    response = response || {};
3    const transfer = 'data' in response ? [response.data.buffer] : 'width' in response ? [response] : [];
4    return self.postMessage({ id: message.data.id, content: response, error: err }, transfer);
5}]))}}`,c1=new Map;var Ku=(e,t,n)=>new Promise((i,o)=>{const r=e.toString();let a=c1.get(r);if(!a){const s=Aw(e),c=URL.createObjectURL(Ew(s)),u=new Map,f=new Worker(c);a={url:c,worker:f,messages:u,terminationTimeout:void 0,terminate:()=>{clearTimeout(a.terminationTimeout),a.worker.terminate(),URL.revokeObjectURL(c),c1.delete(r)}},f.onmessage=function(d){const{id:m,content:g,error:p}=d.data;if(clearTimeout(a.terminationTimeout),a.terminationTimeout=setTimeout(()=>{u.size>0||a.terminate()},500),!u.has(m))return;const y=u.get(m);u.delete(m),p!=null?y.reject(p):y.resolve(g)},c1.set(r,a)}const l=Yr();a.messages.set(l,{resolve:i,reject:o}),a.worker.postMessage({id:l,content:t},n)});let u1=null;var ja=()=>(u1===null&&(u1=Mm(/Firefox/)),u1);const S0=async(e,t)=>{const{canvasMemoryLimit:n,colorSpace:i}=t||{},o=await Rw(e,{canvasMemoryLimit:n,contextOptions:{willReadFrequently:!0,colorSpace:i}}),r=xc(o,{colorSpace:i});return Wi(o),r};var fy=async(e,t)=>{const{canvasMemoryLimit:n,colorSpace:i}=t||{},o=/p3/i.test(i)?"display-p3":"srgb";if(Xd()&&!ja())return await S0(e,{canvasMemoryLimit:n,colorSpace:o});let r;if(cy()&&!uy(e)&&Iw())try{r=await Ku((a,l,s,c)=>{createImageBitmap(a).then(u=>{let f=u.width,d=u.height;const m=f*d;if(l&&m>l){const w=Math.sqrt(l)/Math.sqrt(m);f=Math.floor(f*w),d=Math.floor(d*w)}const g=new OffscreenCanvas(f,d),p=g.getContext("2d",{colorSpace:s,willReadFrequently:!0});p.drawImage(u,0,0,f,d);const y=p.getImageData(0,0,g.width,g.height);c(null,y)}).catch(u=>{c(u)})},[e,n,o])}catch{}return!r||!r.width?await S0(e,{canvasMemoryLimit:n,colorSpace:o}):r},Rm=(e,t=void 0,n=void 0)=>new Promise((i,o)=>{try{e.toBlob(r=>{if(!r)return o(new Error("Failed to create blob"));i(r)},t,n)}catch(r){o(r)}}),Lw=async(e,t,n)=>{const i=await Vs(e),o=await Rm(i,t,n);return Wi(i),o};const xw={matroska:"mkv"};var dy=e=>{const t=(e.match(/\/([a-z0-9]+)/)||[])[1];if(/^x/.test(t)){const[,n=""]=e.split("/x-");return xw[n]}return t},hy=e=>e.substring(0,e.lastIndexOf("."))||e,Fw=e=>e.split(".").pop();const vw=/avif|bmp|gif|jpg|jpeg|jpe|jif|jfif|png|svg|tiff|webp/;var Ow=e=>vw.test(e)?"image/"+(/jfif|jif|jpe|jpg/.test(e)?"jpeg":e==="svg"?"svg+xml":e):"",Im=e=>e&&Ow(Fw(e).toLowerCase()),Dw=(e,t)=>{const n=Im(e);if(n===t)return e;const i=dy(t)||n;return`${hy(e)}.${i}`}
5,Yu=(e,t,n)=>{const i=new Date().getTime(),o=e.type.length&&!/null|text/.test(e.type),r=o?e.type:n,a=Dw(t,r);try{return new(Cm("File"))([e],a,{lastModified:i,type:o?e.type:r})}catch{const s=o?e.slice():e.slice(0,e.size,r);return s.lastModified=i,s.name=a,s}},fa=(e,t)=>e/t,Nn=e=>e;const f1=Math.PI,Ha=Math.PI/2,ca=Ha/2;var ol=e=>{const t=Math.abs(e)%Math.PI;return t>ca&&t<Math.PI-ca};const Q1={Top:"t",Right:"r",Bottom:"b",Left:"l",TopLeft:"tl",TopRight:"tr",BottomRight:"br",BottomLeft:"bl"},{Top:es,Right:ts,Bottom:ns,Left:is,TopLeft:ma,TopRight:ga,BottomRight:ba,BottomLeft:pa}=Q1;var Wu={[es]:[.5,0],[ts]:[1,.5],[ns]:[.5,1],[is]:[0,.5],[ma]:[0,0],[ga]:[1,0],[ba]:[1,1],[pa]:[0,1]},un=(e,t=12)=>parseFloat(e.toFixed(t));const Ed=(e,t,n)=>n+(e-n)*t,w0=e=>({x:e.x+e.width*.5,y:e.y+e.height*.5,rx:e.width*.5,ry:e.height*.5}),Kn=()=>re(0,0),re=(e,t)=>({x:e,y:t}),Bw=e=>re(e.width,e.height),zw=e=>re(e.x,e.y),_0=e=>re(e.pageX,e.pageY),Vw=e=>re(e.offsetX,e.offsetY),Ut=e=>re(e.x,e.y),Ww=(e,t,n)=>(e.x=t,e.y=n,e),Sc=e=>(e.x=-e.x,e.y=-e.y,e),Uw=e=>{const t=e.x;return e.x=-e.y,e.y=t,e},Go=(e,t,n=Kn())=>{const i=Math.cos(t),o=Math.sin(t),r=e.x-n.x,a=e.y-n.y;return e.x=n.x+i*r-o*a,e.y=n.y+o*r+i*a,e},Yl=e=>Math.sqrt(e.x*e.x+e.y*e.y),ur=e=>{const t=Math.sqrt(e.x*e.x+e.y*e.y);return t===0?Kn():(e.x/=t,e.y/=t,e)},Hw=e=>Math.atan2(e.y,e.x),ed=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),Xl=(e,t)=>e.x===t.x&&e.y===t.y,Or=(e,t)=>(e.x=t(e.x),e.y=t(e.y),e),Nw=(e,t)=>e.x>=0&&e.y>=0&&e.x<=t.width&&e.y<=t.height,xi=(e,t)=>(e.x+=t.x,e.y+=t.y,e),Fi=(e,t)=>(e.x-=t.x,e.y-=t.y,e),T0=(e,t)=>(e.x/=t,e.y/=t,e),Bo=(e,t)=>(e.x*=t,e.y*=t,e),kd=(e,t)=>e.x*t.x+e.y*t.y,Cd=(e,t)=>e.x*t.y-e.y*t.x,xr=(e,t=Kn())=>{const n=e.x-t.x,i=e.y-t.y;return n*n+i*i},or=(e,t=Kn())=>Math.sqrt(xr(e,t)),Gw=(e,t,n)=>(e.x=Ed(e.x,t,n.x),e.y=Ed(e.y,t,n.y),e),Kr=e=>{let t=0,n=0;return e.forEach(i=>{t+=i.x,n+=i.y}),re(t/e.length,n/e.length)},wc=(e,t,n,i,o)=>(e.forEach(r=>{r.x=t?i-(r.x-i):r.x,r.y=n?o-(r.y-o):r.y}),e),Os=(e,t,n,i)=>{const o=Math.sin(t),r=Math.cos(t);return e.forEach(a=>{a.x-=n,a.y-=i;const l=a.x*r-a.y*o,s=a.x*o+a.y*r;a.x=n+l,a.y=i+s}),e},Fc=(e,t)=>({width:e,height:t}),ir=e=>Fc(e.width,e.height),sl=e=>Fc(e.width,e.height),zs=e=>Fc(e.width,e.height),my=e=>Fc(e[0],e[1]),jw=e=>!e.naturalWidth&&!e.naturalHeight?{width:300,height:150}:Fc(e.naturalWidth,e.naturalHeight),Ou=e=>/img/i.test(e.nodeName)?jw(e):sl(e),Ci=(e,t)=>Fc(e,t),qu=(e,t,n=Nn)=>n(e.width)===n(t.width)&&n(e.height)===n(t.height),td=(e,t)=>(e.width*=t,e.height*=t,e),Pc=e=>re(e.width*.5,e.height*.5),gy=(e,t)=>{const n=Math.abs(t),i=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),r=i*e.width+o*e.height,a=o*e.width+i*e.height;return e.width=r,e.height=a,e},Zw=(e,t)=>{const n=e.width,i=e.height;return ol(t)&&(e.width=i,e.height=n),e},Ad=(e,t)=>e.width>=t.width&&e.height>=t.height,Ga=(e,t)=>(e.width=t(e.width),e.height=t(e.height),e),Xw=e=>Math.sqrt(e.width*e.width+e.height*e.height),Kw=(e,t)=>Ci(Math.min(e.width,t.width),Math.min(e.height,t.height)),os=(e,t)=>({start:e,end:t}),by=e=>os(Ut(e.start),Ut(e.end)),Em=(e,t)=>{if(t===0)return e;const n=re(e.start.x-e.end.x,e.start.y-e.end.y),i=ur(n),o=Bo(i,t);return e.start.x+=o.x,e.start.y+=o.y,e.end.x-=o.x,e.end.y-=o.y,e},Yw=(e,t)=>{const n=re(e.start.x-e.end.x,e.start.y-e.end.y),i=ur(n),o=Bo(i,t);return e.end.x+=o.x,e.end.y+=o.y,e},qw=({start:e,end:t},n)=>{if(n===0)return[re(e.x,e.y),re(e.x,e.y),re(t.x,t.y),re(t.x,t.y)];const i=Math.atan2(t.y-e.y,t.x-e.x),o=Math.sin(i)*n,r=Math.cos(i)*n;return[re(o+e.x,-r+e.y),re(-o+e.x,r+e.y),re(-o+t.x,r+t.y),re(o+t.x,-r+t.y)]},Jw=[re(-1,-1),re(-1,1),re(1,1),re(1,-1)],Sa=(e,t,n,i)=>({x:e,y:t,width:n,height:i}),Rn=e=>Sa(e.x,e.y,e.width,e.height),ql=()=>Sa(0,0,0,0),Qw=(e,t)=>Sa(0,0,e,t),jo=e=>Sa(0,0,e.width,e.height),$w=e=>Sa(e[3],e[0],e[1]-e[3],e[2]-e[0]),rl=e=>Sa(e.x||0,e.y||0,e.width||0,e.height||0),Qi=e=>{let t=e[0].x,n=e[0].x,i=e[0].y,o=e[0].y;return e.forEach(r=>{t=Math.min(t,r.x),n=Math.max(n,r.x),i=Math.min(i,r.y),o=Math.max(o,r.y)}),Sa(t,i,n-t,o-i)},Pd=e=>Li(e.x-e.rx,e.y-e.ry,e.rx*2,e.ry*2),k0=(e,t)=>Sa(e.x-t.width*.5,e.y-t.height*.5,t.width,t.height),Li=(e,t,n,i)=>Sa(e,t,n,i),In=e=>re(e.x+e.width*.5,e.y+e.height*.5),ua=(e,t)=>(e.x+=t.x,e.y+=t.y,e),Oo=(e,t,n)=>(n=n||In(e),e.x=t*(e.x-n.x)+n.x,e.y=t*(e.y-n.y)+n.y,e.width=t*e.width,e.height=t*e.height,e),C0=(e,t,n,i)=>{const o=(i.x-e.x)/e.width,r=(i.y-e.y)/e.height;let a=Math.max(t.width,e.width),l=Math.max(t.height,e.height);return a=Math.min(n.width,a),l=Math.min(n.height,l),e.x=i.x-o*a,e.y=i.y-r*l,e.width=a,e.height=l,e},P0=(e,t)=>{const[n,i]=Wu[t],o=n*e.width,r=i*e.height;return re(e.x+o,e.y+r)},Ds=(e,t)=>(e.x*=t,e.y*=t,e.width*=t,e.height*=t,e),e5=(e,t)=>(e.x/=t,e.y/=t,e.width/=t,e.height/=t,e),t5=(e,t)=>(e.x-=t.x,e.y-=t.y,e.width-=t.width,e.height-=t.height,e),n5=(e,t)=>(e.x+=t.x,e.y+=t.y,e.width+=t.width,e.height+=t.height,e),da=(e,t,n=Nn)=>n(e.x)===n(t.x)&&n(e.y)===n(t.y)&&n(e.width)===n(t.width)&&n(e.height)===n(t.height),ao=e=>fa(e.width,e.height),py=(e,t,n,i,o)=>(e.x=t,e.y=n,e.width=i,e.height=o,e),Kd=(e,t)=>(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e),Ro=(e,t,n)=>(n||(n=In(e)),Fr(e).map(i=>Go(i,t,n))),Md=(e,t)=>Sa(e.width*.5-t.width*.5,e.height*.5-t.height*.5,t.width,t.height),Ld=(e,t)=>!(t.x<e.x||t.y<e.y||t.x>e.x+e.width||t.y>e.y+e.height),rs=(e,t,n=Kn())=>{if(e.width===0||e.height===0)return ql();const i=ao(e);t||(t=i);let o=e.width,r=e.height;return t>i?o=r*t:r=o/t,Sa(n.x+(e.width-o)*.5,n.y+(e.height-r)*.5,o,r)},i5=(e,t,n)=>{const[i,o,r,a]=Ws(e),l={...e};if(i<t.y&&(e.height=e.height-(t.y-i),e.y=t.y),o>t.x+t.width&&(e.width=t.x+t.width-e.x),r>t.y+t.height&&(e.height=t.y+t.height-e.y),a<t.x&&(e.width=e.width-(t.x-a),e.x=t.x),n){const s=Math.min(1,l.width/e.width,l.height/e.he
5ight);return Ds(l,s)}return e},o5=(e,t)=>{const[n,i,o,r]=Ws(e);return n<t.y&&(e.y=Math.max(t.y,e.y)),i>t.width&&(e.x=t.width-e.width),o>t.height&&(e.y=t.height-e.height),r<t.x&&(e.x=Math.max(t.x,e.x)),e},rr=(e,t=ao(e),n=Kn())=>{if(e.width===0||e.height===0)return ql();let i=e.width,o=i/t;return o>e.height&&(o=e.height,i=o*t),Sa(n.x+(e.width-i)*.5,n.y+(e.height-o)*.5,i,o)},Ws=e=>[Math.min(e.y,e.y+e.height),Math.max(e.x,e.x+e.width),Math.max(e.y,e.y+e.height),Math.min(e.x,e.x+e.width)],Fr=e=>[re(e.x,e.y),re(e.x+e.width,e.y),re(e.x+e.width,e.y+e.height),re(e.x,e.y+e.height)],qr=(e,t)=>{if(e)return e.x=t(e.x),e.y=t(e.y),e.width=t(e.width),e.height=t(e.height),e},yy=(e,t,n=In(e))=>Fr(e).map((i,o)=>{const r=Jw[o];return re(Ed(i.x,1+r.x*t.x,n.x),Ed(i.y,1+r.y*t.y,n.y))}),Uu=e=>(e.x=0,e.y=0,e),M0=e=>{const t=e[0],n=e[e.length-1];e=Xl(t,n)?e:[...e,t];const i=t.x,o=t.y;let r=0,a=0,l=0,s=0,c,u,f;const d=e.length;for(;a<d;a++)c=e[a],u=e[a+1>d-1?0:a+1],f=(c.y-o)*(u.x-i)-(u.y-o)*(c.x-i),r+=f,l+=(c.x+u.x-2*i)*f,s+=(c.y+u.y-2*o)*f;return f=r*3,re(i+l/f,o+s/f)},Am=(e,t)=>Sy(e.start,e.end,t.start,t.end),Sy=(e,t,n,i)=>{const o=(i.y-n.y)*(t.x-e.x)-(i.x-n.x)*(t.y-e.y);if(o===0)return;const r=((i.x-n.x)*(e.y-n.y)-(i.y-n.y)*(e.x-n.x))/o,a=((t.x-e.x)*(e.y-n.y)-(t.y-e.y)*(e.x-n.x))/o;if(!(r<0||r>1||a<0||a>1))return re(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y))},wy=(e,t,{ignoreIdenticalLines:n=!1,breakOnIntersection:i=!1}
5={})=>{const o=t.length,r=[];for(let a=0;a<o-1;a++){if(n&&(Xl(e.start,t[a])||Xl(e.start,t[a+1])||Xl(e.end,t[a])||Xl(e.end,t[a+1])))continue;const l=Sy(e.start,e.end,t[a],t[a+1]);if(l){if(i)return[l];r.push(l)}}return r.length?r:void 0},$1=(e,t)=>{let n=0,i=0,o=!1;const r=t.length;for(n=0,i=r-1;n<r;i=n++)t[n].y>e.y!=t[i].y>e.y&&e.x<(t[i].x-t[n].x)*(e.y-t[n].y)/(t[i].y-t[n].y)+t[n].x&&(o=!o);return o},r5=(e,t,n,i)=>{let o=(t.x-e.x)*i,r=(t.y-e.y)*i;return or(n,t)<or(t,e)&&(o*=.15,r*=.15),{x:t.x+o,y:t.y+r}},a5=(e,t,n,i)=>{const o=(1-i)*(1-i)*e.x+2*(1-i)*i*t.x+i*i*n.x,r=(1-i)*(1-i)*e.y+2*(1-i)*i*t.y+i*i*n.y;return{x:o,y:r}},l5=(e,t,n,i,o)=>{const r=r5(e,t,n,o),a=[];for(let l=0;l<=i;l++){const s=l/i;a.push(a5(t,r,n,s))}return a},s5=(e,t)=>!!(e.find(o=>$1(o,t))||t.find(o=>$1(o,e))),_y=e=>{const t=[];for(let n=0;n<e.length;n++){let i=n+1;i===e.length&&(i=0),t.push(os(Ut(e[n]),Ut(e[i])))}return t},Ty=(e,t=0)=>_y(e).map(n=>Em(n,t)),Yd=(e,t,n,i=0,o=!1,r=!1,a=12)=>{const l=[];for(let s=0;s<a;s++)l.push(re(e.x+t*Math.cos(s*(Math.PI*2)/a),e.y+n*Math.sin(s*(Math.PI*2)/a)));return(o||r)&&wc(l,o,r,e.x,e.y),i&&Os(l,i,e.x,e.y),l},c5=e=>e.reduce(([t,n,i,o],{x:r,y:a})=>(o=Math.min(o,r),n=Math.max(n,r),t=Math.min(t,a),i=Math.max(i,a),[t,n,i,o]),[1/0,-1/0,-1/0,1/0]),xd=(e,t,n,i)=>{const o=re(e.x-n.x,e.y-n.y),r=re(i.x-n.x,i.y-n.y),a=kd(r,r);let s=kd(o,r)/a;s=s<0?0:s,s=s>1?1:s;const c=re(r.x*s+n.x-e.x,r.y*s+n.y-e.y);return kd(c,c)<=t*t},ky=(e,t,n)=>{const i=n.length;for(let o=0;o<i-1;o++)if(xd(e,t,n[o],n[o+1]))return!0;return!1},Lm=(e,t,n)=>$1(e,n)||ky(e,t,n)?!0:xd(e,t,n[0],n[n.length-1]),u5=(e,t,n,i,o,r)=>{const a=Yd(re(n.x,n.y),n.rx,n.ry,i,o,r,12);return Lm(e,t,a)},d1=(e,t,n,i,o)=>Lm(e,t,Ro(n,i,o||In(n)));var f5=(e,t)=>{const n=jo(e),i=In(n),o=Ro(n,t,i);return Uu(Qi(o))},Mc=(e,t)=>e instanceof HTMLElement&&(t?new RegExp(`^${t}$`,"i").test(e.nodeName):!0),Ju=e=>e instanceof File,R0=async(e,t,n)=>{const i=await Rm(e,t,n);return Yu(i,"canvas")},xm=e=>e.split("/").pop().split(/\?|\#/).shift();const d5=zo()&&!!Node.prototype.replaceChildren,h5=d5?(e,t)=>e.replaceChildren(t):(e,t)=>{for(;e.lastChild;)e.removeChild(e.lastChild);t!==void 0&&e.append(t)},nd=zo()&&ci("div",{class:"PinturaMeasure",style:"position:absolute;left:0;top:0;width:99999px;height:0;pointer-events:none;contain:strict;margin:0;padding:0;"});let I0;var Fm=e=>(h5(nd,e),nd.parentNode||document.body.append(nd),clearTimeout(I0),I0=setTimeout(()=>{nd.remove()},500),e);let h1=null;var Za=()=>(h1===null&&(h1=zo()&&/^((?!chrome|android).)*(safari|iphone|ipad)/i.test(navigator.userAgent)),h1),Cy=e=>new Promise((t,n)=>{let i=!1;!e.parentNode&&Za()&&(i=!0,e.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:0;top:0;width:0;height:0;",Fm(e));let o=!1;const r=()=>{let l=e.naturalWidth,s=e.naturalHeight;if(!(l&&s)){if(!o)return;l=300,s=150}delete e.onload,i&&e.remove(),clearInterval(a),t({width:l,height:s})};e.onerror=l=>{clearInterval(a),n(l)},e.onload=()=>{o=!0,clearInterval(a),r()};const a=setInterval(r,1);r()}),Py=e=>new Promise((t,n)=>{const i=()=>{t({width:e.videoWidth,height:e.videoHeight})};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>n(e.error)}),Qu=e=>/^image/.test(e.type),vm=e=>new Promise(t=>{const n=Nt(e)?e:URL.createObjectURL(e),i=()=>{const r=new Image;r.src=n,t(r)};if(e instanceof Blob&&Qu(e))return i();const o=document.createElement("video");o.preload="metadata",o.onloadedmetadata=()=>t(o),o.onerror=i,o.src=n}),Fd=e=>e.nodeName==="VIDEO",My=async e=>{let t;e.src?t=e:t=await vm(e);let n;try{n=Fd(t)?await Py(t):await Cy(t)}finally{Ju(e)&&URL.revokeObjectURL(t.src)}return n};const m5=e=>new Promise((t,n)=>{if(e.complete)return t(e);e.onload=()=>t(e),e.onerror=()=>n(new Error("Failed to load image"))});var g5=async e=>{const t=await My(e),n=await m5(e),i=ci("canvas",t);i.getContext("2d",{willReadFrequently:!0}).drawImage(n,0,0);const r=await Rm(i);return Yu(r,xm(n.src))},b5=e=>/^data:/.test(e),bc=(e=0,t=!0)=>new(Cm("ProgressEvent"))("progress",{loaded:e*100,total:100,lengthComputable:t}),p5=async(e,t="data-uri",n=st)=>{n(bc(0));const i=await fetch(e);n(bc(.33));const o=await i.blob();let r;Qu(o)||(r=`image/${e.includes(",/9j/")?"jpeg":"png"}`),n(bc(.66));const a=Yu(o,t,r);return n(bc(1)),a},E0=(e,t,n=i=>i)=>e.getAllResponseHeaders().indexOf(t)>=0?n(e.getResponseHeader(t)):void 0,y5=e=>{if(!e)return null;const t=e.split(/filename=|filename\*=.+''/).splice(1).map(n=>n.trim().replace(/^["']|[;"']{0,2}$/g,"")).filter(n=>n.length);
5return t.length?decodeURI(t[t.length-1]):null};const S5={URL_REQUEST:"URL_REQUEST"};class Du extends Error{constructor(t,n,i){super(t),this.name="EditorError",this.code=n,this.metadata=i}}var Ry=(e,t)=>{const{headers:n={},credentials:i}=t||{};Object.entries(n).forEach(([o,r])=>e.setRequestHeader(o,r)),i&&(e.withCredentials=i!=="omit")},w5=(e,t,n)=>new Promise((i,o)=>{const r=()=>o(new Du("Error fetching image",S5.URL_REQUEST,a)),a=new XMLHttpRequest;a.onprogress=t,a.onerror=r,a.onload=()=>{if(!a.response||a.status>=300||a.status<200)return r();const s=E0(a,"Content-Type"),c=E0(a,"Content-Disposition",y5)||xm(e);i(Yu(a.response,c,s||Im(c)))};const{willRequest:l}=n;Promise.resolve(l&&l(e,{resourceType:"image"})).then(s=>{if(s===!1)return o("Image load rejected");a.open("GET",e,!0),Ry(a,s),a.responseType="blob",a.send()}).catch(console.error)}),_5=(e,t,n)=>b5(e)?p5(e,void 0,t):w5(e,t,n),Om=e=>e instanceof Blob&&!(e instanceof File),Iy=e=>"close"in e,T5=async(e,t,n)=>{if(Ju(e)||Om(e))return e;if(Nt(e))return await _5(e,t,n);if(Mc(e,"canvas"))return await R0(e);if(Mc(e,"img"))return await g5(e);if(Cc(e)||Iy(e))return await R0(await Vs(e));
5throw new Du("Invalid image source","invalid-image-source")};let m1=null;var Hu=()=>(m1===null&&(m1=zo()&&/^mac/i.test(navigator.platform)),m1);let g1=null;var ya=()=>(g1===null&&(g1=zo()&&(Mm(/iPhone|iPad|iPod/)||Hu()&&navigator.maxTouchPoints>=1)),g1),k5=async(e,t=1)=>await Zd()||ya()||t<5?e:Ci(e.height,e.width),Ey=e=>/jpeg/.test(e.type),C5=e=>typeof e=="object"&&e.constructor==Object,P5=e=>C5(e)?JSON.stringify(e):e,M5=(e,t,n)=>new Promise((i,o)=>{const{token:r={},beforeSend:a=st,onprogress:l=st}=n;r.cancel=()=>s.abort();const s=new XMLHttpRequest;s.upload.onprogress=l,s.onload=()=>s.status>=200&&s.status<300?i(s):o(s),s.onerror=()=>o(s),s.ontimeout=()=>o(s),s.open("POST",encodeURI(e)),a(s),s.send(t instanceof FormData?t:t.reduce((c,u)=>(c.append(...u.map(P5)),c),new FormData))}),Dm=(e,t=0,n)=>(t===0||(e.translate(n.x,n.y),e.rotate(t),e.translate(-n.x,-n.y)),e),R5=(e,t,n)=>(e.translate(t,n),e),Ay=(e,t,n)=>(e.scale(t,n),e),I5=async(e,t={})=>{const{flipX:n,flipY:i,rotation:o,crop:r}=t,a=sl(e),l=n||i,s=!!o,c=r&&(r.x||r.y||r.width||r.height),u=c&&da(r,jo(a)),f=c&&!u;if(!l&&!s&&!f)return e;const d={willReadFrequently:!0,colorSpace:e.colorSpace};let m,g=ci("canvas",{width:e.width,height:e.height});if(g.getContext("2d",d).putImageData(e,0,0),l){const w=ci("canvas",{width:g.width,height:g.height}).getContext("2d",d);Ay(w,n?-1:1,i?-1:1),w.drawImage(g,n?-g.width:0,i?-g.height:0),w.restore(),Wi(g),g=w.canvas}if(s){const w=Ga(zs(Qi(Ro(rl(g),o))),Math.floor),_=ci("canvas",{width:r.width,height:r.height}).getContext("2d",d);R5(_,-r.x,-r.y),Dm(_,o,Pc(w)),_.drawImage(g,(w.width-g.width)*.5,(w.height-g.height)*.5),_.restore(),Wi(g),g=_.canvas}else if(f)return m=g.getContext("2d",d).getImageData(r.x,r.y,r.width,r.height),Wi(g),m;return m=g.getContext("2d",d).getImageData(0,0,g.width,g.height),Wi(g),m},E5=(e,t)=>{const{imageData:n,width:i,height:o}=e,r=n.width,a=n.height,l=n.colorSpace,s=Math.round(i),c=Math.round(o),u=n.data,f=new Uint8ClampedArray(s*c*4),d=r/s,m=a/c,g=Math.ceil(d*.5),p=Math.ceil(m*.5);for(let y=0;y<c;y++)for(let w=0;w<s;w++){const _=(w+y*s)*4;let P=0,C=0,R=0,I=0,M=0,T=0,v=0;const H=(y+.5)*m;for(let Y=Math.floor(y*m);Y<(y+1)*m;Y++){const Z=Math.abs(H-(Y+.5))/p,W=(w+.5)*d,$=Z*Z;for(let S=Math.floor(w*d);S<(w+1)*d;S++){let pe=Math.abs(W-(S+.5))/g;const ge=Math.sqrt($+pe*pe);if(ge<-1||ge>1||(P=2*ge*ge*ge-3*ge*ge+1,P<=0))continue;pe=4*(S+Y*r);const de=u[pe+3];v+=P*de,R+=P,de<255&&(P=P*de/250),I+=P*u[pe],M+=P*u[pe+1],T+=P*u[pe+2],C+=P}}f[_]=I/C,f[_+1]=M/C,f[_+2]=T/C,f[_+3]=v/R}t(null,{data:f,width:s,height:c,colorSpace:l})},Bm=e=>{if(e instanceof ImageData)return e;let t;try{t=new ImageData(e.width,e.height,{colorSpace:e.colorSpace||"srgb"})}catch{t=ci("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},A5=async(e,t={},n)=>{const{width:i,height:o,fit:r,upscale:a}=t;if(!i&&!o)return e;let l=i,s=o;if(i?o||(s=i):l=o,r!=="force"){const c=l/e.width,u=s/e.height;let f=1;if(r==="cover"?f=Math.max(c,u):r==="contain"&&(f=Math.min(c,u)),f>1&&a===!1)return e;l=Math.round(e.width*f),s=Math.round(e.height*f),i&&o&&(Math.abs(l-i)<=1&&(l=i),Math.abs(s-o)<=1&&(s=o))}return l=Math.max(l,1),s=Math.max(s,1),e.width===l&&e.height===s?e:n?n(e,l,s):(e=await Ku(E5,[{imageData:e,width:l,height:s}],[e.data.buffer]),Bm(e))},L5=(e,t)=>{const{imageData:n,matrix:i}=e;if(!i||i.length!==20)return t(null,n);const o=n.colorSpace,r=n.data,a=r.length,l=i[0],s=i[1],c=i[2],u=i[3],f=i[4],d=i[5],m=i[6],g=i[7],p=i[8],y=i[9],w=i[10],_=i[11],P=i[12],C=i[13],R=i[14],I=i[15],M=i[16],T=i[17],v=i[18],H=i[19];let Y=0,Z=0,W=0,$=0,S=0,pe=0,ge=0,de=0,Fe=0;const X=U=>Math.max(0,Math.min(255,U*255));for(;Y<a;Y+=4)Z=r[Y]/255,W=r[Y+1]/255,$=r[Y+2]/255,S=r[Y+3]/255,S>0&&(Z/=S,W/=S,$/=S),pe=Z*l+W*s+$*c+S*u+f,ge=Z*d+W*m+$*g+S*p+y,de=Z*w+W*_+$*P+S*C+R,Fe=Z*I+W*M+$*T+S*v+H,S>0?(Z=pe*S,W=ge*S,$=de*S):(Z=0,W=0,$=0),r[Y]=X(pe*Fe),r[Y+1]=X(ge*Fe),r[Y+2]=X(de*Fe),r[Y+3]=X(S);t(null,{data:r,width:n.width,height:n.height,colorSpace:o})},Ly=(e,t)=>{const{imageData:n,matrix:i}=e;if(!i)return t(null,n);let o=i.reduce((v,H)=>v+H);o=o<=0?1:o;const r=n.width,a=n.height,l=n.data,s=n.colorSpace;let c=0,u=0,f=0;const d=Math.round(Math.sqrt(i.length)),m=Math.floor(d/2);let g=0,p=0,y=0,w=0,_=0,P=0,C=0,R=0,I=0,M=0;const T=new Uint8ClampedArray(r*a*4);for(f=0;f<a;f++)for(u=0;
5u<r;u++){for(g=0,p=0,y=0,w=0,P=0;P<d;P++)for(_=0;_<d;_++)C=f+P-m,R=u+_-m,C<0&&(C=a-1),C>=a&&(C=0),R<0&&(R=r-1),R>=r&&(R=0),I=(C*r+R)*4,M=i[P*d+_],g+=l[I]*M,p+=l[I+1]*M,y+=l[I+2]*M,w+=l[I+3]*M;T[c]=g/o,T[c+1]=p/o,T[c+2]=y/o,T[c+3]=w/o,c+=4}t(null,{data:T,width:r,height:a,colorSpace:s})},x5=(e,t)=>{let{imageData:n,strength:i}=e;if(!i)return t(null,n);const o=n.colorSpace,r=n.width,a=n.height,l=n.data,s=(H,Y)=>(m=H-f,g=Y-d,Math.sqrt(m*m+g*g));let c=0,u=0,f=r*.5,d=a*.5,m,g,p=s(0,0),y,w,_,P,C,R,I,M,T;const v=(H,Y,Z,W)=>{P=Y[H]/255,C=Y[H+1]/255,R=Y[H+2]/255,I=Y[H+3]/255,M=1-W,T=M*I+W,Z[H]=(M*I*P+W*y)/T*255,Z[H+1]=(M*I*C+W*w)/T*255,Z[H+2]=(M*I*R+W*_)/T*255,Z[H+3]=T*255};for(i>0?(y=0,w=0,_=0):(i=Math.abs(i),y=1,w=1,_=1),u=0;u<a;u++)for(c=0;c<r;c++)v((c+u*r)*4,l,l,s(c,u)*i/p);t(null,{data:l,width:n.width,height:n.height,colorSpace:o})},F5=(e,t)=>{const{imageData:n,level:i,monochrome:o=!1}=e;if(!i)return t(null,n);const r=n.colorSpace,a=n.data,l=a.length;let s=0,c,u,f;const d=()=>(-1+Math.random()*2)*255*i,m=o?()=>{const g=d();return[g,g,g]}:()=>[d(),d(),d()];for(;s<l;s+=4)[c,u,f]=m(),a[s]=a[s]+c,a[s+1]=a[s+1]+u,a[s+2]=a[s+2]+f;t(null,{data:a,width:n.width,height:n.height,colorSpace:r})},v5=(e,t)=>{const{imageData:n,level:i}=e;if(!i)return t(null,n);const o=n.colorSpace,r=n.data,a=r.length;let l=0,s,c,u;for(;
5l<a;l+=4)s=r[l]/255,c=r[l+1]/255,u=r[l+2]/255,r[l]=Math.pow(s,i)*255,r[l+1]=Math.pow(c,i)*255,r[l+2]=Math.pow(u,i)*255;t(null,{data:r,width:n.width,height:n.height,colorSpace:o})},O5=e=>{const t=e.length;let n;const i=t>=20?6:t>=16?5:3;for(let o=0;o<t;o++){if(n=e[o],n===1&&o%i!==0)return!1;if(n!==0&&n!==1)return!1}return!0},xy=async(e,t={})=>{const{colorMatrix:n,convolutionMatrix:i,gamma:o,noise:r,vignette:a}=t,l=[];if(i&&l.push([Ly,{matrix:i.clarity}]),o>0&&l.push([v5,{level:1/o}]),n&&!O5(n)&&l.push([L5,{matrix:n}]),(r>0||r<0)&&l.push([F5,{level:r}]),(a>0||a<0)&&l.push([x5,{strength:a}]),!l.length)return e;const s=(u,f)=>`(err, imageData) => {
6            (${u[f][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${f}]), 
7                ${u[f+1]?s(u,f+1):"done"})
8        }`,c=`function (options, done) {
9        const filterInstructions = options.filterInstructions;
10        const imageData = options.imageData;
11        (${s(l,0)})(null, imageData)
12    }`;return e=await Ku(c,[{imageData:e,filterInstru
12ctions:l.map(u=>u[1])}],[e.data.buffer]),Bm(e)},Ht=e=>typeof e=="number",vd=e=>Nt(e)&&e.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g)!==null,Rt=(e,t)=>e.hasOwnProperty(t),Si=e=>Array.isArray(e),D5=()=>ya()||Hu(),B5=()=>/^win/i.test(navigator.platform);let A0=64,b1=102,L0=112,x0=!1;var Fy=(e,t)=>(!x0&&zo()&&(B5()&&(b1=103),D5()&&(A0=63.5,b1=110,L0=123),x0=!0),`<svg${t?` aria-label="${t}"`:""} width="128" height="128" viewBox="0 0 128 128" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg"><text x="${A0}" y="${b1}" alignment-baseline="text-top" dominant-baseline="text-top" text-anchor="middle" font-size="${L0}px">${e}</text></svg>`),z5=e=>`data:image/svg+xml,${e.replace("<","%3C").replace(">","%3E")}`,Rc=e=>e instanceof Blob,cr=(e,t)=>
12`${e/t*100}%`,Eo=e=>`rgba(${Math.round(e[0]*255)}, ${Math.round(e[1]*255)}, ${Math.round(e[2]*255)}, ${Ht(e[3])?e[3]:1})`,Od=e=>Object.values(e).join("_"),V5=(e=0)=>new Promise(t=>{setTimeout(t,e)});const W5=e=>!new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data.buffer).some(n=>n!==0),F0=80,v0=80,vy=async(e,t=0)=>{const i=ci("canvas",{width:F0,height:v0}).getContext("2d");return await V5(t),i.drawImage(e,0,0,F0,v0),W5(i)&&t<=256?await vy(e,t+16):!0},O0=new Map;var U5=(e,{safariCacheKey:t="*"}={})=>new Promise((n,i)=>{const o=new Image;o.onerror=()=>i(new Error("Failed to load SVG")),o.onload=()=>{if(!Za()||!e.includes("@font-face")||O0.has(t))return n(o);vy(o).then(()=>{O0.set(t,!0),n(o)})},o.src="data:image/svg+xml,"+e}),H5=e=>new Promise((t,n)=>{const i=new FileReader;i.onerror=()=>n(i.error),i.onload=()=>t(i.result),i.readAsDataURL(e)}),Pl=()=>{let e=[];return{sub:(t,n)=>(e.push({event:t,callback:n}),()=>e=e.filter(i=>i.event!==t||i.callback!==n)),pub:(t,n)=>{e.filter(i=>i.event===t).forEach(i=>i.callback(n))}}};const al=32,N5=({fontSize:e=16,lineHeight:t=20}={})=>Math.max(0,e-t)*.5,G5=(e="")=>e.split(`
13`).length,zm=({color:e=[0,0,0],fontSize:t=16,fontFamily:n="sans-serif",fontVariant:i="normal",fontWeight:o="normal",fontStyle:r="normal",textAlign:a="left",letterSpacing:l="normal",lineHeight:s=20},c=1)=>`font-size:${t*c}px;font-style:${r};font-weight:${o};font-family:${n};font-variant:${i};line-height:${s*c}px;text-align:${a};letter-spacing:${Ht(l)?l+"px":"normal"};color:${Eo(e)};`,Vm=(e,t,n=1)=>{const{width:i,height:o,disableNewline:r}=t,a=!i,l=r===!1?G5(e):void 0,s=a?"auto":`${i*n}px`,c=o?`${o*n}px`:"auto",u=a?"normal":"break-word",f=a&&!l?"nowrap":"pre-line",d=N5(t)*n;return`max-width:none;min-width:auto;width:${s};height:${c};margin-top:0;margin-bottom:0;padding-top:${d}px;word-break:${u};word-wrap:normal;white-space:${f};`},D0=new Map,Oy=e=>{const t=[];for(const n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE?t.push(Z5(n)):t.push(...Oy(n));return t},Dy="pointer-events:none;visibility:hidden;position:absolute;left:0;top:0;",j5=(e="",t)=>{let{width:n=0,height:i="auto",fontSize:o,fontFamily:r,lineHeight:a,fontWeight:l,fontStyle:s,fontVariant:c,letterSpacing:u}=t;const f=Od({text:e,fontFamily:r,fontWeight:l,fontStyle:s,fontVariant:c,fontSize:o,lineHeight:a,letterSpacing:u,width:n,height:i});let d=D0.get(f);if(d)return d;let m=1;o>1e3&&ja()&&(m=o/1e3,o=1e3,a=a*m);const g=Fm(ci("pre",{contenteditable:"true",spellcheck:"false",style:`${Dy}${zm({fontFamily:r,fontWeight:l,fontStyle:s,fontVariant:c,fontSize:o,letterSpacing:u,lineHeight:a})};${Vm(e,t)}"`,innerHTML:e})),p=g.getBoundingClientRect();return d={signature:Oy(g).flat().map(w=>w.text).join("_;_"),textSize:Ga(sl(p),w=>Math.ceil(w*m))},D0.set(f,d),g.remove(),d},Z5=e=>{const t=e.nodeValue;if(!t)return[];const n=t.length,i=document.createRange();i.selectNodeContents(e);const o=[];for(let a=0;a<n;a++){i.setStart(e,0),i.setEnd(e,a+1);const l=i.getClientRects().length-1,s=t.charAt(a);o[l]?o[l]+=s:o.push(s)}const r=i.getClientRects();return o.map((a,l)=>({rect:r[l],text:a}))},B0=new Map,tr=(e="",t)=>{const{width:n,height:i}=t;if(Ht(n)&&Ht(i))return Ci(n,i);let{fontSize:o=16,fontFamily:r,lineHeight:a=20,fontWeight:l,fontStyle:s,fontVariant:c,letterSpacing:u}=t;const f=Od({text:e,fontFamily:r,fontWeight:l,fontStyle:s,fontVariant:c,fontSize:o,letterSpacing:u,lineHeight:a,width:n});let d=B0.get(f);if(d)return d;let m=1;o>1e3&&ja()&&(m=o/1e3,o=1e3,a=a/m);const p=Fm(ci("pre",{contenteditable:"true",spellcheck:"false",style:`${Dy}${zm({...t,fontSize:o,lineHeight:a})};${Vm(e,t)}"`,innerHTML:e})).getBoundingClientRect();return d=sl(p),d=Ga(d,y=>y*m),n&&(d.width=n),B0.set(f,d),d},By=e=>e.pathname.split("/").slice(0,-1).join("/"),X5=(e,t)=>{const{sub:n,pub:i}=Pl();let o,r;return Promise.resolve(t&&t(e,{resourceType:"stylesheet"})).then(a=>{if(a===!1)return r="requestPrevented",i("error",r);const{headers:l,credentials:s}=a||{};fetch(e,{headers:l,credentials:s}).then(c=>c.text()).then(c=>{o=c,i("load",o)}).catch(c=>{r=c,i("error",r)})}),{sub:(a,l)=>{if(a==="load"&&o)return l(o);if(a==="error"&&r)return l(r);n(a,l)}}},z0=new Map,K5=(e,t)=>new Promise((n,i)=>{let o=z0.get(e);typeof o>"u"&&(o=X5(e,t),z0.set(e,o)),o.sub("load",n),o.sub("error",i)}),V0=async(e,t,n)=>{let i;try{i=await K5(e,t)}catch{return[]}const o={innerHTML:i,id:Yr()};n&&(o.nonce=n);const r=ci("style",o);document.head.append(r);const a=Array.from(document.styleSheets).find(l=>l.ownerNode.id===r.id);return r.remove(),Array.from(a.cssRules)},cc=new Map,Y5=e=>e.filter(t=>t instanceof CSSFontFaceRule),q5=e=>e.filter(t=>t instanceof CSSImportRule),J5=e=>{if(!e.href)return null;try{return By(new URL(e.href))}catch{return null}},Q5=(e,t)=>!t||!e.href||e.href.startsWith("/")||e.href.startsWith("http")?e.href:t+"/"+e.href.replace(/^\.\//,""),$5=async(e,t,n)=>{if(cc.has(e.href))return cc.get(e.href);let i;try{i=Array.from(e.cssRules);const o=J5(e);for(const r of q5(i)){const a=Q5(r,o);if(cc.has(a)){const s=cc.get(a);i=[...i,...s];continue}const l=await V0(a,t,n);cc.set(a,l),i=[...i,...l]}}catch{const r=e.href;i=await V0(r,t,n),cc.set(r,i)}return Y5(i)},Dd=(e,t)=>e.style.getPropertyValue(t),e_=(e,t)=>
13Dd(e,"font-family").replace(/^"|"$/g,"")==t,t_=e=>e.style&&Dd(e,"src")&&Dd(e,"font-family"),n_=(e,t)=>{const n=[];for(const i of e)t_(i)&&e_(i,t)&&n.push(i);return n},i_=async(e,t)=>{const n=Array.from(document.styleSheets).map(r=>$5(r,e,t)),i=await Promise.all(n),o=[];return i.forEach(r=>o.push(...r)),o},o_=async(e,t,n)=>{const i=await i_(t,n),o=n_(i,e);return o.length?o.map(r=>{const a=r.parentStyleSheet&&r.parentStyleSheet.href&&new URL(r.parentStyleSheet.href),l=a?a.origin+By(a)+"/":"",c=r.style.getPropertyValue("src").match(/url\("?(.*?)"?\)/)[1],u=Array.from(r.style).filter(f=>f!="src").reduce((f,d)=>(f+=d+":"+Dd(r,d)+";",f),"");return[/^http/.test(c)?c:l+c,u]}):[]},W0=new Map,U0=new Map,r_=e=>!e||/woff2/.test(e)?"woff2":/woff/.test(e)?"woff":/ttf|truetype/.test(e)?"truetype":/otf|opentype/.test(e)?"opentype":/svg/.test(e)?"svg":"woff2",a_=async(e,t,n)=>{if(W0.get(e))return;let i=U0.get(e);if(!i){const o=await o_(e,t,n);if(!o.length){W0.set(e,!0);return}const r=[];for(const[a,l]of o){const s=await fetch(a).then(f=>f.blob()),c=r_(s.type),u=await H5(s);r.push(`@font-face { src:url(${u}) format('${c}');${l};font-display:block; }`)}i=r.join(""),U0.set(e,i)}return i};var zy=async(e="",t)=>{if(!e.length)return;let{color:n,imageWidth:i=300,imageHeight:o=150,paddingTop:r=0,paddingRight:a=al,paddingBottom:l=0,paddingLeft:s=al,fontFamily:c,fontSize:u,pixelRatio:f=1,willRequest:d,outline:m,blur:g,styleNonce:p}=t,y=1,w="";u>1e3&&ja()&&(y=u/1e3,w=`transform-origin:0 0;transform:scale(${y})`);const _=f/y,P=(i+s+a)*f,C=(o+l+r)*f,R=await a_(c,d,p);let I="";R&&(I=`<style${p?` nonce="${p}"`:""}>${R}</style>`);const T=e.replace(/%/g,"%25").replace(/#/g,"%23").replace(/&nbsp;/g," ").replace(/&(?!#\d{4};|[a-z]+;)/gi,"&amp;").replace(/<br>|\n/g,"<br/>"),v=r*_,H=a*_,Y=l*_,Z=s*_,W=`top:${v}px;right:${H}px;bottom:${Y}px;left:${Z}px`;let $=n,S="",pe="";if(m||g){const X=Eo(n);m&&($=[0,0,0,0],S=`-webkit-text-stroke: ${m*2*_}px ${X}`),g&&(Za()?pe=`filter:blur(${g*_*.4}px)`:($=[0,0,0,0],pe=`text-shadow: 0 0 ${g*_}px ${X}`))}const ge=zm({...t,color:$,fontSize:u},_),de=Vm(e,t,_),Fe=`<svg xmlns="http://www.w3.org/2000/svg" width="${P}" height="${C}" viewBox="0 0 ${P} ${C}"><foreignObject x="0" y="0" width="${P}" height="${C}"><div xmlns="http://www.w3.org/1999/xhtml">${I}<pre contenteditable="true" spellcheck="false" style="position:absolute;${W};${ge};${de};${w};${S};${pe}">${T}</pre></div></foreignObject></svg>`;return U5(Fe,{safariCacheKey:c})};const l_=(e,t)=>JSON.stringify(e)===JSON.stringify(t),yi=e=>{const t={...e};return ly(t)},H0=(e,t={})=>{const n=ao(e);let i,o;const r=t.width||t.rx,a=t.height||t.ry;if(r&&a)return ir(t);if(r||a){i=parseFloat(r||Number.MAX_SAFE_INTEGER),o=parseFloat(a||Number.MAX_SAFE_INTEGER);const c=Math.min(i,o);Nt(r)||Nt(a)?(i=`${c}%`,o=`${c*n}%`):(i=c,o=c)}else i="10%",o=`${10*n}%`;const l=t.width?"width":t.rx?"rx":void 0,s=t.width?"height":t.rx?"ry":void 0;return{[l||"width"]:i,[s||"height"]:o}},N0=(e,t={})=>({width:void 0,height:void 0,...t,aspectRatio:1,backgroundImage:z5(Fy(e))}),G0=(e,t={})=>{const n=$i(t)?{}:{width:void 0,height:void 0,aspectRatio:void 0};return{backgroundColor:[0,0,0,0],...n,...t,backgroundImage:Nt(e)?e:Rc(e)?URL.createObjectURL(e):e}},j0=(e,t)=>{let n;if(Nt(e)||Rc(e)){const i={...H0(t),backgroundSize:"contain"};vd(e)?n=N0(e,i):n=G0(e,i)}else if(e.src){const i=H0(t,e.shape||e),o={...e.shape,...i};if(e.width&&e.height&&!Rt(o,"aspectRatio")){const r=rm(i,"width",t),a=rm(i,"height",t);o.aspectRatio=fa(r,a)}!o.backgroundSize&&!e.shape&&(!e.width||!e.height)&&(o.backgroundSize="contain"),vd(e.src)?n=N0(e.src,o):n=G0(e.src,o)}else e.shape&&(n=yi(e.shape));return Rt(n,"backgroundImage")&&(Rt(n,"backgroundColor")||(n.backgroundColor=[0,0,0,0]),Rt(n,"disableStyle")||(n.disableStyle=["cornerRadius","backgroundColor","strokeColor","strokeWidth"])),t?Ii(n,t):n},Tl=e=>re(e.x1,e.y1),kl=e=>re(e.x2,e.y2),zi=e=>Rt(e,"text"),Bd=e=>zi(e)&&!(qd(e)||Rt(e,"width")),zd=e=>zi(e)&&(qd(e)||Rt(e,"width")),vr=e=>!zi(e)&&f_(e),$i=e=>Rt(e,"rx"),Io=e=>Rt(e,"x1"),Vi=e=>Rt(e,"points"),s_=e=>zi(e)&&!e.text.length,wl=e=>zi(e)&&e.isEditing,id=e=>Rt(e,"opacity")?e.opacity>0:!0,Va=e=>e.isSelected,p1=e=>e.isEditing,nr=e=>e._isDraft,vs=e=>Rt(e,"width")&&Rt(e,"height"),c_=e=>Ht(e.strokeWidth)&&e.strokeWidth>0,Vy=e=>{const t=Rt(e,"right"),n=Rt(e,"bottom");return t||n},u_=e=>Rt(e,"backgroundImage")||Rt(e,"text"),qd=e=>(Rt(e,"x")||Rt(e,"left"))&&Rt(e,"right")||(Rt(e,"y")||Rt(e,"top"))&&Rt(e,"bottom"),f_=e=>vs(e)||qd(e),d_=(e,t)=>{const n=e[t];return n?n.length===3?!0:n[3]>0:!1},h_=e=>e.strokeWidth&&d_(e,"strokeColor"),m_=e=>(e.isSelected=!0,e),em=e=>(e._isDraft=!0,e),Z0=e=>(e._isDraft=!1,e),tm=(e,t)=>
13e.disableStyle===!0?!1:Si(e.disableStyle)&&t?!e.disableStyle.includes(t):!0,g_=e=>e.disableAcceptSnap!==!0,b_=e=>e.disableErase!==!0,Ba=e=>e.disableSelect!==!0,od=e=>e.disableRemove!==!0,X0=e=>e.disableDuplicate!==!0&&Bs(e),p_=e=>e.disableReorder!==!0,y_=e=>e.disableFlip||nr(e)||Vy(e)?!1:u_(e),uc=(e,t)=>!zi(e)||e.disableInput===!0?!1:xn(e.disableInput)?e.disableInput(t??e.text):t||!0,Rs=(e,t)=>e.disableTextLayout===!0?!1:Si(e.disableTextLayout)&&t?!e.disableTextLayout.includes(t):!0,y1=e=>Wy(e)&&e.points.length>3,Wy=e=>!(!Vi(e)||e.disableAddPoints===void 0||e.disableAddPoints===!0),Wm=e=>e.disableManipulate!==!0&&!nr(e)&&!Vy(e),Bs=e=>Wm(e)&&e.disableMove!==!0,S_=e=>Wm(e)&&Bs(e)&&e.disableResize!==!0&&(vs(e)||zd(e)||$i(e)||Io(e)||Vi(e)&&Rt(e,"pathClose")),w_=e=>Wm(e)&&e.disableRotate!==!0&&(vs(e)||Rt(e,"text")||$i(e)),Um=e=>(delete e.left,delete e.right,delete e.top,delete e.bottom,e),Uy=e=>(delete e.rotation,e),Hy=e=>(e.strokeWidth=e.strokeWidth||1,e.strokeColor=e.strokeColor||[0,0,0],e),Ny=e=>(e.backgroundColor=e.backgroundColor?e.backgroundColor:e.strokeWidth||e.backgroundImage?void 0:[0,0,0],e),Gy=e=>{let t=e.text;t=t.replace(/&(#[0-9]+|[a-z]+);/gi,(n,i)=>`___${i}___`),t=t.replace(/&/,"&amp;"),e.text=t.replace(/___(#[0-9]+|[a-z]+)___/gi,(n,i)=>`&${i};`)},__=e=>{Gy(e);let t=e.text;t=t.replace(/</g,"&gt;"),t=t.replace(/>/g,"&lt;"),e.text=t},nm=e=>{if(!e.textShadow)return e;const[t,n,i,o]=e.textShadow;return e.textShadowX=t,e.textShadowY=n,e.textShadowBlur=i,e.textShadowColor=o,delete e.textShadow,e},im=e=>{if(!e.textOutline)return e;const[t,n]=e.textOutline;e.textOutlineWidth=t,e.textOutlineColor=n,delete e.textOutline},T_=e=>(e.fontSize=e.fontSize||"4%",e.fontFamily=e.fontFamily||"sans-serif",e.fontWeight=e.fontWeight||"normal",e.fontStyle=e.fontStyle||"normal",e.fontVariant=e.fontVariant||"normal",e.lineHeight=e.lineHeight||"120%",e.color=e.color||[0,0,0],e.format=e.format==="html"?"html":"text",nm(e),im(e),e.format==="html"?Gy(e):__(e),Bd(e)?k_(e):C_(e)),k_=e=>(e.disableNewline!==!1&&(delete e.textAlign,e.text=e.text.replace(/\n/g," ")),Um(e)),C_=e=>(e.textAlign=e.textAlign||"left",e),P_=e=>(e.cornerRadius=e.cornerRadius||0,e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],Ny(e)),M_=e=>(e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],Ny(e)),R_=e=>(Hy(e),Uy(e),Rt(e,"pathClose")||(e.disableResize=!0,Rt(e,"disableMove")||(e.disableMove=!0)),Um(e)),I_=e=>(Hy(e),e.lineStart=e.lineStart||void 0,e.lineEnd=e.lineEnd||void 0,Uy(e),Um(e)),E_=e=>{Nt(e.id)||(e.id=Yr()),Rt(e,"rotation")||(e.rotation=0),Rt(e,"opacity")||(e.opacity=1),Rt(e,"disableErase")||(e.disableErase=!0)},jy=e=>(E_(e),zi(e)?T_(e):vr(e)?P_(e):Vi(e)?R_(e):Io(e)?I_(e):$i(e)&&M_(e),e),A_=e=>{if(zi(e))return"text";if(vr(e))return"rectangle";if(Vi(e))return"path";if(Io(e))return"line";if($i(e))return"ellipse"},Vd=(e,t)=>parseFloat(e)/100*t,L_=new RegExp(/^x|left|right|^width|rx|fontSize|eraseRadius|feather|cornerRadius|strokeWidth|strokeDash/,"i"),x_=new RegExp(/^y|top|bottom|^height|ry/,"i"),Hm=(e,t,{width:n,height:i})=>{if(Array.isArray(t))return t.map(r=>(ls(r)&&Zy(r,{width:n,height:i}),Nt(r)&&(r=Hm(e,r,{width:n,height:i})),r));if(typeof t!="string"||!t.endsWith("%"))return t;const o=parseFloat(t)/100;return L_.test(e)?un(n*o,6):x_.test(e)?un(i*o,6):t},F_=Hm,v_=(e,t)=>Math.round(t*(parseFloat(e)/100)),O_=["lineHeight","textOutlineWidth","textShadowX","textShadowY","textShadowBlur"],Zy=(e,t)=>{Object.entries(e).map(([n,i])=>{e[n]=Hm(n,i,t)}),e.text&&O_.filter(n=>Nt(e[n])).forEach(n=>{e[n]=v_(e[n],e.fontSize)})},Ii=(e,t)=>(Zy(e,t),Yy(e,t),e),om=(e,t)=>{let n;return/^x|width|rx|fontSize|strokeWidth|cornerRadius/.test(e)?n=t.width:/^y|height|ry/.test(e)&&(n=t.height),n},D_=(e,t,n,i)=>{if(!Nt(e[t]))return e[t]=n,e;const o=om(t,i);return e[t]=o===void 0?n:cr(n,o),e},rm=(e,t,n)=>Array.isArray(e[t])?e[t].map(i=>Object.entries(i).reduce((o,[r,a])=>(o[r]=Nt(a)?Vd(a,om(r,n)):a,o),{})):Nt(e[t])?Vd(e[t],om(t,n)):e[t],_c=(e,t,n)=>t.reduce((i,o)=>{const r=rm(e,o,n);return i[o]=r,i},{}),Ua=(e,t,n)=>(Object.keys(t).forEach(i=>D_(e,i,t[i],n)),e),B_=e=>
13{const t=ql(),n=e.strokeWidth||0;if(vr(e))t.x=e.x-n*.5,t.y=e.y-n*.5,t.width=e.width+n,t.height=e.height+n;else if(Io(e)){const{x1:i,y1:o,x2:r,y2:a}=e,l=Math.abs(Math.min(i,r)),s=Math.abs(Math.max(i,r)),c=Math.abs(Math.min(o,a)),u=Math.abs(Math.min(o,a));t.x=l+n*.5,t.y=s+n*.5,t.width=s-l+n,t.height=u-c+n}else $i(e)&&(t.x=e.x-e.rx+n*.5,t.y=e.y-e.ry+n*.5,t.width=e.rx*2+n,t.height=e.ry*2+n);return t&&Rt(e,"rotation")&&Ro(t,e.rotation),Ws(t)},Xy=(e,t)=>{const n=e.filter(i=>i.x<0||i.y<0||i.x1<0||i.y1<0).reduce((i,o)=>{const[r,a,l,s]=B_(o);return i.top=Math.min(r,i.top),i.left=Math.min(s,i.left),i.bottom=Math.max(l,i.bottom),i.right=Math.max(a,i.right),i},{top:0,right:0,bottom:0,left:0});return n.right>0&&(n.right-=t.width),n.bottom>0&&(n.bottom-=t.height),n},Ky=(e,t,n)=>{const i=yi(e);Ii(i,t);const o=n(i);return Array.isArray(o)?o:[o]},Yy=(e,t)=>{if(Rt(e,"left")&&(e.x=e.left),Rt(e,"right")&&!Nt(e.right)){const n=t.width-e.right;Rt(e,"left")?(e.x=e.left,e.width=Math.max(0,n-e.left)):Rt(e,"width")&&(e.x=n-e.width)}if(Rt(e,"top")&&(e.y=e.top),Rt(e,"bottom")&&!Nt(e.bottom)){const n=t.height-e.bottom;Rt(e,"top")?(e.y=e.top,e.height=Math.max(0,n-e.top)):Rt(e,"height")&&(e.y=n-e.height)}return e},qy=(e,t)=>(Vi(e)&&e.points.filter(n=>Ht(n.x)).forEach(n=>{n.x*=t,n.y*=t}),Io(e)&&Ht(e.x1)&&(e.x1*=t,e.y1*=t,e.x2*=t,e.y2*=t),Ht(e.x)&&Ht(e.y)&&(e.x*=t,e.y*=t),Ht(e.width)&&Ht(e.height)&&(e.width*=t,e.height*=t),Ht(e.rx)&&Ht(e.ry)&&(e.rx*=t,e.ry*=t),c_(e)&&(e.strokeWidth*=t),zi(e)&&(e._scale=t,Ht(e.fontSize)&&(e.fontSize*=t),Ht(e.lineHeight)&&(e.lineHeight*=t),Ht(e.width)&&!Ht(e.height)&&(e.width*=t)),Rt(e,"cornerRadius")&&Ht(e.cornerRadius)&&(e.cornerRadius*=t),e),Jy=e=>{if(vr(e))return re(e.x+e.width*.5,e.y+e.height*.5);if($i(e))return re(e.x,e.y);if(e.text){if(zd(e)){const n=e.height||tr(e.text,e).height;return re(e.x+e.width*.5,e.y+n*.5)}const t=tr(e.text,e);return re(e.x+t.width*.5,e.y+t.height*.5)}if(Vi(e))return Kr(e.points);if(Io(e))return Kr([Tl(e),kl(e)])};var z_=(e,t,n,i,o,r)=>(i<2*r&&(r=i/2),o<2*r&&(r=o/2),e.beginPath(),e.moveTo(t+r,n),e.arcTo(t+i,n,t+i,n+o,r),e.arcTo(t+i,n+o,t,n+o,r),e.arcTo(t,n+o,t,n,r),e.arcTo(t,n,t+i,n,r),e.closePath(),e),Ic=e=>/canvas/i.test(e.nodeName),V_=e=>new URL(e,location.href).origin!==location.origin,W_=(e,t=void 0)=>new Promise((n,i)=>{let o=e,r=!1;const a=()=>{r||(r=!0,xn(t)&&Promise.resolve().then(()=>t(Ci(o.naturalWidth,o.naturalHeight))))};if(o.src||(o=new Image,Nt(e)&&V_(e)&&(o.crossOrigin="anonymous"),o.src=Nt(e)?e:URL.createObjectURL(e)),o.complete)return a(),n(o);xn(t)&&Cy(o).then(a).catch(i),o.onload=()=>{a(),n(o)},o.onerror=()=>i(new Error("Failed to load image"))});const K0=new Map([]),Nm=(e,t={})=>new Promise((n,i)=>{const{onMetadata:o=st,onLoad:r=n,onError:a=i,onComplete:l=st}=t;let s=K0.get(e);if(s||(s={loading:!1,complete:!1,error:!1,image:void 0,size:void 0,bus:Pl()},K0.set(e,s)),s.bus.sub("meta",o),s.bus.sub("load",r),s.bus.sub("error",a),s.bus.sub("complete",l),Ic(e)){const c=e,u=c.cloneNode();s.complete=!0,s.image=u,s.size=Ou(c)}if(s.complete){s.bus.pub("meta",{size:s.size}),s.error?s.bus.pub("error",s.error):s.bus.pub("load",s.image),s.bus.pub("complete"),s.bus=Pl();return}s.loading||(s.loading=!0,W_(e,c=>{s.size=c,s.bus.pub("meta",{size:c})}).then(c=>{s.image=c,s.bus.pub("load",c)}).catch(c=>{s.error=c,s.bus.pub("error",c)}).finally(()=>{s.complete=!0,s.loading=!1,s.bus.pub("complete"),s.bus=Pl()}))}),U_=(e,t,n,i)=>e.drawImage(t,n.x,n.x,n.width,n.height,i.x,i.y,i.width,i.height);var Qy=async(e,t,n,i,o=U_,r)=>{e.save(),e.clip(),await o(e,t,n,i,r),e.restore()};const Wd=(e,t,n,i,o)=>{const r=Rn(e);if(i){const l=qr(Qi(i),un);return l.x*=n.width,l.width*=n.width,l.y*=n.height,l.height*=n.height,{srcRect:l,destRect:r}}const a=Li(0,0,n.width,n.height);if(t==="contain"){const l=rr(e,ao(a));r.width=l.width,r.height=l.height,o?(r.x+=o.x,r.y+=o.y):(r.x+=l.x,r.y+=l.y)}else if(t==="cover"){const l=rs(r,a.width/a.height);r.width=l.width,r.height=l.height,o?(r.x+=o.x,r.y+=o.y):(r.x+=l.x,r.y+=l.y)}else t?(r.width=t.width,r.height=t.height,o&&(r.x+=o.x,r.y+=o.y)):o&&(r.width=n.width,r.height=n.height,r.x+=o.x,r.y+=o.y);return{srcRect:a,destRect:r}},S1=(e,t)=>(t.cornerRadius>0?z_(e,t.x,t.y,t.width,t.height,t.cornerRadius):e.rect(t.x,t.y,t.width,t.height),e),Y0=(e,t)=>(t.backgroundColor&&e.fill(),e),q0=(e,t)=>(t.strokeWidth&&e.stroke(),e);var Gm=async(e,t,n={})=>{const{drawImage:i}=n;if(e.lineWidth=t.strokeWidth?t.strokeWidth:1,e.strokeStyle=t.strokeColor?Eo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Eo(t.backgroundColor):"none",e.globalAlpha=t.opacity,t.backgroundImage){let o;if(Ic(t.backgroundImage)?o=t.backgroundImage:o=await Nm(t.backgroundImage),S1(e,t),Y
130(e,t),t.backgroundRepeat==="repeat"){const r=t.backgroundPosition||{x:0,y:0},{srcRect:a,destRect:l}=Wd(t,t.backgroundSize||Ou(o),Ou(o),t.backgroundCorners,{x:0,y:0}),s=document.createElement("canvas");s.width=l.width,s.height=l.height;const c=s.getContext("2d",{willReadFrequently:!1,desynchronized:!0});await i(c,o,a,{...l,x:0,y:0});const u=e.createPattern(s,"repeat");e.fillStyle=u,e.save(),e.beginPath(),e.rect(t.x+r.x,t.y+r.y,t.width-r.x,t.height-r.y),e.clip(),e.translate(l.x+r.x,l.y+r.y),e.fill(),Wi(s),e.restore()}else{const{srcRect:r,destRect:a}=Wd(t,t.backgroundSize,Ou(o),t.backgroundCorners,t.backgroundPosition);await Qy(e,o,r,a,i,{feather:t.feather})}return e.beginPath(),S1(e,t),q0(e,t),[]}return S1(e,t),Y0(e,t),q0(e,t),[]},jm=async(e,t,n={})=>new Promise(async(i,o)=>{const{drawImage:r}=n;if(e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Eo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Eo(t.backgroundColor):"none",e.globalAlpha=t.opacity,e.ellipse(t.x,t.y,t.rx,t.ry,0,0,Math.PI*2),t.backgroundColor&&e.fill(),t.backgroundImage){let a;try{a=await Nm(t.backgroundImage)}catch(u){o(u)}const l=Li(t.x-t.rx,t.y-t.ry,t.rx*2,t.ry*2),{srcRect:s,destRect:c}=Wd(l,t.backgroundSize,Ou(a),t.backgroundCorners,t.backgroundPosition);await Qy(e,a,s,c,r),t.strokeWidth&&e.stroke(),i([])}else t.strokeWidth&&e.stroke(),i([])}),H_=async(e,t,n)=>{const i=Ht(t.width)?Math.floor(t.width):void 0,o=Ht(t.height)?Math.floor(t.height):void 0,r=i&&o?sl(t):tr(t.text,{...t,width:i,height:o}),a={x:t.x,y:t.y,width:r.width,height:r.height};if(Gm(e,{...t,...a}),!t.text.length)return[];const{textOutlineWidth:l=0,textShadowX:s=0,textShadowY:c=0,textShadowBlur:u=0,textShadowColor:f,outline:d,blur:m,...g}=t,p=!!t.height;if(p&&(e.rect(a.x,a.y,a.width,a.height),e.save(),e.clip()),s||c||u){e.save(),e.translate(s,c);const y={...a};p||(y.height+=al+u),await w1(e,y,{...t,width:i,height:o},{...n,paddingLeft:al+u,paddingRight:al+u,paddingTop:u,paddingBottom:u+(p?-1*c:t.fontSize),shapeExtendedProps:{color:f,blur:u}}),e.restore()}if(l){const y={...a};p||(y.height+=al+l),await w1(e,y,{...t,width:i,height:o},{...n,paddingLeft:al+l,paddingRight:al+l,paddingTop:l,paddingBottom:l+p?0:t.fontSize,shapeExtendedProps:{color:t.textOutlineColor,outline:l}})}return p&&e.restore(),await w1(e,a,{...g,width:i,height:o},{...n,paddingLeft:al,paddingRight:al,paddingTop:0,paddingBottom:p?0:t.fontSize}),[]};const w1=async(e,t,n,i)=>{const{willRequest:o,shapeExtendedProps:r,paddingLeft:a,paddingRight:l,paddingTop:s,paddingBottom:c,styleNonce:u}=i,f=Ht(n.width)?Math.floor(t.width):void 0,d=Ht(n.height)?Math.floor(t.height):void 0,m=Math.ceil(t.width),g=Math.ceil(t.height),p=await zy(n.text,{...n,...r,...t,width:f,height:d,paddingLeft:a,paddingRight:l,paddingTop:s,paddingBottom:c,imageWidth:m,imageHeight:g,willRequest:o,styleNonce:u});e.drawImage(p,n.x-a,n.y-s,p.width,p.height)};var N_=async(e,t)=>new Promise(async n=>{e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Eo(t.strokeColor):"none",e.globalAlpha=t.opacity,t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[]));let i=Tl(t),o=kl(t);e.moveTo(i.x,i.y),e.lineTo(o.x,o.y),t.strokeWidth&&e.stroke(),n([])}),Zm=async(e,t)=>new Promise((n,i)=>{if(t.bitmap&&t.points.length===1){jm(e,{x:t.points[0].x,y:t.points[0].y,rx:t.strokeWidth*.5,ry:t.strokeWidth*.5,backgroundColor:t.strokeColor}).then(()=>n([]));return}e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Eo(t.strokeColor):"transparent",e.fillStyle=t.pathClose&&t.backgroundColor?Eo(t.backgroundColor):"transparent",e.globalAlpha=t.opacity;const{points:o}=t;t.bitmap&&(e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[])),t.pathClose&&e.beginPath(),e.moveTo(o[0].x,o[0].y);const r=o.length;for(let a=1;a<r;a++)e.lineTo(o[a].x,o[a].y);t.pathClose&&e.closePath(),t.strokeWidth&&e.stroke(),t.backgroundColor&&e.fill(),n([])}),$y=(e,t,n,i)=>(!t&&!n||(e.translate(i.x,i.y),e.scale(t?-1:1,n?-1:1),e.translate(-i.x,-i.y)),e);const G_=async(e,t,n)=>{e.globalCompositeOperation=t.drawMode==="subtract"?"destination-out":"source-over";const i=Jy(t);Dm(e,t.rotation,i),$y(e,t.flipX,t.flipY,i);let o;if(vr(t)?o=Gm:$i(t)?o=jm:Io(t)?o=N_:Vi(t)?o=Zm:zi(t)&&(o=H_),o){const r=await o(e,t,n);if(!r.length)return[];const a=await eS(e,r,n);return[t,...a]}return[]};var eS=async(e,t,n)=>{let i=[];for(const o of t)e.save(),e.beginPath(),i=[...i,...await G_(e,o,n)],e.restore(
13);return i},Xm=async(e,t={})=>{const{shapes:n=[],contextBounds:i=e,transform:o=st,drawImage:r,willRequest:a,styleNonce:l,canvasMemoryLimit:s,computeShape:c=Nn,preprocessShape:u=Nn}=t;if(!n.length)return e;const f={willReadFrequently:!0,colorSpace:e.colorSpace},d=ci("canvas");d.width=i.width,d.height=i.height;const m=d.getContext("2d",f);m.putImageData(e,i.x||0,i.y||0);const g=n.map(yi).map(c).map(u).flat().filter(Boolean);o(m),await eS(m,g,{drawImage:r,canvasMemoryLimit:s,willRequest:a,styleNonce:l});const p=m.getImageData(0,0,d.width,d.height);return Wi(d),p},j_=async(e,t={})=>{const{backgroundFilterMode:n,backgroundColor:i,backgroundImage:o}=t,r=!(!i||i&&i[3]===0);if(!o&&!r)return e;const a={willReadFrequently:!0,colorSpace:e.colorSpace},l=ci("canvas");l.width=e.width,l.height=e.height;const s=l.getContext("2d",a);if(s.putImageData(e,0,0),s.globalCompositeOperation="destination-over",r&&(s.fillStyle=Eo(i),s.fillRect(0,0,l.width,l.height)),o){let u;Ic(o)?u=o:(u=await Nm(o),n==="image"&&(u=sy(u,{contextOptions:a})));let f;if(n==="image"){const g=xc(u),p=await xy(g,t);f=await Vs(p)}const{srcRect:d,destRect:m}=Wd({x:0,y:0,width:e.width,height:e.height},"cover",{width:u.width||u.naturalWidth,height:u.height||u.naturalHeight});s.drawImage(f||u,d.x,d.y,d.width,d.height,m.x,m.y,m.width,m.height),f&&Wi(f),n&&n!=="none"&&u&&!Ic(o)&&Wi(u)}const c=s.getImageData(0,0,l.width,l.height);return Wi(l),c},Z_=(e,t)=>{const n=new Array(20);return n[0]=e[0]*t[0]+e[1]*t[5]+e[2]*t[10]+e[3]*t[15],n[1]=e[0]*t[1]+e[1]*t[6]+e[2]*t[11]+e[3]*t[16],n[2]=e[0]*t[2]+e[1]*t[7]+e[2]*t[12]+e[3]*t[17],n[3]=e[0]*t[3]+e[1]*t[8]+e[2]*t[13]+e[3]*t[18],n[4]=e[0]*t[4]+e[1]*t[9]+e[2]*t[14]+e[3]*t[19]+e[4],n[5]=e[5]*t[0]+e[6]*t[5]+e[7]*t[10]+e[8]*t[15],n[6]=e[5]*t[1]+e[6]*t[6]+e[7]*t[11]+e[8]*t[16],n[7]=e[5]*t[2]+e[6]*t[7]+e[7]*t[12]+e[8]*t[17],n[8]=e[5]*t[3]+e[6]*t[8]+e[7]*t[13]+e[8]*t[18],n[9]=e[5]*t[4]+e[6]*t[9]+e[7]*t[14]+e[8]*t[19]+e[9],n[10]=e[10]*t[0]+e[11]*t[5]+e[12]*t[10]+e[13]*t[15],n[11]=e[10]*t[1]+e[11]*t[6]+e[12]*t[11]+e[13]*t[16],n[12]=e[10]*t[2]+e[11]*t[7]+e[12]*t[12]+e[13]*t[17],n[13]=e[10]*t[3]+e[11]*t[8]+e[12]*t[13]+e[13]*t[18],n[14]=e[10]*t[4]+e[11]*t[9]+e[12]*t[14]+e[13]*t[19]+e[14],n[15]=e[15]*t[0]+e[16]*t[5]+e[17]*t[10]+e[18]*t[15],n[16]=e[15]*t[1]+e[16]*t[6]+e[17]*t[11]+e[18]*t[16],n[17]=e[15]*t[2]+e[16]*t[7]+e[17]*t[12]+e[18]*t[17],n[18]=e[15]*t[3]+e[16]*t[8]+e[17]*t[13]+e[18]*t[18],n[19]=e[15]*t[4]+e[16]*t[9]+e[17]*t[14]+e[18]*t[19]+e[19],n},Jd=e=>e.length?e.reduce((t,n)=>Z_([...t],n),e.shift()):[],X_=(e,t=2)=>Math.round(e*t)/t,tS=(e,t)=>{const n=e.width*e.height,i=t.reduce((a,l)=>(l.width>a.width&&l.height>a.height&&(a.width=l.width,a.height=l.height),a),{width:0,height:0}),o=i.width*i.height,r=Math.max(.5,.5+(1-o/n)/2);return X_(r,5)};function qt(){}const nS=e=>e;function wi(e,t){for(const n in t)e[n]=t[n];return e}function iS(e){return e()}function J0(){return Object.create(null)}function On(e){e.forEach(iS)}function kn(e){return typeof e=="function"}function rn(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let rd;function Q0(e,t){return e===t?!0:(rd||(rd=document.createElement("a")),rd.href=t,e===rd.href)}function K_(e){return Object.keys(e).length===0}function Do(e,...t){if(e==null){for(const i of t)i(void 0);return qt}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Na(e){let t;return Do(e,n=>t=n)(),t}function B(e,t,n){e.$$.on_destroy.push(Do(t,n))}function lo(e,t,n,i){if(e){const o=oS(e,t,n,i);return e[0](o)}}function oS(e,t,n,i){return e[1]&&i?wi(n.ctx.slice(),e[1](i(t))):n.ctx}function so(e,t,n,i){if(e[2]&&i){const o=e[2](i(n));if(t.dirty===void 0)return o;if(typeof o=="object"){const r=[],a=Math.max(t.dirty.length,o.length);for(let l=0;l<a;l+=1)r[l]=t.dirty[l]|o[l];return r}return t.dirty|o}return t.dirty}function co(e,t,n,i,o,r){if(o){const a=oS(t,n,i,r);e.p(a,o)}}function uo(e){if(e.ctx.length>32){const t=[],n=e.ctx.length/32;for(let i=0;i<n;i++)t[i]=-1;return t}return-1}function Nu(e){const t={};for(const n in e)n[0]!=="$"&&(t[n]=e[n]);return t}function $0(e,t){const n={};t=new Set(t);for(const i in e)!t.has(i)&&i[0]!=="$"&&(n[i]=e[i]);return n}function _e(e,t,n){return e.set(n),t}function wn(e){return e&&kn(e.destroy)?e.destroy:qt}const rS=typeof window<"u";let aS=rS?()=>window.performance.now():()=>Date.now(),Km=rS?e=>requestAnimationFrame(e):qt;const Tc=new Set;
13function lS(e){Tc.forEach(t=>{t.c(e)||(Tc.delete(t),t.f())}),Tc.size!==0&&Km(lS)}function Ym(e){let t;return Tc.size===0&&Km(lS),{promise:new Promise(n=>{Tc.add(t={c:e,f:n})}),abort(){Tc.delete(t)}}}const sS=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Ae(e,t){e.appendChild(t)}function cS(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function Y_(e){const t=fe("style");return t.textContent="/* empty */",q_(cS(e),t),t.sheet}function q_(e,t){return Ae(e.head||e,t),t.sheet}function te(e,t,n){e.insertBefore(t,n||null)}function ee(e){e.parentNode&&e.parentNode.removeChild(e)}function fe(e){return document.createElement(e)}function Ao(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function bi(e){return document.createTextNode(e)}function ut(){return bi(" ")}function Mi(){return bi("")}function Pe(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function J_(e){return function(t){return t.preventDefault(),e.call(this,t)}}function Q_(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function k(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const $_=["width","height"];function eT(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)t[i]==null?e.removeAttribute(i):i==="style"?e.style.cssText=t[i]:i==="__value"?e.value=e[i]=t[i]:n[i]&&n[i].set&&$_.indexOf(i)===-1?e[i]=t[i]:k(e,i,t[i])}function tT(e,t){Object.keys(t).forEach(n=>{nT(e,n,t[n])})}function nT(e,t,n){const i=t.toLowerCase();i in e?e[i]=typeof e[i]=="boolean"&&n===""?!0:n:t in e?e[t]=typeof e[t]=="boolean"&&n===""?!0:n:k(e,t,n)}function e2(e){return/-/.test(e)?tT:eT}function iT(e){return Array.from(e.childNodes)}function vi(e,t){t=""+t,e.data!==t&&(e.data=t)}function t2(e,t){e.value=t??""}function Ee(e,t,n,i){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function uS(e,t,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:i})}class qm{is_svg=!1;e=void 0;n=void 0;t=void 0;a=void 0;constructor(t=!1){this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,i=null){this.e||(this.is_svg?this.e=Ao(n.nodeName):this.e=fe(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(i)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)te(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(ee)}}function Ud(e,t){return new e(t)}const Hd=new Map;let Nd=0;function oT(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function rT(e,t){const n={stylesheet:Y_(t),rules:{}};return Hd.set(e,n),n}function n2(e,t,n,i,o,r,a,l=0){const s=16.666/i;let c=`{
14`;for(let y=0;y<=1;y+=s){const w=t+(n-t)*r(y);c+=y*100+`%{${a(w,1-w)}}
15`}const u=c+`100% {${a(n,1-n)}}
16}`,f=`__svelte_${oT(u)}_${l}`,d=cS(e),{stylesheet:m,rules:g}=Hd.get(d)||rT(d,e);g[f]||(g[f]=!0,m.insertRule(`@keyframes ${f} ${u}`,m.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${f} ${i}ms linear ${o}ms 1 both`,Nd+=1,f}function aT(e,t){const n=(e.style.animation||"").split(", "),i=n.filter(t?r=>r.indexOf(t)<0:r=>r.indexOf("__svelte")===-1),o=n.length-i.length;o&&(e.style.animation=i.join(", "),Nd-=o,Nd||lT())}function lT(){Km(()=>{Nd||(Hd.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&ee(t)}),Hd.clear())})}let Gu;function Bu(e){Gu=e}function Us(){if(!Gu)throw new Error("Function called outside component initialization");return Gu}function ss(e){Us().$$.on_mount.push(e)}function sT(e){Us().$$.after_update.push(e)}function Jr(e){Us().$$.on_destroy.push(e)}function Xa(){const e=Us();return(t,n,{cancelable:i=!1}={})=>{const o=e.$$.callbacks[t];if(o){const r=uS(t,n,{cancelable:i});return o.slice().forEach(a=>{a.call(e,r)}),!r.defaultPrevented}return!0}}function sr(e,t){return Us().$$.context.set(e,t),t}function Qn(e){return Us().$$.context.get(e)}function cT(){return Us().$$.context}function Zo(e,t){const n=e.$$.callbacks[t.type];
16n&&n.slice().forEach(i=>i.call(this,t))}const gc=[],vn=[];let kc=[];const am=[],fS=Promise.resolve();let lm=!1;function dS(){lm||(lm=!0,fS.then(F))}function hS(){return dS(),fS}function Ec(e){kc.push(e)}function Dr(e){am.push(e)}const _1=new Set;let fc=0;function F(){if(fc!==0)return;const e=Gu;do{try{for(;fc<gc.length;){const t=gc[fc];fc++,Bu(t),uT(t.$$)}}catch(t){throw gc.length=0,fc=0,t}for(Bu(null),gc.length=0,fc=0;vn.length;)vn.pop()();for(let t=0;t<kc.length;t+=1){const n=kc[t];_1.has(n)||(_1.add(n),n())}kc.length=0}while(gc.length);for(;am.length;)am.pop()();lm=!1,_1.clear(),Bu(e)}function uT(e){if(e.fragment!==null){e.update(),On(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Ec)}}function fT(e){const t=[],n=[];kc.forEach(i=>e.indexOf(i)===-1?t.push(i):n.push(i)),n.forEach(i=>i()),kc=t}let Tu;function dT(){return Tu||(Tu=Promise.resolve(),Tu.then(()=>{Tu=null})),Tu}function T1(e,t,n){e.dispatchEvent(uS(`${t?"intro":"outro"}${n}`))}const Rd=new Set;let Cl;function Et(){Cl={r:0,c:[],p:Cl}}function At(){Cl.r||On(Cl.c),Cl=Cl.p}function L(e,t){e&&e.i&&(Rd.delete(e),e.i(t))}function z(e,t,n,i){if(e&&e.o){if(Rd.has(e))return;Rd.add(e),Cl.c.push(()=>{Rd.delete(e),i&&(n&&e.d(1),i())}),e.o(t)}else i&&i()}const hT={duration:0};function i2(e,t,n,i){let r=t(e,n,{direction:"both"}),a=i?0:1,l=null,s=null,c=null,u;function f(){c&&aT(e,c)}function d(g,p){const y=g.b-a;return p*=Math.abs(y),{a,b:g.b,d:y,duration:p,start:g.start,end:g.start+p,group:g.group}}function m(g){const{delay:p=0,duration:y=300,easing:w=nS,tick:_=qt,css:P}=r||hT,C={start:aS()+p,b:g};g||(C.group=Cl,Cl.r+=1),"inert"in e&&(g?u!==void 0&&(e.inert=u):(u=e.inert,e.inert=!0)),l||s?s=C:(P&&(f(),c=n2(e,a,g,y,p,w,P)),g&&_(0,1),l=d(C,y),Ec(()=>T1(e,g,"start")),Ym(R=>{if(s&&R>s.start&&(l=d(s,y),s=null,T1(e,l.b,"start"),P&&(f(),c=n2(e,a,l.b,l.duration,0,w,r.css))),l){if(R>=l.end)_(a=l.b,1-a),T1(e,l.b,"end"),s||(l.b?f():--l.group.r||On(l.group.c)),l=null;else if(R>=l.start){const I=R-l.start;a=l.a+l.d*w(I/l.duration),_(a,1-a)}}return!!(l||s)}))}return{run(g){kn(r)?dT().then(()=>{r=r({direction:g?"in":"out"}),m(g)}):m(g)},end(){f(),l=s=null}}}function xo(e){return e?.length!==void 0?e:Array.from(e)}function mS(e,t){e.d(1),t.delete(e.key)}function cs(e,t){z(e,1,1,()=>{t.delete(e.key)})}function cl(e,t,n,i,o,r,a,l,s,c,u,f){let d=e.length,m=r.length,g=d;const p={};for(;g--;)p[e[g].key]=g;const y=[],w=new Map,_=new Map,P=[];for(g=m;g--;){const M=f(o,r,g),T=n(M);let v=a.get(T);v?P.push(()=>v.p(M,t)):(v=c(T,M),v.c()),w.set(T,y[g]=v),T in p&&_.set(T,Math.abs(g-p[T]))}const C=new Set,R=new Set;function I(M){L(M,1),M.m(l,u),a.set(M.key,M),u=M.first,m--}for(;d&&m;){const M=y[m-1],T=e[d-1],v=M.key,H=T.key;M===T?(u=M.first,d--,m--):w.has(H)?!a.has(v)||C.has(v)?I(M):R.has(H)?d--:_.get(v)>_.get(H)?(R.add(v),I(M)):(C.add(H),d--):(s(T,a),d--)}for(;d--;){const M=e[d];w.has(M.key)||s(M,a)}for(;m;)I(y[m-1]);return On(P),y}function fo(e,t){const n={},i={},o={$$scope:1};let r=e.length;for(;r--;){const a=e[r],l=t[r];if(l){for(const s in a)s in l||(i[s]=1);for(const s in l)o[s]||(n[s]=l[s],o[s]=1);e[r]=l}else for(const s in a)o[s]=1}for(const a in i)a in n||(n[a]=void 0);return n}function yo(e){return typeof e=="object"&&e!==null?e:{}}function Cr(e,t,n){const i=e.$$.props[t];i!==void 0&&(e.$$.bound[i]=n,n(e.$$.ctx[i]))}function Ve(e){e&&e.c()}function ve(e,t,n){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),Ec(()=>{const r=e.$$.on_mount.map(iS).filter(kn);e.$$.on_destroy?e.$$.on_destroy.push(...r):On(r),e.$$.on_mount=[]}),o.forEach(Ec)}function Oe(e,t){const n=e.$$;n.fragment!==null&&(fT(n.after_update),On(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function mT(e,t){e.$$.dirty[0]===-1&&(gc.push(e),dS(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function mn(e,t,n,i,o,r,a=null,l=[-1]){const s=Gu;Bu(e);const c=e.$$={fragment:null,ctx:[],props:r,update:qt,not_equal:o,bound:J0(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(s?s.$$.context:[])),callbacks:J0(),dirty:l,skip_bound:!1,root:t.target||s.$$.root};a&&a(c.root);let u=!1;if(c.ctx=n?n(e,t.props||{},(f,d,...m)=>{const g=m.length?m[0]:d;return c.ctx&&o(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),u&&mT(e,f)),d}
16):[],c.update(),u=!0,On(c.before_update),c.fragment=i?i(c.ctx):!1,t.target){if(t.hydrate){const f=iT(t.target);c.fragment&&c.fragment.l(f),f.forEach(ee)}else c.fragment&&c.fragment.c();t.intro&&L(e.$$.fragment),ve(e,t.target,t.anchor),F()}Bu(s)}class gn{$$=void 0;$$set=void 0;$destroy(){Oe(this,1),this.$destroy=qt}$on(t,n){if(!kn(n))return qt;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(n),()=>{const o=i.indexOf(n);o!==-1&&i.splice(o,1)}}$set(t){this.$$set&&!K_(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const gT="4",dc=[];function pc(e,t){return{subscribe:ht(e,t).subscribe}}function ht(e,t=qt){let n;const i=new Set;function o(l){if(rn(e,l)&&(e=l,n)){const s=!dc.length;for(const c of i)c[1](),dc.push(c,e);if(s){for(let c=0;c<dc.length;c+=2)dc[c][0](dc[c+1]);dc.length=0}}}function r(l){o(l(e))}function a(l,s=qt){const c=[l,s];return i.add(c),i.size===1&&(n=t(o,r)||qt),l(e),()=>{i.delete(c),i.size===0&&n&&(n(),n=null)}}return{set:o,update:r,subscribe:a}}function Ln(e,t,n){const i=!Array.isArray(e),o=i?[e]:e;if(!o.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=t.length<2;return pc(n,(a,l)=>{let s=!1;const c=[];let u=0,f=qt;const d=()=>{if(u)return;f();const g=t(i?c[0]:c,a,l);r?a(g):f=kn(g)?g:qt},m=o.map((g,p)=>Do(g,y=>{c[p]=y,u&=~(1<<p),s&&d()},()=>{u|=1<<p}));return s=!0,d(),function(){On(m),f(),s=!1}})}var gS=e=>e.reduce((t,n)=>Object.assign(t,n),{});const hc=e=>({updateValue:e}),Xr=e=>({defaultValue:e}),bS=e=>({store:e}),ad=e=>({store:(t,n)=>Ln(...e(n))}),ld=e=>({store:(t,n)=>{const[i,o,r=()=>!1]=e(n);let a=!0,l;return Ln(i,(s,c)=>{o(s,u=>{!a&&r(l,u)||(l=u,a=!1,c(u))})})}}),ku=e=>({store:(t,n)=>{const[i,o={},r=void 0]=e(n);let a=[];const l={},s=m=>i(m,l),c=m=>{!a.length&&!m.length||(a=m,u())},u=()=>{const m=a.map(s);r&&m.sort(r),a=[...m],d(m)};Object.entries(o).map(([m,g])=>g.subscribe(p=>{l[m]=p,p&&u()}));const{subscribe:f,set:d}=ht(t||[]);return{set:c,update:m=>c(m(a)),subscribe:f}}}),bT=(e,t,n)=>{const{store:i=d=>ht(d),defaultValue:o=st,updateValue:r=void 0}=n,a=i(o(),t,e),{subscribe:l,update:s=st}=a;let c;const u=d=>{let m=!0;c&&c(),c=l(g=>
16{if(m)return m=!1;d(g),c(),c=void 0})},f=r?r(e):Nn;return a.set=d=>s(m=>f(d,m,u)),a.defaultValue=o,a};var pS=e=>{const t={},n={};return e.forEach(([i,...o])=>{const r=gS(o),a=t[i]=bT(n,t,r),l={get:()=>Na(a),set:a.set};Object.defineProperty(n,i,l)}),{stores:t,accessors:n}};const pT=()=>{let e;const{subscribe:t,set:n}=ht(),i=r=>{e!==r&&(e=r,n(e))};return{set:i,subscribe:t,update:r=>i(r(e))}};var yT=[["src",bS(pT)],["imageReader"],["imageWriter"],["imageScrambler"],["imageRedactionRendering",Xr(()=>"pixelated")],["images",Xr(()=>[])],["shapePreprocessor"],["willRequestResource"],["willRequest"],["csp"]],yS=e=>e.charAt(0).toUpperCase()+e.slice(1),Qd=(e,t)=>{Object.keys(t).forEach(n=>{const i=xn(t[n])?{value:t[n],writable:!1}:t[n];Object.defineProperty(e,n,i)})};const o2=(e,t)=>{let n,i,o,r,a,l,s,c,u,f;const d=t.length;for(n=0;n<d;n++)if(i=t[n],o=t[n+1>d-1?0:n+1],r=i.x-e.x,a=i.y-e.y,l=o.x-e.x,s=o.y-e.y,c=r-l,u=a-s,f=c*a-u*r,f<-1e-5)return!1;return!0},k1=1e4;var r2=(e,t)=>{const n=_y(t),i=Kn();Fr(e).forEach(s=>{xi(s,i),!o2(s,t)&&n.forEach(c=>{const u=Math.atan2(c.start.y-c.end.y,c.start.x-c.end.x),f=Math.sin(Math.PI-u)*k1,d=Math.cos(Math.PI-u)*k1,m=re(s.x+f,s.y+d),g=Em(by(c),k1),p=Am(os(s,m),g);p&&xi(i,Fi(Ut(p),s))})});const r=Rn(e);return xi(r,i),Fr(r).every(s=>o2(s,t))?(Kd(e,r),!0):!1},SS=(e,t)=>{const n=Fr(e),i=Ty(t,5),o=In(e),r=[];n.forEach(u=>{const f=Yw(os(Ut(o),Ut(u)),1e6);let d=!1;i.map(by).forEach(m=>{const g=Am(f,m);!g||d||(r.push(g),d=!0)})});const a=or(r[0],r[2]),l=or(r[1],r[3]),s=a<l?[r[0],r[2]]:[r[1],r[3]],c=Qi(s);return c.width<e.width?(Kd(e,c),!0):!1},wS=(e,t,n={x:0,y:0})=>{const i=jo(e),o=In(i),r=yy(i,n,o).map(l=>Go(l,t,o)),a=Qi(r);return r.map(l=>Fi(l,a))},vc=(e,t=0,n=ao(e))=>{let i,o;if(t!==0){const r=Math.atan2(1,n),a=Math.sign(t)*t,l=a%Math.PI,s=a%Ha;let c;l>ca&&l<Ha+ca?c=s>ca?a:Ha-s:c=s>ca?Ha-s:a;const u=Math.min(Math.abs(e.height/Math.sin(r+c)),Math.abs(e.width/Math.cos(r-c)));i=Math.cos(r)*u,o=i/n}else i=e.width,o=i/n,o>e.height&&(o=e.height,i=o*n);return Ci(i,o)},ST=(e,t,n=0,i=Kn(),o)=>{if(Ht(n)&&n!==0||i.x||i.y){const r=ao(e),a=wS(t,n,i),l=vc(t,n,r);if(!(e.width<l.width&&e.height<l.height)){const u=e.width*.5-l.width*.5,f=e.height*.5-l.height*.5;e.width>l.width&&(e.width=l.width,e.x+=u),e.height>l.height&&(e.height=l.height,e.y+=f)}r2(e,a),SS(e,a)&&r2(e,a)}else{const r=ao(e);e.width=Math.min(e.width,t.width),e.height=Math.min(e.height,t.height),e.x=Math.max(e.x,0),e.x+e.width>t.width&&(e.x-=e.x+e.width-t.width),e.y=Math.max(e.y,0),e.y+e.height>t.height&&(e.y-=e.y+e.height-t.height);const a=In(e),l=rr(e,r);l.width=Math.max(o.width,l.width),l.height=Math.max(o.height,l.height),l.x=a.x-l.width*.5,l.y=a.y-l.height*.5,Kd(e,l)}},wT=(e,t,n,i,o,r,a,l)=>{const s=ir(a),c=ir(l),u=un(Math.max(t.width/c.width,t.height/c.height)),f=un(Math.min(t.width/s.width,t.height/s.height)),d=Rn(t);if(f<1||u>1){const m=In(e),g=In(t),p=f<1?f:u,y=(g.x+m.x)/2,w=(g.y+m.y)/2,_=d.width/p,P=d.height/p;py(d,y-_*.5,w-P*.5,_,P)}return r?(ST(d,n,i,o,s),{crop:d}):{crop:d}},Jm=(e,t,n)=>{const i=jo(e),o=In(i),r=Ro(i,n,o),a=In(Uu(Qi(r))),l=In(t),s=Go(l,-n,a),c=Fi(s,a),u=Or(xi(o,c),un);return Li(u.x-t.width*.5,u.y-t.height*.5,t.width,t.height)},Xn=(e,t,n)=>Math.max(t,Math.min(e,n)),_T=(e,t,n,i,o,r,a,l,s,c)=>{const u=ir(s),f=ir(c);a&&(f.width=Math.min(c.width,o.width),f.height=Math.min(c.height,o.height));let d=!1;const m=(y,w)=>{const _=Jm(o,i,y),P=jo(o),C=In(P),R=yy(P,r,C),I=Fi(Ut(C),M0(R)),M=Go(In(_),w,C),T=Fi(Ut(C),M);R.forEach(S=>Go(S,w,C));const v=Qi(R),H=M0(R),Y=xi(Fi(Fi(H,T),v),I),Z=Li(Y.x-_.width*.5,Y.y-_.height*.5,_.width,_.height);if(l&&Oo(Z,l.width/Z.width),a){const S=wS(o,w,r);SS(Z,S)}const W=un(Math.min(Z.width/u.width,Z.height/u.height),8),$=un(Math.max(Z.width/f.width,Z.height/f.height),8);return(W<1||$>1)&&un(Math.abs(w-y))===un(Math.PI/2)&&!d?(d=!0,m(e,e+Math.sign(w-y)*Math.PI)):{rotation:w,crop:qr(Z,S=>un(S,8))}},g=Math.sign(t)*Math.round(Math.abs(t)/Ha)*Ha,p=Xn(t,g+n[0],g+n[1]);return m(e,p)};const C1=["cropLimitToImage","cropMinSize","cropMaxSize","cropAspectRatio","flipX","flipY","rotation","crop","colorMatrix","convolutionMatrix","gamma","vignette","manipulation","redaction","annotation","decoration","selection","frame","backgroundColor","backgroundImage","backgroundFilterMode","targetSize","metadata","trim","volume","minDuration","maxDuration","currentTime"],sm=e=>Si(e)?e.map(sm):Om(e)||Ju(e)?e:ls(e)?{...e}:e,Cu=e=>e.map(t=>Object.entries(t).reduce((n,[i,o])=>(i.startsWith("_")||(n[i]=o),n),{}));
16var TT=(e,t,n)=>{const i=C1.map(s=>t[s]);let o=!1;const r=ht({}),{subscribe:a}=Ln([...i,r],(s,c)=>{if(o)return;const u=C1.reduce((f,d,m)=>(f[d]=sm(s[m]),f),{});u.crop&&qr(u.crop,Math.round),u.manipulation=u.manipulation&&Cu(u.manipulation),u.redaction=u.redaction&&Cu(u.redaction),u.annotation=u.annotation&&Cu(u.annotation),u.decoration=u.decoration&&Cu(u.decoration),u.selection=u.selection&&Cu(u.selection),c(u)}),l=s=>{s&&(o=!0,n.cropOrigin=void 0,C1.filter(c=>Rt(s,c)).forEach(c=>{const u=s[c];n[c]=u===null?void 0:sm(u)}),o=!1,r.set({}))};return{set:l,update:s=>l(s(null)),subscribe:a}},kT=e=>{if(e){if(/:/.test(e)){const[t,n]=e.split(":");return t/n}return parseFloat(e)}};const CT=(e,t)=>e===t;var Rl=(e,t,n=CT)=>{if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0},PT=(e=[0,0,0,0],t=1)=>e.length===4?e:[...e,t];const _S=(e,t,n)=>{const i=Or(In(e),u=>un(u,8)),o=jo(t),r=In(o),a=Ro(o,n,r),l=Or(Pc(Qi(a)),u=>un(u,8)),s=Math.abs(l.x-i.x),c=Math.abs(l.y-i.y);return s<1&&c<1},MT=(e,t,n)=>{const i=vc(t,n,ao(e));return qu(Ga(i,Math.round),Ga(ir(e),Math.round))},RT=e=>(t,n=t)=>{const{loadState:i,size:o,cropMinSize:r,cropMaxSize:a,cropLimitToImage:l,cropAspectRatio:s,rotation:c,perspective:u}=e;if(!t&&!n||!i||!i.beforeComplete)return t;t||(t=jo(vc(o,c,s||ao(o))));const f=wT(n,t,o,c,u,l,r,a),d=qr(f.crop,m=>un(m,8));return da(n,d)?n:d},IT=e=>(t,n)=>{const{loadState:i,crop:o,size:r,rotation:a,cropLimitToImage:l}=e,s=kT(t);if(!s)return;if(!o||!i||!i.beforeComplete)return s;const c=n?Math.abs(t-n):1;if(_S(o,r,a)&&l&&c>=.1){const u=Zw(ir(r),a);e.crop=qr(rr(jo(u),t),un)}else{const u={width:o.height*s,height:o.height},f=(o.width-u.width)*.5,d=(o.height-u.height)*.5;e.crop=qr(Li(o.x+f,o.y+d,u.width,u.height),un)}return s},ET=e=>(t,n,i)=>{const{crop:o}=e;return o&&!n&&t&&i(()=>e.crop=Rn(e.crop)),t},AT=e=>(t,n,i)=>{if(t===n)return t;const{loadState:o,size:r,rotationRange:a,cropMinSize:l,cropMaxSize:s,crop:c,perspective:u,cropLimitToImage:f,cropOrigin:d}=e;if(!c||!o||!o.beforeComplete)return t;const m=f&&MT(c,r,n),g=f&&_S(c,r,n),p=_T(n,t,a,c,r,u,f,d,l,s);if(m&&g){const y=vc(r,t,ao(p.crop));p.crop.x+=p.crop.width*.5,p.crop.y+=p.crop.height*.5,p.crop.x-=y.width*.5,p.crop.y-=y.height*.5,p.crop.width=y.width,p.crop.height=y.height}return i(()=>{e.crop=qr(p.crop,y=>un(y,8))}),p.rotation},LT=(e,t,n,i,o)=>{if(!o)return[-1/0,1/0];const r=Math.max(n.width/i.width,n.height/i.height),a=Ci(i.width*r,i.height*r),l=Xw(a),s=Math.min(e.width,e.height);if(l<s)return[-1/0,1/0];const c=t?e.height:e.width,u=t?e.width:e.height,f=Math.acos(a.height/l),d=Math.acos(u/l),m=Math.asin(c/l),g=f-d,p=m-f;if(Number.isNaN(g)&&Number.isNaN(p))return[-1/0,1/0];const y=Number.isNaN(g)?p:Number.isNaN(p)?g:Math.min(g,p);return[-y,y]},xT=(e,t,n,i,o,r)=>{const a=ir(i),l=ir(o);return r?[a,Ga(vc(e,t,n),Math.round)]:[a,l]},Lu=(e,t)=>{const{context:n,props:i}=t;return e._isFormatted||(e=jy(e),e._isFormatted=!0,Object.assign(e,i)),!e._isDraft&&qd(e)&&(!e._context||!da(n,e._context))&&(Yy(e,n),e._context={...n}),e},FT=(e,t)=>(e._isFormatted||(e.disableMove=!0,e.disableSelect=!0,e.disableResize=!0,e.disableRotate=!0),Lu(e,t)),vT=()=>e=>{if(!e)return;const t={frameStyle:void 0,x:0,y:0,width:"100%",height:"100%",disableStyle:["backgroundColor","strokeColor","strokeWidth"]};return Nt(e)?t.frameStyle=e:Object.assign(t,e),t};var Qm=[["file"],["size"],["loadState"],["processState"],["aspectRatio",ad(({size:e})=>[e,t=>t?ao(t):void 0])],["perspectiveX",Xr(()=>0)],["perspectiveY",Xr(()=>0)],["perspective",ad(({perspectiveX:e,perspectiveY:t})=>[[e,t],([n,i])=>({x:n,y:i})])],["rotation",Xr(()=>0),hc(AT)],["flipX",Xr(()=>!1)],["flipY",Xr(()=>!1)],["flip",ad(({flipX:e,flipY:t})=>[[e,t],([n,i])=>({x:n,y:i})])],["isRotatedSideways",ld(({rotation:e})=>[[e],([t],n)=>n(ol(t)),(t,n)=>t!==n])],["crop",hc(RT)],["cropAspectRatio",hc(IT)],["cropOrigin"],["cropMinSize",Xr(()=>({width:1,height:1}))],["cropMaxSize",Xr(()=>({width:32768,height:32768}))],["cropLimitToImage",Xr(()=>!0),hc(ET)],["cropSize",ld(({crop:e})=>[[e],([t],n)=>{t&&n(Ci(t.width,t.height))},(t,n)=>qu(t,n)])],["cropRectAspectRatio",ad(({cropSize:e})=>[[e],([t],n)=>{t&&n(un(ao(t),5))}])],["cropRange",ld(({size:e,rotation:t,cropRectAspectRatio:n,cropMinSize:i,cropMaxSize:o,cropLimitToImage:r})=>[[e,t,n,i,o,r],([a,l,s,c,u,f],d)=>
16{if(!a)return;const m=xT(a,l,s,c,u,f);d(m)},(a,l)=>Rl(a,l)])],["rotationRange",ld(({size:e,isRotatedSideways:t,cropMinSize:n,cropSize:i,cropLimitToImage:o})=>[[e,t,n,i,o],([r,a,l,s,c],u)=>{if(!r||!s)return;const f=LT(r,a,l,s,c);u(f)},(r,a)=>Rl(r,a)])],["backgroundColor",hc(()=>e=>PT(e))],["backgroundImage"],["backgroundFilterMode"],["targetSize"],["colorMatrix"],["convolutionMatrix"],["gamma"],["noise"],["vignette"],["duration"],["currentTime"],["minDuration",Xr(()=>1/24)],["maxDuration",Xr(()=>1/0)],["volume",Xr(()=>1)],["trim"],["redaction",ku(({size:e})=>[Lu,{context:e}])],["manipulation",ku(({size:e})=>[Lu,{context:e}])],["annotation",ku(({size:e})=>[Lu,{context:e}])],["decoration",ku(({crop:e})=>[Lu,{context:e}])],["selection",ku(({size:e})=>[FT,{context:e}])],["frame",hc(vT)],["metadata"],["state",bS(TT)]],a2=async(e,t,n={},i)=>{const{ontaskstart:o,ontaskprogress:r,ontaskend:a,token:l}=i;let s=!1;const c={cancel:st};l.cancel=()=>{s=!0,c.cancel()};for(const[u,f]of t.entries()){if(s)return;const[d,m]=f;o(u,m);try{e=await d(e,{...n,taskCancelToken:c},g=>r(u,m,g))}catch(g){throw s=!0,g}a(u,m)}return e},OT=({minSize:e={width:1,height:1},minDuration:t=0}={})=>{const{stores:n,accessors:i}=pS(Qm),{pub:o,sub:r}=Pl(),a=(c,u)=>{const f=()=>i[c]||{},d=p=>{i[c]={...f(),...p,timeStamp:Date.now()}},m=()=>f().error,g=p=>{m()||(d({error:p}),o(`${u}error`,{...f()}))};return{start(){o(`${u}start`)},onabort(){d({abort:!0}),o(`${u}abort`,{...f()})},ontaskstart(p,y){m()||(d({index:p,task:y,taskProgress:void 0,taskLengthComputable:void 0}),o(`${u}taskstart`,{...f()}))},ontaskprogress(p,y,w){m()||(d({index:p,task:y,taskProgress:w.loaded/w.total,taskLengthComputable:w.lengthComputable}),o(`${u}taskprogress`,{...f()}),o(`${u}progress`,{...f()}))},ontaskend(p,y){m()||(d({index:p,task:y}),o(`${u}taskend`,{...f()}))},ontaskerror(p){g(p)},error(p){g(p)},beforeComplete(p){m()||(d({beforeComplete:!0}),o(`before${u}`,p))},complete(p){m()||(d({complete:!0}),o(u,p))}}};return Qd(i,{read:(c,{reader:u},f={})=>{if(!u)return;Object.assign(i,{file:void 0,size:void 0,loadState:void 0});let d={cancel:st},m=!1;const g=a("loadState","load"),p={token:d,...g},y={src:c,size:void 0,dest:void 0,duration:void 0};return Promise.resolve().then(async()=>{try{if(g.start(),m)return g.onabort();const w=await a2(y,u,f,p);if(m)return g.onabort();const{size:_,duration:P,dest:C}=w||{};if(!_||!_.width||!_.height)throw new Du("Image size missing","IMAGE_SIZE_MISSING",w);if(P>0&&P<t)throw new Du("Video too short","VIDEO_TOO_SHORT",{...w,minDuration:t});if(_.width<e.width||_.height<e.height)throw new Du("Image too small","IMAGE_TOO_SMALL",{...w,minWidth:e.width,minHeight:e.height});Object.assign(i,{file:C,size:_,duration:P}),g.beforeComplete(w),g.complete(w)}catch(w){g.error(w)}finally{d=void 0}}),()=>{m=!0,d&&d.cancel(),g.onabort()}},write:(c,u)=>{if(!i.loadState.complete)return;i.processState=void 0;const f=a("processState","process"),d={src:i.file,imageState:i.state,dest:void 0};if(xn(c)&&(c=c(i.file,i.state)),!c){f.start(),f.complete(d);return}let m={cancel:st},g=!1;const p=u,y={token:m,...f};return Promise.resolve().then(async()=>{try{if(f.start(),g)return f.onabort();const w=await a2(d,c,p,y);if(g)return f.onabort();f.complete(w)}catch(w){f.error(w)}finally{m=void 0}}),()=>{g=!0,m&&m.cancel(),f.onabort()}},on:r}),{accessors:i,stores:n}};const TS=e=>console.warn(`Pintura: ${e} is a required prop.`),kS=["loadstart","loadabort","loaderror","loadprogress","load","processstart","processabort","processerror","processprogress","process"],DT=["flip","cropOrigin","isRotatedSideways","perspective","perspectiveX","perspectiveY","cropRange"],BT=Qm.map(([e])=>e).filter(e=>!DT.includes(e)),P1=e=>`image${yS(e)}`,zT=e=>Nt(e)||Rc(e)||Mc(e),l2=e=>Rt(e,"crop");var CS=()=>{const{stores:e,accessors:t}=pS(yT),{sub:n,pub:i}=Pl(),o=I=>M=>i(I,M),r=()=>t.images?t.images[0]:{};let a={};const l={};BT.forEach(I=>{Object.defineProperty(t,P1(I),{get:()=>{const M=r();if(M)return M.accessors[I]},set:M=>{a[P1(I)]=M,l[P1(I)]=M;const T=r();T&&(T.accessors[I]=M)}})});const s=()=>t.images&&t.images[0];let c;const u=e.src.subscribe(I=>{if(!I)return t.images=[];if(!t.imageReader){c=setTimeout(()=>TS("imageReader"),32);return}t.images.length&&(a={}),d(I)}),f=e.imageReader.subscribe(I=>{I&&(clearTimeout(c),!t.images.length&&t.src&&d(t.src))}),d=I=>{Promise.resolve().then(()=>p(I,a)).catch(()=>{})},m=(I,M)=>
16{if(l2(M)){t.imageState=M;return}if(!M.imageCrop){const H=I.accessors.size,Y=M.imageRotation||0,Z=gy(ir(H),Y),W=jo(Z);W.width=un(Math.abs(W.width),6),W.height=un(Math.abs(W.height),6);const $=M.imageCropAspectRatio||(M.imageCropLimitToImage?ao(H):ao(W));let S;M.imageCropLimitToImage?S=rr(W,$):(S=rs(W,$),S.x=(H.width-S.width)/2,S.y=(H.height-S.height)/2),M.imageCrop=S}if(I.accessors.duration&&!M.imageTrim&&M.imageMaxDuration){const{duration:H}=I.accessors;M.imageTrim=[[0,Math.min(M.imageMaxDuration/H,1)]]}const T=["imageCropLimitToImage","imageCrop","imageCropAspectRatio","imageRotation"];T.filter(H=>Rt(M,H)).forEach(H=>{t[H]=M[H],delete M[H]});const v=Object.keys(M).filter(H=>!T.includes(H)).reduce((H,Y)=>(H[Y]=M[Y],H),{});Object.assign(t,v)};let g;const p=(I,M={})=>new Promise((T,v)=>{let H=s();const Y=!(M.cropLimitToImage===!1||M.imageCropLimitToImage===!1||l.imageCropLmitedToImage===!1),Z=M.cropMinSize||M.imageCropMinSize||l.imageCropMinSize,W=Y?Z:H&&H.accessors.cropMinSize,$=M.minDuration||M.imageMinDuration;H&&R(),H=OT({minSize:W,minDuration:$}),kS.map(ge=>H.accessors.on(ge,o(ge)));const S=()=>{a={},pe.forEach(ge=>ge())},pe=[];pe.push(H.accessors.on("loaderror",ge=>{S(),v(ge)})),pe.push(H.accessors.on("loadabort",()=>{S(),v({name:"AbortError"})})),pe.push(H.accessors.on("load",ge=>{g=void 0,S(),T(ge)})),pe.push(H.accessors.on("beforeload",()=>m(H,M))),t.images=[H],M.imageReader&&(t.imageReader=M.imageReader),M.imageWriter&&(t.imageWriter=M.imageWriter),g=H.accessors.read(I,{reader:t.imageReader},{willRequest:t.willRequest})});let y;const w=(I,M)=>new Promise((T,v)=>{try{const H=[],Y=()=>{H.forEach(Z=>Z())};(async()=>{if(zT(I))try{await p(I,M)}catch(W){v(W)}else I&&(l2(I)?t.imageState=I:Object.assign(t,I));const Z=s();if(!Z)return v("no image");H.push(Z.accessors.on("processerror",W=>{Y(),v(W)})),H.push(Z.accessors.on("processabort",()=>{Y(),v({name:"AbortError"})})),H.push(Z.accessors.on("process",W=>{y=void 0,Y(),T(W)})),y=Z.accessors.write(t.imageWriter,{redactionRenderStyle:t.imageRedactionRendering,shapePreprocessor:t.shapePreprocessor||Nn,imageScrambler:t.imageScrambler,willRequest:t.willRequest,csp:t.csp||{},willRequestResource:t.willRequestResource})})()}catch(H){v(H)}}),_=()=>{const I=s();I&&(y&&y(),I.accessors.processState=void 0)},P=()=>{g&&g(),t.images=[]},C=(I,M)=>new Promise((T,v)=>{p(I,M).then(()=>{const{images:H}=t,Y=H[0],Z=()=>{W(),$()},W=Y.accessors.on("processerror",S=>{Z(),v(S)}),$=Y.accessors.on("process",S=>{Z(),T(S)})}).catch(v)}),R=()=>{const I=s();I&&(g&&g(),I.accessors.loadState=void 0,t.images=[])};return Object.defineProperty(t,"stores",{get:()=>e}),Qd(t,{on:n,loadImage:p,abortLoadImage:P,editImage:C,removeImage:R,processImage:w,abortProcessImage:_,destroy:()=>{u&&u(),f&&f()}}),t};const VT=(e,t)=>{const{processImage:n}=CS();return n(e,t)};var PS=()=>Za()?ya()?/15_|16_/.test(navigator.userAgent)?3840*3840:4096*4096:/15_/.test(navigator.userAgent)?4096*4096:1/0:1/0,MS=(e,t)=>Object.keys(e).filter(n=>!t.includes(n)).reduce((n,i)=>(n[i]=e[i],n),{}),RS=e=>new Promise(t=>{if(e.duration===1/0){e.ontimeupdate=()=>{e.ontimeupdate=void 0,t(e)},e.currentTime=Number.MAX_SAFE_INTEGER;return}t(e)}),WT=e=>new Promise((t,n)=>{const i=()=>{RS(e).then(()=>{t(e.duration)})};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=()=>n(e.error)}),UT=async e=>{const t=await HT(e),n=new DataView(t);return KT(n)};const HT=e=>new Promise(t=>{const n=new FileReader;n.onload=()=>t(n.result),n.readAsArrayBuffer(e)}),NT=(e,t,n)=>{let r=!1,a=-1;for(let f=t;f<n;f++){if(!r&&e.getUint32(f)===1953653099&&(r=!0,f+=4),!r)continue;if(e.getUint8(f)==64){a=f;break}}if(a<0)return 0;const l=e.getUint32(a-28),s=e.getUint32(a-20),c=e.getUint32(a-32),u=e.getUint32(a-16);return l===65536&&s===4294901760?90:c===4294901760&&u===4294901760?180:l===4294901760&&s===65536?270:0},GT=1836019574,s2=1836476516,jT=1953196132,ZT=1953653099,M1=(e,t=0,n=e.byteLength)=>{const i=[],o=t+n;for(;t<o;){const r=e.getUint32(t);if(r<0)break;const a=e.getUint32(t+4);if(i.push({type:a,size:r,offset:t,bodyOffset:t+8,bodySize:r-8}),r<8)break;t+=r}return i},XT=e=>{const n=M1(e).find(a=>a.type===GT);if(!n)return 0;const i=M1(e,n.bodyOffset,n.bodySize);i.filter(a=>a.type===ZT).forEach(a=>{i.push(...M1(e,a.bodyOffset,a.bodySize))});const o=[s2,jT],r=i.filter(a=>o.includes(a.type));for(const{type:a,bodyOffset:l}of r){const s=e.getUint8(l);let c=l+4;c+=a===s2?32:36,c+=s===1?12:0;const u=e.getInt32(c),f=e.getInt32(c+4);if(u===0&&f>0)return 90;if(u<0&&f===0)return 180;if(u===0&&f<0)return 270}return 0},KT=(e,{limit:t=1024}={})=>{let r=0;if(r+=4,e.getUint32(r)!==1718909296)return 0;r+=4;const l=e.getUint32(r);return l===1836069938?NT(e,r,t):l===1903435808?XT(e):0};var IS=e=>new Promise((t,n)=>{(ja()?UT(e):Promise.resolve(0)).then(o=>{const r=document.createElement("video");r.onerror=()=>
16n(r.error),r.playsInline=!0,r.preload="auto",r.onseeked=()=>{r.onseeked=void 0,t(r)},r.onloadeddata=()=>{r.onloadeddata=void 0,r.dataset.rotation=o?`${o}`:"0",RS(r).then(t),r.currentTime=0},ya()&&Za()?(r.srcObject=e,r.load()):r.src=URL.createObjectURL(e)})}),ES=(e,t)=>new Promise(n=>{if(e.currentTime===t)return n(e);let i=e.onseeked;e.onseeked=()=>{e.onseeked=i,n(e)},e.currentTime=Xn(t,0,e.duration)}),AS=(e,t=0)=>new Promise((n,i)=>{IS(e).then(o=>{ES(o,t).then(r=>{const a=ci("canvas");Py(r).then(({width:l,height:s})=>{a.width=l,a.height=s;const c=a.getContext("2d",{willReadFrequently:!0}),u=()=>{c.drawImage(r,0,0,a.width,a.height);const f=c.getImageData(0,0,a.width,a.height);Wi(a),URL.revokeObjectURL(r.src),n(f)};Za()?setTimeout(u,16):u()})})})}),as=e=>/video/.test(e.type);let R1=null;var YT=()=>(R1===null&&(R1=new ImageData(1,1).colorSpace!==void 0),R1);const $m=({imageDataResizer:e,canvasMemoryLimit:t}={})=>async(n,i,o,r,a)=>{o.width=Math.max(o.width,1),o.height=Math.max(o.height,1),r.width=Math.max(r.width,1),r.height=Math.max(r.height,1);const{dest:l}=await VT(i,{imageReader:DS(),imageWriter:BS({format:"canvas",targetSize:{...r,upscale:!0},imageDataResizer:e,canvasMemoryLimit:t}),imageCrop:o}),{feather:s=0}=a||{};if(s>0){const c=ci("canvas");c.width=l.width,c.height=l.height;const u=c.getContext("2d",{willReadFrequently:!0}),f=1/s;let d=0;for(d=0;d<s;d++){const g=d*f;u.strokeStyle=`rgba(0,0,0,${g*g})`,u.strokeRect(d+.5,d+.5,l.width-d*2-1,l.height-d*2-1)}u.fillStyle="#000",u.fillRect(d,d,l.width+.5-d*2,l.height+.5-d*2);const m=l.getContext("2d");m.globalCompositeOperation="destination-in",m.drawImage(c,0,0),Wi(c)}n.drawImage(l,r.x,r.y,r.width,r.height),Wi(l)},Pi=(e,t=(...i)=>i,n)=>async(i,o,r)=>{r(bc(0,!1));let a=!1;const l=await e(...t(i,o,s=>{a=!0,r(s)}));return n&&n(i,l),a||r(bc(1,!1)),i},qT=({willRequest:e=void 0,srcProp:t="src",destProp:n="dest"}={})=>[Pi(T5,(i,o,r)=>[i[t],r,{...o,willRequest:e}],(i,o)=>i[n]=o),"any-to-file"],JT=({srcProp:e="dest",destProp:t="dest"}={})=>[Pi(async n=>{if(/octet-stream/.test(n.type)){console.warn(`Pintura: File has unknown mime type "${n.type}", make sure your server sets the correct Content-Type header.`);let i="image";const o=await vm(n);/video/i.test(o.nodeName)&&(i="video");const r={type:i+"/unknown"};return Ju(n)?new File([n],n.name,{...r,lastModified:n.lastModified}):new Blob([n],r)}return n},n=>[n[e]],(n,i)=>n[t]=i),"guard-mimetype"],LS=({srcProp:e="src",destProp:t="size"}={})=>[Pi(My,n=>[n[e]],(n,i)=>n[t]=i),"read-image-size"],QT=async e=>{const t=await vm(e);if(Fd(t))return await WT(t)},$T=({srcProp:e="src",destProp:t="duration"}={})=>[Pi(QT,n=>[n[e]],(n,i)=>n[t]=i),"read-media-duration"],xS=({srcSize:e="size",srcOrientation:t="orientation",destSize:n="size"}={})=>[Pi(k5,i=>[i[e],i[t]],(i,o)=>i[n]=o),"image-size-match-orientation"],FS=({srcProp:e="src",destProp:t="copy"}={})=>[Pi((n,i)=>Ey(n)?Pm(n,i):void 0,n=>[n[e],onprogress],(n,i)=>{i&&(n[t]=i)}),"read-image-head"],vS=({srcProp:e="copy",orientationProp:t="orientation",colorSpaceProp:n="colorSpace"}={})=>[Pi((i,o)=>{if(i)return iy(i,o)},i=>[i[e],{exif:[Vu],app2:[J1]}],(i,o)=>{o&&(i[t]=o.exif&&o.exif[Vu]||1,i[n]=(o.app2&&o.app2[J1]||"sRGB").toLowerCase())}),"read-image-head-tags"],ek=({srcProp:e="copy"}={})=>[Pi((t,n)=>{if(t)return ww(t,n)},t=>[t[e],{exif:[[Vu,1]]}]),"clear-exif-orientation-tag"],tk=({srcImageSize:e="size",srcCanvasSize:t="imageData",srcImageState:n="imageState",destImageSize:i="size",destScalar:o="scalar"}={})=>[Pi((r,a)=>[Math.min(a.width/r.width,a.height/r.height),sl(a)],r=>[r[e],r[t],r[n]],(r,[a,l])=>{r[o]=a,r[i]=l}),"calculate-canvas-scalar"],nk=({srcProp:e="src",destProp:t="imageData",canvasMemoryLimit:n=void 0,colorSpaceProp:i="colorSpace",srcImageState:o="imageState"}={})=>[Pi((r,a,l,s)=>as(r)?AS(r,s.currentTime):fy(r,{canvasMemoryLimit:a,colorSpace:l}),r=>[r[e],n,r[i],r[o]],(r,a)=>r[t]=a),"blob-to-image-data"],ik=({srcImageData:e="imageData",srcOrientation:t="orientation"}={})=>[Pi(ay,n=>[n[e],n[t]],(n,i)=>n.imageData=i),"image-data-match-orientation"],ok=({srcImageData:e="imageData",srcImageState:t="imageState"}={})=>[Pi(j_,n=>{const{colorMatrix:i}=n[t],o=i&&Object.keys(i).map(r=>
16i[r]).filter(Boolean);return[n[e],{backgroundColor:n[t].backgroundColor,backgroundImage:n[t].backgroundImage,backgroundFilterMode:n[t].backgroundFilterMode,colorMatrix:o&&Jd(o),convolutionMatrix:n[t].convolutionMatrix,gamma:n[t].gamma,noise:n[t].noise,vignette:n[t].vignette}]},(n,i)=>n.imageData=i),"image-data-fill"],rk=({srcImageData:e="imageData",srcImageState:t="imageState",destScalar:n="scalar"}={})=>[Pi(I5,i=>{const o=i[n];let{crop:r}=i[t];return r&&o!==1&&(r=Oo(Rn(r),o,Kn())),[i[e],{crop:r,rotation:i[t].rotation,flipX:i[t].flipX,flipY:i[t].flipY}]},(i,o)=>i.imageData=o),"image-data-crop"],ak=e=>!!(e.targetSize&&e.targetSize.width||e.targetSize&&e.targetSize.height),lk=({targetSize:e={width:void 0,height:void 0,fit:void 0,upscale:void 0},imageDataResizer:t=void 0,srcProp:n="imageData",srcImageState:i="imageState",destImageScaledSize:o="imageScaledSize"})=>[Pi(A5,r=>{const a=Math.min(e.width||Number.MAX_SAFE_INTEGER,r[i].targetSize&&r[i].targetSize.width||Number.MAX_SAFE_INTEGER),l=Math.min(e.height||Number.MAX_SAFE_INTEGER,r[i].targetSize&&r[i].targetSize.height||Number.MAX_SAFE_INTEGER);return[r[n],{width:a,height:l,fit:e.fit||"contain",upscale:ak(r[i])?!0:e.upscale||!1},t]},(r,a)=>{qu(r.imageData,a)||(r[o]=sl(a)),r.imageData=a}),"image-data-resize"],sk=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:n="imageData"}={})=>[Pi(xy,i=>{const{colorMatrix:o}=i[t],r=o&&Object.keys(o).map(a=>o[a]).filter(Boolean);return[i[e],{colorMatrix:r&&Jd(r),convolutionMatrix:i[t].convolutionMatrix,gamma:i[t].gamma,noise:i[t].noise,vignette:i[t].vignette}]},(i,o)=>i[n]=o),"image-data-filter"],ck=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:n="imageData",destScalar:i="scalar"}={})=>[Pi(async(o,r,a,l,s,c)=>{if(!r||!l.length)return o;let u;try{const p={dataSizeScalar:tS(o,l)};a&&a[3]>0&&(p.backgroundColor=[...a]),u=await r(o,p)}catch{}const f=ci("canvas");f.width=o.width,f.height=o.height;const d=f.getContext("2d",{willReadFrequently:!0,colorSpace:o.colorSpace});if(d.putImageData(o,0,0),c==="auto"){const p=Math.sqrt(o.width*o.height);d.filter=`blur(${Math.round(p/100)}px)`}const m=new Path2D;l.forEach(p=>{const y=Li(p.x,p.y,p.width,p.height);Ds(y,s);const w=Ro(Rn(y),p.rotation),_=new Path2D;w.forEach((P,C)=>{if(C===0)return _.moveTo(P.x,P.y);_.lineTo(P.x,P.y)}),m.addPath(_)}),d.clip(m,"nonzero"),d.imageSmoothingEnabled=!1,d.drawImage(u,0,0,f.width,f.height),Wi(u);const g=d.getImageData(0,0,f.width,f.height);return Wi(f),g},(o,{imageScrambler:r,redactionRenderStyle:a})=>[o[e],r,o[t].backgroundColor,o[t].redaction,o[i],a],(o,r)=>o[n]=r),"image-data-redact"],I1=({srcImageData:e="imageData",srcSize:t="size",srcImageState:n="imageState",srcShapes:i="annotation",destImageData:o="imageData",destImageScaledSize:r="imageScaledSize",destScalar:a="scalar",imageDataResizer:l=void 0,canvasMemoryLimit:s=void 0,shapeFilter:c=Nn,shapeClip:u=!0,destImageContext:f="imageContext"}={})=>[Pi(Xm,(d,{shapePreprocessor:m,willRequestResource:g,csp:p,willRequest:y})=>{const w=d[n][i].filter(c);if(!w.length)return[d[e]];const _=d[a],{crop:P}=d[n],C=d[t];let R=_;const I=d[r];I&&(R=Math.min(I.width/P.width,I.height/P.height));const M={width:C.width/_,height:C.height/_};return[d[e],{shapes:w,computeShape:T=>(T=Ii(T,M),T=MS(T,["left","right","top","bottom"]),T=qy(T,R),T),transform:T=>{const v=d[t],{rotation:H=0,flipX:Y,flipY:Z,cropLimitToImage:W}=d[n],{crop:$=jo(v)}=d[n],S=d[r];let pe=1;S?pe=R:pe=_;const ge={width:v.width/_*pe,height:v.height/_*pe},de=f5(ge,H),Fe={width:de.width,height:de.height},X=ge.width*.5-Fe.width*.5,U=ge.height*.5-Fe.height*.5,ae=Pc(ge);T.translate(-X,-U),T.translate(-$.x*pe,-$.y*pe),T.translate(ae.x,ae.y),T.rotate(H),T.translate(-ae.x,-ae.y);const be=d[f]||{x:0,y:0};T.translate(be.x,be.y),T.scale(Y?-1:1,Z?-1:1),T.translate(Y?-ge.width*_:0,Z?-ge.height*_:0),W&&u&&(T.rect(0,0,ge.width,ge.height),T.clip())},drawImage:$m({imageDataResizer:l,canvasMemoryLimit:s}),preprocessShape:T=>m(T,{isPreview:!1,...d[n]}),canvasMemoryLimit:s,willRequest:y||g,styleNonce:p.styleNonce}]},(d,m)=>d[o]=m),"image-data-annotate"],c2=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:n="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:o=void 0,canvasMemoryLimit:r=void 0,destScalar:a="scalar",shapeFilter:l=Nn,destImageContext:s="imageContext"}={})=>[Pi(Xm,(c,{shapePreprocessor:u,willRequestResource:f,willRequest:d,csp:m})=>{let g=c[t].decoration.filter(l);if(!g.length)return[c[e]];let p=c[a];const{crop:y}=c[t],w=c[i];return w&&(p=Math.min(w.width/y.width,w.height/y.height)),[c[e],{shapes:g,drawImage:$m({imageDataResizer:o,canvasMemoryLimit:r}),computeShape:_=>(_=Ii(_,y),_=MS(_,["left","right","top","bottom"]),_=qy(_,p),_),preprocessShape:_=>u(_,{isPreview:!1,...c[t]}),canvasMemoryLimit:r,willRequest:d||f,styleNonce:m.styleNonce,transform:_=>{const P=c[s]||{x:0,y:0};_.translate(P.x,P.y)}}]},(c,u)=>c[n]=u),"image-data-decorate"],uk=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:n="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:o=void 0,canvasMemoryLimit:r=void 0,destScalar:a="scalar",destImageContext:l="imageContext"}={})=>[Pi((s,c)=>new Promise(u=>{if(!c)return u([s]);Xm(s,c).then(f=>{u([f,c.contextBounds])})}),(s,{shapePreprocessor:c,willRequestResource:u,willRequest:f,csp:d})=>{const m=s[t].frame;if(!m)return[s[e]];const g=s[a];let{crop:p}=s[t];p&&g!==1&&(p=Oo(Rn(p),g,Kn()));const y={...p},w=Xy(Ky(m,y,c),y);y.x=Math.abs(w.left),y.y=Math.abs(w.top),y.width+=Math.abs(w.left)+Math.abs(w.right),y.height+=Math.abs(w.top)+Math.abs(w.bottom);const _=s[i],P=_?_.width/p.width:1,C=_?_.height/p.height:1;return y.x*=P,y.y*=C,y.width*=P,y.height*=C,y.x=Math.round(y.x),y.y=Math.round(y.y),y.width=Math.round(y.width),y.height=Math.round(y.height),_&&(Math.abs(y.width-_.width)<=1&&(y.width=_.width),Math.abs(y.height-_.height)<=1&&(y.height=_.height)),[s[e],{shapes:[m],contextBounds:y,computeShape:R=>Ii(R,s[e]),transform:R=>{R.translate(y.x,y.y)},drawImage:$m({imageDataResizer:o,canvasMemoryLimit:r}),preprocessShape:R=>c(R,{isPreview:!1,...s[t]}
16),canvasMemoryLimit:r,willRequest:f||u,styleNonce:d.styleNonce}]},(s,[c,u])=>{s[l]=u,s[n]=c}),"image-data-frame"],fk=({mimeType:e=void 0,quality:t=void 0,srcImageData:n="imageData",srcFile:i="src",destBlob:o="blob"}={})=>[Pi(Lw,r=>[r[n],e||Im(r[i].name)||r[i].type,t],(r,a)=>r[o]=a),"image-data-to-blob"],dk=({srcImageData:e="imageData",srcOrientation:t="orientation",destCanvas:n="dest"}={})=>[Pi(Vs,i=>[i[e],i[t]],(i,o)=>i[n]=o),"image-data-to-canvas"],hk=async(e,t,n)=>{if(!Ey(e)||!t)return e;const i=/p3/i.test(n),o=(u,f)=>{let d=2;const m=new DataView(u),g=m.byteLength;for(f(m.getUint8(0),0,2,g);d<g&&m.getUint8(d)==255;){const p=m.getUint8(d+1),y=m.getUint16(d+2)+2;if(f(p,d,y,g)===!1)break;d+=y}},r=u=>u>=224&&u<=237,a=u=>{const f=[];return o(u,(d,m,g)=>{if(d===218)return!1;if(r(d)){if(d===226&&(!i||!YT()))return!1;f.push(new Uint8Array(u,m,g))}}),f},l=(u,f)=>{const d=[];o(u,(y,w,_,P)=>{if(w===0){d.push(new Uint8Array(u,w,_)),d.push(...f);return}if(y===218)return d.push(new Uint8Array(u,w,P-w)),!1;r(y)||d.push(new Uint8Array(u,w,_))});let m=d.reduce((y,w)=>y+w.length,0),g=new Uint8Array(m),p=0;return d.forEach(y=>{g.set(y,p),p+=y.length}),g},s=a(t),c=l(await Pm(e),s);return new Blob([c],{type:"image/jpeg"})},mk=(e="blob",t="copy",n="colorSpace",i="blob")=>[Pi((o,r,a)=>{if(r)return hk(o,r,a)},o=>[o[e],o[t],o[n]],(o,r)=>{r&&(o[i]=r)}),"blob-write-image-head"],gk=({renameFile:e=void 0,srcBlob:t="blob",srcFile:n="src",destFile:i="dest",defaultFilename:o=void 0}={})=>[Pi(Yu,r=>[r[t],e?e(r[n]):r[n].name||`${o}.${dy(r[t].type)}`],(r,a)=>r[i]=a),"blob-to-file"],u2=({url:e="./",dataset:t=r=>[["dest",r.dest,r.dest.name],["imageState",r.imageState]],destStore:n="store",credentials:i,headers:o={}})=>[Pi(async(r,a)=>await M5(e,r,{onprogress:a,beforeSend:l=>Ry(l,{headers:o,credentials:i})}),(r,a,l)=>[t(r),l],(r,a)=>r[n]=a),"store"],OS=e=>[Pi(t=>(!e||!e.length||Object.keys(t).forEach(n=>{e.includes(n)||delete t[n]}),t)),"prop-filter"],DS=(e={})=>{const{orientImage:t=!0,outputProps:n=["src","dest","size","duration"],preprocessImageFile:i,request:o={}}=e;return[qT({willRequest:()=>o}),JT(),i&&[Pi(i,(r,a,l)=>[r.dest,a,l],(r,a)=>r.dest=a),"preprocess-image-file"],LS({srcProp:"dest"}),$T({srcProp:"dest"}),t&&FS({srcProp:"dest"}),t&&vS(),t&&xS(),OS(n)].filter(Boolean)},bk=e=>e&&(Nt(e)?u2({url:e}):xn(e)?[e,"store"]:u2(e)),BS=(e={})=>(t,n,i={})=>{let{canvasMemoryLimit:o=PS(),orientImage:r=!0,copyImageHead:a=!0,mimeType:l=void 0,quality:s=void 0,renameFile:c=void 0,targetSize:u=void 0,imageDataResizer:f=void 0,store:d=void 0,format:m="file",outputProps:g=["src","dest","imageState","store"],preprocessImageSource:p=void 0,preprocessImageState:y=void 0,postprocessImageData:w=void 0,postprocessImageBlob:_=void 0,testSrcSupport:P=!1}={...e,...i};if(!(P&&!Qu(t)))return m==="blob"&&(m="file"),[p&&[Pi(p,(C,R,I)=>[C.src,R,I,C.imageState],(C,R)=>C.src=R),"preprocess-image-source"],(r||a)&&FS(),vS(),LS(),y&&[Pi(y,(C,R,I,M)=>[C.imageState,R,I,{size:C.size,orientation:C.orientation}],(C,R)=>C.imageState=R),"preprocess-image-state"],nk({canvasMemoryLimit:o}),r&&xS(),r&&ik(),tk(),ck(),rk(),lk({imageDataResizer:f,targetSize:u}),I1({imageDataResizer:f,canvasMemoryLimit:o,srcShapes:"manipulation"}),sk(),ok(),I1({imageDataResizer:f,canvasMemoryLimit:o,srcShapes:"annotation",shapeFilter:C=>!C.aboveFrame}),c2({imageDataResizer:f,canvasMemoryLimit:o,shapeFilter:C=>!C.aboveFrame}),uk({imageDataResizer:f,canvasMemoryLimit:o}),I1({imageDataResizer:f,canvasMemoryLimit:o,srcShapes:"annotation",shapeFilter:C=>C.aboveFrame,shapeClip:!1}),c2({imageDataResizer:f,canvasMemoryLimit:o,shapeFilter:C=>C.aboveFrame}),w&&[Pi(w,(C,R,I)=>[C.imageData,R,I],(C,R)=>C.imageData=R),"postprocess-image-data"],m==="file"?fk({mimeType:l,quality:s}):m==="canvas"?dk():[C=>(C.dest=C.imageData,C)],m==="file"&&r&&ek(),m==="file"&&a&&mk(),_&&[Pi(_,({blob:C,imageData:R,src:I},M,T)=>[{blob:C,imageData:R,src:I},M,T],(C,R)=>C.blob=R),"postprocess-image-file"],m==="file"&&gk({defaultFilename:"image",renameFile:c}),m==="file"?bk(d):xn(d)&&[d,"store"],OS(g)].filter(Boolean)};var pk=(e,t,n,i,o,r,a,l,s,c,u)=>{if(!e||!t||!n||!i||!l)return;l*=r;const f=Uu(Rn(t)),d=In(f),m=In(e),g=jo(n),p=In(g),y=Jm(n,i,s),w=In(y),_=Fi(Ut(p),w),P=Fi(Ut(m),d);_.x+=P.x,_.y+=P.y;const C=Sc(Ut(_));C.x+=P.x,C.y+=P.y;const R=In(ua(ua(Rn(o),a),e)),I=Fi(R,m);return xi(_,I),{origin:C,translation:_,rotation:{x:u?Math.PI:0,y:c?Math.PI:0,z:s},scale:l}};let Pu=null;var eg=()=>{if(Pu===null)if("WebGL2RenderingContext"in window){let e;try{e=ci("canvas"),Pu=!!e.getContext("webgl2")}catch{Pu=!1}e&&Wi(e),e=void 0}else Pu=!1;return Pu},f2=e=>(e&e-1)===0,Jl=(e,t={},n="",i="")=>Object.keys(t).filter(o=>!ls(t[o])).reduce((o,r)=>o.replace(new RegExp(n+r+i),t[r]),e),yk=`#version 300 es
17precision highp float;
18
19out vec4 fragColor;`,Sk=`
20float a=1.0;vec4 fillColor=uColor;vec4 textureColor=texture(uTexture,vTexCoord);textureColor*=(1.0-step(uRepeat.y,vTexCoord.y))*step(0.0,vTexCoord.y)*(1.0-step(uRepeat.x,vTexCoord.x))*step(0.0,vTexCoord.x);`,wk=`
21uniform float uMaskFeather[8];uniform float uMaskBounds[4];uniform float uMaskOpacity;float mask(float x,float y,float bounds[4],float opacity){return 1.0-(1.0-(smoothstep(bounds[3],bounds[3]+1.0,x)*(1.0-smoothstep(bounds[1]-1.0,bounds[1],x))*(1.0-step(bounds[0],y))*step(bounds[2],y)))*(1.0-opacity);}`,_k=`
22float m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);`,Tk=`
23float leftFeatherOpacity=step(uMaskFeather[1],gl_FragCoord.x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],gl_FragCoord.x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],gl_FragCoord.x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],gl_FragCoord.x));a*=leftFeatherOpacity*rightFeatherOpacity;`,kk=`
24vec2 scaledPoint=vec2(vRectCoord.x*uSize.x,vRectCoord.y*uSize.y);a*=smoothstep(0.0,uEdgeFeather,uSize.x-scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,uSize.y-scaledPoint.y);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.y);`,Ck=`
25vec2 s=(uSize-2.0)*.5;vec2 r=(vRectCoord*uSize)-1.0;vec2 p=r-s;float cornerRadius=uCornerRadius[0];bool left=r.x<s.x;bool top=r.y<s.y;if(!left&&top){cornerRadius=uCornerRadius[1];}if(!left&&!top){cornerRadius=uCornerRadius[3];}if(left&&!top){cornerRadius=uCornerRadius[2];}a*=1.0-clamp(length(max(abs(p)-(s-cornerRadius),0.0))-cornerRadius,0.0,1.0);`,Pk=`
26if(m<=0.0)discard;fillColor.a*=a;fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);textureColor*=uTextureOpacity;textureColor.a*=a;textureColor.rgb*=m*a;textureColor.rgb+=(1.0-m)*(uCanvasColor.rgb*textureColor.a);fragColor=textureColor+(fillColor*(1.0-textureColor.a));`,Mk=`
27if(uTextureColor.a!=0.0&&textureColor.a>0.0){vec3 colorFlattened=textureColor.rgb/textureColor.a;if(colorFlattened.r>=.9999&&colorFlattened.g==0.0&&colorFlattened.b>=.9999){textureColor.rgb=uTextureColor.rgb*textureColor.a;}textureColor*=uTextureColor.a;}`,Rk=`#version 300 es
28
29in vec4 aPosition;uniform mat4 uMatrix;`,Ik=`
30gl_Position=uMatrix*vec4(aPosition.x,aPosition.y,0,1);`,Ek=`
31in vec2 aTexCoord;out vec2 vTexCoord;`;const Ak={head:Rk,text:Ek,matrix:Ik},Lk={head:yk,mask:wk,init:Sk,colorize:Mk,maskapply:_k,maskfeatherapply:Tk,rectaa:kk,cornerradius:Ck,fragcolor:Pk},xk=(e,t,n)=>(t=Jl(t,n===e.VERTEX_SHADER?Ak:Lk,"##").trim(),eg()?t:(t=t.replace(/#version.+/gm,"").trim(),t=t.replace(/^\/\/\#/gm,"#"),n===e.VERTEX_SHADER&&(t=t.replace(/in /gm,"attribute ").replace(/out /g,"varying ")),n===e.FRAGMENT_SHADER&&(t=t.replace(/in /gm,"varying ").replace(/out.*?;/gm,"").replace(/texture\(/g,"texture2D(").replace(/fragColor/g,"gl_FragColor")),`${t}
31`)),d2=(e,t,n)=>{const i=e.createShader(n),o=xk(e,t,n);return e.shaderSource(i,o),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||console.error(e.getShaderInfoLog(i)),i},Mu=(e,t,n,i,o)=>{const r=d2(e,t,e.VERTEX_SHADER),a=d2(e,n,e.FRAGMENT_SHADER),l=e.createProgram();e.attachShader(l,r),e.attachShader(l,a),e.linkProgram(l);const s={};return i.forEach(c=>{s[c]=e.getAttribLocation(l,c)}),o.forEach(c=>{s[c]=e.getUniformLocation(l,c)}),{program:l,locations:s,destroy(){e.detachShader(l,r),e.detachShader(l,a),e.deleteShader(r),e.deleteShader(a),e.deleteProgram(l)}}},h2=e=>e.nodeName==="VIDEO"?!1:eg()?!0:f2(e.width)&&f2(e.height),Fk=(e,t,n)=>{e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,h2(t)?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n.filterParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,n.wrapParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,n.wrapParam),h2(t)&&e.generateMipmap(e.TEXTURE_2D)},vk=(e,t,n,i)=>{const{premultiply:o=!0}=i;return e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,o),e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),Fk(e,n,i),e.bindTexture(e.TEXTURE_2D,null),t},Is=(e,t=1)=>e?[e[0],e[1],e[2],Ht(e[3])?t*e[3]:t]:[0,0,0,0],E1=()=>{const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},Ok=(e,t,n,i,o)=>{const r=1/Math.tan(t/2),a=1/(i-o);e[0]=r/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(o+i)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*o*i*a,e[15]=0},A1=(e,t,n,i,o,r,a)=>{const l=1/(t-n),s=1/(i-o),c=1/(r-a);e[0]=-2*l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*l,e[13]=(o+i)*s,e[14]=(a+r)*c,e[15]=1},Es=(e,t,n,i)=>{e[12]=e[0]*t+e[4]*n+e[8]*i+e[12],e[13]=e[1]*t+e[5]*n+e[9]*i+e[13],e[14]=e[2]*t+e[6]*n+e[10]*i+e[14],e[15]=e[3]*t+e[7]*n+e[11]*i+e[15]},m2=(e,t)=>{e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t,e[8]*=t,e[9]*=t,e[10]*=t,e[11]*=t},Dk=(e,t)=>{e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t},Bk=(e,t)=>{e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t},g2=(e,t)=>{const n=Math.sin(t),i=Math.cos(t),o=e[4],r=e[5],a=e[6],l=e[7],s=e[8],c=e[9],u=e[10],f=e[11];e[4]=o*i+s*n,e[5]=r*i+c*n,e[6]=a*i+u*n,e[7]=l*i+f*n,e[8]=s*i-o*n,e[9]=c*i-r*n,e[10]=u*i-a*n,e[11]=f*i-l*n},b2=(e,t)=>{const n=Math.sin(t),i=Math.cos(t),o=e[0],r=e[1],a=e[2],l=e[3],s=e[8],c=e[9],u=e[10],f=e[11];e[0]=o*i-s*n,e[1]=r*i-c*n,e[2]=a*i-u*n,e[3]=l*i-f*n,e[8]=o*n+s*i,e[9]=r*n+c*i,e[10]=a*n+u*i,e[11]=l*n+f*i},p2=(e,t)=>{const n=Math.sin(t),i=Math.cos(t),o=e[0],r=e[1],a=e[2],l=e[3],s=e[4],c=e[5],u=e[6],f=e[7];e[0]=o*i+s*n,e[1]=r*i+c*n,e[2]=a*i+u*n,e[3]=l*i+f*n,e[4]=s*i-o*n,e[5]=c*i-r*n,e[6]=u*i-a*n,e[7]=f*i-l*n};var zk=e=>e*Math.PI/180,$d=(e,t)=>eg()?e.getContext("webgl2",t):e.getContext("webgl",t)||e.getContext("experimental-webgl",t),Vk=`
32##head
33in vec2 vTexCoord;uniform sampler2D uTexture;uniform sampler2D uTextureOverlay;uniform sampler2D uTextureBlend;uniform vec2 uTextureSize;uniform float uOpacity;uniform int uAntialias;uniform vec4 uOverlayColor;uniform mat4 uColorMatrix;uniform vec4 uColorOffset;uniform float uClarityKernel[9];uniform float uClarityKernelWeight;uniform float uColorGamma;uniform float uColorVignette;uniform float uMaskClip;uniform float uMaskOpacity;uniform float uMaskBounds[4];uniform float uMaskCornerRadius[4];uniform float uMaskFeather[8];vec4 applyGamma(vec4 c,float g){c.r=pow(c.r,g);c.g=pow(c.g,g);c.b=pow(c.b,g);return c;}vec4 applyColorMatrix(vec4 c,mat4 m,vec4 o){vec4 res=(c*m)+(o*c.a);res=clamp(res,0.0,1.0);return res;}vec4 applyConvolutionMatrix(vec4 c,float k0,float k1,float k2,float k3,float k4,float k5,float k6,float k7,float k8,float w){vec2 pixel=vec2(1)/uTextureSize;vec4 colorSum=texture(uTexture,vTexCoord-pixel)*k0+texture(uTexture,vTexCoord+pixel*vec2(0.0,-1.0))*k1+texture(uTexture,vTexCoord+pixel*vec2(1.0,-1.0))*k2+texture(uTexture,vTexCoord+pixel*vec2(-1.0,0.0))*k3+texture(uTexture,vTexCoord)*k4+texture(uTexture,vTexCoord+pixel*vec2(1.0,0.0))*k5+texture(uTexture,vTexCoord+pixel*vec2(-1.0,1.0))*k6+texture(uTexture,vTexCoord+pixel*vec2(0.0,1.0))*k7+texture(uTexture,vTexCoord+pixel)*k8;vec4 color=vec4(clamp((colorSum/w),0.0,1.0).rgb,c.a);return color;}vec4 blendPremultipliedAlpha(vec4 back,vec4 front){return front+(back*(1.0-front.a));}vec4 applyVignette(vec4 c,vec2 pos,vec2 center,float v){float d=distance(pos,center)/length(center);float f=1.0-(d*abs(v));if(v>0.0){c.rgb*=f;}else if(v<0.0){c.rgb+=(1.0-f)*(1.0-c.rgb);}return c;}void main(){float x=gl_FragCoord.x;float y=gl_FragCoord.y;float a=1.0;float maskTop=uMaskBounds[0];float maskRight=uMaskBounds[1];float maskBottom=uMaskBounds[2];float maskLeft=uMaskBounds[3];float leftFeatherOpacity=step(uMaskFeather[1],x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],x));a*=leftFeatherOpacity*rightFeatherOpacity;float overlayColorAlpha=(smoothstep(maskLeft,maskLeft+1.0,x)*(1.0-smoothstep(maskRight-1.0,maskRight,x))*(1.0-step(maskTop,y))*step(maskBottom,y));if(uOverlayColor.a==0.0){a*=overlayColorAlpha;}vec2 offset=vec2(maskLeft,maskBottom);vec2 size=vec2(maskRight-maskLeft,maskTop-maskBottom)*.5;vec2 center=offset.xy+size.xy;int pixelX=int(step(center.x,x));int pixelY=int(step(y,center.y));float cornerRadius=0.0;if(pixelX==0&&pixelY==0)cornerRadius=uMaskCornerRadius[0];if(pixelX==1&&pixelY==0)cornerRadius=uMaskCornerRadius[1];if(pixelX==0&&pixelY==1)cornerRadius=uMaskCornerRadius[2];if(pixelX==1&&pixelY==1)cornerRadius=uMaskCornerRadius[3];float cornerOffset=sign(cornerRadius)*length(max(abs(gl_FragCoord.xy-size-offset)-size+cornerRadius,0.0))-cornerRadius;
33float cornerOpacity=1.0-smoothstep(0.0,1.0,cornerOffset);a*=cornerOpacity;if(uAntialias==1){vec2 scaledPoint=vec2(vTexCoord.x*uTextureSize.x,vTexCoord.y*uTextureSize.y);a*=smoothstep(0.0,1.0,uTextureSize.x-scaledPoint.x);a*=smoothstep(0.0,1.0,uTextureSize.y-scaledPoint.y);a*=smoothstep(0.0,1.0,scaledPoint.x);a*=smoothstep(0.0,1.0,scaledPoint.y);}vec4 color=texture(uTexture,vTexCoord);if(uClarityKernelWeight!=-1.0){color=applyConvolutionMatrix(color,uClarityKernel[0],uClarityKernel[1],uClarityKernel[2],uClarityKernel[3],uClarityKernel[4],uClarityKernel[5],uClarityKernel[6],uClarityKernel[7],uClarityKernel[8],uClarityKernelWeight);}color=blendPremultipliedAlpha(color,texture(uTextureBlend,vTexCoord));color=applyGamma(color,uColorGamma);color=applyColorMatrix(color,uColorMatrix,uColorOffset);color*=a;if(uColorVignette!=0.0){vec2 pos=gl_FragCoord.xy-offset;color=applyVignette(color,pos,center-offset,uColorVignette);}color=blendPremultipliedAlpha(color,texture(uTextureOverlay,vTexCoord));if(overlayColorAlpha<=0.0){color*=1.0-uOverlayColor.a;}color*=uOpacity;fragColor=color;}`,Wk=`
34##head
35##text
36void main(){vTexCoord=aTexCoord;gl_Position=uMatrix*aPosition;}`,Uk=`#version 300 es
37
38in vec4 aPosition;in vec2 aNormal;in float aMiter;out vec2 vNormal;out float vMiter;out float vWidth;uniform float uWidth;uniform float uSharpness;uniform mat4 uMatrix;void main(){vMiter=aMiter;vNormal=aNormal;vWidth=(uWidth*.5)+uSharpness;gl_Position=uMatrix*vec4(aPosition.x+(aNormal.x*vWidth*aMiter),aPosition.y+(aNormal.y*vWidth*aMiter),0,1);}`,Hk=`
39##head
40##mask
41in vec2 vNormal;in float vMiter;in float vWidth;uniform float uWidth;uniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;float m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);if(m<=0.0)discard;fillColor.a*=clamp(smoothstep(vWidth-.5,vWidth-1.0,abs(vMiter)*vWidth),0.0,1.0);fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}`,Nk=`
42##head
43##text
44in vec2 aRectCoord;out vec2 vRectCoord;void main(){vTexCoord=aTexCoord;vRectCoord=aRectCoord;
45##matrix
46}`,Gk=`
47##head
48##mask
49in vec2 vTexCoord;in vec2 vRectCoord;uniform sampler2D uTexture;uniform vec4 uTextureColor;uniform float uTextureOpacity;uniform vec2 uRepeat;uniform vec4 uColor;uniform float uCornerRadius[4];uniform vec2 uSize;uniform vec2 uPosition;uniform vec4 uCanvasColor;uniform int uInverted;uniform float uEdgeFeather;void main(){
50##init
51##colorize
52##rectaa
53##cornerradius
54##maskfeatherapply
55if(uInverted==1)a=1.0-a;
56##maskapply
57##fragcolor
58}`,jk=`
59##head
60##text
61out vec2 vTexCoordDouble;void main(){vTexCoordDouble=vec2(aTexCoord.x*2.0-1.0,aTexCoord.y*2.0-1.0);vTexCoord=aTexCoord;
62##matrix
63}`,Zk=`
64##head
65##mask
66in vec2 vTexCoord;in vec2 vTexCoordDouble;uniform sampler2D uTexture;uniform float uTextureOpacity;uniform vec2 uTextureAdjust;uniform vec2 uRepeat;uniform vec2 uRadius;uniform vec4 uColor;uniform int uInverted;uniform vec4 uCanvasColor;void main(){
67##init
68float ar=uRadius.x/uRadius.y;vec2 rAA=vec2(uRadius.x-1.0,uRadius.y-(1.0/ar));vec2 scaledPointSq=vec2((vTexCoordDouble.x*uTextureAdjust.x*uRadius.x)*(vTexCoordDouble.x*uTextureAdjust.x*uRadius.x),(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y)*(vTexCoordDouble.y*uTextureAdjust.y*uRadius.y));float p=(scaledPointSq.x/(uRadius.x*uRadius.x))+(scaledPointSq.y/(uRadius.y*uRadius.y));float pAA=(scaledPointSq.x/(rAA.x*rAA.x))+(scaledPointSq.y/(rAA.y*rAA.y));a=smoothstep(1.0,p/pAA,p);if(uInverted==1)a=1.0-a;
69##maskapply
70##fragcolor
71}`,Xk=`
72##head
73void main(){
74##matrix
75}`,Kk=`
76##head
77##mask
78uniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;
79##maskapply
80if(m<=0.0)discard;fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}`;const cm=(e,t)=>{const n=e.length;return t>=n?e[t%n]:t<0?e[t%n+n]:e[t]},Yk=e=>{let t=0,n,i,o,r,a;const l=e.length;for(n=0;n<l;n++)i=e[n],o=e[(n+1)%l],r=o.x-i.x,a=(o.y+i.y)/2,t+=r*a;return t},qk=(e,t,n,i)=>{const o=re(n.x-t.x,n.y-t.y),r=re(i.x-n.x,i.y-n.y),a=re(t.x-i.x,t.y-i.y),l=re(e.x-t.x,e.y-t.y),s=re(e.x-n.x,e.y-n.y),c=re(e.x-i.x,e.y-i.y),u=Cd(o,l),f=Cd(r,s),d=Cd(a,c);return u<=0&&f<=0&&d<=0},Jk=e=>{const t=e.length;for(let n=0;n<t;n++){const i=os(e[n],cm(e,n+1));if(wy(i,e,{ignoreIdenticalLines:!0,breakOnIntersection:!0}
80))return!0}return!1},Qk=e=>{if(e.length<3)return[];if(Jk(e))return[];Yk(e)<0&&e.reverse();const t=e.length,n=[...Array(t).keys()],i=[];let o,r,a,l,s,c,u,f,d,m,g,p,y=1024;for(;n.length>3;){if(y<=0)return[];for(y--,o=0;o<n.length;o++)if(a=n[o],l=cm(n,o-1),s=cm(n,o+1),c=e[a],u=e[l],f=e[s],d=re(u.x-c.x,u.y-c.y),m=re(f.x-c.x,f.y-c.y),!(Cd(d,m)<0)){for(g=!0,r=0;r<t;r++)if(!(r===a||r===l||r===s)&&(p=e[r],qk(p,u,c,f))){g=!1;break}if(g){i.push([u,c,f]),n.splice(o,1);break}}}return i.push([e[n[0]],e[n[1]],e[n[2]]]),i},y2=(e,t,n,i,o)=>{const r=ur(re(i.x-n.x,i.y-n.y)),a=ur(re(o.x-i.x,o.y-i.y)),l=ur(re(r.x+a.x,r.y+a.y)),s=re(-l.y,l.x),c=re(-r.y,r.x),u=Math.min(1/kd(s,c),5);e[t]=i.x,e[t+1]=i.y,e[t+2]=s.x*u,e[t+3]=s.y*u,e[t+4]=-1,e[t+5]=i.x,e[t+6]=i.y,e[t+7]=s.x*u,e[t+8]=s.y*u,e[t+9]=1},$k=(e,t)=>{let n,i,o,r=0;const a=e.length,l=10,s=new Float32Array((t?a+1:a)*l),c=e[0],u=e[a-1];for(r=0;r<a;r++)n=e[r-1],i=e[r],o=e[r+1],n||(n=t?u:re(i.x+(i.x-o.x),i.y+(i.y-o.y))),o||(o=t?c:re(i.x+(i.x-n.x),i.y+(i.y-n.y))),y2(s,r*l,n,i,o);return t&&y2(s,a*l,u,c,e[1]),s},S2=e=>{const t=new Float32Array(8);return t[0]=e[3].x,t[1]=e[3].y,t[2]=e[0].x,t[3]=e[0].y,t[4]=e[2].x,t[5]=e[2].y,t[6]=e[1].x,t[7]=e[1].y,t},w2=(e,t=0,n,i)=>{const o=Fr(e),r=e.x+e.width*.5,a=e.y+e.height*.5;return(n||i)&&wc(o,n,i,r,a),t!==0&&Os(o,t,r,a),o},e6=(e,t,n,i,o,r,a)=>{const l=Math.abs(n)*.5,s=Math.abs(i)*.5,c=Math.abs(n)+Math.abs(i),u=Math.max(20,Math.round(c/6));return Yd(re(e+l,t+s),l,s,o,r,a,u)},t6=(e,t,n,i,o,r,a,l)=>{const s=[];if(r.every(c=>c===0))s.push(re(e,t),re(e+n,t),re(e+n,t+i),re(e,t+i));else{const[c,u,f,d]=r,m=e,g=e+n,p=t,y=t+i;s.push(re(m+c,p)),sd(s,g-u,p+u,u,-1),s.push(re(g,p+u)),sd(s,g-d,y-d,d,0),s.push(re(g-d,y)),sd(s,m+f,y-f,f,1),s.push(re(m,y-f)),sd(s,m+c,p+c,c,2)}return(a||l)&&wc(s,a,l,e+n*.5,t+i*.5),o&&Os(s,o,e+n*.5,t+i*.5),s},sd=(e,t,n,i,o)=>{const r=Math.min(20,Math.max(4,Math.round(i/2)));let a=0,l=0,s=0,c=0,u=0;for(;u<r;u++)a=u/r,l=o*Ha+a*Ha,s=i*Math.cos(l),c=i*Math.sin(l),e.push(re(t+s,n+c))};let cd=null;var tg=()=>{if(cd!==null)return cd;let e=ci("canvas");const t=$d(e);return cd=t?t.getParameter(t.MAX_TEXTURE_SIZE):void 0,Wi(e),e=void 0,cd},ng=()=>zo()&&!!window.chrome;const xu=new Float32Array([0,1,0,0,1,1,1,0]),n6=new Float32Array([1,0,0,0,1,1,0,1]),i6=zo()&&ja(),_2=[0,0,0,0,1,0,0,0,0],o6=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],L1=0,ud=1,fd=2,T2=3,dd=4,x1=[0,0,0,0],r6=[0,0,0,0],k2=(e,t,n,i,o)=>{if(!n||!i)return xu;let r=i.x/n.width,a=i.y/n.height,l=e/n.width/o,s=t/n.height/o;l-=r,s-=a;const c=-r,u=s,f=-r,d=-a,m=l,g=s,p=l,y=-a;return new Float32Array([c,u,f,d,m,g,p,y])},a6=(e,t)=>Math.floor(Xn(e,0,Math.min((t.width-1)*.5,(t.height-1)*.5)));var l6=(e,t={})=>{const{alpha:n=!1}=t,i={width:0,height:0},o={width:0,height:0},r=tg()||1024;let a,l,s;const c=E1(),u=E1();let f,d,m,g,p,y,w,_,P,C=0,R=0,I=0,M=1;const T=new Map([]),v=(We,Xe,nt)=>{l=Math.max(1,nt),s=l===1?.75:1,o.width=We,o.height=Xe,i.width=We*l,i.height=Xe*l,a=fa(i.width,i.height),e.width=i.width,e.height=i.height,A1(c,0,i.width,i.height,0,-1,1),_=[1,0,1,0,1,o.width,1,o.width]},H=()=>{S.stencilOp(S.KEEP,S.KEEP,S.REPLACE),S.stencilFunc(S.ALWAYS,1,255),S.stencilMask(255)},Y=()=>{S.stencilFunc(S.EQUAL,1,255),S.stencilMask(0)},Z=()=>{S.stencilOp(S.KEEP,S.KEEP,S.KEEP),S.stencilFunc(S.ALWAYS,1,255),S.stencilMask(255)},W=zk(30),$=Math.tan(W/2),S=$d(e,{alpha:n,antialias:!1,premultipliedAlpha:!0,stencil:!0});if(!S)return;S.getExtension("OES_standard_derivatives"),S.disable(S.DEPTH_TEST),S.enable(S.STENCIL_TEST),S.enable(S.BLEND),S.blendFunc(S.ONE,S.ONE_MINUS_SRC_ALPHA),Z();const pe=S.createTexture();S.bindTexture(S.TEXTURE_2D,pe),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,1,1,0,S.RGBA,S.UNSIGNED_BYTE,new Uint8Array(x1)),T.set(L1,pe);const ge=S.createTexture();T.set(fd,ge);const de=S.createFramebuffer(),Fe=S.createTexture();T.set(ud,Fe);const X=S.createFramebuffer(),U=Mu(S,Wk,Vk,["aPosition","aTexCoord"],["uMatrix","uTexture","uTextureBlend","uTextureOverlay","uTextureSize","uColorGamma","uColorVignette","uColorOffset","uColorMatrix","uClarityKernel","uClarityKernelWeight","uOpacity","uMaskOpacity","uMaskBounds","uMaskCornerRadius","uMaskFeather","uOverlayColor","uAntialias"]),ae=S.createBuffer(),be=S.createBuffer();S.bindBuffer(S.ARRAY_BUFFER,be),S.bufferData(S.ARRAY_BUFFER,xu,S.STATIC_DRAW);
80const ft=S.createBuffer();S.bindBuffer(S.ARRAY_BUFFER,ft),S.bufferData(S.ARRAY_BUFFER,n6,S.STATIC_DRAW);const Se=(We,Xe,nt,wt,Zt,yt,nn,Jt,yn,an,Tt=o6,Sn=1,ln,sn=1,ke=0,Re=_,Lt=r6,fn=x1,on=!1,En=!1,bt=!0,Un=!1)=>{const Hn=Xe.width*l,$n=Xe.height*l,Q=Hn*-.5,Ge=$n*.5,j=Hn*.5,Le=$n*-.5,tt=new Float32Array([Q,Le,0,Q,Ge,0,j,Le,0,j,Ge,0]);S.bindBuffer(S.ARRAY_BUFFER,ae),S.bufferData(S.ARRAY_BUFFER,Un?tt.map(ct=>Math.round(ct)):tt,S.STATIC_DRAW);const en=Xe.height/2/$*(i.height/Xe.height)*-1;Zt*=l,yt*=l,nt*=l,wt*=l;const{program:Xt,locations:Ze}=U,tn=E1();Ok(tn,W,a,1,-en*2),Es(tn,Zt,-yt,en),Es(tn,nt,-wt,0),p2(tn,-yn),m2(tn,an),Es(tn,-nt,wt,0),b2(tn,Jt),g2(tn,nn),S.useProgram(Xt),S.enableVertexAttribArray(Ze.aPosition),S.enableVertexAttribArray(Ze.aTexCoord),S.uniform1i(Ze.uTexture,T2),S.uniform2f(Ze.uTextureSize,Xe.width,Xe.height),S.activeTexture(S.TEXTURE0+T2),S.bindTexture(S.TEXTURE_2D,We);const Fn=En?ud:L1,K=T.get(Fn);S.uniform1i(Ze.uTextureBlend,Fn),S.activeTexture(S.TEXTURE0+Fn),S.bindTexture(S.TEXTURE_2D,K);const J=on?fd:L1,xe=T.get(J);S.uniform1i(Ze.uTextureOverlay,J),S.activeTexture(S.TEXTURE0+J),S.bindTexture(S.TEXTURE_2D,xe),S.bindBuffer(S.ARRAY_BUFFER,ae),S.vertexAttribPointer(Ze.aPosition,3,S.FLOAT,!1,0,0);const it=i6&&Ft(We);S.bindBuffer(S.ARRAY_BUFFER,it?ft:be),S.vertexAttribPointer(Ze.aTexCoord,2,S.FLOAT,!1,0,0),S.uniformMatrix4fv(Ze.uMatrix,!1,tn),S.uniform4fv(Ze.uOverlayColor,fn);let Ye;!ln||Rl(ln,_2)?(ln=_2,Ye=-1):(Ye=ln.reduce((ct,ot)=>ct+ot,0),Ye=Ye<=0?1:Ye),S.uniform1fv(Ze.uClarityKernel,ln),S.uniform1f(Ze.uClarityKernelWeight,Ye),S.uniform1f(Ze.uColorGamma,1/sn),S.uniform1f(Ze.uColorVignette,ke),S.uniform1i(Ze.uAntialias,bt?1:0),S.uniform4f(Ze.uColorOffset,Tt[4],Tt[9],Tt[14],Tt[19]),S.uniformMatrix4fv(Ze.uColorMatrix,!1,[Tt[0],Tt[1],Tt[2],Tt[3],Tt[5],Tt[6],Tt[7],Tt[8],Tt[10],Tt[11],Tt[12],Tt[13],Tt[15],Tt[16],Tt[17],Tt[18]]),S.uniform1f(Ze.uOpacity,Sn),S.uniform1f(Ze.uMaskOpacity,y),S.uniform1fv(Ze.uMaskBounds,w),S.uniform1fv(Ze.uMaskCornerRadius,Lt.map(ct=>ct*l)),S.uniform1fv(Ze.uMaskFeather,Re.map((ct,ot)=>ot%2===0?ct:ct*l)),S.drawArrays(S.TRIANGLE_STRIP,0,4),S.disableVertexAttribArray(Ze.aPosition),S.disableVertexAttribArray(Ze.aTexCoord)},De=Mu(S,Uk,Hk,["aPosition","aNormal","aMiter"],["uColor","uCanvasColor","uMatrix","uWidth","uSharpness","uMaskBounds","uMaskOpacity"]),Mt=S.createBuffer();ng()&&(S.bindBuffer(S.ARRAY_BUFFER,Mt),S.bufferData(S.ARRAY_BUFFER,1,S.DYNAMIC_DRAW));const gt=(We,Xe,nt,wt=!1)=>{const{program:Zt,locations:yt}=De;S.useProgram(Zt),S.enableVertexAttribArray(yt.aPosition),S.enableVertexAttribArray(yt.aNormal),S.enableVertexAttribArray(yt.aMiter);const nn=$k(We,wt),Jt=Float32Array.BYTES_PER_ELEMENT*5,yn=Float32Array.BYTES_PER_ELEMENT*2,an=Float32Array.BYTES_PER_ELEMENT*4;S.uniform1f(yt.uWidth,Xe),S.uniform1f(yt.uSharpness,s),S.uniform4fv(yt.uColor,nt),S.uniformMatrix4fv(yt.uMatrix,!1,f),S.uniform4f(yt.uCanvasColor,C,R,I,M),S.uniform1fv(yt.uMaskBounds,w),S.uniform1f(yt.uMaskOpacity,y),S.bindBuffer(S.ARRAY_BUFFER,Mt),S.bufferData(S.ARRAY_BUFFER,nn,S.STATIC_DRAW),S.vertexAttribPointer(yt.aPosition,2,S.FLOAT,!1,Jt,0),S.vertexAttribPointer(yt.aNormal,2,S.FLOAT,!1,Jt,yn),S.vertexAttribPointer(yt.aMiter,1,S.FLOAT,!1,Jt,an),S.drawArrays(S.TRIANGLE_STRIP,0,nn.length/5),S.disableVertexAttribArray(yt.aPosition),S.disableVertexAttribArray(yt.aNormal),S.disableVertexAttribArray(yt.aMiter)},ie=Mu(S,Xk,Kk,["aPosition"],["uColor","uCanvasColor","uMatrix","uMaskBounds","uMaskOpacity"]),N=S.createBuffer(),le=(We,Xe)=>{const{program:nt,locations:wt}=ie;return S.useProgram(nt),S.enableVertexAttribArray(wt.aPosition),S.uniform4fv(wt.uColor,Xe),S.uniformMatrix4fv(wt.uMatrix,!1,f),S.uniform1fv(wt.uMaskBounds,w),S.uniform1f(wt.uMaskOpacity,y),S.uniform4f(wt.uCanvasColor,C,R,I,M),S.bindBuffer(S.ARRAY_BUFFER,N),S.bufferData(S.ARRAY_BUFFER,We,S.STATIC_DRAW),S.vertexAttribPointer(wt.aPosition,2,S.FLOAT,!1,0,0),S.drawArrays(S.TRIANGLES,0,We.length/2),S.disableVertexAttribArray(wt.aPosition),We},Me=Mu(S,Nk,Gk,["aPosition","aTexCoord","aRectCoord"],["uTexture","uColor","uMatrix","uCanvasColor","uTextureColor","uTextureOpacity","uRepeat","uPosition","uSize","uMaskBounds","uMaskOpacity","uMaskFeather","uCornerRadius","uInverted","uEdgeFeather"]),qe=S.createBuffer(),Ne=S.createBuffer(),mt=S.createBuffer(),ue=(We,Xe,nt,wt,Zt,yt=pe,nn,Jt=1,yn=x1,an=xu,Tt=P,Sn=1,ln)=>{const{program:sn,locations:ke}=Me;return S.useProgram(sn),S.enableVertexAttribArray(ke.aPosition),S.enableVertexAttribArray(ke.aTexCoord),S.enableVertexAttribArray(ke.aRectCoord),S.uniform4fv(ke.uColor,Zt),S.uniform2fv(ke.uSize,[Xe,nt]),S.uniform2fv(ke.uPosition,[We[2],We[3]]),S.uniform2fv(ke.uRepeat,nn),S.uniform1i(ke.uInverted,ln?1:0),S.uniform1fv(ke.uCornerRadius,wt),S.uniform4f(ke.uCanvasColor,C,R,I,M),S.uniform1fv(ke.uMaskFeather,Tt.map((Re,Lt)=>Lt%2===0?Re:Re*l)),S.uniform1fv(ke.uMaskBounds,w),S.uniform1f(ke.uMaskOpacity,y),S.uniform1f(ke.uEdgeFeather,Math.max(0,Sn)),S.uniformMatrix4fv(ke.uMatrix,!1,f),S.uniform1i(ke.uTexture,dd),S.uniform4fv(ke.uTextureColor,yn),S.uniform1f(ke.uTextureOpacity,Jt),S.activeTexture(S.TEXTURE0+dd),S.bindTexture(S.TEXTURE_2D,yt),S.bindBuffer(S.ARRAY_BUFFER,Ne),S.bufferData(S.ARRAY_BUFFER,an,S.STATIC_DRAW),S.vertexAttribPointer(ke.aTexCoord,2,S.FLOAT,!1,0,0),S.bindBuffer(S.ARRAY_BUFFER,mt),S.bufferData(S.ARRAY_BUFFER,xu,S.STATIC_DRAW),S.vertexAttribPointer(ke.aRectCoord,2,S.FLOAT,!1,0,0),S.bindBuffer(S.ARRAY_BUFFER,qe),S.bufferData(S.ARRAY_BUFFER,We,S.STATIC_DRAW),S.vertexAttribPointer(ke.aPosition,2,S.FLOAT,!1,0,0),S.drawArrays(S.TRIANGLE_STRIP,0,We.length/2),S.disableVertexAttribArray(ke.aPosition),S.disableVertexAttribArray(ke.aTexCoord),S.disableVertexAttribArray(ke.aRectCoord),We},He=Mu(S,jk,Zk,["aPosition","aTexCoord"],["uTexture","uTextureOpacity","uTextureAdjust","uRepeat","uColor","uCanvasColor","uMatrix","uRadius","uInverted","uMaskBounds","uMaskOpacity"]),Qe=S.createBuffer(),G=S.createBuffer(),je=(We,Xe,nt,wt,Zt=pe,yt,nn=xu,Jt=1,yn=!1)=>{const{program:an,locations:Tt}=He;S.useProgram(an),S.enableVertexAttribArray(Tt.aPosition),S.enableVertexAttribArray(Tt.aTexCoord),S.uniformMatrix4fv(Tt.uMatrix,!1,f),S.uniform2fv(Tt.uRadius,[Xe*.5,nt*.5]),S.uniform2fv(Tt.uTextureAdjust,[yt.width/(Xe/l),yt.height/(nt/l)]),S.uniform1i(Tt.uInverted,yn?1:0),S.uniform4fv(Tt.uColor,wt),S.uniform4f(Tt.uCanvasColor,C,R,I,M),S.uniform2fv(Tt.uRepeat,[1,1]),S.uniform1fv(Tt.uMaskBounds,w),S.uniform1f(Tt.uMaskOpacity,y),S.uniform1i(Tt.uTexture,dd),S.uniform1f(Tt.uTextureOpacity,Jt),S.activeTexture(S.TEXTURE0+dd),S.bindTexture(S.TEXTURE_2D,Zt),S.bindBuffer(S.ARRAY_BUFFER,G),S.bufferData(S.ARRAY_BUFFER,nn,S.STATIC_DRAW),S.vertexAttribPointer(Tt.aTexCoord,2,S.FLOAT,!1,0,0),S.bindBuffer(S.ARRAY_BUFFER,Qe),S.bufferData(S.ARRAY_BUFFER,We,S.STATIC_DRAW),S.vertexAttribPointer(Tt.aPosition,2,S.FLOAT,!1,0,0),S.drawArrays(S.TRIANGLE_STRIP,0,We.length/2),S.disableVertexAttribArray(Tt.aPosition),S.disableVertexAttribArray(Tt.aTexCoord)},ye=(We,Xe=0,nt=!1,wt=!1,Zt,yt,nn,Jt,yn)=>
80{if(We.length<2)return;const an=We.map(sn=>({x:sn.x*l,y:sn.y*l})),Tt=Zt*l;if(Tt>0&&gt(an,Tt,Is(yt,yn),nn),an.length<3||!Jt||Jt[3]===0||!nn)return;const Sn=Qk(an),ln=new Float32Array(Sn.length*6);Sn.forEach(([sn,ke,Re],Lt)=>{const fn=Lt*6;ln[fn+0]=sn.x,ln[fn+1]=sn.y,ln[fn+2]=ke.x,ln[fn+3]=ke.y,ln[fn+4]=Re.x,ln[fn+5]=Re.y}),le(ln,Is(Jt,yn))},$e=(We,Xe=0,nt=!1,wt=!1,Zt,yt,nn,Jt=void 0,yn=void 0,an=!1,Tt=void 0,Sn,ln,sn,ke=void 0,Re=1/l,Lt,fn)=>{const on=Ds(Rn(We),l),En=Zt.map(bt=>a6(bt||0,We)).map(bt=>bt*l);if(yt||nn){const bt=Rn(on);bt.x-=.5,bt.y-=.5,bt.width+=1,bt.height+=1;const Un=w2(bt,Xe,nt,wt),Hn=S2(Un);let $n;Lt&&($n=Is(Lt),$n[3]===0&&($n[3]=.001));const Q=Jt&&an?[bt.width/Jt.width,bt.height/Jt.height]:[1,1];ue(Hn,bt.width,bt.height,En,Is(yt,sn),nn,Q,sn,$n,Tt?new Float32Array(Tt):k2(bt.width,bt.height,Jt,yn,l),ke,Re*l,fn)}Sn&&(Sn=Math.min(Sn,on.width,on.height),gt(t6(on.x,on.y,on.width,on.height,Xe,En,nt,wt),Sn*l,Is(ln,sn),!0))},St=(We,Xe,nt,wt,Zt,yt,nn,Jt,yn=void 0,an=void 0,Tt=void 0,Sn,ln,sn,ke)=>{const Re=Ds(Li(We.x-Xe,We.y-nt,Xe*2,nt*2),l);if(nn||Jt){const Lt=Rn(Re);ke||(Lt.x-=.5,Lt.y-=.5,Lt.width+=1,Lt.height+=1);const fn=w2(Lt,wt,Zt,yt),on=S2(fn);je(on,Lt.width,Lt.height,Is(nn,sn),Jt,yn||Ci(Lt.width/l,Lt.height/l),Tt?new Float32Array(Tt):k2(Lt.width,Lt.height,yn,an,l),sn,ke)}Sn&&gt(e6(Re.x,Re.y,Re.width,Re.height,wt,Zt,yt),Sn*l,Is(ln,sn),!0)},Je=new Map,q={};q[fd]={width:0,height:0},q[ud]={width:0,height:0};const Ie=4096,se=(We,Xe,nt,wt=1)=>{const Zt=Math.min(Math.min(Ie,r)/nt.width,Math.min(Ie,r)/nt.height,wt),yt=Math.floor(Zt*nt.width),nn=Math.floor(Zt*nt.height);qu(nt,q[We])?S.bindFramebuffer(S.FRAMEBUFFER,Xe):(S.bindTexture(S.TEXTURE_2D,T.get(We)),S.texImage2D(S.TEXTURE_2D,0,S.RGBA,yt,nn,0,S.RGBA,S.UNSIGNED_BYTE,null),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_MIN_FILTER,S.LINEAR),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_S,S.CLAMP_TO_EDGE),S.texParameteri(S.TEXTURE_2D,S.TEXTURE_WRAP_T,S.CLAMP_TO_EDGE),S.bindFramebuffer(S.FRAMEBUFFER,Xe),S.framebufferTexture2D(S.FRAMEBUFFER,S.COLOR_ATTACHMENT0,S.TEXTURE_2D,T.get(We),0),q[We]=nt);const Jt=nt.width*l,yn=nt.height*l;A1(u,0,Jt,yn,0,-1,1),Es(u,0,yn,0),Dk(u,1),Bk(u,-1),f=u,S.viewport(0,0,yt,nn),S.colorMask(!0,!0,!0,!0),S.clearColor(0,0,0,0),S.clear(S.COLOR_BUFFER_BIT),P=[1,0,1,0,1,Math.max(i.width,nt.width),1,Math.max(i.width,nt.width)]},V=(We,Xe)=>{const{forceRelease:nt=!1}=Xe||{},{src:wt}=Je.get(We);wt instanceof HTMLCanvasElement&&!nt&&!wt.dataset.retain&&Wi(wt),Je.delete(We),S.deleteTexture(We)},dt=()=>{A1(c,0,i.width,i.height,0,-1,1)},Ft=We=>Je.get(We).isRotatedVideo;return{drawPath:ye,drawRect:$e,drawEllipse:St,drawImage:Se,textureFilterNearest:S.NEAREST,textureFilterLinear:S.LINEAR,textureClamp:S.CLAMP_TO_EDGE,textureRepeat:S.REPEAT,textureCreate:()=>S.createTexture(),textureUpdate:(We,Xe,nt)=>(Je.set(We,{src:Xe,options:nt,isRotatedVideo:Xe.nodeName==="VIDEO"&&(Xe.dataset&&Xe.dataset.rotation==90||Xe.dataset.rotation==270)}),vk(S,We,Xe,nt)),textureGetSize:We=>{const{src:Xe,options:nt}=Je.get(We),wt=sl(Xe);return nt.scalar?Ga(wt,Zt=>Zt/nt.scalar):wt},textureDelete:V,enablePreviewStencil:H,applyPreviewStencil:Y,disablePreviewStencil:Z,setCanvasColor(We){C=We[0],R=We[1],I=We[2],M=n?We[3]:1,S.clear(S.COLOR_BUFFER_BIT)},resetCanvasMatrix:dt,updateCanvasMatrix(We,Xe,nt,wt,Zt){const yt=We.width,nn=We.height,Jt=i.width*(.5/l),yn=i.height*(.5/l),an={x:Jt+(nt.x+Xe.x),y:yn+(nt.y+Xe.y)},Tt={x:an.x-Xe.x,y:an.y-Xe.y},Sn={x:yt*.5,y:nn*.5};Go(Tt,Zt.z,an),Gw(Tt,wt,an);const ln={x:Tt.x-Sn.x,y:Tt.y-Sn.y};Es(c,ln.x*l,ln.y*l,0),Es(c,Sn.x*l,Sn.y*l,0),p2(c,Zt.z);const sn=Zt.x>Math.PI/2;g2(c,sn?Math.PI:0);const ke=Zt.y>Math.PI/2;b2(c,ke?Math.PI:0),m2(c,wt),Es(c,-Sn.x*l,-Sn.y*l,0)},drawToCanvas(){S.bindFramebuffer(S.FRAMEBUFFER,null),f=c,S.viewport(0,0,S.drawingBufferWidth,S.drawingBufferHeight),S.colorMask(!0,!0,!0,!0),S.clearColor(C,R,I,M),S.clear(S.COLOR_BUFFER_BIT),P=[1,0,1,0,1,i.width,1,i.width]},drawToImageBlendBuffer(We,Xe){se(ud,X,We,Xe)},drawToImageOverlayBuffer(We,Xe){se(fd,de,We,Xe)},enableMask(We,Xe){const nt=We.x*l,wt=We.y*l,Zt=We.width*l,yt=We.height*l;p=nt,m=p+Zt,d=i.height-wt,g=i.height-(wt+yt),y=1-Xe,w=[d,m,g,p]},disableMask(){p=0,m=i.width,d=i.height,g=0,y=1,w=[d,m,g,p]}
80,resize:v,release(){Array.from(Je.keys()).forEach(Xe=>V(Xe,{forceRelease:!0})),Je.clear(),T.forEach(Xe=>{S.deleteTexture(Xe)}),T.clear(),U.destroy(),De.destroy(),ie.destroy(),Me.destroy(),He.destroy(),e.width=1,e.height=1,e=void 0}}},s6=(e,t)=>{const{imageData:n,amount:i=1}=e,o=Math.round(Math.max(1,i)*2),r=Math.round(o*.5),a=n.width,l=n.height,s=n.colorSpace,c=new Uint8ClampedArray(a*l*4),u=n.data;let f,d=0,m,g,p,y=0,w=0,_;const P=a*l*4-4;for(g=0;g<l;g++)for(f=crypto.getRandomValues(new Uint8ClampedArray(l)),m=0;m<a;m++)p=f[g]/255,y=0,w=0,p<.5&&(y=(-r+Math.round(Math.random()*o))*4),p>.5&&(w=(-r+Math.round(Math.random()*o))*(a*4)),_=Math.min(Math.max(0,d+y+w),P),c[d]=u[_],c[d+1]=u[_+1],c[d+2]=u[_+2],c[d+3]=u[_+3],d+=4;t(null,{data:c,width:n.width,height:n.height,colorSpace:s})};const c6=[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625];var u6=async(e,t={})=>{if(!e)return;const{width:n,height:i,colorSpace:o="srgb"}=e,{dataSize:r=96,dataSizeScalar:a=1,scrambleAmount:l=4,blurAmount:s=6,outputFormat:c="canvas",backgroundColor:u=[0,0,0]}=t,f=Math.round(r*a),d=Math.min(f/n,f/i),m=Math.floor(n*d),g=Math.floor(i*d),p=ci("canvas",{width:m,height:g}),y=p.getContext("2d",{willReadFrequently:!0,colorSpace:o});if(u.length=3,y.fillStyle=Eo(u),y.fillRect(0,0,m,g),Cc(e)){const C=ci("canvas",{width:n,height:i});C.getContext("2d",{willReadFrequently:!0,colorSpace:o}).putImageData(e,0,0),y.drawImage(C,0,0,m,g),Wi(C)}else y.drawImage(e,0,0,m,g);const w=y.getImageData(0,0,m,g),_=[];if(l>0&&_.push([s6,{amount:l}]),s>0)for(let C=0;C<s;C++)_.push([Ly,{matrix:c6}]);let P;if(_.length){const C=(M,T)=>`(err, imageData) => {
81(${M[T][0].toString()})(Object.assign({ imageData: imageData }
81, filterInstructions[${T}]), 
82${M[T+1]?C(M,T+1):"done"})
83}`,R=`function (options, done) {
84const filterInstructions = options.filterInstructions;
85const imageData = options.imageData;
86(${C(_,0)})(null, imageData)
87}`,I=await Ku(R,[{imageData:w,filterInstructions:_.map(M=>M[1])}],[w.data.buffer]);P=Bm(I)}else P=w;return c==="canvas"?(y.putImageData(P,0,0),p):P};typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gT);function C2(e){return Object.prototype.toString.call(e)==="[object Date]"}function f6(e){return Math.sqrt(1- --e*e)}function um(e,t){if(e===t||e!==e)return()=>e;const n=typeof e;if(n!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const i=t.map((o,r)=>um(e[r],o));return o=>i.map(r=>r(o))}if(n==="object"){if(!e||!t)throw new Error("Object cannot be null");if(C2(e)&&C2(t)){e=e.getTime(),t=t.getTime();const r=t-e;return a=>new Date(e+a*r)}const i=Object.keys(t),o={};return i.forEach(r=>{o[r]=um(e[r],t[r])}),r=>{const a={};return i.forEach(l=>{a[l]=o[l](r)}),a}}if(n==="number"){const i=t-e;return o=>e+o*i}throw new Error(`Cannot interpolate ${n} values`)}function ig(e,t={}){const n=ht(e);let i,o=e;function r(a,l){if(e==null)return n.set(e=a),Promise.resolve();o=a;let s=i,c=!1,{delay:u=0,duration:f=400,easing:d=nS,interpolate:m=um}=wi(wi({},t),l);if(f===0)return s&&(s.abort(),s=null),n.set(e=o),Promise.resolve();const g=aS()+u;let p;return i=Ym(y=>{if(y<g)return!0;c||(p=m(e,a),typeof f=="function"&&(f=f(e,a)),c=!0),s&&(s.abort(),s=null);const w=y-g;return w>f?(n.set(e=a),!1):(n.set(e=p(d(w/f))),!0)}),i.promise}return{set:r,update:(a,l)=>r(a(o,e),l),subscribe:n.subscribe}}function fm(e,t,n,i){if(typeof n=="number"){const o=i-n,r=(n-t)/(e.dt||1/60),a=e.opts.stiffness*o,l=e.opts.damping*r,s=(a-l)*e.inv_mass,c=(r+s)*e.dt;return Math.abs(c)<e.opts.precision&&Math.abs(o)<e.opts.precision?i:(e.settled=!1,n+c)}else{if(Si(n))return n.map((o,r)=>fm(e,t[r],n[r],i[r]));if(typeof n=="object"){const o={};for(const r in n)o[r]=fm(e,t[r],n[r],i[r]);return o}else throw new Error(`Cannot spring ${typeof n} values`)}}function hn(e,t={}){const n=ht(e),{stiffness:i=.15,damping:o=.8,precision:r=.01}=t;let a,l,s,c=e,u=e,f=1,d=0,m=!1;function g(y,w={}){u=y;const _=s={};if(e==null||w.hard||p.stiffness>=1&&p.damping>=1)return m=!0,a=null,c=y,n.set(e=u),Promise.resolve();if(w.soft&&(d=1/((w.soft===!0?.5:+w.soft)*60),f=0),!l){a=null,m=!1;const P={inv_mass:void 0,opts:p,settled:!0,dt:void 0};l=Ym(C=>{if(a===null&&(a=C),m)return m=!1,l=null,!1;f=Math.min(f+d,1),P.inv_mass=f,P.opts=p,P.settled=!0,P.dt=(C-a)*60/1e3;const R=fm(P,c,e,u);return a=C,c=e,n.set(e=R),P.settled&&(l=null),!P.settled})}return new Promise(P=>{l.promise.then(()=>{_===s&&P()})})}const p={set:g,update:(y,w)=>g(y(u,e),w),subscribe:n.subscribe,stiffness:i,damping:o,precision:r};return p}var d6=pc(!1,e=>{const t=window.matchMedia("(prefers-reduced-motion:reduce)"),n=()=>e(t.matches);return n(),t.addListener(n),()=>t.removeListener(n)}),P2=()=>"ResizeObserver"in window;const F1=ql(),zS=(e,t,n,i,o)=>{e.rect||(e.rect=ql());const r=e.rect;py(F1,t,n,i,o),!da(r,F1)&&(Kd(r,F1),e.dispatchEvent(new CustomEvent("measure",{detail:r})))},hd=Math.round,h6=e=>{const t=e.getBoundingClientRect();Wa&&zS(e,hd(t.x),hd(t.y),hd(t.width),hd(t.height))},v1=e=>{Wa&&zS(e,e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)},zu=[];let Wa;function dm(){if(!zu.length){Wa=void 0;return}zu.forEach(e=>e.measure(e)),Wa=requestAnimationFrame(dm)}let As,za,md=new Map([]),Ru=0,O1=0;var Fo=(e,t={})=>{const{observePosition:n=!1,observeViewRect:i=!1,once:o=!1,disabled:r=!1,isMeasureRoot:a=!1}=t;if(P2()&&a&&(za||(za=new ResizeObserver(l=>{l.forEach(c=>{md.set(c.target,c.contentRect)});const s=Array.from(md.values()).some(({width:c,height:u})=>c>0&&u>0);s?s&&Wa===!1&&dm():(Wa&&cancelAnimationFrame(Wa),Wa=!1)})),za.observe(e),Ru++),!r)return P2()&&!n&&!i?(As||(As=new ResizeObserver(l=>{l.forEach(s=>{Wa&&v1(s.target)})})),As.observe(e),v1(e),o?As.unobserve(e):O1++,{destroy(){a&&za&&(md.delete(e),za.unobserve(e),Ru--,Ru===0&&(za.disconnect(),za=void 0)),!o&&(As.unobserve(e),O1--,O1===0&&(As.disconnect(),As=void 0))}}):(e.measure=i?h6:v1,zu.push(e),Wa===void 0&&(Wa=requestAnimationFrame(dm)),e.measure(e),{destroy(){a&&za&&(md.delete(e),za.unobserve(e),Ru--,Ru===0&&(za.disconnect(),za=void 0));const l=zu.indexOf(e);zu.splice(l,1),delete e.measure}})},m6=e=>{let t;const l={pointerdown:()=>{t=!1},keydown:()=>{t=!0},keyup:()=>{t=!1},focus:s=>{t!==!1&&(s.target.dataset.focusVisible="")},blur:s=>{delete s.target.dataset.focusVisible}};return Object.keys(l).forEach(s=>e.addEventListener(s,l[s],!0)),{destroy(){Object.keys(l).forEach(s=>e.removeEventListener(s,l[s],!0))}}};const M2=e=>/^http/.test(e),g6=e=>new Promise((t,n)=>{if(e.kind==="file")return t(e.getAsFile());
87if(e.kind==="string")return e.getAsString(t);n()}),b6=e=>new Promise((t,n)=>{const{items:i}=e.dataTransfer;if(!i)return t([]);const o=Array.from(i).some(a=>a.type==="text/uri-list"),r=Array.from(i).filter(a=>(a.kind==="file"||a.kind==="string")&&a.type!=="text/x-moz-url").map(g6);Promise.all(r).then(a=>{if(o)return t([a.find(M2)].filter(Boolean));const l=a.filter(s=>Rc(s)&&(Qu(s)||as(s))||M2(s));t(l)}).catch(n)});var VS=(e,t={})=>{const n=l=>{l.preventDefault()},i=async l=>{l.preventDefault(),l.stopPropagation();try{const s=await b6(l);e.dispatchEvent(new CustomEvent("dropfiles",{detail:{event:l,resources:s},...t}))}catch{}};function o(){e.removeEventListener("drop",i),e.removeEventListener("dragover",n)}function r(){e.addEventListener("drop",i),e.addEventListener("dragover",n)}function a(l){const{disabled:s=!1}=l||{};o(),!s&&r()}return a(t),{update:a,destroy(){o()}}};let gd=null;var og=()=>{if(gd===null)if(zo()){const e=ci("canvas");gd=!$d(e,{failIfMajorPerformanceCaveat:!0}),Wi(e)}else gd=!1;return gd},p6=e=>{const t=e*.5,n=ci("canvas",{"data-retain":!0,width:e,height:e}),i=n.getContext("2d");return i.fillStyle="#f0f",i.fillRect(0,0,t,t),i.fillRect(t,t,t,t),n},y6=e=>{let t=parseFloat(e);return/^[0-9]+s$/.test(e)?t*1e3:t},D1=e=>e instanceof WebGLTexture,R2=([e,t,n,i])=>[i.x,i.y,e.x,e.y,n.x,n.y,t.x,t.y],S6=e=>e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2,w6=(e,t,n)=>{const{selectionColor:i=[1,1,1],scalar:o=1}=n||{};let r=!1;for(const a of t){const l=a.drawMode==="subtract";if(l&&!r)continue;e.globalCompositeOperation=l?"destination-out":"source-over",e.save(),e.beginPath();const s=Jy(a);Ay(e,o,o),Dm(e,a.rotation,s),$y(e,a.flipX,a.flipY,s),a.width?Gm(e,{...a,backgroundColor:i}):a.points?Zm(e,Object.assign({},a,a.pathClose?{backgroundColor:i,strokeColor:[0,0,0,0]}:{strokeColor:i,strokeJoin:"round",strokeCap:"round"})):a.rx&&jm(e,{...a,backgroundColor:i,strokeColor:[0,0,0,0],strokeJoin:"round",strokeCap:"round"}),e.restore(),r=!0}};function _6(e){let t,n,i,o;return{c(){t=fe("div"),n=fe("canvas"),k(t,"class","PinturaCanvas")},m(r,a){te(r,t,a),Ae(t,n),e[37](n),i||(o=[Pe(n,"measure",e[38]),wn(Fo.call(null,n))],i=!0)},p:qt,i:qt,o:qt,d(r){r&&ee(t),e[37](null),i=!1,On(o)}}}const T6=2048,I2=2;let E2=48;function k6(e,t,n){let i,o,r,a,l,s,c;const u=[0,0,0,0],f=Kn(),d=zo()&&p6(128),m=Xa();let{isAnimated:g}=t,{isTransparent:p}=t,{maskRect:y}=t,{maskOpacity:w=1}=t,{maskFrameOpacity:_=.95}=t,{maskMarkupOpacity:P=1}=t,{clipAnnotationsToImage:C=!0}=t,{pixelRatio:R=1}=t,{textPixelRatio:I=R}=t,{backgroundColor:M}=t,{willRender:T=Nn}=t,{didRender:v=Nn}=t,{willRequest:H=void 0}=t,{csp:Y=void 0}=t,{loadImageData:Z=Nn}=t,{enableGrid:W=!1}=t,{gridColors:$=void 0}=t,{gridSize:S=void 0}=t,{gridOpacity:pe=0}=t,{images:ge=[]}=t,{interfaceImages:de=[]}=t,{selectionColor:Fe=void 0}=t,X,U=null,ae=null,be=null;const ft=(Q,Ge)=>Q.set(Ge,{hard:!g}),De={precision:{precision:1e-4}.precision*.01};let Mt=0;const gt=ig(void 0,{duration:0});B(e,gt,Q=>n(36,c=Q));const ie=hn(1,De);B(e,ie,Q=>n(35,l=Q));const N=hn(1,De);B(e,N,Q=>n(51,r=Q));const le=ht();B(e,le,Q=>n(53,s=Q));const Te=ht();B(e,Te,Q=>n(52,a=Q));const me={},Me=(Q,Ge)=>{if(Q.total!==Ge.length)return!0;const j=Q.last,Le=Ge[Ge.length-1];return!!(j.drawMode!==Le.drawMode||vr(j)&&(!vr(Le)||!da(j,Le))||$i(j)&&(!$i(Le)||!(j.x===Le.x&&j.y===Le.y&&j.rx===Le.rx&&j.ry===Le.ry))||Vi(j)&&(!Vi(Le)||Le.points.length!==j.points.length))},qe=(Q,Ge)=>{let j=me[Q.id];const Le=Math.min(1,T6/Ge.width);let tt=j?j.element:ci("canvas",{width:Ge.width*Le,height:Ge.height*Le,"data-retain":!0});if(!j||Me(j,Q.actions)){tt=tt.cloneNode(),w6(tt.getContext("2d"),Q.actions,{selectionColor:[1,0,1],scalar:Le});const en=Q.actions.length;me[Q.id]={total:en,last:{...Q.actions[en-1]},element:tt}}return{x:0,y:0,...Ge,fillColor:Q.color||[1,1,1],backgroundImage:tt}};let Ne;const mt=()=>{cancelAnimationFrame(Ne),Ne=requestAnimationFrame(()=>{an=!0,on=0,o()})},ue=new Map([]),He=new Map([]),Qe=Q=>!Nt(Q)&&(Iy(Q)||Cc(Q)||Ic(Q)||Fd(Q)),G=(Q,Ge)=>{const j=Q==="pixelated"?U.textureFilterNearest:U.textureFilterLinear,Le=Ge==="repeat"?U.textureRepeat:U.textureClamp;return{filterParam:j,wrapParam:Le}},je=(Q,Ge,j)=>{if(!ue.has(Q)){ue.set(Q,Q);const Le=G(Ge,j);if(Qe(Q)){const tt=U.textureCreate();
87U.textureUpdate(tt,Q,Le),ue.set(Q,tt)}else Z(Q).then(tt=>{if(!U||!tt)return;const en=U.textureCreate();U.textureUpdate(en,tt,Le),ue.set(Q,en),mt()}).catch(tt=>{ue.set(Q,tt)})}if(Fd(Q)&&(S6(Q)||Q.dataset.redraw==="true")){const Le=ue.get(Q),tt=G(Ge,j);return U.textureUpdate(Le,Q,tt),Q.dataset.redraw=!1,Le}return ue.get(Q)},ye=(Q,Ge={})=>{const j=Ge.id||Q.id;if(Q.width&&Q.width<1||Q.height&&Q.height<1||!Q.text.length){He.delete(j);return}let{text:Le,textAlign:tt,fontFamily:en,fontSize:Xt=16,fontWeight:Ze,fontVariant:tn,fontStyle:Fn,letterSpacing:K,lineHeight:J=Xt,width:xe,height:it}=Q,{outline:Ye=0,blur:ct=0,paddingTop:ot=0,paddingRight:Ct=0,paddingBottom:cn=0,paddingLeft:Qt=0}=Ge;xe=Ht(xe)?Math.floor(xe):xe,it=Ht(it)?Math.floor(it):it;const{textSize:_n,signature:Bt}=j5(Le,{...Q,width:xe,height:void 0}),et=Od({text:Le,textAlign:tt,fontFamily:en,fontSize:Xt,fontWeight:Ze,fontVariant:tn,fontStyle:Fn,lineHeight:J,letterSpacing:K,outline:Ye,blur:ct,signature:Bt});if(!ue.has(et)){ue.set(et,Le);const Gn=Math.ceil(_n.width),Ri=Math.ceil(_n.height);if(Gn===0||Ri===0)return;const ai=tg(),ui=Math.min(1,(ai-(Qt+Ct)*I)/(Gn*I),(ai-(ot+cn)*I)/(Ri*I));zy(Le,{fontSize:Xt,fontFamily:en,fontWeight:Ze,fontVariant:tn,fontStyle:Fn,letterSpacing:K,textAlign:tt,lineHeight:J,width:xe,height:it,imageWidth:Gn,imageHeight:Ri,paddingLeft:Qt,paddingTop:ot,paddingRight:Ct,paddingBottom:cn,pixelRatio:I*ui,willRequest:H,outline:Ye,blur:ct,styleNonce:Y.styleNonce,color:[1,0,1]}).then(Yn=>{if(!U)return;const _t=U.textureCreate();U.textureUpdate(_t,Yn,{filterParam:U.textureFilterLinear,wrapParam:U.textureClamp,scalar:ui,premultiply:!ja()}),ue.set(et,_t),He.set(j,_t),mt()}).catch(console.error)}const ri=ue.get(et);return D1(ri)?ri:He.get(j)},$e=new Map,St=Q=>{const{id:Ge,points:j,strokeWidth:Le,strokeCap:tt,strokeJoin:en,strokeColor:Xt,strokeDash:Ze,pathClose:tn,backgroundColor:Fn}=Q;let K=ue.get(Ge),J=$e.get(Ge);const xe=Od({points:j.map(Bt=>`${Bt.x},${Bt.y}`).join(","),strokeWidth:Le,strokeCap:tt,strokeJoin:en,strokeColor:Xt,strokeDash:(Ze||[]).join(","),pathClose:tn,backgroundColor:tn?(Fn||[]).join(","):void 0});if(J){const{hash:Bt}=J;if(!ue.has(Ge))J=void 0;else if(xe===Bt)return ue.get(Ge)}if(!J){const Bt=ci("canvas",{width:1,height:1});J={canvas:Bt,hash:void 0},$e.set(Q.id,J),K=U.textureCreate(),U.textureUpdate(K,Bt,{filterParam:U.textureFilterLinear,wrapParam:U.textureClamp}),ue.set(Ge,K)}const{canvas:it}=J,Ye=Math.ceil(Q.strokeWidth)+I2,ct=Qi(j),ot=Math.floor(ct.x-Ye*.5),Ct=Math.floor(ct.y-Ye*.5),cn=Math.ceil(ct.width+Ye),Qt=Math.ceil(ct.height+Ye);it.width=Math.max(cn,1),it.height=Math.max(Qt,1);const _n=it.getContext("2d");return _n.clearRect(0,0,it.width,it.height),cn>=1&&Qt>=1&&(_n.translate(-ot,-Ct),Zm(_n,Q),_n.resetTransform()),U.textureUpdate(K,it,{filterParam:U.textureFilterLinear,wrapParam:U.textureClamp}),$e.set(Ge,{canvas:it,hash:xe}),ue.get(Ge)},Je=Q=>{let Ge;return Q.backgroundImage?Ge=je(Q.backgroundImage,Q.backgroundImageRendering,Q.backgroundRepeat==="repeat"?"repeat":void 0):Q.bitmap&&Q.points&&(Ge=St(Q)),Ge},q=Q=>{ue.forEach((Ge,j)=>{Q.find(tt=>tt===Ge)||!D1(Ge)||Array.from(He.values()).includes(Ge)||(ue.delete(j),U.textureDelete(Ge))})},Ie=({texture:Q,size:Ge,origin:j,translation:Le,rotation:tt,scale:en,colorMatrix:Xt,opacity:Ze,convolutionMatrix:tn,gamma:Fn,vignette:K,maskFeather:J,maskCornerRadius:xe,overlayColor:it,enableOverlay:Ye,enableManipulation:ct,enableAntialiasing:ot})=>{let Ct=R===1,cn=0,Qt=0;if(R===1){const _n=Math.abs(1-en)<Number.EPSILON;cn=_n&&ae%2!==0?.5:0,Qt=_n&&be%2!==0?.5:0}return U.drawImage(Q,Ge,j.x,j.y,Le.x+cn,Le.y+Qt,tt.x,tt.y,tt.z,en,Xt,Xn(Ze,0,1),tn,Fn,K,J,xe,it,Ye,ct,ot,Ct),Q},se=(Q,Ge,j)=>{const Le=In(Ge),tt=In(Q),en={x:Le.x-tt.x,y:Le.y-tt.y},Xt=Go(Le,j,tt);return{x:Xt.x-tt.x-en.x,y:Xt.y-tt.y-en.y}},V=(Q,Ge,j,Le,tt)=>{if(Le==="left"&&!tt)return 0;const Xt=Q.width+Ge*2-j.width;return Le==="left"?Xt:Le==="center"?Xt*.5:Le==="right"?tt?0:Xt:0},dt=(Q,Ge)=>[Q,Q,Q,Q].map(j=>j*Ge),Ft=(Q,Ge,j)=>{let Le,tt;const en=fa(j.width,j.height);if(Q.backgroundRepeat==="repeat"&&(Le={...j},tt={x:0,y:0}),Q.backgroundSize==="contain"){const Xt=rr(Ge,en,Ge);Le=zs(Xt),Q.backgroundPosition?tt=Q.backgroundPosition:tt=re((Ge.width-Le.width)*.5,(Ge.height-Le.he
87ight)*.5)}else if(Q.backgroundSize==="cover"){const Xt=rs(Ge,en,Ge);Le=zs(Xt),Q.backgroundPosition?tt=Q.backgroundPosition:(tt=re(Xt.x,Xt.y),tt=re((Ge.width-Le.width)*.5,(Ge.height-Le.height)*.5))}else Q.backgroundSize?(Le=Q.backgroundSize,tt=Q.backgroundPosition||{x:0,y:0}):Q.backgroundPosition&&(Le={...j},tt=Q.backgroundPosition);return{backgroundSize:Le,backgroundPosition:tt}},We=(Q=[],Ge)=>{Q.forEach(j=>{let Le=Je(j);const tt=j.status==="complete"?!1:j.status==="loading"?!0:j.backgroundImage&&Le===j.backgroundImage;tt&&mt();const en=j.status==="error"?!0:j.backgroundImage&&Le instanceof Error;let Xt=D1(Le)?Le:void 0;const Ze=j._scale||1,tn=j._translate||f,Fn=j.strokeWidth&&j.strokeWidth*Ze,K=j.cornerRadius?dt(j.cornerRadius,Ze):u,J=!!j.width,xe=Nt(j.text),it=Si(j.points),Ye=$i(j);if(it){const ct=j.points.map(ot=>re(ot.x*Ze+tn.x,ot.y*Ze+tn.y));if(j.bitmap){Le&&Ge.push(Le);const ot=Qi(ct),Ct=Math.ceil(j.strokeWidth*Ze)+I2;U.drawRect({x:Math.floor(ot.x-Ct*.5),y:Math.floor(ot.y-Ct*.5),width:Math.ceil(ot.width+Ct),height:Math.ceil(ot.height+Ct)},j.rotation,j.flipX,j.flipY,[0,0,0,0],void 0,Xt,void 0,void 0,void 0,void 0,void 0,void 0,j.opacity,void 0,void 0,!1,!1)}else U.drawPath(ct,j.rotation,j.flipX,j.flipY,Fn,j.strokeColor,j.pathClose,j.backgroundColor,j.opacity)}else if(Ye){let ct=j.x,ot=j.y;ct*=Ze,ot*=Ze,ct+=tn.x,ot+=tn.y;const Ct=Pd({x:ct,y:ot,rx:j.rx*Ze,ry:j.ry*Ze}),cn=re(ct,ot),Qt=Xt&&U.textureGetSize(Xt);let _n,Bt;if(Qt&&j.backgroundImage&&(j.backgroundSize||j.backgroundPosition||j.backgroundRepeat)){const et=Ft(j,Ct,Qt);_n=et.backgroundSize,Bt=et.backgroundPosition}if(U.drawEllipse(cn,j.rx*Ze,j.ry*Ze,j.rotation,j.flipX,j.flipY,j.backgroundColor,Xt,_n,Bt,j.backgroundCorners&&R2(j.backgroundCorners),Fn,j.strokeColor,j.opacity,j.inverted),Le&&Ge.push(Le),tt||en){if(!j.backgroundColor&&(!j.strokeColor||!j.strokeWidth)){const et=j.opacity||1;U.drawEllipse(cn,j.rx*Ze,j.ry*Ze,j.rotation,j.flipX,j.flipY,en?[1,.2549,.2118,.25*et]:[0,0,0,.25*et])}en&&nn(cn),tt&&yt(cn)}}else if(xe){const{fontSize:ct=16}=j,ot=ct>1e3&&ja()?ct/1e3:1,Ct=Math.max(16,Math.ceil(ct/ot*.25)),cn=Math.abs(j.rotation)>0,Qt=Ht(j.width)?Math.floor(j.width):j.width,_n=Ht(j.height)?Math.floor(j.height):j.height,Bt=tr(j.text,{...j,width:Qt,height:_n}),et=Math.ceil(Bt.width),ri=Math.ceil(Bt.height),Gn={x:j.x*Ze+tn.x,y:j.y*Ze+tn.y,width:et*Ze,height:ri*Ze},Ri=!!j.height;(j.backgroundColor||j.strokeColor)&&U.drawRect(Gn,j.rotation,j.flipX,j.flipY,K,j.backgroundColor,void 0,void 0,void 0,!1,void 0,Fn,j.strokeColor,j.opacity,void 0,void 0,void 0,j.inverted);const{textShadowX:ai,textShadowY:ui,textShadowBlur:Yn}=j;
87if(ai||ui||Yn){const Dn=Math.ceil(Yn*.5),Vn=Math.max(Ct,Ri?0:Dn),ni=ye(j,{id:j.id+"shadow",blur:Yn,paddingTop:Vn,paddingRight:Vn,paddingBottom:Vn,paddingLeft:Vn});if(ni&&!j._prerender){Ge.push(ni);const Bn=U.textureGetSize(ni),qn={x:0,y:0},ii={width:Bn.width/I*Ze,height:Bn.height/I*Ze},pi=Ct*Ze/ot;let An;if(Ri)An={...Gn},qn.x=ai-pi,qn.y=ui-pi,j.textAlign==="right"?qn.x+=An.width-(ii.width-pi*2):j.textAlign==="center"&&(qn.x+=(An.width-(ii.width-pi*2))*.5);else{An={x:j.x*Ze+tn.x-pi,y:j.y*Ze+tn.y-pi,width:ii.width,height:ii.height};const Cn=V(Gn,pi,ii,j.textAlign,j.flipX);if(An.x+=Cn,cn){const _i=se(Gn,An,j.rotation);An.x+=_i.x,An.y+=_i.y;const fi=Go(re(ai,ui),j.rotation);An.x+=fi.x,An.y+=fi.y}else An.x+=ai,An.y+=ui}U.drawRect(An,j.rotation,j.flipX,j.flipY,[0,0,0,0],void 0,ni,ii,qn,!1,void 0,void 0,void 0,j.opacity,void 0,0,j.textShadowColor)}}if(j.textOutlineWidth){const Dn=Math.ceil(j.textOutlineWidth*.5),Vn=Ct+Dn,ni=ye(j,{id:j.id+"outline",outline:j.textOutlineWidth,paddingTop:Vn,paddingRight:Vn,paddingBottom:Vn,paddingLeft:Vn});if(ni&&!j._prerender){Ge.push(ni);const Bn=U.textureGetSize(ni),qn={x:0,y:0},ii={width:Bn.width/I*Ze,height:Bn.height/I*Ze},pi=(Ct+Dn)*Ze/ot,An={x:j.x*Ze+tn.x-pi,y:j.y*Ze+tn.y-pi,width:ii.width,height:j.height?ri+pi:ii.height},Cn=V(Gn,pi,ii,j.textAlign,j.flipX);if(An.x+=Cn,cn){const _i=se(Gn,An,j.rotation);An.x+=_i.x,An.y+=_i.y}U.drawRect(An,j.rotation,j.flipX,j.flipY,[0,0,0,0],void 0,ni,ii,qn,!1,void 0,void 0,void 0,j.opacity,void 0,0,j.textOutlineColor)}}const _t=ye(j,{id:j.id+"text",paddingTop:Ct,paddingRight:Ct,paddingBottom:Ct,paddingLeft:Ct});if(_t&&!j._prerender){Ge.push(_t);const Dn=U.textureGetSize(_t),Vn={x:0,y:0},ni={width:Dn.width/I*Ze,height:Dn.height/I*Ze},Bn=Ct*Ze/ot,qn={x:j.x*Ze+tn.x-Bn,y:j.y*Ze+tn.y-Bn,width:ni.width,height:j.height?ri+Bn:ni.height},ii=V(Gn,Bn,ni,j.textAlign,j.flipX);if(qn.x+=ii,cn){const An=se(Gn,qn,j.rotation);qn.x+=An.x,qn.y+=An.y}const pi=j.color||[0,0,0];j._prerender&&(pi[3]=0),U.drawRect(qn,j.rotation,j.flipX,j.flipY,u,!1,_t,ni,Vn,!1,!1,void 0,void 0,j.opacity,void 0,j.feather,pi,j.inverted)}}else if(J){Le&&Ge.push(Le);const ct=rl(j);tn&&(ct.x*=Ze,ct.y*=Ze,ct.x+=tn.x,ct.y+=tn.y,ct.width*=Ze,ct.height*=Ze);let ot,Ct;const{backgroundRepeat:cn="no-repeat"}=j,Qt=Xt&&U.textureGetSize(Xt);if(Qt&&j.backgroundImage&&(j.backgroundSize||j.backgroundPosition||j.backgroundRepeat)){const _n=Ft(j,ct,Qt);ot=_n.backgroundSize,Ct=_n.backgroundPosition}if(U.drawRect(ct,j.rotation,j.flipX,j.flipY,K,j.backgroundColor||[0,0,0,0],Xt,ot,Ct,cn==="repeat",j.backgroundCorners&&R2(j.backgroundCorners),Fn,j.strokeColor,j.opacity,void 0,j.feather,j.fillColor,j.inverted),tt||en){if((!j.backgroundColor||j.backgroundColor[3]===0)&&(!j.strokeColor||!j.strokeWidth)){const Bt=j.opacity||1;U.drawRect(ct,j.rotation,j.flipX,j.flipY,K,en?[1,.2549,.2118,.25*Bt]:[0,0,0,.25*Bt])}const _n=In(ct);en&&nn(_n),tt&&yt(_n)}}else Le&&Ge.push(Le)})};let Xe=0;const nt=[{x:-5,y:-5},{x:5,y:5}],wt=[{x:5,y:-5},{x:-5,y:5}],Zt=Yd({x:0,y:0},10,10,0,!1,!1,16);Zt.length=9;const yt=Q=>{Xe=Date.now()/50,U.drawEllipse(Q,15,15,0,!1,!1,[0,0,0,.5]);const Ge=Os(Zt.map(j=>({x:j.x+Q.x,y:j.y+Q.y})),Xe,Q.x,Q.y);U.drawPath(Ge,0,!1,!1,2,[1,1,1])},nn=Q=>{U.drawEllipse(Q,13,13,0,!1,!1,[1,.2549,.2118,.75]);const Ge=nt.map(Le=>({x:Le.x+Q.x,y:Le.y+Q.y})),j=wt.map(Le=>({x:Le.x+Q.x,y:Le.y+Q.y}));U.drawPath(Ge,0,!1,!1,3,[1,1,1]),U.drawPath(j,0,!1,!1,3,[1,1,1])},Jt=(Q,Ge,j,Le,tt,en)=>U.drawRect(Ge,0,!1,!1,u,u,Q,Le,j,!0,void 0,0,void 0,en,void 0,void 0,tt),yn=(Q,Ge,j,Le,tt)=>{const en=Ci(Ge,Ge),Xt=je(d,"pixelated","repeat"),Ze=re(-Q.x%Ge,-Q.y%Ge),tn=re(Ze.x+en.width*.5,Ze.y);Jt(Xt,Q,Ze,en,j,tt),Jt(Xt,Q,tn,en,Le,tt)};let an=!1,Tt=!0,Sn=!1;const ln=[],sn=[],ke=[],Re=Q=>!Q.aboveFrame,Lt=Q=>Q.aboveFrame,fn=()=>{ke.length=0;const Q=ge[0],{manipulationShapes:Ge,manipulationShapesDirty:j,annotationShapes:Le,annotationShapesDirty:tt,interfaceShapes:en,decorationShapes:Xt,frameShapes:Ze,selectionShapes:tn}=T({opacity:Q.opacity,rotation:Q.rotation,scale:Q.scale,images:ge,size:Ci(ae,be),backgroundColor:[...c],selectionRect:s}),Fn=[...c],K=s,J=Xn(l,0,1),xe=a,it=Math.abs(-1+Q.rotation.x/Math.PI*2),Ye=Math.abs(-1+Q.rotation.y/Math.PI*2),ct=it<.99||Ye<.99,ot={...Q.size},Ct=Q.backgroundColor,cn=Q.backgroundImage,Qt=Q.backgroundFilterMode,_n=Ge.length>0,Bt=Le.length>
870,et=Le.filter(Lt).length>0,ri=Xt.filter(Lt).length>0,Gn=Ct[3]>0,Ri=J<1,ai=C?P>=1:!1;if(Ri&&Gn){const _t=Fn[0],Dn=Fn[1],Vn=Fn[2],ni=1-J,Bn=Ct[0]*ni,qn=Ct[1]*ni,ii=Ct[2]*ni,pi=1-ni;Fn[0]=Bn+_t*pi,Fn[1]=qn+Dn*pi,Fn[2]=ii+Vn*pi,Fn[3]=1}U.setCanvasColor(p?u:Fn),_n&&(j||an)?(U.disableMask(),U.drawToImageBlendBuffer(ot),ln.length=0,We(Ge,ln)):_n||(ln.length=0),ke.push(...ln),Tt&&(U.drawToImageOverlayBuffer(ot,I),Tt=!1);const Yn=Bt&&(tt||an);if(ct){if(Yn||!Sn){U.disableMask(),U.drawToImageOverlayBuffer(ot,I),sn.length=0;const _t=et?Le.filter(Re):Le;We(_t,sn)}else Bt||(sn.length=0);Sn=!0}else Sn=!1;if(U.drawToCanvas(),U.enableMask(K,J),W&&S>=1&&$.length===2&&pe&&yn(K,S,$[0],$[1],pe),Gn&&U.drawRect(K,0,!1,!1,u,Ct),cn){U.enableMask(K,1);const _t=Math.max(y.width/cn.width,y.height/cn.height);cn.width*_t,cn.height*_t;const Dn={x:y.x+y.width*.5,y:y.y+y.height*.5},[Vn]=ge,ni=Ie({...Vn,vignette:Qt==="image"?Vn.vignette:void 0,gamma:Qt==="image"?Vn.gamma:void 0,convolutionMatrix:Qt==="image"?Vn.convolutionMatrix:void 0,colorMatrix:Qt==="image"?Vn.colorMatrix:void 0,size:{width:cn.width,height:cn.height},translation:{x:Dn.x-ae*.5,y:Dn.y-be*.5},scale:_t,origin:{x:0,y:0},rotation:{x:0,y:0,z:0},enableAntialiasing:!1,texture:je(cn)});ke.push(ni),U.enableMask(K,J)}if(ai&&U.enablePreviewStencil(),ke.push(...[...ge].reverse().map(_t=>Ie({..._t,texture:je(_t.data),enableOverlay:ct&&Bt,enableManipulation:_n,enableAntialiasing:!0,overlayColor:xe}))),U.enableMask(K,P),!ct){ai&&U.applyPreviewStencil(),U.resetCanvasMatrix(),U.updateCanvasMatrix(ot,Q.origin,Q.translation,Q.scale,Q.rotation),sn.length=0;const _t=et?Le.filter(Re):Le;We(_t,sn),ai&&U.disablePreviewStencil()}if(ke.push(...sn),U.resetCanvasMatrix(),U.enableMask(K,P),We(ri?Xt.filter(Re):Xt,ke),Ze.length){U.enableMask(K,1);const _t=Ze.filter(Vn=>!Vn.expandsCanvas),Dn=Ze.filter(Vn=>Vn.expandsCanvas);_t.length&&We(_t,ke),Dn.length&&(U.enableMask({x:K.x+.5,y:K.y+.5,width:K.width-1,height:K.height-1},r),We(Dn,ke))}if(et&&(U.resetCanvasMatrix(),U.updateCanvasMatrix(ot,Q.origin,Q.translation,Q.scale,Q.rotation),We(Le.filter(Lt),ke),U.resetCanvasMatrix()),ri&&(U.resetCanvasMatrix(),We(Xt.filter(Lt),ke),U.resetCanvasMatrix()),Fe&&tn.length&&!ct){U.resetCanvasMatrix(),U.updateCanvasMatrix(ot,Q.origin,Q.translation,Q.scale,Q.rotation);const _t=[...Fe];_t[3]=.5;const Dn=[{id:"selection",color:_t,actions:[...tn]}].map(Vn=>qe(Vn,ot));We(Dn,ke),U.resetCanvasMatrix()}U.disableMask(),We(en,ke),de.forEach(_t=>{if(U.enableMask(_t.mask,_t.maskOpacity),cn){const Vn=Ie({..._t,vignette:Qt==="image"?_t.vignette:void 0,gamma:Qt==="image"?_t.gamma:void 0,convolutionMatrix:Qt==="image"?_t.convolutionMatrix:void 0,colorMatrix:Qt==="image"?_t.colorMatrix:void 0,texture:je(cn),enableAntialiasing:!1,translation:{x:_t.translation.x+_t.offset.x-ae*.5,y:_t.translation.y+_t.offset.y-be*.5}});ke.push(Vn)}
87else _t.backgroundColor&&U.drawRect(_t.mask,0,!1,!1,_t.maskCornerRadius,_t.backgroundColor,void 0,void 0,void 0,void 0,void 0,void 0,void 0,_t.opacity,_t.maskFeather);const Dn=Ie({..._t,texture:je(_t.data),enableAntialiasing:!1,translation:{x:_t.translation.x+_t.offset.x-ae*.5,y:_t.translation.y+_t.offset.y-be*.5}});ke.push(Dn)}),U.disableMask(),q(ke),v(),an=!1};let on=0,En;const bt=()=>{clearTimeout(En);const Q=Date.now();if(Q-on<E2){En=setTimeout(bt,E2);return}on=Q,fn()},Un=()=>og()?bt:fn;sT(()=>o()),ss(()=>n(31,U=l6(X,{alpha:p}))),Jr(()=>{U&&($e.forEach(({canvas:Q})=>Wi(Q)),$e.clear(),U.release(),n(31,U=void 0),n(0,X=void 0))});function Hn(Q){vn[Q?"unshift":"push"](()=>{X=Q,n(0,X)})}const $n=Q=>{n(1,ae=Q.detail.width),n(2,be=Q.detail.height),m("measure",{width:ae,height:be})};return e.$$set=Q=>{"isAnimated"in Q&&n(9,g=Q.isAnimated),"isTransparent"in Q&&n(10,p=Q.isTransparent),"maskRect"in Q&&n(11,y=Q.maskRect),"maskOpacity"in Q&&n(12,w=Q.maskOpacity),"maskFrameOpacity"in Q&&n(13,_=Q.maskFrameOpacity),"maskMarkupOpacity"in Q&&n(14,P=Q.maskMarkupOpacity),"clipAnnotationsToImage"in Q&&n(15,C=Q.clipAnnotationsToImage),"pixelRatio"in Q&&n(16,R=Q.pixelRatio),"textPixelRatio"in Q&&n(17,I=Q.textPixelRatio),"backgroundColor"in Q&&n(18,M=Q.backgroundColor),"willRender"in Q&&n(19,T=Q.willRender),"didRender"in Q&&n(20,v=Q.didRender),"willRequest"in Q&&n(21,H=Q.willRequest),"csp"in Q&&n(22,Y=Q.csp),"loadImageData"in Q&&n(23,Z=Q.loadImageData),"enableGrid"in Q&&n(24,W=Q.enableGrid),"gridColors"in Q&&n(25,$=Q.gridColors),"gridSize"in Q&&n(26,S=Q.gridSize),"gridOpacity"in Q&&n(27,pe=Q.gridOpacity),"images"in Q&&n(28,ge=Q.images),"interfaceImages"in Q&&n(29,de=Q.interfaceImages),"selectionColor"in Q&&n(30,Fe=Q.selectionColor)},e.$$.update=()=>{if(e.$$.dirty[0]&1&&X){const Q=getComputedStyle(X).getPropertyValue("--color-transition-duration");n(32,Mt=y6(Q))}e.$$.dirty[0]&262656|e.$$.dirty[1]&2&&M&&gt.set(M,{duration:g?Mt:0}),e.$$.dirty[0]&4096&&ft(ie,Ht(w)?w:1),e.$$.dirty[0]&8192&&ft(N,Ht(_)?_:1),e.$$.dirty[0]&2048&&y&&le.set(y),e.$$.dirty[1]&48&&c&&Te.set([c[0],c[1],c[2],Xn(l,0,1)]),e.$$.dirty[0]&268435462|e.$$.dirty[1]&1&&n(34,i=!!(U&&ae&&be&&ge.length)),e.$$.dirty[0]&65542|e.$$.dirty[1]&1&&ae&&be&&U&&(on=0,U.resize(ae,be,R)),e.$$.dirty[1]&8&&n(33,o=i?Un():st),e.$$.dirty[1]&12&&i&&o&&o()},[X,ae,be,m,gt,ie,N,le,Te,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de,Fe,U,Mt,o,i,l,c,Hn,$n]}class C6 extends gn{constructor(t){super(),mn(this,t,k6,_6,rn,{isAnimated:9,isTransparent:10,maskRect:11,maskOpacity:12,maskFrameOpacity:13,maskMarkupOpacity:14,clipAnnotationsToImage:15,pixelRatio:16,textPixelRatio:17,backgroundColor:18,willRender:19,didRender:20,willRequest:21,csp:22,loadImageData:23,enableGrid:24,gridColors:25,gridSize:26,gridOpacity:27,images:28,interfaceImages:29,selectionColor:30},null,[-1,-1,-1])}}var pn=(e,t=Boolean,n=" ")=>e.filter(t).join(n);function A2(e,t,n){const i=e.slice();return i[17]=t[n],i}const P6=e=>({tab:e&4}),L2=e=>({tab:e[17]});function x2(e){let t,n=[],i=new Map,o,r,a=xo(e[2]);const l=s=>s[17].id;for(let s=0;s<a.length;s+=1){let c=A2(e,a,s),u=l(c);i.set(u,n[s]=F2(u,c))}return{c(){t=fe("div");for(let s=0;s<n.length;s+=1)n[s].c();k(t,"class",o=pn(["PinturaTabList",e[0]])),k(t,"role","tablist"),k(t,"data-layout",e[1])},m(s,c){te(s,t,c);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(t,null);e[14](t),r=!0},p(s,c){c&1124&&(a=xo(s[2]),Et(),n=cl(n,c,l,1,s,a,i,t,cs,F2,null,A2),At()),(!r||c&1&&o!==(o=pn(["PinturaTabList",s[0]])))&&k(t,"class",o),(!r||c&2)&&k(t,"data-layout",s[1])},i(s){if(!r){for(let c=0;c<a.length;c+=1)L(n[c]);r=!0}},o(s){for(let c=0;c<n.length;c+=1)z(n[c]);r=!1},d(s){s&&ee(t);for(let c=0;c<n.length;c+=1)n[c].d();e[14](null)}}}function F2(e,t){let n,i,o,r,a,l,s,c,u,f;const d=t[11].default,m=lo(d,t,t[10],L2);function g(...y){return t[12](t[17],...y)}function p(...y){return t[13](t[17],...y)}return{key:e,first:null,c(){n=fe("button"),m&&m.c(),i=ut(),k(n,"role","tab"),k(n,"title",o=t[17].title),k(n,"id",r=t[17].tabId),k(n,"aria-controls",a=t[17].href.substring(1)),k(n,"aria-selected",l=t[17].selected),n.disabled=s=t[17].disabled,k(n,"type","button"),this.first=n},m(y,w){te(y,n,w),m&&m.m(n,null),Ae(n,i),c=!0,u||(f=[Pe(n,"keydown",g),Pe(n,"click",p)],u=!0)},p(y,w){t=y,m&&m.p&&(!c||w&1028)&&co(m,d,t,t[10],c?so(d,t[10],w,P6):uo(t[10]),L2),(!c||w&4&&o!==(o=t[17].title))&&k(n,"title",o),(!c||w&4&&r!==(r=t[17].tabId))&&k(n,"id",r),(!c||w&4&&a!==(a=t[17].href.substring(1)))&&k(n,"aria-controls",a),(!c||w&4&&l!==(l=t[17].selected))&&k(n,"aria-selected",l),(!c||w&4&&s!==(s=t[17].disabled))&&(n.disabled=s)},i(y){c||(L(m,y),c=!0)},o(y){z(m,y),c=!1},d(y){y&&ee(n),m&&m.d(y),u=!1,On(f)}}}function M6(e){let t,n,i=e[4]&&x2(e);return{c(){i&&i.c(),t=Mi()},m(o,r){i&&i.m(o,r),te(o,t,r),n=!0},p(o,[r]){o[4]?i?(i.p(o,r),r&16&&L(i,1)):(i=x2(o),i.c(),L(i,1),i.m(t.parentNode,t)):i&&(Et(),z(i,1,1,()=>{i=null}),At())},i(o){n||(L(i),n=!0)},o(o){z(i),n=!1},d(o){o&&ee(t),i&&i.d(o)}}}function R6(e,t,n){let i,o,{$$slots:r={},$$scope:a}=t,l,{class:s=void 0}=t,{name:c}=t,{selected:u}=t,{tabs:f=[]}=t,{layout:d=void 0}=t;const m=Xa(),g=C=>{const R=l.querySelectorAll('[role="tab"] button')[C];R&&R.focus()},p=(C,R)=>
87{C.preventDefault(),C.stopPropagation(),Za()&&C.target.focus(),m("select",R)},y=({key:C},R)=>{if(!/arrow/i.test(C))return;const I=f.findIndex(M=>M.id===R);if(/right|down/i.test(C))return g(I<f.length-1?I+1:0);if(/left|up/i.test(C))return g(I>0?I-1:f.length-1)},w=(C,R)=>y(R,C.id),_=(C,R)=>p(R,C.id);function P(C){vn[C?"unshift":"push"](()=>{l=C,n(3,l)})}return e.$$set=C=>{"class"in C&&n(0,s=C.class),"name"in C&&n(7,c=C.name),"selected"in C&&n(8,u=C.selected),"tabs"in C&&n(9,f=C.tabs),"layout"in C&&n(1,d=C.layout),"$$scope"in C&&n(10,a=C.$$scope)},e.$$.update=()=>{e.$$.dirty&896&&n(2,i=f.map(C=>{const R=C.id===u;return{...C,tabId:`tab-${c}-${C.id}`,href:`#panel-${c}-${C.id}`,selected:R}})),e.$$.dirty&4&&n(4,o=i.length>1)},[s,d,i,l,o,p,y,c,u,f,a,r,w,_,P]}class eh extends gn{constructor(t){super(),mn(this,t,R6,M6,rn,{class:0,name:7,selected:8,tabs:9,layout:1})}}var Il=(e,t)=>{if(!t)return;const n=i=>{oy(e,i)};return n(t),{update:n}};const I6=e=>({panel:e&16}),v2=e=>({panel:e[4][0].id,panelIsActive:!0});function O2(e,t,n){const i=e.slice();return i[14]=t[n].id,i[15]=t[n].shouldDraw,i[16]=t[n].panelId,i[17]=t[n].labelledBy,i[18]=t[n].isActive,i[19]=t[n].hidden,i[3]=t[n].visible,i}const E6=e=>({panel:e&16,panelIsActive:e&16}),D2=e=>({panel:e[14],panelIsActive:e[18]});function A6(e){let t,n,i,o,r,a,l;const s=e[11].default,c=lo(s,e,e[10],v2);return{c(){t=fe("div"),n=fe("div"),c&&c.c(),k(n,"class",i=pn([e[1]])),k(t,"class",e[0])},m(u,f){te(u,t,f),Ae(t,n),c&&c.m(n,null),r=!0,a||(l=[wn(o=Il.call(null,t,e[2])),Pe(t,"measure",e[13]),wn(Fo.call(null,t))],a=!0)},p(u,f){c&&c.p&&(!r||f&1040)&&co(c,s,u,u[10],r?so(s,u[10],f,I6):uo(u[10]),v2),(!r||f&2&&i!==(i=pn([u[1]])))&&k(n,"class",i),(!r||f&1)&&k(t,"class",u[0]),o&&kn(o.update)&&f&4&&o.update.call(null,u[2])},i(u){r||(L(c,u),r=!0)},o(u){z(c,u),r=!1},d(u){u&&ee(t),c&&c.d(u),a=!1,On(l)}}}function L6(e){let t,n=[],i=new Map,o,r,a,l,s,c=xo(e[4]);const u=f=>f[14];for(let f=0;f<c.length;f+=1){let d=O2(e,c,f),m=u(d);i.set(m,n[f]=z2(m,d))}return{c(){t=fe("div");for(let f=0;f<n.length;f+=1)n[f].c();k(t,"class",o=pn(["PinturaTabPanels",e[0]]))},m(f,d){te(f,t,d);for(let m=0;m<n.length;m+=1)n[m]&&n[m].m(t,null);a=!0,l||(s=[wn(r=Il.call(null,t,e[2])),Pe(t,"measure",e[12]),wn(Fo.call(null,t,{observePosition:!0}))],l=!0)},p(f,d){d&1042&&(c=xo(f[4]),Et(),n=cl(n,d,u,1,f,c,i,t,cs,z2,null,O2),At()),(!a||d&1&&o!==(o=pn(["PinturaTabPanels",f[0]])))&&k(t,"class",o),r&&kn(r.update)&&d&4&&r.update.call(null,f[2])},i(f){if(!a){for(let d=0;d<c.length;d+=1)L(n[d]);a=!0}},o(f){for(let d=0;d<n.length;d+=1)z(n[d]);a=!1},d(f){f&&ee(t);for(let d=0;d<n.length;d+=1)n[d].d();l=!1,On(s)}}}function B2(e){let t;const n=e[11].default,i=lo(n,e,e[10],D2);return{c(){i&&i.c()},m(o,r){i&&i.m(o,r),t=!0},p(o,r){i&&i.p&&(!t||r&1040)&&co(i,n,o,o[10],t?so(n,o[10],r,E6):uo(o[10]),D2)},i(o){t||(L(i,o),t=!0)},o(o){z(i,o),t=!1},d(o){i&&i.d(o)}}}function z2(e,t){let n,i,o,r,a,l,s,c,u=t[15]&&B2(t);return{key:e,first:null,c(){n=fe("div"),u&&u.c(),i=ut(),k(n,"id",o=t[16]),k(n,"class",r=pn(["PinturaTabPanel",t[1]])),k(n,"aria-hidden",a=t[19]),k(n,"aria-labelledby",l=t[17]),k(n,"data-inert",s=!t[3]),k(n,"role","tabpanel"),this.first=n},m(f,d){te(f,n,d),u&&u.m(n,null),Ae(n,i),c=!0},p(f,d){t=f,t[15]?u?(u.p(t,d),d&16&&L(u,1)):(u=B2(t),u.c(),L(u,1),u.m(n,i)):u&&(Et(),z(u,1,1,()=>{u=null}),At()),(!c||d&16&&o!==(o=t[16]))&&k(n,"id",o),(!c||d&2&&r!==(r=pn(["PinturaTabPanel",t[1]])))&&k(n,"class",r),(!c||d&16&&a!==(a=t[19]))&&k(n,"aria-hidden",a),(!c||d&16&&l!==(l=t[17]))&&k(n,"aria-labelledby",l),(!c||d&16&&s!==(s=!t[3]))&&k(n,"data-inert",s)},i(f){c||(L(u),c=!0)},o(f){z(u),c=!1},d(f){f&&ee(n),u&&u.d()}}}function x6(e){let t,n,i,o;const r=[L6,A6],a=[];function l(s,c){return s[5]?0:1}return t=l(e),n=a[t]=r[t](e),{c(){n.c(),i=Mi()},m(s,c){a[t].m(s,c),te(s,i,c),o=!0},p(s,[c]){let u=t;t=l(s),t===u?a[t].p(s,c):(Et(),z(a[u],1,1,()=>{a[u]=null}),At(),n=a[t],n?n.p(s,c):(n=a[t]=r[t](s),n.c()),L(n,1),n.m(i.parentNode,i))},i(s){o||(L(n),o=!0)},o(s){z(n),o=!1},d(s){s&&ee(i),a[t].d(s)}}}function F6(e,t,n){let i,o,{$$slots:r={},$$scope:a}=t,{class:l=void 0}=t,{name:s}=t,{selected:c}=t,{panelClass:u=void 0}=t,{panels:f=[]}=t,{visible:d=void 0}=t,{style:m=void 0}=t;const g={};function p(w){Zo.call(this,e,w)}function y(w){Zo.call(this,e,w)}return e.$$set=w=>{"class"in w&&n(0,l=w.class),"name"in w&&n(6,s=w.name),"selected"in 
87w&&n(7,c=w.selected),"panelClass"in w&&n(1,u=w.panelClass),"panels"in w&&n(8,f=w.panels),"visible"in w&&n(3,d=w.visible),"style"in w&&n(2,m=w.style),"$$scope"in w&&n(10,a=w.$$scope)},e.$$.update=()=>{e.$$.dirty&968&&n(4,i=f.map(w=>{const _=w===c;_&&n(9,g[w]=!0,g);const P=d?d.indexOf(w)!==-1:_;return{id:w,panelId:`panel-${s}-${w}`,labelledBy:`tab-${s}-${w}`,isActive:_,hidden:!_,visible:P,shouldDraw:_||g[w]}})),e.$$.dirty&16&&n(5,o=i.length>1)},[l,u,m,d,i,o,s,c,f,g,a,r,p,y]}class th extends gn{constructor(t){super(),mn(this,t,F6,x6,rn,{class:0,name:6,selected:7,panelClass:1,panels:8,visible:3,style:2})}}var rg=e=>{const t=Object.getOwnPropertyDescriptors(e.prototype);return Object.keys(t).filter(n=>!!t[n].get)};function V2(e){let t,n,i,o;const r=[e[5],{locale:e[1]}];function a(c){e[22](c)}var l=e[10];function s(c,u){let f={};for(let d=0;d<r.length;d+=1)f=wi(f,r[d]);return u!==void 0&&u[0]&34&&(f=wi(f,fo(r,[u[0]&32&&yo(c[5]),u[0]&2&&{locale:c[1]}]))),c[3]!==void 0&&(f.name=c[3]),{props:f}}return l&&(t=Ud(l,s(e)),vn.push(()=>Cr(t,"name",a)),e[23](t),t.$on("measure",e[11])),{c(){t&&Ve(t.$$.fragment),i=Mi()},m(c,u){t&&ve(t,c,u),te(c,i,u),o=!0},p(c,u){if(l!==(l=c[10])){if(t){Et();const f=t;z(f.$$.fragment,1,0,()=>{Oe(f,1)}),At()}l?(t=Ud(l,s(c,u)),vn.push(()=>Cr(t,"name",a)),c[23](t),t.$on("measure",c[11]),Ve(t.$$.fragment),L(t.$$.fragment,1),ve(t,i.parentNode,i)):t=null}else if(l){const f=u[0]&34?fo(r,[u[0]&32&&yo(c[5]),u[0]&2&&{locale:c[1]}]):{};!n&&u[0]&8&&(n=!0,f.name=c[3],Dr(()=>n=!1)),t.$set(f)}},i(c){o||(t&&L(t.$$.fragment,c),o=!0)},o(c){t&&z(t.$$.fragment,c),o=!1},d(c){c&&ee(i),e[23](null),t&&Oe(t,c)}}}function v6(e){let t,n,i,o=e[6]&&V2(e);return{c(){t=fe("div"),o&&o.c(),k(t,"data-util",e[3]),k(t,"class",n=pn(["PinturaUtilPanel",e[2]])),Ee(t,"opacity",e[7])},m(r,a){te(r,t,a),o&&o.m(t,null),e[24](t),i=!0},p(r,a){r[6]?o?(o.p(r,a),a[0]&64&&L(o,1)):(o=V2(r),o.c(),L(o,1),o.m(t,null)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),(!i||a[0]&8)&&k(t,"data-util",r[3]),(!i||a[0]&4&&n!==(n=pn(["PinturaUtilPanel",r[2]])))&&k(t,"class",n),a[0]&128&&Ee(t,"opacity",r[7])},i(r){i||(L(o),i=!0)},o(r){z(o),i=!1},d(r){r&&ee(t),o&&o.d(),e[24](null)}}}function O6(e,t,n){let i,o,r,a,l;const s=Xa();let{isActive:c=!0}=t,{stores:u}=t,{view:f}=t,{props:d}=t,{component:m}=t,{locale:g}=t,{class:p=void 0}=t;const y=Qn("isAnimated");B(e,y,ae=>n(21,l=ae));let w;const _=hn(0),P=Ln(_,ae=>Xn(ae,0,1));B(e,P,ae=>n(20,a=ae));let C=!c;const R=ht(c),I=Ln(R,async(ae,be)=>{if(!ae)return be(ae);await hS(),be(ae)},!1),M=Ln(P,ae=>ae),T=Ln(P,ae=>ae>0),v={isActive:I,isActiveFraction:M,isVisible:T},H=f,Y=rg(H),Z=Object.keys(d||{}).reduce((ae,be)=>(Y.includes(be)&&(ae[be]=d[be]),ae),{}),W=Object.keys(v).reduce((ae,be)=>(Y.includes(be)&&(ae[be]=v[be]),ae),{});let $,S;const pe=ae=>{n(17,w={...ae.detail}),!(!de||!c)&&s("measure",{...w})};sr("measurable",Fo);const ge=cT();let de=!1;ss(()=>{if(n(19,de=!0),r)return;n(0,m=new H({target:S,props:{...o,locale:g},context:ge})),n(3,$=m.name);const ae=m.$on("measure",pe);return()=>{ae(),m.$destroy()}});function Fe(ae){$=ae,n(3,$)}function X(ae){vn[ae?"unshift":"push"](()=>{m=ae,n(0,m)})}function U(ae){vn[ae?"unshift":"push"](()=>{S=ae,n(4,S)})}return e.$$set=ae=>{"isActive"in ae&&n(12,c=ae.isActive),"stores"in ae&&n(13,u=ae.stores),"view"in ae&&n(14,f=ae.view),"props"in ae&&n(15,d=ae.props),"component"in ae&&n(0,m=ae.component),"locale"in ae&&n(1,g=
87ae.locale),"class"in ae&&n(2,p=ae.class)},e.$$.update=()=>{e.$$.dirty[0]&135169&&w&&c&&m&&s("measure",w),e.$$.dirty[0]&2101248&&_.set(c?1:0,{hard:l===!1}),e.$$.dirty[0]&1310720&&(a<=0&&!C?n(18,C=!0):a>0&&C&&n(18,C=!1)),e.$$.dirty[0]&786432&&de&&s(C?"hide":"show"),e.$$.dirty[0]&1048576&&s("fade",a),e.$$.dirty[0]&1048576&&n(7,i=a),e.$$.dirty[0]&4096&&R.set(c),e.$$.dirty[0]&8192&&n(5,o={...Z,...W,stores:u})},n(6,r=!Y.includes("external")),[m,g,p,$,S,o,r,i,y,P,H,pe,c,u,f,d,_,w,C,de,a,l,Fe,X,U]}class WS extends gn{constructor(t){super(),mn(this,t,O6,v6,rn,{isActive:12,stores:13,view:14,props:15,component:0,locale:1,class:2,opacity:16},null,[-1,-1])}get opacity(){return this.$$.ctx[16]}}function D6(e){let t,n,i,o,r,a;const l=e[5].default,s=lo(l,e,e[4],null);return{c(){t=Ao("svg"),s&&s.c(),k(t,"class",e[3]),k(t,"width",e[0]),k(t,"height",e[1]),k(t,"viewBox",n="0 0 "+e[0]+`
88    `+e[1]),k(t,"xmlns","http://www.w3.org/2000/svg"),k(t,"aria-hidden","true"),k(t,"focusable","false"),k(t,"stroke-linecap","round"),k(t,"stroke-linejoin","round")},m(c,u){te(c,t,u),s&&s.m(t,null),o=!0,r||(a=wn(i=Il.call(null,t,e[2])),r=!0)},p(c,[u]){s&&s.p&&(!o||u&16)&&co(s,l,c,c[4],o?so(l,c[4],u,null):uo(c[4]),null),(!o||u&8)&&k(t,"class",c[3]),(!o||u&1)&&k(t,"width",c[0]),(!o||u&2)&&k(t,"height",c[1]),(!o||u&3&&n!==(n="0 0 "+c[0]+`
89    `+c[1]))&&k(t,"viewBox",n),i&&kn(i.update)&&u&4&&i.update.call(null,c[2])},i(c){o||(L(s,c),o=!0)},o(c){z(s,c),o=!1},d(c){c&&ee(t),s&&s.d(c),r=!1,a()}}}function B6(e,t,n){let{$$slots:i={},$$scope:o}=t,{width:r=24}=t,{height:a=24}=t,{style:l=void 0}=t,{class:s=void 0}=t;return e.$$set=c=>{"width"in c&&n(0,r=c.width),"height"in c&&n(1,a=c.height),"style"in c&&n(2,l=c.style),"class"in c&&n(3,s=c.class),"$$scope"in c&&n(4,o=c.$$scope)},[r,a,l,s,o,i]}class Br extends gn{constructor(t){super(),mn(this,t,B6,D6,rn,{width:0,height:1,style:2,class:3})}}var US=(e,t)=>t===e.target||t.contains(e.target),z6=e=>e.map(t=>t==="CMD"?Hu()?"⌘":"Ctrl":t).join("+"),Gd=(e,t,n)=>{const i=Nt(t)?t:e;return n?`${i} (${z6(n)})`:i};const{document:W2}=sS;function V6(e){let t,n,i,o;return{c(){t=ut(),n=fe("button"),k(n,"class","PinturaImageButton"),k(n,"type","button"),k(n,"title",e[1]),n.disabled=e[2]},m(r,a){te(r,t,a),te(r,n,a),n.innerHTML=e[0],e[11](n),i||(o=[Pe(W2.body,"load",e[5],!0),Pe(W2.body,"error",e[6],!0),Pe(n,"pointerdown",e[4])],i=!0)},p(r,[a]){a&1&&(n.innerHTML=r[0]),a&2&&k(n,"title",r[1]),a&4&&(n.disabled=r[2])},i:qt,o:qt,d(r){r&&(ee(t),ee(n)),e[11](null),i=!1,On(o)}}}function W6(e,t,n){let{html:i}=t,{title:o}=t,{onclick:r}=t,{disabled:a=!1}=t,{ongrab:l=st}=t,{ondrag:s=st}=t,{ondrop:c=st}=t,u;const f=C=>xr(d,re(C.pageX,C.pageY))<256;let d;const m=C=>{d=re(C.pageX,C.pageY),l(C),document.documentElement.addEventListener("pointermove",p),document.documentElement.addEventListener("pointerup",g)},g=C=>{document.documentElement.removeEventListener("pointermove",p),document.documentElement.removeEventListener("pointerup",g);const R=re(C.pageX,C.pageY);if(xr(d,R)<32)return r(C);f(C)||c(C)},p=C=>{f(C)||s(C)},y=C=>u&&u.contains(C)&&C.nodeName==="IMG",w=({target:C})=>{y(C)&&n(3,u.dataset.load=!0,u)},_=({target:C})=>{y(C)&&n(3,u.dataset.error=!0,u)};function P(C){vn[C?"unshift":"push"](()=>{u=C,n(3,u)})}return e.$$set=C=>{"html"in C&&n(0,i=C.html),"title"in C&&n(1,o=C.title),"onclick"in C&&n(7,r=C.onclick),"disabled"in C&&n(2,a=C.disabled),"ongrab"in C&&n(8,l=C.ongrab),"ondrag"in C&&n(9,s=C.ondrag),"ondrop"in C&&n(10,c=C.ondrop)},e.$$.update=()=>{e.$$.dirty&8&&u&&u.querySelector("img")&&n(3,u.dataset.loader=!0,u)},[i,o,a,u,m,w,_,r,l,s,c,P]}class HS extends gn{constructor(t){super(),mn(this,t,W6,V6,rn,{html:0,title:1,onclick:7,disabled:2,ongrab:8,ondrag:9,ondrop:10})}}function U2(e,t,n){const i=e.slice();return i[13]=t[n],i}function H2(e,t){let n,i,o,r,a,l,s;function c(){return t[9](t[13])}function u(...m){return t[10](t[13],...m)}function f(...m){return t[11](t[13],...m)}function d(...m){return t[12](t[13],...m)}return i=new HS({props:{onclick:c,ongrab:u,ondrag:f,ondrop:d,disabled:t[1]||t[13].disabled,title:t[13].title,html:t[13].thumb}}),{key:e,first:null,c(){n=fe("li"),Ve(i.$$.fragment),o=ut(),Ee(n,"opacity",t[6]),this.first=n},m(m,g){te(m,n,g),ve(i,n,null),Ae(n,o),a=!0,l||(s=wn(r=t[8].call(null,n,t[13])),l=!0)},p(m,g){t=m;const p={};g&5&&(p.onclick=c),g&9&&(p.ongrab=u),g&17&&(p.ondrag=f),g&33&&(p.ondrop=d),g&3&&(p.disabled=t[1]||t[13].disabled),g&1&&
89(p.title=t[13].title),g&1&&(p.html=t[13].thumb),i.$set(p),r&&kn(r.update)&&g&1&&r.update.call(null,t[13]),g&64&&Ee(n,"opacity",t[6])},i(m){a||(L(i.$$.fragment,m),a=!0)},o(m){z(i.$$.fragment,m),a=!1},d(m){m&&ee(n),Oe(i),l=!1,s()}}}function U6(e){let t,n=[],i=new Map,o,r=xo(e[0]);const a=l=>l[13].id;for(let l=0;l<r.length;l+=1){let s=U2(e,r,l),c=a(s);i.set(c,n[l]=H2(c,s))}return{c(){t=fe("ul");for(let l=0;l<n.length;l+=1)n[l].c();k(t,"class","PinturaImageButtonList")},m(l,s){te(l,t,s);for(let c=0;c<n.length;c+=1)n[c]&&n[c].m(t,null);o=!0},p(l,[s]){s&127&&(r=xo(l[0]),Et(),n=cl(n,s,a,1,l,r,i,t,cs,H2,null,U2),At())},i(l){if(!o){for(let s=0;s<r.length;s+=1)L(n[s]);o=!0}},o(l){for(let s=0;s<n.length;s+=1)z(n[s]);o=!1},d(l){l&&ee(t);for(let s=0;s<n.length;s+=1)n[s].d()}}}function H6(e,t,n){let i,{items:o}=t,{disabled:r=void 0}=t,{onclickitem:a}=t,{ongrabitem:l=void 0}=t,{ondragitem:s=void 0}=t,{ondropitem:c=void 0}=t;const u=hn(0,{stiffness:.25,damping:.9});B(e,u,y=>n(6,i=y));const f=(y,w)=>w.mount&&w.mount(y.firstChild,w);ss(()=>u.set(1));const d=y=>a(y.id),m=(y,w)=>l&&l(y.id,w),g=(y,w)=>s&&s(y.id,w),p=(y,w)=>c&&c(y.id,w);return e.$$set=y=>{"items"in y&&n(0,o=y.items),"disabled"in y&&n(1,r=y.disabled),"onclickitem"in y&&n(2,a=y.onclickitem),"ongrabitem"in y&&n(3,l=y.ongrabitem),"ondragitem"in y&&n(4,s=y.ondragitem),"ondropitem"in y&&n(5,c=y.ondropitem)},[o,r,a,l,s,c,i,u,f,d,m,g,p]}class ag extends gn{constructor(t){super(),mn(this,t,H6,U6,rn,{items:0,disabled:1,onclickitem:2,ongrabitem:3,ondragitem:4,ondropitem:5})}}var Fu=()=>zo()&&window.devicePixelRatio||1;let B1=null;var ju=e=>(B1===null&&(B1=Fu()===1?Math.round:t=>t),B1(e)),hm=(e,t={})=>{if(e){if(t.preventScroll&&Za()){const n=document.body.scrollTop;e.focus(),document.body.scrollTop=n;return}
89e.focus(t)}},N6=e=>/textarea/i.test(e.nodeName),NS=e=>/date|email|number|search|text|url/.test(e.type),Ql=e=>N6(e)||NS(e)||e.isContentEditable;const G6=e=>({}),N2=e=>({}),j6=e=>({}),G2=e=>({});function Z6(e){let t,n;const i=[e[7]];let o={$$slots:{default:[K6]},$$scope:{ctx:e}};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new Ll({props:o}),e[53](t),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&128?fo(i,[yo(r[7])]):{};a[1]&67108864&&(l.$$scope={dirty:a,ctx:r}),t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){e[53](null),Oe(t,r)}}}function X6(e){let t,n;const i=[e[7]];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new Ll({props:o}),e[52](t),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&128?fo(i,[yo(r[7])]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){e[52](null),Oe(t,r)}}}function K6(e){let t;const n=e[51].label,i=lo(n,e,e[57],G2);return{c(){i&&i.c()},m(o,r){i&&i.m(o,r),t=!0},p(o,r){i&&i.p&&(!t||r[1]&67108864)&&co(i,n,o,o[57],t?so(n,o[57],r,j6):uo(o[57]),G2)},i(o){t||(L(i,o),t=!0)},o(o){z(i,o),t=!1},d(o){i&&i.d(o)}}}function j2(e){let t,n,i,o,r,a,l;const s=e[51].details,c=lo(s,e,e[57],N2);return{c(){t=fe("div"),c&&c.c(),n=ut(),i=fe("span"),k(i,"class","PinturaPanelTip"),k(i,"data-top",e[10]),Ee(i,"opacity",e[14]),Ee(i,"transform",e[13]),Ee(i,"top",e[12]),Ee(i,"left",e[11]),k(t,"class",o=pn(["PinturaPanel","pintura-editor-panel",e[2]])),k(t,"tabindex","-1"),Ee(t,"opacity",e[18]),Ee(t,"pointer-events",e[17]),Ee(t,"transform",e[16]),Ee(t,"--panel-max-height",e[15])},m(u,f){te(u,t,f),c&&c.m(t,null),Ae(t,n),Ae(t,i),e[54](t),r=!0,a||(l=[Pe(t,"close",e[55]),Pe(t,"keydown",e[25]),Pe(t,"measure",e[56]),wn(Fo.call(null,t))],a=!0)},p(u,f){c&&c.p&&(!r||f[1]&67108864)&&co(c,s,u,u[57],r?so(s,u[57],f,G6):uo(u[57]),N2),(!r||f[0]&1024)&&k(i,"data-top",u[10]),f[0]&16384&&Ee(i,"opacity",u[14]),f[0]&8192&&Ee(i,"transform",u[13]),f[0]&4096&&Ee(i,"top",u[12]),f[0]&2048&&Ee(i,"left",u[11]),(!r||f[0]&4&&o!==(o=pn(["PinturaPanel","pintura-editor-panel",u[2]])))&&k(t,"class",o),f[0]&262144&&Ee(t,"opacity",u[18]),f[0]&131072&&Ee(t,"pointer-events",u[17]),f[0]&65536&&Ee(t,"transform",u[16]),f[0]&32768&&Ee(t,"--panel-max-height",u[15])},i(u){r||(L(c,u),r=!0)},o(u){z(c,u),r=!1},d(u){u&&ee(t),c&&c.d(u),e[54](null),a=!1,On(l)}}}function Y6(e){let t,n,i,o,r,a,l,s,c;const u=[X6,Z6],f=[];function d(p,y){return p[1]?0:1}n=d(e),i=f[n]=u[n](e);let m=e[6]&&j2(e),g=!1;return{c(){t=ut(),i.c(),o=ut(),m&&m.c(),r=ut(),a=Mi()},m(p,y){te(p,t,y),f[n].m(p,y),te(p,o,y),m&&m.m(p,y),te(p,r,y),te(p,a,y),l=!0,s||(c=[Pe(document.body,"pointerdown",function(){kn(e[9])&&e[9].apply(this,arguments)}),Pe(document.body,"pointerup",function(){kn(e[8])&&e[8].apply(this,arguments)})],s=!0)},p(p,y){e=p;let w=n;n=d(e),n===w?f[n].p(e,y):(Et(),z(f[w],1,1,()=>{f[w]=null}),At(),i=f[n],i?i.p(e,y):(i=f[n]=u[n](e),i.c()),L(i,1),i.m(o.parentNode,o)),e[6]?m?(m.p(e,y),y[0]&64&&L(m,1)):(m=j2(e),m.c(),L(m,1),m.m(r.parentNode,r)):m&&(Et(),z(m,1,1,()=>{m=null}),At())},i(p){l||(L(i),L(m),L(g),l=!0)},o(p){z(i),z(m),z(g),l=!1},d(p){p&&(ee(t),ee(o),ee(r),ee(a)),f[n].d(p),m&&m.d(p),s=!1,On(c)}}}let Gl=12;function q6(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,{$$slots:Z={},$$scope:W}=t,{buttonClass:$=void 0}=t,{buttonLabel:S=void 0}=t,{buttonLabelClass:pe=void 0}=t,{buttonHideLabel:ge=void 0}=t,{buttonIcon:de=void 0}=t,{buttonTitle:Fe=void 0}=t,{buttonOnClick:X=void 0}=t,{panelClass:U=void 0}=t,{isActive:ae=!1}=t,{onshow:be=st}=t,{onhide:ft=st}=t;const Se=Qn("isAnimated");B(e,Se,V=>n(50,Y=V));const De=Qn("rootPortal");B(e,De,V=>n(45,I=V));const Mt=Qn("rootRect");B(e,Mt,V=>n(47,T=V));let gt,ie,N;const le=()=>n(34,N=i&&i.getBoundingClientRect());let Te=Kn(),me=hn(0);B(e,me,V=>n(48,v=V));let Me=Kn();const qe=ht({x:0,y:0});B(e,qe,V=>n(46,M=V));const Ne=hn(-5,{stiffness:.1,damping:.35,precision:.001});B(e,Ne,V=>n(49,H=V));let mt=!0;const ue=V=>US(V,I)||ie.isEventTarget(V);let He=!1,Qe,G;const je=V=>{Ql(V.target)||(xn(X)&&X(),ae||le(),n(39,G=V),n(0,ae=!ae))},ye=V=>{/down/i.test(V.key)&&(V.target&&Ql(V.target)||(n(0,ae=!0),n(39,G=V)))},$e=V=>{/esc/i.test(V.key)&&(n(0,ae=!1),i.focus())};Jr(()=>{if(!I||!Qe)return;const V=Qe;hS().then(()=>{V.parentNode&&V.remove()})});function St(V){vn[V?"unshift":"push"](()=>{ie=V,n(4,ie)})}function Je(V){vn[V?"unshift":"push"](()=>{ie=V,n(4,ie)})}function q(V){vn[V?"unshift":"push"](()=>{Qe=V,n(5,Qe)})}const Ie=V=>{V.stopPropagation(),n(0,ae=!1)},se=V=>n(3,gt=sl(V.detail));return e.$$set=V=>{"buttonClass"in V&&n(26,$=V.buttonClass),"buttonLabel"in V&&n(1,S=V.buttonLabel),"buttonLabelClass"in V&&n(27,pe=V.buttonLabelClass),"buttonHideLabel"in V&&n(28,ge=V.buttonHideLabel),"buttonIcon"in V&&n(29,de=V.buttonIcon),"buttonTitle"in V&&n(30,Fe=V.buttonTitle),"buttonOnClick"in V&&n(31,X=V.buttonOnClick),"panelClass"in V&&n(2,U=V.panelClass),"isActive"in V&&n(0,ae=V.isActive),"onshow"in V&&n(32,be=V.onshow),"onhide"in V&&n(33,ft=V.onhide),"$$scope"in V&&n(57,W=V.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&16&&(i=ie&&ie.getElement()),e.$$.dirty[0]&1|e.$$.dirty[1]&128&&n(8,C=ae?V=>{He&&(n(38,He=!1),!ue(V)&&n(0,ae=!1))}:void 0),e.$$.dirty[0]&1|e.$$.dirty[1]&524288&&me.set(ae?1:0,{hard:Y===!1}),e.$$.dirty[0]&1|e.$$.dirty[1]&524288&&Ne.set(ae?0:-5,{hard:Y===!1}),e.$$.dirty[1]&262144&&n(43,o=1-H/-5),e.$$.dirty[0]&1|e.$$.dirty[1]&65536&&T&&ae&&le(),e.$$.dirty[0]&9|e.$$.dirty[1]&65544&&T&&gt&&N&&ae){n(37,mt=!0);let V=N.x-T.x+N.width*.5-gt.width*.5,dt=N.y-T.y+N.height;const Ft=Gl,We=Gl,Xe=T.width-Gl,nt=T.height-Gl,wt=V,Zt=dt,yt=wt+gt.width,nn=Zt+gt.height;if(wt<Ft&&(n(36,Me.x=wt-Ft,Me),V=Ft),yt>Xe&&(n(36,Me.x=yt-Xe,Me),V=Xe-gt.width),nn>nt){n(35,Te.y=-1,Te);const Jt=dt-gt.height-N.height;We<Jt?(n(36,Me.y=0,Me),dt-=gt.height+N.height):(n(36,Me.y=dt-(nn-nt),Me),dt-=nn-nt-Gl,n(37,mt=!1))}else n(35,Te.y=1,Te);_e(qe,M=Or(re(V,dt),ju),M)}if(e.$$.dirty[1]&131072&&n(6,r=v>0),e.$$.dirty[1]&294928&&n(44,a=`translateX(${Math.round(M.x)+Te.x*Gl}px) translateY(${Math.round(M.y)+Te.y*Gl+Te.y*H}px)`),e.$$.dirty[1]&131072&&n(18,l=v),e.$$.dirty[1]&131072&&n(17,s=v<1?"none":"all"),e.$$.dirty[1]&8192&&n(16,c=a),e.$$.dirty[1]&65536&&n(15,u=`${T.height-Gl*2}px`),e.$$.dirty[1]&4096&&n(41,f=.5+o*.5),e.$$.dirty[1]&4096&&n(42,d=o),e.$$.dirty[0]&8|e.$$.dirty[1]&32768&&n(40,m=gt&&M),e.$$.dirty[1]&2624&&n(14,g=m&&mt?d:0),e.$$.dirty[1]&1536&&n(13,p=m?`scaleX(${f})rotate(45deg)`:"none"),e.$$.dirty[0]&8|e.$$.dirty[1]&560&&n(12,y=m?`${Te.y<0?Me.y+gt.height:0}px`:"0"),e.$$.dirty[0]&8|e.$$.dirty[1]&544&&n(11,w=m?`${Me.x+gt.width*.5}px`:"0"),e.$$.dirty[1]&16&&n(10,_=Te.y>=0),e.$$.dirty[0]&1&&n(9,P=ae?V=>{ue(V)||n(38,He=!0)}:void 0),e.$$.dirty[0]&96|e.$$.dirty[1]&16384&&r&&I&&Qe&&Qe.parentNode!==I&&I.append(Qe),e.$$.dirty[0]&1&&(ae||n(39,G=void 0)),e.$$.dirty[0]&97|e.$$.dirty[1]&258&&ae&&r&&Qe){let V=!1;be({e:G,panel:Qe,preventFocus(){V=!0}}),V||hm(Qe,{preventScroll:!0})}e.$$.dirty[0]&65|e.$$.dirty[1]&4&&r&&!ae&&ft(),e.$$.dirty[0]&2080374786&&n(7,R={label:S,icon:de,class:pn(["PinturaPanelButton",$]),onkeydown:ye,onclick:je,hideLabel:ge,labelClass:pe,title:Fe})},[ae,S,U,gt,ie,Qe,r,R,C,P,_,w,y,p,g,u,c,s,l,Se,De,Mt,me,qe,Ne,$e,$,pe,ge,de,Fe,X,be,ft,N,Te,Me,mt,He,G,m,f,d,o,a,I,M,T,v,H,Y,Z,St,Je,q,Ie,se,W]}class nh extends gn{constructor(t){super(),mn(this,t,q6,Y6,rn,{buttonClass:26,buttonLabel:1,buttonLabelClass:27,buttonHideLabel:28,buttonIcon:29,buttonTitle:30,buttonOnClick:31,panelClass:2,isActive:0,onshow:32,onhide:33},null,[-1,-1,-1])}}var J6={Up:38,Down:40,Left:37,Right:39};function Q6(e){let t,n,i,o,r,a,l,s;const c=e[16].default,u=lo(c,e,e[15],null);return{c(){t=fe("li"),n=fe("input"),i=ut(),o=fe("label"),u&&u.c(),k(n,"type","radio"),k(n,"class","implicit"),k(n,"id",e[7]),k(n,"name",e[0]),n.value=e[3],n.disabled=e[6],n.hidden=e[5],n.checked=e[4],k(o,"for",e[7]),k(o,"title",e[2]),k(t,"class",r=pn(["PinturaRadioGroupOption",e[1]])),k(t,"data-hidden",e[5]),k(t,"data-disabled",e[6]),k(t,"data-selected",e[4])},m(f,d){te(f,t,d),Ae(t,n),Ae(t,i),Ae(t,o),u&&u.m(o,null),a=!0,l||(s=[Pe(n,"change",Q_(e[17])),Pe(n,"keydown",e[9]),Pe(n,"click",e[10])],l=!0)},p(f,[d]){(!a||d&128)&&k(n,"id",f[7]),(!a||d&1)&&k(n,"name",f[0]),(!a||d&8)&&(n.value=f[3]),(!a||d&64)&&(n.disabled=f[6]),(!a||d&32)&&(n.hidden=f[5]),(!a||d&16)&&(n.checked=f[4]),u&&u.p&&(!a||d&32768)&&co(u,c,f,f[15],a?so(c,f[15],d,null):uo(f[15]),null),(!a||d&128)&&k(o,"for",f[7]),(!a||d&4)&&k(o,"title",f[2]),(!a||d&2&&r!==(r=pn(["PinturaRadioGroupOption",f[1]])))&&k(t,"class",r),(!a||d&32)&&k(t,"data-hidden",f[5]),(!a||d&64)&&k(t,"data-disabled",f[6]),(!a||d&16)&&k(t,"data-selected",f[4])},i(f){a||(L(u,f),a=!0)},o(f){z(u,f),a=!1},d(f){f&&ee(t),u&&u.d(f),l=!1,On(s)}}}
89function $6(e,t,n){let i,o,{$$slots:r={},$$scope:a}=t,{name:l}=t,{class:s=void 0}=t,{label:c}=t,{title:u=void 0}=t,{id:f}=t,{value:d}=t,{checked:m}=t,{onkeydown:g}=t,{onclick:p}=t,{hidden:y=!1}=t,{disabled:w=!1}=t;const _=Object.values(J6),P=Qn("keysPressed");B(e,P,M=>n(18,o=M));const C=M=>{g(M)},R=M=>{o.some(T=>_.includes(T))||p(M)};function I(M){Zo.call(this,e,M)}return e.$$set=M=>{"name"in M&&n(0,l=M.name),"class"in M&&n(1,s=M.class),"label"in M&&n(11,c=M.label),"title"in M&&n(2,u=M.title),"id"in M&&n(12,f=M.id),"value"in M&&n(3,d=M.value),"checked"in M&&n(4,m=M.checked),"onkeydown"in M&&n(13,g=M.onkeydown),"onclick"in M&&n(14,p=M.onclick),"hidden"in M&&n(5,y=M.hidden),"disabled"in M&&n(6,w=M.disabled),"$$scope"in M&&n(15,a=M.$$scope)},e.$$.update=()=>{e.$$.dirty&4097&&n(7,i=`${l}-${f}`)},[l,s,u,d,m,y,w,i,P,C,R,c,f,g,p,a,r,I]}class GS extends gn{constructor(t){super(),mn(this,t,$6,Q6,rn,{name:0,class:1,label:11,title:2,id:12,value:3,checked:4,onkeydown:13,onclick:14,hidden:5,disabled:6})}}var $l=(e=[])=>e.reduce((t,n)=>(Si(n)?Si(n[1]):!!n.options)?t.concat(Si(n)?n[1]:n.options):(t.push(n),t),[]);const bd=(e,t,n)=>{let i;return Si(e)?i={id:t,value:e[0],label:e[1],...e[2]||{}}:(i=e,i.id=i.id!=null?i.id:t),n?n(i):i};var eC=(e=[],t)=>{let n=0;return e.map(i=>(n++,Si(i)?Si(i[1])?{id:n,label:i[0],options:i[1].map(o=>bd(o,++n,t))}:bd(i,n,t):i.options?{id:i.id||n,label:i.label,options:i.options.map(o=>bd(o,++n,t))}:bd(i,n,t)))},tC=(e,...t)=>e&&e(...t),Lo=(e,t,n)=>xn(e)?e(t,n):e;const jS=(e,t)=>e.map(([n,i,o])=>{if(Si(i))return[Lo(n,t),jS(i,t)];{const r=[n,Lo(i,t)];if(o){let a={...o};o.icon&&(a.icon=Lo(o.icon,t)),r.push(a)}return r}});var ZS=(e,t)=>jS(e,t),XS=e=>/enter| /i.test(e),KS=(e,t)=>Array.isArray(e)&&Array.isArray(t)?Rl(e,t):e===t;function Z2(e,t,n){const i=e.slice();return i[27]=t[n],i}const nC=e=>({option:e[0]&1024}),X2=e=>({option:e[27]});function K2(e,t,n){const i=e.slice();return i[27]=t[n],i}const iC=e=>({option:e[0]&1024}),Y2=e=>({option:e[27]}),oC=e=>({option:e[0]&1024}),q2=e=>({option:e[27]});function J2(e){let t,n,i,o=[],r=new Map,a,l,s=e[1]&&Q2(e),c=xo(e[10]);const u=f=>f[27].id;for(let f=0;f<c.length;f+=1){let d=Z2(e,c,f),m=u(d);r.set(m,o[f]=ob(m,d))}return{c(){t=fe("fieldset"),s&&s.c(),n=ut(),i=fe("ul");for(let f=0;f<o.length;f+=1)o[f].c();k(i,"class","PinturaRadioGroupOptions"),k(t,"class",a=pn(["PinturaRadioGroup",e[3]])),k(t,"data-layout",e[5]),k(t,"title",e[7])},m(f,d){te(f,t,d),s&&s.m(t,null),Ae(t,n),Ae(t,i);for(let m=0;m<o.length;m+=1)o[m]&&o[m].m(i,null);l=!0},p(f,d){f[1]?s?s.p(f,d):(s=Q2(f),s.c(),s.m(t,n)):s&&(s.d(1),s=null),d[0]&8419153&&(c=xo(f[10]),Et(),o=cl(o,d,u,1,f,c,r,i,cs,ob,null,Z2),At()),(!l||d[0]&8&&a!==(a=pn(["PinturaRadioGroup",f[3]])))&&k(t,"class",a),(!l||d[0]&32)&&k(t,"data-layout",f[5]),(!l||d[0]&128)&&k(t,"title",f[7])},i(f){if(!l){for(let d=0;d<c.length;d+=1)L(o[d]);l=!0}},o(f){for(let d=0;d<o.length;d+=1)z(o[d]);l=!1},d(f){f&&ee(t),s&&s.d();for(let d=0;d<o.length;d+=1)o[d].d()}}}function Q2(e){let t,n,i;return{c(){t=fe("legend"),n=bi(e[1]),k(t,"class",i=e[2]&&"implicit")},m(o,r){te(o,t,r),Ae(t,n)},p(o,r){r[0]&2&&vi(n,o[1]),r[0]&4&&i!==(i=o[2]&&"implicit")&&k(t,"class",i)},d(o){o&&ee(t)}}}function rC(e){let t,n;return t=new GS({props:{name:e[4],label:e[27].label,title:e[27].hideLabel?e[27].title||e[27].label:e[27].title,id:e[27].id,value:e[27].value,disabled:e[27].disabled,hidden:e[27].hidden,class:e[8],checked:e[12](e[27])===e[0],onkeydown:e[13](e[27]),onclick:e[14](e[27]),$$slots:{default:[cC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.name=i[4]),o[0]&1024&&(r.label=i[27].label),o[0]&1024&&(r.title=i[27].hideLabel?i[27].title||i[27].label:i[27].title),o[0]&1024&&(r.id=i[27].id),o[0]&1024&&(r.value=i[27].value),o[0]&1024&&(r.disabled=i[27].disabled),o[0]&1024&&(r.hidden=i[27].hidden),o[0]&256&&(r.class=i[8]),o[0]&1025&&(r.checked=i[12](i[27])===i[0]),o[0]&1024&&(r.onkeydown=i[13](i[27])),o[0]&1024&&(r.onclick=i[14](i[27])),o[0]&8389696&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function aC(e){let t,n,i,o=[],r=new Map,a,l,s;const c=e[22].group,u=lo(c,e,e[23],q2),f=u||uC(e);let d=xo(e[27].options);const m=g=>g[27].id;for(let g=0;g<d.length;g+=1){let p=K2(e,d,g),y=m(p);r.set(y,o[g]=ib(y,p))}return{c(){t=fe("li"),f&&f.c(),n=ut(),i=fe("ul");for(let g=0;g<o.length;g+=1)o[g].c();a=ut(),k(i,"class","PinturaRadioGroupOptions"),k(t,"class",l=pn(["PinturaRadioGroupOptionGroup",e[9]]))},m(g,p){te(g,t,p),f&&f.m(t,null),Ae(t,n),Ae(t,i);for(let y=0;y<o.length;y+=1)o[y]&&o[y].m(i,null);Ae(t,a),s=!0},p(g,p){u?u.p&&(!s||p[0]&8389632)&&co(u,c,g,g[23],s?so(c,g[23],p,oC):uo(g[23]),q2):f&&f.p&&(!s||p[0]&1024)&&f.p(g,s?p:[-1,-1]),p[0]&8418641&&(d=xo(g[27].options),Et(),o=cl(o,p,m,1,g,d,r,i,cs,ib,null,K2),At()),(!s||p[0]&512&&l!==(l=pn(["PinturaRadioGroupOptionGroup",g[9]])))&&k(t,"class",l)},i(g){if(!s){L(f,g);for(let p=0;p<d.length;p+=1)L(o[p]);s=!0}},o(g){z(f,g);for(let p=0;p<o.length;p+=1)z(o[p]);s=!1},d(g){g&&ee(t),f&&f.d(g);for(let p=0;p<o.length;p+=1)o[p].d()}}}function $2(e){let t,n;return t=new Br({props:{$$slots:{default:[lC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&8389632&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function lC(e){let t,n=e[27].icon+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[0]&1024&&n!==(n=i[27].icon+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}
89}}function eb(e){let t,n=e[27].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class",e[6])},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[0]&1024&&n!==(n=o[27].label+"")&&vi(i,n),r[0]&64&&k(t,"class",o[6])},d(o){o&&ee(t)}}}function sC(e){let t,n,i,o=e[27].icon&&$2(e),r=!e[27].hideLabel&&eb(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=ut()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[27].icon?o?(o.p(a,l),l[0]&1024&&L(o,1)):(o=$2(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[27].hideLabel?r&&(r.d(1),r=null):r?r.p(a,l):(r=eb(a),r.c(),r.m(n.parentNode,n))},i(a){i||(L(o),i=!0)},o(a){z(o),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function cC(e){let t;const n=e[22].option,i=lo(n,e,e[23],X2),o=i||sC(e);return{c(){o&&o.c()},m(r,a){o&&o.m(r,a),t=!0},p(r,a){i?i.p&&(!t||a[0]&8389632)&&co(i,n,r,r[23],t?so(n,r[23],a,nC):uo(r[23]),X2):o&&o.p&&(!t||a[0]&1088)&&o.p(r,t?a:[-1,-1])},i(r){t||(L(o,r),t=!0)},o(r){z(o,r),t=!1},d(r){o&&o.d(r)}}}function uC(e){let t,n=e[27].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class","PinturaRadioGroupOptionGroupLabel")},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[0]&1024&&n!==(n=o[27].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function tb(e){let t,n;return t=new Br({props:{$$slots:{default:[fC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&8389632&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function fC(e){let t,n=e[27].icon+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[0]&1024&&n!==(n=i[27].icon+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function nb(e){let t,n=e[27].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class",e[6])},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[0]&1024&&n!==(n=o[27].label+"")&&vi(i,n),r[0]&64&&k(t,"class",o[6])},d(o){o&&ee(t)}}}function dC(e){let t,n,i,o=e[27].icon&&tb(e),r=!e[27].hideLabel&&nb(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=ut()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[27].icon?o?(o.p(a,l),l[0]&1024&&L(o,1)):(o=tb(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[27].hideLabel?r&&(r.d(1),r=null):r?r.p(a,l):(r=nb(a),r.c(),r.m(n.parentNode,n))},i(a){i||(L(o),i=!0)},o(a){z(o),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function hC(e){let t;const n=e[22].option,i=lo(n,e,e[23],Y2),o=i||dC(e);return{c(){o&&o.c()},m(r,a){o&&o.m(r,a),t=!0},p(r,a){i?i.p&&(!t||a[0]&8389632)&&co(i,n,r,r[23],t?so(n,r[23],a,iC):uo(r[23]),Y2):o&&o.p&&(!t||a[0]&1088)&&o.p(r,t?a:[-1,-1])},i(r){t||(L(o,r),t=!0)},o(r){z(o,r),t=!1},d(r){o&&o.d(r)}}}function ib(e,t){let n,i,o;return i=new GS({props:{name:t[4],label:t[27].label,title:t[27].hideLabel?t[27].title||t[27].label:t[27].title,id:t[27].id,value:t[27].value,disabled:t[27].disabled,hidden:t[27].hidden,class:t[8],checked:t[12](t[27])===t[0],onkeydown:t[13](t[27]),onclick:t[14](t[27]),$$slots:{default:[hC]},$$scope:{ctx:t}}}),{key:e,first:null,c(){n=Mi(),Ve(i.$$.fragment),this.first=n},m(r,a){te(r,n,a),ve(i,r,a),o=!0},p(r,a){t=r;const l={};a[0]&16&&(l.name=t[4]),a[0]&1024&&(l.label=t[27].label),a[0]&1024&&(l.title=t[27].hideLabel?t[27].title||t[27].label:t[27].title),a[0]&1024&&(l.id=t[27].id),a[0]&1024&&(l.value=t[27].value),a[0]&1024&&(l.disabled=t[27].disabled),a[0]&1024&&(l.hidden=t[27].hidden),a[0]&256&&(l.class=t[8]),a[0]&1025&&(l.checked=t[12](t[27])===t[0]),a[0]&1024&&(l.onkeydown=t[13](t[27])),a[0]&1024&&(l.onclick=t[14](t[27])),a[0]&8389696&&(l.$$scope={dirty:a,ctx:t}),i.$set(l)},i(r){o||(L(i.$$.fragment,r),o=!0)},o(r){z(i.$$.fragment,r),o=!1},d(r){r&&ee(n),Oe(i,r)}}}function ob(e,t){let n,i,o,r,a;const l=[aC,rC],s=[];function c(u,f){return u[27].options?0:1}return i=c(t),o=s[i]=l[i](t),{key:e,first:null,c(){n=Mi(),o.c(),r=Mi(),this.first=n},m(u,f){te(u,n,f),s[i].m(u,f),te(u,r,f),a=!0},p(u,f){t=u;let d=i;i=c(t),i===d?s[i].p(t,f):(Et(),z(s[d],1,1,()=>{s[d]=null}),At(),o=s[i],o?o.p(t,f):(o=s[i]=l[i](t),o.c()),L(o,1),o.m(r.parentNode,r))},i(u){a||(L(o),a=!0)},o(u){z(o),a=!1},d(u){u&&(ee(n),ee(r)),s[i].d(u)}}}function mC(e){let t,n,i,o=e[11].length&&J2(e),r=!1;return{c(){o&&o.c(),t=ut(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),te(a,n,l),i=!0},p(a,l){a[11].length?o?(o.p(a,l),l[0]&2048&&L(o,1)):(o=J2(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a)}}}
89function gC(e,t,n){let i,o,r,{$$slots:a={},$$scope:l}=t;const s=Xa();let{label:c=void 0}=t,{hideLabel:u=!0}=t,{class:f=void 0}=t,{name:d=`radio-group-${Yr()}`}=t,{selectedIndex:m=-1}=t,{options:g=[]}=t,{onchange:p=void 0}=t,{layout:y=void 0}=t,{optionMapper:w=void 0}=t,{optionFilter:_=void 0}=t,{value:P=void 0}=t,{optionLabelClass:C=void 0}=t,{title:R=void 0}=t,{locale:I=void 0}=t,{optionClass:M=void 0}=t,{optionGroupClass:T=void 0}=t;const v=$=>$.findIndex(S=>S[0]===void 0),H=$=>r.findIndex(S=>S.id===$.id),Y=($,S)=>{n(0,m=H($));const pe={index:m,...$};tC(p,pe,S),s("change",pe)},Z=$=>S=>{XS(S.key)&&Y($,S)},W=$=>S=>{Y($,S)};return e.$$set=$=>{"label"in $&&n(1,c=$.label),"hideLabel"in $&&n(2,u=$.hideLabel),"class"in $&&n(3,f=$.class),"name"in $&&n(4,d=$.name),"selectedIndex"in $&&n(0,m=$.selectedIndex),"options"in $&&n(15,g=$.options),"onchange"in $&&n(16,p=$.onchange),"layout"in $&&n(5,y=$.layout),"optionMapper"in $&&n(17,w=$.optionMapper),"optionFilter"in $&&n(18,_=$.optionFilter),"value"in $&&n(19,P=$.value),"optionLabelClass"in $&&n(6,C=$.optionLabelClass),"title"in $&&n(7,R=$.title),"locale"in $&&n(20,I=$.locale),"optionClass"in $&&n(8,M=$.optionClass),"optionGroupClass"in $&&n(9,T=$.optionGroupClass),"$$scope"in $&&n(23,l=$.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&1343488&&n(11,i=ZS(_?g.filter(_):g,I)),e.$$.dirty[0]&133120&&n(10,o=eC(i,w)),e.$$.dirty[0]&1024&&n(21,r=$l(o)),e.$$.dirty[0]&2654209&&m<0&&(n(0,m=r.findIndex($=>KS($.value,P))),m<0&&n(0,m=v(g)))},[m,c,u,f,d,y,C,R,M,T,o,i,H,Z,W,g,p,w,_,P,I,r,a,l]}class El extends gn{constructor(t){super(),mn(this,t,gC,mC,rn,{label:1,hideLabel:2,class:3,name:4,selectedIndex:0,options:15,onchange:16,layout:5,optionMapper:17,optionFilter:18,value:19,optionLabelClass:6,title:7,locale:20,optionClass:8,optionGroupClass:9},null,[-1,-1])}}function rb(e){let t,n,i,o,r,a,l,s,c,u;return{c(){t=fe("div"),n=fe("button"),i=bi("▲"),r=ut(),a=fe("button"),l=bi("▼"),k(n,"type","button"),k(n,"tabindex","-1"),k(n,"aria-label",o=`increase ${e[7]}`),k(a,"type","button"),k(a,"tabindex","-1"),k(a,"aria-label",s=`decrease ${e[7]}`),k(t,"class","PinturaInputSpinners")},m(f,d){te(f,t,d),Ae(t,n),Ae(n,i),Ae(t,r),Ae(t,a),Ae(a,l),c||(u=[Pe(n,"click",e[18]),Pe(a,"click",e[19])],c=!0)},p(f,d){d[0]&128&&o!==(o=`increase ${f[7]}`)&&k(n,"aria-label",o),d[0]&128&&s!==(s=`decrease ${f[7]}`)&&k(a,"aria-label",s)},d(f){f&&ee(t),c=!1,On(u)}}}function bC(e){let t,n,i,o,r,a,l=e[14]&&e[9]&&rb(e);return{c(){t=fe("div"),n=fe("input"),o=ut(),l&&l.c(),k(n,"class","PinturaInputField"),k(n,"title",e[7]),k(n,"type",e[1]),k(n,"min",e[4]),k(n,"max",e[5]),k(n,"step",e[6]),k(n,"inputmode",e[3]),n.value=i=e[12]?e[15]:e[0],k(n,"placeholder",e[8]),k(n,"maxlength",e[13]),n.disabled=e[2],k(n,"spellcheck","false"),k(n,"autocorrect","off"),k(n,"autocapitalize","off"),Ee(n,"min-width",e[11]?`${e[11]}em`:void 0),k(t,"class","PinturaInput")},m(s,c){te(s,t,c),Ae(t,n),e[30](n),Ae(t,o),l&&l.m(t,null),r||(a=[Pe(n,"input",e[17]),Pe(n,"blur",function(){kn(e[12]&&e[16])&&(e[12]&&e[16]).apply(this,arguments)}),Pe(n,"keydown",e[20]),Pe(n,"keyup",e[21])],r=!0)},p(s,c){e=s,c[0]&128&&k(n,"title",e[7]),c[0]&2&&k(n,"type",e[1]),c[0]&16&&k(n,"min",e[4]),c[0]&32&&k(n,"max",e[5]),c[0]&64&&k(n,"step",e[6]),c[0]&8&&k(n,"inputmode",e[3]),c[0]&36865&&i!==(i=e[12]?e[15]:e[0])&&n.value!==i&&(n.value=i),c[0]&256&&k(n,"placeholder",e[8]),c[0]&8192&&k(n,"maxlength",e[13]),c[0]&4&&(n.disabled=e[2]),c[0]&2048&&Ee(n,"min-width",e[11]?`${e[11]}em`:void 0),e[14]&&e[9]?l?l.p(e,c):(l=rb(e),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i:qt,o:qt,d(s){s&&ee(t),e[30](null),l&&l.d(),r=!1,On(a)}}}function pC(e,t,n){let i,o,r,a,l,s,c,{value:u=void 0}=t,{type:f="text"}=t,{disabled:d=!1}=t,{inputmode:m=void 0}=t,{min:g=void 0}=t,{max:p=void 0}=t,{step:y=void 0}=t,{onchange:w=st}=t,{onkeydown:_=st}=t,{onkeyup:P=st}=t,{title:C=void 0}=t,{stepMultiplier:R=10}=t,{placeholder:I=void 0}=t,{enableSpinButtons:M=!0}=t,{enableStopPropagation:T=!1}=t,v,H;const Y=()=>{let X=v.value;return f==="number"&&(X=m==="numeric"?parseInt(X,10):parseFloat(X),!Ht(X)||Number.isNaN(X)?X=g||0:o&&(X=Xn(X,g,p))),X},Z=()=>{n(27,W=Y()),w(u)};let W=u;const $=()=>{n(27,W=v.value),w(Y())},S=()=>{const X=Xn(Y()+(H?y*R:y),g,p);X!==u&&(n(27,W=X),n(0,u=X),w(u))},pe=()=>{const X=Xn(Y()-(H?y*R:y),g,p);X!==u&&(n(27,W=X),n(0,u=X),w(u))},ge=X=>{if(_(X),!a)return;H=X.shiftKey;const{key:U}=X;T&&X.stopPropagation(),/up|down/i.test(U)&&(/up/i.test(U)&&S(),/down/i.test(U)&&pe(),X.preventDefault(),X.stopPropagation())},de=X=>{if(P(X),!a)return;const{key:U}=X;/up|down/i.test(U)&&(X.preventDefault(),X.stopPropagation())};function Fe(X){vn[X?"unshift":"push"](()=>{v=X,n(10,v)})}return e.$$set=X=>{"value"in X&&n(0,u=X.value),"type"in X&&n(1,f=X.type),"disabled"in X&&n(2,d=X.disabled),"inputmode"in X&&n(3,m=X.inputmode),"min"in X&&n(4,g=X.min),"max"in X&&n(5,p=X.max),"step"in X&&n(6,y=X.step),"onchange"in X&&n(22,w=X.onchange),"onkeydown"in X&&n(23,_=X.onkeydown),"onkeyup"in X&&n(24,P=X.onkeyup),"title"in X&&n(7,
89C=X.title),"stepMultiplier"in X&&n(25,R=X.stepMultiplier),"placeholder"in X&&n(8,I=X.placeholder),"enableSpinButtons"in X&&n(9,M=X.enableSpinButtons),"enableStopPropagation"in X&&n(26,T=X.enableStopPropagation)},e.$$.update=()=>{e.$$.dirty[0]&2&&n(29,i=f==="number"),e.$$.dirty[0]&48&&n(12,o=Ht(g)&&Ht(p)),e.$$.dirty[0]&64&&n(28,r=Ht(y)),e.$$.dirty[0]&805310464&&n(14,a=i&&o&&r),e.$$.dirty[0]&134218753&&n(15,l=v===document.activeElement?W:u),e.$$.dirty[0]&32&&n(11,s=p?(p+"").length:void 0),e.$$.dirty[0]&2056&&n(13,c=m==="numeric"&&s?s:void 0)},[u,f,d,m,g,p,y,C,I,M,v,s,o,c,a,l,Z,$,S,pe,ge,de,w,_,P,R,T,W,r,i,Fe]}class YS extends gn{constructor(t){super(),mn(this,t,pC,bC,rn,{value:0,type:1,disabled:2,inputmode:3,min:4,max:5,step:6,onchange:22,onkeydown:23,onkeyup:24,title:7,stepMultiplier:25,placeholder:8,enableSpinButtons:9,enableStopPropagation:26},null,[-1,-1])}}const yC=e=>({}),ab=e=>({});function SC(e){let t,n,i=(e[2]||e[21])+"",o,r,a=e[6]&&lb(e);return{c(){a&&a.c(),t=ut(),n=fe("span"),k(n,"class",o=pn(["PinturaButtonLabel",e[3],e[5]&&"implicit"]))},m(l,s){a&&a.m(l,s),te(l,t,s),te(l,n,s),n.innerHTML=i,r=!0},p(l,s){l[6]?a?(a.p(l,s),s[0]&64&&L(a,1)):(a=lb(l),a.c(),L(a,1),a.m(t.parentNode,t)):a&&(Et(),z(a,1,1,()=>{a=null}),At()),(!r||s[0]&2097156)&&i!==(i=(l[2]||l[21])+"")&&(n.innerHTML=i),(!r||s[0]&40&&o!==(o=pn(["PinturaButtonLabel",l[3],l[5]&&"implicit"])))&&k(n,"class",o)},i(l){r||(L(a),r=!0)},o(l){z(a),r=!1},d(l){l&&(ee(t),ee(n)),a&&a.d(l)}}}function wC(e){let t,n;return t=new YS({props:{value:parseFloat(e[10]),onchange:e[17],enableStopPropagation:!0,type:"number",inputmode:"numeric",min:e[8].reduce(e[29],1/0),max:e[8].reduce(e[30],-1/0),enableSpinButtons:!1}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&1024&&(r.value=parseFloat(i[10])),o[0]&131072&&(r.onchange=i[17]),o[0]&256&&(r.min=i[8].reduce(i[29],1/0)),o[0]&256&&(r.max=i[8].reduce(i[30],-1/0)),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function lb(e){let t,n;return t=new Br({props:{class:"PinturaButtonIcon",$$slots:{default:[_C]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&64|o[1]&2&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function _C(e){let t;return{c(){t=Ao("g")},m(n,i){te(n,t,i),t.innerHTML=e[6]},p(n,i){i[0]&64&&(t.innerHTML=n[6])},d(n){n&&ee(t)}
89}}function TC(e){let t,n,i,o,r;const a=[wC,SC],l=[];function s(c,u){return c[18]?0:1}return n=s(e),i=l[n]=a[n](e),{c(){t=fe("span"),i.c(),k(t,"slot","label"),k(t,"class",o=pn(["PinturaButtonInner",e[18]&&"PinturaComboBox",e[4]]))},m(c,u){te(c,t,u),l[n].m(t,null),r=!0},p(c,u){let f=n;n=s(c),n===f?l[n].p(c,u):(Et(),z(l[f],1,1,()=>{l[f]=null}),At(),i=l[n],i?i.p(c,u):(i=l[n]=a[n](c),i.c()),L(i,1),i.m(t,null)),(!r||u[0]&262160&&o!==(o=pn(["PinturaButtonInner",c[18]&&"PinturaComboBox",c[4]])))&&k(t,"class",o)},i(c){r||(L(i),r=!0)},o(c){z(i),r=!1},d(c){c&&ee(t),l[n].d()}}}function kC(e){let t,n=e[34].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"slot","group")},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[1]&8&&n!==(n=o[34].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function sb(e){let t,n;return t=new Br({props:{style:xn(e[14])?e[14](e[34].value):e[14],$$slots:{default:[CC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16384|o[1]&8&&(r.style=xn(i[14])?i[14](i[34].value):i[14]),o[1]&10&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function CC(e){let t,n=e[34].icon+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[1]&8&&n!==(n=i[34].icon+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function cb(e){let t,n,i=e[34].label+"",o,r,a,l,s,c=e[34].sublabel&&ub(e);return{c(){t=fe("span"),n=new qm(!1),o=ut(),c&&c.c(),n.a=o,k(t,"class",r=pn(["PinturaDropdownOptionLabel",e[11]]))},m(u,f){te(u,t,f),n.m(i,t),Ae(t,o),c&&c.m(t,null),l||(s=wn(a=Il.call(null,t,xn(e[15])?e[15](e[34].value):e[15])),l=!0)},p(u,f){f[1]&8&&i!==(i=u[34].label+"")&&n.p(i),u[34].sublabel?c?c.p(u,f):(c=ub(u),c.c(),c.m(t,null)):c&&(c.d(1),c=null),f[0]&2048&&r!==(r=pn(["PinturaDropdownOptionLabel",u[11]]))&&k(t,"class",r),a&&kn(a.update)&&f[0]&32768|f[1]&8&&a.update.call(null,xn(u[15])?u[15](u[34].value):u[15])},d(u){u&&ee(t),c&&c.d(),l=!1,s()}}}function ub(e){let t,n=e[34].sublabel+"";return{c(){t=fe("span"),k(t,"class","PinturaDropdownOptionSublabel")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[1]&8&&n!==(n=i[34].sublabel+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function PC(e){let t,n,i,o=e[34].icon&&sb(e),r=!e[34].hideLabel&&cb(e);return{c(){t=fe("span"),o&&o.c(),n=ut(),r&&r.c(),k(t,"slot","option")},m(a,l){te(a,t,l),o&&o.m(t,null),Ae(t,n),r&&r.m(t,null),i=!0},p(a,l){a[34].icon?o?(o.p(a,l),l[1]&8&&L(o,1)):(o=sb(a),o.c(),L(o,1),o.m(t,n)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[34].hideLabel?r&&(r.d(1),r=null):r?r.p(a,l):(r=cb(a),r.c(),r.m(t,null))},i(a){i||(L(o),i=!0)},o(a){z(o),i=!1},d(a){a&&ee(t),o&&o.d(),r&&r.d()}}}function MC(e){let t,n,i,o,r,a;const l=e[28].controls,s=lo(l,e,e[32],ab);return i=new El({props:{class:"PinturaOptionsList PinturaScrollableContent",name:e[7],value:e[10],selectedIndex:e[9],optionFilter:e[12],optionMapper:e[13],optionLabelClass:pn(["PinturaDropdownOptionLabel",e[11]]),optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[19],onchange:e[22],$$slots:{option:[PC,({option:c})=>({34:c}),({option:c})=>[0,c?8:0]],group:[kC,({option:c})=>({34:c}),({option:c})=>[0,c?8:0]]},$$scope:{ctx:e}}}),{c(){t=fe("div"),s&&s.c(),n=ut(),Ve(i.$$.fragment),k(t,"slot","details"),k(t,"class","PinturaOptionsListWrapper")},m(c,u){te(c,t,u),s&&s.m(t,null),Ae(t,n),ve(i,t,null),o=!0,r||(a=Pe(t,"keydown",e[24]),r=!0)},p(c,u){s&&s.p&&(!o||u[1]&2)&&co(s,l,c,c[32],o?so(l,c[32],u,yC):uo(c[32]),ab);const f={};u[0]&128&&(f.name=c[7]),u[0]&1024&&(f.value=c[10]),u[0]&512&&(f.selectedIndex=c[9]),u[0]&4096&&(f.optionFilter=c[12]),u[0]&8192&&(f.optionMapper=c[13]),u[0]&2048&&(f.optionLabelClass=pn(["PinturaDropdownOptionLabel",c[11]])),u[0]&524288&&(f.options=c[19]),u[0]&51200|u[1]&10&&(f.$$scope={dirty:u,ctx:c}),i.$set(f)},i(c){o||(L(s,c),L(i.$$.fragment,c),o=!0)},o(c){z(s,c),z(i.$$.fragment,c),o=!1},d(c){c&&ee(t),s&&s.d(c),Oe(i),r=!1,a()}}}function RC(e){let t,n,i;function o(a){e[31](a)}let r={onshow:e[23],buttonTitle:Gd(e[2],e[1]),buttonClass:pn(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"]),buttonOnClick:e[16],$$slots:{details:[MC],label:[TC]},$$scope:{ctx:e}};return e[20]!==void 0&&(r.isActive=e[20]),t=new nh({props:r}),vn.push(()=>Cr(t,"isActive",o)),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,l){const s={};l[0]&6&&(s.buttonTitle=Gd(a[2],a[1])),l[0]&33&&(s.buttonClass=pn(["PinturaDropdownButton",a[0],a[5]&&"PinturaDropdownIconOnly"])),l[0]&65536&&(s.buttonOnClick=a[16]),l[0]&3080188|l[1]&2&&(s.$$scope={dirty:l,ctx:a}),!n&&l[0]&1048576&&(n=!0,s.isActive=a[20],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}function IC(e,t,n){let i,o,{$$slots:r={},$$scope:a}=t,{class:l=void 0}=t,{title:s=void 0}=t,{label:c=void 0}=t,{labelClass:u=void 0}=t,{innerClass:f=void 0}=t,{hideLabel:d=!1}=t,{icon:m=void 0}=t,{name:g=void 0}=t,{options:p=[]}=t,{selectedIndex:y=-1}=t,{value:w=void 0}=t,{optionLabelClass:_=void 0}=t,{optionFilter:P=void 0}=t,{optionMapper:C=void 0}=t,{optionIconStyle:R=void 0}=t,{optionLabelStyle:I=void 0}=t,{locale:M=void 0}=t,{onclick:T=void 0}=t,{onchange:v=st}=t,{onload:H=st}=t,{ondestroy:Y=st}=t,{enableInput:Z=!1}=t;const W=U=>{const ae=U.find(be=>be[0]===void 0);if(ae)return ae[1]};let $;const S=U=>{n(21,o=U.value),v(U),n(20,$=!1)}
89,pe=({e:U,panel:ae,preventFocus:be})=>{if(be(),U&&U.key&&/up|down/i.test(U.key))return hm(ae.querySelector("input:not([disabled])"));hm(ae.querySelector("fieldset"))},ge=U=>{/tab/i.test(U.key)&&U.preventDefault()};ss(()=>H({options:p})),Jr(()=>Y({options:p}));const de=(U,[ae])=>(ae=parseFloat(ae),ae<U?ae:U),Fe=(U,[ae])=>(ae=parseFloat(ae),ae>U?ae:U);function X(U){$=U,n(20,$)}return e.$$set=U=>{"class"in U&&n(0,l=U.class),"title"in U&&n(1,s=U.title),"label"in U&&n(2,c=U.label),"labelClass"in U&&n(3,u=U.labelClass),"innerClass"in U&&n(4,f=U.innerClass),"hideLabel"in U&&n(5,d=U.hideLabel),"icon"in U&&n(6,m=U.icon),"name"in U&&n(7,g=U.name),"options"in U&&n(8,p=U.options),"selectedIndex"in U&&n(9,y=U.selectedIndex),"value"in U&&n(10,w=U.value),"optionLabelClass"in U&&n(11,_=U.optionLabelClass),"optionFilter"in U&&n(12,P=U.optionFilter),"optionMapper"in U&&n(13,C=U.optionMapper),"optionIconStyle"in U&&n(14,R=U.optionIconStyle),"optionLabelStyle"in U&&n(15,I=U.optionLabelStyle),"locale"in U&&n(25,M=U.locale),"onclick"in U&&n(16,T=U.onclick),"onchange"in U&&n(17,v=U.onchange),"onload"in U&&n(26,H=U.onload),"ondestroy"in U&&n(27,Y=U.ondestroy),"enableInput"in U&&n(18,Z=U.enableInput),"$$scope"in U&&n(32,a=U.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&33554688&&n(19,i=M?ZS(p,M):p),e.$$.dirty[0]&525312&&n(21,o=i.reduce((U,ae)=>{if(U)return U;const be=Array.isArray(ae)?ae:[ae,ae],[ft,Se]=be;if(KS(ft,w))return Se},void 0)||W(i)||w)},[l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,T,v,Z,i,$,o,S,pe,ge,M,H,Y,r,de,Fe,X,a]}class lg extends gn{constructor(t){super(),mn(this,t,IC,RC,rn,{class:0,title:1,label:2,labelClass:3,innerClass:4,hideLabel:5,icon:6,name:7,options:8,selectedIndex:9,value:10,optionLabelClass:11,optionFilter:12,optionMapper:13,optionIconStyle:14,optionLabelStyle:15,locale:25,onclick:16,onchange:17,onload:26,ondestroy:27,enableInput:18},null,[-1,-1])}}function EC(e){let t;return{c(){t=fe("div"),k(t,"slot","details")},m(n,i){te(n,t,i),e[14](t)},p:qt,d(n){n&&ee(t),e[14](null)}}}function AC(e){let t,n,i;function o(a){e[15](a)}let r={buttonLabel:e[1],buttonClass:e[2],buttonIcon:e[3],buttonHideLabel:e[4],buttonTitle:e[5],buttonLabelClass:e[6],onshow:e[7],onhide:e[8],$$slots:{details:[EC]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.isActive=e[0]),t=new nh({props:r}),vn.push(()=>Cr(t,"isActive",o)),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,[l]){const s={};l&2&&(s.buttonLabel=a[1]),l&4&&(s.buttonClass=a[2]),l&8&&(s.buttonIcon=a[3]),l&16&&(s.buttonHideLabel=a[4]),l&32&&(s.buttonTitle=a[5]),l&64&&(s.buttonLabelClass=a[6]),l&128&&(s.onshow=a[7]),l&256&&(s.onhide=a[8]),l&66048&&(s.$$scope={dirty:l,ctx:a}),!n&&l&1&&(n=!0,s.isActive=a[0],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}function LC(e,t,n){let{buttonLabel:i=void 0}=t,{buttonClass:o=void 0}=t,{buttonIcon:r=void 0}=t,{buttonHideLabel:a=void 0}=t,{buttonTitle:l=void 0}=t,{buttonLabelClass:s=void 0}=t,{isActive:c=!1}=t,{root:u=void 0}=t,{ondestroy:f=st}=t,{onshow:d=st}=t,{onhide:m=st}=t;const g=()=>n(0,c=!1),p=()=>n(0,c=!0);let y;Jr(f);function w(P){vn[P?"unshift":"push"](()=>{y=P,n(9,y)})}function _(P){c=P,n(0,c)}return e.$$set=P=>{"buttonLabel"in P&&n(1,i=P.buttonLabel),"buttonClass"in P&&n(2,o=P.buttonClass),"buttonIcon"in P&&n(3,r=P.buttonIcon),"buttonHideLabel"in P&&n(4,a=P.buttonHideLabel),"buttonTitle"in P&&n(5,l=P.buttonTitle),"buttonLabelClass"in P&&n(6,s=P.buttonLabelClass),"isActive"in P&&n(0,c=P.isActive),"root"in P&&n(10,u=P.root),"ondestroy"in P&&n(11,f=P.ondestroy),"onshow"in P&&n(7,d=P.onshow),"onhide"in P&&n(8,m=P.onhide)},e.$$.update=()=>{e.$$.dirty&1536&&y&&u&&y.firstChild!==u&&(y.hasChildNodes()?y.replaceChild(u,y.firstChild):y.append(u))},[c,i,o,r,a,l,s,d,m,y,u,f,g,p,w,_]}class xC extends gn{constructor(t){super(),mn(this,t,LC,AC,rn,{buttonLabel:1,buttonClass:2,buttonIcon:3,buttonHideLabel:4,buttonTitle:5,buttonLabelClass:6,isActive:0,root:10,ondestroy:11,onshow:7,onhide:8,hide:12,show:13})}get hide(){return this.$$.ctx[12]}get show(){return this.$$.ctx[13]}}var Al=(e,t={})=>{const{direction:n=void 0,shiftMultiplier:i=10,bubbles:o=!1,preventDefault:r=!1,stopKeydownPropagation:a=!0}=t,l=n==="horizontal",s=n==="vertical",c=u=>{const{key:f}=u,d=u.shiftKey,m=/up|down/i.test(f),g=/left|right/i.test(f);if(!g&&!m||l&&m||s&&g)return;const p=d?i:1;a&&u.stopPropagation(),r&&u.preventDefault(),e.dispatchEvent(new CustomEvent("nudge",{bubbles:o,detail:re((/left/i.test(f)?-1:/right/i.test(f)?1:0)*p,(/up/i.test(f)?-1:/down/i.test(f)?1:0)*p)}))};return e.addEventListener("keydown",c),{destroy(){e.removeEventListener("keydown",c)}}},FC=(e,t)=>
89(t=1/t,Math.round(e*t)/t),vu=(e,t,n)=>(e-t)/(n-t);function vC(e){return e%1===0}function OC(e,t){let n=0;return Math.abs(e)>Math.abs(t)?n=e:n=t,n*-1}var $u=(e,t)=>{const{fixScrollDirection:n=!1}=t||{},{deltaX:i,deltaY:o}=e;let r=OC(i,o);return Hu()?vC(r)?ja()?r*=.1:r*=.25:r*=.05:Math.abs(i)===0&&Math.abs(o)>=100?r*=.05:r*=.25,r=Xn(r,-10,10),Hu()&&!n&&(r*=-1),r};const DC=e=>({}),fb=e=>({});function db(e){let t,n,i;return{c(){t=fe("label"),n=bi(e[0]),k(t,"for",e[17]),k(t,"class",i=e[1]?"implicit":void 0)},m(o,r){te(o,t,r),Ae(t,n)},p(o,r){r[0]&1&&vi(n,o[0]),r[0]&131072&&k(t,"for",o[17]),r[0]&2&&i!==(i=o[1]?"implicit":void 0)&&k(t,"class",i)},d(o){o&&ee(t)}}}function hb(e){let t,n,i,o,r,a,l,s;return n=new Br({props:{$$slots:{default:[BC]},$$scope:{ctx:e}}}),r=new Br({props:{$$slots:{default:[zC]},$$scope:{ctx:e}}}),{c(){t=fe("button"),Ve(n.$$.fragment),i=ut(),o=fe("button"),Ve(r.$$.fragment),k(t,"type","button"),k(t,"aria-label","Increase"),k(o,"type","button"),k(o,"aria-label","Decrease")},m(c,u){te(c,t,u),ve(n,t,null),te(c,i,u),te(c,o,u),ve(r,o,null),a=!0,l||(s=[Pe(t,"pointerdown",e[20](1)),Pe(t,"keydown",e[20](1)),Pe(o,"pointerdown",e[20](-1)),Pe(o,"keydown",e[20](-1))],l=!0)},p(c,u){const f={};u[1]&512&&(f.$$scope={dirty:u,ctx:c}),n.$set(f);const d={};u[1]&512&&(d.$$scope={dirty:u,ctx:c}),r.$set(d)},i(c){a||(L(n.$$.fragment,c),L(r.$$.fragment,c),a=!0)},o(c){z(n.$$.fragment,c),z(r.$$.fragment,c),a=!1},d(c){c&&(ee(t),ee(i),ee(o)),Oe(n),Oe(r),l=!1,On(s)}}}function BC(e){let t;return{c(){t=Ao("path"),k(t,"d","M8 12 h8 M12 8 v8")},m(n,i){te(n,t,i)},p:qt,d(n){n&&ee(t)}
89}}function zC(e){let t;return{c(){t=Ao("path"),k(t,"d","M9 12 h6")},m(n,i){te(n,t,i)},p:qt,d(n){n&&ee(t)}}}function VC(e){let t,n,i,o,r,a,l,s,c,u,f,d,m,g,p,y,w=e[0]&&db(e);const _=e[38].default,P=lo(_,e,e[40],null),C=e[38].knob,R=lo(C,e,e[40],fb);let I=e[8]&&hb(e);return{c(){t=fe("div"),n=fe("div"),w&&w.c(),i=ut(),o=fe("input"),r=ut(),a=fe("div"),P&&P.c(),s=ut(),c=fe("div"),u=fe("div"),R&&R.c(),d=ut(),I&&I.c(),k(o,"type","range"),k(o,"id",e[17]),k(o,"min",e[2]),k(o,"max",e[3]),k(o,"step",e[4]),o.value=e[13],Ee(o,"pointer-events",e[9]?"none":void 0),k(a,"class",l=pn(["PinturaSliderTrack",e[5]])),k(u,"class",f=pn(["PinturaSliderKnob",e[6]])),k(c,"class","PinturaSliderKnobController"),Ee(c,"transform",e[16]),k(n,"class","PinturaSliderControl"),Ee(n,"--slider-position",Math.round(e[14])),k(t,"class",m=pn(["PinturaSlider",e[11]])),k(t,"data-direction",e[7])},m(M,T){te(M,t,T),Ae(t,n),w&&w.m(n,null),Ae(n,i),Ae(n,o),e[39](o),Ae(n,r),Ae(n,a),P&&P.m(a,null),Ae(n,s),Ae(n,c),Ae(c,u),R&&R.m(u,null),Ae(t,d),I&&I.m(t,null),g=!0,p||(y=[Pe(o,"input",e[18]),Pe(o,"nudge",e[19]),Pe(o,"wheel",e[21]),wn(Al.call(null,o)),Pe(n,"pointerdown",function(){kn(e[10]&&e[12])&&(e[10]&&e[12]).apply(this,arguments)})],p=!0)},p(M,T){e=M,e[0]?w?w.p(e,T):(w=db(e),w.c(),w.m(n,i)):w&&(w.d(1),w=null),(!g||T[0]&131072)&&k(o,"id",e[17]),(!g||T[0]&4)&&k(o,"min",e[2]),(!g||T[0]&8)&&k(o,"max",e[3]),(!g||T[0]&16)&&k(o,"step",e[4]),(!g||T[0]&8192)&&(o.value=e[13]),T[0]&512&&Ee(o,"pointer-events",e[9]?"none":void 0),P&&P.p&&(!g||T[1]&512)&&co(P,_,e,e[40],g?so(_,e[40],T,null):uo(e[40]),null),(!g||T[0]&32&&l!==(l=pn(["PinturaSliderTrack",e[5]])))&&k(a,"class",l),R&&R.p&&(!g||T[1]&512)&&co(R,C,e,e[40],g?so(C,e[40],T,DC):uo(e[40]),fb),(!g||T[0]&64&&f!==(f=pn(["PinturaSliderKnob",e[6]])))&&k(u,"class",f),T[0]&65536&&Ee(c,"transform",e[16]),T[0]&16384&&Ee(n,"--slider-position",Math.round(e[14])),e[8]?I?(I.p(e,T),T[0]&256&&L(I,1)):(I=hb(e),I.c(),L(I,1),I.m(t,null)):I&&(Et(),z(I,1,1,()=>{I=null}),At()),(!g||T[0]&2048&&m!==(m=pn(["PinturaSlider",e[11]])))&&k(t,"class",m),(!g||T[0]&128)&&k(t,"data-direction",e[7])},i(M){g||(L(P,M),L(R,M),L(I),g=!0)},o(M){z(P,M),z(R,M),z(I),g=!1},d(M){M&&ee(t),w&&w.d(),e[39](null),P&&P.d(M),R&&R.d(M),I&&I.d(),p=!1,On(y)}}}function WC(e,t,n){let i,o,r,a,l,s,c,u,f,d,{$$slots:m={},$$scope:g}=t,{id:p=void 0}=t,{label:y=void 0}=t,{hideLabel:w=!1}=t,{min:_=0}=t,{max:P=100}=t,{step:C=1}=t,{value:R=0}=t,{valueMin:I=void 0}=t,{valueMax:M=void 0}=t,{trackClass:T=void 0}=t,{knobClass:v=void 0}=t,{ongrab:H=st}=t,{onchange:Y=st}=t,{onrelease:Z=st}=t,{onexceed:W=st}=t,{direction:$="x"}=t,{getValue:S=Nn}=t,{setValue:pe=Nn}=t,{enableSpinButtons:ge=!0}=t,{enableForceUseKnob:de=!1}=t,{enableStopPropagation:Fe=!0}=t,{enablePointerdownListener:X=!0}=t,{maxInteractionDistance:U=6}=t,{class:ae=void 0}=t,be,ft,Se,De,Mt,gt;const ie=q=>pe(FC(Xn(q,_,P),C),R),N=(q,Ie,se={})=>{const{grabbed:V=!1,released:dt=!1}=se,Ft=ie(_+q/Ie*r),We=I||_,Xe=M||P;n(22,R=Nt(Ft)?Ft:Xn(Ft,We,Xe)),gt!==Ft&&(gt=Ft,!Nt(Ft)&&(Ft<We||Ft>Xe)&&W(R,Ft),R!==Mt&&(Mt=R,V&&H(R),Y(R),dt&&Z(R)))},le=q=>{ft||(n(22,R=pe(parseFloat(q.target.value))),R!==Mt&&(Mt=R,Y(R)))};let Te;const me=q=>{const Ie=be[u],se=o/r*Ie;N(se+q.detail[$],Ie),clearTimeout(Te),Te=setTimeout(()=>{Z(R)},250)},Me=q=>{const Ie=be.getBoundingClientRect(),V=q[f]-Ie[$],dt=be[u];return Math.abs(V-a*dt)};let qe;const Ne=q=>{clearTimeout(qe);let Ie=!1;Fe&&q.stopPropagation(),clearTimeout(Te);const se=be.getBoundingClientRect();if(ft=be[u],De=q[f],Se=De-se[$],de){if(Math.abs(Se-a*ft)>U)return;Ie=!0,q.stopPropagation()}return document.activeElement!==be&&be.focus(),N(Se,ft,{grabbed:!0}),document.documentElement.addEventListener("pointermove",mt),document.documentElement.addEventListener("pointerup",ue),Ie},mt=q=>{const Ie=q[f]-De;N(Se+Ie,ft)},ue=q=>{qe=setTimeout(()=>{ft=void 0},50),document.documentElement.removeEventListener("pointermove",mt),document.documentElement.removeEventListener("pointerup",ue),Y(R),Z(R)},He=()=>{n(22,R=ie(o+G*C)),Y(R)};let Qe=null,G=1,je=!1;const ye=q=>Ie=>{Ie.type==="keydown"&&(!XS(Ie.key)||Qe!==null)||(clearTimeout(Te),G=q,je=!1,Qe=setInterval(()=>{je=!0,He()},100),Ie.type==="pointerdown"?(document.addEventListener("pointercancel",$e),document.addEventListener("pointerup",$e)):document.addEventListener("keyup",$e))},$e=q=>{clearTimeout(Qe),Qe=null,je||He(),Z(R),document.removeEventListener("pointerup",$e),document.removeEventListener("keyup",$e)},St=q=>{const Ie=$u(q),se=Ie<0?Math.floor(Ie):Math.ceil(Ie);n(22,R=ie(o+se*C)),Y(R)};function Je(q){vn[q?"unshift":"push"](()=>{be=q,n(15,be)})}return e.$$set=q=>{"id"in q&&n(23,p=q.id),"label"in q&&n(0,y=q.label),"hideLabel"in q&&n(1,w=q.hideLabel),"min"in q&&n(2,_=q.min),"max"in q&&n(3,P=q.max),"step"in q&&n(4,C=q.step),"value"in q&&n(22,R=q.value),"valueMin"in q&&n(24,I=q.valueMin),"valueMax"in q&&n(25,M=q.valueMax),"trackClass"in q&&n(5,T=q.trackClass),"knobClass"in q&&n(6,v=q.knobClass),"ongrab"in q&&n(26,H=q.ongrab),"onchange"in q&&n(27,Y=q.onchange),"onrelease"in q&&n(28,Z=q.onrelease),"onexceed"in q&&n(29,W=q.onexceed),"direction"in q&&n(7,$=q.direction),"getValue"in q&&n(30,S=q.getValue),"setValue"in q&&n(31,pe=q.setValue),"enableSpinButtons"in q&&n(8,ge=q.enableSpinButtons),"enableForceUseKnob"in q&&n(9,de=q.enableForceUseKnob),"enableStopPropagation"in q&&n(32,Fe=q.enableStopPropagation),"enablePointerdownListener"in q&&n(10,X=q.enablePointerdownListener),"max
89InteractionDistance"in q&&n(33,U=q.maxInteractionDistance),"class"in q&&n(11,ae=q.class),"$$scope"in q&&n(40,g=q.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&8388609&&n(17,i=p||(y?`PinturaSlider_${Yr()}`:void 0)),e.$$.dirty[0]&1077936128&&n(13,o=R!==void 0?S(R):0),e.$$.dirty[0]&12&&(r=P-_),e.$$.dirty[0]&8204&&n(35,a=vu(o,_,P)),e.$$.dirty[1]&16&&n(14,l=a*100),e.$$.dirty[0]&128&&n(36,s=$.toUpperCase()),e.$$.dirty[0]&128&&n(37,c=$==="x"?"Width":"Height"),e.$$.dirty[1]&64&&(u=`offset${c}`),e.$$.dirty[1]&32&&(f=`page${s}`),e.$$.dirty[0]&16384|e.$$.dirty[1]&32&&n(16,d=`translate${s}(${l}%)`)},[y,w,_,P,C,T,v,$,ge,de,X,ae,Ne,o,l,be,d,i,le,me,ye,St,R,p,I,M,H,Y,Z,W,S,pe,Fe,U,Me,a,s,c,m,Je,g]}class sg extends gn{constructor(t){super(),mn(this,t,WC,VC,rn,{id:23,label:0,hideLabel:1,min:2,max:3,step:4,value:22,valueMin:24,valueMax:25,trackClass:5,knobClass:6,ongrab:26,onchange:27,onrelease:28,onexceed:29,direction:7,getValue:30,setValue:31,enableSpinButtons:8,enableForceUseKnob:9,enableStopPropagation:32,enablePointerdownListener:10,maxInteractionDistance:33,class:11,eventDistanceToKnob:34,handlePointerDown:12},null,[-1,-1])}get eventDistanceToKnob(){return this.$$.ctx[34]}get handlePointerDown(){return this.$$.ctx[12]}}function mb(e){let t,n;return t=new Br({props:{class:"PinturaButtonIcon",$$slots:{default:[UC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&1048580&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function UC(e){let t;return{c(){t=Ao("g")},m(n,i){te(n,t,i),t.innerHTML=e[2]},p(n,i){i&4&&(t.innerHTML=n[2])},d(n){n&&ee(t)}
89}}function gb(e){let t,n=Lo(e[8],e[6])+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class","PinturaButtonLabelPrefix")},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r&320&&n!==(n=Lo(o[8],o[6])+"")&&vi(i,n)},d(o){o&&ee(t)}}}function HC(e){let t,n,i,o,r,a,l,s,c,u=e[2]&&mb(e),f=e[8]&&gb(e);return{c(){t=fe("span"),u&&u.c(),n=ut(),f&&f.c(),i=ut(),o=fe("span"),r=bi(e[9]),k(o,"class",a=pn(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),k(t,"slot","label"),k(t,"title",l=Lo(e[1],e[6])),k(t,"class",s=pn(["PinturaButtonInner",e[4]]))},m(d,m){te(d,t,m),u&&u.m(t,null),Ae(t,n),f&&f.m(t,null),Ae(t,i),Ae(t,o),Ae(o,r),c=!0},p(d,m){d[2]?u?(u.p(d,m),m&4&&L(u,1)):(u=mb(d),u.c(),L(u,1),u.m(t,n)):u&&(Et(),z(u,1,1,()=>{u=null}),At()),d[8]?f?f.p(d,m):(f=gb(d),f.c(),f.m(t,i)):f&&(f.d(1),f=null),(!c||m&512)&&vi(r,d[9]),(!c||m&40&&a!==(a=pn(["PinturaButtonLabel",d[3],d[5]&&"implicit"])))&&k(o,"class",a),(!c||m&66&&l!==(l=Lo(d[1],d[6])))&&k(t,"title",l),(!c||m&16&&s!==(s=pn(["PinturaButtonInner",d[4]])))&&k(t,"class",s)},i(d){c||(L(u),c=!0)},o(d){z(u),c=!1},d(d){d&&ee(t),u&&u.d(),f&&f.d()}}}function NC(e){let t,n,i,o,r;const a=[{label:Lo(e[1],e[6])},{hideLabel:!0},e[12],{value:e[7]},{onchange:e[11]}];let l={};for(let s=0;s<a.length;s+=1)l=wi(l,a[s]);return n=new sg({props:l}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"slot","details")},m(s,c){te(s,t,c),ve(n,t,null),i=!0,o||(r=Pe(t,"keydown",e[10]),o=!0)},p(s,c){const u=c&6338?fo(a,[c&66&&{label:Lo(s[1],s[6])},a[1],c&4096&&yo(s[12]),c&128&&{value:s[7]},c&2048&&{onchange:s[11]}]):{};n.$set(u)},i(s){i||(L(n.$$.fragment,s),i=!0)},o(s){z(n.$$.fragment,s),i=!1},d(s){s&&ee(t),Oe(n),o=!1,r()}}}function GC(e){let t,n;return t=new nh({props:{panelClass:"PinturaSliderPanel",buttonClass:pn(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"]),$$slots:{details:[NC],label:[HC]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,[o]){const r={};o&33&&(r.buttonClass=pn(["PinturaSliderButton",i[0],i[5]&&"PinturaSliderIconOnly"])),o&1053694&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function jC(e,t,n){const i=["class","title","label","icon","labelClass","innerClass","hideLabel","locale","value","onchange","labelPrefix"];let o=$0(t,i),{class:r=void 0}=t,{title:a=void 0}=t,{label:l=Math.round}=t,{icon:s=void 0}=t,{labelClass:c=void 0}=t,{innerClass:u=void 0}=t,{hideLabel:f=!1}=t,{locale:d=void 0}=t,{value:m=void 0}=t,{onchange:g=st}=t,{labelPrefix:p=void 0}=t;const{min:y,max:w,getValue:_=Nn}=o;let P;const C=T=>{/tab/i.test(T.key)&&T.preventDefault()},R=T=>xn(l)?l(_(T),y,w,T):l,I=T=>{M(T),g(T)},M=T=>n(9,P=R(T));return e.$$set=T=>{t=wi(wi({},t),Nu(T)),n(12,o=$0(t,i)),"class"in T&&n(0,r=T.class),"title"in T&&n(1,a=T.title),"label"in T&&n(13,l=T.label),"icon"in T&&n(2,s=T.icon),"labelClass"in T&&n(3,c=T.labelClass),"innerClass"in T&&n(4,u=T.innerClass),"hideLabel"in T&&n(5,f=T.hideLabel),"locale"in T&&n(6,d=T.locale),"value"in T&&n(7,m=T.value),"onchange"in T&&n(14,g=T.onchange),"labelPrefix"in T&&n(8,p=T.labelPrefix)},e.$$.update=()=>{e.$$.dirty&8320&&M(m)},[r,a,s,c,u,f,d,m,p,P,C,I,o,l,g]}class ZC extends gn{constructor(t){super(),mn(this,t,jC,GC,rn,{class:0,title:1,label:13,icon:2,labelClass:3,innerClass:4,hideLabel:5,locale:6,value:7,onchange:14,labelPrefix:8})}}function XC(e){let t,n,i,o,r,a,l,s;return{c(){t=fe("span"),n=Ao("svg"),i=Ao("g"),o=Ao("circle"),r=Ao("circle"),a=ut(),l=fe("span"),s=bi(e[3]),k(o,"class","PinturaProgressIndicatorBar"),k(o,"r","8.5"),k(o,"cx","10"),k(o,"cy","10"),k(o,"stroke-linecap","round"),k(o,"opacity",".25"),k(r,"class","PinturaProgressIndicatorFill"),k(r,"r","8.5"),k(r,"stroke-dasharray",e[2]),k(r,"cx","10"),k(r,"cy","10"),k(r,"transform","rotate(-90) translate(-20)"),k(i,"fill","none"),k(i,"stroke","currentColor"),k(i,"stroke-width","2.5"),k(i,"stroke-linecap","round"),k(i,"opacity",e[1]),k(n,"width","20"),k(n,"height","20"),k(n,"viewBox","0 0 20 20"),k(n,"xmlns","http://www.w3.org/2000/svg"),k(n,"aria-hidden","true"),k(n,"focusable","false"),k(l,"class","implicit"),k(t,"class","PinturaProgressIndicator"),k(t,"data-status",e[0]),Ee(t,"opacity",e[4])},m(c,u){te(c,t,u),Ae(t,n),Ae(n,i),Ae(i,o),Ae(i,r),Ae(t,a),Ae(t,l),Ae(l,s)},p(c,[u]){u&4&&k(r,"stroke-dasharray",c[2]),u&2&&k(i,"opacity",c[1]),u&8&&vi(s,c[3]),u&1&&k(t,"data-status",c[0]),u&16&&Ee(t,"opacity",c[4])},i:qt,o:qt,d(c){c&&ee(t)}
89}}function KC(e,t,n){let i,o,r,a,l,s,c,u;const f=Xa();let{progress:d}=t,{min:m=0}=t,{max:g=100}=t,{labelBusy:p="Busy"}=t,{opacity:y=void 0}=t;const w=Qn("isAnimated");B(e,w,M=>n(14,l=M));const _=hn(y,{precision:.01});B(e,_,M=>n(4,u=M));const P=hn(0,{precision:.01}),C=hn(0,{precision:.01});B(e,C,M=>n(15,s=M));const R=Ln([P],M=>Xn(M,m,g));B(e,R,M=>n(16,c=M));const I=R.subscribe(M=>{d===1&&Math.round(M)>=100&&f("complete")});return ss(()=>{C.set(1,{hard:!l})}),Jr(()=>{I()}),e.$$set=M=>{"progress"in M&&n(9,d=M.progress),"min"in M&&n(10,m=M.min),"max"in M&&n(11,g=M.max),"labelBusy"in M&&n(12,p=M.labelBusy),"opacity"in M&&n(13,y=M.opacity)},e.$$.update=()=>{e.$$.dirty&24576&&Ht(y)&&_.set(y,{hard:!l}),e.$$.dirty&16896&&d&&d!==1/0&&P.set(d*100,{hard:!l}),e.$$.dirty&70144&&n(3,i=d===1/0?p:`${Math.round(c)}%`),e.$$.dirty&66048&&n(2,o=d===1/0?"26.5 53":`${c/100*53} 53`),e.$$.dirty&32768&&n(1,r=s),e.$$.dirty&512&&n(0,a=d===1/0?"busy":"loading")},[a,r,o,i,u,w,_,C,R,d,m,g,p,y,l,s,c]}class qS extends gn{constructor(t){super(),mn(this,t,KC,XC,rn,{progress:9,min:10,max:11,labelBusy:12,opacity:13})}}function bb(e){let t,n=Lo(e[0],e[1])+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class",e[3])},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r&3&&n!==(n=Lo(o[0],o[1])+"")&&vi(i,n),r&8&&k(t,"class",o[3])},d(o){o&&ee(t)}}}function YC(e){let t,n,i,o,r=e[0]&&bb(e);return i=new Xo({props:{items:e[2]}}),{c(){t=fe("li"),r&&r.c(),n=ut(),Ve(i.$$.fragment),k(t,"class","PinturaShapeStyle")},m(a,l){te(a,t,l),r&&r.m(t,null),Ae(t,n),ve(i,t,null),o=!0},p(a,[l]){a[0]?r?r.p(a,l):(r=bb(a),r.c(),r.m(t,n)):r&&(r.d(1),r=null);const s={};l&4&&(s.items=a[2]),i.$set(s)},i(a){o||(L(i.$$.fragment,a),o=!0)},o(a){z(i.$$.fragment,a),o=!1},d(a){a&&ee(t),r&&r.d(),Oe(i)}}}function qC(e,t,n){let i,{title:o}=t,{locale:r}=t,{items:a}=t,{hideTitle:l=!1}=t;return e.$$set=s=>{"title"in s&&n(0,o=s.title),"locale"in s&&n(1,r=s.locale),"items"in s&&n(2,a=s.items),"hideTitle"in s&&n(4,l=s.hideTitle)},e.$$.update=()=>{e.$$.dirty&16&&n(3,i="PinturaShapeStyleLabel"+(l?" implicit":""))},[o,r,a,i,l]}class JC extends gn{constructor(t){super(),mn(this,t,qC,YC,rn,{title:0,locale:1,items:2,hideTitle:4})}}var QC=(e,t,n)=>{let i=Math.max(e,t,n),o=i-Math.min(e,t,n),r=o&&(i==e?(t-n)/o:i==t?2+(n-e)/o:4+(e-t)/o);return[60*(r<0?r+6:r)/360,i&&o/i,i]},pb=(e,t,n)=>{let i,o,r;const a=Math.floor(e*6),l=e*6-a,s=n*(1-t),c=n*(1-l*t),u=n*(1-(1-l)*t);switch(a%6){case 0:i=n,o=u,r=s;break;case 1:i=c,o=n,r=s;break;case 2:i=s,o=n,r=u;break;case 3:i=s,o=c,r=n;break;case 4:i=u,o=s,r=n;break;case 5:i=n,o=s,r=c;break}return[i,o,r]};function $C(e){let t,n;return{c(){t=fe("div"),n=fe("span"),k(t,"class","PinturaColorPreview"),k(t,"title",e[0]),Ee(t,"--color",e[1])},m(i,o){te(i,t,o),Ae(t,n)},p(i,[o]){o&1&&k(t,"title",i[0]),o&2&&Ee(t,"--color",i[1])},i:qt,o:qt,d(i){i&&ee(t)}}}function eP(e,t,n){let i,{color:o=void 0}=t,{title:r=void 0}=t;return e.$$set=a=>{"color"in a&&n(2,o=a.color),"title"in a&&n(0,r=a.title)},e.$$.update=()=>{e.$$.dirty&4&&n(1,i=o?Eo(o):"transparent")},[r,i,o]}class cg extends gn{constructor(t){super(),mn(this,t,eP,$C,rn,{color:2,title:0})}}var tP=e=>{const[,t,n,i,o]=e.split("");e=e.length>=4&&e.length<=5?`#${t}${t}${n}${n}${i}${i}${o?`${o}${o}`:""}`:e;const[r,a,l,s,c]=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e)||[];if(r)return[a,l,s,c].filter(u=>u!==void 0).map(u=>parseInt(u,16)/255)},mm=e=>{if(e=e.trim(),/^rgba/.test(e))return e.substring(5).split(",").map(parseFloat).map((t,n)=>t/(n===3?1:255));if(/^rgb/.test(e))return e.substring(4).split(",").map(parseFloat).map(t=>t/255);if(/^#/.test(e))return tP(e);if(/[0-9]{1,3}\s?,\s?[0-9]{1,3}\s?,\s?[0-9]{1,3}/.test(e))return e.split(",").map(t=>parseInt(t,10)).map(t=>t/255)};let z1=null;var nP=()=>(z1===null&&(z1=zo()&&"EyeDropper"in window),z1);function yb(e){let t,n;return{c(){t=fe("span"),n=bi(e[0])},m(i,o){te(i,t,o),Ae(t,n)},p(i,o){o[0]&1&&vi(n,i[0])},d(i){i&&ee(t)}}}function iP(e){let t,n,i,o;n=new cg({props:{color:e[4],title:Lo(e[8],e[10])}});let r=!e[9]&&yb(e);return{c(){t=fe("span"),Ve(n.$$.fragment),i=ut(),r&&r.c(),k(t,"slot","label"),k(t,"class","PinturaButtonLabel")},m(a,l){te(a,t,l),ve(n,t,null),Ae(t,i),r&&r.m(t,null),o=!0},p(a,l){const s={};l[0]&16&&(s.color=a[4]),l[0]&1280&&(s.title=Lo(a[8],a[10])),n.$set(s),a[9]?r&&(r.d(1),r=null):r?r.p(a,l):(r=yb(a),r.c(),r.m(t,null))},i(a){o||(L(n.$$.fragment,a),o=!0)},o(a){z(n.$$.fragment,a),o=!1},d(a){a&&ee(t),Oe(n),r&&r.d()}}}function Sb(e){let t,n,i,o,r,a,l,s,c,u,f,d;l=new sg({props:{label:"Hue",hideLabel:!0,class:"PinturaHuePicker",onchange:e[27],value:e[16],min:0,max:1,step:.
8901}});let m=e[11]&&wb(e),g=(e[14]||e[15])&&_b(e);return{c(){t=fe("div"),n=fe("div"),i=fe("div"),o=fe("div"),r=ut(),a=fe("div"),Ve(l.$$.fragment),s=ut(),m&&m.c(),c=ut(),g&&g.c(),k(o,"role","button"),k(o,"aria-label","Saturation slider"),k(o,"class","PinturaPickerKnob"),k(o,"tabindex","0"),Ee(o,"background-color",e[20]),k(i,"class","PinturaPickerKnobController"),Ee(i,"transform",`translate(${e[25]}%,${e[24]}%)`),k(n,"class","PinturaSaturationPicker"),Ee(n,"background-color",e[21]),Ee(a,"--knob-background",e[21]),k(t,"class","PinturaPicker")},m(p,y){te(p,t,y),Ae(t,n),Ae(n,i),Ae(i,o),e[42](n),Ae(t,r),Ae(t,a),ve(l,a,null),Ae(t,s),m&&m.m(t,null),Ae(t,c),g&&g.m(t,null),u=!0,f||(d=[Pe(o,"nudge",e[30]),wn(Al.call(null,o,{preventDefault:!0})),Pe(n,"pointerdown",e[29])],f=!0)},p(p,y){y[0]&1048576&&Ee(o,"background-color",p[20]),y[0]&50331648&&Ee(i,"transform",`translate(${p[25]}%,${p[24]}%)`),y[0]&2097152&&Ee(n,"background-color",p[21]);const w={};y[0]&65536&&(w.value=p[16]),l.$set(w),y[0]&2097152&&Ee(a,"--knob-background",p[21]),p[11]?m?(m.p(p,y),y[0]&2048&&L(m,1)):(m=wb(p),m.c(),L(m,1),m.m(t,c)):m&&(Et(),z(m,1,1,()=>{m=null}),At()),p[14]||p[15]?g?(g.p(p,y),y[0]&49152&&L(g,1)):(g=_b(p),g.c(),L(g,1),g.m(t,null)):g&&(Et(),z(g,1,1,()=>{g=null}),At())},i(p){u||(L(l.$$.fragment,p),L(m),L(g),u=!0)},o(p){z(l.$$.fragment,p),z(m),z(g),u=!1},d(p){p&&ee(t),e[42](null),Oe(l),m&&m.d(),g&&g.d(),f=!1,On(d)}}}function wb(e){let t,n,i;return n=new sg({props:{label:"Opacity",hideLabel:!0,class:"PinturaOpacityPicker",onchange:e[28],value:e[17],min:0,max:1,step:.01}}),{c(){t=fe("div"),Ve(n.$$.fragment),Ee(t,"--knob-background",e[18]),Ee(t,"--track-background",`linear-gradient(to right,${e[19]},${e[20]})`)},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&131072&&(a.value=o[17]),n.$set(a),r[0]&262144&&Ee(t,"--knob-background",o[18]),r[0]&1572864&&Ee(t,"--track-background",`linear-gradient(to right,${o[19]},${o[20]})`)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function _b(e){let t,n,i,o,r,a,l,s=e[15]&&Tb(e);return{c(){t=fe("div"),n=fe("input"),o=ut(),s&&s.c(),k(n,"class","PinturaColorPickerInput"),k(n,"type","text"),n.disabled=i=!e[14],n.value=e[23],k(t,"class","PinturColorPickerInputGroup")},m(c,u){te(c,t,u),Ae(t,n),Ae(t,o),s&&s.m(t,null),r=!0,a||(l=[Pe(n,"keydown",e[32]),Pe(n,"input",e[31])],a=!0)},p(c,u){(!r||u[0]&16384&&i!==(i=!c[14]))&&(n.disabled=i),(!r||u[0]&8388608&&n.value!==c[23])&&(n.value=c[23]),c[15]?s?(s.p(c,u),u[0]&32768&&L(s,1)):(s=Tb(c),s.c(),L(s,1),s.m(t,null)):s&&(Et(),z(s,1,1,()=>{s=null}),At())},i(c){r||(L(s),r=!0)},o(c){z(s),r=!1},d(c){c&&ee(t),s&&s.d(),a=!1,On(l)}}}function Tb(e){let t,n;return t=new Ll({props:{icon:'<path stroke="currentColor" stroke-linecap="square" d="m13 14-7 7a2.704 2.704 0 0 1-3 0 2.704 2.704 0 0 1 0-3l7-7"/><path fill="currentColor" d="M9.475 9.475 14.5 14.5c.263.263.69.265.955.005l.783-.767a4.209 4.209 0 0 0 1.262-3.006V10l4-4c.5-.5.375-2.125-.5-3s-2.5-1-3-.5l-4 4h-.732a4.329 4.329 0 0 0-3.03 1.238l-.758.742a.7.7 0 0 0-.005.995Z"/>',hideLabel:!0,label:"Pick a color",class:"PinturaEyeDropper",onclick:e[33]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p:qt,i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function kb(e){let t,n;return t=new El({props:{label:Lo(e[10].labelColorPalette,e[10]),class:pn(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"]),hideLabel:!1,name:e[1],value:e[4],optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[2].map(e[43]),selectedIndex:e[3],optionMapper:e[7],optionLabelClass:e[6],onchange:e[44],$$slots:{option:[rP,({option:i})=>({60:i}),({option:i})=>[0,i?536870912:0]],group:[oP,({option:i})=>({60:i}),({option:i})=>[0,i?536870912:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&1024&&(r.label=Lo(i[10].labelColorPalette,i[10])),o[0]&512&&(r.class=pn(["PinturaColorPresets",i[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"])),o[0]&2&&(r.name=i[1]),o[0]&16&&(r.value=i[4]),o[0]&4&&(r.options=i[2].map(i[43])),o[0]&8&&(r.selectedIndex=i[3]),o[0]&128&&(r.optionMapper=i[7]),o[0]&64&&(r.optionLabelClass=i[6]),o[0]&512|o[1]&1610612736&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function oP(e){let t,n=e[60].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"slot","group")},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[1]&536870912&&n!==(n=o[60].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function Cb(e){let t,n=e[60].label+"",i;return{c(){t=fe("span"),i=bi(n),k(t,"class","PinturaButtonLabel")},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[1]&536870912&&n!==(n=o[60].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function rP(e){let t,n,i,o;n=new cg({props:{color:e[60].value}});let r=!e[9]&&Cb(e);return{c(){t=fe("span"),Ve(n.$$.fragment),i=ut(),r&&r.c(),k(t,"slot","o
89ption")},m(a,l){te(a,t,l),ve(n,t,null),Ae(t,i),r&&r.m(t,null),o=!0},p(a,l){const s={};l[1]&536870912&&(s.color=a[60].value),n.$set(s),a[9]?r&&(r.d(1),r=null):r?r.p(a,l):(r=Cb(a),r.c(),r.m(t,null))},i(a){o||(L(n.$$.fragment,a),o=!0)},o(a){z(n.$$.fragment,a),o=!1},d(a){a&&ee(t),Oe(n),r&&r.d()}}}function aP(e){let t,n,i,o=e[13]&&Sb(e),r=e[12]&&kb(e);return{c(){t=fe("div"),o&&o.c(),n=ut(),r&&r.c(),k(t,"slot","details"),k(t,"class","PinturaColorPickerPanel")},m(a,l){te(a,t,l),o&&o.m(t,null),Ae(t,n),r&&r.m(t,null),i=!0},p(a,l){a[13]?o?(o.p(a,l),l[0]&8192&&L(o,1)):(o=Sb(a),o.c(),L(o,1),o.m(t,n)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[12]?r?(r.p(a,l),l[0]&4096&&L(r,1)):(r=kb(a),r.c(),L(r,1),r.m(t,null)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&ee(t),o&&o.d(),r&&r.d()}}}function lP(e){let t,n;return t=new nh({props:{buttonClass:pn(["PinturaColorPickerButton",e[5]]),$$slots:{details:[aP],label:[iP]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&32&&(r.buttonClass=pn(["PinturaColorPickerButton",i[5]])),o[0]&67108831|o[1]&1073741824&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function sP(e,t,n){let i,o,r,a,l,{label:s=void 0}=t,{name:c=void 0}=t,{options:u=[]}=t,{selectedIndex:f=-1}=t,{value:d=void 0}=t,{buttonClass:m=void 0}=t,{optionLabelClass:g=void 0}=t,{optionMapper:p=void 0}=t,{onchange:y=void 0}=t,{title:w=void 0}=t,{hidePresetLabel:_=!0}=t,{locale:P=void 0}=t,{enableOpacity:C=!0}=t,{enablePresets:R=!0}=t,{enablePicker:I=!0}=t,{enableInput:M=!1}=t,{enableEyeDropper:T=!1}=t,v,H,Y,Z,W,$,S,pe="transparent",ge="transparent",de;const Fe=(q,Ie)=>{if(W=[q[0],q[1],q[2]],Ie){let se=QC(...W),V=se[0],dt=se[1],Ft=se[2];Ht(Se)&&(V=Se),Ht(be)&&(dt=be),Ht(ft)&&(Ft=ft),n(16,v=V),n(37,H=dt),n(38,Y=Ft),n(17,Z=Ht(q[3])?q[3]:1)}n(18,$=Eo(q)),n(19,S=Eo([...W,0])),n(20,pe=Eo([...W,1])),n(21,ge=Eo(pb(v,1,1)))},X=()=>{const Ie=[...pb(v,H,Y),Z];Fe(Ie),y(Ie)},U=q=>{const Ie=q.length===3?[...q,1]:q;ae(),Fe(Ie,!0),y(Ie)},ae=()=>{be=void 0,ft=void 0,Se=void 0};let be,ft,Se;const De=q=>{n(16,v=q),Se=q,X()},Mt=(q,Ie)=>{n(37,H=q),n(38,Y=Ie),be=q,ft=Ie,X()},gt=q=>{n(17,Z=q),X()},ie=(q,Ie)=>{const se=Xn(q.x/Ie.width,0,1),V=Xn(q.y/Ie.height,0,1);Mt(se,1-V)};let N,le,Te,me;const Me=q=>{q.stopPropagation(),le=Ci(N.offsetWidth,N.offsetHeight),Te=Vw(q),me=_0(q),ie(Te,le),document.documentElement.addEventListener("pointermove",qe),document.documentElement.addEventListener("pointerup",Ne)},qe=q=>{const Ie=Fi(_0(q),me);ie(xi(Ut(Te),Ie),le)},Ne=q=>{le=void 0,document.documentElement.removeEventListener("pointermove",qe),document.documentElement.removeEventListener("pointerup",Ne)},mt=q=>{le=Ci(N.offsetWidth,N.offsetHeight);const Ie=o/100*le.width,se=r/100*le.height;ie({x:Ie+q.detail.x,y:se+q.detail.y},le)};let ue;const He=(q,Ie,se)=>{let V=q.map(dt=>Math.round(dt*255).toString(16).toLowerCase().padStart(2,"0"));return(!Ie&&V.length>3||V[3]==="ff")&&V.pop(),se&&(V=V.map(dt=>dt.substring(0,1))),`#${V.join("")}`},Qe=q=>{const{value:Ie}=q.target,se=Ie.length;if(!Ie.startsWith("#")||se<4||se===6||se===8||se>9||!C&&se>7)return;const V=mm(Ie);V&&(n(40,ue=Ie),ae(),Fe(V),y(V))},G=q=>{q.stopPropagation()},je=q=>{new EyeDropper().open().then(({sRGBHex:Ie})=>{const se=mm(Ie);se&&(se[3]=1,n(40,ue=d),ae(),Fe(se),y(se))}).catch(Ie=>{})};function ye(q){return xn(q)?q(P):q}function $e(q){vn[q?"unshift":"push"](()=>{N=q,n(22,N)})}const St=([q,Ie])=>[q,ye(Ie),{title:ye(Ie)}],Je=q=>U(q.value);return e.$$set=q=>{"label"in q&&n(0,s=q.label),"name"in q&&n(1,c=q.name),"options"in q&&n(2,u=q.options),"selectedIndex"in q&&n(3,f=q.selectedIndex),"value"in q&&n(4,d=q.value),"buttonClass"in q&&n(5,m=q.buttonClass),"optionLabelClass"in q&&n(6,g=q.optionLabelClass),"optionMapper"in q&&n(7,p=q.optionMapper),"onchange"in q&&n(35,y=q.onchange),"title"in q&&n(8,w=q.title),"hidePresetLabel"in q&&n(9,_=q.hidePresetLabel),"locale"in q&&n(10,P=q.locale),"enableOpacity"in q&&n(11,C=q.enableOpacity),"enablePresets"in q&&n(12,R=q.enablePresets),"enablePicker"in q&&n(13,I=q.enablePicker),"enableInput"in q&&n(14,M=q.enableInput),"enableEyeDropper"in q&&n(36,T=q.enableEyeDropper)},e.$$.update=()=>{e.$$.dirty[1]&32&&n(15,i=T&&nP()),e.$$.dirty[0]&16|e.$$.dirty[1]&256&&d&&(!de||!Rl(d,de))&&(n(39,de=[...d]),Fe(d,!0)),e.$$.dirty[1]&64&&n(25,o=H*100),e.$$.dirty[1]&128&&n(24,r=100-Y*100),e.$$.dirty[1]&512&&n(41,a=ue?ue.length>=4&&ue.length<=5:!1),e.$$.dirty[0]&51216|e.$$.dirty[1]&1024&&n(23,l=(M||i)&&d?He(d,C,a):void 0)},[s,c,u,f,d,m,g,p,w,_,P,C,R,I,M,i,v,Z,$,S,pe,ge,N,l,r,o,U,De,gt,Me,mt,Qe,G,je,ye,y,T,H,Y,de,ue,a,$e,St,Je]}class cP extends gn{constructor(t){super(),mn(this,t,sP,lP,rn,{label:0,name:1,options:2,selectedIndex:3,value:4,buttonClass:5,optionLabelClass:6,optionMapper:7,onchange:35,title:8,hidePresetLabel:9,locale:10,enableOpacity:11,enablePresets:12,enablePicker:13,enableInput:14,enableEyeDropper:36},null,[-1,-1])}}function uP(e){let t,n,i;return n=new Xo({props:{items:e[0]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaShorthandControl PinturaShapeStyle")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,[r]){const a={};r&1&&(a.items=o[0]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function fP(e,t,n){let i,o,{value:r}=t,{onchange:a}=t,{controls:l=[]}=t;const s=c=>{const{controls:u,...f}=c;return f};return e.$$set=c=>{n(6,t=wi(wi({},t),Nu(c))),"value"in c&&n(1,r=c.value),"onchange"in c&&n(2,a=c.onchange),"controls"in c&&n(3,l=c.controls)},e.$$.update=()=>{n(4,i=s(t)),e.$$.dirty&30&&n(0,o=l.map((c,u)=>{const[f,d,m]=c;return[f,d,{...i,...m,value:r[u],onchange:g=>{const p=[...r];p[u]=g,a(p)}}]}))},t=Nu(t),[o,r,a,l,i]}class dP extends gn{constructor(t){super(),mn(this,t,fP,uP,rn,{value:1,onchange:2,controls:3})}}function hP(e){let t,n;return t=new lg({props:{label:e[4],options:e[1],title:e[2],selectedIndex:e[5],onchange:e[10]}}
89),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,[o]){const r={};o&16&&(r.label=i[4]),o&2&&(r.options=i[1]),o&4&&(r.title=i[2]),o&32&&(r.selectedIndex=i[5]),o&9&&(r.onchange=i[10]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function mP(e,t,n){let i,o,r,a,{options:l}=t,{title:s}=t,{onchange:c}=t,{selectedIndex:u=-1}=t,{value:f=void 0}=t,{label:d=void 0}=t;const m=(p,y,w)=>{if(p)return y>-1?p[y]:w!==void 0?p.find(_=>_[0]===w):p[0]},g=p=>{n(0,u=p.index),c&&c(p)};return e.$$set=p=>{"options"in p&&n(1,l=p.options),"title"in p&&n(2,s=p.title),"onchange"in p&&n(3,c=p.onchange),"selectedIndex"in p&&n(0,u=p.selectedIndex),"value"in p&&n(6,f=p.value),"label"in p&&n(7,d=p.label)},e.$$.update=()=>{e.$$.dirty&67&&n(9,i=m(l,u,f)),e.$$.dirty&514&&n(5,o=l&&l.findIndex(p=>p===i)),e.$$.dirty&512&&n(8,r=i&&i[1]),e.$$.dirty&384&&n(4,a=d||r)},[u,l,s,c,a,o,f,d,r,i,g]}class gP extends gn{constructor(t){super(),mn(this,t,mP,hP,rn,{options:1,title:2,onchange:3,selectedIndex:0,value:6,label:7})}}function Pb(e,t,n){const i=e.slice();return i[9]=t[n][0],i[0]=t[n][1],i[10]=t[n][2],i[2]=t[n][3],i}function bP(e){let t,n,i;const o=[e[10]];var r=e[3][e[9]]||e[9];function a(l,s){let c={};for(let u=0;u<o.length;u+=1)c=wi(c,o[u]);return s!==void 0&&s&4&&(c=wi(c,fo(o,[yo(l[10])]))),{props:c}}return r&&(t=Ud(r,a(e))),{c(){t&&Ve(t.$$.fragment),n=Mi()},m(l,s){t&&ve(t,l,s),te(l,n,s),i=!0},p(l,s){if(s&4&&r!==(r=l[3][l[9]]||l[9])){if(t){Et();const c=t;z(c.$$.fragment,1,0,()=>{Oe(c,1)}),At()}r?(t=Ud(r,a(l,s)),Ve(t.$$.fragment),L(t.$$.fragment,1),ve(t,n.parentNode,n)):t=null}else if(r){const c=s&4?fo(o,[yo(l[10])]):{};t.$set(c)}},i(l){i||(t&&L(t.$$.fragment,l),i=!0)},o(l){t&&z(t.$$.fragment,l),i=!1},d(l){l&&ee(n),t&&Oe(t,l)}}}function pP(e){let t=e[9],n,i=e[9]&&V1(e);return{c(){i&&i.c(),n=Mi()},m(o,r){i&&i.m(o,r),te(o,n,r)},p(o,r){o[9]?t?rn(t,o[9])?(i.d(1),i=V1(o),t=o[9],i.c(),i.m(n.parentNode,n)):i.p(o,r):(i=V1(o),t=o[9],i.c(),i.m(n.parentNode,n)):t&&(i.d(1),i=null,t=o[9])},i:qt,o(o){z(i,o)},d(o){o&&ee(n),i&&i.d(o)}}}function yP(e){let t,n=e[10].innerHTML+"",i;return{c(){t=new qm(!1),i=Mi(),t.a=i},m(o,r){t.m(n,o,r),te(o,i,r)},p(o,r){r&4&&n!==(n=o[10].innerHTML+"")&&t.p(n)},i:qt,o:qt,d(o){o&&(ee(i),t.d())}}}function SP(e){let t=e[10].textContent+"",n;return{c(){n=bi(t)},m(i,o){te(i,n,o)},p(i,o){o&4&&t!==(t=i[10].textContent+"")&&vi(n,t)},i:qt,o:qt,d(i){i&&ee(n)}}}function wP(e){let t,n;return t=new Xo({props:{items:e[2],discardEmptyItems:!0}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&4&&(r.items=i[2]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function V1(e){let t,n,i,o,r;const a=[wP,SP,yP],l=[];function s(f,d){return f[2]&&f[2].length?0:f[10].textContent?1:f[10].innerHTML?2:-1}~(n=s(e))&&(i=l[n]=a[n](e));let c=[e[4](e[10])],u={};for(let f=0;f<c.length;f+=1)u=wi(u,c[f]);return{c(){t=fe(e[9]),i&&i.c(),o=ut(),e2(e[9])(t,u)},m(f,d){te(f,t,d),~n&&l[n].m(t,null),Ae(t,o),r=!0},p(f,d){let m=n;n=s(f),n===m?~n&&l[n].p(f,d):(i&&(Et(),z(l[m],1,1,()=>{l[m]=null}),At()),~n?(i=l[n],i?i.p(f,d):(i=l[n]=a[n](f),i.c()),L(i,1),i.m(t,o)):i=null),e2(f[9])(t,u=fo(c,[d&4&&f[4](f[10])]))},i(f){r||(L(i),r=!0)},o(f){z(i),r=!1},d(f){f&&ee(t),~n&&l[n].d()}}}function Mb(e,t){let n,i,o,r,a,l;const s=[pP,bP],c=[];function u(f,d){return d&4&&(i=null),i==null&&(i=!f[5](f[9])),i?0:1}return o=u(t,-1),r=c[o]=s[o](t),{key:e,first:null,c(){n=Mi(),r.c(),a=Mi(),this.first=n},m(f,d){te(f,n,d),c[o].m(f,d),te(f,a,d),l=!0},p(f,d){t=f;let m=o;o=u(t,d),o===m?c[o].p(t,d):(Et(),z(c[m],1,1,()=>{c[m]=null}),At(),r=c[o],r?r.p(t,d):(r=c[o]=s[o](t),r.c()),L(r,1),r.m(a.parentNode,a))},i(f){l||(L(r),l=!0)},o(f){z(r),l=!1},d(f){f&&(ee(n),ee(a)),c[o].d(f)}}}function _P(e){let t=[],n=new Map,i,o,r=xo(e[2]);const a=l=>l[0]+l[1];for(let l=0;l<r.length;l+=1){let s=Pb(e,r,l),c=a(s);n.set(c,t[l]=Mb(c,s))}return{c(){for(let l=0;l<t.length;l+=1)t[l].c();i=Mi()},m(l,s){for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(l,s);te(l,i,s),o=!0},p(l,[s]){s&62&&(r=xo(l[2]),Et(),t=cl(t,s,a,1,l,r,n,i.parentNode,cs,Mb,i,Pb),At())},i(l){if(!o){for(let s=0;s<r.length;s+=1)L(t[s]);o=!0}},o(l){for(let s=0;s<t.length;s+=1)z(t[s]);o=!1},d(l){l&&ee(i);for(let s=0;s<t.length;s+=1)t[s].d(l)}}}function TP(e,t,n){let i,o,{items:r}=t,{discardEmptyItems:a=!0}=t,{key:l=""}=t;const s={Button:Ll,ImageButton:HS,ImageButtonList:ag,Dropdown:lg,Select:gP,RadioGroup:El,Input:YS,Panel:xC,ProgressIndicator:qS,ShapeStyle:JC,ToggleSlider:ZC,ColorPicker:cP,ShorthandControl:dP},c=(d={})=>{const{textContent:m,innerHTML:g,...p}=d;return p},u=d=>!Nt(d)||!!s[d],f=d=>{if(!d)return!1;const[m,,g,p=[]]=d;return u(m)?!0:p.some(f)||g.textContent||g.innerHTML};return e.$$set=d=>{"items"in d&&n(6,r=d.items),"discardEmptyItems"in d&&n(7,a=d.discardEmptyItems),"key"in d&&n(0,l=d.key)},e.$$.update=()=>{e.$$.dirty&1&&n(1,i=l),e.$$.dirty&192&&n(2,o=(r&&a?r.filter(f):r)||[])},[l,i,o,s,c,u,r,a]}class Xo extends gn{constructor(t){super(),mn(this,t,TP,_P,rn,{items:6,discardEmptyItems:7,key:0})}get items(){return this.$$.ctx[6]}set items(t){this.$$set({items:t}),F()}get discardEmptyItems(){return this.$$.ctx[7]}set discardEmptyItems(t){this.$$set({discardEmptyItems:t}),F()}get key(){return this.$$.ctx[0]}set key(t){this.$$set({key:t}),F()}}function Rb(e){let t,n;return t=new Br({props:{class:"PinturaButtonIcon",$$slots:{default:[kP]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&536870920&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function kP(e){let t;return{c(){t=Ao("g")},m(n,i){te(n,t,i),t.innerHTML=e[3]},p(n,i){i&8&&(t.innerHTML=n[3])},d(n){n&&ee(t)}
89}}function CP(e){let t;return{c(){t=fe("span"),k(t,"class",e[11])},m(n,i){te(n,t,i),t.innerHTML=e[0]},p(n,i){i&1&&(t.innerHTML=n[0]),i&2048&&k(t,"class",n[11])},i:qt,o:qt,d(n){n&&ee(t)}}}function PP(e){let t,n,i;return n=new Xo({props:{items:e[0]}}),{c(){t=fe("span"),Ve(n.$$.fragment),k(t,"class",e[11])},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r&1&&(a.items=o[0]),n.$set(a),(!i||r&2048)&&k(t,"class",o[11])},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function MP(e){let t,n,i,o,r,a,l=e[3]&&Rb(e);const s=[PP,CP],c=[];function u(f,d){return d&1&&(i=null),i==null&&(i=!!Si(f[0])),i?0:1}return o=u(e,-1),r=c[o]=s[o](e),{c(){t=fe("span"),l&&l.c(),n=ut(),r.c(),k(t,"class",e[13])},m(f,d){te(f,t,d),l&&l.m(t,null),Ae(t,n),c[o].m(t,null),a=!0},p(f,d){f[3]?l?(l.p(f,d),d&8&&L(l,1)):(l=Rb(f),l.c(),L(l,1),l.m(t,n)):l&&(Et(),z(l,1,1,()=>{l=null}),At());let m=o;o=u(f,d),o===m?c[o].p(f,d):(Et(),z(c[m],1,1,()=>{c[m]=null}),At(),r=c[o],r?r.p(f,d):(r=c[o]=s[o](f),r.c()),L(r,1),r.m(t,null)),(!a||d&8192)&&k(t,"class",f[13])},i(f){a||(L(l),L(r),a=!0)},o(f){z(l),z(r),a=!1},d(f){f&&ee(t),l&&l.d(),c[o].d()}}}function RP(e){let t,n,i,o,r,a;const l=e[27].default,s=lo(l,e,e[29],null),c=s||MP(e);return{c(){t=fe("button"),c&&c.c(),k(t,"type",e[6]),t.disabled=e[5],k(t,"class",e[12]),k(t,"title",n=Gd(e[0],e[1],e[2]))},m(u,f){te(u,t,f),c&&c.m(t,null),e[28](t),o=!0,r||(a=[Pe(t,"keydown",function(){kn(e[8])&&e[8].apply(this,arguments)}),Pe(t,"click",function(){kn(e[7])&&e[7].apply(this,arguments)}),Pe(t,"pointerdown",function(){kn(e[14])&&e[14].apply(this,arguments)}),wn(i=Il.call(null,t,e[4])),wn(e[9].call(null,t))],r=!0)},p(u,[f]){e=u,s?s.p&&(!o||f&536870912)&&co(s,l,e,e[29],o?so(l,e[29],f,null):uo(e[29]),null):c&&c.p&&(!o||f&10249)&&c.p(e,o?f:-1),(!o||f&64)&&k(t,"type",e[6]),(!o||f&32)&&(t.disabled=e[5]),(!o||f&4096)&&k(t,"class",e[12]),(!o||f&7&&n!==(n=Gd(e[0],e[1],e[2])))&&k(t,"title",n),i&&kn(i.update)&&f&16&&i.update.call(null,e[4])},i(u){o||(L(c,u),o=!0)},o(u){z(c,u),o=!1},d(u){u&&ee(t),c&&c.d(u),e[28](null),r=!1,On(a)}}}function IP(e,t,n){let i,o,r,a,l,{$$slots:s={},$$scope:c}=t,{class:u=void 0}=t,{label:f=void 0}=t,{title:d=void 0}=t,{shortcut:m=void 0}=t,{labelClass:g=void 0}=t,{innerClass:p=void 0}=t,{hideLabel:y=!1}=t,{icon:w=void 0}=t,{style:_=void 0}=t,{disabled:P=void 0}=t,{type:C="button"}=t,{onclick:R=void 0}=t,{onkeydown:I=void 0}=t,{onhold:M=void 0}=t,{action:T=()=>{}}=t,{holdThreshold:v=500}=t,{holdSpeedUpFactor:H=.5}=t,{holdSpeedMin:Y=20}=t,Z;const W=de=>{n(25,Z=setTimeout(()=>{M(),W(Math.max(de*H,Y))},de))};let $;const S=de=>US(de,$),pe=()=>$;function ge(de){vn[de?"unshift":"push"](()=>{$=de,n(10,$)})}return e.$$set=de=>{"class"in de&&n(15,u=de.class),"label"in de&&n(0,f=de.label),"title"in de&&n(1,d=de.title),"shortcut"in de&&n(2,m=de.shortcut),"labelClass"in de&&n(16,g=de.labelClass),"innerClass"in de&&n(17,p=de.innerClass),"hideLabel"in de&&n(18,y=de.hideLabel),"icon"in de&&n(3,w=de.icon),"style"in de&&n(4,_=de.style),"disabled"in de&&n(5,P=de.disabled),"type"in de&&n(6,C=de.type),"onclick"in de&&n(7,R=de.onclick),"onkeydown"in de&&n(8,I=de.onkeydown),"onhold"in de&&n(19,M=de.onhold),"action"in de&&n(9,T=de.action),"holdThreshold"in de&&n(20,v=de.holdThreshold),"holdSpeedUpFactor"in de&&n(21,H=de.holdSpeedUpFactor),"holdSpeedMin"in de&&n(22,Y=de.holdSpeedMin),"$$scope"in de&&n(29,c=de.$$scope)},e.$$.update=()=>{e.$$.dirty&101187584&&n(26,o=M?()=>{Z&&(clearTimeout(Z),n(25,Z=void 0),document.documentElement.removeEventListener("pointerup",o))}:st),e.$$.dirty&68681728&&n(14,i=M?()=>{document.documentElement.addEventListener("pointerup",o),W(v)}:st),e.$$.dirty&131072&&n(13,r=pn(["PinturaButtonInner",p])),e.$$.dirty&294912&&n(12,a=pn(["PinturaButton",y&&"PinturaButtonIconOnly",u])),e.$$.dirty&327680&&n(11,l=pn([y?"implicit":"PinturaButtonLabel",g]))},[f,d,m,w,_,P,C,R,I,T,$,l,a,r,i,u,g,p,y,M,v,H,Y,S,pe,Z,o,s,ge,c]}class Ll extends gn{constructor(t){super(),mn(this,t,IP,RP,rn,{class:15,label:0,title:1,shortcut:2,labelClass:16,innerClass:17,hideLabel:18,icon:3,style:4,disabled:5,type:6,onclick:7,onkeydown:8,onhold:19,action:9,holdThreshold:20,holdSpeedUpFactor:21,holdSpeedMin:22,isEventTarget:23,getElement:24})}get isEventTarget(){return this.$$.ctx[23]}get getElement(){return this.$$.ctx[24]}}var JS=(e,t)=>{const n=e.findIndex(t);if(n>=0)return e.splice(n,1)};const EP=.25,Ib=50,AP=80,LP=300,xP=64,FP=700,vP=128,OP=e=>Ht(e.button)&&e.button!==0;var xl=(e,t={})=>{const{inertia:n=!1,inertiaDurationMultiplier:i=AP,shouldStartInteraction:o=()=>!0,pinch:r=!1,multiTouch:a=void 0,getEventPosition:l=N=>re(N.clientX,N.clientY),observeKeys:s=!1}=t;function c(N,le){e.dispatchEvent(new CustomEvent(N,{detail:le}))}function u(){Z&&Z(),Z=void 0}const f=[],d=N=>N.timeStamp===0?Date.now():N.timeStamp,m=N=>{const le=d(N),Te={timeStamp:le,timeStampInitial:le,position:l(N),origin:l(N),velocity:Kn(),velocityHistory:[],velocityAverage:Kn(),translation:Kn(),interactionState:void 0,event:N};f.push(Te),Te.interactionState=T(f)},g=N=>{const le=JS(f,Te=>Te.event.pointerId===N.pointerId);if(le)return le[0]},p=()=>{f.length=0},y=N=>f.findIndex(le=>le.event.pointerId===N.pointerId),w=()=>{const N=Ut(f[0].position);if(f[1]){const le=(f[1].position.x-N.x)*.5,Te=(f[1].position.y-N.y)*.5;N.x+=le,N.y+=Te}return N},_=N=>{N.origin.x=N.position.x,N.origin.y=N.position.y,N.translation.x=0,N.translation.y=0},P=N=>{const le=C(N);if(!le)return;const Te=d(N),me=l(N),Me=Math.max(1,Te-le.timeStamp);le.velocity.x=(me.x-le.position.x)/Me,le.velocity.y=(me.y-le.position.y)/Me,le.velocityHistory.push(Ut(le.velocity)),le.velocityHistory=le.velocityHistory.slice(-3),le.velocityAverage=le.velocityHistory.reduce((qe,Ne,mt,ue)=>(qe.x+=Ne.x/ue.length,qe.y+=Ne.y/ue.length,qe),Kn()),le.translation.x=me.x-le.origin.x,le.translation.y=me.y-le.origin.y,le.timeStamp=Te,le.position.x=me.x,le.position.y=me.y,le.event=N},C=N=>{const le=y(N);if(!(le<0))return f[le]},R=()=>f.length===1,I=()=>f.length===2,M=(N,le)=>N.reduce((me,Me)=>
89(me+=or(le,Me.position),me),0)/N.length,T=N=>{const le=Kr(N.map(me=>me.position)),Te=M(N,le);return{center:le,distance:Te,velocity:Kr(N.map(me=>me.velocity)),translation:Kr(N.map(me=>me.translation))}};let v,H,Y,Z,W,$,S,pe,ge=0,de;e.addEventListener("pointerdown",be);const Fe=["Meta","Control","Alt","Shift"];function X(N){if(!Fe.includes(N.key))return;const{metaKey:le,ctrlKey:Te,altKey:me,shiftKey:Me}=N;ae({metaKey:le,ctrlKey:Te,altKey:me,shiftKey:Me})}let U=Date.now();const ae=N=>{const le=Ut(f[0].translation);let Te=S;if(r&&I()){const Ne=or(f[0].position,f[1].position)/W;Te*=Ne,xi(le,f[1].translation)}xi(le,$);const me=Date.now();me-U<16||(U=me,c("interactionupdate",{position:w(),translation:le,scalar:r?Te:void 0,isMultiTouching:I(),...N}))};function be(N){if(!I()&&!OP(N)&&o(N,e)){if(u(),m(N),s&&(window.addEventListener("keydown",X),window.addEventListener("keyup",X)),R())document.documentElement.addEventListener("pointermove",ft),document.documentElement.addEventListener("pointerup",Se),document.documentElement.addEventListener("pointercancel",Se),document.addEventListener("visibilitychange",Mt),pe=!1,S=1,$=Kn(),W=void 0,c("interactionstart",{origin:Ut(C(N).origin)});else if(r)pe=!0,W=or(f[0].position,f[1].position),$.x+=f[0].translation.x,$.y+=f[0].translation.y,_(f[0]);else if(a===!1)return p(),ie(),c("interactioncancel")}}function ft(N){N.preventDefault(),P(N);const{metaKey:le=!1,ctrlKey:Te=!1,altKey:me=!1,shiftKey:Me=!1}=s?N:{};ae({metaKey:le,ctrlKey:Te,altKey:me,shiftKey:Me})}function Se(N){if(!C(N))return;const le=w(),Te=g(N);if(r&&R()){const He=or(f[0].position,Te.position);S*=He/W,$.x+=f[0].translation.x+Te.translation.x,$.y+=f[0].translation.y+Te.translation.y,_(f[0])}let me=!1,Me=!1;if(!pe&&Te){const He=performance.now(),Qe=He-Te.timeStampInitial;me=xr(Te.translation)<xP&&Qe<LP,Me=!!(de&&me&&He-ge<FP&&xr(de,Te.position)<vP),me&&(de=Ut(Te.position),ge=He)}if(f.length>0)return;ie();const qe=Ut(Te.translation),Ne=Ut(Te.velocityAverage);let mt=!1;c("interactionrelease",{isTap:me,isDoubleTap:Me,position:le,translation:qe,scalar:S,preventInertia:()=>mt=!0});const ue=or(Ne);if(mt||!n||ue<EP)return gt(qe,{isTap:me,isDoubleTap:Me});H=Ut(le),Y=Ut(qe),v=ig(Ut(qe),{easing:f6,duration:ue*i}),v.set({x:qe.x+Ne.x*Ib,y:qe.y+Ne.y*Ib}).then(()=>{Z&&gt(Na(v),{isTap:me,isDoubleTap:Me})}),Z=v.subscribe(De)}function De(N){N&&c("interactionupdate",{position:re(H.x+(N.x-Y.x),H.y+(N.y-Y.y)),translation:N,scalar:r?S:void 0})}function Mt(N){if(document.visibilityState==="visible"||!f.length)return;const le=T(f);u(),c("interactionend",{...le}),f.length=0,ie()}function gt(N,le){u(),c("interactionend",{...le,translation:N,scalar:r?S:void 0})}function ie(){s&&window.removeEventListener("keydown",X),s&&window.removeEventListener("keyup",X),document.documentElement.removeEventListener("pointermove",ft),document.documentElement.removeEventListener("pointerup",Se),document.documentElement.removeEventListener("pointercancel",Se),document.removeEventListener("visibilitychange",Mt)}return{destroy(){u(),e.removeEventListener("pointerdown",be)}}};function Kl(e,t){return t?t*Math.sign(e)*Math.log10(1+Math.abs(e)/t):e}const Eb=(e,t,n)=>{if(!t||!n)return{...e};const i=e.x+Kl(t.x-e.x,n),o=e.x+e.width+Kl(t.x+t.width-(e.x+e.width),n),r=e.y+Kl(t.y-e.y,n),a=e.y+e.height+Kl(t.y+t.height-(e.y+e.height),n);return{x:i,y:r,width:o-i,height:a-r}},DP=(e,t,n)=>!t||!n?{...e}:re(e.x+Kl(t.x-e.x,n),e.y+Kl(t.y-e.y,n));var QS=(e,t)=>{if(e){if(/em/.test(e))return parseInt(e,10)*16;if(/px/.test(e))return parseInt(e,10)}};function BP(e){let t,n,i,o,r,a,l;const s=e[40].default,c=lo(s,e,e[39],null);return{c(){t=fe("div"),n=fe("div"),c&&c.c(),Ee(n,"transform",e[6]),k(t,"class",i=pn(["PinturaScrollable",e[0]])),k(t,"data-direction",e[1]),k(t,"data-state",e[7]),Ee(t,"--scrollable-feather-start-opacity",e[4]),Ee(t,"--scrollable-feather-end-opacity",e[5])},m(u,f){te(u,t,f),Ae(t,n),c&&c.m(n,null),e[42](t),r=!0,a||(l=[Pe(n,"interactionstart",e[10]),Pe(n,"interactionupdate",e[12]),Pe(n,"interactionend",e[13]),Pe(n,"interactionrelease",e[11]),wn(xl.call(null,n,{inertia:!0})),Pe(n,"measure",e[41]),wn(Fo.call(null,n)),Pe(t,"wheel",e[15],{passive:!1}),Pe(t,"scroll",e[17]),Pe(t,"focusin",e[43]),Pe(t,"nudge",e[18]),Pe(t,"measure",e[14]),wn(Fo.call(null,t,{observePosition:!0})),wn(o=Al.call(null,t,{direction:e[1]==="x"?"horizontal":"vertical",stopKeydownPropagation:!1}))],a=!0)},p(u,f){c&&c.p&&(!r||f[1]&256)&&co(c,s,u,u[39],r?so(s,u[39],f,null):uo(u[39]),null),f[0]&64&&Ee(n,"transform",u[6]),(!r||f[0]&1&&i!==(i=pn(["PinturaScrollable",u[0]])))&&k(t,"class",i),(!r||f[0]&2)&&k(t,"data-direction",u[1]),(!r||f[0]&128)&&k(t,"data-state",u[7]),o&&kn(o.update)&&f[0]&2&&o.update.call(null,{direction:u[1]==="x"?"horizontal":"vertical",stopKeydownPropagation:!1}),f[0]&16&&Ee(t,"--scrollable-feather-start-opacity",u[4]),f[0]&32&&Ee(t,"--scrollable-feather-end-opacity",u[5])},i(u){r||(L(c,u),r=!0)},o(u){z(c,u),r=!1},d(u){u&&ee(t),c&&c.d(u),e[42](null),a=!1,On(l)}}}function zP(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,{$$slots:g={},$$scope:p}=t;const y=Xa();let w="idle",_,P,C,R,I=hn(0);B(e,I,ye=>n(38,d=ye));let{class:M=void 0}=t,{scrollBlockInteractionDist:T=5}=t,{scrollStep:v=10}=t,{scrollFocusMargin:H=64}=t,{scrollDirection:Y="x"}=t,{scrollAutoCancel:Z=!1}=t,{elasticity:W=0}=t,{onscroll:$=st}=t,{maskFeatherSize:S=void 0}=t,{maskFeatherStartOpacity:pe=void 0}=t,{maskFeatherEndOpacity:ge=void 0}=t,{scroll:de=void 0}=t;const Fe=Qn("fixScrollDirection");B(e,Fe,ye=>n(50,m=ye));let X,U,ae,be=!0;
89const ft=I.subscribe(ye=>{const $e=Kn();$e[Y]=ye,$($e)}),Se=ye=>Math.max(Math.min(0,ye),C[i]-P[i]);let De,Mt,gt;const ie=ye=>{const $e=Or(re(ye.x-gt.x,ye.y-gt.y),Math.abs);gt=Ut(ye);const St=xr($e),Je=$e.x-$e.y;return!(St>1&&Je<-.5)},N=()=>{l&&(Mt=!1,De=!0,gt=re(0,0),R=!1,n(29,w="idle"),_=Na(I))},le=({detail:ye})=>{l&&(R=!0,n(29,w="idle"))},Te=({detail:ye})=>{if(l&&!Mt&&!(De&&(De=!1,xr(ye.translation)<.1))){if(Z&&Y==="x"&&!ie(ye.translation)){Mt=!0;return}qe(_+ye.translation[Y],{elastic:!0})}},me=({detail:ye})=>{if(!l||Mt)return;const $e=_+ye.translation[Y],St=Se($e);be=!1,I.set(St).then(Je=>{R&&(be=!0)})},Me=({detail:ye})=>{n(30,C=ye),y("measure",{x:ye.x,y:ye.y,width:ye.width,height:ye.height})},qe=(ye,$e={})=>{const{elastic:St=!1,animate:Je=!1,preventScrollState:q=!1}=$e;Math.abs(ye-_)>T&&w==="idle"&&!R&&!q&&n(29,w="scrolling");const Ie=Se(ye),se=St&&W&&!R?Ie+Kl(ye-Ie,W):Ie;let V=!0;Je?V=!1:be||(V=!R),be=!1,I.set(se,{hard:V}).then(dt=>{R&&(be=!0)})},Ne=ye=>{if(!l)return;ye.preventDefault(),ye.stopPropagation();const $e=ye.shiftKey,St=$u(ye,{fixScrollDirection:m})*($e?-1:1),Je=Na(I);qe(Je+St*v,{animate:!0})},mt=ye=>{if(!l||!R)return;let $e=ye.target;ye.target.classList.contains("implicit")&&($e=$e.parentNode);const St=$e[Y==="x"?"offsetLeft":"offsetTop"],Je=$e[Y==="x"?"offsetWidth":"offsetHeight"],q=St+Je,Ie=Na(I),se=H+S;Ie+St<se?qe(-St+se):Ie+q>C[i]-se&&qe(C[i]-q-se,{animate:!0})},ue=()=>{n(3,X[Y==="x"?"scrollLeft":"scrollTop"]=0,X)},He=({detail:ye})=>{if(X.querySelector("[data-focus-visible]"))return;const $e=-2*ye[Y],St=Na(I);qe(St+$e*v,{animate:!0,preventScrollState:!0})};Jr(()=>{ft()});const Qe=ye=>n(2,P=ye.detail);function G(ye){vn[ye?"unshift":"push"](()=>{X=ye,n(3,X)})}const je=ye=>{setTimeout(()=>mt(ye),32)};return e.$$set=ye=>{"class"in ye&&n(0,M=ye.class),"scrollBlockInteractionDist"in ye&&n(22,T=ye.scrollBlockInteractionDist),"scrollStep"in ye&&n(23,v=ye.scrollStep),"scrollFocusMargin"in ye&&n(24,H=ye.scrollFocusMargin),"scrollDirection"in ye&&n(1,Y=ye.scrollDirection),"scrollAutoCancel"in ye&&n(25,Z=ye.scrollAutoCancel),"elasticity"in ye&&n(26,W=ye.elasticity),"onscroll"in ye&&n(27,$=ye.onscroll),"maskFeatherSize"in ye&&n(21,S=ye.maskFeatherSize),"maskFeatherStartOpacity"in ye&&n(19,pe=ye.maskFeatherStartOpacity),"maskFeatherEndOpacity"in ye&&n(20,ge=ye.maskFeatherEndOpacity),"scroll"in ye&&n(28,de=ye.scroll),"$$scope"in ye&&n(39,p=ye.$$scope)},e.$$.update=()=>{if(e.$$.dirty[0]&2&&n(35,i=Y==="x"?"width":"height"),e.$$.dirty[0]&2&&n(31,o=Y.toUpperCase()),e.$$.dirty[0]&8&&n(37,r=X&&getComputedStyle(X)),e.$$.dirty[0]&8|e.$$.dirty[1]&64&&n(36,a=r&&QS(r.getPropertyValue("--scrollable-feather-size"))),e.$$.dirty[0]&1075314692|e.$$.dirty[1]&176&&d!=null&&C&&a!=null&&P){const ye=-1*d/a,$e=-(C[i]-P[i]-d)/a;n(19,pe=Xn(1-ye,0,1)),n(20,ge=Xn(1-$e,0,1)),n(21,S=a),n(4,U=pe),n(5,ae=ge)}e.$$.dirty[0]&268435464&&X&&de!==void 0&&(Ht(de)?qe(de):qe(de.scrollOffset,de)),e.$$.dirty[0]&1073741828|e.$$.dirty[1]&16&&n(32,l=C&&P?P[i]>C[i]:void 0),e.$$.dirty[1]&128&&n(34,s=d<0),e.$$.dirty[0]&1073741828|e.$$.dirty[1]&144&&n(33,c=P&&C?d+P[i]>C[i]:!1),e.$$.dirty[0]&536870912|e.$$.dirty[1]&14&&n(7,u=pn([w,l?"overflows":void 0,s?"overflows-start":void 0,c?"overflows-end":void 0])),e.$$.dirty[1]&131&&n(6,f=l?`translate${o}(${d}px)`:"none")},[M,Y,P,X,U,ae,f,u,I,Fe,N,le,Te,me,Me,Ne,mt,ue,He,pe,ge,S,T,v,H,Z,W,$,de,w,C,o,l,c,s,i,a,r,d,p,g,Qe,G,je]}class Ka extends gn{constructor(t){super(),mn(this,t,zP,BP,rn,{class:0,scrollBlockInteractionDist:22,scrollStep:23,scrollFocusMargin:24,scrollDirection:1,scrollAutoCancel:25,elasticity:26,onscroll:27,maskFeatherSize:21,maskFeatherStartOpacity:19,maskFeatherEndOpacity:20,scroll:28},null,[-1,-1])}}function VP(e){let t,n,i,o,r;return{c(){t=fe("span"),k(t,"class","PinturaStatusMessage")},m(a,l){te(a,t,l),t.innerHTML=e[0],i=!0,o||(r=[Pe(t,"measure",function(){kn(e[1])&&e[1].apply(this,arguments)}),wn(Fo.call(null,t))],o=!0)},p(a,[l]){e=a,(!i||l&1)&&(t.innerHTML=e[0])},i(a){i||(Ec(()=>{i&&(n||(n=i2(t,e[4],{duration:e[2]},!0)),n.run(1))}),i=!0)},o(a){n||(n=i2(t,e[4],{duration:e[2]},!1)),n.run(0),i=!1},d(a){a&&ee(t),a&&n&&n.end(),o=!1,On(r)}}}function WP(e,t,n){let i,o,{text:r}=t,{onmeasure:a=st}=t;const l=Qn("isAnimated");B(e,l,c=>n(5,o=c));function s(c,{duration:u}){return{duration:u,tick:f=>{c.style.opacity=f}}}return e.$$set=c=>{"text"in c&&n(0,r=c.text),"onmeasure"in c&&n(1,a=c.onmeasure)},e.$$.update=()=>{e.$$.dirty&32&&n(2,i=o?500:0)},[r,a,i,l,s,o]}class $S extends gn{constructor(t){super(),mn(this,t,WP,VP,rn,{text:0,onmeasure:1})}}function UP(e){let t,n,i;const o=e[5].default,r=lo(o,e,e[4],null);return{c(){t=fe("span"),r&&r.c(),k(t,"class",n=`PinturaStatusAside ${e[1]}`),Ee(t,"transform",e[2]),Ee(t,"opacity",e[0])},m(a,l){te(a,t,l),r&&r.m(t,null),i=!0},p(a,[l]){r&&r.p&&(!i||l&16)&&co(r,o,a,a[4],i?so(o,a[4],l,null):uo(a[4]),null),(!i||l&2&&n!==(n=`P
89inturaStatusAside ${a[1]}`))&&k(t,"class",n),l&4&&Ee(t,"transform",a[2]),l&1&&Ee(t,"opacity",a[0])},i(a){i||(L(r,a),i=!0)},o(a){z(r,a),i=!1},d(a){a&&ee(t),r&&r.d(a)}}}function HP(e,t,n){let i,{$$slots:o={},$$scope:r}=t,{offset:a=0}=t,{opacity:l=0}=t,{class:s=void 0}=t;return e.$$set=c=>{"offset"in c&&n(3,a=c.offset),"opacity"in c&&n(0,l=c.opacity),"class"in c&&n(1,s=c.class),"$$scope"in c&&n(4,r=c.$$scope)},e.$$.update=()=>{e.$$.dirty&8&&n(2,i=`translateX(${a}px)`)},[l,s,i,a,r,o]}class e4 extends gn{constructor(t){super(),mn(this,t,HP,UP,rn,{offset:3,opacity:0,class:1})}}var NP=e=>e.selectionStart=e.selectionEnd=e.value.length;let W1=null;var GP=()=>(W1===null&&(W1=zo()&&"visualViewport"in window),W1),jP=e=>{if(!GP())return!1;const t=visualViewport.height,n=()=>{e(visualViewport.height<t?"visible":"hidden")};return visualViewport.addEventListener("resize",n),()=>visualViewport.removeEventListener("resize",n)};function Ab(e){let t,n;const i=[{onclick:e[1]},e[3]];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new Ll({props:o}),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&10?fo(i,[a[0]&2&&{onclick:r[1]},a[0]&8&&yo(r[3])]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function Lb(e){let t,n;const i=[{onclick:e[0]},{class:"PinturaInputFormButtonConfirm"},e[2]];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new Ll({props:o}),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&5?fo(i,[a[0]&1&&{onclick:r[0]},i[1],a[0]&4&&yo(r[2])]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function ZP(e){let t,n,i,o,r,a,l,s,c=e[3]&&Ab(e);const u=e[29].default,f=lo(u,e,e[28],null);let d=e[2]&&Lb(e);return{c(){t=fe("div"),n=fe("div"),c&&c.c(),i=ut(),o=fe("div"),f&&f.c(),r=ut(),d&&d.c(),k(o,"class","PinturaInputFormFields"),k(n,"class","PinturaInputFormInner"),k(t,"class","PinturaInputForm"),k(t,"data-layout",e[4]),Ee(t,"opacity",e[6]),Ee(t,"left",e[7]),Ee(t,"top",e[8]),Ee(t,"right",e[9]),Ee(t,"bottom",e[10])},m(m,g){te(m,t,g),Ae(t,n),c&&c.m(n,null),Ae(n,i),Ae(n,o),f&&f.m(o,null),Ae(n,r),d&&d.m(n,null),e[30](t),a=!0,l||(s=[Pe(o,"keydown",e[14]),Pe(t,"focusin",e[11]),Pe(t,"focusout",e[12]),Pe(t,"measure",e[13]),wn(Fo.call(null,t))],l=!0)},p(m,g){m[3]?c?(c.p(m,g),g[0]&8&&L(c,1)):(c=Ab(m),c.c(),L(c,1),c.m(n,i)):c&&(Et(),z(c,1,1,()=>{c=null}),At()),f&&f.p&&(!a||g[0]&268435456)&&co(f,u,m,m[28],a?so(u,m[28],g,null):uo(m[28]),null),m[2]?d?(d.p(m,g),g[0]&4&&L(d,1)):(d=Lb(m),d.c(),L(d,1),d.m(n,null)):d&&(Et(),z(d,1,1,()=>{d=null}),At()),(!a||g[0]&16)&&k(t,"data-layout",m[4]),g[0]&64&&Ee(t,"opacity",m[6]),g[0]&128&&Ee(t,"left",m[7]),g[0]&256&&Ee(t,"top",m[8]),g[0]&512&&Ee(t,"right",m[9]),g[0]&1024&&Ee(t,"bottom",m[10])},i(m){a||(L(c),L(f,m),L(d),a=!0)},o(m){z(c),z(f,m),z(d),a=!1},d(m){m&&ee(t),c&&c.d(),f&&f.d(m),d&&d.d(),e[30](null),l=!1,On(s)}}}const XP=200;function KP(e,t,n){let i,o,r,a,{$$slots:l={},$$scope:s}=t,{onconfirm:c}=t,{oncancel:u}=t,{autoFocus:f=!0}=t,{autoPositionCursor:d=!0}=t,{buttonConfirm:m=void 0}=t,{buttonCancel:g=void 0}=t,{layout:p="stack"}=t,{parentRect:y=void 0}=t,{align:w=void 0}=t,{justify:_=void 0}=t,{parentMargin:P=16}=t,{panelOffset:C=Kn()}=t,{willHandleKeydown:R=()=>!0}=t,I=!1,M,T,v={top:void 0,bottom:void 0},H=0,Y,Z,W,$,S;const pe=(N,le,Te,me,Me)=>{let qe,Ne;return me==="center"?qe=N.x+N.width*.5-le.width*.5:me==="right"?qe=N.x+N.width-le.width-Me:qe=N.x+Me,Te==="center"?Ne=N.y+N.height*.5-le.height*.5:Te==="bottom"?Ne=N.y+N.height-le.height-Me:Ne=N.y+Me,{top:`${Ne}px`,right:"auto",bottom:"auto",left:`${qe}px`}},ge=N=>/textarea/i.test(N),de=N=>{let le;const Te=Me=>le=Me.touches[0].screenY,me=Me=>{const qe=Me.touches[0].screenY,Ne=Me.target;/textarea/i.test(Ne.nodeName)?(qe>le?Ne.scrollTop==0&&Me.preventDefault():qe<le?Ne.scrollTop+Ne.offsetHeight==Ne.scrollHeight&&Me.preventDefault():Me.preventDefault(),le=qe):Me.preventDefault()};return N.addEventListener("touchstart",Te),N.addEventListener("touchmove",me),()=>{N.removeEventListener("touchstart",Te),N.removeEventListener("touchmove",me)}},Fe=()=>{const N=S.querySelector("input, textarea");N.focus(),!(H>=1)&&N.select()},X=()=>{I=!0,!De&&(ya()||Xd())&&n(24,v={top:"1em",bottom:"auto"}),ya()&&de(S),n(6,H=1)},U=()=>{I=!1,n(6,H=0)},ae=N=>{if(!a){n(24,v={top:"4.5em",bottom:"auto"});return}if(N==="hidden"&&!I){Fe();return}
89clearTimeout(T),T=void 0,n(24,v={top:`${visualViewport.height-M.height-C.y}px`}),N==="visible"?(n(5,S.dataset.stick=!0,S),Fe(),X()):U()};let be;const ft=N=>{!ge(N.target)&&!NS(N.target)||(be=Date.now(),d&&NP(N.target),clearTimeout(T),T=setTimeout(X,XP))},Se=N=>{Date.now()-be>50||(N.stopPropagation(),Fe())},De=jP(ae),Mt=({detail:N})=>{n(23,M={width:N.width,height:N.height})},gt=N=>{if(R(N)){if(N.key==="Enter")return c();if(N.key==="Escape")return u()}};ss(()=>{f&&Fe()}),Jr(()=>{De&&De()});function ie(N){vn[N?"unshift":"push"](()=>{S=N,n(5,S)})}return e.$$set=N=>{"onconfirm"in N&&n(0,c=N.onconfirm),"oncancel"in N&&n(1,u=N.oncancel),"autoFocus"in N&&n(15,f=N.autoFocus),"autoPositionCursor"in N&&n(16,d=N.autoPositionCursor),"buttonConfirm"in N&&n(2,m=N.buttonConfirm),"buttonCancel"in N&&n(3,g=N.buttonCancel),"layout"in N&&n(4,p=N.layout),"parentRect"in N&&n(17,y=N.parentRect),"align"in N&&n(18,w=N.align),"justify"in N&&n(19,_=N.justify),"parentMargin"in N&&n(20,P=N.parentMargin),"panelOffset"in N&&n(21,C=N.panelOffset),"willHandleKeydown"in N&&n(22,R=N.willHandleKeydown),"$$scope"in N&&n(28,s=N.$$scope)},e.$$.update=()=>{e.$$.dirty[0]&8519680&&n(27,i=y&&M),e.$$.dirty[0]&144572416&&n(26,o=i?pe(y,M,w,_,P):void 0),e.$$.dirty[0]&201326592&&n(7,Y=i?o.left:void 0),e.$$.dirty[0]&218103808&&n(8,Z=i?o.top:v.top),e.$$.dirty[0]&201326592&&n(9,W=i?o.right:void 0),e.$$.dirty[0]&218103808&&n(10,$=i?o.bottom:v.bottom),e.$$.dirty[0]&32&&n(25,r=S&&getComputedStyle(S)),e.$$.dirty[0]&33554432&&(a=r&&r.getPropertyValue("--editor-modal")==="1")},[c,u,m,g,p,S,H,Y,Z,W,$,ft,Se,Mt,gt,f,d,y,w,_,P,C,R,M,v,r,o,i,s,l,ie]}class t4 extends gn{constructor(t){super(),mn(this,t,KP,ZP,rn,{onconfirm:0,oncancel:1,autoFocus:15,autoPositionCursor:16,buttonConfirm:2,buttonCancel:3,layout:4,parentRect:17,align:18,justify:19,parentMargin:20,panelOffset:21,willHandleKeydown:22},null,[-1,-1])}}var xb=(e,t)=>{e.fastSeek&&e.fastSeek(t),e.currentTime=t},n4=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus";const YP=["aspectRatio","isRotatedSideways","flip","cropSize"],Fb=Qm.map(([e])=>e).filter(e=>!YP.includes(e)),qP=function(e,t,n){let i=[];return{set:t,update:n,publish:o=>{i.forEach(r=>r(o))},subscribe:o=>(i.push(o),e(o),()=>{i=i.filter(r=>r!==o)})}};var JP=()=>{let e,t;const n=Fb.reduce((o,r)=>(o[r]=qP(a=>{if(!t)return a();t.stores[r].subscribe(a)()},a=>{t&&t.stores[r].set(a)},a=>{t&&t.stores[r].update(a)}),o),{});return{update:o=>{if(t=o,e&&(e.forEach(r=>r()),e=void 0),!o){n.file.publish(void 0),n.loadState.publish(void 0);return}e=Fb.map(r=>o.stores[r].subscribe(a=>{n[r].publish(a)}))},stores:n,destroy:()=>{e&&e.forEach(o=>o())}}},QP=(e,t=!0)=>n=>{n.type==="ping"&&(t&&n.stopPropagation(),e(n.detail.type,n.detail.data))},Zl=(e,t)=>new CustomEvent("ping",{detail:{type:e,data:t},cancelable:!0,bubbles:!0}),i4=(e,t)=>(t?Jl(e,t):e).replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase(),$P=(e,t)=>{const n=matchMedia(e);return n.addListener(t),t(n),{get matches(){return n.matches},destroy:()=>n.removeListener(t)}},vb=(e,t=Nn)=>{const{subscribe:n,set:i}=ht(void 0),o=$P(e,({matches:r})=>i(t(r)));return{subscribe:n,destroy:o.destroy}},e8=()=>{if(!ya())return!1;const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/i)||[],[,t,n]=e.map(i=>parseInt(i,10)||0);return t>13||t===13&&n>=4}
89,t8=(e,t,n)=>{const{sub:i,pub:o}=Pl(),{willUndo:r=()=>!0}=n||{},a=[],l=ht(0),s=[],c=()=>s.forEach(f=>f({index:Na(l),length:a.length})),u={get index(){return Na(l)},set index(f){f=Number.isInteger(f)?f:0,f=Xn(f,0,a.length-1),l.set(f),t(a[u.index]),c()},get state(){return a[a.length-1]},length(){return a.length},undo(){if(r()===!1)return;const f=u.index--;return o("undo",f),f},redo(){const f=u.index++;return o("redo",u.index),f},revert(){a.length=1,u.index=0,o("revert")},write(f){f&&t({...e(),...f});const d=e(),m=a[a.length-1];JSON.stringify(d)!==JSON.stringify(m)&&(a.length=u.index+1,a.push(d),l.set(a.length-1),c(),o("writehistory"))},set(f={}){a.length=0,u.index=0;const d=Array.isArray(f)?f:[f];a.push(...d),u.index=a.length-1},get(){return[...a]},subscribe(f){return s.push(f),f({index:u.index,length:a.length}),()=>s.splice(s.indexOf(f),1)},on:i};return u},n8=async e=>xc(await Vs(e)),Ob=(e,t)=>new Promise((n,i)=>{(async()=>{const{imageOrienter:o,canvasMemoryLimit:r}=t||{};as(e)&&n(await AS(e));const a=await o.read(e),l=c=>fy(c,{canvasMemoryLimit:r}).then(u=>o.apply(u,a)).then(n).catch(i);if(uy(e)||!cy()||Za()||ya())return l(e);let s;try{s=await Ku((c,u)=>createImageBitmap(c,{colorSpaceConversion:"default"}).then(f=>u(null,f)).catch(u),[e])}catch{}if(!s||!s.width)return l(e);if(!await Zd())return n(o.apply(s,a));if(ng()&&a>1)return n(await n8(s));n(s)})()}),Db=(e,t)=>new Promise(async n=>{if(e.width<t.width&&e.height<t.height)return n(e);const i=Math.min(t.width/e.width,t.height/e.height),o=i*e.width,r=i*e.height,a=ci("canvas",{width:o,height:r}),l=a.getContext("2d",{willReadFrequently:!0}),s=Cc(e)?await Vs(e):e;l.drawImage(s,0,0,o,r),n(xc(a))});let U1=null;var i8=()=>{if(U1===null){let e=ci("canvas");U1=!!$d(e),Wi(e),e=void 0}return U1},o8=e=>/^image/.test(e.type)&&!/svg/.test(e.type);const Bb=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],xs={precision:1e-4},pd={precision:xs.precision*.01};var r8=(e,t,n={})=>{const{resize:i=1,opacity:o=0}=n,r={opacity:[hn(o,{...xs,stiffness:.1}),Nn],resize:[hn(i,{...xs,stiffness:.1}),Nn],translation:[hn(void 0,xs),Nn],rotation:[hn(void 0,pd),Nn],origin:[hn(void 0,xs),Nn],scale:[hn(void 0,pd),Nn],gamma:[hn(void 0,pd),f=>f||1],vignette:[hn(void 0,pd),f=>f||0],colorMatrix:[hn([...Bb],xs),f=>f||[...Bb]],convolutionMatrix:[ht(void 0),f=>f&&f.clarity||void 0],backgroundColor:[hn(void 0,xs),(f,d,m)=>{if(Array.isArray(f)){if(Array.isArray(d)){const g=[...f];d[3]===0?(g[3]=0,m(g)):g[3]===0&&(f=[...d],f[3]=0)}return f}}],backgroundImage:[ht(void 0),Nn],backgroundFilterMode:[ht(void 0),Nn]},a=Object.entries(r).map(([f,d])=>[f,d[0]]),l=a.map(([,f])=>f),s=Object.entries(r).reduce((f,[d,m])=>{const[g,p]=m;return f[d]=(y,w)=>g.set(p(y,c[d],_=>{g.set(_,{hard:!0})}),w),f},{});let c;const u=Ln(l,f=>(c=f.reduce((d,m,g)=>{const p=a[g][0];return d[p]=m,d},{}),c.data=e,c.size=t,c.scale*=f[1],c));return u.get=()=>c,u.set=(f,d)=>{const m={hard:!d};Object.entries(f).forEach(([g,p])=>{s[g]&&s[g](p,m)})},u},a8=()=>{const e=[],t=[],n=[],i=(g,p)=>{const y=e.indexOf(g);y<0||(n[y]=p,o())},o=()=>{t.forEach(g=>g(n))},r=g=>{g.unsub=g.subscribe(p=>i(g,p)),o()};return{get length(){return e.length},clear:()=>{e.forEach(g=>g.unsub()),e.length=0,n.length=0},unshift:g=>{e.unshift(g),r(g)},get:g=>e[g],push:g=>{e.push(g),r(g)},remove:g=>{g.unsub();const p=e.indexOf(g);e.splice(p,1),n.splice(p,1)},forEach:g=>e.forEach(g),filter:g=>e.filter(g),subscribe:g=>(t.push(g),g(n),()=>{t.splice(t.indexOf(g),1)})}},H1=e=>e[0]<.25&&e[1]<.25&&e[2]<.25,o4=(e={})=>new Promise(t=>{const{accept:n="image/*"}=e,i=ci("input",{style:"position:absolute;visibility:hidden;width:0;height:0;",type:"file",accept:n}),o=()=>{const[r]=i.files;i.parentNode&&i.remove(),i.removeEventListener("change",o),t(r)};i.addEventListener("change",o),ya()&&document.body.append(i),i.click()}),Zu=e=>{try{return e()}catch(t){console.error(t)}},l8=([e,t])=>e+(t-e)*.5,Ml=e=>Math.round(e*100),ug=e=>re(e.clientX,e.clientY),gm=(e,t,n)=>{const i=ug(e);return Fi(Fi(i,t),n)};function s8(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M=qt,T=()=>(M(),M=Do(W,J=>n(71,I=J)),W),v;e.$$.on_destroy.push(()=>M());let{root:H}=t,{locale:Y}=t,{stores:Z}
89=t,{isAnimated:W}=t;T();let{allowPan:$=!0}=t,{allowZoom:S=!0}=t,{enablePan:pe=!0}=t,{enableZoom:ge=!0}=t,{enableZoomControls:de=ge}=t,{enableZoomInput:Fe=!0}=t,{enablePanInput:X=!0}=t,{enablePanLimit:U=!0}=t,{panLimitGutterScalar:ae=0}=t,{zoomOptions:be=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:ft=.25}=t,{zoomAdjustFactor:Se=.1}=t,{zoomAdjustWheelFactor:De=1}=t,{elasticity:Mt=5}=t,{imageSelectionRectCentered:gt=void 0}=t,{imageSelectionRectScalar:ie=void 0}=t,{zoomLevel:N=null}=t,{zoomControls:le}=t,{zoomMultiTouching:Te=!1}=t;const{isInteracting:me,rootRect:Me,stageRect:qe,stageScalar:Ne,imageSelectionPan:mt,imageSelectionZoom:ue,imageSelectionStageFitScalar:He,imageSelectionRect:Qe,imageSelectionStoredState:G,imagePreviewUpscale:je}=Z;B(e,me,J=>n(70,C=J)),B(e,Me,J=>n(67,w=J)),B(e,qe,J=>n(66,y=J)),B(e,Ne,J=>n(46,R=J)),B(e,mt,J=>n(65,m=J)),B(e,ue,J=>n(43,d=J)),B(e,He,J=>n(44,g=J)),B(e,Qe,J=>n(68,_=J)),B(e,G,J=>n(72,v=J)),B(e,je,J=>n(45,p=J));const ye=Qn("fixScrollDirection");B(e,ye,J=>n(69,P=J));let $e=!1,St,Je,q,Ie;const se=J=>{const xe=H.querySelector(".PinturaMain > .PinturaUtilMain")||H.querySelector('div[data-inert="false"] .PinturaUtilMain');return!(!xe||!xe.contains(J.target)||Ql(J.target))},V=(J={})=>{const{pan:xe=m,zoom:it=d}=J;_e(G,v={translation:xe,zoom:it},v)},dt=()=>m&&m.x===0&&m.y===0,Ft=()=>{dt()||_e(mt,m=Kn(),m)},We=()=>{_e(ue,d=ge?v.zoom:void 0,d),_e(mt,m=pe?Ut(v.translation):dt()?m:Kn(),m),wt.set(d)},Xe=()=>{_e(ue,d=void 0,d),Ft(),wt.set(void 0,{hard:!0})},nt=()=>{Xe(),V()},wt=hn(void 0,{precision:.01});wt.subscribe(J=>{if(J===void 0){_e(ue,d=void 0,d),dt()||_e(mt,m=Kn(),m);return}const xe=d;J<=1?dt()||_e(mt,m=Kn(),m):J<=xe&&_e(mt,m=Bo(m,.8),m),_e(ue,d=J,d)});const Zt=J=>{wt.update(xe=>{const it=J(xe||g);return V({zoom:it}),it},{hard:!I})},yt=J=>{J?wt.set(J,{hard:I===!1}):(J=void 0,wt.set(void 0,{hard:!0})),_e(ue,d=J,d),V({zoom:J})};let nn;function Jt(){const J=Date.now();if(!Ht(nn)||J-nn>500){nn=J;return}nn=void 0,yt(r?u===1?g:1:u===g?1:g)}const yn=(J,xe)=>J.findIndex(it=>it===xe),an=(J,xe)=>{const it=ie*xe,Ye={...gt},ct=1-Xn(ae,0,1);Oo(Ye,it<ct?it:ct);const ot={...gt};Oo(ot,it),ua(ot,J);const Ct={...ot};return ot.x>Ye.x&&(Ct.x=Ye.x),ot.y>Ye.y&&(Ct.y=Ye.y),ot.x+ot.width<Ye.x+Ye.width&&(Ct.x=Ye.x+Ye.width-ot.width),ot.y+ot.height<Ye.y+Ye.height&&(Ct.y=Ye.y+Ye.height-ot.height),Fi(In(Ct),In(Ye))},Tt=({translation:J,zoom:xe=1,elastify:it=!0})=>{if(!St)return;let Ye=J;const ct=re(St.x+Ye.x,St.y+Ye.y);if(!U)return ct;const ot=an(ct,xe);return it?DP(ot,ct,Mt):ot};let Sn,ln;const sn=()=>{ln=void 0,_e(me,C=!0,C),n(34,$e=X),Sn=!1,q=!1,St={...m},Je=p?d||g:r?d||1:d||g},ke=J=>{const{scalar:xe,translation:it,isMultiTouching:Ye}=J.detail;if(!St||!(Ye||X))return;Ye&&Bo(it,.5),(X||Ye)&&(Sn=!0),Te||n(13,Te=Ye);const ct=i?Xn(Je*xe,l,s):1,ot=Tt({translation:it,zoom:ct,elastify:!0}),Ct=Yl(ot);Ie=Yl(m),q=Ct<Ie,i&&ue.set(ct),mt.set(ot),ln=Te&&{translation:J.detail.translation,scalar:xe}},Re=J=>{_e(me,C=!1,C),n(34,$e=!1),n(13,Te=!1),q&&Ie<50&&(St=void 0,Je=void 0,mt.set(Kn()))},Lt=J=>{_e(me,C=!1,C),n(34,$e=!1),n(13,Te=!1),Promise.resolve().then(()=>{if(Sn&&St){const xe=ln||J.detail,it=i?Xn(Je*xe.scalar,l,s):1,Ye=Tt({elastify:!1,translation:xe.translation,zoom:it});mt.set(Ye)}St=void 0,Je=void 0,X&&J.detail.isDoubleTap&&nt(),V()})};let fn=Date.now(),on,En=0,bt=!1,Un=!1;const Hn=J=>{if(!se(J)||(J.preventDefault(),J.stopPropagation(),Un))return;clearTimeout(on);const xe=$u(J,{fixScrollDirection:P}),it=Date.now(),Ye=it-fn;fn=it;const ct=Math.abs(xe/Ye)>.2;En=ct?En+1:0;const Ct=1+xe*-1*De/(ct?50:100),cn=gm(J,w,y);$n(cn,Ct,{isZoomingFast:ct})},$n=(J,xe,{isZoomingFast:it})=>{const Ye=p?d||g:r?d||1:d||g,ct=Ye*xe,ot=Kn(),Ct=m,cn=p?g:r?1:g,Qt=Math.abs(ct-cn),_n=Ye>cn,Bt=Ye<cn,et=ct>Ye,ri=ct<Ye,Gn=_n&&ri||Bt&&et,Ri=En>=5;if(it||(bt=!1),En>0&&!bt&&(bt=Gn),Ri&&bt){nt(),Un=!0,setTimeout(()=>{Un=!1},100);return}if(Ri)return;!it&&Gn&&Qt<=.05&&(on=setTimeout(()=>{nt()},250)),_e(ue,d=Xn(ct,l,s),d);const ai=Rn(_);Oo(ai,Ye),ua(ai,Ct);const ui=In(ai),Yn=Rn(ai);Oo(Yn,1+(d-Ye),J);const _t=In(Yn),Dn=T0(Fi(_t,ui),Ye);Ww(ot,Ct.x+Dn.x,Ct.y+Dn.y),ri&&it?_e(mt,m=Bo(Ut(m),.85),m):_e(mt,m=an(ot,Ye),m),V()},Q=J=>(J?"add":"remove")+"EventListener";let Ge,j,Le,tt;const en=J=>{J.preventDefault(),j={...m},tt=Rn(_),Le=gm(J,w,y),Ge=p?d||g:r?d||1:d||g},Xt=J=>{J.preventDefault(),_e(ue,d=Xn(J.scale*Ge,l,s),d);const xe=Rn(tt);Oo(xe,Ge),ua(xe,j);const it=In(xe),Ye=Rn(xe);Oo(Ye,1+(d-Ge),Le);const ct=In(Ye),ot=T0(Fi(ct,it),Ge),Ct={x:j.x+ot.x,y:j.y+ot.y};_e(mt,m=an(Ct,d),m)},Ze=J=>{J.preventDefault()},tn=J=>{H[Q(J)]("wheel",Hn),!ya()&&(H[Q(J)]("gesturestart",en),H[Q(J)]("gesturechange",Xt),H[Q(J)]("gestureend",Ze))},Fn=J=>{const xe=Q(J);H[xe]("interactionstart",sn),H[xe]("interactionupdate",ke),H[xe]("interactionrelease",Re),H[xe]("interactionend",Lt)};let K;return ss(()=>{K=xl(H,{pinch:!0,inertia:!0,inertiaDurationMultiplier:10,shouldStartInteraction:se})}),Jr(()=>{tn(!1),Fn(!1),K.destroy(),K=void 0}),e.$$set=J=>{"root"in J&&n(14,H=J.root),"locale"in J&&n(15,Y=J.locale),"stores"in J&&n(16,Z=J.stores),"isAnimated"in J&&T(n(0,W=J.isAnimated)),"allowPan"in J&&n(17,$=J.allowPan),"allowZoom"in J&&n(18,S=J.allowZoom),"enablePan"in J&&n(19,pe=J.enablePan),"enableZoom"in J&&n(20,ge=J.enableZoom),"enableZoomControls"in J&&n(21,de=J.enableZoomControls),"enableZoomInput"in J&&n(22,Fe=J.enableZoomInput),"enablePanInput"in J&&n(23,X=J.enablePanInput),"enablePanLimit"in J&&n(24,U=J.enablePanLimit),"panLimitGutterScalar"in J&&n(25,ae=J.panLimitGutterScalar),"zoomOptions"in J&&n(26,be=J.zoomOptions),"zoomAdjustStep"in J&&n(27,ft=J.zoomAdjustStep),"zoomAdjustFactor"in J&&n(28,Se=J.zoomAdjustFactor),"zoomAdjustWheelFactor"in J&&n(29,De=J.zoomAdjustWheelFactor),"elasticity"in J&&n(30,Mt=J.elasticity),"imageSelectionRectCentered"in J&&n(31,gt=J.imageSelectionRectCentered),"imageSelectionRectScalar"in J&&n(32,ie=J.imageSelectionRectScalar),"zoomLevel"in J&&n(33,N=J.zoomLevel),"zoomControls"in J&&n(12,le=J.zoomControls),"zoomMultiTouching"in J&&n(13,Te=J.zoomMultiTouching)},e.$$.update=()=>{e.$$.dirty[0]&5505024&&n(36,i=S&&ge&&Fe),e.$$.dirty[0]&655360&&n(35,o=$&&pe),e.$$.dirty[0]&393216&&($||S?We():Xe()),e.$$.dirty[1]&32768&&(r=R>=1),e.$$.dirty[0]&67141632|e.$$.dirty[1]&57344&&n(40,a=[(p||R<1)&&[g,Ml(g)+"%",{sublabel:Y.labelZoomFit}],...be.map(J=>
89[J,Ml(J)+"%"])].filter(Boolean).map(J=>(J[0]===1&&(J[2]={sublabel:Y.labelZoomActual}),J)).sort((J,xe)=>{const it=J[0]||g,Ye=xe[0]||g;return it<Ye?-1:Ye<it?1:0})),e.$$.dirty[1]&8704&&n(38,l=Math.min(a.reduce((J,[xe])=>xe<J?xe:J,Number.MAX_SAFE_INTEGER),g)),e.$$.dirty[1]&512&&n(37,s=a.reduce((J,[xe])=>xe>J?xe:J,Number.MIN_SAFE_INTEGER)),e.$$.dirty[1]&4&&N!==null&&yt(N),e.$$.dirty[1]&61440&&n(42,u=d||(p||R<1?g:1)),e.$$.dirty[1]&2560&&n(39,c=yn(a.map(([J])=>J),u)),e.$$.dirty[1]&2048&&n(41,f=Ml(u)+"%"),e.$$.dirty[0]&405045248|e.$$.dirty[1]&6080&&n(12,le=(S||S)&&de?[["Button","zoom-out",{hideLabel:!0,label:Y.labelZoomOut,icon:Y.iconZoomOut,disabled:d===l,onclick:()=>Zt(J=>Math.max(l,J-ft)),onhold:()=>Zt(J=>Math.max(l,J*(1-Se)))}],["Dropdown","zoom-level",{label:f,title:Y.labelZoom,labelClass:"PinturaFixedWidthCharacters",options:a,selectedIndex:c,onchange:J=>yt(J.value),onclick:Jt}],["Button","zoom-in",{hideLabel:!0,label:Y.labelZoomIn,icon:Y.iconZoomIn,disabled:d===s,onclick:()=>Zt(J=>Math.min(s,J+ft)),onhold:()=>Zt(J=>Math.min(s,J*(1+Se)))}]]:[]),e.$$.dirty[0]&16384|e.$$.dirty[1]&32&&H&&tn(i),e.$$.dirty[0]&16384|e.$$.dirty[1]&16&&H&&Fn(o),e.$$.dirty[0]&8404992|e.$$.dirty[1]&24&&H&&H.style.setProperty("--cursor",o&&X?$e?"grabbing":"grab":"")},[W,me,Me,qe,Ne,mt,ue,He,Qe,G,je,ye,le,Te,H,Y,Z,$,S,pe,ge,de,Fe,X,U,ae,be,ft,Se,De,Mt,gt,ie,N,$e,o,i,s,l,c,a,f,u,d,g,p,R]}class c8 extends gn{constructor(t){super(),mn(this,t,s8,null,rn,{root:14,locale:15,stores:16,isAnimated:0,allowPan:17,allowZoom:18,enablePan:19,enableZoom:20,enableZoomControls:21,enableZoomInput:22,enablePanInput:23,enablePanLimit:24,panLimitGutterScalar:25,zoomOptions:26,zoomAdjustStep:27,zoomAdjustFactor:28,zoomAdjustWheelFactor:29,elasticity:30,imageSelectionRectCentered:31,imageSelectionRectScalar:32,zoomLevel:33,zoomControls:12,zoomMultiTouching:13},null,[-1,-1,-1,-1])}}const{window:Fs}=sS;function zb(e){let t,n,i,o=e[41]&&Vb(e),r=e[38]&&Nb(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[41]?o?(o.p(a,l),l[1]&1024&&L(o,1)):(o=Vb(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[38]?r?(r.p(a,l),l[1]&128&&L(r,1)):(r=Nb(a),r.c(),L(r,1),r.m(n.parentNode,n)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function Vb(e){let t,n,i,o,r;const a=[f8,u8],l=[];function s(c,u){return c[39]?0:c[35]?1:-1}return~(i=s(e))&&(o=l[i]=a[i](e)),{c(){t=fe("div"),n=fe("p"),o&&o.c(),Ee(n,"transform",e[72]),k(t,"class","PinturaStatus"),Ee(t,"opacity",e[54])},m(c,u){te(c,t,u),Ae(t,n),~i&&l[i].m(n,null),r=!0},p(c,u){let f=i;i=s(c),i===f?~i&&l[i].p(c,u):(o&&(Et(),z(l[f],1,1,()=>{l[f]=null}),At()),~i?(o=l[i],o?o.p(c,u):(o=l[i]=a[i](c),o.c()),L(o,1),o.m(n,null)):o=null),u[2]&1024&&Ee(n,"transform",c[72]),u[1]&8388608&&Ee(t,"opacity",c[54])},i(c){r||(L(o),r=!0)},o(c){z(o),r=!1},d(c){c&&ee(t),~i&&l[i].d()}}}function u8(e){let t,n,i,o;t=new $S({props:{text:e[35].text||"",onmeasure:e[221]}});let r=e[35].aside&&Wb(e);return{c(){Ve(t.$$.fragment),n=ut(),r&&r.c(),i=Mi()},m(a,l){ve(t,a,l),te(a,n,l),r&&r.m(a,l),te(a,i,l),o=!0},p(a,l){const s={};l[1]&16&&(s.text=a[35].text||""),t.$set(s),a[35].aside?r?(r.p(a,l),l[1]&16&&L(r,1)):(r=Wb(a),r.c(),L(r,1),r.m(i.parentNode,i)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){o||(L(t.$$.fragment,a),L(r),o=!0)},o(a){z(t.$$.fragment,a),z(r),o=!1},d(a){a&&(ee(n),ee(i)),Oe(t,a),r&&r.d(a)}}}function f8(e){let t,n,i,o;return t=new $S({props:{text:e[39],onmeasure:e[221]}}),i=new e4({props:{class:"PinturaStatusIcon",offset:e[82],opacity:e[83],$$slots:{default:[m8]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment),n=ut(),Ve(i.$$.fragment)},m(r,a){ve(t,r,a),te(r,n,a),ve(i,r,a),o=!0},p(r,a){const l={};a[1]&256&&(l.text=r[39]),t.$set(l);const s={};a[2]&1048576&&(s.offset=r[82]),a[2]&2097152&&(s.opacity=r[83]),a[0]&8|a[20]&2&&(s.$$scope={dirty:a,ctx:r}),i.$set(s)},i(r){o||(L(t.$$.fragment,r),L(i.$$.fragment,r),o=!0)},o(r){z(t.$$.fragment,r),z(i.$$.fragment,r),o=!1},d(r){r&&ee(n),Oe(t,r),Oe(i,r)}}}function Wb(e){let t,n;return t=new e4({props:{class:"PinturaStatusButton",offset:e[82],opacity:e[83],$$slots:{default:[d8]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[2]&1048576&&(r.offset=i[82]),o[2]&2097152&&(r.opacity=i[83]),o[1]&16|o[20]&2&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Ub(e){let t,n;return t=new qS({props:{progress:e[35].progressIndicator.progress}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&16&&(r.progress=i[35].progressIndicator.progress),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Hb(e){let t,n;const i=[e[35].closeButton,{hideLabel:!0}];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new Ll({props:o}
89),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[1]&16?fo(i,[yo(r[35].closeButton),i[1]]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function d8(e){let t,n,i,o=e[35].progressIndicator.visible&&Ub(e),r=e[35].closeButton&&e[35].text&&Hb(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[35].progressIndicator.visible?o?(o.p(a,l),l[1]&16&&L(o,1)):(o=Ub(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[35].closeButton&&a[35].text?r?(r.p(a,l),l[1]&16&&L(r,1)):(r=Hb(a),r.c(),L(r,1),r.m(n.parentNode,n)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function h8(e){let t,n=e[3].iconSupportError+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[0]&8&&n!==(n=i[3].iconSupportError+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function m8(e){let t,n;return t=new Br({props:{$$slots:{default:[h8]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&8|o[20]&2&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Nb(e){let t,n,i,o,r,a,l,s,c,u,f,d,m,g,p=e[10]&&Gb(e),y=e[46]&&e[45]&&jb(e);const w=[_8,w8],_=[];function P(T,v){return T[46]?0:1}i=P(e),o=_[i]=w[i](e),a=new C6({props:{isAnimated:e[53],isTransparent:e[20],pixelRatio:e[57],textPixelRatio:e[6],backgroundColor:e[56],maskRect:e[58],maskOpacity:e[73]?e[73].maskOpacity:1,maskMarkupOpacity:e[7],maskFrameOpacity:e[5],clipAnnotationsToImage:e[85],images:e[55],interfaceImages:e[86],loadImageData:e[28],enableGrid:e[11],gridSize:e[87],gridColors:[e[88],e[89]],gridOpacity:e[90],selectionColor:e[91],csp:e[92]||{},willRequest:e[81]||e[93],willRender:e[443],didRender:e[444]}});function C(T){e[446](T)}function R(T){e[447](T)}function I(T){e[448](T)}let M={root:e[2],locale:e[3],isAnimated:e[163],stores:e[202],allowPan:e[95],enablePan:e[17],enablePanLimit:e[21],panLimitGutterScalar:e[22],enablePanInput:e[96],allowZoom:e[97],enableZoom:e[18],enableZoomInput:e[19]!==void 0?e[19]:e[98],enableZoomControls:e[99],zoomOptions:e[13]||e[23],zoomAdjustStep:e[14]||e[24],zoomAdjustFactor:e[15]||e[25],zoomAdjustWheelFactor:e[16]||e[26],imageSelectionRectCentered:e[100],imageSelectionRectScalar:e[101],elasticity:bm*e[8]};return e[0]!==void 0&&(M.zoomLevel=e[0]),e[33]!==void 0&&(M.zoomControls=e[33]),e[34]!==void 0&&(M.zoomMultiTouching=e[34]),u=new c8({props:M}),vn.push(()=>Cr(u,"zoomLevel",C)),vn.push(()=>Cr(u,"zoomControls",R)),vn.push(()=>Cr(u,"zoomMultiTouching",I)),{c(){p&&p.c(),t=ut(),y&&y.c(),n=ut(),o.c(),r=ut(),Ve(a.$$.fragment),l=ut(),s=fe("div"),c=ut(),Ve(u.$$.fragment),k(s,"class","PinturaRootPortal")},m(T,v){p&&p.m(T,v),te(T,t,v),y&&y.m(T,v),te(T,n,v),_[i].m(T,v),te(T,r,v),ve(a,T,v),te(T,l,v),te(T,s,v),e[445](s),te(T,c,v),ve(u,T,v),g=!0},p(T,v){T[10]?p?(p.p(T,v),v[0]&1024&&L(p,1)):(p=Gb(T),p.c(),L(p,1),p.m(t.parentNode,t)):p&&(Et(),z(p,1,1,()=>{p=null}),At()),T[46]&&T[45]?y?(y.p(T,v),v[1]&49152&&L(y,1)):(y=jb(T),y.c(),L(y,1),y.m(n.parentNode,n)):y&&(Et(),z(y,1,1,()=>{y=null}),At());let H=i;i=P(T),i===H?_[i].p(T,v):(Et(),z(_[H],1,1,()=>{_[H]=null}),At(),o=_[i],o?o.p(T,v):(o=_[i]=w[i](T),o.c()),L(o,1),o.m(r.parentNode,r));const Y={};v[1]&4194304&&(Y.isAnimated=T[53]),v[0]&1048576&&(Y.isTransparent=T[20]),v[1]&67108864&&(Y.pixelRatio=T[57]),v[0]&64&&(Y.textPixelRatio=T[6]),v[1]&33554432&&(Y.backgroundColor=T[56]),v[1]&134217728&&(Y.maskRect=T[58]),v[2]&2048&&(Y.maskOpacity=T[73]?T[73].maskOpacity:1),v[0]&128&&(Y.maskMarkupOpacity=T[7]),v[0]&32&&(Y.maskFrameOpacity=T[5]),v[2]&8388608&&(Y.clipAnnotationsToImage=T[85]),v[1]&16777216&&(Y.images=T[55]),v[2]&16777216&&(Y.interfaceImages=T[86]),v[0]&268435456&&(Y.loadImageData=T[28]),v[0]&2048&&(Y.enableGrid=T[11]),v[2]&33554432&&(Y.gridSize=T[87]),v[2]&201326592&&(Y.gridColors=[T[88],T[89]]),v[2]&268435456&&(Y.gridOpacity=T[90]),v[2]&536870912&&(Y.selectionColor=T[91]),v[2]&1073741824&&(Y.csp=T[92]||{}),v[2]&524288|v[3]&1&&(Y.willRequest=T[81]||T[93]),v[0]&512|v[1]&270991424|v[3]&2&&(Y.willRender=T[443]),v[2]&62&&(Y.didRender=T[444]),a.$set(Y);const Z={};v[0]&4&&(Z.root=T[2]),v[0]&8&&(Z.locale=T[3]),v[3]&4&&(Z.allowPan=T[95
89]),v[0]&131072&&(Z.enablePan=T[17]),v[0]&2097152&&(Z.enablePanLimit=T[21]),v[0]&4194304&&(Z.panLimitGutterScalar=T[22]),v[3]&8&&(Z.enablePanInput=T[96]),v[3]&16&&(Z.allowZoom=T[97]),v[0]&262144&&(Z.enableZoom=T[18]),v[0]&524288|v[3]&32&&(Z.enableZoomInput=T[19]!==void 0?T[19]:T[98]),v[3]&64&&(Z.enableZoomControls=T[99]),v[0]&8396800&&(Z.zoomOptions=T[13]||T[23]),v[0]&16793600&&(Z.zoomAdjustStep=T[14]||T[24]),v[0]&33587200&&(Z.zoomAdjustFactor=T[15]||T[25]),v[0]&67174400&&(Z.zoomAdjustWheelFactor=T[16]||T[26]),v[3]&128&&(Z.imageSelectionRectCentered=T[100]),v[3]&256&&(Z.imageSelectionRectScalar=T[101]),v[0]&256&&(Z.elasticity=bm*T[8]),!f&&v[0]&1&&(f=!0,Z.zoomLevel=T[0],Dr(()=>f=!1)),!d&&v[1]&4&&(d=!0,Z.zoomControls=T[33],Dr(()=>d=!1)),!m&&v[1]&8&&(m=!0,Z.zoomMultiTouching=T[34],Dr(()=>m=!1)),u.$set(Z)},i(T){g||(L(p),L(y),L(o),L(a.$$.fragment,T),L(u.$$.fragment,T),g=!0)},o(T){z(p),z(y),z(o),z(a.$$.fragment,T),z(u.$$.fragment,T),g=!1},d(T){T&&(ee(t),ee(n),ee(r),ee(l),ee(s),ee(c)),p&&p.d(T),y&&y.d(T),_[i].d(T),Oe(a,T),e[445](null),Oe(u,T)}}}function Gb(e){let t,n,i,o,r;return n=new Xo({props:{items:e[69]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaNav PinturaNavTools")},m(a,l){te(a,t,l),ve(n,t,null),i=!0,o||(r=[Pe(t,"measure",e[432]),wn(Fo.call(null,t))],o=!0)},p(a,l){const s={};l[2]&128&&(s.items=a[69]),n.$set(s)},i(a){i||(L(n.$$.fragment,a),i=!0)},o(a){z(n.$$.fragment,a),i=!1},d(a){a&&ee(t),Oe(n),o=!1,On(r)}}}function jb(e){let t,n,i;return n=new Ka({props:{elasticity:e[8]*pm,scrollDirection:e[76]?"y":"x",$$slots:{default:[S8]},$$scope:{ctx:e}}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaNav PinturaNavMain")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&256&&(a.elasticity=o[8]*pm),r[2]&16384&&(a.scrollDirection=o[76]?"y":"x"),r[1]&12288|r[2]&135168|r[20]&2&&(a.$$scope={dirty:r,ctx:o}),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function g8(e){let t,n;const i=[e[79],{tabs:e[44]}];let o={$$slots:{default:[y8,({tab:r})=>({620:r}),({tab:r})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r?1:0]]},$$scope:{ctx:e}};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new eh({props:o}),t.$on("select",e[433]),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[1]&8192|a[2]&131072?fo(i,[a[2]&131072&&yo(r[79]),a[1]&8192&&{tabs:r[44]}]):{};a[20]&3&&(l.$$scope={dirty:a,ctx:r}),t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function b8(e){let t,n;return t=new Xo({props:{items:e[44]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&8192&&(r.items=i[44]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function p8(e){let t,n=e[620].icon+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[20]&1&&n!==(n=i[620].icon+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function y8(e){let t,n,i,o=e[620].label+"",r,a;return t=new Br({props:{$$slots:{default:[p8]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment),n=ut(),i=fe("span"),r=bi(o)},m(l,s){ve(t,l,s),te(l,n,s),te(l,i,s),Ae(i,r),a=!0},p(l,s){const c={};
89s[20]&3&&(c.$$scope={dirty:s,ctx:l}),t.$set(c),(!a||s[20]&1)&&o!==(o=l[620].label+"")&&vi(r,o)},i(l){a||(L(t.$$.fragment,l),a=!0)},o(l){z(t.$$.fragment,l),a=!1},d(l){l&&(ee(n),ee(i)),Oe(t,l)}}}function S8(e){let t,n,i,o;const r=[b8,g8],a=[];function l(s,c){return s[74]?0:1}return t=l(e),n=a[t]=r[t](e),{c(){n.c(),i=Mi()},m(s,c){a[t].m(s,c),te(s,i,c),o=!0},p(s,c){let u=t;t=l(s),t===u?a[t].p(s,c):(Et(),z(a[u],1,1,()=>{a[u]=null}),At(),n=a[t],n?n.p(s,c):(n=a[t]=r[t](s),n.c()),L(n,1),n.m(i.parentNode,i))},i(s){o||(L(n),o=!0)},o(s){z(n),o=!1},d(s){s&&ee(i),a[t].d(s)}}}function w8(e){let t,n,i;function o(a){e[439](a)}let r={locale:e[3],class:"PinturaMain",view:e[207](e[43]),props:e[206](e[43],e[27]),stores:e[202]};return e[1][e[43]]!==void 0&&(r.component=e[1][e[43]]),t=new WS({props:r}),vn.push(()=>Cr(t,"component",o)),t.$on("measure",e[233]),t.$on("show",e[440]),t.$on("hide",e[441]),t.$on("fade",e[442]),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,l){const s={};l[0]&8&&(s.locale=a[3]),l[1]&4096&&(s.view=a[207](a[43])),l[0]&134217728|l[1]&4096&&(s.props=a[206](a[43],a[27])),!n&&l[0]&2|l[1]&4096&&(n=!0,s.component=a[1][a[43]],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}function _8(e){let t,n;const i=[{class:"PinturaMain"},{visible:e[62]},e[79],{panels:e[78]}];let o={$$slots:{default:[T8,({panel:r,panelIsActive:a})=>({618:r,619:a}),({panel:r,panelIsActive:a})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(r?536870912:0)|(a?1073741824:0)]]},$$scope:{ctx:e}};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new th({props:o}),t.$on("measure",e[438]),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[2]&196609?fo(i,[i[0],a[2]&1&&{visible:r[62]},a[2]&131072&&yo(r[79]),a[2]&65536&&{panels:r[78]}]):{};a[0]&134217738|a[19]&1610612736|a[20]&2&&(l.$$scope={dirty:a,ctx:r}),t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function T8(e){let t,n,i;function o(c){e[434](c,e[618])}function r(){return e[435](e[618])}function a(){return e[436](e[618])}function l(...c){return e[437](e[618],...c)}let s={locale:e[3],view:e[207](e[618]),props:e[206](e[618],e[27]),isActive:e[619],stores:e[202]};return e[1][e[618]]!==void 0&&(s.component=e[1][e[618]]),t=new WS({props:s}),vn.push(()=>Cr(t,"component",o)),t.$on("measure",e[233]),t.$on("show",r),t.$on("hide",a),t.$on("fade",l),{c(){Ve(t.$$.fragment)},m(c,u){ve(t,c,u),i=!0},p(c,u){e=c;const f={};u[0]&8&&(f.locale=e[3]),u[19]&536870912&&(f.view=e[207](e[618])),u[0]&134217728|u[19]&536870912&&(f.props=e[206](e[618],e[27])),u[19]&1073741824&&(f.isActive=e[619]),!n&&u[0]&2|u[19]&536870912&&(n=!0,f.component=e[1][e[618]],Dr(()=>n=!1)),t.$set(f)},i(c){i||(L(t.$$.fragment,c),i=!0)},o(c){z(t.$$.fragment,c),i=!1},d(c){Oe(t,c)}}}function Zb(e){let t;return{c(){t=fe("span"),k(t,"class","PinturaEditorOverlay"),Ee(t,"opacity",e[102])},m(n,i){te(n,t,i)},p(n,i){i[3]&512&&Ee(t,"opacity",n[102])},d(n){n&&ee(t)}
89}}function Xb(e){let t,n;const i=[{layout:"row"},{parentRect:e[50]},e[60]];let o={$$slots:{default:[k8]},$$scope:{ctx:e}};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new t4({props:o}),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[1]&537395200?fo(i,[i[0],a[1]&524288&&{parentRect:r[50]},a[1]&536870912&&yo(r[60])]):{};a[1]&1610612736|a[20]&2&&(l.$$scope={dirty:a,ctx:r}),t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function k8(e){let t,n,i;return{c(){t=fe("input"),t.value=n=e[60].text,k(t,"placeholder",i=e[60].placeholder),k(t,"type","text"),k(t,"spellcheck","false"),k(t,"autocorrect","off"),k(t,"autocapitalize","off")},m(o,r){te(o,t,r),e[449](t)},p(o,r){r[1]&536870912&&n!==(n=o[60].text)&&t.value!==n&&(t.value=n),r[1]&536870912&&i!==(i=o[60].placeholder)&&k(t,"placeholder",i)},d(o){o&&ee(t),e[449](null)}}}function C8(e){let t,n,i,o,r,a;Ec(e[431]);let l=e[40]&&zb(e),s=e[102]>0&&Zb(e),c=e[60]&&Xb(e);return{c(){t=fe("div"),l&&l.c(),n=ut(),s&&s.c(),i=ut(),c&&c.c(),k(t,"id",e[4]),k(t,"class",e[77]),k(t,"data-env",e[75]),k(t,"dir",e[12])},m(u,f){te(u,t,f),l&&l.m(t,null),Ae(t,n),s&&s.m(t,null),Ae(t,i),c&&c.m(t,null),e[450](t),o=!0,r||(a=[Pe(Fs,"keydown",e[224]),Pe(Fs,"keyup",e[225]),Pe(Fs,"blur",e[226]),Pe(Fs,"paste",e[230]),Pe(Fs,"resize",e[431]),Pe(t,"ping",function(){kn(e[68])&&e[68].apply(this,arguments)}),Pe(t,"contextmenu",e[227]),Pe(t,"touchstart",e[222],{passive:!1}),Pe(t,"touchmove",function(){kn(e[71])&&e[71].apply(this,arguments)}),Pe(t,"pointermove",function(){kn(e[70])&&e[70].apply(this,arguments)}),Pe(t,"transitionend",e[212]),Pe(t,"dropfiles",e[228]),Pe(t,"measure",e[451]),Pe(t,"click",function(){kn(e[42]?e[229]:st)&&(e[42]?e[229]:st).apply(this,arguments)}),wn(Fo.call(null,t,{observeViewRect:!0,isMeasureRoot:!0})),wn(m6.call(null,t)),wn(VS.call(null,t))],r=!0)},p(u,f){e=u,e[40]?l?(l.p(e,f),f[1]&512&&L(l,1)):(l=zb(e),l.c(),L(l,1),l.m(t,n)):l&&(Et(),z(l,1,1,()=>{l=null}),At()),e[102]>0?s?s.p(e,f):(s=Zb(e),s.c(),s.m(t,i)):s&&(s.d(1),s=null),e[60]?c?(c.p(e,f),f[1]&536870912&&L(c,1)):(c=Xb(e),c.c(),L(c,1),c.m(t,null)):c&&(Et(),z(c,1,1,()=>{c=null}),At()),(!o||f[0]&16)&&k(t,"id",e[4]),(!o||f[2]&32768)&&k(t,"class",e[77]),(!o||f[2]&8192)&&k(t,"data-env",e[75]),(!o||f[0]&4096)&&k(t,"dir",e[12])},i(u){o||(L(l),L(c),o=!0)},o(u){z(l),z(c),o=!1},d(u){u&&ee(t),l&&l.d(),s&&s.d(),c&&c.d(),e[450](null),r=!1,On(a)}}}const P8=.75;let M8=16;const R8=5,bm=1,Iu="stage-overlay",N1=64,pm=10,I8=5;function E8(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de,Fe,X,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te,me,Me,qe,Ne,mt,ue,He,Qe,G,je,ye,$e,St,Je,q,Ie,se,V,dt,Ft,We,Xe,nt,wt,Zt,yt,nn,Jt,yn,an,Tt,Sn,ln,sn,ke,Re,Lt,fn,on,En,bt,Un,Hn,$n,Q,Ge,j,Le,tt,en,Xt,Ze,tn,Fn,K,J,xe,it=qt,Ye=()=>(it(),it=Do(Ff,h=>n(376,xe=h)),Ff),ct,ot,Ct,cn,Qt,_n,Bt,et,ri,Gn,Ri,ai,ui,Yn,_t,Dn,Vn,ni,Bn,qn,ii,pi,An,Cn,_i,fi,eo,di,dr,So,li,hi,wa,Qr,hr,Ko,zr,Vr,Pr,Wr,ul,Ki,wo,Ei,_a=qt,Ya=()=>(_a(),_a=Do(va,h=>n(405,Ei=h)),va),Yi,ho,zn,Ui,Vo,ar,to,$r,Ai,Ur,no,Yo,Hr,fl,mo,go,qa,ji,mr,Hi,ea,gr,ta,Ta,br,Ja,dl,pr,Oi,_o,na,ka,io,ia,yr,Nr,Qa,Gr,Wo,Uo,Ca,lr,ei,To,zt,ko,Co,$a,Pa,qo,mi,Mr,Ma,Ra,Rr,el,Ir,Fl,vl,tl,hl,Sr,ml,oa,Ol,gl,Ia,Ea;B(e,d6,h=>n(419,Oi=h)),e.$$.on_destroy.push(()=>it()),e.$$.on_destroy.push(()=>_a());const Jo=Pl(),Ho=Xa();let{class:x=void 0}=t,{layout:we=void 0}=t,{stores:Vt}=t,{locale:rt=void 0}=t,{id:Dt=void 0}=t,{util:Gt=void 0}=t,{utils:E=void 0}=t,{animations:Ue="auto"}=t,{disabled:pt=!1}=t,{previewUpscale:Tn=!1}=t,{previewPad:Pn=!1}=t,{previewMaskOpacity:jn=.95}=t,{previewImageDataMaxSize:Zn=void 0}=t,{previewImageTextPixelRatio:gi=void 0}=t,{markupMaskOpacity:Ti=1}=t,{zoomMaskOpacity:ki=.85}=t,{elasticityMultiplier:si=10}=t,{willRevert:No=()=>Promise.resolve(!0)}=t,{willProcessImage:vo=()=>Promise.resolve(!0)}=t,{willRenderCanvas:Er=Nn}=t,{willRenderToolbar:Po=Nn}=t,{willRenderUtilTabs:Qo=Nn}=t,{willSetHistoryInitialState:us=Nn}=t,{enableButtonExport:Oc=!0}=t,{enableButtonRevert:Dc=!0}=t,{enableNavigateHistory:Bc=!0}=t,{enableToolbar:Ns=!0}=t,{enableUtils:zc=!0}=t,{enableButtonClose:Vc=!1}=t,{enableDropImage:Wc=!1}=t,{enablePasteImage:Uc=!1}=t,{enableBrowseImage:Hc=!1}=t,{accept:Gs="image/*"}
89=t,{enableTransparencyGrid:ef=!1}=t,{layoutDirectionPreference:Nc="auto"}=t,{layoutHorizontalUtilsPreference:Gc="left"}=t,{layoutVerticalUtilsPreference:jc="bottom"}=t,{layoutVerticalToolbarPreference:qi="top"}=t,{layoutVerticalControlGroupsPreference:Zc="bottom"}=t,{layoutVerticalControlTabsPreference:Xc="bottom"}=t,{supportedMediaTypes:tf=["image"]}=t,{status:jr=void 0}=t,{formatStatusImageLoading:Kc=function(h,D){const{state:ce}=h;if(!ce||!ce.task)return D.statusImageLoadNone;if(ce.error){if(ce.error.code==="IMAGE_TOO_SMALL")return D.statusImageLoadMinSize;if(ce.error.code==="VIDEO_TOO_SHORT"){const Ce=Array.isArray(D.unitSeconds)?ce.error.metadata.minDuration===1?D.unitSeconds[0]:D.unitSeconds[1]:D.unitSeconds;return Jl(D.statusImageLoadMinDuration,{seconds:Ce},"{","}")}return D.statusImageLoadError}return ce.task==="blob-to-bitmap"?D.statusImageLoadPrepare:D.statusImageLoadBusy}}=t,{formatStatusImageProcessing:Yc=function(h,D){const{state:ce}=h;if(!(!ce||!ce.task))return ce.task==="store"?ce.error?D.statusImageUploadError:D.statusImageUploadBusy:ce.error?D.statusImageProcessError:D.statusImageProcessBusy}}=t,{formatStatusSupportError:qc=function(h,D){const{features:ce}=h;return{features:ce.join(", ")}}}=t,{textDirection:nf=void 0}=t,{markupEditorZoomLevel:fs=null}=t,{markupEditorZoomLevels:of=void 0}=t,{markupEditorZoomAdjustStep:rf=void 0}=t,{markupEditorZoomAdjustFactor:js=void 0}=t,{markupEditorZoomAdjustWheelFactor:af=void 0}=t,{markupEditorInteractionMode:bl=!1}=t,{muteAudio:ds=!0}=t,{willSetMediaInitialTimeOffset:hs=(h,D)=>h*l8(D[0])}=t,{enablePan:Zs=!0}=t,{enableZoom:Dl=!0}=t,{enableZoomControls:Jc=!0}=t,{enableZoomInput:lf=void 0}=t,{enablePanInput:ms=void 0}=t,{enableCanvasAlpha:gs=!1}=t,{enablePanLimit:Qc=void 0}=t,{panLimitGutterScalar:sf=void 0}=t,{pan:Xs=null}=t,{zoomPresetOptions:cf=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:$c=.25}=t,{zoomAdjustFactor:uf=.1}=t,{zoomAdjustWheelFactor:ff=1}=t,{zoomLevel:pl=null}=t,{fixScrollDirection:Ks=!1}=t;const eu=ht(Ks);sr("fixScrollDirection",eu);const Ys=zo()&&"visualViewport"in window,df=ht("hidden");sr("softKeyboardState",df);function bs(h){const{height:D,scale:ce}=h.target,lt=D*ce/window.screen.height<P8?"visible":"hidden";df.set(lt)}Ys&&window.visualViewport.addEventListener("resize",bs);let ps,qs;const ah=()=>n(60,ps=void 0),lh=(h,D,ce)=>{const{text:Ce="",placeholder:lt="",autoClose:dn=!0,align:$t="top",justify:ti="center",buttonConfirm:Bi,buttonCancel:Mo}=ce;n(60,ps={align:$t,justify:ti,text:Ce,placeholder:lt,buttonConfirm:Bi,buttonCancel:Mo,onconfirm:()=>{h(qs.value),dn&&n(60,ps=void 0)},oncancel:()=>{D(void 0),n(60,ps=void 0)}})};let{imagePreviewSrc:Bl=void 0}=t,{imageOrienter:Js={read:()=>1,apply:h=>h}}=t,{pluginComponents:zl=void 0}=t,{pluginOptions:nl={}}=t;const ys=Jo.sub,wr={};let{root:Di}=t;const tu=()=>{xe.setAttribute("data-redraw","true"),Yt.set({})},Qs=ht(!0);B(e,Qs,h=>n(486,Bn=h));const _r=ht(void 0);B(e,_r,h=>n(429,ko=h));const Zr=ht(0);B(e,Zr,h=>n(426,ei=h));const hf=ht(!1),sh=()=>Zr.set(Ke()/ze()),$s=h=>{hf.set(h.type==="play"),Jo.pub(h.type)};let mf,nu;const ch=h=>{if(!A())return;const D=Date.now();if(nu&&D-nu<M8)return;nu=D;const ce=To*h;if(ce.toFixed(1)===mf)return;mf=ce.toFixed(1);const Ce=xe,lt=()=>{Ce.removeEventListener("seeked",lt),tu()};Ce.addEventListener("seeked",lt),xb(Ce,ce)};let iu=!1,gf,ou;const ru=()=>{if(!r||!A())return;ou=f,_e(_r,ko=void 0,ko);const h=xe;iu=!1;const D=1/24,ce=ze(),Ce=Math.abs(c*ce-ei*ce)<=D,lt=ce-ce*ei<=D;Ce?_e(Zr,ei=s,ei):lt&&_e(Zr,ei=0,ei),Ot(ei*ze()),h.play().catch(()=>{});const dn=()=>{if(A())return;const $t=ou>=0;gf=requestAnimationFrame(dn);const ti=Ke();_e(Zr,ei=Math.min(ti/ze(),1),ei),$t&&ei>=c&&(_e(Zr,ei=c,ei),b()),f>-1&&(iu=!0),$t&&iu&&f===-1&&d>0&&(_e(Zr,ei=l[d][0],ei),Ot(ei*ze())),ei>=1&&b(),_e(Jn,Wo=ei*ze(),Wo),tu()};dn()},b=()=>{!r||A()||(_e(_r,ko=void 0,ko),ou=void 0,xe.pause(),cancelAnimationFrame(gf),tu())},A=()=>xe&&xe.paused,O=()=>{if(r)return A()?ru():b()},ne=()=>{if(!r)return;const h=xe;h.muted=!0},oe=()=>{if(!r)return;const h=xe;h.muted=!1},he=()=>{r&&_e(Be,zt=!zt,zt)},Be=ht(ds);B(e,Be,h=>n(428,zt=h));const ze=()=>{if(r)return xe.duration},Ke=()=>r?xe.currentTime:void 0,Ot=h=>{r&&(xb(xe,h),_e(Zr,ei=h/To,ei))},Kt=h=>{if(!r)return;const D=xe;D.volume=Math.min(1,h)},Yt=ht({});B(e,Yt,h=>n(52,pi=h)),sr("redrawTrigger",Yt);const bn=ht(si);B(e,bn,h=>n(503,Ca=h)),sr("elasticityMultiplier",bn);let at=[];const oi=hn();B(e,oi,h=>n(102,Ea=h));const jt=tg()||1024,It=Ci(jt,jt),vt=PS(),Pt=h=>Promise.resolve(Uo&&Uo(h,{resourceType:"image"})).then(D=>
89{if(D===!1)return;const{headers:ce,credentials:Ce}=D||{};return fetch(h,{headers:ce,credentials:Ce}).then(lt=>{if(lt.status!==200)throw`${lt.status} (${lt.statusText})`;return lt.blob()}).then(lt=>Ob(lt,{imageOrienter:Js,canvasMemoryLimit:vt})).then(lt=>Db(lt,p))});let{imageSourceToImageData:kt=h=>Nt(h)?Pt(h):Mc(h)?new Promise(D=>D(xc(h))):Om(h)||Ju(h)?Ob(h,{imageOrienter:Js,canvasMemoryLimit:vt}).then(D=>Db(D,p)):void 0}=t;const Wt=JP(),{file:Mn,size:xt,duration:Wn,currentTime:Jn,trim:oo,volume:bo,minDuration:Zi,maxDuration:Xi,loadState:Ji,processState:$o,cropAspectRatio:Ar,cropLimitToImage:Ni,crop:Gi,cropMinSize:er,cropMaxSize:yl,cropRange:Aa,cropOrigin:ec,cropRectAspectRatio:La,rotation:Lr,rotationRange:Ss,targetSize:tc,flipX:ws,flipY:ra,backgroundColor:xa,backgroundImage:po,backgroundFilterMode:Fa,colorMatrix:pg,convolutionMatrix:yg,gamma:Sg,vignette:wg,noise:_g,decoration:bf,annotation:pf,manipulation:yf,redaction:Sf,frame:_s,selection:uh,state:wf}=Wt.stores;B(e,Mn,h=>n(403,Ki=h)),B(e,xt,h=>n(377,Ct=h)),B(e,Wn,h=>n(427,To=h)),B(e,Jn,h=>n(502,Wo=h)),B(e,oo,h=>n(424,Gr=h)),B(e,bo,h=>n(425,lr=h)),B(e,Xi,h=>n(430,Co=h)),B(e,Ji,h=>n(395,hi=h)),B(e,$o,h=>n(394,li=h)),B(e,Ar,h=>n(499,na=h)),B(e,Ni,h=>n(85,mi=h)),B(e,Gi,h=>n(414,go=h)),B(e,Lr,h=>n(380,_n=h)),B(e,ws,h=>n(379,Qt=h)),B(e,ra,h=>n(378,cn=h)),B(e,xa,h=>n(385,Dn=h)),B(e,bf,h=>n(48,ot=h)),B(e,pf,h=>n(49,Bt=h)),B(e,yf,h=>n(382,ui=h)),B(e,Sf,h=>n(383,Yn=h)),B(e,_s,h=>n(47,ct=h)),B(e,uh,h=>n(59,yr=h)),B(e,wf,h=>n(488,Yi=h)),sr("components",{DynamicComponentTree:Xo}),sr("previewcontrols",{play:ru,pause:b,togglePlayPause:O,mute:ne,unmute:oe,toggleMute:he,setCurrentTime:Ot,getCurrentTime:Ke,getDuration:ze,frameOffset:Zr,framePeekOffset:_r,isPlaying:hf,isMuted:Be});const Tg=(h,D,ce=0)=>new Promise((Ce,lt)=>{if(as(h)){IS(h).then(Bi=>{const Mo=Ht(Wo)?Wo:hs(Bi.duration,Gr||[[0,1]]);ES(Bi,Mo).then(Ce)}).catch(lt);return}let dn=!1,$t;D.cancel=()=>dn=!0;const ti=Date.now();kt(h).then(Bi=>{const Mo=Date.now()-ti;clearTimeout($t),$t=setTimeout(()=>{dn||Ce(Bi)},Math.max(0,ce-Mo))}).catch(lt)}),{images:kg,shapePreprocessor:Cg,imageScrambler:Pg,imageRedactionRendering:Mg,willRequest:Rg,willRequestResource:Ig,csp:Eg}=Vt;B(e,kg,h=>n(423,Qa=h)),B(e,Cg,h=>n(422,Nr=h)),B(e,Pg,h=>n(386,Vn=h)),B(e,Mg,h=>n(384,_t=h)),B(e,Rg,h=>n(81,Uo=h)),B(e,Ig,h=>n(93,vl=h)),B(e,Eg,h=>n(92,Fl=h));let au;const W4=Ln(po,(h,D)=>{if(!h)return D(void 0);au&&(au.cancel(),au=void 0),au={cancel:st},Tg(h,au).then(D).catch(ce=>{})}),U4=wf.subscribe(h=>Jo.pub("update",h)),H4=ht(),N4=ht({});sr("ui",N4),sr("selection",uh);const fh=ht(!0);B(e,fh,h=>n(95,hl=h));const dh=ht(!0);B(e,dh,h=>n(97,ml=h));const hh=ht(!0);B(e,hh,h=>n(421,ia=h));const _f=ht(!0);B(e,_f,h=>n(500,ka=h));const mh=ht(!0);B(e,mh,h=>n(98,oa=h));const gh=ht();B(e,gh,h=>n(99,Ol=h));const Tf=ht();B(e,Tf,h=>n(501,io=h));const bh=Ln([Tf,_f],(()=>io!==void 0?io:ka));B(e,bh,h=>n(96,Sr=h));const nc=ht([0,0,0]);B(e,nc,h=>n(56,ar=h));const kf=ht([1,1,1]);B(e,kf,h=>n(484,ai=h));const lu=hn([1,1,1]);B(e,lu,h=>n(483,Ri=h));const ph=ht();B(e,ph,h=>n(91,Ir=h));const Ag=ht(),yh=ht();B(e,yh,h=>n(51,qn=h));const ic=ht();B(e,ic,h=>n(375,K=h));const G4=()=>{const h=na,D=ao(K);h&&h===D||(Ar.set(ao(K)),Yg())},oc=ht(ql());B(e,oc,h=>n(80,ho=h));const Sh=ht(0);B(e,Sh,h=>n(420,_o=h));const su=ht(ql());B(e,su,h=>n(84,qo=h));const Ts=ht();B(e,Ts,h=>n(481,J=h));const Cf=vb("(pointer: fine)",h=>h?"pointer-fine":"pointer-coarse");B(e,Cf,h=>n(401,Wr=h));const Pf=vb("(hover: hover)",h=>h?"pointer-hover":"pointer-no-hover");B(e,Pf,h=>n(400,Pr=h));const Lg=ht(!1),cu=ht(!1);B(e,cu,h=>n(381,Gn=h));const wh=pc(void 0,h=>{const D=hn(0),ce=lt=>{D.set(lt?1:0,{hard:!Cn})},Ce=[cu.subscribe(ce),D.subscribe(h)];return()=>Ce.forEach(lt=>lt())});B(e,wh,h=>
89n(482,ri=h));const Mf=ht();B(e,Mf,h=>n(487,Ko=h));const Rf=ht();B(e,Rf,h=>n(53,Cn=h)),sr("isAnimated",Rf);let _h;const If=ht(Tn);B(e,If,h=>n(404,wo=h));const ks=ht(!1);B(e,ks,h=>n(493,mr=h)),sr("imageIsStatic",ks);const uu=ht();B(e,uu,h=>n(494,Hi=h));const Th=ht();B(e,Th,h=>n(491,qa=h));const xg=pc(void 0,h=>{const D=ht(void 0),ce=()=>{if(!go)return;if(mr)return D.set(Rn(go));const lt=Eb(go,qa,R8*si);D.set(lt)},Ce=[Gi.subscribe(ce),D.subscribe(h)];return()=>Ce.forEach(lt=>lt())}),aa=ht();B(e,aa,h=>n(490,mo=h));const Ef=ht();B(e,Ef,h=>n(492,ji=h));const kh=ht(void 0);B(e,kh,h=>n(497,Ja=h));const Fg=ht(Kn());B(e,Fg,h=>n(498,dl=h));const vg=(h,D)=>{if(!D||!h)return{top:0,right:0,bottom:0,left:0};const ce=Ky(D,h,y),Ce=Xy(ce,h);return{top:Math.abs(Ce.top),right:Math.abs(Ce.right),bottom:Math.abs(Ce.bottom),left:Math.abs(Ce.left)}},Og=ht({}),Ch=Ln([Ts,oc,su,Og],([h,D,ce,Ce],lt)=>{if(!h)return lt(void 0);let dn=0;pe.length===1&&!m&&qi!=="bottom"&&(dn=ce.y+ce.height),lt(Li(h.x+D.x,h.y+D.y+dn,h.width,h.height))});let fu={left:0,right:0,top:0,bottom:0};const Af=ht(!1),rc=Ln([Af,_s,Ch,cu],([h,D,ce,Ce],lt)=>{if(!ce)return lt({left:0,right:0,top:0,bottom:0});if(!h)return;const dn=Math.min(ce.width,ce.height),$t=vg({width:dn,height:dn},D);un(fu.top,4)===un($t.top,4)&&un(fu.bottom,4)===un($t.bottom,4)&&un(fu.right,4)===un($t.right,4)&&un(fu.left,4)===un($t.left,4)||(fu=$t,lt($t))});B(e,rc,h=>n(412,Yo=h));const ac=Ln([Af,rc],([h,D],ce)=>{if(!h)return ce(!1);ce(Object.values(D).some(Ce=>Ce>0))});B(e,ac,h=>n(413,Hr=h));const j4=Ln([Af,Ts,ac,rc],([h,D,ce,Ce],lt)=>{if(D){if(!h||!ce)return lt({...D});lt(Li(D.x+Ce.left,D.y+Ce.top,D.width-Ce.left-Ce.right,D.height-Ce.top-Ce.bottom))}}),il=Ln([Ch,ac,rc],([h,D,ce],Ce)=>{if(!h)return Ce(void 0);if(!D)return Ce(h);Ce(Li(h.x+ce.left,h.y+ce.top,h.width-ce.left-ce.right,h.height-ce.top-ce.bottom))});B(e,il,h=>n(50,et=h));const Z4=Ln([ks,xt,Lr],([h,D,ce],Ce)=>{if(!h||!D)return Ce(void 0);const lt=jo(D),dn=Ro(lt,ce);Ce(dn)}),Ph=Ln([Z4],([h],D)=>{if(!h)return D(void 0);const ce=Qi(h);D(Uu(ce))});B(e,Ph,h=>n(416,ta=h));const Sl=Ln([il,Gi,Ph,If],([h,D,ce,Ce],lt)=>{if(!h||!D||!!(Hi||qa))return;const{width:$t,height:ti}=ce||D,Bi=Math.min(h.width/$t,h.height/ti),Mo=Ce?Bi:Math.min(1,Bi);lt(Mo)});B(e,Sl,h=>n(415,gr=h));const X4=Ln([ks,xt,Lr,il,Ts,Sl],([h,D,ce,Ce,lt,dn],$t)=>{if(!h||!Ce||!lt||!D)return $t(void 0);const ti=jo(D),Bi=Uu(Oo(ti,dn)),Mo=Md(Ce,Bi);Bi.x=Mo.x,Bi.y=Mo.y;const sa=Ro(Bi,ce);$t(sa)});sr("imageStaticVisualCorners",X4);const lc=ht(void 0);B(e,lc,h=>n(418,pr=h));const Dg=Ln([Gi,il],([h,D])=>{if(!(!D||!h))return Math.min(D.width/h.width,D.height/h.height)}),Mh=Ln([Gi,aa],([h,D])=>!h||!D?1:Math.min(h.width/D.width,h.height/D.height));B(e,Mh,h=>n(101,Ia=h));const du=Ln([lc,Mh],([h,D])=>!h||!D?1:D*h);B(e,du,h=>n(496,Ta=h));const Cs=ht(Kn());B(e,Cs,h=>n(417,br=h));const Bg=ht({scalar:Ta,translation:br}),zg=()=>{Bg.set({scalar:void 0,translation:Kn()})},Lf=pc(void 0,h=>{const D=hn(void 0,{precision:1e-4}),ce=Fu()===1?dn=>qr(dn,Math.round):Nn,Ce=()=>{if(!mo)return;const dn=Gn||!Ko;if(mr){const ti=Rn(mo);return ua(ti,dl),ua(ti,et),D.set(ti,{hard:dn})}const $t=Eb(mo,Ja,bm*si);$t.width<0&&($t.width=0,$t.x=mo.x),$t.height<0&&($t.height=0,$t.y=mo.y),ua($t,et),ua($t,br),Oo($t,Ta),!dn&&ce($t),D.set($t,{hard:dn})},lt=[il.subscribe(Ce),aa.subscribe(Ce),du.subscribe(Ce),Cs.subscribe(Ce),_s.subscribe(Ce),D.subscribe(h)];return()=>lt.forEach(dn=>dn())});B(e,Lf,h=>n(58,no=h));const Rh=ht(1);B(e,Rh,h=>n(489,fl=h));const Ih=()=>{if(!go||!et)return;let h=Ds(Rn(go),gr||1);const D=Md(et,Ds(Rn(ta),gr));ua(h,D);const ce=J.width/h.width,Ce=J.height/h.height,lt=Math.min(1,ce,Ce);Rh.set(lt),Oo(h,lt),o5(h,{...J,x:0,y:0}),aa.set(h)},Vg=Ln([il,Sl,Gi,xt],([h,D,ce,Ce],lt)=>{!h||!ce&&!Ce||lt(Wg(h,D||1,ce||Ce))});B(e,Vg,h=>n(100,gl=h));const Wg=(h,D,ce)=>ce.width<=h.width&&ce.height<=h.height?Md(h,Ds(Rn(ce),D)):rr(h,ao(ce));let Eh,Ug;const Ah=h=>{if(m&&Eh&&da(Eh,h)&&Ug===gr)return;if(mr)return Ih();Eh=h,Ug=gr;const D=Wg(h,gr,go||Ct);aa.set(D)};let Hg=!1;const K4=Sl.subscribe(h=>{Hg||h===void 0||!go||(Ah(et),Hg=!0)}),Y4=il.subscribe(h=>{!h||gr===void 0||!go||Ah(h)}),q4=ks.subscribe(h=>{!h&&et&&Ah(et)});let Lh;const J4=Ef.subscribe(h=>
89{if(!h){Lh=void 0,_e(uu,Hi=void 0,Hi);return}Lh=ea;const D=Rn(go);uu.set(D)}),Q4=aa.subscribe(h=>{if(!h||!ji)return;const D=t5(Rn(h),ji);e5(D,Lh);const ce=n5(Rn(Hi),D);Gi.set(ce)}),$4=h=>{if(!h||!mo)return;if(mr){ji||Ih();return}if(Gn||ji||qa)return;const D=ao(mo),ce=ao(h);if(un(D,6)===un(ce,6))return;const{width:Ce,height:lt}=go,dn=Math.min(et.width/Ce,et.height/lt),$t=Ci(h.width*dn,h.height*dn),ti=(mo.width-$t.width)*.5,Bi=(mo.height-$t.height)*.5,Mo=Li(Math.max(0,Math.min(et.width-$t.width,mo.x+ti)),Math.max(0,Math.min(et.height-$t.height,mo.y+Bi)),$t.width,$t.height);aa.set(Mo)},e3=Gi.subscribe($4),Ng=Ln([Sl,Gi,aa,ks],([h,D,ce,Ce],lt)=>{if(!h||!D||!ce)return;if(Ce)return lt(fl);const dn=ce.width/D.width,$t=ce.height/D.height,ti=Math.max(dn,$t)/h;lt(ti)}),xf=Ln([Sl,Ng],([h,D],ce)=>{if(!D)return;const Ce=h*D;ce(Ce)});B(e,xf,h=>n(495,ea=h));let sc={left:0,right:0,top:0,bottom:0};const Gg=Ln([_s,aa],([h,D],ce)=>{if(!D)return ce(sc);const Ce=vg(D,h);un(sc.top,4)===un(Ce.top,4)&&un(sc.bottom,4)===un(Ce.bottom,4)&&un(sc.right,4)===un(Ce.right,4)&&un(sc.left,4)===un(Ce.left,4)||(sc=Ce,ce(Ce))}),t3=Ln([Gg],([h],D)=>{D(Object.values(h).some(ce=>ce>0))}),xh=hn(.075,{stiffness:.03,damping:.4,precision:.001}),n3=Ln([lu,nc,xh,Lf,du,_s,t3,Gg,ac],([h,D,ce,Ce,lt,dn,$t,ti,Bi],Mo)=>{if(!Ce||m)return Mo([]);let{x:sa,y:Tr,width:kr,height:Da}=Ce;sa+=.5,Tr+=.5,kr-=.5,Da-=.5;const Nl=[];if(dn){if($t){let{left:Ms,right:m0,top:a1,bottom:g0}=ti;Ms*=lt,m0*=lt,a1*=lt,g0*=lt;const hw=H1(D)?[1,1,1,.125]:[0,0,0,.075];Nl.push({x:sa-Ms-.5,y:Tr-a1-.5,width:kr+Ms+m0+1,height:Da+a1+g0+1,strokeWidth:1,strokeColor:hw,opacity:Bi?1:.5})}const r1=H1(h);!(dn&&dn.frameColor&&H1(dn.frameColor))&&!r1&&(Nl.push({x:sa-1,y:Tr-1,width:kr+2,height:Da+2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:ce}),Nl.push({x:sa+1,y:Tr+1,width:kr-2,height:Da-2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:ce}))}Mo([...Nl,{x:sa,y:Tr,width:kr,height:Da,strokeWidth:1,strokeColor:h,opacity:ce}])}),hu=ht([]);B(e,hu,h=>n(406,zn=h));const jg=Ln([n3,hu],([h,D],ce)=>{ce([...h,...D])});B(e,jg,h=>n(94,tl=h));const Fh=hn(0,{precision:.001});B(e,Fh,h=>n(408,Vo=h));const vh=hn();B(e,vh,h=>n(411,Ai=h));const Oh=hn();B(e,Oh,h=>n(410,$r=h));const Dh=hn();B(e,Dh,h=>n(409,to=h));const Bh=hn();B(e,Bh,h=>n(407,Ui=h));const mu=ht(!1);B(e,mu,h=>n(393,So=h));const gu=ht();B(e,gu,h=>n(396,wa=h));let Vl;const Ff=Ln([mu,gu],([h,D],ce)=>{if(!h||!D){ce(void 0);return}if(Vl&&(Vl.cancel(),n(297,Vl=void 0)),Ic(D))return ce(ry(D));const Ce=la.length?0:Cn?250:0;n(297,Vl={cancel:st}),Tg(D,Vl,Ce).then(ce).catch(lt=>{_e(Ji,hi.error=lt,hi)}).finally(()=>{n(297,Vl=void 0)})});Ye();let{imagePreviewCurrent:bu=void 0}=t;const zh=ht({});B(e,zh,h=>n(398,zr=h));const vf=ht([]);B(e,vf,h=>n(86,Mr=h));const i3=()=>{Cs.set(Kn()),lc.set(void 0),zg(),vf.set([])},Of=Ln([il,ic,xt,xg,aa,xf,Lr,ws,ra,du,Cs,Lg],([h,D,ce,Ce,lt,dn,$t,ti,Bi,Mo,sa,Tr],kr)=>{if(!h||!lt)return;const Da=pk(h,D,ce,Ce,lt,Mo,sa,dn,$t,ti,Bi);!Tr&&Z(Da),kr(Da)});B(e,Of,h=>n(399,Vr=h));const Zg=Ln([pg,yg,Sg,wg,_g],([h,D,ce,Ce,lt],dn)=>{const $t=h&&Object.keys(h).map(Bi=>h[Bi]).filter(Boolean),ti={gamma:ce||void 0,vignette:Ce||void 0,noise:lt||void 0,convolutionMatrix:D||void 0,colorMatrix:$t&&$t.length&&Jd($t)};dn(ti)});let Df,Vh;const Xg=e8(),pu=ht({});B(e,pu,h=>n(387,ii=h)),sr("env",pu);const Kg=Fu(),Wh=pc(Kg,h=>{const D=()=>h(Fu()),ce=matchMedia(`(resolution: ${Kg}dppx)`);return ce.addListener(D),()=>ce.removeListener(D)});B(e,Wh,h=>n(57,Ur=h));const va=t8(()=>Yi,h=>{_e(wf,Yi=h,Yi),oc.set(ho)},{willUndo:()=>s3()?(l3(),!1):!0});Ya();const Yg=()=>{const h={...Ct},D=qr(rr(h,Yi.cropAspectRatio),Math.round),ce=us({...Yi,rotation:0,crop:D},Yi),Ce=[ce];JSON.stringify(ce)!==JSON.stringify(Yi)&&Ce.push({...Yi}),va.set(Ce)},o3=Ji.subscribe(h=>{h&&h.complete&&Yg()}),r3=()=>No().then(h=>h&&va.revert()),a3=[pf,bf,Sf,yf],l3=()=>{a3.forEach(h=>{h.update(D=>D.length&&nr(D[D.length-1])?D.slice(0,-1):D)})},s3=()=>S.filter(h=>h.length).some(h=>nr(h[h.length-1])),Wl=ht(!1);B(e,Wl,h=>n(388,An=h));const c3=()=>{_e(Wl,An=!0,An),vo().then(h=>{if(!h){_e(Wl,An=!1,An);return}let D;D=Su.subscribe(ce=>{ce===1&&(D&&D(),Ho("processImage"))})})},u3=$o.subscribe(h=>
89{if(!h){_e(Wl,An=!1,An);return}_e(Wl,An=!0,An);const{complete:D,abort:ce}=h;(D||ce)&&_e(Wl,An=!1,An)}),la=a8();B(e,la,h=>n(55,Qr=h));const f3=Ln([la],([h],D)=>{if(!h.length)return D();const{origin:ce,translation:Ce,rotation:lt,scale:dn}=h[0];D({origin:ce,translation:Ce,rotation:lt,scale:dn})}),Bf=ht();B(e,Bf,h=>n(402,ul=h));let zf=[],Vf;const qg=ht(),Uh=ht(),d3=Ln([lc,Uh,Sl,Dg],([h,D,ce,Ce])=>h||(D||ce<1?Ce:1)),Jg={...Vt,imageFile:Mn,imageSize:xt,mediaDuration:Wn,mediaMinDuration:Zi,mediaMaxDuration:Xi,mediaTrim:oo,imageBackgroundColor:xa,imageBackgroundImage:po,imageBackgroundFilterMode:Fa,imageCropAspectRatio:Ar,imageCropMinSize:er,imageCropMaxSize:yl,imageCropLimitToImage:Ni,imageCropRect:Gi,imageCropRectOrigin:ec,imageCropRectSnapshot:uu,imageCropRectAspectRatio:La,imageCropRange:Aa,imageRotation:Lr,imageRotationRange:Ss,imageFlipX:ws,imageFlipY:ra,imageOutputSize:tc,imageColorMatrix:pg,imageConvolutionMatrix:yg,imageGamma:Sg,imageVignette:wg,imageNoise:_g,imageManipulation:yf,imageDecoration:bf,imageAnnotation:pf,imageRedaction:Sf,imageFrame:_s,imagePreview:Ff,imagePreviewSource:gu,imageTransforms:Of,imagePreviewModifiers:zh,history:va,animation:Mf,pixelRatio:Wh,elasticityMultiplier:si,scrollElasticity:pm,rangeInputElasticity:I8,redrawTrigger:Yt,pointerAccuracy:Cf,pointerHoverable:Pf,env:pu,rootRect:ic,stageRect:il,stageRectBase:Ch,stageRecenter:Og,stageScalar:Sl,stagePadding:rc,stagePadded:ac,presentationScalar:xf,imagePreviewUpscale:Uh,utilRect:Ts,utilRectPadded:j4,allowPlayPause:Qs,allowPan:fh,allowZoom:dh,allowZoomControls:hh,enableZoomInput:mh,enablePanInput:_f,enablePanInputStatus:bh,imageSelectionMultiTouching:qg,rootBackgroundColor:nc,rootForegroundColor:kf,rootLineColor:lu,rootColorSecondary:Ag,imageOutlineOpacity:xh,utilTools:Bf,imageSelectionPan:Cs,imageSelectionZoom:lc,imageSelectionZoomCurrent:d3,imageSelectionStageFitScalar:Dg,imageSelectionStoredState:Bg,imageOverlayMarkup:hu,interfaceImages:vf,isInteracting:cu,isTransformingImage:Lg,isInteractingFraction:wh,imageCropRectIntent:Th,imageCropRectPresentation:xg,imageSelectionRect:aa,imageSelectionRectIntent:kh,imageSelectionRectPresentation:Lf,imageSelectionRectSnapshot:Ef,imageScalar:Ng,imageTransformsInterpolated:f3,imageEffects:Zg};delete Jg.image;const h3=`util-${Yr()}`;let Hh=[];const m3=(h,D,ce,Ce)=>{const lt=D.filter(([$t])=>h.includes($t)).filter(([$t,{isSupported:ti}])=>ti({...Ce,...ce[$t]})).map(([$t,ti])=>[$t,ti.Component]);return Rl(lt,Hh,($t,ti)=>$t[0]===ti[0]&&$t[1]===ti[1])?Hh:(Hh=lt,lt)},Qg=h=>ge.find(([D])=>h===D),g3=()=>ge[0][0];let yu=[];const Nh=h=>{n(62,yu=yu.concat(h))},Gh=h=>{n(62,yu=yu.filter(D=>D!==h))},jh=(h,D)=>{n(306,U[h]=D,U)},b3=(h,D)=>D[h],p3=h=>Fe.find(D=>D.id===h).view;let $g=ya();const y3=(h,D)=>{if(!K)return"landscape";if(D==="auto")return h.width>h.height?"landscape":"portrait";if(D==="horizontal")return h.width<500?"portrait":"landscape";if(D==="vertical")return h.height<400?"landscape":"portrait"},S3=h=>{const D=q.getPropertyValue(h);return mm(D)},e0=(h,D,ce)=>{let Ce=q.getPropertyValue(h);Ce=ce?ce(Ce):/^[0-9]+$/.test(Ce)?parseFloat(Ce):void 0,D.set(Ce,{hard:!Cn})},Ul=(h,D,ce=!1)=>{const Ce=S3(h);!Ce||Ce[3]===0||(ce||(Ce.length=3),D.set(Ce,{hard:!Cn}))},Zh=ht();B(e,Zh,h=>n(87,Ma=h));const Xh=ht();B(e,Xh,h=>n(88,Ra=h));const Kh=ht();B(e,Kh,h=>n(89,Rr=h));const Wf=hn(0,{damping:.9});B(e,Wf,h=>n(90,el=h));const t0=()=>{Ul("color",kf),Ul(gs?"--color-background":"background-color",nc),Ul("outline-color",lu),Ul("--color-primary",ph),Ul("--color-secondary",Ag),Ul("--grid-color-even",Xh,!0),Ul("--grid-color-odd",Kh,!0),e0("--grid-size",Zh),e0("--editor-inset-top",Sh,h=>parseInt(h,10))},w3=({target:h,propertyName:D})=>{h!==Di||!/background|outline/.test(D)||q&&t0()},n0=Ln([Of,Zg,xa,W4,Fa],([h,D,ce,Ce,lt])=>h&&{...h,...D,backgroundColor:ce,backgroundImage:Ce,backgroundFilterMode:lt||"none"});B(e,n0,h=>n(397,hr=h));const _3=()=>{const h=la.length?void 0:{resize:1.05},D=r8(xe,Ct,h);la.unshift(D),i0(hr)},i0=h=>{la.forEach((D,ce)=>{const Ce=ce===0?1:0;D.set({...h,opacity:Ce,resize:1},Ko)})};let Uf;const Su=ig(void 0,{duration:500});B(e,Su,h=>n(54,di=h));function T3(h,D){if(xn(D.labelSupportError))return D.labelSupportError(h);const ce=qc({features:h},D);return Jl(D.labelSupportError,ce,"{","}")}let Yh;function k3(h,D){const ce=h?!h.complete||h.error?h:{task:"blob-to-bitmap",progress:1/0}:void 0;let Ce=xn(D.statusLabelLoadImage)?D.statusLabelLoadImage(ce):Kc({state:ce},D);return h&&h.error&&h.error.metadata&&(Ce=Jl(Ce,h.error.metadata,"{","}")),Ce}function C3(h,D){return xn(D.statusLabelProcessImage)?D.statusLabelProcessImage(h):Yc({state:h},D)}const Hf=ht(!1);B(e,Hf,h=>n(392,dr=h));let Oa;const Nf=hn(void 0,{stiffness:.1,damping:.7,precision:.25});B(e,Nf,h=>n(82,$a=h));const Gf=hn(0,{stiffness:.1,precision:.05});B(e,Gf,h=>n(83,Pa=h));const wu=hn(0,{stiffness:.02,damping:.5,precision:.25});B(e,wu,h=>
89n(390,fi=h));const qh=hn(void 0,{stiffness:.02,damping:.5,precision:.25});B(e,qh,h=>n(391,eo=h));const jf=hn(void 0,{stiffness:.02,damping:.5,precision:.25});B(e,jf,h=>n(389,_i=h));let Zf;const P3=h=>{const D=!!(Oa&&Oa.closeButton)||!Cn;qh.set(h.detail.width,{hard:D}),jf.set(Math.round(-h.detail.width*.5),{hard:D})},M3=()=>{Ho("abortLoadImage")},R3=()=>{Ho("abortProcessImage"),_e(Wl,An=!1,An)},o0=h=>{h.target&&h.target.dataset.touchScroll==="true"||n4(h)||h.preventDefault()},I3=Xg?h=>{const D=h.touches?h.touches[0]:h;D.pageX>20&&D.pageX<window.innerWidth-20||o0(h)}:st,Ps=ht([]);B(e,Ps,h=>n(485,ni=h)),sr("keysPressed",Ps);const E3=h=>{const{keyCode:D,metaKey:ce,ctrlKey:Ce,shiftKey:lt}=h;if(D===9&&pt){h.preventDefault();return}if(h.target&&D===32&&Di.contains(h.target)&&!Ql(h.target)&&(Bn&&r&&O(),h.preventDefault()),D===90&&(ce||Ce)){lt&&ce?va.redo():va.undo();return}else if(D===89&&Ce){va.redo();return}if(D===229||h.target&&(D===8||D===46)&&!Di.contains(h.target)&&Ql(h.target))return;const dn=new Set([...ni,D]);Ps.set(Array.from(dn))},A3=({key:h,keyCode:D})=>{if(h==="Meta")return Ps.set([]);Ps.set(ni.filter(ce=>ce!==D))},L3=()=>{Ps.set([])},x3=h=>{Ql(h.target)||h.preventDefault()},F3=(h,D)=>!!(o8(h)&&/image/.test(D)||as(h)&&/video/.test(D)),Jh=h=>{!h||Rc(h)&&!F3(h,Gs)||!Rc(h)&&!/^http/.test(h)||Ho("loadImage",h)},v3=h=>{Wc&&Jh(h.detail.resources[0])},O3=h=>{h&&Jh(h)},D3=h=>{!Hc||h.target&&h.target.tagName==="BUTTON"||o4({accept:Gs}).then(O3)},B3=h=>{if(!Uc)return;const D=Xn((window.innerWidth-Math.abs(K.x))/K.width,0,1),ce=Xn((window.innerHeight-Math.abs(K.y))/K.height,0,1);D<.75&&ce<.75||Jh((h.clipboardData||window.clipboardData).files[0])};let Hl,r0,a0;const z3=(h,D,ce,Ce)=>{if(!D||!h||r0===D&&a0===h)return;a0=h,r0=D;const lt={dataSizeScalar:ce};Ce&&Ce[3]>0&&(lt.backgroundColor=[...Ce]),D(h,lt).then(dn=>{Hl&&Wi(Hl),dn.setAttribute("data-retain",!0),n(301,Hl=dn)})};let Qh=[],_u;const l0=ht();sr("rootPortal",l0),sr("rootRect",ic);const s0=()=>({foregroundColor:[...ai],lineColor:[...Ri],utilVisibility:{...U},isInteracting:Gn,isInteractingFraction:ri,rootRect:Rn(K),stageRect:Rn(et),manipulationShapesDirty:Qf,annotationShapesDirty:Kf,decorationShapesDirty:qf,frameShapesDirty:Jf}),c0=(h,D,ce)=>Ii(h,Ci(Math.round(D.width/ce),Math.round(D.height/ce))),u0=(h,D,ce)=>(h._translate=zw(D),h._scale=ce,h),Xf=h=>{const D=[];return h.forEach(ce=>D.push(V3(ce))),D.filter(Boolean)},V3=h=>Io(h)?(h.points=[re(h.x1,h.y1),re(h.x2,h.y2)],h):(s_(h)&&(!h.backgroundColor||h.backgroundColor[3]===0)&&(Bd(h)&&(h.width=5,h.height=h.lineHeight),h.strokeWidth=1,h.strokeColor=[1,1,1,.5],h.backgroundColor=[0,0,0,.1]),h);let $h=[],e1=[],t1=[],n1=[],i1=[],f0,d0={};const h0=(h,D,ce,Ce,lt,dn,$t)=>{const{manipulationShapesDirty:ti,annotationShapesDirty:Bi,decorationShapesDirty:Mo,frameShapesDirty:sa,selectionRect:Tr,scale:kr}=h,Da=f0!==kr,Nl=Da||!da(d0,Tr);Nl&&(f0=kr,d0=Tr),ti&&(t1=D.filter(id).map(yi).map(ro=>Ii(ro,Ct))),(Bi||ce!==Bt)&&($h=ce.filter(id).map(yi).sort((ro,Ms)=>ro.alwaysOnTop?1:Ms.alwaysOnTop?-1:0).map(ro=>Ii(ro,Ct))),(Da||Yf||Bi||ce!==Bt)&&(e1=Xf($h.map(ro=>y(ro,{flipX:Qt,flipY:cn,rotation:_n,scale:kr,context:jo(Ct)})).flat())),(Mo||Ce!==ot||Nl)&&(n1=Xf(Ce.filter(id).map(yi).sort((ro,Ms)=>ro.alwaysOnTop?1:Ms.alwaysOnTop?-1:0).map(ro=>c0(ro,Tr,kr)).map(ro=>y(ro,{context:Tr})).flat().map(ro=>u0(ro,Tr,kr)))),(sa||dn!==ct||Nl)&&(i1=dn?Xf([dn].map(yi).map(ro=>c0(ro,Tr,kr)).map(y).flat().map(ro=>u0(ro,Tr,kr))):[]);let r1=Xf(lt.filter(id));return{manipulationShapesDirty:ti,manipulationShapes:t1,annotationShapesDirty:Bi,annotationShapes:e1,decorationShapesDirty:Mo,decorationShapes:n1,frameShapesDirty:sa,frameShapes:i1,interfaceShapes:r1,selectionShapes:$t.map(yi).map(ro=>Ii(ro,Ct))}};let Kf=!0;const W3=()=>n(63,Kf=!0);let Yf=!0;const U3=()=>n(64,Yf=!0);let qf=!0;const H3=()=>n(65,qf=!0);let Jf=!0;const N3=()=>n(66,Jf=!0);let Qf=!0;const G3=()=>n(67,Qf=!0);Jr(()=>{b(),xe&&Nt(xe.src)&&/^blob:/.test(xe.src)&&URL.revokeObjectURL(xe.src),U4(),Y4(),K4(),q4(),J4(),Q4(),e3(),o3(),u3(),Cf.destroy(),Pf.destroy(),Wt.destroy(),la.clear(),$h.length=0,e1.length=0,t1.length=0,n1.length=0,i1.length=0,Hl&&Wi(Hl),Ys&&window.visualVie
89wport.removeEventListener("resize",bs);try{n(235,bu=void 0),n(298,Uf=void 0)}catch{}});const j3=h=>{J&&da(h.detail,J)||_e(Ts,J=h.detail,J)};let o1;function Z3(){n(31,Df=Fs.innerWidth),n(32,Vh=Fs.innerHeight)}const X3=h=>_e(su,qo=h.detail,qo),K3=({detail:h})=>n(43,X=h);function Y3(h,D){e.$$.not_equal(wr[D],h)&&(wr[D]=h,n(1,wr),n(283,zl),n(27,nl))}const q3=h=>Nh(h),J3=h=>Gh(h),Q3=(h,{detail:D})=>jh(h,D),$3=h=>_e(oc,ho=h.detail,ho);function ew(h){e.$$.not_equal(wr[X],h)&&(wr[X]=h,n(1,wr),n(283,zl),n(27,nl))}const tw=()=>Nh(X),nw=()=>Gh(X),iw=({detail:h})=>jh(X,h),ow=h=>{const D={...h,...s0()},{annotationShapes:ce,decorationShapes:Ce,interfaceShapes:lt,frameShapes:dn,selectionShapes:$t}=Er({annotationShapes:Bt,decorationShapes:ot,interfaceShapes:tl,frameShapes:ct,selectionShapes:yr},D);return h0(D,Xt,ce,Ce,lt,dn,$t)},rw=()=>{n(63,Kf=!1),n(64,Yf=!1),n(65,qf=!1),n(66,Jf=!1),n(67,Qf=!1)};function aw(h){vn[h?"unshift":"push"](()=>{_u=h,n(36,_u)})}function lw(h){pl=h,n(0,pl),n(271,fs)}function sw(h){zf=h,n(33,zf)}function cw(h){Vf=h,n(34,Vf)}function uw(h){vn[h?"unshift":"push"](()=>{qs=h,n(61,qs)})}function fw(h){vn[h?"unshift":"push"](()=>{Di=h,n(2,Di)})}const dw=h=>_e(yh,qn=h.detail,qn);return e.$$set=h=>{"class"in h&&n(236,x=h.class),"layout"in h&&n(237,we=h.layout),"stores"in h&&n(238,Vt=h.stores),"locale"in h&&n(3,rt=h.locale),"id"in h&&n(4,Dt=h.id),"util"in h&&n(239,Gt=h.util),"utils"in h&&n(240,E=h.utils),"animations"in h&&n(241,Ue=h.animations),"disabled"in h&&n(242,pt=h.disabled),"previewUpscale"in h&&n(243,Tn=h.previewUpscale),"previewPad"in h&&n(244,Pn=h.previewPad),"previewMaskOpacity"in h&&n(5,jn=h.previewMaskOpacity),"previewImageDataMaxSize"in h&&n(245,Zn=h.previewImageDataMaxSize),"previewImageTextPixelRatio"in h&&n(6,gi=h.previewImageTextPixelRatio),"markupMaskOpacity"in h&&n(7,Ti=h.markupMaskOpacity),"zoomMaskOpacity"in h&&n(246,ki=h.zoomMaskOpacity),"elasticityMultiplier"in h&&n(8,si=h.elasticityMultiplier),"willRevert"in h&&n(247,No=h.willRevert),"willProcessImage"in h&&n(248,vo=h.willProcessImage),"willRenderCanvas"in h&&n(9,Er=h.willRenderCanvas),"willRenderToolbar"in h&&n(249,Po=h.willRenderToolbar),"willRenderUtilTabs"in h&&n(250,Qo=h.willRenderUtilTabs),"willSetHistoryInitialState"in h&&n(251,us=h.willSetHistoryInitialState),"enableButtonExport"in h&&n(252,Oc=h.enableButtonExport),"enableButtonRevert"in h&&n(253,Dc=h.enableButtonRevert),"enableNavigateHistory"in h&&n(254,Bc=h.enableNavigateHistory),"enableToolbar"in h&&n(10,Ns=h.enableToolbar),"enableUtils"in h&&n(255,zc=h.enableUtils),"enableButtonClose"in h&&n(256,Vc=h.enableButtonClose),"enableDropImage"in h&&n(257,Wc=h.enableDropImage),"enablePasteImage"in h&&n(258,Uc=h.enablePasteImage),"enableBrowseImage"in h&&n(259,Hc=h.enableBrowseImage),"accept"in h&&n(260,Gs=h.accept),"enableTransparencyGrid"in h&&n(11,ef=h.enableTransparencyGrid),"layoutDirectionPreference"in h&&n(261,Nc=h.layoutDirectionPreference),"layoutHorizontalUtilsPreference"in h&&n(262,Gc=h.layoutHorizontalUtilsPreference),"layoutVerticalUtilsPreference"in h&&n(263,jc=h.layoutVerticalUtilsPreference),"layoutVerticalToolbarPreference"in h&&n(264,qi=h.layoutVerticalToolbarPreference),"layoutVerticalControlGroupsPreference"in h&&n(265,Zc=h.layoutVerticalControlGroupsPreference),"layoutVerticalControlTabsPreference"in h&&n(266,Xc=h.layoutVerticalControlTabsPreference),"supportedMediaTypes"in h&&n(267,tf=h.supportedMediaTypes),"status"in h&&n(234,jr=h.status),"formatStatusImageLoading"in h&&n(268,Kc=h.formatStatusImageLoading),"formatStatusImageProcessing"in h&&n(269,Yc=h.formatStatusImageProcessing),"formatStatusSupportError"in h&&n(270,qc=h.formatStatusSupportError),"textDirection"in h&&n(12,nf=h.textDirection),"markupEditorZoomLevel"in h&&n(271,fs=h.markupEditorZoomLevel),"markupEditorZoomLevels"in h&&n(13,of=h.markupEditorZoomLevels),"markupEditorZoomAdjustStep"in h&&n(14,rf=h.markupEditorZoomAdjustStep),"markupEditorZoomAdjustFactor"in h&&n(15,js=h.markupEditorZoomAdjustFactor),"markupEditorZoomAdjustWheelFactor"in h&&n(16,af=h.markupEditorZoomAdjustWheelFactor),"markupEditorInteractionMode"in h&&n(272,bl=h.markupEditorInteractionMode),"muteAudio"in h&&n(273,ds=h.muteAudio),"willSetMediaInitialTimeOffset"in h&&n(274,hs=h.willSetMediaInitialTimeOffset),"enablePan"in h&&n(17,Zs=h.enablePan),"enableZoom"in h&&n(18,Dl=h.enableZoom),"enableZoomControls"in h&&n(275,Jc=h.enableZoomControls),"enableZoomInput"in h&&n(19,lf=h.enableZoomInput),"enablePanInput"in h&&n(276,ms=h.enablePanInput),"enableCanvasAlpha"in h&&n(20,gs=h.enableCanvasAlpha),"enablePanLimit"in h&&n(21,Qc=h.enablePanLimit),"panLimitGutterScalar"in h&&n(22,sf=h.panLimitGutterScalar),"pan"in h&&n(277,Xs=h.pan),"zoomPresetOptions"in h&&n(23,cf=h.zoomPresetOptions),"zoomAdjustStep"in h&&n(24,$c=h.zoomAdjustStep),"zoomAdjustFactor"in h&&n(25,uf=h.zoomAdjustFactor),"zoomAdjustWheelFactor"in h&&n(26,ff=h.zoomAdjustWheelFactor),"zoomLevel"in h&&n(0,pl=h.zoomLevel),"fixScrollDirection"in h&&n(278,Ks=h.fixScrollDirection),"imagePreviewSrc"in h&&n(281,Bl=h.imagePreviewSrc),"imageOrienter"in h&&n(282,Js=h.imageOrienter),"pluginComponents"in h&&n(283,zl=h.pluginComponents),"pluginOptions"in h&&n(27,nl=h.pluginOptions),"root"in h&&n(2,Di=h.root),"imageSourceToImageData"in h&&n(28,kt=h.imageSourceToImageData),"imagePreviewCurrent"in h&&n(235,bu=h.imagePreviewCurrent)},e.$$.update=()=>{if(e.$$.dirty[8]&1073741824&&eu.set(Ks),e.$$.dirty[0]&8&&n(304,i=!!rt),e.$$.dirty[0]&1|e.$$.dirty[8]&8388608&&n(0,pl=pl===null?fs:pl),e.$$.dirty[0]&2|e.$$.dirty[9]&16){let h=!1;zl.forEach(([D])=>{wr[D]||(n(1,wr[D]={},wr),h=!0)}),h&&n(295,at=[...zl])}if(e.$$.dirty[7]&8388608|e.$$.dirty[9]&33619968&&n(356,pe=i&&at.length?E||at.map(([h])=>h):[]),e.$$.dirty[0]&134217728|e.$$.dirty[9]&65536|e.$$.dirty[11]&32768|e.$$.dirty[13]&1&&n(357,ge=m3(pe,at,nl,{src:Ki})),e.$$.dirty[11]&65536&&n(310,de=ge.length),e.$$.dirty[0]&8|e.$$.dirty[10]&1|e.$$.dirty[11]&32768&&n(355,Fe=de&&pe.map(h=>{const D=Qg(h);if(!D)return;const ce=rt[`${h}Label`],Ce=rt[`${h}Title`];return{id:h,view:D[1],tabIcon:rt[`${h}Icon`],tabLabel:ce,tabTitle:Nt(Ce)?Ce:ce}}
89).filter(Boolean)||[]),e.$$.dirty[11]&16384&&n(374,o=!!Fe.find(h=>h.id==="trim")),e.$$.dirty[12]&20|e.$$.dirty[13]&16777216&&n(309,r=!!(To&&xe&&o)),e.$$.dirty[7]&4194304|e.$$.dirty[10]&1&&n(43,X=de&&Gt&&typeof Gt=="string"&&Qg(Gt)?Gt:de>0?g3():void 0),e.$$.dirty[1]&4096|e.$$.dirty[9]&1073741824&&r&&X&&b(),e.$$.dirty[9]&1073741824|e.$$.dirty[12]&16&&(r?(xe.addEventListener("play",$s),xe.addEventListener("pause",$s)):xe&&xe.nodeName==="video"&&(xe.removeEventListener("play",$s),xe.removeEventListener("pause",$s))),e.$$.dirty[9]&1073741824&&r&&sh(),e.$$.dirty[13]&75497472&&ch(ko||ei),e.$$.dirty[13]&8388608&&n(372,a=ei&&un(ei,6)),e.$$.dirty[13]&153092096&&n(370,l=Gr||[[0,Math.min(To,Co)/To]]),e.$$.dirty[11]&536870912&&(s=l[0][0]),e.$$.dirty[11]&536870912&&(c=l[l.length-1][1]),e.$$.dirty[11]&536870912&&n(373,u=l.map(([h,D])=>[un(h,6),un(D,6)])),e.$$.dirty[12]&3&&n(371,f=u.findIndex(([h,D])=>a>=h&&a<=D)),e.$$.dirty[11]&1073741824|e.$$.dirty[12]&3&&(d=f===-1&&u.findIndex((h,D,ce)=>{const Ce=ce[D-1];return Ce?a<=h[0]&&a>=Ce[1]:a<=h[0]})),e.$$.dirty[8]&33554432&&Be.set(ds),e.$$.dirty[12]&16|e.$$.dirty[13]&33554432&&(xe&&zt?ne():oe()),e.$$.dirty[9]&1073741824|e.$$.dirty[13]&8388608&&r&&Jn.set(ze()*ei),e.$$.dirty[12]&16|e.$$.dirty[13]&4194304&&xe&&Kt(lr),e.$$.dirty[0]&256&&_e(bn,Ca=si,Ca),e.$$.dirty[7]&1048576&&n(366,m=we==="overlay"),e.$$.dirty[8]&128|e.$$.dirty[11]&33554432&&n(45,g=zc&&!m),e.$$.dirty[0]&134217730&&nl&&Object.entries(nl).forEach(([h,D])=>{Object.entries(D).forEach(([ce,Ce])=>{wr[h]&&n(1,wr[h][ce]=Ce,wr)})}),e.$$.dirty[13]&65536&&n(367,P=!Oi),e.$$.dirty[7]&16777216|e.$$.dirty[11]&201326592&&_e(Rf,Cn=Ue==="always"?w:Ue==="never"?!1:w&&P,Cn),e.$$.dirty[1]&4194304|e.$$.dirty[7]&33554432&&oi.set(pt?1:0,{hard:!Cn}),e.$$.dirty[7]&268435456&&(p=Zn?Kw(Zn,It):It),e.$$.dirty[13]&1048576&&Wt.update(Qa[0]),e.$$.dirty[13]&524288&&(y=Nr?(h,D)=>Nr(h,{flipX:void 0,flipY:void 0,rotation:void 0,...D,isPreview:!0}):Nn),e.$$.dirty[1]&268435456&&Array.isArray(yr)&&Ho("selectionchange",[...yr]),e.$$.dirty[8]&134217728|e.$$.dirty[13]&262144&&gh.set(ia&&Jc),e.$$.dirty[8]&285212672&&Tf.set(bl==="pan"?!0:ms),e.$$.dirty[1]&1048576&&qn&&ic.set(Li(qn.x,qn.y,qn.width,qn.height)),e.$$.dirty[11]&33554432|e.$$.dirty[12]&8388616&&K&&m&&hi&&hi.complete&&G4(),e.$$.dirty[11]&32768&&n(46,Se=pe.length>1),e.$$.dirty[1]&32768&&(Se||oc.set(ql())),e.$$.dirty[0]&1024|e.$$.dirty[13]&131072&&(Ns||su.set(Li(0,_o,0,0))),e.$$.dirty[11]&134217728|e.$$.dirty[12]&512&&n(369,_=!Gn&&w),e.$$.dirty[1]&1048576&&n(311,j=qn&&qn.width>0&&qn.height>0),e.$$.dirty[0]&8|e.$$.dirty[10]&3&&n(40,Le=j&&rt&&!!de),e.$$.dirty[1]&512&&setTimeout(()=>n(296,_h=Le),1),e.$$.dirty[7]&16777216|e.$$.dirty[9]&131072|e.$$.dirty[11]&335544320&&_e(Mf,Ko=Ue==="always"?_:Ue==="never"?!1:_&&_h&&P,Ko),e.$$.dirty[7]&67108864|e.$$.dirty[11]&33554432&&If.set(Tn||m),e.$$.dirty[7]&134217728&&Af.set(Pn),e.$$.dirty[8]&536870912&&Xs&&Cs.set(Xs),e.$$.dirty[0]&4|e.$$.dirty[13]&36864&&Di&&(Di.dispatchEvent(Zl("markupzoom",pr)),Di.dispatchEvent(Zl("zoom",Ht(pr)?pr:gr))),e.$$.dirty[0]&4|e.$$.dirty[13]&16384&&Di&&(Di.dispatchEvent(Zl("markuppan",br)),Di.dispatchEvent(Zl("pan",br))),e.$$.dirty[13]&2048&&go&&zg(),e.$$.dirty[13]&8192&&ta&&Ih(),e.$$.dirty[1]&4198400&&X&&xh.set(.075,{hard:!Cn}),e.$$.dirty[7]&536870912&&n(364,C=ki),e.$$.dirty[13]&1536&&n(365,R=Hr?-Math.max(...Object.values(Yo)):0),e.$$.dirty[1]&138936320|e.$$.dirty[11]&25165824&&no){let h=no.x-et.x,D=et.x+et.width-(no.x+no.width),ce=no.y-et.y,Ce=et.y+et.height-(no.y+no.height),lt=Math.min(h,ce,D,Ce);Fh.set(lt>R?0:Math.min(C,Math.abs(lt/N1)),{hard:!Cn})}if(e.$$.dirty[1]&67108864&&n(363,I=.55/Ur),e.$$.dirty[1]&4718592|e.$$.dirty[11]&4194304&&et&&vh.set({x:0,y:et.y,width:et.x<N1?0:et.x,height:et.height+I},{hard:!Cn}),e.$$.dirty[1]&4718592|e.$$.dirty[11]&4194304|e.$$.dirty[12]&8&&et&&Oh.set({x:0,y:0,width:K.width,height:et.y+I},{hard:!Cn}),e.$$.dirty[1]&4718592|e.$$.dirty[11]&4194304|e.$$.dirty[12]&8&&et){let h=et.x+et.width,D=K.width-(et.x+et.width);D<N1&&(h+=D,D=0),Dh.set({x:h,y:et.y,width:D,height:et.height+I},{hard:!Cn})}if(e.$$.dirty[1]&4718592|e.$$.dirty[12]&8&&et&&Bh.set({x:0,y:et.y+et.height,width:K.width,height:K.height-(et.y+et.height)},{hard:!Cn}),e.$$.dirty[1]&33554432|e.$$.dirty[13]&288&&n(359,M=Ai&&{id:Iu,backgroundColor:ar,opacity:Vo,...Ai}),e.$$.dirty[1]&33554432|e.$$.dirty[13]&160&&n(362,T=$r&&{id:Iu,backgroundColor:ar,opacity:Vo,...$r}),e.$$.dirty[1]&33554432|e.$$.dirty[13]&96&&n(361,v=to&&{id:Iu,backgroundColor:ar,opacity:Vo,...to}),e.$$.dirty[1]&33554432|e.$$.dirty[13]&48&&n(360,H=Ui&&{id:Iu,backgroundColor:ar,opacity:Vo,...Ui}
89),e.$$.dirty[11]&3932160&&n(358,Y=[T,v,H,M].filter(Boolean)),e.$$.dirty[11]&131072|e.$$.dirty[13]&8&&Y&&zn&&hu.update(h=>[...h.filter(D=>D.id!==Iu),...Y]),e.$$.dirty[9]&4|e.$$.dirty[13]&1&&gu.set(Bl||Ki||void 0),e.$$.dirty[0]&4|e.$$.dirty[7]&262144|e.$$.dirty[12]&16&&(n(235,bu=xe),xe&&Di.dispatchEvent(Zl("loadpreview",bu))),e.$$.dirty[12]&16777216&&wa&&i3(),e.$$.dirty[13]&4&&n(315,W=Ei.index>0),e.$$.dirty[13]&4&&n(314,$=Ei.index<Ei.length-1),e.$$.dirty[1]&393216|e.$$.dirty[12]&3072&&(S=[Bt,ot,Yn,ui]),e.$$.dirty[1]&8&&qg.set(Vf),e.$$.dirty[13]&2&&Uh.set(wo),e.$$.dirty[1]&4096&&H4.set(X),e.$$.dirty[1]&4096|e.$$.dirty[9]&134217728|e.$$.dirty[11]&16384&&n(306,U=Fe.reduce((h,D)=>{const ce=U&&U[D.id];return ce!==void 0?h[D.id]=ce:h[D.id]=D.id===X?1:0,h},{})),e.$$.dirty[1]&4096&&n(79,ae={name:h3,selected:X}),e.$$.dirty[11]&16384&&n(337,be=Fe.map(h=>({id:h.id,icon:h.tabIcon,label:h.tabLabel,title:h.tabTitle}))),e.$$.dirty[11]&16384&&n(78,ft=Fe.map(h=>h.id)),e.$$.dirty[7]&524288&&n(77,De=pn(["PinturaRoot","PinturaRootComponent",x])),e.$$.dirty[12]&8&&n(351,Mt=K&&(K.width>1e3?"wide":K.width<600?"narrow":void 0)),e.$$.dirty[12]&8&&n(338,gt=K&&(K.width<=320||K.height<=460)),e.$$.dirty[12]&8&&n(350,ie=K&&(K.height>1e3?"tall":K.height<600?"short":void 0)),e.$$.dirty[0]&4&&n(317,N=Di&&Di.parentNode&&Di.parentNode.classList.contains("PinturaModal")),e.$$.dirty[1]&1|e.$$.dirty[10]&128|e.$$.dirty[12]&8&&n(343,le=N&&K&&Df>K.width),e.$$.dirty[1]&2|e.$$.dirty[10]&128|e.$$.dirty[12]&8&&n(342,Te=N&&K&&Vh>K.height),e.$$.dirty[11]&6&&n(344,me=le&&Te),e.$$.dirty[0]&1048576&&n(341,Me=gs),e.$$.dirty[11]&1024&&n(312,qe=Mt==="narrow"),e.$$.dirty[8]&8192|e.$$.dirty[12]&8&&n(352,Ne=y3(K,Nc)),e.$$.dirty[11]&2048&&n(76,mt=Ne==="landscape"),e.$$.dirty[10]&4|e.$$.dirty[11]&512&&n(340,ue=qe||ie==="short"),e.$$.dirty[1]&1|e.$$.dirty[12]&8&&n(339,He=$g&&K&&Df===K.width&&!Xg),e.$$.dirty[1]&4|e.$$.dirty[12]&1073741824&&n(313,Qe=[...ul||[],...zf].filter(Boolean)),e.$$.dirty[8]&16384&&n(349,G=`has-navigation-preference-${Gc}`),e.$$.dirty[8]&32768&&n(348,je=`has-navigation-preference-${jc}`),e.$$.dirty[8]&65536&&n(345,ye=`has-toolbar-preference-${qi}`),e.$$.dirty[8]&131072&&n(347,$e=`has-controlgroups-preference-${Zc}`),e.$$.dirty[8]&262144&&n(346,St=`has-controltabs-preference-${Xc}`),e.$$.dirty[12]&8&&n(354,Je=K!==void 0&&K.width>0&&K.height>0),e.$$.dirty[0]&4|e.$$.dirty[11]&8192&&n(353,q=Je&&Di&&getComputedStyle(Di)),e.$$.dirty[11]&4096&&q&&t0(),e.$$.dirty[0]&1024|e.$$.dirty[1]&4243456|e.$$.dirty[7]&34603008|e.$$.dirty[10]&1879048320|e.$$.dirty[11]&4095|e.$$.dirty[12]&805339136&&pu.set({...ii,layoutMode:we,orientation:Ne,horizontalSpace:Mt,verticalSpace:ie,navigationHorizontalPreference:G,navigationVerticalPreference:je,controlGroupsVerticalPreference:$e,controlTabsVerticalpreference:St,toolbarVerticalPreference:ye,isModal:N,isDisabled:pt,isCentered:me,isCenteredHorizontally:le,isCenteredVertically:Te,isAnimated:Cn,isTransparent:Me,pointerAccuracy:Wr,pointerHoverable:Pr,isCompact:ue,hasSwipeNavigation:He,hasLimitedSpace:gt,hasToolbar:Ns,hasNavigation:Se&&g,isIOS:$g,browserVersion:ng()?`chrome-${(navigator.userAgent.match(/Chrome\/([0-9]+)/)||[])[1]}`:void 0}),e.$$.dirty[12]&32768&&n(75,Ie=Object.entries(ii).map(([h,D])=>/^is|has/.test(h)?D?i4(h):void 0:D).filter(Boolean).join(" ")),e.$$.dirty[1]&4096&&X&&Bf.set([]),e.$$.dirty[1]&4096|e.$$.dirty[8]&4|e.$$.dirty[10]&134217728|e.$$.dirty[12]&32768&&n(44,se=Qo(be.map(h=>({...h,selected:X===h.id})),{...ii},()=>Yt.set({}))),e.$$.dirty[1]&8192&&n(74,V=!!se.find(h=>Array.isArray(h))),e.$$.dirty[12]&201326592&&n(73,dt=Vr&&Object.entries(zr).filter(([,h])=>h!=null).reduce((h,[,D])=>(h={...h,...D},h),{})),e.$$.dirty[12]&8388608&&n(334,nt=hi&&hi.task==="any-to-file"),e.$$.dirty[10]&16777216&&nt&&la&&la.clear(),e.$$.dirty[12]&33554432&&n(336,Ft=!!hr&&!!hr.translation),e.$$.dirty[9]&524288|e.$$.dirty[10]&67108864|e.$$.dirty[12]&16&&Ft&&xe&&xe!==Uf&&(n(298,Uf=xe),_3()),e.$$.dirty[10]&67108864|e.$$.dirty[12]&33554432&&Ft&&i0(hr),e.$$.dirty[1]&16777216&&Qr&&Qr.length>1){let h=[];la.forEach((D,ce)=>{ce!==0&&D.get().opacity<=0&&h.push(D)}),h.forEach(D=>la.remove(D))}if(e.$$.dirty[0]&8|e.$$.dirty[10]&33554432&&n(39,Xe=rt&&We.length&&T3(We,rt)),e.$$.dirty[12]&8388608&&n(326,wt=hi&&!!hi.error),e.$$.dirty[12]&8388608&&n(42,Zt=!hi||!hi.complete&&hi.task===void 0),e.$$.dirty[12]&8388608&&n(327,yt=hi&&(hi.taskLengthComputable?hi.taskProgress:1/0)),e.$$.dirty[10]&16777216&&nt&&_e(mu,So=!1,So),e.$$.dirty[1]&4194304|e.$$.dirty[9]&1048576|e.$$.dirty[12]&8388608&&hi&&hi.complete){const h=Cn?250:0;clearTimeout(Yh),n(299,Yh=setTimeout(()=>
89{_e(mu,So=!0,So)},h))}if(e.$$.dirty[1]&2048|e.$$.dirty[10]&65536|e.$$.dirty[12]&10485760&&n(331,nn=hi&&!wt&&!Zt&&!So),e.$$.dirty[9]&262144|e.$$.dirty[12]&16777232&&n(330,Jt=!!wa&&(!xe||!!Vl)),e.$$.dirty[1]&4194304|e.$$.dirty[12]&2097152&&(So?setTimeout(()=>Wf.set(1,{hard:!Cn}),Cn?500:0):Wf.set(0,{hard:!Cn})),e.$$.dirty[12]&4259840&&n(325,yn=!!(An||li&&li.progress!==void 0&&!li.complete)),e.$$.dirty[10]&32768&&yn&&b(),e.$$.dirty[1]&2048|e.$$.dirty[12]&8388608&&n(328,an=hi&&!(hi.error||Zt)),e.$$.dirty[0]&8|e.$$.dirty[12]&8388608&&n(329,Tt=rt&&k3(hi,rt)),e.$$.dirty[0]&8|e.$$.dirty[12]&4194304&&n(324,Sn=li&&rt&&C3(li,rt)),e.$$.dirty[12]&4194304&&n(322,ln=li&&(li.taskLengthComputable?li.taskProgress:1/0)),e.$$.dirty[12]&4194304&&n(323,sn=li&&!li.error),e.$$.dirty[12]&4194304&&n(321,ke=!!(li&&li.error)),e.$$.dirty[0]&8|e.$$.dirty[1]&2048|e.$$.dirty[7]&131072|e.$$.dirty[10]&4192256)if(jr){let h,D,ce,Ce,lt;Nt(jr)&&(h=jr),Ht(jr)?D=jr:Array.isArray(jr)&&([h,D,lt]=jr,D===!1&&(Ce=!0),Ht(D)&&(ce=!0)),n(35,Oa=(h||D)&&{text:h,aside:Ce||ce,progressIndicator:{visible:ce,progress:D},closeButton:Ce&&{label:rt.statusLabelButtonClose,icon:rt.statusIconButtonClose,onclick:lt||(()=>n(234,jr=void 0))}})}else rt&&Zt||wt||nn||Jt?n(35,Oa={text:Tt,aside:wt||an,progressIndicator:{visible:an,progress:yt},closeButton:wt&&{label:rt.statusLabelButtonClose,icon:rt.statusIconButtonClose,onclick:M3}}):rt&&yn&&Sn?n(35,Oa={text:Sn,aside:ke||sn,progressIndicator:{visible:sn,progress:ln},closeButton:ke&&{label:rt.statusLabelButtonClose,icon:rt.statusIconButtonClose,onclick:R3}}):n(35,Oa=void 0);if(e.$$.dirty[7]&131072&&n(333,Re=jr!==void 0),e.$$.dirty[1]&4194304|e.$$.dirty[10]&128|e.$$.dirty[12]&4194304&&N&&li&&li.complete&&(Hf.set(!0),setTimeout(()=>Hf.set(!1),Cn?100:0)),e.$$.dirty[0]&4|e.$$.dirty[1]&4096|e.$$.dirty[12]&2097152&&So&&Di&&Di.dispatchEvent(Zl("selectutil",X)),e.$$.dirty[1]&2304|e.$$.dirty[10]&11632640|e.$$.dirty[12]&1048576&&n(332,Lt=dr||Xe||Zt||wt||nn||Jt||yn||Re),e.$$.dirty[10]&4194304&&_e(Su,di=Lt?1:0,di),e.$$.dirty[1]&4194304|e.$$.dirty[10]&4194304&&Su.set(Lt?1:0,{duration:Cn?500:1}),e.$$.dirty[1]&8388608&&n(41,fn=di>0),e.$$.dirty[1]&16&&n(320,on=!!(Oa&&Oa.aside)),e.$$.dirty[1]&4195344|e.$$.dirty[9]&2097152|e.$$.dirty[10]&1024|e.$$.dirty[12]&524288&&fn&&Oa){clearTimeout(Zf);const h={hard:Cn===!1};if(on){const D=!!Oa.error||!Cn;Gf.set(1,h),Nf.set(eo,{hard:D}),n(300,Zf=setTimeout(()=>{wu.set(16,h)},1))}else Gf.set(0,h),n(300,Zf=setTimeout(()=>{wu.set(0,h)},1))}if(e.$$.dirty[1]&1024&&(fn||(jf.set(void 0,{hard:!0}),Nf.set(void 0,{hard:!0}),wu.set(0,{hard:!0}))),e.$$.dirty[12]&262144&&n(319,En=fi*.5),e.$$.dirty[10]&512|e.$$.dirty[12]&131072&&n(72,bt=`translateX(${_i-En}px)`),e.$$.dirty[1]&256|e.$$.dirty[12]&48&&n(38,tn=xe&&Ct&&!Xe),e.$$.dirty[1]&128|e.$$.dirty[10]&384&&n(316,Hn=Un&&(tn||N)?o0:st),e.$$.dirty[10]&64&&n(71,$n=Hn),e.$$.dirty[10]&64&&n(70,Q=Hn),e.$$.dirty[0]&8|e.$$.dirty[1]&2097152|e.$$.dirty[8]&370|e.$$.dirty[10]&60|e.$$.dirty[12]&32768&&n(69,Ge=rt&&pi&&Zu(()=>Po([["div","alpha",{class:"PinturaNavGroup"},[["div","alpha-set",{class:"PinturaNavSet"},[Vc&&["Button","close",{label:rt.labelClose,icon:rt.iconButtonClose,onclick:()=>Ho("close"),hideLabel:!0}],Dc&&["Button","revert",{label:rt.labelButtonRevert,icon:rt.iconButtonRevert,disabled:!W,onclick:r3,hideLabel:!0}]]]]],["div","beta",{class:"PinturaNavGroup PinturaNavGroupFloat"},[Bc&&["div","history",{class:"PinturaNavSet"},[["Button","undo",{label:rt.labelButtonUndo,icon:rt.iconButtonUndo,disabled:!W,onclick:va.undo,hideLabel:!0}],["Button","redo",{label:rt.labelButtonRedo,icon:rt.iconButtonRedo,disabled:!$,onclick:va.redo,hideLabel:!0}]]],Qe.length&&["div","plugin-tools",{class:"PinturaNavSet"},Qe.filter(Boolean).map(([h,D,ce])=>[h,D,{...ce}])]]],["div","gamma",{class:"PinturaNavGroup"},[Oc&&["Button","export",{label:rt.labelButtonExport,icon:qe&&rt.iconButtonExport,class:"PinturaButtonExport",onclick:c3,hideLabel:qe}]]]],{...ii},()=>Yt.set({})))),e.$$.dirty[12]&2048&&n(308,tt=Yn&&!!Yn.length),e.$$.dirty[9]&536870912|e.$$.dirty[12]&2080&&n(307,en=tt&&tS(Ct,Yn)),e.$$.dirty[9]&805306368|e.$$.dirty[12]&24592&&tt&&z3(xe,Vn,en,Dn),e.$$.dirty[9]&4194304|e.$$.dirty[12]&6176&&Yn&&Hl&&Ct){const{width:h,height:D}=Ct,ce=Za()?"pixelated":_t==="auto"?"auto":"pixelated";n(302,Qh=Yn.map(Ce=>{const lt=Li(Ce.x,Ce.y,Ce.width,Ce.height),$t=Ro(Rn(lt),Ce.rotation).map(ti=>
89re(ti.x/h,ti.y/D));return{...Ce,id:"redaction",flipX:!1,flipY:!1,cornerRadius:0,strokeWidth:0,strokeColor:void 0,backgroundColor:[0,0,0,0],backgroundImage:Hl,backgroundImageRendering:ce,backgroundCorners:$t}}))}e.$$.dirty[9]&8388608|e.$$.dirty[12]&1024&&n(37,Xt=[...Qh,...ui||[]]),e.$$.dirty[1]&32&&_u&&l0.set(_u),e.$$.dirty[0]&4|e.$$.dirty[1]&128&&tn&&Di&&Di.dispatchEvent(Zl("ready")),e.$$.dirty[1]&262144&&W3(),e.$$.dirty[12]&480&&U3(),e.$$.dirty[1]&131072&&H3(),e.$$.dirty[1]&65536&&N3(),e.$$.dirty[1]&64&&G3(),e.$$.dirty[12]&8&&n(305,Fn=K?K.height>0:!1),e.$$.dirty[9]&117440512&&!i&&Fn&&(clearTimeout(o1),n(303,o1=setTimeout(()=>{i||TS("locale")},32)))},n(368,w=!og()),Z=Fu()===1?h=>{h&&(Or(h.origin,Math.round),Or(h.translation,Math.round))}:Nn,n(335,We=[!i8()&&"WebGL"].filter(Boolean)),n(318,Un=ya()||Xd()&&ja()),n(68,Ze=QP(Jo.pub)),[pl,wr,Di,rt,Dt,jn,gi,Ti,si,Er,Ns,ef,nf,of,rf,js,af,Zs,Dl,lf,gs,Qc,sf,cf,$c,uf,ff,nl,kt,Ff,va,Df,Vh,zf,Vf,Oa,_u,Xt,tn,Xe,Le,fn,Zt,X,se,g,Se,ct,ot,Bt,et,qn,pi,Cn,di,Qr,ar,Ur,no,yr,ps,qs,yu,Kf,Yf,qf,Jf,Qf,Ze,Ge,Q,$n,bt,dt,V,Ie,mt,De,ft,ae,ho,Uo,$a,Pa,qo,mi,Mr,Ma,Ra,Rr,el,Ir,Fl,vl,tl,hl,Sr,ml,oa,Ol,gl,Ia,Ea,Qs,_r,Zr,Be,Yt,bn,oi,Mn,xt,Wn,Jn,oo,bo,Xi,Ji,$o,Ar,Ni,Gi,Lr,ws,ra,xa,bf,pf,yf,Sf,_s,uh,wf,kg,Cg,Pg,Mg,Rg,Ig,Eg,fh,dh,hh,_f,mh,gh,Tf,bh,nc,kf,lu,ph,yh,ic,oc,Sh,su,Ts,Cf,Pf,cu,wh,Mf,Rf,If,ks,uu,Th,aa,Ef,kh,Fg,rc,ac,il,Ph,Sl,lc,Mh,du,Cs,Lf,Rh,Vg,xf,hu,jg,Fh,vh,Oh,Dh,Bh,mu,gu,zh,vf,Of,pu,Wh,Wl,la,Bf,Jg,Nh,Gh,jh,b3,p3,Zh,Xh,Kh,Wf,w3,n0,Su,Hf,Nf,Gf,wu,qh,jf,P3,I3,Ps,E3,A3,L3,x3,v3,D3,B3,s0,h0,j3,jr,bu,x,we,Vt,Gt,E,Ue,pt,Tn,Pn,Zn,ki,No,vo,Po,Qo,us,Oc,Dc,Bc,zc,Vc,Wc,Uc,Hc,Gs,Nc,Gc,jc,qi,Zc,Xc,tf,Kc,Yc,qc,fs,bl,ds,hs,Jc,ms,Xs,Ks,ah,lh,Bl,Js,zl,ys,ru,b,A,O,ne,oe,he,ze,Ke,Ot,at,_h,Vl,Uf,Yh,Zf,Hl,Qh,o1,i,Fn,U,en,tt,r,de,j,qe,Qe,$,W,Hn,N,Un,En,on,ke,ln,sn,Sn,yn,wt,yt,an,Tt,Jt,nn,Lt,Re,nt,We,Ft,be,gt,He,ue,Me,Te,le,me,ye,St,$e,je,G,ie,Mt,Ne,q,Je,Fe,pe,ge,Y,M,H,v,T,I,C,R,m,P,w,_,l,f,a,u,o,K,xe,Ct,cn,Qt,_n,Gn,ui,Yn,_t,Dn,Vn,ii,An,_i,fi,eo,dr,So,li,hi,wa,hr,zr,Vr,Pr,Wr,ul,Ki,wo,Ei,zn,Ui,Vo,to,$r,Ai,Yo,Hr,go,gr,ta,br,pr,Oi,_o,ia,Nr,Qa,Gr,lr,ei,To,zt,ko,Co,Z3,X3,K3,Y3,q3,J3,Q3,$3,ew,tw,nw,iw,ow,rw,aw,lw,sw,cw,uw,fw,dw]}class Kb extends gn{constructor(t){super(),mn(this,t,E8,C8,rn,{class:236,layout:237,stores:238,locale:3,id:4,util:239,utils:240,animations:241,disabled:242,previewUpscale:243,previewPad:244,previewMaskOpacity:5,previewImageDataMaxSize:245,previewImageTextPixelRatio:6,markupMaskOpacity:7,zoomMaskOpacity:246,elasticityMultiplier:8,willRevert:247,willProcessImage:248,willRenderCanvas:9,willRenderToolbar:249,willRenderUtilTabs:250,willSetHistoryInitialState:251,enableButtonExport:252,enableButtonRevert:253,enableNavigateHistory:254,enableToolbar:10,enableUtils:255,enableButtonClose:256,enableDropImage:257,enablePasteImage:258,enableBrowseImage:259,accept:260,enableTransparencyGrid:11,layoutDirectionPreference:261,layoutHorizontalUtilsPreference:262,layoutVerticalUtilsPreference:263,layoutVerticalToolbarPreference:264,layoutVerticalControlGroupsPreference:265,layoutVerticalControlTabsPreference:266,supportedMediaTypes:267,status:234,formatStatusImageLoading:268,formatStatusImageProcessing:269,formatStatusSupportError:270,textDirection:12,markupEditorZoomLevel:271,markupEditorZoomLevels:13,markupEditorZoomAdjustStep:14,markupEditorZoomAdjustFactor:15,markupEditorZoomAdjustWheelFactor:16,markupEditorInteractionMode:272,muteAudio:273,willSetMediaInitialTimeOffset:274,enablePan:17,enableZoom:18,enableZoomControls:275,enableZoomInput:19,enablePanInput:276,enableCanvasAlpha:20,enablePanLimit:21,panLimitGutterScalar:22,pan:277,zoomPresetOptions:23,zoomAdjustStep:24,zoomAdjustFactor:25,zoomAdjustWheelFactor:26,zoomLevel:0,fixScrollDirection:278,hideTextInput:279,showTextInput:280,imagePreviewSrc:281,imageOrienter:282,pluginComponents:283,pluginOptions:27,sub:284,pluginInterface:1,root:2,play:285,pause:286,isPaused:287,togglePlayPause:288,mute:289,unmute:290,toggleMute:291,getDuration:292,getCurrentTime:293,setCurrentTime:294,imageSourceToImageData:28,imagePreview:29,imagePreviewCurrent:235,history:30},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get class(){return this.$$.ctx[236]}set class(t){this.$$set({class:t}),F()}get layout(){return this.$$.ctx[237]}set layout(t){this.$$set({layout:t}),F()}get stores(){return this.$$.ctx[238]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[3]}set locale(t){this.$$set({locale:t}),F()}get id(){return this.$$.ctx[4]}set id(t){this.$$set({id:t}),F()}get util(){return this.$$.ctx[239]}set util(t){this.$$set({util:t}),F()}get utils(){return this.$$.ctx[240]}set utils(t){this.$$set({utils:t}),F()}get animations(){return this.$$.ctx[241]}set animations(t){this.$$set({animations:t}),F()}get disabled(){return this.$$.ctx[242]}set disabled(t){this.$$set({disabled:t}),F()}get previewUpscale(){return this.$$.ctx[243]}set previewUpscale(t){this.$$set({previewUpscale:t}),F()}get previewPad(){return this.$$.ctx[244]}set previewPad(t){this.$$set({previewPad:t}),F()}get previewMaskOpacity(){return this.$$.ctx[5]}set previewMaskOpacity(t){this.$$set({previewMaskOpacity:t}),F()}get previewImageDataMaxSize(){return this.$$.ctx[245]}set previewImageDataMaxSize(t){this.$$set({previewImageDataMaxSize:t}),F()}get previewImageTextPixelRatio(){return this.$$.ctx[6]}set previewImageTextPixelRatio(t){this.$$set({previewImageTextPixelRatio:t}),F()}get markupMaskOpacity(){return this.$$.ctx[7]}set markupMaskOpacity(t){this.$$set({markupMaskOpacity:t}),F()}get zoomMaskOpacity(){return this.$$.ctx[246]}set zoomMaskOpacity(t){this.$$set({zoomMaskOpacity:t}),F()}get elasticityMultiplier(){return this.$$.ctx[8]}set elasticityMultiplier(t){this.$$set({elasticityMultiplier:t}),F()}get willRevert(){return this.$$.ctx[247]}set willRevert(t){this.$$set({willRevert:t}),F()}get willProcessImage(){return this.$$.ctx[248]}set willProcessImage(t){this.$$set({willProcessImage:t}),F()}get willRenderCanvas(){return this.$$.ctx[9]}set willRenderCanvas(t){this.$$set({willRenderCanvas:t}),F()}get willRenderToolbar(){return this.$$.ctx[249]}set willRenderToolbar(t){this.$$set({willRenderToolbar:t}),F()}get willRenderUtilTabs(){return this.$$.ctx[250]}set willRenderUtilTabs(t){this.$$set({willRenderUtilTabs:t}),F()}get willSetHistoryInitialState(){return this.$$.ctx[251]}set willSetHistoryInitialState(t){this.$$set({willSetHistoryInitialState:t}),F()}get enableButtonExport(){return this.$$.ctx[252]}set enableButtonExport(t){this.$$set({enableButtonExport:t}),F()}get enableButtonRevert(){return this.$$.ctx[253]}set enableButtonRevert(t){this.$$set({enableButtonRevert:t}),F()}get enableNavigateHistory(){return this.$$.ctx[254]}set enableNavigateHistory(t){this.$$set({enableNavigateHistory:t}),F()}get enableToolbar(){return this.$$.ctx[10]}set enableToolbar(t){this.$$set({enableToolbar:t}),F()}get enableUtils(){return this.$$.ctx[255]}set enableUtils(t){this.$$set({enableUtils:t}),F()}get enableButtonClose(){return this.$$.ctx[256]}set enableButtonClose(t){this.$$set({enableButtonClose:t}),F()}get enableDropImage(){return this.$$.ctx[257]}set enableDropImage(t){this.$$set({enableDropImage:t}),F()}get enablePasteImage(){return this.$$.ctx[258]}set enablePasteImage(t){this.$$set({enablePasteImage:t}),F()}get enableBrowseImage(){return this.$$.ctx[259]}set enableBrowseImage(t){this.$$set({enableBrowseImage:t}),F()}get accept(){return this.$$.ctx[260]}set accept(t){this.$$set({accept:t}),F()}
89get enableTransparencyGrid(){return this.$$.ctx[11]}set enableTransparencyGrid(t){this.$$set({enableTransparencyGrid:t}),F()}get layoutDirectionPreference(){return this.$$.ctx[261]}set layoutDirectionPreference(t){this.$$set({layoutDirectionPreference:t}),F()}get layoutHorizontalUtilsPreference(){return this.$$.ctx[262]}set layoutHorizontalUtilsPreference(t){this.$$set({layoutHorizontalUtilsPreference:t}),F()}get layoutVerticalUtilsPreference(){return this.$$.ctx[263]}set layoutVerticalUtilsPreference(t){this.$$set({layoutVerticalUtilsPreference:t}),F()}get layoutVerticalToolbarPreference(){return this.$$.ctx[264]}set layoutVerticalToolbarPreference(t){this.$$set({layoutVerticalToolbarPreference:t}),F()}get layoutVerticalControlGroupsPreference(){return this.$$.ctx[265]}set layoutVerticalControlGroupsPreference(t){this.$$set({layoutVerticalControlGroupsPreference:t}),F()}get layoutVerticalControlTabsPreference(){return this.$$.ctx[266]}set layoutVerticalControlTabsPreference(t){this.$$set({layoutVerticalControlTabsPreference:t}),F()}get supportedMediaTypes(){return this.$$.ctx[267]}set supportedMediaTypes(t){this.$$set({supportedMediaTypes:t}),F()}get status(){return this.$$.ctx[234]}set status(t){this.$$set({status:t}),F()}get formatStatusImageLoading(){return this.$$.ctx[268]}set formatStatusImageLoading(t){this.$$set({formatStatusImageLoading:t}),F()}get formatStatusImageProcessing(){return this.$$.ctx[269]}set formatStatusImageProcessing(t){this.$$set({formatStatusImageProcessing:t}),F()}get formatStatusSupportError(){return this.$$.ctx[270]}set formatStatusSupportError(t){this.$$set({formatStatusSupportError:t}),F()}get textDirection(){return this.$$.ctx[12]}set textDirection(t){this.$$set({textDirection:t}),F()}get markupEditorZoomLevel(){return this.$$.ctx[271]}set markupEditorZoomLevel(t){this.$$set({markupEditorZoomLevel:t}),F()}get markupEditorZoomLevels(){return this.$$.ctx[13]}set markupEditorZoomLevels(t){this.$$set({markupEditorZoomLevels:t}),F()}get markupEditorZoomAdjustStep(){return this.$$.ctx[14]}set markupEditorZoomAdjustStep(t){this.$$set({markupEditorZoomAdjustStep:t}),F()}get markupEditorZoomAdjustFactor(){return this.$$.ctx[15]}set markupEditorZoomAdjustFactor(t){this.$$set({markupEditorZoomAdjustFactor:t}),F()}get markupEditorZoomAdjustWheelFactor(){return this.$$.ctx[16]}set markupEditorZoomAdjustWheelFactor(t){this.$$set({markupEditorZoomAdjustWheelFactor:t}),F()}get markupEditorInteractionMode(){return this.$$.ctx[272]}set markupEditorInteractionMode(t){this.$$set({markupEditorInteractionMode:t}),F()}get muteAudio(){return this.$$.ctx[273]}set muteAudio(t){this.$$set({muteAudio:t}),F()}get willSetMediaInitialTimeOffset(){return this.$$.ctx[274]}set willSetMediaInitialTimeOffset(t){this.$$set({willSetMediaInitialTimeOffset:t}),F()}get enablePan(){return this.$$.ctx[17]}set enablePan(t){this.$$set({enablePan:t}),F()}get enableZoom(){return this.$$.ctx[18]}set enableZoom(t){this.$$set({enableZoom:t}),F()}get enableZoomControls(){return this.$$.ctx[275]}set enableZoomControls(t){this.$$set({enableZoomControls:t}),F()}get enableZoomInput(){return this.$$.ctx[19]}set enableZoomInput(t){this.$$set({enableZoomInput:t}),F()}get enablePanInput(){return this.$$.ctx[276]}set enablePanInput(t){this.$$set({enablePanInput:t}),F()}get enableCanvasAlpha(){return this.$$.ctx[20]}set enableCanvasAlpha(t){this.$$set({enableCanvasAlpha:t}),F()}get enablePanLimit(){return this.$$.ctx[21]}set enablePanLimit(t){this.$$set({enablePanLimit:t}),F()}get panLimitGutterScalar(){return this.$$.ctx[22]}set panLimitGutterScalar(t){this.$$set({panLimitGutterScalar:t}),F()}get pan(){return this.$$.ctx[277]}set pan(t){this.$$set({pan:t}),F()}get zoomPresetOptions(){return this.$$.ctx[23]}set zoomPresetOptions(t){this.$$set({zoomPresetOptions:t}),F()}get zoomAdjustStep(){return this.$$.ctx[24]}set zoomAdjustStep(t){this.$$set({zoomAdjustStep:t}),F()}get zoomAdjustFactor(){return this.$$.ctx[25]}set zoomAdjustFactor(t){this.$$set({zoomAdjustFactor:t}),F()}get zoomAdjustWheelFactor(){return this.$$.ctx[26]}set zoomAdjustWheelFactor(t){this.$$set({zoomAdjustWheelFactor:t}),F()}get zoomLevel(){return this.$$.ctx[0]}set zoomLevel(t){this.$$set({zoomLevel:t}),F()}get fixScrollDirection(){return this.$$.ctx[278]}set fixScrollDirection(t){this.$$set({fixScrollDirection:t}),F()}get hideTextInput(){return this.$$.ctx[279]}get showTextInput(){return this.$$.ctx[280]}get imagePreviewSrc(){return this.$$.ctx[281]}set imagePreviewSrc(t){this.$$set({imagePreviewSrc:t}),F()}get imageOrienter(){return this.$$.ctx[282]}set imageOrienter(t){this.$$set({imageOrienter:t}),F()}get pluginComponents(){return this.$$.ctx[283]}set pluginComponents(t){this.$$set({pluginComponents:t}),F()}get pluginOptions(){return this.$$.ctx[27]}set pluginOptions(t){this.$$set({pluginOptions:t}),F()}get sub(){return this.$$.ctx[284]}get pluginInterface(){return this.$$.ctx[1]}get root(){return this.$$.ctx[2]}set root(t){this.$$set({root:t}),F()}get play(){return this.$$.ctx[285]}get pause(){return this.$$.ctx[286]}get isPaused(){return this.$$.ctx[287]}get togglePlayPause(){return this.$$.ctx[288]}get mute(){return this.$$.ctx[289]}get unmute(){return this.$$.ctx[290]}get toggleMute(){return this.$$.ctx[291]}get getDuration(){return this.$$.ctx[292]}get getCurrentTime(){return this.$$.ctx[293]}get setCurrentTime(){return this.$$.ctx[294]}
89get imageSourceToImageData(){return this.$$.ctx[28]}set imageSourceToImageData(t){this.$$set({imageSourceToImageData:t}),F()}get imagePreview(){return this.$$.ctx[29]}get imagePreviewCurrent(){return this.$$.ctx[235]}set imagePreviewCurrent(t){this.$$set({imagePreviewCurrent:t}),F()}get history(){return this.$$.ctx[30]}}const A8=["klass","stores","isVisible","isActive","isActiveFraction","locale"],L8=["history","klass","stores","navButtons","pluginComponents","pluginInterface","pluginOptions","sub","imagePreviewSrc","imagePreview","imagePreviewCurrent"],x8=["locale"];let G1;const r4=new Set([]),Id={},ym=new Map,a4=(...e)=>{e.filter(t=>!!t.util).forEach(t=>{const[n,i,o=()=>!0]=t.util;ym.has(n)||(ym.set(n,{Component:i,isSupported:o}),rg(i).filter(r=>!A8.includes(r)).forEach(r=>{if(r4.add(r),Id[r]){Id[r].push(n);return}Id[r]=[n]}))})},F8=(e,t)=>{const n={},i=new Map,o=new Kb({target:e,props:{stores:t,pluginComponents:Array.from(ym)}});let r=!1;const a=()=>{r||o&&(r=!0,o.$destroy())};G1||(G1=new Set(rg(Kb).filter(c=>!L8.includes(c))));function l(c,u){return i.get(c)===u?!0:(i.set(c,u),!1)}G1.forEach(c=>{Object.defineProperty(n,c,{get:()=>o[c],set:x8.includes(c)?u=>{l(c,u)||(o[c]={...o[c],...u})}:u=>{l(c,u)||(o[c]=u)}})}),Object.defineProperty(n,"previewImageData",{get:()=>o.imagePreviewCurrent}),r4.forEach(c=>{const u=Id[c],f=u[0];Object.defineProperty(n,c,{get:()=>o.pluginInterface[f][c],set:d=>{if(l(c,d))return;const m=u.reduce((g,p)=>(g[p]={...o.pluginOptions[p],[c]:d},g),{});o.pluginOptions={...o.pluginOptions,...m}}})}),Object.defineProperty(n,"element",{get:()=>o.root,set:()=>{}});const s=o.history;return Qd(n,{on:(c,u)=>{if(r)return()=>{};if(/undo|redo|revert|writehistory/.test(c))return s.on(c,u);const f=[o.sub(c,u),o.$on(c,d=>u(d instanceof CustomEvent&&!d.detail?void 0:d))].filter(Boolean);return()=>f.forEach(d=>d())},updateImagePreview:c=>{o.imagePreviewSrc=c},close:()=>!r&&o.pub("close"),destroy:a}),Object.defineProperty(n,"history",{get:()=>({undo:()=>s.undo(),redo:()=>s.redo(),revert:()=>s.revert(),get:()=>s.get(),getCollapsed:()=>s.get().splice(0,s.index+1),set:c=>s.set(c),write:c=>s.write(c),get length(){return s.length()},get index(){return s.index},set index(c){s.index=c}})}),n};var l4=[...kS,"init","update","undo","redo","revert","writehistory","de
89stroy","show","hide","close","ready","zoom","pan","loadpreview","selectshape","blurshape","updateshape","addshape","removeshape","selectstyle","markuptap","markupzoom","markuppan","selectutil","selectcontrol","selectiondown","selectionup","selectionchange"];const v8=(e,t,n)=>e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,cancelable:!0}));var O8=(e,t,n={})=>{const{prefix:i="pintura:"}=n;return l4.map(o=>e.on(o,r=>Mc(t)?v8(t,`${i}${o}`,r):t(o,r)))};const D8=e=>Nt(e[0]),B8=e=>!D8(e),s4=e=>e[1],Sm=e=>e[3]||[],z8=(e,t)=>{const n=wm(e,t);return JS(n,i=>s4(i)===e),n},wm=(e,t)=>{if(B8(t)){if(t.find(i=>s4(i)===e))return t;const n=t.find(i=>wm(e,Sm(i)));return n&&n[3]}return wm(e,Sm(t))},V8=()=>[.75,.25,.25,0,0,.25,.75,.25,0,0,.25,.25,.75,0,0,0,0,0,1,0],W8=()=>[1.398,-.316,.065,-.273,.201,-.051,1.278,-.08,-.273,.201,-.051,.119,1.151,-.29,.215,0,0,0,1,0],U8=()=>[1.073,-.015,.092,-.115,-.017,.107,.859,.184,-.115,-.017,.015,.077,1.104,-.115,-.017,0,0,0,1,0],H8=()=>[1.06,0,0,0,0,0,1.01,0,0,0,0,0,.93,0,0,0,0,0,1,0],N8=()=>[1.1,0,0,0,-.1,0,1.1,0,0,-.1,0,0,1.2,0,-.1,0,0,0,1,0],G8=()=>[.212,.715,.114,0,0,.212,.715,.114,0,0,.212,.715,.114,0,0,0,0,0,1,0],j8=()=>[.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,0,0,0,1,0],Z8=()=>[.163,.518,.084,-.01,.208,.163,.529,.082,-.02,.21,.171,.529,.084,0,.214,0,0,0,1,0],X8=()=>[.338,.991,.117,.093,-.196,.302,1.049,.096,.078,-.196,.286,1.016,.146,.101,-.196,0,0,0,1,0],K8=()=>[.393,.768,.188,0,0,.349,.685,.167,0,0,.272,.533,.13,0,0,0,0,0,1,0],Y8=()=>[.289,.62,.185,0,.077,.257,.566,.163,0,.115,.2,.43,.128,0,.188,0,0,0,1,0],q8=()=>[.269,.764,.172,.05,.1,.239,.527,.152,0,.176,.186,.4,.119,0,.159,0,0,0,1,0],J8=()=>[.547,.764,.134,0,-.147,.281,.925,.12,0,-.135,.225,.558,.33,0,-.113,0,0,0,1,0],Q8={chrome:W8,fade:U8,pastel:V8,cold:N8,warm:H8,monoDefault:G8,monoWash:Z8,monoNoir:j8,monoStark:X8,sepiaDefault:K8,sepiaRust:q8,sepiaBlues:Y8,sepiaColor:J8},$8=[["Default",[[void 0,e=>e.labelDefault]]],["Classic",[["chrome",e=>e.filterLabelChrome],["fade",e=>e.filterLabelFade],["cold",e=>e.filterLabelCold],["warm",e=>e.filterLabelWarm],["pastel",e=>e.filterLabelPastel]]],["Monochrome",[["monoDefault",e=>e.filterLabelMonoDefault],["monoNoir",e=>e.filterLabelMonoNoir],["monoStark",e=>e.filterLabelMonoStark],["monoWash",e=>e.filterLabelMonoWash]]],["Sepia",[["sepiaDefault",e=>e.filterLabelSepiaDefault],["sepiaRust",e=>e.filterLabelSepiaRust],["sepiaBlues",e=>e.filterLabelSepiaBlues],["sepiaColor",e=>e.filterLabelSepiaColor]]]];var eM={filterFunctions:Q8,filterOptions:$8};const tM={base:0,min:-.25,max:.25,getLabel:e=>Ml(e/.25),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.brightness)return e.brightness[4]},setValue:(e,t)=>e.update(n=>({...n,brightness:[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0]}))},nM={base:1,min:.5,max:1.5,getLabel:e=>Ml(-1+(e-.5)*2),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.contrast)return e.contrast[0]},setValue:(e,t)=>e.update(n=>({...n,contrast:[t,0,0,0,.5*(1-t),0,t,0,0,.5*(1-t),0,0,t,0,.5*(1-t),0,0,0,1,0]}))},iM={base:1,min:0,max:2,getLabel:e=>Ml(e-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.saturation)return(e.saturation[0]-.213)/.787},setValue:(e,t)=>e.update(n=>({...n,saturation:[.213+.787*t,.715-.715*t,.072-.072*t,0,0,.213-.213*t,.715+.285*t,.072-.072*t,0,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,0,1,0]}))},oM={base:1,min:.5,max:1.5,getLabel:e=>Ml(-1+(e-.5)*2),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.exposure)return e.exposure[0]},setValue:(e,t)=>e.update(n=>({...n,exposure:[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]}))},rM={base:1,min:.15,max:4,getLabel:e=>e<1?Ml((e-.15)/.85-1):Ml((e-1)/3),getStore:({imageGamma:e})=>e},aM={base:0,min:-1,max:1,getStore:({imageVignette:e})=>e},lM={base:0,min:-1,max:1,getStore:({imageConvolutionMatrix:e})=>e,getValue:e=>{if(e.clarity)return e.clarity[0]===0?e.clarity[1]/-1:e.clarity[1]/-2},setValue:(e,t)=>{e.update(n=>({...n,clarity:t>=0?[0,-1*t,0,-1*t,1+4*t,-1*t,0,-1*t,0]:[-1*t,-2*t,-1*t,-2*t,1+-3*t,-2*t,-1*t,-2*t,-1*t]}))}},sM={base:0,min:-1,max:1,getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(!e.temperature)return;const t=e.temperature[0];return t>=1?(t-1)/.1:(1-t)/-.15},setValue:(e,t)=>
89e.update(n=>({...n,temperature:t>0?[1+t*.1,0,0,0,0,0,1,0,0,0,0,0,1+-t*.1,0,0,0,0,0,1,0]:[1+t*.15,0,0,0,0,0,1+t*.05,0,0,0,0,0,1+-t*.15,0,0,0,0,0,1,0]}))},cM={gamma:rM,brightness:tM,contrast:nM,saturation:iM,exposure:oM,temperature:sM,clarity:lM,vignette:aM},uM=[["brightness",e=>e.finetuneLabelBrightness],["contrast",e=>e.finetuneLabelContrast],["saturation",e=>e.finetuneLabelSaturation],["exposure",e=>e.finetuneLabelExposure],["temperature",e=>e.finetuneLabelTemperature],["gamma",e=>e.finetuneLabelGamma],!og()&&["clarity",e=>e.finetuneLabelClarity],["vignette",e=>e.finetuneLabelVignette]].filter(Boolean);var fM={finetuneControlConfiguration:cM,finetuneOptions:uM};const fr=(e,t="thumb")=>["div",t,{style:e,textContent:" "}],dM={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%"},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%"/>'},hM={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%",frameRound:!0},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%" rx="12%"/>'},mM={shape:{frameColor:[1,1,1],frameStyle:"line",frameInset:"2.5%",frameSize:".3125%",frameRadius:0},thumb:[fr("top:.5em;left:.5em;right:.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor")]},gM={shape:{frameColor:[1,1,1],frameStyle:"line",frameAmount:2,frameInset:"2.5%",frameSize:".3125%",frameOffset:"1.25%",frameRadius:0},thumb:[fr("top:.75em;left:.75em;right:.75em;bottom:.75em; outline: 3px double")]},bM={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameOffset:"5%",frameSize:".3125%"},thumb:[fr("top:.75em;left:.5em;bottom:.75em;border-left:1px solid","a"),fr("top:.75em;right:.5em;bottom:.75em;border-right:1px solid","b"),fr("top:.5em;left:.75em;right:.75em;border-top:1px solid","c"),fr("bottom:.5em;left:.75em;right:.75em;border-bottom:1px solid","d")]},pM={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameSize:".3125%"},thumb:[fr("top:-.5em;left:.5em;right:.5em;bottom:-.5em; box-shadow: inset 0 0 0 1px currentColor","a"),fr("top:.5em;left:-.5em;right:-.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor","b")]},yM={shape:{frameColor:[1,1,1],frameStyle:"edge",frameOffset:"1.5%",frameSize:".3125%"},thumb:[fr("top:.3125em;left:.5em;bottom:.3125em;border-left:1px solid","a"),fr("top:.3125em;right:.5em;bottom:.3125em;border-right:1px solid","b"),fr("top:.5em;left:.3125em;right:.3125em;border-top:1px solid","c"),fr("bottom:.5em;left:.3125em;right:.3125em;border-bottom:1px solid","d")]},SM={shape:{frameColor:[1,1,1],frameStyle:"hook",frameInset:"2.5%",frameSize:".3125%",frameLength:"5%"},thumb:[fr("top:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-top: 1px solid","a"),fr("top:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-top: 1px solid","b"),fr("bottom:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-bottom: 1px solid","c"),fr("bottom:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-bottom: 1px solid","d")]},wM={shape:{frameColor:[1,1,1],frameStyle:"polaroid"},thumb:'<rect stroke-width="20%" x="-5%" y="-5%" width="110%" height="96%"/>'},_M={solidSharp:dM,solidRound:hM,lineSingle:mM,lineMultiple:gM,edgeSeparate:bM,edgeCross:pM,edgeOverlap:yM,hook:SM,polaroid:wM},TM=[[void 0,e=>e.labelNone],["solidSharp",e=>e.frameLabelMatSharp],["solidRound",e=>e.frameLabelMatRound],["lineSingle",e=>e.frameLabelLineSingle],["lineMultiple",e=>e.frameLabelLineMultiple],["edgeCross",e=>e.frameLabelEdgeCross],["edgeSeparate",e=>e.frameLabelEdgeSeparate],["edgeOverlap",e=>e.frameLabelEdgeOverlap],["hook",e=>e.frameLabelCornerHooks],["polaroid",e=>e.frameLabelPolaroid]];var kM={frameStyles:_M,frameOptions:TM},Ac=e=>e.charAt(0).toUpperCase()+e.slice(1);let Eu=null;var j1=()=>{if(Eu===null)if(!zo())Eu=!1;else try{Eu=document.fonts.check("16px TestNonExistingFont")===!1}catch{Eu=!1}return Eu};const Xu=(e,t)=>n=>n[t?`${t}${Ac(e)}`:e],CM=e=>[e,`${e}`],ih=(e,t)=>n=>[e[n],Xu(n,t)],PM=e=>e.map(CM),c4=e=>Array.isArray(e)&&e.every(Ht)?PM(e):e,Ls=[1,.2549,.2118],yd="0.5%",Yb=[1,1,1,0],MM=e=>{const{hideLabel:t=!0}=e||{};return XM(["new","add","subtract"].map(n=>[n,Xu(n,"shapeLabelSelectionMode"),{icon:Xu(n,"shapeIconSelectionMode"),hideLabel:t}]),{title:n=>n.shapeTitleSelectionMode,layout:"radio"})},RM=e=>h4(e,{title:t=>t.shapeTitleBrushSize,layout:"radio",optionHideLabel:!0,optionIcon:(t,n)=>`<circle fill="currentColor" stroke-width=".05em" stroke="currentColor" fill-opacity=".25" cx="12" cy="12" r="${2+n*8}"/>`}),qb={eraser:()=>({eraseRadius:8,cursorStyle:"ellipse",cursorSize:"eraseRadius"}),path:()=>({points:[],disableAddPoints:!1}),line:()=>({x1:0,y1:0,x2:0,y2:0,disableErase:!1}),rectangle:()=>({x:0,y:0,width:0,height:0}),ellipse:()=>({x:0,y:0,rx:0,ry:0}),text:()=>({x:0,y:0,text:"Text",disableTextScale:!0})},_l=(e,t={},n)=>{if(!qb[e])return;const{position:i="relative",inputMode:o="drag",isSelection:r=!1,interpolateInput:a=!1}=n||{};return[{...qb[e](),...t},{position:i,inputMode:o,isSelection:r,interpolateInput:a}]},u4=e=>{const t={sharpie:_l("path",{bitmap:!0,strokeJoin:"round",strokeCap:"round",strokeWidth:yd,strokeColor:[...Ls],cursorStyle:"ellipse",cursorSize:"strokeWidth",disableErase:!1,disableResize:!0,disableMove:!0},{interpolateInput:!0}),eraser:_l("eraser"),path:_l("path",{pathClose:void 0,strokeWidth:yd,strokeColor:[...Ls],backgroundColor:[0,0,0,0]},{inputMode:"step"}),line:_l("line",{strokeColor:[...Ls],strokeWidth:yd}),arrow:_l("line",{lineStart:"none",lineEnd:"arrow-solid",strokeColor:[...Ls],strokeWidth:yd}),rectangle:_l("rectangle",{strokeColor:[...Yb],backgroundColor:[...Ls]}),ellipse:_l("ellipse",{strokeColor:[...Yb],backgroundColor:[...Ls]}),text:_l("text",{color:[...Ls],fontSize:"2%"})};return e&&Object.entries(e).forEach(([n,i])=>{Array.isArray(i)?t[n]=i:ls(i)&&t[n]&&(t[n]=[{...t[n][0],...i},t[n][1]])}),t},Z1=(e,t,n)=>[e,t||Xu(e,"shapeLabelTool"),{icon:Xu(e,"shapeIconTool"),...n}],IM=(e=["move","view","sharpie","eraser","path","line","arrow","rectangle","ellipse","text","preset"])=>e.map(t=>{if(Nt(t))return Z1(t);if(Array.isArray(t))return ls(t[1])?Z1(t[0],void 0,t[1]):Z1(t[0],t[1],t[2])}
89).filter(Boolean),EM=()=>({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),AM=()=>({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),LM=()=>({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"}),Jb=()=>({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),xM=()=>["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"],f4=()=>[["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]],FM=()=>["left","center","right"],vM=()=>[["normal","bold"],["italic","normal"],["italic","bold"]],OM=e=>Object.keys(e).map(ih(e,"shapeTitleColor")),DM=e=>Object.keys(e).map(ih(e,"labelSize")),BM=e=>Object.keys(e).map(ih(e,"labelSize")),Qb=e=>Object.keys(e).map(ih(e,"labelSize")),zM=e=>[...e],VM=e=>e.map(t=>[t,n=>n[`shapeLabelFontStyle${t.filter(i=>i!=="normal").map(Ac).join("")}`]]),WM=e=>e.map(t=>[i4(t),n=>n[`shapeTitleLineDecoration${Ac(t)}`],{icon:n=>n[`shapeIconLineDecoration${Ac(t)}`]}]),UM=e=>e.map(t=>[t,n=>n[`shapeTitleTextAlign${Ac(t)}`],{hideLabel:!0,icon:n=>n[`shapeIconTextAlign${Ac(t)}`]}]),ll=(e,t)=>{const{defaultKey:n,defaultValue:i,defaultOptions:o}=t||{},r=[];return n&&(r[0]=[i,a=>a[n],{...o}]),[...r,...e]},$b=e=>e.split(",").map(t=>t.trim()).some(t=>document.fonts.check(`16px ${t}`)),ep=(e={})=>["ToggleSlider",{...e}],tp="PinturaFontTest",HM=(e,t={defaultKey:"labelDefault"})=>["Dropdown",{title:n=>n.shapeTitleFontFamily,onload:({options:n=[]})=>{j1()&&n.map(([i])=>i).filter(Boolean).filter(i=>!$b(i)).forEach(i=>{const o=`${tp}-${i.replace(/[^a-zA-Z0-9]+/g,"").toLowerCase()}`;document.getElementById(o)||document.body.append(ci("span",{textContent:" ",id:o,class:tp,style:`font-family:${i};font-size:0;color:transparent;`}))})},ondestroy:()=>{if(!j1())return;document.querySelectorAll(".PinturaFontTest").forEach(i=>i.remove())},optionLabelStyle:n=>`font-family: ${n}`,options:ll(e,t),optionFilter:n=>{if(!j1())return!0;const[i]=n;return i?$b(i):!0}}],fg=(e,t={})=>["ColorPicker",{options:ll(e),...t}],NM=(e,t={})=>fg(e,{title:n=>n.labelColor,...t}),d4=e=>(t,n={})=>fg(t,{title:i=>i[e],...n}),GM=d4("shapeTitleBackgroundColor"),jM=d4("shapeTitleTextColor"),ZM=(e,t={})=>fg(e,{title:n=>n.shapeTitleStrokeColor,options:ll(e),buttonClass:"PinturaColorPickerButtonStroke",onchange:(n,i)=>{const o=i.strokeWidth;(Ht(o)||Nt(o)?parseFloat(o):0)>0||(i.strokeWidth=t&&t.defaultStrokeWidth||"0.5%")},...t}),h4=(e,t)=>{const{title:n,optionHideLabel:i=!1,layout:o,optionIcon:r=!1}=t||{},a=c4(e),l=e.map(([f])=>Nt(f)?parseFloat(f):f),s=Math.max(...l),c=Math.min(...l),u=s-c;return[o==="radio"?"RadioGroup":"Dropdown",{title:n===!1?void 0:n||(f=>f.shapeTitleStrokeWidth),options:f=>{const d=t?a.map(m=>{const[g,p,y={}]=m,w=Nt(g)?parseFloat(g):g,_=(w-c)/u;let P;return r==="line"?P=`<path stroke="currentColor" stroke-linecap="square" stroke-width="${.1+_*.875}em" d="M3,12 H20"/>`:r==="dot"?P=`<circle fill="currentColor" cx="12" cy="12" r="${2+_*8}"/>`:Nt(r)?P=r:xn(r)&&(P=r(w,_)),[g,p,{icon:P,hideLabel:i,...y}]}):a;return Rt(f,"backgroundColor")?ll(d,{defaultKey:"shapeLabelStrokeNone"}):ll(d)},onchange:(f,d)=>{if(!f)return;const m=d.strokeColor||[];if(m[3])return;const g=[...m];g[3]=1,d.strokeColor=g}}]},XM=(e,t)=>{const{title:n,layout:i}=t||{};return[i==="radio"?"RadioGroup":"Dropdown",{title:n,options:ll(e)}]},m4=(e,t,n)=>["Dropdown",{title:i=>i[t],options:ll(e,{defaultKey:"labelNone",defaultOptions:{icon:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H14"/></g>'}}),optionIconStyle:n}],KM=e=>m4(e,"shapeTitleLineStart","transform: scaleX(-1)"),YM=e=>m4(e,"shapeTitleLineEnd"),qM=e=>["Dropdown",{title:t=>t.shapeTitleFontStyle,optionLabelStyle:t=>t&&`font-style:${t[0]};font-weight:${t[1]}`,options:ll(e,{defaultKey:"shapeLabelFontStyleNormal"})}],g4=e=>["ShorthandControl",e];function JM(e){let t=1,n=0;for(;Math.round(e*t)/t!==e&&(t*=10,n++,!(n>10)););return n}function QM(e){return JM(Nt(e)?parseFloat(e):e)<4}const b4=(e,t,n,i)=>{!i&&!e.find(([a])=>a===n)&&(i={defaultKey:"labelAuto",defaultValue:n});const o=c4(e),r=o.some(([a])=>Nt(a)&&a.endsWith("%"));return["Dropdown",{title:t,options:ll(o,i),formatValue:a=>QM(a)?r?`${parseFloat(a)}%`:a:Ht(a)&&!r?Math.floor(a):`${Math.floor(parseFloat(a))}%`,...i}]},$M=(e,t)=>b4(e,n=>n.shapeTitleFontSize,"4%",t),eR=(e,t)=>b4(e,n=>n.shapeTitleLineHeight,"120%",t),tR=e=>["RadioGroup",{title:t=>t.shapeTitleTextAlign,options:ll(e)}],X1={colorOptions:()=>OM(EM()),lineEndStyleOptions:()=>WM(xM()),fontFamilyOptions:()=>zM(f4()),fontStyleOptions:()=>VM(vM()),textAlignOptions:()=>UM(FM()),strokeWidthOptions:()=>Qb(Jb()),brushSizeOptions:()=>Qb(Object.entries(Jb()).reduce((e,[t,n])=>(e[t]=`${parseFloat(n)*2}%`,e),{})),fontSizeOptions:()=>DM(AM()),lineHeightOptions:()=>BM(LM())},nR=new Intl.NumberFormat("default",{minimumFractionDigits:1,maximumFractionDigits:1}),p4=(e,t)=>
89Nt(t)?`${e}%`:e,y4=(e,t,n,i)=>Nt(i)?`${Math.round(e/n*100)}%`:`${nR.format(e)}`,K1={getValue:e=>parseFloat(e),setValue:p4,label:y4,step:.05,labelClass:"PinturaPercentageLabel"},iR={factory:g4,options:{title:"Text shadow",controls:[["ToggleSlider","x",{...K1,min:-100,max:100,labelPrefix:"X"}],["ToggleSlider","y",{...K1,min:-100,max:100,labelPrefix:"Y"}],["ToggleSlider","blur",{...K1,min:0,max:25,labelPrefix:e=>e.shapeTitleTextShadowBlur}],["ColorPicker","color",{enablePresets:!1}]]}},oR={factory:g4,options:{title:"Text outline",controls:[["ToggleSlider","width",{getValue:e=>parseFloat(e),setValue:p4,label:y4,min:0,max:15,step:.05,labelClass:"PinturaPercentageLabel",labelPrefix:e=>e.shapeTitleTextOutlineWidth}],["ColorPicker","color",{enablePresets:!1}]]}},Sd={defaultColor:{factory:NM,items:"colorOptions"},defaultNumber:{factory:ep},defaultPercentage:{factory:ep,options:{getValue:e=>parseFloat(e),setValue:e=>`${e}%`,step:.05,label:(e,t,n)=>`${Math.round(e/n*100)}%`,labelClass:"PinturaPercentageLabel"}},backgroundColor:{items:"colorOptions",factory:GM},strokeColor:{items:"colorOptions",factory:ZM},strokeWidth:{items:"strokeWidthOptions",factory:h4},brushSize:{items:"brushSizeOptions",factory:RM},drawMode:{factory:MM},lineStart:{items:"lineEndStyleOptions",factory:KM},lineEnd:{items:"lineEndStyleOptions",factory:YM},color:{items:"colorOptions",factory:jM},fontFamily:{items:"fontFamilyOptions",factory:HM},fontStyle_fontWeight:{items:"fontStyleOptions",factory:qM},fontSize:{items:"fontSizeOptions",factory:$M},lineHeight:{items:"lineHeightOptions",factory:eR},textAlign:{items:"textAlignOptions",factory:tR},textShadowX_textShadowY_textShadowBlur_textShadowColor:iR,textOutlineWidth_textOutlineColor:oR,cornerRadius:{factory:"defaultPercentage",options:{min:0,max:50,title:e=>e.shapeTitleCornerRadius}},frameColor:{factory:"defaultColor"},frameSize:{factory:"defaultPercentage",options:{min:.2,max:10,title:e=>e.labelSize}},frameInset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameOffset:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelOffset}},frameRadius:{factory:"defaultPercentage",options:{min:.5,max:10,title:e=>e.labelRadius}},frameAmount:{factory:"defaultNumber",options:{min:1,max:5,step:1,title:e=>e.labelAmount}}},S4=(e={})=>{const t={...Sd,...e},n={};return Object.entries(t).forEach(([i,o])=>{if(!/Options$/.test(i))if(Sd[i]&&ls(o)&&!Si(o)){const{component:r,factory:a,items:l,options:s={}}=t[i];if(Nt(a))n[i]=[a,s];else{const c=Sd[i].items;let u=Nt(c)?t[c]||X1[c]():void 0;Nt(l)&&X1[l]?t[l]?t[l].every(d=>!Array.isArray(d))?u=t[l].map(d=>[d,d]):u=t[l]:u=X1[l]():(l||s.items)&&(u=l||s.items);let f=a||Sd[i].factory;xn(f)?n[i]=u?f(u,s):f(s):r&&(n[i]=[r,{...s,items:l}])}}else n[i]=o}),n};function rR(e){let t,n,i,o,r;const a=e[7].default,l=lo(a,e,e[6],null);return{c(){t=fe("div"),n=fe("div"),l&&l.c(),k(n,"class","PinturaToolbarInner"),k(t,"class","PinturaToolbar"),k(t,"data-layout",e[1]),k(t,"data-overflow",e[0])},m(s,c){te(s,t,c),Ae(t,n),l&&l.m(n,null),i=!0,o||(r=[Pe(n,"measure",e[3]),wn(Fo.call(null,n)),Pe(t,"measure",e[2]),wn(Fo.call(null,t))],o=!0)},p(s,[c]){l&&l.p&&(!i||c&64)&&co(l,a,s,s[6],i?so(a,s[6],c,null):uo(s[6]),null),(!i||c&2)&&k(t,"data-layout",s[1]),(!i||c&1)&&k(t,"data-overflow",s[0])},i(s){i||(L(l,s),i=!0)},o(s){z(l,s),i=!1},d(s){s&&ee(t),l&&l.d(s),o=!1,On(r)}}}function aR(e,t,n){let i,{$$slots:o={},$$scope:r}=t,a=0,l=0,s=0,c;const u=()=>{n(0,c=i==="compact"&&a>s?"overflow":void 0)},f=({detail:m})=>{const{width:g}=m;n(5,s=g),u()},d=({detail:m})=>{const{width:g}=m;g>l&&n(4,l=g),a=g,c||u()};return e.$$set=m=>{"$$scope"in m&&n(6,r=m.$$scope)},e.$$.update=()=>{e.$$.dirty&48&&n(1,i=l>s?"compact":"default")},[c,i,f,d,l,s,r,o]}class w4 extends gn{constructor(t){super(),mn(this,t,aR,rR,rn,{})}}function lR(e){let t,n,i,o;const r=e[5].default,a=lo(r,e,e[4],null);return{c(){t=fe("div"),a&&a.c(),k(t,"class",e[0])},m(l,s){te(l,t,s),a&&a.m(t,null),n=!0,i||(o=[Pe(t,"measure",function(){kn(e[1]&&e[3])&&(e[1]&&e[3]).apply(this,arguments)}),wn(e[2].call(null,t))],i=!0)},p(l,[s]){e=l,a&&a.p&&(!n||s&16)&&co(a,r,e,e[4],n?so(r,e[4],s,null):uo(e[4]),null),(!n||s&1)&&k(t,"class",e[0])},i(l){n||(L(a,l),n=!0)},o(l){z(a,l),n=!1},d(l){l&&ee(t),a&&a.d(l),i=!1,On(o)}}}function sR(e,t,n){let{$$slots:i={},$$scope:o}=t;const r=Xa();let{class:a=null}=t;const l=Qn("measurable");let s=!1;const c=({detail:u})=>r("measure",u);return ss(()=>n(1,s=!0)),e.$$set=u=>{"class"in u&&n(0,a=u.class),"$$scope"in u&&n(4,o=u.$$scope)},[a,s,l,c,o,i]}class cR extends gn{constructor(t){super(),mn(this,t,sR,lR,rn,{class:0})}}const uR=e=>({}),np=e=>({}),fR=e=>({}),ip=e=>({}),dR=e=>({}),op=e=>({});function rp(e){let t,n;const i=e[4].header,o=lo(i,e,e[3],op);return{c(){t=fe("div"),o&&o.c(),k(t,"class","PinturaUtilHeader")},m(r,a){te(r,t,a),o&&o.m(t,null),n=!0},p(r,a){o&&o.p&&(!n||a&8)&&co(o,i,r,r[3],n?so(i,r[3],a,dR):uo(r[3]),op)},i(r){n||(L(o,r),n=!0)},o(r){z(o,r),n=!1},d(r){r&&ee(t),o&&o.d(r)}
89}}function hR(e){let t,n;return t=new cR({props:{class:"PinturaStage"}}),t.$on("measure",e[5]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p:qt,i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function ap(e){let t,n;const i=e[4].footer,o=lo(i,e,e[3],np);return{c(){t=fe("div"),o&&o.c(),k(t,"class","PinturaUtilFooter")},m(r,a){te(r,t,a),o&&o.m(t,null),n=!0},p(r,a){o&&o.p&&(!n||a&8)&&co(o,i,r,r[3],n?so(i,r[3],a,uR):uo(r[3]),np)},i(r){n||(L(o,r),n=!0)},o(r){z(o,r),n=!1},d(r){r&&ee(t),o&&o.d(r)}}}function mR(e){let t,n,i,o,r,a,l=e[1]&&rp(e);const s=e[4].main,c=lo(s,e,e[3],ip),u=c||hR(e);let f=e[2]&&ap(e),d=!1;return{c(){l&&l.c(),t=ut(),n=fe("div"),u&&u.c(),i=ut(),f&&f.c(),o=ut(),r=Mi(),k(n,"class","PinturaUtilMain")},m(m,g){l&&l.m(m,g),te(m,t,g),te(m,n,g),u&&u.m(n,null),e[6](n),te(m,i,g),f&&f.m(m,g),te(m,o,g),te(m,r,g),a=!0},p(m,[g]){m[1]?l?(l.p(m,g),g&2&&L(l,1)):(l=rp(m),l.c(),L(l,1),l.m(t.parentNode,t)):l&&(Et(),z(l,1,1,()=>{l=null}),At()),c&&c.p&&(!a||g&8)&&co(c,s,m,m[3],a?so(s,m[3],g,fR):uo(m[3]),ip),m[2]?f?(f.p(m,g),g&4&&L(f,1)):(f=ap(m),f.c(),L(f,1),f.m(o.parentNode,o)):f&&(Et(),z(f,1,1,()=>{f=null}),At())},i(m){a||(L(l),L(u,m),L(f),L(d),a=!0)},o(m){z(l),z(u,m),z(f),z(d),a=!1},d(m){m&&(ee(t),ee(n),ee(i),ee(o),ee(r)),l&&l.d(m),u&&u.d(m),e[6](null),f&&f.d(m)}}}function gR(e,t,n){let{$$slots:i={},$$scope:o}=t,{hasHeader:r=!!t.$$slots.header}=t,{hasFooter:a=!!t.$$slots.footer}=t,{root:l=void 0}=t;function s(u){Zo.call(this,e,u)}function c(u){vn[u?"unshift":"push"](()=>{l=u,n(0,l)})}return e.$$set=u=>{n(7,t=wi(wi({},t),Nu(u))),"hasHeader"in u&&n(1,r=u.hasHeader),"hasFooter"in u&&n(2,a=u.hasFooter),"root"in u&&n(0,l=u.root),"$$scope"in u&&n(3,o=u.$$scope)},t=Nu(t),[l,r,a,o,i,s,c]}class Hs extends gn{constructor(t){super(),mn(this,t,gR,mR,rn,{hasHeader:1,hasFooter:2,root:0})}}function lp(e){let t;return{c(){t=fe("div"),k(t,"class","PinturaRangeInputMeter"),Ee(t,"transform",`translateX(${e[10].x-e[13].x}px) translateY(${e[10].y-e[13].y}px)`)},m(n,i){te(n,t,i),t.innerHTML=e[7]},p(n,i){i[0]&128&&(t.innerHTML=n[7]),i[0]&1024&&Ee(t,"transform",`translateX(${n[10].x-n[13].x}px) translateY(${n[10].y-n[13].y}px)`)},d(n){n&&ee(t)}
89}}function bR(e){let t,n,i,o,r,a,l,s,c,u,f,d=e[10]&&lp(e);return{c(){t=fe("div"),n=fe("span"),i=ut(),o=fe("button"),r=bi(e[1]),l=ut(),s=fe("div"),d&&d.c(),k(n,"class","PinturaRangeInputValue"),k(o,"class","PinturaRangeInputReset"),k(o,"type","button"),o.disabled=a=e[0]===e[2],k(s,"class","PinturaRangeInputInner"),k(s,"data-value-limited",e[5]),Ee(s,"--range-mask-from",e[9]),Ee(s,"--range-mask-to",e[8]),k(t,"class","PinturaRangeInput"),k(t,"tabindex","0")},m(m,g){te(m,t,g),Ae(t,n),n.innerHTML=e[3],Ae(t,i),Ae(t,o),Ae(o,r),Ae(t,l),Ae(t,s),d&&d.m(s,null),u||(f=[Pe(o,"click",e[18]),Pe(s,"interactionstart",e[14]),Pe(s,"interactionupdate",e[16]),Pe(s,"interactionend",e[17]),Pe(s,"interactionrelease",e[15]),wn(c=xl.call(null,s,{inertia:e[6]})),Pe(s,"measure",e[39]),wn(Fo.call(null,s)),Pe(t,"wheel",e[20],{passive:!1}),Pe(t,"nudge",e[21]),wn(Al.call(null,t,{direction:"horizontal",preventDefault:!0}))],u=!0)},p(m,g){g[0]&8&&(n.innerHTML=m[3]),g[0]&2&&vi(r,m[1]),g[0]&5&&a!==(a=m[0]===m[2])&&(o.disabled=a),m[10]?d?d.p(m,g):(d=lp(m),d.c(),d.m(s,null)):d&&(d.d(1),d=null),g[0]&32&&k(s,"data-value-limited",m[5]),c&&kn(c.update)&&g[0]&64&&c.update.call(null,{inertia:m[6]}),g[0]&512&&Ee(s,"--range-mask-from",m[9]),g[0]&256&&Ee(s,"--range-mask-to",m[8])},i:qt,o:qt,d(m){m&&ee(t),d&&d.d(),u=!1,On(f)}}}const pR=2,yR=.75,SR=10,wR=5,Y1=40;function _R(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,{labelReset:p="Reset"}=t,{direction:y="x"}=t,{min:w=0}=t,{max:_=1}=t,{base:P=w}=t,{value:C=0}=t,{valueLabel:R=0}=t,{valueMin:I=void 0}=t,{valueMax:M=void 0}=t,{oninputstart:T=st}=t,{oninputmove:v=st}=t,{oninputend:H=st}=t,{elasticity:Y=0}=t,{nudgeMultiplier:Z=void 0}=t,{step:W=8}=t;const $=Qn("isAnimated");B(e,$,G=>n(6,d=G));const S=Qn("fixScrollDirection");B(e,S,G=>n(45,m=G));const pe=(G,je,ye)=>Math.ceil((G-ye)/je)*je+ye;let ge,de,Fe;const X={x:2,y:0},U=(G,je,ye)=>`M ${G-ye} ${je} a ${ye} ${ye} 0 1 0 0 -1`;function ae(G,je){const ye=1/Y1,$e=vu(G,w,_),St=vu(je,w,_),Je=un(pe($e,ye,0)-ye*.5),q=un(pe(St,ye,0)-ye*.5);return[`${Je*100}%`,`${q*100}%`]}let be,ft=!1,Se,De={snap:!1,elastic:!1};const Mt=()=>{ft=!1,be=Na(me),Se=[Me(I??w,y),Me(M??_,y)],T()},gt=()=>{ft=!0},ie=({detail:G})=>{De.snap=!ft,De.elastic=!ft,le(be,G.translation,De)},N=({detail:G})=>{De.snap=!1,De.elastic=!1;const je=le(be,G.translation,De);if(be=void 0,Se=void 0,Math.abs(je-P)<.01)return H(P);H(je)},le=(G,je,ye)=>{const $e=G[y]+je[y],St=Xn($e,Se[1][y],Se[0][y]),Je=Y?St+Kl($e-St,Y):St,q=ye.elastic?Je:St,Ie=re(0,0);return Ie[y]=q,me.set(Ie,{hard:ye.snap}),Xn(qe(Ie,y),w,_)},Te=()=>{n(0,C=Xn(P,o,r)),T(),H(C)},me=hn();B(e,me,G=>n(10,g=G));const Me=(G,je)=>{const ye=(ge[je]-a[je])*.5,St=vu(G,w,_)*a[je]-a[je]*.5,Je=ye-St;return{x:je==="x"?Je:0,y:je==="y"?Je:0}},qe=(G,je)=>{const $e=-((G[je]-ge[je]*.5)/a[je]);return w+$e*i},Ne=me.subscribe(G=>{!G||!be||v(Xn(qe(G,y),w,_))}),mt=G=>{const je=[Me(I??w,y),Me(M??_,y)],ye={x:y==="x"?g.x+G:0,y:y==="y"?g.y+G:0},$e=Xn(ye[y],je[1][y],je[0][y]),St={...g,[y]:$e};_e(me,g=St,g);const Je=Xn(qe(St,y),w,_);T(),v(Je),H(Je)},ue=G=>{G.preventDefault(),G.stopPropagation();const je=$u(G,{fixScrollDirection:m})*W;mt(je)},He=({detail:G})=>{mt(G[y]*Math.abs(Z||8))};Jr(()=>{Ne()});const Qe=G=>n(4,ge=Bw(G.detail));return e.$$set=G=>{"labelReset"in G&&n(1,p=G.labelReset),"direction"in G&&n(22,y=G.direction),"min"in G&&n(23,w=G.min),"max"in G&&n(24,_=G.max),"base"in G&&n(2,P=G.base),"value"in G&&n(0,C=G.value),"valueLabel"in G&&n(3,R=G.valueLabel),"valueMin"in G&&n(25,I=G.valueMin),"valueMax"in G&&n(26,M=G.valueMax),"oninputstart"in G&&n(27,T=G.oninputstart),"oninputmove"in G&&n(28,v=G.oninputmove),"oninputend"in G&&n(29,H=G.oninputend),"elasticity"in G&&n(30,Y=G.elasticity),"nudgeMultiplier"in G&&n(31,Z=G.nudgeMultiplier),"step"in G&&n(32,W=G.step)},e.$$.update=()=>{if(e.$$.dirty[0]&25165824&&n(34,i=_-w),e.$$.dirty[0]&41943040&&n(36,o=I!=null?Math.max(I,w):w),e.$$.dirty[0]&83886080&&n(35,r=M!=null?Math.min(M,_):_),e.$$.dirty[0]&25165828&&n(38,l=vu(P,w,_)),e.$$.dirty[0]&16|e.$$.dirty[1]&128&&ge){const G=ge.y*.5;let je=Y1*l,ye="",$e,St=ge.y,Je="";for(let q=0;q<=Y1;q++){const Ie=X.x+q*SR,se=G,V=q%wR===0?pR:yR;ye+=U(Ie,se,V)+" ",$e=Ie+X.x,q===je&&(Je=`<path d="M${Ie} ${se-4} l2 3 l-2 -1 l-2 1 z"/>`)}n(7,de=`<svg width="${$e}" height="${St}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${$e} ${St}" aria-hidden="true" focusable="false">
90        ${Je}
91        <rect rx="4" ry="4" y="${G-4}"" height="8"/>
92        <path fill-rule="evenodd" d="${ye.trim()}"/></svg>`),n(33,Fe={x:$e-X.x*2,y:St})}e.$$.dirty[0]&16|e.$$.dirty[1]&4&&(a=ge&&Fe),e.$$.dirty[0]&25165824|e.$$.dirty[1]&48&&n(5,s=o!==w||r!==_),e.$$.dirty[0]&32|e.$$.dirty[1]&48&&n(37,c=s?ae(o,r):void 0),e.$$.dirty[1]&64&&n(9,u=c?c[0]:""),e.$$.dirty[1]&64&&n(8,f=c?c[1]:""),e.$$.dirty[0]&4194385|e.$$.dirty[1]&8&&i&&ge&&ge.x&&ge.y&&me.set(Me(C,y),{hard:d===!1})},[C,p,P,R,ge,s,d,de,f,u,g,$,S,X,Mt,gt,ie,N,Te,me,ue,He,y,w,_,I,M,T,v,H,Y,Z,W,Fe,i,r,o,c,l,Qe]}class dg extends gn{constructor(t){super(),mn(this,t,_R,bR,rn,{labelReset:1,direction:22,min:23,max:24,base:2,value:0,valueLabel:3,valueMin:25,valueMax:26,oninputstart:27,oninputmove:28,oninputend:29,elasticity:30,nudgeMultiplier:31,step:32},null,[-1,-1])}}var TR={[es]:e=>({x:e.x,y:e.y}),[ga]:e=>({x:e.x+e.width,y:e.y}),[ts]:e=>({x:e.x+e.width,y:e.y}),[ba]:e=>({x:e.x+e.width,y:e.y+e.height}),[ns]:e=>({x:e.x,y:e.y+e.height}),[pa]:e=>({x:e.x,y:e.y+e.height}),[is]:e=>({x:e.x,y:e.y}),[ma]:e=>({x:e.x,y:e.y})};const _4={t:"top",r:"right",b:"bottom",l:"left"},sp="horizontal",cp="vertical",T4={t:cp,b:cp,r:sp,l:sp};function up(e,t,n){const i=e.slice();return i[15]=t[n].key,i[16]=t[n].translate,i[17]=t[n].scale,i[18]=t[n].type,i[19]=t[n].opacity,i[20]=t[n].role,i[21]=t[n].tabindex,i[22]=t[n].label,i[23]=t[n].orientation,i[24]=t[n].valuemin,i[25]=t[n].valuemax,i[26]=t[n].valuenow,i}function fp(e,t){let n,i,o,r,a,l,s,c,u,f,d,m;return{key:e,first:null,c(){n=fe("div"),k(n,"role",i=t[20]),k(n,"tabindex",o=t[21]),k(n,"aria-label",r=t[22]),k(n,"aria-orientation",a=t[23]),k(n,"aria-valuemin",l=t[24]),k(n,"aria-valuemax",s=t[25]),k(n,"aria-valuenow",c=t[26]),k(n,"class","PinturaRectManipulator"),k(n,"data-direction",u=t[15]),k(n,"data-shape",f=`${t[18]==="edge"?"edge":`${t[0]}`}`),Ee(n,"--tx",t[16].x),Ee(n,"--ty",t[16].y),Ee(n,"--sx",t[17].x),Ee(n,"--sy",t[17].y),Ee(n,"opacity",t[19]),this.first=n},m(g,p){te(g,n,p),d||(m=[Pe(n,"nudge",function(){kn(t[6](t[15]))&&t[6](t[15]).apply(this,arguments)}),wn(Al.call(null,n,{preventDefault:!0})),Pe(n,"interactionstart",function(){kn(t[5]("resizestart",t[15]))&&t[5]("resizestart",t[15]).apply(this,arguments)}),Pe(n,"interactionupdate",function(){kn(t[5]("resizemove",t[15]))&&t[5]("resizemove",t[15]).apply(this,arguments)}),Pe(n,"interactionend",function(){kn(t[5]("resizeend",t[15]))&&t[5]("resizeend",t[15]).apply(this,arguments)}),wn(xl.call(null,n))],d=!0)},p(g,p){t=g,p&2&&i!==(i=t[20])&&k(n,"role",i),p&2&&o!==(o=t[21])&&k(n,"tabindex",o),p&2&&r!==(r=t[22])&&k(n,"aria-label",r),p&2&&a!==(a=t[23])&&k(n,"aria-orientation",a),p&2&&l!==(l=t[24])&&k(n,"aria-valuemin",l),p&2&&s!==(s=t[25])&&k(n,"aria-valuemax",s),p&2&&c!==(c=t[26])&&k(n,"aria-valuenow",c),p&2&&u!==(u=t[15])&&k(n,"data-direction",u),p&3&&f!==(f=`${t[18]==="edge"?"edge":`${t[0]}`}`)&&k(n,"data-shape",f),p&2&&Ee(n,"--tx",t[16].x),p&2&&Ee(n,"--ty",t[16].y),p&2&&Ee(n,"--sx",t[17].x),p&2&&Ee(n,"--sy",t[17].y),p&2&&Ee(n,"opacity",t[19])},d(g){g&&ee(n),d=!1,On(m)}}}function kR(e){let t=[],n=new Map,i,o=xo(e[1]);const r=a=>a[15];for(let a=0;a<o.length;a+=1){let l=up(e,o,a),s=r(l);n.set(s,t[a]=fp(s,l))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();i=Mi()},m(a,l){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(a,l);te(a,i,l)},p(a,[l]){l&99&&(o=xo(a[1]),t=cl(t,l,r,1,a,o,n,i.parentNode,mS,fp,i,up))},i:qt,o:qt,d(a){a&&ee(i);for(let l=0;l<t.length;l+=1)t[l].d(a)}}}function CR(e,t,n){let i,o,r,a,{rect:l=null}=t,{bounds:s=null}=t,{visible:c=!1}=t,{cornerStyle:u=void 0}=t;const f=Qn("isAnimated");B(e,f,_=>n(12,a=_));const d=hn(void 0,{precision:1e-4,stiffness:.2,damping:.4});B(e,d,_=>n(11,r=_));const m=hn(0,{precision:.001});B(e,m,_=>n(10,o=_));let g;const p=Xa(),y=(_,P)=>({detail:C})=>{g&&P!==g||_!=="resizestart"&&g===void 0||(_==="resizestart"&&(g=P),_==="resizeend"&&(g=void 0),p(_,{direction:P,translation:C&&C.translation}))},w=_=>({detail:P})=>{p("resizestart",{direction:_,translation:{x:0,y:0}}),p("resizemove",{direction:_,translation:P}),p("resizeend",{direction:_,translation:{x:0,y:0}})};return e.$$set=_=>{"rect"in _&&n(7,l=_.rect),"bounds"in _&&n(8,s=_.bounds),"visible"in _&&n(9,c=_.visible),"cornerStyle"in _&&n(0,u=_.cornerStyle)},e.$$.update=()=>{e.$$.dirty&4608&&d.set(c?1:.5,{hard:a===!1}),e.$$.dirty&4608&&m.set(c?1:0,{hard:a===!1}),e.$$.dirty&3456&&n(1,i=Object.keys(Q1).map((_,P)=>{const C=Q1[_],R=TR[C](l),I=C.length===1?"edge":"corner",M=I==="corner";let T;if(I==="edge"&&s){let v,H,Y;C==="l"&&(v=s.x,H=Math.min(s.width,l.x+l.width),Y=l.x),C==="t"&&(v=s.y,H=Math.min(s.height,l.y+l.height),Y=l.y),
92C==="r"&&(v=l.x,H=s.width,Y=l.x+l.width),C==="b"&&(v=l.y,H=s.height,Y=l.y+l.height),T={role:"slider",tabindex:0,label:`Drag ${_4[C]}`,orientation:`${T4[C]}`,valuemin:Math.round(v),valuemax:Math.round(H),valuenow:Math.round(Y)}}return{key:C,type:I,scale:{x:/^(t|b)$/.test(C)?l.width:M?Xn(r,.5,1.25):1,y:/^(r|l)$/.test(C)?l.height:M?Xn(r,.5,1.25):1},translate:{x:R.x,y:R.y},opacity:o,...T}}))},[u,i,f,d,m,y,w,l,s,c,o,r,a]}class PR extends gn{constructor(t){super(),mn(this,t,CR,kR,rn,{rect:7,bounds:8,visible:9,cornerStyle:0})}}var MR=e=>{function t(a,l){e.dispatchEvent(new CustomEvent(a,{detail:l}))}const n=a=>{a.preventDefault(),e.addEventListener("gesturechange",i),e.addEventListener("gestureend",o),t("gesturedown")},i=a=>{a.preventDefault(),t("gestureupdate",a.scale)},o=a=>{t("gestureup",a.scale),a.preventDefault(),r()},r=()=>{e.removeEventListener("gesturechange",i),e.removeEventListener("gestureend",o)};return e.addEventListener("gesturestart",n),{destroy:()=>{r(),e.removeEventListener("gesturestart",n)}}},hg={[es]:ns,[ts]:is,[ns]:es,[is]:ts,[ma]:ba,[ga]:pa,[ba]:ma,[pa]:ga},mg=e=>{const t=e===ts||e===ga||e===ba,n=e===is||e===pa||e===ma,i=e===es||e===ga||e===ma,o=e===ns||e===ba||e===pa,r=e===is||e===ts,a=e===es||e===ns;return[t,n,i,o,r,a,r||a]},dp=(e,t,n,i={})=>{const{target:o,translate:r}=t,{aspectRatio:a,minSize:l,maxSize:s}=i,c=hg[o],u=Wu[c],f=xi(re(e.x,e.y),re(u[0]*e.width,u[1]*e.height)),d=Wu[o],m=xi(Rn(e),re(d[0]*e.width,d[1]*e.height)),[g,p,y,w,_,P,C]=mg(o);let R=r.x,I=r.y;_?I=0:P&&(R=0);const{inner:M,outer:T}=RR(f,o,n,{aspectRatio:a,minSize:l,maxSize:s});let[v,H,Y,Z]=Ws(e);if(g?Z=f.x:p&&(H=f.x),w?v=f.y:y&&(Y=f.y),g){const W=M.x+M.width,$=T.x+T.width;H=Xn(m.x+R,W,$)}else if(p){const W=T.x,$=M.x;Z=Xn(m.x+R,W,$)}if(w){const W=M.y+M.height,$=T.y+T.height;Y=Xn(m.y+I,W,$)}else if(y){const W=T.y,$=M.y;v=Xn(m.y+I,W,$)}if(Z>M.x&&(Z=M.x),H<M.x+M.width&&(H=M.x+M.width),v>M.y&&(v=M.y),Y<M.y+M.height&&(Y=M.y+M.height),Z<T.x){const W=T.x-Z;Z=T.x,H+=W}if(H>T.x+T.width){const W=H-(T.x+T.width);H=T.x+T.width,Z-=W}if(v<T.y){const W=T.y-v;v=T.y,Y+=W}if(Y>T.y+T.height){const W=Y-(T.y+T.height);Y=T.y+T.height,v-=W}if(a)if(C){let W=H-Z,$=Y-v;_?($=W/a,v=f.y-$*.5,Y=f.y+$*.5):P&&(W=$*a,Z=f.x-W*.5,H=f.x+W*.5)}else{const W=re(m.x+R-f.x,m.y+I-f.y);o===ga?(W.x=Math.max(0,W.x),W.y=Math.min(0,W.y)):o===ba?(W.x=Math.max(0,W.x),W.y=Math.max(0,W.y)):o===pa?(W.x=Math.min(0,W.x),W.y=Math.max(0,W.y)):o===ma&&(W.x=Math.min(0,W.x),W.y=Math.min(0,W.y));const $=Yl(W),S=Yl(re(M.width,M.height)),pe=Yl(re(T.width,T.height)),ge=Xn($,S,pe),de=re(a,1),Fe=Bo(ur(de),ge);o===ga?(H=f.x+Fe.x,v=f.y-Fe.y):o===ba?(H=f.x+Fe.x,Y=f.y+Fe.y):o===pa?(Z=f.x-Fe.x,Y=f.y+Fe.y):o===ma&&(Z=f.x-Fe.x,v=f.y-Fe.y)}return Li(Z,v,H-Z,Y-v)};const RR=(e,t,n,i)=>{const{aspectRatio:o,minSize:r,maxSize:a}=i,l=t===ts||t===ga||t===ba,s=t===is||t===pa||t===ma,c=t===es||t===ga||t===ma,u=t===ns||t===ba||t===pa,f=t===is||t===ts,d=t===es||t===ns,m=Rn(n);l?(m.x=e.x,m.width-=e.x):s&&(m.width=e.x),u?(m.y=e.y,m.height-=e.y):c&&(m.height=e.y);const g=Qw(Math.min(m.width,a.width),Math.min(m.height,a.height));if(o){if(f){const M=Math.min(e.y,n.height-e.y);g.height=Math.min(M*2,g.height)}else if(d){const M=Math.min(e.x,n.width-e.x);g.width=Math.min(M*2,g.width)}}const p=o?zs(rs(jo(r),o)):r,y=o?zs(rr(g,o)):g;let w,_,P,C;l?w=e.x:s&&(_=e.x),u?P=e.y:c&&(C=e.y),l?_=w+p.width:s&&(w=_-p.width),u?C=P+p.height:c&&(P=C-p.height),f?(P=e.y-p.height*.5,C=e.y+p.height*.5):d&&(w=e.x-p.width*.5,_=e.x+p.width*.5);const R=Qi([re(w,P),re(_,C)]);l?_=w+y.width:s&&(w=_-y.width),u?C=P+y.height:c&&(P=C-y.height),f?(P=e.y-y.height*.5,C=e.y+y.height*.5):d&&(w=e.x-y.width*.5,_=e.x+y.width*.5),w=Math.max(n.x,w),_=Math.min(n.x+n.width,_),P=Math.max(n.y,P),C=Math.min(n.y+n.height,C);const I=Qi([re(w,P),re(_,C)]);return{inner:R,outer:I}};var IR=(e,t,n={})=>{const{target:i,translate:o}=t,{aspectRatio:r,minSize:a}=n,l=hg[i],s=Wu[l],c=xi(Rn(e),re(s[0]*e.width,s[1]*e.height)),u=Wu[i],f=xi(Rn(e),re(u[0]*e.width,u[1]*e.height)),[d,m,g,p,y,w,_]=mg(i);let P=o.x,C=o.y;y?C=0:w&&(P=0);let[R,I,M,T]=Ws(e);if(d?T=c.x:m&&(I=c.x),p?R=c.y:g&&(M=c.y),d?I=f.x+P:m&&(T=f.x+P),p?M=f.y+C:g&&(R=f.y+C),a&&y&&M-R<a.height){const v=a.height-(M-R);R-=v*.5,M+=v*.5}if(a&&w&&I-T<a.width){const v=a.width-(I-T);T-=v*.5,I+=v*.5}if(r)if(_){let v=I-T,H=M-R;y?(H=v/r,R=c.y-H*.5,M=c.y+H*.5):w&&(v=H*r,T=c.x-v*.5,I=c.x+v*.5)}else{const v=re(f.x+P-c.x,f.y+C-c.y);i===ga?(v.x=Math.max(0,v.x),v.y=Math.min(0,v.y)):i===ba?(v.x=Math.max(0,v.x),v.y=Math.max(0,v.y)):i===
92pa?(v.x=Math.min(0,v.x),v.y=Math.max(0,v.y)):i===ma&&(v.x=Math.min(0,v.x),v.y=Math.min(0,v.y));const H=Yl(v),Y=re(r,1),Z=Bo(ur(Y),H);i===ga?(I=c.x+Z.x,R=c.y-Z.y):i===ba?(I=c.x+Z.x,M=c.y+Z.y):i===pa?(T=c.x-Z.x,M=c.y+Z.y):i===ma&&(T=c.x-Z.x,R=c.y-Z.y)}return Li(T,R,I-T,M-R)},hp=e=>e*180/Math.PI;function ER(e){let t,n,i;return n=new dg({props:{elasticity:e[5],min:e[9],max:e[10],value:e[11],valueMin:Math.max(e[9],e[0]),valueMax:Math.min(e[10],e[1]),labelReset:e[6],base:e[12],valueLabel:`${Math.round(hp(e[11]))}&deg;`,oninputstart:e[2],oninputmove:e[17],oninputend:e[18]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaImageRotator")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,[r]){const a={};r&32&&(a.elasticity=o[5]),r&512&&(a.min=o[9]),r&1024&&(a.max=o[10]),r&2048&&(a.value=o[11]),r&513&&(a.valueMin=Math.max(o[9],o[0])),r&1026&&(a.valueMax=Math.min(o[10],o[1])),r&64&&(a.labelReset=o[6]),r&4096&&(a.base=o[12]),r&2048&&(a.valueLabel=`${Math.round(hp(o[11]))}&deg;`),r&4&&(a.oninputstart=o[2]),r&392&&(a.oninputmove=o[17]),r&400&&(a.oninputend=o[18]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}const mp=1e-9;function AR(e,t,n){let i,o,r,a,l,s,c,{rotation:u}=t,{valueMin:f}=t,{valueMax:d}=t,{oninputstart:m=st}=t,{oninputmove:g=st}=t,{oninputend:p=st}=t,{elasticity:y=0}=t,{labelReset:w=void 0}=t,{rotationMin:_=void 0}=t,{rotationMax:P=void 0}=t;const C=I=>g(l*s+I),R=I=>p(l*s+I);return e.$$set=I=>{"rotation"in I&&n(13,u=I.rotation),"valueMin"in I&&n(0,f=I.valueMin),"valueMax"in I&&n(1,d=I.valueMax),"oninputstart"in I&&n(2,m=I.oninputstart),"oninputmove"in I&&n(3,g=I.oninputmove),"oninputend"in I&&n(4,p=I.oninputend),"elasticity"in I&&n(5,y=I.elasticity),"labelReset"in I&&n(6,w=I.labelReset),"rotationMin"in I&&n(14,_=I.rotationMin),"rotationMax"in I&&n(15,P=I.rotationMax)},e.$$.update=()=>{e.$$.dirty&16384&&n(9,i=_+mp),e.$$.dirty&32768&&n(10,o=P-mp),e.$$.dirty&1536&&n(12,r=i+(o-i)*.5),e.$$.dirty&32768&&n(16,a=P*2),e.$$.dirty&8192&&n(8,l=Math.sign(u)),e.$$.dirty&73728&&n(7,s=Math.round(Math.abs(u)/a)*a),e.$$.dirty&8576&&n(11,c=u-l*s)},[f,d,m,g,p,y,w,s,l,i,o,c,r,u,_,P,a,C,R]}class LR extends gn{constructor(t){super(),mn(this,t,AR,ER,rn,{rotation:13,valueMin:0,valueMax:1,oninputstart:2,oninputmove:3,oninputend:4,elasticity:5,labelReset:6,rotationMin:14,rotationMax:15})}}var xR=(e,t={})=>{const{width:n=24,height:i=24,bounds:o=16,radius:r=3}=t;let a=Si(e)?fa(e[0],e[1]):e,l=!!a;a=l?a:1;let s,c,u,f;u=a>1?o:a*o,f=u/a,s=Math.round((n-u)*.5),c=Math.round((i-f)*.5);const d=l?"currentColor":"none",m=l?"none":"currentColor",g=n/16,p=[n/12,n/6].join(" ");return`<rect fill="${d}" stroke="${m}" stroke-width="${g}" stroke-dasharray="${p}" x="${s}" y="${c}" width="${u}" height="${f}" rx="${r}"/>`};function FR(e){let t,n;return t=new El({props:{class:"PinturaPresetListFilter",layout:"row",options:e[8],selectedIndex:e[7],onchange:e[10]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&256&&(r.options=i[8]),o&128&&(r.selectedIndex=i[7]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function vR(e){let t,n;return t=new lg({props:{icon:e[0],label:e[1],labelClass:e[2],hideLabel:e[3],options:e[9],selectedIndex:e[4],onchange:e[5],optionMapper:e[6],$$slots:{controls:[FR]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,[o]){const r={};o&1&&(r.icon=i[0]),o&2&&(r.label=i[1]),o&4&&(r.labelClass=i[2]),o&8&&(r.hideLabel=i[3]),o&512&&(r.options=i[9]),o&16&&(r.selectedIndex=i[4]),o&32&&(r.onchange=i[5]),o&64&&(r.optionMapper=i[6]),o&262528&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}const gp='fill="none" stroke="currentColor"';function OR(e,t,n){let i,o,r,{icon:a}=t,{label:l}=t,{labelClass:s}=t,{hideLabel:c}=t,{options:u}=t,{selectedIndex:f}=t,{onchange:d}=t,{optionMapper:m}=t,{filter:g="landscape"}=t,{onfilterchange:p=st}=t;const y=(R,I,M,T,v)=>`
93    <rect ${gp} x="${R}" y="${I}" width="${M}" height="${T}" rx="${v}"/>`,w=(R,I)=>`<path ${gp} d="M${R} ${I} l2 2 l3 -4"/>`,_=(R,I)=>(R||[]).map(M=>Nt(M[0])?(M[1]=M[1].map(I),M):I(M)),P=R=>I=>{const[M,T,v={}]=I;return Ht(M)&&(v.hidden=R==="landscape"?M<1:M>1),[M,T,v]},C=R=>{n(11,g=R.value),p(R.value)};return e.$$set=R=>{"icon"in R&&n(0,a=R.icon),"label"in R&&n(1,l=R.label),"labelClass"in R&&n(2,s=R.labelClass),"hideLabel"in R&&n(3,c=R.hideLabel),"options"in R&&n(12,u=R.options),"selectedIndex"in R&&n(4,f=R.selectedIndex),"onchange"in R&&n(5,d=R.onchange),"optionMapper"in R&&n(6,m=R.optionMapper),"filter"in R&&n(11,g=R.filter),"onfilterchange"in R&&n(13,p=R.onfilterchange)},e.$$.update=()=>{e.$$.dirty&6144&&n(9,i=_(u,P(g))),e.$$.dirty&2048&&n(7,o=g==="landscape"?0:1),e.$$.dirty&128&&n(8,r=[["landscape","Landscape",{hideLabel:!0,icon:y(2,6,19,12,2)+(o===0?w(9,12):"")}],["portrait","Portrait",{hideLabel:!0,icon:y(5,3,13,18,2)+(o===1?w(9,12):"")}]])},[a,l,s,c,f,d,m,o,r,i,C,g,u,p]}class DR extends gn{constructor(t){super(),mn(this,t,OR,vR,rn,{icon:0,label:1,labelClass:2,hideLabel:3,options:12,selectedIndex:4,onchange:5,optionMapper:6,filter:11,onfilterchange:13})}}const BR=.9999,yc=6,k4=e=>Or(e,t=>un(t,yc)),bp=e=>qr(e,t=>un(t,yc)),zR=e=>e.map(k4),jl=(e,t,n=1e-4)=>Math.abs(e-t)<n;var VR=(e,t,n,i,o={})=>{const{aspectRatio:r}=o;e=bp(e),i=zR(i);const a=P0(e,hg[n.target]),l=Or(a,_=>un(_,yc)),s=r?rs(o.minSize,r):o.minSize,c=r?rr(o.maxSize,r):o.maxSize,u=P0(t,n.target);if(or(u,a)<1){t=Rn(e);
93const _=Math.min(s.width/e.width,s.height/e.height);Oo(t,_,a)}t=C0(Rn(t),s,c,a);let d=Rn(t);t=bp(t);const m=Ty(i,1),g=Fr(e),p=Fr(t),y=g.findIndex(_=>Xl(Or(_,P=>un(P,yc)),l)),w=_=>m.map(P=>Am(P,_)).filter(Boolean).pop();if(r){const _=p.map((P,C)=>{if(C===y)return;const R=re(a.x-P.x,a.y-P.y);ur(R),Bo(R,.5);const I=re(a.x-R.x,a.y-R.y),M=os(I,k4(P)),T=w(M);if(!T)return;const v=g[C];return{intersection:T,cornerDist:or(a,v),intersectionDist:or(a,T)}}).filter(Boolean);if(_.length){const P=_.reduce((C,R)=>{const I=R.intersectionDist/R.cornerDist;return I<C?I:C},Number.MAX_SAFE_INTEGER);d=Rn(e),Oo(d,P,a)}}else{const _=n.target.length===1,P=!(i[0].y===i[1].y||i[0].x===i[1].x),C=g.map((R,I)=>{if(I===y)return;const M=p[I],T=!jl(M.x,l.x)&&!jl(M.y,l.y);if(!_&&!P&&T||_&&(jl(M.x,l.x)||jl(M.y,l.y)))return;const v=Ut(_?R:a),H=Fi(Ut(v),M);ur(H),Bo(H,.5),_?xi(v,H):Fi(v,H);const Y=os(v,M),Z=w(Y);if(Z)return Z}).filter(Boolean);if(C.length){const[R,I,M,T]=mg(n.target);let[v,H,Y,Z]=Ws(t);C.forEach(({x:W,y:$})=>{const S=un(W,yc),pe=un($,yc);M&&!jl(pe,l.y)&&(v=Math.max(v,$)),R&&!jl(S,l.x)&&(H=Math.min(H,W)),T&&!jl(pe,l.y)&&(Y=Math.min(Y,$)),I&&!jl(S,l.x)&&(Z=Math.max(Z,W))}),d=$w([v,H,Y,Z]),Oo(d,BR,a)}}return C0(d,s,c,a),d};function WR(e){let t,n;return t=new Xo({props:{items:e[12]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&4096&&(r.items=i[12]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function UR(e){let t,n,i;return n=new w4({props:{$$slots:{default:[WR]},$$scope:{ctx:e}}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"slot","header")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&4096|r[7]&1024&&(a.$$scope={dirty:r,ctx:o}),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function pp(e){let t,n;return t=new Ll({props:{onclick:e[90],label:e[4].cropLabelButtonRecenter,icon:e[4].cropIconButtonRecenter,disabled:!e[9],hideLabel:!0,class:"PinturaButtonCenter",style:`opacity:${e[31]};transform:translate3d(${e[32].x}px, ${e[32].y}px,0)`}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.label=i[4].cropLabelButtonRecenter),o[0]&16&&(r.icon=i[4].cropIconButtonRecenter),o[0]&512&&(r.disabled=!i[9]),o[1]&3&&(r.style=`opacity:${i[31]};transform:translate3d(${i[32].x}px, ${i[32].y}px,0)`),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function yp(e){let t,n;return t=new PR({props:{rect:e[8],bounds:e[14],visible:e[13],cornerStyle:e[1]}}),t.$on("resizestart",e[70]),t.$on("resizemove",e[71]),t.$on("resizeend",e[72]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&256&&(r.rect=i[8]),o[0]&16384&&(r.bounds=i[14]),o[0]&8192&&(r.visible=i[13]),o[0]&2&&(r.cornerStyle=i[1]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Sp(e){let t,n;return{c(){t=fe("div"),n=fe("p"),k(t,"class","PinturaImageInfo"),k(t,"data-custom",e[24])},m(i,o){te(i,t,o),Ae(t,n),n.innerHTML=e[23]},p(i,o){o[0]&8388608&&(n.innerHTML=i[23]),o[0]&16777216&&k(t,"data-custom",i[24])},d(i){i&&ee(t)}}}function HR(e){let t,n,i,o,r,a,l,s,c=e[22]&&e[10]&&pp(e),u=e[22]&&yp(e),f=e[11]&&Sp(e);return{c(){t=fe("div"),n=fe("div"),c&&c.c(),i=ut(),u&&u.c(),r=ut(),f&&f.c(),k(n,"class","PinturaStage"),k(t,"slot","main")},m(d,m){te(d,t,m),Ae(t,n),c&&c.m(n,null),Ae(n,i),u&&u.m(n,null),e[168](n),Ae(t,r),f&&f.m(t,null),a=!0,l||(s=[wn(Fo.call(null,n)),Pe(n,"measure",e[166]),Pe(n,"wheel",function(){kn(e[2]&&e[89])&&(e[2]&&e[89]).apply(this,arguments)},{passive:!1}),Pe(n,"interactionstart",e[76]),Pe(n,"interactionupdate",e[77]),Pe(n,"interactionrelease",e[79]),Pe(n,"interactionend",e[78]),wn(o=xl.call(null,n,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:_p,getEventPosition:e[169]})),Pe(n,"gesturedown",e[86]),Pe(n,"gestureupdate",e[87]),Pe(n,"gestureup",e[88]),wn(MR.call(null,n))],l=!0)},p(d,m){e=d,e[22]&&e[10]?c?(c.p(e,m),m[0]&4195328&&L(c,1)):(c=pp(e),c.c(),L(c,1),c.m(n,i)):c&&(Et(),z(c,1,1,()=>{c=null}),At()),e[22]?u?(u.p(e,m),m[0]&4194304&&L(u,1)):(u=yp(e),u.c(),L(u,1),u.m(n,null)):u&&(Et(),z(u,1,1,()=>{u=null}),At()),o&&kn(o.update)&&m[0]&67108868&&o.update.call(null,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:_p,getEventPosition:e[169]}),e[11]?f?f.p(e,m):(f=Sp(e),f.c(),f.m(t,null)):f&&(f.d(1),f=null)},i(d){a||(L(c),L(u),a=!0)},o(d){z(c),z(u),a=!1},d(d){d&&ee(t),c&&c.d(),u&&u.d(),e[168](null),f&&f.d(),l=!1,On(s)}}}function wp(e){let t,n,i,o;const r=[{class:"PinturaControlList"},{tabs:e[7]},e[19]];let a={$$slots:{default:[NR,({tab:c})=>({226:c}),({tab:c})=>[0,0,0,0,0,0,0,c?512:0]]},$$scope:{ctx:e}};for(let c=0;c<r.length;c+=1)a=wi(a,r[c]);t=new eh({props:a}),t.$on("select",e[167]);const l=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[18]},e[19]];let s={$$slots:{default:[ZR,({panel:c})=>({225:c}),({panel:c})=>[0,0,0,0,0,0,0,c?256:0]]},$$scope:{ctx:e}};for(let c=0;c<l.length;c+=1)s=wi(s,l[c]);return i=new th({props:s}),{c(){Ve(t.$$.fragment),n=ut(),Ve(i.$$.fragment)},m(c,u){ve(t,c,u),te(c,n,u),ve(i,c,u),o=!0},p(c,u){const f=u[0]&524416?fo(r,[r[0],u[0]&128&&{tabs:c[7]},u[0]&524288&&yo(c[19])]):{};u[7]&1536&&(f.$$scope={dirty:u,ctx:c}),t.$set(f);const d=u[0]&786432?fo(l,[l[0],l[1],u[0]&262144&&{panels:c[18]},u[0]&524288&&yo(c[19])]):{};u[0]&2046853144|u[7]&1280&&(d.$$scope={dirty:u,ctx:c}),i.$set(d)},i(c){o||(L(t.$$.fragment,c),L(i.$$.fragment,c),o=!0)},o(c){z(t.$$.fragment,c),z(i.$$.fragment,c),o=!1},d(c){c&&ee(n),Oe(t,c),Oe(i,c)}}}function NR(e){let t,n=e[226].label+"",i;return{c(){t=fe("span"),i=bi(n)},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[7]&512&&n!==(n=o[226].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function GR(e){let t,n;return t=new dg({props:{elasticity:e[27]*e[46],base:qR,min:e[25],max:YR,valueMin:e[29][0],valueMax:e[29][1],value:e[30],labelReset:e[4].labelReset,valueLabel:`${Math.round(e[30]*100)}%`,oninputstart:e[83],oninputmove:e[84],oninputend:e[85]}}
93),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&134217728&&(r.elasticity=i[27]*i[46]),o[0]&33554432&&(r.min=i[25]),o[0]&536870912&&(r.valueMin=i[29][0]),o[0]&536870912&&(r.valueMax=i[29][1]),o[0]&1073741824&&(r.value=i[30]),o[0]&16&&(r.labelReset=i[4].labelReset),o[0]&1073741824&&(r.valueLabel=`${Math.round(i[30]*100)}%`),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function jR(e){let t,n;return t=new LR({props:{elasticity:e[27]*e[46],rotation:e[15],labelReset:e[4].labelReset,valueMin:e[28][0],valueMax:e[28][1],rotationMin:-e[3],rotationMax:e[3],oninputstart:e[73],oninputmove:e[74],oninputend:e[75]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&134217728&&(r.elasticity=i[27]*i[46]),o[0]&32768&&(r.rotation=i[15]),o[0]&16&&(r.labelReset=i[4].labelReset),o[0]&268435456&&(r.valueMin=i[28][0]),o[0]&268435456&&(r.valueMax=i[28][1]),o[0]&8&&(r.rotationMin=-i[3]),o[0]&8&&(r.rotationMax=i[3]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function ZR(e){let t,n,i,o;const r=[jR,GR],a=[];function l(s,c){return s[225]===s[95]+"-rotation"?0:s[225]===s[95]+"-zoom"?1:-1}return~(t=l(e))&&(n=a[t]=r[t](e)),{c(){n&&n.c(),i=Mi()},m(s,c){~t&&a[t].m(s,c),te(s,i,c),o=!0},p(s,c){let u=t;t=l(s),t===u?~t&&a[t].p(s,c):(n&&(Et(),z(a[u],1,1,()=>{a[u]=null}),At()),~t?(n=a[t],n?n.p(s,c):(n=a[t]=r[t](s),n.c()),L(n,1),n.m(i.parentNode,i)):n=null)},i(s){o||(L(n),o=!0)},o(s){z(n),o=!1},d(s){s&&ee(i),~t&&a[t].d(s)}}}function XR(e){let t,n,i=e[20]&&wp(e);return{c(){t=fe("div"),i&&i.c(),k(t,"slot","footer"),Ee(t,"transform",e[17])},m(o,r){te(o,t,r),i&&i.m(t,null),n=!0},p(o,r){o[20]?i?(i.p(o,r),r[0]&1048576&&L(i,1)):(i=wp(o),i.c(),L(i,1),i.m(t,null)):i&&(Et(),z(i,1,1,()=>{i=null}),At()),r[0]&131072&&Ee(t,"transform",o[17])},i(o){n||(L(i),n=!0)},o(o){z(i),n=!1},d(o){o&&ee(t),i&&i.d()}}}function KR(e){let t,n,i;function o(a){e[170](a)}let r={hasHeader:e[21],$$slots:{footer:[XR],main:[HR],header:[UR]},$$scope:{ctx:e}};return e[16]!==void 0&&(r.root=e[16]),t=new Hs({props:r}),vn.push(()=>Cr(t,"root",o)),t.$on("measure",e[171]),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,l){const s={};l[0]&2097152&&(s.hasHeader=a[21]),l[0]&2145320958|l[1]&3|l[7]&1024&&(s.$$scope={dirty:l,ctx:a}),!n&&l[0]&65536&&(n=!0,s.root=a[16],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}const YR=1,qR=0,_p=(e,t)=>e.target===t;function JR(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de=qt,Fe=()=>(de(),de=Do(Sn,E=>n(13,ge=E)),Sn),X,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te,me,Me,qe,Ne,mt,ue,He,Qe,G,je,ye,$e,St,Je,q,Ie,se,V,dt,Ft,We,Xe,nt,wt,Zt,yt,nn,Jt,yn,an;e.$$.on_destroy.push(()=>de());const Tt="crop";let{isActive:Sn}=t;Fe();let{stores:ln}=t,{cropImageSelectionCornerStyle:sn="circle"}=t,{cropWillRenderImageSelectionGuides:ke=(E,Ue)=>{const pt=E=="rotate";return{rows:pt?5:3,cols:pt?5:3,opacity:Ue*.25}}}=t,{cropAutoCenterImageSelectionTimeout:Re=void 0}=t,{cropEnableZoomMatchImageAspectRatio:Lt=!0}=t,{cropEnableRotateMatchImageAspectRatio:fn="never"}=t,{cropEnableRotationInput:on=!0}=t,{cropEnableZoom:En=!0}=t,{cropEnableZoomInput:bt=!0}=t,{cropEnableZoomAutoHide:Un=!0}=t,{cropEnableImageSelection:Hn=!0}=t,{cropEnableInfoIndicator:$n=!1}=t,{cropEnableZoomTowardsWheelPosition:Q=!0}=t,{cropEnableLimitWheelInputToCropSelection:Ge=!0}=t,{cropEnableCenterImageSelection:j=!0}=t,{cropEnableButtonRotateLeft:Le=!0}=t,{cropEnableButtonRotateRight:tt=!1}=t,{cropEnableButtonFlipHorizontal:en=!0}=t,{cropEnableButtonFlipVertical:Xt=!1}=t,{cropSelectPresetOptions:Ze=void 0}=t,{cropEnableSelectPreset:tn=!0}=t,{cropEnableFilterMatchAspectRatio:Fn=!0}=t,{cropSelectPresetFilter:K=!1}=t,{cropEnableButtonToggleCropLimit:J=!1}=t,{cropWillRenderTools:xe=Nn}=t,{cropWillRenderInfoIndicator:it=void 0}=t,{cropActiveTransformTool:Ye="rotation"}=t,{cropMinimizeToolbar:ct="auto"}=t,{cropInteractionFocus:ot="image"}=t,{cropRotationRange:Ct=ca}=t,{cropMaskOpacity:cn=.85}=t,{locale:Qt={}}=t,{cropFormatIconSelectPreset:_n=function(E){const{aspectRatio:Ue}=E,[pt,Tn,Pn]=Ue?[Ue<1?1:.3,Ue===1?.85:.5,Ue>1?1:.3]:[.2,.3,.4];return{a:pt,b:Tn,c:Pn}}}=t,{cropFormatIconCropBoundary:Bt=function(E){const{isBoundToImage:Ue}=E,[pt,Tn,Pn,jn]=Ue?[.3,1,0,0]:[0,0,.3,1];return{a:pt,b:Tn,c:Pn,d:jn}}}=t;const et=Qn("isAnimated");B(e,et,E=>n(144,X=E));const ri=Qn("elasticityMultiplier");B(e,ri,E=>n(27,Zt=E));const Gn=Qn("redrawTrigger");B(e,Gn,E=>n(165,wt=E));const Ri=Qn("imageIsStatic");B(e,Ri,E=>n(150,Mt=E));const ai=Qn("imageStaticVisualCorners");B(e,ai,E=>n(187,se=E));const ui=Qn("fixScrollDirection");B(e,ui,E=>n(181,je=E));let Yn="idle";const _t=ht();B(e,_t,E=>n(162,We=E));const Dn=()=>q===void 0,Vn=E=>1/E,ni=E=>{!Fn||K===E||(n(97,K=E),!(!q||q===1)&&Bn()&&(_e(no,q=Vn(q),q),Cn.write()))},Bn=()=>
93{if(q===1||!i)return!1;const E=Vn(q);return!!$l(We).find(([Ue])=>Ue===E)},qn=(E,Ue,pt)=>ol(pt)?Ue.width===Math.round(E.height)||Ue.height===Math.round(E.width):Ue.width===Math.round(E.width)||Ue.height===Math.round(E.height),ii=(E,Ue,pt)=>{const Tn=Ga(gy(ir(Ue),pt),Zn=>Math.abs(Math.round(Zn))),Pn=Pc(Tn),jn=In(E);return Xl(Pn,jn)},pi=()=>(Dn()||fn==="always"&&Bn())&&ii(ie,ue,He)&&qn(ie,ue,He),An=E=>{if(fn!=="never"&&pi()){_e(Ei,He+=E,He);const Ue=ol(He),pt=Ue?ue.height:ue.width,Tn=Ue?ue.width:ue.height;_e(to,ie=Li(0,0,pt,Tn),ie),Dn()||_e(no,q=fa(pt,Tn),q)}else _e(Ei,He+=E,He)},{history:Cn,env:_i,isInteracting:fi,isInteractingFraction:eo,isTransformingImage:di,rootRect:dr,stageRect:So,utilRect:li,utilRectPadded:hi,rootLineColor:wa,allowPan:Qr,allowZoom:hr,allowPlayPause:Ko,rangeInputElasticity:zr,presentationScalar:Vr,utilTools:Pr,imagePreviewModifiers:Wr,imageOutlineOpacity:ul,imageFlipX:Ki,imageFlipY:wo,imageRotation:Ei,imageRotationRange:_a,imageOutputSize:Ya,imageSelectionRect:Yi,imageSelectionRectSnapshot:ho,imageSelectionRectIntent:zn,imageSelectionRectPresentation:Ui,imageCropRectIntent:Vo,imageCropRectOrigin:ar,imageCropRect:to,imageCropMinSize:$r,imageCropMaxSize:Ai,imageCropRange:Ur,imageCropAspectRatio:no,imageCropLimitToImage:Yo,imageSize:Hr,imageScalar:fl,imageOverlayMarkup:mo,stagePadded:go,stageRecenter:qa}=ln;B(e,_i,E=>n(145,U=E)),B(e,fi,E=>n(149,De=E)),B(e,di,E=>n(179,Ne=E)),B(e,dr,E=>n(26,ye=E)),B(e,So,E=>n(157,qe=E)),B(e,hi,E=>n(14,Te=E)),B(e,Vr,E=>n(154,le=E)),B(e,Pr,E=>n(189,dt=E)),B(e,Wr,E=>n(178,ft=E)),B(e,Ki,E=>n(164,nt=E)),B(e,wo,E=>n(163,Xe=E)),B(e,Ei,E=>n(15,He=E)),B(e,_a,E=>n(28,yt=E)),B(e,Ya,E=>n(151,gt=E)),B(e,Yi,E=>n(156,Me=E)),B(e,ho,E=>n(155,me=E)),B(e,zn,E=>n(188,V=E)),B(e,Ui,E=>n(148,Se=E)),B(e,Vo,E=>n(182,$e=E)),B(e,ar,E=>n(184,Je=E)),B(e,to,E=>n(152,ie=E)),B(e,$r,E=>n(160,G=E)),B(e,Ai,E=>n(186,Ie=E)),B(e,Ur,E=>n(183,St=E)),B(e,no,E=>n(185,q=E)),B(e,Yo,E=>n(159,Qe=E)),B(e,Hr,E=>n(158,ue=E)),B(e,fl,E=>n(153,N=E)),B(e,go,E=>n(147,be=E));function ji(E,Ue){return xn(E.cropIconSelectPreset)?Lo(E.cropIconSelectPreset,E,Ue):Jl(E.cropIconSelectPreset,_n({aspectRatio:Ue}),"{","}")}function mr(E,Ue){return xn(E.cropIconCropBoundary)?Lo(E.cropIconCropBoundary,E,Ue):Jl(E.cropIconCropBoundary,Bt({isBoundToImage:Ue}),"{","}")}let Hi;const ea=()=>{Yn="select",_e(fi,De=!0,De),_e(ho,me=Rn(Me),me),Hi=Mt?Ta:br},gr=({detail:E})=>{const{boundsLimited:Ue,boundsIntent:pt}=Hi(E.direction,E.translation);_e(di,Ne=!0,Ne),_e(zn,V=pt,V),_e(Yi,Me=Ue,Me)},ta=({detail:E})=>{const{boundsLimited:Ue}=Hi(E.direction,E.translation);_e(di,Ne=!1,Ne),_e(fi,De=!1,De),_e(zn,V=void 0,V),Yl(E.translation)&&(_e(Yi,Me=Ue,Me),Cn.write()),_e(ho,me=void 0,me),Yn=void 0},Ta=(E,Ue)=>{const pt={target:E,translate:Ue},Tn=td(ir(G),le),Pn=td(ir(Ie),le);let jn=dp(me,pt,{...Te,x:0,y:0},{aspectRatio:q,minSize:Tn,maxSize:Pn});if(jn=i5(jn,{...Te,x:0,y:0},q),!Qe)return{boundsLimited:jn,boundsIntent:jn};let Zn=VR(me,jn,pt,se,{aspectRatio:q,minSize:Tn,maxSize:Pn});return{boundsLimited:Zn,boundsIntent:Zn}},br=(E,Ue)=>{const pt={target:E,translate:Ue},Tn=td(ir(G),le),Pn=td(ir(Ie),le),jn=IR(me,pt,{aspectRatio:q,minSize:Tn});return{boundsLimited:dp(me,pt,{...Te,x:0,y:0},{aspectRatio:q,minSize:Tn,maxSize:Pn}),boundsIntent:jn}},Ja=()=>{Yn="rotate",_e(fi,De=!0,De),_e(ar,Je=Rn(ie),Je)},dl=E=>{_e(di,Ne=!0,Ne),_e(Ei,He=E,He)},pr=E=>{_e(di,Ne=!1,Ne),_e(fi,De=!1,De),_e(Ei,He=E,He),Cn.write(),_e(ar,Je=void 0,Je)};let Oi,_o;const na=()=>{Yn="pan",_o=void 0,_e(fi,De=!0,De),Oi=Rn(ie)},ka=({detail:E})=>{_e(di,Ne=!0,Ne),yr(E)},io=({detail:E})=>{_e(di,Ne=!1,Ne),_e(fi,De=!1,De),(Yl(E.translation)>0||E.scalar!==0)&&(yr(E),Cn.write()),_e(Vo,$e=void 0,$e),Oi=void 0},ia=({detail:{translation:E}})=>{Mt&&(E=Sc(Ut(E))),_o=E,_e(fi,De=!1,De)},yr=({translation:E,scalar:Ue})=>{Mt&&(Ue=1,E=Sc(Ut(E)));const pt=Math.min(Me.width/ie.width,Me.height/ie.height),Tn=Bo(Ut(E),1/pt);let Pn;if(!_o)Pn=ua(Rn(Oi),Sc(Ut(Tn))),Ue!==void 0&&Oo(Pn,1/Ue);else{const jn=Fi(Ut(_o),E);_o=E,Pn=ua(Rn(ie),jn)}_e(Vo,$e=Pn,$e),_e(to,ie=Pn,ie)},Nr=-1,Qa=(E,Ue,pt)=>ol(pt)?1-1/Math.min(E.height/Ue.width,E.width/Ue.height):1-1/Math.min(E.width/Ue.width,E.height/Ue.height),Gr=Ln([Ur,to],([E,Ue],pt)=>{if(!Ue)return;const[Tn,Pn]=E,jn=ao(Ue);pt([zs(qr(rs(Tn,jn),un)),zs(qr(rr(Pn,jn),un))])});B(e,Gr,E=>n(180,mt=E));const Wo=Ln([Hr,Yo,$r,Ai,Ur,Ei],([E,Ue,pt,Tn,Pn,jn],Zn)=>{if(!E)return;const gi=Pn[0],Ti=Pn[1];let ki,si;Ue?(ki=Qa(E,Ti,jn),si=Math.min(gi.width/pt.width,gi.height/pt.height)):(ki=Nr,si=1);const No=[ki,si].map(vo=>
93un(vo));Zn(No)});B(e,Wo,E=>n(29,nn=E));const Uo=Ln([Hr,to,Ur,Ei],([E,Ue,pt,Tn],Pn)=>{if(!E||!Ue)return Pn(0);let jn;const Zn=pt[0],gi=pt[1],Ti=Ue.width,ki=Ue.height,si=ao(Ue),No=ol(Tn)?Ci(E.height,E.width):E,vo=rr(No,si);if(Ti<=vo.width||ki<=vo.height){const Er=vo.width-Zn.width,Po=vo.height-Zn.height;Er===0||Po===0?jn=1:jn=1-Math.min((Ti-Zn.width)/Er,(ki-Zn.height)/Po)}else{const Er=gi.width-vo.width,Po=gi.height-vo.height,Qo=rr({width:Er,height:Po},si);jn=-Math.min((Ti-vo.width)/Qo.width,(ki-vo.height)/Qo.height)}Pn(jn)});B(e,Uo,E=>n(30,Jt=E));const Ca=()=>{Oi=Rn(ie)},lr=E=>{const Ue=ao(Oi);let pt,Tn,Pn;const jn=ol(He)?Ci(ue.height,ue.width):ue,Zn=rr(jn,Ue);if(E>=0){const ki=Zn.width-St[0].width,si=Zn.height-St[0].height;pt=Zn.width-ki*E,Tn=Zn.height-si*E,Pn=rs({width:pt,height:Tn},Ue)}else{const ki=St[1].width-Zn.width,si=St[1].height-Zn.height;pt=Zn.width+ki*-E,Tn=Zn.height+si*-E,Pn=rr({width:pt,height:Tn},Ue)}pt=Pn.width,Tn=Pn.height;const gi=Oi.x+Oi.width*.5-pt*.5,Ti=Oi.y+Oi.height*.5-Tn*.5;_e(to,ie={x:gi,y:Ti,width:pt,height:Tn},ie)},ei=()=>{Yn="zoom",_e(fi,De=!0,De),Ca()},To=E=>{_e(di,Ne=!1,Ne),lr(E)},zt=E=>{lr(E),Cn.write(),_e(di,Ne=!1,Ne),_e(fi,De=!1,De),Oi=void 0};let ko;const Co=()=>{Yn="zoom",!Oi&&(ko=Rn(ie),_e(fi,De=!0,De))},$a=({detail:E})=>{ko&&(_e(di,Ne=!0,Ne),Pa(E))},Pa=E=>{const Ue=Oo(Rn(ko),1/E);_e(Vo,$e=Ue,$e),_e(to,ie=Ue,ie)},qo=({detail:E})=>{ko&&(_e(di,Ne=!1,Ne),_e(fi,De=!1,De),Pa(E),_e(Vo,$e=void 0,$e),ko=void 0,Cn.write())};let mi;const Mr=E=>{const Ue=gm(E,ye,qe);if(Ge&&!Ld(Me,Ue))return;Yn="zoom",_e(fi,De=!0,De),_e(di,Ne=!0,Ne),E.preventDefault(),E.stopPropagation();const pt=$u(E,{fixScrollDirection:je}),Tn=1+pt/100,Pn=Rn(ie),jn=Math.min(ie.width/G.width,ie.height/G.height)===1;if(Lt&&Qe){const ki=qn(ie,ue,He);if(Dn()&&ki&&pt>0&&u){_e(fi,De=!1,De),_e(di,Ne=!1,Ne);const si=ol(He)?jo({height:ue.width,width:ue.height}):jo(ue);if(da(Pn,si)||(clearTimeout(mi),da(Cn.state.crop,si)))return;_e(to,ie=si,ie),Cn.write();return}}let Zn=In(ie);if(Q&&ot!=="selection"&&pt<0&&!jn){const ki=Fi(Ut(Ue),Me),si=Math.min(Me.width/ie.width,Me.height/ie.height),No=Oo(Rn(Me),1.1);Zn=Ld(No,Ue)?xi(Rn(ie),Bo(ki,1/si)):Zn}let Ti=Oo(Rn(ie),Tn,Zn);if(Ad(mt[1],Ti)||(Ti=k0(In(Ti),mt[1])),Ad(Ti,mt[0])||(Ti=k0(In(Ti),mt[0])),da(Pn,Ti,un)){_e(fi,De=!1,De),_e(di,Ne=!1,Ne);return}_e(to,ie=qr(Ti,ki=>un(ki,5)),ie),_e(fi,De=!1,De),_e(di,Ne=!1,Ne),clearTimeout(mi),mi=setTimeout(()=>{Cn.write()},500)},Ma=()=>{qa.set({})};function Ra(E,Ue){let pt={};if(Ue){const Tn=E.width/E.height;Ue.width&&!Ue.height?pt=Ci(Ue.width,Ue.width/Tn):Ue.height&&!Ue.width?pt=Ci(Ue.height*Tn,Ue.height):pt=ir(Ue)}else pt=Ci(E.width,E.height);return`${Math.round(pt.width)} &times; ${Math.round(pt.height)}`}let Rr;const el=hn(0,{precision:1e-4});B(e,el,E=>n(31,yn=E));const Ir=hn();B(e,Ir,E=>n(32,an=E));const Fl=()=>{_e(Wr,ft.crop={maskOpacity:cn,maskMarkupOpacity:cn},ft),Wr.set(ft)},vl=()=>{delete ft.crop,Wr.set(ft)},tl=Ln([no,Ya,_t],([E,Ue,pt],Tn)=>{if(!i)return;const Pn=$l(pt),jn=[...Pn].map(gi=>gi[0]).sort((gi,Ti)=>Si(gi[0])&&!Si(Ti[0])?1:-1).find(gi=>{if(Si(gi)&&Ue){const[Ti,ki]=gi,si=Ue.width===Ti&&Ue.height===ki,No=E===fa(Ti,ki);return si&&No}return gi===E});if(!jn)return Tn(void 0);const Zn=Pn.map(gi=>gi[0]).findIndex(gi=>Si(gi)?Rl(gi,jn):gi===jn);Tn(Zn)});B(e,tl,E=>n(161,Ft=E));const hl=(E,Ue)=>{if(!i||E===-1||E===void 0)return;const pt=$l(Ue)[E][0];return pt?Si(pt)?fa(pt[0],pt[1]):pt:void 0},Sr=Ln([wa,Ui,eo],([E,Ue,pt],Tn)=>{const{rows:Pn,cols:jn,opacity:Zn}=ke(Yn,pt);if(!Ue||Zn<=0)return Tn([]);const{x:gi,y:Ti,width:ki,height:si}=Ue,No=ki/jn,vo=si/Pn,Er=[];for(let Po=1;Po<=Pn-1;Po++){const Qo=Ti+vo*Po;Er.push({id:`image-selection-guide-row-${Po}`,points:[re(gi,Qo),re(gi+ki,Qo)],opacity:Zn,strokeWidth:1,strokeColor:E})}for(let Po=1;Po<=jn-1;Po++){const Qo=gi+No*Po;Er.push({id:`image-selection-guide-col-${Po}`,points:[re(Qo,Ti),re(Qo,Ti+si)],opacity:Zn,strokeWidth:1,strokeColor:E})}Tn(Er)});B(e,Sr,E=>n(146,ae=E));const ml=()=>{mo.update(E=>{const Ue=E.filter(pt=>!/^image\-selection\-guide/.test(pt.id));return ge?[...Ue,...ae]:Ue})},oa=`crop-${Yr()}`;let Ol=on?Ye:"zoom",gl=oa+"-"+Ol,Ia=gl,Ea,Jo;const Ho=hn(X?20:0);B(e,Ho,E=>n(143,pe=E));function x(E){Zo.call(this,e,E)}const we=({detail:E})=>n(5,Ia=E);function Vt(E){vn[E?"unshift":"push"](()=>{Jo=E,n(6,Jo)})}const rt=E=>ug(E);function Dt(E){Ea=E,n(16,Ea)}function Gt(E){Zo.call(this,e,E)}return e.$$set=E=>{"isActive"in E&&Fe(n(0,Sn=E.isActive)),"stores"in E&&n(99,ln=E.stores),"cropImageSelectionCornerStyle"in E&&n(1,sn=E.cropImageSelectionCornerStyle),"cropWillRenderImageSelectionGuides"in E&&n(100,ke=E.cropWillRenderImageSelectionGuides),"cropAutoCenterImageSelectionTimeout"in E&&n(101,Re=E.cropAutoCenterImageSelectionTimeout),"cropEnableZoomMatchImageAspectRatio"in E&&n(102,Lt=E.cropEnableZoomMatchImageAspectRatio),"cropEnableRotateMatchImageAspectRatio"in E&&n(103,fn=E.cropEnableRotateMatchImageAspectRatio),"cropEnableRotationInput"in E&&n(104,on=E.cropEnableRotationInput),"cropEnableZoom"in E&&n(2,En=E.cropEnableZoom),"cropEnableZoomInput"in E&&n(105,bt=E.cropEnableZoomInput),"cropEnableZoomAutoHide"in E&&n(106,Un=E.cropEnableZoomAutoHide),"cropEnableImageSelection"in E&&n(107,Hn=E.cropEnableImageSelection),"cropEnableInfoIndicator"in E&&n(108,$n=E.cropEnableInfoIndicator),"cropEnableZoomTowardsWheelPosition"in E&&n(109,Q=E.cropEnableZoomTowardsWheelPosition),"cropEnableLimitWheelInputToCropSelection"in E&&n(110,Ge=E.cropEnableLimitWheelInputToCropSelection),"cropEnableCenterImageSelection"in E&&n(111,j=E.cropEnableCenterImageSelection),"cropEnableButtonRotateLeft"in E&&n(112,Le=E.cropEnableButtonRotateLeft),"cropEnableButtonRotateRight"in E&&n(113,tt=E.cropEnableButtonRotateRight),"cropEnableButtonFlipHorizontal"in E&&n(114,en=E.cropEnableButtonFlipHorizontal),"cropEnableButtonFlipVertical"in E&&n(115,Xt=E.cropEnableButtonFlipVertical),"cropSelectPresetOptions"in E&&n(116,Ze=E.cropSelectPresetOptions),"cropEnableSelectPreset"in E&&n(117,tn=E.cropEnableSelectPreset),"cropEnableFilterMatchAspectRatio"in E&&n(118,Fn=E.cropEnableFilterMatchAspectRatio),"cropSelectPresetFilter"in E&&n(97,K=E.cropSelectPresetFilter),"cropEnableButtonToggleCropLimit"in 
93E&&n(119,J=E.cropEnableButtonToggleCropLimit),"cropWillRenderTools"in E&&n(120,xe=E.cropWillRenderTools),"cropWillRenderInfoIndicator"in E&&n(121,it=E.cropWillRenderInfoIndicator),"cropActiveTransformTool"in E&&n(122,Ye=E.cropActiveTransformTool),"cropMinimizeToolbar"in E&&n(123,ct=E.cropMinimizeToolbar),"cropInteractionFocus"in E&&n(124,ot=E.cropInteractionFocus),"cropRotationRange"in E&&n(3,Ct=E.cropRotationRange),"cropMaskOpacity"in E&&n(125,cn=E.cropMaskOpacity),"locale"in E&&n(4,Qt=E.locale),"cropFormatIconSelectPreset"in E&&n(126,_n=E.cropFormatIconSelectPreset),"cropFormatIconCropBoundary"in E&&n(127,Bt=E.cropFormatIconCropBoundary)},e.$$.update=()=>{e.$$.dirty[0]&8192|e.$$.dirty[4]&1&&Ri.set(ot==="selection"&&ge),e.$$.dirty[3]&8388608&&n(134,i=Ze&&Array.isArray(Ze)&&Ze.length),e.$$.dirty[3]&8388608|e.$$.dirty[4]&1024&&_t.set(i?Ze:[]),e.$$.dirty[0]&8192|e.$$.dirty[4]&1048576&&ge&&ul.set(1,{hard:!X}),e.$$.dirty[0]&8192&&Qr.set(!ge),e.$$.dirty[0]&8192&&hr.set(!ge),e.$$.dirty[0]&8192&&ge&&Ko.set(!0),e.$$.dirty[4]&2097152&&n(129,m=U.layoutMode==="overlay"),e.$$.dirty[3]&16777216|e.$$.dirty[4]&32&&n(133,M=tn&&!m),e.$$.dirty[0]&16384|e.$$.dirty[5]&2&&n(142,s=Te&&Me&&Md(Te,Me)),e.$$.dirty[4]&262144|e.$$.dirty[5]&2&&n(140,c=!!(Me&&s)),e.$$.dirty[4]&327680|e.$$.dirty[5]&2&&n(138,u=c&&da(Me,s,E=>un(E,5))),e.$$.dirty[0]&32784|e.$$.dirty[3]&209190928|e.$$.dirty[4]&2115072|e.$$.dirty[5]&2040&&n(12,o=wt&&xe([Le&&["Button","rotate-left",{label:Qt.cropLabelButtonRotateLeft,labelClass:"PinturaToolbarContentWide",icon:Qt.cropIconButtonRotateLeft,onclick:()=>{An(-Math.PI/2),Cn.write()}}],tt&&["Button","rotate-right",{label:Qt.cropLabelButtonRotateRight,labelClass:"PinturaToolbarContentWide",icon:Qt.cropIconButtonRotateRight,onclick:()=>{An(Math.PI/2),Cn.write()}}],en&&["Button","flip-horizontal",{label:Qt.cropLabelButtonFlipHorizontal,labelClass:"PinturaToolbarContentWide",icon:Qt.cropIconButtonFlipHorizontal,onclick:()=>{ol(He)?_e(wo,Xe=!Xe,Xe):_e(Ki,nt=!nt,nt),Cn.write()}}],Xt&&["Button","flip-vertical",{label:Qt.cropLabelButtonFlipVertical,labelClass:"PinturaToolbarContentWide",icon:Qt.cropIconButtonFlipVertical,onclick:()=>{ol(He)?_e(Ki,nt=!nt,nt):_e(wo,Xe=!Xe,Xe),Cn.write()}}],M&&i&&[K===!1?"Dropdown":DR,"select-preset",{icon:ji(Qt,hl(Ft,We)),label:Lo(Qt.cropLabelSelectPreset,Qt,hl(Ft,We)),labelClass:"PinturaToolbarContentWide",options:We,filter:K,onfilterchange:ni,selectedIndex:Ft,onchange:({value:E})=>{Si(E)?(_e(no,q=fa(E[0],E[1]),q),_e(Ya,gt=my(E),gt)):_e(no,q=E,q),u&&Ma(),Cn.write()},optionMapper:E=>{let Ue=!1;const pt=Si(E.value)?E.value[0]/E.value[1]:E.value;if(pt){const Tn=vc(ue,He,pt);Ue=Tn.width<G.width||Tn.height<G.height}return E.icon=xR(E.value,{bounds:14}),{...E,disabled:Ue}}}],J&&["Dropdown","select-crop-limit",{icon:mr(Qt,Qe),label:Qt.cropLabelCropBoundary,labelClass:"PinturaToolbarContentWide",onchange:({value:E})=>{_e(Yo,Qe=E,Qe),Cn.write()},options:[[!0,Qt.cropLabelCropBoundaryEdge,{icon:mr(Qt,!0)}],[!1,Qt.cropLabelCropBoundaryNone,{icon:mr(Qt,!1)}]]}]].filter(Boolean),U,()=>Gn.set({})).filter(Boolean)),e.$$.dirty[0]&12288|e.$$.dirty[3]&1073741824|e.$$.dirty[4]&2097184&&_e(Pr,dt=ge&&ct!=="never"&&(ct==="always"||U.verticalSpace==="short"||m)?o.map(([E,Ue,pt])=>Array.isArray(pt)?[E,Ue,pt]:[E,Ue,{...pt,hideLabel:!0}]):[],dt),e.$$.dirty[5]&16&&n(25,r=Qe?0:Nr),e.$$.dirty[0]&16384|e.$$.dirty[5]&4&&n(135,a=Te&&re(-(qe.x-Te.x),-(qe.y-Te.y))),e.$$.dirty[4]&16779264&&n(136,l=Se&&a&&re(ju(Se.x+Se.width*.5+a.x),ju(Se.y+Se.height*.5+a.y))),e.$$.dirty[5]&1&&n(139,f=me!=null),e.$$.dirty[0]&16384|e.$$.dirty[4]&262144&&n(141,d=Te&&s&&(s.height===Te.height||s.width===Te.width)),e.$$.dirty[4]&1610743808&&n(137,g=!d&&le<1&&N<1),e.$$.dirty[4]&122880&&n(9,p=c&&!f&&(!u||g)),e.$$.dirty[3]&32768|e.$$.dirty[4]&268435488&&n(11,y=$n&&!!ie&&!m),e.$$.dirty[3]&268435456&&n(24,w=it?!0:void 0),e.$$.dirty[0]&2048|e.$$.dirty[3]&268435456|e.$$.dirty[4]&402653184&&n(23,_=y&&it?it(ie,gt):y&&Ra(ie,gt)),e.$$.dirty[4]&16779264&&n(8,R=Se&&a&&{x:Se.x+a.x,y:Se.y+a.y,width:Se.width,height:Se.height}),e.$$.dirty[0]&256|e.$$.dirty[3]&16384|e.$$.dirty[4]&32&&n(22,P=Hn&&!!R&&!m),e.$$.dirty[3]&262400|e.$$.dirty[4]&67112960&&n(10,C=j&&!!l&&!Re&&!Mt),e.$$.dirty[0]&512|e.$$.dirty[3]&256|e.$$.dirty[4]&33554448&&p&&Re&&!De&&(clearTimeout(Rr),n(128,Rr=setTimeout(
93Ma,Re))),e.$$.dirty[4]&33554448&&De&&clearTimeout(Rr),e.$$.dirty[0]&1536|e.$$.dirty[4]&1048576&&el.set(C&&p?1:0,{hard:X===!1}),e.$$.dirty[4]&1052672&&Ir.set(l,{hard:X===!1}),e.$$.dirty[0]&8192|e.$$.dirty[4]&8388608&&(ge&&!be?Fl():vl()),e.$$.dirty[4]&4194304&&ae&&ml(),e.$$.dirty[4]&2097152&&n(132,I=U.verticalSpace!=="short"),e.$$.dirty[3]&1073741824|e.$$.dirty[4]&288&&n(21,T=ct==="never"&&!m||I&&ct!=="always"),e.$$.dirty[0]&4|e.$$.dirty[3]&4096&&n(131,v=En&&bt),e.$$.dirty[3]&8192|e.$$.dirty[4]&384&&n(130,H=Un?I&&v:v),e.$$.dirty[3]&2048|e.$$.dirty[4]&64&&n(20,Y=on||H),e.$$.dirty[4]&64&&(H||n(5,Ia=gl)),e.$$.dirty[0]&32&&n(19,Z={name:oa,selected:Ia}),e.$$.dirty[0]&16|e.$$.dirty[3]&2048|e.$$.dirty[4]&64&&n(7,W=[on&&{id:oa+"-rotation",label:Qt.cropLabelTabRotation},H&&{id:oa+"-zoom",label:Qt.cropLabelTabZoom}].filter(Boolean)),e.$$.dirty[0]&128&&n(18,$=W.map(E=>E.id)),e.$$.dirty[0]&64|e.$$.dirty[4]&32&&Jo&&!Jo.children.length&&m&&Jo.dispatchEvent(new CustomEvent("measure",{detail:Jo.rect})),e.$$.dirty[0]&8192|e.$$.dirty[4]&1048576&&X&&Ho.set(ge?0:20),e.$$.dirty[4]&524288&&n(17,S=pe?`translateY(${pe}px)`:"none")},[Sn,sn,En,Ct,Qt,Ia,Jo,W,R,p,C,y,o,ge,Te,He,Ea,S,$,Z,Y,T,P,_,w,r,ye,Zt,yt,nn,Jt,yn,an,et,ri,Gn,Ri,ai,ui,_t,_i,fi,di,dr,So,hi,zr,Vr,Pr,Wr,Ki,wo,Ei,_a,Ya,Yi,ho,zn,Ui,Vo,ar,to,$r,Ai,Ur,no,Yo,Hr,fl,go,ea,gr,ta,Ja,dl,pr,na,ka,io,ia,Gr,Wo,Uo,ei,To,zt,Co,$a,qo,Mr,Ma,el,Ir,tl,Sr,oa,Ho,K,Tt,ln,ke,Re,Lt,fn,on,bt,Un,Hn,$n,Q,Ge,j,Le,tt,en,Xt,Ze,tn,Fn,J,xe,it,Ye,ct,ot,cn,_n,Bt,Rr,m,H,v,I,M,i,a,l,g,u,f,c,d,s,pe,X,U,ae,be,Se,De,Mt,gt,ie,N,le,me,Me,qe,ue,Qe,G,Ft,We,Xe,nt,wt,x,we,Vt,rt,Dt,Gt]}class QR extends gn{constructor(t){super(),mn(this,t,JR,KR,rn,{name:98,isActive:0,stores:99,cropImageSelectionCornerStyle:1,cropWillRenderImageSelectionGuides:100,cropAutoCenterImageSelectionTimeout:101,cropEnableZoomMatchImageAspectRatio:102,cropEnableRotateMatchImageAspectRatio:103,cropEnableRotationInput:104,cropEnableZoom:2,cropEnableZoomInput:105,cropEnableZoomAutoHide:106,cropEnableImageSelection:107,cropEnableInfoIndicator:108,cropEnableZoomTowardsWheelPosition:109,cropEnableLimitWheelInputToCropSelection:110,cropEnableCenterImageSelection:111,cropEnableButtonRotateLeft:112,cropEnableButtonRotateRight:113,cropEnableButtonFlipHorizontal:114,cropEnableButtonFlipVertical:115,cropSelectPresetOptions:116,cropEnableSelectPreset:117,cropEnableFilterMatchAspectRatio:118,cropSelectPresetFilter:97,cropEnableButtonToggleCropLimit:119,cropWillRenderTools:120,cropWillRenderInfoIndicator:121,cropActiveTransformTool:122,cropMinimizeToolbar:123,cropInteractionFocus:124,cropRotationRange:3,cropMaskOpacity:125,locale:4,cropFormatIconSelectPreset:126,cropFormatIconCropBoundary:127},null,[-1,-1,-1,-1,-1,-1,-1,-1])}get name(){return this.$$.ctx[98]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get stores(){return this.$$.ctx[99]}set stores(t){this.$$set({stores:t}),F()}get cropImageSelectionCornerStyle(){return this.$$.ctx[1]}set cropImageSelectionCornerStyle(t){this.$$set({cropImageSelectionCornerStyle:t}),F()}get cropWillRenderImageSelectionGuides(){return this.$$.ctx[100]}set cropWillRenderImageSelectionGuides(t){this.$$set({cropWillRenderImageSelectionGuides:t}),F()}get cropAutoCenterImageSelectionTimeout(){return this.$$.ctx[101]}set cropAutoCenterImageSelectionTimeout(t){this.$$set({cropAutoCenterImageSelectionTimeout:t}),F()}get cropEnableZoomMatchImageAspectRatio(){return this.$$.ctx[102]}set cropEnableZoomMatchImageAspectRatio(t){this.$$set({cropEnableZoomMatchImageAspectRatio:t}),F()}get cropEnableRotateMatchImageAspectRatio(){return this.$$.ctx[103]}set cropEnableRotateMatchImageAspectRatio(t){this.$$set({cropEnableRotateMatchImageAspectRatio:t}),F()}get cropEnableRotationInput(){return this.$$.ctx[104]}set cropEnableRotationInput(t){this.$$set({cropEnableRotationInput:t}),F()}get cropEnableZoom(){return this.$$.ctx[2]}set cropEnableZoom(t){this.$$set({cropEnableZoom:t}),F()}get cropEnableZoomInput(){return this.$$.ctx[105]}set cropEnableZoomInput(t){this.$$set({cropEnableZoomInput:t}),F()}get cropEnableZoomAutoHide(){return this.$$.ctx[106]}set cropEnableZoomAutoHide(t){this.$$set({cropEnableZoomAutoHide:t}),F()}get cropEnableImageSelection(){return this.$$.ctx[107]}set cropEnableImageSelection(t){this.$$set({cropEnableImageSelection:t}),F()}get cropEnableInfoIndicator(){return this.$$.ctx[108]}set cropEnableInfoIndicator(t){this.$$set({cropEnableInfoIndicator:t}),F()}get cropEnableZoomTowardsWheelPosition(){return this.$$.ctx[109]}set cropEnableZoomTowardsWheelPosition(t){this.$$set({cropEnableZoomTowardsWheelPosition:t}),F()}get cropEnableLimitWheelInputToCropSelection(){return this.$$.ctx[110]}set cropEnableLimitWheelInputToCropSelection(t){this.$$set({cropEnableLimitWheelInputToCropSelection:t}),F()}get cropEnableCenterImageSelection(){return this.$$.ctx[111]}set cropEnableCenterImageSelection(t){this.$$set({cropEnableCenterImageSelection:t}),F()}get cropEnableButtonRotateLeft(){return this.$$.ctx[112]}set cropEnableButtonRotateLeft(t){this.$$set({cropEnableButtonRotateLeft:t}),F()}get cropEnableButtonRotateRight(){return this.$$.ctx[113]}set cropEnableButtonRotateRight(t){this.$$set({cropEnableButtonRotateRight:t}),F()}get cropEnableButtonFlipHorizontal(){return this.$$.ctx[114]}set cropEnableButtonFlipHorizontal(t){this.$$set({cropEnableButtonFlipHorizontal:t}),F()}get cropEnableButtonFlipVertical(){return this.$$.ctx[115]}set cropEnableButtonFlipVertical(t){this.$$set({cropEnableButtonFlipVertical:t}),F()}get cropSelectPresetOptions(){return this.$$.ctx[116]}set cropSelectPresetOptions(t){this.$$set({cropSelectPresetOptions:t}),F()}get cropEnableSelectPreset(){return this.$$.ctx[117]}set cropEnableSelectPreset(t){this.$$set({cropEnableSelectPreset:t}),F()}get cropEnableFilterMatchAspectRatio(){return this.$$.ctx[118]}set cropEnableFilterMatchAspectRatio(t){this.$$set({cropEnableFilterMatchAspectRatio:t}),F()}get cropSelectPresetFilter(){return this.$$.ctx[97]}set cropSelectPresetFilter(t){this.$$set({cropSelectPresetFilter:t}),F()}get cropEnableButtonToggleCropLimit(){return this.$$.ctx[119]}set cropEnableButtonToggleCropLimit(t){this.$$set({cropEnableButtonToggleCropLimit:t}),F()}get cropWillRenderTools(){return this.$$.ctx[120]}set cropWillRenderTools(t){this.$$set({cropWillRenderTools:t}),F()}get cropWillRenderInfoIndicator(){return this.$$.ctx[121]}set cropWillRenderInfoIndicator(t){this.$$set({cropWillRenderInfoIndicator:t}),F()}get cropActiveTransformTool(){return this.$$.ctx[122]}set cropActiveTransformTool(t){this.$$set({cropActiveTransformTool:t}),F()}get cropMinimizeToolbar(){return this.$$.ctx[123]}set cropMinimizeToolbar(t){this.$$set({cropMinimizeToolbar:t}),F()}get cropInteractionFocus(){return this.$$.ctx[124]}set cropInteractionFocus(t){this.$$set({cropInteractionFocus:t}),F()}get cropRotationRange(){return this.$$.ctx[3]}set cropRotationRange(t){this.$$set({cropRotationRange:t}),F()}get cropMaskOpacity(){return this.$$.ctx[125]}set cropMaskOpacity(t){this.$$set({cropMaskOpacity:t}),F()}get locale(){return this.$$.ctx[4]}set locale(t){this.$$set({locale:t}),F()}get cropFormatIconSelectPreset(){return this.$$.ctx[126]}set cropFormatIconSelectPreset(t){this.$$set({cropFormatIconSelectPreset:t}),F()}get cropFormatIconCropBoundary(){return this.$$.ctx[127]}set cropFormatIconCropBoundary(t){this.$$set({cropFormatIconCropBoundary:t}),F()}}var $R={util:["crop",QR]};function eI(e){let t,n,i=e[77],o,r,a=(xn(e[77].label)?e[77].label(e[2]):e[77].label)+"",l,s,c;function u(...m){return e[51](e[77],...m)}const f=()=>e[52](n,i),d=()=>e[52](null,i);return{c(){t=fe("div"),n=fe("div"),o=ut(),r=fe("span"),l=bi(a),k(n,"class",C4),k(t,"slot","o
93ption"),k(t,"class","PinturaFilterOption")},m(m,g){te(m,t,g),Ae(t,n),f(),Ae(t,o),Ae(t,r),Ae(r,l),s||(c=[Pe(n,"measure",u),wn(Fo.call(null,n))],s=!0)},p(m,g){e=m,i!==e[77]&&(d(),i=e[77],f()),g[0]&4|g[2]&32768&&a!==(a=(xn(e[77].label)?e[77].label(e[2]):e[77].label)+"")&&vi(l,a)},d(m){m&&ee(t),d(),s=!1,On(c)}}}function tI(e){let t,n;return t=new El({props:{locale:e[2],layout:"row",options:e[3],selectedIndex:e[12],onchange:e[32],$$slots:{option:[eI,({option:i})=>({77:i}),({option:i})=>[0,0,i?32768:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&4&&(r.locale=i[2]),o[0]&8&&(r.options=i[3]),o[0]&4096&&(r.selectedIndex=i[12]),o[0]&1028|o[2]&98304&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function nI(e){let t,n,i,o,r,a,l,s;function c(m){e[54](m)}function u(m){e[55](m)}function f(m){e[56](m)}let d={elasticity:e[13]*e[19],onscroll:e[53],$$slots:{default:[tI]},$$scope:{ctx:e}};return e[4]!==void 0&&(d.maskFeatherStartOpacity=e[4]),e[5]!==void 0&&(d.maskFeatherEndOpacity=e[5]),e[6]!==void 0&&(d.maskFeatherSize=e[6]),n=new Ka({props:d}),vn.push(()=>Cr(n,"maskFeatherStartOpacity",c)),vn.push(()=>Cr(n,"maskFeatherEndOpacity",u)),vn.push(()=>Cr(n,"maskFeatherSize",f)),n.$on("measure",e[57]),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"slot","footer"),Ee(t,"transform",e[11])},m(m,g){te(m,t,g),ve(n,t,null),a=!0,l||(s=[Pe(t,"transitionend",e[30]),Pe(t,"measure",e[58]),wn(Fo.call(null,t,{observePosition:!0}))],l=!0)},p(m,g){const p={};g[0]&8192&&(p.elasticity=m[13]*m[19]),g[0]&128&&(p.onscroll=m[53]),g[0]&5132|g[2]&65536&&(p.$$scope={dirty:g,ctx:m}),!i&&g[0]&16&&(i=!0,p.maskFeatherStartOpacity=m[4],Dr(()=>i=!1)),!o&&g[0]&32&&(o=!0,p.maskFeatherEndOpacity=m[5],Dr(()=>o=!1)),!r&&g[0]&64&&(r=!0,p.maskFeatherSize=m[6],Dr(()=>r=!1)),n.$set(p),g[0]&2048&&Ee(t,"transform",m[11])},i(m){a||(L(n.$$.fragment,m),a=!0)},o(m){z(n.$$.fragment,m),a=!1},d(m){m&&ee(t),Oe(n),l=!1,On(s)}}}function iI(e){let t,n;return t=new Hs({props:{$$slots:{footer:[nI]},$$scope:{ctx:e}}}),t.$on("measure",e[59]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16380|o[2]&65536&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}let C4="PinturaFilterPreview";function oI(e,t,n){let i,o,r,a,l,s,c,u,f=qt,d=()=>(f(),f=Do(W,Re=>n(43,u=Re)),W),m,g,p,y,w,_,P,C,R,I=qt,M=()=>(I(),I=Do(Z,Re=>n(49,R=Re)),Z),T,v,H;e.$$.on_destroy.push(()=>f()),e.$$.on_destroy.push(()=>I());const Y="filter";let{isActive:Z}=t;M();let{isActiveFraction:W}=t;d();let{stores:$}=t,{locale:S}=t,{filterFunctions:pe}=t,{filterOptions:ge}=t;const de=Qn("elasticityMultiplier");B(e,de,Re=>n(13,H=Re));const{history:Fe,interfaceImages:X,stageRectBase:U,utilRect:ae,animation:be,scrollElasticity:ft,imageSize:Se,imagePreview:De,imageCropRect:Mt,imageRotation:gt,imageFlipX:ie,imageFlipY:N,imageBackgroundColor:le,imageGamma:Te,imageColorMatrix:me,allowPan:Me,allowZoom:qe,allowZoomControls:Ne,allowPlayPause:mt}=$;B(e,X,Re=>n(60,m=Re)),B(e,U,Re=>n(48,C=Re)),B(e,ae,Re=>n(47,P=Re)),B(e,be,Re=>n(50,T=Re)),B(e,Se,Re=>n(62,p=Re)),B(e,De,Re=>n(42,c=Re)),B(e,le,Re=>n(61,g=Re)),B(e,Te,Re=>n(44,y=Re)),B(e,me,Re=>n(40,l=Re));const ue=(Re,Lt)=>{if(!Re||!Re.filter||!Lt)return 0;const fn=Re.filter;return Lt.findIndex(([on])=>{if(!pe[on])return!1;const En=pe[on]();return Rl(En,fn)})},He=ht({});B(e,He,Re=>n(46,_=Re));const Qe=(Re,Lt)=>_e(He,_[Re.value]=Lt,_),G=Ln(He,Re=>{if(!Re[void 0])return;const Lt=Re[void 0];return v&&qu(v,Lt)?v:ir(Lt)});B(e,G,Re=>n(63,v=Re));const je=Ln([Z,G,Mt,Se,gt,ie,N],([Re,Lt,fn,on,En,bt,Un],Hn)=>{if(!Re||!Lt||!on)return w;const $n=jo(on),Q=In($n),Ge=Jm(on,fn,En),j=In(Ge),Le=Fi(Ut(Q),j),tt=Sc(Ut(Le)),en=Math.max(Lt.width/fn.width,Lt.height/fn.height);Hn({origin:tt,translation:Le,rotation:{x:Un?Math.PI:0,y:bt?Math.PI:0,z:En},scale:en})});B(e,je,Re=>n(45,w=Re));const ye=Re=>({origin:Ut(Re.origin),translation:Ut(Re.translation),rotation:{...Re.rotation},scale:Re.scale}),$e=hn(T?20:0);B(e,$e,Re=>n(39,a=Re));let St;const Je={},q=Re=>{Re.target.className===C4&&n(36,St=Object.keys(Je).reduce((Lt,fn)=>{const on=Je[fn],En=getComputedStyle(on),bt=["top-left","top-right","bottom-left","bottom-right"].map(Un=>En.getPropertyValue(`border-${Un}-radius`)).map(QS).map(Un=>Un*1.25);return Lt[fn]=bt,Lt},{}))};let Ie,se,V,dt={x:0,y:0},Ft,We,Xe;const nt=ht([]);B(e,nt,Re=>n(41,s=Re));const wt=Re=>{const Lt={...Re,data:c,size:p,offset:{...Re.offset},mask:{...Re.mask},backgroundColor:g};
93return Lt.opacity=u,Lt.offset.y+=a,Lt.mask.y+=a,Lt.id="filter",Lt},Zt=()=>m.filter(Re=>Re.id!=="filter"),yt=({value:Re})=>{_e(me,l={...l,filter:xn(pe[Re])?pe[Re]():void 0},l),Fe.write()};Jr(()=>{X.set([])});const nn=(Re,Lt)=>Qe(Re,Lt.detail);function Jt(Re,Lt){vn[Re?"unshift":"push"](()=>{Je[Lt.value]=Re,n(10,Je)})}const yn=Re=>n(7,dt=Re);function an(Re){Ie=Re,n(4,Ie)}function Tt(Re){se=Re,n(5,se)}function Sn(Re){V=Re,n(6,V)}const ln=Re=>n(8,Ft=Re.detail),sn=Re=>n(9,Xe=Re.detail);function ke(Re){Zo.call(this,e,Re)}return e.$$set=Re=>{"isActive"in Re&&M(n(0,Z=Re.isActive)),"isActiveFraction"in Re&&d(n(1,W=Re.isActiveFraction)),"stores"in Re&&n(34,$=Re.stores),"locale"in Re&&n(2,S=Re.locale),"filterFunctions"in Re&&n(35,pe=Re.filterFunctions),"filterOptions"in Re&&n(3,ge=Re.filterOptions)},e.$$.update=()=>{if(e.$$.dirty[1]&262144&&Me.set(R),e.$$.dirty[1]&262144&&qe.set(R),e.$$.dirty[1]&262144&&Ne.set(R),e.$$.dirty[1]&262144&&R&&mt.set(!1),e.$$.dirty[0]&8&&n(38,i=$l(ge)),e.$$.dirty[1]&640&&n(12,o=ue(l,i)),e.$$.dirty[1]&786432&&T&&$e.set(R?0:20),e.$$.dirty[0]&512|e.$$.dirty[1]&458752&&R&&P&&C&&Xe&&n(37,We={x:C.x-P.x,y:C.y-P.y+Xe.y}),e.$$.dirty[0]&496|e.$$.dirty[1]&58096&&w&&We&&dt&&Ft&&St){const Lt=We.x+Ft.x+dt.x,fn=We.y,on=Ft.x+We.x,En=on+Ft.width;nt.set(i.map(([bt],Un)=>{const Hn=_[bt],$n=dt.x+Hn.x,Q=$n+Hn.width;if(Q<0||$n>Ft.width)return!1;const Ge=Lt+Hn.x,j=fn+Hn.y,Le=ye(w);Le.offset=re(Hn.width*.5+Ge,Hn.height*.5+j);let tt=0,en=0;Le.maskOpacity=1,Le.mask=Li(Ge+tt,j,Hn.width+en,Hn.height),Le.maskFeather=[1,0,1,0,1,En,1,En],$n<V&&Ie<1&&(Le.maskFeather[0]=Ie,Le.maskFeather[1]=on,Le.maskFeather[2]=1,Le.maskFeather[3]=on+V),Q>Ft.width-V&&se<1&&(Le.maskFeather[4]=se,Le.maskFeather[5]=En-V,Le.maskFeather[6]=1,Le.maskFeather[7]=En),Le.maskCornerRadius=St[bt];let Xt=l&&Object.keys(l).filter(Ze=>Ze!="filter").map(Ze=>l[Ze])||[];return xn(pe[bt])&&Xt.push(pe[bt]()),Le.colorMatrix=Xt.length?Jd(Xt):void 0,Le.gamma=y,Le}).filter(Boolean))}if(e.$$.dirty[1]&7424)if(u>0&&s){const Re=[...Zt(),...s.map(wt)];X.set(Re)}else X.set(Zt());e.$$.dirty[1]&256&&n(11,r=a?`translateY(${a}px)`:"none")},[Z,W,S,ge,Ie,se,V,dt,Ft,Xe,Je,r,o,H,de,X,U,ae,be,ft,Se,De,le,Te,me,He,Qe,G,je,$e,q,nt,yt,Y,$,pe,St,We,i,a,l,s,c,u,y,w,_,P,C,R,T,nn,Jt,yn,an,Tt,Sn,ln,sn,ke]}class rI extends gn{constructor(t){super(),mn(this,t,oI,iI,rn,{name:33,isActive:0,isActiveFraction:1,stores:34,locale:2,filterFunctions:35,filterOptions:3},null,[-1,-1,-1])}get name(){return this.$$.ctx[33]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get stores(){return this.$$.ctx[34]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[2]}set locale(t){this.$$set({locale:t}),F()}get filterFunctions(){return this.$$.ctx[35]}set filterFunctions(t){this.$$set({filterFunctions:t}),F()}get filterOptions(){return this.$$.ctx[3]}set filterOptions(t){this.$$set({filterOptions:t}),F()}}var aI={util:["filter",rI]};function Tp(e){let t,n,i,o;t=new Ka({props:{elasticity:e[6]*e[9],class:"PinturaControlListScroller",$$slots:{default:[sI]},$$scope:{ctx:e}}});const r=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[4]},e[5]];let a={$$slots:{default:[cI,({panel:l})=>({44:l}),({panel:l})=>[0,l?8192:0]]},$$scope:{ctx:e}};for(let l=0;l<r.length;l+=1)a=wi(a,r[l]);return i=new th({props:a}),{c(){Ve(t.$$.fragment),n=ut(),Ve(i.$$.fragment)},m(l,s){ve(t,l,s),te(l,n,s),ve(i,l,s),o=!0},p(l,s){const c={};s[0]&64&&(c.elasticity=l[6]*l[9]),s[0]&38|s[1]&32768&&(c.$$scope={dirty:s,ctx:l}),t.$set(c);const u=s[0]&48?fo(r,[r[0],r[1],s[0]&16&&{panels:l[4]},s[0]&32&&yo(l[5])]):{};s[0]&128|s[1]&40960&&(u.$$scope={dirty:s,ctx:l}),i.$set(u)},i(l){o||(L(t.$$.fragment,l),L(i.$$.fragment,l),o=!0)},o(l){z(t.$$.fragment,l),z(i.$$.fragment,l),o=!1},d(l){l&&ee(n),Oe(t,l),Oe(i,l)}}}function lI(e){let t,n=e[45].label+"",i;return{c(){t=fe("span"),i=bi(n)},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[1]&16384&&n!==(n=o[45].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function sI(e){let t,n;const i=[{class:"PinturaControlList"},{tabs:e[1]},e[5]];let o={$$slots:{default:[lI,({tab:r})=>({45:r}),({tab:r})=>[0,r?16384:0]]},$$scope:{ctx:e}};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new eh({props:o}),t.$on("select",e[24]),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&34?fo(i,[i[0],a[0]&2&&{tabs:r[1]},a[0]&32&&yo(r[5])]):{};a[1]&49152&&(l.$$scope={dirty:a,ctx:r}),t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function cI(e){let t,n;const i=[e[7][e[44]]];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new dg({props:o}
93),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&128|a[1]&8192?fo(i,[yo(r[7][r[44]])]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){Oe(t,r)}}}function uI(e){let t,n,i=e[5]&&Tp(e);return{c(){t=fe("div"),i&&i.c(),k(t,"slot","footer"),Ee(t,"transform",e[3])},m(o,r){te(o,t,r),i&&i.m(t,null),n=!0},p(o,r){o[5]?i?(i.p(o,r),r[0]&32&&L(i,1)):(i=Tp(o),i.c(),L(i,1),i.m(t,null)):i&&(Et(),z(i,1,1,()=>{i=null}),At()),r[0]&8&&Ee(t,"transform",o[3])},i(o){n||(L(i),n=!0)},o(o){z(i),n=!1},d(o){o&&ee(t),i&&i.d()}}}function fI(e){let t,n;return t=new Hs({props:{$$slots:{footer:[uI]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&254|o[1]&32768&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function dI(e,t,n){let i,o,r,a,l,s,c,u,f=qt,d=()=>(f(),f=Do(P,me=>n(21,u=me)),P),m,g,p,y;e.$$.on_destroy.push(()=>f());const w="finetune";let{stores:_}=t,{isActive:P}=t;d();let{locale:C={}}=t,{finetuneControlConfiguration:R}=t,{finetuneOptions:I}=t,{finetuneNudgePrecision:M=void 0}=t;const{history:T,animation:v,scrollElasticity:H,rangeInputElasticity:Y,imageColorMatrix:Z,imageConvolutionMatrix:W,imageGamma:$,imageVignette:S,imageNoise:pe,allowPan:ge,allowZoom:de,allowZoomControls:Fe,allowPlayPause:X}=_;B(e,v,me=>n(22,m=me));const U={imageColorMatrix:Z,imageConvolutionMatrix:W,imageGamma:$,imageVignette:S,imageNoise:pe},ae=Qn("elasticityMultiplier");B(e,ae,me=>n(6,p=me));const be=`finetune-${Yr()}`,ft=ht({});B(e,ft,me=>n(23,g=me));const Se=ht({});B(e,Se,me=>n(7,y=me));const De=(me,Me)=>{me.update(qe=>{const Ne={};return Me.forEach(mt=>{qe[mt]&&(Ne[mt]=qe[mt])}),Ne})},Mt=()=>{_e(Se,y=Object.keys(g).reduce((me,Me)=>{const{base:qe,min:Ne,max:mt,getLabel:ue,getStore:He,setValue:Qe=(ye,$e)=>ye.set($e)}=R[Me],G=He(U),je=g[Me]!=null?g[Me]:qe;return me[Me]={base:qe,min:Ne,max:mt,value:je,valueLabel:ue?ue(je,Ne,mt,mt-Ne):Math.round(100*je),oninputmove:ye=>{Qe(G,ye),G===Z&&De(G,l)},oninputend:ye=>{Qe(G,ye),G===Z&&De(G,l),T.write()},elasticity:p*Y,labelReset:C.labelReset,nudgeMultiplier:M},me},{}),y)};let gt=[];const ie=me=>{gt&&gt.forEach(Me=>Me()),gt=a.map(Me=>{const{getStore:qe,getValue:Ne=Nn}=me[Me];return qe(U).subscribe(ue=>{const He=ue!=null?Ne(ue):ue;_e(ft,g={...g,[Me]:He},g)})})},N=hn(m?20:0);B(e,N,me=>n(20,c=me));const le=({detail:me})=>n(2,o=me);function Te(me){Zo.call(this,e,me)}return e.$$set=me=>{"stores"in me&&n(15,_=me.stores),"isActive"in me&&d(n(0,P=me.isActive)),"locale"in me&&n(16,C=me.locale),"finetuneControlConfiguration"in me&&n(17,R=me.finetuneControlConfiguration),"finetuneOptions"in me&&n(18,I=me.finetuneOptions),"finetuneNudgePrecision"in me&&n(19,M=me.finetuneNudgePrecision)},e.$$.update=()=>{e.$$.dirty[0]&2097152&&ge.set(u),e.$$.dirty[0]&2097152&&de.set(u),e.$$.dirty[0]&2097152&&Fe.set(u),e.$$.dirty[0]&2097152&&u&&X.set(!0),e.$$.dirty[0]&327680&&n(1,i=I?I.map(([me,Me])=>({id:me,label:xn(Me)?Me(C):Me})):[]),e.$$.dirty[0]&2&&n(2,o=i.length?i[0].id:void 0),e.$$.dirty[0]&4&&n(5,r=o&&{name:be,selected:o}),e.$$.dirty[0]&2&&n(4,a=i.map(me=>me.id)),e.$$.dirty[0]&131072&&(l=[...Object.keys(R||{}),"filter"]),e.$$.dirty[0]&131072&&R&&ie(R),e.$$.dirty[0]&8519680&&R&&g&&Mt(),e.$$.dirty[0]&6291456&&m&&N.set(u?0:20),e.$$.dirty[0]&1048576&&n(3,s=c?`translateY(${c}px)`:"none")},[P,i,o,s,a,r,p,y,v,H,ae,ft,Se,N,w,_,C,R,I,M,c,u,m,g,le,Te]}class hI extends gn{constructor(t){super(),mn(this,t,dI,fI,rn,{name:14,stores:15,isActive:0,locale:16,finetuneControlConfiguration:17,finetuneOptions:18,finetuneNudgePrecision:19},null,[-1,-1])}get name(){return this.$$.ctx[14]}get stores(){return this.$$.ctx[15]}set stores(t){this.$$set({stores:t}),F()}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get locale(){return this.$$.ctx[16]}set locale(t){this.$$set({locale:t}),F()}get finetuneControlConfiguration(){return this.$$.ctx[17]}set finetuneControlConfiguration(t){this.$$set({finetuneControlConfiguration:t}),F()}get finetuneOptions(){return this.$$.ctx[18]}set finetuneOptions(t){this.$$set({finetuneOptions:t}),F()}get finetuneNudgePrecision(){return this.$$.ctx[19]}set finetuneNudgePrecision(t){this.$$set({finetuneNudgePrecision:t}),F()}}var mI={util:["finetune",hI]},jd=(e,t)=>{const n=t.length;return e<0?e%n+n:e>=n?e%n:e};
93function kp(e,t,n){const i=e.slice();return i[51]=t[n].key,i[52]=t[n].index,i[53]=t[n].translate,i[16]=t[n].scale,i[54]=t[n].selected,i[15]=t[n].rotate,i[55]=t[n].dir,i[56]=t[n].center,i[57]=t[n].type,i[4]=t[n].visible,i[58]=t[n].role,i[59]=t[n].tabindex,i[60]=t[n].label,i[61]=t[n].orientation,i[62]=t[n].valuemin,i[63]=t[n].valuemax,i[64]=t[n].valuenow,i}function Cp(e){let t;return{c(){t=fe("div"),k(t,"class","PinturaShapeManipulator"),k(t,"data-control","point"),Ee(t,"pointer-events","none"),Ee(t,"opacity",e[6]),Ee(t,"transform",`translate3d(${e[56].x}px, ${e[56].y}px, 0) scale(${e[7]}, ${e[7]})`)},m(n,i){te(n,t,i)},p(n,i){i[0]&64&&Ee(t,"opacity",n[6]),i[0]&160&&Ee(t,"transform",`translate3d(${n[56].x}px, ${n[56].y}px, 0) scale(${n[7]}, ${n[7]})`)},d(n){n&&ee(t)}}}function Pp(e,t){let n,i,o,r,a,l,s,c,u,f,d,m,g,p;function y(..._){return t[23](t[52],..._)}let w=t[57]==="edge"&&t[4]&&Cp(t);return{key:e,first:null,c(){n=fe("div"),d=ut(),w&&w.c(),m=Mi(),k(n,"role",i=t[58]),k(n,"tabindex",o=t[59]),k(n,"aria-label",r=t[60]),k(n,"aria-orientation",a=t[61]),k(n,"aria-valuemin",l=t[62]),k(n,"aria-valuemax",s=t[63]),k(n,"aria-valuenow",c=t[64]),k(n,"class","PinturaShapeManipulator"),k(n,"data-control",u=t[57]),k(n,"data-selected",f=t[54]),Ee(n,"cursor",t[55]?t[55]+"-resize":"move"),Ee(n,"opacity",t[6]),Ee(n,"--tx",t[53].x),Ee(n,"--ty",t[53].y),Ee(n,"--r",`${t[57]==="edge"?t[15]:0}rad`),Ee(n,"--sx",t[57]==="point"?t[7]:t[16].x),Ee(n,"--sy",t[57]==="point"?t[7]:t[16].y),this.first=n},m(_,P){te(_,n,P),te(_,d,P),w&&w.m(_,P),te(_,m,P),g||(p=[Pe(n,"nudge",y),wn(Al.call(null,n,{preventDefault:!0})),Pe(n,"interactionstart",function(){kn(t[11]("start",t[52]))&&t[11]("start",t[52]).apply(this,arguments)}),Pe(n,"interactionupdate",function(){kn(t[11]("move",t[52]))&&t[11]("move",t[52]).apply(this,arguments)}),Pe(n,"interactionend",function(){kn(t[11]("end",t[52]))&&t[11]("end",t[52]).apply(this,arguments)}),wn(xl.call(null,n,{observeKeys:!0}))],g=!0)},p(_,P){t=_,P[0]&32&&i!==(i=t[58])&&k(n,"role",i),P[0]&32&&o!==(o=t[59])&&k(n,"tabindex",o),P[0]&32&&r!==(r=t[60])&&k(n,"aria-label",r),P[0]&32&&a!==(a=t[61])&&k(n,"aria-orientation",a),P[0]&32&&l!==(l=t[62])&&k(n,"aria-valuemin",l),P[0]&32&&s!==(s=t[63])&&k(n,"aria-valuemax",s),P[0]&32&&c!==(c=t[64])&&k(n,"aria-valuenow",c),P[0]&32&&u!==(u=t[57])&&k(n,"data-control",u),P[0]&32&&f!==(f=t[54])&&k(n,"data-selected",f),P[0]&32&&Ee(n,"cursor",t[55]?t[55]+"-resize":"move"),P[0]&64&&Ee(n,"opacity",t[6]),P[0]&32&&Ee(n,"--tx",t[53].x),P[0]&32&&Ee(n,"--ty",t[53].y),P[0]&32&&Ee(n,"--r",`${t[57]==="edge"?t[15]:0}rad`),P[0]&160&&Ee(n,"--sx",t[57]==="point"?t[7]:t[16].x),P[0]&160&&Ee(n,"--sy",t[57]==="point"?t[7]:t[16].y),t[57]==="edge"&&t[4]?w?w.p(t,P):(w=Cp(t),w.c(),w.m(m.parentNode,m)):w&&(w.d(1),w=null)},d(_){_&&(ee(n),ee(d),ee(m)),w&&w.d(_),g=!1,On(p)}}}function Mp(e){let t,n,i;return{c(){t=fe("div"),k(t,"role","button"),k(t,"aria-label","Drag rotator"),k(t,"tabindex","0"),k(t,"class","PinturaShapeManipulator"),k(t,"data-control","rotate"),Ee(t,"transform",`translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[7]}, ${e[7]})`),Ee(t,"opacity",e[6])},m(o,r){te(o,t,r),n||(i=[Pe(t,"nudge",e[13]),wn(Al.call(null,t,{preventDefault:!0})),Pe(t,"interactionstart",e[15]("start")),Pe(t,"interactionupdate",e[15]("move")),Pe(t,"interactionend",e[15]("end")),wn(xl.call(null,t,{observeKeys:!0}))],n=!0)},p(o,r){r[0]&129&&Ee(t,"transform",`translate3d(${o[0].x}px, ${o[0].y}px, 0) scale(${o[7]}, ${o[7]})`),r[0]&64&&Ee(t,"opacity",o[6])},d(o){o&&ee(t),n=!1,On(i)}}}function Rp(e){let t,n,i;return{c(){t=fe("div"),k(t,"role","button"),k(t,"aria-label","Drag scalar"),k(t,"tabindex","0"),k(t,"class","PinturaShapeManipulator"),k(t,"data-control","scale"),Ee(t,"transform",`translate3d(${e[1].x}px, ${e[1].y}px, 0) scale(${e[7]}, ${e[7]})`),Ee(t,"opacity",e[6])},m(o,r){te(o,t,r),n||(i=[Pe(t,"nudge",e[14]),wn(Al.call(null,t,{preventDefault:!0})),Pe(t,"interactionstart",e[16]("start")),Pe(t,"interactionupdate",e[16]("move")),Pe(t,"interactionend",e[16]("end")),wn(xl.call(null,t,{observeKeys:!0}))],n=!0)},p(o,r){r[0]&130&&Ee(t,"transform",`translate3d(${o[1].x}px, ${o[1].y}px, 0) scale(${o[7]}, ${o[7]})`),r[0]&64&&Ee(t,"opacity",o[6])},d(o){o&&ee(t),n=!1,On(i)}}}function gI(e){let t=[],n=new Map,i,o,r,a=xo(e[5]);const l=u=>u[51];for(let u=0;u<a.length;u+=1){let f=kp(e,a,u),d=l(f);n.set(d,t[u]=Pp(d,f))}let s=e[2]&&e[0]&&Mp(e),c=e[3]&&e[1]&&Rp(e);return{c(){for(let u=0;u<t.length;u+=1)t[u].c();i=ut(),s&&s.c(),o=ut(),c&&c.c(),r=Mi()},m(u,f){for(let d=0;d<t.length;d+=1)t[d]&&t[d].m(u,f);te(u,i,f),s&&s.m(u,f),te(u,o,f),c&&c.m(u,f),te(u,r,f)},p(u,f){f[0]&6368&&(a=xo(u[5]),t=cl(t,f,l,1,u,a,n,i.parentNode,mS,Pp,i,kp)),u[2]&&u[0]?s?s.p(u,f):(s=Mp(u),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null),u[3]&&u[1]?c?c.p(u,f):(c=Rp(u),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i:qt,o:qt,d(u){u&&(ee(i),ee(o),ee(r));for(let f=0;f<t.length;f+=1)t[f].d(u);s&&s.d(u),c&&c.d(u)}}}function bI(e,t,n){let i,o,r,a;
93const l=Xa(),s=ca*.5,c=Ha,u=c-s,f=c+s,d=-Ha,m=d-s,g=d+s,y=f1-s,w=-f1+s,_=s,P=-s,C=c-ca,R=C-s,I=C+s,M=f1-ca,T=M-s,v=M+s,H=d-ca,Y=H+s,Z=H-s,W=d+ca,$=W+s,S=W-s;let{visible:pe=!1}=t,{points:ge=[]}=t,{rotatorPoint:de=void 0}=t,{bounds:Fe=null}=t,{scalarPoint:X=void 0}=t,{selectedPoint:U=void 0}=t,{enableDragEdges:ae=!0}=t,{enableDragPoints:be=!0}=t,{enableRotatePoints:ft=!0}=t,{enableScalePoints:Se=!0}=t;const De=Qn("isAnimated");B(e,De,ue=>n(22,o=ue));const Mt=hn(.5,{precision:1e-4,stiffness:.3,damping:.7});B(e,Mt,ue=>n(7,a=ue));const gt=hn(0,{precision:.001,stiffness:.3,damping:.7});B(e,gt,ue=>n(6,r=ue));const ie=ue=>({detail:He})=>{const Qe=He&&He.translation?He.translation:re(0,0);l(`rotate${ue}`,{...He,translation:Qe})},N=ue=>({detail:He})=>{const Qe=He&&He.translation?He.translation:re(0,0);l(`scale${ue}`,{...He,translation:Qe})},le=(ue,He)=>({detail:Qe})=>{const G=Qe&&Qe.translation?Qe.translation:re(0,0);l(`resize${ue}`,{...Qe,indexes:He,translation:G})},Te=ue=>{let He="";const Qe=ue<=f&&ue>=u,G=ue>=m&&ue<=g,je=ue<=w||ue>=y,ye=ue>=P&&ue<=_,$e=ue>=T&&ue<=v,St=ue>=R&&ue<=I,Je=ue<=Y&&ue>=Z,q=ue<=$&&ue>=S;return(Qe||G)&&(He="ns"),(je||ye)&&(He="ew"),($e||q)&&(He="nesw"),(St||Je)&&(He="nwse"),He},me=(ue,He)=>{let Qe=0;const G=Kr(ue),je=[],ye=ue.length,[$e,St,Je,q]=c5(ue);for(;Qe<ye;Qe++){const Ie=jd(Qe-1,ue),se=jd(Qe+1,ue),V=ue[Ie],dt=ue[Qe],Ft=ue[se],We=Math.atan2(Ft.y-dt.y,Ft.x-dt.x);if(be){const nn=ur(re(V.x-dt.x,V.y-dt.y)),Jt=ur(re(Ft.x-dt.x,Ft.y-dt.y)),yn=re(nn.x+Jt.x,nn.y+Jt.y),an=ae?be&&Te(Math.atan2(yn.y,yn.x)):void 0;je.push({index:[Qe],key:`point-${Qe}`,type:"point",selected:U===Qe,scale:{x:1,y:1},translate:{x:dt.x,y:dt.y},angle:void 0,rotate:ft,center:dt,dir:an})}if(!ae||Array.isArray(ae)&&!ae.some(([nn,Jt])=>Qe===nn&&se===Jt))continue;const Xe=re(dt.x+(Ft.x-dt.x)*.5,dt.y+(Ft.y-dt.y)*.5),nt=["t","r","b","l"][Qe];let wt,Zt,yt;nt==="l"&&(wt=Fe.x,Zt=St,yt=q),nt==="t"&&(wt=Fe.y,Zt=Je,yt=$e),nt==="r"&&(wt=q,Zt=Fe.width,yt=St),nt==="b"&&(wt=$e,Zt=Fe.height,yt=Je),je.push({index:[Qe,se],key:`edge-${Qe}`,type:"edge",scale:{x:or(dt,Ft),y:1},translate:{x:dt.x,y:dt.y},angle:We,rotate:We,center:Xe,visible:Array.isArray(ae),dir:Te(Math.atan2(G.y-Xe.y,G.x-Xe.x)),role:"slider",tabindex:0,label:`Drag ${_4[nt]}`,orientation:`${T4[nt]}`,valuemin:Math.round(wt),valuemax:Math.round(Zt),valuenow:Math.round(yt)})}return je},Me=(ue,He)=>{l("resizestart",{indexes:ue,translation:Kn(),isNudge:!0}),l("resizemove",{indexes:ue,translation:He,isNudge:!0}),l("resizeend",{indexes:ue,translation:Kn(),isNudge:!0})},qe=({detail:ue})=>{l("rotatestart",{translation:Kn(),isNudge:!0}),l("rotatemove",{translation:ue,isNudge:!0}),l("rotateend",{translation:Kn(),isNudge:!0})},Ne=({detail:ue})=>{l("scalestart",{translation:Kn(),isNudge:!0}),l("scalemove",{translation:ue,isNudge:!0}),l("scaleend",{translation:Kn(),isNudge:!0})},mt=(ue,{detail:He})=>Me(ue,He);return e.$$set=ue=>{"visible"in ue&&n(4,pe=ue.visible),"points"in ue&&n(17,ge=ue.points),"rotatorPoint"in ue&&n(0,de=ue.rotatorPoint),"bounds"in ue&&n(18,Fe=ue.bounds),"scalarPoint"in ue&&n(1,X=ue.scalarPoint),"selectedPoint"in ue&&n(19,U=ue.selectedPoint),"enableDragEdges"in ue&&n(20,ae=ue.enableDragEdges),"enableDragPoints"in ue&&n(21,be=ue.enableDragPoints),"enableRotatePoints"in ue&&n(2,ft=ue.enableRotatePoints),"enableScalePoints"in ue&&n(3,Se=ue.enableScalePoints)},e.$$.update=()=>{e.$$.dirty[0]&4194320&&Mt.set(pe?1:.5,{hard:o===!1}),e.$$.dirty[0]&4194320&&gt.set(pe?1:0,{hard:o===!1}),e.$$.dirty[0]&131072&&n(5,i=me(ge))},[de,X,ft,Se,pe,i,r,a,De,Mt,gt,le,Me,qe,Ne,ie,N,ge,Fe,U,ae,be,o,mt]}class pI extends gn{constructor(t){super(),mn(this,t,bI,gI,rn,{visible:4,points:17,rotatorPoint:0,bounds:18,scalarPoint:1,selectedPoint:19,enableDragEdges:20,enableDragPoints:21,enableRotatePoints:2,enableScalePoints:3},null,[-1,-1,-1])}}var _m=(e,t)=>{const n=ug(e);return Fi(n,t)},wd=e=>document.createTextNode(e),P4=e=>(Za()&&e.endsWith("<div><br></div>")?e.replace(/<div><br><\/div>$/,"<br><br>"):e).replace(/<div><br><\/div>/g,"<br>").replace(/<\/div>/g,"").replace(/<div>/g,"<br>");function Ip(e){let t,n,i,o;return{c(){t=fe("pre"),k(t,"class","PinturaContentEditable")},m(r,a){te(r,t,a),t.innerHTML=e[0],i||(o=wn(n=Il.call(null,t,`${e[7]};position:absolute;z-index:-1;pointer-events:none;`)),i=!0)},p(r,a){a[0]&1&&(t.innerHTML=r[0]),n&&kn(n.update)&&a[0]&128&&n.update.call(null,`${r[7]};position:absolute;z-index:-1;pointer-events:none;`)},d(r){r&&ee(t),i=!1,o()}}}function yI(e){let t,n,i,o,r,a,l=e[8]&&Ip(e);return{c(){l&&l.c(),t=ut(),n=fe("pre"),k(n,"class","PinturaContentEditable"),k(n,"data-wrap-content",i=!e[4]&&!e[5]?"nowrap":"wrap"),k(n,"contenteditable",""),k(n,"spellcheck",e[1]),k(n,"autocorrect",e[2]),k(n,"autocapitalize",e[3])},m(s,c){l&&l.m(s,c),te(s,t,c),te(s,n,c),e[26](n),r||(a=[wn(o=Il.call(null,n,e[8]?e[15](e[7]):e[7])),Pe(n,"input",e[13]),Pe(n,"compositionend",e[12]),Pe(n,"paste",e[14]),Pe(n,"keydown",e[10]),Pe(n,"keyup",e[11
93]),Pe(n,"blur",e[9])],r=!0)},p(s,c){s[8]?l?l.p(s,c):(l=Ip(s),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),c[0]&48&&i!==(i=!s[4]&&!s[5]?"nowrap":"wrap")&&k(n,"data-wrap-content",i),c[0]&2&&k(n,"spellcheck",s[1]),c[0]&4&&k(n,"autocorrect",s[2]),c[0]&8&&k(n,"autocapitalize",s[3]),o&&kn(o.update)&&c[0]&384&&o.update.call(null,s[8]?s[15](s[7]):s[7])},i:qt,o:qt,d(s){s&&(ee(t),ee(n)),l&&l.d(s),e[26](null),r=!1,On(a)}}}function SI(e,t,n){let i,o,{spellcheck:r="false"}=t,{autocorrect:a="off"}=t,{autocapitalize:l="off"}=t,{wrapLines:s=!0}=t,{allowNewline:c=!0}=t,{textFormat:u="text"}=t,{formatInput:f=Nn}=t,{formatPaste:d=Nn}=t,{styles:m=void 0}=t,{innerHTML:g=void 0}=t,{oninput:p=st}=t,{enableTextStyleShortcuts:y=!1}=t;const w=()=>v(),_=()=>R&&R.focus(),P=()=>{if(!R)return;const ie=document.createRange();ie.selectNodeContents(R);const N=ae();N.removeAllRanges(),N.addRange(ie)},C=Xa();let R;document.execCommand("defaultParagraphSeparator",!1,"br");const I=ie=>{ie!==R.innerHTML&&(n(6,R.innerHTML=ie,R),R===document.activeElement&&P())},M=ie=>ie.replace(/<\/?(?:i|b|em|u|s|strike|strong|font)>/,"").replace(/style=".*?"/g,"").replace(/\n/gim,"<br>"),T=()=>{n(0,g=R.innerHTML);const ie=P4(g);C("input",ie),p(ie),requestAnimationFrame(()=>R&&R.scrollTo(0,0))},v=()=>{be(R);const ie=u==="html"?R.innerHTML:M(R.innerHTML);n(6,R.innerHTML=f(ie),R),ft(R),T()},H=()=>{C("blur")},Y=()=>{C("confirm")},Z=()=>{C("cancel")},W={b:"bold",i:"italic",u:"underline",s:"strikethrough"},$=ie=>{const N=W[ie];N&&document.execCommand(N)},S=ie=>{if(/escape/i.test(ie.code))return ie.stopPropagation(),Z();const N=ie.ctrlKey||ie.metaKey;if(u==="html"&&N&&/b|i|u|s/.test(ie.key)){y&&$(ie.key),ie.preventDefault();return}if(/enter/i.test(ie.key)&&(ie.stopPropagation(),!ie.isComposing)){if(N)return Y();c||ie.preventDefault(),document.execCommand("insertLineBreak"),ie.preventDefault()}},pe=()=>{},ge=ie=>{ie.data!==""&&v()},de=ie=>{const{inputType:N}=ie;N==="insertCompositionText"||N==="deleteCompositionText"||v()},Fe=ie=>{ie.preventDefault();const N=ie.clipboardData.getData("text/plain"),le=u==="html"?N:M(N),Te=d(le);if(!Te.length)return;const me=ae().getRangeAt(0);me.deleteContents(),me.insertNode(document.createTextNode(Te)),T()},X=ie=>{const N=ci("span");return N.dataset.bookmark=ie,N},U=(ie,N,le)=>{const Te=X(le);if(ie.nodeType===Node.TEXT_NODE){const me=ie.textContent;if(le==="start"){const Me=wd(me.substring(0,N)),qe=wd(me.substring(N));ie.replaceWith(Me,Te,qe)}else{const Me=wd(me.substring(0,N)),qe=wd(me.substring(N));ie.replaceWith(Me,Te,qe)}}else ie.nodeType===Node.ELEMENT_NODE&&ie.insertBefore(Te,ie.childNodes[N])},ae=()=>{const ie=R.getRootNode();return"getSelection"in ie?ie.getSelection():document.getSelection()},be=ie=>{const N=ae();if(!(N.getRangeAt&&N.rangeCount))return;const le=N.getRangeAt(0),{startOffset:Te,endOffset:me,startContainer:Me,endContainer:qe}=le;if(!(!ie.contains(le.startContainer)||!ie.contains(le.endContainer)))if(Me.nodeType===Node.TEXT_NODE&&Me===qe){const Ne=Me.textContent,mt=Ne.substring(0,Te),ue=X("start"),He=me-Te>0?Ne.substring(Te,me):"",Qe=X("end"),G=Ne.substring(me);Me.replaceWith(mt,ue,He,Qe,G)}else U(Me,Te,"start"),U(qe,me+(Me===qe?1:0),"end")},ft=ie=>{const N=Se(ie,"start"),le=Se(ie,"end");if(!N||!le)return;const Te=document.createRange();Te.setStart(N,0),Te.setEnd(le,0);const me=ae();me.removeAllRanges(),me.addRange(Te),N.remove(),le.remove()},Se=(ie,N)=>{const le=ie.children;for(let Te=0;Te<le.length;Te++){const me=le[Te];if(me.dataset.bookmark===N)return me;if(me.children.length){const Me=Se(me,N);if(Me)return Me}}};let De;const Mt=ie=>ie.replace("-webkit-text-stroke","--text-stroke").replace("text-shadow","--text-shadow");function gt(ie){vn[ie?"unshift":"push"](()=>{R=ie,n(6,R)})}return e.$$set=ie=>{"spellcheck"in ie&&n(1,r=ie.spellcheck),"autocorrect"in ie&&n(2,a=ie.autocorrect),"autocapitalize"in ie&&n(3,l=ie.autocapitalize),"wrapLines"in ie&&n(4,s=ie.wrapLines),"allowNewline"in ie&&n(5,c=ie.allowNewline),"textFormat"in ie&&n(16,u=ie.textFormat),"formatInput"in ie&&n(17,f=ie.formatInput),"formatPaste"in ie&&n(18,d=ie.formatPaste),"styles"in ie&&n(19,m=ie.styles),"innerHTML"in ie&&n(0,g=ie.innerHTML),"oninput"in ie&&n(20,p=ie.oninput),"enableTextStyleShortcuts"in ie&&n(21,y=ie.enableTextStyleShortcuts)},e.$$.update=()=>{if(e.$$.dirty[0]&64&&n(25,i=!!R),e.$$.dirty[0]&33554433&&i&&g&&I(g),e.$$.dirty[0]&524336)if(!s&&c){const ie=m.includes(":right")?"text-indent:-100px!important":m.includes(":center")?"":"min-width:calc(100% + 100px)!important";n(7,De=m+";overflow:visible;"+ie)}else n(7,De=m);e.$$.dirty[0]&524288&&n(8,o=m.includes("text-stroke"))},[g,r,a,l,s,c,R,De,o,H,S,pe,ge,de,Fe,Mt,u,f,d,m,p,y,w,_,P,i,gt]}
93class wI extends gn{constructor(t){super(),mn(this,t,SI,yI,rn,{spellcheck:1,autocorrect:2,autocapitalize:3,wrapLines:4,allowNewline:5,textFormat:16,formatInput:17,formatPaste:18,styles:19,innerHTML:0,oninput:20,enableTextStyleShortcuts:21,confirm:22,focus:23,select:24},null,[-1,-1])}get spellcheck(){return this.$$.ctx[1]}set spellcheck(t){this.$$set({spellcheck:t}),F()}get autocorrect(){return this.$$.ctx[2]}set autocorrect(t){this.$$set({autocorrect:t}),F()}get autocapitalize(){return this.$$.ctx[3]}set autocapitalize(t){this.$$set({autocapitalize:t}),F()}get wrapLines(){return this.$$.ctx[4]}set wrapLines(t){this.$$set({wrapLines:t}),F()}get allowNewline(){return this.$$.ctx[5]}set allowNewline(t){this.$$set({allowNewline:t}),F()}get textFormat(){return this.$$.ctx[16]}set textFormat(t){this.$$set({textFormat:t}),F()}get formatInput(){return this.$$.ctx[17]}set formatInput(t){this.$$set({formatInput:t}),F()}get formatPaste(){return this.$$.ctx[18]}set formatPaste(t){this.$$set({formatPaste:t}),F()}get styles(){return this.$$.ctx[19]}set styles(t){this.$$set({styles:t}),F()}get innerHTML(){return this.$$.ctx[0]}set innerHTML(t){this.$$set({innerHTML:t}),F()}get oninput(){return this.$$.ctx[20]}set oninput(t){this.$$set({oninput:t}),F()}get enableTextStyleShortcuts(){return this.$$.ctx[21]}set enableTextStyleShortcuts(t){this.$$set({enableTextStyleShortcuts:t}),F()}get confirm(){return this.$$.ctx[22]}get focus(){return this.$$.ctx[23]}get select(){return this.$$.ctx[24]}}const M4=["i","b","u","strike"].map(e=>({tag:e,tagOpen:new RegExp(`<${e}>`,"g"),tagClose:new RegExp(`</${e}>`,"g"),placeholderOpen:new RegExp(`___${e}O___`,"g"),placeholderClose:new RegExp(`___${e}C___`,"g")})),_I=(e,t=M4)=>(t.forEach(({tag:n,tagOpen:i,tagClose:o})=>{e=e.replace(i,`___${n}O___`).replace(o,`___${n}C___`)}),e),TI=(e,t=M4)=>(t.forEach(({tag:n,placeholderOpen:i,placeholderClose:o})=>{e=e.replace(i,`<${n}>`).replace(o,`</${n}>`)}),e);var kI=e=>(e=_I(e),e=e.replace(/ {2,}/g," ").replace(/\u00a0/g,"&nbsp;").split(`
94`).join("<br>"),e=TI(e),e),CI=e=>P4(e).split(/<br>|<br\/>/g).join(`
95`).replace(/&nbsp;/g," ").replace(/&amp;/g,"&"),_d=(e,t)=>Nt(e)?parseFloat(e)/100*t:e,Au=(e,t)=>({x:cr(e.x,t.width),y:cr(e.y,t.height)});function Ep(e,t,n){const i=e.slice();return i[318]=t[n],i[320]=n,i}function Ap(e,t){let n,i,o,r,a,l=t[318].name+"",s,c,u,f,d,m;o=new cg({props:{color:t[318].color}});function g(){return t[198](t[320])}return{key:e,first:null,c(){n=fe("li"),i=fe("button"),Ve(o.$$.fragment),r=ut(),a=fe("span"),s=bi(l),u=ut(),k(i,"class","PinturaShapeListItem"),k(i,"type","button"),k(i,"aria-label",c="Select shape "+t[318].name),this.first=n},m(p,y){te(p,n,y),Ae(n,i),ve(o,i,null),Ae(i,r),Ae(i,a),Ae(a,s),Ae(n,u),f=!0,d||(m=Pe(i,"click",g),d=!0)},p(p,y){t=p;const w={};y[0]&8388608&&(w.color=t[318].color),o.$set(w),(!f||y[0]&8388608)&&l!==(l=t[318].name+"")&&vi(s,l),(!f||y[0]&8388608&&c!==(c="Select shape "+t[318].name))&&k(i,"aria-label",c)},i(p){f||(L(o.$$.fragment,p),f=!0)},o(p){z(o.$$.fragment,p),f=!1},d(p){p&&ee(n),Oe(o),d=!1,m()}}}function Lp(e){let t,n;return t=new pI({props:{visible:!0,points:e[14],bounds:e[4],rotatorPoint:e[31],scalarPoint:e[30],selectedPoint:e[19],enableDragEdges:e[20],enableDragPoints:e[33],enableRotatePoints:e[18],enableScalePoints:e[16]}}),t.$on("resizestart",e[42]),t.$on("resizemove",e[43]),t.$on("resizeend",e[44]),t.$on("rotatestart",e[45]),t.$on("rotatemove",e[46]),t.$on("rotateend",e[47]),t.$on("scalestart",e[48]),t.$on("scalemove",e[49]),t.$on("scaleend",e[50]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16384&&(r.points=i[14]),o[0]&16&&(r.bounds=i[4]),o[1]&1&&(r.rotatorPoint=i[31]),o[0]&1073741824&&(r.scalarPoint=i[30]),o[0]&524288&&(r.selectedPoint=i[19]),o[0]&1048576&&(r.enableDragEdges=i[20]),o[1]&4&&(r.enableDragPoints=i[33]),o[0]&262144&&(r.enableRotatePoints=i[18]),o[0]&65536&&(r.enableScalePoints=i[16]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function xp(e){let t,n,i,o;const r=[MI,PI],a=[];function l(s,c){return s[5]==="modal"?0:s[5]==="inline"?1:-1}return~(t=l(e))&&(n=a[t]=r[t](e)),{c(){n&&n.c(),i=Mi()},m(s,c){~t&&a[t].m(s,c),te(s,i,c),o=!0},p(s,c){let u=t;t=l(s),t===u?~t&&a[t].p(s,c):(n&&(Et(),z(a[u],1,1,()=>{a[u]=null}),At()),~t?(n=a[t],n?n.p(s,c):(n=a[t]=r[t](s),n.c()),L(n,1),n.m(i.parentNode,i)):n=null)},i(s){o||(L(n),o=!0)},o(s){z(n),o=!1},d(s){s&&ee(i),~t&&a[t].d(s)}}}function PI(e){let t,n,i,o,r,a,l={formatInput:e[52],wrapLines:!!e[15].width,textFormat:e[15].format,enableTextStyleShortcuts:e[6],allowNewline:e[32],styles:e[29]};return n=new wI({props:l}),e[202](n),n.$on("input",e[53]),n.$on("keyup",e[57]),n.$on("cancel",e[59]),n.$on("confirm",e[58]),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaInlineInput")},m(s,c){te(s,t,c),ve(n,t,null),o=!0,r||(a=[wn(i=Il.call(null,t,e[28])),Pe(t,"focusout",e[203])],r=!0)},p(s,c){const u={};c[0]&32768&&(u.wrapLines=!!s[15].width),c[0]&32768&&(u.textFormat=s[15].format),c[0]&64&&(u.enableTextStyleShortcuts=s[6]),c[1]&2&&(u.allowNewline=s[32]),c[0]&536870912&&(u.styles=s[29]),n.$set(u),i&&kn(i.update)&&c[0]&268435456&&i.update.call(null,s[28])},i(s){o||(L(n.$$.fragment,s),o=!0)},o(s){z(n.$$.fragment,s),o=!1},d(s){s&&ee(t),e[202](null),Oe(n),r=!1,On(a)}}}function MI(e){let t,n;return t=new t4({props:{panelOffset:e[2],onconfirm:e[58],oncancel:e[59],buttonCancel:{icon:e[7].shapeIconInputCancel,label:e[7].shapeLabelInputCancel},buttonConfirm:{icon:e[7].shapeIconInputConfirm,label:e[7].shapeLabelInputConfirm,hideLabel:!0},willHandleKeydown:e[201],$$slots:{default:[RI]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&4&&(r.panelOffset=i[2]),o[0]&128&&(r.buttonCancel={icon:i[7].shapeIconInputCancel,label:i[7].shapeLabelInputCancel}),o[0]&128&&(r.buttonConfirm={icon:i[7].shapeIconInputConfirm,label:i[7].shapeLabelInputConfirm,hideLabel:!0}),o[0]&4096&&(r.willHandleKeydown=i[201]),o[0]&671088896|o[10]&2048&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function RI(e){let t,n,i,o;
95return{c(){t=fe("textarea"),k(t,"spellcheck","false"),k(t,"autocorrect","off"),k(t,"autocapitalize","off")},m(r,a){te(r,t,a),e[199](t),t2(t,e[27]),i||(o=[Pe(t,"keydown",e[55]),Pe(t,"keypress",e[54]),Pe(t,"keyup",e[57]),Pe(t,"input",e[53]),Pe(t,"input",e[200]),wn(n=Il.call(null,t,e[29]))],i=!0)},p(r,a){a[0]&134217728&&t2(t,r[27]),n&&kn(n.update)&&a[0]&536870912&&n.update.call(null,r[29])},d(r){r&&ee(t),e[199](null),i=!1,On(o)}}}function Fp(e){let t,n,i,o,r;return n=new Xo({props:{items:e[24],key:e[11]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaShapeControls"),Ee(t,"transform",e[26]),Ee(t,"opacity",e[25])},m(a,l){te(a,t,l),ve(n,t,null),i=!0,o||(r=[Pe(t,"measure",e[204]),wn(Fo.call(null,t))],o=!0)},p(a,l){const s={};l[0]&16777216&&(s.items=a[24]),l[0]&2048&&(s.key=a[11]),n.$set(s),l[0]&67108864&&Ee(t,"transform",a[26]),l[0]&33554432&&Ee(t,"opacity",a[25])},i(a){i||(L(n.$$.fragment,a),i=!0)},o(a){z(n.$$.fragment,a),i=!1},d(a){a&&ee(t),Oe(n),o=!1,On(r)}}}function II(e){let t,n,i,o=[],r=new Map,a,l,s,c,u,f,d,m=xo(e[23]);const g=_=>_[318].id;for(let _=0;_<m.length;_+=1){let P=Ep(e,m,_),C=g(P);r.set(C,o[_]=Ap(C,P))}let p=e[17]&&Lp(e),y=e[13]&&xp(e),w=e[21]>0&&Fp(e);return{c(){t=fe("div"),n=fe("nav"),i=fe("ul");for(let _=0;_<o.length;_+=1)o[_].c();a=ut(),p&&p.c(),l=ut(),y&&y.c(),s=ut(),w&&w.c(),k(n,"class","PinturaShapeList"),k(n,"data-visible",e[22]),k(t,"class","PinturaShapeEditor"),k(t,"tabindex","0")},m(_,P){te(_,t,P),Ae(t,n),Ae(n,i);for(let C=0;C<o.length;C+=1)o[C]&&o[C].m(i,null);Ae(t,a),p&&p.m(t,null),Ae(t,l),y&&y.m(t,null),Ae(t,s),w&&w.m(t,null),e[205](t),u=!0,f||(d=[Pe(n,"focusin",e[62]),Pe(n,"focusout",e[63]),Pe(t,"keydown",function(){kn(e[0]?st:e[51])&&(e[0]?st:e[51]).apply(this,arguments)}),Pe(t,"nudge",function(){kn(e[0]?st:e[61])&&(e[0]?st:e[61]).apply(this,arguments)}),Pe(t,"measure",e[197]),Pe(t,"pointermove",function(){kn(e[0]?st:e[64])&&(e[0]?st:e[64]).apply(this,arguments)}),Pe(t,"pointerleave",function(){kn(e[0]?st:e[65])&&(e[0]?st:e[65]).apply(this,arguments)}),Pe(t,"interactionstart",function(){kn(e[0]?st:e[36])&&(e[0]?st:e[36]).apply(this,arguments)}),Pe(t,"interactionupdate",function(){kn(e[0]?st:e[38])&&(e[0]?st:e[38]).apply(this,arguments)}),Pe(t,"interactioncancel",function(){kn(e[0]?st:e[37])&&(e[0]?st:e[37]).apply(this,arguments)}),Pe(t,"interactionrelease",function(){kn(e[0]?st:e[39])&&(e[0]?st:e[39]).apply(this,arguments)}),Pe(t,"interactionend",function(){kn(e[0]?st:e[40])&&(e[0]?st:e[40]).apply(this,arguments)}),wn(Fo.call(null,t)),wn(Al.call(null,t)),wn(c=xl.call(null,t,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:vp,getEventPosition:e[206]}))],f=!0)},p(_,P){e=_,P[0]&8388608|P[2]&16&&(m=xo(e[23]),Et(),o=cl(o,P,g,1,e,m,r,i,cs,Ap,null,Ep),At()),(!u||P[0]&4194304)&&k(n,"data-visible",e[22]),e[17]?p?(p.p(e,P),P[0]&131072&&L(p,1)):(p=Lp(e),p.c(),L(p,1),p.m(t,l)):p&&(Et(),z(p,1,1,()=>{p=null}),At()),e[13]?y?(y.p(e,P),P[0]&8192&&L(y,1)):(y=xp(e),y.c(),L(y,1),y.m(t,s)):y&&(Et(),z(y,1,1,()=>{y=null}),At()),e[21]>0?w?(w.p(e,P),P[0]&2097152&&L(w,1)):(w=Fp(e),w.c(),L(w,1),w.m(t,null)):w&&(Et(),z(w,1,1,()=>{w=null}),At()),c&&kn(c.update)&&P[0]&8&&c.update.call(null,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:vp,getEventPosition:e[206]})},i(_){if(!u){for(let P=0;P<m.length;P+=1)L(o[P]);L(p),L(y),L(w),u=!0}},o(_){for(let P=0;P<o.length;P+=1)z(o[P]);z(p),z(y),z(w),u=!1},d(_){_&&ee(t);for(let P=0;P<o.length;P+=1)o[P].d();p&&p.d(),y&&y.d(),w&&w.d(),e[205](null),f=!1,On(d)}}}const Td=256,EI=100,AI=20,mc="markup-hover",vp=(e,t)=>e.target===t||e.target.className==="PinturaContentEditable";function LI(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de,Fe,X,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te,me,Me,qe,Ne,mt,ue,He,Qe,G,je,ye,$e,St,Je,q,Ie,se=qt,V=()=>(se(),se=Do(yt,b=>n(193,Ie=b)),yt),dt,Ft,We,Xe;e.$$.on_destroy.push(()=>se());let{uid:nt=Yr()}=t,{ui:wt}=t,{disabled:Zt=!1}=t,{shapes:yt}=t;V();let{selection:nn}=t,{offset:Jt}=t,{contextRotation:yn=0}=t,{contextFlipX:an=!1}=t,{contextFlipY:Tt=!1}=t,{contextZoom:Sn=1}=t,{active:ln=!1}=t,{opacity:sn=1}=t,{parentRect:ke}=t,{rootRect:Re}=t,{utilRect:Lt}=t,{hoverColor:fn}
95=t,{caretColor:on}=t,{gridColor:En}=t,{snapColor:bt}=t,{textInputMode:Un="inline"}=t,{oninteractionstart:Hn=st}=t,{oninteractionupdate:$n=st}=t,{oninteractionrelease:Q=st}=t,{oninteractionend:Ge=st}=t,{oninteractioncancel:j=st}=t,{onaddshape:Le=st}=t,{onupdateshape:tt=st}=t,{onselectshape:en=st}=t,{onblurshape:Xt=st}=t,{onremoveshape:Ze=st}=t,{ontapshape:tn=st}=t,{onhovershape:Fn=st}=t,{ontriggerhistorywrite:K=st}=t,{onhovercanvas:J=st}=t,{ontapcanvas:xe=st}=t,{onleavecanvas:it=st}=t,{beforeSelectShape:Ye=()=>!0}=t,{beforeDeselectShape:ct=()=>!0}=t,{beforeRemoveShape:ot=()=>!0}=t,{beforeUpdateShape:Ct=(b,A,O)=>A}=t,{willRenderShapeControls:cn=Nn}=t,{willRenderShapeTextControls:Qt=Nn}=t,{willStartInteraction:_n=(b,A)=>!0}=t,{mapEditorPointToImagePoint:Bt}=t,{mapImagePointToEditorPoint:et}=t,{eraseRadius:ri=void 0}=t,{selectRadius:Gn=void 0}=t,{enableButtonFlipVertical:Ri=!1}=t,{enableTapToAddText:ai=!0}=t,{enableMultiSelect:ui=!1}=t,{enableTextStyleControls:Yn=!0}=t,{locale:_t}=t,{snapThreshold:Dn=0}=t,{snapPointer:Vn=!0}=t,{enableSnapToContext:ni=!0}=t,{gridSize:Bn=0}=t;const qn=b=>{if(Dn===0)return[];let A;return ni&&(A={...ke,x:0,y:0}),[...Ie.filter(O=>O!==b).filter(O=>!nr(O)).filter(O=>g_(O)).map(O=>Ii({...O},ke)),A].filter(Boolean)},ii=(b,A,O,ne)=>b===0?{snapTargets:[]}:{snapThreshold:b,gridSize:A,gridRect:O,snapTargets:qn(ne)},pi=Qn("isAnimated");B(e,pi,b=>n(194,Ft=b));const An=Qn("softKeyboardState"),Cn=b=>b.set(Na(b)),_i=b=>Na(b).find(nr),fi=(b,A)=>{if(!_i(A))return em(b),So(b,A)},eo=b=>{_i(b)&&b.update(A=>A.filter(O=>!nr(O)))},di=b=>{const A=_i(b);if(A)return Z0(A),Cn(b),A},dr=(b,A,O=(ne,oe)=>({...ne,...oe}))=>{_i(A)&&A.update(oe=>oe.map(he=>nr(he)?O(he,b):he))},So=(b,A=yt)=>(A.update(O=>[...O,b]),b),li=(b,A,O)=>{const ne=Ct({...b},A,{...O});return Ua(b,ne,O),b},hi=(b,A)=>{const O=or(b,A),ne=ed(b,A),oe=Math.PI/8,he=oe*Math.round(ne/oe)-yn%oe;A.x=b.x+O*Math.cos(he),A.y=b.y+O*Math.sin(he)},wa=(b,A=12)=>{if(vr(b))return Ro(b,b.rotation,In(b));if(zi(b)){const O=Wo(b);return Ro(O,b.rotation,In(O))}else if($i(b))return Yd(re(b.x,b.y),b.rx,b.ry,b.rotation,b.flipX,b.flipY,A);return[]},Qr=Qn("keysPressed");B(e,Qr,b=>n(195,We=b));const hr=(b,A,O)=>b===0||A&&O?b:A||O?-b:b,Ko=b=>{if(b.x===null&&b.y===null)return zr();b.x&&n(149,Vr=Bt({x:b.x,y:0}).x),b.y&&n(150,Pr=Bt({x:0,y:b.y}).y)},zr=()=>{n(149,Vr=null),n(150,Pr=null)};let Vr=null,Pr=null;const Wr=(b,A={})=>{let O,ne,oe,he=[],Be=$i(b),ze=zi(b),Ke=A.position==="relative";const Ot=A.interpolateInput,Kt=qn(),Yt=jt=>{if(!Dn)return jt;const It=Bt(jt),{snapTranslation:vt,snapLines:Pt}=Yi(Ei(It),Kt,Dn,Bn,i);return ho(jt,vt),Ko(Pt),jt},bn=!!ka(),at=A.isSelection?nn:yt,oi=A.inputMode==="step";if(Vi(b)){if(oi){let jt=!1;const It=(vt,Pt)=>{const kt=_i(at),Wt=vt&&re(_d(vt.x,ke.width),_d(vt.y,ke.height)),Mn=Wt&&et(Wt);We.includes(16)&&Mn&&hi(Mn,Pt);const xt=Bt(Pt),Wn=kt.points.length?kt.points[0]:xt,Jn=re(_d(Wn.x,ke.width),_d(Wn.y,ke.height)),oo=et(Jn),bo=xr(oo,Pt);if(!jt&&kt.points.length===1&&bo<36)return eo(at);if(kt.points.length>2&&bo<=Td){kt.pathClose=!0,Ba(kt)&&io(kt);const Ji=di(at);Le(Ji);return}const Zi=kt.strokeWidth&&kt.strokeColor&&(kt.strokeColor[3]===void 0||kt.strokeColor[3]>0),Xi=xr(Mn,Pt);if(Zi&&kt.points.length>1&&Xi<Td){kt.pathClose=!1,kt.backgroundColor=[0,0,0,0],Ba(kt)&&io(kt);const Ji=di(at);Le(Ji);return}if(!(kt.points.length>0&&Xi<EI))return Ke?Au(xt,ke):xt};return{start:vt=>{const Pt=_i(at),{origin:kt}=vt.detail;if(ne=4,O=Yt(Ut(kt)),oe=Ut(O),Pt){const Wt=Pt.points[Pt.points.length-1],Mn=It(Wt,O);Mn&&(Pt.points=[...Pt.points,Mn]),dr({points:Pt.points},at);return}jt=!0}
95,update:vt=>{if(!jt)return;const Pt=_i(at);if(!Pt)return;const kt=Pt.points[0],Wt=It(kt,re(O.x+vt.detail.translation.x,O.y+vt.detail.translation.y));Wt&&(Pt.points[1]=Wt,dr({points:Pt.points},at))},release:vt=>vt.detail.preventInertia(),cancel:()=>{eo(at)},end:vt=>{if(!jt)return;const Pt=Bt(O),kt=Ke?Au(Pt,ke):Pt,{isTap:Wt}=vt.detail;if(Wt&&Uo(Ie,Pt,0,Ba).length)return eo(at);fi({...b,points:[kt]},at)}}}return{start:jt=>{const{origin:It}=jt.detail;ne=4,O=Ut(It),oe=Ut(O),he.push({...oe});const vt=Bt(O),Pt=Ke?Au(vt,ke):vt;fi({...b,points:[Pt]},at)},update:jt=>{const It=_i(at);if(!It)return;const{translation:vt}=jt.detail,Pt=re(O.x+vt.x,O.y+vt.y),kt=or(oe,Pt);if(un(kt,5)<=ne)return;const Wt=[],Mn=ed(Pt,oe),xt=ne-kt,Wn={x:oe.x+xt*Math.cos(Mn),y:oe.y+xt*Math.sin(Mn)};if(he.push({...Wn}),Ot&&It.points.length>1){const Jn=he.length,oo=Math.ceil(kt/10);let bo=kt/30;const Zi=he[Jn-3],Xi=he[Jn-2],Ji=he[Jn-1];he[Jn-4]||(bo*=.1),Wt.push(...l5(Zi,Xi,Ji,oo,bo).slice(1,-1)),he.splice(Jn-1,0,...Wt)}Wt.push(Wn),oe.x=Wn.x,oe.y=Wn.y,dr({points:It.points.concat(Wt.map(Jn=>{const oo=Bt(Jn);return Ke?Au(oo,ke):oo}))},at)},release:jt=>jt.detail.preventInertia(),cancel:()=>{eo(at)},end:jt=>{const It=_i(at);if(!It)return;if(jt.detail.isTap){let Pt=!1;if(It.bitmap?(To&&(Pt=!0),bn&&(Pt=!0)):Pt=!0,Pt)return eo(at)}const vt=di(at);Le(vt)}}}else{if(Be||ze||vr(b))return{start:jt=>{const{origin:It}=jt.detail;O=Yt(Ut(It));const vt=Bt(O),Pt=Ke?Au(vt,ke):vt,kt=-1*hr(yn,an,Tt),Wt={...b,rotation:kt,...Pt};Wt.flipX=an,Wt.flipY=Tt,delete Wt.position,Wt.opacity=0,(Be?["rx","ry"]:["width","height"]).forEach(xt=>{Wt[xt]=Ke?"0%":0}),fi(Wt,at)},update:jt=>{const It=_i(at);if(!It)return;It.opacity=1;let{aspectRatio:vt}=It,{translation:Pt,shiftKey:kt,ctrlKey:Wt}=jt.detail;!vt&&kt&&(vt=1);const Mn=Yt(re(O.x+Pt.x,O.y+Pt.y)),xt=Bt(O),Wn=Bt(Mn);if(vt){const Gi=Qi([xt,Wn]),er=rr(Gi,vt),yl=Wn.x<xt.x?-1:1,Aa=Wn.y<xt.y?-1:1;Wn.x=xt.x+er.width*yl,Wn.y=xt.y+er.height*Aa}const Jn={x:xt.x+(Wn.x-xt.x)*.5,y:xt.y+(Wn.y-xt.y)*.5},oo=hr(yn,an,Tt);Go(xt,oo,Jn),Go(Wn,oo,Jn);const bo=Math.min(xt.x,Wn.x),Zi=Math.min(xt.y,Wn.y),Xi=Math.max(xt.x,Wn.x),Ji=Math.max(xt.y,Wn.y);let $o=Xi-bo,Ar=Ji-Zi,Ni={};Be?(Wt?(Ni.x=xt.x,Ni.y=xt.y):(Ni.x=bo+$o*.5,Ni.y=Zi+Ar*.5),Ni.rx=$o*.5,Ni.ry=Ar*.5):(Wt?(Ni.x=xt.x-$o*.5,Ni.y=xt.y-Ar*.5):(Ni.x=bo,Ni.y=Zi),Ni.width=$o,Ni.height=Ar),dr(Ni,at,(Gi,er)=>li(Gi,er,ke))},release:jt=>{jt.detail.preventInertia()},cancel:()=>{eo(at)},end:jt=>{const It=_i(at);if(It){if(jt.detail.isTap){if(zi(It)&&ai&&Pa||!zi(It)||!ai||To)return eo(at);delete It.width,delete It.height,It.disableNewline!==!1&&delete It.textAlign;const vt=Ii({...It},ke),Pt=tr(It.text,vt),kt=Bt({x:O.x,y:O.y-Pt.height*.5}),Wt=Bt({x:O.x+Pt.width,y:O.y+Pt.height*.5}),Mn={x:kt.x+(Wt.x-kt.x)*.5,y:kt.y+(Wt.y-kt.y)*.5},xt=hr(yn,an,Tt);Go(kt,xt,Mn),Go(Wt,xt,Mn);let Wn=Math.min(kt.x,Wt.x),Jn=Math.min(kt.y,Wt.y);Wn<0&&(Wn=0),Jn<0&&(Jn=0),Wn+Pt.width>ke.width&&(Wn=ke.width-Pt.width),Jn+Pt.height>ke.height&&(Jn=ke.height-Pt.height),It.x=Nt(It.x)?cr(Wn,ke.width):Wn,It.y=Nt(It.y)?cr(Jn,ke.height):Jn}if(It.opacity=1,zi(It)){const vt=Ii({...It},ke);if(Ht(vt.width)&&vt.width<1||Ht(vt.height)&&vt.height<1)return eo(at);Le(It)}else{const vt=di(at);Le(vt)}Ba(It)&&io(It),zi(It)&&yr(It)}}};if(Io(b))return{start:jt=>{const{origin:It}=jt.detail,vt=Bt(Yt(It)),Pt=Or(vt,ju);O=Ut(It),fi({...b,x1:Ke?cr(Pt.x,ke.width):Pt.x,y1:Ke?cr(Pt.y,ke.height):Pt.y,x2:Ke?cr(Pt.x,ke.width):Pt.x,y2:Ke?cr(Pt.y,ke.height):Pt.y,opacity:0},at)},update:jt=>{if(!_i(at))return;const{translation:vt}=jt.detail,Pt=Yt(xi(Ut(O),vt));if(We.includes(16)){const Wt=or(O,Pt),Mn=ed(O,Pt),xt=Math.PI/4,Wn=xt*Math.round(Mn/xt);Pt.x=O.x+Wt*Math.cos(Wn),Pt.y=O.y+Wt*Math.sin(Wn)}const kt=Bt(Pt);dr({x2:Ke?cr(kt.x,ke.width):kt.x,y2:Ke?cr(kt.y,ke.height):kt.y,opacity:1},at)},release:jt=>jt.detail.preventInertia(),cancel:()=>{eo(at)},end:jt=>{const It=_i(at);if(!It)return;if(jt.detail.isTap)return eo(at);It.opacity=1;const vt=di(at);Le(vt),Ba(It)&&io(vt)}}}},ul=()=>{let b,A;const O=ri*ri,ne=(oe,he,Be=!1)=>{const ze=xr(oe,he);if(!Be&&ze<2)return!1;const Ke=Ie.filter(b_);let Ot;
95return ze<O?Ot=Uo(Ke,Bt(he),ri):Ot=Ca(Ke,Bt(oe),Bt(he),ri),Qa(Ot).forEach(Ze),!0};return{start:oe=>{b=re(Math.round(oe.detail.origin.x),Math.round(oe.detail.origin.y)),ne(b,b,!0),A=b},update:oe=>{const{translation:he}=oe.detail,Be=re(Math.round(b.x+he.x),Math.round(b.y+he.y));ne(A,Be)&&(A=Ut(Be))},release:oe=>oe.detail.preventInertia(),cancel:()=>{eo(collection)},end:()=>{}}},Ki=(b,A)=>{const O=et(b);return Bt(xi(O,A))},wo=(b,A,O)=>{const ne=(O-A)/b+1;return Array.from({length:ne},(oe,he)=>A+he*b)},Ei=b=>{let A=[],O=[],ne=b.points;if(b.x1!==void 0&&(ne=[{x:b.x1,y:b.y1},{x:b.x2,y:b.y2}]),ne){const oe=ne.map(et),he=Qi(oe),Be=oe[0],ze=oe[oe.length-1];A=[he.x,he.x+he.width*.5,he.x+he.width,Be.x,ze.x],O=[he.y,he.y+he.height*.5,he.y+he.height,Be.y,ze.y]}else if(b.text||b.width!==void 0||b.rx!==void 0){let oe;if(b.text&&b.height===void 0){const at=tr(b.text,b);oe=Li(b.x,b.y,at.width,at.height)}else oe=b.width!==void 0?rl(b):rl({x:b.x-b.rx,y:b.y-b.ry,width:b.rx*2,height:b.ry*2});const he=Fr(oe).map(et),Be=Math.abs(b.rotation)>0?Ro(oe,b.rotation).map(et):he,ze=Qi(Be),Ke=In(ze),Ot=ze.width,Kt=ze.height,Yt=Ot*.5,bn=Kt*.5;A=[Ke.x-Yt,Ke.x,Ke.x+Yt],O=[Ke.y-bn,Ke.y,Ke.y+bn]}else if(b.x!==void 0){const oe=et(b);A=[oe.x],O=[oe.y]}return{x:A,y:O}},_a=(b,A,O)=>{let ne,oe=Number.Infinity,he=null,Be=null,ze,Ke;for(let Ot=0;Ot<b.length;Ot++){ze=b[Ot];for(let Kt=0;Kt<A.length;Kt++)Ke=A[Kt],ne=Math.abs(ze-Ke),ne<O&&(Be===null||ne<oe)&&(oe=ne,he=ze,Be=Ke)}return{origin:he,target:Be}},Ya=(b,A,O)=>{const ne={x:null,y:null},oe={x:null,y:null},he=_a(b.x,A.x,O);he.target!==null&&(ne.x=he.target,oe.x=he.target-he.origin);const Be=_a(b.y,A.y,O);return Be.target!==null&&(ne.y=Be.target,oe.y=Be.target-Be.origin),{snapTranslation:oe,snapLine:ne}},Yi=(b,A,O,ne,oe)=>{const he={x:null,y:null},Be={x:null,y:null},ze=A.map(Ei);if(ne>0){const Ke=et({x:0,y:0}),Ot=et({x:ne,y:ne}),Kt=et({x:oe.width,y:oe.height}),Yt=Ot.x-Ke.x,bn=wo(Yt,Ke.x,Kt.x),at=wo(Yt,Ke.y,Kt.y);ze.push({x:bn,y:at})}return ze.forEach(Ke=>{const{snapTranslation:Ot,snapLine:Kt}=Ya(b,Ke,O);Ot.x!==null&&(Be.x===null||Math.abs(Ot.x)<Math.abs(Be.x))&&(Be.x=Ot.x||0,he.x=Kt.x),Ot.y!==null&&(Be.y===null||Math.abs(Ot.y)<Math.abs(Be.y))&&(Be.y=Ot.y||0,he.y=Kt.y)}),{snapTranslation:Be,snapLines:he}},ho=(b,A)=>(A.x!==null&&(b.x+=A.x),A.y!==null&&(b.y+=A.y),b),zn=(b,A,O,ne)=>{const{snapThreshold:oe=0,gridSize:he=0,gridRect:Be,snapTargets:ze=[]}=ne||{};let Ke=null;if(Io(b)){if(oe){const Yt=Ii({...b},ke),bn=Ki(Tl(A),O),at=Ki(kl(A),O),oi=Ei({...Yt,x1:bn.x,y1:bn.y,x2:at.x,y2:at.y}),{snapTranslation:jt,snapLines:It}=Yi(oi,ze,oe,he,Be);ho(O,jt),Ko(It)}const Ot=Ki(Tl(A),O),Kt=Ki(kl(A),O);Ke={x1:Ot.x,y1:Ot.y,x2:Kt.x,y2:Kt.y}}else if(b.points){if(y1(zt)&&Hi(zt,{selectedPoint:void 0}),oe){const Ot=Ii({...b},ke),Kt=Ei({...Ot,points:A.points.map(at=>Ki(at,O))}),{snapTranslation:Yt,snapLines:bn}=Yi(Kt,ze,oe,he,Be);ho(O,Yt),Ko(bn)}Ke={points:A.points.map(Ot=>Ki(Ot,O))}}else if(vr(b)||zi(b)||$i(b)){if(oe){const Ot=Ii({...b},ke),Kt=Ki(A,O),Yt=Ei({...Ot,...Kt}),{snapTranslation:bn,snapLines:at}=Yi(Yt,ze,oe,he,Be);ho(O,bn),Ko(at)}Ke=Ki(A,O)}Ke&&(li(b,Ke,ke),ji())},Ui={0:1,1:0,2:3,3:2},Vo={0:3,1:2,2:1,3:0},ar=(b,A,O,ne,oe)=>{const{shiftKey:he,snapThreshold:Be=0,gridSize:ze=0,gridRect:Ke,snapTargets:Ot=[],aspectRatio:Kt=void 0,beforeResizeShape:Yt=st}=oe||{},bn=Be?(at,oi,jt)=>{const{snapTranslation:It,snapLines:vt}=Yi(Ei(at),Ot,Be,ze,Ke);ho(oi,It),Ko(vt);const Pt=Ki(jt(),oi);at.x=Pt.x,at.y=Pt.y}:st;if(Io(b)||Vi(b)&&Rt(b,"pathClose")){const[at]=O,oi=he?hi:(kt,Wt)=>Wt;let jt,It,vt;if(Io(b))at===0?(jt=()=>Tl(A),It=kt=>oi(kl(A),kt),vt=(kt,Wt)=>{li(kt,{x1:Wt.x,y1:Wt.y},ke)}):at===1&&(jt=()=>kl(A),It=kt=>oi(Tl(A),kt),vt=(kt,Wt)=>{li(kt,{x2:Wt.x,y2:Wt.y},ke)});
95else{const kt=A.points;jt=()=>({...kt[at]}),It=Wt=>{const Mn=kt[jd(at-1,kt)],xt=kt[jd(at+1,kt)];oi(Mn,Wt),oi(xt,Wt)},vt=(Wt,Mn)=>{li(Wt,{points:Wt.points.map((xt,Wn)=>at===Wn?Mn:xt)},ke)}}const Pt=Ki(jt(),ne);bn(Pt,ne,jt),It(Pt),vt(b,Pt)}else if(vs(b)||$i(b)||zi(b)){let at=!1,oi=!1,jt;if($i(A))jt=Pd(A);else if(vs(A))jt=rl(A);else if(Rt(A,"width")){at=!0,jt=rl(A);const xt=tr(A.text,A);jt.height=xt.height}else{oi=!0,jt=rl(A);const xt=tr(A.text,A);jt.width=xt.width,jt.height=xt.height}let It=Kt;b.aspectRatio?It=b.aspectRatio:oe.shiftKey&&!(at||oi)&&(It=jt.width/jt.height);const vt=rl(jt),Pt=In(vt),kt=b.rotation,Wt=Fr(vt),Mn=Ro(vt,kt);if(O.length===1){let xt=O[0];b.flipX&&(xt=Ui[xt]),b.flipY&&(xt=Vo[xt]);const[Wn,Jn,oo,bo]=Wt,Zi=et(Mn[xt]),Xi=xi({...Zi},ne),Ji=Bt(Xi);bn(Ji,ne,()=>Bt(Zi));const $o=re(Ji.x-Mn[xt].x,Ji.y-Mn[xt].y),Ar=Go(Ut($o),-kt),Ni=re(Wt[xt].x+Ar.x,Wt[xt].y+Ar.y);let Gi;xt===0&&(Gi=oo),xt===1&&(Gi=bo),xt===2&&(Gi=Wn),xt===3&&(Gi=Jn);const er=Qi([Gi,Ni]);if(It){const{width:Ss,height:tc}=rr(er,It),[ws,ra,xa]=Ws(er);er.width=Ss,er.height=tc,Ni.y<Gi.y&&(er.y=xa-tc),Ni.x<Gi.x&&(er.x=ra-Ss)}const yl=Ro(er,kt,Pt),Aa=Kr(yl),ec=Go(yl[0],-kt,Aa),La=Go(yl[2],-kt,Aa),Lr=Qi([ec,La]);Yt(Lr),li(b,$i(b)?w0(Lr):Lr,ke)}else{O=O.map(po=>(b.flipX&&(po=Ui[po]),b.flipY&&(po=Vo[po]),po));const[xt,Wn]=O.map(po=>Mn[po]),Jn={x:xt.x+(Wn.x-xt.x)*.5,y:xt.y+(Wn.y-xt.y)*.5},[oo,bo]=O.map(po=>Wt[po]),[Zi,Xi]=O.map(po=>{const Fa=po+2;return Fa<4?Wt[Fa]:Wt[Fa-4]}),Ji={x:Zi.x+(Xi.x-Zi.x)*.5,y:Zi.y+(Xi.y-Zi.y)*.5},$o=et(Jn),Ar=xi({...$o},ne),Ni=Bt(Ar);bn(Ni,ne,()=>Bt($o));const Gi=re(Ni.x-Jn.x,Ni.y-Jn.y),er=Go(Ut(Gi),-kt),yl=Fi(Ut(oo),bo),Aa=Or(yl,po=>1-Math.abs(Math.sign(po))),ec=re(er.x*Aa.x,er.y*Aa.y);xi(oo,ec),xi(bo,ec);const La=Qi(Wt);if(It){let po=La.width,Fa=La.height;Aa.y===0?Fa=po/It:po=Fa*It,La.width=po,La.height=Fa,Aa.y===0?La.y=Ji.y-Fa*.5:La.x=Ji.x-po*.5}const Lr=Ro(La,kt,Pt),Ss=Kr(Lr),tc=Go(Lr[0],-kt,Ss),ws=Go(Lr[2],-kt,Ss),ra=Qi([tc,ws]);let xa;$i(b)?xa=w0(ra):vs(b)?xa=ra:at&&(xa={x:ra.x,y:ra.y,width:ra.width}),li(b,xa,ke)}}ji()};let to;const $r=(b,A,O,ne)=>{const oe=Wo(Ii(yi(b),ke)),he=In(oe),Be=Ki(to,O);let ze=ed(Be,he)+Math.PI/2;if(ne.shiftKey){const Ke=Math.PI/16;ze=Ke*Math.round(ze/Ke)-yn%Ke}li(b,{rotation:ze},ke),ji()},Ai=(b,A,O,ne)=>{const oe=rl(A),he=tr(A.text,A);oe.width||(oe.width=he.width),oe.height||(oe.height=he.height);let Be=2;b.flipX&&b.flipY?Be=0:b.flipX?Be=3:b.flipY&&(Be=1),ar(b,A,[Be],O,{...ne,aspectRatio:oe.width/oe.height,beforeResizeShape:ze=>{const Ke=ze.width/oe.width;ze.fontSize=A.fontSize*Ke,A.width||delete ze.width,A.height||delete ze.height}})},Ur=(b,A)=>{const O=b.points,ne=[];for(let ze=0;ze<O.length-1;ze++)ne.push([O[ze],O[ze+1]]);ne.push([O[O.length-1],O[0]]);const oe=ne.findIndex(([ze,Ke])=>xd(A,6,ze,Ke));let he;const Be=[];for(let ze=0;ze<ne.length;ze++)Be.push(ne[ze][0]),ze===oe&&(he=ze+1,Be.push(A));li(b,{points:Be,selectedPoint:he},ke),ji()},no=(b,A)=>{const O=b.points.filter((ne,oe)=>oe!==A);li(b,{points:O,selectedPoint:void 0},ke),ji()},Yo=()=>{if(Ie.length)return Ie.find(nr)},Hr=()=>{if(Ie.length)return Ie.findIndex(nr)},fl=b=>{if(!Yo())return em(b),So(b)},mo=()=>{const b=Yo();if(b)return Z0(b),ji(),b},go=()=>{if(!Yo())return;const b=[...Ie];b.splice(Hr(),1),yt.set(b)},qa=(b={})=>({id:Yr(),...b}),ji=()=>{yt.set(Ie)},mr=(b,A=[],O=!0)=>{A.filter(Boolean).forEach(ne=>delete b[ne]),O&&ji()},Hi=(b,A,O=!0)=>{b=Object.assign(b,A),O&&ji()},ea=(b,A,O,ne=!0)=>{b[A]=O,ne&&ji()},gr=(b,A,O=!0)=>{Ie.forEach(ne=>ea(ne,b,A,!1)),O&&ji()},ta=(b,A=!0)=>{Ie.forEach(O=>Hi(O,b,!1)),A&&ji()},Ta=()=>[...Ie].reverse().filter(Va),br=()=>[...Ie].reverse().find(Va),Ja=()=>!!br(),dl=(b,A=!1)=>{if(!ot(b))return!1;yt.set(Ie.filter(O=>O!==b)),A||Ze(b)},pr=(b,A=!0,O=!1)=>{const ne=Ie.filter(ze=>od(ze)&&Ba(ze)),oe=ne.findIndex(ze=>ze===b);if(dl(b,O)===!1)return;if(_o=b,ne.length-1<=0)return na();if(!A)return!0;const Be=oe-1<0?ne.length-1:oe-1;return io(ne[Be]),!0},Oi=()=>{if(a){const A=[];r.forEach((O,ne)=>{if(!od(O))return;pr(O,ne===r.length-1,!0)&&A.push(O)}),A.length&&K();return}const b=br();b&&pr(b)};let _o;const na=(b={})=>{const{storePrevious:A=!0}=b;Object.keys(Dl).forEach(ne=>Dl[ne]={});const O=ka();A&&(_o=O),ta({isSelected:!1,isEditing:!1,_prerender:!1}),O&&Xt(O)},ka=()=>Ie.find(Va),io=(b,A=!0,O=!1)=>
95{if(nr(b))return;const oe=ka()||_o,he=Va(b);_o=void 0,Ye(oe,b)&&(O||na(),m_(b),!he&&en(b),A&&ji())},ia=b=>{qi&&qi.confirm&&b.isEditing&&qi.confirm();const A={isSelected:!1,isEditing:!1,_prerender:!1};b.selectedPoint>-1&&(A.selectedPoint=void 0),Hi(b,A),Xt(b)},yr=b=>{Hi(b,{isSelected:!0,isEditing:!0,_prerender:Un==="inline"})},Nr=b=>{Hi(b,{isSelected:!0,isEditing:!1,_prerender:!1})},Qa=b=>{if(!b.length)return[];const A=b.filter(ot);return yt.set(Ie.filter(O=>!A.includes(O))),A},Gr=b=>{const A=tr(b.text,b);return Li(b.x,b.y,b.width?Math.min(b.width,A.width):A.width,b.height?Math.min(b.height,A.height):A.height)},Wo=b=>{if(vs(b))return rl(b);if($i(b))return Pd(b);const A=Gr(b);return A.width=Math.max(0,b.width||A.width),A},Uo=(b,A,O=0,ne=()=>!0)=>[...b].reverse().filter(ne).map(oe=>({shape:oe,priority:1})).filter(oe=>{const{shape:he}=oe,Be=Ii(yi(he),ke),ze=O+(Be.strokeWidth||0)*.5;if(vr(Be))return d1(A,ze,Be,he.rotation);if(zi(Be)){const Ke=Wo(Be),Ot=d1(A,ze,Ke,he.rotation);let Kt=!1;if(Ot&&!Va(he)){const Yt=Gr(Be);he.textAlign==="right"&&!he.flipX&&(Yt.x=Ke.x+Ke.width-Yt.width),he.textAlign==="center"&&(Yt.x=Ke.x+Ke.width*.5-Yt.width*.5),Kt=d1(A,ze,Yt,he.rotation,In(Ke)),Kt||(oe.priority=-1)}return Ot}return $i(Be)?u5(A,ze,Be,he.rotation,he.flipX,he.flipY):Io(Be)?xd(A,Math.max(16,ze),Tl(Be),kl(Be)):Vi(Be)&&Be.pathClose?Lm(A,ze,Be.points):Vi(Be)?Be.points.length===1?xr(A,Be.points[0])<ze*ze:ky(A,Math.max(16,ze),Be.points):!1}).sort((oe,he)=>oe.priority<he.priority?1:oe.priority>he.priority?-1:0).map(oe=>oe.shape),Ca=(b,A,O,ne=0)=>{const oe=Math.abs(ne),he=os(A,O),Be=Em(he,oe),ze=qw(Be,oe);return b.filter(Ot=>{const Kt=Ii(yi(Ot),ke);if(Io(Kt)||Vi(Kt)){const Yt=Kt.points?[...Kt.points]:[Tl(Kt),kl(Kt)];return!!wy(Be,Yt)}return s5(ze,wa(Kt))})};let lr,ei,To,zt,ko,Co,$a=!1,Pa=!1,qo=!1,mi=!1,Mr;const Ma=b=>{Mr=b.map(A=>({shape:A,shapeOrigin:yi(A),shapeOriginComputed:Ii(yi(A),ke)}))},Ra=b=>{const{origin:A}=b.detail,O=ui&&We.includes(16);Mr=void 0,n(151,zt=void 0),ko=void 0,Co=void 0,$a=!1,To=void 0,Pa=!1,qo=!1,zr(),clearTimeout(ei),ei=setTimeout(()=>n(152,mi=!0),250);const ne=Yo();if(ne&&!(Vi(ne)&&Rt(ne,"pathClose"))&&mo(),lr=Bt(Ut(A)),ne&&Vi(ne)&&Rt(ne,"pathClose"))return Hn(b);const oe=Uo(Ie,lr,Gn,ze=>Ba(ze)),he=oe.length&&oe.shift();if(o&&wl(o))if(he!==o)bl();else{const ze=Rt(o,"height"),Ke=!ze&&Rt(o,"width");if(ze||Ke){const Ot=yi(o),Kt=yi(Ot);Ii(Kt,ke);const Yt=Ga(tr(Ot.text,Kt),oi=>Math.ceil(oi)),bn=Ci(Kt.width,Kt.height||Yt.height);ms(bn,Ot,Kt),qo=Uo([{...Ot,strokeWidth:"5%"}],lr,0).length===0}}if(o&&ai&&(Pa=!0),!he&&o&&wl(o)&&ia(o),!_n(A))return;if(he&&Va(he)){if($a=!0,n(151,zt=he),a){O&&ia(he),Ma(r);return}ko=yi(zt),Co=Ii(yi(zt),ke);return}if(To=he||void 0,!Hn(b)&&he){if(io(he,!0,O),n(151,zt=he),a)return Ma(r);ko=yi(zt),Co=Ii(yi(zt),ke)}},Rr=()=>{clearTimeout(ei),ei=void 0,n(152,mi=!1),zr()},el=b=>{Rr(),j(b)};let Ir=null;const Fl=b=>{const{translation:A,ctrlKey:O,metaKey:ne,shiftKey:oe,position:he}=b.detail;if(zt){if(!Bs(zt))return;if(wl(zt)){if(!qo)return;bl()}if(oe){let ze=Math.abs(A.x),Ke=Math.abs(A.y);Ir==="x"&&(Ke-=64),Ir==="y"&&(ze-=64),ze>Ke?(A.y=0,Ir="x"):Ke>ze&&(A.x=0,Ir="y")}else Ir=null;const Be=O||ne;if(Mr){if(!r.every(Bs))return;Mr.forEach(({shape:ze,shapeOriginComputed:Ke})=>{zn(ze,Ke,A,{...ii(0,Bn,i,ze)})});return}return zn(zt,Co,A,{...ii(Be?0:Dn,Bn,i,zt)})}$n(b)},vl=b=>{if(Rr(),!zt){Q(b);return}if(!a)if(b.detail.isTap&&Vi(zt)&&Wy(zt)){const{position:A}=b.detail,O=Bt(Ut(A));Ur(zt,O);return}else b.detail.isTap&&$a&&zi(zt)&&uc(zt)!==!1&&yr(zt)},tl=b=>{const A=To&&b.detail.isTap,O=ui&&We.includes(16);if(b.detail.isTap&&setTimeout(()=>{xe({target:zt||To,position:lr},0)}),zt){tn(zt),l_(zt,ko)||tt(zt),n(151,zt=void 0);return}let ne=!0;if(!O){const oe=ka();ne=oe?ct(oe,To||void 0):!0,ne&&na({storePrevious:!1})}Ge(b),ne&&A&&io(To,!0,O)},hl=b=>{const A=b.map(ne=>Sr(Ii(ne,ke))).flat(),O=Qi(A);return Fr(O)},Sr=b=>{const A=Ht(b.rotation)&&b.rotation!==0;if(vr(b)){const O=In(b),ne=Fr(b);return(b.flipX||b.flipY)&&wc(ne,b.flipX,b.flipY,O.x,O.y),A?Os(ne,b.rotation,O.x,O.y):ne}if($i(b)){const O=b,ne=Fr(Pd(b));return(b.flipX||b.flipY)&&wc(ne,b.flipX,b.flipY,O.x,O.y),A?Os(ne,b.rotation,O.x,O.y):ne}if(Io(b))return[Tl(b),kl(b)];if(Vi(b)){if(b.bitmap&&!Rt(b,"pathClose")){const O=Qi(b.points);return O.x-=b.strokeWidth*.5,O.y-=b.strokeWidth*.5,O.width+=b.strokeWidth,O.height+=b.strokeWidth,Sr({...b,...O})}return[...b.points]}if(zi(b)){const O=Wo(b),ne=In(O),oe=Fr(O);return(b.flipX||b.flipY)&&wc(oe,b.flipX,b.flipY,ne.x,ne.y),A?Os(oe,b.rotation,ne.x,ne.y):oe}return[]},ml=b=>{const A=Sr(b);let O,ne;return b.flipY?(O=Kr([A[0],A[1]]),ne=ur(re(A[1].x-A[2].x,A[1].y-A[2].y))):(O=Kr([A[2],A[3]]),ne=ur(re(A[2].x-A[1].x,A[2].y-A[1].y))),Bo(ne,AI/Sn),{origin:O,dir:ne}},oa=b=>{const A=ml(b),O=et({x:A.origin.x+A.dir.x,y:A.origin.y+A.dir.y});return{origin:et(A.origin),position:O}},Ol=b=>{const A=Sr(b);let O=2;b.flipX&&b.flipY?O=0:b.flipX?O=3:b.flipY&&(O=1);const ne={...A[O]};return et({x:ne.x,y:ne.y})};function gl(b){return b?zi(b)&&!b.height?[[1,2],[3,0]]:!(Io(b)||Vi(b)):!1}const Ia=b=>A=>!b(A),Ea=b=>A=>A.id===b,Jo=b=>{const A=Ea(b);return O=>O.filter(Ia(A))},Ho=b=>{const A=Ea(b),O=Jo(b);return()=>wt.update(ne=>ne.some(A)?O(ne):ne)},x=b=>{const A=Jo(b);return(...O)=>{wt.update(ne=>[...A(ne),...O.filter(Boolean)])}},we=Ho(mc),Vt=x(mc),rt=b=>{const A=Sr(Ii(yi(b),ke));if(!A)return;const O=A.map(et);let ne=!1;b.pathClose===!0?ne=!0:Vi(b)?ne=!Rt(b,"pathClose"):O.length>2&&(ne=!0);const oe=b.selectionStyle==="hook",he=oe?O.map((ze,Ke,Ot)=>({id:mc,points:pt(Ot,Ke),strokeColor:[0,0,0,.1],strokeWidth:2})):[{id:mc,points:O.map(ze=>re(ze.x+1,ze.y+1)),strokeColor:[0,0,0,.1],strokeWidth:2,pathClose:ne}],Be=oe?O.map((ze,Ke,Ot)=>({id:mc,points:pt(Ot,Ke),strokeColor:fn,strokeWidth:2})):[{id:mc,points:O,strokeColor:fn,strokeWidth:2,pathClose:ne}];Vt(...he,...Be)};let Dt;const Gt="markup-manipulator-segment-"+nt,E=Ho(Gt),Ue=x(Gt),pt=(b,A)=>{const O=b[A],ne=A-1<0?b[b.length-1]:b[A-1],oe=A+1<b.length?b[A+1]:b[0],he=Fi(Ut(ne),O);ur(he);const Be=xi(Bo(he,10),O),ze=Fi(Ut(oe),O);ur(ze);const Ke=xi(Bo(ze,10),O);return[Be,O,Ke]},Tn=(b,A,O)=>{if(!Ba(A))return;const ne=Vi(A),oe=ne&&Rt(A,"pathClose"),he=oe&&h_(A),Be=nr(A),ze=wl(A),Ke=A.selectionStyle==="hook",Ot=A.disableShowPoints!==!0,{selectionOpacity:Kt=1}=A;if(Be&&ne&&!oe)return;const Yt=[],bn=[...I],at=bn[bn.length-1],oi=bn[0],jt=(ze?.05:.1)*b*Kt,It=jt>0,vt=(ze?.5:1)*b*Kt,Pt=vt>0,kt=[0,0,0],Wt=[1,1,1],Mn=ze?1:1.5;We.includes(16)&&at&&O&&hi(at,O);const xt=bn.length&&oe&&Be&&O?xr(oi,O):1/0,Wn=bn.length&&oe&&Be&&O?xr(at,O):1/0,Jn=xt<=Td,oo=Wn<=Td;!Jn&&O&&bn.push(O);const bo=bn.length>1;let Zi=!1;A.pathClose===!0?Zi=!0:Vi(A)?nr(A)?Zi=Jn:Zi=!Rt(A,"pathClose"):bn.length>2&&(Zi=!0),bo&&It&&(Ke?Yt.push(...bn.map((Xi,Ji,$o)=>({id:Gt,points:pt($o,Ji),strokeColor:kt,opacity:jt}))):Yt.push({id:Gt,points:bn.map(Xi=>re(Xi.x+1,Xi.y+1)),pathClose:Zi,strokeColor:kt,strokeWidth:2,opacity:jt})),oe&&It&&Ot&&Yt.push(...bn.map(Xi=>({id:Gt,...Xi,rx:Mn*2,ry:Mn*2,backgroundColor:kt,opacity:jt}
95))),Z&&It&&Yt.push({id:Gt,points:[re(Z.origin.x+1,Z.origin.y+1),re(Z.position.x+1,Z.position.y+1)],strokeColor:kt,strokeWidth:2,opacity:jt}),bo&&Pt&&(Ke?Yt.push(...bn.map((Xi,Ji,$o)=>({id:Gt,points:pt($o,Ji),strokeColor:Wt,strokeWidth:Mn,opacity:vt}))):Yt.push({id:Gt,points:bn,pathClose:Zi,strokeColor:Wt,strokeWidth:Mn,backgroundColor:Be&&oe&&A.backgroundColor&&A.backgroundColor[3]>0?A.backgroundColor:[0,0,0,0],opacity:vt})),oe&&Ot&&Yt.push(...bn.map(Xi=>({id:Gt,...Xi,rx:Mn*3,ry:Mn*3,backgroundColor:[.5,.5,.5],strokeWidth:Mn,strokeColor:Wt}))),oe&&Be&&Ot&&I.length>=3&&Yt.push({...oi,id:Gt,rx:Mn*(Jn?5:4),ry:Mn*(Jn?5:4),backgroundColor:Jn?fn:[.5,.5,.5],strokeWidth:Mn,strokeColor:Wt}),oe&&Be&&he&&Ot&&!Jn&&m.length>=2&&Yt.push({...at,id:Gt,rx:Mn*(oo?5:4),ry:Mn*(oo?5:4),backgroundColor:oo?fn:[.5,.5,.5],strokeWidth:Mn,strokeColor:Wt}),Z&&Pt&&!Ke&&Yt.push({id:Gt,points:[{x:Z.origin.x,y:Z.origin.y},{x:Z.position.x,y:Z.position.y}],strokeColor:Wt,strokeWidth:Mn,opacity:vt}),Ue(...Yt)},Pn=()=>{o===Dt&&jn()},jn=()=>{n(153,Dt=void 0),we()},Zn="markup-multi-selection-segment-"+nt,gi=Ho(Zn),Ti=x(Zn),ki=(b,A)=>{if(Dn<=0)return b;if(A)return zr(),b;const O=Bt(b),ne=qn(),{snapTranslation:oe,snapLines:he}=Yi(Ei(O),ne,Dn,Bn,i);return Ko(he),ho(b,oe),b},si=hn(0);B(e,si,b=>n(196,Xe=b));const No=`markup-grid-line-${nt}`,vo=Ho(No),Er=x(No),Po=(b,A,O,ne)=>{const oe=et({x:0,y:0}),he=et({x:b,y:b}),Be=et({x:A.width,y:A.height}),ze=he.x-oe.x;if(si.set(ze>6?1:0),ne<=0)return vo();const Ke=wo(ze,oe.x,Be.x).map(Kt=>({id:No,opacity:ne,points:[{x:Kt,y:oe.y},{x:Kt,y:Be.y}],strokeWidth:1,strokeColor:O})),Ot=wo(ze,oe.y,Be.y).map(Kt=>({id:No,opacity:ne,points:[{x:oe.x,y:Kt},{x:Be.x,y:Kt}],strokeWidth:1,strokeColor:O}));Er(...Ot,...Ke)},Qo="markup-snap-line",us=Ho(Qo),Oc=x(Qo),Dc=(b,A,O)=>{if(b===null&&A===null)return us();let ne,oe;b!==null&&(ne={id:Qo,strokeColor:O,strokeWidth:1.5,points:[et({x:b,y:0}),et({x:b,y:ke.height})]}),A!==null&&(oe={id:Qo,strokeColor:O,strokeWidth:1.5,points:[et({x:0,y:A}),et({x:ke.width,y:A})]}),Oc(ne,oe)},Bc=b=>{if(!b)return ta({_prerender:!1});const A=Ie.find(O=>O.isEditing);A&&Hi(A,{_prerender:Un==="inline"})},Ns=b=>{n(152,mi=!0),n(151,zt=o),Co=f},zc=b=>{if(!zt){n(152,mi=!1);return}const{translation:A,indexes:O,shiftKey:ne,ctrlKey:oe,metaKey:he,isNudge:Be}=b.detail;ar(zt,Co,O,A,{shiftKey:Be?!1:ne,...ii(oe||he?0:Dn,Bn,i,zt)}),y1(zt)&&xr(A)>16&&Hi(zt,{selectedPoint:void 0})},Vc=b=>{if(!zt){n(152,mi=!1);return}io(zt);const{isTap:A,translation:O,indexes:ne}=b.detail;A&&(y1(zt)&&Hi(zt,{selectedPoint:zt.selectedPoint===ne[0]?void 0:ne[0]}),tn(zt)),n(151,zt=void 0),n(152,mi=!1),tt(o)},Wc=b=>{to=ml(f).origin,n(152,mi=!0),n(151,zt=o),Co=f},Uc=b=>{if(!zt){n(152,mi=!1);return}const{translation:A,shiftKey:O}=b.detail;$r(zt,Co,A,{shiftKey:O})},Hc=()=>{if(!zt){n(152,mi=!1);return}
95io(zt),n(151,zt=void 0),n(152,mi=!1),tt(o)},Gs=b=>{n(152,mi=!0),n(151,zt=o),Co=f},ef=b=>{if(!zt){n(152,mi=!1);return}const{translation:A,ctrlKey:O,metaKey:ne}=b.detail;Ai(zt,Co,A,{...ii(O||ne?0:Dn,Bn,i,zt)})},Nc=()=>{if(!zt){n(152,mi=!1);return}io(zt),n(151,zt=void 0),n(152,mi=!1),tt(o)},Gc=()=>{const[b]=We;if(!(b!==8&&b!==46)&&Ja()&&!o.isEditing&&od(o)&&!Ql(document.activeElement)){if(Vi(o)&&Ht(o.selectedPoint)){setTimeout(()=>no(o,o.selectedPoint),0);return}setTimeout(()=>Oi(),0)}},jc=b=>{const{key:A}=b,O=/escape/i.test(A);if(Ja()){if(O)return b.preventDefault(),b.stopPropagation(),ia(o);Me&&A==="d"&&(b.metaKey||b.ctrlKey)&&(b.preventDefault(),b.stopPropagation(),eu())}};let qi;const Zc=()=>({...o});An.subscribe(b=>{Un==="inline"&&o&&o.isEditing&&b==="hidden"&&bl()});const Xc=(b,A)=>{const{textAlign:O="left",fontFamily:ne="sans-serif",fontWeight:oe="normal",fontStyle:he="normal",letterSpacing:Be="normal",textShadowX:ze=0,textShadowY:Ke=0,textShadowBlur:Ot=0,textShadowColor:Kt=void 0,textOutlineWidth:Yt=0,textOutlineColor:bn=void 0}=b,at="!important",oi=`caret-color:${N};text-align:${O}${at};font-family:${ne}${at};font-weight:${oe}${at};font-style:${he}${at};letter-spacing:${Ht(Be)?Be+"px":"normal"}${at}`;if(A==="modal")return oi;const jt=Yt?`;-webkit-text-stroke:${Yt*2}px ${Eo(bn)} ${at}`:"",It=Ot||ze||Ke?`;text-shadow:${ze}px ${Ke}px ${Ot}px ${Eo(Kt)} ${at}`:"";let vt=b.fontSize,Pt=1,kt="";vt>1e3&&ja()&&(Pt=vt/1e3,kt=`transform-origin:0 0;transform:scale(${Pt})`,vt=1e3);let Wt=b.lineHeight/Pt;const Mn=Eo(b.color),xt=Math.max(0,vt-Wt)*.5;return`--font-scalar:${Pt};--bottom-inset:${xt}px;padding:${xt}px 0 0${at};color:${Mn}${at};font-size:${vt}px${at};line-height:${Wt}px${at};${oi};${kt}${jt}${It}`},tf=(b,A,O,ne)=>{let oe,he;b.width&&b.height?(oe=In(b),he=sl(b)):(he=tr(o.text,f),he.width=f.width||he.width,oe=re(b.x+he.width*.5,b.y+he.height*.5));const Be=Math.max(0,b.fontSize-b.lineHeight)+b.lineHeight,ze=et(oe);let Ke=ze.x-A.x-he.width*.5,Ot=ze.y-A.y-he.height*.5,Kt=b.flipX,Yt=b.flipY,bn=b.rotation;an&&Tt?(Kt=!Kt,Yt=!Yt):an?(Kt=!Kt,bn=-bn):Tt&&(Yt=!Yt,bn=-bn),bn+=ne;const at=O*(Kt?-1:1),oi=O*(Yt?-1:1);return`--line-height:${Be}px;width:${he.width}px;height:${he.height}px;transform:translate(${Ke}px,${Ot}px) rotate(${bn}rad) scale(${at}, ${oi})`},jr=()=>Kc(De),Kc=b=>{n(8,qi.innerHTML=kI(b),qi)},Yc=b=>{const A=b.split(/[\n\r]/g);return A.length>1?A.map(O=>O.trim()).filter(O=>O.length).join(" "):A[0]},qc=b=>{const A=b.value===void 0?b.innerHTML:b.value,O=o.format==="text"?CI(A):A;return Bd(o)&&o.disableNewline!==!1?Yc(O):O},nf=b=>{const A=uc(o,b);return A===!0?b:A},fs=()=>{const b=qc(qi),A=uc(o,b),O=A===!0?b:A;let ne=be.x,oe=be.y;if(!o.height){const he=Ro({...Se},o.rotation),Be=tr(O,f),ze=Ro({x:ne,y:oe,...Be},o.rotation),[Ke,,Ot]=he,[Kt,,Yt]=ze;let bn=Ke,at=Kt;o.flipX&&(bn=Ot,at=Yt);const oi=Fi(Ut(bn),at);ne+=oi.x,oe+=oi.y}li(o,{x:ne,y:oe,text:O},ke),ji()},of=b=>{const{target:A,key:O}=b,ne=A.value||A.innerText,oe=A.selectionStart||0,he=A.selectionEnd||ne.length,Be=ne.substring(0,oe),ze=ne.substring(he),Ke=Be+O+ze;if(uc(o,Ke)!==Ke)return b.preventDefault()},rf=b=>{if(Bd(o)&&/enter/i.test(b.key)&&o.disableNewline!==!1)return b.preventDefault();if(/arrow/i.test(b.code))return b.stopPropagation();if(/escape/i.test(b.key))return ds()},js=b=>{const{key:A,ctrlKey:O,metaKey:ne,altKey:oe}=b;return A==="Enter"&&(O||oe||ne)},af=b=>{if(js(b))return bl()},bl=()=>{c&&mo(),qi&&qi.confirm&&qi.confirm(),qi&&fs(),Nr(o),tt(o)},ds=()=>{c?go():(Hi(o,{text:ae.text,x:ae.x,y:ae.y}),Nr(o))},hs=(b,A,{flipX:O,flipY:ne,rotation:oe},he="top left")=>{let Be,ze;const[Ke,Ot,Kt,Yt]=Ro(b,oe),[bn,at,oi,jt]=Ro(A,oe);if(he==="top center"){const It=Kr(ne?[Yt,Kt]:[Ke,Ot]),vt=Kr(ne?[jt,oi]:[bn,at]);Be=It,ze=vt}else he==="top right"&&!O||he==="top left"&&O?(Be=ne?Kt:Ot,ze=ne?oi:at):(Be=ne?Yt:Ke,ze=ne?jt:bn);return Fi(Ut(Be),ze)},Zs=(b,A,O)=>re(Nt(b.x)?cr(A.x+O.x,ke.width):A.x+O.x,Nt(b.y)?cr(A.y+O.y,ke.height):A.y+O.y),Dl={},Jc=()=>no(o,o.selectedPoint),lf=()=>yr(o),ms=(b,A,O)=>{const{width:ne,height:oe,...he}=O,Be=tr(A.text,he),ze=hs(Li(O.x,O.y,b.width,b.height),Li(O.x,O.y,Be.width,Be.he
95ight),O,`top ${A.textAlign}`),Ke=O.disableNewline!==!1;mr(A,["width","height",Ke&&"textAlign"]),Hi(A,{...Zs(A,O,ze)})},gs=(b,A,O,ne,oe={})=>{const{height:he,...Be}=O,ze=Ga(tr(A.text,Be),Yt=>Math.ceil(Yt)),Ke=Ci(oe.width||O.width||ne.width,ze.height),Ot=oe.textAlign||"left",Kt=hs(Li(O.x,O.y,b.width,b.height),Li(O.x,O.y,Ke.width,Ke.height),O,`top ${Ot}`);mr(A,["height"]),Hi(A,{...Zs(A,O,Kt),width:Nt(A.width)?cr(Ke.width,ke.width):Ke.width,textAlign:Ot})},Qc=(b,A,O,ne,oe={})=>{const he=Ci(oe.width||ne.width,oe.height||ne.height),Be=oe.textAlign||"left",ze=hs(Li(O.x,O.y,b.width,b.height),Li(O.x,O.y,he.width,he.height),O,`top ${Be}`);Hi(A,{...Zs(A,O,ze),width:Nt(A.width)?cr(he.width,ke.width):he.width,height:Nt(A.width)?cr(he.height,ke.height):he.height,textAlign:Be})},sf=()=>{const b=Ga(tr(o.text,f),he=>Math.ceil(he)),A=Rt(o,"height"),O=!A&&Rt(o,"width"),ne=o.id;let oe=Dl[ne];if(oe||(Dl[ne]={},oe=Dl[ne]),A){oe.textAlign=o.textAlign,oe.width=f.width,oe.height=f.height;const he=Ci(f.width,f.height);Rs(o,"auto-height")?gs(he,o,f,b,oe):Rs(o,"auto-width")&&ms(he,o,f)}else if(O){oe.textAlign=o.textAlign,oe.width=f.width;const he=Ci(f.width,b.height);Rs(o,"auto-width")?ms(he,o,f):Rs(o,"fixed-size")&&Qc(he,o,f,b,oe)}else{oe.textAlign=o.textAlign||oe.textAlign;const he=Ci(Math.ceil(b.width),Math.ceil(b.height));Rs(o,"fixed-size")?Qc(he,o,f,b,oe):Rs(o,"auto-height")&&gs(he,o,f,b,oe)}},Xs=b=>{b.stopPropagation();const A=o.flipX||!1;ea(o,"flipX",!A),tt(o)},cf=b=>{b.stopPropagation();const A=o.flipY||!1;ea(o,"flipY",!A),tt(o)},$c=b=>{ea(o,"opacity",b)},uf=b=>{$c(b),tt(o)},ff=b=>{b.stopPropagation(),b.target.blur(),Oi()},pl=b=>{b.stopPropagation(),Ie.findIndex(O=>O===o)!==Ie.length-1&&(yt.set(Ie.filter(O=>O!==o).concat([o])),tt(o))},Ks=b=>{b.stopPropagation(),eu()},eu=()=>{const A=(a?r:[o]).filter(X0).map(O=>{const ne=yi(O);ne.id=Yr();const oe=re(50,-50);if(Rt(ne,"points")){const he=_c(ne,["points"],ke);he.points.forEach(Be=>{Be.x+=oe.x,Be.y+=oe.y}),Ua(ne,he,ke)}else if(Io(ne)){const he=_c(ne,["x1","y1","x2","y2"],ke);he.x1+=oe.x,he.y1+=oe.y,he.x2+=oe.x,he.y2+=oe.y,Ua(ne,he,ke)}else{const he=_c(ne,["x","y"],ke);he.x+=50,he.y-=50,Ua(ne,he,ke)}return yt.set([...Ie,ne]),Le(ne),ne});if(A.length>1){na(),A.forEach(O=>{io(O,!0,!0)});return}io(A[0])},Ys=hn(0,{stiffness:.2,damping:.7});B(e,Ys,b=>n(21,dt=b));const df=b=>Or(re(b.x+b.width*.5,b.y),ju);let bs;const ps=(b,A,O,ne)=>{const oe=b.x,he=b.y,Be=oe+b.width;let ze=Math.max(A.x-O.width*.5,oe),Ke=Math.max(A.y-O.height+ne,he);return ze+O.width>Be&&(ze=Be-O.width),re(ze,Ke)},qs=(b,A)=>{const{disableTextLayout:O=[]}=A;return"height"in A?O.includes("auto-height")?b.shapeIconButtonTextLayoutAutoWidth:b.shapeIconButtonTextLayoutAutoHeight:"width"in A?O.includes("auto-width")?b.shapeIconButtonTextLayoutFixedSize:b.shapeIconButtonTextLayoutAutoWidth:O.includes("fixed-size")?b.shapeIconButtonTextLayoutAutoHeight:b.shapeIconButtonTextLayoutFixedSize},ah=(b,A)=>{const{disableTextLayout:O=[]}=A;return"height"in A?O.includes("auto-height")?b.shapeTitleButtonTextLayoutAutoWidth:b.shapeTitleButtonTextLayoutAutoHeight:"width"in A?O.includes("auto-width")?b.shapeTitleButtonTextLayoutFixedSize:b.shapeTitleButtonTextLayoutAutoWidth:O.includes("fixed-size")?b.shapeTitleButtonTextLayoutAutoHeight:b.shapeTitleButtonTextLayoutFixedSize},lh=b=>{const A=Ta();A&&(A.find(wl)||A.find(O=>!Bs(O))||A.forEach(O=>{n(151,zt=O),Co=Ii(yi(zt),ke),zn(zt,Co,b.detail)}))};let Bl=!1;const Js=b=>{n(22,Bl=!0)},zl=({relatedTarget:b})=>{b&&b.classList.contains("shape-selector__button")||n(22,Bl=!1)};let nl=Kn(),ys;const wr=b=>{if(b.pointerType==="touch"||b.target.className!=="PinturaShapeEditor"){it();return}(mi||ei)&&Di(void 0);const A=_m(b,Re);n(154,ys=Ut(A));const O=Or(Bt(A),oe=>Math.round(oe));if(Xl(O,nl)||(nl=Ut(O),J(mi,A,O),mi||ei)||d)return;const[ne]=Uo(Ie,O,0,Ba);ne&&nr(ne)||Di(ne)},Di=b=>{Fn(b),n(153,Dt=b)},tu=b=>{b.pointerType!=="touch"&&it()},Qs=b=>{io(Ie[b])};let _r;function Zr(b){n4(b)&&b.target===_r&&b.preventDefault()}Jr(()=>{us(),vo(),E(),we(),_r.removeEventListener("touchmove",Zr,!1)});function hf(b){Zo.call(this,e,b)}const sh=b=>Qs(b);function $s(b){vn[b?"unshift":"push"](()=>{qi=b,n(8,qi)})}
95function mf(){De=this.value,n(27,De),n(13,U),n(12,o),n(178,X),n(0,Zt),n(193,Ie)}const nu=b=>{const{key:A}=b;if(A==="Enter"){if(js(b))return!0;if(o.disableNewline===!1)return!1}return!0};function ch(b){vn[b?"unshift":"push"](()=>{qi=b,n(8,qi)})}const iu=()=>{_r&&_r.focus()},gf=b=>n(9,bs=b.detail);function ou(b){vn[b?"unshift":"push"](()=>{_r=b,n(10,_r)})}const ru=b=>_m(b,Re);return e.$$set=b=>{"uid"in b&&n(67,nt=b.uid),"ui"in b&&n(68,wt=b.ui),"disabled"in b&&n(0,Zt=b.disabled),"shapes"in b&&V(n(1,yt=b.shapes)),"selection"in b&&n(69,nn=b.selection),"offset"in b&&n(2,Jt=b.offset),"contextRotation"in b&&n(70,yn=b.contextRotation),"contextFlipX"in b&&n(71,an=b.contextFlipX),"contextFlipY"in b&&n(72,Tt=b.contextFlipY),"contextZoom"in b&&n(73,Sn=b.contextZoom),"active"in b&&n(74,ln=b.active),"opacity"in b&&n(75,sn=b.opacity),"parentRect"in b&&n(76,ke=b.parentRect),"rootRect"in b&&n(3,Re=b.rootRect),"utilRect"in b&&n(4,Lt=b.utilRect),"hoverColor"in b&&n(77,fn=b.hoverColor),"caretColor"in b&&n(78,on=b.caretColor),"gridColor"in b&&n(79,En=b.gridColor),"snapColor"in b&&n(80,bt=b.snapColor),"textInputMode"in b&&n(5,Un=b.textInputMode),"oninteractionstart"in b&&n(81,Hn=b.oninteractionstart),"oninteractionupdate"in b&&n(82,$n=b.oninteractionupdate),"oninteractionrelease"in b&&n(83,Q=b.oninteractionrelease),"oninteractionend"in b&&n(84,Ge=b.oninteractionend),"oninteractioncancel"in b&&n(85,j=b.oninteractioncancel),"onaddshape"in b&&n(86,Le=b.onaddshape),"onupdateshape"in b&&n(87,tt=b.onupdateshape),"onselectshape"in b&&n(88,en=b.onselectshape),"onblurshape"in b&&n(89,Xt=b.onblurshape),"onremoveshape"in b&&n(90,Ze=b.onremoveshape),"ontapshape"in b&&n(91,tn=b.ontapshape),"onhovershape"in b&&n(92,Fn=b.onhovershape),"ontriggerhistorywrite"in b&&n(93,K=b.ontriggerhistorywrite),"onhovercanvas"in b&&n(94,J=b.onhovercanvas),"ontapcanvas"in b&&n(95,xe=b.ontapcanvas),"onleavecanvas"in b&&n(96,it=b.onleavecanvas),"beforeSelectShape"in b&&n(97,Ye=b.beforeSelectShape),"beforeDeselectShape"in b&&n(98,ct=b.beforeDeselectShape),"beforeRemoveShape"in b&&n(99,ot=b.beforeRemoveShape),"beforeUpdateShape"in b&&n(100,Ct=b.beforeUpdateShape),"willRenderShapeControls"in b&&n(101,cn=b.willRenderShapeControls),"willRenderShapeTextControls"in b&&n(102,Qt=b.willRenderShapeTextControls),"willStartInteraction"in b&&n(103,_n=b.willStartInteraction),"mapEditorPointToImagePoint"in b&&n(104,Bt=b.mapEditorPointToImagePoint),"mapImagePointToEditorPoint"in b&&n(105,et=b.mapImagePointToEditorPoint),"eraseRadius"in b&&n(106,ri=b.eraseRadius),"selectRadius"in b&&n(107,Gn=b.selectRadius),"enableButtonFlipVertical"in b&&n(108,Ri=b.enableButtonFlipVertical),"enableTapToAddText"in b&&n(109,ai=b.enableTapToAddText),"enableMultiSelect"in b&&n(110,ui=b.enableMultiSelect),"enableTextStyleControls"in b&&n(6,Yn=b.enableTextStyleControls),"locale"in b&&n(7,_t=b.locale),"snapThreshold"in b&&n(111,Dn=b.snapThreshold),"snapPointer"in b&&n(112,Vn=b.snapPointer),"enableSnapToContext"in b&&n(113,ni=b.enableSnapToContext),"gridSize"in b&&n(114,Bn=b.gridSize)},e.$$.update=()=>{if(e.$$.dirty[2]&16384|e.$$.dirty[3]&2097152&&n(180,i=Bn>0?{x:0,y:0,...ke}:void 0),e.$$.dirty[0]&1|e.$$.dirty[6]&128&&n(12,o=!Zt&&Ie&&(Yo()||br())),e.$$.dirty[3]&131072|e.$$.dirty[6]&128&&n(172,r=ui?Ie.filter(Va):[]),e.$$.dirty[5]&131072&&n(171,a=r.length>1),e.$$.dirty[2]&16384|e.$$.dirty[5]&196608&&n(192,l=a?r.map(b=>Ii(yi(b),ke)):[]),e.$$.dirty[0]&4096&&n(189,s=!!o),e.$$.dirty[0]&4096&&n(174,c=o&&nr(o)),e.$$.dirty[0]&4096|e.$$.dirty[5]&524288&&n(11,u=o&&!c?o.id:void 0),e.$$.dirty[0]&4104|e.$$.dirty[2]&16384&&n(15,f=Re&&o&&Ii(yi(o),ke)),e.$$.dirty[0]&4096|e.$$.dirty[5]&524288&&n(155,d=!!(o&&c)),e.$$.dirty[0]&36864|e.$$.dirty[2]&8192&&n(187,m=o&&sn&&Sr(f)||[]),e.$$.dirty[5]&65536|e.$$.dirty[6]&64&&n(184,g=a?l.map(Sr):[]),e.$$.dirty[0]&4096|e.$$.dirty[5]&65536&&n(191,p=!a&&o&&S_(o)&&!wl(o)),e.$$.dirty[0]&4096|e.$$.dirty[5]&65536&&n(18,y=!a&&o&&w_(o)&&!wl(o)),e.$$.dirty[0]&4096&&n(16,w=o&&zi(o)&&!zd(o)&&!wl(o)&&o.disableTextScale===!1),e.$$.dirty[0]&4096|e.$$.dirty[6]&32&&n(20,_=p?gl(o):!1),e.$$.dirty[0]&1052672|e.$$.dirty[6]&32&&n(33,P=o?Array.isArray(_)?!1:p:!1),e.$$.dirty[5]&196608&&n(190,C=a?hl(r):[]),e.$$.dirty[0]&4096|e.$$.dirty[5]&65536|e.$$.dirty[6]&2&&n(17,R=o&&m.length>1||a),e.$$.dirty[3]&4096|e.$$.dirty[5]&65536|e.$$.dirty[6]&18&&n(185,I=a?C.map(et):m.map(et)),e.$$.dirty[0]&4|e.$$.dirty[5]&1073741824&&n(14,M=I.map(b=>re(b.x-Jt.x,b.y-Jt.y))),e.$$.dirty[0]&4096&&n(19,T=o&&o.points&&Ht(o.selectedPoint)?o.selectedPoint:-1),e.$$.dirty[0]&524288&&n(164,v=T>=0),e.$$.dirty[0]&540672|e.$$.dirty[5]&512&&n(169,H=v?M[T]:void 0),e.$$.dirty[0]&4096|e.$$.dirty[6]&8&&n(32,Y=s&&(zd(o)?Rt(o,"disableNewline")?!o.disableNewline:!0:o.disableNewline===!1)),e.$$.dirty[3]&4096|e.$$.dirty[4]&536870912&&(Dt&&et&&!Va(Dt)&&Ba(Dt)?rt(Dt):we()),e.$$.dirty[0]&442368|e.$$.dirty[2]&8192&&n(186,Z=R&&y&&sn&&M?oa(f):void 0),e.$$.dirty[0]&4|e.$$.dirty[6]&1&&n(31,W=Z&&re(Z.position.x-Jt.x,Z.position.y-Jt.y)),e.$$.dirty[0]&245760|e.$$.dirty[2]&8192&&n(188,$=R&&w&&sn&&M?Ol(f):void 0),e.$$.dirty[0]&4|e.$$.dirty[6]&4&&n(30,S=$&&re
95($.x-Jt.x,$.y-Jt.y)),e.$$.dirty[6]&512&&n(179,Fe=!!(We||[]).find(b=>[91,93,17].includes(b))),e.$$.dirty[3]&524288|e.$$.dirty[5]&16777216&&n(181,pe=!(Fe||!Vn)),e.$$.dirty[0]&4096|e.$$.dirty[2]&8192|e.$$.dirty[4]&1073741824|e.$$.dirty[5]&1141374976&&o&&I&&sn>0&&(Pn(),Tn(sn,o,c&&Vi(o)?ki({...ys},!pe):void 0)),e.$$.dirty[0]&4096&&(o||(jn(),E())),e.$$.dirty[3]&4096|e.$$.dirty[5]&536870912)if(g.length){gi();const b=g.map(A=>({id:Zn,points:A.map(et),strokeWidth:1,strokeColor:[1,1,1,.5],pathClose:!0}));Ti(...b)}else gi();e.$$.dirty[4]&536870912&&n(182,ge=!!Dt),e.$$.dirty[4]&134217728&&n(183,de=!!zt),e.$$.dirty[4]&1073741824|e.$$.dirty[5]&469762048&&ys&&!de&&!ge&&ki({...ys},!pe),e.$$.dirty[2]&131072|e.$$.dirty[3]&2101248|e.$$.dirty[5]&33554432|e.$$.dirty[6]&1024&&Bn>0&&i&&et&&Po(Bn,i,En,Xe),e.$$.dirty[2]&262144|e.$$.dirty[3]&4096|e.$$.dirty[4]&100663296|e.$$.dirty[5]&16777216&&et&&(Fe?us():Dc(Vr,Pr,bt)),e.$$.dirty[2]&4096&&Bc(ln),e.$$.dirty[6]&512&&We&&We.length&&Gc(),e.$$.dirty[0]&288&&qi&&Un==="inline"&&qi.focus(),e.$$.dirty[0]&4096&&n(178,X=o&&zi(o)),e.$$.dirty[0]&4096|e.$$.dirty[5]&8388608&&n(13,U=X&&uc(o)!==!1&&wl(o)),e.$$.dirty[0]&8192&&n(173,ae=U?Zc():void 0),e.$$.dirty[2]&16384|e.$$.dirty[5]&262144&&n(175,be=ae&&Ii({...ae},ke)),e.$$.dirty[5]&1048576&&n(177,ft=be&&tr(be.text,be)),e.$$.dirty[5]&5242880&&(Se=be&&Li(be.x,be.y,ft.width,ft.height)),e.$$.dirty[0]&12288&&n(27,De=U?o.text:""),e.$$.dirty[0]&12296|e.$$.dirty[2]&16384&&n(176,Mt=Re&&o&&U&&Ii({...yi(o),width:Ht(o.width)?Math.floor(o.width):void 0,height:Ht(o.height)?Math.floor(o.height):void 0},ke)),e.$$.dirty[0]&8224|e.$$.dirty[5]&2097152&&n(29,gt=U&&Xc(Mt,Un)),e.$$.dirty[0]&8196|e.$$.dirty[2]&2304|e.$$.dirty[5]&2097152&&n(28,ie=U&&tf(Mt,Jt,Sn,yn)),e.$$.dirty[2]&65536&&(N=on?Eo(on):"auto"),e.$$.dirty[0]&8480&&U&&qi&&Un==="inline"&&jr(),e.$$.dirty[0]&4096|e.$$.dirty[5]&33&&n(160,le=o&&!d?o:le),e.$$.dirty[5]&32&&n(162,Te=le&&y_(le)),e.$$.dirty[5]&32&&n(157,me=le&&Rs(le)),e.$$.dirty[5]&32&&n(159,Me=le&&X0(le)),e.$$.dirty[5]&32&&n(158,qe=le&&od(le)),e.$$.dirty[5]&65568&&n(161,Ne=!a&&le&&p_(le)),e.$$.dirty[5]&32&&n(156,mt=le&&uc(le)!==!1),e.$$.dirty[5]&32&&n(163,ue=le&&Rt(le,"backgroundImage")&&tm(le,"opacity")),e.$$.dirty[0]&4128&&n(166,He=o&&o.format==="html"&&Un==="inline"),e.$$.dirty[0]&4096|e.$$.dirty[5]&2049&&n(170,Qe=o&&(!d||He)),e.$$.dirty[4]&268435456|e.$$.dirty[5]&32768|e.$$.dirty[6]&256&&Ys.set(Qe&&!mi?1:0,{hard:Ft===!1}),e.$$.dirty[0]&16384|e.$$.dirty[5]&40960&&n(168,G=Qe&&M.length?df(Qi(M)):G),e.$$.dirty[0]&528|e.$$.dirty[5]&24576&&n(167,je=(H||G)&&bs&&Lt&&ps(Lt,H||G,bs,-16)),e.$$.dirty[5]&4096&&n(26,ye=je?`translate(${je.x}px, ${je.y}px)`:void 0),e.$$.dirty[0]&2097152|e.$$.dirty[5]&4096&&n(25,$e=je?dt:void 0),e.$$.dirty[0]&8192&&n(165,St=U?"text":"shape"),e.$$.dirty[0]&6272|e.$$.dirty[3]&33536|e.$$.dirty[5]&4094|e.$$.dirty[6]&128&&n(24,Je=St==="text"&&Qt&&He?Zu(()=>Qt([["div","text-styles",{class:"PinturaShapeControlsGroup"},[...[["bold",{label:"B",style:"font-weight:900;",title:"Bold",shortcut:["CMD","B"]}],["italic",{label:"I",style:"font-family:Times New Roman;font-style:italic;",title:"Italic",shortcut:["CMD","I"]}],["underline",{label:"U",style:"text-decoration:underline;",title:"Underline",shortcut:["CMD","U"]}],["strikeThrough",{label:"S",style:"text-decoration:line-through;",title:"Strikethrough",shortcut:["CMD","S"]}]].map(([b,A])=>["Button","style-"+b,{onclick:()=>document.execCommand(b),...A,style:"font-size:1.25em;text-underline-offset:1px;text-decoration-thickness:1.5px;font-weight:400;"+A.style}])]],["div","text-reset",{class:"PinturaShapeControlsGroup"},[["Button","style-reset",{onclick:()=>document.execCommand("removeFormat"),style:"font-weight:400",title:"Remove styles",label:[["span","T",{style:"font-size:1.25em;font-style:italic;font-family:Times New Roman;text-decoration:underline",textContent:"T"}],["span","x",{style:"position:relative;top:.175rem;",innerHTML:"&times;"}]]}]]]],u)):St==="shape"&&cn&&u?Zu(()=>cn(v?[["div","epsilon",{class:"PinturaShapeControlsGroup"},[["Button","remove-point",{onclick:Jc,label:_t.shapeTitleButtonRemove,icon:_t.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]]]]:[ue&&["div","alpha",{class:"PinturaShapeControlsGroup"},[["ToggleSlider","adjust-opacity",{onrelease:uf,onchange:$c,step:.01,value:Rt(o,"opacity")?o.opacity:1,label:(b,A,O)=>`${Math.round(b/O*100)}%`,min:0,max:1,direction:"x"}]]],["div","beta",{class:"PinturaShapeControlsGroup"},[Te&&["Button","flip-horizontal",{onclick:Xs,label:_t.shapeTitleButtonFlipHorizontal,icon:_t.shapeIconButtonFlipHorizontal,hideLabel:!0}
95],Te&&Ri&&["Button","flip-vertical",{onclick:cf,label:_t.shapeTitleButtonFlipVertical,icon:_t.shapeIconButtonFlipVertical,hideLabel:!0}],Ne&&["Button","to-front",{onclick:pl,label:_t.shapeTitleButtonMoveToFront,icon:_t.shapeIconButtonMoveToFront,hideLabel:!0,disabled:Ie[Ie.length-1]===le}],Me&&["Button","duplicate",{onclick:Ks,label:_t.shapeTitleButtonDuplicate,icon:_t.shapeIconButtonDuplicate,shortcut:["CMD","D"],hideLabel:!0}],qe&&["Button","remove",{onclick:ff,label:_t.shapeTitleButtonRemove,icon:_t.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]].filter(Boolean)],mt&&me&&["div","gamma",{class:"PinturaShapeControlsGroup"},[["Button","text-layout",{onclick:sf,label:Lo(ah,_t,o),icon:Lo(qs,_t,o),hideLabel:!0}]]],mt&&["div","delta",{class:"PinturaShapeControlsGroup"},[["Button","edit-text",{label:_t.shapeLabelInputText,onclick:lf}]]]].filter(Boolean),u)):[]),e.$$.dirty[0]&128|e.$$.dirty[6]&128&&n(23,q=Ie.filter(Ba).filter(b=>b.id).filter(b=>!nr(b)).map(b=>({id:b.id,color:zi(b)?b.color:Io(b)?b.strokeColor:b.backgroundColor,name:b.name||_t[`shapeLabelTool${yS(A_(b))}`]}))),e.$$.dirty[0]&1024&&_r&&_r.addEventListener("touchmove",Zr,!1)},[Zt,yt,Jt,Re,Lt,Un,Yn,_t,qi,bs,_r,u,o,U,M,f,w,R,y,T,_,dt,Bl,q,Je,$e,ye,De,ie,gt,S,W,Y,P,pi,Qr,Ra,el,Fl,vl,tl,si,Ns,zc,Vc,Wc,Uc,Hc,Gs,ef,Nc,jc,nf,fs,of,rf,js,af,bl,ds,Ys,lh,Js,zl,wr,tu,Qs,nt,wt,nn,yn,an,Tt,Sn,ln,sn,ke,fn,on,En,bt,Hn,$n,Q,Ge,j,Le,tt,en,Xt,Ze,tn,Fn,K,J,xe,it,Ye,ct,ot,Ct,cn,Qt,_n,Bt,et,ri,Gn,Ri,ai,ui,Dn,Vn,ni,Bn,Cn,_i,fi,eo,di,dr,So,Wr,ul,Yo,Hr,fl,mo,go,qa,ji,mr,Hi,ea,gr,ta,Ta,br,Ja,na,io,ia,yr,Nr,Qa,Gr,Wo,Uo,Ca,Vr,Pr,zt,mi,Dt,ys,d,mt,me,qe,Me,le,Ne,Te,ue,v,St,He,je,G,H,Qe,a,r,ae,c,be,Mt,ft,X,Fe,i,pe,ge,de,g,I,Z,m,$,s,C,p,l,Ie,Ft,We,Xe,hf,sh,$s,mf,nu,ch,iu,gf,ou,ru]}class xI extends gn{constructor(t){super(),mn(this,t,LI,II,rn,{uid:67,ui:68,disabled:0,shapes:1,selection:69,offset:2,contextRotation:70,contextFlipX:71,contextFlipY:72,contextZoom:73,active:74,opacity:75,parentRect:76,rootRect:3,utilRect:4,hoverColor:77,caretColor:78,gridColor:79,snapColor:80,textInputMode:5,oninteractionstart:81,oninteractionupdate:82,oninteractionrelease:83,oninteractionend:84,oninteractioncancel:85,onaddshape:86,onupdateshape:87,onselectshape:88,onblurshape:89,onremoveshape:90,ontapshape:91,onhovershape:92,ontriggerhistorywrite:93,onhovercanvas:94,ontapcanvas:95,onleavecanvas:96,beforeSelectShape:97,beforeDeselectShape:98,beforeRemoveShape:99,beforeUpdateShape:100,willRenderShapeControls:101,willRenderShapeTextControls:102,willStartInteraction:103,mapEditorPointToImagePoint:104,mapImagePointToEditorPoint:105,eraseRadius:106,selectRadius:107,enableButtonFlipVertical:108,enableTapToAddText:109,enableMultiSelect:110,enableTextStyleControls:6,locale:7,snapThreshold:111,snapPointer:112,enableSnapToContext:113,gridSize:114,syncShapeCollection:115,getShapeDraft:116,addShapeDraft:117,discardShapeDraft:118,confirmShapeDraft:119,updateShapeDraft:120,addShape:121,createShape:122,eraseShape:123,getMarkupItemDraft:124,getMarkupItemDraftIndex:125,addMarkupItemDraft:126,confirmMarkupItemDraft:127,discardMarkupItemDraft:128,createMarkupItem:129,syncShapes:130,removeMarkupShapeProps:131,updateMarkupShape:132,updateMarkupShapeProperty:133,updateMarkupItemsShapeProperty:134,updateMarkupShapeItems:135,getActiveMarkupItems:136,getActiveMarkupItem:137,hasActiveMarkupItem:138,blurShapes:139,selectShape:140,deselectMarkupItem:141,editMarkupItem:142,finishEditMarkupItem:143,removeMarkupItems:144,getTextShapeRect:145,getMarkupShapeRect:146,getShapesNearPosition:147,getShapesBetweenPoints:148},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get syncShapeCollection(){return this.$$.ctx[115]}get getShapeDraft(){return this.$$.ctx[116]}get addShapeDraft(){return this.$$.ctx[117]}get discardShapeDraft(){return this.$$.ctx[118]}get confirmShapeDraft(){return this.$$.ctx[119]}get updateShapeDraft(){return this.$$.ctx[120]}get addShape(){return this.$$.ctx[121]}get createShape(){return this.$$.ctx[122]}get eraseShape(){return this.$$.ctx[123]}get getMarkupItemDraft(){return this.$$.ctx[124]}get getMarkupItemDraftIndex(){return this.$$.ctx[125]}get addMarkupItemDraft(){return this.$$.ctx[126]}get confirmMarkupItemDraft(){return this.$$.ctx[127]}get discardMarkupItemDraft(){return this.$$.ctx[128]}get createMarkupItem(){return this.$$.ctx[129]}get syncShapes(){return this.$$.ctx[130]}get removeMarkupShapeProps(){return this.$$.ctx[131]}get updateMarkupShape(){return this.$$.ctx[132]}get updateMarkupShapeProperty(){return this.$$.ctx[133]}get updateMarkupItemsShapeProperty(){return this.$$.ctx[134]}get updateMarkupShapeItems(){return this.$$.ctx[135]}get getActiveMarkupItems(){return this.$$.ctx[136]}get getActiveMarkupItem(){return this.$$.ctx[137]}get hasActiveMarkupItem(){return this.$$.ctx[138]}get blurShapes(){return this.$$.ctx[139]}get selectShape(){return this.$$.ctx[140]}get deselectMarkupItem(){return this.$$.ctx[141]}get editMarkupItem(){return this.$$.ctx[142]}get finishEditMarkupItem(){return this.$$.ctx[143]}get removeMarkupItems(){return this.$$.ctx[144]}get getTextShapeRect(){return this.$$.ctx[145]}get getMarkupShapeRect(){return this.$$.ctx[146]}get getShapesNearPosition(){return this.$$.ctx[147]}get getShapesBetweenPoints(){return this.$$.ctx[148]}}function FI(e){let t,n,i;return n=new Xo({props:{items:e[2]}}),{c(){t=fe("ul"),Ve(n.$$.fragment),k(t,"class","PinturaShapeStyleList")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r&4&&(a.items=o[2]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function vI(e){let t,n;return t=new Ka({props:{class:"PinturaShapeStyles",elasticity:e[0],$$slots:{default:[OI]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&1&&(r.elasticity=i[0]),o&524292&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function OI(e){let t,n,i;return n=new Xo({props:{items:e[2]}}),{c(){t=fe("ul"),Ve(n.$$.fragment),k(t,"class","PinturaShapeStyleList")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r&4&&(a.items=o[2]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function DI(e){let t,n,i,o;const r=[vI,FI],a=[];function l(s,c){return s[1]?0:1}return n=l(e),i=a[n]=r[n](e),{c(){t=fe("div"),i.c(),Ee(t,"opacity",e[5]),Ee(t,"pointer-events",e[4]),Ee(t,"visibility",e[3])},m(s,c){te(s,t,c),a[n].m(t,null),o=!0},p(s,[c]){let u=n;n=l(s),n===u?a[n].p(s,c):(Et(),z(a[u],1,1,()=>{a[u]=null}),At(),i=a[n],i?i.p(s,c):(i=a[n]=r[n](s),i.c()),L(i,1),i.m(t,null)),c&32&&Ee(t,"opacity",s[5]),c&16&&Ee(t,"pointer-events",s[4]),c&8&&Ee(t,"visibility",s[3])},i(s){o||(L(i),o=!0)},o(s){z(i),o=!1},d(s){s&&ee(t),a[n].d()}}}
95function BI(e,t,n){let i,o,r,a,l,s,c,u,{isActive:f=!1}=t,{controls:d=[]}=t,{locale:m}=t,{scrollElasticity:g}=t,{scrollEnable:p=!0}=t,{hideTitles:y=!1}=t,{willRenderControls:w=Nn}=t;const _=Qn("redrawTrigger");B(e,_,I=>n(16,s=I));const P=Qn("env");B(e,P,I=>n(15,l=I));const C=Qn("isAnimated");B(e,C,I=>n(18,u=I));const R=hn(0,{stiffness:.25,damping:.9});return B(e,R,I=>n(17,c=I)),e.$$set=I=>{"isActive"in I&&n(10,f=I.isActive),"controls"in I&&n(11,d=I.controls),"locale"in I&&n(12,m=I.locale),"scrollElasticity"in I&&n(0,g=I.scrollElasticity),"scrollEnable"in I&&n(1,p=I.scrollEnable),"hideTitles"in I&&n(13,y=I.hideTitles),"willRenderControls"in I&&n(14,w=I.willRenderControls)},e.$$.update=()=>{e.$$.dirty&263168&&R.set(f?1:0,{hard:u===!1}),e.$$.dirty&131072&&n(5,i=c),e.$$.dirty&1024&&n(4,o=f?"auto":"none"),e.$$.dirty&131072&&n(3,r=c<=0?"hidden":"visible"),e.$$.dirty&129024&&n(2,a=s&&w(d.map(I=>["ShapeStyle",I.id,{title:I.componentProps.title,locale:m,hideTitle:y,items:[[I.component,I.id,I.componentProps]]}]),l,()=>_.set({})))},[g,p,a,r,o,i,_,P,C,R,f,d,m,y,w,l,s,c,u]}class zI extends gn{constructor(t){super(),mn(this,t,BI,DI,rn,{isActive:10,controls:11,locale:12,scrollElasticity:0,scrollEnable:1,hideTitles:13,willRenderControls:14})}}function Op(e,t,n){const i=e.slice();return i[15]=t[n].key,i[6]=t[n].controls,i[16]=t[n].isActive,i}function Dp(e,t){let n,i,o;return i=new zI({props:{isActive:t[16],controls:t[6],locale:t[1],scrollElasticity:t[2],scrollEnable:t[3],hideTitles:t[4],willRenderControls:t[5]}}),{key:e,first:null,c(){n=Mi(),Ve(i.$$.fragment),this.first=n},m(r,a){te(r,n,a),ve(i,r,a),o=!0},p(r,a){t=r;const l={};a&128&&(l.isActive=t[16]),a&128&&(l.controls=t[6]),a&2&&(l.locale=t[1]),a&4&&(l.scrollElasticity=t[2]),a&8&&(l.scrollEnable=t[3]),a&16&&(l.hideTitles=t[4]),a&32&&(l.willRenderControls=t[5]),i.$set(l)},i(r){o||(L(i.$$.fragment,r),o=!0)},o(r){z(i.$$.fragment,r),o=!1},d(r){r&&ee(n),Oe(i,r)}}}function VI(e){let t,n=[],i=new Map,o,r,a=xo(e[7]);const l=s=>s[15];for(let s=0;s<a.length;s+=1){let c=Op(e,a,s),u=l(c);i.set(u,n[s]=Dp(u,c))}return{c(){t=fe("div");for(let s=0;s<n.length;s+=1)n[s].c();k(t,"class",o=pn(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]]))},m(s,c){te(s,t,c);for(let u=0;u<n.length;u+=1)n[u]&&n[u].m(t,null);r=!0},p(s,[c]){c&190&&(a=xo(s[7]),Et(),n=cl(n,c,l,1,s,a,i,t,cs,Dp,null,Op),At()),(!r||c&9&&o!==(o=pn(["PinturaShapeStyleEditor",!s[3]&&"PinturaShapeStyleEditorOverflow",s[0]])))&&k(t,"class",o)},i(s){if(!r){for(let c=0;c<a.length;c+=1)L(n[c]);r=!0}},o(s){for(let c=0;c<n.length;c+=1)z(n[c]);r=!1},d(s){s&&ee(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function WI(e,t,n){let i,o,r,{class:a=void 0}=t,{controls:l={}}=t,{shapeProps:s=void 0}=t,{onchange:c}=t,{locale:u}=t,{scrollElasticity:f}=t,{scrollEnable:d=!0}=t,{hideTitles:m=!1}=t,{willRenderControls:g}=t;const p=_=>i.filter(C=>C.split("_").every(R=>Rt(_,R)&&tm(_,R))).map(C=>{const I=(_.settings&&_.settings[C]||{}).control||C,M=C.split("_");let T=M.length>1?M.map(Z=>_[Z]):_[C];if(xn(l[I])){const{title:Z,component:W}=l[I](T,$=>{c({[C]:$})},{selectedShapeId:_.id});return{id:I,component:Xo,componentProps:{title:Z,items:W}}}let[v,H]=l[I];if(Nt(v)&&l[v]){const Z={...H};[v,H]=l[v],H={...H,...Z}}const Y=xn(H.options)?H.options(_):H.options;return v==="RadioGroup"&&(H.selectedIndex=-1),xn(H.formatValue)&&(T=H.formatValue(T)),{id:I,component:v,componentProps:{...H,options:Y,locale:u,value:T,optionLabelClass:"PinturaButtonLabel",onchange:Z=>{let W=ls(Z)&&!Si(Z)?Z.value:Z;xn(H.formatValue)&&(W=H.formatValue(W)),H.onchange&&H.onchange(W,_);const $=M.length>1?M.reduce((S,pe,ge)=>({...S,[pe]:Array.isArray(W)?W[ge]:W}),{}):{[C]:W};c($)}}}}).filter(Boolean),y=[],w=(_,P)=>{let C=y.find(R=>R.key===_);return C||(C={key:_,controls:P},y.push(C)),y.forEach(R=>R.isActive=!1),C.controls=P,C.isActive=!0,y};return e.$$set=_=>{"class"in _&&n(0,a=_.class),"controls"in _&&n(6,l=_.controls),"shapeProps"in _&&n(8,s=_.shapeProps),"onchange"in _&&n(9,c=_.onchange),"locale"in _&&n(1,u=_.locale),"scrollElasticity"in _&&n(2,f=_.scrollElasticity),"scrollEnable"in _&&n(3,d=_.scrollEnable),"hideTitles"in _&&n(4,m=_.hideTitles),"willRenderControls"in _&&n(5,g=_.willRenderControls)},e.$$.update=()=>{e.$$.dirty&64&&n(11,i=Object.keys(l).filter(_=>l[_])),e.$$.dirty&2304&&n(10,o=s&&Object.keys(s).length&&i&&tm(s)?p(s):[]),e.$$.dirty&1280&&n(7,r=w(s&&Object.keys(s).length?Object.keys(s).join("_"):"none",o||[]))},[a,u,f,d,m,g,l,r,s,c,o,i]}
95class oh extends gn{constructor(t){super(),mn(this,t,WI,VI,rn,{class:0,controls:6,shapeProps:8,onchange:9,locale:1,scrollElasticity:2,scrollEnable:3,hideTitles:4,willRenderControls:5})}}var R4=e=>/<svg /.test(e);function UI(e){let t,n;return t=new Xo({props:{items:e[10]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&1024&&(r.items=i[10]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function HI(e){let t,n,i,o;const r=[GI,NI],a=[];function l(s,c){return s[8]?0:1}return t=l(e),n=a[t]=r[t](e),{c(){n.c(),i=Mi()},m(s,c){a[t].m(s,c),te(s,i,c),o=!0},p(s,c){let u=t;t=l(s),t===u?a[t].p(s,c):(Et(),z(a[u],1,1,()=>{a[u]=null}),At(),n=a[t],n?n.p(s,c):(n=a[t]=r[t](s),n.c()),L(n,1),n.m(i.parentNode,i))},i(s){o||(L(n),o=!0)},o(s){z(n),o=!1},d(s){s&&ee(i),a[t].d(s)}}}function NI(e){let t,n,i,o,r=e[10]&&Bp(e);return i=new Ka({props:{scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[jI]},$$scope:{ctx:e}}}),{c(){t=fe("div"),r&&r.c(),n=ut(),Ve(i.$$.fragment),k(t,"class","PinturaShapePresetsFlat")},m(a,l){te(a,t,l),r&&r.m(t,null),Ae(t,n),ve(i,t,null),o=!0},p(a,l){a[10]?r?(r.p(a,l),l&1024&&L(r,1)):(r=Bp(a),r.c(),L(r,1),r.m(t,n)):r&&(Et(),z(r,1,1,()=>{r=null}),At());const s={};l&512&&(s.scrollAutoCancel=a[9]),l&1&&(s.elasticity=a[0]),l&536871070&&(s.$$scope={dirty:l,ctx:a}),i.$set(s)},i(a){o||(L(r),L(i.$$.fragment,a),o=!0)},o(a){z(r),z(i.$$.fragment,a),o=!1},d(a){a&&ee(t),r&&r.d(),Oe(i)}}}function GI(e){let t,n,i,o,r;n=new Ka({props:{elasticity:e[0],class:"PinturaShapePresetsGroups",$$slots:{default:[KI]},$$scope:{ctx:e}}});const a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[11]},e[12]];let l={$$slots:{default:[qI,({panel:s,panelIsActive:c})=>({26:s,27:c}),({panel:s,panelIsActive:c})=>(s?67108864:0)|(c?134217728:0)]},$$scope:{ctx:e}};for(let s=0;s<a.length;s+=1)l=wi(l,a[s]);return o=new th({props:l}),{c(){t=fe("div"),Ve(n.$$.fragment),i=ut(),Ve(o.$$.fragment),k(t,"class","PinturaShapePresetsGrouped")},m(s,c){te(s,t,c),ve(n,t,null),Ae(t,i),ve(o,t,null),r=!0},p(s,c){const u={};c&1&&(u.elasticity=s[0]),c&536876128&&(u.$$scope={dirty:c,ctx:s}),n.$set(u);const f=c&6144?fo(a,[a[0],a[1],c&2048&&{panels:s[11]},c&4096&&yo(s[12])]):{};c&738206239&&(f.$$scope={dirty:c,ctx:s}),o.$set(f)},i(s){r||(L(n.$$.fragment,s),L(o.$$.fragment,s),r=!0)},o(s){z(n.$$.fragment,s),z(o.$$.fragment,s),r=!1},d(s){s&&ee(t),Oe(n),Oe(o)}}}function Bp(e){let t,n;return t=new Xo({props:{items:e[10]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&1024&&(r.items=i[10]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function jI(e){let t,n;return t=new ag({props:{items:e[7],onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&128&&(r.items=i[7]),o&2&&(r.onclickitem=i[1]),o&4&&(r.ongrabitem=i[2]),o&8&&(r.ondragitem=i[3]),o&16&&(r.ondropitem=i[4]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function zp(e){let t,n;return t=new Xo({props:{items:e[10]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&1024&&(r.items=i[10]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Vp(e){let t,n;return t=new Br({props:{$$slots:{default:[ZI]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&805306368&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function ZI(e){let t,n=e[28].icon+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o&268435456&&n!==(n=i[28].icon+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function Wp(e){let t,n=e[28].label+"",i;return{c(){t=fe("span"),i=bi(n)},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r&268435456&&n!==(n=o[28].label+"")&&vi(i,n)},d(o){o&&ee(t)}}}function XI(e){let t,n,i,o=e[28].icon&&Vp(e),r=!e[28].hideLabel&&Wp(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[28].icon?o?(o.p(a,l),l&268435456&&L(o,1)):(o=Vp(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[28].hideLabel?r&&(r.d(1),r=null):r?r.p(a,l):(r=Wp(a),r.c(),r.m(n.parentNode,n))},i(a){i||(L(o),i=!0)},o(a){z(o),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function KI(e){let t,n,i,o=e[10]&&zp(e);const r=[{class:"PinturaControlList"},{tabs:e[5]},e[12],{layout:"compact"}];let a={$$slots:{default:[XI,({tab:l})=>({28:l}),({tab:l})=>l?268435456:0]},$$scope:{ctx:e}};for(let l=0;l<r.length;l+=1)a=wi(a,r[l]);return n=new eh({props:a}),n.$on("select",e[18]),{c(){o&&o.c(),t=ut(),Ve(n.$$.fragment)},m(l,s){o&&o.m(l,s),te(l,t,s),ve(n,l,s),i=!0},p(l,s){l[10]?o?(o.p(l,s),s&1024&&L(o,1)):(o=zp(l),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At());const c=s&4128?fo(r,[r[0],s&32&&{tabs:l[5]},s&4096&&yo(l[12]),r[3]]):{};s&805306368&&(c.$$scope={dirty:s,ctx:l}),n.$set(c)},i(l){i||(L(o),L(n.$$.fragment,l),i=!0)},o(l){z(o),z(n.$$.fragment,l),i=!1},d(l){l&&ee(t),o&&o.d(l),Oe(n,l)}}}function YI(e){let t,n;return t=new ag({props:{items:e[13][e[26]].items,disabled:e[13][e[26]].disabled,onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&67117056&&(r.items=i[13][i[26]].items),o&67117056&&(r.disabled=i[13][i[26]].disabled),o&2&&(r.onclickitem=i[1]),o&4&&(r.ongrabitem=i[2]),o&8&&(r.ondragitem=i[3]),o&16&&(r.ondropitem=i[4]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function qI(e){let t,n;return t=new Ka({props:{scroll:e[27]?{scrollOffset:0,animate:!1}:void 0,scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[YI]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o&134217728&&(r.scroll=i[27]?{scrollOffset:0,animate:!1}:void 0),o&512&&(r.scrollAutoCancel=i[9]),o&1&&(r.elasticity=i[0]),o&603987998&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function JI(e){let t,n,i,o;const r=[HI,UI],a=[];function l(s,c){return s[9]?0:s[10]?1:-1}return~(n=l(e))&&(i=a[n]=r[n](e)),{c(){t=fe("div"),i&&i.c(),k(t,"class","PinturaShapePresetsPalette")},m(s,c){te(s,t,c),~n&&a[n].m(t,null),o=!0},p(s,[c]){let u=n;n=l(s),n===u?~n&&a[n].p(s,c):(i&&(Et(),z(a[u],1,1,()=>{a[u]=null}),At()),~n?(i=a[n],i?i.p(s,c):(i=a[n]=r[n](s),i.c()),L(i,1),i.m(t,null)):i=null)},i(s){o||(L(i),o=!0)},o(s){z(i),o=!1},d(s){s&&ee(t),~n&&a[n].d()}}}
95function QI(e,t,n){let i,o,r,a,l,s,c,u,f,{locale:d}=t,{presets:m}=t,{scrollElasticity:g}=t,{enableSelectImage:p=!0}=t,{willRenderPresetToolbar:y=Nn}=t,{onaddpreset:w=st}=t,{ongrabpreset:_=void 0}=t,{ondragpreset:P=void 0}=t,{ondroppreset:C=void 0}=t;const R=`presets-${Yr()}`,I=W=>Si(W)&&Nt(W[0])&&Si(W[1]),M=(W,$="")=>R4(W)?W:vd(W)?Fy(W,$):`<img src="${W}" alt="${$}"/>`,T=W=>hy(xm(W)),v=["src","alt","thumb","shape","id","mount","disabled"],H=W=>{let $=W,S,pe,ge,de,Fe,X,U;return Nt(W)?vd(W)?(S=W,Fe=W,de=M(S,Fe)):(S=W,Fe=T(S),de=M(S,Fe)):(S=W.src,Fe=W.alt||(Nt(S)?T(S):Nt(W.thumb)?T(W.thumb):void 0),de=M(W.thumb||S,Fe),pe=W.shape,X=W.mount,U=W.disabled,ge=Object.keys(W).reduce((ae,be)=>(v.includes(be)||(ae[be]=W[be]),ae),{})),{id:$,src:S,thumb:de,shape:pe,shapeProps:ge,alt:Fe,title:Fe,mount:X,disabled:U}},Y=W=>W.map($=>I($)?{...$[2],id:`${R}-${$[0].toLowerCase()}`,label:$[0],items:Y($[1])}:H($)),Z=({detail:W})=>n(6,s=W);return e.$$set=W=>{"locale"in W&&n(14,d=W.locale),"presets"in W&&n(15,m=W.presets),"scrollElasticity"in W&&n(0,g=W.scrollElasticity),"enableSelectImage"in W&&n(16,p=W.enableSelectImage),"willRenderPresetToolbar"in W&&n(17,y=W.willRenderPresetToolbar),"onaddpreset"in W&&n(1,w=W.onaddpreset),"ongrabpreset"in W&&n(2,_=W.ongrabpreset),"ondragpreset"in W&&n(3,P=W.ondragpreset),"ondroppreset"in W&&n(4,C=W.ondroppreset)},e.$$.update=()=>{e.$$.dirty&32768&&n(7,i=Y(m)),e.$$.dirty&128&&n(9,o=i.length),e.$$.dirty&640&&n(8,r=o&&i.some(W=>!!W.items)),e.$$.dirty&384&&n(5,a=r&&i),e.$$.dirty&384&&n(13,l=r&&i.reduce((W,$)=>(W[$.id]=$,W),{})),e.$$.dirty&96&&n(6,s=s||a&&(a.find(W=>!W.disabled)||{}).id),e.$$.dirty&64&&n(12,c={name:R,selected:s}),e.$$.dirty&32&&n(11,u=a&&a.map(W=>W.id)),e.$$.dirty&212994&&n(10,f=d&&y([p&&["Button","browse",{label:d.shapeLabelButtonSelectSticker,icon:d.shapeIconButtonSelectSticker,onclick:()=>{o4().then(W=>{W&&w(W)})}}]]))},[g,w,_,P,C,a,s,i,r,o,f,u,c,l,d,m,p,y,Z]}class I4 extends gn{constructor(t){super(),mn(this,t,QI,JI,rn,{locale:14,presets:15,scrollElasticity:0,enableSelectImage:16,willRenderPresetToolbar:17,onaddpreset:1,ongrabpreset:2,ondragpreset:3,ondroppreset:4})}}var $I=e=>(t,n)=>{e.dispatchEvent(Zl(t,n))};function e7(e){let t,n,i,o;return t=new Xo({props:{items:e[30]}}),i=new oh({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[165]}}),{c(){Ve(t.$$.fragment),n=ut(),Ve(i.$$.fragment)},m(r,a){ve(t,r,a),te(r,n,a),ve(i,r,a),o=!0},p(r,a){const l={};a[0]&1073741824&&(l.items=r[30]),t.$set(l);const s={};a[0]&16&&(s.locale=r[4]),a[1]&262144&&(s.shapeProps=r[49]),a[0]&512&&(s.controls=r[9]),i.$set(s)},i(r){o||(L(t.$$.fragment,r),L(i.$$.fragment,r),o=!0)},o(r){z(t.$$.fragment,r),z(i.$$.fragment,r),o=!1},d(r){r&&ee(n),Oe(t,r),Oe(i,r)}}}function t7(e){let t,n,i;return n=new w4({props:{$$slots:{default:[e7]},$$scope:{ctx:e}}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"slot","header")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&1073742352|r[1]&262144|r[6]&134217728&&(a.$$scope={dirty:r,ctx:o}),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function Up(e){let t,n;const i=[{locale:e[4]},{ui:e[69]},{shapes:e[5]},{selection:e[58]},{uid:e[20]},{parentRect:e[37]},{rootRect:e[55]},{utilRect:e[39]},{offset:e[50]},{disabled:e[38]},{contextRotation:e[23]},{contextFlipX:e[24]},{contextFlipY:e[25]},{contextZoom:e[36]?e[36].scale:void 0},{active:e[35]},{opacity:e[56]},{hoverColor:e[57]},{caretColor:e[57]},{snapColor:e[57]},{gridColor:[1,1,1,.125]},{eraseRadius:e[47]},{selectRadius:e[6]},{enableButtonFlipVertical:e[10]},{enableMultiSelect:e[14]},{mapEditorPointToImagePoint:e[21]},{mapImagePointToEditorPoint:e[22]},{enableTapToAddText:e[13]},{textInputMode:e[8]},{snapThreshold:e[16]},{snapPointer:!e[48]},{enableSnapToContext:e[17]},{gridSize:e[15]},{willStartInteraction:e[95]},{oninteractionstart:e[79]},{oninteractionupdate:e[80]},{oninteractionrelease:e[81]},{oninteractionend:e[83]},{oninteractioncancel:e[82]},{onleavecanvas:e[87]},{onhovercanvas:e[86]},{onhovershape:e[89]},{ontapcanvas:e[88]},{onaddshape:e[156]},{onselectshape:e[157]},{onblurshape:e[158]},{ontapshape:e[159]},{onupdateshape:e[160]},{onremoveshape:e[161]},{ontriggerhistorywrite:e[162]},e[42]];let o={};for(let r=0;r<i.length;r+=1)o=wi(o,i[r]);return t=new xI({props:o}),e[163](t),{c(){Ve(t.$$.fragment)},m(r,a){ve(t,r,a),n=!0},p(r,a){const l=a[0]&66315632|a[1]&252381681|a[2]&255721600|a[3]&12?fo(i,[a[0]&16&&{locale:r[4]},a[2]&128&&{ui:r[69]},a[0]&32&&{shapes:r[5]},a[1]&134217728&&{selection:r[58]},a[0]&1048576&&{uid:r[20]},a[1]&64&&{parentRect:r[37]},a[1]&16777216&&{rootRect:r[55]},a[1]&256&&{utilRect:r[39]},a[1]&524288&&{offset:r[50]},a[1]&128&&{disabled:r[38]},a[0]&8388608&&{contextRotation:r[23]},a[0]&16777216&&{contextFlipX:r[24]},a[0]&33554432&&{contextFlipY:r[25]},a[1]&32&&{contextZoom:r[36]?r[36].scale:void 0},a[1]&16&&{active:r[35]},a[1]&33554432&&{opacity:r[56]},a[1]&67108864&&{hoverColor:r[57]},a[1]&67108864&&{caretColor:r[57]},a[1]&67108864&&{snapColor:r[57]},i[19],a[1]&65536&&{eraseRadius:r[47]},a[0]&64&&{selectRadius:r[6]},a[0]&1024&&{enableButtonFlipVertical:r[10]},a[0]&16384&&{enableMultiSelect:r[14]},a[0]&2097152&&{mapEditorPointToImagePoint:r[21]},a[0]&4194304&&{mapImagePointToEditorPoint:r[22]},a[0]&8192&&{enableTapToAddText:r[13]},a[0]&256&&{textInputMode:r[8]},a[0]&65536&&{snapThreshold:r[16]},a[1]&131072&&{snapPointer:!r[48]},a[0]&131072&&{enableSnapToContext:r[17]},a[0]&32768&&{gridSize:r[15]},a[3]&4&&{willStartInteraction:r[95]},a[2]&131072&&{oninteractionstart:r[79]},a[2]&262144&&{oninteractionupdate:r[80]},a[2]&524288&&{oninteractionrelease:r[81]},a[2]&2097152&&{oninteractionend:r[83]},a[2]&1048576&&{oninteractioncancel:r[82]},a[2]&33554432&&{onleavecanvas:r[87]},a[2]&16777216&&{onhovercanvas:r[86]},a[2]&134217728&&{onhovershape:r[89]},a[2]&67108864&&{ontapcanvas:r[88]},a[1]&1|a[3]&8&&{onaddshape:r[156]},a[1]&1&&{onselectshape:r[157]},a[1]&1&&{onblurshape:r[158]},a[1]&1&&{ontapshape:r[159]},a[1]&1|a[3]&8&&{onupdateshape:r[160]},a[1]&1|a[3]&8&&{onremoveshape:r[161]},a[3]&8&&{ontriggerhistorywrite:r[162]},a[1]&2048&&yo(r[42])]):{};t.$set(l)},i(r){n||(L(t.$$.fragment,r),n=!0)},o(r){z(t.$$.fragment,r),n=!1},d(r){e[163](null),Oe(t,r)}}}function n7(e){let t,n,i,o,r,a=e[51]&&Up(e);return{c(){t=fe("div"),a&&a.c(),k(t,"slot","main"),Ee(t,"cursor",e[46])},m(l,s){te(l,t,s),a&&a.m(t,null),e[164](t),i=!0,o||(r=[Pe(t,"keydown",e[84]),wn(n=VS.call(null,t,{disabled:!e[12]})),Pe(t,"dropfiles",e[94]),wn(Fo.call(null,t)),Pe(t,"measure",e[152])],o=!0)},p(l,s){l[51]?a?(a.p(l,s),s[1]&1048576&&L(a,1)):(a=Up(l),a.c(),L(a,1),a.m(t,null)):a&&(Et(),z(a,1,1,()=>{a=null}),At()),n&&kn(n.update)&&s[0]&4096&&n.update.call(null,{disabled:!l[12]}),s[1]&32768&&Ee(t,"cursor",l[46])},i(l){i||(L(a),i=!0)},o(l){z(a),i=!1},d(l){l&&ee(t),a&&a.d(),e[164](null),o=!1,On(r)}}}function i7(e){let t,n;return t=new I4({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.locale=i[4]),o[0]&524288&&(r.presets=i[19]),o[0]&2048&&(r.enableSelectImage=i[11]),o[1]&4096&&(r.willRenderPresetToolbar=i[43]),o[1]&8192&&(r.scrollElasticity=i[44]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function o7(e){let t,n,i,o=e[7]==="stack"&&Hp(e),r=(e[53]&&e[34]||e[7]==="row")&&Np(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[7]==="stack"?o?(o.p(a,l),l[0]&128&&L(o,1)):(o=Hp(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[53]&&a[34]||a[7]==="row"?r?(r.p(a,l),l[0]&128|l[1]&4194312&&L(r,1)):(r=Np(a),r.c(),L(r,1),r.m(n.parentNode,n)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function Hp(e){let t,n,i,o;const r=[a7,r7],a=[];function l(s,c){return s[45]?0:1}return n=l(e),i=a[n]=r[n](e),{c(){t=fe("div"),i.c(),k(t,"class","PinturaControlPanels")},m(s,c){te(s,t,c),a[n].m(t,null),o=!0},p(s,c){let u=n;n=l(s),n===u?a[n].p(s,c):(Et(),z(a[u],1,1,()=>{a[u]=null}),At(),i=a[n],i?i.p(s,c):(i=a[n]=r[n](s),i.c()),L(i,1),i.m(t,null))},i(s){o||(L(i),o=!0)},o(s){z(i),o=!1},d(s){s&&ee(t),a[n].d()}}}function r7(e){let t,n,i;return n=new oh({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollElasticity:e[44],willRenderControls:e[18]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaControlPanel")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&16&&(a.locale=o[4]),r[1]&262144&&(a.shapeProps=o[49]),r[0]&512&&(a.controls=o[9]),r[1]&8192&&(a.scrollElasticity=o[44]),r[0]&262144&&(a.willRenderControls=o[18]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function a7(e){let t,n,i;return n=new I4({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"class","PinturaControlPanel")},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&16&&(a.locale=o[4]),r[0]&524288&&(a.presets=o[19]),r[0]&2048&&(a.enableSelectImage=o[11]),r[1]&4096&&(a.willRenderPresetToolbar=o[43]),r[1]&8192&&(a.scrollElasticity=o[44]),n.$set(a)},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function Np(e){let t,n;return t=new Ka({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[c7]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&8192&&(r.elasticity=i[44]),o[0]&262801|o[1]&262154|o[6]&134217728&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Gp(e){let t,n;return t=new El({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[32],selectedIndex:e[32].findIndex(e[153]),onchange:e[78],$$
95slots:{option:[s7,({option:i})=>({212:i}),({option:i})=>[0,0,0,0,0,0,i?67108864:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.locale=i[4]),o[1]&2&&(r.options=i[32]),o[0]&1|o[1]&2&&(r.selectedIndex=i[32].findIndex(i[153])),o[0]&16|o[6]&201326592&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function jp(e){let t,n;return t=new Br({props:{$$slots:{default:[l7]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16|o[6]&201326592&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function l7(e){let t,n=(xn(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[0]&16|o[6]&67108864&&n!==(n=(xn(i[212].icon)?i[212].icon(i[4]):i[212].icon)+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function Zp(e){let t,n=(xn(e[212].label)?e[212].label(e[4]):e[212].label)+"",i;return{c(){t=fe("span"),i=bi(n)},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[0]&16|r[6]&67108864&&n!==(n=(xn(o[212].label)?o[212].label(o[4]):o[212].label)+"")&&vi(i,n)},d(o){o&&ee(t)}}}function s7(e){let t,n,i,o=e[212].icon&&jp(e),r=!e[212].hideLabel&&Zp(e);return{c(){t=fe("div"),o&&o.c(),n=ut(),r&&r.c(),k(t,"slot","option")},m(a,l){te(a,t,l),o&&o.m(t,null),Ae(t,n),r&&r.m(t,null),i=!0},p(a,l){a[212].icon?o?(o.p(a,l),l[6]&67108864&&L(o,1)):(o=jp(a),o.c(),L(o,1),o.m(t,n)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[212].hideLabel?r&&(r.d(1),r=null):r?r.p(a,l):(r=Zp(a),r.c(),r.m(t,null))},i(a){i||(L(o),i=!0)},o(a){z(o),i=!1},d(a){a&&ee(t),o&&o.d(),r&&r.d()}}}function Xp(e){let t,n;return t=new oh({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[154]}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.locale=i[4]),o[1]&262144&&(r.shapeProps=i[49]),o[0]&512&&(r.controls=i[9]),o[0]&262144&&(r.willRenderControls=i[154]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function c7(e){let t,n,i,o=e[34]&&Gp(e),r=e[7]==="row"&&Xp(e);return{c(){o&&o.c(),t=ut(),r&&r.c(),n=Mi()},m(a,l){o&&o.m(a,l),te(a,t,l),r&&r.m(a,l),te(a,n,l),i=!0},p(a,l){a[34]?o?(o.p(a,l),l[1]&8&&L(o,1)):(o=Gp(a),o.c(),L(o,1),o.m(t.parentNode,t)):o&&(Et(),z(o,1,1,()=>{o=null}),At()),a[7]==="row"?r?(r.p(a,l),l[0]&128&&L(r,1)):(r=Xp(a),r.c(),L(r,1),r.m(n.parentNode,n)):r&&(Et(),z(r,1,1,()=>{r=null}),At())},i(a){i||(L(o),L(r),i=!0)},o(a){z(o),z(r),i=!1},d(a){a&&(ee(t),ee(n)),o&&o.d(a),r&&r.d(a)}}}function Kp(e){let t,n;return t=new Ka({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[d7]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&8192&&(r.elasticity=i[44]),o[0]&134217744|o[1]&8388608|o[6]&134217728&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function Yp(e){let t,n;return t=new Br({props:{$$slots:{default:[u7]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16|o[6]&201326592&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function u7(e){let t,n=(xn(e[212].icon)?e[212].icon(e[4]):e[212].icon)+"";return{c(){t=Ao("g")},m(i,o){te(i,t,o),t.innerHTML=n},p(i,o){o[0]&16|o[6]&67108864&&n!==(n=(xn(i[212].icon)?i[212].icon(i[4]):i[212].icon)+"")&&(t.innerHTML=n)},d(i){i&&ee(t)}}}function f7(e){let t,n,i,o=(xn(e[212].label)?e[212].label(e[4]):e[212].label)+"",r,a,l=e[212].icon&&Yp(e);return{c(){t=fe("div"),l&&l.c(),n=ut(),i=fe("span"),r=bi(o),k(t,"slot","option")},m(s,c){te(s,t,c),l&&l.m(t,null),Ae(t,n),Ae(t,i),Ae(i,r),a=!0},p(s,c){s[212].icon?l?(l.p(s,c),c[6]&67108864&&L(l,1)):(l=Yp(s),l.c(),L(l,1),l.m(t,n)):l&&(Et(),z(l,1,1,()=>{l=null}),At()),(!a||c[0]&16|c[6]&67108864)&&o!==(o=(xn(s[212].label)?s[212].label(s[4]):s[212].label)+"")&&vi(r,o)},i(s){a||(L(l),a=!0)},o(s){z(l),a=!1},d(s){s&&ee(t),l&&l.d()}}}function d7(e){let t,n;return t=new El({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[54],selectedIndex:e[54].findIndex(e[155]),onchange:e[77],$$slots:{option:[f7,({option:i})=>({212:i}),({option:i})=>[0,0,0,0,0,0,i?67108864:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&16&&(r.locale=i[4]),o[1]&8388608&&(r.options=i[54]),o[0]&134217728|o[1]&8388608&&(r.selectedIndex=i[54].findIndex(i[155])),o[0]&16|o[6]&201326592&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function h7(e){let t,n,i,o,r;const a=[o7,i7],l=[];function s(u,f){return u[52]?0:u[45]?1:-1}~(n=s(e))&&(i=l[n]=a[n](e));let c=e[33]&&Kp(e);return{c(){t=fe("div"),i&&i.c(),o=ut(),c&&c.c(),k(t,"slot","footer"),Ee(t,"transform",e[40])},m(u,f){te(u,t,f),~n&&l[n].m(t,null),Ae(t,o),c&&c.m(t,null),r=!0},p(u,f){let d=n;n=s(u),n===d?~n&&l[n].p(u,f):(i&&(Et(),z(l[d],1,1,()=>{l[d]=null}),At()),~n?(i=l[n],i?i.p(u,f):(i=l[n]=a[n](u),i.c()),L(i,1),i.m(t,o)):i=null),u[33]?c?(c.p(u,f),f[1]&4&&L(c,1)):(c=Kp(u),c.c(),L(c,1),c.m(t,null)):c&&(Et(),z(c,1,1,()=>{c=null}),At()),f[1]&512&&Ee(t,"transform",u[40])},i(u){r||(L(i),L(c),r=!0)},o(u){z(i),z(c),r=!1},d(u){u&&ee(t),~n&&l[n].d(),c&&c.d()}}}function m7(e){let t,n;return t=new Hs({props:{hasHeader:e[41],$$slots:{footer:[h7],main:[n7],header:[t7]},$$scope:{ctx:e}}}),t.$on("measure",e[166]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&1024&&(r.hasHeader=i[41]),o[0]&2080374769|o[1]&134216703|o[6]&134217728&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}let g7=!1;function b7(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de,Fe,X,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te=qt,me=()=>(Te(),Te=Do(ln,x=>n(35,le=x)),ln),Me,qe,Ne,mt,ue=qt,He=()=>(ue(),ue=Do(fn,x=>n(145,mt=x)),fn),Qe,G,je,ye,$e,St,Je,q=qt,Ie=()=>(q(),q=Do(ai,x=>n(37,Je=x)),ai),se,V,dt,Ft,We,Xe,nt,wt,Zt=qt,yt=()=>(Zt(),Zt=Do(ke,x=>n(151,wt=x)),ke),nn,Jt,yn,an=qt,Tt=()=>(an(),an=Do(sn,x=>n(56,yn=x)),sn),Sn;e.$$.on_destroy.push(()=>Te()),e.$$.on_destroy.push(()=>ue()),e.$$.on_destroy.push(()=>
95q()),e.$$.on_destroy.push(()=>Zt()),e.$$.on_destroy.push(()=>an());let{isActive:ln}=t;me();let{isActiveFraction:sn}=t;Tt();let{isVisible:ke}=t;yt();let{stores:Re}=t,{locale:Lt={}}=t,{shapes:fn}=t;He();let{toolbar:on=[]}=t,{toolShapes:En={}}=t,{toolActive:bt=void 0}=t,{toolSelectRadius:Un=void 0}=t,{toolRetainStyles:Hn=!1}=t,{toolbarLayout:$n="stack"}=t,{textInputMode:Q=void 0}=t,{shapeControls:Ge={}}=t,{enableButtonFlipVertical:j=!1}=t,{enablePresetSelectImage:Le=!0}=t,{enablePresetDropImage:tt=!0}=t,{enableSelectToolToAddShape:en=!1}=t,{enableAutoSelectMoveTool:Xt=["line","arrow","path","rectangle","ellipse","text"]}=t,{enableTapToAddText:Ze=!1}=t,{enableMoveTool:tn=!1}=t,{enableViewTool:Fn=!1}=t,{enableToolShareStyles:K=!0}=t,{enableMultiSelect:J=!1}=t,{gridSize:xe=0}=t,{snapThreshold:it=0}=t,{enableSnapToContext:Ye=!0}=t,{willRenderHeaderTools:ct=Nn}=t,{willRenderPresetToolbar:ot=void 0}=t,{willRenderShapeStyleControls:Ct=void 0}=t,{willStartInteraction:cn=void 0}=t,{shapePresets:Qt=[]}=t,{utilKey:_n}=t,{mapScreenPointToImagePoint:Bt}=t,{mapImagePointToScreenPoint:et}=t,{imageRotation:ri=0}=t,{imageFlipX:Gn=!1}=t,{imageFlipY:Ri=!1}=t,{parentRect:ai}=t;Ie();let{hooks:ui={}}=t;const Yn=Qn("selection");B(e,Yn,x=>n(150,We=x));const _t=Qn("isAnimated");B(e,_t,x=>n(142,Me=x));const Dn=Qn("elasticityMultiplier");B(e,Dn,x=>n(146,Qe=x));const Vn=Qn("ui");B(e,Vn,x=>n(177,Xe=x));const ni=Qn("keysPressed");B(e,ni,x=>n(149,Ft=x));let Bn;const{env:qn,history:ii,rootRect:pi,rootColorSecondary:An,enablePanInput:Cn,enablePanInputStatus:_i,enableZoomInput:fi,stageRect:eo,utilRectPadded:di,scrollElasticity:dr,imageOverlayMarkup:So,imagePreviewModifiers:li,imageCropRect:hi,stageScalar:wa,imageSelectionRect:Qr,imageTransformsInterpolated:hr,imageSelectionPan:Ko,imageSize:zr,allowPan:Vr,allowZoom:Pr,allowZoomControls:Wr,allowPlayPause:ul}=Re;B(e,qn,x=>n(143,qe=x)),B(e,pi,x=>n(55,Jt=x)),B(e,An,x=>n(57,Sn=x)),B(e,_i,x=>n(38,V=x)),B(e,eo,x=>n(147,G=x)),B(e,di,x=>n(39,nt=x)),B(e,li,x=>n(178,nn=x)),B(e,hi,x=>n(176,se=x)),B(e,wa,x=>n(174,$e=x)),B(e,Qr,x=>n(175,St=x)),B(e,hr,x=>n(36,je=x)),B(e,Ko,x=>n(173,ye=x)),B(e,zr,x=>n(148,dt=x));const Ki=(x,{willRenderPresetToolbar:we,shapePresets:Vt,enableViewTool:rt,enableMoveTool:Dt})=>{let Gt=Vt.length===0&&!we?x.filter(E=>E[0]!=="preset"):x;return o&&(Gt=[["move",E=>E.shapeLabelToolMove,{icon:E=>E.shapeIconToolMove}],["view",E=>E.shapeLabelToolView,{icon:E=>E.shapeIconToolView}],...Gt]),Gt=Dt?Gt:Gt.filter(E=>E[0]!=="move"),rt?Gt:Gt.filter(E=>E[0]!=="view")};let wo=0,Ei={};const _a=({index:x},we)=>{n(27,wo=x),n(0,bt=Ei[x])},Ya=({value:x},we)=>{n(0,bt=x),(en||/enter/i.test(we.key))&&Yi(x)},Yi=x=>{const[we,Vt]=Bn[x];let rt=Vt.position==="relative",Dt,Gt;const E=rt?"0%":0,Ue=rt?"0%":0;vr(we)||zi(we)?(Gt=rt?"20%":Je.width*.2,Dt=yi(we),nm(Dt),im(Dt),Dt.x=E,Dt.y=Ue,Ua(Dt,{width:Gt,height:Gt},Je)):$i(we)?(Gt=rt?"10%":Je.width*.1,Dt=yi(we),Dt.x=E,Dt.y=Ue,Ua(Dt,{rx:Gt,ry:Gt},Je)):Io(we)&&(Gt=rt?"10%":Je.width*.1,Dt=yi(we),Dt.x1=E,Dt.y1=Ue,Dt.x2=E,Dt.y2=Ue),Dt&&Promise.resolve().then(()=>{Ca(Wo(Dt,void 0,Gt))})},ho=x=>Bt(_m(x,Jt));let zn,Ui={};const Vo=()=>{_e(li,nn[_n]={maskMarkupOpacity:.85},nn)},ar=()=>{delete nn[_n]};let to;const $r=x=>{if(!zn)return;const we=zn.getShapeDraft(Yn);we&&(x&&(to=we.drawMode),zn.updateShapeDraft({drawMode:x?"subtract":to},Yn))};let Ai;const Ur=x=>{if(bt==="eraser")Ai=zn.eraseShape();else if(bt&&Bn[bt]){const[we,Vt={}]=Bn[bt],rt=yi(we);nm(rt),im(rt);const{drawMode:Dt}=H;p==="selection"&&Dt==="new"&&Yn.set([]);let Gt={};p==="selection"&&(be("selectiondown",[...We]),i&&(to=rt.drawMode,Gt.drawMode="subtract")),Ai=zn.createShape({...rt,...v,...Gt},Vt)}else Ai=void 0;return Ai?(Ai.start(x),!0):!1},no=x=>Ai?(Ai.update(x),!0):!1,Yo=x=>Ai?(Ai.release(x),!0):!1,Hr=x=>Ai?(Ai.cancel(x),Ai=void 0,!0):!1,fl=x=>{if(!Ai)return!1;if(Ai.end(x),Ai=void 0,p==="selection"){if(x.detail.isTap){const[rt]=Bn[bt];rt.bitmap||Yn.set([])}be("selectionup",[...We])}const we=zn.getMarkupItemDraft(),Vt=tn&&(Xt===!0||Array.isArray(Xt)&&Xt.includes(bt));return(!we||we.isEditing)&&Vt&&n(0,bt="move"),!0},mo=x=>{if(!(Vi(x)&&Rt(x,"pathClose")))return;const Vt=[...x.strokeColor];Vt[3]=1,zn.updateMarkupShape(x,{pathClose:!1,strokeColor:Vt},!1),zn.removeMarkupShapeProps(x,["backgroundColor"],!1),zn.confirmMarkupItemDraft(),zn.selectShape(x),be("addshape",x),ii.write()},go=x=>{const{key:we}=x,Vt=zn.getMarkupItemDraft();/escape/i.test(we)&&Vt&&(x.preventDefault(),x.stopPropagation(),zn.discardMarkupItemDraft(),Ai=void 0),/enter/i.test(we)&&Vt&&(x.preventDefault(),x.stopPropagation(),mo(Vt),Ai=void 0)},qa=()=>{!zn||bt==="move"||zn.blurShapes()},ji=()=>Xe[_n]?Xe[_n][bt]:{},mr=x=>{const we=yi(x);return Object.assign(we,ji()),jy(we),we},Hi=()=>{n(115,Ui={})},ea=(x,we,Vt)=>{const rt=Xe[x],Dt=rt?rt[we]:{};Vn.set({...Xe,[x]:{...rt,[we]:{...Dt,...Vt}}})},gr=x=>{Vn.set({[x]:{}})};function ta(x){const we={};return x.forEach(Vt=>{Object.entries(Vt).filter(([rt])=>
95!rt.startsWith("_")).forEach(([rt,Dt])=>{if(Rt(we,rt)){rt==="disableStyle"&&Si(Dt)&&we[rt].push(...Dt);return}we[rt]=Dt})}),we}let Ta;function br(x){Object.keys(x).forEach(we=>{const{retain:Vt=!0,share:rt=!0}=T.settings&&T.settings[we]||{};if(Vt){if(K&&rt){n(115,Ui[we]=x[we],Ui);return}Ui[bt]||n(115,Ui[bt]={},Ui),n(115,Ui[bt][we]=x[we],Ui)}}),be("selectstyle",x),R&&(C?P.forEach(we=>{zn.updateMarkupShape(we,Ja(x,we))}):zn.updateMarkupShape(R,x),clearTimeout(Ta),Ta=setTimeout(()=>{qo()},200))}const Ja=(x,we)=>{const Vt={};return Object.entries(x).forEach(([rt,Dt])=>{Rt(we,rt)&&(Vt[rt]=Dt)}),Vt},dl=(x,we)=>{if(Ht(x))return x;if(x.endsWith("%"))return parseFloat(x)/100*we.width};let pr,Oi,_o;const na=x=>{So.update(we=>[...we.filter(Vt=>Vt.id!==`cursor-${_n}`),...x])},ka=()=>{So.update(x=>x.filter(we=>we.id!==`cursor-${_n}`))},io=(x,we,Vt)=>{n(117,Oi=we),n(118,_o=Vt)},ia=()=>{n(118,_o=void 0),n(117,Oi=void 0)},yr=({cursorStyle:x,cursorSize:we},Vt,rt)=>{let Dt;const Gt=Vt[we];if(Gt===void 0?Dt=dl(we,rt):Ht(Gt)?Dt=Gt:Nt(Gt)&&(Dt=F_(we,Vt[we],rt),we==="strokeWidth"&&(Dt*=.5)),!(Dt<=0||Dt===void 0))return{size:Dt,style:x}},Nr=(x,we,Vt,rt,Dt,Gt)=>{if(rt)return Dt?"grabbing":"grab";if(x&&!we)return"none";if(!we)return Gt==="move"?"default":"crosshair";let E=we||Vt;return Va(E)?p1(E)?Q==="modal"?"default":"text":Bs(E)&&(!C||P.every(Bs))?"move":"default":"default"},Qa=x=>{be("markuptap",x)},Gr=x=>n(116,pr=x),Wo=(x,we,Vt)=>{let rt=!1;we||(rt=!0,we=ae?Bt(In(G)):In(se)),we.x-=Je.x||0,we.y-=Je.y||0,(Gn||Ri)&&(x.flipX=Gn,x.flipY=Ri);const Dt=zn.getShapesNearPosition(mt,we);if(rt&&Dt.length){const Gt=Math.min(se.width,se.height)*.1;we.x+=Math.round(-Gt+Math.random()*Gt*2),we.y+=Math.round(-Gt+Math.random()*Gt*2)}if(ri!==0&&(Gn&&Ri?x.rotation=-ri:Gn||Ri?x.rotation=ri:x.rotation=-ri),Rt(x,"width")&&Rt(x,"height")){const{width:Gt,height:E}=_c(x,["width","height"],Je);Ua(x,{x:we.x-Gt*.5,y:we.y-E*.5},Je)}else if($i(x))Ua(x,{x:we.x,y:we.y},Je);else if(Io(x)){const{x1:Gt,y1:E,x2:Ue,y2:pt}=_c(x,["x1","y1","x2","y2"],Je),Tn=or(re(Gt,E),re(Ue,pt)),Pn=Nt(Vt)?Vd(Vt,Je.width):Tn;Ua(x,{x1:we.x-Pn,y1:we.y+Pn,x2:we.x+Pn,y2:we.y-Pn},Je)}else if(Vi(x)){const{points:Gt}=_c(x,["points"],Je),E=Kr(Gt);Ua(x,{points:Gt.map(Ue=>({x:Ue.x+we.x-E.x,y:Ue.y+we.y-E.y}))},Je)}return x},Uo=(x,we)=>{const Vt=Wo(j0(x,se),we);return x.shape&&(Rt(x.shape,"x")&&(Vt.x=x.shape.x),Rt(x.shape,"y")&&(Vt.y=x.shape.y)),Ca(Vt)},Ca=x=>{const{beforeAddShape:we=()=>!0}=ui;if(we(x))return zn.addShape(x),zn.selectShape(x),be("addshape",x),ii.write(),x};let lr=!1;const ei=()=>{lr=!1},To=(x,we)=>{if(lr)return;const{beforeAddShape:Vt=()=>!0}=ui,rt=ho(we),Dt=zn.getMarkupItemDraft(),Gt=Ld(se,{x:rt.x+(Je.x||0),y:rt.y+(Je.y||0)});if(Dt&&!Gt&&zn.discardMarkupItemDraft(),!!Gt){if(!Dt){const E=j0(x,se),Ue=Wo(E,rt);if(!Vt(Ue)){lr=!0,we.preventDefault();return}em(Ue),zn.addShape(Ue);return}vr(Dt)&&(rt.x-=Dt.width*.5,rt.y-=Dt.height*.5),x.shape&&(Rt(x.shape,"x")&&(rt.x=x.shape.x),Rt(x.shape,"y")&&(rt.y=x.shape.y)),zn.updateMarkupShape(Dt,rt)}},zt=(x,we)=>{if(lr)return;const Vt=ho(we);if(!Ld(se,{x:Vt.x+(Je.x||0),y:Vt.y+(Je.y||0)})){zn.discardMarkupItemDraft();return}const rt=zn.confirmMarkupItemDraft();zn.selectShape(rt),be("addshape",rt),ii.write()},ko=x=>Uo(x),Co=(x,we)=>x.filter(Vt=>Qu(Vt)).forEach(Vt=>Uo(Vt,we)),$a=x=>Co(x.detail.resources,ho(x.detail.event)),Pa=x=>{if(!cn)return!0;const we=rectClone(St);return rectScale(we,1/$e),rectTranslate(we,ye),rectScale(we,je.scale),cn(x,{...we,x:we.x+G.x,y:we.y+G.y})},qo=()=>{ii.write()};let mi;const Mr=Qn("redrawTrigger");B(e,Mr,x=>n(144,Ne=x));const Ma=x=>{mt&&fn.update(we=>we.map(Vt=>(Vt._prerender=x?p1(Vt):!1,Vt)))},Ra=[],Rr=hn(Me?20:0);B(e,Rr,x=>n(141,N=x));function el(x){Zo.call(this,e,x)}const Ir=x=>x[0]===bt,Fl=(x,we,Vt)=>{const rt=x.filter(([,Dt])=>!Ra.includes(Dt));return Ct?Ct(rt,we,Vt):rt},vl=x=>x[0]===wo,tl=x=>{Promise.resolve().then(()=>{be("addshape",x),qo()})},hl=x=>{be("selectshape",x)},Sr=x=>{Promise.resolve().then(()=>{be("blurshape",x)})},ml=x=>{be("tapshape",x)},oa=x=>{be("updateshape",x),qo()},Ol=x=>{be("removeshape",x),qo()},gl=()=>{qo()};function Ia(x){vn[x?"unshift":"push"](()=>
95{zn=x,n(28,zn)})}function Ea(x){vn[x?"unshift":"push"](()=>{mi=x,n(29,mi)})}const Jo=x=>x.filter(([,we])=>Ra.includes(we));function Ho(x){Zo.call(this,e,x)}return e.$$set=x=>{"isActive"in x&&me(n(1,ln=x.isActive)),"isActiveFraction"in x&&Tt(n(2,sn=x.isActiveFraction)),"isVisible"in x&&yt(n(3,ke=x.isVisible)),"stores"in x&&n(100,Re=x.stores),"locale"in x&&n(4,Lt=x.locale),"shapes"in x&&He(n(5,fn=x.shapes)),"toolbar"in x&&n(101,on=x.toolbar),"toolShapes"in x&&n(102,En=x.toolShapes),"toolActive"in x&&n(0,bt=x.toolActive),"toolSelectRadius"in x&&n(6,Un=x.toolSelectRadius),"toolRetainStyles"in x&&n(103,Hn=x.toolRetainStyles),"toolbarLayout"in x&&n(7,$n=x.toolbarLayout),"textInputMode"in x&&n(8,Q=x.textInputMode),"shapeControls"in x&&n(9,Ge=x.shapeControls),"enableButtonFlipVertical"in x&&n(10,j=x.enableButtonFlipVertical),"enablePresetSelectImage"in x&&n(11,Le=x.enablePresetSelectImage),"enablePresetDropImage"in x&&n(12,tt=x.enablePresetDropImage),"enableSelectToolToAddShape"in x&&n(104,en=x.enableSelectToolToAddShape),"enableAutoSelectMoveTool"in x&&n(105,Xt=x.enableAutoSelectMoveTool),"enableTapToAddText"in x&&n(13,Ze=x.enableTapToAddText),"enableMoveTool"in x&&n(106,tn=x.enableMoveTool),"enableViewTool"in x&&n(107,Fn=x.enableViewTool),"enableToolShareStyles"in x&&n(108,K=x.enableToolShareStyles),"enableMultiSelect"in x&&n(14,J=x.enableMultiSelect),"gridSize"in x&&n(15,xe=x.gridSize),"snapThreshold"in x&&n(16,it=x.snapThreshold),"enableSnapToContext"in x&&n(17,Ye=x.enableSnapToContext),"willRenderHeaderTools"in x&&n(109,ct=x.willRenderHeaderTools),"willRenderPresetToolbar"in x&&n(110,ot=x.willRenderPresetToolbar),"willRenderShapeStyleControls"in x&&n(18,Ct=x.willRenderShapeStyleControls),"willStartInteraction"in x&&n(111,cn=x.willStartInteraction),"shapePresets"in x&&n(19,Qt=x.shapePresets),"utilKey"in x&&n(20,_n=x.utilKey),"mapScreenPointToImagePoint"in x&&n(21,Bt=x.mapScreenPointToImagePoint),"mapImagePointToScreenPoint"in x&&n(22,et=x.mapImagePointToScreenPoint),"imageRotation"in x&&n(23,ri=x.imageRotation),"imageFlipX"in x&&n(24,Gn=x.imageFlipX),"imageFlipY"in x&&n(25,Ri=x.imageFlipY),"parentRect"in x&&Ie(n(26,ai=x.parentRect)),"hooks"in x&&n(112,ui=x.hooks)},e.$$.update=()=>{if(e.$$.dirty[4]&33554432&&n(124,i=Ft.includes(18)),e.$$.dirty[3]&1049088&&(!Bn||En!==Bn)&&n(113,Bn=En),e.$$.dirty[1]&16&&Vr.set(le),e.$$.dirty[1]&16&&Pr.set(le),e.$$.dirty[1]&16&&Wr.set(le),e.$$.dirty[3]&256&&n(33,o=Array.isArray(on)&&on.length>1&&Array.isArray(on[0][1])),e.$$.dirty[1]&4|e.$$.dirty[3]&256&&n(54,r=o?on.map((x,we)=>[we,x[0]]):[]),e.$$.dirty[0]&134217728|e.$$.dirty[1]&4|e.$$.dirty[3]&256&&n(140,a=o?on[wo][1]:on),e.$$.dirty[0]&524288|e.$$.dirty[3]&155648|e.$$.dirty[4]&65536&&n(32,l=Ki(a,{willRenderPresetToolbar:ot,shapePresets:Qt,enableMoveTool:tn,enableViewTool:Fn})),e.$$.dirty[1]&2&&n(138,u=!!l.length),e.$$.dirty[0]&1|e.$$.dirty[1]&2|e.$$.dirty[4]&16384&&u&&bt===void 0&&n(0,bt=l[0][0]),e.$$.dirty[0]&134217729|e.$$.dirty[1]&4|e.$$.dirty[3]&2097152|e.$$.dirty[4]&65536&&o&&n(114,Ei={...Ei,[wo]:a.map(([x])=>x).includes(bt)?bt:Ei[wo]||a[0][0]}),e.$$.dirty[0]&512&&n(137,s=!!Object.keys(Ge).length),e.$$.dirty[1]&2&&n(34,c=l.length>1),e.$$.dirty[1]&12&&n(53,f=c||o),e.$$.dirty[0]&1&&n(139,d=bt!==void 0),e.$$.dirty[4]&57344&&n(52,m=(!d||u)&&s),e.$$.dirty[0]&536870912&&n(31,be=mi&&$I(mi)),e.$$.dirty[0]&1|e.$$.dirty[1]&17&&le&&be&&be("selectcontrol",bt),e.$$.dirty[1]&16&&(le?Vo():ar()),e.$$.dirty[0]&1|e.$$.dirty[3]&1048576&&n(136,g=bt&&Bn[bt]?Bn[bt][1]:void 0),e.$$.dirty[4]&4096&&n(125,p=g&&g.isSelection?"selection":"shapes"),e.$$.dirty[4]&3&&$r(p==="selection"&&i),e.$$.dirty[0]&268435457&&bt&&zn){const x=zn.getMarkupItemDraft();x&&mo(x)}if(e.$$.dirty[0]&1&&bt&&qa(),e.$$.dirty[1]&16|e.$$.dirty[4]&134217728&&n(51,y=wt&&le),e.$$.dirty[1]&256|e.$$.dirty[4]&8388608&&n(50,w=nt&&re(G.x-nt.x,G.y-nt.y)),e.$$.dirty[0]&512&&n(135,_=Object.keys(Ge)),e.$$.dirty[0]&16384|e.$$.dirty[1]&16|e.$$.dirty[4]&2097152&&n(122,P=J?le&&mt.filter(Va):[]),e.$$.dirty[3]&536870912&&n(123,C=P.length>1),e.$$.dirty[1]&16|e.$$.dirty[4]&2097152&&n(119,R=le&&mt.filter(Va)[0]),e.$$.dirty[1]&16|e.$$.dirty[4]&2097152&&n(130,I=le&&mt.find(x=>p1(x))),e.$$.dirty[1]&16|e.$$.dirty[4]&2097152&&n(133,M=le&&mt.find(x=>nr(x))),e.$$.dirty[0]&1|e.$$.dirty[1]&16|e.$$.dirty[3]&1048576&&n(127,T=le&&Bn[bt]?mr(Bn[bt][0]):{}),e.$$.dirty[3]&1048576&&Bn&&Hi(),e.$$.dirty[0]&1|e.$$.dirty[3]&4227072|e.$$.dirty[4]&2056&&n(126,v=T&&Object.keys(T).reduce((x,we)=>{const Vt=we==="disableStyle",rt=we==="settings",Dt=!!_.find(Ue=>Ue.split("_").includes(we));if(!Vt&&!rt&&!Dt||T[we]===void 0||T.disableStyle===!0||T.disableStyle&&T.disableStyle.includes(we))return x;if(we==="strokeWidth"&&Object.keys(Ui).includes("strokeWidth")&&Ui[we]===void 0&&Rt(T,"points"))return x[we]=T[we],x;const{share:Gt=!0}=T.settings&&T.settings[we]||{},E=K&&Gt?Ui:Ui[bt]||{};return x[we]=Rt(E,we)?E[we]:T[we],x},{})),e.$$.dirty[0]&1048577|e.$$.dirty[3]&1024|e.$$.dirty[4]&4&&(Hn?ea(_n,bt,v):gr(_n)),e.$$.dirty[1]&16|e.$$.dirty[3]&67108864|e.$$.dirty[4]&67108868&&n(134,H=We&&le?R||v:void 0),e.$$.dirty[3]&1610612736|e.$$.dirty[4]&1536&&n(49,Y=C?ta(P):H||M),e.$$.dirty[0]&1|e.$$.dirty[4]&8&&n(48,Z=Rt(T,"eraseRadius")||Rt(T,"points")&&!Rt(T,"pathClose")||bt==="move"||bt==="view"),e.$$.dirty[1]&64|e.$$.dirty[4]&8&&n(47,W=T&&T.eraseRadius!==void 0?dl(T.eraseRadius,Je):void 0),e.$$.dirty[1]&16|e.$$.dirty[4]&33554432&&n(131,$=le&&Ft.includes(32)),e.$$.dirty[0]&1|e.$$.dirty[1]&16&&n(132,S=le&&bt==="view"),e.$$.dirty[4]&384&&n(129,pe=S||$),e.$$.dirty[4]&96&&n(128,ge=pe?!!I||Ql(document.activeElement):!1),e.$$.dirty[1]&16|e.$$.dirty[4]&48&&Cn.set(le?pe&&!ge:!0),e.$$.dirty[1]&16|e.$$.dirty[4]&16&&fi.set(le?!ge:!0),e.$$.dirty[1]&64|e.$$.dirty[4]&12&&n(120,de=T.cursorStyle?yr(T,{...T,...v},Je):void 0),e.$$.dirty[3]&33554432|e.$$.dirty[4]&16777216&&n(121,Fe=_o&&Nw(_o,dt)),e.$$.dirty[0]&1048576|e.$$.dirty[1]&160|e.$$.dirty[3]&427819008|e.$$.dirty[4]&3)if(Fe&&!pr&&de&&!V){const x=de.size*je.scale,we={id:`cursor-${_n}`,x:Oi.x,y:Oi.y,strokeWidth:.5,strokeColor:[0,0,0]};de.style==="ellipse"&&(we.rx=x,we.ry=x);const Vt={strokeWidth:2.5,strokeColor:[1,1,1],opacity:.75},Dt=[{...we,...Vt},we];if(p==="selection"&&i){const Gt=x,E=Oi.x+Gt,Ue=Oi.y+Gt+4,pt={id:`cursor-${_n}`,strokeWidth:.75,strokeColor:[0,0,0],points:[{x:E,y:Ue},{x:E+4,y:Ue}]};Dt.push({...pt,...Vt,strokeWidth:2,points:[{x:E-.5,y:Ue},{x:E+4.5,y:Ue}]},pt)}na(Dt)}else ka();e.$$.dirty[0]&1|e.$$.dirty[1]&128|e.$$.dirty[3]&478150656&&n(46,X=Fe?Nr(de,pr,R,V,g7,bt):"default"),e.$$.dirty[0]&526337|e.$$.dirty[3]&131072&&n(45,U=bt==="preset"&&(Qt.length>
950||Le||ot)),e.$$.dirty[1]&64&&(ae=!Rt(Je,"x")&&!Rt(Je,"y")),e.$$.dirty[4]&4194304&&n(44,ft=Qe*dr),e.$$.dirty[3]&131072|e.$$.dirty[4]&1572864&&n(43,Se=Ne&&ot?x=>Zu(()=>ot(x,Uo,{...qe},()=>Mr.set({}))):Nn),e.$$.dirty[3]&524288&&n(42,De=Object.keys(ui).reduce((x,we)=>(we==="beforeAddShape"||ui[we]===void 0||(x[we]=ui[we]),x),{})),e.$$.dirty[1]&16&&Ma(le),e.$$.dirty[3]&65536|e.$$.dirty[4]&1572864&&n(30,Mt=Ne&&ct([],qe,()=>Mr.set({}))),e.$$.dirty[0]&1073742336&&n(41,gt=!!Mt.length||!!Object.keys(Ge).some(x=>Ra.includes(x))),e.$$.dirty[1]&16|e.$$.dirty[4]&262144&&Me&&Rr.set(le?0:20),e.$$.dirty[4]&131072,e.$$.dirty[4]&131072&&n(40,ie=N?`translateY(${N}px)`:"none")},ul.set(!1),[bt,ln,sn,ke,Lt,fn,Un,$n,Q,Ge,j,Le,tt,Ze,J,xe,it,Ye,Ct,Qt,_n,Bt,et,ri,Gn,Ri,ai,wo,zn,mi,Mt,be,l,o,c,le,je,Je,V,nt,ie,gt,De,Se,ft,U,X,W,Z,Y,w,y,m,f,r,Jt,yn,Sn,Yn,_t,Dn,Vn,ni,qn,pi,An,_i,eo,di,So,li,hi,wa,Qr,hr,Ko,zr,_a,Ya,Ur,no,Yo,Hr,fl,go,br,io,ia,Qa,Gr,ei,To,zt,ko,$a,Pa,qo,Mr,Ra,Rr,Re,on,En,Hn,en,Xt,tn,Fn,K,ct,ot,cn,ui,Bn,Ei,Ui,pr,Oi,_o,R,de,Fe,P,C,i,p,v,T,ge,pe,I,$,S,M,H,_,g,s,u,d,a,N,Me,qe,Ne,mt,Qe,G,dt,Ft,We,wt,el,Ir,Fl,vl,tl,hl,Sr,ml,oa,Ol,gl,Ia,Ea,Jo,Ho]}class rh extends gn{constructor(t){super(),mn(this,t,b7,m7,rn,{isActive:1,isActiveFraction:2,isVisible:3,stores:100,locale:4,shapes:5,toolbar:101,toolShapes:102,toolActive:0,toolSelectRadius:6,toolRetainStyles:103,toolbarLayout:7,textInputMode:8,shapeControls:9,enableButtonFlipVertical:10,enablePresetSelectImage:11,enablePresetDropImage:12,enableSelectToolToAddShape:104,enableAutoSelectMoveTool:105,enableTapToAddText:13,enableMoveTool:106,enableViewTool:107,enableToolShareStyles:108,enableMultiSelect:14,gridSize:15,snapThreshold:16,enableSnapToContext:17,willRenderHeaderTools:109,willRenderPresetToolbar:110,willRenderShapeStyleControls:18,willStartInteraction:111,shapePresets:19,utilKey:20,mapScreenPointToImagePoint:21,mapImagePointToScreenPoint:22,imageRotation:23,imageFlipX:24,imageFlipY:25,parentRect:26,hooks:112},null,[-1,-1,-1,-1,-1,-1,-1])}get isActive(){return this.$$.ctx[1]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get isVisible(){return this.$$.ctx[3]}set isVisible(t){this.$$set({isVisible:t}),F()}get stores(){return this.$$.ctx[100]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[4]}set locale(t){this.$$set({locale:t}),F()}get shapes(){return this.$$.ctx[5]}set shapes(t){this.$$set({shapes:t}),F()}get toolbar(){return this.$$.ctx[101]}set toolbar(t){this.$$set({toolbar:t}),F()}get toolShapes(){return this.$$.ctx[102]}set toolShapes(t){this.$$set({toolShapes:t}),F()}get toolActive(){return this.$$.ctx[0]}set toolActive(t){this.$$set({toolActive:t}),F()}get toolSelectRadius(){return this.$$.ctx[6]}set toolSelectRadius(t){this.$$set({toolSelectRadius:t}),F()}get toolRetainStyles(){return this.$$.ctx[103]}set toolRetainStyles(t){this.$$set({toolRetainStyles:t}),F()}get toolbarLayout(){return this.$$.ctx[7]}set toolbarLayout(t){this.$$set({toolbarLayout:t}),F()}get textInputMode(){return this.$$.ctx[8]}set textInputMode(t){this.$$set({textInputMode:t}),F()}get shapeControls(){return this.$$.ctx[9]}set shapeControls(t){this.$$set({shapeControls:t}),F()}get enableButtonFlipVertical(){return this.$$.ctx[10]}set enableButtonFlipVertical(t){this.$$set({enableButtonFlipVertical:t}),F()}get enablePresetSelectImage(){return this.$$.ctx[11]}set enablePresetSelectImage(t){this.$$set({enablePresetSelectImage:t}),F()}get enablePresetDropImage(){return this.$$.ctx[12]}set enablePresetDropImage(t){this.$$set({enablePresetDropImage:t}),F()}get enableSelectToolToAddShape(){return this.$$.ctx[104]}set enableSelectToolToAddShape(t){this.$$set({enableSelectToolToAddShape:t}),F()}get enableAutoSelectMoveTool(){return this.$$.ctx[105]}set enableAutoSelectMoveTool(t){this.$$set({enableAutoSelectMoveTool:t}),F()}get enableTapToAddText(){return this.$$.ctx[13]}set enableTapToAddText(t){this.$$set({enableTapToAddText:t}),F()}get enableMoveTool(){return this.$$.ctx[106]}set enableMoveTool(t){this.$$set({enableMoveTool:t}),F()}get enableViewTool(){return this.$$.ctx[107]}set enableViewTool(t){this.$$set({enableViewTool:t}),F()}get enableToolShareStyles(){return this.$$.ctx[108]}set enableToolShareStyles(t){this.$$set({enableToolShareStyles:t}),F()}get enableMultiSelect(){return this.$$.ctx[14]}set enableMultiSelect(t){this.$$set({enableMultiSelect:t}),F()}get gridSize(){return this.$$.ctx[15]}set gridSize(t){this.$$set({gridSize:t}),F()}get snapThreshold(){return this.$$.ctx[16]}set snapThreshold(t){this.$$set({snapThreshold:t}),F()}get enableSnapToContext(){return this.$$.ctx[17]}set enableSnapToContext(t){this.$$set({enableSnapToContext:t}),F()}get willRenderHeaderTools(){return this.$$.ctx[109]}set willRenderHeaderTools(t){this.$$set({willRenderHeaderTools:t}),F()}get willRenderPresetToolbar(){return this.$$.ctx[110]}set willRenderPresetToolbar(t){this.$$set({willRenderPresetToolbar:t}),F()}get willRenderShapeStyleControls(){return this.$$.ctx[18]}set willRenderShapeStyleControls(t){this.$$set({willRenderShapeStyleControls:t}),F()}get willStartInteraction(){return this.$$.ctx[111]}set willStartInteraction(t){this.$$set({willStartInteraction:t}),F()}get shapePresets(){return this.$$.ctx[19]}set shapePresets(t){this.$$set({shapePresets:t}),F()}get utilKey(){return this.$$.ctx[20]}set utilKey(t){this.$$set({utilKey:t}),F()}get mapScreenPointToImagePoint(){return this.$$.ctx[21]}set mapScreenPointToImagePoint(t){this.$$set({mapScreenPointToImagePoint:t}),F()}get mapImagePointToScreenPoint(){return this.$$.ctx[22]}set mapImagePointToScreenPoint(t){this.$$set({mapImagePointToScreenPoint:t}),F()}get imageRotation(){return this.$$.ctx[23]}set imageRotation(t){this.$$set({imageRotation:t}),F()}get imageFlipX(){return this.$$.ctx[24]}set imageFlipX(t){this.$$set({imageFlipX:t}),F()}get imageFlipY(){return this.$$.ctx[25]}set imageFlipY(t){this.$$set({imageFlipY:t}),F()}get parentRect(){return this.$$.ctx[26]}set parentRect(t){this.$$set({parentRect:t}),F()}get hooks(){return this.$$.ctx[112]}set hooks(t){this.$$set({hooks:t}),F()}}var gg=(e,t,n,i,o,r,a,l,s)=>{const c=Ut(e),u=n.width*.5,f=n.height*.5,d=t.width*.5,m=t.height*.5,g=o.x+i.x,p=o.y+i.y;l&&(c.x=n.width-c.x),s&&(c.y=n.height-c.y);const y=Math.cos(r),w=Math.sin(r);c.x-=u,c.y-=f;const _=c.x*y-c.y*w,P=c.x*w+c.y*y;c.x=u+_,c.y=f+P,c.x*=a,c.y*=a,c.x+=d,c.y+=m,c.x+=g,c.y+=p,c.x-=u*a,c.y-=f*a;const C=(o.x-g)*a,R=(o.y-p)*a,I=C*y-R*w,M=C*w+R*y;return c.x+=I,c.y+=M,c},bg=(e,t,n,i,o,r,a,l,s)=>{const c=Ut(e),u=Pc(n),f=Pc(t),d=re(o.x+i.x,o.y+i.y),m=Math.cos(r),g=Math.sin(r);c.x-=f.x,c.y-=f.y;const p=(o.x-d.x)*a,y=(o.y-d.y)*a,w=p*m-y*g,_=p*g+y*m;c.x-=w,c.y-=_,c.x-=d.x,c.y-=d.y,c.x/=a,c.y/=a;const P=c.x*m+c.y*g,C=c.x*g-c.y*m;return c.x=P,c.y=-C,c.x+=u.x,c.y+=u.y,l&&(c.x=n.width-c.x),s&&(c.y=n.height-c.y),c},Lc=e=>typeof e=="boolean";function p7(e){let t,n,i;function o(a){e[61](a)}let r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[46],mapImagePointToScreenPoint:e[45],imageRotation:e[47],imageFlipX:e[44],imageFlipY:e[43],shapes:e[49],toolbar:e[21]||e[7],toolShapes:e[22]||e[8],toolRetainStyles:e[9],enableSelectToolToAddShape:e[31],enableTapToAddText:e[32],enableViewTool:e[30],enableMoveTool:e[34],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[35],snapThreshold:e[16],gridSize:Ht(e[18])?e[18]:e[15],enableSnapToContext:Lc(e[19])?e[19]:e[17],enableToolShareStyles:e[13],shapeControls:e[23]||e[10],shapePresets:e[27],enableButtonFlipVertical:e[24],parentRect:e[50],enablePresetDropImage:e[26],enablePresetSelectImage:e[25],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[14],willRenderPresetToolbar:e[28]||e[20],willRenderShapeStyleControls:e[29],hooks:{willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}};return e[0]!==void 0&&(r.toolActive=e[0]),t=new rh({props:r}),vn.push(()=>Cr(t,"toolActive",o)),t.$on("measure",e[62]),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,l){const s={};l[0]&32&&(s.stores=a[5]),l[0]&64&&(s.locale=a[6]),l[0]&4&&(s.isActive=a[2]),l[0]&8&&(s.isActiveFraction=a[3]),l[0]&16&&(s.isVisible=a[4]),l[1]&32768&&(s.mapScreenPointToImagePoint=a[46]),l[1]&16384&&(s.mapImagePointToScreenPoint=a[45]),l[1]&65536&&(s.imageRotation=a[47]),l[1]&8192&&(s.imageFlipX=a[44]),l[1]&4096&&(s.imageFlipY=a[43]),l[0]&2097280&&(s.toolbar=a[21]||a[7]),l[0]&4194560&&(s.toolShapes=a[22]||a[8]),l[0]&512&&(s.toolRetainStyles=a[9]),l[1]&1&&(s.enableSelectToolToAddShape=a[31]),l[1]&2&&(s.enableTapToAddText=a[32]),l[0]&1073741824&&(s.enableViewTool=a[30]),l[1]&8&&(s.enableMoveTool=a[34]),l[1]&4&&(s.enableAutoSelectMoveTool=a[33]),l[1]&16&&(s.enableMultiSelect=a[35]),l[0]&65536&&(s.snapThreshold=a[16]),l[0]&294912&&(s.gridSize=Ht(a[18])?a[18]:a[15]),l[0]&655360&&(s.enableSnapToContext=Lc(a[19])?a[19]:a[17]),l[0]&8192&&(s.enableToolShareStyles=a[13]),l[0]&8389632&&(s.shapeControls=a[23]||a[10]),l[0]&134217728&&(s.shapePresets=a[27]),l[0]&16777216&&(s.enableButtonFlipVertical=a[24]),l[0]&67108864&&(s.enablePresetDropImage=a[26]),l[0]&33554432&&(s.enablePresetSelectImage=a[25]),l[0]&2048&&(s.toolSelectRadius=a[11]),l[0]&4096&&(s.textInputMode=a[12]),l[0]&16384&&(s.willStartInteraction=a[14]),l[0]&269484032&&(s.willRenderPresetToolbar=a[28]||a[20]),l[0]&536870912&&(s.willRenderShapeStyleControls=a[29]),l[1]&4064&&(s.hooks={willRenderShapeControls:a[36],willRenderShapeTextControls:a[37],beforeAddShape:a[38],beforeRemoveShape:a[39],beforeDeselectShape:a[40],beforeSelectShape:a[41],beforeUpdateShape:a[42]}),!n&&l[0]&1&&(n=!0,s.toolActive=a[0],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}
95function y7(e,t,n){let i,o,r,a,l,s,c,u,f,d;const m="annotate";let{isActive:g}=t,{isActiveFraction:p}=t,{isVisible:y}=t,{stores:w}=t,{locale:_={}}=t,{markupEditorToolbar:P=void 0}=t,{markupEditorToolStyles:C=void 0}=t,{markupEditorToolRetainStyles:R=void 0}=t,{markupEditorShapeStyleControls:I=void 0}=t,{markupEditorToolSelectRadius:M=void 0}=t,{markupEditorTextInputMode:T=void 0}=t,{markupEditorToolShareStyles:v=void 0}=t,{markupEditorWillStartInteraction:H=void 0}=t,{markupEditorGridSize:Y=0}=t,{markupEditorSnapThreshold:Z=0}=t,{markupEditorSnapToContext:W=!1}=t,{annotateGridSize:$=void 0}=t,{annotateSnapToContext:S=void 0}=t,{willRenderShapePresetToolbar:pe=void 0}=t,{annotateTools:ge=void 0}=t,{annotateToolShapes:de=void 0}=t,{annotateShapeControls:Fe=void 0}=t,{annotateActiveTool:X=void 0}=t,{annotateEnableButtonFlipVertical:U=!1}=t,{annotateEnableSelectImagePreset:ae=!1}=t,{annotateEnableDropImagePreset:be=!0}=t,{annotatePresets:ft=[]}=t,{annotateWillRenderShapePresetToolbar:Se=void 0}=t,{annotateWillRenderShapeStyleControls:De=void 0}=t,{enableViewTool:Mt=void 0}=t,{enableSelectToolToAddShape:gt=void 0}=t,{enableTapToAddText:ie=void 0}=t,{enableAutoSelectMoveTool:N=void 0}=t,{enableMoveTool:le=void 0}=t,{enableMultiSelect:Te=void 0}=t,{willRenderShapeControls:me=void 0}=t,{willRenderShapeTextControls:Me=void 0}=t,{beforeAddShape:qe=void 0}=t,{beforeRemoveShape:Ne=void 0}=t,{beforeDeselectShape:mt=void 0}=t,{beforeSelectShape:ue=void 0}=t,{beforeUpdateShape:He=void 0}=t;const{rootRect:Qe,imageAnnotation:G,imageSize:je,imageRotation:ye,imageFlipX:$e,imageFlipY:St,imageTransforms:Je,imageTransformsInterpolated:q}=w;B(e,Qe,V=>n(59,u=V)),B(e,je,V=>n(58,c=V)),B(e,ye,V=>n(47,d=V)),B(e,$e,V=>n(44,l=V)),B(e,St,V=>n(43,a=V)),B(e,Je,V=>n(60,f=V)),B(e,q,V=>n(57,s=V));function Ie(V){X=V,n(0,X)}function se(V){Zo.call(this,e,V)}return e.$$set=V=>{"isActive"in V&&n(2,g=V.isActive),"isActiveFraction"in V&&n(3,p=V.isActiveFraction),"isVisible"in V&&n(4,y=V.isVisible),"stores"in V&&n(5,w=V.stores),"locale"in V&&n(6,_=V.locale),"markupEditorToolbar"in V&&n(7,P=V.markupEditorToolbar),"markupEditorToolStyles"in V&&n(8,C=V.markupEditorToolStyles),"markupEditorToolRetainStyles"in V&&n(9,R=V.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in V&&n(10,I=V.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in V&&n(11,M=V.markupEditorToolSelectRadius),"markupEditorTextInputMode"in V&&n(12,T=V.markupEditorTextInputMode),"markupEditorToolShareStyles"in V&&n(13,v=V.markupEditorToolShareStyles),"markupEditorWillStartInteraction"in V&&n(14,H=V.markupEditorWillStartInteraction),"markupEditorGridSize"in V&&n(15,Y=V.markupEditorGridSize),"markupEditorSnapThreshold"in V&&n(16,Z=V.markupEditorSnapThreshold),"markupEditorSnapToContext"in V&&n(17,W=V.markupEditorSnapToContext),"annotateGridSize"in V&&n(18,$=V.annotateGridSize),"annotateSnapToContext"in V&&n(19,S=V.annotateSnapToContext),"willRenderShapePresetToolbar"in V&&n(20,pe=V.willRenderShapePresetToolbar),"annotateTools"in V&&n(21,ge=V.annotateTools),"annotateToolShapes"in V&&n(22,de=V.annotateToolShapes),"annotateShapeControls"in V&&n(23,Fe=V.annotateShapeControls),"annotateActiveTool"in V&&n(0,X=V.annotateActiveTool),"annotateEnableButtonFlipVertical"in V&&n(24,U=V.annotateEnableButtonFlipVertical),"annotateEnableSelectImagePreset"in V&&n(25,ae=V.annotateEnableSelectImagePreset),"annotateEnableDropImagePreset"in V&&n(26,be=V.annotateEnableDropImagePreset),"annotatePresets"in V&&n(27,ft=V.annotatePresets),"annotateWillRenderShapePresetToolbar"in V&&n(28,Se=V.annotateWillRenderShapePresetToolbar),"annotateWillRenderShapeStyleControls"in V&&n(29,De=V.annotateWillRenderShapeStyleControls),"enableViewTool"in V&&n(30,Mt=V.enableViewTool),"enableSelectToolToAddShape"in V&&n(31,gt=V.enableSelectToolToAddShape),"enableTapToAddText"in V&&n(32,ie=V.enableTapToAddText),"enableAutoSelectMoveTool"in V&&n(33,N=V.enableAutoSelectMoveTool),"enableMoveTool"in V&&n(34,le=V.enableMoveTool),"enableMultiSelect"in V&&n(35,Te=V.enableMultiSelect),"willRenderShapeControls"in V&&n(36,me=V.willRenderShapeControls),"willRenderShapeTextControls"in V&&n(37,Me=V.willRenderShapeTextControls),"beforeAddShape"in V&&n(38,qe=V.beforeAddShape),"beforeRemoveShape"in V&&n(39,Ne=V.beforeRemoveShape),"beforeDeselectShape"in V&&n(40,mt=V.beforeDeselectShape),"beforeSelectShape"in V&&n(41,ue=V.beforeSelectShape),"beforeUpdateShape"in V&&n(42,He=V.beforeUpdateShape)},e.$$.update=()=>{e.$$.dirty[1]&536870912&&n(56,i=f?f.rotation.z:0),e.$$.dirty[1]&503328768&&n(46,o=V=>bg(V,u,c,s.origin,s.translation,i,s.scale,l,a)),e.$$.dirty[1]&503328768&&n(45,r=V=>gg(V,u,c,s.origin,s.translation,i,s.scale,l,a))},[X,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de,Fe,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te,me,Me,qe,Ne,mt,ue,He,a,l,r,o,d,Qe,G,je,ye,$e,St,Je,q,i,s,c,u,f,Ie,se]}class S7 extends gn{constructor(t){super(),mn(this,t,y7,p7,rn,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,markupEditorWillStartInteraction:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,annotateGridSize:18,annotateSnapToContext:19,willRenderShapePresetToolbar:20,annotateTools:21,annotateToolShapes:22,annotateShapeControls:23,annotateActiveTool:0,annotateEnableButtonFlipVertical:24,annotateEnableSelectImagePreset:25,annotateEnableDropImagePreset:26,annotatePresets:27,annotateWillRenderShapePresetToolbar:28,annotateWillRenderShapeStyleControls:29,enableViewTool:30,enableSelectToolToAddShape:31,enableTapToAddText:32,enableAutoSelectMoveTool:33,enableMoveTool:34,enableMultiSelect:35,willRenderShapeControls:36,willRenderShapeTextControls:37,beforeAddShape:38,beforeRemoveShape:39,beforeDeselectShape:40,beforeSelectShape:41,beforeUpdateShape:42},null,[-1,-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get isVisible(){return this.$$.ctx[4]}set isVisible(t){this.$$set({isVisible:t}),F()}get stores(){return this.$$.ctx[5]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[6]}set locale(t){this.$$set({locale:t}),F()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(t){this.$$set({markupEditorToolbar:t}),F()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(t){this.$$set({markupEditorToolStyles:t}),F()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(t){this.$$set({markupEditorToolRetainStyles:t}),F()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(t){this.$$set({markupEditorShapeStyleControls:t}),F()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(t){this.$$set({markupEditorToolSelectRadius:t}),F()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(t){this.$$set({markupEditorTextInputMode:t}),F()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(t){this.$$set({markupEditorToolShareStyles:t}),F()}get markupEditorWillStartInteraction(){return this.$$.ctx[14]}set markupEditorWillStartInteraction(t){this.$$set({markupEditorWillStartInteraction:t}),F()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(t){this.$$set({markupEditorGridSize:t}),F()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(t){this.$$set({markupEditorSnapThreshold:t}),F()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(t){this.$$set({markupEditorSnapToContext:t}),F()}get annotateGridSize(){return this.$$.ctx[18]}set annotateGridSize(t){this.$$set({annotateGridSize:t}),F()}get annotateSnapToContext(){return this.$$.ctx[19]}set annotateSnapToContext(t){this.$$set({annotateSnapToContext:t}),F()}get willRenderShapePresetToolbar(){return this.$$.ctx[20]}set willRenderShapePresetToolbar(t){this.$$set({willRenderShapePresetToolbar:t}),F()}get annotateTools(){return this.$$.ctx[21]}set annotateTools(t){this.$$set({annotateTools:t}),F()}get annotateToolShapes(){return this.$$.ctx[22]}set annotateToolShapes(t){this.$$set({annotateToolShapes:t}),F()}get annotateShapeControls(){return this.$$.ctx[23]}set annotateShapeControls(t){this.$$set({annotateShapeControls:t}),F()}get annotateActiveTool(){return this.$$.ctx[0]}set annotateActiveTool(t){this.$$set({annotateActiveTool:t}),F()}get annotateEnableButtonFlipVertical(){return this.$$.ctx[24]}set annotateEnableButtonFlipVertical(t){this.$$set({annotateEnableButtonFlipVertical:t}),F()}get annotateEnableSelectImagePreset(){return this.$$.ctx[25]}set annotateEnableSelectImagePreset(t){this.$$set({annotateEnableSelectImagePreset:t}),F()}get annotateEnableDropImagePreset(){return this.$$.ctx[26]}set annotateEnableDropImagePreset(t){this.$$set({annotateEnableDropImagePreset:t}),F()}get annotatePresets(){return this.$$.ctx[27]}set annotatePresets(t){this.$$set({annotatePresets:t}),F()}get annotateWillRenderShapePresetToolbar(){return this.$$.ctx[28]}set annotateWillRenderShapePresetToolbar(t){this.$$set({annotateWillRenderShapePresetToolbar:t}),F()}get annotateWillRenderShapeStyleControls(){return this.$$.ctx[29]}set annotateWillRenderShapeStyleControls(t){this.$$set({annotateWillRenderShapeStyleControls:t}),F()}get enableViewTool(){return this.$$.ctx[30]}set enableViewTool(t){this.$$set({enableViewTool:t}),F()}get enableSelectToolToAddShape(){return this.$$.ctx[31]}set enableSelectToolToAddShape(t){this.$$set({enableSelectToolToAddShape:t}),F()}get enableTapToAddText(){return this.$$.ctx[32]}set enableTapToAddText(t){this.$$set({enableTapToAddText:t}),F()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(t){this.$$set({enableAutoSelectMoveTool:t}),F()}get enableMoveTool(){return this.$$.ctx[34]}set enableMoveTool(t){this.$$set({enableMoveTool:t}),F()}get enableMultiSelect(){return this.$$.ctx[35]}set enableMultiSelect(t){this.$$set({enableMultiSelect:t}),F()}get willRenderShapeControls(){return this.$$.ctx[36]}set willRenderShapeControls(t){this.$$set({willRenderShapeControls:t}),F()}get willRenderShapeTextControls(){return this.$$.ctx[37]}set willRenderShapeTextControls(t){this.$$set({willRenderShapeTextControls:t}),F()}get beforeAddShape(){return this.$$.ctx[38]}set beforeAddShape(t){this.$$set({beforeAddShape:t}),F()}get beforeRemoveShape(){return this.$$.ctx[39]}set beforeRemoveShape(t){this.$$set({beforeRemoveShape:t}),F()}get beforeDeselectShape(){return this.$$.ctx[40]}set beforeDeselectShape(t){this.$$set({beforeDeselectShape:t}),F()}get beforeSelectShape(){return this.$$.ctx[41]}set beforeSelectShape(t){this.$$set({beforeSelectShape:t}),F()}get beforeUpdateShape(){return this.$$.ctx[42]}set beforeUpdateShape(t){this.$$set({beforeUpdateShape:t}),F()}}var w7={util:["annotate",S7]};function _7(e){let t,n,i;function o(a){e[52](a)}let r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[44],mapImagePointToScreenPoint:e[43],shapes:e[46],toolbar:e[20]||e[7],toolShapes:e[21]||e[8],toolRetainStyles:e[9],shapeControls:e[22]||e[10
95],shapePresets:e[26],enableSelectToolToAddShape:e[29],enableTapToAddText:e[30],enableViewTool:e[31],enableMoveTool:e[32],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[34],snapThreshold:e[16],gridSize:Ht(e[18])?e[18]:e[15],enableSnapToContext:Lc(e[19])?e[19]:e[17],enableToolShareStyles:e[13],enablePresetSelectImage:e[24],enablePresetDropImage:e[25],enableButtonFlipVertical:e[23],parentRect:e[45],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[42],willRenderPresetToolbar:e[27]||e[14],willRenderShapeStyleControls:e[28],hooks:{willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}};return e[0]!==void 0&&(r.toolActive=e[0]),t=new rh({props:r}),vn.push(()=>Cr(t,"toolActive",o)),t.$on("measure",e[53]),{c(){Ve(t.$$.fragment)},m(a,l){ve(t,a,l),i=!0},p(a,l){const s={};l[0]&32&&(s.stores=a[5]),l[0]&64&&(s.locale=a[6]),l[0]&4&&(s.isActive=a[2]),l[0]&8&&(s.isActiveFraction=a[3]),l[0]&16&&(s.isVisible=a[4]),l[1]&8192&&(s.mapScreenPointToImagePoint=a[44]),l[1]&4096&&(s.mapImagePointToScreenPoint=a[43]),l[0]&1048704&&(s.toolbar=a[20]||a[7]),l[0]&2097408&&(s.toolShapes=a[21]||a[8]),l[0]&512&&(s.toolRetainStyles=a[9]),l[0]&4195328&&(s.shapeControls=a[22]||a[10]),l[0]&67108864&&(s.shapePresets=a[26]),l[0]&536870912&&(s.enableSelectToolToAddShape=a[29]),l[0]&1073741824&&(s.enableTapToAddText=a[30]),l[1]&1&&(s.enableViewTool=a[31]),l[1]&2&&(s.enableMoveTool=a[32]),l[1]&4&&(s.enableAutoSelectMoveTool=a[33]),l[1]&8&&(s.enableMultiSelect=a[34]),l[0]&65536&&(s.snapThreshold=a[16]),l[0]&294912&&(s.gridSize=Ht(a[18])?a[18]:a[15]),l[0]&655360&&(s.enableSnapToContext=Lc(a[19])?a[19]:a[17]),l[0]&8192&&(s.enableToolShareStyles=a[13]),l[0]&16777216&&(s.enablePresetSelectImage=a[24]),l[0]&33554432&&(s.enablePresetDropImage=a[25]),l[0]&8388608&&(s.enableButtonFlipVertical=a[23]),l[0]&2048&&(s.toolSelectRadius=a[11]),l[0]&4096&&(s.textInputMode=a[12]),l[1]&2048&&(s.willStartInteraction=a[42]),l[0]&134234112&&(s.willRenderPresetToolbar=a[27]||a[14]),l[0]&268435456&&(s.willRenderShapeStyleControls=a[28]),l[1]&2032&&(s.hooks={willRenderShapeControls:a[35],willRenderShapeTextControls:a[36],beforeAddShape:a[37],beforeRemoveShape:a[38],beforeDeselectShape:a[39],beforeSelectShape:a[40],beforeUpdateShape:a[41]}),!n&&l[0]&1&&(n=!0,s.toolActive=a[0],Dr(()=>n=!1)),t.$set(s)},i(a){i||(L(t.$$.fragment,a),i=!0)},o(a){z(t.$$.fragment,a),i=!1},d(a){Oe(t,a)}}}function T7(e,t,n){let i,o,r,a,l;const s="decorate";let{isActive:c}=t,{isActiveFraction:u}=t,{isVisible:f}=t,{stores:d}=t,{locale:m={}}=t,{markupEditorToolbar:g=void 0}=t,{markupEditorToolStyles:p=void 0}=t,{markupEditorToolRetainStyles:y=void 0}=t,{markupEditorShapeStyleControls:w=void 0}=t,{markupEditorToolSelectRadius:_=void 0}=t,{markupEditorTextInputMode:P=void 0}=t,{markupEditorToolShareStyles:C=void 0}=t,{willRenderShapePresetToolbar:R=void 0}=t,{markupEditorGridSize:I=void 0}=t,{markupEditorSnapThreshold:M=void 0}=t,{markupEditorSnapToContext:T=!0}=t,{decorateGridSize:v=void 0}=t,{decorateSnapToContext:H=void 0}=t,{decorateTools:Y=void 0}=t,{decorateToolShapes:Z=void 0}=t,{decorateShapeControls:W=void 0}=t,{decorateActiveTool:$=void 0}=t,{decorateEnableButtonFlipVertical:S=!1}=t,{decorateEnableSelectImagePreset:pe=!1}=t,{decorateEnableDropImagePreset:ge=!0}=t,{decoratePresets:de=[]}=t,{decorateWillRenderShapePresetToolbar:Fe=void 0}=t,{decorateWillRenderShapeStyleControls:X=void 0}=t,{enableSelectToolToAddShape:U=void 0}=t,{enableTapToAddText:ae=void 0}=t,{enableViewTool:be=void 0}=t,{enableMoveTool:ft=void 0}=t,{enableAutoSelectMoveTool:Se=void 0}=t,{enableMultiSelect:De=void 0}=t,{willRenderShapeControls:Mt=void 0}=t,{willRenderShapeTextControls:gt=void 0}=t,{beforeAddShape:ie=void 0}=t,{beforeRemoveShape:N=void 0}=t,{beforeDeselectShape:le=void 0}=t,{beforeSelectShape:Te=void 0}=t,{beforeUpdateShape:me=void 0}=t,{markupEditorWillStartInteraction:Me=void 0}=t;const{imageCropRect:qe,imageDecoration:Ne,imageSelectionRectPresentation:mt,imageTransformsInterpolated:ue}=d;B(e,mt,G=>n(50,a=G)),B(e,ue,G=>n(51,l=G));function He(G){$=G,n(0,$)}function Qe(G){Zo.call(this,e,G)}return e.$$set=G=>{"isActive"in G&&n(2,c=G.isActive),"isActiveFraction"in G&&n(3,u=G.isActiveFraction),"isVisible"in G&&n(4,f=G.isVisible),"stores"in G&&n(5,d=G.stores),"locale"in G&&n(6,m=G.locale),"markupEditorToolbar"in G&&n(7,g=G.markupEditorToolbar),"markupEditorToolStyles"in G&&n(8,p=G.markupEditorToolStyles),"markupEditorToolRetainStyles"in G&&n(9,y=G.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in G&&n(10,w=G.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in G&&n(11,_=G.markupEditorToolSelectRadius),"markupEditorTextInputMode"in G&&n(12,P=G.markupEditorTextInputMode),"markupEditorToolShareStyles"in G&&n(13,C=G.markupEditorToolShareStyles),"willRenderShapePresetToolbar"in G&&n(14,R=G.willRenderShapePresetToolbar),"markupEditorGridSize"in G&&n(15,I=G.markupEditorGridSize),"markupEditorSnapThreshold"in G&&n(16,M=G.markupEditorSnapThreshold),"markupEditorSnapToContext"in G&&n(17,T=G.markupEditorSnapToContext),"decorateGridSize"in G&&n(18,v=G.decorateGridSize),"decorateSnapToContext"in G&&n(19,H=G.decorateSnapToContext),"decorateTools"in G&&n(20,Y=G.decorateTools),"decorateToolShapes"in G&&n(21,Z=G.decorateToolShapes),"decorateShapeControls"in G&&n(22,W=G.decorateShapeControls),"decorateActiveTool"in G&&n(0,$=G.decorateActiveTool),"decorateEnableButtonFlipVertical"in G&&n(23,S=G.decorateEnableButtonFlipVertical),"decorateEnableSelectImagePreset"in G&&n(24,pe=G.decorateEnableSelectImagePreset),"decorateEnableDropImagePreset"in G&&n(25,ge=G.decorateEnableDropImagePreset),"decoratePresets"in G&&n(26,de=G.decoratePresets),"decorateWillRenderShapePresetToolbar"in G&&n(27,Fe=G.decorateWillRenderShapePresetToolbar),"decorateWillRenderShapeStyleControls"in G&&n(28,X=G.decorateWillRenderShapeStyleControls),"enableSelectToolToAddShape"in G&&n(29,U=G.enableSelectToolToAddShape),"enableTapToAddText"in G&&n(30,ae=G.enableTapToAddText),"enableViewTool"
95in G&&n(31,be=G.enableViewTool),"enableMoveTool"in G&&n(32,ft=G.enableMoveTool),"enableAutoSelectMoveTool"in G&&n(33,Se=G.enableAutoSelectMoveTool),"enableMultiSelect"in G&&n(34,De=G.enableMultiSelect),"willRenderShapeControls"in G&&n(35,Mt=G.willRenderShapeControls),"willRenderShapeTextControls"in G&&n(36,gt=G.willRenderShapeTextControls),"beforeAddShape"in G&&n(37,ie=G.beforeAddShape),"beforeRemoveShape"in G&&n(38,N=G.beforeRemoveShape),"beforeDeselectShape"in G&&n(39,le=G.beforeDeselectShape),"beforeSelectShape"in G&&n(40,Te=G.beforeSelectShape),"beforeUpdateShape"in G&&n(41,me=G.beforeUpdateShape),"markupEditorWillStartInteraction"in G&&n(42,Me=G.markupEditorWillStartInteraction)},e.$$.update=()=>{e.$$.dirty[1]&1048576&&n(49,i=l?l.scale:1),e.$$.dirty[1]&786432&&n(44,o=G=>{const je=Ut(G);return je.x-=a.x,je.y-=a.y,je.x/=i,je.y/=i,je}),e.$$.dirty[1]&786432&&n(43,r=G=>{const je=Ut(G);return je.x*=i,je.y*=i,je.x+=a.x,je.y+=a.y,je})},[$,s,c,u,f,d,m,g,p,y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,S,pe,ge,de,Fe,X,U,ae,be,ft,Se,De,Mt,gt,ie,N,le,Te,me,Me,r,o,qe,Ne,mt,ue,i,a,l,He,Qe]}class k7 extends gn{constructor(t){super(),mn(this,t,T7,_7,rn,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,willRenderShapePresetToolbar:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,decorateGridSize:18,decorateSnapToContext:19,decorateTools:20,decorateToolShapes:21,decorateShapeControls:22,decorateActiveTool:0,decorateEnableButtonFlipVertical:23,decorateEnableSelectImagePreset:24,decorateEnableDropImagePreset:25,decoratePresets:26,decorateWillRenderShapePresetToolbar:27,decorateWillRenderShapeStyleControls:28,enableSelectToolToAddShape:29,enableTapToAddText:30,enableViewTool:31,enableMoveTool:32,enableAutoSelectMoveTool:33,enableMultiSelect:34,willRenderShapeControls:35,willRenderShapeTextControls:36,beforeAddShape:37,beforeRemoveShape:38,beforeDeselectShape:39,beforeSelectShape:40,beforeUpdateShape:41,markupEditorWillStartInteraction:42},null,[-1,-1])}get name(){return this.$$.ctx[1]}get isActive(){return this.$$.ctx[2]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[3]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get isVisible(){return this.$$.ctx[4]}set isVisible(t){this.$$set({isVisible:t}),F()}get stores(){return this.$$.ctx[5]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[6]}set locale(t){this.$$set({locale:t}),F()}get markupEditorToolbar(){return this.$$.ctx[7]}set markupEditorToolbar(t){this.$$set({markupEditorToolbar:t}),F()}get markupEditorToolStyles(){return this.$$.ctx[8]}set markupEditorToolStyles(t){this.$$set({markupEditorToolStyles:t}),F()}get markupEditorToolRetainStyles(){return this.$$.ctx[9]}set markupEditorToolRetainStyles(t){this.$$set({markupEditorToolRetainStyles:t}),F()}get markupEditorShapeStyleControls(){return this.$$.ctx[10]}set markupEditorShapeStyleControls(t){this.$$set({markupEditorShapeStyleControls:t}),F()}get markupEditorToolSelectRadius(){return this.$$.ctx[11]}set markupEditorToolSelectRadius(t){this.$$set({markupEditorToolSelectRadius:t}),F()}get markupEditorTextInputMode(){return this.$$.ctx[12]}set markupEditorTextInputMode(t){this.$$set({markupEditorTextInputMode:t}),F()}get markupEditorToolShareStyles(){return this.$$.ctx[13]}set markupEditorToolShareStyles(t){this.$$set({markupEditorToolShareStyles:t}),F()}get willRenderShapePresetToolbar(){return this.$$.ctx[14]}set willRenderShapePresetToolbar(t){this.$$set({willRenderShapePresetToolbar:t}),F()}get markupEditorGridSize(){return this.$$.ctx[15]}set markupEditorGridSize(t){this.$$set({markupEditorGridSize:t}),F()}get markupEditorSnapThreshold(){return this.$$.ctx[16]}set markupEditorSnapThreshold(t){this.$$set({markupEditorSnapThreshold:t}),F()}get markupEditorSnapToContext(){return this.$$.ctx[17]}set markupEditorSnapToContext(t){this.$$set({markupEditorSnapToContext:t}),F()}get decorateGridSize(){return this.$$.ctx[18]}set decorateGridSize(t){this.$$set({decorateGridSize:t}),F()}get decorateSnapToContext(){return this.$$.ctx[19]}set decorateSnapToContext(t){this.$$set({decorateSnapToContext:t}),F()}get decorateTools(){return this.$$.ctx[20]}set decorateTools(t){this.$$set({decorateTools:t}),F()}get decorateToolShapes(){return this.$$.ctx[21]}set decorateToolShapes(t){this.$$set({decorateToolShapes:t}),F()}get decorateShapeControls(){return this.$$.ctx[22]}set decorateShapeControls(t){this.$$set({decorateShapeControls:t}),F()}get decorateActiveTool(){return this.$$.ctx[0]}set decorateActiveTool(t){this.$$set({decorateActiveTool:t}),F()}get decorateEnableButtonFlipVertical(){return this.$$.ctx[23]}set decorateEnableButtonFlipVertical(t){this.$$set({decorateEnableButtonFlipVertical:t}),F()}get decorateEnableSelectImagePreset(){return this.$$.ctx[24]}set decorateEnableSelectImagePreset(t){this.$$set({decorateEnableSelectImagePreset:t}),F()}get decorateEnableDropImagePreset(){return this.$$.ctx[25]}set decorateEnableDropImagePreset(t){this.$$set({decorateEnableDropImagePreset:t}),F()}get decoratePresets(){return this.$$.ctx[26]}set decoratePresets(t){this.$$set({decoratePresets:t}),F()}get decorateWillRenderShapePresetToolbar(){return this.$$.ctx[27]}set decorateWillRenderShapePresetToolbar(t){this.$$set({decorateWillRenderShapePresetToolbar:t}),F()}get decorateWillRenderShapeStyleControls(){return this.$$.ctx[28]}set decorateWillRenderShapeStyleControls(t){this.$$set({decorateWillRenderShapeStyleControls:t}),F()}get enableSelectToolToAddShape(){return this.$$.ctx[29]}set enableSelectToolToAddShape(t){this.$$set({enableSelectToolToAddShape:t}),F()}get enableTapToAddText(){return this.$$.ctx[30]}set enableTapToAddText(t){this.$$set({enableTapToAddText:t}),F()}get enableViewTool(){return this.$$.ctx[31]}set enableViewTool(t){this.$$set({enableViewTool:t}),F()}get enableMoveTool(){return this.$$.ctx[32]}set enableMoveTool(t){this.$$set({enableMoveTool:t}),F()}get enableAutoSelectMoveTool(){return this.$$.ctx[33]}set enableAutoSelectMoveTool(t){this.$$set({enableAutoSelectMoveTool:t}),F()}get enableMultiSelect(){return this.$$.ctx[34]}set enableMultiSelect(t){this.$$set({enableMultiSelect:t}),F()}get willRenderShapeControls(){return this.$$.ctx[35]}set willRenderShapeControls(t){this.$$set({willRenderShapeControls:t}),F()}get willRenderShapeTextControls(){return this.$$.ctx[36]}set willRenderShapeTextControls(t){this.$$set({willRenderShapeTextControls:t}),F()}get beforeAddShape(){return this.$$.ctx[37]}set beforeAddShape(t){this.$$set({beforeAddShape:t}),F()}get beforeRemoveShape(){return this.$$.ctx[38]}set beforeRemoveShape(t){this.$$set({beforeRemoveShape:t}),F()}get beforeDeselectShape(){return this.$$.ctx[39]}set beforeDeselectShape(t){this.$$set({beforeDeselectShape:t}),F()}get beforeSelectShape(){return this.$$.ctx[40]}set beforeSelectShape(t){this.$$set({beforeSelectShape:t}),F()}get beforeUpdateShape(){return this.$$.ctx[41]}set beforeUpdateShape(t){this.$$set({beforeUpdateShape:t}),F()}get markupEditorWillStartInteraction(){return this.$$.ctx[42]}set markupEditorWillStartInteraction(t){this.$$set({markupEditorWillStartInteraction:t}),F()}}var C7={util:["decorate",k7]};function P7(e){let t,n;return t=new rh({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[26],mapImagePointToScreenPoint:e[25],utilKey:"sticker",shapePresets:e[5],shapes:e[6]?e[35]:e[36],toolActive:"preset",imageFlipX:e[6]?e[24]:!1,imageFlipY:e[6]?e[23]:!1,imageRotation:e[6]?e[31]:0,parentRect:e[6]?e[37]:e[33],snapThreshold:e[29],gridSize:e[28],enableMultiSelect:e[12],enableSnapToContext:e[27],enablePresetDropImage:e[7],enablePresetSelectImage:e[30],enableButtonFlipVertical:e[10]||e[8],toolSelectRadius:e[15],willStartInteraction:e[22],willRenderPresetToolbar:e[11]||e[9]||e[16],hooks:{willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}}}),t.$on("measure",e[61]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&8&&(r.stores=i[3]),o[0]&16&&(r.locale=i[4]),o[0]&1&&(r.isActive=i[0]),o[0]&2&&(r.isActiveFraction=i[1]),o[0]&4&&(r.isVisible=i[2]),o[0]&67108864&&(r.mapScreenPointToImagePoint=i[26]),o[0]&33554432&&(r.mapImagePointToScreenPoint=i[25]),o[0]&32&&(r.shapePresets=i[5]),o[0]&64&&(r.shapes=i[6]?i[35]:i[36]),o[0]&16777280&&(r.imageFlipX=i[6]?i[24]:!1),o[0]&8388672&&(r.imageFlipY=i[6]?i[23]:!1),o[0]&64|o[1]&1&&(r.imageRotation=i[6]?i[31]:0),o[0]&64&&(r.parentRect=i[6]?i[37]:i[33]),o[0]&536870912&&(r.snapThreshold=i[29]),o[0]&268435456&&(r.gridSize=i[28]),o[0]&4096&&(r.enableMultiSelect=i[12]),o[0]&134217728&&(r.enableSnapToContext=i[27]),o[0]&128&&(r.enablePresetDropImage=i[7]),o[0]&1073741824&&(r.enablePresetSelectImage=i[30]),o[0]&1280&&(r.enableButtonFlipVertical=i[10]||i[8]),o[0]&32768&&(r.toolSelectRadius=i[15]),o[0]&4194304&&(r.willStartInteraction=i[22]),o[0]&68096&&(r.willRenderPresetToolbar=i[11]||i[9]||i[16]),o[0]&4087808&&(r.hooks={willRenderShapeControls:i[13],willRenderShapeTextControls:i[14],beforeAddShape:i[17],beforeRemoveShape:i[18],beforeDeselectShape:i[19],beforeSelectShape:i[20],beforeUpdateShape:i[21]}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function M7(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g,p,y,w,_;const P="sticker";let{isActive:C}=t,{isActiveFraction:R}=t,{isVisible:I}=t,{stores:M}=t,{locale:T={}}=t,{stickers:v=[]}=t,{stickerForceEnable:H=!1}=t,{stickerStickToImage:Y=!1}=t,{stickerEnableSelectImagePreset:Z=!0}=t,{stickerEnableDropImagePreset:W=!0}=t,{stickerEnableButtonFlipVertical:$=!1}=t,{stickerWillRenderShapePresetToolbar:S=void 0}=t,{stickerEnableSelectImage:pe=!0}=t,{stickersEnableButtonFlipVertical:ge=!1}=t,{stickersWillRenderShapePresetToolbar:de=void 0}=t,{markupEditorGridSize:Fe=0}=t,{markupEditorSnapThreshold:X=0}=t,{markupEditorSnapToContext:U=!1}=t,{enableMultiSelect:ae=void 0}=t,{annotateGridSize:be=void 0}=t,{annotateSnapToContext:ft=void 0}=t,{decorateGridSize:Se=void 0}=t,{decorateSnapToContext:De=void 0}=t,{willRenderShapeControls:Mt=void 0}=t,{willRenderShapeTextControls:gt=void 0}=t,{markupEditorToolSelectRadius:ie=void 0}=t,{willRenderShapePresetToolbar:N=void 0}=t,{beforeAddShape:le=void 0}=t,{beforeRemoveShape:Te=void 0}=t,{beforeDeselectShape:me=void 0}=t,{beforeSelectShape:Me=void 0}=t,{beforeUpdateShape:qe=void 0}=t,{markupEditorWillStartInteraction:Ne=void 0}=t;const{rootRect:mt,imageCropRect:ue,imageSelectionRectPresentation:He,imageAnnotation:Qe,imageDecoration:G,imageSize:je,imageTransforms:ye,imageTransformsInterpolated:$e,imageRotation:St,imageFlipX:Je,imageFlipY:q}=M;B(e,mt,se=>n(59,y=se)),B(e,He,se=>n(56,f=se)),B(e,je,se=>n(58,p=se)),B(e,ye,se=>n(60,w=se)),B(e,$e,se=>n(57,g=se)),B(e,St,se=>
95n(31,_=se)),B(e,Je,se=>n(24,m=se)),B(e,q,se=>n(23,d=se));function Ie(se){Zo.call(this,e,se)}return e.$$set=se=>{"isActive"in se&&n(0,C=se.isActive),"isActiveFraction"in se&&n(1,R=se.isActiveFraction),"isVisible"in se&&n(2,I=se.isVisible),"stores"in se&&n(3,M=se.stores),"locale"in se&&n(4,T=se.locale),"stickers"in se&&n(5,v=se.stickers),"stickerForceEnable"in se&&n(44,H=se.stickerForceEnable),"stickerStickToImage"in se&&n(6,Y=se.stickerStickToImage),"stickerEnableSelectImagePreset"in se&&n(45,Z=se.stickerEnableSelectImagePreset),"stickerEnableDropImagePreset"in se&&n(7,W=se.stickerEnableDropImagePreset),"stickerEnableButtonFlipVertical"in se&&n(8,$=se.stickerEnableButtonFlipVertical),"stickerWillRenderShapePresetToolbar"in se&&n(9,S=se.stickerWillRenderShapePresetToolbar),"stickerEnableSelectImage"in se&&n(46,pe=se.stickerEnableSelectImage),"stickersEnableButtonFlipVertical"in se&&n(10,ge=se.stickersEnableButtonFlipVertical),"stickersWillRenderShapePresetToolbar"in se&&n(11,de=se.stickersWillRenderShapePresetToolbar),"markupEditorGridSize"in se&&n(47,Fe=se.markupEditorGridSize),"markupEditorSnapThreshold"in se&&n(48,X=se.markupEditorSnapThreshold),"markupEditorSnapToContext"in se&&n(49,U=se.markupEditorSnapToContext),"enableMultiSelect"in se&&n(12,ae=se.enableMultiSelect),"annotateGridSize"in se&&n(50,be=se.annotateGridSize),"annotateSnapToContext"in se&&n(51,ft=se.annotateSnapToContext),"decorateGridSize"in se&&n(52,Se=se.decorateGridSize),"decorateSnapToContext"in se&&n(53,De=se.decorateSnapToContext),"willRenderShapeControls"in se&&n(13,Mt=se.willRenderShapeControls),"willRenderShapeTextControls"in se&&n(14,gt=se.willRenderShapeTextControls),"markupEditorToolSelectRadius"in se&&n(15,ie=se.markupEditorToolSelectRadius),"willRenderShapePresetToolbar"in se&&n(16,N=se.willRenderShapePresetToolbar),"beforeAddShape"in se&&n(17,le=se.beforeAddShape),"beforeRemoveShape"in se&&n(18,Te=se.beforeRemoveShape),"beforeDeselectShape"in se&&n(19,me=se.beforeDeselectShape),"beforeSelectShape"in se&&n(20,Me=se.beforeSelectShape),"beforeUpdateShape"in se&&n(21,qe=se.beforeUpdateShape),"markupEditorWillStartInteraction"in se&&n(22,Ne=se.markupEditorWillStartInteraction)},e.$$.update=()=>{e.$$.dirty[1]&67108864&&n(54,i=g?g.scale:1),e.$$.dirty[1]&536870912&&n(55,o=w?w.rotation.z:0),e.$$.dirty[1]&49152&&n(30,r=Z===!1?!1:pe),e.$$.dirty[1]&131072&&n(29,a=X),e.$$.dirty[0]&64|e.$$.dirty[1]&2686976&&n(28,l=Y?Ht(be)?be:Fe:Ht(Se)?Se:Fe),e.$$.dirty[0]&64|e.$$.dirty[1]&5505024&&n(27,s=Y?Lc(ft)?ft:U:Lc(De)?De:U),e.$$.dirty[0]&25165888|e.$$.dirty[1]&528482304&&n(26,c=Y?se=>bg(se,y,p,g.origin,g.translation,o,g.scale,m,d):se=>{const V=Ut(se);return V.x-=f.x,V.y-=f.y,V.x/=i,V.y/=i,V}),e.$$.dirty[0]&25165888|e.$$.dirty[1]&528482304&&n(25,u=Y?se=>gg(se,y,p,g.origin,g.translation,o,g.scale,m,d):se=>{const V=Ut(se);return V.x*=i,V.y*=i,V.x+=f.x,V.y+=f.y,V})},[C,R,I,M,T,v,Y,W,$,S,ge,de,ae,Mt,gt,ie,N,le,Te,me,Me,qe,Ne,d,m,u,c,s,l,a,r,_,mt,ue,He,Qe,G,je,ye,$e,St,Je,q,P,H,Z,pe,Fe,X,U,be,ft,Se,De,i,o,f,g,p,y,w,Ie]}class R7 extends gn{constructor(t){super(),mn(this,t,M7,P7,rn,{name:43,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,stickers:5,stickerForceEnable:44,stickerStickToImage:6,stickerEnableSelectImagePreset:45,stickerEnableDropImagePreset:7,stickerEnableButtonFlipVertical:8,stickerWillRenderShapePresetToolbar:9,stickerEnableSelectImage:46,stickersEnableButtonFlipVertical:10,stickersWillRenderShapePresetToolbar:11,markupEditorGridSize:47,markupEditorSnapThreshold:48,markupEditorSnapToContext:49,enableMultiSelect:12,annotateGridSize:50,annotateSnapToContext:51,decorateGridSize:52,decorateSnapToContext:53,willRenderShapeControls:13,willRenderShapeTextControls:14,markupEditorToolSelectRadius:15,willRenderShapePresetToolbar:16,beforeAddShape:17,beforeRemoveShape:18,beforeDeselectShape:19,beforeSelectShape:20,beforeUpdateShape:21,markupEditorWillStartInteraction:22},null,[-1,-1])}get name(){return this.$$.ctx[43]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get isVisible(){return this.$$.ctx[2]}set isVisible(t){this.$$set({isVisible:t}),F()}get stores(){return this.$$.ctx[3]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[4]}set locale(t){this.$$set({locale:t}),F()}get stickers(){return this.$$.ctx[5]}set stickers(t){this.$$set({stickers:t}),F()}get stickerForceEnable(){return this.$$.ctx[44]}set stickerForceEnable(t){this.$$set({stickerForceEnable:t}),F()}get stickerStickToImage(){return this.$$.ctx[6]}set stickerStickToImage(t){this.$$set({stickerStickToImage:t}),F()}get stickerEnableSelectImagePreset(){return this.$$.ctx[45]}set stickerEnableSelectImagePreset(t){this.$$set({stickerEnableSelectImagePreset:t}),F()}get stickerEnableDropImagePreset(){return this.$$.ctx[7]}set stickerEnableDropImagePreset(t){this.$$set({stickerEnableDropImagePreset:t}),F()}get stickerEnableButtonFlipVertical(){return this.$$.ctx[8]}set stickerEnableButtonFlipVertical(t){this.$$set({stickerEnableButtonFlipVertical:t}),F()}get stickerWillRenderShapePresetToolbar(){return this.$$.ctx[9]}set stickerWillRenderShapePresetToolbar(t){this.$$set({stickerWillRenderShapePresetToolbar:t}),F()}get stickerEnableSelectImage(){return this.$$.ctx[46]}set stickerEnableSelectImage(t){this.$$set({stickerEnableSelectImage:t}),F()}get stickersEnableButtonFlipVertical(){return this.$$.ctx[10]}set stickersEnableButtonFlipVertical(t){this.$$set({stickersEnableButtonFlipVertical:t}),F()}get stickersWillRenderShapePresetToolbar(){return this.$$.ctx[11]}set stickersWillRenderShapePresetToolbar(t){this.$$set({stickersWillRenderShapePresetToolbar:t}),F()}get markupEditorGridSize(){return this.$$.ctx[47]}set markupEditorGridSize(t){this.$$set({markupEditorGridSize:t}),F()}get markupEditorSnapThreshold(){return this.$$.ctx[48]}set markupEditorSnapThreshold(t){this.$$set({markupEditorSnapThreshold:t}),F()}get markupEditorSnapToContext(){return this.$$.ctx[49]}set markupEditorSnapToContext(t){this.$$set({markupEditorSnapToContext:t}),F()}get enableMultiSelect(){return this.$$.ctx[12]}set enableMultiSelect(t){this.$$set({enableMultiSelect:t}),F()}get annotateGridSize(){return this.$$.ctx[50]}set annotateGridSize(t){this.$$set({annotateGridSize:t}),F()}get annotateSnapToContext(){return this.$$.ctx[51]}set annotateSnapToContext(t){this.$$set({annotateSnapToContext:t}),F()}get decorateGridSize(){return this.$$.ctx[52]}set decorateGridSize(t){this.$$set({decorateGridSize:t}),F()}get decorateSnapToContext(){return this.$$.ctx[53]}set decorateSnapToContext(t){this.$$set({decorateSnapToContext:t}),F()}get willRenderShapeControls(){return this.$$.ctx[13]}set willRenderShapeControls(t){this.$$set({willRenderShapeControls:t}),F()}get willRenderShapeTextControls(){return this.$$.ctx[14]}set willRenderShapeTextControls(t){this.$$set({willRenderShapeTextControls:t}),F()}get markupEditorToolSelectRadius(){return this.$$.ctx[15]}set markupEditorToolSelectRadius(t){this.$$set({markupEditorToolSelectRadius:t}),F()}get willRenderShapePresetToolbar(){return this.$$.ctx[16]}set willRenderShapePresetToolbar(t){this.$$set({willRenderShapePresetToolbar:t}),F()}get beforeAddShape(){return this.$$.ctx[17]}set beforeAddShape(t){this.$$set({beforeAddShape:t}),F()}get beforeRemoveShape(){return this.$$.ctx[18]}set beforeRemoveShape(t){this.$$set({beforeRemoveShape:t}),F()}get beforeDeselectShape(){return this.$$.ctx[19]}set beforeDeselectShape(t){this.$$set({beforeDeselectShape:t}),F()}get beforeSelectShape(){return this.$$.ctx[20]}set beforeSelectShape(t){this.$$set({beforeSelectShape:t}),F()}get beforeUpdateShape(){return this.$$.ctx[21]}set beforeUpdateShape(t){this.$$set({beforeUpdateShape:t}),F()}get markupEditorWillStartInteraction(){return this.$$.ctx[22]}set markupEditorWillStartInteraction(t){this.$$set({markupEditorWillStartInteraction:t}),F()}}var I7={util:["sticker",R7,({stickers:e,stickerEnableSelectImage:t,stickerEnableSelectImagePreset:n,stickerEnableDropImagePreset:i,stickerForceEnable:o})=>e&&e.length||t||n||i||o]};
95function E7(e){let t,n=(e[14](e[36].value)||"")+"",i;return{c(){t=new qm(!1),i=Mi(),t.a=i},m(o,r){t.m(n,o,r),te(o,i,r)},p(o,r){r[1]&32&&n!==(n=(o[14](o[36].value)||"")+"")&&t.p(n)},i:qt,o:qt,d(o){o&&(ee(i),t.d())}}}function A7(e){let t,n;return t=new Xo({props:{items:e[16](e[36].value)}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[1]&32&&(r.items=i[16](i[36].value)),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function L7(e){let t,n,i,o,r,a,l=(xn(e[36].label)?e[36].label(e[1]):e[36].label)+"",s,c;const u=[A7,E7],f=[];function d(m,g){return g[1]&32&&(n=null),n==null&&(n=!!m[15](m[36].value)),n?0:1}return i=d(e,[-1,-1]),o=f[i]=u[i](e),{c(){t=fe("div"),o.c(),r=ut(),a=fe("span"),s=bi(l),k(t,"slot","option")},m(m,g){te(m,t,g),f[i].m(t,null),Ae(t,r),Ae(t,a),Ae(a,s),c=!0},p(m,g){let p=i;i=d(m,g),i===p?f[i].p(m,g):(Et(),z(f[p],1,1,()=>{f[p]=null}),At(),o=f[i],o?o.p(m,g):(o=f[i]=u[i](m),o.c()),L(o,1),o.m(t,r)),(!c||g[0]&2|g[1]&32)&&l!==(l=(xn(m[36].label)?m[36].label(m[1]):m[36].label)+"")&&vi(s,l)},i(m){c||(L(o),c=!0)},o(m){z(o),c=!1},d(m){m&&ee(t),f[i].d()}}}function x7(e){let t,n;return t=new El({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[6],onchange:e[12],$$slots:{option:[L7,({option:i})=>({36:i}),({option:i})=>[0,i?32:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&2&&(r.locale=i[1]),o[0]&4&&(r.options=i[2]),o[0]&64&&(r.selectedIndex=i[6]),o[0]&2|o[1]&96&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function F7(e){let t,n,i,o,r;return n=new oh({props:{locale:e[1],class:"PinturaControlPanels",shapeProps:e[4],onchange:e[13],controls:e[3],scrollElasticity:e[7]}}),o=new Ka({props:{elasticity:e[10],$$slots:{default:[x7]},$$scope:{ctx:e}}}),{c(){t=fe("div"),Ve(n.$$.fragment),i=ut(),Ve(o.$$.fragment),k(t,"slot","footer"),Ee(t,"transform",e[5])},m(a,l){te(a,t,l),ve(n,t,null),Ae(t,i),ve(o,t,null),r=!0},p(a,l){const s={};l[0]&2&&(s.locale=a[1]),l[0]&16&&(s.shapeProps=a[4]),l[0]&8&&(s.controls=a[3]),l[0]&128&&(s.scrollElasticity=a[7]),n.$set(s);const c={};l[0]&70|l[1]&64&&(c.$$scope={dirty:l,ctx:a}),o.$set(c),l[0]&32&&Ee(t,"transform",a[5])},i(a){r||(L(n.$$.fragment,a),L(o.$$.fragment,a),r=!0)},o(a){z(n.$$.fragment,a),z(o.$$.fragment,a),r=!1},d(a){a&&ee(t),Oe(n),Oe(o)}}}function v7(e){let t,n;return t=new Hs({props:{$$slots:{footer:[F7]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&254|o[1]&64&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function O7(e,t,n){let i,o,r,a,l,s=qt,c=()=>(s(),s=Do(g,Se=>n(22,l=Se)),g),u,f,d;e.$$.on_destroy.push(()=>s());const m="frame";let{isActive:g}=t;c();let{stores:p}=t,{locale:y={}}=t,{frameStyles:w={}}=t,{frameOptions:_=[]}=t,{markupEditorShapeStyleControls:P=void 0}=t;const C=Qn("elasticityMultiplier");B(e,C,Se=>n(24,d=Se));const{history:R,animation:I,scrollElasticity:M,imageFrame:T,allowPan:v,allowZoom:H,allowZoomControls:Y,allowPlayPause:Z}=p;B(e,I,Se=>n(23,u=Se)),B(e,T,Se=>n(4,f=Se));let W={};const $=({value:Se})=>{const De=w[Se];if(!De||!De.shape){T.set(void 0),R.write();return}const{shape:Mt}=De,gt={id:Se,...yi(Mt),...Object.keys(W).reduce((ie,N)=>(Mt[N]&&(ie[N]=W[N]),ie),{})};T.set(gt),R.write()};let S;function pe(Se){Rt(Se,"frameColor")&&(W.frameColor=Se.frameColor),f&&(Ua(f,Se),T.set(f),clearTimeout(S),S=setTimeout(()=>{R.write()},200))}const ge=Se=>/rect|path|circle|line|<g>/i.test(Se),de=Se=>/div/i.test(Se),Fe=Se=>de(Se)||R4(Se)?Se:ge(Se)?`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" stroke-width="1" stroke="currentColor" fill="none" aria-hidden="true" focusable="false" stroke-linecap="round" stroke-linejoin="round">${Se}</svg>`:`<img src="${Se}" alt=""/>`,X=Se=>{const De=w[Se];if(!(!De||!De.thumb))return Fe(De.thumb)},U=Se=>{const De=w[Se];return!De||!De.thumb?!1:Si(De.thumb)},ae=Se=>w[Se].thumb,be=hn(u?20:0);B(e,be,Se=>n(21,a=Se));function ft(Se){Zo.call(this,e,Se)}return e.$$set=Se=>{"isActive"in Se&&c(n(0,g=Se.isActive)),"stores"in Se&&n(19,p=Se.stores),"locale"in Se&&n(1,y=Se.locale),"frameStyles"in Se&&n(20,w=Se.frameStyles),"frameOptions"in Se&&n(2,_=Se.frameOptions),"markupEditorShapeStyleControls"in Se&&n(3,P=Se.markupEditorShapeStyleControls)},e.$$.update=()=>{e.$$.dirty[0]&4194304&&v.set(l),e.$$.dirty[0]&4194304&&H.set(l),e.$$.dirty[0]&4194304&&Y.set(l),e.$$.dirty[0]&4194304&&l&&Z.set(!0),e.$$.dirty[0]&16777216&&n(7,i=d*M),e.$$.dirty[0]&20&&n(6,o=f?_.findIndex(([Se])=>Se===f.id):0),e.$$.dirty[0]&12582912&&u&&be.set(l?0:20),e.$$.dirty[0]&2097152&&n(5,r=a?`translateY(${a}px)`:"none")},[g,y,_,P,f,r,o,i,C,I,M,T,$,pe,X,U,ae,be,m,p,w,a,l,u,d,ft]}class D7 extends gn{constructor(t){super(),mn(this,t,O7,v7,rn,{name:18,isActive:0,stores:19,locale:1,frameStyles:20,frameOptions:2,markupEditorShapeStyleControls:3},null,[-1,-1])}get name(){return this.$$.ctx[18]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get stores(){return this.$$.ctx[19]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[1]}set locale(t){this.$$set({locale:t}),F()}get frameStyles(){return this.$$.ctx[20]}set frameStyles(t){this.$$set({frameStyles:t}),F()}get frameOptions(){return this.$$.ctx[2]}set frameOptions(t){this.$$set({frameOptions:t}),F()}get markupEditorShapeStyleControls(){return this.$$.ctx[3]}set markupEditorShapeStyleControls(t){this.$$set({markupEditorShapeStyleControls:t}),F()}}var B7={util:["frame",D7,({src:e})=>e&&!as(e)]};function z7(e){let t,n,i,o,r,a,l,s;return{c(){t=fe("div"),n=fe("input"),o=ut(),r=fe("label"),a=bi(e[1]),k(n,"id",e[0]),k(n,"type","number"),k(n,"min","1"),k(n,"inputmode","numeric"),k(n,"pattern","[0-9]*"),k(n,"data-state",e[3]),k(n,"autocomplete","off"),k(n,"placeholder",e[4]),n.value=i=e[5]===void 0?"":e[7](e[5]+""),k(r,"for",e[0]),k(r,"title",e[2]),k(r,"aria-label",e[2]),k(t,"class","PinturaInputDimension")},m(c,u){te(c,t,u),Ae(t,n),Ae(t,o),Ae(t,r),Ae(r,a),l||(s=Pe(n,"input",e[8]),l=!0)},p(c,[u]){u&1&&k(n,"id",c[0]),u&8&&k(n,"data-state",c[3]),u&16&&k(n,"placeholder",c[4]),u&160&&i!==(i=c[5]===void 0?"":c[7](c[5]+""))&&n.value!==i&&(n.value=i),u&2&&vi(a,c[1]),u&1&&k(r,"for",c[0]),u&4&&k(r,"title",c[2]),u&4&&k(r,"aria-label",c[2])},i:qt,o:qt,d(c){c&&ee(t),l=!1,s()}}}
95function V7(e,t,n){let{id:i}=t,{label:o}=t,{title:r}=t,{state:a}=t,{placeholder:l}=t,{value:s}=t,{onchange:c}=t,{format:u=d=>d.replace(/\D/g,"")}=t;const f=d=>c(u(d.currentTarget.value));return e.$$set=d=>{"id"in d&&n(0,i=d.id),"label"in d&&n(1,o=d.label),"title"in d&&n(2,r=d.title),"state"in d&&n(3,a=d.state),"placeholder"in d&&n(4,l=d.placeholder),"value"in d&&n(5,s=d.value),"onchange"in d&&n(6,c=d.onchange),"format"in d&&n(7,u=d.format)},[i,o,r,a,l,s,c,u,f]}class qp extends gn{constructor(t){super(),mn(this,t,V7,z7,rn,{id:0,label:1,title:2,state:3,placeholder:4,value:5,onchange:6,format:7})}}function W7(e){let t;return{c(){t=Ao("g")},m(n,i){te(n,t,i),t.innerHTML=e[2]},p(n,i){i&4&&(t.innerHTML=n[2])},d(n){n&&ee(t)}}}function U7(e){let t,n,i,o,r,a,l,s;return r=new Br({props:{$$slots:{default:[W7]},$$scope:{ctx:e}}}),{c(){t=fe("div"),n=fe("input"),i=ut(),o=fe("label"),Ve(r.$$.fragment),k(n,"id",e[0]),k(n,"class","implicit"),k(n,"type","checkbox"),n.checked=e[1],k(o,"for",e[0]),k(o,"title",e[3])},m(c,u){te(c,t,u),Ae(t,n),Ae(t,i),Ae(t,o),ve(r,o,null),a=!0,l||(s=Pe(n,"change",e[5]),l=!0)},p(c,[u]){(!a||u&1)&&k(n,"id",c[0]),(!a||u&2)&&(n.checked=c[1]);const f={};u&68&&(f.$$scope={dirty:u,ctx:c}),r.$set(f),(!a||u&1)&&k(o,"for",c[0]),(!a||u&8)&&k(o,"title",c[3])},i(c){a||(L(r.$$.fragment,c),a=!0)},o(c){z(r.$$.fragment,c),a=!1},d(c){c&&ee(t),Oe(r),l=!1,s()}}}function H7(e,t,n){let{id:i}=t,{locked:o}=t,{icon:r}=t,{title:a}=t,{onchange:l}=t;const s=c=>l(c.currentTarget.checked);return e.$$set=c=>{"id"in c&&n(0,i=c.id),"locked"in c&&n(1,o=c.locked),"icon"in c&&n(2,r=c.icon),"title"in c&&n(3,a=c.title),"onchange"in c&&n(4,l=c.onchange)},[i,o,r,a,l,s]}class N7 extends gn{constructor(t){super(),mn(this,t,H7,U7,rn,{id:0,locked:1,icon:2,title:3,onchange:4})}}function G7(e){let t;return{c(){t=bi("Save")},m(n,i){te(n,t,i)},d(n){n&&ee(t)}
95}}function j7(e){let t,n,i,o,r=e[1].resizeLabelFormCaption+"",a,l,s,c,u,f,d,m,g;return c=new Xo({props:{items:e[4]}}),f=new Ll({props:{type:"submit",class:"implicit",$$slots:{default:[G7]},$$scope:{ctx:e}}}),{c(){t=fe("form"),n=fe("div"),i=fe("fieldset"),o=fe("legend"),a=bi(r),l=ut(),s=fe("div"),Ve(c.$$.fragment),u=ut(),Ve(f.$$.fragment),k(o,"class","implicit"),k(s,"class","PinturaFieldsetInner"),k(n,"class","PinturaFormInner"),k(t,"slot","footer"),Ee(t,"transform",e[3])},m(p,y){te(p,t,y),Ae(t,n),Ae(n,i),Ae(i,o),Ae(o,a),Ae(i,l),Ae(i,s),ve(c,s,null),e[66](s),Ae(n,u),ve(f,n,null),d=!0,m||(g=[Pe(s,"focusin",e[15]),Pe(s,"focusout",e[16]),Pe(t,"submit",J_(e[17]))],m=!0)},p(p,y){(!d||y[0]&2)&&r!==(r=p[1].resizeLabelFormCaption+"")&&vi(a,r);const w={};y[0]&16&&(w.items=p[4]),c.$set(w);const _={};y[3]&32&&(_.$$scope={dirty:y,ctx:p}),f.$set(_),y[0]&8&&Ee(t,"transform",p[3])},i(p){d||(L(c.$$.fragment,p),L(f.$$.fragment,p),d=!0)},o(p){z(c.$$.fragment,p),z(f.$$.fragment,p),d=!1},d(p){p&&ee(t),Oe(c),e[66](null),Oe(f),m=!1,On(g)}}}function Z7(e){let t,n;return t=new Hs({props:{$$slots:{footer:[j7]},$$scope:{ctx:e}}}),t.$on("measure",e[67]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&30|o[3]&32&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function X7(e,t,n){let i,o,r,a,l,s,c,u,f,d,m,g=qt,p=()=>(g(),g=Do(U,K=>n(50,m=K)),U),y,w,_,P,C,R,I,M,T,v,H,Y,Z,W,$,S,pe,ge,de;e.$$.on_destroy.push(()=>g());const Fe=(K,J=0,xe=9999)=>{if(Nt(K)&&(K=K.replace(/\D/g,""),!K.length))return;const it=Math.round(K);if(!Number.isNaN(it))return Xn(it,J,xe)},X="resize";let{isActive:U}=t;p();let{stores:ae}=t,{locale:be={}}=t,{resizeMinSize:ft=Ci(1,1)}=t,{resizeMaxSize:Se=Ci(9999,9999)}=t,{resizeAspectRatioLocked:De=!1}=t,{resizeEnableButtonLockAspectRatio:Mt=!0}=t,{resizeSizePresetOptions:gt=void 0}=t,{resizeWidthPresetOptions:ie=void 0}=t,{resizeHeightPresetOptions:N=void 0}=t,{resizeWillRenderFooter:le=Nn}=t,{resizeFormatIconButtonMaintainAspectRatio:Te=function(K){const{active:J,activeFraction:xe}=K;return{active:J,activeFraction:(xe-1)*3}}}=t;const me=hn(0,{stiffness:.15,damping:.3});B(e,me,K=>n(55,C=K));const{animation:Me,imageSize:qe,imageCropRect:Ne,imageCropRectAspectRatio:mt,imageCropAspectRatio:ue,imageOutputSize:He,imageSelectionZoom:Qe,imageSelectionPan:G,history:je,env:ye,allowPan:$e,allowZoom:St,allowZoomControls:Je,allowPlayPause:q}=ae;B(e,Me,K=>n(51,y=K)),B(e,qe,K=>n(74,pe=K)),B(e,Ne,K=>n(53,_=K)),B(e,mt,K=>n(54,P=K)),B(e,ue,K=>n(73,Z=K)),B(e,He,K=>n(62,Y=K)),B(e,Qe,K=>n(75,ge=K)),B(e,G,K=>n(76,de=K)),B(e,ye,K=>n(52,w=K));const Ie=Yr();let se,V,dt,Ft,We,Xe=Kn(),nt;const wt=()=>{Xe=de,nt=ge},Zt=K=>{if(_e(G,de=Kn(),de),!K||!_){_e(Qe,ge=1,ge);return}_e(Qe,ge=K.width/_.width||K.height/_.height,ge)},yt=()=>{_e(G,de=Xe,de),_e(Qe,ge=nt,ge)},nn=(K,J,xe,it,Ye)=>K!=null&&xe!==J?K>=it[J]&&K<=Ye[J]?"valid":"invalid":"undetermined",Jt=(K,J,xe)=>Math.round(K!=null?K*J:xe.width),yn=(K,J,xe)=>Math.round(K!=null?K/J:xe.height),an=K=>{const J=K.target.id;/width/.test(J)?n(41,Ft="width"):/height/.test(J)?n(41,Ft="height"):/aspectRatio/i.test(J)?n(41,Ft="lock"):n(41,Ft=void 0)},Tt=K=>{se.contains(K.relatedTarget)||sn(),n(41,Ft=void 0)},Sn=()=>{!De||!V||!dt||(Ft==="width"?n(40,dt=Math.round(V/P)):Ft==="height"?n(39,V=Math.round(dt*P)):(We==="width"?n(40,dt=Math.round(V/P)):We==="height"&&n(39,V=Math.round(dt*P)),ln()))},ln=K=>{let J=Fe(V),xe=Fe(dt),it=J,Ye=xe,ct=it&&Ye,ot=K||P;if(!it&&!Ye)return;it&&!Ye?Ye=Math.round(it/ot):Ye&&!it&&(it=Math.round(Ye*ot)),ot=K||ct?fa(it,Ye):P;let Ct=Ci(it,Ye);Ad(Se,Ct)||(Ct=rr(Se,ot)),Ad(Ct,ft)||(Ct=rs(ft,ot)),n(39,V=J!=null?Math.round(Ct.width):void 0),n(40,dt=xe!=null?Math.round(Ct.height):void 0)},sn=()=>{ln();const{width:K,height:J}=Y||{};K===V&&J===dt||(!V&&!dt?(_e(ue,Z=pe.width/pe.height,Z),_e(ue,Z=void 0,Z),_e(He,Y=void 0,Y)):(V&&dt&&_e(ue,Z=V/dt,Z),_e(He,Y=Ci(V,dt),Y)),je.write())},ke=He.subscribe(K=>{if(!K){n(39,V=void 0),n(40,dt=void 0);return}n(39,V=K.width),n(40,dt=K.height),ln()}),Re=ue.subscribe(K=>{!V&&!dt||K&&(V&&dt&&fa(V,dt)!==K?(n(40,dt=V/K),ln(K)):ln())}),Lt=K=>Nt(K[0])?(K[1]=K[1].map(Lt),K):Ht(K)?[K,""+K]:K,fn=K=>{if(Nt(K[0]))return K[1]=K[1].map(fn),K;let[J,xe]=K;if(Ht(J)&&Ht(xe)){const[it,Ye]=[J,xe];xe=`${it} &times; ${Ye}`,J=[it,Ye]}return[J,xe]},on=ht();B(e,on,K=>n(61,H=K));const En=ht();B(e,En,K=>n(65,S=K));const bt=ht();B(e,bt,K=>n(59,T=K));const Un=ht();B(e,Un,K=>n(64,$=K));const Hn=ht();B(e,Hn,K=>n(57,I=K));const $n=ht();B(e,$n,K=>n(63,W=K));const Q=Ln([He,En],([K,J],xe)=>{if(!J)return xe(-1);const it=J.findIndex(([Ye])=>{if(!Ye&&!K)return!0;
95if(!Ye)return!1;const[ct,ot]=Ye;return K.width===ct&&K.height===ot});xe(it<0?0:it)});B(e,Q,K=>n(60,v=K));const Ge=Ln([He,Un],([K,J],xe)=>{if(!J)return xe(-1);const it=J.findIndex(([Ye])=>!Ye&&!K?!0:Ye?K.width===Ye:!1);xe(it<0?0:it)});B(e,Ge,K=>n(58,M=K));const j=Ln([He,$n],([K,J],xe)=>{if(!J)return xe(-1);const it=J.findIndex(([Ye])=>!Ye&&!K?!0:Ye?K.height===Ye:!1);xe(it<0?0:it)});B(e,j,K=>n(56,R=K));let Le,tt;const en=K=>{K&&!Le&&(Le={..._},tt=Z),K?(_e(ue,Z=fa(K[0],K[1]),Z),_e(He,Y=my(K),Y)):(_e(Ne,_=Le,_),_e(ue,Z=tt,Z),_e(He,Y=void 0,Y),Le=void 0,tt=void 0),je.write()},Xt=Qn("redrawTrigger"),Ze=hn(y?20:0);B(e,Ze,K=>n(49,d=K)),Jr(()=>{ke(),Re()});function tn(K){vn[K?"unshift":"push"](()=>{se=K,n(2,se)})}function Fn(K){Zo.call(this,e,K)}return e.$$set=K=>{"isActive"in K&&p(n(0,U=K.isActive)),"stores"in K&&n(30,ae=K.stores),"locale"in K&&n(1,be=K.locale),"resizeMinSize"in K&&n(31,ft=K.resizeMinSize),"resizeMaxSize"in K&&n(32,Se=K.resizeMaxSize),"resizeAspectRatioLocked"in K&&n(28,De=K.resizeAspectRatioLocked),"resizeEnableButtonLockAspectRatio"in K&&n(33,Mt=K.resizeEnableButtonLockAspectRatio),"resizeSizePresetOptions"in K&&n(34,gt=K.resizeSizePresetOptions),"resizeWidthPresetOptions"in K&&n(35,ie=K.resizeWidthPresetOptions),"resizeHeightPresetOptions"in K&&n(36,N=K.resizeHeightPresetOptions),"resizeWillRenderFooter"in K&&n(37,le=K.resizeWillRenderFooter),"resizeFormatIconButtonMaintainAspectRatio"in K&&n(38,Te=K.resizeFormatIconButtonMaintainAspectRatio)},e.$$.update=()=>{e.$$.dirty[1]&524288&&$e.set(!m),e.$$.dirty[1]&524288&&St.set(!m),e.$$.dirty[1]&524288&&Je.set(!m),e.$$.dirty[1]&524288&&m&&q.set(!0),e.$$.dirty[1]&1073741832&&gt&&(_e(on,H=gt.map(fn),H),_e(En,S=$l(H),S)),e.$$.dirty[1]&1073741824&&n(48,a=!!H),e.$$.dirty[1]&536870912|e.$$.dirty[2]&8&&n(47,i=v>-1&&S[v][1]),e.$$.dirty[1]&268435472&&ie&&(_e(bt,T=ie.map(Lt),T),_e(Un,$=$l(T),$)),e.$$.dirty[1]&268566528&&n(45,l=!a&&T),e.$$.dirty[1]&134217728|e.$$.dirty[2]&4&&n(46,o=M>-1&&$[M][1]),e.$$.dirty[1]&67108896&&N&&(_e(Hn,I=N.map(Lt),I),_e($n,W=$l(I),W)),e.$$.dirty[1]&67239936&&n(44,s=!a&&I),e.$$.dirty[1]&33554432|e.$$.dirty[2]&2&&n(43,r=R>-1&&W[R][1]),e.$$.dirty[1]&155648&&n(42,c=!a&&!l&&!s),e.$$.dirty[0]&268435458|e.$$.dirty[1]&2145648583&&n(4,u=Xt&&Zu(()=>le([a&&["Dropdown","size-presets",{label:i,options:H,onchange:K=>en(K.value),selectedIndex:v}],l&&["Dropdown","width-presets",{label:o,options:T,onchange:K=>{n(39,V=K.value),sn()},selectedIndex:M}],l&&s&&["span","times",{class:"PinturaResizeLabel",innerHTML:"&times;"}],s&&["Dropdown","height-presets",{label:r,options:I,onchange:K=>{n(40,dt=K.value),sn()},selectedIndex:R}],c&&[qp,"width-input",{id:`width-${Ie}`,title:be.resizeTitleInputWidth,label:be.resizeLabelInputWidth,placeholder:Jt(Fe(dt),P,_),value:V,state:nn(Fe(V),"width",Ft,ft,Se),onchange:K=>{n(39,V=K),Sn()}}],c&&Mt&&[N7,"aspect-ratio-lock",{id:`aspect-ratio-lock-${Ie}`,title:be.resizeTitleButtonMaintainAspectRatio,icon:xn(be.resizeIconButtonMaintainAspectRatio)?be.resizeIconButtonMaintainAspectRatio(De,C):Jl(be.resizeIconButtonMaintainAspectRatio,Te({active:De,activeFraction:C}),"{","}"),locked:De,onchange:K=>{n(28,De=K),Sn()}}],c&&[qp,"height-input",{id:`height-${Ie}`,title:be.resizeTitleInputHeight,label:be.resizeLabelInputHeight,placeholder:yn(Fe(V),P,_),value:dt,state:nn(Fe(dt),"height",Ft,ft,Se),onchange:K=>{n(40,dt=K),Sn()}}]].filter(Boolean),{...w},()=>Xt.set({}))).filter(Boolean)),e.$$.dirty[0]&268435456&&me.set(De?1:0),e.$$.dirty[1]&1024&&Ft&&(We=Ft),e.$$.dirty[1]&524288&&m&&wt(),e.$$.dirty[1]&524288|e.$$.dirty[2]&1&&(m?setTimeout(()=>Zt(Y),0):yt()),e.$$.dirty[1]&1572864&&y&&Ze.set(m?0:20),e.$$.dirty[1]&262144&&n(3,f=d?`translateY(${d}px)`:"none")},[U,be,se,f,u,me,Me,qe,Ne,mt,ue,He,Qe,G,ye,an,Tt,sn,on,En,bt,Un,Hn,$n,Q,Ge,j,Ze,De,X,ae,ft,Se,Mt,gt,ie,N,le,Te,V,dt,Ft,c,r,s,l,o,i,a,d,m,y,w,_,P,C,R,I,M,T,v,H,Y,W,$,S,tn,Fn]}class K7 extends gn{constructor(t){super(),mn(this,t,X7,Z7,rn,{name:29,isActive:0,stores:30,locale:1,resizeMinSize:31,resizeMaxSize:32,resizeAspectRatioLocked:28,resizeEnableButtonLockAspectRatio:33,resizeSizePresetOptions:34,resizeWidthPresetOptions:35,resizeHeightPresetOptions:36,resizeWillRenderFooter:37,resizeFormatIconButtonMaintainAspectRatio:38},null,[-1,-1,-1,-1])}get name(){return this.$$.ctx[29]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get stores(){return this.$$.ctx[30]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[1]}set locale(t){this.$$set({locale:t}),F()}get resizeMinSize(){return this.$$.ctx[31]}set resizeMinSize(t){this.$$set({resizeMinSize:t}),F()}get resizeMaxSize(){return this.$$.ctx[32]}set resizeMaxSize(t){this.$$set({resizeMaxSize:t}),F()}get resizeAspectRatioLocked(){return this.$$.ctx[28]}set resizeAspectRatioLocked(t){this.$$set({resizeAspectRatioLocked:t}),F()}get resizeEnableButtonLockAspectRatio(){return this.$$.ctx[33]}set resizeEnableButtonLockAspectRatio(t){this.$$set({resizeEnableButtonLockAspectRatio:t}),F()}get resizeSizePresetOptions(){return this.$$.ctx[34]}set resizeSizePresetOptions(t){this.$$set({resizeSizePresetOptions:t}),F()}get resizeWidthPresetOptions(){return this.$$.ctx[35]}set resizeWidthPresetOptions(t){this.$$set({resizeWidthPresetOptions:t}),F()}get resizeHeightPresetOptions(){return this.$$.ctx[36]}set resizeHeightPresetOptions(t){this.$$set({resizeHeightPresetOptions:t}),F()}get resizeWillRenderFooter(){return this.$$.ctx[37]}set resizeWillRenderFooter(t){this.$$set({resizeWillRenderFooter:t}),F()}get resizeFormatIconButtonMaintainAspectRatio(){return this.$$.ctx[38]}set resizeFormatIconButtonMaintainAspectRatio(t){this.$$set({resizeFormatIconButtonMaintainAspectRatio:t}),F()}}var Y7={util:["resize",K7]};function q7(e){let t,n;return t=new rh({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[10],mapImagePointToScreenPoint:e[9],enableMultiSelect:e[6],utilKey:"redact",imageRotation:e[11],imageFlipX:e[8],imageFlipY:e[7],shapes:e[12],toolbar:["rect"],toolShapes:{rectangle:[{x:0,y:0,width:0,height:0}]},toolActive:"rectangle",parentRect:e[14],enablePresetDropImage:!1,enablePresetSelectImage:!1,willStartInteraction:e[5],hooks:{willRenderShapeControls:e[26]}}}),t.$on("measure",e[27]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,[o]){const r={};o&8&&(r.stores=i[3]),o&16&&(r.locale=i[4]),o&1&&(r.isActive=i[0]),o&2&&(r.isActiveFraction=i[1]),o&4&&(r.isVisible=i[2]),o&1024&&(r.mapScreenPointToImagePoint=i[10]),o&512&&(r.mapImagePointToScreenPoint=i[9]),o&64&&(r.enableMultiSelect=i[6]),o&2048&&(r.imageRotation=i[11]),o&256&&(r.imageFlipX=i[8]),o&128&&(r.imageFlipY=i[7]),o&32&&(r.willStartInteraction=i[5]),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function J7(e,t,n){let i,o,r,a,l,s,c,u,f,d;const m="redact";let{isActive:g}=t,{isActiveFraction:p}=t,{isVisible:y}=t,{stores:w}=t,{locale:_={}}=t,{markupEditorWillStartInteraction:P=void 0}=t,{enableMultiSelect:C=void 0}=t;const{imageRedaction:R,rootRect:I,imageSize:M,imageRotation:T,imageFlipX:v,imageFlipY:H,imageTransforms:Y,imageTransformsInterpolated:Z}=w;B(e,I,S=>n(24,u=S)),B(e,M,S=>n(23,c=S)),B(e,T,S=>n(11,d=S)),B(e,v,S=>n(8,l=S)),B(e,H,S=>n(7,a=S)),B(e,Y,S=>n(25,f=S)),B(e,Z,S=>n(22,s=S));const W=S=>{const pe=Sm(S[0]);return z8("to-front",pe),S};function $(S){Zo.call(this,e,S)}return e.$$set=S=>{"isActive"in S&&n(0,g=S.isActive),"isActiveFraction"in S&&n(1,p=S.isActiveFraction),"isVisible"in S&&n(2,y=S.isVisible),"stores"in S&&n(3,w=S.stores),"locale"in S&&n(4,_=S.locale),"markupEditorWillStartInteraction"in S&&n(5,P=S.markupEditorWillStartInteraction),"enableMultiSelect"in S&&n(6,C=S.enableMultiSelect)},e.$$.update=()=>{e.$$.dirty&33554432&&n(21,i=f?f.rotation.z:0),e.$$.dirty&31457664&&n(10,o=S=>bg(S,u,c,s.origin,s.translation,i,s.scale,l,a)),e.$$.dirty&31457664&&n(9,r=S=>gg(S,u,c,s.origin,s.translation,i,s.scale,l,a))},[g,p,y,w,_,P,C,a,l,r,o,d,R,I,M,T,v,H,Y,Z,m,i,s,c,u,f,W,$]}class Q7 extends gn{constructor(t){super(),mn(this,t,J7,q7,rn,{name:20,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,markupEditorWillStartInteraction:5,enableMultiSelect:6})}get name(){return this.$$.ctx[20]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(t){this.$$set({isActiveFraction:t}),F()}get isVisible(){return this.$$.ctx[2]}set isVisible(t){this.$$set({isVisible:t}),F()}get stores(){return this.$$.ctx[3]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[4]}set locale(t){this.$$set({locale:t}),F()}get markupEditorWillStartInteraction(){return this.$$.ctx[5]}set markupEditorWillStartInteraction(t){this.$$set({markupEditorWillStartInteraction:t}),F()}get enableMultiSelect(){return this.$$.ctx[6]}set enableMultiSelect(t){this.$$set({enableMultiSelect:t}),F()}}var $7={util:["redact",Q7,({src:e})=>e&&!as(e)]};function eE(e){let t;return{c(){t=fe("div")},m(n,i){te(n,t,i)},p:qt,d(n){n&&ee(t)}
95}}function tE(e){let t,n,i,o;return{c(){t=fe("div"),k(t,"class","PinturaFillTile")},m(r,a){te(r,t,a),i||(o=wn(n=lE.call(null,t,e[31].value)),i=!0)},p(r,a){n&&kn(n.update)&&a[1]&1&&n.update.call(null,r[31].value)},d(r){r&&ee(t),i=!1,o()}}}function nE(e){let t,n,i;return{c(){t=fe("div"),n=fe("img"),Q0(n.src,i=e[31].value)||k(n,"src",i),k(n,"alt",""),k(n,"width","48"),k(n,"height","64"),k(t,"class","PinturaFillTile")},m(o,r){te(o,t,r),Ae(t,n)},p(o,r){r[1]&1&&!Q0(n.src,i=o[31].value)&&k(n,"src",i)},d(o){o&&ee(t)}}}function Jp(e){let t,n=(xn(e[31].label)?e[31].label(e[1]):e[31].label)+"",i;return{c(){t=fe("span"),i=bi(n)},m(o,r){te(o,t,r),Ae(t,i)},p(o,r){r[0]&2|r[1]&1&&n!==(n=(xn(o[31].label)?o[31].label(o[1]):o[31].label)+"")&&vi(i,n)},d(o){o&&ee(t)}}}function iE(e){let t,n,i,o;function r(c,u){return u[1]&1&&(n=null),u[1]&1&&(i=null),n==null&&(n=!!Nt(c[31].value)),n?nE:(i==null&&(i=!!Si(c[31].value)),i?tE:eE)}let a=r(e,[-1,-1]),l=a(e),s=e[31].label&&Jp(e);return{c(){t=fe("div"),l.c(),o=ut(),s&&s.c(),k(t,"slot","option")},m(c,u){te(c,t,u),l.m(t,null),Ae(t,o),s&&s.m(t,null)},p(c,u){a===(a=r(c,u))&&l?l.p(c,u):(l.d(1),l=a(c),l&&(l.c(),l.m(t,o))),c[31].label?s?s.p(c,u):(s=Jp(c),s.c(),s.m(t,null)):s&&(s.d(1),s=null)},d(c){c&&ee(t),l.d(),s&&s.d()}}}function oE(e){let t,n;return t=new El({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[4],onchange:e[10],$$slots:{option:[iE,({option:i})=>({31:i}),({option:i})=>[0,i?1:0]]},$$scope:{ctx:e}}}),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&2&&(r.locale=i[1]),o[0]&4&&(r.options=i[2]),o[0]&16&&(r.selectedIndex=i[4]),o[0]&2|o[1]&3&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function rE(e){let t,n,i;return n=new Ka({props:{elasticity:e[5],$$slots:{default:[oE]},$$scope:{ctx:e}}}),{c(){t=fe("div"),Ve(n.$$.fragment),k(t,"slot","footer"),Ee(t,"transform",e[3])},m(o,r){te(o,t,r),ve(n,t,null),i=!0},p(o,r){const a={};r[0]&32&&(a.elasticity=o[5]),r[0]&22|r[1]&2&&(a.$$scope={dirty:r,ctx:o}),n.$set(a),r[0]&8&&Ee(t,"transform",o[3])},i(o){i||(L(n.$$.fragment,o),i=!0)},o(o){z(n.$$.fragment,o),i=!1},d(o){o&&ee(t),Oe(n)}}}function aE(e){let t,n;return t=new Hs({props:{$$slots:{footer:[rE]},$$scope:{ctx:e}}}),t.$on("measure",e[21]),{c(){Ve(t.$$.fragment)},m(i,o){ve(t,i,o),n=!0},p(i,o){const r={};o[0]&62|o[1]&2&&(r.$$scope={dirty:o,ctx:i}),t.$set(r)},i(i){n||(L(t.$$.fragment,i),n=!0)},o(i){z(t.$$.fragment,i),n=!1},d(i){Oe(t,i)}}}function lE(e){const t=document.createElement("div");return e.append(t),{update(n){const[i,o,r,a]=n.map((l,s)=>s<3?Math.round(l*255):l);e.dataset.transparent=a<1,t.style.backgroundColor=`rgba(${i},${o},${r},${a})`}}}function sE(e,t,n){let i,o,r,a,l,s,c=qt,u=()=>(c(),c=Do(y,X=>n(16,s=X)),y),f,d,m,g;e.$$.on_destroy.push(()=>c());const p="fill";let{isActive:y}=t;u();let{stores:w}=t,{locale:_={}}=t,{fillOptions:P=[]}=t;const C=X=>Si(X)&&Nt(X[0])&&Si(X[1]),R=X=>[Array.isArray(X)&&X.length===3?[...X,1]:X,void 0,{disabled:!1}],I=X=>X.map(U=>C(U)?[U[0],I(U[1]),U[2]]:R(U)),M=Qn("elasticityMultiplier");B(e,M,X=>n(20,g=X));const{history:T,animation:v,scrollElasticity:H,imageBackgroundColor:Y,imageBackgroundImage:Z,allowPan:W,allowZoom:$,allowZoomControls:S,allowPlayPause:pe}=w;B(e,v,X=>n(17,f=X)),B(e,Y,X=>n(19,m=X)),B(e,Z,X=>n(18,d=X));const ge=({value:X})=>{Nt(X)&&(_e(Y,m=void 0,m),_e(Z,d=X,d)),Si(X)&&(_e(Y,m=X,m),_e(Z,d=void 0,d)),T.write()},de=hn(f?20:0);B(e,de,X=>n(15,l=X));function Fe(X){Zo.call(this,e,X)}return e.$$set=X=>{"isActive"in X&&u(n(0,y=X.isActive)),"stores"in X&&n(13,w=X.stores),"locale"in X&&n(1,_=X.locale),"fillOptions"in X&&n(14,P=X.fillOptions)},e.$$.update=()=>{e.$$.dirty[0]&16384&&n(2,i=I(P)),e.$$.dirty[0]&65536&&W.set(s),e.$$.dirty[0]&65536&&$.set(s),e.$$.dirty[0]&65536&&S.set(s),e.$$.dirty[0]&65536&&s&&pe.set(!0),e.$$.dirty[0]&1048576&&n(5,o=g*H),e.$$.dirty[0]&786436&&n(4,r=i.findIndex(([X])=>{if(d)return X===d;if(Array.isArray(X))return Rl(X,m)})||0),e.$$.dirty[0]&196608&&f&&de.set(s?0:20),e.$$.dirty[0]&32768&&n(3,a=l?`translateY(${l}px)`:"none")},[y,_,i,a,r,o,M,v,Y,Z,ge,de,p,w,P,l,s,f,d,m,g,Fe]}class cE extends gn{constructor(t){super(),mn(this,t,sE,aE,rn,{name:12,isActive:0,stores:13,locale:1,fillOptions:14},null,[-1,-1])}get name(){return this.$$.ctx[12]}get isActive(){return this.$$.ctx[0]}set isActive(t){this.$$set({isActive:t}),F()}get stores(){return this.$$.ctx[13]}set stores(t){this.$$set({stores:t}),F()}get locale(){return this.$$.ctx[1]}set locale(t){this.$$set({locale:t}),F()}get fillOptions(){return this.$$.ctx[14]}set fillOptions(t){this.$$set({fillOptions:t}),F()}}
95var uE={util:["fill",cE,({src:e,fillOptions:t})=>e&&!as(e)&&t&&t.length]};const Qp='<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"></path></path></g>',q1='<path fill="none" d="M9 15 L12 9 L15 15 M10 13.5 h3" stroke="currentColor" stroke-width=".125em"/>';var fE={labelReset:"Reset",labelDefault:"Default",labelAuto:"Auto",labelNone:"None",labelEdit:"Edit",labelClose:"Close",labelSupportError:"{features} not supported on this browser",labelColor:"Color",labelWidth:"Width",labelSize:"Size",labelOffset:"Offset",labelAmount:"Amount",labelInset:"Inset",labelRadius:"Radius",labelColorPalette:"Color palette",labelSizeExtraSmall:"Extra small",labelSizeSmall:"Small",labelSizeMediumSmall:"Medium small",labelSizeMedium:"Medium",labelSizeMediumLarge:"Medium large",labelSizeLarge:"Large",labelSizeExtraLarge:"Extra large",labelButtonCancel:"Cancel",labelButtonUndo:"Undo",labelButtonRedo:"Redo",labelButtonRevert:"Revert",labelButtonExport:"Done",labelZoom:"Zoom",labelZoomIn:"Zoom in",labelZoomOut:"Zoom out",labelZoomFit:"Fit to view",labelZoomActual:"Actual size",iconZoomIn:'<path stroke="currentColor" stroke-width=".125em" d="M8 12 h8 M12 8 v8" />',iconZoomOut:'<path stroke="currentColor" stroke-width=".125em" d="M9 12 h6" />',iconSupportError:'<g fill="none" stroke="currentColor" stroke-width="2"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><g><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></g>',iconButtonClose:Qp,iconButtonRevert:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M7.388 18.538a8 8 0 10-2.992-9.03"/><path fill="currentColor" d="M2.794 11.696L2.37 6.714l5.088 3.18z"/><path d="M12 8v4M12 12l4 2"/></g>',iconButtonUndo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M10 8h4c2.485 0 5 2 5 5s-2.515 5-5 5h-4"/><path fill="currentColor" d="M5 8l4-3v6z"/></g>',iconButtonRedo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M14 8h-4c-2.485 0-5 2-5 5s2.515 5 5 5h4"/><path fill="currentColor" d="M19 8l-4-3v6z"/></g>',iconButtonExport:'<polyline points="20 6 9 17 4 12" fill="none" stroke="currentColor" stroke-width=".125em"></polyline>',statusLabelButtonClose:"Close",statusIconButtonClose:Qp,statusImageLoadNone:"Waiting for image",statusImageLoadMinSize:"Minimum image size is {minWidth} &times; {minHeight}",statusImageLoadPrepare:"Preparing image&hellip;",statusImageLoadBusy:"Loading image&hellip;",statusImageLoadError:"Error loading image",statusImageProcessBusy:"Processing image&hellip;",statusImageProcessError:"Error processing image",statusImageUploadBusy:"Uploading image&hellip;",statusImageUploadError:"Error uploading image"};const dE={shapeLabelButtonSelectSticker:"Select image",shapeIconButtonSelectSticker:'<g fill="none" stroke="currentColor" stroke-width="0.0625em"><path d="M8 21 L15 11 L19 15"/><path d="M15 2 v5 h5"/><path d="M8 2 h8 l4 4 v12 q0 4 -4 4 h-8 q-4 0 -4 -4 v-12 q0 -4 4 -4z"/></g><circle fill="currentColor" cx="10" cy="8" r="1.5"/>',shapeIconButtonFlipHorizontal:'<g stroke="currentColor" stroke-width=".125em"><path fill="none" d="M6 6.5h5v11H6z"/><path fill="currentColor" d="M15 6.5h3v11h-3z"/><path d="M11 4v16" fill="currentColor"/></g>',shapeIconButtonFlipVertical:'<g stroke="currentColor" stroke-width=".125em"><rect x="7" y="8" width="11" height="5" fill="none"/><rect x="7" y="17" width="11" height="2" fill="currentColor"/><line x1="5" y1="13" x2="20" y2="13"/></g>',shapeIconButtonRemove:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M7.5 7h9z"/><path d="M7.916 9h8.168a1 1 0 01.99 1.14l-.972 6.862a2 2 0 01-1.473 1.653c-.877.23-1.753.345-2.629.345-.876 0-1.752-.115-2.628-.345a2 2 0 01-1.473-1.653l-.973-6.862A1 1 0 017.916 9z" fill="currentColor"/><rect fill="currentColor" x="10" y="5" width="4" height="3" rx="1"/></g>',shapeIconButtonDuplicate:'<g fill="none" fill-rule="evenodd"><path d="M15 13.994V16a2 2 0 01-2 2H8a2 2 0 01-2-2v-5a2 2 0 012-2h2.142" stroke="currentColor" stroke-width=".125em"/><path d="M15 9V8a1 1 0 00-2 0v1h-1a1 1 0 000 2h1v1a1 1 0 002 0v-1h1a1 1 0 000-2h-1zm-4-4h6a2 2 0 012 2v6a2 2 0 01-2 2h-6a2 2 0 01-2-2V7a2 2 0 012-2z" fill="currentColor"/></g>',shapeIconButtonMoveToFront:'<g fill="none" fill-rule="evenodd"><rect fill="currentColor" x="11" y="13" width="8" height="2" rx="1"/><rect fill="currentColor" x="9" y="17" width="10" height="2" rx="1"/><path d="M11.364 8H10a5 5 0 000 10M12 6.5L14.5 8 12 9.5z" stroke="currentColor" stroke-width=".125em" stroke-linecap="round"/></g>',shapeIconButtonTextLayoutAutoWidth:`${q1}`,shapeIconButtonTextLayoutAutoHeight:`<g fill="currentColor"><circle cx="4" cy="12" r="1.5"/><circle cx="20" cy="12" r="1.5"/></g>${q1}`,shapeIconButtonTextLayoutFixedSize:`<g fill="currentColor"><circle cx="5" cy="6" r="1.5"/><circle cx="19" cy="6" r="1.5"/><circle cx="19" cy="19" r="1.5"/><circle cx="5" cy="19" r="1.5"/></g>${q1}`,shapeTitleButtonTextLayoutAutoWidth:"Auto width",shapeTitleButtonTextLayoutAutoHeight:"Auto height",shapeTitleButtonTextLayoutFixedSize:"Fixed size",shapeTitleButtonFlipHorizontal:"Flip Horizontal",shapeTitleButtonFlipVertical:"Flip Vertical",shapeTitleButtonRemove:"Remove",shapeTitleButtonDuplicate:"Duplicate",shapeTitleButtonMoveToFront:"Move to front",shapeLabelInputText:"Edit text",shapeIconInputCancel:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"/></g>',shapeIconInputConfirm:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><polyline points="20 6 9 17 4 12"/></g>',shapeLabelInputCancel:"Cancel",shapeLabelInputConfirm:"Confirm",shapeLabelStrokeNone:"No outline",shapeLabelFontStyleNormal:"Normal",shapeLabelFontStyleBold:"Bold",shapeLabelFontStyleItalic:"Italic",shapeLabelFontStyleItalicBold:"Bold Italic",shapeTitleBackgroun
95dColor:"Fill color",shapeTitleCornerRadius:"Corner radius",shapeTitleFontFamily:"Font",shapeTitleFontSize:"Font size",shapeTitleFontStyle:"Font style",shapeTitleLineHeight:"Line height",shapeTitleLineStart:"Start",shapeTitleLineEnd:"End",shapeTitleStrokeWidth:"Line width",shapeTitleStrokeColor:"Line color",shapeTitleLineDecorationBar:"Bar",shapeTitleLineDecorationCircle:"Circle",shapeTitleLineDecorationSquare:"Square",shapeTitleLineDecorationArrow:"Arrow",shapeTitleLineDecorationCircleSolid:"Circle solid",shapeTitleLineDecorationSquareSolid:"Square solid",shapeTitleLineDecorationArrowSolid:"Arrow solid",shapeIconLineDecorationBar:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M16,8 V16"/></g>',shapeIconLineDecorationCircle:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="none" stroke-width=".125em" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquare:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="none" stroke-width=".125em" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrow:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16 M13,7 l6,5 l-6,5" fill="none"/></g>',shapeIconLineDecorationCircleSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="currentColor" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquareSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="currentColor" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrowSolid:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M13,7 l6,5 l-6,5z" fill="currentColor"/></g>',shapeTitleColorTransparent:"Transparent",shapeTitleColorWhite:"White",shapeTitleColorSilver:"Silver",shapeTitleColorGray:"Gray",shapeTitleColorBlack:"Black",shapeTitleColorNavy:"Navy",shapeTitleColorBlue:"Blue",shapeTitleColorAqua:"Aqua",shapeTitleColorTeal:"Teal",shapeTitleColorOlive:"Olive",shapeTitleColorGreen:"Green",shapeTitleColorYellow:"Yellow",shapeTitleColorOrange:"Orange",shapeTitleColorRed:"Red",shapeTitleColorMaroon:"Maroon",shapeTitleColorFuchsia:"Fuchsia",shapeTitleColorPurple:"Purple",shapeTitleTextOutline:"Text outline",shapeTitleTextOutlineWidth:"Width",shapeTitleTextShadow:"Text shadow",shapeTitleTextShadowBlur:"Blur",shapeTitleTextColor:"Font color",shapeTitleTextAlign:"Text align",shapeTitleTextAlignLeft:"Left align text",shapeTitleTextAlignCenter:"Center align text",shapeTitleTextAlignRight:"Right align text",shapeIconTextAlignLeft:'<g stroke-width=".125em" stroke="currentColor"><line x1="5" y1="8" x2="15" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="14" y2="16"/></g>',shapeIconTextAlignCenter:'<g stroke-width=".125em" stroke="currentColor"><line x1="7" y1="8" x2="17" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="8" y1="16" x2="16" y2="16"/></g>',shapeIconTextAlignRight:'<g stroke-width=".125em" stroke="currentColor"><line x1="9" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="11" y1="16" x2="19" y2="16"/></g>',shapeLabelToolMove:"Move",shapeLabelToolView:"View",shapeLabelToolSharpie:"Sharpie",shapeLabelToolEraser:"Eraser",shapeLabelToolPath:"Path",shapeLabelToolRectangle:"Rectangle",shapeLabelToolEllipse:"Ellipse",shapeLabelToolArrow:"Arrow",shapeLabelToolLine:"Line",shapeLabelToolText:"Text",shapeLabelToolPreset:"Stickers",shapeIconToolView:'<g stroke-width=".125em" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M10.98 9.703V2.567c0-1.19 1.19-1.785 1.784-1.785.595 0 1.784.595 1.784 1.785v3.568"/><path d="M14.548 9.703V4.35c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.594 1.784 1.784v2.973"/><path d="M18.116 10.244V7.271c0-1.19 1.19-1.784 1.784-1.784.595 0 1.785.595 1.785 1.784 0 1.19 0 8.92-1.19 12.488-1.19 3.569-10.704 4.758-13.678 0-2.973-4.757-2.973-4.757-4.163-6.541-1.189-1.784-1.153-2.974-.594-3.568.558-.595 1.784-1.19 2.973.594 1.277 1.916 2.07 2.907 2.379 2.974V5.487c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.595 1.784 1.784V8.46"/></g>',shapeIconToolMove:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M6 2 L6 19 L18 13 Z M13 18 L16 24" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSharpie:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolEraser:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" fill="none"><g transform="translate(3, 15) rotate(-45)"><rect x="0" y="0" width="18" height="10" rx="3"/></g><line x1="11" y1="21" x2="18" y2="21"/><line x1="20" y1="21" x2="22" y2="21"/></g>',shapeIconToolPath:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"><circle cx="21" cy="3" r="2"/><circle cx="9" cy="9" r="2"/><circle cx="3" cy="21" r="2"/><path d="M19 4 11 8 M8 11 4 19"/></g>',shapeIconToolRectangle:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="1" y="1" width="22" height="22" rx="4"/></g>',shapeIconToolEllipse:'<g stroke-width=".125em" stroke="currentColor" fill="none"><circle cx="12" cy="12" r="11"/></g>',shapeIconToolArrow:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/><path d="m10 6 L21.5 1 L20 13.5" fill="currentColor" stroke="none"/></g>',shapeIconToolLine:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/></g>',shapeIconToolText:'<g stroke="none" fill="currentColor" transform="translate(6,0)">
95<path d="M8.14 20.085c.459 0 .901-.034 1.329-.102a8.597 8.597 0 001.015-.21v1.984c-.281.135-.695.247-1.242.336a9.328 9.328 0 01-1.477.133c-3.312 0-4.968-1.745-4.968-5.235V6.804H.344v-1.25l2.453-1.078L3.89.819h1.5v3.97h4.97v2.015H5.39v10.078c0 1.031.245 1.823.735 2.375s1.161.828 2.015.828z"/>',shapeIconToolPreset:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"></path><path d="M20 17c-3 3-5 5-8 5"></path></g>',shapeTitleSelectionMode:"Selection mode",shapeTitleBrushSize:"Brush size",shapeLabelSelectionModeNew:"New",shapeLabelSelectionModeAdd:"Add",shapeLabelSelectionModeSubtract:"Remove",shapeLabelToolSelectionBrush:"Brush",shapeLabelToolSelectionLassoo:"Lassoo",shapeLabelToolSelectionRectangle:"Rectangle marquee",shapeLabelToolSelectionEllipse:"Ellipse marquee",shapeIconSelectionModeNew:'<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 17H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1.5"/><rect width="12" height="12" x="9" y="9" fill="currentColor" fill-opacity=".25" rx="2"/></g>',shapeIconSelectionModeAdd:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><path d="M13 15h4M15 13v4"/></g>',shapeIconSelectionModeSubtract:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h-6a2 2 0 0 0-1.995 1.85L9 11v6H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><rect width="12" height="12" x="9" y="9" stroke-linecap="round" stroke-linejoin="round" rx="2"/><path d="M13 15h4"/></g>',shapeIconToolSelectionBrush:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSelectionLassoo:'<g fill="none" fill-rule="evenodd" stroke-width=".125em" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.428 17.702a18.46 18.46 0 0 0 4.085-1.595c5.851-3.112 9.019-8.599 7.074-12.256-1.945-3.657-8.265-4.1-14.116-.988C2.619 5.974-.55 11.46 1.396 15.118c.63 1.186 1.72 2.033 3.105 2.532"/><ellipse cx="8" cy="18.5" rx="3.5" ry="2.833" transform="rotate(-15 8 18.5)"/><path stroke-linecap="round" d="M5 18c3.347 1.048 5.514 1.881 6.5 2.5.859.54 1.517.994 1.5 2.364"/></g>',shapeIconToolSelectionRectangle:'<g stroke-width=".125em" stroke="currentColor"><path d="M9 1 h6 m4 0 h4v4 m0 4 v6 m0 4 v4h-4 m-4 0 h-6 m-4 0 h-4v-4 m0 -4 v-6 m0 -4 v-4h4" fill="none" /></g>',shapeIconToolSelectionEllipse:'<path stroke-width=".125em" stroke="currentColor" d="M1.21 9.853a11.054 11.054 0 0 0 0 4.294m1.643 3.965a11.054 11.054 0 0 0 3.035 3.035m3.965 1.644a11.054 11.054 0 0 0 4.294 0m3.965-1.644a11.054 11.054 0 0 0 3.035-3.035m1.644-3.965a11.054 11.054 0 0 0 0-4.294m-1.644-3.965a11.054 11.054 0 0 0-3.035-3.035m-3.965-1.644a11.054 11.054 0 0 0-4.294 0M5.888 2.853a11.054 11.054 0 0 0-3.035 3.035"/>'};var hE={cropLabel:"Crop",cropIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M23 17H9a2 2 0 0 1-2-2v-5m0-3V1 M1 7h14a2 2 0 0 1 2 2v7m0 4v3"/></g>',cropIconButtonRecenter:'<path stroke="currentColor" fill="none" stroke-width="2" stroke-linejoin="bevel" d="M1.5 7.5v-6h6M1.5 16.5v6h6M22.5 16.5v6h-6M22.5 7.5v-6h-6"/><circle cx="12" cy="12" r="3.5" fill="currentColor" stroke="none"/>',cropIconButtonRotateLeft:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><rect x="3" rx="1" height="12" width="12" y="9"/><path d="M15 5h-1a5 5 0 015 5 1 1 0 002 0 7 7 0 00-7-7h-1.374l.747-.747A1 1 0 0011.958.84L9.603 3.194a1 1 0 000 1.415l2.355 2.355a1 1 0 001.415-1.414l-.55-.55H15z"/></g>',cropIconButtonRotateRight:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><path d="M11.177 5H10a5 5 0 00-5 5 1 1 0 01-2 0 7 7 0 017-7h1.374l-.747-.747A1 1 0 0112.042.84l2.355 2.355a1 1 0 010 1.415l-2.355 2.354a1 1 0 01-1.415-1.414l.5
955-.55z"/><rect rx="1" height="12" width="12" y="9" x="9"/></g>',cropIconButtonFlipVertical:'<g stroke="none" fill="currentColor"><path d="M19.993 12.143H7a1 1 0 0 1-1-1V5.994a1 1 0 0 1 1.368-.93l12.993 5.15a1 1 0 0 1-.368 1.93z"/><path d="M19.993 14a1 1 0 0 1 .368 1.93L7.368 21.078A1 1 0 0 1 6 20.148V15a1 1 0 0 1 1-1h12.993z" opacity=".6"/></g>',cropIconButtonFlipHorizontal:'<g stroke="none" fill="currentColor"><path d="M11.93 7.007V20a1 1 0 0 1-1 1H5.78a1 1 0 0 1-.93-1.368l5.15-12.993a1 1 0 0 1 1.929.368z"/><path d="M14 7.007V20a1 1 0 0 0 1 1h5.149a1 1 0 0 0 .93-1.368l-5.15-12.993A1 1 0 0 0 14 7.007z" opacity=".6"/></g>',cropIconSelectPreset:`<g fill="currentColor">
96        <rect opacity="{a}" x="2" y="4" width="10" height="18" rx="1"/>
97        <rect opacity="{b}" x="4" y="8" width="14" height="14" rx="1"/>
98        <rect opacity="{c}" x="6" y="12" width="17" height="10" rx="1"/>
99    </g>`,cropIconCropBoundary:`<g fill="currentColor">
100        <rect opacity="{a}" x="2" y="3" width="20" height="20" rx="1"/>
101        <rect opacity="{b}" x="7" y="8" width="10" height="10" rx="1"/>
102        <rect opacity="{c}" x="4" y="8" width="14" height="14" rx="1"/>
103        <rect opacity="{d}" x="12" y="4" width="10" height="10" rx="1"/>
104    </g>`,cropLabelButtonRecenter:"Recenter",cropLabelButtonRotateLeft:"Rotate left",cropLabelButtonRotateRight:"Rotate right",cropLabelButtonFlipHorizontal:"Flip horizontal",cropLabelButtonFlipVertical:"Flip vertical",cropLabelSelectPreset:"Crop shape",cropLabelCropBoundary:"Crop boundary",cropLabelCropBoundaryEdge:"Edge of image",cropLabelCropBoundaryNone:"None",cropLabelTabRotation:"Rotation",cropLabelTabZoom:"Scale"},mE={fillLabel:"Fill",fillIcon:`
105    <g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">
106        <g transform="rotate(60, 12, 12)">
107            <rect x="4" y="4" width="14" height="16" rx="3"/>
108        </g>
109        <path d="M21 13 L21 21"></path>
110        <path d="M4.5 12.5 L19 12.5"></path>
111    </g>
112    `},gE={filterLabel:"Filter",filterIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M18.347 9.907a6.5 6.5 0 1 0-1.872 3.306M3.26 11.574a6.5 6.5 0 1 0 2.815-1.417 M10.15 17.897A6.503 6.503 0 0 0 16.5 23a6.5 6.5 0 1 0-6.183-8.51"/></g>',filterLabelChrome:"Chrome",filterLabelFade:"Fade",filterLabelCold:"Cold",filterLabelWarm:"Warm",filterLabelPastel:"Pastel",filterLabelMonoDefault:"Mono",filterLabelMonoNoir:"Noir",filterLabelMonoWash:"Wash",filterLabelMonoStark:"Stark",filterLabelSepiaDefault:"Sepia",filterLabelSepiaBlues:"Blues",filterLabelSepiaRust:"Rust",filterLabelSepiaColor:"Color"},bE={finetuneLabel:"Finetune",finetuneIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M4 1v5.5m0 3.503V23M12 1v10.5m0 3.5v8M20 1v15.5m0 3.5v3M2 7h4M10 12h4M18 17h4"/></g>',finetuneLabelBrightness:"Brightness",finetuneLabelContrast:"Contrast",finetuneLabelSaturation:"Saturation",finetuneLabelExposure:"Exposure",finetuneLabelTemperature:"Temperature",finetuneLabelGamma:"Gamma",finetuneLabelClarity:"Clarity",finetuneLabelVignette:"Vignette"},pE={resizeLabel:"Resize",resizeIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="2" y="12" width="10" height="10" rx="2"/><path d="M4 11.5V4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5"/><path d="M14 10l3.365-3.365M14 6h4v4"/></g>',resizeLabelFormCaption:"Image output size",resizeLabelInputWidth:"w",resizeTitleInputWidth:"Width",resizeLabelInputHeight:"h",resizeTitleInputHeight:"Height",resizeTitleButtonMaintainAspectRatio:"Maintain aspect ratio",resizeIconButtonMaintainAspectRatio:'<defs><mask id="mask1" x="-2" y="-2" width="24" height="24"><rect x="0" y="0" width="24" height="10" fill="#fff" stroke="none"/></mask></defs><g fill="none" fill-rule="evenodd"><g mask="url(#mask1)"><path transform="translate(0 {activeFraction})" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M9.401 10.205v-.804a2.599 2.599 0 0 1 5.198 0V17"/></g><rect fill="currentColor" x="7" y="10" width="10" height="7" rx="1.5"/></g>'},yE={decorateLabel:"Decorate",decorateIcon:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width=".125em" stroke-linecap="round" stroke-linejoin="round" d="M12 18.5l-6.466 3.4 1.235-7.2-5.23-5.1 7.228-1.05L12 2l3.233 6.55 7.229 1.05-5.231 5.1 1.235 7.2z"/></g>'},SE={annotateLabel:"Annotate",annotateIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M17.086 2.914a2.828 2.828 0 1 1 4 4l-14.5 14.5-5.5 1.5 1.5-5.5 14.5-14.5z"/></g>'},wE={stickerLabel:"Sticker",stickerIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"/><path d="M20 17c-3 3-5 5-8 5"/></g>'},_E={frameLabel:"Frame",frameIcon:`<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">
113            <rect x="2" y="2" width="20" height="20" rx="4"/>
114            <rect x="6" y="6" width="12" height="12" rx="1"/>
115        </g>`,frameLabelMatSharp:"Mat",frameLabelMatRound:"Bevel",frameLabelLineSingle:"Line",frameLabelLineMultiple:"Zebra",frameLabelEdgeSeparate:"Inset",frameLabelEdgeOverlap:"Plus",frameLabelEdgeCross:"Lumber",frameLabelCornerHooks:"Hook",frameLabelPolaroid:"Polaroid"},TE={redactLabel:"Redact",redactIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">
115<path d="M 4 5 l 1 -1"/><path d="M 4 10 l 6 -6"/><path d="M 4 15 l 11 -11"/><path d="M 4 20 l 16 -16"/><path d="M 9 20 l 11 -11"/><path d="M 14 20 l 6 -6"/><path d="M 19 20 l 1 -1"/></g>'},Tm=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e);Object.keys(n).forEach(i=>{n[i].get?Object.defineProperty(t,i,{get:()=>e[i],set:o=>e[i]=o}):t[i]=e[i]})},kE=()=>zo()&&document.doctype!==null,E4=e=>{const t={},{sub:n,pub:i}=Pl();kE()||console.warn("Browser is in quirks mode, add <!DOCTYPE html> to page to fix render issues");const o=CS();Tm(o,t);const r=F8(e,o.stores);Tm(r,t);const a=["loadImage","processImage","abortProcessImage","abortLoadImage"].map(c=>r.on(c,u=>{const f=o[c](u&&u.detail);f instanceof Promise&&f.catch(st)})),l=(c,u)=>{const f=n(c,u),d=o.on(c,u),m=r.on(c,u);return()=>{f(),d(),m()}};t.handleEvent=st;const s=l4.map(c=>l(c,u=>t.handleEvent(c,u)));return Qd(t,{on:l,updateImage:c=>new Promise((u,f)=>{const d=t.history.get(),m=t.history.index,g=t.imageState;o.loadImage(c).then(p=>{t.history.set(d),t.history.index=m,t.imageState=g,u(p)}).catch(f)}),close:()=>{i("close")},destroy:()=>{[...a,...s].forEach(c=>c()),r.destroy(),o.destroy(),i("destroy")}}),setTimeout(()=>i("init",t),0),t};zo();const $p="pintura-editor";var CE=(e,t={})=>{const n=Nt(e)?document.querySelector(e):e;if(!Mc(n))return;t.class=t.class?`${$p} ${t.class}`:$p;const i=E4(n);return Object.assign(i,t)};const ey=(e,t,n,i=5,o)=>{const r=re(t.x-e.x,t.y-e.y),a=ur(r),l=i*n;let s;o?s=l*.5:s=Math.ceil((l-1)*.5);const c=Bo(Ut(a),s);return{anchor:Ut(e),offset:c,normal:a,solid:o,size:l,sizeHalf:s}},PE=(e,t,n)=>{const{strokeWidth:i,strokeColor:o,strokeJoin:r,strokeCap:a,...l}=e,{anchor:s,offset:c,normal:u,solid:f,size:d,sizeHalf:m}
115=t,g=s.x,p=s.y,y=Bo(Ut(u),d),w=re(g+y.x,p+y.y);if(Bo(y,.55),f&&!e.bitmap){xi(n,c);const R=Bo(Ut(u),m*.5);return[{...l,points:[re(g-R.x,p-R.y),re(w.x-y.y,w.y+y.x),re(w.x+y.y,w.y-y.x)],pathClose:!0,backgroundColor:o}]}const _=Bo(Uw(Ut(u)),.5),P=re(g-_.x,p-_.y),C=re(g+_.x,p+_.y);return[{...l,points:[re(w.x+y.y,w.y-y.x),P,re(g,p),C,re(w.x-y.y,w.y+y.x)],backgroundColor:f?o:void 0,pathClose:f,strokeWidth:i,strokeColor:o,strokeJoin:r,strokeCap:a}]},ME=(e,t,n)=>{const{strokeWidth:i,strokeColor:o,...r}=e,{anchor:a,solid:l,offset:s,normal:c,sizeHalf:u}=t;return xi(n,s),l&&xi(n,Sc(Ut(c))),[{...r,x:a.x,y:a.y,rx:u,ry:u,backgroundColor:l?o:void 0,strokeWidth:l?void 0:i,strokeColor:l?void 0:o}]},RE=(e,t)=>{const{strokeWidth:n,strokeColor:i,strokeJoin:o,strokeCap:r,...a}=e,{anchor:l,offset:s}=t;return[{...a,points:[re(l.x-s.y,l.y+s.x),re(l.x+s.y,l.y-s.x)],strokeWidth:n,strokeColor:i,strokeJoin:o,strokeCap:r}]},IE=(e,t,n)=>{const{strokeWidth:i,strokeColor:o,...r}=e,{anchor:a,solid:l,offset:s,normal:c,sizeHalf:u}=t;return xi(n,s),[{...r,x:a.x-u,y:a.y-u,width:u*2,height:u*2,rotation:Hw(c),backgroundColor:l?o:void 0,strokeWidth:l?void 0:i,strokeColor:l?void 0:o}]},EE=(e={})=>t=>{if(!t.lineStart&&!t.lineEnd)return;const n=[],{x1:i,y1:o,x2:r,y2:a,lineStart:l,lineEnd:s,strokeWidth:c,strokeColor:u,strokeJoin:f,strokeCap:d,strokeDash:m,lineStartScalar:g,lineEndScalar:p,bitmap:y,aboveFrame:w,opacity:_}=t,P=re(i,o),C=re(r,a),R=[P,C],I={bitmap:y,aboveFrame:w,opacity:_,strokeColor:u,strokeWidth:c,strokeJoin:f,strokeCap:d,lineStartScalar:g,lineEndScalar:p};if(l){const[M,T]=l.split("-"),v=e[M];if(v){const H=ey(P,C,c,g||p,!!T);n.push(...v(I,H,P))}}if(s){const[M,T]=s.split("-"),v=e[M];if(v){const H=ey(C,P,c,p,!!T);n.push(...v(I,H,C))}}return[{...I,strokeDash:m,points:R},...n]},AE=()=>({arrow:PE,circle:ME,square:IE,bar:RE}),km=(e,t)=>{const n=parseFloat(e)*t;return Nt(e)?`${n}%`:n},ha=(e,t)=>Nt(e)?Vd(e,t):e,LE=e=>[{...e,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:e.frameSize?km(e.frameSize,2):"2.5%",frameRadius:e.frameRound?km(e.frameSize,2):0}],xE=({width:e,height:t,frameImage:n,frameSize:i="15%",frameOutset:o=0,frameSlices:r={x1:.15,y1:.15,x2:.85,y2:.85}},{isPreview:a})=>{if(!n)return[];const l=Math.sqrt(e*t),s=ha(i,l),c=a?s:Math.round(s),u=c,f=ha(o,l),d=f*2,{x1:m,x2:g,y1:p,y2:y}=r,w={x0:0,y0:0,x1:c,y1:u,x2:e-c,y2:t-u,cw:c,ch:u,ew:e-c-c,eh:t-u-u},_=a?1:0,P=_*2,C=f>0,R={expandsCanvas:C,width:w.cw,height:w.ch,backgroundImage:n};return[{expandsCanvas:C,x:w.x1-_-f,y:w.y0-f,width:w.ew+P+d,height:w.ch,backgroundCorners:[{x:m,y:0},{x:g,y:0},{x:g,y:p},{x:m,y:p}],backgroundImage:n},{expandsCanvas:C,x:w.x1-_-f,y:w.y2+f,width:w.ew+P+d,height:w.ch,backgroundCorners:[{x:m,y},{x:g,y},{x:g,y:1},{x:m,y:1}],backgroundImage:n},{expandsCanvas:C,x:w.x0-f,y:w.y1-_-f,width:w.cw,height:w.eh+P+d,backgroundCorners:[{x:0,y:p},{x:m,y:p},{x:m,y},{x:0,y}],backgroundImage:n},{expandsCanvas:C,x:w.x2+f,y:w.y1-_-f,width:w.cw,height:w.eh+P+d,backgroundCorners:[{x:g,y:p},{x:1,y:p},{x:1,y},{x:g,y}],backgroundImage:n},{...R,x:w.x0-f,y:w.y0-f,backgroundCorners:[{x:0,y:0},{x:m,y:0},{x:m,y:p},{x:0,y:p}]},{...R,x:w.x2+f,y:w.y0-f,backgroundCorners:[{x:g,y:0},{x:1,y:0},{x:1,y:p},{x:g,y:p}]},{...R,x:w.x2+f,y:w.y2+f,backgroundCorners:[{x:g,y},{x:1,y},{x:1,y:1},{x:g,y:1}]},{...R,x:w.x0-f,y:w.y2+f,backgroundCorners:[{x:0,y},{x:m,y},{x:m,y:1},{x:0,y:1}]}]},FE=({x:e,y:t,width:n,height:i,frameInset:o="3.5%",frameSize:r=".25%",frameColor:a=[1,1,1],frameOffset:l="5%",frameAmount:s=1,frameRadius:c=0,expandsCanvas:u=!1},{isPreview:f})=>{const d=Math.sqrt(n*i);let m=ha(r,d);const g=ha(o,d),p=ha(l,d);let y=0;f||(m=Math.max(1,Math.round(m)),y=m%2==0?0:.5);const w=ha(km(c,s),d);return new Array(s).fill(void 0).map((_,P)=>{const C=p*P;let R=e+g+C,I=t+g+C,M=e+n-g-C,T=t+i-g-C;f||(R=Math.round(R),I=Math.round(I),M=Math.round(M),T=Math.round(T));const v=w>0?w-C:0;return{x:R+y,y:I+y,width:M-R,height:T-I,cornerRadius:v,strokeWidth:m,strokeColor:a,expandsCanvas:u}})},vE=({x:e,y:t,width:n,height:i,frameSize:o=".25%",frameOffset:r=0,frameInset:a="2.5%",frameColor:l=[1,1,1]},{isPreview:s})=>{const c=Math.sqrt(n*i);let u=ha(o,c),f=ha(a,c),d=ha(r,c),m=0;s||(u=Math.max(1,Math.round(u)),f=Math.round(f),d=Math.round(d),m=u%2==0?0:.5);const g=d-f,p=e+f+m,y=t+f+m,w=e+n-f-m,_=t+i-f-m;
115return[{points:[re(p+g,y),re(w-g,y)]},{points:[re(w,y+g),re(w,_-g)]},{points:[re(w-g,_),re(p+g,_)]},{points:[re(p,_-g),re(p,y+g)]}].map(P=>(P.strokeWidth=u,P.strokeColor=l,P))},OE=({x:e,y:t,width:n,height:i,frameSize:o=".25%",frameInset:r="2.5%",frameLength:a="2.5%",frameColor:l=[1,1,1]},{isPreview:s})=>{const c=Math.sqrt(n*i);let u=ha(o,c),f=ha(r,c),d=ha(a,c),m=0;s||(u=Math.max(1,Math.round(u)),f=Math.round(f),d=Math.round(d),m=u%2==0?0:.5);const g=e+f+m,p=t+f+m,y=e+n-f-m,w=t+i-f-m;return[{points:[re(g,p+d),re(g,p),re(g+d,p)]},{points:[re(y-d,p),re(y,p),re(y,p+d)]},{points:[re(y,w-d),re(y,w),re(y-d,w)]},{points:[re(g+d,w),re(g,w),re(g,w-d)]}].map(_=>(_.strokeWidth=u,_.strokeColor=l,_))},DE=({x:e,y:t,width:n,height:i,frameColor:o=[1,1,1]},{isPreview:r})=>{const a=Math.sqrt(n*i),l=.1*a;let s=.2*a,c=0;const u=.5*l;return r?c=1:s=Math.ceil(s),o.length=3,[{id:"border",x:e-u+c,y:t-u+c,width:n+l-c*2,height:i+s-c*2,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:l,frameColor:o,expandsCanvas:!0},{id:"chin",x:e-u,y:i-c,width:n+l,height:s,backgroundColor:o,expandsCanvas:!0}].filter(Boolean)},BE=(e={})=>(t,n)=>{if(!Rt(t,"frameStyle"))return;const i=t.frameStyle,o=e[i];if(!o)return;const{frameStyle:r,...a}=t;return o(a,n)},zE=()=>({solid:LE,hook:OE,line:FE,edge:vE,polaroid:DE,nine:xE}),VE=()=>EE(AE()),WE=()=>BE(zE()),UE=()=>[WE(),VE()],HE=e=>{const t=(n,i={isPreview:!0})=>{const o=e.map(r=>{const a=r(n,i);if(a)return a.map(l=>t(l,i))}).filter(Boolean).flat();return o.length?o.flat().map((r,a)=>(r.id=n.id+"_"+a,r)):n};return t},NE=DS,ty=BS,GE=()=>({read:async(e,t)=>{const n=await kw(e,{exif:[Vu]},[0,262144],t);return n&&n.exif&&n.exif[Vu]||1},apply:ay}),jE=(e={})=>{const{blurAmount:t,dataSizeScalar:n,scrambleAmount:i,backgroundColor:o}=e;return(r,a)=>u6(r,{blurAmount:t,scrambleAmount:i,backgroundColor:o,...a,dataSizeScalar:n||a.dataSizeScalar})},ZE=u4,XE=S4,KE={markupEditorToolbar:IM(),markupEditorToolStyles:u4(),markupEditorShapeStyleControls:S4()},YE=a4,A4=$R,qE=aI,L4=mI,JE=w7,QE=C7,$E=I7,eA=B7,x4=$7,F4=Y7,tA=uE,nA=fM,iA=eM,oA=kM,v4=fE,rA=dE,O4=hE,aA=mE,lA=gE,D4=bE,B4=pE,sA=yE,cA=SE,uA=wE,fA=_E,z4=TE,dA=CE,hA=(e=[])=>HE([...UE(),...e]),mA=(e={})=>{let t;Array.isArray(e.imageReader)||(t=e.imageReader,delete e.imageReader);let n;Array.isArray(e.imageWriter)?n=ty():(xn(e.imageWriter)?n=e.imageWriter:n=ty(e.imageWriter),delete e.imageWriter);let i;return xn(e.imageScrambler)||(i=e.imageScrambler,delete e.imageScrambler),{imageReader:NE(t),imageWriter:n,imageOrienter:GE(),imageScrambler:jE(i)}},gA=(e={})=>{a4(A4,qE,L4,JE,QE,$E,eA,x4,F4,tA);const t=["trim","crop","filter","finetune","retouch","annotate","decorate","sticker","fill","frame","redact","resize"],n=mA(e),i={...v4,...rA,...O4,...aA,...lA,...D4,...fA,...z4,...B4,...sA,...cA,...uA,...e.locale};delete e.locale;const o=typeof e.shapePreprocessor=="function"?e.shapePreprocessor:hA(e.shapePreprocessor);return delete e.shapePreprocessor,e.markupEditorShapeStyleControls&&Object.entries(e.markupEditorShapeStyleControls).every(([a,l])=>/Options$/.test(a)||!Array.isArray(l))&&(e.markupEditorShapeStyleControls=XE({...e.markupEditorShapeStyleControls})),e.markupEditorToolStyles&&Object.values(e.markupEditorToolStyles).every(a=>!Array.isArray(a))&&(e.markupEditorToolStyles=Object.entries(e.markupEditorToolStyles).reduce((a,[l,s])=>(a[l]=_l(l,s),a),ZE())),gS([{...n,shapePreprocessor:o,utils:t,...nA,...iA,...oA,...KE,stickerStickToImage:!0,locale:i},e])},bA=(e,t)=>dA(e,gA(t)),pA={labelButtonClose:"Maak toe",labelButtonCancel:"Kanselleer",labelButtonExport:"Stoor",labelButtonReset:"Herstel",labelButtonUndo:"Ongedaan maak",labelButtonRedo:"Herdoen",cropLabel:"Knip",finetuneLabel:"Verfyn",redactLabel:"Vervaag",resizeLabel:"Grootte",labelButtonCrop:"Knip",labelButtonFinetune:"Verfyn",labelButtonResize:"Grootte",labelButtonRedact:"Vervaag",finetuneLabelBrightness:"Helderheid",finetuneLabelContrast:"Kontras",finetuneLabelSaturation:"Versadiging",finetuneLabelExposure:"Blootstelling",finetuneLabelTemperature:"Temperatuur",finetuneLabelGamma:"Gamma",finetuneLabelClarity:"Duidelikheid",finetuneLabelVignette:"Vignet",labelSizeExtraSmall:"Baie klein",labelSizeSmall:"Klein",labelSizeMediumSmall:"Medium klein",labelSizeMedium:"Medium",labelSizeMediumLarge:"Medium groot",labelSizeLarge:"Groot",labelSizeExtraLarge:"Baie groot",cropLabelButtonRotateLeft:"Roteer links",cropLabelButtonRotateRight:"Roteer regs",cropLabelButtonFlipHorizontal:"Spieël horisontaal",cropLabelButtonFlipVertical:"Spieël vertikaal",cropLabelTabRotation:"Roteer",cropLabelTabZoom:"Skaal",labelCropTitle:"Beeld uitsny",labelResizeTitle:"Beeldgrootte",labelResizeWidth:"Breedte",labelResizeHeight:"Hoogte",labelResizeApply:"Pas grootte aan",labelToolbar:"Beeldredigeerder",labelUtilStack:"Gereedskap",statusImageLoadPrepare:"Berei beeld voor…",statusImageLoadBusy:"Laai beeld…",statusImageUploadBusy:"Laai beeld op…",statusImageProcessBusy:"Verwerk beeld…",statusImageLoadError:"Kon nie beeld laai nie",statusImageUploadError:"Kon nie beeld o
115plaai nie",statusImageProcessError:"Kon nie beeld verwerk nie"},yA=["Sans-serif","Swart","Smaal","Humanisties","Serif","Ou-styl","Oorgangs","Monospace","Slab Serif"],SA="Lêer kon nie gelees word nie.",wA={...v4,...O4,...D4,...B4,...z4,...pA};YE(A4,L4,x4,F4);function _A(){return f4().map(([t,n],i)=>[t,yA[i]??n])}function TA(e,t){return function(i,o,r){return new Promise((a,l)=>{const s=i.dest,c=new FileReader;c.onload=()=>{const u=c.result,f=u.indexOf("base64,")>=0?u.split("base64,")[1]:u;let d=null;try{d=i.imageState?JSON.stringify(i.imageState):null}catch{d=String(i.imageState)}const m={base64:f,base64Length:f?f.length:0,fileName:s.name,originalFileName:e||s.name,fileSize:s.size,mimeType:s.type,imageState:d,userPostId:t??null};window.dispatchEvent(new CustomEvent("pintura-store-result",{detail:m})),a({})},c.onerror=()=>l(new Error(SA)),c.readAsDataURL(s)})}}function kA(e,t,n=null,i="square"){const o=t&&t instanceof File?t:null,r=typeof t=="string"?t:o?URL.createObjectURL(o):t,a=o?o.name:null,l={store:TA(a,n),quality:.2,mimeType:"image/jpeg"},s={src:r,previewUpscale:!0,imageWriter:l,util:"crop",utils:["crop","finetune","redact","resize"],layoutVerticalUtilsPreference:"left",imageCropAspectRatio:1,imageCropLimitToImage:!0,cropEnableSelectPreset:!1,cropInteractionFocus:"image",cropEnableButtonRotateRight:!0,cropEnableButtonFlipVertical:!0,locale:wA,markupEditorShapeStyleControls:{fontFamilyOptions:_A()}};return i==="circle"?s.willRenderCanvas=(c,u)=>{const{utilVisibility:f,selectionRect:d,lineColor:m,backgroundColor:g}=u;if(f.crop<=0)return c;const{x:p,y,width:w,height:_}=d;return{...c,interfaceShapes:[{x:p+w*.5,y:y+_*.5,rx:w*.5,ry:_*.5,opacity:f.crop,inverted:!0,backgroundColor:[...g,.5],strokeWidth:1,strokeColor:[...m]},...c.interfaceShapes]}}:(s.cropSelectPresetOptions=[[void 0,"Custom"],[1,"1:1"]],s.cropWillRenderImageSelectionGuides=(c,u)=>({rows:3,cols:3,opacity:Math.max(.2,u*.3)})),bA(e,s)}function V4(e={}){return{isButtonDisabled:!0,showPinturaEditor:!1,editorInstance:null,selectedImagePreview:null,selectedImageMeta:null,errorMessage:null,invalidImageMessage:e.invalidImageMessage??"Please select a valid image file.",destroyEditor(){if(this.editorInstance&&this.editorInstance.destroy)try{this.editorInstance.destroy()}catch{}this.editorInstance=null},resetComposerState(){this.destroyEditor(),this.showPinturaEditor=!1,this.selectedImagePreview=null,this.selectedImageMeta=null,this.errorMessage=null,this.isButtonDisabled=this.disabled,this.$refs.photoInput&&(this.$refs.photoInput.value="")},get disabled(){return(this.$wire?.userPostForm?.postBody||"").trim().length===0&&!this.selectedImageMeta?.base64},openPhotoPicker(){this.$refs.photoInput&&(this.$refs.photoInput.value=""),this.$refs.photoInput.click()},onPhotoSelected(t){const n=t.target.files?.[0];if(!n||!n.type.startsWith("image/")){this.errorMessage=this.invalidImageMessage;return}this.errorMessage=null,this.showPinturaEditor=!0,this.$nextTick(()=>{!window.Pintura?.openEditor||!this.$refs.pinturaEditorContainerOverlay||(this.destroyEditor(),this.editorInstance=window.Pintura.openEditor(this.$refs.pinturaEditorContainerOverlay,n,null))})},closePinturaEditor(){this.destroyEditor(),this.showPinturaEditor=!1},removeSelectedImage(){this.selectedImagePreview=null,this.selectedImageMeta=null,this.errorMessage=null,this.isButtonDisabled=this.disabled,this.$refs.photoInput&&(this.$refs.photoInput.value="")},editSelectedImage(){this.selectedImagePreview&&(this.errorMessage=null,this.showPinturaEditor=!0,this.$nextTick(()=>{!window.Pintura?.openEditor||!this.$refs.pinturaEditorContainerOverlay||(this.destroyEditor(),this.editorInstance=window.Pintura.openEditor(this.$refs.pinturaEditorContainerOverlay,this.selectedImagePreview,null))}))},onPinturaStored(t){if(t?.userPostId!=null&&t.userPostId!==""||!t?.base64)return;const n=t.mimeType||"image/jpeg";this.selectedImagePreview=`data:${n};base64,${t.base64}`,this.selectedImageMeta={base64:t.base64,mimeType:n,originalFileName:t.originalFileName||t.fileName||"image.jpg"},this.isButtonDisabled=this.disabled,this.closePinturaEditor()}}}function CA(e={}){const t=e.userPostId??null;return{...V4(e),userPostId:t,editing:!1,userPostImageUrl:e.userPostImageUrl??null,hadServerUserPostImage:!1,existingUserPostImageRemoved:!1,get disabled(){return!((this.$wire?.userPostForm?.postBody||"").trim().length>0||this.selectedImageMeta?.base64||this.selectedImagePreview)},onPhotoSelected(n){this.existingUserPostImageRemoved=!1;const i=n.target.files?.[0];if(!i||!i.type.startsWith("image/")){this.errorMessage=this.invalidImageMessage;return}this.errorMessage=null,this.showPinturaEditor=!0,this.$nextTick(()=>{!window.Pintura?.openEditor||!this.$refs.pinturaEditorContainerOverlay||(this.destroyEditor(),this.editorInstance=window.Pintura.openEditor(this.$refs.pinturaEditorContainerOverlay,i,this.userPostId))})},removeSelectedImage(){this.editing&&this.hadServerUserPostImage&&(this.existingUserPostImageRemoved=!0,this.userPostImageUrl=null),this.selectedImagePreview=null,this.selectedImageMeta=null,this.errorMessage=null,this.isButtonDisabled=this.disabled,this.$refs.photoInput&&(this.$refs.photoInput.value="")},editSelectedImage(){this.selectedImagePreview&&(this.errorMessage=null,this.showPinturaEditor=!0,this.$nextTick(()=>{!window.Pintura?.openEditor||!this.$refs.pinturaEditorContainerOverlay||(this.destroyEditor(),this.editorInstance=window.Pintura.openEditor(this.$refs.pinturaEditorContainerOverlay,this.selectedImagePreview,this.userPostId))}))},onPinturaStored(n){if(Number(n?.userPostId)!==Number(this.userPostId)||!n?.base64)return;this.existingUserPostImageRemoved=!1;const i=n.mimeType||"image/jpeg";this.selectedImagePreview=`data:${i};base64,${n.base64}`,this.selectedImageMeta={base64:n.base64,mimeType:i,originalFileName:n.originalFileName||n.fileName||"image.jpg"},this.isButtonDisabled=this.disabled,this.closePinturaEditor()},beginEdit(){this.existingUserPostImageRemoved=!1,this.hadServerUserPostImage=!!this.userPostImageUrl,this.userPostImageUrl?(this.selectedImagePreview=this.userPostImageUrl,this.selectedImageMeta=null):(this.selectedImagePreview=null,this.selectedImageMeta=null),this.errorMessage=null,this.isButtonDisabled=this.disabled,this.editing=!0,this.$nextTick(()=>
115{this.$wire&&this.$wire.inlineEditUserPostImageUrlForPintura().then(n=>{n&&(this.userPostImageUrl=n,this.selectedImagePreview=n,this.selectedImageMeta=null,this.hadServerUserPostImage=!0,this.isButtonDisabled=this.disabled)})})},cancelInlineEdit(){this.editing=!1,this.existingUserPostImageRemoved=!1,this.hadServerUserPostImage=!1,this.resetComposerState(),this.$dispatch("closeUserPostEdit")},submitInlineEdit(){if(this.disabled)return;const n=this.selectedImageMeta,i=n?.base64?{base64:n.base64,mimeType:n.mimeType||"image/jpeg",originalFileName:n.originalFileName||"image.jpg"}:null;this.$wire.editUserPost(i,!!this.existingUserPostImageRemoved)}}}function PA(e={}){const t=e.pinturaContextId??"profile-avatar",n=e.deferFormSave??!1;return{showPinturaEditor:!1,editorInstance:null,previewImage:null,pinturaContextId:t,deferFormSave:n,destroyEditor(){if(this.editorInstance?.destroy)try{this.editorInstance.destroy()}catch{}this.editorInstance=null},closePinturaEditor(){this.destroyEditor(),this.showPinturaEditor=!1},openPhotoPicker(){this.$refs.photoInput&&(this.$refs.photoInput.value="",this.$refs.photoInput.click())},onPhotoSelected(i){const o=i.target.files?.[0];!o||!o.type.startsWith("image/")||(this.showPinturaEditor=!0,this.$nextTick(()=>{!window.Pintura?.openEditor||!this.$refs.pinturaEditorContainerOverlay||(this.destroyEditor(),this.editorInstance=window.Pintura.openEditor(this.$refs.pinturaEditorContainerOverlay,o,this.pinturaContextId,"circle"))}))},onPinturaStored(i){if(i?.userPostId!==this.pinturaContextId||!i?.base64)return;const o=i.mimeType||"image/jpeg";this.previewImage=`data:${o};base64,${i.base64}`,this.closePinturaEditor(),this.deferFormSave?this.$wire.stageFormLogo(i.base64):this.$wire.saveImage(i.base64)}}}window.Pintura={openEditor:kA};window.pinturaPostComposer=V4;window.pinturaPostInlineEdit=CA;window.pinturaAvatar=PA;

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.