PageSourceSearch

https://s1.48hourprint.com/assets/vendor/dri/dri-tooltip-library/dist/tooltip.js

js 48hourprint.com collected 2026-10-03 22:11:54 UTC 11,455 bytes, 1 lines download raw bytes

1var DriTooltip=function(t){var e={};function o(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,o),s.l=!0,s.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)o.d(i,s,function(e){return t[e]}.bind(null,s));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=0)}([function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TooltipComponent=void 0;var i=o(1),s=o(2),n=function(){function t(t,e){this.is_active=!1,this.tooltip_data={wrapper_class:null,content_class:null,custom_class:[],api_endpoint:null,tooltip_id:0,tooltip_title_enabled:!1,tooltip_title:null,tooltip_title_tag:null,trigger:["click","keydown"],display_type:"popover",tooltip_arrow:!1,tooltip_class:"",modal_class:"",close_btn:{show:!0,text:"close",class:"tooltip-close-button",position:"bottom",container_class:"close-btn-container",btn_icon_enabled:!0},isActive:null},this.events=new s.EventEmitter,"object"==typeof e&&Object.assign(this.tooltip_data,e),this.HttpService=new i.HttpService,this.tooltip_element=t,this.tooltip_display_type=e.dis
1play_type,this.tooltip_trigger_type=e.trigger,this.setTriggerType(this.tooltip_trigger_type,this.tooltip_display_type),window.Element.prototype.matches||(window.Element.prototype.matches=window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector),"remove"in window.Element.prototype||(window.Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}return t.prototype.buildTooltip=function(){var t=this;this.events.emit("tooltip","loading",!0);var e=document.createElement("div");e.setAttribute("style","display: none;");var o=document.createElement("div");if(o.setAttribute("class",this.tooltip_data.content_class),e.appendChild(o),this.tooltip_data.tooltip_arrow){var i=document.createElement("span");i.setAttribute("class","tooltip-arrow"),this.tooltip_element.appendChild(i)}if(this.tooltip_data.close_btn&&this.tooltip_data.close_btn.show){var s=document.createElement("div");s.classList.add(this.tooltip_data.close_btn.container_class);var n=document.createElement("span"),l=this.tooltip_data.close_btn.text?this.tooltip_data.close_btn.text:"",a=this.tooltip_data.close_btn.class?this.tooltip_data.close_btn.class:"";n.classList.add(a),n.innerHTML=l,n.setAttribute("tabindex","0"),n.setAttribute("role","button"),s.appendChild(n),"top"==this.tooltip_data.close_btn.position?e.insertBefore(s,e.childNodes[0]):e.appendChild(s),this.closeTooltip=this.closeTooltip.bind(this),n.addEventListener("click",this.closeTooltip),n.addEventListener("keyup",(function(t){13===t.keyCode&&(t.preventDefault(),n.click())}))}this.tooltip_element.appendChild(e),"popover"==this.tooltip_data.display_type&&(this.setCloseEvent=this.setCloseEvent.bind(this),document.addEventListener("click",this.setCloseEvent),document.addEventListener("focusin",this.setCloseEvent));var r=this.getTooltipContents();r.promise.then((function(i){var s=i.response;if(i.success){t.events.emit("tooltip","content",!0);var n=s.tooltip_html?s.tooltip_html:"",l=(s.tooltip_css?s.tooltip_css:"")+n;t.tooltip_data.tooltip_title_enabled&&(t.tooltip_data.tooltip_title=s.tooltip_desc),o.innerHTML=l,s.tooltip_js&&(t.tooltip_js=s.tooltip_js,"popover"==t.tooltip_display_type&&t.setScriptTag(e)),t.tooltip_contents=e,e.hasAttribute("hidden")||t.showTooltip(t.tooltip_display_type)}})),this.tooltipSubscription=r},t.prototype.getTooltipContents=function(){return this.HttpService.ajax(this.tooltip_data.api_endpoint+"/"+this.tooltip_data.tooltip_id)},t.prototype.setTriggerType=function(t,e){if(this.handleTriggers=this.handleTriggers.bind(this),t instanceof Array)for(var o in t)this.tooltip_element.addEventListener(t[o],this.handleTriggers);else this.tooltip_element.addEventListener(t,this.handleTriggers)},t.prototype.handleTriggers=function(t){if(t.keyCode&&13!=t.keyCode)return!1;if(this.events.emit("tooltip","trigger",!0),null!=this.tooltip_data.isActive){if(t.stopPropagation(),this.tooltip_contents&&this.tooltip_data.isActive)return this.tooltip_contents.setAttribute("hidden","true"),this.tooltip_contents.setAttribute("style","display: none;"),this.tooltip_data.isActive=!1,!0;this.tooltip_data.isActive=!this.tooltip_data.isActive}else t.preventDefault();for(var e=document.querySelectorAll("."+this.tooltip_data.wrapper_class),o=0;o<e.length;o++){var i=e[o];i.setAttribute("hidden","true"),i.setAttribute("style","display: none;")}this.tooltipSubscription?(this.events.emit("tooltip","loading",!0),this.tooltip_contents&&this.showTooltip(this.tooltip_display_type)):this.buildTooltip()},t.prototype.showTooltip=function(t){if(null!=this.tooltip_data.isActive&&!this.tooltip_data.isActive)return!1;switch(t){case"popover":this.popOver();break;case"modal":this.openModal();break;default:this.popOver()}},t.prototype.popOver=function(){for(var t=document.getElementsByClassName("tooltip-arrow"),e=0;e<t.length;e++)t[e].setAttribute("style","visibility:hidden;");if(this.tooltip_contents.classList.add(this.tooltip_data.wrapper_class),this.tooltip_contents.firstElementChild.classList.add(this.tooltip_data.content_class),this.tooltip_contents.removeAttribute("hidden"),this.tooltip_contents.setAttribute("tabindex","0"),this.tooltip_contents.setAttribute("style","display: block;"),this.tooltip_contents.focus(),this.tooltip_data.tooltip_arrow&&this.tooltip_element.querySelector(".tooltip-arrow").setAttribute("style","visibility:visible;"),this.tooltip_data.custom_class.length){var o=this.tooltip_data.custom_class;for(var e in o)this.tooltip_contents.classList.add(o[e])}},t.prototype.setCloseEvent=function(t){var e=t.target;do{if(void 0!==e.matches&&e.matches("."+this.tooltip_data.tooltip_class))return;e=e.parentNode}while(e);this.closeTooltip(t)},t.prototype.openModal=function(){var t=this,e=document.createElement("div");e.setAttribute("tabindex","0"),e.classList.add("js-focus-trap","start");var o=document.createElement("div");o.setAttribute("tabindex","0"),o.classList.add("js-focus-trap","end");var i=document.createElement("div");i.setAttribute("class",this.tooltip_data.modal_class?this.tooltip_data.modal_class:"custom-modal site-modal tooltip-modal modal");var s=document.createElement("div");s.setAttribute("class","custom-modal-backdrop");var n=document.createElement("div");n.setAttribute("class","custom-modal-dialog modal-dialog");var l=document.createElement("div");l.setAttribute("class","custom-modal-content"),l.setAttribute("tabindex","-1");var a=document.createElement("div");a.setAttribute("class","custom-modal-header modal-header"),a.setAttribute("tabindex","0");var r=document.createElement("div");
1r.setAttribute("class","custom-modal-body modal-body"),r.setAttribute("tabindex","0");var p=document.createElement("button");p.setAttribute("class",this.tooltip_data.close_btn.class?this.tooltip_data.close_btn.class:"modal-close-btn"),p.classList.add("close"),p.setAttribute("type","button"),p.setAttribute("aria-label","Close button. Press escape key to close the modal");var d=document.createElement("span");if(d.setAttribute("class","close-icon custom-close-icon"),d.textContent="×",p.appendChild(d),a.appendChild(p),this.tooltip_data.tooltip_title){var c=this.tooltip_data.tooltip_title,u=this.tooltip_data.tooltip_title_tag?this.tooltip_data.tooltip_title_tag:"span",h=document.createElement(u);h.setAttribute("class","custom-modal-title modal-title"),h.innerHTML=c,a.appendChild(h)}if(this.tooltip_data.close_btn.btn_icon_enabled){var _=document.createElement("span");_.setAttribute("class","close-icon"),_.innerHTML="&times;",p.appendChild(_)}l.appendChild(a),r.appendChild(this.tooltip_contents),l.appendChild(r),n.appendChild(e),n.appendChild(l),n.appendChild(o),i.appendChild(n),i.classList.add(this.tooltip_data.content_class),document.body.appendChild(i),document.body.appendChild(s),this.tooltip_contents.removeAttribute("hidden"),this.tooltip_contents.setAttribute("style","display: block;"),l.focus(),this.tooltip_js&&this.setScriptTag(i),i.addEventListener("click",(function(t){t.target.contains(this)&&(this.remove(),s.remove())})),i.addEventListener("keydown",(function(t){t.keyCode&&27==t.keyCode&&p.click()})),p.addEventListener("click",(function(){i.remove(),s.remove();var e=document.getElementById("tooltip_"+t.tooltip_data.tooltip_id);e&&e.focus()})),o.addEventListener("focus",(function(){document.querySelector(".custom-modal-header")&&document.querySelector(".custom-modal-header").focus()})),e.addEventListener("focus",(function(){document.querySelector(".custom-modal-body")&&document.querySelector(".custom-modal-body").focus()})),requestAnimationFrame((function(){i.classList.add("fade-in")}))},t.prototype.setScriptTag=function(t){if(this.tooltip_js){var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.innerHTML=this.tooltip_js,t.appendChild(e)}},t.prototype.closeTooltip=function(t){this.tooltip_contents&&(this.tooltip_contents.setAttribute("hidden",!0),this.tooltip_contents.setAttribute("style","display: none;")),this.tooltip_data.tooltip_arrow&&this.tooltip_element.querySelector(".tooltip-arrow").setAttribute("style","visibility: hidden;"),t.stopPropagation()},t.prototype.destroy=function(){if(this.events.clear(),this.events=null,this.tooltip_trigger_type instanceof Array)for(var t in this.tooltip_trigger_type)this.tooltip_element.removeEventListener(this.tooltip_trigger_type[t],this.handleTriggers);else this.tooltip_element.removeEventListener(this.tooltip_trigger_type,this.handleTriggers);document.removeEventListener("click",this.setCloseEvent),document.removeEventListener("focusin",this.setCloseEvent)},t}();e.TooltipComponent=n},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HttpService=void 0;var i=function(){function t(){}return t.prototype.ajax=function(t,e,o,i){void 0===e&&(e="GET"),void 0===o&&(o={}),void 0===i&&(i={});var s=new XMLHttpRequest;return{promise:new Promise((function(n,l){if(s.open(e,t),s.setRequestHeader("Content-type","application/json"),i)for(var a in i)s.setRequestHeader(a,i[a]);s.onload=function(){4===s.readyState&&200===s.status?n(JSON.parse(this.responseText)):l(Error(s.statusText))},s.onerror=function(){l(Error("Network Error"))},s.send(JSON.stringify(o))})),http:s}},t}();e.HttpService=i},function(t,e,o){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EventEmitter=void 0;var i=function(){function t(){this.events={},this.events={}}return t.prototype.subscribe=function(t,e,o){var i=this,s=t+":"+e;return this.events[s]||(this.events[s]=[]),this.events[s].push(o),function(){i.events[s]=i.events[s].filter((function(t){return o!==t}))}},t.prototype.emit=function(t,e,o){var i=t+":"+e,s=this.events[i];s&&s.forEach((function(t){t.call(null,o)}))},t.prototype.clear=function(){this.events=null},t}();e.EventEmitter=i}]);

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.