ConsultancyProject1_Auslast.../scraper/public/js/filament/forms/components/file-upload.js

124 lines
271 KiB
JavaScript
Raw Normal View History

2024-06-27 21:38:31 +02:00
var Go=Object.defineProperty;var Uo=(e,t)=>{for(var i in t)Go(e,i,{get:t[i],enumerable:!0})};var ea={};Uo(ea,{FileOrigin:()=>Pt,FileStatus:()=>pt,OptionTypes:()=>Ni,Status:()=>Kn,create:()=>dt,destroy:()=>ut,find:()=>Vi,getOptions:()=>Gi,parse:()=>Bi,registerPlugin:()=>_e,setOptions:()=>Ot,supported:()=>zi});var ko=e=>e instanceof HTMLElement,Ho=(e,t=[],i=[])=>{let a={...e},n=[],r=[],o=()=>({...a}),l=()=>{let p=[...n];return n.length=0,p},s=()=>{let p=[...r];r.length=0,p.forEach(({type:f,data:g})=>{u(f,g)})},u=(p,f,g)=>{if(g&&!document.hidden){r.push({type:p,data:f});return}m[p]&&m[p](f),n.push({type:p,data:f})},c=(p,...f)=>h[p]?h[p](...f):null,d={getState:o,processActionQueue:l,processDispatchQueue:s,dispatch:u,query:c},h={};t.forEach(p=>{h={...p(a),...h}});let m={};return i.forEach(p=>{m={...p(u,c,a),...m}}),d},Wo=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},te=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},Ue=e=>{let t={};return te(e,i=>{Wo(t,i,e[i])}),t},ne=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},Yo="http://www.w3.org/2000/svg",$o=["svg","path"],wa=e=>$o.includes(e),ei=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=wa(e)?document.createElementNS(Yo,e):document.createElement(e);return t&&(wa(e)?ne(a,"class",t):a.className=t),te(i,(n,r)=>{ne(a,n,r)}),a},qo=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},jo=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),Xo=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),Qo=(()=>typeof window<"u"&&typeof window.document<"u")(),un=()=>Qo,Zo=un()?ei("svg"):{},Ko="children"in Zo?e=>e.children.length:e=>e.childNodes.length,hn=(e,t,i,a)=>{let n=i[0]||e.left,r=i[1]||e.top,o=n+e.width,l=r+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:r,right:o,bottom:l}};return t.filter(u=>!u.isRectIgnored()).map(u=>u.rect).forEach(u=>{va(s.inner,{...u.inner}),va(s.outer,{...u.outer})}),Aa(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Aa(s.outer),s},va=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Aa=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},$e=e=>typeof e=="number",Jo=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,el=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,r=0,o=!1,u=Ue({interpolate:(c,d)=>{if(o)return;if(!($e(a)&&$e(n))){o=!0,r=0;return}let h=-(n-a)*e;r+=h/i,n+=r,r*=t,Jo(n,a,r)||d?(n=a,r=0,o=!0,u.onupdate(n),u.oncomplete(n)):u.onupdate(n)},target:{set:c=>{if($e(c)&&!$e(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){o=!0,r=0,u.onupdate(n),u.oncomplete(n);return}o=!1},get:()=>a},resting:{get:()=>o},onupdate:c=>{},oncomplete:c=>{}});return u};var tl=e=>e<.5?2*e*e:-1+(4-2*e)*e,il=({duration:e=500,easing:t=tl,delay:i=0}={})=>{let a=null,n,r,o=!0,l=!1,s=null,c=Ue({interpolate:(d,h)=>{o||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||h?(n=1,r=l?0:1,c.onupdate(r*s),c.oncomplete(r*s),o=!0):(r=n/e,c.onupdate((n>=0?t(l?1-r:r):0)*s))))},target:{get:()=>l?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,l=!0):(l=!1,s=d),o=!1,a=null}},resting:{get:()=>o},onupdate:d=>{},oncomplete:d=>{}});return c},La={spring:el,tween:il},al=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,r=typeof a=="object"?{...a}:{};return La[n]?La[n](r):null},Ui=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(r=>{let o=r,l=()=>i[r],s=u=>i[r]=u;typeof r=="object"&&(o=r.key,l=r.getter||l,s=r.setter||s),!(n[o]&&!a)&&(n[o]={get:l,set:s})})})},nl=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},r=[];return te(e,(o,l)=>{let s=al(l);if(!s)return;s.onupdate=c=>{t[o]=c},s.target=n[o],Ui([{key:o,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[o]}],[i,a],t,!0),r.push(s)}),{write:o=>{let l=document.hidden
`);for(let a of i){let n=as(a);if(n){t.name=n;continue}let r=ns(a);if(r){t.size=r;continue}let o=rs(a);if(o){t.source=o;continue}}return t},os=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let l=t.source;o.fire("init",l),l instanceof File?o.fire("load",l):l instanceof Blob?o.fire("load",ht(l,l.name)):Mi(l)?o.fire("load",is(l)):r(l)},r=l=>{if(!e){o.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(l,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=ht(s,s.name||xt(l))),o.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{o.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,u,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=u/c,o.fire("progress",t.progress)},()=>{o.fire("abort")},s=>{let u=Yi(typeof s=="string"?s:s.headers);o.fire("meta",{size:t.size||u.size,filename:u.name,source:u.source})})},o={...li(),setSource:l=>t.source=l,getProgress:i,abort:a,load:n};return o},za=e=>/GET|HEAD/.test(e),Xe=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,o.abort()}},n=!1,r=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),za(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let o=new XMLHttpRequest,l=za(i.method)?o:o.upload;return l.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},o.onreadystatechange=()=>{o.readyState<2||o.readyState===4&&o.status===0||r||(r=!0,a.onheaders(o))},o.onload=()=>{o.status>=200&&o.status<300?a.onload(o):a.onerror(o)},o.onerror=()=>a.onerror(o),o.onabort=()=>{n=!0,a.onabort()},o.ontimeout=()=>a.ontimeout(o),o.open(i.method,t,!0),mt(i.timeout)&&(o.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let u=unescape(encodeURIComponent(i.headers[s]));o.setRequestHeader(s,u)}),i.responseType&&(o.responseType=i.responseType),i.withCredentials&&(o.withCredentials=!0),o.send(e),a},ie=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),Qe=e=>t=>{e(ie("error",0,"Timeout",t.getAllResponseHeaders()))},Na=e=>/\?/.test(e),Mt=(...e)=>{let t="";return e.forEach(i=>{t+=Na(t)&&Na(i)?i.replace(/\?/,"&"):i}),t},Ri=(e="",t)=>{if(typeof t=="function")return t;if(!t||!pe(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,r,o,l,s,u)=>{let c=Xe(n,Mt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let h=d.getAllResponseHeaders(),m=Yi(h).name||xt(n);r(ie("load",d.status,t.method==="HEAD"?null:ht(i(d.response),m),h))},c.onerror=d=>{o(ie("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{u(ie("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=Qe(o),c.onprogress=l,c.onabort=s,c}},Re={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},ls=(e,t,i,a,n,r,o,l,s,u,c)=>{let d=[],{chunkTransferId:h,chunkServer:m,chunkSize:p,chunkRetryDelays:f}=c,g={serverId:h,aborted:!1},b=t.ondata||(A=>A),E=t.onload||((A,F)=>F==="HEAD"?A.getResponseHeader("Upload-Offset"):A.response),I=t.onerror||(A=>null),_=A=>{let F=new FormData;ce(n)&&F.append(i,JSON.stringify(n));let w=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:w},C=Xe(b(F),Mt(e,t.url),L);C.onload=D=>A(E(D,L.method)),C.onerror=D=>o(ie("error",D.status,I(D.response)||D.statusText,D.getAllResponseHeaders())),C.ontimeout=Qe(o)},y=A=>{let F=Mt(e,m.url,g.serverId),L={headers:typeof t.headers=="function"?t.headers(g.serverId):{...t.headers},method:"HEAD"},C=Xe(null,F,L);C.onload=D=>A(E(D,L.method)),C.onerror=D=>o(ie("error",D.status,I(D.response)||D.statusText,D.getAllResponseHeaders())),C.ontimeout=Qe(o)},T=Math.floor(a.size/p);for(let A=0;A<=T;A++){let F=A*p,w=a.slice(F,F+p,"application/offset+octet-stream");d[A]={index:A,size:w.size,offset:F,data:w,file:a,progress:0,retries:[...f],status:Re.QUEUED,error:null,request:null,timeout:null}}let v=()=>r(g.serverId),
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eu(e,t){if(typeof e!="object"||e===null)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var a=i.call(e,t||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Er(e){var t=eu(e,"string");return typeof t=="symbol"?t:String(t)}var pi=typeof window<"u"&&typeof window.document<"u",De=pi?window:{},ma=pi&&De.document.documentElement?"ontouchstart"in De.document.documentElement:!1,pa=pi?"PointerEvent"in De:!1,Z="cropper",fa="all",Tr="crop",Ir="move",br="zoom",tt="e",it="w",ft="s",ke="n",Dt="ne",Ft="nw",Ct="se",zt="sw",ra="".concat(Z,"-crop"),tr="".concat(Z,"-disabled"),Te="".concat(Z,"-hidden"),ir="".concat(Z,"-hide"),tu="".concat(Z,"-invisible"),mi="".concat(Z,"-modal"),oa="".concat(Z,"-move"),Bt="".concat(Z,"Action"),ui="".concat(Z,"Preview"),ga="crop",_r="move",Rr="none",la="crop",sa="cropend",ca="cropmove",da="cropstart",ar="dblclick",iu=ma?"touchstart":"mousedown",au=ma?"touchmove":"mousemove",nu=ma?"touchend touchcancel":"mouseup",nr=pa?"pointerdown":iu,rr=pa?"pointermove":au,or=pa?"pointerup pointercancel":nu,lr="ready",sr="resize",cr="wheel",ua="zoom",dr="image/jpeg",ru=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,ou=/^data:/,lu=/^data:image\/jpeg;base64,/,su=/^img|canvas$/i,yr=200,Sr=100,ur={viewMode:0,dragMode:ga,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:yr,minContainerHeight:Sr,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},cu='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',du=Number.isNaN||De.isNaN;function Y(e){return typeof e=="number"&&!du(e)}var hr=function(t){return t>0&&t<1/0};function ta(e){return typeof e>"u"}function at(e){return aa(e)==="object"&&e!==null}var uu=Object.prototype.hasOwnProperty;function gt(e){if(!at(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&uu.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var hu=Array.prototype.slice;function wr(e){return Array.from?Array.from(e):hu.call(e)}function oe(e,t){return e&&Ee(t)&&(Array.isArray(e)||Y(e.length)?wr(e).forEach(function(i,a){t.call(e,i,a,e)}):at(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var K=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return at(t)&&a.length>0&&a.forEach(function(r){at(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},m
<defs>
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
<stop offset='50%' stop-color='#000000'/>
<stop offset='56%' stop-color='#0a0a0a'/>
<stop offset='63%' stop-color='#262626'/>
<stop offset='69%' stop-color='#4f4f4f'/>
<stop offset='75%' stop-color='#808080'/>
<stop offset='81%' stop-color='#b1b1b1'/>
<stop offset='88%' stop-color='#dadada'/>
<stop offset='94%' stop-color='#f6f6f6'/>
<stop offset='100%' stop-color='#ffffff'/>
</radialGradient>
<mask id="mask-__UID__">
<rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>
</mask>
</defs>
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
</svg>`,jr=0,Lh=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Ah;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}jr++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,jr)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Mh=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},Oh=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,r=i[0],o=i[1],l=i[2],s=i[3],u=i[4],c=i[5],d=i[6],h=i[7],m=i[8],p=i[9],f=i[10],g=i[11],b=i[12],E=i[13],I=i[14],_=i[15],y=i[16],T=i[17],v=i[18],R=i[19],S=0,P=0,x=0,O=0,z=0;for(;S<n;S+=4)P=a[S]/255,x=a[S+1]/255,O=a[S+2]/255,z=a[S+3]/255,a[S]=Math.max(0,Math.min((P*r+x*o+O*l+z*s+u)*255,255)),a[S+1]=Math.max(0,Math.min((P*c+x*d+O*h+z*m+p)*255,255)),a[S+2]=Math.max(0,Math.min((P*f+x*g+O*b+z*E+I)*255,255)),a[S+3]=Math.max(0,Math.min((P*_+x*y+O*T+z*v+R)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},xh=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},Ph={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]},Dh=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,Ph[a](t,i))},Fh=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let r=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),Dh(r,t,i,a),r.drawImage(e,0,0,t,i),n},Zr=e=>/^image/.test(e.type)&&!/svg/.test(e.type),Ch=10,zh=10,Nh=e=>{let t=Math.min(Ch/e.width,zh/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),r=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,r);let o=null;try{o=a.getImageData(0,0,n,r).data}catch{return null}let l=o.length,s=0,u=0,c=0,d=0;for(;d<l;d+=4)s+=o[d]*o[d],u+=o[d+1]*o[d+1],c+=o[d+2]*o[d+2];return s=ba(s,l),u=ba(u,l),c=ba(c,l),{r:s,g:u,b:c}},ba=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Bh=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Vh=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},Gh=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Uh=e=>{let t=Lh(e),i=vh(e),{createWorker:a}=e.utils,n=(E,I,_)=>new Promise(y=>{E.ref.imageData||(E.ref.imageData=_.getContext("2d").getImageData(0,0,_.width,_.height));let T=Vh(E.ref.imageData);if(!I||I.length!==20)return _.getContext("2d").putImageData(T,0,0),y();let v=a(Oh);v.post({imageData:T,colorMatrix:I},R=>{_.getContext("2d").putImageData(R,0,0),v.terminate(),y()},[T.data.buffer])}),r=(E,I)=>{E.removeChildView(I),I.image.width=1,I.image.height=1,I._destroy()},o=({root:E})=>{let I=E.ref.images.shift();return I.opacity=0,I.translateY=-15,E.ref.imageViewBin.push(I),I},l=({root:E,props:I,image:_})=>{let y=I.id,T=E.query("GET_ITEM",{id:y});if(!T)return;let v=T.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},R=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),S,P,x=!1;E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(S=T.getMetadata("markup")||[],P=T.getMetadata("resize"),x=!0);let O=E.appendChildView(E.createChildView(i,{id:y,image:_,crop:v,resize:P,markup:S,dirty:x,background:R,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),E.childViews.length);E.ref.images.push(O),O.opacity=1,O.scaleX=1,O.scaleY=1,O.translateY=0,setTimeout(()=>{E.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:E,props:I})=>{let _=E.query("GET_ITEM",{id:I.id});if(!_)return;let y=E.ref.images[E.ref.images.length-1]
`+W.outerHTML+`
`},""),v=`
<g>${v.replace(/&nbsp;/g," ")}</g>
`}let R=t.aspectRatio||T/y,S=y,P=S*R,x=typeof t.scaleToFit>"u"||t.scaleToFit,O=t.center?t.center.x:.5,z=t.center?t.center.y:.5,A=lo({width:y,height:T},so({width:S,height:P},R),t.rotation,x?{x:O,y:z}:{x:.5,y:.5}),F=t.zoom*A,w=t.rotation*(180/Math.PI),L={x:S*.5,y:P*.5},C={x:L.x-y*O,y:L.y-T*z},D=[`rotate(${w} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${C.x} ${C.y})`],V=t.flip&&t.flip.horizontal,B=t.flip&&t.flip.vertical,j=[`scale(${V?-1:1} ${B?-1:1})`,`translate(${V?-y:0} ${B?-T:0})`],q=`<?xml version="1.0" encoding="UTF-8"?>
<svg width="${S}${b}" height="${P}${E}"
viewBox="0 0 ${S} ${P}" ${r?'style="background:'+r+'" ':""}
preserveAspectRatio="xMinYMin"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg">
<!-- Generated by PQINA - https://pqina.nl/ -->
<title>${d?d.textContent:""}</title>
<g transform="${D.join(" ")}">
<g transform="${j.join(" ")}">
${u.outerHTML}${v}
</g>
</g>
</svg>`;n(q)},o.readAsText(e)}),Sm=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},wm=()=>{let e={resize:c,filter:u},t=(d,h)=>(d.forEach(m=>{h=e[m.type](h,m.data)}),h),i=(d,h)=>{let m=d.transforms,p=null;if(m.forEach(f=>{f.type==="filter"&&(p=f)}),p){let f=null;m.forEach(g=>{g.type==="resize"&&(f=g)}),f&&(f.data.matrix=p.data,m=m.filter(g=>g.type!=="filter"))}h(t(m,d.imageData))};self.onmessage=d=>{i(d.data.message,h=>{self.postMessage({id:d.data.id,message:h},[h.data.buffer])})};let a=1,n=1,r=1;function o(d,h,m){let p=h[d]/255,f=h[d+1]/255,g=h[d+2]/255,b=h[d+3]/255,E=p*m[0]+f*m[1]+g*m[2]+b*m[3]+m[4],I=p*m[5]+f*m[6]+g*m[7]+b*m[8]+m[9],_=p*m[10]+f*m[11]+g*m[12]+b*m[13]+m[14],y=p*m[15]+f*m[16]+g*m[17]+b*m[18]+m[19],T=Math.max(0,E*y)+a*(1-y),v=Math.max(0,I*y)+n*(1-y),R=Math.max(0,_*y)+r*(1-y);h[d]=Math.max(0,Math.min(1,T))*255,h[d+1]=Math.max(0,Math.min(1,v))*255,h[d+2]=Math.max(0,Math.min(1,R))*255}let l=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===l}function u(d,h){if(!h||s(h))return d;let m=d.data,p=m.length,f=h[0],g=h[1],b=h[2],E=h[3],I=h[4],_=h[5],y=h[6],T=h[7],v=h[8],R=h[9],S=h[10],P=h[11],x=h[12],O=h[13],z=h[14],A=h[15],F=h[16],w=h[17],L=h[18],C=h[19],D=0,V=0,B=0,j=0,q=0,X=0,ue=0,U=0,W=0,$=0,le=0,J=0;for(;D<p;D+=4)V=m[D]/255,B=m[D+1]/255,j=m[D+2]/255,q=m[D+3]/255,X=V*f+B*g+j*b+q*E+I,ue=V*_+B*y+j*T+q*v+R,U=V*S+B*P+j*x+q*O+z,W=V*A+B*F+j*w+q*L+C,$=Math.max(0,X*W)+a*(1-W),le=Math.max(0,ue*W)+n*(1-W),J=Math.max(0,U*W)+r*(1-W),m[D]=Math.max(0,Math.min(1,$))*255,m[D+1]=Math.max(0,Math.min(1,le))*255,m[D+2]=Math.max(0,Math.min(1,J))*255;return d}function c(d,h){let{mode:m="contain",upscale:p=!1,width:f,height:g,matrix:b}=h;if(b=!b||s(b)?null:b,!f&&!g)return u(d,b);if(f===null?f=g:g===null&&(g=f),m!=="force"){let O=f/d.width,z=g/d.height,A=1;if(m==="cover"?A=Math.max(O,z):m==="contain"&&(A=Math.min(O,z)),A>1&&p===!1)return u(d,b);f=d.width*A,g=d.height*A}let E=d.width,I=d.height,_=Math.round(f),y=Math.round(g),T=d.data,v=new Uint8ClampedArray(_*y*4),R=E/_,S=I/y,P=Math.ceil(R*.5),x=Math.ceil(S*.5);for(let O=0;O<y;O++)for(let z=0;z<_;z++){let A=(z+O*_)*4,F=0,w=0,L=0,C=0,D=0,V=0,B=0,j=(O+.5)*S;for(let q=Math.floor(O*S);q<(O+1)*S;q++){let X=Math.abs(j-(q+.5))/x,ue=(z+.5)*R,U=X*X;for(let W=Math.floor(z*R);W<(z+1)*R;W++){let $=Math.abs(ue-(W+.5))/P,le=Math.sqrt(U+$*$);if(le>=-1&&le<=1&&(F=2*le*le*le-3*le*le+1,F>0)){$=4*(W+q*E);let J=T[$+3];B+=F*J,L+=F,J<255&&(F=F*J/250),C+=F*T[$],D+=F*T[$+1],V+=F*T[$+2],w+=F}}}v[A]=C/w,v[A+1]=D/w,v[A+2]=V/w,v[A+3]=B/L,b&&o(A,v,b)}return{data:v,width:_,height:y}}},vm=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},Am=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,r=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(r||(r=vm(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},Lm=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Am(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),Mm=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Om=(e,t)=>{let i=Mm();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},xm=()=>Math.random().toString(36).substr(2,9),Pm=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(r,o,l)=>{let s=xm();n[s]=o,a.onmessage=u=>{let c=n[u.data.id];c&&(c(u.data.message),delete n[u.data.id])},a.postMessage({id:s,message:r},l)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Dm=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),Fm=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.prototy
/*! Bundled license information:
filepond/dist/filepond.esm.js:
(*!
* FilePond 4.31.1
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
cropperjs/dist/cropper.esm.js:
(*!
* Cropper.js v1.6.1
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2023-09-17T03:44:19.860Z
*)
filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.esm.js:
(*!
* FilePondPluginFileValidateSize 2.2.8
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js:
(*!
* FilePondPluginFileValidateType 1.2.9
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-crop/dist/filepond-plugin-image-crop.esm.js:
(*!
* FilePondPluginImageCrop 2.0.6
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-edit/dist/filepond-plugin-image-edit.esm.js:
(*!
* FilePondPluginImageEdit 1.6.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.esm.js:
(*!
* FilePondPluginImageExifOrientation 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js:
(*!
* FilePondPluginImagePreview 4.6.12
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-resize/dist/filepond-plugin-image-resize.esm.js:
(*!
* FilePondPluginImageResize 2.0.10
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-transform/dist/filepond-plugin-image-transform.esm.js:
(*!
* FilePondPluginImageTransform 3.8.7
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-media-preview/dist/filepond-plugin-media-preview.esm.js:
(*!
* FilePondPluginMediaPreview 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*)
*/