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AGb,C,GCpBI6C,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaE,QAGrB,IAAIC,EAASN,EAAyBE,GAAY,CAGjDG,QAAS,CAAC,GAOX,OAHAE,EAAoBL,GAAUM,KAAKF,EAAOD,QAASC,EAAQA,EAAOD,QAASJ,GAGpEK,EAAOD,OACf,E,WCpBA,eACA,SACA,SACA,SAGAhE,OAAOoE,OAAOC,KAAKC,WAAU,WACzBtE,OAAOC,iBAAiB,kBAAqBsB,GAAiB,IAAI,EAAAgD,6BAA6BhD,IAC/F,IAAAiD,+BACA,IAAAC,YACA,IAAAC,mBACJ,G","sources":["webpack://playme_npm_config/./Resources/Scripts/navigation.ts","webpack://playme_npm_config/./Controls/PostBackHandlers/LoadingPostBackHandler.ts","webpack://playme_npm_config/./Controls/PostBackHandlers/ConfirmDialogPostbackHandler.ts","webpack://playme_npm_config/./Resources/Scripts/calendar-toggle.ts","webpack://playme_npm_config/webpack/bootstrap","webpack://playme_npm_config/./Resources/Scripts/init.ts"],"sourcesContent":["const menuBtn = document.getElementById('menuBtn') as HTMLButtonElement\r\nconst menu = document.querySelector('.nav__menu') as HTMLDivElement\r\nconst nav = document.querySelector('nav')\r\nconst navItems = document.querySelectorAll('.nav__item')\r\nconst htmlDoc = document.querySelector('body')\r\n\r\nfunction toggleOpenMenuClasses() {\r\n menuBtn.classList.toggle('burger--open')\r\n menu.classList.toggle('nav__menu--open')\r\n nav.classList.toggle('nav--open')\r\n htmlDoc.classList.toggle('overflow-hidden')\r\n}\r\n\r\nexport function initNav() {\r\n menuBtn.addEventListener('click', () => {\r\n toggleOpenMenuClasses()\r\n })\r\n\r\n navItems.forEach(navItems => {\r\n navItems.addEventListener('click', () => {\r\n toggleOpenMenuClasses()\r\n })\r\n })\r\n}","export function initLoadingPostBackHandler() {\r\n const pendingClassName = 'button--loading';\r\n const successClassName = 'button--success';\r\n const failClassName = 'button--fail';\r\n const stateDuration = 2000;\r\n dotvvm.postbackHandlers[\"loading-style-postback-handler\"] = handlerOptions => ({\r\n async execute(callback, postbackOptions) {\r\n const button = (postbackOptions.sender as HTMLButtonElement);\r\n const showError = () => {\r\n button.classList.remove(pendingClassName);\r\n button.classList.add(failClassName);\r\n window.setTimeout(() => button.classList.remove(failClassName), stateDuration);\r\n };\r\n const showSuccess = () => {\r\n button.classList.remove(pendingClassName);\r\n button.classList.add(successClassName);\r\n return window.setTimeout(() => button.classList.remove(successClassName), stateDuration);\r\n };\r\n const handleException = e => {\r\n if (e.error === 'redirect') {\r\n showSuccess();\r\n } else if (e.error && e.error.message == \"Invalid action validationErrors\") {\r\n // ignore\r\n } else {\r\n console.error(e);\r\n showError();\r\n }\r\n };\r\n try {\r\n button.classList.add(pendingClassName);\r\n const postbackCommit = await callback();\r\n const removeSuccessTimeout = showSuccess();\r\n return (async () => {\r\n try {\r\n clearTimeout(removeSuccessTimeout);\r\n button.classList.remove(successClassName);\r\n button.classList.add(pendingClassName);\r\n const postbackResult = await postbackCommit();\r\n showSuccess();\r\n return postbackResult;\r\n } catch (e) {\r\n handleException(e);\r\n throw e;\r\n }\r\n });\r\n } catch (e) {\r\n handleException(e);\r\n throw e;\r\n }\r\n }\r\n });\r\n}","export class ConfirmDialogPostbackHandler {\r\n constructor(public options: any) { }\r\n before: string[] = [\"setIsPostbackRunning\"]\r\n execute(callback: () => Promise, postBackOptions: any): Promise {\r\n return new Promise((resolve, reject) => {\r\n //checks if the confirm dialog with that id is already in the viewmodel\r\n if (!(\"ConfirmDialog\" in dotvvm.state)) {\r\n throw new Error(\"The ConfirmDialog property in the root viewmodel was not found!\");\r\n }\r\n const dialog = document.getElementById(\"confirmDialog\");\r\n if (!dialog) {\r\n throw new Error(\"The dialog with ID=confirmDialog was not found in the page!\");\r\n }\r\n // show dialog\r\n dotvvm.patchState({\r\n ConfirmDialog: {\r\n IsVisible: true,\r\n Title: this.options.title,\r\n MessageHtml: this.options.messageHtml,\r\n Type: this.options.type,\r\n AcceptButtonText: this.options.acceptButtonText,\r\n CancelButtonText: this.options.cancelButtonText\r\n }\r\n });\r\n // bind handlers\r\n const acceptButton = dialog.querySelector(\"#acceptBtn\");\r\n acceptButton.addEventListener(\"click\", onAccepted);\r\n const cancelButton = dialog.querySelector(\"#cancelBtn\");\r\n cancelButton.addEventListener(\"click\", onCancelled);\r\n function onAccepted() {\r\n resolve(void 0);\r\n hideDialog();\r\n }\r\n function onCancelled() {\r\n hideDialog();\r\n reject(void 0);\r\n }\r\n function hideDialog() {\r\n // hide dialog\r\n dotvvm.patchState({\r\n ConfirmDialog: {\r\n IsVisible: false\r\n }\r\n });\r\n // unbind handlers\r\n acceptButton.removeEventListener(\"click\", onAccepted);\r\n cancelButton.removeEventListener(\"click\", onCancelled);\r\n }\r\n }).then(() => callback());\r\n }\r\n}","\r\nexport function initCalendarView() {\r\n const view = document.querySelector('.calendar') as HTMLDivElement;\r\n const toggleView = document.getElementById('toggleView') as HTMLButtonElement;\r\n\r\n if (toggleView) {\r\n toggleView.addEventListener('click',\r\n () => {\r\n toggleView.classList.toggle('toggleView--active');\r\n view.classList.toggle('calendar--compact-view');\r\n });\r\n }\r\n\r\n try {\r\n if (dotvvm.viewModels.root.viewModel.IsToggleEnabled()) {\r\n toggleView.classList.toggle('toggleView--active');\r\n view.classList.toggle('calendar--compact-view');\r\n }\r\n } catch (e) {\r\n\r\n }\r\n}","// 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].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","/// \r\n\r\nimport { initCalendarView } from \"./calendar-toggle\";\r\nimport { initNav } from \"./navigation\";\r\nimport { ConfirmDialogPostbackHandler } from '../../Controls/PostBackHandlers/ConfirmDialogPostbackHandler';\r\nimport { initLoadingPostBackHandler } from '../../Controls/PostBackHandlers/LoadingPostBackHandler';\r\n\r\n\r\ndotvvm.events.init.subscribe(function () {\r\n dotvvm.postbackHandlers[\"confirm-dialog\"] = (options: any) => new ConfirmDialogPostbackHandler(options);\r\n initLoadingPostBackHandler();\r\n initNav();\r\n initCalendarView();\r\n});\r\n\r\n"],"names":["menuBtn","document","getElementById","menu","querySelector","nav","navItems","querySelectorAll","htmlDoc","toggleOpenMenuClasses","classList","toggle","addEventListener","forEach","pendingClassName","successClassName","failClassName","dotvvm","postbackHandlers","handlerOptions","execute","callback","postbackOptions","button","sender","showSuccess","remove","add","window","setTimeout","handleException","e","error","message","console","postbackCommit","removeSuccessTimeout","clearTimeout","postbackResult","constructor","options","before","postBackOptions","Promise","resolve","reject","state","Error","dialog","patchState","ConfirmDialog","IsVisible","Title","this","title","MessageHtml","messageHtml","Type","type","AcceptButtonText","acceptButtonText","CancelButtonText","cancelButtonText","acceptButton","onAccepted","cancelButton","hideDialog","onCancelled","removeEventListener","then","view","toggleView","viewModels","root","viewModel","IsToggleEnabled","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","call","events","init","subscribe","ConfirmDialogPostbackHandler","initLoadingPostBackHandler","initNav","initCalendarView"],"sourceRoot":""}