@10yun/open-sdk 0.3.89

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-DSBKHepn.cjs");require("pinia");const r=require("vue");function K(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var V={exports:{}},J=V.exports,H;function X(){return H||(H=1,function(s,l){var _;(function(p,h){s.exports=h()})(J,function(){function p(e){this.mode=g.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,o=this.data.length;t<o;t++){var i=[],n=this.data.charCodeAt(t);n>65536?(i[0]=240|(n&1835008)>>>18,i[1]=128|(n&258048)>>>12,i[2]=128|(n&4032)>>>6,i[3]=128|n&63):n>2048?(i[0]=224|(n&61440)>>>12,i[1]=128|(n&4032)>>>6,i[2]=128|n&63):n>128?(i[0]=192|(n&1984)>>>6,i[1]=128|n&63):i[0]=n,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}p.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,o=this.parsedData.length;t<o;t++)e.put(this.parsedData[t],8)}};function h(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}h.prototype={addData:function(e){var t=new p(e);this.dataList.push(t),this.dataCache=null},isDark:function(e,t){if(e<0||this.moduleCount<=e||t<0||this.moduleCount<=t)throw new Error(e+","+t);return this.modules[e][t]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(e,t){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var o=0;o<this.moduleCount;o++){this.modules[o]=new Array(this.moduleCount);for(var i=0;i<this.moduleCount;i++)this.modules[o][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(e,t),this.typeNumber>=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=h.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var o=-1;o<=7;o++)if(!(e+o<=-1||this.moduleCount<=e+o))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(0<=o&&o<=6&&(i==0||i==6)||0<=i&&i<=6&&(o==0||o==6)||2<=o&&o<=4&&2<=i&&i<=4?this.modules[e+o][t+i]=!0:this.modules[e+o][t+i]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,o=0;o<8;o++){this.makeImpl(!0,o);var i=v.getLostPoint(this);(o==0||e>i)&&(e=i,t=o)}return t},createMovieClip:function(e,t,o){var i=e.createEmptyMovieClip(t,o),n=1;this.make();for(var c=0;c<this.modules.length;c++)for(var d=c*n,a=0;a<this.modules[c].length;a++){var u=a*n,m=this.modules[c][a];m&&(i.beginFill(0,100),i.moveTo(u,d),i.lineTo(u+n,d),i.lineTo(u+n,d+n),i.lineTo(u,d+n),i.endFill())}return i},setupTimingPattern:function(){for(var e=8;e<this.moduleCount-8;e++)this.modules[e][6]==null&&(this.modules[e][6]=e%2==0);for(var t=8;t<this.moduleCount-8;t++)this.modules[6][t]==null&&(this.modules[6][t]=t%2==0)},setupPositionAdjustPattern:function(){for(var e=v.getPatternPosition(this.typeNumber),t=0;t<e.length;t++)for(var o=0;o<e.length;o++){var i=e[t],n=e[o];if(this.modules[i][n]==null)for(var c=-2;c<=2;c++)for(var d=-2;d<=2;d++)c==-2||c==2||d==-2||d==2||c==0&&d==0?this.modules[i+c][n+d]=!0:this.modules[i+c][n+d]=!1}},setupTypeNumber:function(e){for(var t=v.getBCHTypeNumber(this.typeNumber),o=0;o<18;o++){var i=!e&&(t>>o&1)==1;this.modules[Math.floor(o/3)][o%3+this.moduleCount-8-3]=i}for(var o=0;o<18;o++){var i=!e&&(t>>o&1)==1;this.modules[o%3+this.moduleCount-8-3][Math.floor(o/3)]=i}},setupTypeInfo:function(e,t){for(var o=this.errorCorrectLevel<<3|t,i=v.getBCHTypeInfo(o),n=0;n<15;n++){var c=!e&&(i>>n&1)==1;n<6?this.modules[n][8]=c:n<8?this.modules[n+1][8]=c:this.modules[this.moduleCount-15+n][8]=c}for(var n=0;n<15;n++){var c=!e&&(i>>n&1)==1;n<8?this.modules[8][this.moduleCount-n-1]=c:n<9?this.modules[8][15-n-1+1]=c:this.modules[8][15-n-1]=c}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var o=-1,i=this.moduleCount-1,n=7,c=0,d=this.moduleCount-1;d>0;d-=2)for(d==6&&d--;;){for(var a=0;a<2;a++)if(this.modules[i][d-a]==null){var u=!1;c<e.length&&(u=(e[c]>>>n&1)==1);var m=v.getMask(t,i,d-a);m&&(u=!u),this.modules[i][d-a]=u,n--,n==-1&&(c++,n=7)}if(i+=o,i<0||this.moduleCount<=i){i-=o,o=-o;break}}}},h.PAD0=236,h.PAD1=17,h.createData=function(e,t,o){for(var i=L.getRSBlocks(e,t),n=new w,c=0;c<o.length;c++){var d=o[c];n.put(d.mode,4),n.put(d.getLength(),v.getLengthInBits(d.mode,e)),d.write(n)}for(var a=0,c=0;c<i.length;c++)a+=i[c].dataCount;if(n.getLengthInBits()>a*8)throw new Error("code length overflow. ("+n.getLengthInBits()+">"+a*8+")");for(n.getLengthInBits()+4<=a*8&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=a*8||(n.put(h.PAD0,8),n.getLengthInBits()>=a*8));)n.put(h.PAD1,8);return h.createBytes(n,i)},h.createBytes=function(e,t){for(var o=0,i=0,n=0,c=new Array(t.length),d=new Array(t.length),a=0;a<t.length;a++){var u=t[a].dataCount,m=t[a].totalCount-u;i=Math.max(i,u),n=Math.max(n,m),c[a]=new Array(u);for(var f=0;f<c[a].length;f++)c[a][f]=255&e.buffer[f+o];o+=u;var y=v.getErrorCorrectPolynomial(m),T=new A(c[a],y.getLength()-1),N=T.mod(y);d[a]=new Array(y.getLength()-1);for(var f=0;f<d[a].length;f++){var b=f+N.getLength()-d[a].length;d[a][f]=b>=0?N.get(b):0}}for(var D=0,f=0;f<t.length;f++)D+=t[f].totalCount;for(var I=new Array(D),M=0,f=0;f<i;f++)for(var a=0;a<t.length;a++)f<c[a].length&&(I[M++]=c[a][f]);for(var f=0;f<n;f++)for(var a=0;a<t.length;a++)f<d[a].length&&(I[M++]=d[a][f]);return I};for(var g={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},k={L:1,M:0,Q:3,H:2},S={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},v={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(e){for(var t=e<<10;v.getBCHDigit(t)-v.getBCHDigit(v.G15)>=0;)t^=v.G15<<v.getBCHDigit(t)-v.getBCHDigit(v.G15);return(e<<10|t)^v.G15_MASK},getBCHTypeNumber:function(e){for(var t=e<<12;v.getBCHDigit(t)-v.getBCHDigit(v.G18)>=0;)t^=v.G18<<v.getBCHDigit(t)-v.getBCHDigit(v.G18);return e<<12|t},getBCHDigit:function(e){for(var t=0;e!=0;)t++,e>>>=1;return t},getPatternPosition:function(e){return v.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,o){switch(e){case S.PATTERN000:return(t+o)%2==0;case S.PATTERN001:return t%2==0;case S.PATTERN010:return o%3==0;case S.PATTERN011:return(t+o)%3==0;case S.PATTERN100:return(Math.floor(t/2)+Math.floor(o/3))%2==0;case S.PATTERN101:return t*o%2+t*o%3==0;case S.PATTERN110:return(t*o%2+t*o%3)%2==0;case S.PATTERN111:return(t*o%3+(t+o)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new A([1],0),o=0;o<e;o++)t=t.multiply(new A([1,E.gexp(o)],0));return t},getLengthInBits:function(e,t){if(1<=t&&t<10)switch(e){case g.MODE_NUMBER:return 10;case g.MODE_ALPHA_NUM:return 9;case g.MODE_8BIT_BYTE:return 8;case g.MODE_KANJI:return 8;default:throw new Error("mode:"+e)}else if(t<27)switch(e){case g.MODE_NUMBER:return 12;case g.MODE_ALPHA_NUM:return 11;case g.MODE_8BIT_BYTE:return 16;case g.MODE_KANJI:return 10;default:throw new Error("mode:"+e)}else if(t<41)switch(e){case g.MODE_NUMBER:return 14;case g.MODE_ALPHA_NUM:return 13;case g.MODE_8BIT_BYTE:return 16;case g.MODE_KANJI:return 12;default:throw new Error("mode:"+e)}else throw new Error("type:"+t)},getLostPoint:function(e){for(var t=e.getModuleCount(),o=0,i=0;i<t;i++)for(var n=0;n<t;n++){for(var c=0,d=e.isDark(i,n),a=-1;a<=1;a++)if(!(i+a<0||t<=i+a))for(var u=-1;u<=1;u++)n+u<0||t<=n+u||a==0&&u==0||d==e.isDark(i+a,n+u)&&c++;c>5&&(o+=3+c-5)}for(var i=0;i<t-1;i++)for(var n=0;n<t-1;n++){var m=0;e.isDark(i,n)&&m++,e.isDark(i+1,n)&&m++,e.isDark(i,n+1)&&m++,e.isDark(i+1,n+1)&&m++,(m==0||m==4)&&(o+=3)}for(var i=0;i<t;i++)for(var n=0;n<t-6;n++)e.isDark(i,n)&&!e.isDark(i,n+1)&&e.isDark(i,n+2)&&e.isDark(i,n+3)&&e.isDark(i,n+4)&&!e.isDark(i,n+5)&&e.isDark(i,n+6)&&(o+=40);for(var n=0;n<t;n++)for(var i=0;i<t-6;i++)e.isDark(i,n)&&!e.isDark(i+1,n)&&e.isDark(i+2,n)&&e.isDark(i+3,n)&&e.isDark(i+4,n)&&!e.isDark(i+5,n)&&e.isDark(i+6,n)&&(o+=40);for(var f=0,n=0;n<t;n++)for(var i=0;i<t;i++)e.isDark(i,n)&&f++;var y=Math.abs(100*f/t/t-50)/5;return o+=y*10,o}},E={glog:function(e){if(e<1)throw new Error("glog("+e+")");return E.LOG_TABLE[e]},gexp:function(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return E.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},C=0;C<8;C++)E.EXP_TABLE[C]=1<<C;for(var C=8;C<256;C++)E.EXP_TABLE[C]=E.EXP_TABLE[C-4]^E.EXP_TABLE[C-5]^E.EXP_TABLE[C-6]^E.EXP_TABLE[C-8];for(var C=0;C<255;C++)E.LOG_TABLE[E.EXP_TABLE[C]]=C;function A(e,t){if(e.length==null)throw new Error(e.length+"/"+t);for(var o=0;o<e.length&&e[o]==0;)o++;this.num=new Array(e.length-o+t);for(var i=0;i<e.length-o;i++)this.num[i]=e[i+o]}A.prototype={get:function(e){return this.num[e]},getLength:function(){return this.num.length},multiply:function(e){for(var t=new Array(this.getLength()+e.getLength()-1),o=0;o<this.getLength();o++)for(var i=0;i<e.getLength();i++)t[o+i]^=E.gexp(E.glog(this.get(o))+E.glog(e.get(i)));return new A(t,0)},mod:function(e){if(this.getLength()-e.getLength()<0)return this;for(var t=E.glog(this.get(0))-E.glog(e.get(0)),o=new Array(this.getLength()),i=0;i<this.getLength();i++)o[i]=this.get(i);for(var i=0;i<e.getLength();i++)o[i]^=E.gexp(E.glog(e.get(i))+t);return new A(o,0).mod(e)}};function L(e,t){this.totalCount=e,this.dataCount=t}L.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],L.getRSBlocks=function(e,t){var o=L.getRsBlockTable(e,t);if(o==null)throw new Error("bad rs block @ typeNumber:"+e+"/errorCorrectLevel:"+t);for(var i=o.length/3,n=[],c=0;c<i;c++)for(var d=o[c*3+0],a=o[c*3+1],u=o[c*3+2],m=0;m<d;m++)n.push(new L(a,u));return n},L.getRsBlockTable=function(e,t){switch(t){case k.L:return L.RS_BLOCK_TABLE[(e-1)*4+0];case k.M:return L.RS_BLOCK_TABLE[(e-1)*4+1];case k.Q:return L.RS_BLOCK_TABLE[(e-1)*4+2];case k.H:return L.RS_BLOCK_TABLE[(e-1)*4+3];default:return}};function w(){this.buffer=[],this.length=0}w.prototype={get:function(e){var t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(var o=0;o<t;o++)this.putBit((e>>>t-o-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var P=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function q(){return typeof CanvasRenderingContext2D<"u"}function O(){var e=!1,t=navigator.userAgent;if(/android/i.test(t)){e=!0;var o=t.toString().match(/android ([0-9]\.[0-9])/i);o&&o[1]&&(e=parseFloat(o[1]))}return e}var R=function(){var e=function(t,o){this._el=t,this._htOption=o};return e.prototype.draw=function(t){var o=this._htOption,i=this._el,n=t.getModuleCount();Math.floor(o.width/n),Math.floor(o.height/n),this.clear();function c(f,y){var T=document.createElementNS("http://www.w3.org/2000/svg",f);for(var N in y)y.hasOwnProperty(N)&&T.setAttribute(N,y[N]);return T}var d=c("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:o.colorLight});d.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),i.appendChild(d),d.appendChild(c("rect",{fill:o.colorLight,width:"100%",height:"100%"})),d.appendChild(c("rect",{fill:o.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a<n;a++)for(var u=0;u<n;u++)if(t.isDark(a,u)){var m=c("use",{x:String(u),y:String(a)});m.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),d.appendChild(m)}},e.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},e}(),Q=document.documentElement.tagName.toLowerCase()==="svg",U=Q?R:q()?function(){function e(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}if(this&&this._android&&this._android<=2.1){var t=1/window.devicePixelRatio,o=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(c,d,a,u,m,f,y,T,N){if("nodeName"in c&&/img/i.test(c.nodeName))for(var b=arguments.length-1;b>=1;b--)arguments[b]=arguments[b]*t;else typeof T>"u"&&(arguments[1]*=t,arguments[2]*=t,arguments[3]*=t,arguments[4]*=t);o.apply(this,arguments)}}function i(c,d){var a=this;if(a._fFail=d,a._fSuccess=c,a._bSupportDataURI===null){var u=document.createElement("img"),m=function(){a._bSupportDataURI=!1,a._fFail&&a._fFail.call(a)},f=function(){a._bSupportDataURI=!0,a._fSuccess&&a._fSuccess.call(a)};u.onabort=m,u.onerror=m,u.onload=f,u.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";return}else a._bSupportDataURI===!0&&a._fSuccess?a._fSuccess.call(a):a._bSupportDataURI===!1&&a._fFail&&a._fFail.call(a)}var n=function(c,d){this._bIsPainted=!1,this._android=O(),this._htOption=d,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=d.width,this._elCanvas.height=d.height,c.appendChild(this._elCanvas),this._el=c,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return n.prototype.draw=function(c){var d=this._elImage,a=this._oContext,u=this._htOption,m=c.getModuleCount(),f=u.width/m,y=u.height/m,T=Math.round(f),N=Math.round(y);d.style.display="none",this.clear();for(var b=0;b<m;b++)for(var D=0;D<m;D++){var I=c.isDark(b,D),M=D*f,x=b*y;a.strokeStyle=I?u.colorDark:u.colorLight,a.lineWidth=1,a.fillStyle=I?u.colorDark:u.colorLight,a.fillRect(M,x,f,y),a.strokeRect(Math.floor(M)+.5,Math.floor(x)+.5,T,N),a.strokeRect(Math.ceil(M)-.5,Math.ceil(x)-.5,T,N)}this._bIsPainted=!0},n.prototype.makeImage=function(){this._bIsPainted&&i.call(this,e)},n.prototype.isPainted=function(){return this._bIsPainted},n.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},n.prototype.round=function(c){return c&&Math.floor(c*1e3)/1e3},n}():function(){var e=function(t,o){this._el=t,this._htOption=o};return e.prototype.draw=function(t){for(var o=this._htOption,i=this._el,n=t.getModuleCount(),c=Math.floor(o.width/n),d=Math.floor(o.height/n),a=['<table style="border:0;border-collapse:collapse;">'],u=0;u<n;u++){a.push("<tr>");for(var m=0;m<n;m++)a.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+c+"px;height:"+d+"px;background-color:"+(t.isDark(u,m)?o.colorDark:o.colorLight)+';"></td>');a.push("</tr>")}a.push("</table>"),i.innerHTML=a.join("");var f=i.childNodes[0],y=(o.width-f.offsetWidth)/2,T=(o.height-f.offsetHeight)/2;y>0&&T>0&&(f.style.margin=T+"px "+y+"px")},e.prototype.clear=function(){this._el.innerHTML=""},e}();function G(e,t){for(var o=1,i=$(e),n=0,c=P.length;n<=c;n++){var d=0;switch(t){case k.L:d=P[n][0];break;case k.M:d=P[n][1];break;case k.Q:d=P[n][2];break;case k.H:d=P[n][3];break}if(i<=d)break;o++}if(o>P.length)throw new Error("Too long data");return o}function $(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}return _=function(e,t){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:k.H},typeof t=="string"&&(t={text:t}),t)for(var o in t)this._htOption[o]=t[o];typeof e=="string"&&(e=document.getElementById(e)),this._htOption.useSVG&&(U=R),this._android=O(),this._el=e,this._oQRCode=null,this._oDrawing=new U(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},_.prototype.makeCode=function(e){this._oQRCode=new h(G(e,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(e),this._oQRCode.make(),this._el.title=e,this._oDrawing.draw(this._oQRCode),this.makeImage()},_.prototype.makeImage=function(){typeof this._oDrawing.makeImage=="function"&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},_.prototype.clear=function(){this._oDrawing.clear()},_.CorrectLevel=k,_})}(V)),V.exports}var z=X();const F=K(z),Y={components:{switchBusiness:B.switchBusiness},data(){return{loadOngoing:!1,loginMode:"access",loginJump:!1,cache_remember:"off",cache_privacy:"off",account_mobile:"",account_password:"",account_password2:"",captcha_code:"",sms_code:"",account_business_id:0,reg_invite:"",regInviteNeed:!1,codeNeed:!1,codeLoad:0,codeKey:"",codeUrl:"",chainShowFlag:!1,chainAccountList:[],chainTempToken:"",qrcodeExpiredShow:!1,qrcodeTimer:null,qrcodeLoad:!1,qrcodeScanVernum:15,qrcodeScanVererr:0,copyright_info:""}},watch:{$route({query:s}){s.type=="reg"&&this.$nextTick(()=>{this.loginMode="reg"})},account_mobile(s){this.$nextTick(()=>{let l=this.$refs.account_mobile.$el.querySelector("input");const p=getComputedStyle(l).background.match(/rgb\((\d+,\s*\d+,\s*\d+)\)/);p&&p[0]==="rgb(232, 240, 254)"&&this.onBlur()})},loginMode(s){s=="reg"&&(this.regInviteNeed=!!this.systemConfig.reg_invite_need)}},computed:{openProductPrivacyUrl(){var s;return((s=this.openProductInfo)==null?void 0:s.privacy_url)||""},loginLastLogo(){return this.openProductInfo.platinfo_log||"/logo-nobg.png"},loginSystemTitle(){var p,h;let s=(p=this.openProductInfo)==null?void 0:p.system_type;return((h=this.openProductInfo)==null?void 0:h.info_title)||s},currentLanguage(){return this.languageList[this.languageName]||"Language"}},created(){this.cache_remember=localStorage.getItem("cacheLoginRemember")||"off",this.cache_privacy=localStorage.getItem("cacheLoginPrivacy")||"off",this.account_mobile=localStorage.getItem("cacheLoginMobile")||""},async mounted(){this.loginMode=this.$route.query.type==="reg"?"reg":"access",this.$Electron&&(this.$Electron.sendMessage("webTabDestroyAll"),this.$Electron.sendMessage("childWindowDestroyAll")),B.useSdkSystemStore().$subscribe((s,l)=>{s.events.key=="useSSOLogin"&&l.useSSOLogin==!0&&this.inputServerUrl()})},beforeDestroy(){clearInterval(this.qrcodeTimer),this.loginJump=!1,this.account_password="",this.account_password2="",this.captcha_code="",this.reg_invite=""},methods:{handleRemember(s){s=="on"?localStorage.setItem("cacheLoginRemember",s):localStorage.removeItem("cacheLoginRemember")},handleRrivacy(s){s=="on"?(localStorage.setItem("cacheLoginPrivacy",s),this.chackServerUrl().catch(l=>{})):localStorage.removeItem("cacheLoginPrivacy"),this.cache_privacy=s},handleForgot(){this.$message.warning("请联系管理员!")},chackServerUrl(s){return new Promise((l,_)=>{l()})},switchLoginMode(s){this.chackServerUrl(!0).then(()=>{clearInterval(this.qrcodeTimer),s==="qrcode"?(this.loginMode="qrcode",this.scanQrcodeRefresh()):s==="access"?this.loginMode="access":s==="smsLogin"?(this.loginMode="smsLogin",this.refreshCode()):this.loginMode=s})},refreshCode(){this.captcha_code="",!(this.codeLoad>0)&&(setTimeout(s=>{this.codeLoad++},600),this.$request.flagGet("BASE_PASSPORT_CODE_DATA",{account_mobile:this.account_mobile}).then(({data:s})=>{var l;this.codeKey=s.key,this.codeUrl=s.img,(l=this.$refs.captcha_code)==null||l.focus()}).catch(s=>{this.codeUrl="error"}).finally(s=>{this.codeLoad--}))},onBlur(){if(!this.account_mobile){this.codeNeed=!1;return}this.loadOngoing=!0,this.$request.flagGet("BASE_PASSPORT_CODE_NEED",{account_mobile:this.account_mobile}).then(s=>{this.loadOngoing=!1,s.data=="need"?(this.refreshCode(),this.codeNeed=!0):this.codeNeed=!1}).catch(s=>{this.loadOngoing=!1}).finally(s=>{this.loadOngoing=!1})},accessLoginFunc(){if(this.loadOngoing)return this.$message({type:"warning",message:"正在登录中,请勿重新确认~"}),!1;this.chackServerUrl(!0).then(()=>{if(this.account_mobile=cvUtils.strTrimAll(this.account_mobile),this.account_password=cvUtils.strTrimAll(this.account_password),this.account_password2=cvUtils.strTrimAll(this.account_password2),this.captcha_code=cvUtils.strTrimAll(this.captcha_code),this.reg_invite=cvUtils.strTrimAll(this.reg_invite),this.cache_privacy!="on"){this.$message.warning("请同意协议");return}if(!cvUtils.isMobile(this.account_mobile)){this.$message.warning("请输入正确的手机号码"),this.$refs.account_mobile.focus();return}if(!this.account_password){this.$message.warning("请输入密码"),this.$refs.account_password.focus();return}if(this.loginMode=="reg"&&this.account_password!=this.account_password2){this.$message.warning("确认密码输入不一致"),this.$refs.account_password2.focus();return}if(this.codeNeed&&!this.captcha_code){this.$message.warning("请输入验证码"),this.$refs.captcha_code.focus();return}this.passportHandle2(null,"MobilePwdLogin")})},loginBusinessCheck(s){this.account_mobile=s.account_mobile_show,this.account_business_id=s.business_id,s.acc_role_type=="sy-org-admin"?this.passportHandle2(null,"OrgAdminPwdLogin"):s.acc_role_type=="sy-org-staff"&&this.passportHandle2(null,"OrgStaffPwdLogin")},passportHandle2(s,l){let _=this.$message({iconClass:"ElIconLoading",message:"正在登录...",duration:0});this.loadOngoing=!0,localStorage.setItem("cacheLoginMobile",this.account_mobile);try{let p={};this.loginMode=="access"?(p={account_mobile:this.account_mobile,business_id:this.account_business_id,account_password:this.account_password,captcha_code:this.captcha_code,captcha_key:this.codeKey},(l=="OrgAdminPwdLogin"||l=="OrgStaffPwdLogin")&&(p.temp_token=this.chainTempToken)):this.loginMode=="reg"&&(p={account_mobile:this.account_mobile,business_id:this.account_business_id,account_password:this.account_password,captcha_code:this.captcha_code,captcha_key:this.codeKey,reg_invite:this.reg_invite}),this.$request.setOptions({timeout:1e4}).flagPost("BASE_PASSPORT_PASSPORT",{handleType:l,...p}).then(h=>{_.close(),this.loadOngoing=!1,h.status==200?this.adminLoginSucc(h):h.status==403?(this.$message.error("验证码有误!"),this.refreshCode(),this.codeNeed=!0):(this.$message.error(h.msg),this.refreshCode())}).catch(h=>{this.loadOngoing=!1,this.chainShowFlag=!1,_.close(),this.refreshCode(),this.codeNeed=!0})}catch{this.$message.error("登录异常"),_.close(),this.loadOngoing=!1,this.refreshCode()}},async adminLoginSucc(s){let l=s.data||{};if(l.result_type=="chain")this.chainAccountList=l.result_data||[],this.chainShowFlag=!0,this.chainTempToken=l.result_token||"";else{const _=l.result_data||{};await B.useSdkAccountStore().SA_ACCOUNT_SIGNIN(_),this.codeNeed=!1,this.$message({type:"success",message:"登录成功...",duration:800,onClose:()=>{this.goNext()}})}},chainReselection(){this.refreshCode(),this.chainShowFlag=!1},scanCreate(s){new F(this.$refs.qrCodeUrl,{text:s,width:180,height:180,margin:2,colorDark:"#000000",colorLight:"#ffffff",correctLevel:F.CorrectLevel.L})},scanQrcodeRefresh(){if(this.loginMode!="qrcode"||this.qrcodeLoad)return!1;this.qrcodeExpiredShow=!1,this.qrcodeScanVererr=0,this.$nextTick(()=>{document.getElementById("qrcode").innerHTML="",clearInterval(this.qrcodeTimer),this.qrcodeLoad=!0,this.$request.flagGet("BASE_PASSPORT_SCAN_QRCODE",{name:"app",fun:"scanQrcode"}).then(s=>{var l;s.status==200?(this.scanCreate((l=s==null?void 0:s.data)==null?void 0:l.checkLogin),this.qrcodeTimer=window.setInterval(()=>{var _;this.scanCheckFunc((_=s==null?void 0:s.data)==null?void 0:_.scanCode)},3e3)):result.status==404}).catch(s=>{}).finally(s=>{this.qrcodeLoad=!1})})},scanCheckFunc(s){if(this.qrcodeScanVererr++,this.qrcodeScanVererr>this.qrcodeScanVernum)return clearInterval(this.qrcodeTimer),this.qrcodeExpiredShow=!0,!1;this.$request.flagPost("BASE_PASSPORT_SCAN_CHECK",{name:"app",fun:"scanCheck",scanCode:s||""}).then(l=>{var p,h;if(l.status==200){var _=l.msg&&((p=l==null?void 0:l.data)==null?void 0:p.scanCVal)||"";_!=""&&(clearInterval(this.qrcodeTimer),this.scanLoginFunc(s,(h=l==null?void 0:l.data)==null?void 0:h.scanCVal))}else l.status==405&&(clearInterval(this.qrcodeTimer),this.qrcodeExpiredShow=!0)}).catch(()=>{})},scanLoginFunc(s,l){this.$message({type:"success",message:"扫码成功,请稍后...",duration:1500}),this.$request.flagPost("BASE_PASSPORT_SCAN_LOGIN",{name:"app",fun:"scanLogin",scanCode:s,scanCVal:l}).then(_=>{if(_.status==200){let p=this.$message({iconClass:"ElIconLoading",message:"正在安全登录中,请稍后...",duration:0});setTimeout(()=>{p.close(),this.$message({message:_.msg,type:_.status==200?"success":"error"})},2e3)}}).catch(()=>{})},goNext(){this.loginJump=!0;let s=cvUtils.urlQueryToObj(this.$route.query);const l=decodeURIComponent(s.from||"");l?gbIdbObj.idbSetItem("clearCache","login").then(_=>{window.location.replace(l)}):this.$router.push({path:"/"})},setTheme(s){B.useSdkThemesStore().SA_THEMES_SET(s)},setLanguage(s){B.useSdkLanguageStore().SA_LANGUAGE_SET(s)},inputServerUrl(){},inputServerChack(s){return new Promise((l,_)=>{let p=s;/\/api\/$/.test(p)||(p=p+(cvUtils.strRightExists(p,"/")?"api/":"/api/")),/^https*:\/\//i.test(p)||(p=`https://${p}`),B.HttpObj.setOptions({checkNetwork:!1}).flagGet("SYS_SETT_ALL",{}).then(async({data:h})=>{typeof h.server_version>"u"&&typeof h.all_group_mute>"u"?_(`服务器(${cvUtils.urlGetDomain(s)})版本过低`):(p!=this.cacheServerUrl&&(await gbIdbObj.idbSetItem("cacheServerUrl",p),window.location.reload()),l())}).catch(({ret:h,msg:g})=>{if(h===-1001){if(!/^https*:\/\//i.test(s)){this.inputServerChack(`http://${s}`).then(l).catch(_);return}g="服务器地址无效"}_(g)})})}}},W={class:"cloud-login-wrap"},j={key:0,class:"cloud-login-main"},Z={class:"cloud-login-logo no-dark-content can-click"},ee=["src"],te={key:0,class:"cloud-login-box"},oe={class:"login-title"},ie={class:"login-subtitle"},ne={class:"cloud-login-mode-access"},re={class:"login-switch"},se={key:1,class:"cloud-login-box"},ae={class:"login-mode-switch"},le={class:"login-mode-switch-box"},ce={class:"login-title"},he={class:"login-subtitle"},de={class:"cloud-login-mode-access"},ue={key:0,class:"code-load"},ge={key:1,class:"code-error"},fe=["src"],me={class:"cloud-login-other"},pe=["href"],_e={class:"cloud-login-other"},ve={key:0,class:"login-switch"},we={key:1,class:"page-login-oauth"},Ee={key:2,class:"cloud-login-box"},Ce={class:"login-mode-switch"},ye={class:"login-mode-switch-box"},ke={class:"login-title"},Le={class:"login-subtitle"},Te={id:"qrcode",ref:"qrCodeUrl"},be={key:3,class:"cloud-login-box"},Se={class:"login-title"},Ne={class:"login-subtitle"},Ae={class:"cloud-login-mode-access"},De={class:"page-login-oauth"};function Be(s,l,_,p,h,g){const k=r.resolveComponent("el-input"),S=r.resolveComponent("el-button"),v=r.resolveComponent("cv-icons"),E=r.resolveComponent("el-tooltip"),C=r.resolveComponent("ElIconLoading"),A=r.resolveComponent("el-checkbox"),L=r.resolveComponent("switchBusiness");return r.openBlock(),r.createElementBlock("div",W,[h.chainShowFlag?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",j,[r.createElementVNode("div",Z,[r.createElementVNode("img",{src:g.loginLastLogo,alt:""},null,8,ee)]),h.loginMode=="reg"?(r.openBlock(),r.createElementBlock("div",te,[r.createElementVNode("div",oe,r.toDisplayString(g.loginSystemTitle),1),r.createElementVNode("div",ie,r.toDisplayString(s.$t("输入您的信息以创建帐户。")),1),r.createElementVNode("div",ne,[r.createElementVNode("form",null,[r.createVNode(k,{modelValue:h.account_password2,"onUpdate:modelValue":l[0]||(l[0]=w=>h.account_password2=w),ref:"account_password2","prefix-icon":"ElIconLock",placeholder:s.$t("输入确认密码"),type:"password",size:"large",clearable:""},null,8,["modelValue","placeholder"]),h.regInviteNeed?(r.openBlock(),r.createBlock(k,{key:0,modelValue:h.reg_invite,"onUpdate:modelValue":l[1]||(l[1]=w=>h.reg_invite=w),ref:"reg_invite",class:"login-code",placeholder:s.$t("请输入注册邀请码"),type:"text",size:"large",clearable:""},{prepend:r.withCtx(()=>[r.createTextVNode(" "+r.toDisplayString(s.$t("邀请码"))+" ",1)]),_:1},8,["modelValue","placeholder"])):r.createCommentVNode("",!0)]),r.createVNode(S,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.loginJump?"注册成功":"注册"),1)]),_:1}),r.createElementVNode("div",re,[r.createTextVNode(r.toDisplayString(s.$t("已经有帐号?"))+" ",1),r.createElementVNode("a",{href:"javascript:void(0)",onClick:l[2]||(l[2]=w=>g.switchLoginMode("access"))},r.toDisplayString(s.$t("登录帐号")),1)])])])):r.createCommentVNode("",!0),h.loginMode=="access"?(r.openBlock(),r.createElementBlock("div",se,[r.createElementVNode("div",ae,[r.createElementVNode("div",le,[r.createVNode(E,{content:"扫码登录",placement:"left"},{default:r.withCtx(()=>[r.createElementVNode("span",{class:"login-mode-switch-icon",onClick:l[3]||(l[3]=w=>g.switchLoginMode("qrcode"))},[r.createVNode(v,{type:"cvSvgBaseQrcode",size:"45"})])]),_:1})])]),r.createElementVNode("div",ce,r.toDisplayString(g.loginSystemTitle),1),r.createElementVNode("div",he,r.toDisplayString(s.$t("输入您的凭证以访问您的帐户。")),1),r.createElementVNode("div",de,[r.createElementVNode("form",null,[r.createVNode(k,{modelValue:h.account_mobile,"onUpdate:modelValue":l[4]||(l[4]=w=>h.account_mobile=w),ref:"account_mobile","prefix-icon":"ElIconUser",placeholder:s.$t("输入您的手机账号"),type:"text",size:"large",maxlength:"11",onBlur:g.onBlur,clearable:""},null,8,["modelValue","placeholder","onBlur"]),r.createVNode(k,{modelValue:h.account_password,"onUpdate:modelValue":l[5]||(l[5]=w=>h.account_password=w),ref:"account_password","prefix-icon":"ElIconLock",placeholder:s.$t("输入您的密码"),type:"password",size:"large",clearable:"",onKeydown:r.withKeys(g.accessLoginFunc,["enter"])},null,8,["modelValue","placeholder","onKeydown"]),h.codeNeed?(r.openBlock(),r.createBlock(k,{key:0,modelValue:h.captcha_code,"onUpdate:modelValue":l[7]||(l[7]=w=>h.captcha_code=w),ref:"captcha_code",class:"login-code",placeholder:s.$t("输入图形验证码"),type:"text",size:"large",clearable:""},{prefix:r.withCtx(()=>[r.createVNode(v,{type:"cvSvgCircleCheck"})]),append:r.withCtx(()=>[r.createElementVNode("div",{class:"login-code-end",onClick:l[6]||(l[6]=(...w)=>g.refreshCode&&g.refreshCode(...w))},[h.codeLoad>0?(r.openBlock(),r.createElementBlock("div",ue,[r.createVNode(C)])):h.codeUrl==="error"?(r.openBlock(),r.createElementBlock("span",ge,r.toDisplayString(s.$t("加载失败")),1)):(r.openBlock(),r.createElementBlock("img",{key:2,src:h.codeUrl},null,8,fe))])]),_:1},8,["modelValue","placeholder"])):r.createCommentVNode("",!0)]),r.createVNode(S,{type:"primary",loading:h.loadOngoing||h.loginJump,size:"large",style:{width:"100%","margin-bottom":"15px"},onClick:g.accessLoginFunc},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(h.loginJump?"登录成功":"登录"),1)]),_:1},8,["loading","onClick"]),r.createElementVNode("div",me,[r.createVNode(A,{modelValue:h.cache_privacy,"onUpdate:modelValue":l[8]||(l[8]=w=>h.cache_privacy=w),"true-value":"on","false-value":"off",onChange:g.handleRrivacy},{default:r.withCtx(()=>[l[16]||(l[16]=r.createTextVNode(" 同意 ")),r.createElementVNode("a",{href:g.openProductPrivacyUrl,target:"_blank"},"《隐私条款》",8,pe)]),_:1},8,["modelValue","onChange"]),r.createElementVNode("a",{href:"javascript:void(0)",onClick:l[9]||(l[9]=(...w)=>g.handleForgot&&g.handleForgot(...w))},r.toDisplayString(s.$t("忘记密码了?")),1)]),r.createElementVNode("div",_e,[s.systemConfig.open_business_reg=="on"?(r.openBlock(),r.createElementBlock("div",ve,[r.createTextVNode(r.toDisplayString(s.$t("还没有帐号?"))+" ",1),r.createElementVNode("a",{href:"javascript:void(0)",onClick:l[10]||(l[10]=w=>g.switchLoginMode("reg"))},r.toDisplayString(s.$t("注册帐号")),1)])):r.createCommentVNode("",!0),s.systemConfig.open_business_oauth2=="on"?(r.openBlock(),r.createElementBlock("div",we,[r.createElementVNode("a",{href:"javascript:void(0)",onClick:l[11]||(l[11]=w=>g.switchLoginMode("oauth2"))},r.toDisplayString(s.$t("OAuth2授权登陆")),1)])):r.createCommentVNode("",!0)])])])):r.createCommentVNode("",!0),h.loginMode=="qrcode"?(r.openBlock(),r.createElementBlock("div",Ee,[r.createElementVNode("div",Ce,[r.createElementVNode("div",ye,[r.createVNode(E,{content:"帐号登录",placement:"left"},{default:r.withCtx(()=>[r.createElementVNode("span",{class:"login-mode-switch-icon",onClick:l[12]||(l[12]=w=>g.switchLoginMode("access"))},[r.createVNode(v,{type:"cvSvgBasePc",size:"45"})])]),_:1})])]),r.createElementVNode("div",ke,r.toDisplayString(s.$t("扫码登录")),1),r.createElementVNode("div",Le,[r.createVNode(v,{type:"cvSvgActionScan",size:"20",style:{"margin-right":"10px"}}),r.createTextVNode(" "+r.toDisplayString(s.$t(`请使用【${g.loginSystemTitle}】移动端扫描二维码`)),1)]),r.createElementVNode("div",{class:"login-qrcode",onClick:l[13]||(l[13]=(...w)=>g.scanQrcodeRefresh&&g.scanQrcodeRefresh(...w))},[r.createElementVNode("div",Te,null,512)])])):r.createCommentVNode("",!0),h.loginMode=="oauth2"?(r.openBlock(),r.createElementBlock("div",be,[r.createElementVNode("div",Se,r.toDisplayString(g.loginSystemTitle),1),r.createElementVNode("div",Ne,r.toDisplayString(s.$t("输入您的信息以创建帐户。")),1),r.createElementVNode("div",Ae,[r.createElementVNode("div",De,[r.createElementVNode("a",{href:"javascript:void(0)",onClick:l[14]||(l[14]=w=>g.switchLoginMode("access"))},r.toDisplayString(s.$t("帐号登录")),1)])])])):r.createCommentVNode("",!0)])),h.chainShowFlag?(r.openBlock(),r.createBlock(L,{key:1,modelValue:h.chainAccountList,"onUpdate:modelValue":l[15]||(l[15]=w=>h.chainAccountList=w),reselectTitle:"重新登录",onReselectFunc:g.chainReselection,onSelectFunc:g.loginBusinessCheck},null,8,["modelValue","onReselectFunc","onSelectFunc"])):r.createCommentVNode("",!0)])}const Pe=B._export_sfc(Y,[["render",Be]]);exports.default=Pe;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index-DSBKHepn.cjs"),c={},t={class:"cloud-none-wrap",style:{"background-color":"none"}};function s(d,o){return e.openBlock(),e.createElementBlock("div",t,o[0]||(o[0]=[e.createElementVNode("div",{class:"cloud-none-box"},[e.createElementVNode("div",{class:"cloud-none-code"},"没有权限"),e.createElementVNode("div",{class:"cloud-none-message"},"Not Permission")],-1)]))}const r=n._export_sfc(c,[["render",s]]);exports.default=r;
@@ -0,0 +1,18 @@
1
+ import { createElementBlock as n, openBlock as s, createElementVNode as o } from "vue";
2
+ import { _ as c } from "./index-CYEmAMQY.js";
3
+ const r = {}, t = {
4
+ class: "cloud-none-wrap",
5
+ style: { "background-color": "none" }
6
+ };
7
+ function d(l, e) {
8
+ return s(), n("div", t, e[0] || (e[0] = [
9
+ o("div", { class: "cloud-none-box" }, [
10
+ o("div", { class: "cloud-none-code" }, "没有权限"),
11
+ o("div", { class: "cloud-none-message" }, "Not Permission")
12
+ ], -1)
13
+ ]));
14
+ }
15
+ const m = /* @__PURE__ */ c(r, [["render", d]]);
16
+ export {
17
+ m as default
18
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DSBKHepn.cjs");Object.defineProperty(exports,"HttpObj",{enumerable:!0,get:()=>e.HttpObj});exports.SameFrame=e.console;exports.SameRouteView=e.SameRouteView;exports.SameWatermark=e.SameWatermark;exports.StorageObj=e.StorageObj;exports.qiankunRouteParse=e.qiankunRouteParse;exports.qiankunWindow=e.qiankunWindow;exports.sdkBootstrap=e.sdkBootstrap;exports.sdkConfigGet=e.sdkConfigGet;exports.sdkConfigSet=e.sdkConfigSet;exports.sdkStartBefore=e.sdkStartBefore;exports.sdkStarup=e.sdkStarup;exports.useSdkAccountStore=e.useSdkAccountStore;exports.useSdkLanguageStore=e.useSdkLanguageStore;exports.useSdkPermissionStore=e.useSdkPermissionStore;exports.useSdkProductStore=e.useSdkProductStore;exports.useSdkQiankunStore=e.useSdkQiankunStore;exports.useSdkSystemStore=e.useSdkSystemStore;exports.useSdkThemesStore=e.useSdkThemesStore;exports.useSdkWindowStore=e.useSdkWindowStore;
@@ -0,0 +1,23 @@
1
+ import { H as e, f as t, S, g as o, m as r, h as k, q as u, p as d, e as n, d as i, n as m, o as g, b as f, u as p, l as c, k as b, i as j, c as q, a as w, j as P } from "./index-CYEmAMQY.js";
2
+ export {
3
+ e as HttpObj,
4
+ t as SameFrame,
5
+ S as SameRouteView,
6
+ o as SameWatermark,
7
+ r as StorageObj,
8
+ k as qiankunRouteParse,
9
+ u as qiankunWindow,
10
+ d as sdkBootstrap,
11
+ n as sdkConfigGet,
12
+ i as sdkConfigSet,
13
+ m as sdkStartBefore,
14
+ g as sdkStarup,
15
+ f as useSdkAccountStore,
16
+ p as useSdkLanguageStore,
17
+ c as useSdkPermissionStore,
18
+ b as useSdkProductStore,
19
+ j as useSdkQiankunStore,
20
+ q as useSdkSystemStore,
21
+ w as useSdkThemesStore,
22
+ P as useSdkWindowStore
23
+ };
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@10yun/open-sdk",
3
+ "version": "0.3.89",
4
+ "version2": "0.2.1",
5
+ "description": "开放平台接入sdk",
6
+ "author": "10yun.com",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "十云",
10
+ "10yun",
11
+ "https://www.10yun.com",
12
+ "https://cvjs.cn",
13
+ "helper",
14
+ "utils",
15
+ "javascript",
16
+ "vite打包"
17
+ ],
18
+ "publishConfig": {
19
+ "registry": "https://registry.npmjs.org/"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "https://gitee.com/open10/open-sdk"
24
+ },
25
+ "bugs": {
26
+ "url": "https://gitee.com/open10/open-sdk/issues"
27
+ },
28
+ "homepage": "https://gitee.com/open10/open-sdk",
29
+ "type": "module",
30
+ "main": "./dist/open-sdk.umd.js",
31
+ "module": "./dist/open-sdk.es.js",
32
+ "types": "./dist/index.d.ts",
33
+ "files": [
34
+ "common",
35
+ "dist",
36
+ "app-config.js",
37
+ "vite-plugin-qiankun",
38
+ "vite-plugin-shiyun.js"
39
+ ],
40
+ "scripts": {
41
+ "build": "vite build"
42
+ },
43
+ "dependencies": {
44
+ "cheerio": "^1.0.0"
45
+ },
46
+ "devDependencies": {
47
+ "@vitejs/plugin-vue": "^5.2.3"
48
+ },
49
+ "peerDependencies": {}
50
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 TMQ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,17 @@
1
+ export interface QiankunProps {
2
+ container?: HTMLElement;
3
+ [x: string]: any;
4
+ }
5
+ export declare type QiankunLifeCycle = {
6
+ bootstrap: () => void | Promise<void>;
7
+ mount: (props: QiankunProps) => void | Promise<void>;
8
+ unmount: (props: QiankunProps) => void | Promise<void>;
9
+ update: (props: QiankunProps) => void | Promise<void>;
10
+ };
11
+ export interface QiankunWindow {
12
+ __POWERED_BY_QIANKUN__?: boolean;
13
+ [x: string]: any;
14
+ }
15
+ export declare const qiankunWindow: QiankunWindow;
16
+ export declare const renderWithQiankun: (qiankunLifeCycle: QiankunLifeCycle) => void;
17
+ export default renderWithQiankun;
@@ -0,0 +1,25 @@
1
+ /*!
2
+ * vite-plugin-qiankun.js v1.0.14
3
+ * (c) 2021-2022 Teng Mao Qing
4
+ * Released under the MIT License.
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var qiankunWindow = typeof window !== 'undefined' ? (window.proxy || window) : {};
11
+ var renderWithQiankun = function (qiankunLifeCycle) {
12
+ // 函数只有一次执行机会,需要把生命周期赋值给全局
13
+ if (qiankunWindow === null || qiankunWindow === void 0 ? void 0 : qiankunWindow.__POWERED_BY_QIANKUN__) {
14
+ if (!window.moudleQiankunAppLifeCycles) {
15
+ window.moudleQiankunAppLifeCycles = {};
16
+ }
17
+ if (qiankunWindow.qiankunName) {
18
+ window.moudleQiankunAppLifeCycles[qiankunWindow.qiankunName] = qiankunLifeCycle;
19
+ }
20
+ }
21
+ };
22
+
23
+ exports.default = renderWithQiankun;
24
+ exports.qiankunWindow = qiankunWindow;
25
+ exports.renderWithQiankun = renderWithQiankun;
@@ -0,0 +1,7 @@
1
+ import { PluginOption } from 'vite';
2
+ export declare type MicroOption = {
3
+ useDevMode?: boolean;
4
+ };
5
+ declare type PluginFn = (qiankunName: string, microOption?: MicroOption) => PluginOption;
6
+ declare const htmlPlugin: PluginFn;
7
+ export default htmlPlugin;
@@ -0,0 +1,109 @@
1
+ /*!
2
+ * vite-plugin-qiankun.js v1.0.14
3
+ * (c) 2021-2022 Teng Mao Qing
4
+ * Released under the MIT License.
5
+ */
6
+ 'use strict';
7
+
8
+ var cheerio = require('cheerio');
9
+
10
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
+
12
+ var cheerio__default = /*#__PURE__*/_interopDefaultLegacy(cheerio);
13
+
14
+ /*! *****************************************************************************
15
+ Copyright (c) Microsoft Corporation.
16
+
17
+ Permission to use, copy, modify, and/or distribute this software for any
18
+ purpose with or without fee is hereby granted.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
21
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
23
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
24
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26
+ PERFORMANCE OF THIS SOFTWARE.
27
+ ***************************************************************************** */
28
+
29
+ function __spreadArray(to, from) {
30
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
31
+ to[j] = from[i];
32
+ return to;
33
+ }
34
+
35
+ var createQiankunHelper = function (qiankunName) { return "\n const createDeffer = (hookName) => {\n const d = new Promise((resolve, reject) => {\n window.proxy && (window.proxy[`vite${hookName}`] = resolve)\n })\n return props => d.then(fn => fn(props));\n }\n const bootstrap = createDeffer('bootstrap');\n const mount = createDeffer('mount');\n const unmount = createDeffer('unmount');\n const update = createDeffer('update');\n\n ;(global => {\n global.qiankunName = '" + qiankunName + "';\n global['" + qiankunName + "'] = {\n bootstrap,\n mount,\n unmount,\n update\n };\n })(window);\n"; };
36
+ var createImportFinallyResolve = function (qiankunName) {
37
+ return "\n const qiankunLifeCycle = window.moudleQiankunAppLifeCycles && window.moudleQiankunAppLifeCycles['" + qiankunName + "'];\n if (qiankunLifeCycle) {\n window.proxy.vitemount((props) => qiankunLifeCycle.mount(props));\n window.proxy.viteunmount((props) => qiankunLifeCycle.unmount(props));\n window.proxy.vitebootstrap(() => qiankunLifeCycle.bootstrap());\n window.proxy.viteupdate((props) => qiankunLifeCycle.update(props));\n }\n ";
38
+ };
39
+ var htmlPlugin = function (qiankunName, microOption) {
40
+ if (microOption === void 0) { microOption = {}; }
41
+ var isProduction;
42
+ var base = '';
43
+ var module2DynamicImport = function ($, scriptTag) {
44
+ if (!scriptTag) {
45
+ return;
46
+ }
47
+ var script$ = $(scriptTag);
48
+ var moduleSrc = script$.attr('src');
49
+ var appendBase = '';
50
+ if (microOption.useDevMode && !isProduction) {
51
+ appendBase = '(window.proxy ? (window.proxy.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ + \'..\') : \'\') + ';
52
+ }
53
+ script$.removeAttr('src');
54
+ script$.removeAttr('type');
55
+ script$.html("import(" + appendBase + "'" + moduleSrc + "')");
56
+ return script$;
57
+ };
58
+ return {
59
+ name: 'qiankun-html-transform',
60
+ configResolved: function (config) {
61
+ isProduction = config.command === 'build' || config.isProduction;
62
+ base = config.base;
63
+ },
64
+ configureServer: function (server) {
65
+ return function () {
66
+ server.middlewares.use(function (req, res, next) {
67
+ if (isProduction || !microOption.useDevMode) {
68
+ next();
69
+ return;
70
+ }
71
+ var end = res.end.bind(res);
72
+ res.end = function () {
73
+ var args = [];
74
+ for (var _i = 0; _i < arguments.length; _i++) {
75
+ args[_i] = arguments[_i];
76
+ }
77
+ var htmlStr = args[0], rest = args.slice(1);
78
+ if (typeof htmlStr === 'string') {
79
+ var $ = cheerio__default['default'].load(htmlStr);
80
+ module2DynamicImport($, $("script[src=" + base + "@vite/client]").get(0));
81
+ htmlStr = $.html();
82
+ }
83
+ end.apply(void 0, __spreadArray([htmlStr], rest));
84
+ };
85
+ next();
86
+ });
87
+ };
88
+ },
89
+ transformIndexHtml: function (html) {
90
+ var $ = cheerio__default['default'].load(html);
91
+ var moduleTags = $('body script[type=module], head script[crossorigin=""]');
92
+ if (!moduleTags || !moduleTags.length) {
93
+ return;
94
+ }
95
+ var len = moduleTags.length;
96
+ moduleTags.each(function (i, moduleTag) {
97
+ var script$ = module2DynamicImport($, moduleTag);
98
+ if (len - 1 === i) {
99
+ script$ === null || script$ === void 0 ? void 0 : script$.html(script$.html() + ".finally(() => {\n " + createImportFinallyResolve(qiankunName) + "\n })");
100
+ }
101
+ });
102
+ $('body').append("<script>" + createQiankunHelper(qiankunName) + "</script>");
103
+ var output = $.html();
104
+ return output;
105
+ }
106
+ };
107
+ };
108
+
109
+ module.exports = htmlPlugin;
@@ -0,0 +1,17 @@
1
+ export interface QiankunProps {
2
+ container?: HTMLElement;
3
+ [x: string]: any;
4
+ }
5
+ export declare type QiankunLifeCycle = {
6
+ bootstrap: () => void | Promise<void>;
7
+ mount: (props: QiankunProps) => void | Promise<void>;
8
+ unmount: (props: QiankunProps) => void | Promise<void>;
9
+ update: (props: QiankunProps) => void | Promise<void>;
10
+ };
11
+ export interface QiankunWindow {
12
+ __POWERED_BY_QIANKUN__?: boolean;
13
+ [x: string]: any;
14
+ }
15
+ export declare const qiankunWindow: QiankunWindow;
16
+ export declare const renderWithQiankun: (qiankunLifeCycle: QiankunLifeCycle) => void;
17
+ export default renderWithQiankun;
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * vite-plugin-qiankun.js v1.0.14
3
+ * (c) 2021-2022 Teng Mao Qing
4
+ * Released under the MIT License.
5
+ */
6
+ var qiankunWindow = typeof window !== 'undefined' ? window.proxy || window : {};
7
+ var renderWithQiankun = function (qiankunLifeCycle) {
8
+ // 函数只有一次执行机会,需要把生命周期赋值给全局
9
+ if (qiankunWindow === null || qiankunWindow === void 0 ? void 0 : qiankunWindow.__POWERED_BY_QIANKUN__) {
10
+ if (!window.moudleQiankunAppLifeCycles) {
11
+ window.moudleQiankunAppLifeCycles = {};
12
+ }
13
+ if (qiankunWindow.qiankunName) {
14
+ window.moudleQiankunAppLifeCycles[qiankunWindow.qiankunName] = qiankunLifeCycle;
15
+ }
16
+ }
17
+ };
18
+
19
+ export default renderWithQiankun;
20
+ export { qiankunWindow, renderWithQiankun };
@@ -0,0 +1,7 @@
1
+ import { PluginOption } from 'vite';
2
+ export declare type MicroOption = {
3
+ useDevMode?: boolean;
4
+ };
5
+ declare type PluginFn = (qiankunName: string, microOption?: MicroOption) => PluginOption;
6
+ declare const htmlPlugin: PluginFn;
7
+ export default htmlPlugin;
@@ -0,0 +1,122 @@
1
+ /*!
2
+ * vite-plugin-qiankun.js v1.0.14
3
+ * (c) 2021-2022 Teng Mao Qing
4
+ * Released under the MIT License.
5
+ */
6
+ // import cheerio from 'cheerio';
7
+ import * as cheerio from 'cheerio';
8
+
9
+ /*! *****************************************************************************
10
+ Copyright (c) Microsoft Corporation.
11
+
12
+ Permission to use, copy, modify, and/or distribute this software for any
13
+ purpose with or without fee is hereby granted.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
16
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
17
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
18
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
19
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
20
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
21
+ PERFORMANCE OF THIS SOFTWARE.
22
+ ***************************************************************************** */
23
+
24
+ function __spreadArray(to, from) {
25
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
26
+ return to;
27
+ }
28
+
29
+ var createQiankunHelper = function (qiankunName) {
30
+ return (
31
+ "\n const createDeffer = (hookName) => {\n const d = new Promise((resolve, reject) => {\n window.proxy && (window.proxy[`vite${hookName}`] = resolve)\n })\n return props => d.then(fn => fn(props));\n }\n const bootstrap = createDeffer('bootstrap');\n const mount = createDeffer('mount');\n const unmount = createDeffer('unmount');\n const update = createDeffer('update');\n\n ;(global => {\n global.qiankunName = '" +
32
+ qiankunName +
33
+ "';\n global['" +
34
+ qiankunName +
35
+ "'] = {\n bootstrap,\n mount,\n unmount,\n update\n };\n })(window);\n"
36
+ );
37
+ };
38
+ var createImportFinallyResolve = function (qiankunName) {
39
+ return (
40
+ "\n const qiankunLifeCycle = window.moudleQiankunAppLifeCycles && window.moudleQiankunAppLifeCycles['" +
41
+ qiankunName +
42
+ "'];\n if (qiankunLifeCycle) {\n window.proxy.vitemount((props) => qiankunLifeCycle.mount(props));\n window.proxy.viteunmount((props) => qiankunLifeCycle.unmount(props));\n window.proxy.vitebootstrap(() => qiankunLifeCycle.bootstrap());\n window.proxy.viteupdate((props) => qiankunLifeCycle.update(props));\n }\n "
43
+ );
44
+ };
45
+ var htmlPlugin = function (qiankunName, microOption) {
46
+ if (microOption === void 0) {
47
+ microOption = {};
48
+ }
49
+ var isProduction;
50
+ var base = '';
51
+ var module2DynamicImport = function ($, scriptTag) {
52
+ if (!scriptTag) {
53
+ return;
54
+ }
55
+ var script$ = $(scriptTag);
56
+ var moduleSrc = script$.attr('src');
57
+ var appendBase = '';
58
+ if (microOption.useDevMode && !isProduction) {
59
+ appendBase = "(window.proxy ? (window.proxy.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ + '..') : '') + ";
60
+ }
61
+ script$.removeAttr('src');
62
+ script$.removeAttr('type');
63
+ script$.html('import(' + appendBase + "'" + moduleSrc + "')");
64
+ return script$;
65
+ };
66
+ return {
67
+ name: 'qiankun-html-transform',
68
+ configResolved: function (config) {
69
+ isProduction = config.command === 'build' || config.isProduction;
70
+ base = config.base;
71
+ },
72
+ configureServer: function (server) {
73
+ return function () {
74
+ server.middlewares.use(function (req, res, next) {
75
+ if (isProduction || !microOption.useDevMode) {
76
+ next();
77
+ return;
78
+ }
79
+ var end = res.end.bind(res);
80
+ res.end = function () {
81
+ var args = [];
82
+ for (var _i = 0; _i < arguments.length; _i++) {
83
+ args[_i] = arguments[_i];
84
+ }
85
+ var htmlStr = args[0],
86
+ rest = args.slice(1);
87
+ if (typeof htmlStr === 'string') {
88
+ var $ = cheerio.load(htmlStr);
89
+ module2DynamicImport($, $('script[src=' + base + '@vite/client]').get(0));
90
+ htmlStr = $.html();
91
+ }
92
+ end.apply(void 0, __spreadArray([htmlStr], rest));
93
+ };
94
+ next();
95
+ });
96
+ };
97
+ },
98
+ transformIndexHtml: function (html) {
99
+ var $ = cheerio.load(html);
100
+ var moduleTags = $('body script[type=module], head script[crossorigin=""]');
101
+ if (!moduleTags || !moduleTags.length) {
102
+ return;
103
+ }
104
+ var len = moduleTags.length;
105
+ moduleTags.each(function (i, moduleTag) {
106
+ var script$ = module2DynamicImport($, moduleTag);
107
+ if (len - 1 === i) {
108
+ script$ === null || script$ === void 0
109
+ ? void 0
110
+ : script$.html(
111
+ script$.html() + '.finally(() => {\n ' + createImportFinallyResolve(qiankunName) + '\n })'
112
+ );
113
+ }
114
+ });
115
+ $('body').append('<script>' + createQiankunHelper(qiankunName) + '</script>');
116
+ var output = $.html();
117
+ return output;
118
+ }
119
+ };
120
+ };
121
+
122
+ export default htmlPlugin;
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "vite-plugin-qiankun",
3
+ "version": "1.0.15",
4
+ "description": "vite for qiankun",
5
+ "module": "es/index.js",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "rollup -c scripts/rollup.config.js",
10
+ "example:install": "cd example/main && npm install && cd ../viteapp && npm install && cd ../vue && npm install && cd ../react18 && npm install && cd ../vue3sub && npm install",
11
+ "example:start": "npm run build && cd example/viteapp && npm run build && cd ../../ && npm-run-all --parallel start:main start:viteapp start:vue start:react18dev start:vue3sub",
12
+ "example:start-vite-dev": "npm run build && npm-run-all --parallel start:main start:vitedev start:vue start:react18dev start:vue3sub",
13
+ "start:main": "cd example/main && npm run start",
14
+ "start:viteapp": "cd example/viteapp && npm run start",
15
+ "start:vitedev": "cd example/viteapp && npm run dev",
16
+ "start:react18dev": "cd example/react18 && npm run dev",
17
+ "start:vue3sub": "cd example/vue3sub && npm run dev",
18
+ "start:vue": "cd example/vue && npm run start",
19
+ "vite:test": "npm run build && cd example/viteapp && npm run dev"
20
+ },
21
+ "keywords": [
22
+ "qiankun",
23
+ "vite",
24
+ "esm",
25
+ "esModule"
26
+ ],
27
+ "files": [
28
+ "dist",
29
+ "es"
30
+ ],
31
+ "homepage": "https://github.com/tengmaoqing/vite-plugin-qiankun",
32
+ "author": "markteng",
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "cheerio": "^1.0.0-rc.10"
36
+ },
37
+ "devDependencies": {
38
+ "@types/jsdom": "^16.2.10",
39
+ "@typescript-eslint/eslint-plugin": "^4.29.1",
40
+ "@typescript-eslint/parser": "^4.29.1",
41
+ "eslint": "^7.32.0",
42
+ "eslint-config-standard": "^16.0.3",
43
+ "eslint-plugin-import": "^2.24.0",
44
+ "eslint-plugin-node": "^11.1.0",
45
+ "eslint-plugin-promise": "^5.1.0",
46
+ "npm-run-all": "^4.1.5",
47
+ "rollup": "^2.73.0",
48
+ "rollup-plugin-typescript2": "^0.30.0",
49
+ "typescript": "^4.6.4",
50
+ "vite": "^2.9.9"
51
+ },
52
+ "peerDependencies": {
53
+ "typescript": ">=4",
54
+ "vite": ">=2"
55
+ }
56
+ }