var Tt=Object.defineProperty,xt=Object.defineProperties;var bt=Object.getOwnPropertyDescriptors;var yt=Object.getOwnPropertySymbols;var At=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable;var mt=(o,t,e)=>t in o?Tt(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,Ct=(o,t)=>{for(var e in t||(t={}))At.call(t,e)&&mt(o,e,t[e]);if(yt)for(var e of yt(t))Rt.call(t,e)&&mt(o,e,t[e]);return o},St=(o,t)=>xt(o,bt(t));var nt=(o,t,e)=>new Promise((n,l)=>{var r=w=>{try{S(e.next(w))}catch(x){l(x)}},u=w=>{try{S(e.throw(w))}catch(x){l(x)}},S=w=>w.done?n(w.value):Promise.resolve(w.value).then(r,u);S((e=e.apply(o,t)).next())});import{d as defineComponent,a as reactive,r as ref,i as createVNode,ac as NGrid,ad as NGi,a9 as NSpace,p as __unplugin_components_3,k as createTextVNode,U as nextTick,cc as commonjsGlobal,cb as getDefaultExportFromCjs,ab as service,u as useMessage,M as watch,cd as NUpload,aa as NModal}from"./index.789dd106.js";/*! * Cropper.js v1.5.13 * https://fengyuanchen.github.io/cropperjs * * Copyright 2015-present Chen Fengyuan * Released under the MIT license * * Date: 2022-11-20T05:30:46.114Z */function ownKeys(o,t){var e=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);t&&(n=n.filter(function(l){return Object.getOwnPropertyDescriptor(o,l).enumerable})),e.push.apply(e,n)}return e}function _objectSpread2(o){for(var t=1;to.length)&&(t=o.length);for(var e=0,n=new Array(t);e
',isNaN=Number.isNaN||WINDOW.isNaN;function isNumber(o){return typeof o=="number"&&!isNaN(o)}var isPositiveNumber=function(t){return t>0&&t<1/0};function isUndefined(o){return typeof o=="undefined"}function isObject(o){return _typeof(o)==="object"&&o!==null}var hasOwnProperty=Object.prototype.hasOwnProperty;function isPlainObject(o){if(!isObject(o))return!1;try{var t=o.constructor,e=t.prototype;return t&&e&&hasOwnProperty.call(e,"isPrototypeOf")}catch(n){return!1}}function isFunction(o){return typeof o=="function"}var slice=Array.prototype.slice;function toArray(o){return Array.from?Array.from(o):slice.call(o)}function forEach(o,t){return o&&isFunction(t)&&(Array.isArray(o)||isNumber(o.length)?toArray(o).forEach(function(e,n){t.call(o,e,n,o)}):isObject(o)&&Object.keys(o).forEach(function(e){t.call(o,o[e],e,o)})),o}var assign=Object.assign||function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),l=1;l0&&n.forEach(function(r){isObject(r)&&Object.keys(r).forEach(function(u){t[u]=r[u]})}),t},REGEXP_DECIMALS=/\.\d*(?:0|9){12}\d*$/;function normalizeDecimalNumber(o){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return REGEXP_DECIMALS.test(o)?Math.round(o*t)/t:o}var REGEXP_SUFFIX=/^width|height|left|top|marginLeft|marginTop$/;function setStyle(o,t){var e=o.style;forEach(t,function(n,l){REGEXP_SUFFIX.test(l)&&isNumber(n)&&(n="".concat(n,"px")),e[l]=n})}function hasClass(o,t){return o.classList?o.classList.contains(t):o.className.indexOf(t)>-1}function addClass(o,t){if(!!t){if(isNumber(o.length)){forEach(o,function(n){addClass(n,t)});return}if(o.classList){o.classList.add(t);return}var e=o.className.trim();e?e.indexOf(t)<0&&(o.className="".concat(e," ").concat(t)):o.className=t}}function removeClass(o,t){if(!!t){if(isNumber(o.length)){forEach(o,function(e){removeClass(e,t)});return}if(o.classList){o.classList.remove(t);return}o.className.indexOf(t)>=0&&(o.className=o.className.replace(t,""))}}function toggleClass(o,t,e){if(!!t){if(isNumber(o.length)){forEach(o,function(n){toggleClass(n,t,e)});return}e?addClass(o,t):removeClass(o,t)}}var REGEXP_CAMEL_CASE=/([a-z\d])([A-Z])/g;function toParamCase(o){return o.replace(REGEXP_CAMEL_CASE,"$1-$2").toLowerCase()}function getData(o,t){return isObject(o[t])?o[t]:o.dataset?o.dataset[t]:o.getAttribute("data-".concat(toParamCase(t)))}function setData(o,t,e){isObject(e)?o[t]=e:o.dataset?o.dataset[t]=e:o.setAttribute("data-".concat(toParamCase(t)),e)}function removeData(o,t){if(isObject(o[t]))try{delete o[t]}catch(e){o[t]=void 0}else if(o.dataset)try{delete o.dataset[t]}catch(e){o.dataset[t]=void 0}else o.removeAttribute("data-".concat(toParamCase(t)))}var REGEXP_SPACES=/\s\s*/,onceSupported=function(){var o=!1;if(IS_BROWSER){var t=!1,e=function(){},n=Object.defineProperty({},"once",{get:function(){return o=!0,t},set:function(r){t=r}});WINDOW.addEventListener("test",e,n),WINDOW.removeEventListener("test",e,n)}return o}();function removeListener(o,t,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=e;t.trim().split(REGEXP_SPACES).forEach(function(r){if(!onceSupported){var u=o.listeners;u&&u[r]&&u[r][e]&&(l=u[r][e],delete u[r][e],Object.keys(u[r]).length===0&&delete u[r],Object.keys(u).length===0&&delete o.listeners)}o.removeEventListener(r,l,n)})}function addListener(o,t,e){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=e;t.trim().split(REGEXP_SPACES).forEach(function(r){if(n.once&&!onceSupported){var u=o.listeners,S=u===void 0?{}:u;l=function(){delete S[r][e],o.removeEventListener(r,l,n);for(var x=arguments.length,C=new Array(x),T=0;TMath.abs(e)&&(e=N)})}),e}function getPointer(o,t){var e=o.pageX,n=o.pageY,l={endX:e,endY:n};return t?l:_objectSpread2({startX:e,startY:n},l)}function getPointersCenter(o){var t=0,e=0,n=0;return forEach(o,function(l){var r=l.startX,u=l.startY;t+=r,e+=u,n+=1}),t/=n,e/=n,{pageX:t,pageY:e}}function getAdjustedSizes(o){var t=o.aspectRatio,e=o.height,n=o.width,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=isPositiveNumber(n),u=isPositiveNumber(e);if(r&&u){var S=e*t;l==="contain"&&S>n||l==="cover"&&S90?{width:w,height:S}:{width:S,height:w}}function getSourceCanvas(o,t,e,n){var l=t.aspectRatio,r=t.naturalWidth,u=t.naturalHeight,S=t.rotate,w=S===void 0?0:S,x=t.scaleX,C=x===void 0?1:x,T=t.scaleY,N=T===void 0?1:T,K=e.aspectRatio,P=e.naturalWidth,H=e.naturalHeight,Y=n.fillColor,W=Y===void 0?"transparent":Y,ie=n.imageSmoothingEnabled,B=ie===void 0?!0:ie,A=n.imageSmoothingQuality,E=A===void 0?"low":A,O=n.maxWidth,g=O===void 0?1/0:O,M=n.maxHeight,z=M===void 0?1/0:M,L=n.minWidth,F=L===void 0?0:L,k=n.minHeight,V=k===void 0?0:k,X=document.createElement("canvas"),G=X.getContext("2d"),$=getAdjustedSizes({aspectRatio:K,width:g,height:z}),re=getAdjustedSizes({aspectRatio:K,width:F,height:V},"cover"),ue=Math.min($.width,Math.max(re.width,P)),oe=Math.min($.height,Math.max(re.height,H)),ee=getAdjustedSizes({aspectRatio:l,width:g,height:z}),ce=getAdjustedSizes({aspectRatio:l,width:F,height:V},"cover"),ae=Math.min(ee.width,Math.max(ce.width,r)),pe=Math.min(ee.height,Math.max(ce.height,u)),Z=[-ae/2,-pe/2,ae,pe];return X.width=normalizeDecimalNumber(ue),X.height=normalizeDecimalNumber(oe),G.fillStyle=W,G.fillRect(0,0,ue,oe),G.save(),G.translate(ue/2,oe/2),G.rotate(w*Math.PI/180),G.scale(C,N),G.imageSmoothingEnabled=B,G.imageSmoothingQuality=E,G.drawImage.apply(G,[o].concat(_toConsumableArray(Z.map(function(ne){return Math.floor(normalizeDecimalNumber(ne))})))),G.restore(),X}var fromCharCode=String.fromCharCode;function getStringFromCharCode(o,t,e){var n="";e+=t;for(var l=t;l0;)e.push(fromCharCode.apply(null,toArray(l.subarray(0,n)))),l=l.subarray(n);return"data:".concat(t,";base64,").concat(btoa(e.join("")))}function resetAndGetOrientation(o){var t=new DataView(o),e;try{var n,l,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var u=t.byteLength,S=2;S+1=8&&(r=x+T)}}}if(r){var N=t.getUint16(r,n),K,P;for(P=0;P=0?r:MIN_CONTAINER_WIDTH),height:Math.max(n.offsetHeight,u>=0?u:MIN_CONTAINER_HEIGHT)};this.containerData=S,setStyle(l,{width:S.width,height:S.height}),addClass(t,CLASS_HIDDEN),removeClass(l,CLASS_HIDDEN)},initCanvas:function(){var t=this.containerData,e=this.imageData,n=this.options.viewMode,l=Math.abs(e.rotate)%180===90,r=l?e.naturalHeight:e.naturalWidth,u=l?e.naturalWidth:e.naturalHeight,S=r/u,w=t.width,x=t.height;t.height*S>t.width?n===3?w=t.height*S:x=t.width/S:n===3?x=t.width/S:w=t.height*S;var C={aspectRatio:S,naturalWidth:r,naturalHeight:u,width:w,height:x};this.canvasData=C,this.limited=n===1||n===2,this.limitCanvas(!0,!0),C.width=Math.min(Math.max(C.width,C.minWidth),C.maxWidth),C.height=Math.min(Math.max(C.height,C.minHeight),C.maxHeight),C.left=(t.width-C.width)/2,C.top=(t.height-C.height)/2,C.oldLeft=C.left,C.oldTop=C.top,this.initialCanvasData=assign({},C)},limitCanvas:function(t,e){var n=this.options,l=this.containerData,r=this.canvasData,u=this.cropBoxData,S=n.viewMode,w=r.aspectRatio,x=this.cropped&&u;if(t){var C=Number(n.minCanvasWidth)||0,T=Number(n.minCanvasHeight)||0;S>1?(C=Math.max(C,l.width),T=Math.max(T,l.height),S===3&&(T*w>C?C=T*w:T=C/w)):S>0&&(C?C=Math.max(C,x?u.width:0):T?T=Math.max(T,x?u.height:0):x&&(C=u.width,T=u.height,T*w>C?C=T*w:T=C/w));var N=getAdjustedSizes({aspectRatio:w,width:C,height:T});C=N.width,T=N.height,r.minWidth=C,r.minHeight=T,r.maxWidth=1/0,r.maxHeight=1/0}if(e)if(S>(x?0:1)){var K=l.width-r.width,P=l.height-r.height;r.minLeft=Math.min(0,K),r.minTop=Math.min(0,P),r.maxLeft=Math.max(0,K),r.maxTop=Math.max(0,P),x&&this.limited&&(r.minLeft=Math.min(u.left,u.left+(u.width-r.width)),r.minTop=Math.min(u.top,u.top+(u.height-r.height)),r.maxLeft=u.left,r.maxTop=u.top,S===2&&(r.width>=l.width&&(r.minLeft=Math.min(0,K),r.maxLeft=Math.max(0,K)),r.height>=l.height&&(r.minTop=Math.min(0,P),r.maxTop=Math.max(0,P))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=l.width,r.maxTop=l.height},renderCanvas:function(t,e){var n=this.canvasData,l=this.imageData;if(e){var r=getRotatedSizes({width:l.naturalWidth*Math.abs(l.scaleX||1),height:l.naturalHeight*Math.abs(l.scaleY||1),degree:l.rotate||0}),u=r.width,S=r.height,w=n.width*(u/n.naturalWidth),x=n.height*(S/n.naturalHeight);n.left-=(w-n.width)/2,n.top-=(x-n.height)/2,n.width=w,n.height=x,n.aspectRatio=u/S,n.naturalWidth=u,n.naturalHeight=S,this.limitCanvas(!0,!1)}(n.width>n.maxWidth||n.widthn.maxHeight||n.heighte.width?r.height=r.width/n:r.width=r.height*n),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*l),r.height=Math.max(r.minHeight,r.height*l),r.left=e.left+(e.width-r.width)/2,r.top=e.top+(e.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=assign({},r)},limitCropBox:function(t,e){var n=this.options,l=this.containerData,r=this.canvasData,u=this.cropBoxData,S=this.limited,w=n.aspectRatio;if(t){var x=Number(n.minCropBoxWidth)||0,C=Number(n.minCropBoxHeight)||0,T=S?Math.min(l.width,r.width,r.width+r.left,l.width-r.left):l.width,N=S?Math.min(l.height,r.height,r.height+r.top,l.height-r.top):l.height;x=Math.min(x,l.width),C=Math.min(C,l.height),w&&(x&&C?C*w>x?C=x/w:x=C*w:x?C=x/w:C&&(x=C*w),N*w>T?N=T/w:T=N*w),u.minWidth=Math.min(x,T),u.minHeight=Math.min(C,N),u.maxWidth=T,u.maxHeight=N}e&&(S?(u.minLeft=Math.max(0,r.left),u.minTop=Math.max(0,r.top),u.maxLeft=Math.min(l.width,r.left+r.width)-u.width,u.maxTop=Math.min(l.height,r.top+r.height)-u.height):(u.minLeft=0,u.minTop=0,u.maxLeft=l.width-u.width,u.maxTop=l.height-u.height))},renderCropBox:function(){var t=this.options,e=this.containerData,n=this.cropBoxData;(n.width>n.maxWidth||n.widthn.maxHeight||n.height=e.width&&n.height>=e.height?ACTION_MOVE:ACTION_ALL),setStyle(this.cropBox,assign({width:n.width,height:n.height},getTransforms({translateX:n.left,translateY:n.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),dispatchEvent(this.element,EVENT_CROP,this.getData())}},preview={initPreview:function(){var t=this.element,e=this.crossOrigin,n=this.options.preview,l=e?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",u=document.createElement("img");if(e&&(u.crossOrigin=e),u.src=l,u.alt=r,this.viewBox.appendChild(u),this.viewBoxImage=u,!!n){var S=n;typeof n=="string"?S=t.ownerDocument.querySelectorAll(n):n.querySelector&&(S=[n]),this.previews=S,forEach(S,function(w){var x=document.createElement("img");setData(w,DATA_PREVIEW,{width:w.offsetWidth,height:w.offsetHeight,html:w.innerHTML}),e&&(x.crossOrigin=e),x.src=l,x.alt=r,x.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',w.innerHTML="",w.appendChild(x)})}},resetPreview:function(){forEach(this.previews,function(t){var e=getData(t,DATA_PREVIEW);setStyle(t,{width:e.width,height:e.height}),t.innerHTML=e.html,removeData(t,DATA_PREVIEW)})},preview:function(){var t=this.imageData,e=this.canvasData,n=this.cropBoxData,l=n.width,r=n.height,u=t.width,S=t.height,w=n.left-e.left-t.left,x=n.top-e.top-t.top;!this.cropped||this.disabled||(setStyle(this.viewBoxImage,assign({width:u,height:S},getTransforms(assign({translateX:-w,translateY:-x},t)))),forEach(this.previews,function(C){var T=getData(C,DATA_PREVIEW),N=T.width,K=T.height,P=N,H=K,Y=1;l&&(Y=N/l,H=r*Y),r&&H>K&&(Y=K/r,P=l*Y,H=K),setStyle(C,{width:P,height:H}),setStyle(C.getElementsByTagName("img")[0],assign({width:u*Y,height:S*Y},getTransforms(assign({translateX:-w*Y,translateY:-x*Y},t))))}))}},events={bind:function(){var t=this.element,e=this.options,n=this.cropper;isFunction(e.cropstart)&&addListener(t,EVENT_CROP_START,e.cropstart),isFunction(e.cropmove)&&addListener(t,EVENT_CROP_MOVE,e.cropmove),isFunction(e.cropend)&&addListener(t,EVENT_CROP_END,e.cropend),isFunction(e.crop)&&addListener(t,EVENT_CROP,e.crop),isFunction(e.zoom)&&addListener(t,EVENT_ZOOM,e.zoom),addListener(n,EVENT_POINTER_DOWN,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&addListener(n,EVENT_WHEEL,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&addListener(n,EVENT_DBLCLICK,this.onDblclick=this.dblclick.bind(this)),addListener(t.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove=this.cropMove.bind(this)),addListener(t.ownerDocument,EVENT_POINTER_UP,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&addListener(window,EVENT_RESIZE,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,n=this.cropper;isFunction(e.cropstart)&&removeListener(t,EVENT_CROP_START,e.cropstart),isFunction(e.cropmove)&&removeListener(t,EVENT_CROP_MOVE,e.cropmove),isFunction(e.cropend)&&removeListener(t,EVENT_CROP_END,e.cropend),isFunction(e.crop)&&removeListener(t,EVENT_CROP,e.crop),isFunction(e.zoom)&&removeListener(t,EVENT_ZOOM,e.zoom),removeListener(n,EVENT_POINTER_DOWN,this.onCropStart),e.zoomable&&e.zoomOnWheel&&removeListener(n,EVENT_WHEEL,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&removeListener(n,EVENT_DBLCLICK,this.onDblclick),removeListener(t.ownerDocument,EVENT_POINTER_MOVE,this.onCropMove),removeListener(t.ownerDocument,EVENT_POINTER_UP,this.onCropEnd),e.responsive&&removeListener(window,EVENT_RESIZE,this.onResize)}},handlers={resize:function(){if(!this.disabled){var t=this.options,e=this.container,n=this.containerData,l=e.offsetWidth/n.width,r=e.offsetHeight/n.height,u=Math.abs(l-1)>Math.abs(r-1)?l:r;if(u!==1){var S,w;t.restore&&(S=this.getCanvasData(),w=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(forEach(S,function(x,C){S[C]=x*u})),this.setCropBoxData(forEach(w,function(x,C){w[C]=x*u})))}}},dblclick:function(){this.disabled||this.options.dragMode===DRAG_MODE_NONE||this.setDragMode(hasClass(this.dragBox,CLASS_CROP)?DRAG_MODE_MOVE:DRAG_MODE_CROP)},wheel:function(t){var e=this,n=Number(this.options.wheelZoomRatio)||.1,l=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?l=t.deltaY>0?1:-1:t.wheelDelta?l=-t.wheelDelta/120:t.detail&&(l=t.detail>0?1:-1),this.zoom(-l*n,t)))},cropStart:function(t){var e=t.buttons,n=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(isNumber(e)&&e!==1||isNumber(n)&&n!==0||t.ctrlKey))){var l=this.options,r=this.pointers,u;t.changedTouches?forEach(t.changedTouches,function(S){r[S.identifier]=getPointer(S)}):r[t.pointerId||0]=getPointer(t),Object.keys(r).length>1&&l.zoomable&&l.zoomOnTouch?u=ACTION_ZOOM:u=getData(t.target,DATA_ACTION),!!REGEXP_ACTIONS.test(u)&&dispatchEvent(this.element,EVENT_CROP_START,{originalEvent:t,action:u})!==!1&&(t.preventDefault(),this.action=u,this.cropping=!1,u===ACTION_CROP&&(this.cropping=!0,addClass(this.dragBox,CLASS_MODAL)))}},cropMove:function(t){var e=this.action;if(!(this.disabled||!e)){var n=this.pointers;t.preventDefault(),dispatchEvent(this.element,EVENT_CROP_MOVE,{originalEvent:t,action:e})!==!1&&(t.changedTouches?forEach(t.changedTouches,function(l){assign(n[l.identifier]||{},getPointer(l,!0))}):assign(n[t.pointerId||0]||{},getPointer(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,n=this.pointers;t.changedTouches?forEach(t.changedTouches,function(l){delete n[l.identifier]}):delete n[t.pointerId||0],e&&(t.preventDefault(),Object.keys(n).length||(this.action=""),this.cropping&&(this.cropping=!1,toggleClass(this.dragBox,CLASS_MODAL,this.cropped&&this.options.modal)),dispatchEvent(this.element,EVENT_CROP_END,{originalEvent:t,action:e}))}}},change={change:function(t){var e=this.options,n=this.canvasData,l=this.containerData,r=this.cropBoxData,u=this.pointers,S=this.action,w=e.aspectRatio,x=r.left,C=r.top,T=r.width,N=r.height,K=x+T,P=C+N,H=0,Y=0,W=l.width,ie=l.height,B=!0,A;!w&&t.shiftKey&&(w=T&&N?T/N:1),this.limited&&(H=r.minLeft,Y=r.minTop,W=H+Math.min(l.width,n.width,n.left+n.width),ie=Y+Math.min(l.height,n.height,n.top+n.height));var E=u[Object.keys(u)[0]],O={x:E.endX-E.startX,y:E.endY-E.startY},g=function(z){switch(z){case ACTION_EAST:K+O.x>W&&(O.x=W-K);break;case ACTION_WEST:x+O.xie&&(O.y=ie-P);break}};switch(S){case ACTION_ALL:x+=O.x,C+=O.y;break;case ACTION_EAST:if(O.x>=0&&(K>=W||w&&(C<=Y||P>=ie))){B=!1;break}g(ACTION_EAST),T+=O.x,T<0&&(S=ACTION_WEST,T=-T,x-=T),w&&(N=T/w,C+=(r.height-N)/2);break;case ACTION_NORTH:if(O.y<=0&&(C<=Y||w&&(x<=H||K>=W))){B=!1;break}g(ACTION_NORTH),N-=O.y,C+=O.y,N<0&&(S=ACTION_SOUTH,N=-N,C-=N),w&&(T=N*w,x+=(r.width-T)/2);break;case ACTION_WEST:if(O.x<=0&&(x<=H||w&&(C<=Y||P>=ie))){B=!1;break}g(ACTION_WEST),T-=O.x,x+=O.x,T<0&&(S=ACTION_EAST,T=-T,x-=T),w&&(N=T/w,C+=(r.height-N)/2);break;case ACTION_SOUTH:if(O.y>=0&&(P>=ie||w&&(x<=H||K>=W))){B=!1;break}g(ACTION_SOUTH),N+=O.y,N<0&&(S=ACTION_NORTH,N=-N,C-=N),w&&(T=N*w,x+=(r.width-T)/2);break;case ACTION_NORTH_EAST:if(w){if(O.y<=0&&(C<=Y||K>=W)){B=!1;break}g(ACTION_NORTH),N-=O.y,C+=O.y,T=N*w}else g(ACTION_NORTH),g(ACTION_EAST),O.x>=0?KY&&(N-=O.y,C+=O.y):(N-=O.y,C+=O.y);T<0&&N<0?(S=ACTION_SOUTH_WEST,N=-N,T=-T,C-=N,x-=T):T<0?(S=ACTION_NORTH_WEST,T=-T,x-=T):N<0&&(S=ACTION_SOUTH_EAST,N=-N,C-=N);break;case ACTION_NORTH_WEST:if(w){if(O.y<=0&&(C<=Y||x<=H)){B=!1;break}g(ACTION_NORTH),N-=O.y,C+=O.y,T=N*w,x+=r.width-T}else g(ACTION_NORTH),g(ACTION_WEST),O.x<=0?x>H?(T-=O.x,x+=O.x):O.y<=0&&C<=Y&&(B=!1):(T-=O.x,x+=O.x),O.y<=0?C>Y&&(N-=O.y,C+=O.y):(N-=O.y,C+=O.y);T<0&&N<0?(S=ACTION_SOUTH_EAST,N=-N,T=-T,C-=N,x-=T):T<0?(S=ACTION_NORTH_EAST,T=-T,x-=T):N<0&&(S=ACTION_SOUTH_WEST,N=-N,C-=N);break;case ACTION_SOUTH_WEST:if(w){if(O.x<=0&&(x<=H||P>=ie)){B=!1;break}g(ACTION_WEST),T-=O.x,x+=O.x,N=T/w}else g(ACTION_SOUTH),g(ACTION_WEST),O.x<=0?x>H?(T-=O.x,x+=O.x):O.y>=0&&P>=ie&&(B=!1):(T-=O.x,x+=O.x),O.y>=0?P=0&&(K>=W||P>=ie)){B=!1;break}g(ACTION_EAST),T+=O.x,N=T/w}else g(ACTION_SOUTH),g(ACTION_EAST),O.x>=0?K=0&&P>=ie&&(B=!1):T+=O.x,O.y>=0?P0?S=O.y>0?ACTION_SOUTH_EAST:ACTION_NORTH_EAST:O.x<0&&(x-=T,S=O.y>0?ACTION_SOUTH_WEST:ACTION_NORTH_WEST),O.y<0&&(C-=N),this.cropped||(removeClass(this.cropBox,CLASS_HIDDEN),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}B&&(r.width=T,r.height=N,r.left=x,r.top=C,this.action=S,this.renderCropBox()),forEach(u,function(M){M.startX=M.endX,M.startY=M.endY})}},methods={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&addClass(this.dragBox,CLASS_MODAL),removeClass(this.cropBox,CLASS_HIDDEN),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=assign({},this.initialImageData),this.canvasData=assign({},this.initialCanvasData),this.cropBoxData=assign({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(assign(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),removeClass(this.dragBox,CLASS_MODAL),addClass(this.cropBox,CLASS_HIDDEN)),this},replace:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,forEach(this.previews,function(n){n.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,removeClass(this.cropper,CLASS_DISABLED)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,addClass(this.cropper,CLASS_DISABLED)),this},destroy:function(){var t=this.element;return t[NAMESPACE]?(t[NAMESPACE]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.canvasData,l=n.left,r=n.top;return this.moveTo(isUndefined(t)?t:l+Number(t),isUndefined(e)?e:r+Number(e))},moveTo:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.canvasData,l=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(isNumber(t)&&(n.left=t,l=!0),isNumber(e)&&(n.top=e,l=!0),l&&this.renderCanvas(!0)),this},zoom:function(t,e){var n=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(n.width*t/n.naturalWidth,null,e)},zoomTo:function(t,e,n){var l=this.options,r=this.canvasData,u=r.width,S=r.height,w=r.naturalWidth,x=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&l.zoomable){var C=w*t,T=x*t;if(dispatchEvent(this.element,EVENT_ZOOM,{ratio:t,oldRatio:u/w,originalEvent:n})===!1)return this;if(n){var N=this.pointers,K=getOffset(this.cropper),P=N&&Object.keys(N).length?getPointersCenter(N):{pageX:n.pageX,pageY:n.pageY};r.left-=(C-u)*((P.pageX-K.left-r.left)/u),r.top-=(T-S)*((P.pageY-K.top-r.top)/S)}else isPlainObject(e)&&isNumber(e.x)&&isNumber(e.y)?(r.left-=(C-u)*((e.x-r.left)/u),r.top-=(T-S)*((e.y-r.top)/S)):(r.left-=(C-u)/2,r.top-=(T-S)/2);r.width=C,r.height=T,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),isNumber(t)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,isNumber(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(isNumber(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,n=this.imageData,l=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(isNumber(t)&&(n.scaleX=t,l=!0),isNumber(e)&&(n.scaleY=e,l=!0),l&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,e=this.options,n=this.imageData,l=this.canvasData,r=this.cropBoxData,u;if(this.ready&&this.cropped){u={x:r.left-l.left,y:r.top-l.top,width:r.width,height:r.height};var S=n.width/n.naturalWidth;if(forEach(u,function(C,T){u[T]=C/S}),t){var w=Math.round(u.y+u.height),x=Math.round(u.x+u.width);u.x=Math.round(u.x),u.y=Math.round(u.y),u.width=x-u.x,u.height=w-u.y}}else u={x:0,y:0,width:0,height:0};return e.rotatable&&(u.rotate=n.rotate||0),e.scalable&&(u.scaleX=n.scaleX||1,u.scaleY=n.scaleY||1),u},setData:function(t){var e=this.options,n=this.imageData,l=this.canvasData,r={};if(this.ready&&!this.disabled&&isPlainObject(t)){var u=!1;e.rotatable&&isNumber(t.rotate)&&t.rotate!==n.rotate&&(n.rotate=t.rotate,u=!0),e.scalable&&(isNumber(t.scaleX)&&t.scaleX!==n.scaleX&&(n.scaleX=t.scaleX,u=!0),isNumber(t.scaleY)&&t.scaleY!==n.scaleY&&(n.scaleY=t.scaleY,u=!0)),u&&this.renderCanvas(!0,!0);var S=n.width/n.naturalWidth;isNumber(t.x)&&(r.left=t.x*S+l.left),isNumber(t.y)&&(r.top=t.y*S+l.top),isNumber(t.width)&&(r.width=t.width*S),isNumber(t.height)&&(r.height=t.height*S),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?assign({},this.containerData):{}},getImageData:function(){return this.sized?assign({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&forEach(["left","top","width","height","naturalWidth","naturalHeight"],function(n){e[n]=t[n]}),e},setCanvasData:function(t){var e=this.canvasData,n=e.aspectRatio;return this.ready&&!this.disabled&&isPlainObject(t)&&(isNumber(t.left)&&(e.left=t.left),isNumber(t.top)&&(e.top=t.top),isNumber(t.width)?(e.width=t.width,e.height=t.width/n):isNumber(t.height)&&(e.height=t.height,e.width=t.height*n),this.renderCanvas(!0)),this},getCropBoxData:function(){var t=this.cropBoxData,e;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(t){var e=this.cropBoxData,n=this.options.aspectRatio,l,r;return this.ready&&this.cropped&&!this.disabled&&isPlainObject(t)&&(isNumber(t.left)&&(e.left=t.left),isNumber(t.top)&&(e.top=t.top),isNumber(t.width)&&t.width!==e.width&&(l=!0,e.width=t.width),isNumber(t.height)&&t.height!==e.height&&(r=!0,e.height=t.height),n&&(l?e.height=e.width/n:r&&(e.width=e.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,n=getSourceCanvas(this.image,this.imageData,e,t);if(!this.cropped)return n;var l=this.getData(),r=l.x,u=l.y,S=l.width,w=l.height,x=n.width/Math.floor(e.naturalWidth);x!==1&&(r*=x,u*=x,S*=x,w*=x);var C=S/w,T=getAdjustedSizes({aspectRatio:C,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),N=getAdjustedSizes({aspectRatio:C,width:t.minWidth||0,height:t.minHeight||0},"cover"),K=getAdjustedSizes({aspectRatio:C,width:t.width||(x!==1?n.width:S),height:t.height||(x!==1?n.height:w)}),P=K.width,H=K.height;P=Math.min(T.width,Math.max(N.width,P)),H=Math.min(T.height,Math.max(N.height,H));var Y=document.createElement("canvas"),W=Y.getContext("2d");Y.width=normalizeDecimalNumber(P),Y.height=normalizeDecimalNumber(H),W.fillStyle=t.fillColor||"transparent",W.fillRect(0,0,P,H);var ie=t.imageSmoothingEnabled,B=ie===void 0?!0:ie,A=t.imageSmoothingQuality;W.imageSmoothingEnabled=B,A&&(W.imageSmoothingQuality=A);var E=n.width,O=n.height,g=r,M=u,z,L,F,k,V,X;g<=-S||g>E?(g=0,z=0,F=0,V=0):g<=0?(F=-g,g=0,z=Math.min(E,S+g),V=z):g<=E&&(F=0,z=Math.min(S,E-g),V=z),z<=0||M<=-w||M>O?(M=0,L=0,k=0,X=0):M<=0?(k=-M,M=0,L=Math.min(O,w+M),X=L):M<=O&&(k=0,L=Math.min(w,O-M),X=L);var G=[g,M,z,L];if(V>0&&X>0){var $=P/S;G.push(F*$,k*$,V*$,X*$)}return W.drawImage.apply(W,[n].concat(_toConsumableArray(G.map(function(re){return Math.floor(normalizeDecimalNumber(re))})))),Y},setAspectRatio:function(t){var e=this.options;return!this.disabled&&!isUndefined(t)&&(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,n=this.dragBox,l=this.face;if(this.ready&&!this.disabled){var r=t===DRAG_MODE_CROP,u=e.movable&&t===DRAG_MODE_MOVE;t=r||u?t:DRAG_MODE_NONE,e.dragMode=t,setData(n,DATA_ACTION,t),toggleClass(n,CLASS_CROP,r),toggleClass(n,CLASS_MOVE,u),e.cropBoxMovable||(setData(l,DATA_ACTION,t),toggleClass(l,CLASS_CROP,r),toggleClass(l,CLASS_MOVE,u))}return this}},AnotherCropper=WINDOW.Cropper,Cropper=function(){function o(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_classCallCheck(this,o),!t||!REGEXP_TAG_NAME.test(t.tagName))throw new Error("The first argument is required and must be an or element.");this.element=t,this.options=assign({},DEFAULTS,isPlainObject(e)&&e),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return _createClass(o,[{key:"init",value:function(){var e=this.element,n=e.tagName.toLowerCase(),l;if(!e[NAMESPACE]){if(e[NAMESPACE]=this,n==="img"){if(this.isImg=!0,l=e.getAttribute("src")||"",this.originalUrl=l,!l)return;l=e.src}else n==="canvas"&&window.HTMLCanvasElement&&(l=e.toDataURL());this.load(l)}}},{key:"load",value:function(e){var n=this;if(!!e){this.url=e,this.imageData={};var l=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(REGEXP_DATA_URL.test(e)){REGEXP_DATA_URL_JPEG.test(e)?this.read(dataURLToArrayBuffer(e)):this.clone();return}var u=new XMLHttpRequest,S=this.clone.bind(this);this.reloading=!0,this.xhr=u,u.onabort=S,u.onerror=S,u.ontimeout=S,u.onprogress=function(){u.getResponseHeader("content-type")!==MIME_TYPE_JPEG&&u.abort()},u.onload=function(){n.read(u.response)},u.onloadend=function(){n.reloading=!1,n.xhr=null},r.checkCrossOrigin&&isCrossOriginURL(e)&&l.crossOrigin&&(e=addTimestamp(e)),u.open("GET",e,!0),u.responseType="arraybuffer",u.withCredentials=l.crossOrigin==="use-credentials",u.send()}}},{key:"read",value:function(e){var n=this.options,l=this.imageData,r=resetAndGetOrientation(e),u=0,S=1,w=1;if(r>1){this.url=arrayBufferToDataURL(e,MIME_TYPE_JPEG);var x=parseOrientation(r);u=x.rotate,S=x.scaleX,w=x.scaleY}n.rotatable&&(l.rotate=u),n.scalable&&(l.scaleX=S,l.scaleY=w),this.clone()}},{key:"clone",value:function(){var e=this.element,n=this.url,l=e.crossOrigin,r=n;this.options.checkCrossOrigin&&isCrossOriginURL(n)&&(l||(l="anonymous"),r=addTimestamp(n)),this.crossOrigin=l,this.crossOriginUrl=r;var u=document.createElement("img");l&&(u.crossOrigin=l),u.src=r||n,u.alt=e.alt||"The image to crop",this.image=u,u.onload=this.start.bind(this),u.onerror=this.stop.bind(this),addClass(u,CLASS_HIDE),e.parentNode.insertBefore(u,e.nextSibling)}},{key:"start",value:function(){var e=this,n=this.image;n.onload=null,n.onerror=null,this.sizing=!0;var l=WINDOW.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent),r=function(x,C){assign(e.imageData,{naturalWidth:x,naturalHeight:C,aspectRatio:x/C}),e.initialImageData=assign({},e.imageData),e.sizing=!1,e.sized=!0,e.build()};if(n.naturalWidth&&!l){r(n.naturalWidth,n.naturalHeight);return}var u=document.createElement("img"),S=document.body||document.documentElement;this.sizingImage=u,u.onload=function(){r(u.width,u.height),l||S.removeChild(u)},u.src=n.src,l||(u.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",S.appendChild(u))}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var e=this.element,n=this.options,l=this.image,r=e.parentNode,u=document.createElement("div");u.innerHTML=TEMPLATE;var S=u.querySelector(".".concat(NAMESPACE,"-container")),w=S.querySelector(".".concat(NAMESPACE,"-canvas")),x=S.querySelector(".".concat(NAMESPACE,"-drag-box")),C=S.querySelector(".".concat(NAMESPACE,"-crop-box")),T=C.querySelector(".".concat(NAMESPACE,"-face"));this.container=r,this.cropper=S,this.canvas=w,this.dragBox=x,this.cropBox=C,this.viewBox=S.querySelector(".".concat(NAMESPACE,"-view-box")),this.face=T,w.appendChild(l),addClass(e,CLASS_HIDDEN),r.insertBefore(S,e.nextSibling),removeClass(l,CLASS_HIDE),this.initPreview(),this.bind(),n.initialAspectRatio=Math.max(0,n.initialAspectRatio)||NaN,n.aspectRatio=Math.max(0,n.aspectRatio)||NaN,n.viewMode=Math.max(0,Math.min(3,Math.round(n.viewMode)))||0,addClass(C,CLASS_HIDDEN),n.guides||addClass(C.getElementsByClassName("".concat(NAMESPACE,"-dashed")),CLASS_HIDDEN),n.center||addClass(C.getElementsByClassName("".concat(NAMESPACE,"-center")),CLASS_HIDDEN),n.background&&addClass(S,"".concat(NAMESPACE,"-bg")),n.highlight||addClass(T,CLASS_INVISIBLE),n.cropBoxMovable&&(addClass(T,CLASS_MOVE),setData(T,DATA_ACTION,ACTION_ALL)),n.cropBoxResizable||(addClass(C.getElementsByClassName("".concat(NAMESPACE,"-line")),CLASS_HIDDEN),addClass(C.getElementsByClassName("".concat(NAMESPACE,"-point")),CLASS_HIDDEN)),this.render(),this.ready=!0,this.setDragMode(n.dragMode),n.autoCrop&&this.crop(),this.setData(n.data),isFunction(n.ready)&&addListener(e,EVENT_READY,n.ready,{once:!0}),dispatchEvent(e,EVENT_READY)}}},{key:"unbuild",value:function(){if(!!this.ready){this.ready=!1,this.unbind(),this.resetPreview();var e=this.cropper.parentNode;e&&e.removeChild(this.cropper),removeClass(this.element,CLASS_HIDDEN)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=AnotherCropper,o}},{key:"setDefaults",value:function(e){assign(DEFAULTS,isPlainObject(e)&&e)}}]),o}();assign(Cropper.prototype,render,preview,events,handlers,change,methods);const cropper="",Copper=defineComponent({name:"copper",emits:["close","cropperNo","cropperOk"],setup(o,{slots:t,attrs:e,emit:n,expose:l}){const r=reactive({visible:!1,img:null,confirmLoading:!1,options:{img:"",autoCrop:!0,autoCropWidth:180,autoCropHeight:180,fixedBox:!0,full:!1,enlarge:1,previewsCircle:!0,centerBox:!0,outputType:"png",title:"\u4FEE\u6539\u5934\u50CF",name:null},previews:{},url:{upload:"/sys/common/saveToImgByStr"},myCropper:null}),u=ref(),S=T=>{const{options:N}=r;r.visible=!0,r.options=Object.assign({},N,T),nextTick(()=>{w()})},w=()=>{r.myCropper=new Cropper(u.value,{viewMode:1,dragMode:"move",aspectRatio:r.options.autoCropWidth/r.options.autoCropHeight,initialAspectRatio:1,autoCropArea:1,cropBoxMovable:!0,cropBoxResizable:!1,background:!0,movable:!0,modal:!0,preview:".before"})},x=T=>{switch(T){case"left":r.myCropper.rotate(90);break;case"right":r.myCropper.rotate(-90);break;case"zoomIn":r.myCropper.zoom(.1);break;case"zoomOut":r.myCropper.zoom(-.1);break}},C=()=>{r.confirmLoading=!0,r.myCropper.getCroppedCanvas({imageSmoothingQuality:"high"}).toBlob(T=>{n("cropperOk",T),r.confirmLoading=!1})};return l({edit:S}),()=>createVNode("div",null,[createVNode(NGrid,{cols:2,xGap:24,style:{paddingTop:"12px"}},{default:()=>[createVNode(NGi,null,{default:()=>[createVNode("div",{style:"width: 100%; height: 300px"},[createVNode("img",{ref:u,id:"myImages",src:r.options.img,alt:""},null)]),createVNode(NSpace,{justify:"end",style:{paddingTop:"12px"}},{default:()=>[createVNode(__unplugin_components_3,{type:"primary",size:"small",onClick:()=>x("left")},{default:()=>[createTextVNode("\u9006\u65F6\u9488\u65CB\u8F6C")]}),createVNode(__unplugin_components_3,{type:"primary",size:"small",onClick:()=>x("right")},{default:()=>[createTextVNode("\u987A\u65F6\u9488\u65CB\u8F6C")]}),createVNode(__unplugin_components_3,{type:"primary",size:"small",onClick:()=>x("zoomIn")},{default:()=>[createTextVNode("\u653E\u5927")]}),createVNode(__unplugin_components_3,{type:"primary",size:"small",onClick:()=>x("zoomOut")},{default:()=>[createTextVNode("\u7F29\u5C0F")]})]})]}),createVNode(NGi,null,{default:()=>[createVNode("span",{style:{fontSize:"15px",fontWeight:600,paddingBottom:"8px",display:"inline-block"}},[createTextVNode("\u9884\u89C8\u56FE\u7247")]),createVNode("div",{class:"before",style:{width:r.options.autoCropWidth+"px",height:r.options.autoCropHeight+"px",overflow:"hidden"}},null)]})]}),createVNode(NSpace,{justify:"end"},{default:()=>[createVNode(__unplugin_components_3,{type:"default",onClick:()=>{r.confirmLoading=!1,n("close"),n("cropperNo")}},{default:()=>[createTextVNode("\u53D6\u6D88")]}),createVNode(__unplugin_components_3,{type:"primary",loading:r.confirmLoading,onClick:C},{default:()=>[createTextVNode("\u786E\u8BA4")]})]})])}});var cosJsSdkV5={exports:{}};(function(module,exports){(function(t,e){module.exports=e()})(commonjsGlobal,function(){return function(o){var t={};function e(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return o[n].call(l.exports,l,l.exports,e),l.l=!0,l.exports}return e.m=o,e.c=t,e.d=function(n,l,r){e.o(n,l)||Object.defineProperty(n,l,{enumerable:!0,get:r})},e.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},e.t=function(n,l){if(l&1&&(n=e(n)),l&8||l&4&&typeof n=="object"&&n&&n.__esModule)return n;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),l&2&&typeof n!="string")for(var u in n)e.d(r,u,function(S){return n[S]}.bind(null,u));return r},e.n=function(n){var l=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(l,"a",l),l},e.o=function(n,l){return Object.prototype.hasOwnProperty.call(n,l)},e.p="/dist/",e(e.s="./index.js")}({"./index.js":function(o,t,e){var n=e("./src/cos.js");o.exports=n},"./lib/base64.js":function(o,t){var e=function(n){n=n||{};var l=n.Base64,r="2.1.9",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",S=function(L){for(var F={},k=0,V=L.length;k>>6)+w(128|k&63):w(224|k>>>12&15)+w(128|k>>>6&63)+w(128|k&63)}else{var k=65536+(F.charCodeAt(0)-55296)*1024+(F.charCodeAt(1)-56320);return w(240|k>>>18&7)+w(128|k>>>12&63)+w(128|k>>>6&63)+w(128|k&63)}},C=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,T=function(F){return F.replace(C,x)},N=function(F){var k=[0,2,1][F.length%3],V=F.charCodeAt(0)<<16|(F.length>1?F.charCodeAt(1):0)<<8|(F.length>2?F.charCodeAt(2):0),X=[u.charAt(V>>>18),u.charAt(V>>>12&63),k>=2?"=":u.charAt(V>>>6&63),k>=1?"=":u.charAt(V&63)];return X.join("")},K=n.btoa?function(L){return n.btoa(L)}:function(L){return L.replace(/[\s\S]{1,3}/g,N)},P=function(L){return K(T(L))},H=function(F,k){return k?P(String(F)).replace(/[+\/]/g,function(V){return V=="+"?"-":"_"}).replace(/=/g,""):P(String(F))},Y=function(F){return H(F,!0)},W=new RegExp(["[\xC0-\xDF][\x80-\xBF]","[\xE0-\xEF][\x80-\xBF]{2}","[\xF0-\xF7][\x80-\xBF]{3}"].join("|"),"g"),ie=function(F){switch(F.length){case 4:var k=(7&F.charCodeAt(0))<<18|(63&F.charCodeAt(1))<<12|(63&F.charCodeAt(2))<<6|63&F.charCodeAt(3),V=k-65536;return w((V>>>10)+55296)+w((V&1023)+56320);case 3:return w((15&F.charCodeAt(0))<<12|(63&F.charCodeAt(1))<<6|63&F.charCodeAt(2));default:return w((31&F.charCodeAt(0))<<6|63&F.charCodeAt(1))}},B=function(F){return F.replace(W,ie)},A=function(F){var k=F.length,V=k%4,X=(k>0?S[F.charAt(0)]<<18:0)|(k>1?S[F.charAt(1)]<<12:0)|(k>2?S[F.charAt(2)]<<6:0)|(k>3?S[F.charAt(3)]:0),G=[w(X>>>16),w(X>>>8&255),w(X&255)];return G.length-=[0,0,2,1][V],G.join("")},E=n.atob?function(L){return n.atob(L)}:function(L){return L.replace(/[\s\S]{1,4}/g,A)},O=function(L){return B(E(L))},g=function(F){return O(String(F).replace(/[-_]/g,function(k){return k=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},M=function(){var F=n.Base64;return n.Base64=l,F},z={VERSION:r,atob:E,btoa:K,fromBase64:g,toBase64:H,utob:T,encode:H,encodeURI:Y,btou:B,decode:g,noConflict:M};return z}();o.exports=e},"./lib/beacon.min.js":function(o,t,e){var n,l,r=e("./node_modules/@babel/runtime/helpers/typeof.js");(function(u,S){r(t)=="object"&&typeof o!="undefined"?o.exports=S():(n=S,l=typeof n=="function"?n.call(t,e,t,o):n,l!==void 0&&(o.exports=l))})(this,function(){var u=function(c,a){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,m){d.__proto__=m}||function(d,m){for(var D in m)Object.prototype.hasOwnProperty.call(m,D)&&(d[D]=m[D])},u(c,a)},S=function(){return S=Object.assign||function(c){for(var a,d=1,m=arguments.length;d0&&m[m.length-1])||J[0]!==6&&J[0]!==2)){U=0;continue}if(J[0]===3&&(!m||J[1]>m[0]&&J[1]60*this.strategy.requestInterval*1e3},h.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},h.prototype.isBlackEvent=function(c){return this.strategy.blacklist.indexOf(c)!=-1},h.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},h.prototype.isSampleEvent=function(c){return!!Object.prototype.hasOwnProperty.call(this.realSample,c)&&this.realSample[c]this.duration)return this.createSession();a=m.sessionId,d=m.sessionStart,this.getSessionStackDepth=0}catch(U){}return{sessionId:a,sessionStart:d}},h.prototype.createSession=function(){var c=Date.now(),a={sessionId:this.appkey+"_"+c.toString(),sessionStart:c};this.storage.setItem(M,JSON.stringify(a)),this.storage.setItem(N,c.toString());var d="is_new_user",m=this.storage.getItem(d);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:m?"N":"Y"}),this.storage.setItem(d,JSON.stringify(!1)),a},h}();function L(){var h=navigator.userAgent,c=h.indexOf("compatible")>-1&&h.indexOf("MSIE")>-1,a=h.indexOf("Edge")>-1&&!c,d=h.indexOf("Trident")>-1&&h.indexOf("rv:11.0")>-1;if(c){new RegExp("MSIE (\\d+\\.\\d+);").test(h);var m=parseFloat(RegExp.$1);return m==7?7:m==8?8:m==9?9:m==10?10:6}return a?-2:d?11:-1}function F(h,c){var a,d;return(a="https://tun-cos-1258344701.file.myqcloud.com/fp.js",d===void 0&&(d=Date.now()+"-"+Math.random()),new Promise(function(m,D){if(document.getElementById(d))m(void 0);else{var U=document.getElementsByTagName("head")[0],Q=document.createElement("script");Q.onload=function(){return function(){Q.onload=null,m(void 0)}},Q.onerror=function(de){Q.onerror=null,U.removeChild(Q),D(de)},Q.src=a,Q.id=d,U.appendChild(Q)}})).then(function(){new Fingerprint().getQimei36(h,c)}).catch(function(m){}),""}var k=function(){return(k=Object.assign||function(c){for(var a,d=1,m=arguments.length;d0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new ue(a),this.dbEventCount=this.store.getCount()):(this.store=new re(c),this.getCount().then(function(m){d.dbEventCount=m}).catch(function(m){}))}return h.prototype.getCount=function(){return w(this,void 0,void 0,function(){return x(this,function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,c.sent()];case 2:return c.sent(),[2,Promise.reject()];case 3:return[2]}})})},h.prototype.insertEvent=function(c,a){return w(this,void 0,void 0,function(){var d,m;return x(this,function(D){switch(D.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];d=B(c.mapValue),D.label=1;case 1:return D.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(d,c)];case 2:return[2,D.sent()];case 3:return m=D.sent(),a&&a(m,c),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},h.prototype.getEvents=function(){return w(this,void 0,void 0,function(){var c;return x(this,function(a){switch(a.label){case 0:c=[],a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.store.iterate(function(d){c.push(d)})];case 2:return a.sent(),[2,Promise.all(c)];case 3:return a.sent(),[2,Promise.all(c)];case 4:return[2]}})})},h.prototype.removeEvent=function(c){return w(this,void 0,void 0,function(){var a;return x(this,function(d){switch(d.label){case 0:a=B(c.mapValue),d.label=1;case 1:return d.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(a)];case 2:return[2,d.sent()];case 3:return d.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},h}(),ee=function(){return(ee=Object.assign||function(c){for(var a,d=1,m=arguments.length;d0&&m[m.length-1])||J[0]!==6&&J[0]!==2)){U=0;continue}if(J[0]===3&&(!m||J[1]>m[0]&&J[1]0&&U<8,d.isUnderIE8||(d.isUnderIE=U>0,a.needInitQimei&&F(a.appkey,function(Q){d.qimei36=Q.q36}),d.network=new De(a),d.storage=new He(a.appkey),d.initCommonInfo(a),d.store=new oe(a.appkey,d.storage),d.errorReport=new O(d.config,d.commonInfo,"web",d.network),d.strategy=new g(a.needQueryConfig==null||a.needQueryConfig,d.config,d.commonInfo,d.storage,d.network),d.logidStartTime=d.storage.getItem(Pe),d.logidStartTime||(d.logidStartTime=Date.now().toString(),d.storage.setItem(Pe,d.logidStartTime)),m=d.logidStartTime,D=Date.now()-Number.parseFloat(m),Math.floor(D/864e5)>=365&&d.storage.clear(),d.initSession(a),d.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return d.lifeCycle.emit("init")},0),d.initDelayTime=a.delay?a.delay:1e3,d.cycleTask(d.initDelayTime)),d}return function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");function m(){this.constructor=a}u(a,d),a.prototype=d===null?Object.create(d):(m.prototype=d.prototype,new m)}(c,h),c.prototype.initSession=function(a){var d=18e5;a.sessionDuration&&a.sessionDuration>3e4&&(d=a.sessionDuration),this.beaconSession=new z(this.storage,d,this)},c.prototype.initCommonInfo=function(a){var d=Number(this.storage.getItem(N));try{var m=JSON.parse(this.storage.getItem(K));(Date.now()-d>3e4||!m)&&this.storage.setItem(K,JSON.stringify([]))}catch(U){}a.uploadUrl&&(this.uploadUrl=a.uploadUrl+"?appkey="+a.appkey);var D=[window.screen.width,window.screen.height];window.devicePixelRatio&&D.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:D.join("*"),channelID:a.channelID?String(a.channelID):"",openid:a.openid?String(a.openid):"",unid:a.unionid?String(a.unionid):"",sdkVersion:se},this.config.appVersion=a.versionCode?String(a.versionCode):"",this.config.strictMode=a.strictMode},c.prototype.cycleTask=function(a){var d=this;this.intervalID=window.setInterval(function(){d.pauseSearching||d.store.getEvents().then(function(m){m.length==0&&(d.pauseSearching=!0);var D=[],U=JSON.parse(d.storage.getItem(K));U||(U=[]),m&&m.forEach(function(Q){var de=B(Q.mapValue);U.indexOf(de)==-1&&(D.push(Q),U.push(de))}),D.length!=0&&(d.storage.setItem(K,JSON.stringify(U)),d._normalLogPipeline(d.assembleData(D)))}).catch(function(m){})},a)},c.prototype.onReport=function(a,d,m){var D=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var U=this.generateData(a,d,m);if(m&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(U));else{var Q=U.shift();Q&&this.store.insertEvent(Q,function(de){de&&D.errorReport.reportError("604","insertEvent fail!")}).catch(function(de){D._normalLogPipeline(D.assembleData(U))})}}},c.prototype.onSendBeacon=function(a,d){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var m=this.assembleData(this.generateData(a,d,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(m))}},c.prototype.generateData=function(a,d,m){var D=[],U="4.5.14-web_"+(m?"direct_log_id":"normal_log_id"),Q=Number(this.storage.getItem(U));return Q=Q||1,d=S(S({},d),{A99:m?"Y":"N",A100:Q.toString(),A72:se,A88:this.logidStartTime}),Q++,this.storage.setItem(U,Q.toString()),D.push({eventCode:a,eventTime:Date.now().toString(),mapValue:W(d,this.config.strictMode)}),D},c.prototype.assembleData=function(a){var d=this.beaconSession.getSession();return{appVersion:this.config.appVersion?ie(this.config.appVersion):"",sdkId:"js",sdkVersion:se,mainAppKey:this.config.appkey,platformId:3,common:W(S(S({},this.additionalParams),{A2:this.commonInfo.deviceId,A8:this.commonInfo.openid,A12:this.commonInfo.language,A17:this.commonInfo.pixel,A23:this.commonInfo.channelID,A50:this.commonInfo.unid,A76:d.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:a}},c.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},c.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},c}(E)})},"./lib/crypto.js":function(o,t,e){(function(n){var l=e("./node_modules/@babel/runtime/helpers/typeof.js"),r=r||function(u,S){var w={},x=w.lib={},C=function(){},T=x.Base={extend:function(A){C.prototype=this;var E=new C;return A&&E.mixIn(A),E.hasOwnProperty("init")||(E.init=function(){E.$super.init.apply(this,arguments)}),E.init.prototype=E,E.$super=this,E},create:function(){var A=this.extend();return A.init.apply(A,arguments),A},init:function(){},mixIn:function(A){for(var E in A)A.hasOwnProperty(E)&&(this[E]=A[E]);A.hasOwnProperty("toString")&&(this.toString=A.toString)},clone:function(){return this.init.prototype.extend(this)}},N=x.WordArray=T.extend({init:function(A,E){A=this.words=A||[],this.sigBytes=E!=S?E:4*A.length},toString:function(A){return(A||P).stringify(this)},concat:function(A){var E=this.words,O=A.words,g=this.sigBytes;if(A=A.sigBytes,this.clamp(),g%4)for(var M=0;M>>2]|=(O[M>>>2]>>>24-8*(M%4)&255)<<24-8*((g+M)%4);else if(65535>>2]=O[M>>>2];else E.push.apply(E,O);return this.sigBytes+=A,this},clamp:function(){var A=this.words,E=this.sigBytes;A[E>>>2]&=4294967295<<32-8*(E%4),A.length=u.ceil(E/4)},clone:function(){var A=T.clone.call(this);return A.words=this.words.slice(0),A},random:function(A){for(var E=[],O=0;O>>2]>>>24-8*(g%4)&255;O.push((M>>>4).toString(16)),O.push((M&15).toString(16))}return O.join("")},parse:function(A){for(var E=A.length,O=[],g=0;g>>3]|=parseInt(A.substr(g,2),16)<<24-4*(g%8);return new N.init(O,E/2)}},H=K.Latin1={stringify:function(A){var E=A.words;A=A.sigBytes;for(var O=[],g=0;g>>2]>>>24-8*(g%4)&255));return O.join("")},parse:function(A){for(var E=A.length,O=[],g=0;g>>2]|=(A.charCodeAt(g)&255)<<24-8*(g%4);return new N.init(O,E)}},Y=K.Utf8={stringify:function(A){try{return decodeURIComponent(escape(H.stringify(A)))}catch(E){throw Error("Malformed UTF-8 data")}},parse:function(A){return H.parse(unescape(encodeURIComponent(A)))}},W=x.BufferedBlockAlgorithm=T.extend({reset:function(){this._data=new N.init,this._nDataBytes=0},_append:function(A){typeof A=="string"&&(A=Y.parse(A)),this._data.concat(A),this._nDataBytes+=A.sigBytes},_process:function(A){var E=this._data,O=E.words,g=E.sigBytes,M=this.blockSize,z=g/(4*M),z=A?u.ceil(z):u.max((z|0)-this._minBufferSize,0);if(A=z*M,g=u.min(4*A,g),A){for(var L=0;LA;A++){if(16>A)x[A]=N[K+A]|0;else{var E=x[A-3]^x[A-8]^x[A-14]^x[A-16];x[A]=E<<1|E>>>31}E=(H<<5|H>>>27)+B+x[A],E=20>A?E+((Y&W|~Y&ie)+1518500249):40>A?E+((Y^W^ie)+1859775393):60>A?E+((Y&W|Y&ie|W&ie)-1894007588):E+((Y^W^ie)-899497514),B=ie,ie=W,W=Y<<30|Y>>>2,Y=H,H=E}P[0]=P[0]+H|0,P[1]=P[1]+Y|0,P[2]=P[2]+W|0,P[3]=P[3]+ie|0,P[4]=P[4]+B|0},_doFinalize:function(){var N=this._data,K=N.words,P=8*this._nDataBytes,H=8*N.sigBytes;return K[H>>>5]|=128<<24-H%32,K[(H+64>>>9<<4)+14]=Math.floor(P/4294967296),K[(H+64>>>9<<4)+15]=P,N.sigBytes=4*K.length,this._process(),this._hash},clone:function(){var N=w.clone.call(this);return N._hash=this._hash.clone(),N}});u.SHA1=w._createHelper(C),u.HmacSHA1=w._createHmacHelper(C)})(),function(){var u=r,S=u.enc.Utf8;u.algo.HMAC=u.lib.Base.extend({init:function(x,C){x=this._hasher=new x.init,typeof C=="string"&&(C=S.parse(C));var T=x.blockSize,N=4*T;C.sigBytes>N&&(C=x.finalize(C)),C.clamp();for(var K=this._oKey=C.clone(),P=this._iKey=C.clone(),H=K.words,Y=P.words,W=0;W>>2]>>>24-Y%4*8&255,ie=N[Y+1>>>2]>>>24-(Y+1)%4*8&255,B=N[Y+2>>>2]>>>24-(Y+2)%4*8&255,A=W<<16|ie<<8|B,E=0;E<4&&Y+E*.75>>6*(3-E)&63));var O=P.charAt(64);if(O)for(;H.length%4;)H.push(O);return H.join("")},parse:function(T){var N=T.length,K=this._map,P=K.charAt(64);if(P){var H=T.indexOf(P);H!=-1&&(N=H)}for(var Y=[],W=0,ie=0;ie>>6-ie%4*2;Y[W>>>2]|=(B|A)<<24-W%4*8,W++}return w.create(Y,W)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),l(n)==="object"?n.exports=r:window.CryptoJS=r}).call(this,e("./node_modules/webpack/buildin/module.js")(o))},"./lib/json2xml.js":function(o,t,e){var n=e("./node_modules/@babel/runtime/helpers/typeof.js"),l="a-zA-Z_\xC0-\xD6\xD8-\xF6\xF8-\xFF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FFF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD",r="-.0-9\xB7\u0300-\u036F\u203F\u2040",u=new RegExp("^([^"+l+"])|^((x|X)(m|M)(l|L))|([^"+l+r+"])","g"),S=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,w=function(K){var P=[];if(K instanceof Object)for(var H in K)K.hasOwnProperty(H)&&P.push(H);return P},x=function(K,P){var H=function(W,ie,B,A,E){var O=P.indent!==void 0?P.indent:" ",g=P.prettyPrint?` `+new Array(A).join(O):"";P.removeIllegalNameCharacters&&(W=W.replace(u,"_"));var M=[g,"<",W,B||""];return ie&&ie.length>0?(M.push(">"),M.push(ie),E&&M.push(g),M.push("")):M.push("/>"),M.join("")};return function Y(W,ie,B){var A=n(W);switch((Array.isArray?Array.isArray(W):W instanceof Array)?A="array":W instanceof Date&&(A="date"),A){case"array":var E=[];return W.map(function(z){E.push(Y(z,1,B+1))}),P.prettyPrint&&E.push(` `),E.join("");case"date":return W.toJSON?W.toJSON():W+"";case"object":var O=[];for(var g in W)if(W.hasOwnProperty(g))if(W[g]instanceof Array)for(var M=0;M0&&O.push(` `),O.join("");case"function":return W();default:return P.escape?T(W):""+W}}(K,0,0)},C=function(K){var P=['"),P.join("")};function T(N){return(""+N).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(S,"")}o.exports=function(N,K){if(K||(K={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof N=="string")try{N=JSON.parse(N.toString())}catch(W){return!1}var P="",H="";K&&(n(K)=="object"?(K.xmlHeader&&(P=C(!!K.xmlHeader.standalone)),typeof K.docType!="undefined"&&(H="")):P=C()),K=K||{};var Y=[P,K.prettyPrint&&H?` `:"",H,x(N,K)];return Y.join("").replace(/\n{2,}/g,` `).replace(/\s+$/g,"")}},"./lib/md5.js":function(module,exports,__webpack_require__){(function(process,global,module){var __WEBPACK_AMD_DEFINE_RESULT__,_typeof=__webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js");(function(){var ERROR="input is invalid type",WINDOW=(typeof window=="undefined"?"undefined":_typeof(window))==="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&(typeof self=="undefined"?"undefined":_typeof(self))==="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process=="undefined"?"undefined":_typeof(process))==="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&_typeof(module)==="object"&&module.exports,AMD=__webpack_require__("./node_modules/webpack/buildin/amd-options.js"),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(o){return Object.prototype.toString.call(o)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(o){return _typeof(o)==="object"&&o.buffer&&o.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(e,n){return new Md5(!0).update(e,n)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.getCtx=t.create=function(){return new Md5},t.update=function(l){return t.create().update(l)};for(var e=0;e>6,S[l++]=128|e&63):e<55296||e>=57344?(S[l++]=224|e>>12,S[l++]=128|e>>6&63,S[l++]=128|e&63):(e=65536+((e&1023)<<10|o.charCodeAt(++n)&1023),S[l++]=240|e>>18,S[l++]=128|e>>12&63,S[l++]=128|e>>6&63,S[l++]=128|e&63);else for(l=this.start;n>2]|=e<>2]|=(192|e>>6)<>2]|=(128|e&63)<=57344?(u[l>>2]|=(224|e>>12)<>2]|=(128|e>>6&63)<>2]|=(128|e&63)<>2]|=(240|e>>18)<>2]|=(128|e>>12&63)<>2]|=(128|e>>6&63)<>2]|=(128|e&63)<=64?(this.start=l-64,this.hash(),this.hashed=!0):this.start=l}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var o=this.blocks,t=this.lastByteIndex;o[t>>2]|=EXTRA[t&3],t>=56&&(this.hashed||this.hash(),o[0]=o[16],o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),o[14]=this.bytes<<3,o[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var o,t,e,n,l,r,u=this.blocks;this.first?(o=u[0]-680876937,o=(o<<7|o>>>25)-271733879<<0,n=(-1732584194^o&2004318071)+u[1]-117830708,n=(n<<12|n>>>20)+o<<0,e=(-271733879^n&(o^-271733879))+u[2]-1126478375,e=(e<<17|e>>>15)+n<<0,t=(o^e&(n^o))+u[3]-1316259209,t=(t<<22|t>>>10)+e<<0):(o=this.h0,t=this.h1,e=this.h2,n=this.h3,o+=(n^t&(e^n))+u[0]-680876936,o=(o<<7|o>>>25)+t<<0,n+=(e^o&(t^e))+u[1]-389564586,n=(n<<12|n>>>20)+o<<0,e+=(t^n&(o^t))+u[2]+606105819,e=(e<<17|e>>>15)+n<<0,t+=(o^e&(n^o))+u[3]-1044525330,t=(t<<22|t>>>10)+e<<0),o+=(n^t&(e^n))+u[4]-176418897,o=(o<<7|o>>>25)+t<<0,n+=(e^o&(t^e))+u[5]+1200080426,n=(n<<12|n>>>20)+o<<0,e+=(t^n&(o^t))+u[6]-1473231341,e=(e<<17|e>>>15)+n<<0,t+=(o^e&(n^o))+u[7]-45705983,t=(t<<22|t>>>10)+e<<0,o+=(n^t&(e^n))+u[8]+1770035416,o=(o<<7|o>>>25)+t<<0,n+=(e^o&(t^e))+u[9]-1958414417,n=(n<<12|n>>>20)+o<<0,e+=(t^n&(o^t))+u[10]-42063,e=(e<<17|e>>>15)+n<<0,t+=(o^e&(n^o))+u[11]-1990404162,t=(t<<22|t>>>10)+e<<0,o+=(n^t&(e^n))+u[12]+1804603682,o=(o<<7|o>>>25)+t<<0,n+=(e^o&(t^e))+u[13]-40341101,n=(n<<12|n>>>20)+o<<0,e+=(t^n&(o^t))+u[14]-1502002290,e=(e<<17|e>>>15)+n<<0,t+=(o^e&(n^o))+u[15]+1236535329,t=(t<<22|t>>>10)+e<<0,o+=(e^n&(t^e))+u[1]-165796510,o=(o<<5|o>>>27)+t<<0,n+=(t^e&(o^t))+u[6]-1069501632,n=(n<<9|n>>>23)+o<<0,e+=(o^t&(n^o))+u[11]+643717713,e=(e<<14|e>>>18)+n<<0,t+=(n^o&(e^n))+u[0]-373897302,t=(t<<20|t>>>12)+e<<0,o+=(e^n&(t^e))+u[5]-701558691,o=(o<<5|o>>>27)+t<<0,n+=(t^e&(o^t))+u[10]+38016083,n=(n<<9|n>>>23)+o<<0,e+=(o^t&(n^o))+u[15]-660478335,e=(e<<14|e>>>18)+n<<0,t+=(n^o&(e^n))+u[4]-405537848,t=(t<<20|t>>>12)+e<<0,o+=(e^n&(t^e))+u[9]+568446438,o=(o<<5|o>>>27)+t<<0,n+=(t^e&(o^t))+u[14]-1019803690,n=(n<<9|n>>>23)+o<<0,e+=(o^t&(n^o))+u[3]-187363961,e=(e<<14|e>>>18)+n<<0,t+=(n^o&(e^n))+u[8]+1163531501,t=(t<<20|t>>>12)+e<<0,o+=(e^n&(t^e))+u[13]-1444681467,o=(o<<5|o>>>27)+t<<0,n+=(t^e&(o^t))+u[2]-51403784,n=(n<<9|n>>>23)+o<<0,e+=(o^t&(n^o))+u[7]+1735328473,e=(e<<14|e>>>18)+n<<0,t+=(n^o&(e^n))+u[12]-1926607734,t=(t<<20|t>>>12)+e<<0,l=t^e,o+=(l^n)+u[5]-378558,o=(o<<4|o>>>28)+t<<0,n+=(l^o)+u[8]-2022574463,n=(n<<11|n>>>21)+o<<0,r=n^o,e+=(r^t)+u[11]+1839030562,e=(e<<16|e>>>16)+n<<0,t+=(r^e)+u[14]-35309556,t=(t<<23|t>>>9)+e<<0,l=t^e,o+=(l^n)+u[1]-1530992060,o=(o<<4|o>>>28)+t<<0,n+=(l^o)+u[4]+1272893353,n=(n<<11|n>>>21)+o<<0,r=n^o,e+=(r^t)+u[7]-155497632,e=(e<<16|e>>>16)+n<<0,t+=(r^e)+u[10]-1094730640,t=(t<<23|t>>>9)+e<<0,l=t^e,o+=(l^n)+u[13]+681279174,o=(o<<4|o>>>28)+t<<0,n+=(l^o)+u[0]-358537222,n=(n<<11|n>>>21)+o<<0,r=n^o,e+=(r^t)+u[3]-722521979,e=(e<<16|e>>>16)+n<<0,t+=(r^e)+u[6]+76029189,t=(t<<23|t>>>9)+e<<0,l=t^e,o+=(l^n)+u[9]-640364487,o=(o<<4|o>>>28)+t<<0,n+=(l^o)+u[12]-421815835,n=(n<<11|n>>>21)+o<<0,r=n^o,e+=(r^t)+u[15]+530742520,e=(e<<16|e>>>16)+n<<0,t+=(r^e)+u[2]-995338651,t=(t<<23|t>>>9)+e<<0,o+=(e^(t|~n))+u[0]-198630844,o=(o<<6|o>>>26)+t<<0,n+=(t^(o|~e))+u[7]+1126891415,n=(n<<10|n>>>22)+o<<0,e+=(o^(n|~t))+u[14]-1416354905,e=(e<<15|e>>>17)+n<<0,t+=(n^(e|~o))+u[5]-57434055,t=(t<<21|t>>>11)+e<<0,o+=(e^(t|~n))+u[12]+1700485571,o=(o<<6|o>>>26)+t<<0,n+=(t^(o|~e))+u[3]-1894986606,n=(n<<10|n>>>22)+o<<0,e+=(o^(n|~t))+u[10]-1051523,e=(e<<15|e>>>17)+n<<0,t+=(n^(e|~o))+u[1]-2054922799,t=(t<<21|t>>>11)+e<<0,o+=(e^(t|~n))+u[8]+1873313359,o=(o<<6|o>>>26)+t<<0,n+=(t^(o|~e))+u[15]-30611744,n=(n<<10|n>>>22)+o<<0,e+=(o^(n|~t))+u[6]-1560198380,e=(e<<15|e>>>17)+n<<0,t+=(n^(e|~o))+u[13]+1309151649,t=(t<<21|t>>>11)+e<<0,o+=(e^(t|~n))+u[4]-145523070,o=(o<<6|o>>>26)+t<<0,n+=(t^(o|~e))+u[11]-1120210379,n=(n<<10|n>>>22)+o<<0,e+=(o^(n|~t))+u[2]+718787259,e=(e<<15|e>>>17)+n<<0,t+=(n^(e|~o))+u[9]-343485551,t=(t<<21|t>>>11)+e<<0,this.first?(this.h0=o+1732584193<<0,this.h1=t-271733879<<0,this.h2=e-1732584194<<0,this.h3=n+271733878<<0,this.first=!1):(this.h0=this.h0+o<<0,this.h1=this.h1+t<<0,this.h2=this.h2+e<<0,this.h3=this.h3+n<<0)},Md5.prototype.hex=function(){this.finalize();var o=this.h0,t=this.h1,e=this.h2,n=this.h3;return HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(o){if(o==="hex")return this.hex();this.finalize();var t=this.h0,e=this.h1,n=this.h2,l=this.h3,r=[t&255,t>>8&255,t>>16&255,t>>24&255,e&255,e>>8&255,e>>16&255,e>>24&255,n&255,n>>8&255,n>>16&255,n>>24&255,l&255,l>>8&255,l>>16&255,l>>24&255];return r},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var o=new ArrayBuffer(16),t=new Uint32Array(o);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,o},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var o,t,e,n="",l=this.array(),r=0;r<15;)o=l[r++],t=l[r++],e=l[r++],n+=BASE64_ENCODE_CHAR[o>>>2]+BASE64_ENCODE_CHAR[(o<<4|t>>>4)&63]+BASE64_ENCODE_CHAR[(t<<2|e>>>6)&63]+BASE64_ENCODE_CHAR[e&63];return o=l[r],n+=BASE64_ENCODE_CHAR[o>>>2]+BASE64_ENCODE_CHAR[o<<4&63]+"==",n};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__("./node_modules/process/browser.js"),__webpack_require__("./node_modules/webpack/buildin/global.js"),__webpack_require__("./node_modules/webpack/buildin/module.js")(module))},"./lib/request.js":function(o,t,e){var n=e("./node_modules/@babel/runtime/helpers/typeof.js"),l=function(C){switch(n(C)){case"string":return C;case"boolean":return C?"true":"false";case"number":return isFinite(C)?C:"";default:return""}},r=function(C,T,N,K){return T=T||"&",N=N||"=",C===null&&(C=void 0),n(C)==="object"?Object.keys(C).map(function(P){var H=encodeURIComponent(l(P))+N;return Array.isArray(C[P])?C[P].map(function(Y){return H+encodeURIComponent(l(Y))}).join(T):H+encodeURIComponent(l(C[P]))}).filter(Boolean).join(T):K?encodeURIComponent(l(K))+N+encodeURIComponent(l(C)):""},u=function(C,T,N){var K={};return T.getAllResponseHeaders().trim().split(` `).forEach(function(P){if(P){var H=P.indexOf(":"),Y=P.substr(0,H).trim().toLowerCase(),W=P.substr(H+1).trim();K[Y]=W}}),{error:C,statusCode:T.status,statusMessage:T.statusText,headers:K,body:N}},S=function(C,T){return!T&&T==="text"?C.responseText:C.response},w=function(C,T){var N=(C.method||"GET").toUpperCase(),K=C.url;if(C.qs){var P=r(C.qs);P&&(K+=(K.indexOf("?")===-1?"?":"&")+P)}var H=new XMLHttpRequest;if(H.open(N,K,!0),H.responseType=C.dataType||"text",C.xhrFields)for(var Y in C.xhrFields)H[Y]=C.xhrFields[Y];var W=C.headers;if(W)for(var ie in W)W.hasOwnProperty(ie)&&ie.toLowerCase()!=="content-length"&&ie.toLowerCase()!=="user-agent"&&ie.toLowerCase()!=="origin"&&ie.toLowerCase()!=="host"&&H.setRequestHeader(ie,W[ie]);return C.onProgress&&H.upload&&(H.upload.onprogress=C.onProgress),C.onDownloadProgress&&(H.onprogress=C.onDownloadProgress),C.timeout&&(H.timeout=C.timeout),H.ontimeout=function(B){var A=new Error("timeout");T(u(A,H))},H.onload=function(){T(u(null,H,S(H,C.dataType)))},H.onerror=function(B){var A=S(H,C.dataType);if(A)T(u(null,H,A));else{var E=H.statusText;!E&&H.status===0&&(E=new Error("CORS blocked or network error")),T(u(E,H,A))}},H.send(C.body||""),H};o.exports=w},"./lib/xml2json.js":function(o,t,e){var n=e("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,l=function(){this.version="1.3.5";var u={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},S=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(w){return/^\s*$/.test(w)?null:/^(?:true|false)$/i.test(w)?w.toLowerCase()==="true":isFinite(w)?parseFloat(w):w},this.parseString=function(w,x){if(w){var C=this.stringToXML(w);return C.getElementsByTagName("parsererror").length?null:this.parseXML(C,x)}else return null},this.parseXML=function(w,x){for(var C in x)u[C]=x[C];var T={},N=0,K="",P=w.childNodes.length;if(P)for(var H,Y,W,ie=0;ie=A+E||A?new java.lang.String(B,A,E)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){P.prototype[B]=function(){return null}});function ie(B,A){B.currentElement?B.currentElement.appendChild(A):B.doc.appendChild(A)}t.__DOMHandler=P,t.normalizeLineEndings=T,t.DOMParser=N},"./node_modules/@xmldom/xmldom/lib/dom.js":function(o,t,e){var n=e("./node_modules/@xmldom/xmldom/lib/conventions.js"),l=n.find,r=n.NAMESPACE;function u(f){return f!==""}function S(f){return f?f.split(/[\t\n\f\r ]+/).filter(u):[]}function w(f,v){return f.hasOwnProperty(v)||(f[v]=!0),f}function x(f){if(!f)return[];var v=S(f);return Object.keys(v.reduce(w,{}))}function C(f){return function(v){return f&&f.indexOf(v)!==-1}}function T(f,v){for(var I in f)Object.prototype.hasOwnProperty.call(f,I)&&(v[I]=f[I])}function N(f,v){var I=f.prototype;if(!(I instanceof v)){let q=function(){};q.prototype=v.prototype,q=new q,T(I,q),f.prototype=I=q}I.constructor!=f&&(typeof f!="function"&&console.error("unknown Class:"+f),I.constructor=f)}var K={},P=K.ELEMENT_NODE=1,H=K.ATTRIBUTE_NODE=2,Y=K.TEXT_NODE=3,W=K.CDATA_SECTION_NODE=4,ie=K.ENTITY_REFERENCE_NODE=5,B=K.ENTITY_NODE=6,A=K.PROCESSING_INSTRUCTION_NODE=7,E=K.COMMENT_NODE=8,O=K.DOCUMENT_NODE=9,g=K.DOCUMENT_TYPE_NODE=10,M=K.DOCUMENT_FRAGMENT_NODE=11,z=K.NOTATION_NODE=12,L={},F={};L.INDEX_SIZE_ERR=(F[1]="Index size error",1),L.DOMSTRING_SIZE_ERR=(F[2]="DOMString size error",2);var k=L.HIERARCHY_REQUEST_ERR=(F[3]="Hierarchy request error",3);L.WRONG_DOCUMENT_ERR=(F[4]="Wrong document",4),L.INVALID_CHARACTER_ERR=(F[5]="Invalid character",5),L.NO_DATA_ALLOWED_ERR=(F[6]="No data allowed",6),L.NO_MODIFICATION_ALLOWED_ERR=(F[7]="No modification allowed",7);var V=L.NOT_FOUND_ERR=(F[8]="Not found",8);L.NOT_SUPPORTED_ERR=(F[9]="Not supported",9);var X=L.INUSE_ATTRIBUTE_ERR=(F[10]="Attribute in use",10);L.INVALID_STATE_ERR=(F[11]="Invalid state",11),L.SYNTAX_ERR=(F[12]="Syntax error",12),L.INVALID_MODIFICATION_ERR=(F[13]="Invalid modification",13),L.NAMESPACE_ERR=(F[14]="Invalid namespace",14),L.INVALID_ACCESS_ERR=(F[15]="Invalid access",15);function G(f,v){if(v instanceof Error)var I=v;else I=this,Error.call(this,F[f]),this.message=F[f],Error.captureStackTrace&&Error.captureStackTrace(this,G);return I.code=f,v&&(this.message=this.message+": "+v),I}G.prototype=Error.prototype,T(L,G);function $(){}$.prototype={length:0,item:function(f){return this[f]||null},toString:function(f,v){for(var I=[],q=0;q=0){for(var fe=v.length-1;q0},lookupPrefix:function(f){for(var v=this;v;){var I=v._nsMap;if(I){for(var q in I)if(Object.prototype.hasOwnProperty.call(I,q)&&I[q]===f)return q}v=v.nodeType==H?v.ownerDocument:v.parentNode}return null},lookupNamespaceURI:function(f){for(var v=this;v;){var I=v._nsMap;if(I&&Object.prototype.hasOwnProperty.call(I,f))return I[f];v=v.nodeType==H?v.ownerDocument:v.parentNode}return null},isDefaultNamespace:function(f){var v=this.lookupPrefix(f);return v==null}};function ne(f){return f=="<"&&"<"||f==">"&&">"||f=="&"&&"&"||f=='"'&&"""||"&#"+f.charCodeAt()+";"}T(K,Z),T(K,Z.prototype);function ge(f,v){if(v(f))return!0;if(f=f.firstChild)do if(ge(f,v))return!0;while(f=f.nextSibling)}function me(){this.ownerDocument=this}function ve(f,v,I){f&&f._inc++;var q=I.namespaceURI;q===r.XMLNS&&(v._nsMap[I.prefix?I.localName:""]=I.value)}function ye(f,v,I,q){f&&f._inc++;var fe=I.namespaceURI;fe===r.XMLNS&&delete v._nsMap[I.prefix?I.localName:""]}function Ce(f,v,I){if(f&&f._inc){f._inc++;var q=v.childNodes;if(I)q[q.length++]=I;else{for(var fe=v.firstChild,Re=0;fe;)q[Re++]=fe,fe=fe.nextSibling;q.length=Re,delete q[q.length]}}}function Ee(f,v){var I=v.previousSibling,q=v.nextSibling;return I?I.nextSibling=q:f.firstChild=q,q?q.previousSibling=I:f.lastChild=I,v.parentNode=null,v.previousSibling=null,v.nextSibling=null,Ce(f.ownerDocument,f),v}function be(f){return f&&(f.nodeType===Z.DOCUMENT_NODE||f.nodeType===Z.DOCUMENT_FRAGMENT_NODE||f.nodeType===Z.ELEMENT_NODE)}function Oe(f){return f&&(De(f)||He(f)||we(f)||f.nodeType===Z.DOCUMENT_FRAGMENT_NODE||f.nodeType===Z.COMMENT_NODE||f.nodeType===Z.PROCESSING_INSTRUCTION_NODE)}function we(f){return f&&f.nodeType===Z.DOCUMENT_TYPE_NODE}function De(f){return f&&f.nodeType===Z.ELEMENT_NODE}function He(f){return f&&f.nodeType===Z.TEXT_NODE}function Pe(f,v){var I=f.childNodes||[];if(l(I,De)||we(v))return!1;var q=l(I,we);return!(v&&q&&I.indexOf(q)>I.indexOf(v))}function se(f,v){var I=f.childNodes||[];function q(Re){return De(Re)&&Re!==v}if(l(I,q))return!1;var fe=l(I,we);return!(v&&fe&&I.indexOf(fe)>I.indexOf(v))}function h(f,v,I){if(!be(f))throw new G(k,"Unexpected parent node type "+f.nodeType);if(I&&I.parentNode!==f)throw new G(V,"child not in parent");if(!Oe(v)||we(v)&&f.nodeType!==Z.DOCUMENT_NODE)throw new G(k,"Unexpected node type "+v.nodeType+" for parent node type "+f.nodeType)}function c(f,v,I){var q=f.childNodes||[],fe=v.childNodes||[];if(v.nodeType===Z.DOCUMENT_FRAGMENT_NODE){var Re=fe.filter(De);if(Re.length>1||l(fe,He))throw new G(k,"More than one element or text in fragment");if(Re.length===1&&!Pe(f,I))throw new G(k,"Element in fragment can not be inserted before doctype")}if(De(v)&&!Pe(f,I))throw new G(k,"Only one element can be added and only after doctype");if(we(v)){if(l(q,we))throw new G(k,"Only one doctype is allowed");var Me=l(q,De);if(I&&q.indexOf(Me)1||l(fe,He))throw new G(k,"More than one element or text in fragment");if(Re.length===1&&!se(f,I))throw new G(k,"Element in fragment can not be inserted before doctype")}if(De(v)&&!se(f,I))throw new G(k,"Only one element can be added and only after doctype");if(we(v)){if(l(q,function(Ye){return we(Ye)&&Ye!==I}))throw new G(k,"Only one doctype is allowed");var Me=l(q,De);if(I&&q.indexOf(Me)0&&ge(I.documentElement,function(fe){if(fe!==I&&fe.nodeType===P){var Re=fe.getAttribute("class");if(Re){var Me=f===Re;if(!Me){var le=x(Re);Me=v.every(C(le))}Me&&q.push(fe)}}}),q})},createElement:function(f){var v=new D;v.ownerDocument=this,v.nodeName=f,v.tagName=f,v.localName=f,v.childNodes=new $;var I=v.attributes=new oe;return I._ownerElement=v,v},createDocumentFragment:function(){var f=new Le;return f.ownerDocument=this,f.childNodes=new $,f},createTextNode:function(f){var v=new de;return v.ownerDocument=this,v.appendData(f),v},createComment:function(f){var v=new he;return v.ownerDocument=this,v.appendData(f),v},createCDATASection:function(f){var v=new J;return v.ownerDocument=this,v.appendData(f),v},createProcessingInstruction:function(f,v){var I=new Ve;return I.ownerDocument=this,I.tagName=I.target=f,I.nodeValue=I.data=v,I},createAttribute:function(f){var v=new U;return v.ownerDocument=this,v.name=f,v.nodeName=f,v.localName=f,v.specified=!0,v},createEntityReference:function(f){var v=new _e;return v.ownerDocument=this,v.nodeName=f,v},createElementNS:function(f,v){var I=new D,q=v.split(":"),fe=I.attributes=new oe;return I.childNodes=new $,I.ownerDocument=this,I.nodeName=v,I.tagName=v,I.namespaceURI=f,q.length==2?(I.prefix=q[0],I.localName=q[1]):I.localName=v,fe._ownerElement=I,I},createAttributeNS:function(f,v){var I=new U,q=v.split(":");return I.ownerDocument=this,I.nodeName=v,I.name=v,I.namespaceURI=f,I.specified=!0,q.length==2?(I.prefix=q[0],I.localName=q[1]):I.localName=v,I}},N(me,Z);function D(){this._nsMap={}}D.prototype={nodeType:P,hasAttribute:function(f){return this.getAttributeNode(f)!=null},getAttribute:function(f){var v=this.getAttributeNode(f);return v&&v.value||""},getAttributeNode:function(f){return this.attributes.getNamedItem(f)},setAttribute:function(f,v){var I=this.ownerDocument.createAttribute(f);I.value=I.nodeValue=""+v,this.setAttributeNode(I)},removeAttribute:function(f){var v=this.getAttributeNode(f);v&&this.removeAttributeNode(v)},appendChild:function(f){return f.nodeType===M?this.insertBefore(f,null):m(this,f)},setAttributeNode:function(f){return this.attributes.setNamedItem(f)},setAttributeNodeNS:function(f){return this.attributes.setNamedItemNS(f)},removeAttributeNode:function(f){return this.attributes.removeNamedItem(f.nodeName)},removeAttributeNS:function(f,v){var I=this.getAttributeNodeNS(f,v);I&&this.removeAttributeNode(I)},hasAttributeNS:function(f,v){return this.getAttributeNodeNS(f,v)!=null},getAttributeNS:function(f,v){var I=this.getAttributeNodeNS(f,v);return I&&I.value||""},setAttributeNS:function(f,v,I){var q=this.ownerDocument.createAttributeNS(f,v);q.value=q.nodeValue=""+I,this.setAttributeNode(q)},getAttributeNodeNS:function(f,v){return this.attributes.getNamedItemNS(f,v)},getElementsByTagName:function(f){return new re(this,function(v){var I=[];return ge(v,function(q){q!==v&&q.nodeType==P&&(f==="*"||q.tagName==f)&&I.push(q)}),I})},getElementsByTagNameNS:function(f,v){return new re(this,function(I){var q=[];return ge(I,function(fe){fe!==I&&fe.nodeType===P&&(f==="*"||fe.namespaceURI===f)&&(v==="*"||fe.localName==v)&&q.push(fe)}),q})}},me.prototype.getElementsByTagName=D.prototype.getElementsByTagName,me.prototype.getElementsByTagNameNS=D.prototype.getElementsByTagNameNS,N(D,Z);function U(){}U.prototype.nodeType=H,N(U,Z);function Q(){}Q.prototype={data:"",substringData:function(f,v){return this.data.substring(f,f+v)},appendData:function(f){f=this.data+f,this.nodeValue=this.data=f,this.length=f.length},insertData:function(f,v){this.replaceData(f,0,v)},appendChild:function(f){throw new Error(F[k])},deleteData:function(f,v){this.replaceData(f,v,"")},replaceData:function(f,v,I){var q=this.data.substring(0,f),fe=this.data.substring(f+v);I=q+I+fe,this.nodeValue=this.data=I,this.length=I.length}},N(Q,Z);function de(){}de.prototype={nodeName:"#text",nodeType:Y,splitText:function(f){var v=this.data,I=v.substring(f);v=v.substring(0,f),this.data=this.nodeValue=v,this.length=v.length;var q=this.ownerDocument.createTextNode(I);return this.parentNode&&this.parentNode.insertBefore(q,this.nextSibling),q}},N(de,Q);function he(){}he.prototype={nodeName:"#comment",nodeType:E},N(he,Q);function J(){}J.prototype={nodeName:"#cdata-section",nodeType:W},N(J,Q);function xe(){}xe.prototype.nodeType=g,N(xe,Z);function Be(){}Be.prototype.nodeType=z,N(Be,Z);function Ue(){}Ue.prototype.nodeType=B,N(Ue,Z);function _e(){}_e.prototype.nodeType=ie,N(_e,Z);function Le(){}Le.prototype.nodeName="#document-fragment",Le.prototype.nodeType=M,N(Le,Z);function Ve(){}Ve.prototype.nodeType=A,N(Ve,Z);function qe(){}qe.prototype.serializeToString=function(f,v,I){return Ge.call(f,v,I)},Z.prototype.toString=Ge;function Ge(f,v){var I=[],q=this.nodeType==9&&this.documentElement||this,fe=q.prefix,Re=q.namespaceURI;if(Re&&fe==null){var fe=q.lookupPrefix(Re);if(fe==null)var Me=[{namespace:Re,prefix:null}]}return Xe(this,I,f,v,Me),I.join("")}function Ke(f,v,I){var q=f.prefix||"",fe=f.namespaceURI;if(!fe||q==="xml"&&fe===r.XML||fe===r.XMLNS)return!1;for(var Re=I.length;Re--;){var Me=I[Re];if(Me.prefix===q)return Me.namespace!==fe}return!0}function We(f,v,I){f.push(" ",v,'="',I.replace(/[<>&"\t\n\r]/g,ne),'"')}function Xe(f,v,I,q,fe){if(fe||(fe=[]),q)if(f=q(f),f){if(typeof f=="string"){v.push(f);return}}else return;switch(f.nodeType){case P:var Re=f.attributes,Me=Re.length,_=f.firstChild,le=f.tagName;I=r.isHTML(f.namespaceURI)||I;var Ye=le;if(!I&&!f.prefix&&f.namespaceURI){for(var Qe,$e=0;$e=0;i--){var y=fe[i];if(y.prefix===""&&y.namespace===f.namespaceURI){Qe=y.namespace;break}}if(Qe!==f.namespaceURI)for(var i=fe.length-1;i>=0;i--){var y=fe[i];if(y.namespace===f.namespaceURI){y.prefix&&(Ye=y.prefix+":"+le);break}}}v.push("<",Ye);for(var s=0;s"),I&&/^script$/i.test(le))for(;_;)_.data?v.push(_.data):Xe(_,v,I,q,fe.slice()),_=_.nextSibling;else for(;_;)Xe(_,v,I,q,fe.slice()),_=_.nextSibling;v.push("")}else v.push("/>");return;case O:case M:for(var _=f.firstChild;_;)Xe(_,v,I,q,fe.slice()),_=_.nextSibling;return;case H:return We(v,f.name,f.value);case Y:return v.push(f.data.replace(/[<&>]/g,ne));case W:return v.push("");case E:return v.push("");case g:var j=f.publicId,te=f.systemId;if(v.push("");else if(te&&te!=".")v.push(" SYSTEM ",te,">");else{var ke=f.internalSubset;ke&&v.push(" [",ke,"]"),v.push(">")}return;case A:return v.push("");case ie:return v.push("&",f.nodeName,";");default:v.push("??",f.nodeName)}}function it(f,v,I){var q;switch(v.nodeType){case P:q=v.cloneNode(!1),q.ownerDocument=f;case M:break;case H:I=!0;break}if(q||(q=v.cloneNode(!1)),q.ownerDocument=f,q.parentNode=null,I)for(var fe=v.firstChild;fe;)q.appendChild(it(f,fe,I)),fe=fe.nextSibling;return q}function et(f,v,I){var q=new v.constructor;for(var fe in v)if(Object.prototype.hasOwnProperty.call(v,fe)){var Re=v[fe];typeof Re!="object"&&Re!=q[fe]&&(q[fe]=Re)}switch(v.childNodes&&(q.childNodes=new $),q.ownerDocument=f,q.nodeType){case P:var Me=v.attributes,le=q.attributes=new oe,Ye=Me.length;le._ownerElement=q;for(var Qe=0;Qe",lt:"<",quot:'"'}),t.HTML_ENTITIES=n({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",times:"\xD7",divide:"\xF7",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",euro:"\u20AC",trade:"\u2122",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"}),t.entityMap=t.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(o,t,e){var n=e("./node_modules/@xmldom/xmldom/lib/dom.js");t.DOMImplementation=n.DOMImplementation,t.XMLSerializer=n.XMLSerializer,t.DOMParser=e("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(o,t,e){var n=e("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,l=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,r=new RegExp("[\\-\\.0-9"+l.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),u=new RegExp("^"+l.source+r.source+"*(?::"+l.source+r.source+"*)?$"),S=0,w=1,x=2,C=3,T=4,N=5,K=6,P=7;function H(k,V){this.message=k,this.locator=V,Error.captureStackTrace&&Error.captureStackTrace(this,H)}H.prototype=new Error,H.prototype.name=H.name;function Y(){}Y.prototype={parse:function(k,V,X){var G=this.domBuilder;G.startDocument(),g(V,V={}),W(k,V,X,G,this.errorHandler),G.endDocument()}};function W(k,V,X,G,$){function re(D){if(D>65535){D-=65536;var U=55296+(D>>10),Q=56320+(D&1023);return String.fromCharCode(U,Q)}else return String.fromCharCode(D)}function ue(D){var U=D.slice(1,-1);return Object.hasOwnProperty.call(X,U)?X[U]:U.charAt(0)==="#"?re(parseInt(U.substr(1).replace("x","0x"))):($.error("entity not found:"+D),D)}function oe(D){if(D>me){var U=k.substring(me,D).replace(/&#?\w+;/g,ue);Z&&ee(me),G.characters(U,0,D-me),me=D}}function ee(D,U){for(;D>=ae&&(U=pe.exec(k));)ce=U.index,ae=ce+U[0].length,Z.lineNumber++;Z.columnNumber=D-ce+1}for(var ce=0,ae=0,pe=/.*(?:\r\n?|\n)|.*$/g,Z=G.locator,ne=[{currentNSMap:V}],ge={},me=0;;){try{var ve=k.indexOf("<",me);if(ve<0){if(!k.substr(me).match(/^\s*$/)){var ye=G.doc,Ce=ye.createTextNode(k.substr(me));ye.appendChild(Ce),G.currentElement=Ce}return}switch(ve>me&&oe(ve),k.charAt(ve+1)){case"/":var h=k.indexOf(">",ve+3),Ee=k.substring(ve+2,h).replace(/[ \t\n\r]+$/g,""),be=ne.pop();h<0?(Ee=k.substring(ve+2).replace(/[\s<].*/,""),$.error("end tag name: "+Ee+" is not complete:"+be.tagName),h=ve+1+Ee.length):Ee.match(/\sme?me=h:oe(Math.max(ve,me)+1)}}function ie(k,V){return V.lineNumber=k.lineNumber,V.columnNumber=k.columnNumber,V}function B(k,V,X,G,$,re){function ue(Z,ne,ge){X.attributeNames.hasOwnProperty(Z)&&re.fatalError("Attribute "+Z+" redefined"),X.addValue(Z,ne.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,$),ge)}for(var oe,ee,ce=++V,ae=S;;){var pe=k.charAt(ce);switch(pe){case"=":if(ae===w)oe=k.slice(V,ce),ae=C;else if(ae===x)ae=C;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ae===C||ae===w)if(ae===w&&(re.warning('attribute value must after "="'),oe=k.slice(V,ce)),V=ce+1,ce=k.indexOf(pe,V),ce>0)ee=k.slice(V,ce),ue(oe,ee,V-1),ae=N;else throw new Error("attribute value no end '"+pe+"' match");else if(ae==T)ee=k.slice(V,ce),ue(oe,ee,V),re.warning('attribute "'+oe+'" missed start quot('+pe+")!!"),V=ce+1,ae=N;else throw new Error('attribute value must after "="');break;case"/":switch(ae){case S:X.setTagName(k.slice(V,ce));case N:case K:case P:ae=P,X.closed=!0;case T:case w:case x:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return re.error("unexpected end of input"),ae==S&&X.setTagName(k.slice(V,ce)),ce;case">":switch(ae){case S:X.setTagName(k.slice(V,ce));case N:case K:case P:break;case T:case w:ee=k.slice(V,ce),ee.slice(-1)==="/"&&(X.closed=!0,ee=ee.slice(0,-1));case x:ae===x&&(ee=oe),ae==T?(re.warning('attribute "'+ee+'" missed quot(")!'),ue(oe,ee,V)):((!n.isHTML(G[""])||!ee.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+ee+'" missed value!! "'+ee+'" instead!!'),ue(ee,ee,V));break;case C:throw new Error("attribute value missed!!")}return ce;case"\x80":pe=" ";default:if(pe<=" ")switch(ae){case S:X.setTagName(k.slice(V,ce)),ae=K;break;case w:oe=k.slice(V,ce),ae=x;break;case T:var ee=k.slice(V,ce);re.warning('attribute "'+ee+'" missed quot(")!!'),ue(oe,ee,V);case N:ae=K;break}else switch(ae){case x:X.tagName,(!n.isHTML(G[""])||!oe.match(/^(?:disabled|checked|selected)$/i))&&re.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead2!!'),ue(oe,oe,V),V=ce,ae=w;break;case N:re.warning('attribute space is required"'+oe+'"!!');case K:ae=w,V=ce;break;case C:ae=T,V=ce;break;case P:throw new Error("elements closed character '/' and '>' must be connected to")}}ce++}}function A(k,V,X){for(var G=k.tagName,$=null,pe=k.length;pe--;){var re=k[pe],ue=re.qName,oe=re.value,Z=ue.indexOf(":");if(Z>0)var ee=re.prefix=ue.slice(0,Z),ce=ue.slice(Z+1),ae=ee==="xmlns"&&ce;else ce=ue,ee=null,ae=ue==="xmlns"&&"";re.localName=ce,ae!==!1&&($==null&&($={},g(X,X={})),X[ae]=$[ae]=oe,re.uri=n.XMLNS,V.startPrefixMapping(ae,oe))}for(var pe=k.length;pe--;){re=k[pe];var ee=re.prefix;ee&&(ee==="xml"&&(re.uri=n.XML),ee!=="xmlns"&&(re.uri=X[ee||""]))}var Z=G.indexOf(":");Z>0?(ee=k.prefix=G.slice(0,Z),ce=k.localName=G.slice(Z+1)):(ee=null,ce=k.localName=G);var ne=k.uri=X[ee||""];if(V.startElement(ne,ce,G,k),k.closed){if(V.endElement(ne,ce,G),$)for(ee in $)Object.prototype.hasOwnProperty.call($,ee)&&V.endPrefixMapping(ee)}else return k.currentNSMap=X,k.localNSMap=$,!0}function E(k,V,X,G,$){if(/^(?:script|textarea)$/i.test(X)){var re=k.indexOf("",V),ue=k.substring(V+1,re);if(/[&<]/.test(ue))return/^script$/i.test(X)?($.characters(ue,0,ue.length),re):(ue=ue.replace(/&#?\w+;/g,G),$.characters(ue,0,ue.length),re)}return V+1}function O(k,V,X,G){var $=G[X];return $==null&&($=k.lastIndexOf(""),$",V+4);return re>V?(X.comment(k,V+4,re-V-4),re+3):(G.error("Unclosed comment"),-1)}else return-1;default:if(k.substr(V+3,6)=="CDATA["){var re=k.indexOf("]]>",V+9);return X.startCDATA(),X.characters(k,V+9,re-V-9),X.endCDATA(),re+3}var ue=F(k,V),oe=ue.length;if(oe>1&&/!doctype/i.test(ue[0][0])){var ee=ue[1][0],ce=!1,ae=!1;oe>3&&(/^public$/i.test(ue[2][0])?(ce=ue[3][0],ae=oe>4&&ue[4][0]):/^system$/i.test(ue[2][0])&&(ae=ue[3][0]));var pe=ue[oe-1];return X.startDTD(ee,ce,ae),X.endDTD(),pe.index+pe[0].length}}return-1}function z(k,V,X){var G=k.indexOf("?>",V);if(G){var $=k.substring(V,G).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return $?($[0].length,X.processingInstruction($[1],$[2]),G+2):-1}return-1}function L(){this.attributeNames={}}L.prototype={setTagName:function(k){if(!u.test(k))throw new Error("invalid tagName:"+k);this.tagName=k},addValue:function(k,V,X){if(!u.test(k))throw new Error("invalid attribute:"+k);this.attributeNames[k]=this.length,this[this.length++]={qName:k,value:V,offset:X}},length:0,getLocalName:function(k){return this[k].localName},getLocator:function(k){return this[k].locator},getQName:function(k){return this[k].qName},getURI:function(k){return this[k].uri},getValue:function(k){return this[k].value}};function F(k,V){var X,G=[],$=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for($.lastIndex=V,$.exec(k);X=$.exec(k);)if(G.push(X),X[1])return G}t.XMLReader=Y,t.ParseError=H},"./node_modules/process/browser.js":function(o,t){var e=o.exports={},n,l;function r(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?n=setTimeout:n=r}catch(W){n=r}try{typeof clearTimeout=="function"?l=clearTimeout:l=u}catch(W){l=u}})();function S(W){if(n===setTimeout)return setTimeout(W,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(W,0);try{return n(W,0)}catch(ie){try{return n.call(null,W,0)}catch(B){return n.call(this,W,0)}}}function w(W){if(l===clearTimeout)return clearTimeout(W);if((l===u||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(W);try{return l(W)}catch(ie){try{return l.call(null,W)}catch(B){return l.call(this,W)}}}var x=[],C=!1,T,N=-1;function K(){!C||!T||(C=!1,T.length?x=T.concat(x):N=-1,x.length&&P())}function P(){if(!C){var W=S(K);C=!0;for(var ie=x.length;ie;){for(T=x,x=[];++N1)for(var B=1;Bue)return ge(null,!1);if(me>1){var ve=Math.max(ne[0].Size,ne[1].Size);if(ve!==re)return ge(null,!1)}var ye=function Ce(Ee){if(Ee=ge.length){pe.emit("has_and_check_upload_id",Z);return}var Ce=ge[ye];if(!S.isInArray(Z,Ce)){l.removeUploadId.call(X,Ce),ve(ye+1);return}if(l.using[Ce]){ve(ye+1);return}N.call(X,{Bucket:L,Region:F,Key:k,UploadId:Ce,tracker:g.tracker},function(Ee,be){!X._isRunningTask(z)||(Ee?(l.removeUploadId.call(X,Ce),ve(ye+1)):pe.emit("upload_id_available",{UploadId:Ce,PartList:be.PartList}))})};me(0)}),pe.on("get_remote_upload_id_list",function(){T.call(X,{Bucket:L,Region:F,Key:k,tracker:g.tracker},function(Z,ne){if(!!X._isRunningTask(z)){if(Z)return pe.emit("error",Z);var ge=S.filter(ne.UploadList,function(ye){return ye.Key===k&&(!V||ye.StorageClass.toUpperCase()===V.toUpperCase())}).reverse().map(function(ye){return ye.UploadId||ye.UploadID});if(ge.length)pe.emit("seek_local_avail_upload_id",ge);else{var me=l.getFileId(g.Body,g.ChunkSize,L,k),ve;me&&(ve=l.getUploadIdList.call(X,me))&&S.each(ve,function(ye){l.removeUploadId.call(X,ye)}),pe.emit("no_available_upload_id")}}})}),pe.emit("get_remote_upload_id_list")}function T(g,M){var z=this,L=[],F={Bucket:g.Bucket,Region:g.Region,Prefix:g.Key,calledBySdk:g.calledBySdk||"sliceUploadFile",tracker:g.tracker},k=function V(){z.multipartList(F,function(X,G){if(X)return M(X);L.push.apply(L,G.Upload||[]),G.IsTruncated==="true"?(F.KeyMarker=G.NextKeyMarker,F.UploadIdMarker=G.NextUploadIdMarker,V()):M(null,{UploadList:L})})};k()}function N(g,M){var z=this,L=[],F={Bucket:g.Bucket,Region:g.Region,Key:g.Key,UploadId:g.UploadId,calledBySdk:"sliceUploadFile",tracker:g.tracker},k=function V(){z.multipartListPart(F,function(X,G){if(X)return M(X);L.push.apply(L,G.Part||[]),G.IsTruncated==="true"?(F.PartNumberMarker=G.NextPartNumberMarker,V()):M(null,{PartList:L})})};k()}function K(g,M){var z=this,L=g.TaskId,F=g.Bucket,k=g.Region,V=g.Key,X=g.UploadData,G=g.FileSize,$=g.SliceSize,re=Math.min(g.AsyncLimit||z.options.ChunkParallelLimit||1,256),ue=g.Body,oe=Math.ceil(G/$),ee=0,ce=g.ServerSideEncryption,ae=g.Headers,pe=S.filter(X.PartList,function(ne){return ne.Uploaded&&(ee+=ne.PartNumber>=oe&&G%$||$),!ne.Uploaded}),Z=g.onProgress;r.eachLimit(pe,re,function(ne,ge){if(!!z._isRunningTask(L)){var me=ne.PartNumber,ve=Math.min(G,ne.PartNumber*$)-(ne.PartNumber-1)*$,ye=0;P.call(z,{TaskId:L,Bucket:F,Region:k,Key:V,SliceSize:$,FileSize:G,PartNumber:me,ServerSideEncryption:ce,Body:ue,UploadData:X,Headers:ae,onProgress:function(Ee){ee+=Ee.loaded-ye,ye=Ee.loaded,Z({loaded:ee,total:G})},tracker:g.tracker},function(Ce,Ee){!z._isRunningTask(L)||(!Ce&&!Ee.ETag&&(Ce='get ETag error, please add "ETag" to CORS ExposeHeader setting.( \u83B7\u53D6ETag\u5931\u8D25\uFF0C\u8BF7\u5728CORS ExposeHeader\u8BBE\u7F6E\u4E2D\u6DFB\u52A0ETag\uFF0C\u8BF7\u53C2\u8003\u6587\u6863\uFF1Ahttps://cloud.tencent.com/document/product/436/13318 )'),Ce?ee-=ye:(ee+=ve-ye,ne.ETag=Ee.ETag),Z({loaded:ee,total:G}),ge(Ce||null,Ee))})}},function(ne){if(!!z._isRunningTask(L)){if(ne)return M(ne);M(null,{UploadId:X.UploadId,SliceList:X.PartList})}})}function P(g,M){var z=this,L=g.TaskId,F=g.Bucket,k=g.Region,V=g.Key,X=g.FileSize,G=g.Body,$=g.PartNumber*1,re=g.SliceSize,ue=g.ServerSideEncryption,oe=g.UploadData,ee=g.Headers||{},ce=z.options.ChunkRetryTimes+1,ae=re*($-1),pe=re,Z=ae+re;Z>X&&(Z=X,pe=Z-ae);var ne=["x-cos-traffic-limit","x-cos-mime-limit"],ge={};S.each(ee,function(ve,ye){ne.indexOf(ye)>-1&&(ge[ye]=ve)});var me=oe.PartList[$-1];r.retry(ce,function(ve){!z._isRunningTask(L)||S.fileSlice(G,ae,Z,!0,function(ye){z.multipartUpload({TaskId:L,Bucket:F,Region:k,Key:V,ContentLength:pe,PartNumber:$,UploadId:oe.UploadId,ServerSideEncryption:ue,Body:ye,Headers:ge,onProgress:g.onProgress,calledBySdk:"sliceUploadFile",tracker:g.tracker},function(Ce,Ee){if(!!z._isRunningTask(L))return Ce?ve(Ce):(me.Uploaded=!0,ve(null,Ee))})})},function(ve,ye){if(!!z._isRunningTask(L))return M(ve,ye)})}function H(g,M){var z=g.Bucket,L=g.Region,F=g.Key,k=g.UploadId,V=g.SliceList,X=this,G=this.options.ChunkRetryTimes+1,$=g.Headers,re=V.map(function(ue){return{PartNumber:ue.PartNumber,ETag:ue.ETag}});r.retry(G,function(ue){X.multipartComplete({Bucket:z,Region:L,Key:F,UploadId:k,Parts:re,Headers:$,calledBySdk:"sliceUploadFile",tracker:g.tracker},ue)},function(ue,oe){M(ue,oe)})}function Y(g,M){var z=g.Bucket,L=g.Region,F=g.Key,k=g.UploadId,V=g.Level||"task",X=g.AsyncLimit,G=this,$=new u;if($.on("error",function(re){return M(re)}),$.on("get_abort_array",function(re){W.call(G,{Bucket:z,Region:L,Key:F,Headers:g.Headers,AsyncLimit:X,AbortArray:re},M)}),V==="bucket")T.call(G,{Bucket:z,Region:L,calledBySdk:"abortUploadTask"},function(re,ue){if(re)return M(re);$.emit("get_abort_array",ue.UploadList||[])});else if(V==="file"){if(!F)return M(S.error(new Error("abort_upload_task_no_key")));T.call(G,{Bucket:z,Region:L,Key:F,calledBySdk:"abortUploadTask"},function(re,ue){if(re)return M(re);$.emit("get_abort_array",ue.UploadList||[])})}else if(V==="task"){if(!k)return M(S.error(new Error("abort_upload_task_no_id")));if(!F)return M(S.error(new Error("abort_upload_task_no_key")));$.emit("get_abort_array",[{Key:F,UploadId:k}])}else return M(S.error(new Error("abort_unknown_level")))}function W(g,M){var z=g.Bucket,L=g.Region,F=g.Key,k=g.AbortArray,V=g.AsyncLimit||1,X=this,G=0,$=new Array(k.length);r.eachLimit(k,V,function(re,ue){var oe=G;if(F&&F!==re.Key){$[oe]={error:{KeyNotMatch:!0}},ue(null);return}var ee=re.UploadId||re.UploadID;X.multipartAbort({Bucket:z,Region:L,Key:re.Key,Headers:g.Headers,UploadId:ee},function(ce){var ae={Bucket:z,Region:L,Key:re.Key,UploadId:ee};$[oe]={error:ce,task:ae},ue(null)}),G++},function(re){if(re)return M(re);for(var ue=[],oe=[],ee=0,ce=$.length;eeL?"sliceUploadFile":"putObject",oe=g.onFileFinish,ee=function(ae,pe){g.tracker&&g.tracker.formatResult(ae,pe),oe&&oe(ae,pe,X),M&&M(ae,pe)};F.push({api:ue,params:g,callback:ee}),z._addTasks(F)}function B(g,M){var z=this,L=g.SliceSize===void 0?z.options.SliceSize:g.SliceSize,F=0,k=0,V=S.throttleOnProgress.call(z,k,g.onProgress),X=g.files.length,G=g.onFileFinish,$=Array(X),re=function(ee,ce,ae){V(null,!0),G&&G(ee,ce,ae),$[ae.Index]={options:ae,error:ee,data:ce},--X<=0&&M&&M(null,{files:$})},ue=[];S.each(g.files,function(oe,ee){(function(){var ce=oe.Body,ae=ce.size||ce.length||0,pe={Index:ee,TaskId:""};if(!z.options.UseRawKey&&oe.Key&&oe.Key.substr(0,1)==="/"&&(oe.Key=oe.Key.substr(1)),F+=ae,z.options.EnableTracker){var Z=z.options.UseAccelerate||typeof z.options.Domain=="string"&&z.options.Domain.includes("accelerate.");oe.tracker=new w({bucket:oe.Bucket,region:oe.Region,apiName:"uploadFiles",fileKey:oe.Key,fileSize:ae,accelerate:Z,deepTracker:z.options.DeepTracker,customId:z.options.CustomId,delay:z.options.TrackerDelay})}S.each(oe,function(Oe,we){n(Oe)!=="object"&&typeof Oe!="function"&&(pe[we]=Oe)});var ne=oe.onTaskReady,ge=function(we){pe.TaskId=we,ne&&ne(we)};oe.onTaskReady=ge;var me=0,ve=oe.onProgress,ye=function(we){k=k-me+we.loaded,me=we.loaded,ve&&ve(we),V({loaded:k,total:F})};oe.onProgress=ye;var Ce=ae>L?"sliceUploadFile":"putObject",Ee=oe.onFileFinish,be=function(we,De){oe.tracker&&oe.tracker.formatResult(we,De),Ee&&Ee(we,De),re&&re(we,De,pe)};ue.push({api:Ce,params:oe,callback:be})})()}),z._addTasks(ue)}function A(g,M){var z=new u,L=this,F=g.Bucket,k=g.Region,V=g.Key,X=g.CopySource,G=S.getSourceParams.call(this,X);if(!G){M(S.error(new Error("CopySource format error")));return}var $=G.Bucket,re=G.Region,ue=decodeURIComponent(G.Key),oe=g.CopySliceSize===void 0?L.options.CopySliceSize:g.CopySliceSize;oe=Math.max(0,oe);var ee=g.CopyChunkSize||this.options.CopyChunkSize,ce=this.options.CopyChunkParallelLimit,ae=this.options.ChunkRetryTimes+1,pe=0,Z=0,ne,ge,me={},ve={},ye={};z.on("copy_slice_complete",function(Ce){S.each(g.Headers,function(be,Oe){Oe.toLowerCase().indexOf("x-cos-meta-")});var Ee=S.map(Ce.PartList,function(be){return{PartNumber:be.PartNumber,ETag:be.ETag}});r.retry(ae,function(be){L.multipartComplete({Bucket:F,Region:k,Key:V,UploadId:Ce.UploadId,Parts:Ee,calledBySdk:"sliceCopyFile"},be)},function(be,Oe){if(l.removeUsing(Ce.UploadId),be)return ge(null,!0),M(be);l.removeUploadId(Ce.UploadId),ge({loaded:ne,total:ne},!0),M(null,Oe)})}),z.on("get_copy_data_finish",function(Ce){var Ee=l.getCopyFileId(X,me,ee,F,V);Ee&&l.saveUploadId(Ee,Ce.UploadId,L.options.UploadIdCacheLimit),l.setUsing(Ce.UploadId);var be=S.filter(Ce.PartList,function(Oe){return Oe.Uploaded&&(Z+=Oe.PartNumber>=pe&&ne%ee||ee),!Oe.Uploaded});r.eachLimit(be,ce,function(Oe,we){var De=Oe.PartNumber,He=Oe.CopySourceRange,Pe=Oe.end-Oe.start;r.retry(ae,function(se){E.call(L,{Bucket:F,Region:k,Key:V,CopySource:X,UploadId:Ce.UploadId,PartNumber:De,CopySourceRange:He},se)},function(se,h){if(se)return we(se);Z+=Pe,ge({loaded:Z,total:ne}),Oe.ETag=h.ETag,we(se||null,h)})},function(Oe){if(Oe)return l.removeUsing(Ce.UploadId),ge(null,!0),M(Oe);z.emit("copy_slice_complete",Ce)})}),z.on("get_chunk_size_finish",function(){var Ce=function(){L.multipartInit({Bucket:F,Region:k,Key:V,Headers:ye},function(De,He){if(De)return M(De);g.UploadId=He.UploadId,z.emit("get_copy_data_finish",{UploadId:g.UploadId,PartList:g.PartList})})},Ee=l.getCopyFileId(X,me,ee,F,V),be=l.getUploadIdList(Ee);if(!Ee||!be)return Ce();var Oe=function we(De){if(De>=be.length)return Ce();var He=be[De];if(l.using[He])return we(De+1);N.call(L,{Bucket:F,Region:k,Key:V,UploadId:He},function(Pe,se){if(Pe)l.removeUploadId(He),we(De+1);else{if(l.using[He])return we(De+1);var h={},c=0;S.each(se.PartList,function(a){var d=parseInt(a.Size),m=c+d-1;h[a.PartNumber+"|"+c+"|"+m]=a.ETag,c+=d}),S.each(g.PartList,function(a){var d=h[a.PartNumber+"|"+a.start+"|"+a.end];d&&(a.ETag=d,a.Uploaded=!0)}),z.emit("get_copy_data_finish",{UploadId:He,PartList:g.PartList})}})};Oe(0)}),z.on("get_file_size_finish",function(){if(function(){for(var Ee=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],be=1024*1024,Oe=0;OeDe.length&&(ve[we]=Oe)}),z.emit("get_file_size_finish")}})}function E(g,M){var z=g.TaskId,L=g.Bucket,F=g.Region,k=g.Key,V=g.CopySource,X=g.UploadId,G=g.PartNumber*1,$=g.CopySourceRange,re=this.options.ChunkRetryTimes+1,ue=this;r.retry(re,function(oe){ue.uploadPartCopy({TaskId:z,Bucket:L,Region:F,Key:k,CopySource:V,UploadId:X,PartNumber:G,CopySourceRange:$},function(ee,ce){oe(ee||null,ce)})},function(oe,ee){return M(oe,ee)})}var O={sliceUploadFile:x,abortUploadTask:Y,uploadFile:ie,uploadFiles:B,sliceCopyFile:A};o.exports.init=function(g,M){M.transferToTaskMethod(O,"sliceUploadFile"),S.each(O,function(z,L){g.prototype[L]=S.apiWrapper(L,z)})}},"./src/async.js":function(o,t){var e=function(u,S,w,x){if(x=x||function(){},!u.length||S<=0)return x();var C=0,T=0,N=0;(function K(){if(C>=u.length)return x();for(;N=u.length?x():K())})})()},n=function(u,S,w){var x=function C(T){S(function(N,K){N&&T/gi,"<$1Rule>"),p=p.replace(/<(\/?)Tags>/gi,"<$1Tag>");var R=i.Headers;R["Content-Type"]="application/xml",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:p,action:"replication",headers:R},function(b,_){if(b&&b.statusCode===204)return y(null,{statusCode:b.statusCode});if(b)return y(b);y(null,{statusCode:_.statusCode,headers:_.headers})})}function V(i,y){le.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"replication"},function(s,p){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="ReplicationConfigurationnotFoundError")){var R={ReplicationConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}!p.ReplicationConfiguration&&(p.ReplicationConfiguration={}),p.ReplicationConfiguration.Rule&&(p.ReplicationConfiguration.Rules=r.makeArray(p.ReplicationConfiguration.Rule),delete p.ReplicationConfiguration.Rule),y(s,p)})}function X(i,y){le.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"replication"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function G(i,y){if(!i.WebsiteConfiguration){y(r.error(new Error("missing param WebsiteConfiguration")));return}var s=r.clone(i.WebsiteConfiguration||{}),p=s.RoutingRules||s.RoutingRule||[];p=r.isArray(p)?p:[p],delete s.RoutingRule,delete s.RoutingRules,p.length&&(s.RoutingRules={RoutingRule:p});var R=r.json2xml({WebsiteConfiguration:s}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"website",headers:b},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function $(i,y){le.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"website"},function(s,p){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchWebsiteConfiguration"){var R={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=p.WebsiteConfiguration||{};if(b.RoutingRules){var _=r.clone(b.RoutingRules.RoutingRule||[]);_=r.makeArray(_),b.RoutingRules=_}y(null,{WebsiteConfiguration:b,statusCode:p.statusCode,headers:p.headers})})}function re(i,y){le.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"website"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function ue(i,y){if(!i.RefererConfiguration){y(r.error(new Error("missing param RefererConfiguration")));return}var s=r.clone(i.RefererConfiguration||{}),p=s.DomainList||{},R=p.Domains||p.Domain||[];R=r.isArray(R)?R:[R],R.length&&(s.DomainList={Domain:R});var b=r.json2xml({RefererConfiguration:s}),_=i.Headers;_["Content-Type"]="application/xml",_["Content-MD5"]=r.b64(r.md5(b)),le.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:b,action:"referer",headers:_},function(j,te){if(j&&j.statusCode===204)return y(null,{statusCode:j.statusCode});if(j)return y(j);y(null,{statusCode:te.statusCode,headers:te.headers})})}function oe(i,y){le.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"referer"},function(s,p){if(s){if(s.statusCode===404&&s.error.Code==="NoSuchRefererConfiguration"){var R={WebsiteConfiguration:{},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=p.RefererConfiguration||{};if(b.DomainList){var _=r.makeArray(b.DomainList.Domain||[]);b.DomainList={Domains:_}}y(null,{RefererConfiguration:b,statusCode:p.statusCode,headers:p.headers})})}function ee(i,y){var s=i.DomainConfiguration||{},p=s.DomainRule||i.DomainRule||[];p=r.clone(p);var R=r.json2xml({DomainConfiguration:{DomainRule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"domain",headers:b},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function ce(i,y){le.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"domain"},function(s,p){if(s)return y(s);var R=[];try{R=p.DomainConfiguration.DomainRule||[]}catch(b){}R=r.clone(r.isArray(R)?R:[R]),y(null,{DomainRule:R,statusCode:p.statusCode,headers:p.headers})})}function ae(i,y){le.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"domain"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function pe(i,y){var s=i.OriginConfiguration||{},p=s.OriginRule||i.OriginRule||[];p=r.clone(p);var R=r.json2xml({OriginConfiguration:{OriginRule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"origin",headers:b},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Z(i,y){le.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"origin"},function(s,p){if(s)return y(s);var R=[];try{R=p.OriginConfiguration.OriginRule||[]}catch(b){}R=r.clone(r.isArray(R)?R:[R]),y(null,{OriginRule:R,statusCode:p.statusCode,headers:p.headers})})}function ne(i,y){le.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"origin"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function ge(i,y){var s=r.json2xml({BucketLoggingStatus:i.BucketLoggingStatus||""}),p=i.Headers;p["Content-Type"]="application/xml",p["Content-MD5"]=r.b64(r.md5(s)),le.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:s,action:"logging",headers:p},function(R,b){if(R&&R.statusCode===204)return y(null,{statusCode:R.statusCode});if(R)return y(R);y(null,{statusCode:b.statusCode,headers:b.headers})})}function me(i,y){le.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"logging"},function(s,p){if(s)return y(s);y(null,{BucketLoggingStatus:p.BucketLoggingStatus,statusCode:p.statusCode,headers:p.headers})})}function ve(i,y,s){var p=r.clone(y.InventoryConfiguration);if(p.OptionalFields){var R=p.OptionalFields||[];p.OptionalFields={Field:R}}if(p.Destination&&p.Destination.COSBucketDestination&&p.Destination.COSBucketDestination.Encryption){var b=p.Destination.COSBucketDestination.Encryption;Object.keys(b).indexOf("SSECOS")>-1&&(b["SSE-COS"]=b.SSECOS,delete b.SSECOS)}var _=r.json2xml({InventoryConfiguration:p}),j=y.Headers;j["Content-Type"]="application/xml",j["Content-MD5"]=r.b64(r.md5(_));var te=i==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";le.call(this,{Action:te,method:i,Bucket:y.Bucket,Region:y.Region,body:_,action:"inventory",qs:{id:y.Id},headers:j},function(ke,Te){if(ke&&ke.statusCode===204)return s(null,{statusCode:ke.statusCode});if(ke)return s(ke);s(null,{statusCode:Te.statusCode,headers:Te.headers})})}function ye(i,y){return ve.call(this,"PUT",i,y)}function Ce(i,y){return ve.call(this,"POST",i,y)}function Ee(i,y){le.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{id:i.Id}},function(s,p){if(s)return y(s);var R=p.InventoryConfiguration;if(R&&R.OptionalFields&&R.OptionalFields.Field){var b=R.OptionalFields.Field;r.isArray(b)||(b=[b]),R.OptionalFields=b}if(R.Destination&&R.Destination.COSBucketDestination&&R.Destination.COSBucketDestination.Encryption){var _=R.Destination.COSBucketDestination.Encryption;Object.keys(_).indexOf("SSE-COS")>-1&&(_.SSECOS=_["SSE-COS"],delete _["SSE-COS"])}y(null,{InventoryConfiguration:R,statusCode:p.statusCode,headers:p.headers})})}function be(i,y){le.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{"continuation-token":i.ContinuationToken}},function(s,p){if(s)return y(s);var R=p.ListInventoryConfigurationResult,b=R.InventoryConfiguration||[];b=r.isArray(b)?b:[b],delete R.InventoryConfiguration,r.each(b,function(_){if(_&&_.OptionalFields&&_.OptionalFields.Field){var j=_.OptionalFields.Field;r.isArray(j)||(j=[j]),_.OptionalFields=j}if(_.Destination&&_.Destination.COSBucketDestination&&_.Destination.COSBucketDestination.Encryption){var te=_.Destination.COSBucketDestination.Encryption;Object.keys(te).indexOf("SSE-COS")>-1&&(te.SSECOS=te["SSE-COS"],delete te["SSE-COS"])}}),R.InventoryConfigurations=b,r.extend(R,{statusCode:p.statusCode,headers:p.headers}),y(null,R)})}function Oe(i,y){le.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"inventory",qs:{id:i.Id}},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function we(i,y){if(!i.AccelerateConfiguration){y(r.error(new Error("missing param AccelerateConfiguration")));return}var s={AccelerateConfiguration:i.AccelerateConfiguration||{}},p=r.json2xml(s),R={};R["Content-Type"]="application/xml",R["Content-MD5"]=r.b64(r.md5(p)),le.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:p,action:"accelerate",headers:R},function(b,_){if(b)return y(b);y(null,{statusCode:_.statusCode,headers:_.headers})})}function De(i,y){le.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:i.Bucket,Region:i.Region,action:"accelerate"},function(s,p){s||!p.AccelerateConfiguration&&(p.AccelerateConfiguration={}),y(s,p)})}function He(i,y){var s=i.ServerSideEncryptionConfiguration||{},p=s.Rule||s.Rules||[],R=r.json2xml({ServerSideEncryptionConfiguration:{Rule:p}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:i.Bucket,Region:i.Region,body:R,action:"encryption",headers:b},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Pe(i,y){le.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"encryption"},function(s,p){if(s){if(s.statusCode===404&&s.code==="NoSuchEncryptionConfiguration"){var R={EncryptionConfiguration:{Rules:[]},statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=r.makeArray(p.EncryptionConfiguration&&p.EncryptionConfiguration.Rule||[]);p.EncryptionConfiguration={Rules:b},y(s,p)})}function se(i,y){le.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"encryption"},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function h(i,y){le.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,headers:i.Headers},function(s,p){if(s){var R=s.statusCode;return i.Headers["If-Modified-Since"]&&R&&R===304?y(null,{NotModified:!0,statusCode:R}):y(s)}p.ETag=r.attr(p.headers,"etag",""),y(null,p)})}function c(i,y){var s={};s.prefix=i.Prefix||"",s.delimiter=i.Delimiter,s["key-marker"]=i.KeyMarker,s["version-id-marker"]=i.VersionIdMarker,s["max-keys"]=i.MaxKeys,s["encoding-type"]=i.EncodingType,le.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:s.prefix,method:"GET",Bucket:i.Bucket,Region:i.Region,headers:i.Headers,qs:s,action:"versions"},function(p,R){if(p)return y(p);var b=R.ListVersionsResult||{},_=b.DeleteMarker||[];_=r.isArray(_)?_:[_];var j=b.Version||[];j=r.isArray(j)?j:[j];var te=r.clone(b);delete te.DeleteMarker,delete te.Version,r.extend(te,{DeleteMarkers:_,Versions:j,statusCode:R.statusCode,headers:R.headers}),y(null,te)})}function a(i,y){var s=i.Query||{},p=i.QueryString||"",R=r.throttleOnProgress.call(this,0,i.onProgress),b=i.tracker;b&&b.setParams({signStartTime:new Date().getTime()}),s["response-content-type"]=i.ResponseContentType,s["response-content-language"]=i.ResponseContentLanguage,s["response-expires"]=i.ResponseExpires,s["response-cache-control"]=i.ResponseCacheControl,s["response-content-disposition"]=i.ResponseContentDisposition,s["response-content-encoding"]=i.ResponseContentEncoding,le.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,DataType:i.DataType,headers:i.Headers,qs:s,qsStr:p,rawBody:!0,onDownloadProgress:R,tracker:b},function(_,j){if(R(null,!0),_){var te=_.statusCode;return i.Headers["If-Modified-Since"]&&te&&te===304?y(null,{NotModified:!0}):y(_)}y(null,{Body:j.body,ETag:r.attr(j.headers,"etag",""),statusCode:j.statusCode,headers:j.headers})})}function d(i,y){var s=this,p=i.ContentLength,R=r.throttleOnProgress.call(s,p,i.onProgress),b=i.Headers;!b["Cache-Control"]&&!b["cache-control"]&&(b["Cache-Control"]=""),!b["Content-Type"]&&!b["content-type"]&&(b["Content-Type"]=i.Body&&i.Body.type||"");var _=i.UploadAddMetaMd5||s.options.UploadAddMetaMd5||s.options.UploadCheckContentMd5,j=i.tracker;_&&j&&j.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(_,i.Body,function(te){te&&(j&&j.setParams({md5EndTime:new Date().getTime()}),s.options.UploadCheckContentMd5&&(b["Content-MD5"]=r.b64(te)),(i.UploadAddMetaMd5||s.options.UploadAddMetaMd5)&&(b["x-cos-meta-md5"]=te)),i.ContentLength!==void 0&&(b["Content-Length"]=i.ContentLength),R(null,!0),le.call(s,{Action:"name/cos:PutObject",TaskId:i.TaskId,method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:i.Query,body:i.Body,onProgress:R,tracker:j},function(ke,Te){if(ke)return R(null,!0),y(ke);R({loaded:p,total:p},!0);var Se=q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:s.options.UseAccelerate?"accelerate":i.Region,object:i.Key});Se=Se.substr(Se.indexOf("://")+3),Te.Location=Se,Te.ETag=r.attr(Te.headers,"etag",""),y(null,Te)})},i.onHashProgress)}function m(i,y){le.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,VersionId:i.VersionId,action:i.Recursive?"recursive":""},function(s,p){if(s){var R=s.statusCode;return R&&R===404?y(null,{BucketNotFound:!0,statusCode:R}):y(s)}y(null,{statusCode:p.statusCode,headers:p.headers})})}function D(i,y){var s={};i.VersionId&&(s.versionId=i.VersionId),le.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,qs:s,action:"acl"},function(p,R){if(p)return y(p);var b=R.AccessControlPolicy||{},_=b.Owner||{},j=b.AccessControlList&&b.AccessControlList.Grant||[];j=r.isArray(j)?j:[j];var te=v(b);delete te.GrantWrite,R.headers&&R.headers["x-cos-acl"]&&(te.ACL=R.headers["x-cos-acl"]),te=r.extend(te,{Owner:_,Grants:j,statusCode:R.statusCode,headers:R.headers}),y(null,te)})}function U(i,y){var s=i.Headers,p="";if(i.AccessControlPolicy){var R=r.clone(i.AccessControlPolicy||{}),b=R.Grants||R.Grant;b=r.isArray(b)?b:[b],delete R.Grant,delete R.Grants,R.AccessControlList={Grant:b},p=r.json2xml({AccessControlPolicy:R}),s["Content-Type"]="application/xml",s["Content-MD5"]=r.b64(r.md5(p))}r.each(s,function(_,j){j.indexOf("x-cos-grant-")===0&&(s[j]=I(s[j]))}),le.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,action:"acl",headers:s,body:p},function(_,j){if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Q(i,y){var s=i.Headers;s.Origin=i.Origin,s["Access-Control-Request-Method"]=i.AccessControlRequestMethod,s["Access-Control-Request-Headers"]=i.AccessControlRequestHeaders,le.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:s},function(p,R){if(p)return p.statusCode&&p.statusCode===403?y(null,{OptionsForbidden:!0,statusCode:p.statusCode}):y(p);var b=R.headers||{};y(null,{AccessControlAllowOrigin:b["access-control-allow-origin"],AccessControlAllowMethods:b["access-control-allow-methods"],AccessControlAllowHeaders:b["access-control-allow-headers"],AccessControlExposeHeaders:b["access-control-expose-headers"],AccessControlMaxAge:b["access-control-max-age"],statusCode:R.statusCode,headers:R.headers})})}function de(i,y){var s=this,p=i.Headers;!p["Cache-Control"]&&!p["cache-control"]&&(p["Cache-Control"]="");var R=i.CopySource||"",b=r.getSourceParams.call(this,R);if(!b){y(r.error(new Error("CopySource format error")));return}var _=b.Bucket,j=b.Region,te=decodeURIComponent(b.Key);le.call(this,{Scope:[{action:"name/cos:GetObject",bucket:_,region:j,prefix:te},{action:"name/cos:PutObject",bucket:i.Bucket,region:i.Region,prefix:i.Key}],method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,headers:i.Headers},function(ke,Te){if(ke)return y(ke);var Se=r.clone(Te.CopyObjectResult||{}),Ae=q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:i.Bucket,region:i.Region,object:i.Key,isLocation:!0});r.extend(Se,{Location:Ae,statusCode:Te.statusCode,headers:Te.headers}),y(null,Se)})}function he(i,y){var s=i.CopySource||"",p=r.getSourceParams.call(this,s);if(!p){y(r.error(new Error("CopySource format error")));return}var R=p.Bucket,b=p.Region,_=decodeURIComponent(p.Key);le.call(this,{Scope:[{action:"name/cos:GetObject",bucket:R,region:b,prefix:_},{action:"name/cos:PutObject",bucket:i.Bucket,region:i.Region,prefix:i.Key}],method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,qs:{partNumber:i.PartNumber,uploadId:i.UploadId},headers:i.Headers},function(j,te){if(j)return y(j);var ke=r.clone(te.CopyPartResult||{});r.extend(ke,{statusCode:te.statusCode,headers:te.headers}),y(null,ke)})}function J(i,y){var s=i.Objects||[],p=i.Quiet;s=r.isArray(s)?s:[s];var R=r.json2xml({Delete:{Object:s,Quiet:p||!1}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R));var _=r.map(s,function(j){return{action:"name/cos:DeleteObject",bucket:i.Bucket,region:i.Region,prefix:j.Key}});le.call(this,{Scope:_,method:"POST",Bucket:i.Bucket,Region:i.Region,body:R,action:"delete",headers:b},function(j,te){if(j)return y(j);var ke=te.DeleteResult||{},Te=ke.Deleted||[],Se=ke.Error||[];Te=r.isArray(Te)?Te:[Te],Se=r.isArray(Se)?Se:[Se];var Ae=r.clone(ke);r.extend(Ae,{Error:Se,Deleted:Te,statusCode:te.statusCode,headers:te.headers}),y(null,Ae)})}function xe(i,y){var s=i.Headers;if(!i.RestoreRequest){y(r.error(new Error("missing param RestoreRequest")));return}var p=i.RestoreRequest||{},R=r.json2xml({RestoreRequest:p});s["Content-Type"]="application/xml",s["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,VersionId:i.VersionId,body:R,action:"restore",headers:s},y)}function Be(i,y){var s=i.Tagging||{},p=s.TagSet||s.Tags||i.Tags||[];p=r.clone(r.isArray(p)?p:[p]);var R=r.json2xml({Tagging:{TagSet:{Tag:p}}}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:i.Bucket,Key:i.Key,Region:i.Region,body:R,action:"tagging",headers:b,VersionId:i.VersionId},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);y(null,{statusCode:j.statusCode,headers:j.headers})})}function Ue(i,y){le.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:i.Key,Bucket:i.Bucket,Region:i.Region,headers:i.Headers,action:"tagging",VersionId:i.VersionId},function(s,p){if(s){if(s.statusCode===404&&s.error&&(s.error==="Not Found"||s.error.Code==="NoSuchTagSet")){var R={Tags:[],statusCode:s.statusCode};s.headers&&(R.headers=s.headers),y(null,R)}else y(s);return}var b=[];try{b=p.Tagging.TagSet.Tag||[]}catch(_){}b=r.clone(r.isArray(b)?b:[b]),y(null,{Tags:b,statusCode:p.statusCode,headers:p.headers})})}function _e(i,y){le.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"tagging",VersionId:i.VersionId},function(s,p){if(s&&s.statusCode===204)return y(null,{statusCode:s.statusCode});if(s)return y(s);y(null,{statusCode:p.statusCode,headers:p.headers})})}function Le(i,y){var s=i.SelectType;if(!s)return y(r.error(new Error("missing param SelectType")));var p=i.SelectRequest||{},R=r.json2xml({SelectRequest:p}),b=i.Headers;b["Content-Type"]="application/xml",b["Content-MD5"]=r.b64(r.md5(R)),le.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,headers:i.Headers,action:"select",qs:{"select-type":i.SelectType},VersionId:i.VersionId,body:R,DataType:"arraybuffer",rawBody:!0},function(_,j){if(_&&_.statusCode===204)return y(null,{statusCode:_.statusCode});if(_)return y(_);var te=r.parseSelectPayload(j.body);y(null,{statusCode:j.statusCode,headers:j.headers,Body:te.body,Payload:te.payload})})}function Ve(i,y){var s=this,p=i.Headers,R=i.tracker;!p["Cache-Control"]&&!p["cache-control"]&&(p["Cache-Control"]=""),!p["Content-Type"]&&!p["content-type"]&&(p["Content-Type"]=i.Body&&i.Body.type||"");var b=i.Body&&(i.UploadAddMetaMd5||s.options.UploadAddMetaMd5);b&&R&&R.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(b,i.Body,function(_){_&&(i.Headers["x-cos-meta-md5"]=_),b&&R&&R.setParams({md5EndTime:new Date().getTime()}),le.call(s,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:i.Bucket,Region:i.Region,Key:i.Key,action:"uploads",headers:i.Headers,qs:i.Query,tracker:R},function(j,te){if(j)return R&&R.parent&&R.parent.setParams({errorNode:"multipartInit"}),y(j);if(te=r.clone(te||{}),te&&te.InitiateMultipartUploadResult)return y(null,r.extend(te.InitiateMultipartUploadResult,{statusCode:te.statusCode,headers:te.headers}));y(null,te)})},i.onHashProgress)}function qe(i,y){var s=this;r.getFileSize("multipartUpload",i,function(){var p=i.tracker,R=s.options.UploadCheckContentMd5;R&&p&&p.setParams({md5StartTime:new Date().getTime()}),r.getBodyMd5(R,i.Body,function(b){b&&(i.Headers["Content-MD5"]=r.b64(b)),R&&p&&p.setParams({md5EndTime:new Date().getTime()}),p&&p.setParams({partNumber:i.PartNumber}),le.call(s,{Action:"name/cos:UploadPart",TaskId:i.TaskId,method:"PUT",Bucket:i.Bucket,Region:i.Region,Key:i.Key,qs:{partNumber:i.PartNumber,uploadId:i.UploadId},headers:i.Headers,onProgress:i.onProgress,body:i.Body||null,tracker:p},function(_,j){if(_)return p&&p.parent&&p.parent.setParams({errorNode:"multipartUpload"}),y(_);y(null,{ETag:r.attr(j.headers,"etag",""),statusCode:j.statusCode,headers:j.headers})})})})}function Ge(i,y){for(var s=this,p=i.UploadId,R=i.Parts,b=i.tracker,_=0,j=R.length;_-1?Se(Te.Authorization):"sign="+encodeURIComponent(Te.Authorization)),Te.SecurityToken&&(Ae+="&x-cos-security-token="+Te.SecurityToken),Te.ClientIP&&(Ae+="&clientIP="+Te.ClientIP),Te.ClientUA&&(Ae+="&clientUA="+Te.ClientUA),Te.Token&&(Ae+="&token="+Te.Token),b&&(Ae+="&"+b),setTimeout(function(){y(null,{Url:Ae})})}});return te?(_+="?"+te.Authorization+(te.SecurityToken?"&x-cos-security-token="+te.SecurityToken:""),b&&(_+="&"+b)):b&&(_+="?"+b),_}function v(i){var y={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},s={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},p=i&&i.AccessControlList||{},R=p.Grant;R&&(R=r.isArray(R)?R:[R]);var b={READ:0,WRITE:0,FULL_CONTROL:0};return R&&R.length&&r.each(R,function(_){_.Grantee.ID==="qcs::cam::anyone:anyone"||_.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?b[_.Permission]=1:_.Grantee.ID!==i.Owner.ID&&y[s[_.Permission]].push('id="'+_.Grantee.ID+'"')}),b.FULL_CONTROL||b.WRITE&&b.READ?y.ACL="public-read-write":b.READ?y.ACL="public-read":y.ACL="private",r.each(s,function(_){y[_]=I(y[_].join(","))}),y}function I(i){var y=i.split(","),s={},p,R;for(p=0;p-1?b="{Region}.myqcloud.com":b="cos.{Region}.myqcloud.com",i.ForcePathStyle||(b="{Bucket}."+b)),b=b.replace(/\{\{AppId\}\}/gi,R).replace(/\{\{Bucket\}\}/gi,p).replace(/\{\{Region\}\}/gi,y).replace(/\{\{.*?\}\}/gi,""),b=b.replace(/\{AppId\}/gi,R).replace(/\{BucketName\}/gi,p).replace(/\{Bucket\}/gi,s).replace(/\{Region\}/gi,y).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(b)||(b=j+"//"+b),b.slice(-1)==="/"&&(b=b.slice(0,-1));var te=b;return i.ForcePathStyle&&(te+="/"+s),te+="/",_&&(te+=r.camSafeUrlEncode(_).replace(/%2F/g,"/")),i.isLocation&&(te=te.replace(/^https?:\/\//,"")),te}var fe=function(y){if(!y.Bucket||!y.Region)return"";var s=y.UseAccelerate===void 0?this.options.UseAccelerate:y.UseAccelerate,p=y.Url||q({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:y.Bucket,region:s?"accelerate":y.Region}),R=p.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),b=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return b.test(R)?R:""};function Re(i,y){var s=r.clone(i.Headers),p="";r.each(s,function(Ie,Ne){(Ie===""||["content-type","cache-control","expires"].indexOf(Ne.toLowerCase())>-1)&&delete s[Ne],Ne.toLowerCase()==="host"&&(p=Ie)});var R=i.ForceSignHost!==!1;!p&&i.SignHost&&R&&(s.Host=i.SignHost);var b=!1,_=function(Ne,je){b||(b=!0,je&&je.XCosSecurityToken&&!je.SecurityToken&&(je=r.clone(je),je.SecurityToken=je.XCosSecurityToken,delete je.XCosSecurityToken),y&&y(Ne,je))},j=this,te=i.Bucket||"",ke=i.Region||"",Te=i.Key||"";j.options.ForcePathStyle&&te&&(Te=te+"/"+Te);var Se="/"+Te,Ae={},Fe=i.Scope;if(!Fe){var Je=i.Action||"",st=i.ResourceKey||i.Key||"";Fe=i.Scope||[{action:Je,bucket:te,region:ke,prefix:st}]}var ot=r.md5(JSON.stringify(Fe));j._StsCache=j._StsCache||[],function(){var Ie,Ne;for(Ie=j._StsCache.length-1;Ie>=0;Ie--){Ne=j._StsCache[Ie];var je=Math.round(r.getSkewTime(j.options.SystemClockOffset)/1e3)+30;if(Ne.StartTime&&je=Ne.ExpiredTime){j._StsCache.splice(Ie,1);continue}if(!Ne.ScopeLimit||Ne.ScopeLimit&&Ne.ScopeKey===ot){Ae=Ne;break}}}();var Ze=function(){var Ne="";Ae.StartTime&&i.Expires?Ne=Ae.StartTime+";"+(Ae.StartTime+i.Expires*1):Ae.StartTime&&Ae.ExpiredTime&&(Ne=Ae.StartTime+";"+Ae.ExpiredTime);var je=r.getAuth({SecretId:Ae.TmpSecretId,SecretKey:Ae.TmpSecretKey,Method:i.Method,Pathname:Se,Query:i.Query,Headers:s,Expires:i.Expires,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,KeyTime:Ne,ForceSignHost:R}),ze={Authorization:je,SecurityToken:Ae.SecurityToken||Ae.XCosSecurityToken||"",Token:Ae.Token||"",ClientIP:Ae.ClientIP||"",ClientUA:Ae.ClientUA||""};_(null,ze)},at=function(Ne){if(Ne.Authorization){var je=!1,ze=Ne.Authorization;if(ze)if(ze.indexOf(" ")>-1)je=!1;else if(ze.indexOf("q-sign-algorithm=")>-1&&ze.indexOf("q-ak=")>-1&&ze.indexOf("q-sign-time=")>-1&&ze.indexOf("q-key-time=")>-1&&ze.indexOf("q-url-param-list=")>-1)je=!0;else try{ze=atob(ze),ze.indexOf("a=")>-1&&ze.indexOf("k=")>-1&&ze.indexOf("t=")>-1&&ze.indexOf("r=")>-1&&ze.indexOf("b=")>-1&&(je=!0)}catch(tt){}if(!je)return r.error(new Error("getAuthorization callback params format error"))}else{if(!Ne.TmpSecretId)return r.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Ne.TmpSecretKey)return r.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Ne.SecurityToken&&!Ne.XCosSecurityToken)return r.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Ne.ExpiredTime)return r.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Ne.ExpiredTime&&Ne.ExpiredTime.toString().length!==10)return r.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Ne.StartTime&&Ne.StartTime.toString().length!==10)return r.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(Ae.ExpiredTime&&Ae.ExpiredTime-r.getSkewTime(j.options.SystemClockOffset)/1e3>60)Ze();else if(j.options.getAuthorization)j.options.getAuthorization.call(j,{Bucket:te,Region:ke,Method:i.Method,Key:Te,Pathname:Se,Query:i.Query,Headers:s,Scope:Fe,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:R},function(Ie){typeof Ie=="string"&&(Ie={Authorization:Ie});var Ne=at(Ie);if(Ne)return _(Ne);Ie.Authorization?_(null,Ie):(Ae=Ie||{},Ae.Scope=Fe,Ae.ScopeKey=ot,j._StsCache.push(Ae),Ze())});else if(j.options.getSTS)j.options.getSTS.call(j,{Bucket:te,Region:ke},function(Ie){Ae=Ie||{},Ae.Scope=Fe,Ae.ScopeKey=ot,Ae.TmpSecretId||(Ae.TmpSecretId=Ae.SecretId),Ae.TmpSecretKey||(Ae.TmpSecretKey=Ae.SecretKey);var Ne=at(Ae);if(Ne)return _(Ne);j._StsCache.push(Ae),Ze()});else return function(){var Ie=r.getAuth({SecretId:i.SecretId||j.options.SecretId,SecretKey:i.SecretKey||j.options.SecretKey,Method:i.Method,Pathname:Se,Query:i.Query,Headers:s,Expires:i.Expires,UseRawKey:j.options.UseRawKey,SystemClockOffset:j.options.SystemClockOffset,ForceSignHost:R}),Ne={Authorization:Ie,SecurityToken:j.options.SecurityToken||j.options.XCosSecurityToken};return _(null,Ne),Ne}();return""}function Me(i){var y=!1,s=!1,p=i.headers&&(i.headers.date||i.headers.Date)||i.error&&i.error.ServerTime;try{var R=i.error.Code,b=i.error.Message;(R==="RequestTimeTooSkewed"||R==="AccessDenied"&&b==="Request has expired")&&(s=!0)}catch(j){}if(i)if(s&&p){var _=Date.parse(p);this.options.CorrectClockSkew&&Math.abs(r.getSkewTime(this.options.SystemClockOffset)-_)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=_-Date.now(),y=!0)}else Math.floor(i.statusCode/100)===5&&(y=!0);return y}function le(i,y){var s=this;!i.headers&&(i.headers={}),!i.qs&&(i.qs={}),i.VersionId&&(i.qs.versionId=i.VersionId),i.qs=r.clearKey(i.qs),i.headers&&(i.headers=r.clearKey(i.headers)),i.qs&&(i.qs=r.clearKey(i.qs));var p=r.clone(i.qs);i.action&&(p[i.action]="");var R=i.url||i.Url,b=i.SignHost||fe.call(this,{Bucket:i.Bucket,Region:i.Region,Url:R}),_=i.tracker,j=function te(ke){var Te=s.options.SystemClockOffset;_&&_.setParams({signStartTime:new Date().getTime(),retryTimes:ke-1}),Re.call(s,{Bucket:i.Bucket||"",Region:i.Region||"",Method:i.method,Key:i.Key,Query:p,Headers:i.headers,SignHost:b,Action:i.Action,ResourceKey:i.ResourceKey,Scope:i.Scope,ForceSignHost:s.options.ForceSignHost},function(Se,Ae){if(Se){y(Se);return}_&&_.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),i.AuthData=Ae,Ye.call(s,i,function(Fe,Je){_&&_.setParams({httpEndTime:new Date().getTime()}),Fe&&ke<2&&(Te!==s.options.SystemClockOffset||Me.call(s,Fe))?(i.headers&&(delete i.headers.Authorization,delete i.headers.token,delete i.headers.clientIP,delete i.headers.clientUA,i.headers["x-cos-security-token"]&&delete i.headers["x-cos-security-token"],i.headers["x-ci-security-token"]&&delete i.headers["x-ci-security-token"]),te(ke+1)):y(Fe,Je)})})};j(1)}function Ye(i,y){var s=this,p=i.TaskId;if(!(p&&!s._isRunningTask(p))){var R=i.Bucket,b=i.Region,_=i.Key,j=i.method||"GET",te=i.Url||i.url,ke=i.body,Te=i.rawBody;s.options.UseAccelerate&&(b="accelerate"),te=te||q({ForcePathStyle:s.options.ForcePathStyle,protocol:s.options.Protocol,domain:s.options.Domain,bucket:R,region:b,object:_}),i.action&&(te=te+"?"+(r.isIOS_QQ?"".concat(i.action,"="):i.action)),i.qsStr&&(te.indexOf("?")>-1?te=te+"&"+i.qsStr:te=te+"?"+i.qsStr);var Se={method:j,url:te,headers:i.headers,qs:i.qs,body:ke},Ae="x-cos-security-token";if(r.isCIHost(te)&&(Ae="x-ci-security-token"),Se.headers.Authorization=i.AuthData.Authorization,i.AuthData.Token&&(Se.headers.token=i.AuthData.Token),i.AuthData.ClientIP&&(Se.headers.clientIP=i.AuthData.ClientIP),i.AuthData.ClientUA&&(Se.headers.clientUA=i.AuthData.ClientUA),i.AuthData.SecurityToken&&(Se.headers[Ae]=i.AuthData.SecurityToken),Se.headers&&(Se.headers=r.clearKey(Se.headers)),Se=r.clearKey(Se),i.onProgress&&typeof i.onProgress=="function"){var Fe=ke&&(ke.size||ke.length)||0;Se.onProgress=function(Ie){if(!(p&&!s._isRunningTask(p))){var Ne=Ie?Ie.loaded:0;i.onProgress({loaded:Ne,total:Fe})}}}i.onDownloadProgress&&(Se.onDownloadProgress=i.onDownloadProgress),i.DataType&&(Se.dataType=i.DataType),this.options.Timeout&&(Se.timeout=this.options.Timeout),s.options.ForcePathStyle&&(Se.pathStyle=s.options.ForcePathStyle),s.emit("before-send",Se);var Je=Se.url.includes("accelerate."),st=Se.qs?Object.keys(Se.qs).map(function(Ie){return"".concat(Ie,"=").concat(Se.qs[Ie])}).join("&"):"",ot=st?Se.url+"?"+st:Se.url;i.tracker&&i.tracker.setParams({reqUrl:ot,accelerate:Je?"Y":"N"}),i.tracker&&i.tracker.parent&&i.tracker.parent.setParams({reqUrl:ot,accelerate:Je?"Y":"N"});var Ze=(s.options.Request||l)(Se,function(Ie){if(!(Ie&&Ie.error==="abort")){var Ne={options:Se,error:Ie&&Ie.error,statusCode:Ie&&Ie.statusCode||0,statusMessage:Ie&&Ie.statusMessage||"",headers:Ie&&Ie.headers||{},body:Ie&&Ie.body};s.emit("after-receive",Ne);var je=Ne.error,ze=Ne.body,tt={statusCode:Ne.statusCode,statusMessage:Ne.statusMessage,headers:Ne.headers},gt,ut=function(ft,pt){if(p&&s.off("inner-kill-task",at),!gt){gt=!0;var ht={};tt&&tt.statusCode&&(ht.statusCode=tt.statusCode),tt&&tt.headers&&(ht.headers=tt.headers),ft?(ft=r.extend(ft||{},ht),y(ft,null)):(pt=r.extend(pt||{},ht),y(null,pt)),Ze=null}};if(je)return ut(r.error(je));var lt=tt.statusCode,vt=Math.floor(lt/100)===2;if(Te&&vt)return ut(null,{body:ze});var ct;try{ct=ze&&ze.indexOf("<")>-1&&ze.indexOf(">")>-1&&r.xml2json(ze)||{}}catch(Et){ct={}}var dt=ct&&ct.Error;vt?ut(null,ct):dt?ut(r.error(new Error(dt.Message),{code:dt.Code,error:dt})):lt?ut(r.error(new Error(tt.statusMessage),{code:""+lt})):lt&&ut(r.error(new Error("statusCode error")))}}),at=function Ie(Ne){Ne.TaskId===p&&(Ze&&Ze.abort&&Ze.abort(),s.off("inner-kill-task",Ie))};p&&s.on("inner-kill-task",at)}}var Qe={getService:u,putBucket:S,headBucket:w,getBucket:x,deleteBucket:C,putBucketAcl:T,getBucketAcl:N,putBucketCors:K,getBucketCors:P,deleteBucketCors:H,getBucketLocation:Y,getBucketPolicy:ie,putBucketPolicy:W,deleteBucketPolicy:B,putBucketTagging:A,getBucketTagging:E,deleteBucketTagging:O,putBucketLifecycle:g,getBucketLifecycle:M,deleteBucketLifecycle:z,putBucketVersioning:L,getBucketVersioning:F,putBucketReplication:k,getBucketReplication:V,deleteBucketReplication:X,putBucketWebsite:G,getBucketWebsite:$,deleteBucketWebsite:re,putBucketReferer:ue,getBucketReferer:oe,putBucketDomain:ee,getBucketDomain:ce,deleteBucketDomain:ae,putBucketOrigin:pe,getBucketOrigin:Z,deleteBucketOrigin:ne,putBucketLogging:ge,getBucketLogging:me,putBucketInventory:ye,postBucketInventory:Ce,getBucketInventory:Ee,listBucketInventory:be,deleteBucketInventory:Oe,putBucketAccelerate:we,getBucketAccelerate:De,putBucketEncryption:He,getBucketEncryption:Pe,deleteBucketEncryption:se,getObject:a,headObject:h,listObjectVersions:c,putObject:d,deleteObject:m,getObjectAcl:D,putObjectAcl:U,optionsObject:Q,putObjectCopy:de,deleteMultipleObject:J,restoreObject:xe,putObjectTagging:Be,getObjectTagging:Ue,deleteObjectTagging:_e,selectObjectContent:Le,appendObject:et,uploadPartCopy:he,multipartInit:Ve,multipartUpload:qe,multipartComplete:Ge,multipartList:Ke,multipartListPart:We,multipartAbort:Xe,request:it,getObjectUrl:f,getAuth:rt};function $e(i,y,s){r.each(["Cors","Acl"],function(p){if(i.slice(-p.length)===p){var R=i.slice(0,-p.length)+p.toUpperCase(),b=r.apiWrapper(i,y),_=!1;s[R]=function(){!_&&console.warn("warning: cos."+R+" has been deprecated. Please Use cos."+i+" instead."),_=!0,b.apply(this,arguments)}}})}o.exports.init=function(i,y){y.transferToTaskMethod(Qe,"putObject"),r.each(Qe,function(s,p){i.prototype[p]=r.apiWrapper(p,s),$e(p,s,i.prototype)})}},"./src/cos.js":function(o,t,e){var n=e("./src/util.js"),l=e("./src/event.js"),r=e("./src/task.js"),u=e("./src/base.js"),S=e("./src/advance.js"),w=e("./package.json"),x={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1024*1024,SliceSize:1024*1024,CopyChunkParallelLimit:20,CopyChunkSize:1024*1024*10,CopySliceSize:1024*1024*10,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,EnableTracker:!1,DeepTracker:!1,TrackerDelay:5e3,CustomId:""},C=function(N){this.options=n.extend(n.clone(x),N||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1024*1024,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1024*1024,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey\u683C\u5F0F\u9519\u8BEF\uFF0C\u8BF7\u68C0\u67E5"),console.error("error: SecretKey format is incorrect. Please check")),n.isNode()&&(console.warn("warning: cos-js-sdk-v5 \u4E0D\u652F\u6301 nodejs \u73AF\u5883\u4F7F\u7528\uFF0C\u8BF7\u6539\u7528 cos-nodejs-sdk-v5\uFF0C\u53C2\u8003\u6587\u6863\uFF1A https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),l.init(this),r.init(this)};u.init(C,r),S.init(C,r),C.util={md5:n.md5,xml2json:n.xml2json,json2xml:n.json2xml,encodeBase64:n.encodeBase64},C.getAuthorization=n.getAuth,C.version=w.version,o.exports=C},"./src/event.js":function(o,t){var e=function(r){var u={},S=function(x){return!u[x]&&(u[x]=[]),u[x]};r.on=function(w,x){w==="task-list-update"&&console.warn('warning: Event "'+w+'" has been deprecated. Please use "list-update" instead.'),S(w).push(x)},r.off=function(w,x){for(var C=S(w),T=C.length-1;T>=0;T--)x===C[T]&&C.splice(T,1)},r.emit=function(w,x){for(var C=S(w).map(function(N){return N}),T=0;T=0;Y--){var W=u[Y][2];(!W||W+r=0;W--){var ie=u[W];ie[0]===P&&ie[1]===H&&u.splice(W,1)}u.unshift([P,H,Math.round(Date.now()/1e3)]),u.length>Y&&u.splice(Y),T()}},removeUploadId:function(P){C.call(this),delete N.using[P];for(var H=u.length-1;H>=0;H--)u[H][1]===P&&u.splice(H,1);T()}};o.exports=N},"./src/task.js":function(o,t,e){var n=e("./src/session.js"),l=e("./src/util.js"),r={},u=function(x,C){r[C]=x[C],x[C]=function(T,N){T.SkipTask?r[C].call(this,T,N):this._addTask(C,T,N)}},S=function(x){var C=[],T={},N=0,K=0,P=function(E){var O={id:E.id,Bucket:E.Bucket,Region:E.Region,Key:E.Key,FilePath:E.FilePath,state:E.state,loaded:E.loaded,size:E.size,speed:E.speed,percent:E.percent,hashPercent:E.hashPercent,error:E.error};return E.FilePath&&(O.FilePath=E.FilePath),E._custom&&(O._custom=E._custom),O},H=function(){var A,E=function(){A=0,x.emit("task-list-update",{list:l.map(C,P)}),x.emit("list-update",{list:l.map(C,P)})};return function(){A||(A=setTimeout(E))}}(),Y=function(){if(!(C.length<=x.options.UploadQueueSize)){for(var E=0;Ex.options.UploadQueueSize;){var O=C[E].state==="waiting"||C[E].state==="checking"||C[E].state==="uploading";!C[E]||!O?(T[C[E].id]&&delete T[C[E].id],C.splice(E,1),K--):E++}H()}},W=function A(){if(!(N>=x.options.FileParallelLimit)){for(;C[K]&&C[K].state!=="waiting";)K++;if(!(K>=C.length)){var E=C[K];K++,N++,E.state="checking",E.params.onTaskStart&&E.params.onTaskStart(P(E)),!E.params.UploadData&&(E.params.UploadData={});var O=l.formatParams(E.api,E.params);r[E.api].call(x,O,function(g,M){!x._isRunningTask(E.id)||((E.state==="checking"||E.state==="uploading")&&(E.state=g?"error":"success",g&&(E.error=g),N--,H(),A(),E.callback&&E.callback(g,M),E.state==="success"&&(E.params&&(delete E.params.UploadData,delete E.params.Body,delete E.params),delete E.callback)),Y())}),H(),setTimeout(A)}}},ie=function(E,O){var g=T[E];if(!!g){var M=g&&g.state==="waiting",z=g&&(g.state==="checking"||g.state==="uploading");if(O==="canceled"&&g.state!=="canceled"||O==="paused"&&M||O==="paused"&&z){if(O==="paused"&&g.params.Body&&typeof g.params.Body.pipe=="function"){console.error("stream not support pause");return}g.state=O,x.emit("inner-kill-task",{TaskId:E,toState:O});try{var L=g&&g.params&&g.params.UploadData.UploadId}catch(F){}O==="canceled"&&L&&n.removeUsing(L),H(),z&&(N--,W()),O==="canceled"&&(g.params&&(delete g.params.UploadData,delete g.params.Body,delete g.params),delete g.callback)}Y()}};x._addTasks=function(A){l.each(A,function(E){x._addTask(E.api,E.params,E.callback,!0)}),H()};var B=!0;x._addTask=function(A,E,O,g){E=l.formatParams(A,E);var M=l.uuid();E.TaskId=M,E.onTaskReady&&E.onTaskReady(M),E.TaskReady&&(E.TaskReady(M),B&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),B=!1);var z={params:E,callback:O,api:A,index:C.length,id:M,Bucket:E.Bucket,Region:E.Region,Key:E.Key,FilePath:E.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:E._custom},L=E.onHashProgress;E.onHashProgress=function(k){!x._isRunningTask(z.id)||(z.hashPercent=k.percent,L&&L(k),H())};var F=E.onProgress;return E.onProgress=function(k){!x._isRunningTask(z.id)||(z.state==="checking"&&(z.state="uploading"),z.loaded=k.loaded,z.speed=k.speed,z.percent=k.percent,F&&F(k),H())},l.getFileSize(A,E,function(k,V){if(k)return O(l.error(k));T[M]=z,C.push(z),z.size=V,!g&&H(),W(),Y()}),M},x._isRunningTask=function(A){var E=T[A];return!!(E&&(E.state==="checking"||E.state==="uploading"))},x.getTaskList=function(){return l.map(C,P)},x.cancelTask=function(A){ie(A,"canceled")},x.pauseTask=function(A){ie(A,"paused")},x.restartTask=function(A){var E=T[A];E&&(E.state==="paused"||E.state==="error")&&(E.state="waiting",H(),K=Math.min(K,E.index),W())},x.isUploadRunning=function(){return N||K=0||A.indexOf("wow32")>=0?"win32":A.indexOf("win64")>=0||A.indexOf("wow64")>=0?"win64":E?"mac":"unknown os"},isMobile:function(){var A=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator=="undefined"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(A))},isAndroid:function(){var A=/(Android|Adr|Linux)/i;return!!((typeof navigator=="undefined"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(A))},isIOS:function(){var A=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator=="undefined"?"undefined":r(navigator))==="object"&&navigator.userAgent.match(A))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator=="undefined"?"undefined":r(navigator))!=="object")return"unknown device";var A=navigator.userAgent.toLowerCase();if(A.includes("app/tencent_wemeet"))return"tencent_wemeet";if(A.indexOf("maxthon")>=0){var E=A.match(/maxthon\/([\d.]+)/),O=E&&E[1]||"";return"\u50B2\u6E38\u6D4F\u89C8\u5668 ".concat(O).trim()}if(A.indexOf("qqbrowser")>=0){var g=A.match(/qqbrowser\/([\d.]+)/),M=g&&g[1]||"";return"QQ\u6D4F\u89C8\u5668 ".concat(M).trim()}if(A.indexOf("se 2.x")>=0)return"\u641C\u72D7\u6D4F\u89C8\u5668";if(A.indexOf("wxwork")>=0)return"\u5FAE\u4FE1\u5185\u7F6E\u6D4F\u89C8\u5668";if(A.indexOf("msie")>=0){var z=A.match(/msie ([\d.]+)/),L=z&&z[1]||"";return"IE ".concat(L).trim()}if(A.indexOf("firefox")>=0){var F=A.match(/firefox\/([\d.]+)/),k=F&&F[1]||"";return"Firefox ".concat(k).trim()}if(A.indexOf("chrome")>=0){var V=A.match(/chrome\/([\d.]+)/),X=V&&V[1]||"";return"Chrome ".concat(X).trim()}if(A.indexOf("opera")>=0){var G=A.match(/opera.([\d.]+)/),$=G&&G[1]||"";return"Opera ".concat($).trim()}if(A.indexOf("safari")>=0){var re=A.match(/version\/([\d.]+)/),ue=re&&re[1]||"";return"Safari ".concat(ue).trim()}if(A.indexOf("edge")>=0){var oe=A.match(/edge\/([\d.]+)/),ee=oe&&oe[1]||"";return"edge ".concat(ee).trim()}return A.substr(0,200)}},C={isMobile:x.isMobile(),isBrowser:!x.isMobile(),mobileOsType:x.isAndroid()?"android":x.isIOS?"ios":"other_mobile",pcOsType:x.getOsType()},T={deviceType:C.isMobile?"mobile":C.isBrowser?"browser":"unknown",devicePlatform:C.isMobile?C.mobileOsType:C.pcOsType,deviceName:x.getDeviceName()},N=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],K=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(N),P=["getObject"];function H(B){return K.includes(B)?"cos_upload":P.includes(B)?"cos_download":"base_service"}function Y(B){return B.replace(/([A-Z])/g,"_$1").toLowerCase()}function W(B){var A={},E=["tracePlatform","cossdkVersion","region","networkType","host","accelerate","requestPath","size","httpMd5","httpSign","httpFull","name","result","tookTime","errorNode","errorCode","errorMessage","errorRequestId","errorStatusCode","errorServiceName","errorType","traceId","bucket","appid","partNumber","retryTimes","reqUrl","customId","fullError","deviceType","devicePlatform","deviceName"],O=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],g=B.result==="Success"?O:E;for(var M in B)if(!!g.includes(M)){var z=Y(M);A[z]=B[M]}return A}var ie=function(){function B(A){n(this,B);var E=A.parent,O=A.traceId,g=A.bucket,M=A.region,z=A.apiName,L=A.fileKey,F=A.fileSize,k=A.accelerate,V=A.customId,X=A.delay,G=A.deepTracker,$=g&&g.substr(g.lastIndexOf("-")+1)||"";this.parent=E,this.deepTracker=G,this.delay=X,this.params={cossdkVersion:u.version,region:M,networkType:"",host:"",accelerate:k?"Y":"N",requestPath:L||"",size:F||-1,httpMd5:0,httpSign:0,httpFull:0,name:z||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:O||x.getUid(),bucket:g,appid:$,partNumber:0,retryTimes:0,reqUrl:"",customId:V||"",deviceType:T.deviceType,devicePlatform:T.devicePlatform,deviceName:T.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0},this.beacon=w(X)}return l(B,[{key:"formatResult",value:function(E,O){var g,M,z,L,F,k,V=new Date().getTime(),X=V-this.params.startTime,G=x.getNetType(),$=E?(E==null?void 0:E.code)||(E==null||(g=E.error)===null||g===void 0?void 0:g.code)||(E==null||(M=E.error)===null||M===void 0?void 0:M.Code):"",re=E?(E==null?void 0:E.message)||(E==null||(z=E.error)===null||z===void 0?void 0:z.message)||(E==null||(L=E.error)===null||L===void 0?void 0:L.Message):"",ue=E?(E==null?void 0:E.resource)||(E==null||(F=E.error)===null||F===void 0?void 0:F.resource)||(E==null||(k=E.error)===null||k===void 0?void 0:k.Resource):"",oe=E?E==null?void 0:E.statusCode:O.statusCode,ee=E?(E==null?void 0:E.headers)&&(E==null?void 0:E.headers["x-cos-request-id"]):(O==null?void 0:O.headers)&&(O==null?void 0:O.headers["x-cos-request-id"]),ce=E?ee?"Server":"Client":"";if(Object.assign(this.params,{tookTime:X,networkType:G,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:E?"Fail":"Success",errorType:ce,errorCode:$,errorStatusCode:oe,errorMessage:re,errorServiceName:ue,errorRequestId:ee}),E&&(!$||!re)&&(this.params.fullError=E?JSON.stringify(E):""),this.params.name==="getObject"&&(this.params.size=O?O.headers&&O.headers["content-length"]:-1),this.params.reqUrl)try{var ae=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ae[2]}catch(pe){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(E){Object.assign(this.params,E)}},{key:"sendEvents",value:function(){if(!(N.includes(this.params.name)&&!this.deepTracker)){var E=H(this.params.name),O=W(this.params);this.beacon||(this.beacon=w(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(E,O):this.beacon&&this.beacon.onUserAction(E,O)}}},{key:"generateSubTracker",value:function(E){return Object.assign(E,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay}),new B(E)}}]),B}();o.exports=ie},"./src/util.js":function(o,t,e){(function(n){var l=e("./node_modules/@babel/runtime/helpers/typeof.js"),r=e("./lib/md5.js"),u=e("./lib/crypto.js"),S=e("./lib/xml2json.js"),w=e("./lib/json2xml.js"),x=e("./lib/base64.js"),C=e("./src/tracker.js");function T(se){return encodeURIComponent(se).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function N(se,h){var c=[];for(var a in se)se.hasOwnProperty(a)&&c.push(h?T(a).toLowerCase():a);return c.sort(function(d,m){return d=d.toLowerCase(),m=m.toLowerCase(),d===m?0:d>m?1:-1})}var K=function(h,c){var a,d,m,D=[],U=N(h);for(a=0;a-1||P.indexOf(d)>-1)&&(c[a]=h[a])}return c},Y=function(h){h=h||{};var c=h.SecretId,a=h.SecretKey,d=h.KeyTime,m=(h.method||h.Method||"get").toLowerCase(),D=V(h.Query||h.params||{}),U=H(V(h.Headers||h.headers||{})),Q=h.Key||"",de;h.UseRawKey?de=h.Pathname||h.pathname||"/"+Q:(de=h.Pathname||h.pathname||Q,de.indexOf("/")!==0&&(de="/"+de));var he=h.ForceSignHost!==!1;if(!U.Host&&!U.host&&h.Bucket&&h.Region&&he&&(U.Host=h.Bucket+".cos."+h.Region+".myqcloud.com"),!c)throw new Error("missing param SecretId");if(!a)throw new Error("missing param SecretKey");var J=Math.round(ye(h.SystemClockOffset)/1e3)-1,xe=J,Be=h.Expires||h.expires;Be===void 0?xe+=900:xe+=Be*1||0;var Ue="sha1",_e=c,Le=d||J+";"+xe,Ve=d||J+";"+xe,qe=N(U,!0).join(";").toLowerCase(),Ge=N(D,!0).join(";").toLowerCase(),Ke=u.HmacSHA1(Ve,a).toString(),We=[m,de,Pe.obj2str(D,!0),Pe.obj2str(U,!0),""].join(` `),Xe=["sha1",Le,u.SHA1(We).toString(),""].join(` `),it=u.HmacSHA1(Xe,Ke).toString(),et=["q-sign-algorithm="+Ue,"q-ak="+_e,"q-sign-time="+Le,"q-key-time="+Ve,"q-header-list="+qe,"q-url-param-list="+Ge,"q-signature="+it].join("&");return et},W=function(h,c,a){var d=c/8,m=h.slice(a,a+d);return new Uint8Array(m).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[c](m)[0]},ie=function(h,c,a,d){var m=h.slice(c,a),D="";return new Uint8Array(m).forEach(function(U){D+=String.fromCharCode(U)}),d&&(D=decodeURIComponent(escape(D))),D},B=function(h){for(var c={},a=ie(h),d={records:[]};h.byteLength;){var m=W(h,32,0),D=W(h,32,4),U=m-D-16,Q=0,de;for(h=h.slice(12);QparseInt(d[m])?1:-1;return 0},h=function(a){if(!a)return!1;var d=(a.match(/Chrome\/([.\d]+)/)||[])[1],m=(a.match(/QBCore\/([.\d]+)/)||[])[1],D=(a.match(/QQBrowser\/([.\d]+)/)||[])[1],U=d&&se(d,"53.0.2785.116")<0&&m&&se(m,"3.53.991.400")<0&&D&&se(D,"9.0.2524.400")<=0||!1;return U};return h(typeof navigator!="undefined"&&navigator.userAgent)}(),z=function(h,c,a,d,m){var D;if(h.slice?D=h.slice(c,a):h.mozSlice?D=h.mozSlice(c,a):h.webkitSlice&&(D=h.webkitSlice(c,a)),d&&M){var U=new FileReader;U.onload=function(Q){D=null,m(new Blob([U.result]))},U.readAsArrayBuffer(D)}else m(D)},L=function(h,c,a,d){a=a||E,h?typeof c=="string"?a(Pe.md5(c,!0)):Blob&&c instanceof Blob?Pe.getFileMd5(c,function(m,D){a(D)},d):a():a()},F=1024*1024,k=function(h,c,a){var d=h.size,m=0,D=r.getCtx(),U=function Q(de){if(de>=d){var he=D.digest("hex");c(null,he);return}var J=Math.min(d,de+F);Pe.fileSlice(h,de,J,!1,function(xe){g(xe,function(Be){xe=null,D=D.update(Be,!0),m+=Be.length,Be=null,a&&a({loaded:m,total:d,percent:Math.round(m/d*1e4)/1e4}),Q(de+F)})})};U(0)};function V(se){return ee(se,function(h){return l(h)==="object"&&h!==null?V(h):h})}function X(se,h,c){return se&&h in se?se[h]:c}function G(se,h){return oe(h,function(c,a){se[a]=h[a]}),se}function $(se){return se instanceof Array}function re(se,h){for(var c=!1,a=0;a-1,Q=!D||typeof D=="string"&&D.indexOf("{Region}")>-1;if(h.indexOf("Bucket")>-1||h==="deleteMultipleObject"||h==="multipartList"||h==="listObjectVersions"){if(U&&!a)return"Bucket";if(Q&&!d)return"Region"}else if(h.indexOf("Object")>-1||h.indexOf("multipart")>-1||h==="sliceUploadFile"||h==="abortUploadTask"){if(U&&!a)return"Bucket";if(Q&&!d)return"Region";if(!m)return"Key"}return!1},ne=function(h,c){if(c=G({},c),h!=="getAuth"&&h!=="getV4Auth"&&h!=="getObjectUrl"){var a=c.Headers||{};if(c&&l(c)==="object"){(function(){for(var m in c)c.hasOwnProperty(m)&&m.indexOf("x-cos-")>-1&&(a[m]=c[m])})();var d={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext","Pic-Operations":"PicOperations"};Pe.each(d,function(m,D){c[m]!==void 0&&(a[D]=c[m])}),c.Headers=O(a)}}return c},ge=function(h,c){return function(a,d){var m=this;typeof a=="function"&&(d=a,a={}),a=ne(h,a);var D;if(m.options.EnableTracker)if(a.calledBySdk==="sliceUploadFile")D=a.tracker&&a.tracker.generateSubTracker({apiName:h});else if(["uploadFile","uploadFiles"].includes(h))D=null;else{var U=-1;a.Body&&(U=typeof a.Body=="string"?a.Body.length:a.Body.size||a.Body.byteLength||-1),D=new C({bucket:a.Bucket,region:a.Region,apiName:h,fileKey:a.Key,fileSize:U,deepTracker:m.options.DeepTracker,customId:m.options.CustomId,delay:m.options.TrackerDelay})}a.tracker=D;var Q=function(_e){return _e&&_e.headers&&(_e.headers["x-cos-request-id"]&&(_e.RequestId=_e.headers["x-cos-request-id"]),_e.headers["x-ci-request-id"]&&(_e.RequestId=_e.headers["x-ci-request-id"]),_e.headers["x-cos-version-id"]&&(_e.VersionId=_e.headers["x-cos-version-id"]),_e.headers["x-cos-delete-marker"]&&(_e.DeleteMarker=_e.headers["x-cos-delete-marker"])),_e},de=function(_e,Le){D&&D.formatResult(_e,Le),d&&d(Q(_e),Q(Le))},he=function(){if(h!=="getService"&&h!=="abortUploadTask"){var _e=Z.call(m,h,a);if(_e)return"missing param "+_e;if(a.Region){if(m.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(a.Region))return"Region format error."}else{if(a.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(a.Region))return"Region format error."}!m.options.CompatibilityMode&&a.Region.indexOf("-")===-1&&a.Region!=="yfb"&&a.Region!=="default"&&a.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(a.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(a.Bucket))if(a.AppId)a.Bucket=a.Bucket+"-"+a.AppId;else if(m.options.AppId)a.Bucket=a.Bucket+"-"+m.options.AppId;else return'Bucket should format as "test-1250000000".';a.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete a.AppId)}!m.options.UseRawKey&&a.Key&&a.Key.substr(0,1)==="/"&&(a.Key=a.Key.substr(1))}},J=he(),xe=["getAuth","getObjectUrl"].includes(h);if(typeof Promise=="function"&&!xe&&!d)return new Promise(function(Ue,_e){if(d=function(Ve,qe){Ve?_e(Ve):Ue(qe)},J)return de(Pe.error(new Error(J)));c.call(m,a,de)});if(J)return de(Pe.error(new Error(J)));var Be=c.call(m,a,de);if(xe)return Be}},me=function(h,c){var a=this,d=0,m=0,D=Date.now(),U,Q;function de(){if(Q=0,c&&typeof c=="function"){U=Date.now();var he=Math.max(0,Math.round((m-d)/((U-D)/1e3)*100)/100)||0,J;m===0&&h===0?J=1:J=Math.floor(m/h*100)/100||0,D=U,d=m;try{c({loaded:m,total:h,speed:he,percent:J})}catch(xe){}}}return function(he,J){if(he&&(m=he.loaded,h=he.total),J)clearTimeout(Q),de();else{if(Q)return;Q=setTimeout(de,a.options.ProgressInterval)}}},ve=function(h,c,a){var d;if(typeof c.Body=="string"?c.Body=new Blob([c.Body],{type:"text/plain"}):c.Body instanceof ArrayBuffer&&(c.Body=new Blob([c.Body])),c.Body&&(c.Body instanceof Blob||c.Body.toString()==="[object File]"||c.Body.toString()==="[object Blob]"))d=c.Body.size;else{a(Pe.error(new Error("params body format error, Only allow File|Blob|String.")));return}c.ContentLength=d,a(null,d)},ye=function(h){return Date.now()+(h||0)},Ce=function(h,c){var a=h;return h.message=h.message||null,typeof c=="string"?(h.error=c,h.message=c):l(c)==="object"&&c!==null&&(G(h,c),(c.code||c.name)&&(h.code=c.code||c.name),c.message&&(h.message=c.message),c.stack&&(h.stack=c.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(h,"name",{writable:!0,enumerable:!1}),Object.defineProperty(h,"message",{enumerable:!0})),h.name=c&&c.name||h.name||h.code||"Error",h.code||(h.code=h.name),h.error||(h.error=V(a)),h},Ee=function(){return(typeof globalThis=="undefined"?"undefined":l(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},be=function(){return(typeof window=="undefined"?"undefined":l(window))!=="object"&&(typeof n=="undefined"?"undefined":l(n))==="object"&&!0&&!Ee()},Oe=function(h){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(h)},we=function(){if((typeof navigator=="undefined"?"undefined":l(navigator))!=="object")return!1;var se=navigator.userAgent,h=!!se.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return h}(),De=function(){return(typeof navigator=="undefined"?"undefined":l(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),He=function(h,c){var a=x.encode(h);return c&&(a=a.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),a},Pe={noop:E,formatParams:ne,apiWrapper:ge,xml2json:S,json2xml:w,md5:r,clearKey:O,fileSlice:z,getBodyMd5:L,getFileMd5:k,b64:ae,extend:G,isArray:$,isInArray:re,makeArray:ue,each:oe,map:ee,filter:ce,clone:V,attr:X,uuid:pe,camSafeUrlEncode:T,throttleOnProgress:me,getFileSize:ve,getSkewTime:ye,error:Ce,obj2str:K,getAuth:Y,parseSelectPayload:B,getSourceParams:A,isBrowser:!0,isNode:be,isCIHost:Oe,isIOS_QQ:we&&De,encodeBase64:He};o.exports=Pe}).call(this,e("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);const COS=getDefaultExportFromCjs(cosJsSdkV5.exports),ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=o=>nt(void 0,null,function*(){const{bucketName:t,filename:e,postData:n}=o,l=ossSwitch;let r=t,u=e,S={};return r=tencentBucket,u="MECMP/"+e,S={key:"MECMP/"+n.key},service.post("/cbs-app/open/getUploadSign?pluginName="+l,{postData:S,pluginName:l,bucketName:r,filename:u})}),onFileUpload=({file:o,action:t,data:e,onProgress:n,onFinish:l,onError:r})=>{new COS({Domain:"https://oss.dayaedu.com",Protocol:"https",getAuthorization:(S,w)=>nt(void 0,null,function*(){w({Authorization:e.signature})})}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`MECMP/${e.name}`,Body:e.file.file,SliceSize:1024*1024*500,onProgress:function(S){n({percent:Math.ceil((S.percent||0)*100)})}}).then(S=>{var w;((w=S.Location)==null?void 0:w.indexOf("http"))>=0?o.url=S.Location:o.url="https://"+S.Location,l()}).catch(S=>{console.log(S,"error"),r()})},onOnlyFileUpload=(o,t)=>nt(void 0,null,function*(){{let e="",n=null;if(yield new COS({Domain:"https://oss.dayaedu.com",getAuthorization:(r,u)=>nt(void 0,null,function*(){u({Authorization:t.signature})})}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`MECMP/${t.name}`,Body:t.file,SliceSize:1024*1024*500}).then(r=>{var u;((u=r.Location)==null?void 0:u.indexOf("http"))>=0?e=r.Location:e="https://"+r.Location}).catch(r=>{n=r}),e)return e;throw new Error(n)}}),UploadFile=defineComponent({name:"upload-file",props:{fileList:{type:String,default:""},imageList:{type:Array,default:()=>[]},accept:{type:String,default:".jpg,.png,.jpeg,.gif"},listType:{type:String,default:"image-card"},showFileList:{type:Boolean,default:!0},desc:{type:String,default:""},text:{type:String,default:"\u4E0A\u4F20\u6587\u4EF6"},size:{type:Number,default:5},max:{type:Number,default:1},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tips:{type:String,default:""},bucketName:{type:String,default:"gyt"},path:{type:String,default:""},fileName:{type:String,default:""},cropper:{type:Boolean,default:!1},options:{type:Object,default:()=>({viewMode:0,autoCrop:!0,enlarge:1,autoCropWidth:200,autoCropHeight:200,fixedBox:!1,previewsCircle:!0,title:"\u4E0A\u4F20\u56FE\u7247"})}},emits:["update:fileList","upload:success","close","readFileInputEventAsArrayBuffer","remove"],setup(o,{slots:t,attrs:e,emit:n,expose:l}){const r=`https://${o.bucketName}.ks3-cn-beijing.ksyuncs.com/`,u=useMessage(),S=ref(!1),w=ref(!1),x=ref(),C=ref(),T=reactive({policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}),N=ref([]),K=()=>{if(console.log("desc",o.desc),o.fileList){console.log("downloadUrl",o.fileList);const O=o.fileList.split("/");N.value=[{id:new Date().getTime().toString(),name:O[O.length-1],status:"finished",url:o.fileList}]}else if(Array.isArray(o.imageList)){console.log(Array.isArray(o.imageList),o.imageList,"Array.isArray(props.imageList)");let O=[];o.imageList.forEach(g=>{const M=g.split("/");O.push({id:Date.now().toString(),name:M[M.length-1],status:"finished",url:g})}),N.value=O}else N.value=[]};K(),watch(()=>o.imageList,()=>{K()},{deep:!0}),watch(()=>o.fileList,()=>{console.log("list"),K()}),l({handleClearFile:()=>{var O;(O=C.value)==null||O.clear(),console.log("\u6E05\u7A7A",C.value)}});const H=ref(),Y=O=>nt(this,null,function*(){const g=O.file;let M=!0;if(o.size&&(M=g.file.size/1024/1024{const L=Object.assign({},o.options,{img:z,name:g.file.name});S.value=!0,setTimeout(()=>{var F;(F=H.value)==null||F.edit(L),console.log(H.value,"cropper")},100)}),!1;try{w.value=!0,console.log(o.path,g.file);const z=g.file.name,L=z.slice(z.lastIndexOf(".")),F=`${o.path}${o.fileName||Date.now()+L}`,k={filename:F,bucketName:o.bucketName,postData:{filename:F,acl:"public-read",key:F,unknowValueField:[]}},{data:V}=yield getUploadSign(k);T.policy=V.policy,T.signature=V.signature,T.key=F,T.KSSAccessKeyId=V.kssAccessKeyId,T.name=F,x.value=g.file}catch(z){return w.value=!1,!1}return!0}),W=(O,g)=>nt(this,null,function*(){const M=new FileReader;M.addEventListener("load",()=>g(M.result)),M.readAsDataURL(O)}),ie=({file:O,action:g,onFinish:M,onError:z,onProgress:L})=>{const F=T;F.file=O,onFileUpload({file:O,action:g,data:F,onProgress:L,onFinish:M,onError:z})},B=O=>{n("update:fileList",O.file.url),n("upload:success",{url:O.file.url,name:O.file.name}),n("readFileInputEventAsArrayBuffer",x.value),S.value=!1,w.value=!1},A=O=>nt(this,null,function*(){console.log("\u{1F680} ~ options",O),n("update:fileList",""),n("upload:success",{}),n("remove"),w.value=!1}),E=O=>nt(this,null,function*(){try{const g=`${o.path}${o.fileName||new Date().getTime()+".png"}`,M={filename:g,bucketName:o.bucketName,postData:{filename:g,acl:"public-read",key:g,unknowValueField:[]}},{data:z}=yield getUploadSign(M);T.policy=z.policy,T.signature=z.signature,T.key=g,T.KSSAccessKeyId=z.kssAccessKeyId,T.name=g;const L=St(Ct({},T),{file:O});yield onOnlyFileUpload(r,L).then(F=>{const k=F.split("/");N.value=[{id:new Date().getTime().toString(),name:k[k.length-1],status:"finished",url:F}],n("update:fileList",F),S.value=!1})}catch(g){return!1}});return()=>createVNode("div",null,[createVNode(NUpload,{ref:C,action:r,customRequest:ie,data:T,fileList:N.value,"onUpdate:fileList":O=>N.value=O,listType:o.listType,accept:o.accept,multiple:o.multiple,max:o.max,disabled:o.disabled,showFileList:o.showFileList,showPreviewButton:!0,onBeforeUpload:O=>Y(O),onFinish:O=>B(O),onRemove:O=>A(O)},{default:()=>[o.listType==="image"&&createVNode(__unplugin_components_3,{loading:w.value,type:"primary"},{default:()=>[o.text]})]}),o.tips&&createVNode("p",{style:"font-size: 13px; color: #666; padding-top: 4px;"},[o.tips]),createVNode(NModal,{show:S.value,"onUpdate:show":O=>S.value=O,preset:"dialog",showIcon:!1,title:"\u4E0A\u4F20\u56FE\u7247",style:{width:"800px"}},{default:()=>[createVNode(Copper,{ref:H,onClose:()=>S.value=!1,onCropperOk:E},null)]})])}});export{UploadFile as U,getUploadSign as g,onOnlyFileUpload as o};