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obal","data_element","sentry_dsn","app_version","rails_env_from_data","event","regex","PerformanceTracking","SimplePerformanceMetric","loadPolyfillsSometimes","dynamicImportWithRetry","__vitePreload","module","I18n","e","markI18nAsReady","es6_start","VueSemiAutoInit","_a"],"ignoreList":[],"sources":["../../../app/assets/entrypoints/apps__spacious_website__application.js"],"sourcesContent":["\nimport { dynamicImportWithRetry } from \"@fatso83/retry-dynamic-import\"\n\n// Since built script contains strange symbol polyfill\n// We must load our polyfill before they script\nimport \"core-js/modules/es.symbol\"\nimport \"core-js/modules/es.array.includes\"\n\nimport \"plugins/modernizr/modernizr-custom\"\n\n// Required since dynamic import is expecting `Promise` in `window`\nimport \"core-js/modules/es.promise\"\n\nimport {\n SimplePerformanceMetric,\n} from \"plugins/@figliolia/metrics\"\n\nimport * as SentryGlobal from \"@sentry/browser\"\n\nimport {\n performance,\n} from \"plugins/user-timing-polyfill\"\nimport PerformanceTracking from \"apps/spacious_website/performance/tracking\"\n\nimport {\n captureException,\n} from \"app/error_reporting\"\n\nimport { markI18nAsReady } from \"plugins/i18n-js/state\"\n\n// Change the path for different page type\nimport Application from \"application/index\"\nwindow.App_Authentication_Manager = Application.App_Authentication_Manager\n\nimport { loadPolyfillsSometimes } from \"apps/spacious_website/polyfills\"\n\n// region prevent HMR causing full reload\n\n// Workaround from https://github.com/vitejs/vite/issues/6695#issuecomment-1069522995\nif (import.meta.hot) {\n import.meta.hot.on('vite:beforeFullReload', () => {\n throw '(skipping full reload)'\n })\n}\n\n// endregion prevent HMR causing full reload\n\n\nfunction initalizeSentry() {\n const Sentry = SentryGlobal\n\n // This can still be `null` sometimes\n // Just ignore those strange cases\n const data_element = document.getElementById(\"app-data-container\")\n if (data_element == null) { return }\n\n const sentry_dsn = data_element.getAttribute(\"data-sentry-dsn\")\n const app_version = data_element.getAttribute(\"data-app-version-git-revision-sha\")\n // Non-prod env probably won't have this set\n if (sentry_dsn == null) { return }\n\n const rails_env_from_data = data_element.getAttribute(\"data-rails-env\") || \"unknown\"\n\n Sentry.init({\n dsn: sentry_dsn,\n release: (typeof app_version === \"string\" && app_version.length > 0) ? app_version : undefined,\n environment: rails_env_from_data,\n\n // Attaches stack traces to pure capture message / log integrations\n attachStacktrace: true,\n\n integrations: [\n Sentry.globalHandlersIntegration({\n onerror: true,\n onunhandledrejection: false,\n }),\n ],\n\n denyUrls: [\n // All from user agent\n // Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) Safari/538.1 Daum/4.1\n /sp\\.pl/,\n // Google Maps API\n /maps-api-v3/,\n // InspectLet\n /inspectlet\\.js/,\n // Google Ads\n /adsbygoogle\\.js/,\n // Google DoubleClick\n /doubleclick.net/,\n // Facebook\n /fbevents\\.js/,\n /xfbml\\.customerchat\\.js/,\n // FB too, example URL:\n // https://connect.facebook.net/signals/config/492404124272136?v=2.7.7\n /signals\\/config/,\n // Some Wifi Provider injected script\n /js\\.union-wifi\\.com\\/zm\\.js/,\n // Anti-virus plugin script\n /kaspersky-labs\\.com/,\n // Possible malware\n // https://malwaretips.com/blogs/cdncache1-a-akamaihd-net-removal/\n /akamaihd\\.net\\/loaders/,\n // Shopperifymac, adware?\n /secure\\.shopperifymac\\.com\\/servicejs\\/components\\/js/,\n // Twitter got bugs sometimes\n \"https://platform.twitter.com/widgets.js\",\n // Google AMP\n /cdn\\.ampproject\\.org/,\n // Optimizely\n /cdn\\.optimizely\\.com/,\n // Google YOLO\n /smartlock\\.google\\.com/,\n /accounts\\.google\\.com/,\n // Truepush\n /sdk\\.truepush\\.com/,\n /sdki\\.truepush\\.com/,\n // Some strange extension site?\n /image\\.uc\\.cn/,\n // Yahoo Gemini (Yahoo Advertising)\n /s\\.yimg\\.com/,\n // Some unknown China script\n /feiqinwangshi\\.cn/,\n // Google One Tap\n /m=gis_client_library/,\n /m=gis_id_library/,\n // Baidu Maps\n /api\\.map\\.baidu\\.com/,\n ],\n\n ignoreErrors: [\n // Don't send reports for message with `elt.parentNode`\n // https://github.com/getsentry/raven-js/issues/756\n //\n // DO NOT use code like\n // `if data.exception?.message.indexOf(\"evaluating 'elt.parentNode'\") isnt -1`\n /evaluating 'elt\\.parentNode'/,\n\n // The \"out of memory\" error we are getting are mostly caused by Window XP\n // And are ALL caused by Firefox 50.0 (no other versions)\n //\n // See https://sentry.io/spacious/spacious-rails-js/issues/193699433\n //\n // Thus we don't care about this kind of error\n //\n // `if data.exception?.message.indexOf(\"evaluating 'elt.parentNode'\") isnt -1`\n /out of memory/,\n\n // Error report from old browsers which is useless for debugging\n // https://github.com/getsentry/raven-js/issues/360\n \"[object Event]\",\n\n // This could be caused by the raven-js or other stuff\n // But useless to us anyway (and waiting quota)\n \"undefined\",\n\n // Error generated by a bug in auto-fill library from browser\n // https://github.com/getsentry/sentry/issues/5267\n /Blocked a frame with origin/,\n\n // Error from browser or extension something\n // https://forum.sentry.io/t/empty-stacktrace-and-exceptions-from-unknown-code-base/1143\n /Player is not defined/,\n /MacPlayer is not defined/,\n /\\$skyuc_src is not defined/,\n\n // Doesn't seem to be our script issue\n /UET is not defined/,\n /'UET' is undefined/,\n\n // Some Android browser internal issue\n /window\\.naverAppDic\\.checkDomStatus is not a function/,\n /inappbrowser\\.notifyOGTag is not a function/,\n\n // Some undefined variable, but our scripts do not contain them\n \"Can't find variable: inf\",\n \"Can't find variable: nan\",\n \"Can't find variable: MyAppGetLinkHREFAtPoint\",\n \"Can't find variable: MyAppGetLinkSRCAtPoint\",\n \"Can't find variable: MyAppGetHTMLElementsAtPoint\",\n \"Can't find variable: MyAppGetLinkTitleNameAtPoint\",\n \"Can't find variable: GetHTMLElementsAtPoint\",\n\n // IE bug, can only be fixed by updating IE\n // https://support.microsoft.com/en-us/help/3191336/-permission-denied-script-error-in-internet-explorer-11\n \"Permission denied\",\n \"沒有使用權限\",\n\n // \"Failed\" AJAX requests, rejected promises etc.\n \"Non-Error exception captured with keys\",\n\n // Strange Newtonsoft.Json which seems to be some browser plugin\n /Newtonsoft\\.Json/,\n\n // Chrome Mobile only, assumed some native code\n /removeNightMode/,\n /document\\.getElementsByClassName\\.ToString is not a function/,\n\n // Some DataCloneError on some var not defined by us\n /Failed to execute 'postMessage' on 'Window'/,\n\n // Optimizely\n /_isMatchingDomain is not defined/,\n\n // Bug in Chrome iOS related to autofilling forms, it should not impact our app. Marking as resolved\n /__gCrWeb/,\n\n // Specific phone builtin JS issue\n /diableNightMode is not defined/,\n\n // browser built-in/extension JS\n /loginFormData.userNameValue/,\n\n // Android app\n // https://gist.github.com/pioug/b006c983538538066ea871d299d8e8bc\n /vid_mate_check is not defined/,\n\n // indexedDB used by other parties only\n // https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n /Failed to execute 'transaction' on 'IDBDatabase'/,\n\n // UC Browser only without stacktrace (native code)\n /JSON Parse error: Unexpected identifier/,\n\n // Mobile Safari UIWebView only, probably specific apps\n /Can't find variable: loadHomepageTiles/,\n /Can't find variable: pktAnnotationHighlighter/,\n /Can't find variable: getFirstImage/,\n /Can't find variable: getAbstract/,\n /Can't find variable: _bdbox_js/,\n /Can't find variable: GetImageTagSrcFromPoint/,\n\n // QQ Browser Mobile\n /x5onSkinSwitch is not defined/,\n /Identifier 'qbSniffJsVersion' has already been declared/,\n\n // FB SDK\n /Unexpected token u in JSON at position 0/,\n\n // User/Browser specific issue, not in our code\n // Possibly browser extension\n /Can't find variable: commonCallback/,\n /androidInterface is not defined/,\n /getRandomIntInclusive is not defined/,\n /Can't find variable: UC_Pub_Base_WebView_isFinish/,\n\n // Vivo devices?\n /vivoNewsDetailPage is not defined/,\n /vivoNewsDetailPage.getNewsReadStatus4Vivo is not a function/,\n\n // XiaoMi devices\n /Cannot read property 'title' of null/,\n\n // QQ Browser Mobile\n /WeixinJSBridge is not defined/,\n\n // Xiaomi Devices\n /window\\.readmode\\.onReadModeDataReady is not a function/,\n\n // Unknown script like `js_snapshot_var_0xdeadbeefz09_5c.throwErr`\n /DOMException is not defined/,\n\n // Huawei Browser\n /hwbrNotifyNotInMultiWinMode is not defined/,\n /hwbrNotifyInMultiWinMode is not defined/,\n /hwbrNotifyScreenConfigChanged is not defined/,\n\n // 3rd party injected script from some Chinese news site\n // http://www.wewyy.com/archives/335\n /ToutiaoJSBridge is not defined/,\n\n // This is caused by calling document.createEvent\n // But it happens only inside FB crawler\n // https://github.com/aFarkas/lazysizes/issues/520\n /Illegal invocation/,\n\n // Non standard/documented JS called from mostly UC Browser\n /this.hostIndex.push is not a function/,\n ],\n\n beforeSend: function (event) {\n const is_valid_user_agent = [\n // Ignore any visitor with user agent including\n // Chrome 45\n // Since this is faked by some search crawler\n /^(.+Chrome\\/45\\.0\\.2454\\.93.+)$/,\n // User agent with too many \"Unexpected identifier\" errors\n /Cocolyzebot/,\n ].every(function(regex) { return !regex.test(window.navigator.userAgent) })\n\n return is_valid_user_agent ? event : null\n },\n })\n}\n\n\n// Not waiting for `window._spacious_main_css_loaded` since\n// it's slow on slow networks (mobile devices mostly)\n// WaitObjectByPathPromise(\"window._spacious_main_css_loaded\")\nPromise.resolve()\n.then(async () => {\n // Suppressing Failed to fetch dynamically imported module Issue because of outdated assets(javascript)\n // see https://vite.dev/guide/build#load-error-handling for more details\n window.addEventListener(\"vite:preloadError\", (e) => {\n e.preventDefault()\n })\n\n PerformanceTracking.init()\n\n new SimplePerformanceMetric(\"initalizeSentry\").measure(initalizeSentry)\n\n await (new SimplePerformanceMetric(\"loadPolyfillsSometimes\").measureAsync(loadPolyfillsSometimes))\n\n await new SimplePerformanceMetric(\"i18n-js:import\").measureAsync(() => {\n return dynamicImportWithRetry(() => import(\"plugins/i18n-js\"))\n })\n .then((module) => {\n if (module?.default) {\n const I18n = module.default\n new SimplePerformanceMetric(\"i18n-js:run\").measure(() => {\n // region assign existing locale\n try {\n if (typeof window.I18n.defaultLocale === \"string\") {\n I18n.defaultLocale = window.I18n.defaultLocale\n }\n } catch {\n // Do nothing\n }\n try {\n if (typeof window.I18n.locale === \"string\") {\n I18n.locale = window.I18n.locale\n }\n } catch {\n // Do nothing\n }\n\n window.I18n = I18n\n markI18nAsReady(I18n)\n // endregion assign existing locale\n })\n }\n })\n\n await new SimplePerformanceMetric(\"es6_page_loader:import\").measureAsync(() => {\n return dynamicImportWithRetry(() => import(\"application/es6_page_loader.es6\"))\n })\n .then((module) => {\n if (module?.default) {\n const es6_start = module.default\n new SimplePerformanceMetric(\"es6_page_loader:run\").measure(es6_start)\n }\n })\n\n await new SimplePerformanceMetric(\"app/vue/semi-auto-init:import\").measureAsync(() => {\n return dynamicImportWithRetry(() => import(\"app/vue/semi-auto-init\"))\n })\n .then((VueSemiAutoInit) => {\n new SimplePerformanceMetric(\"app/vue/semi-auto-init:run\").measure(() => {\n VueSemiAutoInit?.init?.()\n })\n })\n})\n"],"file":"assets/apps__spacious_website__application-mRLMCz02.js"}