yk-element-components-v2
Version:
4 lines (3 loc) • 48.6 kB
JavaScript
(function(C,_){typeof exports=="object"&&typeof module<"u"?module.exports=_():typeof define=="function"&&define.amd?define(_):(C=typeof globalThis<"u"?globalThis:C||self,C.index=_())})(this,function(){"use strict";function C(t,e){return function(){return t.apply(e,arguments)}}const{toString:_}=Object.prototype,{getPrototypeOf:K}=Object,X=(t=>e=>{const i=_.call(e);return t[i]||(t[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),w=t=>(t=t.toLowerCase(),e=>X(e)===t),z=t=>e=>typeof e===t,{isArray:O}=Array,F=z("undefined");function ze(t){return t!==null&&!F(t)&&t.constructor!==null&&!F(t.constructor)&&U(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ne=w("ArrayBuffer");function ke(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ne(t.buffer),e}const De=z("string"),U=z("function"),oe=z("number"),G=t=>t!==null&&typeof t=="object",Pe=t=>t===!0||t===!1,k=t=>{if(X(t)!=="object")return!1;const e=K(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},He=w("Date"),Ie=w("File"),je=w("Blob"),Je=w("FileList"),Me=t=>G(t)&&U(t.pipe),We=t=>{const e="[object FormData]";return t&&(typeof FormData=="function"&&t instanceof FormData||_.call(t)===e||U(t.toString)&&t.toString()===e)},qe=w("URLSearchParams"),Ve=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function T(t,e,{allOwnKeys:i=!1}={}){if(t===null||typeof t>"u")return;let s,r;if(typeof t!="object"&&(t=[t]),O(t))for(s=0,r=t.length;s<r;s++)e.call(null,t[s],s,t);else{const o=i?Object.getOwnPropertyNames(t):Object.keys(t),n=o.length;let c;for(s=0;s<n;s++)c=o[s],e.call(null,t[c],c,t)}}function ae(t,e){e=e.toLowerCase();const i=Object.keys(t);let s=i.length,r;for(;s-- >0;)if(r=i[s],e===r.toLowerCase())return r;return null}const le=typeof self>"u"?typeof global>"u"?globalThis:global:self,ce=t=>!F(t)&&t!==le;function Q(){const{caseless:t}=ce(this)&&this||{},e={},i=(s,r)=>{const o=t&&ae(e,r)||r;k(e[o])&&k(s)?e[o]=Q(e[o],s):k(s)?e[o]=Q({},s):O(s)?e[o]=s.slice():e[o]=s};for(let s=0,r=arguments.length;s<r;s++)arguments[s]&&T(arguments[s],i);return e}const Ke=(t,e,i,{allOwnKeys:s}={})=>(T(e,(r,o)=>{i&&U(r)?t[o]=C(r,i):t[o]=r},{allOwnKeys:s}),t),Xe=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Ge=(t,e,i,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},Qe=(t,e,i,s)=>{let r,o,n;const c={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),o=r.length;o-- >0;)n=r[o],(!s||s(n,t,e))&&!c[n]&&(e[n]=t[n],c[n]=!0);t=i!==!1&&K(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},Ze=(t,e,i)=>{t=String(t),(i===void 0||i>t.length)&&(i=t.length),i-=e.length;const s=t.indexOf(e,i);return s!==-1&&s===i},Ye=t=>{if(!t)return null;if(O(t))return t;let e=t.length;if(!oe(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},$e=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&K(Uint8Array)),et=(t,e)=>{const s=(t&&t[Symbol.iterator]).call(t);let r;for(;(r=s.next())&&!r.done;){const o=r.value;e.call(t,o[0],o[1])}},tt=(t,e)=>{let i;const s=[];for(;(i=t.exec(e))!==null;)s.push(i);return s},it=w("HTMLFormElement"),st=t=>t.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(i,s,r){return s.toUpperCase()+r}),ue=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),rt=w("RegExp"),de=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),s={};T(i,(r,o)=>{e(r,o,t)!==!1&&(s[o]=r)}),Object.defineProperties(t,s)},a={isArray:O,isArrayBuffer:ne,isBuffer:ze,isFormData:We,isArrayBufferView:ke,isString:De,isNumber:oe,isBoolean:Pe,isObject:G,isPlainObject:k,isUndefined:F,isDate:He,isFile:Ie,isBlob:je,isRegExp:rt,isFunction:U,isStream:Me,isURLSearchParams:qe,isTypedArray:$e,isFileList:Je,forEach:T,merge:Q,extend:Ke,trim:Ve,stripBOM:Xe,inherits:Ge,toFlatObject:Qe,kindOf:X,kindOfTest:w,endsWith:Ze,toArray:Ye,forEachEntry:et,matchAll:tt,isHTMLForm:it,hasOwnProperty:ue,hasOwnProp:ue,reduceDescriptors:de,freezeMethods:t=>{de(t,(e,i)=>{if(U(t)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const s=t[i];if(!!U(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,e)=>{const i={},s=r=>{r.forEach(o=>{i[o]=!0})};return O(t)?s(t):s(String(t).split(e)),i},toCamelCase:st,noop:()=>{},toFiniteNumber:(t,e)=>(t=+t,Number.isFinite(t)?t:e),findKey:ae,global:le,isContextDefined:ce,toJSONObject:t=>{const e=new Array(10),i=(s,r)=>{if(G(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[r]=s;const o=O(s)?[]:{};return T(s,(n,c)=>{const u=i(n,r+1);!F(u)&&(o[c]=u)}),e[r]=void 0,o}}return s};return i(t,0)}};function m(t,e,i,s,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),s&&(this.request=s),r&&(this.response=r)}a.inherits(m,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const he=m.prototype,fe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{fe[t]={value:t}}),Object.defineProperties(m,fe),Object.defineProperty(he,"isAxiosError",{value:!0}),m.from=(t,e,i,s,r,o)=>{const n=Object.create(he);return a.toFlatObject(t,n,function(u){return u!==Error.prototype},c=>c!=="isAxiosError"),m.call(n,t.message,e,i,s,r),n.cause=t,n.name=t.name,o&&Object.assign(n,o),n};var nt=typeof self=="object"?self.FormData:window.FormData;const ot=nt;function Z(t){return a.isPlainObject(t)||a.isArray(t)}function pe(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function me(t,e,i){return t?t.concat(e).map(function(r,o){return r=pe(r),!i&&o?"["+r+"]":r}).join(i?".":""):e}function at(t){return a.isArray(t)&&!t.some(Z)}const lt=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function ct(t){return t&&a.isFunction(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator]}function D(t,e,i){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new(ot||FormData),i=a.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,E){return!a.isUndefined(E[p])});const s=i.metaTokens,r=i.visitor||d,o=i.dots,n=i.indexes,u=(i.Blob||typeof Blob<"u"&&Blob)&&ct(e);if(!a.isFunction(r))throw new TypeError("visitor must be a function");function l(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(!u&&a.isBlob(h))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?u&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function d(h,p,E){let b=h;if(h&&!E&&typeof h=="object"){if(a.endsWith(p,"{}"))p=s?p:p.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&at(h)||a.isFileList(h)||a.endsWith(p,"[]")&&(b=a.toArray(h)))return p=pe(p),b.forEach(function(V,ni){!(a.isUndefined(V)||V===null)&&e.append(n===!0?me([p],ni,o):n===null?p:p+"[]",l(V))}),!1}return Z(h)?!0:(e.append(me(E,p,o),l(h)),!1)}const f=[],g=Object.assign(lt,{defaultVisitor:d,convertValue:l,isVisitable:Z});function A(h,p){if(!a.isUndefined(h)){if(f.indexOf(h)!==-1)throw Error("Circular reference detected in "+p.join("."));f.push(h),a.forEach(h,function(b,R){(!(a.isUndefined(b)||b===null)&&r.call(e,b,a.isString(R)?R.trim():R,p,g))===!0&&A(b,p?p.concat(R):[R])}),f.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return A(t),e}function ge(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Y(t,e){this._pairs=[],t&&D(t,this,e)}const Ae=Y.prototype;Ae.append=function(e,i){this._pairs.push([e,i])},Ae.toString=function(e){const i=e?function(s){return e.call(this,s,ge)}:ge;return this._pairs.map(function(r){return i(r[0])+"="+i(r[1])},"").join("&")};function ut(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ye(t,e,i){if(!e)return t;const s=i&&i.encode||ut,r=i&&i.serialize;let o;if(r?o=r(e,i):o=a.isURLSearchParams(e)?e.toString():new Y(e,i).toString(s),o){const n=t.indexOf("#");n!==-1&&(t=t.slice(0,n)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class dt{constructor(){this.handlers=[]}use(e,i,s){return this.handlers.push({fulfilled:e,rejected:i,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(s){s!==null&&e(s)})}}const be=dt,we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ht=typeof URLSearchParams<"u"?URLSearchParams:Y,ft=FormData,pt=(()=>{let t;return typeof navigator<"u"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),v={isBrowser:!0,classes:{URLSearchParams:ht,FormData:ft,Blob},isStandardBrowserEnv:pt,protocols:["http","https","file","blob","url","data"]};function mt(t,e){return D(t,new v.classes.URLSearchParams,Object.assign({visitor:function(i,s,r,o){return v.isNode&&a.isBuffer(i)?(this.append(s,i.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function gt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function At(t){const e={},i=Object.keys(t);let s;const r=i.length;let o;for(s=0;s<r;s++)o=i[s],e[o]=t[o];return e}function ve(t){function e(i,s,r,o){let n=i[o++];const c=Number.isFinite(+n),u=o>=i.length;return n=!n&&a.isArray(r)?r.length:n,u?(a.hasOwnProp(r,n)?r[n]=[r[n],s]:r[n]=s,!c):((!r[n]||!a.isObject(r[n]))&&(r[n]=[]),e(i,s,r[n],o)&&a.isArray(r[n])&&(r[n]=At(r[n])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const i={};return a.forEachEntry(t,(s,r)=>{e(gt(s),r,i,0)}),i}return null}const yt={"Content-Type":void 0};function bt(t,e,i){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(i||JSON.stringify)(t)}const P={transitional:we,adapter:["xhr","http"],transformRequest:[function(e,i){const s=i.getContentType()||"",r=s.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return r&&r?JSON.stringify(ve(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(s.indexOf("application/x-www-form-urlencoded")>-1)return mt(e,this.formSerializer).toString();if((c=a.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return D(c?{"files[]":e}:e,u&&new u,this.formSerializer)}}return o||r?(i.setContentType("application/json",!1),bt(e)):e}],transformResponse:[function(e){const i=this.transitional||P.transitional,s=i&&i.forcedJSONParsing,r=this.responseType==="json";if(e&&a.isString(e)&&(s&&!this.responseType||r)){const n=!(i&&i.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(c){if(n)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:v.classes.FormData,Blob:v.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};a.forEach(["delete","get","head"],function(e){P.headers[e]={}}),a.forEach(["post","put","patch"],function(e){P.headers[e]=a.merge(yt)});const $=P,wt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vt=t=>{const e={};let i,s,r;return t&&t.split(`
`).forEach(function(n){r=n.indexOf(":"),i=n.substring(0,r).trim().toLowerCase(),s=n.substring(r+1).trim(),!(!i||e[i]&&wt[i])&&(i==="set-cookie"?e[i]?e[i].push(s):e[i]=[s]:e[i]=e[i]?e[i]+", "+s:s)}),e},Se=Symbol("internals");function L(t){return t&&String(t).trim().toLowerCase()}function H(t){return t===!1||t==null?t:a.isArray(t)?t.map(H):String(t)}function St(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=i.exec(t);)e[s[1]]=s[2];return e}function Et(t){return/^[-_a-zA-Z]+$/.test(t.trim())}function Ee(t,e,i,s){if(a.isFunction(s))return s.call(this,e,i);if(!!a.isString(e)){if(a.isString(s))return e.indexOf(s)!==-1;if(a.isRegExp(s))return s.test(e)}}function xt(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,i,s)=>i.toUpperCase()+s)}function Ut(t,e){const i=a.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+i,{value:function(r,o,n){return this[s].call(this,e,r,o,n)},configurable:!0})})}class I{constructor(e){e&&this.set(e)}set(e,i,s){const r=this;function o(c,u,l){const d=L(u);if(!d)throw new Error("header name must be a non-empty string");const f=a.findKey(r,d);(!f||r[f]===void 0||l===!0||l===void 0&&r[f]!==!1)&&(r[f||u]=H(c))}const n=(c,u)=>a.forEach(c,(l,d)=>o(l,d,u));return a.isPlainObject(e)||e instanceof this.constructor?n(e,i):a.isString(e)&&(e=e.trim())&&!Et(e)?n(vt(e),i):e!=null&&o(i,e,s),this}get(e,i){if(e=L(e),e){const s=a.findKey(this,e);if(s){const r=this[s];if(!i)return r;if(i===!0)return St(r);if(a.isFunction(i))return i.call(this,r,s);if(a.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,i){if(e=L(e),e){const s=a.findKey(this,e);return!!(s&&(!i||Ee(this,this[s],s,i)))}return!1}delete(e,i){const s=this;let r=!1;function o(n){if(n=L(n),n){const c=a.findKey(s,n);c&&(!i||Ee(s,s[c],c,i))&&(delete s[c],r=!0)}}return a.isArray(e)?e.forEach(o):o(e),r}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){const i=this,s={};return a.forEach(this,(r,o)=>{const n=a.findKey(s,o);if(n){i[n]=H(r),delete i[o];return}const c=e?xt(o):String(o).trim();c!==o&&delete i[o],i[c]=H(r),s[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const i=Object.create(null);return a.forEach(this,(s,r)=>{s!=null&&s!==!1&&(i[r]=e&&a.isArray(s)?s.join(", "):s)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,i])=>e+": "+i).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...i){const s=new this(e);return i.forEach(r=>s.set(r)),s}static accessor(e){const s=(this[Se]=this[Se]={accessors:{}}).accessors,r=this.prototype;function o(n){const c=L(n);s[c]||(Ut(r,n),s[c]=!0)}return a.isArray(e)?e.forEach(o):o(e),this}}I.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),a.freezeMethods(I.prototype),a.freezeMethods(I);const S=I;function ee(t,e){const i=this||$,s=e||i,r=S.from(s.headers);let o=s.data;return a.forEach(t,function(c){o=c.call(i,o,r.normalize(),e?e.status:void 0)}),r.normalize(),o}function xe(t){return!!(t&&t.__CANCEL__)}function N(t,e,i){m.call(this,t==null?"canceled":t,m.ERR_CANCELED,e,i),this.name="CanceledError"}a.inherits(N,m,{__CANCEL__:!0});const Ct=null;function _t(t,e,i){const s=i.config.validateStatus;!i.status||!s||s(i.status)?t(i):e(new m("Request failed with status code "+i.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}const Ot=v.isStandardBrowserEnv?function(){return{write:function(i,s,r,o,n,c){const u=[];u.push(i+"="+encodeURIComponent(s)),a.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),a.isString(o)&&u.push("path="+o),a.isString(n)&&u.push("domain="+n),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(i){const s=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function Rt(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Ft(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function Ue(t,e){return t&&!Rt(e)?Ft(t,e):e}const Tt=v.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");let s;function r(o){let n=o;return e&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return s=r(window.location.href),function(n){const c=a.isString(n)?r(n):n;return c.protocol===s.protocol&&c.host===s.host}}():function(){return function(){return!0}}();function Lt(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Nt(t,e){t=t||10;const i=new Array(t),s=new Array(t);let r=0,o=0,n;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),d=s[o];n||(n=l),i[r]=u,s[r]=l;let f=o,g=0;for(;f!==r;)g+=i[f++],f=f%t;if(r=(r+1)%t,r===o&&(o=(o+1)%t),l-n<e)return;const A=d&&l-d;return A?Math.round(g*1e3/A):void 0}}function Ce(t,e){let i=0;const s=Nt(50,250);return r=>{const o=r.loaded,n=r.lengthComputable?r.total:void 0,c=o-i,u=s(c),l=o<=n;i=o;const d={loaded:o,total:n,progress:n?o/n:void 0,bytes:c,rate:u||void 0,estimated:u&&n&&l?(n-o)/u:void 0,event:r};d[e?"download":"upload"]=!0,t(d)}}const j={http:Ct,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(i,s){let r=t.data;const o=S.from(t.headers).normalize(),n=t.responseType;let c;function u(){t.cancelToken&&t.cancelToken.unsubscribe(c),t.signal&&t.signal.removeEventListener("abort",c)}a.isFormData(r)&&v.isStandardBrowserEnv&&o.setContentType(!1);let l=new XMLHttpRequest;if(t.auth){const A=t.auth.username||"",h=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(A+":"+h))}const d=Ue(t.baseURL,t.url);l.open(t.method.toUpperCase(),ye(d,t.params,t.paramsSerializer),!0),l.timeout=t.timeout;function f(){if(!l)return;const A=S.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),p={data:!n||n==="text"||n==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:A,config:t,request:l};_t(function(b){i(b),u()},function(b){s(b),u()},p),l=null}if("onloadend"in l?l.onloadend=f:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(f)},l.onabort=function(){!l||(s(new m("Request aborted",m.ECONNABORTED,t,l)),l=null)},l.onerror=function(){s(new m("Network Error",m.ERR_NETWORK,t,l)),l=null},l.ontimeout=function(){let h=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const p=t.transitional||we;t.timeoutErrorMessage&&(h=t.timeoutErrorMessage),s(new m(h,p.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,l)),l=null},v.isStandardBrowserEnv){const A=(t.withCredentials||Tt(d))&&t.xsrfCookieName&&Ot.read(t.xsrfCookieName);A&&o.set(t.xsrfHeaderName,A)}r===void 0&&o.setContentType(null),"setRequestHeader"in l&&a.forEach(o.toJSON(),function(h,p){l.setRequestHeader(p,h)}),a.isUndefined(t.withCredentials)||(l.withCredentials=!!t.withCredentials),n&&n!=="json"&&(l.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&l.addEventListener("progress",Ce(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",Ce(t.onUploadProgress)),(t.cancelToken||t.signal)&&(c=A=>{!l||(s(!A||A.type?new N(null,t,l):A),l.abort(),l=null)},t.cancelToken&&t.cancelToken.subscribe(c),t.signal&&(t.signal.aborted?c():t.signal.addEventListener("abort",c)));const g=Lt(d);if(g&&v.protocols.indexOf(g)===-1){s(new m("Unsupported protocol "+g+":",m.ERR_BAD_REQUEST,t));return}l.send(r||null)})}};a.forEach(j,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Bt={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let i,s;for(let r=0;r<e&&(i=t[r],!(s=a.isString(i)?j[i.toLowerCase()]:i));r++);if(!s)throw s===!1?new m(`Adapter ${i} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(a.hasOwnProp(j,i)?`Adapter '${i}' is not available in the build`:`Unknown adapter '${i}'`);if(!a.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:j};function te(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new N}function _e(t){return te(t),t.headers=S.from(t.headers),t.data=ee.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Bt.getAdapter(t.adapter||$.adapter)(t).then(function(s){return te(t),s.data=ee.call(t,t.transformResponse,s),s.headers=S.from(s.headers),s},function(s){return xe(s)||(te(t),s&&s.response&&(s.response.data=ee.call(t,t.transformResponse,s.response),s.response.headers=S.from(s.response.headers))),Promise.reject(s)})}const Oe=t=>t instanceof S?t.toJSON():t;function B(t,e){e=e||{};const i={};function s(l,d,f){return a.isPlainObject(l)&&a.isPlainObject(d)?a.merge.call({caseless:f},l,d):a.isPlainObject(d)?a.merge({},d):a.isArray(d)?d.slice():d}function r(l,d,f){if(a.isUndefined(d)){if(!a.isUndefined(l))return s(void 0,l,f)}else return s(l,d,f)}function o(l,d){if(!a.isUndefined(d))return s(void 0,d)}function n(l,d){if(a.isUndefined(d)){if(!a.isUndefined(l))return s(void 0,l)}else return s(void 0,d)}function c(l,d,f){if(f in e)return s(l,d);if(f in t)return s(void 0,l)}const u={url:o,method:o,data:o,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:c,headers:(l,d)=>r(Oe(l),Oe(d),!0)};return a.forEach(Object.keys(t).concat(Object.keys(e)),function(d){const f=u[d]||r,g=f(t[d],e[d],d);a.isUndefined(g)&&f!==c||(i[d]=g)}),i}const Re="1.2.0",ie={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ie[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Fe={};ie.transitional=function(e,i,s){function r(o,n){return"[Axios v"+Re+"] Transitional option '"+o+"'"+n+(s?". "+s:"")}return(o,n,c)=>{if(e===!1)throw new m(r(n," has been removed"+(i?" in "+i:"")),m.ERR_DEPRECATED);return i&&!Fe[n]&&(Fe[n]=!0,console.warn(r(n," has been deprecated since v"+i+" and will be removed in the near future"))),e?e(o,n,c):!0}};function zt(t,e,i){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let r=s.length;for(;r-- >0;){const o=s[r],n=e[o];if(n){const c=t[o],u=c===void 0||n(c,o,t);if(u!==!0)throw new m("option "+o+" must be "+u,m.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new m("Unknown option "+o,m.ERR_BAD_OPTION)}}const se={assertOptions:zt,validators:ie},x=se.validators;class J{constructor(e){this.defaults=e,this.interceptors={request:new be,response:new be}}request(e,i){typeof e=="string"?(i=i||{},i.url=e):i=e||{},i=B(this.defaults,i);const{transitional:s,paramsSerializer:r,headers:o}=i;s!==void 0&&se.assertOptions(s,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),r!==void 0&&se.assertOptions(r,{encode:x.function,serialize:x.function},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let n;n=o&&a.merge(o.common,o[i.method]),n&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),i.headers=S.concat(n,o);const c=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(i)===!1||(u=u&&p.synchronous,c.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let d,f=0,g;if(!u){const h=[_e.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,l),g=h.length,d=Promise.resolve(i);f<g;)d=d.then(h[f++],h[f++]);return d}g=c.length;let A=i;for(f=0;f<g;){const h=c[f++],p=c[f++];try{A=h(A)}catch(E){p.call(this,E);break}}try{d=_e.call(this,A)}catch(h){return Promise.reject(h)}for(f=0,g=l.length;f<g;)d=d.then(l[f++],l[f++]);return d}getUri(e){e=B(this.defaults,e);const i=Ue(e.baseURL,e.url);return ye(i,e.params,e.paramsSerializer)}}a.forEach(["delete","get","head","options"],function(e){J.prototype[e]=function(i,s){return this.request(B(s||{},{method:e,url:i,data:(s||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function i(s){return function(o,n,c){return this.request(B(c||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:n}))}}J.prototype[e]=i(),J.prototype[e+"Form"]=i(!0)});const M=J;class re{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(o){i=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const n=new Promise(c=>{s.subscribe(c),o=c}).then(r);return n.cancel=function(){s.unsubscribe(o)},n},e(function(o,n,c){s.reason||(s.reason=new N(o,n,c),i(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const i=this._listeners.indexOf(e);i!==-1&&this._listeners.splice(i,1)}static source(){let e;return{token:new re(function(r){e=r}),cancel:e}}}const kt=re;function Dt(t){return function(i){return t.apply(null,i)}}function Pt(t){return a.isObject(t)&&t.isAxiosError===!0}function Te(t){const e=new M(t),i=C(M.prototype.request,e);return a.extend(i,M.prototype,e,{allOwnKeys:!0}),a.extend(i,e,null,{allOwnKeys:!0}),i.create=function(r){return Te(B(t,r))},i}const y=Te($);y.Axios=M,y.CanceledError=N,y.CancelToken=kt,y.isCancel=xe,y.VERSION=Re,y.toFormData=D,y.AxiosError=m,y.Cancel=y.CanceledError,y.all=function(e){return Promise.all(e)},y.spread=Dt,y.isAxiosError=Pt,y.AxiosHeaders=S,y.formToJSON=t=>ve(a.isHTMLForm(t)?new FormData(t):t),y.default=y;const W=y,fi="";function q(t,e,i,s,r,o,n,c){var u=typeof t=="function"?t.options:t;e&&(u.render=e,u.staticRenderFns=i,u._compiled=!0),s&&(u.functional=!0),o&&(u._scopeId="data-v-"+o);var l;if(n?(l=function(g){g=g||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!g&&typeof __VUE_SSR_CONTEXT__<"u"&&(g=__VUE_SSR_CONTEXT__),r&&r.call(this,g),g&&g._registeredComponents&&g._registeredComponents.add(n)},u._ssrRegister=l):r&&(l=c?function(){r.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:r),l)if(u.functional){u._injectStyles=l;var d=u.render;u.render=function(A,h){return l.call(h),d(A,h)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:u}}const Ht={props:{validateCover:{type:Boolean,default:!1},orCropper:{type:Boolean,default:!1},value:{type:Array,default(){return[]}},accept:{type:String,default:".jpg,.jpeg,.png"},maxSize:{type:String,default:"300k"},coverWidth:{type:Number,default:750},coverHeight:{type:Number,default:422},cropBoxResizable:{type:Boolean,default:!1},guides:{type:Boolean,default:!1},aspectRatio:{type:String,default:"750/422"},getCoverUploadInfo:Function,uploadService:{type:String,default:"huawei"}},data(){return{loading:null,fileList:[],uploadImgUrl:"",viewUrl:"",sendContentType:"",sendAuthorization:"",sendXAmzDate:""}},mounted(){this.fileList=this.value},methods:{handleSize(){const t=this.maxSize.toLowerCase();let e=0;return t.indexOf("k")>=0&&(e=Number(t.substr(0,t.indexOf("k")))),t.indexOf("m")>=0&&(e=Number(t.substr(0,t.indexOf("m")))*1024),e},getPath(t){let i=new URL(t).pathname;return i.substring(1,i.length)},handleUploadSuccess(t,e){this.fileList=[{path:this.getPath(this.viewUrl),url:this.viewUrl,id:e.file.uid,name:e.file.name}],this.$emit("input",this.fileList),this.loading.close()},async handleBeforeUpload(t){const i=this.accept.replaceAll(".","").split(",");if(!i.find(u=>t.type.indexOf(u)!=-1)&&this.accept!=""){let u="";return i.forEach((l,d)=>{u+=d+1==i.length?l:l+"/"}),this.$message.error(`\u4E0A\u4F20\u89C6\u9891\u53EA\u80FD\u662F ${u} \u683C\u5F0F!`),!1}const r=this.handleSize();if(!(t.size/1024<r))return this.$message.error(`\u4E0A\u4F20\u5C01\u9762\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${this.maxSize}!`),!1;if(this.validateCover){let u=await this.getSize(t);if(u.width!=this.coverWidth||u.height!=this.coverHeight)return this.$message.error(`\u4E0A\u4F20\u5C01\u9762\u56FE\u7247\u7684\u5BBD\u9AD8\u5E94\u4E3A${this.coverWidth}*${this.coverHeight}\u50CF\u7D20!`),!1}const n=t.type.replace("image/",""),c=await this.getCoverUploadInfo(n,t);if(!c)return!1;this.uploadService==="huawei"?(this.uploadImgUrl=c.data.signedUrl,this.viewUrl=c.data.viewUrl):this.uploadService==="huayun"&&(this.uploadImgUrl=c.data.viewUrl,this.viewUrl=c.data.viewUrl,this.sendContentType=c.data.contentType,this.sendAuthorization=c.data.amzSignature,this.sendXAmzDate=c.data.amzDate),this.loading=this.$loading({lock:!0,text:"\u4E0A\u4F20\u4E2D",background:"rgba(0, 0, 0, 0.7)"})},handleUploadError(){this.$message({type:"error",message:"\u5C01\u9762\u4E0A\u4F20\u5931\u8D25"}),this.loading.close()},upload(t){if(this.uploadService==="huayun"){const e={"Content-Type":this.sendContentType,Authorization:this.sendAuthorization,"x-chinac-date":this.sendXAmzDate};W.put(this.uploadImgUrl,t.file,{headers:e}).then(i=>{this.handleUploadSuccess(i,t)}).catch(function(i){console.log(i)})}else this.uploadService==="huawei"&&W.put(this.uploadImgUrl,t.file,{headers:{"Content-Type":t.file.type}}).then(e=>{this.loading.close(),this.handleUploadSuccess(e,t)})},async getSize(t){return new Promise((e,i)=>{const s=new FileReader;s.onload=function(r){const o=r.target.result,n=document.createElement("img");n.src=o,n.onload=function(){e({width:n.width,height:n.height})}},s.readAsDataURL(t)})}}};var It=function(){var e=this,i=e._self._c;return i("div",{staticClass:"compose_cover_upload_box"},[i("yk-upload",{ref:"upload",attrs:{action:"#","show-file-list":!1,"on-success":e.handleUploadSuccess,"before-upload":e.handleBeforeUpload,"on-error":e.handleUploadError,name:"file","file-list":e.value,accept:e.accept,"or-cropper":e.orCropper,"http-request":e.upload,cropperWidth:e.coverWidth,cropperHeight:e.coverHeight,cropBoxResizable:e.cropBoxResizable,guides:e.guides,aspectRatio:e.aspectRatio}},[i("div",{staticClass:"cover_upload_button"},[i("i",{staticClass:"el-icon-picture-outline"})])])],1)},jt=[],Jt=q(Ht,It,jt,!1,null,null,null,null);const Mt=Jt.exports,Wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABSCAYAAADD2VOmAAAAAXNSR0IArs4c6QAAAbZJREFUe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s8Naet6b8vaUjwG4PuMfMNTSvvn1Mw50qWsGTAJKOGuYmgXakM8D5wmKKJ4JN9c2Hf1eDmEGOqpcPHRT8W2syBeBiITJcyAWbVjgdKSqIjogZAFMOqFI3AlQwXFynqQAX94PqfAUAplXiw98c5ZzDix+W5ZxZ/HA08m6Gu87D31qqXT8fxv8ACV6Kwug5U4UAAAAASUVORK5CYII=",Ne="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAP5JREFUWEftltEJwkAMhr84hvuIjiG4gTqGjiA4huJAbmHk4PpS7mwSsVehfTySP1/TP9cIjR9pXJ8ZYJodUNUlsAfuIvL4xiequgLWwFlEnn2tYgdU9QQcgBewE5FrBEJVt8AFWGSAoxUgUd9yYgiiVzxpbErdrHqgIGDuhCf3owk9Ql1rvTmDU+AR9MR2wIMAKdAibIkpGdkEMAQRLZ50zQA1iPxW3ai5J8YFUIFIx2nO3cXdHag4PR2Hiv8nQMFw432CkttHM+GnUfv5GFoKWGJCF5FH2BNruoojgt6caf6O8xrVbiGZwkrWdimNLKDRHPffMFqoljcDNO/AG+KX5CFfO43qAAAAAElFTkSuQmCC",pi="",qt={props:{visible:{type:Boolean,default:!1},videoUrl:{type:String,default:""},videoPoster:{type:String,default:""}},computed:{orVisible(){return this.visible}},watch:{visible(t){t&&this.getVideoMsg()}},data(){return{palyIng:!0,sHeight:0,sWidth:0}},methods:{getVideoMsg(){this.$nextTick(()=>{var t=document.getElementById("video_upload_video");t.addEventListener("loadedmetadata",()=>{let e=1200,i=800,s=e/i,r=t.videoWidth/t.videoHeight;r<s?(this.sHeight=i,this.sWidth=i*r):(this.sWidth=e,this.sHeight=e/r)}),t.addEventListener("ended",()=>{this.palyIng=!1},!1)})},close(){this.palyIng=!0,this.$emit("update:visible",!1)},pause(){var t=document.getElementById("video_upload_video");t.paused?(this.palyIng=!0,t.play()):t.play()&&(this.palyIng=!1,t.pause())}}};var Vt=function(){var e=this,i=e._self._c;return i("el-dialog",{attrs:{"custom-class":"video_upload_box",visible:e.orVisible,"show-close":!1,"append-to-body":"","destroy-on-close":!0,width:e.sWidth+"px",height:e.sHeight+"px"},on:{"update:visible":function(s){e.orVisible=s}}},[i("div",{staticClass:"video_pop_box"},[e.visible?i("video",{staticStyle:{width:"100%",height:"100%"},attrs:{id:"video_upload_video",src:e.videoUrl,poster:e.videoPoster,autoplay:""}}):e._e(),i("div",{staticClass:"video_operation"},[e.palyIng?i("img",{staticClass:"video_recess",attrs:{src:Wt},on:{click:e.pause}}):i("img",{staticClass:"video_recess",attrs:{src:Le},on:{click:e.pause}}),i("img",{staticClass:"video_close",attrs:{src:Ne},on:{click:e.close}})])])])},Kt=[],Xt=q(qt,Vt,Kt,!1,null,null,null,null);const Gt=Xt.exports,mi="",Qt={props:{visible:{type:Boolean,default:!1},imageUrl:{type:String,default:""}},computed:{orVisible(){return this.visible}},data(){return{sHeight:0,sWidth:0}},watch:{visible(t){t&&this.getImgaeMsg()}},mounted(){this.getImgaeMsg()},methods:{getImgaeMsg(){let t=new Image;t.src=this.imageUrl,t.onload=()=>{let e=1200,i=800,s=e/i,r=t.width/t.height;r<s?(this.sHeight=i,this.sWidth=i*r-10):(this.sWidth=e,this.sHeight=e/r-10)}},close(){this.$emit("update:visible",!1)}}};var Zt=function(){var e=this,i=e._self._c;return i("el-dialog",{attrs:{"custom-class":"video_upload_box",visible:e.orVisible,"show-close":!1,"append-to-body":"","destroy-on-close":!0,width:e.sWidth+"px",height:e.sHeight+"px"},on:{"update:visible":function(s){e.orVisible=s}}},[e.orVisible?i("div",{staticClass:"video_pop_box"},[i("img",{style:{width:e.sWidth+"px",height:e.sHeight+"px"},attrs:{src:e.imageUrl}}),i("div",{staticClass:"video_operation"},[i("img",{staticClass:"video_close",attrs:{src:Ne},on:{click:e.close}})])]):e._e()])},Yt=[],$t=q(Qt,Zt,Yt,!1,null,null,null,null);const ei=$t.exports,gi="",ti={name:"yk-compose-upload",components:{CoverUpload:Mt,VideoPlay:Gt,ImageShow:ei},props:{beforeUpload:{type:Function,default:()=>!0},validateCover:{type:Boolean,default:!1},orCropper:{type:Boolean,default:!1},accept:{type:String,default:".jpg,.jpeg,.png,.mp4"},maxSize:{type:String,default:"10M"},imgWidth:{type:Number,default:750},imgHeight:{type:Number,default:422},cropBoxResizable:{type:Boolean,default:!1},guides:{type:Boolean,default:!1},aspectRatio:{type:String,default:"750/422"},getUploadInfo:Function,coverAccept:{type:String,default:".jpg,.jpeg,.png"},coverMaxSize:{type:String,default:"3000k"},coverWidth:{type:Number,default:750},coverHeight:{type:Number,default:422},coverAspectRatio:{type:String,default:"750/422"},mediaFileList:{type:Array,default:()=>[]},coverFileList:{type:Array,default:()=>[]},getCoverUploadInfo:Function,uploadService:{type:String,default:"huawei"}},data(){return{fileList:[],uploadImgUrl:"",viewUrl:"",fileType:"",state:"",totalNum:0,loadedNum:0,coverUploadFileList:[],videoCoverUrl:"",visible:!1,boxWidth:0,boxHeight:0,imgVisible:!1,sendContentType:"",sendAuthorization:"",sendXAmzDate:""}},watch:{coverUploadFileList:{handler(t){this.$emit("update:coverFileList",t),this.fileType=="2"&&(t&&t.length>0?this.videoCoverUrl=t[0].url:this.videoCoverUrl="")},deep:!0},coverFileList:{handler(t){if(this.$emit("update:coverFileList",t),this.mediaFileList&&this.mediaFileList.length>0)this.fileType="2",this.fileList=this.mediaFileList,this.viewUrl=this.mediaFileList[0].url,this.coverFileList&&this.coverFileList.length>0?this.coverUploadFileList=this.coverFileList:this.videoCoverUrl="",this.state="3";else if(t&&t.length>0){this.fileType="1",this.fileList=this.coverFileList,this.viewUrl=this.coverFileList[0].url;let e=new Image;e.src=this.viewUrl,e.onload=()=>{let i=e.width/e.height;i>1?(this.boxWidth=120,this.boxHeight=120/i):(this.boxHeight=120,this.boxWidth=120*i)},this.state="3"}else this.state="",this.fileList=[]},deep:!0},mediaFileList:{handler(t){if(this.$emit("update:mediaFileList",t),t&&t.length>0)this.fileType="2",this.fileList=this.mediaFileList,this.viewUrl=this.mediaFileList[0].url,this.coverFileList&&this.coverFileList.length>0?this.coverUploadFileList=this.coverFileList:this.videoCoverUrl="",this.state="3";else if(this.coverFileList&&this.coverFileList.length>0){this.fileType="1",this.fileList=this.coverFileList,this.viewUrl=this.coverFileList[0].url;let e=new Image;e.src=this.viewUrl,e.onload=()=>{let i=e.width/e.height;i>1?(this.boxWidth=120,this.boxHeight=120/i):(this.boxHeight=120,this.boxWidth=120*i)},this.state="3"}else this.state="",this.fileList=[]},deep:!0}},async mounted(){if(this.mediaFileList&&this.mediaFileList.length>0)this.fileType="2",this.fileList=this.mediaFileList,this.viewUrl=this.mediaFileList[0].url,this.coverFileList&&this.coverFileList.length>0&&(this.coverUploadFileList=this.coverFileList),this.state="3";else if(this.coverFileList&&this.coverFileList.length>0){this.fileType="1",this.fileList=this.coverFileList,this.viewUrl=this.coverFileList[0].url;let t=new Image;t.src=this.viewUrl,t.onload=()=>{let e=t.width/t.height;e>1?(this.boxWidth=120,this.boxHeight=120/e):(this.boxHeight=120,this.boxWidth=120*e)},this.state="3"}},methods:{imgShow(){this.imgVisible=!0},videoPlay(){this.visible=!0},handleRemove(){this.loadedNum=0,this.totalNum=0,this.fileList=[],this.coverUploadFileList=[],this.$emit("update:mediaFileList",this.fileList),this.$emit("update:coverFileList",this.coverUploadFileList),setTimeout(()=>{this.state=""},10)},handleSize(){const t=this.fileType=="1"?this.coverMaxSize.toLowerCase():this.maxSize.toLowerCase();let e=0;return t.indexOf("k")>=0&&(e=Number(t.substr(0,t.indexOf("k")))),t.indexOf("m")>=0&&(e=Number(t.substr(0,t.indexOf("m")))*1024),e},getPath(t){let i=new URL(t).pathname;return i.substring(1,i.length)},handleUploadSuccess(t,e){this.fileList=[{path:this.getPath(this.viewUrl),url:this.viewUrl,id:e.file.uid,name:e.file.name}],this.state="3",this.fileType=="1"?this.coverUploadFileList=this.fileList:this.$emit("update:mediaFileList",this.fileList)},async handleBeforeUpload(t){if(await this.beforeUpload(t)===!1)return!1;let i=(t.size/1024/1024).toFixed(1);this.totalNum=i,this.fileType=t.type.indexOf("image")==-1?"2":"1",this.canUpload=!0;const r=this.accept.replaceAll(".","").split(",");if(!r.find(d=>t.type.indexOf(d)!=-1)&&this.accept!=""){let d="";return r.forEach((f,g)=>{d+=g+1==r.length?f:f+"/"}),this.$message.error(`\u4E0A\u4F20\u56FE\u7247/\u89C6\u9891\u53EA\u80FD\u662F ${d} \u683C\u5F0F!`),this.canUpload=!1,!1}const n=this.handleSize();if(!(t.size/1024<n))return this.$message.error(`\u4E0A\u4F20${this.fileType=="1"?"\u56FE\u7247":"\u89C6\u9891"}\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${this.fileType=="1"?this.coverMaxSize:this.maxSize}!`),this.canUpload=!1,!1;if(this.fileType=="1"){let d=await this.getSize(t),f=d.width/d.height;f>1?(this.boxWidth=120,this.boxHeight=120/f):(this.boxHeight=120,this.boxWidth=120*f)}if(this.validateCover&&this.fileType=="1"){let d=await this.getSize(t);if(d.width!=this.imgWidth||d.height!=this.imgHeight)return this.$message.error(`\u4E0A\u4F20\u56FE\u7247/\u89C6\u9891\u7684\u5BBD\u9AD8\u5E94\u4E3A${this.imgWidth}*${this.imgHeight}\u50CF\u7D20!`),this.canUpload=!1,!1}const u=t.type.replace(this.fileType=="1"?"image/":"video/",""),l=await this.getUploadInfo(u,t);if(!l)return this.canUpload=!1,!1;this.uploadService==="huawei"?(this.uploadImgUrl=l.data.signedUrl,this.viewUrl=l.data.viewUrl):this.uploadService==="huayun"&&(this.uploadImgUrl=l.data.viewUrl,this.viewUrl=l.data.viewUrl,this.sendContentType=l.data.contentType,this.sendAuthorization=l.data.amzSignature,this.sendXAmzDate=l.data.amzDate)},handleUploadError(){this.$message({type:"error",message:"\u4E0A\u4F20\u5931\u8D25"})},upload(t){if(this.canUpload)if(this.state="2",this.uploadService==="huayun"){const e={"Content-Type":this.sendContentType,Authorization:this.sendAuthorization,"x-chinac-date":this.sendXAmzDate};W.put(this.uploadImgUrl,t.file,{headers:e,onUploadProgress:i=>{this.loadedNum=(i.loaded/1024/1024).toFixed(1)}}).then(i=>{this.handleUploadSuccess(i,t)}).catch(function(i){console.log(i)})}else this.uploadService==="huawei"&&W.put(this.uploadImgUrl,t.file,{headers:{"Content-Type":t.file.type},onUploadProgress:e=>{this.loadedNum=(e.loaded/1024/1024).toFixed(1)}}).then(e=>{this.handleUploadSuccess(e,t)})},async getSize(t){return new Promise((e,i)=>{const s=new FileReader;s.onload=function(r){const o=r.target.result,n=document.createElement("img");n.src=o,n.onload=function(){e({width:n.width,height:n.height})}},s.readAsDataURL(t)})}}};var ii=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{display:"inline-block","vertical-align":"top"}},[i("yk-upload",{ref:"upload",staticClass:"compose_upload_box",class:{compose_upload_hide:e.fileList[0]||e.state!=""},attrs:{action:"#","show-file-list":!1,"on-success":e.handleUploadSuccess,"before-upload":e.handleBeforeUpload,"on-error":e.handleUploadError,name:"file",accept:e.accept,"or-cropper":e.orCropper,"http-request":e.upload,cropperWidth:e.imgWidth,cropperHeight:e.imgHeight,cropBoxResizable:e.cropBoxResizable,guides:e.guides,aspectRatio:e.aspectRatio,"on-remove":e.handleRemove}},[i("div",{staticClass:"upload_trigger",attrs:{slot:"trigger"},slot:"trigger"},[i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),e.state=="2"?i("div",{staticClass:"yk-video-upload-default-count",staticStyle:{background:"rgba(245, 247, 250, 1)"}},[i("div",{staticClass:"loading_box"},[i("div",[e._v("\u4E0A\u4F20\u4E2D")]),i("div",[e._v(e._s(e.loadedNum)+"M/"+e._s(e.totalNum)+"M")])]),i("div",{staticClass:"progress_box"},[i("div",{staticClass:"progress"},[i("div",{style:{width:e.loadedNum/e.totalNum*100+"%"}})])])]):e._e(),e.fileList[0]&&e.state=="3"?i("div",{staticClass:"video_show_box"},[e.state=="3"?i("div",{staticClass:"yk-video-upload-default-count",staticStyle:{border:"none"}},[e.fileType=="1"?i("div",{staticClass:"image_box",on:{click:e.imgShow}},[i("img",{style:{width:e.boxWidth+"px",height:e.boxHeight+"px"},attrs:{src:this.viewUrl}})]):e._e(),e.fileType=="2"?i("cover-upload",{staticClass:"hidden_box",attrs:{orCropper:e.orCropper,coverWidth:e.coverWidth,coverHeight:e.coverHeight,cropBoxResizable:e.cropBoxResizable,guides:e.guides,accept:e.coverAccept,maxSize:e.coverMaxSize,aspectRatio:e.coverAspectRatio,getCoverUploadInfo:e.getCoverUploadInfo,validateCover:e.validateCover,uploadService:e.uploadService},model:{value:e.coverUploadFileList,callback:function(s){e.coverUploadFileList=s},expression:"coverUploadFileList"}}):e._e(),i("div",{staticClass:"video_remove_button hidden_box",on:{click:e.handleRemove}},[i("i",{staticClass:"el-icon-delete"})]),e.fileType=="2"?i("video",{attrs:{src:this.viewUrl,poster:e.videoCoverUrl}}):e._e(),e.fileType=="2"?i("div",{staticClass:"video_play_button",on:{click:e.videoPlay}},[i("img",{attrs:{src:Le}})]):e._e()],1):e._e()]):e._e()]),i("video-play",{attrs:{visible:e.visible,videoUrl:e.viewUrl,videoPoster:e.videoCoverUrl},on:{"update:visible":function(s){e.visible=s}}}),i("image-show",{attrs:{visible:e.imgVisible,imageUrl:e.viewUrl,width:e.boxWidth,height:e.boxHeight},on:{"update:visible":function(s){e.imgVisible=s}}})],1)},si=[],ri=q(ti,ii,si,!1,null,null,null,null);const Be=ri.exports;return{install(t){t.component(Be.name,Be)}}});