You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1871 lines
1.2 MiB
JavaScript
1871 lines
1.2 MiB
JavaScript
|
9 months ago
|
(()=>{var e={5179:e=>{function webpackEmptyAsyncContext(e){return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");t.code="MODULE_NOT_FOUND";throw t}))}webpackEmptyAsyncContext.keys=()=>[];webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext;webpackEmptyAsyncContext.id=5179;e.exports=webpackEmptyAsyncContext},3914:function(e,t,r){(function(t,n){true?e.exports=n(r(4614),r(5328)):0})(this,(function(e,t){"use strict";const r=SegmentObject("",-1,-1,"",null);const n=[];function SegmentObject(e,t,r,n,s){return{source:e,line:t,column:r,name:n,content:s}}function Source(e,t,r,n){return{map:e,sources:t,source:r,content:n}}function MapSource(e,t){return Source(e,t,"",null)}function OriginalSource(e,t){return Source(null,n,e,t)}function traceMappings(n){const s=new t.GenMapping({file:n.map.file});const{sources:i,map:a}=n;const o=a.names;const l=e.decodedMappings(a);for(let e=0;e<l.length;e++){const n=l[e];for(let a=0;a<n.length;a++){const l=n[a];const c=l[0];let u=r;if(l.length!==1){const e=i[l[1]];u=originalPositionFor(e,l[2],l[3],l.length===5?o[l[4]]:"");if(u==null)continue}const{column:p,line:f,name:d,content:h,source:m}=u;t.maybeAddSegment(s,e,c,m,f,p,d);if(m&&h!=null)t.setSourceContent(s,m,h)}}return s}function originalPositionFor(t,n,s,i){if(!t.map){return SegmentObject(t.source,n,s,i,t.content)}const a=e.traceSegment(t.map,n,s);if(a==null)return null;if(a.length===1)return r;return originalPositionFor(t.sources[a[1]],a[2],a[3],a.length===5?t.map.names[a[4]]:i)}function asArray(e){if(Array.isArray(e))return e;return[e]}function buildSourceMapTree(t,r){const n=asArray(t).map((t=>new e.TraceMap(t,"")));const s=n.pop();for(let e=0;e<n.length;e++){if(n[e].sources.length>1){throw new Error(`Transformation map ${e} must have exactly one source file.\n`+"Did you specify these with the most recent transformation maps first?")}}let i=build(s,r,"",0);for(let e=n.length-1;e>=0;e--){i=MapSource(n[e],[i])}return i}function build(t,r,n,s){const{resolvedSources:i,sourcesContent:a}=t;const o=s+1;const l=i.map(((t,s)=>{const i={importer:n,depth:o,source:t||"",content:undefined};const l=r(i.source,i);const{source:c,content:u}=i;if(l)return build(new e.TraceMap(l,c),r,c,o);const p=u!==undefined?u:a?a[s]:null;return OriginalSource(c,p)}));return MapSource(t,l)}class SourceMap{constructor(e,r){const n=r.decodedMappings?t.toDecodedMap(e):t.toEncodedMap(e);this.version=n.version;this.file=n.file;this.mappings=n.mappings;this.names=n.names;this.sourceRoot=n.sourceRoot;this.sources=n.sources;if(!r.excludeContent){this.sourcesContent=n.sourcesContent}}toString(){return JSON.stringify(this)}}function remapping(e,t,r){const n=typeof r==="object"?r:{excludeContent:!!r,decodedMappings:false};const s=buildSourceMapTree(e,t);return new SourceMap(traceMappings(s),n)}return remapping}))},5328:function(e,t,r){(function(e,n){true?n(t,r(7168),r(1575),r(4614)):0})(this,(function(e,t,r,n){"use strict";const s=0;const i=1;const a=2;const o=3;const l=4;const c=-1;e.addSegment=void 0;e.addMapping=void 0;e.maybeAddSegment=void 0;e.maybeAddMapping=void 0;e.setSourceContent=void 0;e.toDecodedMap=void 0;e.toEncodedMap=void 0;e.fromMap=void 0;e.allMappings=void 0;let u;class GenMapping{constructor({file:e,sourceRoot:r}={}){this._names=new t.SetArray;this._sources=new t.SetArray;this._sourcesContent=[];this._mappings=[];this.file=e;this.sourceRoot=r}}(()=>{e.addSegment=(e,t,r,n,s,i,a,o)=>u(false,e,t,r,n,s,i,a,o);e.maybeAddSegment=(e,t,r,n,s,i,a,o)=>u(true,e,t,r,n,s,i,a,o);e.addMapping=(e,t)=>addMappingInternal(false,e,t);e.maybeAddMapping=(e,t)=>addMappingInternal(true,e,t);e.setSourceContent=(e,r,n)=>{const{_sources:s,_sourcesContent:i}=e;i[t.put(s,r)]=n};e.toDecodedMap=e=>{const{file:t,sourceRoot:r,_mappings:n,_sources:s,_sourcesContent:i,_names:a}=e;removeEmptyFinalLines(n);return{version:3,file:t||undefined,names:a.array,sourceRoot:r||undefined,sources:s.array,sourcesContent:i,mappings:n}};e.toEncodedMap=t=>{const n=e.toDecodedMap(t);return Object.assign(Object.assign({},n),{mappings:r.encode(n.mappings)})};e.allMappings=e=>{const t=[];c
|
||
|
|
(function (root, factory) {
|
||
|
|
if (typeof define === "function" && define.amd) {
|
||
|
|
define(AMD_ARGUMENTS, factory);
|
||
|
|
} else if (typeof exports === "object") {
|
||
|
|
factory(COMMON_ARGUMENTS);
|
||
|
|
} else {
|
||
|
|
factory(BROWSER_ARGUMENTS);
|
||
|
|
}
|
||
|
|
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
|
||
|
|
FACTORY_BODY
|
||
|
|
});
|
||
|
|
`(e);function buildGlobal(e){const t=m("babelHelpers");const r=[];const n=h(null,[m("global")],o(r));const s=b([d(l(n,[u(a("===",S("typeof",m("global")),T("undefined")),m("self"),m("global"))]))]);r.push(E("var",[x(t,i("=",y(m("global"),t),g([])))]));buildHelpers(r,t,e);return s}function buildModule(e){const t=[];const r=buildHelpers(t,null,e);t.unshift(p(null,Object.keys(r).map((e=>f(c(r[e]),m(e))))));return b(t,[],"module")}function buildUmd(e){const t=m("babelHelpers");const r=[];r.push(E("var",[x(t,m("global"))]));buildHelpers(r,t,e);return b([buildUmdWrapper({FACTORY_PARAMETERS:m("global"),BROWSER_ARGUMENTS:i("=",y(m("root"),t),g([])),COMMON_ARGUMENTS:m("exports"),AMD_ARGUMENTS:s([T("exports")]),FACTORY_BODY:r,UMD_ROOT:m("this")})])}function buildVar(e){const t=m("babelHelpers");const r=[];r.push(E("var",[x(t,g([]))]));const n=b(r);buildHelpers(r,t,e);r.push(d(t));return n}function buildHelpers(e,t,r){const getHelperReference=e=>t?y(t,m(e)):m(`_${e}`);const s={};helpers().list.forEach((function(t){if(r&&r.indexOf(t)<0)return;const i=s[t]=getHelperReference(t);helpers().ensure(t,n.default);const{nodes:a}=helpers().get(t,getHelperReference,i);e.push(...a)}));return s}function _default(e,t="global"){let r;const n={global:buildGlobal,module:buildModule,umd:buildUmd,var:buildVar}[t];if(n){r=n(e)}else{throw new Error(`Unsupported output type ${t}`)}return(0,_generator().default)(r).code}0&&0},6895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformFromAst=void 0;t.transformFromAstAsync=transformFromAstAsync;t.transformFromAstSync=transformFromAstSync;function _gensync(){const e=r(6433);_gensync=function(){return e};return e}var n=r(4455);var s=r(8589);var i=r(3585);const a=_gensync()((function*(e,t,r){const i=yield*(0,n.default)(r);if(i===null)return null;if(!e)throw new Error("No AST given");return yield*(0,s.run)(i,t,e)}));const o=function transformFromAst(e,t,r,n){let s;let o;if(typeof r==="function"){o=r;s=undefined}else{s=r;o=n}if(o===undefined){{return(0,i.beginHiddenCallStack)(a.sync)(e,t,s)}}(0,i.beginHiddenCallStack)(a.errback)(e,t,s,o)};t.transformFromAst=o;function transformFromAstSync(...e){return(0,i.beginHiddenCallStack)(a.sync)(...e)}function transformFromAstAsync(...e){return(0,i.beginHiddenCallStack)(a.async)(...e)}0&&0},5885:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transformFile=transformFile;t.transformFileAsync=transformFileAsync;t.transformFileSync=transformFileSync;function _gensync(){const e=r(6433);_gensync=function(){return e};return e}var n=r(4455);var s=r(8589);var i=r(9724);({});const a=_gensync()((function*(e,t){const r=Object.assign({},t,{filename:e});const a=yield*(0,n.default)(r);if(a===null)return null;const o=yield*i.readFile(e,"utf8");return yield*(0,s.run)(a,o)}));function transformFile(...e){a.errback(...e)}function transformFileSync(...e){return a.sync(...e)}function transformFileAsync(...e){return a.async(...e)}0&&0},9994:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.transform=void 0;t.transformAsync=transformAsync;t.transformSync=transformSync;function _gensync(){const e=r(6433);_gensync=function(){return e};return e}var n=r(4455);var s=r(8589);var i=r(3585);const a=_gensync()((function*transform(e,t){const r=yield*(0,n.default)(t);if(r===null)return null;return yield*(0,s.run)(r,e)}));const o=function transform(e,t,r){let n;let s;if(typeof t==="function"){s=t;n=undefined}else{n=t;s=r}if(s===undefined){{return(0,i.beginHiddenCallStack)(a.sync)(e,n)}}(0,i.beginHiddenCallStack)(a.errback)(e,n,s)};t.transform=o;function transformSync(...e){return(0,i.beginHiddenCallStack)(a.sync)(...e)}function transformAsync(...e){return(0,i.beginHiddenCallStack)(a.async)(...e)}0&&0},2167:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=loadBlockHoistPlugin;function _traverse(){const e=r(2297);_traverse=function(){return e};return e}var n=r(7916);let s;const i={name:"internal.blockHoist",visitor:{Block:{exit({node:e}){const{body:t}=e;let r=Math.pow(2,30)-1;let n=f
|
||
|
|
${addDecorateHelper(s)}(
|
||
|
|
${f||n.types.nullLiteral()},
|
||
|
|
function (${o}, ${u?n.types.cloneNode(p):null}) {
|
||
|
|
${i}
|
||
|
|
return { F: ${n.types.cloneNode(i.id)}, d: ${d} };
|
||
|
|
},
|
||
|
|
${u}
|
||
|
|
)
|
||
|
|
`;if(!c){h.arguments[1].body.directives.push(n.types.directive(n.types.directiveLiteral("use strict")))}let m=h;let y="arguments.1.body.body.0";if(l){m=n.template.statement.ast`let ${e} = ${h}`;y="declarations.0.init."+y}return{instanceNodes:[n.template.statement.ast`${n.types.cloneNode(o)}(this)`],wrapClass(e){e.replaceWith(m);return e.get(y)}}}},5929:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.FEATURES=void 0;t.enableFeature=enableFeature;t.isLoose=isLoose;t.shouldTransform=shouldTransform;var n=r(327);const s=Object.freeze({fields:1<<1,privateMethods:1<<2,decorators:1<<3,privateIn:1<<4,staticBlocks:1<<5});t.FEATURES=s;const i=new Map([[s.fields,"@babel/plugin-transform-class-properties"],[s.privateMethods,"@babel/plugin-transform-private-methods"],[s.privateIn,"@babel/plugin-transform-private-property-in-object"]]);const a="@babel/plugin-class-features/featuresKey";const o="@babel/plugin-class-features/looseKey";const l="@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing";function enableFeature(e,t,r){if(!hasFeature(e,t)||canIgnoreLoose(e,t)){e.set(a,e.get(a)|t);if(r==="#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error"){setLoose(e,t,true);e.set(l,e.get(l)|t)}else if(r==="#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error"){setLoose(e,t,false);e.set(l,e.get(l)|t)}else{setLoose(e,t,r)}}let n;let s;for(const[t,r]of i){if(!hasFeature(e,t))continue;const i=isLoose(e,t);if(canIgnoreLoose(e,t)){continue}else if(n===!i){throw new Error("'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, "+"@babel/plugin-transform-private-methods and "+"@babel/plugin-transform-private-property-in-object (when they are enabled).")}else{n=i;s=r}}if(n!==undefined){for(const[t,r]of i){if(hasFeature(e,t)&&isLoose(e,t)!==n){setLoose(e,t,n);console.warn(`Though the "loose" option was set to "${!n}" in your @babel/preset-env `+`config, it will not be used for ${r} since the "loose" mode option was set to `+`"${n}" for ${s}.\nThe "loose" option must be the `+`same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods `+`and @babel/plugin-transform-private-property-in-object (when they are enabled): you can `+`silence this warning by explicitly adding\n`+`\t["${r}", { "loose": ${n} }]\n`+`to the "plugins" section of your Babel config.`)}}}}function hasFeature(e,t){return!!(e.get(a)&t)}function isLoose(e,t){return!!(e.get(o)&t)}function setLoose(e,t,r){if(r)e.set(o,e.get(o)|t);else e.set(o,e.get(o)&~t);e.set(l,e.get(l)&~t)}function canIgnoreLoose(e,t){return!!(e.get(l)&t)}function shouldTransform(e,t){let r=null;let i=null;let a=null;let o=null;let l=null;if((0,n.hasOwnDecorators)(e.node)){r=e.get("decorators.0")}for(const t of e.get("body.body")){if(!r&&(0,n.hasOwnDecorators)(t.node)){r=t.get("decorators.0")}if(!i&&t.isClassProperty()){i=t}if(!a&&t.isClassPrivateProperty()){a=t}if(!o&&t.isClassPrivateMethod!=null&&t.isClassPrivateMethod()){o=t}if(!l&&t.isStaticBlock!=null&&t.isStaticBlock()){l=t}}if(r&&a){throw a.buildCodeFrameError("Private fields in decorated classes are not supported yet.")}if(r&&o){throw o.buildCodeFrameError("Private methods in decorated classes are not supported yet.")}if(r&&!hasFeature(t,s.decorators)){throw e.buildCodeFrameError("Decorators are not enabled."+"\nIf you are using "+'["@babel/plugin-proposal-decorators", { "version": "legacy" }], '+'make sure it comes *before* "@babel/plugin-transform-class-properties" '+"and enable loose mode, like so:\n"+'\t["@babel/plugin-proposal-decorators", { "version": "legacy" }]\n'+'\t["@babel/plugin-transform-class-properties", { "loose": true }]')}if(o&&!hasFeature(t,s.privateMethods)){throw o.buildCodeFrameError("Class private methods are not enabled. "+"Please add `@babel/plugin-transform-private-methods` to your configuration.")}if((i||a)&&!hasFeature(t,s.fields)&&!hasFeature(t,s.privateMethods)){throw e.buildCodeFrameError("Class fields are
|
||
|
|
Object.prototype.hasOwnProperty.call(${buildCheckInRHS(i,t)}, ${n.types.cloneNode(r)})
|
||
|
|
`);return}const{id:u,static:p}=o.get(c);if(p){e.replaceWith(n.template.expression.ast`${buildCheckInRHS(i,t)} === ${n.types.cloneNode(this.classRef)}`);return}e.replaceWith(n.template.expression.ast`${n.types.cloneNode(u)}.has(${buildCheckInRHS(i,t)})`)}});const d={memoise(e,t){const{scope:r}=e;const{object:n}=e.node;const s=r.maybeGenerateMemoised(n);if(!s){return}this.memoiser.set(n,s,t)},receiver(e){const{object:t}=e.node;if(this.memoiser.has(t)){return n.types.cloneNode(this.memoiser.get(t))}return n.types.cloneNode(t)},get(e){const{classRef:t,privateNamesMap:r,file:s,innerBinding:i}=this;const{name:a}=e.node.property.id;const{id:o,static:l,method:c,methodId:u,getId:p,setId:f}=r.get(a);const d=p||f;if(l){const r=c&&!d?"classStaticPrivateMethodGet":"classStaticPrivateFieldSpecGet";unshadow(t.name,e.scope,i);return n.types.callExpression(s.addHelper(r),[this.receiver(e),n.types.cloneNode(t),n.types.cloneNode(o)])}if(c){if(d){if(!p&&f){if(s.availableHelper("writeOnlyError")){return n.types.sequenceExpression([this.receiver(e),n.types.callExpression(s.addHelper("writeOnlyError"),[n.types.stringLiteral(`#${a}`)])])}console.warn(`@babel/helpers is outdated, update it to silence this warning.`)}return n.types.callExpression(s.addHelper("classPrivateFieldGet"),[this.receiver(e),n.types.cloneNode(o)])}return n.types.callExpression(s.addHelper("classPrivateMethodGet"),[this.receiver(e),n.types.cloneNode(o),n.types.cloneNode(u)])}return n.types.callExpression(s.addHelper("classPrivateFieldGet"),[this.receiver(e),n.types.cloneNode(o)])},boundGet(e){this.memoise(e,1);return n.types.callExpression(n.types.memberExpression(this.get(e),n.types.identifier("bind")),[this.receiver(e)])},set(e,t){const{classRef:r,privateNamesMap:s,file:i}=this;const{name:a}=e.node.property.id;const{id:o,static:l,method:c,setId:u,getId:p}=s.get(a);const f=p||u;if(l){const s=c&&!f?"classStaticPrivateMethodSet":"classStaticPrivateFieldSpecSet";return n.types.callExpression(i.addHelper(s),[this.receiver(e),n.types.cloneNode(r),n.types.cloneNode(o),t])}if(c){if(u){return n.types.callExpression(i.addHelper("classPrivateFieldSet"),[this.receiver(e),n.types.cloneNode(o),t])}return n.types.sequenceExpression([this.receiver(e),t,n.types.callExpression(i.addHelper("readOnlyError"),[n.types.stringLiteral(`#${a}`)])])}return n.types.callExpression(i.addHelper("classPrivateFieldSet"),[this.receiver(e),n.types.cloneNode(o),t])},destructureSet(e){const{classRef:t,privateNamesMap:r,file:s}=this;const{name:i}=e.node.property.id;const{id:a,static:o}=r.get(i);if(o){try{var l=s.addHelper("classStaticPrivateFieldDestructureSet")}catch(e){throw new Error("Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \n"+"please update @babel/helpers to the latest version.")}return n.types.memberExpression(n.types.callExpression(l,[this.receiver(e),n.types.cloneNode(t),n.types.cloneNode(a)]),n.types.identifier("value"))}return n.types.memberExpression(n.types.callExpression(s.addHelper("classPrivateFieldDestructureSet"),[this.receiver(e),n.types.cloneNode(a)]),n.types.identifier("value"))},call(e,t){this.memoise(e,1);return(0,o.default)(this.get(e),this.receiver(e),t,false)},optionalCall(e,t){this.memoise(e,1);return(0,o.default)(this.get(e),this.receiver(e),t,true)},delete(){throw new Error("Internal Babel error: deleting private elements is a parsing error.")}};const h={get(e){const{privateNamesMap:t,file:r}=this;const{object:s}=e.node;const{name:i}=e.node.property.id;return n.template.expression`BASE(REF, PROP)[PROP]`({BASE:r.addHelper("classPrivateFieldLooseBase"),REF:n.types.cloneNode(s),PROP:n.types.cloneNode(t.get(i).id)})},set(){throw new Error("private name handler with loose = true don't need set()")},boundGet(e){return n.types.callExpression(n.types.memberExpression(this.get(e),n.types.identifier("bind")),[n.types.cloneNode(e.node.object)])},simpleSet(e){return this.get(e)},destructureSet(e){return this.get(e)},call(e,t){return n.types.callExpression(this.get(e),t)},optionalCall(e,t){return n.types.optionalCallExpression(this.get(e),t,true)},delete(){
|
||
|
|
Object.defineProperty(${e}, ${n.types.cloneNode(s)}, {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
writable: true,
|
||
|
|
value: ${i}
|
||
|
|
});
|
||
|
|
`,t)}function buildPrivateInstanceFieldInitSpec(e,t,r,s){const{id:i}=r.get(t.node.key.id.name);const a=t.node.value||t.scope.buildUndefinedNode();{if(!s.availableHelper("classPrivateFieldInitSpec")){return inheritPropComments(n.template.statement.ast`${n.types.cloneNode(i)}.set(${e}, {
|
||
|
|
// configurable is always false for private elements
|
||
|
|
// enumerable is always false for private elements
|
||
|
|
writable: true,
|
||
|
|
value: ${a},
|
||
|
|
})`,t)}}const o=s.addHelper("classPrivateFieldInitSpec");return inheritPropComments(n.template.statement.ast`${o}(
|
||
|
|
${n.types.thisExpression()},
|
||
|
|
${n.types.cloneNode(i)},
|
||
|
|
{
|
||
|
|
writable: true,
|
||
|
|
value: ${a}
|
||
|
|
},
|
||
|
|
)`,t)}function buildPrivateStaticFieldInitSpec(e,t){const r=t.get(e.node.key.id.name);const{id:s,getId:i,setId:a,initAdded:o}=r;const l=i||a;if(!e.isProperty()&&(o||!l))return;if(l){t.set(e.node.key.id.name,Object.assign({},r,{initAdded:true}));return inheritPropComments(n.template.statement.ast`
|
||
|
|
var ${n.types.cloneNode(s)} = {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
// writable is false by default
|
||
|
|
get: ${i?i.name:e.scope.buildUndefinedNode()},
|
||
|
|
set: ${a?a.name:e.scope.buildUndefinedNode()}
|
||
|
|
}
|
||
|
|
`,e)}const c=e.node.value||e.scope.buildUndefinedNode();return inheritPropComments(n.template.statement.ast`
|
||
|
|
var ${n.types.cloneNode(s)} = {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
writable: true,
|
||
|
|
value: ${c}
|
||
|
|
};
|
||
|
|
`,e)}function buildPrivateMethodInitLoose(e,t,r){const s=r.get(t.node.key.id.name);const{methodId:i,id:a,getId:o,setId:l,initAdded:c}=s;if(c)return;if(i){return inheritPropComments(n.template.statement.ast`
|
||
|
|
Object.defineProperty(${e}, ${a}, {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
// writable is false by default
|
||
|
|
value: ${i.name}
|
||
|
|
});
|
||
|
|
`,t)}const u=o||l;if(u){r.set(t.node.key.id.name,Object.assign({},s,{initAdded:true}));return inheritPropComments(n.template.statement.ast`
|
||
|
|
Object.defineProperty(${e}, ${a}, {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
// writable is false by default
|
||
|
|
get: ${o?o.name:t.scope.buildUndefinedNode()},
|
||
|
|
set: ${l?l.name:t.scope.buildUndefinedNode()}
|
||
|
|
});
|
||
|
|
`,t)}}function buildPrivateInstanceMethodInitSpec(e,t,r,n){const s=r.get(t.node.key.id.name);const{getId:i,setId:a,initAdded:o}=s;if(o)return;const l=i||a;if(l){return buildPrivateAccessorInitialization(e,t,r,n)}return buildPrivateInstanceMethodInitialization(e,t,r,n)}function buildPrivateAccessorInitialization(e,t,r,s){const i=r.get(t.node.key.id.name);const{id:a,getId:o,setId:l}=i;r.set(t.node.key.id.name,Object.assign({},i,{initAdded:true}));{if(!s.availableHelper("classPrivateFieldInitSpec")){return inheritPropComments(n.template.statement.ast`
|
||
|
|
${a}.set(${e}, {
|
||
|
|
get: ${o?o.name:t.scope.buildUndefinedNode()},
|
||
|
|
set: ${l?l.name:t.scope.buildUndefinedNode()}
|
||
|
|
});
|
||
|
|
`,t)}}const c=s.addHelper("classPrivateFieldInitSpec");return inheritPropComments(n.template.statement.ast`${c}(
|
||
|
|
${n.types.thisExpression()},
|
||
|
|
${n.types.cloneNode(a)},
|
||
|
|
{
|
||
|
|
get: ${o?o.name:t.scope.buildUndefinedNode()},
|
||
|
|
set: ${l?l.name:t.scope.buildUndefinedNode()}
|
||
|
|
},
|
||
|
|
)`,t)}function buildPrivateInstanceMethodInitialization(e,t,r,s){const i=r.get(t.node.key.id.name);const{id:a}=i;{if(!s.availableHelper("classPrivateMethodInitSpec")){return inheritPropComments(n.template.statement.ast`${a}.add(${e})`,t)}}const o=s.addHelper("classPrivateMethodInitSpec");return inheritPropComments(n.template.statement.ast`${o}(
|
||
|
|
${n.types.thisExpression()},
|
||
|
|
${n.types.cloneNode(a)}
|
||
|
|
)`,t)}function buildPublicFieldInitLoose(e,t){const{key:r,computed:s}=t.node;const i=t.node.value||t.scope.buildUndefinedNode();return inheritPropComments(n.types.expressionStatement(n.types.assignmentExpression("=",n.types.memberExpression(e,r,s||n.types.isLiteral(r)),i)),t)}function buildPublicFieldInitSpec(e,t,r){const{key:s,computed:i}=t.node;const a=t.node.value||t.scope.buildUndefinedNode();return inheritPropComments(n.types.expressionStatement(n.types.callExpression(r.addHelper("defineProperty"),[e,i||n.types.isLiteral(s)?s:n.types.stringLiteral(s.name),a])),t)}function buildPrivateStaticMethodInitLoose(e,t,r,s){const i=s.get(t.node.key.id.name);const{id:a,methodId:o,getId:l,setId:c,initAdded:u}=i;if(u)return;const p=l||c;if(p){s.set(t.node.key.id.name,Object.assign({},i,{initAdded:true}));return inheritPropComments(n.template.statement.ast`
|
||
|
|
Object.defineProperty(${e}, ${a}, {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
// writable is false by default
|
||
|
|
get: ${l?l.name:t.scope.buildUndefinedNode()},
|
||
|
|
set: ${c?c.name:t.scope.buildUndefinedNode()}
|
||
|
|
})
|
||
|
|
`,t)}return inheritPropComments(n.template.statement.ast`
|
||
|
|
Object.defineProperty(${e}, ${a}, {
|
||
|
|
// configurable is false by default
|
||
|
|
// enumerable is false by default
|
||
|
|
// writable is false by default
|
||
|
|
value: ${o.name}
|
||
|
|
});
|
||
|
|
`,t)}function buildPrivateMethodDeclaration(e,t,r=false){const s=t.get(e.node.key.id.name);const{id:i,methodId:a,getId:o,setId:l,getterDeclared:c,setterDeclared:u,static:p}=s;const{params:f,body:d,generator:h,async:m}=e.node;const y=o&&!c&&f.length===0;const g=l&&!u&&f.length>0;let b=a;if(y){t.set(e.node.key.id.name,Object.assign({},s,{getterDeclared:true}));b=o}else if(g){t.set(e.node.key.id.name,Object.assign({},s,{setterDeclared:true}));b=l}else if(p&&!r){b=i}return inheritPropComments(n.types.functionDeclaration(n.types.cloneNode(b),f,d,h,m),e)}const m=n.traverse.visitors.merge([{UnaryExpression(e){const{node:t}=e;if(t.operator==="delete"){const r=(0,c.skipTransparentExprWrapperNodes)(t.argument);if(n.types.isThisExpression(r)){e.replaceWith(n.types.booleanLiteral(true))}}},ThisExpression(e,t){t.needsClassRef=true;e.replaceWith(n.types.cloneNode(t.classRef))},MetaProperty(e){const{node:t,scope:r}=e;if(t.meta.name==="new"&&t.property.name==="target"){e.replaceWith(r.buildUndefinedNode())}}},i.default]);const y={ReferencedIdentifier(e,t){if(e.scope.bindingIdentifierEquals(e.node.name,t.innerBinding)){t.needsClassRef=true;e.node.name=t.classRef.name}}};function replaceThisContext(e,t,r){var n;const s={classRef:t,needsClassRef:false,innerBinding:r};if(!e.isMethod()){e.traverse(m,s)}if(r!=null&&(n=s.classRef)!=null&&n.name&&s.classRef.name!==r.name){e.traverse(y,s)}return s.needsClassRef}function isNameOrLength({key:e,computed:t}){if(e.type==="Identifier"){return!t&&(e.name==="name"||e.name==="length")}if(e.type==="StringLiteral"){return e.value==="name"||e.value==="length"}return false}function inheritPropComments(e,t){n.types.inheritLeadingComments(e,t.node);n.types.inheritInnerComments(e,t.node);return e}function buildFieldsInitNodes(e,t,r,i,a,o,l,c,p){var f,d;let h=0;let m;const y=[];const g=[];const b=[];let T=null;const S=n.types.isIdentifier(t)?()=>t:()=>{var e;(e=m)!=null?e:m=r[0].scope.generateUidIdentifierBasedOnNode(t);return m};const E=(f=e)!=null?f:r[0].scope.generateUidIdentifier("class");(d=e)!=null?d:e=n.types.cloneNode(p);for(const t of r){t.isClassProperty()&&u.assertFieldTransformed(t);const r=!(n.types.isStaticBlock!=null&&n.types.isStaticBlock(t.node))&&t.node.static;const f=!r;const d=t.isPrivate();const m=!d;const T=t.isProperty();const x=!T;const v=t.isStaticBlock==null?void 0:t.isStaticBlock();if(r)h|=1;if(r||x&&d||v){new s.default({methodPath:t,constantSuper:c,file:a,refToPreserve:p,getSuperRef:S,getObjectRef(){h|=2;if(r||v){return E}else{return n.types.memberExpression(E,n.types.identifier("prototype"))}}}).replace();const e=replaceThisContext(t,E,p);if(e){h|=2}}switch(true){case v:{const e=t.node.body;if(e.length===1&&n.types.isExpressionStatement(e[0])){y.push(inheritPropComments(e[0],t))}else{y.push(n.types.inheritsComments(n.template.statement.ast`(() => { ${e} })()`,t.node))}break}case r&&d&&T&&l:y.push(buildPrivateFieldInitLoose(n.types.cloneNode(e),t,i));break;case r&&d&&T&&!l:y.push(buildPrivateStaticFieldInitSpec(t,i));break;case r&&m&&T&&o:if(!isNameOrLength(t.node)){y.push(buildPublicFieldInitLoose(n.types.cloneNode(e),t));break}case r&&m&&T&&!o:y.push(buildPublicFieldInitSpec(n.types.cloneNode(e),t,a));break;case f&&d&&T&&l:g.push(buildPrivateFieldInitLoose(n.types.thisExpression(),t,i));break;case f&&d&&T&&!l:g.push(buildPrivateInstanceFieldInitSpec(n.types.thisExpression(),t,i,a));break;case f&&d&&x&&l:g.unshift(buildPrivateMethodInitLoose(n.types.thisExpression(),t,i));b.push(buildPrivateMethodDeclaration(t,i,l));break;case f&&d&&x&&!l:g.unshift(buildPrivateInstanceMethodInitSpec(n.types.thisExpression(),t,i,a));b.push(buildPrivateMethodDeclaration(t,i,l));break;case r&&d&&x&&!l:y.unshift(buildPrivateStaticFieldInitSpec(t,i));b.push(buildPrivateMethodDeclaration(t,i,l));break;case r&&d&&x&&l:y.unshift(buildPrivateStaticMethodInitLoose(n.types.cloneNode(e),t,a,i));b.push(buildPrivateMethodDeclaration(t,i,l));break;case f&&m&&T&&o:g.push(buildPublicFieldInitLoose(n.types.thisExpression(),t));break;case f&&m&&T&&!o:g.push(buildPublicFieldInitSpec(n.types.thisExpression(),t,a));b
|
||
|
|
Promise.resolve().then(() => ${s(i)})
|
||
|
|
`}else return s(i)}const a=n.types.isTemplateLiteral(i)?n.types.identifier("specifier"):n.types.templateLiteral([n.types.templateElement({raw:""}),n.types.templateElement({raw:""})],[n.types.identifier("specifier")]);if(t){return n.template.expression.ast`
|
||
|
|
(specifier =>
|
||
|
|
new Promise(r => r(${a}))
|
||
|
|
.then(s => ${s(n.types.identifier("s"))})
|
||
|
|
)(${i})
|
||
|
|
`}else if(r){return n.template.expression.ast`
|
||
|
|
(specifier =>
|
||
|
|
new Promise(r => r(${s(a)}))
|
||
|
|
)(${i})
|
||
|
|
`}else{return n.template.expression.ast`
|
||
|
|
(specifier => ${s(a)})(${i})
|
||
|
|
`}}},7406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=getModuleName;{const e=getModuleName;t["default"]=getModuleName=function getModuleName(t,r){var n,s,i,a;return e(t,{moduleId:(n=r.moduleId)!=null?n:t.moduleId,moduleIds:(s=r.moduleIds)!=null?s:t.moduleIds,getModuleId:(i=r.getModuleId)!=null?i:t.getModuleId,moduleRoot:(a=r.moduleRoot)!=null?a:t.moduleRoot})}}function getModuleName(e,t){const{filename:r,filenameRelative:n=r,sourceRoot:s=t.moduleRoot}=e;const{moduleId:i,moduleIds:a=!!i,getModuleId:o,moduleRoot:l=s}=t;if(!a)return null;if(i!=null&&!o){return i}let c=l!=null?l+"/":"";if(n){const e=s!=null?new RegExp("^"+s+"/?"):"";c+=n.replace(e,"").replace(/\.(\w*?)$/,"")}c=c.replace(/\\/g,"/");if(o){return o(c)||c}else{return c}}},6646:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});Object.defineProperty(t,"buildDynamicImport",{enumerable:true,get:function(){return u.buildDynamicImport}});t.buildNamespaceInitStatements=buildNamespaceInitStatements;t.ensureStatementsHoisted=ensureStatementsHoisted;Object.defineProperty(t,"getModuleName",{enumerable:true,get:function(){return p.default}});Object.defineProperty(t,"hasExports",{enumerable:true,get:function(){return l.hasExports}});Object.defineProperty(t,"isModule",{enumerable:true,get:function(){return i.isModule}});Object.defineProperty(t,"isSideEffectImport",{enumerable:true,get:function(){return l.isSideEffectImport}});t.rewriteModuleStatementsAndPrepareHeader=rewriteModuleStatementsAndPrepareHeader;Object.defineProperty(t,"rewriteThis",{enumerable:true,get:function(){return a.default}});t.wrapInterop=wrapInterop;var n=r(9491);var s=r(3688);var i=r(3380);var a=r(2268);var o=r(7258);var l=r(4042);var c=r(8652);var u=r(3664);var p=r(7406);const{booleanLiteral:f,callExpression:d,cloneNode:h,directive:m,directiveLiteral:y,expressionStatement:g,identifier:b,isIdentifier:T,memberExpression:S,stringLiteral:E,valueToNode:x,variableDeclaration:v,variableDeclarator:P}=s.types;{t.getDynamicImportSource=r(3664).getDynamicImportSource}function rewriteModuleStatementsAndPrepareHeader(e,{exportName:t,strict:r,allowTopLevelThis:s,strictMode:u,noInterop:p,importInterop:f=(p?"none":"babel"),lazy:d,getWrapperPayload:h=c.toGetWrapperPayload(d!=null?d:false),wrapReference:g=c.wrapReference,esNamespaceOnly:b,filename:T,constantReexports:S=arguments[1].loose,enumerableModuleMeta:E=arguments[1].loose,noIncompleteNsImportDetection:x}){(0,l.validateImportInteropOption)(f);n((0,i.isModule)(e),"Cannot process module statements in a script");e.node.sourceType="script";const v=(0,l.default)(e,t,{importInterop:f,initializeReexports:S,getWrapperPayload:h,esNamespaceOnly:b,filename:T});if(!s){(0,a.default)(e)}(0,o.default)(e,v,g);if(u!==false){const t=e.node.directives.some((e=>e.value.value==="use strict"));if(!t){e.unshiftContainer("directives",m(y("use strict")))}}const P=[];if((0,l.hasExports)(v)&&!r){P.push(buildESModuleHeader(v,E))}const A=buildExportNameListDeclaration(e,v);if(A){v.exportNameListName=A.name;P.push(A.statement)}P.push(...buildExportInitializationStatements(e,v,g,S,x));return{meta:v,headers:P}}function ensureStatementsHoisted(e){e.forEach((e=>{e._blockHoist=3}))}function wrapInterop(e,t,r){if(r==="none"){return null}if(r==="node-namespace"){return d(e.hub.addHelper("interopRequireWildcard"),[t,f(true)])}else if(r==="node-default"){return null}let n;if(r==="default"){n="interopRequireDefault"}else if(r==="namespace"){n="interopRequireWildcard"}else{throw new Error(`Unknown interop: ${r}`)}return d(e.hub.addHelper(n),[t])}function buildNamespaceInitStatements(e,t,r=false,n=c.wrapReference){var i;const a=[];const o=b(t.name);for(const e of t.importsNamespace){if(e===t.name)continue;a.push(s.template.statement`var NAME = SOURCE;`({NAME:e,SOURCE:h(o)}))}const l=(i=n(o,t.wrap))!=null?i:o;if(r){a.push(...buildReexportsFromMeta(e,t,true,n))}for(const r of t.reexportNamespace){a.push((!s.types.isIdentifier(l)?s.template.statement`
|
||
|
|
Object.defineProperty(EXPORTS, "NAME", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return NAMESPACE;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
`:s.template.statement`EXPORTS.NAME = NAMESPACE;`)({EXPORTS:e.exportName,NAME:r,NAMESPACE:h(l)}))}if(t.reexportAll){const n=buildNamespaceReexport(e,h(l),r);n.loc=t.reexportAll.loc;a.push(n)}return a}const A={constant:s.template.statement`EXPORTS.EXPORT_NAME = NAMESPACE_IMPORT;`,constantComputed:s.template.statement`EXPORTS["EXPORT_NAME"] = NAMESPACE_IMPORT;`,spec:s.template.statement`
|
||
|
|
Object.defineProperty(EXPORTS, "EXPORT_NAME", {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return NAMESPACE_IMPORT;
|
||
|
|
},
|
||
|
|
});
|
||
|
|
`};function buildReexportsFromMeta(e,t,r,n){var s;let i=b(t.name);i=(s=n(i,t.wrap))!=null?s:i;const{stringSpecifiers:a}=e;return Array.from(t.reexports,(([n,s])=>{let o=h(i);if(s==="default"&&t.interop==="node-default"){}else if(a.has(s)){o=S(o,E(s),true)}else{o=S(o,b(s))}const l={EXPORTS:e.exportName,EXPORT_NAME:n,NAMESPACE_IMPORT:o};if(r||T(o)){if(a.has(n)){return A.constantComputed(l)}else{return A.constant(l)}}else{return A.spec(l)}}))}function buildESModuleHeader(e,t=false){return(t?s.template.statement`
|
||
|
|
EXPORTS.__esModule = true;
|
||
|
|
`:s.template.statement`
|
||
|
|
Object.defineProperty(EXPORTS, "__esModule", {
|
||
|
|
value: true,
|
||
|
|
});
|
||
|
|
`)({EXPORTS:e.exportName})}function buildNamespaceReexport(e,t,r){return(r?s.template.statement`
|
||
|
|
Object.keys(NAMESPACE).forEach(function(key) {
|
||
|
|
if (key === "default" || key === "__esModule") return;
|
||
|
|
VERIFY_NAME_LIST;
|
||
|
|
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
|
||
|
|
|
||
|
|
EXPORTS[key] = NAMESPACE[key];
|
||
|
|
});
|
||
|
|
`:s.template.statement`
|
||
|
|
Object.keys(NAMESPACE).forEach(function(key) {
|
||
|
|
if (key === "default" || key === "__esModule") return;
|
||
|
|
VERIFY_NAME_LIST;
|
||
|
|
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
|
||
|
|
|
||
|
|
Object.defineProperty(EXPORTS, key, {
|
||
|
|
enumerable: true,
|
||
|
|
get: function() {
|
||
|
|
return NAMESPACE[key];
|
||
|
|
},
|
||
|
|
});
|
||
|
|
});
|
||
|
|
`)({NAMESPACE:t,EXPORTS:e.exportName,VERIFY_NAME_LIST:e.exportNameListName?(0,s.template)`
|
||
|
|
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
|
||
|
|
`({EXPORTS_LIST:e.exportNameListName}):null})}function buildExportNameListDeclaration(e,t){const r=Object.create(null);for(const e of t.local.values()){for(const t of e.names){r[t]=true}}let n=false;for(const e of t.source.values()){for(const t of e.reexports.keys()){r[t]=true}for(const t of e.reexportNamespace){r[t]=true}n=n||!!e.reexportAll}if(!n||Object.keys(r).length===0)return null;const s=e.scope.generateUidIdentifier("exportNames");delete r.default;return{name:s.name,statement:v("var",[P(s,x(r))])}}function buildExportInitializationStatements(e,t,r,n=false,s=false){const i=[];for(const[e,r]of t.local){if(r.kind==="import"){}else if(r.kind==="hoisted"){i.push([r.names[0],buildInitStatement(t,r.names,b(e))])}else if(!s){for(const e of r.names){i.push([e,null])}}}for(const e of t.source.values()){if(!n){const n=buildReexportsFromMeta(t,e,false,r);const s=[...e.reexports.keys()];for(let e=0;e<n.length;e++){i.push([s[e],n[e]])}}if(!s){for(const t of e.reexportNamespace){i.push([t,null])}}}i.sort((([e],[t])=>{if(e<t)return-1;if(t<e)return 1;return 0}));const a=[];if(s){for(const[,e]of i){a.push(e)}}else{const r=100;for(let n=0;n<i.length;n+=r){let s=[];for(let o=0;o<r&&n+o<i.length;o++){const[r,l]=i[n+o];if(l!==null){if(s.length>0){a.push(buildInitStatement(t,s,e.scope.buildUndefinedNode()));s=[]}a.push(l)}else{s.push(r)}}if(s.length>0){a.push(buildInitStatement(t,s,e.scope.buildUndefinedNode()))}}}return a}const w={computed:s.template.expression`EXPORTS["NAME"] = VALUE`,default:s.template.expression`EXPORTS.NAME = VALUE`};function buildInitStatement(e,t,r){const{stringSpecifiers:n,exportName:s}=e;return g(t.reduce(((e,t)=>{const r={EXPORTS:s,NAME:t,VALUE:e};if(n.has(t)){return w.computed(r)}else{return w.default(r)}}),r))}},8652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.toGetWrapperPayload=toGetWrapperPayload;t.wrapReference=wrapReference;var n=r(3688);var s=r(4042);function toGetWrapperPayload(e){return(t,r)=>{if(e===false)return null;if((0,s.isSideEffectImport)(r)||r.reexportAll)return null;if(e===true){return/\./.test(t)?null:"lazy"}if(Array.isArray(e)){return e.indexOf(t)===-1?null:"lazy"}if(typeof e==="function"){return e(t)?"lazy":null}throw new Error(`.lazy must be a boolean, string array, or function`)}}function wrapReference(e,t){if(t==="lazy")return n.types.callExpression(e,[]);return null}},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=normalizeModuleAndLoadMetadata;t.hasExports=hasExports;t.isSideEffectImport=isSideEffectImport;t.validateImportInteropOption=validateImportInteropOption;var n=r(1017);var s=r(4975);var i=r(4097);function hasExports(e){return e.hasExports}function isSideEffectImport(e){return e.imports.size===0&&e.importsNamespace.size===0&&e.reexports.size===0&&e.reexportNamespace.size===0&&!e.reexportAll}function validateImportInteropOption(e){if(typeof e!=="function"&&e!=="none"&&e!=="babel"&&e!=="node"){throw new Error(`.importInterop must be one of "none", "babel", "node", or a function returning one of those values (received ${e}).`)}return e}function resolveImportInterop(e,t,r){if(typeof e==="function"){return validateImportInteropOption(e(t,r))}return e}function normalizeModuleAndLoadMetadata(e,t,{importInterop:r,initializeReexports:n=false,getWrapperPayload:s,esNamespaceOnly:i=false,filename:a}){if(!t){t=e.scope.generateUidIdentifier("exports").name}const o=new Set;nameAnonymousExports(e);const{local:l,sources:c,hasExports:u}=getModuleMetadata(e,{initializeReexports:n,getWrapperPayload:s},o);removeImportExportDeclarations(e);for(const[e,t]of c){const{importsNamespace:n,imports:s}=t;if(n.size>0&&s.size===0){const[e]=n;t.name=e}const o=resolveImportInterop(r,e,a);if(o==="none"){t.interop="none"}else if(o==="node"&&t.interop==="namespace"){t.interop="node-namespace"}else if(o==="node"&&t.interop==="default"){t.interop="node-default"}else if(i&&t.interop==="namespace"){t.interop="default"}}return{exportName:t,exportNameListName:null,hasExports:u,local:l,source:c,stringSpecifiers:o}}function getExport
|
||
|
|
(function() {
|
||
|
|
throw new Error('"' + '${e}' + '" is read-only.');
|
||
|
|
})()
|
||
|
|
`;const w={ReferencedIdentifier(e){const{seen:t,buildImportReference:r,scope:n,imported:s,requeueInParent:i}=this;if(t.has(e.node))return;t.add(e.node);const a=e.node.name;const o=s.get(a);if(o){if(isInType(e)){throw e.buildCodeFrameError(`Cannot transform the imported binding "${a}" since it's also used in a type annotation. `+`Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`)}const t=e.scope.getBinding(a);const s=n.getBinding(a);if(s!==t)return;const l=r(o,e.node);l.loc=e.node.loc;if((e.parentPath.isCallExpression({callee:e.node})||e.parentPath.isOptionalCallExpression({callee:e.node})||e.parentPath.isTaggedTemplateExpression({tag:e.node}))&&m(l)){e.replaceWith(E([S(0),l]))}else if(e.isJSXIdentifier()&&m(l)){const{object:t,property:r}=l;e.replaceWith(b(g(t.name),g(r.name)))}else{e.replaceWith(l)}i(e);e.skip()}},UpdateExpression(e){const{scope:t,seen:r,imported:n,exported:s,requeueInParent:i,buildImportReference:l}=this;if(r.has(e.node))return;r.add(e.node);const c=e.get("argument");if(c.isMemberExpression())return;const p=e.node;if(c.isIdentifier()){const r=c.node.name;if(t.getBinding(r)!==e.scope.getBinding(r)){return}const i=s.get(r);const f=n.get(r);if((i==null?void 0:i.length)>0||f){if(f){e.replaceWith(a(p.operator[0]+"=",l(f,c.node),buildImportThrow(r)))}else if(p.prefix){e.replaceWith(buildBindingExportAssignmentExpression(this.metadata,i,o(p),e.scope))}else{const n=t.generateDeclaredUidIdentifier(r);e.replaceWith(E([a("=",o(n),o(p)),buildBindingExportAssignmentExpression(this.metadata,i,u(r),e.scope),o(n)]))}}}i(e);e.skip()},AssignmentExpression:{exit(e){const{scope:t,seen:r,imported:s,exported:i,requeueInParent:a,buildImportReference:o}=this;if(r.has(e.node))return;r.add(e.node);const c=e.get("left");if(c.isMemberExpression())return;if(c.isIdentifier()){const r=c.node.name;if(t.getBinding(r)!==e.scope.getBinding(r)){return}const l=i.get(r);const u=s.get(r);if((l==null?void 0:l.length)>0||u){n(e.node.operator==="=","Path was not simplified");const t=e.node;if(u){t.left=o(u,c.node);t.right=E([t.right,buildImportThrow(r)])}e.replaceWith(buildBindingExportAssignmentExpression(this.metadata,l,t,e.scope));a(e)}}else{const r=c.getOuterBindingIdentifiers();const n=Object.keys(r).filter((r=>t.getBinding(r)===e.scope.getBinding(r)));const o=n.find((e=>s.has(e)));if(o){e.node.right=E([e.node.right,buildImportThrow(o)])}const p=[];n.forEach((t=>{const r=i.get(t)||[];if(r.length>0){p.push(buildBindingExportAssignmentExpression(this.metadata,r,u(t),e.scope))}}));if(p.length>0){let t=E(p);if(e.parentPath.isExpressionStatement()){t=l(t);t._blockHoist=e.parentPath.node._blockHoist}const r=e.insertAfter(t)[0];a(r)}}}},"ForOfStatement|ForInStatement"(e){const{scope:t,node:r}=e;const{left:n}=r;const{exported:s,imported:i,scope:u}=this;if(!y(n)){let r=false,p;const f=e.get("body").scope;for(const e of Object.keys(c(n))){if(u.getBinding(e)===t.getBinding(e)){if(s.has(e)){r=true;if(f.hasOwnBinding(e)){f.rename(e)}}if(i.has(e)&&!p){p=e}}}if(!r&&!p){return}e.ensureBlock();const d=e.get("body");const h=t.generateUidIdentifierBasedOnNode(n);e.get("left").replaceWith(v("let",[P(o(h))]));t.registerDeclaration(e.get("left"));if(r){d.unshiftContainer("body",l(a("=",n,h)))}if(p){d.unshiftContainer("body",l(buildImportThrow(p)))}}}}},2268:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=rewriteThis;var n=r(8552);var s=r(3688);const{numericLiteral:i,unaryExpression:a}=s.types;const o=s.traverse.visitors.merge([n.default,{ThisExpression(e){e.replaceWith(a("void",i(0),true))}}]);function rewriteThis(e){(0,s.traverse)(e.node,Object.assign({},o,{noScope:true}))}},1475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=optimiseCallExpression;var n=r(776);const{callExpression:s,identifier:i,isIdentifier:a,isSpreadElement:o,memberExpression:l,optionalCallExpression:c,optionalMemberExpression:u}=n;function optimiseCallExpression(e,t,r,n){if(r.length===1&&o(r[0])&&a(r[0].argument,{name:"arguments"})){if(n){return c(u(e,i("apply"),false,true),
|
||
|
|
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
|
||
|
|
`])}else{return a.template.expression.ast`
|
||
|
|
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
|
||
|
|
`}}};const T=Object.assign({},b,{prop(e){const{property:t}=e.node;if(this.memoiser.has(t)){return u(this.memoiser.get(t))}return u(t)},get(e){const{isStatic:t,getSuperRef:r}=this;const{computed:n}=e.node;const s=this.prop(e);let i;if(t){var a;i=(a=r())!=null?a:f(p("Function"),p("prototype"))}else{var o;i=f((o=r())!=null?o:p("Object"),p("prototype"))}return f(i,s,n)},set(e,t){const{computed:r}=e.node;const n=this.prop(e);return o("=",f(m(),n,r),t)},destructureSet(e){const{computed:t}=e.node;const r=this.prop(e);return f(m(),r,t)},call(e,t){return(0,i.default)(this.get(e),m(),t,false)},optionalCall(e,t){return(0,i.default)(this.get(e),m(),t,true)}});class ReplaceSupers{constructor(e){var t;const r=e.methodPath;this.methodPath=r;this.isDerivedConstructor=r.isClassMethod({kind:"constructor"})&&!!e.superRef;this.isStatic=r.isObjectMethod()||r.node.static||(r.isStaticBlock==null?void 0:r.isStaticBlock());this.isPrivateMethod=r.isPrivate()&&r.isMethod();this.file=e.file;this.constantSuper=(t=e.constantSuper)!=null?t:e.isLoose;this.opts=e}getObjectRef(){return u(this.opts.objectRef||this.opts.getObjectRef())}getSuperRef(){if(this.opts.superRef)return u(this.opts.superRef);if(this.opts.getSuperRef){return u(this.opts.getSuperRef())}}replace(){if(this.opts.refToPreserve){this.methodPath.traverse(g,{refName:this.opts.refToPreserve.name})}const e=this.constantSuper?T:b;(0,s.default)(this.methodPath,y,Object.assign({file:this.file,scope:this.methodPath.scope,isDerivedConstructor:this.isDerivedConstructor,isStatic:this.isStatic,isPrivateMethod:this.isPrivateMethod,getObjectRef:this.getObjectRef.bind(this),getSuperRef:this.getSuperRef.bind(this),boundGet:e.get},e))}}t["default"]=ReplaceSupers},6118:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=simplifyAccess;var n=r(776);const{LOGICAL_OPERATORS:s,assignmentExpression:i,binaryExpression:a,cloneNode:o,identifier:l,logicalExpression:c,numericLiteral:u,sequenceExpression:p,unaryExpression:f}=n;const d={AssignmentExpression:{exit(e){const{scope:t,seen:r,bindingNames:n}=this;if(e.node.operator==="=")return;if(r.has(e.node))return;r.add(e.node);const l=e.get("left");if(!l.isIdentifier())return;const u=l.node.name;if(!n.has(u))return;if(t.getBinding(u)!==e.scope.getBinding(u)){return}const p=e.node.operator.slice(0,-1);if(s.includes(p)){e.replaceWith(c(p,e.node.left,i("=",o(e.node.left),e.node.right)))}else{e.node.right=a(p,o(e.node.left),e.node.right);e.node.operator="="}}}};{d.UpdateExpression={exit(e){if(!this.includeUpdateExpression)return;const{scope:t,bindingNames:r}=this;const n=e.get("argument");if(!n.isIdentifier())return;const s=n.node.name;if(!r.has(s))return;if(t.getBinding(s)!==e.scope.getBinding(s)){return}if(e.parentPath.isExpressionStatement()&&!e.isCompletionRecord()){const t=e.node.operator=="++"?"+=":"-=";e.replaceWith(i(t,n.node,u(1)))}else if(e.node.prefix){e.replaceWith(i("=",l(s),a(e.node.operator[0],f("+",n.node),u(1))))}else{const t=e.scope.generateUidIdentifierBasedOnNode(n.node,"old");const r=t.name;e.scope.push({id:t});const s=a(e.node.operator[0],l(r),u(1));e.replaceWith(p([i("=",l(r),f("+",n.node)),i("=",o(n.node),s),l(r)]))}}}}function simplifyAccess(e,t){{var r;e.traverse(d,{scope:e.scope,bindingNames:t,seen:new WeakSet,includeUpdateExpression:(r=arguments[2])!=null?r:true})}}},7255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isTransparentExprWrapper=isTransparentExprWrapper;t.skipTransparentExprWrapperNodes=skipTransparentExprWrapperNodes;t.skipTransparentExprWrappers=skipTransparentExprWrappers;var n=r(776);const{isParenthesizedExpression:s,isTSAsExpression:i,isTSNonNullExpression:a,isTSSatisfiesExpression:o,isTSTypeAssertion:l,isTypeCastExpression:c}=n;function isTransparentExprWrapper(e){return i(e)||o(e)||l(e)||a(e)||c(e)||s(e)}function skipTransparentExprWrappers(e){while(isTransparentExprWrapper(e.node)){e=e.get("expression")}return e}function skipTransparentExprWrapperNodes(e){while(isTransparentExprWrapper(e)){e=e.expression}return e}},4097:(e,t,r)=>{"use strict";Object.defi
|
||
|
|
export default function _AwaitValue(value) {
|
||
|
|
this.wrapped = value;
|
||
|
|
}
|
||
|
|
`}i.wrapAsyncGenerator=helper("7.0.0-beta.0")`
|
||
|
|
import AsyncGenerator from "AsyncGenerator";
|
||
|
|
|
||
|
|
export default function _wrapAsyncGenerator(fn) {
|
||
|
|
return function () {
|
||
|
|
return new AsyncGenerator(fn.apply(this, arguments));
|
||
|
|
};
|
||
|
|
}
|
||
|
|
`;i.asyncToGenerator=helper("7.0.0-beta.0")`
|
||
|
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
||
|
|
try {
|
||
|
|
var info = gen[key](arg);
|
||
|
|
var value = info.value;
|
||
|
|
} catch (error) {
|
||
|
|
reject(error);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (info.done) {
|
||
|
|
resolve(value);
|
||
|
|
} else {
|
||
|
|
Promise.resolve(value).then(_next, _throw);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function _asyncToGenerator(fn) {
|
||
|
|
return function () {
|
||
|
|
var self = this, args = arguments;
|
||
|
|
return new Promise(function (resolve, reject) {
|
||
|
|
var gen = fn.apply(self, args);
|
||
|
|
function _next(value) {
|
||
|
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
||
|
|
}
|
||
|
|
function _throw(err) {
|
||
|
|
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
||
|
|
}
|
||
|
|
|
||
|
|
_next(undefined);
|
||
|
|
});
|
||
|
|
};
|
||
|
|
}
|
||
|
|
`;i.classCallCheck=helper("7.0.0-beta.0")`
|
||
|
|
export default function _classCallCheck(instance, Constructor) {
|
||
|
|
if (!(instance instanceof Constructor)) {
|
||
|
|
throw new TypeError("Cannot call a class as a function");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.createClass=helper("7.0.0-beta.0")`
|
||
|
|
import toPropertyKey from "toPropertyKey";
|
||
|
|
function _defineProperties(target, props) {
|
||
|
|
for (var i = 0; i < props.length; i ++) {
|
||
|
|
var descriptor = props[i];
|
||
|
|
descriptor.enumerable = descriptor.enumerable || false;
|
||
|
|
descriptor.configurable = true;
|
||
|
|
if ("value" in descriptor) descriptor.writable = true;
|
||
|
|
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function _createClass(Constructor, protoProps, staticProps) {
|
||
|
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||
|
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
||
|
|
Object.defineProperty(Constructor, "prototype", { writable: false });
|
||
|
|
return Constructor;
|
||
|
|
}
|
||
|
|
`;i.defineEnumerableProperties=helper("7.0.0-beta.0")`
|
||
|
|
export default function _defineEnumerableProperties(obj, descs) {
|
||
|
|
for (var key in descs) {
|
||
|
|
var desc = descs[key];
|
||
|
|
desc.configurable = desc.enumerable = true;
|
||
|
|
if ("value" in desc) desc.writable = true;
|
||
|
|
Object.defineProperty(obj, key, desc);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Symbols are not enumerated over by for-in loops. If native
|
||
|
|
// Symbols are available, fetch all of the descs object's own
|
||
|
|
// symbol properties and define them on our target object too.
|
||
|
|
if (Object.getOwnPropertySymbols) {
|
||
|
|
var objectSymbols = Object.getOwnPropertySymbols(descs);
|
||
|
|
for (var i = 0; i < objectSymbols.length; i++) {
|
||
|
|
var sym = objectSymbols[i];
|
||
|
|
var desc = descs[sym];
|
||
|
|
desc.configurable = desc.enumerable = true;
|
||
|
|
if ("value" in desc) desc.writable = true;
|
||
|
|
Object.defineProperty(obj, sym, desc);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return obj;
|
||
|
|
}
|
||
|
|
`;i.defaults=helper("7.0.0-beta.0")`
|
||
|
|
export default function _defaults(obj, defaults) {
|
||
|
|
var keys = Object.getOwnPropertyNames(defaults);
|
||
|
|
for (var i = 0; i < keys.length; i++) {
|
||
|
|
var key = keys[i];
|
||
|
|
var value = Object.getOwnPropertyDescriptor(defaults, key);
|
||
|
|
if (value && value.configurable && obj[key] === undefined) {
|
||
|
|
Object.defineProperty(obj, key, value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return obj;
|
||
|
|
}
|
||
|
|
`;i.defineProperty=helper("7.0.0-beta.0")`
|
||
|
|
import toPropertyKey from "toPropertyKey";
|
||
|
|
export default function _defineProperty(obj, key, value) {
|
||
|
|
key = toPropertyKey(key);
|
||
|
|
// Shortcircuit the slow defineProperty path when possible.
|
||
|
|
// We are trying to avoid issues where setters defined on the
|
||
|
|
// prototype cause side effects under the fast path of simple
|
||
|
|
// assignment. By checking for existence of the property with
|
||
|
|
// the in operator, we can optimize most of this overhead away.
|
||
|
|
if (key in obj) {
|
||
|
|
Object.defineProperty(obj, key, {
|
||
|
|
value: value,
|
||
|
|
enumerable: true,
|
||
|
|
configurable: true,
|
||
|
|
writable: true
|
||
|
|
});
|
||
|
|
} else {
|
||
|
|
obj[key] = value;
|
||
|
|
}
|
||
|
|
return obj;
|
||
|
|
}
|
||
|
|
`;i.extends=helper("7.0.0-beta.0")`
|
||
|
|
export default function _extends() {
|
||
|
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
||
|
|
for (var i = 1; i < arguments.length; i++) {
|
||
|
|
var source = arguments[i];
|
||
|
|
for (var key in source) {
|
||
|
|
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
||
|
|
target[key] = source[key];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return target;
|
||
|
|
};
|
||
|
|
|
||
|
|
return _extends.apply(this, arguments);
|
||
|
|
}
|
||
|
|
`;{i.objectSpread=helper("7.0.0-beta.0")`
|
||
|
|
import defineProperty from "defineProperty";
|
||
|
|
|
||
|
|
export default function _objectSpread(target) {
|
||
|
|
for (var i = 1; i < arguments.length; i++) {
|
||
|
|
var source = (arguments[i] != null) ? Object(arguments[i]) : {};
|
||
|
|
var ownKeys = Object.keys(source);
|
||
|
|
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||
|
|
ownKeys.push.apply(ownKeys, Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||
|
|
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
ownKeys.forEach(function(key) {
|
||
|
|
defineProperty(target, key, source[key]);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
return target;
|
||
|
|
}
|
||
|
|
`}i.inherits=helper("7.0.0-beta.0")`
|
||
|
|
import setPrototypeOf from "setPrototypeOf";
|
||
|
|
|
||
|
|
export default function _inherits(subClass, superClass) {
|
||
|
|
if (typeof superClass !== "function" && superClass !== null) {
|
||
|
|
throw new TypeError("Super expression must either be null or a function");
|
||
|
|
}
|
||
|
|
// We can't use defineProperty to set the prototype in a single step because it
|
||
|
|
// doesn't work in Chrome <= 36. https://github.com/babel/babel/issues/14056
|
||
|
|
// V8 bug: https://bugs.chromium.org/p/v8/issues/detail?id=3334
|
||
|
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
||
|
|
constructor: {
|
||
|
|
value: subClass,
|
||
|
|
writable: true,
|
||
|
|
configurable: true
|
||
|
|
}
|
||
|
|
});
|
||
|
|
Object.defineProperty(subClass, "prototype", { writable: false });
|
||
|
|
if (superClass) setPrototypeOf(subClass, superClass);
|
||
|
|
}
|
||
|
|
`;i.inheritsLoose=helper("7.0.0-beta.0")`
|
||
|
|
import setPrototypeOf from "setPrototypeOf";
|
||
|
|
|
||
|
|
export default function _inheritsLoose(subClass, superClass) {
|
||
|
|
subClass.prototype = Object.create(superClass.prototype);
|
||
|
|
subClass.prototype.constructor = subClass;
|
||
|
|
setPrototypeOf(subClass, superClass);
|
||
|
|
}
|
||
|
|
`;i.getPrototypeOf=helper("7.0.0-beta.0")`
|
||
|
|
export default function _getPrototypeOf(o) {
|
||
|
|
_getPrototypeOf = Object.setPrototypeOf
|
||
|
|
? Object.getPrototypeOf.bind()
|
||
|
|
: function _getPrototypeOf(o) {
|
||
|
|
return o.__proto__ || Object.getPrototypeOf(o);
|
||
|
|
};
|
||
|
|
return _getPrototypeOf(o);
|
||
|
|
}
|
||
|
|
`;i.setPrototypeOf=helper("7.0.0-beta.0")`
|
||
|
|
export default function _setPrototypeOf(o, p) {
|
||
|
|
_setPrototypeOf = Object.setPrototypeOf
|
||
|
|
? Object.setPrototypeOf.bind()
|
||
|
|
: function _setPrototypeOf(o, p) {
|
||
|
|
o.__proto__ = p;
|
||
|
|
return o;
|
||
|
|
};
|
||
|
|
return _setPrototypeOf(o, p);
|
||
|
|
}
|
||
|
|
`;i.isNativeReflectConstruct=helper("7.9.0")`
|
||
|
|
export default function _isNativeReflectConstruct() {
|
||
|
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
||
|
|
|
||
|
|
// core-js@3
|
||
|
|
if (Reflect.construct.sham) return false;
|
||
|
|
|
||
|
|
// Proxy can't be polyfilled. Every browser implemented
|
||
|
|
// proxies before or at the same time as Reflect.construct,
|
||
|
|
// so if they support Proxy they also support Reflect.construct.
|
||
|
|
if (typeof Proxy === "function") return true;
|
||
|
|
|
||
|
|
// Since Reflect.construct can't be properly polyfilled, some
|
||
|
|
// implementations (e.g. core-js@2) don't set the correct internal slots.
|
||
|
|
// Those polyfills don't allow us to subclass built-ins, so we need to
|
||
|
|
// use our fallback implementation.
|
||
|
|
try {
|
||
|
|
// If the internal slots aren't set, this throws an error similar to
|
||
|
|
// TypeError: this is not a Boolean object.
|
||
|
|
|
||
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
||
|
|
return true;
|
||
|
|
} catch (e) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.construct=helper("7.0.0-beta.0")`
|
||
|
|
import setPrototypeOf from "setPrototypeOf";
|
||
|
|
import isNativeReflectConstruct from "isNativeReflectConstruct";
|
||
|
|
|
||
|
|
export default function _construct(Parent, args, Class) {
|
||
|
|
if (isNativeReflectConstruct()) {
|
||
|
|
_construct = Reflect.construct.bind();
|
||
|
|
} else {
|
||
|
|
// NOTE: If Parent !== Class, the correct __proto__ is set *after*
|
||
|
|
// calling the constructor.
|
||
|
|
_construct = function _construct(Parent, args, Class) {
|
||
|
|
var a = [null];
|
||
|
|
a.push.apply(a, args);
|
||
|
|
var Constructor = Function.bind.apply(Parent, a);
|
||
|
|
var instance = new Constructor();
|
||
|
|
if (Class) setPrototypeOf(instance, Class.prototype);
|
||
|
|
return instance;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
// Avoid issues with Class being present but undefined when it wasn't
|
||
|
|
// present in the original call.
|
||
|
|
return _construct.apply(null, arguments);
|
||
|
|
}
|
||
|
|
`;i.isNativeFunction=helper("7.0.0-beta.0")`
|
||
|
|
export default function _isNativeFunction(fn) {
|
||
|
|
// Note: This function returns "true" for core-js functions.
|
||
|
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
||
|
|
}
|
||
|
|
`;i.wrapNativeSuper=helper("7.0.0-beta.0")`
|
||
|
|
import getPrototypeOf from "getPrototypeOf";
|
||
|
|
import setPrototypeOf from "setPrototypeOf";
|
||
|
|
import isNativeFunction from "isNativeFunction";
|
||
|
|
import construct from "construct";
|
||
|
|
|
||
|
|
export default function _wrapNativeSuper(Class) {
|
||
|
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
||
|
|
|
||
|
|
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
||
|
|
if (Class === null || !isNativeFunction(Class)) return Class;
|
||
|
|
if (typeof Class !== "function") {
|
||
|
|
throw new TypeError("Super expression must either be null or a function");
|
||
|
|
}
|
||
|
|
if (typeof _cache !== "undefined") {
|
||
|
|
if (_cache.has(Class)) return _cache.get(Class);
|
||
|
|
_cache.set(Class, Wrapper);
|
||
|
|
}
|
||
|
|
function Wrapper() {
|
||
|
|
return construct(Class, arguments, getPrototypeOf(this).constructor)
|
||
|
|
}
|
||
|
|
Wrapper.prototype = Object.create(Class.prototype, {
|
||
|
|
constructor: {
|
||
|
|
value: Wrapper,
|
||
|
|
enumerable: false,
|
||
|
|
writable: true,
|
||
|
|
configurable: true,
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
return setPrototypeOf(Wrapper, Class);
|
||
|
|
}
|
||
|
|
|
||
|
|
return _wrapNativeSuper(Class)
|
||
|
|
}
|
||
|
|
`;i.instanceof=helper("7.0.0-beta.0")`
|
||
|
|
export default function _instanceof(left, right) {
|
||
|
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
||
|
|
return !!right[Symbol.hasInstance](left);
|
||
|
|
} else {
|
||
|
|
return left instanceof right;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.interopRequireDefault=helper("7.0.0-beta.0")`
|
||
|
|
export default function _interopRequireDefault(obj) {
|
||
|
|
return obj && obj.__esModule ? obj : { default: obj };
|
||
|
|
}
|
||
|
|
`;i.interopRequireWildcard=helper("7.14.0")`
|
||
|
|
function _getRequireWildcardCache(nodeInterop) {
|
||
|
|
if (typeof WeakMap !== "function") return null;
|
||
|
|
|
||
|
|
var cacheBabelInterop = new WeakMap();
|
||
|
|
var cacheNodeInterop = new WeakMap();
|
||
|
|
return (_getRequireWildcardCache = function (nodeInterop) {
|
||
|
|
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||
|
|
})(nodeInterop);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function _interopRequireWildcard(obj, nodeInterop) {
|
||
|
|
if (!nodeInterop && obj && obj.__esModule) {
|
||
|
|
return obj;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (obj === null || (typeof obj !== "object" && typeof obj !== "function")) {
|
||
|
|
return { default: obj }
|
||
|
|
}
|
||
|
|
|
||
|
|
var cache = _getRequireWildcardCache(nodeInterop);
|
||
|
|
if (cache && cache.has(obj)) {
|
||
|
|
return cache.get(obj);
|
||
|
|
}
|
||
|
|
|
||
|
|
var newObj = {};
|
||
|
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||
|
|
for (var key in obj) {
|
||
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||
|
|
var desc = hasPropertyDescriptor
|
||
|
|
? Object.getOwnPropertyDescriptor(obj, key)
|
||
|
|
: null;
|
||
|
|
if (desc && (desc.get || desc.set)) {
|
||
|
|
Object.defineProperty(newObj, key, desc);
|
||
|
|
} else {
|
||
|
|
newObj[key] = obj[key];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
newObj.default = obj;
|
||
|
|
if (cache) {
|
||
|
|
cache.set(obj, newObj);
|
||
|
|
}
|
||
|
|
return newObj;
|
||
|
|
}
|
||
|
|
`;i.newArrowCheck=helper("7.0.0-beta.0")`
|
||
|
|
export default function _newArrowCheck(innerThis, boundThis) {
|
||
|
|
if (innerThis !== boundThis) {
|
||
|
|
throw new TypeError("Cannot instantiate an arrow function");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.objectDestructuringEmpty=helper("7.0.0-beta.0")`
|
||
|
|
export default function _objectDestructuringEmpty(obj) {
|
||
|
|
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
||
|
|
}
|
||
|
|
`;i.objectWithoutPropertiesLoose=helper("7.0.0-beta.0")`
|
||
|
|
export default function _objectWithoutPropertiesLoose(source, excluded) {
|
||
|
|
if (source == null) return {};
|
||
|
|
|
||
|
|
var target = {};
|
||
|
|
var sourceKeys = Object.keys(source);
|
||
|
|
var key, i;
|
||
|
|
|
||
|
|
for (i = 0; i < sourceKeys.length; i++) {
|
||
|
|
key = sourceKeys[i];
|
||
|
|
if (excluded.indexOf(key) >= 0) continue;
|
||
|
|
target[key] = source[key];
|
||
|
|
}
|
||
|
|
|
||
|
|
return target;
|
||
|
|
}
|
||
|
|
`;i.objectWithoutProperties=helper("7.0.0-beta.0")`
|
||
|
|
import objectWithoutPropertiesLoose from "objectWithoutPropertiesLoose";
|
||
|
|
|
||
|
|
export default function _objectWithoutProperties(source, excluded) {
|
||
|
|
if (source == null) return {};
|
||
|
|
|
||
|
|
var target = objectWithoutPropertiesLoose(source, excluded);
|
||
|
|
var key, i;
|
||
|
|
|
||
|
|
if (Object.getOwnPropertySymbols) {
|
||
|
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
||
|
|
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
||
|
|
key = sourceSymbolKeys[i];
|
||
|
|
if (excluded.indexOf(key) >= 0) continue;
|
||
|
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
||
|
|
target[key] = source[key];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return target;
|
||
|
|
}
|
||
|
|
`;i.assertThisInitialized=helper("7.0.0-beta.0")`
|
||
|
|
export default function _assertThisInitialized(self) {
|
||
|
|
if (self === void 0) {
|
||
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
||
|
|
}
|
||
|
|
return self;
|
||
|
|
}
|
||
|
|
`;i.possibleConstructorReturn=helper("7.0.0-beta.0")`
|
||
|
|
import assertThisInitialized from "assertThisInitialized";
|
||
|
|
|
||
|
|
export default function _possibleConstructorReturn(self, call) {
|
||
|
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
||
|
|
return call;
|
||
|
|
} else if (call !== void 0) {
|
||
|
|
throw new TypeError("Derived constructors may only return object or undefined");
|
||
|
|
}
|
||
|
|
|
||
|
|
return assertThisInitialized(self);
|
||
|
|
}
|
||
|
|
`;i.createSuper=helper("7.9.0")`
|
||
|
|
import getPrototypeOf from "getPrototypeOf";
|
||
|
|
import isNativeReflectConstruct from "isNativeReflectConstruct";
|
||
|
|
import possibleConstructorReturn from "possibleConstructorReturn";
|
||
|
|
|
||
|
|
export default function _createSuper(Derived) {
|
||
|
|
var hasNativeReflectConstruct = isNativeReflectConstruct();
|
||
|
|
|
||
|
|
return function _createSuperInternal() {
|
||
|
|
var Super = getPrototypeOf(Derived), result;
|
||
|
|
if (hasNativeReflectConstruct) {
|
||
|
|
// NOTE: This doesn't work if this.__proto__.constructor has been modified.
|
||
|
|
var NewTarget = getPrototypeOf(this).constructor;
|
||
|
|
result = Reflect.construct(Super, arguments, NewTarget);
|
||
|
|
} else {
|
||
|
|
result = Super.apply(this, arguments);
|
||
|
|
}
|
||
|
|
return possibleConstructorReturn(this, result);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.superPropBase=helper("7.0.0-beta.0")`
|
||
|
|
import getPrototypeOf from "getPrototypeOf";
|
||
|
|
|
||
|
|
export default function _superPropBase(object, property) {
|
||
|
|
// Yes, this throws if object is null to being with, that's on purpose.
|
||
|
|
while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
||
|
|
object = getPrototypeOf(object);
|
||
|
|
if (object === null) break;
|
||
|
|
}
|
||
|
|
return object;
|
||
|
|
}
|
||
|
|
`;i.get=helper("7.0.0-beta.0")`
|
||
|
|
import superPropBase from "superPropBase";
|
||
|
|
|
||
|
|
export default function _get() {
|
||
|
|
if (typeof Reflect !== "undefined" && Reflect.get) {
|
||
|
|
_get = Reflect.get.bind();
|
||
|
|
} else {
|
||
|
|
_get = function _get(target, property, receiver) {
|
||
|
|
var base = superPropBase(target, property);
|
||
|
|
|
||
|
|
if (!base) return;
|
||
|
|
|
||
|
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
||
|
|
if (desc.get) {
|
||
|
|
// STEP 3. If receiver is not present, then set receiver to target.
|
||
|
|
return desc.get.call(arguments.length < 3 ? target : receiver);
|
||
|
|
}
|
||
|
|
|
||
|
|
return desc.value;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
return _get.apply(this, arguments);
|
||
|
|
}
|
||
|
|
`;i.set=helper("7.0.0-beta.0")`
|
||
|
|
import superPropBase from "superPropBase";
|
||
|
|
import defineProperty from "defineProperty";
|
||
|
|
|
||
|
|
function set(target, property, value, receiver) {
|
||
|
|
if (typeof Reflect !== "undefined" && Reflect.set) {
|
||
|
|
set = Reflect.set;
|
||
|
|
} else {
|
||
|
|
set = function set(target, property, value, receiver) {
|
||
|
|
var base = superPropBase(target, property);
|
||
|
|
var desc;
|
||
|
|
|
||
|
|
if (base) {
|
||
|
|
desc = Object.getOwnPropertyDescriptor(base, property);
|
||
|
|
if (desc.set) {
|
||
|
|
desc.set.call(receiver, value);
|
||
|
|
return true;
|
||
|
|
} else if (!desc.writable) {
|
||
|
|
// Both getter and non-writable fall into this.
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Without a super that defines the property, spec boils down to
|
||
|
|
// "define on receiver" for some reason.
|
||
|
|
desc = Object.getOwnPropertyDescriptor(receiver, property);
|
||
|
|
if (desc) {
|
||
|
|
if (!desc.writable) {
|
||
|
|
// Setter, getter, and non-writable fall into this.
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
desc.value = value;
|
||
|
|
Object.defineProperty(receiver, property, desc);
|
||
|
|
} else {
|
||
|
|
// Avoid setters that may be defined on Sub's prototype, but not on
|
||
|
|
// the instance.
|
||
|
|
defineProperty(receiver, property, value);
|
||
|
|
}
|
||
|
|
|
||
|
|
return true;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
return set(target, property, value, receiver);
|
||
|
|
}
|
||
|
|
|
||
|
|
export default function _set(target, property, value, receiver, isStrict) {
|
||
|
|
var s = set(target, property, value, receiver || target);
|
||
|
|
if (!s && isStrict) {
|
||
|
|
throw new TypeError('failed to set property');
|
||
|
|
}
|
||
|
|
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
`;i.taggedTemplateLiteral=helper("7.0.0-beta.0")`
|
||
|
|
export default function _taggedTemplateLiteral(strings, raw) {
|
||
|
|
if (!raw) { raw = strings.slice(0); }
|
||
|
|
return Object.freeze(Object.defineProperties(strings, {
|
||
|
|
raw: { value: Object.freeze(raw) }
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
`;i.taggedTemplateLiteralLoose=helper("7.0.0-beta.0")`
|
||
|
|
export default function _taggedTemplateLiteralLoose(strings, raw) {
|
||
|
|
if (!raw) { raw = strings.slice(0); }
|
||
|
|
strings.raw = raw;
|
||
|
|
return strings;
|
||
|
|
}
|
||
|
|
`;i.readOnlyError=helper("7.0.0-beta.0")`
|
||
|
|
export default function _readOnlyError(name) {
|
||
|
|
throw new TypeError("\\"" + name + "\\" is read-only");
|
||
|
|
}
|
||
|
|
`;i.writeOnlyError=helper("7.12.13")`
|
||
|
|
export default function _writeOnlyError(name) {
|
||
|
|
throw new TypeError("\\"" + name + "\\" is write-only");
|
||
|
|
}
|
||
|
|
`;i.classNameTDZError=helper("7.0.0-beta.0")`
|
||
|
|
export default function _classNameTDZError(name) {
|
||
|
|
throw new ReferenceError("Class \\"" + name + "\\" cannot be referenced in computed property keys.");
|
||
|
|
}
|
||
|
|
`;i.temporalUndefined=helper("7.0.0-beta.0")`
|
||
|
|
// This function isn't mean to be called, but to be used as a reference.
|
||
|
|
// We can't use a normal object because it isn't hoisted.
|
||
|
|
export default function _temporalUndefined() {}
|
||
|
|
`;i.tdz=helper("7.5.5")`
|
||
|
|
export default function _tdzError(name) {
|
||
|
|
throw new ReferenceError(name + " is not defined - temporal dead zone");
|
||
|
|
}
|
||
|
|
`;i.temporalRef=helper("7.0.0-beta.0")`
|
||
|
|
import undef from "temporalUndefined";
|
||
|
|
import err from "tdz";
|
||
|
|
|
||
|
|
export default function _temporalRef(val, name) {
|
||
|
|
return val === undef ? err(name) : val;
|
||
|
|
}
|
||
|
|
`;i.slicedToArray=helper("7.0.0-beta.0")`
|
||
|
|
import arrayWithHoles from "arrayWithHoles";
|
||
|
|
import iterableToArrayLimit from "iterableToArrayLimit";
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
import nonIterableRest from "nonIterableRest";
|
||
|
|
|
||
|
|
export default function _slicedToArray(arr, i) {
|
||
|
|
return (
|
||
|
|
arrayWithHoles(arr) ||
|
||
|
|
iterableToArrayLimit(arr, i) ||
|
||
|
|
unsupportedIterableToArray(arr, i) ||
|
||
|
|
nonIterableRest()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.slicedToArrayLoose=helper("7.0.0-beta.0")`
|
||
|
|
import arrayWithHoles from "arrayWithHoles";
|
||
|
|
import iterableToArrayLimitLoose from "iterableToArrayLimitLoose";
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
import nonIterableRest from "nonIterableRest";
|
||
|
|
|
||
|
|
export default function _slicedToArrayLoose(arr, i) {
|
||
|
|
return (
|
||
|
|
arrayWithHoles(arr) ||
|
||
|
|
iterableToArrayLimitLoose(arr, i) ||
|
||
|
|
unsupportedIterableToArray(arr, i) ||
|
||
|
|
nonIterableRest()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.toArray=helper("7.0.0-beta.0")`
|
||
|
|
import arrayWithHoles from "arrayWithHoles";
|
||
|
|
import iterableToArray from "iterableToArray";
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
import nonIterableRest from "nonIterableRest";
|
||
|
|
|
||
|
|
export default function _toArray(arr) {
|
||
|
|
return (
|
||
|
|
arrayWithHoles(arr) ||
|
||
|
|
iterableToArray(arr) ||
|
||
|
|
unsupportedIterableToArray(arr) ||
|
||
|
|
nonIterableRest()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.toConsumableArray=helper("7.0.0-beta.0")`
|
||
|
|
import arrayWithoutHoles from "arrayWithoutHoles";
|
||
|
|
import iterableToArray from "iterableToArray";
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
import nonIterableSpread from "nonIterableSpread";
|
||
|
|
|
||
|
|
export default function _toConsumableArray(arr) {
|
||
|
|
return (
|
||
|
|
arrayWithoutHoles(arr) ||
|
||
|
|
iterableToArray(arr) ||
|
||
|
|
unsupportedIterableToArray(arr) ||
|
||
|
|
nonIterableSpread()
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.arrayWithoutHoles=helper("7.0.0-beta.0")`
|
||
|
|
import arrayLikeToArray from "arrayLikeToArray";
|
||
|
|
|
||
|
|
export default function _arrayWithoutHoles(arr) {
|
||
|
|
if (Array.isArray(arr)) return arrayLikeToArray(arr);
|
||
|
|
}
|
||
|
|
`;i.arrayWithHoles=helper("7.0.0-beta.0")`
|
||
|
|
export default function _arrayWithHoles(arr) {
|
||
|
|
if (Array.isArray(arr)) return arr;
|
||
|
|
}
|
||
|
|
`;i.maybeArrayLike=helper("7.9.0")`
|
||
|
|
import arrayLikeToArray from "arrayLikeToArray";
|
||
|
|
|
||
|
|
export default function _maybeArrayLike(next, arr, i) {
|
||
|
|
if (arr && !Array.isArray(arr) && typeof arr.length === "number") {
|
||
|
|
var len = arr.length;
|
||
|
|
return arrayLikeToArray(arr, i !== void 0 && i < len ? i : len);
|
||
|
|
}
|
||
|
|
return next(arr, i);
|
||
|
|
}
|
||
|
|
`;i.iterableToArray=helper("7.0.0-beta.0")`
|
||
|
|
export default function _iterableToArray(iter) {
|
||
|
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
||
|
|
}
|
||
|
|
`;i.unsupportedIterableToArray=helper("7.9.0")`
|
||
|
|
import arrayLikeToArray from "arrayLikeToArray";
|
||
|
|
|
||
|
|
export default function _unsupportedIterableToArray(o, minLen) {
|
||
|
|
if (!o) return;
|
||
|
|
if (typeof o === "string") return arrayLikeToArray(o, minLen);
|
||
|
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
||
|
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
||
|
|
if (n === "Map" || n === "Set") return Array.from(o);
|
||
|
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
||
|
|
return arrayLikeToArray(o, minLen);
|
||
|
|
}
|
||
|
|
`;i.arrayLikeToArray=helper("7.9.0")`
|
||
|
|
export default function _arrayLikeToArray(arr, len) {
|
||
|
|
if (len == null || len > arr.length) len = arr.length;
|
||
|
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
||
|
|
return arr2;
|
||
|
|
}
|
||
|
|
`;i.nonIterableSpread=helper("7.0.0-beta.0")`
|
||
|
|
export default function _nonIterableSpread() {
|
||
|
|
throw new TypeError(
|
||
|
|
"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.nonIterableRest=helper("7.0.0-beta.0")`
|
||
|
|
export default function _nonIterableRest() {
|
||
|
|
throw new TypeError(
|
||
|
|
"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.createForOfIteratorHelper=helper("7.9.0")`
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
|
||
|
|
// s: start (create the iterator)
|
||
|
|
// n: next
|
||
|
|
// e: error (called whenever something throws)
|
||
|
|
// f: finish (always called at the end)
|
||
|
|
|
||
|
|
export default function _createForOfIteratorHelper(o, allowArrayLike) {
|
||
|
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
||
|
|
|
||
|
|
if (!it) {
|
||
|
|
// Fallback for engines without symbol support
|
||
|
|
if (
|
||
|
|
Array.isArray(o) ||
|
||
|
|
(it = unsupportedIterableToArray(o)) ||
|
||
|
|
(allowArrayLike && o && typeof o.length === "number")
|
||
|
|
) {
|
||
|
|
if (it) o = it;
|
||
|
|
var i = 0;
|
||
|
|
var F = function(){};
|
||
|
|
return {
|
||
|
|
s: F,
|
||
|
|
n: function() {
|
||
|
|
if (i >= o.length) return { done: true };
|
||
|
|
return { done: false, value: o[i++] };
|
||
|
|
},
|
||
|
|
e: function(e) { throw e; },
|
||
|
|
f: F,
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
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 normalCompletion = true, didErr = false, err;
|
||
|
|
|
||
|
|
return {
|
||
|
|
s: function() {
|
||
|
|
it = it.call(o);
|
||
|
|
},
|
||
|
|
n: function() {
|
||
|
|
var step = it.next();
|
||
|
|
normalCompletion = step.done;
|
||
|
|
return step;
|
||
|
|
},
|
||
|
|
e: function(e) {
|
||
|
|
didErr = true;
|
||
|
|
err = e;
|
||
|
|
},
|
||
|
|
f: function() {
|
||
|
|
try {
|
||
|
|
if (!normalCompletion && it.return != null) it.return();
|
||
|
|
} finally {
|
||
|
|
if (didErr) throw err;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
}
|
||
|
|
`;i.createForOfIteratorHelperLoose=helper("7.9.0")`
|
||
|
|
import unsupportedIterableToArray from "unsupportedIterableToArray";
|
||
|
|
|
||
|
|
export default function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
||
|
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
||
|
|
|
||
|
|
if (it) return (it = it.call(o)).next.bind(it);
|
||
|
|
|
||
|
|
// Fallback for engines without symbol support
|
||
|
|
if (
|
||
|
|
Array.isArray(o) ||
|
||
|
|
(it = unsupportedIterableToArray(o)) ||
|
||
|
|
(allowArrayLike && o && typeof o.length === "number")
|
||
|
|
) {
|
||
|
|
if (it) o = it;
|
||
|
|
var i = 0;
|
||
|
|
return function() {
|
||
|
|
if (i >= o.length) return { done: true };
|
||
|
|
return { done: false, value: o[i++] };
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
||
|
|
}
|
||
|
|
`;i.skipFirstGeneratorNext=helper("7.0.0-beta.0")`
|
||
|
|
export default function _skipFirstGeneratorNext(fn) {
|
||
|
|
return function () {
|
||
|
|
var it = fn.apply(this, arguments);
|
||
|
|
it.next();
|
||
|
|
return it;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.toPrimitive=helper("7.1.5")`
|
||
|
|
export default function _toPrimitive(
|
||
|
|
input,
|
||
|
|
hint /*: "default" | "string" | "number" | void */
|
||
|
|
) {
|
||
|
|
if (typeof input !== "object" || input === null) return input;
|
||
|
|
var prim = input[Symbol.toPrimitive];
|
||
|
|
if (prim !== undefined) {
|
||
|
|
var res = prim.call(input, hint || "default");
|
||
|
|
if (typeof res !== "object") return res;
|
||
|
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
||
|
|
}
|
||
|
|
return (hint === "string" ? String : Number)(input);
|
||
|
|
}
|
||
|
|
`;i.toPropertyKey=helper("7.1.5")`
|
||
|
|
import toPrimitive from "toPrimitive";
|
||
|
|
|
||
|
|
export default function _toPropertyKey(arg) {
|
||
|
|
var key = toPrimitive(arg, "string");
|
||
|
|
return typeof key === "symbol" ? key : String(key);
|
||
|
|
}
|
||
|
|
`;i.initializerWarningHelper=helper("7.0.0-beta.0")`
|
||
|
|
export default function _initializerWarningHelper(descriptor, context){
|
||
|
|
throw new Error(
|
||
|
|
'Decorating class property failed. Please ensure that ' +
|
||
|
|
'transform-class-properties is enabled and runs after the decorators transform.'
|
||
|
|
);
|
||
|
|
}
|
||
|
|
`;i.initializerDefineProperty=helper("7.0.0-beta.0")`
|
||
|
|
export default function _initializerDefineProperty(target, property, descriptor, context){
|
||
|
|
if (!descriptor) return;
|
||
|
|
|
||
|
|
Object.defineProperty(target, property, {
|
||
|
|
enumerable: descriptor.enumerable,
|
||
|
|
configurable: descriptor.configurable,
|
||
|
|
writable: descriptor.writable,
|
||
|
|
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,
|
||
|
|
});
|
||
|
|
}
|
||
|
|
`;i.applyDecoratedDescriptor=helper("7.0.0-beta.0")`
|
||
|
|
export default function _applyDecoratedDescriptor(target, property, decorators, descriptor, context){
|
||
|
|
var desc = {};
|
||
|
|
Object.keys(descriptor).forEach(function(key){
|
||
|
|
desc[key] = descriptor[key];
|
||
|
|
});
|
||
|
|
desc.enumerable = !!desc.enumerable;
|
||
|
|
desc.configurable = !!desc.configurable;
|
||
|
|
if ('value' in desc || desc.initializer){
|
||
|
|
desc.writable = true;
|
||
|
|
}
|
||
|
|
|
||
|
|
desc = decorators.slice().reverse().reduce(function(desc, decorator){
|
||
|
|
return decorator(target, property, desc) || desc;
|
||
|
|
}, desc);
|
||
|
|
|
||
|
|
if (context && desc.initializer !== void 0){
|
||
|
|
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
||
|
|
desc.initializer = undefined;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (desc.initializer === void 0){
|
||
|
|
Object.defineProperty(target, property, desc);
|
||
|
|
desc = null;
|
||
|
|
}
|
||
|
|
|
||
|
|
return desc;
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldLooseKey=helper("7.0.0-beta.0")`
|
||
|
|
var id = 0;
|
||
|
|
export default function _classPrivateFieldKey(name) {
|
||
|
|
return "__private_" + (id++) + "_" + name;
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldLooseBase=helper("7.0.0-beta.0")`
|
||
|
|
export default function _classPrivateFieldBase(receiver, privateKey) {
|
||
|
|
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
|
||
|
|
throw new TypeError("attempted to use private field on non-instance");
|
||
|
|
}
|
||
|
|
return receiver;
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldGet=helper("7.0.0-beta.0")`
|
||
|
|
import classApplyDescriptorGet from "classApplyDescriptorGet";
|
||
|
|
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
|
||
|
|
export default function _classPrivateFieldGet(receiver, privateMap) {
|
||
|
|
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "get");
|
||
|
|
return classApplyDescriptorGet(receiver, descriptor);
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldSet=helper("7.0.0-beta.0")`
|
||
|
|
import classApplyDescriptorSet from "classApplyDescriptorSet";
|
||
|
|
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
|
||
|
|
export default function _classPrivateFieldSet(receiver, privateMap, value) {
|
||
|
|
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
|
||
|
|
classApplyDescriptorSet(receiver, descriptor, value);
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldDestructureSet=helper("7.4.4")`
|
||
|
|
import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet";
|
||
|
|
import classExtractFieldDescriptor from "classExtractFieldDescriptor";
|
||
|
|
export default function _classPrivateFieldDestructureSet(receiver, privateMap) {
|
||
|
|
var descriptor = classExtractFieldDescriptor(receiver, privateMap, "set");
|
||
|
|
return classApplyDescriptorDestructureSet(receiver, descriptor);
|
||
|
|
}
|
||
|
|
`;i.classExtractFieldDescriptor=helper("7.13.10")`
|
||
|
|
export default function _classExtractFieldDescriptor(receiver, privateMap, action) {
|
||
|
|
if (!privateMap.has(receiver)) {
|
||
|
|
throw new TypeError("attempted to " + action + " private field on non-instance");
|
||
|
|
}
|
||
|
|
return privateMap.get(receiver);
|
||
|
|
}
|
||
|
|
`;i.classStaticPrivateFieldSpecGet=helper("7.0.2")`
|
||
|
|
import classApplyDescriptorGet from "classApplyDescriptorGet";
|
||
|
|
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
|
||
|
|
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
|
||
|
|
export default function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {
|
||
|
|
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||
|
|
classCheckPrivateStaticFieldDescriptor(descriptor, "get");
|
||
|
|
return classApplyDescriptorGet(receiver, descriptor);
|
||
|
|
}
|
||
|
|
`;i.classStaticPrivateFieldSpecSet=helper("7.0.2")`
|
||
|
|
import classApplyDescriptorSet from "classApplyDescriptorSet";
|
||
|
|
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
|
||
|
|
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
|
||
|
|
export default function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {
|
||
|
|
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||
|
|
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
|
||
|
|
classApplyDescriptorSet(receiver, descriptor, value);
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
`;i.classStaticPrivateMethodGet=helper("7.3.2")`
|
||
|
|
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
|
||
|
|
export default function _classStaticPrivateMethodGet(receiver, classConstructor, method) {
|
||
|
|
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||
|
|
return method;
|
||
|
|
}
|
||
|
|
`;i.classStaticPrivateMethodSet=helper("7.3.2")`
|
||
|
|
export default function _classStaticPrivateMethodSet() {
|
||
|
|
throw new TypeError("attempted to set read only static private field");
|
||
|
|
}
|
||
|
|
`;i.classApplyDescriptorGet=helper("7.13.10")`
|
||
|
|
export default function _classApplyDescriptorGet(receiver, descriptor) {
|
||
|
|
if (descriptor.get) {
|
||
|
|
return descriptor.get.call(receiver);
|
||
|
|
}
|
||
|
|
return descriptor.value;
|
||
|
|
}
|
||
|
|
`;i.classApplyDescriptorSet=helper("7.13.10")`
|
||
|
|
export default function _classApplyDescriptorSet(receiver, descriptor, value) {
|
||
|
|
if (descriptor.set) {
|
||
|
|
descriptor.set.call(receiver, value);
|
||
|
|
} else {
|
||
|
|
if (!descriptor.writable) {
|
||
|
|
// This should only throw in strict mode, but class bodies are
|
||
|
|
// always strict and private fields can only be used inside
|
||
|
|
// class bodies.
|
||
|
|
throw new TypeError("attempted to set read only private field");
|
||
|
|
}
|
||
|
|
descriptor.value = value;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.classApplyDescriptorDestructureSet=helper("7.13.10")`
|
||
|
|
export default function _classApplyDescriptorDestructureSet(receiver, descriptor) {
|
||
|
|
if (descriptor.set) {
|
||
|
|
if (!("__destrObj" in descriptor)) {
|
||
|
|
descriptor.__destrObj = {
|
||
|
|
set value(v) {
|
||
|
|
descriptor.set.call(receiver, v)
|
||
|
|
},
|
||
|
|
};
|
||
|
|
}
|
||
|
|
return descriptor.__destrObj;
|
||
|
|
} else {
|
||
|
|
if (!descriptor.writable) {
|
||
|
|
// This should only throw in strict mode, but class bodies are
|
||
|
|
// always strict and private fields can only be used inside
|
||
|
|
// class bodies.
|
||
|
|
throw new TypeError("attempted to set read only private field");
|
||
|
|
}
|
||
|
|
|
||
|
|
return descriptor;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.classStaticPrivateFieldDestructureSet=helper("7.13.10")`
|
||
|
|
import classApplyDescriptorDestructureSet from "classApplyDescriptorDestructureSet";
|
||
|
|
import classCheckPrivateStaticAccess from "classCheckPrivateStaticAccess";
|
||
|
|
import classCheckPrivateStaticFieldDescriptor from "classCheckPrivateStaticFieldDescriptor";
|
||
|
|
export default function _classStaticPrivateFieldDestructureSet(receiver, classConstructor, descriptor) {
|
||
|
|
classCheckPrivateStaticAccess(receiver, classConstructor);
|
||
|
|
classCheckPrivateStaticFieldDescriptor(descriptor, "set");
|
||
|
|
return classApplyDescriptorDestructureSet(receiver, descriptor);
|
||
|
|
}
|
||
|
|
`;i.classCheckPrivateStaticAccess=helper("7.13.10")`
|
||
|
|
export default function _classCheckPrivateStaticAccess(receiver, classConstructor) {
|
||
|
|
if (receiver !== classConstructor) {
|
||
|
|
throw new TypeError("Private static access of wrong provenance");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.classCheckPrivateStaticFieldDescriptor=helper("7.13.10")`
|
||
|
|
export default function _classCheckPrivateStaticFieldDescriptor(descriptor, action) {
|
||
|
|
if (descriptor === undefined) {
|
||
|
|
throw new TypeError("attempted to " + action + " private static field before its declaration");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.decorate=helper("7.1.5")`
|
||
|
|
import toArray from "toArray";
|
||
|
|
import toPropertyKey from "toPropertyKey";
|
||
|
|
|
||
|
|
// These comments are stripped by @babel/template
|
||
|
|
/*::
|
||
|
|
type PropertyDescriptor =
|
||
|
|
| {
|
||
|
|
value: any,
|
||
|
|
writable: boolean,
|
||
|
|
configurable: boolean,
|
||
|
|
enumerable: boolean,
|
||
|
|
}
|
||
|
|
| {
|
||
|
|
get?: () => any,
|
||
|
|
set?: (v: any) => void,
|
||
|
|
configurable: boolean,
|
||
|
|
enumerable: boolean,
|
||
|
|
};
|
||
|
|
|
||
|
|
type FieldDescriptor ={
|
||
|
|
writable: boolean,
|
||
|
|
configurable: boolean,
|
||
|
|
enumerable: boolean,
|
||
|
|
};
|
||
|
|
|
||
|
|
type Placement = "static" | "prototype" | "own";
|
||
|
|
type Key = string | symbol; // PrivateName is not supported yet.
|
||
|
|
|
||
|
|
type ElementDescriptor =
|
||
|
|
| {
|
||
|
|
kind: "method",
|
||
|
|
key: Key,
|
||
|
|
placement: Placement,
|
||
|
|
descriptor: PropertyDescriptor
|
||
|
|
}
|
||
|
|
| {
|
||
|
|
kind: "field",
|
||
|
|
key: Key,
|
||
|
|
placement: Placement,
|
||
|
|
descriptor: FieldDescriptor,
|
||
|
|
initializer?: () => any,
|
||
|
|
};
|
||
|
|
|
||
|
|
// This is exposed to the user code
|
||
|
|
type ElementObjectInput = ElementDescriptor & {
|
||
|
|
[@@toStringTag]?: "Descriptor"
|
||
|
|
};
|
||
|
|
|
||
|
|
// This is exposed to the user code
|
||
|
|
type ElementObjectOutput = ElementDescriptor & {
|
||
|
|
[@@toStringTag]?: "Descriptor"
|
||
|
|
extras?: ElementDescriptor[],
|
||
|
|
finisher?: ClassFinisher,
|
||
|
|
};
|
||
|
|
|
||
|
|
// This is exposed to the user code
|
||
|
|
type ClassObject = {
|
||
|
|
[@@toStringTag]?: "Descriptor",
|
||
|
|
kind: "class",
|
||
|
|
elements: ElementDescriptor[],
|
||
|
|
};
|
||
|
|
|
||
|
|
type ElementDecorator = (descriptor: ElementObjectInput) => ?ElementObjectOutput;
|
||
|
|
type ClassDecorator = (descriptor: ClassObject) => ?ClassObject;
|
||
|
|
type ClassFinisher = <A, B>(cl: Class<A>) => Class<B>;
|
||
|
|
|
||
|
|
// Only used by Babel in the transform output, not part of the spec.
|
||
|
|
type ElementDefinition =
|
||
|
|
| {
|
||
|
|
kind: "method",
|
||
|
|
value: any,
|
||
|
|
key: Key,
|
||
|
|
static?: boolean,
|
||
|
|
decorators?: ElementDecorator[],
|
||
|
|
}
|
||
|
|
| {
|
||
|
|
kind: "field",
|
||
|
|
value: () => any,
|
||
|
|
key: Key,
|
||
|
|
static?: boolean,
|
||
|
|
decorators?: ElementDecorator[],
|
||
|
|
};
|
||
|
|
|
||
|
|
declare function ClassFactory<C>(initialize: (instance: C) => void): {
|
||
|
|
F: Class<C>,
|
||
|
|
d: ElementDefinition[]
|
||
|
|
}
|
||
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
/*::
|
||
|
|
// Various combinations with/without extras and with one or many finishers
|
||
|
|
|
||
|
|
type ElementFinisherExtras = {
|
||
|
|
element: ElementDescriptor,
|
||
|
|
finisher?: ClassFinisher,
|
||
|
|
extras?: ElementDescriptor[],
|
||
|
|
};
|
||
|
|
|
||
|
|
type ElementFinishersExtras = {
|
||
|
|
element: ElementDescriptor,
|
||
|
|
finishers: ClassFinisher[],
|
||
|
|
extras: ElementDescriptor[],
|
||
|
|
};
|
||
|
|
|
||
|
|
type ElementsFinisher = {
|
||
|
|
elements: ElementDescriptor[],
|
||
|
|
finisher?: ClassFinisher,
|
||
|
|
};
|
||
|
|
|
||
|
|
type ElementsFinishers = {
|
||
|
|
elements: ElementDescriptor[],
|
||
|
|
finishers: ClassFinisher[],
|
||
|
|
};
|
||
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
/*::
|
||
|
|
|
||
|
|
type Placements = {
|
||
|
|
static: Key[],
|
||
|
|
prototype: Key[],
|
||
|
|
own: Key[],
|
||
|
|
};
|
||
|
|
|
||
|
|
*/
|
||
|
|
|
||
|
|
// ClassDefinitionEvaluation (Steps 26-*)
|
||
|
|
export default function _decorate(
|
||
|
|
decorators /*: ClassDecorator[] */,
|
||
|
|
factory /*: ClassFactory */,
|
||
|
|
superClass /*: ?Class<*> */,
|
||
|
|
mixins /*: ?Array<Function> */,
|
||
|
|
) /*: Class<*> */ {
|
||
|
|
var api = _getDecoratorsApi();
|
||
|
|
if (mixins) {
|
||
|
|
for (var i = 0; i < mixins.length; i++) {
|
||
|
|
api = mixins[i](api);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
var r = factory(function initialize(O) {
|
||
|
|
api.initializeInstanceElements(O, decorated.elements);
|
||
|
|
}, superClass);
|
||
|
|
var decorated = api.decorateClass(
|
||
|
|
_coalesceClassElements(r.d.map(_createElementDescriptor)),
|
||
|
|
decorators,
|
||
|
|
);
|
||
|
|
|
||
|
|
api.initializeClassElements(r.F, decorated.elements);
|
||
|
|
|
||
|
|
return api.runClassFinishers(r.F, decorated.finishers);
|
||
|
|
}
|
||
|
|
|
||
|
|
function _getDecoratorsApi() {
|
||
|
|
_getDecoratorsApi = function() {
|
||
|
|
return api;
|
||
|
|
};
|
||
|
|
|
||
|
|
var api = {
|
||
|
|
elementsDefinitionOrder: [["method"], ["field"]],
|
||
|
|
|
||
|
|
// InitializeInstanceElements
|
||
|
|
initializeInstanceElements: function(
|
||
|
|
/*::<C>*/ O /*: C */,
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
) {
|
||
|
|
["method", "field"].forEach(function(kind) {
|
||
|
|
elements.forEach(function(element /*: ElementDescriptor */) {
|
||
|
|
if (element.kind === kind && element.placement === "own") {
|
||
|
|
this.defineClassElement(O, element);
|
||
|
|
}
|
||
|
|
}, this);
|
||
|
|
}, this);
|
||
|
|
},
|
||
|
|
|
||
|
|
// InitializeClassElements
|
||
|
|
initializeClassElements: function(
|
||
|
|
/*::<C>*/ F /*: Class<C> */,
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
) {
|
||
|
|
var proto = F.prototype;
|
||
|
|
|
||
|
|
["method", "field"].forEach(function(kind) {
|
||
|
|
elements.forEach(function(element /*: ElementDescriptor */) {
|
||
|
|
var placement = element.placement;
|
||
|
|
if (
|
||
|
|
element.kind === kind &&
|
||
|
|
(placement === "static" || placement === "prototype")
|
||
|
|
) {
|
||
|
|
var receiver = placement === "static" ? F : proto;
|
||
|
|
this.defineClassElement(receiver, element);
|
||
|
|
}
|
||
|
|
}, this);
|
||
|
|
}, this);
|
||
|
|
},
|
||
|
|
|
||
|
|
// DefineClassElement
|
||
|
|
defineClassElement: function(
|
||
|
|
/*::<C>*/ receiver /*: C | Class<C> */,
|
||
|
|
element /*: ElementDescriptor */,
|
||
|
|
) {
|
||
|
|
var descriptor /*: PropertyDescriptor */ = element.descriptor;
|
||
|
|
if (element.kind === "field") {
|
||
|
|
var initializer = element.initializer;
|
||
|
|
descriptor = {
|
||
|
|
enumerable: descriptor.enumerable,
|
||
|
|
writable: descriptor.writable,
|
||
|
|
configurable: descriptor.configurable,
|
||
|
|
value: initializer === void 0 ? void 0 : initializer.call(receiver),
|
||
|
|
};
|
||
|
|
}
|
||
|
|
Object.defineProperty(receiver, element.key, descriptor);
|
||
|
|
},
|
||
|
|
|
||
|
|
// DecorateClass
|
||
|
|
decorateClass: function(
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
decorators /*: ClassDecorator[] */,
|
||
|
|
) /*: ElementsFinishers */ {
|
||
|
|
var newElements /*: ElementDescriptor[] */ = [];
|
||
|
|
var finishers /*: ClassFinisher[] */ = [];
|
||
|
|
var placements /*: Placements */ = {
|
||
|
|
static: [],
|
||
|
|
prototype: [],
|
||
|
|
own: [],
|
||
|
|
};
|
||
|
|
|
||
|
|
elements.forEach(function(element /*: ElementDescriptor */) {
|
||
|
|
this.addElementPlacement(element, placements);
|
||
|
|
}, this);
|
||
|
|
|
||
|
|
elements.forEach(function(element /*: ElementDescriptor */) {
|
||
|
|
if (!_hasDecorators(element)) return newElements.push(element);
|
||
|
|
|
||
|
|
var elementFinishersExtras /*: ElementFinishersExtras */ = this.decorateElement(
|
||
|
|
element,
|
||
|
|
placements,
|
||
|
|
);
|
||
|
|
newElements.push(elementFinishersExtras.element);
|
||
|
|
newElements.push.apply(newElements, elementFinishersExtras.extras);
|
||
|
|
finishers.push.apply(finishers, elementFinishersExtras.finishers);
|
||
|
|
}, this);
|
||
|
|
|
||
|
|
if (!decorators) {
|
||
|
|
return { elements: newElements, finishers: finishers };
|
||
|
|
}
|
||
|
|
|
||
|
|
var result /*: ElementsFinishers */ = this.decorateConstructor(
|
||
|
|
newElements,
|
||
|
|
decorators,
|
||
|
|
);
|
||
|
|
finishers.push.apply(finishers, result.finishers);
|
||
|
|
result.finishers = finishers;
|
||
|
|
|
||
|
|
return result;
|
||
|
|
},
|
||
|
|
|
||
|
|
// AddElementPlacement
|
||
|
|
addElementPlacement: function(
|
||
|
|
element /*: ElementDescriptor */,
|
||
|
|
placements /*: Placements */,
|
||
|
|
silent /*: boolean */,
|
||
|
|
) {
|
||
|
|
var keys = placements[element.placement];
|
||
|
|
if (!silent && keys.indexOf(element.key) !== -1) {
|
||
|
|
throw new TypeError("Duplicated element (" + element.key + ")");
|
||
|
|
}
|
||
|
|
keys.push(element.key);
|
||
|
|
},
|
||
|
|
|
||
|
|
// DecorateElement
|
||
|
|
decorateElement: function(
|
||
|
|
element /*: ElementDescriptor */,
|
||
|
|
placements /*: Placements */,
|
||
|
|
) /*: ElementFinishersExtras */ {
|
||
|
|
var extras /*: ElementDescriptor[] */ = [];
|
||
|
|
var finishers /*: ClassFinisher[] */ = [];
|
||
|
|
|
||
|
|
for (
|
||
|
|
var decorators = element.decorators, i = decorators.length - 1;
|
||
|
|
i >= 0;
|
||
|
|
i--
|
||
|
|
) {
|
||
|
|
// (inlined) RemoveElementPlacement
|
||
|
|
var keys = placements[element.placement];
|
||
|
|
keys.splice(keys.indexOf(element.key), 1);
|
||
|
|
|
||
|
|
var elementObject /*: ElementObjectInput */ = this.fromElementDescriptor(
|
||
|
|
element,
|
||
|
|
);
|
||
|
|
var elementFinisherExtras /*: ElementFinisherExtras */ = this.toElementFinisherExtras(
|
||
|
|
(0, decorators[i])(elementObject) /*: ElementObjectOutput */ ||
|
||
|
|
elementObject,
|
||
|
|
);
|
||
|
|
|
||
|
|
element = elementFinisherExtras.element;
|
||
|
|
this.addElementPlacement(element, placements);
|
||
|
|
|
||
|
|
if (elementFinisherExtras.finisher) {
|
||
|
|
finishers.push(elementFinisherExtras.finisher);
|
||
|
|
}
|
||
|
|
|
||
|
|
var newExtras /*: ElementDescriptor[] | void */ =
|
||
|
|
elementFinisherExtras.extras;
|
||
|
|
if (newExtras) {
|
||
|
|
for (var j = 0; j < newExtras.length; j++) {
|
||
|
|
this.addElementPlacement(newExtras[j], placements);
|
||
|
|
}
|
||
|
|
extras.push.apply(extras, newExtras);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return { element: element, finishers: finishers, extras: extras };
|
||
|
|
},
|
||
|
|
|
||
|
|
// DecorateConstructor
|
||
|
|
decorateConstructor: function(
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
decorators /*: ClassDecorator[] */,
|
||
|
|
) /*: ElementsFinishers */ {
|
||
|
|
var finishers /*: ClassFinisher[] */ = [];
|
||
|
|
|
||
|
|
for (var i = decorators.length - 1; i >= 0; i--) {
|
||
|
|
var obj /*: ClassObject */ = this.fromClassDescriptor(elements);
|
||
|
|
var elementsAndFinisher /*: ElementsFinisher */ = this.toClassDescriptor(
|
||
|
|
(0, decorators[i])(obj) /*: ClassObject */ || obj,
|
||
|
|
);
|
||
|
|
|
||
|
|
if (elementsAndFinisher.finisher !== undefined) {
|
||
|
|
finishers.push(elementsAndFinisher.finisher);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (elementsAndFinisher.elements !== undefined) {
|
||
|
|
elements = elementsAndFinisher.elements;
|
||
|
|
|
||
|
|
for (var j = 0; j < elements.length - 1; j++) {
|
||
|
|
for (var k = j + 1; k < elements.length; k++) {
|
||
|
|
if (
|
||
|
|
elements[j].key === elements[k].key &&
|
||
|
|
elements[j].placement === elements[k].placement
|
||
|
|
) {
|
||
|
|
throw new TypeError(
|
||
|
|
"Duplicated element (" + elements[j].key + ")",
|
||
|
|
);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return { elements: elements, finishers: finishers };
|
||
|
|
},
|
||
|
|
|
||
|
|
// FromElementDescriptor
|
||
|
|
fromElementDescriptor: function(
|
||
|
|
element /*: ElementDescriptor */,
|
||
|
|
) /*: ElementObject */ {
|
||
|
|
var obj /*: ElementObject */ = {
|
||
|
|
kind: element.kind,
|
||
|
|
key: element.key,
|
||
|
|
placement: element.placement,
|
||
|
|
descriptor: element.descriptor,
|
||
|
|
};
|
||
|
|
|
||
|
|
var desc = {
|
||
|
|
value: "Descriptor",
|
||
|
|
configurable: true,
|
||
|
|
};
|
||
|
|
Object.defineProperty(obj, Symbol.toStringTag, desc);
|
||
|
|
|
||
|
|
if (element.kind === "field") obj.initializer = element.initializer;
|
||
|
|
|
||
|
|
return obj;
|
||
|
|
},
|
||
|
|
|
||
|
|
// ToElementDescriptors
|
||
|
|
toElementDescriptors: function(
|
||
|
|
elementObjects /*: ElementObject[] */,
|
||
|
|
) /*: ElementDescriptor[] */ {
|
||
|
|
if (elementObjects === undefined) return;
|
||
|
|
return toArray(elementObjects).map(function(elementObject) {
|
||
|
|
var element = this.toElementDescriptor(elementObject);
|
||
|
|
this.disallowProperty(elementObject, "finisher", "An element descriptor");
|
||
|
|
this.disallowProperty(elementObject, "extras", "An element descriptor");
|
||
|
|
return element;
|
||
|
|
}, this);
|
||
|
|
},
|
||
|
|
|
||
|
|
// ToElementDescriptor
|
||
|
|
toElementDescriptor: function(
|
||
|
|
elementObject /*: ElementObject */,
|
||
|
|
) /*: ElementDescriptor */ {
|
||
|
|
var kind = String(elementObject.kind);
|
||
|
|
if (kind !== "method" && kind !== "field") {
|
||
|
|
throw new TypeError(
|
||
|
|
'An element descriptor\\'s .kind property must be either "method" or' +
|
||
|
|
' "field", but a decorator created an element descriptor with' +
|
||
|
|
' .kind "' +
|
||
|
|
kind +
|
||
|
|
'"',
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
var key = toPropertyKey(elementObject.key);
|
||
|
|
|
||
|
|
var placement = String(elementObject.placement);
|
||
|
|
if (
|
||
|
|
placement !== "static" &&
|
||
|
|
placement !== "prototype" &&
|
||
|
|
placement !== "own"
|
||
|
|
) {
|
||
|
|
throw new TypeError(
|
||
|
|
'An element descriptor\\'s .placement property must be one of "static",' +
|
||
|
|
' "prototype" or "own", but a decorator created an element descriptor' +
|
||
|
|
' with .placement "' +
|
||
|
|
placement +
|
||
|
|
'"',
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
var descriptor /*: PropertyDescriptor */ = elementObject.descriptor;
|
||
|
|
|
||
|
|
this.disallowProperty(elementObject, "elements", "An element descriptor");
|
||
|
|
|
||
|
|
var element /*: ElementDescriptor */ = {
|
||
|
|
kind: kind,
|
||
|
|
key: key,
|
||
|
|
placement: placement,
|
||
|
|
descriptor: Object.assign({}, descriptor),
|
||
|
|
};
|
||
|
|
|
||
|
|
if (kind !== "field") {
|
||
|
|
this.disallowProperty(elementObject, "initializer", "A method descriptor");
|
||
|
|
} else {
|
||
|
|
this.disallowProperty(
|
||
|
|
descriptor,
|
||
|
|
"get",
|
||
|
|
"The property descriptor of a field descriptor",
|
||
|
|
);
|
||
|
|
this.disallowProperty(
|
||
|
|
descriptor,
|
||
|
|
"set",
|
||
|
|
"The property descriptor of a field descriptor",
|
||
|
|
);
|
||
|
|
this.disallowProperty(
|
||
|
|
descriptor,
|
||
|
|
"value",
|
||
|
|
"The property descriptor of a field descriptor",
|
||
|
|
);
|
||
|
|
|
||
|
|
element.initializer = elementObject.initializer;
|
||
|
|
}
|
||
|
|
|
||
|
|
return element;
|
||
|
|
},
|
||
|
|
|
||
|
|
toElementFinisherExtras: function(
|
||
|
|
elementObject /*: ElementObject */,
|
||
|
|
) /*: ElementFinisherExtras */ {
|
||
|
|
var element /*: ElementDescriptor */ = this.toElementDescriptor(
|
||
|
|
elementObject,
|
||
|
|
);
|
||
|
|
var finisher /*: ClassFinisher */ = _optionalCallableProperty(
|
||
|
|
elementObject,
|
||
|
|
"finisher",
|
||
|
|
);
|
||
|
|
var extras /*: ElementDescriptors[] */ = this.toElementDescriptors(
|
||
|
|
elementObject.extras,
|
||
|
|
);
|
||
|
|
|
||
|
|
return { element: element, finisher: finisher, extras: extras };
|
||
|
|
},
|
||
|
|
|
||
|
|
// FromClassDescriptor
|
||
|
|
fromClassDescriptor: function(
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
) /*: ClassObject */ {
|
||
|
|
var obj = {
|
||
|
|
kind: "class",
|
||
|
|
elements: elements.map(this.fromElementDescriptor, this),
|
||
|
|
};
|
||
|
|
|
||
|
|
var desc = { value: "Descriptor", configurable: true };
|
||
|
|
Object.defineProperty(obj, Symbol.toStringTag, desc);
|
||
|
|
|
||
|
|
return obj;
|
||
|
|
},
|
||
|
|
|
||
|
|
// ToClassDescriptor
|
||
|
|
toClassDescriptor: function(
|
||
|
|
obj /*: ClassObject */,
|
||
|
|
) /*: ElementsFinisher */ {
|
||
|
|
var kind = String(obj.kind);
|
||
|
|
if (kind !== "class") {
|
||
|
|
throw new TypeError(
|
||
|
|
'A class descriptor\\'s .kind property must be "class", but a decorator' +
|
||
|
|
' created a class descriptor with .kind "' +
|
||
|
|
kind +
|
||
|
|
'"',
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
this.disallowProperty(obj, "key", "A class descriptor");
|
||
|
|
this.disallowProperty(obj, "placement", "A class descriptor");
|
||
|
|
this.disallowProperty(obj, "descriptor", "A class descriptor");
|
||
|
|
this.disallowProperty(obj, "initializer", "A class descriptor");
|
||
|
|
this.disallowProperty(obj, "extras", "A class descriptor");
|
||
|
|
|
||
|
|
var finisher = _optionalCallableProperty(obj, "finisher");
|
||
|
|
var elements = this.toElementDescriptors(obj.elements);
|
||
|
|
|
||
|
|
return { elements: elements, finisher: finisher };
|
||
|
|
},
|
||
|
|
|
||
|
|
// RunClassFinishers
|
||
|
|
runClassFinishers: function(
|
||
|
|
constructor /*: Class<*> */,
|
||
|
|
finishers /*: ClassFinisher[] */,
|
||
|
|
) /*: Class<*> */ {
|
||
|
|
for (var i = 0; i < finishers.length; i++) {
|
||
|
|
var newConstructor /*: ?Class<*> */ = (0, finishers[i])(constructor);
|
||
|
|
if (newConstructor !== undefined) {
|
||
|
|
// NOTE: This should check if IsConstructor(newConstructor) is false.
|
||
|
|
if (typeof newConstructor !== "function") {
|
||
|
|
throw new TypeError("Finishers must return a constructor.");
|
||
|
|
}
|
||
|
|
constructor = newConstructor;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return constructor;
|
||
|
|
},
|
||
|
|
|
||
|
|
disallowProperty: function(obj, name, objectType) {
|
||
|
|
if (obj[name] !== undefined) {
|
||
|
|
throw new TypeError(objectType + " can't have a ." + name + " property.");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
return api;
|
||
|
|
}
|
||
|
|
|
||
|
|
// ClassElementEvaluation
|
||
|
|
function _createElementDescriptor(
|
||
|
|
def /*: ElementDefinition */,
|
||
|
|
) /*: ElementDescriptor */ {
|
||
|
|
var key = toPropertyKey(def.key);
|
||
|
|
|
||
|
|
var descriptor /*: PropertyDescriptor */;
|
||
|
|
if (def.kind === "method") {
|
||
|
|
descriptor = {
|
||
|
|
value: def.value,
|
||
|
|
writable: true,
|
||
|
|
configurable: true,
|
||
|
|
enumerable: false,
|
||
|
|
};
|
||
|
|
} else if (def.kind === "get") {
|
||
|
|
descriptor = { get: def.value, configurable: true, enumerable: false };
|
||
|
|
} else if (def.kind === "set") {
|
||
|
|
descriptor = { set: def.value, configurable: true, enumerable: false };
|
||
|
|
} else if (def.kind === "field") {
|
||
|
|
descriptor = { configurable: true, writable: true, enumerable: true };
|
||
|
|
}
|
||
|
|
|
||
|
|
var element /*: ElementDescriptor */ = {
|
||
|
|
kind: def.kind === "field" ? "field" : "method",
|
||
|
|
key: key,
|
||
|
|
placement: def.static
|
||
|
|
? "static"
|
||
|
|
: def.kind === "field"
|
||
|
|
? "own"
|
||
|
|
: "prototype",
|
||
|
|
descriptor: descriptor,
|
||
|
|
};
|
||
|
|
if (def.decorators) element.decorators = def.decorators;
|
||
|
|
if (def.kind === "field") element.initializer = def.value;
|
||
|
|
|
||
|
|
return element;
|
||
|
|
}
|
||
|
|
|
||
|
|
// CoalesceGetterSetter
|
||
|
|
function _coalesceGetterSetter(
|
||
|
|
element /*: ElementDescriptor */,
|
||
|
|
other /*: ElementDescriptor */,
|
||
|
|
) {
|
||
|
|
if (element.descriptor.get !== undefined) {
|
||
|
|
other.descriptor.get = element.descriptor.get;
|
||
|
|
} else {
|
||
|
|
other.descriptor.set = element.descriptor.set;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// CoalesceClassElements
|
||
|
|
function _coalesceClassElements(
|
||
|
|
elements /*: ElementDescriptor[] */,
|
||
|
|
) /*: ElementDescriptor[] */ {
|
||
|
|
var newElements /*: ElementDescriptor[] */ = [];
|
||
|
|
|
||
|
|
var isSameElement = function(
|
||
|
|
other /*: ElementDescriptor */,
|
||
|
|
) /*: boolean */ {
|
||
|
|
return (
|
||
|
|
other.kind === "method" &&
|
||
|
|
other.key === element.key &&
|
||
|
|
other.placement === element.placement
|
||
|
|
);
|
||
|
|
};
|
||
|
|
|
||
|
|
for (var i = 0; i < elements.length; i++) {
|
||
|
|
var element /*: ElementDescriptor */ = elements[i];
|
||
|
|
var other /*: ElementDescriptor */;
|
||
|
|
|
||
|
|
if (
|
||
|
|
element.kind === "method" &&
|
||
|
|
(other = newElements.find(isSameElement))
|
||
|
|
) {
|
||
|
|
if (
|
||
|
|
_isDataDescriptor(element.descriptor) ||
|
||
|
|
_isDataDescriptor(other.descriptor)
|
||
|
|
) {
|
||
|
|
if (_hasDecorators(element) || _hasDecorators(other)) {
|
||
|
|
throw new ReferenceError(
|
||
|
|
"Duplicated methods (" + element.key + ") can't be decorated.",
|
||
|
|
);
|
||
|
|
}
|
||
|
|
other.descriptor = element.descriptor;
|
||
|
|
} else {
|
||
|
|
if (_hasDecorators(element)) {
|
||
|
|
if (_hasDecorators(other)) {
|
||
|
|
throw new ReferenceError(
|
||
|
|
"Decorators can't be placed on different accessors with for " +
|
||
|
|
"the same property (" +
|
||
|
|
element.key +
|
||
|
|
").",
|
||
|
|
);
|
||
|
|
}
|
||
|
|
other.decorators = element.decorators;
|
||
|
|
}
|
||
|
|
_coalesceGetterSetter(element, other);
|
||
|
|
}
|
||
|
|
} else {
|
||
|
|
newElements.push(element);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return newElements;
|
||
|
|
}
|
||
|
|
|
||
|
|
function _hasDecorators(element /*: ElementDescriptor */) /*: boolean */ {
|
||
|
|
return element.decorators && element.decorators.length;
|
||
|
|
}
|
||
|
|
|
||
|
|
function _isDataDescriptor(desc /*: PropertyDescriptor */) /*: boolean */ {
|
||
|
|
return (
|
||
|
|
desc !== undefined &&
|
||
|
|
!(desc.value === undefined && desc.writable === undefined)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
function _optionalCallableProperty /*::<T>*/(
|
||
|
|
obj /*: T */,
|
||
|
|
name /*: $Keys<T> */,
|
||
|
|
) /*: ?Function */ {
|
||
|
|
var value = obj[name];
|
||
|
|
if (value !== undefined && typeof value !== "function") {
|
||
|
|
throw new TypeError("Expected '" + name + "' to be a function");
|
||
|
|
}
|
||
|
|
return value;
|
||
|
|
}
|
||
|
|
|
||
|
|
`;i.classPrivateMethodGet=helper("7.1.6")`
|
||
|
|
export default function _classPrivateMethodGet(receiver, privateSet, fn) {
|
||
|
|
if (!privateSet.has(receiver)) {
|
||
|
|
throw new TypeError("attempted to get private field on non-instance");
|
||
|
|
}
|
||
|
|
return fn;
|
||
|
|
}
|
||
|
|
`;i.checkPrivateRedeclaration=helper("7.14.1")`
|
||
|
|
export default function _checkPrivateRedeclaration(obj, privateCollection) {
|
||
|
|
if (privateCollection.has(obj)) {
|
||
|
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
`;i.classPrivateFieldInitSpec=helper("7.14.1")`
|
||
|
|
import checkPrivateRedeclaration from "checkPrivateRedeclaration";
|
||
|
|
|
||
|
|
export default function _classPrivateFieldInitSpec(obj, privateMap, value) {
|
||
|
|
checkPrivateRedeclaration(obj, privateMap);
|
||
|
|
privateMap.set(obj, value);
|
||
|
|
}
|
||
|
|
`;i.classPrivateMethodInitSpec=helper("7.14.1")`
|
||
|
|
import checkPrivateRedeclaration from "checkPrivateRedeclaration";
|
||
|
|
|
||
|
|
export default function _classPrivateMethodInitSpec(obj, privateSet) {
|
||
|
|
checkPrivateRedeclaration(obj, privateSet);
|
||
|
|
privateSet.add(obj);
|
||
|
|
}
|
||
|
|
`;{i.classPrivateMethodSet=helper("7.1.6")`
|
||
|
|
export default function _classPrivateMethodSet() {
|
||
|
|
throw new TypeError("attempted to reassign private method");
|
||
|
|
}
|
||
|
|
`}i.identity=helper("7.17.0")`
|
||
|
|
export default function _identity(x) {
|
||
|
|
return x;
|
||
|
|
}
|
||
|
|
`;i.nullishReceiverError=helper("7.22.6")`
|
||
|
|
export default function _nullishReceiverError(r) {
|
||
|
|
throw new TypeError("Cannot set property of null or undefined.");
|
||
|
|
}
|
||
|
|
`},1416:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=void 0;t.ensure=ensure;t.get=get;t.getDependencies=getDependencies;t.list=void 0;t.minVersion=minVersion;var n=r(2297);var s=r(776);var i=r(5095);const{assignmentExpression:a,cloneNode:o,expressionStatement:l,file:c,identifier:u}=s;function makePath(e){const t=[];for(;e.parentPath;e=e.parentPath){t.push(e.key);if(e.inList)t.push(e.listKey)}return t.reverse().join(".")}let p=undefined;function getHelperMetadata(e){const t=new Set;const r=new Set;const s=new Map;let a;let o;const l=[];const c=[];const u=[];const p={ImportDeclaration(e){const t=e.node.source.value;if(!i.default[t]){throw e.buildCodeFrameError(`Unknown helper ${t}`)}if(e.get("specifiers").length!==1||!e.get("specifiers.0").isImportDefaultSpecifier()){throw e.buildCodeFrameError("Helpers can only import a default value")}const r=e.node.specifiers[0].local;s.set(r,t);c.push(makePath(e))},ExportDefaultDeclaration(e){const t=e.get("declaration");if(!t.isFunctionDeclaration()||!t.node.id){throw t.buildCodeFrameError("Helpers can only export named function declarations")}a=t.node.id.name;o=makePath(e)},ExportAllDeclaration(e){throw e.buildCodeFrameError("Helpers can only export default")},ExportNamedDeclaration(e){throw e.buildCodeFrameError("Helpers can only export default")},Statement(e){if(e.isImportDeclaration()||e.isExportDeclaration())return;e.skip()}};const f={Program(e){const t=e.scope.getAllBindings();Object.keys(t).forEach((e=>{if(e===a)return;if(s.has(t[e].identifier))return;r.add(e)}))},ReferencedIdentifier(e){const r=e.node.name;const n=e.scope.getBinding(r);if(!n){t.add(r)}else if(s.has(n.identifier)){u.push(makePath(e))}},AssignmentExpression(e){const t=e.get("left");if(!(a in t.getBindingIdentifiers()))return;if(!t.isIdentifier()){throw t.buildCodeFrameError("Only simple assignments to exports are allowed in helpers")}const r=e.scope.getBinding(a);if(r!=null&&r.scope.path.isProgram()){l.push(makePath(e))}}};(0,n.default)(e.ast,p,e.scope);(0,n.default)(e.ast,f,e.scope);if(!o)throw new Error("Helpers must have a default export.");l.reverse();return{globals:Array.from(t),localBindingNames:Array.from(r),dependencies:s,exportBindingAssignments:l,exportPath:o,exportName:a,importBindingsReferences:u,importPaths:c}}function permuteHelperAST(e,t,r,n,s){if(n&&!r){throw new Error("Unexpected local bindings for module-based helpers.")}if(!r)return;const{localBindingNames:i,dependencies:c,exportBindingAssignments:p,exportPath:f,exportName:d,importBindingsReferences:h,importPaths:m}=t;const y={};c.forEach(((e,t)=>{y[t.name]=typeof s==="function"&&s(e)||t}));const g={};const b=new Set(n||[]);i.forEach((e=>{let t=e;while(b.has(t))t="_"+t;if(t!==e)g[e]=t}));if(r.type==="Identifier"&&d!==r.name){g[d]=r.name}const{path:T}=e;const S=T.get(f);const E=m.map((e=>T.get(e)));const x=h.map((e=>T.get(e)));const v=S.get("declaration");if(r.type==="Identifier"){S.replaceWith(v)}else if(r.type==="MemberExpression"){p.forEach((e=>{const t=T.get(e);t.replaceWith(a("=",r,t.node))}));S.replaceWith(v);T.pushContainer("body",l(a("=",r,u(d))))}else{throw new Error("Unexpected helper format.")}Object.keys(g).forEach((e=>{T.scope.rename(e,g[e])}));for(const e of E)e.remove();for(const e of x){const t=o(y[e.node.name]);e.replaceWith(t)}}const f=Object.create(null);function loadHelper(e){if(!f[e]){const t=i.default[e];if(!t){throw Object.assign(new ReferenceError(`Unknown helper ${e}`),{code:"BABEL_HELPER_UNKNOWN",helper:e})}const fn=()=>{{if(!p){const e={ast:c(t.ast()),path:null};(0,n.default)(e.ast,{Program:t=>(e.path=t).stop()});return e}}return new p({filename:`babel-helper://${e}`},{ast:c(t.ast()),code:"[internal Babel helper code]",inputMap:null})};let r=null;f[e]={minVersion:t.minVersion,build(e,t,n){const s=fn();r||(r=getHelperMetadata(s));permuteHelperAST(s,r,t,n,e);return{nodes:s.ast.program.body,globals:r.globals}},getDependencies(){r||(r=getHelperMetadata(fn()));return Array.from(r.dependencies.values())}}}return f[e]}function get(e,t,r,n){return loadHelper(e).build(t,r,n)}function
|
||
|
|
(function(){
|
||
|
|
throw new Error(
|
||
|
|
"The CommonJS '" + "${e}" + "' variable is not available in ES6 modules." +
|
||
|
|
"Consider setting setting sourceType:script or sourceType:unambiguous in your " +
|
||
|
|
"Babel config for this file.");
|
||
|
|
})()
|
||
|
|
`;const x={ReferencedIdentifier(e){const t=e.node.name;if(t!=="module"&&t!=="exports")return;const r=e.scope.getBinding(t);const n=this.scope.getBinding(t);if(n!==r||e.parentPath.isObjectProperty({value:e.node})&&e.parentPath.parentPath.isObjectPattern()||e.parentPath.isAssignmentExpression({left:e.node})||e.isAssignmentExpression({left:e.node})){return}e.replaceWith(getAssertion(t))},UpdateExpression(e){const t=e.get("argument");if(!t.isIdentifier())return;const r=t.node.name;if(r!=="module"&&r!=="exports")return;const n=e.scope.getBinding(r);const s=this.scope.getBinding(r);if(s!==n)return;e.replaceWith(a.types.assignmentExpression(e.node.operator[0]+"=",t.node,getAssertion(r)))},AssignmentExpression(e){const t=e.get("left");if(t.isIdentifier()){const r=t.node.name;if(r!=="module"&&r!=="exports")return;const n=e.scope.getBinding(r);const s=this.scope.getBinding(r);if(s!==n)return;const i=e.get("right");i.replaceWith(a.types.sequenceExpression([i.node,getAssertion(r)]))}else if(t.isPattern()){const r=t.getOuterBindingIdentifiers();const n=Object.keys(r).filter((t=>{if(t!=="module"&&t!=="exports")return false;return this.scope.getBinding(t)===e.scope.getBinding(t)}))[0];if(n){const t=e.get("right");t.replaceWith(a.types.sequenceExpression([t.node,getAssertion(n)]))}}}};return{name:"transform-modules-commonjs",pre(){this.file.set("@babel/plugin-transform-modules-*","commonjs")},visitor:{CallExpression(e){if(!this.file.has("@babel/plugin-proposal-dynamic-import"))return;if(!a.types.isImport(e.node.callee))return;let{scope:t}=e;do{t.rename("require")}while(t=t.parent);(0,o.transformDynamicImport)(e,h,this.file)},Program:{exit(e,r){if(!(0,s.isModule)(e))return;e.scope.rename("exports");e.scope.rename("module");e.scope.rename("require");e.scope.rename("__filename");e.scope.rename("__dirname");if(!g){{(0,i.default)(e,new Set(["module","exports"]),false)}e.traverse(x,{scope:e.scope})}let n=(0,s.getModuleName)(this.file.opts,t);if(n)n=a.types.stringLiteral(n);const{meta:o,headers:l}=(0,s.rewriteModuleStatementsAndPrepareHeader)(e,{exportName:"exports",constantReexports:T,enumerableModuleMeta:S,strict:f,strictMode:d,allowTopLevelThis:p,noInterop:h,importInterop:m,lazy:y,esNamespaceOnly:typeof r.filename==="string"&&/\.mjs$/.test(r.filename)?u:c,noIncompleteNsImportDetection:E,filename:this.file.opts.filename});for(const[t,r]of o.source){const n=a.types.callExpression(a.types.identifier("require"),[a.types.stringLiteral(t)]);let i;if((0,s.isSideEffectImport)(r)){if(r.lazy)throw new Error("Assertion failure");i=a.types.expressionStatement(n)}else{if(r.lazy&&!r.referenced){continue}const t=(0,s.wrapInterop)(e,n,r.interop)||n;if(r.lazy){i=a.template.statement.ast`
|
||
|
|
function ${r.name}() {
|
||
|
|
const data = ${t};
|
||
|
|
${r.name} = function(){ return data; };
|
||
|
|
return data;
|
||
|
|
}
|
||
|
|
`}else{i=a.template.statement.ast`
|
||
|
|
var ${r.name} = ${t};
|
||
|
|
`}}i.loc=r.loc;l.push(i);l.push(...(0,s.buildNamespaceInitStatements)(o,r,T))}(0,s.ensureStatementsHoisted)(l);e.unshiftContainer("body",l);e.get("body").forEach((e=>{if(l.indexOf(e.node)===-1)return;if(e.isVariableDeclaration()){e.scope.registerDeclaration(e)}}))}}}}}));t["default"]=l},6969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=transpileConstEnum;var n=r(7812);function transpileConstEnum(e,t){const{name:r}=e.node.id;const s=e.parentPath.isExportNamedDeclaration();let i=s;if(!i&&t.isProgram(e.parent)){i=e.parent.body.some((e=>t.isExportNamedDeclaration(e)&&e.exportKind!=="type"&&!e.source&&e.specifiers.some((e=>t.isExportSpecifier(e)&&e.exportKind!=="type"&&e.local.name===r))))}const{enumValues:a}=(0,n.translateEnumValues)(e,t);if(i){const n=t.objectExpression(a.map((([e,r])=>t.objectProperty(t.isValidIdentifier(e)?t.identifier(e):t.stringLiteral(e),r))));if(e.scope.hasOwnBinding(r)){(s?e.parentPath:e).replaceWith(t.expressionStatement(t.callExpression(t.memberExpression(t.identifier("Object"),t.identifier("assign")),[e.node.id,n])))}else{e.replaceWith(t.variableDeclaration("var",[t.variableDeclarator(e.node.id,n)]));e.scope.registerDeclaration(e)}return}const o=new Map(a);e.scope.path.traverse({Scope(e){if(e.scope.hasOwnBinding(r))e.skip()},MemberExpression(e){if(!t.isIdentifier(e.node.object,{name:r}))return;let n;if(e.node.computed){if(t.isStringLiteral(e.node.property)){n=e.node.property.value}else{return}}else if(t.isIdentifier(e.node.property)){n=e.node.property.name}else{return}if(!o.has(n))return;e.replaceWith(t.cloneNode(o.get(n)))}});e.remove()}},7812:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=transpileEnum;t.translateEnumValues=translateEnumValues;var n=r(3688);var s=r(9491);var i=r(365);const a=new WeakMap;const o=n.template.expression(`\n (function (ID) {\n ASSIGNMENTS;\n return ID;\n })(INIT)\n `);function transpileEnum(e,t){const{node:r,parentPath:n}=e;if(r.declare){e.remove();return}const s=r.id.name;const{fill:l,data:c,isPure:u}=enumFill(e,t,r.id);switch(n.type){case"BlockStatement":case"ExportNamedDeclaration":case"Program":{const p=t.isProgram(e.parent);const f=seen(n);let d=t.objectExpression([]);if(f||p){d=t.logicalExpression("||",t.cloneNode(l.ID),d)}const h=o(Object.assign({},l,{INIT:d}));if(u)(0,i.default)(h);if(f){const s=n.isExportDeclaration()?n:e;s.replaceWith(t.expressionStatement(t.assignmentExpression("=",t.cloneNode(r.id),h)))}else{e.scope.registerDeclaration(e.replaceWith(t.variableDeclaration(p?"var":"let",[t.variableDeclarator(r.id,h)]))[0])}a.set(e.scope.getBindingIdentifier(s),c);break}default:throw new Error(`Unexpected enum parent '${e.parent.type}`)}function seen(e){if(e.isExportDeclaration()){return seen(e.parentPath)}if(e.getData(s)){return true}else{e.setData(s,true);return false}}}const l=(0,n.template)(`\n ENUM["NAME"] = VALUE;\n`);const c=(0,n.template)(`\n ENUM[ENUM["NAME"] = VALUE] = "NAME";\n`);const buildEnumMember=(e,t)=>(e?l:c)(t);function enumFill(e,t,r){const{enumValues:n,data:s,isPure:i}=translateEnumValues(e,t);const a=n.map((([e,n])=>buildEnumMember(t.isStringLiteral(n),{ENUM:t.cloneNode(r),NAME:e,VALUE:n})));return{fill:{ID:t.cloneNode(r),ASSIGNMENTS:a},data:s,isPure:i}}function ReferencedIdentifier(e,t){const{seen:r,path:n,t:s}=t;const i=e.node.name;if(r.has(i)&&!e.scope.hasOwnBinding(i)){e.replaceWith(s.memberExpression(s.cloneNode(n.node.id),s.cloneNode(e.node)));e.skip()}}const u={ReferencedIdentifier:ReferencedIdentifier};function translateEnumValues(e,t){const r=new Map;let n=-1;let i;let a=true;const o=e.get("members").map((o=>{const l=o.node;const c=t.isIdentifier(l.id)?l.id.name:l.id.value;const p=o.get("initializer");const f=l.initializer;let d;if(f){n=computeConstantValue(p,r);if(n!==undefined){r.set(c,n);s(typeof n==="number"||typeof n==="string");if(n===Infinity||Number.isNaN(n)){d=t.identifier(String(n))}else if(n===-Infinity){d=t.unaryExpression("-",t.identifier("Infinity"))}else{d=t.valueToNode(n)}}else{a&&(a=p.isPure());
|
||
|
|
this.${r.cloneNode(o)} = ${r.cloneNode(o)}`);t.replaceWith(t.get("parameter"));a.registerBinding("param",t)}}(0,i.injectInitialization)(t,e,s)}};return{name:"transform-typescript",inherits:s.default,visitor:{Pattern:visitPattern,Identifier:visitPattern,RestElement:visitPattern,Program:{enter(e,t){const{file:r}=t;let n=null;let s=null;const i=e.scope;if(!c.has(i)){c.set(i,new Set)}if(r.ast.comments){for(const e of r.ast.comments){const t=f.exec(e.value);if(t){if(t[1]){s=t[2]}else{n=t[2]}}}}let a=n||h;if(a){[a]=a.split(".")}let o=s||m;if(o){[o]=o.split(".")}for(let r of e.get("body")){if(r.isImportDeclaration()){if(!u.has(t.file.ast.program)){u.set(t.file.ast.program,true)}if(r.node.importKind==="type"){for(const e of r.node.specifiers){registerGlobalType(i,e.local.name)}r.remove();continue}const n=new Set;const s=r.node.specifiers.length;const isAllSpecifiersElided=()=>s>0&&s===n.size;for(const e of r.node.specifiers){if(e.type==="ImportSpecifier"&&e.importKind==="type"){registerGlobalType(i,e.local.name);const t=r.scope.getBinding(e.local.name);if(t){n.add(t.path)}}}if(y){u.set(e.node,false)}else{if(r.node.specifiers.length===0){u.set(e.node,false);continue}for(const t of r.node.specifiers){const s=r.scope.getBinding(t.local.name);if(s&&!n.has(s.path)){if(isImportTypeOnly({binding:s,programPath:e,pragmaImportName:a,pragmaFragImportName:o})){n.add(s.path)}else{u.set(e.node,false)}}}}if(isAllSpecifiersElided()&&!y){r.remove()}else{for(const e of n){e.remove()}}continue}if(r.isExportDeclaration()){r=r.get("declaration")}if(r.isVariableDeclaration({declare:true})){for(const e of Object.keys(r.getBindingIdentifiers())){registerGlobalType(i,e)}}else if(r.isTSTypeAliasDeclaration()||r.isTSDeclareFunction()&&r.get("id").isIdentifier()||r.isTSInterfaceDeclaration()||r.isClassDeclaration({declare:true})||r.isTSEnumDeclaration({declare:true})||r.isTSModuleDeclaration({declare:true})&&r.get("id").isIdentifier()){registerGlobalType(i,r.node.id.name)}}},exit(e){if(e.node.sourceType==="module"&&u.get(e.node)){e.pushContainer("body",r.exportNamedDeclaration())}}},ExportNamedDeclaration(e,t){if(!u.has(t.file.ast.program)){u.set(t.file.ast.program,true)}if(e.node.exportKind==="type"){e.remove();return}if(e.node.source&&e.node.specifiers.length>0&&e.node.specifiers.every((e=>e.type==="ExportSpecifier"&&e.exportKind==="type"))){e.remove();return}if(!e.node.source&&e.node.specifiers.length>0&&e.node.specifiers.every((t=>r.isExportSpecifier(t)&&isGlobalType(e,t.local.name)))){e.remove();return}if(r.isTSModuleDeclaration(e.node.declaration)){const t=e.node.declaration;const{id:n}=t;if(r.isIdentifier(n)){if(e.scope.hasOwnBinding(n.name)){e.replaceWith(t)}else{const[s]=e.replaceWithMultiple([r.exportNamedDeclaration(r.variableDeclaration("let",[r.variableDeclarator(r.cloneNode(n))])),t]);e.scope.registerDeclaration(s)}}}u.set(t.file.ast.program,false)},ExportAllDeclaration(e){if(e.node.exportKind==="type")e.remove()},ExportSpecifier(e){const t=e.parent;if(!t.source&&isGlobalType(e,e.node.local.name)||e.node.exportKind==="type"){e.remove()}},ExportDefaultDeclaration(e,t){if(!u.has(t.file.ast.program)){u.set(t.file.ast.program,true)}if(r.isIdentifier(e.node.declaration)&&isGlobalType(e,e.node.declaration.name)){e.remove();return}u.set(t.file.ast.program,false)},TSDeclareFunction(e){safeRemove(e)},TSDeclareMethod(e){safeRemove(e)},VariableDeclaration(e){if(e.node.declare){safeRemove(e)}},VariableDeclarator({node:e}){if(e.definite)e.definite=null},TSIndexSignature(e){e.remove()},ClassDeclaration(e){const{node:t}=e;if(t.declare){safeRemove(e)}},Class(e){const{node:t}=e;if(t.typeParameters)t.typeParameters=null;if(t.superTypeParameters)t.superTypeParameters=null;if(t.implements)t.implements=null;if(t.abstract)t.abstract=null;e.get("body.body").forEach((t=>{if(t.isClassMethod()||t.isClassPrivateMethod()){if(t.node.kind==="constructor"){T.constructor(t,e)}else{T.method(t)}}else if(t.isClassProperty()||t.isClassPrivateProperty()||t.isClassAccessorProperty()){T.field(t)}}))},Function(e){const{node:t}=e;if(t.typeParameters)t.typeParameters=null;
|
||
|
|
${n.types.cloneNode(e)} ||
|
||
|
|
(${n.types.cloneNode(e)} = ${c})
|
||
|
|
`}return n.template.statement.ast`
|
||
|
|
(function (${n.types.identifier(a)}) {
|
||
|
|
${o}
|
||
|
|
})(${i} || (${n.types.cloneNode(i)} = ${c}));
|
||
|
|
`}},5432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=r(5389);var s=r(7167);r(6085);var i=r(8417);var a=r(4716);function _interopDefaultLegacy(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var o=_interopDefaultLegacy(s);var l=_interopDefaultLegacy(i);const c=new a.OptionValidator("@babel/preset-typescript");function normalizeOptions(e={}){let{allowNamespaces:t=true,jsxPragma:r,onlyRemoveTypeImports:n}=e;const s={ignoreExtensions:"ignoreExtensions",allowNamespaces:"allowNamespaces",disallowAmbiguousJSXLike:"disallowAmbiguousJSXLike",jsxPragma:"jsxPragma",jsxPragmaFrag:"jsxPragmaFrag",onlyRemoveTypeImports:"onlyRemoveTypeImports",optimizeConstEnums:"optimizeConstEnums",allExtensions:"allExtensions",isTSX:"isTSX"};const i=c.validateStringOption(s.jsxPragmaFrag,e.jsxPragmaFrag,"React.Fragment");{var a=c.validateBooleanOption(s.allExtensions,e.allExtensions,false);var o=c.validateBooleanOption(s.isTSX,e.isTSX,false);if(o){c.invariant(a,"isTSX:true requires allExtensions:true")}}const l=c.validateBooleanOption(s.ignoreExtensions,e.ignoreExtensions,false);const u=c.validateBooleanOption(s.disallowAmbiguousJSXLike,e.disallowAmbiguousJSXLike,false);if(u){{c.invariant(a,"disallowAmbiguousJSXLike:true requires allExtensions:true")}}const p=c.validateBooleanOption(s.optimizeConstEnums,e.optimizeConstEnums,false);const f={ignoreExtensions:l,allowNamespaces:t,disallowAmbiguousJSXLike:u,jsxPragma:r,jsxPragmaFrag:i,onlyRemoveTypeImports:n,optimizeConstEnums:p};{f.allExtensions=a;f.isTSX=o}return f}var u=n.declarePreset(((e,t)=>{e.assertVersion(7);const{allExtensions:r,ignoreExtensions:n,allowNamespaces:s,disallowAmbiguousJSXLike:i,isTSX:a,jsxPragma:c,jsxPragmaFrag:u,onlyRemoveTypeImports:p,optimizeConstEnums:f}=normalizeOptions(t);const pluginOptions=e=>({allowDeclareFields:t.allowDeclareFields,allowNamespaces:s,disallowAmbiguousJSXLike:e,jsxPragma:c,jsxPragmaFrag:u,onlyRemoveTypeImports:p,optimizeConstEnums:f});const getPlugins=(e,t)=>{{return[[o["default"],Object.assign({isTSX:e},pluginOptions(t))]]}};const d=r||n;return{overrides:d?[{plugins:getPlugins(a,i)}]:[{test:/\.ts$/,plugins:getPlugins(false,false)},{test:/\.mts$/,sourceType:"module",plugins:getPlugins(false,true)},{test:/\.cts$/,sourceType:"unambiguous",plugins:[[l["default"],{allowTopLevelThis:true}],[o["default"],pluginOptions(true)]]},{test:/\.tsx$/,plugins:getPlugins(true,false)}]}}));t["default"]=u},7601:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t["default"]=createTemplateBuilder;var n=r(4287);var s=r(4430);var i=r(5202);const a=(0,n.validate)({placeholderPattern:false});function createTemplateBuilder(e,t){const r=new WeakMap;const o=new WeakMap;const l=t||(0,n.validate)(null);return Object.assign(((t,...a)=>{if(typeof t==="string"){if(a.length>1)throw new Error("Unexpected extra params.");return extendedTrace((0,s.default)(e,t,(0,n.merge)(l,(0,n.validate)(a[0]))))}else if(Array.isArray(t)){let n=r.get(t);if(!n){n=(0,i.default)(e,t,l);r.set(t,n)}return extendedTrace(n(a))}else if(typeof t==="object"&&t){if(a.length>0)throw new Error("Unexpected extra params.");return createTemplateBuilder(e,(0,n.merge)(l,(0,n.validate)(t)))}throw new Error(`Unexpected template param ${typeof t}`)}),{ast:(t,...r)=>{if(typeof t==="string"){if(r.length>1)throw new Error("Unexpected extra params.");return(0,s.default)(e,t,(0,n.merge)((0,n.merge)(l,(0,n.validate)(r[0])),a))()}else if(Array.isArray(t)){let s=o.get(t);if(!s){s=(0,i.default)(e,t,(0,n.merge)(l,a));o.set(t,s)}return s(r)()}throw new Error(`Unexpected template param ${typeof t}`)}})}function extendedTrace(e){let t="";try{throw new Error}catch(e){if(e.stack){t=e.stack.split("\n").slice(3).join("\n")}}return r=>{try{return e(r)}catch(e){e.stack+=`\n =============\n${t}`;throw e}}}},9550:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.statements=t.statement=t.smart=t.program=t.expression=void 0;var n=r(776);const{assertExpressionStatement:s}=n;function makeStatementFormatter(e){return{code:e=>`/* @babel/template */;\n${
|