x-block-lib 0.11.2 → 0.11.3
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/dist/{i18n-en.l65xil3y.js → i18n-en.fzzizejc.js} +1 -1
- package/dist/{i18n-zhHans.fm8rc300.js → i18n-zhHans.b0wqxx8d.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/{rolldown-runtime.bt10cbti.js → rolldown-runtime.81faoggt.js} +1 -1
- package/dist/vendor.bsmu4xkh.js +2154 -0
- package/package.json +2 -2
- package/dist/vendor.d4yexy6y.js +0 -1103
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime.
|
|
1
|
+
import{n as e}from"./rolldown-runtime.81faoggt.js";var t=e({default:()=>n}),n={"x-block-lib":{bind:`Bind`,dlg:{source:{title:`Source`}},funcEntry:`Func Entry`,implementMethod:`Implement Method`,msg:{cannotOperateInLockedState:`Cannot operate in locked state`},navigator:`Navigator`,noOption:`No Option`,procedure:`Procedure`,temporaryBlock:`Temporary Block`,tip:{hotkeyCtrlE:`Press 'Ctrl W' to navigate`,hotkeyCtrlQ:`Press 'Ctrl Q' to clean workspace`,hotkeyCtrlW:`Press 'Ctrl R' to toggle lock state`},watchEffect:`Watch Effect`}};export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime.
|
|
1
|
+
import{n as e}from"./rolldown-runtime.81faoggt.js";var t=e({default:()=>n}),n={"x-block-lib":{bind:`绑定`,dlg:{source:{title:`源代码`}},funcEntry:`函数入口`,implementMethod:`实现方法`,msg:{cannotOperateInLockedState:`锁定状态下不能操作`},navigator:`导航器`,noOption:`没有选项`,procedure:`子程序`,temporaryBlock:`临时块`,tip:{hotkeyCtrlE:`按「Ctrl E」导航`,hotkeyCtrlQ:`按「Ctrl Q」清理工作区`,hotkeyCtrlW:`按「Ctrl W」切换锁状态`},watchEffect:`观察效应`}};export{t};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as ee,M as te,N as d,O as f,P as ne,Q as p,R as re,S as m,T as h,U as ie,V as ae,W as oe,X as se,Y as ce,Z as le,_ as g,a as ue,b as de,c as fe,d as pe,f as me,g as _,h as he,i as ge,j as _e,k as ve,l as ye,m as be,n as xe,o as Se,p as v,q as Ce,r as we,s as Te,t as Ee,u as De,v as y,w as b,x,y as Oe,z as ke}from"./vendor.
|
|
1
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,J as l,K as u,L as ee,M as te,N as d,O as f,P as ne,Q as p,R as re,S as m,T as h,U as ie,V as ae,W as oe,X as se,Y as ce,Z as le,_ as g,a as ue,b as de,c as fe,d as pe,f as me,g as _,h as he,i as ge,j as _e,k as ve,l as ye,m as be,n as xe,o as Se,p as v,q as Ce,r as we,s as Te,t as Ee,u as De,v as y,w as b,x,y as Oe,z as ke}from"./vendor.bsmu4xkh.js";import{eventBus as Ae,globalObjects as je,messageWarning as Me,openConfirmDlg as Ne,openPromptDlg as Pe,useColor as Fe,useSystem as Ie,useViewStack as Le}from"x-essential-lib";import{globalState as S}from"x-state-lib";import{addIndent as Re,finalProperties as C,getElement as w,getImplementMethodName as ze,getItems as Be,getTag as Ve,getTypes as He,makeEventId as T,makeEventKeyOfCustomSlot as Ue,makeEventKeyOfElementSlot as We,makeMethodId as Ge,makeMethodKeyOfCustomSlot as Ke,makeMethodKeyOfElementSlot as qe,makePropertyId as Je,makePropertyKeyOfCustomSlot as Ye,makePropertyKeyOfElementSlot as Xe,makeTriggerId as Ze,parseNumberUnit as Qe,pkgs as $e,themeColors as et,toEventName as tt,toMethodName as nt,toPropertyName as rt,unwrapEventId as it,unwrapEventKeyOfCustomSlot as at,unwrapEventKeyOfElementSlot as ot,unwrapMethodId as st,unwrapMethodKeyOfCustomSlot as ct,unwrapMethodKeyOfElementSlot as lt,unwrapPropertyId as ut,unwrapPropertyKeyOfCustomSlot as dt,unwrapPropertyKeyOfElementSlot as ft,unwrapSlotId as pt}from"x-runtime-lib";import{Fragment as mt,computed as E,createBlock as D,createCommentVNode as ht,createElementBlock as O,createElementVNode as k,createVNode as A,defineComponent as gt,inject as _t,isRef as vt,mergeModels as yt,mergeProps as bt,nextTick as xt,normalizeStyle as j,onBeforeUnmount as St,onMounted as Ct,onUnmounted as wt,openBlock as M,provide as Tt,ref as Et,renderList as Dt,renderSlot as Ot,resolveComponent as N,resolveDirective as kt,toDisplayString as At,unref as P,useId as jt,useModel as Mt,useTemplateRef as Nt,watch as Pt,withCtx as Ft,withDirectives as It,withKeys as Lt,withModifiers as Rt}from"vue";import{useI18n as zt}from"vue-i18n";import{useDisplay as Bt}from"vuetify";async function Vt(e){if(e===`en`)ce((await import(`./en.md0q5xx8.js`)).default);else if(e===`zhHans`)ce((await import(`./zhHans.ei0ea10m.js`)).default);else throw Error(`invalid locale=${e}`)}function F(e){return ve[e]??e}function Ht(e){let t=`<block type="text_v1"><field name="TEXT">${e}</field></block>`;return p.xml.textToDom(t)}function Ut(e){let t=`<block type="math_number_v1"><field name="NUM">${e}</field></block>`;return p.xml.textToDom(t)}function Wt(e){let t=`<block type="logic_boolean_v1"><field name="BOOL">${e?`TRUE`:`FALSE`}</field></block>`;return p.xml.textToDom(t)}function Gt(e,t){let n=null;return t===`string`?n=Ht(``):t===`integer`||t===`decimal`?n=Ut(0):t===`boolean`?n=Wt(!1):t===`enum`||t===`dateTime`?n=Ht(``):console.assert(!1,`type not implementd`),n?re.domToBlock(n,e):null}const Kt=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==`,qt=`data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K`;function Jt(e){let t=e.lastIndexOf(`V`);if(t<=0||t>=e.length-1)throw Error(`must has V`);return`${pe(e.substring(0,t))}_${`v`+e.substring(t+1)}`}function Yt(e){let t=e.lastIndexOf(`V`);if(t<=0||t>=e.length-1)return console.assert(!1,`invalid key=${e}`),``;let n=e.substring(0,t-1);return`${n[0].toUpperCase()}${n.substring(1)}`}function I(e){return e.length<=0&&e.push([F(`NO_OPTION`),``]),e}function Xt(e){let t=0;for(;e;)t++,e=e.getParent();return t}function Zt(e){return e.ui===`text`?`string`:e.ui===`number`?`number`:e.ui===`switch`?`boolean`:`string`}function Qt(e,t){return!!(e.startsWith(`basic.`)||!t.ui||t.readonly)}function L(e){return e.startsWith(`globality_v`)}function $t(e){return e.startsWith(`ref_v`)}function en(e){return e.startsWith(`multiple_ref_v`)}function R(e){return e.startsWith(`slot_v`)}function z(e){return e.startsWith(`multiple_slot_v`)}function tn(e,t,n){let{kind:r,mainKey:i,slotKey:a}=pt(e);return!(r!==`elementSlot`&&r!==`multipleElementSlot`||t!==i||n!==a)}function nn(e,t,n){let{kind:r,mainKey:i,slotKey:a}=pt(e);return!(r!==`customSlot`&&r!==`multipleCustomSlot`||t!==i||n!==a)}function B(e){return e===`string`?`String`:e===`number`?`Number`:e===`boolean`?`Boolean`:e===`array`?`Array`:e===`object`?`Object`:(e===`any`||console.assert(!1),null)}function rn(e){return e.array?`Array`:e.ui===`transient`?B(e.type):e.ui===`dummy`?null:e.ui===`text`?`String`:e.ui===`number`?`Number`:e.ui===`switch`?`Boolean`:e.ui===`select`?Yt(e.items):e.ui===`multiTypes`?Yt(e.types):e.ui===`comp`?`Comp`:e.ui===`slot`?`Slot`:e.ui===`adaptSlot`?`AdaptSlot`:(console.assert(!1),null)}function an(e){return e===`string`?`String`:e===`integer`||e===`decimal`?`Number`:e===`boolean`?`Boolean`:e===`enum`||e===`dateTime`?`String`:(console.assert(!1),null)}const on=`#F44336.#FFEBEE.#FFCDD2.#EF9A9A.#E57373.#EF5350.#E53935.#D32F2F.#C62828.#B71C1C.#FF8A80.#FF5252.#FF1744.#D50000.#e91e63.#fce4ec.#f8bbd0.#f48fb1.#f06292.#ec407a.#d81b60.#c2185b.#ad1457.#880e4f.#ff80ab.#ff4081.#f50057.#c51162.#9c27b0.#f3e5f5.#e1bee7.#ce93d8.#ba68c8.#ab47bc.#8e24aa.#7b1fa2.#6a1b9a.#4a148c.#ea80fc.#e040fb.#d500f9.#aa00ff.#673ab7.#ede7f6.#d1c4e9.#b39ddb.#9575cd.#7e57c2.#5e35b1.#512da8.#4527a0.#311b92.#b388ff.#7c4dff.#651fff.#6200ea.#3f51b5.#e8eaf6.#c5cae9.#9fa8da.#7986cb.#5c6bc0.#3949ab.#303f9f.#283593.#1a237e.#8c9eff.#536dfe.#3d5afe.#304ffe.#2196F3.#E3F2FD.#BBDEFB.#90CAF9.#64B5F6.#42A5F5.#1E88E5.#1976D2.#1565C0.#0D47A1.#82B1FF.#448AFF.#2979FF.#2962FF.#03a9f4.#e1f5fe.#b3e5fc.#81d4fa.#4fc3f7.#29b6f6.#039be5.#0288d1.#0277bd.#01579b.#80d8ff.#40c4ff.#00b0ff.#0091ea.#00bcd4.#e0f7fa.#b2ebf2.#80deea.#4dd0e1.#26c6da.#00acc1.#0097a7.#00838f.#006064.#84ffff.#18ffff.#00e5ff.#00b8d4.#009688.#e0f2f1.#b2dfdb.#80cbc4.#4db6ac.#26a69a.#00897b.#00796b.#00695c.#004d40.#a7ffeb.#64ffda.#1de9b6.#00bfa5.#4CAF50.#E8F5E9.#C8E6C9.#A5D6A7.#81C784.#66BB6A.#43A047.#388E3C.#2E7D32.#1B5E20.#B9F6CA.#69F0AE.#00E676.#00C853.#8bc34a.#f1f8e9.#dcedc8.#c5e1a5.#aed581.#9ccc65.#7cb342.#689f38.#558b2f.#33691e.#ccff90.#b2ff59.#76ff03.#64dd17.#cddc39.#f9fbe7.#f0f4c3.#e6ee9c.#dce775.#d4e157.#c0ca33.#afb42b.#9e9d24.#827717.#f4ff81.#eeff41.#c6ff00.#aeea00.#ffeb3b.#fffde7.#fff9c4.#fff59d.#fff176.#ffee58.#fdd835.#fbc02d.#f9a825.#f57f17.#ffff8d.#ffff00.#ffea00.#ffd600.#ffc107.#fff8e1.#ffecb3.#ffe082.#ffd54f.#ffca28.#ffb300.#ffa000.#ff8f00.#ff6f00.#ffe57f.#ffd740.#ffc400.#ffab00.#ff9800.#fff3e0.#ffe0b2.#ffcc80.#ffb74d.#ffa726.#fb8c00.#f57c00.#ef6c00.#e65100.#ffd180.#ffab40.#ff9100.#ff6d00.#ff5722.#fbe9e7.#ffccbc.#ffab91.#ff8a65.#ff7043.#f4511e.#e64a19.#d84315.#bf360c.#ff9e80.#ff6e40.#ff3d00.#dd2c00.#795548.#efebe9.#d7ccc8.#bcaaa4.#a1887f.#8d6e63.#6d4c41.#5d4037.#4e342e.#3e2723.#.#.#.#.#607d8b.#eceff1.#cfd8dc.#b0bec5.#90a4ae.#78909c.#546e7a.#455a64.#37474f.#263238.#.#.#.#.#9e9e9e.#fafafa.#f5f5f5.#eeeeee.#e0e0e0.#bdbdbd.#757575.#616161.#424242.#212121.#.#.#.#.#000000.#FFFFFF.#FFFFFF00`.split(`.`),sn=[`add_data_v`,`call_app_method_v`,`call_func_v`,`call_func_internal_v`,`delete_data_v`,`func_entry_v`,`implement_app_method_v`,`open_confirm_dlg_v`,`open_prompt_dlg_v`,`on_app_event_v`,`procedure_def_v`,`transaction_v`,`query_data_v`,`update_data_v`];function cn(e){return!!sn.find(t=>e.startsWith(t))}const ln=p.xml;y.parameter_v1={init:function(){this.key=``,this.name=``,this.locale=!1,this.appendDummyInput().appendField(``,`LABEL`),this.setOutput(!0),this.setColour(220)},mutationToDom:function(){let e=ln.createElement(`mutation`);return e.setAttribute(`key`,this.key),e.setAttribute(`name`,this.name),e.setAttribute(`locale`,this.locale?`TRUE`:`FALSE`),e},domToMutation:function(e){this.key=e.getAttribute(`key`)??``,this.name=e.getAttribute(`name`)??``,this.locale=e.getAttribute(`locale`)===`TRUE`,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},saveExtraState:function(){return{key:this.key,name:this.name,locale:this.locale}},loadExtraState:function(e){this.key=e.key??``,this.name=e.name??``,this.locale=e.locale??!1,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},setKeyName:function(e,t,n){this.key=e,this.name=t,this.locale=n,this.updateShape_(),setTimeout(()=>{this.checkWarning_()},0)},onchange:function(e){if(e.type===x.BLOCK_MOVE){let t=e;if(t.blockId!==this.id)return;this.tryDuplicate_(t)}setTimeout(()=>{this.checkWarning_()},0)},tryDuplicate_:function(e){let t=this.workspace.getBlockById(e.oldParentId);if(t&&cn(t.type))try{x.disable();let n=t.getInput(e.oldInputName)?.connection;if(n){let e=un(this.workspace,this.key,this.name,this.locale);n.connect(e.outputConnection)}}finally{x.enable()}},updateShape_:function(){if(this.locale){let{i18n:e}=je;this.setFieldValue(e.global.t(this.name),`LABEL`)}else this.setFieldValue(this.name,`LABEL`)},checkWarning_:function(){let e=this.getSurroundParent();for(;e;){if(cn(e.type))for(let t of e.inputList){let e=t.connection?.targetBlock();if(!e||e.type!==`parameter_v1`)continue;let n=e;if(n.key===this.key){n.name!==this.name&&(this.name=n.name),n.locale!==this.locale&&(this.locale=n.locale),this.setWarningText(null);return}}e=e.getSurroundParent()}this.setWarningText(F(`WARN_PARAMETER_NOT_FOUND`))}},g.forBlock.parameter_v1=function(e){return[e.key,_.ATOMIC]};function un(e,t,n,r){let i=`
|
|
2
2
|
<block type="parameter_v1">
|
|
3
3
|
<mutation key="${t}" name="${n}" locale="${r?`TRUE`:`FALSE`}"/>
|
|
4
4
|
</block>
|
|
@@ -374,4 +374,4 @@ function ${g.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
|
374
374
|
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
|
375
375
|
}
|
|
376
376
|
`)}(${t}, ${n}, ${r})`,_.FUNCTION_CALL]},t([{type:`text_reverse_v1`,message0:`%{BKY_TEXT_V1_REVERSE_TITLE}`,args0:[{type:`input_value`,name:`TEXT`,check:`String`}],inputsInline:!0,output:`String`,style:`text_blocks`,tooltip:`%{BKY_TEXT_V1_REVERSE_TOOLTIP}`,helpUrl:`%{BKY_TEXT_V1_REVERSE_HELPURL}`}]),g.forBlock.text_reverse_v1=function(e){return[(g.valueToCode(e,`TEXT`,_.MEMBER)||`''`)+`.split('').reverse().join('')`,_.FUNCTION_CALL]},t([{type:`text_split_v1`,message0:`%{BKY_TEXT_V1_SPLIT_TITLE}`,args0:[{type:`input_value`,name:`TEXT`,check:`String`},{type:`input_value`,name:`DELIM`,check:`String`}],inputsInline:!0,output:`Array`,style:`text_blocks`,tooltip:`%{BKY_TEXT_V1_SPLIT_TOOLTIP}`,helpUrl:`%{BKY_TEXT_V1_SPLIT_HELPURL}`}]),g.forBlock.text_split_v1=function(e){return[`${g.valueToCode(e,`TEXT`,_.MEMBER)||`''`}.split(${g.valueToCode(e,`DELIM`,_.NONE)||`''`})`,_.FUNCTION_CALL]},t([{type:`text_substring_v1`,message0:`%{BKY_TEXT_V1_SUBSTRING_TITLE}`,args0:[{type:`input_value`,name:`TEXT`,check:`String`},{type:`input_value`,name:`START`,check:`Number`},{type:`input_value`,name:`END`,check:`Number`}],inputsInline:!0,output:`String`,style:`text_blocks`,tooltip:`%{BKY_TEXT_V1_SUBSTRING_TOOLTIP}`,helpUrl:`%{BKY_TEXT_V1_SUBSTRING_HELPURL}`}]),g.forBlock.text_substring_v1=function(e){return[`${g.valueToCode(e,`TEXT`,_.MEMBER)||`''`}.slice(${g.getAdjusted(e,`START`)}, ${g.getAdjusted(e,`END`,1)})`,_.FUNCTION_CALL]},t([{type:`text_trim_v1`,message0:`%{BKY_TEXT_V1_TRIM_TITLE}`,args0:[{type:`field_dropdown`,name:`MODE`,options:[[`%{BKY_TEXT_TRIM_OPERATOR_BOTH}`,`BOTH`],[`%{BKY_TEXT_TRIM_OPERATOR_LEFT}`,`LEFT`],[`%{BKY_TEXT_TRIM_OPERATOR_RIGHT}`,`RIGHT`]]},{type:`input_value`,name:`TEXT`,check:`String`}],output:`String`,style:`text_blocks`,tooltip:`%{BKY_TEXT_V1_TRIM_TOOLTIP}`,helpUrl:`%{BKY_TEXT_V1_TRIM_HELPURL}`}]),g.forBlock.text_trim_v1=function(e){return[`__trimV1__(${g.valueToCode(e,`TEXT`,_.NONE)||`''`}, ${{BOTH:0,LEFT:1,RIGHT:2}[e.getFieldValue(`MODE`)]})`,_.ATOMIC]},y.create_timer_v1={init:function(){this.appendDummyInput().appendField(`%{BKY_TIME_V1_CREATE_TIMER_TITLE}`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setStyle(`time_blocks`),this.setTooltip(`%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}`),this.setHelpUrl(`%{BKY_TIME_V1_CREATE_TIMER_HELPURL}`)},saveExtraState:function(){return{}},loadExtraState:function(){this.updateShape_(),this.updateShadow_()},updateShape_:function(){this.getInput(`CALLBACK`)||this.appendStatementInput(`CALLBACK`).appendField(`%{BKY_TIME_DO}`),this.getInput(`IMMEDIATE`)||(this.appendValueInput(`IMMEDIATE`).setCheck(`Boolean`).setAlign(u.Align.RIGHT).appendField(`%{BKY_TIME_IMMEDIATE}`),this.moveInputBefore(`IMMEDIATE`,`CALLBACK`)),this.getInput(`COUNT`)||(this.appendValueInput(`COUNT`).setCheck(`Number`).setAlign(u.Align.RIGHT).appendField(`%{BKY_TIME_COUNT}`),this.moveInputBefore(`COUNT`,`IMMEDIATE`)),this.getInput(`LOOP`)||(this.appendValueInput(`LOOP`).setCheck(`Boolean`).setAlign(u.Align.RIGHT).appendField(`%{BKY_TIME_LOOP}`),this.moveInputBefore(`LOOP`,`COUNT`)),this.getInput(`INTERVAL`)||(this.appendValueInput(`INTERVAL`).setCheck(`Number`).setAlign(u.Align.RIGHT).appendField(`%{BKY_TIME_INTERVAL_MS}`),this.moveInputBefore(`INTERVAL`,`LOOP`))},updateShadow_:function(){if(this.isInsertionMarker())return;let e=fn(1e3);this.getInput(`INTERVAL`)?.setShadowDom(e);let t=pn(!1);this.getInput(`LOOP`)?.setShadowDom(t);let n=fn(1);this.getInput(`COUNT`)?.setShadowDom(n);let r=pn(!1);this.getInput(`IMMEDIATE`)?.setShadowDom(r)}},g.forBlock.create_timer_v1=function(e){return`__createTimerV1__(${g.valueToCode(e,`INTERVAL`,_.ATOMIC)||`1000`}, ${g.valueToCode(e,`LOOP`,_.ATOMIC)||`false`}, ${g.valueToCode(e,`COUNT`,_.ATOMIC)||`1`}, ${g.valueToCode(e,`IMMEDIATE`,_.ATOMIC)||`false`}, async function() {
|
|
377
|
-
${g.statementToCode(e,`CALLBACK`)}});\n`},t([{type:`delay_v1`,message0:`%{BKY_TIME_V1_DELAY_TITLE}`,args0:[{type:`input_value`,name:`DURATION`,check:`Number`}],previousStatement:null,nextStatement:null,style:`time_blocks`,tooltip:`%{BKY_TIME_V1_DELAY_TOOLTIP}`,helpUrl:`%{BKY_TIME_V1_DELAY_HELPURL}`}]),g.forBlock.delay_v1=function(e){return`await __delayV1__(${g.valueToCode(e,`DURATION`,_.ATOMIC)||`0`});\n`};const di={customContextMenu:function(e){if(!this.isInFlyout){let t,n;this.type===`variable_get_v1`?(t=`variable_set_v1`,n=F(`VARIABLE_GET_CREATE_SET`)):this.type===`variable_set_v1`?(t=`variable_get_v1`,n=F(`VARIABLE_SET_CREATE_GET`)):console.assert(!1);let r=this.getField(`VAR`),i={type:t,fields:{VAR:r.saveState(!0)}};e.push({enabled:this.workspace.remainingCapacity()>0,text:n.replace(`%1`,r.getText()),callback:Oe.callbackFactory(this,i)})}else if(this.type===`variable_get_v1`){let t={text:F(`RENAME_VARIABLE`),enabled:!0,callback:fi(this)},n=this.getField(`VAR`).getText(),r={text:F(`DELETE_VARIABLE`).replace(`%1`,n),enabled:!0,callback:pi(this)};e.unshift(t),e.unshift(r)}}},fi=function(e){return function(){let t=e.workspace,n=e.getField(`VAR`).getVariable();c.renameVariable(t,n)}},pi=function(e){return function(){let t=e.getField(`VAR`).getVariable();t&&c.deleteVariable(t.getWorkspace(),t,e)}};m.registerMixin(`context_menu_variable_v1`,di),t([{type:`variable_get_v1`,message0:`%1`,args0:[{type:`field_variable`,name:`VAR`}],output:null,style:`variable_blocks`,tooltip:`%{BKY_VARIABLE_V1_GET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLE_V1_GET_HELPURL}`,extensions:[`context_menu_variable_v1`]}]),g.forBlock.variable_get_v1=function(t){return[g.nameDB_.getName(t.getFieldValue(`VAR`),e.NameType.VARIABLE),_.ATOMIC]},t([{type:`variable_set_v1`,message0:`%{BKY_VARIABLE_V1_SET_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:``},{type:`input_value`,name:`VALUE`}],previousStatement:null,nextStatement:null,style:`variable_blocks`,tooltip:`%{BKY_VARIABLE_V1_SET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLE_V1_SET_HELPURL}`,extensions:[`context_menu_variable_v1`]}]),g.forBlock.variable_set_v1=function(t){return`${g.nameDB_.getName(t.getFieldValue(`VAR`),e.NameType.VARIABLE)} = ${g.valueToCode(t,`VALUE`,_.ASSIGNMENT)||`0`};\n`},ae.setConfirm(async(e,t)=>{t(!!await Ne({title:``,text:e}))}),ae.setPrompt(async(e,t,n)=>{let r=await Pe({title:``,value:t});r!==void 0&&n(String(r))});const mi=b.prototype;mi.doClassValidation_=function(e){return e};const hi=mi.doValueUpdate_;mi.doValueUpdate_=function(e){hi.call(this,e),this.selectedOption&&this.selectedOption[1]!==e&&(this.selectedOption=null)};const gi=mi.getText_;mi.getText_=function(){if(this.selectedOption)return gi.call(this);let{i18n:e}=je,t=this.getSourceBlock();if(this.name===`APP`)return t.app.name;if(this.name===`PAGE`)return t.page.name;if(this.name===`ELEMENT`)return t.element.name;if(this.name===`NODE`){let n=w(t.node.key);if(n)return`${e.global.t(n.name)} / ${t.node.alias}`}else if(this.name===`PROPERTY`){let{kind:e,names:n}=t.property;return rt(e,n)}else if(this.name===`EVENT`){let{kind:e,names:n}=t.event;return tt(e,n)}else if(this.name===`METHOD`){let{kind:e,names:n}=t.method;return nt(e,n)}else if(this.name===`SPACE`)return t.space.name;else if(this.name===`FUNC`)return t.func.name;else if(this.name===`OUTPUT`)return t.output.name;else if(this.name===`TABLE`)return t.table.name;else if(this.name===`COLUMN`)return t.column.name;else if(this.name===`DIR`)return t.dir.name;else if(this.name===`RESOURCE`)return t.resource.name;return`<n/a>`},ee.prototype.cleanUp=function(){this.setResizesEnabled(!1);let e=x.getGroup();e||x.setGroup(!0);let t=this.getTopBlocks(!0),n=t.filter(e=>e.isMovable()),r=t.filter(e=>!e.isMovable()).map(e=>e.getBoundingRectangle()),i=function(e){for(let t of r)if(e.intersects(t))return t;return null},a=0;for(let e of n){let t=e.getBoundingRectangle();e.moveBy(-t.left,a-t.top,[`cleanup`]),e.snapToGrid(),t=e.getBoundingRectangle();let n=i(t);for(;n!=null;)a=n.top+n.getHeight()+60,e.moveBy(0,a-t.top,[`cleanup`]),e.snapToGrid(),t=e.getBoundingRectangle(),n=i(t);a=e.getRelativeToSurfaceXY().y+e.getHeightWidth().height+60}x.setGroup(e),this.setResizesEnabled(!0)};var _i=Te();function vi(e){let t=e.getParent();return t&&vi(t)?!0:!t&&!!(e.outputConnection||e.previousConnection)}var yi=class{init(){let e=de.registry.getItem(`blockDisable`);e&&(e.preconditionFn=function(e){let t=e.block;return t&&!t.isInFlyout&&t.workspace.options.disable&&t.isEditable()?t.getInheritedDisabled()||vi(t)?`disabled`:`enabled`:`hidden`})}};(0,En.registerFieldColour)(),d.registry.unregister(te.names.ESCAPE),new _i.CrossTabCopyPaste().init({contextMenu:!0,shortcut:!0}),new yi().init();function bi(e){"@babel/helpers - typeof";return bi=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bi(e)}function xi(e,t){if(bi(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(bi(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Si(e){var t=xi(e,`string`);return bi(t)==`symbol`?t:t+``}function Ci(e,t,n){return(t=Si(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wi=class extends x.Abstract{constructor(e){super(),Ci(this,`isBlank`,!0),Ci(this,`recordUndo`,!1),Ci(this,`type`,`state_change`),this.workspaceId=e.id}};Ce.register(Ce.Type.EVENT,`state_change`,wi);function Ti(e){let t=s();if(!t)return;let n=t.getBlockById(e);if(!n)return;let r=n.getRootBlock();if(!r)return;let i=r.getRelativeToSurfaceXY(),a=i.x*t.scale,o=i.y*t.scale;t.scroll(-a,-o)}function Ei(){let e=s();if(!e)return;let t=e.getTopBlocks(!0)?.[0];t&&Ti(t.id)}a.Classic.blockStyles={color_blocks:{colourPrimary:`#a5745b`,colourSecondary:`#ede3de`,colourTertiary:`#845d49`,hat:``},event_blocks:{colourPrimary:`#a5a55b`,colourSecondary:`#ededde`,colourTertiary:`#848449`,hat:``},list_blocks:{colourPrimary:`#745ba5`,colourSecondary:`#e3deed`,colourTertiary:`#5d4984`,hat:``},logic_blocks:{colourPrimary:`#5b80a5`,colourSecondary:`#dee6ed`,colourTertiary:`#496684`,hat:``},loop_blocks:{colourPrimary:`#5ba55b`,colourSecondary:`#deedde`,colourTertiary:`#498449`,hat:``},math_blocks:{colourPrimary:`#5b67a5`,colourSecondary:`#dee1ed`,colourTertiary:`#495284`,hat:``},method_blocks:{colourPrimary:`#995ba5`,colourSecondary:`#ebdeed`,colourTertiary:`#7a4984`,hat:``},object_blocks:{colourPrimary:`#80a55b`,colourSecondary:`#e6edde`,colourTertiary:`#668449`,hat:``},procedure_blocks:{colourPrimary:`#995ba5`,colourSecondary:`#ebdeed`,colourTertiary:`#7a4984`,hat:``},property_blocks:{colourPrimary:`#5ba5a5`,colourSecondary:`#deeded`,colourTertiary:`#498484`,hat:``},state_blocks:{colourPrimary:`#a55b67`,colourSecondary:`#eddee1`,colourTertiary:`#844952`,hat:``},text_blocks:{colourPrimary:`#5ba58c`,colourSecondary:`#deede8`,colourTertiary:`#498470`,hat:``},time_blocks:{colourPrimary:`#5b99a5`,colourSecondary:`#deebed`,colourTertiary:`#497a84`,hat:``},variable_blocks:{colourPrimary:`#a55b80`,colourSecondary:`#eddee6`,colourTertiary:`#844966`,hat:``}},a.Classic.categoryStyles={color_category:{colour:`#a5745b`},common_category:{colour:`#757575`},compute_category:{colour:`#757575`},data_category:{colour:`#757575`},event_category:{colour:`#a5a55b`},flow_category:{colour:`#757575`},func_category:{colour:`#757575`},list_category:{colour:`#745ba5`},logic_category:{colour:`#5b80a5`},loop_category:{colour:`#5ba55b`},math_category:{colour:`#5b67a5`},method_category:{colour:`#995ba5`},misc_category:{colour:`#757575`},object_category:{colour:`#80a55b`},procedure_category:{colour:`#995ba5`},property_category:{colour:`#5ba5a5`},resource_category:{colour:`#757575`},state_category:{colour:`#a55b67`},text_category:{colour:`#5ba58c`},time_category:{colour:`#5b99a5`},variable_category:{colour:`#a55b80`}};const Di=ne.defineTheme(`light`,{name:`light`,base:a.Classic,componentStyles:{workspaceBackgroundColour:`#ffffff`,toolboxBackgroundColour:`#eeeeee`,toolboxForegroundColour:``,flyoutBackgroundColour:`#eeeeee`,flyoutForegroundColour:`#000000`,flyoutOpacity:.8,scrollbarColour:``,insertionMarkerColour:``,insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:``}}),Oi=ne.defineTheme(`dark`,{name:`dark`,base:a.Classic,componentStyles:{workspaceBackgroundColour:`#1e1e1e`,toolboxBackgroundColour:`#272727`,toolboxForegroundColour:``,flyoutBackgroundColour:`#272727`,flyoutForegroundColour:`#ffffff`,flyoutOpacity:.8,scrollbarColour:``,insertionMarkerColour:``,insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:``}});function ki(e){let t=s();switch(e){case`light`:t.setTheme(Di);break;case`dark`:t.setTheme(Oi);break}}function Ai(e,t){e.find(e=>e===t)||e.push(t)}const ji=[`get_app_property_v1`,`get_app_state_v1`];function Mi(e){let t=[];function n(e){for(let r of e.getChildren(!0))ji.includes(r.type)&&t.push(r),n(r)}return n(e),t}function Ni(e){let t=[];for(let n of e)n.type===`get_app_property_v1`?Ai(t,Ze(`propertyTrigger`,n.property.id)):n.type===`get_app_state_v1`?Ai(t,Ze(`stateTrigger`,n.state.id)):console.assert(!1);return t}function Pi(e){let t=[];for(let n of e){if(n.type!==`app_bind_entry_v1`)continue;let e=n;e.kind===`property`?Ai(t,Ze(`propertyTrigger`,e.property.id)):e.kind===`state`&&Ai(t,Ze(`stateTrigger`,e.state.id))}return t}function Fi(e){let t={watchEffect:{ids:[],triggers:{}},bind:{sets:{},triggers:{}}},n=e.getTopBlocks(!0);if(!n)return t;for(let e of n)if(e.type===`watch_effect_v1`){let n=Ni(Mi(e));for(let r of n)t.watchEffect.triggers[r]||(t.watchEffect.triggers[r]=[]),Ai(t.watchEffect.triggers[r],e.id);t.watchEffect.ids.push(e.id)}else if(e.type===`app_bind_v1`){let n=Pi(e.getChildren(!0));t.bind.sets[e.id]=n;for(let r of n)t.bind.triggers[r]||(t.bind.triggers[r]=[]),Ai(t.bind.triggers[r],e.id)}return t}const Ii=Symbol();function Li(e){Tt(Ii,e)}function Ri(){return _t(Ii)}var zi=gt({__name:`index`,props:{lock:{type:Boolean,required:!0}},setup(e,{expose:t}){let{t:n}=zt(),r=Bt(),i=Ri(),a=E(()=>r.smAndDown.value),o=()=>{if(!i.workspace){console.assert(!1);return}if(e.lock){Me(n(`x-block-lib.msg.cannotOperateInLockedState`));return}i.workspace.cleanUp()},s=()=>{o()};return t({cleanWorkspace:o}),(e,t)=>{let r=N(`v-btn`),i=N(`v-tooltip`);return M(),D(i,{disabled:a.value,text:P(n)(`x-block-lib.tip.hotkeyCtrlQ`)},{activator:Ft(({props:e})=>[A(r,bt(e,{density:`comfortable`,icon:`mdi-broom`,variant:`outlined`,onClick:s}),null,16)]),_:1},8,[`disabled`,`text`])}}});function Bi(e,t){let n=t.newBlock(`json_root_v1`);n.initSvg(),n.render();let r=(e,n)=>{if(e===null)return;let i;if(e instanceof Array)i=`json_array_v1`;else{let t=typeof e;if(t===`object`)i=`json_map_v1`;else if(t===`string`)i=`json_string_v1`;else if(t===`number`)i=`json_number_v1`;else if(t===`boolean`)i=`json_boolean_v1`;else return}let a=t.newBlock(i);if(a.initSvg(),a.render(),n.connect(a.outputConnection),i===`json_map_v1`){let t=[];for(let n in e)t.push(n);a.initData(t);for(let n=0;n<t.length;n++){let i=t[n],o=a.getInput(`ENTRY`+n);r(e[i],o.connection)}}else if(i===`json_array_v1`){a.initData(e.length);for(let t=0;t<e.length;t++)r(e[t],a.getInput(`ENTRY`+t).connection)}else i===`json_string_v1`||i===`json_number_v1`?a.setFieldValue(e,`VALUE`):i===`json_boolean_v1`&&a.setFieldValue(e?`true`:`false`,`VALUE`)};r(e,n.getInput(`JSON`).connection),x.fire(new(x.get(x.FINISHED_LOADING))(t))}function Vi(e){let t=e=>{if(!e)return null;if(e.type===`json_root_v1`)return t(e.getInputTargetBlock(`JSON`));if(e.type===`json_map_v1`){let n={};for(let r=0;r<e.length;r++){let i=e.getFieldValue(`KEY`+r);n[i]=t(e.getInputTargetBlock(`ENTRY`+r))}return n}else if(e.type===`json_array_v1`){let n=[];for(let r=0;r<e.length;r++)n.push(t(e.getInputTargetBlock(`ENTRY`+r)));return n}else if(e.type===`json_string_v1`)return e.getFieldValue(`VALUE`);else if(e.type===`json_number_v1`)return e.getFieldValue(`VALUE`);else if(e.type===`json_boolean_v1`)return e.getFieldValue(`VALUE`)===`true`;else console.assert(!1)},n=e.getTopBlocks();for(let e of n)if(e.type===`json_root_v1`)return t(e)}var Hi=gt({__name:`index`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let{t}=zt(),n=Bt(),r=Mt(e,`modelValue`),i=E(()=>n.smAndDown.value);return(e,n)=>{let a=N(`v-btn`),o=N(`v-tooltip`);return M(),D(o,{disabled:i.value,text:P(t)(`x-block-lib.tip.hotkeyCtrlW`)},{activator:Ft(({props:e})=>[A(a,bt(e,{density:`comfortable`,icon:r.value?`mdi-lock`:`mdi-lock-open`,variant:`outlined`,onClick:n[0]||(n[0]=e=>r.value=!r.value)}),null,16,[`icon`])]),_:1},8,[`disabled`,`text`])}}});const Ui={class:`d-flex flex-column`},Wi={class:`text-body-large ml-6`},Gi={key:0,class:`text-body-small text-grey text-truncate ml-6`,style:{maxWidth:`340px`}};var Ki=gt({__name:`item`,props:{id:{type:String,required:!0},title:{type:String,required:!0},desc:{type:String,required:!0},select:{type:Boolean,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{primaryColor:n,backgroundColor2:r,highlightColor:i}=Fe(),a=t,o=Et(!1),s=E(()=>{let t={position:`relative`,background:o.value?i.value:r.value,boxSizing:`border-box`,width:`100%`,height:`48px`,marginTop:`1px`,userSelect:`none`};return e.select?(t.borderTop=`1px solid `+n.value,t.borderBottom=`1px solid `+n.value):(t.borderTop=void 0,t.borderBottom=void 0),t});return(t,n)=>{let r=N(`v-spacer`),i=N(`v-icon`),c=kt(`ripple`);return It((M(),O(`div`,{class:`d-flex align-center cursor-pointer`,style:j(s.value),onClick:n[1]||(n[1]=t=>a(`x-click`,e.id)),onMouseout:n[2]||(n[2]=e=>o.value=!1),onMouseover:n[3]||(n[3]=e=>o.value=!0)},[k(`div`,Ui,[k(`span`,Wi,At(e.title),1),e.desc?(M(),O(`span`,Gi,At(e.desc),1)):ht(`v-if`,!0)]),A(r),A(i,{class:`x-handle cursor-move mr-3`,icon:`mdi-drag-horizontal-variant`,onMousedown:n[0]||(n[0]=Rt(()=>{},[`stop`]))})],36)),[[c]])}}});const qi={key:1,class:`text-body-small text-grey`};var Ji=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(gt({__name:`index`,props:yt({lock:{type:Boolean,required:!0}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e,{expose:t}){let{t:n}=zt(),r=Mt(e,`modelValue`),i=Ri(),a=Et([]);t({update:()=>{if(!i.workspace){console.assert(!1);return}let e=[];i.workspace.getTopBlocks(!0).forEach(t=>{let r=t.id===ie()?.id,i=``;if(t.type.startsWith(`on_app_event_v`)){let e=t,r=w(e.node.key);r&&(i=n(r.name),e.node.alias&&(i+=` / `+e.node.alias),i+=` - `+tt(e.event.kind,e.event.names))}else if(t.type.startsWith(`watch_effect_v`))i=n(`x-block-lib.watchEffect`);else if(t.type.startsWith(`app_bind_v`))i=n(`x-block-lib.bind`);else if(t.type.startsWith(`implement_app_method_v`)){let e=t;i=n(`x-block-lib.implementMethod`),i+=` - `+nt(e.method.kind,e.method.names)}else i=t.type.startsWith(`func_entry_v`)?n(`x-block-lib.funcEntry`):t.type.startsWith(`procedure_def_v`)?n(`x-block-lib.procedure`)+` - `+t.getFieldValue(`NAME`):n(`x-block-lib.temporaryBlock`);let a=t.getCommentText()??``;e.push({id:t.id,name:i,desc:a,select:r})}),a.value=e}});let o=[],s=()=>{if(e.lock){Me(n(`x-block-lib.msg.cannotOperateInLockedState`));return}let t=[];a.value.forEach(({id:e})=>{t.push(e)}),o=t},c=()=>!e.lock,l=e=>{if(!i.workspace){console.assert(!1);return}if(e.oldIndex===void 0||e.newIndex===void 0){console.assert(!1);return}if(e.oldIndex===e.newIndex)return;let t=o[e.oldIndex],n=i.workspace.getBlockById(t);if(!n){console.assert(!1);return}let r=``;e.newIndex>e.oldIndex?r=o[e.newIndex]:e.newIndex>0&&(r=o[e.newIndex-1]);let a=-10;r!==``&&(a=i.workspace.getBlockById(r).getRelativeToSurfaceXY().y+10);let s=n.getRelativeToSurfaceXY();n.moveTo(new p.Coordinate(s.x,a)),i.workspace.cleanUp(),Ei()},u=async e=>{if(!i.workspace){console.assert(!1);return}let t=i.workspace.getBlockById(e);ke.setSelected(t),Ti(e),r.value=!1};return(e,t)=>a.value.length>0?(M(),D(P(ue),{key:0,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),animation:150,"ghost-class":`ghost`,handle:`.x-handle`,onEnd:l,onMove:c,onStart:s},{default:Ft(()=>[(M(!0),O(mt,null,Dt(a.value,e=>(M(),D(Ki,{id:e.id,key:e.id,desc:e.desc,select:e.select,title:e.name,onXClick:u},null,8,[`id`,`desc`,`select`,`title`]))),128))]),_:1},8,[`modelValue`])):(M(),O(`span`,qi,At(P(n)(`x-block-lib.noOption`)),1))}}),[[`__scopeId`,`data-v-x-block-lib-ca7316a0`]]),Yi=gt({__name:`index`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e,{expose:t}){let n=Mt(e,`modelValue`),r=Ri();t({update:()=>{if(!r.workspace){console.assert(!1);return}}});let i=e=>{let t=s();if(!t){console.assert(!1);return}let r=t.getBlockById(e);ke.setSelected(r),Ti(e),n.value=!1};return(e,t)=>(M(),O(`div`,{onClick:t[0]||(t[0]=e=>i(``))},`blockTree`))}});const Xi={class:`text-body-large`};var Zi=gt({__name:`index`,props:{type:{type:String,required:!0},lock:{type:Boolean,required:!0}},setup(e,{expose:t}){let{t:n}=zt(),r=Bt(),{sysBarAvail:i}=Ie(),{backgroundColor1:a}=Fe(),o=E(()=>r.smAndDown.value),s=E(()=>{let e=`100%`;return r.mdAndUp.value&&(e=`400px`),{background:a.value,width:e,height:`100%`}}),c=E(()=>{let e=48;return i.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),l=E(()=>({height:`60px`})),{open:u}=Le(`blocklyNavigatorDlg${jt()}`);wt(()=>{u.value=!1});let ee=Nt(`blockList`),te=Nt(`blockTree`);return t({open:u,update:()=>{e.type===`list`?ee.value?.update():e.type===`tree`&&te.value?.update()}}),(t,r)=>{let a=N(`v-sheet`),d=N(`v-btn`),f=N(`v-spacer`),ne=N(`v-dialog`),p=N(`v-tooltip`);return M(),O(mt,null,[A(ne,{modelValue:P(u),"onUpdate:modelValue":r[5]||(r[5]=e=>vt(u)?u.value=e:null),eager:``,fullscreen:``,"no-click-animation":``,persistent:``,transition:`scroll-x-reverse-transition`,onKeydown:r[6]||(r[6]=Lt(Rt(e=>u.value=!1,[`stop`,`prevent`]),[`esc`]))},{default:Ft(()=>[k(`div`,{class:`w-100 h-100 d-flex flex-row-reverse`,onClick:r[3]||(r[3]=Rt(e=>u.value=!1,[`self`])),onContextmenu:r[4]||(r[4]=Rt(e=>u.value=!1,[`self`,`prevent`]))},[k(`div`,{class:`elevation-2`,style:j(s.value)},[P(i)?(M(),D(a,{key:0,color:`transparent`,height:24})):ht(`v-if`,!0),A(a,{class:`d-flex align-center px-2`,color:`transparent`,height:48},{default:Ft(()=>[A(d,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:r[0]||(r[0]=e=>u.value=!1)}),k(`span`,Xi,At(P(n)(`x-block-lib.navigator`)),1),A(f)]),_:1}),k(`div`,{class:`overflow-y-auto`,style:j(c.value)},[e.type===`list`?(M(),D(Ji,{key:0,ref_key:`blockList`,ref:ee,modelValue:P(u),"onUpdate:modelValue":r[1]||(r[1]=e=>vt(u)?u.value=e:null),lock:e.lock},null,8,[`modelValue`,`lock`])):e.type===`tree`?(M(),D(Yi,{key:1,ref_key:`blockTree`,ref:te,modelValue:P(u),"onUpdate:modelValue":r[2]||(r[2]=e=>vt(u)?u.value=e:null)},null,8,[`modelValue`])):ht(`v-if`,!0),k(`div`,{style:j(l.value)},null,4)],4)],4)],32)]),_:1},8,[`modelValue`]),A(p,{disabled:o.value,text:P(n)(`x-block-lib.tip.hotkeyCtrlE`)},{activator:Ft(({props:e})=>[A(d,bt(e,{density:`comfortable`,icon:`mdi-navigation-variant`,variant:`outlined`,onClick:r[7]||(r[7]=e=>u.value=!0)}),null,16)]),_:1},8,[`disabled`,`text`])],64)}}}),Qi=ge();const Z=p.xml;function Q(e){let t=Z.createElement(`label`);return t.setAttribute(`text`,e),t}function $(e,t){let n=Z.createElement(`block`);if(n.setAttribute(`type`,e),t)for(let e of t)n.appendChild(e);return n}function $i(e){let t=Z.createElement(`mutation`);for(let{key:n,value:r}of e)t.setAttribute(n,r);return t}function ea(e,t){t===void 0&&(t=``);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`text_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`TEXT`);let a=Z.createTextNode(t);return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function ta(e,t){t===void 0&&(t=0);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`math_number_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`NUM`);let a=Z.createTextNode(String(t));return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function na(e,t){t===void 0&&(t=!1);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`logic_boolean_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`BOOL`);let a=Z.createTextNode(t?`TRUE`:`FALSE`);return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function ra(){let{activeObject:e,activeComp:t}=S.app;return!(e.type!==`comp`||!t.meta.states||t.meta.states.length<=0)}function ia(){let e=[];return e.push(Q(F(`LABEL_EVENT`))),U(`onEvent`)&&e.push($(`on_app_event_v1`)),U(`triggerEvent`)&&e.push($(`trigger_app_event_v1`)),e.push($(`app_bind_v1`,[$i([{key:`items`,value:`2`}])])),e.push($(`watch_effect_v1`)),(U(`getProperty`)||U(`setProperty`))&&e.push(Q(F(`LABEL_PROPERTY`))),U(`getProperty`)&&e.push($(`get_app_property_v1`)),U(`setProperty`)&&e.push($(`set_app_property_v1`)),ra()&&(e.push(Q(F(`LABEL_STATE`))),e.push($(`get_app_state_v1`)),e.push($(`set_app_state_v1`))),(U(`callMethod`)||U(`implementMethod`))&&e.push(Q(F(`LABEL_METHOD`))),U(`callMethod`)&&e.push($(`call_app_method_v1`)),U(`implementMethod`)&&(e.push($(`implement_app_method_v1`)),U(`implementMethodOutput`)&&e.push($(`set_app_method_output_v1`)),e.push($(`procedure_return_v1`))),e}const aa={name:`APP_COMP_CATEGORY`,callback:ia};function oa(){let e=[];return e.push(Q(F(`LABEL_FUNC`))),e.push(Q(F(`LABEL_FLOW`))),e}const sa={name:`APP_COMPUTE_CATEGORY`,callback:oa};function ca(){let e=[];return e.push($(`app_debug_trace_v1`,[ea(`OBJECT`)])),e.push($(`popup_message_v1`,[ea(`TEXT`)])),e.push($(`open_confirm_dlg_v1`)),e.push($(`open_prompt_dlg_v1`)),e}const la={name:`APP_MESSAGE_CATEGORY`,callback:ca};function ua(){for(let e of S.app.appList)if(e.pages.length>0)return!0;return!1}function da(){let e=[];return e.push($(`app_env_is_v1`)),ua()&&e.push($(`navigate_to_v1`)),e}const fa={name:`APP_MISC_CATEGORY`,callback:da};function pa(){let{activeObject:e,activePage:t}=S.app;return!(e.type!==`page`||!t.meta.states||t.meta.states.length<=0)}function ma(){let{activeObject:e,activePage:t}=S.app;return!(e.type!==`page`||!t.meta.arguments||t.meta.arguments.length<=0)}function ha(){let e=[];return e.push(Q(F(`LABEL_EVENT`))),U(`onEvent`)&&e.push($(`on_app_event_v1`)),e.push($(`app_bind_v1`,[$i([{key:`items`,value:`2`}])])),e.push($(`watch_effect_v1`)),(U(`getProperty`)||U(`setProperty`))&&e.push(Q(F(`LABEL_PROPERTY`))),U(`getProperty`)&&e.push($(`get_app_property_v1`)),U(`setProperty`)&&e.push($(`set_app_property_v1`)),pa()&&(e.push(Q(F(`LABEL_STATE`))),e.push($(`get_app_state_v1`)),e.push($(`set_app_state_v1`))),U(`callMethod`)&&(e.push(Q(F(`LABEL_METHOD`))),e.push($(`call_app_method_v1`))),ma()&&(e.push(Q(F(`LABEL_ARGUMENT`))),e.push($(`get_page_argument_v1`))),e}const ga={name:`APP_PAGE_CATEGORY`,callback:ha};function _a(){let e=[];return e.push(Q(F(`LABEL_RESOURCE`))),e.push($(`upload_resource_v1`)),e}const va={name:`APP_RESOURCE_CATEGORY`,callback:_a},ya=p.xml;function ba(){let e=[];{let t=ya.createElement(`label`);t.setAttribute(`text`,`%{BKY_LABEL_PROCEDURE}`),e.push(t)}{let t=ya.createElement(`block`);t.setAttribute(`type`,`procedure_def_v1`);{let e=ya.createElement(`field`);e.setAttribute(`name`,`NAME`);let n=ya.createTextNode(F(`PROCEDURE_DEFAULT_NAME`));e.appendChild(n),t.appendChild(e)}e.push(t)}{let t=ya.createElement(`block`);t.setAttribute(`type`,`procedure_return_v1`),e.push(t)}return e}const xa={name:`PROCEDURE_CATEGORY`,callback:ba},Sa=p.xml;function Ca(){let e=s(),t=[];{let e=Sa.createElement(`label`);e.setAttribute(`text`,`%{BKY_LABEL_VARIABLE}`),t.push(e)}{let n=document.createElement(`button`);n.setAttribute(`text`,`%{BKY_NEW_VARIABLE}`),n.setAttribute(`callbackKey`,`CREATE_VARIABLE`),e.registerButtonCallback(`CREATE_VARIABLE`,function(e){c.createVariableButtonHandler(e.getTargetWorkspace())}),t.push(n)}let n=e.getVariablesOfType(``);if(n.length<=0)return t;n.sort(c.compareByName);{let e=Sa.createElement(`label`);e.setAttribute(`text`,F(`LABEL_CREATED`)),t.push(e)}return n.forEach(e=>{{let n=Sa.createElement(`block`);n.setAttribute(`type`,`variable_get_v1`),n.appendChild(c.generateVariableFieldDom(e)),t.push(n)}{let n=Sa.createElement(`block`);n.setAttribute(`type`,`variable_set_v1`),n.appendChild(c.generateVariableFieldDom(e)),t.push(n)}}),t}const wa={name:`VARIABLE_CATEGORY`,callback:Ca};function Ta(){let e=[];if(Y().length>0)e.push(Q(F(`LABEL_OPERATION`))),e.push($(`add_data_v1`)),e.push($(`delete_data_v1`)),e.push($(`update_data_v1`)),e.push($(`query_data_v1`)),e.push($(`transaction_v1`)),e.push($(`interrupt_transaction_v1`,[ea(`VALUE`)])),e.push(Q(F(`LABEL_CONDITION`))),e.push($(`cond_logic_v1`)),e.push($(`cond_atomic_v1`,[ea(`VALUE`)])),e.push(Q(F(`LABEL_QUERY_EXTRA`))),e.push($(`query_extra_limit_v1`,[ta(`OFFSET`,0),ta(`LIMIT`,1)])),e.push($(`query_extra_sortby_v1`,[ea(`COLUMN`),na(`DESC`)]));else{let t=document.createElement(`button`);t.setAttribute(`text`,F(`BUTTON_NO_TABLE`)),t.setAttribute(`callbackKey`,`NO_TABLE`),e.push(t)}return e}const Ea={name:`COMPUTE_DATA_CATEGORY`,callback:Ta};function Da(){return Er(`flow`).length>0}function Oa(){let e=[];return S.compute.activeObject.type===`flow`&&e.push($(`on_flow_state_event_v1`)),Da()&&console.assert(!0),e}const ka={name:`COMPUTE_FLOW_CATEGORY`,callback:Oa};function Aa(){return Er(`func`).length>0}function ja(){let{activeObject:e,activeFunc:t}=S.compute,n=[];return e.type===`func`&&(n.push($(`func_entry_v1`)),t.outputs&&t.outputs.length>0&&n.push($(`set_func_output_v1`)),n.push($(`procedure_return_v1`))),Aa()&&n.push($(`call_func_internal_v1`)),n}const Ma={name:`COMPUTE_FUNC_CATEGORY`,callback:ja};function Na(){let e=[];return e.push($(`compute_debug_trace_v1`,[ea(`OBJECT`)])),e}const Pa={name:`COMPUTE_MISC_CATEGORY`,callback:Na},Fa={kind:`category`,name:`%{BKY_CATEGORY_COLOR}`,categorystyle:`color_category`,contents:[{kind:`block`,type:`color_picker_v1`},{kind:`block`,type:`color_random_v1`},{kind:`block`,type:`color_rgb_v1`,inputs:{RED:{shadow:{type:`math_number_v1`,fields:{NUM:0}}},GREEN:{shadow:{type:`math_number_v1`,fields:{NUM:0}}},BLUE:{shadow:{type:`math_number_v1`,fields:{NUM:0}}}}},{kind:`block`,type:`color_blend_v1`,inputs:{COLOR1:{shadow:{type:`color_picker_v1`,fields:{COLOR:`#ff0000`}}},COLOR2:{shadow:{type:`color_picker_v1`,fields:{COLOR:`#00ff00`}}},RATIO:{shadow:{type:`math_number_v1`,fields:{NUM:.5}}}}}]},Ia={kind:`category`,name:`%{BKY_CATEGORY_LIST}`,categorystyle:`list_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_LIST}`},{kind:`block`,type:`list_create_v1`,extraState:{itemCount:0}},{kind:`label`,text:`%{BKY_LABEL_GET}`},{kind:`block`,type:`list_is_empty_v1`},{kind:`block`,type:`list_length_v1`},{kind:`block`,type:`list_get_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_get_sublist_v1`,inputs:{START:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},END:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`label`,text:`%{BKY_LABEL_SET}`},{kind:`block`,type:`list_set_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_delete_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_join_v1`,inputs:{DELIM:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`list_reverse_v1`}]},La={kind:`category`,name:`%{BKY_CATEGORY_LOGIC}`,categorystyle:`logic_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_BOOLEAN}`},{kind:`block`,type:`logic_boolean_v1`},{kind:`label`,text:`%{BKY_LABEL_BRANCH}`},{kind:`block`,type:`logic_if_v1`},{kind:`label`,text:`%{BKY_LABEL_LOGIC_OPERATION}`},{kind:`block`,type:`logic_compare_v1`},{kind:`block`,type:`logic_operation_v1`},{kind:`block`,type:`logic_negate_v1`},{kind:`block`,type:`logic_ternary_v1`}]},Ra={kind:`category`,name:`%{BKY_CATEGORY_LOOP}`,categorystyle:`loop_category`,contents:[{kind:`block`,type:`repeat_v1`,inputs:{TIMES:{shadow:{type:`math_number_v1`,fields:{NUM:10}}}}},{kind:`block`,type:`while_until_v1`},{kind:`block`,type:`for_v1`,inputs:{FROM:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},TO:{shadow:{type:`math_number_v1`,fields:{NUM:10}}},BY:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`for_each_v1`},{kind:`block`,type:`flow_control_v1`}]},za={kind:`category`,name:`%{BKY_CATEGORY_MATH}`,categorystyle:`math_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_VALUE}`},{kind:`block`,type:`math_number_v1`,fields:{NUM:0}},{kind:`block`,type:`math_constant_v1`},{kind:`block`,type:`math_random_float_v1`},{kind:`block`,type:`math_random_int_v1`,inputs:{FROM:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},TO:{shadow:{type:`math_number_v1`,fields:{NUM:100}}}}},{kind:`label`,text:`%{BKY_LABEL_MATH_OPERATION}`},{kind:`block`,type:`math_arithmetic_v1`,inputs:{A:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},B:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`math_round_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:3.1}}}}},{kind:`block`,type:`math_single_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:9}}}}},{kind:`block`,type:`math_trig_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:45}}}}},{kind:`block`,type:`math_modulo_v1`,inputs:{DIVIDEND:{shadow:{type:`math_number_v1`,fields:{NUM:64}}},DIVISOR:{shadow:{type:`math_number_v1`,fields:{NUM:10}}}}},{kind:`block`,type:`math_number_property_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:2}}}}},{kind:`block`,type:`math_on_list_v1`}]},Ba={kind:`category`,name:`%{BKY_CATEGORY_OBJECT}`,categorystyle:`object_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_OBJECT}`},{kind:`block`,type:`object_create_v1`},{kind:`block`,type:`object_from_json_v1`},{kind:`block`,type:`object_to_json_v1`},{kind:`label`,text:`%{BKY_LABEL_PROPERTY}`},{kind:`block`,type:`object_get_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`object_set_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`object_delete_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}}]},Va={kind:`category`,name:`%{BKY_CATEGORY_TEXT}`,categorystyle:`text_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_TEXT}`},{kind:`block`,type:`text_v1`},{kind:`block`,type:`text_join_v1`,extraState:{itemCount:2}},{kind:`label`,text:`%{BKY_LABEL_GET}`},{kind:`block`,type:`text_is_empty_v1`},{kind:`block`,type:`text_length_v1`},{kind:`block`,type:`text_char_at_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`text_substring_v1`,inputs:{START:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},END:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`text_index_of_v1`,inputs:{SUBSTR:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_count_v1`,inputs:{SUBSTR:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`label`,text:`%{BKY_LABEL_SET}`},{kind:`block`,type:`text_append_v1`,inputs:{TEXT:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_replace_v1`,inputs:{FROM:{shadow:{type:`text_v1`,fields:{TEXT:``}}},TO:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_split_v1`,inputs:{DELIM:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_change_case_v1`},{kind:`block`,type:`text_trim_v1`},{kind:`block`,type:`text_reverse_v1`}]},Ha={kind:`category`,name:`%{BKY_CATEGORY_TIME}`,categorystyle:`time_category`,contents:[{kind:`block`,type:`create_timer_v1`},{kind:`block`,type:`delay_v1`,inputs:{DURATION:{shadow:{type:`math_number_v1`,fields:{NUM:1e3}}}}}]},Ua={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_COMP}`,categorystyle:`misc_category`,custom:aa.name},{kind:`category`,name:`%{BKY_CATEGORY_MESSAGE}`,categorystyle:`misc_category`,custom:la.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:fa.name},Ra,La,za,Va,Ia,Ba,Fa,Ha,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name},{kind:`category`,name:`%{BKY_CATEGORY_RESOURCE}`,categorystyle:`resource_category`,custom:va.name},{kind:`category`,name:`%{BKY_CATEGORY_COMPUTE}`,categorystyle:`compute_category`,custom:sa.name}]},Wa={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_FUNC}`,categorystyle:`func_category`,custom:Ma.name},{kind:`category`,name:`%{BKY_CATEGORY_FLOW}`,categorystyle:`flow_category`,custom:ka.name},{kind:`category`,name:`%{BKY_CATEGORY_DATA}`,categorystyle:`data_category`,custom:Ea.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:Pa.name},Ra,La,za,Va,Ia,Ba,Fa,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name}]},Ga={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_FUNC}`,categorystyle:`func_category`,custom:Ma.name},{kind:`category`,name:`%{BKY_CATEGORY_FLOW}`,categorystyle:`flow_category`,custom:ka.name},{kind:`category`,name:`%{BKY_CATEGORY_DATA}`,categorystyle:`data_category`,custom:Ea.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:Pa.name},Ra,La,za,Va,Ia,Ba,Fa,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name}]},Ka={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_JSON}`,colour:`330`,contents:[{kind:`block`,type:`json_map_v1`},{kind:`block`,type:`json_array_v1`},{kind:`block`,type:`json_string_v1`},{kind:`block`,type:`json_number_v1`},{kind:`block`,type:`json_boolean_v1`}]}]},qa={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_PAGE}`,categorystyle:`misc_category`,custom:ga.name},{kind:`category`,name:`%{BKY_CATEGORY_MESSAGE}`,categorystyle:`misc_category`,custom:la.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:fa.name},Ra,La,za,Va,Ia,Ba,Fa,Ha,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name},{kind:`category`,name:`%{BKY_CATEGORY_RESOURCE}`,categorystyle:`resource_category`,custom:va.name},{kind:`category`,name:`%{BKY_CATEGORY_COMPUTE}`,categorystyle:`compute_category`,custom:sa.name}]},Ja={grid:{length:2,snap:!0,spacing:20},maxInstances:{func_entry_v1:1},media:`/media/`,move:{drag:!0,scrollbars:!0,wheel:!0},readOnly:!1,theme:`light`,trashcan:!1,zoom:{maxScale:1,minScale:.1,scaleSpeed:1.25,startScale:1,wheel:!0}};function Ya(e,t,n,r){Ja.theme=r?`dark`:`light`,Ja.toolbox=Xa(t,n);let i=o(e,Ja);return i.addChangeListener(e=>{if(e.type===`state_change`){let e=i.getAllBlocks();for(let t of e){let e=t;e.checkWarning_&&e.checkWarning_()}}setTimeout(()=>{(0,Qi.shadowBlockConversionChangeListener)(e)},0)}),Za(i,t,n),Qa(i),i}function Xa(e,t){let n;return e===`page`?t===`v1`&&(n=qa):e===`comp`?t===`v1`&&(n=Ua):e===`func`?t===`v1`&&(n=Ga):e===`flow`?t===`v1`&&(n=Wa):e===`json`&&t===`v1`&&(n=Ka),console.assert(!!n,`invalid toolbox type=${e} version=${t}`),n}function Za(e,t,n){function r({name:n,callback:r}){e.registerToolboxCategoryCallback(n,()=>r(t))}t===`page`?n===`v1`&&(r(ga),r(la),r(fa),r(wa),r(xa),r(va),r(sa)):t===`comp`?n===`v1`&&(r(aa),r(la),r(fa),r(wa),r(xa),r(va),r(sa)):t===`func`?n===`v1`&&(r(Ma),r(ka),r(Ea),r(Pa),r(wa),r(xa)):t===`flow`&&n===`v1`&&(r(Ma),r(ka),r(Ea),r(Pa),r(wa),r(xa))}function Qa(e){let{router:t}=je;e.registerButtonCallback(`NO_COMPUTE`,()=>{let e=t.resolve({path:`/compute/`+Date.now()});setTimeout(()=>{window.open(e.href,`_blank`)},100)}),e.registerButtonCallback(`NO_TABLE`,()=>{let e=t.resolve({path:`/data/`+Date.now()});setTimeout(()=>{window.open(e.href,`_blank`)},100)})}const $a={class:`position-relative w-100 h-100`};var eo=gt({__name:`index`,props:yt({type:{type:String,required:!0},version:{type:String,required:!0},locale:{type:String,required:!0},dark:{type:Boolean,required:!0}},{lock:{type:Boolean,required:!0},lockModifiers:{},scale:{type:Number,required:!0},scaleModifiers:{}}),emits:yt([`ready`],[`update:lock`,`update:scale`]),setup(e,{expose:t,emit:n}){let{backgroundColor2:r}=Fe(),i=Mt(e,`lock`),a=Mt(e,`scale`),o=n,s=`blocklyEditor${jt()}`,c=Et(),u=Nt(`parentContainer`),ee=Nt(`clean`),te=Nt(`navigator`),d={};Li(d);let f=Et(!0),ne=Et(!1),p=E(()=>e.type===`json`?`tree`:`list`),re=E(()=>({width:`100%`,height:`calc(100% - 48px)`})),m=E(()=>({position:`absolute`,background:r.value,bottom:`0px`,width:`100%`,height:`48px`})),h=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`1px`,left:`0px`,width:`56px`,height:`calc(100% - 49px)`,zIndex:999})),ie=E(()=>({position:`absolute`,top:`0px`,right:`0px`,zIndex:20})),ae=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`0px`,left:`0px`,width:`100%`,height:`calc(100% - 48px)`,pointerEvents:`none`})),oe=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`1px`,left:`0px`,width:`56px`,height:`calc(100% - 49px)`,zIndex:999})),ce=E(()=>({position:`fixed`,top:0,left:0,zIndex:3e3})),{open:ue}=Le(`blocklyEditorFlyout${jt()}`);Ct(async()=>{if(!c.value||!u.value){console.assert(!1);return}se(u.value),await Vt(e.locale),d.workspace=Ya(c.value,e.type,e.version,e.dark),d.workspace.addChangeListener(x.disableOrphans),d.workspace.addChangeListener(de);let t=document.querySelector(`#${s} .blocklyFlyout`);new MutationObserver(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`style`&&(ue.value=d.workspace.getFlyout().isVisible())})}).observe(t,{attributes:!0}),ue.value=d.workspace.getFlyout().isVisible(),ge(),_e(),await xt(),o(`ready`)}),St(()=>{ue.value=!1}),Se(c,()=>{d.workspace&&le(d.workspace)});async function de(e){if(e.type===x.FINISHED_LOADING){Ei(),setTimeout(()=>{te.value?.update()},0),f.value=!1;return}if(!f.value){if(e.type===x.VIEWPORT_CHANGE){a.value=d.workspace.getScale();return}e.type===x.BLOCK_DRAG&&(e.isStart?ne.value=!0:ne.value=!1),setTimeout(()=>{te.value?.update()},0)}}let fe=t=>{f.value=!0,e.type===`json`?Bi(t,d.workspace):l.workspaces.load(t,d.workspace)},pe=()=>e.type===`json`?Vi(d.workspace):l.workspaces.save(d.workspace),me=e=>{l.blocks.append(e,d.workspace)},_=()=>{if(e.type===`json`)console.assert(!1);else return g.workspaceToCode(d.workspace)},he=()=>Fi(d.workspace),ge=()=>{d.workspace.setIsReadOnly(i.value),d.workspace.isReadOnly()&&(ue.value=!1)},_e=()=>{d.workspace.setScale(a.value)},ve=()=>{x.fire(new(x.get(`state_change`))(d.workspace))},ye=()=>{ee.value?.cleanWorkspace()},be=()=>{i.value=!i.value},xe=()=>{te.value&&(te.value.open=!0)};return Ct(()=>{Ae.on(`cleanWorkspace`,ye),Ae.on(`toggleBlocklyLock`,be),Ae.on(`openBlocklyNavigator`,xe)}),St(()=>{Ae.off(`cleanWorkspace`,ye),Ae.off(`toggleBlocklyLock`,be),Ae.off(`openBlocklyNavigator`,xe)}),Pt(()=>e.locale,e=>{Vt(e)}),Pt(()=>e.dark,e=>{ki(e?`dark`:`light`)}),Pt(ue,e=>{e||d.workspace?.hideChaff()}),Pt(i,()=>{ge()}),Pt(a,()=>{_e()}),t({loading:f,load:fe,save:pe,appendBlock:me,generateCode:_,generateReactivity:he,fireStateChange:ve}),(e,t)=>{let n=N(`v-icon`),r=N(`x-loading`);return M(),O(`div`,$a,[k(`div`,{id:s,ref_key:`blocklyDiv`,ref:c,style:j(re.value)},null,4),k(`div`,{style:j(m.value)},[Ot(e.$slots,`bottom`)],4),ne.value?(M(),O(`div`,{key:0,class:`d-flex flex-column justify-center align-center`,style:j(h.value)},[A(n,{icon:`mdi-delete`,size:`x-large`})],4)):ht(`v-if`,!0),f.value?ht(`v-if`,!0):(M(),O(`div`,{key:1,class:`d-flex align-end ga-3 pt-3 pr-3`,style:j(ie.value)},[A(zi,{ref_key:`clean`,ref:ee,lock:i.value},null,8,[`lock`]),A(Hi,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e)},null,8,[`modelValue`]),A(Zi,{ref_key:`navigator`,ref:te,lock:i.value,type:p.value},null,8,[`lock`,`type`])],4)),i.value?(M(),O(`div`,{key:2,style:j(oe.value)},null,4)):ht(`v-if`,!0),i.value?(M(),O(`div`,{key:3,style:j(ae.value)},null,4)):ht(`v-if`,!0),k(`div`,{ref_key:`parentContainer`,ref:u,style:j(ce.value)},null,4),A(r,{open:f.value,"z-index":99},null,8,[`open`])])}}}),to=gt({__name:`index`,props:{code:{type:String,required:!0}},setup(e){we.registerLanguage(`javascript`,Ee);let t=xe.component,{backgroundColor2:n}=Fe();return(r,i)=>{let a=N(`v-sheet`);return M(),D(a,{color:P(n),height:`100%`,width:`100%`},{default:Ft(()=>[A(P(t),{code:e.code,language:`js`},null,8,[`code`])]),_:1},8,[`color`])}}});const no={class:`text-body-large`},ro={class:`w-100 h-100 overflow-auto`};var io=gt({__name:`index`,setup(e){let{t}=zt(),{sysBarAvail:n}=Ie(),{backgroundColor0:r,backgroundColor2:i}=Fe(),a=Et(``),o=E(()=>{let e=48;return n.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),{open:s}=Le(`sourceDlg`,e=>{a.value=e.code});return(e,c)=>{let l=N(`v-sheet`),u=N(`v-btn`),ee=N(`v-spacer`),te=N(`v-dialog`);return M(),D(te,{modelValue:P(s),"onUpdate:modelValue":c[1]||(c[1]=e=>vt(s)?s.value=e:null),fullscreen:``,"no-click-animation":``,persistent:``,transition:`dialog-bottom-transition`,onKeydown:c[2]||(c[2]=Lt(Rt(e=>s.value=!1,[`stop`,`prevent`]),[`esc`]))},{default:Ft(()=>[A(l,{color:P(r),height:`100%`,width:`100%`},{default:Ft(()=>[P(n)?(M(),D(l,{key:0,color:P(i),height:24},null,8,[`color`])):ht(`v-if`,!0),A(l,{class:`d-flex align-center px-2`,color:P(i),height:48},{default:Ft(()=>[A(u,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:c[0]||(c[0]=e=>s.value=!1)}),k(`span`,no,At(P(t)(`x-block-lib.dlg.source.title`)),1),A(ee)]),_:1},8,[`color`]),k(`div`,{style:j(o.value)},[k(`div`,ro,[A(to,{code:a.value},null,8,[`code`])])],4)]),_:1},8,[`color`])]),_:1},8,[`modelValue`])}}});const ao=e=>{e.component(`XBlockly`,eo),e.component(`XSourceDlg`,io)};async function oo(e){if(e===`en`)return(await import(`./i18n-en.l65xil3y.js`).then(e=>e.t)).default;if(e===`zhHans`)return(await import(`./i18n-zhHans.fm8rc300.js`).then(e=>e.t)).default;throw Error(`invalid locale=${e}`)}var so={install:ao};export{eo as XBlockly,so as default,tr as getCallMethodInfo,ar as getImplementMethodInfo,W as getNodeInfo,Jn as getOnEventInfo,mr as getPropertyInfo,Zn as getTriggerEventInfo,ao as install,oo as loadLocaleMessageBlock};
|
|
377
|
+
${g.statementToCode(e,`CALLBACK`)}});\n`},t([{type:`delay_v1`,message0:`%{BKY_TIME_V1_DELAY_TITLE}`,args0:[{type:`input_value`,name:`DURATION`,check:`Number`}],previousStatement:null,nextStatement:null,style:`time_blocks`,tooltip:`%{BKY_TIME_V1_DELAY_TOOLTIP}`,helpUrl:`%{BKY_TIME_V1_DELAY_HELPURL}`}]),g.forBlock.delay_v1=function(e){return`await __delayV1__(${g.valueToCode(e,`DURATION`,_.ATOMIC)||`0`});\n`};const di={customContextMenu:function(e){if(!this.isInFlyout){let t,n;this.type===`variable_get_v1`?(t=`variable_set_v1`,n=F(`VARIABLE_GET_CREATE_SET`)):this.type===`variable_set_v1`?(t=`variable_get_v1`,n=F(`VARIABLE_SET_CREATE_GET`)):console.assert(!1);let r=this.getField(`VAR`),i={type:t,fields:{VAR:r.saveState(!0)}};e.push({enabled:this.workspace.remainingCapacity()>0,text:n.replace(`%1`,r.getText()),callback:Oe.callbackFactory(this,i)})}else if(this.type===`variable_get_v1`){let t={text:F(`RENAME_VARIABLE`),enabled:!0,callback:fi(this)},n=this.getField(`VAR`).getText(),r={text:F(`DELETE_VARIABLE`).replace(`%1`,n),enabled:!0,callback:pi(this)};e.unshift(t),e.unshift(r)}}},fi=function(e){return function(){let t=e.workspace,n=e.getField(`VAR`).getVariable();c.renameVariable(t,n)}},pi=function(e){return function(){let t=e.getField(`VAR`).getVariable();t&&c.deleteVariable(t.getWorkspace(),t,e)}};m.registerMixin(`context_menu_variable_v1`,di),t([{type:`variable_get_v1`,message0:`%1`,args0:[{type:`field_variable`,name:`VAR`}],output:null,style:`variable_blocks`,tooltip:`%{BKY_VARIABLE_V1_GET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLE_V1_GET_HELPURL}`,extensions:[`context_menu_variable_v1`]}]),g.forBlock.variable_get_v1=function(t){return[g.nameDB_.getName(t.getFieldValue(`VAR`),e.NameType.VARIABLE),_.ATOMIC]},t([{type:`variable_set_v1`,message0:`%{BKY_VARIABLE_V1_SET_TITLE}`,args0:[{type:`field_variable`,name:`VAR`,variable:``},{type:`input_value`,name:`VALUE`}],previousStatement:null,nextStatement:null,style:`variable_blocks`,tooltip:`%{BKY_VARIABLE_V1_SET_TOOLTIP}`,helpUrl:`%{BKY_VARIABLE_V1_SET_HELPURL}`,extensions:[`context_menu_variable_v1`]}]),g.forBlock.variable_set_v1=function(t){return`${g.nameDB_.getName(t.getFieldValue(`VAR`),e.NameType.VARIABLE)} = ${g.valueToCode(t,`VALUE`,_.ASSIGNMENT)||`0`};\n`},ae.setConfirm(async(e,t)=>{t(!!await Ne({title:``,text:e}))}),ae.setPrompt(async(e,t,n)=>{let r=await Pe({title:``,value:t});r!==void 0&&n(String(r))});const mi=b.prototype;mi.doClassValidation_=function(e){return e};const hi=mi.doValueUpdate_;mi.doValueUpdate_=function(e){hi.call(this,e),this.selectedOption&&this.selectedOption[1]!==e&&(this.selectedOption=null)};const gi=mi.getText_;mi.getText_=function(){if(this.selectedOption)return gi.call(this);let{i18n:e}=je,t=this.getSourceBlock();if(this.name===`APP`)return t.app.name;if(this.name===`PAGE`)return t.page.name;if(this.name===`ELEMENT`)return t.element.name;if(this.name===`NODE`){let n=w(t.node.key);if(n)return`${e.global.t(n.name)} / ${t.node.alias}`}else if(this.name===`PROPERTY`){let{kind:e,names:n}=t.property;return rt(e,n)}else if(this.name===`EVENT`){let{kind:e,names:n}=t.event;return tt(e,n)}else if(this.name===`METHOD`){let{kind:e,names:n}=t.method;return nt(e,n)}else if(this.name===`SPACE`)return t.space.name;else if(this.name===`FUNC`)return t.func.name;else if(this.name===`OUTPUT`)return t.output.name;else if(this.name===`TABLE`)return t.table.name;else if(this.name===`COLUMN`)return t.column.name;else if(this.name===`DIR`)return t.dir.name;else if(this.name===`RESOURCE`)return t.resource.name;return`<n/a>`},ee.prototype.cleanUp=function(){this.setResizesEnabled(!1);let e=x.getGroup();e||x.setGroup(!0);let t=this.getTopBlocks(!0),n=t.filter(e=>e.isMovable()),r=t.filter(e=>!e.isMovable()).map(e=>e.getBoundingRectangle()),i=function(e){for(let t of r)if(e.intersects(t))return t;return null},a=0;for(let e of n){let t=e.getBoundingRectangle();e.moveBy(-t.left,a-t.top,[`cleanup`]),e.snapToGrid(),t=e.getBoundingRectangle();let n=i(t);for(;n!=null;)a=n.top+n.getHeight()+60,e.moveBy(0,a-t.top,[`cleanup`]),e.snapToGrid(),t=e.getBoundingRectangle(),n=i(t);a=e.getRelativeToSurfaceXY().y+e.getHeightWidth().height+60}x.setGroup(e),this.setResizesEnabled(!0)};var _i=Te();function vi(e){let t=e.getParent();return t&&vi(t)?!0:!t&&!!(e.outputConnection||e.previousConnection)}var yi=class{init(){let e=de.registry.getItem(`blockDisable`);e&&(e.preconditionFn=function(e){let t=e.block;return t&&!t.isInFlyout&&t.workspace.options.disable&&t.isEditable()?t.getInheritedDisabled()||vi(t)?`disabled`:`enabled`:`hidden`})}};(0,En.registerFieldColour)(),d.registry.unregister(te.names.ESCAPE),new _i.CrossTabCopyPaste().init({contextMenu:!0,shortcut:!0}),new yi().init();function bi(e){"@babel/helpers - typeof";return bi=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},bi(e)}function xi(e,t){if(bi(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(bi(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Si(e){var t=xi(e,`string`);return bi(t)==`symbol`?t:t+``}function Ci(e,t,n){return(t=Si(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var wi=class extends x.Abstract{constructor(e){super(),Ci(this,`isBlank`,!0),Ci(this,`recordUndo`,!1),Ci(this,`type`,`state_change`),this.workspaceId=e.id}};Ce.register(Ce.Type.EVENT,`state_change`,wi);function Ti(e){let t=s();if(!t)return;let n=t.getBlockById(e);if(!n)return;let r=n.getRootBlock();if(!r)return;let i=r.getRelativeToSurfaceXY(),a=i.x*t.scale,o=i.y*t.scale;t.scroll(-a,-o)}function Ei(){let e=s();if(!e)return;let t=e.getTopBlocks(!0)?.[0];t&&Ti(t.id)}a.Classic.blockStyles={color_blocks:{colourPrimary:`#a5745b`,colourSecondary:`#ede3de`,colourTertiary:`#845d49`,hat:``},event_blocks:{colourPrimary:`#a5a55b`,colourSecondary:`#ededde`,colourTertiary:`#848449`,hat:``},list_blocks:{colourPrimary:`#745ba5`,colourSecondary:`#e3deed`,colourTertiary:`#5d4984`,hat:``},logic_blocks:{colourPrimary:`#5b80a5`,colourSecondary:`#dee6ed`,colourTertiary:`#496684`,hat:``},loop_blocks:{colourPrimary:`#5ba55b`,colourSecondary:`#deedde`,colourTertiary:`#498449`,hat:``},math_blocks:{colourPrimary:`#5b67a5`,colourSecondary:`#dee1ed`,colourTertiary:`#495284`,hat:``},method_blocks:{colourPrimary:`#995ba5`,colourSecondary:`#ebdeed`,colourTertiary:`#7a4984`,hat:``},object_blocks:{colourPrimary:`#80a55b`,colourSecondary:`#e6edde`,colourTertiary:`#668449`,hat:``},procedure_blocks:{colourPrimary:`#995ba5`,colourSecondary:`#ebdeed`,colourTertiary:`#7a4984`,hat:``},property_blocks:{colourPrimary:`#5ba5a5`,colourSecondary:`#deeded`,colourTertiary:`#498484`,hat:``},state_blocks:{colourPrimary:`#a55b67`,colourSecondary:`#eddee1`,colourTertiary:`#844952`,hat:``},text_blocks:{colourPrimary:`#5ba58c`,colourSecondary:`#deede8`,colourTertiary:`#498470`,hat:``},time_blocks:{colourPrimary:`#5b99a5`,colourSecondary:`#deebed`,colourTertiary:`#497a84`,hat:``},variable_blocks:{colourPrimary:`#a55b80`,colourSecondary:`#eddee6`,colourTertiary:`#844966`,hat:``}},a.Classic.categoryStyles={color_category:{colour:`#a5745b`},common_category:{colour:`#757575`},compute_category:{colour:`#757575`},data_category:{colour:`#757575`},event_category:{colour:`#a5a55b`},flow_category:{colour:`#757575`},func_category:{colour:`#757575`},list_category:{colour:`#745ba5`},logic_category:{colour:`#5b80a5`},loop_category:{colour:`#5ba55b`},math_category:{colour:`#5b67a5`},method_category:{colour:`#995ba5`},misc_category:{colour:`#757575`},object_category:{colour:`#80a55b`},procedure_category:{colour:`#995ba5`},property_category:{colour:`#5ba5a5`},resource_category:{colour:`#757575`},state_category:{colour:`#a55b67`},text_category:{colour:`#5ba58c`},time_category:{colour:`#5b99a5`},variable_category:{colour:`#a55b80`}};const Di=ne.defineTheme(`light`,{name:`light`,base:a.Classic,componentStyles:{workspaceBackgroundColour:`#ffffff`,toolboxBackgroundColour:`#eeeeee`,toolboxForegroundColour:``,flyoutBackgroundColour:`#eeeeee`,flyoutForegroundColour:`#000000`,flyoutOpacity:.8,scrollbarColour:``,insertionMarkerColour:``,insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:``}}),Oi=ne.defineTheme(`dark`,{name:`dark`,base:a.Classic,componentStyles:{workspaceBackgroundColour:`#1e1e1e`,toolboxBackgroundColour:`#272727`,toolboxForegroundColour:``,flyoutBackgroundColour:`#272727`,flyoutForegroundColour:`#ffffff`,flyoutOpacity:.8,scrollbarColour:``,insertionMarkerColour:``,insertionMarkerOpacity:.3,scrollbarOpacity:.4,cursorColour:``}});function ki(e){let t=s();switch(e){case`light`:t.setTheme(Di);break;case`dark`:t.setTheme(Oi);break}}function Ai(e,t){e.find(e=>e===t)||e.push(t)}const ji=[`get_app_property_v1`,`get_app_state_v1`];function Mi(e){let t=[];function n(e){for(let r of e.getChildren(!0))ji.includes(r.type)&&t.push(r),n(r)}return n(e),t}function Ni(e){let t=[];for(let n of e)n.type===`get_app_property_v1`?Ai(t,Ze(`propertyTrigger`,n.property.id)):n.type===`get_app_state_v1`?Ai(t,Ze(`stateTrigger`,n.state.id)):console.assert(!1);return t}function Pi(e){let t=[];for(let n of e){if(n.type!==`app_bind_entry_v1`)continue;let e=n;e.kind===`property`?Ai(t,Ze(`propertyTrigger`,e.property.id)):e.kind===`state`&&Ai(t,Ze(`stateTrigger`,e.state.id))}return t}function Fi(e){let t={watchEffect:{ids:[],triggers:{}},bind:{sets:{},triggers:{}}},n=e.getTopBlocks(!0);if(!n)return t;for(let e of n)if(e.type===`watch_effect_v1`){let n=Ni(Mi(e));for(let r of n)t.watchEffect.triggers[r]||(t.watchEffect.triggers[r]=[]),Ai(t.watchEffect.triggers[r],e.id);t.watchEffect.ids.push(e.id)}else if(e.type===`app_bind_v1`){let n=Pi(e.getChildren(!0));t.bind.sets[e.id]=n;for(let r of n)t.bind.triggers[r]||(t.bind.triggers[r]=[]),Ai(t.bind.triggers[r],e.id)}return t}const Ii=Symbol();function Li(e){Tt(Ii,e)}function Ri(){return _t(Ii)}var zi=gt({__name:`index`,props:{lock:{type:Boolean,required:!0}},setup(e,{expose:t}){let{t:n}=zt(),r=Bt(),i=Ri(),a=E(()=>r.smAndDown.value),o=()=>{if(!i.workspace){console.assert(!1);return}if(e.lock){Me(n(`x-block-lib.msg.cannotOperateInLockedState`));return}i.workspace.cleanUp()},s=()=>{o()};return t({cleanWorkspace:o}),(e,t)=>{let r=N(`v-btn`),i=N(`v-tooltip`);return M(),D(i,{disabled:a.value,text:P(n)(`x-block-lib.tip.hotkeyCtrlQ`)},{activator:Ft(({props:e})=>[A(r,bt(e,{density:`comfortable`,icon:`mdi-broom`,variant:`outlined`,onClick:s}),null,16)]),_:1},8,[`disabled`,`text`])}}});function Bi(e,t){let n=t.newBlock(`json_root_v1`);n.initSvg(),n.render();let r=(e,n)=>{if(e===null)return;let i;if(e instanceof Array)i=`json_array_v1`;else{let t=typeof e;if(t===`object`)i=`json_map_v1`;else if(t===`string`)i=`json_string_v1`;else if(t===`number`)i=`json_number_v1`;else if(t===`boolean`)i=`json_boolean_v1`;else return}let a=t.newBlock(i);if(a.initSvg(),a.render(),n.connect(a.outputConnection),i===`json_map_v1`){let t=[];for(let n in e)t.push(n);a.initData(t);for(let n=0;n<t.length;n++){let i=t[n],o=a.getInput(`ENTRY`+n);r(e[i],o.connection)}}else if(i===`json_array_v1`){a.initData(e.length);for(let t=0;t<e.length;t++)r(e[t],a.getInput(`ENTRY`+t).connection)}else i===`json_string_v1`||i===`json_number_v1`?a.setFieldValue(e,`VALUE`):i===`json_boolean_v1`&&a.setFieldValue(e?`true`:`false`,`VALUE`)};r(e,n.getInput(`JSON`).connection),x.fire(new(x.get(x.FINISHED_LOADING))(t))}function Vi(e){let t=e=>{if(!e)return null;if(e.type===`json_root_v1`)return t(e.getInputTargetBlock(`JSON`));if(e.type===`json_map_v1`){let n={};for(let r=0;r<e.length;r++){let i=e.getFieldValue(`KEY`+r);n[i]=t(e.getInputTargetBlock(`ENTRY`+r))}return n}else if(e.type===`json_array_v1`){let n=[];for(let r=0;r<e.length;r++)n.push(t(e.getInputTargetBlock(`ENTRY`+r)));return n}else if(e.type===`json_string_v1`)return e.getFieldValue(`VALUE`);else if(e.type===`json_number_v1`)return e.getFieldValue(`VALUE`);else if(e.type===`json_boolean_v1`)return e.getFieldValue(`VALUE`)===`true`;else console.assert(!1)},n=e.getTopBlocks();for(let e of n)if(e.type===`json_root_v1`)return t(e)}var Hi=gt({__name:`index`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let{t}=zt(),n=Bt(),r=Mt(e,`modelValue`),i=E(()=>n.smAndDown.value);return(e,n)=>{let a=N(`v-btn`),o=N(`v-tooltip`);return M(),D(o,{disabled:i.value,text:P(t)(`x-block-lib.tip.hotkeyCtrlW`)},{activator:Ft(({props:e})=>[A(a,bt(e,{density:`comfortable`,icon:r.value?`mdi-lock`:`mdi-lock-open`,variant:`outlined`,onClick:n[0]||(n[0]=e=>r.value=!r.value)}),null,16,[`icon`])]),_:1},8,[`disabled`,`text`])}}});const Ui={class:`d-flex flex-column`},Wi={class:`text-body-large ml-6`},Gi={key:0,class:`text-body-small text-grey text-truncate ml-6`,style:{maxWidth:`340px`}};var Ki=gt({__name:`item`,props:{id:{type:String,required:!0},title:{type:String,required:!0},desc:{type:String,required:!0},select:{type:Boolean,required:!0}},emits:[`x-click`],setup(e,{emit:t}){let{primaryColor:n,backgroundColor2:r,highlightColor:i}=Fe(),a=t,o=Et(!1),s=E(()=>{let t={position:`relative`,background:o.value?i.value:r.value,boxSizing:`border-box`,width:`100%`,height:`48px`,marginTop:`1px`,userSelect:`none`};return e.select?(t.borderTop=`1px solid `+n.value,t.borderBottom=`1px solid `+n.value):(t.borderTop=void 0,t.borderBottom=void 0),t});return(t,n)=>{let r=N(`v-spacer`),i=N(`v-icon`),c=kt(`ripple`);return It((M(),O(`div`,{class:`d-flex align-center cursor-pointer`,style:j(s.value),onClick:n[1]||(n[1]=t=>a(`x-click`,e.id)),onMouseout:n[2]||(n[2]=e=>o.value=!1),onMouseover:n[3]||(n[3]=e=>o.value=!0)},[k(`div`,Ui,[k(`span`,Wi,At(e.title),1),e.desc?(M(),O(`span`,Gi,At(e.desc),1)):ht(`v-if`,!0)]),A(r),A(i,{class:`x-handle cursor-move mr-3`,icon:`mdi-drag-horizontal-variant`,onMousedown:n[0]||(n[0]=Rt(()=>{},[`stop`]))})],36)),[[c]])}}});const qi={key:1,class:`text-body-small text-grey`};var Ji=((e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n})(gt({__name:`index`,props:yt({lock:{type:Boolean,required:!0}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e,{expose:t}){let{t:n}=zt(),r=Mt(e,`modelValue`),i=Ri(),a=Et([]);t({update:()=>{if(!i.workspace){console.assert(!1);return}let e=[];i.workspace.getTopBlocks(!0).forEach(t=>{let r=t.id===ie()?.id,i=``;if(t.type.startsWith(`on_app_event_v`)){let e=t,r=w(e.node.key);r&&(i=n(r.name),e.node.alias&&(i+=` / `+e.node.alias),i+=` - `+tt(e.event.kind,e.event.names))}else if(t.type.startsWith(`watch_effect_v`))i=n(`x-block-lib.watchEffect`);else if(t.type.startsWith(`app_bind_v`))i=n(`x-block-lib.bind`);else if(t.type.startsWith(`implement_app_method_v`)){let e=t;i=n(`x-block-lib.implementMethod`),i+=` - `+nt(e.method.kind,e.method.names)}else i=t.type.startsWith(`func_entry_v`)?n(`x-block-lib.funcEntry`):t.type.startsWith(`procedure_def_v`)?n(`x-block-lib.procedure`)+` - `+t.getFieldValue(`NAME`):n(`x-block-lib.temporaryBlock`);let a=t.getCommentText()??``;e.push({id:t.id,name:i,desc:a,select:r})}),a.value=e}});let o=[],s=()=>{if(e.lock){Me(n(`x-block-lib.msg.cannotOperateInLockedState`));return}let t=[];a.value.forEach(({id:e})=>{t.push(e)}),o=t},c=()=>!e.lock,l=e=>{if(!i.workspace){console.assert(!1);return}if(e.oldIndex===void 0||e.newIndex===void 0){console.assert(!1);return}if(e.oldIndex===e.newIndex)return;let t=o[e.oldIndex],n=i.workspace.getBlockById(t);if(!n){console.assert(!1);return}let r=``;e.newIndex>e.oldIndex?r=o[e.newIndex]:e.newIndex>0&&(r=o[e.newIndex-1]);let a=-10;r!==``&&(a=i.workspace.getBlockById(r).getRelativeToSurfaceXY().y+10);let s=n.getRelativeToSurfaceXY();n.moveTo(new p.Coordinate(s.x,a)),i.workspace.cleanUp(),Ei()},u=async e=>{if(!i.workspace){console.assert(!1);return}let t=i.workspace.getBlockById(e);ke.setSelected(t),Ti(e),r.value=!1};return(e,t)=>a.value.length>0?(M(),D(P(ue),{key:0,modelValue:a.value,"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),animation:150,"ghost-class":`ghost`,handle:`.x-handle`,onEnd:l,onMove:c,onStart:s},{default:Ft(()=>[(M(!0),O(mt,null,Dt(a.value,e=>(M(),D(Ki,{id:e.id,key:e.id,desc:e.desc,select:e.select,title:e.name,onXClick:u},null,8,[`id`,`desc`,`select`,`title`]))),128))]),_:1},8,[`modelValue`])):(M(),O(`span`,qi,At(P(n)(`x-block-lib.noOption`)),1))}}),[[`__scopeId`,`data-v-x-block-lib-ca7316a0`]]),Yi=gt({__name:`index`,props:{modelValue:{type:Boolean,required:!0},modelModifiers:{}},emits:[`update:modelValue`],setup(e,{expose:t}){let n=Mt(e,`modelValue`),r=Ri();t({update:()=>{if(!r.workspace){console.assert(!1);return}}});let i=e=>{let t=s();if(!t){console.assert(!1);return}let r=t.getBlockById(e);ke.setSelected(r),Ti(e),n.value=!1};return(e,t)=>(M(),O(`div`,{onClick:t[0]||(t[0]=e=>i(``))},`blockTree`))}});const Xi={class:`text-body-large`};var Zi=gt({__name:`index`,props:{type:{type:String,required:!0},lock:{type:Boolean,required:!0}},setup(e,{expose:t}){let{t:n}=zt(),r=Bt(),{sysBarAvail:i}=Ie(),{backgroundColor1:a}=Fe(),o=E(()=>r.smAndDown.value),s=E(()=>{let e=`100%`;return r.mdAndUp.value&&(e=`400px`),{background:a.value,width:e,height:`100%`}}),c=E(()=>{let e=48;return i.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),l=E(()=>({height:`60px`})),{open:u}=Le(`blocklyNavigatorDlg${jt()}`);wt(()=>{u.value=!1});let ee=Nt(`blockList`),te=Nt(`blockTree`);return t({open:u,update:()=>{e.type===`list`?ee.value?.update():e.type===`tree`&&te.value?.update()}}),(t,r)=>{let a=N(`v-sheet`),d=N(`v-btn`),f=N(`v-spacer`),ne=N(`v-dialog`),p=N(`v-tooltip`);return M(),O(mt,null,[A(ne,{modelValue:P(u),"onUpdate:modelValue":r[5]||(r[5]=e=>vt(u)?u.value=e:null),eager:``,fullscreen:``,"no-click-animation":``,persistent:``,transition:`scroll-x-reverse-transition`,onKeydown:r[6]||(r[6]=Lt(Rt(e=>u.value=!1,[`stop`,`prevent`]),[`esc`]))},{default:Ft(()=>[k(`div`,{class:`w-100 h-100 d-flex flex-row-reverse`,onClick:r[3]||(r[3]=Rt(e=>u.value=!1,[`self`])),onContextmenu:r[4]||(r[4]=Rt(e=>u.value=!1,[`self`,`prevent`]))},[k(`div`,{class:`elevation-2`,style:j(s.value)},[P(i)?(M(),D(a,{key:0,color:`transparent`,height:24})):ht(`v-if`,!0),A(a,{class:`d-flex align-center px-2`,color:`transparent`,height:48},{default:Ft(()=>[A(d,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:r[0]||(r[0]=e=>u.value=!1)}),k(`span`,Xi,At(P(n)(`x-block-lib.navigator`)),1),A(f)]),_:1}),k(`div`,{class:`overflow-y-auto`,style:j(c.value)},[e.type===`list`?(M(),D(Ji,{key:0,ref_key:`blockList`,ref:ee,modelValue:P(u),"onUpdate:modelValue":r[1]||(r[1]=e=>vt(u)?u.value=e:null),lock:e.lock},null,8,[`modelValue`,`lock`])):e.type===`tree`?(M(),D(Yi,{key:1,ref_key:`blockTree`,ref:te,modelValue:P(u),"onUpdate:modelValue":r[2]||(r[2]=e=>vt(u)?u.value=e:null)},null,8,[`modelValue`])):ht(`v-if`,!0),k(`div`,{style:j(l.value)},null,4)],4)],4)],32)]),_:1},8,[`modelValue`]),A(p,{disabled:o.value,text:P(n)(`x-block-lib.tip.hotkeyCtrlE`)},{activator:Ft(({props:e})=>[A(d,bt(e,{density:`comfortable`,icon:`mdi-navigation-variant`,variant:`outlined`,onClick:r[7]||(r[7]=e=>u.value=!0)}),null,16)]),_:1},8,[`disabled`,`text`])],64)}}}),Qi=ge();const Z=p.xml;function Q(e){let t=Z.createElement(`label`);return t.setAttribute(`text`,e),t}function $(e,t){let n=Z.createElement(`block`);if(n.setAttribute(`type`,e),t)for(let e of t)n.appendChild(e);return n}function $i(e){let t=Z.createElement(`mutation`);for(let{key:n,value:r}of e)t.setAttribute(n,r);return t}function ea(e,t){t===void 0&&(t=``);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`text_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`TEXT`);let a=Z.createTextNode(t);return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function ta(e,t){t===void 0&&(t=0);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`math_number_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`NUM`);let a=Z.createTextNode(String(t));return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function na(e,t){t===void 0&&(t=!1);let n=Z.createElement(`value`);n.setAttribute(`name`,e);let r=Z.createElement(`shadow`);r.setAttribute(`type`,`logic_boolean_v1`);let i=Z.createElement(`field`);i.setAttribute(`name`,`BOOL`);let a=Z.createTextNode(t?`TRUE`:`FALSE`);return i.appendChild(a),r.appendChild(i),n.appendChild(r),n}function ra(){let{activeObject:e,activeComp:t}=S.app;return!(e.type!==`comp`||!t.meta.states||t.meta.states.length<=0)}function ia(){let e=[];return e.push(Q(F(`LABEL_EVENT`))),U(`onEvent`)&&e.push($(`on_app_event_v1`)),U(`triggerEvent`)&&e.push($(`trigger_app_event_v1`)),e.push($(`app_bind_v1`,[$i([{key:`items`,value:`2`}])])),e.push($(`watch_effect_v1`)),(U(`getProperty`)||U(`setProperty`))&&e.push(Q(F(`LABEL_PROPERTY`))),U(`getProperty`)&&e.push($(`get_app_property_v1`)),U(`setProperty`)&&e.push($(`set_app_property_v1`)),ra()&&(e.push(Q(F(`LABEL_STATE`))),e.push($(`get_app_state_v1`)),e.push($(`set_app_state_v1`))),(U(`callMethod`)||U(`implementMethod`))&&e.push(Q(F(`LABEL_METHOD`))),U(`callMethod`)&&e.push($(`call_app_method_v1`)),U(`implementMethod`)&&(e.push($(`implement_app_method_v1`)),U(`implementMethodOutput`)&&e.push($(`set_app_method_output_v1`)),e.push($(`procedure_return_v1`))),e}const aa={name:`APP_COMP_CATEGORY`,callback:ia};function oa(){let e=[];return e.push(Q(F(`LABEL_FUNC`))),e.push(Q(F(`LABEL_FLOW`))),e}const sa={name:`APP_COMPUTE_CATEGORY`,callback:oa};function ca(){let e=[];return e.push($(`app_debug_trace_v1`,[ea(`OBJECT`)])),e.push($(`popup_message_v1`,[ea(`TEXT`)])),e.push($(`open_confirm_dlg_v1`)),e.push($(`open_prompt_dlg_v1`)),e}const la={name:`APP_MESSAGE_CATEGORY`,callback:ca};function ua(){for(let e of S.app.appList)if(e.pages.length>0)return!0;return!1}function da(){let e=[];return e.push($(`app_env_is_v1`)),ua()&&e.push($(`navigate_to_v1`)),e}const fa={name:`APP_MISC_CATEGORY`,callback:da};function pa(){let{activeObject:e,activePage:t}=S.app;return!(e.type!==`page`||!t.meta.states||t.meta.states.length<=0)}function ma(){let{activeObject:e,activePage:t}=S.app;return!(e.type!==`page`||!t.meta.arguments||t.meta.arguments.length<=0)}function ha(){let e=[];return e.push(Q(F(`LABEL_EVENT`))),U(`onEvent`)&&e.push($(`on_app_event_v1`)),e.push($(`app_bind_v1`,[$i([{key:`items`,value:`2`}])])),e.push($(`watch_effect_v1`)),(U(`getProperty`)||U(`setProperty`))&&e.push(Q(F(`LABEL_PROPERTY`))),U(`getProperty`)&&e.push($(`get_app_property_v1`)),U(`setProperty`)&&e.push($(`set_app_property_v1`)),pa()&&(e.push(Q(F(`LABEL_STATE`))),e.push($(`get_app_state_v1`)),e.push($(`set_app_state_v1`))),U(`callMethod`)&&(e.push(Q(F(`LABEL_METHOD`))),e.push($(`call_app_method_v1`))),ma()&&(e.push(Q(F(`LABEL_ARGUMENT`))),e.push($(`get_page_argument_v1`))),e}const ga={name:`APP_PAGE_CATEGORY`,callback:ha};function _a(){let e=[];return e.push(Q(F(`LABEL_RESOURCE`))),e.push($(`upload_resource_v1`)),e}const va={name:`APP_RESOURCE_CATEGORY`,callback:_a},ya=p.xml;function ba(){let e=[];{let t=ya.createElement(`label`);t.setAttribute(`text`,`%{BKY_LABEL_PROCEDURE}`),e.push(t)}{let t=ya.createElement(`block`);t.setAttribute(`type`,`procedure_def_v1`);{let e=ya.createElement(`field`);e.setAttribute(`name`,`NAME`);let n=ya.createTextNode(F(`PROCEDURE_DEFAULT_NAME`));e.appendChild(n),t.appendChild(e)}e.push(t)}{let t=ya.createElement(`block`);t.setAttribute(`type`,`procedure_return_v1`),e.push(t)}return e}const xa={name:`PROCEDURE_CATEGORY`,callback:ba},Sa=p.xml;function Ca(){let e=s(),t=[];{let e=Sa.createElement(`label`);e.setAttribute(`text`,`%{BKY_LABEL_VARIABLE}`),t.push(e)}{let n=document.createElement(`button`);n.setAttribute(`text`,`%{BKY_NEW_VARIABLE}`),n.setAttribute(`callbackKey`,`CREATE_VARIABLE`),e.registerButtonCallback(`CREATE_VARIABLE`,function(e){c.createVariableButtonHandler(e.getTargetWorkspace())}),t.push(n)}let n=e.getVariablesOfType(``);if(n.length<=0)return t;n.sort(c.compareByName);{let e=Sa.createElement(`label`);e.setAttribute(`text`,F(`LABEL_CREATED`)),t.push(e)}return n.forEach(e=>{{let n=Sa.createElement(`block`);n.setAttribute(`type`,`variable_get_v1`),n.appendChild(c.generateVariableFieldDom(e)),t.push(n)}{let n=Sa.createElement(`block`);n.setAttribute(`type`,`variable_set_v1`),n.appendChild(c.generateVariableFieldDom(e)),t.push(n)}}),t}const wa={name:`VARIABLE_CATEGORY`,callback:Ca};function Ta(){let e=[];if(Y().length>0)e.push(Q(F(`LABEL_OPERATION`))),e.push($(`add_data_v1`)),e.push($(`delete_data_v1`)),e.push($(`update_data_v1`)),e.push($(`query_data_v1`)),e.push($(`transaction_v1`)),e.push($(`interrupt_transaction_v1`,[ea(`VALUE`)])),e.push(Q(F(`LABEL_CONDITION`))),e.push($(`cond_logic_v1`)),e.push($(`cond_atomic_v1`,[ea(`VALUE`)])),e.push(Q(F(`LABEL_QUERY_EXTRA`))),e.push($(`query_extra_limit_v1`,[ta(`OFFSET`,0),ta(`LIMIT`,1)])),e.push($(`query_extra_sortby_v1`,[ea(`COLUMN`),na(`DESC`)]));else{let t=document.createElement(`button`);t.setAttribute(`text`,F(`BUTTON_NO_TABLE`)),t.setAttribute(`callbackKey`,`NO_TABLE`),e.push(t)}return e}const Ea={name:`COMPUTE_DATA_CATEGORY`,callback:Ta};function Da(){return Er(`flow`).length>0}function Oa(){let e=[];return S.compute.activeObject.type===`flow`&&e.push($(`on_flow_state_event_v1`)),Da()&&console.assert(!0),e}const ka={name:`COMPUTE_FLOW_CATEGORY`,callback:Oa};function Aa(){return Er(`func`).length>0}function ja(){let{activeObject:e,activeFunc:t}=S.compute,n=[];return e.type===`func`&&(n.push($(`func_entry_v1`)),t.outputs&&t.outputs.length>0&&n.push($(`set_func_output_v1`)),n.push($(`procedure_return_v1`))),Aa()&&n.push($(`call_func_internal_v1`)),n}const Ma={name:`COMPUTE_FUNC_CATEGORY`,callback:ja};function Na(){let e=[];return e.push($(`compute_debug_trace_v1`,[ea(`OBJECT`)])),e}const Pa={name:`COMPUTE_MISC_CATEGORY`,callback:Na},Fa={kind:`category`,name:`%{BKY_CATEGORY_COLOR}`,categorystyle:`color_category`,contents:[{kind:`block`,type:`color_picker_v1`},{kind:`block`,type:`color_random_v1`},{kind:`block`,type:`color_rgb_v1`,inputs:{RED:{shadow:{type:`math_number_v1`,fields:{NUM:0}}},GREEN:{shadow:{type:`math_number_v1`,fields:{NUM:0}}},BLUE:{shadow:{type:`math_number_v1`,fields:{NUM:0}}}}},{kind:`block`,type:`color_blend_v1`,inputs:{COLOR1:{shadow:{type:`color_picker_v1`,fields:{COLOR:`#ff0000`}}},COLOR2:{shadow:{type:`color_picker_v1`,fields:{COLOR:`#00ff00`}}},RATIO:{shadow:{type:`math_number_v1`,fields:{NUM:.5}}}}}]},Ia={kind:`category`,name:`%{BKY_CATEGORY_LIST}`,categorystyle:`list_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_LIST}`},{kind:`block`,type:`list_create_v1`,extraState:{itemCount:0}},{kind:`label`,text:`%{BKY_LABEL_GET}`},{kind:`block`,type:`list_is_empty_v1`},{kind:`block`,type:`list_length_v1`},{kind:`block`,type:`list_get_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_get_sublist_v1`,inputs:{START:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},END:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`label`,text:`%{BKY_LABEL_SET}`},{kind:`block`,type:`list_set_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_delete_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`list_join_v1`,inputs:{DELIM:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`list_reverse_v1`}]},La={kind:`category`,name:`%{BKY_CATEGORY_LOGIC}`,categorystyle:`logic_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_BOOLEAN}`},{kind:`block`,type:`logic_boolean_v1`},{kind:`label`,text:`%{BKY_LABEL_BRANCH}`},{kind:`block`,type:`logic_if_v1`},{kind:`label`,text:`%{BKY_LABEL_LOGIC_OPERATION}`},{kind:`block`,type:`logic_compare_v1`},{kind:`block`,type:`logic_operation_v1`},{kind:`block`,type:`logic_negate_v1`},{kind:`block`,type:`logic_ternary_v1`}]},Ra={kind:`category`,name:`%{BKY_CATEGORY_LOOP}`,categorystyle:`loop_category`,contents:[{kind:`block`,type:`repeat_v1`,inputs:{TIMES:{shadow:{type:`math_number_v1`,fields:{NUM:10}}}}},{kind:`block`,type:`while_until_v1`},{kind:`block`,type:`for_v1`,inputs:{FROM:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},TO:{shadow:{type:`math_number_v1`,fields:{NUM:10}}},BY:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`for_each_v1`},{kind:`block`,type:`flow_control_v1`}]},za={kind:`category`,name:`%{BKY_CATEGORY_MATH}`,categorystyle:`math_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_VALUE}`},{kind:`block`,type:`math_number_v1`,fields:{NUM:0}},{kind:`block`,type:`math_constant_v1`},{kind:`block`,type:`math_random_float_v1`},{kind:`block`,type:`math_random_int_v1`,inputs:{FROM:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},TO:{shadow:{type:`math_number_v1`,fields:{NUM:100}}}}},{kind:`label`,text:`%{BKY_LABEL_MATH_OPERATION}`},{kind:`block`,type:`math_arithmetic_v1`,inputs:{A:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},B:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`math_round_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:3.1}}}}},{kind:`block`,type:`math_single_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:9}}}}},{kind:`block`,type:`math_trig_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:45}}}}},{kind:`block`,type:`math_modulo_v1`,inputs:{DIVIDEND:{shadow:{type:`math_number_v1`,fields:{NUM:64}}},DIVISOR:{shadow:{type:`math_number_v1`,fields:{NUM:10}}}}},{kind:`block`,type:`math_number_property_v1`,inputs:{NUM:{shadow:{type:`math_number_v1`,fields:{NUM:2}}}}},{kind:`block`,type:`math_on_list_v1`}]},Ba={kind:`category`,name:`%{BKY_CATEGORY_OBJECT}`,categorystyle:`object_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_OBJECT}`},{kind:`block`,type:`object_create_v1`},{kind:`block`,type:`object_from_json_v1`},{kind:`block`,type:`object_to_json_v1`},{kind:`label`,text:`%{BKY_LABEL_PROPERTY}`},{kind:`block`,type:`object_get_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`object_set_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`object_delete_v1`,inputs:{KEY:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}}]},Va={kind:`category`,name:`%{BKY_CATEGORY_TEXT}`,categorystyle:`text_category`,contents:[{kind:`label`,text:`%{BKY_LABEL_TEXT}`},{kind:`block`,type:`text_v1`},{kind:`block`,type:`text_join_v1`,extraState:{itemCount:2}},{kind:`label`,text:`%{BKY_LABEL_GET}`},{kind:`block`,type:`text_is_empty_v1`},{kind:`block`,type:`text_length_v1`},{kind:`block`,type:`text_char_at_v1`,inputs:{AT:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`text_substring_v1`,inputs:{START:{shadow:{type:`math_number_v1`,fields:{NUM:1}}},END:{shadow:{type:`math_number_v1`,fields:{NUM:1}}}}},{kind:`block`,type:`text_index_of_v1`,inputs:{SUBSTR:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_count_v1`,inputs:{SUBSTR:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`label`,text:`%{BKY_LABEL_SET}`},{kind:`block`,type:`text_append_v1`,inputs:{TEXT:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_replace_v1`,inputs:{FROM:{shadow:{type:`text_v1`,fields:{TEXT:``}}},TO:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_split_v1`,inputs:{DELIM:{shadow:{type:`text_v1`,fields:{TEXT:``}}}}},{kind:`block`,type:`text_change_case_v1`},{kind:`block`,type:`text_trim_v1`},{kind:`block`,type:`text_reverse_v1`}]},Ha={kind:`category`,name:`%{BKY_CATEGORY_TIME}`,categorystyle:`time_category`,contents:[{kind:`block`,type:`create_timer_v1`},{kind:`block`,type:`delay_v1`,inputs:{DURATION:{shadow:{type:`math_number_v1`,fields:{NUM:1e3}}}}}]},Ua={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_COMP}`,categorystyle:`misc_category`,custom:aa.name},{kind:`category`,name:`%{BKY_CATEGORY_MESSAGE}`,categorystyle:`misc_category`,custom:la.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:fa.name},Ra,La,za,Va,Ia,Ba,Fa,Ha,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name},{kind:`category`,name:`%{BKY_CATEGORY_RESOURCE}`,categorystyle:`resource_category`,custom:va.name},{kind:`category`,name:`%{BKY_CATEGORY_COMPUTE}`,categorystyle:`compute_category`,custom:sa.name}]},Wa={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_FUNC}`,categorystyle:`func_category`,custom:Ma.name},{kind:`category`,name:`%{BKY_CATEGORY_FLOW}`,categorystyle:`flow_category`,custom:ka.name},{kind:`category`,name:`%{BKY_CATEGORY_DATA}`,categorystyle:`data_category`,custom:Ea.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:Pa.name},Ra,La,za,Va,Ia,Ba,Fa,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name}]},Ga={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_FUNC}`,categorystyle:`func_category`,custom:Ma.name},{kind:`category`,name:`%{BKY_CATEGORY_FLOW}`,categorystyle:`flow_category`,custom:ka.name},{kind:`category`,name:`%{BKY_CATEGORY_DATA}`,categorystyle:`data_category`,custom:Ea.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:Pa.name},Ra,La,za,Va,Ia,Ba,Fa,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name}]},Ka={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_JSON}`,colour:`330`,contents:[{kind:`block`,type:`json_map_v1`},{kind:`block`,type:`json_array_v1`},{kind:`block`,type:`json_string_v1`},{kind:`block`,type:`json_number_v1`},{kind:`block`,type:`json_boolean_v1`}]}]},qa={kind:`categoryToolbox`,contents:[{kind:`category`,name:`%{BKY_CATEGORY_PAGE}`,categorystyle:`misc_category`,custom:ga.name},{kind:`category`,name:`%{BKY_CATEGORY_MESSAGE}`,categorystyle:`misc_category`,custom:la.name},{kind:`category`,name:`%{BKY_CATEGORY_MISC}`,categorystyle:`misc_category`,custom:fa.name},Ra,La,za,Va,Ia,Ba,Fa,Ha,{kind:`category`,name:`%{BKY_CATEGORY_VARIABLE}`,categorystyle:`variable_category`,custom:wa.name},{kind:`category`,name:`%{BKY_CATEGORY_PROCEDURE}`,categorystyle:`procedure_category`,custom:xa.name},{kind:`category`,name:`%{BKY_CATEGORY_RESOURCE}`,categorystyle:`resource_category`,custom:va.name},{kind:`category`,name:`%{BKY_CATEGORY_COMPUTE}`,categorystyle:`compute_category`,custom:sa.name}]},Ja={grid:{length:2,snap:!0,spacing:20},maxInstances:{func_entry_v1:1},media:`/media/`,move:{drag:!0,scrollbars:!0,wheel:!0},readOnly:!1,theme:`light`,trashcan:!1,zoom:{maxScale:1,minScale:.1,scaleSpeed:1.25,startScale:1,wheel:!0}};function Ya(e,t,n,r){Ja.theme=r?`dark`:`light`,Ja.toolbox=Xa(t,n);let i=o(e,Ja);return i.addChangeListener(e=>{if(e.type===`state_change`){let e=i.getAllBlocks();for(let t of e){let e=t;e.checkWarning_&&e.checkWarning_()}}setTimeout(()=>{(0,Qi.shadowBlockConversionChangeListener)(e)},0)}),Za(i,t,n),Qa(i),i}function Xa(e,t){let n;return e===`page`?t===`v1`&&(n=qa):e===`comp`?t===`v1`&&(n=Ua):e===`func`?t===`v1`&&(n=Ga):e===`flow`?t===`v1`&&(n=Wa):e===`json`&&t===`v1`&&(n=Ka),console.assert(!!n,`invalid toolbox type=${e} version=${t}`),n}function Za(e,t,n){function r({name:n,callback:r}){e.registerToolboxCategoryCallback(n,()=>r(t))}t===`page`?n===`v1`&&(r(ga),r(la),r(fa),r(wa),r(xa),r(va),r(sa)):t===`comp`?n===`v1`&&(r(aa),r(la),r(fa),r(wa),r(xa),r(va),r(sa)):t===`func`?n===`v1`&&(r(Ma),r(ka),r(Ea),r(Pa),r(wa),r(xa)):t===`flow`&&n===`v1`&&(r(Ma),r(ka),r(Ea),r(Pa),r(wa),r(xa))}function Qa(e){let{router:t}=je;e.registerButtonCallback(`NO_COMPUTE`,()=>{let e=t.resolve({path:`/compute/`+Date.now()});setTimeout(()=>{window.open(e.href,`_blank`)},100)}),e.registerButtonCallback(`NO_TABLE`,()=>{let e=t.resolve({path:`/data/`+Date.now()});setTimeout(()=>{window.open(e.href,`_blank`)},100)})}const $a={class:`position-relative w-100 h-100`};var eo=gt({__name:`index`,props:yt({type:{type:String,required:!0},version:{type:String,required:!0},locale:{type:String,required:!0},dark:{type:Boolean,required:!0}},{lock:{type:Boolean,required:!0},lockModifiers:{},scale:{type:Number,required:!0},scaleModifiers:{}}),emits:yt([`ready`],[`update:lock`,`update:scale`]),setup(e,{expose:t,emit:n}){let{backgroundColor2:r}=Fe(),i=Mt(e,`lock`),a=Mt(e,`scale`),o=n,s=`blocklyEditor${jt()}`,c=Et(),u=Nt(`parentContainer`),ee=Nt(`clean`),te=Nt(`navigator`),d={};Li(d);let f=Et(!0),ne=Et(!1),p=E(()=>e.type===`json`?`tree`:`list`),re=E(()=>({width:`100%`,height:`calc(100% - 48px)`})),m=E(()=>({position:`absolute`,background:r.value,bottom:`0px`,width:`100%`,height:`48px`})),h=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`1px`,left:`0px`,width:`56px`,height:`calc(100% - 49px)`,zIndex:999})),ie=E(()=>({position:`absolute`,top:`0px`,right:`0px`,zIndex:20})),ae=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`0px`,left:`0px`,width:`100%`,height:`calc(100% - 48px)`,pointerEvents:`none`})),oe=E(()=>({position:`absolute`,background:e.dark?`#0000007f`:`#ffffff7f`,top:`1px`,left:`0px`,width:`56px`,height:`calc(100% - 49px)`,zIndex:999})),ce=E(()=>({position:`fixed`,top:0,left:0,zIndex:3e3})),{open:ue}=Le(`blocklyEditorFlyout${jt()}`);Ct(async()=>{if(!c.value||!u.value){console.assert(!1);return}se(u.value),await Vt(e.locale),d.workspace=Ya(c.value,e.type,e.version,e.dark),d.workspace.addChangeListener(x.disableOrphans),d.workspace.addChangeListener(de);let t=document.querySelector(`#${s} .blocklyFlyout`);new MutationObserver(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`style`&&(ue.value=d.workspace.getFlyout().isVisible())})}).observe(t,{attributes:!0}),ue.value=d.workspace.getFlyout().isVisible(),ge(),_e(),await xt(),o(`ready`)}),St(()=>{ue.value=!1}),Se(c,()=>{d.workspace&&le(d.workspace)});async function de(e){if(e.type===x.FINISHED_LOADING){Ei(),setTimeout(()=>{te.value?.update()},0),f.value=!1;return}if(!f.value){if(e.type===x.VIEWPORT_CHANGE){a.value=d.workspace.getScale();return}e.type===x.BLOCK_DRAG&&(e.isStart?ne.value=!0:ne.value=!1),setTimeout(()=>{te.value?.update()},0)}}let fe=t=>{f.value=!0,e.type===`json`?Bi(t,d.workspace):l.workspaces.load(t,d.workspace)},pe=()=>e.type===`json`?Vi(d.workspace):l.workspaces.save(d.workspace),me=e=>{l.blocks.append(e,d.workspace)},_=()=>{if(e.type===`json`)console.assert(!1);else return g.workspaceToCode(d.workspace)},he=()=>Fi(d.workspace),ge=()=>{d.workspace.setIsReadOnly(i.value),d.workspace.isReadOnly()&&(ue.value=!1)},_e=()=>{d.workspace.setScale(a.value)},ve=()=>{x.fire(new(x.get(`state_change`))(d.workspace))},ye=()=>{ee.value?.cleanWorkspace()},be=()=>{i.value=!i.value},xe=()=>{te.value&&(te.value.open=!0)};return Ct(()=>{Ae.on(`cleanWorkspace`,ye),Ae.on(`toggleBlocklyLock`,be),Ae.on(`openBlocklyNavigator`,xe)}),St(()=>{Ae.off(`cleanWorkspace`,ye),Ae.off(`toggleBlocklyLock`,be),Ae.off(`openBlocklyNavigator`,xe)}),Pt(()=>e.locale,e=>{Vt(e)}),Pt(()=>e.dark,e=>{ki(e?`dark`:`light`)}),Pt(ue,e=>{e||d.workspace?.hideChaff()}),Pt(i,()=>{ge()}),Pt(a,()=>{_e()}),t({loading:f,load:fe,save:pe,appendBlock:me,generateCode:_,generateReactivity:he,fireStateChange:ve}),(e,t)=>{let n=N(`v-icon`),r=N(`x-loading`);return M(),O(`div`,$a,[k(`div`,{id:s,ref_key:`blocklyDiv`,ref:c,style:j(re.value)},null,4),k(`div`,{style:j(m.value)},[Ot(e.$slots,`bottom`)],4),ne.value?(M(),O(`div`,{key:0,class:`d-flex flex-column justify-center align-center`,style:j(h.value)},[A(n,{icon:`mdi-delete`,size:`x-large`})],4)):ht(`v-if`,!0),f.value?ht(`v-if`,!0):(M(),O(`div`,{key:1,class:`d-flex align-end ga-3 pt-3 pr-3`,style:j(ie.value)},[A(zi,{ref_key:`clean`,ref:ee,lock:i.value},null,8,[`lock`]),A(Hi,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e)},null,8,[`modelValue`]),A(Zi,{ref_key:`navigator`,ref:te,lock:i.value,type:p.value},null,8,[`lock`,`type`])],4)),i.value?(M(),O(`div`,{key:2,style:j(oe.value)},null,4)):ht(`v-if`,!0),i.value?(M(),O(`div`,{key:3,style:j(ae.value)},null,4)):ht(`v-if`,!0),k(`div`,{ref_key:`parentContainer`,ref:u,style:j(ce.value)},null,4),A(r,{open:f.value,"z-index":99},null,8,[`open`])])}}}),to=gt({__name:`index`,props:{code:{type:String,required:!0}},setup(e){we.registerLanguage(`javascript`,Ee);let t=xe.component,{backgroundColor2:n}=Fe();return(r,i)=>{let a=N(`v-sheet`);return M(),D(a,{color:P(n),height:`100%`,width:`100%`},{default:Ft(()=>[A(P(t),{code:e.code,language:`js`},null,8,[`code`])]),_:1},8,[`color`])}}});const no={class:`text-body-large`},ro={class:`w-100 h-100 overflow-auto`};var io=gt({__name:`index`,setup(e){let{t}=zt(),{sysBarAvail:n}=Ie(),{backgroundColor0:r,backgroundColor2:i}=Fe(),a=Et(``),o=E(()=>{let e=48;return n.value&&(e+=24),{position:`relative`,height:`calc(100% - ${e}px)`}}),{open:s}=Le(`sourceDlg`,e=>{a.value=e.code});return(e,c)=>{let l=N(`v-sheet`),u=N(`v-btn`),ee=N(`v-spacer`),te=N(`v-dialog`);return M(),D(te,{modelValue:P(s),"onUpdate:modelValue":c[1]||(c[1]=e=>vt(s)?s.value=e:null),fullscreen:``,"no-click-animation":``,persistent:``,transition:`dialog-bottom-transition`,onKeydown:c[2]||(c[2]=Lt(Rt(e=>s.value=!1,[`stop`,`prevent`]),[`esc`]))},{default:Ft(()=>[A(l,{color:P(r),height:`100%`,width:`100%`},{default:Ft(()=>[P(n)?(M(),D(l,{key:0,color:P(i),height:24},null,8,[`color`])):ht(`v-if`,!0),A(l,{class:`d-flex align-center px-2`,color:P(i),height:48},{default:Ft(()=>[A(u,{density:`comfortable`,icon:`mdi-close`,variant:`text`,onClick:c[0]||(c[0]=e=>s.value=!1)}),k(`span`,no,At(P(t)(`x-block-lib.dlg.source.title`)),1),A(ee)]),_:1},8,[`color`]),k(`div`,{style:j(o.value)},[k(`div`,ro,[A(to,{code:a.value},null,8,[`code`])])],4)]),_:1},8,[`color`])]),_:1},8,[`modelValue`])}}});const ao=e=>{e.component(`XBlockly`,eo),e.component(`XSourceDlg`,io)};async function oo(e){if(e===`en`)return(await import(`./i18n-en.fzzizejc.js`).then(e=>e.t)).default;if(e===`zhHans`)return(await import(`./i18n-zhHans.b0wqxx8d.js`).then(e=>e.t)).default;throw Error(`invalid locale=${e}`)}var so={install:ao};export{eo as XBlockly,so as default,tr as getCallMethodInfo,ar as getImplementMethodInfo,W as getNodeInfo,Jn as getOnEventInfo,mr as getPropertyInfo,Zn as getTriggerEventInfo,ao as install,oo as loadLocaleMessageBlock};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n))
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{s as n,l as r,o as t};
|