"use strict";const e=require("../store/index.js"),i=require("../config/index.js"),t=(i="",t="")=>i?0===i.indexOf("http")?i:(""===t&&(t=e.$store("app").info.cdnurl),t+i):"",a={cdn:t,thumb:(i="",a)=>function(i,t){const a=e.$store("app").info.filesystem;if("public"===a)return i;let r=t.width||"200",c=t.height||"200",s=t.mode||"lfit",l=t.quality||90,o=t.gravity||"center",n="",u="",f="",m=r+"x"+c;switch(a){case"aliyun":o||"center"==o||(s="mfit",u="/crop,g_"+gravityFormat("aliyun",o)+",w_"+r+",h_"+c),l>0&&l<100&&(f="/quality,q_"+l),n="x-oss-process=image/resize,m_"+s+",w_"+r+",h_"+c,n+=u+f;break;case"qcloud":let e="thumbnail";switch(("fill"==s||!o&&"center"!=o)&&(e="crop",s="fill",u="/gravity/"+gravityFormat("qcloud",o)),l>0&&l<100&&(f="/rquality/"+l),s){case"lfit":m+=">";break;case"mfit":m="!"+m+"r";case"fill":break;case"pad":m+="/pad/1";break;case"fixed":m+="!"}n="imageMogr2/"+e+"/"+m+u+f;break;case"qiniu":switch(("fill"==s||!o&&"center"!=o)&&(s="mfit",u="/gravity/"+gravityFormat("qiniu",o)+"/crop/"+m),l>0&&l<100&&(f="/quality/"+l),s){case"lfit":case"pad":m+=">";break;case"mfit":m="!"+m+"r";break;case"fill":break;case"fixed":m+="!"}n="imageMogr2/thumbnail/"+m+u+f}return i+"?"+n}(i=t(i),a),static:(e="",a="")=>(""===a&&(a=i.staticUrl),"local"!==a&&(e=t(e,a)),e),css:(e="",a="")=>(""===a&&(a=i.staticUrl),"local"!==a&&(e=t(e,a)),`url(${e})`)};exports.$url=a;
