diff --git a/Front/src/components/Pip.vue b/Front/src/components/Pip.vue index 558959c42a9fb6dd1e2a28ce5b9d330429d47ac3..1c10b12763470813d21fdfb31be2fb9d57a7f0a6 100644 --- a/Front/src/components/Pip.vue +++ b/Front/src/components/Pip.vue @@ -2,12 +2,24 @@ @@ -16,7 +28,12 @@ import { ref } from 'vue' const visible = ref(false) -const pipList = ref([]) +const pipList = ref([ + { Package: "pip", Version: "20.2.3" }, + { Package: "setuptools", Version: "49.2.1" } +]) +const packageName = ref('') +const installSource = ref('') function handlePipClick() { visible.value = true @@ -33,6 +50,29 @@ async function fetchPipList() { } } +async function handleInstall() { + try { + // 构造完整的 URL,将参数拼接到查询字符串中 + const url = new URL('/api/pipInstall', window.location.origin); + url.searchParams.append('packageName', packageName.value); + url.searchParams.append('installSource', installSource.value); + + // 发送 GET 请求 + const response = await fetch(url); + + // 检查响应状态 + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + // 解析响应数据 + const data = await response.json(); + console.log(data); + } catch (error) { + console.error('安装失败:', error); + } +} + defineExpose({ handlePipClick }) @@ -40,4 +80,4 @@ defineExpose({ handlePipClick }) #modal-content { -webkit-tap-highlight-color: transparent; } - + \ No newline at end of file diff --git a/README.md b/README.md index a1486f57708098f9aad21099b92a4f83b7ce873a..ed6a56f0152552d9f2fb03f23d36e474ced560bb 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,62 @@ # BlockPy -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +BlockPy 是一个基于 Python 的编程教育平台,旨在通过图形化编程界面帮助初学者学习编程。它提供了一个直观的界面,让用户可以通过拖放块来编写代码,从而逐步掌握编程的基本概念。 -#### 软件架构 -软件架构说明 +## 前置条件 +- Python 3.8 或更高版本 +- 一个支持 JavaScript 的现代浏览器 -#### 安装教程 +## 安装教程 -1. xxxx -2. xxxx -3. xxxx +1. 克隆仓库到本地: + ```bash + git clone https://gitee.com/codekpy/block-py.git + ``` -#### 使用说明 +2. 进入项目目录: + ```bash + cd block-py + ``` -1. xxxx -2. xxxx -3. xxxx +3. 安装依赖: + ```bash + pip install -r requirements.txt + ``` -#### 参与贡献 +4. 启动服务器: + ```bash + python main.py + ``` -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request +## 使用说明 +1. 打开浏览器,访问 `http://localhost:5000`。 +2. 在图形化界面中拖放块来编写代码。 +3. 点击运行按钮来执行代码。 -#### 特技 +## 构建方法 -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +1. 确保所有依赖都已安装。 +2. 使用以下命令构建项目: + ```bash + cd ./Front + npm install + npm run build + ``` + +## 许可证 + +本项目采用 AGPL 许可证。请查看 LICENSE 文件了解更多信息。 + +## 贡献 + +欢迎对本项目做出贡献。请遵循贡献指南,并在提交 Pull Request 之前确保代码风格和格式符合项目标准。 + +## 联系方式 + +如有任何问题或建议,请通过issue提交。 + +## 致谢 + +感谢所有为本项目做出贡献的开发者和用户。 diff --git a/dist/assets/index-8bf0eee1.js b/dist/assets/index-8bf0eee1.js new file mode 100644 index 0000000000000000000000000000000000000000..f9fb62660a3a3175578387143e0229262bae0018 --- /dev/null +++ b/dist/assets/index-8bf0eee1.js @@ -0,0 +1,1237 @@ +var d9=Object.defineProperty;var h9=(o,n,s)=>n in o?d9(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s;var J$=(o,n,s)=>(h9(o,typeof n!="symbol"?n+"":n,s),s);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))l(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function B0(o,n){const s=Object.create(null),l=o.split(",");for(let a=0;a!!s[a.toLowerCase()]:a=>!!s[a]}const Kt={},sl=[],Ls=()=>{},p9=()=>!1,$9=/^on[^a-z]/,Yu=o=>$9.test(o),F0=o=>o.startsWith("onUpdate:"),lo=Object.assign,U0=(o,n)=>{const s=o.indexOf(n);s>-1&&o.splice(s,1)},_9=Object.prototype.hasOwnProperty,Lt=(o,n)=>_9.call(o,n),lt=Array.isArray,il=o=>Ku(o)==="[object Map]",Wb=o=>Ku(o)==="[object Set]",gt=o=>typeof o=="function",to=o=>typeof o=="string",H0=o=>typeof o=="symbol",Yt=o=>o!==null&&typeof o=="object",zb=o=>Yt(o)&>(o.then)&>(o.catch),Xb=Object.prototype.toString,Ku=o=>Xb.call(o),g9=o=>Ku(o).slice(8,-1),jb=o=>Ku(o)==="[object Object]",V0=o=>to(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o,Su=B0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qu=o=>{const n=Object.create(null);return s=>n[s]||(n[s]=o(s))},f9=/-(\w)/g,ti=Qu(o=>o.replace(f9,(n,s)=>s?s.toUpperCase():"")),m9=/\B([A-Z])/g,$l=Qu(o=>o.replace(m9,"-$1").toLowerCase()),qu=Qu(o=>o.charAt(0).toUpperCase()+o.slice(1)),Z$=Qu(o=>o?`on${qu(o)}`:""),Rc=(o,n)=>!Object.is(o,n),e_=(o,n)=>{for(let s=0;s{Object.defineProperty(o,n,{configurable:!0,enumerable:!1,value:s})},T9=o=>{const n=parseFloat(o);return isNaN(n)?o:n},E9=o=>{const n=to(o)?Number(o):NaN;return isNaN(n)?o:n};let AE;const $0=()=>AE||(AE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(o){if(lt(o)){const n={};for(let s=0;s{if(s){const l=s.split(v9);l.length>1&&(n[l[0].trim()]=l[1].trim())}}),n}function Pe(o){let n="";if(to(o))n=o;else if(lt(o))for(let s=0;sto(o)?o:o==null?"":lt(o)||Yt(o)&&(o.toString===Xb||!gt(o.toString))?JSON.stringify(o,Kb,2):String(o),Kb=(o,n)=>n&&n.__v_isRef?Kb(o,n.value):il(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((s,[l,a])=>(s[`${l} =>`]=a,s),{})}:Wb(n)?{[`Set(${n.size})`]:[...n.values()]}:Yt(n)&&!lt(n)&&!jb(n)?String(n):n;let is;class Qb{constructor(n=!1){this.detached=n,this._active=!0,this.effects=[],this.cleanups=[],this.parent=is,!n&&is&&(this.index=(is.scopes||(is.scopes=[])).push(this)-1)}get active(){return this._active}run(n){if(this._active){const s=is;try{return is=this,n()}finally{is=s}}}on(){is=this}off(){is=this.parent}stop(n){if(this._active){let s,l;for(s=0,l=this.effects.length;s{const n=new Set(o);return n.w=0,n.n=0,n},Zb=o=>(o.w&an)>0,ev=o=>(o.n&an)>0,k9=({deps:o})=>{if(o.length)for(let n=0;n{const{deps:n}=o;if(n.length){let s=0;for(let l=0;l{(T==="length"||T>=p)&&h.push(f)})}else switch(s!==void 0&&h.push(d.get(s)),n){case"add":lt(o)?V0(s)&&h.push(d.get("length")):(h.push(d.get(Yn)),il(o)&&h.push(d.get(g0)));break;case"delete":lt(o)||(h.push(d.get(Yn)),il(o)&&h.push(d.get(g0)));break;case"set":il(o)&&h.push(d.get(Yn));break}if(h.length===1)h[0]&&f0(h[0]);else{const p=[];for(const f of h)f&&p.push(...f);f0(W0(p))}}function f0(o,n){const s=lt(o)?o:[...o];for(const l of s)l.computed&&NE(l);for(const l of s)l.computed||NE(l)}function NE(o,n){(o!==Rs||o.allowRecurse)&&(o.scheduler?o.scheduler():o.run())}function L9(o,n){var s;return(s=Fu.get(o))==null?void 0:s.get(n)}const N9=B0("__proto__,__v_isRef,__isVue"),sv=new Set(Object.getOwnPropertyNames(Symbol).filter(o=>o!=="arguments"&&o!=="caller").map(o=>Symbol[o]).filter(H0)),w9=X0(),M9=X0(!1,!0),D9=X0(!0),wE=P9();function P9(){const o={};return["includes","indexOf","lastIndexOf"].forEach(n=>{o[n]=function(...s){const l=Ct(this);for(let u=0,d=this.length;u{o[n]=function(...s){_l();const l=Ct(this)[n].apply(this,s);return gl(),l}}),o}function x9(o){const n=Ct(this);return Ko(n,"has",o),n.hasOwnProperty(o)}function X0(o=!1,n=!1){return function(l,a,u){if(a==="__v_isReactive")return!o;if(a==="__v_isReadonly")return o;if(a==="__v_isShallow")return n;if(a==="__v_raw"&&u===(o?n?Z9:cv:n?lv:rv).get(l))return l;const d=lt(l);if(!o){if(d&&Lt(wE,a))return Reflect.get(wE,a,u);if(a==="hasOwnProperty")return x9}const h=Reflect.get(l,a,u);return(H0(a)?sv.has(a):N9(a))||(o||Ko(l,"get",a),n)?h:eo(h)?d&&V0(a)?h:h.value:Yt(h)?o?K0(h):Jt(h):h}}const B9=iv(),F9=iv(!0);function iv(o=!1){return function(s,l,a,u){let d=s[l];if(cl(d)&&eo(d)&&!eo(a))return!1;if(!o&&(!Uu(a)&&!cl(a)&&(d=Ct(d),a=Ct(a)),!lt(s)&&eo(d)&&!eo(a)))return d.value=a,!0;const h=lt(s)&&V0(l)?Number(l)o,Ju=o=>Reflect.getPrototypeOf(o);function hu(o,n,s=!1,l=!1){o=o.__v_raw;const a=Ct(o),u=Ct(n);s||(n!==u&&Ko(a,"get",n),Ko(a,"get",u));const{has:d}=Ju(a),h=l?j0:s?q0:kc;if(d.call(a,n))return h(o.get(n));if(d.call(a,u))return h(o.get(u));o!==a&&o.get(n)}function pu(o,n=!1){const s=this.__v_raw,l=Ct(s),a=Ct(o);return n||(o!==a&&Ko(l,"has",o),Ko(l,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)}function $u(o,n=!1){return o=o.__v_raw,!n&&Ko(Ct(o),"iterate",Yn),Reflect.get(o,"size",o)}function ME(o){o=Ct(o);const n=Ct(this);return Ju(n).has.call(n,o)||(n.add(o),yi(n,"add",o,o)),this}function DE(o,n){n=Ct(n);const s=Ct(this),{has:l,get:a}=Ju(s);let u=l.call(s,o);u||(o=Ct(o),u=l.call(s,o));const d=a.call(s,o);return s.set(o,n),u?Rc(n,d)&&yi(s,"set",o,n):yi(s,"add",o,n),this}function PE(o){const n=Ct(this),{has:s,get:l}=Ju(n);let a=s.call(n,o);a||(o=Ct(o),a=s.call(n,o)),l&&l.call(n,o);const u=n.delete(o);return a&&yi(n,"delete",o,void 0),u}function xE(){const o=Ct(this),n=o.size!==0,s=o.clear();return n&&yi(o,"clear",void 0,void 0),s}function _u(o,n){return function(l,a){const u=this,d=u.__v_raw,h=Ct(d),p=n?j0:o?q0:kc;return!o&&Ko(h,"iterate",Yn),d.forEach((f,T)=>l.call(a,p(f),p(T),u))}}function gu(o,n,s){return function(...l){const a=this.__v_raw,u=Ct(a),d=il(u),h=o==="entries"||o===Symbol.iterator&&d,p=o==="keys"&&d,f=a[o](...l),T=s?j0:n?q0:kc;return!n&&Ko(u,"iterate",p?g0:Yn),{next(){const{value:y,done:S}=f.next();return S?{value:y,done:S}:{value:h?[T(y[0]),T(y[1])]:T(y),done:S}},[Symbol.iterator](){return this}}}}function qi(o){return function(...n){return o==="delete"?!1:this}}function z9(){const o={get(u){return hu(this,u)},get size(){return $u(this)},has:pu,add:ME,set:DE,delete:PE,clear:xE,forEach:_u(!1,!1)},n={get(u){return hu(this,u,!1,!0)},get size(){return $u(this)},has:pu,add:ME,set:DE,delete:PE,clear:xE,forEach:_u(!1,!0)},s={get(u){return hu(this,u,!0)},get size(){return $u(this,!0)},has(u){return pu.call(this,u,!0)},add:qi("add"),set:qi("set"),delete:qi("delete"),clear:qi("clear"),forEach:_u(!0,!1)},l={get(u){return hu(this,u,!0,!0)},get size(){return $u(this,!0)},has(u){return pu.call(this,u,!0)},add:qi("add"),set:qi("set"),delete:qi("delete"),clear:qi("clear"),forEach:_u(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=gu(u,!1,!1),s[u]=gu(u,!0,!1),n[u]=gu(u,!1,!0),l[u]=gu(u,!0,!0)}),[o,s,n,l]}const[X9,j9,Y9,K9]=z9();function Y0(o,n){const s=n?o?K9:Y9:o?j9:X9;return(l,a,u)=>a==="__v_isReactive"?!o:a==="__v_isReadonly"?o:a==="__v_raw"?l:Reflect.get(Lt(s,a)&&a in l?s:l,a,u)}const Q9={get:Y0(!1,!1)},q9={get:Y0(!1,!0)},J9={get:Y0(!0,!1)},rv=new WeakMap,lv=new WeakMap,cv=new WeakMap,Z9=new WeakMap;function eR(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function tR(o){return o.__v_skip||!Object.isExtensible(o)?0:eR(g9(o))}function Jt(o){return cl(o)?o:Q0(o,!1,nv,Q9,rv)}function oR(o){return Q0(o,!1,W9,q9,lv)}function K0(o){return Q0(o,!0,G9,J9,cv)}function Q0(o,n,s,l,a){if(!Yt(o)||o.__v_raw&&!(n&&o.__v_isReactive))return o;const u=a.get(o);if(u)return u;const d=tR(o);if(d===0)return o;const h=new Proxy(o,d===2?l:s);return a.set(o,h),h}function rn(o){return cl(o)?rn(o.__v_raw):!!(o&&o.__v_isReactive)}function cl(o){return!!(o&&o.__v_isReadonly)}function Uu(o){return!!(o&&o.__v_isShallow)}function av(o){return rn(o)||cl(o)}function Ct(o){const n=o&&o.__v_raw;return n?Ct(n):o}function Zu(o){return Bu(o,"__v_skip",!0),o}const kc=o=>Yt(o)?Jt(o):o,q0=o=>Yt(o)?K0(o):o;function uv(o){nn&&Rs&&(o=Ct(o),ov(o.dep||(o.dep=W0())))}function dv(o,n){o=Ct(o);const s=o.dep;s&&f0(s)}function eo(o){return!!(o&&o.__v_isRef===!0)}function ge(o){return hv(o,!1)}function BE(o){return hv(o,!0)}function hv(o,n){return eo(o)?o:new sR(o,n)}class sR{constructor(n,s){this.__v_isShallow=s,this.dep=void 0,this.__v_isRef=!0,this._rawValue=s?n:Ct(n),this._value=s?n:kc(n)}get value(){return uv(this),this._value}set value(n){const s=this.__v_isShallow||Uu(n)||cl(n);n=s?n:Ct(n),Rc(n,this._rawValue)&&(this._rawValue=n,this._value=s?n:kc(n),dv(this))}}function Xo(o){return eo(o)?o.value:o}const iR={get:(o,n,s)=>Xo(Reflect.get(o,n,s)),set:(o,n,s,l)=>{const a=o[n];return eo(a)&&!eo(s)?(a.value=s,!0):Reflect.set(o,n,s,l)}};function pv(o){return rn(o)?o:new Proxy(o,iR)}function Pt(o){const n=lt(o)?new Array(o.length):{};for(const s in o)n[s]=$v(o,s);return n}class nR{constructor(n,s,l){this._object=n,this._key=s,this._defaultValue=l,this.__v_isRef=!0}get value(){const n=this._object[this._key];return n===void 0?this._defaultValue:n}set value(n){this._object[this._key]=n}get dep(){return L9(Ct(this._object),this._key)}}class rR{constructor(n){this._getter=n,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function m0(o,n,s){return eo(o)?o:gt(o)?new rR(o):Yt(o)&&arguments.length>1?$v(o,n,s):ge(o)}function $v(o,n,s){const l=o[n];return eo(l)?l:new nR(o,n,s)}class lR{constructor(n,s,l,a){this._setter=s,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new z0(n,()=>{this._dirty||(this._dirty=!0,dv(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!a,this.__v_isReadonly=l}get value(){const n=Ct(this);return uv(n),(n._dirty||!n._cacheable)&&(n._dirty=!1,n._value=n.effect.run()),n._value}set value(n){this._setter(n)}}function cR(o,n,s=!1){let l,a;const u=gt(o);return u?(l=o,a=Ls):(l=o.get,a=o.set),new lR(l,a,u||!a,s)}function ln(o,n,s,l){let a;try{a=l?o(...l):o()}catch(u){ed(u,n,s)}return a}function _s(o,n,s,l){if(gt(o)){const u=ln(o,n,s,l);return u&&zb(u)&&u.catch(d=>{ed(d,n,s)}),u}const a=[];for(let u=0;u>>1;Lc(Ro[l])ei&&Ro.splice(n,1)}function hR(o){lt(o)?nl.push(...o):(!Oi||!Oi.includes(o,o.allowRecurse?Wn+1:Wn))&&nl.push(o),gv()}function FE(o,n=Ac?ei+1:0){for(;nLc(s)-Lc(l)),Wn=0;Wno.id==null?1/0:o.id,pR=(o,n)=>{const s=Lc(o)-Lc(n);if(s===0){if(o.pre&&!n.pre)return-1;if(n.pre&&!o.pre)return 1}return s};function mv(o){T0=!1,Ac=!0,Ro.sort(pR);const n=Ls;try{for(ei=0;eito(P)?P.trim():P)),y&&(a=s.map(T9))}let h,p=l[h=Z$(n)]||l[h=Z$(ti(n))];!p&&u&&(p=l[h=Z$($l(n))]),p&&_s(p,o,6,a);const f=l[h+"Once"];if(f){if(!o.emitted)o.emitted={};else if(o.emitted[h])return;o.emitted[h]=!0,_s(f,o,6,a)}}function Tv(o,n,s=!1){const l=n.emitsCache,a=l.get(o);if(a!==void 0)return a;const u=o.emits;let d={},h=!1;if(!gt(o)){const p=f=>{const T=Tv(f,n,!0);T&&(h=!0,lo(d,T))};!s&&n.mixins.length&&n.mixins.forEach(p),o.extends&&p(o.extends),o.mixins&&o.mixins.forEach(p)}return!u&&!h?(Yt(o)&&l.set(o,null),null):(lt(u)?u.forEach(p=>d[p]=null):lo(d,u),Yt(o)&&l.set(o,d),d)}function td(o,n){return!o||!Yu(n)?!1:(n=n.slice(2).replace(/Once$/,""),Lt(o,n[0].toLowerCase()+n.slice(1))||Lt(o,$l(n))||Lt(o,n))}let mo=null,Ev=null;function Hu(o){const n=mo;return mo=o,Ev=o&&o.type.__scopeId||null,n}function De(o,n=mo,s){if(!n||o._n)return o;const l=(...a)=>{l._d&&JE(-1);const u=Hu(n);let d;try{d=o(...a)}finally{Hu(u),l._d&&JE(1)}return d};return l._n=!0,l._c=!0,l._d=!0,l}function t_(o){const{type:n,vnode:s,proxy:l,withProxy:a,props:u,propsOptions:[d],slots:h,attrs:p,emit:f,render:T,renderCache:y,data:S,setupState:P,ctx:x,inheritAttrs:G}=o;let oe,ne;const Z=Hu(o);try{if(s.shapeFlag&4){const M=a||l;oe=Js(T.call(M,M,y,u,P,S,x)),ne=p}else{const M=n;oe=Js(M.length>1?M(u,{attrs:p,slots:h,emit:f}):M(u,null)),ne=n.props?p:_R(p)}}catch(M){Oc.length=0,ed(M,o,1),oe=Q(ns)}let Y=oe;if(ne&&G!==!1){const M=Object.keys(ne),{shapeFlag:L}=Y;M.length&&L&7&&(d&&M.some(F0)&&(ne=gR(ne,d)),Y=gs(Y,ne))}return s.dirs&&(Y=gs(Y),Y.dirs=Y.dirs?Y.dirs.concat(s.dirs):s.dirs),s.transition&&(Y.transition=s.transition),oe=Y,Hu(Z),oe}const _R=o=>{let n;for(const s in o)(s==="class"||s==="style"||Yu(s))&&((n||(n={}))[s]=o[s]);return n},gR=(o,n)=>{const s={};for(const l in o)(!F0(l)||!(l.slice(9)in n))&&(s[l]=o[l]);return s};function fR(o,n,s){const{props:l,children:a,component:u}=o,{props:d,children:h,patchFlag:p}=n,f=u.emitsOptions;if(n.dirs||n.transition)return!0;if(s&&p>=0){if(p&1024)return!0;if(p&16)return l?UE(l,d,f):!!d;if(p&8){const T=n.dynamicProps;for(let y=0;yo.__isSuspense;function ER(o,n){n&&n.pendingBranch?lt(o)?n.effects.push(...o):n.effects.push(o):hR(o)}function eg(o,n){return tg(o,null,n)}const fu={};function Et(o,n,s){return tg(o,n,s)}function tg(o,n,{immediate:s,deep:l,flush:a,onTrack:u,onTrigger:d}=Kt){var h;const p=G0()===((h=_o)==null?void 0:h.scope)?_o:null;let f,T=!1,y=!1;if(eo(o)?(f=()=>o.value,T=Uu(o)):rn(o)?(f=()=>o,l=!0):lt(o)?(y=!0,T=o.some(M=>rn(M)||Uu(M)),f=()=>o.map(M=>{if(eo(M))return M.value;if(rn(M))return jn(M);if(gt(M))return ln(M,p,2)})):gt(o)?n?f=()=>ln(o,p,2):f=()=>{if(!(p&&p.isUnmounted))return S&&S(),_s(o,p,3,[P])}:f=Ls,n&&l){const M=f;f=()=>jn(M())}let S,P=M=>{S=Z.onStop=()=>{ln(M,p,4)}},x;if(Pc)if(P=Ls,n?s&&_s(n,p,3,[f(),y?[]:void 0,P]):f(),a==="sync"){const M=d3();x=M.__watcherHandles||(M.__watcherHandles=[])}else return Ls;let G=y?new Array(o.length).fill(fu):fu;const oe=()=>{if(Z.active)if(n){const M=Z.run();(l||T||(y?M.some((L,R)=>Rc(L,G[R])):Rc(M,G)))&&(S&&S(),_s(n,p,3,[M,G===fu?void 0:y&&G[0]===fu?[]:G,P]),G=M)}else Z.run()};oe.allowRecurse=!!n;let ne;a==="sync"?ne=oe:a==="post"?ne=()=>zo(oe,p&&p.suspense):(oe.pre=!0,p&&(oe.id=p.uid),ne=()=>Z0(oe));const Z=new z0(f,ne);n?s?oe():G=Z.run():a==="post"?zo(Z.run.bind(Z),p&&p.suspense):Z.run();const Y=()=>{Z.stop(),p&&p.scope&&U0(p.scope.effects,Z)};return x&&x.push(Y),Y}function bR(o,n,s){const l=this.proxy,a=to(o)?o.includes(".")?bv(l,o):()=>l[o]:o.bind(l,l);let u;gt(n)?u=n:(u=n.handler,s=n);const d=_o;ul(this);const h=tg(a,u.bind(l),s);return d?ul(d):Qn(),h}function bv(o,n){const s=n.split(".");return()=>{let l=o;for(let a=0;a{jn(s,n)});else if(jb(o))for(const s in o)jn(o[s],n);return o}function Kn(o,n){const s=mo;if(s===null)return o;const l=cd(s)||s.proxy,a=o.dirs||(o.dirs=[]);for(let u=0;u{o.isMounted=!0}),Ri(()=>{o.isUnmounting=!0}),o}const $s=[Function,Array],Iv={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$s,onEnter:$s,onAfterEnter:$s,onEnterCancelled:$s,onBeforeLeave:$s,onLeave:$s,onAfterLeave:$s,onLeaveCancelled:$s,onBeforeAppear:$s,onAppear:$s,onAfterAppear:$s,onAppearCancelled:$s},vR={name:"BaseTransition",props:Iv,setup(o,{slots:n}){const s=ml(),l=vv();let a;return()=>{const u=n.default&&og(n.default(),!0);if(!u||!u.length)return;let d=u[0];if(u.length>1){for(const G of u)if(G.type!==ns){d=G;break}}const h=Ct(o),{mode:p}=h;if(l.isLeaving)return o_(d);const f=HE(d);if(!f)return o_(d);const T=Nc(f,h,l,s);wc(f,T);const y=s.subTree,S=y&&HE(y);let P=!1;const{getTransitionKey:x}=f.type;if(x){const G=x();a===void 0?a=G:G!==a&&(a=G,P=!0)}if(S&&S.type!==ns&&(!zn(f,S)||P)){const G=Nc(S,h,l,s);if(wc(S,G),p==="out-in")return l.isLeaving=!0,G.afterLeave=()=>{l.isLeaving=!1,s.update.active!==!1&&s.update()},o_(d);p==="in-out"&&f.type!==ns&&(G.delayLeave=(oe,ne,Z)=>{const Y=Ov(l,S);Y[String(S.key)]=S,oe._leaveCb=()=>{ne(),oe._leaveCb=void 0,delete T.delayedLeave},T.delayedLeave=Z})}return d}}},IR=vR;function Ov(o,n){const{leavingVNodes:s}=o;let l=s.get(n.type);return l||(l=Object.create(null),s.set(n.type,l)),l}function Nc(o,n,s,l){const{appear:a,mode:u,persisted:d=!1,onBeforeEnter:h,onEnter:p,onAfterEnter:f,onEnterCancelled:T,onBeforeLeave:y,onLeave:S,onAfterLeave:P,onLeaveCancelled:x,onBeforeAppear:G,onAppear:oe,onAfterAppear:ne,onAppearCancelled:Z}=n,Y=String(o.key),M=Ov(s,o),L=(z,X)=>{z&&_s(z,l,9,X)},R=(z,X)=>{const le=X[1];L(z,X),lt(z)?z.every($e=>$e.length<=1)&&le():z.length<=1&&le()},F={mode:u,persisted:d,beforeEnter(z){let X=h;if(!s.isMounted)if(a)X=G||h;else return;z._leaveCb&&z._leaveCb(!0);const le=M[Y];le&&zn(o,le)&&le.el._leaveCb&&le.el._leaveCb(),L(X,[z])},enter(z){let X=p,le=f,$e=T;if(!s.isMounted)if(a)X=oe||p,le=ne||f,$e=Z||T;else return;let he=!1;const fe=z._enterCb=ke=>{he||(he=!0,ke?L($e,[z]):L(le,[z]),F.delayedLeave&&F.delayedLeave(),z._enterCb=void 0)};X?R(X,[z,fe]):fe()},leave(z,X){const le=String(o.key);if(z._enterCb&&z._enterCb(!0),s.isUnmounting)return X();L(y,[z]);let $e=!1;const he=z._leaveCb=fe=>{$e||($e=!0,X(),fe?L(x,[z]):L(P,[z]),z._leaveCb=void 0,M[le]===o&&delete M[le])};M[le]=o,S?R(S,[z,he]):he()},clone(z){return Nc(z,n,s,l)}};return F}function o_(o){if(od(o))return o=gs(o),o.children=null,o}function HE(o){return od(o)?o.children?o.children[0]:void 0:o}function wc(o,n){o.shapeFlag&6&&o.component?wc(o.component.subTree,n):o.shapeFlag&128?(o.ssContent.transition=n.clone(o.ssContent),o.ssFallback.transition=n.clone(o.ssFallback)):o.transition=n}function og(o,n=!1,s){let l=[],a=0;for(let u=0;u1)for(let u=0;ulo({name:o.name},n,{setup:o}))():o}const bc=o=>!!o.type.__asyncLoader,od=o=>o.type.__isKeepAlive;function OR(o,n){yv(o,"a",n)}function Cv(o,n){yv(o,"da",n)}function yv(o,n,s=_o){const l=o.__wdc||(o.__wdc=()=>{let a=s;for(;a;){if(a.isDeactivated)return;a=a.parent}return o()});if(sd(n,l,s),s){let a=s.parent;for(;a&&a.parent;)od(a.parent.vnode)&&CR(l,n,s,a),a=a.parent}}function CR(o,n,s,l){const a=sd(n,o,l,!0);Uc(()=>{U0(l[n],a)},s)}function sd(o,n,s=_o,l=!1){if(s){const a=s[o]||(s[o]=[]),u=n.__weh||(n.__weh=(...d)=>{if(s.isUnmounted)return;_l(),ul(s);const h=_s(n,s,o,d);return Qn(),gl(),h});return l?a.unshift(u):a.push(u),u}}const Si=o=>(n,s=_o)=>(!Pc||o==="sp")&&sd(o,(...l)=>n(...l),s),yR=Si("bm"),zt=Si("m"),SR=Si("bu"),fl=Si("u"),Ri=Si("bum"),Uc=Si("um"),RR=Si("sp"),kR=Si("rtg"),AR=Si("rtc");function LR(o,n=_o){sd("ec",o,n)}const sg="components";function _t(o,n){return Rv(sg,o,!0,n)||o}const Sv=Symbol.for("v-ndc");function cn(o){return to(o)?Rv(sg,o,!1)||o:o||Sv}function Rv(o,n,s=!0,l=!1){const a=mo||_o;if(a){const u=a.type;if(o===sg){const h=c3(u,!1);if(h&&(h===n||h===ti(n)||h===qu(ti(n))))return u}const d=VE(a[o]||u[o],n)||VE(a.appContext[o],n);return!d&&l?u:d}}function VE(o,n){return o&&(o[n]||o[ti(n)]||o[qu(ti(n))])}function id(o,n,s,l){let a;const u=s&&s[l];if(lt(o)||to(o)){a=new Array(o.length);for(let d=0,h=o.length;dn(d,h,void 0,u&&u[h]));else{const d=Object.keys(o);a=new Array(d.length);for(let h=0,p=d.length;h{const u=l.fn(...a);return u&&(u.key=l.key),u}:l.fn)}return o}function ct(o,n,s={},l,a){if(mo.isCE||mo.parent&&bc(mo.parent)&&mo.parent.isCE)return n!=="default"&&(s.name=n),Q("slot",s,l&&l());let u=o[n];u&&u._c&&(u._d=!1),me();const d=u&&Av(u(s)),h=it(Wt,{key:s.key||d&&d.key||`_${n}`},d||(l?l():[]),d&&o._===1?64:-2);return!a&&h.scopeId&&(h.slotScopeIds=[h.scopeId+"-s"]),u&&u._c&&(u._d=!0),h}function Av(o){return o.some(n=>al(n)?!(n.type===ns||n.type===Wt&&!Av(n.children)):!0)?o:null}const E0=o=>o?Hv(o)?cd(o)||o.proxy:E0(o.parent):null,vc=lo(Object.create(null),{$:o=>o,$el:o=>o.vnode.el,$data:o=>o.data,$props:o=>o.props,$attrs:o=>o.attrs,$slots:o=>o.slots,$refs:o=>o.refs,$parent:o=>E0(o.parent),$root:o=>E0(o.root),$emit:o=>o.emit,$options:o=>ig(o),$forceUpdate:o=>o.f||(o.f=()=>Z0(o.update)),$nextTick:o=>o.n||(o.n=Io.bind(o.proxy)),$watch:o=>bR.bind(o)}),s_=(o,n)=>o!==Kt&&!o.__isScriptSetup&&Lt(o,n),NR={get({_:o},n){const{ctx:s,setupState:l,data:a,props:u,accessCache:d,type:h,appContext:p}=o;let f;if(n[0]!=="$"){const P=d[n];if(P!==void 0)switch(P){case 1:return l[n];case 2:return a[n];case 4:return s[n];case 3:return u[n]}else{if(s_(l,n))return d[n]=1,l[n];if(a!==Kt&&Lt(a,n))return d[n]=2,a[n];if((f=o.propsOptions[0])&&Lt(f,n))return d[n]=3,u[n];if(s!==Kt&&Lt(s,n))return d[n]=4,s[n];b0&&(d[n]=0)}}const T=vc[n];let y,S;if(T)return n==="$attrs"&&Ko(o,"get",n),T(o);if((y=h.__cssModules)&&(y=y[n]))return y;if(s!==Kt&&Lt(s,n))return d[n]=4,s[n];if(S=p.config.globalProperties,Lt(S,n))return S[n]},set({_:o},n,s){const{data:l,setupState:a,ctx:u}=o;return s_(a,n)?(a[n]=s,!0):l!==Kt&&Lt(l,n)?(l[n]=s,!0):Lt(o.props,n)||n[0]==="$"&&n.slice(1)in o?!1:(u[n]=s,!0)},has({_:{data:o,setupState:n,accessCache:s,ctx:l,appContext:a,propsOptions:u}},d){let h;return!!s[d]||o!==Kt&&Lt(o,d)||s_(n,d)||(h=u[0])&&Lt(h,d)||Lt(l,d)||Lt(vc,d)||Lt(a.config.globalProperties,d)},defineProperty(o,n,s){return s.get!=null?o._.accessCache[n]=0:Lt(s,"value")&&this.set(o,n,s.value,null),Reflect.defineProperty(o,n,s)}};function GE(o){return lt(o)?o.reduce((n,s)=>(n[s]=null,n),{}):o}let b0=!0;function wR(o){const n=ig(o),s=o.proxy,l=o.ctx;b0=!1,n.beforeCreate&&WE(n.beforeCreate,o,"bc");const{data:a,computed:u,methods:d,watch:h,provide:p,inject:f,created:T,beforeMount:y,mounted:S,beforeUpdate:P,updated:x,activated:G,deactivated:oe,beforeDestroy:ne,beforeUnmount:Z,destroyed:Y,unmounted:M,render:L,renderTracked:R,renderTriggered:F,errorCaptured:z,serverPrefetch:X,expose:le,inheritAttrs:$e,components:he,directives:fe,filters:ke}=n;if(f&&MR(f,l,null),d)for(const D in d){const B=d[D];gt(B)&&(l[D]=B.bind(s))}if(a){const D=a.call(s,s);Yt(D)&&(o.data=Jt(D))}if(b0=!0,u)for(const D in u){const B=u[D],ae=gt(B)?B.bind(s,s):gt(B.get)?B.get.bind(s,s):Ls,_e=!gt(B)&>(B.set)?B.set.bind(s):Ls,Me=j({get:ae,set:_e});Object.defineProperty(l,D,{enumerable:!0,configurable:!0,get:()=>Me.value,set:Xe=>Me.value=Xe})}if(h)for(const D in h)Lv(h[D],l,s,D);if(p){const D=gt(p)?p.call(s):p;Reflect.ownKeys(D).forEach(B=>{hn(B,D[B])})}T&&WE(T,o,"c");function Ie(D,B){lt(B)?B.forEach(ae=>D(ae.bind(s))):B&&D(B.bind(s))}if(Ie(yR,y),Ie(zt,S),Ie(SR,P),Ie(fl,x),Ie(OR,G),Ie(Cv,oe),Ie(LR,z),Ie(AR,R),Ie(kR,F),Ie(Ri,Z),Ie(Uc,M),Ie(RR,X),lt(le))if(le.length){const D=o.exposed||(o.exposed={});le.forEach(B=>{Object.defineProperty(D,B,{get:()=>s[B],set:ae=>s[B]=ae})})}else o.exposed||(o.exposed={});L&&o.render===Ls&&(o.render=L),$e!=null&&(o.inheritAttrs=$e),he&&(o.components=he),fe&&(o.directives=fe)}function MR(o,n,s=Ls){lt(o)&&(o=v0(o));for(const l in o){const a=o[l];let u;Yt(a)?"default"in a?u=ho(a.from||l,a.default,!0):u=ho(a.from||l):u=ho(a),eo(u)?Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get:()=>u.value,set:d=>u.value=d}):n[l]=u}}function WE(o,n,s){_s(lt(o)?o.map(l=>l.bind(n.proxy)):o.bind(n.proxy),n,s)}function Lv(o,n,s,l){const a=l.includes(".")?bv(s,l):()=>s[l];if(to(o)){const u=n[o];gt(u)&&Et(a,u)}else if(gt(o))Et(a,o.bind(s));else if(Yt(o))if(lt(o))o.forEach(u=>Lv(u,n,s,l));else{const u=gt(o.handler)?o.handler.bind(s):n[o.handler];gt(u)&&Et(a,u,o)}}function ig(o){const n=o.type,{mixins:s,extends:l}=n,{mixins:a,optionsCache:u,config:{optionMergeStrategies:d}}=o.appContext,h=u.get(n);let p;return h?p=h:!a.length&&!s&&!l?p=n:(p={},a.length&&a.forEach(f=>Vu(p,f,d,!0)),Vu(p,n,d)),Yt(n)&&u.set(n,p),p}function Vu(o,n,s,l=!1){const{mixins:a,extends:u}=n;u&&Vu(o,u,s,!0),a&&a.forEach(d=>Vu(o,d,s,!0));for(const d in n)if(!(l&&d==="expose")){const h=DR[d]||s&&s[d];o[d]=h?h(o[d],n[d]):n[d]}return o}const DR={data:zE,props:XE,emits:XE,methods:mc,computed:mc,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:mc,directives:mc,watch:xR,provide:zE,inject:PR};function zE(o,n){return n?o?function(){return lo(gt(o)?o.call(this,this):o,gt(n)?n.call(this,this):n)}:n:o}function PR(o,n){return mc(v0(o),v0(n))}function v0(o){if(lt(o)){const n={};for(let s=0;s1)return s&>(n)?n.call(l&&l.proxy):n}}function UR(){return!!(_o||mo||Mc)}function HR(o,n,s,l=!1){const a={},u={};Bu(u,rd,1),o.propsDefaults=Object.create(null),wv(o,n,a,u);for(const d in o.propsOptions[0])d in a||(a[d]=void 0);s?o.props=l?a:oR(a):o.type.props?o.props=a:o.props=u,o.attrs=u}function VR(o,n,s,l){const{props:a,attrs:u,vnode:{patchFlag:d}}=o,h=Ct(a),[p]=o.propsOptions;let f=!1;if((l||d>0)&&!(d&16)){if(d&8){const T=o.vnode.dynamicProps;for(let y=0;y{p=!0;const[S,P]=Mv(y,n,!0);lo(d,S),P&&h.push(...P)};!s&&n.mixins.length&&n.mixins.forEach(T),o.extends&&T(o.extends),o.mixins&&o.mixins.forEach(T)}if(!u&&!p)return Yt(o)&&l.set(o,sl),sl;if(lt(u))for(let T=0;T-1,P[1]=G<0||x-1||Lt(P,"default"))&&h.push(y)}}}const f=[d,h];return Yt(o)&&l.set(o,f),f}function jE(o){return o[0]!=="$"}function YE(o){const n=o&&o.toString().match(/^\s*(function|class) (\w+)/);return n?n[2]:o===null?"null":""}function KE(o,n){return YE(o)===YE(n)}function QE(o,n){return lt(n)?n.findIndex(s=>KE(s,o)):gt(n)&&KE(n,o)?0:-1}const Dv=o=>o[0]==="_"||o==="$stable",ng=o=>lt(o)?o.map(Js):[Js(o)],GR=(o,n,s)=>{if(n._n)return n;const l=De((...a)=>ng(n(...a)),s);return l._c=!1,l},Pv=(o,n,s)=>{const l=o._ctx;for(const a in o){if(Dv(a))continue;const u=o[a];if(gt(u))n[a]=GR(a,u,l);else if(u!=null){const d=ng(u);n[a]=()=>d}}},xv=(o,n)=>{const s=ng(n);o.slots.default=()=>s},WR=(o,n)=>{if(o.vnode.shapeFlag&32){const s=n._;s?(o.slots=Ct(n),Bu(n,"_",s)):Pv(n,o.slots={})}else o.slots={},n&&xv(o,n);Bu(o.slots,rd,1)},zR=(o,n,s)=>{const{vnode:l,slots:a}=o;let u=!0,d=Kt;if(l.shapeFlag&32){const h=n._;h?s&&h===1?u=!1:(lo(a,n),!s&&h===1&&delete a._):(u=!n.$stable,Pv(n,a)),d=n}else n&&(xv(o,n),d={default:1});if(u)for(const h in a)!Dv(h)&&!(h in d)&&delete a[h]};function O0(o,n,s,l,a=!1){if(lt(o)){o.forEach((S,P)=>O0(S,n&&(lt(n)?n[P]:n),s,l,a));return}if(bc(l)&&!a)return;const u=l.shapeFlag&4?cd(l.component)||l.component.proxy:l.el,d=a?null:u,{i:h,r:p}=o,f=n&&n.r,T=h.refs===Kt?h.refs={}:h.refs,y=h.setupState;if(f!=null&&f!==p&&(to(f)?(T[f]=null,Lt(y,f)&&(y[f]=null)):eo(f)&&(f.value=null)),gt(p))ln(p,h,12,[d,T]);else{const S=to(p),P=eo(p);if(S||P){const x=()=>{if(o.f){const G=S?Lt(y,p)?y[p]:T[p]:p.value;a?lt(G)&&U0(G,u):lt(G)?G.includes(u)||G.push(u):S?(T[p]=[u],Lt(y,p)&&(y[p]=T[p])):(p.value=[u],o.k&&(T[o.k]=p.value))}else S?(T[p]=d,Lt(y,p)&&(y[p]=d)):P&&(p.value=d,o.k&&(T[o.k]=d))};d?(x.id=-1,zo(x,s)):x()}}}const zo=ER;function XR(o){return jR(o)}function jR(o,n){const s=$0();s.__VUE__=!0;const{insert:l,remove:a,patchProp:u,createElement:d,createText:h,createComment:p,setText:f,setElementText:T,parentNode:y,nextSibling:S,setScopeId:P=Ls,insertStaticContent:x}=o,G=(I,N,A,K=null,U=null,de=null,Te=!1,se=null,Ce=!!N.dynamicChildren)=>{if(I===N)return;I&&!zn(I,N)&&(K=nt(I),Xe(I,U,de,!0),I=null),N.patchFlag===-2&&(Ce=!1,N.dynamicChildren=null);const{type:ce,ref:Se,shapeFlag:Ne}=N;switch(ce){case nd:oe(I,N,A,K);break;case ns:ne(I,N,A,K);break;case Ru:I==null&&Z(N,A,K,Te);break;case Wt:he(I,N,A,K,U,de,Te,se,Ce);break;default:Ne&1?L(I,N,A,K,U,de,Te,se,Ce):Ne&6?fe(I,N,A,K,U,de,Te,se,Ce):(Ne&64||Ne&128)&&ce.process(I,N,A,K,U,de,Te,se,Ce,et)}Se!=null&&U&&O0(Se,I&&I.ref,de,N||I,!N)},oe=(I,N,A,K)=>{if(I==null)l(N.el=h(N.children),A,K);else{const U=N.el=I.el;N.children!==I.children&&f(U,N.children)}},ne=(I,N,A,K)=>{I==null?l(N.el=p(N.children||""),A,K):N.el=I.el},Z=(I,N,A,K)=>{[I.el,I.anchor]=x(I.children,N,A,K,I.el,I.anchor)},Y=({el:I,anchor:N},A,K)=>{let U;for(;I&&I!==N;)U=S(I),l(I,A,K),I=U;l(N,A,K)},M=({el:I,anchor:N})=>{let A;for(;I&&I!==N;)A=S(I),a(I),I=A;a(N)},L=(I,N,A,K,U,de,Te,se,Ce)=>{Te=Te||N.type==="svg",I==null?R(N,A,K,U,de,Te,se,Ce):X(I,N,U,de,Te,se,Ce)},R=(I,N,A,K,U,de,Te,se)=>{let Ce,ce;const{type:Se,props:Ne,shapeFlag:He,transition:be,dirs:ee}=I;if(Ce=I.el=d(I.type,de,Ne&&Ne.is,Ne),He&8?T(Ce,I.children):He&16&&z(I.children,Ce,null,K,U,de&&Se!=="foreignObject",Te,se),ee&&Un(I,null,K,"created"),F(Ce,I,I.scopeId,Te,K),Ne){for(const ue in Ne)ue!=="value"&&!Su(ue)&&u(Ce,ue,null,Ne[ue],de,I.children,K,U,Ze);"value"in Ne&&u(Ce,"value",null,Ne.value),(ce=Ne.onVnodeBeforeMount)&&qs(ce,K,I)}ee&&Un(I,null,K,"beforeMount");const ie=(!U||U&&!U.pendingBranch)&&be&&!be.persisted;ie&&be.beforeEnter(Ce),l(Ce,N,A),((ce=Ne&&Ne.onVnodeMounted)||ie||ee)&&zo(()=>{ce&&qs(ce,K,I),ie&&be.enter(Ce),ee&&Un(I,null,K,"mounted")},U)},F=(I,N,A,K,U)=>{if(A&&P(I,A),K)for(let de=0;de{for(let ce=Ce;ce{const se=N.el=I.el;let{patchFlag:Ce,dynamicChildren:ce,dirs:Se}=N;Ce|=I.patchFlag&16;const Ne=I.props||Kt,He=N.props||Kt;let be;A&&Hn(A,!1),(be=He.onVnodeBeforeUpdate)&&qs(be,A,N,I),Se&&Un(N,I,A,"beforeUpdate"),A&&Hn(A,!0);const ee=U&&N.type!=="foreignObject";if(ce?le(I.dynamicChildren,ce,se,A,K,ee,de):Te||B(I,N,se,null,A,K,ee,de,!1),Ce>0){if(Ce&16)$e(se,N,Ne,He,A,K,U);else if(Ce&2&&Ne.class!==He.class&&u(se,"class",null,He.class,U),Ce&4&&u(se,"style",Ne.style,He.style,U),Ce&8){const ie=N.dynamicProps;for(let ue=0;ue{be&&qs(be,A,N,I),Se&&Un(N,I,A,"updated")},K)},le=(I,N,A,K,U,de,Te)=>{for(let se=0;se{if(A!==K){if(A!==Kt)for(const se in A)!Su(se)&&!(se in K)&&u(I,se,A[se],null,Te,N.children,U,de,Ze);for(const se in K){if(Su(se))continue;const Ce=K[se],ce=A[se];Ce!==ce&&se!=="value"&&u(I,se,ce,Ce,Te,N.children,U,de,Ze)}"value"in K&&u(I,"value",A.value,K.value)}},he=(I,N,A,K,U,de,Te,se,Ce)=>{const ce=N.el=I?I.el:h(""),Se=N.anchor=I?I.anchor:h("");let{patchFlag:Ne,dynamicChildren:He,slotScopeIds:be}=N;be&&(se=se?se.concat(be):be),I==null?(l(ce,A,K),l(Se,A,K),z(N.children,A,Se,U,de,Te,se,Ce)):Ne>0&&Ne&64&&He&&I.dynamicChildren?(le(I.dynamicChildren,He,A,U,de,Te,se),(N.key!=null||U&&N===U.subTree)&&rg(I,N,!0)):B(I,N,A,Se,U,de,Te,se,Ce)},fe=(I,N,A,K,U,de,Te,se,Ce)=>{N.slotScopeIds=se,I==null?N.shapeFlag&512?U.ctx.activate(N,A,K,Te,Ce):ke(N,A,K,U,de,Te,Ce):re(I,N,Ce)},ke=(I,N,A,K,U,de,Te)=>{const se=I.component=s3(I,K,U);if(od(I)&&(se.ctx.renderer=et),i3(se),se.asyncDep){if(U&&U.registerDep(se,Ie),!I.el){const Ce=se.subTree=Q(ns);ne(null,Ce,N,A)}return}Ie(se,I,N,A,U,de,Te)},re=(I,N,A)=>{const K=N.component=I.component;if(fR(I,N,A))if(K.asyncDep&&!K.asyncResolved){D(K,N,A);return}else K.next=N,dR(K.update),K.update();else N.el=I.el,K.vnode=N},Ie=(I,N,A,K,U,de,Te)=>{const se=()=>{if(I.isMounted){let{next:Se,bu:Ne,u:He,parent:be,vnode:ee}=I,ie=Se,ue;Hn(I,!1),Se?(Se.el=ee.el,D(I,Se,Te)):Se=ee,Ne&&e_(Ne),(ue=Se.props&&Se.props.onVnodeBeforeUpdate)&&qs(ue,be,Se,ee),Hn(I,!0);const ye=t_(I),E=I.subTree;I.subTree=ye,G(E,ye,y(E.el),nt(E),I,U,de),Se.el=ye.el,ie===null&&mR(I,ye.el),He&&zo(He,U),(ue=Se.props&&Se.props.onVnodeUpdated)&&zo(()=>qs(ue,be,Se,ee),U)}else{let Se;const{el:Ne,props:He}=N,{bm:be,m:ee,parent:ie}=I,ue=bc(N);if(Hn(I,!1),be&&e_(be),!ue&&(Se=He&&He.onVnodeBeforeMount)&&qs(Se,ie,N),Hn(I,!0),Ne&&w){const ye=()=>{I.subTree=t_(I),w(Ne,I.subTree,I,U,null)};ue?N.type.__asyncLoader().then(()=>!I.isUnmounted&&ye()):ye()}else{const ye=I.subTree=t_(I);G(null,ye,A,K,I,U,de),N.el=ye.el}if(ee&&zo(ee,U),!ue&&(Se=He&&He.onVnodeMounted)){const ye=N;zo(()=>qs(Se,ie,ye),U)}(N.shapeFlag&256||ie&&bc(ie.vnode)&&ie.vnode.shapeFlag&256)&&I.a&&zo(I.a,U),I.isMounted=!0,N=A=K=null}},Ce=I.effect=new z0(se,()=>Z0(ce),I.scope),ce=I.update=()=>Ce.run();ce.id=I.uid,Hn(I,!0),ce()},D=(I,N,A)=>{N.component=I;const K=I.vnode.props;I.vnode=N,I.next=null,VR(I,N.props,K,A),zR(I,N.children,A),_l(),FE(),gl()},B=(I,N,A,K,U,de,Te,se,Ce=!1)=>{const ce=I&&I.children,Se=I?I.shapeFlag:0,Ne=N.children,{patchFlag:He,shapeFlag:be}=N;if(He>0){if(He&128){_e(ce,Ne,A,K,U,de,Te,se,Ce);return}else if(He&256){ae(ce,Ne,A,K,U,de,Te,se,Ce);return}}be&8?(Se&16&&Ze(ce,U,de),Ne!==ce&&T(A,Ne)):Se&16?be&16?_e(ce,Ne,A,K,U,de,Te,se,Ce):Ze(ce,U,de,!0):(Se&8&&T(A,""),be&16&&z(Ne,A,K,U,de,Te,se,Ce))},ae=(I,N,A,K,U,de,Te,se,Ce)=>{I=I||sl,N=N||sl;const ce=I.length,Se=N.length,Ne=Math.min(ce,Se);let He;for(He=0;HeSe?Ze(I,U,de,!0,!1,Ne):z(N,A,K,U,de,Te,se,Ce,Ne)},_e=(I,N,A,K,U,de,Te,se,Ce)=>{let ce=0;const Se=N.length;let Ne=I.length-1,He=Se-1;for(;ce<=Ne&&ce<=He;){const be=I[ce],ee=N[ce]=Ce?on(N[ce]):Js(N[ce]);if(zn(be,ee))G(be,ee,A,null,U,de,Te,se,Ce);else break;ce++}for(;ce<=Ne&&ce<=He;){const be=I[Ne],ee=N[He]=Ce?on(N[He]):Js(N[He]);if(zn(be,ee))G(be,ee,A,null,U,de,Te,se,Ce);else break;Ne--,He--}if(ce>Ne){if(ce<=He){const be=He+1,ee=beHe)for(;ce<=Ne;)Xe(I[ce],U,de,!0),ce++;else{const be=ce,ee=ce,ie=new Map;for(ce=ee;ce<=He;ce++){const Ee=N[ce]=Ce?on(N[ce]):Js(N[ce]);Ee.key!=null&&ie.set(Ee.key,ce)}let ue,ye=0;const E=He-ee+1;let g=!1,k=0;const W=new Array(E);for(ce=0;ce=E){Xe(Ee,U,de,!0);continue}let ze;if(Ee.key!=null)ze=ie.get(Ee.key);else for(ue=ee;ue<=He;ue++)if(W[ue-ee]===0&&zn(Ee,N[ue])){ze=ue;break}ze===void 0?Xe(Ee,U,de,!0):(W[ze-ee]=ce+1,ze>=k?k=ze:g=!0,G(Ee,N[ze],A,null,U,de,Te,se,Ce),ye++)}const J=g?YR(W):sl;for(ue=J.length-1,ce=E-1;ce>=0;ce--){const Ee=ee+ce,ze=N[Ee],yt=Ee+1{const{el:de,type:Te,transition:se,children:Ce,shapeFlag:ce}=I;if(ce&6){Me(I.component.subTree,N,A,K);return}if(ce&128){I.suspense.move(N,A,K);return}if(ce&64){Te.move(I,N,A,et);return}if(Te===Wt){l(de,N,A);for(let Ne=0;Nese.enter(de),U);else{const{leave:Ne,delayLeave:He,afterLeave:be}=se,ee=()=>l(de,N,A),ie=()=>{Ne(de,()=>{ee(),be&&be()})};He?He(de,ee,ie):ie()}else l(de,N,A)},Xe=(I,N,A,K=!1,U=!1)=>{const{type:de,props:Te,ref:se,children:Ce,dynamicChildren:ce,shapeFlag:Se,patchFlag:Ne,dirs:He}=I;if(se!=null&&O0(se,null,A,I,!0),Se&256){N.ctx.deactivate(I);return}const be=Se&1&&He,ee=!bc(I);let ie;if(ee&&(ie=Te&&Te.onVnodeBeforeUnmount)&&qs(ie,N,I),Se&6)We(I.component,A,K);else{if(Se&128){I.suspense.unmount(A,K);return}be&&Un(I,null,N,"beforeUnmount"),Se&64?I.type.remove(I,N,A,U,et,K):ce&&(de!==Wt||Ne>0&&Ne&64)?Ze(ce,N,A,!1,!0):(de===Wt&&Ne&384||!U&&Se&16)&&Ze(Ce,N,A),K&&Je(I)}(ee&&(ie=Te&&Te.onVnodeUnmounted)||be)&&zo(()=>{ie&&qs(ie,N,I),be&&Un(I,null,N,"unmounted")},A)},Je=I=>{const{type:N,el:A,anchor:K,transition:U}=I;if(N===Wt){we(A,K);return}if(N===Ru){M(I);return}const de=()=>{a(A),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(I.shapeFlag&1&&U&&!U.persisted){const{leave:Te,delayLeave:se}=U,Ce=()=>Te(A,de);se?se(I.el,de,Ce):Ce()}else de()},we=(I,N)=>{let A;for(;I!==N;)A=S(I),a(I),I=A;a(N)},We=(I,N,A)=>{const{bum:K,scope:U,update:de,subTree:Te,um:se}=I;K&&e_(K),U.stop(),de&&(de.active=!1,Xe(Te,I,N,A)),se&&zo(se,N),zo(()=>{I.isUnmounted=!0},N),N&&N.pendingBranch&&!N.isUnmounted&&I.asyncDep&&!I.asyncResolved&&I.suspenseId===N.pendingId&&(N.deps--,N.deps===0&&N.resolve())},Ze=(I,N,A,K=!1,U=!1,de=0)=>{for(let Te=de;TeI.shapeFlag&6?nt(I.component.subTree):I.shapeFlag&128?I.suspense.next():S(I.anchor||I.el),ht=(I,N,A)=>{I==null?N._vnode&&Xe(N._vnode,null,null,!0):G(N._vnode||null,I,N,null,null,null,A),FE(),fv(),N._vnode=I},et={p:G,um:Xe,m:Me,r:Je,mt:ke,mc:z,pc:B,pbc:le,n:nt,o};let xe,w;return n&&([xe,w]=n(et)),{render:ht,hydrate:xe,createApp:FR(ht,xe)}}function Hn({effect:o,update:n},s){o.allowRecurse=n.allowRecurse=s}function rg(o,n,s=!1){const l=o.children,a=n.children;if(lt(l)&<(a))for(let u=0;u>1,o[s[h]]0&&(n[l]=s[u-1]),s[u]=l)}}for(u=s.length,d=s[u-1];u-- >0;)s[u]=d,d=n[d];return s}const KR=o=>o.__isTeleport,Ic=o=>o&&(o.disabled||o.disabled===""),qE=o=>typeof SVGElement<"u"&&o instanceof SVGElement,C0=(o,n)=>{const s=o&&o.to;return to(s)?n?n(s):null:s},QR={__isTeleport:!0,process(o,n,s,l,a,u,d,h,p,f){const{mc:T,pc:y,pbc:S,o:{insert:P,querySelector:x,createText:G,createComment:oe}}=f,ne=Ic(n.props);let{shapeFlag:Z,children:Y,dynamicChildren:M}=n;if(o==null){const L=n.el=G(""),R=n.anchor=G("");P(L,s,l),P(R,s,l);const F=n.target=C0(n.props,x),z=n.targetAnchor=G("");F&&(P(z,F),d=d||qE(F));const X=(le,$e)=>{Z&16&&T(Y,le,$e,a,u,d,h,p)};ne?X(s,R):F&&X(F,z)}else{n.el=o.el;const L=n.anchor=o.anchor,R=n.target=o.target,F=n.targetAnchor=o.targetAnchor,z=Ic(o.props),X=z?s:R,le=z?L:F;if(d=d||qE(R),M?(S(o.dynamicChildren,M,X,a,u,d,h),rg(o,n,!0)):p||y(o,n,X,le,a,u,d,h,!1),ne)z||mu(n,s,L,f,1);else if((n.props&&n.props.to)!==(o.props&&o.props.to)){const $e=n.target=C0(n.props,x);$e&&mu(n,$e,null,f,0)}else z&&mu(n,R,F,f,1)}Bv(n)},remove(o,n,s,l,{um:a,o:{remove:u}},d){const{shapeFlag:h,children:p,anchor:f,targetAnchor:T,target:y,props:S}=o;if(y&&u(T),(d||!Ic(S))&&(u(f),h&16))for(let P=0;P0?ks||sl:null,JR(),Dc>0&&ks&&ks.push(o),o}function Fe(o,n,s,l,a,u){return Fv(Le(o,n,s,l,a,u,!0))}function it(o,n,s,l,a){return Fv(Q(o,n,s,l,a,!0))}function al(o){return o?o.__v_isVNode===!0:!1}function zn(o,n){return o.type===n.type&&o.key===n.key}const rd="__vInternal",Uv=({key:o})=>o??null,ku=({ref:o,ref_key:n,ref_for:s})=>(typeof o=="number"&&(o=""+o),o!=null?to(o)||eo(o)||gt(o)?{i:mo,r:o,k:n,f:!!s}:o:null);function Le(o,n=null,s=null,l=0,a=null,u=o===Wt?0:1,d=!1,h=!1){const p={__v_isVNode:!0,__v_skip:!0,type:o,props:n,key:n&&Uv(n),ref:n&&ku(n),scopeId:Ev,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:u,patchFlag:l,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:mo};return h?(cg(p,s),u&128&&o.normalize(p)):s&&(p.shapeFlag|=to(s)?8:16),Dc>0&&!d&&ks&&(p.patchFlag>0||u&6)&&p.patchFlag!==32&&ks.push(p),p}const Q=ZR;function ZR(o,n=null,s=null,l=0,a=null,u=!1){if((!o||o===Sv)&&(o=ns),al(o)){const h=gs(o,n,!0);return s&&cg(h,s),Dc>0&&!u&&ks&&(h.shapeFlag&6?ks[ks.indexOf(o)]=h:ks.push(h)),h.patchFlag|=-2,h}if(a3(o)&&(o=o.__vccOpts),n){n=e3(n);let{class:h,style:p}=n;h&&!to(h)&&(n.class=Pe(h)),Yt(p)&&(av(p)&&!lt(p)&&(p=lo({},p)),n.style=It(p))}const d=to(o)?1:TR(o)?128:KR(o)?64:Yt(o)?4:gt(o)?2:0;return Le(o,n,s,l,a,d,u,!0)}function e3(o){return o?av(o)||rd in o?lo({},o):o:null}function gs(o,n,s=!1){const{props:l,ref:a,patchFlag:u,children:d}=o,h=n?Ot(l||{},n):l;return{__v_isVNode:!0,__v_skip:!0,type:o.type,props:h,key:h&&Uv(h),ref:n&&n.ref?s&&a?lt(a)?a.concat(ku(n)):[a,ku(n)]:ku(n):a,scopeId:o.scopeId,slotScopeIds:o.slotScopeIds,children:d,target:o.target,targetAnchor:o.targetAnchor,staticCount:o.staticCount,shapeFlag:o.shapeFlag,patchFlag:n&&o.type!==Wt?u===-1?16:u|16:u,dynamicProps:o.dynamicProps,dynamicChildren:o.dynamicChildren,appContext:o.appContext,dirs:o.dirs,transition:o.transition,component:o.component,suspense:o.suspense,ssContent:o.ssContent&&gs(o.ssContent),ssFallback:o.ssFallback&&gs(o.ssFallback),el:o.el,anchor:o.anchor,ctx:o.ctx,ce:o.ce}}function Ut(o=" ",n=0){return Q(nd,null,o,n)}function ld(o,n){const s=Q(Ru,null,o);return s.staticCount=n,s}function ut(o="",n=!1){return n?(me(),it(ns,null,o)):Q(ns,null,o)}function Js(o){return o==null||typeof o=="boolean"?Q(ns):lt(o)?Q(Wt,null,o.slice()):typeof o=="object"?on(o):Q(nd,null,String(o))}function on(o){return o.el===null&&o.patchFlag!==-1||o.memo?o:gs(o)}function cg(o,n){let s=0;const{shapeFlag:l}=o;if(n==null)n=null;else if(lt(n))s=16;else if(typeof n=="object")if(l&65){const a=n.default;a&&(a._c&&(a._d=!1),cg(o,a()),a._c&&(a._d=!0));return}else{s=32;const a=n._;!a&&!(rd in n)?n._ctx=mo:a===3&&mo&&(mo.slots._===1?n._=1:(n._=2,o.patchFlag|=1024))}else gt(n)?(n={default:n,_ctx:mo},s=32):(n=String(n),l&64?(s=16,n=[Ut(n)]):s=8);o.children=n,o.shapeFlag|=s}function Ot(...o){const n={};for(let s=0;s_o||mo;let ag,el,ZE="__VUE_INSTANCE_SETTERS__";(el=$0()[ZE])||(el=$0()[ZE]=[]),el.push(o=>_o=o),ag=o=>{el.length>1?el.forEach(n=>n(o)):el[0](o)};const ul=o=>{ag(o),o.scope.on()},Qn=()=>{_o&&_o.scope.off(),ag(null)};function Hv(o){return o.vnode.shapeFlag&4}let Pc=!1;function i3(o,n=!1){Pc=n;const{props:s,children:l}=o.vnode,a=Hv(o);HR(o,s,a,n),WR(o,l);const u=a?n3(o,n):void 0;return Pc=!1,u}function n3(o,n){const s=o.type;o.accessCache=Object.create(null),o.proxy=Zu(new Proxy(o.ctx,NR));const{setup:l}=s;if(l){const a=o.setupContext=l.length>1?l3(o):null;ul(o),_l();const u=ln(l,o,0,[o.props,a]);if(gl(),Qn(),zb(u)){if(u.then(Qn,Qn),n)return u.then(d=>{e1(o,d,n)}).catch(d=>{ed(d,o,0)});o.asyncDep=u}else e1(o,u,n)}else Vv(o,n)}function e1(o,n,s){gt(n)?o.type.__ssrInlineRender?o.ssrRender=n:o.render=n:Yt(n)&&(o.setupState=pv(n)),Vv(o,s)}let t1;function Vv(o,n,s){const l=o.type;if(!o.render){if(!n&&t1&&!l.render){const a=l.template||ig(o).template;if(a){const{isCustomElement:u,compilerOptions:d}=o.appContext.config,{delimiters:h,compilerOptions:p}=l,f=lo(lo({isCustomElement:u,delimiters:h},d),p);l.render=t1(a,f)}}o.render=l.render||Ls}ul(o),_l(),wR(o),gl(),Qn()}function r3(o){return o.attrsProxy||(o.attrsProxy=new Proxy(o.attrs,{get(n,s){return Ko(o,"get","$attrs"),n[s]}}))}function l3(o){const n=s=>{o.exposed=s||{}};return{get attrs(){return r3(o)},slots:o.slots,emit:o.emit,expose:n}}function cd(o){if(o.exposed)return o.exposeProxy||(o.exposeProxy=new Proxy(pv(Zu(o.exposed)),{get(n,s){if(s in n)return n[s];if(s in vc)return vc[s](o)},has(n,s){return s in n||s in vc}}))}function c3(o,n=!0){return gt(o)?o.displayName||o.name:o.name||n&&o.__name}function a3(o){return gt(o)&&"__vccOpts"in o}const j=(o,n)=>cR(o,n,Pc);function Zs(o,n,s){const l=arguments.length;return l===2?Yt(n)&&!lt(n)?al(n)?Q(o,null,[n]):Q(o,n):Q(o,null,n):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&al(s)&&(s=[s]),Q(o,n,s))}const u3=Symbol.for("v-scx"),d3=()=>ho(u3),h3="3.3.4",p3="http://www.w3.org/2000/svg",Xn=typeof document<"u"?document:null,o1=Xn&&Xn.createElement("template"),$3={insert:(o,n,s)=>{n.insertBefore(o,s||null)},remove:o=>{const n=o.parentNode;n&&n.removeChild(o)},createElement:(o,n,s,l)=>{const a=n?Xn.createElementNS(p3,o):Xn.createElement(o,s?{is:s}:void 0);return o==="select"&&l&&l.multiple!=null&&a.setAttribute("multiple",l.multiple),a},createText:o=>Xn.createTextNode(o),createComment:o=>Xn.createComment(o),setText:(o,n)=>{o.nodeValue=n},setElementText:(o,n)=>{o.textContent=n},parentNode:o=>o.parentNode,nextSibling:o=>o.nextSibling,querySelector:o=>Xn.querySelector(o),setScopeId(o,n){o.setAttribute(n,"")},insertStaticContent(o,n,s,l,a,u){const d=s?s.previousSibling:n.lastChild;if(a&&(a===u||a.nextSibling))for(;n.insertBefore(a.cloneNode(!0),s),!(a===u||!(a=a.nextSibling)););else{o1.innerHTML=l?`${o}`:o;const h=o1.content;if(l){const p=h.firstChild;for(;p.firstChild;)h.appendChild(p.firstChild);h.removeChild(p)}n.insertBefore(h,s)}return[d?d.nextSibling:n.firstChild,s?s.previousSibling:n.lastChild]}};function _3(o,n,s){const l=o._vtc;l&&(n=(n?[n,...l]:[...l]).join(" ")),n==null?o.removeAttribute("class"):s?o.setAttribute("class",n):o.className=n}function g3(o,n,s){const l=o.style,a=to(s);if(s&&!a){if(n&&!to(n))for(const u in n)s[u]==null&&y0(l,u,"");for(const u in s)y0(l,u,s[u])}else{const u=l.display;a?n!==s&&(l.cssText=s):n&&o.removeAttribute("style"),"_vod"in o&&(l.display=u)}}const s1=/\s*!important$/;function y0(o,n,s){if(lt(s))s.forEach(l=>y0(o,n,l));else if(s==null&&(s=""),n.startsWith("--"))o.setProperty(n,s);else{const l=f3(o,n);s1.test(s)?o.setProperty($l(l),s.replace(s1,""),"important"):o[l]=s}}const i1=["Webkit","Moz","ms"],i_={};function f3(o,n){const s=i_[n];if(s)return s;let l=ti(n);if(l!=="filter"&&l in o)return i_[n]=l;l=qu(l);for(let a=0;an_||(O3.then(()=>n_=0),n_=Date.now());function y3(o,n){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;_s(S3(l,s.value),n,5,[l])};return s.value=o,s.attached=C3(),s}function S3(o,n){if(lt(n)){const s=o.stopImmediatePropagation;return o.stopImmediatePropagation=()=>{s.call(o),o._stopped=!0},n.map(l=>a=>!a._stopped&&l&&l(a))}else return n}const l1=/^on[a-z]/,R3=(o,n,s,l,a=!1,u,d,h,p)=>{n==="class"?_3(o,l,a):n==="style"?g3(o,s,l):Yu(n)?F0(n)||v3(o,n,s,l,d):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):k3(o,n,l,a))?T3(o,n,l,u,d,h,p):(n==="true-value"?o._trueValue=l:n==="false-value"&&(o._falseValue=l),m3(o,n,l,a))};function k3(o,n,s,l){return l?!!(n==="innerHTML"||n==="textContent"||n in o&&l1.test(n)&>(s)):n==="spellcheck"||n==="draggable"||n==="translate"||n==="form"||n==="list"&&o.tagName==="INPUT"||n==="type"&&o.tagName==="TEXTAREA"||l1.test(n)&&to(s)?!1:n in o}const Ji="transition",$c="animation",un=(o,{slots:n})=>Zs(IR,Wv(o),n);un.displayName="Transition";const Gv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},A3=un.props=lo({},Iv,Gv),Vn=(o,n=[])=>{lt(o)?o.forEach(s=>s(...n)):o&&o(...n)},c1=o=>o?lt(o)?o.some(n=>n.length>1):o.length>1:!1;function Wv(o){const n={};for(const he in o)he in Gv||(n[he]=o[he]);if(o.css===!1)return n;const{name:s="v",type:l,duration:a,enterFromClass:u=`${s}-enter-from`,enterActiveClass:d=`${s}-enter-active`,enterToClass:h=`${s}-enter-to`,appearFromClass:p=u,appearActiveClass:f=d,appearToClass:T=h,leaveFromClass:y=`${s}-leave-from`,leaveActiveClass:S=`${s}-leave-active`,leaveToClass:P=`${s}-leave-to`}=o,x=L3(a),G=x&&x[0],oe=x&&x[1],{onBeforeEnter:ne,onEnter:Z,onEnterCancelled:Y,onLeave:M,onLeaveCancelled:L,onBeforeAppear:R=ne,onAppear:F=Z,onAppearCancelled:z=Y}=n,X=(he,fe,ke)=>{Zi(he,fe?T:h),Zi(he,fe?f:d),ke&&ke()},le=(he,fe)=>{he._isLeaving=!1,Zi(he,y),Zi(he,P),Zi(he,S),fe&&fe()},$e=he=>(fe,ke)=>{const re=he?F:Z,Ie=()=>X(fe,he,ke);Vn(re,[fe,Ie]),a1(()=>{Zi(fe,he?p:u),Ii(fe,he?T:h),c1(re)||u1(fe,l,G,Ie)})};return lo(n,{onBeforeEnter(he){Vn(ne,[he]),Ii(he,u),Ii(he,d)},onBeforeAppear(he){Vn(R,[he]),Ii(he,p),Ii(he,f)},onEnter:$e(!1),onAppear:$e(!0),onLeave(he,fe){he._isLeaving=!0;const ke=()=>le(he,fe);Ii(he,y),Xv(),Ii(he,S),a1(()=>{he._isLeaving&&(Zi(he,y),Ii(he,P),c1(M)||u1(he,l,oe,ke))}),Vn(M,[he,ke])},onEnterCancelled(he){X(he,!1),Vn(Y,[he])},onAppearCancelled(he){X(he,!0),Vn(z,[he])},onLeaveCancelled(he){le(he),Vn(L,[he])}})}function L3(o){if(o==null)return null;if(Yt(o))return[r_(o.enter),r_(o.leave)];{const n=r_(o);return[n,n]}}function r_(o){return E9(o)}function Ii(o,n){n.split(/\s+/).forEach(s=>s&&o.classList.add(s)),(o._vtc||(o._vtc=new Set)).add(n)}function Zi(o,n){n.split(/\s+/).forEach(l=>l&&o.classList.remove(l));const{_vtc:s}=o;s&&(s.delete(n),s.size||(o._vtc=void 0))}function a1(o){requestAnimationFrame(()=>{requestAnimationFrame(o)})}let N3=0;function u1(o,n,s,l){const a=o._endId=++N3,u=()=>{a===o._endId&&l()};if(s)return setTimeout(u,s);const{type:d,timeout:h,propCount:p}=zv(o,n);if(!d)return l();const f=d+"end";let T=0;const y=()=>{o.removeEventListener(f,S),u()},S=P=>{P.target===o&&++T>=p&&y()};setTimeout(()=>{T(s[x]||"").split(", "),a=l(`${Ji}Delay`),u=l(`${Ji}Duration`),d=d1(a,u),h=l(`${$c}Delay`),p=l(`${$c}Duration`),f=d1(h,p);let T=null,y=0,S=0;n===Ji?d>0&&(T=Ji,y=d,S=u.length):n===$c?f>0&&(T=$c,y=f,S=p.length):(y=Math.max(d,f),T=y>0?d>f?Ji:$c:null,S=T?T===Ji?u.length:p.length:0);const P=T===Ji&&/\b(transform|all)(,|$)/.test(l(`${Ji}Property`).toString());return{type:T,timeout:y,propCount:S,hasTransform:P}}function d1(o,n){for(;o.lengthh1(s)+h1(o[l])))}function h1(o){return Number(o.slice(0,-1).replace(",","."))*1e3}function Xv(){return document.body.offsetHeight}const jv=new WeakMap,Yv=new WeakMap,Kv={name:"TransitionGroup",props:lo({},A3,{tag:String,moveClass:String}),setup(o,{slots:n}){const s=ml(),l=vv();let a,u;return fl(()=>{if(!a.length)return;const d=o.moveClass||`${o.name||"v"}-move`;if(!B3(a[0].el,s.vnode.el,d))return;a.forEach(D3),a.forEach(P3);const h=a.filter(x3);Xv(),h.forEach(p=>{const f=p.el,T=f.style;Ii(f,d),T.transform=T.webkitTransform=T.transitionDuration="";const y=f._moveCb=S=>{S&&S.target!==f||(!S||/transform$/.test(S.propertyName))&&(f.removeEventListener("transitionend",y),f._moveCb=null,Zi(f,d))};f.addEventListener("transitionend",y)})}),()=>{const d=Ct(o),h=Wv(d);let p=d.tag||Wt;a=u,u=n.default?og(n.default()):[];for(let f=0;fdelete o.mode;Kv.props;const M3=Kv;function D3(o){const n=o.el;n._moveCb&&n._moveCb(),n._enterCb&&n._enterCb()}function P3(o){Yv.set(o,o.el.getBoundingClientRect())}function x3(o){const n=jv.get(o),s=Yv.get(o),l=n.left-s.left,a=n.top-s.top;if(l||a){const u=o.el.style;return u.transform=u.webkitTransform=`translate(${l}px,${a}px)`,u.transitionDuration="0s",o}}function B3(o,n,s){const l=o.cloneNode();o._vtc&&o._vtc.forEach(d=>{d.split(/\s+/).forEach(h=>h&&l.classList.remove(h))}),s.split(/\s+/).forEach(d=>d&&l.classList.add(d)),l.style.display="none";const a=n.nodeType===1?n:n.parentNode;a.appendChild(l);const{hasTransform:u}=zv(l);return a.removeChild(l),u}const F3=["ctrl","shift","alt","meta"],U3={stop:o=>o.stopPropagation(),prevent:o=>o.preventDefault(),self:o=>o.target!==o.currentTarget,ctrl:o=>!o.ctrlKey,shift:o=>!o.shiftKey,alt:o=>!o.altKey,meta:o=>!o.metaKey,left:o=>"button"in o&&o.button!==0,middle:o=>"button"in o&&o.button!==1,right:o=>"button"in o&&o.button!==2,exact:(o,n)=>F3.some(s=>o[`${s}Key`]&&!n.includes(s))},er=(o,n)=>(s,...l)=>{for(let a=0;a{_c(o,!1)}):_c(o,n))},beforeUnmount(o,{value:n}){_c(o,n)}};function _c(o,n){o.style.display=n?o._vod:"none"}const H3=lo({patchProp:R3},$3);let p1;function Qv(){return p1||(p1=XR(H3))}const $1=(...o)=>{Qv().render(...o)},V3=(...o)=>{const n=Qv().createApp(...o),{mount:s}=n;return n.mount=l=>{const a=G3(l);if(!a)return;const u=n._component;!gt(u)&&!u.render&&!u.template&&(u.template=a.innerHTML),a.innerHTML="";const d=s(a,!1,a instanceof SVGElement);return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),d},n};function G3(o){return to(o)?document.querySelector(o):o}const or=Object.prototype.toString;function jo(o){return or.call(o)==="[object Array]"}function Tl(o){return or.call(o)==="[object Null]"}function S0(o){return or.call(o)==="[object Boolean]"}function ko(o){return or.call(o)==="[object Object]"}const _1=o=>or.call(o)==="[object Promise]";function ki(o){return or.call(o)==="[object String]"}function vt(o){return or.call(o)==="[object Number]"&&o===o}function rs(o){return o===void 0}function bo(o){return typeof o=="function"}function W3(o){return ko(o)&&Object.keys(o).length===0}const qv=o=>(o==null?void 0:o.$)!==void 0,sr=Symbol("ArcoConfigProvider"),Tu={formatYear:"YYYY 年",formatMonth:"YYYY 年 MM 月",today:"今天",view:{month:"月",year:"年",week:"周",day:"日"},month:{long:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"},short:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"}},week:{long:{self:"周",monday:"周一",tuesday:"周二",wednesday:"周三",thursday:"周四",friday:"周五",saturday:"周六",sunday:"周日"},short:{self:"周",monday:"一",tuesday:"二",wednesday:"三",thursday:"四",friday:"五",saturday:"六",sunday:"日"}}},z3={locale:"zh-CN",empty:{description:"暂无数据"},drawer:{okText:"确定",cancelText:"取消"},popconfirm:{okText:"确定",cancelText:"取消"},modal:{okText:"确定",cancelText:"取消"},pagination:{goto:"前往",page:"页",countPerPage:"条/页",total:"共 {0} 条"},table:{okText:"确定",resetText:"重置"},upload:{start:"开始",cancel:"取消",delete:"删除",retry:"点击重试",buttonText:"点击上传",preview:"预览",drag:"点击或拖拽文件到此处上传",dragHover:"释放文件并开始上传",error:"上传失败"},calendar:Tu,datePicker:{view:Tu.view,month:Tu.month,week:Tu.week,placeholder:{date:"请选择日期",week:"请选择周",month:"请选择月份",year:"请选择年份",quarter:"请选择季度",time:"请选择时间"},rangePlaceholder:{date:["开始日期","结束日期"],week:["开始周","结束周"],month:["开始月份","结束月份"],year:["开始年份","结束年份"],quarter:["开始季度","结束季度"],time:["开始时间","结束时间"]},selectTime:"选择时间",today:"今天",now:"此刻",ok:"确定"},image:{loading:"加载中"},imagePreview:{fullScreen:"全屏",rotateRight:"向右旋转",rotateLeft:"向左旋转",zoomIn:"放大",zoomOut:"缩小",originalSize:"原始尺寸"},typography:{copied:"已复制",copy:"复制",expand:"展开",collapse:"折叠",edit:"编辑"},form:{validateMessages:{required:"#{field} 是必填项",type:{string:"#{field} 不是合法的文本类型",number:"#{field} 不是合法的数字类型",boolean:"#{field} 不是合法的布尔类型",array:"#{field} 不是合法的数组类型",object:"#{field} 不是合法的对象类型",url:"#{field} 不是合法的 url 地址",email:"#{field} 不是合法的邮箱地址",ip:"#{field} 不是合法的 IP 地址"},number:{min:"`#{value}` 小于最小值 `#{min}`",max:"`#{value}` 大于最大值 `#{max}`",equal:"`#{value}` 不等于 `#{equal}`",range:"`#{value}` 不在 `#{min} ~ #{max}` 范围内",positive:"`#{value}` 不是正数",negative:"`#{value}` 不是负数"},array:{length:"`#{field}` 个数不等于 #{length}",minLength:"`#{field}` 个数最少为 #{minLength}",maxLength:"`#{field}` 个数最多为 #{maxLength}",includes:"#{field} 不包含 #{includes}",deepEqual:"#{field} 不等于 #{deepEqual}",empty:"`#{field}` 不是空数组"},string:{minLength:"字符数最少为 #{minLength}",maxLength:"字符数最多为 #{maxLength}",length:"字符数必须是 #{length}",match:"`#{value}` 不符合模式 #{pattern}",uppercase:"`#{value}` 必须全大写",lowercase:"`#{value}` 必须全小写"},object:{deepEqual:"`#{field}` 不等于期望值",hasKeys:"`#{field}` 不包含必须字段",empty:"`#{field}` 不是对象"},boolean:{true:"期望是 `true`",false:"期望是 `false`"}}}},X3=ge("zh-CN"),j3=Jt({"zh-CN":z3}),ug=()=>{const o=ho(sr,void 0),n=j(()=>{var a;return(a=o==null?void 0:o.locale)!=null?a:j3[X3.value]}),s=j(()=>n.value.locale);return{i18nMessage:n,locale:s,t:(a,...u)=>{const d=a.split(".");let h=n.value;for(const p of d){if(!h[p])return a;h=h[p]}return ki(h)&&u.length>0?h.replace(/{(\d+)}/g,(p,f)=>{var T;return(T=u[f])!=null?T:p}):h}}};var Y3=Object.defineProperty,K3=Object.defineProperties,Q3=Object.getOwnPropertyDescriptors,g1=Object.getOwnPropertySymbols,q3=Object.prototype.hasOwnProperty,J3=Object.prototype.propertyIsEnumerable,f1=(o,n,s)=>n in o?Y3(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Z3=(o,n)=>{for(var s in n||(n={}))q3.call(n,s)&&f1(o,s,n[s]);if(g1)for(var s of g1(n))J3.call(n,s)&&f1(o,s,n[s]);return o},ek=(o,n)=>K3(o,Q3(n));const tk="A",ok="arco",R0="$arco",Oo=o=>{var n;return(n=o==null?void 0:o.componentPrefix)!=null?n:tk},Co=(o,n)=>{var s;n&&n.classPrefix&&(o.config.globalProperties[R0]=ek(Z3({},(s=o.config.globalProperties[R0])!=null?s:{}),{classPrefix:n.classPrefix}))},ot=o=>{var n,s,l;const a=ml(),u=ho(sr,void 0),d=(l=(s=u==null?void 0:u.prefixCls)!=null?s:(n=a==null?void 0:a.appContext.config.globalProperties[R0])==null?void 0:n.classPrefix)!=null?l:ok;return o?`${d}-${o}`:d};var Jv=function(){if(typeof Map<"u")return Map;function o(n,s){var l=-1;return n.some(function(a,u){return a[0]===s?(l=u,!0):!1}),l}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(s){var l=o(this.__entries__,s),a=this.__entries__[l];return a&&a[1]},n.prototype.set=function(s,l){var a=o(this.__entries__,s);~a?this.__entries__[a][1]=l:this.__entries__.push([s,l])},n.prototype.delete=function(s){var l=this.__entries__,a=o(l,s);~a&&l.splice(a,1)},n.prototype.has=function(s){return!!~o(this.__entries__,s)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(s,l){l===void 0&&(l=null);for(var a=0,u=this.__entries__;a0},o.prototype.connect_=function(){!k0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ck?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},o.prototype.disconnect_=function(){!k0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},o.prototype.onTransitionEnd_=function(n){var s=n.propertyName,l=s===void 0?"":s,a=lk.some(function(u){return!!~l.indexOf(u)});a&&this.refresh()},o.getInstance=function(){return this.instance_||(this.instance_=new o),this.instance_},o.instance_=null,o}(),Zv=function(o,n){for(var s=0,l=Object.keys(n);s"u"||!(Element instanceof Object))){if(!(n instanceof dl(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(n)||(s.set(n,new fk(n)),this.controller_.addObserver(this),this.controller_.refresh())}},o.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof dl(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(n)&&(s.delete(n),s.size||this.controller_.removeObserver(this))}},o.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},o.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(s){s.isActive()&&n.activeObservations_.push(s)})},o.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,s=this.activeObservations_.map(function(l){return new mk(l.target,l.broadcastRect())});this.callback_.call(n,s,n),this.clearActive()}},o.prototype.clearActive=function(){this.activeObservations_.splice(0)},o.prototype.hasActive=function(){return this.activeObservations_.length>0},o}(),tI=typeof WeakMap<"u"?new WeakMap:new Jv,oI=function(){function o(n){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var s=ak.getInstance(),l=new Tk(n,s,this);tI.set(this,l)}return o}();["observe","unobserve","disconnect"].forEach(function(o){oI.prototype[o]=function(){var n;return(n=tI.get(this))[o].apply(n,arguments)}});var dg=function(){return typeof Gu.ResizeObserver<"u"?Gu.ResizeObserver:oI}(),T1;(function(o){o[o.ELEMENT=1]="ELEMENT",o[o.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",o[o.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",o[o.COMPONENT=6]="COMPONENT",o[o.TEXT_CHILDREN=8]="TEXT_CHILDREN",o[o.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",o[o.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",o[o.TELEPORT=64]="TELEPORT",o[o.SUSPENSE=128]="SUSPENSE",o[o.COMPONENT_SHOULD_KEEP_ALIVE=256]="COMPONENT_SHOULD_KEEP_ALIVE",o[o.COMPONENT_KEPT_ALIVE=512]="COMPONENT_KEPT_ALIVE"})(T1||(T1={}));var E1;(function(o){o[o.TEXT=1]="TEXT",o[o.CLASS=2]="CLASS",o[o.STYLE=4]="STYLE",o[o.PROPS=8]="PROPS",o[o.FULL_PROPS=16]="FULL_PROPS",o[o.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",o[o.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",o[o.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",o[o.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",o[o.NEED_PATCH=512]="NEED_PATCH",o[o.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",o[o.DEV_ROOT_FRAGMENT=2048]="DEV_ROOT_FRAGMENT",o[o.HOISTED=-1]="HOISTED",o[o.BAIL=-2]="BAIL"})(E1||(E1={}));const ud=o=>!!(o&&o.shapeFlag&1),dd=(o,n)=>!!(o&&o.shapeFlag&6),Ek=(o,n)=>!!(o&&o.shapeFlag&8),hg=(o,n)=>!!(o&&o.shapeFlag&16),sI=(o,n)=>!!(o&&o.shapeFlag&32),rl=o=>{var n,s;if(o)for(const l of o){if(ud(l)||dd(l))return l;if(hg(l,l.children)){const a=rl(l.children);if(a)return a}else if(sI(l,l.children)){const a=(s=(n=l.children).default)==null?void 0:s.call(n);if(a){const u=rl(a);if(u)return u}}else if(jo(l)){const a=rl(l);if(a)return a}}},bk=o=>{if(!o)return!0;for(const n of o)if(n.children)return!1;return!0},iI=(o,n)=>{if(o&&o.length>0)for(let s=0;s0&&iI(a,n))return!0}return!1},nI=o=>{if(hg(o,o.children))return o.children;if(jo(o))return o},rI=o=>{var n,s;if(ud(o))return o.el;if(dd(o)){if(((n=o.el)==null?void 0:n.nodeType)===1)return o.el;if((s=o.component)!=null&&s.subTree){const l=rI(o.component.subTree);if(l)return l}}else{const l=nI(o);return lI(l)}},lI=o=>{if(o&&o.length>0)for(const n of o){const s=rI(n);if(s)return s}},Au=(o,n=!1)=>{var s,l;const a=[];for(const u of o??[])ud(u)||dd(u)||n&&Ek(u,u.children)?a.push(u):hg(u,u.children)?a.push(...Au(u.children,n)):sI(u,u.children)?a.push(...Au((l=(s=u.children).default)==null?void 0:l.call(s),n)):jo(u)&&a.push(...Au(u,n));return a},l_=o=>{if(o)return bo(o)?o:()=>o};var cI=Ke({name:"ResizeObserver",emits:["resize"],setup(o,{emit:n,slots:s}){let l;const a=ge(),u=j(()=>qv(a.value)?a.value.$el:a.value),d=p=>{p&&(l=new dg(f=>{const T=f[0];n("resize",T)}),l.observe(p))},h=()=>{l&&(l.disconnect(),l=null)};return Et(u,p=>{l&&h(),p&&d(p)}),zt(()=>{u.value&&d(u.value)}),Uc(()=>{h()}),()=>{var p,f;const T=rl((f=(p=s.default)==null?void 0:p.call(s))!=null?f:[]);return T?gs(T,{ref:a},!0):null}}});const aI=typeof window>"u"?global:window,vk=aI.requestAnimationFrame,b1=aI.cancelAnimationFrame;function A0(o){let n=0;const s=(...l)=>{n&&b1(n),n=vk(()=>{o(...l),n=0})};return s.cancel=()=>{b1(n),n=0},s}const pg=()=>{},uI=()=>{const{body:o}=document,n=document.documentElement;let s;try{s=(window.top||window.self||window).document.body}catch{}return{height:Math.max(o.scrollHeight,o.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight,(s==null?void 0:s.scrollHeight)||0,(s==null?void 0:s.clientHeight)||0),width:Math.max(o.scrollWidth,o.offsetWidth,n.clientWidth,n.scrollWidth,n.offsetWidth,(s==null?void 0:s.scrollWidth)||0,(s==null?void 0:s.clientWidth)||0)}},$g=(()=>{try{return!(typeof window<"u"&&document!==void 0)}catch{return!0}})(),vo=(()=>$g?pg:(o,n,s,l=!1)=>{o.addEventListener(n,s,l)})(),Yo=(()=>$g?pg:(o,n,s,l=!1)=>{o.removeEventListener(n,s,l)})(),Ik=(o,n)=>{if(!o||!n)return!1;let s=n;for(;s;){if(s===o)return!0;s=s.parentNode}return!1},Ok=o=>{const n=document.createElement("div");return n.setAttribute("class",`arco-overlay arco-overlay-${o}`),n},dI=(o,n)=>{var s;return $g?pg():(s=(n??document).querySelector(o))!=null?s:void 0},L0=(o,n)=>{if(ki(o)){const s=o[0]==="#"?`[id='${o.slice(1)}']`:o;return dI(s,n)}return o},Ck=(o,n)=>{const s=o.getBoundingClientRect(),l=n.getBoundingClientRect();return{top:s.top-l.top,bottom:l.bottom-s.bottom,left:s.left-l.left,right:l.right-s.right,width:s.width,height:s.height}},yk=o=>o.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:o.scrollHeight>o.offsetHeight,Sk=o=>o.tagName==="BODY"?window.innerWidth-uI().width:o.offsetWidth-o.clientWidth;var dt=(o,n)=>{for(const[s,l]of n)o[s]=l;return o};const Rk=Ke({name:"IconHover",props:{prefix:{type:String},size:{type:String,default:"medium"},disabled:{type:Boolean,default:!1}},setup(){return{prefixCls:ot("icon-hover")}}});function kk(o,n,s,l,a,u){return me(),Fe("span",{class:Pe([o.prefixCls,{[`${o.prefix}-icon-hover`]:o.prefix,[`${o.prefixCls}-size-${o.size}`]:o.size!=="medium",[`${o.prefixCls}-disabled`]:o.disabled}])},[ct(o.$slots,"default")],2)}var oi=dt(Rk,[["render",kk]]);const Ak=Ke({name:"IconClose",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-close`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Lk=["stroke-width","stroke-linecap","stroke-linejoin"],Nk=Le("path",{d:"M9.857 9.858 24 24m0 0 14.142 14.142M24 24 38.142 9.858M24 24 9.857 38.142"},null,-1),wk=[Nk];function Mk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},wk,14,Lk)}var c_=dt(Ak,[["render",Mk]]);const El=Object.assign(c_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+c_.name,c_)}}),Dk=Ke({name:"IconInfoCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-info-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Pk=["stroke-width","stroke-linecap","stroke-linejoin"],xk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null,-1),Bk=[xk];function Fk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Bk,14,Pk)}var a_=dt(Dk,[["render",Fk]]);const Uk=Object.assign(a_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+a_.name,a_)}}),Hk=Ke({name:"IconCheckCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-check-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Vk=["stroke-width","stroke-linecap","stroke-linejoin"],Gk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"},null,-1),Wk=[Gk];function zk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Wk,14,Vk)}var u_=dt(Hk,[["render",zk]]);const hI=Object.assign(u_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+u_.name,u_)}}),Xk=Ke({name:"IconExclamationCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-exclamation-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),jk=["stroke-width","stroke-linecap","stroke-linejoin"],Yk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"},null,-1),Kk=[Yk];function Qk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Kk,14,jk)}var d_=dt(Xk,[["render",Qk]]);const pI=Object.assign(d_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+d_.name,d_)}}),qk=Ke({name:"IconCloseCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-close-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Jk=["stroke-width","stroke-linecap","stroke-linejoin"],Zk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"},null,-1),eA=[Zk];function tA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},eA,14,Jk)}var h_=dt(qk,[["render",tA]]);const $I=Object.assign(h_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+h_.name,h_)}}),oA=["info","success","warning","error"],hl=["onFocus","onFocusin","onFocusout","onBlur","onChange","onBeforeinput","onInput","onReset","onSubmit","onInvalid","onKeydown","onKeypress","onKeyup","onCopy","onCut","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onSelect","autocomplete","autofocus","maxlength","minlength","name","pattern","readonly","required"],sA=Ke({name:"IconLoading",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-loading`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),iA=["stroke-width","stroke-linecap","stroke-linejoin"],nA=Le("path",{d:"M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6"},null,-1),rA=[nA];function lA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},rA,14,iA)}var p_=dt(sA,[["render",lA]]);const ir=Object.assign(p_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+p_.name,p_)}}),cA=Ke({name:"FeedbackIcon",components:{IconLoading:ir,IconCheckCircleFill:hI,IconExclamationCircleFill:pI,IconCloseCircleFill:$I},props:{type:{type:String}},setup(o){const n=ot("feedback-icon");return{cls:j(()=>[n,`${n}-status-${o.type}`])}}});function aA(o,n,s,l,a,u){const d=_t("icon-loading"),h=_t("icon-check-circle-fill"),p=_t("icon-exclamation-circle-fill"),f=_t("icon-close-circle-fill");return me(),Fe("span",{class:Pe(o.cls)},[o.type==="validating"?(me(),it(d,{key:0})):o.type==="success"?(me(),it(h,{key:1})):o.type==="warning"?(me(),it(p,{key:2})):o.type==="error"?(me(),it(f,{key:3})):ut("v-if",!0)],2)}var _g=dt(cA,[["render",aA]]);const gg={key:"Enter",code:"Enter"},uA={key:"Backspace",code:"Backspace"};var dA=Object.defineProperty,v1=Object.getOwnPropertySymbols,hA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,I1=(o,n,s)=>n in o?dA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,$A=(o,n)=>{for(var s in n||(n={}))hA.call(n,s)&&I1(o,s,n[s]);if(v1)for(var s of v1(n))pA.call(n,s)&&I1(o,s,n[s]);return o};const Hc=(o,n)=>{const s=$A({},o);for(const l of n)l in s&&delete s[l];return s};function fg(o,n){const s={};return n.forEach(l=>{const a=l;l in o&&(s[a]=o[a])}),s}const _A=Symbol("ArcoFormItemContext"),si=({size:o,disabled:n,error:s,uninject:l}={})=>{const a=l?{}:ho(_A,{}),u=j(()=>{var T;return(T=o==null?void 0:o.value)!=null?T:a.size}),d=j(()=>(n==null?void 0:n.value)||a.disabled),h=j(()=>(s==null?void 0:s.value)||a.error),p=m0(a,"feedback"),f=m0(a,"eventHandlers");return{formItemCtx:a,mergedSize:u,mergedDisabled:d,mergedError:h,feedback:p,eventHandlers:f}},nr=(o,{defaultValue:n="medium"}={})=>{const s=ho(sr,void 0);return{mergedSize:j(()=>{var a,u;return(u=(a=o==null?void 0:o.value)!=null?a:s==null?void 0:s.size)!=null?u:n})}};function gA(o){const n=ge();function s(){if(!o.value)return;const{selectionStart:a,selectionEnd:u,value:d}=o.value;if(a==null||u==null)return;const h=d.slice(0,Math.max(0,a)),p=d.slice(Math.max(0,u));n.value={selectionStart:a,selectionEnd:u,value:d,beforeTxt:h,afterTxt:p}}function l(){if(!o.value||!n.value)return;const{value:a}=o.value,{beforeTxt:u,afterTxt:d,selectionStart:h}=n.value;if(!u||!d||!h)return;let p=a.length;if(a.endsWith(d))p=a.length-d.length;else if(a.startsWith(u))p=u.length;else{const f=u[h-1],T=a.indexOf(f,h-1);T!==-1&&(p=T+1)}o.value.setSelectionRange(p,p)}return[s,l]}var fA=Object.defineProperty,O1=Object.getOwnPropertySymbols,mA=Object.prototype.hasOwnProperty,TA=Object.prototype.propertyIsEnumerable,C1=(o,n,s)=>n in o?fA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,y1=(o,n)=>{for(var s in n||(n={}))mA.call(n,s)&&C1(o,s,n[s]);if(O1)for(var s of O1(n))TA.call(n,s)&&C1(o,s,n[s]);return o},Cc=Ke({name:"Input",inheritAttrs:!1,props:{modelValue:String,defaultValue:{type:String,default:""},size:{type:String},allowClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},placeholder:String,maxLength:{type:[Number,Object],default:0},showWordLimit:{type:Boolean,default:!1},wordLength:{type:Function},wordSlice:{type:Function},inputAttrs:{type:Object},type:{type:String,default:"text"}},emits:{"update:modelValue":o=>!0,input:(o,n)=>!0,change:(o,n)=>!0,pressEnter:o=>!0,clear:o=>!0,focus:o=>!0,blur:o=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{size:a,disabled:u,error:d,modelValue:h}=Pt(o),p=ot("input"),f=ge(),{mergedSize:T,mergedDisabled:y,mergedError:S,feedback:P,eventHandlers:x}=si({size:a,disabled:u,error:d}),{mergedSize:G}=nr(T),[oe,ne]=gA(f),Z=ge(o.defaultValue),Y=j(()=>{var N;return(N=o.modelValue)!=null?N:Z.value});Et(h,N=>{(rs(N)||Tl(N))&&(Z.value="")});let M=Y.value;const L=ge(!1),R=j(()=>o.allowClear&&!y.value&&!!Y.value),F=ge(!1),z=ge(""),X=N=>{var A;return bo(o.wordLength)?o.wordLength(N):(A=N.length)!=null?A:0},le=j(()=>X(Y.value)),$e=j(()=>S.value||!!(ko(o.maxLength)&&o.maxLength.errorOnly&&le.value>fe.value)),he=j(()=>ko(o.maxLength)&&!!o.maxLength.errorOnly),fe=j(()=>ko(o.maxLength)?o.maxLength.length:o.maxLength),ke=j(()=>{const N=X("a");return Math.floor(fe.value/N)}),re=N=>{var A,K;fe.value&&!he.value&&X(N)>fe.value&&(N=(K=(A=o.wordSlice)==null?void 0:A.call(o,N,fe.value))!=null?K:N.slice(0,ke.value)),Z.value=N,n("update:modelValue",N)},Ie=N=>{f.value&&N.target!==f.value&&(N.preventDefault(),f.value.focus())},D=(N,A)=>{var K,U;N!==M&&(M=N,n("change",N,A),(U=(K=x.value)==null?void 0:K.onChange)==null||U.call(K,A))},B=N=>{var A,K;L.value=!0,M=Y.value,n("focus",N),(K=(A=x.value)==null?void 0:A.onFocus)==null||K.call(A,N)},ae=N=>{var A,K;L.value=!1,D(Y.value,N),n("blur",N),(K=(A=x.value)==null?void 0:A.onBlur)==null||K.call(A,N)},_e=N=>{var A,K,U;const{value:de,selectionStart:Te,selectionEnd:se}=N.target;if(N.type==="compositionend"){if(F.value=!1,z.value="",fe.value&&!he.value&&le.value>=fe.value&&X(de)>fe.value&&Te===se){Me();return}re(de),n("input",de,N),(K=(A=x.value)==null?void 0:A.onInput)==null||K.call(A,N),Me()}else F.value=!0,z.value=Y.value+((U=N.data)!=null?U:"")},Me=()=>{oe(),Io(()=>{f.value&&Y.value!==f.value.value&&(f.value.value=Y.value,ne())})},Xe=N=>{var A,K;const{value:U}=N.target;if(!F.value){if(fe.value&&!he.value&&le.value>=fe.value&&X(U)>fe.value&&N.inputType==="insertText"){Me();return}re(U),n("input",U,N),(K=(A=x.value)==null?void 0:A.onInput)==null||K.call(A,N),Me()}},Je=N=>{re(""),D("",N),n("clear",N)},we=N=>{const A=N.key||N.code;!F.value&&A===gg.key&&(D(Y.value,N),n("pressEnter",N))},We=j(()=>[`${p}-outer`,`${p}-outer-size-${G.value}`,{[`${p}-outer-has-suffix`]:!!s.suffix,[`${p}-outer-disabled`]:y.value}]),Ze=j(()=>[`${p}-wrapper`,{[`${p}-error`]:$e.value,[`${p}-disabled`]:y.value,[`${p}-focus`]:L.value}]),nt=j(()=>[p,`${p}-size-${G.value}`]),ht=j(()=>Hc(l,hl)),et=j(()=>fg(l,hl)),xe=j(()=>{const N=y1(y1({},et.value),o.inputAttrs);return $e.value&&(N["aria-invalid"]=!0),N}),w=N=>{var A;return Q("span",Ot({class:Ze.value,onMousedown:Ie},N?void 0:ht.value),[s.prefix&&Q("span",{class:`${p}-prefix`},[s.prefix()]),Q("input",Ot(xe.value,{ref:f,class:nt.value,value:Y.value,type:o.type,placeholder:o.placeholder,readonly:o.readonly,disabled:y.value,onInput:Xe,onKeydown:we,onFocus:B,onBlur:ae,onCompositionstart:_e,onCompositionupdate:_e,onCompositionend:_e}),null),R.value&&Q(oi,{prefix:p,class:`${p}-clear-btn`,onClick:Je},{default:()=>[Q(El,null,null)]}),(s.suffix||!!o.maxLength&&o.showWordLimit||!!P.value)&&Q("span",{class:[`${p}-suffix`,{[`${p}-suffix-has-feedback`]:P.value}]},[!!o.maxLength&&o.showWordLimit&&Q("span",{class:`${p}-word-limit`},[le.value,Ut("/"),fe.value]),(A=s.suffix)==null?void 0:A.call(s),!!P.value&&Q(_g,{type:P.value},null)])])};return{inputRef:f,render:()=>s.prepend||s.append?Q("span",Ot({class:We.value},ht.value),[s.prepend&&Q("span",{class:`${p}-prepend`},[s.prepend()]),w(!0),s.append&&Q("span",{class:`${p}-append`},[s.append()])]):w()}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const EA=Ke({name:"IconSearch",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-search`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),bA=["stroke-width","stroke-linecap","stroke-linejoin"],vA=Le("path",{d:"M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"},null,-1),IA=[vA];function OA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},IA,14,bA)}var $_=dt(EA,[["render",OA]]);const N0=Object.assign($_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+$_.name,$_)}}),_I=Symbol("ArcoButtonGroup"),CA=Ke({name:"Button",components:{IconLoading:ir},props:{type:{type:String},shape:{type:String},status:{type:String},size:{type:String},long:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean},htmlType:{type:String,default:"button"},href:String},emits:{click:o=>!0},setup(o,{emit:n}){const{size:s,disabled:l}=Pt(o),a=ot("btn"),u=ho(_I,void 0),d=j(()=>{var P;return(P=s.value)!=null?P:u==null?void 0:u.size}),h=j(()=>!!(l.value||u!=null&&u.disabled)),{mergedSize:p,mergedDisabled:f}=si({size:d,disabled:h}),{mergedSize:T}=nr(p),y=j(()=>{var P,x,G,oe,ne,Z;return[a,`${a}-${(x=(P=o.type)!=null?P:u==null?void 0:u.type)!=null?x:"secondary"}`,`${a}-shape-${(oe=(G=o.shape)!=null?G:u==null?void 0:u.shape)!=null?oe:"square"}`,`${a}-size-${T.value}`,`${a}-status-${(Z=(ne=o.status)!=null?ne:u==null?void 0:u.status)!=null?Z:"normal"}`,{[`${a}-long`]:o.long,[`${a}-loading`]:o.loading,[`${a}-disabled`]:f.value,[`${a}-link`]:ki(o.href)}]});return{prefixCls:a,cls:y,mergedDisabled:f,handleClick:P=>{if(o.disabled||o.loading){P.preventDefault();return}n("click",P)}}}}),yA=["href"],SA=["type","disabled"];function RA(o,n,s,l,a,u){const d=_t("icon-loading");return o.href?(me(),Fe("a",{key:0,class:Pe([o.cls,{[`${o.prefixCls}-only-icon`]:o.$slots.icon&&!o.$slots.default}]),href:o.mergedDisabled||o.loading?void 0:o.href,onClick:n[0]||(n[0]=(...h)=>o.handleClick&&o.handleClick(...h))},[o.loading||o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[o.loading?(me(),it(d,{key:0,spin:"true"})):ct(o.$slots,"icon",{key:1})],2)):ut("v-if",!0),ct(o.$slots,"default")],10,yA)):(me(),Fe("button",{key:1,class:Pe([o.cls,{[`${o.prefixCls}-only-icon`]:o.$slots.icon&&!o.$slots.default}]),type:o.htmlType,disabled:o.mergedDisabled,onClick:n[1]||(n[1]=(...h)=>o.handleClick&&o.handleClick(...h))},[o.loading||o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[o.loading?(me(),it(d,{key:0,spin:!0})):ct(o.$slots,"icon",{key:1})],2)):ut("v-if",!0),ct(o.$slots,"default")],10,SA))}var __=dt(CA,[["render",RA]]);const kA=Ke({name:"ButtonGroup",props:{type:{type:String},status:{type:String},shape:{type:String},size:{type:String},disabled:{type:Boolean}},setup(o){const{type:n,size:s,status:l,disabled:a,shape:u}=Pt(o),d=ot("btn-group");return hn(_I,Jt({type:n,size:s,shape:u,status:l,disabled:a})),{prefixCls:d}}});function AA(o,n,s,l,a,u){return me(),Fe("div",{class:Pe(o.prefixCls)},[ct(o.$slots,"default")],2)}var g_=dt(kA,[["render",AA]]);const Vc=Object.assign(__,{Group:g_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+__.name,__),o.component(s+g_.name,g_)}});var f_=Ke({name:"InputSearch",props:{searchButton:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String},buttonText:{type:String},buttonProps:{type:Object}},emits:{search:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{size:l}=Pt(o),a=ot("input-search"),{mergedSize:u}=nr(l),d=ge(),h=y=>{d.value.inputRef&&n("search",d.value.inputRef.value,y)},p=()=>{var y;return Q(Wt,null,[o.loading?Q(ir,null,null):Q(oi,{onClick:h},{default:()=>[Q(N0,null,null)]}),(y=s.suffix)==null?void 0:y.call(s)])},f=()=>{var y;let S={};return o.buttonText||s["button-default"]||s["button-icon"]?S={default:(y=s["button-default"])!=null?y:o.buttonText?()=>o.buttonText:void 0,icon:s["button-icon"]}:S={icon:()=>Q(N0,null,null)},Q(Vc,Ot({type:"primary",class:`${a}-btn`,disabled:o.disabled,size:u.value,loading:o.loading},o.buttonProps,{onClick:h}),S)};return{inputRef:d,render:()=>Q(Cc,{ref:d,class:a,size:u.value,disabled:o.disabled},{prepend:s.prepend,prefix:s.prefix,suffix:o.searchButton?s.suffix:p,append:o.searchButton?f:s.append})}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const LA=Ke({name:"IconEye",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-eye`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),NA=["stroke-width","stroke-linecap","stroke-linejoin"],wA=Le("path",{"clip-rule":"evenodd",d:"M24 37c6.627 0 12.627-4.333 18-13-5.373-8.667-11.373-13-18-13-6.627 0-12.627 4.333-18 13 5.373 8.667 11.373 13 18 13Z"},null,-1),MA=Le("path",{d:"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"},null,-1),DA=[wA,MA];function PA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},DA,14,NA)}var m_=dt(LA,[["render",PA]]);const xA=Object.assign(m_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+m_.name,m_)}}),BA=Ke({name:"IconEyeInvisible",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-eye-invisible`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),FA=["stroke-width","stroke-linecap","stroke-linejoin"],UA=Le("path",{d:"M14 14.5c-2.69 2-5.415 5.33-8 9.5 5.373 8.667 11.373 13 18 13 3.325 0 6.491-1.09 9.5-3.271M17.463 12.5C19 11 21.75 11 24 11c6.627 0 12.627 4.333 18 13-1.766 2.848-3.599 5.228-5.5 7.14"},null,-1),HA=Le("path",{d:"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM6.852 7.103l34.294 34.294"},null,-1),VA=[UA,HA];function GA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},VA,14,FA)}var T_=dt(BA,[["render",GA]]);const WA=Object.assign(T_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+T_.name,T_)}}),zA=Ke({name:"InputPassword",components:{IconEye:xA,IconEyeInvisible:WA,AIconHover:oi,AInput:Cc},props:{invisibleButton:{type:Boolean,default:!0}},setup(){const o=ge(),n=ge(!0);return{inputRef:o,invisible:n,handleInvisible:()=>{n.value=!n.value}}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}}});function XA(o,n,s,l,a,u){const d=_t("icon-eye"),h=_t("icon-eye-invisible"),p=_t("a-icon-hover"),f=_t("a-input");return me(),it(f,{ref:"inputRef",type:o.invisible?"password":"text"},kv({_:2},[o.$slots.prepend?{name:"prepend",fn:De(()=>[ct(o.$slots,"prepend")])}:void 0,o.$slots.prefix?{name:"prefix",fn:De(()=>[ct(o.$slots,"prefix")])}:void 0,o.invisibleButton||o.$slots.suffix?{name:"suffix",fn:De(()=>[o.invisibleButton?(me(),it(p,{key:0,onClick:o.handleInvisible,onMousedown:n[0]||(n[0]=er(()=>{},["prevent"])),onMouseup:n[1]||(n[1]=er(()=>{},["prevent"]))},{default:De(()=>[o.invisible?(me(),it(h,{key:1})):(me(),it(d,{key:0}))]),_:1},8,["onClick"])):ut("v-if",!0),ct(o.$slots,"suffix")])}:void 0,o.$slots.append?{name:"append",fn:De(()=>[ct(o.$slots,"append")])}:void 0]),1032,["type"])}var E_=dt(zA,[["render",XA]]);const jA=Ke({name:"InputGroup",setup(){return{prefixCls:ot("input-group")}}});function YA(o,n,s,l,a,u){return me(),Fe("div",{class:Pe(o.prefixCls)},[ct(o.$slots,"default")],2)}var b_=dt(jA,[["render",YA]]);const mg=Object.assign(Cc,{Search:f_,Password:E_,Group:b_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+Cc.name,Cc),o.component(s+b_.name,b_),o.component(s+f_.name,f_),o.component(s+E_.name,E_)}});var KA=Object.defineProperty,S1=Object.getOwnPropertySymbols,QA=Object.prototype.hasOwnProperty,qA=Object.prototype.propertyIsEnumerable,R1=(o,n,s)=>n in o?KA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Tc=(o,n)=>{for(var s in n||(n={}))QA.call(n,s)&&R1(o,s,n[s]);if(S1)for(var s of S1(n))qA.call(n,s)&&R1(o,s,n[s]);return o};const JA=()=>{const{height:o,width:n}=uI();return{width:Math.min(n,window.innerWidth),height:Math.min(o,window.innerHeight)}},k1=(o,n)=>{var s,l;const a=o.getBoundingClientRect();return{top:a.top,bottom:a.bottom,left:a.left,right:a.right,scrollTop:a.top-n.top,scrollBottom:a.bottom-n.top,scrollLeft:a.left-n.left,scrollRight:a.right-n.left,width:(s=o.offsetWidth)!=null?s:o.clientWidth,height:(l=o.offsetHeight)!=null?l:o.clientHeight}},ZA=o=>{switch(o){case"top":case"tl":case"tr":return"top";case"bottom":case"bl":case"br":return"bottom";case"left":case"lt":case"lb":return"left";case"right":case"rt":case"rb":return"right";default:return"top"}},Eu=(o,n)=>{switch(n){case"top":switch(o){case"bottom":return"top";case"bl":return"tl";case"br":return"tr";default:return o}case"bottom":switch(o){case"top":return"bottom";case"tl":return"bl";case"tr":return"br";default:return o}case"left":switch(o){case"right":return"left";case"rt":return"lt";case"rb":return"lb";default:return o}case"right":switch(o){case"left":return"right";case"lt":return"rt";case"lb":return"rb";default:return o}default:return o}},eL=(o,n,{containerRect:s,triggerRect:l,popupRect:a,offset:u,translate:d})=>{const h=ZA(o),p=JA(),f={top:s.top+n.top,bottom:p.height-(s.top+n.top+a.height),left:s.left+n.left,right:p.width-(s.left+n.left+a.width)};let T=o;if(h==="top"&&f.top<0)if(l.top>a.height)n.top=-s.top;else{const y=Ec("bottom",l,a,{offset:u,translate:d});p.height-(s.top+y.top+a.height)>0&&(T=Eu(o,"bottom"),n.top=y.top)}if(h==="bottom"&&f.bottom<0)if(p.height-l.bottom>a.height)n.top=-s.top+(p.height-a.height);else{const y=Ec("top",l,a,{offset:u,translate:d});s.top+y.top>0&&(T=Eu(o,"top"),n.top=y.top)}if(h==="left"&&f.left<0)if(l.left>a.width)n.left=-s.left;else{const y=Ec("right",l,a,{offset:u,translate:d});p.width-(s.left+y.left+a.width)>0&&(T=Eu(o,"right"),n.left=y.left)}if(h==="right"&&f.right<0)if(p.width-l.right>a.width)n.left=-s.left+(p.width-a.width);else{const y=Ec("left",l,a,{offset:u,translate:d});s.left+y.left>0&&(T=Eu(o,"left"),n.left=y.left)}return(h==="top"||h==="bottom")&&(f.left<0?n.left=-s.left:f.right<0&&(n.left=-s.left+(p.width-a.width))),(h==="left"||h==="right")&&(f.top<0?n.top=-s.top:f.bottom<0&&(n.top=-s.top+(p.height-a.height))),{popupPosition:n,position:T}},Ec=(o,n,s,{offset:l=0,translate:a=[0,0]}={})=>{var u;const d=(u=jo(a)?a:a[o])!=null?u:[0,0];switch(o){case"top":return{left:n.scrollLeft+Math.round(n.width/2)-Math.round(s.width/2)+d[0],top:n.scrollTop-s.height-l+d[1]};case"tl":return{left:n.scrollLeft+d[0],top:n.scrollTop-s.height-l+d[1]};case"tr":return{left:n.scrollRight-s.width+d[0],top:n.scrollTop-s.height-l+d[1]};case"bottom":return{left:n.scrollLeft+Math.round(n.width/2)-Math.round(s.width/2)+d[0],top:n.scrollBottom+l+d[1]};case"bl":return{left:n.scrollLeft+d[0],top:n.scrollBottom+l+d[1]};case"br":return{left:n.scrollRight-s.width+d[0],top:n.scrollBottom+l+d[1]};case"left":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollTop+Math.round(n.height/2)-Math.round(s.height/2)+d[1]};case"lt":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollTop+d[1]};case"lb":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollBottom-s.height+d[1]};case"right":return{left:n.scrollRight+l+d[0],top:n.scrollTop+Math.round(n.height/2)-Math.round(s.height/2)+d[1]};case"rt":return{left:n.scrollRight+l+d[0],top:n.scrollTop+d[1]};case"rb":return{left:n.scrollRight+l+d[0],top:n.scrollBottom-s.height+d[1]};default:return{left:0,top:0}}},tL=o=>{let n="0";["top","bottom"].includes(o)?n="50%":["left","lt","lb","tr","br"].includes(o)&&(n="100%");let s="0";return["left","right"].includes(o)?s="50%":["top","tl","tr","lt","rt"].includes(o)&&(s="100%"),`${n} ${s}`},oL=(o,n,s,l,{offset:a=0,translate:u=[0,0],customStyle:d={},autoFitPosition:h=!1}={})=>{let p=o,f=Ec(o,s,l,{offset:a,translate:u});if(h){const y=eL(o,f,{containerRect:n,popupRect:l,triggerRect:s,offset:a,translate:u});f=y.popupPosition,p=y.position}return{style:Tc({left:`${f.left}px`,top:`${f.top}px`},d),position:p}},sL=(o,n,s,{customStyle:l={}})=>{if(["top","tl","tr","bottom","bl","br"].includes(o)){let u=Math.abs(n.scrollLeft+n.width/2-s.scrollLeft);return u>s.width-8&&(n.width>s.width?u=s.width/2:u=s.width-8),["top","tl","tr"].includes(o)?Tc({left:`${u}px`,bottom:"0",transform:"translate(-50%,50%) rotate(45deg)"},l):Tc({left:`${u}px`,top:"0",transform:"translate(-50%,-50%) rotate(45deg)"},l)}let a=Math.abs(n.scrollTop+n.height/2-s.scrollTop);return a>s.height-8&&(n.height>s.height?a=s.height/2:a=s.height-8),["left","lt","lb"].includes(o)?Tc({top:`${a}px`,right:"0",transform:"translate(50%,-50%) rotate(45deg)"},l):Tc({top:`${a}px`,left:"0",transform:"translate(-50%,-50%) rotate(45deg)"},l)},iL=o=>o.scrollHeight>o.offsetHeight||o.scrollWidth>o.offsetWidth,A1=o=>{var n;const s=[];let l=o;for(;l&&l!==document.documentElement;)iL(l)&&s.push(l),l=(n=l.parentElement)!=null?n:void 0;return s},gI=()=>{const o={},n=ge(),s=()=>{const l=lI(o.value);l!==n.value&&(n.value=l)};return zt(()=>s()),fl(()=>s()),{children:o,firstElement:n}};var w0=Ke({name:"ResizeObserver",props:{watchOnUpdated:Boolean},emits:["resize"],setup(o,{emit:n,slots:s}){const{children:l,firstElement:a}=gI();let u;const d=p=>{p&&(u=new dg(f=>{const T=f[0];n("resize",T)}),u.observe(p))},h=()=>{u&&(u.disconnect(),u=null)};return Et(a,p=>{u&&h(),p&&d(p)}),Ri(()=>{u&&h()}),()=>{var p;return l.value=(p=s.default)==null?void 0:p.call(s),l.value}}});function nL(o,n){const s=ge(o[n]);return fl(()=>{const l=o[n];s.value!==l&&(s.value=l)}),s}const L1=Symbol("ArcoTrigger"),rL=1e3,lL=5e3,cL=1;class aL{constructor(){this.popupStack={popup:new Set,dialog:new Set,message:new Set},this.getNextZIndex=n=>(n==="message"?Array.from(this.popupStack.message).pop()||lL:Array.from(this.popupStack.popup).pop()||rL)+cL,this.add=n=>{const s=this.getNextZIndex(n);return this.popupStack[n].add(s),n==="dialog"&&this.popupStack.popup.add(s),s},this.delete=(n,s)=>{this.popupStack[s].delete(n),s==="dialog"&&this.popupStack.popup.delete(n)},this.isLastDialog=n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0}}const v_=new aL;function Tg(o,{visible:n,runOnMounted:s}={}){const l=ge(0),a=()=>{l.value=v_.add(o)},u=()=>{v_.delete(l.value,o)},d=()=>o==="dialog"?v_.isLastDialog(l.value):!1;return Et(()=>n==null?void 0:n.value,h=>{h?a():u()},{immediate:!0}),s&&(zt(()=>{a()}),Ri(()=>{u()})),{zIndex:K0(l),open:a,close:u,isLastDialog:d}}const uL=({elementRef:o,onResize:n})=>{let s;return{createResizeObserver:()=>{o.value&&(s=new dg(u=>{const d=u[0];bo(n)&&n(d)}),s.observe(o.value))},destroyResizeObserver:()=>{s&&(s.disconnect(),s=null)}}};var fI=Ke({name:"ClientOnly",setup(o,{slots:n}){const s=ge(!1);return zt(()=>s.value=!0),()=>{var l;return s.value?(l=n.default)==null?void 0:l.call(n):null}}});const mI=({popupContainer:o,visible:n,defaultContainer:s="body",documentContainer:l})=>{const a=ge(o.value),u=ge(),d=()=>{const h=L0(o.value),p=h?o.value:s,f=h??(l?document.documentElement:L0(s));p!==a.value&&(a.value=p),f!==u.value&&(u.value=f)};return zt(()=>d()),Et(n,h=>{a.value!==o.value&&h&&d()}),{teleportContainer:a,containerRef:u}};var dL=Object.defineProperty,hL=Object.defineProperties,pL=Object.getOwnPropertyDescriptors,N1=Object.getOwnPropertySymbols,$L=Object.prototype.hasOwnProperty,_L=Object.prototype.propertyIsEnumerable,w1=(o,n,s)=>n in o?dL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,gL=(o,n)=>{for(var s in n||(n={}))$L.call(n,s)&&w1(o,s,n[s]);if(N1)for(var s of N1(n))_L.call(n,s)&&w1(o,s,n[s]);return o},fL=(o,n)=>hL(o,pL(n));const mL=["onClick","onMouseenter","onMouseleave","onFocusin","onFocusout","onContextmenu"];var I_=Ke({name:"Trigger",inheritAttrs:!1,props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},trigger:{type:[String,Array],default:"hover"},position:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},popupOffset:{type:Number,default:0},popupTranslate:{type:[Array,Object]},showArrow:{type:Boolean,default:!1},alignPoint:{type:Boolean,default:!1},popupHoverStay:{type:Boolean,default:!0},blurToClose:{type:Boolean,default:!0},clickToClose:{type:Boolean,default:!0},clickOutsideToClose:{type:Boolean,default:!0},unmountOnClose:{type:Boolean,default:!0},contentClass:{type:[String,Array,Object]},contentStyle:{type:Object},arrowClass:{type:[String,Array,Object]},arrowStyle:{type:Object},popupStyle:{type:Object},animationName:{type:String,default:"fade-in"},duration:{type:[Number,Object]},mouseEnterDelay:{type:Number,default:100},mouseLeaveDelay:{type:Number,default:100},focusDelay:{type:Number,default:0},autoFitPopupWidth:{type:Boolean,default:!1},autoFitPopupMinWidth:{type:Boolean,default:!1},autoFixPosition:{type:Boolean,default:!0},popupContainer:{type:[String,Object]},updateAtScroll:{type:Boolean,default:!1},autoFitTransformOrigin:{type:Boolean,default:!1},hideEmpty:{type:Boolean,default:!1},openedClass:{type:[String,Array,Object]},autoFitPosition:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},preventFocus:{type:Boolean,default:!1},scrollToClose:{type:Boolean,default:!1}},emits:{"update:popupVisible":o=>!0,popupVisibleChange:o=>!0,show:()=>!0,hide:()=>!0,resize:()=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{popupContainer:a}=Pt(o),u=ot("trigger"),d=j(()=>Hc(l,mL)),h=ho(sr,void 0),p=j(()=>[].concat(o.trigger)),f=new Set,T=ho(L1,void 0),{children:y,firstElement:S}=gI(),P=ge(),x=ge(o.defaultPopupVisible),G=ge(o.position),oe=ge({}),ne=ge({}),Z=ge({}),Y=ge(),M=ge({top:0,left:0}),L=j(()=>{var be;return(be=o.popupVisible)!=null?be:x.value}),{teleportContainer:R,containerRef:F}=mI({popupContainer:a,visible:L,documentContainer:!0}),{zIndex:z}=Tg("popup",{visible:L});let X=0,le=!1,$e=!1;const he=()=>{X&&(window.clearTimeout(X),X=0)},fe=be=>{if(o.alignPoint){const{pageX:ee,pageY:ie}=be;M.value={top:ie,left:ee}}},ke=()=>{if(!S.value||!P.value||!F.value)return;const be=F.value.getBoundingClientRect(),ee=o.alignPoint?{top:M.value.top,bottom:M.value.top,left:M.value.left,right:M.value.left,scrollTop:M.value.top,scrollBottom:M.value.top,scrollLeft:M.value.left,scrollRight:M.value.left,width:0,height:0}:k1(S.value,be),ie=()=>k1(P.value,be),ue=ie(),{style:ye,position:E}=oL(o.position,be,ee,ue,{offset:o.popupOffset,translate:o.popupTranslate,customStyle:o.popupStyle,autoFitPosition:o.autoFitPosition});o.autoFitTransformOrigin&&(ne.value={transformOrigin:tL(E)}),o.autoFitPopupMinWidth?ye.minWidth=`${ee.width}px`:o.autoFitPopupWidth&&(ye.width=`${ee.width}px`),G.value!==E&&(G.value=E),oe.value=ye,o.showArrow&&Io(()=>{Z.value=sL(E,ee,ie(),{customStyle:o.arrowStyle})})},re=(be,ee)=>{if(be===L.value&&X===0)return;const ie=()=>{x.value=be,n("update:popupVisible",be),n("popupVisibleChange",be),be&&Io(()=>{ke()})};ee?(he(),be!==L.value&&(X=window.setTimeout(ie,ee))):ie()},Ie=be=>{var ee;(ee=l.onClick)==null||ee.call(l,be),!(o.disabled||L.value&&!o.clickToClose)&&(p.value.includes("click")?(fe(be),re(!L.value)):p.value.includes("contextMenu")&&L.value&&re(!1))},D=be=>{var ee;(ee=l.onMouseenter)==null||ee.call(l,be),!(o.disabled||!p.value.includes("hover"))&&(fe(be),re(!0,o.mouseEnterDelay))},B=be=>{T==null||T.onMouseenter(be),D(be)},ae=be=>{var ee;(ee=l.onMouseleave)==null||ee.call(l,be),!(o.disabled||!p.value.includes("hover"))&&re(!1,o.mouseLeaveDelay)},_e=be=>{T==null||T.onMouseleave(be),ae(be)},Me=be=>{var ee;(ee=l.onFocusin)==null||ee.call(l,be),!(o.disabled||!p.value.includes("focus"))&&re(!0,o.focusDelay)},Xe=be=>{var ee;(ee=l.onFocusout)==null||ee.call(l,be),!(o.disabled||!p.value.includes("focus"))&&o.blurToClose&&re(!1)},Je=be=>{var ee;(ee=l.onContextmenu)==null||ee.call(l,be),!(o.disabled||!p.value.includes("contextMenu")||L.value&&!o.clickToClose)&&(fe(be),re(!L.value),be.preventDefault())};hn(L1,Jt({onMouseenter:B,onMouseleave:_e,addChildRef:be=>{f.add(be),T==null||T.addChildRef(be)},removeChildRef:be=>{f.delete(be),T==null||T.removeChildRef(be)}}));const Ze=()=>{Yo(document.documentElement,"mousedown",et),le=!1},nt=nL(s,"content"),ht=j(()=>{var be;return o.hideEmpty&&bk((be=nt.value)==null?void 0:be.call(nt))}),et=be=>{var ee,ie,ue;if(!((ee=S.value)!=null&&ee.contains(be.target)||(ie=P.value)!=null&&ie.contains(be.target))){for(const ye of f)if((ue=ye.value)!=null&&ue.contains(be.target))return;Ze(),re(!1)}},xe=A0(()=>{L.value&&(o.scrollToClose||h!=null&&h.scrollToClose?re(!1):ke())}),w=()=>{Yo(window,"scroll",I),$e=!1},I=A0(()=>{re(!1),w()}),N=()=>{L.value&&ke()},A=()=>{N(),n("resize")},K=be=>{o.preventFocus&&be.preventDefault()};T==null||T.addChildRef(P);const U=j(()=>L.value?o.openedClass:void 0);let de;Et(L,be=>{if(o.clickOutsideToClose&&(!be&&le?Ze():be&&!le&&(vo(document.documentElement,"mousedown",et),le=!0)),(o.scrollToClose||h!=null&&h.scrollToClose)&&(vo(window,"scroll",I),$e=!0),o.updateAtScroll||h!=null&&h.updateAtScroll){if(be){de=A1(S.value);for(const ee of de)ee.addEventListener("scroll",xe)}else if(de){for(const ee of de)ee.removeEventListener("scroll",xe);de=void 0}}be&&(Ce.value=!0)}),Et(()=>[o.autoFitPopupWidth,o.autoFitPopupMinWidth],()=>{L.value&&ke()});const{createResizeObserver:Te,destroyResizeObserver:se}=uL({elementRef:F,onResize:N});zt(()=>{if(Te(),L.value&&(ke(),o.clickOutsideToClose&&!le&&(vo(document.documentElement,"mousedown",et),le=!0),o.updateAtScroll||h!=null&&h.updateAtScroll)){de=A1(S.value);for(const be of de)be.addEventListener("scroll",xe)}}),fl(()=>{L.value&&ke()}),Cv(()=>{re(!1)}),Ri(()=>{if(T==null||T.removeChildRef(P),se(),le&&Ze(),$e&&w(),de){for(const be of de)be.removeEventListener("scroll",xe);de=void 0}});const Ce=ge(L.value),ce=ge(!1),Se=()=>{ce.value=!0},Ne=()=>{ce.value=!1,L.value&&n("show")},He=()=>{ce.value=!1,L.value||(Ce.value=!1,n("hide"))};return()=>{var be,ee;return y.value=(ee=(be=s.default)==null?void 0:be.call(s))!=null?ee:[],iI(y.value,{class:U.value,onClick:Ie,onMouseenter:D,onMouseleave:ae,onFocusin:Me,onFocusout:Xe,onContextmenu:Je}),Q(Wt,null,[o.autoFixPosition?Q(w0,{onResize:A},{default:()=>[y.value]}):y.value,Q(fI,null,{default:()=>[Q(lg,{to:R.value,disabled:!o.renderToBody},{default:()=>[(!o.unmountOnClose||L.value||Ce.value)&&!ht.value&&Q(w0,{onResize:N},{default:()=>[Q("div",Ot({ref:P,class:[`${u}-popup`,`${u}-position-${G.value}`],style:fL(gL({},oe.value),{zIndex:z.value,pointerEvents:ce.value?"none":"auto"}),"trigger-placement":G.value,onMouseenter:B,onMouseleave:_e,onMousedown:K},d.value),[Q(un,{name:o.animationName,duration:o.duration,appear:!0,onBeforeEnter:Se,onAfterEnter:Ne,onBeforeLeave:Se,onAfterLeave:He},{default:()=>{var ie;return[Kn(Q("div",{class:`${u}-popup-wrapper`,style:ne.value},[Q("div",{class:[`${u}-content`,o.contentClass],style:o.contentStyle},[(ie=s.content)==null?void 0:ie.call(s)]),o.showArrow&&Q("div",{ref:Y,class:[`${u}-arrow`,o.arrowClass],style:Z.value},null)]),[[qn,L.value]])]}})])]})]})]})])}}});const zu=Object.assign(I_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+I_.name,I_)}}),TL=Ke({name:"IconEmpty",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-empty`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),EL=["stroke-width","stroke-linecap","stroke-linejoin"],bL=Le("path",{d:"M24 5v6m7 1 4-4m-18 4-4-4m28.5 22H28s-1 3-4 3-4-3-4-3H6.5M40 41H8a2 2 0 0 1-2-2v-8.46a2 2 0 0 1 .272-1.007l6.15-10.54A2 2 0 0 1 14.148 18H33.85a2 2 0 0 1 1.728.992l6.149 10.541A2 2 0 0 1 42 30.541V39a2 2 0 0 1-2 2Z"},null,-1),vL=[bL];function IL(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},vL,14,EL)}var O_=dt(TL,[["render",IL]]);const OL=Object.assign(O_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+O_.name,O_)}});var C_=Ke({name:"Empty",props:{description:String,imgSrc:String,inConfigProvider:{type:Boolean,default:!1}},setup(o,{slots:n}){const s=ot("empty"),{t:l}=ug(),a=ho(sr,void 0);return()=>{var u,d,h,p;return!o.inConfigProvider&&(a!=null&&a.slots.empty)&&!(n.image||o.imgSrc||o.description)?a.slots.empty({component:"empty"}):Q("div",{class:s},[Q("div",{class:`${s}-image`},[(d=(u=n.image)==null?void 0:u.call(n))!=null?d:o.imgSrc?Q("img",{src:o.imgSrc,alt:o.description||"empty"},null):Q(OL,null,null)]),Q("div",{class:`${s}-description`},[(p=(h=n.default)==null?void 0:h.call(n))!=null?p:o.description||l("empty.description")])])}}});const CL=Object.assign(C_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+C_.name,C_)}}),yL=5;var SL=Ke({name:"DotLoading",props:{size:{type:Number}},setup(o){const n=ot("dot-loading");return()=>{const s=o.size?{width:`${o.size}px`,height:`${o.size}px`}:{};return Q("div",{class:n,style:{width:o.size?`${o.size*7}px`:void 0,height:o.size?`${o.size}px`:void 0}},[Array(yL).fill(1).map((l,a)=>Q("div",{class:`${n}-item`,key:a,style:s},null))])}}}),y_=Ke({name:"Spin",props:{size:{type:Number},loading:Boolean,dot:Boolean,tip:String,hideIcon:{type:Boolean,default:!1}},setup(o,{slots:n}){const s=ot("spin"),l=ho(sr,void 0),a=j(()=>[s,{[`${s}-loading`]:o.loading,[`${s}-with-tip`]:o.tip&&!n.default}]),u=()=>{if(n.icon){const h=rl(n.icon());if(h)return gs(h,{spin:!0})}return n.element?n.element():o.dot?Q(SL,{size:o.size},null):l!=null&&l.slots.loading?l.slots.loading():Q(ir,{spin:!0,size:o.size},null)},d=()=>{var h,p,f;const T=o.size?{fontSize:`${o.size}px`}:void 0,y=!!((h=n.tip)!=null?h:o.tip);return Q(Wt,null,[!o.hideIcon&&Q("div",{class:`${s}-icon`,style:T},[u()]),y&&Q("div",{class:`${s}-tip`},[(f=(p=n.tip)==null?void 0:p.call(n))!=null?f:o.tip])])};return()=>Q("div",{class:a.value},[n.default?Q(Wt,null,[n.default(),o.loading&&Q("div",{class:`${s}-mask`},[Q("div",{class:`${s}-mask-icon`},[d()])])]):d()])}});const RL=Object.assign(y_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+y_.name,y_)}}),kL=Ke({name:"Thumb",props:{data:{type:Object},direction:{type:String,default:"horizontal"},alwaysShow:{type:Boolean,default:!1},both:{type:Boolean,default:!1}},emits:["scroll"],setup(o,{emit:n}){const s=ot("scrollbar"),l=ge(!1),a=ge(),u=ge(),d=j(()=>o.direction==="horizontal"?{size:"width",direction:"left",offset:"offsetWidth",client:"clientX"}:{size:"height",direction:"top",offset:"offsetHeight",client:"clientY"}),h=ge(0),p=ge(!1),f=ge(0),T=j(()=>{var Z,Y;return{[d.value.size]:`${(Y=(Z=o.data)==null?void 0:Z.thumbSize)!=null?Y:0}px`,[d.value.direction]:`${h.value}px`}}),y=Z=>{Z.preventDefault(),u.value&&(f.value=Z[d.value.client]-u.value.getBoundingClientRect()[d.value.direction],p.value=!0,vo(window,"mousemove",x),vo(window,"mouseup",G),vo(window,"contextmenu",G))},S=Z=>{var Y,M,L,R;if(Z.preventDefault(),u.value){const F=P(Z[d.value.client]>u.value.getBoundingClientRect()[d.value.direction]?h.value+((M=(Y=o.data)==null?void 0:Y.thumbSize)!=null?M:0):h.value-((R=(L=o.data)==null?void 0:L.thumbSize)!=null?R:0));F!==h.value&&(h.value=F,n("scroll",F))}},P=Z=>Z<0?0:o.data&&Z>o.data.max?o.data.max:Z,x=Z=>{if(a.value&&u.value){const Y=P(Z[d.value.client]-a.value.getBoundingClientRect()[d.value.direction]-f.value);Y!==h.value&&(h.value=Y,n("scroll",Y))}},G=()=>{p.value=!1,Yo(window,"mousemove",x),Yo(window,"mouseup",G)},oe=Z=>{p.value||(Z=P(Z),Z!==h.value&&(h.value=Z))},ne=j(()=>[`${s}-thumb`,`${s}-thumb-direction-${o.direction}`,{[`${s}-thumb-dragging`]:p.value}]);return{visible:l,trackRef:a,thumbRef:u,prefixCls:s,thumbCls:ne,thumbStyle:T,handleThumbMouseDown:y,handleTrackClick:S,setOffset:oe}}});function AL(o,n,s,l,a,u){return me(),it(un,null,{default:De(()=>[Le("div",{ref:"trackRef",class:Pe([`${o.prefixCls}-track`,`${o.prefixCls}-track-direction-${o.direction}`]),onMousedown:n[1]||(n[1]=er((...d)=>o.handleTrackClick&&o.handleTrackClick(...d),["self"]))},[Le("div",{ref:"thumbRef",class:Pe(o.thumbCls),style:It(o.thumbStyle),onMousedown:n[0]||(n[0]=(...d)=>o.handleThumbMouseDown&&o.handleThumbMouseDown(...d))},[Le("div",{class:Pe(`${o.prefixCls}-thumb-bar`)},null,2)],38)],34)]),_:1})}var LL=dt(kL,[["render",AL]]);const M1=20,bu=15,NL=Ke({name:"Scrollbar",components:{ResizeObserver:w0,Thumb:LL},inheritAttrs:!1,props:{type:{type:String,default:"embed"},outerClass:[String,Object,Array],outerStyle:{type:[String,Object,Array]},hide:{type:Boolean,default:!1},disableHorizontal:{type:Boolean,default:!1},disableVertical:{type:Boolean,default:!1}},emits:{scroll:o=>!0},setup(o,{emit:n}){const s=ot("scrollbar"),l=ge(),a=ge(),u=ge(),d=ge(),h=ge(),p=ge(!1),f=ge(!1),T=j(()=>p.value&&!o.disableHorizontal),y=j(()=>f.value&&!o.disableVertical),S=ge(!1),P=()=>{var M,L,R,F,z,X;if(l.value){const{clientWidth:le,clientHeight:$e,offsetWidth:he,offsetHeight:fe,scrollWidth:ke,scrollHeight:re,scrollTop:Ie,scrollLeft:D}=l.value;p.value=ke>le,f.value=re>$e,S.value=T.value&&y.value;const B=o.type==="embed"&&S.value?he-bu:he,ae=o.type==="embed"&&S.value?fe-bu:fe,_e=Math.round(B/Math.min(ke/le,B/M1)),Me=B-_e,Xe=(ke-le)/Me,Je=Math.round(ae/Math.min(re/$e,ae/M1)),we=ae-Je,We=(re-$e)/we;if(a.value={ratio:Xe,thumbSize:_e,max:Me},u.value={ratio:We,thumbSize:Je,max:we},Ie>0){const Ze=Math.round(Ie/((L=(M=u.value)==null?void 0:M.ratio)!=null?L:1));(R=h.value)==null||R.setOffset(Ze)}if(D>0){const Ze=Math.round(D/((z=(F=u.value)==null?void 0:F.ratio)!=null?z:1));(X=d.value)==null||X.setOffset(Ze)}}};zt(()=>{P()});const x=()=>{P()},G=M=>{var L,R,F,z,X,le;if(l.value){if(T.value&&!o.disableHorizontal){const $e=Math.round(l.value.scrollLeft/((R=(L=a.value)==null?void 0:L.ratio)!=null?R:1));(F=d.value)==null||F.setOffset($e)}if(y.value&&!o.disableVertical){const $e=Math.round(l.value.scrollTop/((X=(z=u.value)==null?void 0:z.ratio)!=null?X:1));(le=h.value)==null||le.setOffset($e)}}n("scroll",M)},oe=M=>{var L,R;l.value&&l.value.scrollTo({left:M*((R=(L=a.value)==null?void 0:L.ratio)!=null?R:1)})},ne=M=>{var L,R;l.value&&l.value.scrollTo({top:M*((R=(L=u.value)==null?void 0:L.ratio)!=null?R:1)})},Z=j(()=>{const M={};return o.type==="track"&&(T.value&&(M.paddingBottom=`${bu}px`),y.value&&(M.paddingRight=`${bu}px`)),[M,o.outerStyle]}),Y=j(()=>[`${s}`,`${s}-type-${o.type}`,{[`${s}-both`]:S.value},o.outerClass]);return{prefixCls:s,cls:Y,style:Z,containerRef:l,horizontalThumbRef:d,verticalThumbRef:h,horizontalData:a,verticalData:u,isBoth:S,hasHorizontalScrollbar:T,hasVerticalScrollbar:y,handleResize:x,handleScroll:G,handleHorizontalScroll:oe,handleVerticalScroll:ne}},methods:{scrollTo(o,n){var s,l;ko(o)?(s=this.$refs.containerRef)==null||s.scrollTo(o):(o||n)&&((l=this.$refs.containerRef)==null||l.scrollTo(o,n))},scrollTop(o){var n;(n=this.$refs.containerRef)==null||n.scrollTo({top:o})},scrollLeft(o){var n;(n=this.$refs.containerRef)==null||n.scrollTo({left:o})}}});function wL(o,n,s,l,a,u){const d=_t("ResizeObserver"),h=_t("thumb");return me(),Fe("div",{class:Pe(o.cls),style:It(o.style)},[Q(d,{onResize:o.handleResize},{default:De(()=>[Le("div",Ot({ref:"containerRef",class:`${o.prefixCls}-container`},o.$attrs,{onScroll:n[0]||(n[0]=(...p)=>o.handleScroll&&o.handleScroll(...p))}),[Q(d,{onResize:o.handleResize},{default:De(()=>[ct(o.$slots,"default")]),_:3},8,["onResize"])],16)]),_:3},8,["onResize"]),!o.hide&&o.hasHorizontalScrollbar?(me(),it(h,{key:0,ref:"horizontalThumbRef",data:o.horizontalData,direction:"horizontal",both:o.isBoth,onScroll:o.handleHorizontalScroll},null,8,["data","both","onScroll"])):ut("v-if",!0),!o.hide&&o.hasVerticalScrollbar?(me(),it(h,{key:1,ref:"verticalThumbRef",data:o.verticalData,direction:"vertical",both:o.isBoth,onScroll:o.handleVerticalScroll},null,8,["data","both","onScroll"])):ut("v-if",!0)],6)}var S_=dt(NL,[["render",wL]]);const TI=Object.assign(S_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+S_.name,S_)}}),ML=o=>{const n=ge(),s=()=>qv(n.value)?n.value.$refs[o]:n.value,l=ge();return zt(()=>{l.value=s()}),Et([n],()=>{l.value=s()}),{componentRef:n,elementRef:l}};var DL=Object.defineProperty,D1=Object.getOwnPropertySymbols,PL=Object.prototype.hasOwnProperty,xL=Object.prototype.propertyIsEnumerable,P1=(o,n,s)=>n in o?DL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,BL=(o,n)=>{for(var s in n||(n={}))PL.call(n,s)&&P1(o,s,n[s]);if(D1)for(var s of D1(n))xL.call(n,s)&&P1(o,s,n[s]);return o};const FL=o=>{const n=j(()=>!!o.value),s=j(()=>{if(o.value)return BL({type:"embed"},S0(o.value)?void 0:o.value)});return{displayScrollbar:n,scrollbarProps:s}},UL=Ke({name:"SelectDropdown",components:{ScrollbarComponent:TI,Empty:CL,Spin:RL},props:{loading:Boolean,empty:Boolean,virtualList:Boolean,bottomOffset:{type:Number,default:0},scrollbar:{type:[Boolean,Object],default:!0},onScroll:{type:[Function,Array]},onReachBottom:{type:[Function,Array]},showHeaderOnEmpty:{type:Boolean,default:!1},showFooterOnEmpty:{type:Boolean,default:!1}},emits:["scroll","reachBottom"],setup(o,{emit:n,slots:s}){var l,a,u;const{scrollbar:d}=Pt(o),h=ot("select-dropdown"),p=ho(sr,void 0),f=(u=(a=p==null?void 0:(l=p.slots).empty)==null?void 0:a.call(l,{component:"select"}))==null?void 0:u[0],{componentRef:T,elementRef:y}=ML("containerRef"),{displayScrollbar:S,scrollbarProps:P}=FL(d),x=oe=>{const{scrollTop:ne,scrollHeight:Z,offsetHeight:Y}=oe.target;Z-(ne+Y)<=o.bottomOffset&&n("reachBottom",oe),n("scroll",oe)},G=j(()=>[h,{[`${h}-has-header`]:!!s.header,[`${h}-has-footer`]:!!s.footer}]);return{prefixCls:h,SelectEmpty:f,cls:G,wrapperRef:y,wrapperComRef:T,handleScroll:x,displayScrollbar:S,scrollbarProps:P}}});function HL(o,n,s,l,a,u){const d=_t("spin");return me(),Fe("div",{class:Pe(o.cls)},[o.$slots.header&&(!o.empty||o.showHeaderOnEmpty)?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-header`)},[ct(o.$slots,"header")],2)):ut("v-if",!0),o.loading?(me(),it(d,{key:1,class:Pe(`${o.prefixCls}-loading`)},null,8,["class"])):o.empty?(me(),Fe("div",{key:2,class:Pe(`${o.prefixCls}-empty`)},[ct(o.$slots,"empty",{},()=>[(me(),it(cn(o.SelectEmpty?o.SelectEmpty:"Empty")))])],2)):ut("v-if",!0),o.virtualList&&!o.loading&&!o.empty?ct(o.$slots,"virtual-list",{key:3}):ut("v-if",!0),o.virtualList?ut("v-if",!0):Kn((me(),it(cn(o.displayScrollbar?"ScrollbarComponent":"div"),Ot({key:4,ref:"wrapperComRef",class:`${o.prefixCls}-list-wrapper`},o.scrollbarProps,{onScroll:o.handleScroll}),{default:De(()=>[Le("ul",{class:Pe(`${o.prefixCls}-list`)},[ct(o.$slots,"default")],2)]),_:3},16,["class","onScroll"])),[[qn,!o.loading&&!o.empty]]),o.$slots.footer&&(!o.empty||o.showFooterOnEmpty)?(me(),Fe("div",{key:5,class:Pe(`${o.prefixCls}-footer`)},[ct(o.$slots,"footer")],2)):ut("v-if",!0)],2)}var VL=dt(UL,[["render",HL]]),x1=Ke({name:"IconCheck",render(){return Q("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",width:"200",height:"200",fill:"currentColor"},[Q("path",{d:"M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z","p-id":"840"},null)])}});const EI=Symbol("ArcoCheckboxGroup");var Lu=Ke({name:"Checkbox",components:{IconCheck:x1,IconHover:oi},props:{modelValue:{type:[Boolean,Array],default:void 0},defaultChecked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean]},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},uninjectGroupContext:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{disabled:l,modelValue:a}=Pt(o),u=ot("checkbox"),d=ge(),h=o.uninjectGroupContext?void 0:ho(EI,void 0),p=(h==null?void 0:h.name)==="ArcoCheckboxGroup",{mergedDisabled:f,eventHandlers:T}=si({disabled:l}),y=ge(o.defaultChecked),S=j(()=>{var M;return p?h==null?void 0:h.computedValue:(M=o.modelValue)!=null?M:y.value}),P=j(()=>{var M;return jo(S.value)?S.value.includes((M=o.value)!=null?M:!0):S.value}),x=j(()=>(h==null?void 0:h.disabled)||(f==null?void 0:f.value)||!P.value&&(h==null?void 0:h.isMaxed)),G=M=>{M.stopPropagation()},oe=M=>{var L,R,F,z;const{checked:X}=M.target;let le=X;if(jo(S.value)){const $e=new Set(S.value);X?$e.add((L=o.value)!=null?L:!0):$e.delete((R=o.value)!=null?R:!0),le=Array.from($e)}y.value=X,p&&jo(le)?h==null||h.handleChange(le,M):(n("update:modelValue",le),n("change",le,M),(z=(F=T.value)==null?void 0:F.onChange)==null||z.call(F,M)),Io(()=>{d.value&&d.value.checked!==P.value&&(d.value.checked=P.value)})},ne=j(()=>[u,{[`${u}-checked`]:P.value,[`${u}-indeterminate`]:o.indeterminate,[`${u}-disabled`]:x.value}]),Z=M=>{var L,R;(R=(L=T.value)==null?void 0:L.onFocus)==null||R.call(L,M)},Y=M=>{var L,R;(R=(L=T.value)==null?void 0:L.onBlur)==null||R.call(L,M)};return Et(a,M=>{(rs(M)||Tl(M))&&(y.value=!1)}),Et(S,M=>{var L;let R;jo(M)?R=M.includes((L=o.value)!=null?L:!0):R=M,y.value!==R&&(y.value=R),d.value&&d.value.checked!==R&&(d.value.checked=R)}),()=>{var M,L,R,F;return Q("label",{"aria-disabled":x.value,class:ne.value},[Q("input",{ref:d,type:"checkbox",checked:P.value,value:o.value,class:`${u}-target`,disabled:x.value,onClick:G,onChange:oe,onFocus:Z,onBlur:Y},null),(F=(R=(L=s.checkbox)!=null?L:(M=h==null?void 0:h.slots)==null?void 0:M.checkbox)==null?void 0:R({checked:P.value,disabled:x.value}))!=null?F:Q(oi,{class:`${u}-icon-hover`,disabled:x.value||P.value},{default:()=>[Q("div",{class:`${u}-icon`},[P.value&&Q(x1,{class:`${u}-icon-check`},null)])]}),s.default&&Q("span",{class:`${u}-label`},[s.default()])])}}}),R_=Ke({name:"CheckboxGroup",props:{modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:()=>[]},max:{type:Number},options:{type:Array},direction:{type:String,default:"horizontal"},disabled:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{disabled:l}=Pt(o),a=ot("checkbox-group"),{mergedDisabled:u,eventHandlers:d}=si({disabled:l}),h=ge(o.defaultValue),p=j(()=>jo(o.modelValue)?o.modelValue:h.value),f=j(()=>o.max===void 0?!1:p.value.length>=o.max),T=j(()=>{var x;return((x=o.options)!=null?x:[]).map(G=>ki(G)||vt(G)?{label:G,value:G}:G)});hn(EI,Jt({name:"ArcoCheckboxGroup",computedValue:p,disabled:u,isMaxed:f,slots:s,handleChange:(x,G)=>{var oe,ne;h.value=x,n("update:modelValue",x),n("change",x,G),(ne=(oe=d.value)==null?void 0:oe.onChange)==null||ne.call(oe,G)}}));const S=j(()=>[a,`${a}-direction-${o.direction}`]);Et(()=>o.modelValue,x=>{jo(x)?h.value=[...x]:h.value=[]});const P=()=>T.value.map(x=>{const G=p.value.includes(x.value);return Q(Lu,{key:x.value,value:x.value,disabled:x.disabled||!G&&f.value,indeterminate:x.indeterminate,modelValue:G},{default:()=>[s.label?s.label({data:x}):bo(x.label)?x.label():x.label]})});return()=>{var x;return Q("span",{class:S.value},[T.value.length>0?P():(x=s.default)==null?void 0:x.call(s)])}}});const GL=Object.assign(Lu,{Group:R_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+Lu.name,Lu),o.component(s+R_.name,R_)}}),bI=Symbol("ArcoSelectContext");var WL=Object.defineProperty,zL=Object.defineProperties,XL=Object.getOwnPropertyDescriptors,B1=Object.getOwnPropertySymbols,jL=Object.prototype.hasOwnProperty,YL=Object.prototype.propertyIsEnumerable,F1=(o,n,s)=>n in o?WL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Eg=(o,n)=>{for(var s in n||(n={}))jL.call(n,s)&&F1(o,s,n[s]);if(B1)for(var s of B1(n))YL.call(n,s)&&F1(o,s,n[s]);return o},vI=(o,n)=>zL(o,XL(n));const KL=o=>ko(o)&&"isGroup"in o,II=o=>ko(o)&&"isGroup"in o,QL=(o,n="value")=>String(ko(o)?o[n]:o),xc=(o,n="value")=>ko(o)?`__arco__option__object__${o[n]}`:o||vt(o)||ki(o)?`__arco__option__${typeof o}-${o}`:"",qL=o=>o.has("__arco__option__string-"),JL=(o,{valueKey:n,fieldNames:s,origin:l,index:a=-1})=>{var u;if(ko(o)){const h=o[s.value];return{raw:o,index:a,key:xc(h,n),origin:l,value:h,label:(u=o[s.label])!=null?u:QL(h,n),render:o[s.render],disabled:!!o[s.disabled],tagProps:o[s.tagProps]}}const d={value:o,label:String(o),disabled:!1};return Eg({raw:d,index:a,key:xc(o,n),origin:l},d)},M0=(o,{valueKey:n,fieldNames:s,origin:l,optionInfoMap:a})=>{var u;const d=[];for(const h of o)if(KL(h)){const p=M0((u=h.options)!=null?u:[],{valueKey:n,fieldNames:s,origin:l,optionInfoMap:a});p.length>0&&d.push(vI(Eg({},h),{key:`__arco__group__${h.label}`,options:p}))}else{const p=JL(h,{valueKey:n,fieldNames:s,origin:l});d.push(p),a.get(p.key)||a.set(p.key,p)}return d},U1=(o,{inputValue:n,filterOption:s})=>{const l=a=>{var u;const d=[];for(const h of a)if(II(h)){const p=l((u=h.options)!=null?u:[]);p.length>0&&d.push(vI(Eg({},h),{options:p}))}else hd(h,{inputValue:n,filterOption:s})&&d.push(h);return d};return l(o)},hd=(o,{inputValue:n,filterOption:s})=>bo(s)?!n||s(n,o.raw):s?o.label.toLowerCase().includes((n??"").toLowerCase()):!0,ZL=(o,n)=>{if(!o||!n||o.length!==n.length)return!1;for(const s of Object.keys(o))if(!bg(o[s],n[s]))return!1;return!0},eN=(o,n)=>{if(!o||!n)return!1;const{length:s}=o;if(s!==n.length)return!1;for(let l=0;l{const s=Object.prototype.toString.call(o);return s!==Object.prototype.toString.call(n)?!1:s==="[object Object]"?ZL(o,n):s==="[object Array]"?eN(o,n):s==="[object Function]"?o===n?!0:o.toString()===n.toString():o===n},tN=Ke({name:"Option",components:{Checkbox:GL},props:{value:[String,Number,Object],label:String,disabled:Boolean,tagProps:{type:Object},extra:{type:Object},index:{type:Number},internal:Boolean},setup(o){const{disabled:n,tagProps:s,index:l}=Pt(o),a=ot("select-option"),u=ho(bI,void 0),d=ml(),h=ge(),p=ge(s.value);Et(s,(R,F)=>{bg(R,F)||(p.value=R)});const f=ge(""),T=j(()=>{var R,F;return(F=(R=o.value)!=null?R:o.label)!=null?F:f.value}),y=j(()=>{var R;return(R=o.label)!=null?R:f.value}),S=j(()=>xc(T.value,u==null?void 0:u.valueKey)),P=j(()=>{var R;return(R=u==null?void 0:u.component)!=null?R:"li"}),x=()=>{var R;if(!o.label&&h.value){const F=(R=h.value.textContent)!=null?R:"";f.value!==F&&(f.value=F)}};zt(()=>x()),fl(()=>x());const G=j(()=>{var R;return(R=u==null?void 0:u.valueKeys.includes(S.value))!=null?R:!1}),oe=j(()=>(u==null?void 0:u.activeKey)===S.value);let ne=ge(!0);if(!o.internal){const R=Jt({raw:{value:T,label:y,disabled:n,tagProps:p},ref:h,index:l,key:S,origin:"slot",value:T,label:y,disabled:n,tagProps:p});ne=j(()=>hd(R,{inputValue:u==null?void 0:u.inputValue,filterOption:u==null?void 0:u.filterOption})),d&&(u==null||u.addSlotOptionInfo(d.uid,R)),Ri(()=>{d&&(u==null||u.removeSlotOptionInfo(d.uid))})}const Z=R=>{o.disabled||u==null||u.onSelect(S.value,R)},Y=()=>{o.disabled||u==null||u.setActiveKey(S.value)},M=()=>{o.disabled||u==null||u.setActiveKey()},L=j(()=>[a,{[`${a}-disabled`]:o.disabled,[`${a}-active`]:oe.value,[`${a}-multiple`]:u==null?void 0:u.multiple}]);return{prefixCls:a,cls:L,selectCtx:u,itemRef:h,component:P,isSelected:G,isValid:ne,handleClick:Z,handleMouseEnter:Y,handleMouseLeave:M}}});function oN(o,n,s,l,a,u){const d=_t("checkbox");return Kn((me(),it(cn(o.component),{ref:"itemRef",class:Pe([o.cls,{[`${o.prefixCls}-has-suffix`]:!!o.$slots.suffix}]),onClick:o.handleClick,onMouseenter:o.handleMouseEnter,onMouseleave:o.handleMouseLeave},{default:De(()=>[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),o.selectCtx&&o.selectCtx.multiple?(me(),it(d,{key:1,class:Pe(`${o.prefixCls}-checkbox`),"model-value":o.isSelected,disabled:o.disabled,"uninject-group-context":""},{default:De(()=>[ct(o.$slots,"default",{},()=>[Ut(Ci(o.label),1)])]),_:3},8,["class","model-value","disabled"])):(me(),Fe("span",{key:2,class:Pe(`${o.prefixCls}-content`)},[ct(o.$slots,"default",{},()=>[Ut(Ci(o.label),1)])],2)),o.$slots.suffix?(me(),Fe("span",{key:3,class:Pe(`${o.prefixCls}-suffix`)},[ct(o.$slots,"suffix")],2)):ut("v-if",!0)]),_:3},8,["class","onClick","onMouseenter","onMouseleave"])),[[qn,o.isValid]])}var ll=dt(tN,[["render",oN]]),sN=Object.defineProperty,iN=Object.defineProperties,nN=Object.getOwnPropertyDescriptors,H1=Object.getOwnPropertySymbols,rN=Object.prototype.hasOwnProperty,lN=Object.prototype.propertyIsEnumerable,V1=(o,n,s)=>n in o?sN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,k_=(o,n)=>{for(var s in n||(n={}))rN.call(n,s)&&V1(o,s,n[s]);if(H1)for(var s of H1(n))lN.call(n,s)&&V1(o,s,n[s]);return o},cN=(o,n)=>iN(o,nN(n));const aN={value:"value",label:"label",disabled:"disabled",tagProps:"tagProps",render:"render"},uN=({options:o,extraOptions:n,inputValue:s,filterOption:l,showExtraOptions:a,valueKey:u,fieldNames:d})=>{const h=j(()=>k_(k_({},aN),d==null?void 0:d.value)),p=Jt(new Map),f=j(()=>Array.from(p.values()).sort((Y,M)=>vt(Y.index)&&vt(M.index)?Y.index-M.index:0)),T=j(()=>{var Y,M;const L=new Map;return{optionInfos:M0((Y=o==null?void 0:o.value)!=null?Y:[],{valueKey:(M=u==null?void 0:u.value)!=null?M:"value",fieldNames:h.value,origin:"options",optionInfoMap:L}),optionInfoMap:L}}),y=j(()=>{var Y,M;const L=new Map;return{optionInfos:M0((Y=n==null?void 0:n.value)!=null?Y:[],{valueKey:(M=u==null?void 0:u.value)!=null?M:"value",fieldNames:h.value,origin:"extraOptions",optionInfoMap:L}),optionInfoMap:L}}),S=Jt(new Map);Et([f,o??ge([]),n??ge([]),u??ge("value")],()=>{S.clear(),f.value.forEach((Y,M)=>{S.set(Y.key,cN(k_({},Y),{index:M}))}),T.value.optionInfoMap.forEach(Y=>{S.has(Y.key)||(Y.index=S.size,S.set(Y.key,Y))}),y.value.optionInfoMap.forEach(Y=>{S.has(Y.key)||(Y.index=S.size,S.set(Y.key,Y))})},{immediate:!0,deep:!0});const P=j(()=>{var Y;const M=U1(T.value.optionInfos,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value});return((Y=a==null?void 0:a.value)==null||Y)&&M.push(...U1(y.value.optionInfos,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value})),M}),x=j(()=>Array.from(S.values()).filter(Y=>Y.origin==="extraOptions"&&(a==null?void 0:a.value)===!1?!1:hd(Y,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value}))),G=j(()=>x.value.filter(Y=>!Y.disabled).map(Y=>Y.key));return{validOptions:P,optionInfoMap:S,validOptionInfos:x,enabledOptionKeys:G,getNextSlotOptionIndex:()=>p.size,addSlotOptionInfo:(Y,M)=>{p.set(Y,M)},removeSlotOptionInfo:Y=>{p.delete(Y)}}},Ss={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},G1=o=>JSON.stringify({key:o.key,ctrl:!!o.ctrl,shift:!!o.shift,alt:!!o.alt,meta:!!o.meta}),dN=o=>{const n={};return o.forEach((s,l)=>{const a=ki(l)?{key:l}:l;n[G1(a)]=s}),s=>{const l=G1({key:s.key,ctrl:s.ctrlKey,shift:s.shiftKey,alt:s.altKey,meta:s.metaKey}),a=n[l];a&&(s.stopPropagation(),a(s))}},hN=({multiple:o,options:n,extraOptions:s,inputValue:l,filterOption:a,showExtraOptions:u,component:d,valueKey:h,fieldNames:p,loading:f,popupVisible:T,valueKeys:y,dropdownRef:S,optionRefs:P,virtualListRef:x,onSelect:G,onPopupVisibleChange:oe,enterToOpen:ne=!0,defaultActiveFirstOption:Z})=>{const{validOptions:Y,optionInfoMap:M,validOptionInfos:L,enabledOptionKeys:R,getNextSlotOptionIndex:F,addSlotOptionInfo:z,removeSlotOptionInfo:X}=uN({options:n,extraOptions:s,inputValue:l,filterOption:a,showExtraOptions:u,valueKey:h,fieldNames:p}),le=ge();Et(R,re=>{(!le.value||!re.includes(le.value))&&(le.value=re[0])});const $e=re=>{le.value=re},he=re=>{const Ie=R.value.length;if(Ie===0)return;if(!le.value)return re==="down"?R.value[0]:R.value[Ie-1];const D=R.value.indexOf(le.value),B=(Ie+D+(re==="up"?-1:1))%Ie;return R.value[B]},fe=re=>{var Ie,D;x!=null&&x.value&&x.value.scrollTo({key:re});const B=M.get(re),ae=(Ie=S==null?void 0:S.value)==null?void 0:Ie.wrapperRef,_e=(D=P==null?void 0:P.value[re])!=null?D:B==null?void 0:B.ref;if(!ae||!_e||ae.scrollHeight===ae.offsetHeight)return;const Me=Ck(_e,ae),Xe=ae.scrollTop;Me.top<0?ae.scrollTo(0,Xe+Me.top):Me.bottom<0&&ae.scrollTo(0,Xe-Me.bottom)};Et(T,re=>{var Ie;if(re){const D=y.value[y.value.length-1];let B=(Ie=Z==null?void 0:Z.value)==null||Ie?R.value[0]:void 0;R.value.includes(D)&&(B=D),B!==le.value&&(le.value=B),Io(()=>{le.value&&fe(le.value)})}});const ke=dN(new Map([[Ss.ENTER,re=>{!(f!=null&&f.value)&&!re.isComposing&&(T.value?le.value&&(G(le.value,re),re.preventDefault()):ne&&(oe(!0),re.preventDefault()))}],[Ss.ESC,re=>{T.value&&(oe(!1),re.preventDefault())}],[Ss.ARROW_DOWN,re=>{if(T.value){const Ie=he("down");Ie&&(le.value=Ie,fe(Ie)),re.preventDefault()}}],[Ss.ARROW_UP,re=>{if(T.value){const Ie=he("up");Ie&&(le.value=Ie,fe(Ie)),re.preventDefault()}}]]));return hn(bI,Jt({multiple:o,valueKey:h,inputValue:l,filterOption:a,component:d,valueKeys:y,activeKey:le,setActiveKey:$e,onSelect:G,getNextSlotOptionIndex:F,addSlotOptionInfo:z,removeSlotOptionInfo:X})),{validOptions:Y,optionInfoMap:M,validOptionInfos:L,enabledOptionKeys:R,activeKey:le,setActiveKey:$e,addSlotOptionInfo:z,removeSlotOptionInfo:X,getNextActiveKey:he,scrollIntoView:fe,handleKeyDown:ke}},pN=({dataKeys:o,contentRef:n,fixedSize:s,estimatedSize:l,buffer:a})=>{const u=ge(0),d=new Map,h=j(()=>o.value.length),p=ge(0),f=j(()=>{const F=p.value+a.value*3;return F>h.value?h.value:F}),T=j(()=>{const F=h.value-a.value*3;return F<0?0:F}),y=F=>{F<0?p.value=0:F>T.value?p.value=T.value:p.value=F},S=ge(s.value),P=j(()=>l.value!==30?l.value:u.value||l.value),x=(F,z)=>{d.set(F,z)},G=F=>{var z;if(S.value)return P.value;const X=o.value[F];return(z=d.get(X))!=null?z:P.value},oe=F=>d.has(F);zt(()=>{const F=Array.from(d.values()).reduce((z,X)=>z+X,0);F>0&&(u.value=F/d.size)});const ne=F=>S.value?P.value*F:Z(0,F),Z=(F,z)=>{let X=0;for(let le=F;leS.value?P.value*p.value:Z(0,p.value)),M=F=>{const z=F>=Y.value;let X=Math.abs(F-Y.value);const le=z?p.value:p.value-1;let $e=0;for(;X>0;)X-=G(le+$e),z?$e++:$e--;return $e},L=F=>{const z=M(F),X=p.value+z-a.value;return X<0?0:X>T.value?T.value:X},R=j(()=>S.value?P.value*(h.value-f.value):Z(f.value,h.value));return{frontPadding:Y,behindPadding:R,start:p,end:f,getStartByScroll:L,setItemSize:x,hasItemSize:oe,setStart:y,getScrollOffset:ne}};var $N=Ke({name:"VirtualListItem",props:{hasItemSize:{type:Function,required:!0},setItemSize:{type:Function,required:!0}},setup(o,{slots:n}){var s;const l=(s=ml())==null?void 0:s.vnode.key,a=ge(),u=()=>{var d,h,p,f;const T=(h=(d=a.value)==null?void 0:d.$el)!=null?h:a.value,y=(f=(p=T==null?void 0:T.getBoundingClientRect)==null?void 0:p.call(T).height)!=null?f:T==null?void 0:T.offsetHeight;y&&o.setItemSize(l,y)};return zt(()=>u()),Ri(()=>u()),()=>{var d;const h=rl((d=n.default)==null?void 0:d.call(n));return h?gs(h,{ref:a},!0):null}}}),_N=Object.defineProperty,W1=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,z1=(o,n,s)=>n in o?_N(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,mN=(o,n)=>{for(var s in n||(n={}))gN.call(n,s)&&z1(o,s,n[s]);if(W1)for(var s of W1(n))fN.call(n,s)&&z1(o,s,n[s]);return o};const TN=Ke({name:"VirtualList",components:{VirtualListItem:$N},props:{height:{type:[Number,String],default:200},data:{type:Array,default:()=>[]},threshold:{type:Number,default:0},itemKey:{type:String,default:"key"},fixedSize:{type:Boolean,default:!1},estimatedSize:{type:Number,default:30},buffer:{type:Number,default:10},component:{type:[String,Object],default:"div"},listAttrs:{type:Object},contentAttrs:{type:Object},paddingPosition:{type:String,default:"content"}},emits:{scroll:o=>!0,reachBottom:o=>!0},setup(o,{emit:n}){const{data:s,itemKey:l,fixedSize:a,estimatedSize:u,buffer:d,height:h}=Pt(o),p=ot("virtual-list"),f=j(()=>ko(o.component)?mN({container:"div",list:"div",content:"div"},o.component):{container:o.component,list:"div",content:"div"}),T=ge(),y=ge(),S=j(()=>({height:vt(h.value)?`${h.value}px`:h.value,overflow:"auto"})),P=j(()=>s.value.map((he,fe)=>{var ke;return(ke=he[l.value])!=null?ke:fe})),{frontPadding:x,behindPadding:G,start:oe,end:ne,getStartByScroll:Z,setItemSize:Y,hasItemSize:M,setStart:L,getScrollOffset:R}=pN({dataKeys:P,contentRef:y,fixedSize:a,estimatedSize:u,buffer:d}),F=ge(!0),z=Jt({scrollTop:0,scrollHeight:0});Et(P,()=>{F.value=!1});const X=j(()=>o.threshold&&s.value.length<=o.threshold?s.value:s.value.slice(oe.value,ne.value)),le=he=>{const{scrollTop:fe,scrollHeight:ke,offsetHeight:re}=he.target;if(F.value){z.scrollTop=fe,z.scrollHeight=ke;const Ie=Z(fe);Ie!==oe.value&&L(Ie),n("scroll",he),Math.floor(ke-(fe+re))<=0&&n("reachBottom",he)}else ke!==z.scrollHeight&&(F.value=!0,setTimeout(()=>{$e(z.scrollTop)},10)),$e(z.scrollTop)},$e=he=>{var fe,ke;if(T.value)if(vt(he))T.value.scrollTop=he;else{const re=(ke=he.index)!=null?ke:P.value.indexOf((fe=he.key)!=null?fe:"");L(re-d.value),T.value.scrollTop=R(re),Io(()=>{if(T.value){const Ie=R(re);Ie!==T.value.scrollTop&&(T.value.scrollTop=Ie)}})}};return{prefixCls:p,containerRef:T,contentRef:y,frontPadding:x,currentList:X,behindPadding:G,onScroll:le,setItemSize:Y,hasItemSize:M,start:oe,scrollTo:$e,style:S,mergedComponent:f}}});function EN(o,n,s,l,a,u){const d=_t("VirtualListItem");return me(),it(cn(o.mergedComponent.container),{ref:"containerRef",class:Pe(o.prefixCls),style:It(o.style),onScroll:o.onScroll},{default:De(()=>[(me(),it(cn(o.mergedComponent.list),Ot(o.listAttrs,{style:o.paddingPosition==="list"?{paddingTop:`${o.frontPadding}px`,paddingBottom:`${o.behindPadding}px`}:{}}),{default:De(()=>[(me(),it(cn(o.mergedComponent.content),Ot({ref:"contentRef"},o.contentAttrs,{style:o.paddingPosition==="content"?{paddingTop:`${o.frontPadding}px`,paddingBottom:`${o.behindPadding}px`}:{}}),{default:De(()=>[(me(!0),Fe(Wt,null,id(o.currentList,(h,p)=>{var f;return me(),it(d,{key:(f=h[o.itemKey])!=null?f:o.start+p,"has-item-size":o.hasItemSize,"set-item-size":o.setItemSize},{default:De(()=>[ct(o.$slots,"item",{item:h,index:o.start+p})]),_:2},1032,["has-item-size","set-item-size"])}),128))]),_:3},16,["style"]))]),_:3},16,["style"]))]),_:3},8,["class","style","onScroll"])}var bN=dt(TN,[["render",EN]]);const vN=Ke({name:"IconDown",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-down`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),IN=["stroke-width","stroke-linecap","stroke-linejoin"],ON=Le("path",{d:"M39.6 17.443 24.043 33 8.487 17.443"},null,-1),CN=[ON];function yN(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},CN,14,IN)}var A_=dt(vN,[["render",yN]]);const SN=Object.assign(A_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+A_.name,A_)}}),RN=Symbol("ArcoDropdown"),kN=({popupVisible:o,defaultPopupVisible:n,emit:s})=>{var l;const a=ge((l=n==null?void 0:n.value)!=null?l:!1),u=j(()=>{var h;return(h=o==null?void 0:o.value)!=null?h:a.value}),d=h=>{h!==u.value&&(a.value=h,s("update:popupVisible",h),s("popupVisibleChange",h))};return Et(u,h=>{a.value!==h&&(a.value=h)}),{computedPopupVisible:u,handlePopupVisibleChange:d}},AN=Ke({name:"Doption",props:{value:{type:[String,Number,Object]},disabled:{type:Boolean,default:!1},active:Boolean,uninjectContext:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("dropdown-option"),l=ge(),a=j(()=>{var p,f,T;return(T=(f=o.value)!=null?f:(p=l.value)==null?void 0:p.textContent)!=null?T:void 0}),u=o.uninjectContext?void 0:ho(RN,void 0),d=p=>{o.disabled||(n("click",p),u==null||u.onOptionClick(a.value,p))},h=j(()=>[s,{[`${s}-disabled`]:o.disabled,[`${s}-active`]:o.active}]);return{prefixCls:s,cls:h,liRef:l,handleClick:d}}});function LN(o,n,s,l,a,u){return me(),Fe("li",{ref:"liRef",class:Pe([o.cls,{[`${o.prefixCls}-has-suffix`]:!!o.$slots.suffix}]),onClick:n[0]||(n[0]=(...d)=>o.handleClick&&o.handleClick(...d))},[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),Le("span",{class:Pe(`${o.prefixCls}-content`)},[ct(o.$slots,"default")],2),o.$slots.suffix?(me(),Fe("span",{key:1,class:Pe(`${o.prefixCls}-suffix`)},[ct(o.$slots,"suffix")],2)):ut("v-if",!0)],2)}var NN=dt(AN,[["render",LN]]);const wN=Ke({name:"IconRight",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-right`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),MN=["stroke-width","stroke-linecap","stroke-linejoin"],DN=Le("path",{d:"m16 39.513 15.556-15.557L16 8.4"},null,-1),PN=[DN];function xN(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},PN,14,MN)}var L_=dt(wN,[["render",xN]]);const OI=Object.assign(L_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+L_.name,L_)}});var Do=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function CI(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}const BN=({defaultValue:o,modelValue:n,emit:s,eventName:l="input",updateEventName:a="update:modelValue",eventHandlers:u})=>{var d;const h=ge(),p=ge((d=o==null?void 0:o.value)!=null?d:""),f=ge(!1),T=ge(!1),y=ge("");let S;const P=j(()=>{var R;return(R=n==null?void 0:n.value)!=null?R:p.value}),x=(R,F)=>{p.value=R,s(a,R),s(l,R,F)},G=R=>{const{value:F}=R.target;T.value||(x(F,R),Io(()=>{h.value&&P.value!==h.value.value&&(h.value.value=P.value)}))},oe=R=>{l==="input"&&P.value!==S&&(S=P.value,s("change",P.value,R))},ne=R=>{var F;const{value:z}=R.target;R.type==="compositionend"?(T.value=!1,y.value="",x(z,R),Io(()=>{h.value&&P.value!==h.value.value&&(h.value.value=P.value)})):(T.value=!0,y.value=P.value+((F=R.data)!=null?F:""))},Z=R=>{var F,z;f.value=!0,S=P.value,s("focus",R),(z=(F=u==null?void 0:u.value)==null?void 0:F.onFocus)==null||z.call(F,R)},Y=R=>{var F,z;f.value=!1,s("blur",R),(z=(F=u==null?void 0:u.value)==null?void 0:F.onBlur)==null||z.call(F,R),oe(R)},M=R=>{const F=R.key||R.code;!T.value&&F===gg.key&&(s("pressEnter",R),oe(R))},L=R=>{h.value&&R.target!==h.value&&(R.preventDefault(),h.value.focus())};return Et(P,R=>{h.value&&R!==h.value.value&&(h.value.value=R)}),{inputRef:h,_value:p,_focused:f,isComposition:T,compositionValue:y,computedValue:P,handleInput:G,handleComposition:ne,handleFocus:Z,handleBlur:Y,handleKeyDown:M,handleMousedown:L}};var FN=Ke({name:"InputLabel",inheritAttrs:!1,props:{modelValue:Object,inputValue:{type:String,default:""},enabledInput:Boolean,formatLabel:Function,placeholder:String,retainInputValue:Boolean,disabled:Boolean,baseCls:String,size:String,error:Boolean,focused:Boolean,uninjectFormItemContext:Boolean},emits:["update:inputValue","inputValueChange","focus","blur"],setup(o,{attrs:n,emit:s,slots:l}){var a;const{size:u,disabled:d,error:h,inputValue:p,uninjectFormItemContext:f}=Pt(o),T=(a=o.baseCls)!=null?a:ot("input-label"),{mergedSize:y,mergedDisabled:S,mergedError:P,eventHandlers:x}=si({size:u,disabled:d,error:h,uninject:f==null?void 0:f.value}),{mergedSize:G}=nr(y),{inputRef:oe,_focused:ne,computedValue:Z,handleInput:Y,handleComposition:M,handleFocus:L,handleBlur:R,handleMousedown:F}=BN({modelValue:p,emit:s,eventName:"inputValueChange",updateEventName:"update:inputValue",eventHandlers:x}),z=j(()=>{var D;return(D=o.focused)!=null?D:ne.value}),X=j(()=>o.enabledInput&&ne.value||!o.modelValue),le=()=>{var D,B;return o.modelValue?(B=(D=o.formatLabel)==null?void 0:D.call(o,o.modelValue))!=null?B:o.modelValue.label:""},$e=j(()=>o.enabledInput&&o.modelValue?le():o.placeholder),he=()=>{var D,B;return o.modelValue?(B=(D=l.default)==null?void 0:D.call(l,{data:o.modelValue}))!=null?B:le():null},fe=j(()=>[T,`${T}-size-${G.value}`,{[`${T}-search`]:o.enabledInput,[`${T}-focus`]:z.value,[`${T}-disabled`]:S.value,[`${T}-error`]:P.value}]),ke=j(()=>Hc(n,hl)),re=j(()=>fg(n,hl));return{inputRef:oe,render:()=>Q("span",Ot(ke.value,{class:fe.value,title:le(),onMousedown:F}),[l.prefix&&Q("span",{class:`${T}-prefix`},[l.prefix()]),Q("input",Ot(re.value,{ref:oe,class:[`${T}-input`,{[`${T}-input-hidden`]:!X.value}],value:Z.value,readonly:!o.enabledInput,placeholder:$e.value,disabled:S.value,onInput:Y,onFocus:L,onBlur:R,onCompositionstart:M,onCompositionupdate:M,onCompositionend:M}),null),Q("span",{class:[`${T}-value`,{[`${T}-value-hidden`]:X.value}]},[he()]),l.suffix&&Q("span",{class:`${T}-suffix`},[l.suffix()])])}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}}),UN=Object.defineProperty,X1=Object.getOwnPropertySymbols,HN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,j1=(o,n,s)=>n in o?UN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,GN=(o,n)=>{for(var s in n||(n={}))HN.call(n,s)&&j1(o,s,n[s]);if(X1)for(var s of X1(n))VN.call(n,s)&&j1(o,s,n[s]);return o};const WN=(o,n)=>{const s=[];for(const l of o)if(ko(l))s.push({raw:l,value:l[n.value],label:l[n.label],closable:l[n.closable],tagProps:l[n.tagProps]});else if(o||vt(o)){const a={value:l,label:String(l),closable:!0};s.push(GN({raw:a},a))}return s},Y1=["red","orangered","orange","gold","lime","green","cyan","blue","arcoblue","purple","pinkpurple","magenta","gray"],zN=Ke({name:"Tag",components:{IconHover:oi,IconClose:El,IconLoading:ir},props:{color:{type:String},size:{type:String},bordered:{type:Boolean,default:!1},visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:!0}},emits:{"update:visible":o=>!0,"update:checked":o=>!0,close:o=>!0,check:(o,n)=>!0},setup(o,{emit:n}){const{size:s}=Pt(o),l=ot("tag"),a=j(()=>o.color&&Y1.includes(o.color)),u=j(()=>o.color&&!Y1.includes(o.color)),d=ge(o.defaultVisible),h=ge(o.defaultChecked),p=j(()=>{var oe;return(oe=o.visible)!=null?oe:d.value}),f=j(()=>{var oe;return o.checkable?(oe=o.checked)!=null?oe:h.value:!0}),{mergedSize:T}=nr(s),y=j(()=>T.value==="mini"?"small":T.value),S=oe=>{d.value=!1,n("update:visible",!1),n("close",oe)},P=oe=>{if(o.checkable){const ne=!f.value;h.value=ne,n("update:checked",ne),n("check",ne,oe)}},x=j(()=>[l,`${l}-size-${y.value}`,{[`${l}-loading`]:o.loading,[`${l}-hide`]:!p.value,[`${l}-${o.color}`]:a.value,[`${l}-bordered`]:o.bordered,[`${l}-checkable`]:o.checkable,[`${l}-checked`]:f.value,[`${l}-custom-color`]:u.value}]),G=j(()=>{if(u.value)return{backgroundColor:o.color}});return{prefixCls:l,cls:x,style:G,computedVisible:p,computedChecked:f,handleClick:P,handleClose:S}}});function XN(o,n,s,l,a,u){const d=_t("icon-close"),h=_t("icon-hover"),p=_t("icon-loading");return o.computedVisible?(me(),Fe("span",{key:0,class:Pe(o.cls),style:It(o.style),onClick:n[0]||(n[0]=(...f)=>o.handleClick&&o.handleClick(...f))},[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),ct(o.$slots,"default"),o.closable?(me(),it(h,{key:1,role:"button","aria-label":"Close",prefix:o.prefixCls,class:Pe(`${o.prefixCls}-close-btn`),onClick:er(o.handleClose,["stop"])},{default:De(()=>[ct(o.$slots,"close-icon",{},()=>[Q(d)])]),_:3},8,["prefix","class","onClick"])):ut("v-if",!0),o.loading?(me(),Fe("span",{key:2,class:Pe(`${o.prefixCls}-loading-icon`)},[Q(p)],2)):ut("v-if",!0)],6)):ut("v-if",!0)}var N_=dt(zN,[["render",XN]]);const jN=Object.assign(N_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+N_.name,N_)}});var YN=Object.defineProperty,K1=Object.getOwnPropertySymbols,KN=Object.prototype.hasOwnProperty,QN=Object.prototype.propertyIsEnumerable,Q1=(o,n,s)=>n in o?YN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,vu=(o,n)=>{for(var s in n||(n={}))KN.call(n,s)&&Q1(o,s,n[s]);if(K1)for(var s of K1(n))QN.call(n,s)&&Q1(o,s,n[s]);return o};const qN={value:"value",label:"label",closable:"closable",tagProps:"tagProps"};var w_=Ke({name:"InputTag",inheritAttrs:!1,props:{modelValue:{type:Array},defaultValue:{type:Array,default:()=>[]},inputValue:String,defaultInputValue:{type:String,default:""},placeholder:String,disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},size:{type:String},maxTagCount:{type:Number,default:0},retainInputValue:{type:[Boolean,Object],default:!1},formatTag:{type:Function},uniqueValue:{type:Boolean,default:!1},fieldNames:{type:Object},baseCls:String,focused:Boolean,disabledInput:Boolean,uninjectFormItemContext:Boolean},emits:{"update:modelValue":o=>!0,"update:inputValue":o=>!0,change:(o,n)=>!0,inputValueChange:(o,n)=>!0,pressEnter:(o,n)=>!0,remove:(o,n)=>!0,clear:o=>!0,focus:o=>!0,blur:o=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{size:a,disabled:u,error:d,uninjectFormItemContext:h,modelValue:p}=Pt(o),f=o.baseCls||ot("input-tag"),T=ge(),y=ge(),{mergedSize:S,mergedDisabled:P,mergedError:x,feedback:G,eventHandlers:oe}=si({size:a,disabled:u,error:d,uninject:h==null?void 0:h.value}),{mergedSize:ne}=nr(S),Z=j(()=>vu(vu({},qN),o.fieldNames)),Y=ge(!1),M=ge(o.defaultValue),L=ge(o.defaultInputValue),R=ge(!1),F=ge(""),z=j(()=>ko(o.retainInputValue)?vu({create:!1,blur:!1},o.retainInputValue):{create:o.retainInputValue,blur:o.retainInputValue}),X=Jt({width:"12px"}),le=j(()=>o.focused||Y.value),$e=(A,K)=>{L.value=A,n("update:inputValue",A),n("inputValueChange",A,K)},he=A=>{var K;const{value:U}=A.target;A.type==="compositionend"?(R.value=!1,F.value="",$e(U,A),Io(()=>{T.value&&ke.value!==T.value.value&&(T.value.value=ke.value)})):(R.value=!0,F.value=ke.value+((K=A.data)!=null?K:""))},fe=j(()=>{var A;return(A=o.modelValue)!=null?A:M.value}),ke=j(()=>{var A;return(A=o.inputValue)!=null?A:L.value});Et(p,A=>{(rs(A)||Tl(A))&&(M.value=[])});const re=A=>{T.value&&A.target!==T.value&&(A.preventDefault(),T.value.focus())},Ie=A=>{const{value:K}=A.target;R.value||($e(K,A),Io(()=>{T.value&&ke.value!==T.value.value&&(T.value.value=ke.value)}))},D=j(()=>WN(fe.value,Z.value)),B=j(()=>{if(o.maxTagCount>0){const A=D.value.length-o.maxTagCount;if(A>0){const K=D.value.slice(0,o.maxTagCount),U={value:"__arco__more",label:`+${A}...`,closable:!1};return K.push(vu({raw:U},U)),K}}return D.value}),ae=(A,K)=>{var U,de;M.value=A,n("update:modelValue",A),n("change",A,K),(de=(U=oe.value)==null?void 0:U.onChange)==null||de.call(U,K)},_e=(A,K,U)=>{var de;const Te=(de=fe.value)==null?void 0:de.filter((se,Ce)=>Ce!==K);ae(Te,U),n("remove",A,U)},Me=A=>{ae([],A),n("clear",A)},Xe=j(()=>!P.value&&!o.readonly&&o.allowClear&&!!fe.value.length),Je=A=>{var K;if(ke.value){if(A.preventDefault(),o.uniqueValue&&((K=fe.value)!=null&&K.includes(ke.value))){n("pressEnter",ke.value,A);return}const U=fe.value.concat(ke.value);ae(U,A),n("pressEnter",ke.value,A),z.value.create||$e("",A)}},we=A=>{var K,U;Y.value=!0,n("focus",A),(U=(K=oe.value)==null?void 0:K.onFocus)==null||U.call(K,A)},We=A=>{var K,U;Y.value=!1,!z.value.blur&&ke.value&&$e("",A),n("blur",A),(U=(K=oe.value)==null?void 0:K.onBlur)==null||U.call(K,A)},Ze=()=>{for(let A=D.value.length-1;A>=0;A--)if(D.value[A].closable)return A;return-1},nt=A=>{const K=A.key||A.code;if(!R.value&&ke.value&&K===gg.key&&Je(A),!R.value&&B.value.length>0&&!ke.value&&K===uA.key){const U=Ze();U>=0&&_e(D.value[U].value,U,A)}},ht=A=>{A>12?X.width=`${A}px`:X.width="12px"};zt(()=>{y.value&&ht(y.value.offsetWidth)});const et=()=>{y.value&&ht(y.value.offsetWidth)};Et(ke,A=>{T.value&&!R.value&&A!==T.value.value&&(T.value.value=A)});const xe=j(()=>[f,`${f}-size-${ne.value}`,{[`${f}-disabled`]:P.value,[`${f}-disabled-input`]:o.disabledInput,[`${f}-error`]:x.value,[`${f}-focus`]:le.value,[`${f}-readonly`]:o.readonly,[`${f}-has-tag`]:B.value.length>0,[`${f}-has-prefix`]:!!s.prefix,[`${f}-has-suffix`]:!!s.suffix||Xe.value||G.value,[`${f}-has-placeholder`]:!fe.value.length}]),w=j(()=>Hc(l,hl)),I=j(()=>fg(l,hl));return{inputRef:T,render:()=>{var A;return Q("span",Ot({class:xe.value,onMousedown:re},w.value),[Q(cI,{onResize:et},{default:()=>[Q("span",{ref:y,class:`${f}-mirror`},[B.value.length>0?F.value||ke.value:F.value||ke.value||o.placeholder])]}),s.prefix&&Q("span",{class:`${f}-prefix`},[s.prefix()]),Q(M3,{tag:"span",name:"input-tag-zoom",class:`${f}-inner`},{default:()=>[B.value.map((K,U)=>Q(jN,Ot({key:`tag-${K.value}`,class:`${f}-tag`,closable:!P.value&&!o.readonly&&K.closable,visible:!0},K.tagProps,{onClose:de=>_e(K.value,U,de)}),{default:()=>{var de,Te,se,Ce;return[(Ce=(se=(de=s.tag)==null?void 0:de.call(s,{data:K.raw}))!=null?se:(Te=o.formatTag)==null?void 0:Te.call(o,K.raw))!=null?Ce:K.label]}})),Q("input",Ot(I.value,{ref:T,key:"input-tag-input",class:`${f}-input`,style:X,placeholder:B.value.length===0?o.placeholder:void 0,disabled:P.value,readonly:o.readonly||o.disabledInput,onInput:Ie,onKeydown:nt,onFocus:we,onBlur:We,onCompositionstart:he,onCompositionupdate:he,onCompositionend:he}),null)]}),Xe.value&&Q(oi,{class:`${f}-clear-btn`,onClick:Me,onMousedown:K=>K.stopPropagation()},{default:()=>[Q(El,null,null)]}),(s.suffix||!!G.value)&&Q("span",{class:`${f}-suffix`},[(A=s.suffix)==null?void 0:A.call(s),!!G.value&&Q(_g,{type:G.value},null)])])}}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const JN=Object.assign(w_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+w_.name,w_)}});var q1=Ke({name:"SelectView",props:{modelValue:{type:Array,required:!0},inputValue:String,placeholder:String,disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},opened:{type:Boolean,default:!1},size:{type:String},bordered:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},allowSearch:{type:Boolean,default:o=>jo(o.modelValue)},maxTagCount:{type:Number,default:0},retainInputValue:{type:Boolean,default:!1}},emits:["remove","clear","focus","blur"],setup(o,{emit:n,slots:s}){const{size:l,disabled:a,error:u}=Pt(o),d=ot("select-view"),{feedback:h,eventHandlers:p,mergedDisabled:f,mergedSize:T,mergedError:y}=si({size:l,disabled:a,error:u}),{mergedSize:S}=nr(T),{opened:P}=Pt(o),x=ge(),G=j(()=>{var $e;return($e=x.value)==null?void 0:$e.inputRef}),oe=j(()=>o.modelValue.length===0),ne=j(()=>o.allowSearch||o.allowCreate),Z=j(()=>o.allowClear&&!o.disabled&&!oe.value),Y=$e=>{var he,fe;n("focus",$e),(fe=(he=p.value)==null?void 0:he.onFocus)==null||fe.call(he,$e)},M=$e=>{var he,fe;n("blur",$e),(fe=(he=p.value)==null?void 0:he.onBlur)==null||fe.call(he,$e)},L=$e=>{n("remove",$e)},R=$e=>{n("clear",$e)},F=()=>{var $e,he,fe,ke;return o.loading?(he=($e=s["loading-icon"])==null?void 0:$e.call(s))!=null?he:Q(ir,null,null):o.allowSearch&&o.opened?(ke=(fe=s["search-icon"])==null?void 0:fe.call(s))!=null?ke:Q(N0,null,null):s["arrow-icon"]?s["arrow-icon"]():Q(SN,{class:`${d}-arrow-icon`},null)},z=()=>Q(Wt,null,[Z.value&&Q(oi,{class:`${d}-clear-btn`,onClick:R,onMousedown:$e=>$e.stopPropagation()},{default:()=>[Q(El,null,null)]}),Q("span",{class:`${d}-icon`},[F()]),!!h.value&&Q(_g,{type:h.value},null)]);Et(P,$e=>{!$e&&G.value&&G.value.isSameNode(document.activeElement)&&G.value.blur()});const X=j(()=>[`${d}-${o.multiple?"multiple":"single"}`,{[`${d}-opened`]:o.opened,[`${d}-borderless`]:!o.bordered}]);return{inputRef:G,handleFocus:Y,handleBlur:M,render:()=>o.multiple?Q(JN,{ref:x,baseCls:d,class:X.value,modelValue:o.modelValue,inputValue:o.inputValue,focused:o.opened,placeholder:o.placeholder,disabled:f.value,size:S.value,error:y.value,maxTagCount:o.maxTagCount,disabledInput:!o.allowSearch&&!o.allowCreate,retainInputValue:!0,uninjectFormItemContext:!0,onRemove:L,onFocus:Y,onBlur:M},{prefix:s.prefix,suffix:z,tag:s.label}):Q(FN,{ref:x,baseCls:d,class:X.value,modelValue:o.modelValue[0],inputValue:o.inputValue,focused:o.opened,placeholder:o.placeholder,disabled:f.value,size:S.value,error:y.value,enabledInput:ne.value,uninjectFormItemContext:!0,onFocus:Y,onBlur:M},{default:s.label,prefix:s.prefix,suffix:z})}},methods:{focus(){this.inputRef&&this.inputRef.focus()},blur(){this.inputRef&&this.inputRef.blur()}},render(){return this.render()}});const ZN=Ke({name:"Optgroup",props:{label:{type:String}},setup(){return{prefixCls:ot("select-group")}}});function ew(o,n,s,l,a,u){return me(),Fe(Wt,null,[Le("li",{class:Pe(`${o.prefixCls}-title`)},[ct(o.$slots,"label",{},()=>[Ut(Ci(o.label),1)])],2),ct(o.$slots,"default")],64)}var Nu=dt(ZN,[["render",ew]]);const J1=typeof window>"u"?global:window;function tw(o,n){let s=0;return(...l)=>{s&&J1.clearTimeout(s),s=J1.setTimeout(()=>{s=0,o(...l)},n)}}var ow=Object.defineProperty,sw=Object.defineProperties,iw=Object.getOwnPropertyDescriptors,Z1=Object.getOwnPropertySymbols,nw=Object.prototype.hasOwnProperty,rw=Object.prototype.propertyIsEnumerable,eb=(o,n,s)=>n in o?ow(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,gc=(o,n)=>{for(var s in n||(n={}))nw.call(n,s)&&eb(o,s,n[s]);if(Z1)for(var s of Z1(n))rw.call(n,s)&&eb(o,s,n[s]);return o},lw=(o,n)=>sw(o,iw(n));function cw(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!al(o)}const aw={value:"value",label:"label",disabled:"disabled",tagProps:"tagProps",render:"render"};var M_=Ke({name:"Select",components:{Trigger:zu,SelectView:q1},inheritAttrs:!1,props:{multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Object,Array]},defaultValue:{type:[String,Number,Object,Array],default:o=>rs(o.multiple)?"":[]},inputValue:{type:String},defaultInputValue:{type:String,default:""},size:{type:String},placeholder:String,loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},allowSearch:{type:[Boolean,Object],default:o=>!!o.multiple},allowCreate:{type:Boolean,default:!1},maxTagCount:{type:Number,default:0},popupContainer:{type:[String,Object]},bordered:{type:Boolean,default:!0},defaultActiveFirstOption:{type:Boolean,default:!0},popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},unmountOnClose:{type:Boolean,default:!1},filterOption:{type:[Boolean,Function],default:!0},options:{type:Array,default:()=>[]},virtualListProps:{type:Object},triggerProps:{type:Object},formatLabel:{type:Function},fallbackOption:{type:[Boolean,Function],default:!0},showExtraOptions:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},searchDelay:{type:Number,default:500},limit:{type:Number,default:0},fieldNames:{type:Object},scrollbar:{type:[Boolean,Object],default:!0},showHeaderOnEmpty:{type:Boolean,default:!1},showFooterOnEmpty:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,"update:inputValue":o=>!0,"update:popupVisible":o=>!0,change:o=>!0,inputValueChange:o=>!0,popupVisibleChange:o=>!0,clear:o=>!0,remove:o=>!0,search:o=>!0,dropdownScroll:o=>!0,dropdownReachBottom:o=>!0,exceedLimit:(o,n)=>!0},setup(o,{slots:n,emit:s,attrs:l}){const{size:a,disabled:u,error:d,options:h,filterOption:p,valueKey:f,multiple:T,popupVisible:y,showExtraOptions:S,modelValue:P,fieldNames:x,loading:G,defaultActiveFirstOption:oe}=Pt(o),ne=ot("select"),{mergedSize:Z,mergedDisabled:Y,mergedError:M,eventHandlers:L}=si({size:a,disabled:u,error:d}),R=j(()=>o.virtualListProps?"div":"li"),F=j(()=>ko(o.allowSearch)&&!!o.allowSearch.retainInputValue);j(()=>{if(bo(o.formatLabel))return ee=>{const ie=de.get(ee.value);return o.formatLabel(ie)}});const z=ge(),X=ge({}),le=ge(),{computedPopupVisible:$e,handlePopupVisibleChange:he}=kN({popupVisible:y,emit:s}),fe=ge(o.defaultValue),ke=j(()=>{var ee;const ie=(ee=o.modelValue)!=null?ee:fe.value;return(jo(ie)?ie:ie||vt(ie)||ki(ie)?[ie]:[]).map(ye=>({value:ye,key:xc(ye,o.valueKey)}))});Et(P,ee=>{(rs(ee)||Tl(ee))&&(fe.value=T.value?[]:ee)});const re=j(()=>ke.value.map(ee=>ee.key)),Ie=j(()=>gc(gc({},aw),x==null?void 0:x.value)),D=ge(),B=ee=>{const ie={};return ee.forEach(ue=>{ie[ue]=de.get(ue)}),ie},ae=ee=>{D.value=B(ee)},_e=ee=>bo(o.fallbackOption)?o.fallbackOption(ee):{[Ie.value.value]:ee,[Ie.value.label]:String(ko(ee)?ee[f==null?void 0:f.value]:ee)},Me=()=>{const ee=[],ie=[];if(o.allowCreate||o.fallbackOption){for(const ue of ke.value)if(!ie.includes(ue.key)&&ue.value!==""){const ye=de.get(ue.key);(!ye||ye.origin==="extraOptions")&&(ee.push(ue),ie.push(ue.key))}}if(o.allowCreate&&We.value){const ue=xc(We.value);if(!ie.includes(ue)){const ye=de.get(ue);(!ye||ye.origin==="extraOptions")&&ee.push({value:We.value,key:ue})}}return ee},Xe=ge([]),Je=j(()=>Xe.value.map(ee=>{var ie;let ue=_e(ee.value);const ye=(ie=D.value)==null?void 0:ie[ee.key];return!rs(ye)&&!W3(ye)&&(ue=gc(gc({},ue),ye)),ue}));Io(()=>{eg(()=>{var ee;const ie=Me();if(ie.length!==Xe.value.length)Xe.value=ie;else if(ie.length>0){for(let ue=0;ue{var ee;return(ee=o.inputValue)!=null?ee:we.value});Et($e,ee=>{!ee&&!F.value&&We.value&&ht("")});const Ze=ee=>{var ie,ue;return o.multiple?ee.map(ye=>{var E,g;return(g=(E=de.get(ye))==null?void 0:E.value)!=null?g:""}):(ue=(ie=de.get(ee[0]))==null?void 0:ie.value)!=null?ue:qL(de)?void 0:""},nt=ee=>{var ie,ue;const ye=Ze(ee);fe.value=ye,s("update:modelValue",ye),s("change",ye),(ue=(ie=L.value)==null?void 0:ie.onChange)==null||ue.call(ie),ae(ee)},ht=ee=>{we.value=ee,s("update:inputValue",ee),s("inputValueChange",ee)},et=(ee,ie)=>{if(o.multiple){if(re.value.includes(ee)){const ue=re.value.filter(ye=>ye!==ee);nt(ue)}else if(se.value.includes(ee))if(o.limit>0&&re.value.length>=o.limit){const ue=de.get(ee);s("exceedLimit",ue==null?void 0:ue.value,ie)}else{const ue=re.value.concat(ee);nt(ue)}F.value||ht("")}else{if(ee!==re.value[0]&&nt([ee]),F.value){const ue=de.get(ee);ue&&ht(ue.label)}he(!1)}},xe=tw(ee=>{s("search",ee)},o.searchDelay),w=ee=>{ee!==We.value&&($e.value||he(!0),ht(ee),o.allowSearch&&xe(ee))},I=ee=>{const ie=de.get(ee),ue=re.value.filter(ye=>ye!==ee);nt(ue),s("remove",ie==null?void 0:ie.value)},N=ee=>{ee==null||ee.stopPropagation();const ie=re.value.filter(ue=>{var ye;return(ye=de.get(ue))==null?void 0:ye.disabled});nt(ie),ht(""),s("clear",ee)},A=ee=>{s("dropdownScroll",ee)},K=ee=>{s("dropdownReachBottom",ee)},{validOptions:U,optionInfoMap:de,validOptionInfos:Te,enabledOptionKeys:se,handleKeyDown:Ce}=hN({multiple:T,options:h,extraOptions:Je,inputValue:We,filterOption:p,showExtraOptions:S,component:R,valueKey:f,fieldNames:x,loading:G,popupVisible:$e,valueKeys:re,dropdownRef:z,optionRefs:X,virtualListRef:le,defaultActiveFirstOption:oe,onSelect:et,onPopupVisibleChange:he}),ce=j(()=>{var ee;const ie=[];for(const ue of ke.value){const ye=de.get(ue.key);ye&&ie.push(lw(gc({},ye),{value:ue.key,label:(ee=ye==null?void 0:ye.label)!=null?ee:String(ko(ue.value)?ue.value[f==null?void 0:f.value]:ue.value),closable:!(ye!=null&&ye.disabled),tagProps:ye==null?void 0:ye.tagProps}))}return ie}),Se=ee=>{if(bo(n.option)){const ie=n.option;return()=>ie({data:ee.raw})}return bo(ee.render)?ee.render:()=>ee.label},Ne=ee=>{if(II(ee)){let ie;return Q(Nu,{key:ee.key,label:ee.label},cw(ie=ee.options.map(ue=>Ne(ue)))?ie:{default:()=>[ie]})}return hd(ee,{inputValue:We.value,filterOption:p==null?void 0:p.value})?Q(ll,{ref:ie=>{ie!=null&&ie.$el&&(X.value[ee.key]=ie.$el)},key:ee.key,value:ee.value,label:ee.label,disabled:ee.disabled,internal:!0},{default:Se(ee)}):null},He=()=>Q(VL,{ref:z,loading:o.loading,empty:Te.value.length===0,virtualList:!!o.virtualListProps,scrollbar:o.scrollbar,showHeaderOnEmpty:o.showHeaderOnEmpty,showFooterOnEmpty:o.showFooterOnEmpty,onScroll:A,onReachBottom:K},{default:()=>{var ee,ie;return[...(ie=(ee=n.default)==null?void 0:ee.call(n))!=null?ie:[],...U.value.map(Ne)]},"virtual-list":()=>Q(bN,Ot(o.virtualListProps,{ref:le,data:U.value}),{item:({item:ee})=>Ne(ee)}),empty:n.empty,header:n.header,footer:n.footer}),be=({data:ee})=>{var ie,ue,ye,E;if((n.label||bo(o.formatLabel))&&ee){const g=de.get(ee.value);if(g!=null&&g.raw)return(ye=(ie=n.label)==null?void 0:ie.call(n,{data:g.raw}))!=null?ye:(ue=o.formatLabel)==null?void 0:ue.call(o,g.raw)}return(E=ee==null?void 0:ee.label)!=null?E:""};return()=>Q(zu,Ot({trigger:"click",position:"bl",popupOffset:4,animationName:"slide-dynamic-origin",hideEmpty:!0,preventFocus:!0,autoFitPopupWidth:!0,autoFitTransformOrigin:!0,disabled:Y.value,popupVisible:$e.value,unmountOnClose:o.unmountOnClose,clickToClose:!(o.allowSearch||o.allowCreate),popupContainer:o.popupContainer,onPopupVisibleChange:he},o.triggerProps),{default:()=>{var ee,ie;return[(ie=(ee=n.trigger)==null?void 0:ee.call(n))!=null?ie:Q(q1,Ot({class:ne,modelValue:ce.value,inputValue:We.value,multiple:o.multiple,disabled:Y.value,error:M.value,loading:o.loading,allowClear:o.allowClear,allowCreate:o.allowCreate,allowSearch:!!o.allowSearch,opened:$e.value,maxTagCount:o.maxTagCount,placeholder:o.placeholder,bordered:o.bordered,size:Z.value,onInputValueChange:w,onRemove:I,onClear:N,onKeydown:Ce},l),{label:be,prefix:n.prefix,"arrow-icon":n["arrow-icon"],"loading-icon":n["loading-icon"],"search-icon":n["search-icon"]})]},content:He})}});const yI=Object.assign(M_,{Option:ll,OptGroup:Nu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+M_.name,M_),o.component(s+ll.name,ll),o.component(s+Nu.name,Nu)}}),SI=Symbol("RadioGroup");var wu=Ke({name:"Radio",components:{IconHover:oi},props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultChecked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:!0},type:{type:String,default:"radio"},disabled:{type:Boolean,default:!1},uninjectGroupContext:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const l=ot("radio"),{modelValue:a}=Pt(o),u=o.uninjectGroupContext?void 0:ho(SI,void 0),{mergedDisabled:d,eventHandlers:h}=si({disabled:m0(o,"disabled")}),p=ge(null),f=ge(o.defaultChecked),T=j(()=>(u==null?void 0:u.name)==="ArcoRadioGroup"),y=j(()=>{var M;return(M=u==null?void 0:u.type)!=null?M:o.type}),S=j(()=>(u==null?void 0:u.disabled)||d.value),P=j(()=>{var M,L;return T.value?(u==null?void 0:u.value)===((M=o.value)!=null?M:!0):rs(o.modelValue)?f.value:o.modelValue===((L=o.value)!=null?L:!0)});Et(a,M=>{(rs(M)||Tl(M))&&(f.value=!1)}),Et(P,(M,L)=>{M!==L&&(f.value=M,p.value&&(p.value.checked=M))});const x=M=>{var L,R;(R=(L=h.value)==null?void 0:L.onFocus)==null||R.call(L,M)},G=M=>{var L,R;(R=(L=h.value)==null?void 0:L.onBlur)==null||R.call(L,M)},oe=M=>{M.stopPropagation()},ne=M=>{var L,R,F,z,X;f.value=!0,T.value?u==null||u.handleChange((L=o.value)!=null?L:!0,M):(n("update:modelValue",(R=o.value)!=null?R:!0),n("change",(F=o.value)!=null?F:!0,M),(X=(z=h.value)==null?void 0:z.onChange)==null||X.call(z,M)),Io(()=>{p.value&&p.value.checked!==P.value&&(p.value.checked=P.value)})},Z=j(()=>[`${y.value==="button"?`${l}-button`:l}`,{[`${l}-checked`]:P.value,[`${l}-disabled`]:S.value}]),Y=()=>Q(Wt,null,[Q(_t("icon-hover"),{class:`${l}-icon-hover`,disabled:S.value||P.value},{default:()=>[Q("span",{class:`${l}-icon`},null)]}),s.default&&Q("span",{class:`${l}-label`},[s.default()])]);return()=>{var M,L,R,F;return Q("label",{class:Z.value},[Q("input",{ref:p,type:"radio",checked:P.value,value:o.value,class:`${l}-target`,disabled:S.value,onClick:oe,onChange:ne,onFocus:x,onBlur:G},null),y.value==="radio"?(F=(R=(L=s.radio)!=null?L:(M=u==null?void 0:u.slots)==null?void 0:M.radio)==null?void 0:R({checked:P.value,disabled:S.value}))!=null?F:Y():Q("span",{class:`${l}-button-content`},[s.default&&s.default()])])}}}),Mu=Ke({name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean],default:""},type:{type:String,default:"radio"},size:{type:String},options:{type:Array},direction:{type:String,default:"horizontal"},disabled:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const l=ot("radio-group"),{size:a,type:u,disabled:d,modelValue:h}=Pt(o),{mergedDisabled:p,mergedSize:f,eventHandlers:T}=si({size:a,disabled:d}),y=ge(o.defaultValue),S=j(()=>{var ne;return(ne=o.modelValue)!=null?ne:y.value}),P=j(()=>{var ne;return((ne=o.options)!=null?ne:[]).map(Z=>ki(Z)||vt(Z)?{label:Z,value:Z}:Z)});hn(SI,Jt({name:"ArcoRadioGroup",value:S,size:f,type:u,disabled:p,slots:s,handleChange:(ne,Z)=>{var Y,M;y.value=ne,n("update:modelValue",ne),n("change",ne,Z),(M=(Y=T.value)==null?void 0:Y.onChange)==null||M.call(Y,Z)}})),Et(S,ne=>{y.value!==ne&&(y.value=ne)}),Et(h,ne=>{(rs(ne)||Tl(ne))&&(y.value="")});const G=j(()=>[`${l}${o.type==="button"?"-button":""}`,`${l}-size-${f.value}`,`${l}-direction-${o.direction}`,{[`${l}-disabled`]:p.value}]),oe=()=>P.value.map(ne=>Q(wu,{key:ne.value,value:ne.value,disabled:ne.disabled,modelValue:S.value===ne.value},{default:()=>[s.label?s.label({data:ne}):bo(ne.label)?ne.label():ne.label]}));return()=>{var ne;return Q("span",{class:G.value},[P.value.length>0?oe():(ne=s.default)==null?void 0:ne.call(s)])}}});const uw=Object.assign(wu,{Group:Mu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+wu.name,wu),o.component(s+Mu.name,Mu)}}),dw=Ke({name:"IconLeft",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-left`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),hw=["stroke-width","stroke-linecap","stroke-linejoin"],pw=Le("path",{d:"M32 8.4 16.444 23.956 32 39.513"},null,-1),$w=[pw];function _w(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},$w,14,hw)}var D_=dt(dw,[["render",_w]]);const RI=Object.assign(D_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+D_.name,D_)}});function gw(o){const n=ge(o);return[n,l=>{n.value=l}]}var fw=Ke({name:"RenderFunction",props:{renderFunc:{type:Function,required:!0}},render(){return this.renderFunc(this.$attrs)}});function Xu(o,n){const{value:s}=Pt(n),[l,a]=gw(rs(s.value)?o:s.value);return Et(s,d=>{rs(d)&&a(void 0)}),[j(()=>rs(s.value)?l.value:s.value),a,l]}var mw=Object.defineProperty,Tw=Object.defineProperties,Ew=Object.getOwnPropertyDescriptors,tb=Object.getOwnPropertySymbols,bw=Object.prototype.hasOwnProperty,vw=Object.prototype.propertyIsEnumerable,ob=(o,n,s)=>n in o?mw(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Iw=(o,n)=>{for(var s in n||(n={}))bw.call(n,s)&&ob(o,s,n[s]);if(tb)for(var s of tb(n))vw.call(n,s)&&ob(o,s,n[s]);return o},Ow=(o,n)=>Tw(o,Ew(n));const Iu={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"};let Gn=[],Cw=-1,Ou={};const sb={matchHandlers:{},dispatch(o,n){return Ou=o,Gn.length<1?!1:(Gn.forEach(s=>{s.func(Ou,n)}),!0)},subscribe(o){Gn.length===0&&this.register();const n=(++Cw).toString();return Gn.push({token:n,func:o}),o(Ou,null),n},unsubscribe(o){Gn=Gn.filter(n=>n.token!==o),Gn.length===0&&this.unregister()},unregister(){Object.keys(Iu).forEach(o=>{const n=Iu[o];if(!n)return;const s=this.matchHandlers[n];s&&s.mql&&s.listener&&(s.mql.removeEventListener?s.mql.removeEventListener("change",s.listener):s.mql.removeListener(s.listener))})},register(){Object.keys(Iu).forEach(o=>{const n=Iu[o];if(!n)return;const s=({matches:a})=>{this.dispatch(Ow(Iw({},Ou),{[o]:a}),o)},l=window.matchMedia(n);l.addEventListener?l.addEventListener("change",s):l.addListener(s),this.matchHandlers[n]={mql:l,listener:s},s(l)})}};var P_=Ke({name:"Divider",props:{direction:{type:String,default:"horizontal"},orientation:{type:String,default:"center"},type:{type:String},size:{type:Number},margin:{type:[Number,String]}},setup(o,{slots:n}){const s=ot("divider"),l=j(()=>o.direction==="horizontal"),a=j(()=>{const u={};if(o.size&&(u[l.value?"border-bottom-width":"border-left-width"]=vt(o.size)?`${o.size}px`:o.size),o.type&&(u[l.value?"border-bottom-style":"border-left-style"]=o.type),!rs(o.margin)){const d=vt(o.margin)?`${o.margin}px`:o.margin;u.margin=l.value?`${d} 0`:`0 ${d}`}return u});return()=>{var u;const d=(u=n.default)==null?void 0:u.call(n),h=[s,`${s}-${o.direction}`,{[`${s}-with-text`]:d}];return Q("div",{role:"separator",class:h,style:a.value},[d&&o.direction==="horizontal"&&Q("span",{class:[`${s}-text`,`${s}-text-${o.orientation}`]},[d])])}}});const yw=Object.assign(P_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+P_.name,P_)}}),Sw=o=>{const n=ge(!1),s={overflow:"",width:"",boxSizing:""};return{setOverflowHidden:()=>{if(o.value){const u=o.value;if(!n.value&&u.style.overflow!=="hidden"){const d=Sk(u);(d>0||yk(u))&&(s.overflow=u.style.overflow,s.width=u.style.width,s.boxSizing=u.style.boxSizing,u.style.overflow="hidden",u.style.width=`${u.offsetWidth-d}px`,u.style.boxSizing="border-box",n.value=!0)}}},resetOverflow:()=>{if(o.value&&n.value){const u=o.value;u.style.overflow=s.overflow,u.style.width=s.width,u.style.boxSizing=s.boxSizing,n.value=!1}}}};var Rw=Object.defineProperty,ib=Object.getOwnPropertySymbols,kw=Object.prototype.hasOwnProperty,Aw=Object.prototype.propertyIsEnumerable,nb=(o,n,s)=>n in o?Rw(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,rb=(o,n)=>{for(var s in n||(n={}))kw.call(n,s)&&nb(o,s,n[s]);if(ib)for(var s of ib(n))Aw.call(n,s)&&nb(o,s,n[s]);return o};const Lw=Ke({name:"Tooltip",components:{Trigger:zu},props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},content:String,position:{type:String,default:"top"},mini:{type:Boolean,default:!1},backgroundColor:{type:String},contentClass:{type:[String,Array,Object]},contentStyle:{type:Object},arrowClass:{type:[String,Array,Object]},arrowStyle:{type:Object},popupContainer:{type:[String,Object]}},emits:{"update:popupVisible":o=>!0,popupVisibleChange:o=>!0},setup(o,{emit:n}){const s=ot("tooltip"),l=ge(o.defaultPopupVisible),a=j(()=>{var T;return(T=o.popupVisible)!=null?T:l.value}),u=T=>{l.value=T,n("update:popupVisible",T),n("popupVisibleChange",T)},d=j(()=>[`${s}-content`,o.contentClass,{[`${s}-mini`]:o.mini}]),h=j(()=>{if(o.backgroundColor||o.contentStyle)return rb({backgroundColor:o.backgroundColor},o.contentStyle)}),p=j(()=>[`${s}-popup-arrow`,o.arrowClass]),f=j(()=>{if(o.backgroundColor||o.arrowStyle)return rb({backgroundColor:o.backgroundColor},o.arrowStyle)});return{prefixCls:s,computedPopupVisible:a,contentCls:d,computedContentStyle:h,arrowCls:p,computedArrowStyle:f,handlePopupVisibleChange:u}}});function Nw(o,n,s,l,a,u){const d=_t("Trigger");return me(),it(d,{class:Pe(o.prefixCls),trigger:"hover",position:o.position,"popup-visible":o.computedPopupVisible,"popup-offset":10,"show-arrow":"","content-class":o.contentCls,"content-style":o.computedContentStyle,"arrow-class":o.arrowCls,"arrow-style":o.computedArrowStyle,"popup-container":o.popupContainer,"animation-name":"zoom-in-fade-out","auto-fit-transform-origin":"",role:"tooltip",onPopupVisibleChange:o.handlePopupVisibleChange},{content:De(()=>[ct(o.$slots,"content",{},()=>[Ut(Ci(o.content),1)])]),default:De(()=>[ct(o.$slots,"default")]),_:3},8,["class","position","popup-visible","content-class","content-style","arrow-class","arrow-style","popup-container","onPopupVisibleChange"])}var x_=dt(Lw,[["render",Nw]]);const D0=Object.assign(x_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+x_.name,x_)}}),ww=Ke({name:"ImagePreviewArrow",components:{IconLeft:RI,IconRight:OI},props:{onPrev:{type:Function},onNext:{type:Function}},setup(){return{prefixCls:ot("image-preview-arrow")}}});function Mw(o,n,s,l,a,u){const d=_t("icon-left"),h=_t("icon-right");return me(),Fe("div",{class:Pe(o.prefixCls)},[Le("div",{class:Pe([`${o.prefixCls}-left`,{[`${o.prefixCls}-disabled`]:!o.onPrev}]),onClick:n[0]||(n[0]=p=>{p.preventDefault(),o.onPrev&&o.onPrev()})},[Q(d)],2),Le("div",{class:Pe([`${o.prefixCls}-right`,{[`${o.prefixCls}-disabled`]:!o.onNext}]),onClick:n[1]||(n[1]=p=>{p.preventDefault(),o.onNext&&o.onNext()})},[Q(h)],2)],2)}var Dw=dt(ww,[["render",Mw]]);function Pw(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!al(o)}var kI=Ke({name:"ImagePreviewAction",components:{Tooltip:D0},inheritAttrs:!1,props:{name:{type:String},disabled:{type:Boolean}},setup(o,{slots:n,attrs:s}){const l=ot("image-preview-toolbar-action");return()=>{var a;const{name:u,disabled:d}=o,h=(a=n.default)==null?void 0:a.call(n);if(!h||!h.length)return null;const p=Q("div",Ot({class:[`${l}`,{[`${l}-disabled`]:d}],onMousedown:f=>{f.preventDefault()}},s),[Q("span",{class:`${l}-content`},[h])]);return u?Q(D0,{class:`${l}-tooltip`,content:u},Pw(p)?p:{default:()=>[p]}):p}}}),xw=Ke({name:"ImagePreviewToolbar",components:{RenderFunction:fw,PreviewAction:kI},props:{actions:{type:Array,default:()=>[]},actionsLayout:{type:Array,default:()=>[]}},setup(o){const{actions:n,actionsLayout:s}=Pt(o),l=ot("image-preview-toolbar"),a=j(()=>{const u=new Set(s.value),d=p=>u.has(p.key);return n.value.filter(d).sort((p,f)=>{const T=s.value.indexOf(p.key),y=s.value.indexOf(f.key);return T>y?1:-1})});return{prefixCls:l,resultActions:a}}});function Bw(o,n,s,l,a,u){const d=_t("RenderFunction"),h=_t("PreviewAction");return me(),Fe("div",{class:Pe(o.prefixCls)},[(me(!0),Fe(Wt,null,id(o.resultActions,p=>(me(),it(h,{key:p.key,name:p.name,disabled:p.disabled,onClick:p.onClick},{default:De(()=>[Q(d,{"render-func":p.content},null,8,["render-func"])]),_:2},1032,["name","disabled","onClick"]))),128)),ct(o.$slots,"default")],2)}var Fw=dt(xw,[["render",Bw]]);function Uw(o){const n=ge(o||"beforeLoad"),s=j(()=>n.value==="beforeLoad"),l=j(()=>n.value==="loading"),a=j(()=>n.value==="error"),u=j(()=>n.value==="loaded");return{status:n,isBeforeLoad:s,isLoading:l,isError:a,isLoaded:u,setLoadStatus:d=>{n.value=d}}}function Hw(o,n,s,l,a){let u=s,d=l;return s&&(o.width>n.width?u=0:(n.left>o.left&&(u-=Math.abs(o.left-n.left)/a),n.rightn.height?d=0:(n.top>o.top&&(d-=Math.abs(o.top-n.top)/a),n.bottom{if(!n.value||!s.value)return;const x=n.value.getBoundingClientRect(),G=s.value.getBoundingClientRect(),[oe,ne]=Hw(x,G,a.value[0],a.value[1],l.value);(oe!==a.value[0]||ne!==a.value[1])&&(a.value=[oe,ne])},T=x=>{x.preventDefault&&x.preventDefault();const G=p[0]+(x.pageX-d)/l.value,oe=p[1]+(x.pageY-h)/l.value;a.value=[G,oe]},y=x=>{x.preventDefault&&x.preventDefault(),u.value=!1,f(),P()},S=x=>{x.target===x.currentTarget&&(x.preventDefault&&x.preventDefault(),u.value=!0,d=x.pageX,h=x.pageY,p=[...a.value],vo(window,"mousemove",T,!1),vo(window,"mouseup",y,!1))};function P(){Yo(window,"mousemove",T,!1),Yo(window,"mouseup",y,!1)}return eg(x=>{s.value&&vo(s.value,"mousedown",S),x(()=>{s.value&&Yo(s.value,"mousedown",S),P()})}),Et([l],()=>{Io(()=>f())}),{translate:a,moving:u,resetTranslate(){a.value=[0,0]}}}const Gw=Ke({name:"IconZoomOut",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-zoom-out`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Ww=["stroke-width","stroke-linecap","stroke-linejoin"],zw=Le("path",{d:"M32.607 32.607A14.953 14.953 0 0 0 37 22c0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15 0 8.284 6.716 15 15 15 4.142 0 7.892-1.679 10.607-4.393Zm0 0L41.5 41.5M29 22H15"},null,-1),Xw=[zw];function jw(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Xw,14,Ww)}var B_=dt(Gw,[["render",jw]]);const Yw=Object.assign(B_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+B_.name,B_)}}),Kw=Ke({name:"IconZoomIn",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-zoom-in`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Qw=["stroke-width","stroke-linecap","stroke-linejoin"],qw=Le("path",{d:"M32.607 32.607A14.953 14.953 0 0 0 37 22c0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15 0 8.284 6.716 15 15 15 4.142 0 7.892-1.679 10.607-4.393Zm0 0L41.5 41.5M29 22H15m7 7V15"},null,-1),Jw=[qw];function Zw(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Jw,14,Qw)}var F_=dt(Kw,[["render",Zw]]);const e6=Object.assign(F_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+F_.name,F_)}}),t6=Ke({name:"IconFullscreen",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-fullscreen`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),o6=["stroke-width","stroke-linecap","stroke-linejoin"],s6=Le("path",{d:"M42 17V9a1 1 0 0 0-1-1h-8M6 17V9a1 1 0 0 1 1-1h8m27 23v8a1 1 0 0 1-1 1h-8M6 31v8a1 1 0 0 0 1 1h8"},null,-1),i6=[s6];function n6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},i6,14,o6)}var U_=dt(t6,[["render",n6]]);const r6=Object.assign(U_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+U_.name,U_)}}),l6=Ke({name:"IconRotateLeft",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-rotate-left`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),c6=["stroke-width","stroke-linecap","stroke-linejoin"],a6=Le("path",{d:"M10 22a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H11a1 1 0 0 1-1-1V22ZM23 11h11a6 6 0 0 1 6 6v6M22.5 12.893 19.587 11 22.5 9.107v3.786Z"},null,-1),u6=[a6];function d6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},u6,14,c6)}var H_=dt(l6,[["render",d6]]);const h6=Object.assign(H_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+H_.name,H_)}}),p6=Ke({name:"IconRotateRight",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-rotate-right`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),$6=["stroke-width","stroke-linecap","stroke-linejoin"],_6=Le("path",{d:"M38 22a1 1 0 0 0-1-1H17a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V22ZM25 11H14a6 6 0 0 0-6 6v6M25.5 12.893 28.413 11 25.5 9.107v3.786Z"},null,-1),g6=[_6];function f6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},g6,14,$6)}var V_=dt(p6,[["render",f6]]);const m6=Object.assign(V_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+V_.name,V_)}}),T6=Ke({name:"IconOriginalSize",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-original-size`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),E6=["stroke-width","stroke-linecap","stroke-linejoin"],b6=Le("path",{d:"m5.5 11.5 5-2.5h1v32M34 11.5 39 9h1v32"},null,-1),v6=Le("path",{d:"M24 17h1v1h-1v-1ZM24 30h1v1h-1v-1Z",fill:"currentColor",stroke:"none"},null,-1),I6=Le("path",{d:"M24 17h1v1h-1v-1ZM24 30h1v1h-1v-1Z"},null,-1),O6=[b6,v6,I6];function C6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},O6,14,E6)}var G_=dt(T6,[["render",C6]]);const y6=Object.assign(G_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+G_.name,G_)}});function S6(o){const{container:n,hidden:s}=Pt(o);let l=!1,a={};const u=p=>p.tagName==="BODY"?window.innerWidth-(document.body.clientWidth||document.documentElement.clientWidth):p.offsetWidth-p.clientWidth,d=()=>{if(n.value&&n.value.style.overflow!=="hidden"){const p=n.value.style;l=!0;const f=u(n.value);f&&(a.width=p.width,n.value.style.width=`calc(${n.value.style.width||"100%"} - ${f}px)`),a.overflow=p.overflow,n.value.style.overflow="hidden"}},h=()=>{if(n.value&&l){const p=a;Object.keys(p).forEach(f=>{n.value.style[f]=p[f]})}l=!1,a={}};return eg(p=>{s.value?d():h(),p(()=>{h()})}),[h,d]}function R6(o,n){const{popupContainer:s}=Pt(n);return j(()=>(ki(s.value)?dI(s.value):s.value)||o)}const As=[25,33,50,67,75,80,90,100,110,125,150,175,200,250,300,400,500].map(o=>+(o/100).toFixed(2)),AI=As[0],LI=As[As.length-1];function k6(o=1,n="zoomIn"){let s=As.indexOf(o);return s===-1&&(s=L6(o)),n==="zoomIn"?s===As.length-1?o:As[s+1]:s===0?o:As[s-1]}function A6(o,n=1.1,s="zoomIn"){const l=s==="zoomIn"?n:1/n,a=Number.parseFloat((o*l).toFixed(3));return Math.min(LI,Math.max(AI,a))}function L6(o){let n=As.length-1;for(let s=0;sn in o?N6(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,D6=(o,n)=>{for(var s in n||(n={}))w6.call(n,s)&&cb(o,s,n[s]);if(lb)for(var s of lb(n))M6.call(n,s)&&cb(o,s,n[s]);return o};const W_=90;var P6=Ke({name:"ImagePreview",components:{PreviewArrow:Dw,PreviewToolbar:Fw,IconLoading:ir,IconClose:El},props:{renderToBody:{type:Boolean,default:!0},src:{type:String},visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},actionsLayout:{type:Array,default:()=>["fullScreen","rotateRight","rotateLeft","zoomIn","zoomOut","originalSize"]},popupContainer:{type:[Object,String]},inGroup:{type:Boolean,default:!1},groupArrowProps:{type:Object,default:()=>({})},escToClose:{type:Boolean,default:!0},wheelZoom:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},defaultScale:{type:Number,default:1},zoomRate:{type:Number,default:1.1}},emits:["close","update:visible"],setup(o,{emit:n}){const{t:s}=ug(),{src:l,popupContainer:a,visible:u,defaultVisible:d,maskClosable:h,actionsLayout:p,defaultScale:f,zoomRate:T}=Pt(o),y=ge(),S=ge(),P=ot("image-preview"),[x,G]=Xu(d.value,Jt({value:u})),oe=j(()=>[P,{[`${P}-hide`]:!x.value}]),ne=R6(document.body,Jt({popupContainer:a})),Z=j(()=>ne.value===document.body),{zIndex:Y}=Tg("dialog",{visible:x}),M=j(()=>{const et=Z.value?{zIndex:Y.value,position:"fixed"}:{zIndex:"inherit",position:"absolute"};return D6({},et)}),{isLoading:L,isLoaded:R,setLoadStatus:F}=Uw(),z=ge(0),X=ge(f.value),{translate:le,moving:$e,resetTranslate:he}=Vw(Jt({wrapperEl:y,imageEl:S,visible:x,scale:X})),fe=ge(!1);let ke=null;const re=()=>{!fe.value&&(fe.value=!0),ke&&clearTimeout(ke),ke=setTimeout(()=>{fe.value=!1},1e3)};S6(Jt({container:ne,hidden:x}));function Ie(){z.value=0,X.value=f.value,he()}const D=et=>p.value.includes(et),B=et=>{switch(et.stopPropagation(),et.preventDefault(),et.key){case Ss.ESC:o.escToClose&&Je();break;case Ss.ARROW_LEFT:o.groupArrowProps.onPrev&&o.groupArrowProps.onPrev();break;case Ss.ARROW_RIGHT:o.groupArrowProps.onNext&&o.groupArrowProps.onNext();break;case Ss.ARROW_UP:D("zoomIn")&&ht("zoomIn");break;case Ss.ARROW_DOWN:D("zoomOut")&&ht("zoomOut");break;case Ss.SPACE:D("originalSize")&&We(1);break}},ae=A0(et=>{if(et.preventDefault(),et.stopPropagation(),!o.wheelZoom)return;const w=(et.deltaY||et.deltaX)>0?"zoomOut":"zoomIn",I=A6(X.value,T.value,w);We(I)});let _e=!1;const Me=()=>{Io(()=>{var et;(et=y==null?void 0:y.value)==null||et.focus()}),o.keyboard&&!_e&&(_e=!0,vo(ne.value,"keydown",B))},Xe=()=>{_e&&(_e=!1,Yo(ne.value,"keydown",B))};Et([l,x],()=>{x.value?(Ie(),F("loading"),Me()):Xe()});function Je(){x.value&&(n("close"),n("update:visible",!1),G(!1))}function we(et){var xe;(xe=y==null?void 0:y.value)==null||xe.focus(),h.value&&et.target===et.currentTarget&&Je()}function We(et){X.value!==et&&(X.value=et,re())}function Ze(){const et=y.value.getBoundingClientRect(),xe=S.value.getBoundingClientRect(),w=et.height/(xe.height/X.value),I=et.width/(xe.width/X.value),N=Math.max(w,I);We(N)}function nt(et){const w=et==="clockwise"?(z.value+W_)%360:z.value===0?360-W_:z.value-W_;z.value=w}function ht(et){const xe=k6(X.value,et);We(xe)}return Ri(()=>{Xe()}),{prefixCls:P,classNames:oe,container:ne,wrapperStyles:M,scale:X,translate:le,rotate:z,moving:$e,mergedVisible:x,isLoading:L,isLoaded:R,scaleValueVisible:fe,refWrapper:y,refImage:S,onWheel:ae,onMaskClick:we,onCloseClick:Je,onImgLoad(){F("loaded")},onImgError(){F("error")},actions:j(()=>[{key:"fullScreen",name:s("imagePreview.fullScreen"),content:()=>Zs(r6),onClick:()=>Ze()},{key:"rotateRight",name:s("imagePreview.rotateRight"),content:()=>Zs(m6),onClick:()=>nt("clockwise")},{key:"rotateLeft",name:s("imagePreview.rotateLeft"),content:()=>Zs(h6),onClick:()=>nt("counterclockwise")},{key:"zoomIn",name:s("imagePreview.zoomIn"),content:()=>Zs(e6),onClick:()=>ht("zoomIn"),disabled:X.value===LI},{key:"zoomOut",name:s("imagePreview.zoomOut"),content:()=>Zs(Yw),onClick:()=>ht("zoomOut"),disabled:X.value===AI},{key:"originalSize",name:s("imagePreview.originalSize"),content:()=>Zs(y6),onClick:()=>We(1)}])}}});const x6=["src"];function B6(o,n,s,l,a,u){const d=_t("IconLoading"),h=_t("PreviewToolbar"),p=_t("IconClose"),f=_t("PreviewArrow");return me(),it(lg,{to:o.container,disabled:!o.renderToBody},[Le("div",{class:Pe(o.classNames),style:It(o.wrapperStyles)},[Q(un,{name:"image-fade",onBeforeEnter:n[0]||(n[0]=T=>T.parentElement&&(T.parentElement.style.display="block")),onAfterLeave:n[1]||(n[1]=T=>T.parentElement&&(T.parentElement.style.display=""))},{default:De(()=>[Kn(Le("div",{class:Pe(`${o.prefixCls}-mask`)},null,2),[[qn,o.mergedVisible]])]),_:1}),o.mergedVisible?(me(),Fe("div",{key:0,ref:"refWrapper",tabindex:"0",class:Pe(`${o.prefixCls}-wrapper`),onClick:n[6]||(n[6]=(...T)=>o.onMaskClick&&o.onMaskClick(...T)),onWheel:n[7]||(n[7]=er((...T)=>o.onWheel&&o.onWheel(...T),["prevent","stop"]))},[ut(" img "),Le("div",{class:Pe(`${o.prefixCls}-img-container`),style:It({transform:`scale(${o.scale}, ${o.scale})`}),onClick:n[4]||(n[4]=(...T)=>o.onMaskClick&&o.onMaskClick(...T))},[(me(),Fe("img",{ref:"refImage",key:o.src,src:o.src,class:Pe([`${o.prefixCls}-img`,{[`${o.prefixCls}-img-moving`]:o.moving}]),style:It({transform:`translate(${o.translate[0]}px, ${o.translate[1]}px) rotate(${o.rotate}deg)`}),onLoad:n[2]||(n[2]=(...T)=>o.onImgLoad&&o.onImgLoad(...T)),onError:n[3]||(n[3]=(...T)=>o.onImgError&&o.onImgError(...T))},null,46,x6))],6),ut(" loading "),o.isLoading?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-loading`)},[Q(d)],2)):ut("v-if",!0),ut(" scale value "),Q(un,{name:"image-fade"},{default:De(()=>[o.scaleValueVisible?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-scale-value`)},Ci((o.scale*100).toFixed(0))+"% ",3)):ut("v-if",!0)]),_:1}),ut(" toolbar "),o.isLoaded&&o.actionsLayout.length?(me(),it(h,{key:1,actions:o.actions,"actions-layout":o.actionsLayout},{default:De(()=>[ct(o.$slots,"actions")]),_:3},8,["actions","actions-layout"])):ut("v-if",!0),ut(" close btn "),o.closable?(me(),Fe("div",{key:2,class:Pe(`${o.prefixCls}-close-btn`),onClick:n[5]||(n[5]=(...T)=>o.onCloseClick&&o.onCloseClick(...T))},[Q(p)],2)):ut("v-if",!0),ut(" group arrow "),o.inGroup?(me(),it(f,C9(Ot({key:3},o.groupArrowProps)),null,16)):ut("v-if",!0)],34)):ut("v-if",!0)],6)],8,["to","disabled"])}var F6=dt(P6,[["render",B6]]);const NI=Symbol("LayoutSiderInjectionKey"),U6=Symbol("SiderInjectionKey");var H6=Ke({name:"Layout",props:{hasSider:{type:Boolean}},setup(o){const n=ge([]),s=ot("layout"),l=j(()=>[s,{[`${s}-has-sider`]:o.hasSider||n.value.length}]);return hn(NI,{onSiderMount:a=>n.value.push(a),onSiderUnMount:a=>{n.value=n.value.filter(u=>u!==a)}}),{classNames:l}}});function V6(o,n,s,l,a,u){return me(),Fe("section",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var z_=dt(H6,[["render",V6]]);const G6=Ke({name:"LayoutHeader",setup(){return{classNames:[ot("layout-header")]}}});function W6(o,n,s,l,a,u){return me(),Fe("header",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var X_=dt(G6,[["render",W6]]);const z6=Ke({name:"LayoutContent",setup(){return{classNames:[ot("layout-content")]}}});function X6(o,n,s,l,a,u){return me(),Fe("main",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var Du=dt(z6,[["render",X6]]);const j6=Ke({name:"LayoutFooter",setup(){return{classNames:[ot("layout-footer")]}}});function Y6(o,n,s,l,a,u){return me(),Fe("footer",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var j_=dt(j6,[["render",Y6]]);const K6=Ke({name:"IconDragDot",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-drag-dot`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Q6=["stroke-width","stroke-linecap","stroke-linejoin"],q6=Le("path",{d:"M40 17v2h-2v-2h2ZM25 17v2h-2v-2h2ZM10 17v2H8v-2h2ZM40 29v2h-2v-2h2ZM25 29v2h-2v-2h2ZM10 29v2H8v-2h2Z",fill:"currentColor",stroke:"none"},null,-1),J6=Le("path",{d:"M40 17v2h-2v-2h2ZM25 17v2h-2v-2h2ZM10 17v2H8v-2h2ZM40 29v2h-2v-2h2ZM25 29v2h-2v-2h2ZM10 29v2H8v-2h2Z"},null,-1),Z6=[q6,J6];function eM(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Z6,14,Q6)}var Y_=dt(K6,[["render",eM]]);const tM=Object.assign(Y_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+Y_.name,Y_)}}),oM=Ke({name:"IconDragDotVertical",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-drag-dot-vertical`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),sM=["stroke-width","stroke-linecap","stroke-linejoin"],iM=Le("path",{d:"M17 8h2v2h-2V8ZM17 23h2v2h-2v-2ZM17 38h2v2h-2v-2ZM29 8h2v2h-2V8ZM29 23h2v2h-2v-2ZM29 38h2v2h-2v-2Z",fill:"currentColor",stroke:"none"},null,-1),nM=Le("path",{d:"M17 8h2v2h-2V8ZM17 23h2v2h-2v-2ZM17 38h2v2h-2v-2ZM29 8h2v2h-2V8ZM29 23h2v2h-2v-2ZM29 38h2v2h-2v-2Z"},null,-1),rM=[iM,nM];function lM(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},rM,14,sM)}var K_=dt(oM,[["render",lM]]);const cM=Object.assign(K_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+K_.name,K_)}});var aM=Ke({name:"ResizeTrigger",components:{ResizeObserver:cI,IconDragDot:tM,IconDragDotVertical:cM},props:{prefixCls:{type:String,required:!0},direction:{type:String,default:"horizontal"}},emits:["resize"],setup(o,{emit:n}){const{direction:s,prefixCls:l}=Pt(o),a=j(()=>(s==null?void 0:s.value)==="horizontal");return{classNames:j(()=>[l.value,{[`${l.value}-horizontal`]:a.value,[`${l.value}-vertical`]:!a.value}]),onResize:h=>{n("resize",h)},isHorizontal:a}}});function uM(o,n,s,l,a,u){const d=_t("IconDragDot"),h=_t("IconDragDotVertical"),p=_t("ResizeObserver");return me(),it(p,{onResize:o.onResize},{default:De(()=>[Le("div",{class:Pe(o.classNames)},[ut(" @slot 自定义内容 "),ct(o.$slots,"default",{},()=>[Le("div",{class:Pe(`${o.prefixCls}-icon-wrapper`)},[ut(" @slot 自定义 icon "),ct(o.$slots,"icon",{},()=>[o.isHorizontal?(me(),it(d,{key:0,class:Pe(`${o.prefixCls}-icon`)},null,8,["class"])):(me(),it(h,{key:1,class:Pe(`${o.prefixCls}-icon`)},null,8,["class"]))])],2)])],2)]),_:3},8,["onResize"])}var dM=dt(aM,[["render",uM]]),hM=Object.defineProperty,ab=Object.getOwnPropertySymbols,pM=Object.prototype.hasOwnProperty,$M=Object.prototype.propertyIsEnumerable,ub=(o,n,s)=>n in o?hM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Q_=(o,n)=>{for(var s in n||(n={}))pM.call(n,s)&&ub(o,s,n[s]);if(ab)for(var s of ab(n))$M.call(n,s)&&ub(o,s,n[s]);return o};const wI="left",MI="right",vg="top",Ig="bottom",_M=[wI,MI,vg,Ig];function db(o,n){if(o===0)return 0;const s=o-n;return s<=0?0:s}function q_(o){return[vg,Ig].indexOf(o)>-1}const gM=Ke({name:"ResizeBox",components:{ResizeTrigger:dM},inheritAttrs:!1,props:{width:{type:Number},height:{type:Number},component:{type:String,default:"div"},directions:{type:Array,default:()=>["right"]}},emits:{"update:width":o=>!0,"update:height":o=>!0,movingStart:o=>!0,moving:(o,n)=>!0,movingEnd:o=>!0},setup(o,{emit:n}){const{height:s,width:l,directions:a}=Pt(o),[u,d]=Xu(null,Jt({value:l})),[h,p]=Xu(null,Jt({value:s})),f=ge(),T=Jt({}),y=ot("resizebox"),S=j(()=>[y]),P=j(()=>Q_(Q_(Q_({},vt(u.value)?{width:`${u.value}px`}:{}),vt(h.value)?{height:`${h.value}px`}:{}),T)),x=j(()=>a.value.filter(M=>_M.includes(M))),G={direction:"",startPageX:0,startPageY:0,startWidth:0,startHeight:0,moving:!1,padding:{left:0,right:0,top:0,bottom:0}};function oe(M){if(!G.moving)return;const{startPageX:L,startPageY:R,startWidth:F,startHeight:z,direction:X}=G;let le=F,$e=z;const he=M.pageX-L,fe=M.pageY-R;switch(X){case wI:le=F-he,d(le),n("update:width",le);break;case MI:le=F+he,d(le),n("update:width",le);break;case vg:$e=z-fe,p($e),n("update:height",$e);break;case Ig:$e=z+fe,p($e),n("update:height",$e);break}n("moving",{width:le,height:$e},M)}function ne(M){G.moving=!1,Yo(window,"mousemove",oe),Yo(window,"mouseup",ne),Yo(window,"contextmenu",ne),document.body.style.cursor="default",n("movingEnd",M)}function Z(M,L){var R,F;n("movingStart",L),G.moving=!0,G.startPageX=L.pageX,G.startPageY=L.pageY,G.direction=M;const{top:z,left:X,right:le,bottom:$e}=G.padding;G.startWidth=db(((R=f.value)==null?void 0:R.clientWidth)||0,X+le),G.startHeight=db(((F=f.value)==null?void 0:F.clientHeight)||0,z+$e),vo(window,"mousemove",oe),vo(window,"mouseup",ne),vo(window,"contextmenu",ne),document.body.style.cursor=q_(M)?"row-resize":"col-resize"}function Y(M,L){const{width:R,height:F}=L.contentRect,z=q_(M)?F:R;G.padding[M]=z,T[`padding-${M}`]=`${z}px`}return{prefixCls:y,classNames:S,styles:P,wrapperRef:f,onMoveStart:Z,isHorizontal:q_,allowDirections:x,onTiggerResize:Y}}});function fM(o,n,s,l,a,u){const d=_t("ResizeTrigger");return me(),it(cn(o.component),Ot({ref:"wrapperRef",class:o.classNames},o.$attrs,{style:o.styles}),{default:De(()=>[ct(o.$slots,"default"),(me(!0),Fe(Wt,null,id(o.allowDirections,h=>(me(),it(d,{key:h,"prefix-cls":`${o.prefixCls}-trigger`,class:Pe(`${o.prefixCls}-direction-${h}`),direction:o.isHorizontal(h)?"horizontal":"vertical",onMousedown:p=>{o.onMoveStart(h,p)},onResize:p=>{o.onTiggerResize(h,p)}},kv({default:De(()=>[o.$slots["resize-trigger"]?ct(o.$slots,"resize-trigger",{key:0,direction:h}):ut("v-if",!0)]),_:2},[o.$slots["resize-trigger-icon"]?{name:"icon",fn:De(()=>[ct(o.$slots,"resize-trigger-icon",{direction:h})])}:void 0]),1032,["prefix-cls","class","direction","onMousedown","onResize"]))),128))]),_:3},16,["class","style"])}var J_=dt(gM,[["render",fM]]);const mM=Object.assign(J_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+J_.name,J_)}});function TM(o,n){const s=j(()=>eo(o)?o.value:o);let l="";zt(()=>{l=sb.subscribe((a,u)=>{s.value&&(!u||u===s.value)&&n(!!a[s.value])})}),Uc(()=>{l&&sb.unsubscribe(l)})}const EM=(()=>{let o=0;return(n="")=>(o+=1,`${n}${o}`)})();var bM=Ke({name:"LayoutSider",components:{IconLeft:RI,IconRight:OI,ResizeBox:mM},props:{theme:{type:String,default:"light"},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean},collapsible:{type:Boolean},width:{type:Number,default:200},collapsedWidth:{type:Number,default:48},reverseArrow:{type:Boolean},breakpoint:{type:String},resizeDirections:{type:Array,default:void 0},hideTrigger:{type:Boolean}},emits:["collapse","update:collapsed","breakpoint"],setup(o,{emit:n}){const{theme:s,collapsed:l,defaultCollapsed:a,collapsible:u,hideTrigger:d,breakpoint:h,collapsedWidth:p,resizeDirections:f}=Pt(o),[T,y]=Xu(a.value,Jt({value:l})),S=j(()=>f.value?"ResizeBox":"div"),P=j(()=>u.value&&!d.value),x=ot("layout-sider"),G=j(()=>[x,{[`${x}-light`]:s.value==="light",[`${x}-has-trigger`]:P.value,[`${x}-collapsed`]:l.value}]),oe=j(()=>{const{width:L,collapsedWidth:R}=o,F=T.value?R:L;return vt(F)?`${F}px`:String(F)}),ne=j(()=>[`${x}-trigger`,{[`${x}-trigger-light`]:s.value==="light"}]),Z=()=>{const L=!T.value;y(L),n("update:collapsed",L),n("collapse",L,"clickTrigger")};TM(h,L=>{const R=!L;R!==T.value&&(y(R),n("update:collapsed",R),n("collapse",R,"responsive"),n("breakpoint",R))});const Y=EM("__arco_layout_sider"),M=ho(NI,void 0);return zt(()=>{var L;(L=M==null?void 0:M.onSiderMount)==null||L.call(M,Y)}),Uc(()=>{var L;(L=M==null?void 0:M.onSiderUnMount)==null||L.call(M,Y)}),hn(U6,Jt({theme:s,collapsed:T,collapsedWidth:p})),{componentTag:S,prefixCls:x,classNames:G,triggerClassNames:ne,localCollapsed:T,siderWidth:oe,showTrigger:P,toggleTrigger:Z}}});const vM={key:0},IM={key:1};function OM(o,n,s,l,a,u){const d=_t("IconLeft"),h=_t("IconRight");return me(),it(cn(o.componentTag),Ot({class:o.classNames,style:{width:o.siderWidth}},o.resizeDirections?{directions:o.resizeDirections}:{}),{default:De(()=>[Le("div",{class:Pe(`${o.prefixCls}-children`)},[ct(o.$slots,"default")],2),o.showTrigger?(me(),Fe("div",{key:0,class:Pe(o.triggerClassNames),style:It({width:o.siderWidth}),onClick:n[0]||(n[0]=(...p)=>o.toggleTrigger&&o.toggleTrigger(...p))},[ct(o.$slots,"trigger",{collapsed:o.localCollapsed},()=>[o.reverseArrow?(me(),Fe("div",IM,[o.localCollapsed?(me(),it(d,{key:0})):(me(),it(h,{key:1}))])):(me(),Fe("div",vM,[o.localCollapsed?(me(),it(h,{key:1})):(me(),it(d,{key:0}))]))])],6)):ut("v-if",!0)]),_:3},16,["class","style"])}var Pu=dt(bM,[["render",OM]]);const CM=Object.assign(z_,{Header:X_,Content:Du,Footer:j_,Sider:Pu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+z_.name,z_),o.component(s+X_.name,X_),o.component(s+Du.name,Du),o.component(s+j_.name,j_),o.component(s+Pu.name,Pu)}}),yM=({modalRef:o,wrapperRef:n,draggable:s,alignCenter:l})=>{const a=ge(!1),u=ge([0,0]),d=ge([0,0]),h=ge(),p=ge([0,0]),f=ge([0,0]),T=()=>{var x,G,oe;if(n.value&&o.value){const{top:ne,left:Z}=n.value.getBoundingClientRect(),{clientWidth:Y,clientHeight:M}=n.value,{top:L,left:R,width:F,height:z}=o.value.getBoundingClientRect(),X=l.value?0:(x=o.value)==null?void 0:x.offsetTop,le=R-Z,$e=L-ne-X;(le!==((G=d.value)==null?void 0:G[0])||$e!==((oe=d.value)==null?void 0:oe[1]))&&(d.value=[le,$e]);const he=Y>F?Y-F:0,fe=M>z?M-z-X:0;(he!==f.value[0]||fe!==f.value[1])&&(f.value=[he,fe]),X&&(p.value=[0,0-X])}},y=x=>{s.value&&(x.preventDefault(),a.value=!0,T(),u.value=[x.x,x.y],vo(window,"mousemove",S),vo(window,"mouseup",P),vo(window,"contextmenu",P))},S=x=>{if(a.value){const G=x.x-u.value[0],oe=x.y-u.value[1];let ne=d.value[0]+G,Z=d.value[1]+oe;nef.value[0]&&(ne=f.value[0]),Zf.value[1]&&(Z=f.value[1]),h.value=[ne,Z]}},P=()=>{a.value=!1,Yo(window,"mousemove",S),Yo(window,"mouseup",P)};return{position:h,handleMoveDown:y}};var SM=Object.defineProperty,hb=Object.getOwnPropertySymbols,RM=Object.prototype.hasOwnProperty,kM=Object.prototype.propertyIsEnumerable,pb=(o,n,s)=>n in o?SM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,AM=(o,n)=>{for(var s in n||(n={}))RM.call(n,s)&&pb(o,s,n[s]);if(hb)for(var s of hb(n))kM.call(n,s)&&pb(o,s,n[s]);return o},LM=Ke({name:"Modal",components:{ClientOnly:fI,ArcoButton:Vc,IconHover:oi,IconClose:El,IconInfoCircleFill:Uk,IconCheckCircleFill:hI,IconExclamationCircleFill:pI,IconCloseCircleFill:$I},inheritAttrs:!1,props:{visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},width:{type:[Number,String]},top:{type:[Number,String]},mask:{type:Boolean,default:!0},title:{type:String},titleAlign:{type:String,default:"center"},alignCenter:{type:Boolean,default:!0},unmountOnClose:Boolean,maskClosable:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1},simple:{type:Boolean,default:o=>o.notice},closable:{type:Boolean,default:!0},okText:String,cancelText:String,okLoading:{type:Boolean,default:!1},okButtonProps:{type:Object},cancelButtonProps:{type:Object},footer:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},popupContainer:{type:[String,Object],default:"body"},maskStyle:{type:Object},modalClass:{type:[String,Array]},modalStyle:{type:Object},onBeforeOk:{type:Function},onBeforeCancel:{type:Function},escToClose:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maskAnimationName:{type:String,default:o=>o.fullscreen?"fade-in-standard":"fade-modal"},modalAnimationName:{type:String,default:o=>o.fullscreen?"zoom-in":"zoom-modal"},bodyClass:{type:[String,Array]},bodyStyle:{type:[String,Object,Array]},messageType:{type:String},hideTitle:{type:Boolean,default:!1}},emits:{"update:visible":o=>!0,ok:o=>!0,cancel:o=>!0,open:()=>!0,close:()=>!0,beforeOpen:()=>!0,beforeClose:()=>!0},setup(o,{emit:n}){const{fullscreen:s,popupContainer:l,alignCenter:a}=Pt(o),u=ot("modal"),{t:d}=ug(),h=ge(),p=ge(),f=ge(o.defaultVisible),T=j(()=>{var We;return(We=o.visible)!=null?We:f.value}),y=ge(!1),S=j(()=>o.okLoading||y.value),P=j(()=>o.draggable&&!o.fullscreen),{teleportContainer:x,containerRef:G}=mI({popupContainer:l,visible:T}),oe=ge(T.value),ne=j(()=>o.okText||d("modal.okText")),Z=j(()=>o.cancelText||d("modal.cancelText")),{zIndex:Y,isLastDialog:M}=Tg("dialog",{visible:T});let L=!1;const R=We=>{o.escToClose&&We.key===Ss.ESC&&M()&&ke(We)},F=()=>{o.escToClose&&!L&&(L=!0,vo(document.documentElement,"keydown",R))},z=()=>{L=!1,Yo(document.documentElement,"keydown",R)};let X=0;const{position:le,handleMoveDown:$e}=yM({wrapperRef:h,modalRef:p,draggable:P,alignCenter:a}),he=()=>{X++,y.value&&(y.value=!1),f.value=!1,n("update:visible",!1)},fe=async We=>{const Ze=X,nt=await new Promise(async ht=>{var et;if(bo(o.onBeforeOk)){let xe=o.onBeforeOk((w=!0)=>ht(w));if((_1(xe)||!S0(xe))&&(y.value=!0),_1(xe))try{xe=(et=await xe)!=null?et:!0}catch{xe=!1}S0(xe)&&ht(xe)}else ht(!0)});Ze===X&&(nt?(n("ok",We),he()):y.value&&(y.value=!1))},ke=We=>{var Ze;let nt=!0;bo(o.onBeforeCancel)&&(nt=(Ze=o.onBeforeCancel())!=null?Ze:!1),nt&&(n("cancel",We),he())},re=ge(!1),Ie=We=>{We.target===h.value&&(re.value=!0)},D=We=>{o.mask&&o.maskClosable&&re.value&&ke(We)},B=()=>{T.value&&(!Ik(h.value,document.activeElement)&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),n("open"))},ae=()=>{T.value||(P.value&&(le.value=void 0),oe.value=!1,Me(),n("close"))},{setOverflowHidden:_e,resetOverflow:Me}=Sw(G);zt(()=>{G.value=L0(o.popupContainer),T.value&&(_e(),o.escToClose&&F())}),Ri(()=>{Me(),z()}),Et(T,We=>{f.value!==We&&(f.value=We),We?(n("beforeOpen"),oe.value=!0,re.value=!1,_e(),F()):(n("beforeClose"),z())}),Et(s,()=>{le.value&&(le.value=void 0)});const Xe=j(()=>[`${u}-wrapper`,{[`${u}-wrapper-align-center`]:o.alignCenter&&!o.fullscreen,[`${u}-wrapper-moved`]:!!le.value}]),Je=j(()=>[`${u}`,o.modalClass,{[`${u}-simple`]:o.simple,[`${u}-draggable`]:P.value,[`${u}-fullscreen`]:o.fullscreen}]),we=j(()=>{var We;const Ze=AM({},(We=o.modalStyle)!=null?We:{});return o.width&&!o.fullscreen&&(Ze.width=vt(o.width)?`${o.width}px`:o.width),!o.alignCenter&&o.top&&(Ze.top=vt(o.top)?`${o.top}px`:o.top),le.value&&(Ze.transform=`translate(${le.value[0]}px, ${le.value[1]}px)`),Ze});return{prefixCls:u,mounted:oe,computedVisible:T,containerRef:G,wrapperRef:h,mergedModalStyle:we,okDisplayText:ne,cancelDisplayText:Z,zIndex:Y,handleOk:fe,handleCancel:ke,handleMaskClick:D,handleMaskMouseDown:Ie,handleOpen:B,handleClose:ae,mergedOkLoading:S,modalRef:p,wrapperCls:Xe,modalCls:Je,teleportContainer:x,handleMoveDown:$e}}});function NM(o,n,s,l,a,u){const d=_t("icon-info-circle-fill"),h=_t("icon-check-circle-fill"),p=_t("icon-exclamation-circle-fill"),f=_t("icon-close-circle-fill"),T=_t("icon-close"),y=_t("icon-hover"),S=_t("arco-button"),P=_t("client-only");return me(),it(P,null,{default:De(()=>[(me(),it(lg,{to:o.teleportContainer,disabled:!o.renderToBody},[!o.unmountOnClose||o.computedVisible||o.mounted?Kn((me(),Fe("div",Ot({key:0,class:`${o.prefixCls}-container`,style:{zIndex:o.zIndex}},o.$attrs),[Q(un,{name:o.maskAnimationName,appear:""},{default:De(()=>[o.mask?Kn((me(),Fe("div",{key:0,ref:"maskRef",class:Pe(`${o.prefixCls}-mask`),style:It(o.maskStyle)},null,6)),[[qn,o.computedVisible]]):ut("v-if",!0)]),_:1},8,["name"]),Le("div",{ref:"wrapperRef",class:Pe(o.wrapperCls),onClick:n[2]||(n[2]=er((...x)=>o.handleMaskClick&&o.handleMaskClick(...x),["self"])),onMousedown:n[3]||(n[3]=er((...x)=>o.handleMaskMouseDown&&o.handleMaskMouseDown(...x),["self"]))},[Q(un,{name:o.modalAnimationName,appear:"",onAfterEnter:o.handleOpen,onAfterLeave:o.handleClose},{default:De(()=>[Kn(Le("div",{ref:"modalRef",class:Pe(o.modalCls),style:It(o.mergedModalStyle)},[!o.hideTitle&&(o.$slots.title||o.title||o.closable)?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-header`),onMousedown:n[1]||(n[1]=(...x)=>o.handleMoveDown&&o.handleMoveDown(...x))},[o.$slots.title||o.title?(me(),Fe("div",{key:0,class:Pe([`${o.prefixCls}-title`,`${o.prefixCls}-title-align-${o.titleAlign}`])},[o.messageType?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-title-icon`)},[o.messageType==="info"?(me(),it(d,{key:0})):ut("v-if",!0),o.messageType==="success"?(me(),it(h,{key:1})):ut("v-if",!0),o.messageType==="warning"?(me(),it(p,{key:2})):ut("v-if",!0),o.messageType==="error"?(me(),it(f,{key:3})):ut("v-if",!0)],2)):ut("v-if",!0),ct(o.$slots,"title",{},()=>[Ut(Ci(o.title),1)])],2)):ut("v-if",!0),!o.simple&&o.closable?(me(),Fe("div",{key:1,tabindex:"-1",role:"button","aria-label":"Close",class:Pe(`${o.prefixCls}-close-btn`),onClick:n[0]||(n[0]=(...x)=>o.handleCancel&&o.handleCancel(...x))},[Q(y,null,{default:De(()=>[Q(T)]),_:1})],2)):ut("v-if",!0)],34)):ut("v-if",!0),Le("div",{class:Pe([`${o.prefixCls}-body`,o.bodyClass]),style:It(o.bodyStyle)},[ct(o.$slots,"default")],6),o.footer?(me(),Fe("div",{key:1,class:Pe(`${o.prefixCls}-footer`)},[ct(o.$slots,"footer",{},()=>[o.hideCancel?ut("v-if",!0):(me(),it(S,Ot({key:0},o.cancelButtonProps,{onClick:o.handleCancel}),{default:De(()=>[Ut(Ci(o.cancelDisplayText),1)]),_:1},16,["onClick"])),Q(S,Ot({type:"primary"},o.okButtonProps,{loading:o.mergedOkLoading,onClick:o.handleOk}),{default:De(()=>[Ut(Ci(o.okDisplayText),1)]),_:1},16,["loading","onClick"])])],2)):ut("v-if",!0)],6),[[qn,o.computedVisible]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],34)],16)),[[qn,o.computedVisible||o.mounted]]):ut("v-if",!0)],8,["to","disabled"]))]),_:3})}var xu=dt(LM,[["render",NM]]),wM=Object.defineProperty,MM=Object.defineProperties,DM=Object.getOwnPropertyDescriptors,$b=Object.getOwnPropertySymbols,PM=Object.prototype.hasOwnProperty,xM=Object.prototype.propertyIsEnumerable,_b=(o,n,s)=>n in o?wM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Jn=(o,n)=>{for(var s in n||(n={}))PM.call(n,s)&&_b(o,s,n[s]);if($b)for(var s of $b(n))xM.call(n,s)&&_b(o,s,n[s]);return o},BM=(o,n)=>MM(o,DM(n));const Z_=(o,n)=>{let s=Ok("modal");const l=()=>{f.component&&(f.component.props.visible=!1),bo(o.onOk)&&o.onOk()},a=()=>{f.component&&(f.component.props.visible=!1),bo(o.onCancel)&&o.onCancel()},u=async()=>{await Io(),s&&($1(null,s),document.body.removeChild(s)),s=null,bo(o.onClose)&&o.onClose()},d=()=>{f.component&&(f.component.props.visible=!1)},h=T=>{f.component&&Object.entries(T).forEach(([y,S])=>{f.component.props[y]=S})},f=Q(xu,Jn(Jn(Jn({},{visible:!0,renderToBody:!1,unmountOnClose:!0,onOk:l,onCancel:a,onClose:u}),Hc(o,["content","title","footer","visible","unmountOnClose","onOk","onCancel","onClose"])),{footer:typeof o.footer=="boolean"?o.footer:void 0}),{default:l_(o.content),title:l_(o.title),footer:typeof o.footer!="boolean"?l_(o.footer):void 0});return(n??dn._context)&&(f.appContext=n??dn._context),$1(f,s),document.body.appendChild(s),{close:d,update:h}},e0=Jn({open:Z_,confirm:(o,n)=>{const s=Jn({simple:!0,messageType:"warning"},o);return Z_(s,n)}},oA.reduce((o,n)=>(o[n]=(s,l)=>{const a=Jn({simple:!0,hideCancel:!0,messageType:n},s);return Z_(a,l)},o),{})),dn=Object.assign(xu,BM(Jn({},e0),{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+xu.name,xu);const l={};for(const a of Object.keys(e0))l[a]=(u,d=o._context)=>e0[a](u,d);o.config.globalProperties.$modal=l},_context:null}));var t0=Ke({name:"Space",props:{align:{type:String},direction:{type:String,default:"horizontal"},size:{type:[Number,String,Array],default:"small"},wrap:{type:Boolean},fill:{type:Boolean}},setup(o,{slots:n}){const s=ot("space"),l=j(()=>{var h;return(h=o.align)!=null?h:o.direction==="horizontal"?"center":""}),a=j(()=>[s,{[`${s}-${o.direction}`]:o.direction,[`${s}-align-${l.value}`]:l.value,[`${s}-wrap`]:o.wrap,[`${s}-fill`]:o.fill}]);function u(h){if(vt(h))return h;switch(h){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const d=h=>{const p={},f=`${u(jo(o.size)?o.size[0]:o.size)}px`,T=`${u(jo(o.size)?o.size[1]:o.size)}px`;return h?o.wrap?{marginBottom:T}:{}:(o.direction==="horizontal"&&(p.marginRight=f),(o.direction==="vertical"||o.wrap)&&(p.marginBottom=T),p)};return()=>{var h;const p=Au((h=n.default)==null?void 0:h.call(n),!0).filter(f=>f.type!==ns);return Q("div",{class:a.value},[p.map((f,T)=>{var y,S;const P=n.split&&T>0;return Q(Wt,{key:(y=f.key)!=null?y:`item-${T}`},[P&&Q("div",{class:`${s}-item-split`,style:d(!1)},[(S=n.split)==null?void 0:S.call(n)]),Q("div",{class:`${s}-item`,style:d(T===p.length-1)},[f])])})])}}});const Og=Object.assign(t0,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+t0.name,t0)}});function DI(o){return o instanceof Map?o.clear=o.delete=o.set=function(){throw new Error("map is read-only")}:o instanceof Set&&(o.add=o.clear=o.delete=function(){throw new Error("set is read-only")}),Object.freeze(o),Object.getOwnPropertyNames(o).forEach(n=>{const s=o[n],l=typeof s;(l==="object"||l==="function")&&!Object.isFrozen(s)&&DI(s)}),o}class gb{constructor(n){n.data===void 0&&(n.data={}),this.data=n.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function PI(o){return o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function sn(o,...n){const s=Object.create(null);for(const l in o)s[l]=o[l];return n.forEach(function(l){for(const a in l)s[a]=l[a]}),s}const FM="",fb=o=>!!o.scope,UM=(o,{prefix:n})=>{if(o.startsWith("language:"))return o.replace("language:","language-");if(o.includes(".")){const s=o.split(".");return[`${n}${s.shift()}`,...s.map((l,a)=>`${l}${"_".repeat(a+1)}`)].join(" ")}return`${n}${o}`};class HM{constructor(n,s){this.buffer="",this.classPrefix=s.classPrefix,n.walk(this)}addText(n){this.buffer+=PI(n)}openNode(n){if(!fb(n))return;const s=UM(n.scope,{prefix:this.classPrefix});this.span(s)}closeNode(n){fb(n)&&(this.buffer+=FM)}value(){return this.buffer}span(n){this.buffer+=``}}const mb=(o={})=>{const n={children:[]};return Object.assign(n,o),n};class Cg{constructor(){this.rootNode=mb(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(n){this.top.children.push(n)}openNode(n){const s=mb({scope:n});this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(n){return this.constructor._walk(n,this.rootNode)}static _walk(n,s){return typeof s=="string"?n.addText(s):s.children&&(n.openNode(s),s.children.forEach(l=>this._walk(n,l)),n.closeNode(s)),n}static _collapse(n){typeof n!="string"&&n.children&&(n.children.every(s=>typeof s=="string")?n.children=[n.children.join("")]:n.children.forEach(s=>{Cg._collapse(s)}))}}class VM extends Cg{constructor(n){super(),this.options=n}addText(n){n!==""&&this.add(n)}startScope(n){this.openNode(n)}endScope(){this.closeNode()}__addSublanguage(n,s){const l=n.root;s&&(l.scope=`language:${s}`),this.add(l)}toHTML(){return new HM(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Bc(o){return o?typeof o=="string"?o:o.source:null}function xI(o){return rr("(?=",o,")")}function GM(o){return rr("(?:",o,")*")}function WM(o){return rr("(?:",o,")?")}function rr(...o){return o.map(s=>Bc(s)).join("")}function zM(o){const n=o[o.length-1];return typeof n=="object"&&n.constructor===Object?(o.splice(o.length-1,1),n):{}}function yg(...o){return"("+(zM(o).capture?"":"?:")+o.map(l=>Bc(l)).join("|")+")"}function BI(o){return new RegExp(o.toString()+"|").exec("").length-1}function XM(o,n){const s=o&&o.exec(n);return s&&s.index===0}const jM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Sg(o,{joinWith:n}){let s=0;return o.map(l=>{s+=1;const a=s;let u=Bc(l),d="";for(;u.length>0;){const h=jM.exec(u);if(!h){d+=u;break}d+=u.substring(0,h.index),u=u.substring(h.index+h[0].length),h[0][0]==="\\"&&h[1]?d+="\\"+String(Number(h[1])+a):(d+=h[0],h[0]==="("&&s++)}return d}).map(l=>`(${l})`).join(n)}const YM=/\b\B/,FI="[a-zA-Z]\\w*",Rg="[a-zA-Z_]\\w*",UI="\\b\\d+(\\.\\d+)?",HI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",VI="\\b(0b[01]+)",KM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",QM=(o={})=>{const n=/^#![ ]*\//;return o.binary&&(o.begin=rr(n,/.*\b/,o.binary,/\b.*/)),sn({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(s,l)=>{s.index!==0&&l.ignoreMatch()}},o)},Fc={begin:"\\\\[\\s\\S]",relevance:0},qM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fc]},JM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fc]},ZM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pd=function(o,n,s={}){const l=sn({scope:"comment",begin:o,end:n,contains:[]},s);l.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=yg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return l.contains.push({begin:rr(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),l},e5=pd("//","$"),t5=pd("/\\*","\\*/"),o5=pd("#","$"),s5={scope:"number",begin:UI,relevance:0},i5={scope:"number",begin:HI,relevance:0},n5={scope:"number",begin:VI,relevance:0},r5={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Fc,{begin:/\[/,end:/\]/,relevance:0,contains:[Fc]}]}]},l5={scope:"title",begin:FI,relevance:0},c5={scope:"title",begin:Rg,relevance:0},a5={begin:"\\.\\s*"+Rg,relevance:0},u5=function(o){return Object.assign(o,{"on:begin":(n,s)=>{s.data._beginMatch=n[1]},"on:end":(n,s)=>{s.data._beginMatch!==n[1]&&s.ignoreMatch()}})};var Cu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:YM,IDENT_RE:FI,UNDERSCORE_IDENT_RE:Rg,NUMBER_RE:UI,C_NUMBER_RE:HI,BINARY_NUMBER_RE:VI,RE_STARTERS_RE:KM,SHEBANG:QM,BACKSLASH_ESCAPE:Fc,APOS_STRING_MODE:qM,QUOTE_STRING_MODE:JM,PHRASAL_WORDS_MODE:ZM,COMMENT:pd,C_LINE_COMMENT_MODE:e5,C_BLOCK_COMMENT_MODE:t5,HASH_COMMENT_MODE:o5,NUMBER_MODE:s5,C_NUMBER_MODE:i5,BINARY_NUMBER_MODE:n5,REGEXP_MODE:r5,TITLE_MODE:l5,UNDERSCORE_TITLE_MODE:c5,METHOD_GUARD:a5,END_SAME_AS_BEGIN:u5});function d5(o,n){o.input[o.index-1]==="."&&n.ignoreMatch()}function h5(o,n){o.className!==void 0&&(o.scope=o.className,delete o.className)}function p5(o,n){n&&o.beginKeywords&&(o.begin="\\b("+o.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",o.__beforeBegin=d5,o.keywords=o.keywords||o.beginKeywords,delete o.beginKeywords,o.relevance===void 0&&(o.relevance=0))}function $5(o,n){Array.isArray(o.illegal)&&(o.illegal=yg(...o.illegal))}function _5(o,n){if(o.match){if(o.begin||o.end)throw new Error("begin & end are not supported with match");o.begin=o.match,delete o.match}}function g5(o,n){o.relevance===void 0&&(o.relevance=1)}const f5=(o,n)=>{if(!o.beforeMatch)return;if(o.starts)throw new Error("beforeMatch cannot be used with starts");const s=Object.assign({},o);Object.keys(o).forEach(l=>{delete o[l]}),o.keywords=s.keywords,o.begin=rr(s.beforeMatch,xI(s.begin)),o.starts={relevance:0,contains:[Object.assign(s,{endsParent:!0})]},o.relevance=0,delete s.beforeMatch},m5=["of","and","for","in","not","or","if","then","parent","list","value"],T5="keyword";function GI(o,n,s=T5){const l=Object.create(null);return typeof o=="string"?a(s,o.split(" ")):Array.isArray(o)?a(s,o):Object.keys(o).forEach(function(u){Object.assign(l,GI(o[u],n,u))}),l;function a(u,d){n&&(d=d.map(h=>h.toLowerCase())),d.forEach(function(h){const p=h.split("|");l[p[0]]=[u,E5(p[0],p[1])]})}}function E5(o,n){return n?Number(n):b5(o)?0:1}function b5(o){return m5.includes(o.toLowerCase())}const Tb={},Zn=o=>{console.error(o)},Eb=(o,...n)=>{console.log(`WARN: ${o}`,...n)},tl=(o,n)=>{Tb[`${o}/${n}`]||(console.log(`Deprecated as of ${o}. ${n}`),Tb[`${o}/${n}`]=!0)},ju=new Error;function WI(o,n,{key:s}){let l=0;const a=o[s],u={},d={};for(let h=1;h<=n.length;h++)d[h+l]=a[h],u[h+l]=!0,l+=BI(n[h-1]);o[s]=d,o[s]._emit=u,o[s]._multi=!0}function v5(o){if(Array.isArray(o.begin)){if(o.skip||o.excludeBegin||o.returnBegin)throw Zn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ju;if(typeof o.beginScope!="object"||o.beginScope===null)throw Zn("beginScope must be object"),ju;WI(o,o.begin,{key:"beginScope"}),o.begin=Sg(o.begin,{joinWith:""})}}function I5(o){if(Array.isArray(o.end)){if(o.skip||o.excludeEnd||o.returnEnd)throw Zn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ju;if(typeof o.endScope!="object"||o.endScope===null)throw Zn("endScope must be object"),ju;WI(o,o.end,{key:"endScope"}),o.end=Sg(o.end,{joinWith:""})}}function O5(o){o.scope&&typeof o.scope=="object"&&o.scope!==null&&(o.beginScope=o.scope,delete o.scope)}function C5(o){O5(o),typeof o.beginScope=="string"&&(o.beginScope={_wrap:o.beginScope}),typeof o.endScope=="string"&&(o.endScope={_wrap:o.endScope}),v5(o),I5(o)}function y5(o){function n(d,h){return new RegExp(Bc(d),"m"+(o.case_insensitive?"i":"")+(o.unicodeRegex?"u":"")+(h?"g":""))}class s{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(h,p){p.position=this.position++,this.matchIndexes[this.matchAt]=p,this.regexes.push([p,h]),this.matchAt+=BI(h)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const h=this.regexes.map(p=>p[1]);this.matcherRe=n(Sg(h,{joinWith:"|"}),!0),this.lastIndex=0}exec(h){this.matcherRe.lastIndex=this.lastIndex;const p=this.matcherRe.exec(h);if(!p)return null;const f=p.findIndex((y,S)=>S>0&&y!==void 0),T=this.matchIndexes[f];return p.splice(0,f),Object.assign(p,T)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(h){if(this.multiRegexes[h])return this.multiRegexes[h];const p=new s;return this.rules.slice(h).forEach(([f,T])=>p.addRule(f,T)),p.compile(),this.multiRegexes[h]=p,p}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(h,p){this.rules.push([h,p]),p.type==="begin"&&this.count++}exec(h){const p=this.getMatcher(this.regexIndex);p.lastIndex=this.lastIndex;let f=p.exec(h);if(this.resumingScanAtSamePosition()&&!(f&&f.index===this.lastIndex)){const T=this.getMatcher(0);T.lastIndex=this.lastIndex+1,f=T.exec(h)}return f&&(this.regexIndex+=f.position+1,this.regexIndex===this.count&&this.considerAll()),f}}function a(d){const h=new l;return d.contains.forEach(p=>h.addRule(p.begin,{rule:p,type:"begin"})),d.terminatorEnd&&h.addRule(d.terminatorEnd,{type:"end"}),d.illegal&&h.addRule(d.illegal,{type:"illegal"}),h}function u(d,h){const p=d;if(d.isCompiled)return p;[h5,_5,C5,f5].forEach(T=>T(d,h)),o.compilerExtensions.forEach(T=>T(d,h)),d.__beforeBegin=null,[p5,$5,g5].forEach(T=>T(d,h)),d.isCompiled=!0;let f=null;return typeof d.keywords=="object"&&d.keywords.$pattern&&(d.keywords=Object.assign({},d.keywords),f=d.keywords.$pattern,delete d.keywords.$pattern),f=f||/\w+/,d.keywords&&(d.keywords=GI(d.keywords,o.case_insensitive)),p.keywordPatternRe=n(f,!0),h&&(d.begin||(d.begin=/\B|\b/),p.beginRe=n(p.begin),!d.end&&!d.endsWithParent&&(d.end=/\B|\b/),d.end&&(p.endRe=n(p.end)),p.terminatorEnd=Bc(p.end)||"",d.endsWithParent&&h.terminatorEnd&&(p.terminatorEnd+=(d.end?"|":"")+h.terminatorEnd)),d.illegal&&(p.illegalRe=n(d.illegal)),d.contains||(d.contains=[]),d.contains=[].concat(...d.contains.map(function(T){return S5(T==="self"?d:T)})),d.contains.forEach(function(T){u(T,p)}),d.starts&&u(d.starts,h),p.matcher=a(p),p}if(o.compilerExtensions||(o.compilerExtensions=[]),o.contains&&o.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return o.classNameAliases=sn(o.classNameAliases||{}),u(o)}function zI(o){return o?o.endsWithParent||zI(o.starts):!1}function S5(o){return o.variants&&!o.cachedVariants&&(o.cachedVariants=o.variants.map(function(n){return sn(o,{variants:null},n)})),o.cachedVariants?o.cachedVariants:zI(o)?sn(o,{starts:o.starts?sn(o.starts):null}):Object.isFrozen(o)?sn(o):o}var R5="11.8.0";class k5 extends Error{constructor(n,s){super(n),this.name="HTMLInjectionError",this.html=s}}const o0=PI,bb=sn,vb=Symbol("nomatch"),A5=7,XI=function(o){const n=Object.create(null),s=Object.create(null),l=[];let a=!0;const u="Could not find the language '{}', did you forget to load/include a language module?",d={disableAutodetect:!0,name:"Plain text",contains:[]};let h={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:VM};function p(D){return h.noHighlightRe.test(D)}function f(D){let B=D.className+" ";B+=D.parentNode?D.parentNode.className:"";const ae=h.languageDetectRe.exec(B);if(ae){const _e=X(ae[1]);return _e||(Eb(u.replace("{}",ae[1])),Eb("Falling back to no-highlight mode for this block.",D)),_e?ae[1]:"no-highlight"}return B.split(/\s+/).find(_e=>p(_e)||X(_e))}function T(D,B,ae){let _e="",Me="";typeof B=="object"?(_e=D,ae=B.ignoreIllegals,Me=B.language):(tl("10.7.0","highlight(lang, code, ...args) has been deprecated."),tl("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),Me=D,_e=B),ae===void 0&&(ae=!0);const Xe={code:_e,language:Me};re("before:highlight",Xe);const Je=Xe.result?Xe.result:y(Xe.language,Xe.code,ae);return Je.code=Xe.code,re("after:highlight",Je),Je}function y(D,B,ae,_e){const Me=Object.create(null);function Xe(ie,ue){return ie.keywords[ue]}function Je(){if(!se.keywords){ce.addText(Se);return}let ie=0;se.keywordPatternRe.lastIndex=0;let ue=se.keywordPatternRe.exec(Se),ye="";for(;ue;){ye+=Se.substring(ie,ue.index);const E=U.case_insensitive?ue[0].toLowerCase():ue[0],g=Xe(se,E);if(g){const[k,W]=g;if(ce.addText(ye),ye="",Me[E]=(Me[E]||0)+1,Me[E]<=A5&&(Ne+=W),k.startsWith("_"))ye+=ue[0];else{const J=U.classNameAliases[k]||k;Ze(ue[0],J)}}else ye+=ue[0];ie=se.keywordPatternRe.lastIndex,ue=se.keywordPatternRe.exec(Se)}ye+=Se.substring(ie),ce.addText(ye)}function we(){if(Se==="")return;let ie=null;if(typeof se.subLanguage=="string"){if(!n[se.subLanguage]){ce.addText(Se);return}ie=y(se.subLanguage,Se,!0,Ce[se.subLanguage]),Ce[se.subLanguage]=ie._top}else ie=P(Se,se.subLanguage.length?se.subLanguage:null);se.relevance>0&&(Ne+=ie.relevance),ce.__addSublanguage(ie._emitter,ie.language)}function We(){se.subLanguage!=null?we():Je(),Se=""}function Ze(ie,ue){ie!==""&&(ce.startScope(ue),ce.addText(ie),ce.endScope())}function nt(ie,ue){let ye=1;const E=ue.length-1;for(;ye<=E;){if(!ie._emit[ye]){ye++;continue}const g=U.classNameAliases[ie[ye]]||ie[ye],k=ue[ye];g?Ze(k,g):(Se=k,Je(),Se=""),ye++}}function ht(ie,ue){return ie.scope&&typeof ie.scope=="string"&&ce.openNode(U.classNameAliases[ie.scope]||ie.scope),ie.beginScope&&(ie.beginScope._wrap?(Ze(Se,U.classNameAliases[ie.beginScope._wrap]||ie.beginScope._wrap),Se=""):ie.beginScope._multi&&(nt(ie.beginScope,ue),Se="")),se=Object.create(ie,{parent:{value:se}}),se}function et(ie,ue,ye){let E=XM(ie.endRe,ye);if(E){if(ie["on:end"]){const g=new gb(ie);ie["on:end"](ue,g),g.isMatchIgnored&&(E=!1)}if(E){for(;ie.endsParent&&ie.parent;)ie=ie.parent;return ie}}if(ie.endsWithParent)return et(ie.parent,ue,ye)}function xe(ie){return se.matcher.regexIndex===0?(Se+=ie[0],1):(ee=!0,0)}function w(ie){const ue=ie[0],ye=ie.rule,E=new gb(ye),g=[ye.__beforeBegin,ye["on:begin"]];for(const k of g)if(k&&(k(ie,E),E.isMatchIgnored))return xe(ue);return ye.skip?Se+=ue:(ye.excludeBegin&&(Se+=ue),We(),!ye.returnBegin&&!ye.excludeBegin&&(Se=ue)),ht(ye,ie),ye.returnBegin?0:ue.length}function I(ie){const ue=ie[0],ye=B.substring(ie.index),E=et(se,ie,ye);if(!E)return vb;const g=se;se.endScope&&se.endScope._wrap?(We(),Ze(ue,se.endScope._wrap)):se.endScope&&se.endScope._multi?(We(),nt(se.endScope,ie)):g.skip?Se+=ue:(g.returnEnd||g.excludeEnd||(Se+=ue),We(),g.excludeEnd&&(Se=ue));do se.scope&&ce.closeNode(),!se.skip&&!se.subLanguage&&(Ne+=se.relevance),se=se.parent;while(se!==E.parent);return E.starts&&ht(E.starts,ie),g.returnEnd?0:ue.length}function N(){const ie=[];for(let ue=se;ue!==U;ue=ue.parent)ue.scope&&ie.unshift(ue.scope);ie.forEach(ue=>ce.openNode(ue))}let A={};function K(ie,ue){const ye=ue&&ue[0];if(Se+=ie,ye==null)return We(),0;if(A.type==="begin"&&ue.type==="end"&&A.index===ue.index&&ye===""){if(Se+=B.slice(ue.index,ue.index+1),!a){const E=new Error(`0 width match regex (${D})`);throw E.languageName=D,E.badRule=A.rule,E}return 1}if(A=ue,ue.type==="begin")return w(ue);if(ue.type==="illegal"&&!ae){const E=new Error('Illegal lexeme "'+ye+'" for mode "'+(se.scope||"")+'"');throw E.mode=se,E}else if(ue.type==="end"){const E=I(ue);if(E!==vb)return E}if(ue.type==="illegal"&&ye==="")return 1;if(be>1e5&&be>ue.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ye,ye.length}const U=X(D);if(!U)throw Zn(u.replace("{}",D)),new Error('Unknown language: "'+D+'"');const de=y5(U);let Te="",se=_e||de;const Ce={},ce=new h.__emitter(h);N();let Se="",Ne=0,He=0,be=0,ee=!1;try{if(U.__emitTokens)U.__emitTokens(B,ce);else{for(se.matcher.considerAll();;){be++,ee?ee=!1:se.matcher.considerAll(),se.matcher.lastIndex=He;const ie=se.matcher.exec(B);if(!ie)break;const ue=B.substring(He,ie.index),ye=K(ue,ie);He=ie.index+ye}K(B.substring(He))}return ce.finalize(),Te=ce.toHTML(),{language:D,value:Te,relevance:Ne,illegal:!1,_emitter:ce,_top:se}}catch(ie){if(ie.message&&ie.message.includes("Illegal"))return{language:D,value:o0(B),illegal:!0,relevance:0,_illegalBy:{message:ie.message,index:He,context:B.slice(He-100,He+100),mode:ie.mode,resultSoFar:Te},_emitter:ce};if(a)return{language:D,value:o0(B),illegal:!1,relevance:0,errorRaised:ie,_emitter:ce,_top:se};throw ie}}function S(D){const B={value:o0(D),illegal:!1,relevance:0,_top:d,_emitter:new h.__emitter(h)};return B._emitter.addText(D),B}function P(D,B){B=B||h.languages||Object.keys(n);const ae=S(D),_e=B.filter(X).filter($e).map(We=>y(We,D,!1));_e.unshift(ae);const Me=_e.sort((We,Ze)=>{if(We.relevance!==Ze.relevance)return Ze.relevance-We.relevance;if(We.language&&Ze.language){if(X(We.language).supersetOf===Ze.language)return 1;if(X(Ze.language).supersetOf===We.language)return-1}return 0}),[Xe,Je]=Me,we=Xe;return we.secondBest=Je,we}function x(D,B,ae){const _e=B&&s[B]||ae;D.classList.add("hljs"),D.classList.add(`language-${_e}`)}function G(D){let B=null;const ae=f(D);if(p(ae))return;if(re("before:highlightElement",{el:D,language:ae}),D.children.length>0&&(h.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),h.throwUnescapedHTML))throw new k5("One of your code blocks includes unescaped HTML.",D.innerHTML);B=D;const _e=B.textContent,Me=ae?T(_e,{language:ae,ignoreIllegals:!0}):P(_e);D.innerHTML=Me.value,x(D,ae,Me.language),D.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(D.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),re("after:highlightElement",{el:D,result:Me,text:_e})}function oe(D){h=bb(h,D)}const ne=()=>{M(),tl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Z(){M(),tl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Y=!1;function M(){if(document.readyState==="loading"){Y=!0;return}document.querySelectorAll(h.cssSelector).forEach(G)}function L(){Y&&M()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",L,!1);function R(D,B){let ae=null;try{ae=B(o)}catch(_e){if(Zn("Language definition for '{}' could not be registered.".replace("{}",D)),a)Zn(_e);else throw _e;ae=d}ae.name||(ae.name=D),n[D]=ae,ae.rawDefinition=B.bind(null,o),ae.aliases&&le(ae.aliases,{languageName:D})}function F(D){delete n[D];for(const B of Object.keys(s))s[B]===D&&delete s[B]}function z(){return Object.keys(n)}function X(D){return D=(D||"").toLowerCase(),n[D]||n[s[D]]}function le(D,{languageName:B}){typeof D=="string"&&(D=[D]),D.forEach(ae=>{s[ae.toLowerCase()]=B})}function $e(D){const B=X(D);return B&&!B.disableAutodetect}function he(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=B=>{D["before:highlightBlock"](Object.assign({block:B.el},B))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=B=>{D["after:highlightBlock"](Object.assign({block:B.el},B))})}function fe(D){he(D),l.push(D)}function ke(D){const B=l.indexOf(D);B!==-1&&l.splice(B,1)}function re(D,B){const ae=D;l.forEach(function(_e){_e[ae]&&_e[ae](B)})}function Ie(D){return tl("10.7.0","highlightBlock will be removed entirely in v12.0"),tl("10.7.0","Please use highlightElement now."),G(D)}Object.assign(o,{highlight:T,highlightAuto:P,highlightAll:M,highlightElement:G,highlightBlock:Ie,configure:oe,initHighlighting:ne,initHighlightingOnLoad:Z,registerLanguage:R,unregisterLanguage:F,listLanguages:z,getLanguage:X,registerAliases:le,autoDetection:$e,inherit:bb,addPlugin:fe,removePlugin:ke}),o.debugMode=function(){a=!1},o.safeMode=function(){a=!0},o.versionString=R5,o.regex={concat:rr,lookahead:xI,either:yg,optional:WM,anyNumberOfTimes:GM};for(const D in Cu)typeof Cu[D]=="object"&&DI(Cu[D]);return Object.assign(o,Cu),o},pl=XI({});pl.newInstance=()=>XI({});var L5=pl;pl.HighlightJS=pl;pl.default=pl;const yc=CI(L5);var Ib=Ke({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(o){var n=ge(o.language);Et(function(){return o.language},function(a){n.value=a});var s=j(function(){return o.autodetect||!n.value}),l=j(function(){return!s.value&&!yc.getLanguage(n.value)});return{className:j(function(){return l.value?"":"hljs "+n.value}),highlightedCode:j(function(){var a;if(l.value)return console.warn('The language "'+n.value+'" you specified could not be found.'),o.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(s.value){var u=yc.highlightAuto(o.code);return n.value=(a=u.language)!==null&&a!==void 0?a:"",u.value}return(u=yc.highlight(o.code,{language:n.value,ignoreIllegals:o.ignoreIllegals})).value})}},render:function(){return Zs("pre",{},[Zs("code",{class:this.className,innerHTML:this.highlightedCode})])}}),N5={install:function(o){o.component("highlightjs",Ib)},component:Ib};const Ob="[A-Za-z$_][0-9A-Za-z$_]*",w5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],M5=["true","false","null","undefined","NaN","Infinity"],jI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],YI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],KI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],D5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],P5=[].concat(KI,jI,YI);function x5(o){const n=o.regex,s=(B,{after:ae})=>{const _e="",end:""},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,ae)=>{const _e=B[0].length+B.index,Me=B.input[_e];if(Me==="<"||Me===","){ae.ignoreMatch();return}Me===">"&&(s(B,{after:_e})||ae.ignoreMatch());let Xe;const Je=B.input.substring(_e);if(Xe=Je.match(/^\s*=/)){ae.ignoreMatch();return}if((Xe=Je.match(/^\s+extends\s+/))&&Xe.index===0){ae.ignoreMatch();return}}},h={$pattern:Ob,keyword:w5,literal:M5,built_in:P5,"variable.language":D5},p="[0-9](_?[0-9])*",f=`\\.(${p})`,T="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${T})((${f})|\\.)?|(${f}))[eE][+-]?(${p})\\b`},{begin:`\\b(${T})\\b((${f})\\b|\\.)?|(${f})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},S={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},P={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"xml"}},x={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"css"}},G={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"graphql"}},oe={className:"string",begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,S]},Z={className:"comment",variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},Y=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,P,x,G,oe,{match:/\$\d+/},y];S.contains=Y.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(Y)});const M=[].concat(Z,S.contains),L=M.concat([{begin:/\(/,end:/\)/,keywords:h,contains:["self"].concat(M)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:L},F={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},z={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jI,...YI]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},le={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},$e={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function he(B){return n.concat("(?!",B.join("|"),")")}const fe={match:n.concat(/\b/,he([...KI,"super","import"]),l,n.lookahead(/\(/)),className:"title.function",relevance:0},ke={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},Ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:z},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,P,x,G,oe,Z,{match:/\$\d+/},y,z,{className:"attr",begin:l+n.lookahead(":"),relevance:0},D,{begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,o.REGEXP_MODE,{className:"function",begin:Ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},le,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,o.inherit(o.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ke,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},fe,$e,F,re,{match:/\$[(.]/}]}}function B5(o){const n=o.regex,s=/[\p{XID_Start}_]\p{XID_Continue}*/u,l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},p={className:"meta",begin:/^(>>>|\.\.\.) /},f={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},T={begin:/\{\{/,relevance:0},y={className:"string",contains:[o.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[o.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[o.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[o.BACKSLASH_ESCAPE,p,T,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[o.BACKSLASH_ESCAPE,p,T,f]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[o.BACKSLASH_ESCAPE,T,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[o.BACKSLASH_ESCAPE,T,f]},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE]},S="[0-9](_?[0-9])*",P=`(\\b(${S}))?\\.(${S})|\\b(${S})\\.`,x=`\\b|${l.join("|")}`,G={className:"number",relevance:0,variants:[{begin:`(\\b(${S})|(${P}))[eE][+-]?(${S})[jJ]?(?=${x})`},{begin:`(${P})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${S})[jJ](?=${x})`}]},oe={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},ne={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",p,G,y,o.HASH_COMMENT_MODE]}]};return f.contains=[y,G,p],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[p,G,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},y,oe,o.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[ne]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[G,ne,y]}]}}var F5=!1;/*! + * pinia v2.1.6 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */let QI;const $d=o=>QI=o,qI=Symbol();function P0(o){return o&&typeof o=="object"&&Object.prototype.toString.call(o)==="[object Object]"&&typeof o.toJSON!="function"}var Sc;(function(o){o.direct="direct",o.patchObject="patch object",o.patchFunction="patch function"})(Sc||(Sc={}));function U5(){const o=qb(!0),n=o.run(()=>ge({}));let s=[],l=[];const a=Zu({install(u){$d(a),a._a=u,u.provide(qI,a),u.config.globalProperties.$pinia=a,l.forEach(d=>s.push(d)),l=[]},use(u){return!this._a&&!F5?l.push(u):s.push(u),this},_p:s,_a:null,_e:o,_s:new Map,state:n});return a}const JI=()=>{};function Cb(o,n,s,l=JI){o.push(n);const a=()=>{const u=o.indexOf(n);u>-1&&(o.splice(u,1),l())};return!s&&G0()&&Jb(a),a}function ol(o,...n){o.slice().forEach(s=>{s(...n)})}const H5=o=>o();function x0(o,n){o instanceof Map&&n instanceof Map&&n.forEach((s,l)=>o.set(l,s)),o instanceof Set&&n instanceof Set&&n.forEach(o.add,o);for(const s in n){if(!n.hasOwnProperty(s))continue;const l=n[s],a=o[s];P0(a)&&P0(l)&&o.hasOwnProperty(s)&&!eo(l)&&!rn(l)?o[s]=x0(a,l):o[s]=l}return o}const V5=Symbol();function G5(o){return!P0(o)||!o.hasOwnProperty(V5)}const{assign:en}=Object;function W5(o){return!!(eo(o)&&o.effect)}function z5(o,n,s,l){const{state:a,actions:u,getters:d}=n,h=s.state.value[o];let p;function f(){h||(s.state.value[o]=a?a():{});const T=Pt(s.state.value[o]);return en(T,u,Object.keys(d||{}).reduce((y,S)=>(y[S]=Zu(j(()=>{$d(s);const P=s._s.get(o);return d[S].call(P,P)})),y),{}))}return p=ZI(o,f,n,s,l,!0),p}function ZI(o,n,s={},l,a,u){let d;const h=en({actions:{}},s),p={deep:!0};let f,T,y=[],S=[],P;const x=l.state.value[o];!u&&!x&&(l.state.value[o]={}),ge({});let G;function oe(z){let X;f=T=!1,typeof z=="function"?(z(l.state.value[o]),X={type:Sc.patchFunction,storeId:o,events:P}):(x0(l.state.value[o],z),X={type:Sc.patchObject,payload:z,storeId:o,events:P});const le=G=Symbol();Io().then(()=>{G===le&&(f=!0)}),T=!0,ol(y,X,l.state.value[o])}const ne=u?function(){const{state:X}=s,le=X?X():{};this.$patch($e=>{en($e,le)})}:JI;function Z(){d.stop(),y=[],S=[],l._s.delete(o)}function Y(z,X){return function(){$d(l);const le=Array.from(arguments),$e=[],he=[];function fe(Ie){$e.push(Ie)}function ke(Ie){he.push(Ie)}ol(S,{args:le,name:z,store:L,after:fe,onError:ke});let re;try{re=X.apply(this&&this.$id===o?this:L,le)}catch(Ie){throw ol(he,Ie),Ie}return re instanceof Promise?re.then(Ie=>(ol($e,Ie),Ie)).catch(Ie=>(ol(he,Ie),Promise.reject(Ie))):(ol($e,re),re)}}const M={_p:l,$id:o,$onAction:Cb.bind(null,S),$patch:oe,$reset:ne,$subscribe(z,X={}){const le=Cb(y,z,X.detached,()=>$e()),$e=d.run(()=>Et(()=>l.state.value[o],he=>{(X.flush==="sync"?T:f)&&z({storeId:o,type:Sc.direct,events:P},he)},en({},p,X)));return le},$dispose:Z},L=Jt(M);l._s.set(o,L);const R=l._a&&l._a.runWithContext||H5,F=l._e.run(()=>(d=qb(),R(()=>d.run(n))));for(const z in F){const X=F[z];if(eo(X)&&!W5(X)||rn(X))u||(x&&G5(X)&&(eo(X)?X.value=x[z]:x0(X,x[z])),l.state.value[o][z]=X);else if(typeof X=="function"){const le=Y(z,X);F[z]=le,h.actions[z]=X}}return en(L,F),en(Ct(L),F),Object.defineProperty(L,"$state",{get:()=>l.state.value[o],set:z=>{oe(X=>{en(X,z)})}}),l._p.forEach(z=>{en(L,d.run(()=>z({store:L,app:l._a,pinia:l,options:h})))}),x&&u&&s.hydrate&&s.hydrate(L.$state,x),f=!0,T=!0,L}function X5(o,n,s){let l,a;const u=typeof n=="function";typeof o=="string"?(l=o,a=u?s:n):(a=o,l=o.id);function d(h,p){const f=UR();return h=h||(f?ho(qI,null):null),h&&$d(h),h=QI,h._s.has(l)||(u?ZI(l,n,a,h):z5(l,a,h)),h._s.get(l)}return d.$id=l,d}const j5="modulepreload",Y5=function(o){return"/"+o},yb={},K5=function(n,s,l){if(!s||s.length===0)return n();const a=document.getElementsByTagName("link");return Promise.all(s.map(u=>{if(u=Y5(u),u in yb)return;yb[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!l)for(let T=a.length-1;T>=0;T--){const y=a[T];if(y.href===u&&(!d||y.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":j5,d||(f.as="script",f.crossOrigin=""),f.href=u,document.head.appendChild(f),d)return new Promise((T,y)=>{f.addEventListener("load",T),f.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${u}`)))})})).then(()=>n()).catch(u=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u})};function Q5(o={}){const{immediate:n=!1,onNeedRefresh:s,onOfflineReady:l,onRegistered:a,onRegisteredSW:u,onRegisterError:d}=o;let h,p,f;const T=async(S=!0)=>{await p,await(f==null?void 0:f())};async function y(){if("serviceWorker"in navigator){const{Workbox:S}=await K5(()=>import("./workbox-window.prod.es5-a7b12eab.js"),[]);h=new S("/sw.js",{scope:"/",type:"classic"}),f=async()=>{await(h==null?void 0:h.messageSkipWaiting())};{let P=!1;const x=()=>{P=!0,h==null||h.addEventListener("controlling",G=>{G.isUpdate&&window.location.reload()}),s==null||s()};h.addEventListener("installed",G=>{typeof G.isUpdate>"u"?typeof G.isExternal<"u"?G.isExternal?x():!P&&(l==null||l()):G.isExternal?window.location.reload():!P&&(l==null||l()):G.isUpdate||l==null||l()}),h.addEventListener("waiting",x),h.addEventListener("externalwaiting",x)}h.register({immediate:n}).then(P=>{u?u("/sw.js",P):a==null||a(P)}).catch(P=>{d==null||d(P)})}}return p=y(),T}(function(){window.__iconpark__=window.__iconpark__||{};var o=JSON.parse('{"991983":{"viewBox":"0 0 24 24","fill":"none","content":""},"991984":{"viewBox":"0 0 24 24","fill":"none","content":""},"991985":{"viewBox":"0 0 24 24","fill":"none","content":""},"991986":{"viewBox":"0 0 24 24","fill":"none","content":""},"991987":{"viewBox":"0 0 24 24","fill":"none","content":""},"991988":{"viewBox":"0 0 24 24","fill":"none","content":""},"991989":{"viewBox":"0 0 24 24","fill":"none","content":""},"991990":{"viewBox":"0 0 24 24","fill":"none","content":""},"991991":{"viewBox":"0 0 24 24","fill":"none","content":""},"991992":{"viewBox":"0 0 24 24","fill":"none","content":""},"991993":{"viewBox":"0 0 24 24","fill":"none","content":""},"991994":{"viewBox":"0 0 24 24","fill":"none","content":""},"991995":{"viewBox":"0 0 24 24","fill":"none","content":""},"991996":{"viewBox":"0 0 24 24","fill":"none","content":""},"992011":{"viewBox":"0 0 24 24","fill":"none","content":""},"995695":{"viewBox":"0 0 24 24","fill":"none","content":""},"995696":{"viewBox":"0 0 24 24","fill":"none","content":""},"995697":{"viewBox":"0 0 24 24","fill":"none","content":""},"995826":{"viewBox":"0 0 48 48","fill":"none","content":""}}');for(var n in o)window.__iconpark__[n]=o[n];var s={variable:991983,color:991984,html:991985,frame:991986,controller:991987,calculation:991988,list:991989,text:991990,css:991991,"php-mysql":991992,"php-basic":991993,echo:991994,cdn:991995,receive:991996,"php-form":992011,"php-file":995695,"php-hash":995696,"php-session":995697,function:995826};for(var l in s)window.__iconpark__[l]=o[s[l]]})();typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);(()=>{var o={816:(l,a,u)=>{var d,h,p,f;u.d(a,{Vm:()=>et,dy:()=>he,Jb:()=>ke,Ld:()=>re,sY:()=>D,YP:()=>fe});const T=globalThis.trustedTypes,y=T?T.createPolicy("lit-html",{createHTML:xe=>xe}):void 0,S=`lit$${(Math.random()+"").slice(9)}$`,P="?"+S,x=`<${P}>`,G=document,oe=(xe="")=>G.createComment(xe),ne=xe=>xe===null||typeof xe!="object"&&typeof xe!="function",Z=Array.isArray,Y=xe=>{var w;return Z(xe)||typeof((w=xe)===null||w===void 0?void 0:w[Symbol.iterator])=="function"},M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,R=/>/g,F=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,z=/'/g,X=/"/g,le=/^(?:script|style|textarea)$/i,$e=xe=>(w,...I)=>({_$litType$:xe,strings:w,values:I}),he=$e(1),fe=$e(2),ke=Symbol.for("lit-noChange"),re=Symbol.for("lit-nothing"),Ie=new WeakMap,D=(xe,w,I)=>{var N,A;const K=(N=I==null?void 0:I.renderBefore)!==null&&N!==void 0?N:w;let U=K._$litPart$;if(U===void 0){const de=(A=I==null?void 0:I.renderBefore)!==null&&A!==void 0?A:null;K._$litPart$=U=new Je(w.insertBefore(oe(),de),de,void 0,I)}return U.I(xe),U},B=G.createTreeWalker(G,129,null,!1),ae=(xe,w)=>{const I=xe.length-1,N=[];let A,K=w===2?"":"",U=M;for(let Te=0;Te"?(U=A??M,Se=-1):ce[1]===void 0?Se=-2:(Se=U.lastIndex-ce[2].length,Ce=ce[1],U=ce[3]===void 0?F:ce[3]==='"'?X:z):U===X||U===z?U=F:U===L||U===R?U=M:(U=F,A=void 0);const He=U===F&&xe[Te+1].startsWith("/>")?" ":"";K+=U===M?se+x:Se>=0?(N.push(Ce),se.slice(0,Se)+"$lit$"+se.slice(Se)+S+He):se+S+(Se===-2?(N.push(void 0),Te):He)}const de=K+(xe[I]||"")+(w===2?"":"");return[y!==void 0?y.createHTML(de):de,N]};class _e{constructor({strings:w,_$litType$:I},N){let A;this.parts=[];let K=0,U=0;const de=w.length-1,Te=this.parts,[se,Ce]=ae(w,I);if(this.el=_e.createElement(se,N),B.currentNode=this.el.content,I===2){const ce=this.el.content,Se=ce.firstChild;Se.remove(),ce.append(...Se.childNodes)}for(;(A=B.nextNode())!==null&&Te.length0){A.textContent=T?T.emptyScript:"";for(let Ne=0;Ne2||N[0]!==""||N[1]!==""?(this.H=Array(N.length-1).fill(re),this.strings=N):this.H=re}get tagName(){return this.element.tagName}I(w,I=this,N,A){const K=this.strings;let U=!1;if(K===void 0)w=Me(this,w,I,0),U=!ne(w)||w!==this.H&&w!==ke,U&&(this.H=w);else{const de=w;let Te,se;for(w=K[0],Te=0;Te{u.r(a),u.d(a,{customElement:()=>d,eventOptions:()=>y,property:()=>p,query:()=>S,queryAll:()=>P,queryAssignedNodes:()=>ne,queryAsync:()=>x,state:()=>f});const d=Z=>Y=>typeof Y=="function"?((M,L)=>(window.customElements.define(M,L),L))(Z,Y):((M,L)=>{const{kind:R,elements:F}=L;return{kind:R,elements:F,finisher(z){window.customElements.define(M,z)}}})(Z,Y),h=(Z,Y)=>Y.kind==="method"&&Y.descriptor&&!("value"in Y.descriptor)?{...Y,finisher(M){M.createProperty(Y.key,Z)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:Y.key,initializer(){typeof Y.initializer=="function"&&(this[Y.key]=Y.initializer.call(this))},finisher(M){M.createProperty(Y.key,Z)}};function p(Z){return(Y,M)=>M!==void 0?((L,R,F)=>{R.constructor.createProperty(F,L)})(Z,Y,M):h(Z,Y)}function f(Z){return p({...Z,state:!0,attribute:!1})}const T=({finisher:Z,descriptor:Y})=>(M,L)=>{var R;if(L===void 0){const F=(R=M.originalKey)!==null&&R!==void 0?R:M.key,z=Y!=null?{kind:"method",placement:"prototype",key:F,descriptor:Y(M.key)}:{...M,key:F};return Z!=null&&(z.finisher=function(X){Z(X,F)}),z}{const F=M.constructor;Y!==void 0&&Object.defineProperty(M,L,Y(L)),Z==null||Z(F,L)}};function y(Z){return T({finisher:(Y,M)=>{Object.assign(Y.prototype[M],Z)}})}function S(Z,Y){return T({descriptor:M=>{const L={get(){var R;return(R=this.renderRoot)===null||R===void 0?void 0:R.querySelector(Z)},enumerable:!0,configurable:!0};if(Y){const R=typeof M=="symbol"?Symbol():"__"+M;L.get=function(){var F;return this[R]===void 0&&(this[R]=(F=this.renderRoot)===null||F===void 0?void 0:F.querySelector(Z)),this[R]}}return L}})}function P(Z){return T({descriptor:Y=>({get(){var M;return(M=this.renderRoot)===null||M===void 0?void 0:M.querySelectorAll(Z)},enumerable:!0,configurable:!0})})}function x(Z){return T({descriptor:Y=>({async get(){var M;return await this.updateComplete,(M=this.renderRoot)===null||M===void 0?void 0:M.querySelector(Z)},enumerable:!0,configurable:!0})})}const G=Element.prototype,oe=G.msMatchesSelector||G.webkitMatchesSelector;function ne(Z="",Y=!1,M=""){return T({descriptor:L=>({get(){var R,F;const z="slot"+(Z?`[name=${Z}]`:":not([name])");let X=(F=(R=this.renderRoot)===null||R===void 0?void 0:R.querySelector(z))===null||F===void 0?void 0:F.assignedNodes({flatten:Y});return X&&M&&(X=X.filter(le=>le.nodeType===Node.ELEMENT_NODE&&(le.matches?le.matches(M):oe.call(le,M)))),X},enumerable:!0,configurable:!0})})}},23:(l,a,u)=>{u.r(a),u.d(a,{unsafeSVG:()=>T});const d=y=>(...S)=>({_$litDirective$:y,values:S});var h=u(816);class p extends class{constructor(S){}T(S,P,x){this.Σdt=S,this.M=P,this.Σct=x}S(S,P){return this.update(S,P)}update(S,P){return this.render(...P)}}{constructor(S){if(super(S),this.vt=h.Ld,S.type!==2)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(S){if(S===h.Ld)return this.Vt=void 0,this.vt=S;if(S===h.Jb)return S;if(typeof S!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(S===this.vt)return this.Vt;this.vt=S;const P=[S];return P.raw=P,this.Vt={_$litType$:this.constructor.resultType,strings:P,values:[]}}}p.directiveName="unsafeHTML",p.resultType=1;class f extends p{}f.directiveName="unsafeSVG",f.resultType=2;const T=d(f)},249:(l,a,u)=>{u.r(a),u.d(a,{CSSResult:()=>f,LitElement:()=>ke,ReactiveElement:()=>R,UpdatingElement:()=>fe,_Σ:()=>d.Vm,_Φ:()=>re,adoptStyles:()=>P,css:()=>S,defaultConverter:()=>Y,getCompatibleStyle:()=>x,html:()=>d.dy,noChange:()=>d.Jb,notEqual:()=>M,nothing:()=>d.Ld,render:()=>d.sY,supportsAdoptingStyleSheets:()=>h,svg:()=>d.YP,unsafeCSS:()=>T});var d=u(816);const h=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,p=Symbol();class f{constructor(D,B){if(B!==p)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=D}get styleSheet(){return h&&this.t===void 0&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const T=Ie=>new f(Ie+"",p),y=new Map,S=(Ie,...D)=>{const B=D.reduce((_e,Me,Xe)=>_e+(Je=>{if(Je instanceof f)return Je.cssText;if(typeof Je=="number")return Je;throw Error(`Value passed to 'css' function must be a 'css' function result: ${Je}. Use 'unsafeCSS' to pass non-literal values, but + take care to ensure page security.`)})(Me)+Ie[Xe+1],Ie[0]);let ae=y.get(B);return ae===void 0&&y.set(B,ae=new f(B,p)),ae},P=(Ie,D)=>{h?Ie.adoptedStyleSheets=D.map(B=>B instanceof CSSStyleSheet?B:B.styleSheet):D.forEach(B=>{const ae=document.createElement("style");ae.textContent=B.cssText,Ie.appendChild(ae)})},x=h?Ie=>Ie:Ie=>Ie instanceof CSSStyleSheet?(D=>{let B="";for(const ae of D.cssRules)B+=ae.cssText;return T(B)})(Ie):Ie;var G,oe,ne,Z;const Y={toAttribute(Ie,D){switch(D){case Boolean:Ie=Ie?"":null;break;case Object:case Array:Ie=Ie==null?Ie:JSON.stringify(Ie)}return Ie},fromAttribute(Ie,D){let B=Ie;switch(D){case Boolean:B=Ie!==null;break;case Number:B=Ie===null?null:Number(Ie);break;case Object:case Array:try{B=JSON.parse(Ie)}catch{B=null}}return B}},M=(Ie,D)=>D!==Ie&&(D==D||Ie==Ie),L={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:M};class R extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(D){var B;(B=this.v)!==null&&B!==void 0||(this.v=[]),this.v.push(D)}static get observedAttributes(){this.finalize();const D=[];return this.elementProperties.forEach((B,ae)=>{const _e=this.Πp(ae,B);_e!==void 0&&(this.Πm.set(_e,ae),D.push(_e))}),D}static createProperty(D,B=L){if(B.state&&(B.attribute=!1),this.finalize(),this.elementProperties.set(D,B),!B.noAccessor&&!this.prototype.hasOwnProperty(D)){const ae=typeof D=="symbol"?Symbol():"__"+D,_e=this.getPropertyDescriptor(D,ae,B);_e!==void 0&&Object.defineProperty(this.prototype,D,_e)}}static getPropertyDescriptor(D,B,ae){return{get(){return this[B]},set(_e){const Me=this[D];this[B]=_e,this.requestUpdate(D,Me,ae)},configurable:!0,enumerable:!0}}static getPropertyOptions(D){return this.elementProperties.get(D)||L}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const D=Object.getPrototypeOf(this);if(D.finalize(),this.elementProperties=new Map(D.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const B=this.properties,ae=[...Object.getOwnPropertyNames(B),...Object.getOwnPropertySymbols(B)];for(const _e of ae)this.createProperty(_e,B[_e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(D){const B=[];if(Array.isArray(D)){const ae=new Set(D.flat(1/0).reverse());for(const _e of ae)B.unshift(x(_e))}else D!==void 0&&B.push(x(D));return B}static Πp(D,B){const ae=B.attribute;return ae===!1?void 0:typeof ae=="string"?ae:typeof D=="string"?D.toLowerCase():void 0}u(){var D;this.Πg=new Promise(B=>this.enableUpdating=B),this.L=new Map,this.Π_(),this.requestUpdate(),(D=this.constructor.v)===null||D===void 0||D.forEach(B=>B(this))}addController(D){var B,ae;((B=this.ΠU)!==null&&B!==void 0?B:this.ΠU=[]).push(D),this.renderRoot!==void 0&&this.isConnected&&((ae=D.hostConnected)===null||ae===void 0||ae.call(D))}removeController(D){var B;(B=this.ΠU)===null||B===void 0||B.splice(this.ΠU.indexOf(D)>>>0,1)}Π_(){this.constructor.elementProperties.forEach((D,B)=>{this.hasOwnProperty(B)&&(this.Πi.set(B,this[B]),delete this[B])})}createRenderRoot(){var D;const B=(D=this.shadowRoot)!==null&&D!==void 0?D:this.attachShadow(this.constructor.shadowRootOptions);return P(B,this.constructor.elementStyles),B}connectedCallback(){var D;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(D=this.ΠU)===null||D===void 0||D.forEach(B=>{var ae;return(ae=B.hostConnected)===null||ae===void 0?void 0:ae.call(B)}),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(D){}disconnectedCallback(){var D;(D=this.ΠU)===null||D===void 0||D.forEach(B=>{var ae;return(ae=B.hostDisconnected)===null||ae===void 0?void 0:ae.call(B)}),this.Πo=new Promise(B=>this.Πl=B)}attributeChangedCallback(D,B,ae){this.K(D,ae)}Πj(D,B,ae=L){var _e,Me;const Xe=this.constructor.Πp(D,ae);if(Xe!==void 0&&ae.reflect===!0){const Je=((Me=(_e=ae.converter)===null||_e===void 0?void 0:_e.toAttribute)!==null&&Me!==void 0?Me:Y.toAttribute)(B,ae.type);this.Πh=D,Je==null?this.removeAttribute(Xe):this.setAttribute(Xe,Je),this.Πh=null}}K(D,B){var ae,_e,Me;const Xe=this.constructor,Je=Xe.Πm.get(D);if(Je!==void 0&&this.Πh!==Je){const we=Xe.getPropertyOptions(Je),We=we.converter,Ze=(Me=(_e=(ae=We)===null||ae===void 0?void 0:ae.fromAttribute)!==null&&_e!==void 0?_e:typeof We=="function"?We:null)!==null&&Me!==void 0?Me:Y.fromAttribute;this.Πh=Je,this[Je]=Ze(B,we.type),this.Πh=null}}requestUpdate(D,B,ae){let _e=!0;D!==void 0&&(((ae=ae||this.constructor.getPropertyOptions(D)).hasChanged||M)(this[D],B)?(this.L.has(D)||this.L.set(D,B),ae.reflect===!0&&this.Πh!==D&&(this.Πk===void 0&&(this.Πk=new Map),this.Πk.set(D,ae))):_e=!1),!this.isUpdatePending&&_e&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(B){Promise.reject(B)}const D=this.performUpdate();return D!=null&&await D,!this.isUpdatePending}performUpdate(){var D;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach((_e,Me)=>this[Me]=_e),this.Πi=void 0);let B=!1;const ae=this.L;try{B=this.shouldUpdate(ae),B?(this.willUpdate(ae),(D=this.ΠU)===null||D===void 0||D.forEach(_e=>{var Me;return(Me=_e.hostUpdate)===null||Me===void 0?void 0:Me.call(_e)}),this.update(ae)):this.Π$()}catch(_e){throw B=!1,this.Π$(),_e}B&&this.E(ae)}willUpdate(D){}E(D){var B;(B=this.ΠU)===null||B===void 0||B.forEach(ae=>{var _e;return(_e=ae.hostUpdated)===null||_e===void 0?void 0:_e.call(ae)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(D)),this.updated(D)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(D){return!0}update(D){this.Πk!==void 0&&(this.Πk.forEach((B,ae)=>this.Πj(ae,this[ae],B)),this.Πk=void 0),this.Π$()}updated(D){}firstUpdated(D){}}var F,z,X,le,$e,he;R.finalized=!0,R.shadowRootOptions={mode:"open"},(oe=(G=globalThis).reactiveElementPlatformSupport)===null||oe===void 0||oe.call(G,{ReactiveElement:R}),((ne=(Z=globalThis).reactiveElementVersions)!==null&&ne!==void 0?ne:Z.reactiveElementVersions=[]).push("1.0.0-rc.1");const fe=R;((F=(he=globalThis).litElementVersions)!==null&&F!==void 0?F:he.litElementVersions=[]).push("3.0.0-rc.1");class ke extends R{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var D,B;const ae=super.createRenderRoot();return(D=(B=this.renderOptions).renderBefore)!==null&&D!==void 0||(B.renderBefore=ae.firstChild),ae}update(D){const B=this.render();super.update(D),this.Φt=(0,d.sY)(B,this.renderRoot,this.renderOptions)}connectedCallback(){var D;super.connectedCallback(),(D=this.Φt)===null||D===void 0||D.setConnected(!0)}disconnectedCallback(){var D;super.disconnectedCallback(),(D=this.Φt)===null||D===void 0||D.setConnected(!1)}render(){return d.Jb}}ke.finalized=!0,ke._$litElement$=!0,(X=(z=globalThis).litElementHydrateSupport)===null||X===void 0||X.call(z,{LitElement:ke}),($e=(le=globalThis).litElementPlatformSupport)===null||$e===void 0||$e.call(le,{LitElement:ke});const re={K:(Ie,D,B)=>{Ie.K(D,B)},L:Ie=>Ie.L}},409:function(l,a,u){var d=this&&this.__decorate||function(P,x,G,oe){var ne,Z=arguments.length,Y=Z<3?x:oe===null?oe=Object.getOwnPropertyDescriptor(x,G):oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(P,x,G,oe);else for(var M=P.length-1;M>=0;M--)(ne=P[M])&&(Y=(Z<3?ne(Y):Z>3?ne(x,G,Y):ne(x,G))||Y);return Z>3&&Y&&Object.defineProperty(x,G,Y),Y};Object.defineProperty(a,"__esModule",{value:!0}),a.IconparkIconElement=void 0;const h=u(249),p=u(26),f=u(23),T={color:1,fill:1,stroke:1},y={STROKE:{trackAttr:"data-follow-stroke",rawAttr:"stroke"},FILL:{trackAttr:"data-follow-fill",rawAttr:"fill"}};class S extends h.LitElement{constructor(){super(...arguments),this.name="",this.identifyer="",this.size="1em"}get _width(){return this.width||this.size}get _height(){return this.height||this.size}get _stroke(){return this.stroke||this.color}get _fill(){return this.fill||this.color}get SVGConfig(){return(window.__iconpark__||{})[this.identifyer]||(window.__iconpark__||{})[this.name]||{viewBox:"0 0 0 0",content:""}}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.monkeyPatch("STROKE",!0),this.monkeyPatch("FILL",!0)})}monkeyPatch(x,G){switch(x){case"STROKE":this.updateDOMByHand(this.strokeAppliedNodes,"STROKE",this._stroke,!!G);break;case"FILL":this.updateDOMByHand(this.fillAppliedNodes,"FILL",this._fill,!!G)}}updateDOMByHand(x,G,oe,ne){!oe&&ne||x&&x.forEach(Z=>{oe&&oe===Z.getAttribute(y[G].rawAttr)||Z.setAttribute(y[G].rawAttr,oe||Z.getAttribute(y[G].trackAttr))})}attributeChangedCallback(x,G,oe){super.attributeChangedCallback(x,G,oe),x==="name"||x==="identifyer"?setTimeout(()=>{this.monkeyPatch("STROKE"),this.monkeyPatch("FILL")}):T[x]&&(this.monkeyPatch("STROKE"),this.monkeyPatch("FILL"))}render(){return h.svg`${f.unsafeSVG(this.SVGConfig.content)}`}}S.styles=h.css`:host {display: inline-flex; align-items: center; justify-content: center;} :host([spin]) svg {animation: iconpark-spin 1s infinite linear;} :host([spin][rtl]) svg {animation: iconpark-spin-rtl 1s infinite linear;} :host([rtl]) svg {transform: scaleX(-1);} @keyframes iconpark-spin {0% { -webkit-transform: rotate(0); transform: rotate(0);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}} @keyframes iconpark-spin-rtl {0% {-webkit-transform: scaleX(-1) rotate(0); transform: scaleX(-1) rotate(0);} 100% {-webkit-transform: scaleX(-1) rotate(360deg); transform: scaleX(-1) rotate(360deg);}}`,d([p.property({reflect:!0})],S.prototype,"name",void 0),d([p.property({reflect:!0,attribute:"icon-id"})],S.prototype,"identifyer",void 0),d([p.property({reflect:!0})],S.prototype,"color",void 0),d([p.property({reflect:!0})],S.prototype,"stroke",void 0),d([p.property({reflect:!0})],S.prototype,"fill",void 0),d([p.property({reflect:!0})],S.prototype,"size",void 0),d([p.property({reflect:!0})],S.prototype,"width",void 0),d([p.property({reflect:!0})],S.prototype,"height",void 0),d([p.queryAll(`[${y.STROKE.trackAttr}]`)],S.prototype,"strokeAppliedNodes",void 0),d([p.queryAll(`[${y.FILL.trackAttr}]`)],S.prototype,"fillAppliedNodes",void 0),a.IconparkIconElement=S,customElements.get("iconpark-icon")||customElements.define("iconpark-icon",S)}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var u=n[l]={exports:{}};return o[l].call(u.exports,u,u.exports,s),u.exports}s.d=(l,a)=>{for(var u in a)s.o(a,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:a[u]})},s.o=(l,a)=>Object.prototype.hasOwnProperty.call(l,a),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},s(409)})();var e2={exports:{}},s0={exports:{}},i0={exports:{}},n0={exports:{}},r0={exports:{}},Sb;function _d(){return Sb||(Sb=1,function(o,n){(function(s,l){o.exports=l()})(Do,function(){var s={},l,a,u,d,h,p,f,T,y,S,P,x,G,oe,ne,Z,Y,M,L,R,F,z,X,le,$e,he,fe,ke,re,Ie,D,B,ae,_e,Me,Xe,Je,we,We,Ze,nt,ht,et,xe,w,I,N,A,K,U,de,Te,se,Ce,ce,Se,Ne,He,be,ee,ie,ue,ye,E,g,k,W,J,Ee,ze,yt,ls,ii,xt,Qo,Ht,ws,qo,b,O,_,m,C,V,ve,Ge,rt,Mt,po,Be,wt,Dt,bl,Ai,pn,vl,cs,gd,Il,Ag,fd,Ms,Li,md,Td,Wc,Ed,$n,zc,bd,vd,Lg,Ng,Id,cr,Ds,Od,Cd,yd,Sd,Rd,wg,kd,Ol,Mg,Dg,Ni,Ad,Ps,Pg,xg,Bg,wi,Ld,Fg,Ug,Hg,Vg,Gg,Nd,Wg,zg,Xc,Xg,jg,wd,jc,Yg,xs,Kg,Qg,qg,Jg,Zg,ef,tf,Md,_n,Cl,Dd,of,sf,nf,rf,lf,cf,af,uf,Pd,df,Mi,hf,pf,$f,ar,xd,ur,Bd,Fd,Ud,dr,Yc,Kc,_f,yl,Hd,Vd,Gd,Wd,zd,Xd,gf,Sl,jd,hr,Qc,fs,Yd,Kd,ff,Rl,Qd,qd,mf,qc,Jd,Tf,Ef,bf,vf,If,pr,Zd,eh,kl,th,Of,Cf,oh,sh,ni,ih,nh,yf,Sf,Rf,kf,rh,Af,lh,Lf,Di,Al,Jc,Zc,gn,ch,ea,ah,Zt,ta,$r,fn,Nf,uh,oa,as,dh,sa,hh,ph,wf,Mf,Df,$h,Jo,Pf,xf,ms,Xt,Bf,Ff,_h,ri,ia,Uf,Ll,na,Hf,ra,Vf,la,gh,fh,Gf,mh,ca,Wf,zf,Xf,Th,aa,Eh,ua,jf,da,Yf,Kf,Po,tt,xo,To,jt,Bs,_r,je,oo,bh,Qf,vh,Ih,Oh,Ch,yh,gr,fr,Sh,qf,ha,Rh,Nl,Jf,kh,pa,Zf,em,Ah,wl,tm,om,sm,im,Ml,Lh,Nh,wh,nm,Dl,Mh,mr,rm,Dh,Ph,xh,Bh,Fh,Uh,Hh,Vh,$a,Pl,Gh,lm,Wh,zh,Xh,jh,Yh,Kh,Qh,cm,qh,Pi,_a,ga,Jh,am,Zh,fa,ep,tp,um,op,dm,sp,ip,np,ma,rp,Ta,Ea,ba,hm,pm,$m,_m,gm,fm,mm,Tm,lp,cp,ap,up,Em,bm,dp,hp,pp,$p,_p,gp,fp,mp,vm,Im,st;l=function(e,t,i,r){if(!(e instanceof Ae)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const c=t.toLowerCase();if(!i)throw Error("Can not register a null value");let $=xi[e],v=va[e];if($||($=xi[e]=Object.create(null),v=va[e]=Object.create(null)),a(e,i),!r&&$[c])throw Error('Name "'+c+'" with type "'+e+'" already registered.');$[c]=i,v[c]=t},a=function(e,t){switch(e){case String(Ae.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},u=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const i=xi[e];i&&i[t]?(delete xi[e][t],delete va[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,i){e=`${e}`.toLowerCase(),t=t.toLowerCase();const r=xi[e];if(!r||!r[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",i)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return r[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=xi[e])?!!e[t]:!1},p=function(e,t,i){return d(e,t,i)},f=function(e,t,i){return d(e,t,i)},T=function(e,t,i){e=`${e}`.toLowerCase();var r=xi[e];if(!r){if(r=`Unable to find [${e}] in the registry.`,i)throw Error(`${r} You must require or register a ${e} plugin.`);return console.warn(r),null}if(!t)return r;e=va[e],i=Object.create(null);for(const c of Object.keys(r))i[e[c]]=r[c];return i},y=function(e,t,i){return t=t.plugins[String(e)]||li,typeof t=="function"?t:p(e,t,i)},S=function(e){return xl[e]||null},P=function(){const e=[];for(const t in xl)e.push(xl[t]);return e},x=function(e){xl[e.id]=e},G=function(e){delete xl[e.id]},oe=function(){return Om},ne=function(e){Om=e},Z=function(){return Cm},Y=function(e){Cm=e},M=function(){return ym},L=function(e){ym=e},R=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),i=e.getCachedParentSvgSize();var r=t.parentElement;if(r instanceof HTMLElement){var c=r.offsetWidth;r=r.offsetHeight,i.width!==c&&(t.setAttribute("width",c+"px"),e.setCachedParentSvgSize(c,null)),i.height!==r&&(t.setAttribute("height",r+"px"),e.setCachedParentSvgSize(null,r)),e.resize()}},F=function(e,t){const i=Object.create(null),r=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=r.indexOf(e),r.splice(e,r.length-e));for(let c=0,$;$=r[c];c++)i[$.type]?i[$.type]++:i[$.type]=1;return i},z=function(e){return function(){this.jsonInit(e)}},X=function(e){Sm.defineBlocksWithJsonArrayInternal(e)},le=function(e){s.defineBlocks$$module$build$src$core$common(s.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},s.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let i=0;i{setTimeout(D,0)})}catch{setTimeout(D,0)}vn.push(e)}},D=function(){var e=B(vn,!0);vn.length=0;for(let i=0,r;r=e[i];i++)if(r.workspaceId){var t=S(r.workspaceId);t&&t.fireChangeListener(r)}e=new Set(e.map(i=>i.workspaceId));for(const i of e){if(!i||(e=S(i),!e))continue;e=e.getUndoStack();let r;for(t=e.length;0`&#${t.charCodeAt(0)};`)},xe=function(e,t,i,r){e=e+" was deprecated in "+t+" and will be deleted in "+i+".",r&&(e+=` +Use `+r+" instead."),console.warn(e)},w=function(e,t,i){e=document.createElementNS(Aa,`${e}`);for(const r in t)e.setAttribute(r,`${t[r]}`);return i&&i.appendChild(e),e},I=function(e,t){return t=t.split(" "),t.every(i=>e.classList.contains(i))?!1:(e.classList.add(...t),!0)},N=function(e,t){e.classList.remove(...t.split(" "))},A=function(e,t){return t=t.split(" "),t.every(i=>!e.classList.contains(i))?!1:(e.classList.remove(...t),!0)},K=function(e,t){return e.classList.contains(t)},U=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},de=function(e,t){const i=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");i?t.insertBefore(e,i):t.appendChild(e)},Te=function(e,t){return xe("Blockly.utils.dom.containsNode","version 10","version 11",'Use native "contains" DOM method'),e.contains(t)},se=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},Ce=function(){bp++,Es||(Es=Object.create(null))},ce=function(){bp--,bp||(Es=null)},Se=function(e){const t=e.textContent+` +`+e.className.baseVal;let i;if(Es&&(i=Es[t]))return i;try{i=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Es&&(Es[t]=i),i},Ne=function(e,t,i,r){return He(e,t+"pt",i,r)},He=function(e,t,i,r){const c=e.textContent;e=c+` +`+e.className.baseVal;var $;return Es&&($=Es[e])||(La||($=document.createElement("canvas"),$.className="blocklyComputeCanvas",document.body.appendChild($),La=$.getContext("2d")),La.font=i+" "+t+" "+r,$=c?La.measureText(c).width:0,Es&&(Es[e]=$)),$},be=function(e,t,i,r){const c=document.createElement("span");c.style.font=i+" "+t+" "+r,c.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.setAttribute("style","position: fixed; top: 0; left: 0; display: flex;"),t.appendChild(c),t.appendChild(e),document.body.appendChild(t),i={height:0,baseline:0};try{t.style.alignItems="baseline",i.baseline=e.offsetTop-c.offsetTop,t.style.alignItems="flex-end",i.height=e.offsetTop-c.offsetTop}finally{document.body.removeChild(t)}return i},ee=function(e,t){Lm(e,t)},ie=function(e){Lm=e},ue=function(e,t){Mm.confirmInternal(e,t)},ye=function(e,t){Nm(e,t)},E=function(e){Nm=e},g=function(e,t,i){wm(e,t,i)},k=function(e){wm=e},W=function(e){return e.getVariableModel!==void 0},J=function(e){return e.getProcedureDef!==void 0},Ee=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},s.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let i=0;i1'),r.appendChild(i),t.push(r)),Fo.variables_get){e.sort(Hl.compareByName);for(let c=0,$;$=e[c];c++)i=s.createElement$$module$build$src$core$utils$xml("block"),i.setAttribute("type","variables_get"),i.setAttribute("gap","8"),i.appendChild(s.generateVariableFieldDom$$module$build$src$core$variables($)),t.push(i)}}return t},ls=function(e){return Dm.generateUniqueNameInternal(e)},ii=function(e){return xt(Cp.charAt(0),e.getAllVariableNames())},xt=function(e,t){if(!t.length)return e;const i=Cp;let r="",c=i.indexOf(e);for(;;){let $=!1;for(let v=0;v$.getVariableModel().name);if(r&&(i=r.some($=>$.toLowerCase()===e),r=r.some($=>$.toLowerCase()===t),i&&r))return c.getName()}return null},_=function(e,t,i){e=e.toLowerCase(),t=t.toLowerCase(),i=i.getAllBlocks(!1);for(const c of i){if(!J(c))continue;i=c.getProcedureDef();var r=i[1];const $=r.some(v=>v.toLowerCase()===e);if(r=r.some(v=>v.toLowerCase()===t),$&&r)return i[0]}return null},s.generateVariableFieldDom$$module$build$src$core$variables=function(e){const t=s.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=s.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},s.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,i,r){let c=s.getVariable$$module$build$src$core$variables(e,t,i,r);return c||(c=m(e,t,i,r)),c},s.getVariable$$module$build$src$core$variables=function(e,t,i,r){const c=e.getPotentialVariableMap();let $=null;if(t&&($=e.getVariableById(t),!$&&c&&($=c.getVariableById(t)),$))return $;if(i){if(r===void 0)throw Error("Tried to look up a variable by name without a type");$=e.getVariable(i,r),!$&&c&&($=c.getVariable(i,r))}return $},m=function(e,t,i,r){const c=e.getPotentialVariableMap();return i||(i=ls(e.isFlyout?e.targetWorkspace:e)),c?c.createVariable(i,r,t):e.createVariable(i,r,t)},C=function(e,t){e=e.getAllVariables();const i=[];if(t.length!==e.length)for(let r=0;r>>/g,e),wp="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},Il=function(e){return Xm.getSizeInternal(e)},Ag=function(e){if(Ms(e,"display")!=="none")return fd(e);const t=e.style,i=t.display,r=t.visibility,c=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const $=e.offsetWidth;return e=e.offsetHeight,t.display=i,t.position=c,t.visibility=r,new Vt($,e)},fd=function(e){return new Vt(e.offsetWidth,e.offsetHeight)},Ms=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},Li=function(e){const t=new Ue(0,0);e=e.getBoundingClientRect();var i=document.documentElement;return i=new Ue(window.pageXOffset||i.scrollLeft,window.pageYOffset||i.scrollTop),t.x=e.left+i.x,t.y=e.top+i.y,t},md=function(){const e=document.body,t=document.documentElement;return new Ue(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},Td=function(e){const t=parseFloat(Ms(e,"borderLeftWidth")),i=parseFloat(Ms(e,"borderRightWidth")),r=parseFloat(Ms(e,"borderTopWidth"));return e=parseFloat(Ms(e,"borderBottomWidth")),new Bt(r,e,t,i)},Wc=function(e,t,i){e=Ed(e,t,i),t.scrollLeft=e.x,t.scrollTop=e.y},Ed=function(e,t,i){var r=Li(e),c=Li(t),$=Td(t);const v=r.x-c.x-$.left;return r=r.y-c.y-$.top,c=fd(e),e=t.clientWidth-c.width,c=t.clientHeight-c.height,$=t.scrollLeft,t=t.scrollTop,i?($+=v-e/2,t+=r-c/2):($+=Math.min(v,Math.max(v-e,0)),t+=Math.min(r,Math.max(r-c,0))),new Ue($,t)},$n=function(e){const t=new Ue(0,0);var i=e.x&&e.getAttribute("x");const r=e.y&&e.getAttribute("y");return i&&(t.x=parseInt(i)),r&&(t.y=parseInt(r)),(i=(i=e.getAttribute("transform"))&&i.match(jm))&&(t.x+=Number(i[1]),i[3]&&(t.y+=Number(i[3]))),(e=e.getAttribute("style"))&&-1{Dp=t,Km=window.requestAnimationFrame(()=>{Cd(),t()})})),Ar},cr=function(){return Ar||Promise.resolve()},Ds=function(){window.cancelAnimationFrame(Km),Cd(),Dp&&Dp()},Od=function(e){Ua.add(e);const t=e.getParent();t?Od(t):Fa.add(e)},Cd=function(){const e=new Set([...Fa].map(t=>t.workspace));for(const t of Fa){if(t.isDisposed()||t.getParent())continue;yd(t);const i=t.getRelativeToSurfaceXY();Sd(t,i),Rd(t,i)}for(const t of e)t.resizeContents();Fa.clear(),Ua=new Set,Ar=null},yd=function(e){if(Ua.has(e)){for(const t of e.getChildren(!1))yd(t);e.renderEfficiently()}},Sd=function(e,t){for(const i of e.getConnections_(!1)){e=i.moveToOffset(t);const r=i.targetBlock();i.isSuperior()&&r&&(e||Ua.has(r))&&Sd(r,Ue.sum(t,r.relativeCoords))}},Rd=function(e,t){if(e.getIcons){for(const i of e.getIcons())i.onLocationChange(t);for(const i of e.getChildren(!1))Rd(i,Ue.sum(t,i.relativeCoords))}},wg=function(e,t){const i=s.createElement$$module$build$src$core$utils$xml("xml");var r=kd(s.allUsedVarModels$$module$build$src$core$variables(e));r.hasChildNodes()&&i.appendChild(r),r=e.getTopComments(!0);for(let c=0;c/g,"<$1$2>")},Pg=function(e){e=Ps(e).split("<");let t="";for(let i=1;i"&&(t+=" ")}return e=e.join(` +`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},xg=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=s.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},s.domToWorkspace$$module$build$src$core$xml=function(e,t){let i=0;t.RTL&&(i=t.getWidth());const r=[];Ce();const c=s.getGroup$$module$build$src$core$events$utils();c||s.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let $=!0;try{for(let v=0,H;H=e.childNodes[v];v++){const Oe=H.nodeName.toLowerCase(),Qe=H;if(Oe==="block"||Oe==="shadow"&&!ke()){const qt=wi(Qe,t);r.push(qt.id);let Ft;const Go=parseInt((Ft=Qe.getAttribute("x"))!=null?Ft:"10",10);let Jr;const Zr=parseInt((Jr=Qe.getAttribute("y"))!=null?Jr:"10",10);isNaN(Go)||isNaN(Zr)||qt.moveBy(t.RTL?i-Go:Go,Zr,["create"]),$=!1}else{if(Oe==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(Oe==="comment")t.rendered?yo.fromXmlRendered(Qe,t,i):Hs.fromXml(Qe,t);else if(Oe==="variables"){if($)Ld(Qe,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");$=!1}}}}finally{s.setGroup$$module$build$src$core$events$utils(c),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&Ds(),ce()}return re(new(we(bn))(t)),r},Bg=function(e,t){if(!t.getBlocksBoundingBox)return s.domToWorkspace$$module$build$src$core$xml(e,t);var i=t.getBlocksBoundingBox();if(e=s.domToWorkspace$$module$build$src$core$xml(e,t),i&&i.top!==i.bottom){var r=i.bottom;i=t.RTL?i.right:i.left;var c=1/0;let $=-1/0,v=1/0;for(let H=0;H$&&($=Oe.x)}for(r=r-v+10,i=t.RTL?i-$:i-c,c=0;cQe.setBubbleVisible($),1)}},Vg=function(e,t){for(let i=0;i{v.disposed||v.setConnectionTracking(!0)},1),v},Dd=function(e,t,{parentConnection:i,isShadow:r=!1}={}){if(!e.type)throw new Qm(e);const c=t.newBlock(e.type,e.id);return c.setShadow(r),of(c,e),sf(c,e),nf(c,e),rf(i,c,e),lf(c,e),cf(c,e),af(c,e),uf(c,e),df(c,t.rendered),c},of=function(e,t){let i=t.x===void 0?0:t.x;t=t.y===void 0?0:t.y;const r=e.workspace;i=r.RTL?r.getWidth()-i:i,e.moveBy(i,t)},sf=function(e,t){t.collapsed&&e.setCollapsed(!0),t.deletable===!1&&e.setDeletable(!1),t.movable===!1&&e.setMovable(!1),t.editable===!1&&e.setEditable(!1),t.enabled===!1&&e.setEnabled(!1),t.inline!==void 0&&e.setInputsInline(t.inline),t.data!==void 0&&(e.data=t.data)},nf=function(e,t){t.extraState&&(e.loadExtraState?e.loadExtraState(t.extraState):e.domToMutation&&e.domToMutation(s.textToDom$$module$build$src$core$utils$xml(t.extraState)))},rf=function(e,t,i){if(e){if(e.getSourceBlock().isShadow()&&!t.isShadow())throw new Jm(i);if(e.type===s.inputTypes$$module$build$src$core$inputs$input_types.VALUE){var r=t.outputConnection;if(!r)throw new Vl("output",t,i)}else if(r=t.previousConnection,!r)throw new Vl("previous",t,i);if(!e.connect(r)){const c=t.workspace.connectionChecker;throw new qm(c.getErrorMessage(c.canConnectWithReason(r,e,!1),r,e),e.type===s.inputTypes$$module$build$src$core$inputs$input_types.VALUE?"output connection":"previous connection",t,i)}}},lf=function(e,t){if(t.icons){var i=Object.keys(t.icons);for(const c of i){i=t.icons[c];var r=e.getIcon(c);if(!r){if(r=p(Ae.ICON,c,!1),!r)throw new Zm(c,e,t);r=new r(e),e.addIcon(r)}Ze(r)&&r.loadState(i)}}},cf=function(e,t){if(t.fields){var i=Object.keys(t.fields);for(let r=0;rt&&(t=i[r].length);var c=-1/0;let $,v=1;do{r=c,$=e,e=[],c=i.length/v;let H=1;for(let Oe=0;Oer);return $},qc=function(e,t,i){const r=[0],c=[];for(var $=0;$r&&(r=H,c=v)}return c?Jd(e,c,i):t},Tf=function(e,t){const i=[];for(let r=0;rdT&&ni()}else jl!==ds&&(clearTimeout(Ln),zp=e.pageX,Xp=e.pageY,Ln=setTimeout(kf,hT))},sh=function(){jl=ds=null,ni()},ni=function(){Xl&&(Xl=!1,ro&&(ro.style.display="none")),Ln&&(clearTimeout(Ln),Ln=0)},ih=function(){ni(),Pr=!0},nh=function(){Pr=!1},yf=function(){ro&&ds&&(typeof Xa=="function"?Xa(ro,ds):Sf())},Sf=function(){var e=pr(ds);e=s.wrap$$module$build$src$core$utils$string(e,aT),e=e.split(` +`);for(let t=0;ti+window.scrollY&&(c-=ro.offsetHeight+2*Yp),e?r=Math.max(ja-window.scrollX,r):r+ro.offsetWidth>t+window.scrollX-2*ja&&(r=t-ro.offsetWidth-2*ja),{x:r,y:c}},kf=function(){if(!Pr&&(jl=ds,ro)){ro.textContent="",yf();var e=ds.RTL;ro.style.direction=e?"rtl":"ltr",ro.style.display="block",Xl=!0;var{x:t,y:i}=Rf(e);ro.style.left=t+"px",ro.style.top=i+"px"}},rh=function(){return Kp},Af=function(e){Kp=e},lh=function(){return Qp},Lf=function(e){Qp=e},Di=function(e){e=`${e}`.toLowerCase().trim();var t=pT[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var i=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return i&&(e=Number(i[1]),t=Number(i[2]),i=Number(i[3]),0<=e&&256>e&&0<=t&&256>t&&0<=i&&256>i)?Al(e,t,i):null},Al=function(e,t,i){return t=e<<16|t<<8|i,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Jc=function(e){return e=Di(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Zc=function(e,t,i){let r=0,c=0,$=0;if(t===0)$=c=r=i;else{const v=Math.floor(e/60),H=e/60-v;e=i*(1-t);const Oe=i*(1-t*H);switch(t=i*(1-t*(1-H)),v){case 1:r=Oe,c=i,$=e;break;case 2:r=e,c=i,$=t;break;case 3:r=e,c=Oe,$=i;break;case 4:r=t,c=e,$=i;break;case 5:r=i,c=e,$=Oe;break;case 6:case 0:r=i,c=t,$=e}}return Al(Math.floor(r),Math.floor(c),Math.floor($))},gn=function(e,t,i){return e=Di(e),!e||(t=Di(t),!t)?null:(e=Jc(e),t=Jc(t),Al(Math.round(t[0]+i*(e[0]-t[0])),Math.round(t[1]+i*(e[1]-t[1])),Math.round(t[2]+i*(e[2]-t[2]))))},ch=function(e){return Zc(e,Kp,255*Qp)},ea=function(e,t){const i=[];var r=e.split("");r.push("");var c=0;e=[];let $=null;for(let Oe=0;Oe=v?(c=2,$=v,(v=e.join(""))&&i.push(v),e.length=0):v==="{"?c=3:(e.push("%",v),c=0);else if(c===2)if("0"<=v&&"9">=v)$+=v;else{var H=void 0;i.push(parseInt((H=$)!=null?H:"",10)),Oe--,c=0}else c===3&&(v===""?(e.splice(0,0,"%{"),Oe--,c=0):v!=="}"?e.push(v):(c=e.join(""),/[A-Z]\w*/i.test(c)?(v=c.toUpperCase(),(v=v.startsWith("BKY_")?v.substring(4):null)&&v in s.Msg$$module$build$src$core$msg?(c=s.Msg$$module$build$src$core$msg[v],typeof c=="string"?Array.prototype.push.apply(i,ea(c,t)):t?i.push(`${c}`):i.push(c)):i.push("%{"+c+"}")):i.push("%{"+c+"}"),c=e.length=0))}for((t=e.join(""))&&i.push(t),H=[],e.length=0,r=0;r=i)return{hue:i,hex:Zc(i,rh(),255*lh())};if(i=Di(t))return{hue:null,hex:i};throw i='Invalid colour: "'+t+'"',e!==t&&(i+=' (from "'+e+'")'),Error(i)},fn=function(){return bs},Nf=function(e){bs=e},uh=function(){bs||(bs=document.createElement("div"),bs.className="blocklyWidgetDiv",(M()||document.body).appendChild(bs))},oa=function(e,t,i){as(),xr=e,Ya=i,(e=bs)&&(e.style.direction=t?"rtl":"ltr",e.style.display="block",t=oe(),Br=t.getRenderer().getClassName(),Fr=t.getTheme().getClassName(),Br&&I(e,Br),Fr&&I(e,Fr))},as=function(){if(dh()){xr=null;var e=bs;e&&(e.style.display="none",e.style.left="",e.style.top="",Ya&&Ya(),Ya=null,e.textContent="",Br&&(A(e,Br),Br=""),Fr&&(A(e,Fr),Fr=""),oe().markFocused())}},dh=function(){return!!xr},sa=function(e){xr===e&&as()},hh=function(e,t,i){bs.style.left=e+"px",bs.style.top=t+"px",bs.style.height=i+"px"},ph=function(e,t,i,r){const c=Mf(e,t,i);e=wf(e,t,i,r),0>c?hh(e,0,i.height+c):hh(e,c,i.height)},wf=function(e,t,i,r){return r?Math.min(Math.max(t.right-i.width,e.left),e.right-i.width):Math.max(Math.min(t.left,e.right-i.width),e.left)},Mf=function(e,t,i){return t.bottom+i.height>=e.bottom?t.top-i.height:t.bottom},Df=function(e){return!(e==null||!e.repositionForWindowResize)},$h=function(){Df(xr)&&xr.repositionForWindowResize()||as()},Jo=function(e,t){l(Ae.FIELD,e,t)},Pf=function(e){u(Ae.FIELD,e)},s.fromJson$$module$build$src$core$field_registry=function(e){return $T.fromJsonInternal(e)},xf=function(e){const t=f(Ae.FIELD,e.type);if(t){if(typeof t.fromJson!="function")throw new TypeError("returned Field was not a IRegistrableField");return t.fromJson(e)}return console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null},ms=function(e,t){e.setAttribute(CS,t)},Xt=function(e,t,i){Array.isArray(i)&&(i=i.join(" ")),e.setAttribute(OS+t,`${i}`)},Bf=function(e){let t=!1;const i=e.map(([v,H])=>typeof v=="string"?[Zt(v),H]:(t=!0,[v.alt!==null?Object.assign({},v,{alt:Zt(v.alt)}):Object.assign({},v),H]));if(t||2>e.length)return{options:i};var r=i.map(([v])=>v),c=Rl(r);e=Qd(r,c);const $=qd(r,c);return!e&&!$||c<=e+$?{options:i}:(c=e?r[0].substring(0,e-1):void 0,r=$?r[0].substr(1-$):void 0,{options:Ff(i,e,$),prefix:c,suffix:r})},Ff=function(e,t,i){return e.map(([r,c])=>[r.substring(t,r.length-i),c])},_h=function(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let i=0;i document.")}else e instanceof Element&&(t=e);return t},s.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(Ur[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');Ur[e]=t},s.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');s.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},s.registerMutator$$module$build$src$core$extensions=function(e,t,i,r){const c='Error when registering mutator "'+e+'": ';Eh(c,t);const $=Th(t,c);if(i&&typeof i!="function")throw Error(c+'Extension "'+e+'" is not a function');s.register$$module$build$src$core$extensions(e,function(){$&&this.setMutator(new s.MutatorIcon$$module$build$src$core$icons$mutator_icon(r||[],this)),this.mixin(t),i&&i.apply(this)})},Gf=function(e){mh(e)?delete Ur[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},mh=function(e){return!!Ur[e]},ca=function(e,t,i){const r=Ur[e];if(typeof r!="function")throw Error('Error: Extension "'+e+'" not found.');let c;if(i?Wf(e,t):c=ua(t),r.apply(t),i)Eh('Error after applying mutator "'+e+'": ',t);else if(!jf(c,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},Wf=function(e,t){if(ua(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},zf=function(e,t){return aa(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},Xf=function(e,t){return aa(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Th=function(e,t){return aa(e.compose,e.decompose,t+" compose/decompose")},aa=function(e,t,i){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(i+" must be a function");return!0}if(!e&&!t)return!1;throw Error(i+"Must have both or neither functions")},Eh=function(e,t){const i=zf(t,e),r=Xf(t,e);if(!i&&!r)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Th(t,e)},ua=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},jf=function(e,t){if(t=ua(t),t.length!==e.length)return!1;for(let i=0;ii)){var r=t.getSvgXY(e.getSvgRoot());e.outputConnection?(r.x+=(e.RTL?3:-3)*i,r.y+=13*i):e.previousConnection&&(r.x+=(e.RTL?-23:23)*i,r.y+=3*i);var c=w(te.CIRCLE,{cx:r.x,cy:r.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=w(te.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*i},c),t=w(te.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},c),e.beginElement(),t.beginElement(),setTimeout(()=>void U(c),150)}},Ch=function(e){if(gr(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),ql=e,yh(e,t,new Date)}},yh=function(e,t,i){const r=(new Date().getTime()-i.getTime())/200;let c="";1>=r&&(c=`skewX(${Math.round(Math.sin(r*Math.PI*3)*(1-r)*t)})`,Za=setTimeout(yh,10,e,t,i)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${c}`)},gr=function(){ql&&(Za&&(clearTimeout(Za),Za=null),ql.getSvgRoot().setAttribute("transform",ql.getTranslation()),ql=null)},fr=function(e,t,i){const r=i.getBoundingRectangle(),c=r.right-r.left,$=ur(t.top,r.top,t.top+t.height-(r.bottom-r.top))-r.top;let v=t.left;return t=t.left+t.width-c,e.RTL?v=Math.min(t,v):t=Math.max(v,t),(e=ur(v,r.left,t)-r.left)||$?(i.moveBy(e,$,["inbounds"]),!0):!1},Sh=function(e){return t=>{var i=e.getMetricsManager();if(i.hasFixedEdges()&&!e.isDragging()){var r;if(ya.indexOf((r=t.type)!=null?r:"")!==-1){r=i.getScrollMetrics(!0);const c=qf(e,t);c&&(i=s.getGroup$$module$build$src$core$events$utils()||!1,s.setGroup$$module$build$src$core$events$utils(t.group),fr(e,r,c)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),s.setGroup$$module$build$src$core$events$utils(i))}else t.type===Ui&&t.scale&&t.oldScale&&t.scale>t.oldScale&&ha(e)}}},qf=function(e,t){let i=null;switch(t.type){case s.CREATE$$module$build$src$core$events$utils:case s.MOVE$$module$build$src$core$events$utils:(i=e.getBlockById(t.blockId))&&(i=i.getRootBlock());break;case Hi:case Us:i=e.getCommentById(t.commentId)}return i},ha=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var i=e.getTopBoundedElements();for(let r=0,c;c=i[r];r++)fr(e,t,c)}},Rh=function(e,t){const i=[];for(const r of e.getIcons())(!Mi(r)||r.bubbleIsVisible())&&(i.push({location:t,icon:r}),r.onLocationChange(t));for(const r of e.getChildren(!1))i.push(...Rh(r,Ue.sum(t,r.relativeCoords)));return i},Nl=function(e){l$.copyInternal(e)},Jf=function(e){Ei=e.toCopyData()},kh=function(){if(!Ei)return null;let e=Ei.source;return e.isFlyout&&(e=e.targetWorkspace),Ei.typeCounts&&e.isCapacityAvailable(Ei.typeCounts)?e.paste(Ei.saveInfo):null},pa=function(e){return l$.duplicateInternal(e)},Zf=function(e){const t=Ei;Nl(e);let i,r,c;return e=(c=(i=e.toCopyData())==null||(r=i.source)==null?void 0:r.paste(Ei.saveInfo))!=null?c:null,Ei=t,e},em=function(){return tu},Ah=function(e){tu=e},wl=function(e,t,i){if(oa(yT,i,Lh),t.length){var r=tm(t,i);ou=r,om(r,e,i),setTimeout(function(){r.focus()},1),tu=null}else Ml()},tm=function(e,t){const i=new qp;i.setRole(Vo.MENU);for(let r=0;r{setTimeout(()=>{c.callback(c.scope)},0)})},{})}return i},om=function(e,t,i){const r=bd();t=new Bt(t.clientY+r.top,t.clientY+r.top,t.clientX+r.left,t.clientX+r.left),sm(e);const c=e.getSize();i&&(t.left+=c.width,t.right+=c.width,r.left+=c.width,r.right+=c.width),ph(r,t,c,i),e.focus()},sm=function(e){var t=fn();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),I(t,"blocklyContextMenu"),Be(t,"contextmenu",null,im),e.focus()},im=function(e){e.preventDefault(),e.stopPropagation()},Ml=function(){sa(yT),tu=null},Lh=function(){ou&&(ou.dispose(),ou=null)},s.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{s.disable$$module$build$src$core$events$utils();let i;try{i=wi(t,e.workspace);const r=e.getRelativeToSurfaceXY();r.x=e.RTL?r.x-s.config$$module$build$src$core$config.snapRadius:r.x+s.config$$module$build$src$core$config.snapRadius,r.y+=2*s.config$$module$build$src$core$config.snapRadius,i.moveBy(r.x,r.y)}finally{s.enable$$module$build$src$core$events$utils()}_e()&&!i.isShadow()&&re(new(we(s.CREATE$$module$build$src$core$events$utils))(i)),i.select()}},Nh=function(e){return{text:s.Msg$$module$build$src$core$msg.REMOVE_COMMENT,enabled:!0,callback:function(){s.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),s.setGroup$$module$build$src$core$events$utils(!1)}}},wh=function(e){return{text:s.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){pa(e)}}},nm=function(e,t){const i={enabled:!0};return i.text=s.Msg$$module$build$src$core$msg.ADD_COMMENT,i.callback=function(){const r=new yo(e,s.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT,yo.DEFAULT_SIZE,yo.DEFAULT_SIZE);var c=e.getInjectionDiv().getBoundingClientRect();c=new Ue(t.clientX-c.left,t.clientY-c.top);const $=e.getOriginOffsetInPixels();c=Ue.difference(c,$),c.scale(1/e.scale),r.moveBy(c.x,c.y),e.rendered&&(r.initSvg(),r.render(),r.select())},i},Dl=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},Mh=function(e){return e.isDynamic},mr=function(e,t){l(Ae.RENDERER,e,t)},rm=function(e){u(Ae.RENDERER,e)},Dh=function(e,t,i){return e=new(p(Ae.RENDERER,e))(e),e.init(t,i),e},Ph=function(){kt.registry.register({displayText(){return s.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?Pl(t):ue(s.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(i){i&&Pl(t)})}},scopeType:kt.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},lm=function(){Ph(),xh(),Bh(),Uh(),Hh(),Gh()},Wh=function(){kt.registry.register({displayText(){return s.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){e.block&&pa(e.block)},scopeType:kt.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},zh=function(){kt.registry.register({displayText(e){return e.block.hasIcon(Ao.TYPE)?s.Msg$$module$build$src$core$msg.REMOVE_COMMENT:s.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(Ao.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:kt.ScopeType.BLOCK,id:"blockComment",weight:2})},Xh=function(){kt.registry.register({displayText(e){return e.block.getInputsInline()?s.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:s.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t!r.getReturnTypes()).map(r=>[r.getName(),r.getParameters().map(c=>c.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(r=>{!Pi(r)&&J(r)&&t.push(r.getProcedureDef())});const i=e.getProcedureMap().getProcedures().filter(r=>!!r.getReturnTypes()).map(r=>[r.getName(),r.getParameters().map(c=>c.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(r=>{!Pi(r)&&J(r)&&i.push(r.getProcedureDef())}),t.sort(Jh),i.sort(Jh),[t,i]},Jh=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},s.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||s.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!am(e,t.workspace,t);){const i=e.match(/^(.*?)(\d+)$/);e=i?i[1]+(parseInt(i[2])+1):e+"2"}return e},am=function(e,t,i){return!Zh(e,t,i)},Zh=function(e,t,i){for(const r of t.getAllBlocks(!1))if(r!==i&&J(r)&&s.Names$$module$build$src$core$names.equals(r.getProcedureDef()[0],e))return!0;i=i&&Pi(i)?i==null?void 0:i.getProcedureModel():void 0;for(const r of t.getProcedureMap().getProcedures())if(r!==i&&s.Names$$module$build$src$core$names.equals(r.getName(),e))return!0;return!1},s.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new io;e=e.trim();const i=s.findLegalName$$module$build$src$core$procedures(e,t);Pi(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(i);const r=this.getValue();if(r!==e&&r!==i)for(e=t.workspace.getAllBlocks(!1),t=0;tdm(i,e)||Ee(i)&&s.Names$$module$build$src$core$names.equals(i.getProcedureCall(),e))},dm=function(e,t){return Pi(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&s.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},s.mutateCallers$$module$build$src$core$procedures=function(e){const t=ke();var i=e.getProcedureDef()[0];const r=e.mutationToDom(!0);e=op(i,e.workspace);for(let $=0,v;v=e[$];$++){i=(i=v.mutationToDom())&&ht(i),v.domToMutation&&v.domToMutation(r);var c=v.mutationToDom();c=c&&ht(c),i!==c&&(fe(!1),re(new(we(s.CHANGE$$module$build$src$core$events$utils))(v,"mutation",null,i,c)),fe(t))}},s.getDefinition$$module$build$src$core$procedures=function(e,t){for(const i of t.getAllBlocks(!1))if(Pi(i)&&i.isProcedureDef()&&s.Names$$module$build$src$core$names.equals(i.getProcedureModel().getName(),e)||J(i)&&s.Names$$module$build$src$core$names.equals(i.getProcedureDef()[0],e))return i;return null},sp=function(e){Qo(e.getTargetWorkspace(),void 0,"String")},ip=function(e){Qo(e.getTargetWorkspace(),void 0,"Number")},np=function(e){Qo(e.getTargetWorkspace(),void 0,"Colour")},ma=function(e){let t=[],i=document.createElement("button");return i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(i),i=document.createElement("button"),i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(i),i=document.createElement("button"),i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(i),e.registerButtonCallback("CREATE_VARIABLE_STRING",sp),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",ip),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",np),e=rp(e),t=t.concat(e)},rp=function(e){e=e.getAllVariables();const t=[];if(0cp(i))),t},cp=function(e){const t={id:e.getId(),name:e.getName()};return e.getTypes().length&&(t.types=e.getTypes()),t},ap=function(e,t,i,r){if(e=new e(r,i.name,i.id).setReturnTypes(i.returnTypes),!i.parameters)return e;for(const[c,$]of i.parameters.entries())e.insertParameter(up(t,$,r),c);return e},up=function(e,t,i){return e=new e(i,t.name,t.id),t.types&&e.setTypes(t.types),e},Em=function(e){const t=Object.create(null),i=T(Ae.SERIALIZER,!0);for(const r in i){let c;const $=(c=i[r])==null?void 0:c.save(e);$&&(t[r]=$)}return t},bm=function(e,t,{recordUndo:i=!1}={}){var r=T(Ae.SERIALIZER,!0);if(r){r=Object.entries(r).sort(($,v)=>v[1].priority-$[1].priority);var c=ke();fe(i),(i=s.getGroup$$module$build$src$core$events$utils())||s.setGroup$$module$build$src$core$events$utils(!0),Ce(),t instanceof Cs&&t.setResizesEnabled(!1);for(const[,$]of r.reverse()){let v;(v=$)==null||v.clear(t)}for(let[$,v]of r.reverse())if(e[$]){let H;(H=v)==null||H.load(e[$],t)}t instanceof Cs&&t.setResizesEnabled(!0),ce(),re(new(we(bn))(t)),s.setGroup$$module$build$src$core$events$utils(i),fe(c)}},dp=function(){At.registry.register({name:Ks.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[ft.ESC]})},hp=function(){At.registry.register({name:Ks.DELETE,preconditionFn(e){const t=Z();return!e.options.readOnly&&t!=null&&t.isDeletable()},callback(e,t){return t.preventDefault(),bi.inProgress()?!1:(Z().checkAndDelete(),!0)},keyCodes:[ft.DELETE,ft.BACKSPACE]})},pp=function(){const e=At.registry.createSerializedKey(ft.C,[ft.CTRL]),t=At.registry.createSerializedKey(ft.C,[ft.ALT]),i=At.registry.createSerializedKey(ft.C,[ft.META]);At.registry.register({name:Ks.COPY,preconditionFn(r){const c=Z();return!r.options.readOnly&&!bi.inProgress()&&c!=null&&c.isDeletable()&&c.isMovable()},callback(r,c){return c.preventDefault(),r.hideChaff(),Nl(Z()),!0},keyCodes:[e,t,i]})},$p=function(){const e=At.registry.createSerializedKey(ft.X,[ft.CTRL]),t=At.registry.createSerializedKey(ft.X,[ft.ALT]),i=At.registry.createSerializedKey(ft.X,[ft.META]);At.registry.register({name:Ks.CUT,preconditionFn(r){const c=Z();return!r.options.readOnly&&!bi.inProgress()&&c!=null&&c instanceof ts&&c.isDeletable()&&c.isMovable()&&!c.workspace.isFlyout},callback(){const r=Z();return r?(Nl(r),r.checkAndDelete(),!0):!1},keyCodes:[e,t,i]})},_p=function(){const e=At.registry.createSerializedKey(ft.V,[ft.CTRL]),t=At.registry.createSerializedKey(ft.V,[ft.ALT]),i=At.registry.createSerializedKey(ft.V,[ft.META]);At.registry.register({name:Ks.PASTE,preconditionFn(r){return!r.options.readOnly&&!bi.inProgress()},callback(){return!!kh()},keyCodes:[e,t,i]})},gp=function(){const e=At.registry.createSerializedKey(ft.Z,[ft.CTRL]),t=At.registry.createSerializedKey(ft.Z,[ft.ALT]),i=At.registry.createSerializedKey(ft.Z,[ft.META]);At.registry.register({name:Ks.UNDO,preconditionFn(r){return!r.options.readOnly&&!bi.inProgress()},callback(r){return r.hideChaff(),r.undo(!1),!0},keyCodes:[e,t,i]})},fp=function(){const e=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.CTRL]),t=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.ALT]),i=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.META]),r=At.registry.createSerializedKey(ft.Y,[ft.CTRL]);At.registry.register({name:Ks.REDO,preconditionFn(c){return!bi.inProgress()&&!c.options.readOnly},callback(c){return c.hideChaff(),c.undo(!0),!0},keyCodes:[e,t,i,r]})},mp=function(){dp(),hp(),pp(),$p(),_p(),gp(),fp()},vm=function(e){return e.isSelectable()},Im=function(e){oe().hideChaff(e)},st=st||{},st.scope={},st.ASSUME_ES5=!1,st.ASSUME_NO_NATIVE_MAP=!1,st.ASSUME_NO_NATIVE_SET=!1,st.SIMPLE_FROUND_POLYFILL=!1,st.ISOLATE_POLYFILLS=!1,st.FORCE_POLYFILL_PROMISE=!1,st.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,st.defineProperty=st.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,i){return e==Array.prototype||e==Object.prototype||(e[t]=i.value),e},st.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof Do=="object"&&Do];for(var t=0;t>>0,st.propertyToPolyfillSymbol[c]=st.IS_SYMBOL_NATIVE?st.global.Symbol(c):st.POLYFILL_PREFIX+i+"$"+c),st.defineProperty(r,st.propertyToPolyfillSymbol[c],{configurable:!0,writable:!0,value:t})))},st.polyfill("globalThis",function(e){return e||st.global},"es_2020","es3"),st.arrayIteratorImpl=function(e){var t=0;return function(){return t{const e=Rm.length,t=[];for(let i=0;20>i;i++)t[i]=Rm.charAt(Math.random()*e);return t.join("")}},fS=0,Ia={};Ia.TEST_ONLY=km,Ia.genUid=he,Ia.getNextUniqueId=$e;var Tp,Er,Oa,Bi,Fi,mn,br,Ca,Tn,ci,ai,vr,Fs,Ir,Or,Cr,Ui,Hi,En,yr,Us,bn,ya,vn,Sa,pt;Tp="",Er=!0,Oa=0,s.CREATE$$module$build$src$core$events$utils="create",s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils="delete",s.DELETE$$module$build$src$core$events$utils,s.CHANGE$$module$build$src$core$events$utils="change",s.CHANGE$$module$build$src$core$events$utils,Bi="block_field_intermediate_change",s.MOVE$$module$build$src$core$events$utils="move",s.MOVE$$module$build$src$core$events$utils,Fi="var_create",mn="var_delete",br="var_rename",Ca="ui",Tn="drag",ci="selected",ai="click",vr="marker_move",Fs="bubble_open",Ir="trashcan_open",Or="toolbox_item_select",Cr="theme_change",Ui="viewport_change",Hi="comment_create",En="comment_delete",yr="comment_change",Us="comment_move",bn="finished_loading",ya=[s.CREATE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,Hi,Us],vn=[],Sa={FIRE_QUEUE:vn,fireNow:D,fireInternal:Ie,setGroupInternal:Me},pt={},pt.BLOCK_CHANGE=s.CHANGE$$module$build$src$core$events$utils,pt.BLOCK_CREATE=s.CREATE$$module$build$src$core$events$utils,pt.BLOCK_DELETE=s.DELETE$$module$build$src$core$events$utils,pt.BLOCK_DRAG=Tn,pt.BLOCK_FIELD_INTERMEDIATE_CHANGE=Bi,pt.BLOCK_MOVE=s.MOVE$$module$build$src$core$events$utils,pt.BUBBLE_OPEN=Fs,pt.BUMP_EVENTS=ya,pt.CHANGE=s.CHANGE$$module$build$src$core$events$utils,pt.CLICK=ai,pt.COMMENT_CHANGE=yr,pt.COMMENT_CREATE=Hi,pt.COMMENT_DELETE=En,pt.COMMENT_MOVE=Us,pt.CREATE=s.CREATE$$module$build$src$core$events$utils,pt.DELETE=s.DELETE$$module$build$src$core$events$utils,pt.FINISHED_LOADING=bn,pt.MARKER_MOVE=vr,pt.MOVE=s.MOVE$$module$build$src$core$events$utils,pt.SELECTED=ci,pt.TEST_ONLY=Sa,pt.THEME_CHANGE=Cr,pt.TOOLBOX_ITEM_SELECT=Or,pt.TRASHCAN_OPEN=Ir,pt.UI=Ca,pt.VAR_CREATE=Fi,pt.VAR_DELETE=mn,pt.VAR_RENAME=br,pt.VIEWPORT_CHANGE=Ui,pt.clearPendingUndo=ae,pt.disable=s.disable$$module$build$src$core$events$utils,pt.disableOrphans=We,pt.enable=s.enable$$module$build$src$core$events$utils,pt.filter=B,pt.fire=re,pt.fromJson=Je,pt.get=we,pt.getDescendantIds=Xe,pt.getGroup=s.getGroup$$module$build$src$core$events$utils,pt.getRecordUndo=ke,pt.isEnabled=_e,pt.setGroup=s.setGroup$$module$build$src$core$events$utils,pt.setRecordUndo=fe,function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM"}(s.inputTypes$$module$build$src$core$inputs$input_types||(s.inputTypes$$module$build$src$core$inputs$input_types={})),s.inputTypes$$module$build$src$core$inputs$input_types;var Ra={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ep={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:ka,DOMParser:Bl,XMLSerializer:Fl}=globalThis;Bl&&(Ra=new Bl),Fl&&(Ep=new Fl);var Am="https://developers.google.com/blockly/xml",mS=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,In={};In.NAME_SPACE=Am,In.createElement=s.createElement$$module$build$src$core$utils$xml,In.createTextNode=s.createTextNode$$module$build$src$core$utils$xml,In.domToText=ht,In.injectDependencies=nt,In.textToDom=s.textToDom$$module$build$src$core$utils$xml;var Uo=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Uo.MUTATOR=new Uo("mutator"),Uo.WARNING=new Uo("warning"),Uo.COMMENT=new Uo("comment");var Sr={};Sr.warn=xe;var Aa="http://www.w3.org/2000/svg",ui="http://www.w3.org/1999/xhtml",us="http://www.w3.org/1999/xlink",di;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(di||(di={}));var Es=null,bp=0,La=null,co={};co.HTML_NS=ui,co.NodeType=di,co.SVG_NS=Aa,co.XLINK_NS=us,co.addClass=I,co.containsNode=Te,co.createSvgElement=w,co.getFastTextWidth=Ne,co.getFastTextWidthWithSizeString=He,co.getTextWidth=Se,co.hasClass=K,co.insertAfter=de,co.measureFontMetrics=be,co.removeClass=A,co.removeClasses=N,co.removeNode=U,co.setCssTransform=se,co.startTextWidthCache=Ce,co.stopTextWidthCache=ce;var Vt=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}},Lm=function(e,t){window.alert(e),t&&t()},Nm=function(e,t){t(window.confirm(e))},wm=function(e,t,i){i(window.prompt(e,t))},Mm={confirmInternal:ye},Vi={};Vi.TEST_ONLY=Mm,Vi.alert=ee,Vi.confirm=ue,Vi.prompt=g,Vi.setAlert=ie,Vi.setConfirm=E,Vi.setPrompt=k;var vp,Na;s.Msg$$module$build$src$core$msg=Object.create(null),vp=function(e){Object.keys(e).forEach(function(t){s.Msg$$module$build$src$core$msg[t]=e[t]})},Na={},Na.Msg=s.Msg$$module$build$src$core$msg,Na.setLocale=vp;var Rr=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=s.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ke()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,i){return i.isBlank=!1,i.group=e.group||"",i.workspaceId=t.id,i}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=S(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ul=class extends Rr{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Ul),t.varId=e.varId,t}},Ip=class extends Ul{constructor(e){super(e),this.type=Fi,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Ip),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};l(Ae.EVENT,Fi,Ip);var Hl=class{constructor(e,t,i,r){this.workspace=e,this.name=t,this.type=i||"",this.id_=r||he()}getId(){return this.id_}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},Op="VARIABLE",Cp="ijkmnopqrstuvwxyzabcdefgh",Dm={generateUniqueNameInternal:ii},ao={};ao.CATEGORY_NAME=Op,ao.TEST_ONLY=Dm,ao.VAR_LETTER_OPTIONS=Cp,ao.allDeveloperVariables=s.allDeveloperVariables$$module$build$src$core$variables,ao.allUsedVarModels=s.allUsedVarModels$$module$build$src$core$variables,ao.createVariableButtonHandler=Qo,ao.flyoutCategory=ze,ao.flyoutCategoryBlocks=yt,ao.generateUniqueName=ls,ao.generateUniqueNameFromOptions=xt,ao.generateVariableFieldDom=s.generateVariableFieldDom$$module$build$src$core$variables,ao.getAddedVariables=C,ao.getOrCreateVariablePackage=s.getOrCreateVariablePackage$$module$build$src$core$variables,ao.getVariable=s.getVariable$$module$build$src$core$variables,ao.nameUsedWithAnyType=qo,ao.nameUsedWithConflictingParam=b,ao.promptName=Ht,ao.renameVariable=s.renameVariable$$module$build$src$core$variables;var Ue=class{constructor(e,t){this.x=e,this.y=t}clone(){return new Ue(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const i=e.x-t.x;return e=e.y-t.y,Math.sqrt(i*i+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new Ue(e.x-t.x,e.y-t.y)}static sum(e,t){return new Ue(e.x+t.x,e.y+t.y)}},Hs=class{constructor(e,t,i,r,c){this.workspace=e,this.editable=this.movable=this.deletable=!0,this.disposed_=!1,this.isComment=!0,this.id=c&&!e.getCommentById(c)?c:he(),e.addTopComment(this),this.xy_=new Ue(0,0),this.height_=i,this.width_=r,this.RTL=e.RTL,this.content_=t,Hs.fireCreateEvent(this)}dispose(){this.disposed_||(_e()&&re(new(we(En))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)}getHeight(){return this.height_}setHeight(e){this.height_=e}getWidth(){return this.width_}setWidth(e){this.width_=e}getRelativeToSurfaceXY(){return new Ue(this.xy_.x,this.xy_.y)}moveBy(e,t){const i=new(we(Us))(this);this.xy_.translate(e,t),i.recordNew(),re(i)}isDeletable(){return this.deletable&&!(this.workspace&&this.workspace.options.readOnly)}setDeletable(e){this.deletable=e}isMovable(){return this.movable&&!(this.workspace&&this.workspace.options.readOnly)}setMovable(e){this.movable=e}isEditable(){return this.editable&&!(this.workspace&&this.workspace.options.readOnly)}setEditable(e){this.editable=e}getContent(){return this.content_}setContent(e){this.content_!==e&&(re(new(we(yr))(this,this.content_,e)),this.content_=e)}toXmlWithXY(e){return e=this.toXml(e),e.setAttribute("x",String(Math.round(this.xy_.x))),e.setAttribute("y",String(Math.round(this.xy_.y))),e.setAttribute("h",String(this.height_)),e.setAttribute("w",String(this.width_)),e}toXml(e){const t=s.createElement$$module$build$src$core$utils$xml("comment");return e||(t.id=this.id),t.textContent=this.getContent(),t}static fireCreateEvent(e){if(_e()){const t=s.getGroup$$module$build$src$core$events$utils();t||s.setGroup$$module$build$src$core$events$utils(!0);try{re(new(we(Hi))(e))}finally{s.setGroup$$module$build$src$core$events$utils(t)}}}static fromXml(e,t){var i=Hs.parseAttributes(e);return t=new Hs(t,i.content,i.h,i.w,i.id),i=e.getAttribute("x"),e=e.getAttribute("y"),i=i?parseInt(i,10):NaN,e=e?parseInt(e,10):NaN,isNaN(i)||isNaN(e)||t.moveBy(i,e),Hs.fireCreateEvent(t),t}static parseAttributes(e){const t=e.getAttribute("h"),i=e.getAttribute("w"),r=e.getAttribute("x"),c=e.getAttribute("y"),$=e.getAttribute("id");if(!$)throw Error("No ID present in XML comment definition.");let v;return{id:$,h:t?parseInt(t):100,w:i?parseInt(i):100,x:r?parseInt(r):NaN,y:c?parseInt(c):NaN,content:(v=e.textContent)!=null?v:""}}},Vs=class extends Rr{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},yp=class extends Vs{constructor(e,t,i){super(i),this.type=ci,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new yp),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};l(Ae.EVENT,ci,yp);var TS=750,Pm="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),wa=null,On={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},Ma=0,hi={};hi.TOUCH_ENABLED=Pm,hi.TOUCH_MAP=On,hi.checkTouchIdentifier=po,hi.clearTouchIdentifier=Ge,hi.getTouchIdentifierFromEvent=Mt,hi.longStart=V,hi.longStop=ve,hi.shouldHandleEvent=rt;var Sp,xm,Bm,Fm,Da,Pa,Rp,Um,Hm,Vm;(function(e){function t(r){return i.indexOf(r.toUpperCase())!==-1}Sp=e;const i=Sp.toUpperCase();xm=t("JavaFX"),Bm=t("WebKit"),Fm=t("Gecko")&&!Bm,Da=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,Pa=t("iPad")||t("Macintosh")&&0.blocklyPathLight { + display: none; +} + +.blocklyDraggable { + cursor: grab; + cursor: -webkit-grab; +} + +.blocklyDragging { + cursor: grabbing; + cursor: -webkit-grabbing; +} + + /* Changes cursor on mouse down. Not effective in Firefox because of + https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */ +.blocklyDraggable:active { + cursor: grabbing; + cursor: -webkit-grabbing; +} + +.blocklyDragging.blocklyDraggingDelete { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyDragging>.blocklyPath, +.blocklyDragging>.blocklyPathLight { + fill-opacity: .8; + stroke-opacity: .8; +} + +.blocklyDragging>.blocklyPathDark { + display: none; +} + +.blocklyDisabled>.blocklyPath { + fill-opacity: .5; + stroke-opacity: .5; +} + +.blocklyDisabled>.blocklyPathLight, +.blocklyDisabled>.blocklyPathDark { + display: none; +} + +.blocklyInsertionMarker>.blocklyPath, +.blocklyInsertionMarker>.blocklyPathLight, +.blocklyInsertionMarker>.blocklyPathDark { + fill-opacity: .2; + stroke: none; +} + +.blocklyMultilineText { + font-family: monospace; +} + +.blocklyNonEditableText>text { + pointer-events: none; +} + +.blocklyFlyout { + position: absolute; + z-index: 20; +} + +.blocklyText text { + cursor: default; +} + +/* + Don't allow users to select text. It gets annoying when trying to + drag a block and selected text moves instead. +*/ +.blocklySvg text { + user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + cursor: inherit; +} + +.blocklyHidden { + display: none; +} + +.blocklyFieldDropdown:not(.blocklyHidden) { + display: block; +} + +.blocklyIconGroup { + cursor: default; +} + +.blocklyIconGroup:not(:hover), +.blocklyIconGroupReadonly { + opacity: .6; +} + +.blocklyIconShape { + fill: #00f; + stroke: #fff; + stroke-width: 1px; +} + +.blocklyIconSymbol { + fill: #fff; +} + +.blocklyMinimalBody { + margin: 0; + padding: 0; +} + +.blocklyHtmlInput { + border: none; + border-radius: 4px; + height: 100%; + margin: 0; + outline: none; + padding: 0; + width: 100%; + text-align: center; + display: block; + box-sizing: border-box; +} + +/* Remove the increase and decrease arrows on the field number editor */ +input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button, +input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type=number] { + -moz-appearance: textfield; +} + +.blocklyMainBackground { + stroke-width: 1; + stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */ +} + +.blocklyMutatorBackground { + fill: #fff; + stroke: #ddd; + stroke-width: 1; +} + +.blocklyFlyoutBackground { + fill: #ddd; + fill-opacity: .8; +} + +.blocklyMainWorkspaceScrollbar { + z-index: 20; +} + +.blocklyFlyoutScrollbar { + z-index: 30; +} + +.blocklyScrollbarHorizontal, +.blocklyScrollbarVertical { + position: absolute; + outline: none; +} + +.blocklyScrollbarBackground { + opacity: 0; +} + +.blocklyScrollbarHandle { + fill: #ccc; +} + +.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyScrollbarHandle:hover { + fill: #bbb; +} + +/* Darken flyout scrollbars due to being on a grey background. */ +/* By contrast, workspace scrollbars are on a white background. */ +.blocklyFlyout .blocklyScrollbarHandle { + fill: #bbb; +} + +.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyFlyout .blocklyScrollbarHandle:hover { + fill: #aaa; +} + +.blocklyInvalidInput { + background: #faa; +} + +.blocklyVerticalMarker { + stroke-width: 3px; + fill: rgba(255,255,255,.5); + pointer-events: none; +} + +.blocklyComputeCanvas { + position: absolute; + width: 0; + height: 0; +} + +.blocklyNoPointerEvents { + pointer-events: none; +} + +.blocklyContextMenu { + border-radius: 4px; + max-height: 100%; +} + +.blocklyDropdownMenu { + border-radius: 2px; + padding: 0 !important; +} + +.blocklyDropdownMenu .blocklyMenuItem { + /* 28px on the left for icon or checkbox. */ + padding-left: 28px; +} + +/* BiDi override for the resting state. */ +.blocklyDropdownMenu .blocklyMenuItemRtl { + /* Flip left/right padding for BiDi. */ + padding-left: 5px; + padding-right: 28px; +} + +.blocklyWidgetDiv .blocklyMenu { + background: #fff; + border: 1px solid transparent; + box-shadow: 0 0 3px 1px rgba(0,0,0,.3); + font: normal 13px Arial, sans-serif; + margin: 0; + outline: none; + padding: 4px 0; + position: absolute; + overflow-y: auto; + overflow-x: hidden; + max-height: 100%; + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +.blocklyWidgetDiv .blocklyMenu.blocklyFocused { + box-shadow: 0 0 6px 1px rgba(0,0,0,.3); +} + +.blocklyDropDownDiv .blocklyMenu { + background: inherit; /* Compatibility with gapi, reset from goog-menu */ + border: inherit; /* Compatibility with gapi, reset from goog-menu */ + font: normal 13px "Helvetica Neue", Helvetica, sans-serif; + outline: none; + position: relative; /* Compatibility with gapi, reset from goog-menu */ + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +/* State: resting. */ +.blocklyMenuItem { + border: none; + color: #000; + cursor: pointer; + list-style: none; + margin: 0; + /* 7em on the right for shortcut. */ + min-width: 7em; + padding: 6px 15px; + white-space: nowrap; +} + +/* State: disabled. */ +.blocklyMenuItemDisabled { + color: #ccc; + cursor: inherit; +} + +/* State: hover. */ +.blocklyMenuItemHighlight { + background-color: rgba(0,0,0,.1); +} + +/* State: selected/checked. */ +.blocklyMenuItemCheckbox { + height: 16px; + position: absolute; + width: 16px; +} + +.blocklyMenuItemSelected .blocklyMenuItemCheckbox { + background: url(<<>>/sprites.png) no-repeat -48px -16px; + float: left; + margin-left: -24px; + position: static; /* Scroll with the menu. */ +} + +.blocklyMenuItemRtl .blocklyMenuItemCheckbox { + float: right; + margin-right: -24px; +} +`,Mp={};Mp.inject=gd,Mp.register=cs;var Bt=class{constructor(e,t,i,r){this.top=e,this.bottom=t,this.left=i,this.right=r}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return!(this.left>e.right||this.righte.bottom||this.bottom{this.disposed_||(this.textarea.focus(),this.addFocus(),this.svgRectTarget&&I(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&I(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}blurFocus(){this.focused=!1,setTimeout(()=>{this.disposed_||(this.textarea.blur(),this.removeFocus(),this.svgRectTarget&&A(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&A(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}static fromXmlRendered(e,t,i){s.disable$$module$build$src$core$events$utils();let r;try{const c=Hs.parseAttributes(e);if(r=new yo(t,c.content,c.h,c.w,c.id),t.rendered&&(r.initSvg(!0),r.render()),!isNaN(c.x)&&!isNaN(c.y))if(t.RTL){const $=i||t.getWidth();r.moveBy($-c.x,c.y)}else r.moveBy(c.x,c.y)}finally{s.enable$$module$build$src$core$events$utils()}return Hs.fireCreateEvent(r),r}};yo.DEFAULT_SIZE=100,yo.TOP_OFFSET=10,cs(` +.blocklyCommentForeignObject { + position: relative; + z-index: 0; +} + +.blocklyCommentRect { + fill: #E7DE8E; + stroke: #bcA903; + stroke-width: 1px; +} + +.blocklyCommentTarget { + fill: transparent; + stroke: #bcA903; +} + +.blocklyCommentTargetFocused { + fill: none; +} + +.blocklyCommentHandleTarget { + fill: none; +} + +.blocklyCommentHandleTargetFocused { + fill: transparent; +} + +.blocklyFocused>.blocklyCommentRect { + fill: #B9B272; + stroke: #B9B272; +} + +.blocklySelected>.blocklyCommentTarget { + stroke: #fc3; + stroke-width: 3px; +} + +.blocklyCommentDeleteIcon { + cursor: pointer; + fill: #000; + display: none; +} + +.blocklySelected > .blocklyCommentDeleteIcon { + display: block; +} + +.blocklyDeleteIconShape { + fill: #000; + stroke: #000; + stroke-width: 1px; +} + +.blocklyDeleteIconShape.blocklyDeleteIconHighlighted { + stroke: #fc3; +} +`);var Fa=new Set,Ua=new WeakSet,Ar=null,Dp=null,Km=0,Ha={};Ha.finishQueuedRenders=cr,Ha.queueRender=Id,Ha.triggerQueuedRenders=Ds;var Ho={};Ho.appendDomToWorkspace=Bg,Ho.blockToDom=Ni,Ho.blockToDomWithXY=Ol,Ho.clearWorkspaceAndLoadFromXml=xg,Ho.deleteNext=jg,Ho.domToBlock=s.domToBlock$$module$build$src$core$xml,Ho.domToBlockInternal=wi,Ho.domToPrettyText=Pg,Ho.domToText=Ps,Ho.domToVariables=Ld,Ho.domToWorkspace=s.domToWorkspace$$module$build$src$core$xml,Ho.variablesToDom=kd,Ho.workspaceToDom=wg;var Lr=class extends Error{},Qm=class extends Lr{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},Vl=class extends Lr{constructor(e,t,i){super(`The block ${t.toDevString()} is missing a(n) ${e} +connection`),this.block=t,this.state=i}},qm=class extends Lr{constructor(e,t,i,r){super(`The block ${i.toDevString()} could not connect its +${t} to its parent, because: ${e}`),this.childBlock=i,this.childState=r}},Jm=class extends Lr{constructor(e){super(`Encountered a real block which is defined as a child of a shadow +block. It is an invariant of Blockly that shadow blocks only have shadow +children`),this.state=e}},Zm=class extends Lr{constructor(e,t,i){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=i}},Cn={};Cn.BadConnectionCheck=qm,Cn.DeserializationError=Lr,Cn.MissingBlockType=Qm,Cn.MissingConnection=Vl,Cn.RealChildOfShadow=Jm,Cn.UnregisteredIcon=Zm;var eT=100,tT=75,oT=50,Va={};Va.BLOCKS=oT,Va.PROCEDURES=tT,Va.VARIABLES=eT;var Pp={};Pp.register=jc,Pp.unregister=Yg;var sT=class{constructor(){this.priority=oT}save(e){const t=[];for(const i of e.getTopBlocks(!1))(e=xs(i,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const i of e)_n(i,t,{recordUndo:ke()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};jc("blocks",new sT);var Gl={};Gl.BlockSerializer=sT,Gl.append=_n,Gl.appendInternal=Cl,Gl.save=xs;var yn=class extends Rr{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new yn),t.blockId=e.blockId,t}},xp=class extends yn{constructor(e){super(e),this.type=s.CREATE$$module$build$src$core$events$utils,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=Ol(e),this.ids=Xe(e),this.json=xs(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=Ps(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new xp),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(e)_n(this.json,t);else for(e=0;e")),re(new Sn(t,"mutation",null,i,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState())?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?Ps(e):""}};l(Ae.EVENT,s.CHANGE$$module$build$src$core$events$utils,Sn);var Bp=class extends yn{constructor(e){if(super(e),this.type=s.DELETE$$module$build$src$core$events$utils,e){if(e.getParent())throw Error("Connected blocks cannot be deleted.");e.isShadow()&&(this.recordUndo=!1),this.oldXml=Ol(e),this.ids=Xe(e),this.wasShadow=e.isShadow(),this.oldJson=xs(e,{addCoordinates:!0})}}toJson(){const e=super.toJson();if(!this.oldXml)throw Error("The old block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.oldXml=Ps(this.oldXml),e.ids=this.ids,e.wasShadow=this.wasShadow,e.oldJson=this.oldJson,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Bp),t.oldXml=s.textToDom$$module$build$src$core$utils$xml(e.oldXml),t.ids=e.ids,t.wasShadow=e.wasShadow||t.oldXml.tagName.toLowerCase()==="shadow",t.oldJson=e.oldJson,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(e)for(e=0;ec.top?Xd(i,r,c,$):t+$.heightdocument.documentElement.clientTop?Xd(i,r,c,$):gf(e,c,$)}},so={};so.ANIMATION_TIME=za,so.ARROW_HORIZONTAL_PADDING=lT,so.ARROW_SIZE=Wl,so.BORDER_SIZE=Up,so.PADDING_Y=Hp,so.TEST_ONLY=Wp,so.clearContent=Yc,so.createDom=Bd,so.getContentDiv=dr,so.getOwner=Ud,so.getPositionX=Sl,so.hide=Qc,so.hideIfOwner=hr,so.hideWithoutAnimation=fs,so.isVisible=jd,so.repositionForWindowResize=Kd,so.setBoundsElement=Fd,so.setColour=Kc,so.show=Wd,so.showPositionedByBlock=_f,so.showPositionedByField=yl;var zl=class{constructor(e){this.workspace=e,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(e),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg_=e):this.cursorSvg_=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,i;i=e[t];t++)this.unregisterMarker(i);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};zl.LOCAL_MARKER="local_marker_1";var An={};An.commonWordPrefix=Qd,An.commonWordSuffix=qd,An.isNumber=s.isNumber$$module$build$src$core$utils$string,An.shortestStringLength=Rl,An.startsWith=ff,An.wrap=s.wrap$$module$build$src$core$utils$string;var Xa=void 0,Xl=!1,Pr=!1,aT=50,uT=0,Ln=0,zp=0,Xp=0,ds=null,jl=null,jp=0,Yp=10,dT=10,hT=750,ja=5,ro=null,$o={};$o.HOVER_MS=hT,$o.LIMIT=aT,$o.MARGINS=ja,$o.OFFSET_X=jp,$o.OFFSET_Y=Yp,$o.RADIUS_OK=dT,$o.bindMouseEvents=kl,$o.block=ih,$o.createDom=eh,$o.dispose=sh,$o.getCustomTooltip=bf,$o.getDiv=If,$o.getTooltipOfObject=pr,$o.hide=ni,$o.isVisible=vf,$o.setCustomTooltip=Ef,$o.unbindMouseEvents=th,$o.unblock=nh;var Kp=.45,Qp=.65,pT={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},So={};So.blend=gn,So.getHsvSaturation=rh,So.getHsvValue=lh,So.hexToRgb=Jc,So.hsvToHex=Zc,So.hueToHex=ch,So.names=pT,So.parse=Di,So.rgbToHex=Al,So.setHsvSaturation=Af,So.setHsvValue=Lf;var Yl={};Yl.checkMessageReferences=ta,Yl.parseBlockColour=$r,Yl.replaceMessageReferences=Zt,Yl.tokenizeInterpolation=ah;var xr=null,Ya=null,Br="",Fr="",bs,Gs={};Gs.createDom=uh,Gs.getDiv=fn,Gs.hide=as,Gs.hideIfOwner=sa,Gs.isVisible=dh,Gs.positionWithAnchor=ph,Gs.repositionForWindowResize=$h,Gs.show=oa,Gs.testOnly_setDiv=Nf;var bt=class{constructor(e,t,i){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Vt(0,0),e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(Zt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=w(te.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}createBorderRect_(){this.borderRect_=w(te.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=w(te.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");kl(e),this.mouseDownWrapper_=Be(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(bt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(bt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=s.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),ht(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(s.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){hr(this),sa(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||U(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(I(e,"blocklyEditableText"),A(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(I(e,"blocklyNonEditableText"),A(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==bt.prototype.showEditor_}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let i=2*e,r=t.FIELD_TEXT_HEIGHT,c=0;this.textElement_&&(c=Ne(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),i+=c),this.borderRect_&&(r=Math.max(r,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=r,this.size_.width=i,this.positionTextElement_(e,c),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var i=this.getConstants(),r=this.size_.height/2,c;this.textElement_.setAttribute("x",String((c=this.getSourceBlock())!=null&&c.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(i.FIELD_TEXT_BASELINE_CENTER?r:r-i.FIELD_TEXT_HEIGHT/2+i.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Vt(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new io;if(this.borderRect_){var i=this.borderRect_.getBoundingClientRect();e=Li(this.borderRect_),t=i.width,i=i.height}else{i=this.sourceBlock_.getHeightWidth();const r=t.workspace.scale;e=this.getAbsoluteXY_(),t=(i.width+1)*r,i=(i.height+1)*r,kp?(e.x+=1.5*r,e.y+=1.5*r):(e.x-=.5*r,e.y-=.5*r)}return new Bt(e.y,e.y+i,e.x,e.x+t)}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,bt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):bt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.queueRender(),this.sourceBlock_.bumpNeighbours())}setValue(e,t=!0){if(e!==null){var i=this.doClassValidation_(e);if(e=this.processValidation_(e,i),!(e instanceof Error)){var r;i=(r=this.getValidator())==null?void 0:r.call(this,e),r=this.processValidation_(e,i),r instanceof Error||(e=this.sourceBlock_,e&&e.disposed||(i=this.getValue(),i===r?this.doValueUpdate_(r):(this.doValueUpdate_(r),t&&e&&_e()&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(e,"field",this.name||null,i,r)),this.isDirty_&&this.forceRerender())))}}}processValidation_(e,t){return t===null?(this.doValueInvalid_(e),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip_=e}getTooltip(){const e=this.getClickTarget_();return pr(e||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return Li(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new io;const i=t.inputList;for(let r=0;re?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let i;for(;i=this.menuItems[e];){if(i.isEnabled()){this.setHighlighted(i);break}e+=t}}handleMouseOver(e){(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const i=new Ue(e.clientX,e.clientY);if(1>Ue.distance(t,i))return}(e=this.getMenuItem(e.target))&&e.performAction()}handleMouseEnter(e){this.focus()}handleMouseLeave(e){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Il(e);return t.height=e.scrollHeight,t}},Jp=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=$e(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var i=document.createElement("div");i.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(i)}return i=this.content,typeof this.content=="string"&&(i=document.createTextNode(this.content)),t.appendChild(i),e.appendChild(t),this.roleName&&ms(e,this.roleName),Xt(e,Gt.SELECTED,this.checkable&&this.checked||!1),Xt(e,Gt.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(I(t,"blocklyMenuItemHighlight"),I(t,"goog-menuitem-highlight")):(A(t,"blocklyMenuItemHighlight"),A(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},Ws=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.svgArrow=this.arrow=this.imageElement=this.menu_=this.selectedMenuItem=null,this.SERIALIZABLE=!0,this.CURSOR="default",this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null,e!==bt.SKIP_SETUP&&(Array.isArray(e)?(_h(e),e=Bf(e),this.menuGenerator_=e.options,this.prefixField=e.prefix||null,this.suffixField=e.suffix||null):this.menuGenerator_=e,this.selectedOption=this.getOptions(!1)[0],i&&this.configure_(i),this.setValue(this.selectedOption[1]),t&&this.setValidator(t))}fromXml(e){this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(e.textContent)}loadState(e){this.loadLegacyState(Ws,e)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(e))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot(),this.createTextElement_(),this.imageElement=w(te.IMAGE,{},this.fieldGroup_),this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_(),this.borderRect_&&I(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){let e;return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!((e=this.getSourceBlock())!=null&&e.isShadow())}createTextArrow_(){this.arrow=w(te.TSPAN,{},this.textElement_);let e;this.arrow.appendChild(document.createTextNode((e=this.getSourceBlock())!=null&&e.RTL?Ws.ARROW_CHAR+" ":" "+Ws.ARROW_CHAR));let t;(t=this.getSourceBlock())!=null&&t.RTL?this.getTextElement().insertBefore(this.arrow,this.textContent_):this.getTextElement().appendChild(this.arrow)}createSVGArrow_(){this.svgArrow=w(te.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_),this.svgArrow.setAttributeNS(us,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(e){var t=this.getSourceBlock();if(!t)throw new io;this.dropdownCreate(),this.menu_.openingCoords=e&&typeof e.clientX=="number"?new Ue(e.clientX,e.clientY):null,Yc(),e=this.menu_.render(dr()),I(e,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(e=t.isShadow()?t.getParent().getColour():t.getColour(),t=t.isShadow()?t.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,Kc(e,t)),yl(this,this.dropdownDispose_.bind(this)),this.menu_.focus(),this.selectedMenuItem&&(this.menu_.setHighlighted(this.selectedMenuItem),Wc(this.selectedMenuItem.getElement(),dr(),!0)),this.applyColour()}dropdownCreate(){const e=this.getSourceBlock();if(!e)throw new io;const t=new qp;t.setRole(Vo.LISTBOX),this.menu_=t;const i=this.getOptions(!1);this.selectedMenuItem=null;for(let c=0;ct[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,i;i=e[t];t++)i[1]===this.value_&&(this.selectedOption=i)}applyColour(){const e=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",e.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=e.colourSecondary:this.arrow.style.fill=e.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new io;this.imageElement.style.display="",this.imageElement.setAttributeNS(us,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const i=Number(e.height);e=Number(e.width);var r=!!this.borderRect_;const c=Math.max(r?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,i+SS);r=r?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let $;$=this.svgArrow?this.positionSVGArrow(e+r,c/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Ne(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+$+2*r,this.size_.height=c;let v=0;t.RTL?this.imageElement.setAttribute("x",`${r+$}`):(v=e+$,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${r}`)),this.imageElement.setAttribute("y",String(c/2-i/2)),this.positionTextElement_(v+r,e+$)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();I(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const i=Ne(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let r=0;this.svgArrow&&(r=this.positionSVGArrow(i+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=i+r+2*t,this.size_.height=e,this.positionTextElement_(t,i)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const i=this.getSourceBlock();if(!i)throw new io;const r=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,c=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,$=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(i.RTL?r:e+c)+","+t+")"),$+c}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}};Ws.CHECKMARK_OVERHANG=25,Ws.MAX_MENU_HEIGHT_VH=.45,Ws.ARROW_CHAR="▾";var yS=5,SS=2*yS;Jo("field_dropdown",Ws);var Ka=class{constructor(e){this.sourceBlock=e,this.offsetInBlock=new Ue(0,0),this.workspaceLocation=new Ue(0,0),this.svgRoot=null}getType(){throw Error("Icons must implement getType")}initView(e){if(!this.svgRoot){var t=this.sourceBlock;this.svgRoot=w(te.G,{class:"blocklyIconGroup"}),t.getSvgRoot().appendChild(this.svgRoot),this.updateSvgRootOffset(),Be(this.svgRoot,"pointerdown",this,e)}}dispose(){U(this.svgRoot)}getWeight(){return-1}getSize(){return new Vt(0,0)}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",Mi(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(e){this.offsetInBlock=e,this.updateSvgRootOffset()}updateSvgRootOffset(){let e;(e=this.svgRoot)==null||e.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(e){this.workspaceLocation=Ue.sum(e,this.offsetInBlock)}onClick(){}setVisible(e){xe("setVisible","v10","v11","setBubbleVisible"),Mi(this)&&this.setBubbleVisible(e)}},no=class{constructor(e,t,i,r,c){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new Ue(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new Ue(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=i||!1,this.margin=c!==void 0?c:no.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),r&&(e+=" "+r),this.outerSvg=w(te.SVG,{class:e}),r=w(te.G,{},this.outerSvg),this.svgBackground=w(te.RECT,{class:"blocklyScrollbarBackground"},r),e=Math.floor((no.scrollbarThickness-5)/2),this.svgHandle=w(te.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},r),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),de(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=Be(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=Be(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=no.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),Dt(this.onMouseDownBarWrapper_),Dt(this.onMouseDownHandleWrapper_),U(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,se(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&no.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=no.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=no.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-no.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var i=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*i,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=i/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=no.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-no.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var i=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*i,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=i/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Ge(),this.cleanUp(),Ai(e))e.stopPropagation();else{var t=pn(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var i=zc(this.svgHandle);i=this.horizontal?i.x:i.y;var r=this.handlePosition,c=.95*this.handleLength;t<=i?r-=c:t>=i+this.handleLength&&(r+=c),this.setHandlePosition(this.constrainHandlePosition(r)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),Ai(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=Be(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=Be(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Ge(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(Dt(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(Dt(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new Ue(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};no.scrollbarThickness=Pm?25:15,no.DEFAULT_SCROLLBAR_MARGIN=.5;var Zp,$t=class{constructor(e,t,i){this.workspace=e,this.anchor=t,this.ownerRect=i,this.size=new Vt(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.svgRoot=w(te.G,{},e.getBubbleCanvas()),e=w(te.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=w(te.PATH,{},e),this.background=w(te.RECT,{class:"blocklyDraggable",x:0,y:0,rx:$t.BORDER_WIDTH,ry:$t.BORDER_WIDTH},e),this.contentContainer=w(te.G,{},this.svgRoot),Be(this.background,"pointerdown",this,this.onMouseDown)}dispose(){U(this.svgRoot),this.disposed=!0}setAnchorLocation(e,t=!1){this.anchor=e,t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(e,t){this.relativeLeft=e,this.relativeTop=t,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(e,t=!1){e.width=Math.max(e.width,$t.MIN_SIZE),e.height=Math.max(e.height,$t.MIN_SIZE),this.size=e,this.background.setAttribute("width",`${e.width}`),this.background.setAttribute("height",`${e.height}`),t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(e){this.colour=e,this.tail.setAttribute("fill",e),this.background.setAttribute("fill",e)}onMouseDown(e){let t;(t=this.workspace.getGesture(e))==null||t.handleBubbleStart(e,this)}positionRelativeToAnchor(){let e=this.anchor.x;e=this.workspace.RTL?e-(this.relativeLeft+this.size.width):e+this.relativeLeft,this.moveTo(e,this.relativeTop+this.anchor.y)}moveTo(e,t){this.svgRoot.setAttribute("transform",`translate(${e}, ${t})`)}positionByRect(e=new Bt(0,0,0,0)){var t=this.workspace.getMetricsManager().getViewMetrics(!0),i=this.getOptimalRelativeLeft(t),r=this.getOptimalRelativeTop(t);const c={x:i,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},$={x:-this.size.width-30,y:r};r={x:e.getWidth(),y:r};var v={x:i,y:e.getHeight()};i=e.getWidth()e.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var i=this.anchor.x-t;i-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{i=t+this.anchor.x;const r=i+this.size.width;ie.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const i=this.anchor.y+t,r=i+this.size.height;return e=this.getWorkspaceViewRect(e),ie.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let i=e.top+e.height,r=e.left;return e=e.left+e.width,i-=this.getScrollbarThickness(),this.workspace.RTL?r-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new Bt(t,i,r,e)}getScrollbarThickness(){return no.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,i=this.size.height/2,r=-this.relativeLeft,c=-this.relativeTop;if(t===r&&i===c)e.push("M "+t+","+i);else{c-=i,r-=t,this.workspace.RTL&&(r*=-1);var $=Math.sqrt(c*c+r*r),v=Math.acos(r/$);0>c&&(v=2*Math.PI-v);var H=v+Math.PI/2;H>2*Math.PI&&(H-=2*Math.PI);var Oe=Math.sin(H);const qt=Math.cos(H);let Ft=(this.size.width+this.size.height)/$t.TAIL_THICKNESS;Ft=Math.min(Ft,this.size.width,this.size.height)/4,H=1-$t.ANCHOR_RADIUS/$,r=t+H*r,c=i+H*c,H=t+Ft*qt;const Go=i+Ft*Oe;t-=Ft*qt,i-=Ft*Oe,Oe=ar(this.workspace.RTL?-$t.TAIL_ANGLE:$t.TAIL_ANGLE),Oe=v+Oe,Oe>2*Math.PI&&(Oe-=2*Math.PI),v=Math.sin(Oe)*$/$t.TAIL_BEND,$=Math.cos(Oe)*$/$t.TAIL_BEND,e.push("M"+H+","+Go),e.push("C"+(H+$)+","+(Go+v)+" "+r+","+c+" "+r+","+c),e.push("C"+r+","+c+" "+(t+$)+","+(i+v)+" "+t+","+i)}e.push("z");let Qe;(Qe=this.tail)==null||Qe.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Ue(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}};Zp=$t,$t.BORDER_WIDTH=6,$t.DOUBLE_BORDER=2*Zp.BORDER_WIDTH,$t.MIN_SIZE=Zp.DOUBLE_BORDER,$t.TAIL_THICKNESS=1,$t.TAIL_ANGLE=20,$t.TAIL_BEND=4,$t.ANCHOR_RADIUS=8;var _T={};_T.deepMerge=ri;var Nn=class{constructor(e,t,i,r){this.name=e,this.startHats=!1,this.blockStyles=t||Object.create(null),this.categoryStyles=i||Object.create(null),this.componentStyles=r||Object.create(null),this.fontStyle=Object.create(null),l(Ae.THEME,e,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(e,t){this.blockStyles[e]=t}setCategoryStyle(e,t){this.categoryStyles[e]=t}getComponentStyle(e){if(e=this.componentStyles[e],!e)return null;if(typeof e=="string"){const t=this.getComponentStyle(e);if(t)return t}return`${e}`}setComponentStyle(e,t){this.componentStyles[e]=t}setFontStyle(e){this.fontStyle=e}setStartHats(e){this.startHats=e}static defineTheme(e,t){e=e.toLowerCase();const i=new Nn(e);let r=t.base;if(r){if(typeof r=="string"){let c;r=(c=f(Ae.THEME,r))!=null?c:void 0}r instanceof Nn&&(ri(i,r),i.name=e)}return ri(i.blockStyles,t.blockStyles),ri(i.categoryStyles,t.categoryStyles),ri(i.componentStyles,t.componentStyles),ri(i.fontStyle,t.fontStyle),t.startHats!==null&&(i.startHats=t.startHats),i}},RS={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},kS={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},Qa=new Nn("classic",RS,kS),e$="categoryToolbox",gT="flyoutToolbox",at;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(at||(at={}));var fT={hasCategoriesInternal:Hf},zi={};zi.Position=at,zi.TEST_ONLY=fT,zi.convertFlyoutDefToJsonArray=Ll,zi.convertToolboxDefToJson=ia,zi.hasCategories=na,zi.isCategoryCollapsible=ra,zi.parseToolboxTree=fh;var hs=class{constructor(e){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let t=null,i=!1;var r=!1,c=!1,$=!1,v=!1,H=!1;const Oe=!!e.readOnly;if(!Oe){var Qe;t=ia((Qe=e.toolbox)!=null?Qe:null),i=na(t),r=e.trashcan,r=r===void 0?i:r,c=e.collapse,c=c===void 0?i:c,$=e.comments,$=$===void 0?i:$,v=e.disable,v=v===void 0?i:v,H=e.sounds,H=H===void 0?!0:H}Qe=e.maxTrashcanContents,r?Qe===void 0&&(Qe=32):Qe=0;const qt=!!e.rtl;let Ft=e.horizontalLayout;Ft===void 0&&(Ft=!1);var Go=e.toolboxPosition!=="end";Go=Ft?Go?at.TOP:at.BOTTOM:Go===qt?at.RIGHT:at.LEFT;let Jr=e.css;Jr===void 0&&(Jr=!0);let Zr="https://blockly-demo.appspot.com/static/media/";e.media?Zr=e.media.endsWith("/")?e.media:e.media+"/":"path"in e&&(xe("path","Nov 2014","Jul 2023","media"),Zr=e.path+"media/");const yE=e.oneBasedIndex,a9=e.renderer||"geras",u9=e.plugins||{};let q$=e.modalInputs;q$===void 0&&(q$=!0),this.RTL=qt,this.oneBasedIndex=yE===void 0?!0:yE,this.collapse=c,this.comments=$,this.disable=v,this.readOnly=Oe,this.maxBlocks=e.maxBlocks||1/0;let SE;this.maxInstances=(SE=e.maxInstances)!=null?SE:null,this.modalInputs=q$,this.pathToMedia=Zr,this.hasCategories=i,this.moveOptions=hs.parseMoveOptions_(e,i),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=r,this.maxTrashcanContents=Qe,this.hasSounds=H,this.hasCss=Jr,this.horizontalLayout=Ft,this.languageTree=t,this.gridOptions=hs.parseGridOptions_(e),this.zoomOptions=hs.parseZoomOptions_(e),this.toolboxPosition=Go,this.theme=hs.parseThemeOptions_(e),this.renderer=a9;let RE;this.rendererOverrides=(RE=e.rendererOverrides)!=null?RE:null;let kE;this.parentWorkspace=(kE=e.parentWorkspace)!=null?kE:null,this.plugins=u9}static parseMoveOptions_(e,t){const i=e.move||{},r={};return i.scrollbars===void 0&&e.scrollbars===void 0?r.scrollbars=t:typeof i.scrollbars=="object"?(r.scrollbars={horizontal:!!i.scrollbars.horizontal,vertical:!!i.scrollbars.vertical},r.scrollbars.horizontal&&r.scrollbars.vertical?r.scrollbars=!0:r.scrollbars.horizontal||r.scrollbars.vertical||(r.scrollbars=!1)):r.scrollbars=!!i.scrollbars||!!e.scrollbars,r.wheel=r.scrollbars&&i.wheel!==void 0?!!i.wheel:typeof r.scrollbars=="object",r.drag=r.scrollbars?i.drag===void 0?!0:!!i.drag:!1,r}static parseZoomOptions_(e){e=e.zoom||{};const t={};return t.controls=e.controls===void 0?!1:!!e.controls,t.wheel=e.wheel===void 0?!1:!!e.wheel,t.startScale=e.startScale===void 0?1:Number(e.startScale),t.maxScale=e.maxScale===void 0?3:Number(e.maxScale),t.minScale=e.minScale===void 0?.3:Number(e.minScale),t.scaleSpeed=e.scaleSpeed===void 0?1.2:Number(e.scaleSpeed),t.pinch=e.pinch===void 0?t.wheel||t.controls:!!e.pinch,t}static parseGridOptions_(e){e=e.grid||{};const t={};return t.spacing=Number(e.spacing)||0,t.colour=e.colour||"#888",t.length=e.length===void 0?1:Number(e.length),t.snap=0t.y&&e.moveBy(0,20-t.y),e.RTL){let i=-20;const r=this.miniWorkspace.getFlyout();r&&(i-=r.getWidth()),t.x>i&&e.moveBy(i-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:i}))}),t}getAnchorLocation(){const e=qa/2;return Ue.sum(this.workspaceLocation,new Ue(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new Bt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,i,r,c;e=(c=(t=this.miniWorkspaceBubble)==null||(i=t.getWorkspace())==null||(r=i.getFlyout())==null?void 0:r.getWidth())!=null?c:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Ja):Ja,Ja)}addSaveConnectionsListener(){if(this.sourceBlock.saveConnections&&this.rootBlock){var e=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)};e(),this.sourceBlock.workspace.addChangeListener(e)}}createMiniWorkspaceChangeListener(){return e=>{s.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||e.type===s.CREATE$$module$build$src$core$events$utils||e.type===s.CHANGE$$module$build$src$core$events$utils&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=s.getGroup$$module$build$src$core$events$utils();e||s.setGroup$$module$build$src$core$events$utils(!0);var t=Sn.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var i=Sn.getExtraBlockState_(this.sourceBlock);t!==i&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,t,i)),s.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}static reconnect(e,t,i){return xe("MutatorIcon.reconnect","v10","v11","connection.reconnect"),e?e.reconnect(t,i):!1}static findParentWs(e){return xe("MutatorIcon.findParentWs","v10","v11","workspace.getRootWorkspace"),e.getRootWorkspace()}},s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Uo.MUTATOR,s.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,s.MutatorIcon$$module$build$src$core$icons$mutator_icon;var Ur=Object.create(null),AS={allExtensions:Ur};s.register$$module$build$src$core$extensions("parent_tooltip_when_inline",Kf);var ps={};ps.TEST_ONLY=AS,ps.apply=ca,ps.buildTooltipForDropdown=s.buildTooltipForDropdown$$module$build$src$core$extensions,ps.buildTooltipWithFieldText=s.buildTooltipWithFieldText$$module$build$src$core$extensions,ps.isRegistered=mh,ps.register=s.register$$module$build$src$core$extensions,ps.registerMixin=s.registerMixin$$module$build$src$core$extensions,ps.registerMutator=s.registerMutator$$module$build$src$core$extensions,ps.runAfterPageLoad=da,ps.unregister=Gf,function(e){e[e.LEFT=-1]="LEFT",e[e.CENTRE=0]="CENTRE",e[e.RIGHT=1]="RIGHT"}(s.Align$$module$build$src$core$inputs$align||(s.Align$$module$build$src$core$inputs$align={})),s.Align$$module$build$src$core$inputs$align;var mT={};mT.removeElem=Po;var ft;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(ft||(ft={}));var fi={};fi.arc=oo,fi.curve=xo,fi.line=_r,fi.lineOnAxis=je,fi.lineTo=Bs,fi.moveBy=jt,fi.moveTo=To,fi.point=tt;var Qt={};Qt.Coordinate=Ue,Qt.KeyCodes=ft,Qt.Rect=Bt,Qt.Size=Vt,Qt.Svg=te,Qt.aria=Ql,Qt.array=mT,Qt.browserEvents=$i,Qt.colour=So,Qt.deprecation=Sr,Qt.dom=co,Qt.extensions=ps,Qt.idGenerator=Ia,Qt.math=Wa,Qt.object=_T,Qt.parsing=Yl,Qt.string=An,Qt.style=_i,Qt.svgMath=Gi,Qt.svgPaths=fi,Qt.toolbox=zi,Qt.userAgent=pi,Qt.xml=In;var t$={};t$.register=bh,t$.unregister=Qf;var o$=class extends $t{constructor(e,t,i,r){super(t,i,r),this.text=e,this.workspace=t,this.anchor=i,this.ownerRect=r,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,U(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createSpans(t,e),this.workspace.RTL&&this.rightAlignSpans(t.getBBox().width,e),t}createParagraph(e){return w(te.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:$t.BORDER_WIDTH},e)}createSpans(e,t){return t.split(` +`).map(i=>{const r=w(te.TSPAN,{dy:"1em",x:$t.BORDER_WIDTH},e);return i=document.createTextNode(i),r.appendChild(i),r})}rightAlignSpans(e,t){for(const i of t)i.setAttribute("text-anchor","end"),i.setAttribute("x",`${e+$t.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Vt(e.width+2*$t.BORDER_WIDTH,e.height+2*$t.BORDER_WIDTH),!0)}},TT=class extends $t{constructor(e,t,i){super(e,t,i),this.workspace=e,this.anchor=t,this.ownerRect=i,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Vt(160+$t.DOUBLE_BORDER,80+$t.DOUBLE_BORDER),this.MIN_SIZE=new Vt(45+$t.DOUBLE_BORDER,20+$t.DOUBLE_BORDER),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=w(te.FOREIGNOBJECT,{x:$t.BORDER_WIDTH,y:$t.BORDER_WIDTH},e);const t=document.createElementNS(ui,"body");t.setAttribute("xmlns",ui),t.className="blocklyMinimalBody";const i=document.createElementNS(ui,"textarea");return i.className="blocklyCommentTextarea",i.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(i),e.appendChild(t),this.bindTextAreaEvents(i),setTimeout(()=>{i.focus()},0),{inputRoot:e,textArea:i}}bindTextAreaEvents(e){Be(e,"wheel",this,t=>{t.stopPropagation()}),Be(e,"focus",this,this.onStartEdit,!0),Be(e,"change",this,this.onTextChange)}createResizeHandle(e){e=w(te.G,{class:this.workspace.RTL?"blocklyResizeSW":"blocklyResizeSE"},e);const t=2*$t.BORDER_WIDTH;return w(te.POLYGON,{points:`0,${t} ${t},${t} ${t},0`},e),w(te.LINE,{class:"blocklyResizeLine",x1:t/3,y1:t-1,x2:t-1,y2:t/3},e),w(te.LINE,{class:"blocklyResizeLine",x1:2*t/3,y1:t-1,x2:t-1,y2:2*t/3},e),Be(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const i=e.width-$t.DOUBLE_BORDER,r=e.height-$t.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${i}`),this.inputRoot.setAttribute("height",`${r}`),this.textArea.style.width=`${i-4}px`,this.textArea.style.height=`${r-4}px`,this.workspace.RTL?this.resizeGroup.setAttribute("transform",`translate(${$t.DOUBLE_BORDER}, ${r}) scale(-1 1)`):this.resizeGroup.setAttribute("transform",`translate(${i}, ${r})`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),Ai(e)||(this.workspace.startDrag(e,new Ue(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=Be(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=Be(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Ge(),this.resizePointerUpListener&&(Dt(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(Dt(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=this.workspace.moveDrag(e),this.setSize(new Vt(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};cs(` +.blocklyCommentTextarea { + background-color: #fef49c; + border: 0; + display: block; + margin: 0; + outline: 0; + padding: 3px; + resize: none; + text-overflow: hidden; +} +`);var s$=17,ET=160,bT=80,Ao=class extends Ka{constructor(e){super(e),this.sourceBlock=e,this.textBubble=this.textInputBubble=null,this.text="",this.bubbleSize=new Vt(ET,bT),this.bubbleVisiblity=!1}getType(){return Ao.TYPE}initView(e){this.svgRoot||(super.initView(e),w(te.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),w(te.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),w(te.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose();let t;(t=this.textBubble)==null||t.dispose()}getWeight(){return Ao.WEIGHT}getSize(){return new Vt(s$,s$)}applyColour(){super.applyColour();const e=this.sourceBlock.style.colourPrimary;let t;(t=this.textInputBubble)==null||t.setColour(e);let i;(i=this.textBubble)==null||i.setColour(e)}updateEditable(){super.updateEditable(),this.bubbleIsVisible()&&(this.setBubbleVisible(!1),this.setBubbleVisible(!0))}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e);let i;(i=this.textBubble)==null||i.setAnchorLocation(e)}setText(e){this.text=e;let t;(t=this.textInputBubble)==null||t.setText(this.text);let i;(i=this.textBubble)==null||i.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let i,r;this.bubbleSize=new Vt((i=e.width)!=null?i:ET,(r=e.height)!=null?r:bT);let c;this.bubbleVisiblity=(c=e.pinned)!=null?c:!1,setTimeout(()=>this.setBubbleVisible(this.bubbleVisiblity),1)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}onTextChange(){this.textInputBubble&&(this.text=this.textInputBubble.getText())}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){(!e||!this.textBubble&&!this.textInputBubble)&&(e||this.textBubble||this.textInputBubble)&&(this.bubbleVisiblity=e,this.sourceBlock.rendered&&!this.sourceBlock.isInFlyout&&(e?(this.sourceBlock.isEditable()?this.showEditableBubble():this.showNonEditableBubble(),this.applyColour()):this.hideBubble(),re(new(we(Fs))(this.sourceBlock,e,"comment"))))}showEditableBubble(){this.textInputBubble=new TT(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new o$(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null;let t;(t=this.textBubble)==null||t.dispose(),this.textBubble=null}getAnchorLocation(){const e=s$/2;return Ue.sum(this.workspaceLocation,new Ue(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new Bt(e.y,e.y+e.height,e.x,e.x+e.width)}};Ao.TYPE=Uo.COMMENT,Ao.WEIGHT=3,bh(Ao.TYPE,Ao);var wn=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.class=null,this.EDITABLE=!1,this.maxDisplayLength=1/0,e!==bt.SKIP_SETUP&&(i?this.configure_(i):this.class=t||null,this.setValue(e))}configure_(e){super.configure_(e),e.class&&(this.class=e.class)}initView(){this.createTextElement_(),this.class&&I(this.getTextElement(),this.class)}doClassValidation_(e){return e==null?null:`${e}`}setClass(e){this.textElement_&&(this.class&&A(this.textElement_,this.class),e&&I(this.textElement_,e)),this.class=e}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_label",wn),wn.prototype.DEFAULT_VALUE="";var mi=class{constructor(e,t){this.name=e,this.sourceBlock=t,this.fieldRow=[],this.align=s.Align$$module$build$src$core$inputs$input.LEFT,this.visible=!0,this.type=s.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM,this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(e,t){return this.insertFieldAt(this.fieldRow.length,e,t),this}insertFieldAt(e,t,i){if(0>e||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&i)&&(typeof t=="string"&&(t=s.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.rendered&&(t.init(),t.applyColour()),t.name=i,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours())),e}removeField(e,t){for(let i=0,r;r=this.fieldRow[i];i++)if(r.name===e)return r.dispose(),this.fieldRow.splice(i,1),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours()),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let r=0,c;c=this.fieldRow[r];r++)c.setVisible(e);if(this.connection){var i=this.connection;e?t=i.startTrackingAll():i.stopTrackingAll(),(i=i.targetBlock())&&(i.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){if(this.sourceBlock.workspace.rendered)for(let e=0;ee.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0)}isDeadOrDying(){return this.disposing||this.disposed}initModel(){for(const e of this.inputList)for(const t of e.fieldRow)t.initModel&&t.initModel()}unplug(e){this.outputConnection&&this.unplugFromRow_(e),this.previousConnection&&this.unplugFromStack_(e)}unplugFromRow_(e){let t=null,i;(i=this.outputConnection)!=null&&i.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection_())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection_(){let e=null;for(let t=0;t(r=r+(i==="("||c===")"?"":" ")+c,i=c[c.length-1],r),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const r of this.inputList)if(r.name!=Nr){for(const c of r.fieldRow)t.push(c.getText());if(r.connection){const c=r.connection.targetBlock();if(c){var i=r.connection;let $=i.getCheck();!$&&i.targetConnection&&($=i.targetConnection.getCheck()),(i=!!$&&($.indexOf("Boolean")!==-1||$.indexOf("Number")!==-1))&&t.push("("),t.push(...c.toTokens(e)),i&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new s.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new Zo(e,this))}appendDummyInput(e=""){return this.appendInput(new zs(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p(Ae.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");e.style?this.jsonInitStyle_(e,t):this.jsonInitColour_(e,t);for(var i=0;e["message"+i]!==void 0;)this.interpolate_(e["message"+i],e["args"+i]||[],e["lastDummyAlign"+i],t),i++;if(e.inputsInline!==void 0&&this.setInputsInline(e.inputsInline),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(i=Zt(e.tooltip),this.setTooltip(i)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(i=Zt(e.helpUrl),this.setHelpUrl(i)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&ca(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;t$||$>t)throw Error('Block "'+this.type+'": Message index %'+$+" out of range.");if(i[$])throw Error('Block "'+this.type+'": Message index %'+$+" duplicated.");i[$]=!0,r++}}if(r!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments_(e,t,i){const r=[];for(let c=0;c=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const i=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-i.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(i=>!i.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Uo?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(e,t,i){if(this.parentBlock_)throw Error("Block has parent");const r=new(we(s.MOVE$$module$build$src$core$events$utils))(this);i&&r.setReason(i),this.xy_.translate(e,t),r.recordNew(),re(r)}makeConnection_(e){return new St(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let i=0,r;r=this.inputList[i];i++)if(r.connection){var t=r.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Hr.COLLAPSED_INPUT_NAME=Nr,Hr.COLLAPSED_FIELD_NAME=Ga;var Za=null,ql=null,Jl={};Jl.connectionUiEffect=Oh,Jl.disconnectUiEffect=Ch,Jl.disconnectUiStop=gr,Jl.disposeUiEffect=vh;var n$=class extends Vs{constructor(e,t,i){super(e?e.workspace.id:void 0),this.type=Tn,e&&(this.blockId=e.id,this.isStart=t,this.blocks=i)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new n$),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};l(Ae.EVENT,Tn,n$);var eu={};eu.bumpIntoBounds=fr,eu.bumpIntoBoundsHandler=Sh,eu.bumpTopObjectsIntoBounds=ha;var Ti=class{constructor(e){this.name_=e}toString(){return this.name_}};Ti.POSITIONABLE=new Ti("positionable"),Ti.DRAG_TARGET=new Ti("drag_target"),Ti.DELETE_AREA=new Ti("delete_area"),Ti.AUTOHIDEABLE=new Ti("autohideable");var fo=class{constructor(){this.componentData=new Map,this.capabilityToComponentIds=new Map}addComponent(e,t){const i=e.component.id;if(!t&&this.componentData.has(i)){var r;throw Error('Plugin "'+i+'" with capabilities "'+((r=this.componentData.get(i))==null?void 0:r.capabilities)+'" already added.')}for(this.componentData.set(i,e),t=[],r=0;r{r.push(this.componentData.get(c))}),r.sort(function(c,$){return c.weight-$.weight}),r.forEach(function(c){i.push(c.component)})}else e.forEach(r=>{i.push(this.componentData.get(r).component)});return i}};fo.Capability=Ti;var r$,IT;r$=28,s.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:r$,connectingSnapRadius:r$,currentConnectionPreference:8,bumpDelay:250},IT={},IT.config=s.config$$module$build$src$core$config;var OT="The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined.",es=class{constructor(e){this.activeCandidate=this.lastMarker=this.lastOnStack=null,this.wouldDeleteBlock=!1,this.fadedBlock=this.highlightedBlock=this.markerConnection=null,Y(e),this.topBlock=e,this.workspace=e.workspace,this.firstMarker=this.createMarkerBlock(this.topBlock),this.availableConnections=this.initAvailableConnections(),this.lastOnStack&&(this.lastMarker=this.createMarkerBlock(this.lastOnStack.getSourceBlock()))}dispose(){this.availableConnections.length=0,this.disposeInsertionMarker(this.firstMarker),this.disposeInsertionMarker(this.lastMarker)}updateAvailableConnections(){this.availableConnections=this.initAvailableConnections()}wouldConnectBlock(){return!!this.activeCandidate}applyConnections(){if(this.activeCandidate){s.disable$$module$build$src$core$events$utils(),this.hidePreview(),s.enable$$module$build$src$core$events$utils();var{local:e,closest:t}=this.activeCandidate;if(e.connect(t),this.topBlock.rendered){const i=e.isSuperior()?t:e,r=this.topBlock.getRootBlock();cr().then(()=>{Oh(i.getSourceBlock()),setTimeout(()=>{r.bringToFront()},0)})}}}update(e,t){const i=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!i,t))||this.shouldUpdatePreviews(i,e))&&(s.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(i),this.maybeShowPreview(i),s.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){var t=e.type;s.disable$$module$build$src$core$events$utils();let i;try{if(i=this.workspace.newBlock(t),i.setInsertionMarker(!0),e.saveExtraState){var r=e.saveExtraState();r&&i.loadExtraState&&i.loadExtraState(r)}else if(e.mutationToDom){const c=e.mutationToDom();c&&i.domToMutation&&i.domToMutation(c)}for(t=0;t{let $;($=r)==null||$.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=c}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),i=t.outputConnection,r;if((r=t.previousConnection)!=null&&r.targetConnection||i!=null&&i.targetConnection)t.unplug(!0);else{let c;(c=e.targetBlock())==null||c.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){s.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{s.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(es||(es={})),es.PREVIEW_TYPE;var CT=class{constructor(e,t){this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.draggingBlock_=e,this.draggedConnectionManager_=new es(this.draggingBlock_),this.workspace_=t,this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=Rh(e,this.startXY_)}dispose(){this.dragIconData_.length=0,this.draggedConnectionManager_&&this.draggedConnectionManager_.dispose()}startDrag(e,t){s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent_(),this.workspace_.isMutator&&this.draggingBlock_.bringToFront(),Ce(),this.workspace_.setResizesEnabled(!1),gr(),this.shouldDisconnect_(t)&&this.disconnectBlock_(t,e),this.draggingBlock_.setDragging(!0)}shouldDisconnect_(e){return!!(this.draggingBlock_.getParent()||e&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())}disconnectBlock_(e,t){this.draggingBlock_.unplug(e),e=this.pixelsToWorkspaceUnits_(t),e=Ue.sum(this.startXY_,e),this.draggingBlock_.translate(e.x,e.y),Ch(this.draggingBlock_),this.draggedConnectionManager_.updateAvailableConnections()}fireDragStartEvent_(){const e=new(we(Tn))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));re(e)}drag(e,t){t=this.pixelsToWorkspaceUnits_(t);var i=Ue.sum(this.startXY_,t);this.draggingBlock_.moveDuringDrag(i),this.dragIcons_(t),i=this.dragTarget_,this.dragTarget_=this.workspace_.getDragTarget(e),this.draggedConnectionManager_.update(t,this.dragTarget_),e=this.wouldDeleteBlock_,this.wouldDeleteBlock_=this.draggedConnectionManager_.wouldDeleteBlock,e!==this.wouldDeleteBlock_&&this.updateCursorDuringBlockDrag_(),this.dragTarget_!==i&&(i&&i.onDragExit(this.draggingBlock_),this.dragTarget_&&this.dragTarget_.onDragEnter(this.draggingBlock_)),this.dragTarget_&&this.dragTarget_.onDragOver(this.draggingBlock_)}endDrag(e,t){this.drag(e,t),this.dragIconData_=[],this.fireDragEndEvent_(),ce(),gr(),e=null,this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_)||(e=this.getNewLocationAfterDrag_(t).delta),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),this.maybeDeleteBlock_()||(this.draggingBlock_.setDragging(!1),e?this.updateBlockAfterMove_():fr(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)),this.workspace_.setResizesEnabled(!0),s.setGroup$$module$build$src$core$events$utils(!1)}getNewLocationAfterDrag_(e){e=this.pixelsToWorkspaceUnits_(e);const t=Ue.sum(this.startXY_,e);return{delta:e,newLocation:t}}maybeDeleteBlock_(){return this.wouldDeleteBlock_?(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),Tr.length=0,!0):!1}updateBlockAfterMove_(){this.fireMoveEvent_(),this.draggedConnectionManager_.wouldConnectBlock()?this.draggedConnectionManager_.applyConnections():this.draggingBlock_.queueRender(),this.draggingBlock_.scheduleSnapAndBump()}fireDragEndEvent_(){const e=new(we(Tn))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));re(e)}updateToolboxStyle_(e){const t=this.workspace_.getToolbox();if(t){const i=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";e&&typeof t.removeStyle=="function"?t.removeStyle(i):e||typeof t.addStyle!="function"||t.addStyle(i)}}fireMoveEvent_(){if(!this.draggingBlock_.isDeadOrDying()){var e=new(we(s.MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);e.setReason(["drag"]),e.oldCoordinate=this.startXY_,e.recordNew(),re(e)}}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(e){return e=new Ue(e.x/this.workspace_.scale,e.y/this.workspace_.scale),this.workspace_.isMutator&&e.scale(1/this.workspace_.options.parentWorkspace.scale),e}dragIcons_(e){for(const t of this.dragIconData_)t.icon.onLocationChange(Ue.sum(t.location,e))}getInsertionMarkers(){return this.draggedConnectionManager_&&this.draggedConnectionManager_.getInsertionMarkers?this.draggedConnectionManager_.getInsertionMarkers():[]}};l(Ae.BLOCK_DRAGGER,li,CT);var Ei=null,l$={duplicateInternal:Zf,copyInternal:Jf},Zl={};Zl.TEST_ONLY=l$,Zl.copy=Nl,Zl.duplicate=pa,Zl.paste=kh;var tu=null,yT={},ou=null,Xs={};Xs.callbackFactory=s.callbackFactory$$module$build$src$core$contextmenu,Xs.commentDeleteOption=Nh,Xs.commentDuplicateOption=wh,Xs.dispose=Lh,Xs.getCurrentBlock=em,Xs.hide=Ml,Xs.setCurrentBlock=Ah,Xs.show=wl,Xs.workspaceCommentOption=nm;var kt=class{constructor(){this.registry_=new Map,this.reset()}reset(){this.registry_.clear()}register(e){if(this.registry_.has(e.id))throw Error('Menu item with ID "'+e.id+'" is already registered.');this.registry_.set(e.id,e)}unregister(e){if(!this.registry_.has(e))throw Error('Menu item with ID "'+e+'" not found.');this.registry_.delete(e)}getItem(e){let t;return(t=this.registry_.get(e))!=null?t:null}getContextMenuOptions(e,t){const i=[];for(const c of this.registry_.values())if(e===c.scopeType){var r=c.preconditionFn(t);r!=="hidden"&&(r={text:typeof c.displayText=="function"?c.displayText(t):c.displayText,enabled:r==="enabled",callback:c.callback,scope:t,weight:c.weight},i.push(r))}return i.sort(function(c,$){return c.weight-$.weight}),i}};(function(e){var t=e.ScopeType||(e.ScopeType={});t.BLOCK="block",t.WORKSPACE="workspace",e.registry=new e})(kt||(kt={})),kt.ScopeType;var ST=30,RT=!0,Mn=[];Mn[qe.INPUT_VALUE]=qe.OUTPUT_VALUE,Mn[qe.OUTPUT_VALUE]=qe.INPUT_VALUE,Mn[qe.NEXT_STATEMENT]=qe.PREVIOUS_STATEMENT,Mn[qe.PREVIOUS_STATEMENT]=qe.NEXT_STATEMENT;var c$="RENAME_VARIABLE_ID",a$="DELETE_VARIABLE_ID",Re=class{constructor(e,t,i){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=Re.isConnectionType(e),this.location=t,this.processParams(i||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;eclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose()))}checkAndDelete(){this.workspace.isFlyout||(s.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),s.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{saveInfo:xs(this,{addCoordinates:!0,addNextBlocks:!1}),source:this.workspace,typeCounts:F(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(i),this.setWarningText(e,i))},100));else if(this.isInFlyout&&(e=null),t=this.getIcon(vs.TYPE),typeof e=="string"){r=this.getSurroundParent();let c=null;for(;r;)r.isCollapsed()&&(c=r),r=r.getSurroundParent();c&&c.setWarningText(s.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,ts.COLLAPSED_WARNING_ID),t?t.addMessage(e,i):this.addIcon(new vs(this).addMessage(e,i))}else t&&(i?t.getText()||this.removeIcon(vs.TYPE):this.removeIcon(vs.TYPE))}setMutator(e){this.removeIcon(s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof vs&&(this.warning=e),e instanceof s.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),this.rendered&&(e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),Ds(),this.bumpNeighbours()),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(vs.TYPE)&&(this.warning=null),e.equals(s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.rendered&&(this.queueRender(),Ds(),this.bumpNeighbours()),t}setEnabled(e){this.isEnabled()!==e&&(super.setEnabled(e),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())}setHighlighted(e){this.rendered&&this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}bringToFront(){let e=this;do{const t=e.getSvgRoot(),i=t.parentNode,r=i.childNodes;r[r.length-1]!==t&&i.appendChild(t),e=e.getParent()}while(e)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setNextStatement(e,t){super.setNextStatement(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setOutput(e,t){super.setOutput(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setInputsInline(e){super.setInputsInline(e),this.rendered&&(this.queueRender(),this.bumpNeighbours())}removeInput(e,t){return e=super.removeInput(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours()),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}appendInput(e){return super.appendInput(e),this.rendered&&(this.queueRender(),this.bumpNeighbours()),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t{const t=s.getGroup$$module$build$src$core$events$utils();s.setGroup$$module$build$src$core$events$utils(e),this.getRootBlock().bumpNeighboursInternal(),s.setGroup$$module$build$src$core$events$utils(t),this.bumpNeighboursPid=0},s.config$$module$build$src$core$config.bumpDelay)}}bumpNeighboursInternal(){const e=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||e.isInFlyout))for(const t of this.getConnections_(!1)){if(t.isSuperior()){let i;(i=t.targetBlock())==null||i.bumpNeighboursInternal()}for(const i of t.neighbours(s.config$$module$build$src$core$config.snapRadius))i.getSourceBlock().getRootBlock()!==e&&(t.isConnected()&&i.isConnected()||(t.isSuperior()?i.bumpAwayFrom(t):t.bumpAwayFrom(i)))}}scheduleSnapAndBump(){const e=s.getGroup$$module$build$src$core$events$utils();setTimeout(()=>{s.setGroup$$module$build$src$core$events$utils(e),this.snapToGrid(),s.setGroup$$module$build$src$core$events$utils(!1)},s.config$$module$build$src$core$config.bumpDelay/2),this.bumpNeighbours()}positionNearConnection(e,t){e.type!==qe.NEXT_STATEMENT&&e.type!==qe.INPUT_VALUE||this.moveBy(t.x-e.x,t.y-e.y)}getChildren(e){return super.getChildren(e)}queueRender(){return Id(this)}render(){this.queueRender(),Ds()}renderEfficiently(){this.rendered=!0,Ce(),this.isCollapsed()&&this.updateCollapsed_(),this.workspace.getRenderer().render(this),this.tightenChildrenEfficiently(),ce(),this.updateMarkers_()}tightenChildrenEfficiently(){for(const e of this.inputList){const t=e.connection;t&&t.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}updateMarkers_(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(zl.LOCAL_MARKER).draw();for(const e of this.inputList)for(const t of e.fieldRow)t.updateMarkers_()}updateConnectionAndIconLocations(){const e=this.getRelativeToSurfaceXY();this.previousConnection&&this.previousConnection.moveToOffset(e),this.outputConnection&&this.outputConnection.moveToOffset(e);for(let t=0;ti||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case qe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case qe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case qe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case qe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return Tr.indexOf(t)===-1}canConnectToPrevious_(e,t){return e.targetConnection||Tr.indexOf(t)!==-1?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};l(Ae.CONNECTION_CHECKER,li,NT);var Vr=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const i=this.calculateIndexForYPos(t);if(i>=this.connections.length)return-1;t=e.y;let r=i;for(;0<=r&&this.connections[r].y===t;){if(this.connections[r]===e)return r;r--}for(r=i;re)i=r;else{t=r;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function i(Qe){const qt=c-r[Qe].x,Ft=$-r[Qe].y;return Math.sqrt(qt*qt+Ft*Ft)<=t&&Oe.push(r[Qe]),Ft"u"?"":t,this.newContents_=typeof i>"u"?"":i)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new T$),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var i=e?this.newContents_:this.oldContents_;if(!i)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setContent(i)}else console.warn("Can't change non-existent comment: "+this.commentId)}};l(Ae.EVENT,yr,T$);var E$=class extends Xi{constructor(e){super(e),this.type=Hi,e&&(this.xml=e.toXmlWithXY())}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return e.xml=Ps(this.xml),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new E$),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t}run(e){Xi.CommentCreateDeleteHelper(this,e)}};l(Ae.EVENT,Hi,E$);var b$=class extends Xi{constructor(e){super(e),this.type=En,e&&(this.xml=e.toXmlWithXY())}run(e){Xi.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return e.xml=Ps(this.xml),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new b$),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t}};l(Ae.EVENT,En,b$);var v$=class extends Xi{constructor(e){super(e),this.type=Us,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new v$),i=e.oldCoordinate.split(","),t.oldCoordinate_=new Ue(Number(i[0]),Number(i[1])),i=e.newCoordinate.split(","),t.newCoordinate_=new Ue(Number(i[0]),Number(i[1])),t}isNull(){return Ue.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");var i=t.getRelativeToSurfaceXY();t.moveBy(e.x-i.x,e.y-i.y)}else console.warn("Can't move non-existent comment: "+this.commentId)}};l(Ae.EVENT,Us,v$);var I$=class extends Vs{constructor(e,t,i,r){let c=e?e.workspace.id:void 0;r&&r.getType()===Re.types.WORKSPACE&&(c=r.getLocation().id),super(c),this.type=vr,this.blockId=e==null?void 0:e.id,this.oldNode=i||void 0,this.newNode=r,this.isCursor=t}toJson(){const e=super.toJson();if(this.isCursor===void 0)throw Error("Whether this is a cursor event or not is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newNode)throw Error("The new node is undefined. Either pass a node to the constructor, or call fromJson");return e.isCursor=this.isCursor,e.blockId=this.blockId,e.oldNode=this.oldNode,e.newNode=this.newNode,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new I$),t.isCursor=e.isCursor,t.blockId=e.blockId,t.oldNode=e.oldNode,t.newNode=e.newNode,t}};l(Ae.EVENT,vr,I$);var O$=class extends Vs{constructor(e,t){super(t),this.type=Cr,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new O$),t.themeName=e.themeName,t}};l(Ae.EVENT,Cr,O$);var C$=class extends Vs{constructor(e,t,i){super(i),this.type=Or,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new C$),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};l(Ae.EVENT,Or,C$);var y$=class extends Vs{constructor(e,t){super(t),this.type=Ir,this.isOpen=e}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new y$),t.isOpen=e.isOpen,t}};l(Ae.EVENT,Ir,y$);var S$=class extends Ul{constructor(e){super(e),this.type=mn,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new S$),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};l(Ae.EVENT,mn,S$);var R$=class extends Ul{constructor(e,t){super(e),this.type=br,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new R$),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};l(Ae.EVENT,br,R$);var k$=class extends Vs{constructor(e,t,i,r,c){super(r),this.type=Ui,this.viewTop=e,this.viewLeft=t,this.scale=i,this.oldScale=c}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new k$),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};l(Ae.EVENT,Ui,k$),s.CHANGE$$module$build$src$core$events$utils,s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,s.CHANGE$$module$build$src$core$events$utils,s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,s.disable$$module$build$src$core$events$utils,s.enable$$module$build$src$core$events$utils,s.getGroup$$module$build$src$core$events$utils,s.setGroup$$module$build$src$core$events$utils;var Ye={};Ye.Abstract=Rr,Ye.BLOCK_CHANGE=s.CHANGE$$module$build$src$core$events$utils,Ye.BLOCK_CREATE=s.CREATE$$module$build$src$core$events$utils,Ye.BLOCK_DELETE=s.DELETE$$module$build$src$core$events$utils,Ye.BLOCK_DRAG=Tn,Ye.BLOCK_FIELD_INTERMEDIATE_CHANGE=Bi,Ye.BLOCK_MOVE=s.MOVE$$module$build$src$core$events$utils,Ye.BUBBLE_OPEN=Fs,Ye.BUMP_EVENTS=ya,Ye.BlockBase=yn,Ye.BlockChange=Sn,Ye.BlockCreate=xp,Ye.BlockDelete=Bp,Ye.BlockDrag=n$,Ye.BlockFieldIntermediateChange=p$,Ye.BlockMove=$$,Ye.BubbleOpen=_$,Ye.BubbleType=g$,Ye.CHANGE=s.CHANGE$$module$build$src$core$events$utils,Ye.CLICK=ai,Ye.COMMENT_CHANGE=yr,Ye.COMMENT_CREATE=Hi,Ye.COMMENT_DELETE=En,Ye.COMMENT_MOVE=Us,Ye.CREATE=s.CREATE$$module$build$src$core$events$utils,Ye.Click=f$,Ye.ClickTarget=m$,Ye.CommentBase=Xi,Ye.CommentChange=T$,Ye.CommentCreate=E$,Ye.CommentDelete=b$,Ye.CommentMove=v$,Ye.DELETE=s.DELETE$$module$build$src$core$events$utils,Ye.FINISHED_LOADING=bn,Ye.FinishedLoading=iT,Ye.MARKER_MOVE=vr,Ye.MOVE=s.MOVE$$module$build$src$core$events$utils,Ye.MarkerMove=I$,Ye.SELECTED=ci,Ye.Selected=yp,Ye.THEME_CHANGE=Cr,Ye.TOOLBOX_ITEM_SELECT=Or,Ye.TRASHCAN_OPEN=Ir,Ye.ThemeChange=O$,Ye.ToolboxItemSelect=C$,Ye.TrashcanOpen=y$,Ye.UI=Ca,Ye.UiBase=Vs,Ye.VAR_CREATE=Fi,Ye.VAR_DELETE=mn,Ye.VAR_RENAME=br,Ye.VIEWPORT_CHANGE=Ui,Ye.VarBase=Ul,Ye.VarCreate=Ip,Ye.VarDelete=S$,Ye.VarRename=R$,Ye.ViewportChange=k$,Ye.clearPendingUndo=ae,Ye.disable=s.disable$$module$build$src$core$events$utils,Ye.disableOrphans=We,Ye.enable=s.enable$$module$build$src$core$events$utils,Ye.filter=B,Ye.fire=re,Ye.fromJson=Je,Ye.get=we,Ye.getDescendantIds=Xe,Ye.getGroup=s.getGroup$$module$build$src$core$events$utils,Ye.getRecordUndo=ke,Ye.isEnabled=_e,Ye.setGroup=s.setGroup$$module$build$src$core$events$utils,Ye.setRecordUndo=fe;var oc=class{constructor(){this.NO_PADDING=0,this.SMALL_PADDING=3,this.MEDIUM_PADDING=5,this.MEDIUM_LARGE_PADDING=8,this.LARGE_PADDING=10,this.TAB_HEIGHT=15,this.TAB_OFFSET_FROM_TOP=5,this.TAB_VERTICAL_OVERLAP=2.5,this.TAB_WIDTH=8,this.NOTCH_WIDTH=15,this.NOTCH_HEIGHT=4,this.MIN_BLOCK_WIDTH=12,this.EMPTY_BLOCK_SPACER_HEIGHT=16,this.CORNER_RADIUS=8,this.NOTCH_OFFSET_LEFT=15,this.STATEMENT_BOTTOM_SPACER=0,this.STATEMENT_INPUT_PADDING_LEFT=20,this.BETWEEN_STATEMENT_PADDING_Y=4,this.ADD_START_HATS=!1,this.START_HAT_HEIGHT=15,this.START_HAT_WIDTH=100,this.SPACER_DEFAULT_HEIGHT=15,this.MIN_BLOCK_HEIGHT=24,this.EMPTY_INLINE_INPUT_PADDING=14.5,this.EXTERNAL_VALUE_INPUT_PADDING=2,this.JAGGED_TEETH_HEIGHT=12,this.JAGGED_TEETH_WIDTH=6,this.FIELD_TEXT_FONTSIZE=11,this.FIELD_TEXT_FONTWEIGHT="normal",this.FIELD_TEXT_FONTFAMILY="sans-serif",this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=-1,this.FIELD_BORDER_RECT_RADIUS=4,this.FIELD_BORDER_RECT_HEIGHT=16,this.FIELD_BORDER_RECT_X_PADDING=5,this.FIELD_BORDER_RECT_Y_PADDING=3,this.FIELD_BORDER_RECT_COLOUR="#fff",this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1,this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12,this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1,this.FIELD_COLOUR_DEFAULT_WIDTH=26,this.defs=null,this.embossFilterId="",this.embossFilter=null,this.disabledPatternId="",this.disabledPattern=null,this.debugFilterId="",this.cssNode=this.debugFilter=null,this.CURSOR_COLOUR="#cc0a0a",this.MARKER_COLOUR="#4286f4",this.CURSOR_WS_WIDTH=100,this.WS_CURSOR_HEIGHT=5,this.CURSOR_STACK_PADDING=10,this.CURSOR_BLOCK_PADDING=2,this.CURSOR_STROKE_WIDTH=4,this.FULL_BLOCK_FIELDS=!1,this.INSERTION_MARKER_COLOUR="#000000",this.INSERTION_MARKER_OPACITY=.2,this.SHAPES={PUZZLE:1,NOTCH:2},this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=this.TAB_HEIGHT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT,this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11,this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT,this.START_POINT=jt(0,0),this.FIELD_TEXT_BASELINE_CENTER=!0,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3,this.randomIdentifier=String(Math.random()).substring(2)}init(){this.JAGGED_TEETH=this.makeJaggedTeeth(),this.NOTCH=this.makeNotch(),this.START_HAT=this.makeStartHat(),this.PUZZLE_TAB=this.makePuzzleTab(),this.INSIDE_CORNERS=this.makeInsideCorners(),this.OUTSIDE_CORNERS=this.makeOutsideCorners()}setTheme(e){this.blockStyles=Object.create(null);const t=e.blockStyles;for(const i in t)this.blockStyles[i]=this.validatedBlockStyle_(t[i]);this.setDynamicProperties_(e)}setDynamicProperties_(e){this.setFontConstants_(e),this.setComponentConstants_(e),this.ADD_START_HATS=e.startHats!==void 0?e.startHats:this.ADD_START_HATS}setFontConstants_(e){e.fontStyle&&e.fontStyle.family&&(this.FIELD_TEXT_FONTFAMILY=e.fontStyle.family),e.fontStyle&&e.fontStyle.weight&&(this.FIELD_TEXT_FONTWEIGHT=e.fontStyle.weight),e.fontStyle&&e.fontStyle.size&&(this.FIELD_TEXT_FONTSIZE=e.fontStyle.size),e=be("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY),this.FIELD_TEXT_HEIGHT=e.height,this.FIELD_TEXT_BASELINE=e.baseline}setComponentConstants_(e){this.CURSOR_COLOUR=e.getComponentStyle("cursorColour")||this.CURSOR_COLOUR,this.MARKER_COLOUR=e.getComponentStyle("markerColour")||this.MARKER_COLOUR,this.INSERTION_MARKER_COLOUR=e.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR,this.INSERTION_MARKER_OPACITY=Number(e.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY}getBlockStyleForColour(e){const t="auto_"+e;return this.blockStyles[t]||(this.blockStyles[t]=this.createBlockStyle_(e)),{style:this.blockStyles[t],name:t}}getBlockStyle(e){return this.blockStyles[e||""]||(e&&e.indexOf("auto_")===0?this.getBlockStyleForColour(e.substring(5)).style:this.createBlockStyle_("#000000"))}createBlockStyle_(e){return this.validatedBlockStyle_({colourPrimary:e})}validatedBlockStyle_(e){const t={};return e&&Object.assign(t,e),e=$r(t.colourPrimary||"#000"),t.colourPrimary=e.hex,t.colourSecondary=t.colourSecondary?$r(t.colourSecondary).hex:this.generateSecondaryColour_(t.colourPrimary),t.colourTertiary=t.colourTertiary?$r(t.colourTertiary).hex:this.generateTertiaryColour_(t.colourPrimary),t.hat=t.hat||"",t}generateSecondaryColour_(e){return gn("#fff",e,.6)||e}generateTertiaryColour_(e){return gn("#fff",e,.3)||e}dispose(){this.embossFilter&&U(this.embossFilter),this.disabledPattern&&U(this.disabledPattern),this.debugFilter&&U(this.debugFilter),this.cssNode=null}makeJaggedTeeth(){const e=this.JAGGED_TEETH_HEIGHT,t=this.JAGGED_TEETH_WIDTH,i=_r([tt(t,e/4),tt(2*-t,e/2),tt(t,e/4)]);return{height:e,width:t,path:i}}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,i=xo("c",[tt(30,-e),tt(70,-e),tt(t,0)]);return{height:e,width:t,path:i}}makePuzzleTab(){function e($){$=$?-1:1;const v=-$;var H=i/2;const Oe=H+2.5,Qe=H+.5,qt=tt(-t,$*H);return H=tt(t,$*H),xo("c",[tt(0,$*Oe),tt(-t,v*Qe),qt])+xo("s",[tt(t,2.5*v),H])}const t=this.TAB_WIDTH,i=this.TAB_HEIGHT,r=e(!0),c=e(!1);return{type:this.SHAPES.PUZZLE,width:t,height:i,pathDown:c,pathUp:r}}makeNotch(){function e(v){return _r([tt(v*r,i),tt(3*v,0),tt(v*r,-i)])}const t=this.NOTCH_WIDTH,i=this.NOTCH_HEIGHT,r=(t-3)/2,c=e(1),$=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:i,pathLeft:c,pathRight:$}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=oo("a","0 0,0",e,tt(-e,e)),i=oo("a","0 0,0",e,tt(e,e));return{width:e,height:e,pathTop:t,pathBottom:i}}makeOutsideCorners(){const e=this.CORNER_RADIUS,t=jt(0,e)+oo("a","0 0,1",e,tt(e,-e)),i=oo("a","0 0,1",e,tt(e,e)),r=oo("a","0 0,1",e,tt(-e,-e)),c=oo("a","0 0,1",e,tt(-e,e));return{topLeft:t,topRight:i,bottomRight:c,bottomLeft:r,rightHeight:e}}shapeFor(e){switch(e.type){case qe.INPUT_VALUE:case qe.OUTPUT_VALUE:return this.PUZZLE_TAB;case qe.PREVIOUS_STATEMENT:case qe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type")}}createDom(e,t,i){this.injectCSS_(t,i),this.defs=w(te.DEFS,{},e),e=w(te.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs),w(te.FEGAUSSIANBLUR,{in:"SourceAlpha",stdDeviation:1,result:"blur"},e),t=w(te.FESPECULARLIGHTING,{in:"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},e),w(te.FEPOINTLIGHT,{x:-5e3,y:-1e4,z:2e4},t),w(te.FECOMPOSITE,{in:"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},e),w(te.FECOMPOSITE,{in:"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},e),this.embossFilterId=e.id,this.embossFilter=e,e=w(te.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs),w(te.RECT,{width:10,height:10,fill:"#aaa"},e),w(te.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},e),this.disabledPatternId=e.id,this.disabledPattern=e,this.createDebugFilter()}createDebugFilter(){if(!this.debugFilter){const e=w(te.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),t=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},e);w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),w(te.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},e),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),this.debugFilterId=e.id,this.debugFilter=e}}injectCSS_(e,t){t=this.getCSS_(t),e="blockly-renderer-style-"+e,this.cssNode=document.getElementById(e);const i=t.join(` +`);this.cssNode?this.cssNode.firstChild.textContent=i:(t=document.createElement("style"),t.id=e,e=document.createTextNode(i),t.appendChild(e),document.head.insertBefore(t,document.head.firstChild),this.cssNode=t)}getCSS_(e){return[`${e} .blocklyText, `,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},wT=class extends oc{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=2*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=4*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&U(this.selectedGlowFilter),this.replacementGlowFilter&&U(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,i=xo("c",[tt(25,-e),tt(71,-e),tt(t,0)]);return{height:e,width:t,path:i}}makeHexagonal(){function e(i,r,c){var $=i/2;return $=$>t?t:$,c=c?-1:1,i=(r?-1:1)*i/2,Bs(-c*$,i)+Bs(c*$,i)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(i){return i/=2,i>t?t:i},height(i){return i},connectionOffsetY(i){return i/2},connectionOffsetX(i){return-i},pathDown(i){return e(i,!1,!1)},pathUp(i){return e(i,!0,!1)},pathRightDown(i){return e(i,!1,!0)},pathRightUp(i){return e(i,!1,!0)}}}makeRounded(){function e(r,c,$){const v=r>i?r-i:0;return r=(r>i?i:r)/2,oo("a","0 0,1",r,tt((c?-1:1)*r,(c?-1:1)*r))+je("v",($?1:-1)*v)+oo("a","0 0,1",r,tt((c?1:-1)*r,(c?-1:1)*r))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,i=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(r){return r/=2,r>t?t:r},height(r){return r},connectionOffsetY(r){return r/2},connectionOffsetX(r){return-r},pathDown(r){return e(r,!1,!1)},pathUp(r){return e(r,!0,!1)},pathRightDown(r){return e(r,!1,!0)},pathRightUp(r){return e(r,!1,!0)}}}makeSquared(){function e(i,r,c){return i-=2*t,oo("a","0 0,1",t,tt((r?-1:1)*t,(r?-1:1)*t))+je("v",(c?1:-1)*i)+oo("a","0 0,1",t,tt((r?1:-1)*t,(r?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(i){return t},height(i){return i},connectionOffsetY(i){return i/2},connectionOffsetX(i){return-i},pathDown(i){return e(i,!1,!1)},pathUp(i){return e(i,!0,!1)},pathRightDown(i){return e(i,!1,!0)},pathRightUp(i){return e(i,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case qe.INPUT_VALUE:case qe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.indexOf("Boolean")!==-1?this.HEXAGONAL:t&&t.indexOf("Number")!==-1?this.ROUNDED:(t&&t.indexOf("String"),this.ROUNDED);case qe.PREVIOUS_STATEMENT:case qe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Qe){return xo("c",[tt(Qe*c/2,0),tt(Qe*c*3/4,v/2),tt(Qe*c,v)])+_r([tt(Qe*c,$)])+xo("c",[tt(Qe*c/4,v/2),tt(Qe*c/2,v),tt(Qe*c,v)])+je("h",Qe*r)+xo("c",[tt(Qe*c/2,0),tt(Qe*c*3/4,-(v/2)),tt(Qe*c,-v)])+_r([tt(Qe*c,-$)])+xo("c",[tt(Qe*c/4,-(v/2)),tt(Qe*c/2,-v),tt(Qe*c,-v)])}const t=this.NOTCH_WIDTH,i=this.NOTCH_HEIGHT,r=t/3,c=r/3,$=i/2,v=$/2,H=e(1),Oe=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:i,pathLeft:H,pathRight:Oe}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=oo("a","0 0,0",e,tt(-e,e)),i=oo("a","0 0,1",e,tt(-e,e)),r=oo("a","0 0,0",e,tt(e,e)),c=oo("a","0 0,1",e,tt(e,e));return{width:e,height:e,pathTop:t,pathBottom:r,rightWidth:e,rightHeight:e,pathTopRight:i,pathBottomRight:c}}generateSecondaryColour_(e){return gn("#000",e,.15)||e}generateTertiaryColour_(e){return gn("#000",e,.25)||e}createDom(e,t,i){super.createDom(e,t,i),e=w(te.DEFS,{},e),t=w(te.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),w(te.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),i=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},t),w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},i),w(te.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=w(te.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),w(te.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},e),w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),w(te.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),w(te.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .goog-menuitem,`,`${e}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},LS=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(e){return Object.prototype.hasOwnProperty.call(this,e)||(this[e]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[e]}isField(e){return e.type&this.FIELD}isHat(e){return e.type&this.HAT}isIcon(e){return e.type&this.ICON}isSpacer(e){return e.type&this.SPACER}isInRowSpacer(e){return e.type&this.IN_ROW_SPACER}isInput(e){return e.type&this.INPUT}isExternalInput(e){return e.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(e){return e.type&this.INLINE_INPUT}isStatementInput(e){return e.type&this.STATEMENT_INPUT}isPreviousConnection(e){return e.type&this.PREVIOUS_CONNECTION}isNextConnection(e){return e.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(e){return e.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(e){return e.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(e){return e.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(e){return e.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(e){return e.type&this.RIGHT_SQUARE_CORNER}isCorner(e){return e.type&this.CORNER}isJaggedEdge(e){return e.type&this.JAGGED_EDGE}isRow(e){return e.type&this.ROW}isBetweenRowSpacer(e){return e.type&this.BETWEEN_ROW_SPACER}isTopRow(e){return e.type&this.TOP_ROW}isBottomRow(e){return e.type&this.BOTTOM_ROW}isTopOrBottomRow(e){return e.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(e){return e.type&this.INPUT_ROW}},q=new LS,js=class{constructor(e){this.centerline=this.xPos=this.height=this.width=0,this.constants_=e,this.type=q.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},Dn=class extends js{constructor(e,t){super(e),this.connectionModel=t,this.shape=this.constants_.shapeFor(t),this.isDynamicShape="isDynamic"in this.shape&&this.shape.isDynamic,this.type|=q.CONNECTION}},sc=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.block_.pathObject.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}hideHiddenIcons_(){xe("hideHiddenIcons_","v10","v11")}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let e=1;e=e.height)){if(q.isSpacer(e)){const r=e.precedesStatement;var t=e.followsStatement;if(r||t){const c=this.constants_.INSIDE_CORNERS;var i=c.rightHeight;i=e.height-(r?i:0),t=t?c.pathBottomRight:"",e=0=i||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Vt(t,i+Pn.Y_PADDING),this.imageHeight=i,typeof c=="function"&&(this.clickHandler=c),e!==bt.SKIP_SETUP&&(v?this.configure_(v):(this.flipRtl=!!$,this.altText=Zt(r)||""),this.setValue(Zt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=Zt(e.alt))}initView(){this.imageElement=w(te.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(us,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(us,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Pn.Y_PADDING=1,Jo("field_image",Pn),Pn.prototype.DEFAULT_VALUE="";var ic=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){const e=this.getSourceBlock();if(!e)throw new io;if(this.getConstants().FULL_BLOCK_FIELDS){let t=0,i=0;for(let r=0,c;c=e.inputList[r];r++){for(let $=0;c.fieldRow[$];$++)t++;c.connection&&i++}this.fullBlockClickTarget_=1>=t&&e.outputConnection&&!i}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_(),this.createTextElement_()}doValueInvalid_(e){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&_e()&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){if(this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS){var e=this.sourceBlock_;this.borderRect_?this.borderRect_.setAttribute("stroke",e.style.colourTertiary):e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)}}render_(){if(super.render_(),this.isBeingEdited_){this.resizeEditor_();const e=this.htmlInput_;this.isTextValid_?(A(e,"blocklyInvalidInput"),Xt(e,Gt.INVALID,!1)):(I(e,"blocklyInvalidInput"),Xt(e,Gt.INVALID,!0))}}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Lp||xa||kr)?this.showPromptEditor_():this.showInlineEditor_(t)}showPromptEditor_(){g(s.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e))})}showInlineEditor_(e){const t=this.getSourceBlock();if(!t)throw new io;oa(this,t.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new io;s.setGroup$$module$build$src$core$events$utils(!0);const t=fn();var i=this.getClickTarget_();if(!i)throw Error("A click target has not been set.");I(i,"editing"),i=document.createElement("input"),i.className="blocklyHtmlInput",i.setAttribute("spellcheck",this.spellcheck_);const r=this.workspace_.getScale();var c=this.getConstants().FIELD_TEXT_FONTSIZE*r+"pt";return t.style.fontSize=c,i.style.fontSize=c,c=ic.BORDERRADIUS*r+"px",this.fullBlockClickTarget_&&(c=this.getScaledBBox(),c=(c.bottom-c.top)/2+"px",e=e.getParent()?e.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,i.style.border=1*r+"px solid "+e,t.style.borderRadius=c,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*r+"px")),i.style.borderRadius=c,t.appendChild(i),i.value=i.defaultValue=this.getEditorText_(this.value_),i.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(i),i}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&_e()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),s.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=fn().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");A(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper_=Be(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Be(e,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(Dt(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Dt(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(as(),fs()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value")),as(),fs()):e.key==="Tab"&&(as(),fs(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange_(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&_e()&&this.value_!==e&&re(new(we(Bi))(this.sourceBlock_,this.name||null,e,this.value_)),cr().then(()=>{this.resizeEditor_()})}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){var e=this.getSourceBlock();if(!e)throw new io;const t=fn(),i=this.getScaledBBox();t.style.width=i.right-i.left+"px",t.style.height=i.bottom-i.top+"px",e=new Ue(e.RTL?i.right-t.offsetWidth:i.left,i.top),t.style.left=e.x+"px",t.style.top=e.y+"px"}repositionForWindowResize(){const e=this.getSourceBlock();return e instanceof ts?(fr(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),e),this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};ic.BORDERRADIUS=4;var Gr=class extends ic{constructor(e,t,i){super(e,t,i)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_input",Gr),Gr.prototype.DEFAULT_VALUE="";var nc=class{constructor(e){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=e,this.type=q.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let e=this.elements.length-1;0<=e;e--){const t=this.elements[e];if(q.isInput(t))return t}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let e=0;e=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!r.precedesStatement,q.isInputRow($)&&$.hasStatement){$.measure();let v,H;t=$.width-((H=(v=$.getLastInput())==null?void 0:v.width)!=null?H:0)+e}else if(i&&(c===2||r)&&q.isInputRow($)&&!$.hasStatement){r=$.xPos,i=null;for(let v=0;v<$.elements.length;v++){const H=$.elements[v];q.isSpacer(H)&&(i=H),i&&(q.isField(H)||q.isInput(H))&&ri?i:this.height/2,t-i*(1-Math.sin(Math.acos((i-this.constants_.SMALL_PADDING)/i)));default:return 0}if(q.isInlineInput(e)&&e instanceof ji){const c=e.connectedBlock;return e=c?c.pathObject.outputShapeType:e.shape.type,e==null||c&&c.outputConnection&&(c.statementInputCount||c.nextConnection)||i===r.SHAPES.HEXAGONAL&&i!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[i][e]}return q.isField(e)&&e instanceof Wr?i===r.SHAPES.ROUND&&e.field instanceof Gr?t-2.75*r.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[i][0]:q.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let r=2;r=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!v.precedesStatement;if(e?this.topRow.hasPreviousConnection:c.followsStatement){var i=$.elements[1];if(i=$.elements.length===3&&i instanceof Wr&&(i.field instanceof wn||i.field instanceof Pn),!e&&i)c.height-=this.constants_.SMALL_PADDING,v.height-=this.constants_.SMALL_PADDING,$.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)c.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t<$.elements.length;t++)if(i=$.elements[t],i instanceof ji&&q.isInlineInput(i)&&i.connectedBlock&&!i.connectedBlock.isShadow()&&40<=i.connectedBlock.getHeightWidth().height){e=!0;break}e&&(c.height-=this.constants_.SMALL_PADDING,v.height-=this.constants_.SMALL_PADDING)}}}}finalize_(){this.finalizeOutputConnection_(),this.finalizeHorizontalAlignment_(),this.finalizeVerticalAlignment_(),super.finalize_(),this.rightSide&&(this.widthWithChildren+=this.rightSide.width)}},NS="blocklyCursor",wS="blocklyMarker",MS=.75,P$=class{constructor(e,t,i){this.workspace=e,this.marker=i,this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=this.currentMarkerSvg=this.parent=null,this.constants_=t,e=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR,this.colour_=i.colour||e}getSvgRoot(){return this.svgGroup_}getMarker(){return this.marker}isCursor(){return this.marker.type==="cursor"}createDom(){const e=this.isCursor()?NS:wS;return this.svgGroup_=w(te.G,{class:e}),this.createDomInternal_(),this.svgGroup_}setParent_(e){this.isCursor()?(this.parent&&this.parent.setCursorSvg(null),e.setCursorSvg(this.getSvgRoot())):(this.parent&&this.parent.setMarkerSvg(null),e.setMarkerSvg(this.getSvgRoot())),this.parent=e}draw(e,t){if(t){this.constants_=this.workspace.getRenderer().getConstants();var i=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker.colour||i,this.applyColour_(t),this.showAtLocation_(t),this.fireMarkerEvent(e,t),e=this.currentMarkerSvg.childNodes[0],e!==void 0&&e.beginElement&&e.beginElement()}else this.hide()}showAtLocation_(e){const t=e.getLocation().type;e.getType()===Re.types.BLOCK?this.showWithBlock_(e):e.getType()===Re.types.OUTPUT?this.showWithOutput_(e):t===qe.INPUT_VALUE?this.showWithInput_(e):t===qe.NEXT_STATEMENT?this.showWithNext_(e):e.getType()===Re.types.PREVIOUS?this.showWithPrevious_(e):e.getType()===Re.types.FIELD?this.showWithField_(e):e.getType()===Re.types.WORKSPACE?this.showWithCoordinates_(e):e.getType()===Re.types.STACK&&this.showWithStack_(e)}showWithBlockPrevOutput(e){e=e.getSourceBlock();const t=e.width;var i=e.height,r=i*MS;const c=this.constants_.CURSOR_BLOCK_PADDING;e.previousConnection?(i=this.constants_.shapeFor(e.previousConnection),this.positionPrevious_(t,c,r,i)):e.outputConnection?(r=this.constants_.shapeFor(e.outputConnection),this.positionOutput_(t,i,r)):this.positionBlock_(t,c,r),this.setParent_(e),this.showCurrent_()}showWithBlock_(e){this.showWithBlockPrevOutput(e)}showWithPrevious_(e){this.showWithBlockPrevOutput(e)}showWithOutput_(e){this.showWithBlockPrevOutput(e)}showWithCoordinates_(e){var t=e.getWsCoordinate();e=t.x,t=t.y,this.workspace.RTL&&(e-=this.constants_.CURSOR_WS_WIDTH),this.positionLine_(e,t,this.constants_.CURSOR_WS_WIDTH),this.setParent_(this.workspace),this.showCurrent_()}showWithField_(e){e=e.getLocation();const t=e.getSize().width,i=e.getSize().height;this.positionRect_(0,0,t,i),this.setParent_(e),this.showCurrent_()}showWithInput_(e){e=e.getLocation();const t=e.getSourceBlock();this.positionInput_(e),this.setParent_(t),this.showCurrent_()}showWithNext_(e){var t=e.getLocation();e=t.getSourceBlock();let i=0;t=t.getOffsetInBlock().y;const r=e.getHeightWidth().width;this.workspace.RTL&&(i=-r),this.positionLine_(i,t,r),this.setParent_(e),this.showCurrent_()}showWithStack_(e){e=e.getLocation();var t=e.getHeightWidth();const i=t.width+this.constants_.CURSOR_STACK_PADDING;t=t.height+this.constants_.CURSOR_STACK_PADDING;const r=-this.constants_.CURSOR_STACK_PADDING/2,c=-this.constants_.CURSOR_STACK_PADDING/2;let $=r;this.workspace.RTL&&($=-(i+r)),this.positionRect_($,c,i,t),this.setParent_(e),this.showCurrent_()}showCurrent_(){this.hide(),this.currentMarkerSvg&&(this.currentMarkerSvg.style.display="")}positionBlock_(e,t,i){if(e=jt(-t,i)+je("V",-t)+je("H",e+2*t)+je("V",i),!this.markerBlock_)throw Error("createDom should be called before positioning the marker");this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionInput_(e){const t=e.getOffsetInBlock().x,i=e.getOffsetInBlock().y;e=To(0,0)+this.constants_.shapeFor(e).pathDown,this.markerInput_.setAttribute("d",e),this.markerInput_.setAttribute("transform","translate("+t+","+i+")"+(this.workspace.RTL?" scale(-1 1)":"")),this.currentMarkerSvg=this.markerInput_}positionLine_(e,t,i){if(!this.markerSvgLine_)throw Error("createDom should be called before positioning the line");this.markerSvgLine_.setAttribute("x",`${e}`),this.markerSvgLine_.setAttribute("y",`${t}`),this.markerSvgLine_.setAttribute("width",`${i}`),this.currentMarkerSvg=this.markerSvgLine_}positionOutput_(e,t,i){if(!this.markerBlock_)throw Error("createDom should be called before positioning the output");e=jt(e,0)+je("h",-(e-i.width))+je("v",this.constants_.TAB_OFFSET_FROM_TOP)+i.pathDown+je("V",t)+je("H",e),this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionPrevious_(e,t,i,r){if(!this.markerBlock_)throw Error("createDom should be called before positioning the previous connection marker");e=jt(-t,i)+je("V",-t)+je("H",this.constants_.NOTCH_OFFSET_LEFT)+r.pathLeft+je("H",e+2*t)+je("V",i),this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionRect_(e,t,i,r){if(!this.markerSvgRect_)throw Error("createDom should be called before positioning the rect");this.markerSvgRect_.setAttribute("x",`${e}`),this.markerSvgRect_.setAttribute("y",`${t}`),this.markerSvgRect_.setAttribute("width",`${i}`),this.markerSvgRect_.setAttribute("height",`${r}`),this.currentMarkerSvg=this.markerSvgRect_}flipRtl(e){e.setAttribute("transform","scale(-1 1)")}hide(){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before hiding the marker");this.markerSvgLine_.style.display="none",this.markerSvgRect_.style.display="none",this.markerInput_.style.display="none",this.markerBlock_.style.display="none"}fireMarkerEvent(e,t){const i=t.getSourceBlock();e=new(we(vr))(i,this.isCursor(),e,t),re(e)}getBlinkProperties_(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}createDomInternal_(){if(this.markerSvg_=w(te.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_),this.markerSvgLine_=w(te.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},this.markerSvg_),this.markerSvgRect_=w(te.RECT,{class:"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.markerSvg_),this.markerInput_=w(te.PATH,{transform:"",style:"display: none"},this.markerSvg_),this.markerBlock_=w(te.PATH,{transform:"",style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){const e=this.getBlinkProperties_();w(te.ANIMATE,e,this.markerSvgLine_),w(te.ANIMATE,e,this.markerInput_),w(te.ANIMATE,Object.assign({},e,{attributeName:"stroke"}),this.markerBlock_)}return this.markerSvg_}applyColour_(e){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before applying color to the markerj");this.markerSvgLine_.setAttribute("fill",this.colour_),this.markerSvgRect_.setAttribute("stroke",this.colour_),this.markerInput_.setAttribute("fill",this.colour_),this.markerBlock_.setAttribute("stroke",this.colour_),this.isCursor()&&(e=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstElementChild.setAttribute("values",e),this.markerInput_.firstElementChild.setAttribute("values",e),this.markerBlock_.firstElementChild.setAttribute("values",e))}dispose(){this.svgGroup_&&U(this.svgGroup_)}},WT=class extends P${constructor(e,t,i){super(e,t,i),this.markerCircle=null}showWithInputOutput(e){const t=e.getSourceBlock();e=e.getLocation().getOffsetInBlock(),this.positionCircle(e.x,e.y),this.setParent_(t),this.showCurrent_()}showWithOutput_(e){this.showWithInputOutput(e)}showWithInput_(e){this.showWithInputOutput(e)}showWithBlock_(e){e=e.getLocation();const t=e.getHeightWidth();this.positionRect_(0,0,t.width,t.height),this.setParent_(e),this.showCurrent_()}positionCircle(e,t){let i;(i=this.markerCircle)==null||i.setAttribute("cx",`${e}`);let r;(r=this.markerCircle)==null||r.setAttribute("cy",`${t}`),this.currentMarkerSvg=this.markerCircle}hide(){super.hide(),this.markerCircle&&(this.markerCircle.style.display="none")}createDomInternal_(){if(super.createDomInternal_(),this.markerCircle=w(te.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){const e=this.getBlinkProperties_();w(te.ANIMATE,e,this.markerCircle)}return this.markerSvg_}applyColour_(e){super.applyColour_(e);let t;(t=this.markerCircle)==null||t.setAttribute("fill",this.colour_);let i;if((i=this.markerCircle)==null||i.setAttribute("stroke",this.colour_),this.isCursor()){e=this.colour_+";transparent;transparent;";let r;(r=this.markerCircle)==null||r.firstElementChild.setAttribute("values",e)}}},nu=class{constructor(e,t,i){this.markerSvg=this.cursorSvg=null,this.constants=i,this.style=t,this.svgRoot=e,this.svgPath=w(te.PATH,{class:"blocklyPath"},this.svgRoot)}setPath(e){this.svgPath.setAttribute("d",e)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)")}setCursorSvg(e){e?(this.svgRoot.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?(this.cursorSvg?this.svgRoot.insertBefore(e,this.cursorSvg):this.svgRoot.appendChild(e),this.markerSvg=e):this.markerSvg=null}applyColour(e){this.svgPath.setAttribute("stroke",this.style.colourTertiary),this.svgPath.setAttribute("fill",this.style.colourPrimary),this.updateShadow_(e.isShadow()),this.updateDisabled_(!e.isEnabled()||e.getInheritedDisabled())}setStyle(e){this.style=e}setClass_(e,t){e&&(t?I(this.svgRoot,e):A(this.svgRoot,e))}updateHighlighted(e){e?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")}updateShadow_(e){e&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))}updateDisabled_(e){this.setClass_("blocklyDisabled",e),e&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")}updateSelected(e){this.setClass_("blocklySelected",e)}updateDraggingDelete(e){this.setClass_("blocklyDraggingDelete",e)}updateInsertionMarker(e){this.setClass_("blocklyInsertionMarker",e)}updateMovable(e){this.setClass_("blocklyDraggable",e)}updateReplacementFade(e){this.setClass_("blocklyReplaceable",e)}updateShapeForInputHighlight(e,t){}},zT=class extends nu{constructor(e,t,i){super(e,t,i),this.svgPathSelected=null,this.outlines=new Map,this.remainingOutlines=new Set,this.outputShapeType=null,this.constants=i}setPath(e){super.setPath(e),this.svgPathSelected&&this.svgPathSelected.setAttribute("d",e)}applyColour(e){super.applyColour(e);const t=e.getParent();e.isShadow()&&t&&this.svgPath.setAttribute("stroke",t.style.colourTertiary);for(const i of this.outlines.values())i.setAttribute("fill",this.style.colourTertiary)}flipRTL(){super.flipRTL();for(const e of this.outlines.values())e.setAttribute("transform","scale(-1 1)")}updateSelected(e){this.setClass_("blocklySelected",e),e?this.svgPathSelected||(this.svgPathSelected=this.svgPath.cloneNode(!0),this.svgPathSelected.setAttribute("fill","none"),this.svgPathSelected.setAttribute("filter","url(#"+this.constants.selectedGlowFilterId+")"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}updateReplacementFade(e){this.setClass_("blocklyReplaceable",e),e?this.svgPath.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):this.svgPath.removeAttribute("filter")}updateShapeForInputHighlight(e,t){e=e.getParentInput().name,(e=this.getOutlinePath(e))&&(t?e.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):e.removeAttribute("filter"))}beginDrawing(){this.remainingOutlines.clear();for(const e of this.outlines.keys())this.remainingOutlines.add(e)}endDrawing(){if(this.remainingOutlines.size)for(const e of this.remainingOutlines)this.removeOutlinePath(e);this.remainingOutlines.clear()}setOutlinePath(e,t){e=this.getOutlinePath(e),e.setAttribute("d",t),e.setAttribute("fill",this.style.colourTertiary)}getOutlinePath(e){return this.outlines.has(e)||this.outlines.set(e,w(te.PATH,{class:"blocklyOutlinePath",d:""},this.svgRoot)),this.remainingOutlines.delete(e),this.outlines.get(e)}removeOutlinePath(e){let t,i;(t=this.outlines.get(e))==null||(i=t.parentNode)==null||i.removeChild(this.outlines.get(e)),this.outlines.delete(e)}},ac=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const i=this.getConstants();i.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=i.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new oc}makeRenderInfo_(e){return new zr(this,e)}makeDrawer_(e,t){return new sc(e,t)}makeMarkerDrawer(e,t){return new P$(e,this.getConstants(),t)}makePathObject(e,t){return new nu(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,i){return!!St.getConnectionForOrphanedConnection(e,i===qe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,i){return t.type===qe.OUTPUT_VALUE||t.type===qe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(i,e.targetBlock(),t.type)?es.PREVIEW_TYPE.INSERTION_MARKER:es.PREVIEW_TYPE.REPLACEMENT_FADE:es.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},Nt={};Nt.BottomRow=A$,Nt.Connection=Dn,Nt.ConstantProvider=oc,Nt.Drawer=sc,Nt.ExternalValueInput=su,Nt.Field=Wr,Nt.Hat=L$,Nt.Icon=DT,Nt.InRowSpacer=os,Nt.InlineInput=N$,Nt.InputConnection=ji,Nt.InputRow=w$,Nt.JaggedEdge=PT,Nt.MarkerSvg=P$,Nt.Measurable=js,Nt.NextConnection=xT,Nt.OutputConnection=BT,Nt.PathObject=nu,Nt.PreviousConnection=FT,Nt.RenderInfo=zr,Nt.Renderer=ac,Nt.RoundCorner=lc,Nt.Row=nc,Nt.SpacerRow=M$,Nt.SquareCorner=cc,Nt.StatementInput=rc,Nt.TopRow=D$,Nt.Types=q,Nt.init=Dh,Nt.register=mr,Nt.unregister=rm;var XT=class extends ac{constructor(e){super(e)}makeConstants_(){return new wT}makeRenderInfo_(e){return new GT(this,e)}makeDrawer_(e,t){return new MT(e,t)}makeMarkerDrawer(e,t){return new WT(e,this.getConstants(),t)}makePathObject(e,t){return new zT(e,t,this.getConstants())}getConstants(){return this.constants_}shouldHighlightConnection(e){return e.type!==qe.INPUT_VALUE&&e.type!==qe.OUTPUT_VALUE}getConnectionPreviewMethod(e,t,i){return t.type===qe.OUTPUT_VALUE?e.isConnected()?es.PREVIEW_TYPE.REPLACEMENT_FADE:es.PREVIEW_TYPE.INPUT_OUTLINE:super.getConnectionPreviewMethod(e,t,i)}};mr("zelos",XT);var Is={};Is.BottomRow=UT,Is.ConstantProvider=wT,Is.Drawer=MT,Is.MarkerSvg=WT,Is.PathObject=zT,Is.RenderInfo=GT,Is.Renderer=XT,Is.RightConnectionShape=HT,Is.StatementInput=iu,Is.TopRow=VT,qh();var No={};No.registerCleanup=Bh,No.registerCollapse=Uh,No.registerCollapseExpandBlock=jh,No.registerComment=zh,No.registerDefaultOptions=qh,No.registerDelete=Kh,No.registerDeleteAll=Gh,No.registerDisable=Yh,No.registerDuplicate=Wh,No.registerExpand=Hh,No.registerHelp=Qh,No.registerInline=Xh,No.registerRedo=xh,No.registerUndo=Ph;var jT=class{constructor(){}onDragEnter(e){}onDragOver(e){}onDragExit(e){}onDrop(e){}getClientRect(){return null}shouldPreventMove(e){return!1}},ru=class extends jT{constructor(){super(),this.wouldDelete_=!1}wouldDelete(e,t){return e instanceof ts?(e=!e.getParent()&&e.isDeletable(),this.updateWouldDelete_(e&&!t)):this.updateWouldDelete_(e.isDeletable()),this.wouldDelete_}updateWouldDelete_(e){this.wouldDelete_=e}},mt=class extends ic{constructor(e,t,i){super(bt.SKIP_SETUP),this.clockwise=mt.CLOCKWISE,this.offset=mt.OFFSET,this.wrap=mt.WRAP,this.round=mt.ROUND,this.boundEvents=[],this.symbol_=this.gauge=this.line=null,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){switch(super.configure_(e),e.mode){case lu.COMPASS:this.clockwise=!0,this.offset=90;break;case lu.PROTRACTOR:this.clockwise=!1,this.offset=0}e.clockwise&&(this.clockwise=e.clockwise),e.offset&&(this.offset=e.offset),e.wrap&&(this.wrap=e.wrap),e.round&&(this.round=e.round)}initView(){super.initView(),this.symbol_=w(te.TSPAN,{}),this.symbol_.appendChild(document.createTextNode("°")),this.getTextElement().appendChild(this.symbol_)}render_(){super.render_(),this.updateGraph()}showEditor_(e){super.showEditor_(e,Lp||xa||kr),e=this.dropdownCreate(),dr().appendChild(e),this.sourceBlock_ instanceof ts&&Kc(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),yl(this,this.dropdownDispose.bind(this)),this.updateGraph()}dropdownCreate(){const e=w(te.SVG,{xmlns:Aa,"xmlns:html":ui,"xmlns:xlink":us,version:"1.1",height:2*mt.HALF+"px",width:2*mt.HALF+"px",style:"touch-action: none"}),t=w(te.CIRCLE,{cx:mt.HALF,cy:mt.HALF,r:mt.RADIUS,class:"blocklyAngleCircle"},e);this.gauge=w(te.PATH,{class:"blocklyAngleGauge"},e),this.line=w(te.LINE,{x1:mt.HALF,y1:mt.HALF,class:"blocklyAngleLine"},e);for(let i=0;360>i;i+=15)w(te.LINE,{x1:mt.HALF+mt.RADIUS,y1:mt.HALF,x2:mt.HALF+mt.RADIUS-(i%45===0?10:5),y2:mt.HALF,class:"blocklyAngleMarks",transform:"rotate("+i+","+mt.HALF+","+mt.HALF+")"},e);return this.boundEvents.push(Be(e,"click",this,this.hide)),this.boundEvents.push(Be(t,"pointerdown",this,this.onMouseMove_,!0)),this.boundEvents.push(Be(t,"pointermove",this,this.onMouseMove_,!0)),e}dropdownDispose(){for(const e of this.boundEvents)Dt(e);this.boundEvents.length=0,this.line=this.gauge=null}hide(){hr(this),as()}onMouseMove_(e){var t=this.gauge.ownerSVGElement.getBoundingClientRect();const i=e.clientX-t.left-mt.HALF;e=e.clientY-t.top-mt.HALF,t=Math.atan(-e/i),isNaN(t)||(t=xd(t),0>i?t+=180:0e&&(e+=360),e>this.wrap&&(e-=360),e}static fromJson(e){return new this(e.angle,void 0,e)}};mt.HALF=50,mt.RADIUS=mt.HALF-1,mt.CLOCKWISE=!1,mt.OFFSET=0,mt.WRAP=360,mt.ROUND=15,Jo("field_angle",mt),mt.prototype.DEFAULT_VALUE=0,cs(` +.blocklyAngleCircle { + stroke: #444; + stroke-width: 1; + fill: #ddd; + fill-opacity: 0.8; +} + +.blocklyAngleMarks { + stroke: #444; + stroke-width: 1; +} + +.blocklyAngleGauge { + fill: #f88; + fill-opacity: 0.8; + pointer-events: none; +} + +.blocklyAngleLine { + stroke: #f00; + stroke-width: 2; + stroke-linecap: round; + pointer-events: none; +} +`);var lu;(function(e){e.COMPASS="compass",e.PROTRACTOR="protractor"})(lu||(lu={}));var xn=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=xn.CHECK_CHAR,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(xn);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();I(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||xn.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool_(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};xn.CHECK_CHAR="✓",Jo("field_checkbox",xn),xn.prototype.DEFAULT_VALUE=!1;var ss=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.highlightedIndex=this.picker=null,this.boundEvents=[],this.SERIALIZABLE=!0,this.CURSOR="default",this.isDirty_=!1,this.titles=this.colours=null,this.columns=0,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.colourOptions&&(this.colours=e.colourOptions),e.colourTitles&&(this.titles=e.colourTitles),e.columns&&(this.columns=e.columns)}initView(){this.size_=new Vt(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof ts&&(this.clickTarget_=this.sourceBlock_.getSvgRoot()):(this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1")}applyColour(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof ts&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())}doClassValidation_(e){return typeof e!="string"?null:Di(e)}doValueUpdate_(e){this.value_=e,this.borderRect_?this.borderRect_.style.fill=e:this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_ instanceof ts&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",e),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))}getText(){let e=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(e)&&(e="#"+e[1]+e[3]+e[5]),e}setColours(e,t){return this.colours=e,t&&(this.titles=t),this}setColumns(e){return this.columns=e,this}showEditor_(){this.dropdownCreate(),dr().appendChild(this.picker),yl(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(e){e=(e=e.target)&&e.getAttribute("data-colour"),e!==null&&(this.setValue(e),hr(this))}onKeyDown(e){let t=!0;var i;switch(e.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":(i=this.getHighlighted())&&(i=i.getAttribute("data-colour"),i!==null&&this.setValue(i)),fs();break;default:t=!1}t&&e.stopPropagation()}moveHighlightBy(e,t){if(this.highlightedIndex){var i=this.colours||ss.COLOURS,r=this.columns||ss.COLUMNS,c=this.highlightedIndex%r,$=Math.floor(this.highlightedIndex/r);c+=e,$+=t,0>e?0>c&&0<$?(c=r-1,$--):0>c&&(c=0):0r-1&&$r-1&&c--:0>t?0>$&&($=0):0Math.floor(i.length/r)-1&&($=Math.floor(i.length/r)-1),this.setHighlightedCell(this.picker.childNodes[$].childNodes[c],$*r+c)}}onMouseMove(e){const t=(e=e.target)&&Number(e.getAttribute("data-index"));t!==null&&t!==this.highlightedIndex&&this.setHighlightedCell(e,t)}onMouseEnter(){let e;(e=this.picker)==null||e.focus({preventScroll:!0})}onMouseLeave(){var e;(e=this.picker)==null||e.blur(),(e=this.getHighlighted())&&A(e,"blocklyColourHighlighted")}getHighlighted(){if(!this.highlightedIndex)return null;const e=this.columns||ss.COLUMNS,t=this.picker.childNodes[Math.floor(this.highlightedIndex/e)];return t?t.childNodes[this.highlightedIndex%e]:null}setHighlightedCell(e,t){const i=this.getHighlighted();i&&A(i,"blocklyColourHighlighted"),I(e,"blocklyColourHighlighted"),this.highlightedIndex=t,(e=e.getAttribute("id"))&&this.picker&&Xt(this.picker,Gt.ACTIVEDESCENDANT,e)}dropdownCreate(){const e=this.columns||ss.COLUMNS,t=this.colours||ss.COLOURS,i=this.titles||ss.TITLES,r=this.getValue(),c=document.createElement("table");c.className="blocklyColourTable",c.tabIndex=0,c.dir="ltr",ms(c,Vo.GRID),Xt(c,Gt.EXPANDED,!0),Xt(c,Gt.ROWCOUNT,Math.floor(t.length/e)),Xt(c,Gt.COLCOUNT,e);let $;for(let v=0;vtr>td { + border: 0.5px solid #888; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + height: 20px; + padding: 0; + width: 20px; +} + +.blocklyColourTable>tr>td.blocklyColourHighlighted { + border-color: #eee; + box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3); + position: relative; +} + +.blocklyColourSelected, .blocklyColourSelected:hover { + border-color: #eee !important; + outline: 1px solid #333; + position: relative; +} +`);var YT=class extends wn{constructor(e,t,i){super(String(e??""),t,i),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_label_serializable",YT);var x$=class extends Gr{constructor(e,t,i){super(bt.SKIP_SETUP),this.textGroup=null,this.maxLines_=1/0,this.isOverflowedY_=!1,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.maxLines&&this.setMaxLines(e.maxLines)}toXml(e){return e.textContent=this.getValue().replace(/\n/g," "),e}fromXml(e){this.setValue(e.textContent.replace(/ /g,` +`))}saveState(){const e=this.saveLegacyState(x$);return e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(bt,e)||this.setValue(e)}initView(){this.createBorderRect_(),this.textGroup=w(te.G,{class:"blocklyEditableText"},this.fieldGroup_)}getDisplayText_(){const e=this.getSourceBlock();if(!e)throw new io;let t=this.getText();if(!t)return bt.NBSP;const i=t.split(` +`);t="";const r=this.isOverflowedY_?this.maxLines_:i.length;for(let c=0;cthis.maxDisplayLength?$=$.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&c===r-1&&($=$.substring(0,$.length-3)+"..."),$=$.replace(/\s/g,bt.NBSP),t+=$,c!==r-1&&(t+=` +`)}return e.RTL&&(t+="‏"),t}doValueUpdate_(e){super.doValueUpdate_(e),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` +`).length>this.maxLines_)}render_(){var e=this.getSourceBlock();if(!e)throw new io;for(var t,i=this.textGroup;t=i.firstChild;)i.removeChild(t);t=this.getDisplayText_().split(` +`);let r=0;for(let c=0;cc&&(c=H),$+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(e[H]=e[H].substring(0,this.maxDisplayLength)),v.textContent=e[H];const Oe=Ne(v,t,i,r);Oe>c&&(c=Oe)}c+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&($+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,c+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",`${c}`),this.borderRect_.setAttribute("height",`${$}`)),this.size_.width=c,this.size_.height=$,this.positionBorderRect_()}showEditor_(e,t){super.showEditor_(e,t),this.forceRerender()}widgetCreate_(){const e=fn(),t=this.workspace_.getScale(),i=document.createElement("textarea");i.className="blocklyHtmlInput blocklyHtmlTextAreaInput",i.setAttribute("spellcheck",String(this.spellcheck_));var r=this.getConstants().FIELD_TEXT_FONTSIZE*t+"pt";e.style.fontSize=r,i.style.fontSize=r,i.style.borderRadius=Gr.BORDERRADIUS*t+"px",r=this.getConstants().FIELD_BORDER_RECT_X_PADDING*t;const c=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*t/2;return i.style.padding=c+"px "+r+"px "+c+"px "+r+"px",r=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,i.style.lineHeight=r*t+"px",e.appendChild(i),i.value=i.defaultValue=this.getEditorText_(this.value_),i.setAttribute("data-untyped-default-value",String(this.value_)),i.setAttribute("data-old-value",""),kp?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(i),i}setMaxLines(e){typeof e=="number"&&0this.max_&&(e.max=`${this.max_}`,Xt(e,Gt.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Jo("field_number",B$),B$.prototype.DEFAULT_VALUE=0;var uc=class extends Ws{constructor(e,t,i,r,c){super(bt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=uc.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Vt(0,0),e!==bt.SKIP_SETUP&&(c?this.configure_(c):this.setTypes(i,r),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new io;this.variable||(e=s.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new io;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new io;const i=e.getAttribute("id"),r=e.textContent,c=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=s.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,i,r,c),c!==null&&c!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+Ps(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(uc);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new io;this.loadLegacyState(uc,e)||(e=s.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new io;return t=s.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new io;this.variable=s.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let i=0;i(this.flyout?s.config$$module$build$src$core$config.flyoutDragRadius:s.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),this.targetBlock.select(),!0):!1}updateIsDraggingBubble(){return this.startBubble?(this.startDraggingBubble(),!0):!1}updateIsDraggingBlock(){if(!this.targetBlock)return!1;if(this.flyout){if(this.updateIsDraggingFromFlyout())return this.startDraggingBlock(),!0}else if(this.targetBlock.isMovable())return this.startDraggingBlock(),!0;return!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger=new QT(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(){if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.updateIsDraggingBubble()||this.updateIsDraggingBlock()||this.updateIsDraggingWorkspace()}startDraggingBlock(){this.blockDragger=new(y(Ae.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(this.targetBlock,this.startWorkspace_),this.blockDragger.startDrag(this.currentDragDeltaXY,this.healStack),this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY)}startDraggingBubble(){if(!this.startBubble)throw Error("Cannot update dragging the bubble because the start bubble is undefined");if(!this.startWorkspace_)throw Error("Cannot update dragging the bubble because the start workspace is undefined");this.bubbleDragger=new LT(this.startBubble,this.startWorkspace_),this.bubbleDragger.startBubbleDrag(),this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,bl(e)?this.cancel():(this.gestureHasStarted=!0,gr(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Ud(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ih(),this.targetBlock&&this.targetBlock.select(),Ai(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&V(e,this),this.mouseDownXY=new Ue(e.clientX,e.clientY),this.healStack=e.altKey||e.ctrlKey||e.metaKey,this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(Be(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(Be(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(Be(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&ve())}handleMove(e){this.isDragging()&&rt(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.blockDragger?this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY):this.bubbleDragger&&this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),ve())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!rt(e))return;if(this.updateFromEvent(e),ve(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.bubbleDragger?this.bubbleDragger.endBubbleDrag(e,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()?this.doBubbleClick():this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e)}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=Mt(e);this.cachedPoints.set(t,this.getTouchPoint(e));var i=Array.from(this.cachedPoints.keys());i.length===2&&(t=this.cachedPoints.get(i[0]),i=this.cachedPoints.get(i[1]),this.startDistance=Ue.distance(t,i),this.isMultiTouch_=!0,e.preventDefault())}handleTouchMove(e){const t=Mt(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):this.handleMove(e)}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),i=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),i=Ue.distance(i,t)/this.startDistance,0this.previousScale){if(t=i-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new Ue(e.pageX,e.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(ve(),this.bubbleDragger?this.bubbleDragger.endBubbleDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.doStart(e)}fireWorkspaceClick(e){re(new(we(ai))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}doBubbleClick(){this.startBubble instanceof yo&&(this.startBubble.setFocus(),this.startBubble.select())}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");this.targetBlock.isEnabled()&&(s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.flyout.createBlock(this.targetBlock).scheduleSnapAndBump())}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");const e=new(we(ai))(this.startBlock,this.startWorkspace_.id,"block");re(e)}this.bringBlockToFront(),s.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,Z()&&Z().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return(this.startField?this.startField.isClickable():!1)&&!this.hasExceededDragRadius&&(!this.flyout||!this.flyout.autoClose)}isIconClick(){return!!this.startIcon&&!this.hasExceededDragRadius}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}isDragging(){return!!this.workspaceDragger||!!this.blockDragger||!!this.bubbleDragger}hasStarted(){return this.gestureHasStarted}getInsertionMarkers(){return this.blockDragger?this.blockDragger.getInsertionMarkers():[]}getCurrentDragger(){let e,t;return(t=(e=this.blockDragger)!=null?e:this.workspaceDragger)!=null?t:this.bubbleDragger}static inProgress(){const e=P();for(let t=0,i;i=e[t];t++)if(i.currentGesture_)return!0;return!1}},H$=class{constructor(e,t){this.pattern=e;let i;this.spacing=(i=t.spacing)!=null?i:0;let r;this.length=(r=t.length)!=null?r:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let c;this.snapToGrid=(c=t.snap)!=null?c:!1}shouldSnap(){return this.snapToGrid}getSpacing(){return this.spacing}getPatternId(){return this.pattern.id}update(e){var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let i=t-this.length/2,r=t+this.length/2;t*=e,i*=e,r*=e,this.setLineAttributes(this.line1,e,i,r,t,t),this.setLineAttributes(this.line2,e,t,t,i,r)}setLineAttributes(e,t,i,r,c,$){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${i}`),e.setAttribute("y1",`${c}`),e.setAttribute("x2",`${r}`),e.setAttribute("y2",`${$}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}static createDom(e,t,i){e=w(te.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},i);let r,c;if(0<((r=t.length)!=null?r:1)&&0<((c=t.spacing)!=null?c:0)){w(te.LINE,{stroke:t.colour},e);let $;($=t.length)!=null&&$&&w(te.LINE,{stroke:t.colour},e)}else w(te.LINE,{},e);return e}};s.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: +Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=s.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;t{c&&t&&this.deleteVariableInternal(t,r)})):this.deleteVariableInternal(t,r)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const i=s.getGroup$$module$build$src$core$events$utils();i||s.setGroup$$module$build$src$core$events$utils(!0);try{for(let r=0;re.name)}getVariableUsesById(e){const t=[],i=this.workspace.getAllBlocks(!1);for(let r=0;rthis.remainingCapacityOfType(i))return!1;t+=e[i]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,i=e?this.undoStack_:this.redoStack_;const r=t.pop();if(r){for(var c=[r];t.length&&r.group&&r.group===t[t.length-1].group;){const $=t.pop();$&&c.push($)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;timage, .blocklyZoom>svg>image { + opacity: .4; +} + +.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover { + opacity: .6; +} + +.blocklyZoom>image:active, .blocklyZoom>svg>image:active { + opacity: .8; +} +`);var BS=20,Cs=class extends dc{constructor(e){super(e),this.resizeHandlerWrapper=null,this.resizesEnabled=this.isVisible_=this.rendered=!0,this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0,this.dragDeltaXY=null,this.oldScale=this.scale=1,this.oldLeft=this.oldTop=0,this.inverseScreenCTM=this.targetWorkspace=this.configureContextMenu=this.lastRecordedPageScroll=this.injectionDiv=this.currentGesture_=this.toolbox_=this.flyout=this.scrollbar=this.trashcan=null,this.inverseScreenCTMDirty=!0,this.highlightedBlocks=[],this.toolboxCategoryCallbacks=new Map,this.flyoutButtonCallbacks=new Map,this.cachedParentSvg=null,this.keyboardAccessibilityMode=!1,this.topBoundedElements=[],this.dragTargetAreas=[],this.zoomControls_=null,this.metricsManager=new(y(Ae.METRICS_MANAGER,e,!0))(this),this.getMetrics=e.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager),this.setMetrics=e.setMetrics||Cs.setTopLevelWorkspaceMetrics_,this.componentManager=new fo,this.connectionDBList=Vr.init(this.connectionChecker),this.audioManager=new ZT(e.parentWorkspace),this.grid=this.options.gridPattern?new H$(this.options.gridPattern,e.gridOptions):null,this.markerManager=new zl(this),ao&&ze&&this.registerToolboxCategoryCallback(Op,ze),Ki&&ma&&this.registerToolboxCategoryCallback(V$,ma),Eo&&fa&&(this.registerToolboxCategoryCallback(cu,fa),this.addChangeListener(tp)),this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new JT(this,this.options.theme||Qa),this.themeManager_.subscribeWorkspace(this);let t;this.renderer=Dh(this.options.renderer||"geras",this.getTheme(),(t=this.options.rendererOverrides)!=null?t:void 0),this.cachedParentSvgSize=new Vt(0,0)}getMarkerManager(){return this.markerManager}getMetricsManager(){return this.metricsManager}setMetricsManager(e){this.metricsManager=e,this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}setCursorSvg(e){this.markerManager.setCursorSvg(e)}setMarkerSvg(e){this.markerManager.setMarkerSvg(e)}getMarker(e){return this.markerManager?this.markerManager.getMarker(e):null}getCursor(){return this.markerManager?this.markerManager.getCursor():null}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(e){e||(e=Qa),this.themeManager_.setTheme(e)}refreshTheme(){this.svgGroup_&&this.renderer.refreshDom(this.svgGroup_,this.getTheme()),this.updateBlockStyles_(this.getAllBlocks(!1).filter(function(t){return!!t.getStyleName()})),this.refreshToolboxSelection(),this.toolbox_&&this.toolbox_.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(we(Cr))(this.getTheme().name,this.id);re(e)}updateBlockStyles_(e){for(let t=0,i;i=e[t];t++){const r=i.getStyleName();r&&i.setStyle(r)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.isVisible_}getSvgXY(e){let t=0,i=0,r=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(r=this.scale);do{const c=$n(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(r=1),t+=c.x*r,i+=c.y*r,e=e.parentNode}while(e&&e!==this.getParentSvg());return new Ue(t,i)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Vt(e.width,e.height)}getOriginOffsetInPixels(){return zc(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")!==-1){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getBlockCanvas(){return this.svgBlockCanvas_}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e){return this.svgGroup_=w(te.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=w(te.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.svgBlockCanvas_=w(te.G,{class:"blocklyBlockCanvas"},this.svgGroup_),this.svgBubbleCanvas_=w(te.G,{class:"blocklyBubbleCanvas"},this.svgGroup_),this.isFlyout||(Be(this.svgGroup_,"pointerdown",this,this.onMouseDown_,!1),document.body.addEventListener("wheel",function(){}),Be(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(y(Ae.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=y(Ae.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&U(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&U(e.parentNode)}this.resizeHandlerWrapper&&(Dt(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null)}addTrashcan(){this.trashcan=Cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.svgBlockCanvas_)}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new eE(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new hs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(y(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(y(Ae.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(fo.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),i=[];for(let r=0,c;c=e[r];r++){c.position(t,i);const $=c.getBoundingRectangle();$&&i.push($)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const e=vd();Ue.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations_())}getCanvas(){return this.svgBlockCanvas_}setCachedParentSvgSize(e,t){const i=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,i.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,i.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.svgBubbleCanvas_}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(_e()){var e=this.scale,t=-this.scrollY,i=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(i-this.oldLeft))){var r=new(we(Ui))(t,i,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=i,re(r)}}}translate(e,t){const i="translate("+e+","+t+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",i),this.svgBubbleCanvas_.setAttribute("transform",i),this.grid&&this.grid.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.isVisible_=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox_&&this.toolbox_.setVisible(e),e||this.hideChaff(!0))}render(){for(var e=this.getAllBlocks(!1),t=e.length-1;0<=t;t--)e[t].queueRender();if(this.currentGesture_)for(e=this.currentGesture_.getInsertionMarkers(),t=0;tvoid this.markerManager.updateMarkers())}highlightBlock(e,t){if(t===void 0){for(let i=0,r;r=this.highlightedBlocks[i];i++)r.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.indexOf(e)===-1&&this.highlightedBlocks.push(e):Po(this.highlightedBlocks,e),e.setHighlighted(t))}paste(e){if(!this.rendered||!e.type&&!e.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();const t=s.getGroup$$module$build$src$core$events$utils();t||s.setGroup$$module$build$src$core$events$utils(!0);let i;try{i=e.type?this.pasteBlock_(null,e):e.tagName.toLowerCase()==="comment"?this.pasteWorkspaceComment_(e):this.pasteBlock_(e,null)}finally{s.setGroup$$module$build$src$core$events$utils(t)}return i}pasteBlock_(e,t){s.disable$$module$build$src$core$events$utils();let i;try{let r=0,c=0;if(e){i=wi(e,this);let $;r=parseInt(($=e.getAttribute("x"))!=null?$:"0"),this.RTL&&(r=-r);let v;c=parseInt((v=e.getAttribute("y"))!=null?v:"0")}else t&&(i=_n(t,this),r=t.x||10,this.RTL&&(r=this.getWidth()-r),c=t.y||10);if(!isNaN(r)&&!isNaN(c)){let $;do{$=!1;const v=this.getAllBlocks(!1);for(let H=0,Oe;Oe=v[H];H++){const Qe=Oe.getRelativeToSurfaceXY();if(1>=Math.abs(r-Qe.x)&&1>=Math.abs(c-Qe.y)){$=!0;break}}if(!$){const H=i.getConnections_(!1);for(let Oe=0,Qe;Qe=H[Oe];Oe++)if(Qe.closest(s.config$$module$build$src$core$config.snapRadius,new Ue(r,c)).connection){$=!0;break}}$&&(r=this.RTL?r-s.config$$module$build$src$core$config.snapRadius:r+s.config$$module$build$src$core$config.snapRadius,c+=2*s.config$$module$build$src$core$config.snapRadius)}while($);i.moveTo(new Ue(r,c))}}finally{s.enable$$module$build$src$core$events$utils()}return _e()&&!i.isShadow()&&re(new(we(s.CREATE$$module$build$src$core$events$utils))(i)),i.select(),i}pasteWorkspaceComment_(e){s.disable$$module$build$src$core$events$utils();let t;try{t=yo.fromXmlRendered(e,this);let i,r=parseInt((i=e.getAttribute("x"))!=null?i:"0"),c,$=parseInt((c=e.getAttribute("y"))!=null?c:"0");isNaN(r)||isNaN($)||(this.RTL&&(r=-r),t.moveBy(r+50,$+50))}finally{s.enable$$module$build$src$core$events$utils()}return _e()&&Hs.fireCreateEvent(t),t.select(),t}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox_&&e.toolbox_.getFlyout()&&e.toolbox_.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,i){return e=super.createVariable(e,t,i),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(fo.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,i;i=e[t];t++){const r=i.getClientRect();r&&this.dragTargetAreas.push({component:i,clientRect:r})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,i;i=this.dragTargetAreas[t];t++)if(i.clientRect.contains(e.clientX,e.clientY))return i.component;return null}onMouseDown_(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){e=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,this.dragDeltaXY=Ue.difference(t,e)}moveDrag(e){return e=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,Ue.sum(this.dragDeltaXY,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel_(e){if(bi.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,i=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||i){var r=vl(e);if(Ap)var c=e.metaKey;t&&(e.ctrlKey||c||!i)?(r=-r.y/50,t=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,r)):(t=this.scrollX-r.x,i=this.scrollY-r.y,e.shiftKey&&!r.x&&(t=this.scrollX-r.y,i=this.scrollY),this.scroll(t,i)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new Bt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let r=1;rt.bottom&&(t.bottom=i.bottom),i.leftt.right&&(t.right=i.right))}return t}cleanUp(){this.setResizesEnabled(!1),s.setGroup$$module$build$src$core$events$utils(!0);const e=this.getTopBlocks(!0);let t=0;for(let i=0,r;r=e[i];i++){if(!r.isMovable())continue;const c=r.getRelativeToSurfaceXY();r.moveBy(-c.x,t-c.y,["cleanup"]),r.snapToGrid(),t=r.getRelativeToSurfaceXY().y+r.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}s.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=kt.registry.getContextMenuOptions(kt.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),wl(e,t,this.RTL)}}updateToolbox(e){if(e=ia(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(na(e)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox_.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(ne(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,i){i=Math.pow(this.options.zoomOptions.scaleSpeed,i);const r=this.scale*i;if(this.scale!==r){r>this.options.zoomOptions.maxScale?i=this.options.zoomOptions.maxScale/this.scale:rthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics_(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},jr;(function(e){e.BLOCK="block",e.BUTTON="button"})(jr||(jr={}));var au=class extends ru{constructor(e){super(),this.horizontalLayout=!1,this.boundEvents=[],this.filterWrapper=this.reflowWrapper=null,this.mats=[],this.buttons_=[],this.listeners=[],this.permanentlyDisabled=[],this.recycledBlocks=[],this.autoClose=!0,this.isVisible_=!1,this.containerVisible=!0,this.CORNER_RADIUS=8,this.SCROLLBAR_MARGIN=2.5,this.height_=this.width_=0,this.dragAngleRange_=70,this.svgGroup_=this.svgBackground_=null,e.setMetrics=this.setMetrics_.bind(this),this.workspace_=new Cs(e),this.workspace_.setMetricsManager(new KT(this.workspace_,this)),this.workspace_.internalIsFlyout=!0,this.workspace_.setVisible(this.isVisible_),this.id=he(),this.RTL=!!e.RTL,this.toolboxPosition_=e.toolboxPosition,this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH,this.rectMap_=new WeakMap,this.MARGIN=this.CORNER_RADIUS,this.GAP_X=3*this.MARGIN,this.GAP_Y=3*this.MARGIN}createDom(e){return this.svgGroup_=w(e,{class:"blocklyFlyout",style:"display: none"}),this.svgBackground_=w(te.PATH,{class:"blocklyFlyoutBackground"},this.svgGroup_),this.svgGroup_.appendChild(this.workspace_.createDom()),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"),this.svgGroup_}init(e){this.targetWorkspace=e,this.workspace_.targetWorkspace=e,this.workspace_.scrollbar=new U$(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN),this.hide(),this.boundEvents.push(Be(this.svgGroup_,"wheel",this,this.wheel_)),this.autoClose||(this.filterWrapper=this.filterForCapacity.bind(this),this.targetWorkspace.addChangeListener(this.filterWrapper)),this.boundEvents.push(Be(this.svgBackground_,"pointerdown",this,this.onMouseDown)),this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace),this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap()),this.workspace_.createPotentialVariableMap(),e.getComponentManager().addComponent({component:this,weight:1,capabilities:[fo.Capability.DELETE_AREA,fo.Capability.DRAG_TARGET]})}dispose(){this.hide(),this.workspace_.getComponentManager().removeComponent(this.id);for(const e of this.boundEvents)Dt(e);this.boundEvents.length=0,this.filterWrapper&&this.targetWorkspace.removeChangeListener(this.filterWrapper),this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose()),this.svgGroup_&&U(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}isVisible(){return this.isVisible_}setVisible(e){const t=e!==this.isVisible();this.isVisible_=e,t&&(this.autoClose||this.workspace_.recordDragTargets(),this.updateDisplay())}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay()}updateDisplay(){let e;e=this.containerVisible?this.isVisible():!1,this.svgGroup_&&(this.svgGroup_.style.display=e?"block":"none");let t;(t=this.workspace_.scrollbar)==null||t.setContainerVisible(e)}positionAt_(e,t,i,r){let c;(c=this.svgGroup_)==null||c.setAttribute("width",`${e}`);let $;($=this.svgGroup_)==null||$.setAttribute("height",`${t}`),this.workspace_.setCachedParentSvgSize(e,t),this.svgGroup_&&se(this.svgGroup_,"translate("+i+"px,"+r+"px)"),(e=this.workspace_.scrollbar)&&(e.setOrigin(i,r),e.resize(),e.hScroll&&e.hScroll.setPosition(e.hScroll.position.x,e.hScroll.position.y),e.vScroll&&e.vScroll.setPosition(e.vScroll.position.x,e.vScroll.position.y))}hide(){if(this.isVisible()){this.setVisible(!1);for(const e of this.listeners)Dt(e);this.listeners.length=0,this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null)}}show(e){this.workspace_.setResizesEnabled(!1),this.hide(),this.clearOldBlocks(),typeof e=="string"&&(e=this.getDynamicCategoryContents(e)),this.setVisible(!0),e=Ll(e),e=this.createFlyoutInfo(e),Ds(),this.layout_(e.contents,e.gaps),this.horizontalLayout?this.height_=0:this.width_=0,this.workspace_.setResizesEnabled(!0),this.reflow(),this.filterForCapacity(),this.position(),this.reflowWrapper=this.reflow.bind(this),this.workspace_.addChangeListener(this.reflowWrapper),this.emptyRecycledBlocks()}createFlyoutInfo(e){const t=[],i=[];this.permanentlyDisabled.length=0;const r=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const c of e){if("custom"in c){e=this.getDynamicCategoryContents(c.custom),e=Ll(e);const{contents:$,gaps:v}=this.createFlyoutInfo(e);t.push(...$),i.push(...v)}switch(c.kind.toUpperCase()){case"BLOCK":e=c;const $=this.createFlyoutBlock(e);t.push({type:jr.BLOCK,block:$}),this.addBlockGap(e,i,r);break;case"SEP":this.addSeparatorGap(c,i,r);break;case"LABEL":e=this.createButton(c,!0),t.push({type:jr.BUTTON,button:e}),i.push(r);break;case"BUTTON":e=this.createButton(c,!1),t.push({type:jr.BUTTON,button:e}),i.push(r)}}return{contents:t,gaps:i}}getDynamicCategoryContents(e){if(e=this.workspace_.targetWorkspace.getToolboxCategoryCallback(e),typeof e!="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");return e(this.workspace_.targetWorkspace)}createButton(e,t){return new Os(this.workspace_,this.targetWorkspace,e,t)}createFlyoutBlock(e){let t;return e.blockxml?(e=typeof e.blockxml=="string"?s.textToDom$$module$build$src$core$utils$xml(e.blockxml):e.blockxml,(t=this.getRecycledBlock(e.getAttribute("type")))||(t=wi(e,this.workspace_))):(t=this.getRecycledBlock(e.type),t||(e.enabled===void 0&&(e.enabled=e.disabled!=="true"&&e.disabled!==!0),t=Cl(e,this.workspace_))),t.isEnabled()||this.permanentlyDisabled.push(t),t}getRecycledBlock(e){let t=-1;for(let i=0;i{const i=this.targetWorkspace.getGesture(t);i&&(i.setStartBlock(e),i.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;s.disable$$module$build$src$core$events$utils();var i=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{s.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=C(this.targetWorkspace,i),_e()){for(s.setGroup$$module$build$src$core$events$utils(!0),i=0;i90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===at.TOP?new Bt(-1e9,t+e.height,-1e9,1e9):new Bt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let r=0,c;c=t[r];r++)e=Math.max(e,c.getHeightWidth().height);const i=this.buttons_;for(let r=0,c;c=i[r];r++)e=Math.max(e,c.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=no.scrollbarThickness,this.height_!==e){for(let r=0,c;c=t[r];r++)this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==at.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.recordDragTargets()}}};l(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,li,tE);var W$=class extends au{constructor(e){super(e)}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),i=t.getScrollMetrics(),r=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.y=="number"&&(this.workspace_.scrollY=-(i.top+(i.height-r.height)*e.y)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),i=e.getViewMetrics();return e=e.getToolboxMetrics(),this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===at.LEFT?e.width:i.width-this.width_:this.toolboxPosition_===at.LEFT?0:i.width:this.toolboxPosition_===at.LEFT?0:i.width+t.left-this.width_}getY(){return 0}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=e.height,this.setBackgroundPath(this.width_-this.CORNER_RADIUS,e.height-2*this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const i=this.toolboxPosition_===at.RIGHT;var r=e+this.CORNER_RADIUS;r=["M "+(i?r:0)+",0"],r.push("h",i?-e:e),r.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,i?0:1,i?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),r.push("v",Math.max(0,t)),r.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,i?0:1,i?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),r.push("h",i?e:-e),r.push("z"),this.svgBackground_.setAttribute("d",r.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setY(0)}wheel_(e){var t=vl(e);if(t.y){const i=this.workspace_.getMetricsManager(),r=i.getScrollMetrics();t=i.getViewMetrics().top-r.top+t.y;let c;(c=this.workspace_.scrollbar)==null||c.setY(t),as(),fs()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;var i=this.MARGIN;const r=this.RTL?i:i+this.tabWidth_;for(let H=0,Oe;Oe=e[H];H++)if(Oe.type==="block"){var c=Oe.block,$=c.getDescendants(!1);for(let qt=0,Ft;Ft=$[qt];qt++)Ft.isInFlyout=!0;$=c.getSvgRoot();const Qe=c.getHeightWidth();var v=c.outputConnection?r-this.tabWidth_:r;c.moveBy(v,i),v=this.createRect_(c,this.RTL?v-Qe.width:v,i,Qe,H),this.addBlockListeners_($,c,v),i+=Qe.height+t[H]}else Oe.type==="button"&&(c=Oe.button,this.initFlyoutButton_(c,r,i),i+=c.height+t[H])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===at.LEFT?new Bt(-1e9,1e9,-1e9,t+e.width):new Bt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let r=0,c;c=t[r];r++){var i=c.getHeightWidth().width;c.outputConnection&&(i-=this.tabWidth_),e=Math.max(e,i)}for(let r=0,c;c=this.buttons_[r];r++)e=Math.max(e,c.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=no.scrollbarThickness,this.width_!==e){for(let r=0,c;c=t[r];r++){if(this.RTL){i=c.getRelativeToSurfaceXY().x;let $=e/this.workspace_.scale-this.MARGIN;c.outputConnection||($-=this.tabWidth_),c.moveBy($-i,0)}this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c)}if(this.RTL)for(let r=0,c;c=this.buttons_[r];r++)t=c.getPosition().y,c.moveTo(e/this.workspace_.scale-c.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==at.LEFT||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.recordDragTargets()}}};W$.registryName="verticalFlyout",l(Ae.FLYOUTS_VERTICAL_TOOLBOX,li,W$);var oE;s.CodeGenerator$$module$build$src$core$generator=class{constructor(e){this.forBlock=Object.create(null),this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null,this.INDENT=" ",this.COMMENT_WRAP=60,this.ORDER_OVERRIDES=[],this.isInitialized=null,this.RESERVED_WORDS_="",this.definitions_=Object.create(null),this.functionNames_=Object.create(null),this.nameDB_=void 0,this.name_=e,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}workspaceToCode(e){e||(console.warn("No workspace specified in workspaceToCode call. Guessing."),e=oe());var t=[];this.init(e),e=e.getTopBlocks(!0);for(let i=0,r;r=e[i];i++){let c=this.blockToCode(r);Array.isArray(c)&&(c=c[0]),c&&(r.outputConnection&&(c=this.scrubNakedValue(c),this.STATEMENT_PREFIX&&!r.suppressPrefixSuffix&&(c=this.injectId(this.STATEMENT_PREFIX,r)+c),this.STATEMENT_SUFFIX&&!r.suppressPrefixSuffix&&(c+=this.injectId(this.STATEMENT_SUFFIX,r))),t.push(c))}return t=t.join(` +`),t=this.finish(t),t=t.replace(/^\s+\n/,""),t=t.replace(/\n\s+$/,` +`),t=t.replace(/[ \t]+\n/g,` +`)}prefixLines(e,t){return t+e.replace(/(?!\n$)\n/g,` +`+t)}allNestedComments(e){const t=[];e=e.getDescendants(!0);for(let i=0;i.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},nE=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` +`+this.inlineSteps_}drawTopCorner(e){this.steps_+=jt(e.xPos,this.info_.startY);for(let t=0,i;i=e.elements[t];t++)q.isLeftSquareCorner(i)?this.steps_+=this.highlightConstants_.START_POINT:q.isLeftRoundedCorner(i)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):q.isPreviousConnection(i)?this.steps_+=this.notchPaths_.pathLeft:q.isHat(i)?this.steps_+=this.startPaths_.path(this.RTL_):q.isSpacer(i)&&i.width!==0&&(this.steps_+=je("H",i.xPos+i.width-this.highlightOffset));this.steps_+=je("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+je("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const i=e.height-t.connectionHeight;this.steps_+=To(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+je("v",i)}else this.steps_+=To(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const i=e.height-2*this.insideCornerPaths_.height;this.steps_+=To(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+je("v",i)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=To(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof M$&&e.followsStatement&&(this.steps_+=je("H",t)),this.RTL_&&(this.steps_+=je("H",t),e.height>this.highlightOffset&&(this.steps_+=je("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=je("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];q.isLeftSquareCorner(t)?this.steps_+=To(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):q.isLeftRoundedCorner(t)&&(this.steps_+=To(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=To(this.info_.startX,e):(this.steps_+=To(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=je("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,q.isLeftRoundedCorner(e.elements[0])?this.steps_+=je("V",this.outsideCornerPaths_.height):this.steps_+=je("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,i=e.xPos+e.connectionWidth;var r=e.centerline-e.height/2;const c=e.width-e.connectionWidth,$=r+t;this.RTL_?(r=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=To(i-t,$)+je("v",r)+this.puzzleTabPaths_.pathDown(this.RTL_)+je("v",e)+je("h",c)):this.inlineSteps_+=To(e.xPos+e.width+t,$)+je("v",e.height)+je("h",-c)+To(i,r+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},rE=class extends sc{constructor(e,t){super(e,t),this.highlighter_=new nE(t)}draw(){this.drawOutline_(),this.drawInternals_();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` +`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=je("H",e.xPos+e.width)+je("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let i=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(i*=-1),e.connectionModel.setOffsetInBlock(i,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let i=e.xPos+e.statementEdge+t.notchOffset;i=this.info_.RTL?-1*i:i+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(i,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let i=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(i*=-1),t.connectionModel.setOffsetInBlock(i,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,i=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-i:i)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},lE=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=jt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,i=(1-Math.SQRT1_2)*(e+t)-t,r=jt(i,i)+oo("a","0 0,0",e,tt(-i-t,e-i)),c=oo("a","0 0,0",e+t,tt(e+t,e+t)),$=jt(i,-i)+oo("a","0 0,0",e+t,tt(e-i,i+t));return{width:e+t,height:e,pathTop(v){return v?r:""},pathBottom(v){return v?c:$}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,i=(1-Math.SQRT1_2)*(e-t)+t,r=jt(i,i)+oo("a","0 0,1",e-t,tt(e-i,-i+t)),c=jt(t,e)+oo("a","0 0,1",e-t,tt(e,-e+t)),$=-i,v=jt(i,$)+oo("a","0 0,1",e-t,tt(-i+t,-$-e));return{height:e,topLeft(H){return H?r:c},bottomLeft(){return v}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,i=jt(-2,-t+3.4)+Bs(-.45*e,-2.1),r=je("v",2.5)+jt(.97*-e,2.5)+xo("q",[tt(.05*-e,10),tt(.3*e,9.5)])+jt(.67*e,-1.9)+je("v",2.5),c=je("v",-1.5)+jt(-.92*e,-.5)+xo("q",[tt(-.19*e,-5.5),tt(0,-11)])+jt(.92*e,1),$=jt(-5,t-.7)+Bs(.46*e,-2.1);return{width:e,height:t,pathUp(v){return v?i:c},pathDown(v){return v?r:$}}}makeNotch(){return{pathLeft:je("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Bs(5.1,2.6)+jt(-10.2,6.8)+Bs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=jt(25,-8.7)+xo("c",[tt(29.7,-6.2),tt(57.2,-.5),tt(75,8.7)]),i=xo("c",[tt(17.8,-9.2),tt(45.3,-14.9),tt(75,-8.7)])+To(100.5,e+.5);return{path(r){return r?t:i}}}},cE=class extends N${constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},aE=class extends rc{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},uE=class extends zr{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof Zo||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof s.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new cE(this.constants_,e)),t.hasInlineInput=!0):e instanceof Zo?(t.elements.push(new aE(this.constants_,e)),t.hasStatement=!0):e instanceof s.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new su(this.constants_,e)),t.hasExternalInput=!0):e instanceof zs&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let i=0,r;r=this.rows[i];i++)r.hasExternalInput&&(e=!0);for(let i=0,r;r=this.rows[i];i++){var t=r.elements;if(r.elements=[],r.startsWithElemSpacer()&&r.elements.push(new os(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let c=0;clp(t)),e.length?e:null}load(e,t){const i=t.getProcedureMap();for(const r of e)i.add(ap(this.procedureModelClass,this.parameterModelClass,r,t))}clear(e){e.getProcedureMap().clear()}},Yr={};Yr.ProcedureSerializer=FS,Yr.loadParameter=up,Yr.loadProcedure=ap,Yr.saveParameter=cp,Yr.saveProcedure=lp;var TE=class{constructor(){this.priority=eT}save(e){const t=[];for(const i of e.getAllVariables())e={name:i.name,id:i.getId()},i.type&&(e.type=i.type),t.push(e);return t.length?t:null}load(e,t){for(const i of e)t.createVariable(i.name,i.type,i.id)}clear(e){e.getVariableMap().clear()}};jc("variables",new TE);var EE={};EE.VariableSerializer=TE;var X$={};X$.load=bm,X$.save=Em;var US={blocks:Gl,exceptions:Cn,priorities:Va,procedures:Yr,registry:Pp,variables:EE,workspaces:X$},Ks;(function(e){e.ESCAPE="escape",e.DELETE="delete",e.COPY="copy",e.CUT="cut",e.PASTE="paste",e.UNDO="undo",e.REDO="redo"})(Ks||(Ks={})),mp();var Qs={};Qs.names=Ks,Qs.registerCopy=pp,Qs.registerCut=$p,Qs.registerDefaultShortcuts=mp,Qs.registerDelete=hp,Qs.registerEscape=dp,Qs.registerPaste=_p,Qs.registerRedo=fp,Qs.registerUndo=gp;var HS={colour_blocks:{colourPrimary:"#CF63CF",colourSecondary:"#C94FC9",colourTertiary:"#BD42BD"},list_blocks:{colourPrimary:"#9966FF",colourSecondary:"#855CD6",colourTertiary:"#774DCB"},logic_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC"},loop_blocks:{colourPrimary:"#0fBD8C",colourSecondary:"#0DA57A",colourTertiary:"#0B8E69"},math_blocks:{colourPrimary:"#59C059",colourSecondary:"#46B946",colourTertiary:"#389438"},procedure_blocks:{colourPrimary:"#FF6680",colourSecondary:"#FF4D6A",colourTertiary:"#FF3355"},text_blocks:{colourPrimary:"#FFBF00",colourSecondary:"#E6AC00",colourTertiary:"#CC9900"},variable_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},variable_dynamic_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},hat_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC",hat:"cap"}},VS={colour_category:{colour:"#CF63CF"},list_category:{colour:"#9966FF"},logic_category:{colour:"#4C97FF"},loop_category:{colour:"#0fBD8C"},math_category:{colour:"#59C059"},procedure_category:{colour:"#FF6680"},text_category:{colour:"#FFBF00"},variable_category:{colour:"#FF8C1A"},variable_dynamic_category:{colour:"#FF8C1A"}},GS=new Nn("zelos",HS,VS),j$={};j$.Classic=Qa,j$.Zelos=GS;var Y$=class{constructor(e,t,i){this.id_=e.toolboxitemid||$e(),this.level_=(this.parent_=i||null)?this.parent_.getLevel()+1:0,this.toolboxItemDef_=e,this.parentToolbox_=t,this.workspace_=this.parentToolbox_.getWorkspace()}init(){}getDiv(){return null}getClickTarget(){return null}getId(){return this.id_}getParent(){return null}getLevel(){return this.level_}isSelectable(){return!1}isCollapsible(){return!1}dispose(){}setVisible_(e){}},ys=class extends Y${constructor(e,t,i){super(e,t,i),this.colour_=this.name_="",this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null,this.isDisabled_=this.isHidden_=!1,this.flyoutItems_=[],this.cssConfig_=this.makeDefaultCssConfig_()}init(){this.parseCategoryDef_(this.toolboxItemDef_),this.parseContents_(this.toolboxItemDef_),this.createDom_(),this.toolboxItemDef_.hidden==="true"&&this.hide()}makeDefaultCssConfig_(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else if(e=e.contents)for(let t=0;t>>/sprites.png); + height: 16px; + vertical-align: middle; + visibility: hidden; + width: 16px; +} + +.blocklyTreeIconClosed { + background-position: -32px -1px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed { + background-position: 0 -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: -32px -17px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: 0 -17px; +} + +.blocklyTreeIconOpen { + background-position: -16px -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconOpen { + background-position: -16px -17px; +} + +.blocklyTreeLabel { + cursor: default; + font: 16px sans-serif; + padding: 0 3px; + vertical-align: middle; +} + +.blocklyToolboxDelete .blocklyTreeLabel { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyTreeSelected .blocklyTreeLabel { + color: #fff; +} +`),l(Ae.TOOLBOX_ITEM,ys.registrationName,ys);var pc=class extends Y${constructor(e,t){super(e,t),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv_=null,Object.assign(this.cssConfig_,e.cssconfig||e.cssConfig)}init(){this.createDom_()}createDom_(){const e=document.createElement("div"),t=this.cssConfig_.container;return t&&I(e,t),this.htmlDiv_=e}getDiv(){return this.htmlDiv_}dispose(){U(this.htmlDiv_)}};pc.registrationName="sep",cs(` +.blocklyTreeSeparator { + border-bottom: solid #e5e5e5 1px; + height: 0; + margin: 5px 0; +} + +.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator { + border-right: solid #e5e5e5 1px; + border-bottom: none; + height: auto; + margin: 0 5px 0 5px; + padding: 5px 0; + width: 0; +} +`),l(Ae.TOOLBOX_ITEM,pc.registrationName,pc);var Kr=class extends ys{constructor(e,t,i){super(e,t,i),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const e=super.makeDefaultCssConfig_();return e.contents="blocklyToolboxContents",e}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else{const t=e.contents;if(t){this.flyoutItems_=[],e=!0;for(let i=0;i>>/handdelete.cur"), auto; +} + +.blocklyToolboxGrab { + cursor: url("<<>>/handclosed.cur"), auto; + cursor: grabbing; + cursor: -webkit-grabbing; +} + +/* Category tree in Toolbox. */ +.blocklyToolboxDiv { + background-color: #ddd; + overflow-x: visible; + overflow-y: auto; + padding: 4px 0 4px 0; + position: absolute; + z-index: 70; /* so blocks go under toolbox when dragging */ + -webkit-tap-highlight-color: transparent; /* issue #1345 */ +} + +.blocklyToolboxContents { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.blocklyToolboxContents:focus { + outline: none; +} +`),l(Ae.TOOLBOX,li,bE);var vE=class extends ru{constructor(e){super(),this.workspace=e,this.id="trashcan",this.contents=[],this.flyout=null,this.isLidOpen=!1,this.minOpenness=0,this.lidTask=this.svgLid=this.svgGroup=null,this.top=this.left=this.lidOpen=0,this.initialized=!1,0>=this.workspace.options.maxTrashcanContents||(e=new hs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===at.TOP?at.BOTTOM:at.TOP,this.flyout=new(y(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===at.RIGHT?at.LEFT:at.RIGHT,this.flyout=new(y(Ae.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=w(te.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=w(te.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),w(te.RECT,{width:Qr,height:uu,y:qr},e);const i=w(te.IMAGE,{width:wo.width,x:-K$,height:wo.height,y:-Q$,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return i.setAttributeNS(us,"xlink:href",this.workspace.options.pathToMedia+wo.url),e=w(te.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),w(te.RECT,{width:Qr,height:qr},e),this.svgLid=w(te.IMAGE,{width:wo.width,x:-K$,height:wo.height,y:-Q$,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(us,"xlink:href",this.workspace.options.pathToMedia+wo.url),wt(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),wt(this.svgGroup,"pointerup",this,this.click),wt(i,"pointerover",this,this.mouseOver),wt(i,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let i;(i=this.flyout)==null||i.show(e),t.cursor="";let r;(r=this.workspace.scrollbar)==null||r.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var i=Ea(this.workspace,e);e=Ta(i,new Vt(Qr,uu+qr),WS,IE,e,this.workspace),t=ba(e,IE,i.vertical===vi.TOP?Qi.DOWN:Qi.UP,t),this.top=t.top,this.left=t.left;var r;(r=this.svgGroup)==null||r.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Bt(this.top,this.top+uu+qr,this.left,this.left+Qr)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Q$-du;return e=e.left+K$-du,new Bt(t,t+qr+uu+2*du,e,e+Qr+2*du)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=jS;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*CE),t=OE+this.lidOpen*(YS-OE),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),XS/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===at.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let i;(i=this.svgLid)==null||i.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:Qr-4)+","+(qr-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*CE)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&this.openFlyout()}fireUiEvent(e){e=new(we(Ir))(e,this.workspace.id),re(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||e.type!==s.DELETE$$module$build$src$core$events$utils||e.type!==s.DELETE$$module$build$src$core$events$utils||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),this.contents.indexOf(e)===-1){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(zS)}}}cleanBlockJson(e){function t(i){if(i){if(delete i.id,delete i.x,delete i.y,delete i.enabled,i.icons&&i.icons.comment){var r=i.icons.comment;delete r.height,delete r.width,delete r.pinned}r=i.inputs;for(var c in r){var $=r[c];const v=$.block;$=$.shadow,v&&t(v),$&&t($)}i.next&&(c=i.next,i=c.block,c=c.shadow,i&&t(i),c&&t(c))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},Qr=47,uu=44,qr=16,IE=20,WS=20,du=10,K$=0,Q$=32,zS=.1,XS=80,jS=4,OE=.4,YS=.8,CE=45,KS="10.1.3",QS=s.Align$$module$build$src$core$inputs$align.LEFT,qS=s.Align$$module$build$src$core$inputs$align.CENTRE,JS=s.Align$$module$build$src$core$inputs$align.RIGHT,ZS=qe.INPUT_VALUE,e9=qe.OUTPUT_VALUE,t9=qe.NEXT_STATEMENT,o9=qe.PREVIOUS_STATEMENT,s9=s.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,i9=at.TOP,n9=at.BOTTOM,r9=at.LEFT,l9=at.RIGHT;dc.prototype.newBlock=function(e,t){return new Hr(this,e,t)},Cs.prototype.newBlock=function(e,t){return new ts(this,e,t)},Cs.newTrashcan=function(e){return new vE(e)},yo.prototype.showContextMenu=function(e){if(!this.workspace.options.readOnly){var t=[];this.isDeletable()&&this.isMovable()&&(t.push(wh(this)),t.push(Nh(this))),wl(e,t,this.RTL)}},gi.prototype.newWorkspaceSvg=function(e){return new Cs(e)},s.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=ga(e),e=e[0].concat(e[1]);for(let t=0;tl.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};d.lists_indexOf=T;var y={init:function(){var g=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(function(k){k=k==="REMOVE",this.getSourceBlock().updateStatement_(k)}),this.appendValueInput("VALUE").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const k=this.getFieldValue("MODE"),W=this.getFieldValue("WHERE");let J="";switch(k+" "+W){case"GET FROM_START":case"GET FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(W==="FROM_START"||W==="FROM_END")&&(J+=" "+(W==="FROM_START"?l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),J})},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");g.setAttribute("statement",String(!this.outputConnection));const k=this.getInput("AT")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(k)),g},domToMutation:function(g){const k=g.getAttribute("statement")==="true";this.updateStatement_(k),g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(g){g.isStatement?this.updateStatement_(!0):typeof g=="string"&&this.domToMutation(l.textToDom$$module$build$src$core$utils$xml(g))},updateStatement_:function(g){g!==!this.outputConnection&&(this.unplug(!0,!0),g?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const k=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});k.setValidator(function(W){const J=W==="FROM_START"||W==="FROM_END";if(J!==g){const Ee=this.getSourceBlock();return Ee.updateAt_(J),Ee.setFieldValue(W,"WHERE"),null}}),this.getInput("AT").appendField(k,"WHERE"),l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};d.lists_getIndex=y;var S={init:function(){var g=[[l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const k=this.getFieldValue("MODE"),W=this.getFieldValue("WHERE");let J="";switch(k+" "+W){case"SET FROM_START":case"SET FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(W==="FROM_START"||W==="FROM_END")&&(J+=" "+l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),J})},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation"),k=this.getInput("AT")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(k)),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const k=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});k.setValidator(function(W){const J=W==="FROM_START"||W==="FROM_END";if(J!==g){const Ee=this.getSourceBlock();return Ee.updateAt_(J),Ee.setFieldValue(W,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(k,"WHERE")}};d.lists_setIndex=S;var P={init:function(){this.WHERE_OPTIONS_1=[[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");var k=this.getInput("AT1")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at1",String(k)),k=this.getInput("AT2")instanceof l.ValueInput$$module$build$src$core$inputs$value_input,g.setAttribute("at2",String(k)),g},domToMutation:function(g){const k=g.getAttribute("at1")==="true";g=g.getAttribute("at2")==="true",this.updateAt_(1,k),this.updateAt_(2,g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g,k){this.removeInput("AT"+g),this.removeInput("ORDINAL"+g,!0),k?(this.appendValueInput("AT"+g).setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+g).appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+g);const W=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+g]});W.setValidator(function(J){const Ee=J==="FROM_START"||J==="FROM_END";if(Ee!==k){const ze=this.getSourceBlock();return ze.updateAt_(g,Ee),ze.setFieldValue(J,"WHERE"+g),null}}),this.getInput("AT"+g).appendField(W,"WHERE"+g),g===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};d.lists_getSublist=P,d.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},d.lists_split={init:function(){const g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[l.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!g)throw Error("field_dropdown not found");g.setValidator(k=>{this.updateType_(k)}),this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(g,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(l.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const k=this.getFieldValue("MODE");if(k==="SPLIT")return l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(k==="JOIN")return l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+k)})},updateType_:function(g){if(this.getFieldValue("MODE")!==g){const k=this.getInput("INPUT").connection;k.setShadowDom(null);const W=k.targetBlock();W&&(k.disconnect(),W.isShadow()?W.dispose(!1):this.bumpNeighbours())}g==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("mode",this.getFieldValue("MODE")),g},domToMutation:function(g){this.updateType_(g.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},l.defineBlocks$$module$build$src$core$common(d);var x={};x.blocks=d;var G=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["≠","NEQ"],["‏<","LT"],["‏≤","LTE"],["‏>","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),oe={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};l.register$$module$build$src$core$extensions("logic_op_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("OP",oe));var ne={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=l.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&g.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&g.setAttribute("else","1"),g},domToMutation:function(g){this.elseifCount_=parseInt(g.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(g.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=Object.create(null);return this.elseifCount_&&(g.elseIfCount=this.elseifCount_),this.elseCount_&&(g.hasElse=!0),g},loadExtraState:function(g){this.elseifCount_=g.elseIfCount||0,this.elseCount_=g.hasElse?1:0,this.updateShape_()},decompose:function(g){const k=g.newBlock("controls_if_if");k.initSvg();let W=k.nextConnection;for(let J=1;J<=this.elseifCount_;J++){const Ee=g.newBlock("controls_if_elseif");Ee.initSvg(),W.connect(Ee.previousConnection),W=Ee.nextConnection}return this.elseCount_&&(g=g.newBlock("controls_if_else"),g.initSvg(),W.connect(g.previousConnection)),k},compose:function(g){g=g.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const k=[null],W=[null];let J=null;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":this.elseifCount_++,k.push(g.valueConnection_),W.push(g.statementConnection_);break;case"controls_if_else":this.elseCount_++,J=g.statementConnection_;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(k,W,J)},saveConnections:function(g){g=g.nextConnection.targetBlock();let k=1;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":var W=this.getInput("IF"+k);const J=this.getInput("DO"+k);g.valueConnection_=W&&W.connection.targetConnection,g.statementConnection_=J&&J.connection.targetConnection,k++;break;case"controls_if_else":W=this.getInput("ELSE"),g.statementConnection_=W&&W.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}},rebuildShape_:function(){const g=[null],k=[null];let W=null;this.getInput("ELSE")&&(W=this.getInput("ELSE").connection.targetConnection);for(let J=1;this.getInput("IF"+J);J++){const Ee=this.getInput("IF"+J),ze=this.getInput("DO"+J);g.push(Ee.connection.targetConnection),k.push(ze.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(g,k,W)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var g=1;this.getInput("IF"+g);g++)this.removeInput("IF"+g),this.removeInput("DO"+g);for(g=1;g<=this.elseifCount_;g++)this.appendValueInput("IF"+g).setCheck("Boolean").appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+g).appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(g,k,W){for(let J=1;J<=this.elseifCount_;J++){let Ee;(Ee=g[J])==null||Ee.reconnect(this,"IF"+J);let ze;(ze=k[J])==null||ze.reconnect(this,"DO"+J)}W==null||W.reconnect(this,"ELSE")}};l.registerMutator$$module$build$src$core$extensions("controls_if_mutator",ne,null,["controls_if_elseif","controls_if_else"]);var Z=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};l.register$$module$build$src$core$extensions("controls_if_tooltip",Z);var Y={onchange:function(g){this.prevBlocks_||(this.prevBlocks_=[null,null]);var k=this.getInputTargetBlock("A");const W=this.getInputTargetBlock("B");k&&W&&!this.workspace.connectionChecker.doTypeChecks(k.outputConnection,W.outputConnection)&&(l.setGroup$$module$build$src$core$events$utils(g.group),g=this.prevBlocks_[0],g!==k&&(k.unplug(),!g||g.isDisposed()||g.isShadow()||this.getInput("A").connection.connect(g.outputConnection)),k=this.prevBlocks_[1],k!==W&&(W.unplug(),!k||k.isDisposed()||k.isShadow()||this.getInput("B").connection.connect(k.outputConnection)),this.bumpNeighbours(),l.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},M=function(){this.mixin(Y)};l.register$$module$build$src$core$extensions("logic_compare",M);var L={prevParentConnection_:null,onchange:function(g){const k=this.getInputTargetBlock("THEN"),W=this.getInputTargetBlock("ELSE"),J=this.outputConnection.targetConnection;if((k||W)&&J)for(let Ee=0;2>Ee;Ee++){const ze=Ee===1?k:W;ze&&!ze.workspace.connectionChecker.doTypeChecks(ze.outputConnection,J)&&(l.setGroup$$module$build$src$core$events$utils(g.group),J===this.prevParentConnection_?(this.unplug(),J.getSourceBlock().bumpNeighbours()):(ze.unplug(),ze.bumpNeighbours()),l.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=J}};l.registerMixin$$module$build$src$core$extensions("logic_ternary",L),l.defineBlocks$$module$build$src$core$common(G);var R=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),F={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};l.register$$module$build$src$core$extensions("controls_whileUntil_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("MODE",F));var z={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};l.register$$module$build$src$core$extensions("controls_flow_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("FLOW",z));var X={customContextMenu:function(g){if(!this.isInFlyout){var k=this.getField("VAR").getVariable(),W=k.name;if(!this.isCollapsed()&&W!==null){k=l.generateVariableFieldDom$$module$build$src$core$variables(k);const J=l.createElement$$module$build$src$core$utils$xml("block");J.setAttribute("type","variables_get"),J.appendChild(k),g.push({enabled:!0,text:l.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",W),callback:l.callbackFactory$$module$build$src$core$contextmenu(this,J)})}}}};l.registerMixin$$module$build$src$core$extensions("contextMenu_newGetVariableBlock",X),l.register$$module$build$src$core$extensions("controls_for_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),l.register$$module$build$src$core$extensions("controls_forEach_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));var le=new Set(["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]),$e={getSurroundLoop:function(){let g=this;do{if(le.has(g.type))return g;g=g.getSurroundParent()}while(g);return null},onchange:function(g){var k=this.workspace;if(k.isDragging&&!k.isDragging()&&g.type===l.MOVE$$module$build$src$core$events$utils&&(k=!!this.getSurroundLoop(),this.setWarningText(k?null:l.Msg$$module$build$src$core$msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout)){const W=l.getGroup$$module$build$src$core$events$utils();l.setGroup$$module$build$src$core$events$utils(g.group),this.setEnabled(k),l.setGroup$$module$build$src$core$events$utils(W)}}};l.registerMixin$$module$build$src$core$extensions("controls_flow_in_loop_check",$e),l.defineBlocks$$module$build$src$core$common(R);var he={};he.blocks=R,he.loopTypes=le;var fe=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),ke={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};l.register$$module$build$src$core$extensions("math_op_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("OP",ke));var re={mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation"),k=this.getFieldValue("PROPERTY")==="DIVISIBLE_BY";return g.setAttribute("divisor_input",String(k)),g},domToMutation:function(g){g=g.getAttribute("divisor_input")==="true",this.updateShape_(g)},updateShape_:function(g){const k=this.getInput("DIVISOR");g?k||this.appendValueInput("DIVISOR").setCheck("Number"):k&&this.removeInput("DIVISOR")}},Ie=function(){this.getField("PROPERTY").setValidator(function(g){g=g==="DIVISIBLE_BY",this.getSourceBlock().updateShape_(g)})};l.registerMutator$$module$build$src$core$extensions("math_is_divisibleby_mutator",re,Ie),l.register$$module$build$src$core$extensions("math_change_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));var D={updateType_:function(g){g==="MODE"?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("op",this.getFieldValue("OP")),g},domToMutation:function(g){if(g=g.getAttribute("op"),g===null)throw new TypeError("xmlElement had no op attribute");this.updateType_(g)}},B=function(){this.getField("OP").setValidator((function(g){this.updateType_(g)}).bind(this))};l.registerMutator$$module$build$src$core$extensions("math_modes_of_list_mutator",D,B),l.defineBlocks$$module$build$src$core$common(fe);var ae={};ae.blocks=fe;var _e={},Me={setStatements_:function(g){this.hasStatements_!==g&&(g?(this.appendStatementInput("STACK").appendField(l.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=g)},updateParams_:function(){let g="";this.arguments_.length&&(g=l.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),l.disable$$module$build$src$core$events$utils();try{this.setFieldValue(g,"PARAMS")}finally{l.enable$$module$build$src$core$events$utils()}},mutationToDom:function(g){const k=l.createElement$$module$build$src$core$utils$xml("mutation");g&&k.setAttribute("name",this.getFieldValue("NAME"));for(let W=0;W{this.updateType_(k)}),this.appendValueInput("TEXT").appendField(g,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var xe=Object.assign({},et,{init:function(){this.mixin(w);var g=[[l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(l.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(k=>{this.updateType_(k)}),this.appendDummyInput().appendField(g,"TYPE").appendField(this.newQuote_(!0)).appendField(l.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});nt.text_prompt=xe,nt.text_count={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},nt.text_replace={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},nt.text_reverse={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var w={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(g){for(let k=0,W;W=this.inputList[k];k++)for(let J=0,Ee;Ee=W.fieldRow[J];J++)if(g===Ee.name){W.insertFieldAt(J,this.newQuote_(!0)),W.insertFieldAt(J+2,this.newQuote_(!1));return}console.warn('field named "'+g+'" not found in '+this.toDevString())},newQuote_:function(g){return g=this.RTL?!g:g,l.fromJson$$module$build$src$core$field_registry({type:"field_image",src:g?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:g?"“":"”"})}},I=function(){this.mixin(w),this.quoteField_("TEXT")},N={itemCount_:0,mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("items",`${this.itemCount_}`),g},domToMutation:function(g){this.itemCount_=parseInt(g.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(g){this.itemCount_=g.itemCount,this.updateShape_()},decompose:function(g){const k=g.newBlock("text_create_join_container");k.initSvg();let W=k.getInput("STACK").connection;for(let J=0;Jl.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},U={isAt_:!1,mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("at",`${this.isAt_}`),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},updateAt_:function(g){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),g&&(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=g}},de=function(){this.getField("WHERE").setValidator(function(g){g=g==="FROM_START"||g==="FROM_END";const k=this.getSourceBlock();g!==k.isAt_&&k.updateAt_(g)}),this.updateAt_(!0),this.setTooltip(()=>{var g=this.getFieldValue("WHERE");let k=l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(g==="FROM_START"||g==="FROM_END")&&(g=g==="FROM_START"?l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(k+=" "+g.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),k})};l.register$$module$build$src$core$extensions("text_indexOf_tooltip",K),l.register$$module$build$src$core$extensions("text_quotes",I),l.registerMutator$$module$build$src$core$extensions("text_join_mutator",N,A),l.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",U,de),l.defineBlocks$$module$build$src$core$common(nt);var Te={};Te.blocks=nt;var se=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),Ce={customContextMenu:function(g){if(this.isInFlyout)(this.type==="variables_get"||this.type==="variables_get_reporter")&&(k={text:l.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:ce(this)},W=this.getField("VAR").getText(),W={text:l.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",W),enabled:!0,callback:Se(this)},g.unshift(k),g.unshift(W));else{if(this.type==="variables_get")var k="variables_set",W=l.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else k="variables_get",W=l.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;const J=this.getField("VAR").getText(),Ee=l.createElement$$module$build$src$core$utils$xml("field");Ee.setAttribute("name","VAR"),Ee.appendChild(l.createTextNode$$module$build$src$core$utils$xml(J));const ze=l.createElement$$module$build$src$core$utils$xml("block");ze.setAttribute("type",k),ze.appendChild(Ee),g.push({enabled:0 String(b) ? 1 : -1; }, + 'IGNORE_CASE': function(a, b) { + return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, + }; + var compare = compareFuncs[type]; + return function(a, b) { return compare(a, b) * direction; }; +} + `),[C+".slice().sort("+m+'("'+_+'", '+V+"))",E.FUNCTION_CALL]},Z=function(_,m){let C=m.valueToCode(_,"INPUT",E.MEMBER);if(m=m.valueToCode(_,"DELIM",E.NONE)||"''",_=_.getFieldValue("MODE"),_==="SPLIT")C||(C="''"),_="split";else if(_==="JOIN")C||(C="[]"),_="join";else throw Error("Unknown mode: "+_);return[C+"."+_+"("+m+")",E.FUNCTION_CALL]},Y=function(_,m){return[(m.valueToCode(_,"LIST",E.FUNCTION_CALL)||"[]")+".slice().reverse()",E.FUNCTION_CALL]},M=function(_,m){var C=0;let V="";m.STATEMENT_PREFIX&&(V+=m.injectId(m.STATEMENT_PREFIX,_));do{const ve=m.valueToCode(_,"IF"+C,E.NONE)||"false";let Ge=m.statementToCode(_,"DO"+C);m.STATEMENT_SUFFIX&&(Ge=m.prefixLines(m.injectId(m.STATEMENT_SUFFIX,_),m.INDENT)+Ge),V+=(0",GTE:">="}[_.getFieldValue("OP")],V=C==="=="||C==="!="?E.EQUALITY:E.RELATIONAL,ve=m.valueToCode(_,"A",V)||"0";return _=m.valueToCode(_,"B",V)||"0",[ve+" "+C+" "+_,V]},R=function(_,m){const C=_.getFieldValue("OP")==="AND"?"&&":"||",V=C==="&&"?E.LOGICAL_AND:E.LOGICAL_OR;let ve=m.valueToCode(_,"A",V);return _=m.valueToCode(_,"B",V),ve||_?(m=C==="&&"?"true":"false",ve||(ve=m),_||(_=m)):_=ve="false",[ve+" "+C+" "+_,V]},F=function(_,m){const C=E.LOGICAL_NOT;return["!"+(m.valueToCode(_,"BOOL",C)||"true"),C]},z=function(_,m){return[_.getFieldValue("BOOL")==="TRUE"?"true":"false",E.ATOMIC]},X=function(_,m){return["null",E.ATOMIC]},le=function(_,m){const C=m.valueToCode(_,"IF",E.CONDITIONAL)||"false",V=m.valueToCode(_,"THEN",E.CONDITIONAL)||"null";return _=m.valueToCode(_,"ELSE",E.CONDITIONAL)||"null",[C+" ? "+V+" : "+_,E.CONDITIONAL]},$e=function(_,m){let C;C=_.getField("TIMES")?String(Number(_.getFieldValue("TIMES"))):m.valueToCode(_,"TIMES",E.ASSIGNMENT)||"0";let V=m.statementToCode(_,"DO");V=m.addLoopTrap(V,_),_="";const ve=m.nameDB_.getDistinctName("count",l.NameType$$module$build$src$core$names.VARIABLE);let Ge=C;return C.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(C)||(Ge=m.nameDB_.getDistinctName("repeat_end",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Ge+" = "+C+`; +`),_+("for (var "+ve+" = 0; "+ve+" < "+Ge+"; "+ve+`++) { +`+V+`} +`)},he=function(_,m){const C=_.getFieldValue("MODE")==="UNTIL";let V=m.valueToCode(_,"BOOL",C?E.LOGICAL_NOT:E.NONE)||"false",ve=m.statementToCode(_,"DO");return ve=m.addLoopTrap(ve,_),C&&(V="!"+V),"while ("+V+`) { +`+ve+`} +`},fe=function(_,m){var C=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),V=m.valueToCode(_,"FROM",E.ASSIGNMENT)||"0",ve=m.valueToCode(_,"TO",E.ASSIGNMENT)||"0";const Ge=m.valueToCode(_,"BY",E.ASSIGNMENT)||"1";let rt=m.statementToCode(_,"DO");if(rt=m.addLoopTrap(rt,_),l.isNumber$$module$build$src$core$utils$string(V)&&l.isNumber$$module$build$src$core$utils$string(ve)&&l.isNumber$$module$build$src$core$utils$string(Ge))m=Number(V)<=Number(ve),_="for ("+C+" = "+V+"; "+C+(m?" <= ":" >= ")+ve+"; "+C,C=Math.abs(Number(Ge)),_=C===1?_+(m?"++":"--"):_+((m?" += ":" -= ")+C),_+=`) { +`+rt+`} +`;else{_="";let Mt=V;V.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(V)||(Mt=m.nameDB_.getDistinctName(C+"_start",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Mt+" = "+V+`; +`),V=ve,ve.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(ve)||(V=m.nameDB_.getDistinctName(C+"_end",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+V+" = "+ve+`; +`),ve=m.nameDB_.getDistinctName(C+"_inc",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+ve+" = ",_=l.isNumber$$module$build$src$core$utils$string(Ge)?_+(Math.abs(Ge)+`; +`):_+("Math.abs("+Ge+`); +`),_+="if ("+Mt+" > "+V+`) { +`,_+=m.INDENT+ve+" = -"+ve+`; +`,_=_+`} +for (`+(C+" = "+Mt+"; "+ve+" >= 0 ? "+C+" <= "+V+" : "+C+" >= "+V+"; "+C+" += "+ve+`) { +`+rt+`} +`)}return _},ke=function(_,m){const C=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE);var V=m.valueToCode(_,"LIST",E.ASSIGNMENT)||"[]";let ve=m.statementToCode(_,"DO");ve=m.addLoopTrap(ve,_),_="";let Ge=V;return V.match(/^\w+$/)||(Ge=m.nameDB_.getDistinctName(C+"_list",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Ge+" = "+V+`; +`),V=m.nameDB_.getDistinctName(C+"_index",l.NameType$$module$build$src$core$names.VARIABLE),ve=m.INDENT+C+" = "+Ge+"["+V+`]; +`+ve,_+("for (var "+V+" in "+Ge+`) { +`+ve+`} +`)},re=function(_,m){let C="";if(m.STATEMENT_PREFIX&&(C+=m.injectId(m.STATEMENT_PREFIX,_)),m.STATEMENT_SUFFIX&&(C+=m.injectId(m.STATEMENT_SUFFIX,_)),m.STATEMENT_PREFIX){const V=_.getSurroundLoop();V&&!V.suppressPrefixSuffix&&(C+=m.injectId(m.STATEMENT_PREFIX,V))}switch(_.getFieldValue("FLOW")){case"BREAK":return C+`break; +`;case"CONTINUE":return C+`continue; +`}throw Error("Unknown flow statement.")},Ie=function(_,m){return _=Number(_.getFieldValue("NUM")),[_,0<=_?E.ATOMIC:E.UNARY_NEGATION]},D=function(_,m){var C={ADD:[" + ",E.ADDITION],MINUS:[" - ",E.SUBTRACTION],MULTIPLY:[" * ",E.MULTIPLICATION],DIVIDE:[" / ",E.DIVISION],POWER:[null,E.NONE]}[_.getFieldValue("OP")];const V=C[0];C=C[1];const ve=m.valueToCode(_,"A",C)||"0";return _=m.valueToCode(_,"B",C)||"0",V?[ve+V+_,C]:["Math.pow("+ve+", "+_+")",E.FUNCTION_CALL]},B=function(_,m){const C=_.getFieldValue("OP");let V;if(C==="NEG")return _=m.valueToCode(_,"NUM",E.UNARY_NEGATION)||"0",_[0]==="-"&&(_=" "+_),["-"+_,E.UNARY_NEGATION];switch(_=C==="SIN"||C==="COS"||C==="TAN"?m.valueToCode(_,"NUM",E.DIVISION)||"0":m.valueToCode(_,"NUM",E.NONE)||"0",C){case"ABS":V="Math.abs("+_+")";break;case"ROOT":V="Math.sqrt("+_+")";break;case"LN":V="Math.log("+_+")";break;case"EXP":V="Math.exp("+_+")";break;case"POW10":V="Math.pow(10,"+_+")";break;case"ROUND":V="Math.round("+_+")";break;case"ROUNDUP":V="Math.ceil("+_+")";break;case"ROUNDDOWN":V="Math.floor("+_+")";break;case"SIN":V="Math.sin("+_+" / 180 * Math.PI)";break;case"COS":V="Math.cos("+_+" / 180 * Math.PI)";break;case"TAN":V="Math.tan("+_+" / 180 * Math.PI)"}if(V)return[V,E.FUNCTION_CALL];switch(C){case"LOG10":V="Math.log("+_+") / Math.log(10)";break;case"ASIN":V="Math.asin("+_+") / Math.PI * 180";break;case"ACOS":V="Math.acos("+_+") / Math.PI * 180";break;case"ATAN":V="Math.atan("+_+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+C)}return[V,E.DIVISION]},ae=function(_,m){return{PI:["Math.PI",E.MEMBER],E:["Math.E",E.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",E.DIVISION],SQRT2:["Math.SQRT2",E.MEMBER],SQRT1_2:["Math.SQRT1_2",E.MEMBER],INFINITY:["Infinity",E.ATOMIC]}[_.getFieldValue("CONSTANT")]},_e=function(_,m){var C={EVEN:[" % 2 === 0",E.MODULUS,E.EQUALITY],ODD:[" % 2 === 1",E.MODULUS,E.EQUALITY],WHOLE:[" % 1 === 0",E.MODULUS,E.EQUALITY],POSITIVE:[" > 0",E.RELATIONAL,E.RELATIONAL],NEGATIVE:[" < 0",E.RELATIONAL,E.RELATIONAL],DIVISIBLE_BY:[null,E.MODULUS,E.EQUALITY],PRIME:[null,E.NONE,E.FUNCTION_CALL]};const V=_.getFieldValue("PROPERTY"),[ve,Ge,rt]=C[V];return C=m.valueToCode(_,"NUMBER_TO_CHECK",Ge)||"0",V==="PRIME"?_=m.provideFunction_("mathIsPrime",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(n) { + // https://en.wikipedia.org/wiki/Primality_test#Naive_methods + if (n == 2 || n == 3) { + return true; + } + // False if n is NaN, negative, is 1, or not whole. + // And false if n is divisible by 2 or 3. + if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) { + return false; + } + // Check all the numbers of form 6k +/- 1, up to sqrt(n). + for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) { + if (n % (x - 1) === 0 || n % (x + 1) === 0) { + return false; + } + } + return true; +} +`)+"("+C+")":V==="DIVISIBLE_BY"?(_=m.valueToCode(_,"DIVISOR",E.MODULUS)||"0",_=C+" % "+_+" === 0"):_=C+ve,[_,rt]},Me=function(_,m){const C=m.valueToCode(_,"DELTA",E.ADDITION)||"0";return _=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),_+" = (typeof "+_+" === 'number' ? "+_+" : 0) + "+C+`; +`},Xe=function(_,m){var C=_.getFieldValue("OP");switch(C){case"SUM":_=m.valueToCode(_,"LIST",E.MEMBER)||"[]",_+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":_=m.valueToCode(_,"LIST",E.NONE)||"[]",_="Math.min.apply(null, "+_+")";break;case"MAX":_=m.valueToCode(_,"LIST",E.NONE)||"[]",_="Math.max.apply(null, "+_+")";break;case"AVERAGE":C=m.provideFunction_("mathMean",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(myList) { + return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=C+"("+_+")";break;case"MEDIAN":C=m.provideFunction_("mathMedian",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(myList) { + var localList = myList.filter(function (x) {return typeof x === 'number';}); + if (!localList.length) return null; + localList.sort(function(a, b) {return b - a;}); + if (localList.length % 2 === 0) { + return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2; + } else { + return localList[(localList.length - 1) / 2]; + } +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=C+"("+_+")";break;case"MODE":C=m.provideFunction_("mathModes",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(values) { + var modes = []; + var counts = []; + var maxCount = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + var found = false; + var thisCount; + for (var j = 0; j < counts.length; j++) { + if (counts[j][0] === value) { + thisCount = ++counts[j][1]; + found = true; + break; + } + } + if (!found) { + counts.push([value, 1]); + thisCount = 1; + } + maxCount = Math.max(thisCount, maxCount); + } + for (var j = 0; j < counts.length; j++) { + if (counts[j][1] === maxCount) { + modes.push(counts[j][0]); + } + } + return modes; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=C+"("+_+")";break;case"STD_DEV":C=m.provideFunction_("mathStandardDeviation",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(numbers) { + var n = numbers.length; + if (!n) return null; + var mean = numbers.reduce(function(x, y) {return x + y;}) / n; + var variance = 0; + for (var j = 0; j < n; j++) { + variance += Math.pow(numbers[j] - mean, 2); + } + variance = variance / n; + return Math.sqrt(variance); +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=C+"("+_+")";break;case"RANDOM":C=m.provideFunction_("mathRandomList",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(list) { + var x = Math.floor(Math.random() * list.length); + return list[x]; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=C+"("+_+")";break;default:throw Error("Unknown operator: "+C)}return[_,E.FUNCTION_CALL]},Je=function(_,m){const C=m.valueToCode(_,"DIVIDEND",E.MODULUS)||"0";return _=m.valueToCode(_,"DIVISOR",E.MODULUS)||"0",[C+" % "+_,E.MODULUS]},we=function(_,m){const C=m.valueToCode(_,"VALUE",E.NONE)||"0",V=m.valueToCode(_,"LOW",E.NONE)||"0";return _=m.valueToCode(_,"HIGH",E.NONE)||"Infinity",["Math.min(Math.max("+C+", "+V+"), "+_+")",E.FUNCTION_CALL]},We=function(_,m){const C=m.valueToCode(_,"FROM",E.NONE)||"0";return _=m.valueToCode(_,"TO",E.NONE)||"0",[m.provideFunction_("mathRandomInt",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(a, b) { + if (a > b) { + // Swap a and b to ensure a is smaller. + var c = a; + a = b; + b = c; + } + return Math.floor(Math.random() * (b - a + 1) + a); +} +`)+"("+C+", "+_+")",E.FUNCTION_CALL]},Ze=function(_,m){return["Math.random()",E.FUNCTION_CALL]},nt=function(_,m){const C=m.valueToCode(_,"X",E.NONE)||"0";return["Math.atan2("+(m.valueToCode(_,"Y",E.NONE)||"0")+", "+C+") / Math.PI * 180",E.DIVISION]},ht=function(_,m){const C=m.nameDB_.getName(_.getFieldValue("NAME"),l.NameType$$module$build$src$core$names.PROCEDURE);var V="";m.STATEMENT_PREFIX&&(V+=m.injectId(m.STATEMENT_PREFIX,_)),m.STATEMENT_SUFFIX&&(V+=m.injectId(m.STATEMENT_SUFFIX,_)),V&&(V=m.prefixLines(V,m.INDENT));let ve="";m.INFINITE_LOOP_TRAP&&(ve=m.prefixLines(m.injectId(m.INFINITE_LOOP_TRAP,_),m.INDENT));const Ge=m.statementToCode(_,"STACK");let rt=m.valueToCode(_,"RETURN",E.NONE)||"",Mt="";Ge&&rt&&(Mt=V),rt&&(rt=m.INDENT+"return "+rt+`; +`);const po=[],Be=_.getVars();for(let wt=0;wtC?rt=Mt=this.ORDER_SUBTRACTION:V&&(rt=Mt=this.ORDER_UNARY_NEGATION),_=this.valueToCode(_,m,Mt)||Ge,l.isNumber$$module$build$src$core$utils$string(_)?(_=Number(_)+C,V&&(_=-_)):(0C&&(_=_+" - "+-C),V&&(_=C?"-("+_+")":"-"+_),rt=Math.floor(rt),ve=Math.floor(ve),rt&&ve>=rt&&(_="("+_+")")),_}},k={};k.colour_blend=h,k.colour_picker=a,k.colour_random=u,k.colour_rgb=d;var W=function(_,m,C){return m==="FIRST"?"0":m==="FROM_END"?_+".length - 1 - "+C:m==="LAST"?_+".length - 1":C},J={};J.lists_create_empty=p,J.lists_create_with=f,J.lists_getIndex=x,J.lists_getSublist=oe,J.lists_indexOf=P,J.lists_isEmpty=S,J.lists_length=y,J.lists_repeat=T,J.lists_reverse=Y,J.lists_setIndex=G,J.lists_sort=ne,J.lists_split=Z;var Ee={};Ee.controls_if=M,Ee.controls_ifelse=M,Ee.logic_boolean=z,Ee.logic_compare=L,Ee.logic_negate=F,Ee.logic_null=X,Ee.logic_operation=R,Ee.logic_ternary=le;var ze={};ze.controls_flow_statements=re,ze.controls_for=fe,ze.controls_forEach=ke,ze.controls_repeat=$e,ze.controls_repeat_ext=$e,ze.controls_whileUntil=he;var yt={};yt.math_arithmetic=D,yt.math_atan2=nt,yt.math_change=Me,yt.math_constant=ae,yt.math_constrain=we,yt.math_modulo=Je,yt.math_number=Ie,yt.math_number_property=_e,yt.math_on_list=Xe,yt.math_random_float=Ze,yt.math_random_int=We,yt.math_round=B,yt.math_single=B,yt.math_trig=B;var ls={};ls.procedures_callnoreturn=xe,ls.procedures_callreturn=et,ls.procedures_defnoreturn=ht,ls.procedures_defreturn=ht,ls.procedures_ifreturn=w;var ii=/^\s*'([^']|\\')*'\s*$/,xt=function(_){return ii.test(_)?[_,E.ATOMIC]:["String("+_+")",E.FUNCTION_CALL]},Qo=function(_,m,C){return m==="FIRST"?"0":m==="FROM_END"?_+".length - 1 - "+C:m==="LAST"?_+".length - 1":C},Ht={};Ht.text=I,Ht.text_append=K,Ht.text_changeCase=ce,Ht.text_charAt=se,Ht.text_count=be,Ht.text_getSubstring=Ce,Ht.text_indexOf=Te,Ht.text_isEmpty=de,Ht.text_join=A,Ht.text_length=U,Ht.text_multiline=N,Ht.text_print=Ne,Ht.text_prompt=He,Ht.text_prompt_ext=He,Ht.text_replace=ee,Ht.text_reverse=ie,Ht.text_trim=Se;var ws={};ws.variables_get=ue,ws.variables_set=ye;var qo={};qo.variables_get_dynamic=ue,qo.variables_set_dynamic=ye;var b=new g;Object.assign(b.forBlock,k,J,Ee,ze,yt,ls,Ht,ws,qo);var O={};return O.JavascriptGenerator=g,O.Order=E,O.javascriptGenerator=b,O.__namespace__=l,O})}(d0)),d0.exports}var Mb;function o8(){return Mb||(Mb=1,function(o,n){(function(s,l){o.exports=l(Gc(),t8())})(Do,function(s,l){/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return l})}(u0)),u0.exports}var Db;function s8(){return Db||(Db=1,function(o,n){(function(s,l){o.exports=l(Gc(),J5(),e8(),o8())})(Do,function(s,l,a,u){return s.setLocale(l),s})}(s0)),s0.exports}(function(o,n){(function(s,l){o.exports=l(s8())})(Do,function(s){/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return s})})(e2);var i8=e2.exports;const Tt=CI(i8);Tt.defineBlocksWithJsonArray([{type:"controls_forever",message0:"%1",args0:[{type:"field_label",text:"永远 循环"}],message1:"%1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"controller",tooltip:"重复执行。"},{type:"math_evenly_divisible",message0:"%1 能被 %2 整除",args0:[{type:"input_value",name:"DIVIDEND",check:"Number",value:0},{type:"input_value",name:"DIVISOR",check:"Number",value:0}],output:"Boolean",style:"calculation",tooltip:"判断第一个数是否恰好被第二个数整除。"},{type:"lists_split",message0:"把 %1 按 %2 %3",args0:[{type:"input_value",name:"INPUT",check:["String","Array"]},{type:"input_value",name:"DELIM",check:"String"},{type:"field_dropdown",name:"MODE",options:[["分开成列表","SPLIT"],["合并为文本","JOIN"]]}],output:["String","Array"],style:"calculation",tooltip:"将文本分开成列表或将列表合并为文本。"},{type:"text_charAt",message0:"取 %1 %2 第 %3 个字符",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],output:"String",style:"calculation",tooltip:"取文本指定位置的字符。"},{type:"text_getSubstring",message0:"取 %1 %2 第 %3 到 %4 第 %5 个字符",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE1",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX1",check:"Number"},{type:"field_dropdown",name:"WHERE2",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX2",check:"Number"}],output:"String",style:"calculation",tooltip:"取文本指定位置的字符。"},{type:"math_types",message0:"把 %1 转换为 %2 类型",args0:[{type:"input_value",name:"VALUE"},{type:"field_dropdown",name:"TYPE",options:[["字符串","STRING"],["数值","NUMBER"],["布尔","BOOLEAN"]]}],output:"String",style:"calculation",tooltip:"将对象转换为指定类型。"},{type:"lists_push",message0:"添加 %1 到 %2 末尾",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"添加值到列表的末尾。"},{type:"lists_insert",message0:"插入 %1 到 %2 %3 第 %4 项后面",args0:[{type:"input_value",name:"VALUE"},{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"添加值到列表的末尾。"},{type:"lists_delete",message0:"删除 %1 %2 第 %3 项",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],previousStatement:null,nextStatement:null,style:"lists_delete",tooltip:"删除列表的指定项。"},{type:"lists_set",message0:"替换 %1 %2 第 %3 项为 %4",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"替换列表的指定项。"},{type:"lists_get",message0:"%1 %2 第 %3 项",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],output:"Any",style:"lists",tooltip:"获取列表的指定项。"},{type:"lists_index",message0:"%1 中 %2 %3 的位置",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHICH",options:[["第一个","FIRST"],["最后一个","LAST"]]},{type:"input_value",name:"VALUE"}],output:"Number",style:"lists",tooltip:"返回在列表中的第一个/最后一个匹配项的索引值,如果找不到项目则返回列表本身。"},{type:"lists_includes",message0:"%1 中包含 %2",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"input_value",name:"VALUE"}],output:"Boolean",style:"lists",tooltip:"列表中是否包含指定项。"},{type:"time_current",message0:"当前时间戳",output:"Number",style:"time",tooltip:"获取当前时间戳。"},{type:"time_timestamp_to_date",message0:"时间戳 %1 转换为日期字符串",args0:[{type:"input_value",name:"TIMESTAMP",check:"Number"}],output:"String",style:"time",tooltip:"将时间戳转换为日期字符串。"},{type:"time_import",message0:"引入time库",previousStatement:null,nextStatement:null,style:"time",tooltip:"引入时间库。"},{type:"sqlite_open",message0:"打开数据库 %1",args0:[{type:"input_value",name:"DATABASE",check:"String"}],output:"sqlite3.Connection",style:"sqlite",tooltip:"打开数据库连接。"},{type:"sqlite_query",message0:"执行查询 %1",args0:[{type:"input_value",name:"QUERY",check:"String"}],output:"sqlite3.Cursor",style:"sqlite",tooltip:"执行SQL查询。"},{type:"sqlite_exec",message0:"执行命令 %1",args0:[{type:"input_value",name:"COMMAND",check:"String"}],previousStatement:null,nextStatement:null,style:"sqlite",tooltip:"执行SQL命令。"},{type:"sqlite_close",message0:"关闭数据库连接",previousStatement:null,nextStatement:null,style:"sqlite",tooltip:"关闭数据库连接。"},{type:"http_import",message0:"引入http库",previousStatement:null,nextStatement:null,style:"http",tooltip:"引入HTTP库。"},{type:"http_get",message0:"发送GET请求到 链接:%1 请求头(字典):%2 cookie(字典):%3",args0:[{type:"input_value",name:"URL",check:"String"},{type:"input_value",name:"HEADERS",check:"Array"},{type:"input_value",name:"COOKIES",check:"Array"}],output:"String",style:"http",tooltip:"发送GET请求。"},{type:"http_post",message0:"发送POST请求到 链接:%1 请求体(字典):%2 请求头(字典):%3 cookie(字典):%4",args0:[{type:"input_value",name:"URL",check:"String"},{type:"input_value",name:"BODY",check:"Array"},{type:"input_value",name:"HEADERS",check:"Array"},{type:"input_value",name:"COOKIES",check:"Array"}],output:"String",style:"http",tooltip:"发送POST请求。"},{type:"dict_get",message0:"获取字典 %1 的键 %2 的值",args0:[{type:"input_value",name:"DICT",check:"Array"},{type:"input_value",name:"KEY",check:"String"}],output:"Any",style:"dict",tooltip:"获取字典的指定键的值。"},{type:"dict_create",message0:"创建字典",output:"Array",style:"dict",tooltip:"创建一个空字典。"},{type:"dict_set",message0:"设置字典 %1 的键 %2 的值为 %3",args0:[{type:"input_value",name:"DICT",check:"Array"},{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"dict",tooltip:"设置字典的指定键的值。"},{type:"set_dict",message0:"创建字典 键 %1 : %2",args0:[{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VALUE"}],output:"Array",style:"dict",tooltip:"创建一个空字典。"}]);const n8="categoryToolbox",r8=[{kind:"category",name:"控制",categorystyle:"controller",contents:[{kind:"block",type:"controls_forever"},{kind:"block",type:"controls_repeat_ext",inputs:{TIMES:{block:{type:"math_number",fields:{NUM:1}}}}},{kind:"block",type:"controls_for",inputs:{FROM:{block:{type:"math_number",fields:{NUM:1}}},TO:{block:{type:"math_number",fields:{NUM:10}}},BY:{block:{type:"math_number",fields:{NUM:1}}}}},{kind:"block",type:"controls_forEach"},{kind:"block",type:"controls_whileUntil"},{kind:"block",type:"controls_flow_statements"},{kind:"sep",gap:"64"},{kind:"block",type:"controls_if"},{kind:"block",type:"controls_if",extraState:{hasElse:!0}},{kind:"sep",gap:"64"},{kind:"block",type:"logic_ternary",inline:"true"}]},{kind:"category",name:"运算",categorystyle:"calculation",contents:[{kind:"block",type:"math_number",fields:{NUM:0}},{kind:"block",type:"math_arithmetic",inputs:{A:{block:{type:"math_number",fields:{NUM:0}}},B:{block:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"math_random_int",inputs:{FROM:{block:{type:"math_number",fields:{NUM:0}}},TO:{block:{type:"math_number",fields:{NUM:5}}}}},{kind:"sep",gap:"64"},{kind:"block",type:"logic_boolean"},{kind:"block",type:"logic_compare"},{kind:"block",type:"logic_operation"},{kind:"block",type:"logic_negate"},{kind:"sep",gap:"64"},{kind:"block",type:"math_round"},{kind:"block",type:"math_modulo"},{kind:"block",type:"math_evenly_divisible",inputs:{DIVIDEND:{block:{type:"math_number",fields:{NUM:9}}},DIVISOR:{block:{type:"math_number",fields:{NUM:3}}}}},{kind:"block",type:"math_number_property"},{kind:"block",type:"math_trig"},{kind:"block",type:"math_single"},{kind:"sep",gap:"64"},{kind:"block",type:"text"},{kind:"block",type:"text_join",inline:"true",extraState:{itemCount:2}},{kind:"block",type:"lists_split"},{kind:"block",type:"text_indexOf"},{kind:"block",type:"text_charAt"},{kind:"block",type:"text_getSubstring"},{kind:"block",type:"text_replace"},{kind:"block",type:"text_count"},{kind:"block",type:"text_length"},{kind:"block",type:"text_changeCase"},{kind:"block",type:"text_trim"},{kind:"block",type:"math_types"}]},{kind:"category",name:"变量",categorystyle:"variable",custom:"VARIABLE",contents:[{kind:"block",type:"variables_set"},{kind:"block",type:"math_change"},{kind:"block",type:"variables_get"}]},{kind:"category",name:"列表",categorystyle:"list",contents:[{kind:"block",type:"lists_create_empty"},{kind:"block",type:"lists_create_with",inline:"true",extraState:{itemCount:1}},{kind:"block",type:"lists_push"},{kind:"block",type:"lists_insert"},{kind:"block",type:"lists_delete"},{kind:"block",type:"lists_set"},{kind:"sep",gap:"64"},{kind:"block",type:"lists_get"},{kind:"block",type:"lists_length"},{kind:"block",type:"lists_index"},{kind:"block",type:"lists_includes"}]},{kind:"category",name:"字典",categorystyle:"dict",contents:[{kind:"block",type:"set_dict",inline:"true",extraState:{itemCount:1}},{kind:"block",type:"dict_get"},{kind:"block",type:"dict_create"},{kind:"block",type:"dict_set"}]},{kind:"category",name:"函数",categorystyle:"function",custom:"PROCEDURE",contents:[{kind:"block",type:"procedures_defnoreturn"},{kind:"block",type:"procedures_defreturn"}]},{kind:"category",name:"时间",categorystyle:"time",contents:[{kind:"block",type:"time_import"},{kind:"block",type:"time_current"},{kind:"block",type:"time_timestamp_to_date"}]},{kind:"category",name:"HTTP",categorystyle:"http",contents:[{kind:"block",type:"http_import"},{kind:"block",type:"http_get"},{kind:"block",type:"http_post"}]},{kind:"category",name:"Sqlite",categorystyle:"sqlite",contents:[{kind:"block",type:"sqlite_open"},{kind:"block",type:"sqlite_query"},{kind:"block",type:"sqlite_exec"},{kind:"block",type:"sqlite_close"}]}],t2={kind:n8,contents:r8};function tn(o,n){const s=Tt.Blocks[o].init;Tt.Blocks[o].init=function(){s.bind(this)(),this.setStyle(n),this.inputsInline=!0}}t2.contents.forEach(function(o){if("contents"in o){let n=o.categorystyle;o.contents.forEach(function(s){s.kind==="block"&&tn(s.type,n)})}else console.warn("This category is empty. ","If you are using a custom approach, ","please list all possible blocks in contents for a unified format.")});Tt.Theme.defineTheme("codemao",{base:Tt.Themes.Zelos,blockStyles:{controller:{colourPrimary:"#68cdff",colourTertiary:"#5db8e5"},calculation:{colourPrimary:"#feae8a",colourTertiary:"#e49c7c"},function:{colourPrimary:"#f88767",colourTertiary:"#df795c"},utility:{colourPrimary:"#00afc3",colourTertiary:"#009daf"},variable:{colourPrimary:"#ffbb55",colourTertiary:"#e5a84c"},list:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},time:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},dictionary:{colourPrimary:"#a073ff",colourTertiary:"#9067e5"},color:{colourPrimary:"#2bc9a7",colourTertiary:"#19b693"},http:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},sqlite:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},dict:{colourPrimary:"#a073ff",colourTertiary:"#9067e5"}},categoryStyles:{controller:{colour:"#01adff"},calculation:{colour:"#f0aa8b"},function:{colour:"#f88767"},utility:{colour:"#5ab45b"},variable:{colour:"#ffbb55"},list:{colour:"#ff9c37"},dictionary:{colour:"#2bc9a7"},time:{colour:"#f9cc37"},color:{colour:"#2bc9a7"},http:{colour:"#f9cc37"},sqlite:{colour:"#f9cc37"},dict:{colour:"#a073ff"}}});class l8 extends Tt.zelos.ConstantProvider{constructor(){super(),this.NOTCH_WIDTH=0,this.NOTCH_HEIGHT=8,this.CORNER_RADIUS=4,this.FIELD_TEXT_FONTSIZE=13,this.FIELD_TEXT_FONTWEIGHT="500",this.TOP_ROW_MIN_HEIGHT=2,this.BOTTOM_ROW_MIN_HEIGHT=2,this.SELECTED_GLOW_COLOUR="#4062f6",this.REPLACEMENT_GLOW_COLOUR="#4062f6"}makeNotch(){function l(d){return Tt.utils.svgPaths.line([Tt.utils.svgPaths.point(0,0),Tt.utils.svgPaths.point(d*0,0),Tt.utils.svgPaths.point(0,-0)])}const a=l(1),u=l(-1);return{width:0,height:0+this.NOTCH_HEIGHT,pathLeft:a,pathRight:u}}}class c8 extends Tt.zelos.Renderer{constructor(n){super(n)}makeConstants_(){return new l8}}Tt.blockRendering.register("codemao",c8);var o2={exports:{}},h0={exports:{}},Pb;function a8(){return Pb||(Pb=1,function(o,n){(function(s,l){o.exports=l(_d())})(Do,function(s){var l=s.__namespace__,a=function(b,O){return[O.quote_(b.getFieldValue("COLOUR")),E.ATOMIC]},u=function(b,O){return O.definitions_.import_random="import random",["'#%06x' % random.randint(0, 2**24 - 1)",E.FUNCTION_CALL]},d=function(b,O){const _=O.provideFunction_("colour_rgb",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(r, g, b): + r = round(min(100, max(0, r)) * 2.55) + g = round(min(100, max(0, g)) * 2.55) + b = round(min(100, max(0, b)) * 2.55) + return '#%02x%02x%02x' % (r, g, b) +`),m=O.valueToCode(b,"RED",E.NONE)||0,C=O.valueToCode(b,"GREEN",E.NONE)||0;return b=O.valueToCode(b,"BLUE",E.NONE)||0,[_+"("+m+", "+C+", "+b+")",E.FUNCTION_CALL]},h=function(b,O){const _=O.provideFunction_("colour_blend",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(colour1, colour2, ratio): + r1, r2 = int(colour1[1:3], 16), int(colour2[1:3], 16) + g1, g2 = int(colour1[3:5], 16), int(colour2[3:5], 16) + b1, b2 = int(colour1[5:7], 16), int(colour2[5:7], 16) + ratio = min(1, max(0, ratio)) + r = round(r1 * (1 - ratio) + r2 * ratio) + g = round(g1 * (1 - ratio) + g2 * ratio) + b = round(b1 * (1 - ratio) + b2 * ratio) + return '#%02x%02x%02x' % (r, g, b) +`),m=O.valueToCode(b,"COLOUR1",E.NONE)||"'#000000'",C=O.valueToCode(b,"COLOUR2",E.NONE)||"'#000000'";return b=O.valueToCode(b,"RATIO",E.NONE)||0,[_+"("+m+", "+C+", "+b+")",E.FUNCTION_CALL]},p=function(b,O){return["[]",E.ATOMIC]},f=function(b,O){const _=Array(b.itemCount_);for(let m=0;m",GTE:">="}[b.getFieldValue("OP")],m=E.RELATIONAL,C=O.valueToCode(b,"A",m)||"0";return b=O.valueToCode(b,"B",m)||"0",[C+" "+_+" "+b,m]},R=function(b,O){const _=b.getFieldValue("OP")==="AND"?"and":"or",m=_==="and"?E.LOGICAL_AND:E.LOGICAL_OR;let C=O.valueToCode(b,"A",m);return b=O.valueToCode(b,"B",m),C||b?(O=_==="and"?"True":"False",C||(C=O),b||(b=O)):b=C="False",[C+" "+_+" "+b,m]},F=function(b,O){return["not "+(O.valueToCode(b,"BOOL",E.LOGICAL_NOT)||"True"),E.LOGICAL_NOT]},z=function(b,O){return[b.getFieldValue("BOOL")==="TRUE"?"True":"False",E.ATOMIC]},X=function(b,O){return["None",E.ATOMIC]},le=function(b,O){const _=O.valueToCode(b,"IF",E.CONDITIONAL)||"False",m=O.valueToCode(b,"THEN",E.CONDITIONAL)||"None";return b=O.valueToCode(b,"ELSE",E.CONDITIONAL)||"None",[m+" if "+_+" else "+b,E.CONDITIONAL]},$e=function(b,O){let _;_=b.getField("TIMES")?String(parseInt(b.getFieldValue("TIMES"),10)):O.valueToCode(b,"TIMES",E.NONE)||"0",_=l.isNumber$$module$build$src$core$utils$string(_)?parseInt(_,10):"int("+_+")";let m=O.statementToCode(b,"DO");return m=O.addLoopTrap(m,b)||O.PASS,"for "+O.nameDB_.getDistinctName("count",l.NameType$$module$build$src$core$names.VARIABLE)+" in range("+_+`): +`+m},he=function(b,O){const _=b.getFieldValue("MODE")==="UNTIL";let m=O.valueToCode(b,"BOOL",_?E.LOGICAL_NOT:E.NONE)||"False",C=O.statementToCode(b,"DO");return C=O.addLoopTrap(C,b)||O.PASS,_&&(m="not "+m),"while "+m+`: +`+C},fe=function(b,O){const _=O.nameDB_.getName(b.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE);var m=O.valueToCode(b,"FROM",E.NONE)||"0",C=O.valueToCode(b,"TO",E.NONE)||"0",V=O.valueToCode(b,"BY",E.NONE)||"1";let ve=O.statementToCode(b,"DO");ve=O.addLoopTrap(ve,b)||O.PASS;let Ge="";const rt=function(){return O.provideFunction_("upRange",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): + while start <= stop: + yield start + start += abs(step) +`)},Mt=function(){return O.provideFunction_("downRange",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): + while start >= stop: + yield start + start -= abs(step) +`)};if(b=function(po,Be,wt){return"("+po+" <= "+Be+") and "+rt()+"("+po+", "+Be+", "+wt+") or "+Mt()+"("+po+", "+Be+", "+wt+")"},l.isNumber$$module$build$src$core$utils$string(m)&&l.isNumber$$module$build$src$core$utils$string(C)&&l.isNumber$$module$build$src$core$utils$string(V))m=Number(m),C=Number(C),V=Math.abs(Number(V)),m%1===0&&C%1===0&&V%1===0?(m<=C?(C++,b=m===0&&V===1?C:m+", "+C,V!==1&&(b+=", "+V)):(C--,b=m+", "+C+", -"+V),b="range("+b+")"):(b=mb?E.UNARY_SIGN:E.ATOMIC,[b,O]},D=function(b,O){var _={ADD:[" + ",E.ADDITIVE],MINUS:[" - ",E.ADDITIVE],MULTIPLY:[" * ",E.MULTIPLICATIVE],DIVIDE:[" / ",E.MULTIPLICATIVE],POWER:[" ** ",E.EXPONENTIATION]}[b.getFieldValue("OP")];const m=_[0];_=_[1];const C=O.valueToCode(b,"A",_)||"0";return b=O.valueToCode(b,"B",_)||"0",[C+m+b,_]},B=function(b,O){const _=b.getFieldValue("OP");let m;if(_==="NEG")return m=O.valueToCode(b,"NUM",E.UNARY_SIGN)||"0",["-"+m,E.UNARY_SIGN];switch(O.definitions_.import_math="import math",b=_==="SIN"||_==="COS"||_==="TAN"?O.valueToCode(b,"NUM",E.MULTIPLICATIVE)||"0":O.valueToCode(b,"NUM",E.NONE)||"0",_){case"ABS":m="math.fabs("+b+")";break;case"ROOT":m="math.sqrt("+b+")";break;case"LN":m="math.log("+b+")";break;case"LOG10":m="math.log10("+b+")";break;case"EXP":m="math.exp("+b+")";break;case"POW10":m="math.pow(10,"+b+")";break;case"ROUND":m="round("+b+")";break;case"ROUNDUP":m="math.ceil("+b+")";break;case"ROUNDDOWN":m="math.floor("+b+")";break;case"SIN":m="math.sin("+b+" / 180.0 * math.pi)";break;case"COS":m="math.cos("+b+" / 180.0 * math.pi)";break;case"TAN":m="math.tan("+b+" / 180.0 * math.pi)"}if(m)return[m,E.FUNCTION_CALL];switch(_){case"ASIN":m="math.asin("+b+") / math.pi * 180";break;case"ACOS":m="math.acos("+b+") / math.pi * 180";break;case"ATAN":m="math.atan("+b+") / math.pi * 180";break;default:throw Error("Unknown math operator: "+_)}return[m,E.MULTIPLICATIVE]},ae=function(b,O){const _={PI:["math.pi",E.MEMBER],E:["math.e",E.MEMBER],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",E.MULTIPLICATIVE],SQRT2:["math.sqrt(2)",E.MEMBER],SQRT1_2:["math.sqrt(1.0 / 2)",E.MEMBER],INFINITY:["float('inf')",E.ATOMIC]};return b=b.getFieldValue("CONSTANT"),b!=="INFINITY"&&(O.definitions_.import_math="import math"),_[b]},_e=function(b,O){var _={EVEN:[" % 2 == 0",E.MULTIPLICATIVE,E.RELATIONAL],ODD:[" % 2 == 1",E.MULTIPLICATIVE,E.RELATIONAL],WHOLE:[" % 1 == 0",E.MULTIPLICATIVE,E.RELATIONAL],POSITIVE:[" > 0",E.RELATIONAL,E.RELATIONAL],NEGATIVE:[" < 0",E.RELATIONAL,E.RELATIONAL],DIVISIBLE_BY:[null,E.MULTIPLICATIVE,E.RELATIONAL],PRIME:[null,E.NONE,E.FUNCTION_CALL]};const m=b.getFieldValue("PROPERTY"),[C,V,ve]=_[m];if(_=O.valueToCode(b,"NUMBER_TO_CHECK",V)||"0",m==="PRIME")O.definitions_.import_math="import math",O.definitions_.from_numbers_import_Number="from numbers import Number",b=O.provideFunction_("math_isPrime",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(n): + # https://en.wikipedia.org/wiki/Primality_test#Naive_methods + # If n is not a number but a string, try parsing it. + if not isinstance(n, Number): + try: + n = float(n) + except: + return False + if n == 2 or n == 3: + return True + # False if n is negative, is 1, or not whole, or if n is divisible by 2 or 3. + if n <= 1 or n % 1 != 0 or n % 2 == 0 or n % 3 == 0: + return False + # Check all the numbers of form 6k +/- 1, up to sqrt(n). + for x in range(6, int(math.sqrt(n)) + 2, 6): + if n % (x - 1) == 0 or n % (x + 1) == 0: + return False + return True +`)+"("+_+")";else if(m==="DIVISIBLE_BY"){if(b=O.valueToCode(b,"DIVISOR",E.MULTIPLICATIVE)||"0",b==="0")return["False",E.ATOMIC];b=_+" % "+b+" == 0"}else b=_+C;return[b,ve]},Me=function(b,O){O.definitions_.from_numbers_import_Number="from numbers import Number";const _=O.valueToCode(b,"DELTA",E.ADDITIVE)||"0";return b=O.nameDB_.getName(b.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),b+" = ("+b+" if isinstance("+b+", Number) else 0) + "+_+` +`},Xe=function(b,O){const _=b.getFieldValue("OP");switch(b=O.valueToCode(b,"LIST",E.NONE)||"[]",_){case"SUM":O="sum("+b+")";break;case"MIN":O="min("+b+")";break;case"MAX":O="max("+b+")";break;case"AVERAGE":O.definitions_.from_numbers_import_Number="from numbers import Number",O=O.provideFunction_("math_mean",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(myList): + localList = [e for e in myList if isinstance(e, Number)] + if not localList: return + return float(sum(localList)) / len(localList) +`)+"("+b+")";break;case"MEDIAN":O.definitions_.from_numbers_import_Number="from numbers import Number",O=O.provideFunction_("math_median",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(myList): + localList = sorted([e for e in myList if isinstance(e, Number)]) + if not localList: return + if len(localList) % 2 == 0: + return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0 + else: + return localList[(len(localList) - 1) // 2] +`)+"("+b+")";break;case"MODE":O=O.provideFunction_("math_modes",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(some_list): + modes = [] + # Using a lists of [item, count] to keep count rather than dict + # to avoid "unhashable" errors when the counted item is itself a list or dict. + counts = [] + maxCount = 1 + for item in some_list: + found = False + for count in counts: + if count[0] == item: + count[1] += 1 + maxCount = max(maxCount, count[1]) + found = True + if not found: + counts.append([item, 1]) + for counted_item, item_count in counts: + if item_count == maxCount: + modes.append(counted_item) + return modes +`)+"("+b+")";break;case"STD_DEV":O.definitions_.import_math="import math",O=O.provideFunction_("math_standard_deviation",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(numbers): + n = len(numbers) + if n == 0: return + mean = float(sum(numbers)) / n + variance = sum((x - mean) ** 2 for x in numbers) / n + return math.sqrt(variance) +`)+"("+b+")";break;case"RANDOM":O.definitions_.import_random="import random",O="random.choice("+b+")";break;default:throw Error("Unknown operator: "+_)}return[O,E.FUNCTION_CALL]},Je=function(b,O){const _=O.valueToCode(b,"DIVIDEND",E.MULTIPLICATIVE)||"0";return b=O.valueToCode(b,"DIVISOR",E.MULTIPLICATIVE)||"0",[_+" % "+b,E.MULTIPLICATIVE]},we=function(b,O){const _=O.valueToCode(b,"VALUE",E.NONE)||"0",m=O.valueToCode(b,"LOW",E.NONE)||"0";return b=O.valueToCode(b,"HIGH",E.NONE)||"float('inf')",["min(max("+_+", "+m+"), "+b+")",E.FUNCTION_CALL]},We=function(b,O){O.definitions_.import_random="import random";const _=O.valueToCode(b,"FROM",E.NONE)||"0";return b=O.valueToCode(b,"TO",E.NONE)||"0",["random.randint("+_+", "+b+")",E.FUNCTION_CALL]},Ze=function(b,O){return O.definitions_.import_random="import random",["random.random()",E.FUNCTION_CALL]},nt=function(b,O){O.definitions_.import_math="import math";const _=O.valueToCode(b,"X",E.NONE)||"0";return["math.atan2("+(O.valueToCode(b,"Y",E.NONE)||"0")+", "+_+") / math.pi * 180",E.MULTIPLICATIVE]},ht=function(b,O){var _=[],m=b.workspace,C=l.allUsedVarModels$$module$build$src$core$variables(m)||[];for(let Be=0,wt;wt=C[Be];Be++){var V=wt.name;b.getVars().indexOf(V)===-1&&_.push(O.nameDB_.getName(V,l.NameType$$module$build$src$core$names.VARIABLE))}for(m=l.allDeveloperVariables$$module$build$src$core$variables(m),C=0;C_?"int("+b+" - "+-_+")":"int("+b+")",m&&(b="-"+b)),b}},k={};k.colour_blend=h,k.colour_picker=a,k.colour_random=u,k.colour_rgb=d;var W={};W.lists_create_empty=p,W.lists_create_with=f,W.lists_getIndex=x,W.lists_getSublist=oe,W.lists_indexOf=P,W.lists_isEmpty=S,W.lists_length=y,W.lists_repeat=T,W.lists_reverse=Y,W.lists_setIndex=G,W.lists_sort=ne,W.lists_split=Z;var J={};J.controls_if=M,J.controls_ifelse=M,J.logic_boolean=z,J.logic_compare=L,J.logic_negate=F,J.logic_null=X,J.logic_operation=R,J.logic_ternary=le;var Ee={};Ee.controls_flow_statements=re,Ee.controls_for=fe,Ee.controls_forEach=ke,Ee.controls_repeat=$e,Ee.controls_repeat_ext=$e,Ee.controls_whileUntil=he;var ze={};ze.math_arithmetic=D,ze.math_atan2=nt,ze.math_change=Me,ze.math_constant=ae,ze.math_constrain=we,ze.math_modulo=Je,ze.math_number=Ie,ze.math_number_property=_e,ze.math_on_list=Xe,ze.math_random_float=Ze,ze.math_random_int=We,ze.math_round=B,ze.math_single=B,ze.math_trig=B;var yt={};yt.procedures_callnoreturn=xe,yt.procedures_callreturn=et,yt.procedures_defnoreturn=ht,yt.procedures_defreturn=ht,yt.procedures_ifreturn=w;var ls=/^\s*'([^']|\\')*'\s*$/,ii=function(b){return ls.test(b)?[b,E.ATOMIC]:["str("+b+")",E.FUNCTION_CALL]},xt={};xt.text=I,xt.text_append=K,xt.text_changeCase=ce,xt.text_charAt=se,xt.text_count=be,xt.text_getSubstring=Ce,xt.text_indexOf=Te,xt.text_isEmpty=de,xt.text_join=A,xt.text_length=U,xt.text_multiline=N,xt.text_print=Ne,xt.text_prompt=He,xt.text_prompt_ext=He,xt.text_replace=ee,xt.text_reverse=ie,xt.text_trim=Se;var Qo={};Qo.variables_get=ue,Qo.variables_set=ye;var Ht={};Ht.variables_get_dynamic=ue,Ht.variables_set_dynamic=ye;var ws=new g;ws.addReservedWords("math,random,Number"),Object.assign(ws.forBlock,k,W,J,Ee,ze,yt,xt,Qo,Ht);var qo={};return qo.Order=E,qo.PythonGenerator=g,qo.pythonGenerator=ws,qo.__namespace__=l,qo})}(h0)),h0.exports}(function(o,n){(function(s,l){o.exports=l(Gc(),a8())})(Do,function(s,l){/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return l})})(o2);var Ve=o2.exports;function tr(o){return/^\d+$/.test(o)}Ve.pythonGenerator.forBlock.controls_forever=function(o,n){return`while True: +`+n.statementToCode(o,"DO")};Ve.pythonGenerator.forBlock.math_evenly_divisible=function(o,n){const s=n.valueToCode(o,"DIVIDEND",Ve.Order.NONE)||"0",l=n.valueToCode(o,"DIVISOR",Ve.Order.NONE)||"1";return[s+" % "+l+" == 0",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.text_charAt=function(o,n){const s=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),[s+"["+l+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.text_getSubstring=function(o,n){const s=n.valueToCode(o,"STRING",Ve.Order.NONE)||"''";let l=n.valueToCode(o,"WHERE1",Ve.Order.NONE)||"1",a=n.valueToCode(o,"WHERE2",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE1")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE1")==="FROM_END"&&(l=s+".length - "+l),o.getFieldValue("WHERE2")==="FROM_END"&&(a=tr(a)?Number(a)-1:a+" - 1",a=s+".length - "+a),[s+"["+l+":"+a+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.math_types=function(o,n){const s={STRING:"str",NUMBER:"float",BOOLEAN:"bool"},l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"";return[s[o.getFieldValue("TYPE")]+"("+l+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_push=function(o,n){const s=n.valueToCode(o,"ITEM",Ve.Order.NONE)||"";return(n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]")+".append("+s+")"};Ve.pythonGenerator.forBlock.lists_insert=function(o,n){const s=n.valueToCode(o,"ITEM",Ve.Order.NONE)||"None",l=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let a=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?a=tr(a)?Number(a)-1:a+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=l+".length - "+a),l+".insert("+a+", "+s+")"};Ve.pythonGenerator.forBlock.lists_delete=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),s+".pop("+l+")"};Ve.pythonGenerator.forBlock.lists_set=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"TO",Ve.Order.NONE)||"None";let a=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?a=tr(a)?Number(a)-1:a+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=s+".length - "+a),s+"["+a+"] = "+l};Ve.pythonGenerator.forBlock.lists_get=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),[s+"["+l+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_index=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";let a;return o.getFieldValue("WHERE")==="FROM_START"?a=s+".index("+l+") + 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=s+".rindex("+l+") + 1"),[a,Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_includes=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return[s+".count("+l+") > 0",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_length=function(o,n){return[(n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]")+".length",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_current=function(){return["time.time()",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_timestamp_to_date=function(o,n){return["datetime.datetime.fromtimestamp("+(n.valueToCode(o,"TIMESTAMP",Ve.Order.NONE)||"0")+').strftime("%Y-%m-%d %H:%M:%S")',Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_import=function(){return`import time +`};Ve.pythonGenerator.forBlock.http_import=function(){return`import requests +`};Ve.pythonGenerator.forBlock.http_get=function(o,n){const s=n.valueToCode(o,"URL",Ve.Order.NONE)||"''",l=n.valueToCode(o,"HEADERS",Ve.Order.NONE)||"{}",a=n.valueToCode(o,"COOKIES",Ve.Order.NONE)||"{}";return["requests.get("+s+", headers="+l+", cookies="+a+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.http_post=function(o,n){const s=n.valueToCode(o,"URL",Ve.Order.NONE)||"''",l=n.valueToCode(o,"HEADERS",Ve.Order.NONE)||"{}",a=n.valueToCode(o,"COOKIES",Ve.Order.NONE)||"{}",u=n.valueToCode(o,"DATA",Ve.Order.NONE)||"{}";return["requests.post("+s+", headers="+l+", cookies="+a+", data="+u+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.dict_create=function(){return["dict()",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.dict_set=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return(n.valueToCode(o,"DICT",Ve.Order.NONE)||"{}")+"["+s+"] = "+l};Ve.pythonGenerator.forBlock.set_dict=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return"{"+s+":"+l+"}"};Ve.pythonGenerator.forBlock.dict_get=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''";return[(n.valueToCode(o,"DICT",Ve.Order.NONE)||"{}")+"["+s+"]",Ve.Order.NONE]};var Ns=(o,n)=>{const s=o.__vccOpts||o;for(const[l,a]of n)s[l]=a;return s};const u8={name:"IconDark",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},d8=["fill"],h8=Le("defs",null,[Le("clipPath",{id:"svg_a82fd95db1__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),p8=Le("g",{"clip-path":"url(#svg_a82fd95db1__a)"},[Le("path",{d:"M28.4559,2.45191Q26.2603,2,24,2Q19.525399999999998,2,15.436,3.72969Q11.48756,5.39973,8.44365,8.44365Q5.39973,11.48757,3.729689,15.436Q2,19.525399999999998,2,24Q2,28.4746,3.72969,32.564Q5.39973,36.5124,8.44365,39.5564Q11.48757,42.6003,15.436,44.2703Q19.525399999999998,46,24,46Q28.4746,46,32.564,44.2703Q36.5124,42.6003,39.5564,39.5564Q42.6003,36.5124,44.2703,32.564Q46,28.4746,46,24Q46,21.7397,45.548,19.544Q45.5199,19.407600000000002,45.4732,19.2763Q45.4265,19.1451,45.362,19.0216Q45.2975,18.8981,45.2165,18.7847Q45.1355,18.6714,45.0396,18.5703Q44.9437,18.4693,44.8347,18.3825Q44.7257,18.2958,44.6057,18.224899999999998Q44.4857,18.1541,44.3571,18.1006Q44.2285,18.0471,44.0936,18.012Q43.9986,17.9872,43.9015,17.971899999999998Q43.8045,17.9565,43.7064,17.950699999999998Q43.6083,17.945,43.5101,17.948900000000002Q43.4119,17.9527,43.3146,17.9662Q43.2173,17.9797,43.1218,18.0027Q43.0262,18.0256,42.9334,18.0578Q42.8406,18.0901,42.7514,18.1312Q42.6621,18.1724,42.5774,18.222099999999998Q42.4926,18.2718,42.4132,18.3295Q42.3337,18.3873,42.2602,18.4526Q42.1868,18.517899999999997,42.1201,18.59Q42.0535,18.6622,41.9942,18.7406Q41.9349,18.8189,41.8836,18.9027Q41.8323,18.9865,41.7894,19.0749Q41.7465,19.1633,41.7126,19.255499999999998Q41.6786,19.3477,41.6538,19.4428Q40.7431,22.9361,37.8816,25.1777Q34.9751,27.4545,31.2727,27.4545Q29.0889,27.4545,27.0978,26.6123Q25.1731,25.7983,23.6874,24.3126Q22.2017,22.8269,21.3877,20.9022Q20.5455,18.911099999999998,20.5455,16.7273Q20.5455,13.02491,22.8223,10.118459999999999Q25.0639,7.2569300000000005,28.5573,6.346159999999999Q28.6921,6.31101,28.8207,6.25751Q28.9494,6.20401,29.0693,6.13319Q29.1893,6.06237,29.2983,5.9756Q29.4073,5.8888300000000005,29.5032,5.78778Q29.5992,5.68674,29.6801,5.57337Q29.7611,5.46,29.8256,5.3365Q29.8901,5.213,29.9368,5.0817499999999995Q29.9836,4.9505040000000005,30.0116,4.814043Q30.0513,4.621105,30.0527,4.424127Q30.054,4.227148,30.0168,4.0336998Q29.9797,3.840251,29.9055,3.6577669999999998Q29.8313,3.475282,29.723,3.310774Q29.6146,3.146266,29.4763,3.006056Q29.3379,2.86585,29.1749,2.75532Q29.0118,2.6448,28.8303,2.56821Q28.6488,2.49162,28.4559,2.45191ZM20.8976,6.26333Q18.894,6.6101399999999995,16.9942,7.41371Q13.76432,8.77983,11.272079999999999,11.272079999999999Q8.77983,13.76432,7.41371,16.9942Q6,20.3366,6,24Q6,27.6634,7.41371,31.0058Q8.77983,34.2357,11.272079999999999,36.7279Q13.76433,39.2202,16.9942,40.5863Q20.3366,42,24,42Q27.6634,42,31.0058,40.5863Q34.2357,39.2202,36.7279,36.7279Q39.2202,34.2357,40.5863,31.0058Q41.3899,29.106,41.7367,27.1024Q41.0902,27.7453,40.3483,28.3265Q36.3553,31.4545,31.2727,31.4545Q28.2778,31.4545,25.5396,30.2964Q22.8963,29.1783,20.859,27.141Q18.8216,25.1037,17.7036,22.4604Q16.5455,19.7222,16.5455,16.7273Q16.5455,11.6447,19.6735,7.65174Q20.2547,6.90977,20.8976,6.26333Z","fill-rule":"evenodd"})],-1),$8=[h8,p8];function _8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-dark`],width:"1em",height:"1em"},o.$attrs),$8,16,d8)}var g8=Ns(u8,[["render",_8]]);const f8={name:"IconCode",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},m8=["fill"],T8=Le("defs",null,[Le("clipPath",{id:"svg_c13367945d__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),E8=Le("g",{"clip-path":"url(#svg_c13367945d__a)","fill-rule":"evenodd"},[Le("path",{d:"M13.6112 38.4392L13.6119 38.4399Q13.7504 38.5734 13.9118 38.6781 14.0732 38.7827 14.2516 38.8547 14.43 38.9267 14.6188 38.963300000000004 14.8076 39 15 39 15.0183 39 15.0367 38.999700000000004 15.2336 38.9961 15.4261 38.9541 15.6185 38.912099999999995 15.7991 38.8334 15.9797 38.7547 16.1414 38.6423 16.3032 38.5299 16.4399 38.3881 16.5734 38.2496 16.6781 38.0882 16.7827 37.9268 16.8547 37.748400000000004 16.9267 37.57 16.9633 37.3812 17 37.1924 17 37 17 36.981700000000004 16.9997 36.963300000000004 16.9961 36.766400000000004 16.9541 36.573899999999995 16.912100000000002 36.3815 16.833399999999997 36.200900000000004 16.7547 36.0203 16.6423 35.858599999999996 16.529899999999998 35.696799999999996 16.3881 35.5601L16.3873 35.5594 5.8288899999999995 25.3812 16.438200000000002 14.38983 16.439 14.38898Q16.572699999999998 14.25047 16.677500000000002 14.088989999999999 16.782400000000003 13.927508 16.8545 13.748998 16.9266 13.570489 16.9633 13.381504 17 13.19252 17 13.000000000000012 17 12.9823145 16.9997 12.9646317 16.9962 12.76768 16.9544 12.575192 16.9125 12.382703 16.8339 12.202077 16.7553 12.02145 16.643 11.85963 16.5307 11.6978 16.389 11.561 16.250500000000002 11.4273 16.089 11.32247 15.9275 11.217649999999999 15.749 11.14555 15.5705 11.07345 15.3815 11.03672 15.1925 11 15 11L14.9976 11Q14.9811 11.00002 14.9646 11.00031 14.7677 11.0038 14.5752 11.04564 14.3827 11.08748 14.2021 11.16606 14.0215 11.24465 13.8596 11.35697 13.6978 11.46929 13.561 11.61102L13.5602 11.61187 1.561 24.043100000000003 1.5601 24.0441Q1.42339 24.1859 1.31697 24.3517 1.21055 24.517400000000002 1.13852 24.7008 1.06649 24.8841 1.03161 25.078.9967299999999999 25.2718 1.00034 25.4688 1.00395 25.6657 1.04591 25.8582 1.08788 26.0507 1.16658 26.2312 1.24529 26.4118 1.35771 26.5736 1.47013 26.735300000000002 1.61195 26.872L13.6112 38.4392zM31.6128 35.5593L31.61195 35.5601Q31.47013 35.696799999999996 31.35771 35.858599999999996 31.24529 36.0203 31.16658 36.200900000000004 31.08788 36.3815 31.04591 36.573899999999995 31.00395 36.766400000000004 31.00034 36.963300000000004 31 36.981700000000004 31 37 31 37.0297 31.00088 37.0594 31.00638 37.2442 31.04565 37.4249 31.08491 37.6055 31.15663 37.7759 31.22834 37.9463 31.33007 38.1006 31.4318 38.254999999999995 31.5601 38.3881 31.70002 38.5332 31.8661 38.6475 32.032178 38.7618 32.217728 38.8407 32.403278 38.9195 32.600833 38.9598 32.798388 39 33 39 33.03343 39 33.066851 38.9989 33.250672 38.9927 33.430289 38.953199999999995 33.609906 38.9136 33.779294 38.841899999999995 33.948681 38.7703 34.10216 38.6689 34.25563 38.5676 34.38805 38.4399L34.3889 38.439099999999996 46.3881 26.872Q46.5299 26.735300000000002 46.6423 26.5736 46.7547 26.4118 46.8334 26.2312 46.9121 26.0507 46.9541 25.8582 46.9961 25.6657 46.999700000000004 25.4688 47.003299999999996 25.2718 46.9684 25.078 46.9335 24.8841 46.8615 24.7008 46.7894 24.517400000000002 46.683 24.3517 46.5766 24.1859 46.4399 24.0441L46.439 24.043100000000003 34.4391 11.61111 34.439 11.61102Q34.2991 11.46607 34.1331 11.351939999999999 33.9671 11.23781 33.781676 11.15908 33.596251 11.08035 33.398849 11.04017 33.201448 11 32.999999999999986 11 32.9659166 11 32.9318531 11.00116 32.748036 11.00743 32.568444 11.04711 32.388853 11.0868 32.219512 11.15858 32.050171 11.23035 31.89676 11.33181 31.74335 11.43326 31.61102 11.561 31.46607 11.7009 31.35194 11.8669 31.23781 12.0329 31.15908 12.218323999999999 31.08035 12.403749 31.04017 12.601151 31 12.798552 31 13 31 13.0340834 31.00116 13.0681469 31.00743 13.251964 31.04711 13.431556 31.0868 13.611147 31.15858 13.780488 31.23035 13.949829 31.33181 14.10324 31.43326 14.25665 31.561 14.38898L31.56109 14.38908 42.17111 25.3812 31.6128 35.5593zM26.02983 3.655886L19.02994 43.6552Q19 43.8263 19 44L19.00009 44.0195Q19.00094 44.1063 19.0093 44.1926 19.01766 44.279 19.03347 44.3644 19.04929 44.4497 19.07243 44.5334 19.095579999999998 44.617 19.12588 44.6984 19.15619 44.7797 19.19343 44.8581 19.23067 44.9365 19.27455 45.0114 19.31844 45.0862 19.36865 45.157 19.41887 45.2278 19.47502 45.294 19.53118 45.3602 19.59285 45.4212 19.65453 45.4823 19.72126 45.5378 19.788 45.5933 19.85929 45.6428 19.93058 45.6923 20.005894 45.7354 20.081206 45.7786 20.159972 45.815 20.238738 45.8515 20.320366 45.881 20.401994 45.9105 20.48587 45.9328 20.569746 45.9551 20.655239 45.9701 20.82632 46 21 46 21.0211794 46 21.0423827 45.9996 21.339964 45.9932 21.622812 45.9006 21.905661 45.8079 22.149259999999998 45.6368 22.31047 45.5236 22.44651 45.3812 22.58254 45.2387 22.68816 45.0724 22.79379 44.9062 22.86495 44.7225 22.9361 44.5388 22.97006 44.3448L29.97006 4.344761Q30 4.173682 30 4.0000044183 30 3.9788062 29.99955 3.9576172 29.99324 3.660036 29.900550000000003 3.377187 29.807859999999998 3.0943389999999997 29.63683 2.85074 29.52363 2.68953 29.38116 2.55349 29.2387 2.41746 29.07243 2.31184 28.90616 2.20621 28.72248 2.1350499999999997 28.53879 2.0639000000000003 28.34476 2.02994 28.17368 2 28 2L27.98053 2.00009Q27.89374 2.00094 27.80735 2.0093 27.720959999999998 2.0176600000000002 27.63562 2.0334700000000003 27.55028 2.04929 27.466630000000002 2.0724299999999998 27.38298 2.09558 27.301650000000002 2.12588 27.22032 2.15619 27.14192 2.19343 27.06352 2.23067 26.98865 2.27455 26.91377 2.31844 26.84297 2.3686499999999997 26.77218 2.41887 26.706 2.4750199999999998 26.63982 2.53118 26.57876 2.5928500000000003 26.51769 2.6545300000000003 26.4622 2.72126 26.40671 2.7880000000000003 26.3572 2.85929 26.3077 2.93058 26.26456 3.005894 26.221420000000002 3.081206 26.18497 3.159972 26.14851 3.238738 26.11902 3.320366 26.08952 3.401994 26.06721 3.4858700000000002 26.0449 3.569746 26.02994 3.655239L26.02983 3.655886z"})],-1),b8=[T8,E8];function v8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-code`],width:"1em",height:"1em"},o.$attrs),b8,16,m8)}var I8=Ns(f8,[["render",v8]]);const O8={name:"IconBigger",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},C8=["fill"],y8=ld('',2),S8=[y8];function R8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-bigger`],width:"1em",height:"1em"},o.$attrs),S8,16,C8)}var k8=Ns(O8,[["render",R8]]);const A8={name:"IconSmaller",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},L8=["fill"],N8=Le("defs",null,[Le("clipPath",{id:"svg_23394313d7__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),w8=Le("g",{"clip-path":"url(#svg_23394313d7__a)"},[Le("path",{d:"M6,26L42,26Q42.0983,26,42.196,25.99037Q42.2938,25.98074,42.3902,25.961570000000002Q42.4865,25.9424,42.5806,25.91388Q42.6746,25.88536,42.7654,25.84776Q42.8561,25.81016,42.9428,25.763840000000002Q43.0294,25.71753,43.1111,25.66294Q43.1928,25.60835,43.2688,25.54602Q43.3447,25.48369,43.4142,25.41421Q43.4837,25.34474,43.546,25.26879Q43.6083,25.19284,43.6629,25.11114Q43.7175,25.02945,43.7638,24.942793Q43.8102,24.856141,43.8478,24.765367Q43.8854,24.674592,43.9139,24.580569Q43.9424,24.486546,43.9616,24.390181Q43.9807,24.293815,43.9904,24.196034Q44,24.0982537,44,24Q44,23.9017463,43.9904,23.803966Q43.9807,23.706185,43.9616,23.609819Q43.9424,23.513454,43.9139,23.419431Q43.8854,23.325408,43.8478,23.234633Q43.8102,23.143859,43.7638,23.057207Q43.7175,22.97055,43.6629,22.88886Q43.6083,22.80716,43.546,22.73121Q43.4837,22.65526,43.4142,22.58579Q43.3447,22.51631,43.2688,22.45398Q43.1928,22.39165,43.1111,22.33706Q43.0294,22.28247,42.9428,22.236159999999998Q42.8561,22.18984,42.7654,22.15224Q42.6746,22.11464,42.5806,22.08612Q42.4865,22.0576,42.3902,22.038429999999998Q42.2938,22.01926,42.196,22.00963Q42.0983,22,42,22L6,22Q5.9017463,22,5.803966,22.00963Q5.706185,22.01926,5.609819,22.038429999999998Q5.513454,22.0576,5.419431,22.08612Q5.325408,22.11464,5.234633,22.15224Q5.143859,22.18984,5.057207,22.236159999999998Q4.97055,22.28247,4.88886,22.33706Q4.80716,22.39165,4.73121,22.45398Q4.65526,22.51631,4.58579,22.58579Q4.51631,22.65526,4.45398,22.73121Q4.39165,22.80716,4.33706,22.88886Q4.28247,22.97055,4.23616,23.057207Q4.18984,23.143859,4.15224,23.234633Q4.11464,23.325408,4.08612,23.419431Q4.0576,23.513454,4.03843,23.609819Q4.01926,23.706185,4.00963,23.803966Q4,23.9017463,4,24Q4,24.0982537,4.00963,24.196034Q4.01926,24.293815,4.03843,24.390181Q4.0576,24.486546,4.08612,24.580569Q4.11464,24.674592,4.15224,24.765367Q4.18984,24.856141,4.23616,24.942793Q4.28247,25.02945,4.33706,25.11114Q4.39165,25.19284,4.45398,25.26879Q4.51631,25.34474,4.58579,25.41421Q4.65526,25.48369,4.73121,25.54602Q4.80716,25.60835,4.88886,25.66294Q4.97055,25.71753,5.057207,25.763840000000002Q5.143859,25.81016,5.234633,25.84776Q5.325408,25.88536,5.419431,25.91388Q5.513454,25.9424,5.609819,25.961570000000002Q5.706185,25.98074,5.803966,25.99037Q5.9017463,26,6,26Z","fill-rule":"evenodd"})],-1),M8=[N8,w8];function D8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-smaller`],width:"1em",height:"1em"},o.$attrs),M8,16,L8)}var P8=Ns(A8,[["render",D8]]);const x8={name:"IconAuto",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},B8=["fill"],F8=ld('',2),U8=[F8];function H8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-auto`],width:"1em",height:"1em"},o.$attrs),U8,16,B8)}var V8=Ns(x8,[["render",H8]]);const G8={name:"IconLight",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},W8=["fill"],z8=ld('',2),X8=[z8];function j8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-light`],width:"1em",height:"1em"},o.$attrs),X8,16,W8)}var Y8=Ns(G8,[["render",j8]]);const K8={name:"IconClose",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},Q8=["fill"],q8=ld('',2),J8=[q8];function Z8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-close`],width:"1em",height:"1em"},o.$attrs),J8,16,Q8)}var s2=Ns(K8,[["render",Z8]]);const eD={name:"IconDownload",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},tD=["fill"],oD=Le("defs",null,[Le("clipPath",{id:"svg_fd45640674__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),sD=Le("g",{"clip-path":"url(#svg_fd45640674__a)"},[Le("path",{d:"M26,26.3152L31.6577,20.6569L34.4863,23.4851L24.0022,33.9704L13.51586,23.4853L16.34414,20.6567L22,26.3119L22,5L26,5L26,26.3152ZM10,39L10,35L6,35L6,43L42,43L42,35L38,35L38,39L10,39Z","fill-rule":"evenodd"})],-1),iD=[oD,sD];function nD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-download`],width:"1em",height:"1em"},o.$attrs),iD,16,tD)}var rD=Ns(eD,[["render",nD]]);const lD={name:"IconCleanup",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},cD=["fill"],aD=Le("defs",null,[Le("clipPath",{id:"svg_9a669f61db__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),uD=Le("g",{"clip-path":"url(#svg_9a669f61db__a)","fill-rule":"evenodd"},[Le("path",{d:"M14 7L14 19Q14 19.098300000000002 14.00963 19.195999999999998 14.01926 19.293799999999997 14.03843 19.3902 14.0576 19.4865 14.08612 19.5806 14.11464 19.674599999999998 14.152239999999999 19.7654 14.18984 19.856099999999998 14.23616 19.9428 14.28247 20.029400000000003 14.33706 20.1111 14.39165 20.1928 14.45398 20.2688 14.51631 20.3447 14.58579 20.4142 14.65526 20.4837 14.73121 20.546 14.80716 20.6084 14.88886 20.6629 14.97055 20.7175 15.057207 20.7638 15.143858999999999 20.810200000000002 15.234633 20.8478 15.325408 20.8854 15.419431 20.913899999999998 15.513454 20.9424 15.609819 20.9616 15.706185 20.9807 15.803966 20.9904 15.9017463 21 16 21L42 21Q42.098299999999995 21 42.196 20.9904 42.293800000000005 20.9807 42.3902 20.9616 42.4865 20.9424 42.580600000000004 20.913899999999998 42.6746 20.8854 42.7654 20.8478 42.8561 20.810200000000002 42.9428 20.7638 43.029399999999995 20.7175 43.1111 20.6629 43.1928 20.6084 43.2688 20.546 43.3447 20.4837 43.4142 20.4142 43.4837 20.3447 43.546 20.2688 43.6084 20.1928 43.6629 20.1111 43.7175 20.029400000000003 43.7638 19.9428 43.810199999999995 19.856099999999998 43.8478 19.7654 43.885400000000004 19.674599999999998 43.9139 19.5806 43.9424 19.4865 43.961600000000004 19.3902 43.9807 19.293799999999997 43.9904 19.195999999999998 44 19.098300000000002 44 19L44 7Q44 6.9017463 43.9904 6.803966 43.9807 6.706185 43.961600000000004 6.609819 43.9424 6.513454 43.9139 6.419431 43.885400000000004 6.325408 43.8478 6.234633 43.810199999999995 6.143859 43.7638 6.057207 43.7175 5.97055 43.6629 5.88886 43.6084 5.80716 43.546 5.73121 43.4837 5.65526 43.4142 5.58579 43.3447 5.51631 43.2688 5.45398 43.1928 5.39165 43.1111 5.33706 43.029399999999995 5.28247 42.9428 5.23616 42.8561 5.18984 42.7654 5.15224 42.6746 5.11464 42.580600000000004 5.08612 42.4865 5.0576 42.3902 5.03843 42.293800000000005 5.01926 42.196 5.00963 42.098299999999995 5 42 5L16 5Q15.9017463 5 15.803966 5.00963 15.706185 5.01926 15.609819 5.03843 15.513454 5.0576 15.419431 5.08612 15.325408 5.11464 15.234633 5.15224 15.143858999999999 5.18984 15.057207 5.23616 14.97055 5.28247 14.88886 5.33706 14.80716 5.39165 14.73121 5.45398 14.65526 5.51631 14.58579 5.58579 14.51631 5.65526 14.45398 5.73121 14.39165 5.80716 14.33706 5.88886 14.28247 5.97055 14.23616 6.057207 14.18984 6.143859 14.152239999999999 6.234633 14.11464 6.325408 14.08612 6.419431 14.0576 6.513454 14.03843 6.609819 14.01926 6.706185 14.00963 6.803966 14 6.9017463 14 7zM18 17L18 9 40 9 40 17 18 17zM8 42L8 6Q8 5.9017463 7.99037 5.803966 7.98074 5.706185 7.96157 5.609819 7.9424 5.513454 7.91388 5.419431 7.88536 5.325408 7.84776 5.234633 7.81016 5.143859 7.76384 5.057207 7.71753 4.97055 7.66294 4.88886 7.60835 4.80716 7.54602 4.73121 7.48369 4.65526 7.41421 4.58579 7.34474 4.51631 7.26879 4.45398 7.19284 4.39165 7.11114 4.33706 7.02945 4.28247 6.942793 4.23616 6.856141 4.18984 6.765367 4.15224 6.674592 4.11464 6.580569 4.08612 6.486546 4.0576 6.390181 4.03843 6.293815 4.01926 6.196034 4.00963 6.0982537 4 6 4 5.9017463 4 5.803966 4.00963 5.706185 4.01926 5.609819 4.03843 5.513454 4.0576 5.419431 4.08612 5.325408 4.11464 5.234633 4.15224 5.143859 4.18984 5.057207 4.23616 4.97055 4.28247 4.88886 4.33706 4.80716 4.39165 4.73121 4.45398 4.65526 4.51631 4.58579 4.58579 4.51631 4.65526 4.45398 4.73121 4.39165 4.80716 4.33706 4.88886 4.28247 4.97055 4.23616 5.057207 4.18984 5.143859 4.15224 5.234633 4.11464 5.325408 4.08612 5.419431 4.0576 5.513454 4.03843 5.609819 4.01926 5.706185 4.00963 5.803966 4 5.9017463 4 6L4 42Q4 42.0983 4.00963 42.196 4.01926 42.2938 4.03843 42.3902 4.0576 42.4865 4.08612 42.5806 4.11464 42.6746 4.15224 42.7654 4.18984 42.8561 4.23616 42.9428 4.28247 43.0294 4.33706 43.1111 4.39165 43.1928 4.45398 43.2688 4.51631 43.3447 4.58579 43.4142 4.65526 43.4837 4.73121 43.546 4.80716 43.6083 4.88886 43.6629 4.97055 43.7175 5.057207 43.7638 5.143859 43.8102 5.234633 43.8478 5.325408 43.8854 5.419431 43.9139 5.513454 43.9424 5.609819 43.9616 5.706185 43.9807 5.803966 43.9904 5.9017463 44 6 44 6.0982537 44 6.196034 43.9904 6.293815 43.9807 6.390181 43.9616 6.486546 43.9424 6.580569 43.9139 6.674592 43.8854 6.765367 43.8478 6.856141 43.8102 6.942793 43.7638 7.02945 43.7175 7.11114 43.6629 7.19284 43.6083 7.26879 43.546 7.34474 43.4837 7.41421 43.4142 7.48369 43.3447 7.54602 43.2688 7.60835 43.1928 7.66294 43.1111 7.71753 43.0294 7.76384 42.9428 7.81016 42.8561 7.84776 42.7654 7.88536 42.6746 7.91388 42.5806 7.9424 42.4865 7.96157 42.3902 7.98074 42.2938 7.99037 42.196 8 42.0983 8 42zM14 29L14 41Q14 41.0983 14.00963 41.196 14.01926 41.2938 14.03843 41.3902 14.0576 41.4865 14.08612 41.580600000000004 14.11464 41.6746 14.152239999999999 41.7654 14.18984 41.8561 14.23616 41.9428 14.28247 42.0294 14.33706 42.1111 14.39165 42.1928 14.45398 42.2688 14.51631 42.3447 14.58579 42.4142 14.65526 42.4837 14.73121 42.546 14.80716 42.6084 14.88886 42.6629 14.97055 42.7175 15.057207 42.7638 15.143858999999999 42.8102 15.234633 42.8478 15.325408 42.885400000000004 15.419431 42.9139 15.513454 42.9424 15.609819 42.961600000000004 15.706185 42.9807 15.803966 42.9904 15.9017463 43 16 43L38 43Q38.098299999999995 43 38.196 42.9904 38.293800000000005 42.9807 38.3902 42.961600000000004 38.4865 42.9424 38.580600000000004 42.9139 38.6746 42.885400000000004 38.7654 42.8478 38.8561 42.8102 38.9428 42.7638 39.029399999999995 42.7175 39.1111 42.6629 39.1928 42.6084 39.2688 42.546 39.3447 42.4837 39.4142 42.4142 39.4837 42.3447 39.546 42.2688 39.6084 42.1928 39.6629 42.1111 39.7175 42.0294 39.7638 41.9428 39.810199999999995 41.8561 39.8478 41.7654 39.885400000000004 41.6746 39.9139 41.580600000000004 39.9424 41.4865 39.961600000000004 41.3902 39.9807 41.2938 39.9904 41.196 40 41.0983 40 41L40 29Q40 28.9017463 39.9904 28.803966 39.9807 28.706185 39.961600000000004 28.609819 39.9424 28.513454 39.9139 28.419431 39.885400000000004 28.325408 39.8478 28.234633 39.810199999999995 28.143859 39.7638 28.057207 39.7175 27.97055 39.6629 27.88886 39.6084 27.80716 39.546 27.73121 39.4837 27.65526 39.4142 27.58579 39.3447 27.51631 39.2688 27.45398 39.1928 27.39165 39.1111 27.33706 39.029399999999995 27.28247 38.9428 27.236159999999998 38.8561 27.18984 38.7654 27.15224 38.6746 27.11464 38.580600000000004 27.08612 38.4865 27.0576 38.3902 27.038429999999998 38.293800000000005 27.01926 38.196 27.00963 38.098299999999995 27 38 27L16 27Q15.9017463 27 15.803966 27.00963 15.706185 27.01926 15.609819 27.038429999999998 15.513454 27.0576 15.419431 27.08612 15.325408 27.11464 15.234633 27.15224 15.143858999999999 27.18984 15.057207 27.236159999999998 14.97055 27.28247 14.88886 27.33706 14.80716 27.39165 14.73121 27.45398 14.65526 27.51631 14.58579 27.58579 14.51631 27.65526 14.45398 27.73121 14.39165 27.80716 14.33706 27.88886 14.28247 27.97055 14.23616 28.057207 14.18984 28.143859 14.152239999999999 28.234633 14.11464 28.325408 14.08612 28.419431 14.0576 28.513454 14.03843 28.609819 14.01926 28.706185 14.00963 28.803966 14 28.9017463 14 29zM18 39L18 31 36 31 36 39 18 39z"})],-1),dD=[aD,uD];function hD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-cleanup`],width:"1em",height:"1em"},o.$attrs),dD,16,cD)}var pD=Ns(lD,[["render",hD]]);const $D={name:"IconDown",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},_D=["fill"],gD=Le("defs",null,[Le("clipPath",{id:"svg_74e8333ad1__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),fD=Le("g",{"clip-path":"url(#svg_74e8333ad1__a)"},[Le("path",{d:"M13.41445,16.58602L13.41421,16.58579Q13.27493,16.4465,13.11114,16.33706Q12.947355,16.22762,12.765367,16.15224Q12.583378,16.07686,12.390181,16.038429999999998Q12.196983,16,12,16Q11.803017,16,11.609819,16.038429999999998Q11.416622,16.07686,11.234633,16.15224Q11.052645,16.22762,10.88886,16.33706Q10.72507,16.4465,10.58579,16.58579Q10.4465,16.72507,10.33706,16.88886Q10.22762,17.052645,10.152239999999999,17.234633Q10.07686,17.416622,10.03843,17.609819Q10,17.803017,10,18Q10,18.196983,10.03843,18.390181Q10.07686,18.583378,10.152239999999999,18.765367Q10.22762,18.947355,10.33706,19.11114Q10.4465,19.27493,10.58579,19.41421L10.58602,19.41445L22.5858,31.4142Q22.725099999999998,31.5535,22.8889,31.6629Q23.052599999999998,31.772399999999998,23.2346,31.8478Q23.416600000000003,31.923099999999998,23.6098,31.9616Q23.803,32,24,32Q24.197,32,24.3902,31.9616Q24.583399999999997,31.923099999999998,24.7654,31.8478Q24.947400000000002,31.772399999999998,25.1111,31.6629Q25.274900000000002,31.5535,25.4142,31.4142L37.4135,19.41496L37.4142,19.41421Q37.5535,19.27493,37.6629,19.11114Q37.772400000000005,18.947355,37.8478,18.765367Q37.923100000000005,18.583378,37.961600000000004,18.390181Q38,18.196983,38,18Q38,17.803017,37.961600000000004,17.609819Q37.923100000000005,17.416621,37.8478,17.234633Q37.772400000000005,17.052645,37.6629,16.88886Q37.5535,16.72507,37.4142,16.58579Q37.2749,16.4465,37.1111,16.33706Q36.9474,16.22762,36.7654,16.15224Q36.5834,16.07686,36.3902,16.038429999999998Q36.197,16,36,16Q35.803,16,35.6098,16.038429999999998Q35.4166,16.07686,35.2346,16.15224Q35.0526,16.22762,34.8889,16.33706Q34.7251,16.4465,34.5858,16.58579L34.585,16.58654L24,27.17157L13.41445,16.58602Z","fill-rule":"evenodd"})],-1),mD=[gD,fD];function TD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-down`],width:"1em",height:"1em"},o.$attrs),mD,16,_D)}var ED=Ns($D,[["render",TD]]);const bD={name:"IconUp",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},vD=["fill"],ID=Le("defs",null,[Le("clipPath",{id:"svg_46c48bec0d__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),OD=Le("g",{"clip-path":"url(#svg_46c48bec0d__a)"},[Le("path",{d:"M34.5848,31.4132L34.5858,31.4142Q34.7251,31.5535,34.8889,31.6629Q35.0526,31.772399999999998,35.2346,31.8478Q35.4166,31.923099999999998,35.6098,31.9616Q35.803,32,36,32Q36.197,32,36.3902,31.9616Q36.5834,31.923099999999998,36.7654,31.8478Q36.9474,31.772399999999998,37.1111,31.6629Q37.2749,31.5535,37.4142,31.4142Q37.5535,31.274900000000002,37.6629,31.1111Q37.772400000000005,30.947400000000002,37.8478,30.7654Q37.923100000000005,30.583399999999997,37.961600000000004,30.3902Q38,30.197,38,30Q38,29.803,37.961600000000004,29.6098Q37.923100000000005,29.416600000000003,37.8478,29.2346Q37.772400000000005,29.052599999999998,37.6629,28.8889Q37.5535,28.725099999999998,37.4142,28.5858L25.4142,16.58579Q25.274900000000002,16.4465,25.1111,16.33706Q24.947400000000002,16.22762,24.7654,16.15224Q24.583399999999997,16.07686,24.3902,16.038429999999998Q24.197,16,24,16Q23.803,16,23.6098,16.038429999999998Q23.416600000000003,16.07686,23.2346,16.15224Q23.052599999999998,16.22762,22.8889,16.33706Q22.725099999999998,16.4465,22.5858,16.58579L10.58654,28.585L10.58579,28.5858Q10.4465,28.725099999999998,10.33706,28.8889Q10.22762,29.052599999999998,10.152239999999999,29.2346Q10.07686,29.416600000000003,10.03843,29.6098Q10,29.803,10,30Q10,30.048099999999998,10.00231,30.0961Q10.01119,30.2807,10.05376,30.4606Q10.09634,30.6405,10.17116,30.8095Q10.245989999999999,30.9786,10.35053,31.131Q10.45507,31.2835,10.58579,31.4142Q10.72507,31.5535,10.88886,31.6629Q11.052645,31.772399999999998,11.234633,31.8478Q11.416621,31.923099999999998,11.609819,31.9616Q11.803017,32,12,32Q12.196983,32,12.390181,31.9616Q12.583378,31.923099999999998,12.765367,31.8478Q12.947355,31.772399999999998,13.11114,31.6629Q13.27493,31.5535,13.41421,31.4142L13.41496,31.4135L24,20.82843L34.5848,31.4132Z","fill-rule":"evenodd"})],-1),CD=[ID,OD];function yD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-up`],width:"1em",height:"1em"},o.$attrs),CD,16,vD)}var SD=Ns(bD,[["render",yD]]);const lr=X5("main",()=>{const o=BE(null),n=BE(null),s=ge(!1),l=ge(!1);return{workspaceSvg:o,searchPlugin:n,hasLayoutSider:s,searchVisible:l}});const RD={id:"codespace"},xb="未检测到积木块",kD={__name:"Codespace",setup(o){const n=ge(xb),s=lr();zt(()=>{s.workspaceSvg.addChangeListener(()=>{n.value=Ve.pythonGenerator.workspaceToCode(s.workspaceSvg)||xb})});function l(){s.hasLayoutSider=!1}return(a,u)=>{const d=_t("highlightjs"),h=TI;return me(),it(h,{style:{overflow:"auto"}},{default:De(()=>[Le("div",RD,[Le("div",null,[Q(Xo(s2),{onClick:l})]),Le("div",null,[Q(d,{autodetect:"",code:n.value},null,8,["code"])])])]),_:1})}}};Tt.dialog.setAlert(function(o,n){dn.confirm({title:"注意",content:o,okText:"确认",onCancel:n,onOk:n,hideCancel:!0})});Tt.dialog.setConfirm(function(o,n){dn.confirm({title:"注意",content:o,okText:"确认",cancelText:"取消",onCancel:function(){n(!1)},onOk:function(){n(!0)}})});Tt.dialog.setPrompt(function(o,n,s){dn.confirm({title:o.replace(":",""),content:()=>Zs(mg,{defaultValue:n,id:"dialog-input"}),okText:"确认",cancelText:"取消",onCancel:function(){s(null)},onOk:function(){s(document.querySelector("#dialog-input input").value)}})});const AD={};const LD="/assets/boxy-1d58dca5.png";function i2(o){return G0()?(Jb(o),!0):!1}function ND(o){return typeof o=="function"?o():Xo(o)}const wD=typeof window<"u";/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */var n2=DD,Bb=PD,MD=Object.prototype.toString,yu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function DD(o,n){if(typeof o!="string")throw new TypeError("argument str must be a string");for(var s={},l=n||{},a=l.decode||xD,u=0;u{if(!this.HAS_DOCUMENT_COOKIE)return;const a=this.cookies;this.cookies=n2(document.cookie),this._checkChanges(a)};const l=typeof document>"u"?"":document.cookie;this.cookies=VD(n||l),this.defaultSetOptions=s,this.HAS_DOCUMENT_COOKIE=HD()}_emitChange(n){for(let s=0;s{n[l]!==this.cookies[l]&&this._emitChange({name:l,value:p0(n[l])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(n,s={}){return s.doNotUpdate||this.update(),p0(this.cookies[n],s)}getAll(n={}){n.doNotUpdate||this.update();const s={};for(let l in this.cookies)s[l]=p0(this.cookies[l],n);return s}set(n,s,l){l?l=Object.assign(Object.assign({},this.defaultSetOptions),l):l=this.defaultSetOptions;const a=typeof s=="string"?s:JSON.stringify(s);this.cookies=Object.assign(Object.assign({},this.cookies),{[n]:a}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Bb(n,a,l)),this._emitChange({name:n,value:s,options:l})}remove(n,s){const l=s=Object.assign(Object.assign({},s),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[n],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Bb(n,"",l)),this._emitChange({name:n,value:void 0,options:s})}addChangeListener(n){this.changeListeners.push(n),this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(n){const s=this.changeListeners.indexOf(n);s>=0&&this.changeListeners.splice(s,1),this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}var zD=Object.defineProperty,Fb=Object.getOwnPropertySymbols,XD=Object.prototype.hasOwnProperty,jD=Object.prototype.propertyIsEnumerable,Ub=(o,n,s)=>n in o?zD(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Hb=(o,n)=>{for(var s in n||(n={}))XD.call(n,s)&&Ub(o,s,n[s]);if(Fb)for(var s of Fb(n))jD.call(n,s)&&Ub(o,s,n[s]);return o};function r2(o,{doNotParse:n=!1,autoUpdateDependencies:s=!1}={},l=new WD){const a=s?[...o||[]]:o;let u=l.getAll({doNotParse:!0});const d=ge(0),h=()=>{const p=l.getAll({doNotParse:!0});YD(a||null,p,u)&&d.value++,u=p};return l.addChangeListener(h),i2(()=>{l.removeChangeListener(h)}),{get:(...p)=>(s&&a&&!a.includes(p[0])&&a.push(p[0]),d.value,l.get(p[0],Hb({doNotParse:n},p[1]))),getAll:(...p)=>(d.value,l.getAll(Hb({doNotParse:n},p[0]))),set:(...p)=>l.set(...p),remove:(...p)=>l.remove(...p),addChangeListener:(...p)=>l.addChangeListener(...p),removeChangeListener:(...p)=>l.removeChangeListener(...p)}}function YD(o,n,s){if(!o)return!0;for(const l of o)if(n[l]!==s[l])return!0;return!1}const KD={id:"modal-content"},QD=Le("p",null,"积木盒宽度",-1),qD=Le("p",null,"主题",-1),JD=Le("span",{style:{color:"var(--color-text-4)"}},"Copyright 2023 Coconut Studio",-1),ZD={__name:"Settings",setup(o,{expose:n}){const s=r2(["flyout","theme"]),l=ge(!1),a=ge(s.get("flyout")||"full"),u=ge(s.get("theme")||"auto");function d(){l.value=!0}function h(){const y=document.querySelector("div.injectionDiv > svg.blocklyFlyout");y&&(y.style.width="320px")}function p(y){h(),a.value=y,s.set("flyout",y)}function f(y){let S=y;y==="auto"&&(S=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.body.setAttribute("arco-theme",S)}function T(y){f(y),u.value=y,s.set("theme",y)}return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(y){u.value==="auto"&&f(y.matches?"dark":"light")}),zt(()=>{let y=document.createElement("style");y.innerHTML="* { transition: color ease 50ms, background-color ease 200ms, border ease 300ms; }",document.head.appendChild(y)}),f(s.get("theme")||"auto"),n({handleClick:d}),(y,S)=>{const P=uw,x=Mu,G=Og,oe=ll,ne=yI,Z=dn;return me(),it(Z,{visible:l.value,"onUpdate:visible":S[0]||(S[0]=Y=>l.value=Y),width:"auto",footer:"false"},{title:De(()=>[Ut("设置")]),footer:De(()=>[JD]),default:De(()=>[Le("div",KD,[Q(G,null,{default:De(()=>[QD,Q(x,{"model-value":a.value,onChange:p,type:"button"},{default:De(()=>[Q(P,{value:"full"},{default:De(()=>[Ut("适应")]),_:1}),Q(P,{value:"fixed"},{default:De(()=>[Ut("固定")]),_:1})]),_:1},8,["model-value"])]),_:1}),Q(G,null,{default:De(()=>[qD,Q(ne,{"model-value":u.value,onChange:T,style:{"text-align":"justify"}},{default:De(()=>[Q(oe,{value:"light"},{icon:De(()=>[Q(Xo(Y8))]),default:De(()=>[Ut("白天模式")]),_:1}),Q(oe,{value:"dark"},{icon:De(()=>[Q(Xo(g8))]),default:De(()=>[Ut("黑夜模式")]),_:1}),Q(oe,{value:"auto"},{icon:De(()=>[Q(Xo(V8))]),default:De(()=>[Ut("跟随系统")]),_:1})]),_:1},8,["model-value"])]),_:1})])]),_:1},8,["visible"])}}};const e7={id:"modal-content"},t7={style:{"margin-bottom":"16px"}},o7=Le("span",{style:{color:"var(--color-text-4)"}},"Copyright 2023 Coconut Studio",-1),s7={__name:"Pip",setup(o,{expose:n}){const s=ge(!1),l=ge([]),a=ge(""),u=ge("");function d(){s.value=!0,h()}async function h(){try{const T=await(await fetch("./api/pipList")).json();l.value=T.pipList}catch(f){console.error("获取 Pip 列表失败:",f)}}async function p(){try{const T=await(await fetch("/api/pipInstall",{method:"GET",params:{packageName:a.value,installSource:u.value}})).json();console.log(T)}catch(f){console.error("安装失败:",f)}}return n({handlePipClick:d}),(f,T)=>{const y=mg,S=ll,P=yI,x=Vc,G=dn;return me(),it(G,{visible:s.value,"onUpdate:visible":T[2]||(T[2]=oe=>s.value=oe),width:"auto",footer:"false"},{title:De(()=>[Ut("Pip 列表")]),footer:De(()=>[o7]),default:De(()=>[Le("div",e7,[Le("div",t7,[Q(y,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=oe=>a.value=oe),placeholder:"请输入库名称",style:{width:"200px","margin-right":"8px"}},null,8,["modelValue"]),Q(P,{modelValue:u.value,"onUpdate:modelValue":T[1]||(T[1]=oe=>u.value=oe),placeholder:"请选择安装源",style:{width:"200px","margin-right":"8px"}},{default:De(()=>[Q(S,{value:"https://pypi.org/simple"},{default:De(()=>[Ut("PyPI")]),_:1}),Q(S,{value:"https://pypi.tuna.tsinghua.edu.cn/simple"},{default:De(()=>[Ut("清华大学")]),_:1}),Q(S,{value:"https://pypi.mirrors.ustc.edu.cn/simple"},{default:De(()=>[Ut("中国科学技术大学")]),_:1}),Q(S,{value:"https://pypi.org/simple"},{default:De(()=>[Ut("中国科技大学")]),_:1})]),_:1},8,["modelValue"]),Q(x,{type:"primary",onClick:p},{default:De(()=>[Ut("安装")]),_:1})]),Le("ul",null,[(me(!0),Fe(Wt,null,id(l.value,(oe,ne)=>(me(),Fe("li",{key:ne},Ci(oe[0]),1))),128))])])]),_:1},8,["visible"])}}};const i7=Le("img",{alt:"Logo",src:LD,width:"36",height:"36"},null,-1),n7=[i7],r7={class:"navigatorMenu"},l7={__name:"Navigator",setup(o){const n=ge(),s=ge(),l=ge(),a=lr();function u(){Tt.hideChaff()}function d(){const S=Tt.serialization.workspaces.save(a.workspaceSvg),P=JSON.stringify(S),x=new Blob([P],{type:"text/plain;charset=utf-8"}),G=URL.createObjectURL(x),oe=document.createElement("a");oe.href=G,oe.download="project.boxy",oe.click(),n.value=!1}function h(){const S=document.createElement("input");S.setAttribute("type","file"),S.setAttribute("name","file"),S.setAttribute("visibility","hidden"),S.setAttribute("accept",".boxy"),S.addEventListener("change",function(){const P=this.files[0],x=new FileReader;x.addEventListener("load",function(){const G=JSON.parse(this.result);Tt.serialization.workspaces.load(G,a.workspaceSvg)}),x.readAsText(P)}),S.click(),n.value=!1}function p(){a.searchVisible=!0,n.value=!1}function f(){s.value.handleClick(),n.value=!1}function T(){window.open("https://www.yuque.com/hzsn/boxy"),n.value=!1}function y(){l.value.handlePipClick(),n.value=!1}return(S,P)=>{const x=NN,G=yw,oe=zu;return me(),Fe(Wt,null,[Q(oe,{trigger:["hover","click"],position:"rt","popup-visible":n.value,"onUpdate:popupVisible":P[0]||(P[0]=ne=>n.value=ne)},{content:De(()=>[Le("div",r7,[Q(x,null,{default:De(()=>[Ut("新建")]),_:1}),Q(x,{onClick:y},{default:De(()=>[Ut("PIP库管理")]),_:1}),Q(x,{onClick:d},{default:De(()=>[Ut("保存到电脑")]),_:1}),Q(x,{onClick:h},{default:De(()=>[Ut("打开本地文件")]),_:1}),Q(G,{margin:"1px"}),Q(x,{onClick:p},{default:De(()=>[Ut("查找")]),_:1}),Q(G,{margin:"1px"}),Q(x,{onClick:f},{default:De(()=>[Ut("设置")]),_:1}),Q(x,{onClick:T},{default:De(()=>[Ut("关于")]),_:1})])]),default:De(()=>[Le("div",{id:"logo",onClick:u},n7)]),_:1},8,["popup-visible"]),Q(ZD,{ref_key:"modal",ref:s},null,512),Q(s7,{ref_key:"pipModal",ref:l},null,512)],64)}}};const c7={__name:"Screenshot",setup(o){const n=ge(),s=ge();function l(){const h=document.createElement("a");h.download="block.png",h.href=n.value,h.click()}function a(h){const p=document.createElement("img"),f=document.createElement("canvas"),T=f.getContext("2d"),y=Math.sqrt(40);f.width=h.width*y,f.height=h.height*y,p.onload=function(){T.drawImage(p,0,0,h.width,h.height,0,0,f.width,f.height);try{n.value=f.toDataURL("image/png"),s.value=!0}catch{console.warn("Error converting the workspace svg to a png.")}},p.src=h.data}function u(h,p){const f=document.getElementsByTagName("textarea");for(const R of f)R.innerHTML=R.value;const T=h.getBlocksBoundingBox(),y=T.x||T.left,S=T.y||T.top,P=T.width||T.right-y,x=T.height||T.bottom-S,oe=h.getCanvas().cloneNode(!0);oe.removeAttribute("transform");const ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.appendChild(oe),ne.setAttribute("viewBox",y+" "+S+" "+P+" "+x),ne.setAttribute("class","blocklySvg "+(h.options.renderer||"geras")+"-renderer "+(h.getTheme?h.getTheme().name+"-theme":"")),ne.setAttribute("width",P),ne.setAttribute("height",x),ne.setAttribute("style","background-color: transparent");const Z=[].slice.call(document.head.querySelectorAll("style")).filter(R=>/\.blocklySvg/.test(R.innerText)||R.id.indexOf("blockly-")===0).map(R=>R.innerText).join(` +`),Y=document.createElement("style");Y.innerHTML=Z+` +`+p,ne.insertBefore(Y,ne.firstChild);let M=new XMLSerializer().serializeToString(ne);return M=M.replace(/ /g," "),{data:"data:image/svg+xml,"+encodeURIComponent(M),width:P,height:x}}function d(h){const p=document.createElement("div"),f={blocks:{languageVersion:0,blocks:[h.block.toCopyData().saveInfo]}},T=Tt.inject(p,{readOnly:!0,theme:"codemao",renderer:"codemao"});return Tt.serialization.workspaces.load(f,T),T}return zt(()=>{Tt.ContextMenuRegistry.registry.register({callback:function(h){a(u(d(h)))},scopeType:Tt.ContextMenuRegistry.ScopeType.BLOCK,displayText:"生成积木图片",preconditionFn:function(){return"enabled"},id:"BlcokImage"}),Tt.ContextMenuRegistry.registry.register({callback:function(h){a(u(h.workspace))},scopeType:Tt.ContextMenuRegistry.ScopeType.WORKSPACE,displayText:"全局预览",preconditionFn:function(h){return h.workspace.blockDB.size?"enabled":"disabled"},id:"WorkspaceImage"})}),(h,p)=>{const f=kI,T=F6;return me(),it(T,{src:n.value,"onUpdate:src":p[0]||(p[0]=y=>n.value=y),visible:s.value,"onUpdate:visible":p[1]||(p[1]=y=>s.value=y)},{actions:De(()=>[Q(f,{name:"下载",onClick:l},{default:De(()=>[Q(Xo(rD))]),_:1})]),_:1},8,["src","visible"])}}};const a7={id:"search"},u7={__name:"Search",setup(o){const n=ge(),s=lr();function l(){n.value=!0}function a(){n.value=!1,s.searchPlugin.close()}function u(T){s.searchPlugin.searchAndHighlight(T)}function d(){s.searchPlugin.next()}function h(){s.searchPlugin.previous()}function p(){s.searchPlugin.next()}function f(){s.searchVisible=!1}return zt(()=>{s.workspaceSvg.injectionDiv.addEventListener("keydown",T=>{(T.ctrlKey||T.metaKey)&&T.key==="f"&&(s.searchVisible=!0,T.preventDefault(),T.stopPropagation())}),Et(s.$state,T=>{T.searchVisible?l():a()}),a()}),(T,y)=>{const S=Vc,P=mg,x=Og;return me(),Fe("div",a7,[Q(x,{style:It({display:n.value?"block":"none"})},{default:De(()=>[Q(P,{placeholder:"搜索作品中的积木",onInput:u,onPressEnter:d},{append:De(()=>[Q(S,{type:"text",onClick:h,"aria-label":"整理"},{icon:De(()=>[Q(Xo(SD))]),_:1}),Q(S,{type:"text",onClick:p,"aria-label":"整理"},{icon:De(()=>[Q(Xo(ED))]),_:1}),Q(S,{type:"text",onClick:f,"aria-label":"关闭"},{icon:De(()=>[Q(Xo(s2))]),_:1})]),_:1})]),_:1},8,["style"])])}}};function d7(o){var n;const s=ND(o);return(n=s==null?void 0:s.$el)!=null?n:s}const h7=wD?window:void 0;function p7(){const o=ge(!1);return ml()&&zt(()=>{o.value=!0}),o}function $7(o){const n=p7();return j(()=>(n.value,!!o()))}var Vb=Object.getOwnPropertySymbols,_7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,f7=(o,n)=>{var s={};for(var l in o)_7.call(o,l)&&n.indexOf(l)<0&&(s[l]=o[l]);if(o!=null&&Vb)for(var l of Vb(o))n.indexOf(l)<0&&g7.call(o,l)&&(s[l]=o[l]);return s};function l2(o,n,s={}){const l=s,{window:a=h7}=l,u=f7(l,["window"]);let d;const h=$7(()=>a&&"MutationObserver"in a),p=()=>{d&&(d.disconnect(),d=void 0)},f=Et(()=>d7(o),y=>{p(),h.value&&a&&y&&(d=new MutationObserver(n),d.observe(y,u))},{immediate:!0}),T=()=>{p(),f()};return i2(T),{isSupported:h,stop:T}}const Gb="/assets/superellipse-abb4b598.svg";const m7={__name:"Toolbox",setup(o){class n extends Tt.ToolboxCategory{constructor(){super(...arguments);J$(this,"setSelected",u=>{let d=this.rowDiv_.getElementsByClassName("blocklyTreeLabel")[0];u?(this.rowDiv_.style.backgroundColor="rgb(var(--primary-5))",d.style.color="var(--color-white)"):(this.rowDiv_.style.backgroundColor="",d.style.color=""),Tt.utils.aria.setState(this.htmlDiv_,Tt.utils.aria.State.SELECTED,u)});J$(this,"createIconDom_",()=>{const u=document.createElement("iconpark-icon");return u.name=this.toolboxItemDef_.categorystyle,u.size="21",u.style=` + -webkit-mask-size: 100% 100%; + -webkit-mask-image: url(${Gb}); + mask-size: 100% 100%; + mask-image: url(${Gb}); + color: white; + `,u})}addColourBorder_(u){this.rowDiv_.children[0].children[0].style.backgroundColor=u}}Tt.registry.register(Tt.registry.Type.TOOLBOX_ITEM,Tt.ToolboxCategory.registrationName,n,!0),Tt.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=.8;let l=0;const a=this.workspace_.getTopBlocks(!1);for(const u of a){let d=u.getHeightWidth().width;u.outputConnection&&(d-=this.tabWidth_),l=Math.max(l,d)}for(const u of this.buttons_)l=Math.max(l,u.width);if(l+=this.MARGIN*1.5+this.tabWidth_,l*=this.workspace_.scale,l+=Tt.Scrollbar.scrollbarThickness,this.width_!==l){for(const u of a){if(this.RTL){const d=u.getRelativeToSurfaceXY().x;let h=l/this.workspace_.scale-this.MARGIN;u.outputConnection||(h-=this.tabWidth_),u.moveBy(h-d,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(const u of this.buttons_){const d=u.getPosition().y,h=l/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_;u.moveTo(h,d)}this.targetWorkspace.toolboxPosition===this.toolboxPosition_&&this.toolboxPosition_===Tt.utils.toolbox.Position.LEFT&&!this.targetWorkspace.getToolbox()&&this.targetWorkspace.translate(this.targetWorkspace.scrollX+l,this.targetWorkspace.scrollY),this.width_=l,this.position(),this.targetWorkspace.recordDragTargets()}};const s=r2(["flyout"]);return zt(()=>{const l=document.querySelector("#app > section > main > div.blocklyDiv > div > svg.blocklyFlyout");l2(l,()=>{const a=s.get("flyout"),u=Math.max(parseInt(l.getAttribute("width")),320),d=l.style.display==="block";l.style.width=a==="fixed"||!d?"320px":`${u}px`,l.style.transform=d?"translate(60px, 0px)":`translate(${60-(a==="full"?u:320)}px, 0px)`},{attributeFilter:["style"]}),l.addEventListener("mouseenter",()=>{s.get("flyout")==="fixed"&&(l.style.minWidth=l.getAttribute("width")+"px")}),l.addEventListener("mouseleave",()=>{s.get("flyout")==="fixed"&&(l.style.minWidth="320px")})}),()=>{}}},T7="/assets/trashcan_lid-bf343e64.svg",E7="/assets/trashcan_body-d3f2460a.svg";const b7={__name:"Trashcan",setup(o){const n=lr(),s=ge(),l=ge(),a=ge();function u(){s.value.style.zIndex=6,l.value.style.zIndex=7,a.value.style.zIndex=7,s.value.style.opacity=1,l.value.style.opacity=1,a.value.style.opacity=1}function d(){s.value.style.zIndex=0,l.value.style.zIndex=0,a.value.style.zIndex=0,s.value.style.opacity=0,l.value.style.opacity=0,a.value.style.opacity=0}function h(){l.value.style.transform="translate(-4px,-4px) rotate(-20deg)"}function p(){l.value.style.transform="translate(0px, 0px) rotate(0deg)"}return zt(()=>{l2(document.querySelector("#app > section > main > div.blocklyDiv > div > div"),f=>{f[0].target.classList.contains("blocklyToolboxDelete")?h():p()},{attributeFilter:["class"]}),n.workspaceSvg.addChangeListener(f=>{f.type==="drag"?u():f.type==="move"&&f.oldCoordinate!==void 0&&d()})}),(f,T)=>(me(),Fe("div",{ref_key:"trashcan",ref:s,id:"trashcan",class:"blocklyToolboxDelete",style:{cursor:"grabbing"}},[Le("img",{ref_key:"trashcanLid",ref:l,src:T7,alt:"垃圾桶盖"},null,512),Le("img",{ref_key:"trashcanBody",ref:a,src:E7,alt:"垃圾桶身"},null,512)],512))}};var v7={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(o,n){(function(s,l){o.exports=l(Gc())})(Do,s=>(()=>{var l={573:h=>{h.exports=s}},a={};function u(h){var p=a[h];if(p!==void 0)return p.exports;var f=a[h]={exports:{}};return l[h](f,f.exports,u),f.exports}u.n=h=>{var p=h&&h.__esModule?()=>h.default:()=>h;return u.d(p,{a:p}),p},u.d=(h,p)=>{for(var f in p)u.o(p,f)&&!u.o(h,f)&&Object.defineProperty(h,f,{enumerable:!0,get:p[f]})},u.o=(h,p)=>Object.prototype.hasOwnProperty.call(h,p),u.r=h=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})};var d={};return(()=>{u.r(d);var h=u(573),p=u.n(h);function f(L){if(L.saveExtraState){const R=L.saveExtraState();return R?JSON.stringify(R):""}if(L.mutationToDom){const R=L.mutationToDom();return R?h.Xml.domToText(R):""}return""}function T(L){const R=new h.FieldImage(S,15,15,void 0,y);return R.args_=L,R}function y(L){const R=L.getSourceBlock();if(R.isInFlyout)return;h.Events.setGroup(!0);const F=f(R);R.minus(L.args_);const z=f(R);F!=z&&h.Events.fire(new h.Events.BlockChange(R,"mutation",null,F,z)),h.Events.setGroup(!1)}const S="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K";function P(L){const R=new h.FieldImage(G,15,15,void 0,x);return R.args_=L,R}function x(L){const R=L.getSourceBlock();if(R.isInFlyout)return;h.Events.setGroup(!0);const F=f(R);R.plus(L.args_);const z=f(R);F!=z&&h.Events.fire(new h.Events.BlockChange(R,"mutation",null,F,z)),h.Events.setGroup(!1)}const G="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==",oe={elseIfCount_:0,hasElse_:!1,mutationToDom:function(){if(!this.elseIfCount_&&!this.hasElse_)return null;const L=p().utils.xml.createElement("mutation");return L.setAttribute("elseif",this.elseIfCount_),this.hasElse_&&L.setAttribute("else",1),L},domToMutation:function(L){const R=parseInt(L.getAttribute("elseif"),10)||0;this.hasElse_=!!parseInt(L.getAttribute("else"),10)||0,this.hasElse_&&!this.getInput("ELSE")&&this.appendStatementInput("ELSE").appendField(p().Msg.CONTROLS_IF_MSG_ELSE),this.updateShape_(R)},saveExtraState:function(){if(!this.elseIfCount_&&!this.hasElse_)return null;const L=Object.create(null);return this.elseIfCount_&&(L.elseIfCount=this.elseIfCount_),this.hasElse_&&(L.hasElse=!0),L},loadExtraState:function(L){const R=L.elseIfCount||0;this.hasElse_=L.hasElse||!1,this.hasElse_&&!this.getInput("ELSE")&&this.appendStatementInput("ELSE").appendField(p().Msg.CONTROLS_IF_MSG_ELSE),this.updateShape_(R)},updateShape_:function(L){for(;this.elseIfCount_L;)this.removeElseIf_()},plus:function(){this.addElseIf_()},minus:function(L){this.elseIfCount_!=0&&this.removeElseIf_(L)},addElseIf_:function(){this.elseIfCount_++,this.appendValueInput("IF"+this.elseIfCount_).setCheck("Boolean").appendField(p().Msg.CONTROLS_IF_MSG_ELSEIF).appendField(T(this.elseIfCount_),"MINUS"+this.elseIfCount_),this.appendStatementInput("DO"+this.elseIfCount_).appendField(p().Msg.CONTROLS_IF_MSG_THEN),this.getInput("ELSE")&&this.moveInputBefore("ELSE",null)},removeElseIf_:function(L){if(L!==void 0&&L!=this.elseIfCount_){const R=2*L,F=this.inputList;let z=F[R].connection;z.isConnected()&&z.disconnect(),z=F[R+1].connection,z.isConnected()&&z.disconnect(),this.bumpNeighbours();for(let X,le=R+2;(X=this.inputList[le])&&X.name!="ELSE";le++){const $e=X.connection.targetConnection;$e&&this.inputList[le-2].connection.connect($e)}}this.removeInput("IF"+this.elseIfCount_),this.removeInput("DO"+this.elseIfCount_),this.elseIfCount_--}};p().Extensions.isRegistered("controls_if_mutator")&&p().Extensions.unregister("controls_if_mutator"),p().Extensions.registerMutator("controls_if_mutator",oe,function(){this.getInput("IF0").insertFieldAt(0,P(),"PLUS")}),delete p().Blocks.lists_create_with,p().defineBlocksWithJsonArray([{type:"lists_create_with",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE} %1",args0:[{type:"input_dummy",name:"EMPTY"}],output:"Array",style:"list_blocks",helpUrl:"%{BKY_LISTS_CREATE_WITH_HELPURL}",tooltip:"%{BKY_LISTS_CREATE_WITH_TOOLTIP}",mutator:"new_list_create_with_mutator"}]);const ne={itemCount_:0,mutationToDom:function(){const L=p().utils.xml.createElement("mutation");return L.setAttribute("items",this.itemCount_),L},domToMutation:function(L){const R=parseInt(L.getAttribute("items"),10);this.updateShape_(R)},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(L){this.updateShape_(L.itemCount)},updateShape_:function(L){for(;this.itemCount_L;)this.removePart_();this.updateMinus_()},plus:function(){this.addPart_(),this.updateMinus_()},minus:function(){this.itemCount_!=0&&(this.removePart_(),this.updateMinus_())},addPart_:function(){this.itemCount_==0?(this.removeInput("EMPTY"),this.topInput_=this.appendValueInput("ADD"+this.itemCount_).appendField(P(),"PLUS").appendField(p().Msg.LISTS_CREATE_WITH_INPUT_WITH)):this.appendValueInput("ADD"+this.itemCount_),this.itemCount_++},removePart_:function(){this.itemCount_--,this.removeInput("ADD"+this.itemCount_),this.itemCount_==0&&(this.topInput_=this.appendDummyInput("EMPTY").appendField(P(),"PLUS").appendField(p().Msg.LISTS_CREATE_EMPTY_TITLE))},updateMinus_:function(){const L=this.getField("MINUS");!L&&this.itemCount_>0?this.topInput_.insertFieldAt(1,T(),"MINUS"):L&&this.itemCount_<1&&this.topInput_.removeField("MINUS")}};p().Extensions.registerMutator("new_list_create_with_mutator",ne,function(){this.getInput("EMPTY").insertFieldAt(0,P(),"PLUS"),this.updateShape_(3)}),p().Msg.PROCEDURE_VARIABLE="variable:",delete p().Blocks.procedures_defnoreturn,delete p().Blocks.procedures_defreturn,p().defineBlocksWithJsonArray([{type:"procedures_defnoreturn",message0:"%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2",message1:"%{BKY_PROCEDURES_DEFNORETURN_DO} %1",args0:[{type:"field_input",name:"NAME",text:""},{type:"input_dummy",name:"TOP"}],args1:[{type:"input_statement",name:"STACK"}],style:"procedure_blocks",helpUrl:"%{BKY_PROCEDURES_DEFNORETURN_HELPURL}",tooltip:"%{BKY_PROCEDURES_DEFNORETURN_TOOLTIP}",extensions:["get_procedure_def_no_return","procedure_context_menu","procedure_rename","procedure_vars"],mutator:"procedure_def_mutator"},{type:"procedures_defreturn",message0:"%{BKY_PROCEDURES_DEFRETURN_TITLE} %1 %2",message1:"%{BKY_PROCEDURES_DEFRETURN_DO} %1",message2:"%{BKY_PROCEDURES_DEFRETURN_RETURN} %1",args0:[{type:"field_input",name:"NAME",text:""},{type:"input_dummy",name:"TOP"}],args1:[{type:"input_statement",name:"STACK"}],args2:[{type:"input_value",align:"right",name:"RETURN"}],style:"procedure_blocks",helpUrl:"%{BKY_PROCEDURES_DEFRETURN_HELPURL}",tooltip:"%{BKY_PROCEDURES_DEFRETURN_TOOLTIP}",extensions:["get_procedure_def_return","procedure_context_menu","procedure_rename","procedure_vars"],mutator:"procedure_def_mutator"}]),p().Extensions.registerMixin("get_procedure_def_no_return",{getProcedureDef:function(){const L=this.argData_.map(R=>R.model.name);return[this.getFieldValue("NAME"),L,!1]},callType_:"procedures_callnoreturn"}),p().Extensions.registerMixin("get_procedure_def_return",{getProcedureDef:function(){const L=this.argData_.map(R=>R.model.name);return[this.getFieldValue("NAME"),L,!0]},callType_:"procedures_callreturn"});const Z={customContextMenu:function(L){if(this.isInFlyout)return;const R=this.getFieldValue("NAME"),F=p().Msg.PROCEDURES_CREATE_DO.replace("%1",R),z=p().utils.xml.createElement("block");z.setAttribute("type",this.callType_),z.appendChild(this.mutationToDom(!0));const X=p().ContextMenu.callbackFactory(this,z);if(L.push({enabled:!0,text:F,callback:X}),this.isCollapsed())return;const le=this.getVarModels();for(const $e of le){const he=p().Msg.VARIABLES_SET_CREATE_GET.replace("%1",$e.name),fe=p().utils.xml.createElement("block");fe.setAttribute("type","variables_get"),fe.appendChild(p().Variables.generateVariableFieldDom($e));const ke=p().ContextMenu.callbackFactory(this,fe);L.push({enabled:!0,text:he,callback:ke})}}};p().Extensions.registerMixin("procedure_context_menu",Z);const Y={mutationToDom:function(L=!1){const R=p().utils.xml.createElement("mutation");return L&&R.setAttribute("name",this.getFieldValue("NAME")),this.argData_.forEach(F=>{const z=p().utils.xml.createElement("arg"),X=F.model;z.setAttribute("name",X.name),z.setAttribute("varid",X.getId()),z.setAttribute("argid",F.argId),L&&z.setAttribute("paramid",F.argId),R.appendChild(z)}),this.hasStatements_||R.setAttribute("statements","false"),R},domToMutation:function(L){this.hasStatements_=L.getAttribute("statements")!=="false",this.hasStatements_||this.removeInput("STACK");const R=[],F=[],z=[];for(const X of L.childNodes)X.nodeName.toLowerCase()=="arg"&&(R.push(X.getAttribute("name")),F.push(X.getAttribute("varid")||X.getAttribute("varId")),z.push(X.getAttribute("argid")));this.updateShape_(R,F,z)},saveExtraState:function(){if(!this.argData_.length&&this.hasStatements_)return null;const L=Object.create(null);return this.argData_.length&&(L.params=[],this.argData_.forEach(R=>{const F=R.model;L.params.push({name:F.name,id:F.getId(),argId:R.argId})})),this.hasStatements_||(L.hasStatements=!1),L},loadExtraState:function(L){this.hasStatements_=L.hasStatements!==!1,this.hasStatements_||this.removeInput("STACK");const R=[],F=[],z=[];if(L.params)for(let X=0;X=0;X--)this.removeArg_(this.argData_[X].argId);this.argData_=[];const z=R.length;for(let X=0;Xle.model.name);L=L||p().Variables.generateUniqueNameFromOptions(p().Procedures.DEFAULT_ARG,z);const X=p().Variables.getOrCreateVariablePackage(this.workspace,R,L,"");F=F||p().utils.idGenerator.genUid(),this.addVarInput_(L,F),this.getInput("STACK")?this.moveInputBefore(F,"STACK"):this.moveInputBefore(F,"RETURN"),this.argData_.push({model:X,argId:F})},removeArg_:function(L){this.removeInput(L,!0)&&(this.argData_.length==1&&this.getInput("TOP").removeField("WITH"),this.argData_=this.argData_.filter(R=>R.argId!=L))},addVarInput_:function(L,R){const F=new(p()).FieldTextInput(L,this.validator_);F.onFinishEditing_=this.finishEditing_.bind(F),F.varIdsToDelete_=[],F.preEditVarModel_=null,this.appendDummyInput(R).setAlign(p().ALIGN_RIGHT).appendField(T(R)).appendField(p().Msg.PROCEDURE_VARIABLE).appendField(F,R)},validator_:function(L){const R=this.getSourceBlock(),F=R.workspace,z=R.argData_,X=R.argData_.find(fe=>fe.argId==this.name),le=X.model.getId(),$e=(L=L.replace(/[\s\xa0]+/g," ").trim()).toLowerCase();if(!L||!z.every(fe=>fe.argId==this.name||$e!=fe.model.name.toLowerCase()))return this.preEditVarModel_&&(X.model=this.preEditVarModel_,this.preEditVarModel_=null),p().Procedures.mutateCallers(R),null;this.varIdsToDelete_.length||(this.preEditVarModel_=X.model,F.getVariableUsesById(le).every(fe=>fe.id==R.id||fe.getProcedureCall&&fe.getProcedureCall()==R.getProcedureDef()[0])&&this.varIdsToDelete_.push(le));let he=F.getVariable(L,"");return he?he.name!=L&&F.renameVariableById(he.getId(),L):(he=F.createVariable(L,""),this.varIdsToDelete_.push(he.getId())),he.getId()!=le&&(X.model=he),p().Procedures.mutateCallers(R),L},finishEditing_:function(L){const R=this.getSourceBlock(),F=R.argData_.find(z=>z.argId==this.name).model.getId();this.varIdsToDelete_.forEach(z=>{z!=F&&R.workspace.deleteVariableById(z)}),this.varIdsToDelete_.length=0,this.preEditVarModel_=null}};p().Extensions.registerMutator("procedure_def_mutator",Y,function(){this.argData_=[],this.hasStatements_=!0,this.getInput("TOP").insertFieldAt(0,P(),"PLUS")}),p().Extensions.register("procedure_rename",function(){this.getField("NAME").setValidator(p().Procedures.rename)}),p().Extensions.register("procedure_vars",function(){const L={getVars:function(){return this.argData_.map(R=>R.model.name)},getVarModels:function(){return this.argData_.map(R=>R.model)},renameVarById:function(R,F){const z=this.argData_.find($e=>$e.model.getId()==R);if(!z)return;const X=this.workspace.getVariableById(F),le=X.name;this.addVarInput_(le,F),this.moveInputBefore(F,R),this.removeInput(R),z.model=X,p().Procedures.mutateCallers(this)},updateVarName:function(R){const F=R.getId(),z=this.argData_.find(X=>X.model.getId()==F);z&&(this.setFieldValue(R.name,z.argId),z.model=R)}};this.mixin(L,!0)});const M={itemCount_:0,mutationToDom:function(){const L=p().utils.xml.createElement("mutation");return L.setAttribute("items",this.itemCount_),L},domToMutation:function(L){const R=parseInt(L.getAttribute("items"),10);this.updateShape_(R)},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(L){this.updateShape_(L.itemCount)},updateShape_:function(L){for(;this.itemCount_L;)this.removePart_();this.updateMinus_()},plus:function(){this.addPart_(),this.updateMinus_()},minus:function(){this.itemCount_!=0&&(this.removePart_(),this.updateMinus_())},addPart_:function(){this.itemCount_==0?(this.getInput("EMPTY")&&this.removeInput("EMPTY"),this.topInput_=this.appendValueInput("ADD"+this.itemCount_).appendField(P(),"PLUS").appendField(p().Msg.TEXT_JOIN_TITLE_CREATEWITH)):this.appendValueInput("ADD"+this.itemCount_),this.itemCount_++},removePart_:function(){this.itemCount_--,this.removeInput("ADD"+this.itemCount_),this.itemCount_==0&&(this.topInput_=this.appendDummyInput("EMPTY").appendField(P(),"PLUS").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1)))},updateMinus_:function(){const L=this.getField("MINUS");!L&&this.itemCount_>0?this.topInput_.insertFieldAt(1,T(),"MINUS"):L&&this.itemCount_<1&&this.topInput_.removeField("MINUS")}};p().Extensions.isRegistered("text_join_mutator")&&p().Extensions.unregister("text_join_mutator"),p().Extensions.registerMutator("text_join_mutator",M,function(){p().Extensions.apply("text_quotes",this,!1),this.updateShape_(2)})})(),d})())})(v7);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const I7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNMTkgNi40MUwxNy41OSA1IDEyIDEwLjU5IDYuNDEgNSA1IDYuNDEgMTAuNTkgMTIgNSAxNy41OSA2LjQxIDE5IDEyIDEzLjQxIDE3LjU5IDE5IDE5IDE3LjU5IDEzLjQxIDEyeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=",O7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSA4LjU5TDEyIDEzLjE3bDQuNTktNC41OEwxOCAxMGwtNiA2LTYtNiAxLjQxLTEuNDF6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PC9zdmc+",C7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSAxNS40MUwxMiAxMC44M2w0LjU5IDQuNThMMTggMTRsLTYtNi02IDZ6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==",y7=["path.blocklyPath.blockly-ws-search-highlight {","fill: #000;","}","path.blocklyPath.blockly-ws-search-highlight.blockly-ws-search-current {","fill: grey;","}",".blockly-ws-search-close-btn {","background: url("+I7+") no-repeat top left;","}",".blockly-ws-search-next-btn {","background: url("+O7+") no-repeat top left;","}",".blockly-ws-search-previous-btn {","background: url("+C7+") no-repeat top left;","}",".blockly-ws-search {","background: #fff;","border: solid lightgrey 0.5px;","box-shadow: 0px 10px 20px grey;","justify-content: center;","padding: 0.25em;","position: absolute;","z-index: 70;","}",".blockly-ws-search-input input {","border: none;","}",".blockly-ws-search button {","border: none;","}",".blockly-ws-search-actions {","display: flex;","}",".blockly-ws-search-container {","display: flex;","}",".blockly-ws-search-content {","display: flex;","}"],S7=function(){let o=!1;return function(){if(o)return;o=!0;const n=y7.join(` +`),s=document.createElement("style");s.id="blockly-ws-search-style";const l=document.createTextNode(n);s.appendChild(l),document.head.insertBefore(s,document.head.firstChild)}}();var Wo=Gc();/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class R7{constructor(n){this.workspace_=n,this.id="workspaceSearch",this.htmlDiv_=null,this.actionDiv_=null,this.inputElement_=null,this.textInputPlaceholder_="Search",this.blocks_=[],this.currentBlockIndex_=-1,this.searchText_="",this.searchOnInput=!0,this.caseSensitive=!1,this.preserveSelected=!0,this.boundEvents_=[]}init(){this.workspace_.getComponentManager().addComponent({component:this,weight:0,capabilities:[Wo.ComponentManager.Capability.POSITIONABLE]}),S7(),this.createDom_(),this.setVisible_(!1),this.workspace_.resize()}dispose(){for(const n of this.boundEvents_)Wo.browserEvents.unbind(n);this.boundEvents_.length=0,this.htmlDiv_&&(this.htmlDiv_.remove(),this.htmlDiv_=null),this.actionDiv_=null,this.inputElement_=null}createDom_(){const n=this.workspace_.getInjectionDiv();this.addEvent_(n,"keydown",this,p=>this.onWorkspaceKeyDown_(p)),this.htmlDiv_=document.createElement("div"),Wo.utils.dom.addClass(this.htmlDiv_,"blockly-ws-search");const s=document.createElement("div");Wo.utils.dom.addClass(s,"blockly-ws-search-container");const l=document.createElement("div");Wo.utils.dom.addClass(l,"blockly-ws-search-content"),s.appendChild(l);const a=document.createElement("div");Wo.utils.dom.addClass(a,"blockly-ws-search-input"),this.inputElement_=this.createTextInput_(),this.addEvent_(this.inputElement_,"keydown",this,p=>this.onKeyDown_(p)),this.addEvent_(this.inputElement_,"input",this,()=>this.onInput_()),this.addEvent_(this.inputElement_,"click",this,()=>{this.searchAndHighlight(this.searchText_,this.preserveSelected),this.inputElement_.select()}),a.appendChild(this.inputElement_),l.appendChild(a),this.actionDiv_=document.createElement("div"),Wo.utils.dom.addClass(this.actionDiv_,"blockly-ws-search-actions"),l.appendChild(this.actionDiv_);const u=this.createNextBtn_();u&&this.addActionBtn(u,()=>this.next());const d=this.createPreviousBtn_();d&&this.addActionBtn(d,()=>this.previous());const h=this.createCloseBtn_();h&&(this.addBtnListener_(h,()=>this.close()),s.appendChild(h)),this.htmlDiv_.appendChild(s),n.insertBefore(this.htmlDiv_,this.workspace_.getParentSvg())}addEvent_(n,s,l,a){const u=Wo.browserEvents.conditionalBind(n,s,l,a);this.boundEvents_.push(u)}addActionBtn(n,s){this.addBtnListener_(n,s),this.actionDiv_.appendChild(n)}createTextInput_(){const n=document.createElement("input");return n.type="text",n.setAttribute("placeholder",this.textInputPlaceholder_),n}createNextBtn_(){return this.createBtn_("blockly-ws-search-next-btn","Find next")}createPreviousBtn_(){return this.createBtn_("blockly-ws-search-previous-btn","Find previous")}createCloseBtn_(){return this.createBtn_("blockly-ws-search-close-btn","Close search bar")}createBtn_(n,s){const l=document.createElement("button");return Wo.utils.dom.addClass(l,n),l.setAttribute("aria-label",s),l}addBtnListener_(n,s){this.addEvent_(n,"click",this,s),this.addEvent_(n,"keydown",this,l=>{l.key==="Enter"?(s(l),l.preventDefault()):l.key==="Escape"&&this.close(),l.stopPropagation()})}getBoundingRectangle(){return null}position(n,s){this.workspace_.RTL?this.htmlDiv_.style.left=n.absoluteMetrics.left+"px":n.toolboxMetrics.position===Wo.TOOLBOX_AT_RIGHT?this.htmlDiv_.style.right=n.toolboxMetrics.width+"px":this.htmlDiv_.style.right="0",this.htmlDiv_.style.top=n.absoluteMetrics.top+"px"}onInput_(){if(this.searchOnInput){const n=this.inputElement_.value.trim();n!==this.searchText_&&this.searchAndHighlight(n,this.preserveSelected)}}onKeyDown_(n){if(n.key==="Escape")this.close();else if(n.key==="Enter")if(this.searchOnInput)this.next();else{const s=this.inputElement_.value.trim();s!==this.searchText_&&this.searchAndHighlight(s,this.preserveSelected)}}onWorkspaceKeyDown_(n){(n.ctrlKey||n.metaKey)&&n.key==="f"&&(this.open(),n.preventDefault(),n.stopPropagation())}previous(){this.setCurrentBlock_(this.currentBlockIndex_-1)}next(){this.setCurrentBlock_(this.currentBlockIndex_+1)}setSearchPlaceholder(n){this.textInputPlaceholder_=n,this.inputElement_&&this.inputElement_.setAttribute("placeholder",this.textInputPlaceholder_)}setCurrentBlock_(n){if(!this.blocks_.length)return;let s=this.blocks_[this.currentBlockIndex_];s&&this.unhighlightCurrentSelection_(s),this.currentBlockIndex_=(n%this.blocks_.length+this.blocks_.length)%this.blocks_.length,s=this.blocks_[this.currentBlockIndex_],this.highlightCurrentSelection_(s),this.workspace_.centerOnBlock(s.id,!1)}open(){this.setVisible_(!0),this.inputElement_.focus(),this.searchText_&&this.searchAndHighlight(this.searchText_)}close(){this.setVisible_(!1),this.workspace_.markFocused(),this.clearBlocks()}setVisible_(n){this.htmlDiv_.style.display=n?"flex":"none"}searchAndHighlight(n,s){const l=this.blocks_[this.currentBlockIndex_];this.searchText_=n.trim(),this.clearBlocks(),this.blocks_=this.getMatchingBlocks_(this.workspace_,this.searchText_,this.caseSensitive),this.highlightSearchGroup_(this.blocks_);let a=0;s&&(a=this.blocks_.indexOf(l),a=a>-1?a:0),this.setCurrentBlock_(a)}getSearchPool_(n){return n.getAllBlocks(!0).filter(l=>{const a=l.getSurroundParent();return!a||!a.isCollapsed()})}isBlockMatch_(n,s,l){let a="";if(n.isCollapsed())a=n.toString();else{const u=[];n.inputList.forEach(d=>{d.fieldRow.forEach(h=>{u.push(h.getText())})}),a=u.join(" ").trim()}return l||(a=a.toLowerCase()),a.indexOf(s)>-1}getMatchingBlocks_(n,s,l){return s?(this.caseSensitive||(s=s.toLowerCase()),this.getSearchPool_(n).filter(u=>this.isBlockMatch_(u,s,l))):[]}clearBlocks(){this.unhighlightSearchGroup_(this.blocks_);const n=this.blocks_[this.currentBlockIndex_];n&&this.unhighlightCurrentSelection_(n),this.currentBlockIndex_=-1,this.blocks_=[]}highlightCurrentSelection_(n){const s=n.pathObject.svgPath;Wo.utils.dom.addClass(s,"blockly-ws-search-current")}unhighlightCurrentSelection_(n){const s=n.pathObject.svgPath;Wo.utils.dom.removeClass(s,"blockly-ws-search-current")}highlightSearchGroup_(n){n.forEach(s=>{const l=s.pathObject.svgPath;Wo.utils.dom.addClass(l,"blockly-ws-search-highlight")})}unhighlightSearchGroup_(n){n.forEach(s=>{const l=s.pathObject.svgPath;Wo.utils.dom.removeClass(l,"blockly-ws-search-highlight")})}}const c2="项目",a2="未命名",u2="今天",d2="复制并粘贴",h2="添加注释",p2="删除注释",$2="复制注释",_2="多行输入",g2="单行输入",f2="删除块",m2="删除 %1 个块",T2="删除所有 %1 个块吗?",E2="整理块",b2="折叠块",v2="折叠块",I2="展开块",O2="展开块",C2="禁用块",y2="启用块",S2="帮助",R2="撤销",k2="重做",A2="更改值",L2="重命名变量...",N2="将所有“%1”变量重命名为",w2="创建变量",M2="创建字符串变量",D2="创建数字变量",P2="创建颜色变量",x2="新变量的类型:",B2="新变量的名称:",F2="名字叫“%1”的变量已经存在了。",U2="名字叫“%1”的变量已经有了另一个类型:“%2”。",H2="要删除对变量“%2”的%1个引用吗?",V2="不能删除变量“%1”,因为它是函数“%2”定义的一部分",G2="删除变量“%1”",W2="https://zh.wikipedia.org/wiki/颜色",z2="从调色板中选择一种颜色。",X2="随机颜色",j2="随机选择一种颜色。",Y2="颜色",K2="红色",Q2="绿色",q2="蓝色",J2="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须在0和100之间。",Z2="混合",eO="颜色1",tO="颜色2",oO="比例",sO="把两种颜色以一个给定的比例(0.0-1.0)进行混合。",iO="https://zh.wikipedia.org/wiki/For循环",nO="循环 %1 次",rO="",lO="多次执行一些语句。",cO="循环 当满足",aO="循环 直到",uO="只要值为真,就一直循环执行一些语句。",dO="只要值为假,就一直循环执行一些语句。",hO="用变量%1记录从开始数值到终止数值之间的数值,数值按指定间隔增加,并执行指定的块。",pO="变量 %1 从 %2 数到 %3 步长为 %4",$O="变量 %1 遍历列表 %2",_O="遍历列表中的每一项,将变量“%1”设为所选项,并执行一些语句。",gO="退出循环",fO="直接进入下一轮循环",mO="跳出包含它的循环。",TO="跳过本轮循环的剩余部分,并继进行续下一轮循环。",EO="警告:这个块只能在循环内使用。",bO="如果值为真,执行一些语句。",vO="如果值为真,则执行第一块语句。否则,则执行第二块语句。",IO="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。",OO="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。",CO="如果",yO="",SO="否则如果",RO="",kO="增加、删除或重新排列各节来重新配置这个if语句块。",AO="在这个if语句块中增加一个条件。",LO="在这个if语句块中添加一个最终的,包括所有其余情况的条件。",NO="https://zh.wikipedia.org/wiki/不等",wO="如果两个输入结果相等,则返回真。",MO="如果两个输入结果不相等,则返回真。",DO="如果第一个输入结果比第二个小,则返回真。",PO="如果第一个输入结果小于或等于第二个输入结果,则返回真。",xO="如果第一个输入结果比第二个大,则返回真。",BO="如果第一个输入结果大于或等于第二个输入结果,则返回真。",FO="如果两个输入结果都为真,则返回真。",UO="且",HO="如果至少有一个输入结果为真,则返回真。",VO="或",GO="%1 不成立",WO="如果输入结果为false,则返回true;如果输入结果为true,则返回false。",zO="成立",XO="不成立",jO="返回 true 或 false。",YO="空",KO="返回空值。",QO="https://zh.wikipedia.org/wiki/条件运算符",qO="条件",JO="成立则为",ZO="不成立则为",eC="检查“断言”里的条件语句。如果条件为真,则返回“如果为真”的值,否则,则返回“如果为假”的值。",tC="https://zh.wikipedia.org/wiki/数",oC="一个数值。",sC="sin",iC="cos",nC="tan",rC="asin",lC="acos",cC="atan",aC="https://zh.wikipedia.org/wiki/算术",uC="返回两个数值的和。",dC="返回两个数值的差。",hC="返回两个数值的乘积。",pC="返回两个数值的商。",$C="返回以第一个数值为底数,以第二个数值为幂的结果。",_C="https://zh.wikipedia.org/wiki/平方根",gC="算术平方根",fC="返回一个数的算术平方根。",mC="绝对值",TC="返回一个数值的绝对值。",EC="返回一个数值的相反数。",bC="返回一个数值的自然对数。",vC="返回一个数值的以10为底的对数。",IC="返回e的n次幂。",OC="返回10的n次幂。",CC="https://zh.wikipedia.org/wiki/三角函数",yC="返回指定角度的正弦值(非弧度)。",SC="返回指定角度的余弦值(非弧度)。",RC="返回指定角度的正切值(非弧度)。",kC="返回一个数值的反正弦值。",AC="返回一个数值的反余弦值。",LC="返回一个数值的反正切值。",NC="https://zh.wikipedia.org/wiki/数学常数",wC="返回一个常见常量:π (3.141…)、e (2.718…)、φ (1.618…)、根号2 (1.414…)、根号二分之一 (0.707…)或∞ (无穷大)。",MC="是偶数",DC="是奇数",PC="是质数",xC="是整数",BC="是正数",FC="是负数",UC="检查一个数值是否是偶数、奇数、质数、自然数、正数、负数或者是否能被某数整除。返回真或假。",HC="https://zh.wikipedia.org/wiki/加法",VC="将 %1 增加 %2",GC="为变量“%1”增加一个数值。",WC="https://zh.wikipedia.org/wiki/数值修约",zC="数字向上或向下舍入。",XC="四舍五入",jC="向上舍入",YC="向下舍入",KC="列表中数值的和",QC="返回列表中的所有数值的和。",qC="列表最小值",JC="返回列表中最小值。",ZC="列表最大值",e4="返回列表中最大值。",t4="列表平均值",o4="返回列表中的数值的平均值。",s4="列表中位数",i4="返回列表中数值的中位数。",n4="列表中的众数",r4="返回列表中的出现次数最多的项的列表。",l4="列表的标准差",c4="返回列表的标准差。",a4="列表中的随机一项",u4="从列表中返回一个随机的元素。",d4="https://zh.wikipedia.org/wiki/模除",h4="%1 ÷ %2 的余数",p4="返回这两个数字相除后的余数。",$4="将 %1 限制在 最低 %2 到最高 %3 之间",_4="将一个数值限制在两个指定的数值范围(含边界)之间。",g4="https://zh.wikipedia.org/wiki/随机数生成器",f4="随机整数 %1 到 %2",m4="返回一个限制在两个指定数值的范围(含边界)之间的随机整数。",T4="https://zh.wikipedia.org/wiki/随机数生成器",E4="随机小数",b4="返回一个从0.0(含)到1.0(不含)之间的随机数。",v4="https://zh.wikipedia.org/wiki/反正切2",I4="点(x:%1,y:%2)的方位角",O4="返回点(X,Y)的反正切值,范围为-180到180度。",C4="https://zh.wikipedia.org/wiki/字符串",y4="一个字、词语或一行文本。",S4="连接",R4="通过串起任意数量的项以建立一段文本。",k4="拼接",A4="添加、移除或重新排列各节来重新配置这个文本块。",L4="将一个项添加到文本中。",N4="在 %1 之后加上文本 %2 ",w4="将一些文本追加到变量“%1”里。",M4="%1 的字符数",D4="返回给定文本的字母数(包括空格)。",P4="%1 是空的",x4="如果给定的文本为空,则返回真。",B4="返回第一个文本段在第二个文本段中的第一/最后一个匹配项的起始位置。如果未找到,则返回%1。",F4="在 %1 中 %2 出现 %3 的位置",U4="首次",H4="最后",V4="用不同的大小写模式复制并返回这段文字。",G4="转为大写",W4="转为小写",z4="转为首字母大写",X4="从某一端或同时从两端删除多余的空白,并返回这段文字的一个副本。",j4="消除其两侧的空白",Y4="消除其左侧的空白",K4="消除其右侧的空白",Q4="输出 %1",q4="输出指定的文字、数字或其他值。",J4="要求输入文本,并显示提示消息",Z4="要求输入数字,并显示提示消息",ey="要求用户输入数字。",ty="要求用户输入一些文本。",oy="%1 在 %2 里出现的次数",sy="计算在一段文本中,某个部分文本重复出现了多少次。",iy="把 %3 中的 %1 替换为 %2",ny="在一段文本中,将出现过的某部分文本都替换掉。",ry="倒转文本%1",ly="将文本中各个字符的顺序倒转。",cy="创建空列表",ay="返回一个列表,长度为 0,不包含任何数据记录",uy="建立一个具有任意数量项目的列表。",dy="创建列表,内容:",hy="列表",py="增加、删除或重新排列各部分以此重新配置这个列表块。",$y="将一个项添加到列表中。",_y="建立包含指定重复次数的值的列表。",gy="建立列表使用项 %1 重复 %2 次",fy="%1 的长度",my="返回列表的长度。",Ty="%1 是空的",Ey="如果改列表为空,则返回真。",by="在列表中",vy="寻找第一次出现的项",Iy="寻找最后一次出现的项",Oy="排序%1 %2 %3",Cy="排序一个列表,返回副本。",yy="升序",Sy="降序",Ry="按数字",ky="按字母",Ay="按字母(忽略大小写)",Ly="倒转%1",Ny="倒转一个列表,返回副本。",wy="返回此变量的值。",My="创建“设定%1”",Dy="设置 %1 的值为 %2",Py="设置此变量,以使它和输入值相等。",xy="创建“获得%1”",By="https://zh.wikipedia.org/wiki/子程序",Fy="定义函数",Uy="定义函数",Hy="做点什么",Vy="做点什么",Gy="",Wy="",zy="形参",Xy="创建一个不带输出值的函数。",jy="描述该功能...",Yy="https://zh.wikipedia.org/wiki/子程序",Ky="返回",Qy="创建一个有输出值的函数。",qy="允许声明",Jy="警告:此函数具有重复参数。",Zy="https://zh.wikipedia.org/wiki/子程序",eS="运行用户定义的函数“%1”。",tS="https://zh.wikipedia.org/wiki/子程序",oS="运行用户定义的函数“%1”,并使用它的输出值。",sS="输入",iS="添加、移除或重新排此函数的输入。",nS="输入名称:",rS="添加函数输入。",lS="突出显示函数定义",cS="创建“%1”",aS="如果值为真,则返回第二个值。",uS="警告:这个块只能在函数内部使用。",dS="说点什么...",hS="Blockly工作区",pS="已收起的信息块内包含警告。",$S="确认",_S="取消",k7={VARIABLES_DEFAULT_NAME:c2,UNNAMED_KEY:a2,TODAY:u2,DUPLICATE_BLOCK:d2,ADD_COMMENT:h2,REMOVE_COMMENT:p2,DUPLICATE_COMMENT:$2,EXTERNAL_INPUTS:_2,INLINE_INPUTS:g2,DELETE_BLOCK:f2,DELETE_X_BLOCKS:m2,DELETE_ALL_BLOCKS:T2,CLEAN_UP:E2,COLLAPSE_BLOCK:b2,COLLAPSE_ALL:v2,EXPAND_BLOCK:I2,EXPAND_ALL:O2,DISABLE_BLOCK:C2,ENABLE_BLOCK:y2,HELP:S2,UNDO:R2,REDO:k2,CHANGE_VALUE_TITLE:A2,RENAME_VARIABLE:L2,RENAME_VARIABLE_TITLE:N2,NEW_VARIABLE:w2,NEW_STRING_VARIABLE:M2,NEW_NUMBER_VARIABLE:D2,NEW_COLOUR_VARIABLE:P2,NEW_VARIABLE_TYPE_TITLE:x2,NEW_VARIABLE_TITLE:B2,VARIABLE_ALREADY_EXISTS:F2,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:U2,DELETE_VARIABLE_CONFIRMATION:H2,CANNOT_DELETE_VARIABLE_PROCEDURE:V2,DELETE_VARIABLE:G2,COLOUR_PICKER_HELPURL:W2,COLOUR_PICKER_TOOLTIP:z2,COLOUR_RANDOM_TITLE:X2,COLOUR_RANDOM_TOOLTIP:j2,COLOUR_RGB_TITLE:Y2,COLOUR_RGB_RED:K2,COLOUR_RGB_GREEN:Q2,COLOUR_RGB_BLUE:q2,COLOUR_RGB_TOOLTIP:J2,COLOUR_BLEND_TITLE:Z2,COLOUR_BLEND_COLOUR1:eO,COLOUR_BLEND_COLOUR2:tO,COLOUR_BLEND_RATIO:oO,COLOUR_BLEND_TOOLTIP:sO,CONTROLS_REPEAT_HELPURL:iO,CONTROLS_REPEAT_TITLE:nO,CONTROLS_REPEAT_INPUT_DO:rO,CONTROLS_REPEAT_TOOLTIP:lO,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:cO,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:aO,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:uO,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:dO,CONTROLS_FOR_TOOLTIP:hO,CONTROLS_FOR_TITLE:pO,CONTROLS_FOREACH_TITLE:$O,CONTROLS_FOREACH_TOOLTIP:_O,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:gO,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:fO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:mO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:TO,CONTROLS_FLOW_STATEMENTS_WARNING:EO,CONTROLS_IF_TOOLTIP_1:bO,CONTROLS_IF_TOOLTIP_2:vO,CONTROLS_IF_TOOLTIP_3:IO,CONTROLS_IF_TOOLTIP_4:OO,CONTROLS_IF_MSG_IF:CO,CONTROLS_IF_MSG_THEN:yO,CONTROLS_IF_MSG_ELSEIF:SO,CONTROLS_IF_MSG_ELSE:RO,CONTROLS_IF_IF_TOOLTIP:kO,CONTROLS_IF_ELSEIF_TOOLTIP:AO,CONTROLS_IF_ELSE_TOOLTIP:LO,LOGIC_COMPARE_HELPURL:NO,LOGIC_COMPARE_TOOLTIP_EQ:wO,LOGIC_COMPARE_TOOLTIP_NEQ:MO,LOGIC_COMPARE_TOOLTIP_LT:DO,LOGIC_COMPARE_TOOLTIP_LTE:PO,LOGIC_COMPARE_TOOLTIP_GT:xO,LOGIC_COMPARE_TOOLTIP_GTE:BO,LOGIC_OPERATION_TOOLTIP_AND:FO,LOGIC_OPERATION_AND:UO,LOGIC_OPERATION_TOOLTIP_OR:HO,LOGIC_OPERATION_OR:VO,LOGIC_NEGATE_TITLE:GO,LOGIC_NEGATE_TOOLTIP:WO,LOGIC_BOOLEAN_TRUE:zO,LOGIC_BOOLEAN_FALSE:XO,LOGIC_BOOLEAN_TOOLTIP:jO,LOGIC_NULL:YO,LOGIC_NULL_TOOLTIP:KO,LOGIC_TERNARY_HELPURL:QO,LOGIC_TERNARY_CONDITION:qO,LOGIC_TERNARY_IF_TRUE:JO,LOGIC_TERNARY_IF_FALSE:ZO,LOGIC_TERNARY_TOOLTIP:eC,MATH_NUMBER_HELPURL:tC,MATH_NUMBER_TOOLTIP:oC,MATH_TRIG_SIN:sC,MATH_TRIG_COS:iC,MATH_TRIG_TAN:nC,MATH_TRIG_ASIN:rC,MATH_TRIG_ACOS:lC,MATH_TRIG_ATAN:cC,MATH_ARITHMETIC_HELPURL:aC,MATH_ARITHMETIC_TOOLTIP_ADD:uC,MATH_ARITHMETIC_TOOLTIP_MINUS:dC,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:hC,MATH_ARITHMETIC_TOOLTIP_DIVIDE:pC,MATH_ARITHMETIC_TOOLTIP_POWER:$C,MATH_SINGLE_HELPURL:_C,MATH_SINGLE_OP_ROOT:gC,MATH_SINGLE_TOOLTIP_ROOT:fC,MATH_SINGLE_OP_ABSOLUTE:mC,MATH_SINGLE_TOOLTIP_ABS:TC,MATH_SINGLE_TOOLTIP_NEG:EC,MATH_SINGLE_TOOLTIP_LN:bC,MATH_SINGLE_TOOLTIP_LOG10:vC,MATH_SINGLE_TOOLTIP_EXP:IC,MATH_SINGLE_TOOLTIP_POW10:OC,MATH_TRIG_HELPURL:CC,MATH_TRIG_TOOLTIP_SIN:yC,MATH_TRIG_TOOLTIP_COS:SC,MATH_TRIG_TOOLTIP_TAN:RC,MATH_TRIG_TOOLTIP_ASIN:kC,MATH_TRIG_TOOLTIP_ACOS:AC,MATH_TRIG_TOOLTIP_ATAN:LC,MATH_CONSTANT_HELPURL:NC,MATH_CONSTANT_TOOLTIP:wC,MATH_IS_EVEN:MC,MATH_IS_ODD:DC,MATH_IS_PRIME:PC,MATH_IS_WHOLE:xC,MATH_IS_POSITIVE:BC,MATH_IS_NEGATIVE:FC,MATH_IS_TOOLTIP:UC,MATH_CHANGE_HELPURL:HC,MATH_CHANGE_TITLE:VC,MATH_CHANGE_TOOLTIP:GC,MATH_ROUND_HELPURL:WC,MATH_ROUND_TOOLTIP:zC,MATH_ROUND_OPERATOR_ROUND:XC,MATH_ROUND_OPERATOR_ROUNDUP:jC,MATH_ROUND_OPERATOR_ROUNDDOWN:YC,MATH_ONLIST_OPERATOR_SUM:KC,MATH_ONLIST_TOOLTIP_SUM:QC,MATH_ONLIST_OPERATOR_MIN:qC,MATH_ONLIST_TOOLTIP_MIN:JC,MATH_ONLIST_OPERATOR_MAX:ZC,MATH_ONLIST_TOOLTIP_MAX:e4,MATH_ONLIST_OPERATOR_AVERAGE:t4,MATH_ONLIST_TOOLTIP_AVERAGE:o4,MATH_ONLIST_OPERATOR_MEDIAN:s4,MATH_ONLIST_TOOLTIP_MEDIAN:i4,MATH_ONLIST_OPERATOR_MODE:n4,MATH_ONLIST_TOOLTIP_MODE:r4,MATH_ONLIST_OPERATOR_STD_DEV:l4,MATH_ONLIST_TOOLTIP_STD_DEV:c4,MATH_ONLIST_OPERATOR_RANDOM:a4,MATH_ONLIST_TOOLTIP_RANDOM:u4,MATH_MODULO_HELPURL:d4,MATH_MODULO_TITLE:h4,MATH_MODULO_TOOLTIP:p4,MATH_CONSTRAIN_TITLE:$4,MATH_CONSTRAIN_TOOLTIP:_4,MATH_RANDOM_INT_HELPURL:g4,MATH_RANDOM_INT_TITLE:f4,MATH_RANDOM_INT_TOOLTIP:m4,MATH_RANDOM_FLOAT_HELPURL:T4,MATH_RANDOM_FLOAT_TITLE_RANDOM:E4,MATH_RANDOM_FLOAT_TOOLTIP:b4,MATH_ATAN2_HELPURL:v4,MATH_ATAN2_TITLE:I4,MATH_ATAN2_TOOLTIP:O4,TEXT_TEXT_HELPURL:C4,TEXT_TEXT_TOOLTIP:y4,TEXT_JOIN_TITLE_CREATEWITH:S4,TEXT_JOIN_TOOLTIP:R4,TEXT_CREATE_JOIN_TITLE_JOIN:k4,TEXT_CREATE_JOIN_TOOLTIP:A4,TEXT_CREATE_JOIN_ITEM_TOOLTIP:L4,TEXT_APPEND_TITLE:N4,TEXT_APPEND_TOOLTIP:w4,TEXT_LENGTH_TITLE:M4,TEXT_LENGTH_TOOLTIP:D4,TEXT_ISEMPTY_TITLE:P4,TEXT_ISEMPTY_TOOLTIP:x4,TEXT_INDEXOF_TOOLTIP:B4,TEXT_INDEXOF_TITLE:F4,TEXT_INDEXOF_OPERATOR_FIRST:U4,TEXT_INDEXOF_OPERATOR_LAST:H4,TEXT_CHANGECASE_TOOLTIP:V4,TEXT_CHANGECASE_OPERATOR_UPPERCASE:G4,TEXT_CHANGECASE_OPERATOR_LOWERCASE:W4,TEXT_CHANGECASE_OPERATOR_TITLECASE:z4,TEXT_TRIM_TOOLTIP:X4,TEXT_TRIM_OPERATOR_BOTH:j4,TEXT_TRIM_OPERATOR_LEFT:Y4,TEXT_TRIM_OPERATOR_RIGHT:K4,TEXT_PRINT_TITLE:Q4,TEXT_PRINT_TOOLTIP:q4,TEXT_PROMPT_TYPE_TEXT:J4,TEXT_PROMPT_TYPE_NUMBER:Z4,TEXT_PROMPT_TOOLTIP_NUMBER:ey,TEXT_PROMPT_TOOLTIP_TEXT:ty,TEXT_COUNT_MESSAGE0:oy,TEXT_COUNT_TOOLTIP:sy,TEXT_REPLACE_MESSAGE0:iy,TEXT_REPLACE_TOOLTIP:ny,TEXT_REVERSE_MESSAGE0:ry,TEXT_REVERSE_TOOLTIP:ly,LISTS_CREATE_EMPTY_TITLE:cy,LISTS_CREATE_EMPTY_TOOLTIP:ay,LISTS_CREATE_WITH_TOOLTIP:uy,LISTS_CREATE_WITH_INPUT_WITH:dy,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:hy,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:py,LISTS_CREATE_WITH_ITEM_TOOLTIP:$y,LISTS_REPEAT_TOOLTIP:_y,LISTS_REPEAT_TITLE:gy,LISTS_LENGTH_TITLE:fy,LISTS_LENGTH_TOOLTIP:my,LISTS_ISEMPTY_TITLE:Ty,LISTS_ISEMPTY_TOOLTIP:Ey,LISTS_INLIST:by,LISTS_INDEX_OF_FIRST:vy,LISTS_INDEX_OF_LAST:Iy,LISTS_SORT_TITLE:Oy,LISTS_SORT_TOOLTIP:Cy,LISTS_SORT_ORDER_ASCENDING:yy,LISTS_SORT_ORDER_DESCENDING:Sy,LISTS_SORT_TYPE_NUMERIC:Ry,LISTS_SORT_TYPE_TEXT:ky,LISTS_SORT_TYPE_IGNORECASE:Ay,LISTS_REVERSE_MESSAGE0:Ly,LISTS_REVERSE_TOOLTIP:Ny,VARIABLES_GET_TOOLTIP:wy,VARIABLES_GET_CREATE_SET:My,VARIABLES_SET:Dy,VARIABLES_SET_TOOLTIP:Py,VARIABLES_SET_CREATE_GET:xy,PROCEDURES_DEFNORETURN_HELPURL:By,PROCEDURES_DEFNORETURN_TITLE:Fy,PROCEDURES_DEFRETURN_TITLE:Uy,PROCEDURES_DEFNORETURN_PROCEDURE:Hy,PROCEDURES_DEFRETURN_PROCEDURE:Vy,PROCEDURES_BEFORE_PARAMS:Gy,PROCEDURES_CALL_BEFORE_PARAMS:Wy,PROCEDURE_VARIABLE:zy,PROCEDURES_DEFNORETURN_TOOLTIP:Xy,PROCEDURES_DEFNORETURN_COMMENT:jy,PROCEDURES_DEFRETURN_HELPURL:Yy,PROCEDURES_DEFRETURN_RETURN:Ky,PROCEDURES_DEFRETURN_TOOLTIP:Qy,PROCEDURES_ALLOW_STATEMENTS:qy,PROCEDURES_DEF_DUPLICATE_WARNING:Jy,PROCEDURES_CALLNORETURN_HELPURL:Zy,PROCEDURES_CALLNORETURN_TOOLTIP:eS,PROCEDURES_CALLRETURN_HELPURL:tS,PROCEDURES_CALLRETURN_TOOLTIP:oS,PROCEDURES_MUTATORCONTAINER_TITLE:sS,PROCEDURES_MUTATORCONTAINER_TOOLTIP:iS,PROCEDURES_MUTATORARG_TITLE:nS,PROCEDURES_MUTATORARG_TOOLTIP:rS,PROCEDURES_HIGHLIGHT_DEF:lS,PROCEDURES_CREATE_DO:cS,PROCEDURES_IFRETURN_TOOLTIP:aS,PROCEDURES_IFRETURN_WARNING:uS,WORKSPACE_COMMENT_DEFAULT_TEXT:dS,WORKSPACE_ARIA_LABEL:hS,COLLAPSED_WARNINGS_WARNING:pS,DIALOG_OK:$S,DIALOG_CANCEL:_S},A7=Object.freeze(Object.defineProperty({__proto__:null,ADD_COMMENT:h2,CANNOT_DELETE_VARIABLE_PROCEDURE:V2,CHANGE_VALUE_TITLE:A2,CLEAN_UP:E2,COLLAPSED_WARNINGS_WARNING:pS,COLLAPSE_ALL:v2,COLLAPSE_BLOCK:b2,COLOUR_BLEND_COLOUR1:eO,COLOUR_BLEND_COLOUR2:tO,COLOUR_BLEND_RATIO:oO,COLOUR_BLEND_TITLE:Z2,COLOUR_BLEND_TOOLTIP:sO,COLOUR_PICKER_HELPURL:W2,COLOUR_PICKER_TOOLTIP:z2,COLOUR_RANDOM_TITLE:X2,COLOUR_RANDOM_TOOLTIP:j2,COLOUR_RGB_BLUE:q2,COLOUR_RGB_GREEN:Q2,COLOUR_RGB_RED:K2,COLOUR_RGB_TITLE:Y2,COLOUR_RGB_TOOLTIP:J2,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:gO,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:fO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:mO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:TO,CONTROLS_FLOW_STATEMENTS_WARNING:EO,CONTROLS_FOREACH_TITLE:$O,CONTROLS_FOREACH_TOOLTIP:_O,CONTROLS_FOR_TITLE:pO,CONTROLS_FOR_TOOLTIP:hO,CONTROLS_IF_ELSEIF_TOOLTIP:AO,CONTROLS_IF_ELSE_TOOLTIP:LO,CONTROLS_IF_IF_TOOLTIP:kO,CONTROLS_IF_MSG_ELSE:RO,CONTROLS_IF_MSG_ELSEIF:SO,CONTROLS_IF_MSG_IF:CO,CONTROLS_IF_MSG_THEN:yO,CONTROLS_IF_TOOLTIP_1:bO,CONTROLS_IF_TOOLTIP_2:vO,CONTROLS_IF_TOOLTIP_3:IO,CONTROLS_IF_TOOLTIP_4:OO,CONTROLS_REPEAT_HELPURL:iO,CONTROLS_REPEAT_INPUT_DO:rO,CONTROLS_REPEAT_TITLE:nO,CONTROLS_REPEAT_TOOLTIP:lO,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:aO,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:cO,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:dO,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:uO,DELETE_ALL_BLOCKS:T2,DELETE_BLOCK:f2,DELETE_VARIABLE:G2,DELETE_VARIABLE_CONFIRMATION:H2,DELETE_X_BLOCKS:m2,DIALOG_CANCEL:_S,DIALOG_OK:$S,DISABLE_BLOCK:C2,DUPLICATE_BLOCK:d2,DUPLICATE_COMMENT:$2,ENABLE_BLOCK:y2,EXPAND_ALL:O2,EXPAND_BLOCK:I2,EXTERNAL_INPUTS:_2,HELP:S2,INLINE_INPUTS:g2,LISTS_CREATE_EMPTY_TITLE:cy,LISTS_CREATE_EMPTY_TOOLTIP:ay,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:hy,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:py,LISTS_CREATE_WITH_INPUT_WITH:dy,LISTS_CREATE_WITH_ITEM_TOOLTIP:$y,LISTS_CREATE_WITH_TOOLTIP:uy,LISTS_INDEX_OF_FIRST:vy,LISTS_INDEX_OF_LAST:Iy,LISTS_INLIST:by,LISTS_ISEMPTY_TITLE:Ty,LISTS_ISEMPTY_TOOLTIP:Ey,LISTS_LENGTH_TITLE:fy,LISTS_LENGTH_TOOLTIP:my,LISTS_REPEAT_TITLE:gy,LISTS_REPEAT_TOOLTIP:_y,LISTS_REVERSE_MESSAGE0:Ly,LISTS_REVERSE_TOOLTIP:Ny,LISTS_SORT_ORDER_ASCENDING:yy,LISTS_SORT_ORDER_DESCENDING:Sy,LISTS_SORT_TITLE:Oy,LISTS_SORT_TOOLTIP:Cy,LISTS_SORT_TYPE_IGNORECASE:Ay,LISTS_SORT_TYPE_NUMERIC:Ry,LISTS_SORT_TYPE_TEXT:ky,LOGIC_BOOLEAN_FALSE:XO,LOGIC_BOOLEAN_TOOLTIP:jO,LOGIC_BOOLEAN_TRUE:zO,LOGIC_COMPARE_HELPURL:NO,LOGIC_COMPARE_TOOLTIP_EQ:wO,LOGIC_COMPARE_TOOLTIP_GT:xO,LOGIC_COMPARE_TOOLTIP_GTE:BO,LOGIC_COMPARE_TOOLTIP_LT:DO,LOGIC_COMPARE_TOOLTIP_LTE:PO,LOGIC_COMPARE_TOOLTIP_NEQ:MO,LOGIC_NEGATE_TITLE:GO,LOGIC_NEGATE_TOOLTIP:WO,LOGIC_NULL:YO,LOGIC_NULL_TOOLTIP:KO,LOGIC_OPERATION_AND:UO,LOGIC_OPERATION_OR:VO,LOGIC_OPERATION_TOOLTIP_AND:FO,LOGIC_OPERATION_TOOLTIP_OR:HO,LOGIC_TERNARY_CONDITION:qO,LOGIC_TERNARY_HELPURL:QO,LOGIC_TERNARY_IF_FALSE:ZO,LOGIC_TERNARY_IF_TRUE:JO,LOGIC_TERNARY_TOOLTIP:eC,MATH_ARITHMETIC_HELPURL:aC,MATH_ARITHMETIC_TOOLTIP_ADD:uC,MATH_ARITHMETIC_TOOLTIP_DIVIDE:pC,MATH_ARITHMETIC_TOOLTIP_MINUS:dC,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:hC,MATH_ARITHMETIC_TOOLTIP_POWER:$C,MATH_ATAN2_HELPURL:v4,MATH_ATAN2_TITLE:I4,MATH_ATAN2_TOOLTIP:O4,MATH_CHANGE_HELPURL:HC,MATH_CHANGE_TITLE:VC,MATH_CHANGE_TOOLTIP:GC,MATH_CONSTANT_HELPURL:NC,MATH_CONSTANT_TOOLTIP:wC,MATH_CONSTRAIN_TITLE:$4,MATH_CONSTRAIN_TOOLTIP:_4,MATH_IS_EVEN:MC,MATH_IS_NEGATIVE:FC,MATH_IS_ODD:DC,MATH_IS_POSITIVE:BC,MATH_IS_PRIME:PC,MATH_IS_TOOLTIP:UC,MATH_IS_WHOLE:xC,MATH_MODULO_HELPURL:d4,MATH_MODULO_TITLE:h4,MATH_MODULO_TOOLTIP:p4,MATH_NUMBER_HELPURL:tC,MATH_NUMBER_TOOLTIP:oC,MATH_ONLIST_OPERATOR_AVERAGE:t4,MATH_ONLIST_OPERATOR_MAX:ZC,MATH_ONLIST_OPERATOR_MEDIAN:s4,MATH_ONLIST_OPERATOR_MIN:qC,MATH_ONLIST_OPERATOR_MODE:n4,MATH_ONLIST_OPERATOR_RANDOM:a4,MATH_ONLIST_OPERATOR_STD_DEV:l4,MATH_ONLIST_OPERATOR_SUM:KC,MATH_ONLIST_TOOLTIP_AVERAGE:o4,MATH_ONLIST_TOOLTIP_MAX:e4,MATH_ONLIST_TOOLTIP_MEDIAN:i4,MATH_ONLIST_TOOLTIP_MIN:JC,MATH_ONLIST_TOOLTIP_MODE:r4,MATH_ONLIST_TOOLTIP_RANDOM:u4,MATH_ONLIST_TOOLTIP_STD_DEV:c4,MATH_ONLIST_TOOLTIP_SUM:QC,MATH_RANDOM_FLOAT_HELPURL:T4,MATH_RANDOM_FLOAT_TITLE_RANDOM:E4,MATH_RANDOM_FLOAT_TOOLTIP:b4,MATH_RANDOM_INT_HELPURL:g4,MATH_RANDOM_INT_TITLE:f4,MATH_RANDOM_INT_TOOLTIP:m4,MATH_ROUND_HELPURL:WC,MATH_ROUND_OPERATOR_ROUND:XC,MATH_ROUND_OPERATOR_ROUNDDOWN:YC,MATH_ROUND_OPERATOR_ROUNDUP:jC,MATH_ROUND_TOOLTIP:zC,MATH_SINGLE_HELPURL:_C,MATH_SINGLE_OP_ABSOLUTE:mC,MATH_SINGLE_OP_ROOT:gC,MATH_SINGLE_TOOLTIP_ABS:TC,MATH_SINGLE_TOOLTIP_EXP:IC,MATH_SINGLE_TOOLTIP_LN:bC,MATH_SINGLE_TOOLTIP_LOG10:vC,MATH_SINGLE_TOOLTIP_NEG:EC,MATH_SINGLE_TOOLTIP_POW10:OC,MATH_SINGLE_TOOLTIP_ROOT:fC,MATH_TRIG_ACOS:lC,MATH_TRIG_ASIN:rC,MATH_TRIG_ATAN:cC,MATH_TRIG_COS:iC,MATH_TRIG_HELPURL:CC,MATH_TRIG_SIN:sC,MATH_TRIG_TAN:nC,MATH_TRIG_TOOLTIP_ACOS:AC,MATH_TRIG_TOOLTIP_ASIN:kC,MATH_TRIG_TOOLTIP_ATAN:LC,MATH_TRIG_TOOLTIP_COS:SC,MATH_TRIG_TOOLTIP_SIN:yC,MATH_TRIG_TOOLTIP_TAN:RC,NEW_COLOUR_VARIABLE:P2,NEW_NUMBER_VARIABLE:D2,NEW_STRING_VARIABLE:M2,NEW_VARIABLE:w2,NEW_VARIABLE_TITLE:B2,NEW_VARIABLE_TYPE_TITLE:x2,PROCEDURES_ALLOW_STATEMENTS:qy,PROCEDURES_BEFORE_PARAMS:Gy,PROCEDURES_CALLNORETURN_HELPURL:Zy,PROCEDURES_CALLNORETURN_TOOLTIP:eS,PROCEDURES_CALLRETURN_HELPURL:tS,PROCEDURES_CALLRETURN_TOOLTIP:oS,PROCEDURES_CALL_BEFORE_PARAMS:Wy,PROCEDURES_CREATE_DO:cS,PROCEDURES_DEFNORETURN_COMMENT:jy,PROCEDURES_DEFNORETURN_HELPURL:By,PROCEDURES_DEFNORETURN_PROCEDURE:Hy,PROCEDURES_DEFNORETURN_TITLE:Fy,PROCEDURES_DEFNORETURN_TOOLTIP:Xy,PROCEDURES_DEFRETURN_HELPURL:Yy,PROCEDURES_DEFRETURN_PROCEDURE:Vy,PROCEDURES_DEFRETURN_RETURN:Ky,PROCEDURES_DEFRETURN_TITLE:Uy,PROCEDURES_DEFRETURN_TOOLTIP:Qy,PROCEDURES_DEF_DUPLICATE_WARNING:Jy,PROCEDURES_HIGHLIGHT_DEF:lS,PROCEDURES_IFRETURN_TOOLTIP:aS,PROCEDURES_IFRETURN_WARNING:uS,PROCEDURES_MUTATORARG_TITLE:nS,PROCEDURES_MUTATORARG_TOOLTIP:rS,PROCEDURES_MUTATORCONTAINER_TITLE:sS,PROCEDURES_MUTATORCONTAINER_TOOLTIP:iS,PROCEDURE_VARIABLE:zy,REDO:k2,REMOVE_COMMENT:p2,RENAME_VARIABLE:L2,RENAME_VARIABLE_TITLE:N2,TEXT_APPEND_TITLE:N4,TEXT_APPEND_TOOLTIP:w4,TEXT_CHANGECASE_OPERATOR_LOWERCASE:W4,TEXT_CHANGECASE_OPERATOR_TITLECASE:z4,TEXT_CHANGECASE_OPERATOR_UPPERCASE:G4,TEXT_CHANGECASE_TOOLTIP:V4,TEXT_COUNT_MESSAGE0:oy,TEXT_COUNT_TOOLTIP:sy,TEXT_CREATE_JOIN_ITEM_TOOLTIP:L4,TEXT_CREATE_JOIN_TITLE_JOIN:k4,TEXT_CREATE_JOIN_TOOLTIP:A4,TEXT_INDEXOF_OPERATOR_FIRST:U4,TEXT_INDEXOF_OPERATOR_LAST:H4,TEXT_INDEXOF_TITLE:F4,TEXT_INDEXOF_TOOLTIP:B4,TEXT_ISEMPTY_TITLE:P4,TEXT_ISEMPTY_TOOLTIP:x4,TEXT_JOIN_TITLE_CREATEWITH:S4,TEXT_JOIN_TOOLTIP:R4,TEXT_LENGTH_TITLE:M4,TEXT_LENGTH_TOOLTIP:D4,TEXT_PRINT_TITLE:Q4,TEXT_PRINT_TOOLTIP:q4,TEXT_PROMPT_TOOLTIP_NUMBER:ey,TEXT_PROMPT_TOOLTIP_TEXT:ty,TEXT_PROMPT_TYPE_NUMBER:Z4,TEXT_PROMPT_TYPE_TEXT:J4,TEXT_REPLACE_MESSAGE0:iy,TEXT_REPLACE_TOOLTIP:ny,TEXT_REVERSE_MESSAGE0:ry,TEXT_REVERSE_TOOLTIP:ly,TEXT_TEXT_HELPURL:C4,TEXT_TEXT_TOOLTIP:y4,TEXT_TRIM_OPERATOR_BOTH:j4,TEXT_TRIM_OPERATOR_LEFT:Y4,TEXT_TRIM_OPERATOR_RIGHT:K4,TEXT_TRIM_TOOLTIP:X4,TODAY:u2,UNDO:R2,UNNAMED_KEY:a2,VARIABLES_DEFAULT_NAME:c2,VARIABLES_GET_CREATE_SET:My,VARIABLES_GET_TOOLTIP:wy,VARIABLES_SET:Dy,VARIABLES_SET_CREATE_GET:xy,VARIABLES_SET_TOOLTIP:Py,VARIABLE_ALREADY_EXISTS:F2,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:U2,WORKSPACE_ARIA_LABEL:hS,WORKSPACE_COMMENT_DEFAULT_TEXT:dS,default:k7},Symbol.toStringTag,{value:"Module"}));const L7={__name:"Workspace",setup(o){Tt.setLocale(A7),Tt.Scrollbar.scrollbarThickness=15,Tt.FlyoutButton.BORDER_RADIUS=4,Tt.FlyoutButton.TEXT_MARGIN_X=10,Tt.FlyoutButton.TEXT_MARGIN_Y=10,tn("lists_create_with","list"),tn("procedures_defnoreturn","function"),tn("procedures_defreturn","function"),tn("procedures_ifreturn","function"),tn("procedures_callnoreturn","function"),tn("procedures_callreturn","function"),tn("time_current","time");const n=ge(),s=lr(),l={toolbox:t2,media:"/media",trashcan:!1,zoom:{controls:!0,wheel:!0,startScale:.8,maxScale:1.4,minScale:.5},move:{scrollbars:!0,drag:!0,wheel:!0},theme:"codemao",renderer:"codemao"};return zt(()=>{s.$patch(a=>{a.workspaceSvg=Tt.inject(n.value,l),a.searchPlugin=new R7(s.workspaceSvg)}),s.searchPlugin.setSearchPlaceholder("搜索作品中的积木"),s.searchPlugin.init()}),(a,u)=>(me(),Fe("div",{class:"blocklyDiv",ref_key:"blocklyDiv",ref:n},null,512))}};const N7={id:"zoombox"},w7={__name:"Zoombox",setup(o){const n=ge(),s=lr();function l(){s.workspaceSvg.cleanUp()}function a(){s.hasLayoutSider=!s.hasLayoutSider}function u(){let p=s.workspaceSvg.options.zoomOptions.scaleSpeed,f=s.workspaceSvg.scale;s.workspaceSvg.zoom(0,0,Math.log((f-.15)/f)/Math.log(p))}function d(){document.getElementsByClassName("blocklyZoom")[2].dispatchEvent(new PointerEvent("pointerdown"))}function h(){let p=s.workspaceSvg.options.zoomOptions.scaleSpeed,f=s.workspaceSvg.scale;s.workspaceSvg.zoom(0,0,Math.log((f+.15)/f)/Math.log(p))}return zt(()=>{s.workspaceSvg.addChangeListener(()=>{n.value.innerHTML=Math.floor((s.workspaceSvg.scale*(5/3)-1/3)*100)+"%"})}),(p,f)=>{const T=Vc,y=D0,S=Og;return me(),Fe("div",N7,[Q(S,null,{default:De(()=>[Q(y,{content:"整理",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:l,"aria-label":"整理"},{icon:De(()=>[Q(Xo(pD))]),_:1})]),_:1})]),_:1}),Q(S,null,{default:De(()=>[Q(y,{content:"代码区",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:a,"aria-label":"代码区"},{icon:De(()=>[Q(Xo(I8))]),_:1})]),_:1})]),_:1}),Q(S,null,{default:De(()=>[Q(y,{content:"缩小",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:u,"aria-label":"缩小"},{icon:De(()=>[Q(Xo(P8))]),_:1})]),_:1}),Q(y,{content:"恢复为100%",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:d,"aria-label":"恢复为100%"},{default:De(()=>[Le("span",{ref_key:"scale",ref:n},"100%",512)]),_:1})]),_:1}),Q(y,{content:"放大",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:h,"aria-label":"放大"},{icon:De(()=>[Q(Xo(k8))]),_:1})]),_:1})]),_:1})])}}};const M7={__name:"App",setup(o){let n;const s=ge(),l=lr();function a(){for(let d=0;d<5;d++)setTimeout(()=>{Tt.svgResize(l.workspaceSvg)},100*d)}function u(d=!1){s.value.$el.style.display=d?"block":"none",a()}return zt(()=>{Et(l.$state,d=>{d.hasLayoutSider!==n&&(u(d.hasLayoutSider),n=d.hasLayoutSider)},{deep:!0}),a(),u()}),(d,h)=>{const p=Du,f=Pu,T=CM;return me(),Fe(Wt,null,[Q(T,null,{default:De(()=>[Q(p,null,{default:De(()=>[Q(L7),Q(u7),Q(m7),Q(w7)]),_:1}),Q(f,{ref_key:"layoutSider",ref:s,"resize-directions":["left"],onMoving:a,onMovingEnd:a},{default:De(()=>[Q(kD)]),_:1},512)]),_:1}),Q(l7),Q(b7),Q(c7),Q(AD)],64)}}};yc.registerLanguage("javascript",x5);yc.registerLanguage("python",B5);const kg=V3(M7),D7=U5();kg.use(N5);kg.use(D7);kg.mount("#app");if("serviceWorker"in navigator){const o=Q5({onNeedRefresh(){dn.confirm({title:"注意",content:"当前版本有更新,请问是否立即更新。",okText:"确认",onOk:()=>{o(!0)},onCancel:!1,hideCancel:!1})}})} diff --git a/dist/assets/index-8bf0eee1.js.gz b/dist/assets/index-8bf0eee1.js.gz new file mode 100644 index 0000000000000000000000000000000000000000..2c2c11e6f2eb0f6377be0e0d2df5846a9b7ad845 Binary files /dev/null and b/dist/assets/index-8bf0eee1.js.gz differ diff --git a/dist/assets/index-8f79ef64.js b/dist/assets/index-8f79ef64.js new file mode 100644 index 0000000000000000000000000000000000000000..bc158fd5148e4ef2c1f4508d7621d3bdae6cdfe6 --- /dev/null +++ b/dist/assets/index-8f79ef64.js @@ -0,0 +1,1237 @@ +var d9=Object.defineProperty;var h9=(o,n,s)=>n in o?d9(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s;var J$=(o,n,s)=>(h9(o,typeof n!="symbol"?n+"":n,s),s);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))l(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function s(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function l(a){if(a.ep)return;a.ep=!0;const u=s(a);fetch(a.href,u)}})();function B0(o,n){const s=Object.create(null),l=o.split(",");for(let a=0;a!!s[a.toLowerCase()]:a=>!!s[a]}const Kt={},sl=[],Ls=()=>{},p9=()=>!1,$9=/^on[^a-z]/,Yu=o=>$9.test(o),F0=o=>o.startsWith("onUpdate:"),lo=Object.assign,U0=(o,n)=>{const s=o.indexOf(n);s>-1&&o.splice(s,1)},_9=Object.prototype.hasOwnProperty,Lt=(o,n)=>_9.call(o,n),lt=Array.isArray,il=o=>Ku(o)==="[object Map]",Wb=o=>Ku(o)==="[object Set]",gt=o=>typeof o=="function",to=o=>typeof o=="string",H0=o=>typeof o=="symbol",Yt=o=>o!==null&&typeof o=="object",zb=o=>Yt(o)&>(o.then)&>(o.catch),Xb=Object.prototype.toString,Ku=o=>Xb.call(o),g9=o=>Ku(o).slice(8,-1),jb=o=>Ku(o)==="[object Object]",V0=o=>to(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o,Su=B0(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qu=o=>{const n=Object.create(null);return s=>n[s]||(n[s]=o(s))},f9=/-(\w)/g,ti=Qu(o=>o.replace(f9,(n,s)=>s?s.toUpperCase():"")),m9=/\B([A-Z])/g,$l=Qu(o=>o.replace(m9,"-$1").toLowerCase()),qu=Qu(o=>o.charAt(0).toUpperCase()+o.slice(1)),Z$=Qu(o=>o?`on${qu(o)}`:""),Rc=(o,n)=>!Object.is(o,n),e_=(o,n)=>{for(let s=0;s{Object.defineProperty(o,n,{configurable:!0,enumerable:!1,value:s})},T9=o=>{const n=parseFloat(o);return isNaN(n)?o:n},E9=o=>{const n=to(o)?Number(o):NaN;return isNaN(n)?o:n};let AE;const $0=()=>AE||(AE=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function It(o){if(lt(o)){const n={};for(let s=0;s{if(s){const l=s.split(v9);l.length>1&&(n[l[0].trim()]=l[1].trim())}}),n}function Pe(o){let n="";if(to(o))n=o;else if(lt(o))for(let s=0;sto(o)?o:o==null?"":lt(o)||Yt(o)&&(o.toString===Xb||!gt(o.toString))?JSON.stringify(o,Kb,2):String(o),Kb=(o,n)=>n&&n.__v_isRef?Kb(o,n.value):il(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((s,[l,a])=>(s[`${l} =>`]=a,s),{})}:Wb(n)?{[`Set(${n.size})`]:[...n.values()]}:Yt(n)&&!lt(n)&&!jb(n)?String(n):n;let is;class Qb{constructor(n=!1){this.detached=n,this._active=!0,this.effects=[],this.cleanups=[],this.parent=is,!n&&is&&(this.index=(is.scopes||(is.scopes=[])).push(this)-1)}get active(){return this._active}run(n){if(this._active){const s=is;try{return is=this,n()}finally{is=s}}}on(){is=this}off(){is=this.parent}stop(n){if(this._active){let s,l;for(s=0,l=this.effects.length;s{const n=new Set(o);return n.w=0,n.n=0,n},Zb=o=>(o.w&an)>0,ev=o=>(o.n&an)>0,k9=({deps:o})=>{if(o.length)for(let n=0;n{const{deps:n}=o;if(n.length){let s=0;for(let l=0;l{(T==="length"||T>=p)&&h.push(f)})}else switch(s!==void 0&&h.push(d.get(s)),n){case"add":lt(o)?V0(s)&&h.push(d.get("length")):(h.push(d.get(Yn)),il(o)&&h.push(d.get(g0)));break;case"delete":lt(o)||(h.push(d.get(Yn)),il(o)&&h.push(d.get(g0)));break;case"set":il(o)&&h.push(d.get(Yn));break}if(h.length===1)h[0]&&f0(h[0]);else{const p=[];for(const f of h)f&&p.push(...f);f0(W0(p))}}function f0(o,n){const s=lt(o)?o:[...o];for(const l of s)l.computed&&NE(l);for(const l of s)l.computed||NE(l)}function NE(o,n){(o!==Rs||o.allowRecurse)&&(o.scheduler?o.scheduler():o.run())}function L9(o,n){var s;return(s=Fu.get(o))==null?void 0:s.get(n)}const N9=B0("__proto__,__v_isRef,__isVue"),sv=new Set(Object.getOwnPropertyNames(Symbol).filter(o=>o!=="arguments"&&o!=="caller").map(o=>Symbol[o]).filter(H0)),w9=X0(),M9=X0(!1,!0),D9=X0(!0),wE=P9();function P9(){const o={};return["includes","indexOf","lastIndexOf"].forEach(n=>{o[n]=function(...s){const l=Ct(this);for(let u=0,d=this.length;u{o[n]=function(...s){_l();const l=Ct(this)[n].apply(this,s);return gl(),l}}),o}function x9(o){const n=Ct(this);return Ko(n,"has",o),n.hasOwnProperty(o)}function X0(o=!1,n=!1){return function(l,a,u){if(a==="__v_isReactive")return!o;if(a==="__v_isReadonly")return o;if(a==="__v_isShallow")return n;if(a==="__v_raw"&&u===(o?n?Z9:cv:n?lv:rv).get(l))return l;const d=lt(l);if(!o){if(d&&Lt(wE,a))return Reflect.get(wE,a,u);if(a==="hasOwnProperty")return x9}const h=Reflect.get(l,a,u);return(H0(a)?sv.has(a):N9(a))||(o||Ko(l,"get",a),n)?h:eo(h)?d&&V0(a)?h:h.value:Yt(h)?o?K0(h):Jt(h):h}}const B9=iv(),F9=iv(!0);function iv(o=!1){return function(s,l,a,u){let d=s[l];if(cl(d)&&eo(d)&&!eo(a))return!1;if(!o&&(!Uu(a)&&!cl(a)&&(d=Ct(d),a=Ct(a)),!lt(s)&&eo(d)&&!eo(a)))return d.value=a,!0;const h=lt(s)&&V0(l)?Number(l)o,Ju=o=>Reflect.getPrototypeOf(o);function hu(o,n,s=!1,l=!1){o=o.__v_raw;const a=Ct(o),u=Ct(n);s||(n!==u&&Ko(a,"get",n),Ko(a,"get",u));const{has:d}=Ju(a),h=l?j0:s?q0:kc;if(d.call(a,n))return h(o.get(n));if(d.call(a,u))return h(o.get(u));o!==a&&o.get(n)}function pu(o,n=!1){const s=this.__v_raw,l=Ct(s),a=Ct(o);return n||(o!==a&&Ko(l,"has",o),Ko(l,"has",a)),o===a?s.has(o):s.has(o)||s.has(a)}function $u(o,n=!1){return o=o.__v_raw,!n&&Ko(Ct(o),"iterate",Yn),Reflect.get(o,"size",o)}function ME(o){o=Ct(o);const n=Ct(this);return Ju(n).has.call(n,o)||(n.add(o),yi(n,"add",o,o)),this}function DE(o,n){n=Ct(n);const s=Ct(this),{has:l,get:a}=Ju(s);let u=l.call(s,o);u||(o=Ct(o),u=l.call(s,o));const d=a.call(s,o);return s.set(o,n),u?Rc(n,d)&&yi(s,"set",o,n):yi(s,"add",o,n),this}function PE(o){const n=Ct(this),{has:s,get:l}=Ju(n);let a=s.call(n,o);a||(o=Ct(o),a=s.call(n,o)),l&&l.call(n,o);const u=n.delete(o);return a&&yi(n,"delete",o,void 0),u}function xE(){const o=Ct(this),n=o.size!==0,s=o.clear();return n&&yi(o,"clear",void 0,void 0),s}function _u(o,n){return function(l,a){const u=this,d=u.__v_raw,h=Ct(d),p=n?j0:o?q0:kc;return!o&&Ko(h,"iterate",Yn),d.forEach((f,T)=>l.call(a,p(f),p(T),u))}}function gu(o,n,s){return function(...l){const a=this.__v_raw,u=Ct(a),d=il(u),h=o==="entries"||o===Symbol.iterator&&d,p=o==="keys"&&d,f=a[o](...l),T=s?j0:n?q0:kc;return!n&&Ko(u,"iterate",p?g0:Yn),{next(){const{value:C,done:S}=f.next();return S?{value:C,done:S}:{value:h?[T(C[0]),T(C[1])]:T(C),done:S}},[Symbol.iterator](){return this}}}}function qi(o){return function(...n){return o==="delete"?!1:this}}function z9(){const o={get(u){return hu(this,u)},get size(){return $u(this)},has:pu,add:ME,set:DE,delete:PE,clear:xE,forEach:_u(!1,!1)},n={get(u){return hu(this,u,!1,!0)},get size(){return $u(this)},has:pu,add:ME,set:DE,delete:PE,clear:xE,forEach:_u(!1,!0)},s={get(u){return hu(this,u,!0)},get size(){return $u(this,!0)},has(u){return pu.call(this,u,!0)},add:qi("add"),set:qi("set"),delete:qi("delete"),clear:qi("clear"),forEach:_u(!0,!1)},l={get(u){return hu(this,u,!0,!0)},get size(){return $u(this,!0)},has(u){return pu.call(this,u,!0)},add:qi("add"),set:qi("set"),delete:qi("delete"),clear:qi("clear"),forEach:_u(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=gu(u,!1,!1),s[u]=gu(u,!0,!1),n[u]=gu(u,!1,!0),l[u]=gu(u,!0,!0)}),[o,s,n,l]}const[X9,j9,Y9,K9]=z9();function Y0(o,n){const s=n?o?K9:Y9:o?j9:X9;return(l,a,u)=>a==="__v_isReactive"?!o:a==="__v_isReadonly"?o:a==="__v_raw"?l:Reflect.get(Lt(s,a)&&a in l?s:l,a,u)}const Q9={get:Y0(!1,!1)},q9={get:Y0(!1,!0)},J9={get:Y0(!0,!1)},rv=new WeakMap,lv=new WeakMap,cv=new WeakMap,Z9=new WeakMap;function eR(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function tR(o){return o.__v_skip||!Object.isExtensible(o)?0:eR(g9(o))}function Jt(o){return cl(o)?o:Q0(o,!1,nv,Q9,rv)}function oR(o){return Q0(o,!1,W9,q9,lv)}function K0(o){return Q0(o,!0,G9,J9,cv)}function Q0(o,n,s,l,a){if(!Yt(o)||o.__v_raw&&!(n&&o.__v_isReactive))return o;const u=a.get(o);if(u)return u;const d=tR(o);if(d===0)return o;const h=new Proxy(o,d===2?l:s);return a.set(o,h),h}function rn(o){return cl(o)?rn(o.__v_raw):!!(o&&o.__v_isReactive)}function cl(o){return!!(o&&o.__v_isReadonly)}function Uu(o){return!!(o&&o.__v_isShallow)}function av(o){return rn(o)||cl(o)}function Ct(o){const n=o&&o.__v_raw;return n?Ct(n):o}function Zu(o){return Bu(o,"__v_skip",!0),o}const kc=o=>Yt(o)?Jt(o):o,q0=o=>Yt(o)?K0(o):o;function uv(o){nn&&Rs&&(o=Ct(o),ov(o.dep||(o.dep=W0())))}function dv(o,n){o=Ct(o);const s=o.dep;s&&f0(s)}function eo(o){return!!(o&&o.__v_isRef===!0)}function ge(o){return hv(o,!1)}function BE(o){return hv(o,!0)}function hv(o,n){return eo(o)?o:new sR(o,n)}class sR{constructor(n,s){this.__v_isShallow=s,this.dep=void 0,this.__v_isRef=!0,this._rawValue=s?n:Ct(n),this._value=s?n:kc(n)}get value(){return uv(this),this._value}set value(n){const s=this.__v_isShallow||Uu(n)||cl(n);n=s?n:Ct(n),Rc(n,this._rawValue)&&(this._rawValue=n,this._value=s?n:kc(n),dv(this))}}function Xo(o){return eo(o)?o.value:o}const iR={get:(o,n,s)=>Xo(Reflect.get(o,n,s)),set:(o,n,s,l)=>{const a=o[n];return eo(a)&&!eo(s)?(a.value=s,!0):Reflect.set(o,n,s,l)}};function pv(o){return rn(o)?o:new Proxy(o,iR)}function Pt(o){const n=lt(o)?new Array(o.length):{};for(const s in o)n[s]=$v(o,s);return n}class nR{constructor(n,s,l){this._object=n,this._key=s,this._defaultValue=l,this.__v_isRef=!0}get value(){const n=this._object[this._key];return n===void 0?this._defaultValue:n}set value(n){this._object[this._key]=n}get dep(){return L9(Ct(this._object),this._key)}}class rR{constructor(n){this._getter=n,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function m0(o,n,s){return eo(o)?o:gt(o)?new rR(o):Yt(o)&&arguments.length>1?$v(o,n,s):ge(o)}function $v(o,n,s){const l=o[n];return eo(l)?l:new nR(o,n,s)}class lR{constructor(n,s,l,a){this._setter=s,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new z0(n,()=>{this._dirty||(this._dirty=!0,dv(this))}),this.effect.computed=this,this.effect.active=this._cacheable=!a,this.__v_isReadonly=l}get value(){const n=Ct(this);return uv(n),(n._dirty||!n._cacheable)&&(n._dirty=!1,n._value=n.effect.run()),n._value}set value(n){this._setter(n)}}function cR(o,n,s=!1){let l,a;const u=gt(o);return u?(l=o,a=Ls):(l=o.get,a=o.set),new lR(l,a,u||!a,s)}function ln(o,n,s,l){let a;try{a=l?o(...l):o()}catch(u){ed(u,n,s)}return a}function _s(o,n,s,l){if(gt(o)){const u=ln(o,n,s,l);return u&&zb(u)&&u.catch(d=>{ed(d,n,s)}),u}const a=[];for(let u=0;u>>1;Lc(Ro[l])ei&&Ro.splice(n,1)}function hR(o){lt(o)?nl.push(...o):(!Oi||!Oi.includes(o,o.allowRecurse?Wn+1:Wn))&&nl.push(o),gv()}function FE(o,n=Ac?ei+1:0){for(;nLc(s)-Lc(l)),Wn=0;Wno.id==null?1/0:o.id,pR=(o,n)=>{const s=Lc(o)-Lc(n);if(s===0){if(o.pre&&!n.pre)return-1;if(n.pre&&!o.pre)return 1}return s};function mv(o){T0=!1,Ac=!0,Ro.sort(pR);const n=Ls;try{for(ei=0;eito(P)?P.trim():P)),C&&(a=s.map(T9))}let h,p=l[h=Z$(n)]||l[h=Z$(ti(n))];!p&&u&&(p=l[h=Z$($l(n))]),p&&_s(p,o,6,a);const f=l[h+"Once"];if(f){if(!o.emitted)o.emitted={};else if(o.emitted[h])return;o.emitted[h]=!0,_s(f,o,6,a)}}function Tv(o,n,s=!1){const l=n.emitsCache,a=l.get(o);if(a!==void 0)return a;const u=o.emits;let d={},h=!1;if(!gt(o)){const p=f=>{const T=Tv(f,n,!0);T&&(h=!0,lo(d,T))};!s&&n.mixins.length&&n.mixins.forEach(p),o.extends&&p(o.extends),o.mixins&&o.mixins.forEach(p)}return!u&&!h?(Yt(o)&&l.set(o,null),null):(lt(u)?u.forEach(p=>d[p]=null):lo(d,u),Yt(o)&&l.set(o,d),d)}function td(o,n){return!o||!Yu(n)?!1:(n=n.slice(2).replace(/Once$/,""),Lt(o,n[0].toLowerCase()+n.slice(1))||Lt(o,$l(n))||Lt(o,n))}let mo=null,Ev=null;function Hu(o){const n=mo;return mo=o,Ev=o&&o.type.__scopeId||null,n}function De(o,n=mo,s){if(!n||o._n)return o;const l=(...a)=>{l._d&&JE(-1);const u=Hu(n);let d;try{d=o(...a)}finally{Hu(u),l._d&&JE(1)}return d};return l._n=!0,l._c=!0,l._d=!0,l}function t_(o){const{type:n,vnode:s,proxy:l,withProxy:a,props:u,propsOptions:[d],slots:h,attrs:p,emit:f,render:T,renderCache:C,data:S,setupState:P,ctx:x,inheritAttrs:G}=o;let oe,ne;const Z=Hu(o);try{if(s.shapeFlag&4){const M=a||l;oe=Js(T.call(M,M,C,u,P,S,x)),ne=p}else{const M=n;oe=Js(M.length>1?M(u,{attrs:p,slots:h,emit:f}):M(u,null)),ne=n.props?p:_R(p)}}catch(M){Oc.length=0,ed(M,o,1),oe=Q(ns)}let Y=oe;if(ne&&G!==!1){const M=Object.keys(ne),{shapeFlag:L}=Y;M.length&&L&7&&(d&&M.some(F0)&&(ne=gR(ne,d)),Y=gs(Y,ne))}return s.dirs&&(Y=gs(Y),Y.dirs=Y.dirs?Y.dirs.concat(s.dirs):s.dirs),s.transition&&(Y.transition=s.transition),oe=Y,Hu(Z),oe}const _R=o=>{let n;for(const s in o)(s==="class"||s==="style"||Yu(s))&&((n||(n={}))[s]=o[s]);return n},gR=(o,n)=>{const s={};for(const l in o)(!F0(l)||!(l.slice(9)in n))&&(s[l]=o[l]);return s};function fR(o,n,s){const{props:l,children:a,component:u}=o,{props:d,children:h,patchFlag:p}=n,f=u.emitsOptions;if(n.dirs||n.transition)return!0;if(s&&p>=0){if(p&1024)return!0;if(p&16)return l?UE(l,d,f):!!d;if(p&8){const T=n.dynamicProps;for(let C=0;Co.__isSuspense;function ER(o,n){n&&n.pendingBranch?lt(o)?n.effects.push(...o):n.effects.push(o):hR(o)}function eg(o,n){return tg(o,null,n)}const fu={};function Et(o,n,s){return tg(o,n,s)}function tg(o,n,{immediate:s,deep:l,flush:a,onTrack:u,onTrigger:d}=Kt){var h;const p=G0()===((h=_o)==null?void 0:h.scope)?_o:null;let f,T=!1,C=!1;if(eo(o)?(f=()=>o.value,T=Uu(o)):rn(o)?(f=()=>o,l=!0):lt(o)?(C=!0,T=o.some(M=>rn(M)||Uu(M)),f=()=>o.map(M=>{if(eo(M))return M.value;if(rn(M))return jn(M);if(gt(M))return ln(M,p,2)})):gt(o)?n?f=()=>ln(o,p,2):f=()=>{if(!(p&&p.isUnmounted))return S&&S(),_s(o,p,3,[P])}:f=Ls,n&&l){const M=f;f=()=>jn(M())}let S,P=M=>{S=Z.onStop=()=>{ln(M,p,4)}},x;if(Pc)if(P=Ls,n?s&&_s(n,p,3,[f(),C?[]:void 0,P]):f(),a==="sync"){const M=d3();x=M.__watcherHandles||(M.__watcherHandles=[])}else return Ls;let G=C?new Array(o.length).fill(fu):fu;const oe=()=>{if(Z.active)if(n){const M=Z.run();(l||T||(C?M.some((L,R)=>Rc(L,G[R])):Rc(M,G)))&&(S&&S(),_s(n,p,3,[M,G===fu?void 0:C&&G[0]===fu?[]:G,P]),G=M)}else Z.run()};oe.allowRecurse=!!n;let ne;a==="sync"?ne=oe:a==="post"?ne=()=>zo(oe,p&&p.suspense):(oe.pre=!0,p&&(oe.id=p.uid),ne=()=>Z0(oe));const Z=new z0(f,ne);n?s?oe():G=Z.run():a==="post"?zo(Z.run.bind(Z),p&&p.suspense):Z.run();const Y=()=>{Z.stop(),p&&p.scope&&U0(p.scope.effects,Z)};return x&&x.push(Y),Y}function bR(o,n,s){const l=this.proxy,a=to(o)?o.includes(".")?bv(l,o):()=>l[o]:o.bind(l,l);let u;gt(n)?u=n:(u=n.handler,s=n);const d=_o;ul(this);const h=tg(a,u.bind(l),s);return d?ul(d):Qn(),h}function bv(o,n){const s=n.split(".");return()=>{let l=o;for(let a=0;a{jn(s,n)});else if(jb(o))for(const s in o)jn(o[s],n);return o}function Kn(o,n){const s=mo;if(s===null)return o;const l=cd(s)||s.proxy,a=o.dirs||(o.dirs=[]);for(let u=0;u{o.isMounted=!0}),Ri(()=>{o.isUnmounting=!0}),o}const $s=[Function,Array],Iv={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:$s,onEnter:$s,onAfterEnter:$s,onEnterCancelled:$s,onBeforeLeave:$s,onLeave:$s,onAfterLeave:$s,onLeaveCancelled:$s,onBeforeAppear:$s,onAppear:$s,onAfterAppear:$s,onAppearCancelled:$s},vR={name:"BaseTransition",props:Iv,setup(o,{slots:n}){const s=ml(),l=vv();let a;return()=>{const u=n.default&&og(n.default(),!0);if(!u||!u.length)return;let d=u[0];if(u.length>1){for(const G of u)if(G.type!==ns){d=G;break}}const h=Ct(o),{mode:p}=h;if(l.isLeaving)return o_(d);const f=HE(d);if(!f)return o_(d);const T=Nc(f,h,l,s);wc(f,T);const C=s.subTree,S=C&&HE(C);let P=!1;const{getTransitionKey:x}=f.type;if(x){const G=x();a===void 0?a=G:G!==a&&(a=G,P=!0)}if(S&&S.type!==ns&&(!zn(f,S)||P)){const G=Nc(S,h,l,s);if(wc(S,G),p==="out-in")return l.isLeaving=!0,G.afterLeave=()=>{l.isLeaving=!1,s.update.active!==!1&&s.update()},o_(d);p==="in-out"&&f.type!==ns&&(G.delayLeave=(oe,ne,Z)=>{const Y=Ov(l,S);Y[String(S.key)]=S,oe._leaveCb=()=>{ne(),oe._leaveCb=void 0,delete T.delayedLeave},T.delayedLeave=Z})}return d}}},IR=vR;function Ov(o,n){const{leavingVNodes:s}=o;let l=s.get(n.type);return l||(l=Object.create(null),s.set(n.type,l)),l}function Nc(o,n,s,l){const{appear:a,mode:u,persisted:d=!1,onBeforeEnter:h,onEnter:p,onAfterEnter:f,onEnterCancelled:T,onBeforeLeave:C,onLeave:S,onAfterLeave:P,onLeaveCancelled:x,onBeforeAppear:G,onAppear:oe,onAfterAppear:ne,onAppearCancelled:Z}=n,Y=String(o.key),M=Ov(s,o),L=(z,X)=>{z&&_s(z,l,9,X)},R=(z,X)=>{const le=X[1];L(z,X),lt(z)?z.every($e=>$e.length<=1)&&le():z.length<=1&&le()},F={mode:u,persisted:d,beforeEnter(z){let X=h;if(!s.isMounted)if(a)X=G||h;else return;z._leaveCb&&z._leaveCb(!0);const le=M[Y];le&&zn(o,le)&&le.el._leaveCb&&le.el._leaveCb(),L(X,[z])},enter(z){let X=p,le=f,$e=T;if(!s.isMounted)if(a)X=oe||p,le=ne||f,$e=Z||T;else return;let he=!1;const fe=z._enterCb=ke=>{he||(he=!0,ke?L($e,[z]):L(le,[z]),F.delayedLeave&&F.delayedLeave(),z._enterCb=void 0)};X?R(X,[z,fe]):fe()},leave(z,X){const le=String(o.key);if(z._enterCb&&z._enterCb(!0),s.isUnmounting)return X();L(C,[z]);let $e=!1;const he=z._leaveCb=fe=>{$e||($e=!0,X(),fe?L(x,[z]):L(P,[z]),z._leaveCb=void 0,M[le]===o&&delete M[le])};M[le]=o,S?R(S,[z,he]):he()},clone(z){return Nc(z,n,s,l)}};return F}function o_(o){if(od(o))return o=gs(o),o.children=null,o}function HE(o){return od(o)?o.children?o.children[0]:void 0:o}function wc(o,n){o.shapeFlag&6&&o.component?wc(o.component.subTree,n):o.shapeFlag&128?(o.ssContent.transition=n.clone(o.ssContent),o.ssFallback.transition=n.clone(o.ssFallback)):o.transition=n}function og(o,n=!1,s){let l=[],a=0;for(let u=0;u1)for(let u=0;ulo({name:o.name},n,{setup:o}))():o}const bc=o=>!!o.type.__asyncLoader,od=o=>o.type.__isKeepAlive;function OR(o,n){yv(o,"a",n)}function Cv(o,n){yv(o,"da",n)}function yv(o,n,s=_o){const l=o.__wdc||(o.__wdc=()=>{let a=s;for(;a;){if(a.isDeactivated)return;a=a.parent}return o()});if(sd(n,l,s),s){let a=s.parent;for(;a&&a.parent;)od(a.parent.vnode)&&CR(l,n,s,a),a=a.parent}}function CR(o,n,s,l){const a=sd(n,o,l,!0);Uc(()=>{U0(l[n],a)},s)}function sd(o,n,s=_o,l=!1){if(s){const a=s[o]||(s[o]=[]),u=n.__weh||(n.__weh=(...d)=>{if(s.isUnmounted)return;_l(),ul(s);const h=_s(n,s,o,d);return Qn(),gl(),h});return l?a.unshift(u):a.push(u),u}}const Si=o=>(n,s=_o)=>(!Pc||o==="sp")&&sd(o,(...l)=>n(...l),s),yR=Si("bm"),zt=Si("m"),SR=Si("bu"),fl=Si("u"),Ri=Si("bum"),Uc=Si("um"),RR=Si("sp"),kR=Si("rtg"),AR=Si("rtc");function LR(o,n=_o){sd("ec",o,n)}const sg="components";function _t(o,n){return Rv(sg,o,!0,n)||o}const Sv=Symbol.for("v-ndc");function cn(o){return to(o)?Rv(sg,o,!1)||o:o||Sv}function Rv(o,n,s=!0,l=!1){const a=mo||_o;if(a){const u=a.type;if(o===sg){const h=c3(u,!1);if(h&&(h===n||h===ti(n)||h===qu(ti(n))))return u}const d=VE(a[o]||u[o],n)||VE(a.appContext[o],n);return!d&&l?u:d}}function VE(o,n){return o&&(o[n]||o[ti(n)]||o[qu(ti(n))])}function id(o,n,s,l){let a;const u=s&&s[l];if(lt(o)||to(o)){a=new Array(o.length);for(let d=0,h=o.length;dn(d,h,void 0,u&&u[h]));else{const d=Object.keys(o);a=new Array(d.length);for(let h=0,p=d.length;h{const u=l.fn(...a);return u&&(u.key=l.key),u}:l.fn)}return o}function ct(o,n,s={},l,a){if(mo.isCE||mo.parent&&bc(mo.parent)&&mo.parent.isCE)return n!=="default"&&(s.name=n),Q("slot",s,l&&l());let u=o[n];u&&u._c&&(u._d=!1),me();const d=u&&Av(u(s)),h=it(Wt,{key:s.key||d&&d.key||`_${n}`},d||(l?l():[]),d&&o._===1?64:-2);return!a&&h.scopeId&&(h.slotScopeIds=[h.scopeId+"-s"]),u&&u._c&&(u._d=!0),h}function Av(o){return o.some(n=>al(n)?!(n.type===ns||n.type===Wt&&!Av(n.children)):!0)?o:null}const E0=o=>o?Hv(o)?cd(o)||o.proxy:E0(o.parent):null,vc=lo(Object.create(null),{$:o=>o,$el:o=>o.vnode.el,$data:o=>o.data,$props:o=>o.props,$attrs:o=>o.attrs,$slots:o=>o.slots,$refs:o=>o.refs,$parent:o=>E0(o.parent),$root:o=>E0(o.root),$emit:o=>o.emit,$options:o=>ig(o),$forceUpdate:o=>o.f||(o.f=()=>Z0(o.update)),$nextTick:o=>o.n||(o.n=Io.bind(o.proxy)),$watch:o=>bR.bind(o)}),s_=(o,n)=>o!==Kt&&!o.__isScriptSetup&&Lt(o,n),NR={get({_:o},n){const{ctx:s,setupState:l,data:a,props:u,accessCache:d,type:h,appContext:p}=o;let f;if(n[0]!=="$"){const P=d[n];if(P!==void 0)switch(P){case 1:return l[n];case 2:return a[n];case 4:return s[n];case 3:return u[n]}else{if(s_(l,n))return d[n]=1,l[n];if(a!==Kt&&Lt(a,n))return d[n]=2,a[n];if((f=o.propsOptions[0])&&Lt(f,n))return d[n]=3,u[n];if(s!==Kt&&Lt(s,n))return d[n]=4,s[n];b0&&(d[n]=0)}}const T=vc[n];let C,S;if(T)return n==="$attrs"&&Ko(o,"get",n),T(o);if((C=h.__cssModules)&&(C=C[n]))return C;if(s!==Kt&&Lt(s,n))return d[n]=4,s[n];if(S=p.config.globalProperties,Lt(S,n))return S[n]},set({_:o},n,s){const{data:l,setupState:a,ctx:u}=o;return s_(a,n)?(a[n]=s,!0):l!==Kt&&Lt(l,n)?(l[n]=s,!0):Lt(o.props,n)||n[0]==="$"&&n.slice(1)in o?!1:(u[n]=s,!0)},has({_:{data:o,setupState:n,accessCache:s,ctx:l,appContext:a,propsOptions:u}},d){let h;return!!s[d]||o!==Kt&&Lt(o,d)||s_(n,d)||(h=u[0])&&Lt(h,d)||Lt(l,d)||Lt(vc,d)||Lt(a.config.globalProperties,d)},defineProperty(o,n,s){return s.get!=null?o._.accessCache[n]=0:Lt(s,"value")&&this.set(o,n,s.value,null),Reflect.defineProperty(o,n,s)}};function GE(o){return lt(o)?o.reduce((n,s)=>(n[s]=null,n),{}):o}let b0=!0;function wR(o){const n=ig(o),s=o.proxy,l=o.ctx;b0=!1,n.beforeCreate&&WE(n.beforeCreate,o,"bc");const{data:a,computed:u,methods:d,watch:h,provide:p,inject:f,created:T,beforeMount:C,mounted:S,beforeUpdate:P,updated:x,activated:G,deactivated:oe,beforeDestroy:ne,beforeUnmount:Z,destroyed:Y,unmounted:M,render:L,renderTracked:R,renderTriggered:F,errorCaptured:z,serverPrefetch:X,expose:le,inheritAttrs:$e,components:he,directives:fe,filters:ke}=n;if(f&&MR(f,l,null),d)for(const D in d){const B=d[D];gt(B)&&(l[D]=B.bind(s))}if(a){const D=a.call(s,s);Yt(D)&&(o.data=Jt(D))}if(b0=!0,u)for(const D in u){const B=u[D],ae=gt(B)?B.bind(s,s):gt(B.get)?B.get.bind(s,s):Ls,_e=!gt(B)&>(B.set)?B.set.bind(s):Ls,Me=j({get:ae,set:_e});Object.defineProperty(l,D,{enumerable:!0,configurable:!0,get:()=>Me.value,set:Xe=>Me.value=Xe})}if(h)for(const D in h)Lv(h[D],l,s,D);if(p){const D=gt(p)?p.call(s):p;Reflect.ownKeys(D).forEach(B=>{hn(B,D[B])})}T&&WE(T,o,"c");function Ie(D,B){lt(B)?B.forEach(ae=>D(ae.bind(s))):B&&D(B.bind(s))}if(Ie(yR,C),Ie(zt,S),Ie(SR,P),Ie(fl,x),Ie(OR,G),Ie(Cv,oe),Ie(LR,z),Ie(AR,R),Ie(kR,F),Ie(Ri,Z),Ie(Uc,M),Ie(RR,X),lt(le))if(le.length){const D=o.exposed||(o.exposed={});le.forEach(B=>{Object.defineProperty(D,B,{get:()=>s[B],set:ae=>s[B]=ae})})}else o.exposed||(o.exposed={});L&&o.render===Ls&&(o.render=L),$e!=null&&(o.inheritAttrs=$e),he&&(o.components=he),fe&&(o.directives=fe)}function MR(o,n,s=Ls){lt(o)&&(o=v0(o));for(const l in o){const a=o[l];let u;Yt(a)?"default"in a?u=ho(a.from||l,a.default,!0):u=ho(a.from||l):u=ho(a),eo(u)?Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get:()=>u.value,set:d=>u.value=d}):n[l]=u}}function WE(o,n,s){_s(lt(o)?o.map(l=>l.bind(n.proxy)):o.bind(n.proxy),n,s)}function Lv(o,n,s,l){const a=l.includes(".")?bv(s,l):()=>s[l];if(to(o)){const u=n[o];gt(u)&&Et(a,u)}else if(gt(o))Et(a,o.bind(s));else if(Yt(o))if(lt(o))o.forEach(u=>Lv(u,n,s,l));else{const u=gt(o.handler)?o.handler.bind(s):n[o.handler];gt(u)&&Et(a,u,o)}}function ig(o){const n=o.type,{mixins:s,extends:l}=n,{mixins:a,optionsCache:u,config:{optionMergeStrategies:d}}=o.appContext,h=u.get(n);let p;return h?p=h:!a.length&&!s&&!l?p=n:(p={},a.length&&a.forEach(f=>Vu(p,f,d,!0)),Vu(p,n,d)),Yt(n)&&u.set(n,p),p}function Vu(o,n,s,l=!1){const{mixins:a,extends:u}=n;u&&Vu(o,u,s,!0),a&&a.forEach(d=>Vu(o,d,s,!0));for(const d in n)if(!(l&&d==="expose")){const h=DR[d]||s&&s[d];o[d]=h?h(o[d],n[d]):n[d]}return o}const DR={data:zE,props:XE,emits:XE,methods:mc,computed:mc,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:mc,directives:mc,watch:xR,provide:zE,inject:PR};function zE(o,n){return n?o?function(){return lo(gt(o)?o.call(this,this):o,gt(n)?n.call(this,this):n)}:n:o}function PR(o,n){return mc(v0(o),v0(n))}function v0(o){if(lt(o)){const n={};for(let s=0;s1)return s&>(n)?n.call(l&&l.proxy):n}}function UR(){return!!(_o||mo||Mc)}function HR(o,n,s,l=!1){const a={},u={};Bu(u,rd,1),o.propsDefaults=Object.create(null),wv(o,n,a,u);for(const d in o.propsOptions[0])d in a||(a[d]=void 0);s?o.props=l?a:oR(a):o.type.props?o.props=a:o.props=u,o.attrs=u}function VR(o,n,s,l){const{props:a,attrs:u,vnode:{patchFlag:d}}=o,h=Ct(a),[p]=o.propsOptions;let f=!1;if((l||d>0)&&!(d&16)){if(d&8){const T=o.vnode.dynamicProps;for(let C=0;C{p=!0;const[S,P]=Mv(C,n,!0);lo(d,S),P&&h.push(...P)};!s&&n.mixins.length&&n.mixins.forEach(T),o.extends&&T(o.extends),o.mixins&&o.mixins.forEach(T)}if(!u&&!p)return Yt(o)&&l.set(o,sl),sl;if(lt(u))for(let T=0;T-1,P[1]=G<0||x-1||Lt(P,"default"))&&h.push(C)}}}const f=[d,h];return Yt(o)&&l.set(o,f),f}function jE(o){return o[0]!=="$"}function YE(o){const n=o&&o.toString().match(/^\s*(function|class) (\w+)/);return n?n[2]:o===null?"null":""}function KE(o,n){return YE(o)===YE(n)}function QE(o,n){return lt(n)?n.findIndex(s=>KE(s,o)):gt(n)&&KE(n,o)?0:-1}const Dv=o=>o[0]==="_"||o==="$stable",ng=o=>lt(o)?o.map(Js):[Js(o)],GR=(o,n,s)=>{if(n._n)return n;const l=De((...a)=>ng(n(...a)),s);return l._c=!1,l},Pv=(o,n,s)=>{const l=o._ctx;for(const a in o){if(Dv(a))continue;const u=o[a];if(gt(u))n[a]=GR(a,u,l);else if(u!=null){const d=ng(u);n[a]=()=>d}}},xv=(o,n)=>{const s=ng(n);o.slots.default=()=>s},WR=(o,n)=>{if(o.vnode.shapeFlag&32){const s=n._;s?(o.slots=Ct(n),Bu(n,"_",s)):Pv(n,o.slots={})}else o.slots={},n&&xv(o,n);Bu(o.slots,rd,1)},zR=(o,n,s)=>{const{vnode:l,slots:a}=o;let u=!0,d=Kt;if(l.shapeFlag&32){const h=n._;h?s&&h===1?u=!1:(lo(a,n),!s&&h===1&&delete a._):(u=!n.$stable,Pv(n,a)),d=n}else n&&(xv(o,n),d={default:1});if(u)for(const h in a)!Dv(h)&&!(h in d)&&delete a[h]};function O0(o,n,s,l,a=!1){if(lt(o)){o.forEach((S,P)=>O0(S,n&&(lt(n)?n[P]:n),s,l,a));return}if(bc(l)&&!a)return;const u=l.shapeFlag&4?cd(l.component)||l.component.proxy:l.el,d=a?null:u,{i:h,r:p}=o,f=n&&n.r,T=h.refs===Kt?h.refs={}:h.refs,C=h.setupState;if(f!=null&&f!==p&&(to(f)?(T[f]=null,Lt(C,f)&&(C[f]=null)):eo(f)&&(f.value=null)),gt(p))ln(p,h,12,[d,T]);else{const S=to(p),P=eo(p);if(S||P){const x=()=>{if(o.f){const G=S?Lt(C,p)?C[p]:T[p]:p.value;a?lt(G)&&U0(G,u):lt(G)?G.includes(u)||G.push(u):S?(T[p]=[u],Lt(C,p)&&(C[p]=T[p])):(p.value=[u],o.k&&(T[o.k]=p.value))}else S?(T[p]=d,Lt(C,p)&&(C[p]=d)):P&&(p.value=d,o.k&&(T[o.k]=d))};d?(x.id=-1,zo(x,s)):x()}}}const zo=ER;function XR(o){return jR(o)}function jR(o,n){const s=$0();s.__VUE__=!0;const{insert:l,remove:a,patchProp:u,createElement:d,createText:h,createComment:p,setText:f,setElementText:T,parentNode:C,nextSibling:S,setScopeId:P=Ls,insertStaticContent:x}=o,G=(I,N,A,K=null,U=null,de=null,Te=!1,se=null,Ce=!!N.dynamicChildren)=>{if(I===N)return;I&&!zn(I,N)&&(K=nt(I),Xe(I,U,de,!0),I=null),N.patchFlag===-2&&(Ce=!1,N.dynamicChildren=null);const{type:ce,ref:Se,shapeFlag:Ne}=N;switch(ce){case nd:oe(I,N,A,K);break;case ns:ne(I,N,A,K);break;case Ru:I==null&&Z(N,A,K,Te);break;case Wt:he(I,N,A,K,U,de,Te,se,Ce);break;default:Ne&1?L(I,N,A,K,U,de,Te,se,Ce):Ne&6?fe(I,N,A,K,U,de,Te,se,Ce):(Ne&64||Ne&128)&&ce.process(I,N,A,K,U,de,Te,se,Ce,et)}Se!=null&&U&&O0(Se,I&&I.ref,de,N||I,!N)},oe=(I,N,A,K)=>{if(I==null)l(N.el=h(N.children),A,K);else{const U=N.el=I.el;N.children!==I.children&&f(U,N.children)}},ne=(I,N,A,K)=>{I==null?l(N.el=p(N.children||""),A,K):N.el=I.el},Z=(I,N,A,K)=>{[I.el,I.anchor]=x(I.children,N,A,K,I.el,I.anchor)},Y=({el:I,anchor:N},A,K)=>{let U;for(;I&&I!==N;)U=S(I),l(I,A,K),I=U;l(N,A,K)},M=({el:I,anchor:N})=>{let A;for(;I&&I!==N;)A=S(I),a(I),I=A;a(N)},L=(I,N,A,K,U,de,Te,se,Ce)=>{Te=Te||N.type==="svg",I==null?R(N,A,K,U,de,Te,se,Ce):X(I,N,U,de,Te,se,Ce)},R=(I,N,A,K,U,de,Te,se)=>{let Ce,ce;const{type:Se,props:Ne,shapeFlag:He,transition:be,dirs:ee}=I;if(Ce=I.el=d(I.type,de,Ne&&Ne.is,Ne),He&8?T(Ce,I.children):He&16&&z(I.children,Ce,null,K,U,de&&Se!=="foreignObject",Te,se),ee&&Un(I,null,K,"created"),F(Ce,I,I.scopeId,Te,K),Ne){for(const ue in Ne)ue!=="value"&&!Su(ue)&&u(Ce,ue,null,Ne[ue],de,I.children,K,U,Ze);"value"in Ne&&u(Ce,"value",null,Ne.value),(ce=Ne.onVnodeBeforeMount)&&qs(ce,K,I)}ee&&Un(I,null,K,"beforeMount");const ie=(!U||U&&!U.pendingBranch)&&be&&!be.persisted;ie&&be.beforeEnter(Ce),l(Ce,N,A),((ce=Ne&&Ne.onVnodeMounted)||ie||ee)&&zo(()=>{ce&&qs(ce,K,I),ie&&be.enter(Ce),ee&&Un(I,null,K,"mounted")},U)},F=(I,N,A,K,U)=>{if(A&&P(I,A),K)for(let de=0;de{for(let ce=Ce;ce{const se=N.el=I.el;let{patchFlag:Ce,dynamicChildren:ce,dirs:Se}=N;Ce|=I.patchFlag&16;const Ne=I.props||Kt,He=N.props||Kt;let be;A&&Hn(A,!1),(be=He.onVnodeBeforeUpdate)&&qs(be,A,N,I),Se&&Un(N,I,A,"beforeUpdate"),A&&Hn(A,!0);const ee=U&&N.type!=="foreignObject";if(ce?le(I.dynamicChildren,ce,se,A,K,ee,de):Te||B(I,N,se,null,A,K,ee,de,!1),Ce>0){if(Ce&16)$e(se,N,Ne,He,A,K,U);else if(Ce&2&&Ne.class!==He.class&&u(se,"class",null,He.class,U),Ce&4&&u(se,"style",Ne.style,He.style,U),Ce&8){const ie=N.dynamicProps;for(let ue=0;ue{be&&qs(be,A,N,I),Se&&Un(N,I,A,"updated")},K)},le=(I,N,A,K,U,de,Te)=>{for(let se=0;se{if(A!==K){if(A!==Kt)for(const se in A)!Su(se)&&!(se in K)&&u(I,se,A[se],null,Te,N.children,U,de,Ze);for(const se in K){if(Su(se))continue;const Ce=K[se],ce=A[se];Ce!==ce&&se!=="value"&&u(I,se,ce,Ce,Te,N.children,U,de,Ze)}"value"in K&&u(I,"value",A.value,K.value)}},he=(I,N,A,K,U,de,Te,se,Ce)=>{const ce=N.el=I?I.el:h(""),Se=N.anchor=I?I.anchor:h("");let{patchFlag:Ne,dynamicChildren:He,slotScopeIds:be}=N;be&&(se=se?se.concat(be):be),I==null?(l(ce,A,K),l(Se,A,K),z(N.children,A,Se,U,de,Te,se,Ce)):Ne>0&&Ne&64&&He&&I.dynamicChildren?(le(I.dynamicChildren,He,A,U,de,Te,se),(N.key!=null||U&&N===U.subTree)&&rg(I,N,!0)):B(I,N,A,Se,U,de,Te,se,Ce)},fe=(I,N,A,K,U,de,Te,se,Ce)=>{N.slotScopeIds=se,I==null?N.shapeFlag&512?U.ctx.activate(N,A,K,Te,Ce):ke(N,A,K,U,de,Te,Ce):re(I,N,Ce)},ke=(I,N,A,K,U,de,Te)=>{const se=I.component=s3(I,K,U);if(od(I)&&(se.ctx.renderer=et),i3(se),se.asyncDep){if(U&&U.registerDep(se,Ie),!I.el){const Ce=se.subTree=Q(ns);ne(null,Ce,N,A)}return}Ie(se,I,N,A,U,de,Te)},re=(I,N,A)=>{const K=N.component=I.component;if(fR(I,N,A))if(K.asyncDep&&!K.asyncResolved){D(K,N,A);return}else K.next=N,dR(K.update),K.update();else N.el=I.el,K.vnode=N},Ie=(I,N,A,K,U,de,Te)=>{const se=()=>{if(I.isMounted){let{next:Se,bu:Ne,u:He,parent:be,vnode:ee}=I,ie=Se,ue;Hn(I,!1),Se?(Se.el=ee.el,D(I,Se,Te)):Se=ee,Ne&&e_(Ne),(ue=Se.props&&Se.props.onVnodeBeforeUpdate)&&qs(ue,be,Se,ee),Hn(I,!0);const ye=t_(I),E=I.subTree;I.subTree=ye,G(E,ye,C(E.el),nt(E),I,U,de),Se.el=ye.el,ie===null&&mR(I,ye.el),He&&zo(He,U),(ue=Se.props&&Se.props.onVnodeUpdated)&&zo(()=>qs(ue,be,Se,ee),U)}else{let Se;const{el:Ne,props:He}=N,{bm:be,m:ee,parent:ie}=I,ue=bc(N);if(Hn(I,!1),be&&e_(be),!ue&&(Se=He&&He.onVnodeBeforeMount)&&qs(Se,ie,N),Hn(I,!0),Ne&&w){const ye=()=>{I.subTree=t_(I),w(Ne,I.subTree,I,U,null)};ue?N.type.__asyncLoader().then(()=>!I.isUnmounted&&ye()):ye()}else{const ye=I.subTree=t_(I);G(null,ye,A,K,I,U,de),N.el=ye.el}if(ee&&zo(ee,U),!ue&&(Se=He&&He.onVnodeMounted)){const ye=N;zo(()=>qs(Se,ie,ye),U)}(N.shapeFlag&256||ie&&bc(ie.vnode)&&ie.vnode.shapeFlag&256)&&I.a&&zo(I.a,U),I.isMounted=!0,N=A=K=null}},Ce=I.effect=new z0(se,()=>Z0(ce),I.scope),ce=I.update=()=>Ce.run();ce.id=I.uid,Hn(I,!0),ce()},D=(I,N,A)=>{N.component=I;const K=I.vnode.props;I.vnode=N,I.next=null,VR(I,N.props,K,A),zR(I,N.children,A),_l(),FE(),gl()},B=(I,N,A,K,U,de,Te,se,Ce=!1)=>{const ce=I&&I.children,Se=I?I.shapeFlag:0,Ne=N.children,{patchFlag:He,shapeFlag:be}=N;if(He>0){if(He&128){_e(ce,Ne,A,K,U,de,Te,se,Ce);return}else if(He&256){ae(ce,Ne,A,K,U,de,Te,se,Ce);return}}be&8?(Se&16&&Ze(ce,U,de),Ne!==ce&&T(A,Ne)):Se&16?be&16?_e(ce,Ne,A,K,U,de,Te,se,Ce):Ze(ce,U,de,!0):(Se&8&&T(A,""),be&16&&z(Ne,A,K,U,de,Te,se,Ce))},ae=(I,N,A,K,U,de,Te,se,Ce)=>{I=I||sl,N=N||sl;const ce=I.length,Se=N.length,Ne=Math.min(ce,Se);let He;for(He=0;HeSe?Ze(I,U,de,!0,!1,Ne):z(N,A,K,U,de,Te,se,Ce,Ne)},_e=(I,N,A,K,U,de,Te,se,Ce)=>{let ce=0;const Se=N.length;let Ne=I.length-1,He=Se-1;for(;ce<=Ne&&ce<=He;){const be=I[ce],ee=N[ce]=Ce?on(N[ce]):Js(N[ce]);if(zn(be,ee))G(be,ee,A,null,U,de,Te,se,Ce);else break;ce++}for(;ce<=Ne&&ce<=He;){const be=I[Ne],ee=N[He]=Ce?on(N[He]):Js(N[He]);if(zn(be,ee))G(be,ee,A,null,U,de,Te,se,Ce);else break;Ne--,He--}if(ce>Ne){if(ce<=He){const be=He+1,ee=beHe)for(;ce<=Ne;)Xe(I[ce],U,de,!0),ce++;else{const be=ce,ee=ce,ie=new Map;for(ce=ee;ce<=He;ce++){const Ee=N[ce]=Ce?on(N[ce]):Js(N[ce]);Ee.key!=null&&ie.set(Ee.key,ce)}let ue,ye=0;const E=He-ee+1;let g=!1,k=0;const W=new Array(E);for(ce=0;ce=E){Xe(Ee,U,de,!0);continue}let ze;if(Ee.key!=null)ze=ie.get(Ee.key);else for(ue=ee;ue<=He;ue++)if(W[ue-ee]===0&&zn(Ee,N[ue])){ze=ue;break}ze===void 0?Xe(Ee,U,de,!0):(W[ze-ee]=ce+1,ze>=k?k=ze:g=!0,G(Ee,N[ze],A,null,U,de,Te,se,Ce),ye++)}const J=g?YR(W):sl;for(ue=J.length-1,ce=E-1;ce>=0;ce--){const Ee=ee+ce,ze=N[Ee],yt=Ee+1{const{el:de,type:Te,transition:se,children:Ce,shapeFlag:ce}=I;if(ce&6){Me(I.component.subTree,N,A,K);return}if(ce&128){I.suspense.move(N,A,K);return}if(ce&64){Te.move(I,N,A,et);return}if(Te===Wt){l(de,N,A);for(let Ne=0;Nese.enter(de),U);else{const{leave:Ne,delayLeave:He,afterLeave:be}=se,ee=()=>l(de,N,A),ie=()=>{Ne(de,()=>{ee(),be&&be()})};He?He(de,ee,ie):ie()}else l(de,N,A)},Xe=(I,N,A,K=!1,U=!1)=>{const{type:de,props:Te,ref:se,children:Ce,dynamicChildren:ce,shapeFlag:Se,patchFlag:Ne,dirs:He}=I;if(se!=null&&O0(se,null,A,I,!0),Se&256){N.ctx.deactivate(I);return}const be=Se&1&&He,ee=!bc(I);let ie;if(ee&&(ie=Te&&Te.onVnodeBeforeUnmount)&&qs(ie,N,I),Se&6)We(I.component,A,K);else{if(Se&128){I.suspense.unmount(A,K);return}be&&Un(I,null,N,"beforeUnmount"),Se&64?I.type.remove(I,N,A,U,et,K):ce&&(de!==Wt||Ne>0&&Ne&64)?Ze(ce,N,A,!1,!0):(de===Wt&&Ne&384||!U&&Se&16)&&Ze(Ce,N,A),K&&Je(I)}(ee&&(ie=Te&&Te.onVnodeUnmounted)||be)&&zo(()=>{ie&&qs(ie,N,I),be&&Un(I,null,N,"unmounted")},A)},Je=I=>{const{type:N,el:A,anchor:K,transition:U}=I;if(N===Wt){we(A,K);return}if(N===Ru){M(I);return}const de=()=>{a(A),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(I.shapeFlag&1&&U&&!U.persisted){const{leave:Te,delayLeave:se}=U,Ce=()=>Te(A,de);se?se(I.el,de,Ce):Ce()}else de()},we=(I,N)=>{let A;for(;I!==N;)A=S(I),a(I),I=A;a(N)},We=(I,N,A)=>{const{bum:K,scope:U,update:de,subTree:Te,um:se}=I;K&&e_(K),U.stop(),de&&(de.active=!1,Xe(Te,I,N,A)),se&&zo(se,N),zo(()=>{I.isUnmounted=!0},N),N&&N.pendingBranch&&!N.isUnmounted&&I.asyncDep&&!I.asyncResolved&&I.suspenseId===N.pendingId&&(N.deps--,N.deps===0&&N.resolve())},Ze=(I,N,A,K=!1,U=!1,de=0)=>{for(let Te=de;TeI.shapeFlag&6?nt(I.component.subTree):I.shapeFlag&128?I.suspense.next():S(I.anchor||I.el),ht=(I,N,A)=>{I==null?N._vnode&&Xe(N._vnode,null,null,!0):G(N._vnode||null,I,N,null,null,null,A),FE(),fv(),N._vnode=I},et={p:G,um:Xe,m:Me,r:Je,mt:ke,mc:z,pc:B,pbc:le,n:nt,o};let xe,w;return n&&([xe,w]=n(et)),{render:ht,hydrate:xe,createApp:FR(ht,xe)}}function Hn({effect:o,update:n},s){o.allowRecurse=n.allowRecurse=s}function rg(o,n,s=!1){const l=o.children,a=n.children;if(lt(l)&<(a))for(let u=0;u>1,o[s[h]]0&&(n[l]=s[u-1]),s[u]=l)}}for(u=s.length,d=s[u-1];u-- >0;)s[u]=d,d=n[d];return s}const KR=o=>o.__isTeleport,Ic=o=>o&&(o.disabled||o.disabled===""),qE=o=>typeof SVGElement<"u"&&o instanceof SVGElement,C0=(o,n)=>{const s=o&&o.to;return to(s)?n?n(s):null:s},QR={__isTeleport:!0,process(o,n,s,l,a,u,d,h,p,f){const{mc:T,pc:C,pbc:S,o:{insert:P,querySelector:x,createText:G,createComment:oe}}=f,ne=Ic(n.props);let{shapeFlag:Z,children:Y,dynamicChildren:M}=n;if(o==null){const L=n.el=G(""),R=n.anchor=G("");P(L,s,l),P(R,s,l);const F=n.target=C0(n.props,x),z=n.targetAnchor=G("");F&&(P(z,F),d=d||qE(F));const X=(le,$e)=>{Z&16&&T(Y,le,$e,a,u,d,h,p)};ne?X(s,R):F&&X(F,z)}else{n.el=o.el;const L=n.anchor=o.anchor,R=n.target=o.target,F=n.targetAnchor=o.targetAnchor,z=Ic(o.props),X=z?s:R,le=z?L:F;if(d=d||qE(R),M?(S(o.dynamicChildren,M,X,a,u,d,h),rg(o,n,!0)):p||C(o,n,X,le,a,u,d,h,!1),ne)z||mu(n,s,L,f,1);else if((n.props&&n.props.to)!==(o.props&&o.props.to)){const $e=n.target=C0(n.props,x);$e&&mu(n,$e,null,f,0)}else z&&mu(n,R,F,f,1)}Bv(n)},remove(o,n,s,l,{um:a,o:{remove:u}},d){const{shapeFlag:h,children:p,anchor:f,targetAnchor:T,target:C,props:S}=o;if(C&&u(T),(d||!Ic(S))&&(u(f),h&16))for(let P=0;P0?ks||sl:null,JR(),Dc>0&&ks&&ks.push(o),o}function Fe(o,n,s,l,a,u){return Fv(Le(o,n,s,l,a,u,!0))}function it(o,n,s,l,a){return Fv(Q(o,n,s,l,a,!0))}function al(o){return o?o.__v_isVNode===!0:!1}function zn(o,n){return o.type===n.type&&o.key===n.key}const rd="__vInternal",Uv=({key:o})=>o??null,ku=({ref:o,ref_key:n,ref_for:s})=>(typeof o=="number"&&(o=""+o),o!=null?to(o)||eo(o)||gt(o)?{i:mo,r:o,k:n,f:!!s}:o:null);function Le(o,n=null,s=null,l=0,a=null,u=o===Wt?0:1,d=!1,h=!1){const p={__v_isVNode:!0,__v_skip:!0,type:o,props:n,key:n&&Uv(n),ref:n&&ku(n),scopeId:Ev,slotScopeIds:null,children:s,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:u,patchFlag:l,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:mo};return h?(cg(p,s),u&128&&o.normalize(p)):s&&(p.shapeFlag|=to(s)?8:16),Dc>0&&!d&&ks&&(p.patchFlag>0||u&6)&&p.patchFlag!==32&&ks.push(p),p}const Q=ZR;function ZR(o,n=null,s=null,l=0,a=null,u=!1){if((!o||o===Sv)&&(o=ns),al(o)){const h=gs(o,n,!0);return s&&cg(h,s),Dc>0&&!u&&ks&&(h.shapeFlag&6?ks[ks.indexOf(o)]=h:ks.push(h)),h.patchFlag|=-2,h}if(a3(o)&&(o=o.__vccOpts),n){n=e3(n);let{class:h,style:p}=n;h&&!to(h)&&(n.class=Pe(h)),Yt(p)&&(av(p)&&!lt(p)&&(p=lo({},p)),n.style=It(p))}const d=to(o)?1:TR(o)?128:KR(o)?64:Yt(o)?4:gt(o)?2:0;return Le(o,n,s,l,a,d,u,!0)}function e3(o){return o?av(o)||rd in o?lo({},o):o:null}function gs(o,n,s=!1){const{props:l,ref:a,patchFlag:u,children:d}=o,h=n?Ot(l||{},n):l;return{__v_isVNode:!0,__v_skip:!0,type:o.type,props:h,key:h&&Uv(h),ref:n&&n.ref?s&&a?lt(a)?a.concat(ku(n)):[a,ku(n)]:ku(n):a,scopeId:o.scopeId,slotScopeIds:o.slotScopeIds,children:d,target:o.target,targetAnchor:o.targetAnchor,staticCount:o.staticCount,shapeFlag:o.shapeFlag,patchFlag:n&&o.type!==Wt?u===-1?16:u|16:u,dynamicProps:o.dynamicProps,dynamicChildren:o.dynamicChildren,appContext:o.appContext,dirs:o.dirs,transition:o.transition,component:o.component,suspense:o.suspense,ssContent:o.ssContent&&gs(o.ssContent),ssFallback:o.ssFallback&&gs(o.ssFallback),el:o.el,anchor:o.anchor,ctx:o.ctx,ce:o.ce}}function Ut(o=" ",n=0){return Q(nd,null,o,n)}function ld(o,n){const s=Q(Ru,null,o);return s.staticCount=n,s}function ut(o="",n=!1){return n?(me(),it(ns,null,o)):Q(ns,null,o)}function Js(o){return o==null||typeof o=="boolean"?Q(ns):lt(o)?Q(Wt,null,o.slice()):typeof o=="object"?on(o):Q(nd,null,String(o))}function on(o){return o.el===null&&o.patchFlag!==-1||o.memo?o:gs(o)}function cg(o,n){let s=0;const{shapeFlag:l}=o;if(n==null)n=null;else if(lt(n))s=16;else if(typeof n=="object")if(l&65){const a=n.default;a&&(a._c&&(a._d=!1),cg(o,a()),a._c&&(a._d=!0));return}else{s=32;const a=n._;!a&&!(rd in n)?n._ctx=mo:a===3&&mo&&(mo.slots._===1?n._=1:(n._=2,o.patchFlag|=1024))}else gt(n)?(n={default:n,_ctx:mo},s=32):(n=String(n),l&64?(s=16,n=[Ut(n)]):s=8);o.children=n,o.shapeFlag|=s}function Ot(...o){const n={};for(let s=0;s_o||mo;let ag,el,ZE="__VUE_INSTANCE_SETTERS__";(el=$0()[ZE])||(el=$0()[ZE]=[]),el.push(o=>_o=o),ag=o=>{el.length>1?el.forEach(n=>n(o)):el[0](o)};const ul=o=>{ag(o),o.scope.on()},Qn=()=>{_o&&_o.scope.off(),ag(null)};function Hv(o){return o.vnode.shapeFlag&4}let Pc=!1;function i3(o,n=!1){Pc=n;const{props:s,children:l}=o.vnode,a=Hv(o);HR(o,s,a,n),WR(o,l);const u=a?n3(o,n):void 0;return Pc=!1,u}function n3(o,n){const s=o.type;o.accessCache=Object.create(null),o.proxy=Zu(new Proxy(o.ctx,NR));const{setup:l}=s;if(l){const a=o.setupContext=l.length>1?l3(o):null;ul(o),_l();const u=ln(l,o,0,[o.props,a]);if(gl(),Qn(),zb(u)){if(u.then(Qn,Qn),n)return u.then(d=>{e1(o,d,n)}).catch(d=>{ed(d,o,0)});o.asyncDep=u}else e1(o,u,n)}else Vv(o,n)}function e1(o,n,s){gt(n)?o.type.__ssrInlineRender?o.ssrRender=n:o.render=n:Yt(n)&&(o.setupState=pv(n)),Vv(o,s)}let t1;function Vv(o,n,s){const l=o.type;if(!o.render){if(!n&&t1&&!l.render){const a=l.template||ig(o).template;if(a){const{isCustomElement:u,compilerOptions:d}=o.appContext.config,{delimiters:h,compilerOptions:p}=l,f=lo(lo({isCustomElement:u,delimiters:h},d),p);l.render=t1(a,f)}}o.render=l.render||Ls}ul(o),_l(),wR(o),gl(),Qn()}function r3(o){return o.attrsProxy||(o.attrsProxy=new Proxy(o.attrs,{get(n,s){return Ko(o,"get","$attrs"),n[s]}}))}function l3(o){const n=s=>{o.exposed=s||{}};return{get attrs(){return r3(o)},slots:o.slots,emit:o.emit,expose:n}}function cd(o){if(o.exposed)return o.exposeProxy||(o.exposeProxy=new Proxy(pv(Zu(o.exposed)),{get(n,s){if(s in n)return n[s];if(s in vc)return vc[s](o)},has(n,s){return s in n||s in vc}}))}function c3(o,n=!0){return gt(o)?o.displayName||o.name:o.name||n&&o.__name}function a3(o){return gt(o)&&"__vccOpts"in o}const j=(o,n)=>cR(o,n,Pc);function Zs(o,n,s){const l=arguments.length;return l===2?Yt(n)&&!lt(n)?al(n)?Q(o,null,[n]):Q(o,n):Q(o,null,n):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&al(s)&&(s=[s]),Q(o,n,s))}const u3=Symbol.for("v-scx"),d3=()=>ho(u3),h3="3.3.4",p3="http://www.w3.org/2000/svg",Xn=typeof document<"u"?document:null,o1=Xn&&Xn.createElement("template"),$3={insert:(o,n,s)=>{n.insertBefore(o,s||null)},remove:o=>{const n=o.parentNode;n&&n.removeChild(o)},createElement:(o,n,s,l)=>{const a=n?Xn.createElementNS(p3,o):Xn.createElement(o,s?{is:s}:void 0);return o==="select"&&l&&l.multiple!=null&&a.setAttribute("multiple",l.multiple),a},createText:o=>Xn.createTextNode(o),createComment:o=>Xn.createComment(o),setText:(o,n)=>{o.nodeValue=n},setElementText:(o,n)=>{o.textContent=n},parentNode:o=>o.parentNode,nextSibling:o=>o.nextSibling,querySelector:o=>Xn.querySelector(o),setScopeId(o,n){o.setAttribute(n,"")},insertStaticContent(o,n,s,l,a,u){const d=s?s.previousSibling:n.lastChild;if(a&&(a===u||a.nextSibling))for(;n.insertBefore(a.cloneNode(!0),s),!(a===u||!(a=a.nextSibling)););else{o1.innerHTML=l?`${o}`:o;const h=o1.content;if(l){const p=h.firstChild;for(;p.firstChild;)h.appendChild(p.firstChild);h.removeChild(p)}n.insertBefore(h,s)}return[d?d.nextSibling:n.firstChild,s?s.previousSibling:n.lastChild]}};function _3(o,n,s){const l=o._vtc;l&&(n=(n?[n,...l]:[...l]).join(" ")),n==null?o.removeAttribute("class"):s?o.setAttribute("class",n):o.className=n}function g3(o,n,s){const l=o.style,a=to(s);if(s&&!a){if(n&&!to(n))for(const u in n)s[u]==null&&y0(l,u,"");for(const u in s)y0(l,u,s[u])}else{const u=l.display;a?n!==s&&(l.cssText=s):n&&o.removeAttribute("style"),"_vod"in o&&(l.display=u)}}const s1=/\s*!important$/;function y0(o,n,s){if(lt(s))s.forEach(l=>y0(o,n,l));else if(s==null&&(s=""),n.startsWith("--"))o.setProperty(n,s);else{const l=f3(o,n);s1.test(s)?o.setProperty($l(l),s.replace(s1,""),"important"):o[l]=s}}const i1=["Webkit","Moz","ms"],i_={};function f3(o,n){const s=i_[n];if(s)return s;let l=ti(n);if(l!=="filter"&&l in o)return i_[n]=l;l=qu(l);for(let a=0;an_||(O3.then(()=>n_=0),n_=Date.now());function y3(o,n){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;_s(S3(l,s.value),n,5,[l])};return s.value=o,s.attached=C3(),s}function S3(o,n){if(lt(n)){const s=o.stopImmediatePropagation;return o.stopImmediatePropagation=()=>{s.call(o),o._stopped=!0},n.map(l=>a=>!a._stopped&&l&&l(a))}else return n}const l1=/^on[a-z]/,R3=(o,n,s,l,a=!1,u,d,h,p)=>{n==="class"?_3(o,l,a):n==="style"?g3(o,s,l):Yu(n)?F0(n)||v3(o,n,s,l,d):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):k3(o,n,l,a))?T3(o,n,l,u,d,h,p):(n==="true-value"?o._trueValue=l:n==="false-value"&&(o._falseValue=l),m3(o,n,l,a))};function k3(o,n,s,l){return l?!!(n==="innerHTML"||n==="textContent"||n in o&&l1.test(n)&>(s)):n==="spellcheck"||n==="draggable"||n==="translate"||n==="form"||n==="list"&&o.tagName==="INPUT"||n==="type"&&o.tagName==="TEXTAREA"||l1.test(n)&&to(s)?!1:n in o}const Ji="transition",$c="animation",un=(o,{slots:n})=>Zs(IR,Wv(o),n);un.displayName="Transition";const Gv={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},A3=un.props=lo({},Iv,Gv),Vn=(o,n=[])=>{lt(o)?o.forEach(s=>s(...n)):o&&o(...n)},c1=o=>o?lt(o)?o.some(n=>n.length>1):o.length>1:!1;function Wv(o){const n={};for(const he in o)he in Gv||(n[he]=o[he]);if(o.css===!1)return n;const{name:s="v",type:l,duration:a,enterFromClass:u=`${s}-enter-from`,enterActiveClass:d=`${s}-enter-active`,enterToClass:h=`${s}-enter-to`,appearFromClass:p=u,appearActiveClass:f=d,appearToClass:T=h,leaveFromClass:C=`${s}-leave-from`,leaveActiveClass:S=`${s}-leave-active`,leaveToClass:P=`${s}-leave-to`}=o,x=L3(a),G=x&&x[0],oe=x&&x[1],{onBeforeEnter:ne,onEnter:Z,onEnterCancelled:Y,onLeave:M,onLeaveCancelled:L,onBeforeAppear:R=ne,onAppear:F=Z,onAppearCancelled:z=Y}=n,X=(he,fe,ke)=>{Zi(he,fe?T:h),Zi(he,fe?f:d),ke&&ke()},le=(he,fe)=>{he._isLeaving=!1,Zi(he,C),Zi(he,P),Zi(he,S),fe&&fe()},$e=he=>(fe,ke)=>{const re=he?F:Z,Ie=()=>X(fe,he,ke);Vn(re,[fe,Ie]),a1(()=>{Zi(fe,he?p:u),Ii(fe,he?T:h),c1(re)||u1(fe,l,G,Ie)})};return lo(n,{onBeforeEnter(he){Vn(ne,[he]),Ii(he,u),Ii(he,d)},onBeforeAppear(he){Vn(R,[he]),Ii(he,p),Ii(he,f)},onEnter:$e(!1),onAppear:$e(!0),onLeave(he,fe){he._isLeaving=!0;const ke=()=>le(he,fe);Ii(he,C),Xv(),Ii(he,S),a1(()=>{he._isLeaving&&(Zi(he,C),Ii(he,P),c1(M)||u1(he,l,oe,ke))}),Vn(M,[he,ke])},onEnterCancelled(he){X(he,!1),Vn(Y,[he])},onAppearCancelled(he){X(he,!0),Vn(z,[he])},onLeaveCancelled(he){le(he),Vn(L,[he])}})}function L3(o){if(o==null)return null;if(Yt(o))return[r_(o.enter),r_(o.leave)];{const n=r_(o);return[n,n]}}function r_(o){return E9(o)}function Ii(o,n){n.split(/\s+/).forEach(s=>s&&o.classList.add(s)),(o._vtc||(o._vtc=new Set)).add(n)}function Zi(o,n){n.split(/\s+/).forEach(l=>l&&o.classList.remove(l));const{_vtc:s}=o;s&&(s.delete(n),s.size||(o._vtc=void 0))}function a1(o){requestAnimationFrame(()=>{requestAnimationFrame(o)})}let N3=0;function u1(o,n,s,l){const a=o._endId=++N3,u=()=>{a===o._endId&&l()};if(s)return setTimeout(u,s);const{type:d,timeout:h,propCount:p}=zv(o,n);if(!d)return l();const f=d+"end";let T=0;const C=()=>{o.removeEventListener(f,S),u()},S=P=>{P.target===o&&++T>=p&&C()};setTimeout(()=>{T(s[x]||"").split(", "),a=l(`${Ji}Delay`),u=l(`${Ji}Duration`),d=d1(a,u),h=l(`${$c}Delay`),p=l(`${$c}Duration`),f=d1(h,p);let T=null,C=0,S=0;n===Ji?d>0&&(T=Ji,C=d,S=u.length):n===$c?f>0&&(T=$c,C=f,S=p.length):(C=Math.max(d,f),T=C>0?d>f?Ji:$c:null,S=T?T===Ji?u.length:p.length:0);const P=T===Ji&&/\b(transform|all)(,|$)/.test(l(`${Ji}Property`).toString());return{type:T,timeout:C,propCount:S,hasTransform:P}}function d1(o,n){for(;o.lengthh1(s)+h1(o[l])))}function h1(o){return Number(o.slice(0,-1).replace(",","."))*1e3}function Xv(){return document.body.offsetHeight}const jv=new WeakMap,Yv=new WeakMap,Kv={name:"TransitionGroup",props:lo({},A3,{tag:String,moveClass:String}),setup(o,{slots:n}){const s=ml(),l=vv();let a,u;return fl(()=>{if(!a.length)return;const d=o.moveClass||`${o.name||"v"}-move`;if(!B3(a[0].el,s.vnode.el,d))return;a.forEach(D3),a.forEach(P3);const h=a.filter(x3);Xv(),h.forEach(p=>{const f=p.el,T=f.style;Ii(f,d),T.transform=T.webkitTransform=T.transitionDuration="";const C=f._moveCb=S=>{S&&S.target!==f||(!S||/transform$/.test(S.propertyName))&&(f.removeEventListener("transitionend",C),f._moveCb=null,Zi(f,d))};f.addEventListener("transitionend",C)})}),()=>{const d=Ct(o),h=Wv(d);let p=d.tag||Wt;a=u,u=n.default?og(n.default()):[];for(let f=0;fdelete o.mode;Kv.props;const M3=Kv;function D3(o){const n=o.el;n._moveCb&&n._moveCb(),n._enterCb&&n._enterCb()}function P3(o){Yv.set(o,o.el.getBoundingClientRect())}function x3(o){const n=jv.get(o),s=Yv.get(o),l=n.left-s.left,a=n.top-s.top;if(l||a){const u=o.el.style;return u.transform=u.webkitTransform=`translate(${l}px,${a}px)`,u.transitionDuration="0s",o}}function B3(o,n,s){const l=o.cloneNode();o._vtc&&o._vtc.forEach(d=>{d.split(/\s+/).forEach(h=>h&&l.classList.remove(h))}),s.split(/\s+/).forEach(d=>d&&l.classList.add(d)),l.style.display="none";const a=n.nodeType===1?n:n.parentNode;a.appendChild(l);const{hasTransform:u}=zv(l);return a.removeChild(l),u}const F3=["ctrl","shift","alt","meta"],U3={stop:o=>o.stopPropagation(),prevent:o=>o.preventDefault(),self:o=>o.target!==o.currentTarget,ctrl:o=>!o.ctrlKey,shift:o=>!o.shiftKey,alt:o=>!o.altKey,meta:o=>!o.metaKey,left:o=>"button"in o&&o.button!==0,middle:o=>"button"in o&&o.button!==1,right:o=>"button"in o&&o.button!==2,exact:(o,n)=>F3.some(s=>o[`${s}Key`]&&!n.includes(s))},er=(o,n)=>(s,...l)=>{for(let a=0;a{_c(o,!1)}):_c(o,n))},beforeUnmount(o,{value:n}){_c(o,n)}};function _c(o,n){o.style.display=n?o._vod:"none"}const H3=lo({patchProp:R3},$3);let p1;function Qv(){return p1||(p1=XR(H3))}const $1=(...o)=>{Qv().render(...o)},V3=(...o)=>{const n=Qv().createApp(...o),{mount:s}=n;return n.mount=l=>{const a=G3(l);if(!a)return;const u=n._component;!gt(u)&&!u.render&&!u.template&&(u.template=a.innerHTML),a.innerHTML="";const d=s(a,!1,a instanceof SVGElement);return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),d},n};function G3(o){return to(o)?document.querySelector(o):o}const or=Object.prototype.toString;function jo(o){return or.call(o)==="[object Array]"}function Tl(o){return or.call(o)==="[object Null]"}function S0(o){return or.call(o)==="[object Boolean]"}function ko(o){return or.call(o)==="[object Object]"}const _1=o=>or.call(o)==="[object Promise]";function ki(o){return or.call(o)==="[object String]"}function vt(o){return or.call(o)==="[object Number]"&&o===o}function rs(o){return o===void 0}function bo(o){return typeof o=="function"}function W3(o){return ko(o)&&Object.keys(o).length===0}const qv=o=>(o==null?void 0:o.$)!==void 0,sr=Symbol("ArcoConfigProvider"),Tu={formatYear:"YYYY 年",formatMonth:"YYYY 年 MM 月",today:"今天",view:{month:"月",year:"年",week:"周",day:"日"},month:{long:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"},short:{January:"一月",February:"二月",March:"三月",April:"四月",May:"五月",June:"六月",July:"七月",August:"八月",September:"九月",October:"十月",November:"十一月",December:"十二月"}},week:{long:{self:"周",monday:"周一",tuesday:"周二",wednesday:"周三",thursday:"周四",friday:"周五",saturday:"周六",sunday:"周日"},short:{self:"周",monday:"一",tuesday:"二",wednesday:"三",thursday:"四",friday:"五",saturday:"六",sunday:"日"}}},z3={locale:"zh-CN",empty:{description:"暂无数据"},drawer:{okText:"确定",cancelText:"取消"},popconfirm:{okText:"确定",cancelText:"取消"},modal:{okText:"确定",cancelText:"取消"},pagination:{goto:"前往",page:"页",countPerPage:"条/页",total:"共 {0} 条"},table:{okText:"确定",resetText:"重置"},upload:{start:"开始",cancel:"取消",delete:"删除",retry:"点击重试",buttonText:"点击上传",preview:"预览",drag:"点击或拖拽文件到此处上传",dragHover:"释放文件并开始上传",error:"上传失败"},calendar:Tu,datePicker:{view:Tu.view,month:Tu.month,week:Tu.week,placeholder:{date:"请选择日期",week:"请选择周",month:"请选择月份",year:"请选择年份",quarter:"请选择季度",time:"请选择时间"},rangePlaceholder:{date:["开始日期","结束日期"],week:["开始周","结束周"],month:["开始月份","结束月份"],year:["开始年份","结束年份"],quarter:["开始季度","结束季度"],time:["开始时间","结束时间"]},selectTime:"选择时间",today:"今天",now:"此刻",ok:"确定"},image:{loading:"加载中"},imagePreview:{fullScreen:"全屏",rotateRight:"向右旋转",rotateLeft:"向左旋转",zoomIn:"放大",zoomOut:"缩小",originalSize:"原始尺寸"},typography:{copied:"已复制",copy:"复制",expand:"展开",collapse:"折叠",edit:"编辑"},form:{validateMessages:{required:"#{field} 是必填项",type:{string:"#{field} 不是合法的文本类型",number:"#{field} 不是合法的数字类型",boolean:"#{field} 不是合法的布尔类型",array:"#{field} 不是合法的数组类型",object:"#{field} 不是合法的对象类型",url:"#{field} 不是合法的 url 地址",email:"#{field} 不是合法的邮箱地址",ip:"#{field} 不是合法的 IP 地址"},number:{min:"`#{value}` 小于最小值 `#{min}`",max:"`#{value}` 大于最大值 `#{max}`",equal:"`#{value}` 不等于 `#{equal}`",range:"`#{value}` 不在 `#{min} ~ #{max}` 范围内",positive:"`#{value}` 不是正数",negative:"`#{value}` 不是负数"},array:{length:"`#{field}` 个数不等于 #{length}",minLength:"`#{field}` 个数最少为 #{minLength}",maxLength:"`#{field}` 个数最多为 #{maxLength}",includes:"#{field} 不包含 #{includes}",deepEqual:"#{field} 不等于 #{deepEqual}",empty:"`#{field}` 不是空数组"},string:{minLength:"字符数最少为 #{minLength}",maxLength:"字符数最多为 #{maxLength}",length:"字符数必须是 #{length}",match:"`#{value}` 不符合模式 #{pattern}",uppercase:"`#{value}` 必须全大写",lowercase:"`#{value}` 必须全小写"},object:{deepEqual:"`#{field}` 不等于期望值",hasKeys:"`#{field}` 不包含必须字段",empty:"`#{field}` 不是对象"},boolean:{true:"期望是 `true`",false:"期望是 `false`"}}}},X3=ge("zh-CN"),j3=Jt({"zh-CN":z3}),ug=()=>{const o=ho(sr,void 0),n=j(()=>{var a;return(a=o==null?void 0:o.locale)!=null?a:j3[X3.value]}),s=j(()=>n.value.locale);return{i18nMessage:n,locale:s,t:(a,...u)=>{const d=a.split(".");let h=n.value;for(const p of d){if(!h[p])return a;h=h[p]}return ki(h)&&u.length>0?h.replace(/{(\d+)}/g,(p,f)=>{var T;return(T=u[f])!=null?T:p}):h}}};var Y3=Object.defineProperty,K3=Object.defineProperties,Q3=Object.getOwnPropertyDescriptors,g1=Object.getOwnPropertySymbols,q3=Object.prototype.hasOwnProperty,J3=Object.prototype.propertyIsEnumerable,f1=(o,n,s)=>n in o?Y3(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Z3=(o,n)=>{for(var s in n||(n={}))q3.call(n,s)&&f1(o,s,n[s]);if(g1)for(var s of g1(n))J3.call(n,s)&&f1(o,s,n[s]);return o},ek=(o,n)=>K3(o,Q3(n));const tk="A",ok="arco",R0="$arco",Oo=o=>{var n;return(n=o==null?void 0:o.componentPrefix)!=null?n:tk},Co=(o,n)=>{var s;n&&n.classPrefix&&(o.config.globalProperties[R0]=ek(Z3({},(s=o.config.globalProperties[R0])!=null?s:{}),{classPrefix:n.classPrefix}))},ot=o=>{var n,s,l;const a=ml(),u=ho(sr,void 0),d=(l=(s=u==null?void 0:u.prefixCls)!=null?s:(n=a==null?void 0:a.appContext.config.globalProperties[R0])==null?void 0:n.classPrefix)!=null?l:ok;return o?`${d}-${o}`:d};var Jv=function(){if(typeof Map<"u")return Map;function o(n,s){var l=-1;return n.some(function(a,u){return a[0]===s?(l=u,!0):!1}),l}return function(){function n(){this.__entries__=[]}return Object.defineProperty(n.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),n.prototype.get=function(s){var l=o(this.__entries__,s),a=this.__entries__[l];return a&&a[1]},n.prototype.set=function(s,l){var a=o(this.__entries__,s);~a?this.__entries__[a][1]=l:this.__entries__.push([s,l])},n.prototype.delete=function(s){var l=this.__entries__,a=o(l,s);~a&&l.splice(a,1)},n.prototype.has=function(s){return!!~o(this.__entries__,s)},n.prototype.clear=function(){this.__entries__.splice(0)},n.prototype.forEach=function(s,l){l===void 0&&(l=null);for(var a=0,u=this.__entries__;a0},o.prototype.connect_=function(){!k0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ck?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},o.prototype.disconnect_=function(){!k0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},o.prototype.onTransitionEnd_=function(n){var s=n.propertyName,l=s===void 0?"":s,a=lk.some(function(u){return!!~l.indexOf(u)});a&&this.refresh()},o.getInstance=function(){return this.instance_||(this.instance_=new o),this.instance_},o.instance_=null,o}(),Zv=function(o,n){for(var s=0,l=Object.keys(n);s"u"||!(Element instanceof Object))){if(!(n instanceof dl(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(n)||(s.set(n,new fk(n)),this.controller_.addObserver(this),this.controller_.refresh())}},o.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(n instanceof dl(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var s=this.observations_;s.has(n)&&(s.delete(n),s.size||this.controller_.removeObserver(this))}},o.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},o.prototype.gatherActive=function(){var n=this;this.clearActive(),this.observations_.forEach(function(s){s.isActive()&&n.activeObservations_.push(s)})},o.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,s=this.activeObservations_.map(function(l){return new mk(l.target,l.broadcastRect())});this.callback_.call(n,s,n),this.clearActive()}},o.prototype.clearActive=function(){this.activeObservations_.splice(0)},o.prototype.hasActive=function(){return this.activeObservations_.length>0},o}(),tI=typeof WeakMap<"u"?new WeakMap:new Jv,oI=function(){function o(n){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var s=ak.getInstance(),l=new Tk(n,s,this);tI.set(this,l)}return o}();["observe","unobserve","disconnect"].forEach(function(o){oI.prototype[o]=function(){var n;return(n=tI.get(this))[o].apply(n,arguments)}});var dg=function(){return typeof Gu.ResizeObserver<"u"?Gu.ResizeObserver:oI}(),T1;(function(o){o[o.ELEMENT=1]="ELEMENT",o[o.FUNCTIONAL_COMPONENT=2]="FUNCTIONAL_COMPONENT",o[o.STATEFUL_COMPONENT=4]="STATEFUL_COMPONENT",o[o.COMPONENT=6]="COMPONENT",o[o.TEXT_CHILDREN=8]="TEXT_CHILDREN",o[o.ARRAY_CHILDREN=16]="ARRAY_CHILDREN",o[o.SLOTS_CHILDREN=32]="SLOTS_CHILDREN",o[o.TELEPORT=64]="TELEPORT",o[o.SUSPENSE=128]="SUSPENSE",o[o.COMPONENT_SHOULD_KEEP_ALIVE=256]="COMPONENT_SHOULD_KEEP_ALIVE",o[o.COMPONENT_KEPT_ALIVE=512]="COMPONENT_KEPT_ALIVE"})(T1||(T1={}));var E1;(function(o){o[o.TEXT=1]="TEXT",o[o.CLASS=2]="CLASS",o[o.STYLE=4]="STYLE",o[o.PROPS=8]="PROPS",o[o.FULL_PROPS=16]="FULL_PROPS",o[o.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",o[o.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",o[o.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",o[o.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",o[o.NEED_PATCH=512]="NEED_PATCH",o[o.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",o[o.DEV_ROOT_FRAGMENT=2048]="DEV_ROOT_FRAGMENT",o[o.HOISTED=-1]="HOISTED",o[o.BAIL=-2]="BAIL"})(E1||(E1={}));const ud=o=>!!(o&&o.shapeFlag&1),dd=(o,n)=>!!(o&&o.shapeFlag&6),Ek=(o,n)=>!!(o&&o.shapeFlag&8),hg=(o,n)=>!!(o&&o.shapeFlag&16),sI=(o,n)=>!!(o&&o.shapeFlag&32),rl=o=>{var n,s;if(o)for(const l of o){if(ud(l)||dd(l))return l;if(hg(l,l.children)){const a=rl(l.children);if(a)return a}else if(sI(l,l.children)){const a=(s=(n=l.children).default)==null?void 0:s.call(n);if(a){const u=rl(a);if(u)return u}}else if(jo(l)){const a=rl(l);if(a)return a}}},bk=o=>{if(!o)return!0;for(const n of o)if(n.children)return!1;return!0},iI=(o,n)=>{if(o&&o.length>0)for(let s=0;s0&&iI(a,n))return!0}return!1},nI=o=>{if(hg(o,o.children))return o.children;if(jo(o))return o},rI=o=>{var n,s;if(ud(o))return o.el;if(dd(o)){if(((n=o.el)==null?void 0:n.nodeType)===1)return o.el;if((s=o.component)!=null&&s.subTree){const l=rI(o.component.subTree);if(l)return l}}else{const l=nI(o);return lI(l)}},lI=o=>{if(o&&o.length>0)for(const n of o){const s=rI(n);if(s)return s}},Au=(o,n=!1)=>{var s,l;const a=[];for(const u of o??[])ud(u)||dd(u)||n&&Ek(u,u.children)?a.push(u):hg(u,u.children)?a.push(...Au(u.children,n)):sI(u,u.children)?a.push(...Au((l=(s=u.children).default)==null?void 0:l.call(s),n)):jo(u)&&a.push(...Au(u,n));return a},l_=o=>{if(o)return bo(o)?o:()=>o};var cI=Ke({name:"ResizeObserver",emits:["resize"],setup(o,{emit:n,slots:s}){let l;const a=ge(),u=j(()=>qv(a.value)?a.value.$el:a.value),d=p=>{p&&(l=new dg(f=>{const T=f[0];n("resize",T)}),l.observe(p))},h=()=>{l&&(l.disconnect(),l=null)};return Et(u,p=>{l&&h(),p&&d(p)}),zt(()=>{u.value&&d(u.value)}),Uc(()=>{h()}),()=>{var p,f;const T=rl((f=(p=s.default)==null?void 0:p.call(s))!=null?f:[]);return T?gs(T,{ref:a},!0):null}}});const aI=typeof window>"u"?global:window,vk=aI.requestAnimationFrame,b1=aI.cancelAnimationFrame;function A0(o){let n=0;const s=(...l)=>{n&&b1(n),n=vk(()=>{o(...l),n=0})};return s.cancel=()=>{b1(n),n=0},s}const pg=()=>{},uI=()=>{const{body:o}=document,n=document.documentElement;let s;try{s=(window.top||window.self||window).document.body}catch{}return{height:Math.max(o.scrollHeight,o.offsetHeight,n.clientHeight,n.scrollHeight,n.offsetHeight,(s==null?void 0:s.scrollHeight)||0,(s==null?void 0:s.clientHeight)||0),width:Math.max(o.scrollWidth,o.offsetWidth,n.clientWidth,n.scrollWidth,n.offsetWidth,(s==null?void 0:s.scrollWidth)||0,(s==null?void 0:s.clientWidth)||0)}},$g=(()=>{try{return!(typeof window<"u"&&document!==void 0)}catch{return!0}})(),vo=(()=>$g?pg:(o,n,s,l=!1)=>{o.addEventListener(n,s,l)})(),Yo=(()=>$g?pg:(o,n,s,l=!1)=>{o.removeEventListener(n,s,l)})(),Ik=(o,n)=>{if(!o||!n)return!1;let s=n;for(;s;){if(s===o)return!0;s=s.parentNode}return!1},Ok=o=>{const n=document.createElement("div");return n.setAttribute("class",`arco-overlay arco-overlay-${o}`),n},dI=(o,n)=>{var s;return $g?pg():(s=(n??document).querySelector(o))!=null?s:void 0},L0=(o,n)=>{if(ki(o)){const s=o[0]==="#"?`[id='${o.slice(1)}']`:o;return dI(s,n)}return o},Ck=(o,n)=>{const s=o.getBoundingClientRect(),l=n.getBoundingClientRect();return{top:s.top-l.top,bottom:l.bottom-s.bottom,left:s.left-l.left,right:l.right-s.right,width:s.width,height:s.height}},yk=o=>o.tagName==="BODY"?document.documentElement.scrollHeight>window.innerHeight:o.scrollHeight>o.offsetHeight,Sk=o=>o.tagName==="BODY"?window.innerWidth-uI().width:o.offsetWidth-o.clientWidth;var dt=(o,n)=>{for(const[s,l]of n)o[s]=l;return o};const Rk=Ke({name:"IconHover",props:{prefix:{type:String},size:{type:String,default:"medium"},disabled:{type:Boolean,default:!1}},setup(){return{prefixCls:ot("icon-hover")}}});function kk(o,n,s,l,a,u){return me(),Fe("span",{class:Pe([o.prefixCls,{[`${o.prefix}-icon-hover`]:o.prefix,[`${o.prefixCls}-size-${o.size}`]:o.size!=="medium",[`${o.prefixCls}-disabled`]:o.disabled}])},[ct(o.$slots,"default")],2)}var oi=dt(Rk,[["render",kk]]);const Ak=Ke({name:"IconClose",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-close`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Lk=["stroke-width","stroke-linecap","stroke-linejoin"],Nk=Le("path",{d:"M9.857 9.858 24 24m0 0 14.142 14.142M24 24 38.142 9.858M24 24 9.857 38.142"},null,-1),wk=[Nk];function Mk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},wk,14,Lk)}var c_=dt(Ak,[["render",Mk]]);const El=Object.assign(c_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+c_.name,c_)}}),Dk=Ke({name:"IconInfoCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-info-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Pk=["stroke-width","stroke-linecap","stroke-linejoin"],xk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm2-30a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2Zm0 17h1a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-6a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h1v-8a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v11Z",fill:"currentColor",stroke:"none"},null,-1),Bk=[xk];function Fk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Bk,14,Pk)}var a_=dt(Dk,[["render",Fk]]);const Uk=Object.assign(a_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+a_.name,a_)}}),Hk=Ke({name:"IconCheckCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-check-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Vk=["stroke-width","stroke-linecap","stroke-linejoin"],Gk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm10.207-24.379a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0L22 26.172l-4.878-4.88a1 1 0 0 0-1.415 0l-1.414 1.415a1 1 0 0 0 0 1.414l7 7a1 1 0 0 0 1.414 0l11.5-11.5Z",fill:"currentColor",stroke:"none"},null,-1),Wk=[Gk];function zk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Wk,14,Vk)}var u_=dt(Hk,[["render",zk]]);const hI=Object.assign(u_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+u_.name,u_)}}),Xk=Ke({name:"IconExclamationCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-exclamation-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),jk=["stroke-width","stroke-linecap","stroke-linejoin"],Yk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm-2-11a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v2Zm4-18a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V15Z",fill:"currentColor",stroke:"none"},null,-1),Kk=[Yk];function Qk(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Kk,14,jk)}var d_=dt(Xk,[["render",Qk]]);const pI=Object.assign(d_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+d_.name,d_)}}),qk=Ke({name:"IconCloseCircleFill",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-close-circle-fill`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Jk=["stroke-width","stroke-linecap","stroke-linejoin"],Zk=Le("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M24 44c11.046 0 20-8.954 20-20S35.046 4 24 4 4 12.954 4 24s8.954 20 20 20Zm4.955-27.771-4.95 4.95-4.95-4.95a1 1 0 0 0-1.414 0l-1.414 1.414a1 1 0 0 0 0 1.414l4.95 4.95-4.95 4.95a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0l4.95-4.95 4.95 4.95a1 1 0 0 0 1.414 0l1.414-1.414a1 1 0 0 0 0-1.414l-4.95-4.95 4.95-4.95a1 1 0 0 0 0-1.414l-1.414-1.414a1 1 0 0 0-1.414 0Z",fill:"currentColor",stroke:"none"},null,-1),eA=[Zk];function tA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},eA,14,Jk)}var h_=dt(qk,[["render",tA]]);const $I=Object.assign(h_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+h_.name,h_)}}),oA=["info","success","warning","error"],hl=["onFocus","onFocusin","onFocusout","onBlur","onChange","onBeforeinput","onInput","onReset","onSubmit","onInvalid","onKeydown","onKeypress","onKeyup","onCopy","onCut","onPaste","onCompositionstart","onCompositionupdate","onCompositionend","onSelect","autocomplete","autofocus","maxlength","minlength","name","pattern","readonly","required"],sA=Ke({name:"IconLoading",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-loading`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),iA=["stroke-width","stroke-linecap","stroke-linejoin"],nA=Le("path",{d:"M42 24c0 9.941-8.059 18-18 18S6 33.941 6 24 14.059 6 24 6"},null,-1),rA=[nA];function lA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},rA,14,iA)}var p_=dt(sA,[["render",lA]]);const ir=Object.assign(p_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+p_.name,p_)}}),cA=Ke({name:"FeedbackIcon",components:{IconLoading:ir,IconCheckCircleFill:hI,IconExclamationCircleFill:pI,IconCloseCircleFill:$I},props:{type:{type:String}},setup(o){const n=ot("feedback-icon");return{cls:j(()=>[n,`${n}-status-${o.type}`])}}});function aA(o,n,s,l,a,u){const d=_t("icon-loading"),h=_t("icon-check-circle-fill"),p=_t("icon-exclamation-circle-fill"),f=_t("icon-close-circle-fill");return me(),Fe("span",{class:Pe(o.cls)},[o.type==="validating"?(me(),it(d,{key:0})):o.type==="success"?(me(),it(h,{key:1})):o.type==="warning"?(me(),it(p,{key:2})):o.type==="error"?(me(),it(f,{key:3})):ut("v-if",!0)],2)}var _g=dt(cA,[["render",aA]]);const gg={key:"Enter",code:"Enter"},uA={key:"Backspace",code:"Backspace"};var dA=Object.defineProperty,v1=Object.getOwnPropertySymbols,hA=Object.prototype.hasOwnProperty,pA=Object.prototype.propertyIsEnumerable,I1=(o,n,s)=>n in o?dA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,$A=(o,n)=>{for(var s in n||(n={}))hA.call(n,s)&&I1(o,s,n[s]);if(v1)for(var s of v1(n))pA.call(n,s)&&I1(o,s,n[s]);return o};const Hc=(o,n)=>{const s=$A({},o);for(const l of n)l in s&&delete s[l];return s};function fg(o,n){const s={};return n.forEach(l=>{const a=l;l in o&&(s[a]=o[a])}),s}const _A=Symbol("ArcoFormItemContext"),si=({size:o,disabled:n,error:s,uninject:l}={})=>{const a=l?{}:ho(_A,{}),u=j(()=>{var T;return(T=o==null?void 0:o.value)!=null?T:a.size}),d=j(()=>(n==null?void 0:n.value)||a.disabled),h=j(()=>(s==null?void 0:s.value)||a.error),p=m0(a,"feedback"),f=m0(a,"eventHandlers");return{formItemCtx:a,mergedSize:u,mergedDisabled:d,mergedError:h,feedback:p,eventHandlers:f}},nr=(o,{defaultValue:n="medium"}={})=>{const s=ho(sr,void 0);return{mergedSize:j(()=>{var a,u;return(u=(a=o==null?void 0:o.value)!=null?a:s==null?void 0:s.size)!=null?u:n})}};function gA(o){const n=ge();function s(){if(!o.value)return;const{selectionStart:a,selectionEnd:u,value:d}=o.value;if(a==null||u==null)return;const h=d.slice(0,Math.max(0,a)),p=d.slice(Math.max(0,u));n.value={selectionStart:a,selectionEnd:u,value:d,beforeTxt:h,afterTxt:p}}function l(){if(!o.value||!n.value)return;const{value:a}=o.value,{beforeTxt:u,afterTxt:d,selectionStart:h}=n.value;if(!u||!d||!h)return;let p=a.length;if(a.endsWith(d))p=a.length-d.length;else if(a.startsWith(u))p=u.length;else{const f=u[h-1],T=a.indexOf(f,h-1);T!==-1&&(p=T+1)}o.value.setSelectionRange(p,p)}return[s,l]}var fA=Object.defineProperty,O1=Object.getOwnPropertySymbols,mA=Object.prototype.hasOwnProperty,TA=Object.prototype.propertyIsEnumerable,C1=(o,n,s)=>n in o?fA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,y1=(o,n)=>{for(var s in n||(n={}))mA.call(n,s)&&C1(o,s,n[s]);if(O1)for(var s of O1(n))TA.call(n,s)&&C1(o,s,n[s]);return o},Cc=Ke({name:"Input",inheritAttrs:!1,props:{modelValue:String,defaultValue:{type:String,default:""},size:{type:String},allowClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},placeholder:String,maxLength:{type:[Number,Object],default:0},showWordLimit:{type:Boolean,default:!1},wordLength:{type:Function},wordSlice:{type:Function},inputAttrs:{type:Object},type:{type:String,default:"text"}},emits:{"update:modelValue":o=>!0,input:(o,n)=>!0,change:(o,n)=>!0,pressEnter:o=>!0,clear:o=>!0,focus:o=>!0,blur:o=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{size:a,disabled:u,error:d,modelValue:h}=Pt(o),p=ot("input"),f=ge(),{mergedSize:T,mergedDisabled:C,mergedError:S,feedback:P,eventHandlers:x}=si({size:a,disabled:u,error:d}),{mergedSize:G}=nr(T),[oe,ne]=gA(f),Z=ge(o.defaultValue),Y=j(()=>{var N;return(N=o.modelValue)!=null?N:Z.value});Et(h,N=>{(rs(N)||Tl(N))&&(Z.value="")});let M=Y.value;const L=ge(!1),R=j(()=>o.allowClear&&!C.value&&!!Y.value),F=ge(!1),z=ge(""),X=N=>{var A;return bo(o.wordLength)?o.wordLength(N):(A=N.length)!=null?A:0},le=j(()=>X(Y.value)),$e=j(()=>S.value||!!(ko(o.maxLength)&&o.maxLength.errorOnly&&le.value>fe.value)),he=j(()=>ko(o.maxLength)&&!!o.maxLength.errorOnly),fe=j(()=>ko(o.maxLength)?o.maxLength.length:o.maxLength),ke=j(()=>{const N=X("a");return Math.floor(fe.value/N)}),re=N=>{var A,K;fe.value&&!he.value&&X(N)>fe.value&&(N=(K=(A=o.wordSlice)==null?void 0:A.call(o,N,fe.value))!=null?K:N.slice(0,ke.value)),Z.value=N,n("update:modelValue",N)},Ie=N=>{f.value&&N.target!==f.value&&(N.preventDefault(),f.value.focus())},D=(N,A)=>{var K,U;N!==M&&(M=N,n("change",N,A),(U=(K=x.value)==null?void 0:K.onChange)==null||U.call(K,A))},B=N=>{var A,K;L.value=!0,M=Y.value,n("focus",N),(K=(A=x.value)==null?void 0:A.onFocus)==null||K.call(A,N)},ae=N=>{var A,K;L.value=!1,D(Y.value,N),n("blur",N),(K=(A=x.value)==null?void 0:A.onBlur)==null||K.call(A,N)},_e=N=>{var A,K,U;const{value:de,selectionStart:Te,selectionEnd:se}=N.target;if(N.type==="compositionend"){if(F.value=!1,z.value="",fe.value&&!he.value&&le.value>=fe.value&&X(de)>fe.value&&Te===se){Me();return}re(de),n("input",de,N),(K=(A=x.value)==null?void 0:A.onInput)==null||K.call(A,N),Me()}else F.value=!0,z.value=Y.value+((U=N.data)!=null?U:"")},Me=()=>{oe(),Io(()=>{f.value&&Y.value!==f.value.value&&(f.value.value=Y.value,ne())})},Xe=N=>{var A,K;const{value:U}=N.target;if(!F.value){if(fe.value&&!he.value&&le.value>=fe.value&&X(U)>fe.value&&N.inputType==="insertText"){Me();return}re(U),n("input",U,N),(K=(A=x.value)==null?void 0:A.onInput)==null||K.call(A,N),Me()}},Je=N=>{re(""),D("",N),n("clear",N)},we=N=>{const A=N.key||N.code;!F.value&&A===gg.key&&(D(Y.value,N),n("pressEnter",N))},We=j(()=>[`${p}-outer`,`${p}-outer-size-${G.value}`,{[`${p}-outer-has-suffix`]:!!s.suffix,[`${p}-outer-disabled`]:C.value}]),Ze=j(()=>[`${p}-wrapper`,{[`${p}-error`]:$e.value,[`${p}-disabled`]:C.value,[`${p}-focus`]:L.value}]),nt=j(()=>[p,`${p}-size-${G.value}`]),ht=j(()=>Hc(l,hl)),et=j(()=>fg(l,hl)),xe=j(()=>{const N=y1(y1({},et.value),o.inputAttrs);return $e.value&&(N["aria-invalid"]=!0),N}),w=N=>{var A;return Q("span",Ot({class:Ze.value,onMousedown:Ie},N?void 0:ht.value),[s.prefix&&Q("span",{class:`${p}-prefix`},[s.prefix()]),Q("input",Ot(xe.value,{ref:f,class:nt.value,value:Y.value,type:o.type,placeholder:o.placeholder,readonly:o.readonly,disabled:C.value,onInput:Xe,onKeydown:we,onFocus:B,onBlur:ae,onCompositionstart:_e,onCompositionupdate:_e,onCompositionend:_e}),null),R.value&&Q(oi,{prefix:p,class:`${p}-clear-btn`,onClick:Je},{default:()=>[Q(El,null,null)]}),(s.suffix||!!o.maxLength&&o.showWordLimit||!!P.value)&&Q("span",{class:[`${p}-suffix`,{[`${p}-suffix-has-feedback`]:P.value}]},[!!o.maxLength&&o.showWordLimit&&Q("span",{class:`${p}-word-limit`},[le.value,Ut("/"),fe.value]),(A=s.suffix)==null?void 0:A.call(s),!!P.value&&Q(_g,{type:P.value},null)])])};return{inputRef:f,render:()=>s.prepend||s.append?Q("span",Ot({class:We.value},ht.value),[s.prepend&&Q("span",{class:`${p}-prepend`},[s.prepend()]),w(!0),s.append&&Q("span",{class:`${p}-append`},[s.append()])]):w()}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const EA=Ke({name:"IconSearch",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-search`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),bA=["stroke-width","stroke-linecap","stroke-linejoin"],vA=Le("path",{d:"M33.072 33.071c6.248-6.248 6.248-16.379 0-22.627-6.249-6.249-16.38-6.249-22.628 0-6.248 6.248-6.248 16.379 0 22.627 6.248 6.248 16.38 6.248 22.628 0Zm0 0 8.485 8.485"},null,-1),IA=[vA];function OA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},IA,14,bA)}var $_=dt(EA,[["render",OA]]);const N0=Object.assign($_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+$_.name,$_)}}),_I=Symbol("ArcoButtonGroup"),CA=Ke({name:"Button",components:{IconLoading:ir},props:{type:{type:String},shape:{type:String},status:{type:String},size:{type:String},long:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean},htmlType:{type:String,default:"button"},href:String},emits:{click:o=>!0},setup(o,{emit:n}){const{size:s,disabled:l}=Pt(o),a=ot("btn"),u=ho(_I,void 0),d=j(()=>{var P;return(P=s.value)!=null?P:u==null?void 0:u.size}),h=j(()=>!!(l.value||u!=null&&u.disabled)),{mergedSize:p,mergedDisabled:f}=si({size:d,disabled:h}),{mergedSize:T}=nr(p),C=j(()=>{var P,x,G,oe,ne,Z;return[a,`${a}-${(x=(P=o.type)!=null?P:u==null?void 0:u.type)!=null?x:"secondary"}`,`${a}-shape-${(oe=(G=o.shape)!=null?G:u==null?void 0:u.shape)!=null?oe:"square"}`,`${a}-size-${T.value}`,`${a}-status-${(Z=(ne=o.status)!=null?ne:u==null?void 0:u.status)!=null?Z:"normal"}`,{[`${a}-long`]:o.long,[`${a}-loading`]:o.loading,[`${a}-disabled`]:f.value,[`${a}-link`]:ki(o.href)}]});return{prefixCls:a,cls:C,mergedDisabled:f,handleClick:P=>{if(o.disabled||o.loading){P.preventDefault();return}n("click",P)}}}}),yA=["href"],SA=["type","disabled"];function RA(o,n,s,l,a,u){const d=_t("icon-loading");return o.href?(me(),Fe("a",{key:0,class:Pe([o.cls,{[`${o.prefixCls}-only-icon`]:o.$slots.icon&&!o.$slots.default}]),href:o.mergedDisabled||o.loading?void 0:o.href,onClick:n[0]||(n[0]=(...h)=>o.handleClick&&o.handleClick(...h))},[o.loading||o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[o.loading?(me(),it(d,{key:0,spin:"true"})):ct(o.$slots,"icon",{key:1})],2)):ut("v-if",!0),ct(o.$slots,"default")],10,yA)):(me(),Fe("button",{key:1,class:Pe([o.cls,{[`${o.prefixCls}-only-icon`]:o.$slots.icon&&!o.$slots.default}]),type:o.htmlType,disabled:o.mergedDisabled,onClick:n[1]||(n[1]=(...h)=>o.handleClick&&o.handleClick(...h))},[o.loading||o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[o.loading?(me(),it(d,{key:0,spin:!0})):ct(o.$slots,"icon",{key:1})],2)):ut("v-if",!0),ct(o.$slots,"default")],10,SA))}var __=dt(CA,[["render",RA]]);const kA=Ke({name:"ButtonGroup",props:{type:{type:String},status:{type:String},shape:{type:String},size:{type:String},disabled:{type:Boolean}},setup(o){const{type:n,size:s,status:l,disabled:a,shape:u}=Pt(o),d=ot("btn-group");return hn(_I,Jt({type:n,size:s,shape:u,status:l,disabled:a})),{prefixCls:d}}});function AA(o,n,s,l,a,u){return me(),Fe("div",{class:Pe(o.prefixCls)},[ct(o.$slots,"default")],2)}var g_=dt(kA,[["render",AA]]);const Vc=Object.assign(__,{Group:g_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+__.name,__),o.component(s+g_.name,g_)}});var f_=Ke({name:"InputSearch",props:{searchButton:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String},buttonText:{type:String},buttonProps:{type:Object}},emits:{search:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{size:l}=Pt(o),a=ot("input-search"),{mergedSize:u}=nr(l),d=ge(),h=C=>{d.value.inputRef&&n("search",d.value.inputRef.value,C)},p=()=>{var C;return Q(Wt,null,[o.loading?Q(ir,null,null):Q(oi,{onClick:h},{default:()=>[Q(N0,null,null)]}),(C=s.suffix)==null?void 0:C.call(s)])},f=()=>{var C;let S={};return o.buttonText||s["button-default"]||s["button-icon"]?S={default:(C=s["button-default"])!=null?C:o.buttonText?()=>o.buttonText:void 0,icon:s["button-icon"]}:S={icon:()=>Q(N0,null,null)},Q(Vc,Ot({type:"primary",class:`${a}-btn`,disabled:o.disabled,size:u.value,loading:o.loading},o.buttonProps,{onClick:h}),S)};return{inputRef:d,render:()=>Q(Cc,{ref:d,class:a,size:u.value,disabled:o.disabled},{prepend:s.prepend,prefix:s.prefix,suffix:o.searchButton?s.suffix:p,append:o.searchButton?f:s.append})}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const LA=Ke({name:"IconEye",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-eye`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),NA=["stroke-width","stroke-linecap","stroke-linejoin"],wA=Le("path",{"clip-rule":"evenodd",d:"M24 37c6.627 0 12.627-4.333 18-13-5.373-8.667-11.373-13-18-13-6.627 0-12.627 4.333-18 13 5.373 8.667 11.373 13 18 13Z"},null,-1),MA=Le("path",{d:"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"},null,-1),DA=[wA,MA];function PA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},DA,14,NA)}var m_=dt(LA,[["render",PA]]);const xA=Object.assign(m_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+m_.name,m_)}}),BA=Ke({name:"IconEyeInvisible",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-eye-invisible`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),FA=["stroke-width","stroke-linecap","stroke-linejoin"],UA=Le("path",{d:"M14 14.5c-2.69 2-5.415 5.33-8 9.5 5.373 8.667 11.373 13 18 13 3.325 0 6.491-1.09 9.5-3.271M17.463 12.5C19 11 21.75 11 24 11c6.627 0 12.627 4.333 18 13-1.766 2.848-3.599 5.228-5.5 7.14"},null,-1),HA=Le("path",{d:"M29 24a5 5 0 1 1-10 0 5 5 0 0 1 10 0ZM6.852 7.103l34.294 34.294"},null,-1),VA=[UA,HA];function GA(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},VA,14,FA)}var T_=dt(BA,[["render",GA]]);const WA=Object.assign(T_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+T_.name,T_)}}),zA=Ke({name:"InputPassword",components:{IconEye:xA,IconEyeInvisible:WA,AIconHover:oi,AInput:Cc},props:{invisibleButton:{type:Boolean,default:!0}},setup(){const o=ge(),n=ge(!0);return{inputRef:o,invisible:n,handleInvisible:()=>{n.value=!n.value}}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}}});function XA(o,n,s,l,a,u){const d=_t("icon-eye"),h=_t("icon-eye-invisible"),p=_t("a-icon-hover"),f=_t("a-input");return me(),it(f,{ref:"inputRef",type:o.invisible?"password":"text"},kv({_:2},[o.$slots.prepend?{name:"prepend",fn:De(()=>[ct(o.$slots,"prepend")])}:void 0,o.$slots.prefix?{name:"prefix",fn:De(()=>[ct(o.$slots,"prefix")])}:void 0,o.invisibleButton||o.$slots.suffix?{name:"suffix",fn:De(()=>[o.invisibleButton?(me(),it(p,{key:0,onClick:o.handleInvisible,onMousedown:n[0]||(n[0]=er(()=>{},["prevent"])),onMouseup:n[1]||(n[1]=er(()=>{},["prevent"]))},{default:De(()=>[o.invisible?(me(),it(h,{key:1})):(me(),it(d,{key:0}))]),_:1},8,["onClick"])):ut("v-if",!0),ct(o.$slots,"suffix")])}:void 0,o.$slots.append?{name:"append",fn:De(()=>[ct(o.$slots,"append")])}:void 0]),1032,["type"])}var E_=dt(zA,[["render",XA]]);const jA=Ke({name:"InputGroup",setup(){return{prefixCls:ot("input-group")}}});function YA(o,n,s,l,a,u){return me(),Fe("div",{class:Pe(o.prefixCls)},[ct(o.$slots,"default")],2)}var b_=dt(jA,[["render",YA]]);const mg=Object.assign(Cc,{Search:f_,Password:E_,Group:b_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+Cc.name,Cc),o.component(s+b_.name,b_),o.component(s+f_.name,f_),o.component(s+E_.name,E_)}});var KA=Object.defineProperty,S1=Object.getOwnPropertySymbols,QA=Object.prototype.hasOwnProperty,qA=Object.prototype.propertyIsEnumerable,R1=(o,n,s)=>n in o?KA(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Tc=(o,n)=>{for(var s in n||(n={}))QA.call(n,s)&&R1(o,s,n[s]);if(S1)for(var s of S1(n))qA.call(n,s)&&R1(o,s,n[s]);return o};const JA=()=>{const{height:o,width:n}=uI();return{width:Math.min(n,window.innerWidth),height:Math.min(o,window.innerHeight)}},k1=(o,n)=>{var s,l;const a=o.getBoundingClientRect();return{top:a.top,bottom:a.bottom,left:a.left,right:a.right,scrollTop:a.top-n.top,scrollBottom:a.bottom-n.top,scrollLeft:a.left-n.left,scrollRight:a.right-n.left,width:(s=o.offsetWidth)!=null?s:o.clientWidth,height:(l=o.offsetHeight)!=null?l:o.clientHeight}},ZA=o=>{switch(o){case"top":case"tl":case"tr":return"top";case"bottom":case"bl":case"br":return"bottom";case"left":case"lt":case"lb":return"left";case"right":case"rt":case"rb":return"right";default:return"top"}},Eu=(o,n)=>{switch(n){case"top":switch(o){case"bottom":return"top";case"bl":return"tl";case"br":return"tr";default:return o}case"bottom":switch(o){case"top":return"bottom";case"tl":return"bl";case"tr":return"br";default:return o}case"left":switch(o){case"right":return"left";case"rt":return"lt";case"rb":return"lb";default:return o}case"right":switch(o){case"left":return"right";case"lt":return"rt";case"lb":return"rb";default:return o}default:return o}},eL=(o,n,{containerRect:s,triggerRect:l,popupRect:a,offset:u,translate:d})=>{const h=ZA(o),p=JA(),f={top:s.top+n.top,bottom:p.height-(s.top+n.top+a.height),left:s.left+n.left,right:p.width-(s.left+n.left+a.width)};let T=o;if(h==="top"&&f.top<0)if(l.top>a.height)n.top=-s.top;else{const C=Ec("bottom",l,a,{offset:u,translate:d});p.height-(s.top+C.top+a.height)>0&&(T=Eu(o,"bottom"),n.top=C.top)}if(h==="bottom"&&f.bottom<0)if(p.height-l.bottom>a.height)n.top=-s.top+(p.height-a.height);else{const C=Ec("top",l,a,{offset:u,translate:d});s.top+C.top>0&&(T=Eu(o,"top"),n.top=C.top)}if(h==="left"&&f.left<0)if(l.left>a.width)n.left=-s.left;else{const C=Ec("right",l,a,{offset:u,translate:d});p.width-(s.left+C.left+a.width)>0&&(T=Eu(o,"right"),n.left=C.left)}if(h==="right"&&f.right<0)if(p.width-l.right>a.width)n.left=-s.left+(p.width-a.width);else{const C=Ec("left",l,a,{offset:u,translate:d});s.left+C.left>0&&(T=Eu(o,"left"),n.left=C.left)}return(h==="top"||h==="bottom")&&(f.left<0?n.left=-s.left:f.right<0&&(n.left=-s.left+(p.width-a.width))),(h==="left"||h==="right")&&(f.top<0?n.top=-s.top:f.bottom<0&&(n.top=-s.top+(p.height-a.height))),{popupPosition:n,position:T}},Ec=(o,n,s,{offset:l=0,translate:a=[0,0]}={})=>{var u;const d=(u=jo(a)?a:a[o])!=null?u:[0,0];switch(o){case"top":return{left:n.scrollLeft+Math.round(n.width/2)-Math.round(s.width/2)+d[0],top:n.scrollTop-s.height-l+d[1]};case"tl":return{left:n.scrollLeft+d[0],top:n.scrollTop-s.height-l+d[1]};case"tr":return{left:n.scrollRight-s.width+d[0],top:n.scrollTop-s.height-l+d[1]};case"bottom":return{left:n.scrollLeft+Math.round(n.width/2)-Math.round(s.width/2)+d[0],top:n.scrollBottom+l+d[1]};case"bl":return{left:n.scrollLeft+d[0],top:n.scrollBottom+l+d[1]};case"br":return{left:n.scrollRight-s.width+d[0],top:n.scrollBottom+l+d[1]};case"left":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollTop+Math.round(n.height/2)-Math.round(s.height/2)+d[1]};case"lt":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollTop+d[1]};case"lb":return{left:n.scrollLeft-s.width-l+d[0],top:n.scrollBottom-s.height+d[1]};case"right":return{left:n.scrollRight+l+d[0],top:n.scrollTop+Math.round(n.height/2)-Math.round(s.height/2)+d[1]};case"rt":return{left:n.scrollRight+l+d[0],top:n.scrollTop+d[1]};case"rb":return{left:n.scrollRight+l+d[0],top:n.scrollBottom-s.height+d[1]};default:return{left:0,top:0}}},tL=o=>{let n="0";["top","bottom"].includes(o)?n="50%":["left","lt","lb","tr","br"].includes(o)&&(n="100%");let s="0";return["left","right"].includes(o)?s="50%":["top","tl","tr","lt","rt"].includes(o)&&(s="100%"),`${n} ${s}`},oL=(o,n,s,l,{offset:a=0,translate:u=[0,0],customStyle:d={},autoFitPosition:h=!1}={})=>{let p=o,f=Ec(o,s,l,{offset:a,translate:u});if(h){const C=eL(o,f,{containerRect:n,popupRect:l,triggerRect:s,offset:a,translate:u});f=C.popupPosition,p=C.position}return{style:Tc({left:`${f.left}px`,top:`${f.top}px`},d),position:p}},sL=(o,n,s,{customStyle:l={}})=>{if(["top","tl","tr","bottom","bl","br"].includes(o)){let u=Math.abs(n.scrollLeft+n.width/2-s.scrollLeft);return u>s.width-8&&(n.width>s.width?u=s.width/2:u=s.width-8),["top","tl","tr"].includes(o)?Tc({left:`${u}px`,bottom:"0",transform:"translate(-50%,50%) rotate(45deg)"},l):Tc({left:`${u}px`,top:"0",transform:"translate(-50%,-50%) rotate(45deg)"},l)}let a=Math.abs(n.scrollTop+n.height/2-s.scrollTop);return a>s.height-8&&(n.height>s.height?a=s.height/2:a=s.height-8),["left","lt","lb"].includes(o)?Tc({top:`${a}px`,right:"0",transform:"translate(50%,-50%) rotate(45deg)"},l):Tc({top:`${a}px`,left:"0",transform:"translate(-50%,-50%) rotate(45deg)"},l)},iL=o=>o.scrollHeight>o.offsetHeight||o.scrollWidth>o.offsetWidth,A1=o=>{var n;const s=[];let l=o;for(;l&&l!==document.documentElement;)iL(l)&&s.push(l),l=(n=l.parentElement)!=null?n:void 0;return s},gI=()=>{const o={},n=ge(),s=()=>{const l=lI(o.value);l!==n.value&&(n.value=l)};return zt(()=>s()),fl(()=>s()),{children:o,firstElement:n}};var w0=Ke({name:"ResizeObserver",props:{watchOnUpdated:Boolean},emits:["resize"],setup(o,{emit:n,slots:s}){const{children:l,firstElement:a}=gI();let u;const d=p=>{p&&(u=new dg(f=>{const T=f[0];n("resize",T)}),u.observe(p))},h=()=>{u&&(u.disconnect(),u=null)};return Et(a,p=>{u&&h(),p&&d(p)}),Ri(()=>{u&&h()}),()=>{var p;return l.value=(p=s.default)==null?void 0:p.call(s),l.value}}});function nL(o,n){const s=ge(o[n]);return fl(()=>{const l=o[n];s.value!==l&&(s.value=l)}),s}const L1=Symbol("ArcoTrigger"),rL=1e3,lL=5e3,cL=1;class aL{constructor(){this.popupStack={popup:new Set,dialog:new Set,message:new Set},this.getNextZIndex=n=>(n==="message"?Array.from(this.popupStack.message).pop()||lL:Array.from(this.popupStack.popup).pop()||rL)+cL,this.add=n=>{const s=this.getNextZIndex(n);return this.popupStack[n].add(s),n==="dialog"&&this.popupStack.popup.add(s),s},this.delete=(n,s)=>{this.popupStack[s].delete(n),s==="dialog"&&this.popupStack.popup.delete(n)},this.isLastDialog=n=>this.popupStack.dialog.size>1?n===Array.from(this.popupStack.dialog).pop():!0}}const v_=new aL;function Tg(o,{visible:n,runOnMounted:s}={}){const l=ge(0),a=()=>{l.value=v_.add(o)},u=()=>{v_.delete(l.value,o)},d=()=>o==="dialog"?v_.isLastDialog(l.value):!1;return Et(()=>n==null?void 0:n.value,h=>{h?a():u()},{immediate:!0}),s&&(zt(()=>{a()}),Ri(()=>{u()})),{zIndex:K0(l),open:a,close:u,isLastDialog:d}}const uL=({elementRef:o,onResize:n})=>{let s;return{createResizeObserver:()=>{o.value&&(s=new dg(u=>{const d=u[0];bo(n)&&n(d)}),s.observe(o.value))},destroyResizeObserver:()=>{s&&(s.disconnect(),s=null)}}};var fI=Ke({name:"ClientOnly",setup(o,{slots:n}){const s=ge(!1);return zt(()=>s.value=!0),()=>{var l;return s.value?(l=n.default)==null?void 0:l.call(n):null}}});const mI=({popupContainer:o,visible:n,defaultContainer:s="body",documentContainer:l})=>{const a=ge(o.value),u=ge(),d=()=>{const h=L0(o.value),p=h?o.value:s,f=h??(l?document.documentElement:L0(s));p!==a.value&&(a.value=p),f!==u.value&&(u.value=f)};return zt(()=>d()),Et(n,h=>{a.value!==o.value&&h&&d()}),{teleportContainer:a,containerRef:u}};var dL=Object.defineProperty,hL=Object.defineProperties,pL=Object.getOwnPropertyDescriptors,N1=Object.getOwnPropertySymbols,$L=Object.prototype.hasOwnProperty,_L=Object.prototype.propertyIsEnumerable,w1=(o,n,s)=>n in o?dL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,gL=(o,n)=>{for(var s in n||(n={}))$L.call(n,s)&&w1(o,s,n[s]);if(N1)for(var s of N1(n))_L.call(n,s)&&w1(o,s,n[s]);return o},fL=(o,n)=>hL(o,pL(n));const mL=["onClick","onMouseenter","onMouseleave","onFocusin","onFocusout","onContextmenu"];var I_=Ke({name:"Trigger",inheritAttrs:!1,props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},trigger:{type:[String,Array],default:"hover"},position:{type:String,default:"bottom"},disabled:{type:Boolean,default:!1},popupOffset:{type:Number,default:0},popupTranslate:{type:[Array,Object]},showArrow:{type:Boolean,default:!1},alignPoint:{type:Boolean,default:!1},popupHoverStay:{type:Boolean,default:!0},blurToClose:{type:Boolean,default:!0},clickToClose:{type:Boolean,default:!0},clickOutsideToClose:{type:Boolean,default:!0},unmountOnClose:{type:Boolean,default:!0},contentClass:{type:[String,Array,Object]},contentStyle:{type:Object},arrowClass:{type:[String,Array,Object]},arrowStyle:{type:Object},popupStyle:{type:Object},animationName:{type:String,default:"fade-in"},duration:{type:[Number,Object]},mouseEnterDelay:{type:Number,default:100},mouseLeaveDelay:{type:Number,default:100},focusDelay:{type:Number,default:0},autoFitPopupWidth:{type:Boolean,default:!1},autoFitPopupMinWidth:{type:Boolean,default:!1},autoFixPosition:{type:Boolean,default:!0},popupContainer:{type:[String,Object]},updateAtScroll:{type:Boolean,default:!1},autoFitTransformOrigin:{type:Boolean,default:!1},hideEmpty:{type:Boolean,default:!1},openedClass:{type:[String,Array,Object]},autoFitPosition:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},preventFocus:{type:Boolean,default:!1},scrollToClose:{type:Boolean,default:!1}},emits:{"update:popupVisible":o=>!0,popupVisibleChange:o=>!0,show:()=>!0,hide:()=>!0,resize:()=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{popupContainer:a}=Pt(o),u=ot("trigger"),d=j(()=>Hc(l,mL)),h=ho(sr,void 0),p=j(()=>[].concat(o.trigger)),f=new Set,T=ho(L1,void 0),{children:C,firstElement:S}=gI(),P=ge(),x=ge(o.defaultPopupVisible),G=ge(o.position),oe=ge({}),ne=ge({}),Z=ge({}),Y=ge(),M=ge({top:0,left:0}),L=j(()=>{var be;return(be=o.popupVisible)!=null?be:x.value}),{teleportContainer:R,containerRef:F}=mI({popupContainer:a,visible:L,documentContainer:!0}),{zIndex:z}=Tg("popup",{visible:L});let X=0,le=!1,$e=!1;const he=()=>{X&&(window.clearTimeout(X),X=0)},fe=be=>{if(o.alignPoint){const{pageX:ee,pageY:ie}=be;M.value={top:ie,left:ee}}},ke=()=>{if(!S.value||!P.value||!F.value)return;const be=F.value.getBoundingClientRect(),ee=o.alignPoint?{top:M.value.top,bottom:M.value.top,left:M.value.left,right:M.value.left,scrollTop:M.value.top,scrollBottom:M.value.top,scrollLeft:M.value.left,scrollRight:M.value.left,width:0,height:0}:k1(S.value,be),ie=()=>k1(P.value,be),ue=ie(),{style:ye,position:E}=oL(o.position,be,ee,ue,{offset:o.popupOffset,translate:o.popupTranslate,customStyle:o.popupStyle,autoFitPosition:o.autoFitPosition});o.autoFitTransformOrigin&&(ne.value={transformOrigin:tL(E)}),o.autoFitPopupMinWidth?ye.minWidth=`${ee.width}px`:o.autoFitPopupWidth&&(ye.width=`${ee.width}px`),G.value!==E&&(G.value=E),oe.value=ye,o.showArrow&&Io(()=>{Z.value=sL(E,ee,ie(),{customStyle:o.arrowStyle})})},re=(be,ee)=>{if(be===L.value&&X===0)return;const ie=()=>{x.value=be,n("update:popupVisible",be),n("popupVisibleChange",be),be&&Io(()=>{ke()})};ee?(he(),be!==L.value&&(X=window.setTimeout(ie,ee))):ie()},Ie=be=>{var ee;(ee=l.onClick)==null||ee.call(l,be),!(o.disabled||L.value&&!o.clickToClose)&&(p.value.includes("click")?(fe(be),re(!L.value)):p.value.includes("contextMenu")&&L.value&&re(!1))},D=be=>{var ee;(ee=l.onMouseenter)==null||ee.call(l,be),!(o.disabled||!p.value.includes("hover"))&&(fe(be),re(!0,o.mouseEnterDelay))},B=be=>{T==null||T.onMouseenter(be),D(be)},ae=be=>{var ee;(ee=l.onMouseleave)==null||ee.call(l,be),!(o.disabled||!p.value.includes("hover"))&&re(!1,o.mouseLeaveDelay)},_e=be=>{T==null||T.onMouseleave(be),ae(be)},Me=be=>{var ee;(ee=l.onFocusin)==null||ee.call(l,be),!(o.disabled||!p.value.includes("focus"))&&re(!0,o.focusDelay)},Xe=be=>{var ee;(ee=l.onFocusout)==null||ee.call(l,be),!(o.disabled||!p.value.includes("focus"))&&o.blurToClose&&re(!1)},Je=be=>{var ee;(ee=l.onContextmenu)==null||ee.call(l,be),!(o.disabled||!p.value.includes("contextMenu")||L.value&&!o.clickToClose)&&(fe(be),re(!L.value),be.preventDefault())};hn(L1,Jt({onMouseenter:B,onMouseleave:_e,addChildRef:be=>{f.add(be),T==null||T.addChildRef(be)},removeChildRef:be=>{f.delete(be),T==null||T.removeChildRef(be)}}));const Ze=()=>{Yo(document.documentElement,"mousedown",et),le=!1},nt=nL(s,"content"),ht=j(()=>{var be;return o.hideEmpty&&bk((be=nt.value)==null?void 0:be.call(nt))}),et=be=>{var ee,ie,ue;if(!((ee=S.value)!=null&&ee.contains(be.target)||(ie=P.value)!=null&&ie.contains(be.target))){for(const ye of f)if((ue=ye.value)!=null&&ue.contains(be.target))return;Ze(),re(!1)}},xe=A0(()=>{L.value&&(o.scrollToClose||h!=null&&h.scrollToClose?re(!1):ke())}),w=()=>{Yo(window,"scroll",I),$e=!1},I=A0(()=>{re(!1),w()}),N=()=>{L.value&&ke()},A=()=>{N(),n("resize")},K=be=>{o.preventFocus&&be.preventDefault()};T==null||T.addChildRef(P);const U=j(()=>L.value?o.openedClass:void 0);let de;Et(L,be=>{if(o.clickOutsideToClose&&(!be&&le?Ze():be&&!le&&(vo(document.documentElement,"mousedown",et),le=!0)),(o.scrollToClose||h!=null&&h.scrollToClose)&&(vo(window,"scroll",I),$e=!0),o.updateAtScroll||h!=null&&h.updateAtScroll){if(be){de=A1(S.value);for(const ee of de)ee.addEventListener("scroll",xe)}else if(de){for(const ee of de)ee.removeEventListener("scroll",xe);de=void 0}}be&&(Ce.value=!0)}),Et(()=>[o.autoFitPopupWidth,o.autoFitPopupMinWidth],()=>{L.value&&ke()});const{createResizeObserver:Te,destroyResizeObserver:se}=uL({elementRef:F,onResize:N});zt(()=>{if(Te(),L.value&&(ke(),o.clickOutsideToClose&&!le&&(vo(document.documentElement,"mousedown",et),le=!0),o.updateAtScroll||h!=null&&h.updateAtScroll)){de=A1(S.value);for(const be of de)be.addEventListener("scroll",xe)}}),fl(()=>{L.value&&ke()}),Cv(()=>{re(!1)}),Ri(()=>{if(T==null||T.removeChildRef(P),se(),le&&Ze(),$e&&w(),de){for(const be of de)be.removeEventListener("scroll",xe);de=void 0}});const Ce=ge(L.value),ce=ge(!1),Se=()=>{ce.value=!0},Ne=()=>{ce.value=!1,L.value&&n("show")},He=()=>{ce.value=!1,L.value||(Ce.value=!1,n("hide"))};return()=>{var be,ee;return C.value=(ee=(be=s.default)==null?void 0:be.call(s))!=null?ee:[],iI(C.value,{class:U.value,onClick:Ie,onMouseenter:D,onMouseleave:ae,onFocusin:Me,onFocusout:Xe,onContextmenu:Je}),Q(Wt,null,[o.autoFixPosition?Q(w0,{onResize:A},{default:()=>[C.value]}):C.value,Q(fI,null,{default:()=>[Q(lg,{to:R.value,disabled:!o.renderToBody},{default:()=>[(!o.unmountOnClose||L.value||Ce.value)&&!ht.value&&Q(w0,{onResize:N},{default:()=>[Q("div",Ot({ref:P,class:[`${u}-popup`,`${u}-position-${G.value}`],style:fL(gL({},oe.value),{zIndex:z.value,pointerEvents:ce.value?"none":"auto"}),"trigger-placement":G.value,onMouseenter:B,onMouseleave:_e,onMousedown:K},d.value),[Q(un,{name:o.animationName,duration:o.duration,appear:!0,onBeforeEnter:Se,onAfterEnter:Ne,onBeforeLeave:Se,onAfterLeave:He},{default:()=>{var ie;return[Kn(Q("div",{class:`${u}-popup-wrapper`,style:ne.value},[Q("div",{class:[`${u}-content`,o.contentClass],style:o.contentStyle},[(ie=s.content)==null?void 0:ie.call(s)]),o.showArrow&&Q("div",{ref:Y,class:[`${u}-arrow`,o.arrowClass],style:Z.value},null)]),[[qn,L.value]])]}})])]})]})]})])}}});const zu=Object.assign(I_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+I_.name,I_)}}),TL=Ke({name:"IconEmpty",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-empty`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),EL=["stroke-width","stroke-linecap","stroke-linejoin"],bL=Le("path",{d:"M24 5v6m7 1 4-4m-18 4-4-4m28.5 22H28s-1 3-4 3-4-3-4-3H6.5M40 41H8a2 2 0 0 1-2-2v-8.46a2 2 0 0 1 .272-1.007l6.15-10.54A2 2 0 0 1 14.148 18H33.85a2 2 0 0 1 1.728.992l6.149 10.541A2 2 0 0 1 42 30.541V39a2 2 0 0 1-2 2Z"},null,-1),vL=[bL];function IL(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},vL,14,EL)}var O_=dt(TL,[["render",IL]]);const OL=Object.assign(O_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+O_.name,O_)}});var C_=Ke({name:"Empty",props:{description:String,imgSrc:String,inConfigProvider:{type:Boolean,default:!1}},setup(o,{slots:n}){const s=ot("empty"),{t:l}=ug(),a=ho(sr,void 0);return()=>{var u,d,h,p;return!o.inConfigProvider&&(a!=null&&a.slots.empty)&&!(n.image||o.imgSrc||o.description)?a.slots.empty({component:"empty"}):Q("div",{class:s},[Q("div",{class:`${s}-image`},[(d=(u=n.image)==null?void 0:u.call(n))!=null?d:o.imgSrc?Q("img",{src:o.imgSrc,alt:o.description||"empty"},null):Q(OL,null,null)]),Q("div",{class:`${s}-description`},[(p=(h=n.default)==null?void 0:h.call(n))!=null?p:o.description||l("empty.description")])])}}});const CL=Object.assign(C_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+C_.name,C_)}}),yL=5;var SL=Ke({name:"DotLoading",props:{size:{type:Number}},setup(o){const n=ot("dot-loading");return()=>{const s=o.size?{width:`${o.size}px`,height:`${o.size}px`}:{};return Q("div",{class:n,style:{width:o.size?`${o.size*7}px`:void 0,height:o.size?`${o.size}px`:void 0}},[Array(yL).fill(1).map((l,a)=>Q("div",{class:`${n}-item`,key:a,style:s},null))])}}}),y_=Ke({name:"Spin",props:{size:{type:Number},loading:Boolean,dot:Boolean,tip:String,hideIcon:{type:Boolean,default:!1}},setup(o,{slots:n}){const s=ot("spin"),l=ho(sr,void 0),a=j(()=>[s,{[`${s}-loading`]:o.loading,[`${s}-with-tip`]:o.tip&&!n.default}]),u=()=>{if(n.icon){const h=rl(n.icon());if(h)return gs(h,{spin:!0})}return n.element?n.element():o.dot?Q(SL,{size:o.size},null):l!=null&&l.slots.loading?l.slots.loading():Q(ir,{spin:!0,size:o.size},null)},d=()=>{var h,p,f;const T=o.size?{fontSize:`${o.size}px`}:void 0,C=!!((h=n.tip)!=null?h:o.tip);return Q(Wt,null,[!o.hideIcon&&Q("div",{class:`${s}-icon`,style:T},[u()]),C&&Q("div",{class:`${s}-tip`},[(f=(p=n.tip)==null?void 0:p.call(n))!=null?f:o.tip])])};return()=>Q("div",{class:a.value},[n.default?Q(Wt,null,[n.default(),o.loading&&Q("div",{class:`${s}-mask`},[Q("div",{class:`${s}-mask-icon`},[d()])])]):d()])}});const RL=Object.assign(y_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+y_.name,y_)}}),kL=Ke({name:"Thumb",props:{data:{type:Object},direction:{type:String,default:"horizontal"},alwaysShow:{type:Boolean,default:!1},both:{type:Boolean,default:!1}},emits:["scroll"],setup(o,{emit:n}){const s=ot("scrollbar"),l=ge(!1),a=ge(),u=ge(),d=j(()=>o.direction==="horizontal"?{size:"width",direction:"left",offset:"offsetWidth",client:"clientX"}:{size:"height",direction:"top",offset:"offsetHeight",client:"clientY"}),h=ge(0),p=ge(!1),f=ge(0),T=j(()=>{var Z,Y;return{[d.value.size]:`${(Y=(Z=o.data)==null?void 0:Z.thumbSize)!=null?Y:0}px`,[d.value.direction]:`${h.value}px`}}),C=Z=>{Z.preventDefault(),u.value&&(f.value=Z[d.value.client]-u.value.getBoundingClientRect()[d.value.direction],p.value=!0,vo(window,"mousemove",x),vo(window,"mouseup",G),vo(window,"contextmenu",G))},S=Z=>{var Y,M,L,R;if(Z.preventDefault(),u.value){const F=P(Z[d.value.client]>u.value.getBoundingClientRect()[d.value.direction]?h.value+((M=(Y=o.data)==null?void 0:Y.thumbSize)!=null?M:0):h.value-((R=(L=o.data)==null?void 0:L.thumbSize)!=null?R:0));F!==h.value&&(h.value=F,n("scroll",F))}},P=Z=>Z<0?0:o.data&&Z>o.data.max?o.data.max:Z,x=Z=>{if(a.value&&u.value){const Y=P(Z[d.value.client]-a.value.getBoundingClientRect()[d.value.direction]-f.value);Y!==h.value&&(h.value=Y,n("scroll",Y))}},G=()=>{p.value=!1,Yo(window,"mousemove",x),Yo(window,"mouseup",G)},oe=Z=>{p.value||(Z=P(Z),Z!==h.value&&(h.value=Z))},ne=j(()=>[`${s}-thumb`,`${s}-thumb-direction-${o.direction}`,{[`${s}-thumb-dragging`]:p.value}]);return{visible:l,trackRef:a,thumbRef:u,prefixCls:s,thumbCls:ne,thumbStyle:T,handleThumbMouseDown:C,handleTrackClick:S,setOffset:oe}}});function AL(o,n,s,l,a,u){return me(),it(un,null,{default:De(()=>[Le("div",{ref:"trackRef",class:Pe([`${o.prefixCls}-track`,`${o.prefixCls}-track-direction-${o.direction}`]),onMousedown:n[1]||(n[1]=er((...d)=>o.handleTrackClick&&o.handleTrackClick(...d),["self"]))},[Le("div",{ref:"thumbRef",class:Pe(o.thumbCls),style:It(o.thumbStyle),onMousedown:n[0]||(n[0]=(...d)=>o.handleThumbMouseDown&&o.handleThumbMouseDown(...d))},[Le("div",{class:Pe(`${o.prefixCls}-thumb-bar`)},null,2)],38)],34)]),_:1})}var LL=dt(kL,[["render",AL]]);const M1=20,bu=15,NL=Ke({name:"Scrollbar",components:{ResizeObserver:w0,Thumb:LL},inheritAttrs:!1,props:{type:{type:String,default:"embed"},outerClass:[String,Object,Array],outerStyle:{type:[String,Object,Array]},hide:{type:Boolean,default:!1},disableHorizontal:{type:Boolean,default:!1},disableVertical:{type:Boolean,default:!1}},emits:{scroll:o=>!0},setup(o,{emit:n}){const s=ot("scrollbar"),l=ge(),a=ge(),u=ge(),d=ge(),h=ge(),p=ge(!1),f=ge(!1),T=j(()=>p.value&&!o.disableHorizontal),C=j(()=>f.value&&!o.disableVertical),S=ge(!1),P=()=>{var M,L,R,F,z,X;if(l.value){const{clientWidth:le,clientHeight:$e,offsetWidth:he,offsetHeight:fe,scrollWidth:ke,scrollHeight:re,scrollTop:Ie,scrollLeft:D}=l.value;p.value=ke>le,f.value=re>$e,S.value=T.value&&C.value;const B=o.type==="embed"&&S.value?he-bu:he,ae=o.type==="embed"&&S.value?fe-bu:fe,_e=Math.round(B/Math.min(ke/le,B/M1)),Me=B-_e,Xe=(ke-le)/Me,Je=Math.round(ae/Math.min(re/$e,ae/M1)),we=ae-Je,We=(re-$e)/we;if(a.value={ratio:Xe,thumbSize:_e,max:Me},u.value={ratio:We,thumbSize:Je,max:we},Ie>0){const Ze=Math.round(Ie/((L=(M=u.value)==null?void 0:M.ratio)!=null?L:1));(R=h.value)==null||R.setOffset(Ze)}if(D>0){const Ze=Math.round(D/((z=(F=u.value)==null?void 0:F.ratio)!=null?z:1));(X=d.value)==null||X.setOffset(Ze)}}};zt(()=>{P()});const x=()=>{P()},G=M=>{var L,R,F,z,X,le;if(l.value){if(T.value&&!o.disableHorizontal){const $e=Math.round(l.value.scrollLeft/((R=(L=a.value)==null?void 0:L.ratio)!=null?R:1));(F=d.value)==null||F.setOffset($e)}if(C.value&&!o.disableVertical){const $e=Math.round(l.value.scrollTop/((X=(z=u.value)==null?void 0:z.ratio)!=null?X:1));(le=h.value)==null||le.setOffset($e)}}n("scroll",M)},oe=M=>{var L,R;l.value&&l.value.scrollTo({left:M*((R=(L=a.value)==null?void 0:L.ratio)!=null?R:1)})},ne=M=>{var L,R;l.value&&l.value.scrollTo({top:M*((R=(L=u.value)==null?void 0:L.ratio)!=null?R:1)})},Z=j(()=>{const M={};return o.type==="track"&&(T.value&&(M.paddingBottom=`${bu}px`),C.value&&(M.paddingRight=`${bu}px`)),[M,o.outerStyle]}),Y=j(()=>[`${s}`,`${s}-type-${o.type}`,{[`${s}-both`]:S.value},o.outerClass]);return{prefixCls:s,cls:Y,style:Z,containerRef:l,horizontalThumbRef:d,verticalThumbRef:h,horizontalData:a,verticalData:u,isBoth:S,hasHorizontalScrollbar:T,hasVerticalScrollbar:C,handleResize:x,handleScroll:G,handleHorizontalScroll:oe,handleVerticalScroll:ne}},methods:{scrollTo(o,n){var s,l;ko(o)?(s=this.$refs.containerRef)==null||s.scrollTo(o):(o||n)&&((l=this.$refs.containerRef)==null||l.scrollTo(o,n))},scrollTop(o){var n;(n=this.$refs.containerRef)==null||n.scrollTo({top:o})},scrollLeft(o){var n;(n=this.$refs.containerRef)==null||n.scrollTo({left:o})}}});function wL(o,n,s,l,a,u){const d=_t("ResizeObserver"),h=_t("thumb");return me(),Fe("div",{class:Pe(o.cls),style:It(o.style)},[Q(d,{onResize:o.handleResize},{default:De(()=>[Le("div",Ot({ref:"containerRef",class:`${o.prefixCls}-container`},o.$attrs,{onScroll:n[0]||(n[0]=(...p)=>o.handleScroll&&o.handleScroll(...p))}),[Q(d,{onResize:o.handleResize},{default:De(()=>[ct(o.$slots,"default")]),_:3},8,["onResize"])],16)]),_:3},8,["onResize"]),!o.hide&&o.hasHorizontalScrollbar?(me(),it(h,{key:0,ref:"horizontalThumbRef",data:o.horizontalData,direction:"horizontal",both:o.isBoth,onScroll:o.handleHorizontalScroll},null,8,["data","both","onScroll"])):ut("v-if",!0),!o.hide&&o.hasVerticalScrollbar?(me(),it(h,{key:1,ref:"verticalThumbRef",data:o.verticalData,direction:"vertical",both:o.isBoth,onScroll:o.handleVerticalScroll},null,8,["data","both","onScroll"])):ut("v-if",!0)],6)}var S_=dt(NL,[["render",wL]]);const TI=Object.assign(S_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+S_.name,S_)}}),ML=o=>{const n=ge(),s=()=>qv(n.value)?n.value.$refs[o]:n.value,l=ge();return zt(()=>{l.value=s()}),Et([n],()=>{l.value=s()}),{componentRef:n,elementRef:l}};var DL=Object.defineProperty,D1=Object.getOwnPropertySymbols,PL=Object.prototype.hasOwnProperty,xL=Object.prototype.propertyIsEnumerable,P1=(o,n,s)=>n in o?DL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,BL=(o,n)=>{for(var s in n||(n={}))PL.call(n,s)&&P1(o,s,n[s]);if(D1)for(var s of D1(n))xL.call(n,s)&&P1(o,s,n[s]);return o};const FL=o=>{const n=j(()=>!!o.value),s=j(()=>{if(o.value)return BL({type:"embed"},S0(o.value)?void 0:o.value)});return{displayScrollbar:n,scrollbarProps:s}},UL=Ke({name:"SelectDropdown",components:{ScrollbarComponent:TI,Empty:CL,Spin:RL},props:{loading:Boolean,empty:Boolean,virtualList:Boolean,bottomOffset:{type:Number,default:0},scrollbar:{type:[Boolean,Object],default:!0},onScroll:{type:[Function,Array]},onReachBottom:{type:[Function,Array]},showHeaderOnEmpty:{type:Boolean,default:!1},showFooterOnEmpty:{type:Boolean,default:!1}},emits:["scroll","reachBottom"],setup(o,{emit:n,slots:s}){var l,a,u;const{scrollbar:d}=Pt(o),h=ot("select-dropdown"),p=ho(sr,void 0),f=(u=(a=p==null?void 0:(l=p.slots).empty)==null?void 0:a.call(l,{component:"select"}))==null?void 0:u[0],{componentRef:T,elementRef:C}=ML("containerRef"),{displayScrollbar:S,scrollbarProps:P}=FL(d),x=oe=>{const{scrollTop:ne,scrollHeight:Z,offsetHeight:Y}=oe.target;Z-(ne+Y)<=o.bottomOffset&&n("reachBottom",oe),n("scroll",oe)},G=j(()=>[h,{[`${h}-has-header`]:!!s.header,[`${h}-has-footer`]:!!s.footer}]);return{prefixCls:h,SelectEmpty:f,cls:G,wrapperRef:C,wrapperComRef:T,handleScroll:x,displayScrollbar:S,scrollbarProps:P}}});function HL(o,n,s,l,a,u){const d=_t("spin");return me(),Fe("div",{class:Pe(o.cls)},[o.$slots.header&&(!o.empty||o.showHeaderOnEmpty)?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-header`)},[ct(o.$slots,"header")],2)):ut("v-if",!0),o.loading?(me(),it(d,{key:1,class:Pe(`${o.prefixCls}-loading`)},null,8,["class"])):o.empty?(me(),Fe("div",{key:2,class:Pe(`${o.prefixCls}-empty`)},[ct(o.$slots,"empty",{},()=>[(me(),it(cn(o.SelectEmpty?o.SelectEmpty:"Empty")))])],2)):ut("v-if",!0),o.virtualList&&!o.loading&&!o.empty?ct(o.$slots,"virtual-list",{key:3}):ut("v-if",!0),o.virtualList?ut("v-if",!0):Kn((me(),it(cn(o.displayScrollbar?"ScrollbarComponent":"div"),Ot({key:4,ref:"wrapperComRef",class:`${o.prefixCls}-list-wrapper`},o.scrollbarProps,{onScroll:o.handleScroll}),{default:De(()=>[Le("ul",{class:Pe(`${o.prefixCls}-list`)},[ct(o.$slots,"default")],2)]),_:3},16,["class","onScroll"])),[[qn,!o.loading&&!o.empty]]),o.$slots.footer&&(!o.empty||o.showFooterOnEmpty)?(me(),Fe("div",{key:5,class:Pe(`${o.prefixCls}-footer`)},[ct(o.$slots,"footer")],2)):ut("v-if",!0)],2)}var VL=dt(UL,[["render",HL]]),x1=Ke({name:"IconCheck",render(){return Q("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 1024 1024",width:"200",height:"200",fill:"currentColor"},[Q("path",{d:"M877.44815445 206.10060629a64.72691371 64.72691371 0 0 0-95.14856334 4.01306852L380.73381888 685.46812814 235.22771741 533.48933518a64.72691371 64.72691371 0 0 0-92.43003222-1.03563036l-45.82665557 45.82665443a64.72691371 64.72691371 0 0 0-0.90617629 90.61767965l239.61903446 250.10479331a64.72691371 64.72691371 0 0 0 71.19960405 15.14609778 64.33855261 64.33855261 0 0 0 35.08198741-21.23042702l36.24707186-42.71976334 40.5190474-40.77795556-3.36579926-3.49525333 411.40426297-486.74638962a64.72691371 64.72691371 0 0 0-3.88361443-87.64024149l-45.3088404-45.43829334z","p-id":"840"},null)])}});const EI=Symbol("ArcoCheckboxGroup");var Lu=Ke({name:"Checkbox",components:{IconCheck:x1,IconHover:oi},props:{modelValue:{type:[Boolean,Array],default:void 0},defaultChecked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean]},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},uninjectGroupContext:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{disabled:l,modelValue:a}=Pt(o),u=ot("checkbox"),d=ge(),h=o.uninjectGroupContext?void 0:ho(EI,void 0),p=(h==null?void 0:h.name)==="ArcoCheckboxGroup",{mergedDisabled:f,eventHandlers:T}=si({disabled:l}),C=ge(o.defaultChecked),S=j(()=>{var M;return p?h==null?void 0:h.computedValue:(M=o.modelValue)!=null?M:C.value}),P=j(()=>{var M;return jo(S.value)?S.value.includes((M=o.value)!=null?M:!0):S.value}),x=j(()=>(h==null?void 0:h.disabled)||(f==null?void 0:f.value)||!P.value&&(h==null?void 0:h.isMaxed)),G=M=>{M.stopPropagation()},oe=M=>{var L,R,F,z;const{checked:X}=M.target;let le=X;if(jo(S.value)){const $e=new Set(S.value);X?$e.add((L=o.value)!=null?L:!0):$e.delete((R=o.value)!=null?R:!0),le=Array.from($e)}C.value=X,p&&jo(le)?h==null||h.handleChange(le,M):(n("update:modelValue",le),n("change",le,M),(z=(F=T.value)==null?void 0:F.onChange)==null||z.call(F,M)),Io(()=>{d.value&&d.value.checked!==P.value&&(d.value.checked=P.value)})},ne=j(()=>[u,{[`${u}-checked`]:P.value,[`${u}-indeterminate`]:o.indeterminate,[`${u}-disabled`]:x.value}]),Z=M=>{var L,R;(R=(L=T.value)==null?void 0:L.onFocus)==null||R.call(L,M)},Y=M=>{var L,R;(R=(L=T.value)==null?void 0:L.onBlur)==null||R.call(L,M)};return Et(a,M=>{(rs(M)||Tl(M))&&(C.value=!1)}),Et(S,M=>{var L;let R;jo(M)?R=M.includes((L=o.value)!=null?L:!0):R=M,C.value!==R&&(C.value=R),d.value&&d.value.checked!==R&&(d.value.checked=R)}),()=>{var M,L,R,F;return Q("label",{"aria-disabled":x.value,class:ne.value},[Q("input",{ref:d,type:"checkbox",checked:P.value,value:o.value,class:`${u}-target`,disabled:x.value,onClick:G,onChange:oe,onFocus:Z,onBlur:Y},null),(F=(R=(L=s.checkbox)!=null?L:(M=h==null?void 0:h.slots)==null?void 0:M.checkbox)==null?void 0:R({checked:P.value,disabled:x.value}))!=null?F:Q(oi,{class:`${u}-icon-hover`,disabled:x.value||P.value},{default:()=>[Q("div",{class:`${u}-icon`},[P.value&&Q(x1,{class:`${u}-icon-check`},null)])]}),s.default&&Q("span",{class:`${u}-label`},[s.default()])])}}}),R_=Ke({name:"CheckboxGroup",props:{modelValue:{type:Array,default:void 0},defaultValue:{type:Array,default:()=>[]},max:{type:Number},options:{type:Array},direction:{type:String,default:"horizontal"},disabled:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const{disabled:l}=Pt(o),a=ot("checkbox-group"),{mergedDisabled:u,eventHandlers:d}=si({disabled:l}),h=ge(o.defaultValue),p=j(()=>jo(o.modelValue)?o.modelValue:h.value),f=j(()=>o.max===void 0?!1:p.value.length>=o.max),T=j(()=>{var x;return((x=o.options)!=null?x:[]).map(G=>ki(G)||vt(G)?{label:G,value:G}:G)});hn(EI,Jt({name:"ArcoCheckboxGroup",computedValue:p,disabled:u,isMaxed:f,slots:s,handleChange:(x,G)=>{var oe,ne;h.value=x,n("update:modelValue",x),n("change",x,G),(ne=(oe=d.value)==null?void 0:oe.onChange)==null||ne.call(oe,G)}}));const S=j(()=>[a,`${a}-direction-${o.direction}`]);Et(()=>o.modelValue,x=>{jo(x)?h.value=[...x]:h.value=[]});const P=()=>T.value.map(x=>{const G=p.value.includes(x.value);return Q(Lu,{key:x.value,value:x.value,disabled:x.disabled||!G&&f.value,indeterminate:x.indeterminate,modelValue:G},{default:()=>[s.label?s.label({data:x}):bo(x.label)?x.label():x.label]})});return()=>{var x;return Q("span",{class:S.value},[T.value.length>0?P():(x=s.default)==null?void 0:x.call(s)])}}});const GL=Object.assign(Lu,{Group:R_,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+Lu.name,Lu),o.component(s+R_.name,R_)}}),bI=Symbol("ArcoSelectContext");var WL=Object.defineProperty,zL=Object.defineProperties,XL=Object.getOwnPropertyDescriptors,B1=Object.getOwnPropertySymbols,jL=Object.prototype.hasOwnProperty,YL=Object.prototype.propertyIsEnumerable,F1=(o,n,s)=>n in o?WL(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Eg=(o,n)=>{for(var s in n||(n={}))jL.call(n,s)&&F1(o,s,n[s]);if(B1)for(var s of B1(n))YL.call(n,s)&&F1(o,s,n[s]);return o},vI=(o,n)=>zL(o,XL(n));const KL=o=>ko(o)&&"isGroup"in o,II=o=>ko(o)&&"isGroup"in o,QL=(o,n="value")=>String(ko(o)?o[n]:o),xc=(o,n="value")=>ko(o)?`__arco__option__object__${o[n]}`:o||vt(o)||ki(o)?`__arco__option__${typeof o}-${o}`:"",qL=o=>o.has("__arco__option__string-"),JL=(o,{valueKey:n,fieldNames:s,origin:l,index:a=-1})=>{var u;if(ko(o)){const h=o[s.value];return{raw:o,index:a,key:xc(h,n),origin:l,value:h,label:(u=o[s.label])!=null?u:QL(h,n),render:o[s.render],disabled:!!o[s.disabled],tagProps:o[s.tagProps]}}const d={value:o,label:String(o),disabled:!1};return Eg({raw:d,index:a,key:xc(o,n),origin:l},d)},M0=(o,{valueKey:n,fieldNames:s,origin:l,optionInfoMap:a})=>{var u;const d=[];for(const h of o)if(KL(h)){const p=M0((u=h.options)!=null?u:[],{valueKey:n,fieldNames:s,origin:l,optionInfoMap:a});p.length>0&&d.push(vI(Eg({},h),{key:`__arco__group__${h.label}`,options:p}))}else{const p=JL(h,{valueKey:n,fieldNames:s,origin:l});d.push(p),a.get(p.key)||a.set(p.key,p)}return d},U1=(o,{inputValue:n,filterOption:s})=>{const l=a=>{var u;const d=[];for(const h of a)if(II(h)){const p=l((u=h.options)!=null?u:[]);p.length>0&&d.push(vI(Eg({},h),{options:p}))}else hd(h,{inputValue:n,filterOption:s})&&d.push(h);return d};return l(o)},hd=(o,{inputValue:n,filterOption:s})=>bo(s)?!n||s(n,o.raw):s?o.label.toLowerCase().includes((n??"").toLowerCase()):!0,ZL=(o,n)=>{if(!o||!n||o.length!==n.length)return!1;for(const s of Object.keys(o))if(!bg(o[s],n[s]))return!1;return!0},eN=(o,n)=>{if(!o||!n)return!1;const{length:s}=o;if(s!==n.length)return!1;for(let l=0;l{const s=Object.prototype.toString.call(o);return s!==Object.prototype.toString.call(n)?!1:s==="[object Object]"?ZL(o,n):s==="[object Array]"?eN(o,n):s==="[object Function]"?o===n?!0:o.toString()===n.toString():o===n},tN=Ke({name:"Option",components:{Checkbox:GL},props:{value:[String,Number,Object],label:String,disabled:Boolean,tagProps:{type:Object},extra:{type:Object},index:{type:Number},internal:Boolean},setup(o){const{disabled:n,tagProps:s,index:l}=Pt(o),a=ot("select-option"),u=ho(bI,void 0),d=ml(),h=ge(),p=ge(s.value);Et(s,(R,F)=>{bg(R,F)||(p.value=R)});const f=ge(""),T=j(()=>{var R,F;return(F=(R=o.value)!=null?R:o.label)!=null?F:f.value}),C=j(()=>{var R;return(R=o.label)!=null?R:f.value}),S=j(()=>xc(T.value,u==null?void 0:u.valueKey)),P=j(()=>{var R;return(R=u==null?void 0:u.component)!=null?R:"li"}),x=()=>{var R;if(!o.label&&h.value){const F=(R=h.value.textContent)!=null?R:"";f.value!==F&&(f.value=F)}};zt(()=>x()),fl(()=>x());const G=j(()=>{var R;return(R=u==null?void 0:u.valueKeys.includes(S.value))!=null?R:!1}),oe=j(()=>(u==null?void 0:u.activeKey)===S.value);let ne=ge(!0);if(!o.internal){const R=Jt({raw:{value:T,label:C,disabled:n,tagProps:p},ref:h,index:l,key:S,origin:"slot",value:T,label:C,disabled:n,tagProps:p});ne=j(()=>hd(R,{inputValue:u==null?void 0:u.inputValue,filterOption:u==null?void 0:u.filterOption})),d&&(u==null||u.addSlotOptionInfo(d.uid,R)),Ri(()=>{d&&(u==null||u.removeSlotOptionInfo(d.uid))})}const Z=R=>{o.disabled||u==null||u.onSelect(S.value,R)},Y=()=>{o.disabled||u==null||u.setActiveKey(S.value)},M=()=>{o.disabled||u==null||u.setActiveKey()},L=j(()=>[a,{[`${a}-disabled`]:o.disabled,[`${a}-active`]:oe.value,[`${a}-multiple`]:u==null?void 0:u.multiple}]);return{prefixCls:a,cls:L,selectCtx:u,itemRef:h,component:P,isSelected:G,isValid:ne,handleClick:Z,handleMouseEnter:Y,handleMouseLeave:M}}});function oN(o,n,s,l,a,u){const d=_t("checkbox");return Kn((me(),it(cn(o.component),{ref:"itemRef",class:Pe([o.cls,{[`${o.prefixCls}-has-suffix`]:!!o.$slots.suffix}]),onClick:o.handleClick,onMouseenter:o.handleMouseEnter,onMouseleave:o.handleMouseLeave},{default:De(()=>[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),o.selectCtx&&o.selectCtx.multiple?(me(),it(d,{key:1,class:Pe(`${o.prefixCls}-checkbox`),"model-value":o.isSelected,disabled:o.disabled,"uninject-group-context":""},{default:De(()=>[ct(o.$slots,"default",{},()=>[Ut(Ci(o.label),1)])]),_:3},8,["class","model-value","disabled"])):(me(),Fe("span",{key:2,class:Pe(`${o.prefixCls}-content`)},[ct(o.$slots,"default",{},()=>[Ut(Ci(o.label),1)])],2)),o.$slots.suffix?(me(),Fe("span",{key:3,class:Pe(`${o.prefixCls}-suffix`)},[ct(o.$slots,"suffix")],2)):ut("v-if",!0)]),_:3},8,["class","onClick","onMouseenter","onMouseleave"])),[[qn,o.isValid]])}var ll=dt(tN,[["render",oN]]),sN=Object.defineProperty,iN=Object.defineProperties,nN=Object.getOwnPropertyDescriptors,H1=Object.getOwnPropertySymbols,rN=Object.prototype.hasOwnProperty,lN=Object.prototype.propertyIsEnumerable,V1=(o,n,s)=>n in o?sN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,k_=(o,n)=>{for(var s in n||(n={}))rN.call(n,s)&&V1(o,s,n[s]);if(H1)for(var s of H1(n))lN.call(n,s)&&V1(o,s,n[s]);return o},cN=(o,n)=>iN(o,nN(n));const aN={value:"value",label:"label",disabled:"disabled",tagProps:"tagProps",render:"render"},uN=({options:o,extraOptions:n,inputValue:s,filterOption:l,showExtraOptions:a,valueKey:u,fieldNames:d})=>{const h=j(()=>k_(k_({},aN),d==null?void 0:d.value)),p=Jt(new Map),f=j(()=>Array.from(p.values()).sort((Y,M)=>vt(Y.index)&&vt(M.index)?Y.index-M.index:0)),T=j(()=>{var Y,M;const L=new Map;return{optionInfos:M0((Y=o==null?void 0:o.value)!=null?Y:[],{valueKey:(M=u==null?void 0:u.value)!=null?M:"value",fieldNames:h.value,origin:"options",optionInfoMap:L}),optionInfoMap:L}}),C=j(()=>{var Y,M;const L=new Map;return{optionInfos:M0((Y=n==null?void 0:n.value)!=null?Y:[],{valueKey:(M=u==null?void 0:u.value)!=null?M:"value",fieldNames:h.value,origin:"extraOptions",optionInfoMap:L}),optionInfoMap:L}}),S=Jt(new Map);Et([f,o??ge([]),n??ge([]),u??ge("value")],()=>{S.clear(),f.value.forEach((Y,M)=>{S.set(Y.key,cN(k_({},Y),{index:M}))}),T.value.optionInfoMap.forEach(Y=>{S.has(Y.key)||(Y.index=S.size,S.set(Y.key,Y))}),C.value.optionInfoMap.forEach(Y=>{S.has(Y.key)||(Y.index=S.size,S.set(Y.key,Y))})},{immediate:!0,deep:!0});const P=j(()=>{var Y;const M=U1(T.value.optionInfos,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value});return((Y=a==null?void 0:a.value)==null||Y)&&M.push(...U1(C.value.optionInfos,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value})),M}),x=j(()=>Array.from(S.values()).filter(Y=>Y.origin==="extraOptions"&&(a==null?void 0:a.value)===!1?!1:hd(Y,{inputValue:s==null?void 0:s.value,filterOption:l==null?void 0:l.value}))),G=j(()=>x.value.filter(Y=>!Y.disabled).map(Y=>Y.key));return{validOptions:P,optionInfoMap:S,validOptionInfos:x,enabledOptionKeys:G,getNextSlotOptionIndex:()=>p.size,addSlotOptionInfo:(Y,M)=>{p.set(Y,M)},removeSlotOptionInfo:Y=>{p.delete(Y)}}},Ss={ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",TAB:"Tab",SPACE:" ",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight"},G1=o=>JSON.stringify({key:o.key,ctrl:!!o.ctrl,shift:!!o.shift,alt:!!o.alt,meta:!!o.meta}),dN=o=>{const n={};return o.forEach((s,l)=>{const a=ki(l)?{key:l}:l;n[G1(a)]=s}),s=>{const l=G1({key:s.key,ctrl:s.ctrlKey,shift:s.shiftKey,alt:s.altKey,meta:s.metaKey}),a=n[l];a&&(s.stopPropagation(),a(s))}},hN=({multiple:o,options:n,extraOptions:s,inputValue:l,filterOption:a,showExtraOptions:u,component:d,valueKey:h,fieldNames:p,loading:f,popupVisible:T,valueKeys:C,dropdownRef:S,optionRefs:P,virtualListRef:x,onSelect:G,onPopupVisibleChange:oe,enterToOpen:ne=!0,defaultActiveFirstOption:Z})=>{const{validOptions:Y,optionInfoMap:M,validOptionInfos:L,enabledOptionKeys:R,getNextSlotOptionIndex:F,addSlotOptionInfo:z,removeSlotOptionInfo:X}=uN({options:n,extraOptions:s,inputValue:l,filterOption:a,showExtraOptions:u,valueKey:h,fieldNames:p}),le=ge();Et(R,re=>{(!le.value||!re.includes(le.value))&&(le.value=re[0])});const $e=re=>{le.value=re},he=re=>{const Ie=R.value.length;if(Ie===0)return;if(!le.value)return re==="down"?R.value[0]:R.value[Ie-1];const D=R.value.indexOf(le.value),B=(Ie+D+(re==="up"?-1:1))%Ie;return R.value[B]},fe=re=>{var Ie,D;x!=null&&x.value&&x.value.scrollTo({key:re});const B=M.get(re),ae=(Ie=S==null?void 0:S.value)==null?void 0:Ie.wrapperRef,_e=(D=P==null?void 0:P.value[re])!=null?D:B==null?void 0:B.ref;if(!ae||!_e||ae.scrollHeight===ae.offsetHeight)return;const Me=Ck(_e,ae),Xe=ae.scrollTop;Me.top<0?ae.scrollTo(0,Xe+Me.top):Me.bottom<0&&ae.scrollTo(0,Xe-Me.bottom)};Et(T,re=>{var Ie;if(re){const D=C.value[C.value.length-1];let B=(Ie=Z==null?void 0:Z.value)==null||Ie?R.value[0]:void 0;R.value.includes(D)&&(B=D),B!==le.value&&(le.value=B),Io(()=>{le.value&&fe(le.value)})}});const ke=dN(new Map([[Ss.ENTER,re=>{!(f!=null&&f.value)&&!re.isComposing&&(T.value?le.value&&(G(le.value,re),re.preventDefault()):ne&&(oe(!0),re.preventDefault()))}],[Ss.ESC,re=>{T.value&&(oe(!1),re.preventDefault())}],[Ss.ARROW_DOWN,re=>{if(T.value){const Ie=he("down");Ie&&(le.value=Ie,fe(Ie)),re.preventDefault()}}],[Ss.ARROW_UP,re=>{if(T.value){const Ie=he("up");Ie&&(le.value=Ie,fe(Ie)),re.preventDefault()}}]]));return hn(bI,Jt({multiple:o,valueKey:h,inputValue:l,filterOption:a,component:d,valueKeys:C,activeKey:le,setActiveKey:$e,onSelect:G,getNextSlotOptionIndex:F,addSlotOptionInfo:z,removeSlotOptionInfo:X})),{validOptions:Y,optionInfoMap:M,validOptionInfos:L,enabledOptionKeys:R,activeKey:le,setActiveKey:$e,addSlotOptionInfo:z,removeSlotOptionInfo:X,getNextActiveKey:he,scrollIntoView:fe,handleKeyDown:ke}},pN=({dataKeys:o,contentRef:n,fixedSize:s,estimatedSize:l,buffer:a})=>{const u=ge(0),d=new Map,h=j(()=>o.value.length),p=ge(0),f=j(()=>{const F=p.value+a.value*3;return F>h.value?h.value:F}),T=j(()=>{const F=h.value-a.value*3;return F<0?0:F}),C=F=>{F<0?p.value=0:F>T.value?p.value=T.value:p.value=F},S=ge(s.value),P=j(()=>l.value!==30?l.value:u.value||l.value),x=(F,z)=>{d.set(F,z)},G=F=>{var z;if(S.value)return P.value;const X=o.value[F];return(z=d.get(X))!=null?z:P.value},oe=F=>d.has(F);zt(()=>{const F=Array.from(d.values()).reduce((z,X)=>z+X,0);F>0&&(u.value=F/d.size)});const ne=F=>S.value?P.value*F:Z(0,F),Z=(F,z)=>{let X=0;for(let le=F;leS.value?P.value*p.value:Z(0,p.value)),M=F=>{const z=F>=Y.value;let X=Math.abs(F-Y.value);const le=z?p.value:p.value-1;let $e=0;for(;X>0;)X-=G(le+$e),z?$e++:$e--;return $e},L=F=>{const z=M(F),X=p.value+z-a.value;return X<0?0:X>T.value?T.value:X},R=j(()=>S.value?P.value*(h.value-f.value):Z(f.value,h.value));return{frontPadding:Y,behindPadding:R,start:p,end:f,getStartByScroll:L,setItemSize:x,hasItemSize:oe,setStart:C,getScrollOffset:ne}};var $N=Ke({name:"VirtualListItem",props:{hasItemSize:{type:Function,required:!0},setItemSize:{type:Function,required:!0}},setup(o,{slots:n}){var s;const l=(s=ml())==null?void 0:s.vnode.key,a=ge(),u=()=>{var d,h,p,f;const T=(h=(d=a.value)==null?void 0:d.$el)!=null?h:a.value,C=(f=(p=T==null?void 0:T.getBoundingClientRect)==null?void 0:p.call(T).height)!=null?f:T==null?void 0:T.offsetHeight;C&&o.setItemSize(l,C)};return zt(()=>u()),Ri(()=>u()),()=>{var d;const h=rl((d=n.default)==null?void 0:d.call(n));return h?gs(h,{ref:a},!0):null}}}),_N=Object.defineProperty,W1=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,fN=Object.prototype.propertyIsEnumerable,z1=(o,n,s)=>n in o?_N(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,mN=(o,n)=>{for(var s in n||(n={}))gN.call(n,s)&&z1(o,s,n[s]);if(W1)for(var s of W1(n))fN.call(n,s)&&z1(o,s,n[s]);return o};const TN=Ke({name:"VirtualList",components:{VirtualListItem:$N},props:{height:{type:[Number,String],default:200},data:{type:Array,default:()=>[]},threshold:{type:Number,default:0},itemKey:{type:String,default:"key"},fixedSize:{type:Boolean,default:!1},estimatedSize:{type:Number,default:30},buffer:{type:Number,default:10},component:{type:[String,Object],default:"div"},listAttrs:{type:Object},contentAttrs:{type:Object},paddingPosition:{type:String,default:"content"}},emits:{scroll:o=>!0,reachBottom:o=>!0},setup(o,{emit:n}){const{data:s,itemKey:l,fixedSize:a,estimatedSize:u,buffer:d,height:h}=Pt(o),p=ot("virtual-list"),f=j(()=>ko(o.component)?mN({container:"div",list:"div",content:"div"},o.component):{container:o.component,list:"div",content:"div"}),T=ge(),C=ge(),S=j(()=>({height:vt(h.value)?`${h.value}px`:h.value,overflow:"auto"})),P=j(()=>s.value.map((he,fe)=>{var ke;return(ke=he[l.value])!=null?ke:fe})),{frontPadding:x,behindPadding:G,start:oe,end:ne,getStartByScroll:Z,setItemSize:Y,hasItemSize:M,setStart:L,getScrollOffset:R}=pN({dataKeys:P,contentRef:C,fixedSize:a,estimatedSize:u,buffer:d}),F=ge(!0),z=Jt({scrollTop:0,scrollHeight:0});Et(P,()=>{F.value=!1});const X=j(()=>o.threshold&&s.value.length<=o.threshold?s.value:s.value.slice(oe.value,ne.value)),le=he=>{const{scrollTop:fe,scrollHeight:ke,offsetHeight:re}=he.target;if(F.value){z.scrollTop=fe,z.scrollHeight=ke;const Ie=Z(fe);Ie!==oe.value&&L(Ie),n("scroll",he),Math.floor(ke-(fe+re))<=0&&n("reachBottom",he)}else ke!==z.scrollHeight&&(F.value=!0,setTimeout(()=>{$e(z.scrollTop)},10)),$e(z.scrollTop)},$e=he=>{var fe,ke;if(T.value)if(vt(he))T.value.scrollTop=he;else{const re=(ke=he.index)!=null?ke:P.value.indexOf((fe=he.key)!=null?fe:"");L(re-d.value),T.value.scrollTop=R(re),Io(()=>{if(T.value){const Ie=R(re);Ie!==T.value.scrollTop&&(T.value.scrollTop=Ie)}})}};return{prefixCls:p,containerRef:T,contentRef:C,frontPadding:x,currentList:X,behindPadding:G,onScroll:le,setItemSize:Y,hasItemSize:M,start:oe,scrollTo:$e,style:S,mergedComponent:f}}});function EN(o,n,s,l,a,u){const d=_t("VirtualListItem");return me(),it(cn(o.mergedComponent.container),{ref:"containerRef",class:Pe(o.prefixCls),style:It(o.style),onScroll:o.onScroll},{default:De(()=>[(me(),it(cn(o.mergedComponent.list),Ot(o.listAttrs,{style:o.paddingPosition==="list"?{paddingTop:`${o.frontPadding}px`,paddingBottom:`${o.behindPadding}px`}:{}}),{default:De(()=>[(me(),it(cn(o.mergedComponent.content),Ot({ref:"contentRef"},o.contentAttrs,{style:o.paddingPosition==="content"?{paddingTop:`${o.frontPadding}px`,paddingBottom:`${o.behindPadding}px`}:{}}),{default:De(()=>[(me(!0),Fe(Wt,null,id(o.currentList,(h,p)=>{var f;return me(),it(d,{key:(f=h[o.itemKey])!=null?f:o.start+p,"has-item-size":o.hasItemSize,"set-item-size":o.setItemSize},{default:De(()=>[ct(o.$slots,"item",{item:h,index:o.start+p})]),_:2},1032,["has-item-size","set-item-size"])}),128))]),_:3},16,["style"]))]),_:3},16,["style"]))]),_:3},8,["class","style","onScroll"])}var bN=dt(TN,[["render",EN]]);const vN=Ke({name:"IconDown",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-down`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),IN=["stroke-width","stroke-linecap","stroke-linejoin"],ON=Le("path",{d:"M39.6 17.443 24.043 33 8.487 17.443"},null,-1),CN=[ON];function yN(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},CN,14,IN)}var A_=dt(vN,[["render",yN]]);const SN=Object.assign(A_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+A_.name,A_)}}),RN=Symbol("ArcoDropdown"),kN=({popupVisible:o,defaultPopupVisible:n,emit:s})=>{var l;const a=ge((l=n==null?void 0:n.value)!=null?l:!1),u=j(()=>{var h;return(h=o==null?void 0:o.value)!=null?h:a.value}),d=h=>{h!==u.value&&(a.value=h,s("update:popupVisible",h),s("popupVisibleChange",h))};return Et(u,h=>{a.value!==h&&(a.value=h)}),{computedPopupVisible:u,handlePopupVisibleChange:d}},AN=Ke({name:"Doption",props:{value:{type:[String,Number,Object]},disabled:{type:Boolean,default:!1},active:Boolean,uninjectContext:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("dropdown-option"),l=ge(),a=j(()=>{var p,f,T;return(T=(f=o.value)!=null?f:(p=l.value)==null?void 0:p.textContent)!=null?T:void 0}),u=o.uninjectContext?void 0:ho(RN,void 0),d=p=>{o.disabled||(n("click",p),u==null||u.onOptionClick(a.value,p))},h=j(()=>[s,{[`${s}-disabled`]:o.disabled,[`${s}-active`]:o.active}]);return{prefixCls:s,cls:h,liRef:l,handleClick:d}}});function LN(o,n,s,l,a,u){return me(),Fe("li",{ref:"liRef",class:Pe([o.cls,{[`${o.prefixCls}-has-suffix`]:!!o.$slots.suffix}]),onClick:n[0]||(n[0]=(...d)=>o.handleClick&&o.handleClick(...d))},[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),Le("span",{class:Pe(`${o.prefixCls}-content`)},[ct(o.$slots,"default")],2),o.$slots.suffix?(me(),Fe("span",{key:1,class:Pe(`${o.prefixCls}-suffix`)},[ct(o.$slots,"suffix")],2)):ut("v-if",!0)],2)}var NN=dt(AN,[["render",LN]]);const wN=Ke({name:"IconRight",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-right`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),MN=["stroke-width","stroke-linecap","stroke-linejoin"],DN=Le("path",{d:"m16 39.513 15.556-15.557L16 8.4"},null,-1),PN=[DN];function xN(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},PN,14,MN)}var L_=dt(wN,[["render",xN]]);const OI=Object.assign(L_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+L_.name,L_)}});var Do=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function CI(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}const BN=({defaultValue:o,modelValue:n,emit:s,eventName:l="input",updateEventName:a="update:modelValue",eventHandlers:u})=>{var d;const h=ge(),p=ge((d=o==null?void 0:o.value)!=null?d:""),f=ge(!1),T=ge(!1),C=ge("");let S;const P=j(()=>{var R;return(R=n==null?void 0:n.value)!=null?R:p.value}),x=(R,F)=>{p.value=R,s(a,R),s(l,R,F)},G=R=>{const{value:F}=R.target;T.value||(x(F,R),Io(()=>{h.value&&P.value!==h.value.value&&(h.value.value=P.value)}))},oe=R=>{l==="input"&&P.value!==S&&(S=P.value,s("change",P.value,R))},ne=R=>{var F;const{value:z}=R.target;R.type==="compositionend"?(T.value=!1,C.value="",x(z,R),Io(()=>{h.value&&P.value!==h.value.value&&(h.value.value=P.value)})):(T.value=!0,C.value=P.value+((F=R.data)!=null?F:""))},Z=R=>{var F,z;f.value=!0,S=P.value,s("focus",R),(z=(F=u==null?void 0:u.value)==null?void 0:F.onFocus)==null||z.call(F,R)},Y=R=>{var F,z;f.value=!1,s("blur",R),(z=(F=u==null?void 0:u.value)==null?void 0:F.onBlur)==null||z.call(F,R),oe(R)},M=R=>{const F=R.key||R.code;!T.value&&F===gg.key&&(s("pressEnter",R),oe(R))},L=R=>{h.value&&R.target!==h.value&&(R.preventDefault(),h.value.focus())};return Et(P,R=>{h.value&&R!==h.value.value&&(h.value.value=R)}),{inputRef:h,_value:p,_focused:f,isComposition:T,compositionValue:C,computedValue:P,handleInput:G,handleComposition:ne,handleFocus:Z,handleBlur:Y,handleKeyDown:M,handleMousedown:L}};var FN=Ke({name:"InputLabel",inheritAttrs:!1,props:{modelValue:Object,inputValue:{type:String,default:""},enabledInput:Boolean,formatLabel:Function,placeholder:String,retainInputValue:Boolean,disabled:Boolean,baseCls:String,size:String,error:Boolean,focused:Boolean,uninjectFormItemContext:Boolean},emits:["update:inputValue","inputValueChange","focus","blur"],setup(o,{attrs:n,emit:s,slots:l}){var a;const{size:u,disabled:d,error:h,inputValue:p,uninjectFormItemContext:f}=Pt(o),T=(a=o.baseCls)!=null?a:ot("input-label"),{mergedSize:C,mergedDisabled:S,mergedError:P,eventHandlers:x}=si({size:u,disabled:d,error:h,uninject:f==null?void 0:f.value}),{mergedSize:G}=nr(C),{inputRef:oe,_focused:ne,computedValue:Z,handleInput:Y,handleComposition:M,handleFocus:L,handleBlur:R,handleMousedown:F}=BN({modelValue:p,emit:s,eventName:"inputValueChange",updateEventName:"update:inputValue",eventHandlers:x}),z=j(()=>{var D;return(D=o.focused)!=null?D:ne.value}),X=j(()=>o.enabledInput&&ne.value||!o.modelValue),le=()=>{var D,B;return o.modelValue?(B=(D=o.formatLabel)==null?void 0:D.call(o,o.modelValue))!=null?B:o.modelValue.label:""},$e=j(()=>o.enabledInput&&o.modelValue?le():o.placeholder),he=()=>{var D,B;return o.modelValue?(B=(D=l.default)==null?void 0:D.call(l,{data:o.modelValue}))!=null?B:le():null},fe=j(()=>[T,`${T}-size-${G.value}`,{[`${T}-search`]:o.enabledInput,[`${T}-focus`]:z.value,[`${T}-disabled`]:S.value,[`${T}-error`]:P.value}]),ke=j(()=>Hc(n,hl)),re=j(()=>fg(n,hl));return{inputRef:oe,render:()=>Q("span",Ot(ke.value,{class:fe.value,title:le(),onMousedown:F}),[l.prefix&&Q("span",{class:`${T}-prefix`},[l.prefix()]),Q("input",Ot(re.value,{ref:oe,class:[`${T}-input`,{[`${T}-input-hidden`]:!X.value}],value:Z.value,readonly:!o.enabledInput,placeholder:$e.value,disabled:S.value,onInput:Y,onFocus:L,onBlur:R,onCompositionstart:M,onCompositionupdate:M,onCompositionend:M}),null),Q("span",{class:[`${T}-value`,{[`${T}-value-hidden`]:X.value}]},[he()]),l.suffix&&Q("span",{class:`${T}-suffix`},[l.suffix()])])}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}}),UN=Object.defineProperty,X1=Object.getOwnPropertySymbols,HN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,j1=(o,n,s)=>n in o?UN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,GN=(o,n)=>{for(var s in n||(n={}))HN.call(n,s)&&j1(o,s,n[s]);if(X1)for(var s of X1(n))VN.call(n,s)&&j1(o,s,n[s]);return o};const WN=(o,n)=>{const s=[];for(const l of o)if(ko(l))s.push({raw:l,value:l[n.value],label:l[n.label],closable:l[n.closable],tagProps:l[n.tagProps]});else if(o||vt(o)){const a={value:l,label:String(l),closable:!0};s.push(GN({raw:a},a))}return s},Y1=["red","orangered","orange","gold","lime","green","cyan","blue","arcoblue","purple","pinkpurple","magenta","gray"],zN=Ke({name:"Tag",components:{IconHover:oi,IconClose:El,IconLoading:ir},props:{color:{type:String},size:{type:String},bordered:{type:Boolean,default:!1},visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},checkable:{type:Boolean,default:!1},checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:!0}},emits:{"update:visible":o=>!0,"update:checked":o=>!0,close:o=>!0,check:(o,n)=>!0},setup(o,{emit:n}){const{size:s}=Pt(o),l=ot("tag"),a=j(()=>o.color&&Y1.includes(o.color)),u=j(()=>o.color&&!Y1.includes(o.color)),d=ge(o.defaultVisible),h=ge(o.defaultChecked),p=j(()=>{var oe;return(oe=o.visible)!=null?oe:d.value}),f=j(()=>{var oe;return o.checkable?(oe=o.checked)!=null?oe:h.value:!0}),{mergedSize:T}=nr(s),C=j(()=>T.value==="mini"?"small":T.value),S=oe=>{d.value=!1,n("update:visible",!1),n("close",oe)},P=oe=>{if(o.checkable){const ne=!f.value;h.value=ne,n("update:checked",ne),n("check",ne,oe)}},x=j(()=>[l,`${l}-size-${C.value}`,{[`${l}-loading`]:o.loading,[`${l}-hide`]:!p.value,[`${l}-${o.color}`]:a.value,[`${l}-bordered`]:o.bordered,[`${l}-checkable`]:o.checkable,[`${l}-checked`]:f.value,[`${l}-custom-color`]:u.value}]),G=j(()=>{if(u.value)return{backgroundColor:o.color}});return{prefixCls:l,cls:x,style:G,computedVisible:p,computedChecked:f,handleClick:P,handleClose:S}}});function XN(o,n,s,l,a,u){const d=_t("icon-close"),h=_t("icon-hover"),p=_t("icon-loading");return o.computedVisible?(me(),Fe("span",{key:0,class:Pe(o.cls),style:It(o.style),onClick:n[0]||(n[0]=(...f)=>o.handleClick&&o.handleClick(...f))},[o.$slots.icon?(me(),Fe("span",{key:0,class:Pe(`${o.prefixCls}-icon`)},[ct(o.$slots,"icon")],2)):ut("v-if",!0),ct(o.$slots,"default"),o.closable?(me(),it(h,{key:1,role:"button","aria-label":"Close",prefix:o.prefixCls,class:Pe(`${o.prefixCls}-close-btn`),onClick:er(o.handleClose,["stop"])},{default:De(()=>[ct(o.$slots,"close-icon",{},()=>[Q(d)])]),_:3},8,["prefix","class","onClick"])):ut("v-if",!0),o.loading?(me(),Fe("span",{key:2,class:Pe(`${o.prefixCls}-loading-icon`)},[Q(p)],2)):ut("v-if",!0)],6)):ut("v-if",!0)}var N_=dt(zN,[["render",XN]]);const jN=Object.assign(N_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+N_.name,N_)}});var YN=Object.defineProperty,K1=Object.getOwnPropertySymbols,KN=Object.prototype.hasOwnProperty,QN=Object.prototype.propertyIsEnumerable,Q1=(o,n,s)=>n in o?YN(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,vu=(o,n)=>{for(var s in n||(n={}))KN.call(n,s)&&Q1(o,s,n[s]);if(K1)for(var s of K1(n))QN.call(n,s)&&Q1(o,s,n[s]);return o};const qN={value:"value",label:"label",closable:"closable",tagProps:"tagProps"};var w_=Ke({name:"InputTag",inheritAttrs:!1,props:{modelValue:{type:Array},defaultValue:{type:Array,default:()=>[]},inputValue:String,defaultInputValue:{type:String,default:""},placeholder:String,disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},size:{type:String},maxTagCount:{type:Number,default:0},retainInputValue:{type:[Boolean,Object],default:!1},formatTag:{type:Function},uniqueValue:{type:Boolean,default:!1},fieldNames:{type:Object},baseCls:String,focused:Boolean,disabledInput:Boolean,uninjectFormItemContext:Boolean},emits:{"update:modelValue":o=>!0,"update:inputValue":o=>!0,change:(o,n)=>!0,inputValueChange:(o,n)=>!0,pressEnter:(o,n)=>!0,remove:(o,n)=>!0,clear:o=>!0,focus:o=>!0,blur:o=>!0},setup(o,{emit:n,slots:s,attrs:l}){const{size:a,disabled:u,error:d,uninjectFormItemContext:h,modelValue:p}=Pt(o),f=o.baseCls||ot("input-tag"),T=ge(),C=ge(),{mergedSize:S,mergedDisabled:P,mergedError:x,feedback:G,eventHandlers:oe}=si({size:a,disabled:u,error:d,uninject:h==null?void 0:h.value}),{mergedSize:ne}=nr(S),Z=j(()=>vu(vu({},qN),o.fieldNames)),Y=ge(!1),M=ge(o.defaultValue),L=ge(o.defaultInputValue),R=ge(!1),F=ge(""),z=j(()=>ko(o.retainInputValue)?vu({create:!1,blur:!1},o.retainInputValue):{create:o.retainInputValue,blur:o.retainInputValue}),X=Jt({width:"12px"}),le=j(()=>o.focused||Y.value),$e=(A,K)=>{L.value=A,n("update:inputValue",A),n("inputValueChange",A,K)},he=A=>{var K;const{value:U}=A.target;A.type==="compositionend"?(R.value=!1,F.value="",$e(U,A),Io(()=>{T.value&&ke.value!==T.value.value&&(T.value.value=ke.value)})):(R.value=!0,F.value=ke.value+((K=A.data)!=null?K:""))},fe=j(()=>{var A;return(A=o.modelValue)!=null?A:M.value}),ke=j(()=>{var A;return(A=o.inputValue)!=null?A:L.value});Et(p,A=>{(rs(A)||Tl(A))&&(M.value=[])});const re=A=>{T.value&&A.target!==T.value&&(A.preventDefault(),T.value.focus())},Ie=A=>{const{value:K}=A.target;R.value||($e(K,A),Io(()=>{T.value&&ke.value!==T.value.value&&(T.value.value=ke.value)}))},D=j(()=>WN(fe.value,Z.value)),B=j(()=>{if(o.maxTagCount>0){const A=D.value.length-o.maxTagCount;if(A>0){const K=D.value.slice(0,o.maxTagCount),U={value:"__arco__more",label:`+${A}...`,closable:!1};return K.push(vu({raw:U},U)),K}}return D.value}),ae=(A,K)=>{var U,de;M.value=A,n("update:modelValue",A),n("change",A,K),(de=(U=oe.value)==null?void 0:U.onChange)==null||de.call(U,K)},_e=(A,K,U)=>{var de;const Te=(de=fe.value)==null?void 0:de.filter((se,Ce)=>Ce!==K);ae(Te,U),n("remove",A,U)},Me=A=>{ae([],A),n("clear",A)},Xe=j(()=>!P.value&&!o.readonly&&o.allowClear&&!!fe.value.length),Je=A=>{var K;if(ke.value){if(A.preventDefault(),o.uniqueValue&&((K=fe.value)!=null&&K.includes(ke.value))){n("pressEnter",ke.value,A);return}const U=fe.value.concat(ke.value);ae(U,A),n("pressEnter",ke.value,A),z.value.create||$e("",A)}},we=A=>{var K,U;Y.value=!0,n("focus",A),(U=(K=oe.value)==null?void 0:K.onFocus)==null||U.call(K,A)},We=A=>{var K,U;Y.value=!1,!z.value.blur&&ke.value&&$e("",A),n("blur",A),(U=(K=oe.value)==null?void 0:K.onBlur)==null||U.call(K,A)},Ze=()=>{for(let A=D.value.length-1;A>=0;A--)if(D.value[A].closable)return A;return-1},nt=A=>{const K=A.key||A.code;if(!R.value&&ke.value&&K===gg.key&&Je(A),!R.value&&B.value.length>0&&!ke.value&&K===uA.key){const U=Ze();U>=0&&_e(D.value[U].value,U,A)}},ht=A=>{A>12?X.width=`${A}px`:X.width="12px"};zt(()=>{C.value&&ht(C.value.offsetWidth)});const et=()=>{C.value&&ht(C.value.offsetWidth)};Et(ke,A=>{T.value&&!R.value&&A!==T.value.value&&(T.value.value=A)});const xe=j(()=>[f,`${f}-size-${ne.value}`,{[`${f}-disabled`]:P.value,[`${f}-disabled-input`]:o.disabledInput,[`${f}-error`]:x.value,[`${f}-focus`]:le.value,[`${f}-readonly`]:o.readonly,[`${f}-has-tag`]:B.value.length>0,[`${f}-has-prefix`]:!!s.prefix,[`${f}-has-suffix`]:!!s.suffix||Xe.value||G.value,[`${f}-has-placeholder`]:!fe.value.length}]),w=j(()=>Hc(l,hl)),I=j(()=>fg(l,hl));return{inputRef:T,render:()=>{var A;return Q("span",Ot({class:xe.value,onMousedown:re},w.value),[Q(cI,{onResize:et},{default:()=>[Q("span",{ref:C,class:`${f}-mirror`},[B.value.length>0?F.value||ke.value:F.value||ke.value||o.placeholder])]}),s.prefix&&Q("span",{class:`${f}-prefix`},[s.prefix()]),Q(M3,{tag:"span",name:"input-tag-zoom",class:`${f}-inner`},{default:()=>[B.value.map((K,U)=>Q(jN,Ot({key:`tag-${K.value}`,class:`${f}-tag`,closable:!P.value&&!o.readonly&&K.closable,visible:!0},K.tagProps,{onClose:de=>_e(K.value,U,de)}),{default:()=>{var de,Te,se,Ce;return[(Ce=(se=(de=s.tag)==null?void 0:de.call(s,{data:K.raw}))!=null?se:(Te=o.formatTag)==null?void 0:Te.call(o,K.raw))!=null?Ce:K.label]}})),Q("input",Ot(I.value,{ref:T,key:"input-tag-input",class:`${f}-input`,style:X,placeholder:B.value.length===0?o.placeholder:void 0,disabled:P.value,readonly:o.readonly||o.disabledInput,onInput:Ie,onKeydown:nt,onFocus:we,onBlur:We,onCompositionstart:he,onCompositionupdate:he,onCompositionend:he}),null)]}),Xe.value&&Q(oi,{class:`${f}-clear-btn`,onClick:Me,onMousedown:K=>K.stopPropagation()},{default:()=>[Q(El,null,null)]}),(s.suffix||!!G.value)&&Q("span",{class:`${f}-suffix`},[(A=s.suffix)==null?void 0:A.call(s),!!G.value&&Q(_g,{type:G.value},null)])])}}},methods:{focus(){var o;(o=this.inputRef)==null||o.focus()},blur(){var o;(o=this.inputRef)==null||o.blur()}},render(){return this.render()}});const JN=Object.assign(w_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+w_.name,w_)}});var q1=Ke({name:"SelectView",props:{modelValue:{type:Array,required:!0},inputValue:String,placeholder:String,disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},opened:{type:Boolean,default:!1},size:{type:String},bordered:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},allowSearch:{type:Boolean,default:o=>jo(o.modelValue)},maxTagCount:{type:Number,default:0},retainInputValue:{type:Boolean,default:!1}},emits:["remove","clear","focus","blur"],setup(o,{emit:n,slots:s}){const{size:l,disabled:a,error:u}=Pt(o),d=ot("select-view"),{feedback:h,eventHandlers:p,mergedDisabled:f,mergedSize:T,mergedError:C}=si({size:l,disabled:a,error:u}),{mergedSize:S}=nr(T),{opened:P}=Pt(o),x=ge(),G=j(()=>{var $e;return($e=x.value)==null?void 0:$e.inputRef}),oe=j(()=>o.modelValue.length===0),ne=j(()=>o.allowSearch||o.allowCreate),Z=j(()=>o.allowClear&&!o.disabled&&!oe.value),Y=$e=>{var he,fe;n("focus",$e),(fe=(he=p.value)==null?void 0:he.onFocus)==null||fe.call(he,$e)},M=$e=>{var he,fe;n("blur",$e),(fe=(he=p.value)==null?void 0:he.onBlur)==null||fe.call(he,$e)},L=$e=>{n("remove",$e)},R=$e=>{n("clear",$e)},F=()=>{var $e,he,fe,ke;return o.loading?(he=($e=s["loading-icon"])==null?void 0:$e.call(s))!=null?he:Q(ir,null,null):o.allowSearch&&o.opened?(ke=(fe=s["search-icon"])==null?void 0:fe.call(s))!=null?ke:Q(N0,null,null):s["arrow-icon"]?s["arrow-icon"]():Q(SN,{class:`${d}-arrow-icon`},null)},z=()=>Q(Wt,null,[Z.value&&Q(oi,{class:`${d}-clear-btn`,onClick:R,onMousedown:$e=>$e.stopPropagation()},{default:()=>[Q(El,null,null)]}),Q("span",{class:`${d}-icon`},[F()]),!!h.value&&Q(_g,{type:h.value},null)]);Et(P,$e=>{!$e&&G.value&&G.value.isSameNode(document.activeElement)&&G.value.blur()});const X=j(()=>[`${d}-${o.multiple?"multiple":"single"}`,{[`${d}-opened`]:o.opened,[`${d}-borderless`]:!o.bordered}]);return{inputRef:G,handleFocus:Y,handleBlur:M,render:()=>o.multiple?Q(JN,{ref:x,baseCls:d,class:X.value,modelValue:o.modelValue,inputValue:o.inputValue,focused:o.opened,placeholder:o.placeholder,disabled:f.value,size:S.value,error:C.value,maxTagCount:o.maxTagCount,disabledInput:!o.allowSearch&&!o.allowCreate,retainInputValue:!0,uninjectFormItemContext:!0,onRemove:L,onFocus:Y,onBlur:M},{prefix:s.prefix,suffix:z,tag:s.label}):Q(FN,{ref:x,baseCls:d,class:X.value,modelValue:o.modelValue[0],inputValue:o.inputValue,focused:o.opened,placeholder:o.placeholder,disabled:f.value,size:S.value,error:C.value,enabledInput:ne.value,uninjectFormItemContext:!0,onFocus:Y,onBlur:M},{default:s.label,prefix:s.prefix,suffix:z})}},methods:{focus(){this.inputRef&&this.inputRef.focus()},blur(){this.inputRef&&this.inputRef.blur()}},render(){return this.render()}});const ZN=Ke({name:"Optgroup",props:{label:{type:String}},setup(){return{prefixCls:ot("select-group")}}});function ew(o,n,s,l,a,u){return me(),Fe(Wt,null,[Le("li",{class:Pe(`${o.prefixCls}-title`)},[ct(o.$slots,"label",{},()=>[Ut(Ci(o.label),1)])],2),ct(o.$slots,"default")],64)}var Nu=dt(ZN,[["render",ew]]);const J1=typeof window>"u"?global:window;function tw(o,n){let s=0;return(...l)=>{s&&J1.clearTimeout(s),s=J1.setTimeout(()=>{s=0,o(...l)},n)}}var ow=Object.defineProperty,sw=Object.defineProperties,iw=Object.getOwnPropertyDescriptors,Z1=Object.getOwnPropertySymbols,nw=Object.prototype.hasOwnProperty,rw=Object.prototype.propertyIsEnumerable,eb=(o,n,s)=>n in o?ow(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,gc=(o,n)=>{for(var s in n||(n={}))nw.call(n,s)&&eb(o,s,n[s]);if(Z1)for(var s of Z1(n))rw.call(n,s)&&eb(o,s,n[s]);return o},lw=(o,n)=>sw(o,iw(n));function cw(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!al(o)}const aw={value:"value",label:"label",disabled:"disabled",tagProps:"tagProps",render:"render"};var M_=Ke({name:"Select",components:{Trigger:zu,SelectView:q1},inheritAttrs:!1,props:{multiple:{type:Boolean,default:!1},modelValue:{type:[String,Number,Object,Array]},defaultValue:{type:[String,Number,Object,Array],default:o=>rs(o.multiple)?"":[]},inputValue:{type:String},defaultInputValue:{type:String,default:""},size:{type:String},placeholder:String,loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},error:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!1},allowSearch:{type:[Boolean,Object],default:o=>!!o.multiple},allowCreate:{type:Boolean,default:!1},maxTagCount:{type:Number,default:0},popupContainer:{type:[String,Object]},bordered:{type:Boolean,default:!0},defaultActiveFirstOption:{type:Boolean,default:!0},popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},unmountOnClose:{type:Boolean,default:!1},filterOption:{type:[Boolean,Function],default:!0},options:{type:Array,default:()=>[]},virtualListProps:{type:Object},triggerProps:{type:Object},formatLabel:{type:Function},fallbackOption:{type:[Boolean,Function],default:!0},showExtraOptions:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},searchDelay:{type:Number,default:500},limit:{type:Number,default:0},fieldNames:{type:Object},scrollbar:{type:[Boolean,Object],default:!0},showHeaderOnEmpty:{type:Boolean,default:!1},showFooterOnEmpty:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,"update:inputValue":o=>!0,"update:popupVisible":o=>!0,change:o=>!0,inputValueChange:o=>!0,popupVisibleChange:o=>!0,clear:o=>!0,remove:o=>!0,search:o=>!0,dropdownScroll:o=>!0,dropdownReachBottom:o=>!0,exceedLimit:(o,n)=>!0},setup(o,{slots:n,emit:s,attrs:l}){const{size:a,disabled:u,error:d,options:h,filterOption:p,valueKey:f,multiple:T,popupVisible:C,showExtraOptions:S,modelValue:P,fieldNames:x,loading:G,defaultActiveFirstOption:oe}=Pt(o),ne=ot("select"),{mergedSize:Z,mergedDisabled:Y,mergedError:M,eventHandlers:L}=si({size:a,disabled:u,error:d}),R=j(()=>o.virtualListProps?"div":"li"),F=j(()=>ko(o.allowSearch)&&!!o.allowSearch.retainInputValue);j(()=>{if(bo(o.formatLabel))return ee=>{const ie=de.get(ee.value);return o.formatLabel(ie)}});const z=ge(),X=ge({}),le=ge(),{computedPopupVisible:$e,handlePopupVisibleChange:he}=kN({popupVisible:C,emit:s}),fe=ge(o.defaultValue),ke=j(()=>{var ee;const ie=(ee=o.modelValue)!=null?ee:fe.value;return(jo(ie)?ie:ie||vt(ie)||ki(ie)?[ie]:[]).map(ye=>({value:ye,key:xc(ye,o.valueKey)}))});Et(P,ee=>{(rs(ee)||Tl(ee))&&(fe.value=T.value?[]:ee)});const re=j(()=>ke.value.map(ee=>ee.key)),Ie=j(()=>gc(gc({},aw),x==null?void 0:x.value)),D=ge(),B=ee=>{const ie={};return ee.forEach(ue=>{ie[ue]=de.get(ue)}),ie},ae=ee=>{D.value=B(ee)},_e=ee=>bo(o.fallbackOption)?o.fallbackOption(ee):{[Ie.value.value]:ee,[Ie.value.label]:String(ko(ee)?ee[f==null?void 0:f.value]:ee)},Me=()=>{const ee=[],ie=[];if(o.allowCreate||o.fallbackOption){for(const ue of ke.value)if(!ie.includes(ue.key)&&ue.value!==""){const ye=de.get(ue.key);(!ye||ye.origin==="extraOptions")&&(ee.push(ue),ie.push(ue.key))}}if(o.allowCreate&&We.value){const ue=xc(We.value);if(!ie.includes(ue)){const ye=de.get(ue);(!ye||ye.origin==="extraOptions")&&ee.push({value:We.value,key:ue})}}return ee},Xe=ge([]),Je=j(()=>Xe.value.map(ee=>{var ie;let ue=_e(ee.value);const ye=(ie=D.value)==null?void 0:ie[ee.key];return!rs(ye)&&!W3(ye)&&(ue=gc(gc({},ue),ye)),ue}));Io(()=>{eg(()=>{var ee;const ie=Me();if(ie.length!==Xe.value.length)Xe.value=ie;else if(ie.length>0){for(let ue=0;ue{var ee;return(ee=o.inputValue)!=null?ee:we.value});Et($e,ee=>{!ee&&!F.value&&We.value&&ht("")});const Ze=ee=>{var ie,ue;return o.multiple?ee.map(ye=>{var E,g;return(g=(E=de.get(ye))==null?void 0:E.value)!=null?g:""}):(ue=(ie=de.get(ee[0]))==null?void 0:ie.value)!=null?ue:qL(de)?void 0:""},nt=ee=>{var ie,ue;const ye=Ze(ee);fe.value=ye,s("update:modelValue",ye),s("change",ye),(ue=(ie=L.value)==null?void 0:ie.onChange)==null||ue.call(ie),ae(ee)},ht=ee=>{we.value=ee,s("update:inputValue",ee),s("inputValueChange",ee)},et=(ee,ie)=>{if(o.multiple){if(re.value.includes(ee)){const ue=re.value.filter(ye=>ye!==ee);nt(ue)}else if(se.value.includes(ee))if(o.limit>0&&re.value.length>=o.limit){const ue=de.get(ee);s("exceedLimit",ue==null?void 0:ue.value,ie)}else{const ue=re.value.concat(ee);nt(ue)}F.value||ht("")}else{if(ee!==re.value[0]&&nt([ee]),F.value){const ue=de.get(ee);ue&&ht(ue.label)}he(!1)}},xe=tw(ee=>{s("search",ee)},o.searchDelay),w=ee=>{ee!==We.value&&($e.value||he(!0),ht(ee),o.allowSearch&&xe(ee))},I=ee=>{const ie=de.get(ee),ue=re.value.filter(ye=>ye!==ee);nt(ue),s("remove",ie==null?void 0:ie.value)},N=ee=>{ee==null||ee.stopPropagation();const ie=re.value.filter(ue=>{var ye;return(ye=de.get(ue))==null?void 0:ye.disabled});nt(ie),ht(""),s("clear",ee)},A=ee=>{s("dropdownScroll",ee)},K=ee=>{s("dropdownReachBottom",ee)},{validOptions:U,optionInfoMap:de,validOptionInfos:Te,enabledOptionKeys:se,handleKeyDown:Ce}=hN({multiple:T,options:h,extraOptions:Je,inputValue:We,filterOption:p,showExtraOptions:S,component:R,valueKey:f,fieldNames:x,loading:G,popupVisible:$e,valueKeys:re,dropdownRef:z,optionRefs:X,virtualListRef:le,defaultActiveFirstOption:oe,onSelect:et,onPopupVisibleChange:he}),ce=j(()=>{var ee;const ie=[];for(const ue of ke.value){const ye=de.get(ue.key);ye&&ie.push(lw(gc({},ye),{value:ue.key,label:(ee=ye==null?void 0:ye.label)!=null?ee:String(ko(ue.value)?ue.value[f==null?void 0:f.value]:ue.value),closable:!(ye!=null&&ye.disabled),tagProps:ye==null?void 0:ye.tagProps}))}return ie}),Se=ee=>{if(bo(n.option)){const ie=n.option;return()=>ie({data:ee.raw})}return bo(ee.render)?ee.render:()=>ee.label},Ne=ee=>{if(II(ee)){let ie;return Q(Nu,{key:ee.key,label:ee.label},cw(ie=ee.options.map(ue=>Ne(ue)))?ie:{default:()=>[ie]})}return hd(ee,{inputValue:We.value,filterOption:p==null?void 0:p.value})?Q(ll,{ref:ie=>{ie!=null&&ie.$el&&(X.value[ee.key]=ie.$el)},key:ee.key,value:ee.value,label:ee.label,disabled:ee.disabled,internal:!0},{default:Se(ee)}):null},He=()=>Q(VL,{ref:z,loading:o.loading,empty:Te.value.length===0,virtualList:!!o.virtualListProps,scrollbar:o.scrollbar,showHeaderOnEmpty:o.showHeaderOnEmpty,showFooterOnEmpty:o.showFooterOnEmpty,onScroll:A,onReachBottom:K},{default:()=>{var ee,ie;return[...(ie=(ee=n.default)==null?void 0:ee.call(n))!=null?ie:[],...U.value.map(Ne)]},"virtual-list":()=>Q(bN,Ot(o.virtualListProps,{ref:le,data:U.value}),{item:({item:ee})=>Ne(ee)}),empty:n.empty,header:n.header,footer:n.footer}),be=({data:ee})=>{var ie,ue,ye,E;if((n.label||bo(o.formatLabel))&&ee){const g=de.get(ee.value);if(g!=null&&g.raw)return(ye=(ie=n.label)==null?void 0:ie.call(n,{data:g.raw}))!=null?ye:(ue=o.formatLabel)==null?void 0:ue.call(o,g.raw)}return(E=ee==null?void 0:ee.label)!=null?E:""};return()=>Q(zu,Ot({trigger:"click",position:"bl",popupOffset:4,animationName:"slide-dynamic-origin",hideEmpty:!0,preventFocus:!0,autoFitPopupWidth:!0,autoFitTransformOrigin:!0,disabled:Y.value,popupVisible:$e.value,unmountOnClose:o.unmountOnClose,clickToClose:!(o.allowSearch||o.allowCreate),popupContainer:o.popupContainer,onPopupVisibleChange:he},o.triggerProps),{default:()=>{var ee,ie;return[(ie=(ee=n.trigger)==null?void 0:ee.call(n))!=null?ie:Q(q1,Ot({class:ne,modelValue:ce.value,inputValue:We.value,multiple:o.multiple,disabled:Y.value,error:M.value,loading:o.loading,allowClear:o.allowClear,allowCreate:o.allowCreate,allowSearch:!!o.allowSearch,opened:$e.value,maxTagCount:o.maxTagCount,placeholder:o.placeholder,bordered:o.bordered,size:Z.value,onInputValueChange:w,onRemove:I,onClear:N,onKeydown:Ce},l),{label:be,prefix:n.prefix,"arrow-icon":n["arrow-icon"],"loading-icon":n["loading-icon"],"search-icon":n["search-icon"]})]},content:He})}});const yI=Object.assign(M_,{Option:ll,OptGroup:Nu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+M_.name,M_),o.component(s+ll.name,ll),o.component(s+Nu.name,Nu)}}),SI=Symbol("RadioGroup");var wu=Ke({name:"Radio",components:{IconHover:oi},props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultChecked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean],default:!0},type:{type:String,default:"radio"},disabled:{type:Boolean,default:!1},uninjectGroupContext:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const l=ot("radio"),{modelValue:a}=Pt(o),u=o.uninjectGroupContext?void 0:ho(SI,void 0),{mergedDisabled:d,eventHandlers:h}=si({disabled:m0(o,"disabled")}),p=ge(null),f=ge(o.defaultChecked),T=j(()=>(u==null?void 0:u.name)==="ArcoRadioGroup"),C=j(()=>{var M;return(M=u==null?void 0:u.type)!=null?M:o.type}),S=j(()=>(u==null?void 0:u.disabled)||d.value),P=j(()=>{var M,L;return T.value?(u==null?void 0:u.value)===((M=o.value)!=null?M:!0):rs(o.modelValue)?f.value:o.modelValue===((L=o.value)!=null?L:!0)});Et(a,M=>{(rs(M)||Tl(M))&&(f.value=!1)}),Et(P,(M,L)=>{M!==L&&(f.value=M,p.value&&(p.value.checked=M))});const x=M=>{var L,R;(R=(L=h.value)==null?void 0:L.onFocus)==null||R.call(L,M)},G=M=>{var L,R;(R=(L=h.value)==null?void 0:L.onBlur)==null||R.call(L,M)},oe=M=>{M.stopPropagation()},ne=M=>{var L,R,F,z,X;f.value=!0,T.value?u==null||u.handleChange((L=o.value)!=null?L:!0,M):(n("update:modelValue",(R=o.value)!=null?R:!0),n("change",(F=o.value)!=null?F:!0,M),(X=(z=h.value)==null?void 0:z.onChange)==null||X.call(z,M)),Io(()=>{p.value&&p.value.checked!==P.value&&(p.value.checked=P.value)})},Z=j(()=>[`${C.value==="button"?`${l}-button`:l}`,{[`${l}-checked`]:P.value,[`${l}-disabled`]:S.value}]),Y=()=>Q(Wt,null,[Q(_t("icon-hover"),{class:`${l}-icon-hover`,disabled:S.value||P.value},{default:()=>[Q("span",{class:`${l}-icon`},null)]}),s.default&&Q("span",{class:`${l}-label`},[s.default()])]);return()=>{var M,L,R,F;return Q("label",{class:Z.value},[Q("input",{ref:p,type:"radio",checked:P.value,value:o.value,class:`${l}-target`,disabled:S.value,onClick:oe,onChange:ne,onFocus:x,onBlur:G},null),C.value==="radio"?(F=(R=(L=s.radio)!=null?L:(M=u==null?void 0:u.slots)==null?void 0:M.radio)==null?void 0:R({checked:P.value,disabled:S.value}))!=null?F:Y():Q("span",{class:`${l}-button-content`},[s.default&&s.default()])])}}}),Mu=Ke({name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:void 0},defaultValue:{type:[String,Number,Boolean],default:""},type:{type:String,default:"radio"},size:{type:String},options:{type:Array},direction:{type:String,default:"horizontal"},disabled:{type:Boolean,default:!1}},emits:{"update:modelValue":o=>!0,change:(o,n)=>!0},setup(o,{emit:n,slots:s}){const l=ot("radio-group"),{size:a,type:u,disabled:d,modelValue:h}=Pt(o),{mergedDisabled:p,mergedSize:f,eventHandlers:T}=si({size:a,disabled:d}),C=ge(o.defaultValue),S=j(()=>{var ne;return(ne=o.modelValue)!=null?ne:C.value}),P=j(()=>{var ne;return((ne=o.options)!=null?ne:[]).map(Z=>ki(Z)||vt(Z)?{label:Z,value:Z}:Z)});hn(SI,Jt({name:"ArcoRadioGroup",value:S,size:f,type:u,disabled:p,slots:s,handleChange:(ne,Z)=>{var Y,M;C.value=ne,n("update:modelValue",ne),n("change",ne,Z),(M=(Y=T.value)==null?void 0:Y.onChange)==null||M.call(Y,Z)}})),Et(S,ne=>{C.value!==ne&&(C.value=ne)}),Et(h,ne=>{(rs(ne)||Tl(ne))&&(C.value="")});const G=j(()=>[`${l}${o.type==="button"?"-button":""}`,`${l}-size-${f.value}`,`${l}-direction-${o.direction}`,{[`${l}-disabled`]:p.value}]),oe=()=>P.value.map(ne=>Q(wu,{key:ne.value,value:ne.value,disabled:ne.disabled,modelValue:S.value===ne.value},{default:()=>[s.label?s.label({data:ne}):bo(ne.label)?ne.label():ne.label]}));return()=>{var ne;return Q("span",{class:G.value},[P.value.length>0?oe():(ne=s.default)==null?void 0:ne.call(s)])}}});const uw=Object.assign(wu,{Group:Mu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+wu.name,wu),o.component(s+Mu.name,Mu)}}),dw=Ke({name:"IconLeft",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-left`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),hw=["stroke-width","stroke-linecap","stroke-linejoin"],pw=Le("path",{d:"M32 8.4 16.444 23.956 32 39.513"},null,-1),$w=[pw];function _w(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},$w,14,hw)}var D_=dt(dw,[["render",_w]]);const RI=Object.assign(D_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+D_.name,D_)}});function gw(o){const n=ge(o);return[n,l=>{n.value=l}]}var fw=Ke({name:"RenderFunction",props:{renderFunc:{type:Function,required:!0}},render(){return this.renderFunc(this.$attrs)}});function Xu(o,n){const{value:s}=Pt(n),[l,a]=gw(rs(s.value)?o:s.value);return Et(s,d=>{rs(d)&&a(void 0)}),[j(()=>rs(s.value)?l.value:s.value),a,l]}var mw=Object.defineProperty,Tw=Object.defineProperties,Ew=Object.getOwnPropertyDescriptors,tb=Object.getOwnPropertySymbols,bw=Object.prototype.hasOwnProperty,vw=Object.prototype.propertyIsEnumerable,ob=(o,n,s)=>n in o?mw(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Iw=(o,n)=>{for(var s in n||(n={}))bw.call(n,s)&&ob(o,s,n[s]);if(tb)for(var s of tb(n))vw.call(n,s)&&ob(o,s,n[s]);return o},Ow=(o,n)=>Tw(o,Ew(n));const Iu={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"};let Gn=[],Cw=-1,Ou={};const sb={matchHandlers:{},dispatch(o,n){return Ou=o,Gn.length<1?!1:(Gn.forEach(s=>{s.func(Ou,n)}),!0)},subscribe(o){Gn.length===0&&this.register();const n=(++Cw).toString();return Gn.push({token:n,func:o}),o(Ou,null),n},unsubscribe(o){Gn=Gn.filter(n=>n.token!==o),Gn.length===0&&this.unregister()},unregister(){Object.keys(Iu).forEach(o=>{const n=Iu[o];if(!n)return;const s=this.matchHandlers[n];s&&s.mql&&s.listener&&(s.mql.removeEventListener?s.mql.removeEventListener("change",s.listener):s.mql.removeListener(s.listener))})},register(){Object.keys(Iu).forEach(o=>{const n=Iu[o];if(!n)return;const s=({matches:a})=>{this.dispatch(Ow(Iw({},Ou),{[o]:a}),o)},l=window.matchMedia(n);l.addEventListener?l.addEventListener("change",s):l.addListener(s),this.matchHandlers[n]={mql:l,listener:s},s(l)})}};var P_=Ke({name:"Divider",props:{direction:{type:String,default:"horizontal"},orientation:{type:String,default:"center"},type:{type:String},size:{type:Number},margin:{type:[Number,String]}},setup(o,{slots:n}){const s=ot("divider"),l=j(()=>o.direction==="horizontal"),a=j(()=>{const u={};if(o.size&&(u[l.value?"border-bottom-width":"border-left-width"]=vt(o.size)?`${o.size}px`:o.size),o.type&&(u[l.value?"border-bottom-style":"border-left-style"]=o.type),!rs(o.margin)){const d=vt(o.margin)?`${o.margin}px`:o.margin;u.margin=l.value?`${d} 0`:`0 ${d}`}return u});return()=>{var u;const d=(u=n.default)==null?void 0:u.call(n),h=[s,`${s}-${o.direction}`,{[`${s}-with-text`]:d}];return Q("div",{role:"separator",class:h,style:a.value},[d&&o.direction==="horizontal"&&Q("span",{class:[`${s}-text`,`${s}-text-${o.orientation}`]},[d])])}}});const yw=Object.assign(P_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+P_.name,P_)}}),Sw=o=>{const n=ge(!1),s={overflow:"",width:"",boxSizing:""};return{setOverflowHidden:()=>{if(o.value){const u=o.value;if(!n.value&&u.style.overflow!=="hidden"){const d=Sk(u);(d>0||yk(u))&&(s.overflow=u.style.overflow,s.width=u.style.width,s.boxSizing=u.style.boxSizing,u.style.overflow="hidden",u.style.width=`${u.offsetWidth-d}px`,u.style.boxSizing="border-box",n.value=!0)}}},resetOverflow:()=>{if(o.value&&n.value){const u=o.value;u.style.overflow=s.overflow,u.style.width=s.width,u.style.boxSizing=s.boxSizing,n.value=!1}}}};var Rw=Object.defineProperty,ib=Object.getOwnPropertySymbols,kw=Object.prototype.hasOwnProperty,Aw=Object.prototype.propertyIsEnumerable,nb=(o,n,s)=>n in o?Rw(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,rb=(o,n)=>{for(var s in n||(n={}))kw.call(n,s)&&nb(o,s,n[s]);if(ib)for(var s of ib(n))Aw.call(n,s)&&nb(o,s,n[s]);return o};const Lw=Ke({name:"Tooltip",components:{Trigger:zu},props:{popupVisible:{type:Boolean,default:void 0},defaultPopupVisible:{type:Boolean,default:!1},content:String,position:{type:String,default:"top"},mini:{type:Boolean,default:!1},backgroundColor:{type:String},contentClass:{type:[String,Array,Object]},contentStyle:{type:Object},arrowClass:{type:[String,Array,Object]},arrowStyle:{type:Object},popupContainer:{type:[String,Object]}},emits:{"update:popupVisible":o=>!0,popupVisibleChange:o=>!0},setup(o,{emit:n}){const s=ot("tooltip"),l=ge(o.defaultPopupVisible),a=j(()=>{var T;return(T=o.popupVisible)!=null?T:l.value}),u=T=>{l.value=T,n("update:popupVisible",T),n("popupVisibleChange",T)},d=j(()=>[`${s}-content`,o.contentClass,{[`${s}-mini`]:o.mini}]),h=j(()=>{if(o.backgroundColor||o.contentStyle)return rb({backgroundColor:o.backgroundColor},o.contentStyle)}),p=j(()=>[`${s}-popup-arrow`,o.arrowClass]),f=j(()=>{if(o.backgroundColor||o.arrowStyle)return rb({backgroundColor:o.backgroundColor},o.arrowStyle)});return{prefixCls:s,computedPopupVisible:a,contentCls:d,computedContentStyle:h,arrowCls:p,computedArrowStyle:f,handlePopupVisibleChange:u}}});function Nw(o,n,s,l,a,u){const d=_t("Trigger");return me(),it(d,{class:Pe(o.prefixCls),trigger:"hover",position:o.position,"popup-visible":o.computedPopupVisible,"popup-offset":10,"show-arrow":"","content-class":o.contentCls,"content-style":o.computedContentStyle,"arrow-class":o.arrowCls,"arrow-style":o.computedArrowStyle,"popup-container":o.popupContainer,"animation-name":"zoom-in-fade-out","auto-fit-transform-origin":"",role:"tooltip",onPopupVisibleChange:o.handlePopupVisibleChange},{content:De(()=>[ct(o.$slots,"content",{},()=>[Ut(Ci(o.content),1)])]),default:De(()=>[ct(o.$slots,"default")]),_:3},8,["class","position","popup-visible","content-class","content-style","arrow-class","arrow-style","popup-container","onPopupVisibleChange"])}var x_=dt(Lw,[["render",Nw]]);const D0=Object.assign(x_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+x_.name,x_)}}),ww=Ke({name:"ImagePreviewArrow",components:{IconLeft:RI,IconRight:OI},props:{onPrev:{type:Function},onNext:{type:Function}},setup(){return{prefixCls:ot("image-preview-arrow")}}});function Mw(o,n,s,l,a,u){const d=_t("icon-left"),h=_t("icon-right");return me(),Fe("div",{class:Pe(o.prefixCls)},[Le("div",{class:Pe([`${o.prefixCls}-left`,{[`${o.prefixCls}-disabled`]:!o.onPrev}]),onClick:n[0]||(n[0]=p=>{p.preventDefault(),o.onPrev&&o.onPrev()})},[Q(d)],2),Le("div",{class:Pe([`${o.prefixCls}-right`,{[`${o.prefixCls}-disabled`]:!o.onNext}]),onClick:n[1]||(n[1]=p=>{p.preventDefault(),o.onNext&&o.onNext()})},[Q(h)],2)],2)}var Dw=dt(ww,[["render",Mw]]);function Pw(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Object]"&&!al(o)}var kI=Ke({name:"ImagePreviewAction",components:{Tooltip:D0},inheritAttrs:!1,props:{name:{type:String},disabled:{type:Boolean}},setup(o,{slots:n,attrs:s}){const l=ot("image-preview-toolbar-action");return()=>{var a;const{name:u,disabled:d}=o,h=(a=n.default)==null?void 0:a.call(n);if(!h||!h.length)return null;const p=Q("div",Ot({class:[`${l}`,{[`${l}-disabled`]:d}],onMousedown:f=>{f.preventDefault()}},s),[Q("span",{class:`${l}-content`},[h])]);return u?Q(D0,{class:`${l}-tooltip`,content:u},Pw(p)?p:{default:()=>[p]}):p}}}),xw=Ke({name:"ImagePreviewToolbar",components:{RenderFunction:fw,PreviewAction:kI},props:{actions:{type:Array,default:()=>[]},actionsLayout:{type:Array,default:()=>[]}},setup(o){const{actions:n,actionsLayout:s}=Pt(o),l=ot("image-preview-toolbar"),a=j(()=>{const u=new Set(s.value),d=p=>u.has(p.key);return n.value.filter(d).sort((p,f)=>{const T=s.value.indexOf(p.key),C=s.value.indexOf(f.key);return T>C?1:-1})});return{prefixCls:l,resultActions:a}}});function Bw(o,n,s,l,a,u){const d=_t("RenderFunction"),h=_t("PreviewAction");return me(),Fe("div",{class:Pe(o.prefixCls)},[(me(!0),Fe(Wt,null,id(o.resultActions,p=>(me(),it(h,{key:p.key,name:p.name,disabled:p.disabled,onClick:p.onClick},{default:De(()=>[Q(d,{"render-func":p.content},null,8,["render-func"])]),_:2},1032,["name","disabled","onClick"]))),128)),ct(o.$slots,"default")],2)}var Fw=dt(xw,[["render",Bw]]);function Uw(o){const n=ge(o||"beforeLoad"),s=j(()=>n.value==="beforeLoad"),l=j(()=>n.value==="loading"),a=j(()=>n.value==="error"),u=j(()=>n.value==="loaded");return{status:n,isBeforeLoad:s,isLoading:l,isError:a,isLoaded:u,setLoadStatus:d=>{n.value=d}}}function Hw(o,n,s,l,a){let u=s,d=l;return s&&(o.width>n.width?u=0:(n.left>o.left&&(u-=Math.abs(o.left-n.left)/a),n.rightn.height?d=0:(n.top>o.top&&(d-=Math.abs(o.top-n.top)/a),n.bottom{if(!n.value||!s.value)return;const x=n.value.getBoundingClientRect(),G=s.value.getBoundingClientRect(),[oe,ne]=Hw(x,G,a.value[0],a.value[1],l.value);(oe!==a.value[0]||ne!==a.value[1])&&(a.value=[oe,ne])},T=x=>{x.preventDefault&&x.preventDefault();const G=p[0]+(x.pageX-d)/l.value,oe=p[1]+(x.pageY-h)/l.value;a.value=[G,oe]},C=x=>{x.preventDefault&&x.preventDefault(),u.value=!1,f(),P()},S=x=>{x.target===x.currentTarget&&(x.preventDefault&&x.preventDefault(),u.value=!0,d=x.pageX,h=x.pageY,p=[...a.value],vo(window,"mousemove",T,!1),vo(window,"mouseup",C,!1))};function P(){Yo(window,"mousemove",T,!1),Yo(window,"mouseup",C,!1)}return eg(x=>{s.value&&vo(s.value,"mousedown",S),x(()=>{s.value&&Yo(s.value,"mousedown",S),P()})}),Et([l],()=>{Io(()=>f())}),{translate:a,moving:u,resetTranslate(){a.value=[0,0]}}}const Gw=Ke({name:"IconZoomOut",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-zoom-out`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Ww=["stroke-width","stroke-linecap","stroke-linejoin"],zw=Le("path",{d:"M32.607 32.607A14.953 14.953 0 0 0 37 22c0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15 0 8.284 6.716 15 15 15 4.142 0 7.892-1.679 10.607-4.393Zm0 0L41.5 41.5M29 22H15"},null,-1),Xw=[zw];function jw(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Xw,14,Ww)}var B_=dt(Gw,[["render",jw]]);const Yw=Object.assign(B_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+B_.name,B_)}}),Kw=Ke({name:"IconZoomIn",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-zoom-in`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Qw=["stroke-width","stroke-linecap","stroke-linejoin"],qw=Le("path",{d:"M32.607 32.607A14.953 14.953 0 0 0 37 22c0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15 0 8.284 6.716 15 15 15 4.142 0 7.892-1.679 10.607-4.393Zm0 0L41.5 41.5M29 22H15m7 7V15"},null,-1),Jw=[qw];function Zw(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Jw,14,Qw)}var F_=dt(Kw,[["render",Zw]]);const e6=Object.assign(F_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+F_.name,F_)}}),t6=Ke({name:"IconFullscreen",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-fullscreen`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),o6=["stroke-width","stroke-linecap","stroke-linejoin"],s6=Le("path",{d:"M42 17V9a1 1 0 0 0-1-1h-8M6 17V9a1 1 0 0 1 1-1h8m27 23v8a1 1 0 0 1-1 1h-8M6 31v8a1 1 0 0 0 1 1h8"},null,-1),i6=[s6];function n6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},i6,14,o6)}var U_=dt(t6,[["render",n6]]);const r6=Object.assign(U_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+U_.name,U_)}}),l6=Ke({name:"IconRotateLeft",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-rotate-left`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),c6=["stroke-width","stroke-linecap","stroke-linejoin"],a6=Le("path",{d:"M10 22a1 1 0 0 1 1-1h20a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H11a1 1 0 0 1-1-1V22ZM23 11h11a6 6 0 0 1 6 6v6M22.5 12.893 19.587 11 22.5 9.107v3.786Z"},null,-1),u6=[a6];function d6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},u6,14,c6)}var H_=dt(l6,[["render",d6]]);const h6=Object.assign(H_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+H_.name,H_)}}),p6=Ke({name:"IconRotateRight",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-rotate-right`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),$6=["stroke-width","stroke-linecap","stroke-linejoin"],_6=Le("path",{d:"M38 22a1 1 0 0 0-1-1H17a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h20a1 1 0 0 0 1-1V22ZM25 11H14a6 6 0 0 0-6 6v6M25.5 12.893 28.413 11 25.5 9.107v3.786Z"},null,-1),g6=[_6];function f6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},g6,14,$6)}var V_=dt(p6,[["render",f6]]);const m6=Object.assign(V_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+V_.name,V_)}}),T6=Ke({name:"IconOriginalSize",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-original-size`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),E6=["stroke-width","stroke-linecap","stroke-linejoin"],b6=Le("path",{d:"m5.5 11.5 5-2.5h1v32M34 11.5 39 9h1v32"},null,-1),v6=Le("path",{d:"M24 17h1v1h-1v-1ZM24 30h1v1h-1v-1Z",fill:"currentColor",stroke:"none"},null,-1),I6=Le("path",{d:"M24 17h1v1h-1v-1ZM24 30h1v1h-1v-1Z"},null,-1),O6=[b6,v6,I6];function C6(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},O6,14,E6)}var G_=dt(T6,[["render",C6]]);const y6=Object.assign(G_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+G_.name,G_)}});function S6(o){const{container:n,hidden:s}=Pt(o);let l=!1,a={};const u=p=>p.tagName==="BODY"?window.innerWidth-(document.body.clientWidth||document.documentElement.clientWidth):p.offsetWidth-p.clientWidth,d=()=>{if(n.value&&n.value.style.overflow!=="hidden"){const p=n.value.style;l=!0;const f=u(n.value);f&&(a.width=p.width,n.value.style.width=`calc(${n.value.style.width||"100%"} - ${f}px)`),a.overflow=p.overflow,n.value.style.overflow="hidden"}},h=()=>{if(n.value&&l){const p=a;Object.keys(p).forEach(f=>{n.value.style[f]=p[f]})}l=!1,a={}};return eg(p=>{s.value?d():h(),p(()=>{h()})}),[h,d]}function R6(o,n){const{popupContainer:s}=Pt(n);return j(()=>(ki(s.value)?dI(s.value):s.value)||o)}const As=[25,33,50,67,75,80,90,100,110,125,150,175,200,250,300,400,500].map(o=>+(o/100).toFixed(2)),AI=As[0],LI=As[As.length-1];function k6(o=1,n="zoomIn"){let s=As.indexOf(o);return s===-1&&(s=L6(o)),n==="zoomIn"?s===As.length-1?o:As[s+1]:s===0?o:As[s-1]}function A6(o,n=1.1,s="zoomIn"){const l=s==="zoomIn"?n:1/n,a=Number.parseFloat((o*l).toFixed(3));return Math.min(LI,Math.max(AI,a))}function L6(o){let n=As.length-1;for(let s=0;sn in o?N6(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,D6=(o,n)=>{for(var s in n||(n={}))w6.call(n,s)&&cb(o,s,n[s]);if(lb)for(var s of lb(n))M6.call(n,s)&&cb(o,s,n[s]);return o};const W_=90;var P6=Ke({name:"ImagePreview",components:{PreviewArrow:Dw,PreviewToolbar:Fw,IconLoading:ir,IconClose:El},props:{renderToBody:{type:Boolean,default:!0},src:{type:String},visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},maskClosable:{type:Boolean,default:!0},closable:{type:Boolean,default:!0},actionsLayout:{type:Array,default:()=>["fullScreen","rotateRight","rotateLeft","zoomIn","zoomOut","originalSize"]},popupContainer:{type:[Object,String]},inGroup:{type:Boolean,default:!1},groupArrowProps:{type:Object,default:()=>({})},escToClose:{type:Boolean,default:!0},wheelZoom:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},defaultScale:{type:Number,default:1},zoomRate:{type:Number,default:1.1}},emits:["close","update:visible"],setup(o,{emit:n}){const{t:s}=ug(),{src:l,popupContainer:a,visible:u,defaultVisible:d,maskClosable:h,actionsLayout:p,defaultScale:f,zoomRate:T}=Pt(o),C=ge(),S=ge(),P=ot("image-preview"),[x,G]=Xu(d.value,Jt({value:u})),oe=j(()=>[P,{[`${P}-hide`]:!x.value}]),ne=R6(document.body,Jt({popupContainer:a})),Z=j(()=>ne.value===document.body),{zIndex:Y}=Tg("dialog",{visible:x}),M=j(()=>{const et=Z.value?{zIndex:Y.value,position:"fixed"}:{zIndex:"inherit",position:"absolute"};return D6({},et)}),{isLoading:L,isLoaded:R,setLoadStatus:F}=Uw(),z=ge(0),X=ge(f.value),{translate:le,moving:$e,resetTranslate:he}=Vw(Jt({wrapperEl:C,imageEl:S,visible:x,scale:X})),fe=ge(!1);let ke=null;const re=()=>{!fe.value&&(fe.value=!0),ke&&clearTimeout(ke),ke=setTimeout(()=>{fe.value=!1},1e3)};S6(Jt({container:ne,hidden:x}));function Ie(){z.value=0,X.value=f.value,he()}const D=et=>p.value.includes(et),B=et=>{switch(et.stopPropagation(),et.preventDefault(),et.key){case Ss.ESC:o.escToClose&&Je();break;case Ss.ARROW_LEFT:o.groupArrowProps.onPrev&&o.groupArrowProps.onPrev();break;case Ss.ARROW_RIGHT:o.groupArrowProps.onNext&&o.groupArrowProps.onNext();break;case Ss.ARROW_UP:D("zoomIn")&&ht("zoomIn");break;case Ss.ARROW_DOWN:D("zoomOut")&&ht("zoomOut");break;case Ss.SPACE:D("originalSize")&&We(1);break}},ae=A0(et=>{if(et.preventDefault(),et.stopPropagation(),!o.wheelZoom)return;const w=(et.deltaY||et.deltaX)>0?"zoomOut":"zoomIn",I=A6(X.value,T.value,w);We(I)});let _e=!1;const Me=()=>{Io(()=>{var et;(et=C==null?void 0:C.value)==null||et.focus()}),o.keyboard&&!_e&&(_e=!0,vo(ne.value,"keydown",B))},Xe=()=>{_e&&(_e=!1,Yo(ne.value,"keydown",B))};Et([l,x],()=>{x.value?(Ie(),F("loading"),Me()):Xe()});function Je(){x.value&&(n("close"),n("update:visible",!1),G(!1))}function we(et){var xe;(xe=C==null?void 0:C.value)==null||xe.focus(),h.value&&et.target===et.currentTarget&&Je()}function We(et){X.value!==et&&(X.value=et,re())}function Ze(){const et=C.value.getBoundingClientRect(),xe=S.value.getBoundingClientRect(),w=et.height/(xe.height/X.value),I=et.width/(xe.width/X.value),N=Math.max(w,I);We(N)}function nt(et){const w=et==="clockwise"?(z.value+W_)%360:z.value===0?360-W_:z.value-W_;z.value=w}function ht(et){const xe=k6(X.value,et);We(xe)}return Ri(()=>{Xe()}),{prefixCls:P,classNames:oe,container:ne,wrapperStyles:M,scale:X,translate:le,rotate:z,moving:$e,mergedVisible:x,isLoading:L,isLoaded:R,scaleValueVisible:fe,refWrapper:C,refImage:S,onWheel:ae,onMaskClick:we,onCloseClick:Je,onImgLoad(){F("loaded")},onImgError(){F("error")},actions:j(()=>[{key:"fullScreen",name:s("imagePreview.fullScreen"),content:()=>Zs(r6),onClick:()=>Ze()},{key:"rotateRight",name:s("imagePreview.rotateRight"),content:()=>Zs(m6),onClick:()=>nt("clockwise")},{key:"rotateLeft",name:s("imagePreview.rotateLeft"),content:()=>Zs(h6),onClick:()=>nt("counterclockwise")},{key:"zoomIn",name:s("imagePreview.zoomIn"),content:()=>Zs(e6),onClick:()=>ht("zoomIn"),disabled:X.value===LI},{key:"zoomOut",name:s("imagePreview.zoomOut"),content:()=>Zs(Yw),onClick:()=>ht("zoomOut"),disabled:X.value===AI},{key:"originalSize",name:s("imagePreview.originalSize"),content:()=>Zs(y6),onClick:()=>We(1)}])}}});const x6=["src"];function B6(o,n,s,l,a,u){const d=_t("IconLoading"),h=_t("PreviewToolbar"),p=_t("IconClose"),f=_t("PreviewArrow");return me(),it(lg,{to:o.container,disabled:!o.renderToBody},[Le("div",{class:Pe(o.classNames),style:It(o.wrapperStyles)},[Q(un,{name:"image-fade",onBeforeEnter:n[0]||(n[0]=T=>T.parentElement&&(T.parentElement.style.display="block")),onAfterLeave:n[1]||(n[1]=T=>T.parentElement&&(T.parentElement.style.display=""))},{default:De(()=>[Kn(Le("div",{class:Pe(`${o.prefixCls}-mask`)},null,2),[[qn,o.mergedVisible]])]),_:1}),o.mergedVisible?(me(),Fe("div",{key:0,ref:"refWrapper",tabindex:"0",class:Pe(`${o.prefixCls}-wrapper`),onClick:n[6]||(n[6]=(...T)=>o.onMaskClick&&o.onMaskClick(...T)),onWheel:n[7]||(n[7]=er((...T)=>o.onWheel&&o.onWheel(...T),["prevent","stop"]))},[ut(" img "),Le("div",{class:Pe(`${o.prefixCls}-img-container`),style:It({transform:`scale(${o.scale}, ${o.scale})`}),onClick:n[4]||(n[4]=(...T)=>o.onMaskClick&&o.onMaskClick(...T))},[(me(),Fe("img",{ref:"refImage",key:o.src,src:o.src,class:Pe([`${o.prefixCls}-img`,{[`${o.prefixCls}-img-moving`]:o.moving}]),style:It({transform:`translate(${o.translate[0]}px, ${o.translate[1]}px) rotate(${o.rotate}deg)`}),onLoad:n[2]||(n[2]=(...T)=>o.onImgLoad&&o.onImgLoad(...T)),onError:n[3]||(n[3]=(...T)=>o.onImgError&&o.onImgError(...T))},null,46,x6))],6),ut(" loading "),o.isLoading?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-loading`)},[Q(d)],2)):ut("v-if",!0),ut(" scale value "),Q(un,{name:"image-fade"},{default:De(()=>[o.scaleValueVisible?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-scale-value`)},Ci((o.scale*100).toFixed(0))+"% ",3)):ut("v-if",!0)]),_:1}),ut(" toolbar "),o.isLoaded&&o.actionsLayout.length?(me(),it(h,{key:1,actions:o.actions,"actions-layout":o.actionsLayout},{default:De(()=>[ct(o.$slots,"actions")]),_:3},8,["actions","actions-layout"])):ut("v-if",!0),ut(" close btn "),o.closable?(me(),Fe("div",{key:2,class:Pe(`${o.prefixCls}-close-btn`),onClick:n[5]||(n[5]=(...T)=>o.onCloseClick&&o.onCloseClick(...T))},[Q(p)],2)):ut("v-if",!0),ut(" group arrow "),o.inGroup?(me(),it(f,C9(Ot({key:3},o.groupArrowProps)),null,16)):ut("v-if",!0)],34)):ut("v-if",!0)],6)],8,["to","disabled"])}var F6=dt(P6,[["render",B6]]);const NI=Symbol("LayoutSiderInjectionKey"),U6=Symbol("SiderInjectionKey");var H6=Ke({name:"Layout",props:{hasSider:{type:Boolean}},setup(o){const n=ge([]),s=ot("layout"),l=j(()=>[s,{[`${s}-has-sider`]:o.hasSider||n.value.length}]);return hn(NI,{onSiderMount:a=>n.value.push(a),onSiderUnMount:a=>{n.value=n.value.filter(u=>u!==a)}}),{classNames:l}}});function V6(o,n,s,l,a,u){return me(),Fe("section",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var z_=dt(H6,[["render",V6]]);const G6=Ke({name:"LayoutHeader",setup(){return{classNames:[ot("layout-header")]}}});function W6(o,n,s,l,a,u){return me(),Fe("header",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var X_=dt(G6,[["render",W6]]);const z6=Ke({name:"LayoutContent",setup(){return{classNames:[ot("layout-content")]}}});function X6(o,n,s,l,a,u){return me(),Fe("main",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var Du=dt(z6,[["render",X6]]);const j6=Ke({name:"LayoutFooter",setup(){return{classNames:[ot("layout-footer")]}}});function Y6(o,n,s,l,a,u){return me(),Fe("footer",{class:Pe(o.classNames)},[ct(o.$slots,"default")],2)}var j_=dt(j6,[["render",Y6]]);const K6=Ke({name:"IconDragDot",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-drag-dot`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),Q6=["stroke-width","stroke-linecap","stroke-linejoin"],q6=Le("path",{d:"M40 17v2h-2v-2h2ZM25 17v2h-2v-2h2ZM10 17v2H8v-2h2ZM40 29v2h-2v-2h2ZM25 29v2h-2v-2h2ZM10 29v2H8v-2h2Z",fill:"currentColor",stroke:"none"},null,-1),J6=Le("path",{d:"M40 17v2h-2v-2h2ZM25 17v2h-2v-2h2ZM10 17v2H8v-2h2ZM40 29v2h-2v-2h2ZM25 29v2h-2v-2h2ZM10 29v2H8v-2h2Z"},null,-1),Z6=[q6,J6];function eM(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},Z6,14,Q6)}var Y_=dt(K6,[["render",eM]]);const tM=Object.assign(Y_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+Y_.name,Y_)}}),oM=Ke({name:"IconDragDotVertical",props:{size:{type:[Number,String]},strokeWidth:{type:Number,default:4},strokeLinecap:{type:String,default:"butt",validator:o=>["butt","round","square"].includes(o)},strokeLinejoin:{type:String,default:"miter",validator:o=>["arcs","bevel","miter","miter-clip","round"].includes(o)},rotate:Number,spin:Boolean},emits:{click:o=>!0},setup(o,{emit:n}){const s=ot("icon"),l=j(()=>[s,`${s}-drag-dot-vertical`,{[`${s}-spin`]:o.spin}]),a=j(()=>{const d={};return o.size&&(d.fontSize=vt(o.size)?`${o.size}px`:o.size),o.rotate&&(d.transform=`rotate(${o.rotate}deg)`),d});return{cls:l,innerStyle:a,onClick:d=>{n("click",d)}}}}),sM=["stroke-width","stroke-linecap","stroke-linejoin"],iM=Le("path",{d:"M17 8h2v2h-2V8ZM17 23h2v2h-2v-2ZM17 38h2v2h-2v-2ZM29 8h2v2h-2V8ZM29 23h2v2h-2v-2ZM29 38h2v2h-2v-2Z",fill:"currentColor",stroke:"none"},null,-1),nM=Le("path",{d:"M17 8h2v2h-2V8ZM17 23h2v2h-2v-2ZM17 38h2v2h-2v-2ZM29 8h2v2h-2V8ZM29 23h2v2h-2v-2ZM29 38h2v2h-2v-2Z"},null,-1),rM=[iM,nM];function lM(o,n,s,l,a,u){return me(),Fe("svg",{viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",stroke:"currentColor",class:Pe(o.cls),style:It(o.innerStyle),"stroke-width":o.strokeWidth,"stroke-linecap":o.strokeLinecap,"stroke-linejoin":o.strokeLinejoin,onClick:n[0]||(n[0]=(...d)=>o.onClick&&o.onClick(...d))},rM,14,sM)}var K_=dt(oM,[["render",lM]]);const cM=Object.assign(K_,{install:(o,n)=>{var s;const l=(s=n==null?void 0:n.iconPrefix)!=null?s:"";o.component(l+K_.name,K_)}});var aM=Ke({name:"ResizeTrigger",components:{ResizeObserver:cI,IconDragDot:tM,IconDragDotVertical:cM},props:{prefixCls:{type:String,required:!0},direction:{type:String,default:"horizontal"}},emits:["resize"],setup(o,{emit:n}){const{direction:s,prefixCls:l}=Pt(o),a=j(()=>(s==null?void 0:s.value)==="horizontal");return{classNames:j(()=>[l.value,{[`${l.value}-horizontal`]:a.value,[`${l.value}-vertical`]:!a.value}]),onResize:h=>{n("resize",h)},isHorizontal:a}}});function uM(o,n,s,l,a,u){const d=_t("IconDragDot"),h=_t("IconDragDotVertical"),p=_t("ResizeObserver");return me(),it(p,{onResize:o.onResize},{default:De(()=>[Le("div",{class:Pe(o.classNames)},[ut(" @slot 自定义内容 "),ct(o.$slots,"default",{},()=>[Le("div",{class:Pe(`${o.prefixCls}-icon-wrapper`)},[ut(" @slot 自定义 icon "),ct(o.$slots,"icon",{},()=>[o.isHorizontal?(me(),it(d,{key:0,class:Pe(`${o.prefixCls}-icon`)},null,8,["class"])):(me(),it(h,{key:1,class:Pe(`${o.prefixCls}-icon`)},null,8,["class"]))])],2)])],2)]),_:3},8,["onResize"])}var dM=dt(aM,[["render",uM]]),hM=Object.defineProperty,ab=Object.getOwnPropertySymbols,pM=Object.prototype.hasOwnProperty,$M=Object.prototype.propertyIsEnumerable,ub=(o,n,s)=>n in o?hM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Q_=(o,n)=>{for(var s in n||(n={}))pM.call(n,s)&&ub(o,s,n[s]);if(ab)for(var s of ab(n))$M.call(n,s)&&ub(o,s,n[s]);return o};const wI="left",MI="right",vg="top",Ig="bottom",_M=[wI,MI,vg,Ig];function db(o,n){if(o===0)return 0;const s=o-n;return s<=0?0:s}function q_(o){return[vg,Ig].indexOf(o)>-1}const gM=Ke({name:"ResizeBox",components:{ResizeTrigger:dM},inheritAttrs:!1,props:{width:{type:Number},height:{type:Number},component:{type:String,default:"div"},directions:{type:Array,default:()=>["right"]}},emits:{"update:width":o=>!0,"update:height":o=>!0,movingStart:o=>!0,moving:(o,n)=>!0,movingEnd:o=>!0},setup(o,{emit:n}){const{height:s,width:l,directions:a}=Pt(o),[u,d]=Xu(null,Jt({value:l})),[h,p]=Xu(null,Jt({value:s})),f=ge(),T=Jt({}),C=ot("resizebox"),S=j(()=>[C]),P=j(()=>Q_(Q_(Q_({},vt(u.value)?{width:`${u.value}px`}:{}),vt(h.value)?{height:`${h.value}px`}:{}),T)),x=j(()=>a.value.filter(M=>_M.includes(M))),G={direction:"",startPageX:0,startPageY:0,startWidth:0,startHeight:0,moving:!1,padding:{left:0,right:0,top:0,bottom:0}};function oe(M){if(!G.moving)return;const{startPageX:L,startPageY:R,startWidth:F,startHeight:z,direction:X}=G;let le=F,$e=z;const he=M.pageX-L,fe=M.pageY-R;switch(X){case wI:le=F-he,d(le),n("update:width",le);break;case MI:le=F+he,d(le),n("update:width",le);break;case vg:$e=z-fe,p($e),n("update:height",$e);break;case Ig:$e=z+fe,p($e),n("update:height",$e);break}n("moving",{width:le,height:$e},M)}function ne(M){G.moving=!1,Yo(window,"mousemove",oe),Yo(window,"mouseup",ne),Yo(window,"contextmenu",ne),document.body.style.cursor="default",n("movingEnd",M)}function Z(M,L){var R,F;n("movingStart",L),G.moving=!0,G.startPageX=L.pageX,G.startPageY=L.pageY,G.direction=M;const{top:z,left:X,right:le,bottom:$e}=G.padding;G.startWidth=db(((R=f.value)==null?void 0:R.clientWidth)||0,X+le),G.startHeight=db(((F=f.value)==null?void 0:F.clientHeight)||0,z+$e),vo(window,"mousemove",oe),vo(window,"mouseup",ne),vo(window,"contextmenu",ne),document.body.style.cursor=q_(M)?"row-resize":"col-resize"}function Y(M,L){const{width:R,height:F}=L.contentRect,z=q_(M)?F:R;G.padding[M]=z,T[`padding-${M}`]=`${z}px`}return{prefixCls:C,classNames:S,styles:P,wrapperRef:f,onMoveStart:Z,isHorizontal:q_,allowDirections:x,onTiggerResize:Y}}});function fM(o,n,s,l,a,u){const d=_t("ResizeTrigger");return me(),it(cn(o.component),Ot({ref:"wrapperRef",class:o.classNames},o.$attrs,{style:o.styles}),{default:De(()=>[ct(o.$slots,"default"),(me(!0),Fe(Wt,null,id(o.allowDirections,h=>(me(),it(d,{key:h,"prefix-cls":`${o.prefixCls}-trigger`,class:Pe(`${o.prefixCls}-direction-${h}`),direction:o.isHorizontal(h)?"horizontal":"vertical",onMousedown:p=>{o.onMoveStart(h,p)},onResize:p=>{o.onTiggerResize(h,p)}},kv({default:De(()=>[o.$slots["resize-trigger"]?ct(o.$slots,"resize-trigger",{key:0,direction:h}):ut("v-if",!0)]),_:2},[o.$slots["resize-trigger-icon"]?{name:"icon",fn:De(()=>[ct(o.$slots,"resize-trigger-icon",{direction:h})])}:void 0]),1032,["prefix-cls","class","direction","onMousedown","onResize"]))),128))]),_:3},16,["class","style"])}var J_=dt(gM,[["render",fM]]);const mM=Object.assign(J_,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+J_.name,J_)}});function TM(o,n){const s=j(()=>eo(o)?o.value:o);let l="";zt(()=>{l=sb.subscribe((a,u)=>{s.value&&(!u||u===s.value)&&n(!!a[s.value])})}),Uc(()=>{l&&sb.unsubscribe(l)})}const EM=(()=>{let o=0;return(n="")=>(o+=1,`${n}${o}`)})();var bM=Ke({name:"LayoutSider",components:{IconLeft:RI,IconRight:OI,ResizeBox:mM},props:{theme:{type:String,default:"light"},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean},collapsible:{type:Boolean},width:{type:Number,default:200},collapsedWidth:{type:Number,default:48},reverseArrow:{type:Boolean},breakpoint:{type:String},resizeDirections:{type:Array,default:void 0},hideTrigger:{type:Boolean}},emits:["collapse","update:collapsed","breakpoint"],setup(o,{emit:n}){const{theme:s,collapsed:l,defaultCollapsed:a,collapsible:u,hideTrigger:d,breakpoint:h,collapsedWidth:p,resizeDirections:f}=Pt(o),[T,C]=Xu(a.value,Jt({value:l})),S=j(()=>f.value?"ResizeBox":"div"),P=j(()=>u.value&&!d.value),x=ot("layout-sider"),G=j(()=>[x,{[`${x}-light`]:s.value==="light",[`${x}-has-trigger`]:P.value,[`${x}-collapsed`]:l.value}]),oe=j(()=>{const{width:L,collapsedWidth:R}=o,F=T.value?R:L;return vt(F)?`${F}px`:String(F)}),ne=j(()=>[`${x}-trigger`,{[`${x}-trigger-light`]:s.value==="light"}]),Z=()=>{const L=!T.value;C(L),n("update:collapsed",L),n("collapse",L,"clickTrigger")};TM(h,L=>{const R=!L;R!==T.value&&(C(R),n("update:collapsed",R),n("collapse",R,"responsive"),n("breakpoint",R))});const Y=EM("__arco_layout_sider"),M=ho(NI,void 0);return zt(()=>{var L;(L=M==null?void 0:M.onSiderMount)==null||L.call(M,Y)}),Uc(()=>{var L;(L=M==null?void 0:M.onSiderUnMount)==null||L.call(M,Y)}),hn(U6,Jt({theme:s,collapsed:T,collapsedWidth:p})),{componentTag:S,prefixCls:x,classNames:G,triggerClassNames:ne,localCollapsed:T,siderWidth:oe,showTrigger:P,toggleTrigger:Z}}});const vM={key:0},IM={key:1};function OM(o,n,s,l,a,u){const d=_t("IconLeft"),h=_t("IconRight");return me(),it(cn(o.componentTag),Ot({class:o.classNames,style:{width:o.siderWidth}},o.resizeDirections?{directions:o.resizeDirections}:{}),{default:De(()=>[Le("div",{class:Pe(`${o.prefixCls}-children`)},[ct(o.$slots,"default")],2),o.showTrigger?(me(),Fe("div",{key:0,class:Pe(o.triggerClassNames),style:It({width:o.siderWidth}),onClick:n[0]||(n[0]=(...p)=>o.toggleTrigger&&o.toggleTrigger(...p))},[ct(o.$slots,"trigger",{collapsed:o.localCollapsed},()=>[o.reverseArrow?(me(),Fe("div",IM,[o.localCollapsed?(me(),it(d,{key:0})):(me(),it(h,{key:1}))])):(me(),Fe("div",vM,[o.localCollapsed?(me(),it(h,{key:1})):(me(),it(d,{key:0}))]))])],6)):ut("v-if",!0)]),_:3},16,["class","style"])}var Pu=dt(bM,[["render",OM]]);const CM=Object.assign(z_,{Header:X_,Content:Du,Footer:j_,Sider:Pu,install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+z_.name,z_),o.component(s+X_.name,X_),o.component(s+Du.name,Du),o.component(s+j_.name,j_),o.component(s+Pu.name,Pu)}}),yM=({modalRef:o,wrapperRef:n,draggable:s,alignCenter:l})=>{const a=ge(!1),u=ge([0,0]),d=ge([0,0]),h=ge(),p=ge([0,0]),f=ge([0,0]),T=()=>{var x,G,oe;if(n.value&&o.value){const{top:ne,left:Z}=n.value.getBoundingClientRect(),{clientWidth:Y,clientHeight:M}=n.value,{top:L,left:R,width:F,height:z}=o.value.getBoundingClientRect(),X=l.value?0:(x=o.value)==null?void 0:x.offsetTop,le=R-Z,$e=L-ne-X;(le!==((G=d.value)==null?void 0:G[0])||$e!==((oe=d.value)==null?void 0:oe[1]))&&(d.value=[le,$e]);const he=Y>F?Y-F:0,fe=M>z?M-z-X:0;(he!==f.value[0]||fe!==f.value[1])&&(f.value=[he,fe]),X&&(p.value=[0,0-X])}},C=x=>{s.value&&(x.preventDefault(),a.value=!0,T(),u.value=[x.x,x.y],vo(window,"mousemove",S),vo(window,"mouseup",P),vo(window,"contextmenu",P))},S=x=>{if(a.value){const G=x.x-u.value[0],oe=x.y-u.value[1];let ne=d.value[0]+G,Z=d.value[1]+oe;nef.value[0]&&(ne=f.value[0]),Zf.value[1]&&(Z=f.value[1]),h.value=[ne,Z]}},P=()=>{a.value=!1,Yo(window,"mousemove",S),Yo(window,"mouseup",P)};return{position:h,handleMoveDown:C}};var SM=Object.defineProperty,hb=Object.getOwnPropertySymbols,RM=Object.prototype.hasOwnProperty,kM=Object.prototype.propertyIsEnumerable,pb=(o,n,s)=>n in o?SM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,AM=(o,n)=>{for(var s in n||(n={}))RM.call(n,s)&&pb(o,s,n[s]);if(hb)for(var s of hb(n))kM.call(n,s)&&pb(o,s,n[s]);return o},LM=Ke({name:"Modal",components:{ClientOnly:fI,ArcoButton:Vc,IconHover:oi,IconClose:El,IconInfoCircleFill:Uk,IconCheckCircleFill:hI,IconExclamationCircleFill:pI,IconCloseCircleFill:$I},inheritAttrs:!1,props:{visible:{type:Boolean,default:void 0},defaultVisible:{type:Boolean,default:!1},width:{type:[Number,String]},top:{type:[Number,String]},mask:{type:Boolean,default:!0},title:{type:String},titleAlign:{type:String,default:"center"},alignCenter:{type:Boolean,default:!0},unmountOnClose:Boolean,maskClosable:{type:Boolean,default:!0},hideCancel:{type:Boolean,default:!1},simple:{type:Boolean,default:o=>o.notice},closable:{type:Boolean,default:!0},okText:String,cancelText:String,okLoading:{type:Boolean,default:!1},okButtonProps:{type:Object},cancelButtonProps:{type:Object},footer:{type:Boolean,default:!0},renderToBody:{type:Boolean,default:!0},popupContainer:{type:[String,Object],default:"body"},maskStyle:{type:Object},modalClass:{type:[String,Array]},modalStyle:{type:Object},onBeforeOk:{type:Function},onBeforeCancel:{type:Function},escToClose:{type:Boolean,default:!0},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},maskAnimationName:{type:String,default:o=>o.fullscreen?"fade-in-standard":"fade-modal"},modalAnimationName:{type:String,default:o=>o.fullscreen?"zoom-in":"zoom-modal"},bodyClass:{type:[String,Array]},bodyStyle:{type:[String,Object,Array]},messageType:{type:String},hideTitle:{type:Boolean,default:!1}},emits:{"update:visible":o=>!0,ok:o=>!0,cancel:o=>!0,open:()=>!0,close:()=>!0,beforeOpen:()=>!0,beforeClose:()=>!0},setup(o,{emit:n}){const{fullscreen:s,popupContainer:l,alignCenter:a}=Pt(o),u=ot("modal"),{t:d}=ug(),h=ge(),p=ge(),f=ge(o.defaultVisible),T=j(()=>{var We;return(We=o.visible)!=null?We:f.value}),C=ge(!1),S=j(()=>o.okLoading||C.value),P=j(()=>o.draggable&&!o.fullscreen),{teleportContainer:x,containerRef:G}=mI({popupContainer:l,visible:T}),oe=ge(T.value),ne=j(()=>o.okText||d("modal.okText")),Z=j(()=>o.cancelText||d("modal.cancelText")),{zIndex:Y,isLastDialog:M}=Tg("dialog",{visible:T});let L=!1;const R=We=>{o.escToClose&&We.key===Ss.ESC&&M()&&ke(We)},F=()=>{o.escToClose&&!L&&(L=!0,vo(document.documentElement,"keydown",R))},z=()=>{L=!1,Yo(document.documentElement,"keydown",R)};let X=0;const{position:le,handleMoveDown:$e}=yM({wrapperRef:h,modalRef:p,draggable:P,alignCenter:a}),he=()=>{X++,C.value&&(C.value=!1),f.value=!1,n("update:visible",!1)},fe=async We=>{const Ze=X,nt=await new Promise(async ht=>{var et;if(bo(o.onBeforeOk)){let xe=o.onBeforeOk((w=!0)=>ht(w));if((_1(xe)||!S0(xe))&&(C.value=!0),_1(xe))try{xe=(et=await xe)!=null?et:!0}catch{xe=!1}S0(xe)&&ht(xe)}else ht(!0)});Ze===X&&(nt?(n("ok",We),he()):C.value&&(C.value=!1))},ke=We=>{var Ze;let nt=!0;bo(o.onBeforeCancel)&&(nt=(Ze=o.onBeforeCancel())!=null?Ze:!1),nt&&(n("cancel",We),he())},re=ge(!1),Ie=We=>{We.target===h.value&&(re.value=!0)},D=We=>{o.mask&&o.maskClosable&&re.value&&ke(We)},B=()=>{T.value&&(!Ik(h.value,document.activeElement)&&document.activeElement instanceof HTMLElement&&document.activeElement.blur(),n("open"))},ae=()=>{T.value||(P.value&&(le.value=void 0),oe.value=!1,Me(),n("close"))},{setOverflowHidden:_e,resetOverflow:Me}=Sw(G);zt(()=>{G.value=L0(o.popupContainer),T.value&&(_e(),o.escToClose&&F())}),Ri(()=>{Me(),z()}),Et(T,We=>{f.value!==We&&(f.value=We),We?(n("beforeOpen"),oe.value=!0,re.value=!1,_e(),F()):(n("beforeClose"),z())}),Et(s,()=>{le.value&&(le.value=void 0)});const Xe=j(()=>[`${u}-wrapper`,{[`${u}-wrapper-align-center`]:o.alignCenter&&!o.fullscreen,[`${u}-wrapper-moved`]:!!le.value}]),Je=j(()=>[`${u}`,o.modalClass,{[`${u}-simple`]:o.simple,[`${u}-draggable`]:P.value,[`${u}-fullscreen`]:o.fullscreen}]),we=j(()=>{var We;const Ze=AM({},(We=o.modalStyle)!=null?We:{});return o.width&&!o.fullscreen&&(Ze.width=vt(o.width)?`${o.width}px`:o.width),!o.alignCenter&&o.top&&(Ze.top=vt(o.top)?`${o.top}px`:o.top),le.value&&(Ze.transform=`translate(${le.value[0]}px, ${le.value[1]}px)`),Ze});return{prefixCls:u,mounted:oe,computedVisible:T,containerRef:G,wrapperRef:h,mergedModalStyle:we,okDisplayText:ne,cancelDisplayText:Z,zIndex:Y,handleOk:fe,handleCancel:ke,handleMaskClick:D,handleMaskMouseDown:Ie,handleOpen:B,handleClose:ae,mergedOkLoading:S,modalRef:p,wrapperCls:Xe,modalCls:Je,teleportContainer:x,handleMoveDown:$e}}});function NM(o,n,s,l,a,u){const d=_t("icon-info-circle-fill"),h=_t("icon-check-circle-fill"),p=_t("icon-exclamation-circle-fill"),f=_t("icon-close-circle-fill"),T=_t("icon-close"),C=_t("icon-hover"),S=_t("arco-button"),P=_t("client-only");return me(),it(P,null,{default:De(()=>[(me(),it(lg,{to:o.teleportContainer,disabled:!o.renderToBody},[!o.unmountOnClose||o.computedVisible||o.mounted?Kn((me(),Fe("div",Ot({key:0,class:`${o.prefixCls}-container`,style:{zIndex:o.zIndex}},o.$attrs),[Q(un,{name:o.maskAnimationName,appear:""},{default:De(()=>[o.mask?Kn((me(),Fe("div",{key:0,ref:"maskRef",class:Pe(`${o.prefixCls}-mask`),style:It(o.maskStyle)},null,6)),[[qn,o.computedVisible]]):ut("v-if",!0)]),_:1},8,["name"]),Le("div",{ref:"wrapperRef",class:Pe(o.wrapperCls),onClick:n[2]||(n[2]=er((...x)=>o.handleMaskClick&&o.handleMaskClick(...x),["self"])),onMousedown:n[3]||(n[3]=er((...x)=>o.handleMaskMouseDown&&o.handleMaskMouseDown(...x),["self"]))},[Q(un,{name:o.modalAnimationName,appear:"",onAfterEnter:o.handleOpen,onAfterLeave:o.handleClose},{default:De(()=>[Kn(Le("div",{ref:"modalRef",class:Pe(o.modalCls),style:It(o.mergedModalStyle)},[!o.hideTitle&&(o.$slots.title||o.title||o.closable)?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-header`),onMousedown:n[1]||(n[1]=(...x)=>o.handleMoveDown&&o.handleMoveDown(...x))},[o.$slots.title||o.title?(me(),Fe("div",{key:0,class:Pe([`${o.prefixCls}-title`,`${o.prefixCls}-title-align-${o.titleAlign}`])},[o.messageType?(me(),Fe("div",{key:0,class:Pe(`${o.prefixCls}-title-icon`)},[o.messageType==="info"?(me(),it(d,{key:0})):ut("v-if",!0),o.messageType==="success"?(me(),it(h,{key:1})):ut("v-if",!0),o.messageType==="warning"?(me(),it(p,{key:2})):ut("v-if",!0),o.messageType==="error"?(me(),it(f,{key:3})):ut("v-if",!0)],2)):ut("v-if",!0),ct(o.$slots,"title",{},()=>[Ut(Ci(o.title),1)])],2)):ut("v-if",!0),!o.simple&&o.closable?(me(),Fe("div",{key:1,tabindex:"-1",role:"button","aria-label":"Close",class:Pe(`${o.prefixCls}-close-btn`),onClick:n[0]||(n[0]=(...x)=>o.handleCancel&&o.handleCancel(...x))},[Q(C,null,{default:De(()=>[Q(T)]),_:1})],2)):ut("v-if",!0)],34)):ut("v-if",!0),Le("div",{class:Pe([`${o.prefixCls}-body`,o.bodyClass]),style:It(o.bodyStyle)},[ct(o.$slots,"default")],6),o.footer?(me(),Fe("div",{key:1,class:Pe(`${o.prefixCls}-footer`)},[ct(o.$slots,"footer",{},()=>[o.hideCancel?ut("v-if",!0):(me(),it(S,Ot({key:0},o.cancelButtonProps,{onClick:o.handleCancel}),{default:De(()=>[Ut(Ci(o.cancelDisplayText),1)]),_:1},16,["onClick"])),Q(S,Ot({type:"primary"},o.okButtonProps,{loading:o.mergedOkLoading,onClick:o.handleOk}),{default:De(()=>[Ut(Ci(o.okDisplayText),1)]),_:1},16,["loading","onClick"])])],2)):ut("v-if",!0)],6),[[qn,o.computedVisible]])]),_:3},8,["name","onAfterEnter","onAfterLeave"])],34)],16)),[[qn,o.computedVisible||o.mounted]]):ut("v-if",!0)],8,["to","disabled"]))]),_:3})}var xu=dt(LM,[["render",NM]]),wM=Object.defineProperty,MM=Object.defineProperties,DM=Object.getOwnPropertyDescriptors,$b=Object.getOwnPropertySymbols,PM=Object.prototype.hasOwnProperty,xM=Object.prototype.propertyIsEnumerable,_b=(o,n,s)=>n in o?wM(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Jn=(o,n)=>{for(var s in n||(n={}))PM.call(n,s)&&_b(o,s,n[s]);if($b)for(var s of $b(n))xM.call(n,s)&&_b(o,s,n[s]);return o},BM=(o,n)=>MM(o,DM(n));const Z_=(o,n)=>{let s=Ok("modal");const l=()=>{f.component&&(f.component.props.visible=!1),bo(o.onOk)&&o.onOk()},a=()=>{f.component&&(f.component.props.visible=!1),bo(o.onCancel)&&o.onCancel()},u=async()=>{await Io(),s&&($1(null,s),document.body.removeChild(s)),s=null,bo(o.onClose)&&o.onClose()},d=()=>{f.component&&(f.component.props.visible=!1)},h=T=>{f.component&&Object.entries(T).forEach(([C,S])=>{f.component.props[C]=S})},f=Q(xu,Jn(Jn(Jn({},{visible:!0,renderToBody:!1,unmountOnClose:!0,onOk:l,onCancel:a,onClose:u}),Hc(o,["content","title","footer","visible","unmountOnClose","onOk","onCancel","onClose"])),{footer:typeof o.footer=="boolean"?o.footer:void 0}),{default:l_(o.content),title:l_(o.title),footer:typeof o.footer!="boolean"?l_(o.footer):void 0});return(n??dn._context)&&(f.appContext=n??dn._context),$1(f,s),document.body.appendChild(s),{close:d,update:h}},e0=Jn({open:Z_,confirm:(o,n)=>{const s=Jn({simple:!0,messageType:"warning"},o);return Z_(s,n)}},oA.reduce((o,n)=>(o[n]=(s,l)=>{const a=Jn({simple:!0,hideCancel:!0,messageType:n},s);return Z_(a,l)},o),{})),dn=Object.assign(xu,BM(Jn({},e0),{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+xu.name,xu);const l={};for(const a of Object.keys(e0))l[a]=(u,d=o._context)=>e0[a](u,d);o.config.globalProperties.$modal=l},_context:null}));var t0=Ke({name:"Space",props:{align:{type:String},direction:{type:String,default:"horizontal"},size:{type:[Number,String,Array],default:"small"},wrap:{type:Boolean},fill:{type:Boolean}},setup(o,{slots:n}){const s=ot("space"),l=j(()=>{var h;return(h=o.align)!=null?h:o.direction==="horizontal"?"center":""}),a=j(()=>[s,{[`${s}-${o.direction}`]:o.direction,[`${s}-align-${l.value}`]:l.value,[`${s}-wrap`]:o.wrap,[`${s}-fill`]:o.fill}]);function u(h){if(vt(h))return h;switch(h){case"mini":return 4;case"small":return 8;case"medium":return 16;case"large":return 24;default:return 8}}const d=h=>{const p={},f=`${u(jo(o.size)?o.size[0]:o.size)}px`,T=`${u(jo(o.size)?o.size[1]:o.size)}px`;return h?o.wrap?{marginBottom:T}:{}:(o.direction==="horizontal"&&(p.marginRight=f),(o.direction==="vertical"||o.wrap)&&(p.marginBottom=T),p)};return()=>{var h;const p=Au((h=n.default)==null?void 0:h.call(n),!0).filter(f=>f.type!==ns);return Q("div",{class:a.value},[p.map((f,T)=>{var C,S;const P=n.split&&T>0;return Q(Wt,{key:(C=f.key)!=null?C:`item-${T}`},[P&&Q("div",{class:`${s}-item-split`,style:d(!1)},[(S=n.split)==null?void 0:S.call(n)]),Q("div",{class:`${s}-item`,style:d(T===p.length-1)},[f])])})])}}});const Og=Object.assign(t0,{install:(o,n)=>{Co(o,n);const s=Oo(n);o.component(s+t0.name,t0)}});function DI(o){return o instanceof Map?o.clear=o.delete=o.set=function(){throw new Error("map is read-only")}:o instanceof Set&&(o.add=o.clear=o.delete=function(){throw new Error("set is read-only")}),Object.freeze(o),Object.getOwnPropertyNames(o).forEach(n=>{const s=o[n],l=typeof s;(l==="object"||l==="function")&&!Object.isFrozen(s)&&DI(s)}),o}class gb{constructor(n){n.data===void 0&&(n.data={}),this.data=n.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function PI(o){return o.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function sn(o,...n){const s=Object.create(null);for(const l in o)s[l]=o[l];return n.forEach(function(l){for(const a in l)s[a]=l[a]}),s}const FM="",fb=o=>!!o.scope,UM=(o,{prefix:n})=>{if(o.startsWith("language:"))return o.replace("language:","language-");if(o.includes(".")){const s=o.split(".");return[`${n}${s.shift()}`,...s.map((l,a)=>`${l}${"_".repeat(a+1)}`)].join(" ")}return`${n}${o}`};class HM{constructor(n,s){this.buffer="",this.classPrefix=s.classPrefix,n.walk(this)}addText(n){this.buffer+=PI(n)}openNode(n){if(!fb(n))return;const s=UM(n.scope,{prefix:this.classPrefix});this.span(s)}closeNode(n){fb(n)&&(this.buffer+=FM)}value(){return this.buffer}span(n){this.buffer+=``}}const mb=(o={})=>{const n={children:[]};return Object.assign(n,o),n};class Cg{constructor(){this.rootNode=mb(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(n){this.top.children.push(n)}openNode(n){const s=mb({scope:n});this.add(s),this.stack.push(s)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(n){return this.constructor._walk(n,this.rootNode)}static _walk(n,s){return typeof s=="string"?n.addText(s):s.children&&(n.openNode(s),s.children.forEach(l=>this._walk(n,l)),n.closeNode(s)),n}static _collapse(n){typeof n!="string"&&n.children&&(n.children.every(s=>typeof s=="string")?n.children=[n.children.join("")]:n.children.forEach(s=>{Cg._collapse(s)}))}}class VM extends Cg{constructor(n){super(),this.options=n}addText(n){n!==""&&this.add(n)}startScope(n){this.openNode(n)}endScope(){this.closeNode()}__addSublanguage(n,s){const l=n.root;s&&(l.scope=`language:${s}`),this.add(l)}toHTML(){return new HM(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Bc(o){return o?typeof o=="string"?o:o.source:null}function xI(o){return rr("(?=",o,")")}function GM(o){return rr("(?:",o,")*")}function WM(o){return rr("(?:",o,")?")}function rr(...o){return o.map(s=>Bc(s)).join("")}function zM(o){const n=o[o.length-1];return typeof n=="object"&&n.constructor===Object?(o.splice(o.length-1,1),n):{}}function yg(...o){return"("+(zM(o).capture?"":"?:")+o.map(l=>Bc(l)).join("|")+")"}function BI(o){return new RegExp(o.toString()+"|").exec("").length-1}function XM(o,n){const s=o&&o.exec(n);return s&&s.index===0}const jM=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Sg(o,{joinWith:n}){let s=0;return o.map(l=>{s+=1;const a=s;let u=Bc(l),d="";for(;u.length>0;){const h=jM.exec(u);if(!h){d+=u;break}d+=u.substring(0,h.index),u=u.substring(h.index+h[0].length),h[0][0]==="\\"&&h[1]?d+="\\"+String(Number(h[1])+a):(d+=h[0],h[0]==="("&&s++)}return d}).map(l=>`(${l})`).join(n)}const YM=/\b\B/,FI="[a-zA-Z]\\w*",Rg="[a-zA-Z_]\\w*",UI="\\b\\d+(\\.\\d+)?",HI="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",VI="\\b(0b[01]+)",KM="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",QM=(o={})=>{const n=/^#![ ]*\//;return o.binary&&(o.begin=rr(n,/.*\b/,o.binary,/\b.*/)),sn({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(s,l)=>{s.index!==0&&l.ignoreMatch()}},o)},Fc={begin:"\\\\[\\s\\S]",relevance:0},qM={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Fc]},JM={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Fc]},ZM={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pd=function(o,n,s={}){const l=sn({scope:"comment",begin:o,end:n,contains:[]},s);l.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const a=yg("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return l.contains.push({begin:rr(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),l},e5=pd("//","$"),t5=pd("/\\*","\\*/"),o5=pd("#","$"),s5={scope:"number",begin:UI,relevance:0},i5={scope:"number",begin:HI,relevance:0},n5={scope:"number",begin:VI,relevance:0},r5={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Fc,{begin:/\[/,end:/\]/,relevance:0,contains:[Fc]}]}]},l5={scope:"title",begin:FI,relevance:0},c5={scope:"title",begin:Rg,relevance:0},a5={begin:"\\.\\s*"+Rg,relevance:0},u5=function(o){return Object.assign(o,{"on:begin":(n,s)=>{s.data._beginMatch=n[1]},"on:end":(n,s)=>{s.data._beginMatch!==n[1]&&s.ignoreMatch()}})};var Cu=Object.freeze({__proto__:null,MATCH_NOTHING_RE:YM,IDENT_RE:FI,UNDERSCORE_IDENT_RE:Rg,NUMBER_RE:UI,C_NUMBER_RE:HI,BINARY_NUMBER_RE:VI,RE_STARTERS_RE:KM,SHEBANG:QM,BACKSLASH_ESCAPE:Fc,APOS_STRING_MODE:qM,QUOTE_STRING_MODE:JM,PHRASAL_WORDS_MODE:ZM,COMMENT:pd,C_LINE_COMMENT_MODE:e5,C_BLOCK_COMMENT_MODE:t5,HASH_COMMENT_MODE:o5,NUMBER_MODE:s5,C_NUMBER_MODE:i5,BINARY_NUMBER_MODE:n5,REGEXP_MODE:r5,TITLE_MODE:l5,UNDERSCORE_TITLE_MODE:c5,METHOD_GUARD:a5,END_SAME_AS_BEGIN:u5});function d5(o,n){o.input[o.index-1]==="."&&n.ignoreMatch()}function h5(o,n){o.className!==void 0&&(o.scope=o.className,delete o.className)}function p5(o,n){n&&o.beginKeywords&&(o.begin="\\b("+o.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",o.__beforeBegin=d5,o.keywords=o.keywords||o.beginKeywords,delete o.beginKeywords,o.relevance===void 0&&(o.relevance=0))}function $5(o,n){Array.isArray(o.illegal)&&(o.illegal=yg(...o.illegal))}function _5(o,n){if(o.match){if(o.begin||o.end)throw new Error("begin & end are not supported with match");o.begin=o.match,delete o.match}}function g5(o,n){o.relevance===void 0&&(o.relevance=1)}const f5=(o,n)=>{if(!o.beforeMatch)return;if(o.starts)throw new Error("beforeMatch cannot be used with starts");const s=Object.assign({},o);Object.keys(o).forEach(l=>{delete o[l]}),o.keywords=s.keywords,o.begin=rr(s.beforeMatch,xI(s.begin)),o.starts={relevance:0,contains:[Object.assign(s,{endsParent:!0})]},o.relevance=0,delete s.beforeMatch},m5=["of","and","for","in","not","or","if","then","parent","list","value"],T5="keyword";function GI(o,n,s=T5){const l=Object.create(null);return typeof o=="string"?a(s,o.split(" ")):Array.isArray(o)?a(s,o):Object.keys(o).forEach(function(u){Object.assign(l,GI(o[u],n,u))}),l;function a(u,d){n&&(d=d.map(h=>h.toLowerCase())),d.forEach(function(h){const p=h.split("|");l[p[0]]=[u,E5(p[0],p[1])]})}}function E5(o,n){return n?Number(n):b5(o)?0:1}function b5(o){return m5.includes(o.toLowerCase())}const Tb={},Zn=o=>{console.error(o)},Eb=(o,...n)=>{console.log(`WARN: ${o}`,...n)},tl=(o,n)=>{Tb[`${o}/${n}`]||(console.log(`Deprecated as of ${o}. ${n}`),Tb[`${o}/${n}`]=!0)},ju=new Error;function WI(o,n,{key:s}){let l=0;const a=o[s],u={},d={};for(let h=1;h<=n.length;h++)d[h+l]=a[h],u[h+l]=!0,l+=BI(n[h-1]);o[s]=d,o[s]._emit=u,o[s]._multi=!0}function v5(o){if(Array.isArray(o.begin)){if(o.skip||o.excludeBegin||o.returnBegin)throw Zn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ju;if(typeof o.beginScope!="object"||o.beginScope===null)throw Zn("beginScope must be object"),ju;WI(o,o.begin,{key:"beginScope"}),o.begin=Sg(o.begin,{joinWith:""})}}function I5(o){if(Array.isArray(o.end)){if(o.skip||o.excludeEnd||o.returnEnd)throw Zn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ju;if(typeof o.endScope!="object"||o.endScope===null)throw Zn("endScope must be object"),ju;WI(o,o.end,{key:"endScope"}),o.end=Sg(o.end,{joinWith:""})}}function O5(o){o.scope&&typeof o.scope=="object"&&o.scope!==null&&(o.beginScope=o.scope,delete o.scope)}function C5(o){O5(o),typeof o.beginScope=="string"&&(o.beginScope={_wrap:o.beginScope}),typeof o.endScope=="string"&&(o.endScope={_wrap:o.endScope}),v5(o),I5(o)}function y5(o){function n(d,h){return new RegExp(Bc(d),"m"+(o.case_insensitive?"i":"")+(o.unicodeRegex?"u":"")+(h?"g":""))}class s{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(h,p){p.position=this.position++,this.matchIndexes[this.matchAt]=p,this.regexes.push([p,h]),this.matchAt+=BI(h)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const h=this.regexes.map(p=>p[1]);this.matcherRe=n(Sg(h,{joinWith:"|"}),!0),this.lastIndex=0}exec(h){this.matcherRe.lastIndex=this.lastIndex;const p=this.matcherRe.exec(h);if(!p)return null;const f=p.findIndex((C,S)=>S>0&&C!==void 0),T=this.matchIndexes[f];return p.splice(0,f),Object.assign(p,T)}}class l{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(h){if(this.multiRegexes[h])return this.multiRegexes[h];const p=new s;return this.rules.slice(h).forEach(([f,T])=>p.addRule(f,T)),p.compile(),this.multiRegexes[h]=p,p}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(h,p){this.rules.push([h,p]),p.type==="begin"&&this.count++}exec(h){const p=this.getMatcher(this.regexIndex);p.lastIndex=this.lastIndex;let f=p.exec(h);if(this.resumingScanAtSamePosition()&&!(f&&f.index===this.lastIndex)){const T=this.getMatcher(0);T.lastIndex=this.lastIndex+1,f=T.exec(h)}return f&&(this.regexIndex+=f.position+1,this.regexIndex===this.count&&this.considerAll()),f}}function a(d){const h=new l;return d.contains.forEach(p=>h.addRule(p.begin,{rule:p,type:"begin"})),d.terminatorEnd&&h.addRule(d.terminatorEnd,{type:"end"}),d.illegal&&h.addRule(d.illegal,{type:"illegal"}),h}function u(d,h){const p=d;if(d.isCompiled)return p;[h5,_5,C5,f5].forEach(T=>T(d,h)),o.compilerExtensions.forEach(T=>T(d,h)),d.__beforeBegin=null,[p5,$5,g5].forEach(T=>T(d,h)),d.isCompiled=!0;let f=null;return typeof d.keywords=="object"&&d.keywords.$pattern&&(d.keywords=Object.assign({},d.keywords),f=d.keywords.$pattern,delete d.keywords.$pattern),f=f||/\w+/,d.keywords&&(d.keywords=GI(d.keywords,o.case_insensitive)),p.keywordPatternRe=n(f,!0),h&&(d.begin||(d.begin=/\B|\b/),p.beginRe=n(p.begin),!d.end&&!d.endsWithParent&&(d.end=/\B|\b/),d.end&&(p.endRe=n(p.end)),p.terminatorEnd=Bc(p.end)||"",d.endsWithParent&&h.terminatorEnd&&(p.terminatorEnd+=(d.end?"|":"")+h.terminatorEnd)),d.illegal&&(p.illegalRe=n(d.illegal)),d.contains||(d.contains=[]),d.contains=[].concat(...d.contains.map(function(T){return S5(T==="self"?d:T)})),d.contains.forEach(function(T){u(T,p)}),d.starts&&u(d.starts,h),p.matcher=a(p),p}if(o.compilerExtensions||(o.compilerExtensions=[]),o.contains&&o.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return o.classNameAliases=sn(o.classNameAliases||{}),u(o)}function zI(o){return o?o.endsWithParent||zI(o.starts):!1}function S5(o){return o.variants&&!o.cachedVariants&&(o.cachedVariants=o.variants.map(function(n){return sn(o,{variants:null},n)})),o.cachedVariants?o.cachedVariants:zI(o)?sn(o,{starts:o.starts?sn(o.starts):null}):Object.isFrozen(o)?sn(o):o}var R5="11.8.0";class k5 extends Error{constructor(n,s){super(n),this.name="HTMLInjectionError",this.html=s}}const o0=PI,bb=sn,vb=Symbol("nomatch"),A5=7,XI=function(o){const n=Object.create(null),s=Object.create(null),l=[];let a=!0;const u="Could not find the language '{}', did you forget to load/include a language module?",d={disableAutodetect:!0,name:"Plain text",contains:[]};let h={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:VM};function p(D){return h.noHighlightRe.test(D)}function f(D){let B=D.className+" ";B+=D.parentNode?D.parentNode.className:"";const ae=h.languageDetectRe.exec(B);if(ae){const _e=X(ae[1]);return _e||(Eb(u.replace("{}",ae[1])),Eb("Falling back to no-highlight mode for this block.",D)),_e?ae[1]:"no-highlight"}return B.split(/\s+/).find(_e=>p(_e)||X(_e))}function T(D,B,ae){let _e="",Me="";typeof B=="object"?(_e=D,ae=B.ignoreIllegals,Me=B.language):(tl("10.7.0","highlight(lang, code, ...args) has been deprecated."),tl("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),Me=D,_e=B),ae===void 0&&(ae=!0);const Xe={code:_e,language:Me};re("before:highlight",Xe);const Je=Xe.result?Xe.result:C(Xe.language,Xe.code,ae);return Je.code=Xe.code,re("after:highlight",Je),Je}function C(D,B,ae,_e){const Me=Object.create(null);function Xe(ie,ue){return ie.keywords[ue]}function Je(){if(!se.keywords){ce.addText(Se);return}let ie=0;se.keywordPatternRe.lastIndex=0;let ue=se.keywordPatternRe.exec(Se),ye="";for(;ue;){ye+=Se.substring(ie,ue.index);const E=U.case_insensitive?ue[0].toLowerCase():ue[0],g=Xe(se,E);if(g){const[k,W]=g;if(ce.addText(ye),ye="",Me[E]=(Me[E]||0)+1,Me[E]<=A5&&(Ne+=W),k.startsWith("_"))ye+=ue[0];else{const J=U.classNameAliases[k]||k;Ze(ue[0],J)}}else ye+=ue[0];ie=se.keywordPatternRe.lastIndex,ue=se.keywordPatternRe.exec(Se)}ye+=Se.substring(ie),ce.addText(ye)}function we(){if(Se==="")return;let ie=null;if(typeof se.subLanguage=="string"){if(!n[se.subLanguage]){ce.addText(Se);return}ie=C(se.subLanguage,Se,!0,Ce[se.subLanguage]),Ce[se.subLanguage]=ie._top}else ie=P(Se,se.subLanguage.length?se.subLanguage:null);se.relevance>0&&(Ne+=ie.relevance),ce.__addSublanguage(ie._emitter,ie.language)}function We(){se.subLanguage!=null?we():Je(),Se=""}function Ze(ie,ue){ie!==""&&(ce.startScope(ue),ce.addText(ie),ce.endScope())}function nt(ie,ue){let ye=1;const E=ue.length-1;for(;ye<=E;){if(!ie._emit[ye]){ye++;continue}const g=U.classNameAliases[ie[ye]]||ie[ye],k=ue[ye];g?Ze(k,g):(Se=k,Je(),Se=""),ye++}}function ht(ie,ue){return ie.scope&&typeof ie.scope=="string"&&ce.openNode(U.classNameAliases[ie.scope]||ie.scope),ie.beginScope&&(ie.beginScope._wrap?(Ze(Se,U.classNameAliases[ie.beginScope._wrap]||ie.beginScope._wrap),Se=""):ie.beginScope._multi&&(nt(ie.beginScope,ue),Se="")),se=Object.create(ie,{parent:{value:se}}),se}function et(ie,ue,ye){let E=XM(ie.endRe,ye);if(E){if(ie["on:end"]){const g=new gb(ie);ie["on:end"](ue,g),g.isMatchIgnored&&(E=!1)}if(E){for(;ie.endsParent&&ie.parent;)ie=ie.parent;return ie}}if(ie.endsWithParent)return et(ie.parent,ue,ye)}function xe(ie){return se.matcher.regexIndex===0?(Se+=ie[0],1):(ee=!0,0)}function w(ie){const ue=ie[0],ye=ie.rule,E=new gb(ye),g=[ye.__beforeBegin,ye["on:begin"]];for(const k of g)if(k&&(k(ie,E),E.isMatchIgnored))return xe(ue);return ye.skip?Se+=ue:(ye.excludeBegin&&(Se+=ue),We(),!ye.returnBegin&&!ye.excludeBegin&&(Se=ue)),ht(ye,ie),ye.returnBegin?0:ue.length}function I(ie){const ue=ie[0],ye=B.substring(ie.index),E=et(se,ie,ye);if(!E)return vb;const g=se;se.endScope&&se.endScope._wrap?(We(),Ze(ue,se.endScope._wrap)):se.endScope&&se.endScope._multi?(We(),nt(se.endScope,ie)):g.skip?Se+=ue:(g.returnEnd||g.excludeEnd||(Se+=ue),We(),g.excludeEnd&&(Se=ue));do se.scope&&ce.closeNode(),!se.skip&&!se.subLanguage&&(Ne+=se.relevance),se=se.parent;while(se!==E.parent);return E.starts&&ht(E.starts,ie),g.returnEnd?0:ue.length}function N(){const ie=[];for(let ue=se;ue!==U;ue=ue.parent)ue.scope&&ie.unshift(ue.scope);ie.forEach(ue=>ce.openNode(ue))}let A={};function K(ie,ue){const ye=ue&&ue[0];if(Se+=ie,ye==null)return We(),0;if(A.type==="begin"&&ue.type==="end"&&A.index===ue.index&&ye===""){if(Se+=B.slice(ue.index,ue.index+1),!a){const E=new Error(`0 width match regex (${D})`);throw E.languageName=D,E.badRule=A.rule,E}return 1}if(A=ue,ue.type==="begin")return w(ue);if(ue.type==="illegal"&&!ae){const E=new Error('Illegal lexeme "'+ye+'" for mode "'+(se.scope||"")+'"');throw E.mode=se,E}else if(ue.type==="end"){const E=I(ue);if(E!==vb)return E}if(ue.type==="illegal"&&ye==="")return 1;if(be>1e5&&be>ue.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Se+=ye,ye.length}const U=X(D);if(!U)throw Zn(u.replace("{}",D)),new Error('Unknown language: "'+D+'"');const de=y5(U);let Te="",se=_e||de;const Ce={},ce=new h.__emitter(h);N();let Se="",Ne=0,He=0,be=0,ee=!1;try{if(U.__emitTokens)U.__emitTokens(B,ce);else{for(se.matcher.considerAll();;){be++,ee?ee=!1:se.matcher.considerAll(),se.matcher.lastIndex=He;const ie=se.matcher.exec(B);if(!ie)break;const ue=B.substring(He,ie.index),ye=K(ue,ie);He=ie.index+ye}K(B.substring(He))}return ce.finalize(),Te=ce.toHTML(),{language:D,value:Te,relevance:Ne,illegal:!1,_emitter:ce,_top:se}}catch(ie){if(ie.message&&ie.message.includes("Illegal"))return{language:D,value:o0(B),illegal:!0,relevance:0,_illegalBy:{message:ie.message,index:He,context:B.slice(He-100,He+100),mode:ie.mode,resultSoFar:Te},_emitter:ce};if(a)return{language:D,value:o0(B),illegal:!1,relevance:0,errorRaised:ie,_emitter:ce,_top:se};throw ie}}function S(D){const B={value:o0(D),illegal:!1,relevance:0,_top:d,_emitter:new h.__emitter(h)};return B._emitter.addText(D),B}function P(D,B){B=B||h.languages||Object.keys(n);const ae=S(D),_e=B.filter(X).filter($e).map(We=>C(We,D,!1));_e.unshift(ae);const Me=_e.sort((We,Ze)=>{if(We.relevance!==Ze.relevance)return Ze.relevance-We.relevance;if(We.language&&Ze.language){if(X(We.language).supersetOf===Ze.language)return 1;if(X(Ze.language).supersetOf===We.language)return-1}return 0}),[Xe,Je]=Me,we=Xe;return we.secondBest=Je,we}function x(D,B,ae){const _e=B&&s[B]||ae;D.classList.add("hljs"),D.classList.add(`language-${_e}`)}function G(D){let B=null;const ae=f(D);if(p(ae))return;if(re("before:highlightElement",{el:D,language:ae}),D.children.length>0&&(h.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),h.throwUnescapedHTML))throw new k5("One of your code blocks includes unescaped HTML.",D.innerHTML);B=D;const _e=B.textContent,Me=ae?T(_e,{language:ae,ignoreIllegals:!0}):P(_e);D.innerHTML=Me.value,x(D,ae,Me.language),D.result={language:Me.language,re:Me.relevance,relevance:Me.relevance},Me.secondBest&&(D.secondBest={language:Me.secondBest.language,relevance:Me.secondBest.relevance}),re("after:highlightElement",{el:D,result:Me,text:_e})}function oe(D){h=bb(h,D)}const ne=()=>{M(),tl("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Z(){M(),tl("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Y=!1;function M(){if(document.readyState==="loading"){Y=!0;return}document.querySelectorAll(h.cssSelector).forEach(G)}function L(){Y&&M()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",L,!1);function R(D,B){let ae=null;try{ae=B(o)}catch(_e){if(Zn("Language definition for '{}' could not be registered.".replace("{}",D)),a)Zn(_e);else throw _e;ae=d}ae.name||(ae.name=D),n[D]=ae,ae.rawDefinition=B.bind(null,o),ae.aliases&&le(ae.aliases,{languageName:D})}function F(D){delete n[D];for(const B of Object.keys(s))s[B]===D&&delete s[B]}function z(){return Object.keys(n)}function X(D){return D=(D||"").toLowerCase(),n[D]||n[s[D]]}function le(D,{languageName:B}){typeof D=="string"&&(D=[D]),D.forEach(ae=>{s[ae.toLowerCase()]=B})}function $e(D){const B=X(D);return B&&!B.disableAutodetect}function he(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=B=>{D["before:highlightBlock"](Object.assign({block:B.el},B))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=B=>{D["after:highlightBlock"](Object.assign({block:B.el},B))})}function fe(D){he(D),l.push(D)}function ke(D){const B=l.indexOf(D);B!==-1&&l.splice(B,1)}function re(D,B){const ae=D;l.forEach(function(_e){_e[ae]&&_e[ae](B)})}function Ie(D){return tl("10.7.0","highlightBlock will be removed entirely in v12.0"),tl("10.7.0","Please use highlightElement now."),G(D)}Object.assign(o,{highlight:T,highlightAuto:P,highlightAll:M,highlightElement:G,highlightBlock:Ie,configure:oe,initHighlighting:ne,initHighlightingOnLoad:Z,registerLanguage:R,unregisterLanguage:F,listLanguages:z,getLanguage:X,registerAliases:le,autoDetection:$e,inherit:bb,addPlugin:fe,removePlugin:ke}),o.debugMode=function(){a=!1},o.safeMode=function(){a=!0},o.versionString=R5,o.regex={concat:rr,lookahead:xI,either:yg,optional:WM,anyNumberOfTimes:GM};for(const D in Cu)typeof Cu[D]=="object"&&DI(Cu[D]);return Object.assign(o,Cu),o},pl=XI({});pl.newInstance=()=>XI({});var L5=pl;pl.HighlightJS=pl;pl.default=pl;const yc=CI(L5);var Ib=Ke({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(o){var n=ge(o.language);Et(function(){return o.language},function(a){n.value=a});var s=j(function(){return o.autodetect||!n.value}),l=j(function(){return!s.value&&!yc.getLanguage(n.value)});return{className:j(function(){return l.value?"":"hljs "+n.value}),highlightedCode:j(function(){var a;if(l.value)return console.warn('The language "'+n.value+'" you specified could not be found.'),o.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(s.value){var u=yc.highlightAuto(o.code);return n.value=(a=u.language)!==null&&a!==void 0?a:"",u.value}return(u=yc.highlight(o.code,{language:n.value,ignoreIllegals:o.ignoreIllegals})).value})}},render:function(){return Zs("pre",{},[Zs("code",{class:this.className,innerHTML:this.highlightedCode})])}}),N5={install:function(o){o.component("highlightjs",Ib)},component:Ib};const Ob="[A-Za-z$_][0-9A-Za-z$_]*",w5=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],M5=["true","false","null","undefined","NaN","Infinity"],jI=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],YI=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],KI=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],D5=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],P5=[].concat(KI,jI,YI);function x5(o){const n=o.regex,s=(B,{after:ae})=>{const _e="",end:""},u=/<[A-Za-z0-9\\._:-]+\s*\/>/,d={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,ae)=>{const _e=B[0].length+B.index,Me=B.input[_e];if(Me==="<"||Me===","){ae.ignoreMatch();return}Me===">"&&(s(B,{after:_e})||ae.ignoreMatch());let Xe;const Je=B.input.substring(_e);if(Xe=Je.match(/^\s*=/)){ae.ignoreMatch();return}if((Xe=Je.match(/^\s+extends\s+/))&&Xe.index===0){ae.ignoreMatch();return}}},h={$pattern:Ob,keyword:w5,literal:M5,built_in:P5,"variable.language":D5},p="[0-9](_?[0-9])*",f=`\\.(${p})`,T="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",C={className:"number",variants:[{begin:`(\\b(${T})((${f})|\\.)?|(${f}))[eE][+-]?(${p})\\b`},{begin:`\\b(${T})\\b((${f})\\b|\\.)?|(${f})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},S={className:"subst",begin:"\\$\\{",end:"\\}",keywords:h,contains:[]},P={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"xml"}},x={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"css"}},G={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[o.BACKSLASH_ESCAPE,S],subLanguage:"graphql"}},oe={className:"string",begin:"`",end:"`",contains:[o.BACKSLASH_ESCAPE,S]},Z={className:"comment",variants:[o.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:l+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),o.C_BLOCK_COMMENT_MODE,o.C_LINE_COMMENT_MODE]},Y=[o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,P,x,G,oe,{match:/\$\d+/},C];S.contains=Y.concat({begin:/\{/,end:/\}/,keywords:h,contains:["self"].concat(Y)});const M=[].concat(Z,S.contains),L=M.concat([{begin:/\(/,end:/\)/,keywords:h,contains:["self"].concat(M)}]),R={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:L},F={variants:[{match:[/class/,/\s+/,l,/\s+/,/extends/,/\s+/,n.concat(l,"(",n.concat(/\./,l),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,l],scope:{1:"keyword",3:"title.class"}}]},z={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...jI,...YI]}},X={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},le={variants:[{match:[/function/,/\s+/,l,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},$e={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function he(B){return n.concat("(?!",B.join("|"),")")}const fe={match:n.concat(/\b/,he([...KI,"super","import"]),l,n.lookahead(/\(/)),className:"title.function",relevance:0},ke={begin:n.concat(/\./,n.lookahead(n.concat(l,/(?![0-9A-Za-z$_(])/))),end:l,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},re={match:[/get|set/,/\s+/,l,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},Ie="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+o.UNDERSCORE_IDENT_RE+")\\s*=>",D={match:[/const|var|let/,/\s+/,l,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Ie)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:h,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:z},illegal:/#(?![$_A-z])/,contains:[o.SHEBANG({label:"shebang",binary:"node",relevance:5}),X,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,P,x,G,oe,Z,{match:/\$\d+/},C,z,{className:"attr",begin:l+n.lookahead(":"),relevance:0},D,{begin:"("+o.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Z,o.REGEXP_MODE,{className:"function",begin:Ie,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:o.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:u},{begin:d.begin,"on:begin":d.isTrulyOpeningTag,end:d.end}],subLanguage:"xml",contains:[{begin:d.begin,end:d.end,skip:!0,contains:["self"]}]}]},le,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+o.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,o.inherit(o.TITLE_MODE,{begin:l,className:"title.function"})]},{match:/\.\.\./,relevance:0},ke,{match:"\\$"+l,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},fe,$e,F,re,{match:/\$[(.]/}]}}function B5(o){const n=o.regex,s=/[\p{XID_Start}_]\p{XID_Continue}*/u,l=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],h={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:l,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},p={className:"meta",begin:/^(>>>|\.\.\.) /},f={className:"subst",begin:/\{/,end:/\}/,keywords:h,illegal:/#/},T={begin:/\{\{/,relevance:0},C={className:"string",contains:[o.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[o.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[o.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[o.BACKSLASH_ESCAPE,p,T,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[o.BACKSLASH_ESCAPE,p,T,f]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[o.BACKSLASH_ESCAPE,T,f]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[o.BACKSLASH_ESCAPE,T,f]},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE]},S="[0-9](_?[0-9])*",P=`(\\b(${S}))?\\.(${S})|\\b(${S})\\.`,x=`\\b|${l.join("|")}`,G={className:"number",relevance:0,variants:[{begin:`(\\b(${S})|(${P}))[eE][+-]?(${S})[jJ]?(?=${x})`},{begin:`(${P})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${S})[jJ](?=${x})`}]},oe={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:h,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},ne={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:h,contains:["self",p,G,C,o.HASH_COMMENT_MODE]}]};return f.contains=[C,G,p],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:h,illegal:/(<\/|\?)|=>/,contains:[p,G,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},C,oe,o.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[ne]},{variants:[{match:[/\bclass/,/\s+/,s,/\s*/,/\(\s*/,s,/\s*\)/]},{match:[/\bclass/,/\s+/,s]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[G,ne,C]}]}}var F5=!1;/*! + * pinia v2.1.6 + * (c) 2023 Eduardo San Martin Morote + * @license MIT + */let QI;const $d=o=>QI=o,qI=Symbol();function P0(o){return o&&typeof o=="object"&&Object.prototype.toString.call(o)==="[object Object]"&&typeof o.toJSON!="function"}var Sc;(function(o){o.direct="direct",o.patchObject="patch object",o.patchFunction="patch function"})(Sc||(Sc={}));function U5(){const o=qb(!0),n=o.run(()=>ge({}));let s=[],l=[];const a=Zu({install(u){$d(a),a._a=u,u.provide(qI,a),u.config.globalProperties.$pinia=a,l.forEach(d=>s.push(d)),l=[]},use(u){return!this._a&&!F5?l.push(u):s.push(u),this},_p:s,_a:null,_e:o,_s:new Map,state:n});return a}const JI=()=>{};function Cb(o,n,s,l=JI){o.push(n);const a=()=>{const u=o.indexOf(n);u>-1&&(o.splice(u,1),l())};return!s&&G0()&&Jb(a),a}function ol(o,...n){o.slice().forEach(s=>{s(...n)})}const H5=o=>o();function x0(o,n){o instanceof Map&&n instanceof Map&&n.forEach((s,l)=>o.set(l,s)),o instanceof Set&&n instanceof Set&&n.forEach(o.add,o);for(const s in n){if(!n.hasOwnProperty(s))continue;const l=n[s],a=o[s];P0(a)&&P0(l)&&o.hasOwnProperty(s)&&!eo(l)&&!rn(l)?o[s]=x0(a,l):o[s]=l}return o}const V5=Symbol();function G5(o){return!P0(o)||!o.hasOwnProperty(V5)}const{assign:en}=Object;function W5(o){return!!(eo(o)&&o.effect)}function z5(o,n,s,l){const{state:a,actions:u,getters:d}=n,h=s.state.value[o];let p;function f(){h||(s.state.value[o]=a?a():{});const T=Pt(s.state.value[o]);return en(T,u,Object.keys(d||{}).reduce((C,S)=>(C[S]=Zu(j(()=>{$d(s);const P=s._s.get(o);return d[S].call(P,P)})),C),{}))}return p=ZI(o,f,n,s,l,!0),p}function ZI(o,n,s={},l,a,u){let d;const h=en({actions:{}},s),p={deep:!0};let f,T,C=[],S=[],P;const x=l.state.value[o];!u&&!x&&(l.state.value[o]={}),ge({});let G;function oe(z){let X;f=T=!1,typeof z=="function"?(z(l.state.value[o]),X={type:Sc.patchFunction,storeId:o,events:P}):(x0(l.state.value[o],z),X={type:Sc.patchObject,payload:z,storeId:o,events:P});const le=G=Symbol();Io().then(()=>{G===le&&(f=!0)}),T=!0,ol(C,X,l.state.value[o])}const ne=u?function(){const{state:X}=s,le=X?X():{};this.$patch($e=>{en($e,le)})}:JI;function Z(){d.stop(),C=[],S=[],l._s.delete(o)}function Y(z,X){return function(){$d(l);const le=Array.from(arguments),$e=[],he=[];function fe(Ie){$e.push(Ie)}function ke(Ie){he.push(Ie)}ol(S,{args:le,name:z,store:L,after:fe,onError:ke});let re;try{re=X.apply(this&&this.$id===o?this:L,le)}catch(Ie){throw ol(he,Ie),Ie}return re instanceof Promise?re.then(Ie=>(ol($e,Ie),Ie)).catch(Ie=>(ol(he,Ie),Promise.reject(Ie))):(ol($e,re),re)}}const M={_p:l,$id:o,$onAction:Cb.bind(null,S),$patch:oe,$reset:ne,$subscribe(z,X={}){const le=Cb(C,z,X.detached,()=>$e()),$e=d.run(()=>Et(()=>l.state.value[o],he=>{(X.flush==="sync"?T:f)&&z({storeId:o,type:Sc.direct,events:P},he)},en({},p,X)));return le},$dispose:Z},L=Jt(M);l._s.set(o,L);const R=l._a&&l._a.runWithContext||H5,F=l._e.run(()=>(d=qb(),R(()=>d.run(n))));for(const z in F){const X=F[z];if(eo(X)&&!W5(X)||rn(X))u||(x&&G5(X)&&(eo(X)?X.value=x[z]:x0(X,x[z])),l.state.value[o][z]=X);else if(typeof X=="function"){const le=Y(z,X);F[z]=le,h.actions[z]=X}}return en(L,F),en(Ct(L),F),Object.defineProperty(L,"$state",{get:()=>l.state.value[o],set:z=>{oe(X=>{en(X,z)})}}),l._p.forEach(z=>{en(L,d.run(()=>z({store:L,app:l._a,pinia:l,options:h})))}),x&&u&&s.hydrate&&s.hydrate(L.$state,x),f=!0,T=!0,L}function X5(o,n,s){let l,a;const u=typeof n=="function";typeof o=="string"?(l=o,a=u?s:n):(a=o,l=o.id);function d(h,p){const f=UR();return h=h||(f?ho(qI,null):null),h&&$d(h),h=QI,h._s.has(l)||(u?ZI(l,n,a,h):z5(l,a,h)),h._s.get(l)}return d.$id=l,d}const j5="modulepreload",Y5=function(o){return"/"+o},yb={},K5=function(n,s,l){if(!s||s.length===0)return n();const a=document.getElementsByTagName("link");return Promise.all(s.map(u=>{if(u=Y5(u),u in yb)return;yb[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!l)for(let T=a.length-1;T>=0;T--){const C=a[T];if(C.href===u&&(!d||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":j5,d||(f.as="script",f.crossOrigin=""),f.href=u,document.head.appendChild(f),d)return new Promise((T,C)=>{f.addEventListener("load",T),f.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${u}`)))})})).then(()=>n()).catch(u=>{const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u})};function Q5(o={}){const{immediate:n=!1,onNeedRefresh:s,onOfflineReady:l,onRegistered:a,onRegisteredSW:u,onRegisterError:d}=o;let h,p,f;const T=async(S=!0)=>{await p,await(f==null?void 0:f())};async function C(){if("serviceWorker"in navigator){const{Workbox:S}=await K5(()=>import("./workbox-window.prod.es5-a7b12eab.js"),[]);h=new S("/sw.js",{scope:"/",type:"classic"}),f=async()=>{await(h==null?void 0:h.messageSkipWaiting())};{let P=!1;const x=()=>{P=!0,h==null||h.addEventListener("controlling",G=>{G.isUpdate&&window.location.reload()}),s==null||s()};h.addEventListener("installed",G=>{typeof G.isUpdate>"u"?typeof G.isExternal<"u"?G.isExternal?x():!P&&(l==null||l()):G.isExternal?window.location.reload():!P&&(l==null||l()):G.isUpdate||l==null||l()}),h.addEventListener("waiting",x),h.addEventListener("externalwaiting",x)}h.register({immediate:n}).then(P=>{u?u("/sw.js",P):a==null||a(P)}).catch(P=>{d==null||d(P)})}}return p=C(),T}(function(){window.__iconpark__=window.__iconpark__||{};var o=JSON.parse('{"991983":{"viewBox":"0 0 24 24","fill":"none","content":""},"991984":{"viewBox":"0 0 24 24","fill":"none","content":""},"991985":{"viewBox":"0 0 24 24","fill":"none","content":""},"991986":{"viewBox":"0 0 24 24","fill":"none","content":""},"991987":{"viewBox":"0 0 24 24","fill":"none","content":""},"991988":{"viewBox":"0 0 24 24","fill":"none","content":""},"991989":{"viewBox":"0 0 24 24","fill":"none","content":""},"991990":{"viewBox":"0 0 24 24","fill":"none","content":""},"991991":{"viewBox":"0 0 24 24","fill":"none","content":""},"991992":{"viewBox":"0 0 24 24","fill":"none","content":""},"991993":{"viewBox":"0 0 24 24","fill":"none","content":""},"991994":{"viewBox":"0 0 24 24","fill":"none","content":""},"991995":{"viewBox":"0 0 24 24","fill":"none","content":""},"991996":{"viewBox":"0 0 24 24","fill":"none","content":""},"992011":{"viewBox":"0 0 24 24","fill":"none","content":""},"995695":{"viewBox":"0 0 24 24","fill":"none","content":""},"995696":{"viewBox":"0 0 24 24","fill":"none","content":""},"995697":{"viewBox":"0 0 24 24","fill":"none","content":""},"995826":{"viewBox":"0 0 48 48","fill":"none","content":""}}');for(var n in o)window.__iconpark__[n]=o[n];var s={variable:991983,color:991984,html:991985,frame:991986,controller:991987,calculation:991988,list:991989,text:991990,css:991991,"php-mysql":991992,"php-basic":991993,echo:991994,cdn:991995,receive:991996,"php-form":992011,"php-file":995695,"php-hash":995696,"php-session":995697,function:995826};for(var l in s)window.__iconpark__[l]=o[s[l]]})();typeof globalThis!="object"&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);(()=>{var o={816:(l,a,u)=>{var d,h,p,f;u.d(a,{Vm:()=>et,dy:()=>he,Jb:()=>ke,Ld:()=>re,sY:()=>D,YP:()=>fe});const T=globalThis.trustedTypes,C=T?T.createPolicy("lit-html",{createHTML:xe=>xe}):void 0,S=`lit$${(Math.random()+"").slice(9)}$`,P="?"+S,x=`<${P}>`,G=document,oe=(xe="")=>G.createComment(xe),ne=xe=>xe===null||typeof xe!="object"&&typeof xe!="function",Z=Array.isArray,Y=xe=>{var w;return Z(xe)||typeof((w=xe)===null||w===void 0?void 0:w[Symbol.iterator])=="function"},M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,R=/>/g,F=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,z=/'/g,X=/"/g,le=/^(?:script|style|textarea)$/i,$e=xe=>(w,...I)=>({_$litType$:xe,strings:w,values:I}),he=$e(1),fe=$e(2),ke=Symbol.for("lit-noChange"),re=Symbol.for("lit-nothing"),Ie=new WeakMap,D=(xe,w,I)=>{var N,A;const K=(N=I==null?void 0:I.renderBefore)!==null&&N!==void 0?N:w;let U=K._$litPart$;if(U===void 0){const de=(A=I==null?void 0:I.renderBefore)!==null&&A!==void 0?A:null;K._$litPart$=U=new Je(w.insertBefore(oe(),de),de,void 0,I)}return U.I(xe),U},B=G.createTreeWalker(G,129,null,!1),ae=(xe,w)=>{const I=xe.length-1,N=[];let A,K=w===2?"":"",U=M;for(let Te=0;Te"?(U=A??M,Se=-1):ce[1]===void 0?Se=-2:(Se=U.lastIndex-ce[2].length,Ce=ce[1],U=ce[3]===void 0?F:ce[3]==='"'?X:z):U===X||U===z?U=F:U===L||U===R?U=M:(U=F,A=void 0);const He=U===F&&xe[Te+1].startsWith("/>")?" ":"";K+=U===M?se+x:Se>=0?(N.push(Ce),se.slice(0,Se)+"$lit$"+se.slice(Se)+S+He):se+S+(Se===-2?(N.push(void 0),Te):He)}const de=K+(xe[I]||"")+(w===2?"":"");return[C!==void 0?C.createHTML(de):de,N]};class _e{constructor({strings:w,_$litType$:I},N){let A;this.parts=[];let K=0,U=0;const de=w.length-1,Te=this.parts,[se,Ce]=ae(w,I);if(this.el=_e.createElement(se,N),B.currentNode=this.el.content,I===2){const ce=this.el.content,Se=ce.firstChild;Se.remove(),ce.append(...Se.childNodes)}for(;(A=B.nextNode())!==null&&Te.length0){A.textContent=T?T.emptyScript:"";for(let Ne=0;Ne2||N[0]!==""||N[1]!==""?(this.H=Array(N.length-1).fill(re),this.strings=N):this.H=re}get tagName(){return this.element.tagName}I(w,I=this,N,A){const K=this.strings;let U=!1;if(K===void 0)w=Me(this,w,I,0),U=!ne(w)||w!==this.H&&w!==ke,U&&(this.H=w);else{const de=w;let Te,se;for(w=K[0],Te=0;Te{u.r(a),u.d(a,{customElement:()=>d,eventOptions:()=>C,property:()=>p,query:()=>S,queryAll:()=>P,queryAssignedNodes:()=>ne,queryAsync:()=>x,state:()=>f});const d=Z=>Y=>typeof Y=="function"?((M,L)=>(window.customElements.define(M,L),L))(Z,Y):((M,L)=>{const{kind:R,elements:F}=L;return{kind:R,elements:F,finisher(z){window.customElements.define(M,z)}}})(Z,Y),h=(Z,Y)=>Y.kind==="method"&&Y.descriptor&&!("value"in Y.descriptor)?{...Y,finisher(M){M.createProperty(Y.key,Z)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:Y.key,initializer(){typeof Y.initializer=="function"&&(this[Y.key]=Y.initializer.call(this))},finisher(M){M.createProperty(Y.key,Z)}};function p(Z){return(Y,M)=>M!==void 0?((L,R,F)=>{R.constructor.createProperty(F,L)})(Z,Y,M):h(Z,Y)}function f(Z){return p({...Z,state:!0,attribute:!1})}const T=({finisher:Z,descriptor:Y})=>(M,L)=>{var R;if(L===void 0){const F=(R=M.originalKey)!==null&&R!==void 0?R:M.key,z=Y!=null?{kind:"method",placement:"prototype",key:F,descriptor:Y(M.key)}:{...M,key:F};return Z!=null&&(z.finisher=function(X){Z(X,F)}),z}{const F=M.constructor;Y!==void 0&&Object.defineProperty(M,L,Y(L)),Z==null||Z(F,L)}};function C(Z){return T({finisher:(Y,M)=>{Object.assign(Y.prototype[M],Z)}})}function S(Z,Y){return T({descriptor:M=>{const L={get(){var R;return(R=this.renderRoot)===null||R===void 0?void 0:R.querySelector(Z)},enumerable:!0,configurable:!0};if(Y){const R=typeof M=="symbol"?Symbol():"__"+M;L.get=function(){var F;return this[R]===void 0&&(this[R]=(F=this.renderRoot)===null||F===void 0?void 0:F.querySelector(Z)),this[R]}}return L}})}function P(Z){return T({descriptor:Y=>({get(){var M;return(M=this.renderRoot)===null||M===void 0?void 0:M.querySelectorAll(Z)},enumerable:!0,configurable:!0})})}function x(Z){return T({descriptor:Y=>({async get(){var M;return await this.updateComplete,(M=this.renderRoot)===null||M===void 0?void 0:M.querySelector(Z)},enumerable:!0,configurable:!0})})}const G=Element.prototype,oe=G.msMatchesSelector||G.webkitMatchesSelector;function ne(Z="",Y=!1,M=""){return T({descriptor:L=>({get(){var R,F;const z="slot"+(Z?`[name=${Z}]`:":not([name])");let X=(F=(R=this.renderRoot)===null||R===void 0?void 0:R.querySelector(z))===null||F===void 0?void 0:F.assignedNodes({flatten:Y});return X&&M&&(X=X.filter(le=>le.nodeType===Node.ELEMENT_NODE&&(le.matches?le.matches(M):oe.call(le,M)))),X},enumerable:!0,configurable:!0})})}},23:(l,a,u)=>{u.r(a),u.d(a,{unsafeSVG:()=>T});const d=C=>(...S)=>({_$litDirective$:C,values:S});var h=u(816);class p extends class{constructor(S){}T(S,P,x){this.Σdt=S,this.M=P,this.Σct=x}S(S,P){return this.update(S,P)}update(S,P){return this.render(...P)}}{constructor(S){if(super(S),this.vt=h.Ld,S.type!==2)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(S){if(S===h.Ld)return this.Vt=void 0,this.vt=S;if(S===h.Jb)return S;if(typeof S!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(S===this.vt)return this.Vt;this.vt=S;const P=[S];return P.raw=P,this.Vt={_$litType$:this.constructor.resultType,strings:P,values:[]}}}p.directiveName="unsafeHTML",p.resultType=1;class f extends p{}f.directiveName="unsafeSVG",f.resultType=2;const T=d(f)},249:(l,a,u)=>{u.r(a),u.d(a,{CSSResult:()=>f,LitElement:()=>ke,ReactiveElement:()=>R,UpdatingElement:()=>fe,_Σ:()=>d.Vm,_Φ:()=>re,adoptStyles:()=>P,css:()=>S,defaultConverter:()=>Y,getCompatibleStyle:()=>x,html:()=>d.dy,noChange:()=>d.Jb,notEqual:()=>M,nothing:()=>d.Ld,render:()=>d.sY,supportsAdoptingStyleSheets:()=>h,svg:()=>d.YP,unsafeCSS:()=>T});var d=u(816);const h=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,p=Symbol();class f{constructor(D,B){if(B!==p)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=D}get styleSheet(){return h&&this.t===void 0&&(this.t=new CSSStyleSheet,this.t.replaceSync(this.cssText)),this.t}toString(){return this.cssText}}const T=Ie=>new f(Ie+"",p),C=new Map,S=(Ie,...D)=>{const B=D.reduce((_e,Me,Xe)=>_e+(Je=>{if(Je instanceof f)return Je.cssText;if(typeof Je=="number")return Je;throw Error(`Value passed to 'css' function must be a 'css' function result: ${Je}. Use 'unsafeCSS' to pass non-literal values, but + take care to ensure page security.`)})(Me)+Ie[Xe+1],Ie[0]);let ae=C.get(B);return ae===void 0&&C.set(B,ae=new f(B,p)),ae},P=(Ie,D)=>{h?Ie.adoptedStyleSheets=D.map(B=>B instanceof CSSStyleSheet?B:B.styleSheet):D.forEach(B=>{const ae=document.createElement("style");ae.textContent=B.cssText,Ie.appendChild(ae)})},x=h?Ie=>Ie:Ie=>Ie instanceof CSSStyleSheet?(D=>{let B="";for(const ae of D.cssRules)B+=ae.cssText;return T(B)})(Ie):Ie;var G,oe,ne,Z;const Y={toAttribute(Ie,D){switch(D){case Boolean:Ie=Ie?"":null;break;case Object:case Array:Ie=Ie==null?Ie:JSON.stringify(Ie)}return Ie},fromAttribute(Ie,D){let B=Ie;switch(D){case Boolean:B=Ie!==null;break;case Number:B=Ie===null?null:Number(Ie);break;case Object:case Array:try{B=JSON.parse(Ie)}catch{B=null}}return B}},M=(Ie,D)=>D!==Ie&&(D==D||Ie==Ie),L={attribute:!0,type:String,converter:Y,reflect:!1,hasChanged:M};class R extends HTMLElement{constructor(){super(),this.Πi=new Map,this.Πo=void 0,this.Πl=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.Πh=null,this.u()}static addInitializer(D){var B;(B=this.v)!==null&&B!==void 0||(this.v=[]),this.v.push(D)}static get observedAttributes(){this.finalize();const D=[];return this.elementProperties.forEach((B,ae)=>{const _e=this.Πp(ae,B);_e!==void 0&&(this.Πm.set(_e,ae),D.push(_e))}),D}static createProperty(D,B=L){if(B.state&&(B.attribute=!1),this.finalize(),this.elementProperties.set(D,B),!B.noAccessor&&!this.prototype.hasOwnProperty(D)){const ae=typeof D=="symbol"?Symbol():"__"+D,_e=this.getPropertyDescriptor(D,ae,B);_e!==void 0&&Object.defineProperty(this.prototype,D,_e)}}static getPropertyDescriptor(D,B,ae){return{get(){return this[B]},set(_e){const Me=this[D];this[B]=_e,this.requestUpdate(D,Me,ae)},configurable:!0,enumerable:!0}}static getPropertyOptions(D){return this.elementProperties.get(D)||L}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const D=Object.getPrototypeOf(this);if(D.finalize(),this.elementProperties=new Map(D.elementProperties),this.Πm=new Map,this.hasOwnProperty("properties")){const B=this.properties,ae=[...Object.getOwnPropertyNames(B),...Object.getOwnPropertySymbols(B)];for(const _e of ae)this.createProperty(_e,B[_e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(D){const B=[];if(Array.isArray(D)){const ae=new Set(D.flat(1/0).reverse());for(const _e of ae)B.unshift(x(_e))}else D!==void 0&&B.push(x(D));return B}static Πp(D,B){const ae=B.attribute;return ae===!1?void 0:typeof ae=="string"?ae:typeof D=="string"?D.toLowerCase():void 0}u(){var D;this.Πg=new Promise(B=>this.enableUpdating=B),this.L=new Map,this.Π_(),this.requestUpdate(),(D=this.constructor.v)===null||D===void 0||D.forEach(B=>B(this))}addController(D){var B,ae;((B=this.ΠU)!==null&&B!==void 0?B:this.ΠU=[]).push(D),this.renderRoot!==void 0&&this.isConnected&&((ae=D.hostConnected)===null||ae===void 0||ae.call(D))}removeController(D){var B;(B=this.ΠU)===null||B===void 0||B.splice(this.ΠU.indexOf(D)>>>0,1)}Π_(){this.constructor.elementProperties.forEach((D,B)=>{this.hasOwnProperty(B)&&(this.Πi.set(B,this[B]),delete this[B])})}createRenderRoot(){var D;const B=(D=this.shadowRoot)!==null&&D!==void 0?D:this.attachShadow(this.constructor.shadowRootOptions);return P(B,this.constructor.elementStyles),B}connectedCallback(){var D;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(D=this.ΠU)===null||D===void 0||D.forEach(B=>{var ae;return(ae=B.hostConnected)===null||ae===void 0?void 0:ae.call(B)}),this.Πl&&(this.Πl(),this.Πo=this.Πl=void 0)}enableUpdating(D){}disconnectedCallback(){var D;(D=this.ΠU)===null||D===void 0||D.forEach(B=>{var ae;return(ae=B.hostDisconnected)===null||ae===void 0?void 0:ae.call(B)}),this.Πo=new Promise(B=>this.Πl=B)}attributeChangedCallback(D,B,ae){this.K(D,ae)}Πj(D,B,ae=L){var _e,Me;const Xe=this.constructor.Πp(D,ae);if(Xe!==void 0&&ae.reflect===!0){const Je=((Me=(_e=ae.converter)===null||_e===void 0?void 0:_e.toAttribute)!==null&&Me!==void 0?Me:Y.toAttribute)(B,ae.type);this.Πh=D,Je==null?this.removeAttribute(Xe):this.setAttribute(Xe,Je),this.Πh=null}}K(D,B){var ae,_e,Me;const Xe=this.constructor,Je=Xe.Πm.get(D);if(Je!==void 0&&this.Πh!==Je){const we=Xe.getPropertyOptions(Je),We=we.converter,Ze=(Me=(_e=(ae=We)===null||ae===void 0?void 0:ae.fromAttribute)!==null&&_e!==void 0?_e:typeof We=="function"?We:null)!==null&&Me!==void 0?Me:Y.fromAttribute;this.Πh=Je,this[Je]=Ze(B,we.type),this.Πh=null}}requestUpdate(D,B,ae){let _e=!0;D!==void 0&&(((ae=ae||this.constructor.getPropertyOptions(D)).hasChanged||M)(this[D],B)?(this.L.has(D)||this.L.set(D,B),ae.reflect===!0&&this.Πh!==D&&(this.Πk===void 0&&(this.Πk=new Map),this.Πk.set(D,ae))):_e=!1),!this.isUpdatePending&&_e&&(this.Πg=this.Πq())}async Πq(){this.isUpdatePending=!0;try{for(await this.Πg;this.Πo;)await this.Πo}catch(B){Promise.reject(B)}const D=this.performUpdate();return D!=null&&await D,!this.isUpdatePending}performUpdate(){var D;if(!this.isUpdatePending)return;this.hasUpdated,this.Πi&&(this.Πi.forEach((_e,Me)=>this[Me]=_e),this.Πi=void 0);let B=!1;const ae=this.L;try{B=this.shouldUpdate(ae),B?(this.willUpdate(ae),(D=this.ΠU)===null||D===void 0||D.forEach(_e=>{var Me;return(Me=_e.hostUpdate)===null||Me===void 0?void 0:Me.call(_e)}),this.update(ae)):this.Π$()}catch(_e){throw B=!1,this.Π$(),_e}B&&this.E(ae)}willUpdate(D){}E(D){var B;(B=this.ΠU)===null||B===void 0||B.forEach(ae=>{var _e;return(_e=ae.hostUpdated)===null||_e===void 0?void 0:_e.call(ae)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(D)),this.updated(D)}Π$(){this.L=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.Πg}shouldUpdate(D){return!0}update(D){this.Πk!==void 0&&(this.Πk.forEach((B,ae)=>this.Πj(ae,this[ae],B)),this.Πk=void 0),this.Π$()}updated(D){}firstUpdated(D){}}var F,z,X,le,$e,he;R.finalized=!0,R.shadowRootOptions={mode:"open"},(oe=(G=globalThis).reactiveElementPlatformSupport)===null||oe===void 0||oe.call(G,{ReactiveElement:R}),((ne=(Z=globalThis).reactiveElementVersions)!==null&&ne!==void 0?ne:Z.reactiveElementVersions=[]).push("1.0.0-rc.1");const fe=R;((F=(he=globalThis).litElementVersions)!==null&&F!==void 0?F:he.litElementVersions=[]).push("3.0.0-rc.1");class ke extends R{constructor(){super(...arguments),this.renderOptions={host:this},this.Φt=void 0}createRenderRoot(){var D,B;const ae=super.createRenderRoot();return(D=(B=this.renderOptions).renderBefore)!==null&&D!==void 0||(B.renderBefore=ae.firstChild),ae}update(D){const B=this.render();super.update(D),this.Φt=(0,d.sY)(B,this.renderRoot,this.renderOptions)}connectedCallback(){var D;super.connectedCallback(),(D=this.Φt)===null||D===void 0||D.setConnected(!0)}disconnectedCallback(){var D;super.disconnectedCallback(),(D=this.Φt)===null||D===void 0||D.setConnected(!1)}render(){return d.Jb}}ke.finalized=!0,ke._$litElement$=!0,(X=(z=globalThis).litElementHydrateSupport)===null||X===void 0||X.call(z,{LitElement:ke}),($e=(le=globalThis).litElementPlatformSupport)===null||$e===void 0||$e.call(le,{LitElement:ke});const re={K:(Ie,D,B)=>{Ie.K(D,B)},L:Ie=>Ie.L}},409:function(l,a,u){var d=this&&this.__decorate||function(P,x,G,oe){var ne,Z=arguments.length,Y=Z<3?x:oe===null?oe=Object.getOwnPropertyDescriptor(x,G):oe;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(P,x,G,oe);else for(var M=P.length-1;M>=0;M--)(ne=P[M])&&(Y=(Z<3?ne(Y):Z>3?ne(x,G,Y):ne(x,G))||Y);return Z>3&&Y&&Object.defineProperty(x,G,Y),Y};Object.defineProperty(a,"__esModule",{value:!0}),a.IconparkIconElement=void 0;const h=u(249),p=u(26),f=u(23),T={color:1,fill:1,stroke:1},C={STROKE:{trackAttr:"data-follow-stroke",rawAttr:"stroke"},FILL:{trackAttr:"data-follow-fill",rawAttr:"fill"}};class S extends h.LitElement{constructor(){super(...arguments),this.name="",this.identifyer="",this.size="1em"}get _width(){return this.width||this.size}get _height(){return this.height||this.size}get _stroke(){return this.stroke||this.color}get _fill(){return this.fill||this.color}get SVGConfig(){return(window.__iconpark__||{})[this.identifyer]||(window.__iconpark__||{})[this.name]||{viewBox:"0 0 0 0",content:""}}connectedCallback(){super.connectedCallback(),setTimeout(()=>{this.monkeyPatch("STROKE",!0),this.monkeyPatch("FILL",!0)})}monkeyPatch(x,G){switch(x){case"STROKE":this.updateDOMByHand(this.strokeAppliedNodes,"STROKE",this._stroke,!!G);break;case"FILL":this.updateDOMByHand(this.fillAppliedNodes,"FILL",this._fill,!!G)}}updateDOMByHand(x,G,oe,ne){!oe&&ne||x&&x.forEach(Z=>{oe&&oe===Z.getAttribute(C[G].rawAttr)||Z.setAttribute(C[G].rawAttr,oe||Z.getAttribute(C[G].trackAttr))})}attributeChangedCallback(x,G,oe){super.attributeChangedCallback(x,G,oe),x==="name"||x==="identifyer"?setTimeout(()=>{this.monkeyPatch("STROKE"),this.monkeyPatch("FILL")}):T[x]&&(this.monkeyPatch("STROKE"),this.monkeyPatch("FILL"))}render(){return h.svg`${f.unsafeSVG(this.SVGConfig.content)}`}}S.styles=h.css`:host {display: inline-flex; align-items: center; justify-content: center;} :host([spin]) svg {animation: iconpark-spin 1s infinite linear;} :host([spin][rtl]) svg {animation: iconpark-spin-rtl 1s infinite linear;} :host([rtl]) svg {transform: scaleX(-1);} @keyframes iconpark-spin {0% { -webkit-transform: rotate(0); transform: rotate(0);} 100% {-webkit-transform: rotate(360deg); transform: rotate(360deg);}} @keyframes iconpark-spin-rtl {0% {-webkit-transform: scaleX(-1) rotate(0); transform: scaleX(-1) rotate(0);} 100% {-webkit-transform: scaleX(-1) rotate(360deg); transform: scaleX(-1) rotate(360deg);}}`,d([p.property({reflect:!0})],S.prototype,"name",void 0),d([p.property({reflect:!0,attribute:"icon-id"})],S.prototype,"identifyer",void 0),d([p.property({reflect:!0})],S.prototype,"color",void 0),d([p.property({reflect:!0})],S.prototype,"stroke",void 0),d([p.property({reflect:!0})],S.prototype,"fill",void 0),d([p.property({reflect:!0})],S.prototype,"size",void 0),d([p.property({reflect:!0})],S.prototype,"width",void 0),d([p.property({reflect:!0})],S.prototype,"height",void 0),d([p.queryAll(`[${C.STROKE.trackAttr}]`)],S.prototype,"strokeAppliedNodes",void 0),d([p.queryAll(`[${C.FILL.trackAttr}]`)],S.prototype,"fillAppliedNodes",void 0),a.IconparkIconElement=S,customElements.get("iconpark-icon")||customElements.define("iconpark-icon",S)}},n={};function s(l){var a=n[l];if(a!==void 0)return a.exports;var u=n[l]={exports:{}};return o[l].call(u.exports,u,u.exports,s),u.exports}s.d=(l,a)=>{for(var u in a)s.o(a,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:a[u]})},s.o=(l,a)=>Object.prototype.hasOwnProperty.call(l,a),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})},s(409)})();var e2={exports:{}},s0={exports:{}},i0={exports:{}},n0={exports:{}},r0={exports:{}},Sb;function _d(){return Sb||(Sb=1,function(o,n){(function(s,l){o.exports=l()})(Do,function(){var s={},l,a,u,d,h,p,f,T,C,S,P,x,G,oe,ne,Z,Y,M,L,R,F,z,X,le,$e,he,fe,ke,re,Ie,D,B,ae,_e,Me,Xe,Je,we,We,Ze,nt,ht,et,xe,w,I,N,A,K,U,de,Te,se,Ce,ce,Se,Ne,He,be,ee,ie,ue,ye,E,g,k,W,J,Ee,ze,yt,ls,ii,xt,Qo,Ht,ws,qo,b,O,_,m,y,V,ve,Ge,rt,Mt,po,Be,wt,Dt,bl,Ai,pn,vl,cs,gd,Il,Ag,fd,Ms,Li,md,Td,Wc,Ed,$n,zc,bd,vd,Lg,Ng,Id,cr,Ds,Od,Cd,yd,Sd,Rd,wg,kd,Ol,Mg,Dg,Ni,Ad,Ps,Pg,xg,Bg,wi,Ld,Fg,Ug,Hg,Vg,Gg,Nd,Wg,zg,Xc,Xg,jg,wd,jc,Yg,xs,Kg,Qg,qg,Jg,Zg,ef,tf,Md,_n,Cl,Dd,of,sf,nf,rf,lf,cf,af,uf,Pd,df,Mi,hf,pf,$f,ar,xd,ur,Bd,Fd,Ud,dr,Yc,Kc,_f,yl,Hd,Vd,Gd,Wd,zd,Xd,gf,Sl,jd,hr,Qc,fs,Yd,Kd,ff,Rl,Qd,qd,mf,qc,Jd,Tf,Ef,bf,vf,If,pr,Zd,eh,kl,th,Of,Cf,oh,sh,ni,ih,nh,yf,Sf,Rf,kf,rh,Af,lh,Lf,Di,Al,Jc,Zc,gn,ch,ea,ah,Zt,ta,$r,fn,Nf,uh,oa,as,dh,sa,hh,ph,wf,Mf,Df,$h,Jo,Pf,xf,ms,Xt,Bf,Ff,_h,ri,ia,Uf,Ll,na,Hf,ra,Vf,la,gh,fh,Gf,mh,ca,Wf,zf,Xf,Th,aa,Eh,ua,jf,da,Yf,Kf,Po,tt,xo,To,jt,Bs,_r,je,oo,bh,Qf,vh,Ih,Oh,Ch,yh,gr,fr,Sh,qf,ha,Rh,Nl,Jf,kh,pa,Zf,em,Ah,wl,tm,om,sm,im,Ml,Lh,Nh,wh,nm,Dl,Mh,mr,rm,Dh,Ph,xh,Bh,Fh,Uh,Hh,Vh,$a,Pl,Gh,lm,Wh,zh,Xh,jh,Yh,Kh,Qh,cm,qh,Pi,_a,ga,Jh,am,Zh,fa,ep,tp,um,op,dm,sp,ip,np,ma,rp,Ta,Ea,ba,hm,pm,$m,_m,gm,fm,mm,Tm,lp,cp,ap,up,Em,bm,dp,hp,pp,$p,_p,gp,fp,mp,vm,Im,st;l=function(e,t,i,r){if(!(e instanceof Ae)&&typeof e!="string"||`${e}`.trim()==="")throw Error('Invalid type "'+e+'". The type must be a non-empty string or a Blockly.registry.Type.');if(e=`${e}`.toLowerCase(),typeof t!="string"||t.trim()==="")throw Error('Invalid name "'+t+'". The name must be a non-empty string.');const c=t.toLowerCase();if(!i)throw Error("Can not register a null value");let $=xi[e],v=va[e];if($||($=xi[e]=Object.create(null),v=va[e]=Object.create(null)),a(e,i),!r&&$[c])throw Error('Name "'+c+'" with type "'+e+'" already registered.');$[c]=i,v[c]=t},a=function(e,t){switch(e){case String(Ae.FIELD):if(typeof t.fromJson!="function")throw Error('Type "'+e+'" must have a fromJson function')}},u=function(e,t){e=`${e}`.toLowerCase(),t=t.toLowerCase();const i=xi[e];i&&i[t]?(delete xi[e][t],delete va[e][t]):console.warn("Unable to unregister ["+t+"]["+e+"] from the registry.")},d=function(e,t,i){e=`${e}`.toLowerCase(),t=t.toLowerCase();const r=xi[e];if(!r||!r[t]){if(t="Unable to find ["+t+"]["+e+"] in the registry.",i)throw Error(t+" You must require or register a "+e+" plugin.");return console.warn(t),null}return r[t]},h=function(e,t){return e=`${e}`.toLowerCase(),t=t.toLowerCase(),(e=xi[e])?!!e[t]:!1},p=function(e,t,i){return d(e,t,i)},f=function(e,t,i){return d(e,t,i)},T=function(e,t,i){e=`${e}`.toLowerCase();var r=xi[e];if(!r){if(r=`Unable to find [${e}] in the registry.`,i)throw Error(`${r} You must require or register a ${e} plugin.`);return console.warn(r),null}if(!t)return r;e=va[e],i=Object.create(null);for(const c of Object.keys(r))i[e[c]]=r[c];return i},C=function(e,t,i){return t=t.plugins[String(e)]||li,typeof t=="function"?t:p(e,t,i)},S=function(e){return xl[e]||null},P=function(){const e=[];for(const t in xl)e.push(xl[t]);return e},x=function(e){xl[e.id]=e},G=function(e){delete xl[e.id]},oe=function(){return Om},ne=function(e){Om=e},Z=function(){return Cm},Y=function(e){Cm=e},M=function(){return ym},L=function(e){ym=e},R=function(e){for(;e.options.parentWorkspace;)e=e.options.parentWorkspace;const t=e.getParentSvg(),i=e.getCachedParentSvgSize();var r=t.parentElement;if(r instanceof HTMLElement){var c=r.offsetWidth;r=r.offsetHeight,i.width!==c&&(t.setAttribute("width",c+"px"),e.setCachedParentSvgSize(c,null)),i.height!==r&&(t.setAttribute("height",r+"px"),e.setCachedParentSvgSize(null,r)),e.resize()}},F=function(e,t){const i=Object.create(null),r=e.getDescendants(!0);t&&(e=e.getNextBlock())&&(e=r.indexOf(e),r.splice(e,r.length-e));for(let c=0,$;$=r[c];c++)i[$.type]?i[$.type]++:i[$.type]=1;return i},z=function(e){return function(){this.jsonInit(e)}},X=function(e){Sm.defineBlocksWithJsonArrayInternal(e)},le=function(e){s.defineBlocks$$module$build$src$core$common(s.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(e))},s.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(e){const t={};for(let i=0;i{setTimeout(D,0)})}catch{setTimeout(D,0)}vn.push(e)}},D=function(){var e=B(vn,!0);vn.length=0;for(let i=0,r;r=e[i];i++)if(r.workspaceId){var t=S(r.workspaceId);t&&t.fireChangeListener(r)}e=new Set(e.map(i=>i.workspaceId));for(const i of e){if(!i||(e=S(i),!e))continue;e=e.getUndoStack();let r;for(t=e.length;0`&#${t.charCodeAt(0)};`)},xe=function(e,t,i,r){e=e+" was deprecated in "+t+" and will be deleted in "+i+".",r&&(e+=` +Use `+r+" instead."),console.warn(e)},w=function(e,t,i){e=document.createElementNS(Aa,`${e}`);for(const r in t)e.setAttribute(r,`${t[r]}`);return i&&i.appendChild(e),e},I=function(e,t){return t=t.split(" "),t.every(i=>e.classList.contains(i))?!1:(e.classList.add(...t),!0)},N=function(e,t){e.classList.remove(...t.split(" "))},A=function(e,t){return t=t.split(" "),t.every(i=>!e.classList.contains(i))?!1:(e.classList.remove(...t),!0)},K=function(e,t){return e.classList.contains(t)},U=function(e){return e&&e.parentNode?e.parentNode.removeChild(e):null},de=function(e,t){const i=t.nextSibling;if(t=t.parentNode,!t)throw Error("Reference node has no parent.");i?t.insertBefore(e,i):t.appendChild(e)},Te=function(e,t){return xe("Blockly.utils.dom.containsNode","version 10","version 11",'Use native "contains" DOM method'),e.contains(t)},se=function(e,t){e.style.transform=t,e.style["-webkit-transform"]=t},Ce=function(){bp++,Es||(Es=Object.create(null))},ce=function(){bp--,bp||(Es=null)},Se=function(e){const t=e.textContent+` +`+e.className.baseVal;let i;if(Es&&(i=Es[t]))return i;try{i=e.getComputedTextLength()}catch{return 8*e.textContent.length}return Es&&(Es[t]=i),i},Ne=function(e,t,i,r){return He(e,t+"pt",i,r)},He=function(e,t,i,r){const c=e.textContent;e=c+` +`+e.className.baseVal;var $;return Es&&($=Es[e])||(La||($=document.createElement("canvas"),$.className="blocklyComputeCanvas",document.body.appendChild($),La=$.getContext("2d")),La.font=i+" "+t+" "+r,$=c?La.measureText(c).width:0,Es&&(Es[e]=$)),$},be=function(e,t,i,r){const c=document.createElement("span");c.style.font=i+" "+t+" "+r,c.textContent=e,e=document.createElement("div"),e.style.width="1px",e.style.height="0",t=document.createElement("div"),t.setAttribute("style","position: fixed; top: 0; left: 0; display: flex;"),t.appendChild(c),t.appendChild(e),document.body.appendChild(t),i={height:0,baseline:0};try{t.style.alignItems="baseline",i.baseline=e.offsetTop-c.offsetTop,t.style.alignItems="flex-end",i.height=e.offsetTop-c.offsetTop}finally{document.body.removeChild(t)}return i},ee=function(e,t){Lm(e,t)},ie=function(e){Lm=e},ue=function(e,t){Mm.confirmInternal(e,t)},ye=function(e,t){Nm(e,t)},E=function(e){Nm=e},g=function(e,t,i){wm(e,t,i)},k=function(e){wm=e},W=function(e){return e.getVariableModel!==void 0},J=function(e){return e.getProcedureDef!==void 0},Ee=function(e){return e.getProcedureCall!==void 0&&e.renameProcedure!==void 0},s.allUsedVarModels$$module$build$src$core$variables=function(e){e=e.getAllBlocks(!1);const t=new Set;for(let i=0;i1'),r.appendChild(i),t.push(r)),Fo.variables_get){e.sort(Hl.compareByName);for(let c=0,$;$=e[c];c++)i=s.createElement$$module$build$src$core$utils$xml("block"),i.setAttribute("type","variables_get"),i.setAttribute("gap","8"),i.appendChild(s.generateVariableFieldDom$$module$build$src$core$variables($)),t.push(i)}}return t},ls=function(e){return Dm.generateUniqueNameInternal(e)},ii=function(e){return xt(Cp.charAt(0),e.getAllVariableNames())},xt=function(e,t){if(!t.length)return e;const i=Cp;let r="",c=i.indexOf(e);for(;;){let $=!1;for(let v=0;v$.getVariableModel().name);if(r&&(i=r.some($=>$.toLowerCase()===e),r=r.some($=>$.toLowerCase()===t),i&&r))return c.getName()}return null},_=function(e,t,i){e=e.toLowerCase(),t=t.toLowerCase(),i=i.getAllBlocks(!1);for(const c of i){if(!J(c))continue;i=c.getProcedureDef();var r=i[1];const $=r.some(v=>v.toLowerCase()===e);if(r=r.some(v=>v.toLowerCase()===t),$&&r)return i[0]}return null},s.generateVariableFieldDom$$module$build$src$core$variables=function(e){const t=s.createElement$$module$build$src$core$utils$xml("field");return t.setAttribute("name","VAR"),t.setAttribute("id",e.getId()),t.setAttribute("variabletype",e.type),e=s.createTextNode$$module$build$src$core$utils$xml(e.name),t.appendChild(e),t},s.getOrCreateVariablePackage$$module$build$src$core$variables=function(e,t,i,r){let c=s.getVariable$$module$build$src$core$variables(e,t,i,r);return c||(c=m(e,t,i,r)),c},s.getVariable$$module$build$src$core$variables=function(e,t,i,r){const c=e.getPotentialVariableMap();let $=null;if(t&&($=e.getVariableById(t),!$&&c&&($=c.getVariableById(t)),$))return $;if(i){if(r===void 0)throw Error("Tried to look up a variable by name without a type");$=e.getVariable(i,r),!$&&c&&($=c.getVariable(i,r))}return $},m=function(e,t,i,r){const c=e.getPotentialVariableMap();return i||(i=ls(e.isFlyout?e.targetWorkspace:e)),c?c.createVariable(i,r,t):e.createVariable(i,r,t)},y=function(e,t){e=e.getAllVariables();const i=[];if(t.length!==e.length)for(let r=0;r>>/g,e),wp="",e=document.createElement("style"),e.id="blockly-common-style",t=document.createTextNode(t),e.appendChild(t),document.head.insertBefore(e,document.head.firstChild)))},Il=function(e){return Xm.getSizeInternal(e)},Ag=function(e){if(Ms(e,"display")!=="none")return fd(e);const t=e.style,i=t.display,r=t.visibility,c=t.position;t.visibility="hidden",t.position="absolute",t.display="inline";const $=e.offsetWidth;return e=e.offsetHeight,t.display=i,t.position=c,t.visibility=r,new Vt($,e)},fd=function(e){return new Vt(e.offsetWidth,e.offsetHeight)},Ms=function(e,t){return e=window.getComputedStyle(e),e[t]||e.getPropertyValue(t)},Li=function(e){const t=new Ue(0,0);e=e.getBoundingClientRect();var i=document.documentElement;return i=new Ue(window.pageXOffset||i.scrollLeft,window.pageYOffset||i.scrollTop),t.x=e.left+i.x,t.y=e.top+i.y,t},md=function(){const e=document.body,t=document.documentElement;return new Ue(e.scrollLeft||t.scrollLeft,e.scrollTop||t.scrollTop)},Td=function(e){const t=parseFloat(Ms(e,"borderLeftWidth")),i=parseFloat(Ms(e,"borderRightWidth")),r=parseFloat(Ms(e,"borderTopWidth"));return e=parseFloat(Ms(e,"borderBottomWidth")),new Bt(r,e,t,i)},Wc=function(e,t,i){e=Ed(e,t,i),t.scrollLeft=e.x,t.scrollTop=e.y},Ed=function(e,t,i){var r=Li(e),c=Li(t),$=Td(t);const v=r.x-c.x-$.left;return r=r.y-c.y-$.top,c=fd(e),e=t.clientWidth-c.width,c=t.clientHeight-c.height,$=t.scrollLeft,t=t.scrollTop,i?($+=v-e/2,t+=r-c/2):($+=Math.min(v,Math.max(v-e,0)),t+=Math.min(r,Math.max(r-c,0))),new Ue($,t)},$n=function(e){const t=new Ue(0,0);var i=e.x&&e.getAttribute("x");const r=e.y&&e.getAttribute("y");return i&&(t.x=parseInt(i)),r&&(t.y=parseInt(r)),(i=(i=e.getAttribute("transform"))&&i.match(jm))&&(t.x+=Number(i[1]),i[3]&&(t.y+=Number(i[3]))),(e=e.getAttribute("style"))&&-1{Dp=t,Km=window.requestAnimationFrame(()=>{Cd(),t()})})),Ar},cr=function(){return Ar||Promise.resolve()},Ds=function(){window.cancelAnimationFrame(Km),Cd(),Dp&&Dp()},Od=function(e){Ua.add(e);const t=e.getParent();t?Od(t):Fa.add(e)},Cd=function(){const e=new Set([...Fa].map(t=>t.workspace));for(const t of Fa){if(t.isDisposed()||t.getParent())continue;yd(t);const i=t.getRelativeToSurfaceXY();Sd(t,i),Rd(t,i)}for(const t of e)t.resizeContents();Fa.clear(),Ua=new Set,Ar=null},yd=function(e){if(Ua.has(e)){for(const t of e.getChildren(!1))yd(t);e.renderEfficiently()}},Sd=function(e,t){for(const i of e.getConnections_(!1)){e=i.moveToOffset(t);const r=i.targetBlock();i.isSuperior()&&r&&(e||Ua.has(r))&&Sd(r,Ue.sum(t,r.relativeCoords))}},Rd=function(e,t){if(e.getIcons){for(const i of e.getIcons())i.onLocationChange(t);for(const i of e.getChildren(!1))Rd(i,Ue.sum(t,i.relativeCoords))}},wg=function(e,t){const i=s.createElement$$module$build$src$core$utils$xml("xml");var r=kd(s.allUsedVarModels$$module$build$src$core$variables(e));r.hasChildNodes()&&i.appendChild(r),r=e.getTopComments(!0);for(let c=0;c/g,"<$1$2>")},Pg=function(e){e=Ps(e).split("<");let t="";for(let i=1;i"&&(t+=" ")}return e=e.join(` +`),e=e.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1"),e.replace(/^\n/,"")},xg=function(e,t){return t.setResizesEnabled(!1),t.clear(),e=s.domToWorkspace$$module$build$src$core$xml(e,t),t.setResizesEnabled(!0),e},s.domToWorkspace$$module$build$src$core$xml=function(e,t){let i=0;t.RTL&&(i=t.getWidth());const r=[];Ce();const c=s.getGroup$$module$build$src$core$events$utils();c||s.setGroup$$module$build$src$core$events$utils(!0),t.setResizesEnabled&&t.setResizesEnabled(!1);let $=!0;try{for(let v=0,H;H=e.childNodes[v];v++){const Oe=H.nodeName.toLowerCase(),Qe=H;if(Oe==="block"||Oe==="shadow"&&!ke()){const qt=wi(Qe,t);r.push(qt.id);let Ft;const Go=parseInt((Ft=Qe.getAttribute("x"))!=null?Ft:"10",10);let Jr;const Zr=parseInt((Jr=Qe.getAttribute("y"))!=null?Jr:"10",10);isNaN(Go)||isNaN(Zr)||qt.moveBy(t.RTL?i-Go:Go,Zr,["create"]),$=!1}else{if(Oe==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(Oe==="comment")t.rendered?yo.fromXmlRendered(Qe,t,i):Hs.fromXml(Qe,t);else if(Oe==="variables"){if($)Ld(Qe,t);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location.");$=!1}}}}finally{s.setGroup$$module$build$src$core$events$utils(c),t.setResizesEnabled&&t.setResizesEnabled(!0),t.rendered&&Ds(),ce()}return re(new(we(bn))(t)),r},Bg=function(e,t){if(!t.getBlocksBoundingBox)return s.domToWorkspace$$module$build$src$core$xml(e,t);var i=t.getBlocksBoundingBox();if(e=s.domToWorkspace$$module$build$src$core$xml(e,t),i&&i.top!==i.bottom){var r=i.bottom;i=t.RTL?i.right:i.left;var c=1/0;let $=-1/0,v=1/0;for(let H=0;H$&&($=Oe.x)}for(r=r-v+10,i=t.RTL?i-$:i-c,c=0;cQe.setBubbleVisible($),1)}},Vg=function(e,t){for(let i=0;i{v.disposed||v.setConnectionTracking(!0)},1),v},Dd=function(e,t,{parentConnection:i,isShadow:r=!1}={}){if(!e.type)throw new Qm(e);const c=t.newBlock(e.type,e.id);return c.setShadow(r),of(c,e),sf(c,e),nf(c,e),rf(i,c,e),lf(c,e),cf(c,e),af(c,e),uf(c,e),df(c,t.rendered),c},of=function(e,t){let i=t.x===void 0?0:t.x;t=t.y===void 0?0:t.y;const r=e.workspace;i=r.RTL?r.getWidth()-i:i,e.moveBy(i,t)},sf=function(e,t){t.collapsed&&e.setCollapsed(!0),t.deletable===!1&&e.setDeletable(!1),t.movable===!1&&e.setMovable(!1),t.editable===!1&&e.setEditable(!1),t.enabled===!1&&e.setEnabled(!1),t.inline!==void 0&&e.setInputsInline(t.inline),t.data!==void 0&&(e.data=t.data)},nf=function(e,t){t.extraState&&(e.loadExtraState?e.loadExtraState(t.extraState):e.domToMutation&&e.domToMutation(s.textToDom$$module$build$src$core$utils$xml(t.extraState)))},rf=function(e,t,i){if(e){if(e.getSourceBlock().isShadow()&&!t.isShadow())throw new Jm(i);if(e.type===s.inputTypes$$module$build$src$core$inputs$input_types.VALUE){var r=t.outputConnection;if(!r)throw new Vl("output",t,i)}else if(r=t.previousConnection,!r)throw new Vl("previous",t,i);if(!e.connect(r)){const c=t.workspace.connectionChecker;throw new qm(c.getErrorMessage(c.canConnectWithReason(r,e,!1),r,e),e.type===s.inputTypes$$module$build$src$core$inputs$input_types.VALUE?"output connection":"previous connection",t,i)}}},lf=function(e,t){if(t.icons){var i=Object.keys(t.icons);for(const c of i){i=t.icons[c];var r=e.getIcon(c);if(!r){if(r=p(Ae.ICON,c,!1),!r)throw new Zm(c,e,t);r=new r(e),e.addIcon(r)}Ze(r)&&r.loadState(i)}}},cf=function(e,t){if(t.fields){var i=Object.keys(t.fields);for(let r=0;rt&&(t=i[r].length);var c=-1/0;let $,v=1;do{r=c,$=e,e=[],c=i.length/v;let H=1;for(let Oe=0;Oer);return $},qc=function(e,t,i){const r=[0],c=[];for(var $=0;$r&&(r=H,c=v)}return c?Jd(e,c,i):t},Tf=function(e,t){const i=[];for(let r=0;rdT&&ni()}else jl!==ds&&(clearTimeout(Ln),zp=e.pageX,Xp=e.pageY,Ln=setTimeout(kf,hT))},sh=function(){jl=ds=null,ni()},ni=function(){Xl&&(Xl=!1,ro&&(ro.style.display="none")),Ln&&(clearTimeout(Ln),Ln=0)},ih=function(){ni(),Pr=!0},nh=function(){Pr=!1},yf=function(){ro&&ds&&(typeof Xa=="function"?Xa(ro,ds):Sf())},Sf=function(){var e=pr(ds);e=s.wrap$$module$build$src$core$utils$string(e,aT),e=e.split(` +`);for(let t=0;ti+window.scrollY&&(c-=ro.offsetHeight+2*Yp),e?r=Math.max(ja-window.scrollX,r):r+ro.offsetWidth>t+window.scrollX-2*ja&&(r=t-ro.offsetWidth-2*ja),{x:r,y:c}},kf=function(){if(!Pr&&(jl=ds,ro)){ro.textContent="",yf();var e=ds.RTL;ro.style.direction=e?"rtl":"ltr",ro.style.display="block",Xl=!0;var{x:t,y:i}=Rf(e);ro.style.left=t+"px",ro.style.top=i+"px"}},rh=function(){return Kp},Af=function(e){Kp=e},lh=function(){return Qp},Lf=function(e){Qp=e},Di=function(e){e=`${e}`.toLowerCase().trim();var t=pT[e];if(t||(t=e.substring(0,2)==="0x"?"#"+e.substring(2):e,t=t[0]==="#"?t:"#"+t,/^#[0-9a-f]{6}$/.test(t)))return t;if(/^#[0-9a-f]{3}$/.test(t))return["#",t[1],t[1],t[2],t[2],t[3],t[3]].join("");var i=e.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return i&&(e=Number(i[1]),t=Number(i[2]),i=Number(i[3]),0<=e&&256>e&&0<=t&&256>t&&0<=i&&256>i)?Al(e,t,i):null},Al=function(e,t,i){return t=e<<16|t<<8|i,16>e?"#"+(16777216|t).toString(16).substr(1):"#"+t.toString(16)},Jc=function(e){return e=Di(e),e?(e=parseInt(e.substr(1),16),[e>>16,e>>8&255,e&255]):[0,0,0]},Zc=function(e,t,i){let r=0,c=0,$=0;if(t===0)$=c=r=i;else{const v=Math.floor(e/60),H=e/60-v;e=i*(1-t);const Oe=i*(1-t*H);switch(t=i*(1-t*(1-H)),v){case 1:r=Oe,c=i,$=e;break;case 2:r=e,c=i,$=t;break;case 3:r=e,c=Oe,$=i;break;case 4:r=t,c=e,$=i;break;case 5:r=i,c=e,$=Oe;break;case 6:case 0:r=i,c=t,$=e}}return Al(Math.floor(r),Math.floor(c),Math.floor($))},gn=function(e,t,i){return e=Di(e),!e||(t=Di(t),!t)?null:(e=Jc(e),t=Jc(t),Al(Math.round(t[0]+i*(e[0]-t[0])),Math.round(t[1]+i*(e[1]-t[1])),Math.round(t[2]+i*(e[2]-t[2]))))},ch=function(e){return Zc(e,Kp,255*Qp)},ea=function(e,t){const i=[];var r=e.split("");r.push("");var c=0;e=[];let $=null;for(let Oe=0;Oe=v?(c=2,$=v,(v=e.join(""))&&i.push(v),e.length=0):v==="{"?c=3:(e.push("%",v),c=0);else if(c===2)if("0"<=v&&"9">=v)$+=v;else{var H=void 0;i.push(parseInt((H=$)!=null?H:"",10)),Oe--,c=0}else c===3&&(v===""?(e.splice(0,0,"%{"),Oe--,c=0):v!=="}"?e.push(v):(c=e.join(""),/[A-Z]\w*/i.test(c)?(v=c.toUpperCase(),(v=v.startsWith("BKY_")?v.substring(4):null)&&v in s.Msg$$module$build$src$core$msg?(c=s.Msg$$module$build$src$core$msg[v],typeof c=="string"?Array.prototype.push.apply(i,ea(c,t)):t?i.push(`${c}`):i.push(c)):i.push("%{"+c+"}")):i.push("%{"+c+"}"),c=e.length=0))}for((t=e.join(""))&&i.push(t),H=[],e.length=0,r=0;r=i)return{hue:i,hex:Zc(i,rh(),255*lh())};if(i=Di(t))return{hue:null,hex:i};throw i='Invalid colour: "'+t+'"',e!==t&&(i+=' (from "'+e+'")'),Error(i)},fn=function(){return bs},Nf=function(e){bs=e},uh=function(){bs||(bs=document.createElement("div"),bs.className="blocklyWidgetDiv",(M()||document.body).appendChild(bs))},oa=function(e,t,i){as(),xr=e,Ya=i,(e=bs)&&(e.style.direction=t?"rtl":"ltr",e.style.display="block",t=oe(),Br=t.getRenderer().getClassName(),Fr=t.getTheme().getClassName(),Br&&I(e,Br),Fr&&I(e,Fr))},as=function(){if(dh()){xr=null;var e=bs;e&&(e.style.display="none",e.style.left="",e.style.top="",Ya&&Ya(),Ya=null,e.textContent="",Br&&(A(e,Br),Br=""),Fr&&(A(e,Fr),Fr=""),oe().markFocused())}},dh=function(){return!!xr},sa=function(e){xr===e&&as()},hh=function(e,t,i){bs.style.left=e+"px",bs.style.top=t+"px",bs.style.height=i+"px"},ph=function(e,t,i,r){const c=Mf(e,t,i);e=wf(e,t,i,r),0>c?hh(e,0,i.height+c):hh(e,c,i.height)},wf=function(e,t,i,r){return r?Math.min(Math.max(t.right-i.width,e.left),e.right-i.width):Math.max(Math.min(t.left,e.right-i.width),e.left)},Mf=function(e,t,i){return t.bottom+i.height>=e.bottom?t.top-i.height:t.bottom},Df=function(e){return!(e==null||!e.repositionForWindowResize)},$h=function(){Df(xr)&&xr.repositionForWindowResize()||as()},Jo=function(e,t){l(Ae.FIELD,e,t)},Pf=function(e){u(Ae.FIELD,e)},s.fromJson$$module$build$src$core$field_registry=function(e){return $T.fromJsonInternal(e)},xf=function(e){const t=f(Ae.FIELD,e.type);if(t){if(typeof t.fromJson!="function")throw new TypeError("returned Field was not a IRegistrableField");return t.fromJson(e)}return console.warn("Blockly could not create a field of type "+e.type+". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached."),null},ms=function(e,t){e.setAttribute(CS,t)},Xt=function(e,t,i){Array.isArray(i)&&(i=i.join(" ")),e.setAttribute(OS+t,`${i}`)},Bf=function(e){let t=!1;const i=e.map(([v,H])=>typeof v=="string"?[Zt(v),H]:(t=!0,[v.alt!==null?Object.assign({},v,{alt:Zt(v.alt)}):Object.assign({},v),H]));if(t||2>e.length)return{options:i};var r=i.map(([v])=>v),c=Rl(r);e=Qd(r,c);const $=qd(r,c);return!e&&!$||c<=e+$?{options:i}:(c=e?r[0].substring(0,e-1):void 0,r=$?r[0].substr(1-$):void 0,{options:Ff(i,e,$),prefix:c,suffix:r})},Ff=function(e,t,i){return e.map(([r,c])=>[r.substring(t,r.length-i),c])},_h=function(e){if(!Array.isArray(e))throw TypeError("FieldDropdown options must be an array.");if(!e.length)throw TypeError("FieldDropdown options must not be an empty array.");let t=!1;for(let i=0;i document.")}else e instanceof Element&&(t=e);return t},s.register$$module$build$src$core$extensions=function(e,t){if(typeof e!="string"||e.trim()==="")throw Error('Error: Invalid extension name "'+e+'"');if(Ur[e])throw Error('Error: Extension "'+e+'" is already registered.');if(typeof t!="function")throw Error('Error: Extension "'+e+'" must be a function');Ur[e]=t},s.registerMixin$$module$build$src$core$extensions=function(e,t){if(!t||typeof t!="object")throw Error('Error: Mixin "'+e+'" must be a object');s.register$$module$build$src$core$extensions(e,function(){this.mixin(t)})},s.registerMutator$$module$build$src$core$extensions=function(e,t,i,r){const c='Error when registering mutator "'+e+'": ';Eh(c,t);const $=Th(t,c);if(i&&typeof i!="function")throw Error(c+'Extension "'+e+'" is not a function');s.register$$module$build$src$core$extensions(e,function(){$&&this.setMutator(new s.MutatorIcon$$module$build$src$core$icons$mutator_icon(r||[],this)),this.mixin(t),i&&i.apply(this)})},Gf=function(e){mh(e)?delete Ur[e]:console.warn('No extension mapping for name "'+e+'" found to unregister')},mh=function(e){return!!Ur[e]},ca=function(e,t,i){const r=Ur[e];if(typeof r!="function")throw Error('Error: Extension "'+e+'" not found.');let c;if(i?Wf(e,t):c=ua(t),r.apply(t),i)Eh('Error after applying mutator "'+e+'": ',t);else if(!jf(c,t))throw Error('Error when applying extension "'+e+'": mutation properties changed when applying a non-mutator extension.')},Wf=function(e,t){if(ua(t).length)throw Error('Error: tried to apply mutation "'+e+'" to a block that already has mutator functions. Block id: '+t.id)},zf=function(e,t){return aa(e.mutationToDom,e.domToMutation,t+" mutationToDom/domToMutation")},Xf=function(e,t){return aa(e.saveExtraState,e.loadExtraState,t+" saveExtraState/loadExtraState")},Th=function(e,t){return aa(e.compose,e.decompose,t+" compose/decompose")},aa=function(e,t,i){if(e&&t){if(typeof e!="function"||typeof t!="function")throw Error(i+" must be a function");return!0}if(!e&&!t)return!1;throw Error(i+"Must have both or neither functions")},Eh=function(e,t){const i=zf(t,e),r=Xf(t,e);if(!i&&!r)throw Error(e+"Mutations must contain either XML hooks, or JSON hooks, or both");Th(t,e)},ua=function(e){const t=[];return e.domToMutation!==void 0&&t.push(e.domToMutation),e.mutationToDom!==void 0&&t.push(e.mutationToDom),e.saveExtraState!==void 0&&t.push(e.saveExtraState),e.loadExtraState!==void 0&&t.push(e.loadExtraState),e.compose!==void 0&&t.push(e.compose),e.decompose!==void 0&&t.push(e.decompose),t},jf=function(e,t){if(t=ua(t),t.length!==e.length)return!1;for(let i=0;ii)){var r=t.getSvgXY(e.getSvgRoot());e.outputConnection?(r.x+=(e.RTL?3:-3)*i,r.y+=13*i):e.previousConnection&&(r.x+=(e.RTL?-23:23)*i,r.y+=3*i);var c=w(te.CIRCLE,{cx:r.x,cy:r.y,r:0,fill:"none",stroke:"#888","stroke-width":10},t.getParentSvg());e=w(te.ANIMATE,{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*i},c),t=w(te.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},c),e.beginElement(),t.beginElement(),setTimeout(()=>void U(c),150)}},Ch=function(e){if(gr(),e.workspace.getAudioManager().play("disconnect"),!(1>e.workspace.scale)){var t=e.getHeightWidth().height;t=Math.atan(10/t)/Math.PI*180,e.RTL||(t*=-1),ql=e,yh(e,t,new Date)}},yh=function(e,t,i){const r=(new Date().getTime()-i.getTime())/200;let c="";1>=r&&(c=`skewX(${Math.round(Math.sin(r*Math.PI*3)*(1-r)*t)})`,Za=setTimeout(yh,10,e,t,i)),e.getSvgRoot().setAttribute("transform",`${e.getTranslation()} ${c}`)},gr=function(){ql&&(Za&&(clearTimeout(Za),Za=null),ql.getSvgRoot().setAttribute("transform",ql.getTranslation()),ql=null)},fr=function(e,t,i){const r=i.getBoundingRectangle(),c=r.right-r.left,$=ur(t.top,r.top,t.top+t.height-(r.bottom-r.top))-r.top;let v=t.left;return t=t.left+t.width-c,e.RTL?v=Math.min(t,v):t=Math.max(v,t),(e=ur(v,r.left,t)-r.left)||$?(i.moveBy(e,$,["inbounds"]),!0):!1},Sh=function(e){return t=>{var i=e.getMetricsManager();if(i.hasFixedEdges()&&!e.isDragging()){var r;if(ya.indexOf((r=t.type)!=null?r:"")!==-1){r=i.getScrollMetrics(!0);const c=qf(e,t);c&&(i=s.getGroup$$module$build$src$core$events$utils()||!1,s.setGroup$$module$build$src$core$events$utils(t.group),fr(e,r,c)&&!t.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),s.setGroup$$module$build$src$core$events$utils(i))}else t.type===Ui&&t.scale&&t.oldScale&&t.scale>t.oldScale&&ha(e)}}},qf=function(e,t){let i=null;switch(t.type){case s.CREATE$$module$build$src$core$events$utils:case s.MOVE$$module$build$src$core$events$utils:(i=e.getBlockById(t.blockId))&&(i=i.getRootBlock());break;case Hi:case Us:i=e.getCommentById(t.commentId)}return i},ha=function(e){var t=e.getMetricsManager();if(t.hasFixedEdges()&&!e.isDragging()){t=t.getScrollMetrics(!0);var i=e.getTopBoundedElements();for(let r=0,c;c=i[r];r++)fr(e,t,c)}},Rh=function(e,t){const i=[];for(const r of e.getIcons())(!Mi(r)||r.bubbleIsVisible())&&(i.push({location:t,icon:r}),r.onLocationChange(t));for(const r of e.getChildren(!1))i.push(...Rh(r,Ue.sum(t,r.relativeCoords)));return i},Nl=function(e){l$.copyInternal(e)},Jf=function(e){Ei=e.toCopyData()},kh=function(){if(!Ei)return null;let e=Ei.source;return e.isFlyout&&(e=e.targetWorkspace),Ei.typeCounts&&e.isCapacityAvailable(Ei.typeCounts)?e.paste(Ei.saveInfo):null},pa=function(e){return l$.duplicateInternal(e)},Zf=function(e){const t=Ei;Nl(e);let i,r,c;return e=(c=(i=e.toCopyData())==null||(r=i.source)==null?void 0:r.paste(Ei.saveInfo))!=null?c:null,Ei=t,e},em=function(){return tu},Ah=function(e){tu=e},wl=function(e,t,i){if(oa(yT,i,Lh),t.length){var r=tm(t,i);ou=r,om(r,e,i),setTimeout(function(){r.focus()},1),tu=null}else Ml()},tm=function(e,t){const i=new qp;i.setRole(Vo.MENU);for(let r=0;r{setTimeout(()=>{c.callback(c.scope)},0)})},{})}return i},om=function(e,t,i){const r=bd();t=new Bt(t.clientY+r.top,t.clientY+r.top,t.clientX+r.left,t.clientX+r.left),sm(e);const c=e.getSize();i&&(t.left+=c.width,t.right+=c.width,r.left+=c.width,r.right+=c.width),ph(r,t,c,i),e.focus()},sm=function(e){var t=fn();if(!t)throw Error("Attempting to create a context menu when widget div is null");t=e.render(t),I(t,"blocklyContextMenu"),Be(t,"contextmenu",null,im),e.focus()},im=function(e){e.preventDefault(),e.stopPropagation()},Ml=function(){sa(yT),tu=null},Lh=function(){ou&&(ou.dispose(),ou=null)},s.callbackFactory$$module$build$src$core$contextmenu=function(e,t){return()=>{s.disable$$module$build$src$core$events$utils();let i;try{i=wi(t,e.workspace);const r=e.getRelativeToSurfaceXY();r.x=e.RTL?r.x-s.config$$module$build$src$core$config.snapRadius:r.x+s.config$$module$build$src$core$config.snapRadius,r.y+=2*s.config$$module$build$src$core$config.snapRadius,i.moveBy(r.x,r.y)}finally{s.enable$$module$build$src$core$events$utils()}_e()&&!i.isShadow()&&re(new(we(s.CREATE$$module$build$src$core$events$utils))(i)),i.select()}},Nh=function(e){return{text:s.Msg$$module$build$src$core$msg.REMOVE_COMMENT,enabled:!0,callback:function(){s.setGroup$$module$build$src$core$events$utils(!0),e.dispose(),s.setGroup$$module$build$src$core$events$utils(!1)}}},wh=function(e){return{text:s.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,enabled:!0,callback:function(){pa(e)}}},nm=function(e,t){const i={enabled:!0};return i.text=s.Msg$$module$build$src$core$msg.ADD_COMMENT,i.callback=function(){const r=new yo(e,s.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT,yo.DEFAULT_SIZE,yo.DEFAULT_SIZE);var c=e.getInjectionDiv().getBoundingClientRect();c=new Ue(t.clientX-c.left,t.clientY-c.top);const $=e.getOriginOffsetInPixels();c=Ue.difference(c,$),c.scale(1/e.scale),r.moveBy(c.x,c.y),e.rendered&&(r.initSvg(),r.render(),r.select())},i},Dl=function(e){let t=e.outputConnection;return(!t||e.previousConnection&&e.previousConnection.isConnected())&&(t=e.previousConnection),t},Mh=function(e){return e.isDynamic},mr=function(e,t){l(Ae.RENDERER,e,t)},rm=function(e){u(Ae.RENDERER,e)},Dh=function(e,t,i){return e=new(p(Ae.RENDERER,e))(e),e.init(t,i),e},Ph=function(){kt.registry.register({displayText(){return s.Msg$$module$build$src$core$msg.UNDO},preconditionFn(e){return 0t.length?Pl(t):ue(s.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(t.length)),function(i){i&&Pl(t)})}},scopeType:kt.ScopeType.WORKSPACE,id:"workspaceDelete",weight:6})},lm=function(){Ph(),xh(),Bh(),Uh(),Hh(),Gh()},Wh=function(){kt.registry.register({displayText(){return s.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.isDeletable()&&e.isMovable()?e.isDuplicatable()?"enabled":"disabled":"hidden"},callback(e){e.block&&pa(e.block)},scopeType:kt.ScopeType.BLOCK,id:"blockDuplicate",weight:1})},zh=function(){kt.registry.register({displayText(e){return e.block.hasIcon(Ao.TYPE)?s.Msg$$module$build$src$core$msg.REMOVE_COMMENT:s.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(e){return e=e.block,!e.isInFlyout&&e.workspace.options.comments&&!e.isCollapsed()&&e.isEditable()?"enabled":"hidden"},callback(e){e=e.block,e.hasIcon(Ao.TYPE)?e.setCommentText(null):e.setCommentText("")},scopeType:kt.ScopeType.BLOCK,id:"blockComment",weight:2})},Xh=function(){kt.registry.register({displayText(e){return e.block.getInputsInline()?s.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:s.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(e){if(e=e.block,!e.isInFlyout&&e.isMovable()&&!e.isCollapsed()){for(let t=1;t!r.getReturnTypes()).map(r=>[r.getName(),r.getParameters().map(c=>c.getName()),!1]);e.getBlocksByType("procedures_defnoreturn",!1).forEach(r=>{!Pi(r)&&J(r)&&t.push(r.getProcedureDef())});const i=e.getProcedureMap().getProcedures().filter(r=>!!r.getReturnTypes()).map(r=>[r.getName(),r.getParameters().map(c=>c.getName()),!0]);return e.getBlocksByType("procedures_defreturn",!1).forEach(r=>{!Pi(r)&&J(r)&&i.push(r.getProcedureDef())}),t.sort(Jh),i.sort(Jh),[t,i]},Jh=function(e,t){return e[0].localeCompare(t[0],void 0,{sensitivity:"base"})},s.findLegalName$$module$build$src$core$procedures=function(e,t){if(t.isInFlyout)return e;for(e=e||s.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!am(e,t.workspace,t);){const i=e.match(/^(.*?)(\d+)$/);e=i?i[1]+(parseInt(i[2])+1):e+"2"}return e},am=function(e,t,i){return!Zh(e,t,i)},Zh=function(e,t,i){for(const r of t.getAllBlocks(!1))if(r!==i&&J(r)&&s.Names$$module$build$src$core$names.equals(r.getProcedureDef()[0],e))return!0;i=i&&Pi(i)?i==null?void 0:i.getProcedureModel():void 0;for(const r of t.getProcedureMap().getProcedures())if(r!==i&&s.Names$$module$build$src$core$names.equals(r.getName(),e))return!0;return!1},s.rename$$module$build$src$core$procedures=function(e){var t=this.getSourceBlock();if(!t)throw new io;e=e.trim();const i=s.findLegalName$$module$build$src$core$procedures(e,t);Pi(t)&&!t.isInsertionMarker()&&t.getProcedureModel().setName(i);const r=this.getValue();if(r!==e&&r!==i)for(e=t.workspace.getAllBlocks(!1),t=0;tdm(i,e)||Ee(i)&&s.Names$$module$build$src$core$names.equals(i.getProcedureCall(),e))},dm=function(e,t){return Pi(e)&&!e.isProcedureDef()&&e.getProcedureModel()&&s.Names$$module$build$src$core$names.equals(e.getProcedureModel().getName(),t)},s.mutateCallers$$module$build$src$core$procedures=function(e){const t=ke();var i=e.getProcedureDef()[0];const r=e.mutationToDom(!0);e=op(i,e.workspace);for(let $=0,v;v=e[$];$++){i=(i=v.mutationToDom())&&ht(i),v.domToMutation&&v.domToMutation(r);var c=v.mutationToDom();c=c&&ht(c),i!==c&&(fe(!1),re(new(we(s.CHANGE$$module$build$src$core$events$utils))(v,"mutation",null,i,c)),fe(t))}},s.getDefinition$$module$build$src$core$procedures=function(e,t){for(const i of t.getAllBlocks(!1))if(Pi(i)&&i.isProcedureDef()&&s.Names$$module$build$src$core$names.equals(i.getProcedureModel().getName(),e)||J(i)&&s.Names$$module$build$src$core$names.equals(i.getProcedureDef()[0],e))return i;return null},sp=function(e){Qo(e.getTargetWorkspace(),void 0,"String")},ip=function(e){Qo(e.getTargetWorkspace(),void 0,"Number")},np=function(e){Qo(e.getTargetWorkspace(),void 0,"Colour")},ma=function(e){let t=[],i=document.createElement("button");return i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_STRING"),t.push(i),i=document.createElement("button"),i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER"),t.push(i),i=document.createElement("button"),i.setAttribute("text",s.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE),i.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR"),t.push(i),e.registerButtonCallback("CREATE_VARIABLE_STRING",sp),e.registerButtonCallback("CREATE_VARIABLE_NUMBER",ip),e.registerButtonCallback("CREATE_VARIABLE_COLOUR",np),e=rp(e),t=t.concat(e)},rp=function(e){e=e.getAllVariables();const t=[];if(0cp(i))),t},cp=function(e){const t={id:e.getId(),name:e.getName()};return e.getTypes().length&&(t.types=e.getTypes()),t},ap=function(e,t,i,r){if(e=new e(r,i.name,i.id).setReturnTypes(i.returnTypes),!i.parameters)return e;for(const[c,$]of i.parameters.entries())e.insertParameter(up(t,$,r),c);return e},up=function(e,t,i){return e=new e(i,t.name,t.id),t.types&&e.setTypes(t.types),e},Em=function(e){const t=Object.create(null),i=T(Ae.SERIALIZER,!0);for(const r in i){let c;const $=(c=i[r])==null?void 0:c.save(e);$&&(t[r]=$)}return t},bm=function(e,t,{recordUndo:i=!1}={}){var r=T(Ae.SERIALIZER,!0);if(r){r=Object.entries(r).sort(($,v)=>v[1].priority-$[1].priority);var c=ke();fe(i),(i=s.getGroup$$module$build$src$core$events$utils())||s.setGroup$$module$build$src$core$events$utils(!0),Ce(),t instanceof Cs&&t.setResizesEnabled(!1);for(const[,$]of r.reverse()){let v;(v=$)==null||v.clear(t)}for(let[$,v]of r.reverse())if(e[$]){let H;(H=v)==null||H.load(e[$],t)}t instanceof Cs&&t.setResizesEnabled(!0),ce(),re(new(we(bn))(t)),s.setGroup$$module$build$src$core$events$utils(i),fe(c)}},dp=function(){At.registry.register({name:Ks.ESCAPE,preconditionFn(e){return!e.options.readOnly},callback(e){return e.hideChaff(),!0},keyCodes:[ft.ESC]})},hp=function(){At.registry.register({name:Ks.DELETE,preconditionFn(e){const t=Z();return!e.options.readOnly&&t!=null&&t.isDeletable()},callback(e,t){return t.preventDefault(),bi.inProgress()?!1:(Z().checkAndDelete(),!0)},keyCodes:[ft.DELETE,ft.BACKSPACE]})},pp=function(){const e=At.registry.createSerializedKey(ft.C,[ft.CTRL]),t=At.registry.createSerializedKey(ft.C,[ft.ALT]),i=At.registry.createSerializedKey(ft.C,[ft.META]);At.registry.register({name:Ks.COPY,preconditionFn(r){const c=Z();return!r.options.readOnly&&!bi.inProgress()&&c!=null&&c.isDeletable()&&c.isMovable()},callback(r,c){return c.preventDefault(),r.hideChaff(),Nl(Z()),!0},keyCodes:[e,t,i]})},$p=function(){const e=At.registry.createSerializedKey(ft.X,[ft.CTRL]),t=At.registry.createSerializedKey(ft.X,[ft.ALT]),i=At.registry.createSerializedKey(ft.X,[ft.META]);At.registry.register({name:Ks.CUT,preconditionFn(r){const c=Z();return!r.options.readOnly&&!bi.inProgress()&&c!=null&&c instanceof ts&&c.isDeletable()&&c.isMovable()&&!c.workspace.isFlyout},callback(){const r=Z();return r?(Nl(r),r.checkAndDelete(),!0):!1},keyCodes:[e,t,i]})},_p=function(){const e=At.registry.createSerializedKey(ft.V,[ft.CTRL]),t=At.registry.createSerializedKey(ft.V,[ft.ALT]),i=At.registry.createSerializedKey(ft.V,[ft.META]);At.registry.register({name:Ks.PASTE,preconditionFn(r){return!r.options.readOnly&&!bi.inProgress()},callback(){return!!kh()},keyCodes:[e,t,i]})},gp=function(){const e=At.registry.createSerializedKey(ft.Z,[ft.CTRL]),t=At.registry.createSerializedKey(ft.Z,[ft.ALT]),i=At.registry.createSerializedKey(ft.Z,[ft.META]);At.registry.register({name:Ks.UNDO,preconditionFn(r){return!r.options.readOnly&&!bi.inProgress()},callback(r){return r.hideChaff(),r.undo(!1),!0},keyCodes:[e,t,i]})},fp=function(){const e=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.CTRL]),t=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.ALT]),i=At.registry.createSerializedKey(ft.Z,[ft.SHIFT,ft.META]),r=At.registry.createSerializedKey(ft.Y,[ft.CTRL]);At.registry.register({name:Ks.REDO,preconditionFn(c){return!bi.inProgress()&&!c.options.readOnly},callback(c){return c.hideChaff(),c.undo(!0),!0},keyCodes:[e,t,i,r]})},mp=function(){dp(),hp(),pp(),$p(),_p(),gp(),fp()},vm=function(e){return e.isSelectable()},Im=function(e){oe().hideChaff(e)},st=st||{},st.scope={},st.ASSUME_ES5=!1,st.ASSUME_NO_NATIVE_MAP=!1,st.ASSUME_NO_NATIVE_SET=!1,st.SIMPLE_FROUND_POLYFILL=!1,st.ISOLATE_POLYFILLS=!1,st.FORCE_POLYFILL_PROMISE=!1,st.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1,st.defineProperty=st.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(e,t,i){return e==Array.prototype||e==Object.prototype||(e[t]=i.value),e},st.getGlobal=function(e){e=[typeof globalThis=="object"&&globalThis,e,typeof window=="object"&&window,typeof self=="object"&&self,typeof Do=="object"&&Do];for(var t=0;t>>0,st.propertyToPolyfillSymbol[c]=st.IS_SYMBOL_NATIVE?st.global.Symbol(c):st.POLYFILL_PREFIX+i+"$"+c),st.defineProperty(r,st.propertyToPolyfillSymbol[c],{configurable:!0,writable:!0,value:t})))},st.polyfill("globalThis",function(e){return e||st.global},"es_2020","es3"),st.arrayIteratorImpl=function(e){var t=0;return function(){return t{const e=Rm.length,t=[];for(let i=0;20>i;i++)t[i]=Rm.charAt(Math.random()*e);return t.join("")}},fS=0,Ia={};Ia.TEST_ONLY=km,Ia.genUid=he,Ia.getNextUniqueId=$e;var Tp,Er,Oa,Bi,Fi,mn,br,Ca,Tn,ci,ai,vr,Fs,Ir,Or,Cr,Ui,Hi,En,yr,Us,bn,ya,vn,Sa,pt;Tp="",Er=!0,Oa=0,s.CREATE$$module$build$src$core$events$utils="create",s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils="delete",s.DELETE$$module$build$src$core$events$utils,s.CHANGE$$module$build$src$core$events$utils="change",s.CHANGE$$module$build$src$core$events$utils,Bi="block_field_intermediate_change",s.MOVE$$module$build$src$core$events$utils="move",s.MOVE$$module$build$src$core$events$utils,Fi="var_create",mn="var_delete",br="var_rename",Ca="ui",Tn="drag",ci="selected",ai="click",vr="marker_move",Fs="bubble_open",Ir="trashcan_open",Or="toolbox_item_select",Cr="theme_change",Ui="viewport_change",Hi="comment_create",En="comment_delete",yr="comment_change",Us="comment_move",bn="finished_loading",ya=[s.CREATE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,Hi,Us],vn=[],Sa={FIRE_QUEUE:vn,fireNow:D,fireInternal:Ie,setGroupInternal:Me},pt={},pt.BLOCK_CHANGE=s.CHANGE$$module$build$src$core$events$utils,pt.BLOCK_CREATE=s.CREATE$$module$build$src$core$events$utils,pt.BLOCK_DELETE=s.DELETE$$module$build$src$core$events$utils,pt.BLOCK_DRAG=Tn,pt.BLOCK_FIELD_INTERMEDIATE_CHANGE=Bi,pt.BLOCK_MOVE=s.MOVE$$module$build$src$core$events$utils,pt.BUBBLE_OPEN=Fs,pt.BUMP_EVENTS=ya,pt.CHANGE=s.CHANGE$$module$build$src$core$events$utils,pt.CLICK=ai,pt.COMMENT_CHANGE=yr,pt.COMMENT_CREATE=Hi,pt.COMMENT_DELETE=En,pt.COMMENT_MOVE=Us,pt.CREATE=s.CREATE$$module$build$src$core$events$utils,pt.DELETE=s.DELETE$$module$build$src$core$events$utils,pt.FINISHED_LOADING=bn,pt.MARKER_MOVE=vr,pt.MOVE=s.MOVE$$module$build$src$core$events$utils,pt.SELECTED=ci,pt.TEST_ONLY=Sa,pt.THEME_CHANGE=Cr,pt.TOOLBOX_ITEM_SELECT=Or,pt.TRASHCAN_OPEN=Ir,pt.UI=Ca,pt.VAR_CREATE=Fi,pt.VAR_DELETE=mn,pt.VAR_RENAME=br,pt.VIEWPORT_CHANGE=Ui,pt.clearPendingUndo=ae,pt.disable=s.disable$$module$build$src$core$events$utils,pt.disableOrphans=We,pt.enable=s.enable$$module$build$src$core$events$utils,pt.filter=B,pt.fire=re,pt.fromJson=Je,pt.get=we,pt.getDescendantIds=Xe,pt.getGroup=s.getGroup$$module$build$src$core$events$utils,pt.getRecordUndo=ke,pt.isEnabled=_e,pt.setGroup=s.setGroup$$module$build$src$core$events$utils,pt.setRecordUndo=fe,function(e){e[e.VALUE=1]="VALUE",e[e.STATEMENT=3]="STATEMENT",e[e.DUMMY=5]="DUMMY",e[e.CUSTOM=6]="CUSTOM"}(s.inputTypes$$module$build$src$core$inputs$input_types||(s.inputTypes$$module$build$src$core$inputs$input_types={})),s.inputTypes$$module$build$src$core$inputs$input_types;var Ra={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies")}},Ep={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies")}},{document:ka,DOMParser:Bl,XMLSerializer:Fl}=globalThis;Bl&&(Ra=new Bl),Fl&&(Ep=new Fl);var Am="https://developers.google.com/blockly/xml",mS=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,In={};In.NAME_SPACE=Am,In.createElement=s.createElement$$module$build$src$core$utils$xml,In.createTextNode=s.createTextNode$$module$build$src$core$utils$xml,In.domToText=ht,In.injectDependencies=nt,In.textToDom=s.textToDom$$module$build$src$core$utils$xml;var Uo=class{constructor(e){this.name=e}toString(){return this.name}equals(e){return this.name===e.toString()}};Uo.MUTATOR=new Uo("mutator"),Uo.WARNING=new Uo("warning"),Uo.COMMENT=new Uo("comment");var Sr={};Sr.warn=xe;var Aa="http://www.w3.org/2000/svg",ui="http://www.w3.org/1999/xhtml",us="http://www.w3.org/1999/xlink",di;(function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE"})(di||(di={}));var Es=null,bp=0,La=null,co={};co.HTML_NS=ui,co.NodeType=di,co.SVG_NS=Aa,co.XLINK_NS=us,co.addClass=I,co.containsNode=Te,co.createSvgElement=w,co.getFastTextWidth=Ne,co.getFastTextWidthWithSizeString=He,co.getTextWidth=Se,co.hasClass=K,co.insertAfter=de,co.measureFontMetrics=be,co.removeClass=A,co.removeClasses=N,co.removeNode=U,co.setCssTransform=se,co.startTextWidthCache=Ce,co.stopTextWidthCache=ce;var Vt=class{constructor(e,t){this.width=e,this.height=t}static equals(e,t){return e===t?!0:e&&t?e.width===t.width&&e.height===t.height:!1}},Lm=function(e,t){window.alert(e),t&&t()},Nm=function(e,t){t(window.confirm(e))},wm=function(e,t,i){i(window.prompt(e,t))},Mm={confirmInternal:ye},Vi={};Vi.TEST_ONLY=Mm,Vi.alert=ee,Vi.confirm=ue,Vi.prompt=g,Vi.setAlert=ie,Vi.setConfirm=E,Vi.setPrompt=k;var vp,Na;s.Msg$$module$build$src$core$msg=Object.create(null),vp=function(e){Object.keys(e).forEach(function(t){s.Msg$$module$build$src$core$msg[t]=e[t]})},Na={},Na.Msg=s.Msg$$module$build$src$core$msg,Na.setLocale=vp;var Rr=class{constructor(){this.workspaceId=void 0,this.isUiEvent=!1,this.type="",this.group=s.getGroup$$module$build$src$core$events$utils(),this.recordUndo=ke()}toJson(){return{type:this.type,group:this.group}}static fromJson(e,t,i){return i.isBlank=!1,i.group=e.group||"",i.workspaceId=t.id,i}isNull(){return!1}run(e){}getEventWorkspace_(){let e;if(this.workspaceId&&(e=S(this.workspaceId)),!e)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return e}},Ul=class extends Rr{constructor(e){super(),this.isBlank=typeof e>"u",e&&(this.varId=e.getId(),this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");return e.varId=this.varId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Ul),t.varId=e.varId,t}},Ip=class extends Ul{constructor(e){super(e),this.type=Fi,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Ip),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.createVariable(this.varName,this.varType,this.varId):t.deleteVariableById(this.varId)}};l(Ae.EVENT,Fi,Ip);var Hl=class{constructor(e,t,i,r){this.workspace=e,this.name=t,this.type=i||"",this.id_=r||he()}getId(){return this.id_}static compareByName(e,t){return e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}},Op="VARIABLE",Cp="ijkmnopqrstuvwxyzabcdefgh",Dm={generateUniqueNameInternal:ii},ao={};ao.CATEGORY_NAME=Op,ao.TEST_ONLY=Dm,ao.VAR_LETTER_OPTIONS=Cp,ao.allDeveloperVariables=s.allDeveloperVariables$$module$build$src$core$variables,ao.allUsedVarModels=s.allUsedVarModels$$module$build$src$core$variables,ao.createVariableButtonHandler=Qo,ao.flyoutCategory=ze,ao.flyoutCategoryBlocks=yt,ao.generateUniqueName=ls,ao.generateUniqueNameFromOptions=xt,ao.generateVariableFieldDom=s.generateVariableFieldDom$$module$build$src$core$variables,ao.getAddedVariables=y,ao.getOrCreateVariablePackage=s.getOrCreateVariablePackage$$module$build$src$core$variables,ao.getVariable=s.getVariable$$module$build$src$core$variables,ao.nameUsedWithAnyType=qo,ao.nameUsedWithConflictingParam=b,ao.promptName=Ht,ao.renameVariable=s.renameVariable$$module$build$src$core$variables;var Ue=class{constructor(e,t){this.x=e,this.y=t}clone(){return new Ue(this.x,this.y)}scale(e){return this.x*=e,this.y*=e,this}translate(e,t){return this.x+=e,this.y+=t,this}static equals(e,t){return e===t?!0:e&&t?e.x===t.x&&e.y===t.y:!1}static distance(e,t){const i=e.x-t.x;return e=e.y-t.y,Math.sqrt(i*i+e*e)}static magnitude(e){return Math.sqrt(e.x*e.x+e.y*e.y)}static difference(e,t){return new Ue(e.x-t.x,e.y-t.y)}static sum(e,t){return new Ue(e.x+t.x,e.y+t.y)}},Hs=class{constructor(e,t,i,r,c){this.workspace=e,this.editable=this.movable=this.deletable=!0,this.disposed_=!1,this.isComment=!0,this.id=c&&!e.getCommentById(c)?c:he(),e.addTopComment(this),this.xy_=new Ue(0,0),this.height_=i,this.width_=r,this.RTL=e.RTL,this.content_=t,Hs.fireCreateEvent(this)}dispose(){this.disposed_||(_e()&&re(new(we(En))(this)),this.workspace.removeTopComment(this),this.disposed_=!0)}getHeight(){return this.height_}setHeight(e){this.height_=e}getWidth(){return this.width_}setWidth(e){this.width_=e}getRelativeToSurfaceXY(){return new Ue(this.xy_.x,this.xy_.y)}moveBy(e,t){const i=new(we(Us))(this);this.xy_.translate(e,t),i.recordNew(),re(i)}isDeletable(){return this.deletable&&!(this.workspace&&this.workspace.options.readOnly)}setDeletable(e){this.deletable=e}isMovable(){return this.movable&&!(this.workspace&&this.workspace.options.readOnly)}setMovable(e){this.movable=e}isEditable(){return this.editable&&!(this.workspace&&this.workspace.options.readOnly)}setEditable(e){this.editable=e}getContent(){return this.content_}setContent(e){this.content_!==e&&(re(new(we(yr))(this,this.content_,e)),this.content_=e)}toXmlWithXY(e){return e=this.toXml(e),e.setAttribute("x",String(Math.round(this.xy_.x))),e.setAttribute("y",String(Math.round(this.xy_.y))),e.setAttribute("h",String(this.height_)),e.setAttribute("w",String(this.width_)),e}toXml(e){const t=s.createElement$$module$build$src$core$utils$xml("comment");return e||(t.id=this.id),t.textContent=this.getContent(),t}static fireCreateEvent(e){if(_e()){const t=s.getGroup$$module$build$src$core$events$utils();t||s.setGroup$$module$build$src$core$events$utils(!0);try{re(new(we(Hi))(e))}finally{s.setGroup$$module$build$src$core$events$utils(t)}}}static fromXml(e,t){var i=Hs.parseAttributes(e);return t=new Hs(t,i.content,i.h,i.w,i.id),i=e.getAttribute("x"),e=e.getAttribute("y"),i=i?parseInt(i,10):NaN,e=e?parseInt(e,10):NaN,isNaN(i)||isNaN(e)||t.moveBy(i,e),Hs.fireCreateEvent(t),t}static parseAttributes(e){const t=e.getAttribute("h"),i=e.getAttribute("w"),r=e.getAttribute("x"),c=e.getAttribute("y"),$=e.getAttribute("id");if(!$)throw Error("No ID present in XML comment definition.");let v;return{id:$,h:t?parseInt(t):100,w:i?parseInt(i):100,x:r?parseInt(r):NaN,y:c?parseInt(c):NaN,content:(v=e.textContent)!=null?v:""}}},Vs=class extends Rr{constructor(e){super(),this.recordUndo=!1,this.isUiEvent=!0,this.isBlank=typeof e>"u",this.workspaceId=e||""}},yp=class extends Vs{constructor(e,t,i){super(i),this.type=ci,this.oldElementId=e??void 0,this.newElementId=t??void 0}toJson(){const e=super.toJson();return e.oldElementId=this.oldElementId,e.newElementId=this.newElementId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new yp),t.oldElementId=e.oldElementId,t.newElementId=e.newElementId,t}};l(Ae.EVENT,ci,yp);var TS=750,Pm="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),wa=null,On={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"],mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},Ma=0,hi={};hi.TOUCH_ENABLED=Pm,hi.TOUCH_MAP=On,hi.checkTouchIdentifier=po,hi.clearTouchIdentifier=Ge,hi.getTouchIdentifierFromEvent=Mt,hi.longStart=V,hi.longStop=ve,hi.shouldHandleEvent=rt;var Sp,xm,Bm,Fm,Da,Pa,Rp,Um,Hm,Vm;(function(e){function t(r){return i.indexOf(r.toUpperCase())!==-1}Sp=e;const i=Sp.toUpperCase();xm=t("JavaFX"),Bm=t("WebKit"),Fm=t("Gecko")&&!Bm,Da=t("Android"),e=globalThis.navigator&&globalThis.navigator.maxTouchPoints,Pa=t("iPad")||t("Macintosh")&&0.blocklyPathLight { + display: none; +} + +.blocklyDraggable { + cursor: grab; + cursor: -webkit-grab; +} + +.blocklyDragging { + cursor: grabbing; + cursor: -webkit-grabbing; +} + + /* Changes cursor on mouse down. Not effective in Firefox because of + https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */ +.blocklyDraggable:active { + cursor: grabbing; + cursor: -webkit-grabbing; +} + +.blocklyDragging.blocklyDraggingDelete { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyDragging>.blocklyPath, +.blocklyDragging>.blocklyPathLight { + fill-opacity: .8; + stroke-opacity: .8; +} + +.blocklyDragging>.blocklyPathDark { + display: none; +} + +.blocklyDisabled>.blocklyPath { + fill-opacity: .5; + stroke-opacity: .5; +} + +.blocklyDisabled>.blocklyPathLight, +.blocklyDisabled>.blocklyPathDark { + display: none; +} + +.blocklyInsertionMarker>.blocklyPath, +.blocklyInsertionMarker>.blocklyPathLight, +.blocklyInsertionMarker>.blocklyPathDark { + fill-opacity: .2; + stroke: none; +} + +.blocklyMultilineText { + font-family: monospace; +} + +.blocklyNonEditableText>text { + pointer-events: none; +} + +.blocklyFlyout { + position: absolute; + z-index: 20; +} + +.blocklyText text { + cursor: default; +} + +/* + Don't allow users to select text. It gets annoying when trying to + drag a block and selected text moves instead. +*/ +.blocklySvg text { + user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + cursor: inherit; +} + +.blocklyHidden { + display: none; +} + +.blocklyFieldDropdown:not(.blocklyHidden) { + display: block; +} + +.blocklyIconGroup { + cursor: default; +} + +.blocklyIconGroup:not(:hover), +.blocklyIconGroupReadonly { + opacity: .6; +} + +.blocklyIconShape { + fill: #00f; + stroke: #fff; + stroke-width: 1px; +} + +.blocklyIconSymbol { + fill: #fff; +} + +.blocklyMinimalBody { + margin: 0; + padding: 0; +} + +.blocklyHtmlInput { + border: none; + border-radius: 4px; + height: 100%; + margin: 0; + outline: none; + padding: 0; + width: 100%; + text-align: center; + display: block; + box-sizing: border-box; +} + +/* Remove the increase and decrease arrows on the field number editor */ +input.blocklyHtmlInput[type=number]::-webkit-inner-spin-button, +input.blocklyHtmlInput[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +input[type=number] { + -moz-appearance: textfield; +} + +.blocklyMainBackground { + stroke-width: 1; + stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */ +} + +.blocklyMutatorBackground { + fill: #fff; + stroke: #ddd; + stroke-width: 1; +} + +.blocklyFlyoutBackground { + fill: #ddd; + fill-opacity: .8; +} + +.blocklyMainWorkspaceScrollbar { + z-index: 20; +} + +.blocklyFlyoutScrollbar { + z-index: 30; +} + +.blocklyScrollbarHorizontal, +.blocklyScrollbarVertical { + position: absolute; + outline: none; +} + +.blocklyScrollbarBackground { + opacity: 0; +} + +.blocklyScrollbarHandle { + fill: #ccc; +} + +.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyScrollbarHandle:hover { + fill: #bbb; +} + +/* Darken flyout scrollbars due to being on a grey background. */ +/* By contrast, workspace scrollbars are on a white background. */ +.blocklyFlyout .blocklyScrollbarHandle { + fill: #bbb; +} + +.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle, +.blocklyFlyout .blocklyScrollbarHandle:hover { + fill: #aaa; +} + +.blocklyInvalidInput { + background: #faa; +} + +.blocklyVerticalMarker { + stroke-width: 3px; + fill: rgba(255,255,255,.5); + pointer-events: none; +} + +.blocklyComputeCanvas { + position: absolute; + width: 0; + height: 0; +} + +.blocklyNoPointerEvents { + pointer-events: none; +} + +.blocklyContextMenu { + border-radius: 4px; + max-height: 100%; +} + +.blocklyDropdownMenu { + border-radius: 2px; + padding: 0 !important; +} + +.blocklyDropdownMenu .blocklyMenuItem { + /* 28px on the left for icon or checkbox. */ + padding-left: 28px; +} + +/* BiDi override for the resting state. */ +.blocklyDropdownMenu .blocklyMenuItemRtl { + /* Flip left/right padding for BiDi. */ + padding-left: 5px; + padding-right: 28px; +} + +.blocklyWidgetDiv .blocklyMenu { + background: #fff; + border: 1px solid transparent; + box-shadow: 0 0 3px 1px rgba(0,0,0,.3); + font: normal 13px Arial, sans-serif; + margin: 0; + outline: none; + padding: 4px 0; + position: absolute; + overflow-y: auto; + overflow-x: hidden; + max-height: 100%; + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +.blocklyWidgetDiv .blocklyMenu.blocklyFocused { + box-shadow: 0 0 6px 1px rgba(0,0,0,.3); +} + +.blocklyDropDownDiv .blocklyMenu { + background: inherit; /* Compatibility with gapi, reset from goog-menu */ + border: inherit; /* Compatibility with gapi, reset from goog-menu */ + font: normal 13px "Helvetica Neue", Helvetica, sans-serif; + outline: none; + position: relative; /* Compatibility with gapi, reset from goog-menu */ + z-index: 20000; /* Arbitrary, but some apps depend on it... */ +} + +/* State: resting. */ +.blocklyMenuItem { + border: none; + color: #000; + cursor: pointer; + list-style: none; + margin: 0; + /* 7em on the right for shortcut. */ + min-width: 7em; + padding: 6px 15px; + white-space: nowrap; +} + +/* State: disabled. */ +.blocklyMenuItemDisabled { + color: #ccc; + cursor: inherit; +} + +/* State: hover. */ +.blocklyMenuItemHighlight { + background-color: rgba(0,0,0,.1); +} + +/* State: selected/checked. */ +.blocklyMenuItemCheckbox { + height: 16px; + position: absolute; + width: 16px; +} + +.blocklyMenuItemSelected .blocklyMenuItemCheckbox { + background: url(<<>>/sprites.png) no-repeat -48px -16px; + float: left; + margin-left: -24px; + position: static; /* Scroll with the menu. */ +} + +.blocklyMenuItemRtl .blocklyMenuItemCheckbox { + float: right; + margin-right: -24px; +} +`,Mp={};Mp.inject=gd,Mp.register=cs;var Bt=class{constructor(e,t,i,r){this.top=e,this.bottom=t,this.left=i,this.right=r}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}contains(e,t){return e>=this.left&&e<=this.right&&t>=this.top&&t<=this.bottom}intersects(e){return!(this.left>e.right||this.righte.bottom||this.bottom{this.disposed_||(this.textarea.focus(),this.addFocus(),this.svgRectTarget&&I(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&I(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}blurFocus(){this.focused=!1,setTimeout(()=>{this.disposed_||(this.textarea.blur(),this.removeFocus(),this.svgRectTarget&&A(this.svgRectTarget,"blocklyCommentTargetFocused"),this.svgHandleTarget&&A(this.svgHandleTarget,"blocklyCommentHandleTargetFocused"))},0)}static fromXmlRendered(e,t,i){s.disable$$module$build$src$core$events$utils();let r;try{const c=Hs.parseAttributes(e);if(r=new yo(t,c.content,c.h,c.w,c.id),t.rendered&&(r.initSvg(!0),r.render()),!isNaN(c.x)&&!isNaN(c.y))if(t.RTL){const $=i||t.getWidth();r.moveBy($-c.x,c.y)}else r.moveBy(c.x,c.y)}finally{s.enable$$module$build$src$core$events$utils()}return Hs.fireCreateEvent(r),r}};yo.DEFAULT_SIZE=100,yo.TOP_OFFSET=10,cs(` +.blocklyCommentForeignObject { + position: relative; + z-index: 0; +} + +.blocklyCommentRect { + fill: #E7DE8E; + stroke: #bcA903; + stroke-width: 1px; +} + +.blocklyCommentTarget { + fill: transparent; + stroke: #bcA903; +} + +.blocklyCommentTargetFocused { + fill: none; +} + +.blocklyCommentHandleTarget { + fill: none; +} + +.blocklyCommentHandleTargetFocused { + fill: transparent; +} + +.blocklyFocused>.blocklyCommentRect { + fill: #B9B272; + stroke: #B9B272; +} + +.blocklySelected>.blocklyCommentTarget { + stroke: #fc3; + stroke-width: 3px; +} + +.blocklyCommentDeleteIcon { + cursor: pointer; + fill: #000; + display: none; +} + +.blocklySelected > .blocklyCommentDeleteIcon { + display: block; +} + +.blocklyDeleteIconShape { + fill: #000; + stroke: #000; + stroke-width: 1px; +} + +.blocklyDeleteIconShape.blocklyDeleteIconHighlighted { + stroke: #fc3; +} +`);var Fa=new Set,Ua=new WeakSet,Ar=null,Dp=null,Km=0,Ha={};Ha.finishQueuedRenders=cr,Ha.queueRender=Id,Ha.triggerQueuedRenders=Ds;var Ho={};Ho.appendDomToWorkspace=Bg,Ho.blockToDom=Ni,Ho.blockToDomWithXY=Ol,Ho.clearWorkspaceAndLoadFromXml=xg,Ho.deleteNext=jg,Ho.domToBlock=s.domToBlock$$module$build$src$core$xml,Ho.domToBlockInternal=wi,Ho.domToPrettyText=Pg,Ho.domToText=Ps,Ho.domToVariables=Ld,Ho.domToWorkspace=s.domToWorkspace$$module$build$src$core$xml,Ho.variablesToDom=kd,Ho.workspaceToDom=wg;var Lr=class extends Error{},Qm=class extends Lr{constructor(e){super("Expected to find a 'type' property, defining the block type"),this.state=e}},Vl=class extends Lr{constructor(e,t,i){super(`The block ${t.toDevString()} is missing a(n) ${e} +connection`),this.block=t,this.state=i}},qm=class extends Lr{constructor(e,t,i,r){super(`The block ${i.toDevString()} could not connect its +${t} to its parent, because: ${e}`),this.childBlock=i,this.childState=r}},Jm=class extends Lr{constructor(e){super(`Encountered a real block which is defined as a child of a shadow +block. It is an invariant of Blockly that shadow blocks only have shadow +children`),this.state=e}},Zm=class extends Lr{constructor(e,t,i){super(`Cannot add an icon of type '${e}' to the block ${t.toDevString()}, because there is no icon registered with type '${e}'. Make sure that all of your icons have been registered.`),this.block=t,this.state=i}},Cn={};Cn.BadConnectionCheck=qm,Cn.DeserializationError=Lr,Cn.MissingBlockType=Qm,Cn.MissingConnection=Vl,Cn.RealChildOfShadow=Jm,Cn.UnregisteredIcon=Zm;var eT=100,tT=75,oT=50,Va={};Va.BLOCKS=oT,Va.PROCEDURES=tT,Va.VARIABLES=eT;var Pp={};Pp.register=jc,Pp.unregister=Yg;var sT=class{constructor(){this.priority=oT}save(e){const t=[];for(const i of e.getTopBlocks(!1))(e=xs(i,{addCoordinates:!0,doFullSerialization:!1}))&&t.push(e);return t.length?{languageVersion:0,blocks:t}:null}load(e,t){e=e.blocks;for(const i of e)_n(i,t,{recordUndo:ke()})}clear(e){for(const t of e.getTopBlocks(!1))t.dispose(!1)}};jc("blocks",new sT);var Gl={};Gl.BlockSerializer=sT,Gl.append=_n,Gl.appendInternal=Cl,Gl.save=xs;var yn=class extends Rr{constructor(e){super(),this.isBlank=!e,e&&(this.blockId=e.id,this.workspaceId=e.workspace.id)}toJson(){const e=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.blockId=this.blockId,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new yn),t.blockId=e.blockId,t}},xp=class extends yn{constructor(e){super(e),this.type=s.CREATE$$module$build$src$core$events$utils,e&&(e.isShadow()&&(this.recordUndo=!1),this.xml=Ol(e),this.ids=Xe(e),this.json=xs(e,{addCoordinates:!0}))}toJson(){const e=super.toJson();if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.xml=Ps(this.xml),e.ids=this.ids,e.json=this.json,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new xp),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t.ids=e.ids,t.json=e.json,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(e)_n(this.json,t);else for(e=0;e")),re(new Sn(t,"mutation",null,i,e));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(e){return e.saveExtraState?(e=e.saveExtraState())?JSON.stringify(e):"":e.mutationToDom&&(e=e.mutationToDom())?Ps(e):""}};l(Ae.EVENT,s.CHANGE$$module$build$src$core$events$utils,Sn);var Bp=class extends yn{constructor(e){if(super(e),this.type=s.DELETE$$module$build$src$core$events$utils,e){if(e.getParent())throw Error("Connected blocks cannot be deleted.");e.isShadow()&&(this.recordUndo=!1),this.oldXml=Ol(e),this.ids=Xe(e),this.wasShadow=e.isShadow(),this.oldJson=xs(e,{addCoordinates:!0})}}toJson(){const e=super.toJson();if(!this.oldXml)throw Error("The old block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(this.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");return e.oldXml=Ps(this.oldXml),e.ids=this.ids,e.wasShadow=this.wasShadow,e.oldJson=this.oldJson,this.recordUndo||(e.recordUndo=this.recordUndo),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new Bp),t.oldXml=s.textToDom$$module$build$src$core$utils$xml(e.oldXml),t.ids=e.ids,t.wasShadow=e.wasShadow||t.oldXml.tagName.toLowerCase()==="shadow",t.oldJson=e.oldJson,e.recordUndo!==void 0&&(t.recordUndo=e.recordUndo),t}run(e){const t=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(e)for(e=0;ec.top?Xd(i,r,c,$):t+$.heightdocument.documentElement.clientTop?Xd(i,r,c,$):gf(e,c,$)}},so={};so.ANIMATION_TIME=za,so.ARROW_HORIZONTAL_PADDING=lT,so.ARROW_SIZE=Wl,so.BORDER_SIZE=Up,so.PADDING_Y=Hp,so.TEST_ONLY=Wp,so.clearContent=Yc,so.createDom=Bd,so.getContentDiv=dr,so.getOwner=Ud,so.getPositionX=Sl,so.hide=Qc,so.hideIfOwner=hr,so.hideWithoutAnimation=fs,so.isVisible=jd,so.repositionForWindowResize=Kd,so.setBoundsElement=Fd,so.setColour=Kc,so.show=Wd,so.showPositionedByBlock=_f,so.showPositionedByField=yl;var zl=class{constructor(e){this.workspace=e,this.cursorSvg_=this.cursor_=null,this.markers=new Map,this.markerSvg_=null}registerMarker(e,t){this.markers.has(e)&&this.unregisterMarker(e),t.setDrawer(this.workspace.getRenderer().makeMarkerDrawer(this.workspace,t)),this.setMarkerSvg(t.getDrawer().createDom()),this.markers.set(e,t)}unregisterMarker(e){const t=this.markers.get(e);if(t)t.dispose(),this.markers.delete(e);else throw Error("Marker with ID "+e+" does not exist. Can only unregister markers that exist.")}getCursor(){return this.cursor_}getMarker(e){return this.markers.get(e)||null}setCursor(e){this.cursor_&&this.cursor_.getDrawer()&&this.cursor_.getDrawer().dispose(),(this.cursor_=e)&&(e=this.workspace.getRenderer().makeMarkerDrawer(this.workspace,this.cursor_),this.cursor_.setDrawer(e),this.setCursorSvg(this.cursor_.getDrawer().createDom()))}setCursorSvg(e){e?(this.workspace.getBlockCanvas().appendChild(e),this.cursorSvg_=e):this.cursorSvg_=null}setMarkerSvg(e){e?this.workspace.getBlockCanvas()&&(this.cursorSvg_?this.workspace.getBlockCanvas().insertBefore(e,this.cursorSvg_):this.workspace.getBlockCanvas().appendChild(e)):this.markerSvg_=null}updateMarkers(){this.workspace.keyboardAccessibilityMode&&this.cursorSvg_&&this.workspace.getCursor().draw()}dispose(){const e=Object.keys(this.markers);for(let t=0,i;i=e[t];t++)this.unregisterMarker(i);this.markers.clear(),this.cursor_&&(this.cursor_.dispose(),this.cursor_=null)}};zl.LOCAL_MARKER="local_marker_1";var An={};An.commonWordPrefix=Qd,An.commonWordSuffix=qd,An.isNumber=s.isNumber$$module$build$src$core$utils$string,An.shortestStringLength=Rl,An.startsWith=ff,An.wrap=s.wrap$$module$build$src$core$utils$string;var Xa=void 0,Xl=!1,Pr=!1,aT=50,uT=0,Ln=0,zp=0,Xp=0,ds=null,jl=null,jp=0,Yp=10,dT=10,hT=750,ja=5,ro=null,$o={};$o.HOVER_MS=hT,$o.LIMIT=aT,$o.MARGINS=ja,$o.OFFSET_X=jp,$o.OFFSET_Y=Yp,$o.RADIUS_OK=dT,$o.bindMouseEvents=kl,$o.block=ih,$o.createDom=eh,$o.dispose=sh,$o.getCustomTooltip=bf,$o.getDiv=If,$o.getTooltipOfObject=pr,$o.hide=ni,$o.isVisible=vf,$o.setCustomTooltip=Ef,$o.unbindMouseEvents=th,$o.unblock=nh;var Kp=.45,Qp=.65,pT={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},So={};So.blend=gn,So.getHsvSaturation=rh,So.getHsvValue=lh,So.hexToRgb=Jc,So.hsvToHex=Zc,So.hueToHex=ch,So.names=pT,So.parse=Di,So.rgbToHex=Al,So.setHsvSaturation=Af,So.setHsvValue=Lf;var Yl={};Yl.checkMessageReferences=ta,Yl.parseBlockColour=$r,Yl.replaceMessageReferences=Zt,Yl.tokenizeInterpolation=ah;var xr=null,Ya=null,Br="",Fr="",bs,Gs={};Gs.createDom=uh,Gs.getDiv=fn,Gs.hide=as,Gs.hideIfOwner=sa,Gs.isVisible=dh,Gs.positionWithAnchor=ph,Gs.repositionForWindowResize=$h,Gs.show=oa,Gs.testOnly_setDiv=Nf;var bt=class{constructor(e,t,i){this.DEFAULT_VALUE=null,this.name=void 0,this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null,this.disposed=!1,this.maxDisplayLength=50,this.sourceBlock_=null,this.enabled_=this.visible_=this.isDirty_=!0,this.suffixField=this.prefixField=this.clickTarget_=null,this.EDITABLE=!0,this.SERIALIZABLE=!1,this.CURSOR="",this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE,this.size_=new Vt(0,0),e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){e.tooltip&&this.setTooltip(Zt(e.tooltip))}setSourceBlock(e){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=e}getConstants(){return!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants()),this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=w(te.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_(),this.createTextElement_()}initModel(){}createBorderRect_(){this.borderRect_=w(te.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,class:"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=w(te.TEXT,{class:"blocklyText"},this.fieldGroup_),this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central"),this.textContent_=document.createTextNode(""),this.textElement_.appendChild(this.textContent_)}bindEvents_(){const e=this.getClickTarget_();if(!e)throw Error("A click target has not been set.");kl(e),this.mouseDownWrapper_=Be(e,"pointerdown",this,this.onMouseDown_)}fromXml(e){this.setValue(e.textContent)}toXml(e){return e.textContent=this.getValue(),e}saveState(e){return e=this.saveLegacyState(bt),e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(bt,e)||this.setValue(e)}saveLegacyState(e){return e.prototype.saveState===this.saveState&&e.prototype.toXml!==this.toXml?(e=s.createElement$$module$build$src$core$utils$xml("field"),e.setAttribute("name",this.name||""),ht(this.toXml(e)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(e,t){return e.prototype.loadState===this.loadState&&e.prototype.fromXml!==this.fromXml?(this.fromXml(s.textToDom$$module$build$src$core$utils$xml(t)),!0):!1}dispose(){hr(this),sa(this);let e;(e=this.getSourceBlock())!=null&&e.isDeadOrDying()||U(this.fieldGroup_),this.disposed=!0}updateEditable(){const e=this.fieldGroup_,t=this.getSourceBlock();this.EDITABLE&&e&&t&&(this.enabled_&&t.isEditable()?(I(e,"blocklyEditableText"),A(e,"blocklyNonEditableText"),e.style.cursor=this.CURSOR):(I(e,"blocklyNonEditableText"),A(e,"blocklyEditableText"),e.style.cursor=""))}setEnabled(e){this.enabled_=e,this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==bt.prototype.showEditor_}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let e=!1;return this.name&&(this.SERIALIZABLE?e=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),e=!0)),e}isVisible(){return this.visible_}setVisible(e){if(this.visible_!==e){this.visible_=e;var t=this.fieldGroup_;t&&(t.style.display=e?"block":"none")}}setValidator(e){this.validator_=e}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_()}showEditor(e){this.isClickable()&&this.showEditor_(e)}showEditor_(e){}repositionForWindowResize(){return!1}updateSize_(e){const t=this.getConstants();e=e!==void 0?e:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let i=2*e,r=t.FIELD_TEXT_HEIGHT,c=0;this.textElement_&&(c=Ne(this.textElement_,t.FIELD_TEXT_FONTSIZE,t.FIELD_TEXT_FONTWEIGHT,t.FIELD_TEXT_FONTFAMILY),i+=c),this.borderRect_&&(r=Math.max(r,t.FIELD_BORDER_RECT_HEIGHT)),this.size_.height=r,this.size_.width=i,this.positionTextElement_(e,c),this.positionBorderRect_()}positionTextElement_(e,t){if(this.textElement_){var i=this.getConstants(),r=this.size_.height/2,c;this.textElement_.setAttribute("x",String((c=this.getSourceBlock())!=null&&c.RTL?this.size_.width-t-e:e)),this.textElement_.setAttribute("y",String(i.FIELD_TEXT_BASELINE_CENTER?r:r-i.FIELD_TEXT_HEIGHT/2+i.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)))}getSize(){return this.isVisible()?(this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&this.size_.width===0&&(this.render_(),this.size_.width!==0&&console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead.")),this.size_):new Vt(0,0)}getScaledBBox(){let e;var t=this.getSourceBlock();if(!t)throw new io;if(this.borderRect_){var i=this.borderRect_.getBoundingClientRect();e=Li(this.borderRect_),t=i.width,i=i.height}else{i=this.sourceBlock_.getHeightWidth();const r=t.workspace.scale;e=this.getAbsoluteXY_(),t=(i.width+1)*r,i=(i.height+1)*r,kp?(e.x+=1.5*r,e.y+=1.5*r):(e.x-=.5*r,e.y-=.5*r)}return new Bt(e.y,e.y+i,e.x,e.x+t)}getDisplayText_(){let e=this.getText();return e?(e.length>this.maxDisplayLength&&(e=e.substring(0,this.maxDisplayLength-2)+"…"),e=e.replace(/\s/g,bt.NBSP),this.sourceBlock_&&this.sourceBlock_.RTL&&(e+="‏"),e):bt.NBSP}getText(){const e=this.getText_();return String(e!==null?e:this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0,this.constants_=null}forceRerender(){this.isDirty_=!0,this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.queueRender(),this.sourceBlock_.bumpNeighbours())}setValue(e,t=!0){if(e!==null){var i=this.doClassValidation_(e);if(e=this.processValidation_(e,i),!(e instanceof Error)){var r;i=(r=this.getValidator())==null?void 0:r.call(this,e),r=this.processValidation_(e,i),r instanceof Error||(e=this.sourceBlock_,e&&e.disposed||(i=this.getValue(),i===r?this.doValueUpdate_(r):(this.doValueUpdate_(r),t&&e&&_e()&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(e,"field",this.name||null,i,r)),this.isDirty_&&this.forceRerender())))}}}processValidation_(e,t){return t===null?(this.doValueInvalid_(e),this.isDirty_&&this.forceRerender(),Error()):t===void 0?e:t}getValue(){return this.value_}doClassValidation_(e){return e??null}doValueUpdate_(e){this.value_=e,this.isDirty_=!0}doValueInvalid_(e){}onMouseDown_(e){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(e=this.sourceBlock_.workspace.getGesture(e))&&e.setStartField(this)}setTooltip(e){e||e===""||(e=this.sourceBlock_);const t=this.getClickTarget_();t?t.tooltip=e:this.tooltip_=e}getTooltip(){const e=this.getClickTarget_();return pr(e||{tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return Li(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let e=null;const t=this.getSourceBlock();if(!t)throw new io;const i=t.inputList;for(let r=0;re?this.menuItems.length:e,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(e,t){e+=t;let i;for(;i=this.menuItems[e];){if(i.isEnabled()){this.setHighlighted(i);break}e+=t}}handleMouseOver(e){(e=this.getMenuItem(e.target))&&(e.isEnabled()?this.highlightedItem!==e&&this.setHighlighted(e):this.setHighlighted(null))}handleClick(e){const t=this.openingCoords;if(this.openingCoords=null,t&&typeof e.clientX=="number"){const i=new Ue(e.clientX,e.clientY);if(1>Ue.distance(t,i))return}(e=this.getMenuItem(e.target))&&e.performAction()}handleMouseEnter(e){this.focus()}handleMouseLeave(e){this.getElement()&&(this.blur(),this.setHighlighted(null))}handleKeyEvent(e){if(this.menuItems.length&&!(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)){var t=this.highlightedItem;switch(e.key){case"Enter":case" ":t&&t.performAction();break;case"ArrowUp":this.highlightPrevious();break;case"ArrowDown":this.highlightNext();break;case"PageUp":case"Home":this.highlightFirst();break;case"PageDown":case"End":this.highlightLast();break;default:return}e.preventDefault(),e.stopPropagation()}}getSize(){const e=this.getElement(),t=Il(e);return t.height=e.scrollHeight,t}},Jp=class{constructor(e,t){this.content=e,this.opt_value=t,this.enabled=!0,this.element=null,this.rightToLeft=!1,this.roleName=null,this.highlight=this.checked=this.checkable=!1,this.actionHandler=null}createDom(){const e=document.createElement("div");e.id=$e(),this.element=e,e.className="blocklyMenuItem goog-menuitem "+(this.enabled?"":"blocklyMenuItemDisabled goog-menuitem-disabled ")+(this.checked?"blocklyMenuItemSelected goog-option-selected ":"")+(this.highlight?"blocklyMenuItemHighlight goog-menuitem-highlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl goog-menuitem-rtl ":"");const t=document.createElement("div");if(t.className="blocklyMenuItemContent goog-menuitem-content",this.checkable){var i=document.createElement("div");i.className="blocklyMenuItemCheckbox goog-menuitem-checkbox",t.appendChild(i)}return i=this.content,typeof this.content=="string"&&(i=document.createTextNode(this.content)),t.appendChild(i),e.appendChild(t),this.roleName&&ms(e,this.roleName),Xt(e,Gt.SELECTED,this.checkable&&this.checked||!1),Xt(e,Gt.DISABLED,!this.enabled),e}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let e;return(e=this.opt_value)!=null?e:null}setRightToLeft(e){this.rightToLeft=e}setRole(e){this.roleName=e}setCheckable(e){this.checkable=e}setChecked(e){this.checked=e}setHighlighted(e){this.highlight=e;const t=this.getElement();t&&this.isEnabled()&&(e?(I(t,"blocklyMenuItemHighlight"),I(t,"goog-menuitem-highlight")):(A(t,"blocklyMenuItemHighlight"),A(t,"goog-menuitem-highlight")))}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}performAction(){this.isEnabled()&&this.actionHandler&&this.actionHandler(this)}onAction(e,t){this.actionHandler=e.bind(t)}},Ws=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.svgArrow=this.arrow=this.imageElement=this.menu_=this.selectedMenuItem=null,this.SERIALIZABLE=!0,this.CURSOR="default",this.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null,e!==bt.SKIP_SETUP&&(Array.isArray(e)?(_h(e),e=Bf(e),this.menuGenerator_=e.options,this.prefixField=e.prefix||null,this.suffixField=e.suffix||null):this.menuGenerator_=e,this.selectedOption=this.getOptions(!1)[0],i&&this.configure_(i),this.setValue(this.selectedOption[1]),t&&this.setValidator(t))}fromXml(e){this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(e.textContent)}loadState(e){this.loadLegacyState(Ws,e)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(e))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot(),this.createTextElement_(),this.imageElement=w(te.IMAGE,{},this.fieldGroup_),this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_(),this.borderRect_&&I(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){let e;return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!((e=this.getSourceBlock())!=null&&e.isShadow())}createTextArrow_(){this.arrow=w(te.TSPAN,{},this.textElement_);let e;this.arrow.appendChild(document.createTextNode((e=this.getSourceBlock())!=null&&e.RTL?Ws.ARROW_CHAR+" ":" "+Ws.ARROW_CHAR));let t;(t=this.getSourceBlock())!=null&&t.RTL?this.getTextElement().insertBefore(this.arrow,this.textContent_):this.getTextElement().appendChild(this.arrow)}createSVGArrow_(){this.svgArrow=w(te.IMAGE,{height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_),this.svgArrow.setAttributeNS(us,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(e){var t=this.getSourceBlock();if(!t)throw new io;this.dropdownCreate(),this.menu_.openingCoords=e&&typeof e.clientX=="number"?new Ue(e.clientX,e.clientY):null,Yc(),e=this.menu_.render(dr()),I(e,"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(e=t.isShadow()?t.getParent().getColour():t.getColour(),t=t.isShadow()?t.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,Kc(e,t)),yl(this,this.dropdownDispose_.bind(this)),this.menu_.focus(),this.selectedMenuItem&&(this.menu_.setHighlighted(this.selectedMenuItem),Wc(this.selectedMenuItem.getElement(),dr(),!0)),this.applyColour()}dropdownCreate(){const e=this.getSourceBlock();if(!e)throw new io;const t=new qp;t.setRole(Vo.LISTBOX),this.menu_=t;const i=this.getOptions(!1);this.selectedMenuItem=null;for(let c=0;ct[1]===e)?e:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+e),null)}doValueUpdate_(e){super.doValueUpdate_(e),e=this.getOptions(!0);for(let t=0,i;i=e[t];t++)i[1]===this.value_&&(this.selectedOption=i)}applyColour(){const e=this.sourceBlock_.style;this.borderRect_&&(this.borderRect_.setAttribute("stroke",e.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",e.colourTertiary):this.borderRect_.setAttribute("fill","transparent")),this.sourceBlock_&&this.arrow&&(this.sourceBlock_.isShadow()?this.arrow.style.fill=e.colourSecondary:this.arrow.style.fill=e.colourPrimary)}render_(){this.getTextContent().nodeValue="",this.imageElement.style.display="none";const e=this.selectedOption&&this.selectedOption[0];e&&typeof e=="object"?this.renderSelectedImage(e):this.renderSelectedText(),this.positionBorderRect_()}renderSelectedImage(e){const t=this.getSourceBlock();if(!t)throw new io;this.imageElement.style.display="",this.imageElement.setAttributeNS(us,"xlink:href",e.src),this.imageElement.setAttribute("height",String(e.height)),this.imageElement.setAttribute("width",String(e.width));const i=Number(e.height);e=Number(e.width);var r=!!this.borderRect_;const c=Math.max(r?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,i+SS);r=r?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let $;$=this.svgArrow?this.positionSVGArrow(e+r,c/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):Ne(this.arrow,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY),this.size_.width=e+$+2*r,this.size_.height=c;let v=0;t.RTL?this.imageElement.setAttribute("x",`${r+$}`):(v=e+$,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${r}`)),this.imageElement.setAttribute("y",String(c/2-i/2)),this.positionTextElement_(v+r,e+$)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();var e=this.getTextElement();I(e,"blocklyDropdownText"),e.setAttribute("text-anchor","start");var t=!!this.borderRect_;e=Math.max(t?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const i=Ne(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);t=t?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let r=0;this.svgArrow&&(r=this.positionSVGArrow(i+t,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2)),this.size_.width=i+r+2*t,this.size_.height=e,this.positionTextElement_(t,i)}positionSVGArrow(e,t){if(!this.svgArrow)return 0;const i=this.getSourceBlock();if(!i)throw new io;const r=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,c=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,$=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;return this.svgArrow.setAttribute("transform","translate("+(i.RTL?r:e+c)+","+t+")"),$+c}getText_(){if(!this.selectedOption)return null;const e=this.selectedOption[0];return typeof e=="object"?e.alt:e}static fromJson(e){if(!e.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(e.options,void 0,e)}};Ws.CHECKMARK_OVERHANG=25,Ws.MAX_MENU_HEIGHT_VH=.45,Ws.ARROW_CHAR="▾";var yS=5,SS=2*yS;Jo("field_dropdown",Ws);var Ka=class{constructor(e){this.sourceBlock=e,this.offsetInBlock=new Ue(0,0),this.workspaceLocation=new Ue(0,0),this.svgRoot=null}getType(){throw Error("Icons must implement getType")}initView(e){if(!this.svgRoot){var t=this.sourceBlock;this.svgRoot=w(te.G,{class:"blocklyIconGroup"}),t.getSvgRoot().appendChild(this.svgRoot),this.updateSvgRootOffset(),Be(this.svgRoot,"pointerdown",this,e)}}dispose(){U(this.svgRoot)}getWeight(){return-1}getSize(){return new Vt(0,0)}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",Mi(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(e){this.offsetInBlock=e,this.updateSvgRootOffset()}updateSvgRootOffset(){let e;(e=this.svgRoot)==null||e.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(e){this.workspaceLocation=Ue.sum(e,this.offsetInBlock)}onClick(){}setVisible(e){xe("setVisible","v10","v11","setBubbleVisible"),Mi(this)&&this.setBubbleVisible(e)}},no=class{constructor(e,t,i,r,c){this.workspace=e,this.horizontal=t,this.oldHostMetrics=null,this.ratio=1,this.origin=new Ue(0,0),this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0,this.containerVisible=this.isHandleVisible=!0,this.position=new Ue(0,0),this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null,this.pair=i||!1,this.margin=c!==void 0?c:no.DEFAULT_SCROLLBAR_MARGIN,e="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical"),r&&(e+=" "+r),this.outerSvg=w(te.SVG,{class:e}),r=w(te.G,{},this.outerSvg),this.svgBackground=w(te.RECT,{class:"blocklyScrollbarBackground"},r),e=Math.floor((no.scrollbarThickness-5)/2),this.svgHandle=w(te.RECT,{class:"blocklyScrollbarHandle",rx:e,ry:e},r),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill"),this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity"),de(this.outerSvg,this.workspace.getParentSvg()),this.setInitialThickness(),t?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y"),this.onMouseDownBarWrapper_=Be(this.svgBackground,"pointerdown",this,this.onMouseDownBar),this.onMouseDownHandleWrapper_=Be(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const e=no.scrollbarThickness;this.horizontal?(this.svgBackground.setAttribute("height",String(e)),this.outerSvg.setAttribute("height",String(e)),this.svgHandle.setAttribute("height",String(e-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(e)),this.outerSvg.setAttribute("width",String(e)),this.svgHandle.setAttribute("width",String(e-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp(),Dt(this.onMouseDownBarWrapper_),Dt(this.onMouseDownHandleWrapper_),U(this.outerSvg),this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength)}setHandleLength(e){this.handleLength=e,this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(e){return e=0>=e||isNaN(e)?0:Math.min(e,this.scrollbarLength-this.handleLength)}setHandlePosition(e){this.handlePosition=e,this.svgHandle.setAttribute(this.positionAttribute_,String(this.handlePosition))}setScrollbarLength(e){this.scrollbarLength=e,this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength)),this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(e,t){this.position.x=e,this.position.y=t,se(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(e){!e&&(e=this.workspace.getMetrics(),!e)||this.oldHostMetrics&&no.metricsAreEquivalent(e,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(e):this.resizeVertical(e),this.oldHostMetrics=e,this.updateMetrics())}requiresViewResize(e){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==e.viewWidth||this.oldHostMetrics.viewHeight!==e.viewHeight||this.oldHostMetrics.absoluteLeft!==e.absoluteLeft||this.oldHostMetrics.absoluteTop!==e.absoluteTop:!0}resizeHorizontal(e){this.requiresViewResize(e)?this.resizeViewHorizontal(e):this.resizeContentHorizontal(e)}resizeViewHorizontal(e){var t=e.viewWidth-2*this.margin;this.pair&&(t-=no.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),t=e.absoluteLeft+this.margin,this.pair&&this.workspace.RTL&&(t+=no.scrollbarThickness),this.setPosition(t,e.absoluteTop+e.viewHeight-no.scrollbarThickness-this.margin),this.resizeContentHorizontal(e)}resizeContentHorizontal(e){if(e.viewWidth>=e.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewWidth/e.scrollWidth;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollWidth-e.viewWidth;var i=this.scrollbarLength-this.handleLength;e=(e.viewLeft-e.scrollLeft)/t*i,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=i/t}}resizeVertical(e){this.requiresViewResize(e)?this.resizeViewVertical(e):this.resizeContentVertical(e)}resizeViewVertical(e){let t=e.viewHeight-2*this.margin;this.pair&&(t-=no.scrollbarThickness),this.setScrollbarLength(Math.max(0,t)),this.setPosition(this.workspace.RTL?e.absoluteLeft+this.margin:e.absoluteLeft+e.viewWidth-no.scrollbarThickness-this.margin,e.absoluteTop+this.margin),this.resizeContentVertical(e)}resizeContentVertical(e){if(e.viewHeight>=e.scrollHeight)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var t=this.scrollbarLength*e.viewHeight/e.scrollHeight;t=this.constrainHandleLength(t),this.setHandleLength(t),t=e.scrollHeight-e.viewHeight;var i=this.scrollbarLength-this.handleLength;e=(e.viewTop-e.scrollTop)/t*i,e=this.constrainHandlePosition(e),this.setHandlePosition(e),this.ratio=i/t}}isVisible(){return this.isHandleVisible}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay_()}setVisible(e){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(e)}setVisibleInternal(e){const t=e!==this.isVisible();this.isHandleVisible=e,t&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(e){if(this.workspace.markFocused(),Ge(),this.cleanUp(),Ai(e))e.stopPropagation();else{var t=pn(e,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());t=this.horizontal?t.x:t.y;var i=zc(this.svgHandle);i=this.horizontal?i.x:i.y;var r=this.handlePosition,c=.95*this.handleLength;t<=i?r-=c:t>=i+this.handleLength&&(r+=c),this.setHandlePosition(this.constrainHandlePosition(r)),this.updateMetrics(),e.stopPropagation(),e.preventDefault()}}onMouseDownHandle(e){this.workspace.markFocused(),this.cleanUp(),Ai(e)?e.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?e.clientX:e.clientY,this.onMouseUpWrapper_=Be(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=Be(document,"pointermove",this,this.onMouseMoveHandle),e.stopPropagation(),e.preventDefault())}onMouseMoveHandle(e){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?e.clientX:e.clientY)-this.startDragMouse))),this.updateMetrics()}onMouseUpHandle(){Ge(),this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0),this.onMouseUpWrapper_&&(Dt(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null),this.onMouseMoveWrapper_&&(Dt(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let e=this.handlePosition/(this.scrollbarLength-this.handleLength);return isNaN(e)&&(e=0),e}updateMetrics(){const e=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:e}):this.workspace.setMetrics({y:e})}set(e,t){this.setHandlePosition(this.constrainHandlePosition(e*this.ratio)),(t||t===void 0)&&this.updateMetrics()}setOrigin(e,t){this.origin=new Ue(e,t)}static metricsAreEquivalent(e,t){return e.viewWidth===t.viewWidth&&e.viewHeight===t.viewHeight&&e.viewLeft===t.viewLeft&&e.viewTop===t.viewTop&&e.absoluteTop===t.absoluteTop&&e.absoluteLeft===t.absoluteLeft&&e.scrollWidth===t.scrollWidth&&e.scrollHeight===t.scrollHeight&&e.scrollLeft===t.scrollLeft&&e.scrollTop===t.scrollTop}};no.scrollbarThickness=Pm?25:15,no.DEFAULT_SCROLLBAR_MARGIN=.5;var Zp,$t=class{constructor(e,t,i){this.workspace=e,this.anchor=t,this.ownerRect=i,this.size=new Vt(0,0),this.colour="#ffffff",this.disposed=!1,this.relativeLeft=this.relativeTop=0,this.svgRoot=w(te.G,{},e.getBubbleCanvas()),e=w(te.G,{filter:`url(#${this.workspace.getRenderer().getConstants().embossFilterId})`},this.svgRoot),this.tail=w(te.PATH,{},e),this.background=w(te.RECT,{class:"blocklyDraggable",x:0,y:0,rx:$t.BORDER_WIDTH,ry:$t.BORDER_WIDTH},e),this.contentContainer=w(te.G,{},this.svgRoot),Be(this.background,"pointerdown",this,this.onMouseDown)}dispose(){U(this.svgRoot),this.disposed=!0}setAnchorLocation(e,t=!1){this.anchor=e,t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}setPositionRelativeToAnchor(e,t){this.relativeLeft=e,this.relativeTop=t,this.positionRelativeToAnchor(),this.renderTail()}getSize(){return this.size}setSize(e,t=!1){e.width=Math.max(e.width,$t.MIN_SIZE),e.height=Math.max(e.height,$t.MIN_SIZE),this.size=e,this.background.setAttribute("width",`${e.width}`),this.background.setAttribute("height",`${e.height}`),t?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor(),this.renderTail()}getColour(){return this.colour}setColour(e){this.colour=e,this.tail.setAttribute("fill",e),this.background.setAttribute("fill",e)}onMouseDown(e){let t;(t=this.workspace.getGesture(e))==null||t.handleBubbleStart(e,this)}positionRelativeToAnchor(){let e=this.anchor.x;e=this.workspace.RTL?e-(this.relativeLeft+this.size.width):e+this.relativeLeft,this.moveTo(e,this.relativeTop+this.anchor.y)}moveTo(e,t){this.svgRoot.setAttribute("transform",`translate(${e}, ${t})`)}positionByRect(e=new Bt(0,0,0,0)){var t=this.workspace.getMetricsManager().getViewMetrics(!0),i=this.getOptimalRelativeLeft(t),r=this.getOptimalRelativeTop(t);const c={x:i,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},$={x:-this.size.width-30,y:r};r={x:e.getWidth(),y:r};var v={x:i,y:e.getHeight()};i=e.getWidth()e.width)return t;if(e=this.getWorkspaceViewRect(e),this.workspace.RTL){var i=this.anchor.x-t;i-this.size.widthe.right&&(t=-(e.right-this.anchor.x))}else{i=t+this.anchor.x;const r=i+this.size.width;ie.right&&(t=e.right-this.anchor.x-this.size.width)}return t}getOptimalRelativeTop(e){let t=-this.size.height/4;if(this.size.height>e.height)return t;const i=this.anchor.y+t,r=i+this.size.height;return e=this.getWorkspaceViewRect(e),ie.bottom&&(t=e.bottom-this.anchor.y-this.size.height),t}getWorkspaceViewRect(e){const t=e.top;let i=e.top+e.height,r=e.left;return e=e.left+e.width,i-=this.getScrollbarThickness(),this.workspace.RTL?r-=this.getScrollbarThickness():e-=this.getScrollbarThickness(),new Bt(t,i,r,e)}getScrollbarThickness(){return no.scrollbarThickness/this.workspace.scale}renderTail(){const e=[];var t=this.size.width/2,i=this.size.height/2,r=-this.relativeLeft,c=-this.relativeTop;if(t===r&&i===c)e.push("M "+t+","+i);else{c-=i,r-=t,this.workspace.RTL&&(r*=-1);var $=Math.sqrt(c*c+r*r),v=Math.acos(r/$);0>c&&(v=2*Math.PI-v);var H=v+Math.PI/2;H>2*Math.PI&&(H-=2*Math.PI);var Oe=Math.sin(H);const qt=Math.cos(H);let Ft=(this.size.width+this.size.height)/$t.TAIL_THICKNESS;Ft=Math.min(Ft,this.size.width,this.size.height)/4,H=1-$t.ANCHOR_RADIUS/$,r=t+H*r,c=i+H*c,H=t+Ft*qt;const Go=i+Ft*Oe;t-=Ft*qt,i-=Ft*Oe,Oe=ar(this.workspace.RTL?-$t.TAIL_ANGLE:$t.TAIL_ANGLE),Oe=v+Oe,Oe>2*Math.PI&&(Oe-=2*Math.PI),v=Math.sin(Oe)*$/$t.TAIL_BEND,$=Math.cos(Oe)*$/$t.TAIL_BEND,e.push("M"+H+","+Go),e.push("C"+(H+$)+","+(Go+v)+" "+r+","+c+" "+r+","+c),e.push("C"+r+","+c+" "+(t+$)+","+(i+v)+" "+t+","+i)}e.push("z");let Qe;(Qe=this.tail)==null||Qe.setAttribute("d",e.join(" "))}bringToFront(){let e;const t=(e=this.svgRoot)==null?void 0:e.parentNode;return this.svgRoot&&(t==null?void 0:t.lastChild)!==this.svgRoot?(t==null||t.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Ue(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(e){this.moveTo(e.x,e.y),this.relativeLeft=this.workspace.RTL?this.anchor.x-e.x-this.size.width:e.x-this.anchor.x,this.relativeTop=e.y-this.anchor.y,this.renderTail()}setDragging(e){}setDeleteStyle(e){}isDeletable(){return!1}showContextMenu(e){}};Zp=$t,$t.BORDER_WIDTH=6,$t.DOUBLE_BORDER=2*Zp.BORDER_WIDTH,$t.MIN_SIZE=Zp.DOUBLE_BORDER,$t.TAIL_THICKNESS=1,$t.TAIL_ANGLE=20,$t.TAIL_BEND=4,$t.ANCHOR_RADIUS=8;var _T={};_T.deepMerge=ri;var Nn=class{constructor(e,t,i,r){this.name=e,this.startHats=!1,this.blockStyles=t||Object.create(null),this.categoryStyles=i||Object.create(null),this.componentStyles=r||Object.create(null),this.fontStyle=Object.create(null),l(Ae.THEME,e,this,!0)}getClassName(){return this.name+"-theme"}setBlockStyle(e,t){this.blockStyles[e]=t}setCategoryStyle(e,t){this.categoryStyles[e]=t}getComponentStyle(e){if(e=this.componentStyles[e],!e)return null;if(typeof e=="string"){const t=this.getComponentStyle(e);if(t)return t}return`${e}`}setComponentStyle(e,t){this.componentStyles[e]=t}setFontStyle(e){this.fontStyle=e}setStartHats(e){this.startHats=e}static defineTheme(e,t){e=e.toLowerCase();const i=new Nn(e);let r=t.base;if(r){if(typeof r=="string"){let c;r=(c=f(Ae.THEME,r))!=null?c:void 0}r instanceof Nn&&(ri(i,r),i.name=e)}return ri(i.blockStyles,t.blockStyles),ri(i.categoryStyles,t.categoryStyles),ri(i.componentStyles,t.componentStyles),ri(i.fontStyle,t.fontStyle),t.startHats!==null&&(i.startHats=t.startHats),i}},RS={colour_blocks:{colourPrimary:"20"},list_blocks:{colourPrimary:"260"},logic_blocks:{colourPrimary:"210"},loop_blocks:{colourPrimary:"120"},math_blocks:{colourPrimary:"230"},procedure_blocks:{colourPrimary:"290"},text_blocks:{colourPrimary:"160"},variable_blocks:{colourPrimary:"330"},variable_dynamic_blocks:{colourPrimary:"310"},hat_blocks:{colourPrimary:"330",hat:"cap"}},kS={colour_category:{colour:"20"},list_category:{colour:"260"},logic_category:{colour:"210"},loop_category:{colour:"120"},math_category:{colour:"230"},procedure_category:{colour:"290"},text_category:{colour:"160"},variable_category:{colour:"330"},variable_dynamic_category:{colour:"310"}},Qa=new Nn("classic",RS,kS),e$="categoryToolbox",gT="flyoutToolbox",at;(function(e){e[e.TOP=0]="TOP",e[e.BOTTOM=1]="BOTTOM",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"})(at||(at={}));var fT={hasCategoriesInternal:Hf},zi={};zi.Position=at,zi.TEST_ONLY=fT,zi.convertFlyoutDefToJsonArray=Ll,zi.convertToolboxDefToJson=ia,zi.hasCategories=na,zi.isCategoryCollapsible=ra,zi.parseToolboxTree=fh;var hs=class{constructor(e){this.gridPattern=null,this.getMetrics=this.setMetrics=void 0;let t=null,i=!1;var r=!1,c=!1,$=!1,v=!1,H=!1;const Oe=!!e.readOnly;if(!Oe){var Qe;t=ia((Qe=e.toolbox)!=null?Qe:null),i=na(t),r=e.trashcan,r=r===void 0?i:r,c=e.collapse,c=c===void 0?i:c,$=e.comments,$=$===void 0?i:$,v=e.disable,v=v===void 0?i:v,H=e.sounds,H=H===void 0?!0:H}Qe=e.maxTrashcanContents,r?Qe===void 0&&(Qe=32):Qe=0;const qt=!!e.rtl;let Ft=e.horizontalLayout;Ft===void 0&&(Ft=!1);var Go=e.toolboxPosition!=="end";Go=Ft?Go?at.TOP:at.BOTTOM:Go===qt?at.RIGHT:at.LEFT;let Jr=e.css;Jr===void 0&&(Jr=!0);let Zr="https://blockly-demo.appspot.com/static/media/";e.media?Zr=e.media.endsWith("/")?e.media:e.media+"/":"path"in e&&(xe("path","Nov 2014","Jul 2023","media"),Zr=e.path+"media/");const yE=e.oneBasedIndex,a9=e.renderer||"geras",u9=e.plugins||{};let q$=e.modalInputs;q$===void 0&&(q$=!0),this.RTL=qt,this.oneBasedIndex=yE===void 0?!0:yE,this.collapse=c,this.comments=$,this.disable=v,this.readOnly=Oe,this.maxBlocks=e.maxBlocks||1/0;let SE;this.maxInstances=(SE=e.maxInstances)!=null?SE:null,this.modalInputs=q$,this.pathToMedia=Zr,this.hasCategories=i,this.moveOptions=hs.parseMoveOptions_(e,i),this.hasScrollbars=!!this.moveOptions.scrollbars,this.hasTrashcan=r,this.maxTrashcanContents=Qe,this.hasSounds=H,this.hasCss=Jr,this.horizontalLayout=Ft,this.languageTree=t,this.gridOptions=hs.parseGridOptions_(e),this.zoomOptions=hs.parseZoomOptions_(e),this.toolboxPosition=Go,this.theme=hs.parseThemeOptions_(e),this.renderer=a9;let RE;this.rendererOverrides=(RE=e.rendererOverrides)!=null?RE:null;let kE;this.parentWorkspace=(kE=e.parentWorkspace)!=null?kE:null,this.plugins=u9}static parseMoveOptions_(e,t){const i=e.move||{},r={};return i.scrollbars===void 0&&e.scrollbars===void 0?r.scrollbars=t:typeof i.scrollbars=="object"?(r.scrollbars={horizontal:!!i.scrollbars.horizontal,vertical:!!i.scrollbars.vertical},r.scrollbars.horizontal&&r.scrollbars.vertical?r.scrollbars=!0:r.scrollbars.horizontal||r.scrollbars.vertical||(r.scrollbars=!1)):r.scrollbars=!!i.scrollbars||!!e.scrollbars,r.wheel=r.scrollbars&&i.wheel!==void 0?!!i.wheel:typeof r.scrollbars=="object",r.drag=r.scrollbars?i.drag===void 0?!0:!!i.drag:!1,r}static parseZoomOptions_(e){e=e.zoom||{};const t={};return t.controls=e.controls===void 0?!1:!!e.controls,t.wheel=e.wheel===void 0?!1:!!e.wheel,t.startScale=e.startScale===void 0?1:Number(e.startScale),t.maxScale=e.maxScale===void 0?3:Number(e.maxScale),t.minScale=e.minScale===void 0?.3:Number(e.minScale),t.scaleSpeed=e.scaleSpeed===void 0?1.2:Number(e.scaleSpeed),t.pinch=e.pinch===void 0?t.wheel||t.controls:!!e.pinch,t}static parseGridOptions_(e){e=e.grid||{};const t={};return t.spacing=Number(e.spacing)||0,t.colour=e.colour||"#888",t.length=e.length===void 0?1:Number(e.length),t.snap=0t.y&&e.moveBy(0,20-t.y),e.RTL){let i=-20;const r=this.miniWorkspace.getFlyout();r&&(i-=r.getWidth()),t.x>i&&e.moveBy(i-t.x,0)}else 20>t.x&&e.moveBy(20-t.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()){var e=this.getSize(),t=this.calculateWorkspaceSize();Math.abs(e.width-t.width)({kind:"block",type:i}))}),t}getAnchorLocation(){const e=qa/2;return Ue.sum(this.workspaceLocation,new Ue(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new Bt(e.y,e.y+e.height,e.x,e.x+e.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace());for(var e of this.rootBlock.getDescendants(!1))e.queueRender();this.rootBlock.setMovable(!1),this.rootBlock.setDeletable(!1);let t,i,r,c;e=(c=(t=this.miniWorkspaceBubble)==null||(i=t.getWorkspace())==null||(r=i.getFlyout())==null?void 0:r.getWidth())!=null?c:0,this.rootBlock.moveBy(this.rootBlock.RTL?-(e+Ja):Ja,Ja)}addSaveConnectionsListener(){if(this.sourceBlock.saveConnections&&this.rootBlock){var e=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)};e(),this.sourceBlock.workspace.addChangeListener(e)}}createMiniWorkspaceChangeListener(){return e=>{s.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(e)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null,this.recomposeSourceBlock()},0))}}static isIgnorableMutatorEvent(e){return e.isUiEvent||e.type===s.CREATE$$module$build$src$core$events$utils||e.type===s.CHANGE$$module$build$src$core$events$utils&&e.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var e=s.getGroup$$module$build$src$core$events$utils();e||s.setGroup$$module$build$src$core$events$utils(!0);var t=Sn.getExtraBlockState_(this.sourceBlock);this.sourceBlock.compose(this.rootBlock);var i=Sn.getExtraBlockState_(this.sourceBlock);t!==i&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock,"mutation",null,t,i)),s.setGroup$$module$build$src$core$events$utils(e)}}getWorkspace(){let e;return(e=this.miniWorkspaceBubble)==null?void 0:e.getWorkspace()}static reconnect(e,t,i){return xe("MutatorIcon.reconnect","v10","v11","connection.reconnect"),e?e.reconnect(t,i):!1}static findParentWs(e){return xe("MutatorIcon.findParentWs","v10","v11","workspace.getRootWorkspace"),e.getRootWorkspace()}},s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=Uo.MUTATOR,s.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1,s.MutatorIcon$$module$build$src$core$icons$mutator_icon;var Ur=Object.create(null),AS={allExtensions:Ur};s.register$$module$build$src$core$extensions("parent_tooltip_when_inline",Kf);var ps={};ps.TEST_ONLY=AS,ps.apply=ca,ps.buildTooltipForDropdown=s.buildTooltipForDropdown$$module$build$src$core$extensions,ps.buildTooltipWithFieldText=s.buildTooltipWithFieldText$$module$build$src$core$extensions,ps.isRegistered=mh,ps.register=s.register$$module$build$src$core$extensions,ps.registerMixin=s.registerMixin$$module$build$src$core$extensions,ps.registerMutator=s.registerMutator$$module$build$src$core$extensions,ps.runAfterPageLoad=da,ps.unregister=Gf,function(e){e[e.LEFT=-1]="LEFT",e[e.CENTRE=0]="CENTRE",e[e.RIGHT=1]="RIGHT"}(s.Align$$module$build$src$core$inputs$align||(s.Align$$module$build$src$core$inputs$align={})),s.Align$$module$build$src$core$inputs$align;var mT={};mT.removeElem=Po;var ft;(function(e){e[e.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX",e[e.MAC_ENTER=3]="MAC_ENTER",e[e.BACKSPACE=8]="BACKSPACE",e[e.TAB=9]="TAB",e[e.NUM_CENTER=12]="NUM_CENTER",e[e.ENTER=13]="ENTER",e[e.SHIFT=16]="SHIFT",e[e.CTRL=17]="CTRL",e[e.ALT=18]="ALT",e[e.PAUSE=19]="PAUSE",e[e.CAPS_LOCK=20]="CAPS_LOCK",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.PRINT_SCREEN=44]="PRINT_SCREEN",e[e.INSERT=45]="INSERT",e[e.DELETE=46]="DELETE",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.FF_SEMICOLON=59]="FF_SEMICOLON",e[e.FF_EQUALS=61]="FF_EQUALS",e[e.FF_DASH=173]="FF_DASH",e[e.FF_HASH=163]="FF_HASH",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.AT_SIGN=64]="AT_SIGN",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.META=91]="META",e[e.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT",e[e.CONTEXT_MENU=93]="CONTEXT_MENU",e[e.NUM_ZERO=96]="NUM_ZERO",e[e.NUM_ONE=97]="NUM_ONE",e[e.NUM_TWO=98]="NUM_TWO",e[e.NUM_THREE=99]="NUM_THREE",e[e.NUM_FOUR=100]="NUM_FOUR",e[e.NUM_FIVE=101]="NUM_FIVE",e[e.NUM_SIX=102]="NUM_SIX",e[e.NUM_SEVEN=103]="NUM_SEVEN",e[e.NUM_EIGHT=104]="NUM_EIGHT",e[e.NUM_NINE=105]="NUM_NINE",e[e.NUM_MULTIPLY=106]="NUM_MULTIPLY",e[e.NUM_PLUS=107]="NUM_PLUS",e[e.NUM_MINUS=109]="NUM_MINUS",e[e.NUM_PERIOD=110]="NUM_PERIOD",e[e.NUM_DIVISION=111]="NUM_DIVISION",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F3=114]="F3",e[e.F4=115]="F4",e[e.F5=116]="F5",e[e.F6=117]="F6",e[e.F7=118]="F7",e[e.F8=119]="F8",e[e.F9=120]="F9",e[e.F10=121]="F10",e[e.F11=122]="F11",e[e.F12=123]="F12",e[e.NUMLOCK=144]="NUMLOCK",e[e.SCROLL_LOCK=145]="SCROLL_LOCK",e[e.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY",e[e.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY",e[e.SEMICOLON=186]="SEMICOLON",e[e.DASH=189]="DASH",e[e.EQUALS=187]="EQUALS",e[e.COMMA=188]="COMMA",e[e.PERIOD=190]="PERIOD",e[e.SLASH=191]="SLASH",e[e.APOSTROPHE=192]="APOSTROPHE",e[e.TILDE=192]="TILDE",e[e.SINGLE_QUOTE=222]="SINGLE_QUOTE",e[e.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET",e[e.BACKSLASH=220]="BACKSLASH",e[e.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET",e[e.WIN_KEY=224]="WIN_KEY",e[e.MAC_FF_META=224]="MAC_FF_META",e[e.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT",e[e.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT",e[e.WIN_IME=229]="WIN_IME",e[e.VK_NONAME=252]="VK_NONAME",e[e.PHANTOM=255]="PHANTOM"})(ft||(ft={}));var fi={};fi.arc=oo,fi.curve=xo,fi.line=_r,fi.lineOnAxis=je,fi.lineTo=Bs,fi.moveBy=jt,fi.moveTo=To,fi.point=tt;var Qt={};Qt.Coordinate=Ue,Qt.KeyCodes=ft,Qt.Rect=Bt,Qt.Size=Vt,Qt.Svg=te,Qt.aria=Ql,Qt.array=mT,Qt.browserEvents=$i,Qt.colour=So,Qt.deprecation=Sr,Qt.dom=co,Qt.extensions=ps,Qt.idGenerator=Ia,Qt.math=Wa,Qt.object=_T,Qt.parsing=Yl,Qt.string=An,Qt.style=_i,Qt.svgMath=Gi,Qt.svgPaths=fi,Qt.toolbox=zi,Qt.userAgent=pi,Qt.xml=In;var t$={};t$.register=bh,t$.unregister=Qf;var o$=class extends $t{constructor(e,t,i,r){super(t,i,r),this.text=e,this.workspace=t,this.anchor=i,this.ownerRect=r,this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}getText(){return this.text}setText(e){this.text=e,U(this.paragraph),this.paragraph=this.stringToSvg(e,this.contentContainer),this.updateBubbleSize()}stringToSvg(e,t){return t=this.createParagraph(t),e=this.createSpans(t,e),this.workspace.RTL&&this.rightAlignSpans(t.getBBox().width,e),t}createParagraph(e){return w(te.TEXT,{class:"blocklyText blocklyBubbleText blocklyNoPointerEvents",y:$t.BORDER_WIDTH},e)}createSpans(e,t){return t.split(` +`).map(i=>{const r=w(te.TSPAN,{dy:"1em",x:$t.BORDER_WIDTH},e);return i=document.createTextNode(i),r.appendChild(i),r})}rightAlignSpans(e,t){for(const i of t)i.setAttribute("text-anchor","end"),i.setAttribute("x",`${e+$t.BORDER_WIDTH}`)}updateBubbleSize(){const e=this.paragraph.getBBox();this.setSize(new Vt(e.width+2*$t.BORDER_WIDTH,e.height+2*$t.BORDER_WIDTH),!0)}},TT=class extends $t{constructor(e,t,i){super(e,t,i),this.workspace=e,this.anchor=t,this.ownerRect=i,this.resizePointerMoveListener=this.resizePointerUpListener=null,this.textChangeListeners=[],this.sizeChangeListeners=[],this.text="",this.DEFAULT_SIZE=new Vt(160+$t.DOUBLE_BORDER,80+$t.DOUBLE_BORDER),this.MIN_SIZE=new Vt(45+$t.DOUBLE_BORDER,20+$t.DOUBLE_BORDER),{inputRoot:this.inputRoot,textArea:this.textArea}=this.createEditor(this.contentContainer),this.resizeGroup=this.createResizeHandle(this.svgRoot),this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.text}setText(e){this.text=e,this.textArea.value=e,this.onTextChange()}addTextChangeListener(e){this.textChangeListeners.push(e)}addSizeChangeListener(e){this.sizeChangeListeners.push(e)}createEditor(e){e=w(te.FOREIGNOBJECT,{x:$t.BORDER_WIDTH,y:$t.BORDER_WIDTH},e);const t=document.createElementNS(ui,"body");t.setAttribute("xmlns",ui),t.className="blocklyMinimalBody";const i=document.createElementNS(ui,"textarea");return i.className="blocklyCommentTextarea",i.setAttribute("dir",this.workspace.RTL?"RTL":"LTR"),t.appendChild(i),e.appendChild(t),this.bindTextAreaEvents(i),setTimeout(()=>{i.focus()},0),{inputRoot:e,textArea:i}}bindTextAreaEvents(e){Be(e,"wheel",this,t=>{t.stopPropagation()}),Be(e,"focus",this,this.onStartEdit,!0),Be(e,"change",this,this.onTextChange)}createResizeHandle(e){e=w(te.G,{class:this.workspace.RTL?"blocklyResizeSW":"blocklyResizeSE"},e);const t=2*$t.BORDER_WIDTH;return w(te.POLYGON,{points:`0,${t} ${t},${t} ${t},0`},e),w(te.LINE,{class:"blocklyResizeLine",x1:t/3,y1:t-1,x2:t-1,y2:t/3},e),w(te.LINE,{class:"blocklyResizeLine",x1:2*t/3,y1:t-1,x2:t-1,y2:2*t/3},e),Be(e,"pointerdown",this,this.onResizePointerDown),e}setSize(e,t=!1){e.width=Math.max(e.width,this.MIN_SIZE.width),e.height=Math.max(e.height,this.MIN_SIZE.height);const i=e.width-$t.DOUBLE_BORDER,r=e.height-$t.DOUBLE_BORDER;this.inputRoot.setAttribute("width",`${i}`),this.inputRoot.setAttribute("height",`${r}`),this.textArea.style.width=`${i-4}px`,this.textArea.style.height=`${r-4}px`,this.workspace.RTL?this.resizeGroup.setAttribute("transform",`translate(${$t.DOUBLE_BORDER}, ${r}) scale(-1 1)`):this.resizeGroup.setAttribute("transform",`translate(${i}, ${r})`),super.setSize(e,t),this.onSizeChange()}getSize(){return super.getSize()}onResizePointerDown(e){this.bringToFront(),Ai(e)||(this.workspace.startDrag(e,new Ue(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=Be(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=Be(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()),e.stopPropagation()}onResizePointerUp(e){Ge(),this.resizePointerUpListener&&(Dt(this.resizePointerUpListener),this.resizePointerUpListener=null),this.resizePointerMoveListener&&(Dt(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(e){e=this.workspace.moveDrag(e),this.setSize(new Vt(this.workspace.RTL?-e.x:e.x,e.y),!1),this.onSizeChange()}onStartEdit(){this.bringToFront()&&this.textArea.focus()}onTextChange(){this.text=this.textArea.value;for(const e of this.textChangeListeners)e()}onSizeChange(){for(const e of this.sizeChangeListeners)e()}};cs(` +.blocklyCommentTextarea { + background-color: #fef49c; + border: 0; + display: block; + margin: 0; + outline: 0; + padding: 3px; + resize: none; + text-overflow: hidden; +} +`);var s$=17,ET=160,bT=80,Ao=class extends Ka{constructor(e){super(e),this.sourceBlock=e,this.textBubble=this.textInputBubble=null,this.text="",this.bubbleSize=new Vt(ET,bT),this.bubbleVisiblity=!1}getType(){return Ao.TYPE}initView(e){this.svgRoot||(super.initView(e),w(te.CIRCLE,{class:"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),w(te.PATH,{class:"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"},this.svgRoot),w(te.RECT,{class:"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot))}dispose(){super.dispose();let e;(e=this.textInputBubble)==null||e.dispose();let t;(t=this.textBubble)==null||t.dispose()}getWeight(){return Ao.WEIGHT}getSize(){return new Vt(s$,s$)}applyColour(){super.applyColour();const e=this.sourceBlock.style.colourPrimary;let t;(t=this.textInputBubble)==null||t.setColour(e);let i;(i=this.textBubble)==null||i.setColour(e)}updateEditable(){super.updateEditable(),this.bubbleIsVisible()&&(this.setBubbleVisible(!1),this.setBubbleVisible(!0))}onLocationChange(e){super.onLocationChange(e),e=this.getAnchorLocation();let t;(t=this.textInputBubble)==null||t.setAnchorLocation(e);let i;(i=this.textBubble)==null||i.setAnchorLocation(e)}setText(e){this.text=e;let t;(t=this.textInputBubble)==null||t.setText(this.text);let i;(i=this.textBubble)==null||i.setText(this.text)}getText(){return this.text}setBubbleSize(e){this.bubbleSize=e;let t;(t=this.textInputBubble)==null||t.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}saveState(){return this.text?{text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width}:null}loadState(e){let t;this.text=(t=e.text)!=null?t:"";let i,r;this.bubbleSize=new Vt((i=e.width)!=null?i:ET,(r=e.height)!=null?r:bT);let c;this.bubbleVisiblity=(c=e.pinned)!=null?c:!1,setTimeout(()=>this.setBubbleVisible(this.bubbleVisiblity),1)}onClick(){super.onClick(),this.setBubbleVisible(!this.bubbleIsVisible())}onTextChange(){this.textInputBubble&&(this.text=this.textInputBubble.getText())}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(e){(!e||!this.textBubble&&!this.textInputBubble)&&(e||this.textBubble||this.textInputBubble)&&(this.bubbleVisiblity=e,this.sourceBlock.rendered&&!this.sourceBlock.isInFlyout&&(e?(this.sourceBlock.isEditable()?this.showEditableBubble():this.showNonEditableBubble(),this.applyColour()):this.hideBubble(),re(new(we(Fs))(this.sourceBlock,e,"comment"))))}showEditableBubble(){this.textInputBubble=new TT(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect()),this.textInputBubble.setText(this.getText()),this.textInputBubble.setSize(this.bubbleSize,!0),this.textInputBubble.addTextChangeListener(()=>this.onTextChange()),this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.textBubble=new o$(this.getText(),this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect())}hideBubble(){let e;(e=this.textInputBubble)==null||e.dispose(),this.textInputBubble=null;let t;(t=this.textBubble)==null||t.dispose(),this.textBubble=null}getAnchorLocation(){const e=s$/2;return Ue.sum(this.workspaceLocation,new Ue(e,e))}getBubbleOwnerRect(){const e=this.sourceBlock.getSvgRoot().getBBox();return new Bt(e.y,e.y+e.height,e.x,e.x+e.width)}};Ao.TYPE=Uo.COMMENT,Ao.WEIGHT=3,bh(Ao.TYPE,Ao);var wn=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.class=null,this.EDITABLE=!1,this.maxDisplayLength=1/0,e!==bt.SKIP_SETUP&&(i?this.configure_(i):this.class=t||null,this.setValue(e))}configure_(e){super.configure_(e),e.class&&(this.class=e.class)}initView(){this.createTextElement_(),this.class&&I(this.getTextElement(),this.class)}doClassValidation_(e){return e==null?null:`${e}`}setClass(e){this.textElement_&&(this.class&&A(this.textElement_,this.class),e&&I(this.textElement_,e)),this.class=e}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_label",wn),wn.prototype.DEFAULT_VALUE="";var mi=class{constructor(e,t){this.name=e,this.sourceBlock=t,this.fieldRow=[],this.align=s.Align$$module$build$src$core$inputs$input.LEFT,this.visible=!0,this.type=s.inputTypes$$module$build$src$core$inputs$input_types.CUSTOM,this.connection=null}getSourceBlock(){return this.sourceBlock}appendField(e,t){return this.insertFieldAt(this.fieldRow.length,e,t),this}insertFieldAt(e,t,i){if(0>e||e>this.fieldRow.length)throw Error("index "+e+" out of bounds.");return(t||t===""&&i)&&(typeof t=="string"&&(t=s.fromJson$$module$build$src$core$field_registry({type:"field_label",text:t})),t.setSourceBlock(this.sourceBlock),this.sourceBlock.rendered&&(t.init(),t.applyColour()),t.name=i,t.setVisible(this.isVisible()),t.prefixField&&(e=this.insertFieldAt(e,t.prefixField)),this.fieldRow.splice(e,0,t),e++,t.suffixField&&(e=this.insertFieldAt(e,t.suffixField)),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours())),e}removeField(e,t){for(let i=0,r;r=this.fieldRow[i];i++)if(r.name===e)return r.dispose(),this.fieldRow.splice(i,1),this.sourceBlock.rendered&&(this.sourceBlock.queueRender(),this.sourceBlock.bumpNeighbours()),!0;if(t)return!1;throw Error('Field "'+e+'" not found.')}isVisible(){return this.visible}setVisible(e){let t=[];if(this.visible===e)return t;this.visible=e;for(let r=0,c;c=this.fieldRow[r];r++)c.setVisible(e);if(this.connection){var i=this.connection;e?t=i.startTrackingAll():i.stopTrackingAll(),(i=i.targetBlock())&&(i.getSvgRoot().style.display=e?"block":"none")}return t}markDirty(){for(let e=0,t;t=this.fieldRow[e];e++)t.markDirty()}setCheck(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setCheck(e),this}setAlign(e){return this.align=e,this.sourceBlock.rendered&&this.sourceBlock.queueRender(),this}setShadowDom(e){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.setShadowDom(e),this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection.");return this.connection.getShadowDom()}init(){if(this.sourceBlock.workspace.rendered)for(let e=0;ee.disposeInternal()),this.inputList.forEach(e=>e.dispose()),this.inputList.length=0,this.getConnections_(!0).forEach(e=>e.dispose()),this.disposed=!0)}isDeadOrDying(){return this.disposing||this.disposed}initModel(){for(const e of this.inputList)for(const t of e.fieldRow)t.initModel&&t.initModel()}unplug(e){this.outputConnection&&this.unplugFromRow_(e),this.previousConnection&&this.unplugFromStack_(e)}unplugFromRow_(e){let t=null,i;(i=this.outputConnection)!=null&&i.isConnected()&&(t=this.outputConnection.targetConnection,this.outputConnection.disconnect()),t&&e&&(e=this.getOnlyValueConnection_())&&e.isConnected()&&!e.targetBlock().isShadow()&&(e=e.targetConnection,e==null||e.disconnect(),this.workspace.connectionChecker.canConnect(e,t,!1)?t.connect(e):e==null||e.onFailedConnect(t))}getOnlyValueConnection_(){let e=null;for(let t=0;t(r=r+(i==="("||c===")"?"":" ")+c,i=c[c.length-1],r),""),t=t.trim()||"???",e&&t.length>e&&(t=t.substring(0,e-3)+"..."),t}toTokens(e="?"){const t=[];for(const r of this.inputList)if(r.name!=Nr){for(const c of r.fieldRow)t.push(c.getText());if(r.connection){const c=r.connection.targetBlock();if(c){var i=r.connection;let $=i.getCheck();!$&&i.targetConnection&&($=i.targetConnection.getCheck()),(i=!!$&&($.indexOf("Boolean")!==-1||$.indexOf("Number")!==-1))&&t.push("("),t.push(...c.toTokens(e)),i&&t.push(")")}else t.push(e)}}return t}appendValueInput(e){return this.appendInput(new s.ValueInput$$module$build$src$core$inputs$value_input(e,this))}appendStatementInput(e){return this.statementInputCount++,this.appendInput(new Zo(e,this))}appendDummyInput(e=""){return this.appendInput(new zs(e,this))}appendInput(e){return this.inputList.push(e),e}appendInputFromRegistry(e,t){return(e=p(Ae.INPUT,e,!1))?this.appendInput(new e(t,this)):null}jsonInit(e){var t=e.type?'Block "'+e.type+'": ':"";if(e.output&&e.previousStatement)throw Error(t+"Must not have both an output and a previousStatement.");if(e.style&&e.style.hat&&(this.hat=e.style.hat,e.style=null),e.style&&e.colour)throw Error(t+"Must not have both a colour and a style.");e.style?this.jsonInitStyle_(e,t):this.jsonInitColour_(e,t);for(var i=0;e["message"+i]!==void 0;)this.interpolate_(e["message"+i],e["args"+i]||[],e["lastDummyAlign"+i],t),i++;if(e.inputsInline!==void 0&&this.setInputsInline(e.inputsInline),e.output!==void 0&&this.setOutput(!0,e.output),e.outputShape!==void 0&&this.setOutputShape(e.outputShape),e.previousStatement!==void 0&&this.setPreviousStatement(!0,e.previousStatement),e.nextStatement!==void 0&&this.setNextStatement(!0,e.nextStatement),e.tooltip!==void 0&&(i=Zt(e.tooltip),this.setTooltip(i)),e.enableContextMenu!==void 0&&(this.contextMenu=!!e.enableContextMenu),e.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!e.suppressPrefixSuffix),e.helpUrl!==void 0&&(i=Zt(e.helpUrl),this.setHelpUrl(i)),typeof e.extensions=="string"&&(console.warn(t+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+e.type+"' block."),e.extensions=[e.extensions]),e.mutator!==void 0&&ca(e.mutator,this,!0),e=e.extensions,Array.isArray(e))for(t=0;t$||$>t)throw Error('Block "'+this.type+'": Message index %'+$+" out of range.");if(i[$])throw Error('Block "'+this.type+'": Message index %'+$+" duplicated.");i[$]=!0,r++}}if(r!==t)throw Error('Block "'+this.type+'": Message does not reference all '+t+" arg(s).")}interpolateArguments_(e,t,i){const r=[];for(let c=0;c=this.inputList.length)throw RangeError("Input index "+e+" out of bounds.");if(t>this.inputList.length)throw RangeError("Reference input "+t+" out of bounds.");const i=this.inputList[e];this.inputList.splice(e,1),et.getWeight()-i.getWeight()),e}removeIcon(e){if(!this.hasIcon(e))return!1;let t;return(t=this.getIcon(e))==null||t.dispose(),this.icons=this.icons.filter(i=>!i.getType().equals(e)),!0}hasIcon(e){return this.icons.some(t=>t.getType().equals(e))}getIcon(e){return e instanceof Uo?this.icons.find(t=>t.getType().equals(e)):this.icons.find(t=>t.getType().toString()===e)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy_}moveBy(e,t,i){if(this.parentBlock_)throw Error("Block has parent");const r=new(we(s.MOVE$$module$build$src$core$events$utils))(this);i&&r.setReason(i),this.xy_.translate(e,t),r.recordNew(),re(r)}makeConnection_(e){return new St(this,e)}allInputsFilled(e){if(e===void 0&&(e=!0),!e&&this.isShadow())return!1;for(let i=0,r;r=this.inputList[i];i++)if(r.connection){var t=r.connection.targetBlock();if(!t||!t.allInputsFilled(e))return!1}return(t=this.getNextBlock())?t.allInputsFilled(e):!0}toDevString(){let e=this.type?'"'+this.type+'" block':"Block";return this.id&&(e+=' (id="'+this.id+'")'),e}};Hr.COLLAPSED_INPUT_NAME=Nr,Hr.COLLAPSED_FIELD_NAME=Ga;var Za=null,ql=null,Jl={};Jl.connectionUiEffect=Oh,Jl.disconnectUiEffect=Ch,Jl.disconnectUiStop=gr,Jl.disposeUiEffect=vh;var n$=class extends Vs{constructor(e,t,i){super(e?e.workspace.id:void 0),this.type=Tn,e&&(this.blockId=e.id,this.isStart=t,this.blocks=i)}toJson(){const e=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");return e.isStart=this.isStart,e.blockId=this.blockId,e.blocks=this.blocks,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new n$),t.isStart=e.isStart,t.blockId=e.blockId,t.blocks=e.blocks,t}};l(Ae.EVENT,Tn,n$);var eu={};eu.bumpIntoBounds=fr,eu.bumpIntoBoundsHandler=Sh,eu.bumpTopObjectsIntoBounds=ha;var Ti=class{constructor(e){this.name_=e}toString(){return this.name_}};Ti.POSITIONABLE=new Ti("positionable"),Ti.DRAG_TARGET=new Ti("drag_target"),Ti.DELETE_AREA=new Ti("delete_area"),Ti.AUTOHIDEABLE=new Ti("autohideable");var fo=class{constructor(){this.componentData=new Map,this.capabilityToComponentIds=new Map}addComponent(e,t){const i=e.component.id;if(!t&&this.componentData.has(i)){var r;throw Error('Plugin "'+i+'" with capabilities "'+((r=this.componentData.get(i))==null?void 0:r.capabilities)+'" already added.')}for(this.componentData.set(i,e),t=[],r=0;r{r.push(this.componentData.get(c))}),r.sort(function(c,$){return c.weight-$.weight}),r.forEach(function(c){i.push(c.component)})}else e.forEach(r=>{i.push(this.componentData.get(r).component)});return i}};fo.Capability=Ti;var r$,IT;r$=28,s.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:r$,connectingSnapRadius:r$,currentConnectionPreference:8,bumpDelay:250},IT={},IT.config=s.config$$module$build$src$core$config;var OT="The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined.",es=class{constructor(e){this.activeCandidate=this.lastMarker=this.lastOnStack=null,this.wouldDeleteBlock=!1,this.fadedBlock=this.highlightedBlock=this.markerConnection=null,Y(e),this.topBlock=e,this.workspace=e.workspace,this.firstMarker=this.createMarkerBlock(this.topBlock),this.availableConnections=this.initAvailableConnections(),this.lastOnStack&&(this.lastMarker=this.createMarkerBlock(this.lastOnStack.getSourceBlock()))}dispose(){this.availableConnections.length=0,this.disposeInsertionMarker(this.firstMarker),this.disposeInsertionMarker(this.lastMarker)}updateAvailableConnections(){this.availableConnections=this.initAvailableConnections()}wouldConnectBlock(){return!!this.activeCandidate}applyConnections(){if(this.activeCandidate){s.disable$$module$build$src$core$events$utils(),this.hidePreview(),s.enable$$module$build$src$core$events$utils();var{local:e,closest:t}=this.activeCandidate;if(e.connect(t),this.topBlock.rendered){const i=e.isSuperior()?t:e,r=this.topBlock.getRootBlock();cr().then(()=>{Oh(i.getSourceBlock()),setTimeout(()=>{r.bringToFront()},0)})}}}update(e,t){const i=this.getCandidate(e);((this.wouldDeleteBlock=this.shouldDelete(!!i,t))||this.shouldUpdatePreviews(i,e))&&(s.disable$$module$build$src$core$events$utils(),this.maybeHidePreview(i),this.maybeShowPreview(i),s.enable$$module$build$src$core$events$utils())}createMarkerBlock(e){var t=e.type;s.disable$$module$build$src$core$events$utils();let i;try{if(i=this.workspace.newBlock(t),i.setInsertionMarker(!0),e.saveExtraState){var r=e.saveExtraState();r&&i.loadExtraState&&i.loadExtraState(r)}else if(e.mutationToDom){const c=e.mutationToDom();c&&i.domToMutation&&i.domToMutation(c)}for(t=0;t{let $;($=r)==null||$.getSvgRoot().setAttribute("visibility","visible")}),this.markerConnection=c}hideInsertionMarker(){if(this.markerConnection){var e=this.markerConnection,t=e.getSourceBlock(),i=t.outputConnection,r;if((r=t.previousConnection)!=null&&r.targetConnection||i!=null&&i.targetConnection)t.unplug(!0);else{let c;(c=e.targetBlock())==null||c.unplug(!1)}if(e.targetConnection)throw Error("markerConnection still connected at the end of disconnectInsertionMarker");this.markerConnection=null,(e=t.getSvgRoot())&&e.setAttribute("visibility","hidden")}}showInsertionInputOutline(e){e=e.closest,this.highlightedBlock=e.getSourceBlock(),this.highlightedBlock.highlightShapeForInput(e,!0)}hideInsertionInputOutline(){if(this.highlightedBlock){if(!this.activeCandidate)throw Error("Cannot hide the insertion marker outline because there is no active candidate");this.highlightedBlock.highlightShapeForInput(this.activeCandidate.closest,!1),this.highlightedBlock=null}}showReplacementFade(e){if(this.fadedBlock=e.closest.targetBlock(),!this.fadedBlock)throw Error("Cannot show the replacement fade because the closest connection does not have a target block");this.fadedBlock.fadeForReplacement(!0)}hideReplacementFade(){this.fadedBlock&&(this.fadedBlock.fadeForReplacement(!1),this.fadedBlock=null)}getInsertionMarkers(){const e=[];return this.firstMarker&&e.push(this.firstMarker),this.lastMarker&&e.push(this.lastMarker),e}disposeInsertionMarker(e){if(e){s.disable$$module$build$src$core$events$utils();try{e.dispose()}finally{s.enable$$module$build$src$core$events$utils()}}}};(function(e){e=e.PREVIEW_TYPE||(e.PREVIEW_TYPE={}),e[e.INSERTION_MARKER=0]="INSERTION_MARKER",e[e.INPUT_OUTLINE=1]="INPUT_OUTLINE",e[e.REPLACEMENT_FADE=2]="REPLACEMENT_FADE"})(es||(es={})),es.PREVIEW_TYPE;var CT=class{constructor(e,t){this.dragTarget_=null,this.wouldDeleteBlock_=!1,this.draggingBlock_=e,this.draggedConnectionManager_=new es(this.draggingBlock_),this.workspace_=t,this.startXY_=this.draggingBlock_.getRelativeToSurfaceXY(),this.dragIconData_=Rh(e,this.startXY_)}dispose(){this.dragIconData_.length=0,this.draggedConnectionManager_&&this.draggedConnectionManager_.dispose()}startDrag(e,t){s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.fireDragStartEvent_(),this.workspace_.isMutator&&this.draggingBlock_.bringToFront(),Ce(),this.workspace_.setResizesEnabled(!1),gr(),this.shouldDisconnect_(t)&&this.disconnectBlock_(t,e),this.draggingBlock_.setDragging(!0)}shouldDisconnect_(e){return!!(this.draggingBlock_.getParent()||e&&this.draggingBlock_.nextConnection&&this.draggingBlock_.nextConnection.targetBlock())}disconnectBlock_(e,t){this.draggingBlock_.unplug(e),e=this.pixelsToWorkspaceUnits_(t),e=Ue.sum(this.startXY_,e),this.draggingBlock_.translate(e.x,e.y),Ch(this.draggingBlock_),this.draggedConnectionManager_.updateAvailableConnections()}fireDragStartEvent_(){const e=new(we(Tn))(this.draggingBlock_,!0,this.draggingBlock_.getDescendants(!1));re(e)}drag(e,t){t=this.pixelsToWorkspaceUnits_(t);var i=Ue.sum(this.startXY_,t);this.draggingBlock_.moveDuringDrag(i),this.dragIcons_(t),i=this.dragTarget_,this.dragTarget_=this.workspace_.getDragTarget(e),this.draggedConnectionManager_.update(t,this.dragTarget_),e=this.wouldDeleteBlock_,this.wouldDeleteBlock_=this.draggedConnectionManager_.wouldDeleteBlock,e!==this.wouldDeleteBlock_&&this.updateCursorDuringBlockDrag_(),this.dragTarget_!==i&&(i&&i.onDragExit(this.draggingBlock_),this.dragTarget_&&this.dragTarget_.onDragEnter(this.draggingBlock_)),this.dragTarget_&&this.dragTarget_.onDragOver(this.draggingBlock_)}endDrag(e,t){this.drag(e,t),this.dragIconData_=[],this.fireDragEndEvent_(),ce(),gr(),e=null,this.dragTarget_&&this.dragTarget_.shouldPreventMove(this.draggingBlock_)||(e=this.getNewLocationAfterDrag_(t).delta),this.dragTarget_&&this.dragTarget_.onDrop(this.draggingBlock_),this.maybeDeleteBlock_()||(this.draggingBlock_.setDragging(!1),e?this.updateBlockAfterMove_():fr(this.draggingBlock_.workspace,this.workspace_.getMetricsManager().getScrollMetrics(!0),this.draggingBlock_)),this.workspace_.setResizesEnabled(!0),s.setGroup$$module$build$src$core$events$utils(!1)}getNewLocationAfterDrag_(e){e=this.pixelsToWorkspaceUnits_(e);const t=Ue.sum(this.startXY_,e);return{delta:e,newLocation:t}}maybeDeleteBlock_(){return this.wouldDeleteBlock_?(this.fireMoveEvent_(),this.draggingBlock_.dispose(!1,!0),Tr.length=0,!0):!1}updateBlockAfterMove_(){this.fireMoveEvent_(),this.draggedConnectionManager_.wouldConnectBlock()?this.draggedConnectionManager_.applyConnections():this.draggingBlock_.queueRender(),this.draggingBlock_.scheduleSnapAndBump()}fireDragEndEvent_(){const e=new(we(Tn))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));re(e)}updateToolboxStyle_(e){const t=this.workspace_.getToolbox();if(t){const i=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";e&&typeof t.removeStyle=="function"?t.removeStyle(i):e||typeof t.addStyle!="function"||t.addStyle(i)}}fireMoveEvent_(){if(!this.draggingBlock_.isDeadOrDying()){var e=new(we(s.MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);e.setReason(["drag"]),e.oldCoordinate=this.startXY_,e.recordNew(),re(e)}}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(e){return e=new Ue(e.x/this.workspace_.scale,e.y/this.workspace_.scale),this.workspace_.isMutator&&e.scale(1/this.workspace_.options.parentWorkspace.scale),e}dragIcons_(e){for(const t of this.dragIconData_)t.icon.onLocationChange(Ue.sum(t.location,e))}getInsertionMarkers(){return this.draggedConnectionManager_&&this.draggedConnectionManager_.getInsertionMarkers?this.draggedConnectionManager_.getInsertionMarkers():[]}};l(Ae.BLOCK_DRAGGER,li,CT);var Ei=null,l$={duplicateInternal:Zf,copyInternal:Jf},Zl={};Zl.TEST_ONLY=l$,Zl.copy=Nl,Zl.duplicate=pa,Zl.paste=kh;var tu=null,yT={},ou=null,Xs={};Xs.callbackFactory=s.callbackFactory$$module$build$src$core$contextmenu,Xs.commentDeleteOption=Nh,Xs.commentDuplicateOption=wh,Xs.dispose=Lh,Xs.getCurrentBlock=em,Xs.hide=Ml,Xs.setCurrentBlock=Ah,Xs.show=wl,Xs.workspaceCommentOption=nm;var kt=class{constructor(){this.registry_=new Map,this.reset()}reset(){this.registry_.clear()}register(e){if(this.registry_.has(e.id))throw Error('Menu item with ID "'+e.id+'" is already registered.');this.registry_.set(e.id,e)}unregister(e){if(!this.registry_.has(e))throw Error('Menu item with ID "'+e+'" not found.');this.registry_.delete(e)}getItem(e){let t;return(t=this.registry_.get(e))!=null?t:null}getContextMenuOptions(e,t){const i=[];for(const c of this.registry_.values())if(e===c.scopeType){var r=c.preconditionFn(t);r!=="hidden"&&(r={text:typeof c.displayText=="function"?c.displayText(t):c.displayText,enabled:r==="enabled",callback:c.callback,scope:t,weight:c.weight},i.push(r))}return i.sort(function(c,$){return c.weight-$.weight}),i}};(function(e){var t=e.ScopeType||(e.ScopeType={});t.BLOCK="block",t.WORKSPACE="workspace",e.registry=new e})(kt||(kt={})),kt.ScopeType;var ST=30,RT=!0,Mn=[];Mn[qe.INPUT_VALUE]=qe.OUTPUT_VALUE,Mn[qe.OUTPUT_VALUE]=qe.INPUT_VALUE,Mn[qe.NEXT_STATEMENT]=qe.PREVIOUS_STATEMENT,Mn[qe.PREVIOUS_STATEMENT]=qe.NEXT_STATEMENT;var c$="RENAME_VARIABLE_ID",a$="DELETE_VARIABLE_ID",Re=class{constructor(e,t,i){if(this.wsCoordinate=null,!t)throw Error("Cannot create a node without a location.");this.type=e,this.isConnectionLocation=Re.isConnectionType(e),this.location=t,this.processParams(i||null)}processParams(e){e&&e.wsCoordinate&&(this.wsCoordinate=e.wsCoordinate)}getLocation(){return this.location}getType(){return this.type}getWsCoordinate(){return this.wsCoordinate}isConnection(){return this.isConnectionLocation}findNextForInput(){var e=this.location.getParentInput();const t=e.getSourceBlock();for(e=t.inputList.indexOf(e),e+=1;eclearTimeout(e)),this.warningTextDb.clear(),this.getIcons().forEach(e=>e.dispose()))}checkAndDelete(){this.workspace.isFlyout||(s.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),s.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{saveInfo:xs(this,{addCoordinates:!0,addNextBlocks:!1}),source:this.workspace,typeCounts:F(this,!0)}}applyColour(){this.pathObject.applyColour(this);const e=this.getIcons();for(let t=0;t{this.isDeadOrDying()||(this.warningTextDb.delete(i),this.setWarningText(e,i))},100));else if(this.isInFlyout&&(e=null),t=this.getIcon(vs.TYPE),typeof e=="string"){r=this.getSurroundParent();let c=null;for(;r;)r.isCollapsed()&&(c=r),r=r.getSurroundParent();c&&c.setWarningText(s.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,ts.COLLAPSED_WARNING_ID),t?t.addMessage(e,i):this.addIcon(new vs(this).addMessage(e,i))}else t&&(i?t.getText()||this.removeIcon(vs.TYPE):this.removeIcon(vs.TYPE))}setMutator(e){this.removeIcon(s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE),e&&this.addIcon(e)}addIcon(e){return super.addIcon(e),e instanceof vs&&(this.warning=e),e instanceof s.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=e),this.rendered&&(e.initView(this.createIconPointerDownListener(e)),e.applyColour(),e.updateEditable(),this.queueRender(),Ds(),this.bumpNeighbours()),e}createIconPointerDownListener(e){return t=>{this.isDeadOrDying()||(t=this.workspace.getGesture(t))&&t.setStartIcon(e)}}removeIcon(e){const t=super.removeIcon(e);return e.equals(vs.TYPE)&&(this.warning=null),e.equals(s.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null),this.rendered&&(this.queueRender(),Ds(),this.bumpNeighbours()),t}setEnabled(e){this.isEnabled()!==e&&(super.setEnabled(e),this.rendered&&!this.getInheritedDisabled()&&this.updateDisabled())}setHighlighted(e){this.rendered&&this.pathObject.updateHighlighted(e)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(e){this.pathObject.updateDraggingDelete(e)}getColour(){return this.style.colourPrimary}setColour(e){super.setColour(e),e=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_),this.pathObject.setStyle(e.style),this.style=e.style,this.styleName_=e.name,this.applyColour()}setStyle(e){const t=this.workspace.getRenderer().getConstants().getBlockStyle(e);if(this.styleName_=e,t)this.hat=t.hat,this.pathObject.setStyle(t),this.colour_=t.colourPrimary,this.style=t,this.applyColour();else throw Error("Invalid style name: "+e)}bringToFront(){let e=this;do{const t=e.getSvgRoot(),i=t.parentNode,r=i.childNodes;r[r.length-1]!==t&&i.appendChild(t),e=e.getParent()}while(e)}setPreviousStatement(e,t){super.setPreviousStatement(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setNextStatement(e,t){super.setNextStatement(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setOutput(e,t){super.setOutput(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}setInputsInline(e){super.setInputsInline(e),this.rendered&&(this.queueRender(),this.bumpNeighbours())}removeInput(e,t){return e=super.removeInput(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours()),e}moveNumberedInputBefore(e,t){super.moveNumberedInputBefore(e,t),this.rendered&&(this.queueRender(),this.bumpNeighbours())}appendInput(e){return super.appendInput(e),this.rendered&&(this.queueRender(),this.bumpNeighbours()),e}setConnectionTracking(e){if(this.previousConnection&&this.previousConnection.setTracking(e),this.outputConnection&&this.outputConnection.setTracking(e),this.nextConnection){this.nextConnection.setTracking(e);var t=this.nextConnection.targetBlock();t&&t.setConnectionTracking(e)}if(!this.collapsed_)for(t=0;t{const t=s.getGroup$$module$build$src$core$events$utils();s.setGroup$$module$build$src$core$events$utils(e),this.getRootBlock().bumpNeighboursInternal(),s.setGroup$$module$build$src$core$events$utils(t),this.bumpNeighboursPid=0},s.config$$module$build$src$core$config.bumpDelay)}}bumpNeighboursInternal(){const e=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||e.isInFlyout))for(const t of this.getConnections_(!1)){if(t.isSuperior()){let i;(i=t.targetBlock())==null||i.bumpNeighboursInternal()}for(const i of t.neighbours(s.config$$module$build$src$core$config.snapRadius))i.getSourceBlock().getRootBlock()!==e&&(t.isConnected()&&i.isConnected()||(t.isSuperior()?i.bumpAwayFrom(t):t.bumpAwayFrom(i)))}}scheduleSnapAndBump(){const e=s.getGroup$$module$build$src$core$events$utils();setTimeout(()=>{s.setGroup$$module$build$src$core$events$utils(e),this.snapToGrid(),s.setGroup$$module$build$src$core$events$utils(!1)},s.config$$module$build$src$core$config.bumpDelay/2),this.bumpNeighbours()}positionNearConnection(e,t){e.type!==qe.NEXT_STATEMENT&&e.type!==qe.INPUT_VALUE||this.moveBy(t.x-e.x,t.y-e.y)}getChildren(e){return super.getChildren(e)}queueRender(){return Id(this)}render(){this.queueRender(),Ds()}renderEfficiently(){this.rendered=!0,Ce(),this.isCollapsed()&&this.updateCollapsed_(),this.workspace.getRenderer().render(this),this.tightenChildrenEfficiently(),ce(),this.updateMarkers_()}tightenChildrenEfficiently(){for(const e of this.inputList){const t=e.connection;t&&t.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}updateMarkers_(){this.workspace.keyboardAccessibilityMode&&this.pathObject.cursorSvg&&this.workspace.getCursor().draw(),this.workspace.keyboardAccessibilityMode&&this.pathObject.markerSvg&&this.workspace.getMarker(zl.LOCAL_MARKER).draw();for(const e of this.inputList)for(const t of e.fieldRow)t.updateMarkers_()}updateConnectionAndIconLocations(){const e=this.getRelativeToSurfaceXY();this.previousConnection&&this.previousConnection.moveToOffset(e),this.outputConnection&&this.outputConnection.moveToOffset(e);for(let t=0;ti||t.getSourceBlock().isInsertionMarker())return!1;switch(t.type){case qe.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(e,t);case qe.OUTPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isInsertionMarker()||e.isConnected())return!1;break;case qe.INPUT_VALUE:if(t.isConnected()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;case qe.NEXT_STATEMENT:if(t.isConnected()&&!e.getSourceBlock().nextConnection&&!t.targetBlock().isShadow()&&t.targetBlock().nextConnection||t.targetBlock()&&!t.targetBlock().isMovable()&&!t.targetBlock().isShadow())return!1;break;default:return!1}return Tr.indexOf(t)===-1}canConnectToPrevious_(e,t){return e.targetConnection||Tr.indexOf(t)!==-1?!1:t.targetConnection?(e=t.targetBlock(),e.isInsertionMarker()?!e.getPreviousBlock():!1):!0}};l(Ae.CONNECTION_CHECKER,li,NT);var Vr=class{constructor(e){this.connectionChecker=e,this.connections=[]}addConnection(e,t){t=this.calculateIndexForYPos(t),this.connections.splice(t,0,e)}findIndexOfConnection(e,t){if(!this.connections.length)return-1;const i=this.calculateIndexForYPos(t);if(i>=this.connections.length)return-1;t=e.y;let r=i;for(;0<=r&&this.connections[r].y===t;){if(this.connections[r]===e)return r;r--}for(r=i;re)i=r;else{t=r;break}}return t}removeConnection(e,t){if(e=this.findIndexOfConnection(e,t),e===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(e,1)}getNeighbours(e,t){function i(Qe){const qt=c-r[Qe].x,Ft=$-r[Qe].y;return Math.sqrt(qt*qt+Ft*Ft)<=t&&Oe.push(r[Qe]),Ft"u"?"":t,this.newContents_=typeof i>"u"?"":i)}toJson(){const e=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");return e.oldContents=this.oldContents_,e.newContents=this.newContents_,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new T$),t.oldContents_=e.oldContents,t.newContents_=e.newContents,t}isNull(){return this.oldContents_===this.newContents_}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){var i=e?this.newContents_:this.oldContents_;if(!i)throw Error(e?"The new contents is undefined. Either pass a value to the constructor, or call fromJson":"The old contents is undefined. Either pass a value to the constructor, or call fromJson");t.setContent(i)}else console.warn("Can't change non-existent comment: "+this.commentId)}};l(Ae.EVENT,yr,T$);var E$=class extends Xi{constructor(e){super(e),this.type=Hi,e&&(this.xml=e.toXmlWithXY())}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return e.xml=Ps(this.xml),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new E$),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t}run(e){Xi.CommentCreateDeleteHelper(this,e)}};l(Ae.EVENT,Hi,E$);var b$=class extends Xi{constructor(e){super(e),this.type=En,e&&(this.xml=e.toXmlWithXY())}run(e){Xi.CommentCreateDeleteHelper(this,!e)}toJson(){const e=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");return e.xml=Ps(this.xml),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new b$),t.xml=s.textToDom$$module$build$src$core$utils$xml(e.xml),t}};l(Ae.EVENT,En,b$);var v$=class extends Xi{constructor(e){super(e),this.type=Us,e&&(this.comment_=e,this.oldCoordinate_=e.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setOldCoordinate(e){this.oldCoordinate_=e}toJson(){const e=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");return e.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`,e.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y),e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new v$),i=e.oldCoordinate.split(","),t.oldCoordinate_=new Ue(Number(i[0]),Number(i[1])),i=e.newCoordinate.split(","),t.newCoordinate_=new Ue(Number(i[0]),Number(i[1])),t}isNull(){return Ue.equals(this.oldCoordinate_,this.newCoordinate_)}run(e){var t=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(t=t.getCommentById(this.commentId)){if(e=e?this.newCoordinate_:this.oldCoordinate_,!e)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");var i=t.getRelativeToSurfaceXY();t.moveBy(e.x-i.x,e.y-i.y)}else console.warn("Can't move non-existent comment: "+this.commentId)}};l(Ae.EVENT,Us,v$);var I$=class extends Vs{constructor(e,t,i,r){let c=e?e.workspace.id:void 0;r&&r.getType()===Re.types.WORKSPACE&&(c=r.getLocation().id),super(c),this.type=vr,this.blockId=e==null?void 0:e.id,this.oldNode=i||void 0,this.newNode=r,this.isCursor=t}toJson(){const e=super.toJson();if(this.isCursor===void 0)throw Error("Whether this is a cursor event or not is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newNode)throw Error("The new node is undefined. Either pass a node to the constructor, or call fromJson");return e.isCursor=this.isCursor,e.blockId=this.blockId,e.oldNode=this.oldNode,e.newNode=this.newNode,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new I$),t.isCursor=e.isCursor,t.blockId=e.blockId,t.oldNode=e.oldNode,t.newNode=e.newNode,t}};l(Ae.EVENT,vr,I$);var O$=class extends Vs{constructor(e,t){super(t),this.type=Cr,this.themeName=e}toJson(){const e=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");return e.themeName=this.themeName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new O$),t.themeName=e.themeName,t}};l(Ae.EVENT,Cr,O$);var C$=class extends Vs{constructor(e,t,i){super(i),this.type=Or,this.oldItem=e??void 0,this.newItem=t??void 0}toJson(){const e=super.toJson();return e.oldItem=this.oldItem,e.newItem=this.newItem,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new C$),t.oldItem=e.oldItem,t.newItem=e.newItem,t}};l(Ae.EVENT,Or,C$);var y$=class extends Vs{constructor(e,t){super(t),this.type=Ir,this.isOpen=e}toJson(){const e=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");return e.isOpen=this.isOpen,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new y$),t.isOpen=e.isOpen,t}};l(Ae.EVENT,Ir,y$);var S$=class extends Ul{constructor(e){super(e),this.type=mn,e&&(this.varType=e.type,this.varName=e.name)}toJson(){const e=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");return e.varType=this.varType,e.varName=this.varName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new S$),t.varType=e.varType,t.varName=e.varName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");e?t.deleteVariableById(this.varId):t.createVariable(this.varName,this.varType,this.varId)}};l(Ae.EVENT,mn,S$);var R$=class extends Ul{constructor(e,t){super(e),this.type=br,e&&(this.oldName=e.name,this.newName=typeof t>"u"?"":t)}toJson(){const e=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");return e.oldName=this.oldName,e.newName=this.newName,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new R$),t.oldName=e.oldName,t.newName=e.newName,t}run(e){const t=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson");e?t.renameVariableById(this.varId,this.newName):t.renameVariableById(this.varId,this.oldName)}};l(Ae.EVENT,br,R$);var k$=class extends Vs{constructor(e,t,i,r,c){super(r),this.type=Ui,this.viewTop=e,this.viewLeft=t,this.scale=i,this.oldScale=c}toJson(){const e=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson");if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");return e.viewTop=this.viewTop,e.viewLeft=this.viewLeft,e.scale=this.scale,e.oldScale=this.oldScale,e}static fromJson(e,t,i){return t=super.fromJson(e,t,i??new k$),t.viewTop=e.viewTop,t.viewLeft=e.viewLeft,t.scale=e.scale,t.oldScale=e.oldScale,t}};l(Ae.EVENT,Ui,k$),s.CHANGE$$module$build$src$core$events$utils,s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,s.CHANGE$$module$build$src$core$events$utils,s.CREATE$$module$build$src$core$events$utils,s.DELETE$$module$build$src$core$events$utils,s.MOVE$$module$build$src$core$events$utils,s.disable$$module$build$src$core$events$utils,s.enable$$module$build$src$core$events$utils,s.getGroup$$module$build$src$core$events$utils,s.setGroup$$module$build$src$core$events$utils;var Ye={};Ye.Abstract=Rr,Ye.BLOCK_CHANGE=s.CHANGE$$module$build$src$core$events$utils,Ye.BLOCK_CREATE=s.CREATE$$module$build$src$core$events$utils,Ye.BLOCK_DELETE=s.DELETE$$module$build$src$core$events$utils,Ye.BLOCK_DRAG=Tn,Ye.BLOCK_FIELD_INTERMEDIATE_CHANGE=Bi,Ye.BLOCK_MOVE=s.MOVE$$module$build$src$core$events$utils,Ye.BUBBLE_OPEN=Fs,Ye.BUMP_EVENTS=ya,Ye.BlockBase=yn,Ye.BlockChange=Sn,Ye.BlockCreate=xp,Ye.BlockDelete=Bp,Ye.BlockDrag=n$,Ye.BlockFieldIntermediateChange=p$,Ye.BlockMove=$$,Ye.BubbleOpen=_$,Ye.BubbleType=g$,Ye.CHANGE=s.CHANGE$$module$build$src$core$events$utils,Ye.CLICK=ai,Ye.COMMENT_CHANGE=yr,Ye.COMMENT_CREATE=Hi,Ye.COMMENT_DELETE=En,Ye.COMMENT_MOVE=Us,Ye.CREATE=s.CREATE$$module$build$src$core$events$utils,Ye.Click=f$,Ye.ClickTarget=m$,Ye.CommentBase=Xi,Ye.CommentChange=T$,Ye.CommentCreate=E$,Ye.CommentDelete=b$,Ye.CommentMove=v$,Ye.DELETE=s.DELETE$$module$build$src$core$events$utils,Ye.FINISHED_LOADING=bn,Ye.FinishedLoading=iT,Ye.MARKER_MOVE=vr,Ye.MOVE=s.MOVE$$module$build$src$core$events$utils,Ye.MarkerMove=I$,Ye.SELECTED=ci,Ye.Selected=yp,Ye.THEME_CHANGE=Cr,Ye.TOOLBOX_ITEM_SELECT=Or,Ye.TRASHCAN_OPEN=Ir,Ye.ThemeChange=O$,Ye.ToolboxItemSelect=C$,Ye.TrashcanOpen=y$,Ye.UI=Ca,Ye.UiBase=Vs,Ye.VAR_CREATE=Fi,Ye.VAR_DELETE=mn,Ye.VAR_RENAME=br,Ye.VIEWPORT_CHANGE=Ui,Ye.VarBase=Ul,Ye.VarCreate=Ip,Ye.VarDelete=S$,Ye.VarRename=R$,Ye.ViewportChange=k$,Ye.clearPendingUndo=ae,Ye.disable=s.disable$$module$build$src$core$events$utils,Ye.disableOrphans=We,Ye.enable=s.enable$$module$build$src$core$events$utils,Ye.filter=B,Ye.fire=re,Ye.fromJson=Je,Ye.get=we,Ye.getDescendantIds=Xe,Ye.getGroup=s.getGroup$$module$build$src$core$events$utils,Ye.getRecordUndo=ke,Ye.isEnabled=_e,Ye.setGroup=s.setGroup$$module$build$src$core$events$utils,Ye.setRecordUndo=fe;var oc=class{constructor(){this.NO_PADDING=0,this.SMALL_PADDING=3,this.MEDIUM_PADDING=5,this.MEDIUM_LARGE_PADDING=8,this.LARGE_PADDING=10,this.TAB_HEIGHT=15,this.TAB_OFFSET_FROM_TOP=5,this.TAB_VERTICAL_OVERLAP=2.5,this.TAB_WIDTH=8,this.NOTCH_WIDTH=15,this.NOTCH_HEIGHT=4,this.MIN_BLOCK_WIDTH=12,this.EMPTY_BLOCK_SPACER_HEIGHT=16,this.CORNER_RADIUS=8,this.NOTCH_OFFSET_LEFT=15,this.STATEMENT_BOTTOM_SPACER=0,this.STATEMENT_INPUT_PADDING_LEFT=20,this.BETWEEN_STATEMENT_PADDING_Y=4,this.ADD_START_HATS=!1,this.START_HAT_HEIGHT=15,this.START_HAT_WIDTH=100,this.SPACER_DEFAULT_HEIGHT=15,this.MIN_BLOCK_HEIGHT=24,this.EMPTY_INLINE_INPUT_PADDING=14.5,this.EXTERNAL_VALUE_INPUT_PADDING=2,this.JAGGED_TEETH_HEIGHT=12,this.JAGGED_TEETH_WIDTH=6,this.FIELD_TEXT_FONTSIZE=11,this.FIELD_TEXT_FONTWEIGHT="normal",this.FIELD_TEXT_FONTFAMILY="sans-serif",this.FIELD_TEXT_BASELINE=this.FIELD_TEXT_HEIGHT=-1,this.FIELD_BORDER_RECT_RADIUS=4,this.FIELD_BORDER_RECT_HEIGHT=16,this.FIELD_BORDER_RECT_X_PADDING=5,this.FIELD_BORDER_RECT_Y_PADDING=3,this.FIELD_BORDER_RECT_COLOUR="#fff",this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!1,this.FIELD_DROPDOWN_SVG_ARROW_SIZE=12,this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=!1,this.FIELD_COLOUR_DEFAULT_WIDTH=26,this.defs=null,this.embossFilterId="",this.embossFilter=null,this.disabledPatternId="",this.disabledPattern=null,this.debugFilterId="",this.cssNode=this.debugFilter=null,this.CURSOR_COLOUR="#cc0a0a",this.MARKER_COLOUR="#4286f4",this.CURSOR_WS_WIDTH=100,this.WS_CURSOR_HEIGHT=5,this.CURSOR_STACK_PADDING=10,this.CURSOR_BLOCK_PADDING=2,this.CURSOR_STROKE_WIDTH=4,this.FULL_BLOCK_FIELDS=!1,this.INSERTION_MARKER_COLOUR="#000000",this.INSERTION_MARKER_OPACITY=.2,this.SHAPES={PUZZLE:1,NOTCH:2},this.TALL_INPUT_FIELD_OFFSET_Y=this.MEDIUM_PADDING,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=this.DUMMY_INPUT_MIN_HEIGHT=this.TAB_HEIGHT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT,this.TOP_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.MEDIUM_PADDING,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.EMPTY_INLINE_INPUT_HEIGHT=this.TAB_HEIGHT+11,this.EMPTY_STATEMENT_INPUT_HEIGHT=this.MIN_BLOCK_HEIGHT,this.START_POINT=jt(0,0),this.FIELD_TEXT_BASELINE_CENTER=!0,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_DROPDOWN_SVG_ARROW_DATAURI="data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=",this.FIELD_COLOUR_DEFAULT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT,this.FIELD_CHECKBOX_X_OFFSET=this.FIELD_BORDER_RECT_X_PADDING-3,this.randomIdentifier=String(Math.random()).substring(2)}init(){this.JAGGED_TEETH=this.makeJaggedTeeth(),this.NOTCH=this.makeNotch(),this.START_HAT=this.makeStartHat(),this.PUZZLE_TAB=this.makePuzzleTab(),this.INSIDE_CORNERS=this.makeInsideCorners(),this.OUTSIDE_CORNERS=this.makeOutsideCorners()}setTheme(e){this.blockStyles=Object.create(null);const t=e.blockStyles;for(const i in t)this.blockStyles[i]=this.validatedBlockStyle_(t[i]);this.setDynamicProperties_(e)}setDynamicProperties_(e){this.setFontConstants_(e),this.setComponentConstants_(e),this.ADD_START_HATS=e.startHats!==void 0?e.startHats:this.ADD_START_HATS}setFontConstants_(e){e.fontStyle&&e.fontStyle.family&&(this.FIELD_TEXT_FONTFAMILY=e.fontStyle.family),e.fontStyle&&e.fontStyle.weight&&(this.FIELD_TEXT_FONTWEIGHT=e.fontStyle.weight),e.fontStyle&&e.fontStyle.size&&(this.FIELD_TEXT_FONTSIZE=e.fontStyle.size),e=be("Hg",this.FIELD_TEXT_FONTSIZE+"pt",this.FIELD_TEXT_FONTWEIGHT,this.FIELD_TEXT_FONTFAMILY),this.FIELD_TEXT_HEIGHT=e.height,this.FIELD_TEXT_BASELINE=e.baseline}setComponentConstants_(e){this.CURSOR_COLOUR=e.getComponentStyle("cursorColour")||this.CURSOR_COLOUR,this.MARKER_COLOUR=e.getComponentStyle("markerColour")||this.MARKER_COLOUR,this.INSERTION_MARKER_COLOUR=e.getComponentStyle("insertionMarkerColour")||this.INSERTION_MARKER_COLOUR,this.INSERTION_MARKER_OPACITY=Number(e.getComponentStyle("insertionMarkerOpacity"))||this.INSERTION_MARKER_OPACITY}getBlockStyleForColour(e){const t="auto_"+e;return this.blockStyles[t]||(this.blockStyles[t]=this.createBlockStyle_(e)),{style:this.blockStyles[t],name:t}}getBlockStyle(e){return this.blockStyles[e||""]||(e&&e.indexOf("auto_")===0?this.getBlockStyleForColour(e.substring(5)).style:this.createBlockStyle_("#000000"))}createBlockStyle_(e){return this.validatedBlockStyle_({colourPrimary:e})}validatedBlockStyle_(e){const t={};return e&&Object.assign(t,e),e=$r(t.colourPrimary||"#000"),t.colourPrimary=e.hex,t.colourSecondary=t.colourSecondary?$r(t.colourSecondary).hex:this.generateSecondaryColour_(t.colourPrimary),t.colourTertiary=t.colourTertiary?$r(t.colourTertiary).hex:this.generateTertiaryColour_(t.colourPrimary),t.hat=t.hat||"",t}generateSecondaryColour_(e){return gn("#fff",e,.6)||e}generateTertiaryColour_(e){return gn("#fff",e,.3)||e}dispose(){this.embossFilter&&U(this.embossFilter),this.disabledPattern&&U(this.disabledPattern),this.debugFilter&&U(this.debugFilter),this.cssNode=null}makeJaggedTeeth(){const e=this.JAGGED_TEETH_HEIGHT,t=this.JAGGED_TEETH_WIDTH,i=_r([tt(t,e/4),tt(2*-t,e/2),tt(t,e/4)]);return{height:e,width:t,path:i}}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,i=xo("c",[tt(30,-e),tt(70,-e),tt(t,0)]);return{height:e,width:t,path:i}}makePuzzleTab(){function e($){$=$?-1:1;const v=-$;var H=i/2;const Oe=H+2.5,Qe=H+.5,qt=tt(-t,$*H);return H=tt(t,$*H),xo("c",[tt(0,$*Oe),tt(-t,v*Qe),qt])+xo("s",[tt(t,2.5*v),H])}const t=this.TAB_WIDTH,i=this.TAB_HEIGHT,r=e(!0),c=e(!1);return{type:this.SHAPES.PUZZLE,width:t,height:i,pathDown:c,pathUp:r}}makeNotch(){function e(v){return _r([tt(v*r,i),tt(3*v,0),tt(v*r,-i)])}const t=this.NOTCH_WIDTH,i=this.NOTCH_HEIGHT,r=(t-3)/2,c=e(1),$=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:i,pathLeft:c,pathRight:$}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=oo("a","0 0,0",e,tt(-e,e)),i=oo("a","0 0,0",e,tt(e,e));return{width:e,height:e,pathTop:t,pathBottom:i}}makeOutsideCorners(){const e=this.CORNER_RADIUS,t=jt(0,e)+oo("a","0 0,1",e,tt(e,-e)),i=oo("a","0 0,1",e,tt(e,e)),r=oo("a","0 0,1",e,tt(-e,-e)),c=oo("a","0 0,1",e,tt(-e,e));return{topLeft:t,topRight:i,bottomRight:c,bottomLeft:r,rightHeight:e}}shapeFor(e){switch(e.type){case qe.INPUT_VALUE:case qe.OUTPUT_VALUE:return this.PUZZLE_TAB;case qe.PREVIOUS_STATEMENT:case qe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown connection type")}}createDom(e,t,i){this.injectCSS_(t,i),this.defs=w(te.DEFS,{},e),e=w(te.FILTER,{id:"blocklyEmbossFilter"+this.randomIdentifier},this.defs),w(te.FEGAUSSIANBLUR,{in:"SourceAlpha",stdDeviation:1,result:"blur"},e),t=w(te.FESPECULARLIGHTING,{in:"blur",surfaceScale:1,specularConstant:.5,specularExponent:10,"lighting-color":"white",result:"specOut"},e),w(te.FEPOINTLIGHT,{x:-5e3,y:-1e4,z:2e4},t),w(te.FECOMPOSITE,{in:"specOut",in2:"SourceAlpha",operator:"in",result:"specOut"},e),w(te.FECOMPOSITE,{in:"SourceGraphic",in2:"specOut",operator:"arithmetic",k1:0,k2:1,k3:1,k4:0},e),this.embossFilterId=e.id,this.embossFilter=e,e=w(te.PATTERN,{id:"blocklyDisabledPattern"+this.randomIdentifier,patternUnits:"userSpaceOnUse",width:10,height:10},this.defs),w(te.RECT,{width:10,height:10,fill:"#aaa"},e),w(te.PATH,{d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},e),this.disabledPatternId=e.id,this.disabledPattern=e,this.createDebugFilter()}createDebugFilter(){if(!this.debugFilter){const e=w(te.FILTER,{id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),t=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},e);w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),w(te.FEFLOOD,{"flood-color":"#ff0000","flood-opacity":.5,result:"outColor"},e),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),this.debugFilterId=e.id,this.debugFilter=e}}injectCSS_(e,t){t=this.getCSS_(t),e="blockly-renderer-style-"+e,this.cssNode=document.getElementById(e);const i=t.join(` +`);this.cssNode?this.cssNode.firstChild.textContent=i:(t=document.createElement("style"),t.id=e,e=document.createTextNode(i),t.appendChild(e),document.head.insertBefore(t,document.head.firstChild),this.cssNode=t)}getCSS_(e){return[`${e} .blocklyText, `,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect,`,`${e} .blocklyEditableText>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text {`,"fill: #000;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${e} .blocklyEditableText:not(.editing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${e} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${e} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${e} .blocklyReplaceable .blocklyPath {`,"fill-opacity: .5;","}",`${e} .blocklyReplaceable .blocklyPathLight,`,`${e} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},wT=class extends oc{constructor(){super(),this.GRID_UNIT=4,this.CURSOR_COLOUR="#ffa200",this.CURSOR_RADIUS=5,this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0,this.START_HAT_HEIGHT=22,this.START_HAT_WIDTH=96,this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5},this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT},2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}},this.FULL_BLOCK_FIELDS=!0,this.FIELD_TEXT_FONTWEIGHT="bold",this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif',this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0,this.SELECTED_GLOW_COLOUR="#fff200",this.SELECTED_GLOW_SIZE=.5,this.REPLACEMENT_GLOW_COLOUR="#fff200",this.REPLACEMENT_GLOW_SIZE=2,this.selectedGlowFilterId="",this.selectedGlowFilter=null,this.replacementGlowFilterId="",this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null,this.SMALL_PADDING=this.GRID_UNIT,this.MEDIUM_PADDING=2*this.GRID_UNIT,this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT,this.LARGE_PADDING=4*this.GRID_UNIT,this.CORNER_RADIUS=1*this.GRID_UNIT,this.NOTCH_WIDTH=9*this.GRID_UNIT,this.NOTCH_HEIGHT=2*this.GRID_UNIT,this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT,this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT,this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT,this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT,this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING,this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS,this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT,this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT,this.STATEMENT_INPUT_SPACER_MIN_WIDTH=40*this.GRID_UNIT,this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT,this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT,this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT,this.CURSOR_WS_WIDTH=20*this.GRID_UNIT,this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT,this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS,this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT,this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT,this.FIELD_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT,this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING,this.FIELD_COLOUR_DEFAULT_WIDTH=2*this.GRID_UNIT,this.FIELD_COLOUR_DEFAULT_HEIGHT=4*this.GRID_UNIT,this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT,this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(e){super.setFontConstants_(e),this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+2*this.FIELD_BORDER_RECT_Y_PADDING}init(){super.init(),this.HEXAGONAL=this.makeHexagonal(),this.ROUNDED=this.makeRounded(),this.SQUARED=this.makeSquared(),this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(e){super.setDynamicProperties_(e),this.SELECTED_GLOW_COLOUR=e.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const t=Number(e.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=t&&!isNaN(t)?t:this.SELECTED_GLOW_SIZE,this.REPLACEMENT_GLOW_COLOUR=e.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR,this.REPLACEMENT_GLOW_SIZE=(e=Number(e.getComponentStyle("replacementGlowSize")))&&!isNaN(e)?e:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose(),this.selectedGlowFilter&&U(this.selectedGlowFilter),this.replacementGlowFilter&&U(this.replacementGlowFilter)}makeStartHat(){const e=this.START_HAT_HEIGHT,t=this.START_HAT_WIDTH,i=xo("c",[tt(25,-e),tt(71,-e),tt(t,0)]);return{height:e,width:t,path:i}}makeHexagonal(){function e(i,r,c){var $=i/2;return $=$>t?t:$,c=c?-1:1,i=(r?-1:1)*i/2,Bs(-c*$,i)+Bs(c*$,i)}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(i){return i/=2,i>t?t:i},height(i){return i},connectionOffsetY(i){return i/2},connectionOffsetX(i){return-i},pathDown(i){return e(i,!1,!1)},pathUp(i){return e(i,!0,!1)},pathRightDown(i){return e(i,!1,!0)},pathRightUp(i){return e(i,!1,!0)}}}makeRounded(){function e(r,c,$){const v=r>i?r-i:0;return r=(r>i?i:r)/2,oo("a","0 0,1",r,tt((c?-1:1)*r,(c?-1:1)*r))+je("v",($?1:-1)*v)+oo("a","0 0,1",r,tt((c?1:-1)*r,(c?-1:1)*r))}const t=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,i=2*t;return{type:this.SHAPES.ROUND,isDynamic:!0,width(r){return r/=2,r>t?t:r},height(r){return r},connectionOffsetY(r){return r/2},connectionOffsetX(r){return-r},pathDown(r){return e(r,!1,!1)},pathUp(r){return e(r,!0,!1)},pathRightDown(r){return e(r,!1,!0)},pathRightUp(r){return e(r,!1,!0)}}}makeSquared(){function e(i,r,c){return i-=2*t,oo("a","0 0,1",t,tt((r?-1:1)*t,(r?-1:1)*t))+je("v",(c?1:-1)*i)+oo("a","0 0,1",t,tt((r?1:-1)*t,(r?-1:1)*t))}const t=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(i){return t},height(i){return i},connectionOffsetY(i){return i/2},connectionOffsetX(i){return-i},pathDown(i){return e(i,!1,!1)},pathUp(i){return e(i,!0,!1)},pathRightDown(i){return e(i,!1,!0)},pathRightUp(i){return e(i,!1,!0)}}}shapeFor(e){let t=e.getCheck();switch(!t&&e.targetConnection&&(t=e.targetConnection.getCheck()),e.type){case qe.INPUT_VALUE:case qe.OUTPUT_VALUE:if(e=e.getSourceBlock().getOutputShape(),e!==null)switch(e){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL;case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}return t&&t.indexOf("Boolean")!==-1?this.HEXAGONAL:t&&t.indexOf("Number")!==-1?this.ROUNDED:(t&&t.indexOf("String"),this.ROUNDED);case qe.PREVIOUS_STATEMENT:case qe.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type")}}makeNotch(){function e(Qe){return xo("c",[tt(Qe*c/2,0),tt(Qe*c*3/4,v/2),tt(Qe*c,v)])+_r([tt(Qe*c,$)])+xo("c",[tt(Qe*c/4,v/2),tt(Qe*c/2,v),tt(Qe*c,v)])+je("h",Qe*r)+xo("c",[tt(Qe*c/2,0),tt(Qe*c*3/4,-(v/2)),tt(Qe*c,-v)])+_r([tt(Qe*c,-$)])+xo("c",[tt(Qe*c/4,-(v/2)),tt(Qe*c/2,-v),tt(Qe*c,-v)])}const t=this.NOTCH_WIDTH,i=this.NOTCH_HEIGHT,r=t/3,c=r/3,$=i/2,v=$/2,H=e(1),Oe=e(-1);return{type:this.SHAPES.NOTCH,width:t,height:i,pathLeft:H,pathRight:Oe}}makeInsideCorners(){const e=this.CORNER_RADIUS,t=oo("a","0 0,0",e,tt(-e,e)),i=oo("a","0 0,1",e,tt(-e,e)),r=oo("a","0 0,0",e,tt(e,e)),c=oo("a","0 0,1",e,tt(e,e));return{width:e,height:e,pathTop:t,pathBottom:r,rightWidth:e,rightHeight:e,pathTopRight:i,pathBottomRight:c}}generateSecondaryColour_(e){return gn("#000",e,.15)||e}generateTertiaryColour_(e){return gn("#000",e,.25)||e}createDom(e,t,i){super.createDom(e,t,i),e=w(te.DEFS,{},e),t=w(te.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),w(te.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},t),i=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},t),w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},i),w(te.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},t),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},t),this.selectedGlowFilterId=t.id,this.selectedGlowFilter=t,e=w(te.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},e),w(te.FEGAUSSIANBLUR,{in:"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},e),t=w(te.FECOMPONENTTRANSFER,{result:"outBlur"},e),w(te.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},t),w(te.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},e),w(te.FECOMPOSITE,{in:"outColor",in2:"outBlur",operator:"in",result:"outGlow"},e),w(te.FECOMPOSITE,{in:"SourceGraphic",in2:"outGlow",operator:"over"},e),this.replacementGlowFilterId=e.id,this.replacementGlowFilter=e}getCSS_(e){return[`${e} .blocklyText,`,`${e} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e} .blocklyText {`,"fill: #fff;","}",`${e} .blocklyNonEditableText>rect:not(.blocklyDropdownRect),`,`${e} .blocklyEditableText>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${e} .blocklyNonEditableText>text,`,`${e} .blocklyEditableText>text,`,`${e} .blocklyNonEditableText>g>text,`,`${e} .blocklyEditableText>g>text {`,"fill: #575E75;","}",`${e} .blocklyFlyoutLabelText {`,"fill: #575E75;","}",`${e} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>rect,",`${e} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableText:not(.editing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${e} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${e} .blocklyDropdownText {`,"fill: #fff !important;","}",`${e}.blocklyWidgetDiv .goog-menuitem,`,`${e}.blocklyDropDownDiv .goog-menuitem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${e}.blocklyDropDownDiv .goog-menuitem-content {`,"color: #fff;","}",`${e} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${e} .blocklyDisabled > .blocklyOutlinePath {`,`fill: url(#blocklyDisabledPattern${this.randomIdentifier})`,"}",`${e} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},LS=class{constructor(){this.NONE=0,this.FIELD=1,this.HAT=2,this.ICON=4,this.SPACER=8,this.BETWEEN_ROW_SPACER=16,this.IN_ROW_SPACER=32,this.EXTERNAL_VALUE_INPUT=64,this.INPUT=128,this.INLINE_INPUT=256,this.STATEMENT_INPUT=512,this.CONNECTION=1024,this.PREVIOUS_CONNECTION=2048,this.NEXT_CONNECTION=4096,this.OUTPUT_CONNECTION=8192,this.CORNER=16384,this.LEFT_SQUARE_CORNER=32768,this.LEFT_ROUND_CORNER=65536,this.RIGHT_SQUARE_CORNER=131072,this.RIGHT_ROUND_CORNER=262144,this.JAGGED_EDGE=524288,this.ROW=1048576,this.TOP_ROW=2097152,this.BOTTOM_ROW=4194304,this.INPUT_ROW=8388608,this.LEFT_CORNER=this.LEFT_SQUARE_CORNER|this.LEFT_ROUND_CORNER,this.RIGHT_CORNER=this.RIGHT_SQUARE_CORNER|this.RIGHT_ROUND_CORNER,this.nextTypeValue_=16777216}getType(e){return Object.prototype.hasOwnProperty.call(this,e)||(this[e]=this.nextTypeValue_,this.nextTypeValue_<<=1),this[e]}isField(e){return e.type&this.FIELD}isHat(e){return e.type&this.HAT}isIcon(e){return e.type&this.ICON}isSpacer(e){return e.type&this.SPACER}isInRowSpacer(e){return e.type&this.IN_ROW_SPACER}isInput(e){return e.type&this.INPUT}isExternalInput(e){return e.type&this.EXTERNAL_VALUE_INPUT}isInlineInput(e){return e.type&this.INLINE_INPUT}isStatementInput(e){return e.type&this.STATEMENT_INPUT}isPreviousConnection(e){return e.type&this.PREVIOUS_CONNECTION}isNextConnection(e){return e.type&this.NEXT_CONNECTION}isPreviousOrNextConnection(e){return e.type&(this.PREVIOUS_CONNECTION|this.NEXT_CONNECTION)}isLeftRoundedCorner(e){return e.type&this.LEFT_ROUND_CORNER}isRightRoundedCorner(e){return e.type&this.RIGHT_ROUND_CORNER}isLeftSquareCorner(e){return e.type&this.LEFT_SQUARE_CORNER}isRightSquareCorner(e){return e.type&this.RIGHT_SQUARE_CORNER}isCorner(e){return e.type&this.CORNER}isJaggedEdge(e){return e.type&this.JAGGED_EDGE}isRow(e){return e.type&this.ROW}isBetweenRowSpacer(e){return e.type&this.BETWEEN_ROW_SPACER}isTopRow(e){return e.type&this.TOP_ROW}isBottomRow(e){return e.type&this.BOTTOM_ROW}isTopOrBottomRow(e){return e.type&(this.TOP_ROW|this.BOTTOM_ROW)}isInputRow(e){return e.type&this.INPUT_ROW}},q=new LS,js=class{constructor(e){this.centerline=this.xPos=this.height=this.width=0,this.constants_=e,this.type=q.NONE,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},Dn=class extends js{constructor(e,t){super(e),this.connectionModel=t,this.shape=this.constants_.shapeFor(t),this.isDynamicShape="isDynamic"in this.shape&&this.shape.isDynamic,this.type|=q.CONNECTION}},sc=class{constructor(e,t){this.inlinePath_=this.outlinePath_="",this.block_=e,this.info_=t,this.topLeft_=e.getRelativeToSurfaceXY(),this.constants_=t.getRenderer().getConstants()}draw(){this.drawOutline_(),this.drawInternals_(),this.block_.pathObject.setPath(this.outlinePath_+` +`+this.inlinePath_),this.info_.RTL&&this.block_.pathObject.flipRTL(),this.recordSizeOnBlock_()}hideHiddenIcons_(){xe("hideHiddenIcons_","v10","v11")}recordSizeOnBlock_(){this.block_.height=this.info_.height,this.block_.width=this.info_.widthWithChildren}drawOutline_(){this.drawTop_();for(let e=1;e=e.height)){if(q.isSpacer(e)){const r=e.precedesStatement;var t=e.followsStatement;if(r||t){const c=this.constants_.INSIDE_CORNERS;var i=c.rightHeight;i=e.height-(r?i:0),t=t?c.pathBottomRight:"",e=0=i||0>=t)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Vt(t,i+Pn.Y_PADDING),this.imageHeight=i,typeof c=="function"&&(this.clickHandler=c),e!==bt.SKIP_SETUP&&(v?this.configure_(v):(this.flipRtl=!!$,this.altText=Zt(r)||""),this.setValue(Zt(e)))}configure_(e){super.configure_(e),e.flipRtl&&(this.flipRtl=e.flipRtl),e.alt&&(this.altText=Zt(e.alt))}initView(){this.imageElement=w(te.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_),this.imageElement.setAttributeNS(us,"xlink:href",this.value_),this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(e){return typeof e!="string"?null:e}doValueUpdate_(e){this.value_=e,this.imageElement&&this.imageElement.setAttributeNS(us,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(e){e!==this.altText&&(this.altText=e||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(e){this.clickHandler=e}getText_(){return this.altText}static fromJson(e){if(!e.src||!e.width||!e.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(e.src,e.width,e.height,void 0,void 0,void 0,e)}};Pn.Y_PADDING=1,Jo("field_image",Pn),Pn.prototype.DEFAULT_VALUE="";var ic=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.spellcheck_=!0,this.htmlInput_=null,this.isTextValid_=this.isBeingEdited_=!1,this.onKeyInputWrapper_=this.onKeyDownWrapper_=this.valueWhenEditorWasOpened_=null,this.fullBlockClickTarget_=!1,this.workspace_=null,this.SERIALIZABLE=!0,this.CURSOR="text",e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.spellcheck!==void 0&&(this.spellcheck_=e.spellcheck)}initView(){const e=this.getSourceBlock();if(!e)throw new io;if(this.getConstants().FULL_BLOCK_FIELDS){let t=0,i=0;for(let r=0,c;c=e.inputList[r];r++){for(let $=0;c.fieldRow[$];$++)t++;c.connection&&i++}this.fullBlockClickTarget_=1>=t&&e.outputConnection&&!i}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_(),this.createTextElement_()}doValueInvalid_(e){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,e=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&_e()&&re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,e,this.value_)))}doValueUpdate_(e){this.isTextValid_=this.isDirty_=!0,this.value_=e}applyColour(){if(this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS){var e=this.sourceBlock_;this.borderRect_?this.borderRect_.setAttribute("stroke",e.style.colourTertiary):e.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)}}render_(){if(super.render_(),this.isBeingEdited_){this.resizeEditor_();const e=this.htmlInput_;this.isTextValid_?(A(e,"blocklyInvalidInput"),Xt(e,Gt.INVALID,!1)):(I(e,"blocklyInvalidInput"),Xt(e,Gt.INVALID,!0))}}setSpellcheck(e){e!==this.spellcheck_&&(this.spellcheck_=e,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(e,t=!1){this.workspace_=this.sourceBlock_.workspace,!t&&this.workspace_.options.modalInputs&&(Lp||xa||kr)?this.showPromptEditor_():this.showInlineEditor_(t)}showPromptEditor_(){g(s.Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),e=>{e!==null&&this.setValue(this.getValueFromEditorText_(e))})}showInlineEditor_(e){const t=this.getSourceBlock();if(!t)throw new io;oa(this,t.RTL,this.widgetDispose_.bind(this)),this.htmlInput_=this.widgetCreate_(),this.isBeingEdited_=!0,this.valueWhenEditorWasOpened_=this.value_,e||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var e=this.getSourceBlock();if(!e)throw new io;s.setGroup$$module$build$src$core$events$utils(!0);const t=fn();var i=this.getClickTarget_();if(!i)throw Error("A click target has not been set.");I(i,"editing"),i=document.createElement("input"),i.className="blocklyHtmlInput",i.setAttribute("spellcheck",this.spellcheck_);const r=this.workspace_.getScale();var c=this.getConstants().FIELD_TEXT_FONTSIZE*r+"pt";return t.style.fontSize=c,i.style.fontSize=c,c=ic.BORDERRADIUS*r+"px",this.fullBlockClickTarget_&&(c=this.getScaledBBox(),c=(c.bottom-c.top)/2+"px",e=e.getParent()?e.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary,i.style.border=1*r+"px solid "+e,t.style.borderRadius=c,t.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(t.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*r+"px")),i.style.borderRadius=c,t.appendChild(i),i.value=i.defaultValue=this.getEditorText_(this.value_),i.setAttribute("data-untyped-default-value",String(this.value_)),this.resizeEditor_(),this.bindInputEvents_(i),i}widgetDispose_(){this.isBeingEdited_=!1,this.isTextValid_=!0,this.forceRerender(),this.onFinishEditing_(this.value_),this.sourceBlock_&&_e()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(re(new(we(s.CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null),s.setGroup$$module$build$src$core$events$utils(!1),this.unbindInputEvents_();var e=fn().style;if(e.width="auto",e.height="auto",e.fontSize="",e.transition="",e.boxShadow="",this.htmlInput_=null,e=this.getClickTarget_(),!e)throw Error("A click target has not been set.");A(e,"editing")}onFinishEditing_(e){}bindInputEvents_(e){this.onKeyDownWrapper_=Be(e,"keydown",this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=Be(e,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(Dt(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null),this.onKeyInputWrapper_&&(Dt(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(e){e.key==="Enter"?(as(),fs()):e.key==="Escape"?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value")),as(),fs()):e.key==="Tab"&&(as(),fs(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange_(e){e=this.value_,this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&_e()&&this.value_!==e&&re(new(we(Bi))(this.sourceBlock_,this.name||null,e,this.value_)),cr().then(()=>{this.resizeEditor_()})}setEditorValue_(e,t=!0){this.isDirty_=!0,this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(e)),this.setValue(e,t)}resizeEditor_(){var e=this.getSourceBlock();if(!e)throw new io;const t=fn(),i=this.getScaledBBox();t.style.width=i.right-i.left+"px",t.style.height=i.bottom-i.top+"px",e=new Ue(e.RTL?i.right-t.offsetWidth:i.left,i.top),t.style.left=e.x+"px",t.style.top=e.y+"px"}repositionForWindowResize(){const e=this.getSourceBlock();return e instanceof ts?(fr(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),e),this.resizeEditor_(),!0):!1}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(e){return`${e}`}getValueFromEditorText_(e){return e}};ic.BORDERRADIUS=4;var Gr=class extends ic{constructor(e,t,i){super(e,t,i)}doClassValidation_(e){return e===void 0?null:`${e}`}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_input",Gr),Gr.prototype.DEFAULT_VALUE="";var nc=class{constructor(e){this.elements=[],this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0,this.hasStatement=this.hasExternalInput=!1,this.statementEdge=0,this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1,this.align=null,this.constants_=e,this.type=q.ROW,this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let e=this.elements.length-1;0<=e;e--){const t=this.elements[e];if(q.isInput(t))return t}return null}measure(){throw Error("Unexpected attempt to measure a base Row.")}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let e=0;e=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!r.precedesStatement,q.isInputRow($)&&$.hasStatement){$.measure();let v,H;t=$.width-((H=(v=$.getLastInput())==null?void 0:v.width)!=null?H:0)+e}else if(i&&(c===2||r)&&q.isInputRow($)&&!$.hasStatement){r=$.xPos,i=null;for(let v=0;v<$.elements.length;v++){const H=$.elements[v];q.isSpacer(H)&&(i=H),i&&(q.isField(H)||q.isInput(H))&&ri?i:this.height/2,t-i*(1-Math.sin(Math.acos((i-this.constants_.SMALL_PADDING)/i)));default:return 0}if(q.isInlineInput(e)&&e instanceof ji){const c=e.connectedBlock;return e=c?c.pathObject.outputShapeType:e.shape.type,e==null||c&&c.outputConnection&&(c.statementInputCount||c.nextConnection)||i===r.SHAPES.HEXAGONAL&&i!==e?0:t-this.constants_.SHAPE_IN_SHAPE_PADDING[i][e]}return q.isField(e)&&e instanceof Wr?i===r.SHAPES.ROUND&&e.field instanceof Gr?t-2.75*r.GRID_UNIT:t-this.constants_.SHAPE_IN_SHAPE_PADDING[i][0]:q.isIcon(e)?this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let r=2;r=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!v.precedesStatement;if(e?this.topRow.hasPreviousConnection:c.followsStatement){var i=$.elements[1];if(i=$.elements.length===3&&i instanceof Wr&&(i.field instanceof wn||i.field instanceof Pn),!e&&i)c.height-=this.constants_.SMALL_PADDING,v.height-=this.constants_.SMALL_PADDING,$.height-=this.constants_.MEDIUM_PADDING;else if(!e&&!t)c.height+=this.constants_.SMALL_PADDING;else if(t){for(e=!1,t=0;t<$.elements.length;t++)if(i=$.elements[t],i instanceof ji&&q.isInlineInput(i)&&i.connectedBlock&&!i.connectedBlock.isShadow()&&40<=i.connectedBlock.getHeightWidth().height){e=!0;break}e&&(c.height-=this.constants_.SMALL_PADDING,v.height-=this.constants_.SMALL_PADDING)}}}}finalize_(){this.finalizeOutputConnection_(),this.finalizeHorizontalAlignment_(),this.finalizeVerticalAlignment_(),super.finalize_(),this.rightSide&&(this.widthWithChildren+=this.rightSide.width)}},NS="blocklyCursor",wS="blocklyMarker",MS=.75,P$=class{constructor(e,t,i){this.workspace=e,this.marker=i,this.markerSvgRect_=this.markerSvgLine_=this.markerInput_=this.markerBlock_=this.svgGroup_=this.markerSvg_=this.currentMarkerSvg=this.parent=null,this.constants_=t,e=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR,this.colour_=i.colour||e}getSvgRoot(){return this.svgGroup_}getMarker(){return this.marker}isCursor(){return this.marker.type==="cursor"}createDom(){const e=this.isCursor()?NS:wS;return this.svgGroup_=w(te.G,{class:e}),this.createDomInternal_(),this.svgGroup_}setParent_(e){this.isCursor()?(this.parent&&this.parent.setCursorSvg(null),e.setCursorSvg(this.getSvgRoot())):(this.parent&&this.parent.setMarkerSvg(null),e.setMarkerSvg(this.getSvgRoot())),this.parent=e}draw(e,t){if(t){this.constants_=this.workspace.getRenderer().getConstants();var i=this.isCursor()?this.constants_.CURSOR_COLOUR:this.constants_.MARKER_COLOUR;this.colour_=this.marker.colour||i,this.applyColour_(t),this.showAtLocation_(t),this.fireMarkerEvent(e,t),e=this.currentMarkerSvg.childNodes[0],e!==void 0&&e.beginElement&&e.beginElement()}else this.hide()}showAtLocation_(e){const t=e.getLocation().type;e.getType()===Re.types.BLOCK?this.showWithBlock_(e):e.getType()===Re.types.OUTPUT?this.showWithOutput_(e):t===qe.INPUT_VALUE?this.showWithInput_(e):t===qe.NEXT_STATEMENT?this.showWithNext_(e):e.getType()===Re.types.PREVIOUS?this.showWithPrevious_(e):e.getType()===Re.types.FIELD?this.showWithField_(e):e.getType()===Re.types.WORKSPACE?this.showWithCoordinates_(e):e.getType()===Re.types.STACK&&this.showWithStack_(e)}showWithBlockPrevOutput(e){e=e.getSourceBlock();const t=e.width;var i=e.height,r=i*MS;const c=this.constants_.CURSOR_BLOCK_PADDING;e.previousConnection?(i=this.constants_.shapeFor(e.previousConnection),this.positionPrevious_(t,c,r,i)):e.outputConnection?(r=this.constants_.shapeFor(e.outputConnection),this.positionOutput_(t,i,r)):this.positionBlock_(t,c,r),this.setParent_(e),this.showCurrent_()}showWithBlock_(e){this.showWithBlockPrevOutput(e)}showWithPrevious_(e){this.showWithBlockPrevOutput(e)}showWithOutput_(e){this.showWithBlockPrevOutput(e)}showWithCoordinates_(e){var t=e.getWsCoordinate();e=t.x,t=t.y,this.workspace.RTL&&(e-=this.constants_.CURSOR_WS_WIDTH),this.positionLine_(e,t,this.constants_.CURSOR_WS_WIDTH),this.setParent_(this.workspace),this.showCurrent_()}showWithField_(e){e=e.getLocation();const t=e.getSize().width,i=e.getSize().height;this.positionRect_(0,0,t,i),this.setParent_(e),this.showCurrent_()}showWithInput_(e){e=e.getLocation();const t=e.getSourceBlock();this.positionInput_(e),this.setParent_(t),this.showCurrent_()}showWithNext_(e){var t=e.getLocation();e=t.getSourceBlock();let i=0;t=t.getOffsetInBlock().y;const r=e.getHeightWidth().width;this.workspace.RTL&&(i=-r),this.positionLine_(i,t,r),this.setParent_(e),this.showCurrent_()}showWithStack_(e){e=e.getLocation();var t=e.getHeightWidth();const i=t.width+this.constants_.CURSOR_STACK_PADDING;t=t.height+this.constants_.CURSOR_STACK_PADDING;const r=-this.constants_.CURSOR_STACK_PADDING/2,c=-this.constants_.CURSOR_STACK_PADDING/2;let $=r;this.workspace.RTL&&($=-(i+r)),this.positionRect_($,c,i,t),this.setParent_(e),this.showCurrent_()}showCurrent_(){this.hide(),this.currentMarkerSvg&&(this.currentMarkerSvg.style.display="")}positionBlock_(e,t,i){if(e=jt(-t,i)+je("V",-t)+je("H",e+2*t)+je("V",i),!this.markerBlock_)throw Error("createDom should be called before positioning the marker");this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionInput_(e){const t=e.getOffsetInBlock().x,i=e.getOffsetInBlock().y;e=To(0,0)+this.constants_.shapeFor(e).pathDown,this.markerInput_.setAttribute("d",e),this.markerInput_.setAttribute("transform","translate("+t+","+i+")"+(this.workspace.RTL?" scale(-1 1)":"")),this.currentMarkerSvg=this.markerInput_}positionLine_(e,t,i){if(!this.markerSvgLine_)throw Error("createDom should be called before positioning the line");this.markerSvgLine_.setAttribute("x",`${e}`),this.markerSvgLine_.setAttribute("y",`${t}`),this.markerSvgLine_.setAttribute("width",`${i}`),this.currentMarkerSvg=this.markerSvgLine_}positionOutput_(e,t,i){if(!this.markerBlock_)throw Error("createDom should be called before positioning the output");e=jt(e,0)+je("h",-(e-i.width))+je("v",this.constants_.TAB_OFFSET_FROM_TOP)+i.pathDown+je("V",t)+je("H",e),this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionPrevious_(e,t,i,r){if(!this.markerBlock_)throw Error("createDom should be called before positioning the previous connection marker");e=jt(-t,i)+je("V",-t)+je("H",this.constants_.NOTCH_OFFSET_LEFT)+r.pathLeft+je("H",e+2*t)+je("V",i),this.markerBlock_.setAttribute("d",e),this.workspace.RTL&&this.flipRtl(this.markerBlock_),this.currentMarkerSvg=this.markerBlock_}positionRect_(e,t,i,r){if(!this.markerSvgRect_)throw Error("createDom should be called before positioning the rect");this.markerSvgRect_.setAttribute("x",`${e}`),this.markerSvgRect_.setAttribute("y",`${t}`),this.markerSvgRect_.setAttribute("width",`${i}`),this.markerSvgRect_.setAttribute("height",`${r}`),this.currentMarkerSvg=this.markerSvgRect_}flipRtl(e){e.setAttribute("transform","scale(-1 1)")}hide(){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before hiding the marker");this.markerSvgLine_.style.display="none",this.markerSvgRect_.style.display="none",this.markerInput_.style.display="none",this.markerBlock_.style.display="none"}fireMarkerEvent(e,t){const i=t.getSourceBlock();e=new(we(vr))(i,this.isCursor(),e,t),re(e)}getBlinkProperties_(){return{attributeType:"XML",attributeName:"fill",dur:"1s",values:this.colour_+";transparent;transparent;",repeatCount:"indefinite"}}createDomInternal_(){if(this.markerSvg_=w(te.G,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT},this.svgGroup_),this.markerSvgLine_=w(te.RECT,{width:this.constants_.CURSOR_WS_WIDTH,height:this.constants_.WS_CURSOR_HEIGHT,style:"display: none"},this.markerSvg_),this.markerSvgRect_=w(te.RECT,{class:"blocklyVerticalMarker",rx:10,ry:10,style:"display: none"},this.markerSvg_),this.markerInput_=w(te.PATH,{transform:"",style:"display: none"},this.markerSvg_),this.markerBlock_=w(te.PATH,{transform:"",style:"display: none",fill:"none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){const e=this.getBlinkProperties_();w(te.ANIMATE,e,this.markerSvgLine_),w(te.ANIMATE,e,this.markerInput_),w(te.ANIMATE,Object.assign({},e,{attributeName:"stroke"}),this.markerBlock_)}return this.markerSvg_}applyColour_(e){if(!(this.markerSvgLine_&&this.markerSvgRect_&&this.markerInput_&&this.markerBlock_))throw Error("createDom should be called before applying color to the markerj");this.markerSvgLine_.setAttribute("fill",this.colour_),this.markerSvgRect_.setAttribute("stroke",this.colour_),this.markerInput_.setAttribute("fill",this.colour_),this.markerBlock_.setAttribute("stroke",this.colour_),this.isCursor()&&(e=this.colour_+";transparent;transparent;",this.markerSvgLine_.firstElementChild.setAttribute("values",e),this.markerInput_.firstElementChild.setAttribute("values",e),this.markerBlock_.firstElementChild.setAttribute("values",e))}dispose(){this.svgGroup_&&U(this.svgGroup_)}},WT=class extends P${constructor(e,t,i){super(e,t,i),this.markerCircle=null}showWithInputOutput(e){const t=e.getSourceBlock();e=e.getLocation().getOffsetInBlock(),this.positionCircle(e.x,e.y),this.setParent_(t),this.showCurrent_()}showWithOutput_(e){this.showWithInputOutput(e)}showWithInput_(e){this.showWithInputOutput(e)}showWithBlock_(e){e=e.getLocation();const t=e.getHeightWidth();this.positionRect_(0,0,t.width,t.height),this.setParent_(e),this.showCurrent_()}positionCircle(e,t){let i;(i=this.markerCircle)==null||i.setAttribute("cx",`${e}`);let r;(r=this.markerCircle)==null||r.setAttribute("cy",`${t}`),this.currentMarkerSvg=this.markerCircle}hide(){super.hide(),this.markerCircle&&(this.markerCircle.style.display="none")}createDomInternal_(){if(super.createDomInternal_(),this.markerCircle=w(te.CIRCLE,{r:this.constants_.CURSOR_RADIUS,style:"display: none","stroke-width":this.constants_.CURSOR_STROKE_WIDTH},this.markerSvg_),this.isCursor()){const e=this.getBlinkProperties_();w(te.ANIMATE,e,this.markerCircle)}return this.markerSvg_}applyColour_(e){super.applyColour_(e);let t;(t=this.markerCircle)==null||t.setAttribute("fill",this.colour_);let i;if((i=this.markerCircle)==null||i.setAttribute("stroke",this.colour_),this.isCursor()){e=this.colour_+";transparent;transparent;";let r;(r=this.markerCircle)==null||r.firstElementChild.setAttribute("values",e)}}},nu=class{constructor(e,t,i){this.markerSvg=this.cursorSvg=null,this.constants=i,this.style=t,this.svgRoot=e,this.svgPath=w(te.PATH,{class:"blocklyPath"},this.svgRoot)}setPath(e){this.svgPath.setAttribute("d",e)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)")}setCursorSvg(e){e?(this.svgRoot.appendChild(e),this.cursorSvg=e):this.cursorSvg=null}setMarkerSvg(e){e?(this.cursorSvg?this.svgRoot.insertBefore(e,this.cursorSvg):this.svgRoot.appendChild(e),this.markerSvg=e):this.markerSvg=null}applyColour(e){this.svgPath.setAttribute("stroke",this.style.colourTertiary),this.svgPath.setAttribute("fill",this.style.colourPrimary),this.updateShadow_(e.isShadow()),this.updateDisabled_(!e.isEnabled()||e.getInheritedDisabled())}setStyle(e){this.style=e}setClass_(e,t){e&&(t?I(this.svgRoot,e):A(this.svgRoot,e))}updateHighlighted(e){e?this.svgPath.setAttribute("filter","url(#"+this.constants.embossFilterId+")"):this.svgPath.setAttribute("filter","none")}updateShadow_(e){e&&(this.svgPath.setAttribute("stroke","none"),this.svgPath.setAttribute("fill",this.style.colourSecondary))}updateDisabled_(e){this.setClass_("blocklyDisabled",e),e&&this.svgPath.setAttribute("fill","url(#"+this.constants.disabledPatternId+")")}updateSelected(e){this.setClass_("blocklySelected",e)}updateDraggingDelete(e){this.setClass_("blocklyDraggingDelete",e)}updateInsertionMarker(e){this.setClass_("blocklyInsertionMarker",e)}updateMovable(e){this.setClass_("blocklyDraggable",e)}updateReplacementFade(e){this.setClass_("blocklyReplaceable",e)}updateShapeForInputHighlight(e,t){}},zT=class extends nu{constructor(e,t,i){super(e,t,i),this.svgPathSelected=null,this.outlines=new Map,this.remainingOutlines=new Set,this.outputShapeType=null,this.constants=i}setPath(e){super.setPath(e),this.svgPathSelected&&this.svgPathSelected.setAttribute("d",e)}applyColour(e){super.applyColour(e);const t=e.getParent();e.isShadow()&&t&&this.svgPath.setAttribute("stroke",t.style.colourTertiary);for(const i of this.outlines.values())i.setAttribute("fill",this.style.colourTertiary)}flipRTL(){super.flipRTL();for(const e of this.outlines.values())e.setAttribute("transform","scale(-1 1)")}updateSelected(e){this.setClass_("blocklySelected",e),e?this.svgPathSelected||(this.svgPathSelected=this.svgPath.cloneNode(!0),this.svgPathSelected.setAttribute("fill","none"),this.svgPathSelected.setAttribute("filter","url(#"+this.constants.selectedGlowFilterId+")"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}updateReplacementFade(e){this.setClass_("blocklyReplaceable",e),e?this.svgPath.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):this.svgPath.removeAttribute("filter")}updateShapeForInputHighlight(e,t){e=e.getParentInput().name,(e=this.getOutlinePath(e))&&(t?e.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):e.removeAttribute("filter"))}beginDrawing(){this.remainingOutlines.clear();for(const e of this.outlines.keys())this.remainingOutlines.add(e)}endDrawing(){if(this.remainingOutlines.size)for(const e of this.remainingOutlines)this.removeOutlinePath(e);this.remainingOutlines.clear()}setOutlinePath(e,t){e=this.getOutlinePath(e),e.setAttribute("d",t),e.setAttribute("fill",this.style.colourTertiary)}getOutlinePath(e){return this.outlines.has(e)||this.outlines.set(e,w(te.PATH,{class:"blocklyOutlinePath",d:""},this.svgRoot)),this.remainingOutlines.delete(e),this.outlines.get(e)}removeOutlinePath(e){let t,i;(t=this.outlines.get(e))==null||(i=t.parentNode)==null||i.removeChild(this.outlines.get(e)),this.outlines.delete(e)}},ac=class{constructor(e){this.overrides=null,this.name=e}getClassName(){return this.name+"-renderer"}init(e,t){this.constants_=this.makeConstants_(),t&&(this.overrides=t,Object.assign(this.constants_,t)),this.constants_.setTheme(e),this.constants_.init()}createDom(e,t){this.constants_.createDom(e,this.name+"-"+t.name,"."+this.getClassName()+"."+t.getClassName())}refreshDom(e,t){const i=this.getConstants();i.dispose(),this.constants_=this.makeConstants_(),this.overrides&&Object.assign(this.constants_,this.overrides),this.constants_.randomIdentifier=i.randomIdentifier,this.constants_.setTheme(t),this.constants_.init(),this.createDom(e,t)}dispose(){this.constants_&&this.constants_.dispose()}makeConstants_(){return new oc}makeRenderInfo_(e){return new zr(this,e)}makeDrawer_(e,t){return new sc(e,t)}makeMarkerDrawer(e,t){return new P$(e,this.getConstants(),t)}makePathObject(e,t){return new nu(e,t,this.constants_)}getConstants(){return this.constants_}shouldHighlightConnection(e){return!0}orphanCanConnectAtEnd(e,t,i){return!!St.getConnectionForOrphanedConnection(e,i===qe.OUTPUT_VALUE?t.outputConnection:t.previousConnection)}getConnectionPreviewMethod(e,t,i){return t.type===qe.OUTPUT_VALUE||t.type===qe.PREVIOUS_STATEMENT?!e.isConnected()||this.orphanCanConnectAtEnd(i,e.targetBlock(),t.type)?es.PREVIEW_TYPE.INSERTION_MARKER:es.PREVIEW_TYPE.REPLACEMENT_FADE:es.PREVIEW_TYPE.INSERTION_MARKER}render(e){const t=this.makeRenderInfo_(e);t.measure(),this.makeDrawer_(e,t).draw()}},Nt={};Nt.BottomRow=A$,Nt.Connection=Dn,Nt.ConstantProvider=oc,Nt.Drawer=sc,Nt.ExternalValueInput=su,Nt.Field=Wr,Nt.Hat=L$,Nt.Icon=DT,Nt.InRowSpacer=os,Nt.InlineInput=N$,Nt.InputConnection=ji,Nt.InputRow=w$,Nt.JaggedEdge=PT,Nt.MarkerSvg=P$,Nt.Measurable=js,Nt.NextConnection=xT,Nt.OutputConnection=BT,Nt.PathObject=nu,Nt.PreviousConnection=FT,Nt.RenderInfo=zr,Nt.Renderer=ac,Nt.RoundCorner=lc,Nt.Row=nc,Nt.SpacerRow=M$,Nt.SquareCorner=cc,Nt.StatementInput=rc,Nt.TopRow=D$,Nt.Types=q,Nt.init=Dh,Nt.register=mr,Nt.unregister=rm;var XT=class extends ac{constructor(e){super(e)}makeConstants_(){return new wT}makeRenderInfo_(e){return new GT(this,e)}makeDrawer_(e,t){return new MT(e,t)}makeMarkerDrawer(e,t){return new WT(e,this.getConstants(),t)}makePathObject(e,t){return new zT(e,t,this.getConstants())}getConstants(){return this.constants_}shouldHighlightConnection(e){return e.type!==qe.INPUT_VALUE&&e.type!==qe.OUTPUT_VALUE}getConnectionPreviewMethod(e,t,i){return t.type===qe.OUTPUT_VALUE?e.isConnected()?es.PREVIEW_TYPE.REPLACEMENT_FADE:es.PREVIEW_TYPE.INPUT_OUTLINE:super.getConnectionPreviewMethod(e,t,i)}};mr("zelos",XT);var Is={};Is.BottomRow=UT,Is.ConstantProvider=wT,Is.Drawer=MT,Is.MarkerSvg=WT,Is.PathObject=zT,Is.RenderInfo=GT,Is.Renderer=XT,Is.RightConnectionShape=HT,Is.StatementInput=iu,Is.TopRow=VT,qh();var No={};No.registerCleanup=Bh,No.registerCollapse=Uh,No.registerCollapseExpandBlock=jh,No.registerComment=zh,No.registerDefaultOptions=qh,No.registerDelete=Kh,No.registerDeleteAll=Gh,No.registerDisable=Yh,No.registerDuplicate=Wh,No.registerExpand=Hh,No.registerHelp=Qh,No.registerInline=Xh,No.registerRedo=xh,No.registerUndo=Ph;var jT=class{constructor(){}onDragEnter(e){}onDragOver(e){}onDragExit(e){}onDrop(e){}getClientRect(){return null}shouldPreventMove(e){return!1}},ru=class extends jT{constructor(){super(),this.wouldDelete_=!1}wouldDelete(e,t){return e instanceof ts?(e=!e.getParent()&&e.isDeletable(),this.updateWouldDelete_(e&&!t)):this.updateWouldDelete_(e.isDeletable()),this.wouldDelete_}updateWouldDelete_(e){this.wouldDelete_=e}},mt=class extends ic{constructor(e,t,i){super(bt.SKIP_SETUP),this.clockwise=mt.CLOCKWISE,this.offset=mt.OFFSET,this.wrap=mt.WRAP,this.round=mt.ROUND,this.boundEvents=[],this.symbol_=this.gauge=this.line=null,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){switch(super.configure_(e),e.mode){case lu.COMPASS:this.clockwise=!0,this.offset=90;break;case lu.PROTRACTOR:this.clockwise=!1,this.offset=0}e.clockwise&&(this.clockwise=e.clockwise),e.offset&&(this.offset=e.offset),e.wrap&&(this.wrap=e.wrap),e.round&&(this.round=e.round)}initView(){super.initView(),this.symbol_=w(te.TSPAN,{}),this.symbol_.appendChild(document.createTextNode("°")),this.getTextElement().appendChild(this.symbol_)}render_(){super.render_(),this.updateGraph()}showEditor_(e){super.showEditor_(e,Lp||xa||kr),e=this.dropdownCreate(),dr().appendChild(e),this.sourceBlock_ instanceof ts&&Kc(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary),yl(this,this.dropdownDispose.bind(this)),this.updateGraph()}dropdownCreate(){const e=w(te.SVG,{xmlns:Aa,"xmlns:html":ui,"xmlns:xlink":us,version:"1.1",height:2*mt.HALF+"px",width:2*mt.HALF+"px",style:"touch-action: none"}),t=w(te.CIRCLE,{cx:mt.HALF,cy:mt.HALF,r:mt.RADIUS,class:"blocklyAngleCircle"},e);this.gauge=w(te.PATH,{class:"blocklyAngleGauge"},e),this.line=w(te.LINE,{x1:mt.HALF,y1:mt.HALF,class:"blocklyAngleLine"},e);for(let i=0;360>i;i+=15)w(te.LINE,{x1:mt.HALF+mt.RADIUS,y1:mt.HALF,x2:mt.HALF+mt.RADIUS-(i%45===0?10:5),y2:mt.HALF,class:"blocklyAngleMarks",transform:"rotate("+i+","+mt.HALF+","+mt.HALF+")"},e);return this.boundEvents.push(Be(e,"click",this,this.hide)),this.boundEvents.push(Be(t,"pointerdown",this,this.onMouseMove_,!0)),this.boundEvents.push(Be(t,"pointermove",this,this.onMouseMove_,!0)),e}dropdownDispose(){for(const e of this.boundEvents)Dt(e);this.boundEvents.length=0,this.line=this.gauge=null}hide(){hr(this),as()}onMouseMove_(e){var t=this.gauge.ownerSVGElement.getBoundingClientRect();const i=e.clientX-t.left-mt.HALF;e=e.clientY-t.top-mt.HALF,t=Math.atan(-e/i),isNaN(t)||(t=xd(t),0>i?t+=180:0e&&(e+=360),e>this.wrap&&(e-=360),e}static fromJson(e){return new this(e.angle,void 0,e)}};mt.HALF=50,mt.RADIUS=mt.HALF-1,mt.CLOCKWISE=!1,mt.OFFSET=0,mt.WRAP=360,mt.ROUND=15,Jo("field_angle",mt),mt.prototype.DEFAULT_VALUE=0,cs(` +.blocklyAngleCircle { + stroke: #444; + stroke-width: 1; + fill: #ddd; + fill-opacity: 0.8; +} + +.blocklyAngleMarks { + stroke: #444; + stroke-width: 1; +} + +.blocklyAngleGauge { + fill: #f88; + fill-opacity: 0.8; + pointer-events: none; +} + +.blocklyAngleLine { + stroke: #f00; + stroke-width: 2; + stroke-linecap: round; + pointer-events: none; +} +`);var lu;(function(e){e.COMPASS="compass",e.PROTRACTOR="protractor"})(lu||(lu={}));var xn=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.SERIALIZABLE=!0,this.CURSOR="default",this.value_=this.value_,this.checkChar=xn.CHECK_CHAR,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.checkCharacter&&(this.checkChar=e.checkCharacter)}saveState(){const e=this.saveLegacyState(xn);return e!==null?e:this.getValueBoolean()}initView(){super.initView();const e=this.getTextElement();I(e,"blocklyCheckbox"),e.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_()),this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar}setCheckCharacter(e){this.checkChar=e||xn.CHECK_CHAR,this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(e){return e===!0||e==="TRUE"?"TRUE":e===!1||e==="FALSE"?"FALSE":null}doValueUpdate_(e){this.value_=this.convertValueToBool_(e),this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(e){return typeof e=="string"?e==="TRUE":!!e}static fromJson(e){return new this(e.checked,void 0,e)}};xn.CHECK_CHAR="✓",Jo("field_checkbox",xn),xn.prototype.DEFAULT_VALUE=!1;var ss=class extends bt{constructor(e,t,i){super(bt.SKIP_SETUP),this.highlightedIndex=this.picker=null,this.boundEvents=[],this.SERIALIZABLE=!0,this.CURSOR="default",this.isDirty_=!1,this.titles=this.colours=null,this.columns=0,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.colourOptions&&(this.colours=e.colourOptions),e.colourTitles&&(this.titles=e.colourTitles),e.columns&&(this.columns=e.columns)}initView(){this.size_=new Vt(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT),this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof ts&&(this.clickTarget_=this.sourceBlock_.getSvgRoot()):(this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1")}applyColour(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof ts&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())}doClassValidation_(e){return typeof e!="string"?null:Di(e)}doValueUpdate_(e){this.value_=e,this.borderRect_?this.borderRect_.style.fill=e:this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_ instanceof ts&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",e),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))}getText(){let e=this.value_;return/^#(.)\1(.)\2(.)\3$/.test(e)&&(e="#"+e[1]+e[3]+e[5]),e}setColours(e,t){return this.colours=e,t&&(this.titles=t),this}setColumns(e){return this.columns=e,this}showEditor_(){this.dropdownCreate(),dr().appendChild(this.picker),yl(this,this.dropdownDispose.bind(this)),this.picker.focus({preventScroll:!0})}onClick(e){e=(e=e.target)&&e.getAttribute("data-colour"),e!==null&&(this.setValue(e),hr(this))}onKeyDown(e){let t=!0;var i;switch(e.key){case"ArrowUp":this.moveHighlightBy(0,-1);break;case"ArrowDown":this.moveHighlightBy(0,1);break;case"ArrowLeft":this.moveHighlightBy(-1,0);break;case"ArrowRight":this.moveHighlightBy(1,0);break;case"Enter":(i=this.getHighlighted())&&(i=i.getAttribute("data-colour"),i!==null&&this.setValue(i)),fs();break;default:t=!1}t&&e.stopPropagation()}moveHighlightBy(e,t){if(this.highlightedIndex){var i=this.colours||ss.COLOURS,r=this.columns||ss.COLUMNS,c=this.highlightedIndex%r,$=Math.floor(this.highlightedIndex/r);c+=e,$+=t,0>e?0>c&&0<$?(c=r-1,$--):0>c&&(c=0):0r-1&&$r-1&&c--:0>t?0>$&&($=0):0Math.floor(i.length/r)-1&&($=Math.floor(i.length/r)-1),this.setHighlightedCell(this.picker.childNodes[$].childNodes[c],$*r+c)}}onMouseMove(e){const t=(e=e.target)&&Number(e.getAttribute("data-index"));t!==null&&t!==this.highlightedIndex&&this.setHighlightedCell(e,t)}onMouseEnter(){let e;(e=this.picker)==null||e.focus({preventScroll:!0})}onMouseLeave(){var e;(e=this.picker)==null||e.blur(),(e=this.getHighlighted())&&A(e,"blocklyColourHighlighted")}getHighlighted(){if(!this.highlightedIndex)return null;const e=this.columns||ss.COLUMNS,t=this.picker.childNodes[Math.floor(this.highlightedIndex/e)];return t?t.childNodes[this.highlightedIndex%e]:null}setHighlightedCell(e,t){const i=this.getHighlighted();i&&A(i,"blocklyColourHighlighted"),I(e,"blocklyColourHighlighted"),this.highlightedIndex=t,(e=e.getAttribute("id"))&&this.picker&&Xt(this.picker,Gt.ACTIVEDESCENDANT,e)}dropdownCreate(){const e=this.columns||ss.COLUMNS,t=this.colours||ss.COLOURS,i=this.titles||ss.TITLES,r=this.getValue(),c=document.createElement("table");c.className="blocklyColourTable",c.tabIndex=0,c.dir="ltr",ms(c,Vo.GRID),Xt(c,Gt.EXPANDED,!0),Xt(c,Gt.ROWCOUNT,Math.floor(t.length/e)),Xt(c,Gt.COLCOUNT,e);let $;for(let v=0;vtr>td { + border: 0.5px solid #888; + box-sizing: border-box; + cursor: pointer; + display: inline-block; + height: 20px; + padding: 0; + width: 20px; +} + +.blocklyColourTable>tr>td.blocklyColourHighlighted { + border-color: #eee; + box-shadow: 2px 2px 7px 2px rgba(0, 0, 0, 0.3); + position: relative; +} + +.blocklyColourSelected, .blocklyColourSelected:hover { + border-color: #eee !important; + outline: 1px solid #333; + position: relative; +} +`);var YT=class extends wn{constructor(e,t,i){super(String(e??""),t,i),this.EDITABLE=!1,this.SERIALIZABLE=!0}static fromJson(e){return new this(Zt(e.text),void 0,e)}};Jo("field_label_serializable",YT);var x$=class extends Gr{constructor(e,t,i){super(bt.SKIP_SETUP),this.textGroup=null,this.maxLines_=1/0,this.isOverflowedY_=!1,e!==bt.SKIP_SETUP&&(i&&this.configure_(i),this.setValue(e),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.maxLines&&this.setMaxLines(e.maxLines)}toXml(e){return e.textContent=this.getValue().replace(/\n/g," "),e}fromXml(e){this.setValue(e.textContent.replace(/ /g,` +`))}saveState(){const e=this.saveLegacyState(x$);return e!==null?e:this.getValue()}loadState(e){this.loadLegacyState(bt,e)||this.setValue(e)}initView(){this.createBorderRect_(),this.textGroup=w(te.G,{class:"blocklyEditableText"},this.fieldGroup_)}getDisplayText_(){const e=this.getSourceBlock();if(!e)throw new io;let t=this.getText();if(!t)return bt.NBSP;const i=t.split(` +`);t="";const r=this.isOverflowedY_?this.maxLines_:i.length;for(let c=0;cthis.maxDisplayLength?$=$.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&c===r-1&&($=$.substring(0,$.length-3)+"..."),$=$.replace(/\s/g,bt.NBSP),t+=$,c!==r-1&&(t+=` +`)}return e.RTL&&(t+="‏"),t}doValueUpdate_(e){super.doValueUpdate_(e),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` +`).length>this.maxLines_)}render_(){var e=this.getSourceBlock();if(!e)throw new io;for(var t,i=this.textGroup;t=i.firstChild;)i.removeChild(t);t=this.getDisplayText_().split(` +`);let r=0;for(let c=0;cc&&(c=H),$+=this.getConstants().FIELD_TEXT_HEIGHT+(0this.maxDisplayLength&&(e[H]=e[H].substring(0,this.maxDisplayLength)),v.textContent=e[H];const Oe=Ne(v,t,i,r);Oe>c&&(c=Oe)}c+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&($+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,c+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",`${c}`),this.borderRect_.setAttribute("height",`${$}`)),this.size_.width=c,this.size_.height=$,this.positionBorderRect_()}showEditor_(e,t){super.showEditor_(e,t),this.forceRerender()}widgetCreate_(){const e=fn(),t=this.workspace_.getScale(),i=document.createElement("textarea");i.className="blocklyHtmlInput blocklyHtmlTextAreaInput",i.setAttribute("spellcheck",String(this.spellcheck_));var r=this.getConstants().FIELD_TEXT_FONTSIZE*t+"pt";e.style.fontSize=r,i.style.fontSize=r,i.style.borderRadius=Gr.BORDERRADIUS*t+"px",r=this.getConstants().FIELD_BORDER_RECT_X_PADDING*t;const c=this.getConstants().FIELD_BORDER_RECT_Y_PADDING*t/2;return i.style.padding=c+"px "+r+"px "+c+"px "+r+"px",r=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,i.style.lineHeight=r*t+"px",e.appendChild(i),i.value=i.defaultValue=this.getEditorText_(this.value_),i.setAttribute("data-untyped-default-value",String(this.value_)),i.setAttribute("data-old-value",""),kp?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),this.bindInputEvents_(i),i}setMaxLines(e){typeof e=="number"&&0this.max_&&(e.max=`${this.max_}`,Xt(e,Gt.VALUEMAX,this.max_)),e}static fromJson(e){return new this(e.value,void 0,void 0,void 0,void 0,e)}};Jo("field_number",B$),B$.prototype.DEFAULT_VALUE=0;var uc=class extends Ws{constructor(e,t,i,r,c){super(bt.SKIP_SETUP),this.defaultType="",this.variableTypes=[],this.variable=null,this.SERIALIZABLE=!0,this.menuGenerator_=uc.dropdownCreate,this.defaultVariableName=typeof e=="string"?e:"",this.size_=new Vt(0,0),e!==bt.SKIP_SETUP&&(c?this.configure_(c):this.setTypes(i,r),t&&this.setValidator(t))}configure_(e){super.configure_(e),this.setTypes(e.variableTypes,e.defaultType)}initModel(){var e=this.getSourceBlock();if(!e)throw new io;this.variable||(e=s.getOrCreateVariablePackage$$module$build$src$core$variables(e.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(e.getId()))}shouldAddBorderRect_(){const e=this.getSourceBlock();if(!e)throw new io;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||e.type!=="variables_get")}fromXml(e){var t=this.getSourceBlock();if(!t)throw new io;const i=e.getAttribute("id"),r=e.textContent,c=e.getAttribute("variabletype")||e.getAttribute("variableType")||"";if(t=s.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,i,r,c),c!==null&&c!==t.type)throw Error("Serialized variable type with id '"+t.getId()+"' had type "+t.type+", and does not match variable field that references it: "+Ps(e)+".");this.setValue(t.getId())}toXml(e){return this.initModel(),e.id=this.variable.getId(),e.textContent=this.variable.name,this.variable.type&&e.setAttribute("variabletype",this.variable.type),e}saveState(e){var t=this.saveLegacyState(uc);return t!==null||(this.initModel(),t={id:this.variable.getId()},e&&(t.name=this.variable.name,t.type=this.variable.type)),t}loadState(e){const t=this.getSourceBlock();if(!t)throw new io;this.loadLegacyState(uc,e)||(e=s.getOrCreateVariablePackage$$module$build$src$core$variables(t.workspace,e.id||null,e.name,e.type||""),this.setValue(e.getId()))}setSourceBlock(e){if(e.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(e)}getValue(){return this.variable?this.variable.getId():null}getText(){return this.variable?this.variable.name:""}getVariable(){return this.variable}getValidator(){return this.variable?this.validator_:null}doClassValidation_(e){if(e===null)return null;var t=this.getSourceBlock();if(!t)throw new io;return t=s.getVariable$$module$build$src$core$variables(t.workspace,e),t?(t=t.type,this.typeIsAllowed(t)?e:(console.warn("Variable type doesn't match this field! Type was "+t),null)):(console.warn("Variable id doesn't point to a real variable! ID was "+e),null)}doValueUpdate_(e){const t=this.getSourceBlock();if(!t)throw new io;this.variable=s.getVariable$$module$build$src$core$variables(t.workspace,e),super.doValueUpdate_(e)}typeIsAllowed(e){const t=this.getVariableTypes();if(!t)return!0;for(let i=0;i(this.flyout?s.config$$module$build$src$core$config.flyoutDragRadius:s.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let e;if(!this.targetBlock||(e=this.flyout)==null||!e.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error(`Cannot update dragging from the flyout because the ' + + 'flyout's target workspace is undefined`);return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_=this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),this.targetBlock.select(),!0):!1}updateIsDraggingBubble(){return this.startBubble?(this.startDraggingBubble(),!0):!1}updateIsDraggingBlock(){if(!this.targetBlock)return!1;if(this.flyout){if(this.updateIsDraggingFromFlyout())return this.startDraggingBlock(),!0}else if(this.targetBlock.isMovable())return this.startDraggingBlock(),!0;return!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined");(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())&&(this.workspaceDragger=new QT(this.startWorkspace_),this.workspaceDragger.startDrag())}updateIsDragging(){if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging=!0,this.updateIsDraggingBubble()||this.updateIsDraggingBlock()||this.updateIsDraggingWorkspace()}startDraggingBlock(){this.blockDragger=new(C(Ae.BLOCK_DRAGGER,this.creatorWorkspace.options,!0))(this.targetBlock,this.startWorkspace_),this.blockDragger.startDrag(this.currentDragDeltaXY,this.healStack),this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY)}startDraggingBubble(){if(!this.startBubble)throw Error("Cannot update dragging the bubble because the start bubble is undefined");if(!this.startWorkspace_)throw Error("Cannot update dragging the bubble because the start workspace is undefined");this.bubbleDragger=new LT(this.startBubble,this.startWorkspace_),this.bubbleDragger.startBubbleDrag(),this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY)}doStart(e){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch,bl(e)?this.cancel():(this.gestureHasStarted=!0,gr(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(),this.currentDropdownOwner=Ud(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=e,ih(),this.targetBlock&&this.targetBlock.select(),Ai(e)?this.handleRightClick(e):(e.type.toLowerCase()==="pointerdown"&&e.pointerType!=="mouse"&&V(e,this),this.mouseDownXY=new Ue(e.clientX,e.clientY),this.healStack=e.altKey||e.ctrlKey||e.metaKey,this.bindMouseEvents(e),this.isEnding_||this.handleTouchStart(e)))}bindMouseEvents(e){this.boundEvents.push(Be(document,"pointerdown",null,this.handleStart.bind(this),!0)),this.boundEvents.push(Be(document,"pointermove",null,this.handleMove.bind(this),!0)),this.boundEvents.push(Be(document,"pointerup",null,this.handleUp.bind(this),!0)),e.preventDefault(),e.stopPropagation()}handleStart(e){this.isDragging()||(this.handleTouchStart(e),this.isMultiTouch()&&ve())}handleMove(e){this.isDragging()&&rt(e)||!this.isMultiTouch()?(this.updateFromEvent(e),this.workspaceDragger?this.workspaceDragger.drag(this.currentDragDeltaXY):this.blockDragger?this.blockDragger.drag(this.mostRecentEvent,this.currentDragDeltaXY):this.bubbleDragger&&this.bubbleDragger.dragBubble(this.mostRecentEvent,this.currentDragDeltaXY),e.preventDefault(),e.stopPropagation()):this.isMultiTouch()&&(this.handleTouchMove(e),ve())}handleUp(e){if(this.isDragging()||this.handleTouchEnd(e),!this.isMultiTouch()||this.isDragging()){if(!rt(e))return;if(this.updateFromEvent(e),ve(),this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0,this.bubbleDragger?this.bubbleDragger.endBubbleDrag(e,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(e,this.currentDragDeltaXY):this.workspaceDragger?this.workspaceDragger.endDrag(this.currentDragDeltaXY):this.isBubbleClick()?this.doBubbleClick():this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(e)}e.preventDefault(),e.stopPropagation(),this.dispose()}handleTouchStart(e){var t=Mt(e);this.cachedPoints.set(t,this.getTouchPoint(e));var i=Array.from(this.cachedPoints.keys());i.length===2&&(t=this.cachedPoints.get(i[0]),i=this.cachedPoints.get(i[1]),this.startDistance=Ue.distance(t,i),this.isMultiTouch_=!0,e.preventDefault())}handleTouchMove(e){const t=Mt(e);this.cachedPoints.set(t,this.getTouchPoint(e)),this.isPinchZoomEnabled&&this.cachedPoints.size===2?this.handlePinch(e):this.handleMove(e)}handlePinch(e){var t=Array.from(this.cachedPoints.keys()),i=this.cachedPoints.get(t[0]);if(t=this.cachedPoints.get(t[1]),i=Ue.distance(i,t)/this.startDistance,0this.previousScale){if(t=i-this.previousScale,t=0this.cachedPoints.size&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(e){return this.startWorkspace_?new Ue(e.pageX,e.pageY):null}isMultiTouch(){return this.isMultiTouch_}cancel(){this.isEnding_||(ve(),this.bubbleDragger?this.bubbleDragger.endBubbleDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.blockDragger?this.blockDragger.endDrag(this.mostRecentEvent,this.currentDragDeltaXY):this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY),this.dispose())}handleRightClick(e){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(e)):this.startBubble?this.startBubble.showContextMenu(e):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),this.startWorkspace_.showContextMenu(e)),e.preventDefault(),e.stopPropagation(),this.dispose()}handleWsStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(t),this.mostRecentEvent=e,this.doStart(e)}fireWorkspaceClick(e){re(new(we(ai))(null,e.id,"workspace"))}handleFlyoutStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(t),this.handleWsStart(e,t.getWorkspace())}handleBlockStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started.");this.setStartBlock(t),this.mostRecentEvent=e}handleBubbleStart(e,t){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(t),this.mostRecentEvent=e}doBubbleClick(){this.startBubble instanceof yo&&(this.startBubble.setFocus(),this.startBubble.select())}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined");this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent),this.bringBlockToFront()}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");this.targetBlock.isEnabled()&&(s.getGroup$$module$build$src$core$events$utils()||s.setGroup$$module$build$src$core$events$utils(!0),this.flyout.createBlock(this.targetBlock).scheduleSnapAndBump())}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");const e=new(we(ai))(this.startBlock,this.startWorkspace_.id,"block");re(e)}this.bringBlockToFront(),s.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(e){e=this.creatorWorkspace,Z()&&Z().unselect(),this.fireWorkspaceClick(this.startWorkspace_||e)}bringBlockToFront(){this.targetBlock&&!this.flyout&&this.targetBlock.bringToFront()}setStartField(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=e)}setStartIcon(e){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started.");this.startIcon||(this.startIcon=e)}setStartBubble(e){this.startBubble||(this.startBubble=e)}setStartBlock(e){this.startBlock||this.startBubble||(this.startBlock=e,e.isInFlyout&&e!==e.getRootBlock()?this.setTargetBlock(e.getRootBlock()):this.setTargetBlock(e))}setTargetBlock(e){e.isShadow()?this.setTargetBlock(e.getParent()):this.targetBlock=e}setStartWorkspace(e){this.startWorkspace_||(this.startWorkspace_=e)}setStartFlyout(e){this.flyout||(this.flyout=e)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return(this.startField?this.startField.isClickable():!1)&&!this.hasExceededDragRadius&&(!this.flyout||!this.flyout.autoClose)}isIconClick(){return!!this.startIcon&&!this.hasExceededDragRadius}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}isDragging(){return!!this.workspaceDragger||!!this.blockDragger||!!this.bubbleDragger}hasStarted(){return this.gestureHasStarted}getInsertionMarkers(){return this.blockDragger?this.blockDragger.getInsertionMarkers():[]}getCurrentDragger(){let e,t;return(t=(e=this.blockDragger)!=null?e:this.workspaceDragger)!=null?t:this.bubbleDragger}static inProgress(){const e=P();for(let t=0,i;i=e[t];t++)if(i.currentGesture_)return!0;return!1}},H$=class{constructor(e,t){this.pattern=e;let i;this.spacing=(i=t.spacing)!=null?i:0;let r;this.length=(r=t.length)!=null?r:1,this.line2=(this.line1=e.firstChild)&&this.line1.nextSibling;let c;this.snapToGrid=(c=t.snap)!=null?c:!1}shouldSnap(){return this.snapToGrid}getSpacing(){return this.spacing}getPatternId(){return this.pattern.id}update(e){var t=this.spacing*e;this.pattern.setAttribute("width",`${t}`),this.pattern.setAttribute("height",`${t}`),t=Math.floor(this.spacing/2)+.5;let i=t-this.length/2,r=t+this.length/2;t*=e,i*=e,r*=e,this.setLineAttributes(this.line1,e,i,r,t,t),this.setLineAttributes(this.line2,e,t,t,i,r)}setLineAttributes(e,t,i,r,c,$){e&&(e.setAttribute("stroke-width",`${t}`),e.setAttribute("x1",`${i}`),e.setAttribute("y1",`${c}`),e.setAttribute("x2",`${r}`),e.setAttribute("y2",`${$}`))}moveTo(e,t){this.pattern.setAttribute("x",`${e}`),this.pattern.setAttribute("y",`${t}`)}static createDom(e,t,i){e=w(te.PATTERN,{id:"blocklyGridPattern"+e,patternUnits:"userSpaceOnUse"},i);let r,c;if(0<((r=t.length)!=null?r:1)&&0<((c=t.spacing)!=null?c:0)){w(te.LINE,{stroke:t.colour},e);let $;($=t.length)!=null&&$&&w(te.LINE,{stroke:t.colour},e)}else w(te.LINE,{},e);return e}};s.Names$$module$build$src$core$names=class{constructor(e,t){this.db=new Map,this.dbReverse=new Set,this.variableMap=null,this.variablePrefix=t||"",this.reservedWords=new Set(e?e.split(","):[])}reset(){this.db.clear(),this.dbReverse.clear(),this.variableMap=null}setVariableMap(e){this.variableMap=e}getNameForUserVariable(e){return this.variableMap?(e=this.variableMap.getVariableById(e))?e.name:null:(console.warn(`Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function: +Blockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());`),null)}populateVariables(e){e=s.allUsedVarModels$$module$build$src$core$variables(e);for(let t=0;t{c&&t&&this.deleteVariableInternal(t,r)})):this.deleteVariableInternal(t,r)}else console.warn("Can't delete non-existent variable: "+e)}deleteVariableInternal(e,t){const i=s.getGroup$$module$build$src$core$events$utils();i||s.setGroup$$module$build$src$core$events$utils(!0);try{for(let r=0;re.name)}getVariableUsesById(e){const t=[],i=this.workspace.getAllBlocks(!1);for(let r=0;rthis.remainingCapacityOfType(i))return!1;t+=e[i]}return!(t>this.remainingCapacity())}hasBlockLimits(){return this.options.maxBlocks!==1/0||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(e){var t=e?this.redoStack_:this.undoStack_,i=e?this.undoStack_:this.redoStack_;const r=t.pop();if(r){for(var c=[r];t.length&&r.group&&r.group===t[t.length-1].group;){const $=t.pop();$&&c.push($)}for(t=0;tthis.MAX_UNDO&&0<=this.MAX_UNDO;)this.undoStack_.shift();for(let t=0;timage, .blocklyZoom>svg>image { + opacity: .4; +} + +.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover { + opacity: .6; +} + +.blocklyZoom>image:active, .blocklyZoom>svg>image:active { + opacity: .8; +} +`);var BS=20,Cs=class extends dc{constructor(e){super(e),this.resizeHandlerWrapper=null,this.resizesEnabled=this.isVisible_=this.rendered=!0,this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0,this.dragDeltaXY=null,this.oldScale=this.scale=1,this.oldLeft=this.oldTop=0,this.inverseScreenCTM=this.targetWorkspace=this.configureContextMenu=this.lastRecordedPageScroll=this.injectionDiv=this.currentGesture_=this.toolbox_=this.flyout=this.scrollbar=this.trashcan=null,this.inverseScreenCTMDirty=!0,this.highlightedBlocks=[],this.toolboxCategoryCallbacks=new Map,this.flyoutButtonCallbacks=new Map,this.cachedParentSvg=null,this.keyboardAccessibilityMode=!1,this.topBoundedElements=[],this.dragTargetAreas=[],this.zoomControls_=null,this.metricsManager=new(C(Ae.METRICS_MANAGER,e,!0))(this),this.getMetrics=e.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager),this.setMetrics=e.setMetrics||Cs.setTopLevelWorkspaceMetrics_,this.componentManager=new fo,this.connectionDBList=Vr.init(this.connectionChecker),this.audioManager=new ZT(e.parentWorkspace),this.grid=this.options.gridPattern?new H$(this.options.gridPattern,e.gridOptions):null,this.markerManager=new zl(this),ao&&ze&&this.registerToolboxCategoryCallback(Op,ze),Ki&&ma&&this.registerToolboxCategoryCallback(V$,ma),Eo&&fa&&(this.registerToolboxCategoryCallback(cu,fa),this.addChangeListener(tp)),this.themeManager_=this.options.parentWorkspace?this.options.parentWorkspace.getThemeManager():new JT(this,this.options.theme||Qa),this.themeManager_.subscribeWorkspace(this);let t;this.renderer=Dh(this.options.renderer||"geras",this.getTheme(),(t=this.options.rendererOverrides)!=null?t:void 0),this.cachedParentSvgSize=new Vt(0,0)}getMarkerManager(){return this.markerManager}getMetricsManager(){return this.metricsManager}setMetricsManager(e){this.metricsManager=e,this.getMetrics=this.metricsManager.getMetrics.bind(this.metricsManager)}getComponentManager(){return this.componentManager}setCursorSvg(e){this.markerManager.setCursorSvg(e)}setMarkerSvg(e){this.markerManager.setMarkerSvg(e)}getMarker(e){return this.markerManager?this.markerManager.getMarker(e):null}getCursor(){return this.markerManager?this.markerManager.getCursor():null}getRenderer(){return this.renderer}getThemeManager(){return this.themeManager_}getTheme(){return this.themeManager_.getTheme()}setTheme(e){e||(e=Qa),this.themeManager_.setTheme(e)}refreshTheme(){this.svgGroup_&&this.renderer.refreshDom(this.svgGroup_,this.getTheme()),this.updateBlockStyles_(this.getAllBlocks(!1).filter(function(t){return!!t.getStyleName()})),this.refreshToolboxSelection(),this.toolbox_&&this.toolbox_.refreshTheme(),this.isVisible()&&this.setVisible(!0);const e=new(we(Cr))(this.getTheme().name,this.id);re(e)}updateBlockStyles_(e){for(let t=0,i;i=e[t];t++){const r=i.getStyleName();r&&i.setStyle(r)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const e=this.getParentSvg().getScreenCTM();e&&(this.inverseScreenCTM=e.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.isVisible_}getSvgXY(e){let t=0,i=0,r=1;(this.getCanvas().contains(e)||this.getBubbleCanvas().contains(e))&&(r=this.scale);do{const c=$n(e);(e===this.getCanvas()||e===this.getBubbleCanvas())&&(r=1),t+=c.x*r,i+=c.y*r,e=e.parentNode}while(e&&e!==this.getParentSvg());return new Ue(t,i)}getCachedParentSvgSize(){const e=this.cachedParentSvgSize;return new Vt(e.width,e.height)}getOriginOffsetInPixels(){return zc(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let e=this.svgGroup_;for(;e;){if((" "+(e.getAttribute("class")||"")+" ").indexOf(" injectionDiv ")!==-1){this.injectionDiv=e;break}e=e.parentNode}}return this.injectionDiv}getBlockCanvas(){return this.svgBlockCanvas_}setResizeHandlerWrapper(e){this.resizeHandlerWrapper=e}createDom(e){return this.svgGroup_=w(te.G,{class:"blocklyWorkspace"}),e&&(this.svgBackground_=w(te.RECT,{height:"100%",width:"100%",class:e},this.svgGroup_),e==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="url(#"+this.grid.getPatternId()+")":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill")),this.svgBlockCanvas_=w(te.G,{class:"blocklyBlockCanvas"},this.svgGroup_),this.svgBubbleCanvas_=w(te.G,{class:"blocklyBubbleCanvas"},this.svgGroup_),this.isFlyout||(Be(this.svgGroup_,"pointerdown",this,this.onMouseDown_,!1),document.body.addEventListener("wheel",function(){}),Be(this.svgGroup_,"wheel",this,this.onMouseWheel_)),this.options.hasCategories&&(this.toolbox_=new(C(Ae.TOOLBOX,this.options,!0))(this)),this.grid&&this.grid.update(this.scale),this.recordDragTargets(),(e=C(Ae.CURSOR,this.options))&&this.markerManager.setCursor(new e),this.renderer.createDom(this.svgGroup_,this.getTheme()),this.svgGroup_}dispose(){if(this.rendered=!1,this.currentGesture_&&this.currentGesture_.cancel(),this.svgGroup_&&U(this.svgGroup_),this.toolbox_&&(this.toolbox_.dispose(),this.toolbox_=null),this.flyout&&(this.flyout.dispose(),this.flyout=null),this.trashcan&&(this.trashcan.dispose(),this.trashcan=null),this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null),this.zoomControls_&&this.zoomControls_.dispose(),this.audioManager&&this.audioManager.dispose(),this.grid&&(this.grid=null),this.renderer.dispose(),this.markerManager&&this.markerManager.dispose(),super.dispose(),this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose()),this.connectionDBList.length=0,this.toolboxCategoryCallbacks.clear(),this.flyoutButtonCallbacks.clear(),!this.options.parentWorkspace){const e=this.getParentSvg();e&&e.parentNode&&U(e.parentNode)}this.resizeHandlerWrapper&&(Dt(this.resizeHandlerWrapper),this.resizeHandlerWrapper=null)}addTrashcan(){this.trashcan=Cs.newTrashcan(this);const e=this.trashcan.createDom();this.svgGroup_.insertBefore(e,this.svgBlockCanvas_)}static newTrashcan(e){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts")}addZoomControls(){this.zoomControls_=new eE(this);const e=this.zoomControls_.createDom();this.svgGroup_.appendChild(e)}addFlyout(e){const t=new hs({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,move:{scrollbars:!0}});return t.toolboxPosition=this.options.toolboxPosition,this.flyout=this.horizontalLayout?new(C(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(t):new(C(Ae.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(t),this.flyout.autoClose=!1,this.flyout.getWorkspace().setVisible(!0),this.flyout.createDom(e)}getFlyout(e){return this.flyout||e?this.flyout:this.toolbox_?this.toolbox_.getFlyout():null}getToolbox(){return this.toolbox_}updateScreenCalculations_(){this.updateInverseScreenCTM(),this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox_&&this.toolbox_.position(),this.flyout&&this.flyout.position();const e=this.componentManager.getComponents(fo.Capability.POSITIONABLE,!0),t=this.getMetricsManager().getUiMetrics(),i=[];for(let r=0,c;c=e[r];r++){c.position(t,i);const $=c.getBoundingRectangle();$&&i.push($)}this.scrollbar&&this.scrollbar.resize(),this.updateScreenCalculations_()}updateScreenCalculationsIfScrolled(){const e=vd();Ue.equals(this.lastRecordedPageScroll,e)||(this.lastRecordedPageScroll=e,this.updateScreenCalculations_())}getCanvas(){return this.svgBlockCanvas_}setCachedParentSvgSize(e,t){const i=this.getParentSvg();e!=null&&(this.cachedParentSvgSize.width=e,i.setAttribute("data-cached-width",`${e}`)),t!=null&&(this.cachedParentSvgSize.height=t,i.setAttribute("data-cached-height",`${t}`))}getBubbleCanvas(){return this.svgBubbleCanvas_}getParentSvg(){if(!this.cachedParentSvg){let e=this.svgGroup_;for(;e;){if(e.tagName==="svg"){this.cachedParentSvg=e;break}e=e.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(_e()){var e=this.scale,t=-this.scrollY,i=-this.scrollX;if(!(e===this.oldScale&&1>Math.abs(t-this.oldTop)&&1>Math.abs(i-this.oldLeft))){var r=new(we(Ui))(t,i,e,this.id,this.oldScale);this.oldScale=e,this.oldTop=t,this.oldLeft=i,re(r)}}}translate(e,t){const i="translate("+e+","+t+") scale("+this.scale+")";this.svgBlockCanvas_.setAttribute("transform",i),this.svgBubbleCanvas_.setAttribute("transform",i),this.grid&&this.grid.moveTo(e,t),this.maybeFireViewportChangeEvent()}getWidth(){const e=this.getMetrics();return e?e.viewWidth/this.scale:0}setVisible(e){this.isVisible_=e,this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(e),this.getFlyout()&&this.getFlyout().setContainerVisible(e),this.getParentSvg().style.display=e?"block":"none",this.toolbox_&&this.toolbox_.setVisible(e),e||this.hideChaff(!0))}render(){for(var e=this.getAllBlocks(!1),t=e.length-1;0<=t;t--)e[t].queueRender();if(this.currentGesture_)for(e=this.currentGesture_.getInsertionMarkers(),t=0;tvoid this.markerManager.updateMarkers())}highlightBlock(e,t){if(t===void 0){for(let i=0,r;r=this.highlightedBlocks[i];i++)r.setHighlighted(!1);this.highlightedBlocks.length=0}(e=e?this.getBlockById(e):null)&&((t=t===void 0||t)?this.highlightedBlocks.indexOf(e)===-1&&this.highlightedBlocks.push(e):Po(this.highlightedBlocks,e),e.setHighlighted(t))}paste(e){if(!this.rendered||!e.type&&!e.tagName)return null;this.currentGesture_&&this.currentGesture_.cancel();const t=s.getGroup$$module$build$src$core$events$utils();t||s.setGroup$$module$build$src$core$events$utils(!0);let i;try{i=e.type?this.pasteBlock_(null,e):e.tagName.toLowerCase()==="comment"?this.pasteWorkspaceComment_(e):this.pasteBlock_(e,null)}finally{s.setGroup$$module$build$src$core$events$utils(t)}return i}pasteBlock_(e,t){s.disable$$module$build$src$core$events$utils();let i;try{let r=0,c=0;if(e){i=wi(e,this);let $;r=parseInt(($=e.getAttribute("x"))!=null?$:"0"),this.RTL&&(r=-r);let v;c=parseInt((v=e.getAttribute("y"))!=null?v:"0")}else t&&(i=_n(t,this),r=t.x||10,this.RTL&&(r=this.getWidth()-r),c=t.y||10);if(!isNaN(r)&&!isNaN(c)){let $;do{$=!1;const v=this.getAllBlocks(!1);for(let H=0,Oe;Oe=v[H];H++){const Qe=Oe.getRelativeToSurfaceXY();if(1>=Math.abs(r-Qe.x)&&1>=Math.abs(c-Qe.y)){$=!0;break}}if(!$){const H=i.getConnections_(!1);for(let Oe=0,Qe;Qe=H[Oe];Oe++)if(Qe.closest(s.config$$module$build$src$core$config.snapRadius,new Ue(r,c)).connection){$=!0;break}}$&&(r=this.RTL?r-s.config$$module$build$src$core$config.snapRadius:r+s.config$$module$build$src$core$config.snapRadius,c+=2*s.config$$module$build$src$core$config.snapRadius)}while($);i.moveTo(new Ue(r,c))}}finally{s.enable$$module$build$src$core$events$utils()}return _e()&&!i.isShadow()&&re(new(we(s.CREATE$$module$build$src$core$events$utils))(i)),i.select(),i}pasteWorkspaceComment_(e){s.disable$$module$build$src$core$events$utils();let t;try{t=yo.fromXmlRendered(e,this);let i,r=parseInt((i=e.getAttribute("x"))!=null?i:"0"),c,$=parseInt((c=e.getAttribute("y"))!=null?c:"0");isNaN(r)||isNaN($)||(this.RTL&&(r=-r),t.moveBy(r+50,$+50))}finally{s.enable$$module$build$src$core$events$utils()}return _e()&&Hs.fireCreateEvent(t),t.select(),t}refreshToolboxSelection(){const e=this.isFlyout?this.targetWorkspace:this;e&&!e.currentGesture_&&e.toolbox_&&e.toolbox_.getFlyout()&&e.toolbox_.refreshSelection()}renameVariableById(e,t){super.renameVariableById(e,t),this.refreshToolboxSelection()}deleteVariableById(e){super.deleteVariableById(e),this.refreshToolboxSelection()}createVariable(e,t,i){return e=super.createVariable(e,t,i),this.refreshToolboxSelection(),e}recordDragTargets(){const e=this.componentManager.getComponents(fo.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let t=0,i;i=e[t];t++){const r=i.getClientRect();r&&this.dragTargetAreas.push({component:i,clientRect:r})}}newBlock(e,t){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts")}getDragTarget(e){for(let t=0,i;i=this.dragTargetAreas[t];t++)if(i.clientRect.contains(e.clientX,e.clientY))return i.component;return null}onMouseDown_(e){const t=this.getGesture(e);t&&t.handleWsStart(e,this)}startDrag(e,t){e=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,this.dragDeltaXY=Ue.difference(t,e)}moveDrag(e){return e=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),e.x/=this.scale,e.y/=this.scale,Ue.sum(this.dragDeltaXY,e)}isDragging(){return this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const e=!!this.scrollbar;return this.isMovable()&&(!e||e&&this.scrollbar.canScrollVertically())}onMouseWheel_(e){if(bi.inProgress())e.preventDefault(),e.stopPropagation();else{var t=this.options.zoomOptions&&this.options.zoomOptions.wheel,i=this.options.moveOptions&&this.options.moveOptions.wheel;if(t||i){var r=vl(e);if(Ap)var c=e.metaKey;t&&(e.ctrlKey||c||!i)?(r=-r.y/50,t=pn(e,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(t.x,t.y,r)):(t=this.scrollX-r.x,i=this.scrollY-r.y,e.shiftKey&&!r.x&&(t=this.scrollX-r.y,i=this.scrollY),this.scroll(t,i)),e.preventDefault()}}}getBlocksBoundingBox(){const e=this.getTopBoundedElements();if(!e.length)return new Bt(0,0,0,0);const t=e[0].getBoundingRectangle();for(let r=1;rt.bottom&&(t.bottom=i.bottom),i.leftt.right&&(t.right=i.right))}return t}cleanUp(){this.setResizesEnabled(!1),s.setGroup$$module$build$src$core$events$utils(!0);const e=this.getTopBlocks(!0);let t=0;for(let i=0,r;r=e[i];i++){if(!r.isMovable())continue;const c=r.getRelativeToSurfaceXY();r.moveBy(-c.x,t-c.y,["cleanup"]),r.snapToGrid(),t=r.getRelativeToSurfaceXY().y+r.getHeightWidth().height+this.renderer.getConstants().MIN_BLOCK_HEIGHT}s.setGroup$$module$build$src$core$events$utils(!1),this.setResizesEnabled(!0)}showContextMenu(e){if(!this.options.readOnly&&!this.isFlyout){var t=kt.registry.getContextMenuOptions(kt.ScopeType.WORKSPACE,{workspace:this});this.configureContextMenu&&this.configureContextMenu(t,e),wl(e,t,this.RTL)}}updateToolbox(e){if(e=ia(e)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(na(e)){if(!this.toolbox_)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=e,this.toolbox_.render(e)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode.");this.options.languageTree=e,this.flyout.show(e)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.")}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(ne(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(e,t,i){i=Math.pow(this.options.zoomOptions.scaleSpeed,i);const r=this.scale*i;if(this.scale!==r){r>this.options.zoomOptions.maxScale?i=this.options.zoomOptions.maxScale/this.scale:rthis.options.zoomOptions.maxScale?e=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&et.autoHide(e))}static setTopLevelWorkspaceMetrics_(e){const t=this.getMetrics();typeof e.x=="number"&&(this.scrollX=-(t.scrollLeft+(t.scrollWidth-t.viewWidth)*e.x)),typeof e.y=="number"&&(this.scrollY=-(t.scrollTop+(t.scrollHeight-t.viewHeight)*e.y)),this.translate(this.scrollX+t.absoluteLeft,this.scrollY+t.absoluteTop)}},jr;(function(e){e.BLOCK="block",e.BUTTON="button"})(jr||(jr={}));var au=class extends ru{constructor(e){super(),this.horizontalLayout=!1,this.boundEvents=[],this.filterWrapper=this.reflowWrapper=null,this.mats=[],this.buttons_=[],this.listeners=[],this.permanentlyDisabled=[],this.recycledBlocks=[],this.autoClose=!0,this.isVisible_=!1,this.containerVisible=!0,this.CORNER_RADIUS=8,this.SCROLLBAR_MARGIN=2.5,this.height_=this.width_=0,this.dragAngleRange_=70,this.svgGroup_=this.svgBackground_=null,e.setMetrics=this.setMetrics_.bind(this),this.workspace_=new Cs(e),this.workspace_.setMetricsManager(new KT(this.workspace_,this)),this.workspace_.internalIsFlyout=!0,this.workspace_.setVisible(this.isVisible_),this.id=he(),this.RTL=!!e.RTL,this.toolboxPosition_=e.toolboxPosition,this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH,this.rectMap_=new WeakMap,this.MARGIN=this.CORNER_RADIUS,this.GAP_X=3*this.MARGIN,this.GAP_Y=3*this.MARGIN}createDom(e){return this.svgGroup_=w(e,{class:"blocklyFlyout",style:"display: none"}),this.svgBackground_=w(te.PATH,{class:"blocklyFlyoutBackground"},this.svgGroup_),this.svgGroup_.appendChild(this.workspace_.createDom()),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour","fill"),this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity"),this.svgGroup_}init(e){this.targetWorkspace=e,this.workspace_.targetWorkspace=e,this.workspace_.scrollbar=new U$(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN),this.hide(),this.boundEvents.push(Be(this.svgGroup_,"wheel",this,this.wheel_)),this.autoClose||(this.filterWrapper=this.filterForCapacity.bind(this),this.targetWorkspace.addChangeListener(this.filterWrapper)),this.boundEvents.push(Be(this.svgBackground_,"pointerdown",this,this.onMouseDown)),this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace),this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap()),this.workspace_.createPotentialVariableMap(),e.getComponentManager().addComponent({component:this,weight:1,capabilities:[fo.Capability.DELETE_AREA,fo.Capability.DRAG_TARGET]})}dispose(){this.hide(),this.workspace_.getComponentManager().removeComponent(this.id);for(const e of this.boundEvents)Dt(e);this.boundEvents.length=0,this.filterWrapper&&this.targetWorkspace.removeChangeListener(this.filterWrapper),this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose()),this.svgGroup_&&U(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}isVisible(){return this.isVisible_}setVisible(e){const t=e!==this.isVisible();this.isVisible_=e,t&&(this.autoClose||this.workspace_.recordDragTargets(),this.updateDisplay())}setContainerVisible(e){const t=e!==this.containerVisible;this.containerVisible=e,t&&this.updateDisplay()}updateDisplay(){let e;e=this.containerVisible?this.isVisible():!1,this.svgGroup_&&(this.svgGroup_.style.display=e?"block":"none");let t;(t=this.workspace_.scrollbar)==null||t.setContainerVisible(e)}positionAt_(e,t,i,r){let c;(c=this.svgGroup_)==null||c.setAttribute("width",`${e}`);let $;($=this.svgGroup_)==null||$.setAttribute("height",`${t}`),this.workspace_.setCachedParentSvgSize(e,t),this.svgGroup_&&se(this.svgGroup_,"translate("+i+"px,"+r+"px)"),(e=this.workspace_.scrollbar)&&(e.setOrigin(i,r),e.resize(),e.hScroll&&e.hScroll.setPosition(e.hScroll.position.x,e.hScroll.position.y),e.vScroll&&e.vScroll.setPosition(e.vScroll.position.x,e.vScroll.position.y))}hide(){if(this.isVisible()){this.setVisible(!1);for(const e of this.listeners)Dt(e);this.listeners.length=0,this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null)}}show(e){this.workspace_.setResizesEnabled(!1),this.hide(),this.clearOldBlocks(),typeof e=="string"&&(e=this.getDynamicCategoryContents(e)),this.setVisible(!0),e=Ll(e),e=this.createFlyoutInfo(e),Ds(),this.layout_(e.contents,e.gaps),this.horizontalLayout?this.height_=0:this.width_=0,this.workspace_.setResizesEnabled(!0),this.reflow(),this.filterForCapacity(),this.position(),this.reflowWrapper=this.reflow.bind(this),this.workspace_.addChangeListener(this.reflowWrapper),this.emptyRecycledBlocks()}createFlyoutInfo(e){const t=[],i=[];this.permanentlyDisabled.length=0;const r=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const c of e){if("custom"in c){e=this.getDynamicCategoryContents(c.custom),e=Ll(e);const{contents:$,gaps:v}=this.createFlyoutInfo(e);t.push(...$),i.push(...v)}switch(c.kind.toUpperCase()){case"BLOCK":e=c;const $=this.createFlyoutBlock(e);t.push({type:jr.BLOCK,block:$}),this.addBlockGap(e,i,r);break;case"SEP":this.addSeparatorGap(c,i,r);break;case"LABEL":e=this.createButton(c,!0),t.push({type:jr.BUTTON,button:e}),i.push(r);break;case"BUTTON":e=this.createButton(c,!1),t.push({type:jr.BUTTON,button:e}),i.push(r)}}return{contents:t,gaps:i}}getDynamicCategoryContents(e){if(e=this.workspace_.targetWorkspace.getToolboxCategoryCallback(e),typeof e!="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");return e(this.workspace_.targetWorkspace)}createButton(e,t){return new Os(this.workspace_,this.targetWorkspace,e,t)}createFlyoutBlock(e){let t;return e.blockxml?(e=typeof e.blockxml=="string"?s.textToDom$$module$build$src$core$utils$xml(e.blockxml):e.blockxml,(t=this.getRecycledBlock(e.getAttribute("type")))||(t=wi(e,this.workspace_))):(t=this.getRecycledBlock(e.type),t||(e.enabled===void 0&&(e.enabled=e.disabled!=="true"&&e.disabled!==!0),t=Cl(e,this.workspace_))),t.isEnabled()||this.permanentlyDisabled.push(t),t}getRecycledBlock(e){let t=-1;for(let i=0;i{const i=this.targetWorkspace.getGesture(t);i&&(i.setStartBlock(e),i.handleFlyoutStart(t,this))}}onMouseDown(e){const t=this.targetWorkspace.getGesture(e);t&&t.handleFlyoutStart(e,this)}isBlockCreatable(e){return e.isEnabled()}createBlock(e){let t=null;s.disable$$module$build$src$core$events$utils();var i=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{t=this.placeNewBlock(e)}finally{s.enable$$module$build$src$core$events$utils()}if(this.targetWorkspace.hideChaff(),e=y(this.targetWorkspace,i),_e()){for(s.setGroup$$module$build$src$core$events$utils(!0),i=0;i90-t||e>-90-t&&e<-90+t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.top;return this.toolboxPosition_===at.TOP?new Bt(-1e9,t+e.height,-1e9,1e9):new Bt(t,1e9,-1e9,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;const t=this.workspace_.getTopBlocks(!1);for(let r=0,c;c=t[r];r++)e=Math.max(e,c.getHeightWidth().height);const i=this.buttons_;for(let r=0,c;c=i[r];r++)e=Math.max(e,c.height);if(e+=1.5*this.MARGIN,e*=this.workspace_.scale,e+=no.scrollbarThickness,this.height_!==e){for(let r=0,c;c=t[r];r++)this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==at.TOP||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+e),this.height_=e,this.position(),this.targetWorkspace.recordDragTargets()}}};l(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,li,tE);var W$=class extends au{constructor(e){super(e)}setMetrics_(e){if(this.isVisible()){var t=this.workspace_.getMetricsManager(),i=t.getScrollMetrics(),r=t.getViewMetrics();t=t.getAbsoluteMetrics(),typeof e.y=="number"&&(this.workspace_.scrollY=-(i.top+(i.height-r.height)*e.y)),this.workspace_.translate(this.workspace_.scrollX+t.left,this.workspace_.scrollY+t.top)}}getX(){if(!this.isVisible())return 0;var e=this.targetWorkspace.getMetricsManager();const t=e.getAbsoluteMetrics(),i=e.getViewMetrics();return e=e.getToolboxMetrics(),this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?this.toolboxPosition_===at.LEFT?e.width:i.width-this.width_:this.toolboxPosition_===at.LEFT?0:i.width:this.toolboxPosition_===at.LEFT?0:i.width+t.left-this.width_}getY(){return 0}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var e=this.targetWorkspace.getMetricsManager().getViewMetrics();this.height_=e.height,this.setBackgroundPath(this.width_-this.CORNER_RADIUS,e.height-2*this.CORNER_RADIUS),e=this.getX();var t=this.getY();this.positionAt_(this.width_,this.height_,e,t)}}setBackgroundPath(e,t){const i=this.toolboxPosition_===at.RIGHT;var r=e+this.CORNER_RADIUS;r=["M "+(i?r:0)+",0"],r.push("h",i?-e:e),r.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,i?0:1,i?-this.CORNER_RADIUS:this.CORNER_RADIUS,this.CORNER_RADIUS),r.push("v",Math.max(0,t)),r.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,i?0:1,i?this.CORNER_RADIUS:-this.CORNER_RADIUS,this.CORNER_RADIUS),r.push("h",i?e:-e),r.push("z"),this.svgBackground_.setAttribute("d",r.join(" "))}scrollToStart(){let e;(e=this.workspace_.scrollbar)==null||e.setY(0)}wheel_(e){var t=vl(e);if(t.y){const i=this.workspace_.getMetricsManager(),r=i.getScrollMetrics();t=i.getViewMetrics().top-r.top+t.y;let c;(c=this.workspace_.scrollbar)==null||c.setY(t),as(),fs()}e.preventDefault(),e.stopPropagation()}layout_(e,t){this.workspace_.scale=this.targetWorkspace.scale;var i=this.MARGIN;const r=this.RTL?i:i+this.tabWidth_;for(let H=0,Oe;Oe=e[H];H++)if(Oe.type==="block"){var c=Oe.block,$=c.getDescendants(!1);for(let qt=0,Ft;Ft=$[qt];qt++)Ft.isInFlyout=!0;$=c.getSvgRoot();const Qe=c.getHeightWidth();var v=c.outputConnection?r-this.tabWidth_:r;c.moveBy(v,i),v=this.createRect_(c,this.RTL?v-Qe.width:v,i,Qe,H),this.addBlockListeners_($,c,v),i+=Qe.height+t[H]}else Oe.type==="button"&&(c=Oe.button,this.initFlyoutButton_(c,r,i),i+=c.height+t[H])}isDragTowardWorkspace(e){e=Math.atan2(e.y,e.x)/Math.PI*180;const t=this.dragAngleRange_;return e-t||e<-180+t||e>180-t}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const e=this.svgGroup_.getBoundingClientRect(),t=e.left;return this.toolboxPosition_===at.LEFT?new Bt(-1e9,1e9,-1e9,t+e.width):new Bt(-1e9,1e9,t,1e9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let e=0;var t=this.workspace_.getTopBlocks(!1);for(let r=0,c;c=t[r];r++){var i=c.getHeightWidth().width;c.outputConnection&&(i-=this.tabWidth_),e=Math.max(e,i)}for(let r=0,c;c=this.buttons_[r];r++)e=Math.max(e,c.width);if(e+=1.5*this.MARGIN+this.tabWidth_,e*=this.workspace_.scale,e+=no.scrollbarThickness,this.width_!==e){for(let r=0,c;c=t[r];r++){if(this.RTL){i=c.getRelativeToSurfaceXY().x;let $=e/this.workspace_.scale-this.MARGIN;c.outputConnection||($-=this.tabWidth_),c.moveBy($-i,0)}this.rectMap_.has(c)&&this.moveRectToBlock_(this.rectMap_.get(c),c)}if(this.RTL)for(let r=0,c;c=this.buttons_[r];r++)t=c.getPosition().y,c.moveTo(e/this.workspace_.scale-c.width-this.MARGIN-this.tabWidth_,t);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==at.LEFT||this.targetWorkspace.getToolbox()||this.targetWorkspace.translate(this.targetWorkspace.scrollX+e,this.targetWorkspace.scrollY),this.width_=e,this.position(),this.targetWorkspace.recordDragTargets()}}};W$.registryName="verticalFlyout",l(Ae.FLYOUTS_VERTICAL_TOOLBOX,li,W$);var oE;s.CodeGenerator$$module$build$src$core$generator=class{constructor(e){this.forBlock=Object.create(null),this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}",this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null,this.INDENT=" ",this.COMMENT_WRAP=60,this.ORDER_OVERRIDES=[],this.isInitialized=null,this.RESERVED_WORDS_="",this.definitions_=Object.create(null),this.functionNames_=Object.create(null),this.nameDB_=void 0,this.name_=e,this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,"g")}workspaceToCode(e){e||(console.warn("No workspace specified in workspaceToCode call. Guessing."),e=oe());var t=[];this.init(e),e=e.getTopBlocks(!0);for(let i=0,r;r=e[i];i++){let c=this.blockToCode(r);Array.isArray(c)&&(c=c[0]),c&&(r.outputConnection&&(c=this.scrubNakedValue(c),this.STATEMENT_PREFIX&&!r.suppressPrefixSuffix&&(c=this.injectId(this.STATEMENT_PREFIX,r)+c),this.STATEMENT_SUFFIX&&!r.suppressPrefixSuffix&&(c+=this.injectId(this.STATEMENT_SUFFIX,r))),t.push(c))}return t=t.join(` +`),t=this.finish(t),t=t.replace(/^\s+\n/,""),t=t.replace(/\n\s+$/,` +`),t=t.replace(/[ \t]+\n/g,` +`)}prefixLines(e,t){return t+e.replace(/(?!\n$)\n/g,` +`+t)}allNestedComments(e){const t=[];e=e.getDescendants(!0);for(let i=0;i.blocklyPathLight,`,`${e} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"])}},nE=class{constructor(e){this.inlineSteps_=this.steps_="",this.info_=e,this.RTL_=this.info_.RTL,e=e.getRenderer(),this.constants_=e.getConstants(),this.highlightConstants_=e.getHighlightConstants(),this.highlightOffset=this.highlightConstants_.OFFSET,this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER,this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER,this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB,this.notchPaths_=this.highlightConstants_.NOTCH,this.startPaths_=this.highlightConstants_.START_HAT,this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+` +`+this.inlineSteps_}drawTopCorner(e){this.steps_+=jt(e.xPos,this.info_.startY);for(let t=0,i;i=e.elements[t];t++)q.isLeftSquareCorner(i)?this.steps_+=this.highlightConstants_.START_POINT:q.isLeftRoundedCorner(i)?this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):q.isPreviousConnection(i)?this.steps_+=this.notchPaths_.pathLeft:q.isHat(i)?this.steps_+=this.startPaths_.path(this.RTL_):q.isSpacer(i)&&i.width!==0&&(this.steps_+=je("H",i.xPos+i.width-this.highlightOffset));this.steps_+=je("H",e.xPos+e.width-this.highlightOffset)}drawJaggedEdge_(e){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+je("v",e.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(e){const t=e.getLastInput();if(this.RTL_){const i=e.height-t.connectionHeight;this.steps_+=To(t.xPos+t.width-this.highlightOffset,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+je("v",i)}else this.steps_+=To(t.xPos+t.width,e.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(e){const t=e.getLastInput();if(t)if(this.RTL_){const i=e.height-2*this.insideCornerPaths_.height;this.steps_+=To(t.xPos,e.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+je("v",i)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=To(t.xPos,e.yPos+e.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+Bs(e.width-t.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(e){const t=e.xPos+e.width-this.highlightOffset;e instanceof M$&&e.followsStatement&&(this.steps_+=je("H",t)),this.RTL_&&(this.steps_+=je("H",t),e.height>this.highlightOffset&&(this.steps_+=je("V",e.yPos+e.height-this.highlightOffset)))}drawBottomRow(e){if(this.RTL_)this.steps_+=je("V",e.baseline-this.highlightOffset);else{const t=this.info_.bottomRow.elements[0];q.isLeftSquareCorner(t)?this.steps_+=To(e.xPos+this.highlightOffset,e.baseline-this.highlightOffset):q.isLeftRoundedCorner(t)&&(this.steps_+=To(e.xPos,e.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var e=this.info_.outputConnection;e&&(e=e.connectionOffsetY+e.height,this.RTL_?this.steps_+=To(this.info_.startX,e):(this.steps_+=To(this.info_.startX+this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=je("V",e)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_)),this.RTL_||(e=this.info_.topRow,q.isLeftRoundedCorner(e.elements[0])?this.steps_+=je("V",this.outsideCornerPaths_.height):this.steps_+=je("V",e.capline+this.highlightOffset))}drawInlineInput(e){const t=this.highlightOffset,i=e.xPos+e.connectionWidth;var r=e.centerline-e.height/2;const c=e.width-e.connectionWidth,$=r+t;this.RTL_?(r=e.connectionOffsetY-t,e=e.height-(e.connectionOffsetY+e.connectionHeight)+t,this.inlineSteps_+=To(i-t,$)+je("v",r)+this.puzzleTabPaths_.pathDown(this.RTL_)+je("v",e)+je("h",c)):this.inlineSteps_+=To(e.xPos+e.width+t,$)+je("v",e.height)+je("h",-c)+To(i,r+e.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},rE=class extends sc{constructor(e,t){super(e,t),this.highlighter_=new nE(t)}draw(){this.drawOutline_(),this.drawInternals_();const e=this.block_.pathObject;e.setPath(this.outlinePath_+` +`+this.inlinePath_),e.setHighlightPath(this.highlighter_.getPath()),this.info_.RTL&&e.flipRTL(),this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow),this.highlighter_.drawRightSideRow(this.info_.topRow),super.drawTop_()}drawJaggedEdge_(e){this.highlighter_.drawJaggedEdge_(e),super.drawJaggedEdge_(e)}drawValueInput_(e){this.highlighter_.drawValueInput(e),super.drawValueInput_(e)}drawStatementInput_(e){this.highlighter_.drawStatementInput(e),super.drawStatementInput_(e)}drawRightSideRow_(e){this.highlighter_.drawRightSideRow(e),this.outlinePath_+=je("H",e.xPos+e.width)+je("V",e.yPos+e.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow),super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft(),super.drawLeft_()}drawInlineInput_(e){this.highlighter_.drawInlineInput(e),super.drawInlineInput_(e)}positionInlineInputConnection_(e){const t=e.centerline-e.height/2;if(e.connectionModel){let i=e.xPos+e.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(i*=-1),e.connectionModel.setOffsetInBlock(i,t+e.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(e){const t=e.getLastInput();if(t!=null&&t.connectionModel){let i=e.xPos+e.statementEdge+t.notchOffset;i=this.info_.RTL?-1*i:i+this.constants_.DARK_PATH_OFFSET,t.connectionModel.setOffsetInBlock(i,e.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(e){const t=e.getLastInput();if(t&&t.connectionModel){let i=e.xPos+e.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(i*=-1),t.connectionModel.setOffsetInBlock(i,e.yPos)}}positionNextConnection_(){const e=this.info_.bottomRow;if(e.connection){const t=e.connection,i=t.xPos;t.connectionModel.setOffsetInBlock((this.info_.RTL?-i:i)+this.constants_.DARK_PATH_OFFSET/2,e.baseline+this.constants_.DARK_PATH_OFFSET)}}},lE=class{constructor(e){this.OFFSET=.5,this.constantProvider=e,this.START_POINT=jt(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner(),this.OUTSIDE_CORNER=this.makeOutsideCorner(),this.PUZZLE_TAB=this.makePuzzleTab(),this.NOTCH=this.makeNotch(),this.JAGGED_TEETH=this.makeJaggedTeeth(),this.START_HAT=this.makeStartHat()}makeInsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,i=(1-Math.SQRT1_2)*(e+t)-t,r=jt(i,i)+oo("a","0 0,0",e,tt(-i-t,e-i)),c=oo("a","0 0,0",e+t,tt(e+t,e+t)),$=jt(i,-i)+oo("a","0 0,0",e+t,tt(e-i,i+t));return{width:e+t,height:e,pathTop(v){return v?r:""},pathBottom(v){return v?c:$}}}makeOutsideCorner(){const e=this.constantProvider.CORNER_RADIUS,t=this.OFFSET,i=(1-Math.SQRT1_2)*(e-t)+t,r=jt(i,i)+oo("a","0 0,1",e-t,tt(e-i,-i+t)),c=jt(t,e)+oo("a","0 0,1",e-t,tt(e,-e+t)),$=-i,v=jt(i,$)+oo("a","0 0,1",e-t,tt(-i+t,-$-e));return{height:e,topLeft(H){return H?r:c},bottomLeft(){return v}}}makePuzzleTab(){const e=this.constantProvider.TAB_WIDTH,t=this.constantProvider.TAB_HEIGHT,i=jt(-2,-t+3.4)+Bs(-.45*e,-2.1),r=je("v",2.5)+jt(.97*-e,2.5)+xo("q",[tt(.05*-e,10),tt(.3*e,9.5)])+jt(.67*e,-1.9)+je("v",2.5),c=je("v",-1.5)+jt(-.92*e,-.5)+xo("q",[tt(-.19*e,-5.5),tt(0,-11)])+jt(.92*e,1),$=jt(-5,t-.7)+Bs(.46*e,-2.1);return{width:e,height:t,pathUp(v){return v?i:c},pathDown(v){return v?r:$}}}makeNotch(){return{pathLeft:je("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:Bs(5.1,2.6)+jt(-10.2,6.8)+Bs(5.1,2.6),height:12,width:10.2}}makeStartHat(){const e=this.constantProvider.START_HAT.height,t=jt(25,-8.7)+xo("c",[tt(29.7,-6.2),tt(57.2,-.5),tt(75,8.7)]),i=xo("c",[tt(17.8,-9.2),tt(45.3,-14.9),tt(75,-8.7)])+To(100.5,e+.5);return{path(r){return r?t:i}}}},cE=class extends N${constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},aE=class extends rc{constructor(e,t){super(e,t),this.constants_=e,this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},uE=class extends zr{constructor(e,t){super(e,t),this.renderer_=e}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_(),this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof Zo||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(e,t){this.isInline&&e instanceof s.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new cE(this.constants_,e)),t.hasInlineInput=!0):e instanceof Zo?(t.elements.push(new aE(this.constants_,e)),t.hasStatement=!0):e instanceof s.ValueInput$$module$build$src$core$inputs$value_input?(t.elements.push(new su(this.constants_,e)),t.hasExternalInput=!0):e instanceof zs&&(t.minHeight=Math.max(t.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),t.hasDummyInput=!0),this.isInline||t.align!==null||(t.align=e.align)}addElemSpacing_(){let e=!1;for(let i=0,r;r=this.rows[i];i++)r.hasExternalInput&&(e=!0);for(let i=0,r;r=this.rows[i];i++){var t=r.elements;if(r.elements=[],r.startsWithElemSpacer()&&r.elements.push(new os(this.constants_,this.getInRowSpacing_(null,t[0]))),t.length){for(let c=0;clp(t)),e.length?e:null}load(e,t){const i=t.getProcedureMap();for(const r of e)i.add(ap(this.procedureModelClass,this.parameterModelClass,r,t))}clear(e){e.getProcedureMap().clear()}},Yr={};Yr.ProcedureSerializer=FS,Yr.loadParameter=up,Yr.loadProcedure=ap,Yr.saveParameter=cp,Yr.saveProcedure=lp;var TE=class{constructor(){this.priority=eT}save(e){const t=[];for(const i of e.getAllVariables())e={name:i.name,id:i.getId()},i.type&&(e.type=i.type),t.push(e);return t.length?t:null}load(e,t){for(const i of e)t.createVariable(i.name,i.type,i.id)}clear(e){e.getVariableMap().clear()}};jc("variables",new TE);var EE={};EE.VariableSerializer=TE;var X$={};X$.load=bm,X$.save=Em;var US={blocks:Gl,exceptions:Cn,priorities:Va,procedures:Yr,registry:Pp,variables:EE,workspaces:X$},Ks;(function(e){e.ESCAPE="escape",e.DELETE="delete",e.COPY="copy",e.CUT="cut",e.PASTE="paste",e.UNDO="undo",e.REDO="redo"})(Ks||(Ks={})),mp();var Qs={};Qs.names=Ks,Qs.registerCopy=pp,Qs.registerCut=$p,Qs.registerDefaultShortcuts=mp,Qs.registerDelete=hp,Qs.registerEscape=dp,Qs.registerPaste=_p,Qs.registerRedo=fp,Qs.registerUndo=gp;var HS={colour_blocks:{colourPrimary:"#CF63CF",colourSecondary:"#C94FC9",colourTertiary:"#BD42BD"},list_blocks:{colourPrimary:"#9966FF",colourSecondary:"#855CD6",colourTertiary:"#774DCB"},logic_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC"},loop_blocks:{colourPrimary:"#0fBD8C",colourSecondary:"#0DA57A",colourTertiary:"#0B8E69"},math_blocks:{colourPrimary:"#59C059",colourSecondary:"#46B946",colourTertiary:"#389438"},procedure_blocks:{colourPrimary:"#FF6680",colourSecondary:"#FF4D6A",colourTertiary:"#FF3355"},text_blocks:{colourPrimary:"#FFBF00",colourSecondary:"#E6AC00",colourTertiary:"#CC9900"},variable_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},variable_dynamic_blocks:{colourPrimary:"#FF8C1A",colourSecondary:"#FF8000",colourTertiary:"#DB6E00"},hat_blocks:{colourPrimary:"#4C97FF",colourSecondary:"#4280D7",colourTertiary:"#3373CC",hat:"cap"}},VS={colour_category:{colour:"#CF63CF"},list_category:{colour:"#9966FF"},logic_category:{colour:"#4C97FF"},loop_category:{colour:"#0fBD8C"},math_category:{colour:"#59C059"},procedure_category:{colour:"#FF6680"},text_category:{colour:"#FFBF00"},variable_category:{colour:"#FF8C1A"},variable_dynamic_category:{colour:"#FF8C1A"}},GS=new Nn("zelos",HS,VS),j$={};j$.Classic=Qa,j$.Zelos=GS;var Y$=class{constructor(e,t,i){this.id_=e.toolboxitemid||$e(),this.level_=(this.parent_=i||null)?this.parent_.getLevel()+1:0,this.toolboxItemDef_=e,this.parentToolbox_=t,this.workspace_=this.parentToolbox_.getWorkspace()}init(){}getDiv(){return null}getClickTarget(){return null}getId(){return this.id_}getParent(){return null}getLevel(){return this.level_}isSelectable(){return!1}isCollapsible(){return!1}dispose(){}setVisible_(e){}},ys=class extends Y${constructor(e,t,i){super(e,t,i),this.colour_=this.name_="",this.labelDom_=this.iconDom_=this.rowContents_=this.rowDiv_=this.htmlDiv_=null,this.isDisabled_=this.isHidden_=!1,this.flyoutItems_=[],this.cssConfig_=this.makeDefaultCssConfig_()}init(){this.parseCategoryDef_(this.toolboxItemDef_),this.parseContents_(this.toolboxItemDef_),this.createDom_(),this.toolboxItemDef_.hidden==="true"&&this.hide()}makeDefaultCssConfig_(){return{container:"blocklyToolboxCategory",row:"blocklyTreeRow",rowcontentcontainer:"blocklyTreeRowContentContainer",icon:"blocklyTreeIcon",label:"blocklyTreeLabel",contents:"blocklyToolboxContents",selected:"blocklyTreeSelected",openicon:"blocklyTreeIconOpen",closedicon:"blocklyTreeIconClosed"}}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else if(e=e.contents)for(let t=0;t>>/sprites.png); + height: 16px; + vertical-align: middle; + visibility: hidden; + width: 16px; +} + +.blocklyTreeIconClosed { + background-position: -32px -1px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed { + background-position: 0 -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: -32px -17px; +} + +.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed { + background-position: 0 -17px; +} + +.blocklyTreeIconOpen { + background-position: -16px -1px; +} + +.blocklyTreeSelected>.blocklyTreeIconOpen { + background-position: -16px -17px; +} + +.blocklyTreeLabel { + cursor: default; + font: 16px sans-serif; + padding: 0 3px; + vertical-align: middle; +} + +.blocklyToolboxDelete .blocklyTreeLabel { + cursor: url("<<>>/handdelete.cur"), auto; +} + +.blocklyTreeSelected .blocklyTreeLabel { + color: #fff; +} +`),l(Ae.TOOLBOX_ITEM,ys.registrationName,ys);var pc=class extends Y${constructor(e,t){super(e,t),this.cssConfig_={container:"blocklyTreeSeparator"},this.htmlDiv_=null,Object.assign(this.cssConfig_,e.cssconfig||e.cssConfig)}init(){this.createDom_()}createDom_(){const e=document.createElement("div"),t=this.cssConfig_.container;return t&&I(e,t),this.htmlDiv_=e}getDiv(){return this.htmlDiv_}dispose(){U(this.htmlDiv_)}};pc.registrationName="sep",cs(` +.blocklyTreeSeparator { + border-bottom: solid #e5e5e5 1px; + height: 0; + margin: 5px 0; +} + +.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator { + border-right: solid #e5e5e5 1px; + border-bottom: none; + height: auto; + margin: 0 5px 0 5px; + padding: 5px 0; + width: 0; +} +`),l(Ae.TOOLBOX_ITEM,pc.registrationName,pc);var Kr=class extends ys{constructor(e,t,i){super(e,t,i),this.subcategoriesDiv_=null,this.expanded_=!1,this.toolboxItems_=[]}makeDefaultCssConfig_(){const e=super.makeDefaultCssConfig_();return e.contents="blocklyToolboxContents",e}parseContents_(e){if("custom"in e)this.flyoutItems_=e.custom;else{const t=e.contents;if(t){this.flyoutItems_=[],e=!0;for(let i=0;i>>/handdelete.cur"), auto; +} + +.blocklyToolboxGrab { + cursor: url("<<>>/handclosed.cur"), auto; + cursor: grabbing; + cursor: -webkit-grabbing; +} + +/* Category tree in Toolbox. */ +.blocklyToolboxDiv { + background-color: #ddd; + overflow-x: visible; + overflow-y: auto; + padding: 4px 0 4px 0; + position: absolute; + z-index: 70; /* so blocks go under toolbox when dragging */ + -webkit-tap-highlight-color: transparent; /* issue #1345 */ +} + +.blocklyToolboxContents { + display: flex; + flex-wrap: wrap; + flex-direction: column; +} + +.blocklyToolboxContents:focus { + outline: none; +} +`),l(Ae.TOOLBOX,li,bE);var vE=class extends ru{constructor(e){super(),this.workspace=e,this.id="trashcan",this.contents=[],this.flyout=null,this.isLidOpen=!1,this.minOpenness=0,this.lidTask=this.svgLid=this.svgGroup=null,this.top=this.left=this.lidOpen=0,this.initialized=!1,0>=this.workspace.options.maxTrashcanContents||(e=new hs({scrollbars:!0,parentWorkspace:this.workspace,rtl:this.workspace.RTL,oneBasedIndex:this.workspace.options.oneBasedIndex,renderer:this.workspace.options.renderer,rendererOverrides:this.workspace.options.rendererOverrides,move:{scrollbars:!0}}),this.workspace.horizontalLayout?(e.toolboxPosition=this.workspace.toolboxPosition===at.TOP?at.BOTTOM:at.TOP,this.flyout=new(C(Ae.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(e)):(e.toolboxPosition=this.workspace.toolboxPosition===at.RIGHT?at.LEFT:at.RIGHT,this.flyout=new(C(Ae.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(e)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=w(te.G,{class:"blocklyTrash"});let e;const t=String(Math.random()).substring(2);e=w(te.CLIPPATH,{id:"blocklyTrashBodyClipPath"+t},this.svgGroup),w(te.RECT,{width:Qr,height:uu,y:qr},e);const i=w(te.IMAGE,{width:wo.width,x:-K$,height:wo.height,y:-Q$,"clip-path":"url(#blocklyTrashBodyClipPath"+t+")"},this.svgGroup);return i.setAttributeNS(us,"xlink:href",this.workspace.options.pathToMedia+wo.url),e=w(te.CLIPPATH,{id:"blocklyTrashLidClipPath"+t},this.svgGroup),w(te.RECT,{width:Qr,height:qr},e),this.svgLid=w(te.IMAGE,{width:wo.width,x:-K$,height:wo.height,y:-Q$,"clip-path":"url(#blocklyTrashLidClipPath"+t+")"},this.svgGroup),this.svgLid.setAttributeNS(us,"xlink:href",this.workspace.options.pathToMedia+wo.url),wt(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable),wt(this.svgGroup,"pointerup",this,this.click),wt(i,"pointerover",this,this.mouseOver),wt(i,"pointerout",this,this.mouseOut),this.animateLid(),this.svgGroup}init(){0{let i;(i=this.flyout)==null||i.show(e),t.cursor="";let r;(r=this.workspace.scrollbar)==null||r.setVisible(!1)},10),this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var e;(e=this.flyout)==null||e.hide();var t;(t=this.workspace.scrollbar)==null||t.setVisible(!0),this.fireUiEvent(!1),this.workspace.recordDragTargets()}}autoHide(e){!e&&this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(e,t){if(this.initialized){var i=Ea(this.workspace,e);e=Ta(i,new Vt(Qr,uu+qr),WS,IE,e,this.workspace),t=ba(e,IE,i.vertical===vi.TOP?Qi.DOWN:Qi.UP,t),this.top=t.top,this.left=t.left;var r;(r=this.svgGroup)==null||r.setAttribute("transform","translate("+this.left+","+this.top+")")}}getBoundingRectangle(){return new Bt(this.top,this.top+uu+qr,this.left,this.left+Qr)}getClientRect(){if(!this.svgGroup)return null;var e=this.svgGroup.getBoundingClientRect();const t=e.top+Q$-du;return e=e.left+K$-du,new Bt(t,t+qr+uu+2*du,e,e+Qr+2*du)}onDragOver(e){this.setLidOpen(this.wouldDelete_)}onDragExit(e){this.setLidOpen(!1)}onDrop(e){setTimeout(this.setLidOpen.bind(this,!1),100)}setLidOpen(e){this.isLidOpen!==e&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=e,this.animateLid())}animateLid(){const e=jS;var t=1/(e+1);this.lidOpen+=this.isLidOpen?t:-t,this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1),this.setLidAngle(this.lidOpen*CE),t=OE+this.lidOpen*(YS-OE),this.svgGroup&&(this.svgGroup.style.opacity=`${t}`),this.lidOpen>this.minOpenness&&1>this.lidOpen&&(this.lidTask=setTimeout(this.animateLid.bind(this),XS/e))}setLidAngle(e){const t=this.workspace.toolboxPosition===at.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let i;(i=this.svgLid)==null||i.setAttribute("transform","rotate("+(t?-e:e)+","+(t?4:Qr-4)+","+(qr-2)+")")}setMinOpenness(e){this.minOpenness=e,this.isLidOpen||this.setLidAngle(e*CE)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&this.openFlyout()}fireUiEvent(e){e=new(we(Ir))(e,this.workspace.id),re(e)}blockMouseDownWhenOpenable(e){!this.contentsIsOpen()&&this.hasContents()&&e.stopPropagation()}mouseOver(){this.hasContents()&&this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(e){if(!(0>=this.workspace.options.maxTrashcanContents||e.type!==s.DELETE$$module$build$src$core$events$utils||e.type!==s.DELETE$$module$build$src$core$events$utils||e.wasShadow)){if(!e.oldJson)throw Error("Encountered a delete event without proper oldJson");if(e=JSON.stringify(this.cleanBlockJson(e.oldJson)),this.contents.indexOf(e)===-1){for(this.contents.unshift(e);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(zS)}}}cleanBlockJson(e){function t(i){if(i){if(delete i.id,delete i.x,delete i.y,delete i.enabled,i.icons&&i.icons.comment){var r=i.icons.comment;delete r.height,delete r.width,delete r.pinned}r=i.inputs;for(var c in r){var $=r[c];const v=$.block;$=$.shadow,v&&t(v),$&&t($)}i.next&&(c=i.next,i=c.block,c=c.shadow,i&&t(i),c&&t(c))}}return e=JSON.parse(JSON.stringify(e)),t(e),Object.assign({},{kind:"BLOCK"},e)}},Qr=47,uu=44,qr=16,IE=20,WS=20,du=10,K$=0,Q$=32,zS=.1,XS=80,jS=4,OE=.4,YS=.8,CE=45,KS="10.1.3",QS=s.Align$$module$build$src$core$inputs$align.LEFT,qS=s.Align$$module$build$src$core$inputs$align.CENTRE,JS=s.Align$$module$build$src$core$inputs$align.RIGHT,ZS=qe.INPUT_VALUE,e9=qe.OUTPUT_VALUE,t9=qe.NEXT_STATEMENT,o9=qe.PREVIOUS_STATEMENT,s9=s.inputTypes$$module$build$src$core$inputs$input_types.DUMMY,i9=at.TOP,n9=at.BOTTOM,r9=at.LEFT,l9=at.RIGHT;dc.prototype.newBlock=function(e,t){return new Hr(this,e,t)},Cs.prototype.newBlock=function(e,t){return new ts(this,e,t)},Cs.newTrashcan=function(e){return new vE(e)},yo.prototype.showContextMenu=function(e){if(!this.workspace.options.readOnly){var t=[];this.isDeletable()&&this.isMovable()&&(t.push(wh(this)),t.push(Nh(this))),wl(e,t,this.RTL)}},gi.prototype.newWorkspaceSvg=function(e){return new Cs(e)},s.Names$$module$build$src$core$names.prototype.populateProcedures=function(e){e=ga(e),e=e[0].concat(e[1]);for(let t=0;tl.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};d.lists_indexOf=T;var C={init:function(){var g=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL),this.setStyle("list_blocks"),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(function(k){k=k==="REMOVE",this.getSourceBlock().updateStatement_(k)}),this.appendValueInput("VALUE").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL),this.setInputsInline(!0),this.setOutput(!0),this.updateAt_(!0),this.setTooltip(()=>{const k=this.getFieldValue("MODE"),W=this.getFieldValue("WHERE");let J="";switch(k+" "+W){case"GET FROM_START":case"GET FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case"GET FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case"GET LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case"GET RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM;break;case"GET_REMOVE FROM_START":case"GET_REMOVE FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case"GET_REMOVE FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case"GET_REMOVE LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case"GET_REMOVE RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case"REMOVE FROM_START":case"REMOVE FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case"REMOVE FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case"REMOVE LAST":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case"REMOVE RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}return(W==="FROM_START"||W==="FROM_END")&&(J+=" "+(W==="FROM_START"?l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),J})},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");g.setAttribute("statement",String(!this.outputConnection));const k=this.getInput("AT")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(k)),g},domToMutation:function(g){const k=g.getAttribute("statement")==="true";this.updateStatement_(k),g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return this.outputConnection?null:{isStatement:!0}},loadExtraState:function(g){g.isStatement?this.updateStatement_(!0):typeof g=="string"&&this.domToMutation(l.textToDom$$module$build$src$core$utils$xml(g))},updateStatement_:function(g){g!==!this.outputConnection&&(this.unplug(!0,!0),g?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const k=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});k.setValidator(function(W){const J=W==="FROM_START"||W==="FROM_END";if(J!==g){const Ee=this.getSourceBlock();return Ee.updateAt_(J),Ee.setFieldValue(W,"WHERE"),null}}),this.getInput("AT").appendField(k,"WHERE"),l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};d.lists_getIndex=C;var S={init:function(){var g=[[l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[l.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),this.appendDummyInput().appendField(g,"MODE").appendField("","SPACE"),this.appendDummyInput("AT"),this.appendValueInput("TO").appendField(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP),this.updateAt_(!0),this.setTooltip(()=>{const k=this.getFieldValue("MODE"),W=this.getFieldValue("WHERE");let J="";switch(k+" "+W){case"SET FROM_START":case"SET FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case"SET FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case"SET LAST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case"SET RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case"INSERT FROM_START":case"INSERT FROM_END":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case"INSERT FIRST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case"INSERT LAST":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case"INSERT RANDOM":J=l.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}return(W==="FROM_START"||W==="FROM_END")&&(J+=" "+l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),J})},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation"),k=this.getInput("AT")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at",String(k)),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g){this.removeInput("AT"),this.removeInput("ORDINAL",!0),g?(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");const k=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});k.setValidator(function(W){const J=W==="FROM_START"||W==="FROM_END";if(J!==g){const Ee=this.getSourceBlock();return Ee.updateAt_(J),Ee.setFieldValue(W,"WHERE"),null}}),this.moveInputBefore("AT","TO"),this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO"),this.getInput("AT").appendField(k,"WHERE")}};d.lists_setIndex=S;var P={init:function(){this.WHERE_OPTIONS_1=[[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]],this.WHERE_OPTIONS_2=[[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"],[l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]],this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("LIST").setCheck("Array").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST),this.appendDummyInput("AT1"),this.appendDummyInput("AT2"),l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.updateAt_(1,!0),this.updateAt_(2,!0),this.setTooltip(l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");var k=this.getInput("AT1")instanceof l.ValueInput$$module$build$src$core$inputs$value_input;return g.setAttribute("at1",String(k)),k=this.getInput("AT2")instanceof l.ValueInput$$module$build$src$core$inputs$value_input,g.setAttribute("at2",String(k)),g},domToMutation:function(g){const k=g.getAttribute("at1")==="true";g=g.getAttribute("at2")==="true",this.updateAt_(1,k),this.updateAt_(2,g)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(g,k){this.removeInput("AT"+g),this.removeInput("ORDINAL"+g,!0),k?(this.appendValueInput("AT"+g).setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+g).appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+g);const W=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+g]});W.setValidator(function(J){const Ee=J==="FROM_START"||J==="FROM_END";if(Ee!==k){const ze=this.getSourceBlock();return ze.updateAt_(g,Ee),ze.setFieldValue(J,"WHERE"+g),null}}),this.getInput("AT"+g).appendField(W,"WHERE"+g),g===1&&(this.moveInputBefore("AT1","AT2"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","AT2")),l.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};d.lists_getSublist=P,d.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}},d.lists_split={init:function(){const g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[l.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!g)throw Error("field_dropdown not found");g.setValidator(k=>{this.updateType_(k)}),this.setHelpUrl(l.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL),this.setStyle("list_blocks"),this.appendValueInput("INPUT").setCheck("String").appendField(g,"MODE"),this.appendValueInput("DELIM").setCheck("String").appendField(l.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER),this.setInputsInline(!0),this.setOutput(!0,"Array"),this.setTooltip(()=>{const k=this.getFieldValue("MODE");if(k==="SPLIT")return l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(k==="JOIN")return l.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+k)})},updateType_:function(g){if(this.getFieldValue("MODE")!==g){const k=this.getInput("INPUT").connection;k.setShadowDom(null);const W=k.targetBlock();W&&(k.disconnect(),W.isShadow()?W.dispose(!1):this.bumpNeighbours())}g==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("mode",this.getFieldValue("MODE")),g},domToMutation:function(g){this.updateType_(g.getAttribute("mode"))},saveExtraState:function(){return null},loadExtraState:function(){}},l.defineBlocks$$module$build$src$core$common(d);var x={};x.blocks=d;var G=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"logic_boolean",message0:"%1",args0:[{type:"field_dropdown",name:"BOOL",options:[["%{BKY_LOGIC_BOOLEAN_TRUE}","TRUE"],["%{BKY_LOGIC_BOOLEAN_FALSE}","FALSE"]]}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_BOOLEAN_TOOLTIP}",helpUrl:"%{BKY_LOGIC_BOOLEAN_HELPURL}"},{type:"controls_if",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],previousStatement:null,nextStatement:null,style:"logic_blocks",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,mutator:"controls_if_mutator",extensions:["controls_if_tooltip"]},{type:"controls_ifelse",message0:"%{BKY_CONTROLS_IF_MSG_IF} %1",args0:[{type:"input_value",name:"IF0",check:"Boolean"}],message1:"%{BKY_CONTROLS_IF_MSG_THEN} %1",args1:[{type:"input_statement",name:"DO0"}],message2:"%{BKY_CONTROLS_IF_MSG_ELSE} %1",args2:[{type:"input_statement",name:"ELSE"}],previousStatement:null,nextStatement:null,style:"logic_blocks",tooltip:"%{BKYCONTROLS_IF_TOOLTIP_2}",helpUrl:"%{BKY_CONTROLS_IF_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_if_tooltip"]},{type:"logic_compare",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A"},{type:"field_dropdown",name:"OP",options:[["=","EQ"],["≠","NEQ"],["‏<","LT"],["‏≤","LTE"],["‏>","GT"],["‏≥","GTE"]]},{type:"input_value",name:"B"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]},{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}],message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif",message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),oe={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}",LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};l.register$$module$build$src$core$extensions("logic_op_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("OP",oe));var ne={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=l.createElement$$module$build$src$core$utils$xml("mutation");return this.elseifCount_&&g.setAttribute("elseif",String(this.elseifCount_)),this.elseCount_&&g.setAttribute("else","1"),g},domToMutation:function(g){this.elseifCount_=parseInt(g.getAttribute("elseif"),10)||0,this.elseCount_=parseInt(g.getAttribute("else"),10)||0,this.rebuildShape_()},saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const g=Object.create(null);return this.elseifCount_&&(g.elseIfCount=this.elseifCount_),this.elseCount_&&(g.hasElse=!0),g},loadExtraState:function(g){this.elseifCount_=g.elseIfCount||0,this.elseCount_=g.hasElse?1:0,this.updateShape_()},decompose:function(g){const k=g.newBlock("controls_if_if");k.initSvg();let W=k.nextConnection;for(let J=1;J<=this.elseifCount_;J++){const Ee=g.newBlock("controls_if_elseif");Ee.initSvg(),W.connect(Ee.previousConnection),W=Ee.nextConnection}return this.elseCount_&&(g=g.newBlock("controls_if_else"),g.initSvg(),W.connect(g.previousConnection)),k},compose:function(g){g=g.nextConnection.targetBlock(),this.elseCount_=this.elseifCount_=0;const k=[null],W=[null];let J=null;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":this.elseifCount_++,k.push(g.valueConnection_),W.push(g.statementConnection_);break;case"controls_if_else":this.elseCount_++,J=g.statementConnection_;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}this.updateShape_(),this.reconnectChildBlocks_(k,W,J)},saveConnections:function(g){g=g.nextConnection.targetBlock();let k=1;for(;g;){if(!g.isInsertionMarker())switch(g.type){case"controls_if_elseif":var W=this.getInput("IF"+k);const J=this.getInput("DO"+k);g.valueConnection_=W&&W.connection.targetConnection,g.statementConnection_=J&&J.connection.targetConnection,k++;break;case"controls_if_else":W=this.getInput("ELSE"),g.statementConnection_=W&&W.connection.targetConnection;break;default:throw TypeError("Unknown block type: "+g.type)}g=g.getNextBlock()}},rebuildShape_:function(){const g=[null],k=[null];let W=null;this.getInput("ELSE")&&(W=this.getInput("ELSE").connection.targetConnection);for(let J=1;this.getInput("IF"+J);J++){const Ee=this.getInput("IF"+J),ze=this.getInput("DO"+J);g.push(Ee.connection.targetConnection),k.push(ze.connection.targetConnection)}this.updateShape_(),this.reconnectChildBlocks_(g,k,W)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE");for(var g=1;this.getInput("IF"+g);g++)this.removeInput("IF"+g),this.removeInput("DO"+g);for(g=1;g<=this.elseifCount_;g++)this.appendValueInput("IF"+g).setCheck("Boolean").appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+g).appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField(l.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(g,k,W){for(let J=1;J<=this.elseifCount_;J++){let Ee;(Ee=g[J])==null||Ee.reconnect(this,"IF"+J);let ze;(ze=k[J])==null||ze.reconnect(this,"DO"+J)}W==null||W.reconnect(this,"ELSE")}};l.registerMutator$$module$build$src$core$extensions("controls_if_mutator",ne,null,["controls_if_elseif","controls_if_else"]);var Z=function(){this.setTooltip((function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return l.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1;return""}).bind(this))};l.register$$module$build$src$core$extensions("controls_if_tooltip",Z);var Y={onchange:function(g){this.prevBlocks_||(this.prevBlocks_=[null,null]);var k=this.getInputTargetBlock("A");const W=this.getInputTargetBlock("B");k&&W&&!this.workspace.connectionChecker.doTypeChecks(k.outputConnection,W.outputConnection)&&(l.setGroup$$module$build$src$core$events$utils(g.group),g=this.prevBlocks_[0],g!==k&&(k.unplug(),!g||g.isDisposed()||g.isShadow()||this.getInput("A").connection.connect(g.outputConnection)),k=this.prevBlocks_[1],k!==W&&(W.unplug(),!k||k.isDisposed()||k.isShadow()||this.getInput("B").connection.connect(k.outputConnection)),this.bumpNeighbours(),l.setGroup$$module$build$src$core$events$utils(!1)),this.prevBlocks_[0]=this.getInputTargetBlock("A"),this.prevBlocks_[1]=this.getInputTargetBlock("B")}},M=function(){this.mixin(Y)};l.register$$module$build$src$core$extensions("logic_compare",M);var L={prevParentConnection_:null,onchange:function(g){const k=this.getInputTargetBlock("THEN"),W=this.getInputTargetBlock("ELSE"),J=this.outputConnection.targetConnection;if((k||W)&&J)for(let Ee=0;2>Ee;Ee++){const ze=Ee===1?k:W;ze&&!ze.workspace.connectionChecker.doTypeChecks(ze.outputConnection,J)&&(l.setGroup$$module$build$src$core$events$utils(g.group),J===this.prevParentConnection_?(this.unplug(),J.getSourceBlock().bumpNeighbours()):(ze.unplug(),ze.bumpNeighbours()),l.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=J}};l.registerMixin$$module$build$src$core$extensions("logic_ternary",L),l.defineBlocks$$module$build$src$core$common(G);var R=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"controls_repeat_ext",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"input_value",name:"TIMES",check:"Number"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_repeat",message0:"%{BKY_CONTROLS_REPEAT_TITLE}",args0:[{type:"field_number",name:"TIMES",value:10,min:0,precision:1}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",tooltip:"%{BKY_CONTROLS_REPEAT_TOOLTIP}",helpUrl:"%{BKY_CONTROLS_REPEAT_HELPURL}"},{type:"controls_whileUntil",message0:"%1 %2",args0:[{type:"field_dropdown",name:"MODE",options:[["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_WHILE}","WHILE"],["%{BKY_CONTROLS_WHILEUNTIL_OPERATOR_UNTIL}","UNTIL"]]},{type:"input_value",name:"BOOL",check:"Boolean"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_WHILEUNTIL_HELPURL}",extensions:["controls_whileUntil_tooltip"]},{type:"controls_for",message0:"%{BKY_CONTROLS_FOR_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"FROM",check:"Number",align:"RIGHT"},{type:"input_value",name:"TO",check:"Number",align:"RIGHT"},{type:"input_value",name:"BY",check:"Number",align:"RIGHT"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],inputsInline:!0,previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOR_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_for_tooltip"]},{type:"controls_forEach",message0:"%{BKY_CONTROLS_FOREACH_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:null},{type:"input_value",name:"LIST",check:"Array"}],message1:"%{BKY_CONTROLS_REPEAT_INPUT_DO} %1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FOREACH_HELPURL}",extensions:["contextMenu_newGetVariableBlock","controls_forEach_tooltip"]},{type:"controls_flow_statements",message0:"%1",args0:[{type:"field_dropdown",name:"FLOW",options:[["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK}","BREAK"],["%{BKY_CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE}","CONTINUE"]]}],previousStatement:null,style:"loop_blocks",helpUrl:"%{BKY_CONTROLS_FLOW_STATEMENTS_HELPURL}",suppressPrefixSuffix:!0,extensions:["controls_flow_tooltip","controls_flow_in_loop_check"]}]),F={WHILE:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_WHILE}",UNTIL:"%{BKY_CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL}"};l.register$$module$build$src$core$extensions("controls_whileUntil_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("MODE",F));var z={BREAK:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK}",CONTINUE:"%{BKY_CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE}"};l.register$$module$build$src$core$extensions("controls_flow_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("FLOW",z));var X={customContextMenu:function(g){if(!this.isInFlyout){var k=this.getField("VAR").getVariable(),W=k.name;if(!this.isCollapsed()&&W!==null){k=l.generateVariableFieldDom$$module$build$src$core$variables(k);const J=l.createElement$$module$build$src$core$utils$xml("block");J.setAttribute("type","variables_get"),J.appendChild(k),g.push({enabled:!0,text:l.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",W),callback:l.callbackFactory$$module$build$src$core$contextmenu(this,J)})}}}};l.registerMixin$$module$build$src$core$extensions("contextMenu_newGetVariableBlock",X),l.register$$module$build$src$core$extensions("controls_for_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOR_TOOLTIP}","VAR")),l.register$$module$build$src$core$extensions("controls_forEach_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_CONTROLS_FOREACH_TOOLTIP}","VAR"));var le=new Set(["controls_repeat","controls_repeat_ext","controls_forEach","controls_for","controls_whileUntil"]),$e={getSurroundLoop:function(){let g=this;do{if(le.has(g.type))return g;g=g.getSurroundParent()}while(g);return null},onchange:function(g){var k=this.workspace;if(k.isDragging&&!k.isDragging()&&g.type===l.MOVE$$module$build$src$core$events$utils&&(k=!!this.getSurroundLoop(),this.setWarningText(k?null:l.Msg$$module$build$src$core$msg.CONTROLS_FLOW_STATEMENTS_WARNING),!this.isInFlyout)){const W=l.getGroup$$module$build$src$core$events$utils();l.setGroup$$module$build$src$core$events$utils(g.group),this.setEnabled(k),l.setGroup$$module$build$src$core$events$utils(W)}}};l.registerMixin$$module$build$src$core$extensions("controls_flow_in_loop_check",$e),l.defineBlocks$$module$build$src$core$common(R);var he={};he.blocks=R,he.loopTypes=le;var fe=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"math_number",message0:"%1",args0:[{type:"field_number",name:"NUM",value:0}],output:"Number",helpUrl:"%{BKY_MATH_NUMBER_HELPURL}",style:"math_blocks",tooltip:"%{BKY_MATH_NUMBER_TOOLTIP}",extensions:["parent_tooltip_when_inline"]},{type:"math_arithmetic",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Number"},{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ADDITION_SYMBOL}","ADD"],["%{BKY_MATH_SUBTRACTION_SYMBOL}","MINUS"],["%{BKY_MATH_MULTIPLICATION_SYMBOL}","MULTIPLY"],["%{BKY_MATH_DIVISION_SYMBOL}","DIVIDE"],["%{BKY_MATH_POWER_SYMBOL}","POWER"]]},{type:"input_value",name:"B",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ARITHMETIC_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_single",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_SINGLE_OP_ROOT}","ROOT"],["%{BKY_MATH_SINGLE_OP_ABSOLUTE}","ABS"],["-","NEG"],["ln","LN"],["log10","LOG10"],["e^","EXP"],["10^","POW10"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_SINGLE_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_trig",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_TRIG_SIN}","SIN"],["%{BKY_MATH_TRIG_COS}","COS"],["%{BKY_MATH_TRIG_TAN}","TAN"],["%{BKY_MATH_TRIG_ASIN}","ASIN"],["%{BKY_MATH_TRIG_ACOS}","ACOS"],["%{BKY_MATH_TRIG_ATAN}","ATAN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_TRIG_HELPURL}",extensions:["math_op_tooltip"]},{type:"math_constant",message0:"%1",args0:[{type:"field_dropdown",name:"CONSTANT",options:[["π","PI"],["e","E"],["φ","GOLDEN_RATIO"],["sqrt(2)","SQRT2"],["sqrt(½)","SQRT1_2"],["∞","INFINITY"]]}],output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTANT_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTANT_HELPURL}"},{type:"math_number_property",message0:"%1 %2",args0:[{type:"input_value",name:"NUMBER_TO_CHECK",check:"Number"},{type:"field_dropdown",name:"PROPERTY",options:[["%{BKY_MATH_IS_EVEN}","EVEN"],["%{BKY_MATH_IS_ODD}","ODD"],["%{BKY_MATH_IS_PRIME}","PRIME"],["%{BKY_MATH_IS_WHOLE}","WHOLE"],["%{BKY_MATH_IS_POSITIVE}","POSITIVE"],["%{BKY_MATH_IS_NEGATIVE}","NEGATIVE"],["%{BKY_MATH_IS_DIVISIBLE_BY}","DIVISIBLE_BY"]]}],inputsInline:!0,output:"Boolean",style:"math_blocks",tooltip:"%{BKY_MATH_IS_TOOLTIP}",mutator:"math_is_divisibleby_mutator"},{type:"math_change",message0:"%{BKY_MATH_CHANGE_TITLE}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_MATH_CHANGE_TITLE_ITEM}"},{type:"input_value",name:"DELTA",check:"Number"}],previousStatement:null,nextStatement:null,style:"variable_blocks",helpUrl:"%{BKY_MATH_CHANGE_HELPURL}",extensions:["math_change_tooltip"]},{type:"math_round",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ROUND_OPERATOR_ROUND}","ROUND"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDUP}","ROUNDUP"],["%{BKY_MATH_ROUND_OPERATOR_ROUNDDOWN}","ROUNDDOWN"]]},{type:"input_value",name:"NUM",check:"Number"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ROUND_HELPURL}",tooltip:"%{BKY_MATH_ROUND_TOOLTIP}"},{type:"math_on_list",message0:"%1 %2",args0:[{type:"field_dropdown",name:"OP",options:[["%{BKY_MATH_ONLIST_OPERATOR_SUM}","SUM"],["%{BKY_MATH_ONLIST_OPERATOR_MIN}","MIN"],["%{BKY_MATH_ONLIST_OPERATOR_MAX}","MAX"],["%{BKY_MATH_ONLIST_OPERATOR_AVERAGE}","AVERAGE"],["%{BKY_MATH_ONLIST_OPERATOR_MEDIAN}","MEDIAN"],["%{BKY_MATH_ONLIST_OPERATOR_MODE}","MODE"],["%{BKY_MATH_ONLIST_OPERATOR_STD_DEV}","STD_DEV"],["%{BKY_MATH_ONLIST_OPERATOR_RANDOM}","RANDOM"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Number",style:"math_blocks",helpUrl:"%{BKY_MATH_ONLIST_HELPURL}",mutator:"math_modes_of_list_mutator",extensions:["math_op_tooltip"]},{type:"math_modulo",message0:"%{BKY_MATH_MODULO_TITLE}",args0:[{type:"input_value",name:"DIVIDEND",check:"Number"},{type:"input_value",name:"DIVISOR",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_MODULO_TOOLTIP}",helpUrl:"%{BKY_MATH_MODULO_HELPURL}"},{type:"math_constrain",message0:"%{BKY_MATH_CONSTRAIN_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LOW",check:"Number"},{type:"input_value",name:"HIGH",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_CONSTRAIN_TOOLTIP}",helpUrl:"%{BKY_MATH_CONSTRAIN_HELPURL}"},{type:"math_random_int",message0:"%{BKY_MATH_RANDOM_INT_TITLE}",args0:[{type:"input_value",name:"FROM",check:"Number"},{type:"input_value",name:"TO",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_INT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_INT_HELPURL}"},{type:"math_random_float",message0:"%{BKY_MATH_RANDOM_FLOAT_TITLE_RANDOM}",output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_RANDOM_FLOAT_TOOLTIP}",helpUrl:"%{BKY_MATH_RANDOM_FLOAT_HELPURL}"},{type:"math_atan2",message0:"%{BKY_MATH_ATAN2_TITLE}",args0:[{type:"input_value",name:"X",check:"Number"},{type:"input_value",name:"Y",check:"Number"}],inputsInline:!0,output:"Number",style:"math_blocks",tooltip:"%{BKY_MATH_ATAN2_TOOLTIP}",helpUrl:"%{BKY_MATH_ATAN2_HELPURL}"}]),ke={ADD:"%{BKY_MATH_ARITHMETIC_TOOLTIP_ADD}",MINUS:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MINUS}",MULTIPLY:"%{BKY_MATH_ARITHMETIC_TOOLTIP_MULTIPLY}",DIVIDE:"%{BKY_MATH_ARITHMETIC_TOOLTIP_DIVIDE}",POWER:"%{BKY_MATH_ARITHMETIC_TOOLTIP_POWER}",ROOT:"%{BKY_MATH_SINGLE_TOOLTIP_ROOT}",ABS:"%{BKY_MATH_SINGLE_TOOLTIP_ABS}",NEG:"%{BKY_MATH_SINGLE_TOOLTIP_NEG}",LN:"%{BKY_MATH_SINGLE_TOOLTIP_LN}",LOG10:"%{BKY_MATH_SINGLE_TOOLTIP_LOG10}",EXP:"%{BKY_MATH_SINGLE_TOOLTIP_EXP}",POW10:"%{BKY_MATH_SINGLE_TOOLTIP_POW10}",SIN:"%{BKY_MATH_TRIG_TOOLTIP_SIN}",COS:"%{BKY_MATH_TRIG_TOOLTIP_COS}",TAN:"%{BKY_MATH_TRIG_TOOLTIP_TAN}",ASIN:"%{BKY_MATH_TRIG_TOOLTIP_ASIN}",ACOS:"%{BKY_MATH_TRIG_TOOLTIP_ACOS}",ATAN:"%{BKY_MATH_TRIG_TOOLTIP_ATAN}",SUM:"%{BKY_MATH_ONLIST_TOOLTIP_SUM}",MIN:"%{BKY_MATH_ONLIST_TOOLTIP_MIN}",MAX:"%{BKY_MATH_ONLIST_TOOLTIP_MAX}",AVERAGE:"%{BKY_MATH_ONLIST_TOOLTIP_AVERAGE}",MEDIAN:"%{BKY_MATH_ONLIST_TOOLTIP_MEDIAN}",MODE:"%{BKY_MATH_ONLIST_TOOLTIP_MODE}",STD_DEV:"%{BKY_MATH_ONLIST_TOOLTIP_STD_DEV}",RANDOM:"%{BKY_MATH_ONLIST_TOOLTIP_RANDOM}"};l.register$$module$build$src$core$extensions("math_op_tooltip",l.buildTooltipForDropdown$$module$build$src$core$extensions("OP",ke));var re={mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation"),k=this.getFieldValue("PROPERTY")==="DIVISIBLE_BY";return g.setAttribute("divisor_input",String(k)),g},domToMutation:function(g){g=g.getAttribute("divisor_input")==="true",this.updateShape_(g)},updateShape_:function(g){const k=this.getInput("DIVISOR");g?k||this.appendValueInput("DIVISOR").setCheck("Number"):k&&this.removeInput("DIVISOR")}},Ie=function(){this.getField("PROPERTY").setValidator(function(g){g=g==="DIVISIBLE_BY",this.getSourceBlock().updateShape_(g)})};l.registerMutator$$module$build$src$core$extensions("math_is_divisibleby_mutator",re,Ie),l.register$$module$build$src$core$extensions("math_change_tooltip",l.buildTooltipWithFieldText$$module$build$src$core$extensions("%{BKY_MATH_CHANGE_TOOLTIP}","VAR"));var D={updateType_:function(g){g==="MODE"?this.outputConnection.setCheck("Array"):this.outputConnection.setCheck("Number")},mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("op",this.getFieldValue("OP")),g},domToMutation:function(g){if(g=g.getAttribute("op"),g===null)throw new TypeError("xmlElement had no op attribute");this.updateType_(g)}},B=function(){this.getField("OP").setValidator((function(g){this.updateType_(g)}).bind(this))};l.registerMutator$$module$build$src$core$extensions("math_modes_of_list_mutator",D,B),l.defineBlocks$$module$build$src$core$common(fe);var ae={};ae.blocks=fe;var _e={},Me={setStatements_:function(g){this.hasStatements_!==g&&(g?(this.appendStatementInput("STACK").appendField(l.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=g)},updateParams_:function(){let g="";this.arguments_.length&&(g=l.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+" "+this.arguments_.join(", ")),l.disable$$module$build$src$core$events$utils();try{this.setFieldValue(g,"PARAMS")}finally{l.enable$$module$build$src$core$events$utils()}},mutationToDom:function(g){const k=l.createElement$$module$build$src$core$utils$xml("mutation");g&&k.setAttribute("name",this.getFieldValue("NAME"));for(let W=0;W{this.updateType_(k)}),this.appendValueInput("TEXT").appendField(g,"TYPE"),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});var xe=Object.assign({},et,{init:function(){this.mixin(w);var g=[[l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl(l.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL),this.setStyle("text_blocks"),g=l.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:g}),g.setValidator(k=>{this.updateType_(k)}),this.appendDummyInput().appendField(g,"TYPE").appendField(this.newQuote_(!0)).appendField(l.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1)),this.setOutput(!0,"String"),this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:l.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}});nt.text_prompt=xe,nt.text_count={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}},nt.text_replace={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}},nt.text_reverse={init:function(){this.jsonInit({message0:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:l.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}};var w={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==",QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(g){for(let k=0,W;W=this.inputList[k];k++)for(let J=0,Ee;Ee=W.fieldRow[J];J++)if(g===Ee.name){W.insertFieldAt(J,this.newQuote_(!0)),W.insertFieldAt(J+2,this.newQuote_(!1));return}console.warn('field named "'+g+'" not found in '+this.toDevString())},newQuote_:function(g){return g=this.RTL?!g:g,l.fromJson$$module$build$src$core$field_registry({type:"field_image",src:g?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH,height:this.QUOTE_IMAGE_HEIGHT,alt:g?"“":"”"})}},I=function(){this.mixin(w),this.quoteField_("TEXT")},N={itemCount_:0,mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("items",`${this.itemCount_}`),g},domToMutation:function(g){this.itemCount_=parseInt(g.getAttribute("items"),10),this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(g){this.itemCount_=g.itemCount,this.updateShape_()},decompose:function(g){const k=g.newBlock("text_create_join_container");k.initSvg();let W=k.getInput("STACK").connection;for(let J=0;Jl.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},U={isAt_:!1,mutationToDom:function(){const g=l.createElement$$module$build$src$core$utils$xml("mutation");return g.setAttribute("at",`${this.isAt_}`),g},domToMutation:function(g){g=g.getAttribute("at")!=="false",this.updateAt_(g)},updateAt_:function(g){this.removeInput("AT",!0),this.removeInput("ORDINAL",!0),g&&(this.appendValueInput("AT").setCheck("Number"),l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField(l.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)),l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField(l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL)),this.isAt_=g}},de=function(){this.getField("WHERE").setValidator(function(g){g=g==="FROM_START"||g==="FROM_END";const k=this.getSourceBlock();g!==k.isAt_&&k.updateAt_(g)}),this.updateAt_(!0),this.setTooltip(()=>{var g=this.getFieldValue("WHERE");let k=l.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;return(g==="FROM_START"||g==="FROM_END")&&(g=g==="FROM_START"?l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:l.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(k+=" "+g.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0")),k})};l.register$$module$build$src$core$extensions("text_indexOf_tooltip",K),l.register$$module$build$src$core$extensions("text_quotes",I),l.registerMutator$$module$build$src$core$extensions("text_join_mutator",N,A),l.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",U,de),l.defineBlocks$$module$build$src$core$common(nt);var Te={};Te.blocks=nt;var se=l.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),Ce={customContextMenu:function(g){if(this.isInFlyout)(this.type==="variables_get"||this.type==="variables_get_reporter")&&(k={text:l.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:ce(this)},W=this.getField("VAR").getText(),W={text:l.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",W),enabled:!0,callback:Se(this)},g.unshift(k),g.unshift(W));else{if(this.type==="variables_get")var k="variables_set",W=l.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET;else k="variables_get",W=l.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;const J=this.getField("VAR").getText(),Ee=l.createElement$$module$build$src$core$utils$xml("field");Ee.setAttribute("name","VAR"),Ee.appendChild(l.createTextNode$$module$build$src$core$utils$xml(J));const ze=l.createElement$$module$build$src$core$utils$xml("block");ze.setAttribute("type",k),ze.appendChild(Ee),g.push({enabled:0 String(b) ? 1 : -1; }, + 'IGNORE_CASE': function(a, b) { + return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, + }; + var compare = compareFuncs[type]; + return function(a, b) { return compare(a, b) * direction; }; +} + `),[y+".slice().sort("+m+'("'+_+'", '+V+"))",E.FUNCTION_CALL]},Z=function(_,m){let y=m.valueToCode(_,"INPUT",E.MEMBER);if(m=m.valueToCode(_,"DELIM",E.NONE)||"''",_=_.getFieldValue("MODE"),_==="SPLIT")y||(y="''"),_="split";else if(_==="JOIN")y||(y="[]"),_="join";else throw Error("Unknown mode: "+_);return[y+"."+_+"("+m+")",E.FUNCTION_CALL]},Y=function(_,m){return[(m.valueToCode(_,"LIST",E.FUNCTION_CALL)||"[]")+".slice().reverse()",E.FUNCTION_CALL]},M=function(_,m){var y=0;let V="";m.STATEMENT_PREFIX&&(V+=m.injectId(m.STATEMENT_PREFIX,_));do{const ve=m.valueToCode(_,"IF"+y,E.NONE)||"false";let Ge=m.statementToCode(_,"DO"+y);m.STATEMENT_SUFFIX&&(Ge=m.prefixLines(m.injectId(m.STATEMENT_SUFFIX,_),m.INDENT)+Ge),V+=(0",GTE:">="}[_.getFieldValue("OP")],V=y==="=="||y==="!="?E.EQUALITY:E.RELATIONAL,ve=m.valueToCode(_,"A",V)||"0";return _=m.valueToCode(_,"B",V)||"0",[ve+" "+y+" "+_,V]},R=function(_,m){const y=_.getFieldValue("OP")==="AND"?"&&":"||",V=y==="&&"?E.LOGICAL_AND:E.LOGICAL_OR;let ve=m.valueToCode(_,"A",V);return _=m.valueToCode(_,"B",V),ve||_?(m=y==="&&"?"true":"false",ve||(ve=m),_||(_=m)):_=ve="false",[ve+" "+y+" "+_,V]},F=function(_,m){const y=E.LOGICAL_NOT;return["!"+(m.valueToCode(_,"BOOL",y)||"true"),y]},z=function(_,m){return[_.getFieldValue("BOOL")==="TRUE"?"true":"false",E.ATOMIC]},X=function(_,m){return["null",E.ATOMIC]},le=function(_,m){const y=m.valueToCode(_,"IF",E.CONDITIONAL)||"false",V=m.valueToCode(_,"THEN",E.CONDITIONAL)||"null";return _=m.valueToCode(_,"ELSE",E.CONDITIONAL)||"null",[y+" ? "+V+" : "+_,E.CONDITIONAL]},$e=function(_,m){let y;y=_.getField("TIMES")?String(Number(_.getFieldValue("TIMES"))):m.valueToCode(_,"TIMES",E.ASSIGNMENT)||"0";let V=m.statementToCode(_,"DO");V=m.addLoopTrap(V,_),_="";const ve=m.nameDB_.getDistinctName("count",l.NameType$$module$build$src$core$names.VARIABLE);let Ge=y;return y.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(y)||(Ge=m.nameDB_.getDistinctName("repeat_end",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Ge+" = "+y+`; +`),_+("for (var "+ve+" = 0; "+ve+" < "+Ge+"; "+ve+`++) { +`+V+`} +`)},he=function(_,m){const y=_.getFieldValue("MODE")==="UNTIL";let V=m.valueToCode(_,"BOOL",y?E.LOGICAL_NOT:E.NONE)||"false",ve=m.statementToCode(_,"DO");return ve=m.addLoopTrap(ve,_),y&&(V="!"+V),"while ("+V+`) { +`+ve+`} +`},fe=function(_,m){var y=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),V=m.valueToCode(_,"FROM",E.ASSIGNMENT)||"0",ve=m.valueToCode(_,"TO",E.ASSIGNMENT)||"0";const Ge=m.valueToCode(_,"BY",E.ASSIGNMENT)||"1";let rt=m.statementToCode(_,"DO");if(rt=m.addLoopTrap(rt,_),l.isNumber$$module$build$src$core$utils$string(V)&&l.isNumber$$module$build$src$core$utils$string(ve)&&l.isNumber$$module$build$src$core$utils$string(Ge))m=Number(V)<=Number(ve),_="for ("+y+" = "+V+"; "+y+(m?" <= ":" >= ")+ve+"; "+y,y=Math.abs(Number(Ge)),_=y===1?_+(m?"++":"--"):_+((m?" += ":" -= ")+y),_+=`) { +`+rt+`} +`;else{_="";let Mt=V;V.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(V)||(Mt=m.nameDB_.getDistinctName(y+"_start",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Mt+" = "+V+`; +`),V=ve,ve.match(/^\w+$/)||l.isNumber$$module$build$src$core$utils$string(ve)||(V=m.nameDB_.getDistinctName(y+"_end",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+V+" = "+ve+`; +`),ve=m.nameDB_.getDistinctName(y+"_inc",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+ve+" = ",_=l.isNumber$$module$build$src$core$utils$string(Ge)?_+(Math.abs(Ge)+`; +`):_+("Math.abs("+Ge+`); +`),_+="if ("+Mt+" > "+V+`) { +`,_+=m.INDENT+ve+" = -"+ve+`; +`,_=_+`} +for (`+(y+" = "+Mt+"; "+ve+" >= 0 ? "+y+" <= "+V+" : "+y+" >= "+V+"; "+y+" += "+ve+`) { +`+rt+`} +`)}return _},ke=function(_,m){const y=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE);var V=m.valueToCode(_,"LIST",E.ASSIGNMENT)||"[]";let ve=m.statementToCode(_,"DO");ve=m.addLoopTrap(ve,_),_="";let Ge=V;return V.match(/^\w+$/)||(Ge=m.nameDB_.getDistinctName(y+"_list",l.NameType$$module$build$src$core$names.VARIABLE),_+="var "+Ge+" = "+V+`; +`),V=m.nameDB_.getDistinctName(y+"_index",l.NameType$$module$build$src$core$names.VARIABLE),ve=m.INDENT+y+" = "+Ge+"["+V+`]; +`+ve,_+("for (var "+V+" in "+Ge+`) { +`+ve+`} +`)},re=function(_,m){let y="";if(m.STATEMENT_PREFIX&&(y+=m.injectId(m.STATEMENT_PREFIX,_)),m.STATEMENT_SUFFIX&&(y+=m.injectId(m.STATEMENT_SUFFIX,_)),m.STATEMENT_PREFIX){const V=_.getSurroundLoop();V&&!V.suppressPrefixSuffix&&(y+=m.injectId(m.STATEMENT_PREFIX,V))}switch(_.getFieldValue("FLOW")){case"BREAK":return y+`break; +`;case"CONTINUE":return y+`continue; +`}throw Error("Unknown flow statement.")},Ie=function(_,m){return _=Number(_.getFieldValue("NUM")),[_,0<=_?E.ATOMIC:E.UNARY_NEGATION]},D=function(_,m){var y={ADD:[" + ",E.ADDITION],MINUS:[" - ",E.SUBTRACTION],MULTIPLY:[" * ",E.MULTIPLICATION],DIVIDE:[" / ",E.DIVISION],POWER:[null,E.NONE]}[_.getFieldValue("OP")];const V=y[0];y=y[1];const ve=m.valueToCode(_,"A",y)||"0";return _=m.valueToCode(_,"B",y)||"0",V?[ve+V+_,y]:["Math.pow("+ve+", "+_+")",E.FUNCTION_CALL]},B=function(_,m){const y=_.getFieldValue("OP");let V;if(y==="NEG")return _=m.valueToCode(_,"NUM",E.UNARY_NEGATION)||"0",_[0]==="-"&&(_=" "+_),["-"+_,E.UNARY_NEGATION];switch(_=y==="SIN"||y==="COS"||y==="TAN"?m.valueToCode(_,"NUM",E.DIVISION)||"0":m.valueToCode(_,"NUM",E.NONE)||"0",y){case"ABS":V="Math.abs("+_+")";break;case"ROOT":V="Math.sqrt("+_+")";break;case"LN":V="Math.log("+_+")";break;case"EXP":V="Math.exp("+_+")";break;case"POW10":V="Math.pow(10,"+_+")";break;case"ROUND":V="Math.round("+_+")";break;case"ROUNDUP":V="Math.ceil("+_+")";break;case"ROUNDDOWN":V="Math.floor("+_+")";break;case"SIN":V="Math.sin("+_+" / 180 * Math.PI)";break;case"COS":V="Math.cos("+_+" / 180 * Math.PI)";break;case"TAN":V="Math.tan("+_+" / 180 * Math.PI)"}if(V)return[V,E.FUNCTION_CALL];switch(y){case"LOG10":V="Math.log("+_+") / Math.log(10)";break;case"ASIN":V="Math.asin("+_+") / Math.PI * 180";break;case"ACOS":V="Math.acos("+_+") / Math.PI * 180";break;case"ATAN":V="Math.atan("+_+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+y)}return[V,E.DIVISION]},ae=function(_,m){return{PI:["Math.PI",E.MEMBER],E:["Math.E",E.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",E.DIVISION],SQRT2:["Math.SQRT2",E.MEMBER],SQRT1_2:["Math.SQRT1_2",E.MEMBER],INFINITY:["Infinity",E.ATOMIC]}[_.getFieldValue("CONSTANT")]},_e=function(_,m){var y={EVEN:[" % 2 === 0",E.MODULUS,E.EQUALITY],ODD:[" % 2 === 1",E.MODULUS,E.EQUALITY],WHOLE:[" % 1 === 0",E.MODULUS,E.EQUALITY],POSITIVE:[" > 0",E.RELATIONAL,E.RELATIONAL],NEGATIVE:[" < 0",E.RELATIONAL,E.RELATIONAL],DIVISIBLE_BY:[null,E.MODULUS,E.EQUALITY],PRIME:[null,E.NONE,E.FUNCTION_CALL]};const V=_.getFieldValue("PROPERTY"),[ve,Ge,rt]=y[V];return y=m.valueToCode(_,"NUMBER_TO_CHECK",Ge)||"0",V==="PRIME"?_=m.provideFunction_("mathIsPrime",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(n) { + // https://en.wikipedia.org/wiki/Primality_test#Naive_methods + if (n == 2 || n == 3) { + return true; + } + // False if n is NaN, negative, is 1, or not whole. + // And false if n is divisible by 2 or 3. + if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) { + return false; + } + // Check all the numbers of form 6k +/- 1, up to sqrt(n). + for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) { + if (n % (x - 1) === 0 || n % (x + 1) === 0) { + return false; + } + } + return true; +} +`)+"("+y+")":V==="DIVISIBLE_BY"?(_=m.valueToCode(_,"DIVISOR",E.MODULUS)||"0",_=y+" % "+_+" === 0"):_=y+ve,[_,rt]},Me=function(_,m){const y=m.valueToCode(_,"DELTA",E.ADDITION)||"0";return _=m.nameDB_.getName(_.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),_+" = (typeof "+_+" === 'number' ? "+_+" : 0) + "+y+`; +`},Xe=function(_,m){var y=_.getFieldValue("OP");switch(y){case"SUM":_=m.valueToCode(_,"LIST",E.MEMBER)||"[]",_+=".reduce(function(x, y) {return x + y;}, 0)";break;case"MIN":_=m.valueToCode(_,"LIST",E.NONE)||"[]",_="Math.min.apply(null, "+_+")";break;case"MAX":_=m.valueToCode(_,"LIST",E.NONE)||"[]",_="Math.max.apply(null, "+_+")";break;case"AVERAGE":y=m.provideFunction_("mathMean",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(myList) { + return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=y+"("+_+")";break;case"MEDIAN":y=m.provideFunction_("mathMedian",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(myList) { + var localList = myList.filter(function (x) {return typeof x === 'number';}); + if (!localList.length) return null; + localList.sort(function(a, b) {return b - a;}); + if (localList.length % 2 === 0) { + return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2; + } else { + return localList[(localList.length - 1) / 2]; + } +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=y+"("+_+")";break;case"MODE":y=m.provideFunction_("mathModes",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(values) { + var modes = []; + var counts = []; + var maxCount = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + var found = false; + var thisCount; + for (var j = 0; j < counts.length; j++) { + if (counts[j][0] === value) { + thisCount = ++counts[j][1]; + found = true; + break; + } + } + if (!found) { + counts.push([value, 1]); + thisCount = 1; + } + maxCount = Math.max(thisCount, maxCount); + } + for (var j = 0; j < counts.length; j++) { + if (counts[j][1] === maxCount) { + modes.push(counts[j][0]); + } + } + return modes; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=y+"("+_+")";break;case"STD_DEV":y=m.provideFunction_("mathStandardDeviation",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(numbers) { + var n = numbers.length; + if (!n) return null; + var mean = numbers.reduce(function(x, y) {return x + y;}) / n; + var variance = 0; + for (var j = 0; j < n; j++) { + variance += Math.pow(numbers[j] - mean, 2); + } + variance = variance / n; + return Math.sqrt(variance); +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=y+"("+_+")";break;case"RANDOM":y=m.provideFunction_("mathRandomList",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(list) { + var x = Math.floor(Math.random() * list.length); + return list[x]; +} +`),_=m.valueToCode(_,"LIST",E.NONE)||"[]",_=y+"("+_+")";break;default:throw Error("Unknown operator: "+y)}return[_,E.FUNCTION_CALL]},Je=function(_,m){const y=m.valueToCode(_,"DIVIDEND",E.MODULUS)||"0";return _=m.valueToCode(_,"DIVISOR",E.MODULUS)||"0",[y+" % "+_,E.MODULUS]},we=function(_,m){const y=m.valueToCode(_,"VALUE",E.NONE)||"0",V=m.valueToCode(_,"LOW",E.NONE)||"0";return _=m.valueToCode(_,"HIGH",E.NONE)||"Infinity",["Math.min(Math.max("+y+", "+V+"), "+_+")",E.FUNCTION_CALL]},We=function(_,m){const y=m.valueToCode(_,"FROM",E.NONE)||"0";return _=m.valueToCode(_,"TO",E.NONE)||"0",[m.provideFunction_("mathRandomInt",` +function ${m.FUNCTION_NAME_PLACEHOLDER_}(a, b) { + if (a > b) { + // Swap a and b to ensure a is smaller. + var c = a; + a = b; + b = c; + } + return Math.floor(Math.random() * (b - a + 1) + a); +} +`)+"("+y+", "+_+")",E.FUNCTION_CALL]},Ze=function(_,m){return["Math.random()",E.FUNCTION_CALL]},nt=function(_,m){const y=m.valueToCode(_,"X",E.NONE)||"0";return["Math.atan2("+(m.valueToCode(_,"Y",E.NONE)||"0")+", "+y+") / Math.PI * 180",E.DIVISION]},ht=function(_,m){const y=m.nameDB_.getName(_.getFieldValue("NAME"),l.NameType$$module$build$src$core$names.PROCEDURE);var V="";m.STATEMENT_PREFIX&&(V+=m.injectId(m.STATEMENT_PREFIX,_)),m.STATEMENT_SUFFIX&&(V+=m.injectId(m.STATEMENT_SUFFIX,_)),V&&(V=m.prefixLines(V,m.INDENT));let ve="";m.INFINITE_LOOP_TRAP&&(ve=m.prefixLines(m.injectId(m.INFINITE_LOOP_TRAP,_),m.INDENT));const Ge=m.statementToCode(_,"STACK");let rt=m.valueToCode(_,"RETURN",E.NONE)||"",Mt="";Ge&&rt&&(Mt=V),rt&&(rt=m.INDENT+"return "+rt+`; +`);const po=[],Be=_.getVars();for(let wt=0;wty?rt=Mt=this.ORDER_SUBTRACTION:V&&(rt=Mt=this.ORDER_UNARY_NEGATION),_=this.valueToCode(_,m,Mt)||Ge,l.isNumber$$module$build$src$core$utils$string(_)?(_=Number(_)+y,V&&(_=-_)):(0y&&(_=_+" - "+-y),V&&(_=y?"-("+_+")":"-"+_),rt=Math.floor(rt),ve=Math.floor(ve),rt&&ve>=rt&&(_="("+_+")")),_}},k={};k.colour_blend=h,k.colour_picker=a,k.colour_random=u,k.colour_rgb=d;var W=function(_,m,y){return m==="FIRST"?"0":m==="FROM_END"?_+".length - 1 - "+y:m==="LAST"?_+".length - 1":y},J={};J.lists_create_empty=p,J.lists_create_with=f,J.lists_getIndex=x,J.lists_getSublist=oe,J.lists_indexOf=P,J.lists_isEmpty=S,J.lists_length=C,J.lists_repeat=T,J.lists_reverse=Y,J.lists_setIndex=G,J.lists_sort=ne,J.lists_split=Z;var Ee={};Ee.controls_if=M,Ee.controls_ifelse=M,Ee.logic_boolean=z,Ee.logic_compare=L,Ee.logic_negate=F,Ee.logic_null=X,Ee.logic_operation=R,Ee.logic_ternary=le;var ze={};ze.controls_flow_statements=re,ze.controls_for=fe,ze.controls_forEach=ke,ze.controls_repeat=$e,ze.controls_repeat_ext=$e,ze.controls_whileUntil=he;var yt={};yt.math_arithmetic=D,yt.math_atan2=nt,yt.math_change=Me,yt.math_constant=ae,yt.math_constrain=we,yt.math_modulo=Je,yt.math_number=Ie,yt.math_number_property=_e,yt.math_on_list=Xe,yt.math_random_float=Ze,yt.math_random_int=We,yt.math_round=B,yt.math_single=B,yt.math_trig=B;var ls={};ls.procedures_callnoreturn=xe,ls.procedures_callreturn=et,ls.procedures_defnoreturn=ht,ls.procedures_defreturn=ht,ls.procedures_ifreturn=w;var ii=/^\s*'([^']|\\')*'\s*$/,xt=function(_){return ii.test(_)?[_,E.ATOMIC]:["String("+_+")",E.FUNCTION_CALL]},Qo=function(_,m,y){return m==="FIRST"?"0":m==="FROM_END"?_+".length - 1 - "+y:m==="LAST"?_+".length - 1":y},Ht={};Ht.text=I,Ht.text_append=K,Ht.text_changeCase=ce,Ht.text_charAt=se,Ht.text_count=be,Ht.text_getSubstring=Ce,Ht.text_indexOf=Te,Ht.text_isEmpty=de,Ht.text_join=A,Ht.text_length=U,Ht.text_multiline=N,Ht.text_print=Ne,Ht.text_prompt=He,Ht.text_prompt_ext=He,Ht.text_replace=ee,Ht.text_reverse=ie,Ht.text_trim=Se;var ws={};ws.variables_get=ue,ws.variables_set=ye;var qo={};qo.variables_get_dynamic=ue,qo.variables_set_dynamic=ye;var b=new g;Object.assign(b.forBlock,k,J,Ee,ze,yt,ls,Ht,ws,qo);var O={};return O.JavascriptGenerator=g,O.Order=E,O.javascriptGenerator=b,O.__namespace__=l,O})}(d0)),d0.exports}var Mb;function o8(){return Mb||(Mb=1,function(o,n){(function(s,l){o.exports=l(Gc(),t8())})(Do,function(s,l){/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return l})}(u0)),u0.exports}var Db;function s8(){return Db||(Db=1,function(o,n){(function(s,l){o.exports=l(Gc(),J5(),e8(),o8())})(Do,function(s,l,a,u){return s.setLocale(l),s})}(s0)),s0.exports}(function(o,n){(function(s,l){o.exports=l(s8())})(Do,function(s){/** + * @license + * Copyright 2019 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return s})})(e2);var i8=e2.exports;const Tt=CI(i8);Tt.defineBlocksWithJsonArray([{type:"controls_forever",message0:"%1",args0:[{type:"field_label",text:"永远 循环"}],message1:"%1",args1:[{type:"input_statement",name:"DO"}],previousStatement:null,nextStatement:null,style:"controller",tooltip:"重复执行。"},{type:"math_evenly_divisible",message0:"%1 能被 %2 整除",args0:[{type:"input_value",name:"DIVIDEND",check:"Number",value:0},{type:"input_value",name:"DIVISOR",check:"Number",value:0}],output:"Boolean",style:"calculation",tooltip:"判断第一个数是否恰好被第二个数整除。"},{type:"lists_split",message0:"把 %1 按 %2 %3",args0:[{type:"input_value",name:"INPUT",check:["String","Array"]},{type:"input_value",name:"DELIM",check:"String"},{type:"field_dropdown",name:"MODE",options:[["分开成列表","SPLIT"],["合并为文本","JOIN"]]}],output:["String","Array"],style:"calculation",tooltip:"将文本分开成列表或将列表合并为文本。"},{type:"text_charAt",message0:"取 %1 %2 第 %3 个字符",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],output:"String",style:"calculation",tooltip:"取文本指定位置的字符。"},{type:"text_getSubstring",message0:"取 %1 %2 第 %3 到 %4 第 %5 个字符",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE1",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX1",check:"Number"},{type:"field_dropdown",name:"WHERE2",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX2",check:"Number"}],output:"String",style:"calculation",tooltip:"取文本指定位置的字符。"},{type:"math_types",message0:"把 %1 转换为 %2 类型",args0:[{type:"input_value",name:"VALUE"},{type:"field_dropdown",name:"TYPE",options:[["字符串","STRING"],["数值","NUMBER"],["布尔","BOOLEAN"]]}],output:"String",style:"calculation",tooltip:"将对象转换为指定类型。"},{type:"lists_push",message0:"添加 %1 到 %2 末尾",args0:[{type:"input_value",name:"VALUE",check:"Number"},{type:"input_value",name:"LIST",check:"Array"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"添加值到列表的末尾。"},{type:"lists_insert",message0:"插入 %1 到 %2 %3 第 %4 项后面",args0:[{type:"input_value",name:"VALUE"},{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"添加值到列表的末尾。"},{type:"lists_delete",message0:"删除 %1 %2 第 %3 项",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],previousStatement:null,nextStatement:null,style:"lists_delete",tooltip:"删除列表的指定项。"},{type:"lists_set",message0:"替换 %1 %2 第 %3 项为 %4",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"lists",tooltip:"替换列表的指定项。"},{type:"lists_get",message0:"%1 %2 第 %3 项",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHERE",options:[["正数","FROM_START"],["倒数","FROM_END"]]},{type:"input_value",name:"INDEX",check:"Number"}],output:"Any",style:"lists",tooltip:"获取列表的指定项。"},{type:"lists_index",message0:"%1 中 %2 %3 的位置",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"field_dropdown",name:"WHICH",options:[["第一个","FIRST"],["最后一个","LAST"]]},{type:"input_value",name:"VALUE"}],output:"Number",style:"lists",tooltip:"返回在列表中的第一个/最后一个匹配项的索引值,如果找不到项目则返回列表本身。"},{type:"lists_includes",message0:"%1 中包含 %2",args0:[{type:"input_value",name:"LIST",check:"Array"},{type:"input_value",name:"VALUE"}],output:"Boolean",style:"lists",tooltip:"列表中是否包含指定项。"},{type:"time_current",message0:"当前时间戳",output:"Number",style:"time",tooltip:"获取当前时间戳。"},{type:"time_timestamp_to_date",message0:"时间戳 %1 转换为日期字符串",args0:[{type:"input_value",name:"TIMESTAMP",check:"Number"}],output:"String",style:"time",tooltip:"将时间戳转换为日期字符串。"},{type:"time_import",message0:"引入time库",previousStatement:null,nextStatement:null,style:"time",tooltip:"引入时间库。"},{type:"sqlite_open",message0:"打开数据库 %1",args0:[{type:"input_value",name:"DATABASE",check:"String"}],output:"sqlite3.Connection",style:"sqlite",tooltip:"打开数据库连接。"},{type:"sqlite_query",message0:"执行查询 %1",args0:[{type:"input_value",name:"QUERY",check:"String"}],output:"sqlite3.Cursor",style:"sqlite",tooltip:"执行SQL查询。"},{type:"sqlite_exec",message0:"执行命令 %1",args0:[{type:"input_value",name:"COMMAND",check:"String"}],previousStatement:null,nextStatement:null,style:"sqlite",tooltip:"执行SQL命令。"},{type:"sqlite_close",message0:"关闭数据库连接",previousStatement:null,nextStatement:null,style:"sqlite",tooltip:"关闭数据库连接。"},{type:"http_import",message0:"引入http库",previousStatement:null,nextStatement:null,style:"http",tooltip:"引入HTTP库。"},{type:"http_get",message0:"发送GET请求到 链接:%1 请求头(字典):%2 cookie(字典):%3",args0:[{type:"input_value",name:"URL",check:"String"},{type:"input_value",name:"HEADERS",check:"Array"},{type:"input_value",name:"COOKIES",check:"Array"}],output:"String",style:"http",tooltip:"发送GET请求。"},{type:"http_post",message0:"发送POST请求到 链接:%1 请求体(字典):%2 请求头(字典):%3 cookie(字典):%4",args0:[{type:"input_value",name:"URL",check:"String"},{type:"input_value",name:"BODY",check:"Array"},{type:"input_value",name:"HEADERS",check:"Array"},{type:"input_value",name:"COOKIES",check:"Array"}],output:"String",style:"http",tooltip:"发送POST请求。"},{type:"dict_get",message0:"获取字典 %1 的键 %2 的值",args0:[{type:"input_value",name:"DICT",check:"Array"},{type:"input_value",name:"KEY",check:"String"}],output:"Any",style:"dict",tooltip:"获取字典的指定键的值。"},{type:"dict_create",message0:"创建字典",output:"Array",style:"dict",tooltip:"创建一个空字典。"},{type:"dict_set",message0:"设置字典 %1 的键 %2 的值为 %3",args0:[{type:"input_value",name:"DICT",check:"Array"},{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"dict",tooltip:"设置字典的指定键的值。"},{type:"set_dict",message0:"创建字典 键 %1 : %2",args0:[{type:"input_value",name:"KEY",check:"String"},{type:"input_value",name:"VALUE"}],output:"Array",style:"dict",tooltip:"创建一个空字典。"}]);const n8="categoryToolbox",r8=[{kind:"category",name:"控制",categorystyle:"controller",contents:[{kind:"block",type:"controls_forever"},{kind:"block",type:"controls_repeat_ext",inputs:{TIMES:{block:{type:"math_number",fields:{NUM:1}}}}},{kind:"block",type:"controls_for",inputs:{FROM:{block:{type:"math_number",fields:{NUM:1}}},TO:{block:{type:"math_number",fields:{NUM:10}}},BY:{block:{type:"math_number",fields:{NUM:1}}}}},{kind:"block",type:"controls_forEach"},{kind:"block",type:"controls_whileUntil"},{kind:"block",type:"controls_flow_statements"},{kind:"sep",gap:"64"},{kind:"block",type:"controls_if"},{kind:"block",type:"controls_if",extraState:{hasElse:!0}},{kind:"sep",gap:"64"},{kind:"block",type:"logic_ternary",inline:"true"}]},{kind:"category",name:"运算",categorystyle:"calculation",contents:[{kind:"block",type:"math_number",fields:{NUM:0}},{kind:"block",type:"math_arithmetic",inputs:{A:{block:{type:"math_number",fields:{NUM:0}}},B:{block:{type:"math_number",fields:{NUM:0}}}}},{kind:"block",type:"math_random_int",inputs:{FROM:{block:{type:"math_number",fields:{NUM:0}}},TO:{block:{type:"math_number",fields:{NUM:5}}}}},{kind:"sep",gap:"64"},{kind:"block",type:"logic_boolean"},{kind:"block",type:"logic_compare"},{kind:"block",type:"logic_operation"},{kind:"block",type:"logic_negate"},{kind:"sep",gap:"64"},{kind:"block",type:"math_round"},{kind:"block",type:"math_modulo"},{kind:"block",type:"math_evenly_divisible",inputs:{DIVIDEND:{block:{type:"math_number",fields:{NUM:9}}},DIVISOR:{block:{type:"math_number",fields:{NUM:3}}}}},{kind:"block",type:"math_number_property"},{kind:"block",type:"math_trig"},{kind:"block",type:"math_single"},{kind:"sep",gap:"64"},{kind:"block",type:"text"},{kind:"block",type:"text_join",inline:"true",extraState:{itemCount:2}},{kind:"block",type:"lists_split"},{kind:"block",type:"text_indexOf"},{kind:"block",type:"text_charAt"},{kind:"block",type:"text_getSubstring"},{kind:"block",type:"text_replace"},{kind:"block",type:"text_count"},{kind:"block",type:"text_length"},{kind:"block",type:"text_changeCase"},{kind:"block",type:"text_trim"},{kind:"block",type:"math_types"}]},{kind:"category",name:"变量",categorystyle:"variable",custom:"VARIABLE",contents:[{kind:"block",type:"variables_set"},{kind:"block",type:"math_change"},{kind:"block",type:"variables_get"}]},{kind:"category",name:"列表",categorystyle:"list",contents:[{kind:"block",type:"lists_create_empty"},{kind:"block",type:"lists_create_with",inline:"true",extraState:{itemCount:1}},{kind:"block",type:"lists_push"},{kind:"block",type:"lists_insert"},{kind:"block",type:"lists_delete"},{kind:"block",type:"lists_set"},{kind:"sep",gap:"64"},{kind:"block",type:"lists_get"},{kind:"block",type:"lists_length"},{kind:"block",type:"lists_index"},{kind:"block",type:"lists_includes"}]},{kind:"category",name:"字典",categorystyle:"dict",contents:[{kind:"block",type:"set_dict",inline:"true",extraState:{itemCount:1}},{kind:"block",type:"dict_get"},{kind:"block",type:"dict_create"},{kind:"block",type:"dict_set"}]},{kind:"category",name:"函数",categorystyle:"function",custom:"PROCEDURE",contents:[{kind:"block",type:"procedures_defnoreturn"},{kind:"block",type:"procedures_defreturn"}]},{kind:"category",name:"时间",categorystyle:"time",contents:[{kind:"block",type:"time_import"},{kind:"block",type:"time_current"},{kind:"block",type:"time_timestamp_to_date"}]},{kind:"category",name:"HTTP",categorystyle:"http",contents:[{kind:"block",type:"http_import"},{kind:"block",type:"http_get"},{kind:"block",type:"http_post"}]},{kind:"category",name:"Sqlite",categorystyle:"sqlite",contents:[{kind:"block",type:"sqlite_open"},{kind:"block",type:"sqlite_query"},{kind:"block",type:"sqlite_exec"},{kind:"block",type:"sqlite_close"}]}],t2={kind:n8,contents:r8};function tn(o,n){const s=Tt.Blocks[o].init;Tt.Blocks[o].init=function(){s.bind(this)(),this.setStyle(n),this.inputsInline=!0}}t2.contents.forEach(function(o){if("contents"in o){let n=o.categorystyle;o.contents.forEach(function(s){s.kind==="block"&&tn(s.type,n)})}else console.warn("This category is empty. ","If you are using a custom approach, ","please list all possible blocks in contents for a unified format.")});Tt.Theme.defineTheme("codemao",{base:Tt.Themes.Zelos,blockStyles:{controller:{colourPrimary:"#68cdff",colourTertiary:"#5db8e5"},calculation:{colourPrimary:"#feae8a",colourTertiary:"#e49c7c"},function:{colourPrimary:"#f88767",colourTertiary:"#df795c"},utility:{colourPrimary:"#00afc3",colourTertiary:"#009daf"},variable:{colourPrimary:"#ffbb55",colourTertiary:"#e5a84c"},list:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},time:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},dictionary:{colourPrimary:"#a073ff",colourTertiary:"#9067e5"},color:{colourPrimary:"#2bc9a7",colourTertiary:"#19b693"},http:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},sqlite:{colourPrimary:"#f9cc37",colourTertiary:"#e0b731"},dict:{colourPrimary:"#a073ff",colourTertiary:"#9067e5"}},categoryStyles:{controller:{colour:"#01adff"},calculation:{colour:"#f0aa8b"},function:{colour:"#f88767"},utility:{colour:"#5ab45b"},variable:{colour:"#ffbb55"},list:{colour:"#ff9c37"},dictionary:{colour:"#2bc9a7"},time:{colour:"#f9cc37"},color:{colour:"#2bc9a7"},http:{colour:"#f9cc37"},sqlite:{colour:"#f9cc37"},dict:{colour:"#a073ff"}}});class l8 extends Tt.zelos.ConstantProvider{constructor(){super(),this.NOTCH_WIDTH=0,this.NOTCH_HEIGHT=8,this.CORNER_RADIUS=4,this.FIELD_TEXT_FONTSIZE=13,this.FIELD_TEXT_FONTWEIGHT="500",this.TOP_ROW_MIN_HEIGHT=2,this.BOTTOM_ROW_MIN_HEIGHT=2,this.SELECTED_GLOW_COLOUR="#4062f6",this.REPLACEMENT_GLOW_COLOUR="#4062f6"}makeNotch(){function l(d){return Tt.utils.svgPaths.line([Tt.utils.svgPaths.point(0,0),Tt.utils.svgPaths.point(d*0,0),Tt.utils.svgPaths.point(0,-0)])}const a=l(1),u=l(-1);return{width:0,height:0+this.NOTCH_HEIGHT,pathLeft:a,pathRight:u}}}class c8 extends Tt.zelos.Renderer{constructor(n){super(n)}makeConstants_(){return new l8}}Tt.blockRendering.register("codemao",c8);var o2={exports:{}},h0={exports:{}},Pb;function a8(){return Pb||(Pb=1,function(o,n){(function(s,l){o.exports=l(_d())})(Do,function(s){var l=s.__namespace__,a=function(b,O){return[O.quote_(b.getFieldValue("COLOUR")),E.ATOMIC]},u=function(b,O){return O.definitions_.import_random="import random",["'#%06x' % random.randint(0, 2**24 - 1)",E.FUNCTION_CALL]},d=function(b,O){const _=O.provideFunction_("colour_rgb",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(r, g, b): + r = round(min(100, max(0, r)) * 2.55) + g = round(min(100, max(0, g)) * 2.55) + b = round(min(100, max(0, b)) * 2.55) + return '#%02x%02x%02x' % (r, g, b) +`),m=O.valueToCode(b,"RED",E.NONE)||0,y=O.valueToCode(b,"GREEN",E.NONE)||0;return b=O.valueToCode(b,"BLUE",E.NONE)||0,[_+"("+m+", "+y+", "+b+")",E.FUNCTION_CALL]},h=function(b,O){const _=O.provideFunction_("colour_blend",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(colour1, colour2, ratio): + r1, r2 = int(colour1[1:3], 16), int(colour2[1:3], 16) + g1, g2 = int(colour1[3:5], 16), int(colour2[3:5], 16) + b1, b2 = int(colour1[5:7], 16), int(colour2[5:7], 16) + ratio = min(1, max(0, ratio)) + r = round(r1 * (1 - ratio) + r2 * ratio) + g = round(g1 * (1 - ratio) + g2 * ratio) + b = round(b1 * (1 - ratio) + b2 * ratio) + return '#%02x%02x%02x' % (r, g, b) +`),m=O.valueToCode(b,"COLOUR1",E.NONE)||"'#000000'",y=O.valueToCode(b,"COLOUR2",E.NONE)||"'#000000'";return b=O.valueToCode(b,"RATIO",E.NONE)||0,[_+"("+m+", "+y+", "+b+")",E.FUNCTION_CALL]},p=function(b,O){return["[]",E.ATOMIC]},f=function(b,O){const _=Array(b.itemCount_);for(let m=0;m",GTE:">="}[b.getFieldValue("OP")],m=E.RELATIONAL,y=O.valueToCode(b,"A",m)||"0";return b=O.valueToCode(b,"B",m)||"0",[y+" "+_+" "+b,m]},R=function(b,O){const _=b.getFieldValue("OP")==="AND"?"and":"or",m=_==="and"?E.LOGICAL_AND:E.LOGICAL_OR;let y=O.valueToCode(b,"A",m);return b=O.valueToCode(b,"B",m),y||b?(O=_==="and"?"True":"False",y||(y=O),b||(b=O)):b=y="False",[y+" "+_+" "+b,m]},F=function(b,O){return["not "+(O.valueToCode(b,"BOOL",E.LOGICAL_NOT)||"True"),E.LOGICAL_NOT]},z=function(b,O){return[b.getFieldValue("BOOL")==="TRUE"?"True":"False",E.ATOMIC]},X=function(b,O){return["None",E.ATOMIC]},le=function(b,O){const _=O.valueToCode(b,"IF",E.CONDITIONAL)||"False",m=O.valueToCode(b,"THEN",E.CONDITIONAL)||"None";return b=O.valueToCode(b,"ELSE",E.CONDITIONAL)||"None",[m+" if "+_+" else "+b,E.CONDITIONAL]},$e=function(b,O){let _;_=b.getField("TIMES")?String(parseInt(b.getFieldValue("TIMES"),10)):O.valueToCode(b,"TIMES",E.NONE)||"0",_=l.isNumber$$module$build$src$core$utils$string(_)?parseInt(_,10):"int("+_+")";let m=O.statementToCode(b,"DO");return m=O.addLoopTrap(m,b)||O.PASS,"for "+O.nameDB_.getDistinctName("count",l.NameType$$module$build$src$core$names.VARIABLE)+" in range("+_+`): +`+m},he=function(b,O){const _=b.getFieldValue("MODE")==="UNTIL";let m=O.valueToCode(b,"BOOL",_?E.LOGICAL_NOT:E.NONE)||"False",y=O.statementToCode(b,"DO");return y=O.addLoopTrap(y,b)||O.PASS,_&&(m="not "+m),"while "+m+`: +`+y},fe=function(b,O){const _=O.nameDB_.getName(b.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE);var m=O.valueToCode(b,"FROM",E.NONE)||"0",y=O.valueToCode(b,"TO",E.NONE)||"0",V=O.valueToCode(b,"BY",E.NONE)||"1";let ve=O.statementToCode(b,"DO");ve=O.addLoopTrap(ve,b)||O.PASS;let Ge="";const rt=function(){return O.provideFunction_("upRange",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): + while start <= stop: + yield start + start += abs(step) +`)},Mt=function(){return O.provideFunction_("downRange",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(start, stop, step): + while start >= stop: + yield start + start -= abs(step) +`)};if(b=function(po,Be,wt){return"("+po+" <= "+Be+") and "+rt()+"("+po+", "+Be+", "+wt+") or "+Mt()+"("+po+", "+Be+", "+wt+")"},l.isNumber$$module$build$src$core$utils$string(m)&&l.isNumber$$module$build$src$core$utils$string(y)&&l.isNumber$$module$build$src$core$utils$string(V))m=Number(m),y=Number(y),V=Math.abs(Number(V)),m%1===0&&y%1===0&&V%1===0?(m<=y?(y++,b=m===0&&V===1?y:m+", "+y,V!==1&&(b+=", "+V)):(y--,b=m+", "+y+", -"+V),b="range("+b+")"):(b=mb?E.UNARY_SIGN:E.ATOMIC,[b,O]},D=function(b,O){var _={ADD:[" + ",E.ADDITIVE],MINUS:[" - ",E.ADDITIVE],MULTIPLY:[" * ",E.MULTIPLICATIVE],DIVIDE:[" / ",E.MULTIPLICATIVE],POWER:[" ** ",E.EXPONENTIATION]}[b.getFieldValue("OP")];const m=_[0];_=_[1];const y=O.valueToCode(b,"A",_)||"0";return b=O.valueToCode(b,"B",_)||"0",[y+m+b,_]},B=function(b,O){const _=b.getFieldValue("OP");let m;if(_==="NEG")return m=O.valueToCode(b,"NUM",E.UNARY_SIGN)||"0",["-"+m,E.UNARY_SIGN];switch(O.definitions_.import_math="import math",b=_==="SIN"||_==="COS"||_==="TAN"?O.valueToCode(b,"NUM",E.MULTIPLICATIVE)||"0":O.valueToCode(b,"NUM",E.NONE)||"0",_){case"ABS":m="math.fabs("+b+")";break;case"ROOT":m="math.sqrt("+b+")";break;case"LN":m="math.log("+b+")";break;case"LOG10":m="math.log10("+b+")";break;case"EXP":m="math.exp("+b+")";break;case"POW10":m="math.pow(10,"+b+")";break;case"ROUND":m="round("+b+")";break;case"ROUNDUP":m="math.ceil("+b+")";break;case"ROUNDDOWN":m="math.floor("+b+")";break;case"SIN":m="math.sin("+b+" / 180.0 * math.pi)";break;case"COS":m="math.cos("+b+" / 180.0 * math.pi)";break;case"TAN":m="math.tan("+b+" / 180.0 * math.pi)"}if(m)return[m,E.FUNCTION_CALL];switch(_){case"ASIN":m="math.asin("+b+") / math.pi * 180";break;case"ACOS":m="math.acos("+b+") / math.pi * 180";break;case"ATAN":m="math.atan("+b+") / math.pi * 180";break;default:throw Error("Unknown math operator: "+_)}return[m,E.MULTIPLICATIVE]},ae=function(b,O){const _={PI:["math.pi",E.MEMBER],E:["math.e",E.MEMBER],GOLDEN_RATIO:["(1 + math.sqrt(5)) / 2",E.MULTIPLICATIVE],SQRT2:["math.sqrt(2)",E.MEMBER],SQRT1_2:["math.sqrt(1.0 / 2)",E.MEMBER],INFINITY:["float('inf')",E.ATOMIC]};return b=b.getFieldValue("CONSTANT"),b!=="INFINITY"&&(O.definitions_.import_math="import math"),_[b]},_e=function(b,O){var _={EVEN:[" % 2 == 0",E.MULTIPLICATIVE,E.RELATIONAL],ODD:[" % 2 == 1",E.MULTIPLICATIVE,E.RELATIONAL],WHOLE:[" % 1 == 0",E.MULTIPLICATIVE,E.RELATIONAL],POSITIVE:[" > 0",E.RELATIONAL,E.RELATIONAL],NEGATIVE:[" < 0",E.RELATIONAL,E.RELATIONAL],DIVISIBLE_BY:[null,E.MULTIPLICATIVE,E.RELATIONAL],PRIME:[null,E.NONE,E.FUNCTION_CALL]};const m=b.getFieldValue("PROPERTY"),[y,V,ve]=_[m];if(_=O.valueToCode(b,"NUMBER_TO_CHECK",V)||"0",m==="PRIME")O.definitions_.import_math="import math",O.definitions_.from_numbers_import_Number="from numbers import Number",b=O.provideFunction_("math_isPrime",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(n): + # https://en.wikipedia.org/wiki/Primality_test#Naive_methods + # If n is not a number but a string, try parsing it. + if not isinstance(n, Number): + try: + n = float(n) + except: + return False + if n == 2 or n == 3: + return True + # False if n is negative, is 1, or not whole, or if n is divisible by 2 or 3. + if n <= 1 or n % 1 != 0 or n % 2 == 0 or n % 3 == 0: + return False + # Check all the numbers of form 6k +/- 1, up to sqrt(n). + for x in range(6, int(math.sqrt(n)) + 2, 6): + if n % (x - 1) == 0 or n % (x + 1) == 0: + return False + return True +`)+"("+_+")";else if(m==="DIVISIBLE_BY"){if(b=O.valueToCode(b,"DIVISOR",E.MULTIPLICATIVE)||"0",b==="0")return["False",E.ATOMIC];b=_+" % "+b+" == 0"}else b=_+y;return[b,ve]},Me=function(b,O){O.definitions_.from_numbers_import_Number="from numbers import Number";const _=O.valueToCode(b,"DELTA",E.ADDITIVE)||"0";return b=O.nameDB_.getName(b.getFieldValue("VAR"),l.NameType$$module$build$src$core$names.VARIABLE),b+" = ("+b+" if isinstance("+b+", Number) else 0) + "+_+` +`},Xe=function(b,O){const _=b.getFieldValue("OP");switch(b=O.valueToCode(b,"LIST",E.NONE)||"[]",_){case"SUM":O="sum("+b+")";break;case"MIN":O="min("+b+")";break;case"MAX":O="max("+b+")";break;case"AVERAGE":O.definitions_.from_numbers_import_Number="from numbers import Number",O=O.provideFunction_("math_mean",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(myList): + localList = [e for e in myList if isinstance(e, Number)] + if not localList: return + return float(sum(localList)) / len(localList) +`)+"("+b+")";break;case"MEDIAN":O.definitions_.from_numbers_import_Number="from numbers import Number",O=O.provideFunction_("math_median",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(myList): + localList = sorted([e for e in myList if isinstance(e, Number)]) + if not localList: return + if len(localList) % 2 == 0: + return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0 + else: + return localList[(len(localList) - 1) // 2] +`)+"("+b+")";break;case"MODE":O=O.provideFunction_("math_modes",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(some_list): + modes = [] + # Using a lists of [item, count] to keep count rather than dict + # to avoid "unhashable" errors when the counted item is itself a list or dict. + counts = [] + maxCount = 1 + for item in some_list: + found = False + for count in counts: + if count[0] == item: + count[1] += 1 + maxCount = max(maxCount, count[1]) + found = True + if not found: + counts.append([item, 1]) + for counted_item, item_count in counts: + if item_count == maxCount: + modes.append(counted_item) + return modes +`)+"("+b+")";break;case"STD_DEV":O.definitions_.import_math="import math",O=O.provideFunction_("math_standard_deviation",` +def ${O.FUNCTION_NAME_PLACEHOLDER_}(numbers): + n = len(numbers) + if n == 0: return + mean = float(sum(numbers)) / n + variance = sum((x - mean) ** 2 for x in numbers) / n + return math.sqrt(variance) +`)+"("+b+")";break;case"RANDOM":O.definitions_.import_random="import random",O="random.choice("+b+")";break;default:throw Error("Unknown operator: "+_)}return[O,E.FUNCTION_CALL]},Je=function(b,O){const _=O.valueToCode(b,"DIVIDEND",E.MULTIPLICATIVE)||"0";return b=O.valueToCode(b,"DIVISOR",E.MULTIPLICATIVE)||"0",[_+" % "+b,E.MULTIPLICATIVE]},we=function(b,O){const _=O.valueToCode(b,"VALUE",E.NONE)||"0",m=O.valueToCode(b,"LOW",E.NONE)||"0";return b=O.valueToCode(b,"HIGH",E.NONE)||"float('inf')",["min(max("+_+", "+m+"), "+b+")",E.FUNCTION_CALL]},We=function(b,O){O.definitions_.import_random="import random";const _=O.valueToCode(b,"FROM",E.NONE)||"0";return b=O.valueToCode(b,"TO",E.NONE)||"0",["random.randint("+_+", "+b+")",E.FUNCTION_CALL]},Ze=function(b,O){return O.definitions_.import_random="import random",["random.random()",E.FUNCTION_CALL]},nt=function(b,O){O.definitions_.import_math="import math";const _=O.valueToCode(b,"X",E.NONE)||"0";return["math.atan2("+(O.valueToCode(b,"Y",E.NONE)||"0")+", "+_+") / math.pi * 180",E.MULTIPLICATIVE]},ht=function(b,O){var _=[],m=b.workspace,y=l.allUsedVarModels$$module$build$src$core$variables(m)||[];for(let Be=0,wt;wt=y[Be];Be++){var V=wt.name;b.getVars().indexOf(V)===-1&&_.push(O.nameDB_.getName(V,l.NameType$$module$build$src$core$names.VARIABLE))}for(m=l.allDeveloperVariables$$module$build$src$core$variables(m),y=0;y_?"int("+b+" - "+-_+")":"int("+b+")",m&&(b="-"+b)),b}},k={};k.colour_blend=h,k.colour_picker=a,k.colour_random=u,k.colour_rgb=d;var W={};W.lists_create_empty=p,W.lists_create_with=f,W.lists_getIndex=x,W.lists_getSublist=oe,W.lists_indexOf=P,W.lists_isEmpty=S,W.lists_length=C,W.lists_repeat=T,W.lists_reverse=Y,W.lists_setIndex=G,W.lists_sort=ne,W.lists_split=Z;var J={};J.controls_if=M,J.controls_ifelse=M,J.logic_boolean=z,J.logic_compare=L,J.logic_negate=F,J.logic_null=X,J.logic_operation=R,J.logic_ternary=le;var Ee={};Ee.controls_flow_statements=re,Ee.controls_for=fe,Ee.controls_forEach=ke,Ee.controls_repeat=$e,Ee.controls_repeat_ext=$e,Ee.controls_whileUntil=he;var ze={};ze.math_arithmetic=D,ze.math_atan2=nt,ze.math_change=Me,ze.math_constant=ae,ze.math_constrain=we,ze.math_modulo=Je,ze.math_number=Ie,ze.math_number_property=_e,ze.math_on_list=Xe,ze.math_random_float=Ze,ze.math_random_int=We,ze.math_round=B,ze.math_single=B,ze.math_trig=B;var yt={};yt.procedures_callnoreturn=xe,yt.procedures_callreturn=et,yt.procedures_defnoreturn=ht,yt.procedures_defreturn=ht,yt.procedures_ifreturn=w;var ls=/^\s*'([^']|\\')*'\s*$/,ii=function(b){return ls.test(b)?[b,E.ATOMIC]:["str("+b+")",E.FUNCTION_CALL]},xt={};xt.text=I,xt.text_append=K,xt.text_changeCase=ce,xt.text_charAt=se,xt.text_count=be,xt.text_getSubstring=Ce,xt.text_indexOf=Te,xt.text_isEmpty=de,xt.text_join=A,xt.text_length=U,xt.text_multiline=N,xt.text_print=Ne,xt.text_prompt=He,xt.text_prompt_ext=He,xt.text_replace=ee,xt.text_reverse=ie,xt.text_trim=Se;var Qo={};Qo.variables_get=ue,Qo.variables_set=ye;var Ht={};Ht.variables_get_dynamic=ue,Ht.variables_set_dynamic=ye;var ws=new g;ws.addReservedWords("math,random,Number"),Object.assign(ws.forBlock,k,W,J,Ee,ze,yt,xt,Qo,Ht);var qo={};return qo.Order=E,qo.PythonGenerator=g,qo.pythonGenerator=ws,qo.__namespace__=l,qo})}(h0)),h0.exports}(function(o,n){(function(s,l){o.exports=l(Gc(),a8())})(Do,function(s,l){/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */return l})})(o2);var Ve=o2.exports;function tr(o){return/^\d+$/.test(o)}Ve.pythonGenerator.forBlock.controls_forever=function(o,n){return`while True: +`+n.statementToCode(o,"DO")};Ve.pythonGenerator.forBlock.math_evenly_divisible=function(o,n){const s=n.valueToCode(o,"DIVIDEND",Ve.Order.NONE)||"0",l=n.valueToCode(o,"DIVISOR",Ve.Order.NONE)||"1";return[s+" % "+l+" == 0",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.text_charAt=function(o,n){const s=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),[s+"["+l+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.text_getSubstring=function(o,n){const s=n.valueToCode(o,"STRING",Ve.Order.NONE)||"''";let l=n.valueToCode(o,"WHERE1",Ve.Order.NONE)||"1",a=n.valueToCode(o,"WHERE2",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE1")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE1")==="FROM_END"&&(l=s+".length - "+l),o.getFieldValue("WHERE2")==="FROM_END"&&(a=tr(a)?Number(a)-1:a+" - 1",a=s+".length - "+a),[s+"["+l+":"+a+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.math_types=function(o,n){const s={STRING:"str",NUMBER:"float",BOOLEAN:"bool"},l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"";return[s[o.getFieldValue("TYPE")]+"("+l+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_push=function(o,n){const s=n.valueToCode(o,"ITEM",Ve.Order.NONE)||"";return(n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]")+".append("+s+")"};Ve.pythonGenerator.forBlock.lists_insert=function(o,n){const s=n.valueToCode(o,"ITEM",Ve.Order.NONE)||"None",l=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let a=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?a=tr(a)?Number(a)-1:a+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=l+".length - "+a),l+".insert("+a+", "+s+")"};Ve.pythonGenerator.forBlock.lists_delete=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),s+".pop("+l+")"};Ve.pythonGenerator.forBlock.lists_set=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"TO",Ve.Order.NONE)||"None";let a=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?a=tr(a)?Number(a)-1:a+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=s+".length - "+a),s+"["+a+"] = "+l};Ve.pythonGenerator.forBlock.lists_get=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]";let l=n.valueToCode(o,"AT",Ve.Order.NONE)||"1";return o.getFieldValue("WHERE")==="FROM_START"?l=tr(l)?Number(l)-1:l+" - 1":o.getFieldValue("WHERE")==="FROM_END"&&(l=s+".length - "+l),[s+"["+l+"]",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_index=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";let a;return o.getFieldValue("WHERE")==="FROM_START"?a=s+".index("+l+") + 1":o.getFieldValue("WHERE")==="FROM_END"&&(a=s+".rindex("+l+") + 1"),[a,Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_includes=function(o,n){const s=n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return[s+".count("+l+") > 0",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.lists_length=function(o,n){return[(n.valueToCode(o,"LIST",Ve.Order.NONE)||"[]")+".length",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_current=function(){return["time.time()",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_timestamp_to_date=function(o,n){return["datetime.datetime.fromtimestamp("+(n.valueToCode(o,"TIMESTAMP",Ve.Order.NONE)||"0")+').strftime("%Y-%m-%d %H:%M:%S")',Ve.Order.NONE]};Ve.pythonGenerator.forBlock.time_import=function(){return`import time +`};Ve.pythonGenerator.forBlock.http_import=function(){return`import requests +`};Ve.pythonGenerator.forBlock.http_get=function(o,n){const s=n.valueToCode(o,"URL",Ve.Order.NONE)||"''",l=n.valueToCode(o,"HEADERS",Ve.Order.NONE)||"{}",a=n.valueToCode(o,"COOKIES",Ve.Order.NONE)||"{}";return["requests.get("+s+", headers="+l+", cookies="+a+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.http_post=function(o,n){const s=n.valueToCode(o,"URL",Ve.Order.NONE)||"''",l=n.valueToCode(o,"HEADERS",Ve.Order.NONE)||"{}",a=n.valueToCode(o,"COOKIES",Ve.Order.NONE)||"{}",u=n.valueToCode(o,"DATA",Ve.Order.NONE)||"{}";return["requests.post("+s+", headers="+l+", cookies="+a+", data="+u+")",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.dict_create=function(){return["dict()",Ve.Order.NONE]};Ve.pythonGenerator.forBlock.dict_set=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return(n.valueToCode(o,"DICT",Ve.Order.NONE)||"{}")+"["+s+"] = "+l};Ve.pythonGenerator.forBlock.set_dict=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''",l=n.valueToCode(o,"VALUE",Ve.Order.NONE)||"''";return"{"+s+":"+l+"}"};Ve.pythonGenerator.forBlock.dict_get=function(o,n){const s=n.valueToCode(o,"KEY",Ve.Order.NONE)||"''";return[(n.valueToCode(o,"DICT",Ve.Order.NONE)||"{}")+"["+s+"]",Ve.Order.NONE]};var Ns=(o,n)=>{const s=o.__vccOpts||o;for(const[l,a]of n)s[l]=a;return s};const u8={name:"IconDark",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},d8=["fill"],h8=Le("defs",null,[Le("clipPath",{id:"svg_a82fd95db1__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),p8=Le("g",{"clip-path":"url(#svg_a82fd95db1__a)"},[Le("path",{d:"M28.4559,2.45191Q26.2603,2,24,2Q19.525399999999998,2,15.436,3.72969Q11.48756,5.39973,8.44365,8.44365Q5.39973,11.48757,3.729689,15.436Q2,19.525399999999998,2,24Q2,28.4746,3.72969,32.564Q5.39973,36.5124,8.44365,39.5564Q11.48757,42.6003,15.436,44.2703Q19.525399999999998,46,24,46Q28.4746,46,32.564,44.2703Q36.5124,42.6003,39.5564,39.5564Q42.6003,36.5124,44.2703,32.564Q46,28.4746,46,24Q46,21.7397,45.548,19.544Q45.5199,19.407600000000002,45.4732,19.2763Q45.4265,19.1451,45.362,19.0216Q45.2975,18.8981,45.2165,18.7847Q45.1355,18.6714,45.0396,18.5703Q44.9437,18.4693,44.8347,18.3825Q44.7257,18.2958,44.6057,18.224899999999998Q44.4857,18.1541,44.3571,18.1006Q44.2285,18.0471,44.0936,18.012Q43.9986,17.9872,43.9015,17.971899999999998Q43.8045,17.9565,43.7064,17.950699999999998Q43.6083,17.945,43.5101,17.948900000000002Q43.4119,17.9527,43.3146,17.9662Q43.2173,17.9797,43.1218,18.0027Q43.0262,18.0256,42.9334,18.0578Q42.8406,18.0901,42.7514,18.1312Q42.6621,18.1724,42.5774,18.222099999999998Q42.4926,18.2718,42.4132,18.3295Q42.3337,18.3873,42.2602,18.4526Q42.1868,18.517899999999997,42.1201,18.59Q42.0535,18.6622,41.9942,18.7406Q41.9349,18.8189,41.8836,18.9027Q41.8323,18.9865,41.7894,19.0749Q41.7465,19.1633,41.7126,19.255499999999998Q41.6786,19.3477,41.6538,19.4428Q40.7431,22.9361,37.8816,25.1777Q34.9751,27.4545,31.2727,27.4545Q29.0889,27.4545,27.0978,26.6123Q25.1731,25.7983,23.6874,24.3126Q22.2017,22.8269,21.3877,20.9022Q20.5455,18.911099999999998,20.5455,16.7273Q20.5455,13.02491,22.8223,10.118459999999999Q25.0639,7.2569300000000005,28.5573,6.346159999999999Q28.6921,6.31101,28.8207,6.25751Q28.9494,6.20401,29.0693,6.13319Q29.1893,6.06237,29.2983,5.9756Q29.4073,5.8888300000000005,29.5032,5.78778Q29.5992,5.68674,29.6801,5.57337Q29.7611,5.46,29.8256,5.3365Q29.8901,5.213,29.9368,5.0817499999999995Q29.9836,4.9505040000000005,30.0116,4.814043Q30.0513,4.621105,30.0527,4.424127Q30.054,4.227148,30.0168,4.0336998Q29.9797,3.840251,29.9055,3.6577669999999998Q29.8313,3.475282,29.723,3.310774Q29.6146,3.146266,29.4763,3.006056Q29.3379,2.86585,29.1749,2.75532Q29.0118,2.6448,28.8303,2.56821Q28.6488,2.49162,28.4559,2.45191ZM20.8976,6.26333Q18.894,6.6101399999999995,16.9942,7.41371Q13.76432,8.77983,11.272079999999999,11.272079999999999Q8.77983,13.76432,7.41371,16.9942Q6,20.3366,6,24Q6,27.6634,7.41371,31.0058Q8.77983,34.2357,11.272079999999999,36.7279Q13.76433,39.2202,16.9942,40.5863Q20.3366,42,24,42Q27.6634,42,31.0058,40.5863Q34.2357,39.2202,36.7279,36.7279Q39.2202,34.2357,40.5863,31.0058Q41.3899,29.106,41.7367,27.1024Q41.0902,27.7453,40.3483,28.3265Q36.3553,31.4545,31.2727,31.4545Q28.2778,31.4545,25.5396,30.2964Q22.8963,29.1783,20.859,27.141Q18.8216,25.1037,17.7036,22.4604Q16.5455,19.7222,16.5455,16.7273Q16.5455,11.6447,19.6735,7.65174Q20.2547,6.90977,20.8976,6.26333Z","fill-rule":"evenodd"})],-1),$8=[h8,p8];function _8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-dark`],width:"1em",height:"1em"},o.$attrs),$8,16,d8)}var g8=Ns(u8,[["render",_8]]);const f8={name:"IconCode",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},m8=["fill"],T8=Le("defs",null,[Le("clipPath",{id:"svg_c13367945d__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),E8=Le("g",{"clip-path":"url(#svg_c13367945d__a)","fill-rule":"evenodd"},[Le("path",{d:"M13.6112 38.4392L13.6119 38.4399Q13.7504 38.5734 13.9118 38.6781 14.0732 38.7827 14.2516 38.8547 14.43 38.9267 14.6188 38.963300000000004 14.8076 39 15 39 15.0183 39 15.0367 38.999700000000004 15.2336 38.9961 15.4261 38.9541 15.6185 38.912099999999995 15.7991 38.8334 15.9797 38.7547 16.1414 38.6423 16.3032 38.5299 16.4399 38.3881 16.5734 38.2496 16.6781 38.0882 16.7827 37.9268 16.8547 37.748400000000004 16.9267 37.57 16.9633 37.3812 17 37.1924 17 37 17 36.981700000000004 16.9997 36.963300000000004 16.9961 36.766400000000004 16.9541 36.573899999999995 16.912100000000002 36.3815 16.833399999999997 36.200900000000004 16.7547 36.0203 16.6423 35.858599999999996 16.529899999999998 35.696799999999996 16.3881 35.5601L16.3873 35.5594 5.8288899999999995 25.3812 16.438200000000002 14.38983 16.439 14.38898Q16.572699999999998 14.25047 16.677500000000002 14.088989999999999 16.782400000000003 13.927508 16.8545 13.748998 16.9266 13.570489 16.9633 13.381504 17 13.19252 17 13.000000000000012 17 12.9823145 16.9997 12.9646317 16.9962 12.76768 16.9544 12.575192 16.9125 12.382703 16.8339 12.202077 16.7553 12.02145 16.643 11.85963 16.5307 11.6978 16.389 11.561 16.250500000000002 11.4273 16.089 11.32247 15.9275 11.217649999999999 15.749 11.14555 15.5705 11.07345 15.3815 11.03672 15.1925 11 15 11L14.9976 11Q14.9811 11.00002 14.9646 11.00031 14.7677 11.0038 14.5752 11.04564 14.3827 11.08748 14.2021 11.16606 14.0215 11.24465 13.8596 11.35697 13.6978 11.46929 13.561 11.61102L13.5602 11.61187 1.561 24.043100000000003 1.5601 24.0441Q1.42339 24.1859 1.31697 24.3517 1.21055 24.517400000000002 1.13852 24.7008 1.06649 24.8841 1.03161 25.078.9967299999999999 25.2718 1.00034 25.4688 1.00395 25.6657 1.04591 25.8582 1.08788 26.0507 1.16658 26.2312 1.24529 26.4118 1.35771 26.5736 1.47013 26.735300000000002 1.61195 26.872L13.6112 38.4392zM31.6128 35.5593L31.61195 35.5601Q31.47013 35.696799999999996 31.35771 35.858599999999996 31.24529 36.0203 31.16658 36.200900000000004 31.08788 36.3815 31.04591 36.573899999999995 31.00395 36.766400000000004 31.00034 36.963300000000004 31 36.981700000000004 31 37 31 37.0297 31.00088 37.0594 31.00638 37.2442 31.04565 37.4249 31.08491 37.6055 31.15663 37.7759 31.22834 37.9463 31.33007 38.1006 31.4318 38.254999999999995 31.5601 38.3881 31.70002 38.5332 31.8661 38.6475 32.032178 38.7618 32.217728 38.8407 32.403278 38.9195 32.600833 38.9598 32.798388 39 33 39 33.03343 39 33.066851 38.9989 33.250672 38.9927 33.430289 38.953199999999995 33.609906 38.9136 33.779294 38.841899999999995 33.948681 38.7703 34.10216 38.6689 34.25563 38.5676 34.38805 38.4399L34.3889 38.439099999999996 46.3881 26.872Q46.5299 26.735300000000002 46.6423 26.5736 46.7547 26.4118 46.8334 26.2312 46.9121 26.0507 46.9541 25.8582 46.9961 25.6657 46.999700000000004 25.4688 47.003299999999996 25.2718 46.9684 25.078 46.9335 24.8841 46.8615 24.7008 46.7894 24.517400000000002 46.683 24.3517 46.5766 24.1859 46.4399 24.0441L46.439 24.043100000000003 34.4391 11.61111 34.439 11.61102Q34.2991 11.46607 34.1331 11.351939999999999 33.9671 11.23781 33.781676 11.15908 33.596251 11.08035 33.398849 11.04017 33.201448 11 32.999999999999986 11 32.9659166 11 32.9318531 11.00116 32.748036 11.00743 32.568444 11.04711 32.388853 11.0868 32.219512 11.15858 32.050171 11.23035 31.89676 11.33181 31.74335 11.43326 31.61102 11.561 31.46607 11.7009 31.35194 11.8669 31.23781 12.0329 31.15908 12.218323999999999 31.08035 12.403749 31.04017 12.601151 31 12.798552 31 13 31 13.0340834 31.00116 13.0681469 31.00743 13.251964 31.04711 13.431556 31.0868 13.611147 31.15858 13.780488 31.23035 13.949829 31.33181 14.10324 31.43326 14.25665 31.561 14.38898L31.56109 14.38908 42.17111 25.3812 31.6128 35.5593zM26.02983 3.655886L19.02994 43.6552Q19 43.8263 19 44L19.00009 44.0195Q19.00094 44.1063 19.0093 44.1926 19.01766 44.279 19.03347 44.3644 19.04929 44.4497 19.07243 44.5334 19.095579999999998 44.617 19.12588 44.6984 19.15619 44.7797 19.19343 44.8581 19.23067 44.9365 19.27455 45.0114 19.31844 45.0862 19.36865 45.157 19.41887 45.2278 19.47502 45.294 19.53118 45.3602 19.59285 45.4212 19.65453 45.4823 19.72126 45.5378 19.788 45.5933 19.85929 45.6428 19.93058 45.6923 20.005894 45.7354 20.081206 45.7786 20.159972 45.815 20.238738 45.8515 20.320366 45.881 20.401994 45.9105 20.48587 45.9328 20.569746 45.9551 20.655239 45.9701 20.82632 46 21 46 21.0211794 46 21.0423827 45.9996 21.339964 45.9932 21.622812 45.9006 21.905661 45.8079 22.149259999999998 45.6368 22.31047 45.5236 22.44651 45.3812 22.58254 45.2387 22.68816 45.0724 22.79379 44.9062 22.86495 44.7225 22.9361 44.5388 22.97006 44.3448L29.97006 4.344761Q30 4.173682 30 4.0000044183 30 3.9788062 29.99955 3.9576172 29.99324 3.660036 29.900550000000003 3.377187 29.807859999999998 3.0943389999999997 29.63683 2.85074 29.52363 2.68953 29.38116 2.55349 29.2387 2.41746 29.07243 2.31184 28.90616 2.20621 28.72248 2.1350499999999997 28.53879 2.0639000000000003 28.34476 2.02994 28.17368 2 28 2L27.98053 2.00009Q27.89374 2.00094 27.80735 2.0093 27.720959999999998 2.0176600000000002 27.63562 2.0334700000000003 27.55028 2.04929 27.466630000000002 2.0724299999999998 27.38298 2.09558 27.301650000000002 2.12588 27.22032 2.15619 27.14192 2.19343 27.06352 2.23067 26.98865 2.27455 26.91377 2.31844 26.84297 2.3686499999999997 26.77218 2.41887 26.706 2.4750199999999998 26.63982 2.53118 26.57876 2.5928500000000003 26.51769 2.6545300000000003 26.4622 2.72126 26.40671 2.7880000000000003 26.3572 2.85929 26.3077 2.93058 26.26456 3.005894 26.221420000000002 3.081206 26.18497 3.159972 26.14851 3.238738 26.11902 3.320366 26.08952 3.401994 26.06721 3.4858700000000002 26.0449 3.569746 26.02994 3.655239L26.02983 3.655886z"})],-1),b8=[T8,E8];function v8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-code`],width:"1em",height:"1em"},o.$attrs),b8,16,m8)}var I8=Ns(f8,[["render",v8]]);const O8={name:"IconBigger",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},C8=["fill"],y8=ld('',2),S8=[y8];function R8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-bigger`],width:"1em",height:"1em"},o.$attrs),S8,16,C8)}var k8=Ns(O8,[["render",R8]]);const A8={name:"IconSmaller",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},L8=["fill"],N8=Le("defs",null,[Le("clipPath",{id:"svg_23394313d7__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),w8=Le("g",{"clip-path":"url(#svg_23394313d7__a)"},[Le("path",{d:"M6,26L42,26Q42.0983,26,42.196,25.99037Q42.2938,25.98074,42.3902,25.961570000000002Q42.4865,25.9424,42.5806,25.91388Q42.6746,25.88536,42.7654,25.84776Q42.8561,25.81016,42.9428,25.763840000000002Q43.0294,25.71753,43.1111,25.66294Q43.1928,25.60835,43.2688,25.54602Q43.3447,25.48369,43.4142,25.41421Q43.4837,25.34474,43.546,25.26879Q43.6083,25.19284,43.6629,25.11114Q43.7175,25.02945,43.7638,24.942793Q43.8102,24.856141,43.8478,24.765367Q43.8854,24.674592,43.9139,24.580569Q43.9424,24.486546,43.9616,24.390181Q43.9807,24.293815,43.9904,24.196034Q44,24.0982537,44,24Q44,23.9017463,43.9904,23.803966Q43.9807,23.706185,43.9616,23.609819Q43.9424,23.513454,43.9139,23.419431Q43.8854,23.325408,43.8478,23.234633Q43.8102,23.143859,43.7638,23.057207Q43.7175,22.97055,43.6629,22.88886Q43.6083,22.80716,43.546,22.73121Q43.4837,22.65526,43.4142,22.58579Q43.3447,22.51631,43.2688,22.45398Q43.1928,22.39165,43.1111,22.33706Q43.0294,22.28247,42.9428,22.236159999999998Q42.8561,22.18984,42.7654,22.15224Q42.6746,22.11464,42.5806,22.08612Q42.4865,22.0576,42.3902,22.038429999999998Q42.2938,22.01926,42.196,22.00963Q42.0983,22,42,22L6,22Q5.9017463,22,5.803966,22.00963Q5.706185,22.01926,5.609819,22.038429999999998Q5.513454,22.0576,5.419431,22.08612Q5.325408,22.11464,5.234633,22.15224Q5.143859,22.18984,5.057207,22.236159999999998Q4.97055,22.28247,4.88886,22.33706Q4.80716,22.39165,4.73121,22.45398Q4.65526,22.51631,4.58579,22.58579Q4.51631,22.65526,4.45398,22.73121Q4.39165,22.80716,4.33706,22.88886Q4.28247,22.97055,4.23616,23.057207Q4.18984,23.143859,4.15224,23.234633Q4.11464,23.325408,4.08612,23.419431Q4.0576,23.513454,4.03843,23.609819Q4.01926,23.706185,4.00963,23.803966Q4,23.9017463,4,24Q4,24.0982537,4.00963,24.196034Q4.01926,24.293815,4.03843,24.390181Q4.0576,24.486546,4.08612,24.580569Q4.11464,24.674592,4.15224,24.765367Q4.18984,24.856141,4.23616,24.942793Q4.28247,25.02945,4.33706,25.11114Q4.39165,25.19284,4.45398,25.26879Q4.51631,25.34474,4.58579,25.41421Q4.65526,25.48369,4.73121,25.54602Q4.80716,25.60835,4.88886,25.66294Q4.97055,25.71753,5.057207,25.763840000000002Q5.143859,25.81016,5.234633,25.84776Q5.325408,25.88536,5.419431,25.91388Q5.513454,25.9424,5.609819,25.961570000000002Q5.706185,25.98074,5.803966,25.99037Q5.9017463,26,6,26Z","fill-rule":"evenodd"})],-1),M8=[N8,w8];function D8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-smaller`],width:"1em",height:"1em"},o.$attrs),M8,16,L8)}var P8=Ns(A8,[["render",D8]]);const x8={name:"IconAuto",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},B8=["fill"],F8=ld('',2),U8=[F8];function H8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-auto`],width:"1em",height:"1em"},o.$attrs),U8,16,B8)}var V8=Ns(x8,[["render",H8]]);const G8={name:"IconLight",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},W8=["fill"],z8=ld('',2),X8=[z8];function j8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-light`],width:"1em",height:"1em"},o.$attrs),X8,16,W8)}var Y8=Ns(G8,[["render",j8]]);const K8={name:"IconClose",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},Q8=["fill"],q8=ld('',2),J8=[q8];function Z8(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-close`],width:"1em",height:"1em"},o.$attrs),J8,16,Q8)}var s2=Ns(K8,[["render",Z8]]);const eD={name:"IconDownload",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},tD=["fill"],oD=Le("defs",null,[Le("clipPath",{id:"svg_fd45640674__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),sD=Le("g",{"clip-path":"url(#svg_fd45640674__a)"},[Le("path",{d:"M26,26.3152L31.6577,20.6569L34.4863,23.4851L24.0022,33.9704L13.51586,23.4853L16.34414,20.6567L22,26.3119L22,5L26,5L26,26.3152ZM10,39L10,35L6,35L6,43L42,43L42,35L38,35L38,39L10,39Z","fill-rule":"evenodd"})],-1),iD=[oD,sD];function nD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-download`],width:"1em",height:"1em"},o.$attrs),iD,16,tD)}var rD=Ns(eD,[["render",nD]]);const lD={name:"IconCleanup",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},cD=["fill"],aD=Le("defs",null,[Le("clipPath",{id:"svg_9a669f61db__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),uD=Le("g",{"clip-path":"url(#svg_9a669f61db__a)","fill-rule":"evenodd"},[Le("path",{d:"M14 7L14 19Q14 19.098300000000002 14.00963 19.195999999999998 14.01926 19.293799999999997 14.03843 19.3902 14.0576 19.4865 14.08612 19.5806 14.11464 19.674599999999998 14.152239999999999 19.7654 14.18984 19.856099999999998 14.23616 19.9428 14.28247 20.029400000000003 14.33706 20.1111 14.39165 20.1928 14.45398 20.2688 14.51631 20.3447 14.58579 20.4142 14.65526 20.4837 14.73121 20.546 14.80716 20.6084 14.88886 20.6629 14.97055 20.7175 15.057207 20.7638 15.143858999999999 20.810200000000002 15.234633 20.8478 15.325408 20.8854 15.419431 20.913899999999998 15.513454 20.9424 15.609819 20.9616 15.706185 20.9807 15.803966 20.9904 15.9017463 21 16 21L42 21Q42.098299999999995 21 42.196 20.9904 42.293800000000005 20.9807 42.3902 20.9616 42.4865 20.9424 42.580600000000004 20.913899999999998 42.6746 20.8854 42.7654 20.8478 42.8561 20.810200000000002 42.9428 20.7638 43.029399999999995 20.7175 43.1111 20.6629 43.1928 20.6084 43.2688 20.546 43.3447 20.4837 43.4142 20.4142 43.4837 20.3447 43.546 20.2688 43.6084 20.1928 43.6629 20.1111 43.7175 20.029400000000003 43.7638 19.9428 43.810199999999995 19.856099999999998 43.8478 19.7654 43.885400000000004 19.674599999999998 43.9139 19.5806 43.9424 19.4865 43.961600000000004 19.3902 43.9807 19.293799999999997 43.9904 19.195999999999998 44 19.098300000000002 44 19L44 7Q44 6.9017463 43.9904 6.803966 43.9807 6.706185 43.961600000000004 6.609819 43.9424 6.513454 43.9139 6.419431 43.885400000000004 6.325408 43.8478 6.234633 43.810199999999995 6.143859 43.7638 6.057207 43.7175 5.97055 43.6629 5.88886 43.6084 5.80716 43.546 5.73121 43.4837 5.65526 43.4142 5.58579 43.3447 5.51631 43.2688 5.45398 43.1928 5.39165 43.1111 5.33706 43.029399999999995 5.28247 42.9428 5.23616 42.8561 5.18984 42.7654 5.15224 42.6746 5.11464 42.580600000000004 5.08612 42.4865 5.0576 42.3902 5.03843 42.293800000000005 5.01926 42.196 5.00963 42.098299999999995 5 42 5L16 5Q15.9017463 5 15.803966 5.00963 15.706185 5.01926 15.609819 5.03843 15.513454 5.0576 15.419431 5.08612 15.325408 5.11464 15.234633 5.15224 15.143858999999999 5.18984 15.057207 5.23616 14.97055 5.28247 14.88886 5.33706 14.80716 5.39165 14.73121 5.45398 14.65526 5.51631 14.58579 5.58579 14.51631 5.65526 14.45398 5.73121 14.39165 5.80716 14.33706 5.88886 14.28247 5.97055 14.23616 6.057207 14.18984 6.143859 14.152239999999999 6.234633 14.11464 6.325408 14.08612 6.419431 14.0576 6.513454 14.03843 6.609819 14.01926 6.706185 14.00963 6.803966 14 6.9017463 14 7zM18 17L18 9 40 9 40 17 18 17zM8 42L8 6Q8 5.9017463 7.99037 5.803966 7.98074 5.706185 7.96157 5.609819 7.9424 5.513454 7.91388 5.419431 7.88536 5.325408 7.84776 5.234633 7.81016 5.143859 7.76384 5.057207 7.71753 4.97055 7.66294 4.88886 7.60835 4.80716 7.54602 4.73121 7.48369 4.65526 7.41421 4.58579 7.34474 4.51631 7.26879 4.45398 7.19284 4.39165 7.11114 4.33706 7.02945 4.28247 6.942793 4.23616 6.856141 4.18984 6.765367 4.15224 6.674592 4.11464 6.580569 4.08612 6.486546 4.0576 6.390181 4.03843 6.293815 4.01926 6.196034 4.00963 6.0982537 4 6 4 5.9017463 4 5.803966 4.00963 5.706185 4.01926 5.609819 4.03843 5.513454 4.0576 5.419431 4.08612 5.325408 4.11464 5.234633 4.15224 5.143859 4.18984 5.057207 4.23616 4.97055 4.28247 4.88886 4.33706 4.80716 4.39165 4.73121 4.45398 4.65526 4.51631 4.58579 4.58579 4.51631 4.65526 4.45398 4.73121 4.39165 4.80716 4.33706 4.88886 4.28247 4.97055 4.23616 5.057207 4.18984 5.143859 4.15224 5.234633 4.11464 5.325408 4.08612 5.419431 4.0576 5.513454 4.03843 5.609819 4.01926 5.706185 4.00963 5.803966 4 5.9017463 4 6L4 42Q4 42.0983 4.00963 42.196 4.01926 42.2938 4.03843 42.3902 4.0576 42.4865 4.08612 42.5806 4.11464 42.6746 4.15224 42.7654 4.18984 42.8561 4.23616 42.9428 4.28247 43.0294 4.33706 43.1111 4.39165 43.1928 4.45398 43.2688 4.51631 43.3447 4.58579 43.4142 4.65526 43.4837 4.73121 43.546 4.80716 43.6083 4.88886 43.6629 4.97055 43.7175 5.057207 43.7638 5.143859 43.8102 5.234633 43.8478 5.325408 43.8854 5.419431 43.9139 5.513454 43.9424 5.609819 43.9616 5.706185 43.9807 5.803966 43.9904 5.9017463 44 6 44 6.0982537 44 6.196034 43.9904 6.293815 43.9807 6.390181 43.9616 6.486546 43.9424 6.580569 43.9139 6.674592 43.8854 6.765367 43.8478 6.856141 43.8102 6.942793 43.7638 7.02945 43.7175 7.11114 43.6629 7.19284 43.6083 7.26879 43.546 7.34474 43.4837 7.41421 43.4142 7.48369 43.3447 7.54602 43.2688 7.60835 43.1928 7.66294 43.1111 7.71753 43.0294 7.76384 42.9428 7.81016 42.8561 7.84776 42.7654 7.88536 42.6746 7.91388 42.5806 7.9424 42.4865 7.96157 42.3902 7.98074 42.2938 7.99037 42.196 8 42.0983 8 42zM14 29L14 41Q14 41.0983 14.00963 41.196 14.01926 41.2938 14.03843 41.3902 14.0576 41.4865 14.08612 41.580600000000004 14.11464 41.6746 14.152239999999999 41.7654 14.18984 41.8561 14.23616 41.9428 14.28247 42.0294 14.33706 42.1111 14.39165 42.1928 14.45398 42.2688 14.51631 42.3447 14.58579 42.4142 14.65526 42.4837 14.73121 42.546 14.80716 42.6084 14.88886 42.6629 14.97055 42.7175 15.057207 42.7638 15.143858999999999 42.8102 15.234633 42.8478 15.325408 42.885400000000004 15.419431 42.9139 15.513454 42.9424 15.609819 42.961600000000004 15.706185 42.9807 15.803966 42.9904 15.9017463 43 16 43L38 43Q38.098299999999995 43 38.196 42.9904 38.293800000000005 42.9807 38.3902 42.961600000000004 38.4865 42.9424 38.580600000000004 42.9139 38.6746 42.885400000000004 38.7654 42.8478 38.8561 42.8102 38.9428 42.7638 39.029399999999995 42.7175 39.1111 42.6629 39.1928 42.6084 39.2688 42.546 39.3447 42.4837 39.4142 42.4142 39.4837 42.3447 39.546 42.2688 39.6084 42.1928 39.6629 42.1111 39.7175 42.0294 39.7638 41.9428 39.810199999999995 41.8561 39.8478 41.7654 39.885400000000004 41.6746 39.9139 41.580600000000004 39.9424 41.4865 39.961600000000004 41.3902 39.9807 41.2938 39.9904 41.196 40 41.0983 40 41L40 29Q40 28.9017463 39.9904 28.803966 39.9807 28.706185 39.961600000000004 28.609819 39.9424 28.513454 39.9139 28.419431 39.885400000000004 28.325408 39.8478 28.234633 39.810199999999995 28.143859 39.7638 28.057207 39.7175 27.97055 39.6629 27.88886 39.6084 27.80716 39.546 27.73121 39.4837 27.65526 39.4142 27.58579 39.3447 27.51631 39.2688 27.45398 39.1928 27.39165 39.1111 27.33706 39.029399999999995 27.28247 38.9428 27.236159999999998 38.8561 27.18984 38.7654 27.15224 38.6746 27.11464 38.580600000000004 27.08612 38.4865 27.0576 38.3902 27.038429999999998 38.293800000000005 27.01926 38.196 27.00963 38.098299999999995 27 38 27L16 27Q15.9017463 27 15.803966 27.00963 15.706185 27.01926 15.609819 27.038429999999998 15.513454 27.0576 15.419431 27.08612 15.325408 27.11464 15.234633 27.15224 15.143858999999999 27.18984 15.057207 27.236159999999998 14.97055 27.28247 14.88886 27.33706 14.80716 27.39165 14.73121 27.45398 14.65526 27.51631 14.58579 27.58579 14.51631 27.65526 14.45398 27.73121 14.39165 27.80716 14.33706 27.88886 14.28247 27.97055 14.23616 28.057207 14.18984 28.143859 14.152239999999999 28.234633 14.11464 28.325408 14.08612 28.419431 14.0576 28.513454 14.03843 28.609819 14.01926 28.706185 14.00963 28.803966 14 28.9017463 14 29zM18 39L18 31 36 31 36 39 18 39z"})],-1),dD=[aD,uD];function hD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-cleanup`],width:"1em",height:"1em"},o.$attrs),dD,16,cD)}var pD=Ns(lD,[["render",hD]]);const $D={name:"IconDown",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},_D=["fill"],gD=Le("defs",null,[Le("clipPath",{id:"svg_74e8333ad1__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),fD=Le("g",{"clip-path":"url(#svg_74e8333ad1__a)"},[Le("path",{d:"M13.41445,16.58602L13.41421,16.58579Q13.27493,16.4465,13.11114,16.33706Q12.947355,16.22762,12.765367,16.15224Q12.583378,16.07686,12.390181,16.038429999999998Q12.196983,16,12,16Q11.803017,16,11.609819,16.038429999999998Q11.416622,16.07686,11.234633,16.15224Q11.052645,16.22762,10.88886,16.33706Q10.72507,16.4465,10.58579,16.58579Q10.4465,16.72507,10.33706,16.88886Q10.22762,17.052645,10.152239999999999,17.234633Q10.07686,17.416622,10.03843,17.609819Q10,17.803017,10,18Q10,18.196983,10.03843,18.390181Q10.07686,18.583378,10.152239999999999,18.765367Q10.22762,18.947355,10.33706,19.11114Q10.4465,19.27493,10.58579,19.41421L10.58602,19.41445L22.5858,31.4142Q22.725099999999998,31.5535,22.8889,31.6629Q23.052599999999998,31.772399999999998,23.2346,31.8478Q23.416600000000003,31.923099999999998,23.6098,31.9616Q23.803,32,24,32Q24.197,32,24.3902,31.9616Q24.583399999999997,31.923099999999998,24.7654,31.8478Q24.947400000000002,31.772399999999998,25.1111,31.6629Q25.274900000000002,31.5535,25.4142,31.4142L37.4135,19.41496L37.4142,19.41421Q37.5535,19.27493,37.6629,19.11114Q37.772400000000005,18.947355,37.8478,18.765367Q37.923100000000005,18.583378,37.961600000000004,18.390181Q38,18.196983,38,18Q38,17.803017,37.961600000000004,17.609819Q37.923100000000005,17.416621,37.8478,17.234633Q37.772400000000005,17.052645,37.6629,16.88886Q37.5535,16.72507,37.4142,16.58579Q37.2749,16.4465,37.1111,16.33706Q36.9474,16.22762,36.7654,16.15224Q36.5834,16.07686,36.3902,16.038429999999998Q36.197,16,36,16Q35.803,16,35.6098,16.038429999999998Q35.4166,16.07686,35.2346,16.15224Q35.0526,16.22762,34.8889,16.33706Q34.7251,16.4465,34.5858,16.58579L34.585,16.58654L24,27.17157L13.41445,16.58602Z","fill-rule":"evenodd"})],-1),mD=[gD,fD];function TD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-down`],width:"1em",height:"1em"},o.$attrs),mD,16,_D)}var ED=Ns($D,[["render",TD]]);const bD={name:"IconUp",props:{prefix:{type:String,default:"boxy"},useCurrentColor:{type:Boolean,default:!0}}},vD=["fill"],ID=Le("defs",null,[Le("clipPath",{id:"svg_46c48bec0d__a"},[Le("rect",{width:"48",height:"48",rx:"0"})])],-1),OD=Le("g",{"clip-path":"url(#svg_46c48bec0d__a)"},[Le("path",{d:"M34.5848,31.4132L34.5858,31.4142Q34.7251,31.5535,34.8889,31.6629Q35.0526,31.772399999999998,35.2346,31.8478Q35.4166,31.923099999999998,35.6098,31.9616Q35.803,32,36,32Q36.197,32,36.3902,31.9616Q36.5834,31.923099999999998,36.7654,31.8478Q36.9474,31.772399999999998,37.1111,31.6629Q37.2749,31.5535,37.4142,31.4142Q37.5535,31.274900000000002,37.6629,31.1111Q37.772400000000005,30.947400000000002,37.8478,30.7654Q37.923100000000005,30.583399999999997,37.961600000000004,30.3902Q38,30.197,38,30Q38,29.803,37.961600000000004,29.6098Q37.923100000000005,29.416600000000003,37.8478,29.2346Q37.772400000000005,29.052599999999998,37.6629,28.8889Q37.5535,28.725099999999998,37.4142,28.5858L25.4142,16.58579Q25.274900000000002,16.4465,25.1111,16.33706Q24.947400000000002,16.22762,24.7654,16.15224Q24.583399999999997,16.07686,24.3902,16.038429999999998Q24.197,16,24,16Q23.803,16,23.6098,16.038429999999998Q23.416600000000003,16.07686,23.2346,16.15224Q23.052599999999998,16.22762,22.8889,16.33706Q22.725099999999998,16.4465,22.5858,16.58579L10.58654,28.585L10.58579,28.5858Q10.4465,28.725099999999998,10.33706,28.8889Q10.22762,29.052599999999998,10.152239999999999,29.2346Q10.07686,29.416600000000003,10.03843,29.6098Q10,29.803,10,30Q10,30.048099999999998,10.00231,30.0961Q10.01119,30.2807,10.05376,30.4606Q10.09634,30.6405,10.17116,30.8095Q10.245989999999999,30.9786,10.35053,31.131Q10.45507,31.2835,10.58579,31.4142Q10.72507,31.5535,10.88886,31.6629Q11.052645,31.772399999999998,11.234633,31.8478Q11.416621,31.923099999999998,11.609819,31.9616Q11.803017,32,12,32Q12.196983,32,12.390181,31.9616Q12.583378,31.923099999999998,12.765367,31.8478Q12.947355,31.772399999999998,13.11114,31.6629Q13.27493,31.5535,13.41421,31.4142L13.41496,31.4135L24,20.82843L34.5848,31.4132Z","fill-rule":"evenodd"})],-1),CD=[ID,OD];function yD(o,n,s,l,a,u){return me(),Fe("svg",Ot({xmlns:"http://www.w3.org/2000/svg",fill:s.useCurrentColor?"currentColor":"#000",viewBox:"0 0 48 48",class:[`${s.prefix}-icon`,`${s.prefix}-icon-up`],width:"1em",height:"1em"},o.$attrs),CD,16,vD)}var SD=Ns(bD,[["render",yD]]);const lr=X5("main",()=>{const o=BE(null),n=BE(null),s=ge(!1),l=ge(!1);return{workspaceSvg:o,searchPlugin:n,hasLayoutSider:s,searchVisible:l}});const RD={id:"codespace"},xb="未检测到积木块",kD={__name:"Codespace",setup(o){const n=ge(xb),s=lr();zt(()=>{s.workspaceSvg.addChangeListener(()=>{n.value=Ve.pythonGenerator.workspaceToCode(s.workspaceSvg)||xb})});function l(){s.hasLayoutSider=!1}return(a,u)=>{const d=_t("highlightjs"),h=TI;return me(),it(h,{style:{overflow:"auto"}},{default:De(()=>[Le("div",RD,[Le("div",null,[Q(Xo(s2),{onClick:l})]),Le("div",null,[Q(d,{autodetect:"",code:n.value},null,8,["code"])])])]),_:1})}}};Tt.dialog.setAlert(function(o,n){dn.confirm({title:"注意",content:o,okText:"确认",onCancel:n,onOk:n,hideCancel:!0})});Tt.dialog.setConfirm(function(o,n){dn.confirm({title:"注意",content:o,okText:"确认",cancelText:"取消",onCancel:function(){n(!1)},onOk:function(){n(!0)}})});Tt.dialog.setPrompt(function(o,n,s){dn.confirm({title:o.replace(":",""),content:()=>Zs(mg,{defaultValue:n,id:"dialog-input"}),okText:"确认",cancelText:"取消",onCancel:function(){s(null)},onOk:function(){s(document.querySelector("#dialog-input input").value)}})});const AD={};const LD="/assets/boxy-1d58dca5.png";function i2(o){return G0()?(Jb(o),!0):!1}function ND(o){return typeof o=="function"?o():Xo(o)}const wD=typeof window<"u";/*! + * cookie + * Copyright(c) 2012-2014 Roman Shtylman + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */var n2=DD,Bb=PD,MD=Object.prototype.toString,yu=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function DD(o,n){if(typeof o!="string")throw new TypeError("argument str must be a string");for(var s={},l=n||{},a=l.decode||xD,u=0;u{if(!this.HAS_DOCUMENT_COOKIE)return;const a=this.cookies;this.cookies=n2(document.cookie),this._checkChanges(a)};const l=typeof document>"u"?"":document.cookie;this.cookies=VD(n||l),this.defaultSetOptions=s,this.HAS_DOCUMENT_COOKIE=HD()}_emitChange(n){for(let s=0;s{n[l]!==this.cookies[l]&&this._emitChange({name:l,value:p0(n[l])})})}_startPolling(){this.pollingInterval=setInterval(this.update,300)}_stopPolling(){this.pollingInterval&&clearInterval(this.pollingInterval)}get(n,s={}){return s.doNotUpdate||this.update(),p0(this.cookies[n],s)}getAll(n={}){n.doNotUpdate||this.update();const s={};for(let l in this.cookies)s[l]=p0(this.cookies[l],n);return s}set(n,s,l){l?l=Object.assign(Object.assign({},this.defaultSetOptions),l):l=this.defaultSetOptions;const a=typeof s=="string"?s:JSON.stringify(s);this.cookies=Object.assign(Object.assign({},this.cookies),{[n]:a}),this.HAS_DOCUMENT_COOKIE&&(document.cookie=Bb(n,a,l)),this._emitChange({name:n,value:s,options:l})}remove(n,s){const l=s=Object.assign(Object.assign({},s),{expires:new Date(1970,1,1,0,0,1),maxAge:0});this.cookies=Object.assign({},this.cookies),delete this.cookies[n],this.HAS_DOCUMENT_COOKIE&&(document.cookie=Bb(n,"",l)),this._emitChange({name:n,value:void 0,options:s})}addChangeListener(n){this.changeListeners.push(n),this.changeListeners.length===1&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.addEventListener("change",this.update):this._startPolling())}removeChangeListener(n){const s=this.changeListeners.indexOf(n);s>=0&&this.changeListeners.splice(s,1),this.changeListeners.length===0&&(typeof window=="object"&&"cookieStore"in window?window.cookieStore.removeEventListener("change",this.update):this._stopPolling())}}var zD=Object.defineProperty,Fb=Object.getOwnPropertySymbols,XD=Object.prototype.hasOwnProperty,jD=Object.prototype.propertyIsEnumerable,Ub=(o,n,s)=>n in o?zD(o,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[n]=s,Hb=(o,n)=>{for(var s in n||(n={}))XD.call(n,s)&&Ub(o,s,n[s]);if(Fb)for(var s of Fb(n))jD.call(n,s)&&Ub(o,s,n[s]);return o};function r2(o,{doNotParse:n=!1,autoUpdateDependencies:s=!1}={},l=new WD){const a=s?[...o||[]]:o;let u=l.getAll({doNotParse:!0});const d=ge(0),h=()=>{const p=l.getAll({doNotParse:!0});YD(a||null,p,u)&&d.value++,u=p};return l.addChangeListener(h),i2(()=>{l.removeChangeListener(h)}),{get:(...p)=>(s&&a&&!a.includes(p[0])&&a.push(p[0]),d.value,l.get(p[0],Hb({doNotParse:n},p[1]))),getAll:(...p)=>(d.value,l.getAll(Hb({doNotParse:n},p[0]))),set:(...p)=>l.set(...p),remove:(...p)=>l.remove(...p),addChangeListener:(...p)=>l.addChangeListener(...p),removeChangeListener:(...p)=>l.removeChangeListener(...p)}}function YD(o,n,s){if(!o)return!0;for(const l of o)if(n[l]!==s[l])return!0;return!1}const KD={id:"modal-content"},QD=Le("p",null,"积木盒宽度",-1),qD=Le("p",null,"主题",-1),JD=Le("span",{style:{color:"var(--color-text-4)"}},"Copyright 2023 Coconut Studio",-1),ZD={__name:"Settings",setup(o,{expose:n}){const s=r2(["flyout","theme"]),l=ge(!1),a=ge(s.get("flyout")||"full"),u=ge(s.get("theme")||"auto");function d(){l.value=!0}function h(){const C=document.querySelector("div.injectionDiv > svg.blocklyFlyout");C&&(C.style.width="320px")}function p(C){h(),a.value=C,s.set("flyout",C)}function f(C){let S=C;C==="auto"&&(S=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.body.setAttribute("arco-theme",S)}function T(C){f(C),u.value=C,s.set("theme",C)}return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(C){u.value==="auto"&&f(C.matches?"dark":"light")}),zt(()=>{let C=document.createElement("style");C.innerHTML="* { transition: color ease 50ms, background-color ease 200ms, border ease 300ms; }",document.head.appendChild(C)}),f(s.get("theme")||"auto"),n({handleClick:d}),(C,S)=>{const P=uw,x=Mu,G=Og,oe=ll,ne=yI,Z=dn;return me(),it(Z,{visible:l.value,"onUpdate:visible":S[0]||(S[0]=Y=>l.value=Y),width:"auto",footer:"false"},{title:De(()=>[Ut("设置")]),footer:De(()=>[JD]),default:De(()=>[Le("div",KD,[Q(G,null,{default:De(()=>[QD,Q(x,{"model-value":a.value,onChange:p,type:"button"},{default:De(()=>[Q(P,{value:"full"},{default:De(()=>[Ut("适应")]),_:1}),Q(P,{value:"fixed"},{default:De(()=>[Ut("固定")]),_:1})]),_:1},8,["model-value"])]),_:1}),Q(G,null,{default:De(()=>[qD,Q(ne,{"model-value":u.value,onChange:T,style:{"text-align":"justify"}},{default:De(()=>[Q(oe,{value:"light"},{icon:De(()=>[Q(Xo(Y8))]),default:De(()=>[Ut("白天模式")]),_:1}),Q(oe,{value:"dark"},{icon:De(()=>[Q(Xo(g8))]),default:De(()=>[Ut("黑夜模式")]),_:1}),Q(oe,{value:"auto"},{icon:De(()=>[Q(Xo(V8))]),default:De(()=>[Ut("跟随系统")]),_:1})]),_:1},8,["model-value"])]),_:1})])]),_:1},8,["visible"])}}};const e7={id:"modal-content"},t7={style:{"margin-bottom":"16px"}},o7=Le("span",{style:{color:"var(--color-text-4)"}},"Copyright 2023 Coconut Studio",-1),s7={__name:"Pip",setup(o,{expose:n}){const s=ge(!1),l=ge([]),a=ge(""),u=ge("");function d(){s.value=!0,h()}async function h(){try{const T=await(await fetch("./api/pipList")).json();l.value=T.pipList}catch(f){console.error("获取 Pip 列表失败:",f)}}async function p(){try{const f=new URL("/api/pipInstall",window.location.origin);f.searchParams.append("packageName",a.value),f.searchParams.append("installSource",u.value);const T=await fetch(f);if(!T.ok)throw new Error(`HTTP error! status: ${T.status}`);const C=await T.json();console.log(C)}catch(f){console.error("安装失败:",f)}}return n({handlePipClick:d}),(f,T)=>{const C=mg,S=ll,P=yI,x=Vc,G=dn;return me(),it(G,{visible:s.value,"onUpdate:visible":T[2]||(T[2]=oe=>s.value=oe),width:"auto",footer:"false"},{title:De(()=>[Ut("Pip 列表")]),footer:De(()=>[o7]),default:De(()=>[Le("div",e7,[Le("div",t7,[Q(C,{modelValue:a.value,"onUpdate:modelValue":T[0]||(T[0]=oe=>a.value=oe),placeholder:"请输入库名称",style:{width:"200px","margin-right":"8px"}},null,8,["modelValue"]),Q(P,{modelValue:u.value,"onUpdate:modelValue":T[1]||(T[1]=oe=>u.value=oe),placeholder:"请选择安装源",style:{width:"200px","margin-right":"8px"}},{default:De(()=>[Q(S,{value:"https://pypi.org/simple"},{default:De(()=>[Ut("PyPI")]),_:1}),Q(S,{value:"https://pypi.tuna.tsinghua.edu.cn/simple"},{default:De(()=>[Ut("清华大学")]),_:1}),Q(S,{value:"https://pypi.mirrors.ustc.edu.cn/simple"},{default:De(()=>[Ut("中国科学技术大学")]),_:1}),Q(S,{value:"https://pypi.org/simple"},{default:De(()=>[Ut("中国科技大学")]),_:1})]),_:1},8,["modelValue"]),Q(x,{type:"primary",onClick:p},{default:De(()=>[Ut("安装")]),_:1})]),Le("ul",null,[(me(!0),Fe(Wt,null,id(l.value,(oe,ne)=>(me(),Fe("li",{key:ne},Ci(oe[0]),1))),128))])])]),_:1},8,["visible"])}}};const i7=Le("img",{alt:"Logo",src:LD,width:"36",height:"36"},null,-1),n7=[i7],r7={class:"navigatorMenu"},l7={__name:"Navigator",setup(o){const n=ge(),s=ge(),l=ge(),a=lr();function u(){Tt.hideChaff()}function d(){const S=Tt.serialization.workspaces.save(a.workspaceSvg),P=JSON.stringify(S),x=new Blob([P],{type:"text/plain;charset=utf-8"}),G=URL.createObjectURL(x),oe=document.createElement("a");oe.href=G,oe.download="project.boxy",oe.click(),n.value=!1}function h(){const S=document.createElement("input");S.setAttribute("type","file"),S.setAttribute("name","file"),S.setAttribute("visibility","hidden"),S.setAttribute("accept",".boxy"),S.addEventListener("change",function(){const P=this.files[0],x=new FileReader;x.addEventListener("load",function(){const G=JSON.parse(this.result);Tt.serialization.workspaces.load(G,a.workspaceSvg)}),x.readAsText(P)}),S.click(),n.value=!1}function p(){a.searchVisible=!0,n.value=!1}function f(){s.value.handleClick(),n.value=!1}function T(){window.open("https://www.yuque.com/hzsn/boxy"),n.value=!1}function C(){l.value.handlePipClick(),n.value=!1}return(S,P)=>{const x=NN,G=yw,oe=zu;return me(),Fe(Wt,null,[Q(oe,{trigger:["hover","click"],position:"rt","popup-visible":n.value,"onUpdate:popupVisible":P[0]||(P[0]=ne=>n.value=ne)},{content:De(()=>[Le("div",r7,[Q(x,null,{default:De(()=>[Ut("新建")]),_:1}),Q(x,{onClick:C},{default:De(()=>[Ut("PIP库管理")]),_:1}),Q(x,{onClick:d},{default:De(()=>[Ut("保存到电脑")]),_:1}),Q(x,{onClick:h},{default:De(()=>[Ut("打开本地文件")]),_:1}),Q(G,{margin:"1px"}),Q(x,{onClick:p},{default:De(()=>[Ut("查找")]),_:1}),Q(G,{margin:"1px"}),Q(x,{onClick:f},{default:De(()=>[Ut("设置")]),_:1}),Q(x,{onClick:T},{default:De(()=>[Ut("关于")]),_:1})])]),default:De(()=>[Le("div",{id:"logo",onClick:u},n7)]),_:1},8,["popup-visible"]),Q(ZD,{ref_key:"modal",ref:s},null,512),Q(s7,{ref_key:"pipModal",ref:l},null,512)],64)}}};const c7={__name:"Screenshot",setup(o){const n=ge(),s=ge();function l(){const h=document.createElement("a");h.download="block.png",h.href=n.value,h.click()}function a(h){const p=document.createElement("img"),f=document.createElement("canvas"),T=f.getContext("2d"),C=Math.sqrt(40);f.width=h.width*C,f.height=h.height*C,p.onload=function(){T.drawImage(p,0,0,h.width,h.height,0,0,f.width,f.height);try{n.value=f.toDataURL("image/png"),s.value=!0}catch{console.warn("Error converting the workspace svg to a png.")}},p.src=h.data}function u(h,p){const f=document.getElementsByTagName("textarea");for(const R of f)R.innerHTML=R.value;const T=h.getBlocksBoundingBox(),C=T.x||T.left,S=T.y||T.top,P=T.width||T.right-C,x=T.height||T.bottom-S,oe=h.getCanvas().cloneNode(!0);oe.removeAttribute("transform");const ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.appendChild(oe),ne.setAttribute("viewBox",C+" "+S+" "+P+" "+x),ne.setAttribute("class","blocklySvg "+(h.options.renderer||"geras")+"-renderer "+(h.getTheme?h.getTheme().name+"-theme":"")),ne.setAttribute("width",P),ne.setAttribute("height",x),ne.setAttribute("style","background-color: transparent");const Z=[].slice.call(document.head.querySelectorAll("style")).filter(R=>/\.blocklySvg/.test(R.innerText)||R.id.indexOf("blockly-")===0).map(R=>R.innerText).join(` +`),Y=document.createElement("style");Y.innerHTML=Z+` +`+p,ne.insertBefore(Y,ne.firstChild);let M=new XMLSerializer().serializeToString(ne);return M=M.replace(/ /g," "),{data:"data:image/svg+xml,"+encodeURIComponent(M),width:P,height:x}}function d(h){const p=document.createElement("div"),f={blocks:{languageVersion:0,blocks:[h.block.toCopyData().saveInfo]}},T=Tt.inject(p,{readOnly:!0,theme:"codemao",renderer:"codemao"});return Tt.serialization.workspaces.load(f,T),T}return zt(()=>{Tt.ContextMenuRegistry.registry.register({callback:function(h){a(u(d(h)))},scopeType:Tt.ContextMenuRegistry.ScopeType.BLOCK,displayText:"生成积木图片",preconditionFn:function(){return"enabled"},id:"BlcokImage"}),Tt.ContextMenuRegistry.registry.register({callback:function(h){a(u(h.workspace))},scopeType:Tt.ContextMenuRegistry.ScopeType.WORKSPACE,displayText:"全局预览",preconditionFn:function(h){return h.workspace.blockDB.size?"enabled":"disabled"},id:"WorkspaceImage"})}),(h,p)=>{const f=kI,T=F6;return me(),it(T,{src:n.value,"onUpdate:src":p[0]||(p[0]=C=>n.value=C),visible:s.value,"onUpdate:visible":p[1]||(p[1]=C=>s.value=C)},{actions:De(()=>[Q(f,{name:"下载",onClick:l},{default:De(()=>[Q(Xo(rD))]),_:1})]),_:1},8,["src","visible"])}}};const a7={id:"search"},u7={__name:"Search",setup(o){const n=ge(),s=lr();function l(){n.value=!0}function a(){n.value=!1,s.searchPlugin.close()}function u(T){s.searchPlugin.searchAndHighlight(T)}function d(){s.searchPlugin.next()}function h(){s.searchPlugin.previous()}function p(){s.searchPlugin.next()}function f(){s.searchVisible=!1}return zt(()=>{s.workspaceSvg.injectionDiv.addEventListener("keydown",T=>{(T.ctrlKey||T.metaKey)&&T.key==="f"&&(s.searchVisible=!0,T.preventDefault(),T.stopPropagation())}),Et(s.$state,T=>{T.searchVisible?l():a()}),a()}),(T,C)=>{const S=Vc,P=mg,x=Og;return me(),Fe("div",a7,[Q(x,{style:It({display:n.value?"block":"none"})},{default:De(()=>[Q(P,{placeholder:"搜索作品中的积木",onInput:u,onPressEnter:d},{append:De(()=>[Q(S,{type:"text",onClick:h,"aria-label":"整理"},{icon:De(()=>[Q(Xo(SD))]),_:1}),Q(S,{type:"text",onClick:p,"aria-label":"整理"},{icon:De(()=>[Q(Xo(ED))]),_:1}),Q(S,{type:"text",onClick:f,"aria-label":"关闭"},{icon:De(()=>[Q(Xo(s2))]),_:1})]),_:1})]),_:1},8,["style"])])}}};function d7(o){var n;const s=ND(o);return(n=s==null?void 0:s.$el)!=null?n:s}const h7=wD?window:void 0;function p7(){const o=ge(!1);return ml()&&zt(()=>{o.value=!0}),o}function $7(o){const n=p7();return j(()=>(n.value,!!o()))}var Vb=Object.getOwnPropertySymbols,_7=Object.prototype.hasOwnProperty,g7=Object.prototype.propertyIsEnumerable,f7=(o,n)=>{var s={};for(var l in o)_7.call(o,l)&&n.indexOf(l)<0&&(s[l]=o[l]);if(o!=null&&Vb)for(var l of Vb(o))n.indexOf(l)<0&&g7.call(o,l)&&(s[l]=o[l]);return s};function l2(o,n,s={}){const l=s,{window:a=h7}=l,u=f7(l,["window"]);let d;const h=$7(()=>a&&"MutationObserver"in a),p=()=>{d&&(d.disconnect(),d=void 0)},f=Et(()=>d7(o),C=>{p(),h.value&&a&&C&&(d=new MutationObserver(n),d.observe(C,u))},{immediate:!0}),T=()=>{p(),f()};return i2(T),{isSupported:h,stop:T}}const Gb="/assets/superellipse-abb4b598.svg";const m7={__name:"Toolbox",setup(o){class n extends Tt.ToolboxCategory{constructor(){super(...arguments);J$(this,"setSelected",u=>{let d=this.rowDiv_.getElementsByClassName("blocklyTreeLabel")[0];u?(this.rowDiv_.style.backgroundColor="rgb(var(--primary-5))",d.style.color="var(--color-white)"):(this.rowDiv_.style.backgroundColor="",d.style.color=""),Tt.utils.aria.setState(this.htmlDiv_,Tt.utils.aria.State.SELECTED,u)});J$(this,"createIconDom_",()=>{const u=document.createElement("iconpark-icon");return u.name=this.toolboxItemDef_.categorystyle,u.size="21",u.style=` + -webkit-mask-size: 100% 100%; + -webkit-mask-image: url(${Gb}); + mask-size: 100% 100%; + mask-image: url(${Gb}); + color: white; + `,u})}addColourBorder_(u){this.rowDiv_.children[0].children[0].style.backgroundColor=u}}Tt.registry.register(Tt.registry.Type.TOOLBOX_ITEM,Tt.ToolboxCategory.registrationName,n,!0),Tt.VerticalFlyout.prototype.reflowInternal_=function(){this.workspace_.scale=.8;let l=0;const a=this.workspace_.getTopBlocks(!1);for(const u of a){let d=u.getHeightWidth().width;u.outputConnection&&(d-=this.tabWidth_),l=Math.max(l,d)}for(const u of this.buttons_)l=Math.max(l,u.width);if(l+=this.MARGIN*1.5+this.tabWidth_,l*=this.workspace_.scale,l+=Tt.Scrollbar.scrollbarThickness,this.width_!==l){for(const u of a){if(this.RTL){const d=u.getRelativeToSurfaceXY().x;let h=l/this.workspace_.scale-this.MARGIN;u.outputConnection||(h-=this.tabWidth_),u.moveBy(h-d,0)}this.rectMap_.has(u)&&this.moveRectToBlock_(this.rectMap_.get(u),u)}if(this.RTL)for(const u of this.buttons_){const d=u.getPosition().y,h=l/this.workspace_.scale-u.width-this.MARGIN-this.tabWidth_;u.moveTo(h,d)}this.targetWorkspace.toolboxPosition===this.toolboxPosition_&&this.toolboxPosition_===Tt.utils.toolbox.Position.LEFT&&!this.targetWorkspace.getToolbox()&&this.targetWorkspace.translate(this.targetWorkspace.scrollX+l,this.targetWorkspace.scrollY),this.width_=l,this.position(),this.targetWorkspace.recordDragTargets()}};const s=r2(["flyout"]);return zt(()=>{const l=document.querySelector("#app > section > main > div.blocklyDiv > div > svg.blocklyFlyout");l2(l,()=>{const a=s.get("flyout"),u=Math.max(parseInt(l.getAttribute("width")),320),d=l.style.display==="block";l.style.width=a==="fixed"||!d?"320px":`${u}px`,l.style.transform=d?"translate(60px, 0px)":`translate(${60-(a==="full"?u:320)}px, 0px)`},{attributeFilter:["style"]}),l.addEventListener("mouseenter",()=>{s.get("flyout")==="fixed"&&(l.style.minWidth=l.getAttribute("width")+"px")}),l.addEventListener("mouseleave",()=>{s.get("flyout")==="fixed"&&(l.style.minWidth="320px")})}),()=>{}}},T7="/assets/trashcan_lid-bf343e64.svg",E7="/assets/trashcan_body-d3f2460a.svg";const b7={__name:"Trashcan",setup(o){const n=lr(),s=ge(),l=ge(),a=ge();function u(){s.value.style.zIndex=6,l.value.style.zIndex=7,a.value.style.zIndex=7,s.value.style.opacity=1,l.value.style.opacity=1,a.value.style.opacity=1}function d(){s.value.style.zIndex=0,l.value.style.zIndex=0,a.value.style.zIndex=0,s.value.style.opacity=0,l.value.style.opacity=0,a.value.style.opacity=0}function h(){l.value.style.transform="translate(-4px,-4px) rotate(-20deg)"}function p(){l.value.style.transform="translate(0px, 0px) rotate(0deg)"}return zt(()=>{l2(document.querySelector("#app > section > main > div.blocklyDiv > div > div"),f=>{f[0].target.classList.contains("blocklyToolboxDelete")?h():p()},{attributeFilter:["class"]}),n.workspaceSvg.addChangeListener(f=>{f.type==="drag"?u():f.type==="move"&&f.oldCoordinate!==void 0&&d()})}),(f,T)=>(me(),Fe("div",{ref_key:"trashcan",ref:s,id:"trashcan",class:"blocklyToolboxDelete",style:{cursor:"grabbing"}},[Le("img",{ref_key:"trashcanLid",ref:l,src:T7,alt:"垃圾桶盖"},null,512),Le("img",{ref_key:"trashcanBody",ref:a,src:E7,alt:"垃圾桶身"},null,512)],512))}};var v7={exports:{}};/*! For license information please see index.js.LICENSE.txt */(function(o,n){(function(s,l){o.exports=l(Gc())})(Do,s=>(()=>{var l={573:h=>{h.exports=s}},a={};function u(h){var p=a[h];if(p!==void 0)return p.exports;var f=a[h]={exports:{}};return l[h](f,f.exports,u),f.exports}u.n=h=>{var p=h&&h.__esModule?()=>h.default:()=>h;return u.d(p,{a:p}),p},u.d=(h,p)=>{for(var f in p)u.o(p,f)&&!u.o(h,f)&&Object.defineProperty(h,f,{enumerable:!0,get:p[f]})},u.o=(h,p)=>Object.prototype.hasOwnProperty.call(h,p),u.r=h=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(h,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(h,"__esModule",{value:!0})};var d={};return(()=>{u.r(d);var h=u(573),p=u.n(h);function f(L){if(L.saveExtraState){const R=L.saveExtraState();return R?JSON.stringify(R):""}if(L.mutationToDom){const R=L.mutationToDom();return R?h.Xml.domToText(R):""}return""}function T(L){const R=new h.FieldImage(S,15,15,void 0,C);return R.args_=L,R}function C(L){const R=L.getSourceBlock();if(R.isInFlyout)return;h.Events.setGroup(!0);const F=f(R);R.minus(L.args_);const z=f(R);F!=z&&h.Events.fire(new h.Events.BlockChange(R,"mutation",null,F,z)),h.Events.setGroup(!1)}const S="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTFoLTEyYy0xLjEwNCAwLTIgLjg5Ni0yIDJzLjg5NiAyIDIgMmgxMmMxLjEwNCAwIDItLjg5NiAyLTJzLS44OTYtMi0yLTJ6IiBmaWxsPSJ3aGl0ZSIgLz48L3N2Zz4K";function P(L){const R=new h.FieldImage(G,15,15,void 0,x);return R.args_=L,R}function x(L){const R=L.getSourceBlock();if(R.isInFlyout)return;h.Events.setGroup(!0);const F=f(R);R.plus(L.args_);const z=f(R);F!=z&&h.Events.fire(new h.Events.BlockChange(R,"mutation",null,F,z)),h.Events.setGroup(!1)}const G="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cGF0aCBkPSJNMTggMTBoLTR2LTRjMC0xLjEwNC0uODk2LTItMi0ycy0yIC44OTYtMiAybC4wNzEgNGgtNC4wNzFjLTEuMTA0IDAtMiAuODk2LTIgMnMuODk2IDIgMiAybDQuMDcxLS4wNzEtLjA3MSA0LjA3MWMwIDEuMTA0Ljg5NiAyIDIgMnMyLS44OTYgMi0ydi00LjA3MWw0IC4wNzFjMS4xMDQgMCAyLS44OTYgMi0ycy0uODk2LTItMi0yeiIgZmlsbD0id2hpdGUiIC8+PC9zdmc+Cg==",oe={elseIfCount_:0,hasElse_:!1,mutationToDom:function(){if(!this.elseIfCount_&&!this.hasElse_)return null;const L=p().utils.xml.createElement("mutation");return L.setAttribute("elseif",this.elseIfCount_),this.hasElse_&&L.setAttribute("else",1),L},domToMutation:function(L){const R=parseInt(L.getAttribute("elseif"),10)||0;this.hasElse_=!!parseInt(L.getAttribute("else"),10)||0,this.hasElse_&&!this.getInput("ELSE")&&this.appendStatementInput("ELSE").appendField(p().Msg.CONTROLS_IF_MSG_ELSE),this.updateShape_(R)},saveExtraState:function(){if(!this.elseIfCount_&&!this.hasElse_)return null;const L=Object.create(null);return this.elseIfCount_&&(L.elseIfCount=this.elseIfCount_),this.hasElse_&&(L.hasElse=!0),L},loadExtraState:function(L){const R=L.elseIfCount||0;this.hasElse_=L.hasElse||!1,this.hasElse_&&!this.getInput("ELSE")&&this.appendStatementInput("ELSE").appendField(p().Msg.CONTROLS_IF_MSG_ELSE),this.updateShape_(R)},updateShape_:function(L){for(;this.elseIfCount_L;)this.removeElseIf_()},plus:function(){this.addElseIf_()},minus:function(L){this.elseIfCount_!=0&&this.removeElseIf_(L)},addElseIf_:function(){this.elseIfCount_++,this.appendValueInput("IF"+this.elseIfCount_).setCheck("Boolean").appendField(p().Msg.CONTROLS_IF_MSG_ELSEIF).appendField(T(this.elseIfCount_),"MINUS"+this.elseIfCount_),this.appendStatementInput("DO"+this.elseIfCount_).appendField(p().Msg.CONTROLS_IF_MSG_THEN),this.getInput("ELSE")&&this.moveInputBefore("ELSE",null)},removeElseIf_:function(L){if(L!==void 0&&L!=this.elseIfCount_){const R=2*L,F=this.inputList;let z=F[R].connection;z.isConnected()&&z.disconnect(),z=F[R+1].connection,z.isConnected()&&z.disconnect(),this.bumpNeighbours();for(let X,le=R+2;(X=this.inputList[le])&&X.name!="ELSE";le++){const $e=X.connection.targetConnection;$e&&this.inputList[le-2].connection.connect($e)}}this.removeInput("IF"+this.elseIfCount_),this.removeInput("DO"+this.elseIfCount_),this.elseIfCount_--}};p().Extensions.isRegistered("controls_if_mutator")&&p().Extensions.unregister("controls_if_mutator"),p().Extensions.registerMutator("controls_if_mutator",oe,function(){this.getInput("IF0").insertFieldAt(0,P(),"PLUS")}),delete p().Blocks.lists_create_with,p().defineBlocksWithJsonArray([{type:"lists_create_with",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE} %1",args0:[{type:"input_dummy",name:"EMPTY"}],output:"Array",style:"list_blocks",helpUrl:"%{BKY_LISTS_CREATE_WITH_HELPURL}",tooltip:"%{BKY_LISTS_CREATE_WITH_TOOLTIP}",mutator:"new_list_create_with_mutator"}]);const ne={itemCount_:0,mutationToDom:function(){const L=p().utils.xml.createElement("mutation");return L.setAttribute("items",this.itemCount_),L},domToMutation:function(L){const R=parseInt(L.getAttribute("items"),10);this.updateShape_(R)},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(L){this.updateShape_(L.itemCount)},updateShape_:function(L){for(;this.itemCount_L;)this.removePart_();this.updateMinus_()},plus:function(){this.addPart_(),this.updateMinus_()},minus:function(){this.itemCount_!=0&&(this.removePart_(),this.updateMinus_())},addPart_:function(){this.itemCount_==0?(this.removeInput("EMPTY"),this.topInput_=this.appendValueInput("ADD"+this.itemCount_).appendField(P(),"PLUS").appendField(p().Msg.LISTS_CREATE_WITH_INPUT_WITH)):this.appendValueInput("ADD"+this.itemCount_),this.itemCount_++},removePart_:function(){this.itemCount_--,this.removeInput("ADD"+this.itemCount_),this.itemCount_==0&&(this.topInput_=this.appendDummyInput("EMPTY").appendField(P(),"PLUS").appendField(p().Msg.LISTS_CREATE_EMPTY_TITLE))},updateMinus_:function(){const L=this.getField("MINUS");!L&&this.itemCount_>0?this.topInput_.insertFieldAt(1,T(),"MINUS"):L&&this.itemCount_<1&&this.topInput_.removeField("MINUS")}};p().Extensions.registerMutator("new_list_create_with_mutator",ne,function(){this.getInput("EMPTY").insertFieldAt(0,P(),"PLUS"),this.updateShape_(3)}),p().Msg.PROCEDURE_VARIABLE="variable:",delete p().Blocks.procedures_defnoreturn,delete p().Blocks.procedures_defreturn,p().defineBlocksWithJsonArray([{type:"procedures_defnoreturn",message0:"%{BKY_PROCEDURES_DEFNORETURN_TITLE} %1 %2",message1:"%{BKY_PROCEDURES_DEFNORETURN_DO} %1",args0:[{type:"field_input",name:"NAME",text:""},{type:"input_dummy",name:"TOP"}],args1:[{type:"input_statement",name:"STACK"}],style:"procedure_blocks",helpUrl:"%{BKY_PROCEDURES_DEFNORETURN_HELPURL}",tooltip:"%{BKY_PROCEDURES_DEFNORETURN_TOOLTIP}",extensions:["get_procedure_def_no_return","procedure_context_menu","procedure_rename","procedure_vars"],mutator:"procedure_def_mutator"},{type:"procedures_defreturn",message0:"%{BKY_PROCEDURES_DEFRETURN_TITLE} %1 %2",message1:"%{BKY_PROCEDURES_DEFRETURN_DO} %1",message2:"%{BKY_PROCEDURES_DEFRETURN_RETURN} %1",args0:[{type:"field_input",name:"NAME",text:""},{type:"input_dummy",name:"TOP"}],args1:[{type:"input_statement",name:"STACK"}],args2:[{type:"input_value",align:"right",name:"RETURN"}],style:"procedure_blocks",helpUrl:"%{BKY_PROCEDURES_DEFRETURN_HELPURL}",tooltip:"%{BKY_PROCEDURES_DEFRETURN_TOOLTIP}",extensions:["get_procedure_def_return","procedure_context_menu","procedure_rename","procedure_vars"],mutator:"procedure_def_mutator"}]),p().Extensions.registerMixin("get_procedure_def_no_return",{getProcedureDef:function(){const L=this.argData_.map(R=>R.model.name);return[this.getFieldValue("NAME"),L,!1]},callType_:"procedures_callnoreturn"}),p().Extensions.registerMixin("get_procedure_def_return",{getProcedureDef:function(){const L=this.argData_.map(R=>R.model.name);return[this.getFieldValue("NAME"),L,!0]},callType_:"procedures_callreturn"});const Z={customContextMenu:function(L){if(this.isInFlyout)return;const R=this.getFieldValue("NAME"),F=p().Msg.PROCEDURES_CREATE_DO.replace("%1",R),z=p().utils.xml.createElement("block");z.setAttribute("type",this.callType_),z.appendChild(this.mutationToDom(!0));const X=p().ContextMenu.callbackFactory(this,z);if(L.push({enabled:!0,text:F,callback:X}),this.isCollapsed())return;const le=this.getVarModels();for(const $e of le){const he=p().Msg.VARIABLES_SET_CREATE_GET.replace("%1",$e.name),fe=p().utils.xml.createElement("block");fe.setAttribute("type","variables_get"),fe.appendChild(p().Variables.generateVariableFieldDom($e));const ke=p().ContextMenu.callbackFactory(this,fe);L.push({enabled:!0,text:he,callback:ke})}}};p().Extensions.registerMixin("procedure_context_menu",Z);const Y={mutationToDom:function(L=!1){const R=p().utils.xml.createElement("mutation");return L&&R.setAttribute("name",this.getFieldValue("NAME")),this.argData_.forEach(F=>{const z=p().utils.xml.createElement("arg"),X=F.model;z.setAttribute("name",X.name),z.setAttribute("varid",X.getId()),z.setAttribute("argid",F.argId),L&&z.setAttribute("paramid",F.argId),R.appendChild(z)}),this.hasStatements_||R.setAttribute("statements","false"),R},domToMutation:function(L){this.hasStatements_=L.getAttribute("statements")!=="false",this.hasStatements_||this.removeInput("STACK");const R=[],F=[],z=[];for(const X of L.childNodes)X.nodeName.toLowerCase()=="arg"&&(R.push(X.getAttribute("name")),F.push(X.getAttribute("varid")||X.getAttribute("varId")),z.push(X.getAttribute("argid")));this.updateShape_(R,F,z)},saveExtraState:function(){if(!this.argData_.length&&this.hasStatements_)return null;const L=Object.create(null);return this.argData_.length&&(L.params=[],this.argData_.forEach(R=>{const F=R.model;L.params.push({name:F.name,id:F.getId(),argId:R.argId})})),this.hasStatements_||(L.hasStatements=!1),L},loadExtraState:function(L){this.hasStatements_=L.hasStatements!==!1,this.hasStatements_||this.removeInput("STACK");const R=[],F=[],z=[];if(L.params)for(let X=0;X=0;X--)this.removeArg_(this.argData_[X].argId);this.argData_=[];const z=R.length;for(let X=0;Xle.model.name);L=L||p().Variables.generateUniqueNameFromOptions(p().Procedures.DEFAULT_ARG,z);const X=p().Variables.getOrCreateVariablePackage(this.workspace,R,L,"");F=F||p().utils.idGenerator.genUid(),this.addVarInput_(L,F),this.getInput("STACK")?this.moveInputBefore(F,"STACK"):this.moveInputBefore(F,"RETURN"),this.argData_.push({model:X,argId:F})},removeArg_:function(L){this.removeInput(L,!0)&&(this.argData_.length==1&&this.getInput("TOP").removeField("WITH"),this.argData_=this.argData_.filter(R=>R.argId!=L))},addVarInput_:function(L,R){const F=new(p()).FieldTextInput(L,this.validator_);F.onFinishEditing_=this.finishEditing_.bind(F),F.varIdsToDelete_=[],F.preEditVarModel_=null,this.appendDummyInput(R).setAlign(p().ALIGN_RIGHT).appendField(T(R)).appendField(p().Msg.PROCEDURE_VARIABLE).appendField(F,R)},validator_:function(L){const R=this.getSourceBlock(),F=R.workspace,z=R.argData_,X=R.argData_.find(fe=>fe.argId==this.name),le=X.model.getId(),$e=(L=L.replace(/[\s\xa0]+/g," ").trim()).toLowerCase();if(!L||!z.every(fe=>fe.argId==this.name||$e!=fe.model.name.toLowerCase()))return this.preEditVarModel_&&(X.model=this.preEditVarModel_,this.preEditVarModel_=null),p().Procedures.mutateCallers(R),null;this.varIdsToDelete_.length||(this.preEditVarModel_=X.model,F.getVariableUsesById(le).every(fe=>fe.id==R.id||fe.getProcedureCall&&fe.getProcedureCall()==R.getProcedureDef()[0])&&this.varIdsToDelete_.push(le));let he=F.getVariable(L,"");return he?he.name!=L&&F.renameVariableById(he.getId(),L):(he=F.createVariable(L,""),this.varIdsToDelete_.push(he.getId())),he.getId()!=le&&(X.model=he),p().Procedures.mutateCallers(R),L},finishEditing_:function(L){const R=this.getSourceBlock(),F=R.argData_.find(z=>z.argId==this.name).model.getId();this.varIdsToDelete_.forEach(z=>{z!=F&&R.workspace.deleteVariableById(z)}),this.varIdsToDelete_.length=0,this.preEditVarModel_=null}};p().Extensions.registerMutator("procedure_def_mutator",Y,function(){this.argData_=[],this.hasStatements_=!0,this.getInput("TOP").insertFieldAt(0,P(),"PLUS")}),p().Extensions.register("procedure_rename",function(){this.getField("NAME").setValidator(p().Procedures.rename)}),p().Extensions.register("procedure_vars",function(){const L={getVars:function(){return this.argData_.map(R=>R.model.name)},getVarModels:function(){return this.argData_.map(R=>R.model)},renameVarById:function(R,F){const z=this.argData_.find($e=>$e.model.getId()==R);if(!z)return;const X=this.workspace.getVariableById(F),le=X.name;this.addVarInput_(le,F),this.moveInputBefore(F,R),this.removeInput(R),z.model=X,p().Procedures.mutateCallers(this)},updateVarName:function(R){const F=R.getId(),z=this.argData_.find(X=>X.model.getId()==F);z&&(this.setFieldValue(R.name,z.argId),z.model=R)}};this.mixin(L,!0)});const M={itemCount_:0,mutationToDom:function(){const L=p().utils.xml.createElement("mutation");return L.setAttribute("items",this.itemCount_),L},domToMutation:function(L){const R=parseInt(L.getAttribute("items"),10);this.updateShape_(R)},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(L){this.updateShape_(L.itemCount)},updateShape_:function(L){for(;this.itemCount_L;)this.removePart_();this.updateMinus_()},plus:function(){this.addPart_(),this.updateMinus_()},minus:function(){this.itemCount_!=0&&(this.removePart_(),this.updateMinus_())},addPart_:function(){this.itemCount_==0?(this.getInput("EMPTY")&&this.removeInput("EMPTY"),this.topInput_=this.appendValueInput("ADD"+this.itemCount_).appendField(P(),"PLUS").appendField(p().Msg.TEXT_JOIN_TITLE_CREATEWITH)):this.appendValueInput("ADD"+this.itemCount_),this.itemCount_++},removePart_:function(){this.itemCount_--,this.removeInput("ADD"+this.itemCount_),this.itemCount_==0&&(this.topInput_=this.appendDummyInput("EMPTY").appendField(P(),"PLUS").appendField(this.newQuote_(!0)).appendField(this.newQuote_(!1)))},updateMinus_:function(){const L=this.getField("MINUS");!L&&this.itemCount_>0?this.topInput_.insertFieldAt(1,T(),"MINUS"):L&&this.itemCount_<1&&this.topInput_.removeField("MINUS")}};p().Extensions.isRegistered("text_join_mutator")&&p().Extensions.unregister("text_join_mutator"),p().Extensions.registerMutator("text_join_mutator",M,function(){p().Extensions.apply("text_quotes",this,!1),this.updateShape_(2)})})(),d})())})(v7);/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */const I7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNMTkgNi40MUwxNy41OSA1IDEyIDEwLjU5IDYuNDEgNSA1IDYuNDEgMTAuNTkgMTIgNSAxNy41OSA2LjQxIDE5IDEyIDEzLjQxIDE3LjU5IDE5IDE5IDE3LjU5IDEzLjQxIDEyeiIvPjxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz48L3N2Zz4=",O7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSA4LjU5TDEyIDEzLjE3bDQuNTktNC41OEwxOCAxMGwtNiA2LTYtNiAxLjQxLTEuNDF6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgwVjB6IiBmaWxsPSJub25lIi8+PC9zdmc+",C7="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgd2lkdGg9IjE0Ij48cGF0aCBkPSJNNy40MSAxNS40MUwxMiAxMC44M2w0LjU5IDQuNThMMTggMTRsLTYtNi02IDZ6Ii8+PHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==",y7=["path.blocklyPath.blockly-ws-search-highlight {","fill: #000;","}","path.blocklyPath.blockly-ws-search-highlight.blockly-ws-search-current {","fill: grey;","}",".blockly-ws-search-close-btn {","background: url("+I7+") no-repeat top left;","}",".blockly-ws-search-next-btn {","background: url("+O7+") no-repeat top left;","}",".blockly-ws-search-previous-btn {","background: url("+C7+") no-repeat top left;","}",".blockly-ws-search {","background: #fff;","border: solid lightgrey 0.5px;","box-shadow: 0px 10px 20px grey;","justify-content: center;","padding: 0.25em;","position: absolute;","z-index: 70;","}",".blockly-ws-search-input input {","border: none;","}",".blockly-ws-search button {","border: none;","}",".blockly-ws-search-actions {","display: flex;","}",".blockly-ws-search-container {","display: flex;","}",".blockly-ws-search-content {","display: flex;","}"],S7=function(){let o=!1;return function(){if(o)return;o=!0;const n=y7.join(` +`),s=document.createElement("style");s.id="blockly-ws-search-style";const l=document.createTextNode(n);s.appendChild(l),document.head.insertBefore(s,document.head.firstChild)}}();var Wo=Gc();/** + * @license + * Copyright 2020 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */class R7{constructor(n){this.workspace_=n,this.id="workspaceSearch",this.htmlDiv_=null,this.actionDiv_=null,this.inputElement_=null,this.textInputPlaceholder_="Search",this.blocks_=[],this.currentBlockIndex_=-1,this.searchText_="",this.searchOnInput=!0,this.caseSensitive=!1,this.preserveSelected=!0,this.boundEvents_=[]}init(){this.workspace_.getComponentManager().addComponent({component:this,weight:0,capabilities:[Wo.ComponentManager.Capability.POSITIONABLE]}),S7(),this.createDom_(),this.setVisible_(!1),this.workspace_.resize()}dispose(){for(const n of this.boundEvents_)Wo.browserEvents.unbind(n);this.boundEvents_.length=0,this.htmlDiv_&&(this.htmlDiv_.remove(),this.htmlDiv_=null),this.actionDiv_=null,this.inputElement_=null}createDom_(){const n=this.workspace_.getInjectionDiv();this.addEvent_(n,"keydown",this,p=>this.onWorkspaceKeyDown_(p)),this.htmlDiv_=document.createElement("div"),Wo.utils.dom.addClass(this.htmlDiv_,"blockly-ws-search");const s=document.createElement("div");Wo.utils.dom.addClass(s,"blockly-ws-search-container");const l=document.createElement("div");Wo.utils.dom.addClass(l,"blockly-ws-search-content"),s.appendChild(l);const a=document.createElement("div");Wo.utils.dom.addClass(a,"blockly-ws-search-input"),this.inputElement_=this.createTextInput_(),this.addEvent_(this.inputElement_,"keydown",this,p=>this.onKeyDown_(p)),this.addEvent_(this.inputElement_,"input",this,()=>this.onInput_()),this.addEvent_(this.inputElement_,"click",this,()=>{this.searchAndHighlight(this.searchText_,this.preserveSelected),this.inputElement_.select()}),a.appendChild(this.inputElement_),l.appendChild(a),this.actionDiv_=document.createElement("div"),Wo.utils.dom.addClass(this.actionDiv_,"blockly-ws-search-actions"),l.appendChild(this.actionDiv_);const u=this.createNextBtn_();u&&this.addActionBtn(u,()=>this.next());const d=this.createPreviousBtn_();d&&this.addActionBtn(d,()=>this.previous());const h=this.createCloseBtn_();h&&(this.addBtnListener_(h,()=>this.close()),s.appendChild(h)),this.htmlDiv_.appendChild(s),n.insertBefore(this.htmlDiv_,this.workspace_.getParentSvg())}addEvent_(n,s,l,a){const u=Wo.browserEvents.conditionalBind(n,s,l,a);this.boundEvents_.push(u)}addActionBtn(n,s){this.addBtnListener_(n,s),this.actionDiv_.appendChild(n)}createTextInput_(){const n=document.createElement("input");return n.type="text",n.setAttribute("placeholder",this.textInputPlaceholder_),n}createNextBtn_(){return this.createBtn_("blockly-ws-search-next-btn","Find next")}createPreviousBtn_(){return this.createBtn_("blockly-ws-search-previous-btn","Find previous")}createCloseBtn_(){return this.createBtn_("blockly-ws-search-close-btn","Close search bar")}createBtn_(n,s){const l=document.createElement("button");return Wo.utils.dom.addClass(l,n),l.setAttribute("aria-label",s),l}addBtnListener_(n,s){this.addEvent_(n,"click",this,s),this.addEvent_(n,"keydown",this,l=>{l.key==="Enter"?(s(l),l.preventDefault()):l.key==="Escape"&&this.close(),l.stopPropagation()})}getBoundingRectangle(){return null}position(n,s){this.workspace_.RTL?this.htmlDiv_.style.left=n.absoluteMetrics.left+"px":n.toolboxMetrics.position===Wo.TOOLBOX_AT_RIGHT?this.htmlDiv_.style.right=n.toolboxMetrics.width+"px":this.htmlDiv_.style.right="0",this.htmlDiv_.style.top=n.absoluteMetrics.top+"px"}onInput_(){if(this.searchOnInput){const n=this.inputElement_.value.trim();n!==this.searchText_&&this.searchAndHighlight(n,this.preserveSelected)}}onKeyDown_(n){if(n.key==="Escape")this.close();else if(n.key==="Enter")if(this.searchOnInput)this.next();else{const s=this.inputElement_.value.trim();s!==this.searchText_&&this.searchAndHighlight(s,this.preserveSelected)}}onWorkspaceKeyDown_(n){(n.ctrlKey||n.metaKey)&&n.key==="f"&&(this.open(),n.preventDefault(),n.stopPropagation())}previous(){this.setCurrentBlock_(this.currentBlockIndex_-1)}next(){this.setCurrentBlock_(this.currentBlockIndex_+1)}setSearchPlaceholder(n){this.textInputPlaceholder_=n,this.inputElement_&&this.inputElement_.setAttribute("placeholder",this.textInputPlaceholder_)}setCurrentBlock_(n){if(!this.blocks_.length)return;let s=this.blocks_[this.currentBlockIndex_];s&&this.unhighlightCurrentSelection_(s),this.currentBlockIndex_=(n%this.blocks_.length+this.blocks_.length)%this.blocks_.length,s=this.blocks_[this.currentBlockIndex_],this.highlightCurrentSelection_(s),this.workspace_.centerOnBlock(s.id,!1)}open(){this.setVisible_(!0),this.inputElement_.focus(),this.searchText_&&this.searchAndHighlight(this.searchText_)}close(){this.setVisible_(!1),this.workspace_.markFocused(),this.clearBlocks()}setVisible_(n){this.htmlDiv_.style.display=n?"flex":"none"}searchAndHighlight(n,s){const l=this.blocks_[this.currentBlockIndex_];this.searchText_=n.trim(),this.clearBlocks(),this.blocks_=this.getMatchingBlocks_(this.workspace_,this.searchText_,this.caseSensitive),this.highlightSearchGroup_(this.blocks_);let a=0;s&&(a=this.blocks_.indexOf(l),a=a>-1?a:0),this.setCurrentBlock_(a)}getSearchPool_(n){return n.getAllBlocks(!0).filter(l=>{const a=l.getSurroundParent();return!a||!a.isCollapsed()})}isBlockMatch_(n,s,l){let a="";if(n.isCollapsed())a=n.toString();else{const u=[];n.inputList.forEach(d=>{d.fieldRow.forEach(h=>{u.push(h.getText())})}),a=u.join(" ").trim()}return l||(a=a.toLowerCase()),a.indexOf(s)>-1}getMatchingBlocks_(n,s,l){return s?(this.caseSensitive||(s=s.toLowerCase()),this.getSearchPool_(n).filter(u=>this.isBlockMatch_(u,s,l))):[]}clearBlocks(){this.unhighlightSearchGroup_(this.blocks_);const n=this.blocks_[this.currentBlockIndex_];n&&this.unhighlightCurrentSelection_(n),this.currentBlockIndex_=-1,this.blocks_=[]}highlightCurrentSelection_(n){const s=n.pathObject.svgPath;Wo.utils.dom.addClass(s,"blockly-ws-search-current")}unhighlightCurrentSelection_(n){const s=n.pathObject.svgPath;Wo.utils.dom.removeClass(s,"blockly-ws-search-current")}highlightSearchGroup_(n){n.forEach(s=>{const l=s.pathObject.svgPath;Wo.utils.dom.addClass(l,"blockly-ws-search-highlight")})}unhighlightSearchGroup_(n){n.forEach(s=>{const l=s.pathObject.svgPath;Wo.utils.dom.removeClass(l,"blockly-ws-search-highlight")})}}const c2="项目",a2="未命名",u2="今天",d2="复制并粘贴",h2="添加注释",p2="删除注释",$2="复制注释",_2="多行输入",g2="单行输入",f2="删除块",m2="删除 %1 个块",T2="删除所有 %1 个块吗?",E2="整理块",b2="折叠块",v2="折叠块",I2="展开块",O2="展开块",C2="禁用块",y2="启用块",S2="帮助",R2="撤销",k2="重做",A2="更改值",L2="重命名变量...",N2="将所有“%1”变量重命名为",w2="创建变量",M2="创建字符串变量",D2="创建数字变量",P2="创建颜色变量",x2="新变量的类型:",B2="新变量的名称:",F2="名字叫“%1”的变量已经存在了。",U2="名字叫“%1”的变量已经有了另一个类型:“%2”。",H2="要删除对变量“%2”的%1个引用吗?",V2="不能删除变量“%1”,因为它是函数“%2”定义的一部分",G2="删除变量“%1”",W2="https://zh.wikipedia.org/wiki/颜色",z2="从调色板中选择一种颜色。",X2="随机颜色",j2="随机选择一种颜色。",Y2="颜色",K2="红色",Q2="绿色",q2="蓝色",J2="通过指定红色、绿色和蓝色的量创建一种颜色。所有的值必须在0和100之间。",Z2="混合",eO="颜色1",tO="颜色2",oO="比例",sO="把两种颜色以一个给定的比例(0.0-1.0)进行混合。",iO="https://zh.wikipedia.org/wiki/For循环",nO="循环 %1 次",rO="",lO="多次执行一些语句。",cO="循环 当满足",aO="循环 直到",uO="只要值为真,就一直循环执行一些语句。",dO="只要值为假,就一直循环执行一些语句。",hO="用变量%1记录从开始数值到终止数值之间的数值,数值按指定间隔增加,并执行指定的块。",pO="变量 %1 从 %2 数到 %3 步长为 %4",$O="变量 %1 遍历列表 %2",_O="遍历列表中的每一项,将变量“%1”设为所选项,并执行一些语句。",gO="退出循环",fO="直接进入下一轮循环",mO="跳出包含它的循环。",TO="跳过本轮循环的剩余部分,并继进行续下一轮循环。",EO="警告:这个块只能在循环内使用。",bO="如果值为真,执行一些语句。",vO="如果值为真,则执行第一块语句。否则,则执行第二块语句。",IO="如果第一个值为真,则执行第一块的语句。否则,如果第二个值为真,则执行第二块的语句。",OO="如果第一个值为真,则执行第一块对语句。否则,如果第二个值为真,则执行语句的第二块。如果没有值为真,则执行最后一块的语句。",CO="如果",yO="",SO="否则如果",RO="",kO="增加、删除或重新排列各节来重新配置这个if语句块。",AO="在这个if语句块中增加一个条件。",LO="在这个if语句块中添加一个最终的,包括所有其余情况的条件。",NO="https://zh.wikipedia.org/wiki/不等",wO="如果两个输入结果相等,则返回真。",MO="如果两个输入结果不相等,则返回真。",DO="如果第一个输入结果比第二个小,则返回真。",PO="如果第一个输入结果小于或等于第二个输入结果,则返回真。",xO="如果第一个输入结果比第二个大,则返回真。",BO="如果第一个输入结果大于或等于第二个输入结果,则返回真。",FO="如果两个输入结果都为真,则返回真。",UO="且",HO="如果至少有一个输入结果为真,则返回真。",VO="或",GO="%1 不成立",WO="如果输入结果为false,则返回true;如果输入结果为true,则返回false。",zO="成立",XO="不成立",jO="返回 true 或 false。",YO="空",KO="返回空值。",QO="https://zh.wikipedia.org/wiki/条件运算符",qO="条件",JO="成立则为",ZO="不成立则为",eC="检查“断言”里的条件语句。如果条件为真,则返回“如果为真”的值,否则,则返回“如果为假”的值。",tC="https://zh.wikipedia.org/wiki/数",oC="一个数值。",sC="sin",iC="cos",nC="tan",rC="asin",lC="acos",cC="atan",aC="https://zh.wikipedia.org/wiki/算术",uC="返回两个数值的和。",dC="返回两个数值的差。",hC="返回两个数值的乘积。",pC="返回两个数值的商。",$C="返回以第一个数值为底数,以第二个数值为幂的结果。",_C="https://zh.wikipedia.org/wiki/平方根",gC="算术平方根",fC="返回一个数的算术平方根。",mC="绝对值",TC="返回一个数值的绝对值。",EC="返回一个数值的相反数。",bC="返回一个数值的自然对数。",vC="返回一个数值的以10为底的对数。",IC="返回e的n次幂。",OC="返回10的n次幂。",CC="https://zh.wikipedia.org/wiki/三角函数",yC="返回指定角度的正弦值(非弧度)。",SC="返回指定角度的余弦值(非弧度)。",RC="返回指定角度的正切值(非弧度)。",kC="返回一个数值的反正弦值。",AC="返回一个数值的反余弦值。",LC="返回一个数值的反正切值。",NC="https://zh.wikipedia.org/wiki/数学常数",wC="返回一个常见常量:π (3.141…)、e (2.718…)、φ (1.618…)、根号2 (1.414…)、根号二分之一 (0.707…)或∞ (无穷大)。",MC="是偶数",DC="是奇数",PC="是质数",xC="是整数",BC="是正数",FC="是负数",UC="检查一个数值是否是偶数、奇数、质数、自然数、正数、负数或者是否能被某数整除。返回真或假。",HC="https://zh.wikipedia.org/wiki/加法",VC="将 %1 增加 %2",GC="为变量“%1”增加一个数值。",WC="https://zh.wikipedia.org/wiki/数值修约",zC="数字向上或向下舍入。",XC="四舍五入",jC="向上舍入",YC="向下舍入",KC="列表中数值的和",QC="返回列表中的所有数值的和。",qC="列表最小值",JC="返回列表中最小值。",ZC="列表最大值",e4="返回列表中最大值。",t4="列表平均值",o4="返回列表中的数值的平均值。",s4="列表中位数",i4="返回列表中数值的中位数。",n4="列表中的众数",r4="返回列表中的出现次数最多的项的列表。",l4="列表的标准差",c4="返回列表的标准差。",a4="列表中的随机一项",u4="从列表中返回一个随机的元素。",d4="https://zh.wikipedia.org/wiki/模除",h4="%1 ÷ %2 的余数",p4="返回这两个数字相除后的余数。",$4="将 %1 限制在 最低 %2 到最高 %3 之间",_4="将一个数值限制在两个指定的数值范围(含边界)之间。",g4="https://zh.wikipedia.org/wiki/随机数生成器",f4="随机整数 %1 到 %2",m4="返回一个限制在两个指定数值的范围(含边界)之间的随机整数。",T4="https://zh.wikipedia.org/wiki/随机数生成器",E4="随机小数",b4="返回一个从0.0(含)到1.0(不含)之间的随机数。",v4="https://zh.wikipedia.org/wiki/反正切2",I4="点(x:%1,y:%2)的方位角",O4="返回点(X,Y)的反正切值,范围为-180到180度。",C4="https://zh.wikipedia.org/wiki/字符串",y4="一个字、词语或一行文本。",S4="连接",R4="通过串起任意数量的项以建立一段文本。",k4="拼接",A4="添加、移除或重新排列各节来重新配置这个文本块。",L4="将一个项添加到文本中。",N4="在 %1 之后加上文本 %2 ",w4="将一些文本追加到变量“%1”里。",M4="%1 的字符数",D4="返回给定文本的字母数(包括空格)。",P4="%1 是空的",x4="如果给定的文本为空,则返回真。",B4="返回第一个文本段在第二个文本段中的第一/最后一个匹配项的起始位置。如果未找到,则返回%1。",F4="在 %1 中 %2 出现 %3 的位置",U4="首次",H4="最后",V4="用不同的大小写模式复制并返回这段文字。",G4="转为大写",W4="转为小写",z4="转为首字母大写",X4="从某一端或同时从两端删除多余的空白,并返回这段文字的一个副本。",j4="消除其两侧的空白",Y4="消除其左侧的空白",K4="消除其右侧的空白",Q4="输出 %1",q4="输出指定的文字、数字或其他值。",J4="要求输入文本,并显示提示消息",Z4="要求输入数字,并显示提示消息",ey="要求用户输入数字。",ty="要求用户输入一些文本。",oy="%1 在 %2 里出现的次数",sy="计算在一段文本中,某个部分文本重复出现了多少次。",iy="把 %3 中的 %1 替换为 %2",ny="在一段文本中,将出现过的某部分文本都替换掉。",ry="倒转文本%1",ly="将文本中各个字符的顺序倒转。",cy="创建空列表",ay="返回一个列表,长度为 0,不包含任何数据记录",uy="建立一个具有任意数量项目的列表。",dy="创建列表,内容:",hy="列表",py="增加、删除或重新排列各部分以此重新配置这个列表块。",$y="将一个项添加到列表中。",_y="建立包含指定重复次数的值的列表。",gy="建立列表使用项 %1 重复 %2 次",fy="%1 的长度",my="返回列表的长度。",Ty="%1 是空的",Ey="如果改列表为空,则返回真。",by="在列表中",vy="寻找第一次出现的项",Iy="寻找最后一次出现的项",Oy="排序%1 %2 %3",Cy="排序一个列表,返回副本。",yy="升序",Sy="降序",Ry="按数字",ky="按字母",Ay="按字母(忽略大小写)",Ly="倒转%1",Ny="倒转一个列表,返回副本。",wy="返回此变量的值。",My="创建“设定%1”",Dy="设置 %1 的值为 %2",Py="设置此变量,以使它和输入值相等。",xy="创建“获得%1”",By="https://zh.wikipedia.org/wiki/子程序",Fy="定义函数",Uy="定义函数",Hy="做点什么",Vy="做点什么",Gy="",Wy="",zy="形参",Xy="创建一个不带输出值的函数。",jy="描述该功能...",Yy="https://zh.wikipedia.org/wiki/子程序",Ky="返回",Qy="创建一个有输出值的函数。",qy="允许声明",Jy="警告:此函数具有重复参数。",Zy="https://zh.wikipedia.org/wiki/子程序",eS="运行用户定义的函数“%1”。",tS="https://zh.wikipedia.org/wiki/子程序",oS="运行用户定义的函数“%1”,并使用它的输出值。",sS="输入",iS="添加、移除或重新排此函数的输入。",nS="输入名称:",rS="添加函数输入。",lS="突出显示函数定义",cS="创建“%1”",aS="如果值为真,则返回第二个值。",uS="警告:这个块只能在函数内部使用。",dS="说点什么...",hS="Blockly工作区",pS="已收起的信息块内包含警告。",$S="确认",_S="取消",k7={VARIABLES_DEFAULT_NAME:c2,UNNAMED_KEY:a2,TODAY:u2,DUPLICATE_BLOCK:d2,ADD_COMMENT:h2,REMOVE_COMMENT:p2,DUPLICATE_COMMENT:$2,EXTERNAL_INPUTS:_2,INLINE_INPUTS:g2,DELETE_BLOCK:f2,DELETE_X_BLOCKS:m2,DELETE_ALL_BLOCKS:T2,CLEAN_UP:E2,COLLAPSE_BLOCK:b2,COLLAPSE_ALL:v2,EXPAND_BLOCK:I2,EXPAND_ALL:O2,DISABLE_BLOCK:C2,ENABLE_BLOCK:y2,HELP:S2,UNDO:R2,REDO:k2,CHANGE_VALUE_TITLE:A2,RENAME_VARIABLE:L2,RENAME_VARIABLE_TITLE:N2,NEW_VARIABLE:w2,NEW_STRING_VARIABLE:M2,NEW_NUMBER_VARIABLE:D2,NEW_COLOUR_VARIABLE:P2,NEW_VARIABLE_TYPE_TITLE:x2,NEW_VARIABLE_TITLE:B2,VARIABLE_ALREADY_EXISTS:F2,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:U2,DELETE_VARIABLE_CONFIRMATION:H2,CANNOT_DELETE_VARIABLE_PROCEDURE:V2,DELETE_VARIABLE:G2,COLOUR_PICKER_HELPURL:W2,COLOUR_PICKER_TOOLTIP:z2,COLOUR_RANDOM_TITLE:X2,COLOUR_RANDOM_TOOLTIP:j2,COLOUR_RGB_TITLE:Y2,COLOUR_RGB_RED:K2,COLOUR_RGB_GREEN:Q2,COLOUR_RGB_BLUE:q2,COLOUR_RGB_TOOLTIP:J2,COLOUR_BLEND_TITLE:Z2,COLOUR_BLEND_COLOUR1:eO,COLOUR_BLEND_COLOUR2:tO,COLOUR_BLEND_RATIO:oO,COLOUR_BLEND_TOOLTIP:sO,CONTROLS_REPEAT_HELPURL:iO,CONTROLS_REPEAT_TITLE:nO,CONTROLS_REPEAT_INPUT_DO:rO,CONTROLS_REPEAT_TOOLTIP:lO,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:cO,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:aO,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:uO,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:dO,CONTROLS_FOR_TOOLTIP:hO,CONTROLS_FOR_TITLE:pO,CONTROLS_FOREACH_TITLE:$O,CONTROLS_FOREACH_TOOLTIP:_O,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:gO,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:fO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:mO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:TO,CONTROLS_FLOW_STATEMENTS_WARNING:EO,CONTROLS_IF_TOOLTIP_1:bO,CONTROLS_IF_TOOLTIP_2:vO,CONTROLS_IF_TOOLTIP_3:IO,CONTROLS_IF_TOOLTIP_4:OO,CONTROLS_IF_MSG_IF:CO,CONTROLS_IF_MSG_THEN:yO,CONTROLS_IF_MSG_ELSEIF:SO,CONTROLS_IF_MSG_ELSE:RO,CONTROLS_IF_IF_TOOLTIP:kO,CONTROLS_IF_ELSEIF_TOOLTIP:AO,CONTROLS_IF_ELSE_TOOLTIP:LO,LOGIC_COMPARE_HELPURL:NO,LOGIC_COMPARE_TOOLTIP_EQ:wO,LOGIC_COMPARE_TOOLTIP_NEQ:MO,LOGIC_COMPARE_TOOLTIP_LT:DO,LOGIC_COMPARE_TOOLTIP_LTE:PO,LOGIC_COMPARE_TOOLTIP_GT:xO,LOGIC_COMPARE_TOOLTIP_GTE:BO,LOGIC_OPERATION_TOOLTIP_AND:FO,LOGIC_OPERATION_AND:UO,LOGIC_OPERATION_TOOLTIP_OR:HO,LOGIC_OPERATION_OR:VO,LOGIC_NEGATE_TITLE:GO,LOGIC_NEGATE_TOOLTIP:WO,LOGIC_BOOLEAN_TRUE:zO,LOGIC_BOOLEAN_FALSE:XO,LOGIC_BOOLEAN_TOOLTIP:jO,LOGIC_NULL:YO,LOGIC_NULL_TOOLTIP:KO,LOGIC_TERNARY_HELPURL:QO,LOGIC_TERNARY_CONDITION:qO,LOGIC_TERNARY_IF_TRUE:JO,LOGIC_TERNARY_IF_FALSE:ZO,LOGIC_TERNARY_TOOLTIP:eC,MATH_NUMBER_HELPURL:tC,MATH_NUMBER_TOOLTIP:oC,MATH_TRIG_SIN:sC,MATH_TRIG_COS:iC,MATH_TRIG_TAN:nC,MATH_TRIG_ASIN:rC,MATH_TRIG_ACOS:lC,MATH_TRIG_ATAN:cC,MATH_ARITHMETIC_HELPURL:aC,MATH_ARITHMETIC_TOOLTIP_ADD:uC,MATH_ARITHMETIC_TOOLTIP_MINUS:dC,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:hC,MATH_ARITHMETIC_TOOLTIP_DIVIDE:pC,MATH_ARITHMETIC_TOOLTIP_POWER:$C,MATH_SINGLE_HELPURL:_C,MATH_SINGLE_OP_ROOT:gC,MATH_SINGLE_TOOLTIP_ROOT:fC,MATH_SINGLE_OP_ABSOLUTE:mC,MATH_SINGLE_TOOLTIP_ABS:TC,MATH_SINGLE_TOOLTIP_NEG:EC,MATH_SINGLE_TOOLTIP_LN:bC,MATH_SINGLE_TOOLTIP_LOG10:vC,MATH_SINGLE_TOOLTIP_EXP:IC,MATH_SINGLE_TOOLTIP_POW10:OC,MATH_TRIG_HELPURL:CC,MATH_TRIG_TOOLTIP_SIN:yC,MATH_TRIG_TOOLTIP_COS:SC,MATH_TRIG_TOOLTIP_TAN:RC,MATH_TRIG_TOOLTIP_ASIN:kC,MATH_TRIG_TOOLTIP_ACOS:AC,MATH_TRIG_TOOLTIP_ATAN:LC,MATH_CONSTANT_HELPURL:NC,MATH_CONSTANT_TOOLTIP:wC,MATH_IS_EVEN:MC,MATH_IS_ODD:DC,MATH_IS_PRIME:PC,MATH_IS_WHOLE:xC,MATH_IS_POSITIVE:BC,MATH_IS_NEGATIVE:FC,MATH_IS_TOOLTIP:UC,MATH_CHANGE_HELPURL:HC,MATH_CHANGE_TITLE:VC,MATH_CHANGE_TOOLTIP:GC,MATH_ROUND_HELPURL:WC,MATH_ROUND_TOOLTIP:zC,MATH_ROUND_OPERATOR_ROUND:XC,MATH_ROUND_OPERATOR_ROUNDUP:jC,MATH_ROUND_OPERATOR_ROUNDDOWN:YC,MATH_ONLIST_OPERATOR_SUM:KC,MATH_ONLIST_TOOLTIP_SUM:QC,MATH_ONLIST_OPERATOR_MIN:qC,MATH_ONLIST_TOOLTIP_MIN:JC,MATH_ONLIST_OPERATOR_MAX:ZC,MATH_ONLIST_TOOLTIP_MAX:e4,MATH_ONLIST_OPERATOR_AVERAGE:t4,MATH_ONLIST_TOOLTIP_AVERAGE:o4,MATH_ONLIST_OPERATOR_MEDIAN:s4,MATH_ONLIST_TOOLTIP_MEDIAN:i4,MATH_ONLIST_OPERATOR_MODE:n4,MATH_ONLIST_TOOLTIP_MODE:r4,MATH_ONLIST_OPERATOR_STD_DEV:l4,MATH_ONLIST_TOOLTIP_STD_DEV:c4,MATH_ONLIST_OPERATOR_RANDOM:a4,MATH_ONLIST_TOOLTIP_RANDOM:u4,MATH_MODULO_HELPURL:d4,MATH_MODULO_TITLE:h4,MATH_MODULO_TOOLTIP:p4,MATH_CONSTRAIN_TITLE:$4,MATH_CONSTRAIN_TOOLTIP:_4,MATH_RANDOM_INT_HELPURL:g4,MATH_RANDOM_INT_TITLE:f4,MATH_RANDOM_INT_TOOLTIP:m4,MATH_RANDOM_FLOAT_HELPURL:T4,MATH_RANDOM_FLOAT_TITLE_RANDOM:E4,MATH_RANDOM_FLOAT_TOOLTIP:b4,MATH_ATAN2_HELPURL:v4,MATH_ATAN2_TITLE:I4,MATH_ATAN2_TOOLTIP:O4,TEXT_TEXT_HELPURL:C4,TEXT_TEXT_TOOLTIP:y4,TEXT_JOIN_TITLE_CREATEWITH:S4,TEXT_JOIN_TOOLTIP:R4,TEXT_CREATE_JOIN_TITLE_JOIN:k4,TEXT_CREATE_JOIN_TOOLTIP:A4,TEXT_CREATE_JOIN_ITEM_TOOLTIP:L4,TEXT_APPEND_TITLE:N4,TEXT_APPEND_TOOLTIP:w4,TEXT_LENGTH_TITLE:M4,TEXT_LENGTH_TOOLTIP:D4,TEXT_ISEMPTY_TITLE:P4,TEXT_ISEMPTY_TOOLTIP:x4,TEXT_INDEXOF_TOOLTIP:B4,TEXT_INDEXOF_TITLE:F4,TEXT_INDEXOF_OPERATOR_FIRST:U4,TEXT_INDEXOF_OPERATOR_LAST:H4,TEXT_CHANGECASE_TOOLTIP:V4,TEXT_CHANGECASE_OPERATOR_UPPERCASE:G4,TEXT_CHANGECASE_OPERATOR_LOWERCASE:W4,TEXT_CHANGECASE_OPERATOR_TITLECASE:z4,TEXT_TRIM_TOOLTIP:X4,TEXT_TRIM_OPERATOR_BOTH:j4,TEXT_TRIM_OPERATOR_LEFT:Y4,TEXT_TRIM_OPERATOR_RIGHT:K4,TEXT_PRINT_TITLE:Q4,TEXT_PRINT_TOOLTIP:q4,TEXT_PROMPT_TYPE_TEXT:J4,TEXT_PROMPT_TYPE_NUMBER:Z4,TEXT_PROMPT_TOOLTIP_NUMBER:ey,TEXT_PROMPT_TOOLTIP_TEXT:ty,TEXT_COUNT_MESSAGE0:oy,TEXT_COUNT_TOOLTIP:sy,TEXT_REPLACE_MESSAGE0:iy,TEXT_REPLACE_TOOLTIP:ny,TEXT_REVERSE_MESSAGE0:ry,TEXT_REVERSE_TOOLTIP:ly,LISTS_CREATE_EMPTY_TITLE:cy,LISTS_CREATE_EMPTY_TOOLTIP:ay,LISTS_CREATE_WITH_TOOLTIP:uy,LISTS_CREATE_WITH_INPUT_WITH:dy,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:hy,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:py,LISTS_CREATE_WITH_ITEM_TOOLTIP:$y,LISTS_REPEAT_TOOLTIP:_y,LISTS_REPEAT_TITLE:gy,LISTS_LENGTH_TITLE:fy,LISTS_LENGTH_TOOLTIP:my,LISTS_ISEMPTY_TITLE:Ty,LISTS_ISEMPTY_TOOLTIP:Ey,LISTS_INLIST:by,LISTS_INDEX_OF_FIRST:vy,LISTS_INDEX_OF_LAST:Iy,LISTS_SORT_TITLE:Oy,LISTS_SORT_TOOLTIP:Cy,LISTS_SORT_ORDER_ASCENDING:yy,LISTS_SORT_ORDER_DESCENDING:Sy,LISTS_SORT_TYPE_NUMERIC:Ry,LISTS_SORT_TYPE_TEXT:ky,LISTS_SORT_TYPE_IGNORECASE:Ay,LISTS_REVERSE_MESSAGE0:Ly,LISTS_REVERSE_TOOLTIP:Ny,VARIABLES_GET_TOOLTIP:wy,VARIABLES_GET_CREATE_SET:My,VARIABLES_SET:Dy,VARIABLES_SET_TOOLTIP:Py,VARIABLES_SET_CREATE_GET:xy,PROCEDURES_DEFNORETURN_HELPURL:By,PROCEDURES_DEFNORETURN_TITLE:Fy,PROCEDURES_DEFRETURN_TITLE:Uy,PROCEDURES_DEFNORETURN_PROCEDURE:Hy,PROCEDURES_DEFRETURN_PROCEDURE:Vy,PROCEDURES_BEFORE_PARAMS:Gy,PROCEDURES_CALL_BEFORE_PARAMS:Wy,PROCEDURE_VARIABLE:zy,PROCEDURES_DEFNORETURN_TOOLTIP:Xy,PROCEDURES_DEFNORETURN_COMMENT:jy,PROCEDURES_DEFRETURN_HELPURL:Yy,PROCEDURES_DEFRETURN_RETURN:Ky,PROCEDURES_DEFRETURN_TOOLTIP:Qy,PROCEDURES_ALLOW_STATEMENTS:qy,PROCEDURES_DEF_DUPLICATE_WARNING:Jy,PROCEDURES_CALLNORETURN_HELPURL:Zy,PROCEDURES_CALLNORETURN_TOOLTIP:eS,PROCEDURES_CALLRETURN_HELPURL:tS,PROCEDURES_CALLRETURN_TOOLTIP:oS,PROCEDURES_MUTATORCONTAINER_TITLE:sS,PROCEDURES_MUTATORCONTAINER_TOOLTIP:iS,PROCEDURES_MUTATORARG_TITLE:nS,PROCEDURES_MUTATORARG_TOOLTIP:rS,PROCEDURES_HIGHLIGHT_DEF:lS,PROCEDURES_CREATE_DO:cS,PROCEDURES_IFRETURN_TOOLTIP:aS,PROCEDURES_IFRETURN_WARNING:uS,WORKSPACE_COMMENT_DEFAULT_TEXT:dS,WORKSPACE_ARIA_LABEL:hS,COLLAPSED_WARNINGS_WARNING:pS,DIALOG_OK:$S,DIALOG_CANCEL:_S},A7=Object.freeze(Object.defineProperty({__proto__:null,ADD_COMMENT:h2,CANNOT_DELETE_VARIABLE_PROCEDURE:V2,CHANGE_VALUE_TITLE:A2,CLEAN_UP:E2,COLLAPSED_WARNINGS_WARNING:pS,COLLAPSE_ALL:v2,COLLAPSE_BLOCK:b2,COLOUR_BLEND_COLOUR1:eO,COLOUR_BLEND_COLOUR2:tO,COLOUR_BLEND_RATIO:oO,COLOUR_BLEND_TITLE:Z2,COLOUR_BLEND_TOOLTIP:sO,COLOUR_PICKER_HELPURL:W2,COLOUR_PICKER_TOOLTIP:z2,COLOUR_RANDOM_TITLE:X2,COLOUR_RANDOM_TOOLTIP:j2,COLOUR_RGB_BLUE:q2,COLOUR_RGB_GREEN:Q2,COLOUR_RGB_RED:K2,COLOUR_RGB_TITLE:Y2,COLOUR_RGB_TOOLTIP:J2,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:gO,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:fO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:mO,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:TO,CONTROLS_FLOW_STATEMENTS_WARNING:EO,CONTROLS_FOREACH_TITLE:$O,CONTROLS_FOREACH_TOOLTIP:_O,CONTROLS_FOR_TITLE:pO,CONTROLS_FOR_TOOLTIP:hO,CONTROLS_IF_ELSEIF_TOOLTIP:AO,CONTROLS_IF_ELSE_TOOLTIP:LO,CONTROLS_IF_IF_TOOLTIP:kO,CONTROLS_IF_MSG_ELSE:RO,CONTROLS_IF_MSG_ELSEIF:SO,CONTROLS_IF_MSG_IF:CO,CONTROLS_IF_MSG_THEN:yO,CONTROLS_IF_TOOLTIP_1:bO,CONTROLS_IF_TOOLTIP_2:vO,CONTROLS_IF_TOOLTIP_3:IO,CONTROLS_IF_TOOLTIP_4:OO,CONTROLS_REPEAT_HELPURL:iO,CONTROLS_REPEAT_INPUT_DO:rO,CONTROLS_REPEAT_TITLE:nO,CONTROLS_REPEAT_TOOLTIP:lO,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:aO,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:cO,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:dO,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:uO,DELETE_ALL_BLOCKS:T2,DELETE_BLOCK:f2,DELETE_VARIABLE:G2,DELETE_VARIABLE_CONFIRMATION:H2,DELETE_X_BLOCKS:m2,DIALOG_CANCEL:_S,DIALOG_OK:$S,DISABLE_BLOCK:C2,DUPLICATE_BLOCK:d2,DUPLICATE_COMMENT:$2,ENABLE_BLOCK:y2,EXPAND_ALL:O2,EXPAND_BLOCK:I2,EXTERNAL_INPUTS:_2,HELP:S2,INLINE_INPUTS:g2,LISTS_CREATE_EMPTY_TITLE:cy,LISTS_CREATE_EMPTY_TOOLTIP:ay,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:hy,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:py,LISTS_CREATE_WITH_INPUT_WITH:dy,LISTS_CREATE_WITH_ITEM_TOOLTIP:$y,LISTS_CREATE_WITH_TOOLTIP:uy,LISTS_INDEX_OF_FIRST:vy,LISTS_INDEX_OF_LAST:Iy,LISTS_INLIST:by,LISTS_ISEMPTY_TITLE:Ty,LISTS_ISEMPTY_TOOLTIP:Ey,LISTS_LENGTH_TITLE:fy,LISTS_LENGTH_TOOLTIP:my,LISTS_REPEAT_TITLE:gy,LISTS_REPEAT_TOOLTIP:_y,LISTS_REVERSE_MESSAGE0:Ly,LISTS_REVERSE_TOOLTIP:Ny,LISTS_SORT_ORDER_ASCENDING:yy,LISTS_SORT_ORDER_DESCENDING:Sy,LISTS_SORT_TITLE:Oy,LISTS_SORT_TOOLTIP:Cy,LISTS_SORT_TYPE_IGNORECASE:Ay,LISTS_SORT_TYPE_NUMERIC:Ry,LISTS_SORT_TYPE_TEXT:ky,LOGIC_BOOLEAN_FALSE:XO,LOGIC_BOOLEAN_TOOLTIP:jO,LOGIC_BOOLEAN_TRUE:zO,LOGIC_COMPARE_HELPURL:NO,LOGIC_COMPARE_TOOLTIP_EQ:wO,LOGIC_COMPARE_TOOLTIP_GT:xO,LOGIC_COMPARE_TOOLTIP_GTE:BO,LOGIC_COMPARE_TOOLTIP_LT:DO,LOGIC_COMPARE_TOOLTIP_LTE:PO,LOGIC_COMPARE_TOOLTIP_NEQ:MO,LOGIC_NEGATE_TITLE:GO,LOGIC_NEGATE_TOOLTIP:WO,LOGIC_NULL:YO,LOGIC_NULL_TOOLTIP:KO,LOGIC_OPERATION_AND:UO,LOGIC_OPERATION_OR:VO,LOGIC_OPERATION_TOOLTIP_AND:FO,LOGIC_OPERATION_TOOLTIP_OR:HO,LOGIC_TERNARY_CONDITION:qO,LOGIC_TERNARY_HELPURL:QO,LOGIC_TERNARY_IF_FALSE:ZO,LOGIC_TERNARY_IF_TRUE:JO,LOGIC_TERNARY_TOOLTIP:eC,MATH_ARITHMETIC_HELPURL:aC,MATH_ARITHMETIC_TOOLTIP_ADD:uC,MATH_ARITHMETIC_TOOLTIP_DIVIDE:pC,MATH_ARITHMETIC_TOOLTIP_MINUS:dC,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:hC,MATH_ARITHMETIC_TOOLTIP_POWER:$C,MATH_ATAN2_HELPURL:v4,MATH_ATAN2_TITLE:I4,MATH_ATAN2_TOOLTIP:O4,MATH_CHANGE_HELPURL:HC,MATH_CHANGE_TITLE:VC,MATH_CHANGE_TOOLTIP:GC,MATH_CONSTANT_HELPURL:NC,MATH_CONSTANT_TOOLTIP:wC,MATH_CONSTRAIN_TITLE:$4,MATH_CONSTRAIN_TOOLTIP:_4,MATH_IS_EVEN:MC,MATH_IS_NEGATIVE:FC,MATH_IS_ODD:DC,MATH_IS_POSITIVE:BC,MATH_IS_PRIME:PC,MATH_IS_TOOLTIP:UC,MATH_IS_WHOLE:xC,MATH_MODULO_HELPURL:d4,MATH_MODULO_TITLE:h4,MATH_MODULO_TOOLTIP:p4,MATH_NUMBER_HELPURL:tC,MATH_NUMBER_TOOLTIP:oC,MATH_ONLIST_OPERATOR_AVERAGE:t4,MATH_ONLIST_OPERATOR_MAX:ZC,MATH_ONLIST_OPERATOR_MEDIAN:s4,MATH_ONLIST_OPERATOR_MIN:qC,MATH_ONLIST_OPERATOR_MODE:n4,MATH_ONLIST_OPERATOR_RANDOM:a4,MATH_ONLIST_OPERATOR_STD_DEV:l4,MATH_ONLIST_OPERATOR_SUM:KC,MATH_ONLIST_TOOLTIP_AVERAGE:o4,MATH_ONLIST_TOOLTIP_MAX:e4,MATH_ONLIST_TOOLTIP_MEDIAN:i4,MATH_ONLIST_TOOLTIP_MIN:JC,MATH_ONLIST_TOOLTIP_MODE:r4,MATH_ONLIST_TOOLTIP_RANDOM:u4,MATH_ONLIST_TOOLTIP_STD_DEV:c4,MATH_ONLIST_TOOLTIP_SUM:QC,MATH_RANDOM_FLOAT_HELPURL:T4,MATH_RANDOM_FLOAT_TITLE_RANDOM:E4,MATH_RANDOM_FLOAT_TOOLTIP:b4,MATH_RANDOM_INT_HELPURL:g4,MATH_RANDOM_INT_TITLE:f4,MATH_RANDOM_INT_TOOLTIP:m4,MATH_ROUND_HELPURL:WC,MATH_ROUND_OPERATOR_ROUND:XC,MATH_ROUND_OPERATOR_ROUNDDOWN:YC,MATH_ROUND_OPERATOR_ROUNDUP:jC,MATH_ROUND_TOOLTIP:zC,MATH_SINGLE_HELPURL:_C,MATH_SINGLE_OP_ABSOLUTE:mC,MATH_SINGLE_OP_ROOT:gC,MATH_SINGLE_TOOLTIP_ABS:TC,MATH_SINGLE_TOOLTIP_EXP:IC,MATH_SINGLE_TOOLTIP_LN:bC,MATH_SINGLE_TOOLTIP_LOG10:vC,MATH_SINGLE_TOOLTIP_NEG:EC,MATH_SINGLE_TOOLTIP_POW10:OC,MATH_SINGLE_TOOLTIP_ROOT:fC,MATH_TRIG_ACOS:lC,MATH_TRIG_ASIN:rC,MATH_TRIG_ATAN:cC,MATH_TRIG_COS:iC,MATH_TRIG_HELPURL:CC,MATH_TRIG_SIN:sC,MATH_TRIG_TAN:nC,MATH_TRIG_TOOLTIP_ACOS:AC,MATH_TRIG_TOOLTIP_ASIN:kC,MATH_TRIG_TOOLTIP_ATAN:LC,MATH_TRIG_TOOLTIP_COS:SC,MATH_TRIG_TOOLTIP_SIN:yC,MATH_TRIG_TOOLTIP_TAN:RC,NEW_COLOUR_VARIABLE:P2,NEW_NUMBER_VARIABLE:D2,NEW_STRING_VARIABLE:M2,NEW_VARIABLE:w2,NEW_VARIABLE_TITLE:B2,NEW_VARIABLE_TYPE_TITLE:x2,PROCEDURES_ALLOW_STATEMENTS:qy,PROCEDURES_BEFORE_PARAMS:Gy,PROCEDURES_CALLNORETURN_HELPURL:Zy,PROCEDURES_CALLNORETURN_TOOLTIP:eS,PROCEDURES_CALLRETURN_HELPURL:tS,PROCEDURES_CALLRETURN_TOOLTIP:oS,PROCEDURES_CALL_BEFORE_PARAMS:Wy,PROCEDURES_CREATE_DO:cS,PROCEDURES_DEFNORETURN_COMMENT:jy,PROCEDURES_DEFNORETURN_HELPURL:By,PROCEDURES_DEFNORETURN_PROCEDURE:Hy,PROCEDURES_DEFNORETURN_TITLE:Fy,PROCEDURES_DEFNORETURN_TOOLTIP:Xy,PROCEDURES_DEFRETURN_HELPURL:Yy,PROCEDURES_DEFRETURN_PROCEDURE:Vy,PROCEDURES_DEFRETURN_RETURN:Ky,PROCEDURES_DEFRETURN_TITLE:Uy,PROCEDURES_DEFRETURN_TOOLTIP:Qy,PROCEDURES_DEF_DUPLICATE_WARNING:Jy,PROCEDURES_HIGHLIGHT_DEF:lS,PROCEDURES_IFRETURN_TOOLTIP:aS,PROCEDURES_IFRETURN_WARNING:uS,PROCEDURES_MUTATORARG_TITLE:nS,PROCEDURES_MUTATORARG_TOOLTIP:rS,PROCEDURES_MUTATORCONTAINER_TITLE:sS,PROCEDURES_MUTATORCONTAINER_TOOLTIP:iS,PROCEDURE_VARIABLE:zy,REDO:k2,REMOVE_COMMENT:p2,RENAME_VARIABLE:L2,RENAME_VARIABLE_TITLE:N2,TEXT_APPEND_TITLE:N4,TEXT_APPEND_TOOLTIP:w4,TEXT_CHANGECASE_OPERATOR_LOWERCASE:W4,TEXT_CHANGECASE_OPERATOR_TITLECASE:z4,TEXT_CHANGECASE_OPERATOR_UPPERCASE:G4,TEXT_CHANGECASE_TOOLTIP:V4,TEXT_COUNT_MESSAGE0:oy,TEXT_COUNT_TOOLTIP:sy,TEXT_CREATE_JOIN_ITEM_TOOLTIP:L4,TEXT_CREATE_JOIN_TITLE_JOIN:k4,TEXT_CREATE_JOIN_TOOLTIP:A4,TEXT_INDEXOF_OPERATOR_FIRST:U4,TEXT_INDEXOF_OPERATOR_LAST:H4,TEXT_INDEXOF_TITLE:F4,TEXT_INDEXOF_TOOLTIP:B4,TEXT_ISEMPTY_TITLE:P4,TEXT_ISEMPTY_TOOLTIP:x4,TEXT_JOIN_TITLE_CREATEWITH:S4,TEXT_JOIN_TOOLTIP:R4,TEXT_LENGTH_TITLE:M4,TEXT_LENGTH_TOOLTIP:D4,TEXT_PRINT_TITLE:Q4,TEXT_PRINT_TOOLTIP:q4,TEXT_PROMPT_TOOLTIP_NUMBER:ey,TEXT_PROMPT_TOOLTIP_TEXT:ty,TEXT_PROMPT_TYPE_NUMBER:Z4,TEXT_PROMPT_TYPE_TEXT:J4,TEXT_REPLACE_MESSAGE0:iy,TEXT_REPLACE_TOOLTIP:ny,TEXT_REVERSE_MESSAGE0:ry,TEXT_REVERSE_TOOLTIP:ly,TEXT_TEXT_HELPURL:C4,TEXT_TEXT_TOOLTIP:y4,TEXT_TRIM_OPERATOR_BOTH:j4,TEXT_TRIM_OPERATOR_LEFT:Y4,TEXT_TRIM_OPERATOR_RIGHT:K4,TEXT_TRIM_TOOLTIP:X4,TODAY:u2,UNDO:R2,UNNAMED_KEY:a2,VARIABLES_DEFAULT_NAME:c2,VARIABLES_GET_CREATE_SET:My,VARIABLES_GET_TOOLTIP:wy,VARIABLES_SET:Dy,VARIABLES_SET_CREATE_GET:xy,VARIABLES_SET_TOOLTIP:Py,VARIABLE_ALREADY_EXISTS:F2,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:U2,WORKSPACE_ARIA_LABEL:hS,WORKSPACE_COMMENT_DEFAULT_TEXT:dS,default:k7},Symbol.toStringTag,{value:"Module"}));const L7={__name:"Workspace",setup(o){Tt.setLocale(A7),Tt.Scrollbar.scrollbarThickness=15,Tt.FlyoutButton.BORDER_RADIUS=4,Tt.FlyoutButton.TEXT_MARGIN_X=10,Tt.FlyoutButton.TEXT_MARGIN_Y=10,tn("lists_create_with","list"),tn("procedures_defnoreturn","function"),tn("procedures_defreturn","function"),tn("procedures_ifreturn","function"),tn("procedures_callnoreturn","function"),tn("procedures_callreturn","function"),tn("time_current","time");const n=ge(),s=lr(),l={toolbox:t2,media:"/media",trashcan:!1,zoom:{controls:!0,wheel:!0,startScale:.8,maxScale:1.4,minScale:.5},move:{scrollbars:!0,drag:!0,wheel:!0},theme:"codemao",renderer:"codemao"};return zt(()=>{s.$patch(a=>{a.workspaceSvg=Tt.inject(n.value,l),a.searchPlugin=new R7(s.workspaceSvg)}),s.searchPlugin.setSearchPlaceholder("搜索作品中的积木"),s.searchPlugin.init()}),(a,u)=>(me(),Fe("div",{class:"blocklyDiv",ref_key:"blocklyDiv",ref:n},null,512))}};const N7={id:"zoombox"},w7={__name:"Zoombox",setup(o){const n=ge(),s=lr();function l(){s.workspaceSvg.cleanUp()}function a(){s.hasLayoutSider=!s.hasLayoutSider}function u(){let p=s.workspaceSvg.options.zoomOptions.scaleSpeed,f=s.workspaceSvg.scale;s.workspaceSvg.zoom(0,0,Math.log((f-.15)/f)/Math.log(p))}function d(){document.getElementsByClassName("blocklyZoom")[2].dispatchEvent(new PointerEvent("pointerdown"))}function h(){let p=s.workspaceSvg.options.zoomOptions.scaleSpeed,f=s.workspaceSvg.scale;s.workspaceSvg.zoom(0,0,Math.log((f+.15)/f)/Math.log(p))}return zt(()=>{s.workspaceSvg.addChangeListener(()=>{n.value.innerHTML=Math.floor((s.workspaceSvg.scale*(5/3)-1/3)*100)+"%"})}),(p,f)=>{const T=Vc,C=D0,S=Og;return me(),Fe("div",N7,[Q(S,null,{default:De(()=>[Q(C,{content:"整理",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:l,"aria-label":"整理"},{icon:De(()=>[Q(Xo(pD))]),_:1})]),_:1})]),_:1}),Q(S,null,{default:De(()=>[Q(C,{content:"代码区",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:a,"aria-label":"代码区"},{icon:De(()=>[Q(Xo(I8))]),_:1})]),_:1})]),_:1}),Q(S,null,{default:De(()=>[Q(C,{content:"缩小",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:u,"aria-label":"缩小"},{icon:De(()=>[Q(Xo(P8))]),_:1})]),_:1}),Q(C,{content:"恢复为100%",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:d,"aria-label":"恢复为100%"},{default:De(()=>[Le("span",{ref_key:"scale",ref:n},"100%",512)]),_:1})]),_:1}),Q(C,{content:"放大",position:"top",mini:""},{default:De(()=>[Q(T,{type:"text",onClick:h,"aria-label":"放大"},{icon:De(()=>[Q(Xo(k8))]),_:1})]),_:1})]),_:1})])}}};const M7={__name:"App",setup(o){let n;const s=ge(),l=lr();function a(){for(let d=0;d<5;d++)setTimeout(()=>{Tt.svgResize(l.workspaceSvg)},100*d)}function u(d=!1){s.value.$el.style.display=d?"block":"none",a()}return zt(()=>{Et(l.$state,d=>{d.hasLayoutSider!==n&&(u(d.hasLayoutSider),n=d.hasLayoutSider)},{deep:!0}),a(),u()}),(d,h)=>{const p=Du,f=Pu,T=CM;return me(),Fe(Wt,null,[Q(T,null,{default:De(()=>[Q(p,null,{default:De(()=>[Q(L7),Q(u7),Q(m7),Q(w7)]),_:1}),Q(f,{ref_key:"layoutSider",ref:s,"resize-directions":["left"],onMoving:a,onMovingEnd:a},{default:De(()=>[Q(kD)]),_:1},512)]),_:1}),Q(l7),Q(b7),Q(c7),Q(AD)],64)}}};yc.registerLanguage("javascript",x5);yc.registerLanguage("python",B5);const kg=V3(M7),D7=U5();kg.use(N5);kg.use(D7);kg.mount("#app");if("serviceWorker"in navigator){const o=Q5({onNeedRefresh(){dn.confirm({title:"注意",content:"当前版本有更新,请问是否立即更新。",okText:"确认",onOk:()=>{o(!0)},onCancel:!1,hideCancel:!1})}})} diff --git a/dist/assets/index-8f79ef64.js.gz b/dist/assets/index-8f79ef64.js.gz new file mode 100644 index 0000000000000000000000000000000000000000..c13279a056bed76e69aaa69745a76382ef2e4f2a Binary files /dev/null and b/dist/assets/index-8f79ef64.js.gz differ diff --git a/dist/index.html b/dist/index.html index 32315cdb09973a77b60f3ac1f25b9281772f335f..06acd44badfb085cec63131bad61e37c2e454492 100644 --- a/dist/index.html +++ b/dist/index.html @@ -11,7 +11,7 @@ Boxy - + diff --git a/dist/sw.js b/dist/sw.js index 549ba866a0c4635caf4b5221d045426d9ad2dfe6..d18a71f91180a5552364204ca07469961c345f72 100644 --- a/dist/sw.js +++ b/dist/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const n=(n,i)=>(n=new URL(n+".js",i).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(i,t)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let r={};const l=e=>n(e,o),c={module:{uri:o},exports:r,require:l};s[o]=Promise.all(i.map((e=>c[e]||l(e)))).then((e=>(t(...e),r)))}}define(["./workbox-bf1ed05b"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-5971f7e7.js",revision:null},{url:"assets/index-825ada8c.css",revision:null},{url:"assets/workbox-window.prod.es5-a7b12eab.js",revision:null},{url:"index.html",revision:"efee571707edee3c13112fe6435e513e"},{url:"manifest.webmanifest",revision:"4fd5a74a9ab05dcb5196ecee501098a3"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/.*/i,new e.NetworkFirst({cacheName:"boxy-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")})); +if(!self.define){let e,s={};const n=(n,i)=>(n=new URL(n+".js",i).href,s[n]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=n,e.onload=s,document.head.appendChild(e)}else e=n,importScripts(n),s()})).then((()=>{let e=s[n];if(!e)throw new Error(`Module ${n} didn’t register its module`);return e})));self.define=(i,t)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(s[o])return;let r={};const d=e=>n(e,o),l={module:{uri:o},exports:r,require:d};s[o]=Promise.all(i.map((e=>l[e]||d(e)))).then((e=>(t(...e),r)))}}define(["./workbox-bf1ed05b"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"assets/index-825ada8c.css",revision:null},{url:"assets/index-c7dda4ec.js",revision:null},{url:"assets/workbox-window.prod.es5-a7b12eab.js",revision:null},{url:"index.html",revision:"fcba879ad48e951ddbf02309fcba724d"},{url:"manifest.webmanifest",revision:"4fd5a74a9ab05dcb5196ecee501098a3"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("index.html"))),e.registerRoute(/.*/i,new e.NetworkFirst({cacheName:"boxy-cache",plugins:[new e.ExpirationPlugin({maxEntries:10,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")})); diff --git a/main.py b/main.py index 4ea6213a5611883fb2e142c677c1b8282344544e..912d392dcce9713c3b2f5597d7757a7cefc23787 100644 --- a/main.py +++ b/main.py @@ -1,8 +1,31 @@ -from flask import Flask, render_template +""" +time: 2025 +author: CodeKpy & Coconut Studio +""" + +#from click import command +from flask import Flask, render_template, request, jsonify import pipList +import subprocess +import os +#from urllib.parse import unquote + +#from pipVersion import package_name app = Flask(__name__, template_folder='dist', static_folder='dist/assets') +# 判断是否存在project虚拟环境,不存在则创建 +if not os.path.exists('project'): + import os + os.system('python -m venv project') + +venv_path = "/project" +# Windows系统 +activate_script = f"{venv_path}\\Scripts\\activate" + +# 执行激活虚拟环境的命令 +#subprocess.run(activate_script, shell=True) + # 定义一个路由,当访问根目录时,返回editor.html模板 @app.route('/') def index(): @@ -22,15 +45,66 @@ def api(api): result = pipList.main() """result = subprocess.check_output(['pip', 'freeze']).decode('utf-8')""" # 将内容按行分割制作JSON - result = [line.split() for line in result.split('\n')[2:-1]] + # 按行分割输出 + lines = result.split('\n') + + # 解析每一行并存储为字典 + packages = [] + i = 0 + for line in lines: + if i >1: + if line.strip(): # 跳过空行 + parts = line.split() # 默认按空格分割 + if len(parts) >= 2: + package = parts[0] + version = parts[1] + packages.append({"Package": package, "Version": version}) + else: + i += 1 + # 返回JSON print(result) - return {'pipList': result} + return {'pipList': packages} elif api == 'pyVenv': # 新建Python "project"虚拟环境 - import os + os.system('python -m venv project') return {'pyVenv': 'success'} + elif api == 'pipInstall': + # 从 GET 请求中读取参数 + package_name = request.args.get('packageName') + install_source = request.args.get('installSource') + + # 检查参数是否为空 + if not package_name: + return jsonify({'error': 'packageName is required'}), 400 + if not install_source: + return jsonify({'error': 'installSource is required'}), 400 + + # 打印参数值(实际开发中可以进行相应的处理) + print(f"Package Name: {package_name}") + print(f"Install Source: {install_source}") + + + # result = subprocess.run(['pip', 'install', package_name, '-i', install_source],shell=True, capture_output=True, text=True, encoding="utf-8") + + """# 使用 Popen 执行命令并捕获输出 + process = subprocess.Popen(r'.\project\Scripts\activate && && ' + f'pip install {package_name} -i {install_source}', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="cp936") + stdout, stderr = process.communicate()""" + command = r'.\project\Scripts\activate && pip install '+package_name+' -i ' + install_source + print(command) + process = subprocess.Popen( + command, + shell=True, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="cp936") + stdout, stderr = process.communicate() + + # 检查命令是否成功执行 + if process.returncode == 0: + return jsonify({'success': 'Package installed successfully'}) + else: + return jsonify({'error': 'Failed to install package'}), 500 + if __name__ == '__main__': diff --git a/pipList.py b/pipList.py index d615ac23f805cc21effb9d04479191ce21efd52c..f789d2bebe473be5ad9dbb7edc395b28d792a33b 100644 --- a/pipList.py +++ b/pipList.py @@ -1,45 +1,39 @@ import subprocess +venv_path = r".\project" -# 进入project虚拟环境 -def activate_virtualenv(venv_path): - # Windows系统 +# 激活虚拟环境并获取 pip 列表 +def get_pip_list(venv_path): + # 构造激活虚拟环境和获取 pip 列表的命令 activate_script = f"{venv_path}\\Scripts\\activate" + pip_list_command = "pip list" - # 执行激活虚拟环境的命令 - subprocess.run(activate_script, shell=True) + # 使用 shell 执行命令 + command = f"{activate_script} && {pip_list_command}" + try: + # 使用 Popen 执行命令并捕获输出 + process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, encoding="cp936") + stdout, stderr = process.communicate() -# 获取pip列表 -def get_pip_list(): - # 获取pip列表的命令 - pip_list_command = "pip freeze" - - # 执行命令并获取输出 - result = subprocess.run(pip_list_command, shell=True, capture_output=True, text=True, encoding="utf-8") - - # 检查命令是否成功执行 - if result.returncode == 0: - return result.stdout - else: - return result.stderr + # 检查命令是否成功执行 + if process.returncode == 0: + return stdout.strip() + else: + return f"Error: {stderr.strip()}" + except Exception as e: + return f"Exception occurred: {str(e)}" # 主函数 def main(): - # 虚拟环境路径 - venv_path = "/project" - - # 激活虚拟环境 - activate_virtualenv(venv_path) - - # 获取pip列表 - pip_list = get_pip_list() + # 获取 pip 列表 + pip_list = get_pip_list(venv_path) - # 打印pip列表 + # 打印 pip 列表 print(pip_list) return pip_list if __name__ == "__main__": - main() + main() \ No newline at end of file