( function () { 'use strict'; document.addEventListener( 'click', function ( event ) { const button = event.target.closest( '[data-chrnx-share]' ); if ( ! button ) { return; } const title = button.dataset.shareTitle || document.title; const url = button.dataset.shareUrl || window.location.href; const done = function () { const original = button.dataset.originalLabel || button.textContent; button.dataset.originalLabel = original; button.textContent = 'Enlace copiado'; window.setTimeout( function () { button.textContent = original; }, 1800 ); }; if ( navigator.share ) { navigator.share( { title, url } ).catch( function () {} ); return; } if ( navigator.clipboard && navigator.clipboard.writeText ) { navigator.clipboard .writeText( url ) .then( done ) .catch( function () {} ); } } ); } )();