@pyscript/core 0.4.43 → 0.4.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{codemirror-Dl5H49bb.js → codemirror-Cuc1ujlq.js} +2 -2
  2. package/dist/{codemirror-Dl5H49bb.js.map → codemirror-Cuc1ujlq.js.map} +1 -1
  3. package/dist/{codemirror_commands-BdjCAcK-.js → codemirror_commands-DrGPggEa.js} +2 -2
  4. package/dist/{codemirror_commands-BdjCAcK-.js.map → codemirror_commands-DrGPggEa.js.map} +1 -1
  5. package/dist/{codemirror_lang-python--SQq2qB4.js → codemirror_lang-python-CJNnzWx3.js} +2 -2
  6. package/dist/{codemirror_lang-python--SQq2qB4.js.map → codemirror_lang-python-CJNnzWx3.js.map} +1 -1
  7. package/dist/{codemirror_language-CAKlJ8mf.js → codemirror_language-w-S9uYcH.js} +2 -2
  8. package/dist/{codemirror_language-CAKlJ8mf.js.map → codemirror_language-w-S9uYcH.js.map} +1 -1
  9. package/dist/codemirror_view-DfjLm8GV.js +2 -0
  10. package/dist/codemirror_view-DfjLm8GV.js.map +1 -0
  11. package/dist/{core-B6hsMz8Y.js → core-BLQaGnG9.js} +2 -2
  12. package/dist/{core-B6hsMz8Y.js.map → core-BLQaGnG9.js.map} +1 -1
  13. package/dist/core.js +1 -1
  14. package/dist/{deprecations-manager-De5K5cXk.js → deprecations-manager-Dp9f63Kl.js} +2 -2
  15. package/dist/{deprecations-manager-De5K5cXk.js.map → deprecations-manager-Dp9f63Kl.js.map} +1 -1
  16. package/dist/{error-Dfrs7Q5J.js → error-i2BSJ2Z6.js} +2 -2
  17. package/dist/{error-Dfrs7Q5J.js.map → error-i2BSJ2Z6.js.map} +1 -1
  18. package/dist/{index-DUXwuZn0.js → index-B-A3jfDu.js} +2 -2
  19. package/dist/{index-DUXwuZn0.js.map → index-B-A3jfDu.js.map} +1 -1
  20. package/dist/{mpy-Noch7TCk.js → mpy-C5OOHWwo.js} +2 -2
  21. package/dist/{mpy-Noch7TCk.js.map → mpy-C5OOHWwo.js.map} +1 -1
  22. package/dist/{py-6RmoksBq.js → py-DsJxoJ3K.js} +2 -2
  23. package/dist/{py-6RmoksBq.js.map → py-DsJxoJ3K.js.map} +1 -1
  24. package/dist/py-editor-C4428CRk.js +2 -0
  25. package/dist/py-editor-C4428CRk.js.map +1 -0
  26. package/dist/{py-terminal-CVai3EuH.js → py-terminal-BzrNYA2l.js} +2 -2
  27. package/dist/{py-terminal-CVai3EuH.js.map → py-terminal-BzrNYA2l.js.map} +1 -1
  28. package/dist.zip +0 -0
  29. package/package.json +1 -1
  30. package/src/plugins/py-editor.js +4 -2
  31. package/dist/codemirror_view-BQKcFXby.js +0 -2
  32. package/dist/codemirror_view-BQKcFXby.js.map +0 -1
  33. package/dist/py-editor-DeavJRm_.js +0 -2
  34. package/dist/py-editor-DeavJRm_.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{T as e,d as t,a as r,o as n,X as o,H as s,s as a}from"./core-B6hsMz8Y.js";let i=0;const c=e=>`${e}-editor-${i++}`,l=new Map,u=new Map,d={worker:{codeBeforeRun:()=>a,onReady:({runAsync:e,io:t},{sync:r})=>{t.stdout=t.buffered(r.write),t.stderr=t.buffered(r.writeErr),r.revoke(),r.runAsync=e}}};async function p({currentTarget:e}){const{env:t,pySrc:r,outDiv:a}=this,i=!!e;if(i&&(e.disabled=!0,a.innerHTML=""),!l.has(t)){const e=URL.createObjectURL(new Blob([""])),r={type:this.interpreter},{config:a}=this;if(a){r.configURL=a;const{parse:e}=a.endsWith(".toml")?await import("./toml-CvAfdf9_.js"):JSON;r.config=e(await fetch(a).then((e=>e.text()))),r.version=n(r.config)}else r.config={};const i=o.call(new s(null,d),e,r),{sync:c}=i,{promise:u,resolve:p}=Promise.withResolvers();l.set(t,u),c.revoke=()=>{URL.revokeObjectURL(e),p(i)}}return l.get(t).then((t=>{t.onerror=({error:e})=>{i&&(a.innerHTML+=`<span style='color:red'>${e.message||e}</span>\n`),console.error(e)};const n=()=>{i&&(e.disabled=!1)},{sync:o}=t;o.write=e=>{i&&(a.innerText+=`${e}\n`)},o.writeErr=e=>{i&&(a.innerHTML+=`<span style='color:red'>${e}</span>\n`)},o.runAsync(r).then(n,n)}))}const m=(e,t)=>{const r=document.createElement("div");r.className=`${t}-editor-input`,r.setAttribute("aria-label","Python Script Area");const n=((e,t)=>{const r=document.createElement("button");return r.className=`absolute ${t}-editor-run-button`,r.innerHTML='<svg style="height:20px;width:20px;vertical-align:-.125em;transform-origin:center;overflow:visible;color:green" viewBox="0 0 384 512" aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg"><g transform="translate(192 256)" transform-origin="96 0"><g transform="translate(0,0) scale(1,1)"><path d="M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z" fill="currentColor" transform="translate(-192 -256)"></path></g></g></svg>',r.setAttribute("aria-label","Python Script Run Button"),r.addEventListener("click",(async t=>{r.blur(),await e.handleEvent(t)})),r})(e,t),o=document.createElement("div");return o.addEventListener("keydown",(e=>{e.stopPropagation()})),r.append(n,o),r},f=(e,t)=>{const r=document.createElement("div");r.className=`${t}-editor-box`;const n=m(e,t),o=(e=>{const t=document.createElement("div");return t.className=`${e}-editor-output`,t.id=`${c(e)}-output`,t})(t);return r.append(n,o),[r,o,n.querySelector("button")]},g=async(e,n,o)=>{const[{basicSetup:s,EditorView:a},{Compartment:i},{python:l},{indentUnit:d},{keymap:m},{defaultKeymap:g}]=await Promise.all([import("./codemirror-Dl5H49bb.js"),import("./codemirror_state-D1qTXrff.js"),import("./codemirror_lang-python--SQq2qB4.js"),import("./codemirror_language-CAKlJ8mf.js").then((function(e){return e.x})),import("./codemirror_view-BQKcFXby.js").then((function(e){return e.q})),import("./codemirror_commands-BdjCAcK-.js")]);let h=e.hasAttribute("setup");const v=e.hasAttribute("config"),y=`${o}-${e.getAttribute("env")||c(n)}`;if(v&&u.has(y))throw new SyntaxError(u.get(y)?`duplicated config for env: ${y}`:`unable to add a config to the env: ${y}`);u.set(y,v);let b=e.src?await fetch(e.src).then((e=>e.text())):e.textContent;const w={handleEvent:p,interpreter:o,env:y,config:v&&new URL(e.getAttribute("config"),location.href).href,get pySrc(){return h?b:R.state.doc.toString()},get outDiv(){return h?null:L}};let E;t(e,{target:{get:()=>E},handleEvent:{get:()=>w.handleEvent,set:e=>{w.handleEvent=e===p?p:async r=>{const{currentTarget:n}=r;t(r,{code:{value:w.pySrc}}),!1!==await e(r)&&await p.call(w,{currentTarget:n})}}},code:{get:()=>w.pySrc,set:e=>{h||R.update([R.state.update({changes:{from:0,to:R.state.doc.length,insert:e}})])}},process:{value(e){const t=h,r=b;h=!0,b=e;const n=()=>{h=t,b=r};return w.handleEvent({currentTarget:null}).then(n,n)}}});const $=()=>{const t=new Event(`${n}-editor`,{bubbles:!0});e.dispatchEvent(t)};if(h)return await w.handleEvent({currentTarget:null}),void $();const x=e.getAttribute("target");if(x){if(E=document.getElementById(x)||document.querySelector(x),!E)throw new Error(`Unknown target ${x}`)}else E=document.createElement(`${n}-editor`),E.style.display="block",e.after(E);E.id||(E.id=c(n)),E.hasAttribute("exec-id")||E.setAttribute("exec-id",0),E.hasAttribute("root")||E.setAttribute("root",E.id);const[A,L,S]=f(w,n);A.dataset.env=e.hasAttribute("env")?y:o;const C=A.querySelector(`.${n}-editor-input > div`).attachShadow({mode:"open"});C.innerHTML="<style> :host { all: initial; }</style>",E.appendChild(A);const k=r(e.textContent).trim(),T=/^(\s+)/m.test(k)?RegExp.$1:" ",M=()=>S.click(),R=new a({extensions:[d.of(T),(new i).of(l()),m.of([...g,{key:"Ctrl-Enter",run:M,preventDefault:!0},{key:"Cmd-Enter",run:M,preventDefault:!0},{key:"Shift-Enter",run:M,preventDefault:!0}]),s],foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],parent:C,doc:k});R.focus(),$()};let h=0,v=Promise.resolve();const y=()=>{h=0,b()},b=()=>{if(!h){h=setTimeout(y,250);for(const[t,r]of e){const e=`script[type="${t}-editor"]`;for(const n of document.querySelectorAll(e))n.type+="-active",v=v.then((()=>g(n,t,r)))}return v}};new MutationObserver(b).observe(document,{childList:!0,subtree:!0});var w=b();export{w as default};
2
- //# sourceMappingURL=py-editor-DeavJRm_.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"py-editor-DeavJRm_.js","sources":["../src/plugins/py-editor.js"],"sourcesContent":["// PyScript py-editor plugin\nimport { Hook, XWorker, dedent, defineProperties } from \"polyscript/exports\";\nimport { TYPES, offline_interpreter, stdlib } from \"../core.js\";\n\nconst RUN_BUTTON = `<svg style=\"height:20px;width:20px;vertical-align:-.125em;transform-origin:center;overflow:visible;color:green\" viewBox=\"0 0 384 512\" aria-hidden=\"true\" role=\"img\" xmlns=\"http://www.w3.org/2000/svg\"><g transform=\"translate(192 256)\" transform-origin=\"96 0\"><g transform=\"translate(0,0) scale(1,1)\"><path d=\"M361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215z\" fill=\"currentColor\" transform=\"translate(-192 -256)\"></path></g></g></svg>`;\n\nlet id = 0;\nconst getID = (type) => `${type}-editor-${id++}`;\n\nconst envs = new Map();\nconst configs = new Map();\n\nconst hooks = {\n worker: {\n codeBeforeRun: () => stdlib,\n // works on both Pyodide and MicroPython\n onReady: ({ runAsync, io }, { sync }) => {\n io.stdout = io.buffered(sync.write);\n io.stderr = io.buffered(sync.writeErr);\n sync.revoke();\n sync.runAsync = runAsync;\n },\n },\n};\n\nasync function execute({ currentTarget }) {\n const { env, pySrc, outDiv } = this;\n const hasRunButton = !!currentTarget;\n\n if (hasRunButton) {\n currentTarget.disabled = true;\n outDiv.innerHTML = \"\";\n }\n\n if (!envs.has(env)) {\n const srcLink = URL.createObjectURL(new Blob([\"\"]));\n const details = { type: this.interpreter };\n const { config } = this;\n if (config) {\n details.configURL = config;\n const { parse } = config.endsWith(\".toml\")\n ? await import(/* webpackIgnore: true */ \"../3rd-party/toml.js\")\n : JSON;\n details.config = parse(await fetch(config).then((r) => r.text()));\n details.version = offline_interpreter(details.config);\n } else {\n details.config = {};\n }\n\n const xworker = XWorker.call(new Hook(null, hooks), srcLink, details);\n\n const { sync } = xworker;\n const { promise, resolve } = Promise.withResolvers();\n envs.set(env, promise);\n sync.revoke = () => {\n URL.revokeObjectURL(srcLink);\n resolve(xworker);\n };\n }\n\n // wait for the env then set the target div\n // before executing the current code\n return envs.get(env).then((xworker) => {\n xworker.onerror = ({ error }) => {\n if (hasRunButton) {\n outDiv.innerHTML += `<span style='color:red'>${\n error.message || error\n }</span>\\n`;\n }\n console.error(error);\n };\n\n const enable = () => {\n if (hasRunButton) currentTarget.disabled = false;\n };\n const { sync } = xworker;\n sync.write = (str) => {\n if (hasRunButton) outDiv.innerText += `${str}\\n`;\n };\n sync.writeErr = (str) => {\n if (hasRunButton) {\n outDiv.innerHTML += `<span style='color:red'>${str}</span>\\n`;\n }\n };\n sync.runAsync(pySrc).then(enable, enable);\n });\n}\n\nconst makeRunButton = (handler, type) => {\n const runButton = document.createElement(\"button\");\n runButton.className = `absolute ${type}-editor-run-button`;\n runButton.innerHTML = RUN_BUTTON;\n runButton.setAttribute(\"aria-label\", \"Python Script Run Button\");\n runButton.addEventListener(\"click\", async (event) => {\n runButton.blur();\n await handler.handleEvent(event);\n });\n return runButton;\n};\n\nconst makeEditorDiv = (handler, type) => {\n const editorDiv = document.createElement(\"div\");\n editorDiv.className = `${type}-editor-input`;\n editorDiv.setAttribute(\"aria-label\", \"Python Script Area\");\n\n const runButton = makeRunButton(handler, type);\n const editorShadowContainer = document.createElement(\"div\");\n\n // avoid outer elements intercepting key events (reveal as example)\n editorShadowContainer.addEventListener(\"keydown\", (event) => {\n event.stopPropagation();\n });\n\n editorDiv.append(runButton, editorShadowContainer);\n\n return editorDiv;\n};\n\nconst makeOutDiv = (type) => {\n const outDiv = document.createElement(\"div\");\n outDiv.className = `${type}-editor-output`;\n outDiv.id = `${getID(type)}-output`;\n return outDiv;\n};\n\nconst makeBoxDiv = (handler, type) => {\n const boxDiv = document.createElement(\"div\");\n boxDiv.className = `${type}-editor-box`;\n\n const editorDiv = makeEditorDiv(handler, type);\n const outDiv = makeOutDiv(type);\n boxDiv.append(editorDiv, outDiv);\n\n return [boxDiv, outDiv, editorDiv.querySelector(\"button\")];\n};\n\nconst init = async (script, type, interpreter) => {\n const [\n { basicSetup, EditorView },\n { Compartment },\n { python },\n { indentUnit },\n { keymap },\n { defaultKeymap },\n ] = await Promise.all([\n import(/* webpackIgnore: true */ \"../3rd-party/codemirror.js\"),\n import(/* webpackIgnore: true */ \"../3rd-party/codemirror_state.js\"),\n import(\n /* webpackIgnore: true */ \"../3rd-party/codemirror_lang-python.js\"\n ),\n import(/* webpackIgnore: true */ \"../3rd-party/codemirror_language.js\"),\n import(/* webpackIgnore: true */ \"../3rd-party/codemirror_view.js\"),\n import(/* webpackIgnore: true */ \"../3rd-party/codemirror_commands.js\"),\n ]);\n\n let isSetup = script.hasAttribute(\"setup\");\n const hasConfig = script.hasAttribute(\"config\");\n const env = `${interpreter}-${script.getAttribute(\"env\") || getID(type)}`;\n\n if (hasConfig && configs.has(env)) {\n throw new SyntaxError(\n configs.get(env)\n ? `duplicated config for env: ${env}`\n : `unable to add a config to the env: ${env}`,\n );\n }\n\n configs.set(env, hasConfig);\n\n let source = script.src\n ? await fetch(script.src).then((b) => b.text())\n : script.textContent;\n const context = {\n // allow the listener to be overridden at distance\n handleEvent: execute,\n interpreter,\n env,\n config:\n hasConfig &&\n new URL(script.getAttribute(\"config\"), location.href).href,\n get pySrc() {\n return isSetup ? source : editor.state.doc.toString();\n },\n get outDiv() {\n return isSetup ? null : outDiv;\n },\n };\n\n let target;\n defineProperties(script, {\n target: { get: () => target },\n handleEvent: {\n get: () => context.handleEvent,\n set: (callback) => {\n // do not bother with logic if it was set back as its original handler\n if (callback === execute) context.handleEvent = execute;\n // in every other case be sure that if the listener override returned\n // `false` nothing happens, otherwise keep doing what it always did\n else {\n context.handleEvent = async (event) => {\n // trap the currentTarget ASAP (if any)\n // otherwise it gets lost asynchronously\n const { currentTarget } = event;\n // augment a code snapshot before invoking the override\n defineProperties(event, {\n code: { value: context.pySrc },\n });\n // avoid executing the default handler if the override returned `false`\n if ((await callback(event)) !== false)\n await execute.call(context, { currentTarget });\n };\n }\n },\n },\n code: {\n get: () => context.pySrc,\n set: (insert) => {\n if (isSetup) return;\n editor.update([\n editor.state.update({\n changes: {\n from: 0,\n to: editor.state.doc.length,\n insert,\n },\n }),\n ]);\n },\n },\n process: {\n /**\n * Simulate a setup node overriding the source to evaluate.\n * @param {string} code the Python code to evaluate.\n * @returns {Promise<...>} fulfill once code has been evaluated.\n */\n value(code) {\n const wasSetup = isSetup;\n const wasSource = source;\n isSetup = true;\n source = code;\n const restore = () => {\n isSetup = wasSetup;\n source = wasSource;\n };\n return context\n .handleEvent({ currentTarget: null })\n .then(restore, restore);\n },\n },\n });\n\n const notify = () => {\n const event = new Event(`${type}-editor`, { bubbles: true });\n script.dispatchEvent(event);\n };\n\n if (isSetup) {\n await context.handleEvent({ currentTarget: null });\n notify();\n return;\n }\n\n const selector = script.getAttribute(\"target\");\n\n if (selector) {\n target =\n document.getElementById(selector) ||\n document.querySelector(selector);\n if (!target) throw new Error(`Unknown target ${selector}`);\n } else {\n target = document.createElement(`${type}-editor`);\n target.style.display = \"block\";\n script.after(target);\n }\n\n if (!target.id) target.id = getID(type);\n if (!target.hasAttribute(\"exec-id\")) target.setAttribute(\"exec-id\", 0);\n if (!target.hasAttribute(\"root\")) target.setAttribute(\"root\", target.id);\n\n // @see https://github.com/JeffersGlass/mkdocs-pyscript/blob/main/mkdocs_pyscript/js/makeblocks.js\n const [boxDiv, outDiv, runButton] = makeBoxDiv(context, type);\n boxDiv.dataset.env = script.hasAttribute(\"env\") ? env : interpreter;\n\n const inputChild = boxDiv.querySelector(`.${type}-editor-input > div`);\n const parent = inputChild.attachShadow({ mode: \"open\" });\n // avoid inheriting styles from the outer component\n parent.innerHTML = `<style> :host { all: initial; }</style>`;\n\n target.appendChild(boxDiv);\n\n const doc = dedent(script.textContent).trim();\n\n // preserve user indentation, if any\n const indentation = /^(\\s+)/m.test(doc) ? RegExp.$1 : \" \";\n\n const listener = () => runButton.click();\n const editor = new EditorView({\n extensions: [\n indentUnit.of(indentation),\n new Compartment().of(python()),\n keymap.of([\n ...defaultKeymap,\n { key: \"Ctrl-Enter\", run: listener, preventDefault: true },\n { key: \"Cmd-Enter\", run: listener, preventDefault: true },\n { key: \"Shift-Enter\", run: listener, preventDefault: true },\n ]),\n basicSetup,\n ],\n foldGutter: true,\n gutters: [\"CodeMirror-linenumbers\", \"CodeMirror-foldgutter\"],\n parent,\n doc,\n });\n\n editor.focus();\n notify();\n};\n\n// avoid too greedy MutationObserver operations at distance\nlet timeout = 0;\n\n// avoid delayed initialization\nlet queue = Promise.resolve();\n\n// reset interval value then check for new scripts\nconst resetTimeout = () => {\n timeout = 0;\n pyEditor();\n};\n\n// triggered both ASAP on the living DOM and via MutationObserver later\nconst pyEditor = () => {\n if (timeout) return;\n timeout = setTimeout(resetTimeout, 250);\n for (const [type, interpreter] of TYPES) {\n const selector = `script[type=\"${type}-editor\"]`;\n for (const script of document.querySelectorAll(selector)) {\n // avoid any further bootstrap by changing the type as active\n script.type += \"-active\";\n // don't await in here or multiple calls might happen\n // while the first script is being initialized\n queue = queue.then(() => init(script, type, interpreter));\n }\n }\n return queue;\n};\n\nnew MutationObserver(pyEditor).observe(document, {\n childList: true,\n subtree: true,\n});\n\n// try to check the current document ASAP\nexport default pyEditor();\n"],"names":["id","getID","type","envs","Map","configs","hooks","worker","codeBeforeRun","stdlib","onReady","runAsync","io","sync","stdout","buffered","write","stderr","writeErr","revoke","async","execute","currentTarget","env","pySrc","outDiv","this","hasRunButton","disabled","innerHTML","has","srcLink","URL","createObjectURL","Blob","details","interpreter","config","configURL","parse","endsWith","import","JSON","fetch","then","r","text","version","offline_interpreter","xworker","XWorker","call","Hook","promise","resolve","Promise","withResolvers","set","revokeObjectURL","get","onerror","error","message","console","enable","str","innerText","makeEditorDiv","handler","editorDiv","document","createElement","className","setAttribute","runButton","addEventListener","event","blur","handleEvent","makeRunButton","editorShadowContainer","stopPropagation","append","makeBoxDiv","boxDiv","makeOutDiv","querySelector","init","script","basicSetup","EditorView","Compartment","python","indentUnit","keymap","defaultKeymap","all","n","x","q","isSetup","hasAttribute","hasConfig","getAttribute","SyntaxError","source","src","b","textContent","context","location","href","editor","state","doc","toString","target","defineProperties","callback","code","value","insert","update","changes","from","to","length","process","wasSetup","wasSource","restore","notify","Event","bubbles","dispatchEvent","selector","getElementById","Error","style","display","after","dataset","parent","attachShadow","mode","appendChild","dedent","trim","indentation","test","RegExp","$1","listener","click","extensions","of","key","run","preventDefault","foldGutter","gutters","focus","timeout","queue","resetTimeout","pyEditor","setTimeout","TYPES","querySelectorAll","MutationObserver","observe","childList","subtree","pyEditor$1"],"mappings":"iFAMA,IAAIA,EAAK,EACT,MAAMC,EAASC,GAAS,GAAGA,YAAeF,MAEpCG,EAAO,IAAIC,IACXC,EAAU,IAAID,IAEdE,EAAQ,CACVC,OAAQ,CACJC,cAAe,IAAMC,EAErBC,QAAS,EAAGC,WAAUC,OAAQC,WAC1BD,EAAGE,OAASF,EAAGG,SAASF,EAAKG,OAC7BJ,EAAGK,OAASL,EAAGG,SAASF,EAAKK,UAC7BL,EAAKM,SACLN,EAAKF,SAAWA,CAAQ,IAKpCS,eAAeC,GAAQC,cAAEA,IACrB,MAAMC,IAAEA,EAAGC,MAAEA,EAAKC,OAAEA,GAAWC,KACzBC,IAAiBL,EAO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