IOPaint/lama_cleaner/app/build/static/js/main.0a74f667.chunk.js

1 line
36 KiB
JavaScript
Raw Normal View History

2022-04-18 16:19:33 +02:00
(this["webpackJsonplama-cleaner"]=this["webpackJsonplama-cleaner"]||[]).push([[0],{27:function(e,t,n){},30:function(e,t,n){"use strict";n.r(t);var a=n(0),c=n.n(a),i=n(12),r=n.n(i),s=(n(27),n(5)),o=n(2),l=n(33),u=n(4),d=n.n(u),j=n(8);var h=n(3),b=n(31),f=n(9),v=n(1);function p(e){var t=e.minWidth,n=e.chevronDirection,c=e.value,i=e.options,r=e.onChange,s=Object(a.useState)(!1),l=Object(o.a)(s,2),u=l[0],d=l[1],j=Object(a.useRef)(null);Object(b.a)(j,(function(){d(!1)}));return Object(v.jsxs)("div",{className:"selector",ref:j,style:{minWidth:t},children:[Object(v.jsxs)("div",{className:"selector-main",role:"button",onClick:function(){d((function(e){return!e}))},"aria-hidden":"true",children:[Object(v.jsx)("p",{children:c}),Object(v.jsx)("div",{className:"selector-icon",children:"up"===n?Object(v.jsx)(f.e,{}):Object(v.jsx)(f.d,{})})]}),u&&Object(v.jsx)("div",{className:"selector-options",children:i.map((function(e,t){return Object(v.jsx)("div",{className:"selector-option",role:"button",tabIndex:0,onClick:function(e){return function(e,t){var n=e.target.textContent.split("x");r(n[0]),d(!1)}(e)},"aria-hidden":"true",children:e},e)}))})]})}p.defaultProps={minWidth:128,chevronDirection:"down"};var O=p,x=n(6),m=["value","onValue"],g=c.a.forwardRef((function(e,t){var n=e.value,a=e.onValue,c=Object(x.a)(e,m);return Object(v.jsx)("input",Object(h.a)(Object(h.a)({value:n,onInput:function(e){var t=e.target.value.replace(/\D/g,"");null===a||void 0===a||a(t)},className:"number-input"},c),{},{ref:t,type:"text"}))}));var w=function(e){var t=e.title,n=e.desc,a=e.input,c=e.optionDesc,i=e.className;return Object(v.jsxs)("div",{className:"setting-block ".concat(i),children:[Object(v.jsxs)("div",{className:"setting-block-content",children:[Object(v.jsxs)("div",{className:"setting-block-content-title",children:[Object(v.jsx)("span",{children:t}),n&&Object(v.jsx)("span",{className:"setting-block-desc",children:n})]}),a]}),c&&Object(v.jsx)("div",{className:"option-desc",children:c})]})};var y,k=function(e){var t=e.title,n=e.value,a=e.suffix,c=e.onValue;return Object(v.jsx)(w,{className:"sub-setting-block",title:t,input:Object(v.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",gap:"8px"},children:[Object(v.jsx)(g,{style:{width:"80px"},value:"".concat(n),onValue:c}),a&&Object(v.jsx)("span",{children:a})]})})};!function(e){e.ORIGINAL="Original",e.RESIZE="Resize",e.CROP="Crop"}(y||(y={}));var S,C=function(){var e=Object(s.c)(I),t=Object(o.a)(e,2),n=t[0],a=t[1],c=function(e){a((function(t){return Object(h.a)(Object(h.a)({},t),{},{hdStrategy:e})}))},i=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(h.a)(Object(h.a)({},e),{},{hdStrategyResizeLimit:t})}))},r=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(h.a)(Object(h.a)({},e),{},{hdStrategyCropTrigerSize:t})}))},l=function(e){var t=0===e.length?0:parseInt(e,10);a((function(e){return Object(h.a)(Object(h.a)({},e),{},{hdStrategyCropMargin:t})}))},u=function(){return Object(v.jsxs)("div",{children:["Use the original resolution of the picture, suitable for picture size below 2K. Try"," ",Object(v.jsx)("div",{tabIndex:0,role:"button",className:"inline-tip",onClick:function(){return c(y.RESIZE)},children:"Resize Strategy"})," ","if you do not get good results on high resolution images."]})};return Object(v.jsx)(w,{className:"hd-setting-block",title:"High Resolution Strategy",input:Object(v.jsx)(O,{value:n.hdStrategy,options:Object.values(y),onChange:function(e){return c(e)}}),optionDesc:function(){switch(n.hdStrategy){case y.ORIGINAL:return u();case y.CROP:return Object(v.jsxs)("div",{children:[Object(v.jsx)("div",{children:"Crop masking area from the original image to do inpainting, and paste the result back. Mainly for performance and memory reasons on high resolution image."}),Object(v.jsx)(k,{title:"Trigger size",value:"".concat(n.hdStrategyCropTrigerSize),suffix:"pixel",onValue:r}),Object(v.jsx)(k,{title:"Crop margin",value:"".concat(n.hdStrategyCropMargin),suffix:"pixel",onValue:l})]});case y.RESIZE:return Object(v.js