-
Notifications
You must be signed in to change notification settings - Fork 13
/
md.min.js
1 lines (1 loc) · 3.1 KB
/
md.min.js
1
(()=>{var e,t,n,o={255:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}e.exports=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.save=function(e){var a="text/plain",c=o?o.trim().toLowerCase().replace(/^[^\w\d]+|[^\w\d]+$/g,"").replace(/[\s\W-]+/g,"-"):"claude";"json"===n.toLowerCase()?(c+=".json",a="text/json","object"===t(e)&&(e=JSON.stringify(e,void 0,4))):"md"===n.toLowerCase()&&(c+=".md");var r=new Blob([e],{type:a}),i=document.createElement("a");i.download=c,i.href=window.URL.createObjectURL(r),i.dataset.downloadurl=[a,i.download,i.href].join(":");var l=new MouseEvent("click",{canBubble:!0,cancelable:!1,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});i.dispatchEvent(l)}}},361:e=>{e.exports=function(){var e=document.querySelector("div.flex-1.flex.flex-col.gap-3.px-4"),t=document.querySelector("button[data-testid='chat-menu-trigger']"),n=t?t.textContent:"";return{elements:e.querySelectorAll("div.font-claude-message, div.font-user-message"),title:n}}},380:e=>{e.exports=function(){return new Date(new Date(new Date(new Date).toISOString()).getTime()-6e4*(new Date).getTimezoneOffset()).toISOString().slice(0,19).replace("T"," ")}}},a={};function c(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return o[e](n,n.exports,c),n.exports}e=c(255),t=c(380),n=c(361),function(){var o="",a=n(),c=a.elements,r=a.title,i=t();o+="# ".concat(r||"Claude Chat","\n`").concat(i,"`\n\n");for(var l=0;l<c.length;l++){var d=c[l],s=d.firstChild;if(s){if(s.nodeType===Node.ELEMENT_NODE){var f=[];if(d.classList.contains("font-claude-message")){o+="_Claude_:\n";var u=s.firstChild;u||(u=s),f=u.childNodes}else o+="_Prompt_:\n",f=d.childNodes;for(var E=function(){var e=f[N];if(e.nodeType===Node.ELEMENT_NODE){if(m=e.tagName,p=e.textContent,"P"===m&&(o+="".concat(p,"\n")),"OL"===m&&e.childNodes.forEach((function(e,t){e.nodeType===Node.ELEMENT_NODE&&"LI"===e.tagName&&(o+="".concat(t+1,". ").concat(e.textContent,"\n"))})),"UL"===m&&e.childNodes.forEach((function(e,t){e.nodeType===Node.ELEMENT_NODE&&"LI"===e.tagName&&(o+="- ".concat(e.textContent,"\n"))})),"PRE"===m){var t=e.querySelector("code"),n=t.textContent,a=t.classList[0].split("-")[1];o+="```".concat(a,"\n").concat(n,"\n```\n")}if("TABLE"===m){var c="";e.childNodes.forEach((function(e){if(e.nodeType===Node.ELEMENT_NODE&&("THEAD"===e.tagName||"TBODY"===e.tagName)){var t="",n=0;if(e.childNodes.forEach((function(o){if(o.nodeType===Node.ELEMENT_NODE&&"TR"===o.tagName){var a="";o.childNodes.forEach((function(t){t.nodeType!==Node.ELEMENT_NODE||"TD"!==t.tagName&&"TH"!==t.tagName||(a+="| ".concat(t.textContent," "),"THEAD"===e.tagName&&n++)})),t+="".concat(a,"|\n")}})),c+=t,"THEAD"===e.tagName){var o="| ".concat(Array(n).fill("---").join(" | ")," |\n");c+=o}}})),o+=c}o+="\n"}},N=0;N<f.length;N++){var m,p;E()}}s.nodeType===Node.TEXT_NODE&&(o+="\n")}}e(console,"md",r),console.save(o)}()})();