Current File : /var/www/pediatribu/wp-content/plugins/webp-express/lib/wcfm/index.be5d792e.js
var ue=Object.defineProperty;var G=Object.getOwnPropertySymbols;var he=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable;var Z=(t,e,o)=>e in t?ue(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,K=(t,e)=>{for(var o in e||(e={}))he.call(e,o)&&Z(t,o,e[o]);if(G)for(var o of G(e))pe.call(e,o)&&Z(t,o,e[o]);return t};import{_ as v,o as s,c as d,a as Q,b as r,n as $,d as p,e as q,t as _,p as Y,f as H,r as m,g as w,F as B,h as P,i as x,j as A,k as J,m as ee,V as te,w as S,l as W,q as z,v as I,s as me,u as oe,x as ie,y as ne,z as X,T as fe,A as se,B as ge,C as ve}from"./vendor.fa68d508.js";const ye=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))l(i);new MutationObserver(i=>{for(const n of i)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function o(i){const n={};return i.integrity&&(n.integrity=i.integrity),i.referrerpolicy&&(n.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?n.credentials="include":i.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function l(i){if(i.ep)return;i.ep=!0;const n=o(i);fetch(i.href,n)}};ye();class L{static post(e,o,l){var i=this;window.wcfmoptions.poster(e,o,function(n){l.call(i,n)},function(){console.log("failure")})}}const _e={},we={style:{position:"absolute",width:"0",height:"0"},width:"0",height:"0",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},be=Q(`<defs><symbol id="icon-folder" viewBox="0 0 309.267 309.267"><g><path style="fill:#D0994B;" d="M260.944,43.491H125.64c0,0-18.324-28.994-28.994-28.994H48.323c-10.67,0-19.329,8.65-19.329,19.329
        		v222.286c0,10.67,8.659,19.329,19.329,19.329h212.621c10.67,0,19.329-8.659,19.329-19.329V62.82
        		C280.273,52.15,271.614,43.491,260.944,43.491z"></path><path style="fill:#E4E7E7;" d="M28.994,72.484h251.279v77.317H28.994V72.484z"></path><path style="fill:#F4B459;" d="M19.329,91.814h270.609c10.67,0,19.329,8.65,19.329,19.329l-19.329,164.298
        		c0,10.67-8.659,19.329-19.329,19.329H38.658c-10.67,0-19.329-8.659-19.329-19.329L0,111.143C0,100.463,8.659,91.814,19.329,91.814z
        		"></path></g></symbol><symbol id="icon-unfold" viewBox="0 0 32 32"><path d="M28,14H18V4c0-1.104-0.896-2-2-2s-2,0.896-2,2v10H4c-1.104,0-2,0.896-2,2s0.896,2,2,2h10v10c0,1.104,0.896,2,2,2  s2-0.896,2-2V18h10c1.104,0,2-0.896,2-2S29.104,14,28,14z"></path></symbol><symbol id="icon-fold" viewBox="0 0 24 24"><g fill="none" stroke="#000" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line></g></symbol><symbol id="icon-file" viewBox="0 0 56 56"><g><path style="fill:#E9E9E0;" d="M36.985,0H7.963C7.155,0,6.5,0.655,6.5,1.926V55c0,0.345,0.655,1,1.463,1h40.074
        		c0.808,0,1.463-0.655,1.463-1V12.978c0-0.696-0.093-0.92-0.257-1.085L37.607,0.257C37.442,0.093,37.218,0,36.985,0z"></path><polygon style="fill:#D9D7CA;" points="37.5,0.151 37.5,12 49.349,12 	"></polygon><circle style="fill:#F3D55B;" cx="18.931" cy="14.431" r="4.569"></circle><polygon style="fill:#c5e8e1;" points="6.5,39 17.5,39 49.5,39 49.5,28 39.5,18.5 29,30 23.517,24.517 	"></polygon><path style="fill:#14A085;" d="M48.037,56H7.963C7.155,56,6.5,55.345,6.5,54.537V39h43v15.537C49.5,55.345,48.845,56,48.037,56z"></path><g></g></g></symbol><symbol id="icon-ok" viewBox="0 0 256 256"><g fill="green" stroke="none" transform="translate(0.000000,256.000000) scale(0.100000,-0.100000)"><path d="M1064 2545 c-406 -72 -744 -324 -927 -690 -96 -193 -127 -333 -127 -575 0 -243 33 -387 133 -585 177 -351 518 -606 907 -676 118 -22 393 -17 511 8 110 24 252 78 356 136 327 183 569 525 628 887 19 122 19 338 0 460 -81 498 -483 914 -990 1025 -101 22 -389 28 -491 10z m814 -745 c39 -27 73 -59 77 -70 9 -27 10 -25 -372 -590 -345 -510 -357 -524 -420 -512 -19 4 -98 74 -250 225 -123 121 -225 228 -228 238 -3 10 1 31 9 47 20 40 125 132 149 132 11 0 79 -59 162 -140 79 -77 146 -140 149 -140 3 0 38 48 78 108 95 143 465 678 496 720 35 46 64 42 150 -18z"></path></g></symbol><symbol id="icon-not-available" viewBox="0 0 500.000000 500.000000" preserveAspectRatio="xMidYMid meet"><g fill="#b11010" stroke="none" transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"><path d="M2315 4800 c-479 -35 -928 -217 -1303 -527 -352 -293 -615 -702 -738 -1151 -104 -380 -104 -824 0 -1204 107 -389 302 -724 591 -1013 354 -354 785 -572 1279 -646 196 -30 476 -30 672 0 494 74 925 292 1279 646 354 354 571 784 646 1279 30 197 30 475 0 672 -75 495 -292 925 -646 1279 -289 289 -624 484 -1013 591 -228 62 -528 91 -767 74z m353 -511 c458 -50 874 -272 1170 -624 417 -497 536 -1174 308 -1763 -56 -145 -176 -367 -235 -434 -4 -4 -566 552 -1250 1236 l-1243 1243 94 60 c354 229 754 327 1156 282z m864 -3200 c-67 -59 -289 -179 -434 -235 -946 -366 -2024 172 -2322 1158 -47 155 -66 276 -73 453 -13 362 84 704 290 1023 l60 94 1243 -1243 c684 -684 1240 -1246 1236 -1250z"></path></g></symbol><symbol id="icon-help" viewBox="0 0 400 400" style="enable-background:new 0 0 400 400;" xml:space="preserve"><g><path style="fill:#cccccc;" d="M199.996,0C89.719,0,0,89.72,0,200c0,110.279,89.719,200,199.996,200C310.281,400,400,310.279,400,200
      			C400,89.72,310.281,0,199.996,0z M199.996,373.77C104.187,373.77,26.23,295.816,26.23,200
      			c0-95.817,77.957-173.769,173.766-173.769c95.816,0,173.772,77.953,173.772,173.769
      			C373.769,295.816,295.812,373.77,199.996,373.77z"></path><path style="fill:#000000;" d="M199.996,91.382c-35.176,0-63.789,28.616-63.789,63.793c0,7.243,5.871,13.115,13.113,13.115
      			c7.246,0,13.117-5.873,13.117-13.115c0-20.71,16.848-37.562,37.559-37.562c20.719,0,37.566,16.852,37.566,37.562
      			c0,20.714-16.849,37.566-37.566,37.566c-7.242,0-13.113,5.873-13.113,13.114v45.684c0,7.243,5.871,13.115,13.113,13.115
      			s13.117-5.872,13.117-13.115v-33.938c28.905-6.064,50.68-31.746,50.68-62.427C263.793,119.998,235.176,91.382,199.996,91.382z"></path><path d="M200.004,273.738c-9.086,0-16.465,7.371-16.465,16.462s7.379,16.465,16.465,16.465c9.094,0,16.457-7.374,16.457-16.465
      			S209.098,273.738,200.004,273.738z"></path></g></symbol><symbol id="icon-loading" viewBox="0 0 128 128" xml:space="preserve"><g><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#049046"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(45 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(90 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(135 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(180 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(225 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(270 64 64)"></path><path d="M38.52 33.37L21.36 16.2A63.6 63.6 0 0 1 59.5.16v24.3a39.5 39.5 0 0 0-20.98 8.92z" fill="#c5e8e1" transform="rotate(315 64 64)"></path><animateTransform attributeName="transform" type="rotate" values="0 64 64;45 64 64;90 64 64;135 64 64;180 64 64;225 64 64;270 64 64;315 64 64" calcMode="discrete" dur="720ms" repeatCount="indefinite"></animateTransform></g></symbol><symbol id="icon-trash" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve"><path d="M423.059,45.755h-97.156C321.093,19.757,298.267,0,270.897,0h-29.794c-27.37,0-50.196,19.757-55.006,45.755H88.941c-5.633,0-10.199,4.567-10.199,10.199v62.781c0,5.632,4.566,10.199,10.199,10.199h13.21v372.867c0,5.632,4.566,10.199,10.199,10.199H399.65c5.633,0,10.199-4.567,10.199-10.199V128.934h13.21c5.633,0,10.199-4.567,10.199-10.199V55.954C433.258,50.322,428.692,45.755,423.059,45.755zM241.103,20.398h29.794c16.063,0,29.672,10.706,34.065,25.356h97.926C211.432,31.104,225.04,20.398,241.103,20.398z M389.45,491.602H122.55V128.934H389.45V491.602z M412.861,108.536H99.14V66.153h313.72V108.536z"></path><path d="M256,151.099c-17.359,0-31.481,14.122-31.481,31.48v255.378c0,17.358,14.122,31.481,31.481,31.481s31.481-14.123,31.481-31.481V182.579C287.481,165.22,273.359,151.099,256,151.099z M267.082,437.957c0,6.11-4.972,11.082-11.082,11.082c-6.11,0-11.082-4.972-11.082-11.082V182.579c0-6.11,4.972-11.081,11.082-11.081c6.11,0,11.082,4.971,11.082,11.081V437.957z"></path><path d="M171.938,151.099c-17.359,0-31.481,14.122-31.481,31.48v255.378c0,17.358,14.123,31.481,31.481,31.481c17.359,0,31.481-14.123,31.481-31.481V182.579C203.419,165.22,189.297,151.099,171.938,151.099z M183.021,437.957c0,6.11-4.972,11.082-11.082,11.082s-11.082-4.972-11.082-11.082V182.579c0-6.11,4.972-11.081,11.082-11.081s11.082,4.971,11.082,11.081V437.957z"></path><path d="M340.062,151.099c-17.359,0-31.481,14.122-31.481,31.48v255.378c0,17.358,14.122,31.481,31.481,31.481c17.359,0,31.481-14.123,31.481-31.481V182.579C371.543,165.22,357.421,151.099,340.062,151.099z M351.144,437.957c0,6.11-4.972,11.082-11.082,11.082s-11.082-4.972-11.082-11.082V182.579c0-6.11,4.972-11.081,11.082-11.081s11.082,4.971,11.082,11.081V437.957z"></path><path d="M218.758,79.806H118.735c-5.633,0-10.199,4.567-10.199,10.199c0,5.632,4.566,10.199,10.199,10.199h100.023c5.633,0,10.199-4.567,10.199-10.199C228.957,84.373,224.391,79.806,218.758,79.806z"></path><path d="M259.192,79.806h-5.32c-5.633,0-10.199,4.567-10.199,10.199c0,5.632,4.566,10.199,10.199,10.199h5.32c5.633,0,10.199-4.567,10.199-10.199C269.392,84.373,264.825,79.806,259.192,79.806z"></path></symbol><symbol id="icon-eye" x="0px" y="0px" viewBox="0 0 572.098 572.098" xml:space="preserve"><path d="M99.187,398.999l44.333-44.332c-24.89-15.037-47.503-33.984-66.763-56.379c29.187-33.941,66.053-60.018,106.947-76.426c-6.279,14.002-9.853,29.486-9.853,45.827c0,16.597,3.696,32.3,10.165,46.476l35.802-35.797c-5.698-5.594-9.248-13.36-9.248-21.977c0-17.02,13.801-30.82,30.82-30.82c8.611,0,16.383,3.55,21.971,9.248l32.534-32.534l36.635-36.628l18.366-18.373c-21.206-4.186-42.896-6.469-64.848-6.469c-107.663,0-209.732,52.155-273.038,139.518L0,298.288l13.011,17.957C36.83,349.116,66.151,376.999,99.187,398.999z"></path><path d="M459.208,188.998l-44.854,44.854c30.539,16.071,58.115,37.846,80.986,64.437c-52.167,60.662-128.826,96.273-209.292,96.273c-10.3,0-20.533-0.6-30.661-1.744l-52.375,52.375c26.903,6.887,54.762,10.57,83.036,10.57c107.663,0,209.738-52.154,273.038-139.523l13.011-17.957l-13.011-17.956C532.023,242.995,497.844,212.15,459.208,188.998z"></path><path d="M286.049,379.888c61.965,0,112.198-50.234,112.198-112.199c0-5.588-0.545-11.035-1.335-16.402L269.647,378.56C275.015,379.349,280.461,379.888,286.049,379.888z"></path><path d="M248.815,373.431L391.79,230.455l4.994-4.994l45.796-45.796l86.764-86.77c13.543-13.543,13.543-35.502,0-49.046c-6.77-6.769-15.649-10.159-24.523-10.159s-17.754,3.384-24.522,10.159l-108.33,108.336l-22.772,22.772l-29.248,29.248l-48.14,48.14l-34.456,34.456l-44.027,44.027l-33.115,33.115l-45.056,45.055l-70.208,70.203c-13.543,13.543-13.543,35.502,0,49.045c6.769,6.77,15.649,10.16,24.523,10.16s17.754-3.385,24.523-10.16l88.899-88.898l50.086-50.086L248.815,373.431z"></path></symbol></defs>`,1),ke=[be];function xe(t,e){return s(),d("svg",we,ke)}var Ve=v(_e,[["render",xe]]);const Ce={name:"FileItem",emits:["toggle","select"],props:{item:Object},data(){return{hover:!1,selected:!1}},inject:["wcfm"],methods:{onClick(t){this.selected=!0,this.$emit("select",this)},getWCFM(){return this.wcfm},getFullPath(){for(var t=this.$parent,e=[];t!==null&&t.$parent!==null;)t.item&&e.push(t.item.name),t=t.$parent;return e.pop(),e=e.reverse().join("/"),e=e.replace("//","/"),e},infoClick(){this.getWCFM().displayInfo(this.getFullPath())},convertClick(){this.getWCFM().onConvertClick(this.getFullPath())}}},R=t=>(Y("data-v-4fb0cc48"),t=t(),H(),t),ze={key:0,class:"icon-fold"},Se=R(()=>r("use",{"xlink:href":"#icon-fold"},null,-1)),Me=[Se],Ie={key:1,class:"icon-unfold"},Oe=R(()=>r("use",{"xlink:href":"#icon-unfold"},null,-1)),Te=[Oe],$e=R(()=>r("use",{"xlink:href":"#icon-folder"},null,-1)),Be=[$e],Le={key:2,class:"icon-file"},De=R(()=>r("use",{"xlink:href":"#icon-file"},null,-1)),qe=[De];function Ae(t,e,o,l,i,n){return s(),d("div",{class:$({fileitem:!0,selected:i.selected}),onMouseover:e[2]||(e[2]=a=>i.hover=!0),onMouseleave:e[3]||(e[3]=a=>i.hover=!1),onClick:e[4]||(e[4]=(...a)=>n.onClick&&n.onClick(...a))},[r("p",null,[o.item.isDir?(s(),d("span",{key:0,class:$({"fold-unfold":!0,empty:o.item.isEmpty}),onClick:e[0]||(e[0]=a=>this.$emit("toggle"))},[o.item.isOpen?(s(),d("svg",ze,Me)):p("",!0),o.item.isOpen?p("",!0):(s(),d("svg",Ie,Te))],2)):p("",!0),o.item.isDir?(s(),d("svg",{key:1,class:"icon-folder",onClick:e[1]||(e[1]=a=>this.$emit("toggle"))},Be)):p("",!0),o.item.isDir?p("",!0):(s(),d("svg",Le,qe)),q(" "+_(o.item.nickname||o.item.name),1)])],34)}var Pe=v(Ce,[["render",Ae],["__scopeId","data-v-4fb0cc48"]]);const Ue={name:"FileTree",components:{FileItem:Pe},emits:["select"],props:{item:Object},data(){return{loading:!1}},methods:{load(){var t=this;L.post("get-folder",{path:this.$refs.thefileitem.getFullPath()},function(e){t.loading=!0,t.item.children=e.children.sort(function(o,l){return o.isDir&&!l.isDir?-1:!o.isDir&&l.isDir||o.name>l.name?1:o.name<l.name?-1:0}),t.item.loaded=!0,t.loading=!1})},toggle(){this.item.isOpen=!this.item.isOpen,this.item.loaded||this.load()},onSelect(t){this.$emit("select",t)}},mounted(){let t=this.$refs.thefileitem.getFullPath();(t=="/"||t.indexOf("/")==-1)&&this.toggle()}},je={key:0},Re=r("li",null,"loading...",-1),Fe=[Re],Ne={key:1,class:"tree"};function Ye(t,e,o,l,i,n){const a=m("FileItem"),c=m("FileTree",!0);return s(),d(B,null,[w(a,{ref:"thefileitem",item:o.item,onDblclick:n.toggle,onToggle:n.toggle,onSelect:n.onSelect},null,8,["item","onDblclick","onToggle","onSelect"]),i.loading?(s(),d("ul",je,Fe)):p("",!0),o.item.children!==void 0&&o.item.isOpen?(s(),d("ul",Ne,[(s(!0),d(B,null,P(o.item.children,g=>(s(),d("li",null,[w(c,{item:g,onSelect:n.onSelect},null,8,["item","onSelect"])]))),256))])):p("",!0)],64)}var He=v(Ue,[["render",Ye]]);const We={name:"Files",components:{FileTree:He},emits:["select"],props:{item:Object,statusText:String},methods:{onSelect(t){this.selectedItem&&(this.selectedItem.selected=!1),this.selectedItem=t,this.$emit("select",this.selectedItem.getFullPath(),this.selectedItem.item.isDir)}},data(){return{selected:null}}},Xe={key:1};function Ee(t,e,o,l,i,n){const a=m("FileTree");return s(),d(B,null,[o.item?(s(),x(a,{key:0,item:o.item,onSelect:n.onSelect},null,8,["item","onSelect"])):p("",!0),o.item?p("",!0):(s(),d("div",Xe,_(o.statusText),1))],64)}var Ge=v(We,[["render",Ee]]);const Ze={name:"Modal",emits:["close"],props:{title:{type:String},closeButtonText:{type:String},width:{type:[Number,String],default:"95%"},maxwidth:{type:[Number,String],default:"700px"},alignment:{type:String,default:"center"},height:{type:[Number,String],default:"92%"},maxheight:{type:[Number,String],default:"700px"},valignment:{type:String,default:"center"}},computed:{containerStyle(){let t={width:this.width,"max-width":this.maxwidth,height:this.height,"max-height":this.maxheight};return this.alignment=="center"&&(t.margin="0px auto"),this.alignment=="right"&&(t.position="absolute",t.right="10px"),this.valignment=="center"&&(t.top="50%",t.transform="translateY(-50%)"),this.alignment=="bottom"&&(t.position="absolute",t.bottom="10px"),t}},methods:{onCloseClick(){this.$emit("close")},registerKeyDownEvent(){let t=this;document.onkeydown=function(e){e=e||window.event;var o=!1;"key"in e?o=e.key==="Escape"||e.key==="Esc":o=e.keyCode===27,o&&t.$emit("close")}}},mounted(){this.registerKeyDownEvent()}},Ke={class:"modal-mask"},Qe={class:"modal-wrapper"},Je={class:"title"},et={class:"modal-body"},tt={class:"content"},ot=q(" default body "),it={class:"close-button-with-text"};function nt(t,e,o,l,i,n){return s(),d("div",Ke,[r("div",Qe,[r("div",{class:"modal-container",style:A(n.containerStyle)},[r("a",{class:"close-button",onClick:e[0]||(e[0]=(...a)=>n.onCloseClick&&n.onCloseClick(...a))},"X"),r("div",Je,_(o.title),1),r("div",et,[r("div",tt,[J(t.$slots,"default",{},()=>[ot]),r("div",it,[r("button",{onClick:e[1]||(e[1]=(...a)=>n.onCloseClick&&n.onCloseClick(...a))},_(o.closeButtonText),1)])])])],4)])])}var ae=v(Ze,[["render",nt]]);const st={name:"ZoomSlider",components:{Slider:ee},emits:["update:zoom"],props:{zoom:{type:Number,default:1}},watch:{exp(t,e){this.$emit("update:zoom",2**t)},zoom(t,e){this.exp=Math.log2(t)}},methods:{sliderFormat(t){return Math.round(2**t*100)+"%"}},mounted(){},data(){return{exp:0}}},at={class:"zoom-slider"};function lt(t,e,o,l,i,n){const a=m("Slider");return s(),d("div",at,[w(a,{modelValue:i.exp,"onUpdate:modelValue":e[0]||(e[0]=c=>i.exp=c),min:-4,max:4,width:100,step:-1,format:n.sliderFormat,tooltipPosition:"bottom",orientation:"horizontal"},null,8,["modelValue","format"])])}var rt=v(st,[["render",lt]]);const ct={name:"ImageViewport",components:{VueZoomer:te,ZoomSlider:rt},emits:["update:zoom","update:translateX","update:translateY","load","resize"],props:{src:{type:String},height:{type:Number,default:500},zoom:{type:Number,default:1},scaleZoomRatio:{type:Number},translateX:{type:Number,default:1},translateY:{type:Number,default:1}},data(){return{ratio:1,ro:null}},watch:{height(t,e){var o;((o=this.$refs)==null?void 0:o.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos())},scaleZoomRatio(t){var e;((e=this.$refs)==null?void 0:e.zoomer)&&(this.$refs.zoomer.onWindowResize(),this.$refs.zoomer.refreshContainerPos()),this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio},zoom(t,e){this.isImageReady(),this.$refs.zoomer.scale=t*this.scaleZoomRatio},translateX(t,e){this.$refs.zoomer.translateX!=t&&(this.$refs.zoomer.translateX=t)},translateY(t,e){this.$refs.zoomer.translateY!=t&&(this.$refs.zoomer.translateY=t)}},methods:{getGoodContainerHeight(){var t,e,o;if((e=(t=this.$refs)==null?void 0:t.theimg)==null?void 0:e.naturalWidth){let l=this.$refs.theimg.naturalWidth/this.$refs.theimg.naturalHeight,n=((o=this.$refs.root)==null?void 0:o.offsetWidth)/l;return n>300&&(n=300),n}return 300},updateContainerHeight(){},isImageReady(){var t,e,o;return!(!((e=(t=this.$refs)==null?void 0:t.theimg)==null?void 0:e.naturalWidth)||!((o=this.$refs.root)==null?void 0:o.offsetWidth))},calcScaleZoomRatio(){var l,i;if(!this.isImageReady())return 1;let t=this.$refs.theimg.naturalWidth/((l=this.$refs.root)==null?void 0:l.offsetWidth),e=this.$refs.theimg.naturalHeight/((i=this.$refs.root)==null?void 0:i.offsetHeight),o=Math.max(t,e);return isNaN(o)?1:o},updateRatio(){},updateScale(){this.zoom&&(this.$refs.zoomer.scale=this.zoom*this.scaleZoomRatio)},zoomToFit(){},onImgLoad(){var t,e;((e=(t=this.$refs)==null?void 0:t.theimg)==null?void 0:e.naturalWidth)&&this.$emit("load")},onResize(){this.$emit("resize")},onDoubleTap(){console.log("double tab - zoom to 100%"),this.$emit("update:zoom",1),this.$emit("update:translateX",0),this.$emit("update:translateY",0)}},mounted(){window.ResizeObserver&&(this.ro=new ResizeObserver(this.onResize).observe(this.$refs.root)),this.$refs.zoomer.tapDetector.onDoubleTap(this.onDoubleTap),this.$watch("$refs.zoomer.scale",(t,e)=>{this.isImageReady(),this.$emit("update:zoom",t/this.scaleZoomRatio)}),this.$watch("$refs.zoomer.translateX",(t,e)=>{this.$emit("update:translateX",t)}),this.$watch("$refs.zoomer.translateY",(t,e)=>{this.$emit("update:translateY",t)})},beforeDestroy(){window.ResizeObserver&&this.ro.unobserve(this.$refs.zoomer)}},dt={ref:"root",class:"image-viewport"},ut=["src"],ht={class:"zoom-info"};function pt(t,e,o,l,i,n){const a=m("v-zoomer");return s(),d("div",dt,[w(a,{ref:"zoomer",class:"zoomer",minScale:.1,maxScale:8,onResize:n.onResize,doubleClickToZoom:!1,style:A({height:o.height+"px"}),pivot:"cursor",limitTranslation:!1,lockPanOnNoScale:!1},{default:S(()=>[r("img",{ref:"theimg",src:o.src,onLoad:e[0]||(e[0]=(...c)=>n.onImgLoad&&n.onImgLoad(...c))},null,40,ut)]),_:1},8,["minScale","onResize","style"]),r("div",ht," zoom: "+_(Math.round(o.zoom*100))+"% ",1)],512)}var mt=v(ct,[["render",pt]]);const ft={name:"Variant",components:{ImageViewport:mt},emits:["select","update:zoom","update:translateX","update:translateY","load","resize"],props:{title:{type:String},info:{type:Object},url:{type:String,default:""},height:{type:Number},zoom:{type:Number},scaleZoomRatio:{type:Number},translateX:{type:Number},translateY:{type:Number},variantIndex:{type:Number}},computed:{imageUrl:function(){var t;return(t=this.info)==null?void 0:t.url},filesize:function(){var e;if(!((e=this.info)==null?void 0:e.size))return"";let t=this.info.size;return t<1024?t+" bytes":(t/=1024,t<1024?Math.round(t*10)/10+" kb":(t/=1024,Math.round(t*10)/10+" MB"))}},methods:{onVariantSelect(){this.$emit("select",this.variantIndex)},onLoad(){this.$emit("load")},zoomToFit(){this.$refs.theport.zoomToFit()}},mounted(){this.$watch("$refs.theport.zoom",(t,e)=>{this.$emit("update:zoom",t)}),this.$watch("$refs.theport.translateX",(t,e)=>{this.$emit("update:translateX",t)}),this.$watch("$refs.theport.translateY",(t,e)=>{this.$emit("update:translateY",t)})},data(){return{}}},gt={class:"variant"},vt={class:"header"},yt={class:"title"},_t={class:"size"};function wt(t,e,o,l,i,n){const a=m("ImageViewport");return s(),d("div",gt,[r("div",vt,[r("div",yt,_(o.title),1),r("div",_t,_(n.filesize),1)]),w(a,{ref:"theport",src:n.imageUrl,height:o.height,zoom:o.zoom,"onUpdate:zoom":e[0]||(e[0]=c=>o.zoom=c),scaleZoomRatio:o.scaleZoomRatio,translateX:o.translateX,"onUpdate:translateX":e[1]||(e[1]=c=>o.translateX=c),translateY:o.translateY,"onUpdate:translateY":e[2]||(e[2]=c=>o.translateY=c),onLoad:n.onLoad,onResize:e[3]||(e[3]=c=>this.$emit("resize"))},null,8,["src","height","zoom","scaleZoomRatio","translateX","translateY","onLoad"])])}var le=v(ft,[["render",wt],["__scopeId","data-v-0c38121e"]]);const bt={name:"Variants",components:{Variant:le},emits:["update:zoom","update:translateX","update:translateY"],props:{file:{type:Object},viewport:{type:Object},height:{type:Number},zoom:{type:Number,default:1},translateX:{type:Number,default:0},translateY:{type:Number,default:0}},watch:{file(t,e){}},methods:{onZoomChange(t){this.$emit("update:zoom",t)},onTranslateXChange(t){this.$emit("update:translateX",t)},onTranslateYChange(t){this.$emit("update:translateY",t)},sliderFormat(t){return Math.round(t*100)+"%"},changeImage(){this.imageUrl=="http://localhost:3000/src/assets/dummy.jpg"?this.imageUrl="http://localhost:3000/src/assets/dummy2.jpg":this.imageUrl="http://localhost:3000/src/assets/dummy.jpg",this.selectedVariant=-1},onVariantSelect(t){this.selectedVariant=t}},mounted(){this.$watch("$refs.variants.zoom",(t,e)=>{})},data(){var t="http://localhost:3000/src/assets/200x100.jpg";return{imageUrl:"",selectedVariant:-1,variants:[{title:"Existing conversion",size:732,url:t},{title:"Lossy, q:20",size:35e5,url:t}]}}},re=t=>(Y("data-v-25a3327e"),t=t(),H(),t),kt={class:"variants-component"},xt=re(()=>r("br",null,null,-1)),Vt=re(()=>r("br",null,null,-1)),Ct={class:"variants"};function zt(t,e,o,l,i,n){const a=m("Variant");return s(),d("div",kt,[q(" File: "+_(o.file)+" ",1),r("button",{onClick:e[0]||(e[0]=c=>n.changeImage())},"Change image"),xt,Vt,r("div",Ct,[(s(!0),d(B,null,P(i.variants,(c,g)=>(s(),x(a,{title:c.title,info:c,variantIndex:g,class:$({selected:g==i.selectedVariant}),height:o.height,zoom:o.zoom,"onUpdate:zoom":[e[1]||(e[1]=u=>o.zoom=u),n.onZoomChange],translateX:o.translateX,"onUpdate:translateX":[e[2]||(e[2]=u=>o.translateX=u),n.onTranslateXChange],translateY:o.translateY,"onUpdate:translateY":[e[3]||(e[3]=u=>o.translateY=u),n.onTranslateYChange],onSelect:n.onVariantSelect},null,8,["title","info","variantIndex","class","height","zoom","translateX","translateY","onSelect","onUpdate:zoom","onUpdate:translateX","onUpdate:translateY"]))),256))])])}var St=v(bt,[["render",zt],["__scopeId","data-v-25a3327e"]]);class U{static escape(e){return e.replace(/./gm,function(o){var l=/[0-9a-zA-Z\!\[\]\(\)\*\#]/;return l.test(o.charAt(0))?o.charAt(0):"&#"+o.charCodeAt(0)+";"})}static md2htmlOneLine(e){return e=U.escape(e),e=e.replace(/\[([^[]+)\]\(([^)]+)\)/gm,function(o,l,i){return'<a target="blank" href="'+i+'">'+l+"</a>"}),e=e.replace(/(\*\*[^\*]+\*\*)/gm,function(o){return"<b>"+o.substr(2,o.length-4)+"</b>"}),e=e.replace(/(\*[^\*]+\*)/gm,function(o){return"<i>"+o.substr(1,o.length-2)+"</i>"}),e.substr(0,1)=="#"&&(e.substr(0,2)=="# "&&(e="<h1>"+e.substr(2)+"</h1>"),e.substr(0,3)=="## "&&(e="<h2>"+e.substr(3)+"</h2>"),e.substr(0,4)=="### "&&(e="<h3>"+e.substr(4)+"</h3>"),e.substr(0,5)=="#### "&&(e="<h4>"+e.substr(5)+"</h4>")),e}static md2html(e){e=e.replace(/\r\n/g,`
`);for(var o=e.split(`
`),l=[],i=0;i<o.length;i++)l.push(U.md2htmlOneLine(o[i]));return l.join("<br>")}}const Mt={name:"FileProperties",components:{Variant:le,Variants:St,Modal:ae},props:{file:{type:Object,default:{}}},inject:["wcfm"],computed:{originalMime:function(){var t;return((t=this.originalInfo)==null?void 0:t.mime)?this.originalInfo.mime:""},convertedMime:function(){var t;return((t=this.convertedInfo)==null?void 0:t.mime)?this.convertedInfo.mime:""}},watch:{file(t,e){t.isDir||this.changePath(t.path)}},methods:{onVariantSelect(t){this.selectedVariant=t},onOriginalLoad(){if(this.updateHeight(),this.$refs.original.$refs.theport.calcScaleZoomRatio()>1){let e=this.$refs.original.$refs.theport,o=e.$refs.theimg,l=e.$refs.root,i=o.naturalWidth,n=o.naturalHeight,a=l.offsetWidth,g=this.height/n,u=a/i;this.zoom=Math.min(g,u)}else this.zoom=1;this.translateX=0,this.translateY=0},onOriginalResize(){this.updateHeight()},onConvertClick(){var o;let t=this;this.converting=!0;let e=(o=this.wcfm.$refs.convertOptions)==null?void 0:o.getOptions();t.errorMsg="",L.post("convert",{path:this.path,convertOptions:e},function(l){t.converting=!1,(l==null?void 0:l.success)==!1&&(t.errorMsg=l.data),l.converted&&(t.convertedInfo=l.converted),l.log&&(t.log=U.md2html(l.log))})},onDeleteConvertedClick(){let t=this;L.post("delete-converted",{path:this.path},function(e){(e==null?void 0:e.success)==!1?t.errorMsg=e.data:(t.log="",t.convertedInfo=null)})},updateHeight(){this.$refs.original&&(this.height=this.$refs.original.$refs.theport.getGoodContainerHeight(),this.scaleZoomRatio=this.$refs.original.$refs.theport.calcScaleZoomRatio())},reset(){this.originalInfo=null,this.convertedInfo=null},reload(){this.load()},changePath(t){this.reset(),this.path=t,this.loading=!0,this.errorMsg="",this.log="",this.load()},load(){let t=this;L.post("info",{path:this.path},function(e){(e==null?void 0:e.success)==!1&&(t.errorMsg=e.data),t.loading=!1,t.originalInfo=e.original,e.converted&&(t.convertedInfo=e.converted),e.log&&(t.log=U.md2html(e.log))})}},mounted(){this.file&&(this.path=this.file.path,this.load())},data(){return{zoom:1,scaleZoomRatio:1,translateX:0,translateY:0,height:100,loading:!1,errorMsg:"",originalInfo:null,convertedInfo:null,path:"",log:"",showingLogDialog:!1,converting:!1}}},F=t=>(Y("data-v-1e863e69"),t=t(),H(),t),It={class:"file-properties"},Ot={class:"path"},Tt=q(" Path: "),$t={class:"path"},Bt={key:0,class:"error"},Lt={class:"variant-wrap"},Dt={class:"variant-footer"},qt={class:"variant-wrap"},At={key:0,class:"variant-footer"},Pt=F(()=>r("use",{"xlink:href":"#icon-trash"},null,-1)),Ut=[Pt],jt=["innerHTML"],Rt={key:0},Ft={key:1},Nt={key:0,class:"icon-converting",width:"15",height:"15"},Yt=F(()=>r("use",{"xlink:href":"#icon-loading"},null,-1)),Ht=[Yt],Wt=["disabled"],Xt=F(()=>r("p",null," Above, you see the original image. If it has been converted, you also see the converted image (provided that your browser supports webp). ",-1)),Et=F(()=>r("p",null," You can zoom in on the image, ie using scroll wheel. Both images will zoom, allowing you to compare the quality. Double-click the image to set zoom to 100%. You can also drag the image. ",-1));function Gt(t,e,o,l,i,n){const a=m("Variant"),c=m("Modal"),g=W("tooltip");return s(),d("div",It,[r("div",Ot,[Tt,r("span",$t,_(o.file.path),1)]),i.errorMsg!=""?(s(),d("div",Bt,[r("p",null,"Error: "+_(i.errorMsg),1)])):p("",!0),z(r("div",null,"Getting info...",512),[[I,i.loading]]),r("div",null,[r("div",Lt,[z(w(a,{ref:"original",title:"Original",info:i.originalInfo,height:i.height,zoom:i.zoom,"onUpdate:zoom":e[0]||(e[0]=u=>i.zoom=u),scaleZoomRatio:i.scaleZoomRatio,translateX:i.translateX,"onUpdate:translateX":e[1]||(e[1]=u=>i.translateX=u),translateY:i.translateY,"onUpdate:translateY":e[2]||(e[2]=u=>i.translateY=u),onLoad:n.onOriginalLoad,onResize:n.onOriginalResize},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY","onLoad","onResize"]),[[I,i.originalInfo]]),r("div",Dt,_(n.originalMime),1)]),r("div",qt,[z(w(a,{title:"Existing conversion",info:i.convertedInfo,height:i.height,zoom:i.zoom,"onUpdate:zoom":e[3]||(e[3]=u=>i.zoom=u),scaleZoomRatio:i.scaleZoomRatio,translateX:i.translateX,"onUpdate:translateX":e[4]||(e[4]=u=>i.translateX=u),translateY:i.translateY,"onUpdate:translateY":e[5]||(e[5]=u=>i.translateY=u)},null,8,["info","height","zoom","scaleZoomRatio","translateX","translateY"]),[[I,i.convertedInfo]]),i.convertedInfo?(s(),d("div",At,[q(_(n.convertedMime)+" ",1),z((s(),d("svg",{class:"icon-trash",onClick:e[6]||(e[6]=(...u)=>n.onDeleteConvertedClick&&n.onDeleteConvertedClick(...u))},Ut,512)),[[g,"Delete conversion"]])])):p("",!0)])]),z(w(c,{title:"Conversion log",closeButtonText:"Ok",width:"95vw",maxwidth:"1400px",height:"95vh",onClose:e[7]||(e[7]=u=>i.showingLogDialog=!1)},{default:S(()=>[r("div",{innerHTML:i.log},null,8,jt)]),_:1},512),[[I,i.showingLogDialog]]),r("div",null,[r("button",{onClick:e[8]||(e[8]=(...u)=>n.onConvertClick&&n.onConvertClick(...u))},[i.convertedInfo?(s(),d("span",Rt,"Reconvert")):p("",!0),i.convertedInfo?p("",!0):(s(),d("span",Ft,"Convert"))]),i.converting?(s(),d("svg",Nt,Ht)):p("",!0),i.log!=""?(s(),d("button",{key:1,onClick:e[9]||(e[9]=u=>i.showingLogDialog=!0),class:"log-button",disabled:i.converting},"View conversion log",8,Wt)):p("",!0)]),Xt,Et])}var Zt=v(Mt,[["render",Gt],["__scopeId","data-v-1e863e69"]]);const Kt={name:"FolderProperties",components:{},props:{file:{type:Object,default:{}}},watch:{file(t,e){}}},Qt={class:"folder-properties"},Jt={class:"path"},eo=q(" Path: "),to={class:"path"},oo=r("p",null," You cannot do anything on folders yet. Browse to an image... ",-1);function io(t,e,o,l,i,n){return s(),d("div",Qt,[r("div",Jt,[eo,r("span",to,_(o.file.path),1)]),oo])}var no=v(Kt,[["render",io]]);const so={name:"Group",components:{},props:{modelValue:{},ui:Object,schema:Object},emits:["update:modelValue"],methods:{onLocalChange(){this.$emit("update:modelValue",this.modelValue)}},mounted(){},data(){return{}}},ao={class:"group"},lo={key:0};function ro(t,e,o,l,i,n){return s(),d("div",ao,[o.ui.title?(s(),d("h3",lo,_(o.ui?o.ui.title:""),1)):p("",!0),J(t.$slots,"default",{},void 0,!0)])}var co=v(so,[["render",ro],["__scopeId","data-v-6ea04f9d"]]);const uo={name:"Input",props:{modelValue:{},schema:Object,sensitive:{type:Boolean,default:!1}},computed:{inputType:function(){if(this.dataType=="string")return"text";if(this.dataType=="int"||this.dataType=="float")return"number"},inputClass:function(){return this.dataType=="int"?"small":this.sensitive?"sensitive"+(this.passwordRevealed?" revealed":" obscured"):""},valueAsString:function(){return this.modelValue.toString()},dataType:function(){var t;if((t=this==null?void 0:this.schema)==null?void 0:t.type)switch(this.schema.type[0]){case"integer":return"int";default:return"string"}else return""}},emits:["update:modelValue"],methods:{updateLocalModel(t){this.stringValue=t.toString()},onEyeClick(){this.passwordRevealed=!this.passwordRevealed},onLocalChange(){var o;switch(((o=this==null?void 0:this.schema)==null?void 0:o.type)?this.schema.type[0]:"string"){case"integer":var e=parseInt(this.stringValue,10);this.$emit("update:modelValue",e);break;default:this.$emit("update:modelValue",this.stringValue);break}}},mounted(){this.updateLocalModel(this.modelValue)},watch:{modelValue(t,e){this.updateLocalModel(t)},option(t,e){}},data(){return{stringValue:"",passwordRevealed:!1}}},ho=["type"],po=r("use",{"xlink:href":"#icon-eye"},null,-1),mo=[po];function fo(t,e,o,l,i,n){return s(),d("div",{onInput:e[2]||(e[2]=a=>n.onLocalChange()),class:"autoui-input"},[z(r("input",{type:n.inputType,class:$(n.inputClass),"onUpdate:modelValue":e[0]||(e[0]=a=>i.stringValue=a)},null,10,ho),[[me,i.stringValue]]),o.sensitive?(s(),d("svg",{key:0,class:$({"icon-eye":!0,revealed:i.passwordRevealed}),onClick:e[1]||(e[1]=(...a)=>n.onEyeClick&&n.onEyeClick(...a))},mo,2)):p("",!0)],32)}var go=v(uo,[["render",fo]]);const vo={name:"MultiSelect",components:{VueMultiselect:oe},props:{modelValue:{},schema:Object,ui:Object},emits:["update:modelValue"],computed:{options:function(){var e,o;var t=[];return((e=this==null?void 0:this.schema)==null?void 0:e.enum)&&(t=this.schema.enum),((o=this==null?void 0:this.ui)==null?void 0:o.options)&&(t=this.ui.options),t}},methods:{updateLocalModel(t){var e=t.toString().trim().split(",");e=e.filter(function(o){return o!=""}),this.valueAsArray=e},onLocalChange(){this.$emit("update:modelValue",this.valueAsArray.join(","))}},mounted(){this.updateLocalModel(this.modelValue)},watch:{modelValue(t,e){this.updateLocalModel(t)}},data(){return{valueAsArray:[]}}},yo={key:0},_o={key:0,class:"multiselect__single"},wo={key:1,class:"multiselect__single"},bo={key:2,class:"multiselect__single"};function ko(t,e,o,l,i,n){const a=m("VueMultiselect");return s(),x(a,{modelValue:i.valueAsArray,"onUpdate:modelValue":[e[0]||(e[0]=c=>i.valueAsArray=c),n.onLocalChange],options:n.options,multiple:!0,"close-on-select":!1,"clear-on-select":!1,"preserve-search":!1,"preselect-first":!1,searchable:!1,allowEmpty:!0,placeholder:""},{selection:S(({values:c,search:g,isOpen:u})=>[u?p("",!0):(s(),d("span",yo,[c.length>0&&c.length<n.options.length?(s(),d("span",_o,_(c.join(", ")),1)):p("",!0),c.length==n.options.length?(s(),d("span",wo," all ")):p("",!0),c.length==0&&!u?(s(),d("span",bo," none ")):p("",!0)]))]),_:1},8,["modelValue","options","onUpdate:modelValue"])}var xo=v(vo,[["render",ko]]);const Vo={name:"Select",components:{VueMultiselect:oe},props:{modelValue:{},ui:Object,schema:Object},emits:["update:modelValue"],methods:{updateLocalModel(t){},onLocalChange(){this.$emit("update:modelValue",this.modelValue)}},computed:{options:function(){var e,o;var t=[];return((e=this==null?void 0:this.schema)==null?void 0:e.enum)&&(t=this.schema.enum),((o=this==null?void 0:this.ui)==null?void 0:o.options)&&(t=this.ui.options),t}},mounted(){},watch:{modelValue(t,e){}},data(){return{}}};function Co(t,e,o,l,i,n){const a=m("VueMultiselect");return s(),x(a,{modelValue:o.modelValue,"onUpdate:modelValue":[e[0]||(e[0]=c=>o.modelValue=c),n.onLocalChange],options:n.options,multiple:!1,"close-on-select":!0,"clear-on-select":!1,"preserve-search":!1,"preselect-first":!1,searchable:!1,selectLabel:"",deselectLabel:"",allowEmpty:!1},null,8,["modelValue","options","onUpdate:modelValue"])}var zo=v(Vo,[["render",Co]]);const So={name:"Slider",components:{VueSlider:ee},props:{modelValue:{},ui:Object,schema:Object},emits:["update:modelValue"],methods:{onLocalChange(){this.$emit("update:modelValue",this.modelValue)}},mounted(){},data(){return{}}},Mo={class:"slider"};function Io(t,e,o,l,i,n){const a=m("VueSlider");return s(),d("div",Mo,[w(a,{modelValue:o.modelValue,"onUpdate:modelValue":[e[0]||(e[0]=c=>o.modelValue=c),n.onLocalChange],min:o.schema.minimum,max:o.schema.maximum},null,8,["modelValue","onUpdate:modelValue","min","max"])])}var Oo=v(So,[["render",Io],["__scopeId","data-v-8f297ee6"]]);const To={name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},reverse:{type:Boolean,default:!1},checkedText:{type:String,default:null},uncheckedText:{type:String,default:null},width:{type:[Number,String],default:75},height:{type:[Number,String],default:25},uncheckedBg:{type:String,default:"#939393"},uncheckedBgHover:{type:String,default:"#838383"},checkedBg:{type:String,default:"#0075ff"},checkedBgHover:{type:String,default:"#005cc8"},disabledBg:{type:String,default:"red"},dotColor:{type:String,default:"#fff"},fontSize:{type:[Number,String],default:"12"},checkedColor:{type:String,default:"#fff"},uncheckedColor:{type:String,default:"#fff"},fontWeight:{type:[Number,String],default:"normal"}},emits:["update:modelValue"],data(){return{checked:!0,hovering:!1}},methods:{toggle(){this.checked=!this.checked,this.$emit("update:modelValue",this.checked)}},mounted(){this.checked=this.modelValue},watch:{modelValue(t,e){this.checked=t}},computed:{bgStyle(){var t;return this.disabled?t=this.disabledBg:this.checked?t=this.hovering?this.checkedBgHover:this.checkedBg:t=this.hovering?this.uncheckedBgHover:this.uncheckedBg,{width:`${this.width}px`,height:`${this.height}px`,background:t}},dotStyle(){const t={background:this.dotColor,width:`${this.height-8}px`,height:`${this.height-8}px`,"min-width":`${this.height-8}px`,"min-height":`${this.height-8}px`,"margin-left":this.checked?`${this.width-(this.height-3)}px`:"5px"};return!this.checked&&this.reverse||this.checked&&!this.reverse?t.marginLeft=`${this.width-(this.height-3)}px`:(this.checked&&this.reverse||!this.checked&&!this.reverse)&&(t.marginLeft="5px"),t},textStyle(){const t={"font-weight":this.fontWeight,"font-size":`${this.fontSize}px`,color:this.checked&&!this.disabled?this.checkedColor:this.uncheckedColor,right:this.checked?`${this.height-3}px`:"auto",left:this.checked?"auto":`${this.height-3}px`};return!this.checked&&this.reverse?(t.right=`${this.height-3}px`,t.left="auto"):this.checked&&this.reverse&&(t.left=`${this.height-3}px`,t.right="auto"),t}}},$o=["aria-checked","aria-readonly"];function Bo(t,e,o,l,i,n){return s(),d("span",{class:"vue-toggles",style:A(n.bgStyle),role:"switch",tabindex:"0","aria-checked":i.checked?"true":"false","aria-readonly":o.disabled?"true":"false",onClick:e[0]||(e[0]=a=>o.disabled?null:this.toggle()),onKeyup:[e[1]||(e[1]=ie(ne(a=>o.disabled?null:this.toggle(),["prevent"]),["enter"])),e[2]||(e[2]=ie(ne(a=>o.disabled?null:this.toggle(),["prevent"]),["space"]))],onMouseleave:e[3]||(e[3]=a=>i.hovering=!1),onMouseover:e[4]||(e[4]=a=>i.hovering=!0)},[r("span",{"aria-hidden":"true",style:A(n.dotStyle),class:"dot"},[z(r("span",{style:A(n.textStyle),class:"text"},_(o.checkedText),5),[[I,o.checkedText&&i.checked]]),z(r("span",{style:A(n.textStyle),class:"text"},_(o.uncheckedText),5),[[I,o.uncheckedText&&!i.checked]])],4)],44,$o)}var Lo=v(To,[["render",Bo]]);const Do={name:"HelpIcon",props:{schema:Object,ui:Object},computed:{descriptionParagraphs(){return this.schema.description.split(/\n\n/)}},data(){return{btnDown:""}},methods:{}},qo={class:"help-icon"},Ao=r("svg",{class:"icon"},[r("use",{"xlink:href":"#icon-help"})],-1),Po={class:"menu-inner"},Uo={key:0,class:"buttons"},jo=["href","onMousedown"];function Ro(t,e,o,l,i,n){const a=m("VMenu");return s(),d("div",qo,[w(a,{delay:{show:100,hide:150}},{popper:S(()=>[r("div",Po,[(s(!0),d(B,null,P(n.descriptionParagraphs,c=>(s(),d("p",null,_(c),1))),256)),o.ui.links?(s(),d("div",Uo,[(s(!0),d(B,null,P(o.ui.links,c=>(s(),d("a",{href:c[1],target:"_blank",class:$({"mouse-down":i.btnDown==c[0]}),onMousedown:g=>i.btnDown=c[0],onMouseup:e[0]||(e[0]=g=>i.btnDown=""),onMouseleave:e[1]||(e[1]=g=>i.btnDown="")},_(c[0]),43,jo))),256))])):p("",!0)])]),default:S(()=>[Ao]),_:1})])}var Fo=v(Do,[["render",Ro]]);const No={name:"AutoComponent",components:{Group:co,Input:go,MultiSelect:xo,Select:zo,Slider:Oo,Toggle:Lo,HelpIcon:Fo},props:{ui:Object,modelValue:{},schema:Object,advancedView:Boolean,expressionContext:String},emits:["componentDataChange"],watch:{modelValue(t,e){this.updateLocalModel(t)},ui(){this.updateLocalModel(this.modelValue)},schema(){},localModel(t){this.$emit("componentDataChange",{value:this.localModel,"data-property":this.ui["data-property"]})}},computed:{componentSchema(){return this.ui.hasOwnProperty("data-property")&&this.schema.hasOwnProperty("properties")&&this.schema.properties.hasOwnProperty(this.ui["data-property"])?this.schema.properties[this.ui["data-property"]]:null},enabled(){return(this==null?void 0:this.ui.advanced)&&!this.advancedView?!1:this.displayExpr?this.displayExpr.evaluate(this.expressionContext):!0}},data(){return{localModel:"",displayExpr:null}},mounted(){this.updateLocalModel(this.modelValue),(this==null?void 0:this.ui.display)&&(this.displayExpr=new X(this.ui.display))},methods:{updateLocalModel(t){this.ui.hasOwnProperty("data-property")&&t.hasOwnProperty(this.ui["data-property"])&&(this.localModel=t[this.ui["data-property"]])},onComponentDataChange(t){this.$emit("componentDataChange",t)}}},Yo={key:0,class:"auto-component"},Ho={key:0},Wo={key:3};function Xo(t,e,o,l,i,n){const a=m("HelpIcon"),c=m("Toggle"),g=m("Slider"),u=m("Select"),C=m("MultiSelect"),V=m("Input"),y=m("AutoComponent",!0),D=m("Group");return s(),x(fe,{name:"fade"},{default:S(()=>{var O,T;return[n.enabled&&o.ui.component?(s(),d("div",Yo,[r("div",null,[o.ui.component!="group"?(s(),d("div",Ho,[r("label",null,_((O=n.componentSchema)==null?void 0:O.title),1),((T=n.componentSchema)==null?void 0:T.description)?(s(),x(a,{key:0,schema:n.componentSchema,ui:o.ui},null,8,["schema","ui"])):p("",!0)])):p("",!0),r("div",{class:$("component-"+o.ui.component)},[o.ui.component=="checkbox"?(s(),x(c,{key:0,modelValue:i.localModel,"onUpdate:modelValue":e[0]||(e[0]=b=>i.localModel=b),height:20,width:40},null,8,["modelValue"])):p("",!0),o.ui.component=="slider"?(s(),x(g,{key:1,modelValue:i.localModel,"onUpdate:modelValue":e[1]||(e[1]=b=>i.localModel=b),schema:n.componentSchema},null,8,["modelValue","schema"])):p("",!0),o.ui.component=="select"?(s(),x(u,{key:2,modelValue:i.localModel,"onUpdate:modelValue":e[2]||(e[2]=b=>i.localModel=b),schema:n.componentSchema,ui:o.ui},null,8,["modelValue","schema","ui"])):p("",!0),o.ui.component=="multi-select"?(s(),d("div",Wo,[w(C,{modelValue:i.localModel,"onUpdate:modelValue":e[3]||(e[3]=b=>i.localModel=b),schema:n.componentSchema,ui:o.ui},null,8,["modelValue","schema","ui"])])):p("",!0),o.ui.component=="input"?(s(),x(V,{key:4,modelValue:i.localModel,"onUpdate:modelValue":e[4]||(e[4]=b=>i.localModel=b),schema:n.componentSchema},null,8,["modelValue","schema"])):p("",!0),o.ui.component=="password"?(s(),x(V,{key:5,sensitive:!0,modelValue:i.localModel,"onUpdate:modelValue":e[5]||(e[5]=b=>i.localModel=b),schema:n.componentSchema},null,8,["modelValue","schema"])):p("",!0),o.ui.component=="group"?(s(),x(D,{key:6,modelValue:i.localModel,"onUpdate:modelValue":e[6]||(e[6]=b=>i.localModel=b),schema:n.componentSchema,ui:o.ui},{default:S(()=>[(s(!0),d(B,null,P(o.ui["sub-components"],b=>(s(),x(y,{ui:b,schema:o.schema,modelValue:o.modelValue,advancedView:o.advancedView,expressionContext:o.expressionContext,onComponentDataChange:n.onComponentDataChange},null,8,["ui","schema","modelValue","advancedView","expressionContext","onComponentDataChange"]))),256))]),_:1},8,["modelValue","schema","ui"])):p("",!0)],2)])])):p("",!0)]}),_:1})}var Eo=v(No,[["render",Xo],["__scopeId","data-v-26c389a5"]]);const Go={name:"AutoUI",components:{AutoComponent:Eo},props:{schema:Object,ui:Object,modelValue:{},expressionContext:String,advancedView:{type:Boolean,default:!1},showAdvancedButton:{type:Boolean,default:!0}},computed:{},data(){return{}},mounted(){},methods:{onComponentDataChange(t){this.modelValue[t["data-property"]]=t.value}}},Zo={class:"autoui"},Ko={key:0,class:"view-select"},Qo=["textContent"];function Jo(t,e,o,l,i,n){const a=m("AutoComponent"),c=W("tooltip");return s(),d("div",Zo,[o.showAdvancedButton?(s(),d("div",Ko,[z(r("button",{textContent:_(o.advancedView?"Hide advanced options":"Show advanced options"),onClick:e[0]||(e[0]=g=>o.advancedView=!o.advancedView)},null,8,Qo),[[c,"Swich between advanced view (all available options) and simple view (most used options)"]])])):p("",!0),w(a,{ui:o.ui,schema:o.schema,modelValue:o.modelValue,advancedView:o.advancedView,expressionContext:o.expressionContext,onComponentDataChange:n.onComponentDataChange},null,8,["ui","schema","modelValue","advancedView","expressionContext","onComponentDataChange"])])}var ei=v(Go,[["render",Jo],["__scopeId","data-v-30912c7e"]]);const ti={name:"ConvertOptions2",components:{AutoUI:ei},computed:{tweakpng(){var t,e;return((e=(t=this==null?void 0:this.general)==null?void 0:t.data)==null?void 0:e.tweakpng)==null?!0:this.general.data.tweakpng}},methods:{isOptionSupportedByConverter(t,e){return!e||e=="stack"||!this.unsupportedBy||!this.unsupportedBy[t]?!0:!this.unsupportedBy[t].includes(e)},getOptions(){var V;if(!((V=this==null?void 0:this.general)==null?void 0:V.data))return{};let t=JSON.parse(JSON.stringify(this.general.data)),e=t.converter,o={};for(var l in t)t.hasOwnProperty(l)&&this.isOptionSupportedByConverter(l,e)&&(o[l]=t[l]);if(i!="stack"){for(var i in this.uniqueOptionIds)if(i!=e)for(var n=0;n<this.uniqueOptionIds[i].length;n++){let y=this.uniqueOptionIds[i][n];delete o[y]}}let a=o.tweakpng;if(delete o.tweakpng,delete o.png,!a)return o;let c=this.png.data,g=c.overrides,u={},C=this;return g.forEach(function(y){c[y]!==void 0&&C.isOptionSupportedByConverter(y,e)&&(u[y]=c[y])}),o.png=u,o}},mounted(){var t=this;L.post("conversion-settings",{folder:""},function(e){let o=[],l=[],i=[],n={},a={},c={overrides:["encoding","quality","near-lossless"]},g=[],u=e.options.general,C=e.options.unique;u.push({id:"tweakpng",schema:{title:"Tweak settings for PNG",description:"",type:["boolean"],default:!1},ui:{component:"checkbox","data-property":"tweakpng"},unsupportedBy:[]});let V=u.map(f=>f);for(const f in C)for(let h=0;h<C[f].length;h++){let k=C[f][h];V.push(k)}for(var y=0;y<V.length;y++)g.push(V[y].id);i.push({component:"multi-select","data-property":"overrides",options:g,display:"false"}),n.overrides={title:"Overrides",description:"Select options you want to override for PNG",type:["string"],default:[]};let D={},O=!1,T=[];for(var y=0;y<V.length;y++){let h=V[y];h.schema&&(n[h.id]=h.schema,e.defaults[h.id]?(a[h.id]=e.defaults[h.id],c[h.id]=e.defaults[h.id]):h.schema.default!=null&&(a[h.id]=h.schema.default,c[h.id]=h.schema.default),h.schema.default!=null&&(T[h.id]=h.schema.default)),h.unsupportedBy&&(D[h.id]=h.unsupportedBy)}if(e.defaults.png)for(const[f,h]of Object.entries(e.defaults.png))c[f]!=h&&(c[f]=h,O=!0);for(var y=0;y<u.length;y++){let h=u[y];if(h.ui){let k=h.ui;k["data-property"]=h.id,k.display?(k.display.indexOf("option.encoding")>=0&&(k.display=k.display.replace(/option.encoding/gi,"getOption('encoding')")),k.display='supported("'+h.id+'") && ('+k.display+")"):k.display='supported("'+h.id+'")',o.push(k);let M=Object.assign({},k);M.display?M.display='overriding("'+h.id+'") && ('+M.display+")":M.display='overriding("'+h.id+'")',i.push(M)}}let b=[];for(const f in C){let h={component:"group",title:f+" options","sub-components":[],display:"(option('converter') == '"+f+"') || (option('converter') == 'stack')"};b[f]=[];let k=!1;for(let M=0;M<C[f].length;M++){let j=C[f][M];if(j.ui){let N=j.ui;N["data-property"]=j.id,N.advanced||(k=!0),h["sub-components"].push(N),b[f].push(j.id)}}h.advanced=!k,h["sub-components"].length>0&&l.push(h)}a.tweakpng=O,t.uniqueOptionIds=K({},b),t.general={ui:{component:"group",title:"General","sub-components":o},data:a},t.uniqueUi={component:"group",title:"","sub-components":l},t.png={ui:{component:"group",title:"PNG tweaks","sub-components":i},data:c},t.unsupportedBy=D,t.schema={title:"Options",type:["object"],properties:n};let ce={option:function(f){return t.isOptionSupportedByConverter(f,t.general.data.converter)?t.general.data[f]:T[f]},imageType:"any",supported:function(f){return t.general.data.converter?t.isOptionSupportedByConverter(f,t.general.data.converter):!0}},de={option:function(f){let k=t.png.data.overrides.indexOf("converting")>-1?t.png.data.converter:t.general.data.converter;return t.isOptionSupportedByConverter(f,k)?t.png.data.overrides.indexOf(f)>-1?t.png.data[f]:t.general.data[f]:T[f]},imageType:"png",overriding:function(f){return t.png.data.overrides.indexOf(f)>-1},supported:function(f){return t.general.data.converter?t.isOptionSupportedByConverter(f,t.general.data.converter):!0}};X.setGlobalContext(ce,"general"),X.setGlobalContext(de,"png")})},data(){return{schema:{},general:{ui:{},data:{quality:40,"alpha-quality":65,"auto-limit":!0,"command-line-options":"","skip-these-precompiled-binaries":""}},png:{ui:{},data:{}},advancedView:!1,unsupportedBy:[],uniqueUi:[],uniqueOptionIds:[]}}},oi={class:"convert-options"},ii=["textContent"];function ni(t,e,o,l,i,n){const a=m("AutoUI"),c=W("tooltip");return s(),d("div",oi,[z(r("button",{textContent:_(i.advancedView?"Hide advanced options":"Show advanced options"),onClick:e[0]||(e[0]=g=>i.advancedView=!i.advancedView)},null,8,ii),[[c,"Swich between advanced view (all available options) and simple view (most used options)"]]),w(a,{ui:i.general.ui,schema:i.schema,modelValue:i.general.data,expressionContext:"general",advancedView:i.advancedView,showAdvancedButton:!1},null,8,["ui","schema","modelValue","advancedView"]),z(w(a,{ui:i.png.ui,schema:i.schema,modelValue:i.png.data,expressionContext:"png",advancedView:i.advancedView,showAdvancedButton:!1},null,8,["ui","schema","modelValue","advancedView"]),[[I,n.tweakpng]]),w(a,{ui:i.uniqueUi,schema:i.schema,modelValue:i.general.data,expressionContext:"general",advancedView:i.advancedView,showAdvancedButton:!1},null,8,["ui","schema","modelValue","advancedView"])])}var si=v(ti,[["render",ni]]);const ai={name:"Welcome"},li={class:"welcome"},ri=Q('<div class="headline"><div>Welcome to</div><h3>WebP Convert file manager</h3></div><p> To open a folder, click the &quot;+&quot; sign next to the folder name or double click the folder name </p><p><h4>Whats new?</h4><ul><li> You can now adjust conversion settings. The settings start out with the defaults stored in WebP Express (It will however not start out with Stack converter, but instead with your top active working converter - in order to simplify the UI). The options UI are generated from the option definitions exposed be the WebP Convert library. This means that the UI will always be up-to-date. Note that the WebP Express settings is not quite up-to-date. So you will find conversion settings in this interface, which you will not find in WebP Express settings. Also, this interface has a &quot;Auto-limit&quot; option (advanced option), which is used instead of the quality:auto, max-quality and default-quality settings, which are deprecated. </li></ul></p><p><h4>Whats planned ahead?</h4> I have plenty of ideas, but no planned priority. Ideas: <ul><li>Trigger bulk conversion on folders / mark for background conversion</li><li>Stats on folders</li><li>Display more info on images (dimensions, quality on jpeg and such)</li><li>Interface to allow adjusting quality on a conversion quickly and compare directly</li><li>Compare converters side-by-side (visual quality, result size, conversion time)</li></ul> To support development, you can <a href="https://ko-fi.com/rosell" target="_blank">buy me a cup of coffee</a></p>',4),ci=[ri];function di(t,e,o,l,i,n){return s(),d("div",li,ci)}var ui=v(ai,[["render",di]]);const hi={name:"WCFM",components:{SVGs:Ve,ConvertOptions2:si,FileProperties:Zt,FolderProperties:no,Modal:ae,Files:Ge,Splitpanes:se.exports.Splitpanes,Pane:se.exports.Pane,Welcome:ui},methods:{onConvertCloseClick(){console.log("CLRCL"),this.showConvertOptions=!1},onFileSelect(t,e){this.file={path:t,isDir:e}},displayInfo(t){var e=this;L.post("info",{path:t},function(o){e.selectedInfo=o})}},mounted(){var t=this;L.post("get-folder",{path:""},function(e){t.item=e.children[0]})},data(){return{file:null,selectedItem:null,item:null,treeStatusText:"loading file tree...",selectedInfo:{},showConvertOptions:!1}},provide(){return{wcfm:this}}},pi={class:"wcfm",style:{overflow:"hidden"}},mi={class:"pane-content"},fi={key:0,class:"pane-content"};function gi(t,e,o,l,i,n){const a=m("SVGs"),c=m("Files"),g=m("pane"),u=m("FileProperties"),C=m("FolderProperties"),V=m("Welcome"),y=m("splitpanes"),D=m("ConvertOptions2"),O=m("Modal");return s(),d("div",pi,[w(a),w(y,{class:"default-theme",style:{position:"absolute",top:"0",left:"0"}},{default:S(()=>[w(g,{size:"30"},{default:S(()=>[r("div",mi,[r("div",null,[w(c,{item:i.item,statusText:i.treeStatusText,onSelect:n.onFileSelect},null,8,["item","statusText","onSelect"])])])]),_:1}),w(g,{size:"70",style:{"overflow-y":"auto"}},{default:S(()=>[i.file?(s(),d("div",fi,[i.file.isDir?p("",!0):(s(),x(u,{key:0,file:i.file},null,8,["file"])),i.file.isDir?(s(),x(C,{key:1,file:i.file},null,8,["file"])):p("",!0)])):p("",!0),i.file?p("",!0):(s(),x(V,{key:1}))]),_:1})]),_:1}),r("button",{class:"convertOptionsButton",onClick:e[0]||(e[0]=T=>i.showConvertOptions=!0)},"Conversion options"),z(w(O,{title:"Conversion options",closeButtonText:"Ok",width:"600px",height:"95%",maxheight:"650px",alignment:"right",onClose:n.onConvertCloseClick},{default:S(()=>[w(D,{ref:"convertOptions"},null,512)]),_:1},8,["onClose"]),[[I,i.showConvertOptions]])])}var vi=v(hi,[["render",gi]]);var yi={general:[{id:"converter",schema:{title:"Converter",description:"Conversion method. Cwebp and vips are best. the *magick are nearly as good, but only recent versions supports near-lossless. gd is poor, as it does not support any webp options. For full discussion, check the guide",enum:["cwebp","vips","imagick","gmagick","imagemagick","graphicsmagick","wpc","ffmpeg","ewww","gd","stack"],type:["string"],default:"stack"},ui:{component:"select",links:[["Guide","https://github.com/rosell-dk/webp-convert/blob/master/docs/v1.3/converting/converters.md"]]},sensitive:!1,options:["cwebp","vips","imagick","gmagick","imagemagick","graphicsmagick","wpc","ffmpeg","ewww","gd","stack"]},{id:"encoding",schema:{title:"Encoding",description:'Set encoding for the webp. If you choose "auto", webp-convert will convert to both lossy and lossless and pick the smallest result',enum:["auto","lossy","lossless"],type:["string"],default:"auto"},ui:{component:"select",links:[["Guide","https://github.com/rosell-dk/webp-convert/blob/master/docs/v2.0/converting/introduction-for-converting.md#auto-selecting-between-losslesslossy-encoding"]]},sensitive:!1,options:["auto","lossy","lossless"],unsupportedBy:["ewww","gd","stack"]},{id:"quality",schema:{title:"Quality (Lossy)",description:'Quality for lossy encoding. In case you enable "auto-limit", you can consider this property a maximum quality.',"default-png":85,"default-jpeg":75,oneOf:[{type:"number",minimum:0,maximum:100},{type:"string",enum:["auto"]}],type:["integer","string"],default:75},ui:{component:"slider",display:"option('encoding') != 'lossless'"},unsupportedBy:["stack"]},{id:"auto-limit",schema:{title:"Auto-limit",description:`Enable this option to prevent an unnecessarily high quality setting for low quality jpegs. It works by adjusting quality setting down to the quality of the jpeg. Converting ie a jpeg with quality:50 to ie quality:80 does not get you better quality than converting it to quality:80, but it does get you a much bigger file - so you really should enable this option.

The option is ignored for PNG and never adjusts quality up. 

The feature requires Imagick, ImageMagick or Gmagick in order to detect the quality of the jpeg. 

The option is relative new. Before this option, you could do the same by setting quality to "auto" and specifying a "max-quality" and a "default-quality". These are deprecated now.`,type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0,links:[["Guide","https://github.com/rosell-dk/webp-convert/blob/master/docs/v2.0/converting/introduction-for-converting.md#preventing-unnecessarily-high-quality-setting-for-low-quality-jpegs"]],display:"option('encoding') != 'lossless'"},unsupportedBy:[]},{id:"alpha-quality",schema:{title:"Alpha quality",description:"Quality of alpha channel. Often, there is no need for high quality transparency layer and in some cases you can tweak this all the way down to 10 and save a lot in file size. The option only has effect with lossy encoding, and of course only on images with transparency.",type:["integer"],default:85,minimum:0,maximum:100},ui:{component:"slider",links:[["Guide","https://github.com/rosell-dk/webp-convert/blob/master/docs/v2.0/converting/introduction-for-converting.md#alpha-quality"]],display:"(option('encoding') != 'lossless') && (imageType!='jpeg')"},unsupportedBy:["ffmpeg","ewww","gd","stack"]},{id:"near-lossless",schema:{title:'"Near lossless" quality',description:"This option allows you to get impressively better compression for lossless encoding, with minimal impact on visual quality. The range is 0 (maximum preprocessing) to 100 (no preprocessing). Read the guide for more info.",type:["integer"],default:60,minimum:0,maximum:100},ui:{component:"slider",links:[["Guide","https://github.com/rosell-dk/webp-convert/blob/master/docs/v2.0/converting/introduction-for-converting.md#near-lossless"]],display:"option('encoding') != 'lossy'"},unsupportedBy:["gmagick","graphicsmagick","ffmpeg","ewww","gd","stack"]},{id:"metadata",schema:{title:"Metadata",description:'Determines which metadata that should be copied over to the webp. Setting it to "all" preserves all metadata, setting it to "none" strips all metadata. *cwebp* can take a comma-separated list of which kinds of metadata that should be copied (ie "exif,icc"). *gd* will always remove all metadata and *ffmpeg* will always keep all metadata. The rest can either strip all or keep all (they will keep all, unless the option is set to *none*)',type:["string"],default:"none"},ui:{component:"multi-select",options:["all","none","exif","icc","xmp"]},sensitive:!1,unsupportedBy:["ffmpeg","gd","stack"]},{id:"method",schema:{title:"Reduction effort (0-6)",description:'Controls the trade off between encoding speed and the compressed file size and quality. Possible values range from 0 to 6. 0 is fastest. 6 results in best quality and compression. PS: The option corresponds to the "method" option in libwebp',type:["integer"],default:6,minimum:0,maximum:6},ui:{component:"slider",advanced:!0},unsupportedBy:["ewww","gd","stack"]},{id:"sharp-yuv",schema:{title:"Sharp YUV",description:"Better RGB->YUV color conversion (sharper and more accurate) at the expense of a little extra conversion time.",type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0,links:[["Ctrl.blog","https://www.ctrl.blog/entry/webp-sharp-yuv.html"]]},unsupportedBy:["ffmpeg","ewww","gd","stack"]},{id:"auto-filter",schema:{title:"Auto-filter",description:"Turns auto-filter on. This algorithm will spend additional time optimizing the filtering strength to reach a well-balanced quality. Unfortunately, it is extremely expensive in terms of computation. It takes about 5-10 times longer to do a conversion. A 1MB picture which perhaps typically takes about 2 seconds to convert, will takes about 15 seconds to convert with auto-filter. ",type:["boolean"],default:!1},ui:{component:"checkbox",advanced:!0},unsupportedBy:["vips","ffmpeg","ewww","gd","stack"]},{id:"low-memory",schema:{title:"Low memory",description:"Reduce memory usage of lossy encoding at the cost of ~30% longer encoding time and marginally larger output size. Only effective when the *method* option is 3 or more. Read more in [the docs](https://developers.google.com/speed/webp/docs/cwebp)",type:["boolean"],default:!1},ui:{component:"checkbox",advanced:!0,display:"(option('encoding') != 'lossless') && (option('method')>2)"},unsupportedBy:["ffmpeg","ewww","gd","stack"]},{id:"preset",schema:{title:"Preset",description:'Using a preset will set many of the other options to suit a particular type of source material. It even overrides them. It does however not override the quality option. "none" means that no preset will be set',enum:["none","default","photo","picture","drawing","icon","text"],type:["string"],default:"none"},ui:{component:"select",advanced:!0},sensitive:!1,options:["none","default","photo","picture","drawing","icon","text"],unsupportedBy:["ewww","gd","stack"]}],unique:{cwebp:[{id:"cwebp-use-nice",schema:{title:"Use nice",description:"If *use-nice* is set, it will be examined if the *nice* command is available. If it is, the binary is executed using *nice*. This assigns low priority to the process and will save system resources - but result in slower conversion.",type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"cwebp-try-cwebp",schema:{title:"Try plain cwebp command",description:'If set, the converter will try executing "cwebp -version". In case it succeeds, and the version is higher than those working cwebps found using other methods, the conversion will be done by executing this cwebp.',type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"cwebp-try-discovering-cwebp",schema:{title:"Try discovering cwebp binary",description:'If set, the converter will try to discover installed cwebp binaries using a "which -a cwebp" command, or in case that fails, a "whereis -b cwebp" command. These commands will find cwebp binaries residing in PATH',type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"cwebp-try-common-system-paths",schema:{title:"Try locating cwebp in common system paths",description:'If set, the converter will look for a cwebp binaries residing in common system locations such as "/usr/bin/cwebp". If such exist, it is assumed that they are valid cwebp binaries. A version check will be run on the binaries found (they are executed with the "-version" flag. The cwebp with the highest version found using this method and the other enabled methods will be used for the actual conversion.Note: All methods for discovering cwebp binaries are per default enabled. You can save a few microseconds by disabling some, but it is probably not worth it, as your setup will then become less resilient to system changes.',type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"cwebp-try-supplied-binary-for-os",schema:{title:"Try precompiled cwebp binaries",description:'If set, the converter will try use a precompiled cwebp binary that comes with webp-convert. But only if it has a higher version that those found by other methods. As the library knows the versions of its bundled binaries, no additional time is spent executing them with the "-version" parameter. The binaries are hash-checked before executed. The library btw. comes with several versions of precompiled cwebps because they have different dependencies - some works on some systems and others on others.',type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"cwebp-skip-these-precompiled-binaries",schema:{title:"Skip these precompiled binaries",description:"",type:["string"],default:""},ui:{component:"multi-select",advanced:!0,options:["cwebp-120-linux-x86-64","cwebp-110-linux-x86-64","cwebp-103-linux-x86-64-static","cwebp-061-linux-x86-64"],display:"option('cwebp-try-supplied-binary-for-os') == true"},sensitive:!1},{id:"cwebp-rel-path-to-precompiled-binaries",schema:{title:"Rel path to precompiled binaries",description:"",type:["string"],default:"./Binaries"},ui:{component:"",advanced:!0,display:"option('cwebp-try-supplied-binary-for-os') == true"},sensitive:!0},{id:"cwebp-command-line-options",schema:{title:"Command line options",description:"",type:["string"],default:""},ui:{component:"input",advanced:!0},sensitive:!1}],vips:[],imagick:[],gmagick:[],imagemagick:[{id:"imagemagick-use-nice",schema:{title:"Use nice",description:"If *use-nice* is set, it will be examined if the *nice* command is available. If it is, the binary is executed using *nice*. This assigns low priority to the process and will save system resources - but result in slower conversion.",type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}},{id:"imagemagick-try-common-system-paths",schema:{title:"Try locating ImageMagick in common system paths",description:'If set, the converter will look for a ImageMagick binaries residing in common system locations such as "/usr/bin/convert". If such exist, it is assumed that they are valid ImageMagick binaries. ',type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}}],graphicsmagick:[{id:"graphicsmagick-use-nice",schema:{title:"Use nice",description:"If *use-nice* is set, it will be examined if the *nice* command is available. If it is, the binary is executed using *nice*. This assigns low priority to the process and will save system resources - but result in slower conversion.",type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}}],wpc:[{id:"wpc-api-key",schema:{title:"API key",description:"",type:["string"],default:""},ui:{component:"password",advanced:!1,display:"option('wpc-api-version') != 0"},sensitive:!0},{id:"wpc-secret",schema:{title:"Secret",description:"",type:["string"],default:""},ui:{component:"password",advanced:!1,display:"option('wpc-api-version') == 0"},sensitive:!0},{id:"wpc-api-url",schema:{title:"API url",description:"URL to connect to",type:["string"],default:""},ui:{component:"password",advanced:!1},sensitive:!0},{id:"wpc-api-version",schema:{title:"API version",description:"",type:["integer"],default:2,minimum:0,maximum:2},ui:{component:"select",advanced:!1,options:["0","1","2"]}},{id:"wpc-crypt-api-key-in-transfer",schema:{title:"Crypt API key in transfer",description:"",type:["boolean"],default:!1},ui:{component:"checkbox",advanced:!0,display:"option('wpc-api-version') >= 1"}}],ffmpeg:[{id:"ffmpeg-use-nice",schema:{title:"Use nice",description:"If *use-nice* is set, it will be examined if the *nice* command is available. If it is, the binary is executed using *nice*. This assigns low priority to the process and will save system resources - but result in slower conversion.",type:["boolean"],default:!0},ui:{component:"checkbox",advanced:!0}}],ewww:[{id:"ewww-api-key",schema:{title:"Ewww API key",description:'ewww API key. If you choose "auto", webp-convert will convert to both lossy and lossless and pick the smallest result',type:["string"],default:""},ui:{component:"password"},sensitive:!0},{id:"ewww-check-key-status-before-converting",schema:{title:"Check key status before converting",description:"If enabled, the api key will be validated (relative inexpensive) before trying to convert. For automatic conversions, you should enable it. Otherwise you run the risk that the same files will be uploaded to ewww cloud service over and over again, in case the key has expired. For manually triggered conversions, you can safely disable the option.",type:["boolean"],default:!0},ui:{component:"checkbox"}}],gd:[],stack:[{id:"stack-converters",schema:{title:"Converters",description:"Converters to try, ordered by priority.",sensitive:!0,type:["array"],default:["cwebp","vips","imagick","gmagick","imagemagick","graphicsmagick","wpc","ffmpeg","ewww","gd"]},ui:{component:"multi-select",options:["cwebp","vips","imagick","gmagick","imagemagick","graphicsmagick","wpc","ffmpeg","ewww","gd"],advanced:!0},sensitive:!0},{id:"stack-shuffle",schema:{title:"Shuffle",description:"Shuffles the converter order on each conversion. Can for example be used to spread out requests on multiple cloud converters",type:["boolean"],default:!1},ui:{component:"checkbox",advanced:!0}}]}};const E=ge(vi);E.use(te);E.use(ve,{defaultHtml:!1});window.wcfmoptions||(window.wcfmoptions={},window.wcfmoptions.poster=function(t,e,o,l){switch(t){case"get-folder":switch(e.path){case"":var i={children:[{name:"/",isDir:!0,nickname:"root"}]};break;case"/":var i={children:[{name:"empty-folder",isDir:!0,isEmpty:!0},{name:"file",isDir:!1,isConverted:!0},{name:"aaa",isDir:!1,isConverted:!0},{name:"test-folder",isDir:!0},{name:"file2",isDir:!1,isConverted:!1}]};break;case"/empty-folder":var i={children:[]};break;case"/test-folder":var i={children:[{name:"banana",isDir:!1},{name:"subfolder",isDir:!0},{name:"apple",isDir:!1}]};break;case"/test-folder/subfolder":var i={children:[{name:"file2",isDir:!1},{name:"file1",isDir:!1}]};break;default:l();return}break;case"conversion-settings":var i={options:yi,defaults:{quality:17,"ewww-api-key":"apilapi","wpc-api-key":"bogulogu",png:{encoding:"lossless",quality:90},converter:"vips"},systemStatus:{converterRequirements:{gd:{extensionLoaded:!1,compiledWithWebP:!0}}}};break;case"info":if(e.path=="/file2")var i={original:{size:100,url:"http://localhost:3000/src/assets/200x100.jpg",mime2:"image/jpeg"},converted:{size:70,url:"http://localhost:3000/src/assets/200x100.jpg",mime:"image/webp"},log:`blah blah blah
\rand *more* blah`};else if(e.path=="/file")var i={original:{size:100,url:"http://localhost:3000/src/assets/dummy2.jpg",mime:"image/jpeg"},log:"blah blah *blah*"};else var i={original:{size:100,url:"http://localhost:3000/src/assets/dummy.jpg",mime:"image/jpeg"},converted:{size:70,url:"http://localhost:3000/src/assets/dummy.jpg",mime:"image/webp"},log:"blah blah *blah*"};break;case"convert":if(e.path=="/file2")var i={success:!1,data:"We pretend file2 errors converting...",log:"Oh no!"};else var i={success:!0,converted:{size:26050,url:"http://we0/wordpress/wp-content/uploads/2021/10/Screenshot_2021-10-04_13-43-11.png.webp",mime:"image/webp"},log:`All is *groovy*
next line`};break;case"delete-converted":if(e.path=="/file2")var i={success:!1,data:"We pretend file2 errors deleting..."};else var i={success:!0};break;default:var i="ok";break}o(i)});E.mount("#webpconvert-filemanager");