{"code":"(window.webpackJsonpGUI=window.webpackJsonpGUI||[]).push([[12],{1507:function(t,e,n){(t.exports=n(9)(!1)).push([t.i,'[class*=\"blocks_blocks_\"] .blocklyToolboxDiv {\\n width: 310px;\\n height: auto !important;\\n}\\n\\n.scratchCategoryMenu {\\n width: 100%;\\n columns: 2;\\n column-gap: 0.5rem;\\n padding: 0.25rem;\\n}\\n\\n.scratchCategorySecondMenu {\\n columns: 1;\\n display: grid;\\n grid-template-columns: repeat(2, 1fr);\\n padding-bottom: 2.25rem;\\n}\\n\\n.scratchCategorySecondMenu:empty {\\n padding-top: 0;\\n padding-bottom: 2rem;\\n}\\n\\n.scratchCategoryMenuItem {\\n display: inline-flex; /* inline so that it isn\\'t split between both columns */\\n width: 100%;\\n padding: 0.25rem;\\n border-radius: 0.875rem;\\n}\\n\\n.scratchCategoryItemBubble,\\n.scratchCategoryItemIcon {\\n margin: 0;\\n margin-inline-end: 0.5rem;\\n}\\n\\n.scratchCategoryMenuItemLabel {\\n flex: 1;\\n display: flex;\\n align-items: center;\\n}\\n\\n[class*=\"gui_extension-button-container_\"] {\\n top: var(--sa-add-extension-button-y);\\n bottom: auto;\\n margin-inline-start: 0.5rem;\\n width: calc(308px - 1rem);\\n height: calc(1.75rem - 2px);\\n background-color: transparent;\\n border-color: var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n}\\n\\n/* [dir] is for specificity to override editor-stage-left */\\n[dir] [class*=\"gui_extension-button-container_\"] {\\n border-radius: 0.25rem;\\n}\\n\\n[class*=\"gui_extension-button-container_\"]:hover {\\n background-color: var(--editorDarkMode-accent, white);\\n}\\n\\n[class*=\"gui_extension-button-container_\"]::before {\\n display: none;\\n}\\n\\n[class*=\"gui_extension-button_\"] {\\n display: flex;\\n align-items: center;\\n padding-inline: 0;\\n}\\n\\n[class*=\"gui_extension-button-icon_\"] {\\n filter: var(--editorDarkMode-categoryMenu-invertedFilter, brightness(0.4));\\n}\\n\\n[class*=\"gui_extension-button-container_\"]:hover [class*=\"gui_extension-button-icon_\"] {\\n filter: var(--editorDarkMode-accent-invertedFilter, brightness(0.4));\\n}\\n\\n.sa-add-extension-label {\\n color: var(--editorDarkMode-categoryMenu-text, #575e75);\\n font-size: 0.65rem;\\n}\\n\\n[class*=\"gui_extension-button-container_\"]:hover .sa-add-extension-label {\\n color: var(--editorDarkMode-accent-text, #575e75);\\n font-size: 0.65rem;\\n}\\n\\n/* hide-flyout compatibility */\\n\\n[class*=\"gui_tabs_\"] {\\n --sa-flyout-width: 310px;\\n --sa-category-width: 0;\\n}\\n\\n.sa-flyout-placeHolder {\\n top: calc(var(--sa-flyout-y));\\n}\\n',\"\"])},1581:function(t,e,n){\"use strict\";n.r(e),n.d(e,\"resources\",(function(){return s}));var o=n(1507);const s={\"userscript.js\":async function(t){let{addon:e,msg:n,console:o}=t;const s=await e.tab.traps.getBlockly(),i=s.Toolbox.prototype.position;s.Toolbox.prototype.position=function(){i.call(this),this.HtmlDiv&&!this.HtmlDiv._observer&&(this.HtmlDiv._observer=new ResizeObserver((()=>{this.flyout_.position()})),this.HtmlDiv._observer.observe(this.HtmlDiv))};const a=s.VerticalFlyout.prototype.position;s.VerticalFlyout.prototype.position=function(){if(a.call(this),e.self.disabled||!this.isVisible())return;var t=this.targetWorkspace_.getMetrics();if(!t)return;var n=this.toolboxPosition_===s.TOOLBOX_AT_RIGHT?t.viewWidth-3:0,o=this.parentToolbox_.HtmlDiv.offsetHeight;this.width_=this.parentToolbox_.getWidth(),this.height_=Math.max(0,t.viewHeight-o),this.setBackgroundPath_(this.width_,this.height_),this.svgGroup_.setAttribute(\"width\",this.width_),this.svgGroup_.setAttribute(\"height\",this.height_);var i=\"translate(\"+n+\"px,\"+o+\"px)\";s.utils.setCssTransform(this.svgGroup_,i),this.scrollbar_&&(this.scrollbar_.setOrigin(n+(this.toolboxPosition_===s.TOOLBOX_AT_RIGHT?0:this.width_-this.getWidth()),o),this.scrollbar_.resize());const r=this.svgGroup_.closest(\"[class*='gui_tab-panel_']\");r.style.setProperty(\"--sa-add-extension-button-y\",\"\".concat(o-33,\"px\")),r.parentElement.style.setProperty(\"--sa-flyout-y\",\"\".concat(o,\"px\"))};const r=s.VerticalFlyout.prototype.getWidth;s.VerticalFlyout.prototype.getWidth=function(){let t=r.call(this);return e.self.disabled||(t+=60),t};const l=s.Toolbox.CategoryMenu.prototype.createDom;s.Toolbox.CategoryMenu.prototype.createDom=function(){l.call(this),e.self.disabled||(this.secondTable=document.createElement(\"div\"),this.secondTable.className=\"scratchCategorySecondMenu \"+(this.parent_.horizontalLayout_?\"scratchCategoryMenuHorizontal\":\"scratchCategoryMenu\"),this.parentHtml_.appendChild(this.secondTable))};const c=s.Toolbox.CategoryMenu.prototype.populate;s.Toolbox.CategoryMenu.prototype.populate=function(t){if(!t)return;const n=[\"motion\",\"looks\",\"sound\",\"events\",\"control\",\"sensing\",\"operators\",\"variables\",\"lists\",\"myBlocks\"],o=[],i=t.cloneNode(!0);e.self.disabled||i.childNodes.forEach((t=>{\"category\"!==t.tagName||n.includes(t.id)||(o.push(t.cloneNode(!0)),t.remove())})),c.call(this,i);for(const t of o){const e=document.createElement(\"div\");e.className=\"scratchCategoryMenuRow\",this.secondTable.appendChild(e),t&&this.categories_.push(new s.Toolbox.Category(this,e,t))}e.self.disabled||(this.height_=this.table.offsetHeight+this.secondTable.offsetHeight)};const d=s.Toolbox.CategoryMenu.prototype.dispose;function u(){const t=s.getMainWorkspace(),n=t.getToolbox();if(!n)return;const o=n.categoryMenu_;o&&(o.secondTable&&!e.self.disabled||(o.dispose(),o.createDom(),n.populate_(t.options.languageTree),n.position()))}function h(){e.self.disabled?document.body.classList.remove(\"sa-columns-enabled\"):document.body.classList.add(\"sa-columns-enabled\")}for(s.Toolbox.CategoryMenu.prototype.dispose=function(){d.call(this),this.secondTable&&(this.secondTable.remove(),this.secondTable=null)},u(),e.self.addEventListener(\"disabled\",u),e.self.addEventListener(\"reenabled\",u),h(),e.self.addEventListener(\"disabled\",h),e.self.addEventListener(\"reenabled\",h);;){const t=await e.tab.waitForElement(\"[class*='gui_extension-button_']\",{markAsSeen:!0,reduxEvents:[\"scratch-gui/mode/SET_PLAYER\",\"fontsLoaded/SET_FONTS_LOADED\",\"scratch-gui/locales/SELECT_LOCALE\"],condition:()=>!e.tab.redux.state.scratchGui.mode.isPlayerOnly}),n=Object.assign(document.createElement(\"span\"),{className:\"sa-add-extension-label\",innerText:e.tab.scratchMessage(\"gui.gui.addExtension\")});e.tab.displayNoneWhileDisabled(n),t.appendChild(n),t.removeAttribute(\"title\")}},\"style.css\":n.n(o).a}}}]);","name":"js/pentapod/addon-entry-columns.047432f96ac8e04cc8fa.js","input":"(window[\"webpackJsonpGUI\"] = window[\"webpackJsonpGUI\"] || []).push([[12],{\n\n/***/ 1507:\n/***/ (function(module, exports, __webpack_require__) {\n\nexports = module.exports = __webpack_require__(9)(false);\n// imports\n\n\n// module\nexports.push([module.i, \"[class*=\\\"blocks_blocks_\\\"] .blocklyToolboxDiv {\\n width: 310px;\\n height: auto !important;\\n}\\n\\n.scratchCategoryMenu {\\n width: 100%;\\n columns: 2;\\n column-gap: 0.5rem;\\n padding: 0.25rem;\\n}\\n\\n.scratchCategorySecondMenu {\\n columns: 1;\\n display: grid;\\n grid-template-columns: repeat(2, 1fr);\\n padding-bottom: 2.25rem;\\n}\\n\\n.scratchCategorySecondMenu:empty {\\n padding-top: 0;\\n padding-bottom: 2rem;\\n}\\n\\n.scratchCategoryMenuItem {\\n display: inline-flex; /* inline so that it isn't split between both columns */\\n width: 100%;\\n padding: 0.25rem;\\n border-radius: 0.875rem;\\n}\\n\\n.scratchCategoryItemBubble,\\n.scratchCategoryItemIcon {\\n margin: 0;\\n margin-inline-end: 0.5rem;\\n}\\n\\n.scratchCategoryMenuItemLabel {\\n flex: 1;\\n display: flex;\\n align-items: center;\\n}\\n\\n[class*=\\\"gui_extension-button-container_\\\"] {\\n top: var(--sa-add-extension-button-y);\\n bottom: auto;\\n margin-inline-start: 0.5rem;\\n width: calc(308px - 1rem);\\n height: calc(1.75rem - 2px);\\n background-color: transparent;\\n border-color: var(--editorDarkMode-border, rgba(0, 0, 0, 0.15));\\n}\\n\\n/* [dir] is for specificity to override editor-stage-left */\\n[dir] [class*=\\\"gui_extension-button-container_\\\"] {\\n border-radius: 0.25rem;\\n}\\n\\n[class*=\\\"gui_extension-button-container_\\\"]:hover {\\n background-color: var(--editorDarkMode-accent, white);\\n}\\n\\n[class*=\\\"gui_extension-button-container_\\\"]::before {\\n display: none;\\n}\\n\\n[class*=\\\"gui_extension-button_\\\"] {\\n display: flex;\\n align-items: center;\\n padding-inline: 0;\\n}\\n\\n[class*=\\\"gui_extension-button-icon_\\\"] {\\n filter: var(--editorDarkMode-categoryMenu-invertedFilter, brightness(0.4));\\n}\\n\\n[class*=\\\"gui_extension-button-container_\\\"]:hover [class*=\\\"gui_extension-button-icon_\\\"] {\\n filter: var(--editorDarkMode-accent-invertedFilter, brightness(0.4));\\n}\\n\\n.sa-add-extension-label {\\n color: var(--editorDarkMode-categoryMenu-text, #575e75);\\n font-size: 0.65rem;\\n}\\n\\n[class*=\\\"gui_extension-button-container_\\\"]:hover .sa-add-extension-label {\\n color: var(--editorDarkMode-accent-text, #575e75);\\n font-size: 0.65rem;\\n}\\n\\n/* hide-flyout compatibility */\\n\\n[class*=\\\"gui_tabs_\\\"] {\\n --sa-flyout-width: 310px;\\n --sa-category-width: 0;\\n}\\n\\n.sa-flyout-placeHolder {\\n top: calc(var(--sa-flyout-y));\\n}\\n\", \"\"]);\n\n// exports\n\n\n/***/ }),\n\n/***/ 1581:\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/columns/userscript.js\n/* harmony default export */ var userscript = (async function (_ref) {\n let {\n addon,\n msg,\n console\n } = _ref;\n const Blockly = await addon.tab.traps.getBlockly();\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/toolbox.js#L235\n const _ToolboxPosition = Blockly.Toolbox.prototype.position;\n Blockly.Toolbox.prototype.position = function () {\n _ToolboxPosition.call(this);\n\n // Update flyout position when category menu height changes.\n if (this.HtmlDiv && !this.HtmlDiv._observer) {\n this.HtmlDiv._observer = new ResizeObserver(() => {\n this.flyout_.position();\n });\n this.HtmlDiv._observer.observe(this.HtmlDiv);\n }\n };\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/flyout_vertical.js#L314\n const _VerticalFlyoutPosition = Blockly.VerticalFlyout.prototype.position;\n Blockly.VerticalFlyout.prototype.position = function () {\n _VerticalFlyoutPosition.call(this);\n if (addon.self.disabled || !this.isVisible()) {\n return;\n }\n var targetWorkspaceMetrics = this.targetWorkspace_.getMetrics();\n if (!targetWorkspaceMetrics) {\n // Hidden components will return null.\n return;\n }\n\n // In RTL, subtract the total width of left and right workspace borders and the category menu border\n // from the workspace width.\n var x = this.toolboxPosition_ === Blockly.TOOLBOX_AT_RIGHT ? targetWorkspaceMetrics.viewWidth - 3 : 0;\n var y = this.parentToolbox_.HtmlDiv.offsetHeight;\n\n // Addon sets the width of the flyout to the width of the toolbox.\n this.width_ = this.parentToolbox_.getWidth();\n this.height_ = Math.max(0, targetWorkspaceMetrics.viewHeight - y);\n this.setBackgroundPath_(this.width_, this.height_);\n this.svgGroup_.setAttribute(\"width\", this.width_);\n this.svgGroup_.setAttribute(\"height\", this.height_);\n var transform = \"translate(\" + x + \"px,\" + y + \"px)\";\n Blockly.utils.setCssTransform(this.svgGroup_, transform);\n\n // Update the scrollbar (if one exists).\n if (this.scrollbar_) {\n // Set the scrollbars origin to be the top left of the flyout.\n this.scrollbar_.setOrigin(x + (this.toolboxPosition_ === Blockly.TOOLBOX_AT_RIGHT ? 0 : this.width_ - this.getWidth()), y);\n this.scrollbar_.resize();\n }\n\n // Set CSS variables for the userstyle.\n const container = this.svgGroup_.closest(\"[class*='gui_tab-panel_']\");\n container.style.setProperty(\"--sa-add-extension-button-y\", \"\".concat(y - 33, \"px\"));\n container.parentElement.style.setProperty(\"--sa-flyout-y\", \"\".concat(y, \"px\"));\n };\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/flyout_base.js#L370\n const _VerticalFlyoutGetWidth = Blockly.VerticalFlyout.prototype.getWidth;\n Blockly.VerticalFlyout.prototype.getWidth = function () {\n // In RTL, this will be called by Blockly to position blocks inside the flyout.\n let width = _VerticalFlyoutGetWidth.call(this);\n if (!addon.self.disabled) width += 60;\n return width;\n };\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/toolbox.js#L595\n const _CategoryMenuCreateDom = Blockly.Toolbox.CategoryMenu.prototype.createDom;\n Blockly.Toolbox.CategoryMenu.prototype.createDom = function () {\n _CategoryMenuCreateDom.call(this);\n if (addon.self.disabled) return;\n this.secondTable = document.createElement(\"div\");\n this.secondTable.className = \"scratchCategorySecondMenu \" + (this.parent_.horizontalLayout_ ? \"scratchCategoryMenuHorizontal\" : \"scratchCategoryMenu\");\n this.parentHtml_.appendChild(this.secondTable);\n };\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/toolbox.js#L606\n const _CategoryMenuPopulate = Blockly.Toolbox.CategoryMenu.prototype.populate;\n Blockly.Toolbox.CategoryMenu.prototype.populate = function (domTree) {\n if (!domTree) return;\n const Categories = [\"motion\", \"looks\", \"sound\", \"events\", \"control\", \"sensing\", \"operators\", \"variables\", \"lists\", \"myBlocks\"];\n const extensionsNodes = [];\n const extensionTree = domTree.cloneNode(true);\n if (!addon.self.disabled) {\n extensionTree.childNodes.forEach(child => {\n if (child.tagName === \"category\" && !Categories.includes(child.id)) {\n extensionsNodes.push(child.cloneNode(true));\n child.remove();\n }\n });\n }\n _CategoryMenuPopulate.call(this, extensionTree);\n for (const child of extensionsNodes) {\n const row = document.createElement(\"div\");\n row.className = \"scratchCategoryMenuRow\";\n this.secondTable.appendChild(row);\n if (child) {\n this.categories_.push(new Blockly.Toolbox.Category(this, row, child));\n }\n }\n if (!addon.self.disabled) {\n this.height_ = this.table.offsetHeight + this.secondTable.offsetHeight;\n }\n };\n\n // https://github.com/scratchfoundation/scratch-blocks/blob/893c7e7ad5bfb416eaed75d9a1c93bdce84e36ab/core/toolbox.js#L639\n const _CategoryMenuDispose = Blockly.Toolbox.CategoryMenu.prototype.dispose;\n Blockly.Toolbox.CategoryMenu.prototype.dispose = function () {\n _CategoryMenuDispose.call(this);\n if (this.secondTable) {\n this.secondTable.remove();\n this.secondTable = null;\n }\n };\n function updateToolbox() {\n const workspace = Blockly.getMainWorkspace();\n const toolbox = workspace.getToolbox();\n if (!toolbox) return;\n const categoryMenu = toolbox.categoryMenu_;\n if (!categoryMenu) return;\n\n // Scratch may have already updated the toolbox for us, so no need to update it again.\n if (categoryMenu.secondTable && !addon.self.disabled) return;\n // Must dispose and createDom the category menu so we can run our polluted commands.\n categoryMenu.dispose();\n categoryMenu.createDom();\n // Repopulate the category menu since we've just disposed it.\n toolbox.populate_(workspace.options.languageTree);\n // Reposition the toolbox, since it's likely our addon moved it.\n toolbox.position();\n }\n function updateClass() {\n // Add class to allow editor-compact to handle this addon\n if (addon.self.disabled) document.body.classList.remove(\"sa-columns-enabled\");else document.body.classList.add(\"sa-columns-enabled\");\n }\n updateToolbox();\n addon.self.addEventListener(\"disabled\", updateToolbox);\n addon.self.addEventListener(\"reenabled\", updateToolbox);\n updateClass();\n addon.self.addEventListener(\"disabled\", updateClass);\n addon.self.addEventListener(\"reenabled\", updateClass);\n while (true) {\n const addExtensionButton = await addon.tab.waitForElement(\"[class*='gui_extension-button_']\", {\n markAsSeen: true,\n reduxEvents: [\"scratch-gui/mode/SET_PLAYER\", \"fontsLoaded/SET_FONTS_LOADED\", \"scratch-gui/locales/SELECT_LOCALE\"],\n condition: () => !addon.tab.redux.state.scratchGui.mode.isPlayerOnly\n });\n const addExtensionLabel = Object.assign(document.createElement(\"span\"), {\n className: \"sa-add-extension-label\",\n innerText: addon.tab.scratchMessage(\"gui.gui.addExtension\")\n });\n addon.tab.displayNoneWhileDisabled(addExtensionLabel);\n addExtensionButton.appendChild(addExtensionLabel);\n addExtensionButton.removeAttribute(\"title\");\n }\n});\n// EXTERNAL MODULE: ./node_modules/css-loader!./src/addons/addons/columns/style.css\nvar style = __webpack_require__(1507);\nvar style_default = /*#__PURE__*/__webpack_require__.n(style);\n\n// CONCATENATED MODULE: ./src/addons/addons/columns/_runtime_entry.js\n/* generated by pull.js */\n\n\nconst resources = {\n \"userscript.js\": userscript,\n \"style.css\": style_default.a\n};\n\n/***/ })\n\n}]);","inputSourceMap":null}