NetCoreTemplate/APP_WEB/wwwroot/js/app.min.js
Dvurechensky 1bd84ca8d2 1.0.2
Correct ts
2025-03-02 22:30:02 +03:00

146 lines
24 KiB
JavaScript

/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts":
/*!******************************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts ***!
\******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Alerts: () => (/* binding */ Alerts),\n/* harmony export */ TypeAlert: () => (/* binding */ TypeAlert)\n/* harmony export */ });\nclass Alerts {\n AlertShow(notification) {\n const container = document.getElementById('notification-container');\n if (!container)\n return;\n const newNotification = document.createElement('div');\n newNotification.classList.add('notification');\n switch (notification.type) {\n case TypeAlert.Error:\n newNotification.classList.add('error_alert_animate');\n break;\n case TypeAlert.Ok:\n newNotification.classList.add('ok_alert_animate');\n break;\n case TypeAlert.Warning:\n newNotification.classList.add('warning_alert_animate');\n break;\n }\n newNotification.textContent = notification.text;\n container.appendChild(newNotification);\n newNotification.classList.add('puff-in-center');\n setTimeout(() => {\n newNotification.remove();\n }, notification.duration * 1000);\n }\n}\nvar TypeAlert;\n(function (TypeAlert) {\n TypeAlert[\"Error\"] = \"error\";\n TypeAlert[\"Warning\"] = \"warning\";\n TypeAlert[\"Ok\"] = \"ok\";\n})(TypeAlert || (TypeAlert = {}));\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/Base/Services/Cookies.ts":
/*!************************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Base/Services/Cookies.ts ***!
\************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Cookies: () => (/* binding */ Cookies)\n/* harmony export */ });\nclass Cookies {\n getCookie(cookieName) {\n const name = cookieName + \"=\";\n const decodedCookie = decodeURIComponent(document.cookie);\n const ca = decodedCookie.split(\";\");\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === \" \") {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }\n setCookie(name, value, days) {\n const date = new Date();\n date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);\n document.cookie = name + \"=\" + encodeURIComponent(value) + \";expires=\" + date.toUTCString() + \";path=/;secure\";\n }\n removeCookie(name) {\n document.cookie = name + \"=;Max-Age=-99999999;\";\n }\n}\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Base/Services/Cookies.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/Base/Services/Utilities.ts":
/*!**************************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Base/Services/Utilities.ts ***!
\**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Utilities: () => (/* binding */ Utilities)\n/* harmony export */ });\n/* harmony import */ var _Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Alerts/Alerts */ \"./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Utilities {\n constructor() {\n this.Alerts = new _Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__.Alerts();\n }\n isEmpty(value) {\n if (value == null)\n return true;\n if (value === \"\")\n return true;\n return false;\n }\n setInputWarning(input) {\n input.classList.add(\"warning_input\");\n const timeout = setTimeout(() => {\n input.classList.remove(\"warning_input\");\n clearTimeout(timeout);\n }, 3000);\n }\n setAreaWarning(input) {\n input.classList.add(\"warning_area\");\n const timeout = setTimeout(() => {\n input.classList.remove(\"warning_area\");\n clearTimeout(timeout);\n }, 3000);\n }\n isValidEmail(email) {\n if (this.isEmpty(email))\n return false;\n const pattern = /^([a-z0-9_.-])+@[a-z0-9-]+\\.([a-z]{2,4}\\.)?[a-z]{2,4}$/i;\n return pattern.test(email);\n }\n doDelay(mlsec) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(null);\n }, mlsec);\n });\n });\n }\n get getWidh() {\n return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n }\n get getHeight() {\n return window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n }\n getRandomInt(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }\n copyValueToBuffer(value, element) {\n try {\n const coord = element.getBoundingClientRect();\n const scrolled = window.pageYOffset || document.documentElement.scrollTop;\n const iOsDevice = navigator.userAgent.match(/ipad|iphone/i);\n const textArea = document.createElement(\"textarea\");\n textArea.readOnly = true;\n textArea.style.top = `${Math.round(scrolled + coord.top)}px`;\n textArea.classList.add(\"text_copy\");\n textArea.value = value;\n document.body.appendChild(textArea);\n textArea.focus();\n if (iOsDevice) {\n const editable = textArea.contentEditable;\n const readOnly = textArea.readOnly;\n textArea.contentEditable = \"true\";\n textArea.readOnly = false;\n const range = document.createRange();\n range.selectNodeContents(textArea);\n const selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n textArea.setSelectionRange(0, 999999);\n textArea.contentEditable = editable;\n textArea.readOnly = readOnly;\n }\n else {\n textArea.select();\n }\n const resultCopy = document.execCommand(\"copy\");\n document.body.removeChild(textArea);\n return resultCopy;\n }\n catch (e) {\n console.error(\"Error: \", e);\n return false;\n }\n }\n getCurrentDate() {\n const date = new Date();\n const nowDay = date.getDate();\n const nowMonth = date.getMonth() + 1;\n let forFullDay = \"\";\n if (nowDay < 10) {\n forFullDay = \"0\";\n }\n let forFullMonth = \"\";\n if (nowMonth < 10) {\n forFullMonth = \"0\";\n }\n return `${forFullDay}${nowDay}.${forFullMonth}${nowMonth}.${date.getFullYear()}`;\n }\n stringToBoolean(str) {\n const lowerStr = str.toLowerCase();\n if (lowerStr === \"true\") {\n return true;\n }\n else if (lowerStr === \"false\") {\n return false;\n }\n else {\n return null;\n }\n }\n generateUuid() {\n var d = new Date().getTime();\n var d2 = ((typeof performance !== \"undefined\") && performance.now && (performance.now() * 1000)) || 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, c => {\n var r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n }\n else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : (r & 0x3 | 0x8)).toString(16);\n });\n }\n}\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Base/Services/Utilities.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/Pages/Base/BasePage.ts":
/*!**********************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Pages/Base/BasePage.ts ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BasePage: () => (/* binding */ BasePage)\n/* harmony export */ });\n/* harmony import */ var _Base_Services_Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../Base/Services/Alerts/Alerts */ \"./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass BasePage {\n constructor(utilities, cookies, alerts) {\n this.Utilities = utilities;\n this.Cookies = cookies;\n this.Alerts = alerts;\n }\n set PageReadyState(state) {\n if (this.readyState !== state) {\n this.readyState = state;\n const event = new CustomEvent('pageStateChanged', {\n detail: {\n stateName: 'ReadyState',\n stateValue: state\n }\n });\n window.dispatchEvent(event);\n }\n }\n get PageReadyState() {\n return this.readyState;\n }\n WaitForReadyState(conditions, actions) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => {\n const intervalId = setInterval(() => {\n const allConditionsMet = conditions.every(condition => condition === true);\n if (allConditionsMet) {\n clearInterval(intervalId);\n if (allConditionsMet) {\n this.PageReadyState = true;\n actions.forEach(action => {\n action();\n });\n const alert = {\n text: \"Страница успешно запущена\",\n type: _Base_Services_Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__.TypeAlert.Ok,\n duration: 2\n };\n this.Alerts.AlertShow(alert);\n resolve({ states: conditions });\n }\n else {\n console.log(\"Состояния еще не доступны или не достигнута готовность...\");\n }\n }\n }, 100);\n });\n });\n }\n}\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Pages/Base/BasePage.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/Pages/Contacts.ts":
/*!*****************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Pages/Contacts.ts ***!
\*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ContactPage: () => (/* binding */ ContactPage)\n/* harmony export */ });\n/* harmony import */ var _Base_BasePage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Base/BasePage */ \"./ScriptsAndCss/TypeScripts/Pages/Base/BasePage.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass ContactPage extends _Base_BasePage__WEBPACK_IMPORTED_MODULE_0__.BasePage {\n StartPage() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.WaitForReadyState([true], [this.PostEventLoad]);\n });\n }\n PostEventLoad() {\n console.log(\"Contact post event...\");\n }\n}\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Pages/Contacts.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/Pages/IndexPage.ts":
/*!******************************************************!*\
!*** ./ScriptsAndCss/TypeScripts/Pages/IndexPage.ts ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IndexPage: () => (/* binding */ IndexPage)\n/* harmony export */ });\n/* harmony import */ var _Base_BasePage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Base/BasePage */ \"./ScriptsAndCss/TypeScripts/Pages/Base/BasePage.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass IndexPage extends _Base_BasePage__WEBPACK_IMPORTED_MODULE_0__.BasePage {\n StartPage() {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.WaitForReadyState([true], [this.PostEventLoad]);\n });\n }\n PostEventLoad() {\n console.log(\"Index post event...\");\n }\n}\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/Pages/IndexPage.ts?");
/***/ }),
/***/ "./ScriptsAndCss/TypeScripts/main_api.ts":
/*!***********************************************!*\
!*** ./ScriptsAndCss/TypeScripts/main_api.ts ***!
\***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Base_Services_Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Base/Services/Alerts/Alerts */ \"./ScriptsAndCss/TypeScripts/Base/Services/Alerts/Alerts.ts\");\n/* harmony import */ var _Base_Services_Cookies__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Base/Services/Cookies */ \"./ScriptsAndCss/TypeScripts/Base/Services/Cookies.ts\");\n/* harmony import */ var _Base_Services_Utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Base/Services/Utilities */ \"./ScriptsAndCss/TypeScripts/Base/Services/Utilities.ts\");\n/* harmony import */ var _Pages_Contacts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Pages/Contacts */ \"./ScriptsAndCss/TypeScripts/Pages/Contacts.ts\");\n/* harmony import */ var _Pages_IndexPage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Pages/IndexPage */ \"./ScriptsAndCss/TypeScripts/Pages/IndexPage.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n(() => {\n window.addEventListener(\"load\", () => __awaiter(void 0, void 0, void 0, function* () {\n const utilities = new _Base_Services_Utilities__WEBPACK_IMPORTED_MODULE_2__.Utilities();\n const cookies = new _Base_Services_Cookies__WEBPACK_IMPORTED_MODULE_1__.Cookies();\n const alerts = new _Base_Services_Alerts_Alerts__WEBPACK_IMPORTED_MODULE_0__.Alerts();\n const currentUrl = new URL(document.location.href);\n const pathname = currentUrl.pathname.toLowerCase();\n const partsPath = pathname.split(\"/\");\n let indexPageState = {\n ReadyState: undefined\n };\n window.addEventListener('pageStateChanged', function (event) {\n const stateName = event.detail.stateName;\n const stateValue = event.detail.stateValue;\n if (stateName === 'ReadyState') {\n indexPageState.ReadyState = stateValue;\n }\n CheckStatesAndProceed();\n });\n switch (partsPath[1]) {\n case \"\":\n {\n const page = new _Pages_IndexPage__WEBPACK_IMPORTED_MODULE_4__.IndexPage(utilities, cookies, alerts);\n yield page.StartPage();\n }\n break;\n case \"contacts\":\n {\n const page = new _Pages_Contacts__WEBPACK_IMPORTED_MODULE_3__.ContactPage(utilities, cookies, alerts);\n yield page.StartPage();\n }\n break;\n default:\n break;\n }\n function CheckStatesAndProceed() {\n if (indexPageState.ReadyState !== undefined) {\n if (indexPageState.ReadyState) {\n console.log(\"Success Start Page\");\n }\n else {\n console.log(\"Wait Load Page\");\n }\n }\n }\n }));\n})();\n\n\n//# sourceURL=webpack://asp.net/./ScriptsAndCss/TypeScripts/main_api.ts?");
/***/ })
/******/ });
/************************************************************************/
/******/ // 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 });
/******/ };
/******/ })();
/******/
/************************************************************************/
/******/
/******/ // startup
/******/ // Load entry module and return exports
/******/ // This entry module can't be inlined because the eval devtool is used.
/******/ var __webpack_exports__ = __webpack_require__("./ScriptsAndCss/TypeScripts/main_api.ts");
/******/
/******/ })()
;