diff --git a/.babelrc b/.babelrc deleted file mode 100644 index abe461f..0000000 --- a/.babelrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "presets": [ - [ - "@babel/preset-env", - { - "modules": false - } - ] - ] - } \ No newline at end of file diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 0000000..0d7ef62 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,33 @@ +module.exports = function (api) { + api.cache(true); + const presets = [ + [ + '@babel/preset-env', + { + corejs : { + version : "3", + proposals : true + }, + useBuiltIns: false, + targets: { + browsers: [ + "edge >= 16", + "safari >= 9", + "firefox >= 57", + "ie >= 11", + "ios >= 9", + "chrome >= 49" + ] + } + } + ] + ]; + const plugins= [ + ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }], + ["@babel/plugin-proposal-class-properties", { "loose": true }] + ]; + return { + presets, + plugins + } + } \ No newline at end of file diff --git a/dist/framework.dev.js b/dist/framework.dev.js deleted file mode 100644 index aaf3a85..0000000 --- a/dist/framework.dev.js +++ /dev/null @@ -1,165 +0,0 @@ -"use strict"; - -function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "Core", { - enumerable: true, - get: function get() { - return _core.Framework; - } -}); -Object.defineProperty(exports, "selector", { - enumerable: true, - get: function get() { - return _selector.selector; - } -}); -Object.defineProperty(exports, "Framework", { - enumerable: true, - get: function get() { - return _framework.Framework; - } -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function get() { - return _framework["default"]; - } -}); - -var _core = require("./framework/core"); - -var CoreUtils = _interopRequireWildcard(require("./helpers")); - -var _selector = require("./framework/selector.js"); - -require("./framework/traversing.js"); - -require("./framework/callbacks.js"); - -require("./framework/deferred.js"); - -require("./framework/deferred/exceptionHook.js"); - -require("./framework/core/ready.js"); - -require("./framework/core/parseXML.js"); - -require("./framework/core/parseHTML.js"); - -require("./framework/data.js"); - -require("./framework/queue.js"); - -require("./framework/queue/delay.js"); - -require("./framework/attributes.js"); - -require("./framework/event.js"); - -require("./framework/event/trigger.js"); - -require("./framework/manipulation.js"); - -require("./framework/manipulation/_evalUrl.js"); - -require("./framework/wrap.js"); - -require("./framework/css.js"); - -require("./framework/css/hiddenVisibleSelectors.js"); - -require("./framework/css/showHide.js"); - -require("./framework/serialize.js"); - -require("./framework/ajax.js"); - -require("./framework/ajax/xhr.js"); - -require("./framework/ajax/script.js"); - -require("./framework/ajax/jsonp.js"); - -require("./framework/ajax/binary.js"); - -require("./framework/ajax/load.js"); - -require("./framework/effects.js"); - -require("./framework/effects/animatedSelector.js"); - -require("./framework/offset.js"); - -require("./framework/dimensions.js"); - -require("./framework/util/box.js"); - -require("./framework/util/imageLoader.js"); - -require("./framework/util/keyboard.js"); - -require("./framework/util/mediaQuery.js"); - -require("./framework/util/motion.js"); - -require("./framework/util/nest.js"); - -require("./framework/util/timer.js"); - -require("./framework/util/touch.js"); - -require("./framework/util/triggers.js"); - -require("./framework/elements/abide.js"); - -require("./framework/elements/accordion.js"); - -require("./framework/elements/accordionMenu.js"); - -require("./framework/elements/drilldown.js"); - -require("./framework/elements/dropdown.js"); - -require("./framework/elements/dropdownMenu.js"); - -require("./framework/elements/equalizer.js"); - -require("./framework/elements/interchange.js"); - -require("./framework/elements/magellan.js"); - -require("./framework/elements/offcanvas.js"); - -require("./framework/elements/orbit.js"); - -require("./framework/elements/responsiveMenu.js"); - -require("./framework/elements/responsiveToggle.js"); - -require("./framework/elements/reveal.js"); - -require("./framework/elements/slider.js"); - -require("./framework/elements/switch.js"); - -require("./framework/elements/smoothScroll.js"); - -require("./framework/elements/sticky.js"); - -require("./framework/elements/tabs.js"); - -require("./framework/elements/toggler.js"); - -require("./framework/elements/tooltip.js"); - -require("./framework/elements/responsiveAccordionTabs.js"); - -var _framework = _interopRequireWildcard(require("./entries/framework")); - -function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; } \ No newline at end of file diff --git a/dist/framework.js b/dist/framework.js deleted file mode 100644 index 0476082..0000000 --- a/dist/framework.js +++ /dev/null @@ -1,797 +0,0 @@ -(function webpackUniversalModuleDefinition(root, factory) { - if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory(); - else if(typeof define === 'function' && define.amd) - define([], factory); - else if(typeof exports === 'object') - exports["framework"] = factory(); - else - root["framework"] = factory(); -})(self, () => { -return /******/ (() => { // webpackBootstrap -/******/ "use strict"; -/******/ var __webpack_modules__ = ({ - -/***/ "./src/framework/ajax.js": -/*!*******************************!*\ - !*** ./src/framework/ajax.js ***! - \*******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -Object(function webpackMissingModule() { var e = new Error("Cannot find module 'core'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -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); } } -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } -function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); } -function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } -function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } -function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } -function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } -function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } -function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } -function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } - -(function (f, _xhr, _default_args, _url, _type, _data, _callbacks, _load) { - f.ajax = (_xhr = /*#__PURE__*/new WeakMap(), _default_args = /*#__PURE__*/new WeakMap(), _url = /*#__PURE__*/new WeakMap(), _type = /*#__PURE__*/new WeakMap(), _data = /*#__PURE__*/new WeakMap(), _callbacks = /*#__PURE__*/new WeakMap(), _load = /*#__PURE__*/new WeakSet(), /*#__PURE__*/function () { - function _class(args) { - _classCallCheck(this, _class); - _classPrivateMethodInitSpec(this, _load); - _classPrivateFieldInitSpec(this, _xhr, { - writable: true, - value: null - }); - _classPrivateFieldInitSpec(this, _default_args, { - writable: true, - value: { - "url": "", - "type": "get", - "data": {}, - "success": null, - "error": null - } - }); - _classPrivateFieldInitSpec(this, _url, { - writable: true, - value: "" - }); - _classPrivateFieldInitSpec(this, _type, { - writable: true, - value: "" - }); - _classPrivateFieldInitSpec(this, _data, { - writable: true, - value: {} - }); - _classPrivateFieldInitSpec(this, _callbacks, { - writable: true, - value: [] - }); - _classPrivateFieldSet(this, _xhr, new XMLHttpRequest()); - } - _createClass(_class, [{ - key: "done", - value: function done(callback) { - if (typeof callback === "function") { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_success": callback - }); - } - return this; - } - }, { - key: "success", - value: function success(callback) { - return this.done(callback); - } - }, { - key: "fail", - value: function fail(callback) { - if (typeof callback === "function") { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_error": callback - }); - } - return this; - } - }, { - key: "error", - value: function error(callback) { - return this.fail(callback); - } - }, { - key: "always", - value: function always(callback) { - if (typeof callback === "function") { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_complete": callback - }); - } - return this; - } - }, { - key: "complete", - value: function complete(callback) { - return this.always(callback); - } - }, { - key: "progress", - value: function progress(callback) { - if (typeof callback === "function") { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_progress": callback - }); - } - return this; - } - }, { - key: "then", - value: function then(successCallback) { - var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (typeof callback_success === "function") { - if (typeof errorCallback === "function") { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_success": successCallback, - "callback_error": errorCallback - }); - } else { - _classPrivateFieldGet(this, _callbacks).push({ - "callback_success": callback_success - }); - } - } - return this; - } - }, { - key: "abort", - value: function abort() { - _classPrivateFieldGet(this, _xhr).abort(); - return this; - } - }]); - return _class; - }()); - function _load2() { - var _this = this; - _classPrivateFieldGet(this, _xhr).onerror = function (error) { - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_error !== undefined) { - data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error); - } - }); - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_complete !== undefined) { - data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error); - } - }); - }; - _classPrivateFieldGet(this, _xhr).addEventListener("progress", function (evt) { - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_progress !== undefined) { - data.callback_progress(evt, _classPrivateFieldGet(_this, _xhr)); - } - }); - }); - _classPrivateFieldGet(this, _xhr).addEventListener("load", function (evt) { - var response = {}; - if (_classPrivateFieldGet(_this, _xhr).readyState == 4) { - try { - response = JSON.parse(_this.responseText); - } catch (error) { - response = _this.responseText; - } - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_success !== undefined) { - data.callback_success(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status); - } - }); - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_complete !== undefined) { - data.callback_complete(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status); - } - }); - } else { - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_error !== undefined) { - data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status); - } - }); - _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { - if (data.callback_complete !== undefined) { - data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status); - } - }); - } - }); - } - f.ajax = function (args) { - /* - jqXHR.done(function( data, textStatus, jqXHR ){}); - jqXHR.fail(function( jqXHR, textStatus, errorThrown ){}); - - jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown){}); - jqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ){}); - . - */ - xhttp.onload = function () { - var response; - if (this.readyState == 4 && this.status == 200) { - var _response = ""; - try { - //check if the response in json - //if json the parse it - _response = JSON.parse(this.responseText); - } catch (e) { - //if not json the simple reurn the response - _response = this.responseText; - } - // give a success callback - return success(_response); - } else { - //give a fail callback with the error status - return fail(this.status); - } - }; - var parameters = ""; - if (args) { - type = args["type"]; - if ('data' in args) { - //converting object to url URLSearchParams - parameters = new URLSearchParams(args['data']).toString(); - } - } - if (type && type.toUpperCase() == 'POST') { - xhttp.open("POST", url, true); - xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - xhttp.send(parameters); - } else if (!type || type.toUpperCase() == 'GET') { - xhttp.open("GET", url + "?" + parameters, true); - xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - xhttp.send(); - } - }; -})(Object(function webpackMissingModule() { var e = new Error("Cannot find module 'core'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())); - -/***/ }), - -/***/ "./src/framework/core.js": -/*!*******************************!*\ - !*** ./src/framework/core.js ***! - \*******************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Framework: () => (/* binding */ Framework) -/* harmony export */ }); -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -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."); } -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); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -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; } -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -var Framework = function Framework(el) { - return Framework.fn.init(el); -}; -Framework.__proto__ = Framework.prototype = {}; -Framework.v = {}; -Framework.f = {}; -Framework.f.init = function (el) {}; -Framework.fn.extend = function (name, func) { - if (typeof name == "string") { - Framework.extend(Framework.fn, { - name: func - }); - } else if (_typeof(name) == "object") { - for (var n in name) { - Framework.fn.extend(n, name[n]); - } - } - return Framework.fn; -}; -Framework.extend = function (name, func) { - if (typeof name == "string") { - Framework[name] = func; - } else if (_typeof(name) === _typeof(func) === "object") { - $keys = Object.keys(func); - for (var i = 0; i < $keys.length; i++) { - var n = $keys[i]; - var v = func[n]; - name[n] = v; - } - } - return Framework; -}; -Framework.extend(Framework.fn, { - ready: function ready(callback) { - var _this = this; - this[0].addEventListener('readystatechange', function (e) { - if (_this[0].readyState === "complete") { - callback(); - return true; - } - }); - }, - each: function each(callback) { - if (callback && typeof callback == 'function') { - for (var i = 0; i < this.length; i++) { - callback(this[i], i); - } - return this; - } - }, - siblings: function siblings() { - var _this2 = this; - return _toConsumableArray(this[0].parentNode.children).filter(function (c) { - return c != _this2[0]; - }); - }, - addClass: function addClass(className) { - this.each(function (el) { - el.classList.add(className); - }); - return this; - }, - removeClass: function removeClass(className) { - this.each(function (el) { - el.classList.remove(className); - }); - return this; - }, - hasClass: function hasClass(className) { - return this[0].classList.contains(className); - }, - css: function css(propertyObject) { - this.each(function (el) { - Object.assign(el.style, propertyObject); - }); - return this; - }, - attr: function attr(_attr) { - var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - var getattr = this; - if (value) { - this.each(function (el) { - el.setAttribute(_attr, value); - }); - } else { - getattr = this[0].getAttribute(_attr); - } - return getattr; - }, - html: function html(data) { - if (data) { - this.each(function (el) { - el.innerHTML = data; - }); - } else { - return this[0].innerHTML; - } - return this; - }, - prepend: function prepend(el) { - this[0].prepend(el); - return this; - }, - append: function append(el) { - this[0].append(el); - return this; - }, - hide: function hide() { - this.each(function (el) { - el.style.display = "none"; - }); - return this; - }, - show: function show() { - this.each(function (el) { - el.style.display = "block"; - }); - return this; - }, - on: function on(event, child) { - var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; - if (callback != null) { - var selector = child; - this.each(function (element) { - element.addEventListener(event, function (event) { - if (event.target.matches(selector + ', ' + selector + ' *')) { - callback.apply(event.target.closest(selector), arguments); - } - }); - }); - } else { - //if the callback argument is not present then assume the child argument is being use as callback - callback = child; - this.each(function (element) { - element.addEventListener(event, callback); - }); - } - return this; - } -}); - - -/***/ }), - -/***/ "./src/framework/helpers.js": -/*!**********************************!*\ - !*** ./src/framework/helpers.js ***! - \**********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ explode: () => (/* binding */ explode), -/* harmony export */ floatval: () => (/* binding */ floatval), -/* harmony export */ implode: () => (/* binding */ implode), -/* harmony export */ instance_of: () => (/* binding */ instance_of), -/* harmony export */ intval: () => (/* binding */ intval), -/* harmony export */ is_float: () => (/* binding */ is_float), -/* harmony export */ is_int: () => (/* binding */ is_int), -/* harmony export */ isset: () => (/* binding */ isset), -/* harmony export */ json_decode: () => (/* binding */ json_decode), -/* harmony export */ json_encode: () => (/* binding */ json_encode), -/* harmony export */ str_replace: () => (/* binding */ str_replace) -/* harmony export */ }); -var _arguments = typeof arguments === "undefined" ? void 0 : arguments; -var intval = function intval() { - return parseInt.apply(console, _arguments); -}; -var floatval = function floatval() { - return parseFloat.apply(console, _arguments); -}; -var json_decode = function json_decode() { - return JSON.parse.apply(console, _arguments); -}; -var json_encode = function json_encode() { - return JSON.stringify.apply(console, _arguments); -}; -var explode = function explode(selector, string) { - return string.toString().split(selector); -}; -var implode = function implode(selector, array) { - return array.join(selector); -}; -var str_replace = function str_replace(find, replace, string) { - if (typeof find == "array") { - var temp = ""; - find.forEach(function (toFind) { - if (temp == "") { - temp = string.toString(); - } - temp = temp.replace(toFind, replace); - }); - return temp; - } - return string.replace(find, replace); -}; -var is_int = function is_int(val) { - if (parseInt(val) < parseFloat(val)) { - return false; - } - return true; -}; -var is_float = function is_float(val) { - if (parseInt(val) < parseFloat(val)) { - return true; - } - return false; -}; -var isset = function isset(val) { - if (typeof val !== "undefined") { - return true; - } - return false; -}; -var name_to_object = function name_to_object($name) { - $switch = $name.toLocaleLowerCase(); - switch ($switch) { - case "function": - return Function; - break; - case "string": - return String; - break; - case "object": - return Object; - break; - case "array": - return Array; - break; - default: - if (isset(window[$name])) { - return window[$name]; - } else if (isset(document[$name])) { - return document[$name]; - } else { - return null; - } - break; - } -}; -var instance_of = function instance_of($var, $class) { - var $origin = $class; - if (typeof $class == "string") { - $class = name_to_object($class); - } - if ($class === null) { - console.warn("not implemented", $origin); - return false; - } - if ($var instanceof $class) { - return true; - } - return false; -}; - - -/***/ }), - -/***/ "./src/framework/isElement.js": -/*!************************************!*\ - !*** ./src/framework/isElement.js ***! - \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ isElement: () => (/* binding */ isElement) -/* harmony export */ }); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function isElement(obj) { - try { - //Using W3 DOM2 (works for FF, Opera and Chrome) - return obj instanceof HTMLElement; - } catch (e) { - //Browsers not supporting W3 DOM2 don't have HTMLElement and - //an exception is thrown and we end up here. Testing some - //properties that all elements have (works on IE7) - return _typeof(obj) === "object" && obj.nodeType === 1 && _typeof(obj.style) === "object" && _typeof(obj.ownerDocument) === "object"; - } -} - - -/***/ }), - -/***/ "./src/framework/selector.js": -/*!***********************************!*\ - !*** ./src/framework/selector.js ***! - \***********************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Selector: () => (/* binding */ Selector) -/* harmony export */ }); -/* harmony import */ var _isElement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isElement */ "./src/framework/isElement.js"); -/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/framework/helpers.js"); - - -var Selector = function Selector(obj) { - var parentNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; - if (typeof obj == "string") { - return Selector.resolve_string_to_object(obj, parentNode); - } else if ((0,_isElement__WEBPACK_IMPORTED_MODULE_0__.isElement)(obj)) { - return obj; - } else { - return {}; - } -}; -Selector.prototype = Selector.__proto__ = {}; -Selector.resolve_string_to_object = function (string, parentNode) {}; - - -/***/ }) - -/******/ }); -/************************************************************************/ -/******/ // The module cache -/******/ var __webpack_module_cache__ = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ // Check if module is in cache -/******/ var cachedModule = __webpack_module_cache__[moduleId]; -/******/ if (cachedModule !== undefined) { -/******/ return cachedModule.exports; -/******/ } -/******/ // Create a new module (and put it into the cache) -/******/ var module = __webpack_module_cache__[moduleId] = { -/******/ // no module.id needed -/******/ // no module.loaded needed -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/************************************************************************/ -/******/ /* webpack/runtime/define property getters */ -/******/ (() => { -/******/ // define getter functions for harmony exports -/******/ __webpack_require__.d = (exports, definition) => { -/******/ for(var key in definition) { -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); -/******/ } -/******/ } -/******/ }; -/******/ })(); -/******/ -/******/ /* webpack/runtime/hasOwnProperty shorthand */ -/******/ (() => { -/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) -/******/ })(); -/******/ -/******/ /* webpack/runtime/make namespace object */ -/******/ (() => { -/******/ // define __esModule on exports -/******/ __webpack_require__.r = (exports) => { -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); -/******/ } -/******/ Object.defineProperty(exports, '__esModule', { value: true }); -/******/ }; -/******/ })(); -/******/ -/************************************************************************/ -var __webpack_exports__ = {}; -// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. -(() => { -/*!**************************!*\ - !*** ./src/framework.js ***! - \**************************/ -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ Core: () => (/* reexport safe */ _framework_core__WEBPACK_IMPORTED_MODULE_0__.Framework), -/* harmony export */ Selector: () => (/* reexport safe */ _framework_selector_js__WEBPACK_IMPORTED_MODULE_2__.Selector) -/* harmony export */ }); -/* empty/unused harmony star reexport */ -/* empty/unused harmony star reexport */ -/* harmony import */ var _framework_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./framework/core */ "./src/framework/core.js"); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './helpers'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -/* harmony import */ var _framework_selector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./framework/selector.js */ "./src/framework/selector.js"); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/traversing.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/callbacks.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/deferred.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/deferred/exceptionHook.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/core/ready.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/core/parseXML.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/core/parseHTML.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/data.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/queue.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/queue/delay.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/attributes.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/event.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/event/trigger.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/manipulation.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/manipulation/_evalUrl.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/wrap.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/css.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/css/hiddenVisibleSelectors.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/css/showHide.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/serialize.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -/* harmony import */ var _framework_ajax_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./framework/ajax.js */ "./src/framework/ajax.js"); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/ajax/xhr.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/ajax/script.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/ajax/jsonp.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/ajax/binary.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/ajax/load.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/effects.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/effects/animatedSelector.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/offset.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/dimensions.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/box.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/imageLoader.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/keyboard.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/mediaQuery.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/motion.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/nest.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/timer.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/touch.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/util/triggers.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/abide.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/accordion.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/accordionMenu.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/drilldown.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/dropdown.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/dropdownMenu.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/equalizer.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/interchange.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/magellan.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/offcanvas.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/orbit.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/responsiveMenu.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/responsiveToggle.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/reveal.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/slider.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/switch.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/smoothScroll.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/sticky.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/tabs.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/toggler.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/tooltip.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './framework/elements/responsiveAccordionTabs.js'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); -Object(function webpackMissingModule() { var e = new Error("Cannot find module './entries/framework'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -})(); - -/******/ return __webpack_exports__; -/******/ })() -; -}); -//# sourceMappingURL=framework.js.map \ No newline at end of file diff --git a/dist/framework.js.map b/dist/framework.js.map deleted file mode 100644 index 083ab53..0000000 --- a/dist/framework.js.map +++ /dev/null @@ -1 +0,0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AACG;AACD;AACC;AACF;AACF;AACiB;AAClB;AACI;AACH;AACS;AACH;AACE;AACJ;AACF;AACC;AACA;AACG;AACC;AACI;AACI;AACJ;AACD;AACI;AACH;AACE;AACH;AACC;AACJ;AACS;AACE;AACV;AACA;AACA;AACM;AACN;AACF;AACG;AACA;AACgB;AAEK","sources":["webpack://framework/webpack/universalModuleDefinition","webpack://framework/./src/framework/ajax.js","webpack://framework/./src/framework/core.js","webpack://framework/./src/framework/helpers.js","webpack://framework/./src/framework/isElement.js","webpack://framework/./src/framework/selector.js","webpack://framework/webpack/bootstrap","webpack://framework/webpack/runtime/define property getters","webpack://framework/webpack/runtime/hasOwnProperty shorthand","webpack://framework/webpack/runtime/make namespace object","webpack://framework/./src/framework.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"framework\"] = factory();\n\telse\n\t\troot[\"framework\"] = factory();\n})(self, () => {\nreturn ","import { Framework } from \"core\";\r\n\r\n((f) => {\r\n\tf.ajax = class{\r\n\t\t#xhr = null;\r\n\t\t#default_args = {\r\n\t\t\t\"url\": \"\",\r\n\t\t\t\"type\": \"get\",\r\n\t\t\t\"data\": {},\r\n\t\t\t\"success\": null,\r\n\t\t\t\"error\": null\r\n\t\t};\r\n\t\t#url = \"\";\r\n\t\t#type = \"\";\r\n\t\t#data = {};\r\n\t\t#callbacks=[];\r\n\t\tconstructor(args) {\r\n\t\t\tthis.#xhr = new XMLHttpRequest();\r\n\t\t}\r\n\t\tdone(callback){\r\n\t\t\tif(typeof callback === \"function\"){\r\n\t\t\t\tthis.#callbacks.push({\"callback_success\":callback});\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tsuccess(callback){\r\n\t\t\treturn this.done(callback);\r\n\t\t}\r\n\t\tfail(callback){\r\n\t\t\tif(typeof callback === \"function\"){\r\n\t\t\t\tthis.#callbacks.push({\"callback_error\":callback});\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\terror(callback){\r\n\t\t\treturn this.fail(callback);\r\n\t\t}\r\n\t\talways(callback){\r\n\t\t\tif(typeof callback === \"function\"){\r\n\t\t\t\tthis.#callbacks.push({\"callback_complete\":callback});\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tcomplete(callback){\r\n\t\t\treturn this.always(callback);\r\n\t\t}\r\n\t\tprogress(callback){\r\n\t\t\tif(typeof callback === \"function\"){\r\n\t\t\t\tthis.#callbacks.push({\"callback_progress\":callback});\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tthen(successCallback,errorCallback=null){\r\n\t\t\tif(typeof callback_success === \"function\"){\r\n\t\t\t\tif(typeof errorCallback === \"function\"){\r\n\t\t\t\t\tthis.#callbacks.push({\"callback_success\":successCallback, \"callback_error\": errorCallback});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.#callbacks.push({\"callback_success\":callback_success});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tabort(){\r\n\t\t\tthis.#xhr.abort();\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\t#load(){\r\n\t\t\tthis.#xhr.onerror = (error) => {\r\n\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\tif(data.callback_error !== undefined){\r\n\t\t\t\t\t\tdata.callback_error(this.#xhr, this.#xhr.statusText,error);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\tif(data.callback_complete !== undefined){\r\n\t\t\t\t\t\tdata.callback_complete({}, this.#xhr, this.#xhr.statusText,error);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t};\r\n\t\t\tthis.#xhr.addEventListener(\"progress\", (evt) => {\r\n\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\tif(data.callback_progress !== undefined){\r\n\t\t\t\t\t\tdata.callback_progress(evt, this.#xhr);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tthis.#xhr.addEventListener(\"load\", (evt) => {\r\n\t\t\t\tvar response = {};\r\n\t\t\t\tif(this.#xhr.readyState == 4){\r\n\t\t\t\t\ttry{\r\n\t\t\t\t\t\tresponse=JSON.parse(this.responseText)\r\n\t\t\t\t\t}catch(error){\r\n\t\t\t\t\t\tresponse = this.responseText;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\t\tif(data.callback_success !== undefined){\r\n\t\t\t\t\t\t\tdata.callback_success(response, this.#xhr, this.#xhr.statusText, this.#xhr.status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\t\tif(data.callback_complete !== undefined){\r\n\t\t\t\t\t\t\tdata.callback_complete(response, this.#xhr, this.#xhr.statusText, this.#xhr.status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\t\tif(data.callback_error !== undefined){\r\n\t\t\t\t\t\t\tdata.callback_error(this.#xhr, this.#xhr.statusText, this.status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthis.#callbacks.forEach((data)=>{\r\n\t\t\t\t\t\tif(data.callback_complete !== undefined){\r\n\t\t\t\t\t\t\tdata.callback_complete({}, this.#xhr, this.#xhr.statusText, this.status);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\tf.ajax=function(args) {\r\n\t\t/*\r\n\t\t\tjqXHR.done(function( data, textStatus, jqXHR ){});\r\n\r\n\t\t\tjqXHR.fail(function( jqXHR, textStatus, errorThrown ){});\r\n\t\t\t\r\n\t\t\tjqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown){});\r\n\r\n\t\t\tjqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ){});\r\n.\r\n\t\t */\r\n xhttp.onload = function() {\r\n let response;\r\n if (this.readyState == 4 && this.status == 200) {\r\n let response=\"\";\r\n try {\r\n //check if the response in json \r\n //if json the parse it\r\n response=JSON.parse(this.responseText)\r\n } catch (e) {\r\n //if not json the simple reurn the response\r\n response = this.responseText;\r\n }\r\n // give a success callback\r\n return success(response);\r\n } else {\r\n //give a fail callback with the error status \r\n return fail(this.status);\r\n }\r\n };\r\n let parameters=\"\";\r\n if (args) {\r\n type = args[\"type\"];\r\n if ('data' in args) {\r\n //converting object to url URLSearchParams\r\n parameters = new URLSearchParams(args['data']).toString();\r\n }\r\n }\r\n if (type && type.toUpperCase()=='POST') {\r\n xhttp.open(\"POST\", url, true);\r\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n xhttp.send(parameters);\r\n } else if (!type || type.toUpperCase()=='GET'){\r\n xhttp.open(\"GET\", url + \"?\" + parameters, true);\r\n xhttp.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n xhttp.send();\r\n }\r\n }\r\n})(Framework);","var Framework=function(el){\r\n\treturn Framework.fn.init(el);\r\n}\r\nFramework.__proto__ = Framework.prototype = {};\r\nFramework.v={};\r\nFramework.f={};\r\nFramework.f.init=function(el){\r\n\r\n};\r\nFramework.fn.extend=function(name,func){\r\n\tif((typeof name) == \"string\"){\r\n\t\tFramework.extend(Framework.fn,{name:func});\r\n\t}else if((typeof name) == \"object\"){\r\n\t\tfor (var n in name){\r\n\t\t\tFramework.fn.extend(n,name[n]);\r\n\t\t}\r\n\t}\r\n\treturn Framework.fn;\r\n};\r\nFramework.extend=function(name,func){\r\n\tif((typeof name) == \"string\"){\r\n\t\tFramework[name] = func;\r\n\t}else if(typeof name === typeof func === \"object\"){\r\n\t\t$keys=Object.keys(func);\r\n\t\tfor(var i=0; i<$keys.length; i++){\r\n\t\t\tvar n=$keys[i];\r\n\t\t\tvar v=func[n];\r\n\t\t\tname[n] = v;\r\n\t\t}\r\n\t}\r\n\treturn Framework;\r\n};\r\nFramework.extend(Framework.fn,{\r\n\tready: function(callback){\r\n\t\tthis[0].addEventListener('readystatechange', e => {\r\n\t\t\tif(this[0].readyState === \"complete\"){\r\n\t\t\t\tcallback();\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t\t});\r\n\t},\r\n\teach: function(callback) {\r\n\t\tif (callback && typeof(callback) == 'function') {\r\n\t\t\tfor (let i = 0; i < this.length; i++) {\r\n\t\t\t\tcallback(this[i], i);\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t} \r\n\t},\r\n\tsiblings: function(){\r\n\t\treturn [...this[0].parentNode.children].filter(c=>c!=this[0])\r\n\t},\r\n\taddClass: function(className) {\r\n\t\tthis.each(function(el) {\r\n\t\t\tel.classList.add(className);\r\n\t\t})\r\n\t\treturn this;\r\n\t},\r\n\tremoveClass: function(className) {\r\n\t\tthis.each(function(el) {\r\n\t\t\tel.classList.remove(className);\r\n\t\t})\r\n\t\treturn this;\r\n\t},\r\n\thasClass: function(className) {\r\n\t\treturn this[0].classList.contains(className);\r\n\t},\r\n\tcss: function(propertyObject) {\r\n\t\tthis.each(function(el) {\r\n\t\t\tObject.assign(el.style,propertyObject);\r\n\t\t\t})\r\n\t\t\treturn this;\r\n\t},\r\n\tattr: function(attr, value = null) {\r\n\t\tlet getattr = this;\r\n\t\tif (value){\r\n\t\t\tthis.each(function(el) {\r\n\t\t\t\tel.setAttribute(attr, value);\r\n\t\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t\tgetattr = this[0].getAttribute(attr);\r\n\t\t}\r\n\t\treturn getattr;\r\n\t},\r\n\thtml: function(data) {\r\n\t\tif (data) {\r\n\t\t\tthis.each(function(el) {\r\n\t\t\t\tel.innerHTML = data;\r\n\t\t\t})\r\n\t\t} else {\r\n\t\t\treturn this[0].innerHTML;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\tprepend: function(el){\r\n\t\tthis[0].prepend(el);\r\n\t\treturn this;\r\n\t},\r\n\tappend: function(el){\r\n\t\tthis[0].append(el);\r\n\t\treturn this;\r\n\t},\r\n\thide: function() {\r\n\t\tthis.each(function(el) {\r\n\t\t\tel.style.display = \"none\";\r\n\t\t});\r\n\t\treturn this;\r\n\t},\r\n\tshow: function() {\r\n\t\tthis.each(function(el) {\r\n\t\t\tel.style.display = \"block\";\r\n\t\t});\r\n\t\treturn this;\r\n\t},\r\n\ton: function(event, child, callback = null) {\r\n\t\tif (callback != null) {\r\n\t\t\tlet selector = child;\r\n\t\t\tthis.each(function(element) {\r\n\t\t\t\telement.addEventListener(event, function(event) {\r\n\t\t\t\t\tif (event.target.matches(selector + ', ' + selector + ' *')) {\r\n\t\t\t\t\t\tcallback.apply(event.target.closest(selector), arguments);\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t})\r\n\t\t} else {\r\n\t\t//if the callback argument is not present then assume the child argument is being use as callback\r\n\t\t\tcallback = child;\r\n\t\t\tthis.each(function(element) {\r\n\t\t\t\telement.addEventListener(event, callback);\r\n\t\t\t})\r\n\t\t}\r\n\t\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n\r\nexport {Framework};","var intval=() => {\r\n\treturn parseInt.apply(console,arguments);\r\n};\r\nvar floatval=() => {\r\n\treturn parseFloat.apply(console,arguments);\r\n};\r\nvar json_decode=() => {\r\n\treturn JSON.parse.apply(console,arguments);\r\n}\r\nvar json_encode=() => {\r\n\treturn JSON.stringify.apply(console,arguments);\r\n}\r\nvar explode = (selector, string) => {\r\n\treturn string.toString().split(selector);\r\n}\r\nvar implode = (selector, array) => {\r\n\treturn array.join(selector);\r\n}\r\nvar str_replace = (find,replace,string) => {\r\n\tif(typeof find == \"array\"){\r\n\t\tvar temp=\"\";\r\n\t\tfind.forEach(function(toFind){\r\n\t\t\tif(temp==\"\"){\r\n\t\t\t\ttemp=string.toString();\r\n\t\t\t}\r\n\t\t\ttemp=temp.replace(toFind,replace);\r\n\t\t});\r\n\t\treturn temp;\r\n\t}\r\n\treturn string.replace(find,replace);\r\n}\r\nvar is_int = (val) => {\r\n\tif(parseInt(val) < parseFloat(val)){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}\r\nvar is_float = (val) => {\r\n\tif(parseInt(val) < parseFloat(val)){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\nvar isset = (val) => {\r\n\tif((typeof val) !== \"undefined\"){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\nvar name_to_object= ($name) => {\r\n\t$switch = $name.toLocaleLowerCase();\r\n\tswitch($switch){\r\n\t\tcase \"function\":\r\n\t\t\treturn Function;\r\n\t\tbreak;\r\n\t\tcase \"string\":\r\n\t\t\treturn String;\r\n\t\tbreak;\r\n\t\tcase \"object\":\r\n\t\t\treturn Object;\r\n\t\tbreak;\r\n\t\tcase \"array\":\r\n\t\t\treturn Array;\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tif(isset(window[$name])){\r\n\t\t\t\treturn window[$name];\r\n\t\t\t}else if(isset(document[$name])){\r\n\t\t\t\treturn document[$name];\r\n\t\t\t}else {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\tbreak;\r\n\t}\r\n}\r\nvar instance_of = ($var, $class) => {\r\n\tvar $origin=$class;\r\n\tif(typeof $class == \"string\"){\r\n\t\t$class=name_to_object($class);\r\n\t}\r\n\tif($class === null){\r\n\t\tconsole.warn(\"not implemented\", $origin);\r\n\t\treturn false;\r\n\t}\r\n\tif($var instanceof $class){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\nexport {intval, floatval, json_decode, json_encode, explode, implode, str_replace, instance_of, is_int, is_float, isset};","function isElement(obj) {\r\n\ttry {\r\n\t\t//Using W3 DOM2 (works for FF, Opera and Chrome)\r\n\t\treturn obj instanceof HTMLElement;\r\n\t}\r\n\tcatch(e){\r\n\t\t//Browsers not supporting W3 DOM2 don't have HTMLElement and\r\n\t\t//an exception is thrown and we end up here. Testing some\r\n\t\t//properties that all elements have (works on IE7)\r\n\t\treturn (typeof obj===\"object\") &&\r\n\t\t(obj.nodeType===1) && (typeof obj.style === \"object\") &&\r\n\t\t(typeof obj.ownerDocument ===\"object\");\r\n\t}\r\n}\r\nexport {isElement};","import { isElement } from \"./isElement\";\r\nimport * as CoreUtils from \"./helpers\";\r\n\r\nvar Selector = function(obj, parentNode = document){\r\n\tif(typeof obj == \"string\"){\r\n\t\treturn Selector.resolve_string_to_object(obj,parentNode);\r\n\t}else if(isElement(obj)){\r\n\t\treturn obj;\r\n\t}else{\r\n\t\treturn {};\r\n\t}\r\n};\r\nSelector.prototype = Selector.__proto__ = {};\r\nSelector.resolve_string_to_object = (string,parentNode) =>{\r\n\t\r\n};\r\nexport {Selector};","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { Framework as Core } from \"./framework/core\";\r\n\r\nimport * as CoreUtils from \"./helpers\";\r\nexport { Selector } from \"./framework/selector.js\";\r\nimport \"./framework/traversing.js\";\r\nimport \"./framework/callbacks.js\";\r\nimport \"./framework/deferred.js\";\r\nimport \"./framework/deferred/exceptionHook.js\";\r\nimport \"./framework/core/ready.js\";\r\nimport \"./framework/core/parseXML.js\";\r\nimport \"./framework/core/parseHTML.js\";\r\nimport \"./framework/data.js\";\r\nimport \"./framework/queue.js\";\r\nimport \"./framework/queue/delay.js\";\r\nimport \"./framework/attributes.js\";\r\nimport \"./framework/event.js\";\r\nimport \"./framework/event/trigger.js\";\r\nimport \"./framework/manipulation.js\";\r\nimport \"./framework/manipulation/_evalUrl.js\";\r\nimport \"./framework/wrap.js\";\r\nimport \"./framework/css.js\";\r\nimport \"./framework/css/hiddenVisibleSelectors.js\";\r\nimport \"./framework/css/showHide.js\";\r\nimport \"./framework/serialize.js\";\r\nimport \"./framework/ajax.js\";\r\nimport \"./framework/ajax/xhr.js\";\r\nimport \"./framework/ajax/script.js\";\r\nimport \"./framework/ajax/jsonp.js\";\r\nimport \"./framework/ajax/binary.js\";\r\nimport \"./framework/ajax/load.js\";\r\nimport \"./framework/effects.js\";\r\nimport \"./framework/effects/animatedSelector.js\";\r\nimport \"./framework/offset.js\";\r\nimport \"./framework/dimensions.js\";\r\nimport './framework/util/box.js'\r\nimport './framework/util/imageLoader.js';\r\nimport './framework/util/keyboard.js';\r\nimport './framework/util/mediaQuery.js';\r\nimport './framework/util/motion.js';\r\nimport './framework/util/nest.js';\r\nimport './framework/util/timer.js';\r\nimport './framework/util/touch.js';\r\nimport './framework/util/triggers.js';\r\nimport './framework/elements/abide.js';\r\nimport './framework/elements/accordion.js';\r\nimport './framework/elements/accordionMenu.js';\r\nimport './framework/elements/drilldown.js';\r\nimport './framework/elements/dropdown.js';\r\nimport './framework/elements/dropdownMenu.js';\r\nimport './framework/elements/equalizer.js';\r\nimport './framework/elements/interchange.js';\r\nimport './framework/elements/magellan.js';\r\nimport './framework/elements/offcanvas.js';\r\nimport './framework/elements/orbit.js';\r\nimport './framework/elements/responsiveMenu.js';\r\nimport './framework/elements/responsiveToggle.js';\r\nimport './framework/elements/reveal.js';\r\nimport './framework/elements/slider.js';\r\nimport './framework/elements/switch.js';\r\nimport './framework/elements/smoothScroll.js';\r\nimport './framework/elements/sticky.js';\r\nimport './framework/elements/tabs.js';\r\nimport './framework/elements/toggler.js';\r\nimport './framework/elements/tooltip.js';\r\nimport './framework/elements/responsiveAccordionTabs.js';\r\n\r\nexport { Framework } from './entries/framework';\r\nexport { default } from './entries/framework';"],"names":["Framework","f","_xhr","_default_args","_url","_type","_data","_callbacks","_load","ajax","WeakMap","WeakSet","_class","args","_classCallCheck","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","writable","value","_classPrivateFieldSet","XMLHttpRequest","_createClass","key","done","callback","_classPrivateFieldGet","push","success","fail","error","always","complete","progress","then","successCallback","errorCallback","arguments","length","undefined","callback_success","abort","_load2","_this","onerror","forEach","data","callback_error","statusText","callback_complete","addEventListener","evt","callback_progress","response","readyState","JSON","parse","responseText","status","xhttp","onload","e","parameters","type","URLSearchParams","toString","toUpperCase","open","url","setRequestHeader","send","el","fn","init","__proto__","prototype","v","extend","name","func","_typeof","n","$keys","Object","keys","i","ready","each","siblings","_this2","_toConsumableArray","parentNode","children","filter","c","addClass","className","classList","add","removeClass","remove","hasClass","contains","css","propertyObject","assign","style","attr","getattr","setAttribute","getAttribute","html","innerHTML","prepend","append","hide","display","show","on","event","child","selector","element","target","matches","apply","closest","intval","parseInt","console","floatval","parseFloat","json_decode","json_encode","stringify","explode","string","split","implode","array","join","str_replace","find","replace","temp","toFind","is_int","val","is_float","isset","name_to_object","$name","$switch","toLocaleLowerCase","Function","String","Array","window","document","instance_of","$var","$class","$origin","warn","isElement","obj","HTMLElement","nodeType","ownerDocument","CoreUtils","Selector","resolve_string_to_object","Core","default"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/js/framework.js b/dist/js/framework.js new file mode 100644 index 0000000..c85d02c --- /dev/null +++ b/dist/js/framework.js @@ -0,0 +1,850 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["framework"] = factory(); + else + root["framework"] = factory(); +})(self, () => { +return /******/ (() => { // webpackBootstrap +/******/ "use strict"; +/******/ var __webpack_modules__ = ({ + +/***/ "./src/framework/ajax.js": +/*!*******************************!*\ + !*** ./src/framework/ajax.js ***! + \*******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core */ "./src/framework/core.js"); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } +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); } } +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); } +function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); } +function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } +function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); } +function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } +function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; } +function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } +function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } + +(function (f, _xhr, _default_args, _url, _type, _data, _callbacks, _load) { + f.ajax = (_xhr = /*#__PURE__*/new WeakMap(), _default_args = /*#__PURE__*/new WeakMap(), _url = /*#__PURE__*/new WeakMap(), _type = /*#__PURE__*/new WeakMap(), _data = /*#__PURE__*/new WeakMap(), _callbacks = /*#__PURE__*/new WeakMap(), _load = /*#__PURE__*/new WeakSet(), /*#__PURE__*/function () { + function _class(args) { + _classCallCheck(this, _class); + _classPrivateMethodInitSpec(this, _load); + _classPrivateFieldInitSpec(this, _xhr, { + writable: true, + value: null + }); + _classPrivateFieldInitSpec(this, _default_args, { + writable: true, + value: { + "url": "", + "type": "get", + "data": {}, + "success": null, + "error": null + } + }); + _classPrivateFieldInitSpec(this, _url, { + writable: true, + value: "" + }); + _classPrivateFieldInitSpec(this, _type, { + writable: true, + value: "" + }); + _classPrivateFieldInitSpec(this, _data, { + writable: true, + value: {} + }); + _classPrivateFieldInitSpec(this, _callbacks, { + writable: true, + value: [] + }); + _classPrivateFieldSet(this, _xhr, new XMLHttpRequest()); + } + _createClass(_class, [{ + key: "done", + value: function done(callback) { + if (typeof callback === "function") { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_success": callback + }); + } + return this; + } + }, { + key: "success", + value: function success(callback) { + return this.done(callback); + } + }, { + key: "fail", + value: function fail(callback) { + if (typeof callback === "function") { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_error": callback + }); + } + return this; + } + }, { + key: "error", + value: function error(callback) { + return this.fail(callback); + } + }, { + key: "always", + value: function always(callback) { + if (typeof callback === "function") { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_complete": callback + }); + } + return this; + } + }, { + key: "complete", + value: function complete(callback) { + return this.always(callback); + } + }, { + key: "progress", + value: function progress(callback) { + if (typeof callback === "function") { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_progress": callback + }); + } + return this; + } + }, { + key: "then", + value: function then(successCallback) { + var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + if (typeof callback_success === "function") { + if (typeof errorCallback === "function") { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_success": successCallback, + "callback_error": errorCallback + }); + } else { + _classPrivateFieldGet(this, _callbacks).push({ + "callback_success": callback_success + }); + } + } + return this; + } + }, { + key: "abort", + value: function abort() { + _classPrivateFieldGet(this, _xhr).abort(); + return this; + } + }]); + return _class; + }()); + function _load2() { + var _this = this; + _classPrivateFieldGet(this, _xhr).onerror = function (error) { + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_error !== undefined) { + data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error); + } + }); + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_complete !== undefined) { + data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error); + } + }); + }; + _classPrivateFieldGet(this, _xhr).addEventListener("progress", function (evt) { + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_progress !== undefined) { + data.callback_progress(evt, _classPrivateFieldGet(_this, _xhr)); + } + }); + }); + _classPrivateFieldGet(this, _xhr).addEventListener("load", function (evt) { + var response = {}; + if (_classPrivateFieldGet(_this, _xhr).readyState == 4) { + try { + response = JSON.parse(_this.responseText); + } catch (error) { + response = _this.responseText; + } + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_success !== undefined) { + data.callback_success(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status); + } + }); + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_complete !== undefined) { + data.callback_complete(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status); + } + }); + } else { + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_error !== undefined) { + data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status); + } + }); + _classPrivateFieldGet(_this, _callbacks).forEach(function (data) { + if (data.callback_complete !== undefined) { + data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status); + } + }); + } + }); + } + f.ajax = function (args) { + /* + jqXHR.done(function( data, textStatus, jqXHR ){}); + jqXHR.fail(function( jqXHR, textStatus, errorThrown ){}); + + jqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown){}); + jqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ){}); + . + */ + xhttp.onload = function () { + var response; + if (this.readyState == 4 && this.status == 200) { + var _response = ""; + try { + //check if the response in json + //if json the parse it + _response = JSON.parse(this.responseText); + } catch (e) { + //if not json the simple reurn the response + _response = this.responseText; + } + // give a success callback + return success(_response); + } else { + //give a fail callback with the error status + return fail(this.status); + } + }; + var parameters = ""; + if (args) { + type = args["type"]; + if ('data' in args) { + //converting object to url URLSearchParams + parameters = new URLSearchParams(args['data']).toString(); + } + } + if (type && type.toUpperCase() == 'POST') { + xhttp.open("POST", url, true); + xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + xhttp.send(parameters); + } else if (!type || type.toUpperCase() == 'GET') { + xhttp.open("GET", url + "?" + parameters, true); + xhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + xhttp.send(); + } + }; +})(_core__WEBPACK_IMPORTED_MODULE_0__.Framework); + +/***/ }), + +/***/ "./src/framework/core.js": +/*!*******************************!*\ + !*** ./src/framework/core.js ***! + \*******************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Framework: () => (/* binding */ Framework) +/* harmony export */ }); +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +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."); } +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); } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } +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; } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +var Framework = function Framework(el) { + return Framework.fn.init(el); +}; +Framework.__proto__ = Framework.prototype = {}; +Framework.v = {}; +Framework.f = {}; +Framework.f.init = function (el) {}; +Framework.fn.extend = function (name, func) { + if (typeof name == "string") { + Framework.extend(Framework.fn, { + name: func + }); + } else if (_typeof(name) == "object") { + for (var n in name) { + Framework.fn.extend(n, name[n]); + } + } + return Framework.fn; +}; +Framework.extend = function (name, func) { + if (typeof name == "string") { + Framework[name] = func; + } else if (_typeof(name) === _typeof(func) === "object") { + $keys = Object.keys(func); + for (var i = 0; i < $keys.length; i++) { + var n = $keys[i]; + var v = func[n]; + name[n] = v; + } + } + return Framework; +}; +Framework.extend(Framework.fn, { + ready: function ready(callback) { + var _this = this; + this[0].addEventListener('readystatechange', function (e) { + if (_this[0].readyState === "complete") { + callback(); + return true; + } + }); + }, + each: function each(callback) { + if (callback && typeof callback == 'function') { + for (var i = 0; i < this.length; i++) { + callback(this[i], i); + } + return this; + } + }, + siblings: function siblings() { + var _this2 = this; + return _toConsumableArray(this[0].parentNode.children).filter(function (c) { + return c != _this2[0]; + }); + }, + addClass: function addClass(className) { + this.each(function (el) { + el.classList.add(className); + }); + return this; + }, + removeClass: function removeClass(className) { + this.each(function (el) { + el.classList.remove(className); + }); + return this; + }, + hasClass: function hasClass(className) { + return this[0].classList.contains(className); + }, + css: function css(propertyObject) { + this.each(function (el) { + Object.assign(el.style, propertyObject); + }); + return this; + }, + attr: function attr(_attr) { + var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var getattr = this; + if (value) { + this.each(function (el) { + el.setAttribute(_attr, value); + }); + } else { + getattr = this[0].getAttribute(_attr); + } + return getattr; + }, + html: function html(data) { + if (data) { + this.each(function (el) { + el.innerHTML = data; + }); + } else { + return this[0].innerHTML; + } + return this; + }, + prepend: function prepend(el) { + this[0].prepend(el); + return this; + }, + append: function append(el) { + this[0].append(el); + return this; + }, + hide: function hide() { + this.each(function (el) { + el.style.display = "none"; + }); + return this; + }, + show: function show() { + this.each(function (el) { + el.style.display = "block"; + }); + return this; + }, + on: function on(event, child) { + var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + if (callback != null) { + var selector = child; + this.each(function (element) { + element.addEventListener(event, function (event) { + if (event.target.matches(selector + ', ' + selector + ' *')) { + callback.apply(event.target.closest(selector), arguments); + } + }); + }); + } else { + //if the callback argument is not present then assume the child argument is being use as callback + callback = child; + this.each(function (element) { + element.addEventListener(event, callback); + }); + } + return this; + } +}); + + +/***/ }), + +/***/ "./src/framework/core/ready.js": +/*!*************************************!*\ + !*** ./src/framework/core/ready.js ***! + \*************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core */ "./src/framework/core.js"); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers */ "./src/framework/helpers.js"); + + +(function (f) { + var ready = function ready(fn) { + if (!_helpers__WEBPACK_IMPORTED_MODULE_1__.isset(document) || !_helpers__WEBPACK_IMPORTED_MODULE_1__.isset(document.head) || !_helpers__WEBPACK_IMPORTED_MODULE_1__.isset(document.body)) { + return false; + } + if (_helpers__WEBPACK_IMPORTED_MODULE_1__.is_function(fn)) { + if (is_ready == false) { + ready_list.push(fn); + } + } + if (!isset(fn) && is_ready == true) { + while (ready_list.length > 0) { + var f = ready_list.shift(); + f(); + } + } + }; + function on_ready() { + if (document.readyState !== 'loading') { + ready(); + } else { + document.addEventListener('DOMContentLoaded', ready); + } + } + var is_ready = false; + var ready_list = []; + _core__WEBPACK_IMPORTED_MODULE_0__.Framework.extend("ready", ready); + on_ready(); +})(_core__WEBPACK_IMPORTED_MODULE_0__.Framework); + +/***/ }), + +/***/ "./src/framework/entries/framework.js": +/*!********************************************!*\ + !*** ./src/framework/entries/framework.js ***! + \********************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ CoreUtils: () => (/* reexport module object */ _helpers__WEBPACK_IMPORTED_MODULE_0__), +/* harmony export */ Framework: () => (/* reexport safe */ _core__WEBPACK_IMPORTED_MODULE_1__.Framework), +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../helpers */ "./src/framework/helpers.js"); +/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core */ "./src/framework/core.js"); + + + +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_core__WEBPACK_IMPORTED_MODULE_1__.Framework); + +/***/ }), + +/***/ "./src/framework/helpers.js": +/*!**********************************!*\ + !*** ./src/framework/helpers.js ***! + \**********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ array_search: () => (/* binding */ array_search), +/* harmony export */ explode: () => (/* binding */ explode), +/* harmony export */ floatval: () => (/* binding */ floatval), +/* harmony export */ foreach: () => (/* binding */ foreach), +/* harmony export */ implode: () => (/* binding */ implode), +/* harmony export */ in_array: () => (/* binding */ in_array), +/* harmony export */ instance_of: () => (/* binding */ instance_of), +/* harmony export */ intval: () => (/* binding */ intval), +/* harmony export */ isElement: () => (/* binding */ isElement), +/* harmony export */ is_array: () => (/* binding */ is_array), +/* harmony export */ is_float: () => (/* binding */ is_float), +/* harmony export */ is_function: () => (/* binding */ is_function), +/* harmony export */ is_int: () => (/* binding */ is_int), +/* harmony export */ is_object: () => (/* binding */ is_object), +/* harmony export */ isset: () => (/* binding */ isset), +/* harmony export */ json_decode: () => (/* binding */ json_decode), +/* harmony export */ json_encode: () => (/* binding */ json_encode), +/* harmony export */ str_replace: () => (/* binding */ str_replace), +/* harmony export */ strpos: () => (/* binding */ strpos) +/* harmony export */ }); +var _arguments = typeof arguments === "undefined" ? void 0 : arguments; +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +var intval = function intval() { + return parseInt.apply(console, _arguments); +}; +var floatval = function floatval() { + return parseFloat.apply(console, _arguments); +}; +var json_decode = function json_decode() { + return JSON.parse.apply(console, _arguments); +}; +var json_encode = function json_encode() { + return JSON.stringify.apply(console, _arguments); +}; +var explode = function explode(selector, string) { + return string.toString().split(selector); +}; +var implode = function implode(selector, array) { + return array.join(selector); +}; +var str_replace = function str_replace(find, replace, string) { + if (typeof find == "array") { + var temp = ""; + find.forEach(function (toFind) { + if (temp == "") { + temp = string.toString(); + } + temp = temp.replace(toFind, replace); + }); + return temp; + } + return string.replace(find, replace); +}; +var is_int = function is_int(val) { + if (parseInt(val) < parseFloat(val)) { + return false; + } + return true; +}; +var is_float = function is_float(val) { + if (parseInt(val) < parseFloat(val)) { + return true; + } + return false; +}; +var isset = function isset(val) { + if (typeof val !== "undefined") { + return true; + } + return false; +}; +var name_to_object = function name_to_object($name) { + $switch = $name.toLocaleLowerCase(); + switch ($switch) { + case "function": + return Function; + break; + case "string": + return String; + break; + case "object": + return Object; + break; + case "array": + return Array; + break; + default: + if (isset(window[$name])) { + return window[$name]; + } else if (isset(document[$name])) { + return document[$name]; + } else { + return null; + } + break; + } +}; +var instance_of = function instance_of($var, $class) { + var $origin = $class; + if (typeof $class == "string") { + $class = name_to_object($class); + } + if ($class === null) { + console.warn("not implemented", $origin); + return false; + } + if ($var instanceof $class) { + return true; + } + return false; +}; +var is_array = function is_array(obj) { + return isset(obj) && obj instanceof Array; +}; +var is_string = function is_string(obj) { + return isset(obj) && obj.constructor.name == 'String'; +}; +var array_search = function array_search(value, array) { + return is_array(array) && isset(value) ? Array.indexOf(array, value) : false; +}; +var strpos = function strpos($haystack, $neddle) { + var $offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + if (!is_string($haystack) || !is_string($neddle) || !is_int($offset)) { + if (is_int($offset)) { + console.warn("The '$haystack' and 'neddle' must be a string!"); + } else { + console.warn("The '$offset must be an integer'"); + } + return false; + } + return $haystack.indexOf($neddle, $offset); +}; +var in_array = function in_array($needle, $haystack) { + if (!is_array($haystack)) { + console.warn("The '$haystack' must be a array"); + return false; + } + var $index = $haystack.indexOf($needle) - 1; + if ($index == -2) { + return false; + } + return true; +}; +var is_object = function is_object(obj) { + return isset(obj) && !is_array(obj) && !is_float(obj) && !is_int(obj) && !is_string(obj) && obj instanceof Object; +}; +var is_function = function is_function(obj) { + return isset(obj) && obj instanceof Function; +}; +var foreach = function foreach(arg, func) { + if (!is_function(func)) { + console.warn("The 'func' argument must be a function"); + return false; + } + if (!is_array(arg) || !is_object(arg)) { + console.warn("The 'arg' argument must be a array or a object"); + return false; + } + if (func.length > 1) { + for (var i in arg) { + func(i, arg[i]); + } + } else { + for (var i in arg) { + func(arg[i]); + } + } +}; +var isElement = function isElement(obj) { + if (!isset(obj)) { + return false; + } + if (obj instanceof HTMLElement) { + //Using W3 DOM2 (works for FF, Opera and Chrome) + return true; + } + return _typeof(obj) === "object" && obj.nodeType === 1 && _typeof(obj.style) === "object" && _typeof(obj.ownerDocument) === "object"; +}; + + +/***/ }), + +/***/ "./src/framework/selector.js": +/*!***********************************!*\ + !*** ./src/framework/selector.js ***! + \***********************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Selector: () => (/* binding */ Selector) +/* harmony export */ }); +/* harmony import */ var _helpers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.js */ "./src/framework/helpers.js"); + +var Selector = function Selector(obj) { + var parentNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document; + if (typeof obj == "string") { + return Selector.resolve_string_to_object(obj, parentNode); + } else if (_helpers_js__WEBPACK_IMPORTED_MODULE_0__.isElement(obj)) { + return obj; + } else { + return {}; + } +}; +Selector.prototype = Selector.__proto__ = {}; +Selector.resolve_string_to_object = function (string, parentNode) {}; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { +/*!**************************!*\ + !*** ./src/framework.js ***! + \**************************/ +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Core: () => (/* reexport safe */ _framework_core__WEBPACK_IMPORTED_MODULE_0__.Framework), +/* harmony export */ Framework: () => (/* reexport safe */ _framework_entries_framework__WEBPACK_IMPORTED_MODULE_5__.Framework), +/* harmony export */ "default": () => (/* reexport safe */ _framework_entries_framework__WEBPACK_IMPORTED_MODULE_5__["default"]) +/* harmony export */ }); +/* harmony import */ var _framework_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./framework/core */ "./src/framework/core.js"); +/* harmony import */ var _framework_helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./framework/helpers.js */ "./src/framework/helpers.js"); +/* harmony import */ var _framework_selector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./framework/selector.js */ "./src/framework/selector.js"); +/* harmony import */ var _framework_core_ready_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./framework/core/ready.js */ "./src/framework/core/ready.js"); +/* harmony import */ var _framework_ajax_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./framework/ajax.js */ "./src/framework/ajax.js"); +/* harmony import */ var _framework_entries_framework__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./framework/entries/framework */ "./src/framework/entries/framework.js"); + + + +//import "./framework/traversing.js"; +//import "./framework/callbacks.js"; +//import "./framework/deferred.js"; +//import "./framework/deferred/exceptionHook.js"; + +//import "./framework/core/parseXML.js"; +//import "./framework/core/parseHTML.js"; +//import "./framework/data.js"; +//import "./framework/queue.js"; +//import "./framework/queue/delay.js"; +//import "./framework/attributes.js"; +//import "./framework/event.js"; +//import "./framework/event/trigger.js"; +//import "./framework/manipulation.js"; +//import "./framework/manipulation/_evalUrl.js"; +//import "./framework/wrap.js"; +//import "./framework/css.js"; +//import "./framework/css/hiddenVisibleSelectors.js"; +//import "./framework/css/showHide.js"; +//import "./framework/serialize.js"; + +//import "./framework/ajax/xhr.js"; +//import "./framework/ajax/script.js"; +//import "./framework/ajax/jsonp.js"; +//import "./framework/ajax/binary.js"; +//import "./framework/ajax/load.js"; +//import "./framework/effects.js"; +//import "./framework/effects/animatedSelector.js"; +//import "./framework/offset.js"; +//import "./framework/dimensions.js"; +//import './framework/util/box.js' +//import './framework/util/imageLoader.js'; +//import './framework/util/keyboard.js'; +//import './framework/util/mediaQuery.js'; +//import './framework/util/motion.js'; +//import './framework/util/nest.js'; +//import './framework/util/timer.js'; +//import './framework/util/touch.js'; +//import './framework/util/triggers.js'; +//import './framework/elements/abide.js'; +//import './framework/elements/accordion.js'; +//import './framework/elements/accordionMenu.js'; +//import './framework/elements/drilldown.js'; +//import './framework/elements/dropdown.js'; +//import './framework/elements/dropdownMenu.js'; +//import './framework/elements/equalizer.js'; +//import './framework/elements/interchange.js'; +//import './framework/elements/magellan.js'; +//import './framework/elements/offcanvas.js'; +//import './framework/elements/orbit.js'; +//import './framework/elements/responsiveMenu.js'; +//import './framework/elements/responsiveToggle.js'; +//import './framework/elements/reveal.js'; +//import './framework/elements/slider.js'; +//import './framework/elements/switch.js'; +//import './framework/elements/smoothScroll.js'; +//import './framework/elements/sticky.js'; +//import './framework/elements/tabs.js'; +//import './framework/elements/toggler.js'; +//import './framework/elements/tooltip.js'; +//import './framework/elements/responsiveAccordionTabs.js'; + + + +})(); + +/******/ return __webpack_exports__; +/******/ })() +; +}); +//# sourceMappingURL=framework.js.map \ No newline at end of file diff --git a/dist/js/framework.js.map b/dist/js/framework.js.map new file mode 100644 index 0000000..9f6f9db --- /dev/null +++ b/dist/js/framework.js.map @@ -0,0 +1 @@ +{"version":3,"file":"framework.js","mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;;;;;;;;;;;;ACVA,sBAAsB,2BAA2B,oGAAoG,mBAAmB,iBAAiB,sHAAsH;AAC/S,kDAAkD,0CAA0C;AAC5F,4CAA4C,gBAAgB,kBAAkB,OAAO,2BAA2B,wDAAwD,gCAAgC,uDAAuD;AAC/P,8DAA8D,sEAAsE,8DAA8D,kDAAkD,iBAAiB,GAAG;AACxQ,6BAA6B,mCAAmC;AAChE,8BAA8B,4CAA4C,+BAA+B,oBAAoB,mCAAmC,sCAAsC,uEAAuE;AAC7Q,wDAAwD,6CAA6C;AACrG,8DAA8D,6CAA6C;AAC3G,8DAA8D,kCAAkC;AAChG,uDAAuD,4EAA4E;AACnI,0DAA0D,sBAAsB,wCAAwC;AACxH,8DAA8D,4EAA4E,uDAAuD;AACjM,sEAAsE,iCAAiC,oFAAoF;AAC3L,iEAAiE,sBAAsB,wCAAwC,OAAO,4BAA4B,mEAAmE;AAClM;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,YAAY;AACZ;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,mCAAmC;AACnC;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,qCAAqC;AACrC;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,qDAAqD;AACrD,8DAA8D;AAC9D;AACA,wEAAwE;AACxE,wDAAwD,8CAA8C;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,CAAC,EAAE,4CAAS;;;;;;;;;;;;;;ACzOZ,mCAAmC;AACnC,gCAAgC;AAChC,kDAAkD,gBAAgB,gEAAgE,wDAAwD,6DAA6D,sDAAsD;AAC7S,kCAAkC;AAClC,mCAAmC;AACnC,uCAAuC,uDAAuD,uCAAuC,SAAS,uBAAuB;AACrK,sBAAsB,2BAA2B,oGAAoG,mBAAmB,iBAAiB,sHAAsH;AAC/S;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,oBAAoB,kBAAkB;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,sBAAsB,iBAAiB;AACvC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,MAAM;AACN;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;AClJmC;AACI;AACxC;AACA;AACA,SAAS,2CAAe,eAAe,2CAAe,oBAAoB,2CAAe;AACzF;AACA;AACA,QAAQ,iDAAqB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,EAAE,4CAAS;AACX;AACA,CAAC,EAAE,4CAAS;;;;;;;;;;;;;;;;;;AC9B4B;AACJ;AACJ;AAChC,iEAAe,4CAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACHxB;AACA,sBAAsB,2BAA2B,oGAAoG,mBAAmB,iBAAiB,sHAAsH;AAC/S;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;AC7J0C;AAC1C;AACA;AACA;AACA;AACA,IAAI,SAAS,kDAAmB;AAChC;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;;;;;;UCZA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;;;ACNqD;AACD;AACnB;AACjC;AACA;AACA;AACA;AACmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAE0D","sources":["webpack://framework/webpack/universalModuleDefinition","webpack://framework/./src/framework/ajax.js","webpack://framework/./src/framework/core.js","webpack://framework/./src/framework/core/ready.js","webpack://framework/./src/framework/entries/framework.js","webpack://framework/./src/framework/helpers.js","webpack://framework/./src/framework/selector.js","webpack://framework/webpack/bootstrap","webpack://framework/webpack/runtime/define property getters","webpack://framework/webpack/runtime/hasOwnProperty shorthand","webpack://framework/webpack/runtime/make namespace object","webpack://framework/./src/framework.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"framework\"] = factory();\n\telse\n\t\troot[\"framework\"] = factory();\n})(self, () => {\nreturn ","function _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _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); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }\nfunction _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\nimport { Framework } from \"./core\";\n(function (f, _xhr, _default_args, _url, _type, _data, _callbacks, _load) {\n f.ajax = (_xhr = /*#__PURE__*/new WeakMap(), _default_args = /*#__PURE__*/new WeakMap(), _url = /*#__PURE__*/new WeakMap(), _type = /*#__PURE__*/new WeakMap(), _data = /*#__PURE__*/new WeakMap(), _callbacks = /*#__PURE__*/new WeakMap(), _load = /*#__PURE__*/new WeakSet(), /*#__PURE__*/function () {\n function _class(args) {\n _classCallCheck(this, _class);\n _classPrivateMethodInitSpec(this, _load);\n _classPrivateFieldInitSpec(this, _xhr, {\n writable: true,\n value: null\n });\n _classPrivateFieldInitSpec(this, _default_args, {\n writable: true,\n value: {\n \"url\": \"\",\n \"type\": \"get\",\n \"data\": {},\n \"success\": null,\n \"error\": null\n }\n });\n _classPrivateFieldInitSpec(this, _url, {\n writable: true,\n value: \"\"\n });\n _classPrivateFieldInitSpec(this, _type, {\n writable: true,\n value: \"\"\n });\n _classPrivateFieldInitSpec(this, _data, {\n writable: true,\n value: {}\n });\n _classPrivateFieldInitSpec(this, _callbacks, {\n writable: true,\n value: []\n });\n _classPrivateFieldSet(this, _xhr, new XMLHttpRequest());\n }\n _createClass(_class, [{\n key: \"done\",\n value: function done(callback) {\n if (typeof callback === \"function\") {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_success\": callback\n });\n }\n return this;\n }\n }, {\n key: \"success\",\n value: function success(callback) {\n return this.done(callback);\n }\n }, {\n key: \"fail\",\n value: function fail(callback) {\n if (typeof callback === \"function\") {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_error\": callback\n });\n }\n return this;\n }\n }, {\n key: \"error\",\n value: function error(callback) {\n return this.fail(callback);\n }\n }, {\n key: \"always\",\n value: function always(callback) {\n if (typeof callback === \"function\") {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_complete\": callback\n });\n }\n return this;\n }\n }, {\n key: \"complete\",\n value: function complete(callback) {\n return this.always(callback);\n }\n }, {\n key: \"progress\",\n value: function progress(callback) {\n if (typeof callback === \"function\") {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_progress\": callback\n });\n }\n return this;\n }\n }, {\n key: \"then\",\n value: function then(successCallback) {\n var errorCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n if (typeof callback_success === \"function\") {\n if (typeof errorCallback === \"function\") {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_success\": successCallback,\n \"callback_error\": errorCallback\n });\n } else {\n _classPrivateFieldGet(this, _callbacks).push({\n \"callback_success\": callback_success\n });\n }\n }\n return this;\n }\n }, {\n key: \"abort\",\n value: function abort() {\n _classPrivateFieldGet(this, _xhr).abort();\n return this;\n }\n }]);\n return _class;\n }());\n function _load2() {\n var _this = this;\n _classPrivateFieldGet(this, _xhr).onerror = function (error) {\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_error !== undefined) {\n data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error);\n }\n });\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_complete !== undefined) {\n data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, error);\n }\n });\n };\n _classPrivateFieldGet(this, _xhr).addEventListener(\"progress\", function (evt) {\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_progress !== undefined) {\n data.callback_progress(evt, _classPrivateFieldGet(_this, _xhr));\n }\n });\n });\n _classPrivateFieldGet(this, _xhr).addEventListener(\"load\", function (evt) {\n var response = {};\n if (_classPrivateFieldGet(_this, _xhr).readyState == 4) {\n try {\n response = JSON.parse(_this.responseText);\n } catch (error) {\n response = _this.responseText;\n }\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_success !== undefined) {\n data.callback_success(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status);\n }\n });\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_complete !== undefined) {\n data.callback_complete(response, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _classPrivateFieldGet(_this, _xhr).status);\n }\n });\n } else {\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_error !== undefined) {\n data.callback_error(_classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status);\n }\n });\n _classPrivateFieldGet(_this, _callbacks).forEach(function (data) {\n if (data.callback_complete !== undefined) {\n data.callback_complete({}, _classPrivateFieldGet(_this, _xhr), _classPrivateFieldGet(_this, _xhr).statusText, _this.status);\n }\n });\n }\n });\n }\n f.ajax = function (args) {\n /*\r\n \tjqXHR.done(function( data, textStatus, jqXHR ){});\r\n \t\t\tjqXHR.fail(function( jqXHR, textStatus, errorThrown ){});\r\n \t\r\n \tjqXHR.always(function( data|jqXHR, textStatus, jqXHR|errorThrown){});\r\n \t\t\tjqXHR.then(function( data, textStatus, jqXHR ) {}, function( jqXHR, textStatus, errorThrown ){});\r\n .\r\n */\n xhttp.onload = function () {\n var response;\n if (this.readyState == 4 && this.status == 200) {\n var _response = \"\";\n try {\n //check if the response in json \n //if json the parse it\n _response = JSON.parse(this.responseText);\n } catch (e) {\n //if not json the simple reurn the response\n _response = this.responseText;\n }\n // give a success callback\n return success(_response);\n } else {\n //give a fail callback with the error status \n return fail(this.status);\n }\n };\n var parameters = \"\";\n if (args) {\n type = args[\"type\"];\n if ('data' in args) {\n //converting object to url URLSearchParams\n parameters = new URLSearchParams(args['data']).toString();\n }\n }\n if (type && type.toUpperCase() == 'POST') {\n xhttp.open(\"POST\", url, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(parameters);\n } else if (!type || type.toUpperCase() == 'GET') {\n xhttp.open(\"GET\", url + \"?\" + parameters, true);\n xhttp.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhttp.send();\n }\n };\n})(Framework);","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\nfunction _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.\"); }\nfunction _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); }\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\nfunction _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; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar Framework = function Framework(el) {\n return Framework.fn.init(el);\n};\nFramework.__proto__ = Framework.prototype = {};\nFramework.v = {};\nFramework.f = {};\nFramework.f.init = function (el) {};\nFramework.fn.extend = function (name, func) {\n if (typeof name == \"string\") {\n Framework.extend(Framework.fn, {\n name: func\n });\n } else if (_typeof(name) == \"object\") {\n for (var n in name) {\n Framework.fn.extend(n, name[n]);\n }\n }\n return Framework.fn;\n};\nFramework.extend = function (name, func) {\n if (typeof name == \"string\") {\n Framework[name] = func;\n } else if (_typeof(name) === _typeof(func) === \"object\") {\n $keys = Object.keys(func);\n for (var i = 0; i < $keys.length; i++) {\n var n = $keys[i];\n var v = func[n];\n name[n] = v;\n }\n }\n return Framework;\n};\nFramework.extend(Framework.fn, {\n ready: function ready(callback) {\n var _this = this;\n this[0].addEventListener('readystatechange', function (e) {\n if (_this[0].readyState === \"complete\") {\n callback();\n return true;\n }\n });\n },\n each: function each(callback) {\n if (callback && typeof callback == 'function') {\n for (var i = 0; i < this.length; i++) {\n callback(this[i], i);\n }\n return this;\n }\n },\n siblings: function siblings() {\n var _this2 = this;\n return _toConsumableArray(this[0].parentNode.children).filter(function (c) {\n return c != _this2[0];\n });\n },\n addClass: function addClass(className) {\n this.each(function (el) {\n el.classList.add(className);\n });\n return this;\n },\n removeClass: function removeClass(className) {\n this.each(function (el) {\n el.classList.remove(className);\n });\n return this;\n },\n hasClass: function hasClass(className) {\n return this[0].classList.contains(className);\n },\n css: function css(propertyObject) {\n this.each(function (el) {\n Object.assign(el.style, propertyObject);\n });\n return this;\n },\n attr: function attr(_attr) {\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var getattr = this;\n if (value) {\n this.each(function (el) {\n el.setAttribute(_attr, value);\n });\n } else {\n getattr = this[0].getAttribute(_attr);\n }\n return getattr;\n },\n html: function html(data) {\n if (data) {\n this.each(function (el) {\n el.innerHTML = data;\n });\n } else {\n return this[0].innerHTML;\n }\n return this;\n },\n prepend: function prepend(el) {\n this[0].prepend(el);\n return this;\n },\n append: function append(el) {\n this[0].append(el);\n return this;\n },\n hide: function hide() {\n this.each(function (el) {\n el.style.display = \"none\";\n });\n return this;\n },\n show: function show() {\n this.each(function (el) {\n el.style.display = \"block\";\n });\n return this;\n },\n on: function on(event, child) {\n var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n if (callback != null) {\n var selector = child;\n this.each(function (element) {\n element.addEventListener(event, function (event) {\n if (event.target.matches(selector + ', ' + selector + ' *')) {\n callback.apply(event.target.closest(selector), arguments);\n }\n });\n });\n } else {\n //if the callback argument is not present then assume the child argument is being use as callback\n callback = child;\n this.each(function (element) {\n element.addEventListener(event, callback);\n });\n }\n return this;\n }\n});\nexport { Framework };","import { Framework } from \"../core\";\nimport * as CoreUtils from \"../helpers\";\n(function (f) {\n var ready = function ready(fn) {\n if (!CoreUtils.isset(document) || !CoreUtils.isset(document.head) || !CoreUtils.isset(document.body)) {\n return false;\n }\n if (CoreUtils.is_function(fn)) {\n if (is_ready == false) {\n ready_list.push(fn);\n }\n }\n if (!isset(fn) && is_ready == true) {\n while (ready_list.length > 0) {\n var f = ready_list.shift();\n f();\n }\n }\n };\n function on_ready() {\n if (document.readyState !== 'loading') {\n ready();\n } else {\n document.addEventListener('DOMContentLoaded', ready);\n }\n }\n var is_ready = false;\n var ready_list = [];\n Framework.extend(\"ready\", ready);\n on_ready();\n})(Framework);","import * as CoreUtils from \"../helpers\";\nimport { Framework } from '../core';\nexport { Framework, CoreUtils };\nexport default Framework;","var _arguments = typeof arguments === \"undefined\" ? void 0 : arguments;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar intval = function intval() {\n return parseInt.apply(console, _arguments);\n};\nvar floatval = function floatval() {\n return parseFloat.apply(console, _arguments);\n};\nvar json_decode = function json_decode() {\n return JSON.parse.apply(console, _arguments);\n};\nvar json_encode = function json_encode() {\n return JSON.stringify.apply(console, _arguments);\n};\nvar explode = function explode(selector, string) {\n return string.toString().split(selector);\n};\nvar implode = function implode(selector, array) {\n return array.join(selector);\n};\nvar str_replace = function str_replace(find, replace, string) {\n if (typeof find == \"array\") {\n var temp = \"\";\n find.forEach(function (toFind) {\n if (temp == \"\") {\n temp = string.toString();\n }\n temp = temp.replace(toFind, replace);\n });\n return temp;\n }\n return string.replace(find, replace);\n};\nvar is_int = function is_int(val) {\n if (parseInt(val) < parseFloat(val)) {\n return false;\n }\n return true;\n};\nvar is_float = function is_float(val) {\n if (parseInt(val) < parseFloat(val)) {\n return true;\n }\n return false;\n};\nvar isset = function isset(val) {\n if (typeof val !== \"undefined\") {\n return true;\n }\n return false;\n};\nvar name_to_object = function name_to_object($name) {\n $switch = $name.toLocaleLowerCase();\n switch ($switch) {\n case \"function\":\n return Function;\n break;\n case \"string\":\n return String;\n break;\n case \"object\":\n return Object;\n break;\n case \"array\":\n return Array;\n break;\n default:\n if (isset(window[$name])) {\n return window[$name];\n } else if (isset(document[$name])) {\n return document[$name];\n } else {\n return null;\n }\n break;\n }\n};\nvar instance_of = function instance_of($var, $class) {\n var $origin = $class;\n if (typeof $class == \"string\") {\n $class = name_to_object($class);\n }\n if ($class === null) {\n console.warn(\"not implemented\", $origin);\n return false;\n }\n if ($var instanceof $class) {\n return true;\n }\n return false;\n};\nvar is_array = function is_array(obj) {\n return isset(obj) && obj instanceof Array;\n};\nvar is_string = function is_string(obj) {\n return isset(obj) && obj.constructor.name == 'String';\n};\nvar array_search = function array_search(value, array) {\n return is_array(array) && isset(value) ? Array.indexOf(array, value) : false;\n};\nvar strpos = function strpos($haystack, $neddle) {\n var $offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n if (!is_string($haystack) || !is_string($neddle) || !is_int($offset)) {\n if (is_int($offset)) {\n console.warn(\"The '$haystack' and 'neddle' must be a string!\");\n } else {\n console.warn(\"The '$offset must be an integer'\");\n }\n return false;\n }\n return $haystack.indexOf($neddle, $offset);\n};\nvar in_array = function in_array($needle, $haystack) {\n if (!is_array($haystack)) {\n console.warn(\"The '$haystack' must be a array\");\n return false;\n }\n var $index = $haystack.indexOf($needle) - 1;\n if ($index == -2) {\n return false;\n }\n return true;\n};\nvar is_object = function is_object(obj) {\n return isset(obj) && !is_array(obj) && !is_float(obj) && !is_int(obj) && !is_string(obj) && obj instanceof Object;\n};\nvar is_function = function is_function(obj) {\n return isset(obj) && obj instanceof Function;\n};\nvar foreach = function foreach(arg, func) {\n if (!is_function(func)) {\n console.warn(\"The 'func' argument must be a function\");\n return false;\n }\n if (!is_array(arg) || !is_object(arg)) {\n console.warn(\"The 'arg' argument must be a array or a object\");\n return false;\n }\n if (func.length > 1) {\n for (var i in arg) {\n func(i, arg[i]);\n }\n } else {\n for (var i in arg) {\n func(arg[i]);\n }\n }\n};\nvar isElement = function isElement(obj) {\n if (!isset(obj)) {\n return false;\n }\n if (obj instanceof HTMLElement) {\n //Using W3 DOM2 (works for FF, Opera and Chrome)\n return true;\n }\n return _typeof(obj) === \"object\" && obj.nodeType === 1 && _typeof(obj.style) === \"object\" && _typeof(obj.ownerDocument) === \"object\";\n};\nexport { intval, floatval, json_decode, json_encode, explode, implode, str_replace, instance_of, isset, foreach, array_search, strpos, is_int, is_float, is_array, in_array, is_object, is_function, isElement };","import * as CoreUtils from \"./helpers.js\";\nvar Selector = function Selector(obj) {\n var parentNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document;\n if (typeof obj == \"string\") {\n return Selector.resolve_string_to_object(obj, parentNode);\n } else if (CoreUtils.isElement(obj)) {\n return obj;\n } else {\n return {};\n }\n};\nSelector.prototype = Selector.__proto__ = {};\nSelector.resolve_string_to_object = function (string, parentNode) {};\nexport { Selector };","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export { Framework as Core } from \"./framework/core\";\nimport * as CoreUtils from \"./framework/helpers.js\";\nimport \"./framework/selector.js\";\n//import \"./framework/traversing.js\";\n//import \"./framework/callbacks.js\";\n//import \"./framework/deferred.js\";\n//import \"./framework/deferred/exceptionHook.js\";\nimport \"./framework/core/ready.js\";\n//import \"./framework/core/parseXML.js\";\n//import \"./framework/core/parseHTML.js\";\n//import \"./framework/data.js\";\n//import \"./framework/queue.js\";\n//import \"./framework/queue/delay.js\";\n//import \"./framework/attributes.js\";\n//import \"./framework/event.js\";\n//import \"./framework/event/trigger.js\";\n//import \"./framework/manipulation.js\";\n//import \"./framework/manipulation/_evalUrl.js\";\n//import \"./framework/wrap.js\";\n//import \"./framework/css.js\";\n//import \"./framework/css/hiddenVisibleSelectors.js\";\n//import \"./framework/css/showHide.js\";\n//import \"./framework/serialize.js\";\nimport \"./framework/ajax.js\";\n//import \"./framework/ajax/xhr.js\";\n//import \"./framework/ajax/script.js\";\n//import \"./framework/ajax/jsonp.js\";\n//import \"./framework/ajax/binary.js\";\n//import \"./framework/ajax/load.js\";\n//import \"./framework/effects.js\";\n//import \"./framework/effects/animatedSelector.js\";\n//import \"./framework/offset.js\";\n//import \"./framework/dimensions.js\";\n//import './framework/util/box.js'\n//import './framework/util/imageLoader.js';\n//import './framework/util/keyboard.js';\n//import './framework/util/mediaQuery.js';\n//import './framework/util/motion.js';\n//import './framework/util/nest.js';\n//import './framework/util/timer.js';\n//import './framework/util/touch.js';\n//import './framework/util/triggers.js';\n//import './framework/elements/abide.js';\n//import './framework/elements/accordion.js';\n//import './framework/elements/accordionMenu.js';\n//import './framework/elements/drilldown.js';\n//import './framework/elements/dropdown.js';\n//import './framework/elements/dropdownMenu.js';\n//import './framework/elements/equalizer.js';\n//import './framework/elements/interchange.js';\n//import './framework/elements/magellan.js';\n//import './framework/elements/offcanvas.js';\n//import './framework/elements/orbit.js';\n//import './framework/elements/responsiveMenu.js';\n//import './framework/elements/responsiveToggle.js';\n//import './framework/elements/reveal.js';\n//import './framework/elements/slider.js';\n//import './framework/elements/switch.js';\n//import './framework/elements/smoothScroll.js';\n//import './framework/elements/sticky.js';\n//import './framework/elements/tabs.js';\n//import './framework/elements/toggler.js';\n//import './framework/elements/tooltip.js';\n//import './framework/elements/responsiveAccordionTabs.js';\n\nexport { Framework } from './framework/entries/framework';\nexport { default } from './framework/entries/framework';"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/node_modules/.cache/babel-loader/1766a293e3d806a85647d4db6a297f4cea1d7747797e56a9b192fba4bc0067ca.json.gz b/node_modules/.cache/babel-loader/1766a293e3d806a85647d4db6a297f4cea1d7747797e56a9b192fba4bc0067ca.json.gz new file mode 100644 index 0000000..0c6ed5b --- /dev/null +++ b/node_modules/.cache/babel-loader/1766a293e3d806a85647d4db6a297f4cea1d7747797e56a9b192fba4bc0067ca.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/29561a4c06f66cbef864ab6f946086885dcb8f931127ba8b75618cd7dddab100.json.gz b/node_modules/.cache/babel-loader/29561a4c06f66cbef864ab6f946086885dcb8f931127ba8b75618cd7dddab100.json.gz new file mode 100644 index 0000000..cec36a2 --- /dev/null +++ b/node_modules/.cache/babel-loader/29561a4c06f66cbef864ab6f946086885dcb8f931127ba8b75618cd7dddab100.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/5018fedc1aa6bb349cf9161b25ec46377c3767df8d79128ddb1db08a4da031fa.json.gz b/node_modules/.cache/babel-loader/5018fedc1aa6bb349cf9161b25ec46377c3767df8d79128ddb1db08a4da031fa.json.gz new file mode 100644 index 0000000..43b52f7 --- /dev/null +++ b/node_modules/.cache/babel-loader/5018fedc1aa6bb349cf9161b25ec46377c3767df8d79128ddb1db08a4da031fa.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/587840a8cad3865f1d992656f72eb1f94bdd756a187fb3d7c196dba9a4f1069c.json.gz b/node_modules/.cache/babel-loader/587840a8cad3865f1d992656f72eb1f94bdd756a187fb3d7c196dba9a4f1069c.json.gz new file mode 100644 index 0000000..e27bb4f --- /dev/null +++ b/node_modules/.cache/babel-loader/587840a8cad3865f1d992656f72eb1f94bdd756a187fb3d7c196dba9a4f1069c.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/6e242cacb02cf1040f0a2e72cd83fea5729744e11c7da02a19bf095e6f92ae36.json.gz b/node_modules/.cache/babel-loader/6e242cacb02cf1040f0a2e72cd83fea5729744e11c7da02a19bf095e6f92ae36.json.gz new file mode 100644 index 0000000..d8f3ec3 --- /dev/null +++ b/node_modules/.cache/babel-loader/6e242cacb02cf1040f0a2e72cd83fea5729744e11c7da02a19bf095e6f92ae36.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/6faa1a57a53dee4280bdd872a44780e45fb95a80dce9bf5e13e9a8bb736be134.json.gz b/node_modules/.cache/babel-loader/6faa1a57a53dee4280bdd872a44780e45fb95a80dce9bf5e13e9a8bb736be134.json.gz new file mode 100644 index 0000000..1bcbfe6 --- /dev/null +++ b/node_modules/.cache/babel-loader/6faa1a57a53dee4280bdd872a44780e45fb95a80dce9bf5e13e9a8bb736be134.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/75732eba1e160e0ad63622d3888d6787c7d6831f672708b2fe4b1d9ded64722a.json.gz b/node_modules/.cache/babel-loader/75732eba1e160e0ad63622d3888d6787c7d6831f672708b2fe4b1d9ded64722a.json.gz new file mode 100644 index 0000000..0c6ed5b --- /dev/null +++ b/node_modules/.cache/babel-loader/75732eba1e160e0ad63622d3888d6787c7d6831f672708b2fe4b1d9ded64722a.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/8c6d72c9b685f796a0f1adac6ada7ccb8cd94e0734a64e8840cd10588e7acf50.json.gz b/node_modules/.cache/babel-loader/8c6d72c9b685f796a0f1adac6ada7ccb8cd94e0734a64e8840cd10588e7acf50.json.gz new file mode 100644 index 0000000..510c2e2 --- /dev/null +++ b/node_modules/.cache/babel-loader/8c6d72c9b685f796a0f1adac6ada7ccb8cd94e0734a64e8840cd10588e7acf50.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/94790354e0dae0f0f80aca2f56dee42723f749c791296c892847625a6a383a71.json.gz b/node_modules/.cache/babel-loader/94790354e0dae0f0f80aca2f56dee42723f749c791296c892847625a6a383a71.json.gz new file mode 100644 index 0000000..43b52f7 --- /dev/null +++ b/node_modules/.cache/babel-loader/94790354e0dae0f0f80aca2f56dee42723f749c791296c892847625a6a383a71.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/9bf9aeddaaa247847dcca0933fd7b5c47b64f1bb77dc8e4292582e7912f2d6df.json.gz b/node_modules/.cache/babel-loader/9bf9aeddaaa247847dcca0933fd7b5c47b64f1bb77dc8e4292582e7912f2d6df.json.gz new file mode 100644 index 0000000..c3d54fe --- /dev/null +++ b/node_modules/.cache/babel-loader/9bf9aeddaaa247847dcca0933fd7b5c47b64f1bb77dc8e4292582e7912f2d6df.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/a4e723527c1c9b6f45c195d321cf32238bc0deac2c64770749a660b4b13653fe.json.gz b/node_modules/.cache/babel-loader/a4e723527c1c9b6f45c195d321cf32238bc0deac2c64770749a660b4b13653fe.json.gz new file mode 100644 index 0000000..5a0362e --- /dev/null +++ b/node_modules/.cache/babel-loader/a4e723527c1c9b6f45c195d321cf32238bc0deac2c64770749a660b4b13653fe.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/a4f5c0d7d0138b27eaa7f6aa56d4a8015ce92bd226e06ac4c7995159750e7f36.json.gz b/node_modules/.cache/babel-loader/a4f5c0d7d0138b27eaa7f6aa56d4a8015ce92bd226e06ac4c7995159750e7f36.json.gz new file mode 100644 index 0000000..c657d8e --- /dev/null +++ b/node_modules/.cache/babel-loader/a4f5c0d7d0138b27eaa7f6aa56d4a8015ce92bd226e06ac4c7995159750e7f36.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/a583311cbf7d21039f2ce6d712fde4a5874e3e099aca805307027a2573a96d1d.json.gz b/node_modules/.cache/babel-loader/a583311cbf7d21039f2ce6d712fde4a5874e3e099aca805307027a2573a96d1d.json.gz new file mode 100644 index 0000000..96467c3 --- /dev/null +++ b/node_modules/.cache/babel-loader/a583311cbf7d21039f2ce6d712fde4a5874e3e099aca805307027a2573a96d1d.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/ac446e6482b2003b63b1bef44e206f41e62a748326b7e781ed077ac6037f4966.json.gz b/node_modules/.cache/babel-loader/ac446e6482b2003b63b1bef44e206f41e62a748326b7e781ed077ac6037f4966.json.gz new file mode 100644 index 0000000..cf98654 --- /dev/null +++ b/node_modules/.cache/babel-loader/ac446e6482b2003b63b1bef44e206f41e62a748326b7e781ed077ac6037f4966.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/b76ee2906736dbb04748cd0f0b1a02eb15bfebc3dafe95de3c6c90bee60fa2b5.json.gz b/node_modules/.cache/babel-loader/b76ee2906736dbb04748cd0f0b1a02eb15bfebc3dafe95de3c6c90bee60fa2b5.json.gz new file mode 100644 index 0000000..e8252d0 --- /dev/null +++ b/node_modules/.cache/babel-loader/b76ee2906736dbb04748cd0f0b1a02eb15bfebc3dafe95de3c6c90bee60fa2b5.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/c949c19f987f93e0eb5699280ef904b1d714515700ba7a52bed5640974b35ad0.json.gz b/node_modules/.cache/babel-loader/c949c19f987f93e0eb5699280ef904b1d714515700ba7a52bed5640974b35ad0.json.gz new file mode 100644 index 0000000..db92304 --- /dev/null +++ b/node_modules/.cache/babel-loader/c949c19f987f93e0eb5699280ef904b1d714515700ba7a52bed5640974b35ad0.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/e6d354d8d5040147b766d74afd656df3a73c086bd36cadd288a5e7814397a24e.json.gz b/node_modules/.cache/babel-loader/e6d354d8d5040147b766d74afd656df3a73c086bd36cadd288a5e7814397a24e.json.gz new file mode 100644 index 0000000..aad1cb6 --- /dev/null +++ b/node_modules/.cache/babel-loader/e6d354d8d5040147b766d74afd656df3a73c086bd36cadd288a5e7814397a24e.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/f5fe9a72296e11162b973e2830128eadbf24032060fa3e9b58e6ae0d3f60d084.json.gz b/node_modules/.cache/babel-loader/f5fe9a72296e11162b973e2830128eadbf24032060fa3e9b58e6ae0d3f60d084.json.gz new file mode 100644 index 0000000..c3d54fe --- /dev/null +++ b/node_modules/.cache/babel-loader/f5fe9a72296e11162b973e2830128eadbf24032060fa3e9b58e6ae0d3f60d084.json.gz Binary files differ diff --git a/node_modules/.cache/babel-loader/fb66dd2ebba3f8ce73c9d28a91f67b70eac1493a21e8cf2e4187278d551a3ae3.json.gz b/node_modules/.cache/babel-loader/fb66dd2ebba3f8ce73c9d28a91f67b70eac1493a21e8cf2e4187278d551a3ae3.json.gz new file mode 100644 index 0000000..cec36a2 --- /dev/null +++ b/node_modules/.cache/babel-loader/fb66dd2ebba3f8ce73c9d28a91f67b70eac1493a21e8cf2e4187278d551a3ae3.json.gz Binary files differ diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 2fc03e2..599a5a7 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -134,9 +134,9 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.23.10", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.10.tgz", - "integrity": "sha512-2XpP2XhkXzgxecPNEEK8Vz8Asj9aRxt08oKOqtiZoqV2UGZ5T+EkyP9sXQ9nwMxBIG34a7jmasVqoMop7VdPUw==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.24.0.tgz", + "integrity": "sha512-QAH+vfvts51BCsNZ2PhY6HAggnlS6omLLFTsIpeqZk/MmJ6cW7tgz5yRv0fMJThcr6FmbMrENh1RgrWPTYA76g==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", @@ -279,9 +279,9 @@ } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", - "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" @@ -486,6 +486,40 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/plugin-proposal-class-properties": { + "version": "7.18.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", + "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", + "deprecated": "This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.18.6", + "@babel/helper-plugin-utils": "^7.18.6" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-proposal-decorators": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.24.0.tgz", + "integrity": "sha512-LiT1RqZWeij7X+wGxCoYh3/3b8nVOX6/7BZ9wiQgAIyjoeQWdROaodJCgT+dwtbjHaz0r7bEbHJzjSbVfcOyjQ==", + "dev": true, + "dependencies": { + "@babel/helper-create-class-features-plugin": "^7.24.0", + "@babel/helper-plugin-utils": "^7.24.0", + "@babel/plugin-syntax-decorators": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-proposal-private-property-in-object": { "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", @@ -537,6 +571,21 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/plugin-syntax-decorators": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.24.0.tgz", + "integrity": "sha512-MXW3pQCu9gUiVGzqkGqsgiINDVYXoAnrY8FYF/rmb+OfufNF0zHMpHPN4ulRrinxYT8Vk/aZJxYqOKsDECjKAw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.24.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js b/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js index b3b9f90..75d502a 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js @@ -86,11 +86,8 @@ return _core.types.classProperty(key, value, undefined, undefined, isStatic); } } -function addProxyAccessorsFor(className, element, originalKey, targetKey, version, isComputed = false) { - const { - static: isStatic - } = element.node; - const thisArg = version === "2023-05" && isStatic ? className : _core.types.thisExpression(); +function addProxyAccessorsFor(className, element, originalKey, targetKey, version, isComputed, isStatic) { + const thisArg = (version === "2023-11" || version === "2023-05") && isStatic ? className : _core.types.thisExpression(); const getterBody = _core.types.blockStatement([_core.types.returnStatement(_core.types.memberExpression(_core.types.cloneNode(thisArg), _core.types.cloneNode(targetKey)))]); const setterBody = _core.types.blockStatement([_core.types.expressionStatement(_core.types.assignmentExpression("=", _core.types.memberExpression(_core.types.cloneNode(thisArg), _core.types.cloneNode(targetKey)), _core.types.identifier("v")))]); let getter, setter; @@ -105,7 +102,7 @@ element.insertAfter(getter); } function extractProxyAccessorsFor(targetKey, version) { - if (version !== "2023-05" && version !== "2023-01") { + if (version !== "2023-11" && version !== "2023-05" && version !== "2023-01") { return [_core.template.expression.ast` function () { return this.${_core.types.cloneNode(targetKey)}; @@ -131,6 +128,9 @@ } initializer.replaceWith(maybeSequenceExpression(expressions)); } +function prependExpressionsToStaticBlock(expressions, blockPath) { + blockPath.unshiftContainer("body", _core.types.expressionStatement(maybeSequenceExpression(expressions))); +} function prependExpressionsToConstructor(expressions, constructorPath) { constructorPath.node.body.body.unshift(_core.types.expressionStatement(maybeSequenceExpression(expressions))); } @@ -176,6 +176,9 @@ } return _core.types.classMethod("constructor", _core.types.identifier("constructor"), isDerivedClass ? [_core.types.restElement(_core.types.identifier("args"))] : [], _core.types.blockStatement(body)); } +function createStaticBlockFromExpressions(expressions) { + return _core.types.staticBlock([_core.types.expressionStatement(maybeSequenceExpression(expressions))]); +} const FIELD = 0; const ACCESSOR = 1; const METHOD = 2; @@ -202,45 +205,37 @@ } } } -function isDecoratorInfo(info) { - return "decorators" in info; -} -function filteredOrderedDecoratorInfo(info) { - const filtered = info.filter(isDecoratorInfo); - return [...filtered.filter(el => el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...filtered.filter(el => !el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...filtered.filter(el => el.isStatic && el.kind === FIELD), ...filtered.filter(el => !el.isStatic && el.kind === FIELD)]; +function toSortedDecoratorInfo(info) { + return [...info.filter(el => el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...info.filter(el => !el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER), ...info.filter(el => el.isStatic && el.kind === FIELD), ...info.filter(el => !el.isStatic && el.kind === FIELD)]; } function generateDecorationList(decorators, decoratorsThis, version) { const decsCount = decorators.length; - const hasOneThis = decoratorsThis.some(Boolean); + const haveOneThis = decoratorsThis.some(Boolean); const decs = []; for (let i = 0; i < decsCount; i++) { - if (version === "2023-05" && hasOneThis) { + if ((version === "2023-11" || version === "2023-05") && haveOneThis) { decs.push(decoratorsThis[i] || _core.types.unaryExpression("void", _core.types.numericLiteral(0))); } decs.push(decorators[i]); } return { - hasThis: hasOneThis, + haveThis: haveOneThis, decs }; } -function generateDecorationExprs(info, version) { - return _core.types.arrayExpression(filteredOrderedDecoratorInfo(info).map(el => { - const { - decs, - hasThis - } = generateDecorationList(el.decorators, el.decoratorsThis, version); +function generateDecorationExprs(decorationInfo, version) { + return _core.types.arrayExpression(decorationInfo.map(el => { let flag = el.kind; if (el.isStatic) { - flag += version === "2023-05" ? STATIC : STATIC_OLD_VERSION; + flag += version === "2023-11" || version === "2023-05" ? STATIC : STATIC_OLD_VERSION; } - if (hasThis) flag += DECORATORS_HAVE_THIS; - return _core.types.arrayExpression([decs.length === 1 ? decs[0] : _core.types.arrayExpression(decs), _core.types.numericLiteral(flag), el.name, ...(el.privateMethods || [])]); + if (el.decoratorsHaveThis) flag += DECORATORS_HAVE_THIS; + return _core.types.arrayExpression([el.decoratorsArray, _core.types.numericLiteral(flag), el.name, ...(el.privateMethods || [])]); })); } function extractElementLocalAssignments(decorationInfo) { const localIds = []; - for (const el of filteredOrderedDecoratorInfo(decorationInfo)) { + for (const el of decorationInfo) { const { locals } = el; @@ -252,12 +247,9 @@ } return localIds; } -function addCallAccessorsFor(element, key, getId, setId) { - element.insertAfter(_core.types.classPrivateMethod("get", _core.types.cloneNode(key), [], _core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.cloneNode(getId), [_core.types.thisExpression()]))]))); - element.insertAfter(_core.types.classPrivateMethod("set", _core.types.cloneNode(key), [_core.types.identifier("v")], _core.types.blockStatement([_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(setId), [_core.types.thisExpression(), _core.types.identifier("v")]))]))); -} -function isNotTsParameter(node) { - return node.type !== "TSParameterProperty"; +function addCallAccessorsFor(version, element, key, getId, setId, isStatic) { + element.insertAfter(_core.types.classPrivateMethod("get", _core.types.cloneNode(key), [], _core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.cloneNode(getId), version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()]))]), isStatic)); + element.insertAfter(_core.types.classPrivateMethod("set", _core.types.cloneNode(key), [_core.types.identifier("v")], _core.types.blockStatement([_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(setId), version === "2023-11" && isStatic ? [_core.types.identifier("v")] : [_core.types.thisExpression(), _core.types.identifier("v")]))]), isStatic)); } function movePrivateAccessor(element, key, methodLocalVar, isStatic) { let params; @@ -285,12 +277,50 @@ if (exprs.length === 1) return exprs[0]; return _core.types.sequenceExpression(exprs); } +function createFunctionExpressionFromPrivateMethod(node) { + const { + params, + body, + generator: isGenerator, + async: isAsync + } = node; + return _core.types.functionExpression(undefined, params, body, isGenerator, isAsync); +} function createSetFunctionNameCall(state, className) { return _core.types.callExpression(state.addHelper("setFunctionName"), [_core.types.thisExpression(), className]); } function createToPropertyKeyCall(state, propertyKey) { return _core.types.callExpression(state.addHelper("toPropertyKey"), [propertyKey]); } +function createPrivateBrandCheckClosure(brandName) { + return _core.types.arrowFunctionExpression([_core.types.identifier("_")], _core.types.binaryExpression("in", _core.types.cloneNode(brandName), _core.types.identifier("_"))); +} +function usesFunctionContext(expression) { + try { + _core.types.traverseFast(expression, node => { + if (_core.types.isThisExpression(node) || _core.types.isSuper(node) || _core.types.isIdentifier(node, { + name: "arguments" + }) || _core.types.isMetaProperty(node) && node.meta.name !== "import") { + throw null; + } + }); + return false; + } catch (_unused) { + return true; + } +} +function usesPrivateField(expression) { + try { + _core.types.traverseFast(expression, node => { + if (_core.types.isPrivateName(node)) { + throw null; + } + }); + return false; + } catch (_unused2) { + return true; + } +} function checkPrivateMethodUpdateError(path, decoratedPrivateMethods) { const privateNameVisitor = (0, _fields.privateNameVisitorFactory)({ PrivateName(path, state) { @@ -311,9 +341,12 @@ }); } function transformClass(path, state, constantSuper, version, className, propertyVisitor) { + var _classDecorationsId; const body = path.get("body.body"); const classDecorators = path.node.decorators; let hasElementDecorators = false; + let hasComputedKeysSideEffects = false; + let elemDecsUseFnContext = false; const generateClassPrivateUid = createLazyPrivateUidGeneratorForClass(path); const assignments = []; const scopeParent = path.scope.parent; @@ -338,6 +371,9 @@ break; case "ClassAccessorProperty": propertyVisitor.ClassAccessorProperty(element, state); + if (version === "2023-11") { + break; + } default: if (element.node.static) { var _staticInitLocal; @@ -349,6 +385,7 @@ break; } hasElementDecorators = true; + elemDecsUseFnContext || (elemDecsUseFnContext = element.node.decorators.some(usesFunctionContext)); } else if (element.node.type === "ClassAccessorProperty") { propertyVisitor.ClassAccessorProperty(element, state); const { @@ -361,7 +398,10 @@ const newField = generateClassProperty(newId, value, isStatic); const keyPath = element.get("key"); const [newPath] = element.replaceWith(newField); - addProxyAccessorsFor(path.node.id, newPath, computed && !keyPath.isConstantExpression() ? memoiseExpression(createToPropertyKeyCall(state, key), "computedKey") : key, newId, version, computed); + addProxyAccessorsFor(path.node.id, newPath, computed && !keyPath.isConstantExpression() ? memoiseExpression(createToPropertyKeyCall(state, key), "computedKey") : key, newId, version, computed, isStatic); + } + if ("computed" in element.node && element.node.computed) { + hasComputedKeysSideEffects || (hasComputedKeysSideEffects = !scopeParent.isStatic(element.node.key)); } } if (!classDecorators && !hasElementDecorators) { @@ -375,42 +415,36 @@ let constructorPath; const decoratedPrivateMethods = new Set(); let classInitLocal, classIdLocal; - const decoratorsThis = new Map(); - const maybeExtractDecorators = (decorators, memoiseInPlace) => { - let needMemoise = false; - for (const decorator of decorators) { - const { - expression - } = decorator; - if (version === "2023-05" && _core.types.isMemberExpression(expression)) { - let object; - if (_core.types.isSuper(expression.object) || _core.types.isThisExpression(expression.object)) { - needMemoise = true; - if (memoiseInPlace) { - object = memoiseExpression(_core.types.thisExpression(), "obj"); - } else { - object = _core.types.thisExpression(); - } - } else { - if (!scopeParent.isStatic(expression.object)) { - needMemoise = true; - if (memoiseInPlace) { - expression.object = memoiseExpression(expression.object, "obj"); - } - } + let decoratorReceiverId = null; + function handleDecoratorExpressions(expressions) { + let hasSideEffects = false; + let usesFnContext = false; + const decoratorsThis = []; + for (const expression of expressions) { + let object; + if ((version === "2023-11" || version === "2023-05") && _core.types.isMemberExpression(expression)) { + if (_core.types.isSuper(expression.object)) { + object = _core.types.thisExpression(); + } else if (scopeParent.isStatic(expression.object)) { object = _core.types.cloneNode(expression.object); - } - decoratorsThis.set(decorator, object); - } - if (!scopeParent.isStatic(expression)) { - needMemoise = true; - if (memoiseInPlace) { - decorator.expression = memoiseExpression(expression, "dec"); + } else { + var _decoratorReceiverId; + (_decoratorReceiverId = decoratorReceiverId) != null ? _decoratorReceiverId : decoratorReceiverId = scopeParent.generateDeclaredUidIdentifier("obj"); + object = _core.types.assignmentExpression("=", _core.types.cloneNode(decoratorReceiverId), expression.object); + expression.object = _core.types.cloneNode(decoratorReceiverId); } } + decoratorsThis.push(object); + hasSideEffects || (hasSideEffects = !scopeParent.isStatic(expression)); + usesFnContext || (usesFnContext = usesFunctionContext(expression)); } - return needMemoise && !memoiseInPlace; - }; + return { + hasSideEffects, + usesFnContext, + decoratorsThis + }; + } + const willExtractSomeElemDecs = hasComputedKeysSideEffects || elemDecsUseFnContext || version !== "2023-11"; let needsDeclaraionForClassBinding = false; let classDecorationsFlag = 0; let classDecorations = []; @@ -423,14 +457,19 @@ path } = replaceClassWithVar(path, className)); path.node.decorators = null; - const needMemoise = maybeExtractDecorators(classDecorators, false); + const decoratorExpressions = classDecorators.map(el => el.expression); + const classDecsUsePrivateName = decoratorExpressions.some(usesPrivateField); const { - hasThis, + hasSideEffects, + decoratorsThis + } = handleDecoratorExpressions(decoratorExpressions); + const { + haveThis, decs - } = generateDecorationList(classDecorators.map(el => el.expression), classDecorators.map(dec => decoratorsThis.get(dec)), version); - classDecorationsFlag = hasThis ? 1 : 0; + } = generateDecorationList(decoratorExpressions, decoratorsThis, version); + classDecorationsFlag = haveThis ? 1 : 0; classDecorations = decs; - if (needMemoise) { + if (hasSideEffects && willExtractSomeElemDecs || classDecsUsePrivateName) { classDecorationsId = memoiseExpression(_core.types.arrayExpression(classDecorations), "classDecs"); } } else { @@ -441,42 +480,63 @@ } let lastInstancePrivateName; let needsInstancePrivateBrandCheck = false; - let fieldInitializerAssignments = []; + let fieldInitializerExpressions = []; + let staticFieldInitializerExpressions = []; if (hasElementDecorators) { if (protoInitLocal) { const protoInitCall = _core.types.callExpression(_core.types.cloneNode(protoInitLocal), [_core.types.thisExpression()]); - fieldInitializerAssignments.push(protoInitCall); + fieldInitializerExpressions.push(protoInitCall); } for (const element of body) { if (!isClassDecoratableElementPath(element)) { + if (staticFieldInitializerExpressions.length > 0 && element.isStaticBlock()) { + prependExpressionsToStaticBlock(staticFieldInitializerExpressions, element); + staticFieldInitializerExpressions = []; + } continue; } const { node } = element; - const decorators = element.node.decorators; + const decorators = node.decorators; const hasDecorators = !!(decorators != null && decorators.length); - if (hasDecorators) { - maybeExtractDecorators(decorators, true); + const isComputed = "computed" in node && node.computed; + let name = "computedKey"; + if (node.key.type === "PrivateName") { + name = node.key.id.name; + } else if (!isComputed && node.key.type === "Identifier") { + name = node.key.name; } - const isComputed = "computed" in element.node && element.node.computed; + let decoratorsArray; + let decoratorsHaveThis; + if (hasDecorators) { + const decoratorExpressions = decorators.map(d => d.expression); + const { + hasSideEffects, + usesFnContext, + decoratorsThis + } = handleDecoratorExpressions(decoratorExpressions); + const { + decs, + haveThis + } = generateDecorationList(decoratorExpressions, decoratorsThis, version); + decoratorsHaveThis = haveThis; + decoratorsArray = decs.length === 1 ? decs[0] : _core.types.arrayExpression(decs); + if (usesFnContext || hasSideEffects && willExtractSomeElemDecs) { + decoratorsArray = memoiseExpression(decoratorsArray, name + "Decs"); + } + } if (isComputed) { if (!element.get("key").isConstantExpression()) { node.key = memoiseExpression(createToPropertyKeyCall(state, node.key), "computedKey"); } } - const kind = getElementKind(element); const { - key + key, + static: isStatic } = node; const isPrivate = key.type === "PrivateName"; - const isStatic = element.node.static; - let name = "computedKey"; - if (isPrivate) { - name = key.id.name; - } else if (!isComputed && key.type === "Identifier") { - name = key.name; - } + const kind = getElementKind(element); if (isPrivate && !isStatic) { if (hasDecorators) { needsInstancePrivateBrandCheck = true; @@ -490,14 +550,14 @@ })) { constructorPath = element; } + let locals; if (hasDecorators) { - let locals; let privateMethods; if (kind === ACCESSOR) { const { value } = element.node; - const params = [_core.types.thisExpression()]; + const params = version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()]; if (value) { params.push(_core.types.cloneNode(value)); } @@ -510,22 +570,25 @@ privateMethods = extractProxyAccessorsFor(newId, version); const getId = newPath.scope.parent.generateDeclaredUidIdentifier(`get_${name}`); const setId = newPath.scope.parent.generateDeclaredUidIdentifier(`set_${name}`); - addCallAccessorsFor(newPath, key, getId, setId); + addCallAccessorsFor(version, newPath, key, getId, setId, isStatic); locals = [newFieldInitId, getId, setId]; } else { - addProxyAccessorsFor(path.node.id, newPath, key, newId, version, isComputed); - locals = newFieldInitId; + addProxyAccessorsFor(path.node.id, newPath, key, newId, version, isComputed, isStatic); + locals = [newFieldInitId]; } } else if (kind === FIELD) { const initId = element.scope.parent.generateDeclaredUidIdentifier(`init_${name}`); const valuePath = element.get("value"); - valuePath.replaceWith(_core.types.callExpression(_core.types.cloneNode(initId), [_core.types.thisExpression(), valuePath.node].filter(v => v))); - locals = initId; + const args = version === "2023-11" && isStatic ? [] : [_core.types.thisExpression()]; + if (valuePath.node) args.push(valuePath.node); + valuePath.replaceWith(_core.types.callExpression(_core.types.cloneNode(initId), args)); + locals = [initId]; if (isPrivate) { privateMethods = extractProxyAccessorsFor(key, version); } } else if (isPrivate) { - locals = element.scope.parent.generateDeclaredUidIdentifier(`call_${name}`); + const callId = element.scope.parent.generateDeclaredUidIdentifier(`call_${name}`); + locals = [callId]; const replaceSupers = new _helperReplaceSupers.default({ constantSuper, methodPath: element, @@ -535,17 +598,12 @@ refToPreserve: classIdLocal }); replaceSupers.replace(); - const { - params, - body, - async: isAsync - } = element.node; - privateMethods = [_core.types.functionExpression(undefined, params.filter(isNotTsParameter), body, isAsync)]; + privateMethods = [createFunctionExpressionFromPrivateMethod(element.node)]; if (kind === GETTER || kind === SETTER) { - movePrivateAccessor(element, _core.types.cloneNode(key), _core.types.cloneNode(locals), isStatic); + movePrivateAccessor(element, _core.types.cloneNode(key), _core.types.cloneNode(callId), isStatic); } else { const node = element.node; - path.node.body.body.unshift(_core.types.classPrivateProperty(key, _core.types.cloneNode(locals), [], node.static)); + path.node.body.body.unshift(_core.types.classPrivateProperty(key, _core.types.cloneNode(callId), [], node.static)); decoratedPrivateMethods.add(key.id.name); element.remove(); } @@ -562,8 +620,8 @@ } elementDecoratorInfo.push({ kind, - decorators: decorators.map(d => d.expression), - decoratorsThis: decorators.map(d => decoratorsThis.get(d)), + decoratorsArray, + decoratorsHaveThis, name: nameExpr, isStatic, privateMethods, @@ -573,27 +631,48 @@ element.node.decorators = null; } } - if (fieldInitializerAssignments.length > 0 && !isStatic && (kind === FIELD || kind === ACCESSOR)) { - prependExpressionsToFieldInitializer(fieldInitializerAssignments, element); - fieldInitializerAssignments = []; + if (fieldInitializerExpressions.length > 0 && !isStatic && (kind === FIELD || kind === ACCESSOR)) { + prependExpressionsToFieldInitializer(fieldInitializerExpressions, element); + fieldInitializerExpressions = []; + } + if (staticFieldInitializerExpressions.length > 0 && isStatic && (kind === FIELD || kind === ACCESSOR)) { + prependExpressionsToFieldInitializer(staticFieldInitializerExpressions, element); + staticFieldInitializerExpressions = []; + } + if (hasDecorators && version === "2023-11") { + if (kind === FIELD || kind === ACCESSOR) { + const initExtraId = scopeParent.generateDeclaredUidIdentifier(`init_extra_${name}`); + locals.push(initExtraId); + const initExtraCall = _core.types.callExpression(_core.types.cloneNode(initExtraId), isStatic ? [] : [_core.types.thisExpression()]); + if (!isStatic) { + fieldInitializerExpressions.push(initExtraCall); + } else { + staticFieldInitializerExpressions.push(initExtraCall); + } + } } } } - if (fieldInitializerAssignments.length > 0) { + if (fieldInitializerExpressions.length > 0) { const isDerivedClass = !!path.node.superClass; if (constructorPath) { if (isDerivedClass) { - insertExpressionsAfterSuperCallAndOptimize(fieldInitializerAssignments, constructorPath, protoInitLocal); + insertExpressionsAfterSuperCallAndOptimize(fieldInitializerExpressions, constructorPath, protoInitLocal); } else { - prependExpressionsToConstructor(fieldInitializerAssignments, constructorPath); + prependExpressionsToConstructor(fieldInitializerExpressions, constructorPath); } } else { - path.node.body.body.unshift(createConstructorFromExpressions(fieldInitializerAssignments, isDerivedClass)); + path.node.body.body.unshift(createConstructorFromExpressions(fieldInitializerExpressions, isDerivedClass)); } - fieldInitializerAssignments = []; + fieldInitializerExpressions = []; } - const elementDecorations = generateDecorationExprs(elementDecoratorInfo, version); - const elementLocals = extractElementLocalAssignments(elementDecoratorInfo); + if (staticFieldInitializerExpressions.length > 0) { + path.node.body.body.push(createStaticBlockFromExpressions(staticFieldInitializerExpressions)); + staticFieldInitializerExpressions = []; + } + const sortedElementDecoratorInfo = toSortedDecoratorInfo(elementDecoratorInfo); + const elementDecorations = generateDecorationExprs(version === "2023-11" ? elementDecoratorInfo : sortedElementDecoratorInfo, version); + const elementLocals = extractElementLocalAssignments(sortedElementDecoratorInfo); if (protoInitLocal) { elementLocals.push(protoInitLocal); } @@ -607,35 +686,32 @@ if (classDecorators) { classLocals.push(classIdLocal, classInitLocal); const statics = []; - let staticBlocks = []; path.get("body.body").forEach(element => { if (element.isStaticBlock()) { - staticBlocks.push(element.node); + staticFieldInitializerExpressions.push(staticBlockToIIFE(element.node)); element.remove(); return; } const isProperty = element.isClassProperty() || element.isClassPrivateProperty(); if ((isProperty || element.isClassPrivateMethod()) && element.node.static) { - if (isProperty && staticBlocks.length > 0) { - const allValues = staticBlocks.map(staticBlockToIIFE); - if (element.node.value) allValues.push(element.node.value); - element.node.value = maybeSequenceExpression(allValues); - staticBlocks = []; + if (isProperty && staticFieldInitializerExpressions.length > 0) { + prependExpressionsToFieldInitializer(staticFieldInitializerExpressions, element); + staticFieldInitializerExpressions = []; } element.node.static = false; statics.push(element.node); element.remove(); } }); - if (statics.length > 0 || staticBlocks.length > 0) { + if (statics.length > 0 || staticFieldInitializerExpressions.length > 0) { const staticsClass = _core.template.expression.ast` class extends ${state.addHelper("identity")} {} `; staticsClass.body.body = [_core.types.staticBlock([_core.types.toStatement(originalClass, true) || _core.types.expressionStatement(originalClass)]), ...statics]; const constructorBody = []; const newExpr = _core.types.newExpression(staticsClass, []); - if (staticBlocks.length > 0) { - constructorBody.push(...staticBlocks.map(staticBlockToIIFE)); + if (staticFieldInitializerExpressions.length > 0) { + constructorBody.push(...staticFieldInitializerExpressions); } if (classInitCall) { classInitInjected = true; @@ -643,7 +719,7 @@ } if (constructorBody.length > 0) { constructorBody.unshift(_core.types.callExpression(_core.types.super(), [_core.types.cloneNode(classIdLocal)])); - staticsClass.body.body.push(_core.types.classMethod("constructor", _core.types.identifier("constructor"), [], _core.types.blockStatement([_core.types.expressionStatement(_core.types.sequenceExpression(constructorBody))]))); + staticsClass.body.body.push(createConstructorFromExpressions(constructorBody, false)); } else { newExpr.arguments.push(_core.types.cloneNode(classIdLocal)); } @@ -656,14 +732,14 @@ let { superClass } = originalClass; - if (superClass && version === "2023-05") { + if (superClass && (version === "2023-11" || version === "2023-05")) { const id = path.scope.maybeGenerateMemoised(superClass); if (id) { originalClass.superClass = _core.types.assignmentExpression("=", id, superClass); superClass = id; } } - originalClass.body.body.unshift(_core.types.staticBlock([_core.types.expressionStatement(createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorationsId ? _core.types.cloneNode(classDecorationsId) : _core.types.arrayExpression(classDecorations), _core.types.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, typeof className === "object" ? className : undefined, _core.types.cloneNode(superClass), state, version)), staticInitLocal && _core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(staticInitLocal), [_core.types.thisExpression()]))].filter(Boolean))); + originalClass.body.body.unshift(_core.types.staticBlock([_core.types.expressionStatement(createLocalsAssignment(elementLocals, classLocals, elementDecorations, (_classDecorationsId = classDecorationsId) != null ? _classDecorationsId : _core.types.arrayExpression(classDecorations), _core.types.numericLiteral(classDecorationsFlag), needsInstancePrivateBrandCheck ? lastInstancePrivateName : null, typeof className === "object" ? className : undefined, _core.types.cloneNode(superClass), state, version)), staticInitLocal && _core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(staticInitLocal), [_core.types.thisExpression()]))].filter(Boolean))); path.insertBefore(assignments.map(expr => _core.types.expressionStatement(expr))); if (needsDeclaraionForClassBinding) { path.insertBefore(_core.types.variableDeclaration("let", [_core.types.variableDeclarator(_core.types.cloneNode(classIdLocal))])); @@ -674,38 +750,48 @@ path.scope.crawl(); return path; } -function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBranName, setClassName, superClass, state, version) { +function createLocalsAssignment(elementLocals, classLocals, elementDecorations, classDecorations, classDecorationsFlag, maybePrivateBrandName, setClassName, superClass, state, version) { let lhs, rhs; - const args = [setClassName ? createSetFunctionNameCall(state, setClassName) : _core.types.thisExpression(), elementDecorations, classDecorations]; + const args = [setClassName ? createSetFunctionNameCall(state, setClassName) : _core.types.thisExpression(), classDecorations, elementDecorations]; { + if (version !== "2023-11") { + args.splice(1, 2, elementDecorations, classDecorations); + } if (version === "2021-12" || version === "2022-03" && !state.availableHelper("applyDecs2203R")) { - const lhs = _core.types.arrayPattern([...elementLocals, ...classLocals]); - const rhs = _core.types.callExpression(state.addHelper(version === "2021-12" ? "applyDecs" : "applyDecs2203"), args); + lhs = _core.types.arrayPattern([...elementLocals, ...classLocals]); + rhs = _core.types.callExpression(state.addHelper(version === "2021-12" ? "applyDecs" : "applyDecs2203"), args); return _core.types.assignmentExpression("=", lhs, rhs); + } else if (version === "2022-03") { + rhs = _core.types.callExpression(state.addHelper("applyDecs2203R"), args); + } else if (version === "2023-01") { + if (maybePrivateBrandName) { + args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)); + } + rhs = _core.types.callExpression(state.addHelper("applyDecs2301"), args); + } else if (version === "2023-05") { + if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) { + args.push(classDecorationsFlag); + } + if (maybePrivateBrandName) { + args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)); + } else if (superClass) { + args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0))); + } + if (superClass) args.push(superClass); + rhs = _core.types.callExpression(state.addHelper("applyDecs2305"), args); } } - if (version === "2023-05") { - if (maybePrivateBranName || superClass || classDecorationsFlag.value !== 0) { + if (version === "2023-11") { + if (maybePrivateBrandName || superClass || classDecorationsFlag.value !== 0) { args.push(classDecorationsFlag); } - if (maybePrivateBranName) { - args.push(_core.template.expression.ast` - _ => ${_core.types.cloneNode(maybePrivateBranName)} in _ - `); + if (maybePrivateBrandName) { + args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)); } else if (superClass) { args.push(_core.types.unaryExpression("void", _core.types.numericLiteral(0))); } if (superClass) args.push(superClass); - rhs = _core.types.callExpression(state.addHelper("applyDecs2305"), args); - } else if (version === "2023-01") { - if (maybePrivateBranName) { - args.push(_core.template.expression.ast` - _ => ${_core.types.cloneNode(maybePrivateBranName)} in _ - `); - } - rhs = _core.types.callExpression(state.addHelper("applyDecs2301"), args); - } else { - rhs = _core.types.callExpression(state.addHelper("applyDecs2203R"), args); + rhs = _core.types.callExpression(state.addHelper("applyDecs2311"), args); } if (elementLocals.length > 0) { if (classLocals.length > 0) { @@ -891,7 +977,7 @@ }, version, inherits) { var _assumption; { - if (version === "2023-05" || version === "2023-01") { + if (version === "2023-11" || version === "2023-05" || version === "2023-01") { assertVersion("^7.21.0"); } else if (version === "2021-12") { assertVersion("^7.16.0"); diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map index 10ee8c1..947cbb4 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js.map @@ -1 +1 @@ -{"version":3,"names":["_core","require","_helperReplaceSupers","_helperSplitExportDeclaration","_helperSkipTransparentExpressionWrappers","_fields","incrementId","id","idx","length","unshift","current","createPrivateUidGeneratorForClass","classPath","currentPrivateId","privateNames","Set","traverse","PrivateName","path","add","node","name","reifiedId","String","fromCharCode","has","t","privateName","identifier","createLazyPrivateUidGeneratorForClass","generator","replaceClassWithVar","className","type","varId","scope","generateUidIdentifierBasedOnNode","classId","rename","get","replaceWith","cloneNode","parent","generateDeclaredUidIdentifier","newClassExpr","classExpression","superClass","body","newPath","sequenceExpression","generateClassProperty","key","value","isStatic","classPrivateProperty","undefined","classProperty","addProxyAccessorsFor","element","originalKey","targetKey","version","isComputed","static","thisArg","thisExpression","getterBody","blockStatement","returnStatement","memberExpression","setterBody","expressionStatement","assignmentExpression","getter","setter","classPrivateMethod","classMethod","insertAfter","extractProxyAccessorsFor","template","expression","ast","prependExpressionsToFieldInitializer","expressions","fieldPath","initializer","push","unaryExpression","maybeSequenceExpression","prependExpressionsToConstructor","constructorPath","isProtoInitCallExpression","protoInitCall","isCallExpression","isIdentifier","callee","optimizeSuperCallAndExpressions","protoInitLocal","mergedSuperCall","callExpression","splice","isThisExpression","insertExpressionsAfterSuperCallAndOptimize","CallExpression","exit","isSuper","newNodes","map","expr","isCompletionRecord","skip","ClassMethod","kind","createConstructorFromExpressions","isDerivedClass","super","spreadElement","restElement","FIELD","ACCESSOR","METHOD","GETTER","SETTER","STATIC_OLD_VERSION","STATIC","DECORATORS_HAVE_THIS","getElementKind","isDecoratorInfo","info","filteredOrderedDecoratorInfo","filtered","filter","el","generateDecorationList","decorators","decoratorsThis","decsCount","hasOneThis","some","Boolean","decs","i","numericLiteral","hasThis","generateDecorationExprs","arrayExpression","flag","privateMethods","extractElementLocalAssignments","decorationInfo","localIds","locals","Array","isArray","addCallAccessorsFor","getId","setId","isNotTsParameter","movePrivateAccessor","methodLocalVar","params","block","isClassDecoratableElementPath","staticBlockToIIFE","arrowFunctionExpression","exprs","createSetFunctionNameCall","state","addHelper","createToPropertyKeyCall","propertyKey","checkPrivateMethodUpdateError","decoratedPrivateMethods","privateNameVisitor","privateNameVisitorFactory","privateNamesMap","parentPath","parentParentPath","left","buildCodeFrameError","Map","set","transformClass","constantSuper","propertyVisitor","classDecorators","hasElementDecorators","generateClassPrivateUid","assignments","scopeParent","memoiseExpression","hint","localEvaluatedId","staticInitLocal","isDecorated","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","_staticInitLocal","_protoInitLocal","computed","newId","newField","keyPath","isConstantExpression","insertBefore","crawl","elementDecoratorInfo","classInitLocal","classIdLocal","maybeExtractDecorators","memoiseInPlace","needMemoise","decorator","isMemberExpression","object","needsDeclaraionForClassBinding","classDecorationsFlag","classDecorations","classDecorationsId","isClassDeclaration","dec","generateUidIdentifier","lastInstancePrivateName","needsInstancePrivateBrandCheck","fieldInitializerAssignments","hasDecorators","isPrivate","isClassPrivateProperty","isClassMethod","newFieldInitId","newValue","initId","valuePath","v","replaceSupers","ReplaceSupers","methodPath","objectRef","superRef","file","refToPreserve","replace","async","isAsync","functionExpression","remove","nameExpr","stringLiteral","d","elementDecorations","elementLocals","classLocals","classInitInjected","classInitCall","originalClass","statics","staticBlocks","forEach","isStaticBlock","isProperty","isClassProperty","isClassPrivateMethod","allValues","staticsClass","staticBlock","toStatement","constructorBody","newExpr","newExpression","arguments","maybeGenerateMemoised","createLocalsAssignment","variableDeclaration","variableDeclarator","size","maybePrivateBranName","setClassName","lhs","rhs","args","availableHelper","arrayPattern","objectPattern","objectProperty","isProtoKey","shouldTransformElement","shouldTransformClass","NamedEvaluationVisitoryFactory","isAnonymous","visitor","handleComputedProperty","propertyPath","keyValue","ref","VariableDeclarator","skipTransparentExprWrappers","AssignmentExpression","operator","AssignmentPattern","ObjectExpression","isDecoratedAnonymousClassExpression","isClassExpression","_default","assertVersion","assumption","loose","inherits","_assumption","VISITED","WeakSet","namedEvaluationVisitor","visitClass","_className","_node$id","Object","assign","ExportDefaultDeclaration","declaration","updatedVarDeclarationPath","splitExportDeclaration","ExportNamedDeclaration","Class"],"sources":["../src/decorators.ts"],"sourcesContent":["import type { NodePath, Scope, Visitor } from \"@babel/traverse\";\nimport { types as t, template } from \"@babel/core\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as charCodes from \"charcodes\";\nimport type { PluginAPI, PluginObject, PluginPass } from \"@babel/core\";\nimport { skipTransparentExprWrappers } from \"@babel/helper-skip-transparent-expression-wrappers\";\nimport {\n privateNameVisitorFactory,\n type PrivateNameVisitorState,\n} from \"./fields.ts\";\n\ninterface Options {\n /** @deprecated use `constantSuper` assumption instead. Only supported in 2021-12 version. */\n loose?: boolean;\n}\n\ntype ClassDecoratableElement =\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty;\n\ntype ClassElement =\n | ClassDecoratableElement\n | t.TSDeclareMethod\n | t.TSIndexSignature\n | t.StaticBlock;\n\ntype DecoratorVersionKind = \"2023-05\" | \"2023-01\" | \"2022-03\" | \"2021-12\";\n\nfunction incrementId(id: number[], idx = id.length - 1): void {\n // If index is -1, id needs an additional character, unshift A\n if (idx === -1) {\n id.unshift(charCodes.uppercaseA);\n return;\n }\n\n const current = id[idx];\n\n if (current === charCodes.uppercaseZ) {\n // if current is Z, skip to a\n id[idx] = charCodes.lowercaseA;\n } else if (current === charCodes.lowercaseZ) {\n // if current is z, reset to A and carry the 1\n id[idx] = charCodes.uppercaseA;\n incrementId(id, idx - 1);\n } else {\n // else, increment by one\n id[idx] = current + 1;\n }\n}\n\n/**\n * Generates a new private name that is unique to the given class. This can be\n * used to create extra class fields and methods for the implementation, while\n * keeping the length of those names as small as possible. This is important for\n * minification purposes (though private names can generally be minified,\n * transpilations and polyfills cannot yet).\n */\nfunction createPrivateUidGeneratorForClass(\n classPath: NodePath,\n): () => t.PrivateName {\n const currentPrivateId: number[] = [];\n const privateNames = new Set();\n\n classPath.traverse({\n PrivateName(path) {\n privateNames.add(path.node.id.name);\n },\n });\n\n return (): t.PrivateName => {\n let reifiedId;\n do {\n incrementId(currentPrivateId);\n reifiedId = String.fromCharCode(...currentPrivateId);\n } while (privateNames.has(reifiedId));\n\n return t.privateName(t.identifier(reifiedId));\n };\n}\n\n/**\n * Wraps the above generator function so that it's run lazily the first time\n * it's actually required. Several types of decoration do not require this, so it\n * saves iterating the class elements an additional time and allocating the space\n * for the Sets of element names.\n */\nfunction createLazyPrivateUidGeneratorForClass(\n classPath: NodePath,\n): () => t.PrivateName {\n let generator: () => t.PrivateName;\n\n return (): t.PrivateName => {\n if (!generator) {\n generator = createPrivateUidGeneratorForClass(classPath);\n }\n\n return generator();\n };\n}\n\n/**\n * Takes a class definition and the desired class name if anonymous and\n * replaces it with an equivalent class declaration (path) which is then\n * assigned to a local variable (id). This allows us to reassign the local variable with the\n * decorated version of the class. The class definition retains its original\n * name so that `toString` is not affected, other references to the class\n * are renamed instead.\n */\nfunction replaceClassWithVar(\n path: NodePath,\n className: string | t.Identifier | t.StringLiteral | undefined,\n): {\n id: t.Identifier;\n path: NodePath;\n} {\n if (path.type === \"ClassDeclaration\") {\n const id = path.node.id;\n const className = id.name;\n const varId = path.scope.generateUidIdentifierBasedOnNode(id);\n const classId = t.identifier(className);\n\n path.scope.rename(className, varId.name);\n\n path.get(\"id\").replaceWith(classId);\n\n return { id: t.cloneNode(varId), path };\n } else {\n let varId: t.Identifier;\n\n if (path.node.id) {\n className = path.node.id.name;\n varId = path.scope.parent.generateDeclaredUidIdentifier(className);\n path.scope.rename(className, varId.name);\n } else {\n varId = path.scope.parent.generateDeclaredUidIdentifier(\n typeof className === \"string\" ? className : \"decorated_class\",\n );\n }\n\n const newClassExpr = t.classExpression(\n typeof className === \"string\" ? t.identifier(className) : null,\n path.node.superClass,\n path.node.body,\n );\n\n const [newPath] = path.replaceWith(\n t.sequenceExpression([newClassExpr, varId]),\n );\n\n return {\n id: t.cloneNode(varId),\n path: newPath.get(\"expressions.0\") as NodePath,\n };\n }\n}\n\nfunction generateClassProperty(\n key: t.PrivateName | t.Identifier,\n value: t.Expression | undefined,\n isStatic: boolean,\n): t.ClassPrivateProperty | t.ClassProperty {\n if (key.type === \"PrivateName\") {\n return t.classPrivateProperty(key, value, undefined, isStatic);\n } else {\n return t.classProperty(key, value, undefined, undefined, isStatic);\n }\n}\n\nfunction addProxyAccessorsFor(\n className: t.Identifier,\n element: NodePath,\n originalKey: t.PrivateName | t.Expression,\n targetKey: t.PrivateName,\n version: DecoratorVersionKind,\n isComputed = false,\n): void {\n const { static: isStatic } = element.node;\n\n const thisArg =\n version === \"2023-05\" && isStatic ? className : t.thisExpression();\n\n const getterBody = t.blockStatement([\n t.returnStatement(\n t.memberExpression(t.cloneNode(thisArg), t.cloneNode(targetKey)),\n ),\n ]);\n\n const setterBody = t.blockStatement([\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(t.cloneNode(thisArg), t.cloneNode(targetKey)),\n t.identifier(\"v\"),\n ),\n ),\n ]);\n\n let getter: t.ClassMethod | t.ClassPrivateMethod,\n setter: t.ClassMethod | t.ClassPrivateMethod;\n\n if (originalKey.type === \"PrivateName\") {\n getter = t.classPrivateMethod(\n \"get\",\n t.cloneNode(originalKey),\n [],\n getterBody,\n isStatic,\n );\n setter = t.classPrivateMethod(\n \"set\",\n t.cloneNode(originalKey),\n [t.identifier(\"v\")],\n setterBody,\n isStatic,\n );\n } else {\n getter = t.classMethod(\n \"get\",\n t.cloneNode(originalKey),\n [],\n getterBody,\n isComputed,\n isStatic,\n );\n setter = t.classMethod(\n \"set\",\n t.cloneNode(originalKey),\n [t.identifier(\"v\")],\n setterBody,\n isComputed,\n isStatic,\n );\n }\n\n element.insertAfter(setter);\n element.insertAfter(getter);\n}\n\nfunction extractProxyAccessorsFor(\n targetKey: t.PrivateName,\n version: DecoratorVersionKind,\n): (t.FunctionExpression | t.ArrowFunctionExpression)[] {\n if (version !== \"2023-05\" && version !== \"2023-01\") {\n return [\n template.expression.ast`\n function () {\n return this.${t.cloneNode(targetKey)};\n }\n ` as t.FunctionExpression,\n template.expression.ast`\n function (value) {\n this.${t.cloneNode(targetKey)} = value;\n }\n ` as t.FunctionExpression,\n ];\n }\n return [\n template.expression.ast`\n o => o.${t.cloneNode(targetKey)}\n ` as t.ArrowFunctionExpression,\n template.expression.ast`\n (o, v) => o.${t.cloneNode(targetKey)} = v\n ` as t.ArrowFunctionExpression,\n ];\n}\n\n/**\n * Prepend expressions to the field initializer. If the initializer is not defined,\n * this function will wrap the last expression within a `void` unary expression.\n *\n * @param {t.Expression[]} expressions\n * @param {(NodePath<\n * t.ClassProperty | t.ClassPrivateProperty | t.ClassAccessorProperty\n * >)} fieldPath\n */\nfunction prependExpressionsToFieldInitializer(\n expressions: t.Expression[],\n fieldPath: NodePath<\n t.ClassProperty | t.ClassPrivateProperty | t.ClassAccessorProperty\n >,\n) {\n const initializer = fieldPath.get(\"value\");\n if (initializer.node) {\n expressions.push(initializer.node);\n } else if (expressions.length > 0) {\n expressions[expressions.length - 1] = t.unaryExpression(\n \"void\",\n expressions[expressions.length - 1],\n );\n }\n initializer.replaceWith(maybeSequenceExpression(expressions));\n}\n\nfunction prependExpressionsToConstructor(\n expressions: t.Expression[],\n constructorPath: NodePath,\n) {\n constructorPath.node.body.body.unshift(\n t.expressionStatement(maybeSequenceExpression(expressions)),\n );\n}\n\nfunction isProtoInitCallExpression(\n expression: t.Expression,\n protoInitCall: t.Identifier,\n) {\n return (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee, { name: protoInitCall.name })\n );\n}\n\n/**\n * Optimize super call and its following expressions\n *\n * @param {t.Expression[]} expressions Mutated by this function. The first element must by a super call\n * @param {t.Identifier} protoInitLocal The generated protoInit id\n * @returns optimized expression\n */\nfunction optimizeSuperCallAndExpressions(\n expressions: t.Expression[],\n protoInitLocal: t.Identifier,\n) {\n // Merge `super(), protoInit(this)` into `protoInit(super())`\n if (\n expressions.length >= 2 &&\n isProtoInitCallExpression(expressions[1], protoInitLocal)\n ) {\n const mergedSuperCall = t.callExpression(t.cloneNode(protoInitLocal), [\n expressions[0],\n ]);\n expressions.splice(0, 2, mergedSuperCall);\n }\n // Merge `protoInit(super()), this` into `protoInit(super())`\n if (\n expressions.length >= 2 &&\n t.isThisExpression(expressions[expressions.length - 1]) &&\n isProtoInitCallExpression(\n expressions[expressions.length - 2],\n protoInitLocal,\n )\n ) {\n expressions.splice(expressions.length - 1, 1);\n }\n return maybeSequenceExpression(expressions);\n}\n\n/**\n * Insert expressions immediately after super() and optimize the output if possible.\n * This function will preserve the completion result using the trailing this expression.\n *\n * @param {t.Expression[]} expressions\n * @param {NodePath} constructorPath\n * @param {t.Identifier} protoInitLocal The generated protoInit id\n * @returns\n */\nfunction insertExpressionsAfterSuperCallAndOptimize(\n expressions: t.Expression[],\n constructorPath: NodePath,\n protoInitLocal: t.Identifier,\n) {\n constructorPath.traverse({\n CallExpression: {\n exit(path) {\n if (!path.get(\"callee\").isSuper()) return;\n const newNodes = [\n path.node,\n ...expressions.map(expr => t.cloneNode(expr)),\n ];\n // preserve completion result if super() is in an RHS or a return statement\n if (path.isCompletionRecord()) {\n newNodes.push(t.thisExpression());\n }\n path.replaceWith(\n optimizeSuperCallAndExpressions(newNodes, protoInitLocal),\n );\n\n path.skip();\n },\n },\n ClassMethod(path) {\n if (path.node.kind === \"constructor\") {\n path.skip();\n }\n },\n });\n}\n\n/**\n * Build a class constructor path from the given expressions. If the class is\n * derived, the constructor will call super() first to ensure that `this`\n * in the expressions work as expected.\n *\n * @param {t.Expression[]} expressions\n * @param {boolean} isDerivedClass\n * @returns The class constructor node\n */\nfunction createConstructorFromExpressions(\n expressions: t.Expression[],\n isDerivedClass: boolean,\n) {\n const body: t.Statement[] = [\n t.expressionStatement(maybeSequenceExpression(expressions)),\n ];\n if (isDerivedClass) {\n body.unshift(\n t.expressionStatement(\n t.callExpression(t.super(), [t.spreadElement(t.identifier(\"args\"))]),\n ),\n );\n }\n return t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n isDerivedClass ? [t.restElement(t.identifier(\"args\"))] : [],\n t.blockStatement(body),\n );\n}\n\n// 3 bits reserved to this (0-7)\nconst FIELD = 0;\nconst ACCESSOR = 1;\nconst METHOD = 2;\nconst GETTER = 3;\nconst SETTER = 4;\n\nconst STATIC_OLD_VERSION = 5; // Before 2023-05\nconst STATIC = 8; // 1 << 3\nconst DECORATORS_HAVE_THIS = 16; // 1 << 3\n\nfunction getElementKind(element: NodePath): number {\n switch (element.node.type) {\n case \"ClassProperty\":\n case \"ClassPrivateProperty\":\n return FIELD;\n case \"ClassAccessorProperty\":\n return ACCESSOR;\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n if (element.node.kind === \"get\") {\n return GETTER;\n } else if (element.node.kind === \"set\") {\n return SETTER;\n } else {\n return METHOD;\n }\n }\n}\n\n// Information about the decorators applied to an element\ninterface DecoratorInfo {\n // The expressions of the decorators themselves\n decorators: t.Expression[];\n decoratorsThis: t.Expression[];\n\n // The kind of the decorated value, matches the kind value passed to applyDecs\n kind: number;\n\n // whether or not the field is static\n isStatic: boolean;\n\n // The name of the decorator\n name: t.StringLiteral | t.Expression;\n\n privateMethods:\n | (t.FunctionExpression | t.ArrowFunctionExpression)[]\n | undefined;\n\n // The names of local variables that will be used/returned from the decoration\n locals: t.Identifier | t.Identifier[] | undefined;\n}\n\n// Information about a computed property key. These must be evaluated\n// interspersed with decorator expressions, which is why they get added to the\n// array of DecoratorInfos later on.\ninterface ComputedPropInfo {\n localComputedNameId: t.Identifier;\n keyNode: t.Expression;\n}\n\nfunction isDecoratorInfo(\n info: DecoratorInfo | ComputedPropInfo,\n): info is DecoratorInfo {\n return \"decorators\" in info;\n}\n\nfunction filteredOrderedDecoratorInfo(\n info: (DecoratorInfo | ComputedPropInfo)[],\n): DecoratorInfo[] {\n const filtered = info.filter(isDecoratorInfo);\n\n return [\n ...filtered.filter(\n el => el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER,\n ),\n ...filtered.filter(\n el => !el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER,\n ),\n ...filtered.filter(el => el.isStatic && el.kind === FIELD),\n ...filtered.filter(el => !el.isStatic && el.kind === FIELD),\n ];\n}\n\nfunction generateDecorationList(\n decorators: t.Expression[],\n decoratorsThis: (t.Expression | null)[],\n version: DecoratorVersionKind,\n) {\n const decsCount = decorators.length;\n const hasOneThis = decoratorsThis.some(Boolean);\n const decs: t.Expression[] = [];\n for (let i = 0; i < decsCount; i++) {\n if (version === \"2023-05\" && hasOneThis) {\n decs.push(\n decoratorsThis[i] || t.unaryExpression(\"void\", t.numericLiteral(0)),\n );\n }\n decs.push(decorators[i]);\n }\n\n return { hasThis: hasOneThis, decs };\n}\n\nfunction generateDecorationExprs(\n info: (DecoratorInfo | ComputedPropInfo)[],\n version: DecoratorVersionKind,\n): t.ArrayExpression {\n return t.arrayExpression(\n filteredOrderedDecoratorInfo(info).map(el => {\n const { decs, hasThis } = generateDecorationList(\n el.decorators,\n el.decoratorsThis,\n version,\n );\n\n let flag = el.kind;\n if (el.isStatic) {\n flag += version === \"2023-05\" ? STATIC : STATIC_OLD_VERSION;\n }\n if (hasThis) flag += DECORATORS_HAVE_THIS;\n\n return t.arrayExpression([\n decs.length === 1 ? decs[0] : t.arrayExpression(decs),\n t.numericLiteral(flag),\n el.name,\n ...(el.privateMethods || []),\n ]);\n }),\n );\n}\n\nfunction extractElementLocalAssignments(\n decorationInfo: (DecoratorInfo | ComputedPropInfo)[],\n) {\n const localIds: t.Identifier[] = [];\n\n for (const el of filteredOrderedDecoratorInfo(decorationInfo)) {\n const { locals } = el;\n\n if (Array.isArray(locals)) {\n localIds.push(...locals);\n } else if (locals !== undefined) {\n localIds.push(locals);\n }\n }\n\n return localIds;\n}\n\nfunction addCallAccessorsFor(\n element: NodePath,\n key: t.PrivateName,\n getId: t.Identifier,\n setId: t.Identifier,\n) {\n element.insertAfter(\n t.classPrivateMethod(\n \"get\",\n t.cloneNode(key),\n [],\n t.blockStatement([\n t.returnStatement(\n t.callExpression(t.cloneNode(getId), [t.thisExpression()]),\n ),\n ]),\n ),\n );\n\n element.insertAfter(\n t.classPrivateMethod(\n \"set\",\n t.cloneNode(key),\n [t.identifier(\"v\")],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(t.cloneNode(setId), [\n t.thisExpression(),\n t.identifier(\"v\"),\n ]),\n ),\n ]),\n ),\n );\n}\n\nfunction isNotTsParameter(\n node: t.Identifier | t.Pattern | t.RestElement | t.TSParameterProperty,\n): node is t.Identifier | t.Pattern | t.RestElement {\n return node.type !== \"TSParameterProperty\";\n}\n\nfunction movePrivateAccessor(\n element: NodePath,\n key: t.PrivateName,\n methodLocalVar: t.Identifier,\n isStatic: boolean,\n) {\n let params: (t.Identifier | t.RestElement)[];\n let block: t.Statement[];\n\n if (element.node.kind === \"set\") {\n params = [t.identifier(\"v\")];\n block = [\n t.expressionStatement(\n t.callExpression(methodLocalVar, [\n t.thisExpression(),\n t.identifier(\"v\"),\n ]),\n ),\n ];\n } else {\n params = [];\n block = [\n t.returnStatement(t.callExpression(methodLocalVar, [t.thisExpression()])),\n ];\n }\n\n element.replaceWith(\n t.classPrivateMethod(\n element.node.kind,\n t.cloneNode(key),\n params,\n t.blockStatement(block),\n isStatic,\n ),\n );\n}\n\nfunction isClassDecoratableElementPath(\n path: NodePath,\n): path is NodePath {\n const { type } = path;\n\n return (\n type !== \"TSDeclareMethod\" &&\n type !== \"TSIndexSignature\" &&\n type !== \"StaticBlock\"\n );\n}\n\nfunction staticBlockToIIFE(block: t.StaticBlock) {\n return t.callExpression(\n t.arrowFunctionExpression([], t.blockStatement(block.body)),\n [],\n );\n}\n\nfunction maybeSequenceExpression(exprs: t.Expression[]) {\n if (exprs.length === 0) return t.unaryExpression(\"void\", t.numericLiteral(0));\n if (exprs.length === 1) return exprs[0];\n return t.sequenceExpression(exprs);\n}\n\nfunction createSetFunctionNameCall(\n state: PluginPass,\n className: t.Identifier | t.StringLiteral,\n) {\n return t.callExpression(state.addHelper(\"setFunctionName\"), [\n t.thisExpression(),\n className,\n ]);\n}\n\nfunction createToPropertyKeyCall(state: PluginPass, propertyKey: t.Expression) {\n return t.callExpression(state.addHelper(\"toPropertyKey\"), [propertyKey]);\n}\n\nfunction checkPrivateMethodUpdateError(\n path: NodePath,\n decoratedPrivateMethods: Set,\n) {\n const privateNameVisitor = privateNameVisitorFactory<\n PrivateNameVisitorState,\n null\n >({\n PrivateName(path, state) {\n if (!state.privateNamesMap.has(path.node.id.name)) return;\n\n const parentPath = path.parentPath;\n const parentParentPath = parentPath.parentPath;\n\n if (\n // this.bar().#x = 123;\n (parentParentPath.node.type === \"AssignmentExpression\" &&\n parentParentPath.node.left === parentPath.node) ||\n // this.#x++;\n parentParentPath.node.type === \"UpdateExpression\" ||\n // ([...this.#x] = foo);\n parentParentPath.node.type === \"RestElement\" ||\n // ([this.#x] = foo);\n parentParentPath.node.type === \"ArrayPattern\" ||\n // ({ a: this.#x } = bar);\n (parentParentPath.node.type === \"ObjectProperty\" &&\n parentParentPath.node.value === parentPath.node &&\n parentParentPath.parentPath.type === \"ObjectPattern\") ||\n // for (this.#x of []);\n (parentParentPath.node.type === \"ForOfStatement\" &&\n parentParentPath.node.left === parentPath.node)\n ) {\n throw path.buildCodeFrameError(\n `Decorated private methods are read-only, but \"#${path.node.id.name}\" is updated via this expression.`,\n );\n }\n },\n });\n const privateNamesMap = new Map();\n for (const name of decoratedPrivateMethods) {\n privateNamesMap.set(name, null);\n }\n path.traverse(privateNameVisitor, {\n privateNamesMap: privateNamesMap,\n });\n}\n\nfunction transformClass(\n path: NodePath,\n state: PluginPass,\n constantSuper: boolean,\n version: DecoratorVersionKind,\n className: string | t.Identifier | t.StringLiteral | undefined,\n propertyVisitor: Visitor,\n): NodePath {\n const body = path.get(\"body.body\");\n\n const classDecorators = path.node.decorators;\n let hasElementDecorators = false;\n\n const generateClassPrivateUid = createLazyPrivateUidGeneratorForClass(path);\n\n const assignments: t.AssignmentExpression[] = [];\n const scopeParent: Scope = path.scope.parent;\n const memoiseExpression = (expression: t.Expression, hint: string) => {\n const localEvaluatedId = scopeParent.generateDeclaredUidIdentifier(hint);\n assignments.push(t.assignmentExpression(\"=\", localEvaluatedId, expression));\n return t.cloneNode(localEvaluatedId);\n };\n\n let protoInitLocal: t.Identifier;\n let staticInitLocal: t.Identifier;\n // Iterate over the class to see if we need to decorate it, and also to\n // transform simple auto accessors which are not decorated, and handle inferred\n // class name when the initializer of the class field is a class expression\n for (const element of body) {\n if (!isClassDecoratableElementPath(element)) {\n continue;\n }\n\n if (isDecorated(element.node)) {\n switch (element.node.type) {\n case \"ClassProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassProperty should be callable. Improve typings.\n propertyVisitor.ClassProperty(\n element as NodePath,\n state,\n );\n break;\n case \"ClassPrivateProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassPrivateProperty should be callable. Improve typings.\n propertyVisitor.ClassPrivateProperty(\n element as NodePath,\n state,\n );\n break;\n case \"ClassAccessorProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassAccessorProperty should be callable. Improve typings.\n propertyVisitor.ClassAccessorProperty(\n element as NodePath,\n state,\n );\n /* fallthrough */\n default:\n if (element.node.static) {\n staticInitLocal ??=\n scopeParent.generateDeclaredUidIdentifier(\"initStatic\");\n } else {\n protoInitLocal ??=\n scopeParent.generateDeclaredUidIdentifier(\"initProto\");\n }\n break;\n }\n hasElementDecorators = true;\n } else if (element.node.type === \"ClassAccessorProperty\") {\n // @ts-expect-error todo: propertyVisitor.ClassAccessorProperty should be callable. Improve typings.\n propertyVisitor.ClassAccessorProperty(\n element as NodePath,\n state,\n );\n const { key, value, static: isStatic, computed } = element.node;\n\n const newId = generateClassPrivateUid();\n const newField = generateClassProperty(newId, value, isStatic);\n const keyPath = element.get(\"key\");\n const [newPath] = element.replaceWith(newField);\n\n addProxyAccessorsFor(\n path.node.id,\n newPath,\n computed && !keyPath.isConstantExpression()\n ? memoiseExpression(\n createToPropertyKeyCall(state, key as t.Expression),\n \"computedKey\",\n )\n : key,\n newId,\n version,\n computed,\n );\n }\n }\n\n if (!classDecorators && !hasElementDecorators) {\n // If nothing is decorated but we have assignments, it must be the memoised\n // computed keys of class accessors\n if (assignments.length > 0) {\n path.insertBefore(assignments.map(expr => t.expressionStatement(expr)));\n\n // Recrawl the scope to make sure new identifiers are properly synced\n path.scope.crawl();\n }\n // If nothing is decorated and no assignments inserted, return\n return;\n }\n\n const elementDecoratorInfo: (DecoratorInfo | ComputedPropInfo)[] = [];\n\n let constructorPath: NodePath | undefined;\n const decoratedPrivateMethods = new Set();\n\n let classInitLocal: t.Identifier, classIdLocal: t.Identifier;\n\n const decoratorsThis = new Map();\n const maybeExtractDecorators = (\n decorators: t.Decorator[],\n memoiseInPlace: boolean,\n ) => {\n let needMemoise = false;\n for (const decorator of decorators) {\n const { expression } = decorator;\n if (version === \"2023-05\" && t.isMemberExpression(expression)) {\n let object;\n if (\n t.isSuper(expression.object) ||\n t.isThisExpression(expression.object)\n ) {\n needMemoise = true;\n if (memoiseInPlace) {\n object = memoiseExpression(t.thisExpression(), \"obj\");\n } else {\n object = t.thisExpression();\n }\n } else {\n if (!scopeParent.isStatic(expression.object)) {\n needMemoise = true;\n if (memoiseInPlace) {\n expression.object = memoiseExpression(expression.object, \"obj\");\n }\n }\n object = t.cloneNode(expression.object);\n }\n decoratorsThis.set(decorator, object);\n }\n if (!scopeParent.isStatic(expression)) {\n needMemoise = true;\n if (memoiseInPlace) {\n decorator.expression = memoiseExpression(expression, \"dec\");\n }\n }\n }\n return needMemoise && !memoiseInPlace;\n };\n\n let needsDeclaraionForClassBinding = false;\n let classDecorationsFlag = 0;\n let classDecorations: t.Expression[] = [];\n let classDecorationsId: t.Identifier;\n if (classDecorators) {\n classInitLocal = scopeParent.generateDeclaredUidIdentifier(\"initClass\");\n needsDeclaraionForClassBinding = path.isClassDeclaration();\n ({ id: classIdLocal, path } = replaceClassWithVar(path, className));\n\n path.node.decorators = null;\n\n const needMemoise = maybeExtractDecorators(classDecorators, false);\n\n const { hasThis, decs } = generateDecorationList(\n classDecorators.map(el => el.expression),\n classDecorators.map(dec => decoratorsThis.get(dec)),\n version,\n );\n classDecorationsFlag = hasThis ? 1 : 0;\n classDecorations = decs;\n\n if (needMemoise) {\n classDecorationsId = memoiseExpression(\n t.arrayExpression(classDecorations),\n \"classDecs\",\n );\n }\n } else {\n if (!path.node.id) {\n path.node.id = path.scope.generateUidIdentifier(\"Class\");\n }\n classIdLocal = t.cloneNode(path.node.id);\n }\n\n let lastInstancePrivateName: t.PrivateName;\n let needsInstancePrivateBrandCheck = false;\n\n let fieldInitializerAssignments = [];\n\n if (hasElementDecorators) {\n if (protoInitLocal) {\n const protoInitCall = t.callExpression(t.cloneNode(protoInitLocal), [\n t.thisExpression(),\n ]);\n fieldInitializerAssignments.push(protoInitCall);\n }\n for (const element of body) {\n if (!isClassDecoratableElementPath(element)) {\n continue;\n }\n\n const { node } = element;\n const decorators = element.node.decorators;\n\n const hasDecorators = !!decorators?.length;\n\n if (hasDecorators) {\n maybeExtractDecorators(decorators, true);\n }\n\n const isComputed = \"computed\" in element.node && element.node.computed;\n if (isComputed) {\n if (!element.get(\"key\").isConstantExpression()) {\n node.key = memoiseExpression(\n createToPropertyKeyCall(state, node.key as t.Expression),\n \"computedKey\",\n );\n }\n }\n\n const kind = getElementKind(element);\n const { key } = node;\n\n const isPrivate = key.type === \"PrivateName\";\n\n const isStatic = element.node.static;\n\n let name = \"computedKey\";\n\n if (isPrivate) {\n name = key.id.name;\n } else if (!isComputed && key.type === \"Identifier\") {\n name = key.name;\n }\n\n if (isPrivate && !isStatic) {\n if (hasDecorators) {\n needsInstancePrivateBrandCheck = true;\n }\n if (t.isClassPrivateProperty(node) || !lastInstancePrivateName) {\n lastInstancePrivateName = key;\n }\n }\n\n if (element.isClassMethod({ kind: \"constructor\" })) {\n constructorPath = element;\n }\n\n if (hasDecorators) {\n let locals: t.Identifier | t.Identifier[];\n let privateMethods: Array<\n t.FunctionExpression | t.ArrowFunctionExpression\n >;\n\n if (kind === ACCESSOR) {\n const { value } = element.node as t.ClassAccessorProperty;\n\n const params: t.Expression[] = [t.thisExpression()];\n\n if (value) {\n params.push(t.cloneNode(value));\n }\n\n const newId = generateClassPrivateUid();\n const newFieldInitId =\n element.scope.parent.generateDeclaredUidIdentifier(`init_${name}`);\n const newValue = t.callExpression(\n t.cloneNode(newFieldInitId),\n params,\n );\n\n const newField = generateClassProperty(newId, newValue, isStatic);\n const [newPath] = element.replaceWith(newField);\n\n if (isPrivate) {\n privateMethods = extractProxyAccessorsFor(newId, version);\n\n const getId = newPath.scope.parent.generateDeclaredUidIdentifier(\n `get_${name}`,\n );\n const setId = newPath.scope.parent.generateDeclaredUidIdentifier(\n `set_${name}`,\n );\n\n addCallAccessorsFor(newPath, key, getId, setId);\n\n locals = [newFieldInitId, getId, setId];\n } else {\n addProxyAccessorsFor(\n path.node.id,\n newPath,\n key,\n newId,\n version,\n isComputed,\n );\n locals = newFieldInitId;\n }\n } else if (kind === FIELD) {\n const initId = element.scope.parent.generateDeclaredUidIdentifier(\n `init_${name}`,\n );\n const valuePath = (\n element as NodePath\n ).get(\"value\");\n\n valuePath.replaceWith(\n t.callExpression(\n t.cloneNode(initId),\n [t.thisExpression(), valuePath.node].filter(v => v),\n ),\n );\n\n locals = initId;\n\n if (isPrivate) {\n privateMethods = extractProxyAccessorsFor(key, version);\n }\n } else if (isPrivate) {\n locals = element.scope.parent.generateDeclaredUidIdentifier(\n `call_${name}`,\n );\n\n const replaceSupers = new ReplaceSupers({\n constantSuper,\n methodPath: element as NodePath,\n objectRef: classIdLocal,\n superRef: path.node.superClass,\n file: state.file,\n refToPreserve: classIdLocal,\n });\n\n replaceSupers.replace();\n\n const {\n params,\n body,\n async: isAsync,\n } = element.node as t.ClassPrivateMethod;\n\n privateMethods = [\n t.functionExpression(\n undefined,\n params.filter(isNotTsParameter),\n body,\n isAsync,\n ),\n ];\n\n if (kind === GETTER || kind === SETTER) {\n movePrivateAccessor(\n element as NodePath,\n t.cloneNode(key),\n t.cloneNode(locals),\n isStatic,\n );\n } else {\n const node = element.node as t.ClassPrivateMethod;\n\n // Unshift\n path.node.body.body.unshift(\n t.classPrivateProperty(key, t.cloneNode(locals), [], node.static),\n );\n\n decoratedPrivateMethods.add(key.id.name);\n\n element.remove();\n }\n }\n\n let nameExpr: t.Expression;\n\n if (isComputed) {\n nameExpr = t.cloneNode(key as t.Expression);\n } else if (key.type === \"PrivateName\") {\n nameExpr = t.stringLiteral(key.id.name);\n } else if (key.type === \"Identifier\") {\n nameExpr = t.stringLiteral(key.name);\n } else {\n nameExpr = t.cloneNode(key as t.Expression);\n }\n\n elementDecoratorInfo.push({\n kind,\n decorators: decorators.map(d => d.expression),\n decoratorsThis: decorators.map(d => decoratorsThis.get(d)),\n name: nameExpr,\n isStatic,\n privateMethods,\n locals,\n });\n\n if (element.node) {\n element.node.decorators = null;\n }\n }\n\n if (\n fieldInitializerAssignments.length > 0 &&\n !isStatic &&\n (kind === FIELD || kind === ACCESSOR)\n ) {\n prependExpressionsToFieldInitializer(\n fieldInitializerAssignments,\n element as NodePath<\n t.ClassProperty | t.ClassPrivateProperty | t.ClassAccessorProperty\n >,\n );\n fieldInitializerAssignments = [];\n }\n }\n }\n\n if (fieldInitializerAssignments.length > 0) {\n const isDerivedClass = !!path.node.superClass;\n if (constructorPath) {\n if (isDerivedClass) {\n insertExpressionsAfterSuperCallAndOptimize(\n fieldInitializerAssignments,\n constructorPath,\n protoInitLocal,\n );\n } else {\n prependExpressionsToConstructor(\n fieldInitializerAssignments,\n constructorPath,\n );\n }\n } else {\n path.node.body.body.unshift(\n createConstructorFromExpressions(\n fieldInitializerAssignments,\n isDerivedClass,\n ),\n );\n }\n fieldInitializerAssignments = [];\n }\n\n const elementDecorations = generateDecorationExprs(\n elementDecoratorInfo,\n version,\n );\n\n const elementLocals: t.Identifier[] =\n extractElementLocalAssignments(elementDecoratorInfo);\n\n if (protoInitLocal) {\n elementLocals.push(protoInitLocal);\n }\n\n if (staticInitLocal) {\n elementLocals.push(staticInitLocal);\n }\n\n const classLocals: t.Identifier[] = [];\n let classInitInjected = false;\n const classInitCall =\n classInitLocal && t.callExpression(t.cloneNode(classInitLocal), []);\n\n const originalClass = path.node;\n\n if (classDecorators) {\n classLocals.push(classIdLocal, classInitLocal);\n const statics: (\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassPrivateMethod\n )[] = [];\n let staticBlocks: t.StaticBlock[] = [];\n path.get(\"body.body\").forEach(element => {\n // Static blocks cannot be compiled to \"instance blocks\", but we can inline\n // them as IIFEs in the next property.\n if (element.isStaticBlock()) {\n staticBlocks.push(element.node);\n element.remove();\n return;\n }\n\n const isProperty =\n element.isClassProperty() || element.isClassPrivateProperty();\n\n if (\n (isProperty || element.isClassPrivateMethod()) &&\n element.node.static\n ) {\n if (isProperty && staticBlocks.length > 0) {\n const allValues: t.Expression[] = staticBlocks.map(staticBlockToIIFE);\n if (element.node.value) allValues.push(element.node.value);\n element.node.value = maybeSequenceExpression(allValues);\n staticBlocks = [];\n }\n\n element.node.static = false;\n statics.push(element.node);\n element.remove();\n }\n });\n\n if (statics.length > 0 || staticBlocks.length > 0) {\n const staticsClass = template.expression.ast`\n class extends ${state.addHelper(\"identity\")} {}\n ` as t.ClassExpression;\n staticsClass.body.body = [\n t.staticBlock([\n t.toStatement(originalClass, true) ||\n // If toStatement returns false, originalClass must be an anonymous ClassExpression,\n // because `export default @dec ...` has been handled in the export visitor before.\n t.expressionStatement(originalClass as t.ClassExpression),\n ]),\n ...statics,\n ];\n\n const constructorBody: t.Expression[] = [];\n\n const newExpr = t.newExpression(staticsClass, []);\n\n if (staticBlocks.length > 0) {\n constructorBody.push(...staticBlocks.map(staticBlockToIIFE));\n }\n if (classInitCall) {\n classInitInjected = true;\n constructorBody.push(classInitCall);\n }\n if (constructorBody.length > 0) {\n constructorBody.unshift(\n t.callExpression(t.super(), [t.cloneNode(classIdLocal)]),\n );\n\n staticsClass.body.body.push(\n t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n [],\n t.blockStatement([\n t.expressionStatement(t.sequenceExpression(constructorBody)),\n ]),\n ),\n );\n } else {\n newExpr.arguments.push(t.cloneNode(classIdLocal));\n }\n\n path.replaceWith(newExpr);\n }\n }\n if (!classInitInjected && classInitCall) {\n path.node.body.body.push(\n t.staticBlock([t.expressionStatement(classInitCall)]),\n );\n }\n\n let { superClass } = originalClass;\n if (superClass && (process.env.BABEL_8_BREAKING || version === \"2023-05\")) {\n const id = path.scope.maybeGenerateMemoised(superClass);\n if (id) {\n originalClass.superClass = t.assignmentExpression(\"=\", id, superClass);\n superClass = id;\n }\n }\n originalClass.body.body.unshift(\n t.staticBlock(\n [\n t.expressionStatement(\n createLocalsAssignment(\n elementLocals,\n classLocals,\n elementDecorations,\n classDecorationsId\n ? t.cloneNode(classDecorationsId)\n : t.arrayExpression(classDecorations),\n t.numericLiteral(classDecorationsFlag),\n needsInstancePrivateBrandCheck ? lastInstancePrivateName : null,\n typeof className === \"object\" ? className : undefined,\n t.cloneNode(superClass),\n state,\n version,\n ),\n ),\n staticInitLocal &&\n t.expressionStatement(\n t.callExpression(t.cloneNode(staticInitLocal), [\n t.thisExpression(),\n ]),\n ),\n ].filter(Boolean),\n ),\n );\n\n // When path is a ClassExpression, path.insertBefore will convert `path`\n // into a SequenceExpression\n path.insertBefore(assignments.map(expr => t.expressionStatement(expr)));\n\n if (needsDeclaraionForClassBinding) {\n path.insertBefore(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.cloneNode(classIdLocal)),\n ]),\n );\n }\n\n if (decoratedPrivateMethods.size > 0) {\n checkPrivateMethodUpdateError(path, decoratedPrivateMethods);\n }\n\n // Recrawl the scope to make sure new identifiers are properly synced\n path.scope.crawl();\n\n return path;\n}\n\nfunction createLocalsAssignment(\n elementLocals: t.Identifier[],\n classLocals: t.Identifier[],\n elementDecorations: t.ArrayExpression | t.Identifier,\n classDecorations: t.ArrayExpression | t.Identifier,\n classDecorationsFlag: t.NumericLiteral,\n maybePrivateBranName: t.PrivateName | null,\n setClassName: t.Identifier | t.StringLiteral | undefined,\n superClass: null | t.Expression,\n state: PluginPass,\n version: DecoratorVersionKind,\n) {\n let lhs, rhs;\n const args: t.Expression[] = [\n setClassName\n ? createSetFunctionNameCall(state, setClassName)\n : t.thisExpression(),\n elementDecorations,\n classDecorations,\n ];\n\n if (!process.env.BABEL_8_BREAKING) {\n if (\n version === \"2021-12\" ||\n (version === \"2022-03\" && !state.availableHelper(\"applyDecs2203R\"))\n ) {\n const lhs = t.arrayPattern([...elementLocals, ...classLocals]);\n const rhs = t.callExpression(\n state.addHelper(version === \"2021-12\" ? \"applyDecs\" : \"applyDecs2203\"),\n args,\n );\n return t.assignmentExpression(\"=\", lhs, rhs);\n }\n }\n\n if (process.env.BABEL_8_BREAKING || version === \"2023-05\") {\n if (\n maybePrivateBranName ||\n superClass ||\n classDecorationsFlag.value !== 0\n ) {\n args.push(classDecorationsFlag);\n }\n if (maybePrivateBranName) {\n args.push(\n template.expression.ast`\n _ => ${t.cloneNode(maybePrivateBranName)} in _\n ` as t.ArrowFunctionExpression,\n );\n } else if (superClass) {\n args.push(t.unaryExpression(\"void\", t.numericLiteral(0)));\n }\n if (superClass) args.push(superClass);\n rhs = t.callExpression(state.addHelper(\"applyDecs2305\"), args);\n } else if (version === \"2023-01\") {\n if (maybePrivateBranName) {\n args.push(\n template.expression.ast`\n _ => ${t.cloneNode(maybePrivateBranName)} in _\n ` as t.ArrowFunctionExpression,\n );\n }\n rhs = t.callExpression(state.addHelper(\"applyDecs2301\"), args);\n } else {\n rhs = t.callExpression(state.addHelper(\"applyDecs2203R\"), args);\n }\n // optimize `{ c: [classLocals] } = applyapplyDecs2203R(...)` to\n // `[classLocals] = applyapplyDecs2203R(...).c`\n if (elementLocals.length > 0) {\n if (classLocals.length > 0) {\n lhs = t.objectPattern([\n t.objectProperty(t.identifier(\"e\"), t.arrayPattern(elementLocals)),\n t.objectProperty(t.identifier(\"c\"), t.arrayPattern(classLocals)),\n ]);\n } else {\n lhs = t.arrayPattern(elementLocals);\n rhs = t.memberExpression(rhs, t.identifier(\"e\"), false, false);\n }\n } else {\n // invariant: classLocals.length > 0\n lhs = t.arrayPattern(classLocals);\n rhs = t.memberExpression(rhs, t.identifier(\"c\"), false, false);\n }\n\n return t.assignmentExpression(\"=\", lhs, rhs);\n}\n\nfunction isProtoKey(\n node: t.Identifier | t.StringLiteral | t.BigIntLiteral | t.NumericLiteral,\n) {\n return node.type === \"Identifier\"\n ? node.name === \"__proto__\"\n : node.value === \"__proto__\";\n}\n\nfunction isDecorated(node: t.Class | ClassDecoratableElement) {\n return node.decorators && node.decorators.length > 0;\n}\n\nfunction shouldTransformElement(node: ClassElement) {\n switch (node.type) {\n case \"ClassAccessorProperty\":\n return true;\n case \"ClassMethod\":\n case \"ClassProperty\":\n case \"ClassPrivateMethod\":\n case \"ClassPrivateProperty\":\n return isDecorated(node);\n default:\n return false;\n }\n}\n\nfunction shouldTransformClass(node: t.Class) {\n return isDecorated(node) || node.body.body.some(shouldTransformElement);\n}\n\n// Todo: unify name references logic with helper-function-name\nfunction NamedEvaluationVisitoryFactory(\n isAnonymous: (path: NodePath) => boolean,\n visitor: (\n path: NodePath,\n state: PluginPass,\n name:\n | string\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral,\n ) => void,\n) {\n function handleComputedProperty(\n propertyPath: NodePath<\n t.ObjectProperty | t.ClassProperty | t.ClassAccessorProperty\n >,\n key: t.Expression,\n state: PluginPass,\n ): t.StringLiteral | t.Identifier {\n switch (key.type) {\n case \"StringLiteral\":\n return t.stringLiteral(key.value);\n case \"NumericLiteral\":\n case \"BigIntLiteral\": {\n const keyValue = key.value + \"\";\n propertyPath.get(\"key\").replaceWith(t.stringLiteral(keyValue));\n return t.stringLiteral(keyValue);\n }\n default: {\n const ref = propertyPath.scope.maybeGenerateMemoised(key);\n propertyPath\n .get(\"key\")\n .replaceWith(\n t.assignmentExpression(\n \"=\",\n ref,\n createToPropertyKeyCall(state, key),\n ),\n );\n return t.cloneNode(ref);\n }\n }\n }\n return {\n VariableDeclarator(path, state) {\n const id = path.node.id;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"init\"));\n if (isAnonymous(initializer)) {\n const name = id.name;\n visitor(initializer, state, name);\n }\n }\n },\n AssignmentExpression(path, state) {\n const id = path.node.left;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"right\"));\n if (isAnonymous(initializer)) {\n switch (path.node.operator) {\n case \"=\":\n case \"&&=\":\n case \"||=\":\n case \"??=\":\n visitor(initializer, state, id.name);\n }\n }\n }\n },\n AssignmentPattern(path, state) {\n const id = path.node.left;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"right\"));\n if (isAnonymous(initializer)) {\n const name = id.name;\n visitor(initializer, state, name);\n }\n }\n },\n // We listen on ObjectExpression so that we don't have to visit\n // the object properties under object patterns\n ObjectExpression(path, state) {\n for (const propertyPath of path.get(\"properties\")) {\n const { node } = propertyPath;\n if (node.type !== \"ObjectProperty\") continue;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(\n propertyPath.get(\"value\"),\n );\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n // 13.2.5.5 RS: PropertyDefinitionEvaluation\n if (!isProtoKey(id as t.StringLiteral | t.Identifier)) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n }\n } else {\n const ref = handleComputedProperty(\n propertyPath as NodePath,\n // The key of a computed object property must not be a private name\n id as t.Expression,\n state,\n );\n visitor(initializer, state, ref);\n }\n }\n }\n },\n ClassPrivateProperty(path, state) {\n const { node } = path;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n const className = t.stringLiteral(\"#\" + node.key.id.name);\n visitor(initializer, state, className);\n }\n },\n ClassAccessorProperty(path, state) {\n const { node } = path;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else if (id.type === \"PrivateName\") {\n const className = t.stringLiteral(\"#\" + id.id.name);\n visitor(initializer, state, className);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n } else {\n const ref = handleComputedProperty(\n path,\n // The key of a computed accessor property must not be a private name\n id as t.Expression,\n state,\n );\n visitor(initializer, state, ref);\n }\n }\n },\n ClassProperty(path, state) {\n const { node } = path;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n } else {\n const ref = handleComputedProperty(path, id, state);\n visitor(initializer, state, ref);\n }\n }\n },\n } satisfies Visitor;\n}\n\nfunction isDecoratedAnonymousClassExpression(path: NodePath) {\n return (\n path.isClassExpression({ id: null }) && shouldTransformClass(path.node)\n );\n}\n\nexport default function (\n { assertVersion, assumption }: PluginAPI,\n { loose }: Options,\n // TODO(Babel 8): Only keep 2023-05\n version: \"2023-05\" | \"2023-01\" | \"2022-03\" | \"2021-12\",\n inherits: PluginObject[\"inherits\"],\n): PluginObject {\n if (process.env.BABEL_8_BREAKING) {\n assertVersion(process.env.IS_PUBLISH ? PACKAGE_JSON.version : \"^7.21.0\");\n } else {\n if (version === \"2023-05\" || version === \"2023-01\") {\n assertVersion(\"^7.21.0\");\n } else if (version === \"2021-12\") {\n assertVersion(\"^7.16.0\");\n } else {\n assertVersion(\"^7.19.0\");\n }\n }\n\n const VISITED = new WeakSet();\n const constantSuper = assumption(\"constantSuper\") ?? loose;\n\n const namedEvaluationVisitor: Visitor =\n NamedEvaluationVisitoryFactory(\n isDecoratedAnonymousClassExpression,\n visitClass,\n );\n\n function visitClass(\n path: NodePath,\n state: PluginPass,\n className: string | t.Identifier | t.StringLiteral | undefined,\n ) {\n if (VISITED.has(path)) return;\n const { node } = path;\n className ??= node.id?.name;\n const newPath = transformClass(\n path,\n state,\n constantSuper,\n version,\n className,\n namedEvaluationVisitor,\n );\n if (newPath) {\n VISITED.add(newPath);\n return;\n }\n VISITED.add(path);\n }\n\n return {\n name: \"proposal-decorators\",\n inherits: inherits,\n\n visitor: {\n ExportDefaultDeclaration(path, state) {\n const { declaration } = path.node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n // When compiling class decorators we need to replace the class\n // binding, so we must split it in two separate declarations.\n isDecorated(declaration)\n ) {\n const isAnonymous = !declaration.id;\n const updatedVarDeclarationPath = splitExportDeclaration(\n path,\n ) as unknown as NodePath;\n if (isAnonymous) {\n visitClass(\n updatedVarDeclarationPath,\n state,\n t.stringLiteral(\"default\"),\n );\n }\n }\n },\n ExportNamedDeclaration(path) {\n const { declaration } = path.node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n // When compiling class decorators we need to replace the class\n // binding, so we must split it in two separate declarations.\n isDecorated(declaration)\n ) {\n splitExportDeclaration(path);\n }\n },\n\n Class(path, state) {\n visitClass(path, state, undefined);\n },\n\n ...namedEvaluationVisitor,\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AAGA,IAAAG,wCAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAyBA,SAASK,WAAWA,CAACC,EAAY,EAAEC,GAAG,GAAGD,EAAE,CAACE,MAAM,GAAG,CAAC,EAAQ;EAE5D,IAAID,GAAG,KAAK,CAAC,CAAC,EAAE;IACdD,EAAE,CAACG,OAAO,GAAqB,CAAC;IAChC;EACF;EAEA,MAAMC,OAAO,GAAGJ,EAAE,CAACC,GAAG,CAAC;EAEvB,IAAIG,OAAO,OAAyB,EAAE;IAEpCJ,EAAE,CAACC,GAAG,CAAC,KAAuB;EAChC,CAAC,MAAM,IAAIG,OAAO,QAA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,GAEEgQ,sBAAsB;EAE7B,CAAC;AACH"} \ No newline at end of file +{"version":3,"names":["_core","require","_helperReplaceSupers","_helperSplitExportDeclaration","_helperSkipTransparentExpressionWrappers","_fields","incrementId","id","idx","length","unshift","current","createPrivateUidGeneratorForClass","classPath","currentPrivateId","privateNames","Set","traverse","PrivateName","path","add","node","name","reifiedId","String","fromCharCode","has","t","privateName","identifier","createLazyPrivateUidGeneratorForClass","generator","replaceClassWithVar","className","type","varId","scope","generateUidIdentifierBasedOnNode","classId","rename","get","replaceWith","cloneNode","parent","generateDeclaredUidIdentifier","newClassExpr","classExpression","superClass","body","newPath","sequenceExpression","generateClassProperty","key","value","isStatic","classPrivateProperty","undefined","classProperty","addProxyAccessorsFor","element","originalKey","targetKey","version","isComputed","thisArg","thisExpression","getterBody","blockStatement","returnStatement","memberExpression","setterBody","expressionStatement","assignmentExpression","getter","setter","classPrivateMethod","classMethod","insertAfter","extractProxyAccessorsFor","template","expression","ast","prependExpressionsToFieldInitializer","expressions","fieldPath","initializer","push","unaryExpression","maybeSequenceExpression","prependExpressionsToStaticBlock","blockPath","unshiftContainer","prependExpressionsToConstructor","constructorPath","isProtoInitCallExpression","protoInitCall","isCallExpression","isIdentifier","callee","optimizeSuperCallAndExpressions","protoInitLocal","mergedSuperCall","callExpression","splice","isThisExpression","insertExpressionsAfterSuperCallAndOptimize","CallExpression","exit","isSuper","newNodes","map","expr","isCompletionRecord","skip","ClassMethod","kind","createConstructorFromExpressions","isDerivedClass","super","spreadElement","restElement","createStaticBlockFromExpressions","staticBlock","FIELD","ACCESSOR","METHOD","GETTER","SETTER","STATIC_OLD_VERSION","STATIC","DECORATORS_HAVE_THIS","getElementKind","toSortedDecoratorInfo","info","filter","el","generateDecorationList","decorators","decoratorsThis","decsCount","haveOneThis","some","Boolean","decs","i","numericLiteral","haveThis","generateDecorationExprs","decorationInfo","arrayExpression","flag","decoratorsHaveThis","decoratorsArray","privateMethods","extractElementLocalAssignments","localIds","locals","Array","isArray","addCallAccessorsFor","getId","setId","movePrivateAccessor","methodLocalVar","params","block","isClassDecoratableElementPath","staticBlockToIIFE","arrowFunctionExpression","exprs","createFunctionExpressionFromPrivateMethod","isGenerator","async","isAsync","functionExpression","createSetFunctionNameCall","state","addHelper","createToPropertyKeyCall","propertyKey","createPrivateBrandCheckClosure","brandName","binaryExpression","usesFunctionContext","traverseFast","isMetaProperty","meta","_unused","usesPrivateField","isPrivateName","_unused2","checkPrivateMethodUpdateError","decoratedPrivateMethods","privateNameVisitor","privateNameVisitorFactory","privateNamesMap","parentPath","parentParentPath","left","buildCodeFrameError","Map","set","transformClass","constantSuper","propertyVisitor","_classDecorationsId","classDecorators","hasElementDecorators","hasComputedKeysSideEffects","elemDecsUseFnContext","generateClassPrivateUid","assignments","scopeParent","memoiseExpression","hint","localEvaluatedId","staticInitLocal","isDecorated","ClassProperty","ClassPrivateProperty","ClassAccessorProperty","static","_staticInitLocal","_protoInitLocal","computed","newId","newField","keyPath","isConstantExpression","insertBefore","crawl","elementDecoratorInfo","classInitLocal","classIdLocal","decoratorReceiverId","handleDecoratorExpressions","hasSideEffects","usesFnContext","object","isMemberExpression","_decoratorReceiverId","willExtractSomeElemDecs","needsDeclaraionForClassBinding","classDecorationsFlag","classDecorations","classDecorationsId","isClassDeclaration","decoratorExpressions","classDecsUsePrivateName","generateUidIdentifier","lastInstancePrivateName","needsInstancePrivateBrandCheck","fieldInitializerExpressions","staticFieldInitializerExpressions","isStaticBlock","hasDecorators","d","isPrivate","isClassPrivateProperty","isClassMethod","newFieldInitId","newValue","initId","valuePath","args","callId","replaceSupers","ReplaceSupers","methodPath","objectRef","superRef","file","refToPreserve","replace","remove","nameExpr","stringLiteral","initExtraId","initExtraCall","sortedElementDecoratorInfo","elementDecorations","elementLocals","classLocals","classInitInjected","classInitCall","originalClass","statics","forEach","isProperty","isClassProperty","isClassPrivateMethod","staticsClass","toStatement","constructorBody","newExpr","newExpression","arguments","maybeGenerateMemoised","createLocalsAssignment","variableDeclaration","variableDeclarator","size","maybePrivateBrandName","setClassName","lhs","rhs","availableHelper","arrayPattern","objectPattern","objectProperty","isProtoKey","shouldTransformElement","shouldTransformClass","NamedEvaluationVisitoryFactory","isAnonymous","visitor","handleComputedProperty","propertyPath","keyValue","ref","VariableDeclarator","skipTransparentExprWrappers","AssignmentExpression","operator","AssignmentPattern","ObjectExpression","isDecoratedAnonymousClassExpression","isClassExpression","_default","assertVersion","assumption","loose","inherits","_assumption","VISITED","WeakSet","namedEvaluationVisitor","visitClass","_className","_node$id","Object","assign","ExportDefaultDeclaration","declaration","updatedVarDeclarationPath","splitExportDeclaration","ExportNamedDeclaration","Class"],"sources":["../src/decorators.ts"],"sourcesContent":["import type { NodePath, Scope, Visitor } from \"@babel/traverse\";\nimport { types as t, template } from \"@babel/core\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport * as charCodes from \"charcodes\";\nimport type { PluginAPI, PluginObject, PluginPass } from \"@babel/core\";\nimport { skipTransparentExprWrappers } from \"@babel/helper-skip-transparent-expression-wrappers\";\nimport {\n privateNameVisitorFactory,\n type PrivateNameVisitorState,\n} from \"./fields.ts\";\n\ninterface Options {\n /** @deprecated use `constantSuper` assumption instead. Only supported in 2021-12 version. */\n loose?: boolean;\n}\n\ntype ClassDecoratableElement =\n | t.ClassMethod\n | t.ClassPrivateMethod\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassAccessorProperty;\n\ntype ClassElement =\n | ClassDecoratableElement\n | t.TSDeclareMethod\n | t.TSIndexSignature\n | t.StaticBlock;\n\n// TODO(Babel 8): Only keep 2023-11\nexport type DecoratorVersionKind =\n | \"2023-11\"\n | \"2023-05\"\n | \"2023-01\"\n | \"2022-03\"\n | \"2021-12\";\n\nfunction incrementId(id: number[], idx = id.length - 1): void {\n // If index is -1, id needs an additional character, unshift A\n if (idx === -1) {\n id.unshift(charCodes.uppercaseA);\n return;\n }\n\n const current = id[idx];\n\n if (current === charCodes.uppercaseZ) {\n // if current is Z, skip to a\n id[idx] = charCodes.lowercaseA;\n } else if (current === charCodes.lowercaseZ) {\n // if current is z, reset to A and carry the 1\n id[idx] = charCodes.uppercaseA;\n incrementId(id, idx - 1);\n } else {\n // else, increment by one\n id[idx] = current + 1;\n }\n}\n\n/**\n * Generates a new private name that is unique to the given class. This can be\n * used to create extra class fields and methods for the implementation, while\n * keeping the length of those names as small as possible. This is important for\n * minification purposes (though private names can generally be minified,\n * transpilations and polyfills cannot yet).\n */\nfunction createPrivateUidGeneratorForClass(\n classPath: NodePath,\n): () => t.PrivateName {\n const currentPrivateId: number[] = [];\n const privateNames = new Set();\n\n classPath.traverse({\n PrivateName(path) {\n privateNames.add(path.node.id.name);\n },\n });\n\n return (): t.PrivateName => {\n let reifiedId;\n do {\n incrementId(currentPrivateId);\n reifiedId = String.fromCharCode(...currentPrivateId);\n } while (privateNames.has(reifiedId));\n\n return t.privateName(t.identifier(reifiedId));\n };\n}\n\n/**\n * Wraps the above generator function so that it's run lazily the first time\n * it's actually required. Several types of decoration do not require this, so it\n * saves iterating the class elements an additional time and allocating the space\n * for the Sets of element names.\n */\nfunction createLazyPrivateUidGeneratorForClass(\n classPath: NodePath,\n): () => t.PrivateName {\n let generator: () => t.PrivateName;\n\n return (): t.PrivateName => {\n if (!generator) {\n generator = createPrivateUidGeneratorForClass(classPath);\n }\n\n return generator();\n };\n}\n\n/**\n * Takes a class definition and the desired class name if anonymous and\n * replaces it with an equivalent class declaration (path) which is then\n * assigned to a local variable (id). This allows us to reassign the local variable with the\n * decorated version of the class. The class definition retains its original\n * name so that `toString` is not affected, other references to the class\n * are renamed instead.\n */\nfunction replaceClassWithVar(\n path: NodePath,\n className: string | t.Identifier | t.StringLiteral | undefined,\n): {\n id: t.Identifier;\n path: NodePath;\n} {\n if (path.type === \"ClassDeclaration\") {\n const id = path.node.id;\n const className = id.name;\n const varId = path.scope.generateUidIdentifierBasedOnNode(id);\n const classId = t.identifier(className);\n\n path.scope.rename(className, varId.name);\n\n path.get(\"id\").replaceWith(classId);\n\n return { id: t.cloneNode(varId), path };\n } else {\n let varId: t.Identifier;\n\n if (path.node.id) {\n className = path.node.id.name;\n varId = path.scope.parent.generateDeclaredUidIdentifier(className);\n path.scope.rename(className, varId.name);\n } else {\n varId = path.scope.parent.generateDeclaredUidIdentifier(\n typeof className === \"string\" ? className : \"decorated_class\",\n );\n }\n\n const newClassExpr = t.classExpression(\n typeof className === \"string\" ? t.identifier(className) : null,\n path.node.superClass,\n path.node.body,\n );\n\n const [newPath] = path.replaceWith(\n t.sequenceExpression([newClassExpr, varId]),\n );\n\n return {\n id: t.cloneNode(varId),\n path: newPath.get(\"expressions.0\") as NodePath,\n };\n }\n}\n\nfunction generateClassProperty(\n key: t.PrivateName | t.Identifier,\n value: t.Expression | undefined,\n isStatic: boolean,\n): t.ClassPrivateProperty | t.ClassProperty {\n if (key.type === \"PrivateName\") {\n return t.classPrivateProperty(key, value, undefined, isStatic);\n } else {\n return t.classProperty(key, value, undefined, undefined, isStatic);\n }\n}\n\nfunction addProxyAccessorsFor(\n className: t.Identifier,\n element: NodePath,\n originalKey: t.PrivateName | t.Expression,\n targetKey: t.PrivateName,\n version: DecoratorVersionKind,\n isComputed: boolean,\n isStatic: boolean,\n): void {\n const thisArg =\n (version === \"2023-11\" ||\n (!process.env.BABEL_8_BREAKING && version === \"2023-05\")) &&\n isStatic\n ? className\n : t.thisExpression();\n\n const getterBody = t.blockStatement([\n t.returnStatement(\n t.memberExpression(t.cloneNode(thisArg), t.cloneNode(targetKey)),\n ),\n ]);\n\n const setterBody = t.blockStatement([\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(t.cloneNode(thisArg), t.cloneNode(targetKey)),\n t.identifier(\"v\"),\n ),\n ),\n ]);\n\n let getter: t.ClassMethod | t.ClassPrivateMethod,\n setter: t.ClassMethod | t.ClassPrivateMethod;\n\n if (originalKey.type === \"PrivateName\") {\n getter = t.classPrivateMethod(\n \"get\",\n t.cloneNode(originalKey),\n [],\n getterBody,\n isStatic,\n );\n setter = t.classPrivateMethod(\n \"set\",\n t.cloneNode(originalKey),\n [t.identifier(\"v\")],\n setterBody,\n isStatic,\n );\n } else {\n getter = t.classMethod(\n \"get\",\n t.cloneNode(originalKey),\n [],\n getterBody,\n isComputed,\n isStatic,\n );\n setter = t.classMethod(\n \"set\",\n t.cloneNode(originalKey),\n [t.identifier(\"v\")],\n setterBody,\n isComputed,\n isStatic,\n );\n }\n\n element.insertAfter(setter);\n element.insertAfter(getter);\n}\n\nfunction extractProxyAccessorsFor(\n targetKey: t.PrivateName,\n version: DecoratorVersionKind,\n): (t.FunctionExpression | t.ArrowFunctionExpression)[] {\n if (version !== \"2023-11\" && version !== \"2023-05\" && version !== \"2023-01\") {\n return [\n template.expression.ast`\n function () {\n return this.${t.cloneNode(targetKey)};\n }\n ` as t.FunctionExpression,\n template.expression.ast`\n function (value) {\n this.${t.cloneNode(targetKey)} = value;\n }\n ` as t.FunctionExpression,\n ];\n }\n return [\n template.expression.ast`\n o => o.${t.cloneNode(targetKey)}\n ` as t.ArrowFunctionExpression,\n template.expression.ast`\n (o, v) => o.${t.cloneNode(targetKey)} = v\n ` as t.ArrowFunctionExpression,\n ];\n}\n\n/**\n * Prepend expressions to the field initializer. If the initializer is not defined,\n * this function will wrap the last expression within a `void` unary expression.\n *\n * @param {t.Expression[]} expressions\n * @param {(NodePath<\n * t.ClassProperty | t.ClassPrivateProperty | t.ClassAccessorProperty\n * >)} fieldPath\n */\nfunction prependExpressionsToFieldInitializer(\n expressions: t.Expression[],\n fieldPath: NodePath<\n t.ClassProperty | t.ClassPrivateProperty | t.ClassAccessorProperty\n >,\n) {\n const initializer = fieldPath.get(\"value\");\n if (initializer.node) {\n expressions.push(initializer.node);\n } else if (expressions.length > 0) {\n expressions[expressions.length - 1] = t.unaryExpression(\n \"void\",\n expressions[expressions.length - 1],\n );\n }\n initializer.replaceWith(maybeSequenceExpression(expressions));\n}\n\nfunction prependExpressionsToStaticBlock(\n expressions: t.Expression[],\n blockPath: NodePath,\n) {\n blockPath.unshiftContainer(\n \"body\",\n t.expressionStatement(maybeSequenceExpression(expressions)),\n );\n}\n\nfunction prependExpressionsToConstructor(\n expressions: t.Expression[],\n constructorPath: NodePath,\n) {\n constructorPath.node.body.body.unshift(\n t.expressionStatement(maybeSequenceExpression(expressions)),\n );\n}\n\nfunction isProtoInitCallExpression(\n expression: t.Expression,\n protoInitCall: t.Identifier,\n) {\n return (\n t.isCallExpression(expression) &&\n t.isIdentifier(expression.callee, { name: protoInitCall.name })\n );\n}\n\n/**\n * Optimize super call and its following expressions\n *\n * @param {t.Expression[]} expressions Mutated by this function. The first element must by a super call\n * @param {t.Identifier} protoInitLocal The generated protoInit id\n * @returns optimized expression\n */\nfunction optimizeSuperCallAndExpressions(\n expressions: t.Expression[],\n protoInitLocal: t.Identifier,\n) {\n // Merge `super(), protoInit(this)` into `protoInit(super())`\n if (\n expressions.length >= 2 &&\n isProtoInitCallExpression(expressions[1], protoInitLocal)\n ) {\n const mergedSuperCall = t.callExpression(t.cloneNode(protoInitLocal), [\n expressions[0],\n ]);\n expressions.splice(0, 2, mergedSuperCall);\n }\n // Merge `protoInit(super()), this` into `protoInit(super())`\n if (\n expressions.length >= 2 &&\n t.isThisExpression(expressions[expressions.length - 1]) &&\n isProtoInitCallExpression(\n expressions[expressions.length - 2],\n protoInitLocal,\n )\n ) {\n expressions.splice(expressions.length - 1, 1);\n }\n return maybeSequenceExpression(expressions);\n}\n\n/**\n * Insert expressions immediately after super() and optimize the output if possible.\n * This function will preserve the completion result using the trailing this expression.\n *\n * @param {t.Expression[]} expressions\n * @param {NodePath} constructorPath\n * @param {t.Identifier} protoInitLocal The generated protoInit id\n * @returns\n */\nfunction insertExpressionsAfterSuperCallAndOptimize(\n expressions: t.Expression[],\n constructorPath: NodePath,\n protoInitLocal: t.Identifier,\n) {\n constructorPath.traverse({\n CallExpression: {\n exit(path) {\n if (!path.get(\"callee\").isSuper()) return;\n const newNodes = [\n path.node,\n ...expressions.map(expr => t.cloneNode(expr)),\n ];\n // preserve completion result if super() is in an RHS or a return statement\n if (path.isCompletionRecord()) {\n newNodes.push(t.thisExpression());\n }\n path.replaceWith(\n optimizeSuperCallAndExpressions(newNodes, protoInitLocal),\n );\n\n path.skip();\n },\n },\n ClassMethod(path) {\n if (path.node.kind === \"constructor\") {\n path.skip();\n }\n },\n });\n}\n\n/**\n * Build a class constructor node from the given expressions. If the class is\n * derived, the constructor will call super() first to ensure that `this`\n * in the expressions work as expected.\n *\n * @param {t.Expression[]} expressions\n * @param {boolean} isDerivedClass\n * @returns The class constructor node\n */\nfunction createConstructorFromExpressions(\n expressions: t.Expression[],\n isDerivedClass: boolean,\n) {\n const body: t.Statement[] = [\n t.expressionStatement(maybeSequenceExpression(expressions)),\n ];\n if (isDerivedClass) {\n body.unshift(\n t.expressionStatement(\n t.callExpression(t.super(), [t.spreadElement(t.identifier(\"args\"))]),\n ),\n );\n }\n return t.classMethod(\n \"constructor\",\n t.identifier(\"constructor\"),\n isDerivedClass ? [t.restElement(t.identifier(\"args\"))] : [],\n t.blockStatement(body),\n );\n}\n\nfunction createStaticBlockFromExpressions(expressions: t.Expression[]) {\n return t.staticBlock([\n t.expressionStatement(maybeSequenceExpression(expressions)),\n ]);\n}\n\n// 3 bits reserved to this (0-7)\nconst FIELD = 0;\nconst ACCESSOR = 1;\nconst METHOD = 2;\nconst GETTER = 3;\nconst SETTER = 4;\n\nconst STATIC_OLD_VERSION = 5; // Before 2023-05\nconst STATIC = 8; // 1 << 3\nconst DECORATORS_HAVE_THIS = 16; // 1 << 4\n\nfunction getElementKind(element: NodePath): number {\n switch (element.node.type) {\n case \"ClassProperty\":\n case \"ClassPrivateProperty\":\n return FIELD;\n case \"ClassAccessorProperty\":\n return ACCESSOR;\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n if (element.node.kind === \"get\") {\n return GETTER;\n } else if (element.node.kind === \"set\") {\n return SETTER;\n } else {\n return METHOD;\n }\n }\n}\n\n// Information about the decorators applied to an element\ninterface DecoratorInfo {\n // An array of applied decorators or a memoised identifier\n decoratorsArray: t.Identifier | t.ArrayExpression | t.Expression;\n decoratorsHaveThis: boolean;\n\n // The kind of the decorated value, matches the kind value passed to applyDecs\n kind: number;\n\n // whether or not the field is static\n isStatic: boolean;\n\n // The name of the decorator\n name: t.StringLiteral | t.Expression;\n\n privateMethods:\n | (t.FunctionExpression | t.ArrowFunctionExpression)[]\n | undefined;\n\n // The names of local variables that will be used/returned from the decoration\n locals: t.Identifier | t.Identifier[] | undefined;\n}\n\n/**\n * Sort decoration info in the application order:\n * - static non-fields\n * - instance non-fields\n * - static fields\n * - instance fields\n *\n * @param {DecoratorInfo[]} info\n * @returns {DecoratorInfo[]} Sorted decoration info\n */\nfunction toSortedDecoratorInfo(info: DecoratorInfo[]): DecoratorInfo[] {\n return [\n ...info.filter(\n el => el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER,\n ),\n ...info.filter(\n el => !el.isStatic && el.kind >= ACCESSOR && el.kind <= SETTER,\n ),\n ...info.filter(el => el.isStatic && el.kind === FIELD),\n ...info.filter(el => !el.isStatic && el.kind === FIELD),\n ];\n}\n\ntype GenerateDecorationListResult = {\n // The zipped decorators array that will be passed to generateDecorationExprs\n decs: t.Expression[];\n // Whether there are non-empty decorator this values\n haveThis: boolean;\n};\n/**\n * Zip decorators and decorator this values into an array\n *\n * @param {t.Expression[]} decorators\n * @param {((t.Expression | undefined)[])} decoratorsThis decorator this values\n * @param {DecoratorVersionKind} version\n * @returns {GenerateDecorationListResult}\n */\nfunction generateDecorationList(\n decorators: t.Expression[],\n decoratorsThis: (t.Expression | undefined)[],\n version: DecoratorVersionKind,\n): GenerateDecorationListResult {\n const decsCount = decorators.length;\n const haveOneThis = decoratorsThis.some(Boolean);\n const decs: t.Expression[] = [];\n for (let i = 0; i < decsCount; i++) {\n if (\n (version === \"2023-11\" ||\n (!process.env.BABEL_8_BREAKING && version === \"2023-05\")) &&\n haveOneThis\n ) {\n decs.push(\n decoratorsThis[i] || t.unaryExpression(\"void\", t.numericLiteral(0)),\n );\n }\n decs.push(decorators[i]);\n }\n\n return { haveThis: haveOneThis, decs };\n}\n\nfunction generateDecorationExprs(\n decorationInfo: DecoratorInfo[],\n version: DecoratorVersionKind,\n): t.ArrayExpression {\n return t.arrayExpression(\n decorationInfo.map(el => {\n let flag = el.kind;\n if (el.isStatic) {\n flag +=\n version === \"2023-11\" ||\n (!process.env.BABEL_8_BREAKING && version === \"2023-05\")\n ? STATIC\n : STATIC_OLD_VERSION;\n }\n if (el.decoratorsHaveThis) flag += DECORATORS_HAVE_THIS;\n\n return t.arrayExpression([\n el.decoratorsArray,\n t.numericLiteral(flag),\n el.name,\n ...(el.privateMethods || []),\n ]);\n }),\n );\n}\n\nfunction extractElementLocalAssignments(decorationInfo: DecoratorInfo[]) {\n const localIds: t.Identifier[] = [];\n\n for (const el of decorationInfo) {\n const { locals } = el;\n\n if (Array.isArray(locals)) {\n localIds.push(...locals);\n } else if (locals !== undefined) {\n localIds.push(locals);\n }\n }\n\n return localIds;\n}\n\nfunction addCallAccessorsFor(\n version: DecoratorVersionKind,\n element: NodePath,\n key: t.PrivateName,\n getId: t.Identifier,\n setId: t.Identifier,\n isStatic: boolean,\n) {\n element.insertAfter(\n t.classPrivateMethod(\n \"get\",\n t.cloneNode(key),\n [],\n t.blockStatement([\n t.returnStatement(\n t.callExpression(\n t.cloneNode(getId),\n (process.env.BABEL_8_BREAKING || version === \"2023-11\") && isStatic\n ? []\n : [t.thisExpression()],\n ),\n ),\n ]),\n isStatic,\n ),\n );\n\n element.insertAfter(\n t.classPrivateMethod(\n \"set\",\n t.cloneNode(key),\n [t.identifier(\"v\")],\n t.blockStatement([\n t.expressionStatement(\n t.callExpression(\n t.cloneNode(setId),\n (process.env.BABEL_8_BREAKING || version === \"2023-11\") && isStatic\n ? [t.identifier(\"v\")]\n : [t.thisExpression(), t.identifier(\"v\")],\n ),\n ),\n ]),\n isStatic,\n ),\n );\n}\n\nfunction movePrivateAccessor(\n element: NodePath,\n key: t.PrivateName,\n methodLocalVar: t.Identifier,\n isStatic: boolean,\n) {\n let params: (t.Identifier | t.RestElement)[];\n let block: t.Statement[];\n\n if (element.node.kind === \"set\") {\n params = [t.identifier(\"v\")];\n block = [\n t.expressionStatement(\n t.callExpression(methodLocalVar, [\n t.thisExpression(),\n t.identifier(\"v\"),\n ]),\n ),\n ];\n } else {\n params = [];\n block = [\n t.returnStatement(t.callExpression(methodLocalVar, [t.thisExpression()])),\n ];\n }\n\n element.replaceWith(\n t.classPrivateMethod(\n element.node.kind,\n t.cloneNode(key),\n params,\n t.blockStatement(block),\n isStatic,\n ),\n );\n}\n\nfunction isClassDecoratableElementPath(\n path: NodePath,\n): path is NodePath {\n const { type } = path;\n\n return (\n type !== \"TSDeclareMethod\" &&\n type !== \"TSIndexSignature\" &&\n type !== \"StaticBlock\"\n );\n}\n\nfunction staticBlockToIIFE(block: t.StaticBlock) {\n return t.callExpression(\n t.arrowFunctionExpression([], t.blockStatement(block.body)),\n [],\n );\n}\n\nfunction maybeSequenceExpression(exprs: t.Expression[]) {\n if (exprs.length === 0) return t.unaryExpression(\"void\", t.numericLiteral(0));\n if (exprs.length === 1) return exprs[0];\n return t.sequenceExpression(exprs);\n}\n\n/**\n * Create FunctionExpression from a ClassPrivateMethod.\n * The returned FunctionExpression node takes ownership of the private method's body and params.\n *\n * @param {t.ClassPrivateMethod} node\n * @returns\n */\nfunction createFunctionExpressionFromPrivateMethod(node: t.ClassPrivateMethod) {\n const { params, body, generator: isGenerator, async: isAsync } = node;\n return t.functionExpression(\n undefined,\n // @ts-expect-error todo: Improve typings: TSParameterProperty is only allowed in constructor\n params,\n body,\n isGenerator,\n isAsync,\n );\n}\n\nfunction createSetFunctionNameCall(\n state: PluginPass,\n className: t.Identifier | t.StringLiteral,\n) {\n return t.callExpression(state.addHelper(\"setFunctionName\"), [\n t.thisExpression(),\n className,\n ]);\n}\n\nfunction createToPropertyKeyCall(state: PluginPass, propertyKey: t.Expression) {\n return t.callExpression(state.addHelper(\"toPropertyKey\"), [propertyKey]);\n}\n\nfunction createPrivateBrandCheckClosure(brandName: t.PrivateName) {\n return t.arrowFunctionExpression(\n [t.identifier(\"_\")],\n t.binaryExpression(\"in\", t.cloneNode(brandName), t.identifier(\"_\")),\n );\n}\n\n// Check if the expression does not reference function-specific\n// context or the given identifier name.\n// `true` means \"maybe\" and `false` means \"no\".\nfunction usesFunctionContext(expression: t.Node) {\n try {\n t.traverseFast(expression, node => {\n if (\n t.isThisExpression(node) ||\n t.isSuper(node) ||\n t.isIdentifier(node, { name: \"arguments\" }) ||\n (t.isMetaProperty(node) && node.meta.name !== \"import\")\n ) {\n // TODO: Add early return support to t.traverseFast\n throw null;\n }\n });\n return false;\n } catch {\n return true;\n }\n}\n\nfunction usesPrivateField(expression: t.Node) {\n try {\n t.traverseFast(expression, node => {\n if (t.isPrivateName(node)) {\n // TODO: Add early return support to t.traverseFast\n throw null;\n }\n });\n return false;\n } catch {\n return true;\n }\n}\n\nfunction checkPrivateMethodUpdateError(\n path: NodePath,\n decoratedPrivateMethods: Set,\n) {\n const privateNameVisitor = privateNameVisitorFactory<\n PrivateNameVisitorState,\n null\n >({\n PrivateName(path, state) {\n if (!state.privateNamesMap.has(path.node.id.name)) return;\n\n const parentPath = path.parentPath;\n const parentParentPath = parentPath.parentPath;\n\n if (\n // this.bar().#x = 123;\n (parentParentPath.node.type === \"AssignmentExpression\" &&\n parentParentPath.node.left === parentPath.node) ||\n // this.#x++;\n parentParentPath.node.type === \"UpdateExpression\" ||\n // ([...this.#x] = foo);\n parentParentPath.node.type === \"RestElement\" ||\n // ([this.#x] = foo);\n parentParentPath.node.type === \"ArrayPattern\" ||\n // ({ a: this.#x } = bar);\n (parentParentPath.node.type === \"ObjectProperty\" &&\n parentParentPath.node.value === parentPath.node &&\n parentParentPath.parentPath.type === \"ObjectPattern\") ||\n // for (this.#x of []);\n (parentParentPath.node.type === \"ForOfStatement\" &&\n parentParentPath.node.left === parentPath.node)\n ) {\n throw path.buildCodeFrameError(\n `Decorated private methods are read-only, but \"#${path.node.id.name}\" is updated via this expression.`,\n );\n }\n },\n });\n const privateNamesMap = new Map();\n for (const name of decoratedPrivateMethods) {\n privateNamesMap.set(name, null);\n }\n path.traverse(privateNameVisitor, {\n privateNamesMap: privateNamesMap,\n });\n}\n\nfunction transformClass(\n path: NodePath,\n state: PluginPass,\n constantSuper: boolean,\n version: DecoratorVersionKind,\n className: string | t.Identifier | t.StringLiteral | undefined,\n propertyVisitor: Visitor,\n): NodePath {\n const body = path.get(\"body.body\");\n\n const classDecorators = path.node.decorators;\n let hasElementDecorators = false;\n let hasComputedKeysSideEffects = false;\n let elemDecsUseFnContext = false;\n\n const generateClassPrivateUid = createLazyPrivateUidGeneratorForClass(path);\n\n const assignments: t.AssignmentExpression[] = [];\n const scopeParent: Scope = path.scope.parent;\n const memoiseExpression = (expression: t.Expression, hint: string) => {\n const localEvaluatedId = scopeParent.generateDeclaredUidIdentifier(hint);\n assignments.push(t.assignmentExpression(\"=\", localEvaluatedId, expression));\n return t.cloneNode(localEvaluatedId);\n };\n\n let protoInitLocal: t.Identifier;\n let staticInitLocal: t.Identifier;\n // Iterate over the class to see if we need to decorate it, and also to\n // transform simple auto accessors which are not decorated, and handle inferred\n // class name when the initializer of the class field is a class expression\n for (const element of body) {\n if (!isClassDecoratableElementPath(element)) {\n continue;\n }\n\n if (isDecorated(element.node)) {\n switch (element.node.type) {\n case \"ClassProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassProperty should be callable. Improve typings.\n propertyVisitor.ClassProperty(\n element as NodePath,\n state,\n );\n break;\n case \"ClassPrivateProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassPrivateProperty should be callable. Improve typings.\n propertyVisitor.ClassPrivateProperty(\n element as NodePath,\n state,\n );\n break;\n case \"ClassAccessorProperty\":\n // @ts-expect-error todo: propertyVisitor.ClassAccessorProperty should be callable. Improve typings.\n propertyVisitor.ClassAccessorProperty(\n element as NodePath,\n state,\n );\n if (version === \"2023-11\") {\n break;\n }\n /* fallthrough */\n default:\n if (element.node.static) {\n staticInitLocal ??=\n scopeParent.generateDeclaredUidIdentifier(\"initStatic\");\n } else {\n protoInitLocal ??=\n scopeParent.generateDeclaredUidIdentifier(\"initProto\");\n }\n break;\n }\n hasElementDecorators = true;\n elemDecsUseFnContext ||=\n element.node.decorators.some(usesFunctionContext);\n } else if (element.node.type === \"ClassAccessorProperty\") {\n // @ts-expect-error todo: propertyVisitor.ClassAccessorProperty should be callable. Improve typings.\n propertyVisitor.ClassAccessorProperty(\n element as NodePath,\n state,\n );\n const { key, value, static: isStatic, computed } = element.node;\n\n const newId = generateClassPrivateUid();\n const newField = generateClassProperty(newId, value, isStatic);\n const keyPath = element.get(\"key\");\n const [newPath] = element.replaceWith(newField);\n\n addProxyAccessorsFor(\n path.node.id,\n newPath,\n computed && !keyPath.isConstantExpression()\n ? memoiseExpression(\n createToPropertyKeyCall(state, key as t.Expression),\n \"computedKey\",\n )\n : key,\n newId,\n version,\n computed,\n isStatic,\n );\n }\n\n if (\"computed\" in element.node && element.node.computed) {\n hasComputedKeysSideEffects ||= !scopeParent.isStatic(element.node.key);\n }\n }\n\n if (!classDecorators && !hasElementDecorators) {\n // If nothing is decorated but we have assignments, it must be the memoised\n // computed keys of class accessors\n if (assignments.length > 0) {\n path.insertBefore(assignments.map(expr => t.expressionStatement(expr)));\n\n // Recrawl the scope to make sure new identifiers are properly synced\n path.scope.crawl();\n }\n // If nothing is decorated and no assignments inserted, return\n return;\n }\n\n const elementDecoratorInfo: DecoratorInfo[] = [];\n\n let constructorPath: NodePath | undefined;\n const decoratedPrivateMethods = new Set();\n\n let classInitLocal: t.Identifier, classIdLocal: t.Identifier;\n let decoratorReceiverId: t.Identifier | null = null;\n\n // Memoise the this value `a.b` of decorator member expressions `@a.b.dec`,\n type HandleDecoratorExpressionsResult = {\n // whether the whole decorator list requires memoisation\n hasSideEffects: boolean;\n usesFnContext: boolean;\n // the this value of each decorator if applicable\n decoratorsThis: (t.Expression | undefined)[];\n };\n function handleDecoratorExpressions(\n expressions: t.Expression[],\n ): HandleDecoratorExpressionsResult {\n let hasSideEffects = false;\n let usesFnContext = false;\n const decoratorsThis: (t.Expression | null)[] = [];\n for (const expression of expressions) {\n let object;\n if (\n (version === \"2023-11\" ||\n (!process.env.BABEL_8_BREAKING && version === \"2023-05\")) &&\n t.isMemberExpression(expression)\n ) {\n if (t.isSuper(expression.object)) {\n object = t.thisExpression();\n } else if (scopeParent.isStatic(expression.object)) {\n object = t.cloneNode(expression.object);\n } else {\n decoratorReceiverId ??=\n scopeParent.generateDeclaredUidIdentifier(\"obj\");\n object = t.assignmentExpression(\n \"=\",\n t.cloneNode(decoratorReceiverId),\n expression.object,\n );\n expression.object = t.cloneNode(decoratorReceiverId);\n }\n }\n decoratorsThis.push(object);\n hasSideEffects ||= !scopeParent.isStatic(expression);\n usesFnContext ||= usesFunctionContext(expression);\n }\n return { hasSideEffects, usesFnContext, decoratorsThis };\n }\n\n const willExtractSomeElemDecs =\n hasComputedKeysSideEffects ||\n (process.env.BABEL_8_BREAKING\n ? elemDecsUseFnContext\n : elemDecsUseFnContext || version !== \"2023-11\");\n\n let needsDeclaraionForClassBinding = false;\n let classDecorationsFlag = 0;\n let classDecorations: t.Expression[] = [];\n let classDecorationsId: t.Identifier;\n if (classDecorators) {\n classInitLocal = scopeParent.generateDeclaredUidIdentifier(\"initClass\");\n needsDeclaraionForClassBinding = path.isClassDeclaration();\n ({ id: classIdLocal, path } = replaceClassWithVar(path, className));\n\n path.node.decorators = null;\n\n const decoratorExpressions = classDecorators.map(el => el.expression);\n const classDecsUsePrivateName = decoratorExpressions.some(usesPrivateField);\n const { hasSideEffects, decoratorsThis } =\n handleDecoratorExpressions(decoratorExpressions);\n\n const { haveThis, decs } = generateDecorationList(\n decoratorExpressions,\n decoratorsThis,\n version,\n );\n classDecorationsFlag = haveThis ? 1 : 0;\n classDecorations = decs;\n\n if (\n (hasSideEffects && willExtractSomeElemDecs) ||\n classDecsUsePrivateName\n ) {\n classDecorationsId = memoiseExpression(\n t.arrayExpression(classDecorations),\n \"classDecs\",\n );\n }\n } else {\n if (!path.node.id) {\n path.node.id = path.scope.generateUidIdentifier(\"Class\");\n }\n classIdLocal = t.cloneNode(path.node.id);\n }\n\n let lastInstancePrivateName: t.PrivateName;\n let needsInstancePrivateBrandCheck = false;\n\n let fieldInitializerExpressions = [];\n let staticFieldInitializerExpressions: t.Expression[] = [];\n\n if (hasElementDecorators) {\n if (protoInitLocal) {\n const protoInitCall = t.callExpression(t.cloneNode(protoInitLocal), [\n t.thisExpression(),\n ]);\n fieldInitializerExpressions.push(protoInitCall);\n }\n for (const element of body) {\n if (!isClassDecoratableElementPath(element)) {\n if (\n staticFieldInitializerExpressions.length > 0 &&\n element.isStaticBlock()\n ) {\n prependExpressionsToStaticBlock(\n staticFieldInitializerExpressions,\n element,\n );\n staticFieldInitializerExpressions = [];\n }\n continue;\n }\n\n const { node } = element;\n const decorators = node.decorators;\n\n const hasDecorators = !!decorators?.length;\n\n const isComputed = \"computed\" in node && node.computed;\n\n let name = \"computedKey\";\n\n if (node.key.type === \"PrivateName\") {\n name = node.key.id.name;\n } else if (!isComputed && node.key.type === \"Identifier\") {\n name = node.key.name;\n }\n let decoratorsArray: t.Identifier | t.ArrayExpression | t.Expression;\n let decoratorsHaveThis;\n\n if (hasDecorators) {\n const decoratorExpressions = decorators.map(d => d.expression);\n const { hasSideEffects, usesFnContext, decoratorsThis } =\n handleDecoratorExpressions(decoratorExpressions);\n const { decs, haveThis } = generateDecorationList(\n decoratorExpressions,\n decoratorsThis,\n version,\n );\n decoratorsHaveThis = haveThis;\n decoratorsArray = decs.length === 1 ? decs[0] : t.arrayExpression(decs);\n if (usesFnContext || (hasSideEffects && willExtractSomeElemDecs)) {\n decoratorsArray = memoiseExpression(decoratorsArray, name + \"Decs\");\n }\n }\n\n if (isComputed) {\n if (!element.get(\"key\").isConstantExpression()) {\n node.key = memoiseExpression(\n createToPropertyKeyCall(state, node.key as t.Expression),\n \"computedKey\",\n );\n }\n }\n\n const { key, static: isStatic } = node;\n\n const isPrivate = key.type === \"PrivateName\";\n\n const kind = getElementKind(element);\n\n if (isPrivate && !isStatic) {\n if (hasDecorators) {\n needsInstancePrivateBrandCheck = true;\n }\n if (t.isClassPrivateProperty(node) || !lastInstancePrivateName) {\n lastInstancePrivateName = key;\n }\n }\n\n if (element.isClassMethod({ kind: \"constructor\" })) {\n constructorPath = element;\n }\n\n let locals: t.Identifier[];\n if (hasDecorators) {\n let privateMethods: Array<\n t.FunctionExpression | t.ArrowFunctionExpression\n >;\n\n if (kind === ACCESSOR) {\n const { value } = element.node as t.ClassAccessorProperty;\n\n const params: t.Expression[] =\n (process.env.BABEL_8_BREAKING || version === \"2023-11\") && isStatic\n ? []\n : [t.thisExpression()];\n\n if (value) {\n params.push(t.cloneNode(value));\n }\n\n const newId = generateClassPrivateUid();\n const newFieldInitId =\n element.scope.parent.generateDeclaredUidIdentifier(`init_${name}`);\n const newValue = t.callExpression(\n t.cloneNode(newFieldInitId),\n params,\n );\n\n const newField = generateClassProperty(newId, newValue, isStatic);\n const [newPath] = element.replaceWith(newField);\n\n if (isPrivate) {\n privateMethods = extractProxyAccessorsFor(newId, version);\n\n const getId = newPath.scope.parent.generateDeclaredUidIdentifier(\n `get_${name}`,\n );\n const setId = newPath.scope.parent.generateDeclaredUidIdentifier(\n `set_${name}`,\n );\n\n addCallAccessorsFor(version, newPath, key, getId, setId, isStatic);\n\n locals = [newFieldInitId, getId, setId];\n } else {\n addProxyAccessorsFor(\n path.node.id,\n newPath,\n key,\n newId,\n version,\n isComputed,\n isStatic,\n );\n locals = [newFieldInitId];\n }\n } else if (kind === FIELD) {\n const initId = element.scope.parent.generateDeclaredUidIdentifier(\n `init_${name}`,\n );\n const valuePath = (\n element as NodePath\n ).get(\"value\");\n\n const args: t.Expression[] =\n (process.env.BABEL_8_BREAKING || version === \"2023-11\") && isStatic\n ? []\n : [t.thisExpression()];\n if (valuePath.node) args.push(valuePath.node);\n\n valuePath.replaceWith(t.callExpression(t.cloneNode(initId), args));\n\n locals = [initId];\n\n if (isPrivate) {\n privateMethods = extractProxyAccessorsFor(key, version);\n }\n } else if (isPrivate) {\n const callId = element.scope.parent.generateDeclaredUidIdentifier(\n `call_${name}`,\n );\n locals = [callId];\n\n const replaceSupers = new ReplaceSupers({\n constantSuper,\n methodPath: element as NodePath,\n objectRef: classIdLocal,\n superRef: path.node.superClass,\n file: state.file,\n refToPreserve: classIdLocal,\n });\n\n replaceSupers.replace();\n\n privateMethods = [\n createFunctionExpressionFromPrivateMethod(\n element.node as t.ClassPrivateMethod,\n ),\n ];\n\n if (kind === GETTER || kind === SETTER) {\n movePrivateAccessor(\n element as NodePath,\n t.cloneNode(key),\n t.cloneNode(callId),\n isStatic,\n );\n } else {\n const node = element.node as t.ClassPrivateMethod;\n\n // Unshift\n path.node.body.body.unshift(\n t.classPrivateProperty(key, t.cloneNode(callId), [], node.static),\n );\n\n decoratedPrivateMethods.add(key.id.name);\n\n element.remove();\n }\n }\n\n let nameExpr: t.Expression;\n\n if (isComputed) {\n nameExpr = t.cloneNode(key as t.Expression);\n } else if (key.type === \"PrivateName\") {\n nameExpr = t.stringLiteral(key.id.name);\n } else if (key.type === \"Identifier\") {\n nameExpr = t.stringLiteral(key.name);\n } else {\n nameExpr = t.cloneNode(key as t.Expression);\n }\n\n elementDecoratorInfo.push({\n kind,\n decoratorsArray,\n decoratorsHaveThis,\n name: nameExpr,\n isStatic,\n privateMethods,\n locals,\n });\n\n if (element.node) {\n element.node.decorators = null;\n }\n }\n\n if (\n fieldInitializerExpressions.length > 0 &&\n !isStatic &&\n (kind === FIELD || kind === ACCESSOR)\n ) {\n prependExpressionsToFieldInitializer(\n fieldInitializerExpressions,\n element as NodePath,\n );\n fieldInitializerExpressions = [];\n }\n\n if (\n staticFieldInitializerExpressions.length > 0 &&\n isStatic &&\n (kind === FIELD || kind === ACCESSOR)\n ) {\n prependExpressionsToFieldInitializer(\n staticFieldInitializerExpressions,\n element as NodePath,\n );\n staticFieldInitializerExpressions = [];\n }\n\n if (hasDecorators && version === \"2023-11\") {\n if (kind === FIELD || kind === ACCESSOR) {\n const initExtraId = scopeParent.generateDeclaredUidIdentifier(\n `init_extra_${name}`,\n );\n locals.push(initExtraId);\n const initExtraCall = t.callExpression(\n t.cloneNode(initExtraId),\n isStatic ? [] : [t.thisExpression()],\n );\n if (!isStatic) {\n fieldInitializerExpressions.push(initExtraCall);\n } else {\n staticFieldInitializerExpressions.push(initExtraCall);\n }\n }\n }\n }\n }\n\n if (fieldInitializerExpressions.length > 0) {\n const isDerivedClass = !!path.node.superClass;\n if (constructorPath) {\n if (isDerivedClass) {\n insertExpressionsAfterSuperCallAndOptimize(\n fieldInitializerExpressions,\n constructorPath,\n protoInitLocal,\n );\n } else {\n prependExpressionsToConstructor(\n fieldInitializerExpressions,\n constructorPath,\n );\n }\n } else {\n path.node.body.body.unshift(\n createConstructorFromExpressions(\n fieldInitializerExpressions,\n isDerivedClass,\n ),\n );\n }\n fieldInitializerExpressions = [];\n }\n\n if (staticFieldInitializerExpressions.length > 0) {\n path.node.body.body.push(\n createStaticBlockFromExpressions(staticFieldInitializerExpressions),\n );\n staticFieldInitializerExpressions = [];\n }\n\n const sortedElementDecoratorInfo =\n toSortedDecoratorInfo(elementDecoratorInfo);\n\n const elementDecorations = generateDecorationExprs(\n process.env.BABEL_8_BREAKING || version === \"2023-11\"\n ? elementDecoratorInfo\n : sortedElementDecoratorInfo,\n version,\n );\n\n const elementLocals: t.Identifier[] = extractElementLocalAssignments(\n sortedElementDecoratorInfo,\n );\n\n if (protoInitLocal) {\n elementLocals.push(protoInitLocal);\n }\n\n if (staticInitLocal) {\n elementLocals.push(staticInitLocal);\n }\n\n const classLocals: t.Identifier[] = [];\n let classInitInjected = false;\n const classInitCall =\n classInitLocal && t.callExpression(t.cloneNode(classInitLocal), []);\n\n const originalClass = path.node;\n\n if (classDecorators) {\n classLocals.push(classIdLocal, classInitLocal);\n const statics: (\n | t.ClassProperty\n | t.ClassPrivateProperty\n | t.ClassPrivateMethod\n )[] = [];\n path.get(\"body.body\").forEach(element => {\n // Static blocks cannot be compiled to \"instance blocks\", but we can inline\n // them as IIFEs in the next property.\n if (element.isStaticBlock()) {\n staticFieldInitializerExpressions.push(staticBlockToIIFE(element.node));\n element.remove();\n return;\n }\n\n const isProperty =\n element.isClassProperty() || element.isClassPrivateProperty();\n\n if (\n (isProperty || element.isClassPrivateMethod()) &&\n element.node.static\n ) {\n if (isProperty && staticFieldInitializerExpressions.length > 0) {\n prependExpressionsToFieldInitializer(\n staticFieldInitializerExpressions,\n element,\n );\n staticFieldInitializerExpressions = [];\n }\n\n element.node.static = false;\n statics.push(element.node);\n element.remove();\n }\n });\n\n if (statics.length > 0 || staticFieldInitializerExpressions.length > 0) {\n const staticsClass = template.expression.ast`\n class extends ${state.addHelper(\"identity\")} {}\n ` as t.ClassExpression;\n staticsClass.body.body = [\n t.staticBlock([\n t.toStatement(originalClass, true) ||\n // If toStatement returns false, originalClass must be an anonymous ClassExpression,\n // because `export default @dec ...` has been handled in the export visitor before.\n t.expressionStatement(originalClass as t.ClassExpression),\n ]),\n ...statics,\n ];\n\n const constructorBody: t.Expression[] = [];\n\n const newExpr = t.newExpression(staticsClass, []);\n\n if (staticFieldInitializerExpressions.length > 0) {\n constructorBody.push(...staticFieldInitializerExpressions);\n }\n if (classInitCall) {\n classInitInjected = true;\n constructorBody.push(classInitCall);\n }\n if (constructorBody.length > 0) {\n constructorBody.unshift(\n t.callExpression(t.super(), [t.cloneNode(classIdLocal)]),\n );\n\n // set isDerivedClass to false as we have already prepended super call\n staticsClass.body.body.push(\n createConstructorFromExpressions(\n constructorBody,\n /* isDerivedClass */ false,\n ),\n );\n } else {\n newExpr.arguments.push(t.cloneNode(classIdLocal));\n }\n\n path.replaceWith(newExpr);\n }\n }\n if (!classInitInjected && classInitCall) {\n path.node.body.body.push(\n t.staticBlock([t.expressionStatement(classInitCall)]),\n );\n }\n\n let { superClass } = originalClass;\n if (\n superClass &&\n (process.env.BABEL_8_BREAKING ||\n version === \"2023-11\" ||\n version === \"2023-05\")\n ) {\n const id = path.scope.maybeGenerateMemoised(superClass);\n if (id) {\n originalClass.superClass = t.assignmentExpression(\"=\", id, superClass);\n superClass = id;\n }\n }\n originalClass.body.body.unshift(\n t.staticBlock(\n [\n t.expressionStatement(\n createLocalsAssignment(\n elementLocals,\n classLocals,\n elementDecorations,\n classDecorationsId ?? t.arrayExpression(classDecorations),\n t.numericLiteral(classDecorationsFlag),\n needsInstancePrivateBrandCheck ? lastInstancePrivateName : null,\n typeof className === \"object\" ? className : undefined,\n t.cloneNode(superClass),\n state,\n version,\n ),\n ),\n staticInitLocal &&\n t.expressionStatement(\n t.callExpression(t.cloneNode(staticInitLocal), [\n t.thisExpression(),\n ]),\n ),\n ].filter(Boolean),\n ),\n );\n\n // When path is a ClassExpression, path.insertBefore will convert `path`\n // into a SequenceExpression\n path.insertBefore(assignments.map(expr => t.expressionStatement(expr)));\n\n if (needsDeclaraionForClassBinding) {\n path.insertBefore(\n t.variableDeclaration(\"let\", [\n t.variableDeclarator(t.cloneNode(classIdLocal)),\n ]),\n );\n }\n\n if (decoratedPrivateMethods.size > 0) {\n checkPrivateMethodUpdateError(path, decoratedPrivateMethods);\n }\n\n // Recrawl the scope to make sure new identifiers are properly synced\n path.scope.crawl();\n\n return path;\n}\n\nfunction createLocalsAssignment(\n elementLocals: t.Identifier[],\n classLocals: t.Identifier[],\n elementDecorations: t.ArrayExpression | t.Identifier,\n classDecorations: t.ArrayExpression | t.Identifier,\n classDecorationsFlag: t.NumericLiteral,\n maybePrivateBrandName: t.PrivateName | null,\n setClassName: t.Identifier | t.StringLiteral | undefined,\n superClass: null | t.Expression,\n state: PluginPass,\n version: DecoratorVersionKind,\n) {\n let lhs, rhs;\n const args: t.Expression[] = [\n setClassName\n ? createSetFunctionNameCall(state, setClassName)\n : t.thisExpression(),\n classDecorations,\n elementDecorations,\n ];\n\n if (!process.env.BABEL_8_BREAKING) {\n if (version !== \"2023-11\") {\n args.splice(1, 2, elementDecorations, classDecorations);\n }\n if (\n version === \"2021-12\" ||\n (version === \"2022-03\" && !state.availableHelper(\"applyDecs2203R\"))\n ) {\n lhs = t.arrayPattern([...elementLocals, ...classLocals]);\n rhs = t.callExpression(\n state.addHelper(version === \"2021-12\" ? \"applyDecs\" : \"applyDecs2203\"),\n args,\n );\n return t.assignmentExpression(\"=\", lhs, rhs);\n } else if (version === \"2022-03\") {\n rhs = t.callExpression(state.addHelper(\"applyDecs2203R\"), args);\n } else if (version === \"2023-01\") {\n if (maybePrivateBrandName) {\n args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));\n }\n rhs = t.callExpression(state.addHelper(\"applyDecs2301\"), args);\n } else if (version === \"2023-05\") {\n if (\n maybePrivateBrandName ||\n superClass ||\n classDecorationsFlag.value !== 0\n ) {\n args.push(classDecorationsFlag);\n }\n if (maybePrivateBrandName) {\n args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));\n } else if (superClass) {\n args.push(t.unaryExpression(\"void\", t.numericLiteral(0)));\n }\n if (superClass) args.push(superClass);\n rhs = t.callExpression(state.addHelper(\"applyDecs2305\"), args);\n }\n }\n if (process.env.BABEL_8_BREAKING || version === \"2023-11\") {\n if (\n maybePrivateBrandName ||\n superClass ||\n classDecorationsFlag.value !== 0\n ) {\n args.push(classDecorationsFlag);\n }\n if (maybePrivateBrandName) {\n args.push(createPrivateBrandCheckClosure(maybePrivateBrandName));\n } else if (superClass) {\n args.push(t.unaryExpression(\"void\", t.numericLiteral(0)));\n }\n if (superClass) args.push(superClass);\n rhs = t.callExpression(state.addHelper(\"applyDecs2311\"), args);\n }\n\n // optimize `{ c: [classLocals] } = applyDecsHelper(...)` to\n // `[classLocals] = applyDecsHelper(...).c`\n if (elementLocals.length > 0) {\n if (classLocals.length > 0) {\n lhs = t.objectPattern([\n t.objectProperty(t.identifier(\"e\"), t.arrayPattern(elementLocals)),\n t.objectProperty(t.identifier(\"c\"), t.arrayPattern(classLocals)),\n ]);\n } else {\n lhs = t.arrayPattern(elementLocals);\n rhs = t.memberExpression(rhs, t.identifier(\"e\"), false, false);\n }\n } else {\n // invariant: classLocals.length > 0\n lhs = t.arrayPattern(classLocals);\n rhs = t.memberExpression(rhs, t.identifier(\"c\"), false, false);\n }\n\n return t.assignmentExpression(\"=\", lhs, rhs);\n}\n\nfunction isProtoKey(\n node: t.Identifier | t.StringLiteral | t.BigIntLiteral | t.NumericLiteral,\n) {\n return node.type === \"Identifier\"\n ? node.name === \"__proto__\"\n : node.value === \"__proto__\";\n}\n\nfunction isDecorated(node: t.Class | ClassDecoratableElement) {\n return node.decorators && node.decorators.length > 0;\n}\n\nfunction shouldTransformElement(node: ClassElement) {\n switch (node.type) {\n case \"ClassAccessorProperty\":\n return true;\n case \"ClassMethod\":\n case \"ClassProperty\":\n case \"ClassPrivateMethod\":\n case \"ClassPrivateProperty\":\n return isDecorated(node);\n default:\n return false;\n }\n}\n\nfunction shouldTransformClass(node: t.Class) {\n return isDecorated(node) || node.body.body.some(shouldTransformElement);\n}\n\n// Todo: unify name references logic with helper-function-name\nfunction NamedEvaluationVisitoryFactory(\n isAnonymous: (path: NodePath) => boolean,\n visitor: (\n path: NodePath,\n state: PluginPass,\n name:\n | string\n | t.Identifier\n | t.StringLiteral\n | t.NumericLiteral\n | t.BigIntLiteral,\n ) => void,\n) {\n function handleComputedProperty(\n propertyPath: NodePath<\n t.ObjectProperty | t.ClassProperty | t.ClassAccessorProperty\n >,\n key: t.Expression,\n state: PluginPass,\n ): t.StringLiteral | t.Identifier {\n switch (key.type) {\n case \"StringLiteral\":\n return t.stringLiteral(key.value);\n case \"NumericLiteral\":\n case \"BigIntLiteral\": {\n const keyValue = key.value + \"\";\n propertyPath.get(\"key\").replaceWith(t.stringLiteral(keyValue));\n return t.stringLiteral(keyValue);\n }\n default: {\n const ref = propertyPath.scope.maybeGenerateMemoised(key);\n propertyPath\n .get(\"key\")\n .replaceWith(\n t.assignmentExpression(\n \"=\",\n ref,\n createToPropertyKeyCall(state, key),\n ),\n );\n return t.cloneNode(ref);\n }\n }\n }\n return {\n VariableDeclarator(path, state) {\n const id = path.node.id;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"init\"));\n if (isAnonymous(initializer)) {\n const name = id.name;\n visitor(initializer, state, name);\n }\n }\n },\n AssignmentExpression(path, state) {\n const id = path.node.left;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"right\"));\n if (isAnonymous(initializer)) {\n switch (path.node.operator) {\n case \"=\":\n case \"&&=\":\n case \"||=\":\n case \"??=\":\n visitor(initializer, state, id.name);\n }\n }\n }\n },\n AssignmentPattern(path, state) {\n const id = path.node.left;\n if (id.type === \"Identifier\") {\n const initializer = skipTransparentExprWrappers(path.get(\"right\"));\n if (isAnonymous(initializer)) {\n const name = id.name;\n visitor(initializer, state, name);\n }\n }\n },\n // We listen on ObjectExpression so that we don't have to visit\n // the object properties under object patterns\n ObjectExpression(path, state) {\n for (const propertyPath of path.get(\"properties\")) {\n const { node } = propertyPath;\n if (node.type !== \"ObjectProperty\") continue;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(\n propertyPath.get(\"value\"),\n );\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n // 13.2.5.5 RS: PropertyDefinitionEvaluation\n if (!isProtoKey(id as t.StringLiteral | t.Identifier)) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n }\n } else {\n const ref = handleComputedProperty(\n propertyPath as NodePath,\n // The key of a computed object property must not be a private name\n id as t.Expression,\n state,\n );\n visitor(initializer, state, ref);\n }\n }\n }\n },\n ClassPrivateProperty(path, state) {\n const { node } = path;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n const className = t.stringLiteral(\"#\" + node.key.id.name);\n visitor(initializer, state, className);\n }\n },\n ClassAccessorProperty(path, state) {\n const { node } = path;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else if (id.type === \"PrivateName\") {\n const className = t.stringLiteral(\"#\" + id.id.name);\n visitor(initializer, state, className);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n } else {\n const ref = handleComputedProperty(\n path,\n // The key of a computed accessor property must not be a private name\n id as t.Expression,\n state,\n );\n visitor(initializer, state, ref);\n }\n }\n },\n ClassProperty(path, state) {\n const { node } = path;\n const id = node.key;\n const initializer = skipTransparentExprWrappers(path.get(\"value\"));\n if (isAnonymous(initializer)) {\n if (!node.computed) {\n if (id.type === \"Identifier\") {\n visitor(initializer, state, id.name);\n } else {\n const className = t.stringLiteral(\n (id as t.StringLiteral | t.NumericLiteral | t.BigIntLiteral)\n .value + \"\",\n );\n visitor(initializer, state, className);\n }\n } else {\n const ref = handleComputedProperty(path, id, state);\n visitor(initializer, state, ref);\n }\n }\n },\n } satisfies Visitor;\n}\n\nfunction isDecoratedAnonymousClassExpression(path: NodePath) {\n return (\n path.isClassExpression({ id: null }) && shouldTransformClass(path.node)\n );\n}\n\nexport default function (\n { assertVersion, assumption }: PluginAPI,\n { loose }: Options,\n version: DecoratorVersionKind,\n inherits: PluginObject[\"inherits\"],\n): PluginObject {\n if (process.env.BABEL_8_BREAKING) {\n assertVersion(process.env.IS_PUBLISH ? PACKAGE_JSON.version : \"^7.21.0\");\n } else {\n if (\n version === \"2023-11\" ||\n version === \"2023-05\" ||\n version === \"2023-01\"\n ) {\n assertVersion(\"^7.21.0\");\n } else if (version === \"2021-12\") {\n assertVersion(\"^7.16.0\");\n } else {\n assertVersion(\"^7.19.0\");\n }\n }\n\n const VISITED = new WeakSet();\n const constantSuper = assumption(\"constantSuper\") ?? loose;\n\n const namedEvaluationVisitor: Visitor =\n NamedEvaluationVisitoryFactory(\n isDecoratedAnonymousClassExpression,\n visitClass,\n );\n\n function visitClass(\n path: NodePath,\n state: PluginPass,\n className: string | t.Identifier | t.StringLiteral | undefined,\n ) {\n if (VISITED.has(path)) return;\n const { node } = path;\n className ??= node.id?.name;\n const newPath = transformClass(\n path,\n state,\n constantSuper,\n version,\n className,\n namedEvaluationVisitor,\n );\n if (newPath) {\n VISITED.add(newPath);\n return;\n }\n VISITED.add(path);\n }\n\n return {\n name: \"proposal-decorators\",\n inherits: inherits,\n\n visitor: {\n ExportDefaultDeclaration(path, state) {\n const { declaration } = path.node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n // When compiling class decorators we need to replace the class\n // binding, so we must split it in two separate declarations.\n isDecorated(declaration)\n ) {\n const isAnonymous = !declaration.id;\n const updatedVarDeclarationPath = splitExportDeclaration(\n path,\n ) as unknown as NodePath;\n if (isAnonymous) {\n visitClass(\n updatedVarDeclarationPath,\n state,\n t.stringLiteral(\"default\"),\n );\n }\n }\n },\n ExportNamedDeclaration(path) {\n const { declaration } = path.node;\n if (\n declaration?.type === \"ClassDeclaration\" &&\n // When compiling class decorators we need to replace the class\n // binding, so we must split it in two separate declarations.\n isDecorated(declaration)\n ) {\n splitExportDeclaration(path);\n }\n },\n\n Class(path, state) {\n visitClass(path, state, undefined);\n },\n\n ...namedEvaluationVisitor,\n },\n };\n}\n"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AAGA,IAAAG,wCAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AA+BA,SAASK,WAAWA,CAACC,EAAY,EAAEC,GAAG,GAAGD,E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W,CAAC,EACxB;UACA,MAAM7B,WAAW,GAAG,CAAC6B,WAAW,CAAChV,EAAE;UACnC,MAAMiV,yBAAyB,GAAG,IAAAC,qCAAsB,EACtDtU,IACF,CAA4C;UAC5C,IAAIuS,WAAW,EAAE;YACfuB,UAAU,CACRO,yBAAyB,EACzBxK,KAAK,EACLrJ,WAAC,CAACyP,aAAa,CAAC,SAAS,CAC3B,CAAC;UACH;QACF;MACF,CAAC;MACDsE,sBAAsBA,CAACvU,IAAI,EAAE;QAC3B,MAAM;UAAEoU;QAAY,CAAC,GAAGpU,IAAI,CAACE,IAAI;QACjC,IACE,CAAAkU,WAAW,oBAAXA,WAAW,CAAErT,IAAI,MAAK,kBAAkB,IAGxCuL,WAAW,CAAC8H,WAAW,CAAC,EACxB;UACA,IAAAE,qCAAsB,EAACtU,IAAI,CAAC;QAC9B;MACF,CAAC;MAEDwU,KAAKA,CAACxU,IAAI,EAAE6J,KAAK,EAAE;QACjBiK,UAAU,CAAC9T,IAAI,EAAE6J,KAAK,EAAExH,SAAS,CAAC;MACpC;IAAC,GAEEwR,sBAAsB;EAE7B,CAAC;AACH"} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/features.js b/node_modules/@babel/helper-create-class-features-plugin/lib/features.js index a4ad9ff..5cc919c 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/features.js +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/features.js @@ -47,7 +47,7 @@ } const loose = isLoose(file, mask); if (resolvedLoose === !loose) { - 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)."); + 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)." + "\n\n" + getBabelShowConfigForHint(file)); } else { resolvedLoose = loose; { @@ -59,11 +59,26 @@ for (const [mask, name] of featuresSameLoose) { if (hasFeature(file, mask) && isLoose(file, mask) !== resolvedLoose) { setLoose(file, mask, resolvedLoose); - console.warn(`Though the "loose" option was set to "${!resolvedLoose}" in your @babel/preset-env ` + `config, it will not be used for ${name} since the "loose" mode option was set to ` + `"${resolvedLoose}" for ${higherPriorityPluginName}.\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["${name}", { "loose": ${resolvedLoose} }]\n` + `to the "plugins" section of your Babel config.`); + console.warn(`Though the "loose" option was set to "${!resolvedLoose}" in your @babel/preset-env ` + `config, it will not be used for ${name} since the "loose" mode option was set to ` + `"${resolvedLoose}" for ${higherPriorityPluginName}.\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["${name}", { "loose": ${resolvedLoose} }]\n` + `to the "plugins" section of your Babel config.` + "\n\n" + getBabelShowConfigForHint(file)); } } } } +function getBabelShowConfigForHint(file) { + let { + filename + } = file.opts; + if (!filename || filename === "unknown") { + filename = "[name of the input file]"; + } + return `\ +If you already set the same 'loose' mode for these plugins in your config, it's possible that they \ +are enabled multiple times with different options. +You can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \ +configuration: +\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${filename} +See https://babeljs.io/docs/configuration#print-effective-configs for more info.`; +} function hasFeature(file, feature) { return !!(file.get(featuresKey) & feature); } diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map index 00384e7..b9c4076 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/features.js.map @@ -1 +1 @@ -{"version":3,"names":["_decorators","require","FEATURES","exports","Object","freeze","fields","privateMethods","decorators","privateIn","staticBlocks","featuresSameLoose","Map","featuresKey","looseKey","looseLowPriorityKey","canIgnoreLoose","file","feature","get","enableFeature","loose","hasFeature","set","setLoose","resolvedLoose","mask","name","isLoose","Error","higherPriorityPluginName","undefined","console","warn","shouldTransform","path","decoratorPath","publicFieldPath","privateFieldPath","privateMethodPath","staticBlockPath","hasOwnDecorators","node","el","isClassProperty","isClassPrivateProperty","isClassPrivateMethod","isStaticBlock","buildCodeFrameError"],"sources":["../src/features.ts"],"sourcesContent":["import type { File, types as t } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { hasOwnDecorators } from \"./decorators-2018-09.ts\";\n\nexport const FEATURES = Object.freeze({\n //classes: 1 << 0,\n fields: 1 << 1,\n privateMethods: 1 << 2,\n decorators: 1 << 3,\n privateIn: 1 << 4,\n staticBlocks: 1 << 5,\n});\n\nconst featuresSameLoose = new Map([\n [FEATURES.fields, \"@babel/plugin-transform-class-properties\"],\n [FEATURES.privateMethods, \"@babel/plugin-transform-private-methods\"],\n [FEATURES.privateIn, \"@babel/plugin-transform-private-property-in-object\"],\n]);\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-class-features\n// - @babel/plugin-proposal-decorators\n// - node_modules\n// - @babel-plugin-class-features\nconst featuresKey = \"@babel/plugin-class-features/featuresKey\";\nconst looseKey = \"@babel/plugin-class-features/looseKey\";\n\nif (!process.env.BABEL_8_BREAKING) {\n // See https://github.com/babel/babel/issues/11622.\n // Since preset-env sets loose for the fields and private methods plugins, it can\n // cause conflicts with the loose mode set by an explicit plugin in the config.\n // To solve this problem, we ignore preset-env's loose mode if another plugin\n // explicitly sets it\n // The code to handle this logic doesn't check that \"low priority loose\" is always\n // the same. However, it is only set by the preset and not directly by users:\n // unless someone _wants_ to break it, it shouldn't be a problem.\n // eslint-disable-next-line no-var\n var looseLowPriorityKey =\n \"@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var canIgnoreLoose = function (file: File, feature: number) {\n return !!(file.get(looseLowPriorityKey) & feature);\n };\n}\n\nexport function enableFeature(file: File, feature: number, loose: boolean) {\n // We can't blindly enable the feature because, if it was already set,\n // \"loose\" can't be changed, so that\n // @babel/plugin-class-properties { loose: true }\n // @babel/plugin-class-properties { loose: false }\n // is transformed in loose mode.\n // We only enabled the feature if it was previously disabled.\n if (process.env.BABEL_8_BREAKING) {\n if (!hasFeature(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n setLoose(file, feature, loose);\n }\n } else if (!hasFeature(file, feature) || canIgnoreLoose(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n if (\n // @ts-expect-error comparing loose with internal private magic string\n loose ===\n \"#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error\"\n ) {\n setLoose(file, feature, true);\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);\n } else if (\n // @ts-expect-error comparing loose with internal private magic string\n loose ===\n \"#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error\"\n ) {\n setLoose(file, feature, false);\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);\n } else {\n setLoose(file, feature, loose);\n }\n }\n\n let resolvedLoose: boolean | undefined;\n for (const [mask, name] of featuresSameLoose) {\n if (!hasFeature(file, mask)) continue;\n if (!process.env.BABEL_8_BREAKING) {\n if (canIgnoreLoose(file, mask)) continue;\n }\n\n const loose = isLoose(file, mask);\n\n if (resolvedLoose === !loose) {\n throw new Error(\n \"'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, \" +\n \"@babel/plugin-transform-private-methods and \" +\n \"@babel/plugin-transform-private-property-in-object (when they are enabled).\",\n );\n } else {\n resolvedLoose = loose;\n\n if (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var higherPriorityPluginName = name;\n }\n }\n }\n\n if (!process.env.BABEL_8_BREAKING && resolvedLoose !== undefined) {\n for (const [mask, name] of featuresSameLoose) {\n if (hasFeature(file, mask) && isLoose(file, mask) !== resolvedLoose) {\n setLoose(file, mask, resolvedLoose);\n console.warn(\n `Though the \"loose\" option was set to \"${!resolvedLoose}\" in your @babel/preset-env ` +\n `config, it will not be used for ${name} since the \"loose\" mode option was set to ` +\n `\"${resolvedLoose}\" for ${higherPriorityPluginName}.\\nThe \"loose\" option must be the ` +\n `same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods ` +\n `and @babel/plugin-transform-private-property-in-object (when they are enabled): you can ` +\n `silence this warning by explicitly adding\\n` +\n `\\t[\"${name}\", { \"loose\": ${resolvedLoose} }]\\n` +\n `to the \"plugins\" section of your Babel config.`,\n );\n }\n }\n }\n}\n\nfunction hasFeature(file: File, feature: number) {\n return !!(file.get(featuresKey) & feature);\n}\n\nexport function isLoose(file: File, feature: number) {\n return !!(file.get(looseKey) & feature);\n}\n\nfunction setLoose(file: File, feature: number, loose: boolean) {\n if (loose) file.set(looseKey, file.get(looseKey) | feature);\n else file.set(looseKey, file.get(looseKey) & ~feature);\n\n if (!process.env.BABEL_8_BREAKING) {\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) & ~feature);\n }\n}\n\nexport function shouldTransform(path: NodePath, file: File): boolean {\n let decoratorPath: NodePath | null = null;\n let publicFieldPath: NodePath | null = null;\n let privateFieldPath: NodePath | null = null;\n let privateMethodPath: NodePath | null = null;\n let staticBlockPath: NodePath | null = null;\n\n if (hasOwnDecorators(path.node)) {\n decoratorPath = path.get(\"decorators.0\");\n }\n for (const el of path.get(\"body.body\")) {\n if (!decoratorPath && hasOwnDecorators(el.node)) {\n decoratorPath = el.get(\"decorators.0\");\n }\n if (!publicFieldPath && el.isClassProperty()) {\n publicFieldPath = el;\n }\n if (!privateFieldPath && el.isClassPrivateProperty()) {\n privateFieldPath = el;\n }\n // NOTE: path.isClassPrivateMethod() it isn't supported in <7.2.0\n if (!privateMethodPath && el.isClassPrivateMethod?.()) {\n privateMethodPath = el;\n }\n if (!staticBlockPath && el.isStaticBlock?.()) {\n staticBlockPath = el;\n }\n }\n\n if (decoratorPath && privateFieldPath) {\n throw privateFieldPath.buildCodeFrameError(\n \"Private fields in decorated classes are not supported yet.\",\n );\n }\n if (decoratorPath && privateMethodPath) {\n throw privateMethodPath.buildCodeFrameError(\n \"Private methods in decorated classes are not supported yet.\",\n );\n }\n\n if (decoratorPath && !hasFeature(file, FEATURES.decorators)) {\n throw path.buildCodeFrameError(\n \"Decorators are not enabled.\" +\n \"\\nIf you are using \" +\n '[\"@babel/plugin-proposal-decorators\", { \"version\": \"legacy\" }], ' +\n 'make sure it comes *before* \"@babel/plugin-transform-class-properties\" ' +\n \"and enable loose mode, like so:\\n\" +\n '\\t[\"@babel/plugin-proposal-decorators\", { \"version\": \"legacy\" }]\\n' +\n '\\t[\"@babel/plugin-transform-class-properties\", { \"loose\": true }]',\n );\n }\n\n if (privateMethodPath && !hasFeature(file, FEATURES.privateMethods)) {\n throw privateMethodPath.buildCodeFrameError(\n \"Class private methods are not enabled. \" +\n \"Please add `@babel/plugin-transform-private-methods` to your configuration.\",\n );\n }\n\n if (\n (publicFieldPath || privateFieldPath) &&\n !hasFeature(file, FEATURES.fields) &&\n // We want to allow enabling the private-methods plugin even without enabling\n // the class-properties plugin. Class fields will still be compiled in classes\n // that contain private methods.\n // This is already allowed with the other various class features plugins, but\n // it's because they can fallback to a transform separated from this helper.\n !hasFeature(file, FEATURES.privateMethods)\n ) {\n throw path.buildCodeFrameError(\n \"Class fields are not enabled. \" +\n \"Please add `@babel/plugin-transform-class-properties` to your configuration.\",\n );\n }\n\n if (staticBlockPath && !hasFeature(file, FEATURES.staticBlocks)) {\n throw path.buildCodeFrameError(\n \"Static class blocks are not enabled. \" +\n \"Please add `@babel/plugin-transform-class-static-block` to your configuration.\",\n );\n }\n\n if (decoratorPath || privateMethodPath || staticBlockPath) {\n // If one of those feature is used we know that its transform is\n // enabled, otherwise the previous checks throw.\n return true;\n }\n if (\n (publicFieldPath || privateFieldPath) &&\n hasFeature(file, FEATURES.fields)\n ) {\n return true;\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EAEpCC,MAAM,EAAE,CAAC,IAAI,CAAC;EACdC,cAAc,EAAE,CAAC,IAAI,CAAC;EACtBC,UAAU,EAAE,CAAC,IAAI,CAAC;EAClBC,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBC,YAAY,EAAE,CAAC,IAAI;AACrB,CAAC,CAAC;AAEF,MAAMC,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,CAACV,QAAQ,CAACI,MAAM,EAAE,0CAA0C,CAAC,EAC7D,CAACJ,QAAQ,CAACK,cAAc,EAAE,yCAAyC,CAAC,EACpE,CAACL,QAAQ,CAACO,SAAS,EAAE,oDAAoD,CAAC,CAC3E,CAAC;AASF,MAAMI,WAAW,GAAG,0CAA0C;AAC9D,MAAMC,QAAQ,GAAG,uCAAuC;AAErB;EAUjC,IAAIC,mBAAmB,GACrB,6HAA6H;AACjI;AAEmC;EAEjC,IAAIC,cAAc,GAAG,SAAAA,CAAUC,IAAU,EAAEC,OAAe,EAAE;IAC1D,OAAO,CAAC,EAAED,IAAI,CAACE,GAAG,CAACJ,mBAAmB,CAAC,GAAGG,OAAO,CAAC;EACpD,CAAC;AACH;AAEO,SAASE,aAAaA,CAACH,IAAU,EAAEC,OAAe,EAAEG,KAAc,EAAE;EAYlE,IAAI,CAACC,UAAU,CAACL,IAAI,EAAEC,OAAO,CAAC,IAAIF,cAAc,CAACC,IAAI,EAAEC,OAAO,CAAC,EAAE;IACtED,IAAI,CAACM,GAAG,CAACV,WAAW,EAAEI,IAA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B,qBAAqB,GACrB,kEAAkE,GAClE,yEAAyE,GACzE,mCAAmC,GACnC,oEAAoE,GACpE,mEACJ,CAAC;EACH;EAEA,IAAIT,iBAAiB,IAAI,CAACjB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACK,cAAc,CAAC,EAAE;IACnE,MAAMgC,iBAAiB,CAACS,mBAAmB,CACzC,yCAAyC,GACvC,6EACJ,CAAC;EACH;EAEA,IACE,CAACX,eAAe,IAAIC,gBAAgB,KACpC,CAAChB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACI,MAAM,CAAC,IAMlC,CAACgB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACK,cAAc,CAAC,EAC1C;IACA,MAAM4B,IAAI,CAACa,mBAAmB,CAC5B,gCAAgC,GAC9B,8EACJ,CAAC;EACH;EAEA,IAAIR,eAAe,IAAI,CAAClB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACQ,YAAY,CAAC,EAAE;IAC/D,MAAMyB,IAAI,CAACa,mBAAmB,CAC5B,uCAAuC,GACrC,gFACJ,CAAC;EACH;EAEA,IAAIZ,aAAa,IAAIG,iBAAiB,IAAIC,eAAe,EAAE;IAGzD,OAAO,IAAI;EACb;EACA,IACE,CAACH,eAAe,IAAIC,gBAAgB,KACpChB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACI,MAAM,CAAC,EACjC;IACA,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd"} \ No newline at end of file +{"version":3,"names":["_decorators","require","FEATURES","exports","Object","freeze","fields","privateMethods","decorators","privateIn","staticBlocks","featuresSameLoose","Map","featuresKey","looseKey","looseLowPriorityKey","canIgnoreLoose","file","feature","get","enableFeature","loose","hasFeature","set","setLoose","resolvedLoose","mask","name","isLoose","Error","getBabelShowConfigForHint","higherPriorityPluginName","undefined","console","warn","filename","opts","shouldTransform","path","decoratorPath","publicFieldPath","privateFieldPath","privateMethodPath","staticBlockPath","hasOwnDecorators","node","el","isClassProperty","isClassPrivateProperty","isClassPrivateMethod","isStaticBlock","buildCodeFrameError"],"sources":["../src/features.ts"],"sourcesContent":["import type { File, types as t } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport { hasOwnDecorators } from \"./decorators-2018-09.ts\";\n\nexport const FEATURES = Object.freeze({\n //classes: 1 << 0,\n fields: 1 << 1,\n privateMethods: 1 << 2,\n decorators: 1 << 3,\n privateIn: 1 << 4,\n staticBlocks: 1 << 5,\n});\n\nconst featuresSameLoose = new Map([\n [FEATURES.fields, \"@babel/plugin-transform-class-properties\"],\n [FEATURES.privateMethods, \"@babel/plugin-transform-private-methods\"],\n [FEATURES.privateIn, \"@babel/plugin-transform-private-property-in-object\"],\n]);\n\n// We can't use a symbol because this needs to always be the same, even if\n// this package isn't deduped by npm. e.g.\n// - node_modules/\n// - @babel/plugin-class-features\n// - @babel/plugin-proposal-decorators\n// - node_modules\n// - @babel-plugin-class-features\nconst featuresKey = \"@babel/plugin-class-features/featuresKey\";\nconst looseKey = \"@babel/plugin-class-features/looseKey\";\n\nif (!process.env.BABEL_8_BREAKING) {\n // See https://github.com/babel/babel/issues/11622.\n // Since preset-env sets loose for the fields and private methods plugins, it can\n // cause conflicts with the loose mode set by an explicit plugin in the config.\n // To solve this problem, we ignore preset-env's loose mode if another plugin\n // explicitly sets it\n // The code to handle this logic doesn't check that \"low priority loose\" is always\n // the same. However, it is only set by the preset and not directly by users:\n // unless someone _wants_ to break it, it shouldn't be a problem.\n // eslint-disable-next-line no-var\n var looseLowPriorityKey =\n \"@babel/plugin-class-features/looseLowPriorityKey/#__internal__@babel/preset-env__please-overwrite-loose-instead-of-throwing\";\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var canIgnoreLoose = function (file: File, feature: number) {\n return !!(file.get(looseLowPriorityKey) & feature);\n };\n}\n\nexport function enableFeature(file: File, feature: number, loose: boolean) {\n // We can't blindly enable the feature because, if it was already set,\n // \"loose\" can't be changed, so that\n // @babel/plugin-class-properties { loose: true }\n // @babel/plugin-class-properties { loose: false }\n // is transformed in loose mode.\n // We only enabled the feature if it was previously disabled.\n if (process.env.BABEL_8_BREAKING) {\n if (!hasFeature(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n setLoose(file, feature, loose);\n }\n } else if (!hasFeature(file, feature) || canIgnoreLoose(file, feature)) {\n file.set(featuresKey, file.get(featuresKey) | feature);\n if (\n // @ts-expect-error comparing loose with internal private magic string\n loose ===\n \"#__internal__@babel/preset-env__prefer-true-but-false-is-ok-if-it-prevents-an-error\"\n ) {\n setLoose(file, feature, true);\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);\n } else if (\n // @ts-expect-error comparing loose with internal private magic string\n loose ===\n \"#__internal__@babel/preset-env__prefer-false-but-true-is-ok-if-it-prevents-an-error\"\n ) {\n setLoose(file, feature, false);\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) | feature);\n } else {\n setLoose(file, feature, loose);\n }\n }\n\n let resolvedLoose: boolean | undefined;\n for (const [mask, name] of featuresSameLoose) {\n if (!hasFeature(file, mask)) continue;\n if (!process.env.BABEL_8_BREAKING) {\n if (canIgnoreLoose(file, mask)) continue;\n }\n\n const loose = isLoose(file, mask);\n\n if (resolvedLoose === !loose) {\n throw new Error(\n \"'loose' mode configuration must be the same for @babel/plugin-transform-class-properties, \" +\n \"@babel/plugin-transform-private-methods and \" +\n \"@babel/plugin-transform-private-property-in-object (when they are enabled).\" +\n \"\\n\\n\" +\n getBabelShowConfigForHint(file),\n );\n } else {\n resolvedLoose = loose;\n\n if (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var higherPriorityPluginName = name;\n }\n }\n }\n\n if (!process.env.BABEL_8_BREAKING && resolvedLoose !== undefined) {\n for (const [mask, name] of featuresSameLoose) {\n if (hasFeature(file, mask) && isLoose(file, mask) !== resolvedLoose) {\n setLoose(file, mask, resolvedLoose);\n console.warn(\n `Though the \"loose\" option was set to \"${!resolvedLoose}\" in your @babel/preset-env ` +\n `config, it will not be used for ${name} since the \"loose\" mode option was set to ` +\n `\"${resolvedLoose}\" for ${higherPriorityPluginName}.\\nThe \"loose\" option must be the ` +\n `same for @babel/plugin-transform-class-properties, @babel/plugin-transform-private-methods ` +\n `and @babel/plugin-transform-private-property-in-object (when they are enabled): you can ` +\n `silence this warning by explicitly adding\\n` +\n `\\t[\"${name}\", { \"loose\": ${resolvedLoose} }]\\n` +\n `to the \"plugins\" section of your Babel config.` +\n \"\\n\\n\" +\n getBabelShowConfigForHint(file),\n );\n }\n }\n }\n}\n\nfunction getBabelShowConfigForHint(file: File) {\n let { filename } = file.opts;\n if (!filename || filename === \"unknown\") {\n filename = \"[name of the input file]\";\n }\n return `\\\nIf you already set the same 'loose' mode for these plugins in your config, it's possible that they \\\nare enabled multiple times with different options.\nYou can re-run Babel with the BABEL_SHOW_CONFIG_FOR environment variable to show the loaded \\\nconfiguration:\n\\tnpx cross-env BABEL_SHOW_CONFIG_FOR=${filename} \nSee https://babeljs.io/docs/configuration#print-effective-configs for more info.`;\n}\n\nfunction hasFeature(file: File, feature: number) {\n return !!(file.get(featuresKey) & feature);\n}\n\nexport function isLoose(file: File, feature: number) {\n return !!(file.get(looseKey) & feature);\n}\n\nfunction setLoose(file: File, feature: number, loose: boolean) {\n if (loose) file.set(looseKey, file.get(looseKey) | feature);\n else file.set(looseKey, file.get(looseKey) & ~feature);\n\n if (!process.env.BABEL_8_BREAKING) {\n file.set(looseLowPriorityKey, file.get(looseLowPriorityKey) & ~feature);\n }\n}\n\nexport function shouldTransform(path: NodePath, file: File): boolean {\n let decoratorPath: NodePath | null = null;\n let publicFieldPath: NodePath | null = null;\n let privateFieldPath: NodePath | null = null;\n let privateMethodPath: NodePath | null = null;\n let staticBlockPath: NodePath | null = null;\n\n if (hasOwnDecorators(path.node)) {\n decoratorPath = path.get(\"decorators.0\");\n }\n for (const el of path.get(\"body.body\")) {\n if (!decoratorPath && hasOwnDecorators(el.node)) {\n decoratorPath = el.get(\"decorators.0\");\n }\n if (!publicFieldPath && el.isClassProperty()) {\n publicFieldPath = el;\n }\n if (!privateFieldPath && el.isClassPrivateProperty()) {\n privateFieldPath = el;\n }\n // NOTE: path.isClassPrivateMethod() it isn't supported in <7.2.0\n if (!privateMethodPath && el.isClassPrivateMethod?.()) {\n privateMethodPath = el;\n }\n if (!staticBlockPath && el.isStaticBlock?.()) {\n staticBlockPath = el;\n }\n }\n\n if (decoratorPath && privateFieldPath) {\n throw privateFieldPath.buildCodeFrameError(\n \"Private fields in decorated classes are not supported yet.\",\n );\n }\n if (decoratorPath && privateMethodPath) {\n throw privateMethodPath.buildCodeFrameError(\n \"Private methods in decorated classes are not supported yet.\",\n );\n }\n\n if (decoratorPath && !hasFeature(file, FEATURES.decorators)) {\n throw path.buildCodeFrameError(\n \"Decorators are not enabled.\" +\n \"\\nIf you are using \" +\n '[\"@babel/plugin-proposal-decorators\", { \"version\": \"legacy\" }], ' +\n 'make sure it comes *before* \"@babel/plugin-transform-class-properties\" ' +\n \"and enable loose mode, like so:\\n\" +\n '\\t[\"@babel/plugin-proposal-decorators\", { \"version\": \"legacy\" }]\\n' +\n '\\t[\"@babel/plugin-transform-class-properties\", { \"loose\": true }]',\n );\n }\n\n if (privateMethodPath && !hasFeature(file, FEATURES.privateMethods)) {\n throw privateMethodPath.buildCodeFrameError(\n \"Class private methods are not enabled. \" +\n \"Please add `@babel/plugin-transform-private-methods` to your configuration.\",\n );\n }\n\n if (\n (publicFieldPath || privateFieldPath) &&\n !hasFeature(file, FEATURES.fields) &&\n // We want to allow enabling the private-methods plugin even without enabling\n // the class-properties plugin. Class fields will still be compiled in classes\n // that contain private methods.\n // This is already allowed with the other various class features plugins, but\n // it's because they can fallback to a transform separated from this helper.\n !hasFeature(file, FEATURES.privateMethods)\n ) {\n throw path.buildCodeFrameError(\n \"Class fields are not enabled. \" +\n \"Please add `@babel/plugin-transform-class-properties` to your configuration.\",\n );\n }\n\n if (staticBlockPath && !hasFeature(file, FEATURES.staticBlocks)) {\n throw path.buildCodeFrameError(\n \"Static class blocks are not enabled. \" +\n \"Please add `@babel/plugin-transform-class-static-block` to your configuration.\",\n );\n }\n\n if (decoratorPath || privateMethodPath || staticBlockPath) {\n // If one of those feature is used we know that its transform is\n // enabled, otherwise the previous checks throw.\n return true;\n }\n if (\n (publicFieldPath || privateFieldPath) &&\n hasFeature(file, FEATURES.fields)\n ) {\n return true;\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;AAEA,IAAAA,WAAA,GAAAC,OAAA;AAEO,MAAMC,QAAQ,GAAAC,OAAA,CAAAD,QAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EAEpCC,MAAM,EAAE,CAAC,IAAI,CAAC;EACdC,cAAc,EAAE,CAAC,IAAI,CAAC;EACtBC,UAAU,EAAE,CAAC,IAAI,CAAC;EAClBC,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBC,YAAY,EAAE,CAAC,IAAI;AACrB,CAAC,CAAC;AAEF,MAAMC,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAChC,CAACV,QAAQ,CAACI,MAAM,EAAE,0CAA0C,CAAC,EAC7D,CAACJ,QAAQ,CAACK,cAAc,EAAE,yCAAyC,CAAC,EACpE,CAACL,QAAQ,CAACO,SAAS,EAAE,oDAAoD,CAAC,CAC3E,CAAC;AASF,MAAMI,WAAW,GAAG,0CAA0C;AAC9D,MAAMC,QAAQ,GAAG,uCAAuC;AAErB;EAUjC,IAAIC,mBAAmB,GACrB,6HAA6H;AACjI;AAEmC;EAEjC,IAAIC,cAAc,GAAG,SAAAA,CAAUC,IAAU,EAAEC,OAAe,EAAE;IAC1D,OAAO,CAAC,EAAED,IAAI,CAACE,GAAG,CAACJ,mBAAmB,CAAC,GAAGG,OAAO,CAAC;EACpD,CAAC;AACH;AAEO,SAASE,aAAaA,CAACH,IAAU,EAAEC,OAAe,EAAEG,KAAc,EAAE;EAYlE,IAAI,CAACC,UAAU,CAACL,IAAI,EAAEC,OAAO,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ACE,CAACH,eAAe,IAAIC,gBAAgB,KACpCnB,UAAU,CAACL,IAAI,EAAEf,QAAQ,CAACI,MAAM,CAAC,EACjC;IACA,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd"} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js b/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js index 411ff24..6602263 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js @@ -17,23 +17,70 @@ var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure"); var _helperSkipTransparentExpressionWrappers = require("@babel/helper-skip-transparent-expression-wrappers"); var ts = require("./typescript.js"); -function buildPrivateNamesMap(props) { +{ + var newHelpers = file => { + ; + return file.availableHelper("classPrivateFieldGet2"); + }; +} +function buildPrivateNamesMap(className, privateFieldsAsSymbolsOrProperties, props, file) { const privateNamesMap = new Map(); + let classBrandId; for (const prop of props) { if (prop.isPrivate()) { const { name } = prop.node.key.id; - const update = privateNamesMap.has(name) ? privateNamesMap.get(name) : { - id: prop.scope.generateUidIdentifier(name), - static: prop.node.static, - method: !prop.isProperty() - }; + let update = privateNamesMap.get(name); + if (!update) { + const isMethod = !prop.isProperty(); + const isStatic = prop.node.static; + let initAdded = false; + let id; + if (!privateFieldsAsSymbolsOrProperties && newHelpers(file) && isMethod && !isStatic) { + var _classBrandId; + initAdded = !!classBrandId; + (_classBrandId = classBrandId) != null ? _classBrandId : classBrandId = prop.scope.generateUidIdentifier(`${className}_brand`); + id = classBrandId; + } else { + id = prop.scope.generateUidIdentifier(name); + } + update = { + id, + static: isStatic, + method: isMethod, + initAdded + }; + privateNamesMap.set(name, update); + } if (prop.isClassPrivateMethod()) { if (prop.node.kind === "get") { - update.getId = prop.scope.generateUidIdentifier(`get_${name}`); + const { + body + } = prop.node.body; + let $; + if (body.length === 1 && _core.types.isReturnStatement($ = body[0]) && _core.types.isCallExpression($ = $.argument) && $.arguments.length === 1 && _core.types.isThisExpression($.arguments[0]) && _core.types.isIdentifier($ = $.callee)) { + update.getId = _core.types.cloneNode($); + update.getterDeclared = true; + } else { + update.getId = prop.scope.generateUidIdentifier(`get_${name}`); + } } else if (prop.node.kind === "set") { - update.setId = prop.scope.generateUidIdentifier(`set_${name}`); + const { + params + } = prop.node; + const { + body + } = prop.node.body; + let $; + if (body.length === 1 && _core.types.isExpressionStatement($ = body[0]) && _core.types.isCallExpression($ = $.expression) && $.arguments.length === 2 && _core.types.isThisExpression($.arguments[0]) && _core.types.isIdentifier($.arguments[1], { + name: params[0].name + }) && _core.types.isIdentifier($ = $.callee)) { + update.setId = _core.types.cloneNode($); + update.setterDeclared = true; + } else { + update.setId = prop.scope.generateUidIdentifier(`set_${name}`); + } } else if (prop.node.kind === "method") { update.methodId = prop.scope.generateUidIdentifier(name); } @@ -45,6 +92,7 @@ } function buildPrivateNamesNodes(privateNamesMap, privateFieldsAsProperties, privateFieldsAsSymbols, state) { const initNodes = []; + const injectedIds = new Set(); for (const [name, value] of privateNamesMap) { const { static: isStatic, @@ -52,7 +100,7 @@ getId, setId } = value; - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; const id = _core.types.cloneNode(value.id); let init; if (privateFieldsAsProperties) { @@ -60,10 +108,14 @@ } else if (privateFieldsAsSymbols) { init = _core.types.callExpression(_core.types.identifier("Symbol"), [_core.types.stringLiteral(name)]); } else if (!isStatic) { - init = _core.types.newExpression(_core.types.identifier(!isMethod || isAccessor ? "WeakMap" : "WeakSet"), []); + if (injectedIds.has(id.name)) continue; + injectedIds.add(id.name); + init = _core.types.newExpression(_core.types.identifier(isMethod && (!isGetterOrSetter || newHelpers(state)) ? "WeakSet" : "WeakMap"), []); } if (init) { - (0, _helperAnnotateAsPure.default)(init); + if (!privateFieldsAsSymbols) { + (0, _helperAnnotateAsPure.default)(init); + } initNodes.push(_core.template.statement.ast`var ${id} = ${init}`); } } @@ -181,6 +233,20 @@ path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${buildCheckInRHS(right, file)})`); } }); +function readOnlyError(file, name) { + return _core.types.callExpression(file.addHelper("readOnlyError"), [_core.types.stringLiteral(`#${name}`)]); +} +function writeOnlyError(file, name) { + if (!file.availableHelper("writeOnlyError")) { + console.warn(`@babel/helpers is outdated, update it to silence this warning.`); + return _core.types.buildUndefinedNode(); + } + return _core.types.callExpression(file.addHelper("writeOnlyError"), [_core.types.stringLiteral(`#${name}`)]); +} +function buildStaticPrivateFieldAccess(expr, noUninitializedPrivateFieldAccess) { + if (noUninitializedPrivateFieldAccess) return expr; + return _core.types.memberExpression(expr, _core.types.identifier("_")); +} const privateNameHandlerSpec = { memoise(member, count) { const { @@ -209,7 +275,8 @@ classRef, privateNamesMap, file, - innerBinding + innerBinding, + noUninitializedPrivateFieldAccess } = this; const { name @@ -222,23 +289,52 @@ getId, setId } = privateNamesMap.get(name); - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; if (isStatic) { - const helperName = isMethod && !isAccessor ? "classStaticPrivateMethodGet" : "classStaticPrivateFieldSpecGet"; unshadow(classRef.name, member.scope, innerBinding); - return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id)]); + if (!newHelpers(file)) { + const helperName = isMethod && !isGetterOrSetter ? "classStaticPrivateMethodGet" : "classStaticPrivateFieldSpecGet"; + return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id)]); + } + const receiver = this.receiver(member); + const skipCheck = _core.types.isIdentifier(receiver) && receiver.name === classRef.name; + if (!isMethod) { + if (skipCheck) { + return buildStaticPrivateFieldAccess(_core.types.cloneNode(id), noUninitializedPrivateFieldAccess); + } + return buildStaticPrivateFieldAccess(_core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, _core.types.cloneNode(id)]), noUninitializedPrivateFieldAccess); + } + if (getId) { + if (skipCheck) { + return _core.types.callExpression(_core.types.cloneNode(getId), [receiver]); + } + return _core.types.callExpression(file.addHelper("classPrivateGetter"), [_core.types.cloneNode(classRef), receiver, _core.types.cloneNode(getId)]); + } + if (setId) { + const err = _core.types.buildUndefinedNode(); + if (skipCheck) return err; + return _core.types.sequenceExpression([_core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver]), err]); + } + if (skipCheck) return _core.types.cloneNode(id); + return _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, _core.types.cloneNode(id)]); } if (isMethod) { - if (isAccessor) { - if (!getId && setId) { - if (file.availableHelper("writeOnlyError")) { - return _core.types.sequenceExpression([this.receiver(member), _core.types.callExpression(file.addHelper("writeOnlyError"), [_core.types.stringLiteral(`#${name}`)])]); - } - console.warn(`@babel/helpers is outdated, update it to silence this warning.`); + if (isGetterOrSetter) { + if (!getId) { + return _core.types.sequenceExpression([this.receiver(member), writeOnlyError(file, name)]); } - return _core.types.callExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), _core.types.cloneNode(id)]); + if (!newHelpers(file)) { + return _core.types.callExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), _core.types.cloneNode(id)]); + } + return _core.types.callExpression(file.addHelper("classPrivateGetter"), [_core.types.cloneNode(id), this.receiver(member), _core.types.cloneNode(getId)]); } - return _core.types.callExpression(file.addHelper("classPrivateMethodGet"), [this.receiver(member), _core.types.cloneNode(id), _core.types.cloneNode(methodId)]); + if (!newHelpers(file)) { + return _core.types.callExpression(file.addHelper("classPrivateMethodGet"), [this.receiver(member), _core.types.cloneNode(id), _core.types.cloneNode(methodId)]); + } + return _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(id), this.receiver(member), _core.types.cloneNode(methodId)]); + } + if (newHelpers(file)) { + return _core.types.callExpression(file.addHelper("classPrivateFieldGet2"), [_core.types.cloneNode(id), this.receiver(member)]); } return _core.types.callExpression(file.addHelper("classPrivateFieldGet"), [this.receiver(member), _core.types.cloneNode(id)]); }, @@ -250,7 +346,8 @@ const { classRef, privateNamesMap, - file + file, + noUninitializedPrivateFieldAccess } = this; const { name @@ -262,16 +359,38 @@ setId, getId } = privateNamesMap.get(name); - const isAccessor = getId || setId; + const isGetterOrSetter = getId || setId; if (isStatic) { - const helperName = isMethod && !isAccessor ? "classStaticPrivateMethodSet" : "classStaticPrivateFieldSpecSet"; - return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id), value]); + if (!newHelpers(file)) { + const helperName = isMethod && !isGetterOrSetter ? "classStaticPrivateMethodSet" : "classStaticPrivateFieldSpecSet"; + return _core.types.callExpression(file.addHelper(helperName), [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id), value]); + } + const receiver = this.receiver(member); + const skipCheck = _core.types.isIdentifier(receiver) && receiver.name === classRef.name; + if (isMethod && !setId) { + const err = readOnlyError(file, name); + if (skipCheck) return _core.types.sequenceExpression([value, err]); + return _core.types.sequenceExpression([value, _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver]), readOnlyError(file, name)]); + } + if (setId) { + if (skipCheck) { + return _core.types.callExpression(_core.types.cloneNode(setId), [receiver, value]); + } + return _core.types.callExpression(file.addHelper("classPrivateSetter"), [_core.types.cloneNode(classRef), _core.types.cloneNode(setId), receiver, value]); + } + return _core.types.assignmentExpression("=", buildStaticPrivateFieldAccess(_core.types.cloneNode(id), noUninitializedPrivateFieldAccess), skipCheck ? value : _core.types.callExpression(file.addHelper("assertClassBrand"), [_core.types.cloneNode(classRef), receiver, value])); } if (isMethod) { if (setId) { - return _core.types.callExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), _core.types.cloneNode(id), value]); + if (!newHelpers(file)) { + return _core.types.callExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), _core.types.cloneNode(id), value]); + } + return _core.types.callExpression(file.addHelper("classPrivateSetter"), [_core.types.cloneNode(id), _core.types.cloneNode(setId), this.receiver(member), value]); } - return _core.types.sequenceExpression([this.receiver(member), value, _core.types.callExpression(file.addHelper("readOnlyError"), [_core.types.stringLiteral(`#${name}`)])]); + return _core.types.sequenceExpression([this.receiver(member), value, readOnlyError(file, name)]); + } + if (newHelpers(file)) { + return _core.types.callExpression(file.addHelper("classPrivateFieldSet2"), [_core.types.cloneNode(id), this.receiver(member), value]); } return _core.types.callExpression(file.addHelper("classPrivateFieldSet"), [this.receiver(member), _core.types.cloneNode(id), value]); }, @@ -279,24 +398,56 @@ const { classRef, privateNamesMap, - file + file, + noUninitializedPrivateFieldAccess } = this; const { name } = member.node.property.id; const { id, - static: isStatic + static: isStatic, + method: isMethod, + setId } = privateNamesMap.get(name); - if (isStatic) { - try { - var helper = file.addHelper("classStaticPrivateFieldDestructureSet"); - } catch (_unused) { - 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."); + if (!newHelpers(file)) { + if (isStatic) { + try { + var helper = file.addHelper("classStaticPrivateFieldDestructureSet"); + } catch (_unused) { + 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 _core.types.memberExpression(_core.types.callExpression(helper, [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id)]), _core.types.identifier("value")); } - return _core.types.memberExpression(_core.types.callExpression(helper, [this.receiver(member), _core.types.cloneNode(classRef), _core.types.cloneNode(id)]), _core.types.identifier("value")); + return _core.types.memberExpression(_core.types.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [this.receiver(member), _core.types.cloneNode(id)]), _core.types.identifier("value")); } - return _core.types.memberExpression(_core.types.callExpression(file.addHelper("classPrivateFieldDestructureSet"), [this.receiver(member), _core.types.cloneNode(id)]), _core.types.identifier("value")); + if (isMethod && !setId) { + return _core.types.memberExpression(_core.types.sequenceExpression([member.node.object, readOnlyError(file, name)]), _core.types.identifier("_")); + } + if (isStatic && !isMethod) { + const getCall = this.get(member); + if (!noUninitializedPrivateFieldAccess || !_core.types.isCallExpression(getCall)) { + return getCall; + } + const ref = getCall.arguments.pop(); + getCall.arguments.push(_core.template.expression.ast`(_) => ${ref} = _`); + return _core.types.memberExpression(_core.types.callExpression(file.addHelper("toSetter"), [getCall]), _core.types.identifier("_")); + } + const setCall = this.set(member, _core.types.identifier("_")); + if (!_core.types.isCallExpression(setCall) || !_core.types.isIdentifier(setCall.arguments[setCall.arguments.length - 1], { + name: "_" + })) { + throw member.buildCodeFrameError("Internal Babel error while compiling this code. This is a Babel bug. " + "Please report it at https://github.com/babel/babel/issues."); + } + let args; + if (_core.types.isMemberExpression(setCall.callee, { + computed: false + }) && _core.types.isIdentifier(setCall.callee.property) && setCall.callee.property.name === "call") { + args = [setCall.callee.object, _core.types.arrayExpression(setCall.arguments.slice(1, -1)), setCall.arguments[0]]; + } else { + args = [setCall.callee, _core.types.arrayExpression(setCall.arguments.slice(0, -1))]; + } + return _core.types.memberExpression(_core.types.callExpression(file.addHelper("toSetter"), args), _core.types.identifier("_")); }, call(member, args) { this.memoise(member, 1); @@ -352,6 +503,7 @@ }; function transformPrivateNamesUsage(ref, path, privateNamesMap, { privateFieldsAsProperties, + noUninitializedPrivateFieldAccess, noDocumentAll, innerBinding }, state) { @@ -364,6 +516,7 @@ file: state }, handler, { noDocumentAll, + noUninitializedPrivateFieldAccess, innerBinding })); body.traverse(privateInVisitor, { @@ -404,48 +557,50 @@ } } const helper = state.addHelper("classPrivateFieldInitSpec"); - return inheritPropComments(_core.template.statement.ast`${helper}( - ${_core.types.thisExpression()}, - ${_core.types.cloneNode(id)}, - { - writable: true, - value: ${value} - }, - )`, prop); + return inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(helper, [_core.types.thisExpression(), _core.types.cloneNode(id), newHelpers(state) ? value : _core.template.expression.ast`{ writable: true, value: ${value} }`])), prop); } -function buildPrivateStaticFieldInitSpec(prop, privateNamesMap) { +function buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedPrivateFieldAccess) { const privateName = privateNamesMap.get(prop.node.key.id.name); - const { - id, - getId, - setId, - initAdded - } = privateName; - const isAccessor = getId || setId; - if (!prop.isProperty() && (initAdded || !isAccessor)) return; - if (isAccessor) { - privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { - initAdded: true - })); + const value = noUninitializedPrivateFieldAccess ? prop.node.value : _core.template.expression.ast`{ + _: ${prop.node.value || _core.types.buildUndefinedNode()} + }`; + return inheritPropComments(_core.types.variableDeclaration("var", [_core.types.variableDeclarator(_core.types.cloneNode(privateName.id), value)]), prop); +} +{ + var buildPrivateStaticFieldInitSpecOld = function (prop, privateNamesMap) { + const privateName = privateNamesMap.get(prop.node.key.id.name); + const { + id, + getId, + setId, + initAdded + } = privateName; + const isGetterOrSetter = getId || setId; + if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return; + if (isGetterOrSetter) { + privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { + initAdded: true + })); + return inheritPropComments(_core.template.statement.ast` + var ${_core.types.cloneNode(id)} = { + // configurable is false by default + // enumerable is false by default + // writable is false by default + get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, + set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} + } + `, prop); + } + const value = prop.node.value || prop.scope.buildUndefinedNode(); return inheritPropComments(_core.template.statement.ast` var ${_core.types.cloneNode(id)} = { // configurable is false by default // enumerable is false by default - // writable is false by default - get: ${getId ? getId.name : prop.scope.buildUndefinedNode()}, - set: ${setId ? setId.name : prop.scope.buildUndefinedNode()} - } + writable: true, + value: ${value} + }; `, prop); - } - const value = prop.node.value || prop.scope.buildUndefinedNode(); - return inheritPropComments(_core.template.statement.ast` - var ${_core.types.cloneNode(id)} = { - // configurable is false by default - // enumerable is false by default - writable: true, - value: ${value} - }; - `, prop); + }; } function buildPrivateMethodInitLoose(ref, prop, privateNamesMap) { const privateName = privateNamesMap.get(prop.node.key.id.name); @@ -467,8 +622,8 @@ }); `, prop); } - const isAccessor = getId || setId; - if (isAccessor) { + const isGetterOrSetter = getId || setId; + if (isGetterOrSetter) { privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { initAdded: true })); @@ -485,15 +640,12 @@ } function buildPrivateInstanceMethodInitSpec(ref, prop, privateNamesMap, state) { const privateName = privateNamesMap.get(prop.node.key.id.name); - const { - getId, - setId, - initAdded - } = privateName; - if (initAdded) return; - const isAccessor = getId || setId; - if (isAccessor) { - return buildPrivateAccessorInitialization(ref, prop, privateNamesMap, state); + if (privateName.initAdded) return; + if (!newHelpers(state)) { + const isGetterOrSetter = privateName.getId || privateName.setId; + if (isGetterOrSetter) { + return buildPrivateAccessorInitialization(ref, prop, privateNamesMap, state); + } } return buildPrivateInstanceMethodInitialization(ref, prop, privateNamesMap, state); } @@ -569,8 +721,8 @@ initAdded } = privateName; if (initAdded) return; - const isAccessor = getId || setId; - if (isAccessor) { + const isGetterOrSetter = getId || setId; + if (isGetterOrSetter) { privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { initAdded: true })); @@ -593,7 +745,7 @@ }); `, prop); } -function buildPrivateMethodDeclaration(prop, privateNamesMap, privateFieldsAsProperties = false) { +function buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties = false) { const privateName = privateNamesMap.get(prop.node.key.id.name); const { id, @@ -610,25 +762,58 @@ generator, async } = prop.node; - const isGetter = getId && !getterDeclared && params.length === 0; - const isSetter = setId && !setterDeclared && params.length > 0; + const isGetter = getId && params.length === 0; + const isSetter = setId && params.length > 0; + if (isGetter && getterDeclared || isSetter && setterDeclared) { + privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { + initAdded: true + })); + return null; + } + if (newHelpers(file) && (isGetter || isSetter) && !privateFieldsAsSymbolsOrProperties) { + const scope = prop.get("body").scope; + const thisArg = scope.generateUidIdentifier("this"); + const state = { + thisRef: thisArg, + argumentsPath: [] + }; + prop.traverse(thisContextVisitor, state); + if (state.argumentsPath.length) { + const argumentsId = scope.generateUidIdentifier("arguments"); + scope.push({ + id: argumentsId, + init: _core.template.expression.ast`[].slice.call(arguments, 1)` + }); + for (const path of state.argumentsPath) { + path.replaceWith(_core.types.cloneNode(argumentsId)); + } + } + params.unshift(_core.types.cloneNode(thisArg)); + } let declId = methodId; if (isGetter) { privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { - getterDeclared: true + getterDeclared: true, + initAdded: true })); declId = getId; } else if (isSetter) { privateNamesMap.set(prop.node.key.id.name, Object.assign({}, privateName, { - setterDeclared: true + setterDeclared: true, + initAdded: true })); declId = setId; - } else if (isStatic && !privateFieldsAsProperties) { + } else if (isStatic && !privateFieldsAsSymbolsOrProperties) { declId = id; } return inheritPropComments(_core.types.functionDeclaration(_core.types.cloneNode(declId), params, body, generator, async), prop); } const thisContextVisitor = _core.traverse.visitors.merge([{ + Identifier(path, state) { + if (state.argumentsPath && path.node.name === "arguments") { + state.argumentsPath.push(path); + } + }, UnaryExpression(path) { const { node @@ -642,7 +827,7 @@ }, ThisExpression(path, state) { state.needsClassRef = true; - path.replaceWith(_core.types.cloneNode(state.classRef)); + path.replaceWith(_core.types.cloneNode(state.thisRef)); }, MetaProperty(path) { const { @@ -658,21 +843,21 @@ ReferencedIdentifier(path, state) { if (path.scope.bindingIdentifierEquals(path.node.name, state.innerBinding)) { state.needsClassRef = true; - path.node.name = state.classRef.name; + path.node.name = state.thisRef.name; } } }; function replaceThisContext(path, ref, innerBindingRef) { - var _state$classRef; + var _state$thisRef; const state = { - classRef: ref, + thisRef: ref, needsClassRef: false, innerBinding: innerBindingRef }; if (!path.isMethod()) { path.traverse(thisContextVisitor, state); } - if (innerBindingRef != null && (_state$classRef = state.classRef) != null && _state$classRef.name && state.classRef.name !== innerBindingRef.name) { + if (innerBindingRef != null && (_state$thisRef = state.thisRef) != null && _state$thisRef.name && state.thisRef.name !== innerBindingRef.name) { path.traverse(innerReferencesVisitor, state); } return state.needsClassRef; @@ -694,7 +879,7 @@ _core.types.inheritInnerComments(node, prop.node); return node; } -function buildFieldsInitNodes(ref, superRef, props, privateNamesMap, file, setPublicClassFields, privateFieldsAsProperties, constantSuper, innerBindingRef) { +function buildFieldsInitNodes(ref, superRef, props, privateNamesMap, file, setPublicClassFields, privateFieldsAsSymbolsOrProperties, noUninitializedPrivateFieldAccess, constantSuper, innerBindingRef) { var _ref, _ref2; let classRefFlags = 0; let injectSuperRef; @@ -753,11 +938,15 @@ } break; } - case isStatic && isPrivate && isField && privateFieldsAsProperties: + case isStatic && isPrivate && isField && privateFieldsAsSymbolsOrProperties: staticNodes.push(buildPrivateFieldInitLoose(_core.types.cloneNode(ref), prop, privateNamesMap)); break; - case isStatic && isPrivate && isField && !privateFieldsAsProperties: - staticNodes.push(buildPrivateStaticFieldInitSpec(prop, privateNamesMap)); + case isStatic && isPrivate && isField && !privateFieldsAsSymbolsOrProperties: + if (!newHelpers(file)) { + staticNodes.push(buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap)); + } else { + staticNodes.push(buildPrivateStaticFieldInitSpec(prop, privateNamesMap, noUninitializedPrivateFieldAccess)); + } break; case isStatic && isPublic && isField && setPublicClassFields: if (!isNameOrLength(prop.node)) { @@ -767,27 +956,29 @@ case isStatic && isPublic && isField && !setPublicClassFields: staticNodes.push(buildPublicFieldInitSpec(_core.types.cloneNode(ref), prop, file)); break; - case isInstance && isPrivate && isField && privateFieldsAsProperties: + case isInstance && isPrivate && isField && privateFieldsAsSymbolsOrProperties: instanceNodes.push(buildPrivateFieldInitLoose(_core.types.thisExpression(), prop, privateNamesMap)); break; - case isInstance && isPrivate && isField && !privateFieldsAsProperties: + case isInstance && isPrivate && isField && !privateFieldsAsSymbolsOrProperties: instanceNodes.push(buildPrivateInstanceFieldInitSpec(_core.types.thisExpression(), prop, privateNamesMap, file)); break; - case isInstance && isPrivate && isMethod && privateFieldsAsProperties: + case isInstance && isPrivate && isMethod && privateFieldsAsSymbolsOrProperties: instanceNodes.unshift(buildPrivateMethodInitLoose(_core.types.thisExpression(), prop, privateNamesMap)); - pureStaticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, privateFieldsAsProperties)); + pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties)); break; - case isInstance && isPrivate && isMethod && !privateFieldsAsProperties: + case isInstance && isPrivate && isMethod && !privateFieldsAsSymbolsOrProperties: instanceNodes.unshift(buildPrivateInstanceMethodInitSpec(_core.types.thisExpression(), prop, privateNamesMap, file)); - pureStaticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, privateFieldsAsProperties)); + pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties)); break; - case isStatic && isPrivate && isMethod && !privateFieldsAsProperties: - staticNodes.unshift(buildPrivateStaticFieldInitSpec(prop, privateNamesMap)); - pureStaticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, privateFieldsAsProperties)); + case isStatic && isPrivate && isMethod && !privateFieldsAsSymbolsOrProperties: + if (!newHelpers(file)) { + staticNodes.unshift(buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap)); + } + pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties)); break; - case isStatic && isPrivate && isMethod && privateFieldsAsProperties: + case isStatic && isPrivate && isMethod && privateFieldsAsSymbolsOrProperties: staticNodes.unshift(buildPrivateStaticMethodInitLoose(_core.types.cloneNode(ref), prop, file, privateNamesMap)); - pureStaticNodes.push(buildPrivateMethodDeclaration(prop, privateNamesMap, privateFieldsAsProperties)); + pureStaticNodes.push(buildPrivateMethodDeclaration(file, prop, privateNamesMap, privateFieldsAsSymbolsOrProperties)); break; case isInstance && isPublic && isField && setPublicClassFields: instanceNodes.push(buildPublicFieldInitLoose(_core.types.thisExpression(), prop)); diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map index 0612386..e36d463 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/fields.js.map @@ -1 +1 @@ -{"version":3,"names":["_core","require","_helperReplaceSupers","_helperEnvironmentVisitor","_helperMemberExpressionToFunctions","_helperOptimiseCallExpression","_helperAnnotateAsPure","_helperSkipTransparentExpressionWrappers","ts","buildPrivateNamesMap","props","privateNamesMap","Map","prop","isPrivate","name","node","key","id","update","has","get","scope","generateUidIdentifier","static","method","isProperty","isClassPrivateMethod","kind","getId","setId","methodId","set","buildPrivateNamesNodes","privateFieldsAsProperties","privateFieldsAsSymbols","state","initNodes","value","isStatic","isMethod","isAccessor","t","cloneNode","init","callExpression","addHelper","stringLiteral","identifier","newExpression","annotateAsPure","push","template","statement","ast","privateNameVisitorFactory","visitor","nestedVisitor","traverse","visitors","merge","Object","assign","environmentVisitor","privateNameVisitor","Class","path","body","visiblePrivateNames","redeclared","delete","length","skipKey","PrivateName","noDocumentAll","parentPath","isMemberExpression","property","isOptionalMemberExpression","includes","handle","unshadow","innerBinding","_scope","hasBinding","bindingIdentifierEquals","rename","parent","buildCheckInRHS","rhs","file","inRHSIsObject","availableHelper","privateInVisitor","BinaryExpression","operator","left","right","isPrivateName","classRef","replaceWith","expression","privateNameHandlerSpec","memoise","member","count","object","memo","maybeGenerateMemoised","memoiser","receiver","helperName","sequenceExpression","console","warn","boundGet","memberExpression","destructureSet","helper","_unused","Error","call","args","optimiseCall","optionalCall","privateNameHandlerLoose","BASE","REF","PROP","simpleSet","optionalCallExpression","transformPrivateNamesUsage","ref","size","handler","memberExpressionToFunctions","buildPrivateFieldInitLoose","buildUndefinedNode","inheritPropComments","buildPrivateInstanceFieldInitSpec","thisExpression","buildPrivateStaticFieldInitSpec","privateName","initAdded","buildPrivateMethodInitLoose","buildPrivateInstanceMethodInitSpec","buildPrivateAccessorInitialization","buildPrivateInstanceMethodInitialization","buildPublicFieldInitLoose","computed","expressionStatement","assignmentExpression","isLiteral","buildPublicFieldInitSpec","buildPrivateStaticMethodInitLoose","buildPrivateMethodDeclaration","getterDeclared","setterDeclared","params","generator","async","isGetter","isSetter","declId","functionDeclaration","thisContextVisitor","UnaryExpression","argument","skipTransparentExprWrapperNodes","isThisExpression","booleanLiteral","ThisExpression","needsClassRef","MetaProperty","meta","innerReferencesVisitor","ReferencedIdentifier","replaceThisContext","innerBindingRef","_state$classRef","isNameOrLength","type","inheritLeadingComments","inheritInnerComments","buildFieldsInitNodes","superRef","setPublicClassFields","constantSuper","_ref","_ref2","classRefFlags","injectSuperRef","staticNodes","instanceNodes","lastInstanceNodeReturnsThis","pureStaticNodes","classBindingNode","getSuperRef","isIdentifier","_injectSuperRef","generateUidIdentifierBasedOnNode","classRefForInnerBinding","isClassProperty","assertFieldTransformed","isStaticBlock","isInstance","isPublic","isField","ReplaceSupers","methodPath","refToPreserve","getObjectRef","replace","replaced","blockBody","isExpressionStatement","inheritsComments","unshift","filter","Boolean","wrapClass","leadingComments","remove","superClass","isClassExpression"],"sources":["../src/fields.ts"],"sourcesContent":["import { template, traverse, types as t } from \"@babel/core\";\nimport type { File } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/traverse\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport environmentVisitor from \"@babel/helper-environment-visitor\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport type {\n Handler,\n HandlerState,\n} from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport { skipTransparentExprWrapperNodes } from \"@babel/helper-skip-transparent-expression-wrappers\";\n\nimport * as ts from \"./typescript.ts\";\n\ninterface PrivateNameMetadata {\n id: t.Identifier;\n static: boolean;\n method: boolean;\n getId?: t.Identifier;\n setId?: t.Identifier;\n methodId?: t.Identifier;\n initAdded?: boolean;\n getterDeclared?: boolean;\n setterDeclared?: boolean;\n}\n\ntype PrivateNamesMapGeneric = Map;\n\ntype PrivateNamesMap = PrivateNamesMapGeneric;\n\nexport function buildPrivateNamesMap(props: PropPath[]) {\n const privateNamesMap: PrivateNamesMap = new Map();\n for (const prop of props) {\n if (prop.isPrivate()) {\n const { name } = prop.node.key.id;\n const update: PrivateNameMetadata = privateNamesMap.has(name)\n ? privateNamesMap.get(name)\n : {\n id: prop.scope.generateUidIdentifier(name),\n static: prop.node.static,\n method: !prop.isProperty(),\n };\n if (prop.isClassPrivateMethod()) {\n if (prop.node.kind === \"get\") {\n update.getId = prop.scope.generateUidIdentifier(`get_${name}`);\n } else if (prop.node.kind === \"set\") {\n update.setId = prop.scope.generateUidIdentifier(`set_${name}`);\n } else if (prop.node.kind === \"method\") {\n update.methodId = prop.scope.generateUidIdentifier(name);\n }\n }\n privateNamesMap.set(name, update);\n }\n }\n return privateNamesMap;\n}\n\nexport function buildPrivateNamesNodes(\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsProperties: boolean,\n privateFieldsAsSymbols: boolean,\n state: File,\n) {\n const initNodes: t.Statement[] = [];\n\n for (const [name, value] of privateNamesMap) {\n // - When the privateFieldsAsProperties assumption is enabled,\n // both static and instance fields are transpiled using a\n // secret non-enumerable property. Hence, we also need to generate that\n // key (using the classPrivateFieldLooseKey helper).\n // - When the privateFieldsAsSymbols assumption is enabled,\n // both static and instance fields are transpiled using a\n // unique Symbol to define a non-enumerable property.\n // - In spec mode, only instance fields need a \"private name\" initializer\n // because static fields are directly assigned to a variable in the\n // buildPrivateStaticFieldInitSpec function.\n const { static: isStatic, method: isMethod, getId, setId } = value;\n const isAccessor = getId || setId;\n const id = t.cloneNode(value.id);\n\n let init: t.Expression;\n\n if (privateFieldsAsProperties) {\n init = t.callExpression(state.addHelper(\"classPrivateFieldLooseKey\"), [\n t.stringLiteral(name),\n ]);\n } else if (privateFieldsAsSymbols) {\n init = t.callExpression(t.identifier(\"Symbol\"), [t.stringLiteral(name)]);\n } else if (!isStatic) {\n init = t.newExpression(\n t.identifier(!isMethod || isAccessor ? \"WeakMap\" : \"WeakSet\"),\n [],\n );\n }\n\n if (init) {\n annotateAsPure(init);\n initNodes.push(template.statement.ast`var ${id} = ${init}`);\n }\n }\n\n return initNodes;\n}\n\nexport interface PrivateNameVisitorState {\n privateNamesMap: PrivateNamesMapGeneric;\n redeclared?: string[];\n}\n\n// Traverses the class scope, handling private name references. If an inner\n// class redeclares the same private name, it will hand off traversal to the\n// restricted visitor (which doesn't traverse the inner class's inner scope).\nexport function privateNameVisitorFactory(\n visitor: Visitor & S>,\n) {\n // Traverses the outer portion of a class, without touching the class's inner\n // scope, for private names.\n const nestedVisitor = traverse.visitors.merge([\n {\n ...visitor,\n },\n environmentVisitor,\n ]);\n\n // @ts-expect-error: TS2590: Expression produces a union type that is too complex to represent.\n const privateNameVisitor: Visitor<\n PrivateNameVisitorState & S\n > = {\n ...visitor,\n\n Class(path) {\n const { privateNamesMap } = this;\n const body = path.get(\"body.body\");\n\n const visiblePrivateNames = new Map(privateNamesMap);\n const redeclared = [];\n for (const prop of body) {\n if (!prop.isPrivate()) continue;\n const { name } = prop.node.key.id;\n visiblePrivateNames.delete(name);\n redeclared.push(name);\n }\n\n // If the class doesn't redeclare any private fields, we can continue with\n // our overall traversal.\n if (!redeclared.length) {\n return;\n }\n\n // This class redeclares some private field. We need to process the outer\n // environment with access to all the outer privates, then we can process\n // the inner environment with only the still-visible outer privates.\n path.get(\"body\").traverse(nestedVisitor, {\n ...this,\n redeclared,\n });\n path.traverse(privateNameVisitor, {\n ...this,\n privateNamesMap: visiblePrivateNames,\n });\n\n // We'll eventually hit this class node again with the overall Class\n // Features visitor, which'll process the redeclared privates.\n path.skipKey(\"body\");\n },\n };\n\n return privateNameVisitor;\n}\n\ninterface PrivateNameState {\n privateNamesMap: PrivateNamesMap;\n classRef: t.Identifier;\n file: File;\n noDocumentAll: boolean;\n innerBinding?: t.Identifier;\n}\n\nconst privateNameVisitor = privateNameVisitorFactory<\n HandlerState & PrivateNameState,\n PrivateNameMetadata\n>({\n PrivateName(path, { noDocumentAll }) {\n const { privateNamesMap, redeclared } = this;\n const { node, parentPath } = path;\n\n if (\n !parentPath.isMemberExpression({ property: node }) &&\n !parentPath.isOptionalMemberExpression({ property: node })\n ) {\n return;\n }\n const { name } = node.id;\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n this.handle(parentPath, noDocumentAll);\n },\n});\n\n// rename all bindings that shadows innerBinding\nfunction unshadow(\n name: string,\n scope: Scope,\n innerBinding: t.Identifier | undefined,\n) {\n // in some cases, scope.getBinding(name) === undefined\n // so we check hasBinding to avoid keeping looping\n // see: https://github.com/babel/babel/pull/13656#discussion_r686030715\n while (\n scope?.hasBinding(name) &&\n !scope.bindingIdentifierEquals(name, innerBinding)\n ) {\n scope.rename(name);\n scope = scope.parent;\n }\n}\n\nexport function buildCheckInRHS(\n rhs: t.Expression,\n file: File,\n inRHSIsObject?: boolean,\n) {\n if (inRHSIsObject || !file.availableHelper?.(\"checkInRHS\")) return rhs;\n return t.callExpression(file.addHelper(\"checkInRHS\"), [rhs]);\n}\n\nconst privateInVisitor = privateNameVisitorFactory<\n {\n classRef: t.Identifier;\n file: File;\n innerBinding?: t.Identifier;\n privateFieldsAsProperties: boolean;\n },\n PrivateNameMetadata\n>({\n BinaryExpression(path, { file }) {\n const { operator, left, right } = path.node;\n if (operator !== \"in\") return;\n if (!t.isPrivateName(left)) return;\n\n const { privateFieldsAsProperties, privateNamesMap, redeclared } = this;\n\n const { name } = left.id;\n\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(this.classRef.name, path.scope, this.innerBinding);\n\n if (privateFieldsAsProperties) {\n const { id } = privateNamesMap.get(name);\n path.replaceWith(template.expression.ast`\n Object.prototype.hasOwnProperty.call(${buildCheckInRHS(\n right,\n file,\n )}, ${t.cloneNode(id)})\n `);\n return;\n }\n\n const { id, static: isStatic } = privateNamesMap.get(name);\n\n if (isStatic) {\n path.replaceWith(\n template.expression.ast`${buildCheckInRHS(\n right,\n file,\n )} === ${t.cloneNode(this.classRef)}`,\n );\n return;\n }\n\n path.replaceWith(\n template.expression.ast`${t.cloneNode(id)}.has(${buildCheckInRHS(\n right,\n file,\n )})`,\n );\n },\n});\n\ninterface Receiver {\n receiver(\n this: HandlerState & PrivateNameState,\n member: NodePath,\n ): t.Expression;\n}\n\nconst privateNameHandlerSpec: Handler & Receiver =\n {\n memoise(member, count) {\n const { scope } = member;\n const { object } = member.node as { object: t.Expression };\n\n const memo = scope.maybeGenerateMemoised(object);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(object, memo, count);\n },\n\n receiver(member) {\n const { object } = member.node as { object: t.Expression };\n\n if (this.memoiser.has(object)) {\n return t.cloneNode(this.memoiser.get(object));\n }\n\n return t.cloneNode(object);\n },\n\n get(member) {\n const { classRef, privateNamesMap, file, innerBinding } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n methodId,\n getId,\n setId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n // NOTE: This package has a peerDependency on @babel/core@^7.0.0, but these\n // helpers have been introduced in @babel/helpers@7.1.0.\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodGet\"\n : \"classStaticPrivateFieldSpecGet\";\n\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(classRef.name, member.scope, innerBinding);\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]);\n }\n\n if (isMethod) {\n if (isAccessor) {\n if (!getId && setId) {\n if (file.availableHelper(\"writeOnlyError\")) {\n return t.sequenceExpression([\n this.receiver(member),\n t.callExpression(file.addHelper(\"writeOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]),\n ]);\n }\n console.warn(\n `@babel/helpers is outdated, update it to silence this warning.`,\n );\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateMethodGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n t.cloneNode(methodId),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n },\n\n boundGet(member) {\n this.memoise(member, 1);\n\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n [this.receiver(member)],\n );\n },\n\n set(member, value) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n getId,\n } = privateNamesMap.get(name);\n const isAccessor = getId || setId;\n\n if (isStatic) {\n const helperName =\n isMethod && !isAccessor\n ? \"classStaticPrivateMethodSet\"\n : \"classStaticPrivateFieldSpecSet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n value,\n ]);\n }\n if (isMethod) {\n if (setId) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n }\n return t.sequenceExpression([\n this.receiver(member),\n value,\n t.callExpression(file.addHelper(\"readOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n },\n\n destructureSet(member) {\n const { classRef, privateNamesMap, file } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const { id, static: isStatic } = privateNamesMap.get(name);\n if (isStatic) {\n try {\n // classStaticPrivateFieldDestructureSet was introduced in 7.13.10\n // eslint-disable-next-line no-var\n var helper = file.addHelper(\"classStaticPrivateFieldDestructureSet\");\n } catch {\n throw new Error(\n \"Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \\n\" +\n \"please update @babel/helpers to the latest version.\",\n );\n }\n return t.memberExpression(\n t.callExpression(helper, [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n }\n\n return t.memberExpression(\n t.callExpression(file.addHelper(\"classPrivateFieldDestructureSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n },\n\n call(member, args: (t.Expression | t.SpreadElement)[]) {\n // The first access (the get) should do the memo assignment.\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, false);\n },\n\n optionalCall(member, args: (t.Expression | t.SpreadElement)[]) {\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, true);\n },\n\n delete() {\n throw new Error(\n \"Internal Babel error: deleting private elements is a parsing error.\",\n );\n },\n };\n\nconst privateNameHandlerLoose: Handler = {\n get(member) {\n const { privateNamesMap, file } = this;\n const { object } = member.node;\n const { name } = (member.node.property as t.PrivateName).id;\n\n return template.expression`BASE(REF, PROP)[PROP]`({\n BASE: file.addHelper(\"classPrivateFieldLooseBase\"),\n REF: t.cloneNode(object),\n PROP: t.cloneNode(privateNamesMap.get(name).id),\n });\n },\n\n set() {\n // noop\n throw new Error(\"private name handler with loose = true don't need set()\");\n },\n\n boundGet(member) {\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n [t.cloneNode(member.node.object as t.Expression)],\n );\n },\n\n simpleSet(member) {\n return this.get(member);\n },\n\n destructureSet(member) {\n return this.get(member);\n },\n\n call(member, args) {\n return t.callExpression(this.get(member), args);\n },\n\n optionalCall(member, args) {\n return t.optionalCallExpression(this.get(member), args, true);\n },\n\n delete() {\n throw new Error(\n \"Internal Babel error: deleting private elements is a parsing error.\",\n );\n },\n};\n\nexport function transformPrivateNamesUsage(\n ref: t.Identifier,\n path: NodePath,\n privateNamesMap: PrivateNamesMap,\n {\n privateFieldsAsProperties,\n noDocumentAll,\n innerBinding,\n }: {\n privateFieldsAsProperties: boolean;\n noDocumentAll: boolean;\n innerBinding: t.Identifier;\n },\n state: File,\n) {\n if (!privateNamesMap.size) return;\n\n const body = path.get(\"body\");\n const handler = privateFieldsAsProperties\n ? privateNameHandlerLoose\n : privateNameHandlerSpec;\n\n memberExpressionToFunctions(body, privateNameVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n ...handler,\n noDocumentAll,\n innerBinding,\n });\n body.traverse(privateInVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n privateFieldsAsProperties,\n innerBinding,\n });\n}\n\nfunction buildPrivateFieldInitLoose(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${t.cloneNode(id)}, {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPrivateInstanceFieldInitSpec(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${t.cloneNode(id)}.set(${ref}, {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ${value},\n })` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)},\n {\n writable: true,\n value: ${value}\n },\n )` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPrivateStaticFieldInitSpec(\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n const isAccessor = getId || setId;\n\n if (!prop.isProperty() && (initAdded || !isAccessor)) return;\n\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n }\n `,\n prop,\n );\n }\n\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n };\n `,\n prop,\n );\n}\n\nfunction buildPrivateMethodInitLoose(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { methodId, id, getId, setId, initAdded } = privateName;\n if (initAdded) return;\n\n if (methodId) {\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n}\n\nfunction buildPrivateInstanceMethodInitSpec(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n return buildPrivateAccessorInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n }\n\n return buildPrivateInstanceMethodInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n}\n\nfunction buildPrivateAccessorInitialization(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId } = privateName;\n\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`\n ${id}.set(${ref}, {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)},\n {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n },\n )` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPrivateInstanceMethodInitialization(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id } = privateName;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateMethodInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${id}.add(${ref})` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateMethodInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)}\n )` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPublicFieldInitLoose(\n ref: t.Expression,\n prop: NodePath,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(ref, key, computed || t.isLiteral(key)),\n value,\n ),\n ),\n prop,\n );\n}\n\nfunction buildPublicFieldInitSpec(\n ref: t.Expression,\n prop: NodePath,\n state: File,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n ref,\n computed || t.isLiteral(key)\n ? key\n : t.stringLiteral((key as t.Identifier).name),\n value,\n ]),\n ),\n prop,\n );\n}\n\nfunction buildPrivateStaticMethodInitLoose(\n ref: t.Expression,\n prop: NodePath,\n state: File,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, methodId, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isAccessor = getId || setId;\n if (isAccessor) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n })\n `,\n prop,\n );\n }\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `,\n prop,\n );\n}\n\nfunction buildPrivateMethodDeclaration(\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsProperties = false,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const {\n id,\n methodId,\n getId,\n setId,\n getterDeclared,\n setterDeclared,\n static: isStatic,\n } = privateName;\n const { params, body, generator, async } = prop.node;\n const isGetter = getId && !getterDeclared && params.length === 0;\n const isSetter = setId && !setterDeclared && params.length > 0;\n\n let declId = methodId;\n\n if (isGetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n getterDeclared: true,\n });\n declId = getId;\n } else if (isSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n setterDeclared: true,\n });\n declId = setId;\n } else if (isStatic && !privateFieldsAsProperties) {\n declId = id;\n }\n\n return inheritPropComments(\n t.functionDeclaration(\n t.cloneNode(declId),\n // @ts-expect-error params for ClassMethod has TSParameterProperty\n params,\n body,\n generator,\n async,\n ),\n prop,\n );\n}\n\ntype ReplaceThisState = {\n classRef: t.Identifier;\n needsClassRef: boolean;\n innerBinding: t.Identifier | null;\n};\n\ntype ReplaceInnerBindingReferenceState = ReplaceThisState;\n\nconst thisContextVisitor = traverse.visitors.merge([\n {\n UnaryExpression(path) {\n // Replace `delete this` with `true`\n const { node } = path;\n if (node.operator === \"delete\") {\n const argument = skipTransparentExprWrapperNodes(node.argument);\n if (t.isThisExpression(argument)) {\n path.replaceWith(t.booleanLiteral(true));\n }\n }\n },\n ThisExpression(path, state) {\n state.needsClassRef = true;\n path.replaceWith(t.cloneNode(state.classRef));\n },\n MetaProperty(path) {\n const { node, scope } = path;\n // if there are `new.target` in static field\n // we should replace it with `undefined`\n if (node.meta.name === \"new\" && node.property.name === \"target\") {\n path.replaceWith(scope.buildUndefinedNode());\n }\n },\n },\n environmentVisitor,\n]);\n\nconst innerReferencesVisitor: Visitor = {\n ReferencedIdentifier(path, state) {\n if (\n path.scope.bindingIdentifierEquals(path.node.name, state.innerBinding)\n ) {\n state.needsClassRef = true;\n path.node.name = state.classRef.name;\n }\n },\n};\n\nfunction replaceThisContext(\n path: PropPath,\n ref: t.Identifier,\n innerBindingRef: t.Identifier | null,\n) {\n const state: ReplaceThisState = {\n classRef: ref,\n needsClassRef: false,\n innerBinding: innerBindingRef,\n };\n if (!path.isMethod()) {\n // replace `this` in property initializers and static blocks\n path.traverse(thisContextVisitor, state);\n }\n\n // todo: use innerBinding.referencePaths to avoid full traversal\n if (\n innerBindingRef != null &&\n state.classRef?.name &&\n state.classRef.name !== innerBindingRef.name\n ) {\n path.traverse(innerReferencesVisitor, state);\n }\n\n return state.needsClassRef;\n}\n\nexport type PropNode =\n | t.ClassProperty\n | t.ClassPrivateMethod\n | t.ClassPrivateProperty\n | t.StaticBlock;\nexport type PropPath = NodePath;\n\nfunction isNameOrLength({ key, computed }: t.ClassProperty) {\n if (key.type === \"Identifier\") {\n return !computed && (key.name === \"name\" || key.name === \"length\");\n }\n if (key.type === \"StringLiteral\") {\n return key.value === \"name\" || key.value === \"length\";\n }\n return false;\n}\n\n/**\n * Inherit comments from class members. This is a reduced version of\n * t.inheritsComments: the trailing comments are not inherited because\n * for most class members except the last one, their trailing comments are\n * the next sibling's leading comments.\n *\n * @template T transformed class member type\n * @param {T} node transformed class member\n * @param {PropPath} prop class member\n * @returns transformed class member type with comments inherited\n */\nfunction inheritPropComments(node: T, prop: PropPath) {\n t.inheritLeadingComments(node, prop.node);\n t.inheritInnerComments(node, prop.node);\n return node;\n}\n\n/**\n * ClassRefFlag records the requirement of the class binding reference.\n *\n * @enum {number}\n */\nconst enum ClassRefFlag {\n None,\n /**\n * When this flag is enabled, the binding reference can be the class id,\n * if exists, or the uid identifier generated for class expression. The\n * reference is safe to be consumed by [[Define]].\n */\n ForDefine = 1 << 0,\n /**\n * When this flag is enabled, the reference must be a uid, because the outer\n * class binding can be mutated by user codes.\n * E.g.\n * class C { static p = C }; const oldC = C; C = null; oldC.p;\n * we must memoize class `C` before defining the property `p`.\n */\n ForInnerBinding = 1 << 1,\n}\n\nexport function buildFieldsInitNodes(\n ref: t.Identifier | null,\n superRef: t.Expression | undefined,\n props: PropPath[],\n privateNamesMap: PrivateNamesMap,\n file: File,\n setPublicClassFields: boolean,\n privateFieldsAsProperties: boolean,\n constantSuper: boolean,\n innerBindingRef: t.Identifier | null,\n) {\n let classRefFlags = ClassRefFlag.None;\n let injectSuperRef: t.Identifier;\n const staticNodes: t.Statement[] = [];\n const instanceNodes: t.ExpressionStatement[] = [];\n let lastInstanceNodeReturnsThis = false;\n // These nodes are pure and can be moved to the closest statement position\n const pureStaticNodes: t.FunctionDeclaration[] = [];\n let classBindingNode: t.ExpressionStatement | null = null;\n\n const getSuperRef = t.isIdentifier(superRef)\n ? () => superRef\n : () => {\n injectSuperRef ??=\n props[0].scope.generateUidIdentifierBasedOnNode(superRef);\n return injectSuperRef;\n };\n\n const classRefForInnerBinding =\n ref ??\n props[0].scope.generateUidIdentifier(innerBindingRef?.name || \"Class\");\n ref ??= t.cloneNode(innerBindingRef);\n\n for (const prop of props) {\n prop.isClassProperty() && ts.assertFieldTransformed(prop);\n\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n const isStatic = !t.isStaticBlock?.(prop.node) && prop.node.static;\n const isInstance = !isStatic;\n const isPrivate = prop.isPrivate();\n const isPublic = !isPrivate;\n const isField = prop.isProperty();\n const isMethod = !isField;\n const isStaticBlock = prop.isStaticBlock?.();\n\n if (isStatic) classRefFlags |= ClassRefFlag.ForDefine;\n\n if (isStatic || (isMethod && isPrivate) || isStaticBlock) {\n new ReplaceSupers({\n methodPath: prop,\n constantSuper,\n file: file,\n refToPreserve: innerBindingRef,\n getSuperRef,\n getObjectRef() {\n classRefFlags |= ClassRefFlag.ForInnerBinding;\n if (isStatic || isStaticBlock) {\n return classRefForInnerBinding;\n } else {\n return t.memberExpression(\n classRefForInnerBinding,\n t.identifier(\"prototype\"),\n );\n }\n },\n }).replace();\n\n const replaced = replaceThisContext(\n prop,\n classRefForInnerBinding,\n innerBindingRef,\n );\n if (replaced) {\n classRefFlags |= ClassRefFlag.ForInnerBinding;\n }\n }\n\n lastInstanceNodeReturnsThis = false;\n\n // TODO(ts): there are so many `ts-expect-error` inside cases since\n // ts can not infer type from pre-computed values (or a case test)\n // even change `isStaticBlock` to `t.isStaticBlock(prop)` will not make prop\n // a `NodePath`\n // this maybe a bug for ts\n switch (true) {\n case isStaticBlock: {\n const blockBody = (prop.node as t.StaticBlock).body;\n // We special-case the single expression case to avoid the iife, since\n // it's common.\n if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n staticNodes.push(inheritPropComments(blockBody[0], prop));\n } else {\n staticNodes.push(\n t.inheritsComments(\n template.statement.ast`(() => { ${blockBody} })()`,\n prop.node,\n ),\n );\n }\n break;\n }\n case isStatic && isPrivate && isField && privateFieldsAsProperties:\n staticNodes.push(\n buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),\n );\n break;\n case isStatic && isPrivate && isField && !privateFieldsAsProperties:\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n break;\n case isStatic && isPublic && isField && setPublicClassFields:\n // Functions always have non-writable .name and .length properties,\n // so we must always use [[Define]] for them.\n // It might still be possible to a computed static fields whose resulting\n // key is \"name\" or \"length\", but the assumption is telling us that it's\n // not going to happen.\n // @ts-expect-error checked in switch\n if (!isNameOrLength(prop.node)) {\n // @ts-expect-error checked in switch\n staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));\n break;\n }\n // falls through\n case isStatic && isPublic && isField && !setPublicClassFields:\n staticNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.cloneNode(ref), prop, file),\n );\n break;\n case isInstance && isPrivate && isField && privateFieldsAsProperties:\n instanceNodes.push(\n buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),\n );\n break;\n case isInstance && isPrivate && isField && !privateFieldsAsProperties:\n instanceNodes.push(\n buildPrivateInstanceFieldInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n file,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && privateFieldsAsProperties:\n instanceNodes.unshift(\n buildPrivateMethodInitLoose(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isInstance && isPrivate && isMethod && !privateFieldsAsProperties:\n instanceNodes.unshift(\n buildPrivateInstanceMethodInitSpec(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n file,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isStatic && isPrivate && isMethod && !privateFieldsAsProperties:\n staticNodes.unshift(\n // @ts-expect-error checked in switch\n buildPrivateStaticFieldInitSpec(prop, privateNamesMap),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isStatic && isPrivate && isMethod && privateFieldsAsProperties:\n staticNodes.unshift(\n buildPrivateStaticMethodInitLoose(\n t.cloneNode(ref),\n // @ts-expect-error checked in switch\n prop,\n file,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsProperties,\n ),\n );\n break;\n case isInstance && isPublic && isField && setPublicClassFields:\n // @ts-expect-error checked in switch\n instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));\n break;\n case isInstance && isPublic && isField && !setPublicClassFields:\n lastInstanceNodeReturnsThis = true;\n instanceNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.thisExpression(), prop, file),\n );\n break;\n default:\n throw new Error(\"Unreachable.\");\n }\n }\n\n if (classRefFlags & ClassRefFlag.ForInnerBinding && innerBindingRef != null) {\n classBindingNode = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(classRefForInnerBinding),\n t.cloneNode(innerBindingRef),\n ),\n );\n }\n\n return {\n staticNodes: staticNodes.filter(Boolean),\n instanceNodes: instanceNodes.filter(Boolean),\n lastInstanceNodeReturnsThis,\n pureStaticNodes: pureStaticNodes.filter(Boolean),\n classBindingNode,\n wrapClass(path: NodePath) {\n for (const prop of props) {\n // Delete leading comments so that they don't get attached as\n // trailing comments of the previous sibling.\n // When transforming props, we explicitly attach their leading\n // comments to the transformed node with `inheritPropComments`\n // above.\n prop.node.leadingComments = null;\n prop.remove();\n }\n\n if (injectSuperRef) {\n path.scope.push({ id: t.cloneNode(injectSuperRef) });\n path.set(\n \"superClass\",\n t.assignmentExpression(\"=\", injectSuperRef, path.node.superClass),\n );\n }\n\n if (classRefFlags !== ClassRefFlag.None) {\n if (path.isClassExpression()) {\n path.scope.push({ id: ref });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(ref), path.node),\n );\n } else {\n if (innerBindingRef == null) {\n // export anonymous class declaration\n path.node.id = ref;\n }\n if (classBindingNode != null) {\n path.scope.push({ id: classRefForInnerBinding });\n }\n }\n }\n\n return path;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,kCAAA,GAAAH,OAAA;AAKA,IAAAI,6BAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,wCAAA,GAAAN,OAAA;AAEA,IAAAO,EAAA,GAAAP,OAAA;AAkBO,SAASQ,oBAAoBA,CAACC,KAAiB,EAAE;EACtD,MAAMC,eAAgC,GAAG,IAAIC,GAAG,CAAC,CAAC;EAClD,KAAK,MAAMC,IAAI,IAA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AAC;QACH,CAAC,MAAM;UACL,IAAIkK,eAAe,IAAI,IAAI,EAAE;YAE3BhH,IAAI,CAAClD,IAAI,CAACE,EAAE,GAAGkH,GAAG;UACpB;UACA,IAAIgE,gBAAgB,IAAI,IAAI,EAAE;YAC5BlI,IAAI,CAAC5C,KAAK,CAAC6B,IAAI,CAAC;cAAEjC,EAAE,EAAEuL;YAAwB,CAAC,CAAC;UAClD;QACF;MACF;MAEA,OAAOvI,IAAI;IACb;EACF,CAAC;AACH"} \ No newline at end of file +{"version":3,"names":["_core","require","_helperReplaceSupers","_helperEnvironmentVisitor","_helperMemberExpressionToFunctions","_helperOptimiseCallExpression","_helperAnnotateAsPure","_helperSkipTransparentExpressionWrappers","ts","newHelpers","file","availableHelper","buildPrivateNamesMap","className","privateFieldsAsSymbolsOrProperties","props","privateNamesMap","Map","classBrandId","prop","isPrivate","name","node","key","id","update","get","isMethod","isProperty","isStatic","static","initAdded","_classBrandId","scope","generateUidIdentifier","method","set","isClassPrivateMethod","kind","body","$","length","t","isReturnStatement","isCallExpression","argument","arguments","isThisExpression","isIdentifier","callee","getId","cloneNode","getterDeclared","params","isExpressionStatement","expression","setId","setterDeclared","methodId","buildPrivateNamesNodes","privateFieldsAsProperties","privateFieldsAsSymbols","state","initNodes","injectedIds","Set","value","isGetterOrSetter","init","callExpression","addHelper","stringLiteral","identifier","has","add","newExpression","annotateAsPure","push","template","statement","ast","privateNameVisitorFactory","visitor","nestedVisitor","traverse","visitors","merge","Object","assign","environmentVisitor","privateNameVisitor","Class","path","visiblePrivateNames","redeclared","delete","skipKey","PrivateName","noDocumentAll","parentPath","isMemberExpression","property","isOptionalMemberExpression","includes","handle","unshadow","innerBinding","_scope","hasBinding","bindingIdentifierEquals","rename","parent","buildCheckInRHS","rhs","inRHSIsObject","privateInVisitor","BinaryExpression","operator","left","right","isPrivateName","classRef","replaceWith","readOnlyError","writeOnlyError","console","warn","buildUndefinedNode","buildStaticPrivateFieldAccess","expr","noUninitializedPrivateFieldAccess","memberExpression","privateNameHandlerSpec","memoise","member","count","object","memo","maybeGenerateMemoised","memoiser","receiver","helperName","skipCheck","err","sequenceExpression","boundGet","assignmentExpression","destructureSet","helper","_unused","Error","getCall","ref","pop","setCall","buildCodeFrameError","args","computed","arrayExpression","slice","call","optimiseCall","optionalCall","privateNameHandlerLoose","BASE","REF","PROP","simpleSet","optionalCallExpression","transformPrivateNamesUsage","size","handler","memberExpressionToFunctions","buildPrivateFieldInitLoose","inheritPropComments","buildPrivateInstanceFieldInitSpec","expressionStatement","thisExpression","buildPrivateStaticFieldInitSpec","privateName","variableDeclaration","variableDeclarator","buildPrivateStaticFieldInitSpecOld","buildPrivateMethodInitLoose","buildPrivateInstanceMethodInitSpec","buildPrivateAccessorInitialization","buildPrivateInstanceMethodInitialization","buildPublicFieldInitLoose","isLiteral","buildPublicFieldInitSpec","buildPrivateStaticMethodInitLoose","buildPrivateMethodDeclaration","generator","async","isGetter","isSetter","thisArg","thisRef","argumentsPath","thisContextVisitor","argumentsId","unshift","declId","functionDeclaration","Identifier","UnaryExpression","skipTransparentExprWrapperNodes","booleanLiteral","ThisExpression","needsClassRef","MetaProperty","meta","innerReferencesVisitor","ReferencedIdentifier","replaceThisContext","innerBindingRef","_state$thisRef","isNameOrLength","type","inheritLeadingComments","inheritInnerComments","buildFieldsInitNodes","superRef","setPublicClassFields","constantSuper","_ref","_ref2","classRefFlags","injectSuperRef","staticNodes","instanceNodes","lastInstanceNodeReturnsThis","pureStaticNodes","classBindingNode","getSuperRef","_injectSuperRef","generateUidIdentifierBasedOnNode","classRefForInnerBinding","isClassProperty","assertFieldTransformed","isStaticBlock","isInstance","isPublic","isField","ReplaceSupers","methodPath","refToPreserve","getObjectRef","replace","replaced","blockBody","inheritsComments","filter","Boolean","wrapClass","leadingComments","remove","superClass","isClassExpression"],"sources":["../src/fields.ts"],"sourcesContent":["import { template, traverse, types as t } from \"@babel/core\";\nimport type { File } from \"@babel/core\";\nimport type { NodePath, Visitor, Scope } from \"@babel/traverse\";\nimport ReplaceSupers from \"@babel/helper-replace-supers\";\nimport environmentVisitor from \"@babel/helper-environment-visitor\";\nimport memberExpressionToFunctions from \"@babel/helper-member-expression-to-functions\";\nimport type {\n Handler,\n HandlerState,\n} from \"@babel/helper-member-expression-to-functions\";\nimport optimiseCall from \"@babel/helper-optimise-call-expression\";\nimport annotateAsPure from \"@babel/helper-annotate-as-pure\";\nimport { skipTransparentExprWrapperNodes } from \"@babel/helper-skip-transparent-expression-wrappers\";\n\nimport * as ts from \"./typescript.ts\";\n\ninterface PrivateNameMetadata {\n id: t.Identifier;\n static: boolean;\n method: boolean;\n getId?: t.Identifier;\n setId?: t.Identifier;\n methodId?: t.Identifier;\n initAdded?: boolean;\n getterDeclared?: boolean;\n setterDeclared?: boolean;\n}\n\ntype PrivateNamesMapGeneric = Map;\n\ntype PrivateNamesMap = PrivateNamesMapGeneric;\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var newHelpers = (file: File) => {\n if (!process.env.IS_PUBLISH) {\n const { comments } = file.ast;\n // This is needed for the test in\n // babel-plugin-transform-class-properties/test/fixtures/regression/old-helpers\n if (comments?.some(c => c.value.includes(\"@force-old-private-helpers\"))) {\n return false;\n }\n }\n return file.availableHelper(\"classPrivateFieldGet2\");\n };\n}\n\nexport function buildPrivateNamesMap(\n className: string,\n privateFieldsAsSymbolsOrProperties: boolean,\n props: PropPath[],\n file: File,\n) {\n const privateNamesMap: PrivateNamesMap = new Map();\n let classBrandId: t.Identifier;\n for (const prop of props) {\n if (prop.isPrivate()) {\n const { name } = prop.node.key.id;\n let update: PrivateNameMetadata = privateNamesMap.get(name);\n if (!update) {\n const isMethod = !prop.isProperty();\n const isStatic = prop.node.static;\n let initAdded = false;\n let id: t.Identifier;\n if (\n !privateFieldsAsSymbolsOrProperties &&\n (process.env.BABEL_8_BREAKING || newHelpers(file)) &&\n isMethod &&\n !isStatic\n ) {\n initAdded = !!classBrandId;\n classBrandId ??= prop.scope.generateUidIdentifier(\n `${className}_brand`,\n );\n id = classBrandId;\n } else {\n id = prop.scope.generateUidIdentifier(name);\n }\n update = { id, static: isStatic, method: isMethod, initAdded };\n privateNamesMap.set(name, update);\n }\n if (prop.isClassPrivateMethod()) {\n if (prop.node.kind === \"get\") {\n const { body } = prop.node.body;\n let $: t.Node;\n if (\n // If we have\n // get #foo() { return _some_fn(this); }\n // we can use _some_fn directly.\n body.length === 1 &&\n t.isReturnStatement(($ = body[0])) &&\n t.isCallExpression(($ = $.argument)) &&\n $.arguments.length === 1 &&\n t.isThisExpression($.arguments[0]) &&\n t.isIdentifier(($ = $.callee))\n ) {\n update.getId = t.cloneNode($);\n update.getterDeclared = true;\n } else {\n update.getId = prop.scope.generateUidIdentifier(`get_${name}`);\n }\n } else if (prop.node.kind === \"set\") {\n const { params } = prop.node;\n const { body } = prop.node.body;\n let $: t.Node;\n if (\n // If we have\n // set #foo(val) { _some_fn(this, val); }\n // we can use _some_fn directly.\n body.length === 1 &&\n t.isExpressionStatement(($ = body[0])) &&\n t.isCallExpression(($ = $.expression)) &&\n $.arguments.length === 2 &&\n t.isThisExpression($.arguments[0]) &&\n t.isIdentifier($.arguments[1], {\n name: (params[0] as t.Identifier).name,\n }) &&\n t.isIdentifier(($ = $.callee))\n ) {\n update.setId = t.cloneNode($);\n update.setterDeclared = true;\n } else {\n update.setId = prop.scope.generateUidIdentifier(`set_${name}`);\n }\n } else if (prop.node.kind === \"method\") {\n update.methodId = prop.scope.generateUidIdentifier(name);\n }\n }\n privateNamesMap.set(name, update);\n }\n }\n return privateNamesMap;\n}\n\nexport function buildPrivateNamesNodes(\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsProperties: boolean,\n privateFieldsAsSymbols: boolean,\n state: File,\n) {\n const initNodes: t.Statement[] = [];\n\n const injectedIds = new Set();\n\n for (const [name, value] of privateNamesMap) {\n // - When the privateFieldsAsProperties assumption is enabled,\n // both static and instance fields are transpiled using a\n // secret non-enumerable property. Hence, we also need to generate that\n // key (using the classPrivateFieldLooseKey helper).\n // - When the privateFieldsAsSymbols assumption is enabled,\n // both static and instance fields are transpiled using a\n // unique Symbol to define a non-enumerable property.\n // - In spec mode, only instance fields need a \"private name\" initializer\n // because static fields are directly assigned to a variable in the\n // buildPrivateStaticFieldInitSpec function.\n const { static: isStatic, method: isMethod, getId, setId } = value;\n const isGetterOrSetter = getId || setId;\n const id = t.cloneNode(value.id);\n\n let init: t.Expression;\n\n if (privateFieldsAsProperties) {\n init = t.callExpression(state.addHelper(\"classPrivateFieldLooseKey\"), [\n t.stringLiteral(name),\n ]);\n } else if (privateFieldsAsSymbols) {\n init = t.callExpression(t.identifier(\"Symbol\"), [t.stringLiteral(name)]);\n } else if (!isStatic) {\n if (injectedIds.has(id.name)) continue;\n injectedIds.add(id.name);\n\n init = t.newExpression(\n t.identifier(\n isMethod &&\n (process.env.BABEL_8_BREAKING ||\n !isGetterOrSetter ||\n newHelpers(state))\n ? \"WeakSet\"\n : \"WeakMap\",\n ),\n [],\n );\n }\n\n if (init) {\n if (!privateFieldsAsSymbols) {\n annotateAsPure(init);\n }\n initNodes.push(template.statement.ast`var ${id} = ${init}`);\n }\n }\n\n return initNodes;\n}\n\nexport interface PrivateNameVisitorState {\n privateNamesMap: PrivateNamesMapGeneric;\n redeclared?: string[];\n}\n\n// Traverses the class scope, handling private name references. If an inner\n// class redeclares the same private name, it will hand off traversal to the\n// restricted visitor (which doesn't traverse the inner class's inner scope).\nexport function privateNameVisitorFactory(\n visitor: Visitor & S>,\n) {\n // Traverses the outer portion of a class, without touching the class's inner\n // scope, for private names.\n const nestedVisitor = traverse.visitors.merge([\n { ...visitor },\n environmentVisitor,\n ]);\n\n // @ts-expect-error: TS2590: Expression produces a union type that is too complex to represent.\n const privateNameVisitor: Visitor<\n PrivateNameVisitorState & S\n > = {\n ...visitor,\n\n Class(path) {\n const { privateNamesMap } = this;\n const body = path.get(\"body.body\");\n\n const visiblePrivateNames = new Map(privateNamesMap);\n const redeclared = [];\n for (const prop of body) {\n if (!prop.isPrivate()) continue;\n const { name } = prop.node.key.id;\n visiblePrivateNames.delete(name);\n redeclared.push(name);\n }\n\n // If the class doesn't redeclare any private fields, we can continue with\n // our overall traversal.\n if (!redeclared.length) {\n return;\n }\n\n // This class redeclares some private field. We need to process the outer\n // environment with access to all the outer privates, then we can process\n // the inner environment with only the still-visible outer privates.\n path.get(\"body\").traverse(nestedVisitor, {\n ...this,\n redeclared,\n });\n path.traverse(privateNameVisitor, {\n ...this,\n privateNamesMap: visiblePrivateNames,\n });\n\n // We'll eventually hit this class node again with the overall Class\n // Features visitor, which'll process the redeclared privates.\n path.skipKey(\"body\");\n },\n };\n\n return privateNameVisitor;\n}\n\ninterface PrivateNameState {\n privateNamesMap: PrivateNamesMap;\n classRef: t.Identifier;\n file: File;\n noDocumentAll: boolean;\n noUninitializedPrivateFieldAccess: boolean;\n innerBinding?: t.Identifier;\n}\n\nconst privateNameVisitor = privateNameVisitorFactory<\n HandlerState & PrivateNameState,\n PrivateNameMetadata\n>({\n PrivateName(path, { noDocumentAll }) {\n const { privateNamesMap, redeclared } = this;\n const { node, parentPath } = path;\n\n if (\n !parentPath.isMemberExpression({ property: node }) &&\n !parentPath.isOptionalMemberExpression({ property: node })\n ) {\n return;\n }\n const { name } = node.id;\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n this.handle(parentPath, noDocumentAll);\n },\n});\n\n// rename all bindings that shadows innerBinding\nfunction unshadow(\n name: string,\n scope: Scope,\n innerBinding: t.Identifier | undefined,\n) {\n // in some cases, scope.getBinding(name) === undefined\n // so we check hasBinding to avoid keeping looping\n // see: https://github.com/babel/babel/pull/13656#discussion_r686030715\n while (\n scope?.hasBinding(name) &&\n !scope.bindingIdentifierEquals(name, innerBinding)\n ) {\n scope.rename(name);\n scope = scope.parent;\n }\n}\n\nexport function buildCheckInRHS(\n rhs: t.Expression,\n file: File,\n inRHSIsObject?: boolean,\n) {\n if (inRHSIsObject || !file.availableHelper?.(\"checkInRHS\")) return rhs;\n return t.callExpression(file.addHelper(\"checkInRHS\"), [rhs]);\n}\n\nconst privateInVisitor = privateNameVisitorFactory<\n {\n classRef: t.Identifier;\n file: File;\n innerBinding?: t.Identifier;\n privateFieldsAsProperties: boolean;\n },\n PrivateNameMetadata\n>({\n BinaryExpression(path, { file }) {\n const { operator, left, right } = path.node;\n if (operator !== \"in\") return;\n if (!t.isPrivateName(left)) return;\n\n const { privateFieldsAsProperties, privateNamesMap, redeclared } = this;\n\n const { name } = left.id;\n\n if (!privateNamesMap.has(name)) return;\n if (redeclared && redeclared.includes(name)) return;\n\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(this.classRef.name, path.scope, this.innerBinding);\n\n if (privateFieldsAsProperties) {\n const { id } = privateNamesMap.get(name);\n path.replaceWith(template.expression.ast`\n Object.prototype.hasOwnProperty.call(${buildCheckInRHS(\n right,\n file,\n )}, ${t.cloneNode(id)})\n `);\n return;\n }\n\n const { id, static: isStatic } = privateNamesMap.get(name);\n\n if (isStatic) {\n path.replaceWith(\n template.expression.ast`${buildCheckInRHS(\n right,\n file,\n )} === ${t.cloneNode(this.classRef)}`,\n );\n return;\n }\n\n path.replaceWith(\n template.expression.ast`${t.cloneNode(id)}.has(${buildCheckInRHS(\n right,\n file,\n )})`,\n );\n },\n});\n\ninterface Receiver {\n receiver(\n this: HandlerState & PrivateNameState,\n member: NodePath,\n ): t.Expression;\n}\n\nfunction readOnlyError(file: File, name: string) {\n return t.callExpression(file.addHelper(\"readOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]);\n}\n\nfunction writeOnlyError(file: File, name: string) {\n if (\n !process.env.BABEL_8_BREAKING &&\n !file.availableHelper(\"writeOnlyError\")\n ) {\n console.warn(\n `@babel/helpers is outdated, update it to silence this warning.`,\n );\n return t.buildUndefinedNode();\n }\n return t.callExpression(file.addHelper(\"writeOnlyError\"), [\n t.stringLiteral(`#${name}`),\n ]);\n}\n\nfunction buildStaticPrivateFieldAccess(\n expr: N,\n noUninitializedPrivateFieldAccess: boolean,\n) {\n if (noUninitializedPrivateFieldAccess) return expr;\n return t.memberExpression(expr, t.identifier(\"_\"));\n}\n\nconst privateNameHandlerSpec: Handler & Receiver =\n {\n memoise(member, count) {\n const { scope } = member;\n const { object } = member.node as { object: t.Expression };\n\n const memo = scope.maybeGenerateMemoised(object);\n if (!memo) {\n return;\n }\n\n this.memoiser.set(object, memo, count);\n },\n\n receiver(member) {\n const { object } = member.node as { object: t.Expression };\n\n if (this.memoiser.has(object)) {\n return t.cloneNode(this.memoiser.get(object));\n }\n\n return t.cloneNode(object);\n },\n\n get(member) {\n const {\n classRef,\n privateNamesMap,\n file,\n innerBinding,\n noUninitializedPrivateFieldAccess,\n } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n methodId,\n getId,\n setId,\n } = privateNamesMap.get(name);\n const isGetterOrSetter = getId || setId;\n\n if (isStatic) {\n // if there are any local variable shadowing classRef, unshadow it\n // see #12960\n unshadow(classRef.name, member.scope, innerBinding);\n\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n // NOTE: This package has a peerDependency on @babel/core@^7.0.0, but these\n // helpers have been introduced in @babel/helpers@7.1.0.\n const helperName =\n isMethod && !isGetterOrSetter\n ? \"classStaticPrivateMethodGet\"\n : \"classStaticPrivateFieldSpecGet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]);\n }\n\n const receiver = this.receiver(member);\n const skipCheck =\n t.isIdentifier(receiver) && receiver.name === classRef.name;\n\n if (!isMethod) {\n if (skipCheck) {\n return buildStaticPrivateFieldAccess(\n t.cloneNode(id),\n noUninitializedPrivateFieldAccess,\n );\n }\n\n return buildStaticPrivateFieldAccess(\n t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(classRef),\n receiver,\n t.cloneNode(id),\n ]),\n noUninitializedPrivateFieldAccess,\n );\n }\n\n if (getId) {\n if (skipCheck) {\n return t.callExpression(t.cloneNode(getId), [receiver]);\n }\n return t.callExpression(file.addHelper(\"classPrivateGetter\"), [\n t.cloneNode(classRef),\n receiver,\n t.cloneNode(getId),\n ]);\n }\n\n if (setId) {\n const err = t.buildUndefinedNode(); // TODO: writeOnlyError(file, name)\n if (skipCheck) return err;\n return t.sequenceExpression([\n t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(classRef),\n receiver,\n ]),\n err,\n ]);\n }\n\n if (skipCheck) return t.cloneNode(id);\n return t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(classRef),\n receiver,\n t.cloneNode(id),\n ]);\n }\n\n if (isMethod) {\n if (isGetterOrSetter) {\n if (!getId) {\n return t.sequenceExpression([\n this.receiver(member),\n writeOnlyError(file, name),\n ]);\n }\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateGetter\"), [\n t.cloneNode(id),\n this.receiver(member),\n t.cloneNode(getId),\n ]);\n }\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n return t.callExpression(file.addHelper(\"classPrivateMethodGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n t.cloneNode(methodId),\n ]);\n }\n return t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(id),\n this.receiver(member),\n t.cloneNode(methodId),\n ]);\n }\n if (process.env.BABEL_8_BREAKING || newHelpers(file)) {\n return t.callExpression(file.addHelper(\"classPrivateFieldGet2\"), [\n t.cloneNode(id),\n this.receiver(member),\n ]);\n }\n\n return t.callExpression(file.addHelper(\"classPrivateFieldGet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]);\n },\n\n boundGet(member) {\n this.memoise(member, 1);\n\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n [this.receiver(member)],\n );\n },\n\n set(member, value) {\n const {\n classRef,\n privateNamesMap,\n file,\n noUninitializedPrivateFieldAccess,\n } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n getId,\n } = privateNamesMap.get(name);\n const isGetterOrSetter = getId || setId;\n\n if (isStatic) {\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n const helperName =\n isMethod && !isGetterOrSetter\n ? \"classStaticPrivateMethodSet\"\n : \"classStaticPrivateFieldSpecSet\";\n\n return t.callExpression(file.addHelper(helperName), [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n value,\n ]);\n }\n\n const receiver = this.receiver(member);\n const skipCheck =\n t.isIdentifier(receiver) && receiver.name === classRef.name;\n\n if (isMethod && !setId) {\n const err = readOnlyError(file, name);\n if (skipCheck) return t.sequenceExpression([value, err]);\n return t.sequenceExpression([\n value,\n t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(classRef),\n receiver,\n ]),\n readOnlyError(file, name),\n ]);\n }\n\n if (setId) {\n if (skipCheck) {\n return t.callExpression(t.cloneNode(setId), [receiver, value]);\n }\n return t.callExpression(file.addHelper(\"classPrivateSetter\"), [\n t.cloneNode(classRef),\n t.cloneNode(setId),\n receiver,\n value,\n ]);\n }\n return t.assignmentExpression(\n \"=\",\n buildStaticPrivateFieldAccess(\n t.cloneNode(id),\n noUninitializedPrivateFieldAccess,\n ),\n skipCheck\n ? value\n : t.callExpression(file.addHelper(\"assertClassBrand\"), [\n t.cloneNode(classRef),\n receiver,\n value,\n ]),\n );\n }\n if (isMethod) {\n if (setId) {\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n }\n return t.callExpression(file.addHelper(\"classPrivateSetter\"), [\n t.cloneNode(id),\n t.cloneNode(setId),\n this.receiver(member),\n value,\n ]);\n }\n return t.sequenceExpression([\n this.receiver(member),\n value,\n readOnlyError(file, name),\n ]);\n }\n\n if (process.env.BABEL_8_BREAKING || newHelpers(file)) {\n return t.callExpression(file.addHelper(\"classPrivateFieldSet2\"), [\n t.cloneNode(id),\n this.receiver(member),\n value,\n ]);\n }\n\n return t.callExpression(file.addHelper(\"classPrivateFieldSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n value,\n ]);\n },\n\n destructureSet(member) {\n const {\n classRef,\n privateNamesMap,\n file,\n noUninitializedPrivateFieldAccess,\n } = this;\n const { name } = (member.node.property as t.PrivateName).id;\n const {\n id,\n static: isStatic,\n method: isMethod,\n setId,\n } = privateNamesMap.get(name);\n\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n if (isStatic) {\n try {\n // classStaticPrivateFieldDestructureSet was introduced in 7.13.10\n // eslint-disable-next-line no-var\n var helper = file.addHelper(\n \"classStaticPrivateFieldDestructureSet\",\n );\n } catch {\n throw new Error(\n \"Babel can not transpile `[C.#p] = [0]` with @babel/helpers < 7.13.10, \\n\" +\n \"please update @babel/helpers to the latest version.\",\n );\n }\n return t.memberExpression(\n t.callExpression(helper, [\n this.receiver(member),\n t.cloneNode(classRef),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n }\n\n return t.memberExpression(\n t.callExpression(file.addHelper(\"classPrivateFieldDestructureSet\"), [\n this.receiver(member),\n t.cloneNode(id),\n ]),\n t.identifier(\"value\"),\n );\n }\n\n if (isMethod && !setId) {\n return t.memberExpression(\n t.sequenceExpression([\n // @ts-ignore(Babel 7 vs Babel 8) member.node.object is not t.Super\n member.node.object,\n readOnlyError(file, name),\n ]),\n t.identifier(\"_\"),\n );\n }\n\n if (isStatic && !isMethod) {\n const getCall = this.get(member);\n if (\n !noUninitializedPrivateFieldAccess ||\n !t.isCallExpression(getCall)\n ) {\n return getCall;\n }\n const ref = getCall.arguments.pop();\n getCall.arguments.push(template.expression.ast`(_) => ${ref} = _`);\n return t.memberExpression(\n t.callExpression(file.addHelper(\"toSetter\"), [getCall]),\n t.identifier(\"_\"),\n );\n }\n\n const setCall = this.set(member, t.identifier(\"_\"));\n if (\n !t.isCallExpression(setCall) ||\n !t.isIdentifier(setCall.arguments[setCall.arguments.length - 1], {\n name: \"_\",\n })\n ) {\n throw member.buildCodeFrameError(\n \"Internal Babel error while compiling this code. This is a Babel bug. \" +\n \"Please report it at https://github.com/babel/babel/issues.\",\n );\n }\n\n // someHelper(foo, bar, _) -> someHelper, [foo, bar]\n // aFn.call(foo, bar, _) -> aFn, [bar], foo\n let args: t.Expression[];\n if (\n t.isMemberExpression(setCall.callee, { computed: false }) &&\n t.isIdentifier(setCall.callee.property) &&\n setCall.callee.property.name === \"call\"\n ) {\n args = [\n // @ts-ignore(Babel 7 vs Babel 8) member.node.object is not t.Super\n setCall.callee.object,\n t.arrayExpression(\n // Remove '_'\n (setCall.arguments as t.Expression[]).slice(1, -1),\n ),\n setCall.arguments[0] as t.Expression,\n ];\n } else {\n args = [\n setCall.callee as t.Expression,\n t.arrayExpression(\n // Remove '_'\n (setCall.arguments as t.Expression[]).slice(0, -1),\n ),\n ];\n }\n\n return t.memberExpression(\n t.callExpression(file.addHelper(\"toSetter\"), args),\n t.identifier(\"_\"),\n );\n },\n\n call(member, args: (t.Expression | t.SpreadElement)[]) {\n // The first access (the get) should do the memo assignment.\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, false);\n },\n\n optionalCall(member, args: (t.Expression | t.SpreadElement)[]) {\n this.memoise(member, 1);\n\n return optimiseCall(this.get(member), this.receiver(member), args, true);\n },\n\n delete() {\n throw new Error(\n \"Internal Babel error: deleting private elements is a parsing error.\",\n );\n },\n };\n\nconst privateNameHandlerLoose: Handler = {\n get(member) {\n const { privateNamesMap, file } = this;\n const { object } = member.node;\n const { name } = (member.node.property as t.PrivateName).id;\n\n return template.expression`BASE(REF, PROP)[PROP]`({\n BASE: file.addHelper(\"classPrivateFieldLooseBase\"),\n REF: t.cloneNode(object),\n PROP: t.cloneNode(privateNamesMap.get(name).id),\n });\n },\n\n set() {\n // noop\n throw new Error(\"private name handler with loose = true don't need set()\");\n },\n\n boundGet(member) {\n return t.callExpression(\n t.memberExpression(this.get(member), t.identifier(\"bind\")),\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n [t.cloneNode(member.node.object as t.Expression)],\n );\n },\n\n simpleSet(member) {\n return this.get(member);\n },\n\n destructureSet(member) {\n return this.get(member);\n },\n\n call(member, args) {\n return t.callExpression(this.get(member), args);\n },\n\n optionalCall(member, args) {\n return t.optionalCallExpression(this.get(member), args, true);\n },\n\n delete() {\n throw new Error(\n \"Internal Babel error: deleting private elements is a parsing error.\",\n );\n },\n};\n\nexport function transformPrivateNamesUsage(\n ref: t.Identifier,\n path: NodePath,\n privateNamesMap: PrivateNamesMap,\n {\n privateFieldsAsProperties,\n noUninitializedPrivateFieldAccess,\n noDocumentAll,\n innerBinding,\n }: {\n privateFieldsAsProperties: boolean;\n noUninitializedPrivateFieldAccess: boolean;\n noDocumentAll: boolean;\n innerBinding: t.Identifier;\n },\n state: File,\n) {\n if (!privateNamesMap.size) return;\n\n const body = path.get(\"body\");\n const handler = privateFieldsAsProperties\n ? privateNameHandlerLoose\n : privateNameHandlerSpec;\n\n memberExpressionToFunctions(body, privateNameVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n ...handler,\n noDocumentAll,\n noUninitializedPrivateFieldAccess,\n innerBinding,\n });\n body.traverse(privateInVisitor, {\n privateNamesMap,\n classRef: ref,\n file: state,\n privateFieldsAsProperties,\n innerBinding,\n });\n}\n\nfunction buildPrivateFieldInitLoose(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${t.cloneNode(id)}, {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPrivateInstanceFieldInitSpec(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const { id } = privateNamesMap.get(prop.node.key.id.name);\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${t.cloneNode(id)}.set(${ref}, {\n // configurable is always false for private elements\n // enumerable is always false for private elements\n writable: true,\n value: ${value},\n })` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n t.expressionStatement(\n t.callExpression(helper, [\n t.thisExpression(),\n t.cloneNode(id),\n process.env.BABEL_8_BREAKING || newHelpers(state)\n ? value\n : template.expression.ast`{ writable: true, value: ${value} }`,\n ]),\n ),\n prop,\n );\n}\n\nfunction buildPrivateStaticFieldInitSpec(\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n noUninitializedPrivateFieldAccess: boolean,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n\n const value = noUninitializedPrivateFieldAccess\n ? prop.node.value\n : template.expression.ast`{\n _: ${prop.node.value || t.buildUndefinedNode()}\n }`;\n\n return inheritPropComments(\n t.variableDeclaration(\"var\", [\n t.variableDeclarator(t.cloneNode(privateName.id), value),\n ]),\n prop,\n );\n}\n\nif (!process.env.BABEL_8_BREAKING) {\n // eslint-disable-next-line no-var\n var buildPrivateStaticFieldInitSpecOld = function (\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n ) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId, initAdded } = privateName;\n const isGetterOrSetter = getId || setId;\n\n if (!prop.isProperty() && (initAdded || !isGetterOrSetter)) return;\n\n if (isGetterOrSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n }\n `,\n prop,\n );\n }\n\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n return inheritPropComments(\n template.statement.ast`\n var ${t.cloneNode(id)} = {\n // configurable is false by default\n // enumerable is false by default\n writable: true,\n value: ${value}\n };\n `,\n prop,\n );\n };\n}\n\nfunction buildPrivateMethodInitLoose(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { methodId, id, getId, setId, initAdded } = privateName;\n if (initAdded) return;\n\n if (methodId) {\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n const isGetterOrSetter = getId || setId;\n if (isGetterOrSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n}\n\nfunction buildPrivateInstanceMethodInitSpec(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n\n if (privateName.initAdded) return;\n\n if (!process.env.BABEL_8_BREAKING && !newHelpers(state)) {\n const isGetterOrSetter = privateName.getId || privateName.setId;\n if (isGetterOrSetter) {\n return buildPrivateAccessorInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n }\n }\n\n return buildPrivateInstanceMethodInitialization(\n ref,\n prop,\n privateNamesMap,\n state,\n );\n}\n\nfunction buildPrivateAccessorInitialization(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, getId, setId } = privateName;\n\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateFieldInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`\n ${id}.set(${ref}, {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n });\n ` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateFieldInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)},\n {\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n },\n )` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPrivateInstanceMethodInitialization(\n ref: t.Expression,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n state: File,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id } = privateName;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (!state.availableHelper(\"classPrivateMethodInitSpec\")) {\n return inheritPropComments(\n template.statement.ast`${id}.add(${ref})` as t.ExpressionStatement,\n prop,\n );\n }\n }\n\n const helper = state.addHelper(\"classPrivateMethodInitSpec\");\n return inheritPropComments(\n template.statement.ast`${helper}(\n ${t.thisExpression()},\n ${t.cloneNode(id)}\n )` as t.ExpressionStatement,\n prop,\n );\n}\n\nfunction buildPublicFieldInitLoose(\n ref: t.Expression,\n prop: NodePath,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.memberExpression(ref, key, computed || t.isLiteral(key)),\n value,\n ),\n ),\n prop,\n );\n}\n\nfunction buildPublicFieldInitSpec(\n ref: t.Expression,\n prop: NodePath,\n state: File,\n) {\n const { key, computed } = prop.node;\n const value = prop.node.value || prop.scope.buildUndefinedNode();\n\n return inheritPropComments(\n t.expressionStatement(\n t.callExpression(state.addHelper(\"defineProperty\"), [\n ref,\n computed || t.isLiteral(key)\n ? key\n : t.stringLiteral((key as t.Identifier).name),\n value,\n ]),\n ),\n prop,\n );\n}\n\nfunction buildPrivateStaticMethodInitLoose(\n ref: t.Expression,\n prop: NodePath,\n state: File,\n privateNamesMap: PrivateNamesMap,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const { id, methodId, getId, setId, initAdded } = privateName;\n\n if (initAdded) return;\n\n const isGetterOrSetter = getId || setId;\n if (isGetterOrSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n get: ${getId ? getId.name : prop.scope.buildUndefinedNode()},\n set: ${setId ? setId.name : prop.scope.buildUndefinedNode()}\n })\n `,\n prop,\n );\n }\n\n return inheritPropComments(\n template.statement.ast`\n Object.defineProperty(${ref}, ${id}, {\n // configurable is false by default\n // enumerable is false by default\n // writable is false by default\n value: ${methodId.name}\n });\n `,\n prop,\n );\n}\n\nfunction buildPrivateMethodDeclaration(\n file: File,\n prop: NodePath,\n privateNamesMap: PrivateNamesMap,\n privateFieldsAsSymbolsOrProperties = false,\n) {\n const privateName = privateNamesMap.get(prop.node.key.id.name);\n const {\n id,\n methodId,\n getId,\n setId,\n getterDeclared,\n setterDeclared,\n static: isStatic,\n } = privateName;\n const { params, body, generator, async } = prop.node;\n const isGetter = getId && params.length === 0;\n const isSetter = setId && params.length > 0;\n\n if ((isGetter && getterDeclared) || (isSetter && setterDeclared)) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n initAdded: true,\n });\n return null;\n }\n\n if (\n (process.env.BABEL_8_BREAKING || newHelpers(file)) &&\n (isGetter || isSetter) &&\n !privateFieldsAsSymbolsOrProperties\n ) {\n const scope = prop.get(\"body\").scope;\n const thisArg = scope.generateUidIdentifier(\"this\");\n const state: ReplaceThisState = {\n thisRef: thisArg,\n argumentsPath: [],\n };\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n prop.traverse(thisContextVisitor, state);\n if (state.argumentsPath.length) {\n const argumentsId = scope.generateUidIdentifier(\"arguments\");\n scope.push({\n id: argumentsId,\n init: template.expression.ast`[].slice.call(arguments, 1)`,\n });\n for (const path of state.argumentsPath) {\n path.replaceWith(t.cloneNode(argumentsId));\n }\n }\n\n params.unshift(t.cloneNode(thisArg));\n }\n\n let declId = methodId;\n\n if (isGetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n getterDeclared: true,\n initAdded: true,\n });\n declId = getId;\n } else if (isSetter) {\n privateNamesMap.set(prop.node.key.id.name, {\n ...privateName,\n setterDeclared: true,\n initAdded: true,\n });\n declId = setId;\n } else if (isStatic && !privateFieldsAsSymbolsOrProperties) {\n declId = id;\n }\n\n return inheritPropComments(\n t.functionDeclaration(\n t.cloneNode(declId),\n // @ts-expect-error params for ClassMethod has TSParameterProperty\n params,\n body,\n generator,\n async,\n ),\n prop,\n );\n}\n\ntype ReplaceThisState = {\n thisRef: t.Identifier;\n needsClassRef?: boolean;\n innerBinding?: t.Identifier | null;\n argumentsPath?: NodePath[];\n};\n\ntype ReplaceInnerBindingReferenceState = ReplaceThisState;\n\nconst thisContextVisitor = traverse.visitors.merge([\n {\n Identifier(path, state) {\n if (state.argumentsPath && path.node.name === \"arguments\") {\n state.argumentsPath.push(path);\n }\n },\n UnaryExpression(path) {\n // Replace `delete this` with `true`\n const { node } = path;\n if (node.operator === \"delete\") {\n const argument = skipTransparentExprWrapperNodes(node.argument);\n if (t.isThisExpression(argument)) {\n path.replaceWith(t.booleanLiteral(true));\n }\n }\n },\n ThisExpression(path, state) {\n state.needsClassRef = true;\n path.replaceWith(t.cloneNode(state.thisRef));\n },\n MetaProperty(path) {\n const { node, scope } = path;\n // if there are `new.target` in static field\n // we should replace it with `undefined`\n if (node.meta.name === \"new\" && node.property.name === \"target\") {\n path.replaceWith(scope.buildUndefinedNode());\n }\n },\n },\n environmentVisitor,\n]);\n\nconst innerReferencesVisitor: Visitor = {\n ReferencedIdentifier(path, state) {\n if (\n path.scope.bindingIdentifierEquals(path.node.name, state.innerBinding)\n ) {\n state.needsClassRef = true;\n path.node.name = state.thisRef.name;\n }\n },\n};\n\nfunction replaceThisContext(\n path: PropPath,\n ref: t.Identifier,\n innerBindingRef: t.Identifier | null,\n) {\n const state: ReplaceThisState = {\n thisRef: ref,\n needsClassRef: false,\n innerBinding: innerBindingRef,\n };\n if (!path.isMethod()) {\n // replace `this` in property initializers and static blocks\n path.traverse(thisContextVisitor, state);\n }\n\n // todo: use innerBinding.referencePaths to avoid full traversal\n if (\n innerBindingRef != null &&\n state.thisRef?.name &&\n state.thisRef.name !== innerBindingRef.name\n ) {\n path.traverse(innerReferencesVisitor, state);\n }\n\n return state.needsClassRef;\n}\n\nexport type PropNode =\n | t.ClassProperty\n | t.ClassPrivateMethod\n | t.ClassPrivateProperty\n | t.StaticBlock;\nexport type PropPath = NodePath;\n\nfunction isNameOrLength({ key, computed }: t.ClassProperty) {\n if (key.type === \"Identifier\") {\n return !computed && (key.name === \"name\" || key.name === \"length\");\n }\n if (key.type === \"StringLiteral\") {\n return key.value === \"name\" || key.value === \"length\";\n }\n return false;\n}\n\n/**\n * Inherit comments from class members. This is a reduced version of\n * t.inheritsComments: the trailing comments are not inherited because\n * for most class members except the last one, their trailing comments are\n * the next sibling's leading comments.\n *\n * @template T transformed class member type\n * @param {T} node transformed class member\n * @param {PropPath} prop class member\n * @returns transformed class member type with comments inherited\n */\nfunction inheritPropComments(node: T, prop: PropPath) {\n t.inheritLeadingComments(node, prop.node);\n t.inheritInnerComments(node, prop.node);\n return node;\n}\n\n/**\n * ClassRefFlag records the requirement of the class binding reference.\n *\n * @enum {number}\n */\nconst enum ClassRefFlag {\n None,\n /**\n * When this flag is enabled, the binding reference can be the class id,\n * if exists, or the uid identifier generated for class expression. The\n * reference is safe to be consumed by [[Define]].\n */\n ForDefine = 1 << 0,\n /**\n * When this flag is enabled, the reference must be a uid, because the outer\n * class binding can be mutated by user codes.\n * E.g.\n * class C { static p = C }; const oldC = C; C = null; oldC.p;\n * we must memoize class `C` before defining the property `p`.\n */\n ForInnerBinding = 1 << 1,\n}\n\nexport function buildFieldsInitNodes(\n ref: t.Identifier | null,\n superRef: t.Expression | undefined,\n props: PropPath[],\n privateNamesMap: PrivateNamesMap,\n file: File,\n setPublicClassFields: boolean,\n privateFieldsAsSymbolsOrProperties: boolean,\n noUninitializedPrivateFieldAccess: boolean,\n constantSuper: boolean,\n innerBindingRef: t.Identifier | null,\n) {\n let classRefFlags = ClassRefFlag.None;\n let injectSuperRef: t.Identifier;\n const staticNodes: t.Statement[] = [];\n const instanceNodes: t.ExpressionStatement[] = [];\n let lastInstanceNodeReturnsThis = false;\n // These nodes are pure and can be moved to the closest statement position\n const pureStaticNodes: t.FunctionDeclaration[] = [];\n let classBindingNode: t.ExpressionStatement | null = null;\n\n const getSuperRef = t.isIdentifier(superRef)\n ? () => superRef\n : () => {\n injectSuperRef ??=\n props[0].scope.generateUidIdentifierBasedOnNode(superRef);\n return injectSuperRef;\n };\n\n const classRefForInnerBinding =\n ref ??\n props[0].scope.generateUidIdentifier(innerBindingRef?.name || \"Class\");\n ref ??= t.cloneNode(innerBindingRef);\n\n for (const prop of props) {\n prop.isClassProperty() && ts.assertFieldTransformed(prop);\n\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n const isStatic = !t.isStaticBlock?.(prop.node) && prop.node.static;\n const isInstance = !isStatic;\n const isPrivate = prop.isPrivate();\n const isPublic = !isPrivate;\n const isField = prop.isProperty();\n const isMethod = !isField;\n const isStaticBlock = prop.isStaticBlock?.();\n\n if (isStatic) classRefFlags |= ClassRefFlag.ForDefine;\n\n if (isStatic || (isMethod && isPrivate) || isStaticBlock) {\n new ReplaceSupers({\n methodPath: prop,\n constantSuper,\n file: file,\n refToPreserve: innerBindingRef,\n getSuperRef,\n getObjectRef() {\n classRefFlags |= ClassRefFlag.ForInnerBinding;\n if (isStatic || isStaticBlock) {\n return classRefForInnerBinding;\n } else {\n return t.memberExpression(\n classRefForInnerBinding,\n t.identifier(\"prototype\"),\n );\n }\n },\n }).replace();\n\n const replaced = replaceThisContext(\n prop,\n classRefForInnerBinding,\n innerBindingRef,\n );\n if (replaced) {\n classRefFlags |= ClassRefFlag.ForInnerBinding;\n }\n }\n\n lastInstanceNodeReturnsThis = false;\n\n // TODO(ts): there are so many `ts-expect-error` inside cases since\n // ts can not infer type from pre-computed values (or a case test)\n // even change `isStaticBlock` to `t.isStaticBlock(prop)` will not make prop\n // a `NodePath`\n // this maybe a bug for ts\n switch (true) {\n case isStaticBlock: {\n const blockBody = (prop.node as t.StaticBlock).body;\n // We special-case the single expression case to avoid the iife, since\n // it's common.\n if (blockBody.length === 1 && t.isExpressionStatement(blockBody[0])) {\n staticNodes.push(inheritPropComments(blockBody[0], prop));\n } else {\n staticNodes.push(\n t.inheritsComments(\n template.statement.ast`(() => { ${blockBody} })()`,\n prop.node,\n ),\n );\n }\n break;\n }\n case isStatic &&\n isPrivate &&\n isField &&\n privateFieldsAsSymbolsOrProperties:\n staticNodes.push(\n buildPrivateFieldInitLoose(t.cloneNode(ref), prop, privateNamesMap),\n );\n break;\n case isStatic &&\n isPrivate &&\n isField &&\n !privateFieldsAsSymbolsOrProperties:\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n staticNodes.push(\n buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap),\n );\n } else {\n staticNodes.push(\n buildPrivateStaticFieldInitSpec(\n prop,\n privateNamesMap,\n noUninitializedPrivateFieldAccess,\n ),\n );\n }\n break;\n case isStatic && isPublic && isField && setPublicClassFields:\n // Functions always have non-writable .name and .length properties,\n // so we must always use [[Define]] for them.\n // It might still be possible to a computed static fields whose resulting\n // key is \"name\" or \"length\", but the assumption is telling us that it's\n // not going to happen.\n // @ts-expect-error checked in switch\n if (!isNameOrLength(prop.node)) {\n // @ts-expect-error checked in switch\n staticNodes.push(buildPublicFieldInitLoose(t.cloneNode(ref), prop));\n break;\n }\n // falls through\n case isStatic && isPublic && isField && !setPublicClassFields:\n staticNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.cloneNode(ref), prop, file),\n );\n break;\n case isInstance &&\n isPrivate &&\n isField &&\n privateFieldsAsSymbolsOrProperties:\n instanceNodes.push(\n buildPrivateFieldInitLoose(t.thisExpression(), prop, privateNamesMap),\n );\n break;\n case isInstance &&\n isPrivate &&\n isField &&\n !privateFieldsAsSymbolsOrProperties:\n instanceNodes.push(\n buildPrivateInstanceFieldInitSpec(\n t.thisExpression(),\n prop,\n privateNamesMap,\n file,\n ),\n );\n break;\n case isInstance &&\n isPrivate &&\n isMethod &&\n privateFieldsAsSymbolsOrProperties:\n instanceNodes.unshift(\n buildPrivateMethodInitLoose(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n file,\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsSymbolsOrProperties,\n ),\n );\n break;\n case isInstance &&\n isPrivate &&\n isMethod &&\n !privateFieldsAsSymbolsOrProperties:\n instanceNodes.unshift(\n buildPrivateInstanceMethodInitSpec(\n t.thisExpression(),\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n file,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n file,\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsSymbolsOrProperties,\n ),\n );\n break;\n case isStatic &&\n isPrivate &&\n isMethod &&\n !privateFieldsAsSymbolsOrProperties:\n if (!process.env.BABEL_8_BREAKING && !newHelpers(file)) {\n staticNodes.unshift(\n // @ts-expect-error checked in switch\n buildPrivateStaticFieldInitSpecOld(prop, privateNamesMap),\n );\n }\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n file,\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsSymbolsOrProperties,\n ),\n );\n break;\n case isStatic &&\n isPrivate &&\n isMethod &&\n privateFieldsAsSymbolsOrProperties:\n staticNodes.unshift(\n buildPrivateStaticMethodInitLoose(\n t.cloneNode(ref),\n // @ts-expect-error checked in switch\n prop,\n file,\n privateNamesMap,\n ),\n );\n pureStaticNodes.push(\n buildPrivateMethodDeclaration(\n file,\n // @ts-expect-error checked in switch\n prop,\n privateNamesMap,\n privateFieldsAsSymbolsOrProperties,\n ),\n );\n break;\n case isInstance && isPublic && isField && setPublicClassFields:\n // @ts-expect-error checked in switch\n instanceNodes.push(buildPublicFieldInitLoose(t.thisExpression(), prop));\n break;\n case isInstance && isPublic && isField && !setPublicClassFields:\n lastInstanceNodeReturnsThis = true;\n instanceNodes.push(\n // @ts-expect-error checked in switch\n buildPublicFieldInitSpec(t.thisExpression(), prop, file),\n );\n break;\n default:\n throw new Error(\"Unreachable.\");\n }\n }\n\n if (classRefFlags & ClassRefFlag.ForInnerBinding && innerBindingRef != null) {\n classBindingNode = t.expressionStatement(\n t.assignmentExpression(\n \"=\",\n t.cloneNode(classRefForInnerBinding),\n t.cloneNode(innerBindingRef),\n ),\n );\n }\n\n return {\n staticNodes: staticNodes.filter(Boolean),\n instanceNodes: instanceNodes.filter(Boolean),\n lastInstanceNodeReturnsThis,\n pureStaticNodes: pureStaticNodes.filter(Boolean),\n classBindingNode,\n wrapClass(path: NodePath) {\n for (const prop of props) {\n // Delete leading comments so that they don't get attached as\n // trailing comments of the previous sibling.\n // When transforming props, we explicitly attach their leading\n // comments to the transformed node with `inheritPropComments`\n // above.\n prop.node.leadingComments = null;\n prop.remove();\n }\n\n if (injectSuperRef) {\n path.scope.push({ id: t.cloneNode(injectSuperRef) });\n path.set(\n \"superClass\",\n t.assignmentExpression(\"=\", injectSuperRef, path.node.superClass),\n );\n }\n\n if (classRefFlags !== ClassRefFlag.None) {\n if (path.isClassExpression()) {\n path.scope.push({ id: ref });\n path.replaceWith(\n t.assignmentExpression(\"=\", t.cloneNode(ref), path.node),\n );\n } else {\n if (innerBindingRef == null) {\n // export anonymous class declaration\n path.node.id = ref;\n }\n if (classBindingNode != null) {\n path.scope.push({ id: classRefForInnerBinding });\n }\n }\n }\n\n return path;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,kCAAA,GAAAH,OAAA;AAKA,IAAAI,6BAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAL,OAAA;AACA,IAAAM,wCAAA,GAAAN,OAAA;AAEA,IAAAO,EAAA,GAAAP,OAAA;AAkBmC;EAEjC,IAAIQ,UAAU,GAAIC,IAAU,IAAK;IAAA;IAS/B,OAAOA,IAAI,CAACC,eAAe,CAAC,uBAAuB,CAAC;EACtD,CAAC;AACH;AAEO,SAASC,oBAAoBA,CAClCC,SAAiB,EACjBC,kCAA2C,EAC3CC,KAAiB,EACjBL,IAAU,EACV;EACA,MAAMM,eAAgC,GAAG,IAAIC,GAAG,CAAC,CAAC;EAClD,IAAIC,YAA0B;EAC9B,KAAK,MAAMC,IAAI,IAAIJ,KAAK,EAAE;IACxB,IAAII,IAAI,CAACC,SAAS,CAAC,CAAC,EAAE;MACpB,MAAM;QAAEC;MAAK,CAAC,GAAGF,IAAI,CAACG,IAAI,CAACC,GAAG,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AAwB,CAAC,CAAC;UAClD;QACF;MACF;MAEA,OAAOjJ,IAAI;IACb;EACF,CAAC;AACH"} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js index a73c0cb..8e33108 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js @@ -48,9 +48,10 @@ inherits, decoratorVersion }) { + var _api$assumption; if (feature & _features.FEATURES.decorators) { { - if (decoratorVersion === "2021-12" || decoratorVersion === "2022-03" || decoratorVersion === "2023-01" || decoratorVersion === "2023-05") { + if (decoratorVersion === "2023-11" || decoratorVersion === "2023-05" || decoratorVersion === "2023-01" || decoratorVersion === "2022-03" || decoratorVersion === "2021-12") { return (0, _decorators.default)(api, { loose }, decoratorVersion, inherits); @@ -66,6 +67,7 @@ const setPublicClassFields = api.assumption("setPublicClassFields"); const privateFieldsAsSymbols = api.assumption("privateFieldsAsSymbols"); const privateFieldsAsProperties = api.assumption("privateFieldsAsProperties"); + const noUninitializedPrivateFieldAccess = (_api$assumption = api.assumption("noUninitializedPrivateFieldAccess")) != null ? _api$assumption : false; const constantSuper = api.assumption("constantSuper"); const noDocumentAll = api.assumption("noDocumentAll"); if (privateFieldsAsProperties && privateFieldsAsSymbols) { @@ -95,12 +97,12 @@ (0, _features.enableFeature)(file, feature, loose); { if (typeof file.get(versionKey) === "number") { - file.set(versionKey, "7.23.10"); + file.set(versionKey, "7.24.0"); return; } } - if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.23.10")) { - file.set(versionKey, "7.23.10"); + if (!file.get(versionKey) || _semver.lt(file.get(versionKey), "7.24.0")) { + file.set(versionKey, "7.24.0"); } }, visitor: { @@ -108,7 +110,7 @@ file }) { var _ref; - if (file.get(versionKey) !== "7.23.10") return; + if (file.get(versionKey) !== "7.24.0") return; if (!(0, _features.shouldTransform)(path, file)) return; const pathIsClassDeclaration = path.isClassDeclaration(); if (pathIsClassDeclaration) (0, _typescript.assertFieldTransformed)(path); @@ -170,10 +172,11 @@ ref = path.scope.generateUidIdentifier((innerBinding == null ? void 0 : innerBinding.name) || "Class"); } const classRefForDefine = (_ref = ref) != null ? _ref : _core.types.cloneNode(innerBinding); - const privateNamesMap = (0, _fields.buildPrivateNamesMap)(props); + const privateNamesMap = (0, _fields.buildPrivateNamesMap)(classRefForDefine.name, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, props, file); const privateNamesNodes = (0, _fields.buildPrivateNamesNodes)(privateNamesMap, privateFieldsAsProperties != null ? privateFieldsAsProperties : loose, privateFieldsAsSymbols != null ? privateFieldsAsSymbols : false, file); (0, _fields.transformPrivateNamesUsage)(classRefForDefine, path, privateNamesMap, { privateFieldsAsProperties: privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, + noUninitializedPrivateFieldAccess, noDocumentAll, innerBinding }, file); @@ -194,7 +197,7 @@ lastInstanceNodeReturnsThis, classBindingNode, wrapClass - } = (0, _fields.buildFieldsInitNodes)(ref, path.node.superClass, props, privateNamesMap, file, setPublicClassFields != null ? setPublicClassFields : loose, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, constantSuper != null ? constantSuper : loose, innerBinding)); + } = (0, _fields.buildFieldsInitNodes)(ref, path.node.superClass, props, privateNamesMap, file, setPublicClassFields != null ? setPublicClassFields : loose, privateFieldsAsSymbolsOrProperties != null ? privateFieldsAsSymbolsOrProperties : loose, noUninitializedPrivateFieldAccess, constantSuper != null ? constantSuper : loose, innerBinding)); } } if (instanceNodes.length > 0) { @@ -224,7 +227,7 @@ file }) { { - if (file.get(versionKey) !== "7.23.10") return; + if (file.get(versionKey) !== "7.24.0") return; const decl = path.get("declaration"); if (decl.isClassDeclaration() && (0, _decorators2.hasDecorators)(decl.node)) { if (decl.node.id) { diff --git a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map index 50bc052..c4464ea 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map +++ b/node_modules/@babel/helper-create-class-features-plugin/lib/index.js.map @@ -1 +1 @@ -{"version":3,"names":["_core","require","_helperFunctionName","_helperSplitExportDeclaration","_decorators","_semver","_fields","_decorators2","_misc","_features","_typescript","versionKey","createClassFeaturePlugin","name","feature","loose","manipulateOptions","api","inherits","decoratorVersion","FEATURES","decorators","createDecoratorTransform","_api","assumption","setPublicClassFields","privateFieldsAsSymbols","privateFieldsAsProperties","constantSuper","noDocumentAll","Error","privateFieldsAsSymbolsOrProperties","explicit","undefined","push","length","console","warn","join","pre","file","enableFeature","get","set","semver","lt","visitor","Class","path","_ref","shouldTransform","pathIsClassDeclaration","isClassDeclaration","assertFieldTransformed","isLoose","constructor","isDecorated","hasDecorators","node","props","elements","computedPaths","privateNames","Set","body","isClassProperty","isClassMethod","computed","isPrivate","key","id","getName","setName","isClassPrivateMethod","kind","has","buildCodeFrameError","add","isProperty","isStaticBlock","innerBinding","ref","nameFunction","scope","generateUidIdentifier","classRefForDefine","t","cloneNode","privateNamesMap","buildPrivateNamesMap","privateNamesNodes","buildPrivateNamesNodes","transformPrivateNamesUsage","keysNodes","staticNodes","instanceNodes","lastInstanceNodeReturnsThis","pureStaticNodes","classBindingNode","wrapClass","buildDecoratedClass","extractComputedKeys","buildFieldsInitNodes","superClass","injectInitialization","referenceVisitor","state","prop","static","traverse","wrappedPath","insertBefore","insertAfter","find","parent","isStatement","isDeclaration","ExportDefaultDeclaration","decl","splitExportDeclaration","type"],"sources":["../src/index.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport type { PluginAPI, PluginObject } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport createDecoratorTransform from \"./decorators.ts\";\n\nimport semver from \"semver\";\n\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n buildCheckInRHS,\n} from \"./fields.ts\";\nimport type { PropPath } from \"./fields.ts\";\nimport { buildDecoratedClass, hasDecorators } from \"./decorators-2018-09.ts\";\nimport { injectInitialization, extractComputedKeys } from \"./misc.ts\";\nimport {\n enableFeature,\n FEATURES,\n isLoose,\n shouldTransform,\n} from \"./features.ts\";\nimport { assertFieldTransformed } from \"./typescript.ts\";\n\nexport { FEATURES, enableFeature, injectInitialization, buildCheckInRHS };\n\nconst versionKey = \"@babel/plugin-class-features/version\";\n\ninterface Options {\n name: string;\n feature: number;\n loose?: boolean;\n inherits?: PluginObject[\"inherits\"];\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n api?: PluginAPI;\n decoratorVersion?: \"2023-05\" | \"2023-01\" | \"2022-03\" | \"2021-12\" | \"2018-09\";\n}\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n api,\n inherits,\n decoratorVersion,\n}: Options): PluginObject {\n if (feature & FEATURES.decorators) {\n if (process.env.BABEL_8_BREAKING) {\n return createDecoratorTransform(api, { loose }, \"2023-05\", inherits);\n } else {\n if (\n decoratorVersion === \"2021-12\" ||\n decoratorVersion === \"2022-03\" ||\n decoratorVersion === \"2023-01\" ||\n decoratorVersion === \"2023-05\"\n ) {\n return createDecoratorTransform(\n api,\n { loose },\n decoratorVersion,\n inherits,\n );\n }\n }\n }\n if (!process.env.BABEL_8_BREAKING) {\n api ??= { assumption: () => void 0 as any } as any;\n }\n const setPublicClassFields = api.assumption(\"setPublicClassFields\");\n const privateFieldsAsSymbols = api.assumption(\"privateFieldsAsSymbols\");\n const privateFieldsAsProperties = api.assumption(\"privateFieldsAsProperties\");\n const constantSuper = api.assumption(\"constantSuper\");\n const noDocumentAll = api.assumption(\"noDocumentAll\");\n\n if (privateFieldsAsProperties && privateFieldsAsSymbols) {\n throw new Error(\n `Cannot enable both the \"privateFieldsAsProperties\" and ` +\n `\"privateFieldsAsSymbols\" assumptions as the same time.`,\n );\n }\n const privateFieldsAsSymbolsOrProperties =\n privateFieldsAsProperties || privateFieldsAsSymbols;\n\n if (loose === true) {\n type AssumptionName = Parameters[0];\n const explicit: `\"${AssumptionName}\"`[] = [];\n\n if (setPublicClassFields !== undefined) {\n explicit.push(`\"setPublicClassFields\"`);\n }\n if (privateFieldsAsProperties !== undefined) {\n explicit.push(`\"privateFieldsAsProperties\"`);\n }\n if (privateFieldsAsSymbols !== undefined) {\n explicit.push(`\"privateFieldsAsSymbols\"`);\n }\n if (explicit.length !== 0) {\n console.warn(\n `[${name}]: You are using the \"loose: true\" option and you are` +\n ` explicitly setting a value for the ${explicit.join(\" and \")}` +\n ` assumption${explicit.length > 1 ? \"s\" : \"\"}. The \"loose\" option` +\n ` can cause incompatibilities with the other class features` +\n ` plugins, so it's recommended that you replace it with the` +\n ` following top-level option:\\n` +\n `\\t\"assumptions\": {\\n` +\n `\\t\\t\"setPublicClassFields\": true,\\n` +\n `\\t\\t\"privateFieldsAsSymbols\": true\\n` +\n `\\t}`,\n );\n }\n }\n\n return {\n name,\n manipulateOptions,\n inherits,\n\n pre(file) {\n enableFeature(file, feature, loose);\n\n if (!process.env.BABEL_8_BREAKING) {\n // Until 7.21.4, we used to encode the version as a number.\n // If file.get(versionKey) is a number, it has thus been\n // set by an older version of this plugin.\n if (typeof file.get(versionKey) === \"number\") {\n file.set(versionKey, PACKAGE_JSON.version);\n return;\n }\n }\n if (\n !file.get(versionKey) ||\n semver.lt(file.get(versionKey), PACKAGE_JSON.version)\n ) {\n file.set(versionKey, PACKAGE_JSON.version);\n }\n },\n\n visitor: {\n Class(path, { file }) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n if (!shouldTransform(path, file)) return;\n\n const pathIsClassDeclaration = path.isClassDeclaration();\n\n if (pathIsClassDeclaration) assertFieldTransformed(path);\n\n const loose = isLoose(file, feature);\n\n let constructor: NodePath;\n const isDecorated = hasDecorators(path.node);\n const props: PropPath[] = [];\n const elements = [];\n const computedPaths: NodePath[] = [];\n const privateNames = new Set();\n const body = path.get(\"body\");\n\n for (const path of body.get(\"body\")) {\n if (\n // check path.node.computed is enough, but ts will complain\n (path.isClassProperty() || path.isClassMethod()) &&\n path.node.computed\n ) {\n computedPaths.push(path);\n }\n\n if (path.isPrivate()) {\n const { name } = path.node.key.id;\n const getName = `get ${name}`;\n const setName = `set ${name}`;\n\n if (path.isClassPrivateMethod()) {\n if (path.node.kind === \"get\") {\n if (\n privateNames.has(getName) ||\n (privateNames.has(name) && !privateNames.has(setName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(getName).add(name);\n } else if (path.node.kind === \"set\") {\n if (\n privateNames.has(setName) ||\n (privateNames.has(name) && !privateNames.has(getName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(setName).add(name);\n }\n } else {\n if (\n (privateNames.has(name) &&\n !privateNames.has(getName) &&\n !privateNames.has(setName)) ||\n (privateNames.has(name) &&\n (privateNames.has(getName) || privateNames.has(setName)))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(name);\n }\n }\n\n if (path.isClassMethod({ kind: \"constructor\" })) {\n constructor = path;\n } else {\n elements.push(path);\n if (\n path.isProperty() ||\n path.isPrivate() ||\n path.isStaticBlock?.()\n ) {\n props.push(path as PropPath);\n }\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (!props.length) return;\n } else {\n if (!props.length && !isDecorated) return;\n }\n\n const innerBinding = path.node.id;\n let ref: t.Identifier | null;\n if (!innerBinding || !pathIsClassDeclaration) {\n nameFunction(path);\n ref = path.scope.generateUidIdentifier(innerBinding?.name || \"Class\");\n }\n const classRefForDefine = ref ?? t.cloneNode(innerBinding);\n\n // NODE: These three functions don't support decorators yet,\n // but verifyUsedFeatures throws if there are both\n // decorators and private fields.\n const privateNamesMap = buildPrivateNamesMap(props);\n const privateNamesNodes = buildPrivateNamesNodes(\n privateNamesMap,\n privateFieldsAsProperties ?? loose,\n privateFieldsAsSymbols ?? false,\n file,\n );\n\n transformPrivateNamesUsage(\n classRefForDefine,\n path,\n privateNamesMap,\n {\n privateFieldsAsProperties:\n privateFieldsAsSymbolsOrProperties ?? loose,\n noDocumentAll,\n innerBinding,\n },\n file,\n );\n\n let keysNodes: t.Statement[],\n staticNodes: t.Statement[],\n instanceNodes: t.ExpressionStatement[],\n lastInstanceNodeReturnsThis: boolean,\n pureStaticNodes: t.FunctionDeclaration[],\n classBindingNode: t.Statement | null,\n wrapClass: (path: NodePath) => NodePath;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) {\n staticNodes = pureStaticNodes = keysNodes = [];\n ({ instanceNodes, wrapClass } = buildDecoratedClass(\n classRefForDefine,\n path,\n elements,\n file,\n ));\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n lastInstanceNodeReturnsThis,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n lastInstanceNodeReturnsThis,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n\n if (instanceNodes.length > 0) {\n injectInitialization(\n path,\n constructor,\n instanceNodes,\n (referenceVisitor, state) => {\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) return;\n }\n for (const prop of props) {\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n if (t.isStaticBlock?.(prop.node) || prop.node.static) continue;\n prop.traverse(referenceVisitor, state);\n }\n },\n lastInstanceNodeReturnsThis,\n );\n }\n\n // rename to make ts happy\n const wrappedPath = wrapClass(path);\n wrappedPath.insertBefore([...privateNamesNodes, ...keysNodes]);\n if (staticNodes.length > 0) {\n wrappedPath.insertAfter(staticNodes);\n }\n if (pureStaticNodes.length > 0) {\n wrappedPath\n .find(parent => parent.isStatement() || parent.isDeclaration())\n .insertAfter(pureStaticNodes);\n }\n if (classBindingNode != null && pathIsClassDeclaration) {\n wrappedPath.insertAfter(classBindingNode);\n }\n },\n\n ExportDefaultDeclaration(path, { file }) {\n if (!process.env.BABEL_8_BREAKING) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n const decl = path.get(\"declaration\");\n\n if (decl.isClassDeclaration() && hasDecorators(decl.node)) {\n if (decl.node.id) {\n // export default class Foo {}\n // -->\n // class Foo {} export { Foo as default }\n splitExportDeclaration(path);\n } else {\n // @ts-expect-error Anonymous class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAEA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAQA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,WAAA,GAAAT,OAAA;AAIA,MAAMU,UAAU,GAAG,sCAAsC;AAYlD,SAASC,wBAAwBA,CAAC;EACvCC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,iBAAiB;EACjBC,GAAG;EACHC,QAAQ;EACRC;AACO,C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GAAG,CAAC,EAAE;UAC1B2E,WAAW,CAACE,WAAW,CAAClB,WAAW,CAAC;QACtC;QACA,IAAIG,eAAe,CAAC9D,MAAM,GAAG,CAAC,EAAE;UAC9B2E,WAAW,CACRG,IAAI,CAACC,MAAM,IAAIA,MAAM,CAACC,WAAW,CAAC,CAAC,IAAID,MAAM,CAACE,aAAa,CAAC,CAAC,CAAC,CAC9DJ,WAAW,CAACf,eAAe,CAAC;QACjC;QACA,IAAIC,gBAAgB,IAAI,IAAI,IAAI/C,sBAAsB,EAAE;UACtD2D,WAAW,CAACE,WAAW,CAACd,gBAAgB,CAAC;QAC3C;MACF,CAAC;MAEDmB,wBAAwBA,CAACrE,IAAI,EAAE;QAAER;MAAK,CAAC,EAAE;QACJ;UACjC,IAAIA,IAAI,CAACE,GAAG,CAAC/B,UAAU,CAAC,cAAyB,EAAE;UAEnD,MAAM2G,IAAI,GAAGtE,IAAI,CAACN,GAAG,CAAC,aAAa,CAAC;UAEpC,IAAI4E,IAAI,CAAClE,kBAAkB,CAAC,CAAC,IAAI,IAAAK,0BAAa,EAAC6D,IAAI,CAAC5D,IAAI,CAAC,EAAE;YACzD,IAAI4D,IAAI,CAAC5D,IAAI,CAACY,EAAE,EAAE;cAIhB,IAAAiD,qCAAsB,EAACvE,IAAI,CAAC;YAC9B,CAAC,MAAM;cAGLsE,IAAI,CAAC5D,IAAI,CAAC8D,IAAI,GAAG,iBAAiB;YACpC;UACF;QACF;MACF;IACF;EACF,CAAC;AACH"} \ No newline at end of file +{"version":3,"names":["_core","require","_helperFunctionName","_helperSplitExportDeclaration","_decorators","_semver","_fields","_decorators2","_misc","_features","_typescript","versionKey","createClassFeaturePlugin","name","feature","loose","manipulateOptions","api","inherits","decoratorVersion","_api$assumption","FEATURES","decorators","createDecoratorTransform","_api","assumption","setPublicClassFields","privateFieldsAsSymbols","privateFieldsAsProperties","noUninitializedPrivateFieldAccess","constantSuper","noDocumentAll","Error","privateFieldsAsSymbolsOrProperties","explicit","undefined","push","length","console","warn","join","pre","file","enableFeature","get","set","semver","lt","visitor","Class","path","_ref","shouldTransform","pathIsClassDeclaration","isClassDeclaration","assertFieldTransformed","isLoose","constructor","isDecorated","hasDecorators","node","props","elements","computedPaths","privateNames","Set","body","isClassProperty","isClassMethod","computed","isPrivate","key","id","getName","setName","isClassPrivateMethod","kind","has","buildCodeFrameError","add","isProperty","isStaticBlock","innerBinding","ref","nameFunction","scope","generateUidIdentifier","classRefForDefine","t","cloneNode","privateNamesMap","buildPrivateNamesMap","privateNamesNodes","buildPrivateNamesNodes","transformPrivateNamesUsage","keysNodes","staticNodes","instanceNodes","lastInstanceNodeReturnsThis","pureStaticNodes","classBindingNode","wrapClass","buildDecoratedClass","extractComputedKeys","buildFieldsInitNodes","superClass","injectInitialization","referenceVisitor","state","prop","static","traverse","wrappedPath","insertBefore","insertAfter","find","parent","isStatement","isDeclaration","ExportDefaultDeclaration","decl","splitExportDeclaration","type"],"sources":["../src/index.ts"],"sourcesContent":["import { types as t } from \"@babel/core\";\nimport type { PluginAPI, PluginObject } from \"@babel/core\";\nimport type { NodePath } from \"@babel/traverse\";\nimport nameFunction from \"@babel/helper-function-name\";\nimport splitExportDeclaration from \"@babel/helper-split-export-declaration\";\nimport createDecoratorTransform from \"./decorators.ts\";\nimport type { DecoratorVersionKind } from \"./decorators.ts\";\n\nimport semver from \"semver\";\n\nimport {\n buildPrivateNamesNodes,\n buildPrivateNamesMap,\n transformPrivateNamesUsage,\n buildFieldsInitNodes,\n buildCheckInRHS,\n} from \"./fields.ts\";\nimport type { PropPath } from \"./fields.ts\";\nimport { buildDecoratedClass, hasDecorators } from \"./decorators-2018-09.ts\";\nimport { injectInitialization, extractComputedKeys } from \"./misc.ts\";\nimport {\n enableFeature,\n FEATURES,\n isLoose,\n shouldTransform,\n} from \"./features.ts\";\nimport { assertFieldTransformed } from \"./typescript.ts\";\n\nexport { FEATURES, enableFeature, injectInitialization, buildCheckInRHS };\n\nconst versionKey = \"@babel/plugin-class-features/version\";\n\ninterface Options {\n name: string;\n feature: number;\n loose?: boolean;\n inherits?: PluginObject[\"inherits\"];\n manipulateOptions?: PluginObject[\"manipulateOptions\"];\n api?: PluginAPI;\n decoratorVersion?: DecoratorVersionKind | \"2018-09\";\n}\n\nexport function createClassFeaturePlugin({\n name,\n feature,\n loose,\n manipulateOptions,\n api,\n inherits,\n decoratorVersion,\n}: Options): PluginObject {\n if (feature & FEATURES.decorators) {\n if (process.env.BABEL_8_BREAKING) {\n return createDecoratorTransform(api, { loose }, \"2023-11\", inherits);\n } else {\n if (\n decoratorVersion === \"2023-11\" ||\n decoratorVersion === \"2023-05\" ||\n decoratorVersion === \"2023-01\" ||\n decoratorVersion === \"2022-03\" ||\n decoratorVersion === \"2021-12\"\n ) {\n return createDecoratorTransform(\n api,\n { loose },\n decoratorVersion,\n inherits,\n );\n }\n }\n }\n if (!process.env.BABEL_8_BREAKING) {\n api ??= { assumption: () => void 0 as any } as any;\n }\n const setPublicClassFields = api.assumption(\"setPublicClassFields\");\n const privateFieldsAsSymbols = api.assumption(\"privateFieldsAsSymbols\");\n const privateFieldsAsProperties = api.assumption(\"privateFieldsAsProperties\");\n const noUninitializedPrivateFieldAccess =\n api.assumption(\"noUninitializedPrivateFieldAccess\") ?? false;\n const constantSuper = api.assumption(\"constantSuper\");\n const noDocumentAll = api.assumption(\"noDocumentAll\");\n\n if (privateFieldsAsProperties && privateFieldsAsSymbols) {\n throw new Error(\n `Cannot enable both the \"privateFieldsAsProperties\" and ` +\n `\"privateFieldsAsSymbols\" assumptions as the same time.`,\n );\n }\n const privateFieldsAsSymbolsOrProperties =\n privateFieldsAsProperties || privateFieldsAsSymbols;\n\n if (loose === true) {\n type AssumptionName = Parameters[0];\n const explicit: `\"${AssumptionName}\"`[] = [];\n\n if (setPublicClassFields !== undefined) {\n explicit.push(`\"setPublicClassFields\"`);\n }\n if (privateFieldsAsProperties !== undefined) {\n explicit.push(`\"privateFieldsAsProperties\"`);\n }\n if (privateFieldsAsSymbols !== undefined) {\n explicit.push(`\"privateFieldsAsSymbols\"`);\n }\n if (explicit.length !== 0) {\n console.warn(\n `[${name}]: You are using the \"loose: true\" option and you are` +\n ` explicitly setting a value for the ${explicit.join(\" and \")}` +\n ` assumption${explicit.length > 1 ? \"s\" : \"\"}. The \"loose\" option` +\n ` can cause incompatibilities with the other class features` +\n ` plugins, so it's recommended that you replace it with the` +\n ` following top-level option:\\n` +\n `\\t\"assumptions\": {\\n` +\n `\\t\\t\"setPublicClassFields\": true,\\n` +\n `\\t\\t\"privateFieldsAsSymbols\": true\\n` +\n `\\t}`,\n );\n }\n }\n\n return {\n name,\n manipulateOptions,\n inherits,\n\n pre(file) {\n enableFeature(file, feature, loose);\n\n if (!process.env.BABEL_8_BREAKING) {\n // Until 7.21.4, we used to encode the version as a number.\n // If file.get(versionKey) is a number, it has thus been\n // set by an older version of this plugin.\n if (typeof file.get(versionKey) === \"number\") {\n file.set(versionKey, PACKAGE_JSON.version);\n return;\n }\n }\n if (\n !file.get(versionKey) ||\n semver.lt(file.get(versionKey), PACKAGE_JSON.version)\n ) {\n file.set(versionKey, PACKAGE_JSON.version);\n }\n },\n\n visitor: {\n Class(path, { file }) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n if (!shouldTransform(path, file)) return;\n\n const pathIsClassDeclaration = path.isClassDeclaration();\n\n if (pathIsClassDeclaration) assertFieldTransformed(path);\n\n const loose = isLoose(file, feature);\n\n let constructor: NodePath;\n const isDecorated = hasDecorators(path.node);\n const props: PropPath[] = [];\n const elements = [];\n const computedPaths: NodePath[] = [];\n const privateNames = new Set();\n const body = path.get(\"body\");\n\n for (const path of body.get(\"body\")) {\n if (\n // check path.node.computed is enough, but ts will complain\n (path.isClassProperty() || path.isClassMethod()) &&\n path.node.computed\n ) {\n computedPaths.push(path);\n }\n\n if (path.isPrivate()) {\n const { name } = path.node.key.id;\n const getName = `get ${name}`;\n const setName = `set ${name}`;\n\n if (path.isClassPrivateMethod()) {\n if (path.node.kind === \"get\") {\n if (\n privateNames.has(getName) ||\n (privateNames.has(name) && !privateNames.has(setName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(getName).add(name);\n } else if (path.node.kind === \"set\") {\n if (\n privateNames.has(setName) ||\n (privateNames.has(name) && !privateNames.has(getName))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n privateNames.add(setName).add(name);\n }\n } else {\n if (\n (privateNames.has(name) &&\n !privateNames.has(getName) &&\n !privateNames.has(setName)) ||\n (privateNames.has(name) &&\n (privateNames.has(getName) || privateNames.has(setName)))\n ) {\n throw path.buildCodeFrameError(\"Duplicate private field\");\n }\n\n privateNames.add(name);\n }\n }\n\n if (path.isClassMethod({ kind: \"constructor\" })) {\n constructor = path;\n } else {\n elements.push(path);\n if (\n path.isProperty() ||\n path.isPrivate() ||\n path.isStaticBlock?.()\n ) {\n props.push(path as PropPath);\n }\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (!props.length) return;\n } else {\n if (!props.length && !isDecorated) return;\n }\n\n const innerBinding = path.node.id;\n let ref: t.Identifier | null;\n if (!innerBinding || !pathIsClassDeclaration) {\n nameFunction(path);\n ref = path.scope.generateUidIdentifier(innerBinding?.name || \"Class\");\n }\n const classRefForDefine = ref ?? t.cloneNode(innerBinding);\n\n const privateNamesMap = buildPrivateNamesMap(\n classRefForDefine.name,\n privateFieldsAsSymbolsOrProperties ?? loose,\n props,\n file,\n );\n const privateNamesNodes = buildPrivateNamesNodes(\n privateNamesMap,\n privateFieldsAsProperties ?? loose,\n privateFieldsAsSymbols ?? false,\n file,\n );\n\n transformPrivateNamesUsage(\n classRefForDefine,\n path,\n privateNamesMap,\n {\n privateFieldsAsProperties:\n privateFieldsAsSymbolsOrProperties ?? loose,\n noUninitializedPrivateFieldAccess,\n noDocumentAll,\n innerBinding,\n },\n file,\n );\n\n let keysNodes: t.Statement[],\n staticNodes: t.Statement[],\n instanceNodes: t.ExpressionStatement[],\n lastInstanceNodeReturnsThis: boolean,\n pureStaticNodes: t.FunctionDeclaration[],\n classBindingNode: t.Statement | null,\n wrapClass: (path: NodePath) => NodePath;\n\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) {\n staticNodes = pureStaticNodes = keysNodes = [];\n ({ instanceNodes, wrapClass } = buildDecoratedClass(\n classRefForDefine,\n path,\n elements,\n file,\n ));\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n lastInstanceNodeReturnsThis,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n noUninitializedPrivateFieldAccess,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n } else {\n keysNodes = extractComputedKeys(path, computedPaths, file);\n ({\n staticNodes,\n pureStaticNodes,\n instanceNodes,\n lastInstanceNodeReturnsThis,\n classBindingNode,\n wrapClass,\n } = buildFieldsInitNodes(\n ref,\n path.node.superClass,\n props,\n privateNamesMap,\n file,\n setPublicClassFields ?? loose,\n privateFieldsAsSymbolsOrProperties ?? loose,\n noUninitializedPrivateFieldAccess,\n constantSuper ?? loose,\n innerBinding,\n ));\n }\n\n if (instanceNodes.length > 0) {\n injectInitialization(\n path,\n constructor,\n instanceNodes,\n (referenceVisitor, state) => {\n if (!process.env.BABEL_8_BREAKING) {\n if (isDecorated) return;\n }\n for (const prop of props) {\n // @ts-expect-error: TS doesn't infer that prop.node is not a StaticBlock\n if (t.isStaticBlock?.(prop.node) || prop.node.static) continue;\n prop.traverse(referenceVisitor, state);\n }\n },\n lastInstanceNodeReturnsThis,\n );\n }\n\n // rename to make ts happy\n const wrappedPath = wrapClass(path);\n wrappedPath.insertBefore([...privateNamesNodes, ...keysNodes]);\n if (staticNodes.length > 0) {\n wrappedPath.insertAfter(staticNodes);\n }\n if (pureStaticNodes.length > 0) {\n wrappedPath\n .find(parent => parent.isStatement() || parent.isDeclaration())\n .insertAfter(pureStaticNodes);\n }\n if (classBindingNode != null && pathIsClassDeclaration) {\n wrappedPath.insertAfter(classBindingNode);\n }\n },\n\n ExportDefaultDeclaration(path, { file }) {\n if (!process.env.BABEL_8_BREAKING) {\n if (file.get(versionKey) !== PACKAGE_JSON.version) return;\n\n const decl = path.get(\"declaration\");\n\n if (decl.isClassDeclaration() && hasDecorators(decl.node)) {\n if (decl.node.id) {\n // export default class Foo {}\n // -->\n // class Foo {} export { Foo as default }\n splitExportDeclaration(path);\n } else {\n // @ts-expect-error Anonymous class declarations can be\n // transformed as if they were expressions\n decl.node.type = \"ClassExpression\";\n }\n }\n }\n },\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,6BAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAGA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,OAAA,GAAAL,OAAA;AAQA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAMA,IAAAS,WAAA,GAAAT,OAAA;AAIA,MAAMU,UAAU,GAAG,sCAAsC;AAYlD,SAASC,wBAAwBA,CAAC;EACvCC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,iBAAiB;EACjBC,GAAG;EACHC,QAAQ;EACRC;AACO,CAAC,EAAgB;EAAA,IAAAC,eAAA;EACxB,IAAIN,OAAO,GAAGO,kBAAQ,CAACC,UAAU,EAAE;IAG1B;MACL,IACEH,gBAAgB,KAAK,SAAS,IAC9BA,gBAAgB,KAAK,SAAS,IAC9BA,gBAAgB,KAAK,SAAS,IAC9BA,gBAAgB,KAAK,SAAS,IAC9BA,gBAAgB,KAAK,SAAS,EAC9B;QACA,OAAO,IAAAI,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,CAAC3D,MAAM,GAAG,CAAC,EAAE;UAC1B2E,WAAW,CAACE,WAAW,CAAClB,WAAW,CAAC;QACtC;QACA,IAAIG,eAAe,CAAC9D,MAAM,GAAG,CAAC,EAAE;UAC9B2E,WAAW,CACRG,IAAI,CAACC,MAAM,IAAIA,MAAM,CAACC,WAAW,CAAC,CAAC,IAAID,MAAM,CAACE,aAAa,CAAC,CAAC,CAAC,CAC9DJ,WAAW,CAACf,eAAe,CAAC;QACjC;QACA,IAAIC,gBAAgB,IAAI,IAAI,IAAI/C,sBAAsB,EAAE;UACtD2D,WAAW,CAACE,WAAW,CAACd,gBAAgB,CAAC;QAC3C;MACF,CAAC;MAEDmB,wBAAwBA,CAACrE,IAAI,EAAE;QAAER;MAAK,CAAC,EAAE;QACJ;UACjC,IAAIA,IAAI,CAACE,GAAG,CAACjC,UAAU,CAAC,aAAyB,EAAE;UAEnD,MAAM6G,IAAI,GAAGtE,IAAI,CAACN,GAAG,CAAC,aAAa,CAAC;UAEpC,IAAI4E,IAAI,CAAClE,kBAAkB,CAAC,CAAC,IAAI,IAAAK,0BAAa,EAAC6D,IAAI,CAAC5D,IAAI,CAAC,EAAE;YACzD,IAAI4D,IAAI,CAAC5D,IAAI,CAACY,EAAE,EAAE;cAIhB,IAAAiD,qCAAsB,EAACvE,IAAI,CAAC;YAC9B,CAAC,MAAM;cAGLsE,IAAI,CAAC5D,IAAI,CAAC8D,IAAI,GAAG,iBAAiB;YACpC;UACF;QACF;MACF;IACF;EACF,CAAC;AACH"} \ No newline at end of file diff --git a/node_modules/@babel/helper-create-class-features-plugin/package.json b/node_modules/@babel/helper-create-class-features-plugin/package.json index 726c1c8..08a17a0 100644 --- a/node_modules/@babel/helper-create-class-features-plugin/package.json +++ b/node_modules/@babel/helper-create-class-features-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@babel/helper-create-class-features-plugin", - "version": "7.23.10", + "version": "7.24.0", "author": "The Babel Team (https://babel.dev/team)", "license": "MIT", "description": "Compile class public and private fields, private methods and decorators to ES6", @@ -32,9 +32,9 @@ "@babel/core": "^7.0.0" }, "devDependencies": { - "@babel/core": "^7.23.9", + "@babel/core": "^7.24.0", "@babel/helper-plugin-test-runner": "^7.22.5", - "@babel/preset-env": "^7.23.9", + "@babel/preset-env": "^7.24.0", "@types/charcodes": "^0.2.0", "charcodes": "^0.2.0" }, diff --git a/node_modules/@babel/helper-plugin-utils/README.md b/node_modules/@babel/helper-plugin-utils/README.md index c17852d..a99070f 100644 --- a/node_modules/@babel/helper-plugin-utils/README.md +++ b/node_modules/@babel/helper-plugin-utils/README.md @@ -2,7 +2,7 @@ > General utilities for plugins to use -See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/en/babel-helper-plugin-utils) for more information. +See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/babel-helper-plugin-utils) for more information. ## Install diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js b/node_modules/@babel/helper-plugin-utils/lib/index.js index bad40f8..b8b7366 100644 --- a/node_modules/@babel/helper-plugin-utils/lib/index.js +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js @@ -33,21 +33,17 @@ return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname); }; } -const declarePreset = declare; -exports.declarePreset = declarePreset; +const declarePreset = exports.declarePreset = declare; function copyApiObject(api) { let proto = null; if (typeof api.version === "string" && /^7\./.test(api.version)) { proto = Object.getPrototypeOf(api); - if (proto && (!has(proto, "version") || !has(proto, "transform") || !has(proto, "template") || !has(proto, "types"))) { + if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) { proto = null; } } return Object.assign({}, proto, api); } -function has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} function throwVersionError(range, version) { if (typeof range === "number") { if (!Number.isInteger(range)) { diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js.map b/node_modules/@babel/helper-plugin-utils/lib/index.js.map index b5d1c6c..7675f57 100644 --- a/node_modules/@babel/helper-plugin-utils/lib/index.js.map +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js.map @@ -1 +1 @@ -{"version":3,"names":["apiPolyfills","assertVersion","api","range","throwVersionError","version","Object","assign","targets","assumption","undefined","declare","builder","options","dirname","_clonedApi2","clonedApi","name","keys","_clonedApi","copyApiObject","declarePreset","exports","proto","test","getPrototypeOf","has","obj","key","prototype","hasOwnProperty","call","Number","isInteger","Error","limit","stackTraceLimit","err","slice","code"],"sources":["../src/index.ts"],"sourcesContent":["import type {\n PluginAPI,\n PluginObject,\n PluginPass,\n PresetAPI,\n PresetObject,\n} from \"@babel/core\";\n\ntype APIPolyfillFactory = (\n api: PluginAPI,\n) => PluginAPI[T];\n\ntype APIPolyfills = {\n assertVersion: APIPolyfillFactory<\"assertVersion\">;\n};\n\nconst apiPolyfills: APIPolyfills = {\n // Not supported by Babel 7 and early versions of Babel 7 beta.\n // It's important that this is polyfilled for older Babel versions\n // since it's needed to report the version mismatch.\n assertVersion: (api: PluginAPI) => (range: number | string) => {\n throwVersionError(range, api.version);\n },\n};\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(apiPolyfills, {\n // This is supported starting from Babel 7.13\n targets: () => () => {\n return {};\n },\n // This is supported starting from Babel 7.13\n assumption: () => () => {\n return undefined;\n },\n });\n}\n\nexport function declare(\n builder: (\n api: PluginAPI,\n options: Option,\n dirname: string,\n ) => PluginObject,\n): (\n api: PluginAPI,\n options: Option,\n dirname: string,\n) => PluginObject {\n return (api, options: Option, dirname: string) => {\n let clonedApi: PluginAPI;\n\n for (const name of Object.keys(\n apiPolyfills,\n ) as (keyof typeof apiPolyfills)[]) {\n if (api[name]) continue;\n\n clonedApi ??= copyApiObject(api);\n clonedApi[name] = apiPolyfills[name](clonedApi);\n }\n\n // @ts-expect-error options || {} may not be assigned to Options\n return builder(clonedApi ?? api, options || {}, dirname);\n };\n}\n\nexport const declarePreset = declare as