iobroker.javascript 10.0.0 → 10.1.0
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.
- package/README.md +41 -6
- package/admin/assets/AiChatPanel-C4kuqP2U.js +237 -0
- package/admin/assets/AiDiffView-zJTEnv05.js +1 -0
- package/admin/assets/BlocklyEditor-BB77aFJI.js +84 -0
- package/admin/assets/ContextWrapper-C2yvd2Tn.css +1 -0
- package/admin/assets/ContextWrapper-W2H0z6zD.js +136 -0
- package/admin/assets/Debugger-DCMWjeGm.js +15 -0
- package/admin/assets/Error-CBC2oZzb.js +1 -0
- package/admin/assets/Import-B-F9IhZ-.js +1 -0
- package/admin/assets/RulesEditor-ByjgEaVo.js +1 -0
- package/admin/assets/RulesEditor-k-DMHotH.css +1 -0
- package/admin/assets/{ScriptEditor-BGIuoNei.js → ScriptEditor-CMYUt5S4.js} +2 -2
- package/admin/assets/{ScriptEditorVanillaMonaco-DyMQtoTQ.js → ScriptEditorVanillaMonaco-v12-gORS.js} +3 -3
- package/admin/assets/Send-CChqR5Oy.js +1 -0
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-7EPUlgCk.js +1 -0
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DuplUOZN.js +1243 -0
- package/admin/assets/{_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BBAXJaqI.js → _virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-JkwfVf8d.js} +1 -1
- package/admin/assets/{aiCodeLensProvider-hyAmut0e.js → aiCodeLensProvider-BGvIu6hH.js} +1 -1
- package/admin/assets/blockly-C4zJerWL.js +1047 -0
- package/admin/assets/blocks_action-CvnOHXwt.js +1 -0
- package/admin/assets/blocks_convert-BZlKcd02.js +3 -0
- package/admin/assets/blocks_logic-B33Pypxr.js +1 -0
- package/admin/assets/blocks_number-k2IjE7OH.js +1 -0
- package/admin/assets/blocks_object-B64vSfel.js +1 -0
- package/admin/assets/blocks_procedures-BpvNI5dO.js +3 -0
- package/admin/assets/blocks_sendto-pwZchfe0.js +5 -0
- package/admin/assets/blocks_switch-DViYCmQd.js +2 -0
- package/admin/assets/blocks_system-BZZcGqTJ.js +1 -0
- package/admin/assets/blocks_text-BOvtHN2r.js +1 -0
- package/admin/assets/blocks_time-BH2F-ylT.js +1 -0
- package/admin/assets/blocks_timeout-C3BoW4XJ.js +1 -0
- package/admin/assets/blocks_trigger-gwXvuAHV.js +2 -0
- package/admin/assets/blocks_words-D8PL_nSE.js +1 -0
- package/admin/assets/{cronHoverProvider-pKJkSevo.js → cronHoverProvider-DjY3jLvQ.js} +1 -1
- package/admin/assets/dist-D6o4h8Pd.js +4 -0
- package/admin/assets/field_cron-BMQWPb61.js +1 -0
- package/admin/assets/field_oid-BGIMv9gw.js +1 -0
- package/admin/assets/field_script-CdzYBCe6.js +1 -0
- package/admin/assets/helpers-Crmcgphg.js +1 -0
- package/admin/assets/hostInit-DBlZi_Kt.js +1 -0
- package/admin/assets/index-BvPVHv3P.js +192 -0
- package/admin/assets/{inlineChatWidget-ZaisTOLh.js → inlineChatWidget-SDoyVtOR.js} +2 -2
- package/admin/assets/{inlineDiffController-hTwHHqcc.js → inlineDiffController-CnHE3Rwd.js} +2 -2
- package/admin/assets/javascript-DVIhlTDr.js +218 -0
- package/admin/assets/{mf-entry-bootstrap-0-d6052b31.js → mf-entry-bootstrap-0-a03ecebd.js} +6 -2
- package/admin/assets/{mjs-DWqivHEk.js → mjs-Bh7xFIpd.js} +2 -2
- package/admin/assets/{stateHoverProvider-C7DawIs-.js → stateHoverProvider-D0iXo6YF.js} +3 -3
- package/admin/assets/{virtualExposes-Ed0lGq7k.js → virtualExposes-DgGB-18P.js} +1 -1
- package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-DYEYnOkt.js +1 -0
- package/admin/assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js +1 -0
- package/admin/custom/assets/Components-CuFt9lAY.js +1 -0
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-DljJyQQg.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-D0M1SjIE.js +1 -0
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-CGb5Cofy.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-BD2OkSge.js} +1 -1
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BVCIAgbo.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-pM642JFd.js} +91 -91
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-BkB0anQX.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-BLelmJ7Y.js} +74 -74
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BotqDuw-.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BGiB1l5e.js} +1 -1
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__date_mf_2_fns__prebuild__-Cb5TR7FB.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__prebuild__date_mf_2_fns__prebuild__-D5hqXJXI.js} +1 -1
- package/admin/custom/assets/hostInit-0DGPuZTB.js +1 -0
- package/admin/custom/assets/{index-uEKAoVT7.js → index-DcFI5r-g.js} +1 -1
- package/admin/custom/assets/{lib-Yj8cfN0A.js → lib-BlUjuGH7.js} +1 -1
- package/admin/custom/assets/{mf-entry-bootstrap-0-77793feb.js → mf-entry-bootstrap-0-efd847a6.js} +6 -2
- package/admin/custom/assets/{setYear-DJ9FbdkO.js → setYear-BaCcPbbI.js} +1 -1
- package/admin/custom/assets/virtualExposes-DGxNcyb6.js +1 -0
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-DVNwFcUr.js +1 -0
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-DPck7zEs.js +2 -0
- package/admin/custom/customComponents.js +1 -1
- package/admin/google-blockly/VERSION +1 -0
- package/admin/google-blockly/media/drop.mp3 +0 -0
- package/admin/google-blockly/msg/js/de.js +332 -56
- package/admin/google-blockly/msg/js/en.js +319 -43
- package/admin/google-blockly/msg/js/es.js +319 -42
- package/admin/google-blockly/msg/js/fr.js +315 -39
- package/admin/google-blockly/msg/js/it.js +327 -51
- package/admin/google-blockly/msg/js/nl.js +376 -100
- package/admin/google-blockly/msg/js/pl.js +318 -42
- package/admin/google-blockly/msg/js/pt.js +318 -42
- package/admin/google-blockly/msg/js/ru.js +320 -44
- package/admin/google-blockly/msg/js/uk.js +326 -50
- package/admin/google-blockly/msg/js/zh-cn.js +322 -46
- package/admin/i18n/de.json +48 -26
- package/admin/i18n/en.json +47 -25
- package/admin/i18n/es.json +48 -18
- package/admin/i18n/fr.json +47 -17
- package/admin/i18n/it.json +47 -17
- package/admin/i18n/nl.json +47 -17
- package/admin/i18n/pl.json +48 -18
- package/admin/i18n/pt.json +47 -17
- package/admin/i18n/ru.json +47 -17
- package/admin/i18n/uk.json +47 -17
- package/admin/i18n/zh-cn.json +47 -17
- package/admin/jsonConfig.json +367 -0
- package/admin/mf-manifest.json +1 -1
- package/admin/mf-stats.json +1 -1
- package/admin/remoteEntry.js +1 -1
- package/admin/tab.html +12 -95
- package/build/lib/mirror.js +9 -0
- package/build/lib/mirror.js.map +1 -1
- package/build/lib/sandbox.js +35 -0
- package/build/lib/sandbox.js.map +1 -1
- package/build/lib/typescriptSettings.js +112 -2
- package/build/lib/typescriptSettings.js.map +1 -1
- package/build/lib/typescriptTools.js +168 -43
- package/build/lib/typescriptTools.js.map +1 -1
- package/build/main.js +10 -5
- package/build/main.js.map +1 -1
- package/build/types.d.ts +41 -0
- package/docs/en/javascript.md +16 -0
- package/docs/en/upgrade-guide.md +3 -0
- package/io-package.json +45 -15
- package/package.json +8 -3
- package/admin/assets/AiChatPanel-p0KAg6Cs.js +0 -237
- package/admin/assets/AiDiffView-BPTLnNx1.js +0 -1
- package/admin/assets/BlocklyEditor-CAjVMhYT.js +0 -81
- package/admin/assets/ContextWrapper-BVc8wTK_.css +0 -1
- package/admin/assets/ContextWrapper-D9CrnNKs.js +0 -127
- package/admin/assets/Debugger-SjROokFI.js +0 -15
- package/admin/assets/Error-DDfrxAt2.js +0 -1
- package/admin/assets/Import-DpTg1Jow.js +0 -1
- package/admin/assets/RulesEditor-BSRFWpEm.css +0 -1
- package/admin/assets/RulesEditor-D0hgrcBc.js +0 -1
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-DWJotR1B.js +0 -1
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-CxICLr5Z.js +0 -1243
- package/admin/assets/dist-uw5orDgd.js +0 -4
- package/admin/assets/hostInit-BFg5u9hY.js +0 -1
- package/admin/assets/index-B1gICjdq.js +0 -192
- package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BYs71IQF.js +0 -1
- package/admin/assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-DnnXQRkG.js +0 -1
- package/admin/custom/assets/Components-BrDyDHXh.js +0 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-CyYJM2-v.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-BdzCssLn.js +0 -1
- package/admin/custom/assets/hostInit-DJx2uXXy.js +0 -1
- package/admin/custom/assets/virtualExposes-CxDjLoYu.js +0 -1
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-BU-ugy_7.js +0 -1
- package/admin/custom/assets/virtual_mf-exposes-ssr___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-BEfZbrf7.js +0 -2
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-CTeZ0Jpm.js +0 -2
- package/admin/google-blockly/blockly_compressed.js +0 -1679
- package/admin/google-blockly/blocks_compressed.js +0 -193
- package/admin/google-blockly/javascript_compressed.js +0 -264
- package/admin/google-blockly/msg/messages.js +0 -1630
- package/admin/google-blockly/own/blocks_action.js +0 -765
- package/admin/google-blockly/own/blocks_convert.js +0 -480
- package/admin/google-blockly/own/blocks_logic.js +0 -459
- package/admin/google-blockly/own/blocks_number.js +0 -30
- package/admin/google-blockly/own/blocks_object.js +0 -402
- package/admin/google-blockly/own/blocks_procedures.js +0 -688
- package/admin/google-blockly/own/blocks_sendto.js +0 -702
- package/admin/google-blockly/own/blocks_switch.js +0 -257
- package/admin/google-blockly/own/blocks_system.js +0 -1409
- package/admin/google-blockly/own/blocks_text.js +0 -104
- package/admin/google-blockly/own/blocks_time.js +0 -639
- package/admin/google-blockly/own/blocks_timeout.js +0 -551
- package/admin/google-blockly/own/blocks_trigger.js +0 -1791
- package/admin/google-blockly/own/blocks_words.js +0 -708
- package/admin/google-blockly/own/field_cron.js +0 -158
- package/admin/google-blockly/own/field_oid.js +0 -642
- package/admin/google-blockly/own/field_script.js +0 -159
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`).length;this.status.textContent=this.initialSelectedCode?
|
|
1
|
+
import{In as e,f as t}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DuplUOZN.js";import{t as n}from"./applyCodeEdit-D3nb7erO.js";var r=`iobroker.aichat.inline`;function i(e){if(!e)return{code:null,text:``};let t=e.match(/```[\w-]*\n([\s\S]*?)\n```/);return t?{code:t[1],text:e.replace(t[0],``).trim()}:{code:null,text:e}}var a=class a{constructor(n,r,i){e(this,`editor`,void 0),e(this,`monaco`,void 0),e(this,`host`,void 0),e(this,`domNode`,void 0),e(this,`input`,void 0),e(this,`status`,void 0),e(this,`responseBox`,void 0),e(this,`sendBtn`,void 0),e(this,`cancelBtn`,void 0),e(this,`applyBtn`,void 0),e(this,`openChatBtn`,void 0),e(this,`contentWidget`,null),e(this,`pendingResponse`,``),e(this,`pendingCode`,null),e(this,`initialRange`,null),e(this,`initialSelectedCode`,``),this.editor=n,this.monaco=r,this.host=i;let o=document.createElement(`div`);o.className=`iob-inline-chat`,o.style.cssText=[`background: var(--vscode-editor-background, #1e1e1e)`,`border: 1px solid rgba(128, 128, 128, 0.4)`,`border-radius: 6px`,`padding: 8px`,`min-width: 420px`,`max-width: 720px`,`box-shadow: 0 4px 12px rgba(0,0,0,0.3)`,`font-family: var(--vscode-font-family, system-ui)`,`font-size: 12px`,`color: var(--vscode-editor-foreground, #eee)`,`z-index: 100`].join(`; `);let s=document.createElement(`div`);s.textContent=`🤖 ${t.t(`AI inline chat`)}`,s.style.cssText=`font-weight: 600; margin-bottom: 6px; opacity: 0.8;`,o.appendChild(s),this.input=document.createElement(`textarea`),this.input.rows=2,this.input.placeholder=t.t(`Ask anything, or request a change (e.g. "what does this do?")`),this.input.style.cssText=[`width: 100%`,`box-sizing: border-box`,`background: rgba(0,0,0,0.2)`,`color: inherit`,`border: 1px solid rgba(128, 128, 128, 0.3)`,`border-radius: 4px`,`padding: 6px 8px`,`font-family: inherit`,`font-size: 12px`,`resize: vertical`].join(`; `),o.appendChild(this.input),this.status=document.createElement(`div`),this.status.style.cssText=`min-height: 16px; margin-top: 6px; opacity: 0.7; font-size: 11px;`,o.appendChild(this.status),this.responseBox=document.createElement(`pre`),this.responseBox.style.cssText=[`margin: 6px 0 0 0`,`padding: 6px`,`background: rgba(0,0,0,0.25)`,`border-radius: 4px`,`max-height: 240px`,`overflow: auto`,`white-space: pre-wrap`,`word-wrap: break-word`,`font-family: var(--vscode-editor-font-family, monospace)`,`font-size: 12px`,`display: none`].join(`; `),o.appendChild(this.responseBox);let c=document.createElement(`div`);c.style.cssText=`display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px;`,this.cancelBtn=a.makeButton(t.t(`Cancel`),`Esc`,!1),this.openChatBtn=a.makeButton(t.t(`Open in chat`),``,!1),this.openChatBtn.style.display=`none`,this.applyBtn=a.makeButton(t.t(`Apply`),`Enter`,!0),this.applyBtn.style.display=`none`,this.sendBtn=a.makeButton(t.t(`Send`),`Ctrl+Enter`,!0),c.appendChild(this.cancelBtn),c.appendChild(this.openChatBtn),c.appendChild(this.applyBtn),c.appendChild(this.sendBtn),o.appendChild(c),this.domNode=o,this.input.addEventListener(`keydown`,e=>this.onInputKeyDown(e)),this.sendBtn.addEventListener(`click`,()=>this.submit()),this.cancelBtn.addEventListener(`click`,()=>this.hide()),this.applyBtn.addEventListener(`click`,()=>this.applyProposal()),this.openChatBtn.addEventListener(`click`,()=>this.escalateToChat()),o.addEventListener(`mousedown`,e=>e.stopPropagation()),o.addEventListener(`keydown`,e=>e.stopPropagation())}static makeButton(e,t,n){let r=document.createElement(`button`);return r.textContent=t?`${e} · ${t}`:e,r.style.cssText=[`background: ${n?`var(--vscode-button-background, #0e639c)`:`transparent`}`,`color: ${n?`var(--vscode-button-foreground, #fff)`:`inherit`}`,`border: 1px solid ${n?`transparent`:`rgba(128, 128, 128, 0.4)`}`,`border-radius: 4px`,`padding: 4px 10px`,`cursor: pointer`,`font-family: inherit`,`font-size: 11px`].join(`; `),r}onInputKeyDown(e){e.key===`Escape`?(e.preventDefault(),this.hide()):e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.submit())}show(){let e=this.editor.getSelection(),n=this.editor.getModel();if(!n)return;this.initialRange=e&&!e.isEmpty()?e:null,this.initialSelectedCode=this.initialRange?n.getValueInRange(this.initialRange):``,this.input.value=``;let r=this.initialSelectedCode.split(`
|
|
2
|
+
`).length;this.status.textContent=this.initialSelectedCode?t.t(`Selection: %s line(s)`,r):t.t(`No selection — the question will use context from the whole script.`),this.responseBox.style.display=`none`,this.responseBox.textContent=``,this.applyBtn.style.display=`none`,this.openChatBtn.style.display=`none`,this.sendBtn.style.display=``,this.pendingResponse=``,this.pendingCode=null;let i=this.buildContentWidget();this.editor.addContentWidget(i),this.contentWidget=i,setTimeout(()=>this.input.focus(),50)}hide(){this.contentWidget&&=(this.editor.removeContentWidget(this.contentWidget),null),this.editor.focus()}buildContentWidget(){var e;let t=this.editor.getSelection(),n=(t==null?void 0:t.endLineNumber)??((e=this.editor.getPosition())==null?void 0:e.lineNumber)??1,i=(t==null?void 0:t.endColumn)??1,a=this.domNode,o=this.monaco;return{getId(){return r},getDomNode(){return a},getPosition(){return{position:{lineNumber:n,column:i},preference:[o.editor.ContentWidgetPositionPreference.BELOW,o.editor.ContentWidgetPositionPreference.ABOVE]}}}}async submit(){let e=this.input.value.trim();if(!e){this.status.textContent=t.t(`Please enter a question.`);return}this.setLoading(!0);try{let t=await this.host.onSubmit({question:e,selectedCode:this.initialSelectedCode,range:this.initialRange});this.showResponse(t)}catch(e){this.status.textContent=`${t.t(`Error`)}: ${e.message||String(e)}`}finally{this.setLoading(!1)}}setLoading(e){this.sendBtn.disabled=e,this.input.disabled=e,this.status.textContent=e?t.t(`Thinking…`):``}showResponse(e){let n=i(e);this.pendingResponse=e,this.pendingCode=n.code,this.responseBox.textContent=n.code?n.code:n.text,this.responseBox.style.display=``,this.status.textContent=n.code?t.t(`Code proposal — press Apply to replace your selection.`):t.t(`Plain text answer.`),this.sendBtn.style.display=`none`,this.applyBtn.style.display=n.code?``:`none`,this.openChatBtn.style.display=``}applyProposal(){if(!this.pendingCode){this.hide();return}let e=this.initialRange?{startLine:this.initialRange.startLineNumber,startColumn:this.initialRange.startColumn,endLine:this.initialRange.endLineNumber,endColumn:this.initialRange.endColumn}:null;n(this.editor,this.monaco,e,this.pendingCode,{source:`inline-chat`}),this.hide()}escalateToChat(){this.host.onEscalateToChat&&this.host.onEscalateToChat({question:this.input.value.trim()||t.t(`Show more details`),selectedCode:this.initialSelectedCode,range:this.initialRange}),this.hide()}dispose(){this.hide()}};export{a as InlineChatWidget};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{In as e,f as t}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DuplUOZN.js";import{t as n}from"./applyCodeEdit-D3nb7erO.js";function r(e,t){let n=e===``?[]:e.split(`
|
|
2
2
|
`),r=t===``?[]:t.split(`
|
|
3
|
-
`),i=n.length,a=r.length;if(i===0)return r.map(e=>({op:`insert`,line:e}));if(a===0)return n.map(e=>({op:`delete`,line:e}));let o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=1;e<=i;e++)for(let t=1;t<=a;t++)o[e][t]=n[e-1]===r[t-1]?o[e-1][t-1]+1:Math.max(o[e-1][t],o[e][t-1]);let s=[],c=i,l=a;for(;c>0&&l>0;)n[c-1]===r[l-1]?(s.unshift({op:`equal`,line:n[c-1]}),c--,l--):o[c-1][l]>o[c][l-1]?(s.unshift({op:`delete`,line:n[c-1]}),c--):(s.unshift({op:`insert`,line:r[l-1]}),l--);for(;c>0;)s.unshift({op:`delete`,line:n[--c]});for(;l>0;)s.unshift({op:`insert`,line:r[--l]});return s}function i(e){let t=[],n=0,r=null,i=()=>{r&&=(t.push(r),null)};for(let t of e){if(t.op===`equal`){i(),n++;continue}r||={originalStart:n,deletedCount:0,insertedLines:[]},t.op===`delete`?(r.deletedCount++,n++):r.insertedLines.push(t.line)}return i(),t}var a=`iobroker.aichat.inlineDiff.toolbar`,o=class{constructor(
|
|
3
|
+
`),i=n.length,a=r.length;if(i===0)return r.map(e=>({op:`insert`,line:e}));if(a===0)return n.map(e=>({op:`delete`,line:e}));let o=Array.from({length:i+1},()=>Array(a+1).fill(0));for(let e=1;e<=i;e++)for(let t=1;t<=a;t++)o[e][t]=n[e-1]===r[t-1]?o[e-1][t-1]+1:Math.max(o[e-1][t],o[e][t-1]);let s=[],c=i,l=a;for(;c>0&&l>0;)n[c-1]===r[l-1]?(s.unshift({op:`equal`,line:n[c-1]}),c--,l--):o[c-1][l]>o[c][l-1]?(s.unshift({op:`delete`,line:n[c-1]}),c--):(s.unshift({op:`insert`,line:r[l-1]}),l--);for(;c>0;)s.unshift({op:`delete`,line:n[--c]});for(;l>0;)s.unshift({op:`insert`,line:r[--l]});return s}function i(e){let t=[],n=0,r=null,i=()=>{r&&=(t.push(r),null)};for(let t of e){if(t.op===`equal`){i(),n++;continue}r||={originalStart:n,deletedCount:0,insertedLines:[]},t.op===`delete`?(r.deletedCount++,n++):r.insertedLines.push(t.line)}return i(),t}var a=`iobroker.aichat.inlineDiff.toolbar`,o=class{constructor(t,n,r){e(this,`editor`,void 0),e(this,`monaco`,void 0),e(this,`opts`,void 0),e(this,`decorations`,[]),e(this,`viewZoneIds`,[]),e(this,`toolbarSpacerZoneId`,null),e(this,`toolbarWidget`,null),e(this,`disposed`,!1),this.editor=t,this.monaco=n,this.opts=r}show(){if(this.disposed)return;let{range:e,originalText:t,modifiedText:n}=this.opts,a=i(r(t,n));if(!a.length){var o,s;(o=(s=this.opts).onAccepted)==null||o.call(s);return}if(this.renderDeletions(e,a),this.renderInsertions(e,a),this.renderAcceptWidget(e),this.editor.getModel()){let e=this.editor.onDidChangeModelContent(()=>{if(e.dispose(),!this.disposed){var t,n;this.dispose(),(t=(n=this.opts).onRejected)==null||t.call(n)}})}}renderDeletions(e,t){let n=[],r=e.startLine;for(let e of t){if(e.deletedCount===0)continue;let t=r+e.originalStart,i=t+e.deletedCount-1;n.push({range:new this.monaco.Range(t,1,i,1),options:{isWholeLine:!0,className:`iob-aichat-diff-deleted`,linesDecorationsClassName:`iob-aichat-diff-deleted-gutter`,inlineClassName:`iob-aichat-diff-deleted-inline`}})}this.decorations=this.editor.deltaDecorations([],n)}renderInsertions(e,t){this.editor.changeViewZones(n=>{let r=e.startLine;for(let e of t){if(e.insertedLines.length===0)continue;let t=e.deletedCount>0?r+e.originalStart+e.deletedCount-1:r+e.originalStart-1,i=document.createElement(`div`);i.className=`iob-aichat-diff-inserted`,i.style.cssText=[`background: rgba(46, 160, 67, 0.15)`,`border-left: 3px solid rgb(46, 160, 67)`,`padding: 2px 8px 2px 10px`,`font-family: var(--monaco-monospace-font, monospace)`,`white-space: pre`,`overflow-x: auto`,`font-size: 12px`,`line-height: 18px`].join(`;`);for(let t of e.insertedLines){let e=document.createElement(`div`);e.textContent=t.length?t:`\xA0`,i.appendChild(e)}let a=n.addZone({afterLineNumber:Math.max(0,t),heightInLines:e.insertedLines.length,domNode:i});this.viewZoneIds.push(a)}})}renderAcceptWidget(e){let n=this.monaco,r=this.editor,i=!0;try{let e=r.getDomNode();if(e){let t=getComputedStyle(e).backgroundColor.match(/\d+/g);if(t&&t.length>=3){let[e,n,r]=t.map(e=>parseInt(e,10));i=(.299*e+.587*n+.114*r)/255<.5}}}catch{}let o=i?{bg:`rgba(37, 37, 38, 0.97)`,text:`#cccccc`,labelMuted:`#a0a0a0`,border:`rgba(255, 255, 255, 0.12)`,secondaryBg:`rgba(90, 93, 94, 0.4)`,secondaryHoverBg:`rgba(90, 93, 94, 0.6)`,secondaryText:`#cccccc`,primaryBg:`rgb(14, 99, 156)`,primaryHoverBg:`rgb(17, 119, 187)`,primaryText:`#ffffff`,accent:`rgb(79, 149, 255)`}:{bg:`rgba(243, 243, 243, 0.97)`,text:`#1f1f1f`,labelMuted:`#616161`,border:`rgba(0, 0, 0, 0.12)`,secondaryBg:`rgba(0, 0, 0, 0.04)`,secondaryHoverBg:`rgba(0, 0, 0, 0.08)`,secondaryText:`#1f1f1f`,primaryBg:`rgb(0, 98, 165)`,primaryHoverBg:`rgb(0, 120, 200)`,primaryText:`#ffffff`,accent:`rgb(0, 98, 165)`},s=document.createElement(`div`);s.className=`iob-aichat-diff-toolbar`,s.style.cssText=[`display: flex`,`align-items: center`,`gap: 6px`,`padding: 2px 8px`,`height: 22px`,`box-sizing: border-box`,`font-family: var(--monaco-monospace-font, system-ui)`,`font-size: 11px`,`color: ${o.text}`,`background: ${o.bg}`,`border: 1px solid ${o.border}`,`border-left: 3px solid ${o.accent}`,`border-radius: 3px`,`box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25)`,`pointer-events: auto`,`user-select: none`,`cursor: default`,`white-space: nowrap`].join(`;`);let c=document.createElement(`span`);c.textContent=`🤖 ${t.t(`AI suggestion`)}`,c.style.cssText=`color: ${o.labelMuted}; margin-right: 4px;`,s.appendChild(c);let l=(e,t,n)=>{let r=document.createElement(`button`);r.type=`button`,r.textContent=e;let i=t?o.primaryBg:o.secondaryBg,a=t?o.primaryHoverBg:o.secondaryHoverBg,s=t?o.primaryText:o.secondaryText;return r.style.cssText=[`background: ${i}`,`color: ${s}`,`border: 1px solid ${t?`transparent`:o.border}`,`border-radius: 2px`,`padding: 2px 10px`,`cursor: pointer`,`font-family: inherit`,`font-size: 11px`,`line-height: 16px`,`white-space: nowrap`,`pointer-events: auto`].join(`;`),r.addEventListener(`mouseenter`,()=>{r.style.background=a}),r.addEventListener(`mouseleave`,()=>{r.style.background=i}),r.addEventListener(`click`,e=>{e.stopPropagation(),e.preventDefault(),n(e)}),r.addEventListener(`mousedown`,e=>e.stopPropagation(),!0),r},u=l(`✓ ${t.t(`Apply changes`)}`,!0,()=>this.accept()),d=l(`✗ ${t.t(`Discard changes`)}`,!1,()=>this.reject());s.appendChild(u),s.appendChild(d),s.addEventListener(`mousedown`,e=>e.stopPropagation(),!0),s.addEventListener(`click`,e=>e.stopPropagation());let f=document.createElement(`div`);f.style.cssText=`pointer-events: none;`;let p=Math.max(0,e.startLine-1);this.editor.changeViewZones(e=>{this.toolbarSpacerZoneId=e.addZone({afterLineNumber:p,heightInLines:1,domNode:f})});let m=e.startLine,h={getId(){return a},getDomNode(){return s},getPosition(){return{position:{lineNumber:m,column:1},preference:[n.editor.ContentWidgetPositionPreference.ABOVE,n.editor.ContentWidgetPositionPreference.BELOW]}},allowEditorOverflow:!0};this.toolbarWidget=h,r.addContentWidget(h)}accept(){if(this.disposed)return;let e=n(this.editor,this.monaco,this.opts.range,this.opts.modifiedText,{source:`ai-inline-diff`});if(this.dispose(),e){var t,r;(t=(r=this.opts).onAccepted)==null||t.call(r)}}reject(){var e,t;this.disposed||(this.dispose(),(e=(t=this.opts).onRejected)==null||e.call(t))}dispose(){if(!this.disposed){this.disposed=!0;try{this.editor.deltaDecorations(this.decorations,[])}catch{}try{this.editor.changeViewZones(e=>{for(let t of this.viewZoneIds)e.removeZone(t);this.toolbarSpacerZoneId&&e.removeZone(this.toolbarSpacerZoneId)})}catch{}if(this.toolbarWidget){try{this.editor.removeContentWidget(this.toolbarWidget)}catch{}this.toolbarWidget=null}this.toolbarSpacerZoneId=null,this.decorations=[],this.viewZoneIds=[]}}},s=`
|
|
4
4
|
.iob-aichat-diff-deleted {
|
|
5
5
|
background: rgba(220, 53, 69, 0.15) !important;
|
|
6
6
|
}
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import{o as e,t}from"./rolldown-runtime-C0FnF6B9.js";import{g as n}from"./blockly-C4zJerWL.js";var{JavascriptGenerator:r,Order:i,javascriptGenerator:a}=e(t(((e,t)=>{(function(r,i){typeof e==`object`?t.exports=i(n()):(r.javascript=i(r.Blockly),r.Blockly.JavaScript=r.javascript.javascriptGenerator)})(e,function(e){var t=e.__namespace__,n=function(e,t,n){return t===`FIRST`?`0`:t===`FROM_END`?e+`.length - 1 - `+n:t===`LAST`?e+`.length - 1`:n},r=function(e,t){var n=0,r=``;t.STATEMENT_PREFIX&&(r+=t.injectId(t.STATEMENT_PREFIX,e));do{let i=t.valueToCode(e,`IF`+n,f.NONE)||`false`,a=t.statementToCode(e,`DO`+n);t.STATEMENT_SUFFIX&&(a=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)+a),r+=(n>0?` else `:``)+`if (`+i+`) {
|
|
2
|
+
`+a+`}`,n++}while(e.getInput(`IF`+n));return(e.getInput(`ELSE`)||t.STATEMENT_SUFFIX)&&(n=e.getInput(`ELSE`)?t.statementToCode(e,`ELSE`):``,t.STATEMENT_SUFFIX&&(n=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)+n),r+=` else {
|
|
3
|
+
`+n+`}`),r+`
|
|
4
|
+
`},i=function(e,n){var r=e.getField(`TIMES`)?String(Number(e.getFieldValue(`TIMES`))):n.valueToCode(e,`TIMES`,f.ASSIGNMENT)||`0`,i=n.statementToCode(e,`DO`);i=n.addLoopTrap(i,e),e=``;var a=n.nameDB_.getDistinctName(`count`,t.P.VARIABLE),o=r;return r.match(/^\w+$/)||t.zf(r)||(o=n.nameDB_.getDistinctName(`repeat_end`,t.P.VARIABLE),e+=`var `+o+` = `+r+`;
|
|
5
|
+
`),e+(`for (var `+a+` = 0; `+a+` < `+o+`; `+a+`++) {
|
|
6
|
+
`+i+`}
|
|
7
|
+
`)},a=function(e,t){var n=e.getFieldValue(`OP`);if(n===`NEG`)return e=t.valueToCode(e,`NUM`,f.UNARY_NEGATION)||`0`,e[0]===`-`&&(e=` `+e),[`-`+e,f.UNARY_NEGATION];switch(e=n===`SIN`||n===`COS`||n===`TAN`?t.valueToCode(e,`NUM`,f.DIVISION)||`0`:t.valueToCode(e,`NUM`,f.NONE)||`0`,n){case`ABS`:var r=`Math.abs(`+e+`)`;break;case`ROOT`:r=`Math.sqrt(`+e+`)`;break;case`LN`:r=`Math.log(`+e+`)`;break;case`EXP`:r=`Math.exp(`+e+`)`;break;case`POW10`:r=`Math.pow(10,`+e+`)`;break;case`ROUND`:r=`Math.round(`+e+`)`;break;case`ROUNDUP`:r=`Math.ceil(`+e+`)`;break;case`ROUNDDOWN`:r=`Math.floor(`+e+`)`;break;case`SIN`:r=`Math.sin(`+e+` / 180 * Math.PI)`;break;case`COS`:r=`Math.cos(`+e+` / 180 * Math.PI)`;break;case`TAN`:r=`Math.tan(`+e+` / 180 * Math.PI)`}if(r)return[r,f.FUNCTION_CALL];switch(n){case`LOG10`:r=`Math.log(`+e+`) / Math.log(10)`;break;case`ASIN`:r=`Math.asin(`+e+`) / Math.PI * 180`;break;case`ACOS`:r=`Math.acos(`+e+`) / Math.PI * 180`;break;case`ATAN`:r=`Math.atan(`+e+`) / Math.PI * 180`;break;default:throw Error(`Unknown math operator: `+n)}return[r,f.DIVISION]},o=function(e,t){var n=t.getProcedureName(e.getFieldValue(`NAME`)),r=``;t.STATEMENT_PREFIX&&(r+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(r+=t.injectId(t.STATEMENT_SUFFIX,e)),r&&=t.prefixLines(r,t.INDENT);var i=``;t.INFINITE_LOOP_TRAP&&(i=t.prefixLines(t.injectId(t.INFINITE_LOOP_TRAP,e),t.INDENT));var a=``;e.getInput(`STACK`)&&(a=t.statementToCode(e,`STACK`));var o=``;e.getInput(`RETURN`)&&(o=t.valueToCode(e,`RETURN`,f.NONE)||``);var s=``;a&&o&&(s=r),o&&=t.INDENT+`return `+o+`;
|
|
8
|
+
`;var c=[],l=e.getVarModels();for(let e=0;e<l.length;e++)c[e]=t.getVariableName(l[e].getId());return r=`function `+n+`(`+c.join(`, `)+`) {
|
|
9
|
+
`+r+i+a+s+o+`}`,r=t.scrub_(e,r),t.definitions_[`%`+n]=r,null},s=function(e){return y.test(e)?[e,f.ATOMIC]:[`String(`+e+`)`,f.FUNCTION_CALL]},c=function(e,t,n){return t===`FIRST`?`0`:t===`FROM_END`?e+`.length - 1 - `+n:t===`LAST`?e+`.length - 1`:n},l=function(e,t){return t=`window.prompt(`+(e.getField(`TEXT`)?t.quote_(e.getFieldValue(`TEXT`)):t.valueToCode(e,`TEXT`,f.NONE)||`''`)+`)`,e.getFieldValue(`TYPE`)===`NUMBER`&&(t=`Number(`+t+`)`),[t,f.FUNCTION_CALL]},u=function(e,t){return[t.getVariableName(e.getFieldValue(`VAR`)),f.ATOMIC]},d=function(e,t){var n=t.valueToCode(e,`VALUE`,f.ASSIGNMENT)||`0`;return t.getVariableName(e.getFieldValue(`VAR`))+` = `+n+`;
|
|
10
|
+
`},f,p=f||={};p[p.ATOMIC=0]=`ATOMIC`,p[p.NEW=1.1]=`NEW`,p[p.MEMBER=1.2]=`MEMBER`,p[p.FUNCTION_CALL=2]=`FUNCTION_CALL`,p[p.INCREMENT=3]=`INCREMENT`,p[p.DECREMENT=3]=`DECREMENT`,p[p.BITWISE_NOT=4.1]=`BITWISE_NOT`,p[p.UNARY_PLUS=4.2]=`UNARY_PLUS`,p[p.UNARY_NEGATION=4.3]=`UNARY_NEGATION`,p[p.LOGICAL_NOT=4.4]=`LOGICAL_NOT`,p[p.TYPEOF=4.5]=`TYPEOF`,p[p.VOID=4.6]=`VOID`,p[p.DELETE=4.7]=`DELETE`,p[p.AWAIT=4.8]=`AWAIT`,p[p.EXPONENTIATION=5]=`EXPONENTIATION`,p[p.MULTIPLICATION=5.1]=`MULTIPLICATION`,p[p.DIVISION=5.2]=`DIVISION`,p[p.MODULUS=5.3]=`MODULUS`,p[p.SUBTRACTION=6.1]=`SUBTRACTION`,p[p.ADDITION=6.2]=`ADDITION`,p[p.BITWISE_SHIFT=7]=`BITWISE_SHIFT`,p[p.RELATIONAL=8]=`RELATIONAL`,p[p.IN=8]=`IN`,p[p.INSTANCEOF=8]=`INSTANCEOF`,p[p.EQUALITY=9]=`EQUALITY`,p[p.BITWISE_AND=10]=`BITWISE_AND`,p[p.BITWISE_XOR=11]=`BITWISE_XOR`,p[p.BITWISE_OR=12]=`BITWISE_OR`,p[p.LOGICAL_AND=13]=`LOGICAL_AND`,p[p.LOGICAL_OR=14]=`LOGICAL_OR`,p[p.CONDITIONAL=15]=`CONDITIONAL`,p[p.ASSIGNMENT=16]=`ASSIGNMENT`,p[p.YIELD=17]=`YIELD`,p[p.COMMA=18]=`COMMA`,p[p.NONE=99]=`NONE`;var m=class extends t.dq{constructor(e=`JavaScript`){super(e),this.ORDER_OVERRIDES=[[f.FUNCTION_CALL,f.MEMBER],[f.FUNCTION_CALL,f.FUNCTION_CALL],[f.MEMBER,f.MEMBER],[f.MEMBER,f.FUNCTION_CALL],[f.LOGICAL_NOT,f.LOGICAL_NOT],[f.MULTIPLICATION,f.MULTIPLICATION],[f.ADDITION,f.ADDITION],[f.LOGICAL_AND,f.LOGICAL_AND],[f.LOGICAL_OR,f.LOGICAL_OR]],this.isInitialized=!1;for(let t in f)e=f[t],typeof e!=`string`&&(this[`ORDER_`+t]=e);this.addReservedWords(`break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,in,instanceof,new,return,super,switch,this,throw,try,typeof,var,void,while,with,yield,enum,implements,interface,let,package,private,protected,public,static,await,null,true,false,arguments,`+Object.getOwnPropertyNames(globalThis).join(`,`))}init(e){super.init(e),this.nameDB_?this.nameDB_.reset():this.nameDB_=new t.kj(this.RESERVED_WORDS_),this.nameDB_.setVariableMap(e.getVariableMap()),this.nameDB_.populateVariables(e),this.nameDB_.populateProcedures(e);var n=[],r=t.Cd(e);for(let e=0;e<r.length;e++)n.push(this.nameDB_.getName(r[e],t.P.DEVELOPER_VARIABLE));for(e=t.Bd(e),r=0;r<e.length;r++)n.push(this.nameDB_.getName(e[r].getId(),t.P.VARIABLE));n.length&&(this.definitions_.variables=`var `+n.join(`, `)+`;`),this.isInitialized=!0}finish(e){var t=Object.values(this.definitions_);return super.finish(e),this.isInitialized=!1,this.nameDB_.reset(),t.join(`
|
|
11
|
+
|
|
12
|
+
`)+`
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
`+e}scrubNakedValue(e){return e+`;
|
|
16
|
+
`}quote_(e){return e=e.replace(/\\/g,`\\\\`).replace(/\n/g,`\\
|
|
17
|
+
`).replace(/'/g,`\\'`),`'`+e+`'`}multiline_quote_(e){return e.split(/\n/g).map(this.quote_).join(` + '\\n' +
|
|
18
|
+
`)}scrub_(e,n,r=!1){var i=``;if(!e.outputConnection||!e.outputConnection.targetConnection){var a=e.getCommentText();a&&(a=t.yf(a,this.COMMENT_WRAP-3),i+=this.prefixLines(a+`
|
|
19
|
+
`,`// `));for(let n=0;n<e.inputList.length;n++)e.inputList[n].type===t.je.VALUE&&(a=e.inputList[n].connection.targetBlock())&&(a=this.allNestedComments(a))&&(i+=this.prefixLines(a,`// `))}return e=e.nextConnection&&e.nextConnection.targetBlock(),r=r?``:this.blockToCode(e),i+n+r}getAdjusted(e,n,r=0,i=!1,a=f.NONE){e.workspace.options.oneBasedIndex&&r--;var o=e.workspace.options.oneBasedIndex?`1`:`0`,s=a;return r>0?s=f.ADDITION:r<0?s=f.SUBTRACTION:i&&(s=f.UNARY_NEGATION),e=this.valueToCode(e,n,s)||o,r===0&&!i?e:t.zf(e)?(e=String(Number(e)+r),i&&(e=String(-Number(e))),e):(r>0?e=`${e} + ${r}`:r<0&&(e=`${e} - ${-r}`),i&&(e=r?`-(${e})`:`-${e}`),Math.floor(a)>=Math.floor(s)&&(e=`(${e})`),e)}},h={};h.controls_if=r,h.controls_ifelse=r,h.logic_boolean=function(e){return[e.getFieldValue(`BOOL`)===`TRUE`?`true`:`false`,f.ATOMIC]},h.logic_compare=function(e,t){var n={EQ:`==`,NEQ:`!=`,LT:`<`,LTE:`<=`,GT:`>`,GTE:`>=`}[e.getFieldValue(`OP`)],r=n===`==`||n===`!=`?f.EQUALITY:f.RELATIONAL,i=t.valueToCode(e,`A`,r)||`0`;return e=t.valueToCode(e,`B`,r)||`0`,[i+` `+n+` `+e,r]},h.logic_negate=function(e,t){var n=f.LOGICAL_NOT;return[`!`+(t.valueToCode(e,`BOOL`,n)||`true`),n]},h.logic_null=function(){return[`null`,f.ATOMIC]},h.logic_operation=function(e,t){var n=e.getFieldValue(`OP`)===`AND`?`&&`:`||`,r=n===`&&`?f.LOGICAL_AND:f.LOGICAL_OR,i=t.valueToCode(e,`A`,r);return e=t.valueToCode(e,`B`,r),i||e?(t=n===`&&`?`true`:`false`,i||=t,e||=t):e=i=`false`,[i+` `+n+` `+e,r]},h.logic_ternary=function(e,t){var n=t.valueToCode(e,`IF`,f.CONDITIONAL)||`false`,r=t.valueToCode(e,`THEN`,f.CONDITIONAL)||`null`;return e=t.valueToCode(e,`ELSE`,f.CONDITIONAL)||`null`,[n+` ? `+r+` : `+e,f.CONDITIONAL]};var g={controls_flow_statements:function(e,t){var n=``;if(t.STATEMENT_PREFIX&&(n+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(n+=t.injectId(t.STATEMENT_SUFFIX,e)),t.STATEMENT_PREFIX){let r=e.getSurroundLoop();r&&!r.suppressPrefixSuffix&&(n+=t.injectId(t.STATEMENT_PREFIX,r))}switch(e.getFieldValue(`FLOW`)){case`BREAK`:return n+`break;
|
|
20
|
+
`;case`CONTINUE`:return n+`continue;
|
|
21
|
+
`}throw Error(`Unknown flow statement.`)},controls_for:function(e,n){var r=n.getVariableName(e.getFieldValue(`VAR`)),i=n.valueToCode(e,`FROM`,f.ASSIGNMENT)||`0`,a=n.valueToCode(e,`TO`,f.ASSIGNMENT)||`0`,o=n.valueToCode(e,`BY`,f.ASSIGNMENT)||`1`,s=n.statementToCode(e,`DO`);if(s=n.addLoopTrap(s,e),t.zf(i)&&t.zf(a)&&t.zf(o))n=Number(i)<=Number(a),e=`for (`+r+` = `+i+`; `+r+(n?` <= `:` >= `)+a+`; `+r,r=Math.abs(Number(o)),e=r===1?e+(n?`++`:`--`):e+((n?` += `:` -= `)+r),e+=`) {
|
|
22
|
+
`+s+`}
|
|
23
|
+
`;else{e=``;let c=i;i.match(/^\w+$/)||t.zf(i)||(c=n.nameDB_.getDistinctName(r+`_start`,t.P.VARIABLE),e+=`var `+c+` = `+i+`;
|
|
24
|
+
`),i=a,a.match(/^\w+$/)||t.zf(a)||(i=n.nameDB_.getDistinctName(r+`_end`,t.P.VARIABLE),e+=`var `+i+` = `+a+`;
|
|
25
|
+
`),a=n.nameDB_.getDistinctName(r+`_inc`,t.P.VARIABLE),e+=`var `+a+` = `,e=t.zf(o)?e+(Math.abs(Number(o))+`;
|
|
26
|
+
`):e+(`Math.abs(`+o+`);
|
|
27
|
+
`),e+=`if (`+c+` > `+i+`) {
|
|
28
|
+
`,e+=n.INDENT+a+` = -`+a+`;
|
|
29
|
+
`,e=e+`}
|
|
30
|
+
for (`+(r+` = `+c+`; `+a+` >= 0 ? `+r+` <= `+i+` : `+r+` >= `+i+`; `+r+` += `+a+`) {
|
|
31
|
+
`+s+`}
|
|
32
|
+
`)}return e},controls_forEach:function(e,n){var r=n.getVariableName(e.getFieldValue(`VAR`)),i=n.valueToCode(e,`LIST`,f.ASSIGNMENT)||`[]`,a=n.statementToCode(e,`DO`);a=n.addLoopTrap(a,e),e=``;var o=i;return i.match(/^\w+$/)||(o=n.nameDB_.getDistinctName(r+`_list`,t.P.VARIABLE),e+=`var `+o+` = `+i+`;
|
|
33
|
+
`),i=n.nameDB_.getDistinctName(r+`_index`,t.P.VARIABLE),a=n.INDENT+r+` = `+o+`[`+i+`];
|
|
34
|
+
`+a,e+(`for (var `+i+` in `+o+`) {
|
|
35
|
+
`+a+`}
|
|
36
|
+
`)}};g.controls_repeat=i,g.controls_repeat_ext=i,g.controls_whileUntil=function(e,t){var n=e.getFieldValue(`MODE`)===`UNTIL`,r=t.valueToCode(e,`BOOL`,n?f.LOGICAL_NOT:f.NONE)||`false`,i=t.statementToCode(e,`DO`);return i=t.addLoopTrap(i,e),n&&(r=`!`+r),`while (`+r+`) {
|
|
37
|
+
`+i+`}
|
|
38
|
+
`};var _={math_arithmetic:function(e,t){var n={ADD:[` + `,f.ADDITION],MINUS:[` - `,f.SUBTRACTION],MULTIPLY:[` * `,f.MULTIPLICATION],DIVIDE:[` / `,f.DIVISION],POWER:[null,f.NONE]}[e.getFieldValue(`OP`)],r=n[0];n=n[1];var i=t.valueToCode(e,`A`,n)||`0`;return e=t.valueToCode(e,`B`,n)||`0`,r?[i+r+e,n]:[`Math.pow(`+i+`, `+e+`)`,f.FUNCTION_CALL]},math_atan2:function(e,t){var n=t.valueToCode(e,`X`,f.NONE)||`0`;return[`Math.atan2(`+(t.valueToCode(e,`Y`,f.NONE)||`0`)+`, `+n+`) / Math.PI * 180`,f.DIVISION]},math_change:function(e,t){var n=t.valueToCode(e,`DELTA`,f.ADDITION)||`0`;return e=t.getVariableName(e.getFieldValue(`VAR`)),e+` = (typeof `+e+` === 'number' ? `+e+` : 0) + `+n+`;
|
|
39
|
+
`},math_constant:function(e){return{PI:[`Math.PI`,f.MEMBER],E:[`Math.E`,f.MEMBER],GOLDEN_RATIO:[`(1 + Math.sqrt(5)) / 2`,f.DIVISION],SQRT2:[`Math.SQRT2`,f.MEMBER],SQRT1_2:[`Math.SQRT1_2`,f.MEMBER],INFINITY:[`Infinity`,f.ATOMIC]}[e.getFieldValue(`CONSTANT`)]},math_constrain:function(e,t){var n=t.valueToCode(e,`VALUE`,f.NONE)||`0`,r=t.valueToCode(e,`LOW`,f.NONE)||`0`;return e=t.valueToCode(e,`HIGH`,f.NONE)||`Infinity`,[`Math.min(Math.max(`+n+`, `+r+`), `+e+`)`,f.FUNCTION_CALL]},math_modulo:function(e,t){var n=t.valueToCode(e,`DIVIDEND`,f.MODULUS)||`0`;return e=t.valueToCode(e,`DIVISOR`,f.MODULUS)||`0`,[n+` % `+e,f.MODULUS]},math_number:function(e){return e=Number(e.getFieldValue(`NUM`)),[String(e),e>=0?f.ATOMIC:f.UNARY_NEGATION]},math_number_property:function(e,t){var n={EVEN:[` % 2 === 0`,f.MODULUS,f.EQUALITY],ODD:[` % 2 === 1`,f.MODULUS,f.EQUALITY],WHOLE:[` % 1 === 0`,f.MODULUS,f.EQUALITY],POSITIVE:[` > 0`,f.RELATIONAL,f.RELATIONAL],NEGATIVE:[` < 0`,f.RELATIONAL,f.RELATIONAL],DIVISIBLE_BY:[null,f.MODULUS,f.EQUALITY],PRIME:[null,f.NONE,f.FUNCTION_CALL]},r=e.getFieldValue(`PROPERTY`),[i,a,o]=n[r];return n=t.valueToCode(e,`NUMBER_TO_CHECK`,a)||`0`,r===`PRIME`?e=t.provideFunction_(`mathIsPrime`,`
|
|
40
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
41
|
+
// https://en.wikipedia.org/wiki/Primality_test#Naive_methods
|
|
42
|
+
if (n == 2 || n == 3) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
// False if n is NaN, negative, is 1, or not whole.
|
|
46
|
+
// And false if n is divisible by 2 or 3.
|
|
47
|
+
if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
// Check all the numbers of form 6k +/- 1, up to sqrt(n).
|
|
51
|
+
for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) {
|
|
52
|
+
if (n % (x - 1) === 0 || n % (x + 1) === 0) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
`)+`(`+n+`)`:r===`DIVISIBLE_BY`?(e=t.valueToCode(e,`DIVISOR`,f.MODULUS)||`0`,e=n+` % `+e+` === 0`):e=n+i,[e,o]},math_on_list:function(e,t){var n=e.getFieldValue(`OP`);switch(n){case`SUM`:e=t.valueToCode(e,`LIST`,f.MEMBER)||`[]`,e+=`.reduce(function(x, y) {return x + y;}, 0)`;break;case`MIN`:e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=`Math.min.apply(null, `+e+`)`;break;case`MAX`:e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=`Math.max.apply(null, `+e+`)`;break;case`AVERAGE`:n=t.provideFunction_(`mathMean`,`
|
|
59
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
60
|
+
return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length;
|
|
61
|
+
}
|
|
62
|
+
`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`MEDIAN`:n=t.provideFunction_(`mathMedian`,`
|
|
63
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
64
|
+
var localList = myList.filter(function (x) {return typeof x === 'number';});
|
|
65
|
+
if (!localList.length) return null;
|
|
66
|
+
localList.sort(function(a, b) {return b - a;});
|
|
67
|
+
if (localList.length % 2 === 0) {
|
|
68
|
+
return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2;
|
|
69
|
+
} else {
|
|
70
|
+
return localList[(localList.length - 1) / 2];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`MODE`:n=t.provideFunction_(`mathModes`,`
|
|
74
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(values) {
|
|
75
|
+
var modes = [];
|
|
76
|
+
var counts = [];
|
|
77
|
+
var maxCount = 0;
|
|
78
|
+
for (var i = 0; i < values.length; i++) {
|
|
79
|
+
var value = values[i];
|
|
80
|
+
var found = false;
|
|
81
|
+
var thisCount;
|
|
82
|
+
for (var j = 0; j < counts.length; j++) {
|
|
83
|
+
if (counts[j][0] === value) {
|
|
84
|
+
thisCount = ++counts[j][1];
|
|
85
|
+
found = true;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (!found) {
|
|
90
|
+
counts.push([value, 1]);
|
|
91
|
+
thisCount = 1;
|
|
92
|
+
}
|
|
93
|
+
maxCount = Math.max(thisCount, maxCount);
|
|
94
|
+
}
|
|
95
|
+
for (var j = 0; j < counts.length; j++) {
|
|
96
|
+
if (counts[j][1] === maxCount) {
|
|
97
|
+
modes.push(counts[j][0]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return modes;
|
|
101
|
+
}
|
|
102
|
+
`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`STD_DEV`:n=t.provideFunction_(`mathStandardDeviation`,`
|
|
103
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
|
|
104
|
+
var n = numbers.length;
|
|
105
|
+
if (!n) return null;
|
|
106
|
+
var mean = numbers.reduce(function(x, y) {return x + y;}) / n;
|
|
107
|
+
var variance = 0;
|
|
108
|
+
for (var j = 0; j < n; j++) {
|
|
109
|
+
variance += Math.pow(numbers[j] - mean, 2);
|
|
110
|
+
}
|
|
111
|
+
variance /= n;
|
|
112
|
+
return Math.sqrt(variance);
|
|
113
|
+
}
|
|
114
|
+
`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;case`RANDOM`:n=t.provideFunction_(`mathRandomList`,`
|
|
115
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
|
116
|
+
var x = Math.floor(Math.random() * list.length);
|
|
117
|
+
return list[x];
|
|
118
|
+
}
|
|
119
|
+
`),e=t.valueToCode(e,`LIST`,f.NONE)||`[]`,e=n+`(`+e+`)`;break;default:throw Error(`Unknown operator: `+n)}return[e,f.FUNCTION_CALL]},math_random_float:function(){return[`Math.random()`,f.FUNCTION_CALL]},math_random_int:function(e,t){var n=t.valueToCode(e,`FROM`,f.NONE)||`0`;return e=t.valueToCode(e,`TO`,f.NONE)||`0`,[t.provideFunction_(`mathRandomInt`,`
|
|
120
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
|
121
|
+
if (a > b) {
|
|
122
|
+
// Swap a and b to ensure a is smaller.
|
|
123
|
+
var c = a;
|
|
124
|
+
a = b;
|
|
125
|
+
b = c;
|
|
126
|
+
}
|
|
127
|
+
return Math.floor(Math.random() * (b - a + 1) + a);
|
|
128
|
+
}
|
|
129
|
+
`)+`(`+n+`, `+e+`)`,f.FUNCTION_CALL]}};_.math_round=a,_.math_single=a,_.math_trig=a;var v={procedures_callnoreturn:function(e,t){return t.forBlock.procedures_callreturn(e,t)[0]+`;
|
|
130
|
+
`},procedures_callreturn:function(e,t){var n=t.getProcedureName(e.getFieldValue(`NAME`)),r=[],i=e.getVarModels();for(let n=0;n<i.length;n++)r[n]=t.valueToCode(e,`ARG`+n,f.NONE)||`null`;return[n+`(`+r.join(`, `)+`)`,f.FUNCTION_CALL]}};v.procedures_defnoreturn=o,v.procedures_defreturn=o,v.procedures_ifreturn=function(e,t){var n=`if (`+(t.valueToCode(e,`CONDITION`,f.NONE)||`false`)+`) {
|
|
131
|
+
`;return t.STATEMENT_SUFFIX&&(n+=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)),e.hasReturnValue_?(e=t.valueToCode(e,`VALUE`,f.NONE)||`null`,n+=t.INDENT+`return `+e+`;
|
|
132
|
+
`):n+=t.INDENT+`return;
|
|
133
|
+
`,n+`}
|
|
134
|
+
`};var y=/^\s*'([^']|\\')*'\s*$/,b={text:function(e,t){return[t.quote_(e.getFieldValue(`TEXT`)),f.ATOMIC]},text_append:function(e,t){var n=t.getVariableName(e.getFieldValue(`VAR`));return e=t.valueToCode(e,`TEXT`,f.NONE)||`''`,n+` += `+s(e)[0]+`;
|
|
135
|
+
`},text_changeCase:function(e,t){var n={UPPERCASE:`.toUpperCase()`,LOWERCASE:`.toLowerCase()`,TITLECASE:null}[e.getFieldValue(`CASE`)];return e=t.valueToCode(e,`TEXT`,n?f.MEMBER:f.NONE)||`''`,[n?e+n:t.provideFunction_(`textToTitleCase`,`
|
|
136
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
|
137
|
+
return str.replace(/\\S+/g,
|
|
138
|
+
function(txt) {return txt[0].toUpperCase() + txt.substring(1).toLowerCase();});
|
|
139
|
+
}
|
|
140
|
+
`)+`(`+e+`)`,f.FUNCTION_CALL]},text_charAt:function(e,t){var n=e.getFieldValue(`WHERE`)||`FROM_START`,r=t.valueToCode(e,`VALUE`,n===`RANDOM`?f.NONE:f.MEMBER)||`''`;switch(n){case`FIRST`:return[r+`.charAt(0)`,f.FUNCTION_CALL];case`LAST`:return[r+`.slice(-1)`,f.FUNCTION_CALL];case`FROM_START`:return e=t.getAdjusted(e,`AT`),[r+`.charAt(`+e+`)`,f.FUNCTION_CALL];case`FROM_END`:return e=t.getAdjusted(e,`AT`,1,!0),[r+`.slice(`+e+`).charAt(0)`,f.FUNCTION_CALL];case`RANDOM`:return[t.provideFunction_(`textRandomLetter`,`
|
|
141
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(text) {
|
|
142
|
+
var x = Math.floor(Math.random() * text.length);
|
|
143
|
+
return text[x];
|
|
144
|
+
}
|
|
145
|
+
`)+`(`+r+`)`,f.FUNCTION_CALL]}throw Error(`Unhandled option (text_charAt).`)},text_count:function(e,t){var n=t.valueToCode(e,`TEXT`,f.NONE)||`''`;return e=t.valueToCode(e,`SUB`,f.NONE)||`''`,[t.provideFunction_(`textCount`,`
|
|
146
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
|
147
|
+
if (needle.length === 0) {
|
|
148
|
+
return haystack.length + 1;
|
|
149
|
+
} else {
|
|
150
|
+
return haystack.split(needle).length - 1;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`)+`(`+n+`, `+e+`)`,f.FUNCTION_CALL]},text_getSubstring:function(e,t){var n={FIRST:`First`,LAST:`Last`,FROM_START:`FromStart`,FROM_END:`FromEnd`},r=e.getFieldValue(`WHERE1`),i=e.getFieldValue(`WHERE2`),a=r!==`FROM_END`&&r!==`LAST`&&i!==`FROM_END`&&i!==`LAST`,o=t.valueToCode(e,`STRING`,a?f.MEMBER:f.NONE)||`''`;if(r===`FIRST`&&i===`LAST`)return[o,f.NONE];if(o.match(/^'?\w+'?$/)||a){switch(r){case`FROM_START`:n=t.getAdjusted(e,`AT1`);break;case`FROM_END`:n=t.getAdjusted(e,`AT1`,1,!1,f.SUBTRACTION),n=o+`.length - `+n;break;case`FIRST`:n=`0`;break;default:throw Error(`Unhandled option (text_getSubstring).`)}switch(i){case`FROM_START`:t=t.getAdjusted(e,`AT2`,1);break;case`FROM_END`:t=t.getAdjusted(e,`AT2`,0,!1,f.SUBTRACTION),t=o+`.length - `+t;break;case`LAST`:t=o+`.length`;break;default:throw Error(`Unhandled option (text_getSubstring).`)}o=o+`.slice(`+n+`, `+t+`)`}else a=t.getAdjusted(e,`AT1`),e=t.getAdjusted(e,`AT2`),o=t.provideFunction_(`subsequence`+n[r]+n[i],`
|
|
154
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(sequence${r===`FROM_END`||r===`FROM_START`?`, at1`:``}${i===`FROM_END`||i===`FROM_START`?`, at2`:``}) {
|
|
155
|
+
var start = ${c(`sequence`,r,`at1`)};
|
|
156
|
+
var end = ${c(`sequence`,i,`at2`)} + 1;
|
|
157
|
+
return sequence.slice(start, end);
|
|
158
|
+
}
|
|
159
|
+
`)+`(`+o+(r===`FROM_END`||r===`FROM_START`?`, `+a:``)+(i===`FROM_END`||i===`FROM_START`?`, `+e:``)+`)`;return[o,f.FUNCTION_CALL]},text_indexOf:function(e,t){var n=e.getFieldValue(`END`)===`FIRST`?`indexOf`:`lastIndexOf`,r=t.valueToCode(e,`FIND`,f.NONE)||`''`;return t=(t.valueToCode(e,`VALUE`,f.MEMBER)||`''`)+`.`+n+`(`+r+`)`,e.workspace.options.oneBasedIndex?[t+` + 1`,f.ADDITION]:[t,f.FUNCTION_CALL]},text_isEmpty:function(e,t){return[`!`+(t.valueToCode(e,`VALUE`,f.MEMBER)||`''`)+`.length`,f.LOGICAL_NOT]},text_join:function(e,t){switch(e.itemCount_){case 0:return[`''`,f.ATOMIC];case 1:return e=t.valueToCode(e,`ADD0`,f.NONE)||`''`,s(e);case 2:var n=t.valueToCode(e,`ADD0`,f.NONE)||`''`;return e=t.valueToCode(e,`ADD1`,f.NONE)||`''`,[s(n)[0]+` + `+s(e)[0],f.ADDITION];default:n=Array(e.itemCount_);for(let r=0;r<e.itemCount_;r++)n[r]=t.valueToCode(e,`ADD`+r,f.NONE)||`''`;return[`[`+n.join(`,`)+`].join('')`,f.FUNCTION_CALL]}},text_length:function(e,t){return[(t.valueToCode(e,`VALUE`,f.MEMBER)||`''`)+`.length`,f.MEMBER]},text_print:function(e,t){return`window.alert(`+(t.valueToCode(e,`TEXT`,f.NONE)||`''`)+`);
|
|
160
|
+
`}};b.text_prompt=l,b.text_prompt_ext=l,b.text_replace=function(e,t){var n=t.valueToCode(e,`TEXT`,f.NONE)||`''`,r=t.valueToCode(e,`FROM`,f.NONE)||`''`;return e=t.valueToCode(e,`TO`,f.NONE)||`''`,[t.provideFunction_(`textReplace`,`
|
|
161
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
162
|
+
needle = needle.replace(/([-()\\[\\]{}+?*.$\\^|,:#<!\\\\])/g, '\\\\$1')
|
|
163
|
+
.replace(/\\x08/g, '\\\\x08');
|
|
164
|
+
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
|
165
|
+
}
|
|
166
|
+
`)+`(`+n+`, `+r+`, `+e+`)`,f.FUNCTION_CALL]},b.text_reverse=function(e,t){return[(t.valueToCode(e,`TEXT`,f.MEMBER)||`''`)+`.split('').reverse().join('')`,f.FUNCTION_CALL]},b.text_trim=function(e,t){var n={LEFT:`.replace(/^[\\s\\xa0]+/, '')`,RIGHT:`.replace(/[\\s\\xa0]+$/, '')`,BOTH:`.trim()`}[e.getFieldValue(`MODE`)];return[(t.valueToCode(e,`TEXT`,f.MEMBER)||`''`)+n,f.FUNCTION_CALL]};var x={};x.variables_get=u,x.variables_set=d;var S={};S.variables_get_dynamic=u,S.variables_set_dynamic=d;var C=new m,w=Object.assign({},{lists_create_empty:function(){return[`[]`,f.ATOMIC]},lists_create_with:function(e,t){var n=Array(e.itemCount_);for(let r=0;r<e.itemCount_;r++)n[r]=t.valueToCode(e,`ADD`+r,f.NONE)||`null`;return[`[`+n.join(`, `)+`]`,f.ATOMIC]},lists_getIndex:function(e,t){var n=e.getFieldValue(`MODE`)||`GET`,r=e.getFieldValue(`WHERE`)||`FROM_START`,i=t.valueToCode(e,`VALUE`,r===`RANDOM`?f.NONE:f.MEMBER)||`[]`;switch(r){case`FIRST`:if(n===`GET`)return[i+`[0]`,f.MEMBER];if(n===`GET_REMOVE`)return[i+`.shift()`,f.MEMBER];if(n===`REMOVE`)return i+`.shift();
|
|
167
|
+
`;break;case`LAST`:if(n===`GET`)return[i+`.slice(-1)[0]`,f.MEMBER];if(n===`GET_REMOVE`)return[i+`.pop()`,f.MEMBER];if(n===`REMOVE`)return i+`.pop();
|
|
168
|
+
`;break;case`FROM_START`:if(e=t.getAdjusted(e,`AT`),n===`GET`)return[i+`[`+e+`]`,f.MEMBER];if(n===`GET_REMOVE`)return[i+`.splice(`+e+`, 1)[0]`,f.FUNCTION_CALL];if(n===`REMOVE`)return i+`.splice(`+e+`, 1);
|
|
169
|
+
`;break;case`FROM_END`:if(e=t.getAdjusted(e,`AT`,1,!0),n===`GET`)return[i+`.slice(`+e+`)[0]`,f.FUNCTION_CALL];if(n===`GET_REMOVE`)return[i+`.splice(`+e+`, 1)[0]`,f.FUNCTION_CALL];if(n===`REMOVE`)return i+`.splice(`+e+`, 1);`;break;case`RANDOM`:if(i=t.provideFunction_(`listsGetRandomItem`,`
|
|
170
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(list, remove) {
|
|
171
|
+
var x = Math.floor(Math.random() * list.length);
|
|
172
|
+
if (remove) {
|
|
173
|
+
return list.splice(x, 1)[0];
|
|
174
|
+
} else {
|
|
175
|
+
return list[x];
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
`)+`(`+i+`, `+(n!==`GET`)+`)`,n===`GET`||n===`GET_REMOVE`)return[i,f.FUNCTION_CALL];if(n===`REMOVE`)return i+`;
|
|
179
|
+
`}throw Error(`Unhandled combination (lists_getIndex).`)},lists_getSublist:function(e,t){var r={FIRST:`First`,LAST:`Last`,FROM_START:`FromStart`,FROM_END:`FromEnd`},i=t.valueToCode(e,`LIST`,f.MEMBER)||`[]`,a=e.getFieldValue(`WHERE1`),o=e.getFieldValue(`WHERE2`);if(a===`FIRST`&&o===`LAST`)i+=`.slice(0)`;else if(i.match(/^\w+$/)||a!==`FROM_END`&&o===`FROM_START`){switch(a){case`FROM_START`:r=t.getAdjusted(e,`AT1`);break;case`FROM_END`:r=t.getAdjusted(e,`AT1`,1,!1,f.SUBTRACTION),r=i+`.length - `+r;break;case`FIRST`:r=`0`;break;default:throw Error(`Unhandled option (lists_getSublist).`)}switch(o){case`FROM_START`:t=t.getAdjusted(e,`AT2`,1);break;case`FROM_END`:t=t.getAdjusted(e,`AT2`,0,!1,f.SUBTRACTION),t=i+`.length - `+t;break;case`LAST`:t=i+`.length`;break;default:throw Error(`Unhandled option (lists_getSublist).`)}i=i+`.slice(`+r+`, `+t+`)`}else{let s=t.getAdjusted(e,`AT1`);e=t.getAdjusted(e,`AT2`),i=t.provideFunction_(`subsequence`+r[a]+r[o],`
|
|
180
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(sequence${a===`FROM_END`||a===`FROM_START`?`, at1`:``}${o===`FROM_END`||o===`FROM_START`?`, at2`:``}) {
|
|
181
|
+
var start = ${n(`sequence`,a,`at1`)};
|
|
182
|
+
var end = ${n(`sequence`,o,`at2`)} + 1;
|
|
183
|
+
return sequence.slice(start, end);
|
|
184
|
+
}
|
|
185
|
+
`)+`(`+i+(a===`FROM_END`||a===`FROM_START`?`, `+s:``)+(o===`FROM_END`||o===`FROM_START`?`, `+e:``)+`)`}return[i,f.FUNCTION_CALL]},lists_indexOf:function(e,t){var n=e.getFieldValue(`END`)===`FIRST`?`indexOf`:`lastIndexOf`,r=t.valueToCode(e,`FIND`,f.NONE)||`''`;return t=(t.valueToCode(e,`VALUE`,f.MEMBER)||`[]`)+`.`+n+`(`+r+`)`,e.workspace.options.oneBasedIndex?[t+` + 1`,f.ADDITION]:[t,f.FUNCTION_CALL]},lists_isEmpty:function(e,t){return[`!`+(t.valueToCode(e,`VALUE`,f.MEMBER)||`[]`)+`.length`,f.LOGICAL_NOT]},lists_length:function(e,t){return[(t.valueToCode(e,`VALUE`,f.MEMBER)||`[]`)+`.length`,f.MEMBER]},lists_repeat:function(e,t){var n=t.provideFunction_(`listsRepeat`,`
|
|
186
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(value, n) {
|
|
187
|
+
var array = [];
|
|
188
|
+
for (var i = 0; i < n; i++) {
|
|
189
|
+
array[i] = value;
|
|
190
|
+
}
|
|
191
|
+
return array;
|
|
192
|
+
}
|
|
193
|
+
`),r=t.valueToCode(e,`ITEM`,f.NONE)||`null`;return e=t.valueToCode(e,`NUM`,f.NONE)||`0`,[n+`(`+r+`, `+e+`)`,f.FUNCTION_CALL]},lists_reverse:function(e,t){return[(t.valueToCode(e,`LIST`,f.FUNCTION_CALL)||`[]`)+`.slice().reverse()`,f.FUNCTION_CALL]},lists_setIndex:function(e,n){function r(){if(i.match(/^\w+$/))return``;var e=n.nameDB_.getDistinctName(`tmpList`,t.P.VARIABLE),r=`var `+e+` = `+i+`;
|
|
194
|
+
`;return i=e,r}var i=n.valueToCode(e,`LIST`,f.MEMBER)||`[]`,a=e.getFieldValue(`MODE`)||`GET`,o=e.getFieldValue(`WHERE`)||`FROM_START`,s=n.valueToCode(e,`TO`,f.ASSIGNMENT)||`null`;switch(o){case`FIRST`:if(a===`SET`)return i+`[0] = `+s+`;
|
|
195
|
+
`;if(a===`INSERT`)return i+`.unshift(`+s+`);
|
|
196
|
+
`;break;case`LAST`:if(a===`SET`)return r()+(i+`[`+i+`.length - 1] = `+s+`;
|
|
197
|
+
`);if(a===`INSERT`)return i+`.push(`+s+`);
|
|
198
|
+
`;break;case`FROM_START`:if(e=n.getAdjusted(e,`AT`),a===`SET`)return i+`[`+e+`] = `+s+`;
|
|
199
|
+
`;if(a===`INSERT`)return i+`.splice(`+e+`, 0, `+s+`);
|
|
200
|
+
`;break;case`FROM_END`:if(e=n.getAdjusted(e,`AT`,1,!1,f.SUBTRACTION),o=r(),a===`SET`)return o+(i+`[`+i+`.length - `+e+`] = `+s+`;
|
|
201
|
+
`);if(a===`INSERT`)return o+(i+`.splice(`+i+`.length - `+e+`, 0, `+s+`);
|
|
202
|
+
`);break;case`RANDOM`:if(e=r(),o=n.nameDB_.getDistinctName(`tmpX`,t.P.VARIABLE),e+=`var `+o+` = Math.floor(Math.random() * `+i+`.length);
|
|
203
|
+
`,a===`SET`)return e+(i+`[`+o+`] = `+s+`;
|
|
204
|
+
`);if(a===`INSERT`)return e+(i+`.splice(`+o+`, 0, `+s+`);
|
|
205
|
+
`)}throw Error(`Unhandled combination (lists_setIndex).`)},lists_sort:function(e,t){var n=t.valueToCode(e,`LIST`,f.FUNCTION_CALL)||`[]`,r=e.getFieldValue(`DIRECTION`)===`1`?1:-1;return e=e.getFieldValue(`TYPE`),t=t.provideFunction_(`listsGetSortCompare`,`
|
|
206
|
+
function ${t.FUNCTION_NAME_PLACEHOLDER_}(type, direction) {
|
|
207
|
+
var compareFuncs = {
|
|
208
|
+
'NUMERIC': function(a, b) {
|
|
209
|
+
return Number(a) - Number(b); },
|
|
210
|
+
'TEXT': function(a, b) {
|
|
211
|
+
return String(a) > String(b) ? 1 : -1; },
|
|
212
|
+
'IGNORE_CASE': function(a, b) {
|
|
213
|
+
return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; },
|
|
214
|
+
};
|
|
215
|
+
var compare = compareFuncs[type];
|
|
216
|
+
return function(a, b) { return compare(a, b) * direction; };
|
|
217
|
+
}
|
|
218
|
+
`),[n+`.slice().sort(`+t+`("`+e+`", `+r+`))`,f.FUNCTION_CALL]},lists_split:function(e,t){var n=t.valueToCode(e,`INPUT`,f.MEMBER);if(t=t.valueToCode(e,`DELIM`,f.NONE)||`''`,e=e.getFieldValue(`MODE`),e===`SPLIT`)n||=`''`,e=`split`;else if(e===`JOIN`)n||=`[]`,e=`join`;else throw Error(`Unknown mode: `+e);return[n+`.`+e+`(`+t+`)`,f.FUNCTION_CALL]}},h,g,_,v,b,x,S);for(let e in w)C.forBlock[e]=w[e];var T={};return T.JavascriptGenerator=m,T.Order=f,T.javascriptGenerator=C,t.__chunk_javascript=T,t.__chunk_javascript.__namespace__=t,t.__chunk_javascript})}))(),1).default;export{a as n,i as t};
|
|
@@ -26,11 +26,15 @@ const __mfImport = (src) =>
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
(async () => {
|
|
29
|
-
const __mfHostInit = await __mfImport("./hostInit-
|
|
29
|
+
const __mfHostInit = await __mfImport("./hostInit-DBlZi_Kt.js");
|
|
30
30
|
await __mfHostInit.__tla;
|
|
31
31
|
const { initHost } = __mfHostInit;
|
|
32
32
|
await initHost();
|
|
33
33
|
if (__mfModuleCache.pendingShareLoads) {
|
|
34
34
|
await Promise.all(__mfModuleCache.pendingShareLoads);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
const __mfReactServerModuleCache = globalThis["__mf_module_cache_react_server__"];
|
|
37
|
+
if (__mfReactServerModuleCache?.pendingShareLoads) {
|
|
38
|
+
await Promise.all(__mfReactServerModuleCache.pendingShareLoads);
|
|
39
|
+
}
|
|
40
|
+
})().then(() => __mfImport("./index-BvPVHv3P.js"));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-C0FnF6B9.js";import{
|
|
1
|
+
import{t as e}from"./rolldown-runtime-C0FnF6B9.js";import{Cr as t,Jn as n,_r as r,cr as i,nr as a,pr as o,qn as s,rr as c,tr as l,vr as u}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DuplUOZN.js";var d=e((e=>{var t=60103,n=60106,r=60107,i=60108,a=60114,o=60109,s=60110,c=60112,l=60113,u=60120,d=60115,f=60116;if(typeof Symbol==`function`&&Symbol.for){var p=Symbol.for;t=p(`react.element`),n=p(`react.portal`),r=p(`react.fragment`),i=p(`react.strict_mode`),a=p(`react.profiler`),o=p(`react.provider`),s=p(`react.context`),c=p(`react.forward_ref`),l=p(`react.suspense`),u=p(`react.suspense_list`),d=p(`react.memo`),f=p(`react.lazy`),p(`react.block`),p(`react.server.block`),p(`react.fundamental`),p(`react.debug_trace_mode`),p(`react.legacy_hidden`)}function m(e){if(typeof e==`object`&&e){var p=e.$$typeof;switch(p){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:case o:return e;default:return p}}case n:return p}}}e.isFragment=function(e){return m(e)===r}})),f=e(((e,t)=>{t.exports=d()}));t();var p=f();function m(e,t){let n=getComputedStyle(t);if(!n)return;let r=e===S.Horizontal?t.clientWidth:t.clientHeight;return r===0?void 0:(e===S.Horizontal?r-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight):r-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),r)}function h(e,t,n=[],r={condition:!0}){let{condition:i}=r,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(r,[`condition`]);o((()=>(i&&window.addEventListener(e,t,a),()=>{i&&window.removeEventListener(e,t)})),[e,t,i,...n])}(function(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}})(`/* === Main Container === */
|
|
2
2
|
.__dbk__container {
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -87,4 +87,4 @@ import{t as e}from"./rolldown-runtime-C0FnF6B9.js";import{Hn as t,Qn as n,Un as
|
|
|
87
87
|
.__dbk__dragger.Dark {
|
|
88
88
|
background: #434252;
|
|
89
89
|
}
|
|
90
|
-
/* ====== */`);var g=
|
|
90
|
+
/* ====== */`);var g=l.forwardRef((({className:e,theme:t,draggerClassName:n,direction:r=S.Vertical,onDragging:i},a)=>{let o=`__dbk__gutter ${r} ${e||t}`,c=`__dbk__dragger ${r} ${n||t}`;return s(`div`,Object.assign({className:o,ref:a,dir:r,onMouseDown:i,onTouchStart:w?i:void 0},{children:s(`div`,{className:c},void 0)}),void 0)})),_;function v(e,t,n){let r,i;return t?(r=e/2,i=e):n?(r=e,i=e/2):(r=e,i=e),{aGutterSize:r,bGutterSize:i}}function y(e,t){switch(t.type){case _.SetIsReadyToCompute:return Object.assign(Object.assign({},e),{isReady:t.payload.isReady});case _.CreatePairs:{let{direction:n,children:r,gutters:i}=t.payload,a=r[0].parentNode;if(!a)throw Error(`Cannot create pairs - parent is undefined.`);let o=m(n,a);if(o===void 0)throw Error(`Cannot create pairs - parent has undefined or zero size: ${o}.`);let s=[];return r.forEach(((e,t)=>{if(t>0){let e=r[t-1],o=r[t],c=i[t-1],l=n===S.Horizontal?e.getBoundingClientRect().left:e.getBoundingClientRect().top,u=n===S.Horizontal?o.getBoundingClientRect().right:o.getBoundingClientRect().bottom,d=n===S.Horizontal?e.getBoundingClientRect().width+c.getBoundingClientRect().width+o.getBoundingClientRect().width:e.getBoundingClientRect().height+c.getBoundingClientRect().height+o.getBoundingClientRect().height,f=n===S.Horizontal?c.getBoundingClientRect().width:c.getBoundingClientRect().height,p={idx:t-1,a:e,b:o,gutter:c,parent:a,start:l,end:u,size:d,gutterSize:f,aSizePct:100/r.length,bSizePct:100/r.length};s.push(p)}})),Object.assign(Object.assign({},e),{pairs:s})}case _.StartDragging:{let{gutterIdx:n}=t.payload;return Object.assign(Object.assign({},e),{isDragging:!0,draggingIdx:n})}case _.StopDragging:return Object.assign(Object.assign({},e),{isDragging:!1});case _.CalculateSizes:{let{direction:n,gutterIdx:r}=t.payload,i=e.pairs[r],a=m(n,i.parent);if(!a)throw Error(`Cannot calculate sizes - 'pair.parent' has undefined or zero size.`);let o=i.gutter[n===S.Horizontal?`clientWidth`:`clientHeight`],{aGutterSize:s,bGutterSize:c}=v(o,r===0,r===e.pairs.length-1),l,u,d,f,p;return n===S.Horizontal?(l=i.a.getBoundingClientRect().left,u=i.b.getBoundingClientRect().right,f=(i.a.getBoundingClientRect().width+s)/a*100,p=(i.b.getBoundingClientRect().width+c)/a*100,d=i.a.getBoundingClientRect().width+s+c+i.b.getBoundingClientRect().width):(l=i.a.getBoundingClientRect().top,u=i.b.getBoundingClientRect().bottom,f=(i.a.getBoundingClientRect().height+s)/a*100,p=(i.b.getBoundingClientRect().height+c)/a*100,d=i.a.getBoundingClientRect().height+s+c+i.b.getBoundingClientRect().height),e.pairs[r]=Object.assign(Object.assign({},i),{start:l,end:u,size:d,aSizePct:f,bSizePct:p,gutterSize:o}),Object.assign({},e)}default:return e}}function b(e,t=0,n=[]){return a.toArray(e).reduce(((e,r,a)=>((0,p.isFragment)(r)?e.push.apply(e,b(r.props.children,t+1,n.concat(r.key||a))):i(r)?e.push(c(r,{key:n.concat(String(r.key)).join(`.`)})):typeof r!=`string`&&typeof r!=`number`||e.push(r),e)),[])}(function(e){e[e.SetIsReadyToCompute=0]=`SetIsReadyToCompute`,e[e.CreatePairs=1]=`CreatePairs`,e[e.CalculateSizes=2]=`CalculateSizes`,e[e.StartDragging=3]=`StartDragging`,e[e.StopDragging=4]=`StopDragging`})(_||={});var x=e=>`changedTouches`in e,S,C;(function(e){e.Horizontal=`Horizontal`,e.Vertical=`Vertical`})(S||={}),function(e){e.Light=`Light`,e.Dark=`Dark`}(C||={});var w=typeof window<`u`&&`ontouchstart`in window;function T(e){return e===S.Horizontal?`col-resize`:`row-resize`}var E={isReady:!1,isDragging:!1,pairs:[]};function D({direction:e=S.Horizontal,minWidths:t=[],minHeights:i=[],initialSizes:a,gutterTheme:c=C.Dark,gutterClassName:d,draggerClassName:f,children:p,onResizeStarted:D,onResizeFinished:O,classes:k=[]}){let A=b(p),[j,M]=r(y,E),N=u(null),P=u([]),F=u([]);P.current=[],F.current=[];let I=l.useCallback((e=>{M({type:_.SetIsReadyToCompute,payload:{isReady:e}})}),[]),L=l.useCallback(((e,t)=>{M({type:_.StartDragging,payload:{gutterIdx:t}});let n=j.pairs[t];D==null||D(n.idx),n.a.style.userSelect=`none`,n.b.style.userSelect=`none`,n.gutter.style.cursor=T(e),n.parent.style.cursor=T(e),document.body.style.cursor=T(e)}),[j.pairs]),R=l.useCallback((()=>{M({type:_.StopDragging});let t=[];for(let n=0;n<j.pairs.length;n++){let r=j.pairs[n],i=m(e,r.parent);if(i===void 0)throw Error(`Cannot call the 'onResizeFinished' callback - parentSize is undefined`);if(r.gutterSize===void 0)throw Error(`Cannot call 'onResizeFinished' callback - gutterSize is undefined`);let a=n===0,o=n===j.pairs.length-1,s=r.a.getBoundingClientRect()[e===S.Horizontal?`width`:`height`],{aGutterSize:c,bGutterSize:l}=v(r.gutterSize,a,o),u=(s+c)/i*100;if(t.push(u),o){let n=(r.b.getBoundingClientRect()[e===S.Horizontal?`width`:`height`]+l)/i*100;t.push(n)}}if(j.draggingIdx===void 0)throw Error(`Could not reset cursor and user-select because 'state.draggingIdx' is undefined`);let n=j.pairs[j.draggingIdx];O==null||O(n.idx,t),n.a.style.userSelect=``,n.b.style.userSelect=``,n.gutter.style.cursor=``,n.parent.style.cursor=``,document.body.style.cursor=``}),[j.draggingIdx,j.pairs,e]),z=l.useCallback(((e,t)=>{M({type:_.CalculateSizes,payload:{direction:e,gutterIdx:t}})}),[]),B=l.useCallback(((e,t,n)=>{M({type:_.CreatePairs,payload:{direction:e,children:t,gutters:n}})}),[]),V=l.useCallback(((e,t,n,r)=>{let i=t[0].parentNode;if(!i)throw Error(`Cannot set initial sizes - parent is undefined`);if(m(e,i)===void 0)throw Error(`Cannot set initial sizes - parent has undefined size`);t.forEach(((i,a)=>{let o=a===0,s=a===t.length-1,c,l=0;t.length>1&&(l=n[s?a-1:a].getBoundingClientRect()[e===S.Horizontal?`width`:`height`],l=o||s?l/2:l),c=r&&a<r.length?`calc(${r[a]}% - ${l}px)`:`calc(${100/t.length}% - ${l}px)`,e===S.Horizontal?(i.style.width=c,i.style.height=`100%`):(i.style.height=c,i.style.width=`100%`)}))}),[]),H=l.useCallback(((e,t)=>{if(j.draggingIdx===void 0)throw Error(`Cannot adjust size - 'draggingIdx' is undefined`);let n=j.pairs[j.draggingIdx];if(n.size===void 0)throw Error(`Cannot adjust size - 'pair.size' is undefined`);if(n.gutterSize===void 0)throw Error(`Cannot adjust size - 'pair.gutterSize' is undefined`);let r=n.aSizePct+n.bSizePct,i=t/n.size*r,a=r-t/n.size*r,o=j.draggingIdx===0,s=j.draggingIdx===j.pairs.length-1,{aGutterSize:c,bGutterSize:l}=v(n.gutterSize,o,s),u=`calc(${i}% - ${c}px)`,d=`calc(${a}% - ${l}px)`;e===S.Horizontal?(n.a.style.width=u,n.b.style.width=d):(n.a.style.height=u,n.b.style.height=d)}),[j.draggingIdx,j.pairs,e]),U=l.useCallback(((e,t,n)=>{if(!j.isDragging)return;if(j.draggingIdx===void 0)throw Error(`Cannot drag - 'draggingIdx' is undefined`);let r=j.pairs[j.draggingIdx];if(r.start===void 0)throw Error(`Cannot drag - 'pair.start' is undefined`);if(r.size===void 0)throw Error(`Cannot drag - 'pair.size' is undefined`);if(r.gutterSize===void 0)throw Error(`Cannot drag - 'pair.gutterSize' is undefined`);let i=function(e,t){let n=x(t)?t.changedTouches[0]:t;return e===S.Horizontal?n.clientX:n.clientY}(t,e)-r.start,a=16,o=16;n.length>j.draggingIdx&&(a=n[j.draggingIdx]),n.length>=j.draggingIdx+1&&(o=n[j.draggingIdx+1]),i<r.gutterSize+a&&(i=r.gutterSize+a),i>=r.size-(r.gutterSize+o)&&(i=r.size-(r.gutterSize+o)),H(t,i)}),[j.isDragging,j.draggingIdx,j.pairs,H]),W=()=>{if(j.isDragging){if(j.draggingIdx===void 0)throw Error(`Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined`);z(e,j.draggingIdx),R()}},G=n=>{j.isDragging&&(x(n)&&n.preventDefault(),U(n,e,e===S.Horizontal?t:i))};function K(e,t){if(!e.current)throw Error(`Can't add element to ref object - ref isn't initialized`);t&&!e.current.includes(t)&&e.current.push(t)}return h(`mouseup`,W,[j.isDragging,R]),h(`mousemove`,G,[e,j.isDragging,U,t,i]),h(`touchend`,W,[j.isDragging,R],{condition:w}),h(`touchmove`,G,[e,j.isDragging,U,t,i],{condition:w,passive:!w}),o((function(){if(!N.current)return;let t=N.current.parentElement;if(!t)return;let n=new ResizeObserver((()=>{let n=getComputedStyle(t),r=e===S.Horizontal?t.clientWidth:t.clientHeight;I(!!n&&!!r)}));return n.observe(t),()=>{n.disconnect()}}),[N.current,e]),o((function(){if(j.isReady&&(!P.current||P.current[0].offsetParent)){if(!P.current||!F.current)throw Error(`Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined`);A.length<=1?V(e,P.current,F.current,a):(V(e,P.current,F.current,a),B(e,P.current,F.current))}}),[p,j.isReady,e,V,B,a]),s(`div`,Object.assign({className:`__dbk__container ${e}`,ref:N},{children:j.isReady&&A.map(((t,r)=>n(l.Fragment,{children:[s(`div`,Object.assign({ref:e=>K(P,e),className:`__dbk__child-wrapper `+(r<k.length?k[r]:``)},{children:t}),void 0),r<A.length-1&&s(g,{ref:e=>K(F,e),className:d,theme:c,draggerClassName:f,direction:e,onDragging:()=>{z(e,t=r),L(e,t);return;var t}},void 0)]},r)))}),void 0)}export{S as n,D as t};
|