UNPKG

fa-toolkit

Version:

a devtool for fast app

1 lines 14.9 kB
"use strict";var _0x2cf4f6=_0x1266;function _typeof(r){var e=_0x1266;return(_typeof=e(215)==typeof Symbol&&e(295)==typeof Symbol[e(323)]?function(r){return typeof r}:function(r){var t=e;return r&&t(215)==typeof Symbol&&r[t(319)]===Symbol&&r!==Symbol[t(217)]?t(295):typeof r})(r)}function _createForOfIteratorHelper(r,t){var e=_0x1266,n=typeof Symbol!==e(288)&&r[Symbol[e(323)]]||r[e(218)];if(!n){if(Array[e(260)](r)||(n=_unsupportedIterableToArray(r))||t&&r&&"number"==typeof r[e(352)]){n&&(r=n);var o=0,t=function(){};return{s:t,n:function(){return o>=r[e(352)]?{done:!0}:{done:!1,value:r[o++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n[e(273)](r)},n:function(){var r=e,t=n[r(315)]();return a=t[r(308)],t},e:function(r){c=!0,i=r},f:function(){var r=e;try{a||null==n.return||n[r(285)]()}finally{if(c)throw i}}}}function _unsupportedIterableToArray(r,t){var e=_0x1266;if(r){if("string"==typeof r)return _arrayLikeToArray(r,t);var n=Object.prototype[e(292)].call(r).slice(8,-1);return(n=n===e(230)&&r[e(319)]?r[e(319)][e(340)]:n)===e(306)||"Set"===n?Array[e(301)](r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/[e(253)](n)?_arrayLikeToArray(r,t):void 0}}function _arrayLikeToArray(r,t){var e=_0x1266;(null==t||t>r[e(352)])&&(t=r[e(352)]);for(var n=0,o=new Array(t);n<t;n++)o[n]=r[n];return o}function _regeneratorRuntime(){var f=_0x1266;_regeneratorRuntime=function(){return c};var c={},r=Object[f(217)],s=r[f(265)],l=Object[f(322)]||function(r,t,e){r[t]=e[f(280)]},t=f(215)==typeof Symbol?Symbol:{},i=t[f(323)]||f(218),e=t.asyncIterator||f(346),n=t[f(266)]||f(287);function o(r,t,e){return Object[f(322)](r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{o({},"")}catch(r){o=function(r,t,e){return r[t]=e}}function u(r,t,e,n){var i,a,c,u,s,o=f,t=t&&t[o(217)]instanceof v?t:v,t=Object[o(231)](t.prototype),n=new w(n||[]);return l(t,o(262),{value:(i=r,a=e,c=n,s=(u=f)(219),function(r,t){var e=u;if("executing"===s)throw new Error(e(300));if("completed"===s){if("throw"===r)throw t;return F()}for(c.method=r,c[e(316)]=t;;){var n=c[e(350)];if(n){var o=function r(t,e){var n=f,o=e.method,i=t[n(323)][o];if(void 0===i)return e[n(350)]=null,"throw"===o&&t[n(323)][n(285)]&&(e[n(349)]="return",e[n(316)]=void 0,r(t,e),n(332)===e[n(349)])||"return"!==o&&(e[n(349)]="throw",e[n(316)]=new TypeError("The iterator does not provide a '"+o+"' method")),p;i=h(i,t[n(323)],e[n(316)]);if(n(332)===i[n(279)])return e[n(349)]=n(332),e[n(316)]=i.arg,e[n(350)]=null,p;var i=i.arg;return i?i[n(308)]?(e[t[n(223)]]=i[n(280)],e.next=t[n(241)],n(285)!==e[n(349)]&&(e[n(349)]=n(315),e[n(316)]=void 0),e[n(350)]=null,p):i:(e[n(349)]=n(332),e[n(316)]=new TypeError(n(257)),e[n(350)]=null,p)}(n,c);if(o){if(o===p)continue;return o}}if(e(315)===c.method)c[e(246)]=c[e(318)]=c[e(316)];else if("throw"===c[e(349)]){if(e(219)===s)throw s=e(281),c[e(316)];c[e(324)](c[e(316)])}else"return"===c.method&&c.abrupt(e(285),c[e(316)]);s="executing";o=h(i,a,c);if("normal"===o.type){if(s=c[e(308)]?e(281):e(249),o[e(316)]===p)continue;return{value:o.arg,done:c[e(308)]}}"throw"===o[e(279)]&&(s=e(281),c[e(349)]=e(332),c[e(316)]=o[e(316)])}})}),t}function h(r,t,e){var n=f;try{return{type:n(293),arg:r[n(273)](t,e)}}catch(r){return{type:n(332),arg:r}}}c[f(278)]=u;var p={};function v(){}function a(){}function _(){}var y={};o(y,i,function(){return this});t=Object.getPrototypeOf,t=t&&t(t(k([])));t&&t!==r&&s[f(273)](t,i)&&(y=t);var d=_[f(217)]=v[f(217)]=Object.create(y);function x(r){var t=f;[t(315),"throw",t(285)][t(313)](function(t){o(r,t,function(r){return this[_0x1266(262)](t,r)})})}function m(c,u){var t,o=f;l(this,o(262),{value:function(e,n){function r(){return new u(function(r,t){!function t(r,e,n,o){var i=_0x1266,r=h(c[r],c,e);if(i(332)!==r[i(279)]){var a=r.arg,e=a[i(280)];return e&&i(276)==_typeof(e)&&s[i(273)](e,"__await")?u[i(296)](e[i(302)])[i(270)](function(r){t(i(315),r,n,o)},function(r){t(i(332),r,n,o)}):u[i(296)](e)[i(270)](function(r){a[i(280)]=r,n(a)},function(r){return t(i(332),r,n,o)})}o(r[i(316)])}(e,n,r,t)})}return t=t?t[o(270)](r,r):r()}})}function b(r){var t=f,e={tryLoc:r[0]};1 in r&&(e[t(291)]=r[1]),2 in r&&(e[t(248)]=r[2],e[t(221)]=r[3]),this[t(298)].push(e)}function g(r){var t=f,e=r[t(335)]||{};e[t(279)]=t(293),delete e[t(316)],r[t(335)]=e}function w(r){var t=f;this.tryEntries=[{tryLoc:t(255)}],r[t(313)](b,this),this[t(222)](!0)}function k(e){var n=f;if(e){var r=e[i];if(r)return r[n(273)](e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,r=function r(){for(var t=n;++o<e[t(352)];)if(s[t(273)](e,o))return r.value=e[o],r[t(308)]=!1,r;return r[t(280)]=void 0,r.done=!0,r};return r[n(315)]=r}}return{next:F}}function F(){return{value:void 0,done:!0}}return a[f(217)]=_,l(d,f(319),{value:_,configurable:!0}),l(_,f(319),{value:a,configurable:!0}),a[f(320)]=o(_,n,"GeneratorFunction"),c.isGeneratorFunction=function(r){var t=f,r="function"==typeof r&&r.constructor;return!!r&&(r===a||t(342)===(r[t(320)]||r[t(340)]))},c.mark=function(r){var t=f;return Object.setPrototypeOf?Object[t(333)](r,_):(r[t(244)]=_,o(r,n,"GeneratorFunction")),r[t(217)]=Object.create(d),r},c[f(271)]=function(r){return{__await:r}},x(m[f(217)]),o(m[f(217)],e,function(){return this}),c[f(353)]=m,c[f(311)]=function(r,t,e,n,o){var i=f;void 0===o&&(o=Promise);var a=new m(u(r,t,e,n),o);return c[i(344)](t)?a:a[i(315)]()[i(270)](function(r){var t=i;return r[t(308)]?r[t(280)]:a[t(315)]()})},x(d),o(d,n,f(268)),o(d,i,function(){return this}),o(d,f(292),function(){return f(240)}),c[f(317)]=function(r){var t,n=f,o=Object(r),i=[];for(t in o)i[n(341)](t);return i.reverse(),function r(){for(var t=n;i[t(352)];){var e=i[t(354)]();if(e in o)return r[t(280)]=e,r[t(308)]=!1,r}return r[t(308)]=!0,r}},c[f(304)]=k,w.prototype={constructor:w,reset:function(r){var t=f;if(this[t(245)]=0,this[t(315)]=0,this[t(246)]=this[t(318)]=void 0,this[t(308)]=!1,this.delegate=null,this[t(349)]=t(315),this.arg=void 0,this.tryEntries.forEach(g),!r)for(var e in this)"t"===e[t(220)](0)&&s.call(this,e)&&!isNaN(+e[t(297)](1))&&(this[e]=void 0)},stop:function(){var r=f;this.done=!0;var t=this.tryEntries[0][r(335)];if(r(332)===t.type)throw t.arg;return this[r(355)]},dispatchException:function(n){var r=f;if(this.done)throw n;var o=this;function t(r,t){var e=_0x1266;return a[e(279)]=e(332),a[e(316)]=n,o[e(315)]=r,t&&(o.method=e(315),o[e(316)]=void 0),!!t}for(var e=this[r(298)].length-1;0<=e;--e){var i=this.tryEntries[e],a=i[r(335)];if("root"===i[r(263)])return t(r(226));if(i[r(263)]<=this[r(245)]){var c=s[r(273)](i,r(291)),u=s[r(273)](i,r(248));if(c&&u){if(this.prev<i[r(291)])return t(i.catchLoc,!0);if(this[r(245)]<i.finallyLoc)return t(i[r(248)])}else if(c){if(this.prev<i[r(291)])return t(i[r(291)],!0)}else{if(!u)throw new Error(r(239));if(this[r(245)]<i[r(248)])return t(i[r(248)])}}}},abrupt:function(r,t){for(var e=f,n=this[e(298)][e(352)]-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this[e(245)]&&s[e(273)](o,"finallyLoc")&&this[e(245)]<o[e(248)]){var i=o;break}}var a=(i=i&&(e(309)===r||e(233)===r)&&i[e(263)]<=t&&t<=i[e(248)]?null:i)?i[e(335)]:{};return a[e(279)]=r,a[e(316)]=t,i?(this.method="next",this[e(315)]=i.finallyLoc,p):this[e(328)](a)},complete:function(r,t){var e=f;if(e(332)===r.type)throw r.arg;return e(309)===r.type||e(233)===r[e(279)]?this[e(315)]=r[e(316)]:e(285)===r[e(279)]?(this[e(355)]=this[e(316)]=r[e(316)],this[e(349)]=e(285),this[e(315)]=e(226)):e(293)===r.type&&t&&(this[e(315)]=t),p},finish:function(r){for(var t=f,e=this[t(298)].length-1;0<=e;--e){var n=this[t(298)][e];if(n[t(248)]===r)return this[t(328)](n.completion,n.afterLoc),g(n),p}},catch:function(r){for(var t=f,e=this[t(298)].length-1;0<=e;--e){var n=this[t(298)][e];if(n[t(263)]===r){var o,i=n[t(335)];return t(332)===i.type&&(o=i[t(316)],g(n)),o}}throw new Error(t(310))},delegateYield:function(r,t,e){var n=f;return this[n(350)]={iterator:k(r),resultName:t,nextLoc:e},n(315)===this[n(349)]&&(this[n(316)]=void 0),p}},c}function _0x2d1c(){var r=["AsyncIterator","pop","rval","function","isDirectory","prototype","@@iterator","suspendedStart","charAt","afterLoc","reset","resultName",".js","mark","end","8097921uBkrlm","existsSync","2563mOqPrd","Object","create","includes","continue","warnings","../common/utils","log","extname","mkdirSync","try statement without catch or finally","[object Generator]","nextLoc","readdirSync",".styl","__proto__","prev","sent","30pBLmMA","finallyLoc","suspendedYield","options","arch","shift","test","toLowerCase","root",".vue","iterator result is not an object","build","basename","isArray","ResourcePlugin","_invoke","tryLoc","26408628saxEfM","hasOwnProperty","toStringTag","../common/icon-handler","Generator","join","then","awrap","4085668asFuRa","call",".scss","src","object","apply","wrap","type","value","completed",".DS_Store","statSync","icon","return","isFile","@@toStringTag","undefined","1019892fYirFL","2337974sEnpUa","catchLoc","toString","normal",".md","symbol","resolve","slice","tryEntries","8GXXRMm","Generator is already running","from","__await","exports","values","stop","Map","emit","done","break","illegal catch attempt","async","sep","forEach","24730xUEGsK","next","arg","keys","_sent","constructor","displayName","tapAsync","defineProperty","iterator","dispatchException",".tsx","5wlsdLt",".coffee","complete","WARNING: Failed to copy the file: ","aaptExecutor","concat","throw","setPrototypeOf","3McBAqs","completion","6447nQuwRn","copyFileSync",".wux","addWatermark","name","push","GeneratorFunction","WARNING: File type '.9.png' is not supported on current cpu architecture: ","isGeneratorFunction",".json","@@asyncIterator","catch","size","method","delegate","hooks","length"];return(_0x2d1c=function(){return r})()}function asyncGeneratorStep(r,t,e,n,o,i,a){var c=_0x1266;try{var u=r[i](a),s=u[c(280)]}catch(r){return void e(r)}u[c(308)]?t(s):Promise[c(296)](s)[c(270)](n,o)}function _0x1266(r,t){var e=_0x2d1c();return(_0x1266=function(r,t){return e[r-=215]})(r,t)}function _asyncToGenerator(u){return function(){var r=this,c=arguments;return new Promise(function(t,e){var n=_0x1266,o=u[n(277)](r,c);function i(r){asyncGeneratorStep(o,t,e,i,a,n(315),r)}function a(r){asyncGeneratorStep(o,t,e,i,a,"throw",r)}i(void 0)})}}!function(){for(var r=_0x1266,t=_0x2d1c();;)try{if(681412==+parseInt(r(289))+parseInt(r(290))/2*(parseInt(r(334))/3)+-parseInt(r(272))/4*(-parseInt(r(326))/5)+-parseInt(r(247))/6*(parseInt(r(336))/7)+-parseInt(r(299))/8*(parseInt(r(227))/9)+-parseInt(r(314))/10*(-parseInt(r(229))/11)+-parseInt(r(264))/12)break;t.push(t.shift())}catch(r){t.push(t.shift())}}();var iconPath,_fs=require("fs"),_path=require("path"),utils=require(_0x2cf4f6(235)),FILE_EXT_NAME=[".ux",_0x2cf4f6(338),".mix",_0x2cf4f6(224),".css",".jsx",_0x2cf4f6(327),".ts",_0x2cf4f6(325),_0x2cf4f6(256),".less",".sass",_0x2cf4f6(274),_0x2cf4f6(243),".html",_0x2cf4f6(294),_0x2cf4f6(282)],dot9PngRegx=/.+\.9\.png$/,ARCH_RE=/^x(?=64|32)/,JSON_EXTNAME=_0x2cf4f6(345),isServer=!ARCH_RE[_0x2cf4f6(253)](process[_0x2cf4f6(251)]),declaredCards=[];function dot9PngHandler(r,t,e){var n=_0x2cf4f6;dot9PngRegx[n(253)](t)&&r[n(234)][n(341)]({message:n(343)+"'"[n(331)](process.arch,"'.\n @ ")[n(331)](e)})}function shouldCopyFile(r,t){var e=_0x2cf4f6;return!FILE_EXT_NAME.includes(r)&&e(282)!==t}function copyFile(r,t){return _copyFile[_0x2cf4f6(277)](this,arguments)}function _copyFile(){var r=_0x2cf4f6;return(_copyFile=_asyncToGenerator(_regeneratorRuntime()[r(225)](function r(e,n){var o;return _regeneratorRuntime().wrap(function(r){for(var t=_0x1266;;)switch(r[t(245)]=r[t(315)]){case 0:if(!_fs.existsSync(e)){r[t(315)]=16;break}if(mkParentDir(_path.join(n,"..")),o=_path[t(259)](e).toLowerCase(),r[t(245)]=3,!isServer&&dot9PngRegx[t(253)](o))return o=require("@hw-quickapp/fa-aaptjs"),r[t(315)]=8,o[t(330)](["s","-i",e,"-o",n]);r.next=10;break;case 8:r[t(315)]=11;break;case 10:_fs[t(337)](e,n);case 11:r[t(315)]=16;break;case 13:r[t(245)]=13,r.t0=r[t(347)](3),console[t(236)](t(329)[t(331)](e));case 16:case"end":return r[t(305)]()}},r,null,[[3,13]])})))[r(277)](this,arguments)}function mkParentDir(r){var t,e=_0x2cf4f6;_fs[e(228)](r)&&_fs[e(283)](r)[e(216)]()||(t=_path[e(269)](r,".."),_fs[e(228)](t)&&!_fs.statSync(t)[e(286)]()||mkParentDir(t),_fs[e(238)](r))}function transFile(r,t,e,n){return _transFile.apply(this,arguments)}function _transFile(){var t=_0x2cf4f6;return(_transFile=_asyncToGenerator(_regeneratorRuntime()[t(225)](function r(e,n,o,i){var a,c,u,s,f,l,h,p,v,_=t;return _regeneratorRuntime()[_(278)](function(r){for(var t=_;;)switch(r.prev=r[t(315)]){case 0:a=void 0,c=_path[t(269)](n,i),h=_fs[t(242)](c),u=_createForOfIteratorHelper(h),r.prev=4,u.s();case 6:if((h=u.n()).done){r[t(315)]=40;break}if(s=h.value,f=_path[t(269)](c,s),!(l=_fs[t(283)](f))[t(286)]()){r[t(315)]=33;break}if(p=_path.basename(f)[t(254)](),h=_path[t(237)](f).toLowerCase(),isServer&&dot9PngHandler(e,p,f),!shouldCopyFile(h,p)){r[t(315)]=31;break}if(a=_path[t(269)](o,i,_path[t(259)](s)),!_fs.existsSync(a)){r.next=23;break}if((p=_fs[t(283)](a))[t(286)]()&&(p[t(348)]!==l[t(348)]||isJsonFile(f)))return r.next=21,copyFile(f,a);r[t(315)]=21;break;case 21:r[t(315)]=31;break;case 23:if("beta"===_versionType&&f===iconPath)return v=require(t(267)),v=v[t(339)],r[t(315)]=27,v(iconPath,a);r[t(315)]=29;break;case 27:r[t(315)]=31;break;case 29:return r[t(315)]=31,copyFile(f,a);case 31:r[t(315)]=38;break;case 33:if(!l[t(216)]()){r[t(315)]=38;break}if(shouldCopyDir(n,f))return v=_path[t(269)](i,s),r[t(315)]=38,transFile(e,n,o,v);r.next=38;break;case 38:r[t(315)]=6;break;case 40:r[t(315)]=45;break;case 42:r[t(245)]=42,r.t0=r[t(347)](4),u.e(r.t0);case 45:return r[t(245)]=45,u.f(),r.finish(45);case 48:case"end":return r[t(305)]()}},r,null,[[4,42,45,48]])})))[t(277)](this,arguments)}function isJsonFile(r){return _path[_0x2cf4f6(237)](r)===JSON_EXTNAME}function shouldCopyDir(r,t){return 0===declaredCards[_0x2cf4f6(352)]||isDeclaredCard(declaredCards,getRootDirName(r,t))}function isDeclaredCard(r,t){return r[_0x2cf4f6(232)](t)}function getRootDirName(r,t){var e=_0x2cf4f6;return _path.relative(r,t).split(_path[e(312)])[e(252)]()}function ResourcePlugin(r){this[_0x2cf4f6(250)]=r}ResourcePlugin.prototype[_0x2cf4f6(277)]=function(r){var e,t=_0x2cf4f6,i=this.options;iconPath=_path[t(269)](i[t(275)],i.manifest[t(284)]||""),r[t(351)][t(307)][t(321)](t(261),(e=_asyncToGenerator(_regeneratorRuntime().mark(function r(e,n){var o=_0x1266;return _regeneratorRuntime()[o(278)](function(r){for(var t=o;;)switch(r[t(245)]=r.next){case 0:return _isFlexibleCardMode&&(declaredCards=utils.getFlexibleCards()),r[t(315)]=3,transFile(e,i[t(275)],i[t(258)],"");case 3:n();case 4:case t(226):return r[t(305)]()}},r)})),function(r,t){return e.apply(this,arguments)}))},module[_0x2cf4f6(303)]=ResourcePlugin;