From e7c3a5f61d2858f5227e023ef031c307bb66e6c2 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Wed, 27 Jul 2022 03:45:15 +0800 Subject: [PATCH] feat: Make most `make` commands cross-platform (#14671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * improve * doc * fix * improve * improve * update and fix * pack dependencies * Update Makefile.mjs Co-authored-by: Nicolò Ribaudo * review * fix node6 * fix * terser Co-authored-by: Nicolò Ribaudo --- .github/workflows/ci.yml | 8 +- CONTRIBUTING.md | 4 +- Gulpfile.mjs | 35 ++- Makefile | 206 ++++++---------- Makefile.js | 3 + Makefile.source.mjs | 416 ++++++++++++++++++++++++++++++++ make.cmd | 2 + package.json | 4 +- scripts/assert-dir-git-clean.js | 12 + scripts/assert-dir-git-clean.sh | 8 - scripts/clone-license.js | 25 ++ scripts/clone-license.sh | 4 - scripts/pack-script.js | 55 +++++ scripts/set-module-type.js | 5 +- yarn.lock | 23 +- 15 files changed, 635 insertions(+), 175 deletions(-) create mode 100644 Makefile.js create mode 100644 Makefile.source.mjs create mode 100644 make.cmd create mode 100644 scripts/assert-dir-git-clean.js delete mode 100755 scripts/assert-dir-git-clean.sh create mode 100644 scripts/clone-license.js delete mode 100755 scripts/clone-license.sh create mode 100644 scripts/pack-script.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 539ce7cc321b..91fd9f174b4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,9 +114,12 @@ jobs: env: BABEL_8_BREAKING: false STRIP_BABEL_8_FLAG: true + - name: Build Makefile.js + run: | + node ./scripts/pack-script.js - name: Ensure cwd does not contain uncommitted changes run: | - ./scripts/assert-dir-git-clean.sh + node ./scripts/assert-dir-git-clean.js - uses: actions/upload-artifact@v3 with: name: babel-artifact @@ -149,9 +152,8 @@ jobs: BABEL_8_BREAKING: false STRIP_BABEL_8_FLAG: true - name: Ensure cwd does not contain uncommitted changes - shell: bash run: | - ./scripts/assert-dir-git-clean.sh + node ./scripts/assert-dir-git-clean.js lint: name: Lint diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d64fe3b599e2..499b75591580 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,8 +43,8 @@ _Yarn_: Make sure that Yarn 1 is [installed](https://classic.yarnpkg.com/en/docs _Make_: If you are running Windows 10, you'll need to do one of the following: -- Clone the repository and run the commands inside [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install-win10). -- Install [Make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm). +- Run the commands inside [WSL 2](https://docs.microsoft.com/en-us/windows/wsl/install-win10). +- Using make normally (`make` or `./make`), it will automatically call the cross-platform `Makefile.mjs`. (There may be a small part of the function not implemented.) ### Setup diff --git a/Gulpfile.mjs b/Gulpfile.mjs index b803878e6194..692509d5a2e4 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -673,24 +673,23 @@ gulp.task( ) ); -gulp.task( - "watch", - gulp.series("build-dev", function watch() { - gulp.watch(defaultSourcesGlob, gulp.task("build-no-bundle-watch")); - gulp.watch( - babelStandalonePluginConfigGlob, - gulp.task("generate-standalone") - ); - gulp.watch(buildTypingsWatchGlob, gulp.task("generate-type-helpers")); +function watch() { + gulp.watch(defaultSourcesGlob, gulp.task("build-no-bundle-watch")); + gulp.watch(babelStandalonePluginConfigGlob, gulp.task("generate-standalone")); + gulp.watch(buildTypingsWatchGlob, gulp.task("generate-type-helpers")); + gulp.watch( + "./packages/babel-helpers/src/helpers/*.js", + gulp.task("generate-runtime-helpers") + ); + if (USE_ESM) { gulp.watch( - "./packages/babel-helpers/src/helpers/*.js", - gulp.task("generate-runtime-helpers") + cjsBundles.map(({ src }) => `./${src}/lib/**.js`), + gulp.task("build-cjs-bundles") ); - if (USE_ESM) { - gulp.watch( - cjsBundles.map(({ src }) => `./${src}/lib/**.js`), - gulp.task("build-cjs-bundles") - ); - } - }) + } +} + +gulp.task( + "watch", + process.env.WATCH_SKIP_BUILD ? watch : gulp.series("build-dev", watch) ); diff --git a/Makefile b/Makefile index 85fc59a6b4f0..c145efc5211a 100644 --- a/Makefile +++ b/Makefile @@ -14,110 +14,127 @@ COMMA_SEPARATED_SOURCES = $(subst $(SPACE),$(COMMA),$(SOURCES)) YARN := yarn NODE := $(YARN) node +MAKEJS := node Makefile.js .PHONY: build build-dist watch lint fix clean test-clean test-only test test-ci publish bootstrap use-esm use-cjs -build: build-no-bundle -ifneq ("$(BABEL_COVERAGE)", "true") - $(MAKE) build-standalone -endif +build: + $(MAKEJS) build -build-bundle: clean clean-lib - node ./scripts/set-module-type.js - $(YARN) gulp build - $(MAKE) build-flow-typings - $(MAKE) build-dist +build-bundle: + $(MAKEJS) build-bundle -build-no-bundle-ci: bootstrap-only - $(YARN) gulp build-dev - $(MAKE) build-flow-typings - $(MAKE) build-dist - -build-no-bundle: clean clean-lib - node ./scripts/set-module-type.js - BABEL_ENV=development $(YARN) gulp build-dev - $(MAKE) build-flow-typings - $(MAKE) build-dist +build-no-bundle: + $(MAKEJS) build-no-bundle generate-tsconfig: - $(NODE) scripts/generators/tsconfig.js - $(NODE) scripts/generators/archived-libs-typings.js + $(MAKEJS) generate-tsconfig generate-type-helpers: - $(YARN) gulp generate-type-helpers + $(MAKEJS) generate-type-helpers build-flow-typings: - $(NODE) packages/babel-types/scripts/generators/flow.js > packages/babel-types/lib/index.js.flow + $(MAKEJS) build-flow-typings # For TypeScript older than 3.7 build-typescript-legacy-typings: - $(NODE) packages/babel-types/scripts/generators/typescript-legacy.js > packages/babel-types/lib/index-legacy.d.ts + $(MAKEJS) build-typescript-legacy-typings -build-standalone: build-babel-standalone +build-standalone: + $(MAKEJS) build-standalone build-standalone-ci: build-no-bundle-ci - $(MAKE) build-standalone - -build-babel-standalone: - $(YARN) gulp build-babel-standalone + $(MAKEJS) build-standalone prepublish-build-standalone: - BABEL_ENV=production IS_PUBLISH=true $(YARN) gulp build-babel-standalone + $(MAKEJS) prepublish-build-standalone build-dist: build-plugin-transform-runtime-dist build-plugin-transform-runtime-dist: - cd packages/babel-plugin-transform-runtime; \ - $(NODE) scripts/build-dist.js + $(MAKEJS) build-plugin-transform-runtime-dist -watch: build-no-bundle - BABEL_ENV=development $(YARN) gulp watch +watch: + $(MAKEJS) watch code-quality: tscheck lint -tscheck: generate-tsconfig - rm -rf dts - $(YARN) tsc -b . +tscheck: + $(MAKEJS) tscheck lint-ci: lint check-compat-data-ci -check-compat-data-ci: - $(MAKE) check-compat-data +check-compat-data-ci: check-compat-data lint: - BABEL_ENV=test $(YARN) eslint scripts benchmark $(SOURCES) '*.{js,cjs,mjs,ts}' --format=codeframe --ext .js,.cjs,.mjs,.ts + $(MAKEJS) lint fix: fix-json fix-js fix-js: - $(YARN) eslint scripts benchmark $(SOURCES) '*.{js,cjs,mjs,ts}' --format=codeframe --ext .js,.cjs,.mjs,.ts --fix + $(MAKEJS) fix-js fix-json: - $(YARN) prettier "{$(COMMA_SEPARATED_SOURCES)}/*/test/fixtures/**/options.json" --write --loglevel warn + $(MAKEJS) fix-json -check-compat-data: - cd packages/babel-compat-data; CHECK_COMPAT_DATA=true $(YARN) run build-data +clean: + $(MAKEJS) clean -build-compat-data: - cd packages/babel-compat-data; $(YARN) run build-data +test: lint test-only + +clone-license: + $(MAKEJS) clone-license + +prepublish-build: + $(MAKEJS) prepublish-build + +prepublish: + $(MAKEJS) prepublish -clean: test-clean - rm -f .npmrc - rm -rf coverage - rm -rf packages/*/npm-debug* - rm -rf node_modules/.cache +bootstrap-only: + $(MAKEJS) bootstrap-only -test-clean: - $(foreach source, $(SOURCES), \ - $(call clean-source-test, $(source))) +bootstrap: + $(MAKEJS) bootstrap + +use-cjs: + $(MAKEJS) use-cjs + +use-esm: + $(MAKEJS) use-esm + +clean-lib: + $(MAKEJS) clean-lib + +clean-runtime-helpers: + $(MAKEJS) clean-runtime-helpers + +clean-all: + $(MAKEJS) clean-all + + +build-no-bundle-ci: bootstrap-only + $(YARN) gulp build-dev + $(MAKE) build-flow-typings + $(MAKE) build-dist # Does not work on Windows; use "$(YARN) jest" instead test-only: BABEL_ENV=test ./scripts/test.sh $(MAKE) test-clean -test: lint test-only +check-compat-data: + cd packages/babel-compat-data; CHECK_COMPAT_DATA=true $(YARN) run build-data + +build-compat-data: + cd packages/babel-compat-data; $(YARN) run build-data + +update-env-corejs-fixture: + rm -rf packages/babel-preset-env/node_modules/core-js-compat + $(YARN) + $(MAKE) build-bundle + OVERWRITE=true $(YARN) jest packages/babel-preset-env test-ci: build-standalone-ci BABEL_ENV=test $(YARN) jest --maxWorkers=4 --ci @@ -165,24 +182,6 @@ test-test262: test-test262-update-allowlist: $(NODE) scripts/parser-tests/test262 --update-allowlist -# Does not work on Windows -clone-license: - ./scripts/clone-license.sh - -prepublish-build: clean-lib clean-runtime-helpers - NODE_ENV=production BABEL_ENV=production STRIP_BABEL_8_FLAG=true $(MAKE) build-bundle - STRIP_BABEL_8_FLAG=true $(MAKE) prepublish-build-standalone clone-license prepublish-prepare-dts - -prepublish-prepare-dts: - $(MAKE) tscheck - $(YARN) gulp bundle-dts - $(MAKE) build-typescript-legacy-typings - -prepublish: - $(MAKE) bootstrap-only - $(MAKE) prepublish-build - IS_PUBLISH=true $(MAKE) test - node ./scripts/set-module-type.js clean new-version-checklist: # @echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" @@ -221,64 +220,3 @@ endif node ./scripts/set-module-type.js clean YARN_NPM_PUBLISH_REGISTRY=http://localhost:4873 $(YARN) release-tool publish --yes --tag-version-prefix="version-e2e-test-" $(MAKE) clean - -bootstrap-only: clean-all - $(YARN) install - -bootstrap: bootstrap-only - $(MAKE) generate-tsconfig build - -use-cjs: - node ./scripts/set-module-type.js script - $(MAKE) bootstrap - -use-esm: - node ./scripts/set-module-type.js module - $(MAKE) bootstrap - -clean-lib: - $(foreach source, $(SOURCES), \ - $(call clean-source-lib, $(source))) - -clean-runtime-helpers: - rm -f packages/babel-runtime/helpers/**/*.js - rm -f packages/babel-runtime-corejs2/helpers/**/*.js - rm -f packages/babel-runtime-corejs3/helpers/**/*.js - rm -f packages/babel-runtime/helpers/**/*.mjs - rm -f packages/babel-runtime-corejs2/helpers/**/*.mjs - rm -f packages/babel-runtime-corejs3/helpers/**/*.mjs - rm -rf packages/babel-runtime-corejs2/core-js - -clean-all: - rm -rf node_modules - rm -rf package-lock.json - rm -rf .changelog - - $(foreach source, $(SOURCES), \ - $(call clean-source-all, $(source))) - - $(MAKE) clean - -update-env-corejs-fixture: - rm -rf packages/babel-preset-env/node_modules/core-js-compat - $(YARN) - $(MAKE) build-bundle - OVERWRITE=true $(YARN) jest packages/babel-preset-env - -define clean-source-lib - rm -rf $(1)/*/lib - -endef - -define clean-source-test - rm -rf $(1)/*/test/tmp - rm -rf $(1)/*/test-fixtures.json - -endef - -define clean-source-all - $(call clean-source-lib, $1) - rm -rf $(1)/*/node_modules - rm -rf $(1)/*/package-lock.json - -endef diff --git a/Makefile.js b/Makefile.js new file mode 100644 index 000000000000..c6c778fbb1f8 --- /dev/null +++ b/Makefile.js @@ -0,0 +1,3 @@ +/* eslint-disable */ + //prettier-ignore + "use strict";var e=require("os"),t=require("fs"),r=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=c(e),u=c(t),l=c(r),f=c(n),h=c(i),p=c(o),d=c(s),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},y=function(e){return e&&e.Math==Math&&e},g=y("object"==typeof globalThis&&globalThis)||y("object"==typeof window&&window)||y("object"==typeof self&&self)||y("object"==typeof v&&v)||function(){return this}()||Function("return this")(),m={},b=function(e){try{return!!e()}catch(e){return!0}},w=!b((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),E=!b((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),S=E,x=Function.prototype.call,O=S?x.bind(x):function(){return x.apply(x,arguments)},k={},j={}.propertyIsEnumerable,_=Object.getOwnPropertyDescriptor,A=_&&!j.call({1:2},1);k.f=A?function(e){var t=_(this,e);return!!t&&t.enumerable}:j;var R,I,F=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},L=E,T=Function.prototype,P=T.bind,D=T.call,C=L&&P.bind(D,D),N=L?function(e){return e&&C(e)}:function(e){return e&&function(){return D.apply(e,arguments)}},M=N,G=M({}.toString),$=M("".slice),B=function(e){return $(G(e),8,-1)},q=b,U=B,W=Object,z=N("".split),X=q((function(){return!W("z").propertyIsEnumerable(0)}))?function(e){return"String"==U(e)?z(e,""):W(e)}:W,Y=TypeError,K=function(e){if(null==e)throw Y("Can't call method on "+e);return e},H=X,V=K,Q=function(e){return H(V(e))},J=function(e){return"function"==typeof e},Z=J,ee=function(e){return"object"==typeof e?null!==e:Z(e)},te=g,re=J,ne=function(e){return re(e)?e:void 0},ie=function(e,t){return arguments.length<2?ne(te[e]):te[e]&&te[e][t]},oe=N({}.isPrototypeOf),se=ie("navigator","userAgent")||"",ce=g,ae=se,ue=ce.process,le=ce.Deno,fe=ue&&ue.versions||le&&le.version,he=fe&&fe.v8;he&&(I=(R=he.split("."))[0]>0&&R[0]<4?1:+(R[0]+R[1])),!I&&ae&&(!(R=ae.match(/Edge\/(\d+)/))||R[1]>=74)&&(R=ae.match(/Chrome\/(\d+)/))&&(I=+R[1]);var pe=I,de=pe,ve=b,ye=!!Object.getOwnPropertySymbols&&!ve((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&de&&de<41})),ge=ye&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,me=ie,be=J,we=oe,Ee=Object,Se=ge?function(e){return"symbol"==typeof e}:function(e){var t=me("Symbol");return be(t)&&we(t.prototype,Ee(e))},xe=String,Oe=function(e){try{return xe(e)}catch(e){return"Object"}},ke=J,je=Oe,_e=TypeError,Ae=function(e){if(ke(e))return e;throw _e(je(e)+" is not a function")},Re=Ae,Ie=function(e,t){var r=e[t];return null==r?void 0:Re(r)},Fe=O,Le=J,Te=ee,Pe=TypeError,De={exports:{}},Ce=g,Ne=Object.defineProperty,Me=function(e,t){try{Ne(Ce,e,{value:t,configurable:!0,writable:!0})}catch(r){Ce[e]=t}return t},Ge=Me,$e=g["__core-js_shared__"]||Ge("__core-js_shared__",{}),Be=$e;(De.exports=function(e,t){return Be[e]||(Be[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"});var qe=K,Ue=Object,We=function(e){return Ue(qe(e))},ze=We,Xe=N({}.hasOwnProperty),Ye=Object.hasOwn||function(e,t){return Xe(ze(e),t)},Ke=N,He=0,Ve=Math.random(),Qe=Ke(1..toString),Je=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Qe(++He+Ve,36)},Ze=g,et=De.exports,tt=Ye,rt=Je,nt=ye,it=ge,ot=et("wks"),st=Ze.Symbol,ct=st&&st.for,at=it?st:st&&st.withoutSetter||rt,ut=function(e){if(!tt(ot,e)||!nt&&"string"!=typeof ot[e]){var t="Symbol."+e;nt&&tt(st,e)?ot[e]=st[e]:ot[e]=it&&ct?ct(t):at(t)}return ot[e]},lt=O,ft=ee,ht=Se,pt=Ie,dt=function(e,t){var r,n;if("string"===t&&Le(r=e.toString)&&!Te(n=Fe(r,e)))return n;if(Le(r=e.valueOf)&&!Te(n=Fe(r,e)))return n;if("string"!==t&&Le(r=e.toString)&&!Te(n=Fe(r,e)))return n;throw Pe("Can't convert object to primitive value")},vt=TypeError,yt=ut("toPrimitive"),gt=function(e,t){if(!ft(e)||ht(e))return e;var r,n=pt(e,yt);if(n){if(void 0===t&&(t="default"),r=lt(n,e,t),!ft(r)||ht(r))return r;throw vt("Can't convert object to primitive value")}return void 0===t&&(t="number"),dt(e,t)},mt=Se,bt=function(e){var t=gt(e,"string");return mt(t)?t:t+""},wt=ee,Et=g.document,St=wt(Et)&&wt(Et.createElement),xt=function(e){return St?Et.createElement(e):{}},Ot=xt,kt=!w&&!b((function(){return 7!=Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),jt=w,_t=O,At=k,Rt=F,It=Q,Ft=bt,Lt=Ye,Tt=kt,Pt=Object.getOwnPropertyDescriptor;m.f=jt?Pt:function(e,t){if(e=It(e),t=Ft(t),Tt)try{return Pt(e,t)}catch(e){}if(Lt(e,t))return Rt(!_t(At.f,e,t),e[t])};var Dt={},Ct=w&&b((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Nt=ee,Mt=String,Gt=TypeError,$t=function(e){if(Nt(e))return e;throw Gt(Mt(e)+" is not an object")},Bt=w,qt=kt,Ut=Ct,Wt=$t,zt=bt,Xt=TypeError,Yt=Object.defineProperty,Kt=Object.getOwnPropertyDescriptor;Dt.f=Bt?Ut?function(e,t,r){if(Wt(e),t=zt(t),Wt(r),"function"==typeof e&&"prototype"===t&&"value"in r&&"writable"in r&&!r.writable){var n=Kt(e,t);n&&n.writable&&(e[t]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return Yt(e,t,r)}:Yt:function(e,t,r){if(Wt(e),t=zt(t),Wt(r),qt)try{return Yt(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Xt("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var Ht=Dt,Vt=F,Qt=w?function(e,t,r){return Ht.f(e,t,Vt(1,r))}:function(e,t,r){return e[t]=r,e},Jt={exports:{}},Zt=w,er=Ye,tr=Function.prototype,rr=Zt&&Object.getOwnPropertyDescriptor,nr=er(tr,"name"),ir={EXISTS:nr,PROPER:nr&&"something"===function(){}.name,CONFIGURABLE:nr&&(!Zt||Zt&&rr(tr,"name").configurable)},or=J,sr=$e,cr=N(Function.toString);or(sr.inspectSource)||(sr.inspectSource=function(e){return cr(e)});var ar,ur,lr,fr=sr.inspectSource,hr=J,pr=fr,dr=g.WeakMap,vr=hr(dr)&&/native code/.test(pr(dr)),yr=De.exports,gr=Je,mr=yr("keys"),br=function(e){return mr[e]||(mr[e]=gr(e))},wr={},Er=vr,Sr=g,xr=N,Or=ee,kr=Qt,jr=Ye,_r=$e,Ar=br,Rr=wr,Ir=Sr.TypeError,Fr=Sr.WeakMap;if(Er||_r.state){var Lr=_r.state||(_r.state=new Fr),Tr=xr(Lr.get),Pr=xr(Lr.has),Dr=xr(Lr.set);ar=function(e,t){if(Pr(Lr,e))throw new Ir("Object already initialized");return t.facade=e,Dr(Lr,e,t),t},ur=function(e){return Tr(Lr,e)||{}},lr=function(e){return Pr(Lr,e)}}else{var Cr=Ar("state");Rr[Cr]=!0,ar=function(e,t){if(jr(e,Cr))throw new Ir("Object already initialized");return t.facade=e,kr(e,Cr,t),t},ur=function(e){return jr(e,Cr)?e[Cr]:{}},lr=function(e){return jr(e,Cr)}}var Nr={set:ar,get:ur,has:lr,enforce:function(e){return lr(e)?ur(e):ar(e,{})},getterFor:function(e){return function(t){var r;if(!Or(t)||(r=ur(t)).type!==e)throw Ir("Incompatible receiver, "+e+" required");return r}}},Mr=b,Gr=J,$r=Ye,Br=w,qr=ir.CONFIGURABLE,Ur=fr,Wr=Nr.enforce,zr=Nr.get,Xr=Object.defineProperty,Yr=Br&&!Mr((function(){return 8!==Xr((function(){}),"length",{value:8}).length})),Kr=String(String).split("String"),Hr=Jt.exports=function(e,t,r){"Symbol("===String(t).slice(0,7)&&(t="["+String(t).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!$r(e,"name")||qr&&e.name!==t)&&(Br?Xr(e,"name",{value:t,configurable:!0}):e.name=t),Yr&&r&&$r(r,"arity")&&e.length!==r.arity&&Xr(e,"length",{value:r.arity});try{r&&$r(r,"constructor")&&r.constructor?Br&&Xr(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=Wr(e);return $r(n,"source")||(n.source=Kr.join("string"==typeof t?t:"")),e};Function.prototype.toString=Hr((function(){return Gr(this)&&zr(this).source||Ur(this)}),"toString");var Vr=J,Qr=Dt,Jr=Jt.exports,Zr=Me,en=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(Vr(r)&&Jr(r,o,n),n.global)i?e[t]=r:Zr(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:Qr.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},tn={},rn=Math.ceil,nn=Math.floor,on=Math.trunc||function(e){var t=+e;return(t>0?nn:rn)(t)},sn=function(e){var t=+e;return t!=t||0===t?0:on(t)},cn=sn,an=Math.max,un=Math.min,ln=function(e,t){var r=cn(e);return r<0?an(r+t,0):un(r,t)},fn=sn,hn=Math.min,pn=function(e){return e>0?hn(fn(e),9007199254740991):0},dn=pn,vn=function(e){return dn(e.length)},yn=Q,gn=ln,mn=vn,bn=function(e){return function(t,r,n){var i,o=yn(t),s=mn(o),c=gn(n,s);if(e&&r!=r){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===r)return e||c||0;return!e&&-1}},wn={includes:bn(!0),indexOf:bn(!1)},En=Ye,Sn=Q,xn=wn.indexOf,On=wr,kn=N([].push),jn=function(e,t){var r,n=Sn(e),i=0,o=[];for(r in n)!En(On,r)&&En(n,r)&&kn(o,r);for(;t.length>i;)En(n,r=t[i++])&&(~xn(o,r)||kn(o,r));return o},_n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],An=jn,Rn=_n.concat("length","prototype");tn.f=Object.getOwnPropertyNames||function(e){return An(e,Rn)};var In={};In.f=Object.getOwnPropertySymbols;var Fn=ie,Ln=tn,Tn=In,Pn=$t,Dn=N([].concat),Cn=Fn("Reflect","ownKeys")||function(e){var t=Ln.f(Pn(e)),r=Tn.f;return r?Dn(t,r(e)):t},Nn=Ye,Mn=Cn,Gn=m,$n=Dt,Bn=function(e,t,r){for(var n=Mn(t),i=$n.f,o=Gn.f,s=0;ss;)gi.f(e,r=i[s++],n[r]);return e};var Ei,Si=ie("document","documentElement"),xi=$t,Oi=fi,ki=_n,ji=wr,_i=Si,Ai=xt,Ri=br("IE_PROTO"),Ii=function(){},Fi=function(e){return"