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EAAUtB,SAASY,cAAc,OACrCU,EAAQ6B,UAAY,UACpB7B,EAAQ8B,UAAa,6BAA4BF,kDAEjDlD,SAASqD,KAAKhC,OAAOC,GAGjB0B,IACF1C,OAAOgD,iBAAiB,QAAQ,KAC9BhC,GAAWA,EAAQiC,QAAQ,IAE7BC,YAAW,KACTlC,EAAQiC,QAAQ,GACf,KAEP,CA2BA,SAASxC,EAAoBJ,GAC1B,MAAQ,2DAA0DA,GACrE,CA3BAR,EAAoBmD,iBAAiB,QAAS7B,GAC9CvB,EAAYoD,iBAAiB,WAAYG,IAGrB,UAAdA,EAAMC,KACRjC,GACF,GAuBJ,CAEqCkC,GAGjB,IAAI3D,SAAS4D,iBAAiB,gBAEtCC,SAASC,IACnBA,EAAKC,QAAU,SAASC,GACdF,EAAKG,cAAc,KACzBC,OACJ,CAAC,G","sources":["webpack://_new/./src/app/js/app.js"],"sourcesContent":["import '../scss/app.scss'; // Importing SCSS file\n\n\n \n\n/**\n * Function for Techmer to control their search page\n * @param {string} query_input - The input field for the search query\n * @param {string} query_search_button - The button to submit the search query\n * @param {string} problem_solver_iframe - The iframe that displays the search results\n * @param {string} search_params - The search parameters from the URL\n * @param {string} search_query - The search query from the URL\n * @param {string} iframe - The iframe that displays the search results\n * @param {string} iframeTop - The top position of the iframe\n * @param {string} url - The URL of the page\n * @param {string} seach_url - The URL of the page with the search query\n * @param {string} spinner - The spinner that displays while the search results are loading\n * @param {string} text - The text that displays while the search results are loading\n * @param {string} element - The element that the spinner waits for before removing itself\n * @param {string} str - The search query\n * \n * Version: 1.0.0\n * Author: Gino Peterson\n * Created: Jul 14,2023\n * Last Updated: Jul 14,2023\n * Version Control: \n */\n\n\n\nfunction __techmer_Js() {\n // Cache the DOM\n const query_input = document.getElementById(\"query\");\n const query_search_button = document.getElementById(\"query-search-button\");\n const problem_solver_iframe = document.getElementById(\n \"problem-solver-iframe\"\n );\n const search_params = new URLSearchParams(window.location.search);\n const search_query = search_params.get(\"search\");\n // if search query true spin loader until iframe is loaded\n \n if(search_query){\n let iframe = iFrameAddition(search_query);\n search_query && document.getElementById(\"search-results\").append(iframe);\n search_query && spinner(true, \"problem-solver-iframe\", \"Loading results\");\n // sroll iframe into view smoothly\n search_query && iframe.scrollIntoView({ behavior: \"smooth\" });\n \n }\n \n \n \n \n // Collect Variables\n \n // Preplexity Start here\n // When Search Button is clicked or Enter key is pressed, run the function\n const handleSearch = () => {\n // When the function begins, check if the query input is empty and alert the user to add a value\n if (query_input.value === \"\") {\n alert(\"Please enter a search query.\");\n return;\n }\n \n // get url\n let url = new URL(window.location.href);\n let correct_host = url.hostname.includes('localhost') ? url.host : url.hostname;\n let query = query_input.value;\n let search_url =\n \n \n url.protocol +\n \"//\" +\n correct_host +\n url.pathname +\n \"?search=\" +\n query\n // check if browser is safari and if so open search_url in new tab\n let isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n \n // check if user device is apple \n let isApple = /Mac|iPod|iPhone|iPad/.test(navigator.platform);\n let isMobile = window.innerWidth < 768 ? true : false;\n let iframe_page = IframeLinkGenerator(query);\n \n if (isSafari || isMobile) {\n isMobile ? (window.location.href = iframe_page ): window.open(iframe_page , \"_blank\");\n // reset input field\n query_input.value = \"\";\n \n \n } else {\n window.location.href = search_url;\n spinner(false);\n \n }\n }; \n \n function spinner(removeWhenDone, elementToWaitFor, text = null) {\n text = text || \"Searching for results\";\n let spinner = document.createElement(\"div\");\n spinner.className = \"spinner\";\n spinner.innerHTML = `
${text}
\n
`;\n document.body.append(spinner);\n // if remove when done is true, remove the spinner when the elementToWaitFor is loaded\n let element;\n if (removeWhenDone) {\n window.addEventListener(\"load\", () => {\n spinner && spinner.remove();\n });\n setTimeout(() => {\n spinner.remove();\n }, 3000);\n }\n }\n \n query_search_button.addEventListener(\"click\", handleSearch);\n query_input.addEventListener(\"keydown\", (event) => {\n // Check if the Enter key is pressed (key code 13)\n \n if (event.key === \"Enter\") {\n handleSearch();\n }\n });\n // Preplexity end here\n \n function iFrameAddition(str) {\n let iframe = document.createElement(\"iframe\");\n iframe.id = \"problem-solver-iframe\";\n iframe.src = IframeLinkGenerator(str);\n iframe.width = \"100%\";\n iframe.height = \"800\";\n iframe.frameBorder = \"0\";\n // add sandox to prevent malicous code but allow ifame to load content\n iframe.sandbox = \"allow-same-origin allow-scripts allow-popups allow-forms\";\n \n \n \n return iframe;\n }\n \n function IframeLinkGenerator(str) {\n return `https://catalog.ides.com/QuickSearch.aspx?I=46454&query=${str}`;\n }\n \n }\n \n document.getElementById(\"query\") && __techmer_Js();\n \n // get staff cards\n const staff_cards = [...document.querySelectorAll(\".staff-card\")];\n // loop through staff_cards and add event listener to each\n staff_cards.forEach((card) => {\n card.onclick = function(e){\n let a = card.querySelector('a');\n a.click();\n }\n }) \n "],"names":["document","getElementById","query_input","query_search_button","search_query","URLSearchParams","window","location","search","get","iframe","str","createElement","id","src","IframeLinkGenerator","width","height","frameBorder","sandbox","iFrameAddition","append","spinner","scrollIntoView","behavior","handleSearch","value","alert","url","URL","href","correct_host","hostname","includes","host","query","search_url","protocol","pathname","isSafari","test","navigator","userAgent","isMobile","platform","innerWidth","iframe_page","open","removeWhenDone","elementToWaitFor","text","className","innerHTML","body","addEventListener","remove","setTimeout","event","key","__techmer_Js","querySelectorAll","forEach","card","onclick","e","querySelector","click"],"sourceRoot":""}