bmw-form-render 0.0.319 → 0.0.321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dist/{AntiCheating-DwGk4N7c.cjs → AntiCheating-CNmZIedK.cjs} +1 -1
  2. package/dist/{AppointConfig-CF3h4516.cjs → AppointConfig--Xhy3HOV.cjs} +1 -1
  3. package/dist/{BasicInputSetting-pyWaznES.cjs → BasicInputSetting-zAkTkOGI.cjs} +1 -1
  4. package/dist/{BasicSelectSetting-V8ipuyxQ.cjs → BasicSelectSetting-DE0WvA4e.cjs} +1 -1
  5. package/dist/{Button-mzSFkqox.cjs → Button-BADTJTfh.cjs} +1 -1
  6. package/dist/{ButtonConfig-wir8KDei.cjs → ButtonConfig-CVsg82kf.cjs} +1 -1
  7. package/dist/{CacheIcon-DQwXET_g.cjs → CacheIcon-xQuXuu3H.cjs} +1 -1
  8. package/dist/{Carousel-55OFgViX.cjs → Carousel-DMuCqJGt.cjs} +1 -1
  9. package/dist/{CarouselSetting-BzD72AVT.cjs → CarouselSetting-DD8VMB27.cjs} +1 -1
  10. package/dist/{CheckEntrySetting-C1FndF8i.cjs → CheckEntrySetting-DL03F_2e.cjs} +1 -1
  11. package/dist/{CheckboxRange.vue_vue_type_script_setup_true_lang-DmfsxSed.cjs → CheckboxRange.vue_vue_type_script_setup_true_lang-BlVLoJ72.cjs} +1 -1
  12. package/dist/{CheckboxSetting-D8VXc10C.cjs → CheckboxSetting-DdlJ1K7B.cjs} +1 -1
  13. package/dist/{Choice-g18rV-sR.cjs → Choice-DAygLr4o.cjs} +1 -1
  14. package/dist/{Column.vue_vue_type_script_setup_true_lang-DAfdFoj_.cjs → Column.vue_vue_type_script_setup_true_lang-BFkh-Mky.cjs} +1 -1
  15. package/dist/{ColumnNumOption.vue_vue_type_script_setup_true_lang-BMJZfL2u.cjs → ColumnNumOption.vue_vue_type_script_setup_true_lang-BTTmH99c.cjs} +1 -1
  16. package/dist/{CommonRadioSetting-Bo20cQ-E.cjs → CommonRadioSetting-GPBduwT3.cjs} +1 -1
  17. package/dist/{ConfirmCode-9kPzstzF.cjs → ConfirmCode-C_OcLVcb.cjs} +1 -1
  18. package/dist/{ContactUs-CutYdGzv.cjs → ContactUs-8g8OcP2Q.cjs} +1 -1
  19. package/dist/{ContactUs-Cx2Q-ssa.cjs → ContactUs-DPJfcOOD.cjs} +1 -1
  20. package/dist/{ContactUsSetting-oytlqMZD.cjs → ContactUsSetting-wfAjaDkV.cjs} +1 -1
  21. package/dist/{CrowdManagement-D9i-l4sB.cjs → CrowdManagement-Cn7CyaPi.cjs} +1 -1
  22. package/dist/{DataCollectPanel-DVh58lum.cjs → DataCollectPanel-BuAqBb2y.cjs} +1 -1
  23. package/dist/{DataSubmitPanel-Dsab1OAb.cjs → DataSubmitPanel-CFCzSdoF.cjs} +1 -1
  24. package/dist/{DateSetting-Cyh4HLWl.cjs → DateSetting-BFPDCmEM.cjs} +1 -1
  25. package/dist/{DisplayRuleSetting-0KLY2h-h.cjs → DisplayRuleSetting-Bz9zDVpQ.cjs} +1 -1
  26. package/dist/{DynamicTableSetting-CWWVSFji.cjs → DynamicTableSetting-CZ3S_BY_.cjs} +1 -1
  27. package/dist/{EduCheckboxSetting-D7Dx_QZc.cjs → EduCheckboxSetting-BAN2UNka.cjs} +1 -1
  28. package/dist/{EmailInputSetting-BqfURdh8.cjs → EmailInputSetting-CsRXLpAQ.cjs} +1 -1
  29. package/dist/{ExamBar-C1YwMocN.cjs → ExamBar-CPwgP2n1.cjs} +1 -1
  30. package/dist/{FileSetting-CCzpdC98.cjs → FileSetting-BKRruswy.cjs} +1 -1
  31. package/dist/{FillBlank-CSnPZ_rO.cjs → FillBlank-BKbndpNd.cjs} +1 -1
  32. package/dist/{FormProgress-CGhuvoUJ.cjs → FormProgress-4pfvxmju.cjs} +1 -1
  33. package/dist/{GainConfig-Cm6O5V9N.cjs → GainConfig-BUUM1GVC.cjs} +1 -1
  34. package/dist/{Geolocation-CvNBr1P8.cjs → Geolocation-Djd905Kf.cjs} +1 -1
  35. package/dist/{IdCardInputSetting-DS1ND0nl.cjs → IdCardInputSetting-BY9Tkevh.cjs} +1 -1
  36. package/dist/{ImageSetting-CLV7q6R1.cjs → ImageSetting-BCjJi92A.cjs} +1 -1
  37. package/dist/{ImgCard-DeUGq0XV.cjs → ImgCard-CDOgh0-m.cjs} +1 -1
  38. package/dist/{ImgCheckboxSetting-CO0Hu4_W.cjs → ImgCheckboxSetting-DCWjGg-v.cjs} +1 -1
  39. package/dist/{ImgRadioSetting-BO11wmxd.cjs → ImgRadioSetting-Bb_xjuxI.cjs} +1 -1
  40. package/dist/{ImportantOption.vue_vue_type_script_setup_true_lang-C7ndh7xd.cjs → ImportantOption.vue_vue_type_script_setup_true_lang-DZll29q4.cjs} +1 -1
  41. package/dist/{Input-CsJQsPhh.cjs → Input-DYg7TAZ8.cjs} +1 -1
  42. package/dist/{InputTimer-Cm3KUGIM.cjs → InputTimer-DtN3Rm7w.cjs} +1 -1
  43. package/dist/{LengthRangeOption.vue_vue_type_script_setup_true_lang-Wj0v68Zy.cjs → LengthRangeOption.vue_vue_type_script_setup_true_lang-B0x84OCh.cjs} +1 -1
  44. package/dist/{LocationSetting-BmLKG6eU.cjs → LocationSetting-gE4zpOgU.cjs} +1 -1
  45. package/dist/{MapNavSetting-Dj5Z8mHC.cjs → MapNavSetting-BmGUGSxc.cjs} +1 -1
  46. package/dist/{MapNavigation-AfNDK8To.cjs → MapNavigation-4V3afWBx.cjs} +1 -1
  47. package/dist/{MessagePush-BfGXBd-X.cjs → MessagePush-CvwdPdJO.cjs} +1 -1
  48. package/dist/{MultiSelectSetting-CB9LHy62.cjs → MultiSelectSetting-AZjmwWal.cjs} +1 -1
  49. package/dist/{NumRange-D6cdF-eP.cjs → NumRange-ky65rZV2.cjs} +1 -1
  50. package/dist/{NumberFillBlank-L1YLEIvS.cjs → NumberFillBlank-CW9DQCQ2.cjs} +1 -1
  51. package/dist/{NumberInputSetting-D9QkE4Mg.cjs → NumberInputSetting-CYEocP7t.cjs} +1 -1
  52. package/dist/{OcrSetting-CO8kBuvb.cjs → OcrSetting-Ms6PMB6B.cjs} +1 -1
  53. package/dist/{OcrWidget-wF3yH7UU.cjs → OcrWidget-C8soBGST.cjs} +1 -1
  54. package/dist/{OptionRandom.vue_vue_type_script_setup_true_lang-ZRDSfVc6.cjs → OptionRandom.vue_vue_type_script_setup_true_lang-CXbehCtN.cjs} +1 -1
  55. package/dist/{PageHeader-D0NHMXMK.cjs → PageHeader-CjHD6H-I.cjs} +1 -1
  56. package/dist/{PageHeaderSetting-Bn8gt1kp.cjs → PageHeaderSetting-jeiBTuBj.cjs} +1 -1
  57. package/dist/{Pagination-D3CBhgN5.cjs → Pagination-Bb8y5CHn.cjs} +1 -1
  58. package/dist/{PayConfig-mgv880Pe.cjs → PayConfig-CgNX9ZZV.cjs} +1 -1
  59. package/dist/{PayMethod-czgTgLFC.cjs → PayMethod-Cb9YKxrY.cjs} +1 -1
  60. package/dist/{PhoneInputSetting-0CW4dBm2.cjs → PhoneInputSetting-D1-33MDj.cjs} +1 -1
  61. package/dist/{PlaceholderOption.vue_vue_type_script_setup_true_lang-eFwoyqIK.cjs → PlaceholderOption.vue_vue_type_script_setup_true_lang-BYEanYo2.cjs} +1 -1
  62. package/dist/{PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-xA2q_SED.cjs → PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-B4a-WLb-.cjs} +1 -1
  63. package/dist/{PreparerNameSetting-D2Pdcm1v.cjs → PreparerNameSetting-ClCzUY47.cjs} +1 -1
  64. package/dist/{PreparerPhoneInputSetting-CseiA-20.cjs → PreparerPhoneInputSetting-C0vjWesR.cjs} +1 -1
  65. package/dist/{PreparerSetting-CL8HQ5QB.cjs → PreparerSetting-dZiNfGsx.cjs} +1 -1
  66. package/dist/{RadioSetting-xVdBiJv9.cjs → RadioSetting-DPJ5eWU4.cjs} +1 -1
  67. package/dist/{RatingSetting-C78aOu6a.cjs → RatingSetting-C5JZEs8R.cjs} +1 -1
  68. package/dist/{SearchAndShare-DgdvIlRu.cjs → SearchAndShare-DdTu2bGW.cjs} +1 -1
  69. package/dist/{SetpayModal-STls2L4H.cjs → SetpayModal-X8V66oNb.cjs} +1 -1
  70. package/dist/{ShareQRCode-DwnJegl4.cjs → ShareQRCode-BEXzpcsk.cjs} +1 -1
  71. package/dist/{TableSetting-CPkhcMi9.cjs → TableSetting-BQM_P_eR.cjs} +1 -1
  72. package/dist/{TestSettingPanel-C_xLoh8v.cjs → TestSettingPanel-B9xqHDF6.cjs} +1 -1
  73. package/dist/{ViewVoteRate-CyHdBIBU.cjs → ViewVoteRate-Dq_X2HKs.cjs} +1 -1
  74. package/dist/{WatermarkSetting-ByYEwVAw.cjs → WatermarkSetting-C6HylG-G.cjs} +1 -1
  75. package/dist/bmw-form-render.cjs +1 -1
  76. package/dist/{index-CZBdUlB7.cjs → index-1Dr1c6UI.cjs} +1 -1
  77. package/dist/{index-Ai3BQ1gB.cjs → index-BZmcQOLR.cjs} +1 -1
  78. package/dist/{index-CkMIqzAF.cjs → index-CaGXOzZW.cjs} +1 -1
  79. package/dist/{index-CuXsJ5Hs.cjs → index-Cb5vtxa_.cjs} +1 -1
  80. package/dist/{index-CR1kxct6.cjs → index-CzcRcBd0.cjs} +1 -1
  81. package/dist/{index-Ba8YkLGU.cjs → index-DGX2CKA_.cjs} +1 -1
  82. package/dist/{index-CiP-JQy-.cjs → index-DbNMIhP8.cjs} +1 -1
  83. package/dist/{index-B2LdP98-.cjs → index-GEcUVaIG.cjs} +1 -1
  84. package/dist/{main-BJ5jMLtY.cjs → main-DgF763FD.cjs} +11 -11
  85. package/dist/{style-DwfVs0Th.cjs → style-C45Gfh3a.cjs} +1 -1
  86. package/dist/style.css +1 -1
  87. package/dist/{useVipDialog-zzvg2Uab.cjs → useVipDialog-BWhex-Ho.cjs} +1 -1
  88. package/dist/{vue-quill.esm-bundler-DztrbEZt.cjs → vue-quill.esm-bundler-DtoEcxf0.cjs} +1 -1
  89. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./main-BJ5jMLtY.cjs"),ve=r=>(f.pushScopeId("data-v-908bdd1c"),r=r(),f.popScopeId(),r),Le={class:"ocr-uploader"},Te={class:"upload-buttons"},Re=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-camera btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"拍照上传")],-1)),Pe=[Re],De=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-photo-album btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"从相册选择")],-1)),je=[De],Me=f.defineComponent({__name:"OcrUploader",props:{allowCamera:{type:Boolean},allowGallery:{type:Boolean}},emits:["upload"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.ref(),l=f.ref(),p=f.computed(()=>e.allowCamera&&e.allowGallery);f.onMounted(async()=>{if(navigator.userAgent.toLowerCase().includes("micromessenger"))try{const{data:k}=await f.globalInject.$axios.get(`/v1/wxAccount/getWxSign?q=${window.btoa(JSON.stringify({url:window.location.href}))}`);wx.config({debug:!1,appId:k.result.appId,timestamp:k.result.timestamp,nonceStr:k.result.nonceStr,signature:k.result.signature,jsApiList:["chooseImage","getLocalImgData"]}),wx.ready(()=>{console.log("[OcrUploader] wx.ready")}),wx.error(S=>{console.warn("[OcrUploader] wx.config 失败:",S)})}catch{}});function v(C){try{const k=C.split(",");if(k.length<2)return null;const S=k[0].match(/:(.*?);/),A=(S==null?void 0:S[1])||"image/jpeg",x=atob(k[1]),g=x.length,y=new Uint8Array(g);for(let u=0;u<g;u++)y[u]=x.charCodeAt(u);return new File([y],`ocr_${Date.now()}.jpg`,{type:A})}catch{return null}}function a(C){wx.chooseImage({count:1,sizeType:["compressed"],sourceType:C==="camera"?["camera"]:["album"],success(k){const S=k.localIds[0];wx.getLocalImgData({localId:S,success(A){let x=A.localData;x.indexOf("jgp")>-1&&x.indexOf("jpeg")===-1&&(x=x.replace(/\bjgp\b/g,"jpeg")),x.indexOf("data:image")!==0&&(x="data:image/jpeg;base64,"+x);const g=v(x);if(!g){f.ElMessage.error("图片处理失败,请重试");return}if(g.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB");return}o("upload",g)},fail(){f.ElMessage.error("获取图片数据失败,请重试")}})},fail(){}})}async function h(C){var S,A;if(i)return;if(await f.isWxMiniProgram()){a(C);return}C==="camera"?(S=l.value)==null||S.click():(A=t.value)==null||A.click()}function m(C){var x;const k=C.target,S=(x=k.files)==null?void 0:x[0];if(!S)return;if(!["image/jpeg","image/png"].includes(S.type)){f.ElMessage.error("请上传JPG/PNG格式的图片"),k.value="";return}if(S.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB"),k.value="";return}o("upload",S),k.value=""}return(C,k)=>(f.openBlock(),f.createElementBlock("div",Le,[f.createBaseVNode("div",Te,[C.allowCamera!==!1?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[0]||(k[0]=S=>h("camera"))},Pe,2)):f.createCommentVNode("",!0),C.allowGallery!==!1?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[1]||(k[1]=S=>h("gallery"))},je,2)):f.createCommentVNode("",!0)]),f.createBaseVNode("input",{ref_key:"galleryInput",ref:t,type:"file",accept:".jpg,.jpeg,.png",style:{display:"none"},onChange:k[2]||(k[2]=S=>m(S))},null,544),f.createBaseVNode("input",{ref_key:"cameraInput",ref:l,type:"file",accept:".jpg,.jpeg,.png",capture:"environment",style:{display:"none"},onChange:k[3]||(k[3]=S=>m(S))},null,544)]))}}),Ve=f._export_sfc(Me,[["__scopeId","data-v-908bdd1c"]]),$e={key:0,class:"section-header"},He={class:"section-body"},qe={class:"field-cell-pair"},Ne={class:"field-label"},Ge={class:"field-value"},Ke=["onBlur"],Xe={key:1,class:"value-text"},We={key:0,class:"section-header"},Je={class:"section-body"},Ze={class:"field-label field-label-editor"},Ye={class:"field-value"},Qe=["onBlur"],et={key:1,class:"value-text"},tt=f.defineComponent({__name:"OcrResultTable",props:{sections:{},ocrData:{},canEdit:{type:Boolean},ocrType:{},isLanding:{type:Boolean}},emits:["update:field"],setup(r,{emit:n}){const e=n;function o(i,t){const l=t.target;e("update:field",i,l.innerText||"")}return(i,t)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["ocr-result-table",{"landing-layout":i.isLanding}])},[i.isLanding?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",$e,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",He,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{key:v.key,class:"field-row-pair"},[f.createBaseVNode("div",qe,[f.createBaseVNode("div",Ne,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ge,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[0]||(t[0]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Ke)):(f.openBlock(),f.createElementBlock("span",Xe,f.toDisplayString(i.ocrData[v.key]||""),1))])])]))),128))])]))),128)):(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:1},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",We,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",Je,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{class:"field-row",key:v.key},[f.createBaseVNode("div",Ze,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ye,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[1]||(t[1]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Qe)):(f.openBlock(),f.createElementBlock("span",et,f.toDisplayString(i.ocrData[v.key]||""),1))])]))),128))])]))),128))],2))}}),nt=f._export_sfc(tt,[["__scopeId","data-v-61a3a77c"]]);async function rt(r){const{url:n,keys:e,eacb:o}=r,t=(await f.globalInject.$axios.post("/v2/form/ocrRecognize",{eacb:o,url:n,keys:e})).data;if(t.status!==1)throw new Error(t.msg||"OCR 识别失败");const l=t.result;if(!Array.isArray(l)||l.length===0)throw new Error("OCR 识别返回空数据");const p={};for(const{key:v,value:a}of l)v&&(p[v]=a??"");return{fields:p}}var me=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),B;(function(r){r.InvalidFile="InvalidFile",r.InvalidToken="InvalidToken",r.InvalidMetadata="InvalidMetadata",r.InvalidChunkSize="InvalidChunkSize",r.InvalidCustomVars="InvalidCustomVars",r.NotAvailableUploadHost="NotAvailableUploadHost",r.ReadCacheFailed="ReadCacheFailed",r.InvalidCacheData="InvalidCacheData",r.WriteCacheFailed="WriteCacheFailed",r.RemoveCacheFailed="RemoveCacheFailed",r.GetCanvasContextFailed="GetCanvasContextFailed",r.UnsupportedFileType="UnsupportedFileType",r.FileReaderReadFailed="FileReaderReadFailed",r.NotAvailableXMLHttpRequest="NotAvailableXMLHttpRequest",r.InvalidProgressEventTarget="InvalidProgressEventTarget",r.RequestError="RequestError"})(B||(B={}));var E=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),G=function(r){me(n,r);function n(e,o,i,t){var l=r.call(this,B.RequestError,i)||this;return l.code=e,l.reqId=o,l.isRequestError=!0,l.data=t,l}return n}(E),it=function(r){me(n,r);function n(e,o){return o===void 0&&(o=""),r.call(this,0,o,e)||this}return n}(G),ot=function(){function r(n,e){this.runTask=n,this.limit=e,this.aborted=!1,this.queue=[],this.processing=[]}return r.prototype.enqueue=function(n){var e=this;return new Promise(function(o,i){e.queue.push({task:n,resolve:o,reject:i}),e.check()})},r.prototype.run=function(n){var e=this;this.queue=this.queue.filter(function(o){return o!==n}),this.processing.push(n),this.runTask(n.task).then(function(){e.processing=e.processing.filter(function(o){return o!==n}),n.resolve(),e.check()},function(o){return n.reject(o)})},r.prototype.check=function(){var n=this;if(!this.aborted){var e=this.processing.length,o=this.limit-e;this.queue.slice(0,o).forEach(function(i){n.run(i)})}},r.prototype.abort=function(){this.queue=[],this.aborted=!0},r}(),at=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),q=function(){return q=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},q.apply(this,arguments)},st=function(){function r(){this.closed=!1}return r.prototype.unsubscribe=function(){this.closed||(this.closed=!0,this._unsubscribe&&this._unsubscribe())},r.prototype.add=function(n){this._unsubscribe=n},r}(),ut=function(r){at(n,r);function n(e,o,i){var t=r.call(this)||this;return t.isStopped=!1,e&&typeof e=="object"?t.destination=e:t.destination=q(q(q({},e&&{next:e}),o&&{error:o}),i&&{complete:i}),t}return n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},n.prototype.next=function(e){!this.isStopped&&this.destination.next&&this.destination.next(e)},n.prototype.error=function(e){!this.isStopped&&this.destination.error&&(this.isStopped=!0,this.destination.error(e))},n.prototype.complete=function(e){!this.isStopped&&this.destination.complete&&(this.isStopped=!0,this.destination.complete(e))},n}(st),lt=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,o){var i=new ut(n,e,o);return i.add(this._subscribe(i)),i},r}();function ct(r){if(r===null||typeof r>"u")return"";var n=r+"",e="",o,i,t=0;o=i=0,t=n.length;for(var l=0;l<t;l++){var p=n.charCodeAt(l),v=null;if(p<128)i++;else if(p>127&&p<2048)v=String.fromCharCode(p>>6|192,p&63|128);else if((p&63488^55296)>0)v=String.fromCharCode(p>>12|224,p>>6&63|128,p&63|128);else{if((p&64512^55296)>0)throw new RangeError("Unmatched trail surrogate at "+l);var a=n.charCodeAt(++l);if((a&64512^56320)>0)throw new RangeError("Unmatched lead surrogate at "+(l-1));p=((p&1023)<<10)+(a&1023)+65536,v=String.fromCharCode(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}v!==null&&(i>o&&(e+=n.slice(o,i)),e+=v,o=i=l+1)}return i>o&&(e+=n.slice(o,t)),e}function ft(r){var n=[],e=0,o=0,i=0;for(r+="";e<r.length;){o=r.charCodeAt(e)&255,i=0,o<=191?(o=o&127,i=1):o<=223?(o=o&31,i=2):o<=239?(o=o&15,i=3):(o=o&7,i=4);for(var t=1;t<i;++t)o=o<<6|r.charCodeAt(t+e)&63;i===4?(o-=65536,n.push(String.fromCharCode(55296|o>>10&1023)),n.push(String.fromCharCode(56320|o&1023))):n.push(String.fromCharCode(o)),e+=i}return n.join("")}function dt(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r=ct(r+"");do e=r.charCodeAt(h++),o=r.charCodeAt(h++),i=r.charCodeAt(h++),a=e<<16|o<<8|i,t=a>>18&63,l=a>>12&63,p=a>>6&63,v=a&63,k[m++]=n.charAt(t)+n.charAt(l)+n.charAt(p)+n.charAt(v);while(h<r.length);switch(C=k.join(""),r.length%3){case 1:C=C.slice(0,-2)+"==";break;case 2:C=C.slice(0,-1)+"=";break}return C}function ht(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r+="";do t=n.indexOf(r.charAt(h++)),l=n.indexOf(r.charAt(h++)),p=n.indexOf(r.charAt(h++)),v=n.indexOf(r.charAt(h++)),a=t<<18|l<<12|p<<6|v,e=a>>16&255,o=a>>8&255,i=a&255,p===64?k[m++]=String.fromCharCode(e):v===64?k[m++]=String.fromCharCode(e,o):k[m++]=String.fromCharCode(e,o,i);while(h<r.length);return C=k.join(""),ft(C)}function be(r){return r=dt(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function pt(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),ht(r)}var we={exports:{}};(function(r,n){(function(e){r.exports=e()})(function(e){var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(g,y){var u=g[0],s=g[1],d=g[2],c=g[3];u+=(s&d|~s&c)+y[0]-680876936|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[1]-389564586|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[2]+606105819|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[3]-1044525330|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[4]-176418897|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[5]+1200080426|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[6]-1473231341|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[7]-45705983|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[8]+1770035416|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[9]-1958414417|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[10]-42063|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[11]-1990404162|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[12]+1804603682|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[13]-40341101|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[14]-1502002290|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[15]+1236535329|0,s=(s<<22|s>>>10)+d|0,u+=(s&c|d&~c)+y[1]-165796510|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[6]-1069501632|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[11]+643717713|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[0]-373897302|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[5]-701558691|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[10]+38016083|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[15]-660478335|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[4]-405537848|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[9]+568446438|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[14]-1019803690|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[3]-187363961|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[8]+1163531501|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[13]-1444681467|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[2]-51403784|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[7]+1735328473|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[12]-1926607734|0,s=(s<<20|s>>>12)+d|0,u+=(s^d^c)+y[5]-378558|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[8]-2022574463|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[11]+1839030562|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[14]-35309556|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[1]-1530992060|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[4]+1272893353|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[7]-155497632|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[10]-1094730640|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[13]+681279174|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[0]-358537222|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[3]-722521979|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[6]+76029189|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[9]-640364487|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[12]-421815835|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[15]+530742520|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[2]-995338651|0,s=(s<<23|s>>>9)+d|0,u+=(d^(s|~c))+y[0]-198630844|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[7]+1126891415|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[14]-1416354905|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[5]-57434055|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[12]+1700485571|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[3]-1894986606|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[10]-1051523|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[1]-2054922799|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[8]+1873313359|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[15]-30611744|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[6]-1560198380|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[13]+1309151649|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[4]-145523070|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[11]-1120210379|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[2]+718787259|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[9]-343485551|0,s=(s<<21|s>>>11)+d|0,g[0]=u+g[0]|0,g[1]=s+g[1]|0,g[2]=d+g[2]|0,g[3]=c+g[3]|0}function t(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return y}function l(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return y}function p(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,t(g.substring(s-64,s)));for(g=g.substring(s-64),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g.charCodeAt(s)<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function v(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,l(g.subarray(s-64,s)));for(g=s-64<y?g.subarray(s-64):new Uint8Array(0),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g[s]<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function a(g){var y="",u;for(u=0;u<4;u+=1)y+=o[g>>u*8+4&15]+o[g>>u*8&15];return y}function h(g){var y;for(y=0;y<g.length;y+=1)g[y]=a(g[y]);return g.join("")}h(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(y,u){return y=y|0||0,y<0?Math.max(y+u,0):Math.min(y,u)}ArrayBuffer.prototype.slice=function(y,u){var s=this.byteLength,d=g(y,s),c=s,I,F,O,X;return u!==e&&(c=g(u,s)),d>c?new ArrayBuffer(0):(I=c-d,F=new ArrayBuffer(I),O=new Uint8Array(F),X=new Uint8Array(this,d,I),O.set(X),F)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(g,y){var u=g.length,s=new ArrayBuffer(u),d=new Uint8Array(s),c;for(c=0;c<u;c+=1)d[c]=g.charCodeAt(c);return y?d:s}function k(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function S(g,y,u){var s=new Uint8Array(g.byteLength+y.byteLength);return s.set(new Uint8Array(g)),s.set(new Uint8Array(y),g.byteLength),s}function A(g){var y=[],u=g.length,s;for(s=0;s<u-1;s+=2)y.push(parseInt(g.substr(s,2),16));return String.fromCharCode.apply(String,y)}function x(){this.reset()}return x.prototype.append=function(g){return this.appendBinary(m(g)),this},x.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var y=this._buff.length,u;for(u=64;u<=y;u+=64)i(this._hash,t(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},x.prototype.end=function(g){var y=this._buff,u=y.length,s,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c;for(s=0;s<u;s+=1)d[s>>2]|=y.charCodeAt(s)<<(s%4<<3);return this._finish(d,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(g,y){var u=y,s,d,c;if(g[u>>2]|=128<<(u%4<<3),u>55)for(i(this._hash,g),u=0;u<16;u+=1)g[u]=0;s=this._length*8,s=s.toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(s[2],16),c=parseInt(s[1],16)||0,g[14]=d,g[15]=c,i(this._hash,g)},x.hash=function(g,y){return x.hashBinary(m(g),y)},x.hashBinary=function(g,y){var u=p(g),s=h(u);return y?A(s):s},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(g){var y=S(this._buff.buffer,g),u=y.length,s;for(this._length+=g.byteLength,s=64;s<=u;s+=64)i(this._hash,l(y.subarray(s-64,s)));return this._buff=s-64<u?new Uint8Array(y.buffer.slice(s-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(g){var y=this._buff,u=y.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d,c;for(d=0;d<u;d+=1)s[d>>2]|=y[d]<<(d%4<<3);return this._finish(s,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var g=x.prototype.getState.call(this);return g.buff=k(g.buff),g},x.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),x.prototype.setState.call(this,g)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(g,y){var u=v(new Uint8Array(g)),s=h(u);return y?A(s):s},x})})(we);var yt=we.exports;const gt=f.getDefaultExportFromCjs(yt);var J=function(){return J=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},J.apply(this,arguments)},vt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},mt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},D=Math.pow(1024,2);function bt(r,n){var e=n*D;if(e>r.size)e=r.size;else for(;r.size>e*1e4;)e*=2;for(var o=[],i=Math.ceil(r.size/e),t=0;t<i;t++){var l=r.slice(e*t,t===i-1?r.size:e*(t+1));o.push(l)}return o}function wt(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function _t(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function kt(r){return r.reduce(function(n,e){return n+e},0)}function xt(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new E(B.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function Ct(r,n,e){var o=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+o+"size_"+e}function re(r,n){try{localStorage.removeItem(r)}catch{n.warn(new E(B.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function St(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new E(B.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var o=null;try{o=JSON.parse(e)}catch{re(r,n),n.warn(new E(B.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return o}function Y(r){var n="UpToken "+r;return{Authorization:n}}function Bt(r){var n=Y(r);return J({"content-type":"application/octet-stream"},n)}function Et(r){var n=Y(r);return J({"content-type":"application/json"},n)}function _e(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new E(B.NotAvailableXMLHttpRequest,"the current environment does not support.")}function It(r){return vt(this,void 0,void 0,function(){var n,e;return mt(this,function(o){switch(o.label){case 0:return[4,At(r)];case 1:return n=o.sent(),e=new gt.ArrayBuffer,e.append(n),[2,e.end()]}})})}function At(r){return new Promise(function(n,e){var o=new FileReader;o.onload=function(i){if(i.target){var t=i.target.result;n(t)}else e(new E(B.InvalidProgressEventTarget,"progress event target is undefined"))},o.onerror=function(){e(new E(B.FileReaderReadFailed,"fileReader read failed"))},o.readAsArrayBuffer(r)})}function K(r,n){return new Promise(function(e,o){var i=_e();if(i.open(n.method,r),n.onCreate&&n.onCreate(i),n.headers){var t=n.headers;Object.keys(t).forEach(function(l){i.setRequestHeader(l,t[l])})}i.upload.addEventListener("progress",function(l){l.lengthComputable&&n.onProgress&&n.onProgress({loaded:l.loaded,total:l.total})}),i.onreadystatechange=function(){var l=i.responseText;if(i.readyState===4){var p=i.getResponseHeader("x-reqId")||"";if(i.status===0){o(new it("network error.",p));return}if(i.status!==200){var v="xhr request failed, code: "+i.status;l&&(v+=" response: "+l);var a=void 0;try{a=JSON.parse(l)}catch{}o(new G(i.status,p,v,a));return}try{e({data:JSON.parse(l),reqId:p})}catch(h){o(h)}}},i.send(n.body)})}function Ut(r){if(r&&r.match){var n=r.match(/(^https?)/);if(!n)return"";var e=n[1];return n=r.match(/^https?:\/\/([^:^/]*):(\d*)/),n?n[2]:e==="http"?"80":"443"}return""}function Ft(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function ie(r){if(!r)throw new E(B.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new E(B.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new E(B.InvalidToken,"missing assess key field.");var o=null;try{o=JSON.parse(pt(n[n.length-1]))}catch{throw new E(B.InvalidToken,"token parse failed.")}if(o==null)throw new E(B.InvalidToken,"putPolicy is null.");if(o.scope==null)throw new E(B.InvalidToken,"scope field is null.");var i=o.scope.split(":")[0];if(!i)throw new E(B.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:i,scope:o.scope}}var z,P={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},Ot=(z={},z[P.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},z[P.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},z[P.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},z[P.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},z[P.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},z[P.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},z),V=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},zt=function(r,n,e,o){return n=n||"&",e=e||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(i){var t=encodeURIComponent(V(i))+e;return Array.isArray(r[i])?r[i].map(function(l){return t+encodeURIComponent(V(l))}).join(n):t+encodeURIComponent(V(r[i]))}).filter(Boolean).join(n):o?encodeURIComponent(V(o))+e+encodeURIComponent(V(r)):""},ke;ke=zt;var R=function(){return R=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},R.apply(this,arguments)},Lt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Tt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Rt(r,n,e){return Lt(this,void 0,void 0,function(){var o,i;return Tt(this,function(t){return o=ke({ak:r,bucket:n}),i=e+"://api.qiniu.com/v2/query?"+o,[2,K(i,{method:"GET"})]})})}function xe(r,n,e){var o=e.url,i=e.id;return o+"/buckets/"+r+"/objects/"+(n!=null?be(n):"~")+"/uploads/"+i}function Pt(r,n,e,o){var i=o+"/buckets/"+n+"/objects/"+(e!=null?be(e):"~")+"/uploads";return K(i,{method:"POST",headers:Y(r)})}function Dt(r,n,e,o,i){var t=ie(r).bucketName,l=xe(t,n,o)+("/"+e),p=Bt(r);return i.md5&&(p["Content-MD5"]=i.md5),K(l,R(R({},i),{method:"PUT",headers:p}))}function jt(r,n,e,o){var i=ie(r).bucketName,t=xe(i,n,e);return K(t,R(R({},o),{method:"POST",headers:Et(r)}))}function Mt(r,n,e){return K(r,R({method:"POST",body:n},e))}var Z=function(){return Z=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},Z.apply(this,arguments)},ue=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},le=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Vt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},$t=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Vt(arguments[n]));return r},Ht=4,Ce=[0,502,503,504,599],qt=$t(Ce,[406]),Nt=Math.pow(1024,3),Se=function(){function r(n,e,o,i){this.hostPool=o,this.logger=i,this.aborted=!1,this.retryCount=0,this.xhrList=[],this.config=n.config,i.info("config inited.",this.config),this.putExtra=Z({fname:""},n.putExtra),i.info("putExtra inited.",this.putExtra),this.key=n.key,this.file=n.file,this.token=n.token,this.onData=e.onData,this.onError=e.onError,this.onComplete=e.onComplete;try{var t=ie(this.token);this.bucketName=t.bucketName,this.assessKey=t.assessKey}catch(l){i.error("get putPolicy from token failed.",l),this.onError(l)}}return r.prototype.checkAndUpdateUploadHost=function(){return ue(this,void 0,void 0,function(){var n;return le(this,function(e){switch(e.label){case 0:return this.logger.info("get available upload host."),[4,this.hostPool.getUp(this.assessKey,this.bucketName,this.config.upprotocol)];case 1:if(n=e.sent(),n==null)throw new E(B.NotAvailableUploadHost,"no available upload host.");return this.uploadHost!=null&&this.uploadHost.host!==n.host?this.logger.warn("host switches from "+this.uploadHost.host+" to "+n.host+"."):this.logger.info("use host "+n.host+"."),this.uploadHost=n,[2]}})})},r.prototype.checkAndUnfreezeHost=function(){this.logger.info("check unfreeze host."),this.uploadHost!=null&&this.uploadHost.isFrozen()&&(this.logger.warn(this.uploadHost.host+" will be unfrozen."),this.uploadHost.unfreeze())},r.prototype.checkAndFreezeHost=function(n){this.logger.info("check freeze host."),n instanceof G&&this.uploadHost!=null&&Ce.includes(n.code)&&(this.logger.warn(this.uploadHost.host+" will be temporarily frozen."),this.uploadHost.freeze())},r.prototype.handleError=function(n){this.logger.error(n.message),this.onError(n)},r.prototype.putFile=function(){return ue(this,void 0,void 0,function(){var n,e,o,i;return le(this,function(t){switch(t.label){case 0:if(this.aborted=!1,this.putExtra.fname||(this.logger.info("use file.name as fname."),this.putExtra.fname=this.file.name),this.file.size>1e4*Nt)return this.handleError(new E(B.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!_t(this.putExtra.customVars))return this.handleError(new E(B.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!wt(this.putExtra.metadata))return this.handleError(new E(B.InvalidMetadata,"metadata key should start with x-qn-meta-")),[2];t.label=1;case 1:return t.trys.push([1,4,,5]),this.uploadAt=new Date().getTime(),[4,this.checkAndUpdateUploadHost()];case 2:return t.sent(),[4,this.run()];case 3:return n=t.sent(),this.onComplete(n.data),this.checkAndUnfreezeHost(),this.sendLog(n.reqId,200),[2];case 4:return e=t.sent(),this.aborted?(this.logger.warn("upload is aborted."),this.sendLog("",-2),[2]):(this.clear(),this.logger.error(e),e instanceof G&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),o=++this.retryCount<=this.config.retryCount,i=qt.includes(e.code),i&&o)?(this.logger.warn("error auto retry: "+this.retryCount+"/"+this.config.retryCount+"."),this.putFile(),[2]):(this.onError(e),[3,5]));case 5:return[2]}})})},r.prototype.clear=function(){this.xhrList.forEach(function(n){n.onreadystatechange=null,n.abort()}),this.xhrList=[],this.logger.info("cleanup uploading xhr.")},r.prototype.stop=function(){this.logger.info("aborted."),this.clear(),this.aborted=!0},r.prototype.addXhr=function(n){this.xhrList.push(n)},r.prototype.sendLog=function(n,e){var o,i;this.logger.report({code:e,reqId:n,remoteIp:"",upType:"jssdk-h5",size:this.file.size,time:Math.floor(this.uploadAt/1e3),port:Ut((o=this.uploadHost)===null||o===void 0?void 0:o.getUrl()),host:Ft((i=this.uploadHost)===null||i===void 0?void 0:i.getUrl()),bytesSent:this.progress?this.progress.total.loaded:0,duration:Math.floor((new Date().getTime()-this.uploadAt)/1e3)})},r.prototype.getProgressInfoItem=function(n,e,o){return Z({size:e,loaded:n,percent:n/e*100},o==null?{}:{fromCache:o})},r}(),Gt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),N=function(){return N=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},N.apply(this,arguments)},$=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},H=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Kt(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var Xt=function(r){Gt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return $(this,void 0,void 0,function(){var e,o,i,t,l,p=this;return H(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!Kt(this.config.chunkSize))throw new E(B.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new E(B.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new ot(function(a){return $(p,void 0,void 0,function(){return H(this,function(h){switch(h.label){case 0:if(this.aborted)throw e.abort(),new Error("pool is aborted");return[4,this.uploadChunk(a)];case 1:return h.sent(),[2]}})})},this.config.concurrentRequestLimit),o=null,i=this.getLocalKey(),t=this.chunks.map(function(a,h){return e.enqueue({chunk:a,index:h})}),v.label=2;case 2:return v.trys.push([2,5,,6]),[4,Promise.all(t)];case 3:return v.sent(),[4,this.mkFileReq()];case 4:return o=v.sent(),[3,6];case 5:throw l=v.sent(),l instanceof G&&(l.code===612||l.code===400)&&re(i,this.logger),l;case 6:return re(i,this.logger),[2,o]}})})},n.prototype.uploadChunk=function(e){return $(this,void 0,void 0,function(){var o,i,t,l,p,v,a,h,m,C=this;return H(this,function(k){switch(k.label){case 0:return o=e.index,i=e.chunk,t=this.cachedUploadedList[o],this.logger.info("upload part "+o+", cache:",t),l=this.config.checkByMD5,p=function(){C.usedCacheList[o]=!0,C.updateChunkProgress(i.size,o),C.uploadedList[o]=t,C.updateLocalCache()},t&&!l?(p(),[2]):[4,It(i)];case 1:return v=k.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(p(),[2]):(this.usedCacheList[o]=!1,a=function(S){C.updateChunkProgress(S.loaded,o)},h={body:i,md5:this.config.checkByServer?v:void 0,onProgress:a,onCreate:function(S){return C.addXhr(S)}},this.logger.info("part "+o+" start uploading."),[4,Dt(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=k.sent(),this.logger.info("part "+o+" upload completed."),a({loaded:i.size,total:i.size}),this.uploadedList[o]={etag:m.data.etag,md5:m.data.md5,size:i.size},this.updateLocalCache(),[2]}})})},n.prototype.mkFileReq=function(){return $(this,void 0,void 0,function(){var e,o,i=this;return H(this,function(t){switch(t.label){case 0:return e=N(N(N({parts:this.uploadedList.map(function(l,p){return{etag:l.etag,partNumber:p+1}}),fname:this.putExtra.fname},this.putExtra.mimeType&&{mimeType:this.putExtra.mimeType}),this.putExtra.customVars&&{customVars:this.putExtra.customVars}),this.putExtra.metadata&&{metadata:this.putExtra.metadata}),this.logger.info("parts upload completed, make file.",e),[4,jt(this.token,this.key,this.getUploadInfo(),{onCreate:function(l){return i.addXhr(l)},body:JSON.stringify(e)})];case 1:return o=t.sent(),this.logger.info("finish Resume Progress."),this.updateMkFileProgress(1),[2,o]}})})},n.prototype.initBeforeUploadChunks=function(){return $(this,void 0,void 0,function(){var e,o,i;return H(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=St(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,Pt(this.token,this.bucketName,this.key,this.uploadHost.getUrl())]);case 1:return o=t.sent(),this.logger.info("initd upload parts of id: "+o.data.uploadId+"."),this.uploadId=o.data.uploadId,this.cachedUploadedList=[],[3,3];case 2:i=["resume upload parts from local cache,","total "+e.data.length+" part,","id is "+e.id+"."],this.logger.info(i.join(" ")),this.cachedUploadedList=e.data,this.uploadId=e.id,t.label=3;case 3:return this.chunks=bt(this.file,this.config.chunkSize),this.loaded={mkFileProgress:0,chunks:this.chunks.map(function(l){return 0})},this.notifyResumeProgress(),[2]}})})},n.prototype.getUploadInfo=function(){return{id:this.uploadId,url:this.uploadHost.getUrl()}},n.prototype.getLocalKey=function(){return Ct(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){xt(this.getLocalKey(),{id:this.uploadId,data:this.uploadedList},this.logger)},n.prototype.updateChunkProgress=function(e,o){this.loaded.chunks[o]=e,this.notifyResumeProgress()},n.prototype.updateMkFileProgress=function(e){this.loaded.mkFileProgress=e,this.notifyResumeProgress()},n.prototype.notifyResumeProgress=function(){var e=this;this.progress={total:this.getProgressInfoItem(kt(this.loaded.chunks)+this.loaded.mkFileProgress,this.file.size+1),chunks:this.chunks.map(function(o,i){var t=e.usedCacheList[i];return e.getProgressInfoItem(e.loaded.chunks[i],o.size,t)}),uploadInfo:{id:this.uploadId,url:this.uploadHost.getUrl()}},this.onData(this.progress)},n}(Se),ce=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},fe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Wt=function(){function r(){this.crc=-1,this.table=this.makeTable()}return r.prototype.makeTable=function(){for(var n=new Array,e=0;e<256;e++){for(var o=e,i=0;i<8;i++)o&1?o=o>>>1^3988292384:o>>>=1;n[e]=o}return n},r.prototype.append=function(n){for(var e=this.crc,o=0;o<n.byteLength;o++)e=e>>>8^this.table[(e^n[o])&255];this.crc=e},r.prototype.compute=function(){return(this.crc^-1)>>>0},r.prototype.readAsUint8Array=function(n){return ce(this,void 0,void 0,function(){var e;return fe(this,function(o){switch(o.label){case 0:return typeof n.arrayBuffer!="function"?[3,2]:(e=Uint8Array.bind,[4,n.arrayBuffer()]);case 1:return[2,new(e.apply(Uint8Array,[void 0,o.sent()]))];case 2:return[2,new Promise(function(i,t){var l=new FileReader;l.onload=function(){if(l.result==null){t();return}if(typeof l.result=="string"){t();return}i(new Uint8Array(l.result))},l.readAsArrayBuffer(n)})]}})})},r.prototype.file=function(n){return ce(this,void 0,void 0,function(){var e,o,i,t,l,p;return fe(this,function(v){switch(v.label){case 0:return n.size<=D?(e=this.append,[4,this.readAsUint8Array(n)]):[3,2];case 1:return e.apply(this,[v.sent()]),[2,this.compute()];case 2:o=Math.ceil(n.size/D),i=0,v.label=3;case 3:return i<o?(t=i*D,l=i===o-1?n.size:t+D,[4,this.readAsUint8Array(n.slice(t,l))]):[3,6];case 4:p=v.sent(),this.append(new Uint8Array(p)),v.label=5;case 5:return i++,[3,3];case 6:return[2,this.compute()]}})})},r.file=function(n){var e=new r;return e.file(n)},r}(),Jt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),Zt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Yt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},de=function(r){Jt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Zt(this,void 0,void 0,function(){var e,o,i,t,l,p,v=this;return Yt(this,function(a){switch(a.label){case 0:return this.logger.info("start run Direct."),e=new FormData,this.putExtra.mimeType?(o=this.file.slice(0,this.file.size,this.putExtra.mimeType),e.append("file",o,this.putExtra.fname||this.file.name)):e.append("file",this.file,this.putExtra.fname||this.file.name),e.append("token",this.token),this.key!=null&&e.append("key",this.key),e.append("fname",this.putExtra.fname),this.config.checkByServer?[4,Wt.file(this.file)]:[3,2];case 1:i=a.sent(),e.append("crc32",i.toString()),a.label=2;case 2:return this.putExtra.customVars&&(this.logger.info("init customVars."),t=this.putExtra.customVars,Object.keys(t).forEach(function(h){return e.append(h,t[h].toString())}),this.logger.info("customVars inited.")),this.putExtra.metadata&&(this.logger.info("init metadata."),l=this.putExtra.metadata,Object.keys(l).forEach(function(h){return e.append(h,l[h].toString())})),this.logger.info("formData inited."),[4,Mt(this.uploadHost.getUrl(),e,{onProgress:function(h){v.updateDirectProgress(h.loaded,h.total)},onCreate:function(h){return v.addXhr(h)}})];case 3:return p=a.sent(),this.logger.info("Direct progress finish."),this.finishDirectProgress(),[2,p]}})})},n.prototype.updateDirectProgress=function(e,o){this.progress={total:this.getProgressInfoItem(e,o+1)},this.onData(this.progress)},n.prototype.finishDirectProgress=function(){if(!this.progress){this.logger.warn("progress is null."),this.progress={total:this.getProgressInfoItem(this.file.size,this.file.size)},this.onData(this.progress);return}var e=this.progress.total;this.progress={total:this.getProgressInfoItem(e.loaded+1,e.size)},this.onData(this.progress)},n}(Se);function Be(r,n,e){e===void 0&&(e=3);var o=_e();o.open("POST","https://uplog.qbox.me/log/3"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.setRequestHeader("Authorization",Y(r).Authorization),o.onreadystatechange=function(){o.readyState===4&&o.status!==200&&e>0&&Be(r,n,e-1)};var i=[n.code||"",n.reqId||"",n.host||"",n.remoteIp||"",n.port||"",n.duration||"",n.time||"",n.bytesSent||"",n.upType||"",n.size||""].join(",");o.send(i)}var Qt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},ee=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Qt(arguments[n]));return r},en=function(){function r(n,e,o,i){e===void 0&&(e=!0),o===void 0&&(o="OFF"),i===void 0&&(i="UPLOAD"),this.token=n,this.disableReport=e,this.level=o,this.prefix=i,this.id=++r.id}return r.prototype.getPrintPrefix=function(n){return"Qiniu-JS-SDK ["+n+"]["+this.prefix+"#"+this.id+"]:"},r.prototype.report=function(n,e){if(!this.disableReport)try{Be(this.token,n,e)}catch(o){this.warn(o)}},r.prototype.info=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO"];o.includes(this.level)&&console.log.apply(console,ee([this.getPrintPrefix("INFO")],n))},r.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN"];o.includes(this.level)&&console.warn.apply(console,ee([this.getPrintPrefix("WARN")],n))},r.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN","ERROR"];o.includes(this.level)&&console.error.apply(console,ee([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),he=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},pe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tn=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},nn=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(tn(arguments[n]));return r},W=new Map,rn=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=W.get(this.host);return e!=null&&e>=n},r.prototype.freeze=function(n){n===void 0&&(n=20);var e=new Date().getTime()+n*1e3;W.set(this.host,e)},r.prototype.unfreeze=function(){W.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return W.get(this.host)},r}(),on=function(){function r(n){n===void 0&&(n=[]),this.initHosts=n,this.cachedHostsMap=new Map}return r.prototype.register=function(n,e,o,i){this.cachedHostsMap.set(n+"@"+e,o.map(function(t){return new rn(t,i)}))},r.prototype.refresh=function(n,e,o){var i,t,l,p;return he(this,void 0,void 0,function(){var v,a,h;return pe(this,function(m){switch(m.label){case 0:return v=this.cachedHostsMap.get(n+"@"+e)||[],v.length>0?[2]:this.initHosts.length>0?(this.register(n,e,this.initHosts,o),[2]):[4,Rt(n,e,o)];case 1:return a=m.sent(),(a==null?void 0:a.data)!=null&&(h=nn(((t=(i=a.data.up)===null||i===void 0?void 0:i.acc)===null||t===void 0?void 0:t.main)||[],((p=(l=a.data.up)===null||l===void 0?void 0:l.acc)===null||p===void 0?void 0:p.backup)||[]),this.register(n,e,h,o)),[2]}})})},r.prototype.getUp=function(n,e,o){return he(this,void 0,void 0,function(){var i,t,l;return pe(this,function(p){switch(p.label){case 0:return[4,this.refresh(n,e,o)];case 1:return p.sent(),i=this.cachedHostsMap.get(n+"@"+e)||[],i.length===0?[2,null]:(t=i.filter(function(v){return!v.isFrozen()}),t.length>0?[2,t[0]]:(l=i.slice().sort(function(v,a){return(v.getUnfreezeTime()||0)-(a.getUnfreezeTime()||0)}),[2,l[0]]))}})})},r}();function an(r,n,e,o){return r.config&&r.config.forceDirect?(o.info("ues forceDirect mode."),new de(r,n,e,o)):r.file.size>4*D?(o.info("file size over 4M, use Resume."),new Xt(r,n,e,o)):(o.info("file size less or equal than 4M, use Direct."),new de(r,n,e,o))}function sn(r,n,e,o,i){var t=new en(e,void 0,void 0,r.name),l={file:r,key:n,token:e,putExtra:o,config:cn(i)},p=new on(l.config.uphost);return new lt(function(v){var a=an(l,{onData:function(h){return v.next(h)},onError:function(h){return v.error(h)},onComplete:function(h){return v.complete(h)}},p,t);return a.putFile(),a.stop.bind(a)})}var j=function(){return j=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},j.apply(this,arguments)},un=function(r,n){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(e[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(r);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(e[o[i]]=r[o[i]]);return e},ln=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},te=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ln(arguments[n]));return r};function cn(r,n){var e=j({},r),o=e.upprotocol,i=e.uphost,t=un(e,["upprotocol","uphost"]),l=j({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!0,concurrentRequestLimit:3,chunkSize:Ht,upprotocol:"https",debugLogLevel:"OFF",disableStatisticsReport:!1},t);o&&(l.upprotocol=o.replace(/:$/,""));var p=[];if(i)Array.isArray(i)?p.push.apply(p,te(i)):p.push(i);else if(l!=null&&l.region){var v=Ot[l==null?void 0:l.region];l.useCdnDomain?p.push.apply(p,te(v.cdnUphost)):p.push.apply(p,te(v.srcUphost))}return j(j({},l),{uphost:p.filter(Boolean)})}var ye={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(ye).map(function(r){return ye[r]});let ne=null;async function fn(r,n,e={}){if(!n){console.error("UID is required to upload file to other user's cloud storage");return}return ne||await i(),await t();async function i(){let{data:p}=await f.globalInject.$axios.get("/v2/form/uploadToken");if(p.status===1)ne=p.result;else throw new Error(p.msg)}async function t(){let p=e.path||"att_file/";const v=ge(e.name||r.name),a=parseInt(Date.now()/1e3).toString(),h=p+n+"/"+a+"_"+l()+"_."+ge(v);return sn(r,h,ne)}function l(){let p="";for(let v=0;v<6;v++){const a=parseInt(Math.random()*10);p+=a}return p}}const ge=r=>r.split(".").pop(),Ee=r=>(f.pushScopeId("data-v-45101ef0"),r=r(),f.popScopeId(),r),dn={class:"ocr-widget-box widget-box"},hn={class:"ocr-header"},pn={key:1,class:"ocr-image-preview"},yn=["src"],gn={key:0,class:"loading-overlay"},vn=Ee(()=>f.createBaseVNode("span",{class:"loading-spinner-icon"},null,-1)),mn=[vn],bn=Ee(()=>f.createBaseVNode("span",{class:"reupload-text"},"重新上传",-1)),wn=[bn],_n={key:0,class:"ocr-error-bar"},kn={class:"error-text"},xn=f.defineComponent({__name:"OcrWidget",props:{id:{},type:{},attrs:{},value:{}},emits:["update:value"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.inject("formMode"),l=f.computed(()=>t.value==="answer-preview"),p=f.computed(()=>t.value==="input"||t.value==="preview"),v=f.ref(!1),a=f.ref(""),h=f.ref(!1),m=f.ref(!1),C=f.ref(""),k=["购买方","销售方","货物或应税劳务、服务"],S=f.ref(""),A=f.ref(""),x=f.ref(!1),g=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{k.includes(w.name)?b[_.key]=w.name+_.label:b[_.key]=_.label})}),b}),y=f.computed(()=>{const b={};for(const[w,_]of Object.entries(g.value))b[_]=w;return b}),u=f.computed(()=>{const b=e.value;if(!b)return{};if(typeof b=="object"&&"fields"in b)return b.fields||{};const w=b,_={};for(const[U,L]of Object.entries(w)){const T=y.value[U]||U;_[T]=L}return _}),s=f.computed(()=>({imageUrl:S.value,imageKey:A.value,recognized:x.value,fields:u.value}));function d(b){const w={};for(const[_,U]of Object.entries(b)){const L=g.value[_]||_;w[L]=U}return w}const c=f.ref(""),I=f.ref("");async function F(b){const w=await f.getCreateUid(),_=await fn(b,w);return new Promise((U,L)=>{_.subscribe({error:T=>L(T),complete:T=>U(T)})})}const O=f.computed(()=>{const b=[];return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1).forEach(_=>{if(_.label){let U=_.label;k.includes(w.name)&&(U=w.name+U),b.push(U)}})}),b}),X=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{b[_.label]=_.key,k.includes(w.name)&&(b[w.name+_.label]=_.key)})}),b}),oe=f.computed(()=>!!C.value||!!s.value.imageUrl),Ie=f.computed(()=>i||l.value?!1:!!(s.value.recognized||h.value)),Ae=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.forEach(_=>{b[_.key]=""})}),b}),Ue=f.computed(()=>e.attrs.sections.map(b=>({...b,fields:b.fields.filter(w=>w.visible!==!1).map(w=>{var _;return{...w,value:((_=s.value.fields)==null?void 0:_[w.key])??""}})})).filter(b=>b.fields.length>0));function M(b){b.imageUrl!==void 0&&(S.value=b.imageUrl),b.imageKey!==void 0&&(A.value=b.imageKey),b.recognized!==void 0&&(x.value=b.recognized);const w="fields"in b?b.fields:u.value;o("update:value",d(w))}async function Fe(b){if(!b)return m.value=!0,null;try{const w=await rt({url:b,keys:O.value}),_={};for(const[U,L]of Object.entries(w.fields)){const T=X.value[U]||U;_[T]=L}return _}catch(w){const _=w instanceof Error?w.message:"识别失败";return _.includes("超时")||_.includes("timeout"),m.value=!0,null}}async function Oe(b){C.value=URL.createObjectURL(b),v.value=!0,a.value="",m.value=!1,h.value=!1,M({fields:{},recognized:!1});try{const{key:w}=await F(b);if(!w){f.ElMessage.error("上传失败");return}I.value=w,c.value="https://fatt.bmwax.cn/"+w,M({imageUrl:c.value,imageKey:w});const _=await Fe(c.value);if(v.value=!1,se(),_){const U={...Ae.value,..._};M({fields:U,recognized:!0}),m.value=!1}else a.value="识别失败,请确保图片清晰、无遮挡并重新上传",m.value=!0}catch(w){v.value=!1,se(),a.value=w.message||"识别失败",Q()}}function ze(b,w){M({fields:{...s.value.fields,[b]:w}})}function ae(){M({imageUrl:"",imageKey:"",recognized:!1,fields:{}}),c.value="",I.value="",a.value="",v.value=!1,m.value=!1,h.value=!1,Q()}function Q(){C.value&&(URL.revokeObjectURL(C.value),C.value="")}f.onUnmounted(()=>{Q()});function se(){h.value=!0,a.value=""}return(b,w)=>(f.openBlock(),f.createElementBlock("div",dn,[f.createVNode(f._sfc_main),f.createVNode(f.ChoosenView,null,{default:f.withCtx(()=>[f.createVNode(f._sfc_main$1),f.createBaseVNode("div",{class:f.normalizeClass(["ocr-container",{disabled:f.unref(i)||l.value,"landing-layout":p.value}])},[f.createBaseVNode("div",hn,[oe.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Ve,{key:0,editable:f.unref(i),"allow-camera":b.attrs.allowCamera,"allow-gallery":b.attrs.allowGallery,"is-landing":p.value,onUpload:Oe},null,8,["editable","allow-camera","allow-gallery","is-landing"])),oe.value?(f.openBlock(),f.createElementBlock("div",pn,[f.createBaseVNode("img",{src:C.value||s.value.imageUrl,alt:"上传图片"},null,8,yn),v.value?(f.openBlock(),f.createElementBlock("div",gn,mn)):a.value?(f.openBlock(),f.createElementBlock("div",{key:1,class:"error-overlay",onClick:ae},wn)):f.createCommentVNode("",!0),a.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",{key:2,class:"close-icon iconfont icon-form-close",onClick:ae}))])):f.createCommentVNode("",!0)]),a.value?(f.openBlock(),f.createElementBlock("div",_n,[f.createBaseVNode("span",kn,f.toDisplayString(a.value),1)])):f.createCommentVNode("",!0),f.createVNode(nt,{sections:Ue.value,"ocr-data":s.value.fields,"can-edit":Ie.value,"ocr-type":b.attrs.ocrType,"is-landing":p.value,"onUpdate:field":ze},null,8,["sections","ocr-data","can-edit","ocr-type","is-landing"])],2),f.createVNode(f.VerifyTip),f.createVNode(f._sfc_main$2)]),_:1})]))}}),Cn=f._export_sfc(xn,[["__scopeId","data-v-45101ef0"]]);exports.default=Cn;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./main-DgF763FD.cjs"),ve=r=>(f.pushScopeId("data-v-908bdd1c"),r=r(),f.popScopeId(),r),Le={class:"ocr-uploader"},Te={class:"upload-buttons"},Re=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-camera btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"拍照上传")],-1)),Pe=[Re],De=ve(()=>f.createBaseVNode("div",{class:"btn-content"},[f.createBaseVNode("span",{class:"icon iconfont icon-form-photo-album btn-icon"}),f.createBaseVNode("span",{class:"btn-text"},"从相册选择")],-1)),je=[De],Me=f.defineComponent({__name:"OcrUploader",props:{allowCamera:{type:Boolean},allowGallery:{type:Boolean}},emits:["upload"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.ref(),l=f.ref(),p=f.computed(()=>e.allowCamera&&e.allowGallery);f.onMounted(async()=>{if(navigator.userAgent.toLowerCase().includes("micromessenger"))try{const{data:k}=await f.globalInject.$axios.get(`/v1/wxAccount/getWxSign?q=${window.btoa(JSON.stringify({url:window.location.href}))}`);wx.config({debug:!1,appId:k.result.appId,timestamp:k.result.timestamp,nonceStr:k.result.nonceStr,signature:k.result.signature,jsApiList:["chooseImage","getLocalImgData"]}),wx.ready(()=>{console.log("[OcrUploader] wx.ready")}),wx.error(S=>{console.warn("[OcrUploader] wx.config 失败:",S)})}catch{}});function v(C){try{const k=C.split(",");if(k.length<2)return null;const S=k[0].match(/:(.*?);/),A=(S==null?void 0:S[1])||"image/jpeg",x=atob(k[1]),g=x.length,y=new Uint8Array(g);for(let u=0;u<g;u++)y[u]=x.charCodeAt(u);return new File([y],`ocr_${Date.now()}.jpg`,{type:A})}catch{return null}}function a(C){wx.chooseImage({count:1,sizeType:["compressed"],sourceType:C==="camera"?["camera"]:["album"],success(k){const S=k.localIds[0];wx.getLocalImgData({localId:S,success(A){let x=A.localData;x.indexOf("jgp")>-1&&x.indexOf("jpeg")===-1&&(x=x.replace(/\bjgp\b/g,"jpeg")),x.indexOf("data:image")!==0&&(x="data:image/jpeg;base64,"+x);const g=v(x);if(!g){f.ElMessage.error("图片处理失败,请重试");return}if(g.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB");return}o("upload",g)},fail(){f.ElMessage.error("获取图片数据失败,请重试")}})},fail(){}})}async function h(C){var S,A;if(i)return;if(await f.isWxMiniProgram()){a(C);return}C==="camera"?(S=l.value)==null||S.click():(A=t.value)==null||A.click()}function m(C){var x;const k=C.target,S=(x=k.files)==null?void 0:x[0];if(!S)return;if(!["image/jpeg","image/png"].includes(S.type)){f.ElMessage.error("请上传JPG/PNG格式的图片"),k.value="";return}if(S.size>10*1024*1024){f.ElMessage.error("图片大小不能超过10MB"),k.value="";return}o("upload",S),k.value=""}return(C,k)=>(f.openBlock(),f.createElementBlock("div",Le,[f.createBaseVNode("div",Te,[C.allowCamera!==!1?(f.openBlock(),f.createElementBlock("div",{key:0,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[0]||(k[0]=S=>h("camera"))},Pe,2)):f.createCommentVNode("",!0),C.allowGallery!==!1?(f.openBlock(),f.createElementBlock("div",{key:1,class:f.normalizeClass(["upload-btn",{"single-button":!p.value}]),onClick:k[1]||(k[1]=S=>h("gallery"))},je,2)):f.createCommentVNode("",!0)]),f.createBaseVNode("input",{ref_key:"galleryInput",ref:t,type:"file",accept:".jpg,.jpeg,.png",style:{display:"none"},onChange:k[2]||(k[2]=S=>m(S))},null,544),f.createBaseVNode("input",{ref_key:"cameraInput",ref:l,type:"file",accept:".jpg,.jpeg,.png",capture:"environment",style:{display:"none"},onChange:k[3]||(k[3]=S=>m(S))},null,544)]))}}),Ve=f._export_sfc(Me,[["__scopeId","data-v-908bdd1c"]]),$e={key:0,class:"section-header"},He={class:"section-body"},qe={class:"field-cell-pair"},Ne={class:"field-label"},Ge={class:"field-value"},Ke=["onBlur"],Xe={key:1,class:"value-text"},We={key:0,class:"section-header"},Je={class:"section-body"},Ze={class:"field-label field-label-editor"},Ye={class:"field-value"},Qe=["onBlur"],et={key:1,class:"value-text"},tt=f.defineComponent({__name:"OcrResultTable",props:{sections:{},ocrData:{},canEdit:{type:Boolean},ocrType:{},isLanding:{type:Boolean}},emits:["update:field"],setup(r,{emit:n}){const e=n;function o(i,t){const l=t.target;e("update:field",i,l.innerText||"")}return(i,t)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["ocr-result-table",{"landing-layout":i.isLanding}])},[i.isLanding?(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:0},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",$e,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",He,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{key:v.key,class:"field-row-pair"},[f.createBaseVNode("div",qe,[f.createBaseVNode("div",Ne,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ge,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[0]||(t[0]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Ke)):(f.openBlock(),f.createElementBlock("span",Xe,f.toDisplayString(i.ocrData[v.key]||""),1))])])]))),128))])]))),128)):(f.openBlock(!0),f.createElementBlock(f.Fragment,{key:1},f.renderList(i.sections,(l,p)=>(f.openBlock(),f.createElementBlock("div",{key:p,class:"section-table"},[i.sections.length>1&&l.name?(f.openBlock(),f.createElementBlock("div",We,f.toDisplayString(l.name),1)):f.createCommentVNode("",!0),f.createBaseVNode("div",Je,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.fields,v=>(f.openBlock(),f.createElementBlock("div",{class:"field-row",key:v.key},[f.createBaseVNode("div",Ze,f.toDisplayString(v.label),1),f.createBaseVNode("div",Ye,[i.canEdit?(f.openBlock(),f.createElementBlock("div",{key:0,class:"value-input",contenteditable:"",onBlur:a=>o(v.key,a),onKeydown:t[1]||(t[1]=f.withKeys(f.withModifiers(a=>a.target.blur(),["prevent"]),["enter"]))},f.toDisplayString(i.ocrData[v.key]||""),41,Qe)):(f.openBlock(),f.createElementBlock("span",et,f.toDisplayString(i.ocrData[v.key]||""),1))])]))),128))])]))),128))],2))}}),nt=f._export_sfc(tt,[["__scopeId","data-v-61a3a77c"]]);async function rt(r){const{url:n,keys:e,eacb:o}=r,t=(await f.globalInject.$axios.post("/v2/form/ocrRecognize",{eacb:o,url:n,keys:e})).data;if(t.status!==1)throw new Error(t.msg||"OCR 识别失败");const l=t.result;if(!Array.isArray(l)||l.length===0)throw new Error("OCR 识别返回空数据");const p={};for(const{key:v,value:a}of l)v&&(p[v]=a??"");return{fields:p}}var me=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),B;(function(r){r.InvalidFile="InvalidFile",r.InvalidToken="InvalidToken",r.InvalidMetadata="InvalidMetadata",r.InvalidChunkSize="InvalidChunkSize",r.InvalidCustomVars="InvalidCustomVars",r.NotAvailableUploadHost="NotAvailableUploadHost",r.ReadCacheFailed="ReadCacheFailed",r.InvalidCacheData="InvalidCacheData",r.WriteCacheFailed="WriteCacheFailed",r.RemoveCacheFailed="RemoveCacheFailed",r.GetCanvasContextFailed="GetCanvasContextFailed",r.UnsupportedFileType="UnsupportedFileType",r.FileReaderReadFailed="FileReaderReadFailed",r.NotAvailableXMLHttpRequest="NotAvailableXMLHttpRequest",r.InvalidProgressEventTarget="InvalidProgressEventTarget",r.RequestError="RequestError"})(B||(B={}));var E=function(){function r(n,e){this.name=n,this.message=e,this.stack=new Error().stack}return r}(),G=function(r){me(n,r);function n(e,o,i,t){var l=r.call(this,B.RequestError,i)||this;return l.code=e,l.reqId=o,l.isRequestError=!0,l.data=t,l}return n}(E),it=function(r){me(n,r);function n(e,o){return o===void 0&&(o=""),r.call(this,0,o,e)||this}return n}(G),ot=function(){function r(n,e){this.runTask=n,this.limit=e,this.aborted=!1,this.queue=[],this.processing=[]}return r.prototype.enqueue=function(n){var e=this;return new Promise(function(o,i){e.queue.push({task:n,resolve:o,reject:i}),e.check()})},r.prototype.run=function(n){var e=this;this.queue=this.queue.filter(function(o){return o!==n}),this.processing.push(n),this.runTask(n.task).then(function(){e.processing=e.processing.filter(function(o){return o!==n}),n.resolve(),e.check()},function(o){return n.reject(o)})},r.prototype.check=function(){var n=this;if(!this.aborted){var e=this.processing.length,o=this.limit-e;this.queue.slice(0,o).forEach(function(i){n.run(i)})}},r.prototype.abort=function(){this.queue=[],this.aborted=!0},r}(),at=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),q=function(){return q=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},q.apply(this,arguments)},st=function(){function r(){this.closed=!1}return r.prototype.unsubscribe=function(){this.closed||(this.closed=!0,this._unsubscribe&&this._unsubscribe())},r.prototype.add=function(n){this._unsubscribe=n},r}(),ut=function(r){at(n,r);function n(e,o,i){var t=r.call(this)||this;return t.isStopped=!1,e&&typeof e=="object"?t.destination=e:t.destination=q(q(q({},e&&{next:e}),o&&{error:o}),i&&{complete:i}),t}return n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this))},n.prototype.next=function(e){!this.isStopped&&this.destination.next&&this.destination.next(e)},n.prototype.error=function(e){!this.isStopped&&this.destination.error&&(this.isStopped=!0,this.destination.error(e))},n.prototype.complete=function(e){!this.isStopped&&this.destination.complete&&(this.isStopped=!0,this.destination.complete(e))},n}(st),lt=function(){function r(n){this._subscribe=n}return r.prototype.subscribe=function(n,e,o){var i=new ut(n,e,o);return i.add(this._subscribe(i)),i},r}();function ct(r){if(r===null||typeof r>"u")return"";var n=r+"",e="",o,i,t=0;o=i=0,t=n.length;for(var l=0;l<t;l++){var p=n.charCodeAt(l),v=null;if(p<128)i++;else if(p>127&&p<2048)v=String.fromCharCode(p>>6|192,p&63|128);else if((p&63488^55296)>0)v=String.fromCharCode(p>>12|224,p>>6&63|128,p&63|128);else{if((p&64512^55296)>0)throw new RangeError("Unmatched trail surrogate at "+l);var a=n.charCodeAt(++l);if((a&64512^56320)>0)throw new RangeError("Unmatched lead surrogate at "+(l-1));p=((p&1023)<<10)+(a&1023)+65536,v=String.fromCharCode(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}v!==null&&(i>o&&(e+=n.slice(o,i)),e+=v,o=i=l+1)}return i>o&&(e+=n.slice(o,t)),e}function ft(r){var n=[],e=0,o=0,i=0;for(r+="";e<r.length;){o=r.charCodeAt(e)&255,i=0,o<=191?(o=o&127,i=1):o<=223?(o=o&31,i=2):o<=239?(o=o&15,i=3):(o=o&7,i=4);for(var t=1;t<i;++t)o=o<<6|r.charCodeAt(t+e)&63;i===4?(o-=65536,n.push(String.fromCharCode(55296|o>>10&1023)),n.push(String.fromCharCode(56320|o&1023))):n.push(String.fromCharCode(o)),e+=i}return n.join("")}function dt(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r=ct(r+"");do e=r.charCodeAt(h++),o=r.charCodeAt(h++),i=r.charCodeAt(h++),a=e<<16|o<<8|i,t=a>>18&63,l=a>>12&63,p=a>>6&63,v=a&63,k[m++]=n.charAt(t)+n.charAt(l)+n.charAt(p)+n.charAt(v);while(h<r.length);switch(C=k.join(""),r.length%3){case 1:C=C.slice(0,-2)+"==";break;case 2:C=C.slice(0,-1)+"=";break}return C}function ht(r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e,o,i,t,l,p,v,a,h=0,m=0,C="",k=[];if(!r)return r;r+="";do t=n.indexOf(r.charAt(h++)),l=n.indexOf(r.charAt(h++)),p=n.indexOf(r.charAt(h++)),v=n.indexOf(r.charAt(h++)),a=t<<18|l<<12|p<<6|v,e=a>>16&255,o=a>>8&255,i=a&255,p===64?k[m++]=String.fromCharCode(e):v===64?k[m++]=String.fromCharCode(e,o):k[m++]=String.fromCharCode(e,o,i);while(h<r.length);return C=k.join(""),ft(C)}function be(r){return r=dt(r),r.replace(/\//g,"_").replace(/\+/g,"-")}function pt(r){return r=r.replace(/_/g,"/").replace(/-/g,"+"),ht(r)}var we={exports:{}};(function(r,n){(function(e){r.exports=e()})(function(e){var o=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function i(g,y){var u=g[0],s=g[1],d=g[2],c=g[3];u+=(s&d|~s&c)+y[0]-680876936|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[1]-389564586|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[2]+606105819|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[3]-1044525330|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[4]-176418897|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[5]+1200080426|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[6]-1473231341|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[7]-45705983|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[8]+1770035416|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[9]-1958414417|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[10]-42063|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[11]-1990404162|0,s=(s<<22|s>>>10)+d|0,u+=(s&d|~s&c)+y[12]+1804603682|0,u=(u<<7|u>>>25)+s|0,c+=(u&s|~u&d)+y[13]-40341101|0,c=(c<<12|c>>>20)+u|0,d+=(c&u|~c&s)+y[14]-1502002290|0,d=(d<<17|d>>>15)+c|0,s+=(d&c|~d&u)+y[15]+1236535329|0,s=(s<<22|s>>>10)+d|0,u+=(s&c|d&~c)+y[1]-165796510|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[6]-1069501632|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[11]+643717713|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[0]-373897302|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[5]-701558691|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[10]+38016083|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[15]-660478335|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[4]-405537848|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[9]+568446438|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[14]-1019803690|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[3]-187363961|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[8]+1163531501|0,s=(s<<20|s>>>12)+d|0,u+=(s&c|d&~c)+y[13]-1444681467|0,u=(u<<5|u>>>27)+s|0,c+=(u&d|s&~d)+y[2]-51403784|0,c=(c<<9|c>>>23)+u|0,d+=(c&s|u&~s)+y[7]+1735328473|0,d=(d<<14|d>>>18)+c|0,s+=(d&u|c&~u)+y[12]-1926607734|0,s=(s<<20|s>>>12)+d|0,u+=(s^d^c)+y[5]-378558|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[8]-2022574463|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[11]+1839030562|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[14]-35309556|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[1]-1530992060|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[4]+1272893353|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[7]-155497632|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[10]-1094730640|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[13]+681279174|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[0]-358537222|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[3]-722521979|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[6]+76029189|0,s=(s<<23|s>>>9)+d|0,u+=(s^d^c)+y[9]-640364487|0,u=(u<<4|u>>>28)+s|0,c+=(u^s^d)+y[12]-421815835|0,c=(c<<11|c>>>21)+u|0,d+=(c^u^s)+y[15]+530742520|0,d=(d<<16|d>>>16)+c|0,s+=(d^c^u)+y[2]-995338651|0,s=(s<<23|s>>>9)+d|0,u+=(d^(s|~c))+y[0]-198630844|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[7]+1126891415|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[14]-1416354905|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[5]-57434055|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[12]+1700485571|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[3]-1894986606|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[10]-1051523|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[1]-2054922799|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[8]+1873313359|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[15]-30611744|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[6]-1560198380|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[13]+1309151649|0,s=(s<<21|s>>>11)+d|0,u+=(d^(s|~c))+y[4]-145523070|0,u=(u<<6|u>>>26)+s|0,c+=(s^(u|~d))+y[11]-1120210379|0,c=(c<<10|c>>>22)+u|0,d+=(u^(c|~s))+y[2]+718787259|0,d=(d<<15|d>>>17)+c|0,s+=(c^(d|~u))+y[9]-343485551|0,s=(s<<21|s>>>11)+d|0,g[0]=u+g[0]|0,g[1]=s+g[1]|0,g[2]=d+g[2]|0,g[3]=c+g[3]|0}function t(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g.charCodeAt(u)+(g.charCodeAt(u+1)<<8)+(g.charCodeAt(u+2)<<16)+(g.charCodeAt(u+3)<<24);return y}function l(g){var y=[],u;for(u=0;u<64;u+=4)y[u>>2]=g[u]+(g[u+1]<<8)+(g[u+2]<<16)+(g[u+3]<<24);return y}function p(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,t(g.substring(s-64,s)));for(g=g.substring(s-64),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g.charCodeAt(s)<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function v(g){var y=g.length,u=[1732584193,-271733879,-1732584194,271733878],s,d,c,I,F,O;for(s=64;s<=y;s+=64)i(u,l(g.subarray(s-64,s)));for(g=s-64<y?g.subarray(s-64):new Uint8Array(0),d=g.length,c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],s=0;s<d;s+=1)c[s>>2]|=g[s]<<(s%4<<3);if(c[s>>2]|=128<<(s%4<<3),s>55)for(i(u,c),s=0;s<16;s+=1)c[s]=0;return I=y*8,I=I.toString(16).match(/(.*?)(.{0,8})$/),F=parseInt(I[2],16),O=parseInt(I[1],16)||0,c[14]=F,c[15]=O,i(u,c),u}function a(g){var y="",u;for(u=0;u<4;u+=1)y+=o[g>>u*8+4&15]+o[g>>u*8&15];return y}function h(g){var y;for(y=0;y<g.length;y+=1)g[y]=a(g[y]);return g.join("")}h(p("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function g(y,u){return y=y|0||0,y<0?Math.max(y+u,0):Math.min(y,u)}ArrayBuffer.prototype.slice=function(y,u){var s=this.byteLength,d=g(y,s),c=s,I,F,O,X;return u!==e&&(c=g(u,s)),d>c?new ArrayBuffer(0):(I=c-d,F=new ArrayBuffer(I),O=new Uint8Array(F),X=new Uint8Array(this,d,I),O.set(X),F)}}();function m(g){return/[\u0080-\uFFFF]/.test(g)&&(g=unescape(encodeURIComponent(g))),g}function C(g,y){var u=g.length,s=new ArrayBuffer(u),d=new Uint8Array(s),c;for(c=0;c<u;c+=1)d[c]=g.charCodeAt(c);return y?d:s}function k(g){return String.fromCharCode.apply(null,new Uint8Array(g))}function S(g,y,u){var s=new Uint8Array(g.byteLength+y.byteLength);return s.set(new Uint8Array(g)),s.set(new Uint8Array(y),g.byteLength),s}function A(g){var y=[],u=g.length,s;for(s=0;s<u-1;s+=2)y.push(parseInt(g.substr(s,2),16));return String.fromCharCode.apply(String,y)}function x(){this.reset()}return x.prototype.append=function(g){return this.appendBinary(m(g)),this},x.prototype.appendBinary=function(g){this._buff+=g,this._length+=g.length;var y=this._buff.length,u;for(u=64;u<=y;u+=64)i(this._hash,t(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},x.prototype.end=function(g){var y=this._buff,u=y.length,s,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c;for(s=0;s<u;s+=1)d[s>>2]|=y.charCodeAt(s)<<(s%4<<3);return this._finish(d,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},x.prototype.setState=function(g){return this._buff=g.buff,this._length=g.length,this._hash=g.hash,this},x.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},x.prototype._finish=function(g,y){var u=y,s,d,c;if(g[u>>2]|=128<<(u%4<<3),u>55)for(i(this._hash,g),u=0;u<16;u+=1)g[u]=0;s=this._length*8,s=s.toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(s[2],16),c=parseInt(s[1],16)||0,g[14]=d,g[15]=c,i(this._hash,g)},x.hash=function(g,y){return x.hashBinary(m(g),y)},x.hashBinary=function(g,y){var u=p(g),s=h(u);return y?A(s):s},x.ArrayBuffer=function(){this.reset()},x.ArrayBuffer.prototype.append=function(g){var y=S(this._buff.buffer,g),u=y.length,s;for(this._length+=g.byteLength,s=64;s<=u;s+=64)i(this._hash,l(y.subarray(s-64,s)));return this._buff=s-64<u?new Uint8Array(y.buffer.slice(s-64)):new Uint8Array(0),this},x.ArrayBuffer.prototype.end=function(g){var y=this._buff,u=y.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d,c;for(d=0;d<u;d+=1)s[d>>2]|=y[d]<<(d%4<<3);return this._finish(s,u),c=h(this._hash),g&&(c=A(c)),this.reset(),c},x.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},x.ArrayBuffer.prototype.getState=function(){var g=x.prototype.getState.call(this);return g.buff=k(g.buff),g},x.ArrayBuffer.prototype.setState=function(g){return g.buff=C(g.buff,!0),x.prototype.setState.call(this,g)},x.ArrayBuffer.prototype.destroy=x.prototype.destroy,x.ArrayBuffer.prototype._finish=x.prototype._finish,x.ArrayBuffer.hash=function(g,y){var u=v(new Uint8Array(g)),s=h(u);return y?A(s):s},x})})(we);var yt=we.exports;const gt=f.getDefaultExportFromCjs(yt);var J=function(){return J=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},J.apply(this,arguments)},vt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},mt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},D=Math.pow(1024,2);function bt(r,n){var e=n*D;if(e>r.size)e=r.size;else for(;r.size>e*1e4;)e*=2;for(var o=[],i=Math.ceil(r.size/e),t=0;t<i;t++){var l=r.slice(e*t,t===i-1?r.size:e*(t+1));o.push(l)}return o}function wt(r){return Object.keys(r).every(function(n){return n.indexOf("x-qn-meta-")===0})}function _t(r){return Object.keys(r).every(function(n){return n.indexOf("x:")===0})}function kt(r){return r.reduce(function(n,e){return n+e},0)}function xt(r,n,e){try{localStorage.setItem(r,JSON.stringify(n))}catch{e.warn(new E(B.WriteCacheFailed,"setLocalFileInfo failed: "+r))}}function Ct(r,n,e){var o=n==null?"_":"_key_"+n+"_";return"qiniu_js_sdk_upload_file_name_"+r+o+"size_"+e}function re(r,n){try{localStorage.removeItem(r)}catch{n.warn(new E(B.RemoveCacheFailed,"removeLocalFileInfo failed. key: "+r))}}function St(r,n){var e=null;try{e=localStorage.getItem(r)}catch{n.warn(new E(B.ReadCacheFailed,"getLocalFileInfo failed. key: "+r))}if(e==null)return null;var o=null;try{o=JSON.parse(e)}catch{re(r,n),n.warn(new E(B.InvalidCacheData,"getLocalFileInfo failed to parse. key: "+r))}return o}function Y(r){var n="UpToken "+r;return{Authorization:n}}function Bt(r){var n=Y(r);return J({"content-type":"application/octet-stream"},n)}function Et(r){var n=Y(r);return J({"content-type":"application/json"},n)}function _e(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP");throw new E(B.NotAvailableXMLHttpRequest,"the current environment does not support.")}function It(r){return vt(this,void 0,void 0,function(){var n,e;return mt(this,function(o){switch(o.label){case 0:return[4,At(r)];case 1:return n=o.sent(),e=new gt.ArrayBuffer,e.append(n),[2,e.end()]}})})}function At(r){return new Promise(function(n,e){var o=new FileReader;o.onload=function(i){if(i.target){var t=i.target.result;n(t)}else e(new E(B.InvalidProgressEventTarget,"progress event target is undefined"))},o.onerror=function(){e(new E(B.FileReaderReadFailed,"fileReader read failed"))},o.readAsArrayBuffer(r)})}function K(r,n){return new Promise(function(e,o){var i=_e();if(i.open(n.method,r),n.onCreate&&n.onCreate(i),n.headers){var t=n.headers;Object.keys(t).forEach(function(l){i.setRequestHeader(l,t[l])})}i.upload.addEventListener("progress",function(l){l.lengthComputable&&n.onProgress&&n.onProgress({loaded:l.loaded,total:l.total})}),i.onreadystatechange=function(){var l=i.responseText;if(i.readyState===4){var p=i.getResponseHeader("x-reqId")||"";if(i.status===0){o(new it("network error.",p));return}if(i.status!==200){var v="xhr request failed, code: "+i.status;l&&(v+=" response: "+l);var a=void 0;try{a=JSON.parse(l)}catch{}o(new G(i.status,p,v,a));return}try{e({data:JSON.parse(l),reqId:p})}catch(h){o(h)}}},i.send(n.body)})}function Ut(r){if(r&&r.match){var n=r.match(/(^https?)/);if(!n)return"";var e=n[1];return n=r.match(/^https?:\/\/([^:^/]*):(\d*)/),n?n[2]:e==="http"?"80":"443"}return""}function Ft(r){if(r&&r.match){var n=r.match(/^https?:\/\/([^:^/]*)/);return n?n[1]:""}return""}function ie(r){if(!r)throw new E(B.InvalidToken,"invalid token.");var n=r.split(":");if(n.length===1)throw new E(B.InvalidToken,"invalid token segments.");var e=n.length>3?n[1]:n[0];if(!e)throw new E(B.InvalidToken,"missing assess key field.");var o=null;try{o=JSON.parse(pt(n[n.length-1]))}catch{throw new E(B.InvalidToken,"token parse failed.")}if(o==null)throw new E(B.InvalidToken,"putPolicy is null.");if(o.scope==null)throw new E(B.InvalidToken,"scope field is null.");var i=o.scope.split(":")[0];if(!i)throw new E(B.InvalidToken,"resolve bucketName failed.");return{assessKey:e,bucketName:i,scope:o.scope}}var z,P={z0:"z0",z1:"z1",z2:"z2",na0:"na0",as0:"as0",cnEast2:"cn-east-2"},Ot=(z={},z[P.z0]={srcUphost:["up.qiniup.com"],cdnUphost:["upload.qiniup.com"]},z[P.z1]={srcUphost:["up-z1.qiniup.com"],cdnUphost:["upload-z1.qiniup.com"]},z[P.z2]={srcUphost:["up-z2.qiniup.com"],cdnUphost:["upload-z2.qiniup.com"]},z[P.na0]={srcUphost:["up-na0.qiniup.com"],cdnUphost:["upload-na0.qiniup.com"]},z[P.as0]={srcUphost:["up-as0.qiniup.com"],cdnUphost:["upload-as0.qiniup.com"]},z[P.cnEast2]={srcUphost:["up-cn-east-2.qiniup.com"],cdnUphost:["upload-cn-east-2.qiniup.com"]},z),V=function(r){switch(typeof r){case"string":return r;case"boolean":return r?"true":"false";case"number":return isFinite(r)?r:"";default:return""}},zt=function(r,n,e,o){return n=n||"&",e=e||"=",r===null&&(r=void 0),typeof r=="object"?Object.keys(r).map(function(i){var t=encodeURIComponent(V(i))+e;return Array.isArray(r[i])?r[i].map(function(l){return t+encodeURIComponent(V(l))}).join(n):t+encodeURIComponent(V(r[i]))}).filter(Boolean).join(n):o?encodeURIComponent(V(o))+e+encodeURIComponent(V(r)):""},ke;ke=zt;var R=function(){return R=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},R.apply(this,arguments)},Lt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Tt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Rt(r,n,e){return Lt(this,void 0,void 0,function(){var o,i;return Tt(this,function(t){return o=ke({ak:r,bucket:n}),i=e+"://api.qiniu.com/v2/query?"+o,[2,K(i,{method:"GET"})]})})}function xe(r,n,e){var o=e.url,i=e.id;return o+"/buckets/"+r+"/objects/"+(n!=null?be(n):"~")+"/uploads/"+i}function Pt(r,n,e,o){var i=o+"/buckets/"+n+"/objects/"+(e!=null?be(e):"~")+"/uploads";return K(i,{method:"POST",headers:Y(r)})}function Dt(r,n,e,o,i){var t=ie(r).bucketName,l=xe(t,n,o)+("/"+e),p=Bt(r);return i.md5&&(p["Content-MD5"]=i.md5),K(l,R(R({},i),{method:"PUT",headers:p}))}function jt(r,n,e,o){var i=ie(r).bucketName,t=xe(i,n,e);return K(t,R(R({},o),{method:"POST",headers:Et(r)}))}function Mt(r,n,e){return K(r,R({method:"POST",body:n},e))}var Z=function(){return Z=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},Z.apply(this,arguments)},ue=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},le=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Vt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},$t=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Vt(arguments[n]));return r},Ht=4,Ce=[0,502,503,504,599],qt=$t(Ce,[406]),Nt=Math.pow(1024,3),Se=function(){function r(n,e,o,i){this.hostPool=o,this.logger=i,this.aborted=!1,this.retryCount=0,this.xhrList=[],this.config=n.config,i.info("config inited.",this.config),this.putExtra=Z({fname:""},n.putExtra),i.info("putExtra inited.",this.putExtra),this.key=n.key,this.file=n.file,this.token=n.token,this.onData=e.onData,this.onError=e.onError,this.onComplete=e.onComplete;try{var t=ie(this.token);this.bucketName=t.bucketName,this.assessKey=t.assessKey}catch(l){i.error("get putPolicy from token failed.",l),this.onError(l)}}return r.prototype.checkAndUpdateUploadHost=function(){return ue(this,void 0,void 0,function(){var n;return le(this,function(e){switch(e.label){case 0:return this.logger.info("get available upload host."),[4,this.hostPool.getUp(this.assessKey,this.bucketName,this.config.upprotocol)];case 1:if(n=e.sent(),n==null)throw new E(B.NotAvailableUploadHost,"no available upload host.");return this.uploadHost!=null&&this.uploadHost.host!==n.host?this.logger.warn("host switches from "+this.uploadHost.host+" to "+n.host+"."):this.logger.info("use host "+n.host+"."),this.uploadHost=n,[2]}})})},r.prototype.checkAndUnfreezeHost=function(){this.logger.info("check unfreeze host."),this.uploadHost!=null&&this.uploadHost.isFrozen()&&(this.logger.warn(this.uploadHost.host+" will be unfrozen."),this.uploadHost.unfreeze())},r.prototype.checkAndFreezeHost=function(n){this.logger.info("check freeze host."),n instanceof G&&this.uploadHost!=null&&Ce.includes(n.code)&&(this.logger.warn(this.uploadHost.host+" will be temporarily frozen."),this.uploadHost.freeze())},r.prototype.handleError=function(n){this.logger.error(n.message),this.onError(n)},r.prototype.putFile=function(){return ue(this,void 0,void 0,function(){var n,e,o,i;return le(this,function(t){switch(t.label){case 0:if(this.aborted=!1,this.putExtra.fname||(this.logger.info("use file.name as fname."),this.putExtra.fname=this.file.name),this.file.size>1e4*Nt)return this.handleError(new E(B.InvalidFile,"file size exceed maximum value 10000G")),[2];if(this.putExtra.customVars&&!_t(this.putExtra.customVars))return this.handleError(new E(B.InvalidCustomVars,"customVars key should start width x:")),[2];if(this.putExtra.metadata&&!wt(this.putExtra.metadata))return this.handleError(new E(B.InvalidMetadata,"metadata key should start with x-qn-meta-")),[2];t.label=1;case 1:return t.trys.push([1,4,,5]),this.uploadAt=new Date().getTime(),[4,this.checkAndUpdateUploadHost()];case 2:return t.sent(),[4,this.run()];case 3:return n=t.sent(),this.onComplete(n.data),this.checkAndUnfreezeHost(),this.sendLog(n.reqId,200),[2];case 4:return e=t.sent(),this.aborted?(this.logger.warn("upload is aborted."),this.sendLog("",-2),[2]):(this.clear(),this.logger.error(e),e instanceof G&&(this.sendLog(e.reqId,e.code),this.checkAndFreezeHost(e),o=++this.retryCount<=this.config.retryCount,i=qt.includes(e.code),i&&o)?(this.logger.warn("error auto retry: "+this.retryCount+"/"+this.config.retryCount+"."),this.putFile(),[2]):(this.onError(e),[3,5]));case 5:return[2]}})})},r.prototype.clear=function(){this.xhrList.forEach(function(n){n.onreadystatechange=null,n.abort()}),this.xhrList=[],this.logger.info("cleanup uploading xhr.")},r.prototype.stop=function(){this.logger.info("aborted."),this.clear(),this.aborted=!0},r.prototype.addXhr=function(n){this.xhrList.push(n)},r.prototype.sendLog=function(n,e){var o,i;this.logger.report({code:e,reqId:n,remoteIp:"",upType:"jssdk-h5",size:this.file.size,time:Math.floor(this.uploadAt/1e3),port:Ut((o=this.uploadHost)===null||o===void 0?void 0:o.getUrl()),host:Ft((i=this.uploadHost)===null||i===void 0?void 0:i.getUrl()),bytesSent:this.progress?this.progress.total.loaded:0,duration:Math.floor((new Date().getTime()-this.uploadAt)/1e3)})},r.prototype.getProgressInfoItem=function(n,e,o){return Z({size:e,loaded:n,percent:n/e*100},o==null?{}:{fromCache:o})},r}(),Gt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),N=function(){return N=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},N.apply(this,arguments)},$=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},H=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};function Kt(r){var n=/^[1-9]\d*$/;return n.test(String(r))}var Xt=function(r){Gt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return $(this,void 0,void 0,function(){var e,o,i,t,l,p=this;return H(this,function(v){switch(v.label){case 0:if(this.logger.info("start run Resume."),!this.config.chunkSize||!Kt(this.config.chunkSize))throw new E(B.InvalidChunkSize,"chunkSize must be a positive integer");if(this.config.chunkSize>1024)throw new E(B.InvalidChunkSize,"chunkSize maximum value is 1024");return[4,this.initBeforeUploadChunks()];case 1:v.sent(),e=new ot(function(a){return $(p,void 0,void 0,function(){return H(this,function(h){switch(h.label){case 0:if(this.aborted)throw e.abort(),new Error("pool is aborted");return[4,this.uploadChunk(a)];case 1:return h.sent(),[2]}})})},this.config.concurrentRequestLimit),o=null,i=this.getLocalKey(),t=this.chunks.map(function(a,h){return e.enqueue({chunk:a,index:h})}),v.label=2;case 2:return v.trys.push([2,5,,6]),[4,Promise.all(t)];case 3:return v.sent(),[4,this.mkFileReq()];case 4:return o=v.sent(),[3,6];case 5:throw l=v.sent(),l instanceof G&&(l.code===612||l.code===400)&&re(i,this.logger),l;case 6:return re(i,this.logger),[2,o]}})})},n.prototype.uploadChunk=function(e){return $(this,void 0,void 0,function(){var o,i,t,l,p,v,a,h,m,C=this;return H(this,function(k){switch(k.label){case 0:return o=e.index,i=e.chunk,t=this.cachedUploadedList[o],this.logger.info("upload part "+o+", cache:",t),l=this.config.checkByMD5,p=function(){C.usedCacheList[o]=!0,C.updateChunkProgress(i.size,o),C.uploadedList[o]=t,C.updateLocalCache()},t&&!l?(p(),[2]):[4,It(i)];case 1:return v=k.sent(),this.logger.info("computed part md5.",v),t&&v===t.md5?(p(),[2]):(this.usedCacheList[o]=!1,a=function(S){C.updateChunkProgress(S.loaded,o)},h={body:i,md5:this.config.checkByServer?v:void 0,onProgress:a,onCreate:function(S){return C.addXhr(S)}},this.logger.info("part "+o+" start uploading."),[4,Dt(this.token,this.key,e.index+1,this.getUploadInfo(),h)]);case 2:return m=k.sent(),this.logger.info("part "+o+" upload completed."),a({loaded:i.size,total:i.size}),this.uploadedList[o]={etag:m.data.etag,md5:m.data.md5,size:i.size},this.updateLocalCache(),[2]}})})},n.prototype.mkFileReq=function(){return $(this,void 0,void 0,function(){var e,o,i=this;return H(this,function(t){switch(t.label){case 0:return e=N(N(N({parts:this.uploadedList.map(function(l,p){return{etag:l.etag,partNumber:p+1}}),fname:this.putExtra.fname},this.putExtra.mimeType&&{mimeType:this.putExtra.mimeType}),this.putExtra.customVars&&{customVars:this.putExtra.customVars}),this.putExtra.metadata&&{metadata:this.putExtra.metadata}),this.logger.info("parts upload completed, make file.",e),[4,jt(this.token,this.key,this.getUploadInfo(),{onCreate:function(l){return i.addXhr(l)},body:JSON.stringify(e)})];case 1:return o=t.sent(),this.logger.info("finish Resume Progress."),this.updateMkFileProgress(1),[2,o]}})})},n.prototype.initBeforeUploadChunks=function(){return $(this,void 0,void 0,function(){var e,o,i;return H(this,function(t){switch(t.label){case 0:return this.uploadedList=[],this.usedCacheList=[],e=St(this.getLocalKey(),this.logger),e?[3,2]:(this.logger.info("init upload parts from api."),[4,Pt(this.token,this.bucketName,this.key,this.uploadHost.getUrl())]);case 1:return o=t.sent(),this.logger.info("initd upload parts of id: "+o.data.uploadId+"."),this.uploadId=o.data.uploadId,this.cachedUploadedList=[],[3,3];case 2:i=["resume upload parts from local cache,","total "+e.data.length+" part,","id is "+e.id+"."],this.logger.info(i.join(" ")),this.cachedUploadedList=e.data,this.uploadId=e.id,t.label=3;case 3:return this.chunks=bt(this.file,this.config.chunkSize),this.loaded={mkFileProgress:0,chunks:this.chunks.map(function(l){return 0})},this.notifyResumeProgress(),[2]}})})},n.prototype.getUploadInfo=function(){return{id:this.uploadId,url:this.uploadHost.getUrl()}},n.prototype.getLocalKey=function(){return Ct(this.file.name,this.key,this.file.size)},n.prototype.updateLocalCache=function(){xt(this.getLocalKey(),{id:this.uploadId,data:this.uploadedList},this.logger)},n.prototype.updateChunkProgress=function(e,o){this.loaded.chunks[o]=e,this.notifyResumeProgress()},n.prototype.updateMkFileProgress=function(e){this.loaded.mkFileProgress=e,this.notifyResumeProgress()},n.prototype.notifyResumeProgress=function(){var e=this;this.progress={total:this.getProgressInfoItem(kt(this.loaded.chunks)+this.loaded.mkFileProgress,this.file.size+1),chunks:this.chunks.map(function(o,i){var t=e.usedCacheList[i];return e.getProgressInfoItem(e.loaded.chunks[i],o.size,t)}),uploadInfo:{id:this.uploadId,url:this.uploadHost.getUrl()}},this.onData(this.progress)},n}(Se),ce=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},fe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},Wt=function(){function r(){this.crc=-1,this.table=this.makeTable()}return r.prototype.makeTable=function(){for(var n=new Array,e=0;e<256;e++){for(var o=e,i=0;i<8;i++)o&1?o=o>>>1^3988292384:o>>>=1;n[e]=o}return n},r.prototype.append=function(n){for(var e=this.crc,o=0;o<n.byteLength;o++)e=e>>>8^this.table[(e^n[o])&255];this.crc=e},r.prototype.compute=function(){return(this.crc^-1)>>>0},r.prototype.readAsUint8Array=function(n){return ce(this,void 0,void 0,function(){var e;return fe(this,function(o){switch(o.label){case 0:return typeof n.arrayBuffer!="function"?[3,2]:(e=Uint8Array.bind,[4,n.arrayBuffer()]);case 1:return[2,new(e.apply(Uint8Array,[void 0,o.sent()]))];case 2:return[2,new Promise(function(i,t){var l=new FileReader;l.onload=function(){if(l.result==null){t();return}if(typeof l.result=="string"){t();return}i(new Uint8Array(l.result))},l.readAsArrayBuffer(n)})]}})})},r.prototype.file=function(n){return ce(this,void 0,void 0,function(){var e,o,i,t,l,p;return fe(this,function(v){switch(v.label){case 0:return n.size<=D?(e=this.append,[4,this.readAsUint8Array(n)]):[3,2];case 1:return e.apply(this,[v.sent()]),[2,this.compute()];case 2:o=Math.ceil(n.size/D),i=0,v.label=3;case 3:return i<o?(t=i*D,l=i===o-1?n.size:t+D,[4,this.readAsUint8Array(n.slice(t,l))]):[3,6];case 4:p=v.sent(),this.append(new Uint8Array(p)),v.label=5;case 5:return i++,[3,3];case 6:return[2,this.compute()]}})})},r.file=function(n){var e=new r;return e.file(n)},r}(),Jt=function(){var r=function(n,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var t in i)i.hasOwnProperty(t)&&(o[t]=i[t])},r(n,e)};return function(n,e){r(n,e);function o(){this.constructor=n}n.prototype=e===null?Object.create(e):(o.prototype=e.prototype,new o)}}(),Zt=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},Yt=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},de=function(r){Jt(n,r);function n(){return r!==null&&r.apply(this,arguments)||this}return n.prototype.run=function(){return Zt(this,void 0,void 0,function(){var e,o,i,t,l,p,v=this;return Yt(this,function(a){switch(a.label){case 0:return this.logger.info("start run Direct."),e=new FormData,this.putExtra.mimeType?(o=this.file.slice(0,this.file.size,this.putExtra.mimeType),e.append("file",o,this.putExtra.fname||this.file.name)):e.append("file",this.file,this.putExtra.fname||this.file.name),e.append("token",this.token),this.key!=null&&e.append("key",this.key),e.append("fname",this.putExtra.fname),this.config.checkByServer?[4,Wt.file(this.file)]:[3,2];case 1:i=a.sent(),e.append("crc32",i.toString()),a.label=2;case 2:return this.putExtra.customVars&&(this.logger.info("init customVars."),t=this.putExtra.customVars,Object.keys(t).forEach(function(h){return e.append(h,t[h].toString())}),this.logger.info("customVars inited.")),this.putExtra.metadata&&(this.logger.info("init metadata."),l=this.putExtra.metadata,Object.keys(l).forEach(function(h){return e.append(h,l[h].toString())})),this.logger.info("formData inited."),[4,Mt(this.uploadHost.getUrl(),e,{onProgress:function(h){v.updateDirectProgress(h.loaded,h.total)},onCreate:function(h){return v.addXhr(h)}})];case 3:return p=a.sent(),this.logger.info("Direct progress finish."),this.finishDirectProgress(),[2,p]}})})},n.prototype.updateDirectProgress=function(e,o){this.progress={total:this.getProgressInfoItem(e,o+1)},this.onData(this.progress)},n.prototype.finishDirectProgress=function(){if(!this.progress){this.logger.warn("progress is null."),this.progress={total:this.getProgressInfoItem(this.file.size,this.file.size)},this.onData(this.progress);return}var e=this.progress.total;this.progress={total:this.getProgressInfoItem(e.loaded+1,e.size)},this.onData(this.progress)},n}(Se);function Be(r,n,e){e===void 0&&(e=3);var o=_e();o.open("POST","https://uplog.qbox.me/log/3"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded"),o.setRequestHeader("Authorization",Y(r).Authorization),o.onreadystatechange=function(){o.readyState===4&&o.status!==200&&e>0&&Be(r,n,e-1)};var i=[n.code||"",n.reqId||"",n.host||"",n.remoteIp||"",n.port||"",n.duration||"",n.time||"",n.bytesSent||"",n.upType||"",n.size||""].join(",");o.send(i)}var Qt=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},ee=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(Qt(arguments[n]));return r},en=function(){function r(n,e,o,i){e===void 0&&(e=!0),o===void 0&&(o="OFF"),i===void 0&&(i="UPLOAD"),this.token=n,this.disableReport=e,this.level=o,this.prefix=i,this.id=++r.id}return r.prototype.getPrintPrefix=function(n){return"Qiniu-JS-SDK ["+n+"]["+this.prefix+"#"+this.id+"]:"},r.prototype.report=function(n,e){if(!this.disableReport)try{Be(this.token,n,e)}catch(o){this.warn(o)}},r.prototype.info=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO"];o.includes(this.level)&&console.log.apply(console,ee([this.getPrintPrefix("INFO")],n))},r.prototype.warn=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN"];o.includes(this.level)&&console.warn.apply(console,ee([this.getPrintPrefix("WARN")],n))},r.prototype.error=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var o=["INFO","WARN","ERROR"];o.includes(this.level)&&console.error.apply(console,ee([this.getPrintPrefix("ERROR")],n))},r.id=0,r}(),he=function(r,n,e,o){function i(t){return t instanceof e?t:new e(function(l){l(t)})}return new(e||(e=Promise))(function(t,l){function p(h){try{a(o.next(h))}catch(m){l(m)}}function v(h){try{a(o.throw(h))}catch(m){l(m)}}function a(h){h.done?t(h.value):i(h.value).then(p,v)}a((o=o.apply(r,n||[])).next())})},pe=function(r,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},o,i,t,l;return l={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function p(a){return function(h){return v([a,h])}}function v(a){if(o)throw new TypeError("Generator is already executing.");for(;e;)try{if(o=1,i&&(t=a[0]&2?i.return:a[0]?i.throw||((t=i.return)&&t.call(i),0):i.next)&&!(t=t.call(i,a[1])).done)return t;switch(i=0,t&&(a=[a[0]&2,t.value]),a[0]){case 0:case 1:t=a;break;case 4:return e.label++,{value:a[1],done:!1};case 5:e.label++,i=a[1],a=[0];continue;case 7:a=e.ops.pop(),e.trys.pop();continue;default:if(t=e.trys,!(t=t.length>0&&t[t.length-1])&&(a[0]===6||a[0]===2)){e=0;continue}if(a[0]===3&&(!t||a[1]>t[0]&&a[1]<t[3])){e.label=a[1];break}if(a[0]===6&&e.label<t[1]){e.label=t[1],t=a;break}if(t&&e.label<t[2]){e.label=t[2],e.ops.push(a);break}t[2]&&e.ops.pop(),e.trys.pop();continue}a=n.call(r,e)}catch(h){a=[6,h],i=0}finally{o=t=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},tn=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},nn=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(tn(arguments[n]));return r},W=new Map,rn=function(){function r(n,e){this.host=n,this.protocol=e}return r.prototype.isFrozen=function(){var n=new Date().getTime(),e=W.get(this.host);return e!=null&&e>=n},r.prototype.freeze=function(n){n===void 0&&(n=20);var e=new Date().getTime()+n*1e3;W.set(this.host,e)},r.prototype.unfreeze=function(){W.delete(this.host)},r.prototype.getUrl=function(){return this.protocol+"://"+this.host},r.prototype.getUnfreezeTime=function(){return W.get(this.host)},r}(),on=function(){function r(n){n===void 0&&(n=[]),this.initHosts=n,this.cachedHostsMap=new Map}return r.prototype.register=function(n,e,o,i){this.cachedHostsMap.set(n+"@"+e,o.map(function(t){return new rn(t,i)}))},r.prototype.refresh=function(n,e,o){var i,t,l,p;return he(this,void 0,void 0,function(){var v,a,h;return pe(this,function(m){switch(m.label){case 0:return v=this.cachedHostsMap.get(n+"@"+e)||[],v.length>0?[2]:this.initHosts.length>0?(this.register(n,e,this.initHosts,o),[2]):[4,Rt(n,e,o)];case 1:return a=m.sent(),(a==null?void 0:a.data)!=null&&(h=nn(((t=(i=a.data.up)===null||i===void 0?void 0:i.acc)===null||t===void 0?void 0:t.main)||[],((p=(l=a.data.up)===null||l===void 0?void 0:l.acc)===null||p===void 0?void 0:p.backup)||[]),this.register(n,e,h,o)),[2]}})})},r.prototype.getUp=function(n,e,o){return he(this,void 0,void 0,function(){var i,t,l;return pe(this,function(p){switch(p.label){case 0:return[4,this.refresh(n,e,o)];case 1:return p.sent(),i=this.cachedHostsMap.get(n+"@"+e)||[],i.length===0?[2,null]:(t=i.filter(function(v){return!v.isFrozen()}),t.length>0?[2,t[0]]:(l=i.slice().sort(function(v,a){return(v.getUnfreezeTime()||0)-(a.getUnfreezeTime()||0)}),[2,l[0]]))}})})},r}();function an(r,n,e,o){return r.config&&r.config.forceDirect?(o.info("ues forceDirect mode."),new de(r,n,e,o)):r.file.size>4*D?(o.info("file size over 4M, use Resume."),new Xt(r,n,e,o)):(o.info("file size less or equal than 4M, use Direct."),new de(r,n,e,o))}function sn(r,n,e,o,i){var t=new en(e,void 0,void 0,r.name),l={file:r,key:n,token:e,putExtra:o,config:cn(i)},p=new on(l.config.uphost);return new lt(function(v){var a=an(l,{onData:function(h){return v.next(h)},onError:function(h){return v.error(h)},onComplete:function(h){return v.complete(h)}},p,t);return a.putFile(),a.stop.bind(a)})}var j=function(){return j=Object.assign||function(r){for(var n,e=1,o=arguments.length;e<o;e++){n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])}return r},j.apply(this,arguments)},un=function(r,n){var e={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.indexOf(o)<0&&(e[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,o=Object.getOwnPropertySymbols(r);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(r,o[i])&&(e[o[i]]=r[o[i]]);return e},ln=function(r,n){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var o=e.call(r),i,t=[],l;try{for(;(n===void 0||n-- >0)&&!(i=o.next()).done;)t.push(i.value)}catch(p){l={error:p}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(l)throw l.error}}return t},te=function(){for(var r=[],n=0;n<arguments.length;n++)r=r.concat(ln(arguments[n]));return r};function cn(r,n){var e=j({},r),o=e.upprotocol,i=e.uphost,t=un(e,["upprotocol","uphost"]),l=j({uphost:[],retryCount:3,checkByMD5:!1,forceDirect:!1,useCdnDomain:!0,checkByServer:!0,concurrentRequestLimit:3,chunkSize:Ht,upprotocol:"https",debugLogLevel:"OFF",disableStatisticsReport:!1},t);o&&(l.upprotocol=o.replace(/:$/,""));var p=[];if(i)Array.isArray(i)?p.push.apply(p,te(i)):p.push(i);else if(l!=null&&l.region){var v=Ot[l==null?void 0:l.region];l.useCdnDomain?p.push.apply(p,te(v.cdnUphost)):p.push.apply(p,te(v.srcUphost))}return j(j({},l),{uphost:p.filter(Boolean)})}var ye={PNG:"image/png",JPEG:"image/jpeg",WEBP:"image/webp",BMP:"image/bmp"};Object.keys(ye).map(function(r){return ye[r]});let ne=null;async function fn(r,n,e={}){if(!n){console.error("UID is required to upload file to other user's cloud storage");return}return ne||await i(),await t();async function i(){let{data:p}=await f.globalInject.$axios.get("/v2/form/uploadToken");if(p.status===1)ne=p.result;else throw new Error(p.msg)}async function t(){let p=e.path||"att_file/";const v=ge(e.name||r.name),a=parseInt(Date.now()/1e3).toString(),h=p+n+"/"+a+"_"+l()+"_."+ge(v);return sn(r,h,ne)}function l(){let p="";for(let v=0;v<6;v++){const a=parseInt(Math.random()*10);p+=a}return p}}const ge=r=>r.split(".").pop(),Ee=r=>(f.pushScopeId("data-v-45101ef0"),r=r(),f.popScopeId(),r),dn={class:"ocr-widget-box widget-box"},hn={class:"ocr-header"},pn={key:1,class:"ocr-image-preview"},yn=["src"],gn={key:0,class:"loading-overlay"},vn=Ee(()=>f.createBaseVNode("span",{class:"loading-spinner-icon"},null,-1)),mn=[vn],bn=Ee(()=>f.createBaseVNode("span",{class:"reupload-text"},"重新上传",-1)),wn=[bn],_n={key:0,class:"ocr-error-bar"},kn={class:"error-text"},xn=f.defineComponent({__name:"OcrWidget",props:{id:{},type:{},attrs:{},value:{}},emits:["update:value"],setup(r,{emit:n}){const e=r,o=n,i=f.inject("editable"),t=f.inject("formMode"),l=f.computed(()=>t.value==="answer-preview"),p=f.computed(()=>t.value==="input"||t.value==="preview"),v=f.ref(!1),a=f.ref(""),h=f.ref(!1),m=f.ref(!1),C=f.ref(""),k=["购买方","销售方","货物或应税劳务、服务"],S=f.ref(""),A=f.ref(""),x=f.ref(!1),g=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{k.includes(w.name)?b[_.key]=w.name+_.label:b[_.key]=_.label})}),b}),y=f.computed(()=>{const b={};for(const[w,_]of Object.entries(g.value))b[_]=w;return b}),u=f.computed(()=>{const b=e.value;if(!b)return{};if(typeof b=="object"&&"fields"in b)return b.fields||{};const w=b,_={};for(const[U,L]of Object.entries(w)){const T=y.value[U]||U;_[T]=L}return _}),s=f.computed(()=>({imageUrl:S.value,imageKey:A.value,recognized:x.value,fields:u.value}));function d(b){const w={};for(const[_,U]of Object.entries(b)){const L=g.value[_]||_;w[L]=U}return w}const c=f.ref(""),I=f.ref("");async function F(b){const w=await f.getCreateUid(),_=await fn(b,w);return new Promise((U,L)=>{_.subscribe({error:T=>L(T),complete:T=>U(T)})})}const O=f.computed(()=>{const b=[];return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1).forEach(_=>{if(_.label){let U=_.label;k.includes(w.name)&&(U=w.name+U),b.push(U)}})}),b}),X=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.filter(_=>_.visible!==!1&&_.label).forEach(_=>{b[_.label]=_.key,k.includes(w.name)&&(b[w.name+_.label]=_.key)})}),b}),oe=f.computed(()=>!!C.value||!!s.value.imageUrl),Ie=f.computed(()=>i||l.value?!1:!!(s.value.recognized||h.value)),Ae=f.computed(()=>{const b={};return e.attrs.sections.forEach(w=>{w.fields.forEach(_=>{b[_.key]=""})}),b}),Ue=f.computed(()=>e.attrs.sections.map(b=>({...b,fields:b.fields.filter(w=>w.visible!==!1).map(w=>{var _;return{...w,value:((_=s.value.fields)==null?void 0:_[w.key])??""}})})).filter(b=>b.fields.length>0));function M(b){b.imageUrl!==void 0&&(S.value=b.imageUrl),b.imageKey!==void 0&&(A.value=b.imageKey),b.recognized!==void 0&&(x.value=b.recognized);const w="fields"in b?b.fields:u.value;o("update:value",d(w))}async function Fe(b){if(!b)return m.value=!0,null;try{const w=await rt({url:b,keys:O.value}),_={};for(const[U,L]of Object.entries(w.fields)){const T=X.value[U]||U;_[T]=L}return _}catch(w){const _=w instanceof Error?w.message:"识别失败";return _.includes("超时")||_.includes("timeout"),m.value=!0,null}}async function Oe(b){C.value=URL.createObjectURL(b),v.value=!0,a.value="",m.value=!1,h.value=!1,M({fields:{},recognized:!1});try{const{key:w}=await F(b);if(!w){f.ElMessage.error("上传失败");return}I.value=w,c.value="https://fatt.bmwax.cn/"+w,M({imageUrl:c.value,imageKey:w});const _=await Fe(c.value);if(v.value=!1,se(),_){const U={...Ae.value,..._};M({fields:U,recognized:!0}),m.value=!1}else a.value="识别失败,请确保图片清晰、无遮挡并重新上传",m.value=!0}catch(w){v.value=!1,se(),a.value=w.message||"识别失败",Q()}}function ze(b,w){M({fields:{...s.value.fields,[b]:w}})}function ae(){M({imageUrl:"",imageKey:"",recognized:!1,fields:{}}),c.value="",I.value="",a.value="",v.value=!1,m.value=!1,h.value=!1,Q()}function Q(){C.value&&(URL.revokeObjectURL(C.value),C.value="")}f.onUnmounted(()=>{Q()});function se(){h.value=!0,a.value=""}return(b,w)=>(f.openBlock(),f.createElementBlock("div",dn,[f.createVNode(f._sfc_main),f.createVNode(f.ChoosenView,null,{default:f.withCtx(()=>[f.createVNode(f._sfc_main$1),f.createBaseVNode("div",{class:f.normalizeClass(["ocr-container",{disabled:f.unref(i)||l.value,"landing-layout":p.value}])},[f.createBaseVNode("div",hn,[oe.value?f.createCommentVNode("",!0):(f.openBlock(),f.createBlock(Ve,{key:0,editable:f.unref(i),"allow-camera":b.attrs.allowCamera,"allow-gallery":b.attrs.allowGallery,"is-landing":p.value,onUpload:Oe},null,8,["editable","allow-camera","allow-gallery","is-landing"])),oe.value?(f.openBlock(),f.createElementBlock("div",pn,[f.createBaseVNode("img",{src:C.value||s.value.imageUrl,alt:"上传图片"},null,8,yn),v.value?(f.openBlock(),f.createElementBlock("div",gn,mn)):a.value?(f.openBlock(),f.createElementBlock("div",{key:1,class:"error-overlay",onClick:ae},wn)):f.createCommentVNode("",!0),a.value?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock("span",{key:2,class:"close-icon iconfont icon-form-close",onClick:ae}))])):f.createCommentVNode("",!0)]),a.value?(f.openBlock(),f.createElementBlock("div",_n,[f.createBaseVNode("span",kn,f.toDisplayString(a.value),1)])):f.createCommentVNode("",!0),f.createVNode(nt,{sections:Ue.value,"ocr-data":s.value.fields,"can-edit":Ie.value,"ocr-type":b.attrs.ocrType,"is-landing":p.value,"onUpdate:field":ze},null,8,["sections","ocr-data","can-edit","ocr-type","is-landing"])],2),f.createVNode(f.VerifyTip),f.createVNode(f._sfc_main$2)]),_:1})]))}}),Cn=f._export_sfc(xn,[["__scopeId","data-v-45101ef0"]]);exports.default=Cn;
@@ -1 +1 @@
1
- "use strict";const e=require("./main-BJ5jMLtY.cjs"),u=require("./index-CZBdUlB7.cjs"),i=e.defineComponent({__name:"OptionRandom",setup(l){const o=e.computed({get:()=>e.activeWidgetAttrs.value.optionRandom,set:t=>e.setOptionRandom(t)});return(t,n)=>o.value!==void 0?(e.openBlock(),e.createBlock(e.unref(u.SwitchRow),{key:0,label:"选项随机排列",modelValue:o.value,"onUpdate:modelValue":n[0]||(n[0]=a=>o.value=a)},null,8,["modelValue"])):e.createCommentVNode("",!0)}});exports._sfc_main=i;
1
+ "use strict";const e=require("./main-DgF763FD.cjs"),u=require("./index-1Dr1c6UI.cjs"),i=e.defineComponent({__name:"OptionRandom",setup(l){const o=e.computed({get:()=>e.activeWidgetAttrs.value.optionRandom,set:t=>e.setOptionRandom(t)});return(t,n)=>o.value!==void 0?(e.openBlock(),e.createBlock(e.unref(u.SwitchRow),{key:0,label:"选项随机排列",modelValue:o.value,"onUpdate:modelValue":n[0]||(n[0]=a=>o.value=a)},null,8,["modelValue"])):e.createCommentVNode("",!0)}});exports._sfc_main=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),f={class:"page-header-view"},y=e.defineComponent({__name:"PageHeader",props:{attrs:{}},setup(d){const a=d,n=e.inject("editable"),u=e.inject("isMobileSize"),c=e.computed(()=>n?!0:!!a.attrs.desc),p=e.computed(()=>e.headerWidget.value.id===e.activeWidgetId.value),s=e.computed(()=>!n||!p.value),l=e.computed({get:()=>a.attrs.title,set:t=>{e.setPageHeaderAttrs("title",t)}}),i=e.computed({get:()=>a.attrs.desc,set:t=>{e.setPageHeaderAttrs("desc",t)}}),g=e.computed(()=>n?"40px 50px":u.value?"30px 20px 10px":"30px 20px 20px"),m=t=>{n&&t.target.select()},v=()=>{const t=l.value||"";t.trim()===""?e.setPageHeaderAttrs("title",e.getSceneFormTitle()):e.setPageHeaderAttrs("title",t)},x=t=>{n&&t.target.select()};return e.watch(()=>a.attrs.title,t=>{e.globalInject.setFormName(t)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createBaseVNode("div",{class:"title-desc-view",style:e.normalizeStyle({padding:g.value})},[e.createVNode(e.unref(e.ElInput),{type:"textarea",autosize:"",resize:"none",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r),maxlength:64,readonly:!e.unref(n),"input-style":{fontSize:"20px",fontWeight:"600",color:"#333333",textAlign:t.attrs.align,scrollbarWidth:"none",...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:m,onBlur:v},null,8,["modelValue","readonly","input-style"]),c.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=r=>i.value=r),type:"textarea",autosize:"",resize:"none",placeholder:"请描述你的问卷",readonly:!e.unref(n),style:e.normalizeStyle({marginTop:e.unref(n)?"10px":"0px"}),"input-style":{padding:"10px",fontSize:"14px",scrollbarWidth:"none",textAlign:t.attrs.align,...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:x},null,8,["modelValue","readonly","style","input-style"])):e.createCommentVNode("",!0)],4)]))}}),b=e._export_sfc(y,[["__scopeId","data-v-87c94f3d"]]);exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),f={class:"page-header-view"},y=e.defineComponent({__name:"PageHeader",props:{attrs:{}},setup(d){const a=d,n=e.inject("editable"),u=e.inject("isMobileSize"),c=e.computed(()=>n?!0:!!a.attrs.desc),p=e.computed(()=>e.headerWidget.value.id===e.activeWidgetId.value),s=e.computed(()=>!n||!p.value),l=e.computed({get:()=>a.attrs.title,set:t=>{e.setPageHeaderAttrs("title",t)}}),i=e.computed({get:()=>a.attrs.desc,set:t=>{e.setPageHeaderAttrs("desc",t)}}),g=e.computed(()=>n?"40px 50px":u.value?"30px 20px 10px":"30px 20px 20px"),m=t=>{n&&t.target.select()},v=()=>{const t=l.value||"";t.trim()===""?e.setPageHeaderAttrs("title",e.getSceneFormTitle()):e.setPageHeaderAttrs("title",t)},x=t=>{n&&t.target.select()};return e.watch(()=>a.attrs.title,t=>{e.globalInject.setFormName(t)}),(t,o)=>(e.openBlock(),e.createElementBlock("div",f,[e.createBaseVNode("div",{class:"title-desc-view",style:e.normalizeStyle({padding:g.value})},[e.createVNode(e.unref(e.ElInput),{type:"textarea",autosize:"",resize:"none",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=r=>l.value=r),maxlength:64,readonly:!e.unref(n),"input-style":{fontSize:"20px",fontWeight:"600",color:"#333333",textAlign:t.attrs.align,scrollbarWidth:"none",...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:m,onBlur:v},null,8,["modelValue","readonly","input-style"]),c.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,modelValue:i.value,"onUpdate:modelValue":o[1]||(o[1]=r=>i.value=r),type:"textarea",autosize:"",resize:"none",placeholder:"请描述你的问卷",readonly:!e.unref(n),style:e.normalizeStyle({marginTop:e.unref(n)?"10px":"0px"}),"input-style":{padding:"10px",fontSize:"14px",scrollbarWidth:"none",textAlign:t.attrs.align,...s.value&&{boxShadow:"none",background:"transparent"}},onFocus:x},null,8,["modelValue","readonly","style","input-style"])):e.createCommentVNode("",!0)],4)]))}}),b=e._export_sfc(y,[["__scopeId","data-v-87c94f3d"]]);exports.default=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),o=require("./index-CZBdUlB7.cjs"),n={class:"page-header-setting"},l=e.defineComponent({__name:"PageHeaderSetting",setup(d){e.ref(!1);const r=a=>{e.setPageHeaderAttrs("align",a)};return(a,c)=>{const t=e.resolveComponent("icon");return e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(o.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("标题设置")]),_:1}),e.createVNode(e.unref(o.Row),{wrap:"",label:"标题对齐方式"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadioGroup),{class:"align-radio-group","model-value":e.unref(e.headerWidget).attrs.align,onChange:r},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadio),{value:"left"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-left"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"center"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-center"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"right"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-right"})]),_:1})]),_:1},8,["model-value"])]),_:1})])}}}),i=e._export_sfc(l,[["__scopeId","data-v-c595fe0e"]]);exports.default=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),o=require("./index-1Dr1c6UI.cjs"),n={class:"page-header-setting"},l=e.defineComponent({__name:"PageHeaderSetting",setup(d){e.ref(!1);const r=a=>{e.setPageHeaderAttrs("align",a)};return(a,c)=>{const t=e.resolveComponent("icon");return e.openBlock(),e.createElementBlock("div",n,[e.createVNode(e.unref(o.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("标题设置")]),_:1}),e.createVNode(e.unref(o.Row),{wrap:"",label:"标题对齐方式"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadioGroup),{class:"align-radio-group","model-value":e.unref(e.headerWidget).attrs.align,onChange:r},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElRadio),{value:"left"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-left"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"center"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-center"})]),_:1}),e.createVNode(e.unref(e.ElRadio),{value:"right"},{default:e.withCtx(()=>[e.createVNode(t,{type:"align-right"})]),_:1})]),_:1},8,["model-value"])]),_:1})])}}}),i=e._export_sfc(l,[["__scopeId","data-v-c595fe0e"]]);exports.default=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),c=n=>(e.pushScopeId("data-v-f49720f0"),n=n(),e.popScopeId(),n),u={key:0,class:"editor-pagination"},p={class:"line-row"},m=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),_={class:"info"},v=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),f={key:1,class:"input-pagination"},g=c(()=>e.createBaseVNode("div",{class:"line-row"},null,-1)),y={key:0,class:"title"},k={key:1,class:"desc"},V=e.defineComponent({__name:"Pagination",setup(n){const a=e.inject("editable"),t=e.inject("widgetStore"),r=e.computed(()=>!a||!t.isActive),s=e.computed({get:()=>t.attrs.title,set:l=>{t.updateAttr("title",l||"")}}),o=e.computed({get:()=>t.attrs.desc,set:l=>{t.updateAttr("desc",l||"")}});return(l,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("div",u,[e.createBaseVNode("div",p,[m,e.createBaseVNode("div",_,e.toDisplayString(`第${e.unref(t).index+1}页(共${e.unref(e.groupedWidgets).paginationList.length}页)`),1),v]),e.createVNode(e.unref(e.ElInput),{class:"title",modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=d=>s.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页标题",readonly:!e.unref(a),resize:"none","input-style":{padding:"10px",fontSize:"16px",color:"#1a1a1a",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"]),e.unref(t).isActive||o.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,class:"desc",modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=d=>o.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页提示",readonly:!e.unref(a),resize:"none","input-style":{padding:"8px 10px",fontSize:"14px",color:"#767676",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"])):e.createCommentVNode("",!0),e.createVNode(e._sfc_main$2)])):(e.openBlock(),e.createElementBlock("div",f,[g,s.value?(e.openBlock(),e.createElementBlock("div",y,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)]))}}),h=e._export_sfc(V,[["__scopeId","data-v-f49720f0"]]);exports.default=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),c=n=>(e.pushScopeId("data-v-f49720f0"),n=n(),e.popScopeId(),n),u={key:0,class:"editor-pagination"},p={class:"line-row"},m=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),_={class:"info"},v=c(()=>e.createBaseVNode("div",{class:"line"},null,-1)),f={key:1,class:"input-pagination"},g=c(()=>e.createBaseVNode("div",{class:"line-row"},null,-1)),y={key:0,class:"title"},k={key:1,class:"desc"},V=e.defineComponent({__name:"Pagination",setup(n){const a=e.inject("editable"),t=e.inject("widgetStore"),r=e.computed(()=>!a||!t.isActive),s=e.computed({get:()=>t.attrs.title,set:l=>{t.updateAttr("title",l||"")}}),o=e.computed({get:()=>t.attrs.desc,set:l=>{t.updateAttr("desc",l||"")}});return(l,i)=>e.unref(a)?(e.openBlock(),e.createElementBlock("div",u,[e.createBaseVNode("div",p,[m,e.createBaseVNode("div",_,e.toDisplayString(`第${e.unref(t).index+1}页(共${e.unref(e.groupedWidgets).paginationList.length}页)`),1),v]),e.createVNode(e.unref(e.ElInput),{class:"title",modelValue:s.value,"onUpdate:modelValue":i[0]||(i[0]=d=>s.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页标题",readonly:!e.unref(a),resize:"none","input-style":{padding:"10px",fontSize:"16px",color:"#1a1a1a",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"]),e.unref(t).isActive||o.value?(e.openBlock(),e.createBlock(e.unref(e.ElInput),{key:0,class:"desc",modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=d=>o.value=d),type:"textarea",autosize:{minRows:1,maxRows:999},placeholder:"点击输入分页提示",readonly:!e.unref(a),resize:"none","input-style":{padding:"8px 10px",fontSize:"14px",color:"#767676",scrollbarWidth:"none",...r.value&&{boxShadow:"none",background:"transparent"}}},null,8,["modelValue","readonly","input-style"])):e.createCommentVNode("",!0),e.createVNode(e._sfc_main$2)])):(e.openBlock(),e.createElementBlock("div",f,[g,s.value?(e.openBlock(),e.createElementBlock("div",y,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",k,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0)]))}}),h=e._export_sfc(V,[["__scopeId","data-v-f49720f0"]]);exports.default=h;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),p=require("./index-CZBdUlB7.cjs"),d=require("./SetpayModal-STls2L4H.cjs"),s=o=>(e.pushScopeId("data-v-723d5602"),o=o(),e.popScopeId(),o),_=s(()=>e.createBaseVNode("i",{class:"el-icon-arrow-right"},null,-1)),u={key:0},m={key:1},g={key:0,class:"flex justify-center items-center gap-2 text"},y=s(()=>e.createBaseVNode("i",{class:"icon iconfont icon-form-weixinzhifu"},null,-1)),f={key:1,class:"flex justify-between text gap-8"},h=s(()=>e.createBaseVNode("span",null,"不支付,仅展示商品价格",-1)),v={class:"flex items-center",style:{gap:"6px"}},B=["src"],k=e.defineComponent({__name:"Pay",props:{disabled:{type:Boolean},label:{},tips:{},wrap:{type:Boolean},custom:{type:Boolean},is_title:{type:Boolean}},emits:["openModal"],setup(o,{emit:n}){const a=e.computed({get:()=>e.FormSetting.value.pay_setting.is_pay,set:()=>{}}),c=e.computed({get:()=>e.FormSetting.value.pay_setting.mch_config_name,set:()=>{}}),t=o,l=n,i=()=>{l("openModal")};return(r,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p.Row,e.normalizeProps(e.guardReactiveProps(t)),{icon:e.withCtx(()=>[e.renderSlot(r.$slots,"icon",{},void 0,!0)]),default:e.withCtx(()=>[a.value!=null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"setting-text",onClick:i},[e.createTextVNode(" 更改 "),_])):e.createCommentVNode("",!0)]),_:3},16),e.createVNode(e.unref(e.ElButton),{onClick:i,class:"button",disabled:a.value!=null},{default:e.withCtx(()=>[a.value==null?(e.openBlock(),e.createElementBlock("span",u,"设置支付方式")):(e.openBlock(),e.createElementBlock("div",m,[a.value==1?(e.openBlock(),e.createElementBlock("div",g,[y,e.createTextVNode(e.toDisplayString(c.value),1)])):(e.openBlock(),e.createElementBlock("div",f,[h,e.createBaseVNode("div",v,[e.createTextVNode(" CNY"),e.createBaseVNode("img",{style:{width:"20px",height:"14px"},src:e.unref(e.getImageUrl)("images/widget/rmb-img.png")},null,8,B)])]))]))]),_:1},8,["disabled"])],64))}}),x=e._export_sfc(k,[["__scopeId","data-v-723d5602"]]),S=e.defineComponent({__name:"PaySettings",setup(o){const n=e.ref(!1),a=()=>{n.value=!0,console.debug(n.value,"ssadas")},c=t=>{e.FormSetting.value.pay_setting.pappid=t.pappid,e.FormSetting.value.pay_setting.is_pay=t.is_pay,e.FormSetting.value.pay_setting.mch_config_id=t.mch_config_id,e.FormSetting.value.pay_setting.mch_config_name=t.mch_config_name,e.FormSetting.value.pay_setting.pay_appid=t.pay_appid,e.FormSetting.value.crown_setting.isCollectInfo.pappid=t.pappid,e.FormSetting.value.crown_setting.isCollectInfo.collectAccountId=t.mch_config_id,e.updateSetting()};return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(x),{label:"支付方式",tips:"支付方式仅支持微信支付,请确保已配置微信支付参数",onOpenModal:a}),e.createVNode(d.SetpayModal,{visible:n.value,onClose:l[0]||(l[0]=i=>n.value=!1),onSetPay:c},null,8,["visible"])],64))}}),w=e.defineComponent({__name:"PayConfig",setup(o){return(n,a)=>{const c=e.resolveComponent("title-row");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(c,null,{default:e.withCtx(()=>[e.createTextVNode("支付设置")]),_:1}),e.createVNode(S)],64)}}});exports.default=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),p=require("./index-1Dr1c6UI.cjs"),d=require("./SetpayModal-X8V66oNb.cjs"),s=o=>(e.pushScopeId("data-v-723d5602"),o=o(),e.popScopeId(),o),_=s(()=>e.createBaseVNode("i",{class:"el-icon-arrow-right"},null,-1)),u={key:0},m={key:1},g={key:0,class:"flex justify-center items-center gap-2 text"},y=s(()=>e.createBaseVNode("i",{class:"icon iconfont icon-form-weixinzhifu"},null,-1)),f={key:1,class:"flex justify-between text gap-8"},h=s(()=>e.createBaseVNode("span",null,"不支付,仅展示商品价格",-1)),v={class:"flex items-center",style:{gap:"6px"}},B=["src"],k=e.defineComponent({__name:"Pay",props:{disabled:{type:Boolean},label:{},tips:{},wrap:{type:Boolean},custom:{type:Boolean},is_title:{type:Boolean}},emits:["openModal"],setup(o,{emit:n}){const a=e.computed({get:()=>e.FormSetting.value.pay_setting.is_pay,set:()=>{}}),c=e.computed({get:()=>e.FormSetting.value.pay_setting.mch_config_name,set:()=>{}}),t=o,l=n,i=()=>{l("openModal")};return(r,N)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(p.Row,e.normalizeProps(e.guardReactiveProps(t)),{icon:e.withCtx(()=>[e.renderSlot(r.$slots,"icon",{},void 0,!0)]),default:e.withCtx(()=>[a.value!=null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"setting-text",onClick:i},[e.createTextVNode(" 更改 "),_])):e.createCommentVNode("",!0)]),_:3},16),e.createVNode(e.unref(e.ElButton),{onClick:i,class:"button",disabled:a.value!=null},{default:e.withCtx(()=>[a.value==null?(e.openBlock(),e.createElementBlock("span",u,"设置支付方式")):(e.openBlock(),e.createElementBlock("div",m,[a.value==1?(e.openBlock(),e.createElementBlock("div",g,[y,e.createTextVNode(e.toDisplayString(c.value),1)])):(e.openBlock(),e.createElementBlock("div",f,[h,e.createBaseVNode("div",v,[e.createTextVNode(" CNY"),e.createBaseVNode("img",{style:{width:"20px",height:"14px"},src:e.unref(e.getImageUrl)("images/widget/rmb-img.png")},null,8,B)])]))]))]),_:1},8,["disabled"])],64))}}),x=e._export_sfc(k,[["__scopeId","data-v-723d5602"]]),S=e.defineComponent({__name:"PaySettings",setup(o){const n=e.ref(!1),a=()=>{n.value=!0,console.debug(n.value,"ssadas")},c=t=>{e.FormSetting.value.pay_setting.pappid=t.pappid,e.FormSetting.value.pay_setting.is_pay=t.is_pay,e.FormSetting.value.pay_setting.mch_config_id=t.mch_config_id,e.FormSetting.value.pay_setting.mch_config_name=t.mch_config_name,e.FormSetting.value.pay_setting.pay_appid=t.pay_appid,e.FormSetting.value.crown_setting.isCollectInfo.pappid=t.pappid,e.FormSetting.value.crown_setting.isCollectInfo.collectAccountId=t.mch_config_id,e.updateSetting()};return(t,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(x),{label:"支付方式",tips:"支付方式仅支持微信支付,请确保已配置微信支付参数",onOpenModal:a}),e.createVNode(d.SetpayModal,{visible:n.value,onClose:l[0]||(l[0]=i=>n.value=!1),onSetPay:c},null,8,["visible"])],64))}}),w=e.defineComponent({__name:"PayConfig",setup(o){return(n,a)=>{const c=e.resolveComponent("title-row");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(c,null,{default:e.withCtx(()=>[e.createTextVNode("支付设置")]),_:1}),e.createVNode(S)],64)}}});exports.default=w;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),f=require("./SetpayModal-STls2L4H.cjs"),o=l=>(e.pushScopeId("data-v-9607f689"),l=l(),e.popScopeId(),l),h={class:"panel-box"},y=o(()=>e.createBaseVNode("div",{class:"box-title"},"支付方式",-1)),x=o(()=>e.createBaseVNode("div",{class:"tip-text"},"表单添加商品字段时,可以配置支付方式完成收款。",-1)),V={class:"box-row"},B={key:0,class:"flex flex-col"},N=o(()=>e.createBaseVNode("span",{style:{color:"#1aad19"},class:"box-text flex gap-2"},[e.createBaseVNode("i",{style:{color:"#1aad19","font-size":"18px"},class:"iconfont icon-form-weixinzhifu"}),e.createTextVNode("微信支付")],-1)),S={class:"box-text"},b={key:1,class:"flex flex-col"},k=o(()=>e.createBaseVNode("span",{class:"box-text"},"人民币(CNY)",-1)),w=o(()=>e.createBaseVNode("span",{class:"box-text"},"无需支付仅展示商品价格",-1)),F=[k,w],C={class:"setting-text"},E=["src"],I={class:"panel-box"},M=o(()=>e.createBaseVNode("div",{class:"box-title"},"设置交易超时规则",-1)),P=o(()=>e.createBaseVNode("div",{class:"tip-text"},"设置交易超时规则,买家逾期未付款,平台将在设定的时间关闭交易, 此规则仅对在线支付的商品或可支付预约生效。",-1)),O={class:"box-row"},T={style:{"margin-left":"4px"}},U={key:0,class:"flex flex-col gap-4"},q=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),z=o(()=>e.createBaseVNode("div",null,"设置超时时间",-1)),D={class:"flex flex-row items-center",style:{gap:"8px"}},j=o(()=>e.createBaseVNode("div",null,"分钟后,将关闭交易、恢复库存",-1)),A=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),L=e.defineComponent({__name:"PayMethod",setup(l){const c=e.ref(!1),s=e.ref(e.FormSetting.value.pay_setting.trade_is_over==1),i=e.ref(e.FormSetting.value.pay_setting.trade_overtime),d=e.computed({get:()=>e.FormSetting.value.pay_setting.is_pay,set:()=>{}}),p=e.computed({get:()=>e.FormSetting.value.pay_setting.mch_config_name,set:()=>{}}),r=()=>{c.value=!0},u=[{value:600,label:"10"},{value:1200,label:"20"},{value:1800,label:"30"}],v=()=>{c.value=!1},m=t=>{t||_()},_=async()=>{e.FormSetting.value.pay_setting.trade_is_over=s.value?1:0,e.FormSetting.value.pay_setting.trade_overtime=i.value,await e.updateSetting()&&e.message.success("保存设置成功")},g=t=>{console.debug(t),e.FormSetting.value.pay_setting.pappid=t.pappid,e.FormSetting.value.pay_setting.is_pay=t.is_pay,e.FormSetting.value.pay_setting.mch_config_id=t.mch_config_id,e.FormSetting.value.pay_setting.mch_config_name=t.mch_config_name,e.FormSetting.value.pay_setting.pay_appid=t.pay_appid,e.FormSetting.value.crown_setting.isCollectInfo.pappid=t.pappid,e.FormSetting.value.crown_setting.isCollectInfo.collectAccountId=t.mch_config_id,e.updateSetting()};return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("section",null,[e.createBaseVNode("div",h,[y,x,e.createBaseVNode("div",V,[d.value==null?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:r,class:"set-pay-button"},[e.createVNode(e.unref(e.ElIcon),{class:"plus-icon mr-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.plus_default))]),_:1}),e.createTextVNode(" 设置支付方式 ")])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:r,class:"view-pay-button"},[d.value==1?(e.openBlock(),e.createElementBlock("div",B,[N,e.createBaseVNode("span",S,e.toDisplayString(p.value),1)])):(e.openBlock(),e.createElementBlock("div",b,F)),e.createBaseVNode("div",C,[e.createBaseVNode("img",{style:{width:"14px"},src:e.unref(e.getImageUrl)("images/widget/gain-edit-icon.png")},null,8,E),e.createTextVNode("更改配置 ")])]))])]),e.createBaseVNode("div",I,[M,P,e.createBaseVNode("div",O,[e.createVNode(e.unref(e.ElSwitch),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=a=>s.value=a),onChange:m},null,8,["modelValue"]),e.createBaseVNode("span",T,e.toDisplayString(s.value?"已开启":"已关闭"),1),s.value?(e.openBlock(),e.createElementBlock("div",U,[q,z,e.createBaseVNode("div",D,[e.createVNode(e.unref(e.ElSelect),{modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=a=>i.value=a),placeholder:"超时时间",style:{width:"120px"}},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,a=>e.createVNode(e.unref(e.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),j]),A,e.createVNode(e.unref(e.ElButton),{class:"button",type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(" 保存设置 ")]),_:1})])):e.createCommentVNode("",!0)])])]),e.createVNode(f.SetpayModal,{visible:c.value,onSetPay:g,onClose:v},null,8,["visible"])],64))}}),Y=e._export_sfc(L,[["__scopeId","data-v-9607f689"]]);exports.default=Y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),f=require("./SetpayModal-X8V66oNb.cjs"),o=l=>(e.pushScopeId("data-v-9607f689"),l=l(),e.popScopeId(),l),h={class:"panel-box"},y=o(()=>e.createBaseVNode("div",{class:"box-title"},"支付方式",-1)),x=o(()=>e.createBaseVNode("div",{class:"tip-text"},"表单添加商品字段时,可以配置支付方式完成收款。",-1)),V={class:"box-row"},B={key:0,class:"flex flex-col"},N=o(()=>e.createBaseVNode("span",{style:{color:"#1aad19"},class:"box-text flex gap-2"},[e.createBaseVNode("i",{style:{color:"#1aad19","font-size":"18px"},class:"iconfont icon-form-weixinzhifu"}),e.createTextVNode("微信支付")],-1)),S={class:"box-text"},b={key:1,class:"flex flex-col"},k=o(()=>e.createBaseVNode("span",{class:"box-text"},"人民币(CNY)",-1)),w=o(()=>e.createBaseVNode("span",{class:"box-text"},"无需支付仅展示商品价格",-1)),F=[k,w],C={class:"setting-text"},E=["src"],I={class:"panel-box"},M=o(()=>e.createBaseVNode("div",{class:"box-title"},"设置交易超时规则",-1)),P=o(()=>e.createBaseVNode("div",{class:"tip-text"},"设置交易超时规则,买家逾期未付款,平台将在设定的时间关闭交易, 此规则仅对在线支付的商品或可支付预约生效。",-1)),O={class:"box-row"},T={style:{"margin-left":"4px"}},U={key:0,class:"flex flex-col gap-4"},q=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),z=o(()=>e.createBaseVNode("div",null,"设置超时时间",-1)),D={class:"flex flex-row items-center",style:{gap:"8px"}},j=o(()=>e.createBaseVNode("div",null,"分钟后,将关闭交易、恢复库存",-1)),A=o(()=>e.createBaseVNode("div",{class:"divide"},null,-1)),L=e.defineComponent({__name:"PayMethod",setup(l){const c=e.ref(!1),s=e.ref(e.FormSetting.value.pay_setting.trade_is_over==1),i=e.ref(e.FormSetting.value.pay_setting.trade_overtime),d=e.computed({get:()=>e.FormSetting.value.pay_setting.is_pay,set:()=>{}}),p=e.computed({get:()=>e.FormSetting.value.pay_setting.mch_config_name,set:()=>{}}),r=()=>{c.value=!0},u=[{value:600,label:"10"},{value:1200,label:"20"},{value:1800,label:"30"}],v=()=>{c.value=!1},m=t=>{t||_()},_=async()=>{e.FormSetting.value.pay_setting.trade_is_over=s.value?1:0,e.FormSetting.value.pay_setting.trade_overtime=i.value,await e.updateSetting()&&e.message.success("保存设置成功")},g=t=>{console.debug(t),e.FormSetting.value.pay_setting.pappid=t.pappid,e.FormSetting.value.pay_setting.is_pay=t.is_pay,e.FormSetting.value.pay_setting.mch_config_id=t.mch_config_id,e.FormSetting.value.pay_setting.mch_config_name=t.mch_config_name,e.FormSetting.value.pay_setting.pay_appid=t.pay_appid,e.FormSetting.value.crown_setting.isCollectInfo.pappid=t.pappid,e.FormSetting.value.crown_setting.isCollectInfo.collectAccountId=t.mch_config_id,e.updateSetting()};return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createBaseVNode("section",null,[e.createBaseVNode("div",h,[y,x,e.createBaseVNode("div",V,[d.value==null?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:r,class:"set-pay-button"},[e.createVNode(e.unref(e.ElIcon),{class:"plus-icon mr-1"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.plus_default))]),_:1}),e.createTextVNode(" 设置支付方式 ")])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:r,class:"view-pay-button"},[d.value==1?(e.openBlock(),e.createElementBlock("div",B,[N,e.createBaseVNode("span",S,e.toDisplayString(p.value),1)])):(e.openBlock(),e.createElementBlock("div",b,F)),e.createBaseVNode("div",C,[e.createBaseVNode("img",{style:{width:"14px"},src:e.unref(e.getImageUrl)("images/widget/gain-edit-icon.png")},null,8,E),e.createTextVNode("更改配置 ")])]))])]),e.createBaseVNode("div",I,[M,P,e.createBaseVNode("div",O,[e.createVNode(e.unref(e.ElSwitch),{modelValue:s.value,"onUpdate:modelValue":n[0]||(n[0]=a=>s.value=a),onChange:m},null,8,["modelValue"]),e.createBaseVNode("span",T,e.toDisplayString(s.value?"已开启":"已关闭"),1),s.value?(e.openBlock(),e.createElementBlock("div",U,[q,z,e.createBaseVNode("div",D,[e.createVNode(e.unref(e.ElSelect),{modelValue:i.value,"onUpdate:modelValue":n[1]||(n[1]=a=>i.value=a),placeholder:"超时时间",style:{width:"120px"}},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,a=>e.createVNode(e.unref(e.ElOption),{key:a.value,label:a.label,value:a.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),j]),A,e.createVNode(e.unref(e.ElButton),{class:"button",type:"primary",onClick:_},{default:e.withCtx(()=>[e.createTextVNode(" 保存设置 ")]),_:1})])):e.createCommentVNode("",!0)])])]),e.createVNode(f.SetpayModal,{visible:c.value,onSetPay:g,onClose:v},null,8,["visible"])],64))}}),Y=e._export_sfc(L,[["__scopeId","data-v-9607f689"]]);exports.default=Y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),t=require("./index-CZBdUlB7.cjs"),n=require("./PlaceholderOption.vue_vue_type_script_setup_true_lang-eFwoyqIK.cjs"),r=require("./ImportantOption.vue_vue_type_script_setup_true_lang-C7ndh7xd.cjs"),o=e.defineComponent({__name:"PhoneInputSetting",setup(_){return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(t.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(e.activeWidgetInfo).name)+"设置",1)]),_:1}),e.createVNode(n._sfc_main),e.createVNode(r._sfc_main)],64))}});exports.default=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),t=require("./index-1Dr1c6UI.cjs"),n=require("./PlaceholderOption.vue_vue_type_script_setup_true_lang-BYEanYo2.cjs"),r=require("./ImportantOption.vue_vue_type_script_setup_true_lang-DZll29q4.cjs"),o=e.defineComponent({__name:"PhoneInputSetting",setup(_){return(u,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(t.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(e.activeWidgetInfo).name)+"设置",1)]),_:1}),e.createVNode(n._sfc_main),e.createVNode(r._sfc_main)],64))}});exports.default=o;
@@ -1 +1 @@
1
- "use strict";const e=require("./main-BJ5jMLtY.cjs");require("./index-CZBdUlB7.cjs");const r=require("./Input-CsJQsPhh.cjs"),a=e.defineComponent({__name:"PlaceholderOption",setup(u){const l=e.computed({get:()=>{var t;return(t=e.activeWidgetAttrs.value)==null?void 0:t.placeholder},set:t=>e.setPlaceholder(t)});return(t,o)=>(e.openBlock(),e.createBlock(e.unref(r.InputRow),{wrap:"",label:"文本框输入框提示",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n)},null,8,["modelValue"]))}});exports._sfc_main=a;
1
+ "use strict";const e=require("./main-DgF763FD.cjs");require("./index-1Dr1c6UI.cjs");const r=require("./Input-DYg7TAZ8.cjs"),a=e.defineComponent({__name:"PlaceholderOption",setup(u){const l=e.computed({get:()=>{var t;return(t=e.activeWidgetAttrs.value)==null?void 0:t.placeholder},set:t=>e.setPlaceholder(t)});return(t,o)=>(e.openBlock(),e.createBlock(e.unref(r.InputRow),{wrap:"",label:"文本框输入框提示",modelValue:l.value,"onUpdate:modelValue":o[0]||(o[0]=n=>l.value=n)},null,8,["modelValue"]))}});exports._sfc_main=a;
@@ -1 +1 @@
1
- "use strict";const e=require("./main-BJ5jMLtY.cjs");require("./index-CZBdUlB7.cjs");const o=require("./Input-CsJQsPhh.cjs"),n=e.defineComponent({__name:"PreparePlaceholderOption",props:{label:{default:"输入提示"}},setup(u){const t=e.computed({get:()=>{var l;return(l=e.activeWidgetAttrs.value)==null?void 0:l.placeholder},set:l=>e.setPlaceholder(l)});return(l,a)=>(e.openBlock(),e.createBlock(e.unref(o.InputRow),{wrap:"",label:l.label,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=r=>t.value=r)},null,8,["label","modelValue"]))}});exports._sfc_main=n;
1
+ "use strict";const e=require("./main-DgF763FD.cjs");require("./index-1Dr1c6UI.cjs");const o=require("./Input-DYg7TAZ8.cjs"),n=e.defineComponent({__name:"PreparePlaceholderOption",props:{label:{default:"输入提示"}},setup(u){const t=e.computed({get:()=>{var l;return(l=e.activeWidgetAttrs.value)==null?void 0:l.placeholder},set:l=>e.setPlaceholder(l)});return(l,a)=>(e.openBlock(),e.createBlock(e.unref(o.InputRow),{wrap:"",label:l.label,modelValue:t.value,"onUpdate:modelValue":a[0]||(a[0]=r=>t.value=r)},null,8,["label","modelValue"]))}});exports._sfc_main=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),t=require("./PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-xA2q_SED.cjs"),r=require("./LengthRangeOption.vue_vue_type_script_setup_true_lang-Wj0v68Zy.cjs"),_=require("./ImportantOption.vue_vue_type_script_setup_true_lang-C7ndh7xd.cjs"),n=e.defineComponent({__name:"PreparerNameSetting",setup(c){return(o,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(t._sfc_main),e.createVNode(r._sfc_main),e.createVNode(_._sfc_main)],64))}}),a=e._export_sfc(n,[["__scopeId","data-v-a1b7eb64"]]);exports.default=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),t=require("./PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-B4a-WLb-.cjs"),r=require("./LengthRangeOption.vue_vue_type_script_setup_true_lang-B0x84OCh.cjs"),_=require("./ImportantOption.vue_vue_type_script_setup_true_lang-DZll29q4.cjs"),n=e.defineComponent({__name:"PreparerNameSetting",setup(c){return(o,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(t._sfc_main),e.createVNode(r._sfc_main),e.createVNode(_._sfc_main)],64))}}),a=e._export_sfc(n,[["__scopeId","data-v-a1b7eb64"]]);exports.default=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),t={};function n(c,o){return e.openBlock(),e.createElementBlock("div")}const r=e._export_sfc(t,[["render",n]]);exports.default=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),t={};function n(c,o){return e.openBlock(),e.createElementBlock("div")}const r=e._export_sfc(t,[["render",n]]);exports.default=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),t=require("./PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-xA2q_SED.cjs"),r=e.defineComponent({__name:"PreparerSetting",setup(_){return(n,o)=>(e.openBlock(),e.createBlock(t._sfc_main))}}),c=e._export_sfc(r,[["__scopeId","data-v-cd26bcdc"]]);exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),t=require("./PreparePlaceholderOption.vue_vue_type_script_setup_true_lang-B4a-WLb-.cjs"),r=e.defineComponent({__name:"PreparerSetting",setup(_){return(n,o)=>(e.openBlock(),e.createBlock(t._sfc_main))}}),c=e._export_sfc(r,[["__scopeId","data-v-cd26bcdc"]]);exports.default=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),n=require("./index-CZBdUlB7.cjs"),r=require("./OptionRandom.vue_vue_type_script_setup_true_lang-ZRDSfVc6.cjs"),i=require("./ImportantOption.vue_vue_type_script_setup_true_lang-C7ndh7xd.cjs"),t=require("./ViewVoteRate-CyHdBIBU.cjs"),o=require("./DisplayRuleSetting-0KLY2h-h.cjs"),_=e.defineComponent({__name:"RadioSetting",setup(c){return(a,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("选项设置")]),_:1}),e.createVNode(r._sfc_main),e.createVNode(t.OptionTips),e.createVNode(o.DisplayRuleSetting),e.createVNode(t._sfc_main),e.createVNode(i._sfc_main)]))}});exports.default=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),n=require("./index-1Dr1c6UI.cjs"),r=require("./OptionRandom.vue_vue_type_script_setup_true_lang-CXbehCtN.cjs"),i=require("./ImportantOption.vue_vue_type_script_setup_true_lang-DZll29q4.cjs"),t=require("./ViewVoteRate-Dq_X2HKs.cjs"),o=require("./DisplayRuleSetting-Bz9zDVpQ.cjs"),_=e.defineComponent({__name:"RadioSetting",setup(c){return(a,u)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("选项设置")]),_:1}),e.createVNode(r._sfc_main),e.createVNode(t.OptionTips),e.createVNode(o.DisplayRuleSetting),e.createVNode(t._sfc_main),e.createVNode(i._sfc_main)]))}});exports.default=_;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BJ5jMLtY.cjs"),n=require("./index-CZBdUlB7.cjs"),s={class:"rate-setting"},u=e.defineComponent({__name:"RatingSetting",setup(f){const a=["fill-star","fill-like","fill-love","fill-flower","fill-paw","fill-shit","fill-smile","fill-dot"],r=l=>{e.setRatingAttrs("iconName",l)};return(l,o)=>{const c=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",s,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("评分设置")]),_:1}),e.createVNode(e.unref(n.Row),{label:"量级设置"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElSelect),{class:"rate-range-select","model-value":e.unref(e.activeWidgetAttrs).range,onChange:o[0]||(o[0]=t=>e.unref(e.setRatingAttrs)("range",t))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(10,t=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t>2?(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:t,value:t},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)],64))),64))]),_:1},8,["model-value"])]),_:1}),e.createVNode(e.unref(n.Row),{wrap:"",label:"外观"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(t,i)=>e.createVNode(e.unref(e.ElButton),{class:e.normalizeClass(["rate-icon-btn",{"rate-icon-btn-active":e.unref(e.activeWidgetAttrs).iconName===t}]),key:`rate-icon-${i}`,onClick:m=>r(t)},{default:e.withCtx(()=>[e.createVNode(c,{name:`${t}-ac`,style:{"font-size":"22px"}},null,8,["name"])]),_:2},1032,["class","onClick"])),64))]),_:1})]),_:1})])}}}),d=e._export_sfc(u,[["__scopeId","data-v-cdd1b827"]]);exports.default=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-DgF763FD.cjs"),n=require("./index-1Dr1c6UI.cjs"),s={class:"rate-setting"},u=e.defineComponent({__name:"RatingSetting",setup(f){const a=["fill-star","fill-like","fill-love","fill-flower","fill-paw","fill-shit","fill-smile","fill-dot"],r=l=>{e.setRatingAttrs("iconName",l)};return(l,o)=>{const c=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",s,[e.createVNode(e.unref(n.TitleRow),null,{default:e.withCtx(()=>[e.createTextVNode("评分设置")]),_:1}),e.createVNode(e.unref(n.Row),{label:"量级设置"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElSelect),{class:"rate-range-select","model-value":e.unref(e.activeWidgetAttrs).range,onChange:o[0]||(o[0]=t=>e.unref(e.setRatingAttrs)("range",t))},{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(10,t=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t>2?(e.openBlock(),e.createBlock(e.unref(e.ElOption),{key:t,value:t},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t),1)]),_:2},1032,["value"])):e.createCommentVNode("",!0)],64))),64))]),_:1},8,["model-value"])]),_:1}),e.createVNode(e.unref(n.Row),{wrap:"",label:"外观"},{default:e.withCtx(()=>[e.createVNode(e.unref(e.ElButtonGroup),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(a,(t,i)=>e.createVNode(e.unref(e.ElButton),{class:e.normalizeClass(["rate-icon-btn",{"rate-icon-btn-active":e.unref(e.activeWidgetAttrs).iconName===t}]),key:`rate-icon-${i}`,onClick:m=>r(t)},{default:e.withCtx(()=>[e.createVNode(c,{name:`${t}-ac`,style:{"font-size":"22px"}},null,8,["name"])]),_:2},1032,["class","onClick"])),64))]),_:1})]),_:1})])}}}),d=e._export_sfc(u,[["__scopeId","data-v-cdd1b827"]]);exports.default=d;