1234567 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-45512059"],{"2de2":function(e,t,r){r.d(t,"e",(function(){return n})),r.d(t,"d",(function(){return o})),r.d(t,"b",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"f",(function(){return s})),r.d(t,"a",(function(){return c}));let n="/duoduo-service/setup-service/",o="/duoduo-service/object-service/",a="/duoduo-service/duoduoenv-service/",i="/duoduo-service",s="/duoduo-service/",c="/duoduo-service/custom-service/"},4244:function(e,t,r){r("b1eb")},"4b9e":function(e,t,r){r.d(t,"a",(function(){return h}));t=r("23f9");var n=r("7a23"),o=r("1fba"),a=r("e5f6"),i=r("d243"),s=r("8db7"),c=r("450f"),l=r("efd9");let[u,d]=Object(o.a)("form");r={colon:Boolean,disabled:Boolean,readonly:Boolean,showError:Boolean,labelWidth:a.f,labelAlign:String,inputAlign:String,scrollToError:Boolean,validateFirst:Boolean,submitOnEnter:a.g,showErrorMessage:a.g,errorMessageAlign:String,validateTrigger:{type:[String,Array],default:"onBlur"}},o=Object(n.defineComponent)({name:u,props:r,emits:["submit","failed"],setup(e,{emit:t,slots:r}){let{children:o,linkChildren:a}=Object(c.useChildren)(i.f),u=e=>e?o.filter(t=>e.includes(t.name)):o,h=e=>new Promise((t,r)=>{let n=[];u(e).reduce((e,t)=>e.then(()=>{if(!n.length)return t.validate().then(e=>{e&&n.push(e)})}),Promise.resolve()).then(()=>{n.length?r(n):t()})}),f=e=>new Promise((t,r)=>{var n=u(e);Promise.all(n.map(e=>e.validate())).then(e=>{(e=e.filter(Boolean)).length?r(e):t()})}),m=e=>{let t=o.find(t=>t.name===e);return t?new Promise((e,r)=>{t.validate().then(t=>{t?r(t):e()})}):Promise.reject()},g=t=>("string"==typeof t?m:e.validateFirst?h:f)(t),p=(e,t)=>{o.some(r=>r.name===e&&(r.$el.scrollIntoView(t),!0))},v=()=>o.reduce((e,t)=>(e[t.name]=t.formValue.value,e),{}),b=()=>{let r=v();g().then(()=>t("submit",r)).catch(n=>{t("failed",{values:r,errors:n}),e.scrollToError&&n[0].name&&p(n[0].name)})},y=e=>{Object(s.e)(e),b()};return a({props:e}),Object(l.a)({submit:b,validate:g,getValues:v,scrollToField:p,resetValidation:e=>{"string"==typeof e&&(e=[e]),u(e).forEach(e=>{e.resetValidation()})},getValidationStatus:()=>o.reduce((e,t)=>(e[t.name]=t.getValidationStatus(),e),{})}),()=>{var e;return Object(n.createVNode)("form",{class:d(),onSubmit:y},[null==(e=r.default)?void 0:e.call(r)])}}});let h=Object(t.a)(o)},5118:function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(o.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(o.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r("6017"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r("c8ba"))},6017:function(e,t,r){(function(e,t){function r(e){delete c[e]}function n(e){if(l)setTimeout(n,0,e);else{var t=c[e];if(t){l=!0;try{var o=t,a=o.callback,s=o.args;switch(s.length){case 0:a();break;case 1:a(s[0]);break;case 2:a(s[0],s[1]);break;case 3:a(s[0],s[1],s[2]);break;default:a.apply(i,s)}}finally{r(e),l=!1}}}}function o(){function e(e){e.source===a&&"string"==typeof e.data&&0===e.data.indexOf(t)&&n(+e.data.slice(t.length))}var t="setImmediate$"+Math.random()+"$";a.addEventListener?a.addEventListener("message",e,!1):a.attachEvent("onmessage",e),d=function(e){a.postMessage(t+e,"*")}}var a,i,s,c,l,u,d,h,f;(a="undefined"==typeof self?void 0===e?this:e:self).setImmediate||(s=1,l=!(c={}),u=a.document,e=(e=Object.getPrototypeOf&&Object.getPrototypeOf(a))&&e.setTimeout?e:a,"[object process]"==={}.toString.call(a.process)?d=function(e){t.nextTick((function(){n(e)}))}:(()=>{var e,t;return a.postMessage&&!a.importScripts&&(e=!0,t=a.onmessage,a.onmessage=function(){e=!1},a.postMessage("","*"),a.onmessage=t,e)})()?o():d=a.MessageChannel?((f=new MessageChannel).port1.onmessage=function(e){n(e.data)},function(e){f.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(h=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){n(e),t.onreadystatechange=null,h.removeChild(t),t=null},h.appendChild(t)}):function(e){setTimeout(n,0,e)},e.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];return c[s]={callback:e,args:t},d(s),s++},e.clearImmediate=r)}).call(this,r("c8ba"),r("4362"))},"72b2":function(e,t,r){r("c280")},"7abe":function(e,t,r){r.r(t);var n=r("7a23");let o={key:0,class:"home"},a={key:0},i={key:1},s={class:"home-content"},c={class:"home-left"},l={class:"box"},u=["src"],d={class:"home-right"},h={key:0,class:"box"},f={class:"qrcode-main"},m={key:0,class:"qrcode-model"},g={key:0},p={key:1,class:"box"};r("14d9");var v=r("d39c"),b=(v=r.n(v),r("6c02")),y=r("d257"),C=r("0613"),E=r("59b9"),O=r("ba72"),w=r("4b9e"),S=r("f23a"),M=r("a136"),j=r("2e1b"),N=r("6c43"),T=r("5581"),I=r("459d"),R=r("a873"),P=r("5118");v=Object(n.defineComponent)({components:{QrcodeVue:v.a,vanForm:w.a,vanField:S.a,CellGroup:M.a,vanButton:j.a},beforeRouteEnter(e,t,r){var n=Object(T.a)();n&&"null"!=n?"logoOut"!==e.query.type?r(e=>{e.queryPageWorkSpace()}):r(e=>{e.showLogin=!0,Object(T.a)()}):r("/error")},setup(e){let t=Object(b.d)();var r=Object(y.u)();let o=Object(C.b)(),a=location.origin,i=Object(n.reactive)({parseImgUrl:y.z,codeValue:a+"/ipad/home",showLogin:!1,size:134,spaceTimer:null,type:1,userInfo:r,checkLoginType(){1===i.type?i.type=2:i.type=1,1===i.type?i.getPadQrCodeStatus():i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null)},username:"",password:"",onSubmit(e){e=e,Object(E.b)().request("/server/login",O.b.POST,e,O.a.json).then(e=>{"success"===e.result?(Object(T.j)(e.token),t.push({path:"/choice-project"})):Object(N.a)("登录失败!")})},queryPageWorkSpace(){var e;i.userInfo.mac?(e={criteria:{macAddress:i.userInfo.mac,isMajorSpace:1},orders:[{column:"createTime",asc:!1}],page:1,size:1},Object(I.H)(e).then(e=>{var r;"success"===e.result?(e=null!=(e=null==e?void 0:e.content)?e:[])&&e.length?(i.showLogin=!1,r=e[0].projectId,o.commit(R.a.SET_PROJECT_ID,r),t.push({name:"envmonitor",query:{spaceId:e[0].spaceId}})):i.showLogin=!0:(i.showLogin=!0,i.spaceTimer=Object(P.setTimeout)(()=>{i.queryPageWorkSpace(),Object(P.clearTimeout)(i.spaceTimer)},5e3))}).catch(()=>{i.showLogin=!0,i.spaceTimer=Object(P.setTimeout)(()=>{i.queryPageWorkSpace(),Object(P.clearTimeout)(i.spaceTimer)},5e3)})):(i.showLogin=!0,t.push({name:"error"}))},getQrcode(){var e=i.userInfo.mac;return Object(y.y)(0,1e5,e)},qrCodeId:"",setCodeUrl(){var e=i.userInfo.mac,t=i.getQrcode();i.qrCodeId=t,i.codeValue=`${a}/ipad/home?type=ipad&id=${i.qrCodeId}&mac=`+e},clearTimer(){i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null)},refreshCode(){i.setCodeUrl(),i.clearTimer(),i.getPadQrCodeStatus()},codeStatus:{},timer:null,getPadQrCodeStatus(){var e=Object(y.C)({qrCodeId:i.qrCodeId});Object(I.p)(e).then(e=>{var r;i.codeStatus=null!=(e=null==e?void 0:e.data)?e:{},2===i.codeStatus.status?(e=i.codeStatus.projectId,r=i.codeStatus.spaceId,e&&r?(o.commit(R.a.SET_PROJECT_ID,e),t.push({name:"choiceSpace",query:{id:e,spaceId:r}})):e&&(o.commit(R.a.SET_PROJECT_ID,e),t.push({name:"choiceSpace",query:{id:e}}))):(i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null),i.timer=Object(P.setTimeout)(()=>{i.getPadQrCodeStatus()},1e3))})}});return Object(n.onBeforeUnmount)(()=>{i.timer&&(Object(P.clearTimeout)(i.timer),i.timer=null,Object(P.clearTimeout)(i.spaceTimer),i.spaceTimer=null)}),Object(n.onMounted)(()=>{i.setCodeUrl(),i.getPadQrCodeStatus()}),{...Object(n.toRefs)(i)}}}),r("4244"),r("72b2"),w=r("6b0d"),S=r.n(w);t.default=S()(v,[["render",function(e,t,r,v,b,y){var C=Object(n.resolveComponent)("qrcode-vue"),E=Object(n.resolveComponent)("van-icon");let O=Object(n.resolveComponent)("van-field"),w=Object(n.resolveComponent)("van-cell-group"),S=Object(n.resolveComponent)("van-button");var M=Object(n.resolveComponent)("van-form");return e.showLogin?(Object(n.openBlock)(),Object(n.createElementBlock)("div",o,[Object(n.createElementVNode)("div",{class:"home-btn",onClick:t[0]||(t[0]=(...t)=>e.checkLoginType&&e.checkLoginType(...t))},[2===e.type?(Object(n.openBlock)(),Object(n.createElementBlock)("span",a,"二维码登录")):(Object(n.openBlock)(),Object(n.createElementBlock)("span",i,"账号登录"))]),Object(n.createElementVNode)("div",s,[Object(n.createElementVNode)("div",c,[Object(n.createElementVNode)("div",l,[Object(n.createElementVNode)("img",{src:e.parseImgUrl("ipdImages","logo.svg"),alt:""},null,8,u),t[3]||(t[3]=Object(n.createElementVNode)("div",{class:"logo-text"},"SagaCare",-1))])]),Object(n.createElementVNode)("div",d,[1===e.type?(Object(n.openBlock)(),Object(n.createElementBlock)("div",h,[Object(n.createElementVNode)("div",f,[Object(n.createVNode)(C,{value:e.codeValue,class:"qrcode",foreground:"#CE9F27",level:"H"},null,8,["value"]),e.codeStatus.status?(Object(n.openBlock)(),Object(n.createElementBlock)("div",m,[1===e.codeStatus.status?(Object(n.openBlock)(),Object(n.createElementBlock)("span",g,"已扫描")):Object(n.createCommentVNode)("",!0),2===e.codeStatus.status||3===e.codeStatus.status?(Object(n.openBlock)(),Object(n.createBlock)(E,{key:1,class:"code-replay",onClick:e.refreshCode,name:"replay"},null,8,["onClick"])):Object(n.createCommentVNode)("",!0)])):Object(n.createCommentVNode)("",!0)]),t[4]||(t[4]=Object(n.createElementVNode)("div",{class:"qrcode-text"}," 请使用朵朵小程序,扫描上面二维码进行授权登录 ",-1))])):(Object(n.openBlock)(),Object(n.createElementBlock)("div",p,[Object(n.createVNode)(M,{onSubmit:e.onSubmit,class:"box-form"},{default:Object(n.withCtx)(()=>[Object(n.createVNode)(w,{inset:""},{default:Object(n.withCtx)(()=>[Object(n.createVNode)(O,{modelValue:e.username,"onUpdate:modelValue":t[1]||(t[1]=t=>e.username=t),name:"username",placeholder:"用户名",rules:[{required:!0,message:"请填写用户名"}]},null,8,["modelValue"]),Object(n.createVNode)(O,{modelValue:e.password,"onUpdate:modelValue":t[2]||(t[2]=t=>e.password=t),type:"password",name:"password",placeholder:"密码",rules:[{required:!0,message:"请填写密码"}]},null,8,["modelValue"])]),_:1}),Object(n.createElementVNode)("div",null,[Object(n.createVNode)(S,{round:"",block:"","native-type":"submit"},{default:Object(n.withCtx)(()=>t[5]||(t[5]=[Object(n.createTextVNode)(" 提交 ")])),_:1})])]),_:1},8,["onSubmit"])]))])]),t[6]||(t[6]=Object(n.createElementVNode)("div",{class:"fotter"},"欢迎使用智能办公",-1))])):Object(n.createCommentVNode)("",!0)}],["__scopeId","data-v-5db0a943"]])},a136:function(e,t,r){r.d(t,"a",(function(){return l}));t=r("23f9");var n=r("7a23"),o=r("1fba"),a=r("e5f6"),i=r("d243");let[s,c]=Object(o.a)("cell-group");r={title:String,inset:Boolean,border:a.g},o=Object(n.defineComponent)({name:s,inheritAttrs:!1,props:r,setup(e,{slots:t,attrs:r}){let o=()=>{var o;return Object(n.createVNode)("div",Object(n.mergeProps)({class:[c({inset:e.inset}),{[i.d]:e.border&&!e.inset}]},r),[null==(o=t.default)?void 0:o.call(t)])};return()=>e.title||t.title?Object(n.createVNode)(n.Fragment,null,[Object(n.createVNode)("div",{class:c("title",{inset:e.inset})},[t.title?t.title():e.title]),o()]):o()}});let l=Object(t.a)(o)},b1eb:function(e,t,r){},c280:function(e,t,r){e.exports={menuBg:"#fff",menuText:"#162b64",menuActiveText:"#435ebe"}},d39c:function(e,t,r){function n(e,t,r){if(t<0||31<t||e>>>t!=0)throw new RangeError("Value out of range");for(var n=t-1;0<=n;n--)r.push(e>>>n&1)}function o(e,t){return 0!=(e>>>t&1)}function a(e){if(!e)throw new Error("Assertion error")}function i(e){return e in p}function s(e,t){void 0===t&&(t=0);var r=[];return e.forEach((function(e,n){var o=null;e.forEach((function(a,i){if(a||null===o)return i===e.length-1?a?void r.push(null===o?"M".concat(i+t,",").concat(n+t," h1v1H").concat(i+t,"z"):"M".concat(o+t,",").concat(n+t," h").concat(i+1-o,"v1H").concat(o+t,"z")):void 0:void(a&&null===o&&(o=i));r.push("M".concat(o+t," ").concat(n+t,"h").concat(i-o,"v1H").concat(o+t,"z")),o=null}))})),r.join("")}function c(e,t,r,n){var o=n.width,a=n.height,i=n.x,s=n.y,c=(r=e.length+2*r,Math.floor(.1*t));r/=t,t=(o||c)*r,o=(a||c)*r,a=null==i?e.length/2-t/2:i*r,c=null==s?e.length/2-o/2:s*r,i=null;return{x:a,y:c,h:o,w:t,excavation:i=n.excavate?{x:e=Math.floor(a),y:s=Math.floor(c),w:Math.ceil(t+a-e),h:Math.ceil(o+c-s)}:i}}function l(e,t){return e.slice().map((function(e,r){return r<t.y||r>=t.y+t.h?e:e.map((function(e,r){return(r<t.x||r>=t.x+t.w)&&e}))}))}
- /*!
- * qrcode.vue v3.6.0
- * A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
- * © 2017-PRESENT @scopewu(https://github.com/scopewu)
- * MIT License.
- */var u,d,h,f,m,g,p,v,b,y,C;t=t,u=r("7a23"),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},h=C=C||{},r=(()=>{function e(t,r,n,o){if(this.version=t,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],t<e.MIN_VERSION||e.MAX_VERSION<t)throw new RangeError("Version value out of range");if(o<-1||7<o)throw new RangeError("Mask value out of range");this.size=4*t+17;for(var i=[],s=0;s<this.size;s++)i.push(!1);for(s=0;s<this.size;s++)this.modules.push(i.slice()),this.isFunction.push(i.slice());if(this.drawFunctionPatterns(),r=this.addEccAndInterleave(n),this.drawCodewords(r),-1==o){var c=1e9;for(s=0;s<8;s++){this.applyMask(s),this.drawFormatBits(s);var l=this.getPenaltyScore();l<c&&(o=s,c=l),this.applyMask(s)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}return e.encodeText=function(t,r){return t=h.QrSegment.makeSegments(t),e.encodeSegments(t,r)},e.encodeBinary=function(t,r){return t=h.QrSegment.makeBytes(t),e.encodeSegments([t],r)},e.encodeSegments=function(t,r,o,i,s,c){if(void 0===i&&(i=40),void 0===s&&(s=-1),void 0===c&&(c=!0),!(e.MIN_VERSION<=(o=void 0===o?1:o)&&o<=i&&i<=e.MAX_VERSION)||s<-1||7<s)throw new RangeError("Invalid value");for(var l,u=o;;u++){var d=8*e.getNumDataCodewords(u,r),h=f.getTotalBits(t,u);if(h<=d){l=h;break}if(i<=u)throw new RangeError("Data too long")}for(var m=0,g=[e.Ecc.MEDIUM,e.Ecc.QUARTILE,e.Ecc.HIGH];m<g.length;m++){var p=g[m];c&&l<=8*e.getNumDataCodewords(u,p)&&(r=p)}for(var v=[],b=0,y=t;b<y.length;b++){var C=y[b];n(C.mode.modeBits,4,v),n(C.numChars,C.mode.numCharCountBits(u),v);for(var E=0,O=C.getData();E<O.length;E++){var w=O[E];v.push(w)}}a(v.length==l);var S=8*e.getNumDataCodewords(u,r);a(v.length<=S),n(0,Math.min(4,S-v.length),v),n(0,(8-v.length%8)%8,v),a(v.length%8==0);for(var M=236;v.length<S;M^=253)n(M,8,v);for(var j=[];8*j.length<v.length;)j.push(0);return v.forEach((function(e,t){return j[t>>>3]|=e<<7-(7&t)})),new e(u,r,j,s)},e.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},e.prototype.getModules=function(){return this.modules},e.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);var t=this.getAlignmentPatternPositions(),r=t.length;for(e=0;e<r;e++)for(var n=0;n<r;n++)0==e&&0==n||0==e&&n==r-1||e==r-1&&0==n||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},e.prototype.drawFormatBits=function(e){e=this.errorCorrectionLevel.formatBits<<3|e;for(var t=e,r=0;r<10;r++)t=t<<1^1335*(t>>>9);var n=21522^(e<<10|t);for(a(n>>>15==0),r=0;r<=5;r++)this.setFunctionModule(8,r,o(n,r));for(this.setFunctionModule(8,7,o(n,6)),this.setFunctionModule(8,8,o(n,7)),this.setFunctionModule(7,8,o(n,8)),r=9;r<15;r++)this.setFunctionModule(14-r,8,o(n,r));for(r=0;r<8;r++)this.setFunctionModule(this.size-1-r,8,o(n,r));for(r=8;r<15;r++)this.setFunctionModule(8,this.size-15+r,o(n,r));this.setFunctionModule(8,this.size-8,!0)},e.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^7973*(e>>>11);var r=this.version<<12|e;for(a(r>>>18==0),t=0;t<18;t++){var n=o(r,t),i=this.size-11+t%3,s=Math.floor(t/3);this.setFunctionModule(i,s,n),this.setFunctionModule(s,i,n)}}},e.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var o=Math.max(Math.abs(n),Math.abs(r)),a=e+n,i=t+r;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,2!=o&&4!=o)}},e.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,1!=Math.max(Math.abs(n),Math.abs(r)))},e.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},e.prototype.addEccAndInterleave=function(t){var r=this.version,n=this.errorCorrectionLevel;if(t.length!=e.getNumDataCodewords(r,n))throw new RangeError("Invalid argument");for(var o=e.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][r],i=e.ECC_CODEWORDS_PER_BLOCK[n.ordinal][r],s=(n=Math.floor(e.getNumRawDataModules(r)/8),o-n%o),c=Math.floor(n/o),l=[],u=e.reedSolomonComputeDivisor(i),d=0,h=0;d<o;d++){var f=t.slice(h,h+c-i+(d<s?0:1)),m=(h+=f.length,e.reedSolomonComputeRemainder(f,u));d<s&&f.push(0),l.push(f.concat(m))}var g=[];for(d=0;d<l[0].length;d++)(e=>{l.forEach((function(t,r){(e!=c-i||s<=r)&&g.push(t[e])}))})(d);return a(g.length==n),g},e.prototype.drawCodewords=function(t){if(t.length!=Math.floor(e.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var r=0,n=this.size-1;1<=n;n-=2){6==n&&(n=5);for(var i=0;i<this.size;i++)for(var s=0;s<2;s++){var c=n-s,l=0==(n+1&2)?this.size-1-i:i;!this.isFunction[l][c]&&r<8*t.length&&(this.modules[l][c]=o(t[r>>>3],7-(7&r)),r++)}}a(r==8*t.length)},e.prototype.applyMask=function(e){if(e<0||7<e)throw new RangeError("Mask value out of range");for(var t=0;t<this.size;t++)for(var r=0;r<this.size;r++){var n=void 0;switch(e){case 0:n=(r+t)%2==0;break;case 1:n=t%2==0;break;case 2:n=r%3==0;break;case 3:n=(r+t)%3==0;break;case 4:n=(Math.floor(r/3)+Math.floor(t/2))%2==0;break;case 5:n=r*t%2+r*t%3==0;break;case 6:n=(r*t%2+r*t%3)%2==0;break;case 7:n=((r+t)%2+r*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][r]&&n&&(this.modules[t][r]=!this.modules[t][r])}},e.prototype.getPenaltyScore=function(){for(var t=0,r=0;r<this.size;r++){for(var n=!1,o=0,i=[0,0,0,0,0,0,0],s=0;s<this.size;s++)this.modules[r][s]==n?5==++o?t+=e.PENALTY_N1:5<o&&t++:(this.finderPenaltyAddHistory(o,i),n||(t+=this.finderPenaltyCountPatterns(i)*e.PENALTY_N3),n=this.modules[r][s],o=1);t+=this.finderPenaltyTerminateAndCount(n,o,i)*e.PENALTY_N3}for(s=0;s<this.size;s++){n=!1;var c=0;for(i=[0,0,0,0,0,0,0],r=0;r<this.size;r++)this.modules[r][s]==n?5==++c?t+=e.PENALTY_N1:5<c&&t++:(this.finderPenaltyAddHistory(c,i),n||(t+=this.finderPenaltyCountPatterns(i)*e.PENALTY_N3),n=this.modules[r][s],c=1);t+=this.finderPenaltyTerminateAndCount(n,c,i)*e.PENALTY_N3}for(r=0;r<this.size-1;r++)for(s=0;s<this.size-1;s++){var l=this.modules[r][s];l==this.modules[r][s+1]&&l==this.modules[r+1][s]&&l==this.modules[r+1][s+1]&&(t+=e.PENALTY_N2)}for(var u=0,d=0,h=this.modules;d<h.length;d++)u=h[d].reduce((function(e,t){return e+(t?1:0)}),u);var f=this.size*this.size;f=Math.ceil(Math.abs(20*u-10*f)/f)-1;return a(0<=f&&f<=9),a(0<=(t+=f*e.PENALTY_N4)&&t<=2568888),t},e.prototype.getAlignmentPatternPositions=function(){if(1==this.version)return[];for(var e=Math.floor(this.version/7)+2,t=2*Math.floor((8*this.version+3*e+5)/(4*e-4)),r=[6],n=this.size-7;r.length<e;n-=t)r.splice(1,0,n);return r},e.getNumRawDataModules=function(t){if(t<e.MIN_VERSION||e.MAX_VERSION<t)throw new RangeError("Version number out of range");var r,n=(16*t+128)*t+64;return 2<=t&&(n-=(25*(r=Math.floor(t/7)+2)-10)*r-55,7<=t)&&(n-=36),a(208<=n&&n<=29648),n},e.getNumDataCodewords=function(t,r){return Math.floor(e.getNumRawDataModules(t)/8)-e.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t]*e.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t]},e.reedSolomonComputeDivisor=function(t){if(t<1||255<t)throw new RangeError("Degree out of range");for(var r=[],n=0;n<t-1;n++)r.push(0);r.push(1);var o=1;for(n=0;n<t;n++){for(var a=0;a<r.length;a++)r[a]=e.reedSolomonMultiply(r[a],o),a+1<r.length&&(r[a]^=r[a+1]);o=e.reedSolomonMultiply(o,2)}return r},e.reedSolomonComputeRemainder=function(t,r){for(var n=r.map((function(e){return 0})),o=0,a=t;o<a.length;o++)(t=>{var o=t^n.shift();n.push(0),r.forEach((function(t,r){return n[r]^=e.reedSolomonMultiply(t,o)}))})(a[o]);return n},e.reedSolomonMultiply=function(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");for(var r=0,n=7;0<=n;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return a(r>>>8==0),r},e.prototype.finderPenaltyCountPatterns=function(e){var t=e[1],r=(a(t<=3*this.size),0<t&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t);return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)},e.prototype.finderPenaltyTerminateAndCount=function(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)},e.prototype.finderPenaltyAddHistory=function(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)},e.MIN_VERSION=1,e.MAX_VERSION=40,e.PENALTY_N1=3,e.PENALTY_N2=3,e.PENALTY_N3=40,e.PENALTY_N4=10,e.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],e.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e})(),h.QrCode=r,f=(()=>{function e(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}return e.makeBytes=function(t){for(var r=[],o=0,a=t;o<a.length;o++)n(a[o],8,r);return new e(e.Mode.BYTE,t.length,r)},e.makeNumeric=function(t){if(!e.isNumeric(t))throw new RangeError("String contains non-numeric characters");for(var r=[],o=0;o<t.length;){var a=Math.min(t.length-o,3);n(parseInt(t.substring(o,o+a),10),3*a+1,r),o+=a}return new e(e.Mode.NUMERIC,t.length,r)},e.makeAlphanumeric=function(t){if(!e.isAlphanumeric(t))throw new RangeError("String contains unencodable characters in alphanumeric mode");for(var r=[],o=0;o+2<=t.length;o+=2){var a=45*e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(o));n(a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(o+1)),11,r)}return o<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(o)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)},e.makeSegments=function(t){return""==t?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]},e.makeEci=function(t){var r=[];if(t<0)throw new RangeError("ECI assignment value out of range");if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else{if(!(t<1e6))throw new RangeError("ECI assignment value out of range");n(6,3,r),n(t,21,r)}return new e(e.Mode.ECI,0,r)},e.isNumeric=function(t){return e.NUMERIC_REGEX.test(t)},e.isAlphanumeric=function(t){return e.ALPHANUMERIC_REGEX.test(t)},e.prototype.getData=function(){return this.bitData.slice()},e.getTotalBits=function(e,t){for(var r=0,n=0,o=e;n<o.length;n++){var a=o[n],i=a.mode.numCharCountBits(t);if(a.numChars>=1<<i)return 1/0;r+=4+i+a.bitData.length}return r},e.toUtf8ByteArray=function(e){e=encodeURI(e);for(var t=[],r=0;r<e.length;r++)"%"!=e.charAt(r)?t.push(e.charCodeAt(r)):(t.push(parseInt(e.substring(r+1,r+3),16)),r+=2);return t},e.NUMERIC_REGEX=/^[0-9]*$/,e.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,e.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e})(),h.QrSegment=f,r=(r=C=C||{}).QrCode||(r.QrCode={}),m=(()=>{function e(e,t){this.ordinal=e,this.formatBits=t}return e.LOW=new e(0,1),e.MEDIUM=new e(1,0),e.QUARTILE=new e(2,3),e.HIGH=new e(3,2),e})(),r.Ecc=m,m=(r=C=C||{}).QrSegment||(r.QrSegment={}),r=(()=>{function e(e,t){this.modeBits=e,this.numBitsCharCount=t}return e.prototype.numCharCountBits=function(e){return this.numBitsCharCount[Math.floor((e+7)/17)]},e.NUMERIC=new e(1,[10,12,14]),e.ALPHANUMERIC=new e(2,[9,11,13]),e.BYTE=new e(4,[8,16,16]),e.KANJI=new e(8,[8,10,12]),e.ECI=new e(7,[0,0,0]),e})(),m.Mode=r,p={L:(g=C).QrCode.Ecc.LOW,M:g.QrCode.Ecc.MEDIUM,Q:g.QrCode.Ecc.QUARTILE,H:g.QrCode.Ecc.HIGH},v=(()=>{try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0})(),m={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:"L",validator:i},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(e){return-1<["linear","radial"].indexOf(e)}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},r=d(d({},m),{renderAs:{type:String,required:!1,default:"canvas",validator:function(e){return-1<["canvas","svg"].indexOf(e)}}}),b=u.defineComponent({name:"QRCodeSvg",props:m,setup:function(e){function t(){var t=e.value,a=e.level,u=e.margin>>>0;t=g.QrCode.encodeText(t,p[i(a)?a:"L"]).getModules();n.value=t.length+2*u,e.imageSettings.src&&(a=c(t,e.size,u,e.imageSettings),r={x:a.x+u,y:a.y+u,width:a.w,height:a.h},a.excavation)&&(t=l(t,a.excavation)),o.value=s(t,u)}var r,n=u.ref(0),o=u.ref("");return t(),u.onUpdated(t),function(){return u.h("svg",{width:e.size,height:e.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(n.value," ").concat(n.value)},[u.h("defs",{},[e.gradient?u.h("linear"===e.gradientType?"linearGradient":"radialGradient",d({id:"qr-gradient"},"linear"===e.gradientType?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"}),[u.h("stop",{offset:"0%",style:{stopColor:e.gradientStartColor}}),u.h("stop",{offset:"100%",style:{stopColor:e.gradientEndColor}})]):null]),u.h("rect",{width:"100%",height:"100%",fill:e.background}),u.h("path",{fill:e.gradient?"url(#qr-gradient)":e.foreground,d:o.value}),e.imageSettings.src&&u.h("image",d({href:e.imageSettings.src},r))])}}}),y=u.defineComponent({name:"QRCodeCanvas",props:m,setup:function(e,t){function r(){var t,r,a,u,d,h,f=e.value,m=e.level,b=e.size,y=e.background,C=e.foreground,E=e.gradient,O=e.gradientType,w=e.gradientStartColor,S=e.gradientEndColor,M=e.margin>>>0,j=(m=i(m)?m:"L",n.value);j&&(t=j.getContext("2d"))&&(m=(f=g.QrCode.encodeText(f,p[m]).getModules()).length+2*M,r=o.value,u={x:0,y:0,width:0,height:0},(a=e.imageSettings.src&&null!=r&&0!==r.naturalWidth&&0!==r.naturalHeight)&&(u={x:(d=c(f,e.size,M,e.imageSettings)).x+M,y:d.y+M,width:d.w,height:d.h},d.excavation)&&(f=l(f,d.excavation)),h=b/m*(d=window.devicePixelRatio||1),j.height=j.width=b*d,t.scale(h,h),t.fillStyle=y,t.fillRect(0,0,m,m),E?(j=void 0,(j="linear"===O?t.createLinearGradient(0,0,m,m):t.createRadialGradient(m/2,m/2,0,m/2,m/2,m/2)).addColorStop(0,w),j.addColorStop(1,S),t.fillStyle=j):t.fillStyle=C,v?t.fill(new Path2D(s(f,M))):f.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+M,r+M,1,1)}))})),a)&&t.drawImage(r,u.x,u.y,u.width,u.height)}var n=u.ref(null),o=u.ref(null),a=(u.onMounted(r),u.onUpdated(r),t.attrs.style);return function(){return u.h(u.Fragment,[u.h("canvas",d(d({},t.attrs),{ref:n,style:d(d({},a),{width:"".concat(e.size,"px"),height:"".concat(e.size,"px")})})),e.imageSettings.src&&u.h("img",{ref:o,src:e.imageSettings.src,style:{display:"none"},onLoad:r})])}}}),C=u.defineComponent({name:"Qrcode",render:function(){var e=this.$props,t=e.renderAs;return u.h("svg"===t?b:y,{value:e.value,size:e.size,margin:e.margin,level:e.level,background:e.background,foreground:e.foreground,imageSettings:e.imageSettings,gradient:e.gradient,gradientType:e.gradientType,gradientStartColor:e.gradientStartColor,gradientEndColor:e.gradientEndColor})},props:r}),t.QrcodeCanvas=y,t.QrcodeSvg=b,t.default=C,Object.defineProperty(t,"__esModule",{value:!0})}}]);
|