{"code":"(window.webpackJsonpGUI=window.webpackJsonpGUI||[]).push([[13],{1496:function(t,e,o){(t.exports=o(9)(!1)).push([t.i,\".sa-copy-reporter-icon {\\n cursor: pointer;\\n float: right;\\n display: block;\\n user-select: none;\\n filter: var(--editorDarkMode-accent-filter, none);\\n width: 14px;\\n height: 14px;\\n}\\n\\n.valueReportBox {\\n user-select: text;\\n}\\n\",\"\"])},1540:function(t,e,o){\"use strict\";o.r(e),o.d(e,\"resources\",(function(){return n}));var s=o(1496);const n={\"userscript.js\":async function(t){let{addon:e,console:o,msg:s}=t;e.tab.createEditorContextMenu((t=>{const e=\"monitor_large\"===t.type?\"monitor_large-value\":\"monitor_value\",o=t.target.querySelector(\"[class*='\".concat(e,\"_']\"));0!==o.innerText.length&&navigator.clipboard.writeText(o.innerText)}),{className:\"copy\",types:[\"monitor_default\",\"monitor_large\",\"monitor_slider\"],position:\"monitor\",order:0,label:s(\"copy-value\")});const n=await e.tab.traps.getBlockly();n.WorkspaceSvg.prototype.reportValue=function(t,o){let r=this.getBlockById(t);if(!r)throw\"Tried to report value on block that does not exist.\";n.DropDownDiv.hideWithoutAnimation(),n.DropDownDiv.clearContent();let i=n.DropDownDiv.getContentDiv(),w=document.createElement(\"div\");if(w.setAttribute(\"class\",\"valueReportBox\"),w.innerText=o,!e.self.disabled&&(w.setAttribute(\"tabindex\",\"0\"),w.onkeydown=t=>{(t.altKey||t.ctrlKey||t.metaKey)&&\"KeyC\"===t.code&&t.stopPropagation()},0!==o.length)){const t=document.createElement(\"img\");t.setAttribute(\"role\",\"button\"),t.setAttribute(\"tabindex\",\"0\"),t.setAttribute(\"alt\",s(\"copy-to-clipboard\")),t.setAttribute(\"src\",e.self.getResource(\"/copy.svg\")),t.classList.add(\"sa-copy-reporter-icon\"),e.tab.displayNoneWhileDisabled(t),t.onclick=()=>navigator.clipboard.writeText(o),w.appendChild(t)}i.appendChild(w),n.DropDownDiv.setColour(n.Colours.valueReportBackground,n.Colours.valueReportBorder),n.DropDownDiv.showPositionedByBlock(this,r)}},\"style.css\":o.n(s).a,\"copy.svg\":\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIxLDguOTRhMS4zMSwxLjMxLDAsMCwwLS4wNi0uMjdsMC0uMDlhMS4wNywxLjA3LDAsMCwwLS4xOS0uMjhoMGwtNi02aDBhMS4wNywxLjA3LDAsMCwwLS4yOC0uMTkuMzIuMzIsMCwwLDAtLjA5LDBBLjg4Ljg4LDAsMCwwLDE0LjA1LDJIMTBBMywzLDAsMCwwLDcsNVY2SDZBMywzLDAsMCwwLDMsOVYxOWEzLDMsMCwwLDAsMywzaDhhMywzLDAsMCwwLDMtM1YxOGgxYTMsMywwLDAsMCwzLTNWOVMyMSw5LDIxLDguOTRaTTE1LDUuNDEsMTcuNTksOEgxNmExLDEsMCwwLDEtMS0xWk0xNSwxOWExLDEsMCwwLDEtMSwxSDZhMSwxLDAsMCwxLTEtMVY5QTEsMSwwLDAsMSw2LDhIN3Y3YTMsMywwLDAsMCwzLDNoNVptNC00YTEsMSwwLDAsMS0xLDFIMTBhMSwxLDAsMCwxLTEtMVY1YTEsMSwwLDAsMSwxLTFoM1Y3YTMsMywwLDAsMCwzLDNoM1oiIGZpbGw9IiM1NzVlNzUiLz48L3N2Zz4K\"}}}]);","name":"js/pentapod/addon-entry-copy-reporter.8a0655d0075f9738981c.js","input":"(window[\"webpackJsonpGUI\"] = window[\"webpackJsonpGUI\"] || []).push([[13],{\n\n/***/ 1496:\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(9)(false);\n// imports\n\n\n// module\nexports.push([module.i, \".sa-copy-reporter-icon {\\n cursor: pointer;\\n float: right;\\n display: block;\\n user-select: none;\\n filter: var(--editorDarkMode-accent-filter, none);\\n width: 14px;\\n height: 14px;\\n}\\n\\n.valueReportBox {\\n user-select: text;\\n}\\n\", \"\"]);\n\n// exports\n\n\n/***/ }),\n\n/***/ 1540:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, \"resources\", function() { return /* binding */ resources; });\n\n// CONCATENATED MODULE: ./src/addons/addons/copy-reporter/userscript.js\n/* harmony default export */ var userscript = (async function (_ref) {\n let {\n addon,\n console,\n msg\n } = _ref;\n addon.tab.createEditorContextMenu(ctx => {\n const className = ctx.type === \"monitor_large\" ? \"monitor_large-value\" : \"monitor_value\";\n const element = ctx.target.querySelector(\"[class*='\".concat(className, \"_']\"));\n if (element.innerText.length !== 0) {\n navigator.clipboard.writeText(element.innerText);\n }\n }, {\n className: \"copy\",\n types: [\"monitor_default\", \"monitor_large\", \"monitor_slider\"],\n position: \"monitor\",\n order: 0,\n label: msg(\"copy-value\")\n });\n\n // add button to reporter bubble\n const ScratchBlocks = await addon.tab.traps.getBlockly();\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/workspace_svg.js#L979\n ScratchBlocks.WorkspaceSvg.prototype.reportValue = function (id, value) {\n let block = this.getBlockById(id);\n if (!block) {\n throw \"Tried to report value on block that does not exist.\";\n }\n ScratchBlocks.DropDownDiv.hideWithoutAnimation();\n ScratchBlocks.DropDownDiv.clearContent();\n let contentDiv = ScratchBlocks.DropDownDiv.getContentDiv();\n let valueReportBox = document.createElement(\"div\");\n valueReportBox.setAttribute(\"class\", \"valueReportBox\");\n valueReportBox.innerText = value;\n if (!addon.self.disabled) {\n // use to get focus and event priority\n valueReportBox.setAttribute(\"tabindex\", \"0\");\n // if the user pressed Ctrl+C, prevent propagation to Blockly\n valueReportBox.onkeydown = event => {\n if ((event.altKey || event.ctrlKey || event.metaKey) && event.code === \"KeyC\") {\n event.stopPropagation();\n }\n };\n if (value.length !== 0) {\n const copyButton = document.createElement(\"img\");\n copyButton.setAttribute(\"role\", \"button\");\n copyButton.setAttribute(\"tabindex\", \"0\");\n copyButton.setAttribute(\"alt\", msg(\"copy-to-clipboard\"));\n copyButton.setAttribute(\"src\", addon.self.getResource(\"/copy.svg\")) /* rewritten by pull.js */;\n copyButton.classList.add(\"sa-copy-reporter-icon\");\n addon.tab.displayNoneWhileDisabled(copyButton);\n copyButton.onclick = () => navigator.clipboard.writeText(value);\n valueReportBox.appendChild(copyButton);\n }\n }\n contentDiv.appendChild(valueReportBox);\n ScratchBlocks.DropDownDiv.setColour(ScratchBlocks.Colours.valueReportBackground, ScratchBlocks.Colours.valueReportBorder);\n ScratchBlocks.DropDownDiv.showPositionedByBlock(this, block);\n };\n});\n// EXTERNAL MODULE: ./node_modules/css-loader!./src/addons/addons/copy-reporter/style.css\nvar style = __webpack_require__(1496);\nvar style_default = /*#__PURE__*/__webpack_require__.n(style);\n\n// CONCATENATED MODULE: ./node_modules/url-loader/dist/cjs.js!./src/addons/addons/copy-reporter/copy.svg\n/* harmony default export */ var copy = (\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIxLDguOTRhMS4zMSwxLjMxLDAsMCwwLS4wNi0uMjdsMC0uMDlhMS4wNywxLjA3LDAsMCwwLS4xOS0uMjhoMGwtNi02aDBhMS4wNywxLjA3LDAsMCwwLS4yOC0uMTkuMzIuMzIsMCwwLDAtLjA5LDBBLjg4Ljg4LDAsMCwwLDE0LjA1LDJIMTBBMywzLDAsMCwwLDcsNVY2SDZBMywzLDAsMCwwLDMsOVYxOWEzLDMsMCwwLDAsMywzaDhhMywzLDAsMCwwLDMtM1YxOGgxYTMsMywwLDAsMCwzLTNWOVMyMSw5LDIxLDguOTRaTTE1LDUuNDEsMTcuNTksOEgxNmExLDEsMCwwLDEtMS0xWk0xNSwxOWExLDEsMCwwLDEtMSwxSDZhMSwxLDAsMCwxLTEtMVY5QTEsMSwwLDAsMSw2LDhIN3Y3YTMsMywwLDAsMCwzLDNoNVptNC00YTEsMSwwLDAsMS0xLDFIMTBhMSwxLDAsMCwxLTEtMVY1YTEsMSwwLDAsMSwxLTFoM1Y3YTMsMywwLDAsMCwzLDNoM1oiIGZpbGw9IiM1NzVlNzUiLz48L3N2Zz4K\");\n// CONCATENATED MODULE: ./src/addons/addons/copy-reporter/_runtime_entry.js\n/* generated by pull.js */\n\n\n\nconst resources = {\n \"userscript.js\": userscript,\n \"style.css\": style_default.a,\n \"copy.svg\": copy\n};\n\n/***/ })\n\n}]);","inputSourceMap":null}