1"use strict";(self.webpackChunkui_apps=self.webpackChunkui_apps||[]).push([[5192],{5192(__unused_webpack_module,__webpack_exports__,__webpack_require__){eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(467);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3029);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2901);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4467);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4756);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5711);\n/* harmony import */ var _core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5564);\nfunction _createForOfIteratorHelper(r,e){var t=\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&\"number\"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t[\"return\"]||t[\"return\"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if(\"string\"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return\"Object\"===t&&r.constructor&&(t=r.constructor.name),\"Map\"===t||\"Set\"===t?Array.from(r):\"Arguments\"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;};// Import the helper functions from the coveo helper module\n/**\n * Coveo Search function\n */var CoveoSearch=/*#__PURE__*/function(){function CoveoSearch(){var _this=this;(0,_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"] */ .A)(this,CoveoSearch);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"init\",function(){// Start an immediately invoked async function expression (IIFE)\n(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* [\"default\"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee2(){var coveoInit;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:coveoInit=/*#__PURE__*/function(){var _ref2=(0,_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__/* [\"default\"] */ .A)(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().mark(function _callee(){var searchInterface,searchInterfaceWrapper,resultListContainer,searchHub,coveoSetupObject;return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_4___default().wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:/**\n * Select the DOM element with the class 'search-results-page' and assign it to the variable searchInterface,\n * this is the actual search interface <atomic-search-interface>\n */searchInterface=document.querySelector('.search-results-page');/**\n * Select the DOM element with the id 'cmp-coveosearch' and assign it to the variable searchInterfaceWrapper,\n * its direct parent element of <atomic-search-interface>\n */searchInterfaceWrapper=document.querySelector('#cmp-coveosearch');/**\n * Select the first 'atomic-result-list' element in the document and assign it to the variable resultListContainer,\n * this element will have search results list\n */resultListContainer=document.querySelector('.cmp-coveosearch atomic-result-list');/**\n * @searchInterface Element representing the '<atomic-search-interface>' element\n * @searchInterfaceWrapper Parent element of the '<atomic-search-interface>' element\n * @resultListContainer Element where search results are displayed, representing '<atomic-result-list>'\n * @facetItems Array containing facet field information, such as '<atomic-facet field=\"www_topic_id\">'\n */searchHub=(searchInterface===null||searchInterface===void 0?void 0:searchInterface.getAttribute('search-hub'))||'';coveoSetupObject={searchInterface:searchInterface,searchInterfaceWrapper:searchInterfaceWrapper,resultListContainer:resultListContainer,facetItems:['caption-www_asset_type_id','caption-www_parent_application_id','caption-www_industry_id'],searchHub:searchHub,originLevel1:searchHub};
1/**\n * Wait for the 'atomic-search-interface' custom element to be defined\n */_context.next=1;return customElements.whenDefined('atomic-search-interface');case 1:_context.next=2;return (0,_clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__/* .executeSearch */ .kB)(coveoSetupObject);case 2:_context.next=3;return (0,_clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__/* .setFiltersLabel */ .uk)(coveoSetupObject);case 3:case\"end\":return _context.stop();}},_callee);}));return function coveoInit(){return _ref2.apply(this,arguments);};}();_context2.next=1;return coveoInit();case 1:case\"end\":return _context2.stop();}},_callee2);}))();// Immediately invoke the async function expression\n// RGA Feedback adjustments\n_this.rgaBeingObserved=false;_this.rgaIsAdjusting=false;_this.adjustRGAFeedback();});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"observeResultsList\",function(){// Interval to periodically check if the Atomic search results are ready\nvar waitForAtomic=setInterval(function(){var _loadMoreRoot$shadowR;// Look for the Atomic search results wrapper within the Coveo search component\nvar resultList=document.querySelector('.cmp-coveosearch atomic-result-list');var atomicWrapper=resultList===null||resultList===void 0?void 0:resultList.shadowRoot;// If the Atomic search results wrapper exists\nif(!atomicWrapper)return;// Select all Atomic result elements\nvar atomicResults=atomicWrapper.querySelectorAll('atomic-result');// If there are Atomic results\nif(!atomicResults.length)return;// Clear the interval since the Atomic results are now available\nclearInterval(waitForAtomic);// Iterate over each Atomic result\natomicResults.forEach(function(result,index){if(!result.shadowRoot||result._clickListenerAttached)return;result._clickListenerAttached=true;var shadow=result.shadowRoot;var link=shadow.querySelector('a');// Function to handle click events on result cards or anchor tags\nvar handleClick=function handleClick(e){var _searchBox$shadowRoot,_inputBox$value,_document$querySelect,_shadow$querySelector,_link$textContent,_analyticsTitle$inner;e.preventDefault();// Get the search term from the search input box\nvar searchBox=document.querySelector('.cmp-coveosearch atomic-search-box');var inputBox=searchBox===null||searchBox===void 0||(_searchBox$shadowRoot=searchBox.shadowRoot)===null||_searchBox$shadowRoot===void 0?void 0:_searchBox$shadowRoot.querySelector('input');var searchTerm=(inputBox===null||inputBox===void 0||(_inputBox$value=inputBox.value)===null||_inputBox$value===void 0?void 0:_inputBox$value.trim())||'';// Get the total search result count\nvar searchCount=parseInt(((_document$querySelect=document.querySelector('.cmp-coveosearch atomic-result-list'))===null||_document$querySelect===void 0||(_document$querySelect=_document$querySelect.getAttribute('data-totalcount'))===null||_document$querySelect===void 0?void 0:_document$querySelect.replace(/[^\\d]/g,''))||'0',10);// Get the result rank from hidden field or fallback to index\nvar rankText=((_shadow$querySelector=shadow.querySelector('.hidden-coveo-analytics-data'))===null||_shadow$querySelector===void 0?void 0:_shadow$querySelector.innerHTML)||\"\".concat(index+1);var rank=parseInt(rankText,10)||null;var cardTitle=(link===null||link===void 0||(_link$textContent=link.textContent)===null||_link$textContent===void 0?void 0:_link$textContent.trim())||'';var analyticsTitle=shadow.querySelector('.result-title')||shadow.querySelector('h2');var description=(analyticsTitle===null||analyticsTitle===void 0||(_analyticsTitle$inner=analyticsTitle.innerHTML)===null||_analyticsTitle$inner===void 0?void 0:_analyticsTitle$inner.replace(/<[^>]+>/g,''))||'';var redirectURL=(link===null||link===void 0?void 0:link.href)||window.location.href;var eVar59=undefined;if(result.classList.contains('is-featured')){eVar59=\"Featured Result : \".concat(cardTitle);}// Push analytics event to Adobe Data Layer\n;(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('Coveosearch',{eVars:{eVar5:searchTerm,eVar12:'Analytics : Event : Coveo Result Click',eVar51:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount),eVar64:rank,eVar59:eVar59},events:{event1to100:{event13:{value:1}}},searchInfo:{onsiteSearchTerm:searchTerm,numberOfSearchResults:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount),resultRank:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(rank),onsiteSearchResultClickThrough:1},pageInfo:{launchRule:'Analytics : Event : Coveo Result Click'},linkInfo:{linkName:eVar59}
1,webInteraction:{name:cardTitle,description:description,url:redirectURL}});// Delay redirection to ensure tracking is pushed\nsetTimeout(function(){window.location.href=redirectURL;},700);};// If anchor tag exists and no listener attached, attach click event\nif(link&&!link._listenerAttached){link._listenerAttached=true;link.addEventListener('click',handleClick);}// Attach click listener to the entire result tile as fallback\nresult.addEventListener('click',function(e){if(e.target.tagName.toLowerCase()!=='a'&&!result._eventFired){result._eventFired=true;// Prevent multiple event fires\nhandleClick(e);}});});var loadMoreRoot=document.querySelector('.cmp-coveosearch atomic-load-more-results');var buttonEl=loadMoreRoot===null||loadMoreRoot===void 0||(_loadMoreRoot$shadowR=loadMoreRoot.shadowRoot)===null||_loadMoreRoot$shadowR===void 0?void 0:_loadMoreRoot$shadowR.querySelector('button');if(buttonEl){buttonEl.setAttribute('aria-label',buttonEl.textContent);}},50);// Check every 50 milliseconds for Atomic results\n});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"loadMoreTracker\",function(){// Observe changes in the DOM related to Coveo search results\nvar targetNode=document.querySelector('.cmp-coveosearch atomic-result-list');(0,_clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__/* .observeCoveoChange */ .bL)(targetNode,'data-totalcount',function(){// Whenever a change is detected, call observeResultsList function\n_this.observeResultsList();if(!_this._recentlySugReset){_this.resetRGAState();}_this._recentlySugReset=false;},2000);});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"suggestionTracker\",function(){// Set up an interval to continuously check for Atomic search results\nvar waitForAtomic=setInterval(function(){var searchBox=document.querySelector('.cmp-coveosearch atomic-search-box');var shadow=searchBox===null||searchBox===void 0?void 0:searchBox.shadowRoot;// If the Atomic search Box wrapper exists\nif(shadow!==null){var inputBox=shadow.querySelector('input');var searchButton=shadow.querySelector('.btn-primary');var fromArrow=false;// If input exists, proceed\nif(inputBox){clearInterval(waitForAtomic);// Observe suggestion box expansion\n(0,_clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__/* .observeCoveoChange */ .bL)(inputBox,'aria-expanded',function(){(0,_clientlibs_common_publish_src_js_utils_coveo_helpers__WEBPACK_IMPORTED_MODULE_5__/* .suggestionObserveChange */ .J5)('coveo_search_suggestion',// Track ID for the suggestion click event\n'.cmp-coveosearch atomic-search-box',inputBox);},200);inputBox.addEventListener('keydown',function(e){if(e.key==='ArrowDown'||e.key==='ArrowUp'){fromArrow=true;}});inputBox.addEventListener('keyup',function(e){if(e.key==='Enter'){var searchTerm=inputBox.value.trim();// Reset RGA processing state when new search is initiated\n_this.resetRGAState();_this._recentlySugReset=true;setTimeout(function(){var _document$querySelect2;var searchCount=((_document$querySelect2=document.querySelector('.cmp-coveosearch atomic-result-list'))===null||_document$querySelect2===void 0?void 0:_document$querySelect2.getAttribute('data-totalcount'))||'0';var eventName=fromArrow?'Analytics : Event : Coveo suggestion click':'Analytics : Event : Coveo Search';fromArrow=false;(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('Coveosearch',{eVars:{eVar5:searchTerm,eVar12:eventName,eVar51:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount)},events:{event1to100:{event5:{value:1}}},searchInfo:{onsiteSearchTerm:searchTerm,numberOfSearchResults:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount),onsiteSearch:1},pageInfo:{launchRule:eventName},webInteraction:{url:window.location.href}});},2000);// Increased timeout to ensure data is ready\n}});if(searchButton){searchButton.addEventListener('click',function(){var searchTerm=inputBox.value.trim();// Reset RGA processing state when new search is initiated\n_this.resetRGAState();_this._recentlySugReset=true;setTimeout(function(){var _document$querySelect3;var searchCount=((_document$querySelect3=document.querySelector('.cmp-coveosearch atomic-result-list'))===null||_document$querySelect3===void 0?void 0:_document$querySelect3.getAttribute('data-totalcount'))||'0';(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('Coveosearch',{eVars:{eVar5:searchTerm,eVar12:'Analytics : Event : Coveo Search',eVar51:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount)},events:{event1to100:{event5:{value:1}}},searchInfo:{onsiteSearchTerm:searchTerm,numberOfSearchResults:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(searchCount),onsiteSearch:1},pageInfo:{launchRule:'Analytics : Event : Coveo Search'},webInteraction:{url:window.location.href}});},600);});}// MutationObserver to track dynamic suggestion buttons\nvar observer=new MutationObserver(function(){var buttons=shadow.querySelectorAll('button[id^=\"atomic-search-box\"]');
1buttons.forEach(function(btn){if(!btn._listenerAttached){btn._listenerAttached=true;btn.addEventListener('click',function(){// Reset RGA processing state when suggestion clicked\n_this.resetRGAState();_this._recentlySugReset=true;setTimeout(function(){var _btn$textContent,_document$querySelect4;var term=(_btn$textContent=btn.textContent)===null||_btn$textContent===void 0?void 0:_btn$textContent.trim();var count=((_document$querySelect4=document.querySelector('.cmp-coveosearch atomic-result-list'))===null||_document$querySelect4===void 0?void 0:_document$querySelect4.getAttribute('data-totalcount'))||'0';if(term){(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('Coveosearch',{eVars:{eVar5:term,eVar12:'Analytics : Event : Coveo suggestion click',eVar51:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(count)},events:{event1to100:{event5:{value:1}}},searchInfo:{onsiteSearchTerm:term,numberOfSearchResults:(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .convertCountToString */ .$A)(count),onsiteSearch:1},pageInfo:{launchRule:'Analytics : Event : Coveo suggestion click'},webInteraction:{url:window.location.href}});}},2000);// Delay event by 2 seconds\n});}});});observer.observe(shadow,{childList:true,subtree:true});}}},100);// Check every 10 milliseconds for Atomic Search Box\n});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"rgaObserver\",function(element){// Observe changes in the RGA component container\nvar rgaContainer=element;var conf={attributes:true,characterData:true,childList:true,subtree:true};var debounceTimer=null;var lastRgaElement=null;var callback=function callback(mutationsList,observer){// Check if RGA was removed (indicates new search is happening)\nvar _iterator=_createForOfIteratorHelper(mutationsList),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var mutation=_step.value;if(mutation.type==='childList'){mutation.removedNodes.forEach(function(node){if(node.classList&&node.classList.contains('rga-result')){// RGA was removed - reset flags for new search\n_this.rgaIsAdjusting=false;_this.retryRgaCount=0;lastRgaElement=null;// Clear any existing debounce timer\nif(debounceTimer){clearTimeout(debounceTimer);debounceTimer=null;}}});}}// Clear any existing debounce timer\n}catch(err){_iterator.e(err);}finally{_iterator.f();}if(debounceTimer){clearTimeout(debounceTimer);}// Debounce the adjustment to prevent rapid re-fires\ndebounceTimer=setTimeout(function(){var rgaResult=document.querySelector('.rga-result');// Check if this is a new RGA element (different from last one)\nvar isNewRga=rgaResult&&rgaResult!==lastRgaElement;if(rgaResult){if(!_this.rgaIsAdjusting||isNewRga){if(isNewRga){lastRgaElement=rgaResult;// If it's a new RGA, reset the flag before processing\n_this.rgaIsAdjusting=false;_this.retryRgaCount=0;}// Clear polling fallback if it's running\nif(_this.rgaPollingTimer){clearTimeout(_this.rgaPollingTimer);_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;}_this.adjustRGAFeedback();}}},50);};// Create an observer instance linked to the callback function\nvar observer=new MutationObserver(callback);// Start observing the target node for configured mutations\nif(rgaContainer){observer.observe(rgaContainer,conf);}return observer;});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"retryRgaCount\",0);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"rgaPollingAttempts\",0);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"rgaPollingTimer\",null);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"lastProcessedRga\",null);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"mainRgaObserver\",null);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"rgaAnswerExpanded\",false);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"_recentlySugReset\",false);(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"resetRGAState\",function(){// Reset flags to allow processing of new RGA\n_this.rgaIsAdjusting=false;_this.retryRgaCount=0;_this.lastProcessedRga=null;_this.rgaAnswerExpanded=false;// Clear polling if running\nif(_this.rgaPollingTimer){clearTimeout(_this.rgaPollingTimer);_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;}// Disconnect shadow content watcher â a fresh one will be set up on next adjustment\nif(_this._rgaContentWatcher){clearTimeout(_this._rgaContentWatcherDebounce);_this._rgaContentWatcher.disconnect();_this._rgaContentWatcher=null;}// Start actively looking for new RGA with polling fallback\n// This handles cases where RGA is updated in-place rather than removed/added\n_this.startRGAPolling();});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"adjustRGAFeedback\",function(){// Check if RGA container exists first\nvar rgaContainer=document.querySelector('.rga-result');if(!rgaContainer){// RGA not yet loaded, set up observer and fallback polling\n_this.setupRGAObserverAndFallback();return;}
1// Check if this is a new RGA element\nvar isNewRga=rgaContainer!==_this.lastProcessedRga;// Prevent overlapping adjustments (unless it's a new RGA)\nif(_this.rgaIsAdjusting&&!isNewRga){return;}// If it's a new RGA, reset everything\nif(isNewRga){_this.rgaIsAdjusting=false;_this.retryRgaCount=0;}_this.rgaIsAdjusting=true;_this.lastProcessedRga=rgaContainer;// Reset retry counter for this attempt\n_this.retryRgaCount=0;// Clear any polling fallback since RGA is now present\nif(_this.rgaPollingTimer){clearTimeout(_this.rgaPollingTimer);_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;}var rgaFeedback=rgaContainer.previousElementSibling;// First, wait for shadowRoot to be initialized\nvar rgaShadowRoot;_this.waitForShadowRoot(rgaContainer,10000).then(function(shadowRoot){// Store shadowRoot for later use in the promise chain\nrgaShadowRoot=shadowRoot;// Disconnect any previous watcher before creating a new one\nif(_this._rgaContentWatcher){clearTimeout(_this._rgaContentWatcherDebounce);_this._rgaContentWatcher.disconnect();_this._rgaContentWatcher=null;}_this._rgaContentWatcherDebounce=null;var watcher=new MutationObserver(function(){var liveFeedbackEl=rgaShadowRoot.querySelector('.feedback-buttons');if(liveFeedbackEl&&!liveFeedbackEl.hasAttribute('part')){liveFeedbackEl.style.visibility='hidden';}clearTimeout(_this._rgaContentWatcherDebounce);_this._rgaContentWatcherDebounce=setTimeout(function(){var flexEl=rgaShadowRoot.querySelector('aside article div > div.flex');var feedbackEl=rgaShadowRoot.querySelector('.feedback-buttons');var headerNeedsWork=flexEl&&!flexEl.hasAttribute('part');var feedbackNeedsWork=feedbackEl&&!feedbackEl.hasAttribute('part');if((headerNeedsWork||feedbackNeedsWork)&&!_this.rgaIsAdjusting){_this.lastProcessedRga=null;_this.adjustRGAFeedback();}},200);});_this._rgaContentWatcher=watcher;watcher.observe(rgaShadowRoot,{childList:true,subtree:true});// Now that shadowRoot is ready, wait for the internal elements\nreturn _this.waitForShadowDomElement(shadowRoot,'aside article div > div.flex',20000);}).then(function(element){// Add part attribute for header section\nif(element.getAttribute('part')!=='rga-header'){element.setAttribute('part','rga-header');}// Modify header text to include \"AI-Generated Answer\" and \"BETA\" badge\nvar headerText=element.querySelector(\"div[part='header-label']\");if(headerText&&!headerText.querySelector('.header-one')){var _window$Granite,_window$Granite2;headerText.innerHTML=\"<span class=\\\"header-one\\\">\".concat((_window$Granite=window.Granite)===null||_window$Granite===void 0||(_window$Granite=_window$Granite.I18n)===null||_window$Granite===void 0?void 0:_window$Granite.getMessage('AI Generated Answer'),\"</span> <span class=\\\"header-two\\\" style=\\\"margin-left:8px;height: 16px;min-width: 42px;flex-shrink: 0;border-radius:2px;background-color:#fff;display:flex;align-items: center;justify-content:center;font-weight: 700;font-size: 12px;line-height: 12px;padding: 2px 8px;letter-spacing: .5px;color: #0f2e66;\\\">\").concat((_window$Granite2=window.Granite)===null||_window$Granite2===void 0||(_window$Granite2=_window$Granite2.I18n)===null||_window$Granite2===void 0?void 0:_window$Granite2.getMessage('BETA'),\"</span>\");}// Style adjustments for feedback buttons\nreturn _this.waitForShadowDomElement(rgaShadowRoot,'.feedback-buttons',20000);}).then(function(feedback){var _rgaFeedback$shadowRo;// Verify the RGA element we're processing is still in the DOM and matches what we started with\nif(!rgaContainer||!rgaContainer.isConnected||!rgaShadowRoot){_this.rgaIsAdjusting=false;console.warn('RGA container no longer in DOM or shadowRoot unavailable - likely replaced by new search');return;}// Double-check this is still the RGA we should be processing\nvar currentRga=document.querySelector('.rga-result');if(currentRga!==rgaContainer){_this.rgaIsAdjusting=false;return;}// Add part attribute for feedback section\nif(feedback.getAttribute('part')!=='rga-feedback'){feedback.setAttribute('part','rga-feedback');}var feedBackParent=feedback.parentElement;var rgaFeedback=rgaContainer.previousElementSibling;//Thumbs Up / Thumbs Down tracking\nif(!feedback._listenerAttached){feedback._listenerAttached=true;feedback.addEventListener('click',function(e){var target=e.target.closest('button.feedback-button');if(!target)return;
1var searchTerm=_this.getSearchTerm();var eVar12Value='';var eVar59Value='';if(target.classList.contains('like')){eVar12Value='Generative Answer Positive Reaction';eVar59Value='Generative Answer : Thumbs Up';}else if(target.classList.contains('dislike')){eVar12Value='Generative Answer Negative Reaction';eVar59Value='Generative Answer : Thumbs Down';}else{return;};(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('linkInteraction',{eVars:{eVar5:searchTerm,eVar12:eVar12Value,eVar59:eVar59Value},searchInfo:{onsiteSearchTerm:searchTerm},pageInfo:{launchRule:eVar12Value},linkInfo:{linkName:eVar59Value}});});}// Change \"Citations\" label to \"Sources\"\nvar citations=feedback.parentElement.querySelector('[part=\"citations-label\"]');if(citations&&!citations.dataset.relabelled){var _window$Granite3;citations.innerText=(_window$Granite3=window.Granite)===null||_window$Granite3===void 0||(_window$Granite3=_window$Granite3.I18n)===null||_window$Granite3===void 0?void 0:_window$Granite3.getMessage('Sources');citations.dataset.relabelled='true';}// Adjust Show More / Less button styles\nvar footerShowMore=feedback.closest(\"div[part='generated-content']\").querySelector('button[part=\"answer-show-button\"] div');if(footerShowMore){footerShowMore.classList.remove('font-light');}// Adjust feedback button icon colors\nvar buttonsIcons=feedback.querySelectorAll(\".feedback-buttons [part='feedback-button'] atomic-icon\");var copyButton=feedback.querySelector(\".feedback-buttons [part='copy-button']\");var copyButtonIcon=feedback.querySelector(\".feedback-buttons [part='copy-button'] .icon-container\");// copy text click tracking\nif(copyButton&&!copyButton._listenerAttached){copyButton._listenerAttached=true;copyButton.addEventListener('click',function(){var searchTerm=_this.getSearchTerm();(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('linkInteraction',{eVars:{eVar5:searchTerm,eVar12:'Generative Answer Copy Click',eVar59:'Generative Answer : Copy'},searchInfo:{onsiteSearchTerm:searchTerm},pageInfo:{launchRule:'Generative Answer Copy Click'},linkInfo:{linkName:'Generative Answer : Copy'}});});}var feedbackAnswers=rgaFeedback===null||rgaFeedback===void 0||(_rgaFeedback$shadowRo=rgaFeedback.shadowRoot)===null||_rgaFeedback$shadowRo===void 0?void 0:_rgaFeedback$shadowRo.querySelectorAll('form .options');feedbackAnswers===null||feedbackAnswers===void 0||feedbackAnswers.forEach(function(answer){if(answer){var answerInputs=answer.querySelectorAll('input');answer.style.flexShrink='0';answerInputs.forEach(function(input){input.style.width='auto';});}});if(!feedback.closest('.disclaimer-feedback')){var _feedback$closest,_window$Granite4,_window$Granite5;var staleWrapper=(_feedback$closest=feedback.closest('.footer'))===null||_feedback$closest===void 0?void 0:_feedback$closest.querySelector('.disclaimer-feedback');var article=feedBackParent.closest('article');// Validate required elements exist before proceeding\nif(!article){console.warn('Article element not found in RGA structure');feedback.style.visibility='visible';_this.rgaIsAdjusting=false;return;}var disclaimerFeedback=document.createElement('div');var helpfulTxt=document.createElement('span');var disclaimerSlot=article.querySelector('slot[name=\"disclaimer\"]');var disclaimerText=disclaimerSlot===null||disclaimerSlot===void 0?void 0:disclaimerSlot.parentElement;var genteratedAnswerFooter=article.querySelector('div[part=\"generated-answer-footer\"]');var hr=document.createElement('hr');var copyTxtSpan=document.createElement('span');var showMoreButton=article.querySelector('button[part=\"answer-show-button\"]');// Verify critical elements exist\nif(!disclaimerText||!genteratedAnswerFooter){console.warn('Required RGA elements not found:',{disclaimerText:!!disclaimerText,genteratedAnswerFooter:!!genteratedAnswerFooter});feedback.style.visibility='visible';_this.rgaIsAdjusting=false;return;}copyTxtSpan.innerText=(_window$Granite4=window.Granite)===null||_window$Granite4===void 0||(_window$Granite4=_window$Granite4.I18n)===null||_window$Granite4===void 0?void 0:_window$Granite4.getMessage('Copy Text');if(showMoreButton){var isCollapsible=showMoreButton.parentElement.classList.contains('is-collapsible')||showMoreButton.classList.contains('ripple-parent');if(copyButton){copyButton.style.display=!isCollapsible||_this.rgaAnswerExpanded?'flex':'none';}if(isCollapsible&&!showMoreButton._listenerAttached){showMoreButton._listenerAttached=true;if(copyButton){copyButton.style.display=_this.rgaAnswerExpanded?'flex':'none';}showMoreButton.addEventListener('click',function(){var wasExpanded=_this.rgaAnswerExpanded;_this.rgaAnswerExpanded=!wasExpanded;
1if(copyButton){copyButton.style.display=_this.rgaAnswerExpanded?'flex':'none';}// Tracking Show More / Show Less clicks\nsetTimeout(function(){var eVar12Value=wasExpanded?'Generative Answer Show Less Click':'Generative Answer Show More Click';var eVar59Value=wasExpanded?'Generative Answer : Show Less':'Generative Answer : Show More';var searchTerm=_this.getSearchTerm();(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('linkInteraction',{eVars:{eVar5:searchTerm,eVar12:eVar12Value,eVar59:eVar59Value},searchInfo:{onsiteSearchTerm:searchTerm},pageInfo:{launchRule:eVar12Value},linkInfo:{linkName:eVar59Value}});//Attach click listeners to dynamically rendered source links\n_this.waitForShadowDomElement(rgaShadowRoot,'.citations-container',5000).then(function(citationsContainer){var sourceLinks=citationsContainer.querySelectorAll('a');sourceLinks.forEach(function(link){if(!link._listenerAttached){link._listenerAttached=true;link.addEventListener('click',function(e){var sourceTitle=link.textContent.trim();var searchTerm=_this.getSearchTerm();(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('linkInteraction',{eVars:{eVar5:searchTerm,eVar12:'Generative Answer Source Click',eVar59:\"Generative Answer : \".concat(sourceTitle)},searchInfo:{onsiteSearchTerm:searchTerm},pageInfo:{launchRule:'Generative Answer Source Click'},linkInfo:{linkName:\"Generative Answer : \".concat(sourceTitle)},webInteraction:{url:link.href,name:sourceTitle}});});}});});},50);// Small delay\n});}}// Tracking Toggle Switch click\nvar toggleButton=rgaShadowRoot.querySelector('button[role=\"switch\"]');if(toggleButton&&!toggleButton._listenerAttached){toggleButton._listenerAttached=true;toggleButton.addEventListener('click',function(){setTimeout(function(){var isEnabled=toggleButton.getAttribute('aria-checked')==='true';var searchTerm=_this.getSearchTerm();var eVar12Value=isEnabled?'Generative Answer Enabled':'Generative Answer Disabled';var eVar59Value=isEnabled?'Generative Answer : Enable':'Generative Answer : Disable';(0,_core_components_datalayer_datalayer__WEBPACK_IMPORTED_MODULE_6__/* .trackAdobeEvent */ .F0)('linkInteraction',{eVars:{eVar5:searchTerm,eVar12:eVar12Value,eVar59:eVar59Value},searchInfo:{onsiteSearchTerm:searchTerm},pageInfo:{launchRule:eVar12Value},linkInfo:{linkName:eVar59Value}});},10);});}if(copyButton){copyButton.style.gap='4px';copyButton.style.color='#0057ae';var copyButtonDiv=copyButton.querySelector('div');if(copyButtonDiv){copyButtonDiv.style.color='#0057ae';}copyTxtSpan.style.color='#0057ae;';copyTxtSpan.style.fontWeight='700';copyTxtSpan.style.fontSize='16px';copyTxtSpan.style.lineHeight='24px';}disclaimerFeedback.classList.add('disclaimer-feedback');disclaimerFeedback.setAttribute('part','disclaimer-feedback');hr.style.height='1px';hr.style.backgroundColor='rgb(40, 40, 41)';hr.style.margin='16px 0 0';hr.style.border='0 solid rgb(40, 40, 41)';helpfulTxt.innerText=(_window$Granite5=window.Granite)===null||_window$Granite5===void 0||(_window$Granite5=_window$Granite5.I18n)===null||_window$Granite5===void 0?void 0:_window$Granite5.getMessage('Was This Helpful?');helpfulTxt.classList.add('helpful-text');helpfulTxt.setAttribute('part','helpful-text');genteratedAnswerFooter.style.flexDirection='row !important';feedBackParent.appendChild(disclaimerFeedback);disclaimerFeedback.appendChild(disclaimerText);feedback.prepend(helpfulTxt);disclaimerFeedback.appendChild(feedback);if(copyButton){genteratedAnswerFooter.appendChild(copyButton);copyButton.appendChild(copyTxtSpan);}feedBackParent.appendChild(hr);feedBackParent.style.flexDirection='column';feedBackParent.style.gap='16px';staleWrapper===null||staleWrapper===void 0||staleWrapper.remove();}feedback.classList.remove('flex','h-9','absolute','top-6','shrink-0','gap-2','right-20');feedback.style.display='flex';feedback.style.flexDirection='row';feedback.style.order='2';feedback.style.alignItems='center';feedback.style.flexShrink='0';feedback.style.visibility='visible';_this.rgaIsAdjusting=false;}
1)[\"catch\"](function(error){var _rgaShadowRoot;_this.rgaIsAdjusting=false;console.error('â Error adjusting RGA feedback:',error);(_rgaShadowRoot=rgaShadowRoot)===null||_rgaShadowRoot===void 0||(_rgaShadowRoot=_rgaShadowRoot.querySelector('.feedback-buttons'))===null||_rgaShadowRoot===void 0||_rgaShadowRoot.style.removeProperty('visibility');// Reset lastProcessedRga so it can be retried\nif(_this.retryRgaCount>=3){console.error('Max retries reached for RGA adjustment');_this.lastProcessedRga=null;}});});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"setupRGAObserverAndFallback\",function(){// Set up mutation observer on the parent container to watch for RGA appearing\n// The observer should ALWAYS be active since searches are dynamic\nif(!_this.rgaBeingObserved){var searchInterfaceWrapper=document.querySelector('#cmp-coveosearch');if(searchInterfaceWrapper){_this.rgaBeingObserved=true;var observer=_this.rgaObserver(searchInterfaceWrapper);// Store the observer instance so it continues watching indefinitely\n_this.mainRgaObserver=observer;}}// Start fallback polling mechanism\n_this.startRGAPolling();});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"startRGAPolling\",function(){// Clear any existing polling timer\nif(_this.rgaPollingTimer){clearTimeout(_this.rgaPollingTimer);}// Exponential backoff: 200ms, 400ms, 600ms, 800ms, 1000ms, 1500ms, 2000ms\nvar delays=[200,400,600,800,1000,1500,2000];if(_this.rgaPollingAttempts>=delays.length){// Stop polling after max attempts\n_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;return;}var delay=delays[_this.rgaPollingAttempts];_this.rgaPollingTimer=setTimeout(function(){var rgaContainer=document.querySelector('.rga-result');var isNewRga=rgaContainer&&rgaContainer!==_this.lastProcessedRga;if(rgaContainer&&(!_this.rgaIsAdjusting||isNewRga)){// RGA found! Process it and stop polling\n_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;// Reset flag if it's a new RGA\nif(isNewRga){_this.rgaIsAdjusting=false;_this.retryRgaCount=0;}_this.lastProcessedRga=rgaContainer;_this.adjustRGAFeedback();}else if(rgaContainer){// Stop polling if RGA exists and is being processed\n_this.rgaPollingTimer=null;_this.rgaPollingAttempts=0;}else{// Continue polling with next delay\n_this.rgaPollingAttempts++;_this.startRGAPolling();}},delay);});(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__/* [\"default\"] */ .A)(this,\"watchFeaturedResults\",function(){var waitForShadow=setInterval(function(){var resultList=document.querySelector('.cmp-coveosearch atomic-result-list');var shadow=resultList===null||resultList===void 0?void 0:resultList.shadowRoot;if(!shadow)return;clearInterval(waitForShadow);var applyFeatured=function applyFeatured(result){var _result$result;var isFeatured=((_result$result=result.result)===null||_result$result===void 0?void 0:_result$result.rankingModifier)==='FeaturedResult';result.classList.toggle('is-featured',isFeatured);};shadow.querySelectorAll('atomic-result').forEach(applyFeatured);_this._featuredObserver=new MutationObserver(function(){shadow.querySelectorAll('atomic-result').forEach(applyFeatured);});_this._featuredObserver.observe(shadow,{childList:true,subtree:true});},50);});}return (0,_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__/* [\"default\"] */ .A)(CoveoSearch,[{key:\"getSearchTerm\",value:function getSearchTerm(){var _searchBox$shadowRoot2,_inputBox$value2;var searchBox=document.querySelector('.cmp-coveosearch atomic-search-box');var inputBox=searchBox===null||searchBox===void 0||(_searchBox$shadowRoot2=searchBox.shadowRoot)===null||_searchBox$shadowRoot2===void 0?void 0:_searchBox$shadowRoot2.querySelector('input');return(inputBox===null||inputBox===void 0||(_inputBox$value2=inputBox.value)===null||_inputBox$value2===void 0?void 0:_inputBox$value2.trim())||'';}},{key:\"waitForShadowRoot\",value:function waitForShadowRoot(element){var _this2=this;var timeout=arguments.length>1&&arguments[1]!==undefined?arguments[1]:10000;return new Promise(function(resolve,reject){var startTime=Date.now();
1var _checkShadowRoot=function checkShadowRoot(){if(element.shadowRoot){resolve(element.shadowRoot);}else if(Date.now()-startTime<timeout){requestAnimationFrame(_checkShadowRoot);}else{if(_this2.retryRgaCount<3){_this2.retryRgaCount++;// Don't reset rgaBeingObserved - keep the observer active!\n_this2.rgaIsAdjusting=false;setTimeout(function(){return _this2.adjustRGAFeedback();},200*_this2.retryRgaCount);}reject(new Error(\"Shadow root not initialized within \".concat(timeout,\"ms timeout. Retry attempt \").concat(_this2.retryRgaCount,\"/3\")));}};requestAnimationFrame(_checkShadowRoot);});}},{key:\"waitForShadowDomElement\",value:function waitForShadowDomElement(shadowRoot,selector){var _this3=this;var timeout=arguments.length>2&&arguments[2]!==undefined?arguments[2]:5000;return new Promise(function(resolve,reject){var startTime=Date.now();var _checkElement=function checkElement(){if(!shadowRoot){reject(new Error('Shadow root is null or undefined'));return;}var element=shadowRoot.querySelector(selector);if(element){resolve(element);}else if(Date.now()-startTime<timeout){requestAnimationFrame(_checkElement);}else{if(_this3.retryRgaCount<3){_this3.retryRgaCount++;// Don't reset rgaBeingObserved - keep the observer active!\n_this3.rgaIsAdjusting=false;setTimeout(function(){return _this3.adjustRGAFeedback();},200*_this3.retryRgaCount);}reject(new Error(\"Shadow DOM element with selector \\\"\".concat(selector,\"\\\" not found within \").concat(timeout,\"ms timeout. Retry attempt \").concat(_this3.retryRgaCount,\"/3\")));}};requestAnimationFrame(_checkElement);});}},{key:\"run\",value:function run(){this.init();this.loadMoreTracker();this.suggestionTracker();this.watchFeaturedResults();}},{key:\"destroy\",value:function destroy(){var _this$_featuredObserv;(_this$_featuredObserv=this._featuredObserver)===null||_this$_featuredObserv===void 0||_this$_featuredObserv.disconnect();if(this._rgaContentWatcher){clearTimeout(this._rgaContentWatcherDebounce);this._rgaContentWatcher.disconnect();this._rgaContentWatcher=null;}}}]);}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CoveoSearch);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, [\n/* harmony export */ \"default\", 0, __WEBPACK_DEFAULT_EXPORT__\n/* harmony export */ ]);\n\n\n//# sourceURL=webpack://ui.apps/./src/main/content/jcr_root/apps/atlas/components/content/coveo-search/v1/coveo-search/coveo-search.js?\n}")}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.