{"version":3,"sources":["SharedLogic/utilities/cache.js","SharedLogic/utilities/validations.js","SharedLogic/app/services.js","SharedLogic/user/services.js","SharedLogic/utilities/endpoints.js","index.js"],"names":["getValue","value","JSON","stringify","Providers","cookie","get","key","parts","document","split","retVal","length","pop","shift","set","expires","arguments","undefined","path","domain","Date","isNaN","getTime","parseInt","concat","toGMTString","remove","setDate","getDate","sessionStorage","window","getItem","decodeURI","setItem","removeItem","localStorage","Cache","method","isValidGuid","guid","test","isValidGenericString","string","replace","isToday","date","today","getMonth","getYear","isTomorrow","tomorrow","isTodayOrTomorrow","isMobileDevice","TOC_DEVICE_TYPE","extractDataFromURL","urlHost","location","hostname","toLocaleLowerCase","urlPath","pathname","isProductPlayerDomain","TOC_ENDPOINT_ENV","pathName","indexOf","substr","pathNameParts","filter","Boolean","productName","nodeKey","environmentId","audienceId","taskManagerNodeKey","isStudentPreview","IS_OLAMON","IS_CYBERSQUAD","olamonPages","part","includes","toLowerCase","nodeKeyParts","isValidKey","search","searchParams","URLSearchParams","showTaskManagerParam","utmSource","utmMedium","utmCampaign","campaignData","campaignPagePath","campaignPageURL","href","protocol","port","folderId","documentId","initAccessibilityLang","lang","sitekey","interdeal","Menulang","Position","script","createElement","src","body","appendChild","documentElement","setAttribute","getParentPage","rootDocumentId","treeData","routes","urlData","parentPage","currentFolderId","currentDocumentId","isRouteExist","_loop","_treeData$currentFold","currentRoute","route","parentId","_treeData$currentFold2","parentFolderId","ENVIRONMENT_ID_KEY","AUDIENCE_ID_KEY","IS_STUDENT_PREVIEW","RETURN_URL","IS_REVEALED_BY_TEACHER","PRIVATE_PURCHASE_ID","fetchGetOptions","headers","Accept","mode","credentials","cache","fetchUserCapsules","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","userId","capsules","wrap","_context","prev","next","fetch","tocGlobalEndpoints","productPlayerServicesAPIURL","then","response","json","abrupt","stop","_x","apply","checkIsUserAuthorized","_ref2","_callee2","userRole","schoolId","rootFolderId","_args2","_context2","Promise","resolve","text","val","_x2","_x3","_x4","_x5","fetchUserGroups","fetchUserAudiences","productId","fetchLastVisit","catch","res","console","error","updateLastVisitedItem","itemId","idParts","data","id","lastVisit","now","toString","getDefaultAudience","audiences","audience","i","archiveYear","getActiveAudience","find","ad","fetchUserTasks","_ref3","_callee3","user","config","url","_context3","treeServiceAPIURL","activeAudience","loLanguage","err","_x6","_x7","fetchUserGrades","_ref4","_callee4","_context4","_x8","_x9","fetchAudienceStudents","_ref5","_callee5","_context5","_x10","setAudienceId","toUpperCase","getAudienceId","setEnvironmentId","getEnvironmentId","clearEnvironmentId","setIsStudentPreview","getIsStudentPreview","clearIsStudentPreview","setIsRevealedByTeacher","isRevealedByTeacher","getIsRevealedByTeacher","setUserReturnURL","returnURL","getUserReturnURL","clearUserReturnURL","isAnyActiveAudience","_user$audiences","_user$audiences$filte","getUserShopURL","purchaseConfig","userSchoolSign","_schoolsList$split","_ref6","shopUrl","schoolShopUrl","schoolsList","tocInitEndpoints","env","environmentAPIURL","ofakimAPIURL","productPlayerURL","loServicesAPIURL","ofakimURL","myBagUIURL","myBagURL","myBagApiURL","itemCreationURL","cdnURL","dashboardURL","getStaticFileUrl","startsWith","render","module","App","default","ReactDOM","createRoot","getElementById","_jsx","isUserInStudentView","cet","accessmanagement","getSessionAsync","sent","role","TOC_PRODUCT_NAME"],"mappings":"iIAAA,sCAAMA,EAAW,SAACC,GAChB,MAA0B,kBAAXA,EAAsBC,KAAKC,UAAUF,GAASA,CAC/D,EAEMG,EAAY,CAChBC,OAAQ,CACNC,IAAK,SAAUC,GACb,IACMC,GADQ,KAAOC,SAASJ,QACVK,MAAM,KAAOH,EAAM,KACnCI,EAAS,KASb,OAPqB,IAAjBH,EAAMI,QAEO,UADfD,EAASH,EAAMK,MAAMH,MAAM,KAAKI,WAE9BH,EAAS,MAINA,CACT,EACAI,IAAK,SAACR,EAAKN,GAAkD,IAA3Ce,EAAOC,UAAAL,OAAA,QAAAM,IAAAD,UAAA,GAAAA,UAAA,GAA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C,oBAAoBqB,SAAS,eAErEjD,OAAO6C,YAAa7C,OAAO8C,eAA0C,OAAzB9C,OAAO0B,SAASuC,KAAa,CAAAqD,EAAAE,KAAA,SAClC,OAAzCxH,OAAO6C,WAAa7C,OAAO8C,cAAcwE,EAAAE,KAAA,EACtBxH,OAAOsP,IAAIC,iBAAiBC,kBAAkB,KAAD,EAA1D1E,EAAIxD,EAAAmI,KACJJ,EAAsB3C,YAAoBlL,cAAqBe,aAEjD,aAAX,OAAJuI,QAAI,IAAJA,OAAI,EAAJA,EAAM4E,OAAqC,WAAX,OAAJ5E,QAAI,IAAJA,OAAI,EAAJA,EAAM4E,OAAsBL,EAGlDrP,OAAO8C,cAChB,2DAAkC8E,MAAK,SAAAkH,GAAM,OAAID,EAAOC,EAAO,IAE/D,2DAA0ClH,MAAK,SAAAkH,GAAM,OAAID,EAAOC,EAAO,KALvE9O,OAAOuB,gBAAkB,KACzB,wEAA8BqG,MAAK,SAAAkH,GAAM,OAAID,EAAOC,EAAO,KAK5DxH,EAAAE,KAAA,iBACoC,WAA3BxH,OAAOuB,iBAAyD,OAAzBvB,OAAO0B,SAASuC,MAA2C,OAAzBjE,OAAO0B,SAASuC,MAInGjE,OAAOuB,gBAAkB,KACzB,wEAA8BqG,MAAK,SAAAkH,GAAM,OAAID,EAAOC,EAAO,MAJ3D9O,OAAOuB,gBAAkB,SACzB,yEAAkCqG,MAAK,SAAAkH,GAAM,OAAID,EAAOC,EAAO,KAIhE,QAED9O,OAAO2P,iBAAmB3P,OAAO2P,kBAAoBnO,cAAqBe,YAC1E,yBAAA+E,EAAAU,OAAA,GAAAd,EAAA,IA1BFH,E","file":"static/js/main.0858428a.chunk.js","sourcesContent":["const getValue = (value) => {\r\n return (typeof(value) === 'object' ? JSON.stringify(value) : value)\r\n}\r\n\r\nconst Providers = {\r\n cookie: {\r\n get: function (key) {\r\n const value = '; ' + document.cookie;\r\n const parts = value.split('; ' + key + '=');\r\n let retVal = null;\r\n\r\n if (parts.length === 2) {\r\n retVal = parts.pop().split(';').shift();\r\n if (retVal === 'null') {\r\n retVal = null;\r\n }\r\n }\r\n\r\n return retVal;\r\n },\r\n set: (key, value, expires = '', path = '/', domain = '') => {\r\n if (expires) {\r\n // If it's a date\r\n if (expires instanceof Date) {\r\n // If it isn't a valid date\r\n if (isNaN(expires.getTime())) expires = new Date();\r\n } else {\r\n expires = new Date(new Date().getTime() + parseInt(expires, 10) * 1000 * 60 * 60 * 24);\r\n }\r\n }\r\n\r\n const cookie = `${key}=${getValue(value)};expires=${expires.toGMTString()};path=${path};domain=${domain}`;\r\n\r\n document.cookie = cookie;\r\n },\r\n remove: key => {\r\n const expires = new Date();\r\n expires.setDate(expires.getDate() - 10);\r\n Providers.cookie.set(key, '', expires);\r\n }\r\n },\r\n sessionStorage: {\r\n get: function (key) {\r\n return window.sessionStorage.getItem(key) ? decodeURI(window.sessionStorage.getItem(key)) : null;\r\n },\r\n set: function (key, value) {\r\n window.sessionStorage.setItem(key, getValue(value));\r\n },\r\n remove: function (key) {\r\n window.sessionStorage.removeItem(key);\r\n }\r\n },\r\n localStorage: {\r\n get: function (key) {\r\n return window.localStorage.getItem(key) ? decodeURI(window.localStorage.getItem(key)) : null;\r\n },\r\n set: function (key, value) {\r\n window.localStorage.setItem(key, getValue(value));\r\n },\r\n remove: function (key) {\r\n window.localStorage.removeItem(key);\r\n }\r\n }\r\n};\r\n\r\nexport const Cache = {\r\n method: { cookie: 'cookie', sessionStorage: 'sessionStorage', localStorage: 'localStorage' },\r\n\r\n get: (key, method = 'localStorage') => {\r\n //if sessionStorage is enabled, it is a property of window\r\n if (!window[method]) {\r\n method = 'cookie';\r\n }\r\n\r\n return Providers[method].get(key);\r\n },\r\n\r\n set: (key, value, method = 'localStorage', expires, path, domain) => {\r\n if (!window[method]) {\r\n method = 'cookie';\r\n }\r\n\r\n Providers[method].set(key, value, expires, path, domain);\r\n\r\n return value;\r\n },\r\n\r\n remove: (key, method = 'localStorage') => {\r\n if (!window[method]) {\r\n method = 'cookie';\r\n }\r\n\r\n Providers[method].remove(key);\r\n }\r\n};\r\n","export const isValidGuid = guid => {\r\n //const guidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; // Real GUID\r\n const guidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; // CET GUID ?\r\n return guidPattern.test(guid);\r\n};\r\n\r\nexport const isValidGenericString = string => {\r\n return !!string && !!string.replace(/\\s/g, '');\r\n};\r\n\r\n// export const isActive = (startDate, endDate) => {\r\n// const today = new Date();\r\n// return startDate <= today && today <= endDate;\r\n// };\r\nexport const isToday = date => {\r\n const today = new Date();\r\n return date.getDate() === today.getDate() && date.getMonth() === today.getMonth() && date.getYear() === today.getYear();\r\n};\r\nexport const isTomorrow = date => {\r\n const tomorrow = new Date();\r\n tomorrow.setDate(tomorrow.getDate() + 1);\r\n return date.getDate() === tomorrow.getDate() && date.getMonth() === tomorrow.getMonth() && date.getYear() === tomorrow.getYear();\r\n};\r\nexport const isTodayOrTomorrow = date => {\r\n return isToday(date) || isTomorrow(date);\r\n};\r\n\r\nexport const isMobileDevice = () => window.TOC_DEVICE_TYPE === 'MOBILE';\r\n","import { isValidGuid } from '../utilities/validations';\r\nimport { Cache } from '../utilities/cache';\r\n\r\nexport const extractDataFromURL = () => {\r\n const urlHost = window.location.hostname.toLocaleLowerCase();\r\n const urlPath = window.location.pathname.toLocaleLowerCase();\r\n const isProductPlayerDomain = urlHost === `productplayer${window.TOC_ENDPOINT_ENV}cet.ac.il`;\r\n\r\n let pathName = urlPath.indexOf('/') === 0 ? urlPath.substr(1) : urlPath;\r\n pathName = pathName.indexOf('/') === pathName.length - 1 ? pathName.substr(0, pathName.length - 1) : pathName;\r\n\r\n let pathNameParts = pathName.split('/').filter(Boolean);\r\n let productName = isProductPlayerDomain ? (pathNameParts.length > 0 ? pathNameParts[0] : '') : urlHost.split('.')[0];\r\n let nodeKey = '';\r\n let environmentId = '';\r\n let audienceId = ''; // PATCH only for myofek (hopefully till they will use environmentId correctly)\r\n let taskManagerNodeKey = '';\r\n let isStudentPreview = false;\r\n\r\n if (!window.IS_OLAMON && !window.IS_CYBERSQUAD) {\r\n nodeKey = pathNameParts.length > 1 ? pathNameParts[1] : '';\r\n } else {\r\n const olamonPages = ['login', 'intro', 'welcome', 'prologue'];\r\n pathNameParts = pathNameParts.filter(part => !olamonPages.includes(part.toLowerCase())).filter(Boolean);\r\n nodeKey = pathNameParts.length > 1 ? pathNameParts[pathNameParts.length - 1] : '';\r\n }\r\n\r\n const nodeKeyParts = nodeKey.split('_').filter(Boolean);\r\n\r\n let isValidKey = nodeKeyParts.length > 0 && isValidGuid(nodeKeyParts[0]);\r\n\r\n if (isValidKey && nodeKeyParts.length > 1) {\r\n isValidKey = isValidGuid(nodeKeyParts[1]);\r\n }\r\n\r\n if (window.location.search) {\r\n const searchParams = new URLSearchParams(window.location.search);\r\n environmentId = searchParams.get('environmentId');\r\n environmentId = environmentId && isValidGuid(environmentId) ? environmentId : '';\r\n audienceId = searchParams.get('audience');\r\n audienceId = audienceId && isValidGuid(audienceId) ? audienceId : '';\r\n isStudentPreview = searchParams.get('isStudentPreview') === 'true';\r\n\r\n // Check if need to show task manager - and build relevant taskManagerNodeKey if needed\r\n const showTaskManagerParam = searchParams.get('showtaskmanager');\r\n if (showTaskManagerParam && nodeKeyParts.length > 0 && isValidKey) {\r\n taskManagerNodeKey = `${nodeKeyParts[0]}_${nodeKeyParts.length > 1 ? nodeKeyParts[1] : showTaskManagerParam ?? ''}`;\r\n }\r\n\r\n // Check for campaign URL params - and save full campaign URL in cache (if any campaign is specified)\r\n const utmSource = searchParams.get('utm_source');\r\n const utmMedium = searchParams.get('utm_medium');\r\n const utmCampaign = searchParams.get('utm_campaign');\r\n\r\n if (utmSource && utmMedium) {\r\n const campaignData = {\r\n campaignPagePath: window.location.pathname + window.location.search,\r\n campaignPageURL: window.location.href,\r\n utmSource,\r\n utmMedium,\r\n utmCampaign\r\n };\r\n\r\n Cache.set('campaignData', campaignData, Cache.method.sessionStorage);\r\n }\r\n }\r\n\r\n return {\r\n productName,\r\n pathName,\r\n domain: `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}`,\r\n nodeKey: nodeKey ? (isValidKey ? nodeKey : 'key-not-valid') : '',\r\n folderId: nodeKeyParts.length > 0 ? (isValidKey ? nodeKeyParts[0] : 'key-not-valid') : '',\r\n documentId: nodeKeyParts.length > 1 ? (isValidKey ? nodeKeyParts[1] : 'key-not-valid') : '',\r\n environmentId,\r\n audienceId,\r\n isStudentPreview,\r\n taskManagerNodeKey\r\n };\r\n};\r\n\r\nexport const initAccessibilityLang = (lang, sitekey = '245ce95f2d0009fdfb7cf218a2c6122a') => {\r\n window.interdeal.Menulang = lang;\r\n window.interdeal.sitekey = sitekey;\r\n\r\n if (window.TOC_DEVICE_TYPE === 'PC' && !window.IS_OLAMON) {\r\n window.interdeal.Position = 'Left';\r\n } else {\r\n window.interdeal.Position = lang === 'he' || lang === 'ar' ? 'Right' : 'Left';\r\n }\r\n\r\n const script = document.createElement('script');\r\n script.src = `https://cdn${window.TOC_ENDPOINT_ENV}cet.ac.il/libs/cet.nagich.provider/1.0/cet.nagich.provider.js`;\r\n document.body.appendChild(script);\r\n\r\n document.documentElement.setAttribute('lang', lang);\r\n};\r\n\r\nexport const getParentPage = (rootDocumentId, treeData, routes = null) => {\r\n const urlData = extractDataFromURL();\r\n let parentPage = '/';\r\n\r\n if (treeData) {\r\n let currentFolderId = urlData.folderId;\r\n let currentDocumentId = urlData.documentId;\r\n\r\n if (routes?.length) {\r\n let isRouteExist = urlData.pathName === '';\r\n\r\n while (!isRouteExist && currentFolderId !== rootDocumentId && treeData[currentFolderId]) {\r\n let currentRoute = `/${currentFolderId}`;\r\n let filteredRoutes = routes.filter(route => route.path === currentRoute);\r\n if (filteredRoutes.length > 0) {\r\n parentPage = currentRoute;\r\n isRouteExist = true;\r\n } else {\r\n currentFolderId = treeData[currentFolderId]?.parentId;\r\n }\r\n }\r\n } else {\r\n if (currentDocumentId) {\r\n parentPage = `/${currentFolderId}`;\r\n } else if (currentFolderId) {\r\n const parentFolderId = treeData[currentFolderId]?.parentId;\r\n\r\n if (parentFolderId && parentFolderId !== rootDocumentId) {\r\n parentPage = `/${parentFolderId}`;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return parentPage;\r\n};\r\n","import { isValidGuid } from '../utilities/validations';\r\nimport { Cache } from '../utilities/cache';\r\n\r\nexport const ENVIRONMENT_ID_KEY = 'ENVIRONMENT_ID_KEY';\r\nexport const AUDIENCE_ID_KEY = 'AUDIENCE_ID_KEY';\r\nexport const IS_STUDENT_PREVIEW = 'IS_STUDENT_PREVIEW';\r\nexport const RETURN_URL = 'RETURN_URL';\r\nexport const IS_REVEALED_BY_TEACHER = 'IS_REVEALED_BY_TEACHER';\r\nexport const PRIVATE_PURCHASE_ID = '__private-purchase__';\r\n\r\nconst fetchGetOptions = {\r\n method: 'GET',\r\n headers: { Accept: 'application/json', 'Content-Type': 'application/json' },\r\n mode: 'cors',\r\n credentials: 'include',\r\n cache: 'no-store'\r\n};\r\n\r\nexport const fetchUserCapsules = async userId => {\r\n const capsules = fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}GetUserCapsules?userId=${userId}`, fetchGetOptions)\r\n .then(response => response.json())\r\n .then(json => json);\r\n\r\n return capsules;\r\n};\r\n\r\nexport const checkIsUserAuthorized = async (userId, userRole, schoolId, rootFolderId, lang = 'he') => {\r\n if (userRole === 'admin') {\r\n return Promise.resolve(true);\r\n }\r\n\r\n return fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}IsUserAuthorized?rootFolderId=${rootFolderId}&userId=${userId}&schoolId=${schoolId}&lang=${lang}`)\r\n .then(response => response.text())\r\n .then(val => val === 'true');\r\n};\r\n\r\nexport const fetchUserGroups = (userId, schoolId) =>\r\n fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}GetUserGroups?userId=${userId}&schoolId=${schoolId}`, fetchGetOptions)\r\n .then(response => response.json())\r\n .then(json => json);\r\n\r\nexport const fetchUserAudiences = (productId, userId, schoolId) =>\r\n fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}GetUserAudiences?userId=${userId}&schoolId=${schoolId}&productId=${productId}`, fetchGetOptions)\r\n .then(response => response.json())\r\n .then(json => json);\r\n\r\nexport const fetchLastVisit = (productId, userId, audienceId) =>\r\n fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}ProductUserAudienceHistory/${productId}/${userId}/${audienceId}`, { cache: 'no-store' })\r\n .then(response => response.json())\r\n .then(json => json)\r\n .catch(res => {\r\n console.error(res);\r\n });\r\n\r\nexport const updateLastVisitedItem = (productId, userId, audienceId, itemId) => {\r\n const idParts = itemId ? itemId.split('_') : [];\r\n const folderId = idParts.length > 0 ? idParts[0] : '';\r\n const documentId = idParts.length > 1 ? idParts[1] : '';\r\n\r\n if (isValidGuid(folderId) && (!documentId || isValidGuid(documentId))) {\r\n let data = {\r\n id: { productId, userId, audienceId },\r\n lastVisit: { date: Date.now().toString(), id: itemId }\r\n };\r\n\r\n fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}ProductUserAudienceHistory`, {\r\n headers: { 'Content-Type': 'application/json' },\r\n method: 'POST',\r\n body: JSON.stringify(data)\r\n }).catch(res => {\r\n console.error(res);\r\n });\r\n }\r\n};\r\n\r\nexport const getDefaultAudience = audiences => {\r\n let audience = null;\r\n\r\n if (audiences && audiences.length > 0) {\r\n audience = audiences[0];\r\n\r\n for (let i = 0; i < audiences.length; i++) {\r\n if (audiences[i].archiveYear === undefined || audiences[i].archiveYear === null) {\r\n audience = audiences[i];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n return audience;\r\n};\r\n\r\nexport const getActiveAudience = (audiences, audienceId) => {\r\n let audience = null;\r\n\r\n if (audiences) {\r\n if (audienceId && audienceId !== 'null') {\r\n audience = audiences.find(ad => ad.audienceId === audienceId);\r\n }\r\n\r\n if (!audience || !audienceId) {\r\n audience = getDefaultAudience(audiences);\r\n }\r\n }\r\n\r\n return audience;\r\n};\r\n\r\nexport const fetchUserTasks = async (user, config) => {\r\n let url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetTocLms/${user.userId}/${user.schoolId}/${config.productId}/${user.activeAudience.audienceId}/${config.loLanguage}/?environmentId=${user.activeAudience.id}`;\r\n\r\n if (user.activeAudience.archiveYear) {\r\n url += `/${user.activeAudience.archiveYear - 1}`;\r\n }\r\n\r\n return fetch(url, { cache: 'no-store' })\r\n .then(response => response.json())\r\n .then(json => json)\r\n .catch(err => err);\r\n};\r\n\r\nexport const fetchUserGrades = async (user, config) => {\r\n let url = `${window.tocGlobalEndpoints.treeServiceAPIURL}TreeLMS/GetStudentScores/${user.userId}/${user.schoolId}/${config.productId}/${user.activeAudience.audienceId}/${config.loLanguage}/?environmentId=${user.activeAudience.id}`;\r\n\r\n if (user.activeAudience.archiveYear) {\r\n url += `/${user.activeAudience.archiveYear - 1}`;\r\n }\r\n\r\n return fetch(url, { cache: 'no-store' })\r\n .then(response => response.json())\r\n .then(json => json)\r\n .catch(err => err);\r\n};\r\n\r\nexport const fetchAudienceStudents = async audienceId => {\r\n return fetch(`${window.tocGlobalEndpoints.productPlayerServicesAPIURL}GetAudienceStudents?audienceId=${audienceId}`)\r\n .then(response => response.json())\r\n .then(json => json);\r\n};\r\n\r\nexport const setAudienceId = (productName, audienceId) => {\r\n Cache.set(`${AUDIENCE_ID_KEY}_${productName.toUpperCase()}`, audienceId, Cache.method.localStorage);\r\n};\r\n\r\nexport const getAudienceId = productName => {\r\n return Cache.get(`${AUDIENCE_ID_KEY}_${productName.toUpperCase()}`, Cache.method.localStorage);\r\n};\r\n\r\nexport const clearAudienceId = productName => {\r\n Cache.remove(`${AUDIENCE_ID_KEY}_${productName.toUpperCase()}`, Cache.method.localStorage);\r\n};\r\n\r\nexport const setEnvironmentId = (productName, environmentId) => {\r\n Cache.set(`${ENVIRONMENT_ID_KEY}_${productName.toUpperCase()}`, environmentId, Cache.method.localStorage);\r\n};\r\n\r\nexport const getEnvironmentId = productName => {\r\n return Cache.get(`${ENVIRONMENT_ID_KEY}_${productName.toUpperCase()}`, Cache.method.localStorage);\r\n};\r\n\r\nexport const clearEnvironmentId = productName => {\r\n Cache.remove(`${ENVIRONMENT_ID_KEY}_${productName.toUpperCase()}`, Cache.method.localStorage);\r\n};\r\n\r\nexport const setIsStudentPreview = productName => {\r\n Cache.set(`${IS_STUDENT_PREVIEW}_${productName.toUpperCase()}`, true, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const getIsStudentPreview = productName => {\r\n return Cache.get(`${IS_STUDENT_PREVIEW}_${productName.toUpperCase()}`, Cache.method.sessionStorage) === 'true';\r\n};\r\n\r\nexport const clearIsStudentPreview = productName => {\r\n Cache.remove(`${IS_STUDENT_PREVIEW}_${productName.toUpperCase()}`, Cache.method.sessionStorage);\r\n Cache.remove(`${IS_REVEALED_BY_TEACHER}_${productName.toUpperCase()}`, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const setIsRevealedByTeacher = (productName, isRevealedByTeacher) => {\r\n Cache.set(`${IS_REVEALED_BY_TEACHER}_${productName.toUpperCase()}`, isRevealedByTeacher, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const getIsRevealedByTeacher = productName => {\r\n return Cache.get(`${IS_REVEALED_BY_TEACHER}_${productName.toUpperCase()}`, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const setUserReturnURL = (productName, returnURL) => {\r\n Cache.set(`${RETURN_URL}_${productName.toUpperCase()}`, returnURL, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const getUserReturnURL = productName => {\r\n return Cache.get(`${RETURN_URL}_${productName.toUpperCase()}`, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const clearUserReturnURL = productName => {\r\n Cache.remove(`${RETURN_URL}_${productName.toUpperCase()}`, Cache.method.sessionStorage);\r\n};\r\n\r\nexport const isAnyActiveAudience = user => {\r\n return user?.audiences?.filter(audience => !audience.archiveYear)?.length > 0;\r\n};\r\n\r\nexport const getUserShopURL = (purchaseConfig, userSchoolSign) => {\r\n const { shopUrl, schoolShopUrl, schoolsList } = purchaseConfig || {};\r\n\r\n const userShopURL = userSchoolSign && schoolShopUrl && schoolsList?.split(',')?.includes(userSchoolSign) ? schoolShopUrl : shopUrl;\r\n return userShopURL;\r\n};\r\n","/********************************************************************\r\n Using the global window object, to enable easy environment switch\r\n********************************************************************/\r\n\r\nexport const tocInitEndpoints = env => {\r\n env = env || window.TOC_ENDPOINT_ENV;\r\n return (window.tocGlobalEndpoints = {\r\n environmentAPIURL: '//environment' + env + 'cet.ac.il/api/Environment/',\r\n ofakimAPIURL: '//ebag' + env + 'cet.ac.il/api/',\r\n treeServiceAPIURL: '//treeservice' + env + 'cet.ac.il/api/',\r\n productPlayerURL: '//productplayer' + env + 'cet.ac.il/',\r\n productPlayerServicesAPIURL: '//productplayerservices' + env + 'cet.ac.il/',\r\n loServicesAPIURL: '//loservices' + env + 'cet.ac.il/loservice/',\r\n ofakimURL: '//ebag' + env + 'cet.ac.il/',\r\n myBagUIURL: '//mybagui' + env + 'cet.ac.il/',\r\n myBagURL: '//mybag.ebag' + env + 'cet.ac.il/',\r\n myBagApiURL: '//mybagapi' + env + 'cet.ac.il/',\r\n itemCreationURL: '//lostudio' + env + 'cet.ac.il/studiolo/editor.html',\r\n cdnURL: '//cdn' + env + 'cet.ac.il/',\r\n dashboardURL: '//dashboard' + env + 'cet.ac.il/'\r\n });\r\n};\r\n\r\nexport const getStaticFileUrl = path => {\r\n if (!path) {\r\n return '';\r\n }\r\n if (path.toLowerCase().startsWith('http')) {\r\n return path;\r\n }\r\n\r\n if (path.toLowerCase().startsWith('/')) {\r\n\t\treturn `${window.location.protocol}//${window.location.hostname}${path}`;\r\n }\r\n};\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom/client';\r\nimport { extractDataFromURL } from './SharedLogic/app/services';\r\nimport { getIsStudentPreview } from './SharedLogic/user/services';\r\nimport { tocInitEndpoints } from './SharedLogic/utilities/endpoints';\r\n\r\n// import * as serviceWorker from './serviceWorker';\r\n\r\ntocInitEndpoints();\r\n// if (process.env.NODE_ENV.toLocaleLowerCase() !== 'production') {\r\n// // console.log(window.tocGlobalEndpoints);\r\n// const { whyDidYouUpdate } = require('why-did-you-update');\r\n// whyDidYouUpdate(React, { exclude: [/^Connect/, /^InjectIntl/] });\r\n// }\r\n\r\nfunction render(module) {\r\n const App = module.default;\r\n const root = ReactDOM.createRoot(document.getElementById('root'));\r\n root.render();\r\n}\r\n\r\n(async () => {\r\n window.IS_OLAMON = window.IS_OLAMON === 'true';\r\n window.IS_CYBERSQUAD = window.location.href.toLocaleLowerCase().includes('cybersquad');\r\n\r\n if (window.IS_OLAMON || window.IS_CYBERSQUAD || window.location.port === '83') {\r\n window.IS_OLAMON = !window.IS_CYBERSQUAD;\r\n const user = await window.cet.accessmanagement.getSessionAsync();\r\n const isUserInStudentView = getIsStudentPreview(extractDataFromURL().productName);\r\n\r\n if ((user?.role === 'teacher' || user?.role === 'admin') && !isUserInStudentView) {\r\n window.TOC_DEVICE_TYPE = 'PC';\r\n import('./PC/Components/App').then(module => render(module));\r\n } else if (window.IS_CYBERSQUAD) {\r\n import('./Cybint/Containers/App').then(module => render(module));\r\n } else {\r\n import(`./SharedComponents/Olamonim/App`).then(module => render(module));\r\n }\r\n } else if ((window.TOC_DEVICE_TYPE === 'MOBILE' || window.location.port === '82') && window.location.port !== '81') {\r\n window.TOC_DEVICE_TYPE = 'MOBILE';\r\n import('./Mobile/Containers/App').then(module => render(module));\r\n } else {\r\n window.TOC_DEVICE_TYPE = 'PC';\r\n import('./PC/Components/App').then(module => render(module));\r\n }\r\n\r\n window.TOC_PRODUCT_NAME = window.TOC_PRODUCT_NAME || extractDataFromURL().productName;\r\n // serviceWorker.unregister();\r\n})();\r\n"],"sourceRoot":""}