import{i as k,c as O}from"./app-BT68AfZ-.js";import{_ as I}from"./app-CKBPOVnC.js";import{_ as V}from"./app-DokSVapq.js";import{_ as P}from"./app-CKSEN_Rg.js";import{_ as S}from"./app-DQ7IohAF.js";import{r as v,o as a,g as m,a as e,u as t,b as s,w as _,c as d,h as l,d as g,f as p,t as N,e as b}from"./app-DA7OTM4Q.js";import{_ as q}from"./app-a9KqBnqw.js";import{_ as y}from"./app-Daq_vi_n.js";import{_ as R}from"./app-d5h3qGYt.js";import{_ as W}from"./app-CFGyEQZz.js";import{_ as C}from"./app-CmG-mh--.js";import{_ as B}from"./app-B6e5QXOZ.js";import{D}from"./app-DNL2FXPk.js";import"./app-P70ZK_FT.js";import"./app-D5twQdhO.js";import"./app-BotiHebp.js";import"./app-OC5wWJiS.js";import"./app-CnGe5nlE.js";import"./app-Zes_jb7S.js";import"./app-D6fSNcLx.js";import"./app-up4gT9D9.js";import"./app-D29bbm9n.js";import"./app-Dxa5h-uG.js";import"./app-B_5dka6q.js";import"./app-BqY8p2gl.js";import"./app-CQwVTjAx.js";import"./app-KNE_24OY.js";import"./app-DuUYZNNT.js";import"./app-DSiZNBrr.js";import"./app-BkWUIifj.js";import"./app-DEIWLCpe.js";import"./app-BHFzVhjx.js";import"./app-C5ROEzFd.js";import"./app-Bnbo6OlJ.js";import"./app-AbPAjGV5.js";import"./app-C-GI59rl.js";import"./app-CHxME8Sw.js";function j(){k(this),this.success=this.$NotifyReloadSuccess("保存成功")}const E=["value"],G=e("td",{class:"title"},"启用WebP压缩",-1),M={class:"comment"},U={key:0},J=["href"],A={key:1},H=e("td",null,"支持的扩展名",-1),z=e("p",{class:"comment"},"含有这些扩展名的URL将会被转成WebP，不区分大小写。",-1),F=e("td",null,"支持的MimeType",-1),K=e("p",{class:"comment"},"响应的Content-Type里包含这些MimeType的内容将会被转成WebP。",-1),Q=e("td",null,"内容最小长度",-1),X=e("p",{class:"comment"},"0表示不限制，内容长度从文件尺寸或Content-Length中获取。",-1),Y=e("td",null,"内容最大长度",-1),Z=e("p",{class:"comment"},"0表示不限制，内容长度从文件尺寸或Content-Length中获取。",-1),ee=e("td",null,"匹配条件",-1),ne={__name:"HTTPWebPConfigBox",props:["v-webp-config","v-is-location","v-is-group","v-require-cache","minCacheLife"],setup(r){const i=r,{config:o,moreOptionsVisible:u}=function(){let n=i.vWebpConfig;return n==null&&(n={isPrior:!1,isOn:!1,minLength:{count:0,unit:"kb"},maxLength:{count:0,unit:"kb"},mimeTypes:["image/png","image/jpeg","image/bmp","image/x-ico"],extensions:[".png",".jpeg",".jpg",".bmp",".ico"],conds:null}),n.mimeTypes==null&&(n.mimeTypes=[]),n.extensions==null&&(n.extensions=[]),{config:v(n),moreOptionsVisible:v(!1)}}(),h=function(){return(!i.vIsLocation&&!i.vIsGroup||o.value.isPrior)&&o.value.isOn},x=function(n){n.forEach(function(c,f){c.length>0&&c[0]!="."&&(n[f]="."+c)}),o.value.extensions=n},L=function(n){o.value.mimeTypes=n},$=function(){u.value=!u.value},w=function(n){o.value.conds=n},T=window.location.toString().replace("/webp?","/cache?");return(n,c)=>(a(),m("div",null,[e("input",{type:"hidden",name:"webpJSON",value:JSON.stringify(t(o))},null,8,E),s(D,null,{default:_(()=>[n.vIsLocation||n.vIsGroup?(a(),d(R,{key:0,"v-config":t(o)},null,8,["v-config"])):l("",!0),g(e("tbody",null,[e("tr",null,[G,e("td",null,[s(q,{value:"1",modelValue:t(o).isOn,"onUpdate:modelValue":c[0]||(c[0]=f=>t(o).isOn=f)},null,8,["modelValue"]),e("p",M,[p("选中后表示开启自动WebP压缩；图片的宽和高均不能超过16383像素"),n.vRequireCache?(a(),m("span",U,[p("；只有满足 "),e("a",{href:t(T)},"[缓存条件]",8,J),p(" 的图片内容才会被转换")])):l("",!0),n.vRequireCache&&r.minCacheLife>0?(a(),m("span",A,"；最小缓存时间为："+N(r.minCacheLife)+"秒",1)):l("",!0),p("。 ")])])])],512),[[b,!n.vIsLocation&&!n.vIsGroup||t(o).isPrior]]),h()?(a(),d(W,{key:1,onChange:$})):l("",!0),g(e("tbody",null,[e("tr",null,[H,e("td",null,[s(y,{values:t(o).extensions,onChange:x,placeholder:"比如 .html"},null,8,["values"]),z])]),e("tr",null,[F,e("td",null,[s(y,{values:t(o).mimeTypes,onChange:L,placeholder:"比如 text/*"},null,8,["values"]),K])]),e("tr",null,[Q,e("td",null,[s(C,{"v-name":"minLength","v-value":t(o).minLength,"v-unit":"kb"},null,8,["v-value"]),X])]),e("tr",null,[Y,e("td",null,[s(C,{"v-name":"maxLength","v-value":t(o).maxLength,"v-unit":"mb"},null,8,["v-value"]),Z])]),e("tr",null,[ee,e("td",null,[s(B,{"v-conds":t(o).conds,onChange:w},null,8,["v-conds"])])])],512),[[b,h()&&t(u)]])]),_:1})]))}},te={key:0},oe=["value"],ie={key:1},Me={__name:"index",setup(r){const i=O(new j);return(o,u)=>(a(),d(I,{ctx:t(i)},{default:_(()=>[t(i).featureIsOn?(a(),m("div",te,[s(V,{action:"$",onSuccess:t(i).success},{default:_(()=>[e("input",{type:"hidden",name:"webId",value:t(i).webId},null,8,oe),s(ne,{"v-webp-config":t(i).webpConfig,"v-require-cache":t(i).requireCache,"min-cache-life":t(i).minCacheLife},null,8,["v-webp-config","v-require-cache","min-cache-life"]),s(P,{class:"mt-4"})]),_:1},8,["onSuccess"])])):l("",!0),t(i).featureIsOn?l("",!0):(a(),m("div",ie,[s(S)]))]),_:1},8,["ctx"]))}};export{Me as default};
