123456789101112 |
- import{j as createNamespace,d as defineComponent,ag as makeRequiredProp,t as numericProp,O as reactive,ah as useTouch,i as ref,E as computed,w as watch,ai as useEventListener,g as createVNode,aj as preventDefault,ak as clamp,a9 as Loading,al as LONG_PRESS_START_TIME,v as truthProp,q as makeArrayProp,am as makeNumericProp,x as unknownProp,n as makeStringProp,an as useExpose,o as onMounted,ao as windowWidth,ap as windowHeight,y as nextTick,m as mergeProps,p as pick,P as Popup,Y as useRect,aq as HAPTICS_FEEDBACK,I as Icon,ar as callInterceptor,z as inBrowser,A as extend,as as mountComponent,at as usePopupState,D as withInstall,au as toArray,av as isFunction,H as getSizeStyle,aw as isDef,l as onBeforeUnmount,ad as useCustomFieldValue,ax as withDirectives,ay as vShow,az as isPromise,U as commonjsGlobal,a8 as getDefaultExportFromCjs,a as request,M as postMessage,f as showToast,aa as closeToast,a4 as showLoadingToast,af as getOssUploadUrl,F as Fragment}from"./index-e362c2e8.js";import{c as SwipeItem,b as Swipe}from"./index-f57b4c5f.js";import{I as Image}from"./index-85ccd873.js";const getDistance=r=>Math.sqrt((r[0].clientX-r[1].clientX)**2+(r[0].clientY-r[1].clientY)**2),bem$2=createNamespace("image-preview")[1];var stdin_default$3=defineComponent({props:{src:String,show:Boolean,active:Number,minZoom:makeRequiredProp(numericProp),maxZoom:makeRequiredProp(numericProp),rootWidth:makeRequiredProp(Number),rootHeight:makeRequiredProp(Number),disableZoom:Boolean},emits:["scale","close","longPress"],setup(r,{emit:p,slots:s}){const u=reactive({scale:1,moveX:0,moveY:0,moving:!1,zooming:!1,imageRatio:0,displayWidth:0,displayHeight:0}),x=useTouch(),l=ref(),T=computed(()=>{const{rootWidth:w,rootHeight:D}=r,A=D/w;return u.imageRatio>A}),U=computed(()=>{const{scale:w,moveX:D,moveY:A,moving:N,zooming:G}=u,W={transitionDuration:G||N?"0s":".3s"};if(w!==1){const Z=D/w,ie=A/w;W.transform=`scale(${w}, ${w}) translate(${Z}px, ${ie}px)`}return W}),K=computed(()=>{if(u.imageRatio){const{rootWidth:w,rootHeight:D}=r,A=T.value?D/u.imageRatio:w;return Math.max(0,(u.scale*A-w)/2)}return 0}),O=computed(()=>{if(u.imageRatio){const{rootWidth:w,rootHeight:D}=r,A=T.value?D:w*u.imageRatio;return Math.max(0,(u.scale*A-D)/2)}return 0}),I=w=>{w=clamp(w,+r.minZoom,+r.maxZoom+1),w!==u.scale&&(u.scale=w,p("scale",{scale:w,index:r.active}))},z=()=>{I(1),u.moveX=0,u.moveY=0},q=()=>{const w=u.scale>1?1:2;I(w),u.moveX=0,u.moveY=0};let X,F,L,$,Y,ee,B,m=!1;const C=w=>{const{touches:D}=w;if(X=D.length,X===2&&r.disableZoom)return;const{offsetX:A}=x;x.start(w),F=u.moveX,L=u.moveY,B=Date.now(),m=!1,u.moving=X===1&&u.scale!==1,u.zooming=X===2&&!A.value,u.zooming&&($=u.scale,Y=getDistance(w.touches))},V=w=>{const{touches:D}=w;if(x.move(w),u.moving){const{deltaX:A,deltaY:N}=x,G=A.value+F,W=N.value+L;if((G>K.value||G<-K.value)&&!m&&x.isHorizontal()){u.moving=!1;return}m=!0,preventDefault(w,!0),u.moveX=clamp(G,-K.value,K.value),u.moveY=clamp(W,-O.value,O.value)}if(u.zooming&&(preventDefault(w,!0),D.length===2)){const A=getDistance(D),N=$*A/Y;I(N)}},y=()=>{if(X>1)return;const{offsetX:w,offsetY:D}=x,A=Date.now()-B,N=250,G=5;w.value<G&&D.value<G&&(A<N?ee?(clearTimeout(ee),ee=null,q()):ee=setTimeout(()=>{p("close"),ee=null},N):A>LONG_PRESS_START_TIME&&p("longPress"))},M=w=>{let D=!1;if((u.moving||u.zooming)&&(D=!0,u.moving&&F===u.moveX&&L===u.moveY&&(D=!1),!w.touches.length)){u.zooming&&(u.moveX=clamp(u.moveX,-K.value,K.value),u.moveY=clamp(u.moveY,-O.value,O.value),u.zooming=!1),u.moving=!1,F=0,L=0,$=1,u.scale<1&&z();const A=+r.maxZoom;u.scale>A&&(u.scale=A)}preventDefault(w,D),y(),x.reset()},j=w=>{const{naturalWidth:D,naturalHeight:A}=w.target;u.imageRatio=A/D};return watch(()=>r.active,z),watch(()=>r.show,w=>{w||z()}),useEventListener("touchmove",V,{target:computed(()=>{var w;return(w=l.value)==null?void 0:w.$el})}),()=>{const w={loading:()=>createVNode(Loading,{type:"spinner"},null)};return createVNode(SwipeItem,{ref:l,class:bem$2("swipe-item"),onTouchstartPassive:C,onTouchend:M,onTouchcancel:M},{default:()=>[s.image?createVNode("div",{class:bem$2("image-wrap")},[s.image({src:r.src})]):createVNode(Image,{src:r.src,fit:"contain",class:bem$2("image",{vertical:T.value}),style:U.value,onLoad:j},w)]})}}});const[name$1,bem$1]=createNamespace("image-preview"),popupProps=["show","teleport","transition","overlayStyle","closeOnPopstate"],imagePreviewProps={show:Boolean,loop:truthProp,images:makeArrayProp(),minZoom:makeNumericProp(1/3),maxZoom:makeNumericProp(3),overlay:truthProp,closeable:Boolean,showIndex:truthProp,className:unknownProp,closeIcon:makeStringProp("clear"),transition:String,beforeClose:Function,overlayClass:unknownProp,overlayStyle:Object,swipeDuration:makeNumericProp(300),startPosition:makeNumericProp(0),showIndicators:Boolean,closeOnPopstate:truthProp,closeIconPosition:makeStringProp("top-right"),teleport:[String,Object]};var stdin_default$2=defineComponent({name:name$1,props:imagePreviewProps,emits:["scale","close","closed","change","longPress","update:show"],setup(r,{emit:p,slots:s}){const u=ref(),x=reactive({active:0,rootWidth:0,rootHeight:0,disableZoom:!1}),l=()=>{if(u.value){const ee=useRect(u.value.$el);x.rootWidth=ee.width,x.rootHeight=ee.height,u.value.resize()}},T=ee=>p("scale",ee),U=ee=>p("update:show",ee),K=()=>{callInterceptor(r.beforeClose,{args:[x.active],done:()=>U(!1)})},O=ee=>{ee!==x.active&&(x.active=ee,p("change",ee))},I=()=>{if(r.showIndex)return createVNode("div",{class:bem$1("index")},[s.index?s.index({index:x.active}):`${x.active+1} / ${r.images.length}`])},z=()=>{if(s.cover)return createVNode("div",{class:bem$1("cover")},[s.cover()])},q=()=>{x.disableZoom=!0},X=()=>{x.disableZoom=!1},F=()=>createVNode(Swipe,{ref:u,lazyRender:!0,loop:r.loop,class:bem$1("swipe"),duration:r.swipeDuration,initialSwipe:r.startPosition,showIndicators:r.showIndicators,indicatorColor:"white",onChange:O,onDragEnd:X,onDragStart:q},{default:()=>[r.images.map((ee,B)=>createVNode(stdin_default$3,{src:ee,show:r.show,active:x.active,maxZoom:r.maxZoom,minZoom:r.minZoom,rootWidth:x.rootWidth,rootHeight:x.rootHeight,disableZoom:x.disableZoom,onScale:T,onClose:K,onLongPress:()=>p("longPress",{index:B})},{image:s.image}))]}),L=()=>{if(r.closeable)return createVNode(Icon,{role:"button",name:r.closeIcon,class:[bem$1("close-icon",r.closeIconPosition),HAPTICS_FEEDBACK],onClick:K},null)},$=()=>p("closed"),Y=(ee,B)=>{var m;return(m=u.value)==null?void 0:m.swipeTo(ee,B)};return useExpose({swipeTo:Y}),onMounted(l),watch([windowWidth,windowHeight],l),watch(()=>r.startPosition,ee=>O(+ee)),watch(()=>r.show,ee=>{const{images:B,startPosition:m}=r;ee?(O(+m),nextTick(()=>{l(),Y(+m,{immediate:!0})})):p("close",{index:x.active,url:B[x.active]})}),()=>createVNode(Popup,mergeProps({class:[bem$1(),r.className],overlayClass:[bem$1("overlay"),r.overlayClass],onClosed:$,"onUpdate:show":U},pick(r,popupProps)),{default:()=>[L(),F(),I(),z()]})}});let instance;const defaultConfig={loop:!0,images:[],maxZoom:3,minZoom:1/3,onScale:void 0,onClose:void 0,onChange:void 0,teleport:"body",className:"",showIndex:!0,closeable:!1,closeIcon:"clear",transition:void 0,beforeClose:void 0,overlayStyle:void 0,overlayClass:void 0,startPosition:0,swipeDuration:300,showIndicators:!1,closeOnPopstate:!0,closeIconPosition:"top-right"};function initInstance(){({instance}=mountComponent({setup(){const{state:r,toggle:p}=usePopupState(),s=()=>{r.images=[]};return()=>createVNode(stdin_default$2,mergeProps(r,{onClosed:s,"onUpdate:show":p}),null)}}))}const showImagePreview=(r,p=0)=>{if(inBrowser)return instance||initInstance(),r=Array.isArray(r)?{images:r,startPosition:p}:r,instance.open(extend({},defaultConfig,r)),instance};withInstall(stdin_default$2);const[name,bem,t]=createNamespace("uploader");function readFileContent(r,p){return new Promise(s=>{if(p==="file"){s();return}const u=new FileReader;u.onload=x=>{s(x.target.result)},p==="dataUrl"?u.readAsDataURL(r):p==="text"&&u.readAsText(r)})}function isOversize(r,p){return toArray(r).some(s=>s.file?isFunction(p)?p(s.file):s.file.size>+p:!1)}function filterFiles(r,p){const s=[],u=[];return r.forEach(x=>{isOversize(x,p)?u.push(x):s.push(x)}),{valid:s,invalid:u}}const IMAGE_REGEXP=/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg|avif)/i,isImageUrl=r=>IMAGE_REGEXP.test(r);function isImageFile(r){return r.isImage?!0:r.file&&r.file.type?r.file.type.indexOf("image")===0:r.url?isImageUrl(r.url):typeof r.content=="string"?r.content.indexOf("data:image")===0:!1}var stdin_default$1=defineComponent({props:{name:numericProp,item:makeRequiredProp(Object),index:Number,imageFit:String,lazyLoad:Boolean,deletable:Boolean,previewSize:[Number,String,Array],beforeDelete:Function},emits:["delete","preview"],setup(r,{emit:p,slots:s}){const u=()=>{const{status:O,message:I}=r.item;if(O==="uploading"||O==="failed"){const z=O==="failed"?createVNode(Icon,{name:"close",class:bem("mask-icon")},null):createVNode(Loading,{class:bem("loading")},null),q=isDef(I)&&I!=="";return createVNode("div",{class:bem("mask")},[z,q&&createVNode("div",{class:bem("mask-message")},[I])])}},x=O=>{const{name:I,item:z,index:q,beforeDelete:X}=r;O.stopPropagation(),callInterceptor(X,{args:[z,{name:I,index:q}],done:()=>p("delete")})},l=()=>p("preview"),T=()=>{if(r.deletable&&r.item.status!=="uploading"){const O=s["preview-delete"];return createVNode("div",{role:"button",class:bem("preview-delete",{shadow:!O}),tabindex:0,"aria-label":t("delete"),onClick:x},[O?O():createVNode(Icon,{name:"cross",class:bem("preview-delete-icon")},null)])}},U=()=>{if(s["preview-cover"]){const{index:O,item:I}=r;return createVNode("div",{class:bem("preview-cover")},[s["preview-cover"](extend({index:O},I))])}},K=()=>{const{item:O,lazyLoad:I,imageFit:z,previewSize:q}=r;return isImageFile(O)?createVNode(Image,{fit:z,src:O.content||O.url,class:bem("preview-image"),width:Array.isArray(q)?q[0]:q,height:Array.isArray(q)?q[1]:q,lazyLoad:I,onClick:l},{default:U}):createVNode("div",{class:bem("file"),style:getSizeStyle(r.previewSize)},[createVNode(Icon,{class:bem("file-icon"),name:"description"},null),createVNode("div",{class:[bem("file-name"),"van-ellipsis"]},[O.file?O.file.name:O.url]),U()])};return()=>createVNode("div",{class:bem("preview")},[K(),u(),T()])}});const uploaderProps={name:makeNumericProp(""),accept:makeStringProp("image/*"),capture:String,multiple:Boolean,disabled:Boolean,readonly:Boolean,lazyLoad:Boolean,maxCount:makeNumericProp(1/0),imageFit:makeStringProp("cover"),resultType:makeStringProp("dataUrl"),uploadIcon:makeStringProp("photograph"),uploadText:String,deletable:truthProp,afterRead:Function,showUpload:truthProp,modelValue:makeArrayProp(),beforeRead:Function,beforeDelete:Function,previewSize:[Number,String,Array],previewImage:truthProp,previewOptions:Object,previewFullImage:truthProp,maxSize:{type:[Number,String,Function],default:1/0}};var stdin_default=defineComponent({name,props:uploaderProps,emits:["delete","oversize","clickUpload","closePreview","clickPreview","update:modelValue"],setup(r,{emit:p,slots:s}){const u=ref(),x=[],l=(m=r.modelValue.length)=>({name:r.name,index:m}),T=()=>{u.value&&(u.value.value="")},U=m=>{if(T(),isOversize(m,r.maxSize))if(Array.isArray(m)){const C=filterFiles(m,r.maxSize);if(m=C.valid,p("oversize",C.invalid,l()),!m.length)return}else{p("oversize",m,l());return}m=reactive(m),p("update:modelValue",[...r.modelValue,...toArray(m)]),r.afterRead&&r.afterRead(m,l())},K=m=>{const{maxCount:C,modelValue:V,resultType:y}=r;if(Array.isArray(m)){const M=+C-V.length;m.length>M&&(m=m.slice(0,M)),Promise.all(m.map(j=>readFileContent(j,y))).then(j=>{const w=m.map((D,A)=>{const N={file:D,status:"",message:""};return j[A]&&(N.content=j[A]),N});U(w)})}else readFileContent(m,y).then(M=>{const j={file:m,status:"",message:""};M&&(j.content=M),U(j)})},O=m=>{const{files:C}=m.target;if(r.disabled||!C||!C.length)return;const V=C.length===1?C[0]:[].slice.call(C);if(r.beforeRead){const y=r.beforeRead(V,l());if(!y){T();return}if(isPromise(y)){y.then(M=>{K(M||V)}).catch(T);return}}K(V)};let I;const z=()=>p("closePreview"),q=m=>{if(r.previewFullImage){const C=r.modelValue.filter(isImageFile),V=C.map(y=>(y.file&&!y.url&&y.status!=="failed"&&(y.url=URL.createObjectURL(y.file),x.push(y.url)),y.url)).filter(Boolean);I=showImagePreview(extend({images:V,startPosition:C.indexOf(m),onClose:z},r.previewOptions))}},X=()=>{I&&I.close()},F=(m,C)=>{const V=r.modelValue.slice(0);V.splice(C,1),p("update:modelValue",V),p("delete",m,l(C))},L=(m,C)=>{const V=["imageFit","deletable","previewSize","beforeDelete"],y=extend(pick(r,V),pick(m,V,!0));return createVNode(stdin_default$1,mergeProps({item:m,index:C,onClick:()=>p("clickPreview",m,l(C)),onDelete:()=>F(m,C),onPreview:()=>q(m)},pick(r,["name","lazyLoad"]),y),pick(s,["preview-cover","preview-delete"]))},$=()=>{if(r.previewImage)return r.modelValue.map(L)},Y=m=>p("clickUpload",m),ee=()=>{if(r.modelValue.length>=+r.maxCount)return;const m=r.readonly?null:createVNode("input",{ref:u,type:"file",class:bem("input"),accept:r.accept,capture:r.capture,multiple:r.multiple,disabled:r.disabled,onChange:O},null);return s.default?createVNode("div",{class:bem("input-wrapper"),onClick:Y},[s.default(),m]):withDirectives(createVNode("div",{class:bem("upload",{readonly:r.readonly}),style:getSizeStyle(r.previewSize),onClick:Y},[createVNode(Icon,{name:r.uploadIcon,class:bem("upload-icon")},null),r.uploadText&&createVNode("span",{class:bem("upload-text")},[r.uploadText]),m]),[[vShow,r.showUpload]])},B=()=>{u.value&&!r.disabled&&u.value.click()};return onBeforeUnmount(()=>{x.forEach(m=>URL.revokeObjectURL(m))}),useExpose({chooseFile:B,closeImagePreview:X}),useCustomFieldValue(()=>r.modelValue),()=>createVNode("div",{class:bem()},[createVNode("div",{class:bem("wrapper",{disabled:r.disabled})},[$(),ee()])])}});const Uploader=withInstall(stdin_default),singleImgClose="_singleImgClose_1ti1e_25",uploader="_uploader_1ti1e_1",previewImg="_previewImg_1ti1e_36",uploadImg="_uploadImg_1ti1e_42",styles={"uploader-section":"_uploader-section_1ti1e_1","img-close":"_img-close_1ti1e_9",singleImgClose,uploader,default:"_default_1ti1e_31",previewImg,uploadImg},iconUploader="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJgAAACYCAMAAAAvHNATAAABOFBMVEUAAADa2tr39/f////a2tr39/fa2trZ2dnV1dX5+fn5+fnp6en29vbZ2dn4+Pjo6OjZ2dk9PT2ZmZmXl5f29vbx8fHk5OTh4eHq6urOzs66urrBwcH19fW1tbXz8/Ps7Oza2trm5uaysrJERETe3t6vr6/g4ODV1dW+vr6cnJzc3Nwly7zv7++np6fQ0NDKyspA0sHJycnFxcU50L8pzL2dnZ3w8PDu7u40z78gyru4uLirq6tKSkovzb5iYmJZWVnGxsY80cCurq6qqqqfn59paWnX19dF1MJBQUHT09Nz3dBp2s/MzMzDw8MbyLqjo6OhoaGSkpJa1spL1MWMjIyHh4dwcHBSUlJMTExi2M3w9vbb8u/U1NR7e3tycnJR1cfn9fON4th839J/f3/M7uvG7um76+eX5Nt5K7d4AAAADnRSTlMA8s8Gx2xszwbyx8cbGz8Ohn8AAAbPSURBVHja7NppU9pQFMbx2M2uT3IwgYzVACUuBWqxOIBWiejgOqgoirtVu3z/b9AT9aqg1vEGhjtTfu/Om8x/kniPCpqmvX71ose4EgOLiykKwBLDMNiwmCwAUTHEwWJiariEDcARgwsWuX2JtBjCYEnD1/Pi1XONfeg1XP0aWFoMFoABMUTBomIa8JvFkAZ7+BKmGOyGSzh+sxjyYLbui7vxZ+/5fvXG0lCMiWfPtZexPBT0UntrQkHpd9obqCjeo0FJuqENKPkoOczQoaBuWDesyf8T5qQVDQPUDUvaUJKiK8nJKRqmG92wJ4eFo1CQsgdsN6wb1m7RiKJhKi9xZcNyDpSk6EqyXUXDVF7iaQdtcrBycrYPGW0+YFcWFzN/VAw7WcxkVjoWZk4d1xMNisO4tJXJlFY7FRbdoTs2rsNK2U6Fmfd0TS+IsFK2Y2FTHLJt6PZtA7iymM0WZMNMJ1BYusxduOPH6dkKK2ULhczqHjuVODUChFnVBBHF0Mzc43OC3y/umpmZmEilJiclbpz8X0lWmXw2mh3c6VpL4ck0yKpxlXd+nkOz/a3mrrUtPJFlS4eFuavPxH1+bXJZKctdjNNSJwdo0sYl/omoaOJfshy1CQnBwj4TVdHAHf94aMEXH+13gcJEKkhY0oaUPn6SuJEPecQSR8tAdJdoKYkCv18Bwgy9FWGzuyTUHJfYLGZSkx0Pm1ry71axXCe248wfH4dMzPDPY4fDlhNEu0MWgEN/edaudiWfE6udDSsTeWFcMKtctgzf79Ra4aCjYeP8rhu3f+E4utqZP/chKae3IqzWsMqXiRIWAgsYJp7kKG7UiUZwqVIbgYRWhXlEC2A3nRVcsBLkQZLUJ7x3w8Zwo0j09XqfTkOSBglNYcdE38GubxMNBw3TjVaErTfs8yEiD2qEhfnc/wIx8HIKtSLMtgKHocoH2bwJX9LjJZCXCGvLyZ8rElF5aCRZ2faX5jeoEoYwlwlLg1AnDLnaEl0qjkGlMCCysePVi9sVE4qFNQgeFpMOCxFV8YgI0S4kSYfNEZXxiH6iIuTIh7kkFtGDInVxVyVoeg5yjrisXO172DYvzUQYkjTIsj163CDk5MMapNlH9Ih6BTKC/5/fnQv1PWx91kGAMLP7VcBu2N927m1HaSgK47jnRI1fycrebem5pBzaCMZJCglzY6AhMcHAA/j+z+HqLq1F0QqKbpXfRaedi85/kk73TBlWyy3sj9M2TIaahun8Yv3tXwHP4klNw3R+sR5a4jBTy/eyaHuDvYVdK0xM3uArYwOl2DVxlt4k/HVhNMSXgmIvwN5QgsbMUYzYadTfUlbMoLyjGF3C0eVhG/qAkk8BGg4V+31OVpamKVHKyEclon4rrNPlYSsyenesKO4qngrj7Yws3pWpw9uAlr85LCEfE2qTx2FbGvN2Qe6FYYvgojCxIhNz27bvaGxXxFHYKF0L8AfaXhgGXBQ2oxUUP/fQaMLkWypM2IY5ILMJc03FobHJwo6L/wfD7s0DG6VFTgMEUspFOpA1UYZFWeaStaa1DWyJyEUTdsz9FYu4oMZSHQ+Jwxw6FqD+lJWMuRIy2oT4HLbst406wuSPXWO7twc9MJdcDvvouu4udRteGZYliUsW3ro1u3WN1a51gw1oIDiMBfkSjfbFP6VcSXm/MqbZ1cPgSlRh7yn5RtgUSp/3673x9cNYFTZMP44Pko6wtzSYNLIrh9n0md8RNqGWN1cOe23VHOpXYdPpdF+GpffKrglbpwt5EF09rNEjX4BtfcXAxK8ZUCStUBt1hnnBT4bJSPVs0vsAihRo88zPt7EPR2FdfjJsQtO+FHe0kqi4uYR03peL6ZIPl7mNyoDM88Ks8GfC5HZH+ZqcABWxX/Em98smeg2YNBQoxbTGeWH4HsOqjGhtNYw6TBHje6I33tGX9AuuydSPwzveMjGg6JwwGX4/zKET/HYYE+8LmiZQlhSqWxbHe+kAvN0Vc7WG+egIO2sRz/onRHVYQ/KlJsCMao2P1Orjk1S/gW84bzidnx12oe0GLaaJkkgMFRqVSXFcxgoTzAvREm7N7rBEy+djf/0fvF1uYX+ctmGvY03DdH7Or21Y4EFLuj61jnQN0/g5fyihIW1vsLewW9gX/p8wnddKbcNi7YYVlrRdxF/HmobpvIhDS9rex25h/1LYwxga4iGiT0bQkPfywbOelmvSUx7tm0A3arTvg1eP8K0hxwswoyb4YH7ukOMQzG5O0T77/KtTLA7DkC0ehsweP33x3Do5FtoEi+ojUVa2x0J7p8dCz3FyLHR9Crs+MMqw+iADM1vjoz8BuFyFexahL+UAAAAASUVORK5CYII=",iconVideoDefault="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcgAAAHICAMAAAD9f4rYAAAAolBMVEUjJyz///8oLDH9/f1AQ0j6+vorLzQ6PkL09PXy8vKztbewsbNydHdpbG8mKi/4+PjAwsOnqatZXGBTVlpKTVJDR0u7vL7l5uaZmp24ubvY2dnKy8yQkpXe3t+trrCeoKLv7/DT09R9gIN3en1bXmJHS08zNzuSlJbV1teJi455e35hZGhfYmU1OT7p6erg4eLQ0dKgoqSDhYjNzs81OD2pq62phkQlAAAHZElEQVR42uzBgQAAAACAoP2pF6kCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGD27myrbSAGA7Dk3YnjJt4SskEWIBBoC6Xv/2qNxw3lgtPG0dhO5/zfC/hCZzySRh4DAAAAAAAAAAAAAAAAAAAAAAAAAAAAQKf87fr+etQbzna72bA3ur5fb32C/4n3NO+vAv5EsOrPnzyCy2cl85nLf+XO5olFcMG8aPiFT/JlGGFhXqrtMuBP2GFo8yeC5Zbg4viTMX/kLorJJsmcZ08t1WcnSzaTYuHyR+MJ0p/L4ozcj/FZRnlMn4rzaPkx4u7IIbgUt32bj256j84/w/7Yu+Eju39LcAmcq/cwusXAopNYg8J9D+UVVmX3rPl7nvp9fUc13K2/v+ewc5QjHdt/44pdpFRbWthc+bYn6I5/dQxjL6OzZL1jKK+QwHZmEB7zlZzOlh8zpXBA0AXrhSvTlETSKVdesFN2wFmxErzGJBS/BqyskL4KyF6rPZ808Ht4vXbjgZUgIk2igJUHghZdszLNSZt8yso1QVviPisjizSyRqz0Y4JWeMOqHRORZlHVJBripLIV3g8uhQlpl4Rc+oFItiCu1uPXjBqQfa3WJN6uzetzaeFQI5wFl/oEDavy1d0bNeR5h9y1DQ/VenyjxrwtUE82b1Dtjw41yKn2SfR4GuSEKl/NqFFZ9RT0XRtjrVT9mFDDElVPrnAW0pQXLkXUuIhLLwSNGHBpRC0YYZtsjq+2rqlFLbCmapvE9EcT1HxOkFMr8kDN8RBot6+/Qcq3SczWaWepuccetaanpiSRueo2Vy9Wn1rjq5frnEArR5V2r9SiV1W0oi2g15XKWGNqUTxFvqPdrV3OIafUqlQ9FN9q6dQ/5ZDQkKeazFFrI6eW5eqx2CX1GQlKD3EJMiLQxHfLlZFR67JySbpo1Oky4YOCOlDwwYRAjzEfpNSBlA/GBFo8qe/KqRPq63Tcx6PHkg/WVMd+eZ2SDms+WBJo4AVlxnFHNWxsZvvnHcndlXlWgMlzHaL6nbIFl242unqDEYHcsPbUhcW//bjVM18yJBCzvpSLy6odSMWdeNLH35RnIDiWlEvqd3Us/mM80NHdSQik7vng8bxAKoVPEo98cE8gNeMDRxBIDh5iOp/DBzMCIc9VvZWzA6lMU2FfyUUBoqWts5QFUhWVsn7EE4GGoatIFEhhURlhCEvbKX0uCaS0qMwxJ6DDqtyhYkkgpUVlXO7SKwKZstG6IEkgpUWlavgFBCK+qgS1BFIpnDNPlzEmILNVR/SiQIqLygnOJDWdB25EgRQXlZvqPBTEDbpEFEhxUZmgSafpWp1MFEhxUZnh4h1NE62OKJDiotLBdKumEeFnUSDFReVzdZAG4vEAT3cglXFKp/EwJKDnEMsm7YFUbnw6jY2DLLEdM4dNBLLOcXXIzDsCBBLwajUFkh1DoPwwRFMNgRkaAv+GFh2gaW4qHGMZAgfLhtA+6uFj1KMWDF8BxiGNpG9AeYYB5TPgkwHARzxGwmd1psCHroa4iE/PsUXiMgjA9SyGEVyYNMOFSRek2yvMClxhhksFAdd8GmmLi3cNgauwDYHL6Q2B30WYAj9wMQR+qWQK/OTMEPjtoCnwI1BD4Ne8psDPsg2B39ebYs+tHihFXNoTKNrznSCnVuQBMp2m+KHKXC1qgaUy1hDNuV/s3OtyqjAQB/D9k6Dcb4KKihbrqdrT2tr6/s92JmDHfnBObwTozP5egA+ZJJvdZbXw0VrGLIbiE9Pi2NY16UE5EtPDKAEgTEizJASAkiNWbaQNAHZKWqX1VzgVoJEP5SBJI3ngC1K/PZTiRNqcCih7YlqtoOy0reRpBx6r0woXSiFJC1mAi5DtCCIoh5Q0SA9QooCYdoNXKHZCjUtsKK/cWd6KQQQl9KhhXggl4nVsSeCiEhvUICNGxeVztT0rVGYZNSabgePV9u1RsTxqiGeB349d8G1UnCE1YOigYnM+p3WyRMV6CeiHghcLlZLzqx0wjg1M0VFGM9SOXO/owuV4FW5G35a5go/Vrg1z1IST0rekjkAt576OLv19Qk2MR/Rlo7FA7Yn75TpmLEKcPa/v6Avu1s84Cxd8O3ZP5gJnZu4b9CmGn5s4EzkHq/3wxxV4c+PcS/qAvHdu8Ea4/L9Vf8jYxMVk6WUBXRVk3nKCCzPm3dgvw+kE75nFeHqbpPJxUBVMHmWa3E7HhYn3JlMOVXtos7RwhbBtgSusJc/P6auBF4X4lDDyuOrYa0aynZv4L3O+Tfi58RsMHhZuaeEKq3QXD7wVf5fhZr1dxU403+3mkROvtusNhzaMMcYY+8ceHAgAAAAAAPm/NoKqqqqqqqqqqqqqqqqqqgp7cCAAAAAAAOT/2giqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkp7cEgAAAAAIOj/a2dYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF4BjB5ee44lPcgAAAAASUVORK5CYII=";var cosJsSdkV5Exports={},cosJsSdkV5={get exports(){return cosJsSdkV5Exports},set exports(r){cosJsSdkV5Exports=r}};(function(module,exports){(function(p,s){module.exports=s()})(commonjsGlobal,function(){return function(r){var p={};function s(u){if(p[u])return p[u].exports;var x=p[u]={i:u,l:!1,exports:{}};return r[u].call(x.exports,x,x.exports,s),x.l=!0,x.exports}return s.m=r,s.c=p,s.d=function(u,x,l){s.o(u,x)||Object.defineProperty(u,x,{enumerable:!0,get:l})},s.r=function(u){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})},s.t=function(u,x){if(x&1&&(u=s(u)),x&8||x&4&&typeof u=="object"&&u&&u.__esModule)return u;var l=Object.create(null);if(s.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:u}),x&2&&typeof u!="string")for(var T in u)s.d(l,T,function(U){return u[U]}.bind(null,T));return l},s.n=function(u){var x=u&&u.__esModule?function(){return u.default}:function(){return u};return s.d(x,"a",x),x},s.o=function(u,x){return Object.prototype.hasOwnProperty.call(u,x)},s.p="/dist/",s(s.s="./index.js")}({"./index.js":function(r,p,s){var u=s("./src/cos.js");r.exports=u},"./lib/base64.js":function(r,p){var s=function(u){u=u||{};var x=u.Base64,l="2.1.9",T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",U=function(w){for(var D={},A=0,N=w.length;A<N;A++)D[w.charAt(A)]=A;return D}(T),K=String.fromCharCode,O=function(D){if(D.length<2){var A=D.charCodeAt(0);return A<128?D:A<2048?K(192|A>>>6)+K(128|A&63):K(224|A>>>12&15)+K(128|A>>>6&63)+K(128|A&63)}else{var A=65536+(D.charCodeAt(0)-55296)*1024+(D.charCodeAt(1)-56320);return K(240|A>>>18&7)+K(128|A>>>12&63)+K(128|A>>>6&63)+K(128|A&63)}},I=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,z=function(D){return D.replace(I,O)},q=function(D){var A=[0,2,1][D.length%3],N=D.charCodeAt(0)<<16|(D.length>1?D.charCodeAt(1):0)<<8|(D.length>2?D.charCodeAt(2):0),G=[T.charAt(N>>>18),T.charAt(N>>>12&63),A>=2?"=":T.charAt(N>>>6&63),A>=1?"=":T.charAt(N&63)];return G.join("")},X=u.btoa?function(w){return u.btoa(w)}:function(w){return w.replace(/[\s\S]{1,3}/g,q)},F=function(w){return X(z(w))},L=function(D,A){return A?F(String(D)).replace(/[+\/]/g,function(N){return N=="+"?"-":"_"}).replace(/=/g,""):F(String(D))},$=function(D){return L(D,!0)},Y=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),ee=function(D){switch(D.length){case 4:var A=(7&D.charCodeAt(0))<<18|(63&D.charCodeAt(1))<<12|(63&D.charCodeAt(2))<<6|63&D.charCodeAt(3),N=A-65536;return K((N>>>10)+55296)+K((N&1023)+56320);case 3:return K((15&D.charCodeAt(0))<<12|(63&D.charCodeAt(1))<<6|63&D.charCodeAt(2));default:return K((31&D.charCodeAt(0))<<6|63&D.charCodeAt(1))}},B=function(D){return D.replace(Y,ee)},m=function(D){var A=D.length,N=A%4,G=(A>0?U[D.charAt(0)]<<18:0)|(A>1?U[D.charAt(1)]<<12:0)|(A>2?U[D.charAt(2)]<<6:0)|(A>3?U[D.charAt(3)]:0),W=[K(G>>>16),K(G>>>8&255),K(G&255)];return W.length-=[0,0,2,1][N],W.join("")},C=u.atob?function(w){return u.atob(w)}:function(w){return w.replace(/[\s\S]{1,4}/g,m)},V=function(w){return B(C(w))},y=function(D){return V(String(D).replace(/[-_]/g,function(A){return A=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},M=function(){var D=u.Base64;return u.Base64=x,D},j={VERSION:l,atob:C,btoa:X,fromBase64:y,toBase64:L,utob:z,encode:L,encodeURI:$,btou:B,decode:y,noConflict:M};return j}();r.exports=s},"./lib/beacon.min.js":function(r,p,s){var u,x,l=s("./node_modules/@babel/runtime/helpers/typeof.js");(function(T,U){l(p)=="object"&&typeof r<"u"?r.exports=U():(u=U,x=typeof u=="function"?u.call(p,s,p,r):u,x!==void 0&&(r.exports=x))})(this,function(){var T=function(i,o){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,v){a.__proto__=v}||function(a,v){for(var R in v)Object.prototype.hasOwnProperty.call(v,R)&&(a[R]=v[R])},T(i,o)},U=function(){return U=Object.assign||function(i){for(var o,a=1,v=arguments.length;a<v;a++)for(var R in o=arguments[a])Object.prototype.hasOwnProperty.call(o,R)&&(i[R]=o[R]);return i},U.apply(this,arguments)};function K(d,i,o,a){return new(o||(o=Promise))(function(v,R){function P(ge){try{fe(a.next(ge))}catch(Q){R(Q)}}function J(ge){try{fe(a.throw(ge))}catch(Q){R(Q)}}function fe(ge){var Q;ge.done?v(ge.value):(Q=ge.value,Q instanceof o?Q:new o(function(Te){Te(Q)})).then(P,J)}fe((a=a.apply(d,i||[])).next())})}function O(d,i){var o,a,v,R,P={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return R={next:J(0),throw:J(1),return:J(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function J(fe){return function(ge){return function(Q){if(o)throw new TypeError("Generator is already executing.");for(;P;)try{if(o=1,a&&(v=2&Q[0]?a.return:Q[0]?a.throw||((v=a.return)&&v.call(a),0):a.next)&&!(v=v.call(a,Q[1])).done)return v;switch(a=0,v&&(Q=[2&Q[0],v.value]),Q[0]){case 0:case 1:v=Q;break;case 4:return P.label++,{value:Q[1],done:!1};case 5:P.label++,a=Q[1],Q=[0];continue;case 7:Q=P.ops.pop(),P.trys.pop();continue;default:if(v=P.trys,!((v=v.length>0&&v[v.length-1])||Q[0]!==6&&Q[0]!==2)){P=0;continue}if(Q[0]===3&&(!v||Q[1]>v[0]&&Q[1]<v[3])){P.label=Q[1];break}if(Q[0]===6&&P.label<v[1]){P.label=v[1],v=Q;break}if(v&&P.label<v[2]){P.label=v[2],P.ops.push(Q);break}v[2]&&P.ops.pop(),P.trys.pop();continue}Q=i.call(d,P)}catch(Te){Q=[6,Te],a=0}finally{o=v=0}if(5&Q[0])throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}([fe,ge])}}}var I="__BEACON_",z="__BEACON_deviceId",q="last_report_time",X="sending_event_ids",F="beacon_config",L="beacon_config_request_time",$=function(){function d(){var i=this;this.emit=function(o,a){if(i){var v,R=i.__EventsList[o];if(R!=null&&R.length){R=R.slice();for(var P=0;P<R.length;P++){v=R[P];try{var J=v.callback.apply(i,[a]);if(v.type===1&&i.remove(o,v.callback),J===!1)break}catch(fe){throw fe}}}return i}},this.__EventsList={}}return d.prototype.indexOf=function(i,o){for(var a=0;a<i.length;a++)if(i[a].callback===o)return a;return-1},d.prototype.on=function(i,o,a){if(a===void 0&&(a=0),this){var v=this.__EventsList[i];if(v||(v=this.__EventsList[i]=[]),this.indexOf(v,o)===-1){var R={name:i,type:a||0,callback:o};return v.push(R),this}return this}},d.prototype.one=function(i,o){this.on(i,o,1)},d.prototype.remove=function(i,o){if(this){var a=this.__EventsList[i];if(!a)return null;if(!o){try{delete this.__EventsList[i]}catch(R){}return null}if(a.length){var v=this.indexOf(a,o);a.splice(v,1)}return this}},d}();function Y(d,i){for(var o={},a=0,v=Object.keys(d);a<v.length;a++){var R=v[a],P=d[R];if(typeof P=="string")o[ee(R)]=ee(P);else{if(i)throw new Error("value mast be string !!!!");o[ee(String(R))]=ee(String(P))}}return o}function ee(d){if(typeof d!="string")return d;try{return d.replace(new RegExp("\\|","g"),"%7C").replace(new RegExp("\\&","g"),"%26").replace(new RegExp("\\=","g"),"%3D").replace(new RegExp("\\+","g"),"%2B")}catch(i){return""}}function B(d){return String(d.A99)+String(d.A100)}var m=function(){},C=function(){function d(i){var o=this;this.lifeCycle=new $,this.uploadJobQueue=[],this.additionalParams={},this.delayTime=0,this._normalLogPipeline=function(a){if(!a||!a.reduce||!a.length)throw new TypeError("createPipeline 方法需要传入至少有一个 pipe 的数组");return a.length===1?function(v,R){a[0](v,R||m)}:a.reduce(function(v,R){return function(P,J){return J===void 0&&(J=m),v(P,function(fe){return R==null?void 0:R(fe,J)})}})}([function(a){o.send({url:o.strategy.getUploadUrl(),data:a,method:"post",contentType:"application/json;charset=UTF-8"},function(){var v=o.config.onReportSuccess;typeof v=="function"&&v(JSON.stringify(a.events))},function(){var v=o.config.onReportFail;typeof v=="function"&&v(JSON.stringify(a.events))})}]),function(a,v){if(!a)throw v instanceof Error?v:new Error(v)}(!!i.appkey,"appkey must be initial"),this.config=U({},i)}return d.prototype.onUserAction=function(i,o){this.preReport(i,o,!1)},d.prototype.onDirectUserAction=function(i,o){this.preReport(i,o,!0)},d.prototype.preReport=function(i,o,a){i?this.strategy.isEventUpOnOff()&&(this.strategy.isBlackEvent(i)||this.strategy.isSampleEvent(i)||this.onReport(i,o,a)):this.errorReport.reportError("602"," no eventCode")},d.prototype.addAdditionalParams=function(i){for(var o=0,a=Object.keys(i);o<a.length;o++){var v=a[o];this.additionalParams[v]=i[v]}},d.prototype.setChannelId=function(i){this.commonInfo.channelID=String(i)},d.prototype.setOpenId=function(i){this.commonInfo.openid=String(i)},d.prototype.setUnionid=function(i){this.commonInfo.unid=String(i)},d.prototype.getDeviceId=function(){return this.commonInfo.deviceId},d.prototype.getCommonInfo=function(){return this.commonInfo},d.prototype.removeSendingId=function(i){try{var o=JSON.parse(this.storage.getItem(X)),a=o.indexOf(i);a!=-1&&(o.splice(a,1),this.storage.setItem(X,JSON.stringify(o)))}catch(v){}},d}(),V=function(){function d(i,o,a,v){this.requestParams={},this.network=v,this.requestParams.attaid="00400014144",this.requestParams.token="6478159937",this.requestParams.product_id=i.appkey,this.requestParams.platform=a,this.requestParams.uin=o.deviceId,this.requestParams.model="",this.requestParams.os=a,this.requestParams.app_version=i.appVersion,this.requestParams.sdk_version=o.sdkVersion,this.requestParams.error_stack="",this.uploadUrl=i.isOversea?"https://htrace.wetvinfo.com/kv":"https://h.trace.qq.com/kv"}return d.prototype.reportError=function(i,o){this.requestParams._dc=Math.random(),this.requestParams.error_msg=o,this.requestParams.error_code=i,this.network.get(this.uploadUrl,{params:this.requestParams}).catch(function(a){})},d}(),y=function(){function d(i,o,a,v,R){this.strategy={isEventUpOnOff:!0,httpsUploadUrl:"https://otheve.beacon.qq.com/analytics/v2_upload",requestInterval:30,blacklist:[],samplelist:[]},this.realSample={},this.appkey="",this.needQueryConfig=!0,this.appkey=o.appkey,this.storage=v,this.needQueryConfig=i;try{var P=JSON.parse(this.storage.getItem(F));P&&this.processData(P)}catch(J){}o.isOversea&&(this.strategy.httpsUploadUrl="https://svibeacon.onezapp.com/analytics/v2_upload"),!o.isOversea&&this.needRequestConfig()&&this.requestConfig(o.appVersion,a,R)}return d.prototype.requestConfig=function(i,o,a){var v=this;this.storage.setItem(L,Date.now().toString()),a.post("https://oth.str.beacon.qq.com/trpc.beacon.configserver.BeaconConfigService/QueryConfig",{platformId:typeof wx>"u"?"3":"4",mainAppKey:this.appkey,appVersion:i,sdkVersion:o.sdkVersion,osVersion:o.userAgent,model:"",packageName:"",params:{A3:o.deviceId}}).then(function(R){if(R.data.ret==0)try{var P=JSON.parse(R.data.beaconConfig);P&&(v.processData(P),v.storage.setItem(F,R.data.beaconConfig))}catch(J){}else v.processData(null),v.storage.setItem(F,"")}).catch(function(R){})},d.prototype.processData=function(i){var o,a,v,R,P;this.strategy.isEventUpOnOff=(o=i==null?void 0:i.isEventUpOnOff)!==null&&o!==void 0?o:this.strategy.isEventUpOnOff,this.strategy.httpsUploadUrl=(a=i==null?void 0:i.httpsUploadUrl)!==null&&a!==void 0?a:this.strategy.httpsUploadUrl,this.strategy.requestInterval=(v=i==null?void 0:i.requestInterval)!==null&&v!==void 0?v:this.strategy.requestInterval,this.strategy.blacklist=(R=i==null?void 0:i.blacklist)!==null&&R!==void 0?R:this.strategy.blacklist,this.strategy.samplelist=(P=i==null?void 0:i.samplelist)!==null&&P!==void 0?P:this.strategy.samplelist;for(var J=0,fe=this.strategy.samplelist;J<fe.length;J++){var ge=fe[J].split(",");ge.length==2&&(this.realSample[ge[0]]=ge[1])}},d.prototype.needRequestConfig=function(){if(!this.needQueryConfig)return!1;var i=Number(this.storage.getItem(L));return Date.now()-i>60*this.strategy.requestInterval*1e3},d.prototype.getUploadUrl=function(){return this.strategy.httpsUploadUrl+"?appkey="+this.appkey},d.prototype.isBlackEvent=function(i){return this.strategy.blacklist.indexOf(i)!=-1},d.prototype.isEventUpOnOff=function(){return this.strategy.isEventUpOnOff},d.prototype.isSampleEvent=function(i){return!!Object.prototype.hasOwnProperty.call(this.realSample,i)&&this.realSample[i]<Math.floor(Math.random()*Math.floor(1e4))},d}(),M="session_storage_key",j=function(){function d(i,o,a){this.getSessionStackDepth=0,this.beacon=a,this.storage=i,this.duration=o,this.appkey=a.config.appkey}return d.prototype.getSession=function(){this.getSessionStackDepth+=1;var i=this.storage.getItem(M);if(!i)return this.createSession();var o="",a=0;try{var v=JSON.parse(i)||{sessionId:void 0,sessionStart:void 0};if(!v.sessionId||!v.sessionStart)return this.createSession();var R=Number(this.storage.getItem(q));if(Date.now()-R>this.duration)return this.createSession();o=v.sessionId,a=v.sessionStart,this.getSessionStackDepth=0}catch(P){}return{sessionId:o,sessionStart:a}},d.prototype.createSession=function(){var i=Date.now(),o={sessionId:this.appkey+"_"+i.toString(),sessionStart:i};this.storage.setItem(M,JSON.stringify(o)),this.storage.setItem(q,i.toString());var a="is_new_user",v=this.storage.getItem(a);return this.getSessionStackDepth<=1&&this.beacon.onDirectUserAction("rqd_applaunched",{A21:v?"N":"Y"}),this.storage.setItem(a,JSON.stringify(!1)),o},d}();function w(){var d=navigator.userAgent,i=d.indexOf("compatible")>-1&&d.indexOf("MSIE")>-1,o=d.indexOf("Edge")>-1&&!i,a=d.indexOf("Trident")>-1&&d.indexOf("rv:11.0")>-1;if(i){new RegExp("MSIE (\\d+\\.\\d+);").test(d);var v=parseFloat(RegExp.$1);return v==7?7:v==8?8:v==9?9:v==10?10:6}return o?-2:a?11:-1}function D(d,i){var o,a;return(o="https://tun-cos-1258344701.file.myqcloud.com/fp.js",a===void 0&&(a=Date.now()+"-"+Math.random()),new Promise(function(v,R){if(document.getElementById(a))v(void 0);else{var P=document.getElementsByTagName("head")[0],J=document.createElement("script");J.onload=function(){return function(){J.onload=null,v(void 0)}},J.onerror=function(fe){J.onerror=null,P.removeChild(J),R(fe)},J.src=o,J.id=a,P.appendChild(J)}})).then(function(){new Fingerprint().getQimei36(d,i)}).catch(function(v){}),""}var A=function(){return(A=Object.assign||function(i){for(var o,a=1,v=arguments.length;a<v;a++)for(var R in o=arguments[a])Object.prototype.hasOwnProperty.call(o,R)&&(i[R]=o[R]);return i}).apply(this,arguments)},N,G=function(){function d(i,o){o===void 0&&(o={}),this.reportOptions={},this.config=i,this.reportOptions=o}return d.canUseDB=function(){return!!(window!=null&&window.indexedDB)},d.prototype.openDB=function(){var i=this;return new Promise(function(o,a){if(!d.canUseDB())return a({message:"当前不支持 indexeddb"});var v=i.config,R=v.name,P=v.version,J=v.stores,fe=indexedDB.open(R,P);fe.onsuccess=function(){i.db=fe.result,o(),A({result:1,func:"open",params:JSON.stringify(i.config)},i.reportOptions)},fe.onerror=function(ge){var Q,Te;a(ge),A({result:0,func:"open",params:JSON.stringify(i.config),error_msg:(Te=(Q=ge.target)===null||Q===void 0?void 0:Q.error)===null||Te===void 0?void 0:Te.message},i.reportOptions)},fe.onupgradeneeded=function(){i.db=fe.result;try{J==null||J.forEach(function(ge){i.createStore(ge)})}catch(ge){A({result:0,func:"open",params:JSON.stringify(i.config),error_msg:ge.message},i.reportOptions),a(ge)}}})},d.prototype.useStore=function(i){return this.storeName=i,this},d.prototype.deleteDB=function(){var i=this;return this.closeDB(),new Promise(function(o,a){var v=indexedDB.deleteDatabase(i.config.name);v.onsuccess=function(){return o()},v.onerror=a})},d.prototype.closeDB=function(){var i;(i=this.db)===null||i===void 0||i.close(),this.db=null},d.prototype.getStoreCount=function(){var i=this;return new Promise(function(o,a){var v=i.getStore("readonly").count();v.onsuccess=function(){return o(v.result)},v.onerror=a})},d.prototype.clearStore=function(){var i=this;return new Promise(function(o,a){var v=i.getStore("readwrite").clear();v.onsuccess=function(){return o()},v.onerror=a})},d.prototype.add=function(i,o){var a=this;return new Promise(function(v,R){var P=a.getStore("readwrite").add(i,o);P.onsuccess=function(){v(P.result)},P.onerror=R})},d.prototype.put=function(i,o){var a=this;return new Promise(function(v,R){var P=a.getStore("readwrite").put(i,o);P.onsuccess=function(){v(P.result)},P.onerror=R})},d.prototype.getStoreAllData=function(){var i=this;return new Promise(function(o,a){var v=i.getStore("readonly").openCursor(),R=[];v.onsuccess=function(){var P;if(!((P=v.result)===null||P===void 0)&&P.value){var J=v.result.value;R.push(J),v.result.continue()}else o(R)},v.onerror=a})},d.prototype.getDataRangeByIndex=function(i,o,a,v,R){var P=this;return new Promise(function(J,fe){var ge=P.getStore().index(i),Q=IDBKeyRange.bound(o,a,v,R),Te=[],Ne=ge.openCursor(Q);Ne.onsuccess=function(){var Fe;!((Fe=Ne==null?void 0:Ne.result)===null||Fe===void 0)&&Fe.value?(Te.push(Ne==null?void 0:Ne.result.value),Ne==null||Ne.result.continue()):J(Te)},Ne.onerror=fe})},d.prototype.removeDataByIndex=function(i,o,a,v,R){var P=this;return new Promise(function(J,fe){var ge=P.getStore("readwrite").index(i),Q=IDBKeyRange.bound(o,a,v,R),Te=ge.openCursor(Q),Ne=0;Te.onsuccess=function(Fe){var Be=Fe.target.result;Be?(Ne+=1,Be.delete(),Be.continue()):J(Ne)},Te.onerror=fe})},d.prototype.createStore=function(i){var o=i.name,a=i.indexes,v=a===void 0?[]:a,R=i.options;if(this.db){this.db.objectStoreNames.contains(o)&&this.db.deleteObjectStore(o);var P=this.db.createObjectStore(o,R);v.forEach(function(J){P.createIndex(J.indexName,J.keyPath,J.options)})}},d.prototype.getStore=function(i){var o;return i===void 0&&(i="readonly"),(o=this.db)===null||o===void 0?void 0:o.transaction(this.storeName,i).objectStore(this.storeName)},d}(),W="event_table_v3",Z="eventId",ie=function(){function d(i){this.isReady=!1,this.taskQueue=Promise.resolve(),this.db=new G({name:"Beacon_"+i+"_V3",version:1,stores:[{name:W,options:{keyPath:Z},indexes:[{indexName:Z,keyPath:Z,options:{unique:!0}}]}]}),this.open()}return d.prototype.getCount=function(){var i=this;return this.readyExec(function(){return i.db.getStoreCount()})},d.prototype.setItem=function(i,o){var a=this;return this.readyExec(function(){return a.db.add({eventId:i,value:o})})},d.prototype.getItem=function(i){return K(this,void 0,void 0,function(){var o=this;return O(this,function(a){return[2,this.readyExec(function(){return o.db.getDataRangeByIndex(Z,i,i)})]})})},d.prototype.removeItem=function(i){var o=this;return this.readyExec(function(){return o.db.removeDataByIndex(Z,i,i)})},d.prototype.updateItem=function(i,o){var a=this;return this.readyExec(function(){return a.db.put({eventId:i,value:o})})},d.prototype.iterate=function(i){var o=this;return this.readyExec(function(){return o.db.getStoreAllData().then(function(a){a.forEach(function(v){i(v.value)})})})},d.prototype.open=function(){return K(this,void 0,void 0,function(){var i=this;return O(this,function(o){switch(o.label){case 0:return this.taskQueue=this.taskQueue.then(function(){return i.db.openDB()}),[4,this.taskQueue];case 1:return o.sent(),this.isReady=!0,this.db.useStore(W),[2]}})})},d.prototype.readyExec=function(i){return this.isReady?i():(this.taskQueue=this.taskQueue.then(function(){return i()}),this.taskQueue)},d}(),le=function(){function d(i){this.keyObject={},this.storage=i}return d.prototype.getCount=function(){return this.storage.getStoreCount()},d.prototype.removeItem=function(i){this.storage.removeItem(i),delete this.keyObject[i]},d.prototype.setItem=function(i,o){var a=JSON.stringify(o);this.storage.setItem(i,a),this.keyObject[i]=o},d.prototype.iterate=function(i){for(var o=Object.keys(this.keyObject),a=0;a<o.length;a++){var v=this.storage.getItem(o[a]);i(JSON.parse(v))}},d}(),ae=function(){function d(i,o){var a=this;this.dbEventCount=0,w()>0||!window.indexedDB||/X5Lite/.test(navigator.userAgent)?(this.store=new le(o),this.dbEventCount=this.store.getCount()):(this.store=new ie(i),this.getCount().then(function(v){a.dbEventCount=v}).catch(function(v){}))}return d.prototype.getCount=function(){return K(this,void 0,void 0,function(){return O(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.store.getCount()];case 1:return[2,i.sent()];case 2:return i.sent(),[2,Promise.reject()];case 3:return[2]}})})},d.prototype.insertEvent=function(i,o){return K(this,void 0,void 0,function(){var a,v;return O(this,function(R){switch(R.label){case 0:if(this.dbEventCount>=1e4)return[2,Promise.reject()];a=B(i.mapValue),R.label=1;case 1:return R.trys.push([1,3,,4]),this.dbEventCount++,[4,this.store.setItem(a,i)];case 2:return[2,R.sent()];case 3:return v=R.sent(),o&&o(v,i),this.dbEventCount--,[2,Promise.reject()];case 4:return[2]}})})},d.prototype.getEvents=function(){return K(this,void 0,void 0,function(){var i;return O(this,function(o){switch(o.label){case 0:i=[],o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.store.iterate(function(a){i.push(a)})];case 2:return o.sent(),[2,Promise.all(i)];case 3:return o.sent(),[2,Promise.all(i)];case 4:return[2]}})})},d.prototype.removeEvent=function(i){return K(this,void 0,void 0,function(){var o;return O(this,function(a){switch(a.label){case 0:o=B(i.mapValue),a.label=1;case 1:return a.trys.push([1,3,,4]),this.dbEventCount--,[4,this.store.removeItem(o)];case 2:return[2,a.sent()];case 3:return a.sent(),this.dbEventCount++,[2,Promise.reject()];case 4:return[2]}})})},d}(),oe=function(){return(oe=Object.assign||function(i){for(var o,a=1,v=arguments.length;a<v;a++)for(var R in o=arguments[a])Object.prototype.hasOwnProperty.call(o,R)&&(i[R]=o[R]);return i}).apply(this,arguments)};function de(d){try{return decodeURIComponent(d.replace(/\+/g," "))}catch(i){return null}}function ue(d,i){var o=[null,void 0,"",NaN].includes(d);if(i.isSkipEmpty&&o)return null;var a=!i.isSkipEmpty&&o?"":d;try{return i.encode?encodeURIComponent(a):a}catch(v){return null}}function me(d,i){i===void 0&&(i={encode:!0,isSkipEmpty:!1});var o=d.url,a=d.query,v=a===void 0?{}:a,R=d.hash,P=o.split("#"),J=P[0],fe=P[1],ge=fe===void 0?"":fe,Q=J.split("?")[0],Te=[],Ne=ue(R||ge,i),Fe=oe(oe({},function(Be){var Le=Be.split("#"),Ve=Le[0],Ge=Le[1],We=Ge===void 0?"":Ge,qe=Ve.split("?"),Xe=qe[0],Ye=qe[1],ot=Ye===void 0?"":Ye,tt=de(We),rt=Object.create(null);return ot.split("&").forEach(function(c){var h=c.split("="),b=h[0],H=h[1],he=H===void 0?"":H,Re=de(b),Me=de(he);Re===null||Me===null||Re===""&&Me===""||rt[Re]||(rt[Re]=Me)}),{url:Xe,query:rt,hash:tt}}(o).query),v);return Object.keys(Fe).forEach(function(Be){var Le=ue(Be,i),Ve=ue(Fe[Be],i);Le!==null&&Ve!==null&&Te.push(Le+"="+Ve)}),Q+(Te.length?"?"+Te.join("&"):"")+(Ne?"#"+Ne:"")}function te(d,i){return new Promise(function(o,a){if(i&&document.querySelectorAll("script[data-tag="+i+"]").length)return o();var v=document.createElement("script"),R=oe({type:"text/javascript",charset:"utf-8"},d);Object.keys(R).forEach(function(P){return function(J,fe,ge){if(J)return ge===void 0?J.getAttribute(fe):J.setAttribute(fe,ge)}(v,P,R[P])}),i&&(v.dataset.tag=i),v.onload=function(){return o()},v.onreadystatechange=function(){var P=v.readyState;["complete","loaded"].includes(P)&&(v.onreadystatechange=null,o())},v.onerror=a,document.body.appendChild(v)})}(function(d){d[d.equal=0]="equal",d[d.low=-1]="low",d[d.high=1]="high"})(N||(N={}));var re=function(){return(re=Object.assign||function(i){for(var o,a=1,v=arguments.length;a<v;a++)for(var R in o=arguments[a])Object.prototype.hasOwnProperty.call(o,R)&&(i[R]=o[R]);return i}).apply(this,arguments)};function pe(d,i,o,a){return new(o||(o=Promise))(function(v,R){function P(ge){try{fe(a.next(ge))}catch(Q){R(Q)}}function J(ge){try{fe(a.throw(ge))}catch(Q){R(Q)}}function fe(ge){var Q;ge.done?v(ge.value):(Q=ge.value,Q instanceof o?Q:new o(function(Te){Te(Q)})).then(P,J)}fe((a=a.apply(d,i||[])).next())})}function Ce(d,i){var o,a,v,R,P={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return R={next:J(0),throw:J(1),return:J(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function J(fe){return function(ge){return function(Q){if(o)throw new TypeError("Generator is already executing.");for(;P;)try{if(o=1,a&&(v=2&Q[0]?a.return:Q[0]?a.throw||((v=a.return)&&v.call(a),0):a.next)&&!(v=v.call(a,Q[1])).done)return v;switch(a=0,v&&(Q=[2&Q[0],v.value]),Q[0]){case 0:case 1:v=Q;break;case 4:return P.label++,{value:Q[1],done:!1};case 5:P.label++,a=Q[1],Q=[0];continue;case 7:Q=P.ops.pop(),P.trys.pop();continue;default:if(!((v=(v=P.trys).length>0&&v[v.length-1])||Q[0]!==6&&Q[0]!==2)){P=0;continue}if(Q[0]===3&&(!v||Q[1]>v[0]&&Q[1]<v[3])){P.label=Q[1];break}if(Q[0]===6&&P.label<v[1]){P.label=v[1],v=Q;break}if(v&&P.label<v[2]){P.label=v[2],P.ops.push(Q);break}v[2]&&P.ops.pop(),P.trys.pop();continue}Q=i.call(d,P)}catch(Te){Q=[6,Te],a=0}finally{o=v=0}if(5&Q[0])throw Q[1];return{value:Q[0]?Q[1]:void 0,done:!0}}([fe,ge])}}}var ve=function(){function d(){this.interceptors=[]}return d.prototype.use=function(i,o){return this.interceptors.push({resolved:i,rejected:o}),this.interceptors.length-1},d.prototype.traverse=function(i,o){o===void 0&&(o=!1);var a=Promise.resolve(i);return(o?Array.prototype.reduceRight:Array.prototype.reduce).call(this.interceptors,function(v,R){if(R){var P=R.resolved,J=R.rejected;a=a.then(P,J)}return v},""),a},d.prototype.eject=function(i){this.interceptors[i]&&(this.interceptors[i]=null)},d}(),ye={defaults:{timeout:0,method:"GET",mode:"cors",redirect:"follow",credentials:"same-origin"},headers:{common:{Accept:"application/json, text/plain, */*"},POST:{"Content-Type":"application/x-www-form-urlencoded"},PUT:{"Content-Type":"application/x-www-form-urlencoded"},PATCH:{"Content-Type":"application/x-www-form-urlencoded"}},baseURL:"",polyfillUrl:"https://vm.gtimg.cn/comps/script/fetch.min.js",interceptors:{request:new ve,response:new ve}},Se=/^([a-z][a-z\d+\-.]*:)?\/\//i,xe=Object.prototype.toString;function Ee(d){return pe(this,void 0,void 0,function(){var i;return Ce(this,function(o){switch(o.label){case 0:if(window.fetch)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,te({src:d})];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),new Error("加载 polyfill "+d+" 失败: "+i.message);case 4:return[2]}})})}function Ie(d){return["Accept","Content-Type"].forEach(function(i){return o=i,void((a=d.headers)&&Object.keys(a).forEach(function(v){v!==o&&v.toUpperCase()===o.toUpperCase()&&(a[o]=a[v],delete a[v])}));var o,a}),function(i){if(xe.call(i)!=="[object Object]")return!1;var o=Object.getPrototypeOf(i);return o===null||o===Object.prototype}(d.body)&&(d.body=JSON.stringify(d.body),d.headers&&(d.headers["Content-Type"]="application/json;charset=utf-8")),d}function we(d){return pe(this,void 0,void 0,function(){var i,o,a,v,R,P,J,fe,ge,Q,Te,Ne,Fe,Be,Le,Ve,Ge;return Ce(this,function(We){switch(We.label){case 0:return i=ye.baseURL,o=ye.defaults,a=ye.interceptors,[4,Ee(ye.polyfillUrl)];case 1:return We.sent(),(v=re(re({},o),d)).headers||(v.headers=function(qe){qe===void 0&&(qe="GET");var Xe=ye.headers[qe]||{};return re(re({},ye.headers.common),Xe)}(v.method)),Ie(v),[4,a.request.traverse(v,!0)];case 2:if((R=We.sent())instanceof Error)throw R;return R.url=function(qe,Xe){return!qe||Se.test(Xe)?Xe:qe.replace(/\/+$/,"")+"/"+Xe.replace(/^\/+/,"")}(i,R.url),P=R.url,J=R.timeout,fe=R.params,ge=R.method,Q=["GET","DELETE","OPTIONS","HEAD"].includes(ge===void 0?"GET":ge)&&!!fe,Te=Q?me({url:P,query:fe}):P,Ne=[],J&&!R.signal&&(Le=new Promise(function(qe){Fe=setTimeout(function(){qe(new Error("timeout"))},J)}),Ne.push(Le),Be=new AbortController,R.signal=Be.signal),Ne.push(fetch(Te,R).catch(function(qe){return qe})),[4,Promise.race(Ne)];case 3:return Ve=We.sent(),Fe&&clearTimeout(Fe),[4,a.response.traverse(Ve)];case 4:if((Ge=We.sent())instanceof Error)throw Be==null||Be.abort(),Ge;return[2,Ge]}})})}var _e=function(){function d(i){ye.interceptors.request.use(function(o){var a=o.url,v=o.method,R=o.body,P=R;if(i.onReportBeforeSend){var J=i.onReportBeforeSend({url:a,method:v,data:R?JSON.parse(R):null});P=J!=null&&J.data?JSON.stringify(J.data):null}return v!="GET"&&P?U(U({},o),{body:P}):o})}return d.prototype.get=function(i,o){return K(this,void 0,void 0,function(){var a,v;return O(this,function(R){switch(R.label){case 0:return[4,we(U({url:i},o))];case 1:return[4,(a=R.sent()).json()];case 2:return v=R.sent(),[2,Promise.resolve({data:v,status:a.status,statusText:a.statusText,headers:a.headers})]}})})},d.prototype.post=function(i,o,a){return K(this,void 0,void 0,function(){var v,R;return O(this,function(P){switch(P.label){case 0:return[4,we(U({url:i,body:o,method:"POST"},a))];case 1:return[4,(v=P.sent()).json()];case 2:return R=P.sent(),[2,Promise.resolve({data:R,status:v.status,statusText:v.statusText,headers:v.headers})]}})})},d}(),je=function(){function d(i){this.appkey=i}return d.prototype.getItem=function(i){try{return window.localStorage.getItem(this.getStoreKey(i))}catch(o){return""}},d.prototype.removeItem=function(i){try{window.localStorage.removeItem(this.getStoreKey(i))}catch(o){}},d.prototype.setItem=function(i,o){try{window.localStorage.setItem(this.getStoreKey(i),o)}catch(a){}},d.prototype.setSessionItem=function(i,o){try{window.sessionStorage.setItem(this.getStoreKey(i),o)}catch(a){}},d.prototype.getSessionItem=function(i){try{return window.sessionStorage.getItem(this.getStoreKey(i))}catch(o){return""}},d.prototype.getStoreKey=function(i){return I+this.appkey+"_"+i},d.prototype.createDeviceId=function(){try{var i=window.localStorage.getItem(z);return i||(i=function(o){for(var a="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789",v="",R=0;R<o;R++)v+=a.charAt(Math.floor(Math.random()*a.length));return v}(32),window.localStorage.setItem(z,i)),i}catch(o){return""}},d.prototype.clear=function(){try{for(var i=window.localStorage.length,o=0;o<i;o++){var a=window.localStorage.key(o);(a==null?void 0:a.substr(0,9))==I&&window.localStorage.removeItem(a)}}catch(v){}},d.prototype.getStoreCount=function(){var i=0;try{i=window.localStorage.length}catch(o){}return i},d}(),Ue="logid_start",se="4.5.14-web";return function(d){function i(o){var a=d.call(this,o)||this;a.qimei36="",a.uselessCycleTaskNum=0,a.underWeakNet=!1,a.pauseSearching=!1,a.send=function(J,fe,ge){a.storage.setItem(q,Date.now().toString()),a.network.post(a.uploadUrl||a.strategy.getUploadUrl(),J.data).then(function(Q){var Te;((Te=Q==null?void 0:Q.data)===null||Te===void 0?void 0:Te.result)==100?a.delayTime=1e3*Q.data.delayTime:a.delayTime=0,fe&&fe(J.data),J.data.events.forEach(function(Ne){a.store.removeEvent(Ne).then(function(){a.removeSendingId(B(Ne.mapValue))})}),a.doCustomCycleTask()}).catch(function(Q){var Te=J.data.events;a.errorReport.reportError(Q.code?Q.code.toString():"600",Q.message),ge&&ge(J.data);var Ne=JSON.parse(a.storage.getItem(X));Te.forEach(function(Fe){Ne&&Ne.indexOf(B(Fe))!=-1&&a.store.insertEvent(Fe,function(Be,Le){Be&&a.errorReport.reportError("604","insertEvent fail!")}),a.removeSendingId(B(Fe))}),a.monitorUploadFailed()})};var v,R,P=w();return a.isUnderIE8=P>0&&P<8,a.isUnderIE8||(a.isUnderIE=P>0,o.needInitQimei&&D(o.appkey,function(J){a.qimei36=J.q36}),a.network=new _e(o),a.storage=new je(o.appkey),a.initCommonInfo(o),a.store=new ae(o.appkey,a.storage),a.errorReport=new V(a.config,a.commonInfo,"web",a.network),a.strategy=new y(o.needQueryConfig==null||o.needQueryConfig,a.config,a.commonInfo,a.storage,a.network),a.logidStartTime=a.storage.getItem(Ue),a.logidStartTime||(a.logidStartTime=Date.now().toString(),a.storage.setItem(Ue,a.logidStartTime)),v=a.logidStartTime,R=Date.now()-Number.parseFloat(v),Math.floor(R/864e5)>=365&&a.storage.clear(),a.initSession(o),a.onDirectUserAction("rqd_js_init",{}),setTimeout(function(){return a.lifeCycle.emit("init")},0),a.initDelayTime=o.delay?o.delay:1e3,a.cycleTask(a.initDelayTime)),a}return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function v(){this.constructor=o}T(o,a),o.prototype=a===null?Object.create(a):(v.prototype=a.prototype,new v)}(i,d),i.prototype.initSession=function(o){var a=18e5;o.sessionDuration&&o.sessionDuration>3e4&&(a=o.sessionDuration),this.beaconSession=new j(this.storage,a,this)},i.prototype.initCommonInfo=function(o){var a=Number(this.storage.getItem(q));try{var v=JSON.parse(this.storage.getItem(X));(Date.now()-a>3e4||!v)&&this.storage.setItem(X,JSON.stringify([]))}catch(P){}o.uploadUrl&&(this.uploadUrl=o.uploadUrl+"?appkey="+o.appkey);var R=[window.screen.width,window.screen.height];window.devicePixelRatio&&R.push(window.devicePixelRatio),this.commonInfo={deviceId:this.storage.createDeviceId(),language:navigator&&navigator.language||"zh_CN",query:window.location.search,userAgent:navigator.userAgent,pixel:R.join("*"),channelID:o.channelID?String(o.channelID):"",openid:o.openid?String(o.openid):"",unid:o.unionid?String(o.unionid):"",sdkVersion:se},this.config.appVersion=o.versionCode?String(o.versionCode):"",this.config.strictMode=o.strictMode},i.prototype.cycleTask=function(o){var a=this;this.intervalID=window.setInterval(function(){a.pauseSearching||a.store.getEvents().then(function(v){v.length==0&&(a.pauseSearching=!0);var R=[],P=JSON.parse(a.storage.getItem(X));P||(P=[]),v&&v.forEach(function(J){var fe=B(J.mapValue);P.indexOf(fe)==-1&&(R.push(J),P.push(fe))}),R.length!=0&&(a.storage.setItem(X,JSON.stringify(P)),a._normalLogPipeline(a.assembleData(R)))}).catch(function(v){})},o)},i.prototype.onReport=function(o,a,v){var R=this;if(this.isUnderIE8)this.errorReport.reportError("601","UnderIE8");else{this.pauseSearching=!1;var P=this.generateData(o,a,v);if(v&&this.delayTime==0&&!this.underWeakNet)this._normalLogPipeline(this.assembleData(P));else{var J=P.shift();J&&this.store.insertEvent(J,function(fe){fe&&R.errorReport.reportError("604","insertEvent fail!")}).catch(function(fe){R._normalLogPipeline(R.assembleData(P))})}}},i.prototype.onSendBeacon=function(o,a){if(this.isUnderIE)this.errorReport.reportError("605","UnderIE");else{this.pauseSearching=!1;var v=this.assembleData(this.generateData(o,a,!0));typeof navigator.sendBeacon=="function"&&navigator.sendBeacon(this.uploadUrl||this.strategy.getUploadUrl(),JSON.stringify(v))}},i.prototype.generateData=function(o,a,v){var R=[],P="4.5.14-web_"+(v?"direct_log_id":"normal_log_id"),J=Number(this.storage.getItem(P));return J=J||1,a=U(U({},a),{A99:v?"Y":"N",A100:J.toString(),A72:se,A88:this.logidStartTime}),J++,this.storage.setItem(P,J.toString()),R.push({eventCode:o,eventTime:Date.now().toString(),mapValue:Y(a,this.config.strictMode)}),R},i.prototype.assembleData=function(o){var a=this.beaconSession.getSession();return{appVersion:this.config.appVersion?ee(this.config.appVersion):"",sdkId:"js",sdkVersion:se,mainAppKey:this.config.appkey,platformId:3,common:Y(U(U({},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:a.sessionId,A101:this.commonInfo.userAgent,A102:window.location.href,A104:document.referrer,A119:this.commonInfo.query,A153:this.qimei36}),!1),events:o}},i.prototype.monitorUploadFailed=function(){this.uselessCycleTaskNum++,this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(6e4),this.underWeakNet=!0)},i.prototype.doCustomCycleTask=function(){this.uselessCycleTaskNum>=5&&(window.clearInterval(this.intervalID),this.cycleTask(this.initDelayTime)),this.uselessCycleTaskNum=0,this.underWeakNet=!1},i}(C)})},"./lib/crypto.js":function(r,p,s){(function(u){var x=s("./node_modules/@babel/runtime/helpers/typeof.js"),l=l||function(T,U){var K={},O=K.lib={},I=function(){},z=O.Base={extend:function(m){I.prototype=this;var C=new I;return m&&C.mixIn(m),C.hasOwnProperty("init")||(C.init=function(){C.$super.init.apply(this,arguments)}),C.init.prototype=C,C.$super=this,C},create:function(){var m=this.extend();return m.init.apply(m,arguments),m},init:function(){},mixIn:function(m){for(var C in m)m.hasOwnProperty(C)&&(this[C]=m[C]);m.hasOwnProperty("toString")&&(this.toString=m.toString)},clone:function(){return this.init.prototype.extend(this)}},q=O.WordArray=z.extend({init:function(m,C){m=this.words=m||[],this.sigBytes=C!=U?C:4*m.length},toString:function(m){return(m||F).stringify(this)},concat:function(m){var C=this.words,V=m.words,y=this.sigBytes;if(m=m.sigBytes,this.clamp(),y%4)for(var M=0;M<m;M++)C[y+M>>>2]|=(V[M>>>2]>>>24-8*(M%4)&255)<<24-8*((y+M)%4);else if(65535<V.length)for(M=0;M<m;M+=4)C[y+M>>>2]=V[M>>>2];else C.push.apply(C,V);return this.sigBytes+=m,this},clamp:function(){var m=this.words,C=this.sigBytes;m[C>>>2]&=4294967295<<32-8*(C%4),m.length=T.ceil(C/4)},clone:function(){var m=z.clone.call(this);return m.words=this.words.slice(0),m},random:function(m){for(var C=[],V=0;V<m;V+=4)C.push(4294967296*T.random()|0);return new q.init(C,m)}}),X=K.enc={},F=X.Hex={stringify:function(m){var C=m.words;m=m.sigBytes;for(var V=[],y=0;y<m;y++){var M=C[y>>>2]>>>24-8*(y%4)&255;V.push((M>>>4).toString(16)),V.push((M&15).toString(16))}return V.join("")},parse:function(m){for(var C=m.length,V=[],y=0;y<C;y+=2)V[y>>>3]|=parseInt(m.substr(y,2),16)<<24-4*(y%8);return new q.init(V,C/2)}},L=X.Latin1={stringify:function(m){var C=m.words;m=m.sigBytes;for(var V=[],y=0;y<m;y++)V.push(String.fromCharCode(C[y>>>2]>>>24-8*(y%4)&255));return V.join("")},parse:function(m){for(var C=m.length,V=[],y=0;y<C;y++)V[y>>>2]|=(m.charCodeAt(y)&255)<<24-8*(y%4);return new q.init(V,C)}},$=X.Utf8={stringify:function(m){try{return decodeURIComponent(escape(L.stringify(m)))}catch(C){throw Error("Malformed UTF-8 data")}},parse:function(m){return L.parse(unescape(encodeURIComponent(m)))}},Y=O.BufferedBlockAlgorithm=z.extend({reset:function(){this._data=new q.init,this._nDataBytes=0},_append:function(m){typeof m=="string"&&(m=$.parse(m)),this._data.concat(m),this._nDataBytes+=m.sigBytes},_process:function(m){var C=this._data,V=C.words,y=C.sigBytes,M=this.blockSize,j=y/(4*M),j=m?T.ceil(j):T.max((j|0)-this._minBufferSize,0);if(m=j*M,y=T.min(4*m,y),m){for(var w=0;w<m;w+=M)this._doProcessBlock(V,w);w=V.splice(0,m),C.sigBytes-=y}return new q.init(w,y)},clone:function(){var m=z.clone.call(this);return m._data=this._data.clone(),m},_minBufferSize:0});O.Hasher=Y.extend({cfg:z.extend(),init:function(m){this.cfg=this.cfg.extend(m),this.reset()},reset:function(){Y.reset.call(this),this._doReset()},update:function(m){return this._append(m),this._process(),this},finalize:function(m){return m&&this._append(m),this._doFinalize()},blockSize:16,_createHelper:function(m){return function(C,V){return new m.init(V).finalize(C)}},_createHmacHelper:function(m){return function(C,V){return new ee.HMAC.init(m,V).finalize(C)}}});var ee=K.algo={};return K}(Math);(function(){var T=l,I=T.lib,U=I.WordArray,K=I.Hasher,O=[],I=T.algo.SHA1=K.extend({_doReset:function(){this._hash=new U.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(q,X){for(var F=this._hash.words,L=F[0],$=F[1],Y=F[2],ee=F[3],B=F[4],m=0;80>m;m++){if(16>m)O[m]=q[X+m]|0;else{var C=O[m-3]^O[m-8]^O[m-14]^O[m-16];O[m]=C<<1|C>>>31}C=(L<<5|L>>>27)+B+O[m],C=20>m?C+(($&Y|~$&ee)+1518500249):40>m?C+(($^Y^ee)+1859775393):60>m?C+(($&Y|$&ee|Y&ee)-1894007588):C+(($^Y^ee)-899497514),B=ee,ee=Y,Y=$<<30|$>>>2,$=L,L=C}F[0]=F[0]+L|0,F[1]=F[1]+$|0,F[2]=F[2]+Y|0,F[3]=F[3]+ee|0,F[4]=F[4]+B|0},_doFinalize:function(){var q=this._data,X=q.words,F=8*this._nDataBytes,L=8*q.sigBytes;return X[L>>>5]|=128<<24-L%32,X[(L+64>>>9<<4)+14]=Math.floor(F/4294967296),X[(L+64>>>9<<4)+15]=F,q.sigBytes=4*X.length,this._process(),this._hash},clone:function(){var q=K.clone.call(this);return q._hash=this._hash.clone(),q}});T.SHA1=K._createHelper(I),T.HmacSHA1=K._createHmacHelper(I)})(),function(){var T=l,U=T.enc.Utf8;T.algo.HMAC=T.lib.Base.extend({init:function(O,I){O=this._hasher=new O.init,typeof I=="string"&&(I=U.parse(I));var z=O.blockSize,q=4*z;I.sigBytes>q&&(I=O.finalize(I)),I.clamp();for(var X=this._oKey=I.clone(),F=this._iKey=I.clone(),L=X.words,$=F.words,Y=0;Y<z;Y++)L[Y]^=1549556828,$[Y]^=909522486;X.sigBytes=F.sigBytes=q,this.reset()},reset:function(){var O=this._hasher;O.reset(),O.update(this._iKey)},update:function(O){return this._hasher.update(O),this},finalize:function(O){var I=this._hasher;return O=I.finalize(O),I.reset(),I.finalize(this._oKey.clone().concat(O))}})}(),function(){var T=l,U=T.lib,K=U.WordArray,O=T.enc;O.Base64={stringify:function(z){var q=z.words,X=z.sigBytes,F=this._map;z.clamp();for(var L=[],$=0;$<X;$+=3)for(var Y=q[$>>>2]>>>24-$%4*8&255,ee=q[$+1>>>2]>>>24-($+1)%4*8&255,B=q[$+2>>>2]>>>24-($+2)%4*8&255,m=Y<<16|ee<<8|B,C=0;C<4&&$+C*.75<X;C++)L.push(F.charAt(m>>>6*(3-C)&63));var V=F.charAt(64);if(V)for(;L.length%4;)L.push(V);return L.join("")},parse:function(z){var q=z.length,X=this._map,F=X.charAt(64);if(F){var L=z.indexOf(F);L!=-1&&(q=L)}for(var $=[],Y=0,ee=0;ee<q;ee++)if(ee%4){var B=X.indexOf(z.charAt(ee-1))<<ee%4*2,m=X.indexOf(z.charAt(ee))>>>6-ee%4*2;$[Y>>>2]|=(B|m)<<24-Y%4*8,Y++}return K.create($,Y)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),x(u)==="object"?u.exports=l:window.CryptoJS=l}).call(this,s("./node_modules/webpack/buildin/module.js")(r))},"./lib/json2xml.js":function(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x="a-zA-Z_À-ÖØ-öø-ÿͰ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�",l="-.0-9·̀-ͯ‿⁀",T=new RegExp("^([^"+x+"])|^((x|X)(m|M)(l|L))|([^"+x+l+"])","g"),U=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,K=function(X){var F=[];if(X instanceof Object)for(var L in X)X.hasOwnProperty(L)&&F.push(L);return F},O=function(X,F){var L=function(Y,ee,B,m,C){var V=F.indent!==void 0?F.indent:" ",y=F.prettyPrint?`
- `+new Array(m).join(V):"";F.removeIllegalNameCharacters&&(Y=Y.replace(T,"_"));var M=[y,"<",Y,B||""];return ee&&ee.length>0?(M.push(">"),M.push(ee),C&&M.push(y),M.push("</"),M.push(Y),M.push(">")):M.push("/>"),M.join("")};return function $(Y,ee,B){var m=u(Y);switch((Array.isArray?Array.isArray(Y):Y instanceof Array)?m="array":Y instanceof Date&&(m="date"),m){case"array":var C=[];return Y.map(function(j){C.push($(j,1,B+1))}),F.prettyPrint&&C.push(`
- `),C.join("");case"date":return Y.toJSON?Y.toJSON():Y+"";case"object":var V=[];for(var y in Y)if(Y.hasOwnProperty(y))if(Y[y]instanceof Array)for(var M=0;M<Y[y].length;M++)Y[y].hasOwnProperty(M)&&V.push(L(y,$(Y[y][M],0,B+1),null,B+1,K(Y[y][M]).length));else V.push(L(y,$(Y[y],0,B+1),null,B+1));return F.prettyPrint&&V.length>0&&V.push(`
- `),V.join("");case"function":return Y();default:return F.escape?z(Y):""+Y}}(X,0,0)},I=function(X){var F=['<?xml version="1.0" encoding="UTF-8"'];return X&&F.push(' standalone="yes"'),F.push("?>"),F.join("")};function z(q){return(""+q).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""").replace(U,"")}r.exports=function(q,X){if(X||(X={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),typeof q=="string")try{q=JSON.parse(q.toString())}catch(Y){return!1}var F="",L="";X&&(u(X)=="object"?(X.xmlHeader&&(F=I(!!X.xmlHeader.standalone)),typeof X.docType<"u"&&(L="<!DOCTYPE "+X.docType+">")):F=I()),X=X||{};var $=[F,X.prettyPrint&&L?`
- `:"",L,O(q,X)];return $.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>"u"?"undefined":_typeof(window))==="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&(typeof self>"u"?"undefined":_typeof(self))==="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&(typeof process>"u"?"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<"u",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(r){return Object.prototype.toString.call(r)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return _typeof(r)==="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});var createOutputMethod=function(p){return function(s,u){return new Md5(!0).update(s,u)[p]()}},createMethod=function(){var p=createOutputMethod("hex");NODE_JS&&(p=nodeWrap(p)),p.getCtx=p.create=function(){return new Md5},p.update=function(x){return p.create().update(x)};for(var s=0;s<OUTPUT_TYPES.length;++s){var u=OUTPUT_TYPES[s];p[u]=createOutputMethod(u)}return p},nodeWrap=function nodeWrap(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function r(p){if(typeof p=="string")return crypto.createHash("md5").update(p,"utf8").digest("hex");if(p==null)throw ERROR;return p.constructor===ArrayBuffer&&(p=new Uint8Array(p)),Array.isArray(p)||ArrayBuffer.isView(p)||p.constructor===Buffer?crypto.createHash("md5").update(new Buffer(p)).digest("hex"):method(p)};return nodeMethod};function Md5(r){if(r)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var p=new ArrayBuffer(68);this.buffer8=new Uint8Array(p),this.blocks=new Uint32Array(p)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(r,p){if(!this.finalized){for(var s,u=0,x,l=r.length,T=this.blocks,U=this.buffer8;u<l;){if(this.hashed&&(this.hashed=!1,T[0]=T[16],T[16]=T[1]=T[2]=T[3]=T[4]=T[5]=T[6]=T[7]=T[8]=T[9]=T[10]=T[11]=T[12]=T[13]=T[14]=T[15]=0),ARRAY_BUFFER)for(x=this.start;u<l&&x<64;++u)s=r.charCodeAt(u),p||s<128?U[x++]=s:s<2048?(U[x++]=192|s>>6,U[x++]=128|s&63):s<55296||s>=57344?(U[x++]=224|s>>12,U[x++]=128|s>>6&63,U[x++]=128|s&63):(s=65536+((s&1023)<<10|r.charCodeAt(++u)&1023),U[x++]=240|s>>18,U[x++]=128|s>>12&63,U[x++]=128|s>>6&63,U[x++]=128|s&63);else for(x=this.start;u<l&&x<64;++u)s=r.charCodeAt(u),p||s<128?T[x>>2]|=s<<SHIFT[x++&3]:s<2048?(T[x>>2]|=(192|s>>6)<<SHIFT[x++&3],T[x>>2]|=(128|s&63)<<SHIFT[x++&3]):s<55296||s>=57344?(T[x>>2]|=(224|s>>12)<<SHIFT[x++&3],T[x>>2]|=(128|s>>6&63)<<SHIFT[x++&3],T[x>>2]|=(128|s&63)<<SHIFT[x++&3]):(s=65536+((s&1023)<<10|r.charCodeAt(++u)&1023),T[x>>2]|=(240|s>>18)<<SHIFT[x++&3],T[x>>2]|=(128|s>>12&63)<<SHIFT[x++&3],T[x>>2]|=(128|s>>6&63)<<SHIFT[x++&3],T[x>>2]|=(128|s&63)<<SHIFT[x++&3]);this.lastByteIndex=x,this.bytes+=x-this.start,x>=64?(this.start=x-64,this.hash(),this.hashed=!0):this.start=x}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 r=this.blocks,p=this.lastByteIndex;r[p>>2]|=EXTRA[p&3],p>=56&&(this.hashed||this.hash(),r[0]=r[16],r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),r[14]=this.bytes<<3,r[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var r,p,s,u,x,l,T=this.blocks;this.first?(r=T[0]-680876937,r=(r<<7|r>>>25)-271733879<<0,u=(-1732584194^r&2004318071)+T[1]-117830708,u=(u<<12|u>>>20)+r<<0,s=(-271733879^u&(r^-271733879))+T[2]-1126478375,s=(s<<17|s>>>15)+u<<0,p=(r^s&(u^r))+T[3]-1316259209,p=(p<<22|p>>>10)+s<<0):(r=this.h0,p=this.h1,s=this.h2,u=this.h3,r+=(u^p&(s^u))+T[0]-680876936,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[1]-389564586,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[2]+606105819,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[3]-1044525330,p=(p<<22|p>>>10)+s<<0),r+=(u^p&(s^u))+T[4]-176418897,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[5]+1200080426,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[6]-1473231341,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[7]-45705983,p=(p<<22|p>>>10)+s<<0,r+=(u^p&(s^u))+T[8]+1770035416,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[9]-1958414417,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[10]-42063,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[11]-1990404162,p=(p<<22|p>>>10)+s<<0,r+=(u^p&(s^u))+T[12]+1804603682,r=(r<<7|r>>>25)+p<<0,u+=(s^r&(p^s))+T[13]-40341101,u=(u<<12|u>>>20)+r<<0,s+=(p^u&(r^p))+T[14]-1502002290,s=(s<<17|s>>>15)+u<<0,p+=(r^s&(u^r))+T[15]+1236535329,p=(p<<22|p>>>10)+s<<0,r+=(s^u&(p^s))+T[1]-165796510,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[6]-1069501632,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[11]+643717713,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[0]-373897302,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[5]-701558691,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[10]+38016083,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[15]-660478335,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[4]-405537848,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[9]+568446438,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[14]-1019803690,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[3]-187363961,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[8]+1163531501,p=(p<<20|p>>>12)+s<<0,r+=(s^u&(p^s))+T[13]-1444681467,r=(r<<5|r>>>27)+p<<0,u+=(p^s&(r^p))+T[2]-51403784,u=(u<<9|u>>>23)+r<<0,s+=(r^p&(u^r))+T[7]+1735328473,s=(s<<14|s>>>18)+u<<0,p+=(u^r&(s^u))+T[12]-1926607734,p=(p<<20|p>>>12)+s<<0,x=p^s,r+=(x^u)+T[5]-378558,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[8]-2022574463,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[11]+1839030562,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[14]-35309556,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[1]-1530992060,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[4]+1272893353,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[7]-155497632,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[10]-1094730640,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[13]+681279174,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[0]-358537222,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[3]-722521979,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[6]+76029189,p=(p<<23|p>>>9)+s<<0,x=p^s,r+=(x^u)+T[9]-640364487,r=(r<<4|r>>>28)+p<<0,u+=(x^r)+T[12]-421815835,u=(u<<11|u>>>21)+r<<0,l=u^r,s+=(l^p)+T[15]+530742520,s=(s<<16|s>>>16)+u<<0,p+=(l^s)+T[2]-995338651,p=(p<<23|p>>>9)+s<<0,r+=(s^(p|~u))+T[0]-198630844,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[7]+1126891415,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[14]-1416354905,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[5]-57434055,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[12]+1700485571,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[3]-1894986606,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[10]-1051523,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[1]-2054922799,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[8]+1873313359,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[15]-30611744,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[6]-1560198380,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[13]+1309151649,p=(p<<21|p>>>11)+s<<0,r+=(s^(p|~u))+T[4]-145523070,r=(r<<6|r>>>26)+p<<0,u+=(p^(r|~s))+T[11]-1120210379,u=(u<<10|u>>>22)+r<<0,s+=(r^(u|~p))+T[2]+718787259,s=(s<<15|s>>>17)+u<<0,p+=(u^(s|~r))+T[9]-343485551,p=(p<<21|p>>>11)+s<<0,this.first?(this.h0=r+1732584193<<0,this.h1=p-271733879<<0,this.h2=s-1732584194<<0,this.h3=u+271733878<<0,this.first=!1):(this.h0=this.h0+r<<0,this.h1=this.h1+p<<0,this.h2=this.h2+s<<0,this.h3=this.h3+u<<0)},Md5.prototype.hex=function(){this.finalize();var r=this.h0,p=this.h1,s=this.h2,u=this.h3;return HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[p>>4&15]+HEX_CHARS[p&15]+HEX_CHARS[p>>12&15]+HEX_CHARS[p>>8&15]+HEX_CHARS[p>>20&15]+HEX_CHARS[p>>16&15]+HEX_CHARS[p>>28&15]+HEX_CHARS[p>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[u>>4&15]+HEX_CHARS[u&15]+HEX_CHARS[u>>12&15]+HEX_CHARS[u>>8&15]+HEX_CHARS[u>>20&15]+HEX_CHARS[u>>16&15]+HEX_CHARS[u>>28&15]+HEX_CHARS[u>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(r){if(r==="hex")return this.hex();this.finalize();var p=this.h0,s=this.h1,u=this.h2,x=this.h3,l=[p&255,p>>8&255,p>>16&255,p>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255,u&255,u>>8&255,u>>16&255,u>>24&255,x&255,x>>8&255,x>>16&255,x>>24&255];return l},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var r=new ArrayBuffer(16),p=new Uint32Array(r);return p[0]=this.h0,p[1]=this.h1,p[2]=this.h2,p[3]=this.h3,r},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var r,p,s,u="",x=this.array(),l=0;l<15;)r=x[l++],p=x[l++],s=x[l++],u+=BASE64_ENCODE_CHAR[r>>>2]+BASE64_ENCODE_CHAR[(r<<4|p>>>4)&63]+BASE64_ENCODE_CHAR[(p<<2|s>>>6)&63]+BASE64_ENCODE_CHAR[s&63];return r=x[l],u+=BASE64_ENCODE_CHAR[r>>>2]+BASE64_ENCODE_CHAR[r<<4&63]+"==",u};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(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x=function(I){switch(u(I)){case"string":return I;case"boolean":return I?"true":"false";case"number":return isFinite(I)?I:"";default:return""}},l=function(I,z,q,X){return z=z||"&",q=q||"=",I===null&&(I=void 0),u(I)==="object"?Object.keys(I).map(function(F){var L=encodeURIComponent(x(F))+q;return Array.isArray(I[F])?I[F].map(function($){return L+encodeURIComponent(x($))}).join(z):L+encodeURIComponent(x(I[F]))}).filter(Boolean).join(z):X?encodeURIComponent(x(X))+q+encodeURIComponent(x(I)):""},T=function(I,z,q){var X={};return z.getAllResponseHeaders().trim().split(`
- `).forEach(function(F){if(F){var L=F.indexOf(":"),$=F.substr(0,L).trim().toLowerCase(),Y=F.substr(L+1).trim();X[$]=Y}}),{error:I,statusCode:z.status,statusMessage:z.statusText,headers:X,body:q}},U=function(I,z){return!z&&z==="text"?I.responseText:I.response},K=function(I,z){var q=(I.method||"GET").toUpperCase(),X=I.url;if(I.qs){var F=l(I.qs);F&&(X+=(X.indexOf("?")===-1?"?":"&")+F)}var L=new XMLHttpRequest;if(L.open(q,X,!0),L.responseType=I.dataType||"text",I.xhrFields)for(var $ in I.xhrFields)L[$]=I.xhrFields[$];var Y=I.headers;if(Y)for(var ee in Y)Y.hasOwnProperty(ee)&&ee.toLowerCase()!=="content-length"&&ee.toLowerCase()!=="user-agent"&&ee.toLowerCase()!=="origin"&&ee.toLowerCase()!=="host"&&L.setRequestHeader(ee,Y[ee]);return I.onProgress&&L.upload&&(L.upload.onprogress=I.onProgress),I.onDownloadProgress&&(L.onprogress=I.onDownloadProgress),I.timeout&&(L.timeout=I.timeout),L.ontimeout=function(B){var m=new Error("timeout");z(T(m,L))},L.onload=function(){z(T(null,L,U(L,I.dataType)))},L.onerror=function(B){var m=U(L,I.dataType);if(m)z(T(null,L,m));else{var C=L.statusText;!C&&L.status===0&&(C=new Error("CORS blocked or network error")),z(T(C,L,m))}},L.send(I.body||""),L};r.exports=K},"./lib/xml2json.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/index.js").DOMParser,x=function(){this.version="1.3.5";var T={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},U=new RegExp(/(?!xmlns)^.*:/);return this.grokType=function(K){return/^\s*$/.test(K)?null:/^(?:true|false)$/i.test(K)?K.toLowerCase()==="true":isFinite(K)?parseFloat(K):K},this.parseString=function(K,O){if(K){var I=this.stringToXML(K);return I.getElementsByTagName("parsererror").length?null:this.parseXML(I,O)}else return null},this.parseXML=function(K,O){for(var I in O)T[I]=O[I];var z={},q=0,X="",F=K.childNodes.length;if(F)for(var L,$,Y,ee=0;ee<K.childNodes.length;ee++)L=K.childNodes.item(ee),L.nodeType===4?T.mergeCDATA&&(X+=L.nodeValue):L.nodeType===3?X+=L.nodeValue:L.nodeType===1&&(q===0&&(z={}),T.stripElemPrefix?$=L.nodeName.replace(U,""):$=L.nodeName,Y=x.parseXML(L),z.hasOwnProperty($)?(z[$].constructor!==Array&&(z[$]=[z[$]]),z[$].push(Y)):(z[$]=Y,q++));return Object.keys(z).length||(z=X||""),z},this.xmlToString=function(K){try{var O=K.xml?K.xml:new XMLSerializer().serializeToString(K);return O}catch(I){return null}},this.stringToXML=function(K){try{var O=null;if(window.DOMParser){var I=new u;return O=I.parseFromString(K,"text/xml"),O}else return O=new ActiveXObject("Microsoft.XMLDOM"),O.async=!1,O.loadXML(K),O}catch(z){return null}},this}.call({}),l=function(U){return x.parseString(U)};r.exports=l},"./node_modules/@babel/runtime/helpers/classCallCheck.js":function(r,p){function s(u,x){if(!(u instanceof x))throw new TypeError("Cannot call a class as a function")}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports},"./node_modules/@babel/runtime/helpers/createClass.js":function(r,p){function s(x,l){for(var T=0;T<l.length;T++){var U=l[T];U.enumerable=U.enumerable||!1,U.configurable=!0,"value"in U&&(U.writable=!0),Object.defineProperty(x,U.key,U)}}function u(x,l,T){return l&&s(x.prototype,l),T&&s(x,T),Object.defineProperty(x,"prototype",{writable:!1}),x}r.exports=u,r.exports.__esModule=!0,r.exports.default=r.exports},"./node_modules/@babel/runtime/helpers/typeof.js":function(r,p){function s(u){return r.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},r.exports.__esModule=!0,r.exports.default=r.exports,s(u)}r.exports=s,r.exports.__esModule=!0,r.exports.default=r.exports},"./node_modules/@xmldom/xmldom/lib/conventions.js":function(r,p,s){function u(K,O,I){if(I===void 0&&(I=Array.prototype),K&&typeof I.find=="function")return I.find.call(K,O);for(var z=0;z<K.length;z++)if(Object.prototype.hasOwnProperty.call(K,z)){var q=K[z];if(O.call(void 0,q,z,K))return q}}function x(K,O){return O===void 0&&(O=Object),O&&typeof O.freeze=="function"?O.freeze(K):K}function l(K,O){if(K===null||typeof K!="object")throw new TypeError("target is not an object");for(var I in O)Object.prototype.hasOwnProperty.call(O,I)&&(K[I]=O[I]);return K}var T=x({HTML:"text/html",isHTML:function(K){return K===T.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),U=x({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(K){return K===U.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});p.assign=l,p.find=u,p.freeze=x,p.MIME_TYPE=T,p.NAMESPACE=U},"./node_modules/@xmldom/xmldom/lib/dom-parser.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),x=s("./node_modules/@xmldom/xmldom/lib/dom.js"),l=s("./node_modules/@xmldom/xmldom/lib/entities.js"),T=s("./node_modules/@xmldom/xmldom/lib/sax.js"),U=x.DOMImplementation,K=u.NAMESPACE,O=T.ParseError,I=T.XMLReader;function z(B){return B.replace(/\r[\n\u0085]/g,`
- `).replace(/[\r\u0085\u2028]/g,`
- `)}function q(B){this.options=B||{locator:{}}}q.prototype.parseFromString=function(B,m){var C=this.options,V=new I,y=C.domBuilder||new F,M=C.errorHandler,j=C.locator,w=C.xmlns||{},D=/\/x?html?$/.test(m),A=D?l.HTML_ENTITIES:l.XML_ENTITIES;j&&y.setDocumentLocator(j),V.errorHandler=X(M,y,j),V.domBuilder=C.domBuilder||y,D&&(w[""]=K.HTML),w.xml=w.xml||K.XML;var N=C.normalizeLineEndings||z;return B&&typeof B=="string"?V.parse(N(B),w,A):V.errorHandler.error("invalid doc source"),y.doc};function X(B,m,C){if(!B){if(m instanceof F)return m;B=m}var V={},y=B instanceof Function;C=C||{};function M(j){var w=B[j];!w&&y&&(w=B.length==2?function(D){B(j,D)}:B),V[j]=w&&function(D){w("[xmldom "+j+"] "+D+$(C))}||function(){}}return M("warning"),M("error"),M("fatalError"),V}function F(){this.cdata=!1}function L(B,m){m.lineNumber=B.lineNumber,m.columnNumber=B.columnNumber}F.prototype={startDocument:function(){this.doc=new U().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(B,m,C,V){var y=this.doc,M=y.createElementNS(B,C||m),j=V.length;ee(this,M),this.currentElement=M,this.locator&&L(this.locator,M);for(var w=0;w<j;w++){var B=V.getURI(w),D=V.getValue(w),C=V.getQName(w),A=y.createAttributeNS(B,C);this.locator&&L(V.getLocator(w),A),A.value=A.nodeValue=D,M.setAttributeNode(A)}},endElement:function(B,m,C){var V=this.currentElement;V.tagName,this.currentElement=V.parentNode},startPrefixMapping:function(B,m){},endPrefixMapping:function(B){},processingInstruction:function(B,m){var C=this.doc.createProcessingInstruction(B,m);this.locator&&L(this.locator,C),ee(this,C)},ignorableWhitespace:function(B,m,C){},characters:function(B,m,C){if(B=Y.apply(this,arguments),B){if(this.cdata)var V=this.doc.createCDATASection(B);else var V=this.doc.createTextNode(B);this.currentElement?this.currentElement.appendChild(V):/^\s*$/.test(B)&&this.doc.appendChild(V),this.locator&&L(this.locator,V)}},skippedEntity:function(B){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(B){(this.locator=B)&&(B.lineNumber=0)},comment:function(B,m,C){B=Y.apply(this,arguments);var V=this.doc.createComment(B);this.locator&&L(this.locator,V),ee(this,V)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(B,m,C){var V=this.doc.implementation;if(V&&V.createDocumentType){var y=V.createDocumentType(B,m,C);this.locator&&L(this.locator,y),ee(this,y),this.doc.doctype=y}},warning:function(B){console.warn("[xmldom warning] "+B,$(this.locator))},error:function(B){console.error("[xmldom error] "+B,$(this.locator))},fatalError:function(B){throw new O(B,this.locator)}};function $(B){if(B)return`
- @`+(B.systemId||"")+"#[line:"+B.lineNumber+",col:"+B.columnNumber+"]"}function Y(B,m,C){return typeof B=="string"?B.substr(m,C):B.length>=m+C||m?new java.lang.String(B,m,C)+"":B}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(B){F.prototype[B]=function(){return null}});function ee(B,m){B.currentElement?B.currentElement.appendChild(m):B.doc.appendChild(m)}p.__DOMHandler=F,p.normalizeLineEndings=z,p.DOMParser=q},"./node_modules/@xmldom/xmldom/lib/dom.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js"),x=u.find,l=u.NAMESPACE;function T(c){return c!==""}function U(c){return c?c.split(/[\t\n\f\r ]+/).filter(T):[]}function K(c,h){return c.hasOwnProperty(h)||(c[h]=!0),c}function O(c){if(!c)return[];var h=U(c);return Object.keys(h.reduce(K,{}))}function I(c){return function(h){return c&&c.indexOf(h)!==-1}}function z(c,h){for(var b in c)Object.prototype.hasOwnProperty.call(c,b)&&(h[b]=c[b])}function q(c,h){var b=c.prototype;if(!(b instanceof h)){let H=function(){};H.prototype=h.prototype,H=new H,z(b,H),c.prototype=b=H}b.constructor!=c&&(typeof c!="function"&&console.error("unknown Class:"+c),b.constructor=c)}var X={},F=X.ELEMENT_NODE=1,L=X.ATTRIBUTE_NODE=2,$=X.TEXT_NODE=3,Y=X.CDATA_SECTION_NODE=4,ee=X.ENTITY_REFERENCE_NODE=5,B=X.ENTITY_NODE=6,m=X.PROCESSING_INSTRUCTION_NODE=7,C=X.COMMENT_NODE=8,V=X.DOCUMENT_NODE=9,y=X.DOCUMENT_TYPE_NODE=10,M=X.DOCUMENT_FRAGMENT_NODE=11,j=X.NOTATION_NODE=12,w={},D={};w.INDEX_SIZE_ERR=(D[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(D[2]="DOMString size error",2);var A=w.HIERARCHY_REQUEST_ERR=(D[3]="Hierarchy request error",3);w.WRONG_DOCUMENT_ERR=(D[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(D[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(D[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(D[7]="No modification allowed",7);var N=w.NOT_FOUND_ERR=(D[8]="Not found",8);w.NOT_SUPPORTED_ERR=(D[9]="Not supported",9);var G=w.INUSE_ATTRIBUTE_ERR=(D[10]="Attribute in use",10);w.INVALID_STATE_ERR=(D[11]="Invalid state",11),w.SYNTAX_ERR=(D[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(D[13]="Invalid modification",13),w.NAMESPACE_ERR=(D[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(D[15]="Invalid access",15);function W(c,h){if(h instanceof Error)var b=h;else b=this,Error.call(this,D[c]),this.message=D[c],Error.captureStackTrace&&Error.captureStackTrace(this,W);return b.code=c,h&&(this.message=this.message+": "+h),b}W.prototype=Error.prototype,z(w,W);function Z(){}Z.prototype={length:0,item:function(c){return this[c]||null},toString:function(c,h){for(var b=[],H=0;H<this.length;H++)Ye(this[H],b,c,h);return b.join("")},filter:function(c){return Array.prototype.filter.call(this,c)},indexOf:function(c){return Array.prototype.indexOf.call(this,c)}};function ie(c,h){this._node=c,this._refresh=h,le(this)}function le(c){var h=c._node._inc||c._node.ownerDocument._inc;if(c._inc!=h){var b=c._refresh(c._node);rt(c,"length",b.length),z(b,c),c._inc=h}}ie.prototype.item=function(c){return le(this),this[c]},q(ie,Z);function ae(){}function oe(c,h){for(var b=c.length;b--;)if(c[b]===h)return b}function de(c,h,b,H){if(H?h[oe(h,H)]=b:h[h.length++]=b,c){b.ownerElement=c;var he=c.ownerDocument;he&&(H&&ye(he,c,H),ve(he,c,b))}}function ue(c,h,b){var H=oe(h,b);if(H>=0){for(var he=h.length-1;H<he;)h[H]=h[++H];if(h.length=he,c){var Re=c.ownerDocument;Re&&(ye(Re,c,b),b.ownerElement=null)}}else throw new W(N,new Error(c.tagName+"@"+b))}ae.prototype={length:0,item:Z.prototype.item,getNamedItem:function(c){for(var h=this.length;h--;){var b=this[h];if(b.nodeName==c)return b}},setNamedItem:function(c){var h=c.ownerElement;if(h&&h!=this._ownerElement)throw new W(G);var b=this.getNamedItem(c.nodeName);return de(this._ownerElement,this,c,b),b},setNamedItemNS:function(c){var h=c.ownerElement,b;if(h&&h!=this._ownerElement)throw new W(G);return b=this.getNamedItemNS(c.namespaceURI,c.localName),de(this._ownerElement,this,c,b),b},removeNamedItem:function(c){var h=this.getNamedItem(c);return ue(this._ownerElement,this,h),h},removeNamedItemNS:function(c,h){var b=this.getNamedItemNS(c,h);return ue(this._ownerElement,this,b),b},getNamedItemNS:function(c,h){for(var b=this.length;b--;){var H=this[b];if(H.localName==h&&H.namespaceURI==c)return H}return null}};function me(){}me.prototype={hasFeature:function(c,h){return!0},createDocument:function(c,h,b){var H=new Ce;if(H.implementation=this,H.childNodes=new Z,H.doctype=b||null,b&&H.appendChild(b),h){var he=H.createElementNS(c,h);H.appendChild(he)}return H},createDocumentType:function(c,h,b){var H=new Te;return H.name=c,H.nodeName=c,H.publicId=h||"",H.systemId=b||"",H}};function te(){}te.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(c,h){return a(this,c,h)},replaceChild:function(c,h){a(this,c,h,o),h&&this.removeChild(h)},removeChild:function(c){return xe(this,c)},appendChild:function(c){return this.insertBefore(c,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(c){return tt(this.ownerDocument||this,this,c)},normalize:function(){for(var c=this.firstChild;c;){var h=c.nextSibling;h&&h.nodeType==$&&c.nodeType==$?(this.removeChild(h),c.appendData(h.data)):(c.normalize(),c=h)}},isSupported:function(c,h){return this.ownerDocument.implementation.hasFeature(c,h)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(c){for(var h=this;h;){var b=h._nsMap;if(b){for(var H in b)if(Object.prototype.hasOwnProperty.call(b,H)&&b[H]===c)return H}h=h.nodeType==L?h.ownerDocument:h.parentNode}return null},lookupNamespaceURI:function(c){for(var h=this;h;){var b=h._nsMap;if(b&&Object.prototype.hasOwnProperty.call(b,c))return b[c];h=h.nodeType==L?h.ownerDocument:h.parentNode}return null},isDefaultNamespace:function(c){var h=this.lookupPrefix(c);return h==null}};function re(c){return c=="<"&&"<"||c==">"&&">"||c=="&"&&"&"||c=='"'&&"""||"&#"+c.charCodeAt()+";"}z(X,te),z(X,te.prototype);function pe(c,h){if(h(c))return!0;if(c=c.firstChild)do if(pe(c,h))return!0;while(c=c.nextSibling)}function Ce(){this.ownerDocument=this}function ve(c,h,b){c&&c._inc++;var H=b.namespaceURI;H===l.XMLNS&&(h._nsMap[b.prefix?b.localName:""]=b.value)}function ye(c,h,b,H){c&&c._inc++;var he=b.namespaceURI;he===l.XMLNS&&delete h._nsMap[b.prefix?b.localName:""]}function Se(c,h,b){if(c&&c._inc){c._inc++;var H=h.childNodes;if(b)H[H.length++]=b;else{for(var he=h.firstChild,Re=0;he;)H[Re++]=he,he=he.nextSibling;H.length=Re,delete H[H.length]}}}function xe(c,h){var b=h.previousSibling,H=h.nextSibling;return b?b.nextSibling=H:c.firstChild=H,H?H.previousSibling=b:c.lastChild=b,h.parentNode=null,h.previousSibling=null,h.nextSibling=null,Se(c.ownerDocument,c),h}function Ee(c){return c&&(c.nodeType===te.DOCUMENT_NODE||c.nodeType===te.DOCUMENT_FRAGMENT_NODE||c.nodeType===te.ELEMENT_NODE)}function Ie(c){return c&&(_e(c)||je(c)||we(c)||c.nodeType===te.DOCUMENT_FRAGMENT_NODE||c.nodeType===te.COMMENT_NODE||c.nodeType===te.PROCESSING_INSTRUCTION_NODE)}function we(c){return c&&c.nodeType===te.DOCUMENT_TYPE_NODE}function _e(c){return c&&c.nodeType===te.ELEMENT_NODE}function je(c){return c&&c.nodeType===te.TEXT_NODE}function Ue(c,h){var b=c.childNodes||[];if(x(b,_e)||we(h))return!1;var H=x(b,we);return!(h&&H&&b.indexOf(H)>b.indexOf(h))}function se(c,h){var b=c.childNodes||[];function H(Re){return _e(Re)&&Re!==h}if(x(b,H))return!1;var he=x(b,we);return!(h&&he&&b.indexOf(he)>b.indexOf(h))}function d(c,h,b){if(!Ee(c))throw new W(A,"Unexpected parent node type "+c.nodeType);if(b&&b.parentNode!==c)throw new W(N,"child not in parent");if(!Ie(h)||we(h)&&c.nodeType!==te.DOCUMENT_NODE)throw new W(A,"Unexpected node type "+h.nodeType+" for parent node type "+c.nodeType)}function i(c,h,b){var H=c.childNodes||[],he=h.childNodes||[];if(h.nodeType===te.DOCUMENT_FRAGMENT_NODE){var Re=he.filter(_e);if(Re.length>1||x(he,je))throw new W(A,"More than one element or text in fragment");if(Re.length===1&&!Ue(c,b))throw new W(A,"Element in fragment can not be inserted before doctype")}if(_e(h)&&!Ue(c,b))throw new W(A,"Only one element can be added and only after doctype");if(we(h)){if(x(H,we))throw new W(A,"Only one doctype is allowed");var Me=x(H,_e);if(b&&H.indexOf(Me)<H.indexOf(b))throw new W(A,"Doctype can only be inserted before an element");if(!b&&Me)throw new W(A,"Doctype can not be appended since element is present")}}function o(c,h,b){var H=c.childNodes||[],he=h.childNodes||[];if(h.nodeType===te.DOCUMENT_FRAGMENT_NODE){var Re=he.filter(_e);if(Re.length>1||x(he,je))throw new W(A,"More than one element or text in fragment");if(Re.length===1&&!se(c,b))throw new W(A,"Element in fragment can not be inserted before doctype")}if(_e(h)&&!se(c,b))throw new W(A,"Only one element can be added and only after doctype");if(we(h)){if(x(H,function(Je){return we(Je)&&Je!==b}))throw new W(A,"Only one doctype is allowed");var Me=x(H,_e);if(b&&H.indexOf(Me)<H.indexOf(b))throw new W(A,"Doctype can only be inserted before an element")}}function a(c,h,b,H){d(c,h,b),c.nodeType===te.DOCUMENT_NODE&&(H||i)(c,h,b);var he=h.parentNode;if(he&&he.removeChild(h),h.nodeType===M){var Re=h.firstChild;if(Re==null)return h;var Me=h.lastChild}else Re=Me=h;var ce=b?b.previousSibling:c.lastChild;Re.previousSibling=ce,Me.nextSibling=b,ce?ce.nextSibling=Re:c.firstChild=Re,b==null?c.lastChild=Me:b.previousSibling=Me;do Re.parentNode=c;while(Re!==Me&&(Re=Re.nextSibling));return Se(c.ownerDocument||c,c),h.nodeType==M&&(h.firstChild=h.lastChild=null),h}function v(c,h){return h.parentNode&&h.parentNode.removeChild(h),h.parentNode=c,h.previousSibling=c.lastChild,h.nextSibling=null,h.previousSibling?h.previousSibling.nextSibling=h:c.firstChild=h,c.lastChild=h,Se(c.ownerDocument,c,h),h}Ce.prototype={nodeName:"#document",nodeType:V,doctype:null,documentElement:null,_inc:1,insertBefore:function(c,h){if(c.nodeType==M){for(var b=c.firstChild;b;){var H=b.nextSibling;this.insertBefore(b,h),b=H}return c}return a(this,c,h),c.ownerDocument=this,this.documentElement===null&&c.nodeType===F&&(this.documentElement=c),c},removeChild:function(c){return this.documentElement==c&&(this.documentElement=null),xe(this,c)},replaceChild:function(c,h){a(this,c,h,o),c.ownerDocument=this,h&&this.removeChild(h),_e(c)&&(this.documentElement=c)},importNode:function(c,h){return ot(this,c,h)},getElementById:function(c){var h=null;return pe(this.documentElement,function(b){if(b.nodeType==F&&b.getAttribute("id")==c)return h=b,!0}),h},getElementsByClassName:function(c){var h=O(c);return new ie(this,function(b){var H=[];return h.length>0&&pe(b.documentElement,function(he){if(he!==b&&he.nodeType===F){var Re=he.getAttribute("class");if(Re){var Me=c===Re;if(!Me){var ce=O(Re);Me=h.every(I(ce))}Me&&H.push(he)}}}),H})},createElement:function(c){var h=new R;h.ownerDocument=this,h.nodeName=c,h.tagName=c,h.localName=c,h.childNodes=new Z;var b=h.attributes=new ae;return b._ownerElement=h,h},createDocumentFragment:function(){var c=new Le;return c.ownerDocument=this,c.childNodes=new Z,c},createTextNode:function(c){var h=new fe;return h.ownerDocument=this,h.appendData(c),h},createComment:function(c){var h=new ge;return h.ownerDocument=this,h.appendData(c),h},createCDATASection:function(c){var h=new Q;return h.ownerDocument=this,h.appendData(c),h},createProcessingInstruction:function(c,h){var b=new Ve;return b.ownerDocument=this,b.tagName=b.target=c,b.nodeValue=b.data=h,b},createAttribute:function(c){var h=new P;return h.ownerDocument=this,h.name=c,h.nodeName=c,h.localName=c,h.specified=!0,h},createEntityReference:function(c){var h=new Be;return h.ownerDocument=this,h.nodeName=c,h},createElementNS:function(c,h){var b=new R,H=h.split(":"),he=b.attributes=new ae;return b.childNodes=new Z,b.ownerDocument=this,b.nodeName=h,b.tagName=h,b.namespaceURI=c,H.length==2?(b.prefix=H[0],b.localName=H[1]):b.localName=h,he._ownerElement=b,b},createAttributeNS:function(c,h){var b=new P,H=h.split(":");return b.ownerDocument=this,b.nodeName=h,b.name=h,b.namespaceURI=c,b.specified=!0,H.length==2?(b.prefix=H[0],b.localName=H[1]):b.localName=h,b}},q(Ce,te);function R(){this._nsMap={}}R.prototype={nodeType:F,hasAttribute:function(c){return this.getAttributeNode(c)!=null},getAttribute:function(c){var h=this.getAttributeNode(c);return h&&h.value||""},getAttributeNode:function(c){return this.attributes.getNamedItem(c)},setAttribute:function(c,h){var b=this.ownerDocument.createAttribute(c);b.value=b.nodeValue=""+h,this.setAttributeNode(b)},removeAttribute:function(c){var h=this.getAttributeNode(c);h&&this.removeAttributeNode(h)},appendChild:function(c){return c.nodeType===M?this.insertBefore(c,null):v(this,c)},setAttributeNode:function(c){return this.attributes.setNamedItem(c)},setAttributeNodeNS:function(c){return this.attributes.setNamedItemNS(c)},removeAttributeNode:function(c){return this.attributes.removeNamedItem(c.nodeName)},removeAttributeNS:function(c,h){var b=this.getAttributeNodeNS(c,h);b&&this.removeAttributeNode(b)},hasAttributeNS:function(c,h){return this.getAttributeNodeNS(c,h)!=null},getAttributeNS:function(c,h){var b=this.getAttributeNodeNS(c,h);return b&&b.value||""},setAttributeNS:function(c,h,b){var H=this.ownerDocument.createAttributeNS(c,h);H.value=H.nodeValue=""+b,this.setAttributeNode(H)},getAttributeNodeNS:function(c,h){return this.attributes.getNamedItemNS(c,h)},getElementsByTagName:function(c){return new ie(this,function(h){var b=[];return pe(h,function(H){H!==h&&H.nodeType==F&&(c==="*"||H.tagName==c)&&b.push(H)}),b})},getElementsByTagNameNS:function(c,h){return new ie(this,function(b){var H=[];return pe(b,function(he){he!==b&&he.nodeType===F&&(c==="*"||he.namespaceURI===c)&&(h==="*"||he.localName==h)&&H.push(he)}),H})}},Ce.prototype.getElementsByTagName=R.prototype.getElementsByTagName,Ce.prototype.getElementsByTagNameNS=R.prototype.getElementsByTagNameNS,q(R,te);function P(){}P.prototype.nodeType=L,q(P,te);function J(){}J.prototype={data:"",substringData:function(c,h){return this.data.substring(c,c+h)},appendData:function(c){c=this.data+c,this.nodeValue=this.data=c,this.length=c.length},insertData:function(c,h){this.replaceData(c,0,h)},appendChild:function(c){throw new Error(D[A])},deleteData:function(c,h){this.replaceData(c,h,"")},replaceData:function(c,h,b){var H=this.data.substring(0,c),he=this.data.substring(c+h);b=H+b+he,this.nodeValue=this.data=b,this.length=b.length}},q(J,te);function fe(){}fe.prototype={nodeName:"#text",nodeType:$,splitText:function(c){var h=this.data,b=h.substring(c);h=h.substring(0,c),this.data=this.nodeValue=h,this.length=h.length;var H=this.ownerDocument.createTextNode(b);return this.parentNode&&this.parentNode.insertBefore(H,this.nextSibling),H}},q(fe,J);function ge(){}ge.prototype={nodeName:"#comment",nodeType:C},q(ge,J);function Q(){}Q.prototype={nodeName:"#cdata-section",nodeType:Y},q(Q,J);function Te(){}Te.prototype.nodeType=y,q(Te,te);function Ne(){}Ne.prototype.nodeType=j,q(Ne,te);function Fe(){}Fe.prototype.nodeType=B,q(Fe,te);function Be(){}Be.prototype.nodeType=ee,q(Be,te);function Le(){}Le.prototype.nodeName="#document-fragment",Le.prototype.nodeType=M,q(Le,te);function Ve(){}Ve.prototype.nodeType=m,q(Ve,te);function Ge(){}Ge.prototype.serializeToString=function(c,h,b){return We.call(c,h,b)},te.prototype.toString=We;function We(c,h){var b=[],H=this.nodeType==9&&this.documentElement||this,he=H.prefix,Re=H.namespaceURI;if(Re&&he==null){var he=H.lookupPrefix(Re);if(he==null)var Me=[{namespace:Re,prefix:null}]}return Ye(this,b,c,h,Me),b.join("")}function qe(c,h,b){var H=c.prefix||"",he=c.namespaceURI;if(!he||H==="xml"&&he===l.XML||he===l.XMLNS)return!1;for(var Re=b.length;Re--;){var Me=b[Re];if(Me.prefix===H)return Me.namespace!==he}return!0}function Xe(c,h,b){c.push(" ",h,'="',b.replace(/[<>&"\t\n\r]/g,re),'"')}function Ye(c,h,b,H,he){if(he||(he=[]),H)if(c=H(c),c){if(typeof c=="string"){h.push(c);return}}else return;switch(c.nodeType){case F:var Re=c.attributes,Me=Re.length,E=c.firstChild,ce=c.tagName;b=l.isHTML(c.namespaceURI)||b;var Je=ce;if(!b&&!c.prefix&&c.namespaceURI){for(var Qe,Ze=0;Ze<Re.length;Ze++)if(Re.item(Ze).name==="xmlns"){Qe=Re.item(Ze).value;break}if(!Qe)for(var e=he.length-1;e>=0;e--){var g=he[e];if(g.prefix===""&&g.namespace===c.namespaceURI){Qe=g.namespace;break}}if(Qe!==c.namespaceURI)for(var e=he.length-1;e>=0;e--){var g=he[e];if(g.namespace===c.namespaceURI){g.prefix&&(Je=g.prefix+":"+ce);break}}}h.push("<",Je);for(var n=0;n<Me;n++){var f=Re.item(n);f.prefix=="xmlns"?he.push({prefix:f.localName,namespace:f.value}):f.nodeName=="xmlns"&&he.push({prefix:"",namespace:f.value})}for(var n=0;n<Me;n++){var f=Re.item(n);if(qe(f,b,he)){var k=f.prefix||"",S=f.namespaceURI;Xe(h,k?"xmlns:"+k:"xmlns",S),he.push({prefix:k,namespace:S})}Ye(f,h,b,H,he)}if(ce===Je&&qe(c,b,he)){var k=c.prefix||"",S=c.namespaceURI;Xe(h,k?"xmlns:"+k:"xmlns",S),he.push({prefix:k,namespace:S})}if(E||b&&!/^(?:meta|link|img|br|hr|input)$/i.test(ce)){if(h.push(">"),b&&/^script$/i.test(ce))for(;E;)E.data?h.push(E.data):Ye(E,h,b,H,he.slice()),E=E.nextSibling;else for(;E;)Ye(E,h,b,H,he.slice()),E=E.nextSibling;h.push("</",Je,">")}else h.push("/>");return;case V:case M:for(var E=c.firstChild;E;)Ye(E,h,b,H,he.slice()),E=E.nextSibling;return;case L:return Xe(h,c.name,c.value);case $:return h.push(c.data.replace(/[<&>]/g,re));case Y:return h.push("<![CDATA[",c.data,"]]>");case C:return h.push("<!--",c.data,"-->");case y:var _=c.publicId,ne=c.systemId;if(h.push("<!DOCTYPE ",c.name),_)h.push(" PUBLIC ",_),ne&&ne!="."&&h.push(" ",ne),h.push(">");else if(ne&&ne!=".")h.push(" SYSTEM ",ne,">");else{var Oe=c.internalSubset;Oe&&h.push(" [",Oe,"]"),h.push(">")}return;case m:return h.push("<?",c.target," ",c.data,"?>");case ee:return h.push("&",c.nodeName,";");default:h.push("??",c.nodeName)}}function ot(c,h,b){var H;switch(h.nodeType){case F:H=h.cloneNode(!1),H.ownerDocument=c;case M:break;case L:b=!0;break}if(H||(H=h.cloneNode(!1)),H.ownerDocument=c,H.parentNode=null,b)for(var he=h.firstChild;he;)H.appendChild(ot(c,he,b)),he=he.nextSibling;return H}function tt(c,h,b){var H=new h.constructor;for(var he in h)if(Object.prototype.hasOwnProperty.call(h,he)){var Re=h[he];typeof Re!="object"&&Re!=H[he]&&(H[he]=Re)}switch(h.childNodes&&(H.childNodes=new Z),H.ownerDocument=c,H.nodeType){case F:var Me=h.attributes,ce=H.attributes=new ae,Je=Me.length;ce._ownerElement=H;for(var Qe=0;Qe<Je;Qe++)H.setAttributeNode(tt(c,Me.item(Qe),!0));break;case L:b=!0}if(b)for(var Ze=h.firstChild;Ze;)H.appendChild(tt(c,Ze,b)),Ze=Ze.nextSibling;return H}function rt(c,h,b){c[h]=b}try{if(Object.defineProperty){let c=function(h){switch(h.nodeType){case F:case M:var b=[];for(h=h.firstChild;h;)h.nodeType!==7&&h.nodeType!==8&&b.push(c(h)),h=h.nextSibling;return b.join("");default:return h.nodeValue}};Object.defineProperty(ie.prototype,"length",{get:function(){return le(this),this.$$length}}),Object.defineProperty(te.prototype,"textContent",{get:function(){return c(this)},set:function(h){switch(this.nodeType){case F:case M:for(;this.firstChild;)this.removeChild(this.firstChild);(h||String(h))&&this.appendChild(this.ownerDocument.createTextNode(h));break;default:this.data=h,this.value=h,this.nodeValue=h}}}),rt=function(h,b,H){h["$$"+b]=H}}}catch(c){}p.DocumentType=Te,p.DOMException=W,p.DOMImplementation=me,p.Element=R,p.Node=te,p.NodeList=Z,p.XMLSerializer=Ge},"./node_modules/@xmldom/xmldom/lib/entities.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js").freeze;p.XML_ENTITIES=u({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),p.HTML_ENTITIES=u({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}),p.entityMap=p.HTML_ENTITIES},"./node_modules/@xmldom/xmldom/lib/index.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/dom.js");p.DOMImplementation=u.DOMImplementation,p.XMLSerializer=u.XMLSerializer,p.DOMParser=s("./node_modules/@xmldom/xmldom/lib/dom-parser.js").DOMParser},"./node_modules/@xmldom/xmldom/lib/sax.js":function(r,p,s){var u=s("./node_modules/@xmldom/xmldom/lib/conventions.js").NAMESPACE,x=/[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]/,l=new RegExp("[\\-\\.0-9"+x.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),T=new RegExp("^"+x.source+l.source+"*(?::"+x.source+l.source+"*)?$"),U=0,K=1,O=2,I=3,z=4,q=5,X=6,F=7;function L(A,N){this.message=A,this.locator=N,Error.captureStackTrace&&Error.captureStackTrace(this,L)}L.prototype=new Error,L.prototype.name=L.name;function $(){}$.prototype={parse:function(A,N,G){var W=this.domBuilder;W.startDocument(),y(N,N={}),Y(A,N,G,W,this.errorHandler),W.endDocument()}};function Y(A,N,G,W,Z){function ie(R){if(R>65535){R-=65536;var P=55296+(R>>10),J=56320+(R&1023);return String.fromCharCode(P,J)}else return String.fromCharCode(R)}function le(R){var P=R.slice(1,-1);return Object.hasOwnProperty.call(G,P)?G[P]:P.charAt(0)==="#"?ie(parseInt(P.substr(1).replace("x","0x"))):(Z.error("entity not found:"+R),R)}function ae(R){if(R>Ce){var P=A.substring(Ce,R).replace(/&#?\w+;/g,le);te&&oe(Ce),W.characters(P,0,R-Ce),Ce=R}}function oe(R,P){for(;R>=ue&&(P=me.exec(A));)de=P.index,ue=de+P[0].length,te.lineNumber++;te.columnNumber=R-de+1}for(var de=0,ue=0,me=/.*(?:\r\n?|\n)|.*$/g,te=W.locator,re=[{currentNSMap:N}],pe={},Ce=0;;){try{var ve=A.indexOf("<",Ce);if(ve<0){if(!A.substr(Ce).match(/^\s*$/)){var ye=W.doc,Se=ye.createTextNode(A.substr(Ce));ye.appendChild(Se),W.currentElement=Se}return}switch(ve>Ce&&ae(ve),A.charAt(ve+1)){case"/":var d=A.indexOf(">",ve+3),xe=A.substring(ve+2,d).replace(/[ \t\n\r]+$/g,""),Ee=re.pop();d<0?(xe=A.substring(ve+2).replace(/[\s<].*/,""),Z.error("end tag name: "+xe+" is not complete:"+Ee.tagName),d=ve+1+xe.length):xe.match(/\s</)&&(xe=xe.replace(/[\s<].*/,""),Z.error("end tag name: "+xe+" maybe not complete"),d=ve+1+xe.length);var Ie=Ee.localNSMap,we=Ee.tagName==xe,_e=we||Ee.tagName&&Ee.tagName.toLowerCase()==xe.toLowerCase();if(_e){if(W.endElement(Ee.uri,Ee.localName,xe),Ie)for(var je in Ie)Object.prototype.hasOwnProperty.call(Ie,je)&&W.endPrefixMapping(je);we||Z.fatalError("end tag name: "+xe+" is not match the current start tagName:"+Ee.tagName)}else re.push(Ee);d++;break;case"?":te&&oe(ve),d=j(A,ve,W);break;case"!":te&&oe(ve),d=M(A,ve,W,Z);break;default:te&&oe(ve);var Ue=new w,se=re[re.length-1].currentNSMap,d=B(A,ve,Ue,se,le,Z),i=Ue.length;if(!Ue.closed&&V(A,d,Ue.tagName,pe)&&(Ue.closed=!0,G.nbsp||Z.warning("unclosed xml attribute")),te&&i){for(var o=ee(te,{}),a=0;a<i;a++){var v=Ue[a];oe(v.offset),v.locator=ee(te,{})}W.locator=o,m(Ue,W,se)&&re.push(Ue),W.locator=te}else m(Ue,W,se)&&re.push(Ue);u.isHTML(Ue.uri)&&!Ue.closed?d=C(A,d,Ue.tagName,le,W):d++}}catch(R){if(R instanceof L)throw R;Z.error("element parse error: "+R),d=-1}d>Ce?Ce=d:ae(Math.max(ve,Ce)+1)}}function ee(A,N){return N.lineNumber=A.lineNumber,N.columnNumber=A.columnNumber,N}function B(A,N,G,W,Z,ie){function le(te,re,pe){G.attributeNames.hasOwnProperty(te)&&ie.fatalError("Attribute "+te+" redefined"),G.addValue(te,re.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,Z),pe)}for(var ae,oe,de=++N,ue=U;;){var me=A.charAt(de);switch(me){case"=":if(ue===K)ae=A.slice(N,de),ue=I;else if(ue===O)ue=I;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(ue===I||ue===K)if(ue===K&&(ie.warning('attribute value must after "="'),ae=A.slice(N,de)),N=de+1,de=A.indexOf(me,N),de>0)oe=A.slice(N,de),le(ae,oe,N-1),ue=q;else throw new Error("attribute value no end '"+me+"' match");else if(ue==z)oe=A.slice(N,de),le(ae,oe,N),ie.warning('attribute "'+ae+'" missed start quot('+me+")!!"),N=de+1,ue=q;else throw new Error('attribute value must after "="');break;case"/":switch(ue){case U:G.setTagName(A.slice(N,de));case q:case X:case F:ue=F,G.closed=!0;case z:case K:case O:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ie.error("unexpected end of input"),ue==U&&G.setTagName(A.slice(N,de)),de;case">":switch(ue){case U:G.setTagName(A.slice(N,de));case q:case X:case F:break;case z:case K:oe=A.slice(N,de),oe.slice(-1)==="/"&&(G.closed=!0,oe=oe.slice(0,-1));case O:ue===O&&(oe=ae),ue==z?(ie.warning('attribute "'+oe+'" missed quot(")!'),le(ae,oe,N)):((!u.isHTML(W[""])||!oe.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+oe+'" missed value!! "'+oe+'" instead!!'),le(oe,oe,N));break;case I:throw new Error("attribute value missed!!")}return de;case"":me=" ";default:if(me<=" ")switch(ue){case U:G.setTagName(A.slice(N,de)),ue=X;break;case K:ae=A.slice(N,de),ue=O;break;case z:var oe=A.slice(N,de);ie.warning('attribute "'+oe+'" missed quot(")!!'),le(ae,oe,N);case q:ue=X;break}else switch(ue){case O:G.tagName,(!u.isHTML(W[""])||!ae.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+ae+'" missed value!! "'+ae+'" instead2!!'),le(ae,ae,N),N=de,ue=K;break;case q:ie.warning('attribute space is required"'+ae+'"!!');case X:ue=K,N=de;break;case I:ue=z,N=de;break;case F:throw new Error("elements closed character '/' and '>' must be connected to")}}de++}}function m(A,N,G){for(var W=A.tagName,Z=null,me=A.length;me--;){var ie=A[me],le=ie.qName,ae=ie.value,te=le.indexOf(":");if(te>0)var oe=ie.prefix=le.slice(0,te),de=le.slice(te+1),ue=oe==="xmlns"&&de;else de=le,oe=null,ue=le==="xmlns"&&"";ie.localName=de,ue!==!1&&(Z==null&&(Z={},y(G,G={})),G[ue]=Z[ue]=ae,ie.uri=u.XMLNS,N.startPrefixMapping(ue,ae))}for(var me=A.length;me--;){ie=A[me];var oe=ie.prefix;oe&&(oe==="xml"&&(ie.uri=u.XML),oe!=="xmlns"&&(ie.uri=G[oe||""]))}var te=W.indexOf(":");te>0?(oe=A.prefix=W.slice(0,te),de=A.localName=W.slice(te+1)):(oe=null,de=A.localName=W);var re=A.uri=G[oe||""];if(N.startElement(re,de,W,A),A.closed){if(N.endElement(re,de,W),Z)for(oe in Z)Object.prototype.hasOwnProperty.call(Z,oe)&&N.endPrefixMapping(oe)}else return A.currentNSMap=G,A.localNSMap=Z,!0}function C(A,N,G,W,Z){if(/^(?:script|textarea)$/i.test(G)){var ie=A.indexOf("</"+G+">",N),le=A.substring(N+1,ie);if(/[&<]/.test(le))return/^script$/i.test(G)?(Z.characters(le,0,le.length),ie):(le=le.replace(/&#?\w+;/g,W),Z.characters(le,0,le.length),ie)}return N+1}function V(A,N,G,W){var Z=W[G];return Z==null&&(Z=A.lastIndexOf("</"+G+">"),Z<N&&(Z=A.lastIndexOf("</"+G)),W[G]=Z),Z<N}function y(A,N){for(var G in A)Object.prototype.hasOwnProperty.call(A,G)&&(N[G]=A[G])}function M(A,N,G,W){var Z=A.charAt(N+2);switch(Z){case"-":if(A.charAt(N+3)==="-"){var ie=A.indexOf("-->",N+4);return ie>N?(G.comment(A,N+4,ie-N-4),ie+3):(W.error("Unclosed comment"),-1)}else return-1;default:if(A.substr(N+3,6)=="CDATA["){var ie=A.indexOf("]]>",N+9);return G.startCDATA(),G.characters(A,N+9,ie-N-9),G.endCDATA(),ie+3}var le=D(A,N),ae=le.length;if(ae>1&&/!doctype/i.test(le[0][0])){var oe=le[1][0],de=!1,ue=!1;ae>3&&(/^public$/i.test(le[2][0])?(de=le[3][0],ue=ae>4&&le[4][0]):/^system$/i.test(le[2][0])&&(ue=le[3][0]));var me=le[ae-1];return G.startDTD(oe,de,ue),G.endDTD(),me.index+me[0].length}}return-1}function j(A,N,G){var W=A.indexOf("?>",N);if(W){var Z=A.substring(N,W).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return Z?(Z[0].length,G.processingInstruction(Z[1],Z[2]),W+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(A){if(!T.test(A))throw new Error("invalid tagName:"+A);this.tagName=A},addValue:function(A,N,G){if(!T.test(A))throw new Error("invalid attribute:"+A);this.attributeNames[A]=this.length,this[this.length++]={qName:A,value:N,offset:G}},length:0,getLocalName:function(A){return this[A].localName},getLocator:function(A){return this[A].locator},getQName:function(A){return this[A].qName},getURI:function(A){return this[A].uri},getValue:function(A){return this[A].value}};function D(A,N){var G,W=[],Z=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(Z.lastIndex=N,Z.exec(A);G=Z.exec(A);)if(W.push(G),G[1])return W}p.XMLReader=$,p.ParseError=L},"./node_modules/process/browser.js":function(r,p){var s=r.exports={},u,x;function l(){throw new Error("setTimeout has not been defined")}function T(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?u=setTimeout:u=l}catch(Y){u=l}try{typeof clearTimeout=="function"?x=clearTimeout:x=T}catch(Y){x=T}})();function U(Y){if(u===setTimeout)return setTimeout(Y,0);if((u===l||!u)&&setTimeout)return u=setTimeout,setTimeout(Y,0);try{return u(Y,0)}catch(ee){try{return u.call(null,Y,0)}catch(B){return u.call(this,Y,0)}}}function K(Y){if(x===clearTimeout)return clearTimeout(Y);if((x===T||!x)&&clearTimeout)return x=clearTimeout,clearTimeout(Y);try{return x(Y)}catch(ee){try{return x.call(null,Y)}catch(B){return x.call(this,Y)}}}var O=[],I=!1,z,q=-1;function X(){!I||!z||(I=!1,z.length?O=z.concat(O):q=-1,O.length&&F())}function F(){if(!I){var Y=U(X);I=!0;for(var ee=O.length;ee;){for(z=O,O=[];++q<ee;)z&&z[q].run();q=-1,ee=O.length}z=null,I=!1,K(Y)}}s.nextTick=function(Y){var ee=new Array(arguments.length-1);if(arguments.length>1)for(var B=1;B<arguments.length;B++)ee[B-1]=arguments[B];O.push(new L(Y,ee)),O.length===1&&!I&&U(F)};function L(Y,ee){this.fun=Y,this.array=ee}L.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function $(){}s.on=$,s.addListener=$,s.once=$,s.off=$,s.removeListener=$,s.removeAllListeners=$,s.emit=$,s.prependListener=$,s.prependOnceListener=$,s.listeners=function(Y){return[]},s.binding=function(Y){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(Y){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},"./node_modules/webpack/buildin/amd-options.js":function(r,p){(function(s){r.exports=s}).call(this,{})},"./node_modules/webpack/buildin/global.js":function(r,p){var s;s=function(){return this}();try{s=s||new Function("return this")()}catch(u){typeof window=="object"&&(s=window)}r.exports=s},"./node_modules/webpack/buildin/module.js":function(r,p){r.exports=function(s){return s.webpackPolyfill||(s.deprecate=function(){},s.paths=[],s.children||(s.children=[]),Object.defineProperty(s,"loaded",{enumerable:!0,get:function(){return s.l}}),Object.defineProperty(s,"id",{enumerable:!0,get:function(){return s.i}}),s.webpackPolyfill=1),s}},"./package.json":function(r){r.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.4.20","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js test/test.js server/sts.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"@xmldom/xmldom":"^0.8.6"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},"./src/advance.js":function(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x=s("./src/session.js"),l=s("./src/async.js"),T=s("./src/event.js").EventProxy,U=s("./src/util.js"),K=s("./src/tracker.js");function O(y,M){var j=this,w=new T,D=y.TaskId,A=y.Bucket,N=y.Region,G=y.Key,W=y.Body,Z=y.ChunkSize||y.SliceSize||j.options.ChunkSize,ie=y.AsyncLimit,le=y.StorageClass,ae=y.ServerSideEncryption,oe,de,ue=y.onHashProgress,me=y.tracker;me&&me.setParams({chunkSize:Z}),w.on("error",function(te){if(j._isRunningTask(D))return te.UploadId=y.UploadData.UploadId||"",M(te)}),w.on("upload_complete",function(te){var re=U.extend({UploadId:y.UploadData.UploadId||""},te);M(null,re)}),w.on("upload_slice_complete",function(te){var re={};U.each(y.Headers,function(pe,Ce){var ve=Ce.toLowerCase();(ve.indexOf("x-cos-meta-")===0||ve==="pic-operations")&&(re[Ce]=pe)}),L.call(j,{Bucket:A,Region:N,Key:G,UploadId:te.UploadId,SliceList:te.SliceList,Headers:re,tracker:me},function(pe,Ce){if(j._isRunningTask(D)){if(x.removeUsing(te.UploadId),pe)return de(null,!0),w.emit("error",pe);x.removeUploadId.call(j,te.UploadId),de({loaded:oe,total:oe},!0),w.emit("upload_complete",Ce)}})}),w.on("get_upload_data_finish",function(te){var re=x.getFileId(W,y.ChunkSize,A,G);re&&x.saveUploadId.call(j,re,te.UploadId,j.options.UploadIdCacheLimit),x.setUsing(te.UploadId),de(null,!0),X.call(j,{TaskId:D,Bucket:A,Region:N,Key:G,Body:W,FileSize:oe,SliceSize:Z,AsyncLimit:ie,ServerSideEncryption:ae,UploadData:te,Headers:y.Headers,onProgress:de,tracker:me},function(pe,Ce){if(j._isRunningTask(D)){if(pe)return de(null,!0),w.emit("error",pe);w.emit("upload_slice_complete",Ce)}})}),w.on("get_file_size_finish",function(){if(de=U.throttleOnProgress.call(j,oe,y.onProgress),y.UploadData.UploadId)w.emit("get_upload_data_finish",y.UploadData);else{var te=U.extend({TaskId:D,Bucket:A,Region:N,Key:G,Headers:y.Headers,StorageClass:le,Body:W,FileSize:oe,SliceSize:Z,onHashProgress:ue,tracker:me},y);I.call(j,te,function(re,pe){if(j._isRunningTask(D)){if(re)return w.emit("error",re);y.UploadData.UploadId=pe.UploadId,y.UploadData.PartList=pe.PartList,w.emit("get_upload_data_finish",y.UploadData)}})}}),oe=y.ContentLength,delete y.ContentLength,!y.Headers&&(y.Headers={}),U.each(y.Headers,function(te,re){re.toLowerCase()==="content-length"&&delete y.Headers[re]}),function(){for(var te=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],re=1024*1024,pe=0;pe<te.length&&(re=te[pe]*1024*1024,!(oe/re<=j.options.MaxPartNumber));pe++);y.ChunkSize=y.SliceSize=Z=Math.max(Z,re)}(),oe===0?(y.Body="",y.ContentLength=0,y.SkipTask=!0,j.putObject(y,M)):w.emit("get_file_size_finish")}function I(y,M){var j=y.TaskId,w=y.Bucket,D=y.Region,A=y.Key,N=y.StorageClass,G=this,W={},Z=y.FileSize,ie=y.SliceSize,le=Math.ceil(Z/ie),ae=0,oe=U.throttleOnProgress.call(G,Z,y.onHashProgress),de=function(re,pe){var Ce=ie*(re-1),ve=Math.min(Ce+ie,Z),ye=ve-Ce;W[re]?pe(null,{PartNumber:re,ETag:W[re],Size:ye}):U.fileSlice(y.Body,Ce,ve,!1,function(Se){U.getFileMd5(Se,function(xe,Ee){if(xe)return pe(U.error(xe));var Ie='"'+Ee+'"';W[re]=Ie,ae+=ye,oe({loaded:ae,total:Z}),pe(null,{PartNumber:re,ETag:Ie,Size:ye})})})},ue=function(re,pe){var Ce=re.length;if(Ce===0)return pe(null,!0);if(Ce>le)return pe(null,!1);if(Ce>1){var ve=Math.max(re[0].Size,re[1].Size);if(ve!==ie)return pe(null,!1)}var ye=function Se(xe){if(xe<Ce){var Ee=re[xe];de(Ee.PartNumber,function(Ie,we){we&&we.ETag===Ee.ETag&&we.Size===Ee.Size?Se(xe+1):pe(null,!1)})}else pe(null,!0)};ye(0)},me=new T;me.on("error",function(te){if(G._isRunningTask(j))return M(te)}),me.on("upload_id_available",function(te){var re={},pe=[];U.each(te.PartList,function(ye){re[ye.PartNumber]=ye});for(var Ce=1;Ce<=le;Ce++){var ve=re[Ce];ve?(ve.PartNumber=Ce,ve.Uploaded=!0):ve={PartNumber:Ce,ETag:null,Uploaded:!1},pe.push(ve)}te.PartList=pe,M(null,te)}),me.on("no_available_upload_id",function(){if(G._isRunningTask(j)){var te=U.extend({Bucket:w,Region:D,Key:A,Query:U.clone(y.Query),StorageClass:N,Body:y.Body,calledBySdk:"sliceUploadFile",tracker:y.tracker},y),re=U.clone(y.Headers);delete re["x-cos-mime-limit"],te.Headers=re,G.multipartInit(te,function(pe,Ce){if(G._isRunningTask(j)){if(pe)return me.emit("error",pe);var ve=Ce.UploadId;if(!ve)return M(U.error(new Error("no such upload id")));me.emit("upload_id_available",{UploadId:ve,PartList:[]})}})}}),me.on("has_and_check_upload_id",function(te){te=te.reverse(),l.eachLimit(te,1,function(re,pe){if(G._isRunningTask(j)){if(x.using[re]){pe();return}q.call(G,{Bucket:w,Region:D,Key:A,UploadId:re,tracker:y.tracker},function(Ce,ve){if(G._isRunningTask(j)){if(Ce)return x.removeUsing(re),me.emit("error",Ce);var ye=ve.PartList;ye.forEach(function(Se){Se.PartNumber*=1,Se.Size*=1,Se.ETag=Se.ETag||""}),ue(ye,function(Se,xe){if(G._isRunningTask(j)){if(Se)return me.emit("error",Se);xe?pe({UploadId:re,PartList:ye}):pe()}})}})}},function(re){G._isRunningTask(j)&&(oe(null,!0),re&&re.UploadId?me.emit("upload_id_available",re):me.emit("no_available_upload_id"))})}),me.on("seek_local_avail_upload_id",function(te){var re=x.getFileId(y.Body,y.ChunkSize,w,A),pe=x.getUploadIdList.call(G,re);if(!re||!pe){me.emit("has_and_check_upload_id",te);return}var Ce=function ve(ye){if(ye>=pe.length){me.emit("has_and_check_upload_id",te);return}var Se=pe[ye];if(!U.isInArray(te,Se)){x.removeUploadId.call(G,Se),ve(ye+1);return}if(x.using[Se]){ve(ye+1);return}q.call(G,{Bucket:w,Region:D,Key:A,UploadId:Se,tracker:y.tracker},function(xe,Ee){G._isRunningTask(j)&&(xe?(x.removeUploadId.call(G,Se),ve(ye+1)):me.emit("upload_id_available",{UploadId:Se,PartList:Ee.PartList}))})};Ce(0)}),me.on("get_remote_upload_id_list",function(){z.call(G,{Bucket:w,Region:D,Key:A,tracker:y.tracker},function(te,re){if(G._isRunningTask(j)){if(te)return me.emit("error",te);var pe=U.filter(re.UploadList,function(ye){return ye.Key===A&&(!N||ye.StorageClass.toUpperCase()===N.toUpperCase())}).reverse().map(function(ye){return ye.UploadId||ye.UploadID});if(pe.length)me.emit("seek_local_avail_upload_id",pe);else{var Ce=x.getFileId(y.Body,y.ChunkSize,w,A),ve;Ce&&(ve=x.getUploadIdList.call(G,Ce))&&U.each(ve,function(ye){x.removeUploadId.call(G,ye)}),me.emit("no_available_upload_id")}}})}),me.emit("get_remote_upload_id_list")}function z(y,M){var j=this,w=[],D={Bucket:y.Bucket,Region:y.Region,Prefix:y.Key,calledBySdk:y.calledBySdk||"sliceUploadFile",tracker:y.tracker},A=function N(){j.multipartList(D,function(G,W){if(G)return M(G);w.push.apply(w,W.Upload||[]),W.IsTruncated==="true"?(D.KeyMarker=W.NextKeyMarker,D.UploadIdMarker=W.NextUploadIdMarker,N()):M(null,{UploadList:w})})};A()}function q(y,M){var j=this,w=[],D={Bucket:y.Bucket,Region:y.Region,Key:y.Key,UploadId:y.UploadId,calledBySdk:"sliceUploadFile",tracker:y.tracker},A=function N(){j.multipartListPart(D,function(G,W){if(G)return M(G);w.push.apply(w,W.Part||[]),W.IsTruncated==="true"?(D.PartNumberMarker=W.NextPartNumberMarker,N()):M(null,{PartList:w})})};A()}function X(y,M){var j=this,w=y.TaskId,D=y.Bucket,A=y.Region,N=y.Key,G=y.UploadData,W=y.FileSize,Z=y.SliceSize,ie=Math.min(y.AsyncLimit||j.options.ChunkParallelLimit||1,256),le=y.Body,ae=Math.ceil(W/Z),oe=0,de=y.ServerSideEncryption,ue=y.Headers,me=U.filter(G.PartList,function(re){return re.Uploaded&&(oe+=re.PartNumber>=ae&&W%Z||Z),!re.Uploaded}),te=y.onProgress;l.eachLimit(me,ie,function(re,pe){if(j._isRunningTask(w)){var Ce=re.PartNumber,ve=Math.min(W,re.PartNumber*Z)-(re.PartNumber-1)*Z,ye=0;F.call(j,{TaskId:w,Bucket:D,Region:A,Key:N,SliceSize:Z,FileSize:W,PartNumber:Ce,ServerSideEncryption:de,Body:le,UploadData:G,Headers:ue,onProgress:function(xe){oe+=xe.loaded-ye,ye=xe.loaded,te({loaded:oe,total:W})},tracker:y.tracker},function(Se,xe){j._isRunningTask(w)&&(!Se&&!xe.ETag&&(Se='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败,请在CORS ExposeHeader设置中添加ETag,请参考文档:https://cloud.tencent.com/document/product/436/13318 )'),Se?oe-=ye:(oe+=ve-ye,re.ETag=xe.ETag),te({loaded:oe,total:W}),pe(Se||null,xe))})}},function(re){if(j._isRunningTask(w)){if(re)return M(re);M(null,{UploadId:G.UploadId,SliceList:G.PartList})}})}function F(y,M){var j=this,w=y.TaskId,D=y.Bucket,A=y.Region,N=y.Key,G=y.FileSize,W=y.Body,Z=y.PartNumber*1,ie=y.SliceSize,le=y.ServerSideEncryption,ae=y.UploadData,oe=y.Headers||{},de=j.options.ChunkRetryTimes+1,ue=ie*(Z-1),me=ie,te=ue+ie;te>G&&(te=G,me=te-ue);var re=["x-cos-traffic-limit","x-cos-mime-limit"],pe={};U.each(oe,function(ve,ye){re.indexOf(ye)>-1&&(pe[ye]=ve)});var Ce=ae.PartList[Z-1];l.retry(de,function(ve){j._isRunningTask(w)&&U.fileSlice(W,ue,te,!0,function(ye){j.multipartUpload({TaskId:w,Bucket:D,Region:A,Key:N,ContentLength:me,PartNumber:Z,UploadId:ae.UploadId,ServerSideEncryption:le,Body:ye,Headers:pe,onProgress:y.onProgress,calledBySdk:"sliceUploadFile",tracker:y.tracker},function(Se,xe){if(j._isRunningTask(w))return Se?ve(Se):(Ce.Uploaded=!0,ve(null,xe))})})},function(ve,ye){if(j._isRunningTask(w))return M(ve,ye)})}function L(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.UploadId,N=y.SliceList,G=this,W=this.options.ChunkRetryTimes+1,Z=y.Headers,ie=N.map(function(le){return{PartNumber:le.PartNumber,ETag:le.ETag}});l.retry(W,function(le){G.multipartComplete({Bucket:j,Region:w,Key:D,UploadId:A,Parts:ie,Headers:Z,calledBySdk:"sliceUploadFile",tracker:y.tracker},le)},function(le,ae){M(le,ae)})}function $(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.UploadId,N=y.Level||"task",G=y.AsyncLimit,W=this,Z=new T;if(Z.on("error",function(ie){return M(ie)}),Z.on("get_abort_array",function(ie){Y.call(W,{Bucket:j,Region:w,Key:D,Headers:y.Headers,AsyncLimit:G,AbortArray:ie},M)}),N==="bucket")z.call(W,{Bucket:j,Region:w,calledBySdk:"abortUploadTask"},function(ie,le){if(ie)return M(ie);Z.emit("get_abort_array",le.UploadList||[])});else if(N==="file"){if(!D)return M(U.error(new Error("abort_upload_task_no_key")));z.call(W,{Bucket:j,Region:w,Key:D,calledBySdk:"abortUploadTask"},function(ie,le){if(ie)return M(ie);Z.emit("get_abort_array",le.UploadList||[])})}else if(N==="task"){if(!A)return M(U.error(new Error("abort_upload_task_no_id")));if(!D)return M(U.error(new Error("abort_upload_task_no_key")));Z.emit("get_abort_array",[{Key:D,UploadId:A}])}else return M(U.error(new Error("abort_unknown_level")))}function Y(y,M){var j=y.Bucket,w=y.Region,D=y.Key,A=y.AbortArray,N=y.AsyncLimit||1,G=this,W=0,Z=new Array(A.length);l.eachLimit(A,N,function(ie,le){var ae=W;if(D&&D!==ie.Key){Z[ae]={error:{KeyNotMatch:!0}},le(null);return}var oe=ie.UploadId||ie.UploadID;G.multipartAbort({Bucket:j,Region:w,Key:ie.Key,Headers:y.Headers,UploadId:oe},function(de){var ue={Bucket:j,Region:w,Key:ie.Key,UploadId:oe};Z[ae]={error:de,task:ue},le(null)}),W++},function(ie){if(ie)return M(ie);for(var le=[],ae=[],oe=0,de=Z.length;oe<de;oe++){var ue=Z[oe];ue.task&&(ue.error?ae.push(ue.task):le.push(ue.task))}return M(null,{successList:le,errorList:ae})})}function ee(y,M){var j=this,w=y.SliceSize===void 0?j.options.SliceSize:y.SliceSize,D=[],A=y.Body,N=A.size||A.length||0,G={TaskId:""};if(j.options.EnableTracker){var W=j.options.UseAccelerate||typeof j.options.Domain=="string"&&j.options.Domain.includes("accelerate.");y.tracker=new K({bucket:y.Bucket,region:y.Region,apiName:"uploadFile",fileKey:y.Key,fileSize:N,accelerate:W,deepTracker:j.options.DeepTracker,customId:j.options.CustomId,delay:j.options.TrackerDelay})}U.each(y,function(de,ue){u(de)!=="object"&&typeof de!="function"&&(G[ue]=de)});var Z=y.onTaskReady,ie=function(ue){G.TaskId=ue,Z&&Z(ue)};y.onTaskReady=ie;var le=N>w?"sliceUploadFile":"putObject",ae=y.onFileFinish,oe=function(ue,me){y.tracker&&y.tracker.formatResult(ue,me),ae&&ae(ue,me,G),M&&M(ue,me)};D.push({api:le,params:y,callback:oe}),j._addTasks(D)}function B(y,M){var j=this,w=y.SliceSize===void 0?j.options.SliceSize:y.SliceSize,D=0,A=0,N=U.throttleOnProgress.call(j,A,y.onProgress),G=y.files.length,W=y.onFileFinish,Z=Array(G),ie=function(oe,de,ue){N(null,!0),W&&W(oe,de,ue),Z[ue.Index]={options:ue,error:oe,data:de},--G<=0&&M&&M(null,{files:Z})},le=[];U.each(y.files,function(ae,oe){(function(){var de=ae.Body,ue=de.size||de.length||0,me={Index:oe,TaskId:""};if(!j.options.UseRawKey&&ae.Key&&ae.Key.substr(0,1)==="/"&&(ae.Key=ae.Key.substr(1)),D+=ue,j.options.EnableTracker){var te=j.options.UseAccelerate||typeof j.options.Domain=="string"&&j.options.Domain.includes("accelerate.");ae.tracker=new K({bucket:ae.Bucket,region:ae.Region,apiName:"uploadFiles",fileKey:ae.Key,fileSize:ue,accelerate:te,deepTracker:j.options.DeepTracker,customId:j.options.CustomId,delay:j.options.TrackerDelay})}U.each(ae,function(Ie,we){u(Ie)!=="object"&&typeof Ie!="function"&&(me[we]=Ie)});var re=ae.onTaskReady,pe=function(we){me.TaskId=we,re&&re(we)};ae.onTaskReady=pe;var Ce=0,ve=ae.onProgress,ye=function(we){A=A-Ce+we.loaded,Ce=we.loaded,ve&&ve(we),N({loaded:A,total:D})};ae.onProgress=ye;var Se=ue>w?"sliceUploadFile":"putObject",xe=ae.onFileFinish,Ee=function(we,_e){ae.tracker&&ae.tracker.formatResult(we,_e),xe&&xe(we,_e),ie&&ie(we,_e,me)};le.push({api:Se,params:ae,callback:Ee})})()}),j._addTasks(le)}function m(y,M){var j=new T,w=this,D=y.Bucket,A=y.Region,N=y.Key,G=y.CopySource,W=U.getSourceParams.call(this,G);if(!W){M(U.error(new Error("CopySource format error")));return}var Z=W.Bucket,ie=W.Region,le=decodeURIComponent(W.Key),ae=y.CopySliceSize===void 0?w.options.CopySliceSize:y.CopySliceSize;ae=Math.max(0,ae);var oe=y.CopyChunkSize||this.options.CopyChunkSize,de=this.options.CopyChunkParallelLimit,ue=this.options.ChunkRetryTimes+1,me=0,te=0,re,pe,Ce={},ve={},ye={};j.on("copy_slice_complete",function(Se){U.each(y.Headers,function(Ee,Ie){Ie.toLowerCase().indexOf("x-cos-meta-")});var xe=U.map(Se.PartList,function(Ee){return{PartNumber:Ee.PartNumber,ETag:Ee.ETag}});l.retry(ue,function(Ee){w.multipartComplete({Bucket:D,Region:A,Key:N,UploadId:Se.UploadId,Parts:xe,calledBySdk:"sliceCopyFile"},Ee)},function(Ee,Ie){if(x.removeUsing(Se.UploadId),Ee)return pe(null,!0),M(Ee);x.removeUploadId(Se.UploadId),pe({loaded:re,total:re},!0),M(null,Ie)})}),j.on("get_copy_data_finish",function(Se){var xe=x.getCopyFileId(G,Ce,oe,D,N);xe&&x.saveUploadId(xe,Se.UploadId,w.options.UploadIdCacheLimit),x.setUsing(Se.UploadId);var Ee=U.filter(Se.PartList,function(Ie){return Ie.Uploaded&&(te+=Ie.PartNumber>=me&&re%oe||oe),!Ie.Uploaded});l.eachLimit(Ee,de,function(Ie,we){var _e=Ie.PartNumber,je=Ie.CopySourceRange,Ue=Ie.end-Ie.start;l.retry(ue,function(se){C.call(w,{Bucket:D,Region:A,Key:N,CopySource:G,UploadId:Se.UploadId,PartNumber:_e,CopySourceRange:je},se)},function(se,d){if(se)return we(se);te+=Ue,pe({loaded:te,total:re}),Ie.ETag=d.ETag,we(se||null,d)})},function(Ie){if(Ie)return x.removeUsing(Se.UploadId),pe(null,!0),M(Ie);j.emit("copy_slice_complete",Se)})}),j.on("get_chunk_size_finish",function(){var Se=function(){w.multipartInit({Bucket:D,Region:A,Key:N,Headers:ye},function(_e,je){if(_e)return M(_e);y.UploadId=je.UploadId,j.emit("get_copy_data_finish",{UploadId:y.UploadId,PartList:y.PartList})})},xe=x.getCopyFileId(G,Ce,oe,D,N),Ee=x.getUploadIdList(xe);if(!xe||!Ee)return Se();var Ie=function we(_e){if(_e>=Ee.length)return Se();var je=Ee[_e];if(x.using[je])return we(_e+1);q.call(w,{Bucket:D,Region:A,Key:N,UploadId:je},function(Ue,se){if(Ue)x.removeUploadId(je),we(_e+1);else{if(x.using[je])return we(_e+1);var d={},i=0;U.each(se.PartList,function(o){var a=parseInt(o.Size),v=i+a-1;d[o.PartNumber+"|"+i+"|"+v]=o.ETag,i+=a}),U.each(y.PartList,function(o){var a=d[o.PartNumber+"|"+o.start+"|"+o.end];a&&(o.ETag=a,o.Uploaded=!0)}),j.emit("get_copy_data_finish",{UploadId:je,PartList:y.PartList})}})};Ie(0)}),j.on("get_file_size_finish",function(){if(function(){for(var xe=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],Ee=1024*1024,Ie=0;Ie<xe.length&&(Ee=xe[Ie]*1024*1024,!(re/Ee<=w.options.MaxPartNumber));Ie++);y.ChunkSize=oe=Math.max(oe,Ee),me=Math.ceil(re/oe);for(var we=[],_e=1;_e<=me;_e++){var je=(_e-1)*oe,Ue=_e*oe<re?_e*oe-1:re-1,se={PartNumber:_e,start:je,end:Ue,CopySourceRange:"bytes="+je+"-"+Ue};we.push(se)}y.PartList=we}(),y.Headers["x-cos-metadata-directive"]==="Replaced"?ye=y.Headers:ye=ve,ye["x-cos-storage-class"]=y.Headers["x-cos-storage-class"]||ve["x-cos-storage-class"],ye=U.clearKey(ye),ve["x-cos-storage-class"]==="ARCHIVE"||ve["x-cos-storage-class"]==="DEEP_ARCHIVE"){var Se=ve["x-cos-restore"];if(!Se||Se==='ongoing-request="true"'){M(U.error(new Error("Unrestored archive object is not allowed to be copied")));return}}delete ye["x-cos-copy-source"],delete ye["x-cos-metadata-directive"],delete ye["x-cos-copy-source-If-Modified-Since"],delete ye["x-cos-copy-source-If-Unmodified-Since"],delete ye["x-cos-copy-source-If-Match"],delete ye["x-cos-copy-source-If-None-Match"],j.emit("get_chunk_size_finish")}),w.headObject({Bucket:Z,Region:ie,Key:le},function(Se,xe){if(Se){Se.statusCode&&Se.statusCode===404?M(U.error(Se,{ErrorStatus:le+" Not Exist"})):M(Se);return}if(re=y.FileSize=xe.headers["content-length"],re===void 0||!re){M(U.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.( 获取Content-Length失败,请在CORS ExposeHeader设置中添加Content-Length,请参考文档:https://cloud.tencent.com/document/product/436/13318 )')));return}if(pe=U.throttleOnProgress.call(w,re,y.onProgress),re<=ae)y.Headers["x-cos-metadata-directive"]||(y.Headers["x-cos-metadata-directive"]="Copy"),w.putObjectCopy(y,function(Ie,we){if(Ie)return pe(null,!0),M(Ie);pe({loaded:re,total:re},!0),M(Ie,we)});else{var Ee=xe.headers;Ce=Ee,ve={"Cache-Control":Ee["cache-control"],"Content-Disposition":Ee["content-disposition"],"Content-Encoding":Ee["content-encoding"],"Content-Type":Ee["content-type"],Expires:Ee.expires,"x-cos-storage-class":Ee["x-cos-storage-class"]},U.each(Ee,function(Ie,we){var _e="x-cos-meta-";we.indexOf(_e)===0&&we.length>_e.length&&(ve[we]=Ie)}),j.emit("get_file_size_finish")}})}function C(y,M){var j=y.TaskId,w=y.Bucket,D=y.Region,A=y.Key,N=y.CopySource,G=y.UploadId,W=y.PartNumber*1,Z=y.CopySourceRange,ie=this.options.ChunkRetryTimes+1,le=this;l.retry(ie,function(ae){le.uploadPartCopy({TaskId:j,Bucket:w,Region:D,Key:A,CopySource:N,UploadId:G,PartNumber:W,CopySourceRange:Z},function(oe,de){ae(oe||null,de)})},function(ae,oe){return M(ae,oe)})}var V={sliceUploadFile:O,abortUploadTask:$,uploadFile:ee,uploadFiles:B,sliceCopyFile:m};r.exports.init=function(y,M){M.transferToTaskMethod(V,"sliceUploadFile"),U.each(V,function(j,w){y.prototype[w]=U.apiWrapper(w,j)})}},"./src/async.js":function(r,p){var s=function(T,U,K,O){if(O=O||function(){},!T.length||U<=0)return O();var I=0,z=0,q=0;(function X(){if(I>=T.length)return O();for(;q<U&&z<T.length;)z+=1,q+=1,K(T[z-1],function(F){F?(O(F),O=function(){}):(I+=1,q-=1,I>=T.length?O():X())})})()},u=function(T,U,K){var O=function I(z){U(function(q,X){q&&z<T?I(z+1):K(q,X)})};T<1?K():O(1)},x={eachLimit:s,retry:u};r.exports=x},"./src/base.js":function(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/typeof.js"),x=s("./lib/request.js"),l=s("./src/util.js");function T(e,g){typeof e=="function"&&(g=e,e={});var n=this.options.Protocol||(l.isBrowser&&(typeof location>"u"?"undefined":u(location))==="object"&&location.protocol==="http:"?"http:":"https:"),f=this.options.ServiceDomain,k=e.AppId||this.options.appId,S=e.Region;f?(f=f.replace(/\{\{AppId\}\}/gi,k||"").replace(/\{\{Region\}\}/gi,S||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(f)||(f=n+"//"+f),f.slice(-1)==="/"&&(f=f.slice(0,-1))):S?f=n+"//cos."+S+".myqcloud.com":f=n+"//service.cos.myqcloud.com";var E="",_=S?"cos."+S+".myqcloud.com":"service.cos.myqcloud.com",ne=f.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");_===ne&&(E=_),ce.call(this,{Action:"name/cos:GetService",url:f,method:"GET",headers:e.Headers,SignHost:E},function(Oe,Ae){if(Oe)return g(Oe);var ke=Ae&&Ae.ListAllMyBucketsResult&&Ae.ListAllMyBucketsResult.Buckets&&Ae.ListAllMyBucketsResult.Buckets.Bucket||[];ke=l.isArray(ke)?ke:[ke];var be=Ae&&Ae.ListAllMyBucketsResult&&Ae.ListAllMyBucketsResult.Owner||{};g(null,{Buckets:ke,Owner:be,statusCode:Ae.statusCode,headers:Ae.headers})})}function U(e,g){var n=this,f="";if(e.BucketAZConfig){var k={BucketAZConfig:e.BucketAZConfig};f=l.json2xml({CreateBucketConfiguration:k})}ce.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:f},function(S,E){if(S)return g(S);var _=H({protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});g(null,{Location:_,statusCode:E.statusCode,headers:E.headers})})}function K(e,g){ce.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD"},g)}function O(e,g){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n.marker=e.Marker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,ce.call(this,{Action:"name/cos:GetBucket",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n},function(f,k){if(f)return g(f);var S=k.ListBucketResult||{},E=S.Contents||[],_=S.CommonPrefixes||[];E=l.isArray(E)?E:[E],_=l.isArray(_)?_:[_];var ne=l.clone(S);l.extend(ne,{Contents:E,CommonPrefixes:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function I(e,g){ce.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function z(e,g){var n=e.Headers,f="";if(e.AccessControlPolicy){var k=l.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=l.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},f=l.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.md5(f))}l.each(n,function(E,_){_.indexOf("x-cos-grant-")===0&&(n[_]=b(n[_]))}),ce.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:n,action:"acl",body:f},function(E,_){if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function q(e,g){ce.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl"},function(n,f){if(n)return g(n);var k=f.AccessControlPolicy||{},S=k.Owner||{},E=k.AccessControlList.Grant||[];E=l.isArray(E)?E:[E];var _=h(k);f.headers&&f.headers["x-cos-acl"]&&(_.ACL=f.headers["x-cos-acl"]),_=l.extend(_,{Owner:S,Grants:E,statusCode:f.statusCode,headers:f.headers}),g(null,_)})}function X(e,g){var n=e.CORSConfiguration||{},f=n.CORSRules||e.CORSRules||[];f=l.clone(l.isArray(f)?f:[f]),l.each(f,function(_){l.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(ne){var Oe=ne+"s",Ae=_[Oe]||_[ne]||[];delete _[Oe],_[ne]=l.isArray(Ae)?Ae:[Ae]})});var k={CORSRule:f};e.ResponseVary&&(k.ResponseVary=e.ResponseVary);var S=l.json2xml({CORSConfiguration:k}),E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=l.b64(l.md5(S)),ce.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"cors",headers:E},function(_,ne){if(_)return g(_);g(null,{statusCode:ne.statusCode,headers:ne.headers})})}function F(e,g){ce.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,f){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchCORSConfiguration"){var k={CORSRules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.CORSConfiguration||{},E=S.CORSRules||S.CORSRule||[];E=l.clone(l.isArray(E)?E:[E]);var _=S.ResponseVary;l.each(E,function(ne){l.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],function(Oe){var Ae=Oe+"s",ke=ne[Ae]||ne[Oe]||[];delete ne[Oe],ne[Ae]=l.isArray(ke)?ke:[ke]})}),g(null,{CORSRules:E,ResponseVary:_,statusCode:f.statusCode,headers:f.headers})})}function L(e,g){ce.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode||n.statusCode,headers:f.headers})})}function $(e,g){ce.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location"},g)}function Y(e,g){var n=e.Policy;try{typeof n=="string"&&(n=JSON.parse(n))}catch(S){}if(!n||typeof n=="string")return g(l.error(new Error("Policy format error")));var f=JSON.stringify(n);n.version||(n.version="2.0");var k=e.Headers;k["Content-Type"]="application/json",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:f,headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function ee(e,g){ce.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0},function(n,f){if(n)return n.statusCode&&n.statusCode===403?g(l.error(n,{ErrorStatus:"Access Denied"})):n.statusCode&&n.statusCode===405?g(l.error(n,{ErrorStatus:"Method Not Allowed"})):n.statusCode&&n.statusCode===404?g(l.error(n,{ErrorStatus:"Policy Not Found"})):g(n);var k={};try{k=JSON.parse(f.body)}catch(S){}g(null,{Policy:k,statusCode:f.statusCode,headers:f.headers})})}function B(e,g){ce.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode||n.statusCode,headers:f.headers})})}function m(e,g){var n=e.Tagging||{},f=n.TagSet||n.Tags||e.Tags||[];f=l.clone(l.isArray(f)?f:[f]);var k=l.json2xml({Tagging:{TagSet:{Tag:f}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"tagging",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function C(e,g){ce.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,f){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="NoSuchTagSet")){var k={Tags:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=[];try{S=f.Tagging.TagSet.Tag||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Tags:S,statusCode:f.statusCode,headers:f.headers})})}function V(e,g){ce.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function y(e,g){var n=e.LifecycleConfiguration||{},f=n.Rules||e.Rules||[];f=l.clone(f);var k=l.json2xml({LifecycleConfiguration:{Rule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"lifecycle",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function M(e,g){ce.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,f){if(n){if(n.statusCode===404&&n.error&&n.error.Code==="NoSuchLifecycleConfiguration"){var k={Rules:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=[];try{S=f.LifecycleConfiguration.Rule||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Rules:S,statusCode:f.statusCode,headers:f.headers})})}function j(e,g){ce.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function w(e,g){if(!e.VersioningConfiguration){g(l.error(new Error("missing param VersioningConfiguration")));return}var n=e.VersioningConfiguration||{},f=l.json2xml({VersioningConfiguration:n}),k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"versioning",headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function D(e,g){ce.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning"},function(n,f){n||!f.VersioningConfiguration&&(f.VersioningConfiguration={}),g(n,f)})}function A(e,g){var n=l.clone(e.ReplicationConfiguration),f=l.json2xml({ReplicationConfiguration:n});f=f.replace(/<(\/?)Rules>/gi,"<$1Rule>"),f=f.replace(/<(\/?)Tags>/gi,"<$1Tag>");var k=e.Headers;k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"replication",headers:k},function(S,E){if(S&&S.statusCode===204)return g(null,{statusCode:S.statusCode});if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function N(e,g){ce.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,f){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="ReplicationConfigurationnotFoundError")){var k={ReplicationConfiguration:{Rules:[]},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}!f.ReplicationConfiguration&&(f.ReplicationConfiguration={}),f.ReplicationConfiguration.Rule&&(f.ReplicationConfiguration.Rules=l.makeArray(f.ReplicationConfiguration.Rule),delete f.ReplicationConfiguration.Rule),g(n,f)})}function G(e,g){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function W(e,g){if(!e.WebsiteConfiguration){g(l.error(new Error("missing param WebsiteConfiguration")));return}var n=l.clone(e.WebsiteConfiguration||{}),f=n.RoutingRules||n.RoutingRule||[];f=l.isArray(f)?f:[f],delete n.RoutingRule,delete n.RoutingRules,f.length&&(n.RoutingRules={RoutingRule:f});var k=l.json2xml({WebsiteConfiguration:n}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"website",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Z(e,g){ce.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(n,f){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchWebsiteConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.WebsiteConfiguration||{};if(S.RoutingRules){var E=l.clone(S.RoutingRules.RoutingRule||[]);E=l.makeArray(E),S.RoutingRules=E}g(null,{WebsiteConfiguration:S,statusCode:f.statusCode,headers:f.headers})})}function ie(e,g){ce.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function le(e,g){if(!e.RefererConfiguration){g(l.error(new Error("missing param RefererConfiguration")));return}var n=l.clone(e.RefererConfiguration||{}),f=n.DomainList||{},k=f.Domains||f.Domain||[];k=l.isArray(k)?k:[k],k.length&&(n.DomainList={Domain:k});var S=l.json2xml({RefererConfiguration:n}),E=e.Headers;E["Content-Type"]="application/xml",E["Content-MD5"]=l.b64(l.md5(S)),ce.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:S,action:"referer",headers:E},function(_,ne){if(_&&_.statusCode===204)return g(null,{statusCode:_.statusCode});if(_)return g(_);g(null,{statusCode:ne.statusCode,headers:ne.headers})})}function ae(e,g){ce.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(n,f){if(n){if(n.statusCode===404&&n.error.Code==="NoSuchRefererConfiguration"){var k={WebsiteConfiguration:{},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=f.RefererConfiguration||{};if(S.DomainList){var E=l.makeArray(S.DomainList.Domain||[]);S.DomainList={Domains:E}}g(null,{RefererConfiguration:S,statusCode:f.statusCode,headers:f.headers})})}function oe(e,g){var n=e.DomainConfiguration||{},f=n.DomainRule||e.DomainRule||[];f=l.clone(f);var k=l.json2xml({DomainConfiguration:{DomainRule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"domain",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function de(e,g){ce.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,f){if(n)return g(n);var k=[];try{k=f.DomainConfiguration.DomainRule||[]}catch(S){}k=l.clone(l.isArray(k)?k:[k]),g(null,{DomainRule:k,statusCode:f.statusCode,headers:f.headers})})}function ue(e,g){ce.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function me(e,g){var n=e.OriginConfiguration||{},f=n.OriginRule||e.OriginRule||[];f=l.clone(f);var k=l.json2xml({OriginConfiguration:{OriginRule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"origin",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function te(e,g){ce.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,f){if(n)return g(n);var k=[];try{k=f.OriginConfiguration.OriginRule||[]}catch(S){}k=l.clone(l.isArray(k)?k:[k]),g(null,{OriginRule:k,statusCode:f.statusCode,headers:f.headers})})}function re(e,g){ce.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function pe(e,g){var n=l.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),f=e.Headers;f["Content-Type"]="application/xml",f["Content-MD5"]=l.b64(l.md5(n)),ce.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:f},function(k,S){if(k&&k.statusCode===204)return g(null,{statusCode:k.statusCode});if(k)return g(k);g(null,{statusCode:S.statusCode,headers:S.headers})})}function Ce(e,g){ce.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(n,f){if(n)return g(n);g(null,{BucketLoggingStatus:f.BucketLoggingStatus,statusCode:f.statusCode,headers:f.headers})})}function ve(e,g,n){var f=l.clone(g.InventoryConfiguration);if(f.OptionalFields){var k=f.OptionalFields||[];f.OptionalFields={Field:k}}if(f.Destination&&f.Destination.COSBucketDestination&&f.Destination.COSBucketDestination.Encryption){var S=f.Destination.COSBucketDestination.Encryption;Object.keys(S).indexOf("SSECOS")>-1&&(S["SSE-COS"]=S.SSECOS,delete S.SSECOS)}var E=l.json2xml({InventoryConfiguration:f}),_=g.Headers;_["Content-Type"]="application/xml",_["Content-MD5"]=l.b64(l.md5(E));var ne=e==="PUT"?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";ce.call(this,{Action:ne,method:e,Bucket:g.Bucket,Region:g.Region,body:E,action:"inventory",qs:{id:g.Id},headers:_},function(Oe,Ae){if(Oe&&Oe.statusCode===204)return n(null,{statusCode:Oe.statusCode});if(Oe)return n(Oe);n(null,{statusCode:Ae.statusCode,headers:Ae.headers})})}function ye(e,g){return ve.call(this,"PUT",e,g)}function Se(e,g){return ve.call(this,"POST",e,g)}function xe(e,g){ce.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(n,f){if(n)return g(n);var k=f.InventoryConfiguration;if(k&&k.OptionalFields&&k.OptionalFields.Field){var S=k.OptionalFields.Field;l.isArray(S)||(S=[S]),k.OptionalFields=S}if(k.Destination&&k.Destination.COSBucketDestination&&k.Destination.COSBucketDestination.Encryption){var E=k.Destination.COSBucketDestination.Encryption;Object.keys(E).indexOf("SSE-COS")>-1&&(E.SSECOS=E["SSE-COS"],delete E["SSE-COS"])}g(null,{InventoryConfiguration:k,statusCode:f.statusCode,headers:f.headers})})}function Ee(e,g){ce.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(n,f){if(n)return g(n);var k=f.ListInventoryConfigurationResult,S=k.InventoryConfiguration||[];S=l.isArray(S)?S:[S],delete k.InventoryConfiguration,l.each(S,function(E){if(E&&E.OptionalFields&&E.OptionalFields.Field){var _=E.OptionalFields.Field;l.isArray(_)||(_=[_]),E.OptionalFields=_}if(E.Destination&&E.Destination.COSBucketDestination&&E.Destination.COSBucketDestination.Encryption){var ne=E.Destination.COSBucketDestination.Encryption;Object.keys(ne).indexOf("SSE-COS")>-1&&(ne.SSECOS=ne["SSE-COS"],delete ne["SSE-COS"])}}),k.InventoryConfigurations=S,l.extend(k,{statusCode:f.statusCode,headers:f.headers}),g(null,k)})}function Ie(e,g){ce.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function we(e,g){if(!e.AccelerateConfiguration){g(l.error(new Error("missing param AccelerateConfiguration")));return}var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},f=l.json2xml(n),k={};k["Content-Type"]="application/xml",k["Content-MD5"]=l.b64(l.md5(f)),ce.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:f,action:"accelerate",headers:k},function(S,E){if(S)return g(S);g(null,{statusCode:E.statusCode,headers:E.headers})})}function _e(e,g){ce.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(n,f){n||!f.AccelerateConfiguration&&(f.AccelerateConfiguration={}),g(n,f)})}function je(e,g){var n=e.ServerSideEncryptionConfiguration||{},f=n.Rule||n.Rules||[],k=l.json2xml({ServerSideEncryptionConfiguration:{Rule:f}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:k,action:"encryption",headers:S},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Ue(e,g){ce.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,f){if(n){if(n.statusCode===404&&n.code==="NoSuchEncryptionConfiguration"){var k={EncryptionConfiguration:{Rules:[]},statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=l.makeArray(f.EncryptionConfiguration&&f.EncryptionConfiguration.Rule||[]);f.EncryptionConfiguration={Rules:S},g(n,f)})}function se(e,g){ce.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption"},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function d(e,g){ce.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,f){if(n){var k=n.statusCode;return e.Headers["If-Modified-Since"]&&k&&k===304?g(null,{NotModified:!0,statusCode:k}):g(n)}f.ETag=l.attr(f.headers,"etag",""),g(null,f)})}function i(e,g){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,ce.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(f,k){if(f)return g(f);var S=k.ListVersionsResult||{},E=S.DeleteMarker||[];E=l.isArray(E)?E:[E];var _=S.Version||[];_=l.isArray(_)?_:[_];var ne=l.clone(S);delete ne.DeleteMarker,delete ne.Version,l.extend(ne,{DeleteMarkers:E,Versions:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function o(e,g){var n=e.Query||{},f=e.QueryString||"",k=l.throttleOnProgress.call(this,0,e.onProgress),S=e.tracker;S&&S.setParams({signStartTime:new Date().getTime()}),n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,ce.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,qsStr:f,rawBody:!0,onDownloadProgress:k,tracker:S},function(E,_){if(k(null,!0),E){var ne=E.statusCode;return e.Headers["If-Modified-Since"]&&ne&&ne===304?g(null,{NotModified:!0}):g(E)}g(null,{Body:_.body,ETag:l.attr(_.headers,"etag",""),statusCode:_.statusCode,headers:_.headers})})}function a(e,g){var n=this,f=e.ContentLength,k=l.throttleOnProgress.call(n,f,e.onProgress),S=e.Headers;!S["Cache-Control"]&&!S["cache-control"]&&(S["Cache-Control"]=""),!S["Content-Type"]&&!S["content-type"]&&(S["Content-Type"]=e.Body&&e.Body.type||"");var E=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5,_=e.tracker;E&&_&&_.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(E,e.Body,function(ne){ne&&(_&&_.setParams({md5EndTime:new Date().getTime()}),n.options.UploadCheckContentMd5&&(S["Content-MD5"]=l.b64(ne)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(S["x-cos-meta-md5"]=ne)),e.ContentLength!==void 0&&(S["Content-Length"]=e.ContentLength),k(null,!0),ce.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:k,tracker:_},function(Oe,Ae){if(Oe)return k(null,!0),g(Oe);k({loaded:f,total:f},!0);var ke=H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:n.options.UseAccelerate?"accelerate":e.Region,object:e.Key});ke=ke.substr(ke.indexOf("://")+3),Ae.Location=ke,Ae.ETag=l.attr(Ae.headers,"etag",""),g(null,Ae)})},e.onHashProgress)}function v(e,g){ce.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":""},function(n,f){if(n){var k=n.statusCode;return k&&k===404?g(null,{BucketNotFound:!0,statusCode:k}):g(n)}g(null,{statusCode:f.statusCode,headers:f.headers})})}function R(e,g){var n={};e.VersionId&&(n.versionId=e.VersionId),ce.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n,action:"acl"},function(f,k){if(f)return g(f);var S=k.AccessControlPolicy||{},E=S.Owner||{},_=S.AccessControlList&&S.AccessControlList.Grant||[];_=l.isArray(_)?_:[_];var ne=h(S);delete ne.GrantWrite,k.headers&&k.headers["x-cos-acl"]&&(ne.ACL=k.headers["x-cos-acl"]),ne=l.extend(ne,{Owner:E,Grants:_,statusCode:k.statusCode,headers:k.headers}),g(null,ne)})}function P(e,g){var n=e.Headers,f="";if(e.AccessControlPolicy){var k=l.clone(e.AccessControlPolicy||{}),S=k.Grants||k.Grant;S=l.isArray(S)?S:[S],delete k.Grant,delete k.Grants,k.AccessControlList={Grant:S},f=l.json2xml({AccessControlPolicy:k}),n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.md5(f))}l.each(n,function(E,_){_.indexOf("x-cos-grant-")===0&&(n[_]=b(n[_]))}),ce.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:f},function(E,_){if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function J(e,g){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,ce.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(f,k){if(f)return f.statusCode&&f.statusCode===403?g(null,{OptionsForbidden:!0,statusCode:f.statusCode}):g(f);var S=k.headers||{};g(null,{AccessControlAllowOrigin:S["access-control-allow-origin"],AccessControlAllowMethods:S["access-control-allow-methods"],AccessControlAllowHeaders:S["access-control-allow-headers"],AccessControlExposeHeaders:S["access-control-expose-headers"],AccessControlMaxAge:S["access-control-max-age"],statusCode:k.statusCode,headers:k.headers})})}function fe(e,g){var n=this,f=e.Headers;!f["Cache-Control"]&&!f["cache-control"]&&(f["Cache-Control"]="");var k=e.CopySource||"",S=l.getSourceParams.call(this,k);if(!S){g(l.error(new Error("CopySource format error")));return}var E=S.Bucket,_=S.Region,ne=decodeURIComponent(S.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:E,region:_,prefix:ne},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(Oe,Ae){if(Oe)return g(Oe);var ke=l.clone(Ae.CopyObjectResult||{}),be=H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});l.extend(ke,{Location:be,statusCode:Ae.statusCode,headers:Ae.headers}),g(null,ke)})}function ge(e,g){var n=e.CopySource||"",f=l.getSourceParams.call(this,n);if(!f){g(l.error(new Error("CopySource format error")));return}var k=f.Bucket,S=f.Region,E=decodeURIComponent(f.Key);ce.call(this,{Scope:[{action:"name/cos:GetObject",bucket:k,region:S,prefix:E},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(_,ne){if(_)return g(_);var Oe=l.clone(ne.CopyPartResult||{});l.extend(Oe,{statusCode:ne.statusCode,headers:ne.headers}),g(null,Oe)})}function Q(e,g){var n=e.Objects||[],f=e.Quiet;n=l.isArray(n)?n:[n];var k=l.json2xml({Delete:{Object:n,Quiet:f||!1}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k));var E=l.map(n,function(_){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:_.Key}});ce.call(this,{Scope:E,method:"POST",Bucket:e.Bucket,Region:e.Region,body:k,action:"delete",headers:S},function(_,ne){if(_)return g(_);var Oe=ne.DeleteResult||{},Ae=Oe.Deleted||[],ke=Oe.Error||[];Ae=l.isArray(Ae)?Ae:[Ae],ke=l.isArray(ke)?ke:[ke];var be=l.clone(Oe);l.extend(be,{Error:ke,Deleted:Ae,statusCode:ne.statusCode,headers:ne.headers}),g(null,be)})}function Te(e,g){var n=e.Headers;if(!e.RestoreRequest){g(l.error(new Error("missing param RestoreRequest")));return}var f=e.RestoreRequest||{},k=l.json2xml({RestoreRequest:f});n["Content-Type"]="application/xml",n["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:k,action:"restore",headers:n},g)}function Ne(e,g){var n=e.Tagging||{},f=n.TagSet||n.Tags||e.Tags||[];f=l.clone(l.isArray(f)?f:[f]);var k=l.json2xml({Tagging:{TagSet:{Tag:f}}}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:k,action:"tagging",headers:S,VersionId:e.VersionId},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);g(null,{statusCode:_.statusCode,headers:_.headers})})}function Fe(e,g){ce.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(n,f){if(n){if(n.statusCode===404&&n.error&&(n.error==="Not Found"||n.error.Code==="NoSuchTagSet")){var k={Tags:[],statusCode:n.statusCode};n.headers&&(k.headers=n.headers),g(null,k)}else g(n);return}var S=[];try{S=f.Tagging.TagSet.Tag||[]}catch(E){}S=l.clone(l.isArray(S)?S:[S]),g(null,{Tags:S,statusCode:f.statusCode,headers:f.headers})})}function Be(e,g){ce.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(n,f){if(n&&n.statusCode===204)return g(null,{statusCode:n.statusCode});if(n)return g(n);g(null,{statusCode:f.statusCode,headers:f.headers})})}function Le(e,g){var n=e.SelectType;if(!n)return g(l.error(new Error("missing param SelectType")));var f=e.SelectRequest||{},k=l.json2xml({SelectRequest:f}),S=e.Headers;S["Content-Type"]="application/xml",S["Content-MD5"]=l.b64(l.md5(k)),ce.call(this,{Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:k,DataType:"arraybuffer",rawBody:!0},function(E,_){if(E&&E.statusCode===204)return g(null,{statusCode:E.statusCode});if(E)return g(E);var ne=l.parseSelectPayload(_.body);g(null,{statusCode:_.statusCode,headers:_.headers,Body:ne.body,Payload:ne.payload})})}function Ve(e,g){var n=this,f=e.Headers,k=e.tracker;!f["Cache-Control"]&&!f["cache-control"]&&(f["Cache-Control"]=""),!f["Content-Type"]&&!f["content-type"]&&(f["Content-Type"]=e.Body&&e.Body.type||"");var S=e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5);S&&k&&k.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(S,e.Body,function(E){E&&(e.Headers["x-cos-meta-md5"]=E),S&&k&&k.setParams({md5EndTime:new Date().getTime()}),ce.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:k},function(_,ne){if(_)return k&&k.parent&&k.parent.setParams({errorNode:"multipartInit"}),g(_);if(ne=l.clone(ne||{}),ne&&ne.InitiateMultipartUploadResult)return g(null,l.extend(ne.InitiateMultipartUploadResult,{statusCode:ne.statusCode,headers:ne.headers}));g(null,ne)})},e.onHashProgress)}function Ge(e,g){var n=this;l.getFileSize("multipartUpload",e,function(){var f=e.tracker,k=n.options.UploadCheckContentMd5;k&&f&&f.setParams({md5StartTime:new Date().getTime()}),l.getBodyMd5(k,e.Body,function(S){S&&(e.Headers["Content-MD5"]=l.b64(S)),k&&f&&f.setParams({md5EndTime:new Date().getTime()}),f&&f.setParams({partNumber:e.PartNumber}),ce.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null,tracker:f},function(E,_){if(E)return f&&f.parent&&f.parent.setParams({errorNode:"multipartUpload"}),g(E);g(null,{ETag:l.attr(_.headers,"etag",""),statusCode:_.statusCode,headers:_.headers})})})})}function We(e,g){for(var n=this,f=e.UploadId,k=e.Parts,S=e.tracker,E=0,_=k.length;E<_;E++)k[E].ETag&&k[E].ETag.indexOf('"')===0||(k[E].ETag='"'+k[E].ETag+'"');var ne=l.json2xml({CompleteMultipartUpload:{Part:k}});ne=ne.replace(/\n\s*/g,"");var Oe=e.Headers;Oe["Content-Type"]="application/xml",Oe["Content-MD5"]=l.b64(l.md5(ne)),ce.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:f},body:ne,headers:Oe,tracker:S},function(Ae,ke){if(Ae)return S&&S.parent&&S.parent.setParams({errorNode:"multipartComplete"}),g(Ae);var be=H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0}),He=ke.CompleteMultipartUploadResult||{};He.ProcessResults&&He&&He.ProcessResults&&(He.UploadResult={OriginalInfo:{Key:He.Key,Location:be,ETag:He.ETag,ImageInfo:He.ImageInfo},ProcessResults:He.ProcessResults},delete He.ImageInfo,delete He.ProcessResults);var $e=l.extend(He,{Location:be,statusCode:ke.statusCode,headers:ke.headers});g(null,$e)})}function qe(e,g){var n={};n.delimiter=e.Delimiter,n["encoding-type"]=e.EncodingType,n.prefix=e.Prefix||"",n["max-uploads"]=e.MaxUploads,n["key-marker"]=e.KeyMarker,n["upload-id-marker"]=e.UploadIdMarker,n=l.clearKey(n);var f=e.tracker;f&&f.setParams({signStartTime:new Date().getTime()}),ce.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"uploads",tracker:f},function(k,S){if(k)return f&&f.parent&&f.parent.setParams({errorNode:"multipartList"}),g(k);if(S&&S.ListMultipartUploadsResult){var E=S.ListMultipartUploadsResult.Upload||[];E=l.isArray(E)?E:[E],S.ListMultipartUploadsResult.Upload=E}var _=l.clone(S.ListMultipartUploadsResult||{});l.extend(_,{statusCode:S.statusCode,headers:S.headers}),g(null,_)})}function Xe(e,g){var n={},f=e.tracker;n.uploadId=e.UploadId,n["encoding-type"]=e.EncodingType,n["max-parts"]=e.MaxParts,n["part-number-marker"]=e.PartNumberMarker,ce.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n},function(k,S){if(k)return f&&f.parent&&f.parent.setParams({errorNode:"multipartListPart"}),g(k);var E=S.ListPartsResult||{},_=E.Part||[];_=l.isArray(_)?_:[_],E.Part=_;var ne=l.clone(E);l.extend(ne,{statusCode:S.statusCode,headers:S.headers}),g(null,ne)})}function Ye(e,g){var n={};n.uploadId=e.UploadId,ce.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:n},function(f,k){if(f)return g(f);g(null,{statusCode:k.statusCode,headers:k.headers})})}function ot(e,g){ce.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,DataType:e.DataType},function(n,f){if(n)return g(n);f&&f.body&&(f.Body=f.body,delete f.body),g(n,f)})}function tt(e,g){var n=e.Headers;!n["Cache-Control"]&&!n["cache-control"]&&(n["Cache-Control"]=""),!n["Content-Type"]&&!n["content-type"]&&(n["Content-Type"]=e.Body&&e.Body.type||""),ce.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers},function(f,k){if(f)return g(f);g(null,k)})}function rt(e){var g=this;return l.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:g.options.UseRawKey,SystemClockOffset:g.options.SystemClockOffset})}function c(e,g){var n=this,f=e.UseAccelerate===void 0?n.options.UseAccelerate:e.UseAccelerate,k=H({ForcePathStyle:n.options.ForcePathStyle,protocol:e.Protocol||n.options.Protocol,domain:e.Domain||n.options.Domain,bucket:e.Bucket,region:f?"accelerate":e.Region,object:e.Key}),S="";e.Query&&(S+=l.obj2str(e.Query)),e.QueryString&&(S+=(S?"&":"")+e.QueryString);var E=k;if(e.Sign!==void 0&&!e.Sign)return S&&(E+="?"+S),g(null,{Url:E}),E;var _=he.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:k}),ne=Re.call(this,{Action:(e.Method||"").toUpperCase()==="PUT"?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:_,ForceSignHost:e.ForceSignHost===!1?!1:n.options.ForceSignHost},function(Oe,Ae){if(g){if(Oe){g(Oe);return}var ke=function($e){var st=$e.match(/q-url-param-list.*?(?=&)/g)[0],it="q-url-param-list="+encodeURIComponent(st.replace(/q-url-param-list=/,"")).toLowerCase(),et=new RegExp(st,"g"),at=$e.replace(et,it);return at},be=k;be+="?"+(Ae.Authorization.indexOf("q-signature")>-1?ke(Ae.Authorization):"sign="+encodeURIComponent(Ae.Authorization)),Ae.SecurityToken&&(be+="&x-cos-security-token="+Ae.SecurityToken),Ae.ClientIP&&(be+="&clientIP="+Ae.ClientIP),Ae.ClientUA&&(be+="&clientUA="+Ae.ClientUA),Ae.Token&&(be+="&token="+Ae.Token),S&&(be+="&"+S),setTimeout(function(){g(null,{Url:be})})}});return ne?(E+="?"+ne.Authorization+(ne.SecurityToken?"&x-cos-security-token="+ne.SecurityToken:""),S&&(E+="&"+S)):S&&(E+="?"+S),E}function h(e){var g={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},f=e&&e.AccessControlList||{},k=f.Grant;k&&(k=l.isArray(k)?k:[k]);var S={READ:0,WRITE:0,FULL_CONTROL:0};return k&&k.length&&l.each(k,function(E){E.Grantee.ID==="qcs::cam::anyone:anyone"||E.Grantee.URI==="http://cam.qcloud.com/groups/global/AllUsers"?S[E.Permission]=1:E.Grantee.ID!==e.Owner.ID&&g[n[E.Permission]].push('id="'+E.Grantee.ID+'"')}),S.FULL_CONTROL||S.WRITE&&S.READ?g.ACL="public-read-write":S.READ?g.ACL="public-read":g.ACL="private",l.each(n,function(E){g[E]=b(g[E].join(","))}),g}function b(e){var g=e.split(","),n={},f,k;for(f=0;f<g.length;)k=g[f].trim(),n[k]?g.splice(f,1):(n[k]=!0,g[f]=k,f++);return g.join(",")}function H(e){var g=e.region||"",n=e.bucket||"",f=n.substr(0,n.lastIndexOf("-")),k=n.substr(n.lastIndexOf("-")+1),S=e.domain,E=e.object;typeof S=="function"&&(S=S({Bucket:n,Region:g})),["http","https"].includes(e.protocol)&&(e.protocol=e.protocol+":");var _=e.protocol||(l.isBrowser&&(typeof location>"u"?"undefined":u(location))==="object"&&location.protocol==="http:"?"http:":"https:");S||(["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(g)>-1?S="{Region}.myqcloud.com":S="cos.{Region}.myqcloud.com",e.ForcePathStyle||(S="{Bucket}."+S)),S=S.replace(/\{\{AppId\}\}/gi,k).replace(/\{\{Bucket\}\}/gi,f).replace(/\{\{Region\}\}/gi,g).replace(/\{\{.*?\}\}/gi,""),S=S.replace(/\{AppId\}/gi,k).replace(/\{BucketName\}/gi,f).replace(/\{Bucket\}/gi,n).replace(/\{Region\}/gi,g).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(S)||(S=_+"//"+S),S.slice(-1)==="/"&&(S=S.slice(0,-1));var ne=S;return e.ForcePathStyle&&(ne+="/"+n),ne+="/",E&&(ne+=l.camSafeUrlEncode(E).replace(/%2F/g,"/")),e.isLocation&&(ne=ne.replace(/^https?:\/\//,"")),ne}var he=function(g){if(!g.Bucket||!g.Region)return"";var n=g.UseAccelerate===void 0?this.options.UseAccelerate:g.UseAccelerate,f=g.Url||H({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:g.Bucket,region:n?"accelerate":g.Region}),k=f.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1"),S=new RegExp("^([a-z\\d-]+-\\d+\\.)?(cos|cosv6|ci|pic)\\.([a-z\\d-]+)\\.myqcloud\\.com$");return S.test(k)?k:""};function Re(e,g){var n=l.clone(e.Headers),f="";l.each(n,function(De,Pe){(De===""||["content-type","cache-control","expires"].indexOf(Pe.toLowerCase())>-1)&&delete n[Pe],Pe.toLowerCase()==="host"&&(f=De)});var k=e.ForceSignHost!==!1;!f&&e.SignHost&&k&&(n.Host=e.SignHost);var S=!1,E=function(Pe,ze){S||(S=!0,ze&&ze.XCosSecurityToken&&!ze.SecurityToken&&(ze=l.clone(ze),ze.SecurityToken=ze.XCosSecurityToken,delete ze.XCosSecurityToken),g&&g(Pe,ze))},_=this,ne=e.Bucket||"",Oe=e.Region||"",Ae=e.Key||"";_.options.ForcePathStyle&&ne&&(Ae=ne+"/"+Ae);var ke="/"+Ae,be={},He=e.Scope;if(!He){var $e=e.Action||"",st=e.ResourceKey||e.Key||"";He=e.Scope||[{action:$e,bucket:ne,region:Oe,prefix:st}]}var it=l.md5(JSON.stringify(He));_._StsCache=_._StsCache||[],function(){var De,Pe;for(De=_._StsCache.length-1;De>=0;De--){Pe=_._StsCache[De];var ze=Math.round(l.getSkewTime(_.options.SystemClockOffset)/1e3)+30;if(Pe.StartTime&&ze<Pe.StartTime||ze>=Pe.ExpiredTime){_._StsCache.splice(De,1);continue}if(!Pe.ScopeLimit||Pe.ScopeLimit&&Pe.ScopeKey===it){be=Pe;break}}}();var et=function(){var Pe="";be.StartTime&&e.Expires?Pe=be.StartTime+";"+(be.StartTime+e.Expires*1):be.StartTime&&be.ExpiredTime&&(Pe=be.StartTime+";"+be.ExpiredTime);var ze=l.getAuth({SecretId:be.TmpSecretId,SecretKey:be.TmpSecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:_.options.UseRawKey,SystemClockOffset:_.options.SystemClockOffset,KeyTime:Pe,ForceSignHost:k}),Ke={Authorization:ze,SecurityToken:be.SecurityToken||be.XCosSecurityToken||"",Token:be.Token||"",ClientIP:be.ClientIP||"",ClientUA:be.ClientUA||""};E(null,Ke)},at=function(Pe){if(Pe.Authorization){var ze=!1,Ke=Pe.Authorization;if(Ke)if(Ke.indexOf(" ")>-1)ze=!1;else if(Ke.indexOf("q-sign-algorithm=")>-1&&Ke.indexOf("q-ak=")>-1&&Ke.indexOf("q-sign-time=")>-1&&Ke.indexOf("q-key-time=")>-1&&Ke.indexOf("q-url-param-list=")>-1)ze=!0;else try{Ke=atob(Ke),Ke.indexOf("a=")>-1&&Ke.indexOf("k=")>-1&&Ke.indexOf("t=")>-1&&Ke.indexOf("r=")>-1&&Ke.indexOf("b=")>-1&&(ze=!0)}catch(nt){}if(!ze)return l.error(new Error("getAuthorization callback params format error"))}else{if(!Pe.TmpSecretId)return l.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!Pe.TmpSecretKey)return l.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!Pe.SecurityToken&&!Pe.XCosSecurityToken)return l.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!Pe.ExpiredTime)return l.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(Pe.ExpiredTime&&Pe.ExpiredTime.toString().length!==10)return l.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(Pe.StartTime&&Pe.StartTime.toString().length!==10)return l.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(be.ExpiredTime&&be.ExpiredTime-l.getSkewTime(_.options.SystemClockOffset)/1e3>60)et();else if(_.options.getAuthorization)_.options.getAuthorization.call(_,{Bucket:ne,Region:Oe,Method:e.Method,Key:Ae,Pathname:ke,Query:e.Query,Headers:n,Scope:He,SystemClockOffset:_.options.SystemClockOffset,ForceSignHost:k},function(De){typeof De=="string"&&(De={Authorization:De});var Pe=at(De);if(Pe)return E(Pe);De.Authorization?E(null,De):(be=De||{},be.Scope=He,be.ScopeKey=it,_._StsCache.push(be),et())});else if(_.options.getSTS)_.options.getSTS.call(_,{Bucket:ne,Region:Oe},function(De){be=De||{},be.Scope=He,be.ScopeKey=it,be.TmpSecretId||(be.TmpSecretId=be.SecretId),be.TmpSecretKey||(be.TmpSecretKey=be.SecretKey);var Pe=at(be);if(Pe)return E(Pe);_._StsCache.push(be),et()});else return function(){var De=l.getAuth({SecretId:e.SecretId||_.options.SecretId,SecretKey:e.SecretKey||_.options.SecretKey,Method:e.Method,Pathname:ke,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:_.options.UseRawKey,SystemClockOffset:_.options.SystemClockOffset,ForceSignHost:k}),Pe={Authorization:De,SecurityToken:_.options.SecurityToken||_.options.XCosSecurityToken};return E(null,Pe),Pe}();return""}function Me(e){var g=!1,n=!1,f=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var k=e.error.Code,S=e.error.Message;(k==="RequestTimeTooSkewed"||k==="AccessDenied"&&S==="Request has expired")&&(n=!0)}catch(_){}if(e)if(n&&f){var E=Date.parse(f);this.options.CorrectClockSkew&&Math.abs(l.getSkewTime(this.options.SystemClockOffset)-E)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=E-Date.now(),g=!0)}else Math.floor(e.statusCode/100)===5&&(g=!0);return g}function ce(e,g){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=l.clearKey(e.qs),e.headers&&(e.headers=l.clearKey(e.headers)),e.qs&&(e.qs=l.clearKey(e.qs));var f=l.clone(e.qs);e.action&&(f[e.action]="");var k=e.url||e.Url,S=e.SignHost||he.call(this,{Bucket:e.Bucket,Region:e.Region,Url:k}),E=e.tracker,_=function ne(Oe){var Ae=n.options.SystemClockOffset;E&&E.setParams({signStartTime:new Date().getTime(),retryTimes:Oe-1}),Re.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:f,Headers:e.headers,SignHost:S,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:n.options.ForceSignHost},function(ke,be){if(ke){g(ke);return}E&&E.setParams({signEndTime:new Date().getTime(),httpStartTime:new Date().getTime()}),e.AuthData=be,Je.call(n,e,function(He,$e){E&&E.setParams({httpEndTime:new Date().getTime()}),He&&Oe<2&&(Ae!==n.options.SystemClockOffset||Me.call(n,He))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]),ne(Oe+1)):g(He,$e)})})};_(1)}function Je(e,g){var n=this,f=e.TaskId;if(!(f&&!n._isRunningTask(f))){var k=e.Bucket,S=e.Region,E=e.Key,_=e.method||"GET",ne=e.Url||e.url,Oe=e.body,Ae=e.rawBody;n.options.UseAccelerate&&(S="accelerate"),ne=ne||H({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:k,region:S,object:E}),e.action&&(ne=ne+"?"+(l.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(ne.indexOf("?")>-1?ne=ne+"&"+e.qsStr:ne=ne+"?"+e.qsStr);var ke={method:_,url:ne,headers:e.headers,qs:e.qs,body:Oe},be="x-cos-security-token";if(l.isCIHost(ne)&&(be="x-ci-security-token"),ke.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(ke.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(ke.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(ke.headers.clientUA=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(ke.headers[be]=e.AuthData.SecurityToken),ke.headers&&(ke.headers=l.clearKey(ke.headers)),ke=l.clearKey(ke),e.onProgress&&typeof e.onProgress=="function"){var He=Oe&&(Oe.size||Oe.length)||0;ke.onProgress=function(De){if(!(f&&!n._isRunningTask(f))){var Pe=De?De.loaded:0;e.onProgress({loaded:Pe,total:He})}}}e.onDownloadProgress&&(ke.onDownloadProgress=e.onDownloadProgress),e.DataType&&(ke.dataType=e.DataType),this.options.Timeout&&(ke.timeout=this.options.Timeout),n.options.ForcePathStyle&&(ke.pathStyle=n.options.ForcePathStyle),n.emit("before-send",ke);var $e=ke.url.includes("accelerate."),st=ke.qs?Object.keys(ke.qs).map(function(De){return"".concat(De,"=").concat(ke.qs[De])}).join("&"):"",it=st?ke.url+"?"+st:ke.url;e.tracker&&e.tracker.setParams({reqUrl:it,accelerate:$e?"Y":"N"}),e.tracker&&e.tracker.parent&&e.tracker.parent.setParams({reqUrl:it,accelerate:$e?"Y":"N"});var et=(n.options.Request||x)(ke,function(De){if(!(De&&De.error==="abort")){var Pe={options:ke,error:De&&De.error,statusCode:De&&De.statusCode||0,statusMessage:De&&De.statusMessage||"",headers:De&&De.headers||{},body:De&&De.body};n.emit("after-receive",Pe);var ze=Pe.error,Ke=Pe.body,nt={statusCode:Pe.statusCode,statusMessage:Pe.statusMessage,headers:Pe.headers},pt,ut=function(ft,gt){if(f&&n.off("inner-kill-task",at),!pt){pt=!0;var ht={};nt&&nt.statusCode&&(ht.statusCode=nt.statusCode),nt&&nt.headers&&(ht.headers=nt.headers),ft?(ft=l.extend(ft||{},ht),g(ft,null)):(gt=l.extend(gt||{},ht),g(null,gt)),et=null}};if(ze)return ut(l.error(ze));var lt=nt.statusCode,vt=Math.floor(lt/100)===2;if(Ae&&vt)return ut(null,{body:Ke});var ct;try{ct=Ke&&Ke.indexOf("<")>-1&&Ke.indexOf(">")>-1&&l.xml2json(Ke)||{}}catch(yt){ct={}}var dt=ct&&ct.Error;vt?ut(null,ct):dt?ut(l.error(new Error(dt.Message),{code:dt.Code,error:dt})):lt?ut(l.error(new Error(nt.statusMessage),{code:""+lt})):lt&&ut(l.error(new Error("statusCode error")))}}),at=function De(Pe){Pe.TaskId===f&&(et&&et.abort&&et.abort(),n.off("inner-kill-task",De))};f&&n.on("inner-kill-task",at)}}var Qe={getService:T,putBucket:U,headBucket:K,getBucket:O,deleteBucket:I,putBucketAcl:z,getBucketAcl:q,putBucketCors:X,getBucketCors:F,deleteBucketCors:L,getBucketLocation:$,getBucketPolicy:ee,putBucketPolicy:Y,deleteBucketPolicy:B,putBucketTagging:m,getBucketTagging:C,deleteBucketTagging:V,putBucketLifecycle:y,getBucketLifecycle:M,deleteBucketLifecycle:j,putBucketVersioning:w,getBucketVersioning:D,putBucketReplication:A,getBucketReplication:N,deleteBucketReplication:G,putBucketWebsite:W,getBucketWebsite:Z,deleteBucketWebsite:ie,putBucketReferer:le,getBucketReferer:ae,putBucketDomain:oe,getBucketDomain:de,deleteBucketDomain:ue,putBucketOrigin:me,getBucketOrigin:te,deleteBucketOrigin:re,putBucketLogging:pe,getBucketLogging:Ce,putBucketInventory:ye,postBucketInventory:Se,getBucketInventory:xe,listBucketInventory:Ee,deleteBucketInventory:Ie,putBucketAccelerate:we,getBucketAccelerate:_e,putBucketEncryption:je,getBucketEncryption:Ue,deleteBucketEncryption:se,getObject:o,headObject:d,listObjectVersions:i,putObject:a,deleteObject:v,getObjectAcl:R,putObjectAcl:P,optionsObject:J,putObjectCopy:fe,deleteMultipleObject:Q,restoreObject:Te,putObjectTagging:Ne,getObjectTagging:Fe,deleteObjectTagging:Be,selectObjectContent:Le,appendObject:tt,uploadPartCopy:ge,multipartInit:Ve,multipartUpload:Ge,multipartComplete:We,multipartList:qe,multipartListPart:Xe,multipartAbort:Ye,request:ot,getObjectUrl:c,getAuth:rt};function Ze(e,g,n){l.each(["Cors","Acl"],function(f){if(e.slice(-f.length)===f){var k=e.slice(0,-f.length)+f.toUpperCase(),S=l.apiWrapper(e,g),E=!1;n[k]=function(){!E&&console.warn("warning: cos."+k+" has been deprecated. Please Use cos."+e+" instead."),E=!0,S.apply(this,arguments)}}})}r.exports.init=function(e,g){g.transferToTaskMethod(Qe,"putObject"),l.each(Qe,function(n,f){e.prototype[f]=l.apiWrapper(f,n),Ze(f,n,e.prototype)})}},"./src/cos.js":function(r,p,s){var u=s("./src/util.js"),x=s("./src/event.js"),l=s("./src/task.js"),T=s("./src/base.js"),U=s("./src/advance.js"),K=s("./package.json"),O={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:""},I=function(q){this.options=u.extend(u.clone(O),q||{}),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格式错误,请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误,请检查"),console.error("error: SecretKey format is incorrect. Please check")),u.isNode()&&(console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用,请改用 cos-nodejs-sdk-v5,参考文档: 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")),x.init(this),l.init(this)};T.init(I,l),U.init(I,l),I.util={md5:u.md5,xml2json:u.xml2json,json2xml:u.json2xml,encodeBase64:u.encodeBase64},I.getAuthorization=u.getAuth,I.version=K.version,r.exports=I},"./src/event.js":function(r,p){var s=function(l){var T={},U=function(O){return!T[O]&&(T[O]=[]),T[O]};l.on=function(K,O){K==="task-list-update"&&console.warn('warning: Event "'+K+'" has been deprecated. Please use "list-update" instead.'),U(K).push(O)},l.off=function(K,O){for(var I=U(K),z=I.length-1;z>=0;z--)O===I[z]&&I.splice(z,1)},l.emit=function(K,O){for(var I=U(K).map(function(q){return q}),z=0;z<I.length;z++)I[z](O)}},u=function(){s(this)};r.exports.init=s,r.exports.EventProxy=u},"./src/session.js":function(r,p,s){var u=s("./src/util.js"),x="cos_sdk_upload_cache",l=30*24*3600,T,U,K=function(){try{var F=JSON.parse(localStorage.getItem(x))}catch(L){}F||(F=[]),T=F},O=function(){try{T.length?localStorage.setItem(x,JSON.stringify(T)):localStorage.removeItem(x)}catch(F){}},I=function(){if(!T){K.call(this);for(var F=!1,L=Math.round(Date.now()/1e3),$=T.length-1;$>=0;$--){var Y=T[$][2];(!Y||Y+l<L)&&(T.splice($,1),F=!0)}F&&O()}},z=function(){U||(U=setTimeout(function(){O(),U=null},400))},q={using:{},setUsing:function(F){q.using[F]=!0},removeUsing:function(F){delete q.using[F]},getFileId:function(F,L,$,Y){return F.name&&F.size&&F.lastModifiedDate&&L?u.md5([F.name,F.size,F.lastModifiedDate,L,$,Y].join("::")):null},getCopyFileId:function(F,L,$,Y,ee){var B=L["content-length"],m=L.etag||"",C=L["last-modified"];return F&&$?u.md5([F,B,m,C,$,Y,ee].join("::")):null},getUploadIdList:function(F){if(!F)return null;I.call(this);for(var L=[],$=0;$<T.length;$++)T[$][0]===F&&L.push(T[$][1]);return L.length?L:null},saveUploadId:function(F,L,$){if(I.call(this),!!F){for(var Y=T.length-1;Y>=0;Y--){var ee=T[Y];ee[0]===F&&ee[1]===L&&T.splice(Y,1)}T.unshift([F,L,Math.round(Date.now()/1e3)]),T.length>$&&T.splice($),z()}},removeUploadId:function(F){I.call(this),delete q.using[F];for(var L=T.length-1;L>=0;L--)T[L][1]===F&&T.splice(L,1);z()}};r.exports=q},"./src/task.js":function(r,p,s){var u=s("./src/session.js"),x=s("./src/util.js"),l={},T=function(O,I){l[I]=O[I],O[I]=function(z,q){z.SkipTask?l[I].call(this,z,q):this._addTask(I,z,q)}},U=function(O){var I=[],z={},q=0,X=0,F=function(C){var V={id:C.id,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath,state:C.state,loaded:C.loaded,size:C.size,speed:C.speed,percent:C.percent,hashPercent:C.hashPercent,error:C.error};return C.FilePath&&(V.FilePath=C.FilePath),C._custom&&(V._custom=C._custom),V},L=function(){var m,C=function(){m=0,O.emit("task-list-update",{list:x.map(I,F)}),O.emit("list-update",{list:x.map(I,F)})};return function(){m||(m=setTimeout(C))}}(),$=function(){if(!(I.length<=O.options.UploadQueueSize)){for(var C=0;C<X&&C<I.length&&I.length>O.options.UploadQueueSize;){var V=I[C].state==="waiting"||I[C].state==="checking"||I[C].state==="uploading";!I[C]||!V?(z[I[C].id]&&delete z[I[C].id],I.splice(C,1),X--):C++}L()}},Y=function m(){if(!(q>=O.options.FileParallelLimit)){for(;I[X]&&I[X].state!=="waiting";)X++;if(!(X>=I.length)){var C=I[X];X++,q++,C.state="checking",C.params.onTaskStart&&C.params.onTaskStart(F(C)),!C.params.UploadData&&(C.params.UploadData={});var V=x.formatParams(C.api,C.params);l[C.api].call(O,V,function(y,M){O._isRunningTask(C.id)&&((C.state==="checking"||C.state==="uploading")&&(C.state=y?"error":"success",y&&(C.error=y),q--,L(),m(),C.callback&&C.callback(y,M),C.state==="success"&&(C.params&&(delete C.params.UploadData,delete C.params.Body,delete C.params),delete C.callback)),$())}),L(),setTimeout(m)}}},ee=function(C,V){var y=z[C];if(y){var M=y&&y.state==="waiting",j=y&&(y.state==="checking"||y.state==="uploading");if(V==="canceled"&&y.state!=="canceled"||V==="paused"&&M||V==="paused"&&j){if(V==="paused"&&y.params.Body&&typeof y.params.Body.pipe=="function"){console.error("stream not support pause");return}y.state=V,O.emit("inner-kill-task",{TaskId:C,toState:V});try{var w=y&&y.params&&y.params.UploadData.UploadId}catch(D){}V==="canceled"&&w&&u.removeUsing(w),L(),j&&(q--,Y()),V==="canceled"&&(y.params&&(delete y.params.UploadData,delete y.params.Body,delete y.params),delete y.callback)}$()}};O._addTasks=function(m){x.each(m,function(C){O._addTask(C.api,C.params,C.callback,!0)}),L()};var B=!0;O._addTask=function(m,C,V,y){C=x.formatParams(m,C);var M=x.uuid();C.TaskId=M,C.onTaskReady&&C.onTaskReady(M),C.TaskReady&&(C.TaskReady(M),B&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),B=!1);var j={params:C,callback:V,api:m,index:I.length,id:M,Bucket:C.Bucket,Region:C.Region,Key:C.Key,FilePath:C.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:C._custom},w=C.onHashProgress;C.onHashProgress=function(A){O._isRunningTask(j.id)&&(j.hashPercent=A.percent,w&&w(A),L())};var D=C.onProgress;return C.onProgress=function(A){O._isRunningTask(j.id)&&(j.state==="checking"&&(j.state="uploading"),j.loaded=A.loaded,j.speed=A.speed,j.percent=A.percent,D&&D(A),L())},x.getFileSize(m,C,function(A,N){if(A)return V(x.error(A));z[M]=j,I.push(j),j.size=N,!y&&L(),Y(),$()}),M},O._isRunningTask=function(m){var C=z[m];return!!(C&&(C.state==="checking"||C.state==="uploading"))},O.getTaskList=function(){return x.map(I,F)},O.cancelTask=function(m){ee(m,"canceled")},O.pauseTask=function(m){ee(m,"paused")},O.restartTask=function(m){var C=z[m];C&&(C.state==="paused"||C.state==="error")&&(C.state="waiting",L(),X=Math.min(X,C.index),Y())},O.isUploadRunning=function(){return q||X<I.length}};r.exports.transferToTaskMethod=T,r.exports.init=U},"./src/tracker.js":function(r,p,s){var u=s("./node_modules/@babel/runtime/helpers/classCallCheck.js"),x=s("./node_modules/@babel/runtime/helpers/createClass.js"),l=s("./node_modules/@babel/runtime/helpers/typeof.js"),T=s("./package.json"),U=null,K=function(m){if(!U){var C=s("./lib/beacon.min.js");U=new C({appkey:"0AND0VEVB24UBGDU",versionCode:T.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:m,sessionDuration:60*1e3})}return U},O={getUid:function(){var m=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return m()+m()+"-"+m()+"-"+m()+"-"+m()+"-"+m()+m()+m()},getNetType:function(){if((typeof navigator>"u"?"undefined":l(navigator))==="object"){var m=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(m==null?void 0:m.type)||(m==null?void 0:m.effectiveType)||"unknown"}return"unknown"},getOsType:function(){if((typeof navigator>"u"?"undefined":l(navigator))!=="object")return"unknown os";var m=navigator.userAgent.toLowerCase(),C=/macintosh|mac os x/i.test(navigator.userAgent);return m.indexOf("win32")>=0||m.indexOf("wow32")>=0?"win32":m.indexOf("win64")>=0||m.indexOf("wow64")>=0?"win64":C?"mac":"unknown os"},isMobile:function(){var m=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!!((typeof navigator>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isAndroid:function(){var m=/(Android|Adr|Linux)/i;return!!((typeof navigator>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isIOS:function(){var m=/(iPhone|iPod|iPad|iOS)/i;return!!((typeof navigator>"u"?"undefined":l(navigator))==="object"&&navigator.userAgent.match(m))},isOtherMobile:function(){return isMobile&&!isAndroid&&!isIOS},getDeviceName:function(){if((typeof navigator>"u"?"undefined":l(navigator))!=="object")return"unknown device";var m=navigator.userAgent.toLowerCase();if(m.includes("app/tencent_wemeet"))return"tencent_wemeet";if(m.indexOf("maxthon")>=0){var C=m.match(/maxthon\/([\d.]+)/),V=C&&C[1]||"";return"傲游浏览器 ".concat(V).trim()}if(m.indexOf("qqbrowser")>=0){var y=m.match(/qqbrowser\/([\d.]+)/),M=y&&y[1]||"";return"QQ浏览器 ".concat(M).trim()}if(m.indexOf("se 2.x")>=0)return"搜狗浏览器";if(m.indexOf("wxwork")>=0)return"微信内置浏览器";if(m.indexOf("msie")>=0){var j=m.match(/msie ([\d.]+)/),w=j&&j[1]||"";return"IE ".concat(w).trim()}if(m.indexOf("firefox")>=0){var D=m.match(/firefox\/([\d.]+)/),A=D&&D[1]||"";return"Firefox ".concat(A).trim()}if(m.indexOf("chrome")>=0){var N=m.match(/chrome\/([\d.]+)/),G=N&&N[1]||"";return"Chrome ".concat(G).trim()}if(m.indexOf("opera")>=0){var W=m.match(/opera.([\d.]+)/),Z=W&&W[1]||"";return"Opera ".concat(Z).trim()}if(m.indexOf("safari")>=0){var ie=m.match(/version\/([\d.]+)/),le=ie&&ie[1]||"";return"Safari ".concat(le).trim()}if(m.indexOf("edge")>=0){var ae=m.match(/edge\/([\d.]+)/),oe=ae&&ae[1]||"";return"edge ".concat(oe).trim()}return m.substr(0,200)}},I={isMobile:O.isMobile(),isBrowser:!O.isMobile(),mobileOsType:O.isAndroid()?"android":O.isIOS?"ios":"other_mobile",pcOsType:O.getOsType()},z={deviceType:I.isMobile?"mobile":I.isBrowser?"browser":"unknown",devicePlatform:I.isMobile?I.mobileOsType:I.pcOsType,deviceName:O.getDeviceName()},q=["multipartInit","multipartUpload","multipartComplete","multipartList","multipartListPart","multipartAbort"],X=["putObject","postObject","appendObject","sliceUploadFile","uploadFile","uploadFiles"].concat(q),F=["getObject"];function L(B){return X.includes(B)?"cos_upload":F.includes(B)?"cos_download":"base_service"}function $(B){return B.replace(/([A-Z])/g,"_$1").toLowerCase()}function Y(B){var m={},C=["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"],V=["tracePlatform","cossdkVersion","region","bucket","appid","networkType","host","accelerate","requestPath","partNumber","size","name","result","tookTime","errorRequestId","retryTimes","reqUrl","customId","deviceType","devicePlatform","deviceName"],y=B.result==="Success"?V:C;for(var M in B)if(y.includes(M)){var j=$(M);m[j]=B[M]}return m}var ee=function(){function B(m){u(this,B);var C=m.parent,V=m.traceId,y=m.bucket,M=m.region,j=m.apiName,w=m.fileKey,D=m.fileSize,A=m.accelerate,N=m.customId,G=m.delay,W=m.deepTracker,Z=y&&y.substr(y.lastIndexOf("-")+1)||"";this.parent=C,this.deepTracker=W,this.delay=G,this.params={cossdkVersion:T.version,region:M,networkType:"",host:"",accelerate:A?"Y":"N",requestPath:w||"",size:D||-1,httpMd5:0,httpSign:0,httpFull:0,name:j||"",result:"",tookTime:0,errorNode:"",errorCode:"",errorMessage:"",errorRequestId:"",errorStatusCode:0,errorServiceName:"",tracePlatform:"cos-js-sdk-v5",traceId:V||O.getUid(),bucket:y,appid:Z,partNumber:0,retryTimes:0,reqUrl:"",customId:N||"",deviceType:z.deviceType,devicePlatform:z.devicePlatform,deviceName:z.deviceName,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:new Date().getTime(),endTime:0},this.beacon=K(G)}return x(B,[{key:"formatResult",value:function(C,V){var y,M,j,w,D,A,N=new Date().getTime(),G=N-this.params.startTime,W=O.getNetType(),Z=C?(C==null?void 0:C.code)||(C==null||(y=C.error)===null||y===void 0?void 0:y.code)||(C==null||(M=C.error)===null||M===void 0?void 0:M.Code):"",ie=C?(C==null?void 0:C.message)||(C==null||(j=C.error)===null||j===void 0?void 0:j.message)||(C==null||(w=C.error)===null||w===void 0?void 0:w.Message):"",le=C?(C==null?void 0:C.resource)||(C==null||(D=C.error)===null||D===void 0?void 0:D.resource)||(C==null||(A=C.error)===null||A===void 0?void 0:A.Resource):"",ae=C?C==null?void 0:C.statusCode:V.statusCode,oe=C?(C==null?void 0:C.headers)&&(C==null?void 0:C.headers["x-cos-request-id"]):(V==null?void 0:V.headers)&&(V==null?void 0:V.headers["x-cos-request-id"]),de=C?oe?"Server":"Client":"";if(Object.assign(this.params,{tookTime:G,networkType:W,httpMd5:this.params.md5EndTime-this.params.md5StartTime,httpSign:this.params.signEndTime-this.params.signStartTime,httpFull:this.params.httpEndTime-this.params.httpStartTime,result:C?"Fail":"Success",errorType:de,errorCode:Z,errorStatusCode:ae,errorMessage:ie,errorServiceName:le,errorRequestId:oe}),C&&(!Z||!ie)&&(this.params.fullError=C?JSON.stringify(C):""),this.params.name==="getObject"&&(this.params.size=V?V.headers&&V.headers["content-length"]:-1),this.params.reqUrl)try{var ue=/^http(s)?:\/\/(.*?)\//.exec(this.params.reqUrl);this.params.host=ue[2]}catch(me){this.params.host=this.params.reqUrl}this.sendEvents()}},{key:"setParams",value:function(C){Object.assign(this.params,C)}},{key:"sendEvents",value:function(){if(!(q.includes(this.params.name)&&!this.deepTracker)){var C=L(this.params.name),V=Y(this.params);this.beacon||(this.beacon=K(this.delay||5e3)),this.delay===0?this.beacon&&this.beacon.onDirectUserAction(C,V):this.beacon&&this.beacon.onUserAction(C,V)}}},{key:"generateSubTracker",value:function(C){return Object.assign(C,{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(C)}}]),B}();r.exports=ee},"./src/util.js":function(r,p,s){(function(u){var x=s("./node_modules/@babel/runtime/helpers/typeof.js"),l=s("./lib/md5.js"),T=s("./lib/crypto.js"),U=s("./lib/xml2json.js"),K=s("./lib/json2xml.js"),O=s("./lib/base64.js"),I=s("./src/tracker.js");function z(se){return encodeURIComponent(se).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function q(se,d){var i=[];for(var o in se)se.hasOwnProperty(o)&&i.push(d?z(o).toLowerCase():o);return i.sort(function(a,v){return a=a.toLowerCase(),v=v.toLowerCase(),a===v?0:a>v?1:-1})}var X=function(d,i){var o,a,v,R=[],P=q(d);for(o=0;o<P.length;o++)a=P[o],v=d[a]===void 0||d[a]===null?"":""+d[a],a=i?z(a).toLowerCase():z(a),v=z(v)||"",R.push(a+"="+v);return R.join("&")},F=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding"],L=function(d){var i={};for(var o in d){var a=o.toLowerCase();(a.indexOf("x-cos-")>-1||F.indexOf(a)>-1)&&(i[o]=d[o])}return i},$=function(d){d=d||{};var i=d.SecretId,o=d.SecretKey,a=d.KeyTime,v=(d.method||d.Method||"get").toLowerCase(),R=N(d.Query||d.params||{}),P=L(N(d.Headers||d.headers||{})),J=d.Key||"",fe;d.UseRawKey?fe=d.Pathname||d.pathname||"/"+J:(fe=d.Pathname||d.pathname||J,fe.indexOf("/")!==0&&(fe="/"+fe));var ge=d.ForceSignHost!==!1;if(!P.Host&&!P.host&&d.Bucket&&d.Region&&ge&&(P.Host=d.Bucket+".cos."+d.Region+".myqcloud.com"),!i)throw new Error("missing param SecretId");if(!o)throw new Error("missing param SecretKey");var Q=Math.round(ye(d.SystemClockOffset)/1e3)-1,Te=Q,Ne=d.Expires||d.expires;Ne===void 0?Te+=900:Te+=Ne*1||0;var Fe="sha1",Be=i,Le=a||Q+";"+Te,Ve=a||Q+";"+Te,Ge=q(P,!0).join(";").toLowerCase(),We=q(R,!0).join(";").toLowerCase(),qe=T.HmacSHA1(Ve,o).toString(),Xe=[v,fe,Ue.obj2str(R,!0),Ue.obj2str(P,!0),""].join(`
- `),Ye=["sha1",Le,T.SHA1(Xe).toString(),""].join(`
- `),ot=T.HmacSHA1(Ye,qe).toString(),tt=["q-sign-algorithm="+Fe,"q-ak="+Be,"q-sign-time="+Le,"q-key-time="+Ve,"q-header-list="+Ge,"q-url-param-list="+We,"q-signature="+ot].join("&");return tt},Y=function(d,i,o){var a=i/8,v=d.slice(o,o+a);return new Uint8Array(v).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[i](v)[0]},ee=function(d,i,o,a){var v=d.slice(i,o),R="";return new Uint8Array(v).forEach(function(P){R+=String.fromCharCode(P)}),a&&(R=decodeURIComponent(escape(R))),R},B=function(d){for(var i={},o=ee(d),a={records:[]};d.byteLength;){var v=Y(d,32,0),R=Y(d,32,4),P=v-R-16,J=0,fe;for(d=d.slice(12);J<R;){var ge=Y(d,8,J),Q=ee(d,J+1,J+1+ge),Te=Y(d,16,J+ge+2),Ne=ee(d,J+ge+4,J+ge+4+Te);i[Q]=Ne,J+=ge+4+Te}if(i[":event-type"]==="Records")fe=ee(d,J,J+P,!0),a.records.push(fe);else if(i[":event-type"]==="Stats")fe=ee(d,J,J+P,!0),a.stats=Ue.xml2json(fe).Stats;else if(i[":event-type"]==="error"){var Fe=i[":error-code"],Be=i[":error-message"],Le=new Error(Be);Le.message=Be,Le.name=Le.code=Fe,a.error=Le}d=d.slice(J+P+4)}return{payload:a.records.join(""),body:o}},m=function(d){var i=this.options.CopySourceParser;if(i)return i(d);var o=d.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return o?{Bucket:o[1],Region:o[3],Key:o[7]}:null},C=function(){},V=function(d){var i={};for(var o in d)d.hasOwnProperty(o)&&d[o]!==void 0&&d[o]!==null&&(i[o]=d[o]);return i},y=function(d,i){var o,a=new FileReader;FileReader.prototype.readAsBinaryString?(o=FileReader.prototype.readAsBinaryString,a.onload=function(){i(this.result)}):FileReader.prototype.readAsArrayBuffer?o=function(R){var P="",J=new FileReader;J.onload=function(fe){for(var ge=new Uint8Array(J.result),Q=ge.byteLength,Te=0;Te<Q;Te++)P+=String.fromCharCode(ge[Te]);i(P)},J.readAsArrayBuffer(R)}:console.error("FileReader not support readAsBinaryString"),o.call(a,d)},M=function(){var se=function(o,a){o=o.split("."),a=a.split(".");for(var v=0;v<a.length;v++)if(o[v]!==a[v])return parseInt(o[v])>parseInt(a[v])?1:-1;return 0},d=function(o){if(!o)return!1;var a=(o.match(/Chrome\/([.\d]+)/)||[])[1],v=(o.match(/QBCore\/([.\d]+)/)||[])[1],R=(o.match(/QQBrowser\/([.\d]+)/)||[])[1],P=a&&se(a,"53.0.2785.116")<0&&v&&se(v,"3.53.991.400")<0&&R&&se(R,"9.0.2524.400")<=0||!1;return P};return d(typeof navigator<"u"&&navigator.userAgent)}(),j=function(d,i,o,a,v){var R;if(d.slice?R=d.slice(i,o):d.mozSlice?R=d.mozSlice(i,o):d.webkitSlice&&(R=d.webkitSlice(i,o)),a&&M){var P=new FileReader;P.onload=function(J){R=null,v(new Blob([P.result]))},P.readAsArrayBuffer(R)}else v(R)},w=function(d,i,o,a){o=o||C,d?typeof i=="string"?o(Ue.md5(i,!0)):Blob&&i instanceof Blob?Ue.getFileMd5(i,function(v,R){o(R)},a):o():o()},D=1024*1024,A=function(d,i,o){var a=d.size,v=0,R=l.getCtx(),P=function J(fe){if(fe>=a){var ge=R.digest("hex");i(null,ge);return}var Q=Math.min(a,fe+D);Ue.fileSlice(d,fe,Q,!1,function(Te){y(Te,function(Ne){Te=null,R=R.update(Ne,!0),v+=Ne.length,Ne=null,o&&o({loaded:v,total:a,percent:Math.round(v/a*1e4)/1e4}),J(fe+D)})})};P(0)};function N(se){return oe(se,function(d){return x(d)==="object"&&d!==null?N(d):d})}function G(se,d,i){return se&&d in se?se[d]:i}function W(se,d){return ae(d,function(i,o){se[o]=d[o]}),se}function Z(se){return se instanceof Array}function ie(se,d){for(var i=!1,o=0;o<se.length;o++)if(d===se[o]){i=!0;break}return i}function le(se){return Z(se)?se:[se]}function ae(se,d){for(var i in se)se.hasOwnProperty(i)&&d(se[i],i)}function oe(se,d){var i=Z(se)?[]:{};for(var o in se)se.hasOwnProperty(o)&&(i[o]=d(se[o],o));return i}function de(se,d){var i=Z(se),o=i?[]:{};for(var a in se)se.hasOwnProperty(a)&&d(se[a],a)&&(i?o.push(se[a]):o[a]=se[a]);return o}var ue=function(d){var i,o,a,v="";for(i=0,o=d.length/2;i<o;i++)a=parseInt(d[i*2]+d[i*2+1],16),v+=String.fromCharCode(a);return btoa(v)},me=function(){var d=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return d()+d()+"-"+d()+"-"+d()+"-"+d()+"-"+d()+d()+d()},te=function(d,i){var o=i.Bucket,a=i.Region,v=i.Key,R=this.options.Domain,P=!R||typeof R=="string"&&R.indexOf("{Bucket}")>-1,J=!R||typeof R=="string"&&R.indexOf("{Region}")>-1;if(d.indexOf("Bucket")>-1||d==="deleteMultipleObject"||d==="multipartList"||d==="listObjectVersions"){if(P&&!o)return"Bucket";if(J&&!a)return"Region"}else if(d.indexOf("Object")>-1||d.indexOf("multipart")>-1||d==="sliceUploadFile"||d==="abortUploadTask"){if(P&&!o)return"Bucket";if(J&&!a)return"Region";if(!v)return"Key"}return!1},re=function(d,i){if(i=W({},i),d!=="getAuth"&&d!=="getV4Auth"&&d!=="getObjectUrl"){var o=i.Headers||{};if(i&&x(i)==="object"){(function(){for(var v in i)i.hasOwnProperty(v)&&v.indexOf("x-cos-")>-1&&(o[v]=i[v])})();var a={"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"};Ue.each(a,function(v,R){i[v]!==void 0&&(o[R]=i[v])}),i.Headers=V(o)}}return i},pe=function(d,i){return function(o,a){var v=this;typeof o=="function"&&(a=o,o={}),o=re(d,o);var R;if(v.options.EnableTracker)if(o.calledBySdk==="sliceUploadFile")R=o.tracker&&o.tracker.generateSubTracker({apiName:d});else if(["uploadFile","uploadFiles"].includes(d))R=null;else{var P=-1;o.Body&&(P=typeof o.Body=="string"?o.Body.length:o.Body.size||o.Body.byteLength||-1),R=new I({bucket:o.Bucket,region:o.Region,apiName:d,fileKey:o.Key,fileSize:P,deepTracker:v.options.DeepTracker,customId:v.options.CustomId,delay:v.options.TrackerDelay})}o.tracker=R;var J=function(Be){return Be&&Be.headers&&(Be.headers["x-cos-request-id"]&&(Be.RequestId=Be.headers["x-cos-request-id"]),Be.headers["x-ci-request-id"]&&(Be.RequestId=Be.headers["x-ci-request-id"]),Be.headers["x-cos-version-id"]&&(Be.VersionId=Be.headers["x-cos-version-id"]),Be.headers["x-cos-delete-marker"]&&(Be.DeleteMarker=Be.headers["x-cos-delete-marker"])),Be},fe=function(Be,Le){R&&R.formatResult(Be,Le),a&&a(J(Be),J(Le))},ge=function(){if(d!=="getService"&&d!=="abortUploadTask"){var Be=te.call(v,d,o);if(Be)return"missing param "+Be;if(o.Region){if(v.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(o.Region))return"Region format error."}else{if(o.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(o.Region))return"Region format error."}!v.options.CompatibilityMode&&o.Region.indexOf("-")===-1&&o.Region!=="yfb"&&o.Region!=="default"&&o.Region!=="accelerate"&&console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(o.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(o.Bucket))if(o.AppId)o.Bucket=o.Bucket+"-"+o.AppId;else if(v.options.AppId)o.Bucket=o.Bucket+"-"+v.options.AppId;else return'Bucket should format as "test-1250000000".';o.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete o.AppId)}!v.options.UseRawKey&&o.Key&&o.Key.substr(0,1)==="/"&&(o.Key=o.Key.substr(1))}},Q=ge(),Te=["getAuth","getObjectUrl"].includes(d);if(typeof Promise=="function"&&!Te&&!a)return new Promise(function(Fe,Be){if(a=function(Ve,Ge){Ve?Be(Ve):Fe(Ge)},Q)return fe(Ue.error(new Error(Q)));i.call(v,o,fe)});if(Q)return fe(Ue.error(new Error(Q)));var Ne=i.call(v,o,fe);if(Te)return Ne}},Ce=function(d,i){var o=this,a=0,v=0,R=Date.now(),P,J;function fe(){if(J=0,i&&typeof i=="function"){P=Date.now();var ge=Math.max(0,Math.round((v-a)/((P-R)/1e3)*100)/100)||0,Q;v===0&&d===0?Q=1:Q=Math.floor(v/d*100)/100||0,R=P,a=v;try{i({loaded:v,total:d,speed:ge,percent:Q})}catch(Te){}}}return function(ge,Q){if(ge&&(v=ge.loaded,d=ge.total),Q)clearTimeout(J),fe();else{if(J)return;J=setTimeout(fe,o.options.ProgressInterval)}}},ve=function(d,i,o){var a;if(typeof i.Body=="string"?i.Body=new Blob([i.Body],{type:"text/plain"}):i.Body instanceof ArrayBuffer&&(i.Body=new Blob([i.Body])),i.Body&&(i.Body instanceof Blob||i.Body.toString()==="[object File]"||i.Body.toString()==="[object Blob]"))a=i.Body.size;else{o(Ue.error(new Error("params body format error, Only allow File|Blob|String.")));return}i.ContentLength=a,o(null,a)},ye=function(d){return Date.now()+(d||0)},Se=function(d,i){var o=d;return d.message=d.message||null,typeof i=="string"?(d.error=i,d.message=i):x(i)==="object"&&i!==null&&(W(d,i),(i.code||i.name)&&(d.code=i.code||i.name),i.message&&(d.message=i.message),i.stack&&(d.stack=i.stack)),typeof Object.defineProperty=="function"&&(Object.defineProperty(d,"name",{writable:!0,enumerable:!1}),Object.defineProperty(d,"message",{enumerable:!0})),d.name=i&&i.name||d.name||d.code||"Error",d.code||(d.code=d.name),d.error||(d.error=N(o)),d},xe=function(){return(typeof globalThis>"u"?"undefined":x(globalThis))==="object"&&(globalThis.constructor.name==="DedicatedWorkerGlobalScope"||globalThis.FileReaderSync)},Ee=function(){return(typeof window>"u"?"undefined":x(window))!=="object"&&(typeof u>"u"?"undefined":x(u))==="object"&&!0&&!xe()},Ie=function(d){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(d)},we=function(){if((typeof navigator>"u"?"undefined":x(navigator))!=="object")return!1;var se=navigator.userAgent,d=!!se.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return d}(),_e=function(){return(typeof navigator>"u"?"undefined":x(navigator))!=="object"?!1:/\sQQ/i.test(navigator.userAgent)}(),je=function(d,i){var o=O.encode(d);return i&&(o=o.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),o},Ue={noop:C,formatParams:re,apiWrapper:pe,xml2json:U,json2xml:K,md5:l,clearKey:V,fileSlice:j,getBodyMd5:w,getFileMd5:A,b64:ue,extend:W,isArray:Z,isInArray:ie,makeArray:le,each:ae,map:oe,filter:de,clone:N,attr:G,uuid:me,camSafeUrlEncode:z,throttleOnProgress:Ce,getFileSize:ve,getSkewTime:ye,error:Se,obj2str:X,getAuth:$,parseSelectPayload:B,getSourceParams:m,isBrowser:!0,isNode:Ee,isCIHost:Ie,isIOS_QQ:we&&_e,encodeBase64:je};r.exports=Ue}).call(this,s("./node_modules/process/browser.js"))}})})})(cosJsSdkV5);const COS=getDefaultExportFromCjs(cosJsSdkV5Exports),ossSwitch="tencent",tencentBucket="daya-online-1303457149",getUploadSign=async r=>{const{bucketName:p,filename:s,postData:u}=r,x=ossSwitch;let l=p,T=s,U={};return l=tencentBucket,T="gym/"+s,U={key:"gym/"+u.key},request.post("/api-web/getUploadSign",{data:{postData:U,pluginName:x,bucketName:l,filename:T},params:{pluginName:x}})},onOnlyFileUpload=async(r,p)=>{{let s="",u=null;if(console.log(p,"params"),await new COS({Domain:"https://oss.dayaedu.com",getAuthorization:async(l,T)=>{T({Authorization:p.signature})}}).uploadFile({Bucket:tencentBucket,Region:"ap-nanjing",Key:`gym/${p.name}`,Body:p.file,SliceSize:1024*1024*500}).then(l=>{var T;((T=l.Location)==null?void 0:T.indexOf("http"))>=0?s=l.Location:s="https://"+l.Location}).catch(l=>{u=l}),s)return s;throw new Error(u)}},MUploader=defineComponent({name:"col-upload",props:{modelValue:{type:Array,default:()=>[]},deletable:{type:Boolean,default:!0},maxCount:{type:Number,default:1},native:{type:Boolean,default:!1},uploadSize:{type:Number,default:5},uploadType:{type:String,default:"IMAGE"},accept:{type:String,default:"image/*"},bucket:{type:String,default:"gyt"},path:{type:String,default:""},uploadIcon:{type:String,default:iconUploader},size:{type:String,default:"default"},disabled:{type:Boolean,default:!1},position:{type:String,default:"outside"}},emits:["uploadChange","update:modelValue"],methods:{nativeUpload(){if(this.disabled)return;const r=this.uploadType==="VIDEO"?"video":"img";let p=1;this.maxCount>1?p=this.maxCount-this.modelValue.length:p=this.maxCount,postMessage({api:"chooseFile",content:{type:r,max:p,bucket:this.bucket,path:this.path}},s=>{if(console.log(s,"fileUrl"),this.maxCount>1){const u=s.fileUrl;console.log(u,"files"),this.$emit("update:modelValue",[...this.modelValue,...u.split(",")]),this.$emit("uploadChange",[...this.modelValue,...u.split(",")])}else this.$emit("update:modelValue",[s.fileUrl]),this.$emit("uploadChange",[s.fileUrl])})},beforeRead(r){return console.log(r,"beforeRead"),r.size/1024/1024<this.uploadSize?!0:(showToast(`上传文件大小不能超过 ${this.uploadSize}MB`),!1)},beforeDelete(){return!0},async afterRead(r){try{r.status="uploading",r.message="上传中...",await this.uploadFile(r.file)}catch(p){closeToast()}},onClose(r,p){const s=this.modelValue,u=s.findIndex(x=>x==p);u>-1&&(s.splice(u,1),this.$emit("update:modelValue",s),this.$emit("uploadChange")),r.stopPropagation()},async getFile(r){try{await this.uploadFile(r)}catch(p){}},async uploadFile(r){try{const p=r.name||"",s=this.path?this.path+"/"+(p&&p.replace(/ /gi,"_")):p&&p.replace(/ /gi,"_"),u=new Date().getTime()+s;console.log(r);const{data:x}=await getUploadSign({filename:u,bucketName:this.bucket,postData:{filename:u,acl:"public-read",key:u,unknowValueField:[]}});showLoadingToast({message:"加载中...",forbidClick:!0,loadingType:"spinner",duration:0});const l={policy:x.policy,signature:x.signature,key:u,KSSAccessKeyId:x.kssAccessKeyId,acl:"public-read",name:u,file:r},T=await onOnlyFileUpload(getOssUploadUrl(this.bucket),l);closeToast(),this.maxCount>1?(this.$emit("update:modelValue",[...this.modelValue,T]),this.$emit("uploadChange",[...this.modelValue,T])):(this.$emit("update:modelValue",[T]),this.$emit("uploadChange",[T]))}catch(p){console.log(p,"uploadFile")}}},render(){return useCustomFieldValue(()=>this.modelValue),createVNode("div",{class:styles["uploader-section"]},[this.modelValue.length>0&&this.maxCount>1&&this.modelValue.map(r=>createVNode("div",{class:["van-uploader",styles.uploader,styles[this.size]]},[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:styles["img-close"]},null),createVNode("div",{class:["van-uploader__upload"]},[this.uploadType==="IMAGE"?createVNode(Image,{src:r,class:styles.previewImg,fit:"cover"},null):createVNode("video",{ref:"videoUpload",style:{backgroundColor:"#F8F8F8"},class:styles.previewImg,poster:iconVideoDefault,src:r+"#t=1,4"},null)])])),this.native?this.maxCount>1?this.modelValue.length<this.maxCount&&createVNode("div",{class:["van-uploader",styles.uploader,styles[this.size]],onClick:this.nativeUpload},[createVNode(Icon,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):createVNode("div",{class:["van-uploader",styles.uploader,styles[this.size]],onClick:this.nativeUpload},[this.modelValue.length>0?createVNode("div",{class:["van-uploader__upload"]},[this.modelValue.map(r=>createVNode(Fragment,null,[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:[styles["img-close"],styles.singleImgClose]},null),this.uploadType==="IMAGE"?createVNode(Image,{fit:"cover",position:"center",class:styles.uploadImg,src:r},null):createVNode("video",{ref:"videoUpload",class:styles.uploadImg,style:{backgroundColor:"#F8F8F8"},poster:iconVideoDefault,src:r+"#t=1,4"},null)]))]):createVNode(Icon,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]):this.maxCount>1?this.modelValue.length<this.maxCount&&createVNode(Uploader,{class:["van-uploader",styles.uploader,styles[this.size]],afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete,uploadIcon:this.uploadIcon,maxCount:this.maxCount,disabled:this.disabled,accept:this.accept},null):createVNode(Uploader,{class:["van-uploader",styles.uploader,styles[this.size]],afterRead:this.afterRead,beforeRead:this.beforeRead,beforeDelete:this.beforeDelete,uploadIcon:this.uploadIcon,accept:this.accept,disabled:this.disabled},{default:()=>[this.modelValue.length>0?createVNode("div",{class:["van-uploader__upload"]},[this.modelValue.map(r=>createVNode(Fragment,null,[this.deletable&&!this.disabled&&createVNode(Icon,{name:"cross",onClick:p=>this.onClose(p,r),class:[styles["img-close"],styles.singleImgClose]},null),this.uploadType==="IMAGE"?createVNode(Image,{fit:"cover",position:"center",class:styles.uploadImg,src:r},null):createVNode("video",{ref:"videoUpload",class:styles.uploadImg,style:{backgroundColor:"#F8F8F8"},poster:iconVideoDefault,src:r+"#t=1,4"},null)]))]):createVNode(Icon,{name:this.uploadIcon,class:["van-uploader__upload"],size:"32"},null)]}),this.$slots.default&&this.$slots.default()])}});export{MUploader as M,Uploader as U,iconUploader as a,getUploadSign as g,iconVideoDefault as i,onOnlyFileUpload as o,styles as s};
|