text: (this["webpackJsonplama-cleaner"]=this["webpackJsonplama-cleaner"]||[]).push([[0],{20:function(e,t,n){},23:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n(14),r=n.n(c),i=(n(20),n(3)),s=n.n(i),o=n(2),l=n(5),u=n(7),h=n(27),d=n(29),b=n(1);function p(e){var t=e.children,n=e.className,c=e.disabled,r=e.icon,i=e.primary,s=e.onKeyDown,l=e.onClick,u=e.onDown,h=e.onUp,d=Object(a.useState)(!1),p=Object(o.a)(d,2),f=p[0],j=p[1],v="";i&&!c&&(v="bg-primary hover:bg-black hover:text-white"),f&&(v="bg-black text-white"),i||f||(v="hover:bg-primary");return Object(b.jsxs)("div",{role:"button",onKeyDown:s,onClick:function(e){e.currentTarget.blur(),null===l||void 0===l||l()},onPointerDown:function(e){j(!0),null===u||void 0===u||u(e.nativeEvent)},onPointerUp:function(e){j(!1),null===h||void 0===h||h(e.nativeEvent)},tabIndex:-1,className:["inline-flex py-3 px-3 rounded-md cursor-pointer",t?"space-x-3":"",v,c?"pointer-events-none opacity-50":"",n].join(" "),children:[r,Object(b.jsx)("span",{className:"whitespace-nowrap select-none",children:t})]})}var f=n(6);function j(e){var t=e.onSelection,n=Object(a.useState)(!1),c=Object(o.a)(n,2),r=c[0],i=c[1],u=Object(a.useState)("file-upload-".concat(Math.random().toString())),h=Object(o.a)(u,1)[0];function d(e){if(e&&e.type.match("image.*"))try{if(e.size>20971520)throw new Error("file too large");t(e)}catch(n){alert("error: ".concat(n.message))}}function p(e){return j.apply(this,arguments)}function j(){return(j=Object(l.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){t.file((function(t){return e(t)}))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return m.apply(this,arguments)}function m(){return(m=Object(l.a)(s.a.mark((function e(t){var n,a,c,r,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(n=[],a=[],c=0;c<t.length;c+=1)a.push(t[c].webkitGetAsEntry());case 3:if(!(a.length>0)){e.next=23;break}if(!(null===(r=a.shift())||void 0===r?void 0:r.isFile)){e.next=12;break}return e.next=8,p(r);case 8:i=e.sent,n.push(i),e.next=21;break;case 12:if(!(null===r||void 0===r?void 0:r.isDirectory)){e.next=21;break}return e.t0=a.push,e.t1=a,e.t2=f.a,e.next=18,x(r.createReader());case 18:e.t3=e.sent,e.t4=(0,e.t2)(e.t3),e.t0.apply.call(e.t0,e.t1,e.t4);case 21:e.next=3;break;case 23:return e.abrupt("return",n);case 24:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return O.apply(this,arguments)}function O(){return(O=Object(l.a)(s.a.mark((function e(t){var n,a;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,g(t);case 3:a=e.sent;case 4:if(!(a.length>0)){e.next=11;break}return n.push.apply(n,Object(f.a)(a)),e.next=8,g(t);case 8:a=e.sent,e.next=4;break;case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return w.apply(this,arguments)}function w(){return(w=Object(l.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.readEntries(e,n)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(){return(y=Object(l.a)(s.a.mark((function e(t){var n;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,v(t.dataTransfer.items);case 3:n=e.sent,i(!1),d(n[0]);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return Object(b.jsx)("label",{htmlFor:h,className:"block w-full h-full group relative cursor-pointer rounded-md font-medium focus-within:outline-none",children:Object(b.jsxs)("div",{className:["w-full h-full flex items-center justify-center px-6 pt-5 pb-6 text-md","border-2 border-dashed rounded-md","hover:border-black hover:bg-primary","text-center",r?"border-black bg-primary":"bg-gray-100 border-gray-300"].join(" "),onDrop:function(e){return y.apply(this,arguments)},onDragOver:function(e){e.stopPropagation(),e.preventDefault(),i(!0)},onDragLeave:function(){return i(!1)},children:[Object(b.jsx)("input",{id:h,name:h,type:"file",className:"sr-only",onChange:function(e){var t,n=null===(t=e.currentTarget.files)||void 0===t?void 0:t[0];n&&d(n)},accept:"image/png, image/jpeg"}),Object(b.jsx)("p",{className:"hidden sm:block",children:"Click here or drag an image file"}),Object(b.jsx)("p",{className:"sm:hidden",children:"Tap here to load your picture"})]})})}var v=n(25),m=n(12);function x(e){var t=e.children,n=e.onClose,c=e.className,r=Object(a.useRef)(null);return Object(v.a)(r,(function(){null===n||void 0===n||n()})),Object(m.a)("Escape",n,{event:"keydown"}),Object(b.jsx)("div",{className:["absolute w-full h-full flex justify-center items-center","z-20","bg-gray-300 bg-opacity-40 backdrop-filter backdrop-blur-md"].join(" "),children:Object(b.jsxs)("div",{ref:r,className:"bg-white max-w-4xl relative rounded-md shadow-md ".concat(c||"p-8 sm:p-12"),children:[Object(b.jsx)(p,{icon:Object(b.jsx)(u.e,{className:"w-6 h-6"}),className:["absolute right-4 top-4 rounded-full bg-gray-100 w-10 h-10","flex justify-center items-center py-0 px-0 sm:px-0"].join(" "),onClick:n}),t]})})}function O(e){var t=e.children,n=e.content;return Object(b.jsxs)("div",{className:"h-full flex flex-row space-x-6 justify-between",children:[Object(b.jsx)("div",{className:"mr-12 border-2 rounded-xl px-2 py-1",children:t}),Object(b.jsx)("div",{className:"flex flex-col justify-center",children:n})]})}function g(e){var t=e.onClose;return Object(b.jsx)(x,{onClose:t,className:"h-full sm:h-auto p-0 sm:p-0",children:Object(b.jsx)("div",{className:"h-full sm:h-auto flex flex-col sm:flex-row",children:Object(b.jsxs)("div",{className:"flex sm:p-14 flex flex-col justify-center space-y-6",children:[Object(b.jsx)(O,{content:"Enable multi-stroke mask drawing",children:Object(b.jsx)("p",{children:"Hold Cmd/Ctrl"})}),Object(b.jsx)(O,{content:"Undo inpainting",children:Object(b.jsx)("p",{children:"Cmd/Ctrl + z"})}),Object(b.jsx)(O,{content:"Pan",children:Object(b.jsx)("p",{children:"Space & Drag"})}),Object(b.jsx)(O,{content:"View original image",children:Object(b.jsx)("p",{children:"Hold Tab"})}),Object(b.jsx)(O,{content:"Reset zoom/pan & Cancel mask drawing",children:Object(b.jsx)("p",{children:"Esc"})}),Object(b.jsx)(O,{content:"Decrease Brush Size",children:Object(b.jsx)("p",{children:"["})}),Object(b.jsx)(O,{content:"Increase Brush Size",children:Object(b.jsx)("p",{children:"]"})})]})})})}var w=n(11),y=n(26),k=n(30);function N(e){for(var t=e.split(",")[0].split(":")[1].split(";")[0],n=atob(e.split(",")[1]),a=[],c=0;c<n.length;c+=1)a.push(n.charCodeAt(c));return new Blob([new Uint8Array(a)],{type:t})}function C(e,t){return new Promise((function(n,a){var c=e.src,r=e;r.onload=n,r.onerror=function(e){r.src=c,a(e)},r.src=t}))}var S="".concat("","/inpaint");function z(e,t,n){return M.apply(this,arguments)}function M(){return M=Object(l.a)(s.a.mark((function e(t,n,a){var c,r,i;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(c=new FormData).append("image",t),r=N(n),c.append("mask",r),void 0===a?c.append("sizeLimit","1080"):c.append("sizeLimit",a),e.next=7,fetch(S,{method:"POST",body:c}).then(function(){var e=Object(l.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t.blob());case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 7:return i=e.sent,e.abrupt("return",URL.createObjectURL(i));case 9:case"end":return e.stop()}}),e)}))),M.apply(this,arguments)}function E(e){var t=e.value,n=e.onChange,a=e.label,c=e.min,r=e.max,i=((r||100)-(c||0))/100;return Object(b.jsxs)("div",{className:"inline-flex items-center space-x-4 text-black",children:[Object(b.jsx)("span",{children:a}),Object(b.jsx)("input",{className:["appearance-none rounded-lg h-4","bg-primary","w-24 md:w-auto"].join(" "),type:"range",step:i,min:c,max:r,value:t,onChange:function(e){e.preventDefault(),e.stopPropagation(),n(parseInt(e.currentTarget.value,10))}})]})}var D=n(28),L=n(15),A=["720","1080","2000","Original"];function H(e){var t=e.value,n=e.originalHeight,c=e.originalWidth,r=e.onChange,i=function(e){if("Original"===e)return"".concat(c,"x").concat(n);var t=parseInt(e,10)/(c>n?c:n);if(c>n){var a=Math.ceil(t*n);return"".concat(e,"x").concat(a)}var r=Math.ceil(t*c);return"".concat(r,"x").concat(e)},s=Object(a.useCallback)((function(){for(var e=c>n?c:n,t=[],a=0;a<A.length;a+=1){var r=A[a];("Original"===r||parseInt(r,10)<=e)&&t.push(r)}return t}),[n,c]),o=Object(a.useCallback)((function(){return-1===s().indexOf(t)?s()[0]:t}),[t,s]);return Object(b.jsx)("div",{className:"w-32",children:Object(b.jsx)(D.a,{value:o(),onChange:r,children:Object(b.jsxs)("div",{className:"relative",children:[Object(b.jsx)(D.a.Options,{style:{top:"-".concat(40*s().length+5,"px")},className:"absolute mb-1 w-full overflow-auto text-base bg-opacity-10 bg-black backdrop-blur rounded-md max-h-60 outline-none sm:text-sm",children:s().map((function(e){return Object(b.jsx)(D.a.Option,{className:function(e){var t=e.active;return"".concat(t?"bg-black bg-opacity-10":"text-gray-900","\n                   cursor-default select-none relative py-2 pl-4 pr-4")},value:e,children:function(t){var n=t.selected;t.active;return Object(b.jsx)(b.Fragment,{children:Object(b.jsx)("span",{className:"".concat(n?"font-medium":"font-normal"," block truncate"),children:i(e)})})}},e)}))}),Object(b.jsxs)(D.a.Button,{onFocus:function(e){e.currentTarget.blur()},className:"relative w-full inline-flex w-full px-4 py-2 text-sm font-medium bg-black rounded-md bg-opacity-10  focus:outline-none ",children:[Object(b.jsx)("span",{className:"block truncate",children:i(o())}),Object(b.jsx)("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none",children:Object(b.jsx)(L.a,{className:"w-5 h-5 text-gray-400","aria-hidden":"true"})})]})]})})})}var T="rgba(189, 255, 1, 0.75)";function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:T;e.strokeStyle=n,e.lineCap="round",e.lineJoin="round",t.forEach((function(t){(null===t||void 0===t?void 0:t.pts.length)&&t.size&&(e.lineWidth=t.size,e.beginPath(),e.moveTo(t.pts[0].x,t.pts[0].y),t.pts.forEach((function(t){return e.lineTo(t.x,t.y)})),e.stroke())}))}function P(e){var t=e.file,n=Object(a.useState)(40),c=Object(o.a)(n,2),r=c[0],i=c[1],h=function(e){var t=Object(a.useState)(new Image),n=Object(o.a)(t,1)[0],c=Object(a.useState)(!1),r=Object(o.a)(c,2),i=r[0],s=r[1];return Object(a.useEffect)((function(){return n.onload=function(){s(!0)},s(!1),n.src=URL.createObjectURL(e),function(){n.onload=null}}),[e,n]),[n,i]}(t),j=Object(o.a)(h,2),v=j[0],x=j[1],O=Object(a.useState)([]),g=Object(o.a)(O,2),N=g[0],S=g[1],M=Object(a.useState)(),D=Object(o.a)(M,2),L=D[0],A=D[1],T=Object(a.useState)((function(){return document.createElement("canvas")})),P=Object(o.a)(T,1)[0],F=Object(a.useState)([{pts:[]}]),W=Object(o.a)(F,2),Z=W[0],R=W[1],U=Object(a.useState)([{pts:[]}]),V=Object(o.a)(U,2),B=V[0],K=V[1],Y=Object(a.useState)([]),J=Object(o.a)(Y,2),X=J[0],G=J[1],$=Object(a.useState)({x:-1,y:-1}),_=Object(o.a)($,2),Q=_[0],q=Q.x,ee=Q.y,te=_[1],ne=Object(a.useState)(!1),ae=Object(o.a)(ne,2),ce=ae[0],re=ae[1],ie=Object(a.useState)(!1),se=Object(o.a)(ie,2),oe=se[0],le=se[1],ue=Object(a.useState)(!1),he=Object(o.a)(ue,2),de=he[0],be=he[1],pe=Object(a.useState)(!1),fe=Object(o.a)(pe,2),je=fe[0],ve=fe[1],me=Object(a.useState)(!1),xe=Object(o.a)(me,2),Oe=xe[0],ge=xe[1],we=Object(a.useState)(1),ye=Object(o.a)(we,2),ke=ye[0],Ne=ye[1],Ce=Object(a.useState)(),Se=Object(o.a)(Ce,2),ze=Se[0],Me=Se[1],Ee=Object(y.a)("sizeLimit","1080"),De=Object(o.a)(Ee,2),Le=De[0],Ae=De[1],He=Object(d.a)(),Te=Object(a.useRef)(),Ie=Object(a.useState)(!1),Pe=Object(o.a)(Ie,2),Fe=Pe[0],We=Pe[1],Ze=Object(a.useState)(!1),Re=Object(o.a)(Ze,2),Ue=Re[0],Ve=Re[1],Be=Object(a.useCallback)((function(){if(L){L.clearRect(0,0,L.canvas.width,L.canvas.height);var e=N[N.length-1];(null===e||void 0===e?void 0:e.src)?L.drawImage(e,0,0,v.naturalWidth,v.naturalHeight):L.drawImage(v,0,0),I(L,B)}}),[L,B,v,N]),Ke=Object(a.useCallback)((function(){if(!(null===L||void 0===L?void 0:L.canvas.width)||!(null===L||void 0===L?void 0:L.canvas.height))throw new Error("canvas has invalid size");P.width=null===L||void 0===L?void 0:L.canvas.width,P.height=null===L||void 0===L?void 0:L.canvas.height;var e=P.getContext("2d");if(!e)throw new Error("could not retrieve mask canvas");I(e,Z,"white")}),[null===L||void 0===L?void 0:L.canvas.height,null===L||void 0===L?void 0:L.canvas.width,Z,P]),Ye=Object(a.useCallback)(Object(l.a)(s.a.mark((function e(){var n,a;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ve(!0),Ke(),e.prev=2,e.next=5,z(t,P.toDataURL(),Le);case 5:if(n=e.sent){e.next=8;break}throw new Error("empty response");case 8:return a=new Image,e.next=11,C(a,n);case 11:N.push(a),Z.push({pts:[]}),S(Object(f.a)(N)),R(Object(f.a)(Z)),X.push(B.length),G(X),B.length=0,K([{pts:[]}]),e.next=24;break;case 21:e.prev=21,e.t0=e.catch(2),alert(e.t0.message?e.t0.message:e.t0.toString());case 24:ve(!1),Be();case 26:case"end":return e.stop()}}),e,null,[[2,21]])}))),[Be,t,Z,B,P,Ke,N,Le,X]),Je=function(){return 0!==B.length&&0!==B[0].pts.length},Xe=function(){return 0!==N.length},Ge=function(){We(!1),B.length=0,K([{pts:[]}])},$e=function(e){return"Control"===e.key||"Meta"===e.key};Object(m.a)($e,(function(){Ue&&(je||(Ve(!1),Je()&&Ye()))}),{event:"keyup"},[je,Ue,Je]),Object(m.a)($e,(function(){je||Ve(!0)}),{event:"keydown"},[je]),Object(a.useEffect)((function(){if(v&&x){var e=He.width/v.naturalWidth,t=(He.height-200)/v.naturalHeight;if(e<1||t<1){var n=Math.min(e,t);Me(n),Ne(n)}else Me(1);(null===L||void 0===L?void 0:L.canvas)&&(L.canvas.width=v.naturalWidth,L.canvas.height=v.naturalHeight),Be()}}),[null===L||void 0===L?void 0:L.canvas,Be,v,x,He]);var _e=Object(a.useCallback)((function(){if(ze&&v&&He){var e=Te.current;if(!e)throw new Error("no viewport");var t=(He.width-v.width*ze)/2,n=(He.height-v.height*ze)/2;e.setTransform(t,n,ze,200,"easeOutQuad"),e.state.scale=ze,Ne(ze)}}),[Te,ze,v,He]);Object(m.a)("Escape",(function(){je||(Fe||Ue?Ge():_e())}),{event:"keydown"},[Fe,je,Ue,_e,Ge]);var Qe=function(e,t){B[B.length-1].pts.push({x:e,y:t}),Z[Z.length-1].pts.push({x:e,y:t}),Be()},qe=function(){if(N.length&&X.length){for(var e=Z,t=X[X.length-1],n=0;n<=t;n+=1)e.pop();R([].concat(Object(f.a)(e),[{pts:[]}])),X.pop(),G(X);var a=N;a.pop(),S(Object(f.a)(a))}};Object(m.a)((function(e){var t=(e.metaKey||e.ctrlKey)&&"z"===e.key;return"Tab"===e.key&&e.preventDefault(),!!t&&(e.preventDefault(),!0)}),qe),Object(k.a)("Tab",(function(e){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),Xe()&&(ge(!0),be(!0))}),(function(e){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),Xe()&&(be(!1),setTimeout((function(){return ge(!1)}),300))}));var et=function(e){e===ce||oe||re(e)},tt=Object(a.useCallback)((function(){return oe?"grab":ce?"none":void 0}),[ce,oe]);Object(k.a)("[",(function(){i((function(e){return e>10?e-10:e<=10&&e>0?e-5:e}))})),Object(k.a)("]",(function(){i((function(e){return e+10}))})),Object(k.a)(" ",(function(e){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),re(!1),le(!0)}),(function(e){null===e||void 0===e||e.preventDefault(),null===e||void 0===e||e.stopPropagation(),re(!0),le(!1)}));return v&&ke&&ze?Object(b.jsxs)("div",{className:"flex flex-col items-center",style:{height:"100%",width:"100%"},"aria-hidden":"true",onMouseMove:function(e){var t=e.nativeEvent;te({x:t.pageX,y:t.pageY})},onMouseUp:function(){if(!oe&&(v.src&&(null===L||void 0===L?void 0:L.canvas)&&!je&&Fe)){if(We(!1),Ue)return Z.push({pts:[]}),R(Object(f.a)(Z)),B.push({pts:[]}),void K(Object(f.a)(B));0!==B.length&&0!==B[0].pts.length&&Ye()}},children:[Object(b.jsx)(w.b,{ref:function(e){e&&(Te.current=e)},panning:{disabled:!oe,velocityDisabled:!0},wheel:{step:.05},centerZoomedOut:!0,alignmentAnimation:{disabled:!0},centerOnInit:!0,limitToBounds:!1,doubleClick:{disabled:!0},initialScale:ze,minScale:ze,onZoom:function(e){Ne(e.state.scale)},children:Object(b.jsx)(w.a,{wrapperStyle:{width:"100%",height:"100%"},contentClass:je?"animate-pulse-fast pointer-events-none transition-opacity":"",children:Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("canvas",{className:"rounded-sm",style:{cursor:tt()},onContextMenu:function(e){e.preventDefault()},onMouseOver:function(){return et(!0)},onFocus:function(){return et(!0)},onMouseLeave:function(){return et(!1)},onMouseDown:function(e){if(!oe&&(v.src&&(null===L||void 0===L?void 0:L.canvas)&&!je)){We(!0),B[B.length-1].size=r,Z[Z.length-1].size=r;var t=e.nativeEvent;Qe(t.offsetX,t.offsetY)}},onMouseMove:function(e){if(!oe&&Fe){var t=e.nativeEvent,n=t.offsetX,a=t.offsetY;Qe(n,a)}},ref:function(e){if(e&&!L){var t=e.getContext("2d");t&&A(t)}}}),Object(b.jsx)("div",{className:["absolute top-0 right-0 pointer-events-none","overflow-hidden","border-primary",Oe?"border-l-4":""].join(" "),style:{width:de?"".concat(Math.round(v.naturalWidth),"px"):"0px",height:v.naturalHeight,transitionProperty:"width, height",transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"300ms"},children:Object(b.jsx)("img",{className:"absolute right-0",src:v.src,alt:"original",width:"".concat(v.naturalWidth,"px"),height:"".concat(v.naturalHeight,"px"),style:{width:"".concat(v.naturalWidth,"px"),height:"".concat(v.naturalHeight,"px"),maxWidth:"none"}})})]})})}),ce&&!je&&!oe&&Object(b.jsx)("div",{className:"hidden sm:block absolute rounded-full border border-primary bg-primary bg-opacity-80 pointer-events-none",style:function(){var e=function(){var e,t,n=ze;return void 0!==(null===(e=Te.current)||void 0===e?void 0:e.state.scale)&&(n=null===(t=Te.current)||void 0===t?void 0:t.state.scale),n}();return{width:"".concat(r*e,"px"),height:"".concat(r*e,"px"),left:"".concat(q,"px"),top:"".concat(ee,"px"),transform:"translate(-50%, -50%)"}}()}),Object(b.jsx)("div",{className:"fixed w-full bottom-0 flex items-center justify-center",style:{height:"90px"},children:Object(b.jsxs)("div",{className:["flex items-center justify-center space-x-6",""].join(" "),children:[Object(b.jsx)(H,{value:Le||"1080",onChange:function(e){Ae(e)},originalWidth:v.naturalWidth,originalHeight:v.naturalHeight}),Object(b.jsx)(E,{label:Object(b.jsx)("span",{children:Object(b.jsx)("span",{className:"hidden md:inline",children:"Brush"})}),min:10,max:150,value:r,onChange:i}),Object(b.jsxs)("div",{children:[Object(b.jsx)(p,{className:"mr-2",icon:Object(b.jsx)(u.b,{className:"w-6 h-6"}),disabled:ke===ze,onClick:_e}),Object(b.jsx)(p,{className:"mr-2",icon:Object(b.jsx)("svg",{width:"19",height:"9",viewBox:"0 0 19 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-6 h-6",children:Object(b.jsx)("path",{d:"M2 1C2 0.447715 1.55228 0 1 0C0.447715 0 0 0.447715 0 1H2ZM1 8H0V9H1V8ZM8 9C8.55228 9 9 8.55229 9 8C9 7.44771 8.55228 7 8 7V9ZM16.5963 7.42809C16.8327 7.92721 17.429 8.14016 17.9281 7.90374C18.4272 7.66731 18.6402 7.07103 18.4037 6.57191L16.5963 7.42809ZM16.9468 5.83205L17.8505 5.40396L16.9468 5.83205ZM0 1V8H2V1H0ZM1 9H8V7H1V9ZM1.66896 8.74329L6.66896 4.24329L5.33104 2.75671L0.331035 7.25671L1.66896 8.74329ZM16.043 6.26014L16.5963 7.42809L18.4037 6.57191L17.8505 5.40396L16.043 6.26014ZM6.65079 4.25926C9.67554 1.66661 14.3376 2.65979 16.043 6.26014L17.8505 5.40396C15.5805 0.61182 9.37523 -0.710131 5.34921 2.74074L6.65079 4.25926Z",fill:"currentColor"})}),onClick:qe,disabled:0===N.length}),Object(b.jsx)(p,{className:"mr-2",icon:Object(b.jsx)(u.d,{className:"w-6 h-6"}),onDown:function(e){e.preventDefault(),ge(!0),be(!0)},onUp:function(){be(!1),setTimeout((function(){return ge(!1)}),300)},disabled:0===N.length,children:void 0}),Object(b.jsx)(p,{icon:Object(b.jsx)(u.c,{className:"w-6 h-6"}),disabled:!N.length,onClick:function(){var e=t.name.replace(/(\.[\w\d_-]+)$/i,"_cleanup$1");!function(e,t){var n=document.createElement("a");n.href=e,n.download=t,n.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),setTimeout((function(){n.remove()}),100)}(N[N.length-1].currentSrc,e)},children:void 0})]}),Object(b.jsx)("div",{className:"absolute bg-black backdrop-blur backdrop-filter bg-opacity-10 rounded-xl",style:{height:"58px",width:"600px",zIndex:-1,marginLeft:"-1px"},children:void 0})]})})]}):Object(b.jsx)(b.Fragment,{})}function F(){return F=Object(l.a)(s.a.mark((function e(){var t,n,a=arguments;return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:"",e.next=3,fetch(t,{method:"GET",cache:"no-cache"});case 3:return n=e.sent,e.abrupt("return",n.json());case 5:case"end":return e.stop()}}),e)}))),F.apply(this,arguments)}document.addEventListener("DOMContentLoaded",(function(){var e=document.location;setInterval((function(){(function(){return F.apply(this,arguments)})(e+"/flaskwebgui-keep-server-alive").then((function(e){return console.log(e)}))}),3e3)}));var W=function(){var e=Object(a.useState)(),t=Object(o.a)(e,2),n=t[0],c=t[1],r=Object(h.a)(!1),i=Object(o.a)(r,2),f=i[0],v=i[1],m=Object(d.a)(),x=function(){var e=Object(a.useState)(),t=Object(o.a)(e,2),n=t[0],c=t[1],r=Object(a.useCallback)((function(){var e=new Headers;e.append("pragma","no-cache"),e.append("cache-control","no-cache"),fetch("/inputimage",{headers:e}).then((function(e){return e.blob()})).then((function(e){if(e&&e.type.startsWith("image")){var t=new File([e],"inputImage");c(t)}}))}),[c]);return Object(a.useEffect)((function(){r()}),[r]),n}();return Object(a.useEffect)((function(){c(x)}),[x]),Object(b.jsxs)("div",{className:"h-full full-visible-h-safari flex flex-col",children:[Object(b.jsxs)("header",{className:"absolute z-10 flex w-full p-1 justify-center sm:justify-between items-center sm:items-start  bg-white backdrop-blur backdrop-filter bg-opacity-30",children:[n?Object(b.jsx)(p,{icon:Object(b.jsx)(u.a,{className:"w-6 h-6"}),onClick:function(){c(void 0)},children:m.width>640?"Start new":void 0}):Object(b.jsx)(b.Fragment,{}),n?Object(b.jsx)(p,{onClick:v,icon:Object(b.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"28",height:"28",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 16 16",children:[Object(b.jsx)("rect",{x:"0",y:"0",width:"16",height:"16",fill:"none",stroke:"none"}),Object(b.jsxs)("g",{fill:"currentColor",children:[Object(b.jsx)("path",{d:"M14 5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h12zM2 4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2H2z"}),Object(b.jsx)("path",{d:"M13 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm0-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm-5 0A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75v-.5zm2 0a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25v-.5zm1 2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm-5-2A.25.25 0 0 1 6.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 6 8.75v-.5zm-2 0A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75v-.5zm-2 0A.25.25 0 0 1 2.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 2 8.75v-.5zm11-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm-2 0a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm-2 0A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75v-.5zm-2 0A.25.25 0 0 1 7.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 7 6.75v-.5zm-2 0A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75v-.5zm-3 0A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 6.75v-.5zm0 4a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zm2 0a.25.25 0 0 1 .25-.25h5.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-5.5a.25.25 0 0 1-.25-.25v-.5z"})]})]})}):Object(b.jsx)(b.Fragment,{})]}),f&&Object(b.jsx)(g,{onClose:v}),Object(b.jsx)("main",{className:["h-full flex flex-1 flex-col sm:items-center sm:justify-center overflow-hidden","items-center justify-center"].join(" "),children:n?Object(b.jsx)(P,{file:n}):Object(b.jsxs)(b.Fragment,{children:[Object(b.jsx)("div",{className:["flex flex-col sm:flex-row items-center","space-y-5 sm:space-y-0 sm:space-x-6 p-5 pt-0 pb-10"].join(" "),children:Object(b.jsx)("div",{className:"max-w-xl flex flex-col items-center sm:items-start p-0 m-0 space-y-5",children:Object(b.jsxs)("h1",{className:"text-center sm:text-left text-xl sm:text-3xl",children:["Image inpainting powered by \ud83e\udd99",Object(b.jsx)("u",{children:Object(b.jsx)("a",{href:"https://github.com/saic-mdal/lama",children:"LaMa"})})]})})}),Object(b.jsx)("div",{className:"h-20 sm:h-52 px-4 w-full",style:{maxWidth:"800px"},children:Object(b.jsx)(j,{onSelection:function(){var e=Object(l.a)(s.a.mark((function e(t){return s.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()})})]})})]})};r.a.render(Object(b.jsx)(W,{}),document.getElementById("root"))}},[[23,1,2]]]);