{"version":3,"sources":["webpack:///./widgets/publication-content/js/publication-content.js","webpack:///./widgets/article-tools/js/article-tools.js"],"names":["debounce","func","wait","timeout","_this","_len","arguments","length","args","Array","_key","clearTimeout","setTimeout","apply","UX","loader","truncation","showMoreText","showLessText","seeMoreIcon","seeLessIcon","seeMoreIconMobile","linesToShow","authorsWrapper","document","querySelector","addEventListener","e","handleAuthorHover","author","target","closest","classList","contains","click","handleAuthorLeave","parent","articleTools","displayClippingTool","useclippingtool","$","attr","show","copyLink","querySelectorAll","forEach","el","_$","url","getAttribute","doi","data","copy","concat","str","copiedEvent","additionalLink","undefined","type","createElement","id","value","location","protocol","host","setAttribute","body","appendChild","selector","navigator","userAgent","match","setSelectionRange","select","execCommand","removeChild","Event","trigger","isDefaultPrevented","on","append","remove"],"mappings":"0FAAA,OASA,SAASA,SAASC,EAAMC,GACpB,IAAIC,EACJ,OAAO,WAAmB,QAAAC,EAAA,KAAAC,EAAAC,UAAAC,OAANC,EAAI,IAAAC,MAAAJ,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAJF,EAAIE,GAAAJ,UAAAI,GACpBC,aAAaR,GACbA,EAAUS,YAAW,kBAAMX,EAAKY,MAAMT,EAAMI,KAAON,IAX3DY,GAAGC,OAAOC,WAAWC,aAAe,WACpCH,GAAGC,OAAOC,WAAWE,aAAe,WACpCJ,GAAGC,OAAOC,WAAWG,YAAc,uBACnCL,GAAGC,OAAOC,WAAWI,YAAc,uBACnCN,GAAGC,OAAOC,WAAWK,kBAAoB,eACzCP,GAAGC,OAAOC,WAAWM,YAAc,EA6BnC,IAAIC,EAAiBC,SAASC,cAAc,yCAE5CF,WAAgBG,iBACZ,YACA1B,UAAS,SAAU2B,IAvBvB,SAASC,kBAAkBD,GACvB,IAAME,EAASF,EAAEG,OAAOC,QAAQ,8DAC5BF,IACKA,EAAOG,UAAUC,SAAS,aAC3BJ,EAAOK,SAoBXN,CAAkBD,KACnB,MAEPJ,WAAgBG,iBACZ,aACA1B,UAAS,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AASC,cAAc,iBAClC4C,UAAUC,UAAUC,MAAM,qBAC1BH,EAASI,kBAAkB,EAAG,QAE9BJ,EAASK,SAGbjD,SAASkD,YAAY,QACrBlD,SAAS0C,KAAKS,YAAY7B,GAG1BS,EAAcf,EAAEoC,MAAM,eACtBpC,EAAEhB,UAAUqD,QAAQtB,EAAa,CAACzC,GAAGuB,eACjCkB,EAAYuB,sBAIpBtC,EAAEhB,UAAUuD,GAAG,eAAe,WAK1BvC,EAAE,4BAA4BwC,OAJV,qJAMpBpE,YAAW,WACP4B,EAAE,uCAAuCyC,WAC1C","file":"js/article-a2bc8cad6351ff5fcc2f.js","sourcesContent":["import 'ui-theme/widgets/publication-content/js/publication-content';\n\nUX.loader.truncation.showMoreText = 'see more';\nUX.loader.truncation.showLessText = 'see less';\nUX.loader.truncation.seeMoreIcon = 'icon-section_arrow_d';\nUX.loader.truncation.seeLessIcon = 'icon-section_arrow_u';\nUX.loader.truncation.seeMoreIconMobile = 'icon-arrow_r';\nUX.loader.truncation.linesToShow = 2;\n\nfunction debounce(func, wait) {\n let timeout;\n return function (...args) {\n clearTimeout(timeout);\n timeout = setTimeout(() => func.apply(this, args), wait);\n };\n}\n\nfunction handleAuthorHover(e) {\n const author = e.target.closest('.author-name.accordion-tabbed__control[data-db-target-for]');\n if (author) {\n if (!author.classList.contains('js--open')) {\n author.click();\n }\n }\n}\n\nfunction handleAuthorLeave(e) {\n const parent = e.target.querySelector('.accordion-tabbed__tab.js--open');\n if (parent) {\n const author = parent.querySelector('.author-name.accordion-tabbed__control[data-db-target-for]');\n if (author && author.classList.contains('js--open')) {\n author.click();\n }\n }\n}\n\nlet authorsWrapper = document.querySelector('.citation .loa-wrapper .loa-accordion');\n\nauthorsWrapper?.addEventListener(\n 'mouseover',\n debounce(function (e) {\n handleAuthorHover(e);\n }, 100)\n);\nauthorsWrapper?.addEventListener(\n 'mouseleave',\n debounce(function (e) {\n handleAuthorLeave(e);\n }, 100)\n);\n","import 'ui-core/widgets/article-tools/js/article-tools';\n\n(function () {\n UX.articleTools.displayClippingTool = function () {\n let useclippingtool = $('.switch-player').attr('useclippingtool');\n\n if ($('.article-tool__clipping').length && useclippingtool === 'true') {\n $('.article-tool__clipping').show();\n }\n };\n\n UX.articleTools.copyLink = function () {\n const embedLink = document.querySelectorAll('.embedLink');\n embedLink.forEach(el => {\n const url = el.getAttribute('data-url');\n const doi = $('.video__content')?.data('doi') || '';\n el.addEventListener('click', () => {\n UX.articleTools.copy(url, `&sourcePub=${doi}`, 'embedIframe');\n });\n });\n };\n\n if ($('.switch-player').length) {\n UX.articleTools.displayClippingTool();\n }\n\n if ($('.embedLink').length) {\n UX.articleTools.copyLink();\n }\n\n UX.articleTools.copy = function (str, additionalLink = '', type = '') {\n const el = document.createElement('textarea');\n var copiedEvent;\n el.id = 'temp_element';\n if (type === 'embedIframe') {\n el.value =\n '';\n } else {\n el.value = document.location.protocol + '//' + document.location.host + additionalLink + str;\n }\n el.setAttribute('readonly', '');\n document.body.appendChild(el);\n\n /*to work on IOS*/\n let selector = document.querySelector('#temp_element');\n if (navigator.userAgent.match(/ipad|ipod|iphone/i)) {\n selector.setSelectionRange(0, 999999);\n } else {\n selector.select();\n }\n\n document.execCommand('copy');\n document.body.removeChild(el);\n\n // to show alert message that the text is copied, implemented on RMIT\n copiedEvent = $.Event('link:copied');\n $(document).trigger(copiedEvent, [UX.articleTools]);\n if (copiedEvent.isDefaultPrevented()) {\n return;\n }\n };\n $(document).on('link:copied', function () {\n let $notification = `
\n Text copied into clipboard.\n
`;\n\n $('.actions-block-container').append($notification);\n\n setTimeout(function () {\n $('.actions-block-container .alert-msg').remove();\n }, 3000);\n });\n})();\n"],"sourceRoot":""}