PageSourceSearch

https://shajinjoseph-template.hf.space/assets/markdown.N65uYq6U.js

js shajinjoseph-template.hf.space collected 2026-10-03 17:22:44 UTC 9,127 bytes, 265 lines download raw bytes

1import{r as e}from"./query-devtools.DIz6FZCX.js";import{h as t}from"./tanstack-vendor.2R6Ja_-H.js";import{C_ as n,Fh as r,Ih as i,t_ as a,zg as o}from"./hooks.B1NLB7i6.js";var s=r=>{let i=e(),{onSuccess:s,onError:c,onMutate:l,...u}=r??{},d={mutationFn:e=>n.editArtifact(e),onMutate:async e=>(l&&await l(e),{previousMessages:{},updatedConversationId:null}),onError:(e,t,n)=>{c?.(e,t,n)},onSuccess:(e,t,n)=>{let r=!0,c=n=>{n&&i.setQueryData([a.messages,n],n=>{if(!n)return n;let i=[...n],a;for(let e=i.length-1;e>=0;e--)if(i[e].messageId===t.messageId){a=e,r=!1;break}return a==null?n:(i[a]={...i[a],content:e.content,text:e.text},i)})};c(e.conversationId),r&&(console.warn("Edited Artifact Message not found in cache, trying `new` as `conversationId`"),c(o.NEW_CONVO)),s?.(e,t,n)},...u};return t(d)},c=(r,i)=>{let o=e(),{onSuccess:s,onError:c,onMutate:l,...u}=i??{},d={mutationFn:e=>n.branchMessage(e),onMutate:async e=>(l&&await l(e),r&&await o.cancelQueries([a.messages,r]),{previousMessages:r?o.getQueryData([a.messages,r]):void 0,conversationId:r}),onError:(e,t,n)=>{n?.conversationId&&n?.previousMessages&&o.setQueryData([a.messages,n.conversationId],n.previousMessages),c?.(e,t,n)},onSuccess:(e,t,n)=>{let r=e.conversationId||n?.conversationId;r&&o.setQueryData([a.messages,r],t=>t?[...t,e]:[e]),s?.(e,t,n)},...u};return t(d)},l=new Set([`http:`,`https:`,`mailto:`,`tel:`]),u=e=>{let t=e.trim();if(!t)return!1;if(t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`.`))return!0;try{return l.has(new URL(t).protocol)}catch{return!1}},d=`
2/* GitHub Markdown CSS - Light theme base */
3.markdown-body {
4  -ms-text-size-adjust: 100%;
5  -webkit-text-size-adjust: 100%;
6  line-height: 1.5;
7  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
8  font-size: 16px;
9  line-height: 1.5;
10  word-wrap: break-word;
11  color: #24292f;
12  background-color: #ffffff;
13}
14
15.markdown-body h1, .markdown-body h2 {
16  border-bottom: 1px solid #d0d7de;
17  margin: 0.6em 0;
18}
19
20.markdown-body h1 { font-size: 2em; margin: 0.67em 0; }
21.markdown-body h2 { font-size: 1.5em; }
22.markdown-body h3 { font-size: 1.25em; }
23.markdown-body h4 { font-size: 1em; }
24.markdown-body h5 { font-size: 0.875em; }
25.markdown-body h6 { font-size: 0.85em; }
26
27.markdown-body ul, .markdown-body ol {
28  list-style: revert !important;
29  padding-left: 2em !important;
30  margin-top: 0;
31  margin-bottom: 16px;
32}
33
34.markdown-body ul { list-style-type: disc !important; }
35.markdown-body ol { list-style-type: decimal !important; }
36.markdown-body ul ul { list-style-type: circle !important; }
37.markdown-body ul ul ul { list-style-type: square !important; }
38
39.markdown-body li { margin-top: 0.25em; }
40
41.markdown-body li:has(> input[type="checkbox"]) {
42  list-style-type: none !important;
43}
44
45.markdown-body li > input[type="checkbox"] {
46  margin-right: 0.75em;
47  margin-left: -1.5em;
48  vertical-align: middle;
49  pointer-events: none;
50  width: 16px;
51  height: 16px;
52}
53
54.markdown-body .task-list-item {
55  list-style-type: none !important;
56}
57
58.markdown-body .task-list-item > input[type="checkbox"] {
59  margin-right: 0.75em;
60  margin-left: -1.5em;
61  vertical-align: middle;
62  pointer-events: none;
63  width: 16px;
64  height: 16px;
65}
66
67.markdown-body code {
68  padding: 0.2em 0.4em;
69  margin: 0;
70  font-size: 85%;
71  border-radius: 6px;
72  background-color: rgba(175, 184, 193, 0.2);
73  color: #24292f;
74  font-family: ui-monospace, monospace;
75  white-space: pre-wrap;
76}
77
78.markdown-body pre {
79  padding: 16px;
80  overflow: auto;
81  font-size: 85%;
82  line-height: 1.45;
83  border-radius: 6px;
84  margin-top: 0;
85  margin-bottom: 16px;
86  background-color: #f6f8fa;
87  color: #24292f;
88}
89
90.markdown-body pre code {
91  display: inline-block;
92  padding: 0;
93  margin: 0;
94  overflow: visible;
95  line-height: inherit;
96  word-wrap: normal;
97  background-color: transparent;
98  border: 0;
99}
100
101.markdown-body a {
102  text-decoration: none;
103  color: #0969da;
104}
105
106.markdown-body a:hover {
107  text-decoration: underline;
108}
109
110.markdown-body table {
111  border-spacing: 0;
112  border-collapse: collapse;
113  display: block;
114  width: max-content;
115  max-width: 100%;
116  overflow: auto;
117}
118
119.markdown-body table thead {
120  background-color: #f6f8fa;
121}
122
123.markdown-body table th, .markdown-body table td {
124  padding: 6px 13px;
125  border: 1px solid #d0d7de;
126}
127
128.markdown-body blockquote {
129  padding: 0 1em;
130  border-left: 0.25em solid #d0d7de;
131  margin: 0 0 16px 0;
132  color: #57606a;
133}
134
135.markdown-body hr {
136  height: 0.25em;
137  padding: 0;
138  margin: 24px 0;
139  border: 0;
140  background-color: #d0d7de;
141}
142
143.markdown-body img {
144  max-width: 100%;
145  box-sizing: content-box;
146}
147
148/* Rendered in place of the document when the marked CDN does not load. Its own
149   rule rather than an inline style so a contrast mode can reach it. */
150.markdown-error {
151  color: #e53e3e;
152  padding: 1rem;
153}
154
155/* Dark theme */
156@media (prefers-color-scheme: dark) {
157  .markdown-body {
158    color: #c9d1d9;
159    background-color: #0d1117;
160  }
161
162  .markdown-body h1, .markdown-body h2 {
163    border-bottom-color: #21262d;
164  }
165
166  .markdown-body code {
167    background-color: rgba(110, 118, 129, 0.4);
168    color: #c9d1d9;
169  }
170
171  .markdown-body pre {
172    background-color: #161b22;
173    color: #c9d1d9;
174  }
175
176  .markdown-body a {
177    color: #58a6ff;
178  }
179
180  .markdown-body table thead {
181    background-color: #161b22;
182  }
183
184  .markdown-body table th, .markdown-body table td {
185    border-color: #30363d;
186  }
187
188  .markdown-body blockquote {
189    border-left-color: #3b434b;
190    color: #8b949e;
191  }
192
193  .markdown-body hr {
194    background-color: #21262d;
195  }
196}
197
198/* Scrollbar */
199::-webkit-scrollbar { height: 0.1em; width: 0.5rem; }
200::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.1); border-radius: 9999px; }
201::-webkit-scrollbar-track { background-color: transparent; border-radius: 9999px; }
202@media (prefers-color-scheme: dark) {
203  ::-webkit-scrollbar-thumb { background-color: hsla(0,0%,100%,0.1); }
204}
205* { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.1) transparent; }
206@media (prefers-color-scheme: dark) {
207  * { scrollbar-color: hsla(0,0%,100%,0.1) transparent; }
208}
209`;function f(e){return e.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$/g,`\\$`).replace(/<\/script/gi,`<\\/script`)}var p=`https://cdn.jsdelivr.net/npm/[email protected]/marked.min.js`,m=`sha384-948ahk4ZmxYVYOc+rxN1H2gM1EJ2Duhp7uHtZ4WSLkV4Vtx5MUqnV+l7u9B+jFv+`,h=`const SAFE_PROTOCOLS = new Set(['http:', 'https:', 'mailto:', 'tel:']);
210const isSafeUrl = (url) => {
211  const trimmed = url.trim();
212  if (!trimmed) return false;
213  if (trimmed.startsWith('/') || trimmed.startsWith('#') || trimmed.startsWith('.')) return true;
214  try { return SAFE_PROTOCOLS.has(new URL(trimmed).protocol); } catch(e) { return false; }
215};`;function g(e){let t=e?r:i,n=(e,n)=>{let r=t[e]?.trim().split(/\s+/).map(Number);return r?.length!==3||r.some(Number.isNaN)?n:`#${r.map(e=>e.toString(16).padStart(2,`0`)).join(``)}`},a=n(`rgb-surface-primary`,e?`#000000`:`#ffffff`),o=n(`rgb-text-primary`,e?`#ffffff`:`#000000`),s=n(`rgb-link`,e?`#8cc8ff`:`#0000cc`),c=n(`rgb-border-medium`,o);return`
216.markdown-body { color: ${o}; background-color: ${a}; }
217body { background-color: ${a}; }
218.markdown-body h1, .markdown-body h2 { border-bottom-color: ${c}; }
219.markdown-body a, .markdown-body a:hover { color: ${s}; text-decoration: underline; }
220.markdown-body table th, .markdown-body table td { border-color: ${c}; }
221.markdown-body table thead { background-color: ${a}; }
222.markdown-body blockquote { border-left-color: ${c}; color: ${o}; }
223.markdown-body hr { background-color: ${c}; }
224.markdown-body code, .markdown-body pre { color: ${o}; background-color: ${n(`rgb-surface-secondary`,a)}; }
225.markdown-body pre { border: 1px solid ${c}; }
226::-webkit-scrollbar-thumb { background-color: ${o}; }
227* { scrollbar-color: ${o} ${a}; }
228.markdown-error { color: ${n(`rgb-text-destructive`,e?`#ff8f8f`:`#a10000`)}; }
229`}function _(e,t=``){return`<!DOCTYPE html>
230<html lang="en">
231<head>
232<meta charset="UTF-8">
233<meta name="viewport" content="width=device-width, initial-scale=1.0">
234<title>Markdown Preview</title>
235<style>${d}${t}</style>
236</head>
237<body>
238<div class="markdown-body" id="content" style="padding:2rem;margin:1rem;min-height:100vh"></div>
239<script src="${p}" integrity="${m}" crossorigin="anonymous"><\/script>
240<script>
241if (typeof marked === 'undefined') {
242  document.getElementById('content').innerHTML =
243    '<p class="markdown-error">Markdown renderer failed to load. Check network connectivity.</p>';
244} else {
245${h}
246marked.use({
247  gfm: true,
248  breaks: true,
249  renderer: {
250    html() { return ''; },
251    link(token) {
252      if (!isSafeUrl(token.href || '')) return '';
253      return false; // fall through to marked's default link renderer
254    },
255    image(token) {
256      if (!isSafeUrl(token.href || '')) return '';
257      return false; // fall through to marked's default image renderer
258    }
259  }
260});
261document.getElementById('content').innerHTML = marked.parse(\`${f(e.replace(/^( {2})(-|\d+\.)/gm,`    $2`))}\`);
262}
263<\/script>
264</body>
265</html>`}var v=(e,t=!1,n=!1)=>{let r=e||`# No content provided`;return{"content.md":r,"index.html":_(r,n?g(t):``)}};export{s as i,u as n,c as r,v as t};

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.