@halo-dev/components 0.0.0-alpha.2 → 0.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert/Alert.vue.d.ts +65 -0
- package/dist/components/avatar/Avatar.vue.d.ts +86 -0
- package/dist/components/avatar/index.d.ts +1 -0
- package/dist/components/avatar/interface.d.ts +1 -0
- package/dist/components/button/Button.vue.d.ts +112 -0
- package/dist/components/card/Card.vue.d.ts +7 -4
- package/dist/components/checkbox/CheckBox.vue.d.ts +65 -0
- package/dist/components/checkbox/CheckBoxGroup.vue.d.ts +137 -0
- package/dist/components/codemirror/Codemirror.vue.d.ts +75 -0
- package/dist/components/codemirror/index.d.ts +1 -0
- package/dist/components/dialog/Dialog.vue.d.ts +149 -0
- package/dist/components/dialog/DialogProvider.vue.d.ts +162 -0
- package/dist/components/dialog/interface.d.ts +2 -0
- package/dist/components/empty/Empty.vue.d.ts +30 -0
- package/dist/components/empty/index.d.ts +1 -0
- package/dist/components/entity/Entity.vue.d.ts +67 -0
- package/dist/components/entity/EntityField.vue.d.ts +42 -0
- package/dist/components/entity/index.d.ts +2 -0
- package/dist/components/header/PageHeader.vue.d.ts +3 -1
- package/dist/components/input/Input.vue.d.ts +62 -0
- package/dist/components/menu/Menu.vue.d.ts +16 -0
- package/dist/components/menu/MenuItem.vue.d.ts +55 -0
- package/dist/components/menu/MenuLabel.vue.d.ts +2 -0
- package/dist/components/menu/RoutesMenu.d.ts +2 -0
- package/dist/components/modal/Modal.vue.d.ts +110 -0
- package/dist/components/radio/Radio.vue.d.ts +53 -0
- package/dist/components/radio/RadioGroup.vue.d.ts +121 -0
- package/dist/components/select/Option.vue.d.ts +3 -1
- package/dist/components/select/Select.vue.d.ts +62 -0
- package/dist/components/space/Space.vue.d.ts +47 -0
- package/dist/components/status/StatusDot.vue.d.ts +48 -0
- package/dist/components/status/index.d.ts +1 -0
- package/dist/components/status/interface.d.ts +1 -0
- package/dist/components/switch/Switch.vue.d.ts +28 -0
- package/dist/components/tabs/TabItem.vue.d.ts +28 -0
- package/dist/components/tabs/Tabbar.vue.d.ts +90 -0
- package/dist/components/tabs/Tabs.vue.d.ts +174 -0
- package/dist/components/tag/Tag.vue.d.ts +49 -0
- package/dist/components/textarea/Textarea.vue.d.ts +15 -1
- package/dist/components.d.ts +5 -0
- package/dist/halo-components.es.js +14172 -5153
- package/dist/halo-components.es.js.map +1 -1
- package/dist/halo-components.iife.js +13 -2
- package/dist/halo-components.iife.js.map +1 -1
- package/dist/icons/icons.d.ts +12 -1
- package/dist/style.css +1 -1
- package/package.json +14 -7
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
var HaloComponents=function(m,t,P){"use strict";var Sd=Object.defineProperty;var Xt=Object.getOwnPropertySymbols;var kd=Object.prototype.hasOwnProperty,Vd=Object.prototype.propertyIsEnumerable;var Qt=(m,t,P)=>t in m?Sd(m,t,{enumerable:!0,configurable:!0,writable:!0,value:P}):m[t]=P,se=(m,t)=>{for(var P in t||(t={}))kd.call(t,P)&&Qt(m,P,t[P]);if(Xt)for(var P of Xt(t))Vd.call(t,P)&&Qt(m,P,t[P]);return m};var Pd="";const Zt={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},en=[t.createElementVNode("path",{fill:"currentColor",d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2zm0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16zm3.833 3.337a.595.595 0 0 1 .763.067a.59.59 0 0 1 .063.76c-2.18 3.046-3.38 4.678-3.598 4.897a1.502 1.502 0 0 1-2.122 0a1.502 1.502 0 0 1 0-2.122c.374-.373 2.005-1.574 4.894-3.602zM17.5 11a1 1 0 1 1 0 2a1 1 0 0 1 0-2zm-11 0a1 1 0 1 1 0 2a1 1 0 0 1 0-2zm2.318-3.596a1 1 0 1 1-1.416 1.414a1 1 0 0 1 1.416-1.414zM12 5.5a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function tn(e,n){return t.openBlock(),t.createElementBlock("svg",Zt,en)}var nn={name:"ri-dashboard-3-line",render:tn};const rn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},on=[t.createElementVNode("path",{fill:"currentColor",d:"m10.828 12l4.95 4.95l-1.414 1.414L8 12l6.364-6.364l1.414 1.414z"},null,-1)];function an(e,n){return t.openBlock(),t.createElementBlock("svg",rn,on)}var G={name:"ri-arrow-left-s-line",render:an};const ln={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},sn=[t.createElementVNode("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.414L16 12l-6.364 6.364l-1.414-1.414z"},null,-1)];function cn(e,n){return t.openBlock(),t.createElementBlock("svg",ln,sn)}var T={name:"ri-arrow-right-s-line",render:cn};const dn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},un=[t.createElementVNode("path",{fill:"currentColor",d:"m12 16l-6-6h12z"},null,-1)];function fn(e,n){return t.openBlock(),t.createElementBlock("svg",dn,un)}var pn={name:"ri-arrow-down-s-fill",render:fn};const mn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},hn=[t.createElementVNode("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)];function _n(e,n){return t.openBlock(),t.createElementBlock("svg",mn,hn)}var gn={name:"ri-arrow-up-s-line",render:_n};const yn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},$n=[t.createElementVNode("path",{fill:"currentColor",d:"m12 13.172l4.95-4.95l1.414 1.414L12 16L5.636 9.636L7.05 8.222z"},null,-1)];function vn(e,n){return t.openBlock(),t.createElementBlock("svg",yn,$n)}var wn={name:"ri-arrow-down-s-line",render:vn};const bn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},On=[t.createElementVNode("path",{fill:"currentColor",d:"M2 3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993zM11 5H4v14h7V5zm2 0v14h7V5h-7zm1 2h5v2h-5V7zm0 3h5v2h-5v-2z"},null,-1)];function En(e,n){return t.openBlock(),t.createElementBlock("svg",bn,On)}var Cn={name:"ri-book-read-line",render:En};const Sn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},kn=[t.createElementVNode("path",{fill:"currentColor",d:"M5 8v12h14V8H5zm0-2h14V4H5v2zm15 16H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1zM7 10h4v4H7v-4zm0 6h10v2H7v-2zm6-5h4v2h-4v-2z"},null,-1)];function Vn(e,n){return t.openBlock(),t.createElementBlock("svg",Sn,kn)}var Pn={name:"ri-pages-line",render:Vn};const Bn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},xn=[t.createElementVNode("path",{fill:"currentColor",d:"M2 8.994A5.99 5.99 0 0 1 8 3h8c3.313 0 6 2.695 6 5.994V21H8c-3.313 0-6-2.695-6-5.994V8.994zM20 19V8.994A4.004 4.004 0 0 0 16 5H8a3.99 3.99 0 0 0-4 3.994v6.012A4.004 4.004 0 0 0 8 19h12zm-6-8h2v2h-2v-2zm-6 0h2v2H8v-2z"},null,-1)];function Mn(e,n){return t.openBlock(),t.createElementBlock("svg",Bn,xn)}var zn={name:"ri-message-3-line",render:Mn};const Nn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},In=[t.createElementVNode("path",{fill:"currentColor",d:"M12 2c5.522 0 10 3.978 10 8.889a5.558 5.558 0 0 1-5.556 5.555h-1.966c-.922 0-1.667.745-1.667 1.667c0 .422.167.811.422 1.1c.267.3.434.689.434 1.122C13.667 21.256 12.9 22 12 22C6.478 22 2 17.522 2 12S6.478 2 12 2zm-1.189 16.111a3.664 3.664 0 0 1 3.667-3.667h1.966A3.558 3.558 0 0 0 20 10.89C20 7.139 16.468 4 12 4a8 8 0 0 0-.676 15.972a3.648 3.648 0 0 1-.513-1.86zM7.5 12a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm9 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zM12 9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3z"},null,-1)];function Dn(e,n){return t.openBlock(),t.createElementBlock("svg",Nn,In)}var Ln={name:"ri-palette-line",render:Dn};const An={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Rn=[t.createElementVNode("path",{fill:"currentColor",d:"M2 18h7v2H2v-2zm0-7h9v2H2v-2zm0-7h20v2H2V4zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4.017 4.017 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391c-.41.37-.898.655-1.435.83L19 21h-2l-.24-1.196a3.996 3.996 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4.017 4.017 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196c.536.174 1.024.46 1.434.83zM18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4z"},null,-1)];function Tn(e,n){return t.openBlock(),t.createElementBlock("svg",An,Rn)}var jn={name:"ri-list-settings-line",render:Tn};const Hn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Fn=[t.createElementVNode("path",{fill:"currentColor",d:"M15.199 9.945a2.6 2.6 0 0 1-.79-1.551l-.403-3.083l-2.73 1.486a2.6 2.6 0 0 1-1.72.273L6.5 6.5l.57 3.056a2.6 2.6 0 0 1-.273 1.72l-1.486 2.73l3.083.403a2.6 2.6 0 0 1 1.55.79l2.138 2.257l1.336-2.807a2.6 2.6 0 0 1 1.23-1.231l2.808-1.336l-2.257-2.137zm.025 5.563l-2.213 4.65a.6.6 0 0 1-.977.155l-3.542-3.739a.6.6 0 0 0-.357-.182l-5.107-.668a.6.6 0 0 1-.449-.881l2.462-4.524a.6.6 0 0 0 .062-.396L4.16 4.86a.6.6 0 0 1 .7-.7l5.063.943a.6.6 0 0 0 .396-.062l4.524-2.462a.6.6 0 0 1 .881.45l.668 5.106a.6.6 0 0 0 .182.357l3.739 3.542a.6.6 0 0 1-.155.977l-4.65 2.213a.6.6 0 0 0-.284.284zm.797 1.927l1.414-1.414l4.243 4.242l-1.415 1.415l-4.242-4.243z"},null,-1)];function Un(e,n){return t.openBlock(),t.createElementBlock("svg",Hn,Fn)}var Yn={name:"ri-magic-line",render:Un};const Wn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Kn=[t.createElementVNode("path",{fill:"currentColor",d:"M12 14v2a6 6 0 0 0-6 6H4a8 8 0 0 1 8-8zm0-1c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm2.595 7.812a3.51 3.51 0 0 1 0-1.623l-.992-.573l1-1.732l.992.573A3.496 3.496 0 0 1 17 14.645V13.5h2v1.145c.532.158 1.012.44 1.405.812l.992-.573l1 1.732l-.992.573a3.51 3.51 0 0 1 0 1.622l.992.573l-1 1.732l-.992-.573a3.496 3.496 0 0 1-1.405.812V22.5h-2v-1.145a3.496 3.496 0 0 1-1.405-.812l-.992.573l-1-1.732l.992-.572zM18 19.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3z"},null,-1)];function qn(e,n){return t.openBlock(),t.createElementBlock("svg",Wn,Kn)}var Gn={name:"ri-user-settings-line",render:qn};const Jn={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Xn=[t.createElementVNode("path",{fill:"currentColor",d:"M2 12c0-.865.11-1.703.316-2.504A3 3 0 0 0 4.99 4.867a9.99 9.99 0 0 1 4.335-2.505a3 3 0 0 0 5.348 0a9.99 9.99 0 0 1 4.335 2.505a3 3 0 0 0 2.675 4.63a10.036 10.036 0 0 1 0 5.007a3 3 0 0 0-2.675 4.629a9.99 9.99 0 0 1-4.335 2.505a3 3 0 0 0-5.348 0a9.99 9.99 0 0 1-4.335-2.505a3 3 0 0 0-2.675-4.63A10.056 10.056 0 0 1 2 12zm4.804 3c.63 1.091.81 2.346.564 3.524c.408.29.842.541 1.297.75A4.993 4.993 0 0 1 12 18c1.26 0 2.438.471 3.335 1.274c.455-.209.889-.46 1.297-.75A4.993 4.993 0 0 1 17.196 15a4.993 4.993 0 0 1 2.77-2.25a8.126 8.126 0 0 0 0-1.5A4.993 4.993 0 0 1 17.195 9a4.993 4.993 0 0 1-.564-3.524a7.989 7.989 0 0 0-1.297-.75A4.993 4.993 0 0 1 12 6a4.993 4.993 0 0 1-3.335-1.274a7.99 7.99 0 0 0-1.297.75A4.993 4.993 0 0 1 6.804 9a4.993 4.993 0 0 1-2.77 2.25a8.126 8.126 0 0 0 0 1.5A4.993 4.993 0 0 1 6.805 15zM12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2z"},null,-1)];function Qn(e,n){return t.openBlock(),t.createElementBlock("svg",Jn,Xn)}var Zn={name:"ri-settings-4-line",render:Qn};const er={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},tr=[t.createElementVNode("path",{fill:"currentColor",d:"M13 18v2h6v2h-6a2 2 0 0 1-2-2v-2H8a4 4 0 0 1-4-4V7a1 1 0 0 1 1-1h2V2h2v4h6V2h2v4h2a1 1 0 0 1 1 1v7a4 4 0 0 1-4 4h-3zm-5-2h8a2 2 0 0 0 2-2v-3H6v3a2 2 0 0 0 2 2zm10-8H6v1h12V8zm-6 6.5a1 1 0 1 1 0-2a1 1 0 0 1 0 2zM11 2h2v3h-2V2z"},null,-1)];function nr(e,n){return t.openBlock(),t.createElementBlock("svg",er,tr)}var rr={name:"ri-plug-2-line",render:nr};const or={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ar=[t.createElementVNode("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9c-5.392 0-9.878-3.88-10.819-9C2.121 6.88 6.608 3 12 3zm0 16a9.005 9.005 0 0 0 8.777-7a9.005 9.005 0 0 0-17.554 0A9.005 9.005 0 0 0 12 19zm0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9zm0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5z"},null,-1)];function lr(e,n){return t.openBlock(),t.createElementBlock("svg",or,ar)}var ir={name:"ri-eye-line",render:lr};const sr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},cr=[t.createElementVNode("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2zM20 11H4v8h16v-8zm0-2V7h-8.414l-2-2H4v4h16z"},null,-1)];function dr(e,n){return t.openBlock(),t.createElementBlock("svg",sr,cr)}var ur={name:"ri-folder-2-line",render:dr};const fr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},pr=[t.createElementVNode("path",{fill:"currentColor",d:"M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5zm15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5zm-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5z"},null,-1)];function mr(e,n){return t.openBlock(),t.createElementBlock("svg",fr,pr)}var hr={name:"ri-more-line",render:mr};const _r={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},gr=[t.createElementVNode("path",{fill:"currentColor",d:"m12 10.586l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.414 1.414l-4.95-4.95l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.95-4.95L7.05 5.636z"},null,-1)];function yr(e,n){return t.openBlock(),t.createElementBlock("svg",_r,gr)}var j={name:"ri-close-line",render:yr};const $r={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},vr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)];function wr(e,n){return t.openBlock(),t.createElementBlock("svg",$r,vr)}var J={name:"ri-error-warning-line",render:wr};const br={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Or=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414l2.829 2.829l5.656-5.657l1.415 1.414L11.003 16z"},null,-1)];function Er(e,n){return t.openBlock(),t.createElementBlock("svg",br,Or)}var X={name:"ri-checkbox-circle-line",render:Er};const Cr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Sr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"},null,-1)];function kr(e,n){return t.openBlock(),t.createElementBlock("svg",Cr,Sr)}var H={name:"ri-information-line",render:kr};const Vr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Pr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm0-9.414l2.828-2.829l1.415 1.415L13.414 12l2.829 2.828l-1.415 1.415L12 13.414l-2.828 2.829l-1.415-1.415L10.586 12L7.757 9.172l1.415-1.415L12 10.586z"},null,-1)];function Br(e,n){return t.openBlock(),t.createElementBlock("svg",Vr,Pr)}var ce={name:"ri-close-circle-line",render:Br};const xr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Mr=[t.createElementVNode("path",{fill:"currentColor",d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-4.586 6l1.768 1.768l-1.414 1.414L12 15.414l-1.768 1.768l-1.414-1.414L10.586 14l-1.768-1.768l1.414-1.414L12 12.586l1.768-1.768l1.414 1.414L13.414 14zM9 4v2h6V4H9z"},null,-1)];function zr(e,n){return t.openBlock(),t.createElementBlock("svg",xr,Mr)}var Nr={name:"ri-delete-bin-2-line",render:zr};const Ir={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Dr=[t.createElementVNode("path",{fill:"currentColor",d:"M11 11V7h2v4h4v2h-4v4h-2v-4H7v-2h4zm1 11C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16z"},null,-1)];function Lr(e,n){return t.openBlock(),t.createElementBlock("svg",Ir,Dr)}var Ar={name:"ri-add-circle-line",render:Lr};const Rr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Tr=[t.createElementVNode("path",{fill:"currentColor",d:"M7 19v-6h10v6h2V7.828L16.172 5H5v14h2zM4 3h13l4 4v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm5 12v4h6v-4H9z"},null,-1)];function jr(e,n){return t.openBlock(),t.createElementBlock("svg",Rr,Tr)}var Hr={name:"ri-save-line",render:jr};const Fr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Ur=[t.createElementVNode("path",{fill:"currentColor",d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"},null,-1)];function Yr(e,n){return t.openBlock(),t.createElementBlock("svg",Fr,Ur)}var Wr={name:"ri-list-unordered",render:Yr};const Kr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},qr=[t.createElementVNode("path",{fill:"currentColor",d:"M14 10h-4v4h4v-4zm2 0v4h3v-4h-3zm-2 9v-3h-4v3h4zm2 0h3v-3h-3v3zM14 5h-4v3h4V5zm2 0v3h3V5h-3zm-8 5H5v4h3v-4zm0 9v-3H5v3h3zM8 5H5v3h3V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"},null,-1)];function Gr(e,n){return t.openBlock(),t.createElementBlock("svg",Kr,qr)}var Jr={name:"ri-grid-line",render:Gr};const Xr={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Qr=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm-.997-6l7.07-7.071l-1.414-1.414l-5.656 5.657l-2.829-2.829l-1.414 1.414L11.003 16z"},null,-1)];function Zr(e,n){return t.openBlock(),t.createElementBlock("svg",Xr,Qr)}var eo={name:"ri-checkbox-circle-fill",render:Zr};const to={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},no=[t.createElementVNode("path",{fill:"currentColor",d:"M11 2c4.968 0 9 4.032 9 9s-4.032 9-9 9s-9-4.032-9-9s4.032-9 9-9zm0 16c3.867 0 7-3.133 7-7c0-3.868-3.133-7-7-7c-3.868 0-7 3.132-7 7c0 3.867 3.132 7 7 7zm8.485.071l2.829 2.828l-1.415 1.415l-2.828-2.829l1.414-1.414z"},null,-1)];function ro(e,n){return t.openBlock(),t.createElementBlock("svg",to,no)}var oo={name:"ri-search-2-line",render:ro};const ao={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},lo=[t.createElementVNode("path",{fill:"currentColor",d:"M4 16h16V5H4v11zm9 2v2h4v2H7v-2h4v-2H2.992A.998.998 0 0 1 2 16.993V4.007C2 3.451 2.455 3 2.992 3h18.016c.548 0 .992.449.992 1.007v12.986c0 .556-.455 1.007-.992 1.007H13z"},null,-1)];function io(e,n){return t.openBlock(),t.createElementBlock("svg",ao,lo)}var so={name:"ri-computer-line",render:io};const co={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},uo=[t.createElementVNode("path",{fill:"currentColor",d:"M7 4v16h10V4H7zM6 2h12a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function fo(e,n){return t.openBlock(),t.createElementBlock("svg",co,uo)}var po={name:"ri-smartphone-line",render:fo};const mo={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ho=[t.createElementVNode("path",{fill:"currentColor",d:"M6 4v16h12V4H6zM5 2h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm7 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function _o(e,n){return t.openBlock(),t.createElementBlock("svg",mo,ho)}var go={name:"ri-tablet-line",render:_o};const yo={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},$o=[t.createElementVNode("path",{fill:"currentColor",d:"M14 14.252v2.09A6 6 0 0 0 6 22l-2-.001a8 8 0 0 1 10-7.748zM12 13c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm5.793 8.914l3.535-3.535l1.415 1.414l-4.95 4.95l-3.536-3.536l1.415-1.414l2.12 2.121z"},null,-1)];function vo(e,n){return t.openBlock(),t.createElementBlock("svg",yo,$o)}var wo={name:"ri-user-follow-line",render:vo};const bo={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Oo=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-5-7h9v2h-4v3l-5-5zm5-4V6l5 5H8V9h4z"},null,-1)];function Eo(e,n){return t.openBlock(),t.createElementBlock("svg",bo,Oo)}var Co={name:"ri-exchange-line",render:Eo};const So={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ko=[t.createElementVNode("path",{fill:"currentColor",d:"M12 2C6.475 2 2 6.475 2 12a9.994 9.994 0 0 0 6.838 9.488c.5.087.687-.213.687-.476c0-.237-.013-1.024-.013-1.862c-2.512.463-3.162-.612-3.362-1.175c-.113-.288-.6-1.175-1.025-1.413c-.35-.187-.85-.65-.013-.662c.788-.013 1.35.725 1.538 1.025c.9 1.512 2.338 1.087 2.912.825c.088-.65.35-1.087.638-1.337c-2.225-.25-4.55-1.113-4.55-4.938c0-1.088.387-1.987 1.025-2.688c-.1-.25-.45-1.275.1-2.65c0 0 .837-.262 2.75 1.026a9.28 9.28 0 0 1 2.5-.338c.85 0 1.7.112 2.5.337c1.912-1.3 2.75-1.024 2.75-1.024c.55 1.375.2 2.4.1 2.65c.637.7 1.025 1.587 1.025 2.687c0 3.838-2.337 4.688-4.562 4.938c.362.312.675.912.675 1.85c0 1.337-.013 2.412-.013 2.75c0 .262.188.574.688.474A10.016 10.016 0 0 0 22 12c0-5.525-4.475-10-10-10z"},null,-1)];function Vo(e,n){return t.openBlock(),t.createElementBlock("svg",So,ko)}var Po={name:"ri-github-fill",render:Vo};const Bo={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},xo=[t.createElementVNode("path",{fill:"currentColor",d:"m12 12.586l4.243 4.242l-1.415 1.415L13 16.415V22h-2v-5.587l-1.828 1.83l-1.415-1.415L12 12.586zM12 2a7.001 7.001 0 0 1 6.954 6.194a5.5 5.5 0 0 1-.953 10.784v-2.014a3.5 3.5 0 1 0-1.112-6.91a5 5 0 1 0-9.777 0a3.5 3.5 0 0 0-1.292 6.88l.18.03v2.014a5.5 5.5 0 0 1-.954-10.784A7 7 0 0 1 12 2z"},null,-1)];function Mo(e,n){return t.openBlock(),t.createElementBlock("svg",Bo,xo)}var zo={name:"ri-upload-cloud-2-line",render:Mo};const No={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Io=[t.createElementVNode("path",{fill:"currentColor",d:"M3.783 2.826L12 1l8.217 1.826a1 1 0 0 1 .783.976v9.987a6 6 0 0 1-2.672 4.992L12 23l-6.328-4.219A6 6 0 0 1 3 13.79V3.802a1 1 0 0 1 .783-.976zM5 4.604v9.185a4 4 0 0 0 1.781 3.328L12 20.597l5.219-3.48A4 4 0 0 0 19 13.79V4.604L12 3.05L5 4.604zM12 11a2.5 2.5 0 1 1 0-5a2.5 2.5 0 0 1 0 5zm-4.473 5a4.5 4.5 0 0 1 8.946 0H7.527z"},null,-1)];function Do(e,n){return t.openBlock(),t.createElementBlock("svg",No,Io)}var Lo={name:"ri-shield-user-line",render:Do};const Ao={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Ro=[t.createElementVNode("path",{fill:"currentColor",d:"M7.105 15.21A3.001 3.001 0 1 1 5 15.17V8.83a3.001 3.001 0 1 1 2 0V12c.836-.628 1.874-1 3-1h4a3.001 3.001 0 0 0 2.895-2.21a3.001 3.001 0 1 1 2.032.064A5.001 5.001 0 0 1 14 13h-4a3.001 3.001 0 0 0-2.895 2.21zM6 17a1 1 0 1 0 0 2a1 1 0 0 0 0-2zM6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2zm12 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2z"},null,-1)];function To(e,n){return t.openBlock(),t.createElementBlock("svg",Ao,Ro)}var jo={name:"ri-git-branch-line",render:To};const Ho={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Fo=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM9 9h6v6H9V9z"},null,-1)];function Uo(e,n){return t.openBlock(),t.createElementBlock("svg",Ho,Fo)}var Yo={name:"ri-stop-circle-line",render:Uo};const Wo={preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Ko=[t.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM8.523 7.109l8.368 8.368a6.04 6.04 0 0 1-1.414 1.414L7.109 8.523A6.04 6.04 0 0 1 8.523 7.11z"},null,-1)];function qo(e,n){return t.openBlock(),t.createElementBlock("svg",Wo,Ko)}var de={name:"ri-forbid-line",render:qo},gu="",ue=(e,n)=>{const r=e.__vccOpts||e;for(const[o,a]of n)r[o]=a;return r};const Go={class:"alert-header"},Jo={class:"alert-icon"},Xo={class:"alert-title"},Qo={key:0,class:"alert-description"},Zo={key:1,class:"alert-actions"};var ea=ue(t.defineComponent({__name:"Alert",props:{type:{type:String,default:"default"},title:{type:String},description:{type:String},closable:{type:Boolean,default:!0}},emits:["close"],setup(e,{emit:n}){const r=e,o={success:X,info:H,default:H,warning:J,error:ce},a=t.computed(()=>[`alert-${r.type}`]),l=()=>{n("close")};return(i,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(a),"alert-wrapper"])},[t.createElementVNode("div",Go,[t.createElementVNode("div",Jo,[t.renderSlot(i.$slots,"icon",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o[e.type])))],!0)]),t.createElementVNode("div",Xo,t.toDisplayString(e.title),1),e.closable?(t.openBlock(),t.createElementBlock("div",{key:0,class:"alert-close",onClick:l},[t.createVNode(t.unref(j))])):t.createCommentVNode("",!0)]),e.description||i.$slots.description?(t.openBlock(),t.createElementBlock("div",Qo,[t.renderSlot(i.$slots,"description",{},()=>[t.createTextVNode(t.toDisplayString(e.description),1)],!0)])):t.createCommentVNode("",!0),i.$slots.actions?(t.openBlock(),t.createElementBlock("div",Zo,[t.renderSlot(i.$slots,"actions",{},void 0,!0)])):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-bb026962"]]),$u="";const ta=["disabled"],na={key:0,class:"btn-icon"},ra={key:0,class:"animate-spin",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},oa=[t.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),t.createElementVNode("path",{class:"opacity-75",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},null,-1)],aa={class:"btn-content"},Q=t.defineComponent({__name:"Button",props:{type:{type:String,default:"default"},size:{type:String,default:"md"},circle:{type:Boolean,default:!1},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},route:{type:Object}},emits:["click"],setup(e,{emit:n}){const r=e,o=P.useRouter(),a=t.computed(()=>[`btn-${r.size}`,`btn-${r.type}`,{"btn-circle":r.circle},{"btn-block":r.block},{"btn-loading":r.loading}]);function l(){r.disabled||r.loading||(r.route&&o.push(r.route),n("click"))}return(i,s)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass([t.unref(a),"btn"]),disabled:e.disabled,onClick:l},[i.$slots.icon||e.loading?(t.openBlock(),t.createElementBlock("span",na,[e.loading?(t.openBlock(),t.createElementBlock("svg",ra,oa)):t.renderSlot(i.$slots,"icon",{key:1})])):t.createCommentVNode("",!0),t.createElementVNode("span",aa,[t.renderSlot(i.$slots,"default")])],10,ta))}});var bu="";const la={class:"card-wrapper"},ia={key:0,class:"card-header"},sa={class:"card-header-title"},ca={class:"card-header-actions"},da={key:1,class:"card-footer"},ua=t.defineComponent({__name:"Card",props:{title:{type:String},bodyClass:{type:Object}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("div",la,[e.title||n.$slots.header?(t.openBlock(),t.createElementBlock("div",ia,[t.renderSlot(n.$slots,"header",{},()=>[t.createElementVNode("div",sa,t.toDisplayString(e.title),1),t.createElementVNode("div",ca,[t.renderSlot(n.$slots,"actions")])])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass([e.bodyClass,"card-body"])},[t.renderSlot(n.$slots,"default")],2),n.$slots.footer?(t.openBlock(),t.createElementBlock("div",da,[t.renderSlot(n.$slots,"footer")])):t.createCommentVNode("",!0)]))}});var Ou="";const fa={class:"checkbox-inner"},pa=["id","checked","value"],ma=["for"],fe=t.defineComponent({__name:"CheckBox",props:{checked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean]},label:{type:String},name:{type:String}},emits:["update:checked","change"],setup(e,{emit:n}){const r=e,o=["checkbox",r.name,r.value].filter(l=>!!l).join("-");function a(l){const{checked:i}=l.target;n("update:checked",i),n("change",l)}return(l,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([{"checkbox-wrapper-checked":e.checked},"checkbox-wrapper"])},[t.createElementVNode("div",fa,[t.createElementVNode("input",{id:t.unref(o),checked:e.checked,value:e.value,type:"checkbox",onChange:a},null,40,pa)]),e.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:t.unref(o),class:"checkbox-label"},t.toDisplayString(e.label),9,ma)):t.createCommentVNode("",!0)],2))}});var Eu="";const ha={class:"checkbox-group-wrapper"},_a=t.defineComponent({__name:"CheckBoxGroup",props:{modelValue:{type:Object,default:()=>[]},options:{type:Object},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},name:{type:String}},emits:["update:modelValue","change"],setup(e,{emit:n}){const r=e;function o(a){const{value:l,checked:i}=a.target,s=[...r.modelValue];i?s.push(l):s.splice(s.indexOf(l),1),n("update:modelValue",s),n("change",s)}return(a,l)=>(t.openBlock(),t.createElementBlock("div",ha,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,(i,s)=>(t.openBlock(),t.createBlock(t.unref(fe),{key:s,checked:e.modelValue.includes(i[e.valueKey]),label:i[e.labelKey],name:e.name,value:i[e.valueKey],onChange:o},null,8,["checked","label","name","value"]))),128))]))}}),ga={class:"flex items-center justify-between bg-white p-4"},ya={class:"min-w-0 flex-1 self-center"},$a={class:"flex items-center truncate text-xl font-bold text-gray-800"},va={class:"self-center"},wa=t.defineComponent({__name:"PageHeader",props:{title:{type:String}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("div",ga,[t.createElementVNode("div",ya,[t.createElementVNode("h2",$a,[t.renderSlot(n.$slots,"icon"),t.createElementVNode("span",null,t.toDisplayString(e.title),1)])]),t.createElementVNode("div",va,[t.renderSlot(n.$slots,"actions")])]))}});var Cu="";const ba={class:"input-wrapper"},Oa={key:0,class:"input-prefix"},Ea=["disabled","placeholder","value"],Ca={key:1,class:"input-suffix"},Sa=t.defineComponent({__name:"Input",props:{modelValue:{type:String},size:{type:String,default:"md"},disabled:{type:Boolean,default:!1},placeholder:{type:String}},emits:["update:modelValue"],setup(e,{emit:n}){const r=e,o=t.computed(()=>[`input-${r.size}`]);function a(l){const{value:i}=l.target;n("update:modelValue",i)}return(l,i)=>(t.openBlock(),t.createElementBlock("div",ba,[l.$slots.prefix?(t.openBlock(),t.createElementBlock("div",Oa,[t.renderSlot(l.$slots,"prefix")])):t.createCommentVNode("",!0),t.createElementVNode("input",{class:t.normalizeClass(t.unref(o)),disabled:e.disabled,placeholder:e.placeholder,value:e.modelValue,type:"text",onInput:a},null,42,Ea),l.$slots.suffix?(t.openBlock(),t.createElementBlock("div",Ca,[t.renderSlot(l.$slots,"suffix")])):t.createCommentVNode("",!0)]))}}),ka={class:"menu-container w-full p-3"},pe=t.defineComponent({__name:"Menu",props:{openIds:{type:Object,required:!1}},setup(e){const n=e;return t.provide("openIds",n.openIds),(r,o)=>(t.openBlock(),t.createElementBlock("div",ka,[t.createElementVNode("ul",null,[t.renderSlot(r.$slots,"default")])]))}});var Su="";const Va=["onClick"],Pa={key:0,class:"menu-icon mr-3 self-center"},Ba={class:"menu-title flex-1 self-center"},xa={class:"sub-menu-items transition-all"},Z=t.defineComponent({__name:"MenuItem",props:{id:{type:String,default:""},title:{type:String,default:""},active:{type:Boolean,default:!1}},emits:["select"],setup(e,{emit:n}){const r=e,o=t.useSlots(),a=t.ref(!1),l=t.inject("openIds");l!=null&&l.includes(r.id)&&(a.value=!0);const i=t.computed(()=>o.default&&o.default().length>0);function s(){if(i.value){a.value=!a.value;return}n("select",r.id)}return(c,d)=>(t.openBlock(),t.createElementBlock("li",{class:t.normalizeClass([{"has-submenus":t.unref(i)},"menu-item"]),onClick:t.withModifiers(s,["stop"])},[t.createElementVNode("div",{class:t.normalizeClass([{active:e.active},"menu-item-title"])},[c.$slots.icon?(t.openBlock(),t.createElementBlock("span",Pa,[t.renderSlot(c.$slots,"icon")])):t.createCommentVNode("",!0),t.createElementVNode("span",Ba,t.toDisplayString(e.title),1),c.$slots.default?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass([{open:a.value},"menu-icon-collapse self-center transition-all"])},[t.createVNode(t.unref(T))],2)):t.createCommentVNode("",!0)],2),t.createVNode(t.Transition,{name:"submenus-show"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("ul",xa,[t.renderSlot(c.$slots,"default")],512),[[t.vShow,c.$slots.default&&a.value]])]),_:3})],10,Va))}});var ku="";const Ma={},za={class:"menu-label flex flex-col"};function Na(e,n){return t.openBlock(),t.createElementBlock("li",za,[t.renderSlot(e.$slots,"default")])}var me=ue(Ma,[["render",Na]]);const Ia=t.defineComponent({name:"VRoutesMenu",props:{menus:{type:Object}},emits:["select"],setup(e,{emit:n}){const r=P.useRoute(),{push:o}=P.useRouter(),a=t.computed(()=>r.matched.map(c=>c.path));async function l(c){n("select",c),await o(c)}function i(c){if(!!c)return t.createVNode(c,{height:"20px",width:"20px"},null)}function s(c){return c==null?void 0:c.map(d=>{var u;return t.createVNode(t.Fragment,null,[(u=d.children)!=null&&u.length?t.createVNode(Z,{key:d.path,id:d.path,title:d.name},{default:()=>[s(d.children)],icon:()=>i(d.icon)}):t.createVNode(Z,{key:d.path,id:d.path,title:d.name,onSelect:l,active:a.value.includes(d.path)},{icon:()=>i(d.icon)})])})}return()=>t.createVNode(pe,{openIds:a.value},{default:()=>{var c;return[(c=e.menus)==null?void 0:c.map(d=>{var u;return t.createVNode(t.Fragment,null,[d.name&&t.createVNode(me,null,{default:()=>[d.name]}),((u=d.items)==null?void 0:u.length)&&s(d.items)])})]}})}});var Vu="";const Da={key:0,class:"modal-header"},La={class:"modal-header-title"},Aa={class:"modal-header-actions flex flex-row"},Ra={key:1,class:"modal-footer"},he=t.defineComponent({__name:"Modal",props:{visible:{type:Boolean,default:!1},title:{type:String},width:{type:Number,default:500},fullscreen:{type:Boolean,default:!1},bodyClass:{type:Object}},emits:["update:visible","close"],setup(e,{emit:n}){const r=e,o=t.ref(!1),a=t.computed(()=>({"modal-wrapper-fullscreen":r.fullscreen})),l=t.computed(()=>({maxWidth:r.width+"px"}));function i(){n("update:visible",!1),n("close")}return(s,c)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body",disabled:!0},[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass([t.unref(a),"modal-wrapper"]),"aria-modal":"true",role:"dialog",tabindex:"0",onKeyup:c[4]||(c[4]=t.withKeys(d=>i(),["esc"]))},[t.createVNode(t.Transition,{"enter-active-class":"ease-out duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0",onBeforeEnter:c[1]||(c[1]=d=>o.value=!0),onAfterLeave:c[2]||(c[2]=d=>o.value=!1)},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:"modal-layer",onClick:c[0]||(c[0]=d=>i())},null,512),[[t.vShow,e.visible]])]),_:1}),t.createVNode(t.Transition,{"enter-active-class":"ease-out duration-200","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"ease-in duration-100","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{style:t.normalizeStyle(t.unref(l)),class:"modal-content transform transition-all"},[s.$slots.header||e.title?(t.openBlock(),t.createElementBlock("div",Da,[t.renderSlot(s.$slots,"header",{},()=>[t.createElementVNode("div",La,t.toDisplayString(e.title),1),t.createElementVNode("div",Aa,[t.renderSlot(s.$slots,"actions"),t.createElementVNode("div",{class:"modal-header-action",onClick:c[3]||(c[3]=d=>i())},[t.createVNode(t.unref(j))])])])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass([e.bodyClass,"modal-body"])},[t.renderSlot(s.$slots,"default")],2),s.$slots.footer?(t.openBlock(),t.createElementBlock("div",Ra,[t.renderSlot(s.$slots,"footer")])):t.createCommentVNode("",!0)],4),[[t.vShow,e.visible]])]),_:3})],34),[[t.vShow,o.value]])]))}});var Pu="";const Ta={class:"radio-inner"},ja=["id","checked","name","value"],Ha=["for"],_e=t.defineComponent({__name:"Radio",props:{modelValue:{type:[String,Number,Boolean]},value:{type:[String,Number,Boolean]},label:{type:String},name:{type:String}},emits:["update:modelValue","change"],setup(e,{emit:n}){const r=e,o=["radio",r.name,r.value].filter(i=>!!i).join("-"),a=t.computed(()=>r.modelValue===r.value);function l(i){const{value:s}=i.target;n("update:modelValue",s),n("change",s)}return(i,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([{"radio-wrapper-checked":t.unref(a)},"radio-wrapper"])},[t.createElementVNode("div",Ta,[t.createElementVNode("input",{id:t.unref(o),checked:t.unref(a),name:e.name,value:e.value,type:"radio",onChange:l},null,40,ja)]),e.label?(t.openBlock(),t.createElementBlock("label",{key:0,for:t.unref(o),class:"radio-label"},t.toDisplayString(e.label),9,Ha)):t.createCommentVNode("",!0)],2))}}),Fa={class:"radio-group-wrapper"},Ua=t.defineComponent({__name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean]},options:{type:Object},valueKey:{type:String,default:"value"},labelKey:{type:String,default:"label"},name:{type:String}},emits:["update:modelValue","change"],setup(e,{emit:n}){function r(o){n("update:modelValue",o),n("change",o)}return(o,a)=>(t.openBlock(),t.createElementBlock("div",Fa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.options,(l,i)=>(t.openBlock(),t.createBlock(t.unref(_e),{key:i,label:l[e.labelKey]+"","model-value":e.modelValue,name:e.name,value:l[e.valueKey],onChange:r},null,8,["label","model-value","name","value"]))),128))]))}});var Bu="";const Ya={class:"select-wrapper"},Wa=["disabled","value"],Ka={key:"placeholder",disabled:"",hidden:"",value:""},qa=t.defineComponent({__name:"Select",props:{modelValue:{type:String},size:{type:String,default:"md"},disabled:{type:Boolean,default:!1},placeholder:{type:String}},emits:["update:modelValue"],setup(e,{emit:n}){const r=e,o=t.computed(()=>[`select-${r.size}`]);function a(l){const{value:i}=l.target;n("update:modelValue",i)}return(l,i)=>(t.openBlock(),t.createElementBlock("div",Ya,[t.createElementVNode("select",{class:t.normalizeClass(t.unref(o)),disabled:e.disabled,value:e.modelValue,onChange:a},[e.placeholder?(t.openBlock(),t.createElementBlock("option",Ka,t.toDisplayString(e.placeholder),1)):t.createCommentVNode("",!0),t.renderSlot(l.$slots,"default")],42,Wa)]))}}),Ga=["value"],Ja=t.defineComponent({__name:"Option",props:{value:{type:[String,Number,Boolean]}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("option",{value:e.value},[t.renderSlot(n.$slots,"default")],8,Ga))}}),Xa={xs:10,sm:12,md:16,lg:20};var xu="";const Qa=t.defineComponent({__name:"Space",props:{spacing:{type:String,default:"xs"},direction:{type:String,default:"row"},align:{type:String,default:"center"}},setup(e){const n=e,r=t.computed(()=>{const{direction:o,align:a}=n;return[`space-direction-${o}`,`space-align-${a}`]});return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(r),"space-wrapper"]),style:t.normalizeStyle(`gap: ${t.unref(Xa)[e.spacing]}px`)},[t.renderSlot(o.$slots,"default")],6))}});var Mu="";const Za={class:"tabs-bar-wrapper"},el={class:"tabs-items-wrapper"},tl=t.defineComponent({__name:"Tabs",props:{activeId:{type:[Number,String]},type:{type:String,default:"default"},direction:{type:String,default:"row"},idKey:{type:String,default:"id"},labelKey:{type:String,default:"label"}},emits:["update:activeId","change"],setup(e,{emit:n}){const r=e;t.provide("activeId",t.computed(()=>r.activeId));const o=t.useSlots(),a=t.computed(()=>{var s;return(s=o.default)==null?void 0:s.call(o).map(({props:c})=>({id:c==null?void 0:c[r.idKey],label:c==null?void 0:c[r.labelKey]}))}),l=t.computed(()=>[`tabs-direction-${r.direction}`]),i=s=>{n("update:activeId",s),n("change",s)};return(s,c)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(l),"tabs-wrapper"])},[t.createElementVNode("div",Za,[t.createVNode(t.unref(ge),{activeId:e.activeId,direction:e.direction,items:t.unref(a),type:e.type,onChange:i},null,8,["activeId","direction","items","type"])]),t.createElementVNode("div",el,[t.renderSlot(s.$slots,"default")])],2))}}),nl={key:0,class:"tabs-item-wrapper"},rl=t.defineComponent({__name:"TabItem",props:{id:{type:String},label:{type:String}},setup(e){const n=e,r=t.inject("activeId"),o=t.computed(()=>(r==null?void 0:r.value)===n.id);return(a,l)=>t.unref(o)?(t.openBlock(),t.createElementBlock("div",nl,[t.renderSlot(a.$slots,"default")])):t.createCommentVNode("",!0)}});var zu="";const ol={class:"tabbar-items"},al=["onClick"],ll={key:0,class:"tabbar-item-icon"},il={key:1,class:"tabbar-item-label"},ge=t.defineComponent({__name:"Tabbar",props:{activeId:{type:[Number,String]},items:{type:Object},type:{type:String,default:"default"},direction:{type:String,default:"row"},idKey:{type:String,default:"id"},labelKey:{type:String,default:"label"}},emits:["update:activeId","change"],setup(e,{emit:n}){const r=e,o=t.computed(()=>[`tabbar-${r.type}`,`tabbar-direction-${r.direction}`]),a=l=>{n("update:activeId",l),n("change",l)};return(l,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(o),"tabbar-wrapper"])},[t.createElementVNode("div",ol,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(s,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:t.normalizeClass([{"tabbar-item-active":s[e.idKey]===e.activeId},"tabbar-item"]),onClick:d=>a(s[e.idKey])},[s.icon?(t.openBlock(),t.createElementBlock("div",ll,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.icon)))])):t.createCommentVNode("",!0),s[e.labelKey]?(t.openBlock(),t.createElementBlock("div",il,t.toDisplayString(s[e.labelKey]),1)):t.createCommentVNode("",!0)],10,al))),128))])],2))}});var Nu="";const sl={key:0,class:"tag-left-icon"},cl={class:"tag-content"},dl={key:1,class:"tag-right-icon"},ul=t.defineComponent({__name:"Tag",props:{theme:{type:String,default:"default"},rounded:{type:Boolean,default:!1}},setup(e){const n=e,r=t.computed(()=>[`tag-${n.theme}`,{"tag-rounded":n.rounded}]);return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([t.unref(r),"tag-wrapper"])},[o.$slots.leftIcon?(t.openBlock(),t.createElementBlock("div",sl,[t.renderSlot(o.$slots,"leftIcon")])):t.createCommentVNode("",!0),t.createElementVNode("span",cl,[t.renderSlot(o.$slots,"default")]),o.$slots.rightIcon?(t.openBlock(),t.createElementBlock("div",dl,[t.renderSlot(o.$slots,"rightIcon")])):t.createCommentVNode("",!0)],2))}});var Iu="";const fl={class:"textarea-wrapper"},pl=["disabled","placeholder","rows","value"],ml=t.defineComponent({__name:"Textarea",props:{modelValue:{type:String},disabled:{type:Boolean,default:!1},placeholder:{type:String},rows:{type:Number,default:3}},emits:["update:modelValue"],setup(e,{emit:n}){function r(o){const{value:a}=o.target;n("update:modelValue",a)}return(o,a)=>(t.openBlock(),t.createElementBlock("div",fl,[t.createElementVNode("textarea",{disabled:e.disabled,placeholder:e.placeholder,rows:e.rows,value:e.modelValue,onInput:r},`
|
|
2
|
-
`,40,pl)]))}});var Du="";const hl={class:"switch-wrapper"},_l=t.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:n}){const r=e,o=()=>{n("update:modelValue",!r.modelValue),n("change",!r.modelValue)};return(a,l)=>(t.openBlock(),t.createElementBlock("div",hl,[t.createElementVNode("button",{class:t.normalizeClass([{"bg-gray-200":!e.modelValue,"!bg-primary":e.modelValue},"switch-inner"]),"aria-checked":"false",role:"switch",type:"button",onClick:o},[t.createElementVNode("span",{class:t.normalizeClass([{"translate-x-0":!e.modelValue,"translate-x-5":e.modelValue},"switch-indicator"]),"aria-hidden":"true"},[t.renderSlot(a.$slots,"icon")],2)],2)]))}}),gl={class:"flex justify-between items-start py-2 mb-2"},yl={class:"flex flex-row items-center gap-3"},$l={class:"text-base text-gray-900 font-bold"},vl={class:"flex items-center gap-4"},wl={class:"flex-1 flex items-stretch"},bl={class:"text-sm text-gray-700"},Ol={class:"flex flex-col sm:flex-row gap-[10px]"},ye=t.defineComponent({__name:"Dialog",props:{type:{type:String,default:"info"},title:{type:String,default:"\u63D0\u793A"},description:{type:String,default:""},confirmText:{type:String,default:"\u786E\u5B9A"},cancelText:{type:String,default:"\u53D6\u6D88"},visible:{type:Boolean,default:!1},onConfirm:{type:Function},onCancel:{type:Function}},emits:["update:visible","close"],setup(e,{emit:n}){const r=e,o={success:{icon:X,color:"green"},info:{icon:H,color:"blue"},warning:{icon:J,color:"orange"},error:{icon:de,color:"red"}},a=t.computed(()=>o[r.type]),l=t.ref(!1),i=()=>{r.onCancel&&r.onCancel(),c()},s=async()=>{r.onConfirm&&(l.value=!0,await r.onConfirm()),c()},c=()=>{l.value=!1,n("update:visible",!1),n("close")};return(d,u)=>(t.openBlock(),t.createBlock(t.unref(he),{visible:e.visible,width:450,onClose:u[0]||(u[0]=h=>i())},{footer:t.withCtx(()=>[t.createElementVNode("div",Ol,[t.createVNode(t.unref(Q),{loading:l.value,type:"secondary",onClick:s},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.confirmText),1)]),_:1},8,["loading"]),t.createVNode(t.unref(Q),{onClick:i},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.cancelText),1)]),_:1})])]),default:t.withCtx(()=>[t.createElementVNode("div",gl,[t.createElementVNode("div",yl,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(a).icon),{class:t.normalizeClass([`text-${t.unref(a).color}-500`,"w-6 h-6"])},null,8,["class"])),t.createElementVNode("div",$l,t.toDisplayString(e.title),1)]),t.createElementVNode("div",null,[t.createVNode(t.unref(j),{class:"cursor-pointer",onClick:i})])]),t.createElementVNode("div",vl,[t.createElementVNode("div",wl,[t.createElementVNode("div",bl,t.toDisplayString(e.description),1)])])]),_:1},8,["visible"]))}}),$e="DIALOG_PROVIDER_PROVIDE_KEY",El=t.defineComponent({__name:"DialogProvider",setup(e){const n=t.ref({visible:!1,title:""});return t.provide($e,n),(r,o)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.renderSlot(r.$slots,"default"),t.createVNode(t.unref(ye),{visible:n.value.visible,"onUpdate:visible":o[0]||(o[0]=a=>n.value.visible=a),"cancel-text":n.value.cancelText,"confirm-text":n.value.confirmText,description:n.value.description,onCancel:n.value.onCancel,onConfirm:n.value.onConfirm,title:n.value.title,type:n.value.type},null,8,["visible","cancel-text","confirm-text","description","onCancel","onConfirm","title","type"])],64))}});function Cl(){const e=t.inject($e);if(!e)throw new Error("DialogProvider is not mounted");const n=r=>o=>{e.value=se(se({},e.value),o),e.value.type=r,e.value.visible=!0};return{success:n("success"),info:n("info"),warning:n("warning"),error:n("error")}}var ve;const N=typeof window!="undefined",we=e=>typeof e=="string",F=()=>+Date.now(),be=(e,n,r)=>Math.min(r,Math.max(n,e)),V=()=>{},Oe=N&&((ve=window==null?void 0:window.navigator)==null?void 0:ve.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function A(e,n){function r(...o){e(()=>n.apply(this,o),{fn:n,thisArg:this,args:o})}return r}const ee=e=>e();function Sl(e,n={}){let r,o;return l=>{const i=t.unref(e),s=t.unref(n.maxWait);if(r&&clearTimeout(r),i<=0||s!==void 0&&s<=0)return o&&(clearTimeout(o),o=null),l();s&&!o&&(o=setTimeout(()=>{r&&clearTimeout(r),o=null,l()},s)),r=setTimeout(()=>{o&&clearTimeout(o),o=null,l()},i)}}function Ee(e,n=!0,r=!0){let o=0,a,l=!0;const i=()=>{a&&(clearTimeout(a),a=void 0)};return c=>{const d=t.unref(e),u=Date.now()-o;if(i(),d<=0)return o=Date.now(),c();u>d&&(r||!l)?(o=Date.now(),c()):n&&(a=setTimeout(()=>{o=Date.now(),l=!0,i(),c()},d)),!r&&!a&&(a=setTimeout(()=>l=!0,d)),l=!1}}function kl(e=ee){const n=t.ref(!0);function r(){n.value=!1}function o(){n.value=!0}return{isActive:n,pause:r,resume:o,eventFilter:(...l)=>{n.value&&e(...l)}}}const I={mounted:"mounted",updated:"updated",unmounted:"unmounted"};function Vl(e,n=!1,r="Timeout"){return new Promise((o,a)=>{setTimeout(n?()=>a(r):o,e)})}function Pl(e){let n;function r(){return n||(n=e()),n}return r.reset=async()=>{const o=n;n=void 0,o&&await o},r}function Bl(e,n,r=!1){return n.reduce((o,a)=>(a in e&&(!r||e[a]!==void 0)&&(o[a]=e[a]),o),{})}function B(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function Ce(e,n=200,r={}){return A(Sl(n,r),e)}function xl(e,n=200,r=!0,o=!0){return A(Ee(n,r,o),e)}function Se(e,n,r={}){const{flush:o="sync",deep:a=!1,immediate:l=!0,direction:i="both"}=r;let s,c;return(i==="both"||i==="ltr")&&(s=t.watch(e,d=>n.value=d,{flush:o,deep:a,immediate:l})),(i==="both"||i==="rtl")&&(c=t.watch(n,d=>e.value=d,{flush:o,deep:a,immediate:l})),()=>{s==null||s(),c==null||c()}}var Ml=Object.defineProperty,zl=Object.defineProperties,Nl=Object.getOwnPropertyDescriptors,ke=Object.getOwnPropertySymbols,Il=Object.prototype.hasOwnProperty,Dl=Object.prototype.propertyIsEnumerable,Ve=(e,n,r)=>n in e?Ml(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Ll=(e,n)=>{for(var r in n||(n={}))Il.call(n,r)&&Ve(e,r,n[r]);if(ke)for(var r of ke(n))Dl.call(n,r)&&Ve(e,r,n[r]);return e},Al=(e,n)=>zl(e,Nl(n));function Pe(e){if(!t.isRef(e))return t.toRefs(e);const n=Array.isArray(e.value)?new Array(e.value.length):{};for(const r in e.value)n[r]=t.customRef(()=>({get(){return e.value[r]},set(o){if(Array.isArray(e.value)){const a=[...e.value];a[r]=o,e.value=a}else{const a=Al(Ll({},e.value),{[r]:o});Object.setPrototypeOf(a,e.value),e.value=a}}}));return n}function Be(e,n=!0){t.getCurrentInstance()?t.onBeforeMount(e):n?e():t.nextTick(e)}function D(e,n=!0){t.getCurrentInstance()?t.onMounted(e):n?e():t.nextTick(e)}function xe(e,n=1e3,r={}){const{immediate:o=!0,immediateCallback:a=!1}=r;let l=null;const i=t.ref(!1);function s(){l&&(clearInterval(l),l=null)}function c(){i.value=!1,s()}function d(){t.unref(n)<=0||(i.value=!0,a&&e(),s(),l=setInterval(e,t.unref(n)))}if(o&&N&&d(),t.isRef(n)){const u=t.watch(n,()=>{i.value&&N&&d()});B(u)}return B(c),{isActive:i,pause:c,resume:d}}function Rl(e=!1,n={}){const{truthyValue:r=!0,falsyValue:o=!1}=n,a=t.isRef(e),l=t.ref(e);function i(s){return arguments.length?(l.value=s,l.value):(l.value=l.value===t.unref(r)?t.unref(o):t.unref(r),l.value)}return a?i:[l,i]}var Me=Object.getOwnPropertySymbols,Tl=Object.prototype.hasOwnProperty,jl=Object.prototype.propertyIsEnumerable,Hl=(e,n)=>{var r={};for(var o in e)Tl.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Me)for(var o of Me(e))n.indexOf(o)<0&&jl.call(e,o)&&(r[o]=e[o]);return r};function Fl(e,n,r={}){const o=r,{eventFilter:a=ee}=o,l=Hl(o,["eventFilter"]);return t.watch(e,A(a,n),l)}var Ul=Object.defineProperty,Yl=Object.defineProperties,Wl=Object.getOwnPropertyDescriptors,U=Object.getOwnPropertySymbols,ze=Object.prototype.hasOwnProperty,Ne=Object.prototype.propertyIsEnumerable,Ie=(e,n,r)=>n in e?Ul(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Kl=(e,n)=>{for(var r in n||(n={}))ze.call(n,r)&&Ie(e,r,n[r]);if(U)for(var r of U(n))Ne.call(n,r)&&Ie(e,r,n[r]);return e},ql=(e,n)=>Yl(e,Wl(n)),Gl=(e,n)=>{var r={};for(var o in e)ze.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&U)for(var o of U(e))n.indexOf(o)<0&&Ne.call(e,o)&&(r[o]=e[o]);return r};function De(e,n,r={}){const o=r,{eventFilter:a}=o,l=Gl(o,["eventFilter"]),{eventFilter:i,pause:s,resume:c,isActive:d}=kl(a);return{stop:Fl(e,n,ql(Kl({},l),{eventFilter:i})),pause:s,resume:c,isActive:d}}function x(e){var n;const r=t.unref(e);return(n=r==null?void 0:r.$el)!=null?n:r}const S=N?window:void 0,Le=N?window.document:void 0,Y=N?window.navigator:void 0;function v(...e){let n,r,o,a;if(we(e[0])?([r,o,a]=e,n=S):[n,r,o,a]=e,!n)return V;let l=V;const i=t.watch(()=>x(n),c=>{l(),c&&(c.addEventListener(r,o,a),l=()=>{c.removeEventListener(r,o,a),l=V})},{immediate:!0,flush:"post"}),s=()=>{i(),l()};return B(s),s}function Jl(e,n,r={}){const{window:o=S,ignore:a,capture:l=!0,detectIframe:i=!1}=r;if(!o)return;const s=t.ref(!0);let c;const d=f=>{o.clearTimeout(c);const p=x(e),_=f.composedPath();!p||p===f.target||_.includes(p)||!s.value||a&&a.length>0&&a.some(y=>{const $=x(y);return $&&(f.target===$||_.includes($))})||n(f)},u=[v(o,"click",d,{passive:!0,capture:l}),v(o,"pointerdown",f=>{const p=x(e);s.value=!!p&&!f.composedPath().includes(p)},{passive:!0}),v(o,"pointerup",f=>{if(f.button===0){const p=f.composedPath();f.composedPath=()=>p,c=o.setTimeout(()=>d(f),50)}},{passive:!0}),i&&v(o,"blur",f=>{var p;const _=x(e);((p=document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(_!=null&&_.contains(document.activeElement))&&n(f)})].filter(Boolean);return()=>u.forEach(f=>f())}function Xl(e={}){const{window:n=S}=e,r=t.ref(0);return n&&(v(n,"blur",()=>r.value+=1,!0),v(n,"focus",()=>r.value+=1,!0)),t.computed(()=>(r.value,n==null?void 0:n.document.activeElement))}function Ql({navigator:e=Y}={}){const n=["chargingchange","chargingtimechange","dischargingtimechange","levelchange"],r=e&&"getBattery"in e,o=t.ref(!1),a=t.ref(0),l=t.ref(0),i=t.ref(1);let s;function c(){o.value=this.charging,a.value=this.chargingTime||0,l.value=this.dischargingTime||0,i.value=this.level}return r&&e.getBattery().then(d=>{s=d,c.call(s);for(const u of n)v(s,u,c,{passive:!0})}),{isSupported:r,charging:o,chargingTime:a,dischargingTime:l,level:i}}function R(e,n={}){const{window:r=S}=n,o=Boolean(r&&"matchMedia"in r&&typeof r.matchMedia=="function");let a;const l=t.ref(!1),i=()=>{!o||(a||(a=r.matchMedia(e)),l.value=a.matches)};return Be(()=>{i(),a&&("addEventListener"in a?a.addEventListener("change",i):a.addListener(i),B(()=>{"removeEventListener"in a?a.removeEventListener("change",i):a.removeListener(i)}))}),l}function Zl({window:e=S}={}){const n=o=>{const{state:a,length:l}=(e==null?void 0:e.history)||{},{hash:i,host:s,hostname:c,href:d,origin:u,pathname:h,port:f,protocol:p,search:_}=(e==null?void 0:e.location)||{};return{trigger:o,state:a,length:l,hash:i,host:s,hostname:c,href:d,origin:u,pathname:h,port:f,protocol:p,search:_}},r=t.ref(n("load"));return e&&(v(e,"popstate",()=>r.value=n("popstate"),{passive:!0}),v(e,"hashchange",()=>r.value=n("hashchange"),{passive:!0})),r}function Ae(e,n,r){const o=t.ref(e);return t.computed({get(){return o.value=be(o.value,t.unref(n),t.unref(r))},set(a){o.value=be(a,t.unref(n),t.unref(r))}})}const te=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ne="__vueuse_ssr_handlers__";te[ne]=te[ne]||{};const ei=te[ne];function Re(e,n){return ei[e]||n}function ti(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const ni={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function Te(e,n,r,o={}){var a;const{flush:l="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,shallow:d,window:u=S,eventFilter:h,onError:f=g=>{console.error(g)}}=o,p=(d?t.shallowRef:t.ref)(n);if(!r)try{r=Re("getDefaultStorage",()=>{var g;return(g=S)==null?void 0:g.localStorage})()}catch(g){f(g)}if(!r)return p;const _=t.unref(n),y=ti(_),$=(a=o.serializer)!=null?a:ni[y],{pause:O,resume:w}=De(p,()=>b(p.value),{flush:l,deep:i,eventFilter:h});return u&&s&&v(u,"storage",C),C(),p;function b(g){try{g==null?r.removeItem(e):r.setItem(e,$.write(g))}catch(k){f(k)}}function E(g){if(!(g&&g.key!==e)){O();try{const k=g?g.newValue:r.getItem(e);return k==null?(c&&_!==null&&r.setItem(e,$.write(_)),_):typeof k!="string"?k:$.read(k)}catch(k){f(k)}finally{w()}}}function C(g){g&&g.key!==e||(p.value=E(g))}}function re(e){return R("(prefers-color-scheme: dark)",e)}var ri=Object.defineProperty,je=Object.getOwnPropertySymbols,oi=Object.prototype.hasOwnProperty,ai=Object.prototype.propertyIsEnumerable,He=(e,n,r)=>n in e?ri(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,li=(e,n)=>{for(var r in n||(n={}))oi.call(n,r)&&He(e,r,n[r]);if(je)for(var r of je(n))ai.call(n,r)&&He(e,r,n[r]);return e};function ii(e={}){const{selector:n="html",attribute:r="class",window:o=S,storage:a,storageKey:l="vueuse-color-scheme",listenToStorageChanges:i=!0,storageRef:s,emitAuto:c}=e,d=li({auto:"",light:"light",dark:"dark"},e.modes||{}),u=re({window:o}),h=t.computed(()=>u.value?"dark":"light"),f=s||(l==null?t.ref("auto"):Te(l,"auto",a,{window:o,listenToStorageChanges:i})),p=t.computed({get(){return f.value==="auto"&&!c?h.value:f.value},set(O){f.value=O}}),_=Re("updateHTMLAttrs",(O,w,b)=>{const E=o==null?void 0:o.document.querySelector(O);if(!!E)if(w==="class"){const C=b.split(/\s/g);Object.values(d).flatMap(g=>(g||"").split(/\s/g)).filter(Boolean).forEach(g=>{C.includes(g)?E.classList.add(g):E.classList.remove(g)})}else E.setAttribute(w,b)});function y(O){var w;const b=O==="auto"?h.value:O;_(n,r,(w=d[b])!=null?w:b)}function $(O){e.onChanged?e.onChanged(O,y):y(O)}return t.watch(p,$,{flush:"post",immediate:!0}),D(()=>$(p.value)),p}var si=Object.defineProperty,ci=Object.defineProperties,di=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,ui=Object.prototype.hasOwnProperty,fi=Object.prototype.propertyIsEnumerable,Ue=(e,n,r)=>n in e?si(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,pi=(e,n)=>{for(var r in n||(n={}))ui.call(n,r)&&Ue(e,r,n[r]);if(Fe)for(var r of Fe(n))fi.call(n,r)&&Ue(e,r,n[r]);return e},mi=(e,n)=>ci(e,di(n));function hi(e={}){const{valueDark:n="dark",valueLight:r="",window:o=S}=e,a=ii(mi(pi({},e),{onChanged:(s,c)=>{var d;e.onChanged?(d=e.onChanged)==null||d.call(e,s==="dark"):c(s)},modes:{dark:n,light:r}})),l=re({window:o});return t.computed({get(){return a.value==="dark"},set(s){s===l.value?a.value="auto":a.value=s?"dark":"light"}})}function _i(e={}){const{window:n=S,eventFilter:r=ee}=e,o=t.ref({x:null,y:null,z:null}),a=t.ref({alpha:null,beta:null,gamma:null}),l=t.ref(0),i=t.ref({x:null,y:null,z:null});if(n){const s=A(r,c=>{o.value=c.acceleration,i.value=c.accelerationIncludingGravity,a.value=c.rotationRate,l.value=c.interval});v(n,"devicemotion",s)}return{acceleration:o,accelerationIncludingGravity:i,rotationRate:a,interval:l}}function gi(e={}){const{window:n=S}=e,r=Boolean(n&&"DeviceOrientationEvent"in n),o=t.ref(!1),a=t.ref(null),l=t.ref(null),i=t.ref(null);return n&&r&&v(n,"deviceorientation",s=>{o.value=s.absolute,a.value=s.alpha,l.value=s.beta,i.value=s.gamma}),{isSupported:r,isAbsolute:o,alpha:a,beta:l,gamma:i}}const yi=[1,1.325,1.4,1.5,1.8,2,2.4,2.5,2.75,3,3.5,4];function $i({window:e=S}={}){if(!e)return{pixelRatio:t.ref(1)};const n=t.ref(e.devicePixelRatio),r=()=>{n.value=e.devicePixelRatio};return v(e,"resize",r,{passive:!0}),yi.forEach(o=>{const a=R(`screen and (min-resolution: ${o}dppx)`),l=R(`screen and (max-resolution: ${o}dppx)`);t.watch([a,l],r)}),{pixelRatio:n}}function vi(e,n={}){const{controls:r=!1,navigator:o=Y}=n,a=Boolean(o&&"permissions"in o);let l;const i=typeof e=="string"?{name:e}:e,s=t.ref(),c=()=>{l&&(s.value=l.state)},d=Pl(async()=>{if(!!a){if(!l)try{l=await o.permissions.query(i),v(l,"change",c),c()}catch{s.value="prompt"}return l}});return d(),r?{state:s,isSupported:a,query:d}:s}function wi(e={}){const{navigator:n=Y,requestPermissions:r=!1,constraints:o={audio:!0,video:!0},onUpdated:a}=e,l=t.ref([]),i=t.computed(()=>l.value.filter(p=>p.kind==="videoinput")),s=t.computed(()=>l.value.filter(p=>p.kind==="audioinput")),c=t.computed(()=>l.value.filter(p=>p.kind==="audiooutput"));let d=!1;const u=t.ref(!1);async function h(){!d||(l.value=await n.mediaDevices.enumerateDevices(),a==null||a(l.value))}async function f(){if(!d)return!1;if(u.value)return!0;const{state:p,query:_}=vi("camera",{controls:!0});return await _(),p.value!=="granted"&&((await n.mediaDevices.getUserMedia(o)).getTracks().forEach($=>$.stop()),h()),u.value=!0,u.value}return n&&(d=Boolean(n.mediaDevices&&n.mediaDevices.enumerateDevices),d&&(r&&f(),v(n.mediaDevices,"devicechange",h),h())),{devices:l,ensurePermissions:f,permissionGranted:u,videoInputs:i,audioInputs:s,audioOutputs:c,isSupported:d}}function bi({document:e=Le}={}){if(!e)return t.ref("visible");const n=t.ref(e.visibilityState);return v(e,"visibilitychange",()=>{n.value=e.visibilityState}),n}var Oi=Object.defineProperty,Ei=Object.defineProperties,Ci=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,ki=Object.prototype.propertyIsEnumerable,We=(e,n,r)=>n in e?Oi(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Vi=(e,n)=>{for(var r in n||(n={}))Si.call(n,r)&&We(e,r,n[r]);if(Ye)for(var r of Ye(n))ki.call(n,r)&&We(e,r,n[r]);return e},Pi=(e,n)=>Ei(e,Ci(n));function Bi(e,n={}){var r,o;const a=(r=n.draggingElement)!=null?r:S,l=t.ref((o=n.initialValue)!=null?o:{x:0,y:0}),i=t.ref(),s=f=>n.pointerTypes?n.pointerTypes.includes(f.pointerType):!0,c=f=>{t.unref(n.preventDefault)&&f.preventDefault(),t.unref(n.stopPropagation)&&f.stopPropagation()},d=f=>{var p;if(!s(f)||t.unref(n.exact)&&f.target!==t.unref(e))return;const _=t.unref(e).getBoundingClientRect(),y={x:f.pageX-_.left,y:f.pageY-_.top};((p=n.onStart)==null?void 0:p.call(n,y,f))!==!1&&(i.value=y,c(f))},u=f=>{var p;!s(f)||!i.value||(l.value={x:f.pageX-i.value.x,y:f.pageY-i.value.y},(p=n.onMove)==null||p.call(n,l.value,f),c(f))},h=f=>{var p;!s(f)||!i.value||(i.value=void 0,(p=n.onEnd)==null||p.call(n,l.value,f),c(f))};return N&&(v(e,"pointerdown",d,!0),v(a,"pointermove",u,!0),v(a,"pointerup",h,!0)),Pi(Vi({},Pe(l)),{position:l,isDragging:t.computed(()=>!!i.value),style:t.computed(()=>`left:${l.value.x}px;top:${l.value.y}px;`)})}var Ke=Object.getOwnPropertySymbols,xi=Object.prototype.hasOwnProperty,Mi=Object.prototype.propertyIsEnumerable,zi=(e,n)=>{var r={};for(var o in e)xi.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ke)for(var o of Ke(e))n.indexOf(o)<0&&Mi.call(e,o)&&(r[o]=e[o]);return r};function qe(e,n,r={}){const o=r,{window:a=S}=o,l=zi(o,["window"]);let i;const s=a&&"ResizeObserver"in a,c=()=>{i&&(i.disconnect(),i=void 0)},d=t.watch(()=>x(e),h=>{c(),s&&a&&h&&(i=new ResizeObserver(n),i.observe(h,l))},{immediate:!0,flush:"post"}),u=()=>{c(),d()};return B(u),{isSupported:s,stop:u}}function Ni(e,n={}){const{reset:r=!0,windowResize:o=!0,windowScroll:a=!0,immediate:l=!0}=n,i=t.ref(0),s=t.ref(0),c=t.ref(0),d=t.ref(0),u=t.ref(0),h=t.ref(0),f=t.ref(0),p=t.ref(0);function _(){const y=x(e);if(!y){r&&(i.value=0,s.value=0,c.value=0,d.value=0,u.value=0,h.value=0,f.value=0,p.value=0);return}const $=y.getBoundingClientRect();i.value=$.height,s.value=$.bottom,c.value=$.left,d.value=$.right,u.value=$.top,h.value=$.width,f.value=$.x,p.value=$.y}return qe(e,_),t.watch(()=>x(e),y=>!y&&_()),a&&v("scroll",_,{passive:!0}),o&&v("resize",_,{passive:!0}),D(()=>{l&&_()}),{height:i,bottom:s,left:c,right:d,top:u,width:h,x:f,y:p,update:_}}function Ge(e,n={}){const{immediate:r=!0,window:o=S}=n,a=t.ref(!1);let l=null;function i(){!a.value||!o||(e(),l=o.requestAnimationFrame(i))}function s(){!a.value&&o&&(a.value=!0,i())}function c(){a.value=!1,l!=null&&o&&(o.cancelAnimationFrame(l),l=null)}return r&&s(),B(c),{isActive:a,pause:c,resume:s}}function Je(e,n={width:0,height:0},r={}){const o=t.ref(n.width),a=t.ref(n.height);return qe(e,([l])=>{o.value=l.contentRect.width,a.value=l.contentRect.height},r),t.watch(()=>x(e),l=>{o.value=l?n.width:0,a.value=l?n.height:0}),{width:o,height:a}}function Ii(e,{window:n=S,scrollTarget:r}={}){const o=t.ref(!1),a=()=>{if(!n)return;const l=n.document;if(!t.unref(e))o.value=!1;else{const i=t.unref(e).getBoundingClientRect();o.value=i.top<=(n.innerHeight||l.documentElement.clientHeight)&&i.left<=(n.innerWidth||l.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return D(a),n&&D(()=>v(t.unref(r)||n,"scroll",a,{capture:!1,passive:!0})),o}function Di(e={}){const{initialValue:n=""}=e,r=Boolean(typeof window!="undefined"&&"EyeDropper"in window),o=t.ref(n);async function a(l){if(!r)return;const s=await new window.EyeDropper().open(l);return o.value=s.sRGBHex,s}return{isSupported:r,sRGBHex:o,open:a}}const Xe=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]];function Li(e,n={}){const{document:r=Le,autoExit:o=!1}=n,a=e||(r==null?void 0:r.querySelector("html")),l=t.ref(!1);let i=!1,s=Xe[0];if(!r)i=!1;else for(const y of Xe)if(y[1]in r){s=y,i=!0;break}const[c,d,u,,h]=s;async function f(){!i||(r!=null&&r[u]&&await r[d](),l.value=!1)}async function p(){if(!i)return;await f();const y=x(a);y&&(await y[c](),l.value=!0)}async function _(){l.value?await f():await p()}return r&&v(r,h,()=>{l.value=!!(r!=null&&r[u])},!1),o&&B(f),{isSupported:i,isFullscreen:l,enter:p,exit:f,toggle:_}}function Ai(e={}){const{enableHighAccuracy:n=!0,maximumAge:r=3e4,timeout:o=27e3,navigator:a=Y}=e,l=a&&"geolocation"in a,i=t.ref(null),s=t.ref(null),c=t.ref({accuracy:0,latitude:1/0,longitude:1/0,altitude:null,altitudeAccuracy:null,heading:null,speed:null});function d(h){i.value=h.timestamp,c.value=h.coords,s.value=null}let u;return l&&(u=a.geolocation.watchPosition(d,h=>s.value=h,{enableHighAccuracy:n,maximumAge:r,timeout:o})),B(()=>{u&&a&&a.geolocation.clearWatch(u)}),{isSupported:l,coords:c,locatedAt:i,error:s}}const Ri=["mousemove","mousedown","resize","keydown","touchstart","wheel"],Ti=6e4;function ji(e=Ti,n={}){const{initialState:r=!1,listenForVisibilityChange:o=!0,events:a=Ri,window:l=S,eventFilter:i=Ee(50)}=n,s=t.ref(r),c=t.ref(F());let d;const u=A(i,()=>{s.value=!1,c.value=F(),clearTimeout(d),d=setTimeout(()=>s.value=!0,e)});if(l){const h=l.document;for(const f of a)v(l,f,u,{passive:!0});o&&v(h,"visibilitychange",()=>{h.hidden||u()})}return d=setTimeout(()=>s.value=!0,e),{idle:s,lastActive:c}}function Qe(e={}){const{type:n="page",touch:r=!0,resetOnTouchEnds:o=!1,initialValue:a={x:0,y:0},window:l=S,eventFilter:i}=e,s=t.ref(a.x),c=t.ref(a.y),d=t.ref(null),u=y=>{n==="page"?(s.value=y.pageX,c.value=y.pageY):n==="client"&&(s.value=y.clientX,c.value=y.clientY),d.value="mouse"},h=()=>{s.value=a.x,c.value=a.y},f=y=>{if(y.touches.length>0){const $=y.touches[0];n==="page"?(s.value=$.pageX,c.value=$.pageY):n==="client"&&(s.value=$.clientX,c.value=$.clientY),d.value="touch"}},p=y=>i===void 0?u(y):i(()=>u(y),{}),_=y=>i===void 0?f(y):i(()=>f(y),{});return l&&(v(l,"mousemove",p,{passive:!0}),v(l,"dragover",p,{passive:!0}),r&&(v(l,"touchstart",_,{passive:!0}),v(l,"touchmove",_,{passive:!0}),o&&v(l,"touchend",h,{passive:!0}))),{x:s,y:c,sourceType:d}}function Hi(e,n={}){const{handleOutside:r=!0,window:o=S}=n,{x:a,y:l,sourceType:i}=Qe(n),s=t.ref(e!=null?e:o==null?void 0:o.document.body),c=t.ref(0),d=t.ref(0),u=t.ref(0),h=t.ref(0),f=t.ref(0),p=t.ref(0),_=t.ref(!0);let y=()=>{};return o&&(y=t.watch([s,a,l],()=>{const $=x(s);if(!$)return;const{left:O,top:w,width:b,height:E}=$.getBoundingClientRect();u.value=O+o.pageXOffset,h.value=w+o.pageYOffset,f.value=E,p.value=b;const C=a.value-u.value,g=l.value-h.value;_.value=b===0||E===0||C<0||g<0||C>b||g>E,(r||!_.value)&&(c.value=C,d.value=g)},{immediate:!0})),{x:a,y:l,sourceType:i,elementX:c,elementY:d,elementPositionX:u,elementPositionY:h,elementHeight:f,elementWidth:p,isOutside:_,stop:y}}function Fi(e={}){const{touch:n=!0,drag:r=!0,initialValue:o=!1,window:a=S}=e,l=t.ref(o),i=t.ref(null);if(!a)return{pressed:l,sourceType:i};const s=u=>()=>{l.value=!0,i.value=u},c=()=>{l.value=!1,i.value=null},d=t.computed(()=>x(e.target)||a);return v(d,"mousedown",s("mouse"),{passive:!0}),v(a,"mouseleave",c,{passive:!0}),v(a,"mouseup",c,{passive:!0}),r&&(v(d,"dragstart",s("mouse"),{passive:!0}),v(a,"drop",c,{passive:!0}),v(a,"dragend",c,{passive:!0})),n&&(v(d,"touchstart",s("touch"),{passive:!0}),v(a,"touchend",c,{passive:!0}),v(a,"touchcancel",c,{passive:!0})),{pressed:l,sourceType:i}}function Ze(e={}){const{window:n=S}=e,r=n==null?void 0:n.navigator,o=Boolean(r&&"connection"in r),a=t.ref(!0),l=t.ref(!1),i=t.ref(void 0),s=t.ref(void 0),c=t.ref(void 0),d=t.ref(void 0),u=t.ref(void 0),h=t.ref(void 0),f=t.ref("unknown"),p=o&&r.connection;function _(){!r||(a.value=r.onLine,i.value=a.value?void 0:Date.now(),s.value=a.value?Date.now():void 0,p&&(c.value=p.downlink,d.value=p.downlinkMax,h.value=p.effectiveType,u.value=p.rtt,l.value=p.saveData,f.value=p.type))}return n&&(v(n,"offline",()=>{a.value=!1,i.value=Date.now()}),v(n,"online",()=>{a.value=!0,s.value=Date.now()})),p&&v(p,"change",_,!1),_(),{isSupported:o,isOnline:a,saveData:l,offlineAt:i,onlineAt:s,downlink:c,downlinkMax:d,effectiveType:h,rtt:u,type:f}}var Ui=Object.defineProperty,et=Object.getOwnPropertySymbols,Yi=Object.prototype.hasOwnProperty,Wi=Object.prototype.propertyIsEnumerable,tt=(e,n,r)=>n in e?Ui(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Ki=(e,n)=>{for(var r in n||(n={}))Yi.call(n,r)&&tt(e,r,n[r]);if(et)for(var r of et(n))Wi.call(n,r)&&tt(e,r,n[r]);return e};function nt(e={}){const{controls:n=!1,interval:r="requestAnimationFrame"}=e,o=t.ref(new Date),a=()=>o.value=new Date,l=r==="requestAnimationFrame"?Ge(a,{immediate:!0}):xe(a,r,{immediate:!0});return n?Ki({now:o},l):o}function qi(e){const n=t.ref(),r=()=>{n.value&&URL.revokeObjectURL(n.value),n.value=void 0};return t.watch(()=>t.unref(e),o=>{r(),o&&(n.value=URL.createObjectURL(o))},{immediate:!0}),B(r),t.readonly(n)}function Gi(e){const{total:n=1/0,pageSize:r=10,page:o=1,onPageChange:a=V,onPageSizeChange:l=V,onPageCountChange:i=V}=e,s=Ae(r,1,1/0),c=t.computed(()=>Math.ceil(t.unref(n)/t.unref(s))),d=Ae(o,1,c),u=t.computed(()=>d.value===1),h=t.computed(()=>d.value===c.value);t.isRef(o)&&Se(o,d),t.isRef(r)&&Se(r,s);function f(){d.value--}function p(){d.value++}const _={currentPage:d,currentPageSize:s,pageCount:c,isFirstPage:u,isLastPage:h,prev:f,next:p};return t.watch(d,()=>{a(t.reactive(_))}),t.watch(s,()=>{l(t.reactive(_))}),t.watch(c,()=>{i(t.reactive(_))}),_}function Ji(e={}){const{isOnline:n}=Ze(e);return n}function Xi(e={}){const{window:n=S}=e,r=t.ref(!1),o=a=>{if(!n)return;a=a||n.event;const l=a.relatedTarget||a.toElement;r.value=!l};return n&&(v(n,"mouseout",o,{passive:!0}),v(n.document,"mouseleave",o,{passive:!0}),v(n.document,"mouseenter",o,{passive:!0})),r}var Qi=Object.defineProperty,Zi=Object.defineProperties,es=Object.getOwnPropertyDescriptors,rt=Object.getOwnPropertySymbols,ts=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,ot=(e,n,r)=>n in e?Qi(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,rs=(e,n)=>{for(var r in n||(n={}))ts.call(n,r)&&ot(e,r,n[r]);if(rt)for(var r of rt(n))ns.call(n,r)&&ot(e,r,n[r]);return e},os=(e,n)=>Zi(e,es(n));const at={x:0,y:0,pointerId:0,pressure:0,tiltX:0,tiltY:0,width:0,height:0,twist:0,pointerType:null},as=Object.keys(at);function ls(e={}){const{target:n=S}=e,r=t.ref(!1),o=t.ref(e.initialValue||{});Object.assign(o.value,at,o.value);const a=l=>{r.value=!0,!(e.pointerTypes&&!e.pointerTypes.includes(l.pointerType))&&(o.value=Bl(l,as,!1))};return n&&(v(n,"pointerdown",a,{passive:!0}),v(n,"pointermove",a,{passive:!0}),v(n,"pointerleave",()=>r.value=!1,{passive:!0})),os(rs({},Pe(o)),{isInside:r})}var lt;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(lt||(lt={}));function is(e){const n=R("(prefers-color-scheme: light)",e),r=R("(prefers-color-scheme: dark)",e);return t.computed(()=>r.value?"dark":n.value?"light":"no-preference")}function ss(e={}){const{window:n=S}=e;if(!n)return t.ref(["en"]);const r=n.navigator,o=t.ref(r.languages);return v(n,"languagechange",()=>{o.value=r.languages}),o}var cs=Object.defineProperty,W=Object.getOwnPropertySymbols,it=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,ct=(e,n,r)=>n in e?cs(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,ds=(e,n)=>{for(var r in n||(n={}))it.call(n,r)&&ct(e,r,n[r]);if(W)for(var r of W(n))st.call(n,r)&&ct(e,r,n[r]);return e},us=(e,n)=>{var r={};for(var o in e)it.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&W)for(var o of W(e))n.indexOf(o)<0&&st.call(e,o)&&(r[o]=e[o]);return r};const dt=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:1/0,value:31536e6,name:"year"}],fs={justNow:"just now",past:e=>e.match(/\d/)?`${e} ago`:e,future:e=>e.match(/\d/)?`in ${e}`:e,month:(e,n)=>e===1?n?"last month":"next month":`${e} month${e>1?"s":""}`,year:(e,n)=>e===1?n?"last year":"next year":`${e} year${e>1?"s":""}`,day:(e,n)=>e===1?n?"yesterday":"tomorrow":`${e} day${e>1?"s":""}`,week:(e,n)=>e===1?n?"last week":"next week":`${e} week${e>1?"s":""}`,hour:e=>`${e} hour${e>1?"s":""}`,minute:e=>`${e} minute${e>1?"s":""}`,second:e=>`${e} second${e>1?"s":""}`},ps=e=>e.toISOString().slice(0,10);function ms(e,n={}){const{controls:r=!1,max:o,updateInterval:a=3e4,messages:l=fs,fullDateFormatter:i=ps}=n,{abs:s,round:c}=Math,d=nt({interval:a,controls:!0}),{now:u}=d,h=us(d,["now"]);function f($,O){var w;const b=+O-+$,E=s(b);if(E<6e4)return l.justNow;if(typeof o=="number"&&E>o)return i(new Date($));if(typeof o=="string"){const C=(w=dt.find(g=>g.name===o))==null?void 0:w.max;if(C&&E>C)return i(new Date($))}for(const C of dt)if(E<C.max)return _(b,C)}function p($,O,w){const b=l[$];return typeof b=="function"?b(O,w):b.replace("{0}",O.toString())}function _($,O){const w=c(s($)/O.value),b=$>0,E=p(O.name,w,b);return p(b?"past":"future",E,b)}const y=t.computed(()=>f(new Date(t.unref(e)),t.unref(u.value)));return r?ds({timeAgo:y},h):y}var hs=Object.defineProperty,ut=Object.getOwnPropertySymbols,_s=Object.prototype.hasOwnProperty,gs=Object.prototype.propertyIsEnumerable,ft=(e,n,r)=>n in e?hs(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,ys=(e,n)=>{for(var r in n||(n={}))_s.call(n,r)&&ft(e,r,n[r]);if(ut)for(var r of ut(n))gs.call(n,r)&&ft(e,r,n[r]);return e};function $s(e={}){const{controls:n=!1,offset:r=0,immediate:o=!0,interval:a="requestAnimationFrame"}=e,l=t.ref(F()+r),i=()=>l.value=F()+r,s=a==="requestAnimationFrame"?Ge(i,{immediate:o}):xe(i,a,{immediate:o});return n?ys({timestamp:l},s):l}function vs(e,n){const r=t.ref(),o=Je(r),a=t.ref([]),l=t.shallowRef(e),i=t.ref({start:0,end:10}),{itemHeight:s,overscan:c=5}=n,d=w=>{if(typeof s=="number")return Math.ceil(w/s);const{start:b=0}=i.value;let E=0,C=0;for(let g=b;g<l.value.length;g++)if(E+=s(g),E>=w){C=g;break}return C-b},u=w=>{if(typeof s=="number")return Math.floor(w/s)+1;let b=0,E=0;for(let C=0;C<l.value.length;C++)if(b+=s(C),b>=w){E=C;break}return E+1},h=()=>{const w=r.value;if(w){const b=u(w.scrollTop),E=d(w.clientHeight),C=b-c,g=b+E+c;i.value={start:C<0?0:C,end:g>l.value.length?l.value.length:g},a.value=l.value.slice(i.value.start,i.value.end).map((k,Cd)=>({data:k,index:Cd+i.value.start}))}};t.watch([o.width,o.height,e],()=>{h()});const f=t.computed(()=>typeof s=="number"?l.value.length*s:l.value.reduce((w,b,E)=>w+s(E),0)),p=w=>typeof s=="number"?w*s:l.value.slice(0,w).reduce((E,C,g)=>E+s(g),0),_=w=>{r.value&&(r.value.scrollTop=p(w),h())},y=t.computed(()=>p(i.value.start)),$=t.computed(()=>({style:{width:"100%",height:`${f.value-y.value}px`,marginTop:`${y.value}px`}}));return{list:a,scrollTo:_,containerProps:{ref:r,onScroll:()=>{h()},style:{overflowY:"auto"}},wrapperProps:$}}function ws({window:e=S}={}){if(!e)return t.ref(!1);const n=t.ref(e.document.hasFocus());return v(e,"blur",()=>{n.value=!1}),v(e,"focus",()=>{n.value=!0}),n}function bs(e={}){const{window:n=S,initialWidth:r=1/0,initialHeight:o=1/0,listenOrientation:a=!0}=e,l=t.ref(r),i=t.ref(o),s=()=>{n&&(l.value=n.innerWidth,i.value=n.innerHeight)};return s(),D(s),v("resize",s,{passive:!0}),a&&v("orientationchange",s,{passive:!0}),{width:l,height:i}}t.defineComponent({name:"OnClickOutside",props:["as"],emits:["trigger"],setup(e,{slots:n,emit:r}){const o=t.ref();return Jl(o,a=>{r("trigger",a)}),()=>{if(n.default)return t.h(e.as||"div",{ref:o},n.default())}}});function L(e){var n;const r=t.unref(e);return(n=r==null?void 0:r.$el)!=null?n:r}const M=N?window:void 0;function z(...e){let n,r,o,a;if(we(e[0])?([r,o,a]=e,n=M):[n,r,o,a]=e,!n)return V;let l=V;const i=t.watch(()=>L(n),c=>{l(),c&&(c.addEventListener(r,o,a),l=()=>{c.removeEventListener(r,o,a),l=V})},{immediate:!0,flush:"post"}),s=()=>{i(),l()};return B(s),s}const Os=e=>typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):e?()=>!0:()=>!1;function pt(e,n,r={}){const{target:o=M,eventName:a="keydown",passive:l=!1}=r,i=Os(e);return z(o,a,c=>{i(c)&&n(c)},l)}var Es=Object.defineProperty,mt=Object.getOwnPropertySymbols,Cs=Object.prototype.hasOwnProperty,Ss=Object.prototype.propertyIsEnumerable,ht=(e,n,r)=>n in e?Es(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,ks=(e,n)=>{for(var r in n||(n={}))Cs.call(n,r)&&ht(e,r,n[r]);if(mt)for(var r of mt(n))Ss.call(n,r)&&ht(e,r,n[r]);return e};I.mounted+"";const Vs=500;function oe(e,n,r){var o,a;const l=t.computed(()=>L(e));let i=null;function s(){i!=null&&(clearTimeout(i),i=null)}function c(u){var h,f,p,_;((h=r==null?void 0:r.modifiers)==null?void 0:h.self)&&u.target!==l.value||(s(),(f=r==null?void 0:r.modifiers)!=null&&f.prevent&&u.preventDefault(),(p=r==null?void 0:r.modifiers)!=null&&p.stop&&u.stopPropagation(),i=setTimeout(()=>n(u),(_=r==null?void 0:r.delay)!=null?_:Vs))}const d={capture:(o=r==null?void 0:r.modifiers)==null?void 0:o.capture,once:(a=r==null?void 0:r.modifiers)==null?void 0:a.once};z(l,"pointerdown",c,d),z(l,"pointerup",s,d),z(l,"pointerleave",s,d)}t.defineComponent({name:"OnLongPress",props:["as","options"],emits:["trigger"],setup(e,{slots:n,emit:r}){const o=t.ref();return oe(o,a=>{r("trigger",a)},e.options),()=>{if(n.default)return t.h(e.as||"div",{ref:o},n.default())}}}),I.mounted+"",t.defineComponent({name:"UseActiveElement",setup(e,{slots:n}){const r=t.reactive({element:Xl()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseBattery",setup(e,{slots:n}){const r=t.reactive(Ql(e));return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseBrowserLocation",setup(e,{slots:n}){const r=t.reactive(Zl());return()=>{if(n.default)return n.default(r)}}});const ae=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},le="__vueuse_ssr_handlers__";ae[le]=ae[le]||{};const Ps=ae[le];function _t(e,n){return Ps[e]||n}function Bs(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"||Array.isArray(e)?"object":Number.isNaN(e)?"any":"number"}const xs={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}};function Ms(e,n,r,o={}){var a;const{flush:l="pre",deep:i=!0,listenToStorageChanges:s=!0,writeDefaults:c=!0,shallow:d,window:u=M,eventFilter:h,onError:f=g=>{console.error(g)}}=o,p=(d?t.shallowRef:t.ref)(n);if(!r)try{r=_t("getDefaultStorage",()=>{var g;return(g=M)==null?void 0:g.localStorage})()}catch(g){f(g)}if(!r)return p;const _=t.unref(n),y=Bs(_),$=(a=o.serializer)!=null?a:xs[y],{pause:O,resume:w}=De(p,()=>b(p.value),{flush:l,deep:i,eventFilter:h});return u&&s&&z(u,"storage",C),C(),p;function b(g){try{g==null?r.removeItem(e):r.setItem(e,$.write(g))}catch(k){f(k)}}function E(g){if(!(g&&g.key!==e)){O();try{const k=g?g.newValue:r.getItem(e);return k==null?(c&&_!==null&&r.setItem(e,$.write(_)),_):typeof k!="string"?k:$.read(k)}catch(k){f(k)}finally{w()}}}function C(g){g&&g.key!==e||(p.value=E(g))}}function zs(e,n={}){const{window:r=M}=n,o=Boolean(r&&"matchMedia"in r&&typeof r.matchMedia=="function");let a;const l=t.ref(!1),i=()=>{!o||(a||(a=r.matchMedia(e)),l.value=a.matches)};return Be(()=>{i(),a&&("addEventListener"in a?a.addEventListener("change",i):a.addListener(i),B(()=>{"removeEventListener"in a?a.removeEventListener("change",i):a.removeListener(i)}))}),l}function Ns(e){return zs("(prefers-color-scheme: dark)",e)}var Is=Object.defineProperty,gt=Object.getOwnPropertySymbols,Ds=Object.prototype.hasOwnProperty,Ls=Object.prototype.propertyIsEnumerable,yt=(e,n,r)=>n in e?Is(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,As=(e,n)=>{for(var r in n||(n={}))Ds.call(n,r)&&yt(e,r,n[r]);if(gt)for(var r of gt(n))Ls.call(n,r)&&yt(e,r,n[r]);return e};function Rs(e={}){const{selector:n="html",attribute:r="class",window:o=M,storage:a,storageKey:l="vueuse-color-scheme",listenToStorageChanges:i=!0,storageRef:s,emitAuto:c}=e,d=As({auto:"",light:"light",dark:"dark"},e.modes||{}),u=Ns({window:o}),h=t.computed(()=>u.value?"dark":"light"),f=s||(l==null?t.ref("auto"):Ms(l,"auto",a,{window:o,listenToStorageChanges:i})),p=t.computed({get(){return f.value==="auto"&&!c?h.value:f.value},set(O){f.value=O}}),_=_t("updateHTMLAttrs",(O,w,b)=>{const E=o==null?void 0:o.document.querySelector(O);if(!!E)if(w==="class"){const C=b.split(/\s/g);Object.values(d).flatMap(g=>(g||"").split(/\s/g)).filter(Boolean).forEach(g=>{C.includes(g)?E.classList.add(g):E.classList.remove(g)})}else E.setAttribute(w,b)});function y(O){var w;const b=O==="auto"?h.value:O;_(n,r,(w=d[b])!=null?w:b)}function $(O){e.onChanged?e.onChanged(O,y):y(O)}return t.watch(p,$,{flush:"post",immediate:!0}),D(()=>$(p.value)),p}t.defineComponent({name:"UseColorMode",props:["selector","attribute","modes","onChanged","storageKey","storage","emitAuto"],setup(e,{slots:n}){const r=Rs(e),o=t.reactive({mode:r});return()=>{if(n.default)return n.default(o)}}}),t.defineComponent({name:"UseDark",props:["selector","attribute","valueDark","valueLight","onChanged","storageKey","storage"],setup(e,{slots:n}){const r=hi(e),o=t.reactive({isDark:r,toggleDark:Rl(r)});return()=>{if(n.default)return n.default(o)}}}),t.defineComponent({name:"UseDeviceMotion",setup(e,{slots:n}){const r=t.reactive(_i());return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseDeviceOrientation",setup(e,{slots:n}){const r=t.reactive(gi());return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseDevicePixelRatio",setup(e,{slots:n}){const r=t.reactive({pixelRatio:$i()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseDevicesList",props:["onUpdated","requestPermissions","constraints"],setup(e,{slots:n}){const r=t.reactive(wi(e));return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseDocumentVisibility",setup(e,{slots:n}){const r=t.reactive({visibility:bi()});return()=>{if(n.default)return n.default(r)}}});var Ts=Object.defineProperty,js=Object.defineProperties,Hs=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertySymbols,Fs=Object.prototype.hasOwnProperty,Us=Object.prototype.propertyIsEnumerable,vt=(e,n,r)=>n in e?Ts(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Ys=(e,n)=>{for(var r in n||(n={}))Fs.call(n,r)&&vt(e,r,n[r]);if($t)for(var r of $t(n))Us.call(n,r)&&vt(e,r,n[r]);return e},Ws=(e,n)=>js(e,Hs(n));t.defineComponent({name:"UseDraggable",props:["storageKey","storageType","initialValue","exact","preventDefault","stopPropagation","pointerTypes","as"],setup(e,{slots:n}){const r=t.ref(),o=e.storageKey?Te(e.storageKey,t.unref(e.initialValue)||{x:0,y:0},N?e.storageType==="session"?sessionStorage:localStorage:void 0):e.initialValue||{x:0,y:0},a=t.reactive(Bi(r,Ws(Ys({},e),{initialValue:o})));return()=>{if(n.default)return t.h(e.as||"div",{ref:r,style:`touch-action:none;${a.style}`},n.default(a))}}}),t.defineComponent({name:"UseElementBounding",props:["box","as"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive(Ni(r));return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}});function Ks(e){const n=t.ref(!1);return z(e,"mouseenter",()=>n.value=!0),z(e,"mouseleave",()=>n.value=!1),n}I.mounted+"",t.defineComponent({name:"UseElementSize",props:["width","height","box"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive(Je(r,{width:e.width,height:e.height},{box:e.box}));return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}});var wt=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,Js=(e,n)=>{var r={};for(var o in e)qs.call(e,o)&&n.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&wt)for(var o of wt(e))n.indexOf(o)<0&&Gs.call(e,o)&&(r[o]=e[o]);return r};function Xs(e,n,r={}){const o=r,{window:a=M}=o,l=Js(o,["window"]);let i;const s=a&&"ResizeObserver"in a,c=()=>{i&&(i.disconnect(),i=void 0)},d=t.watch(()=>L(e),h=>{c(),s&&a&&h&&(i=new ResizeObserver(n),i.observe(h,l))},{immediate:!0,flush:"post"}),u=()=>{c(),d()};return B(u),{isSupported:s,stop:u}}function Qs(e,n={width:0,height:0},r={}){const o=t.ref(n.width),a=t.ref(n.height);return Xs(e,([l])=>{o.value=l.contentRect.width,a.value=l.contentRect.height},r),t.watch(()=>L(e),l=>{o.value=l?n.width:0,a.value=l?n.height:0}),{width:o,height:a}}I.mounted+"",t.defineComponent({name:"UseElementVisibility",props:["as"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive({isVisible:Ii(r)});return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}});function bt(e,{window:n=M,scrollTarget:r}={}){const o=t.ref(!1),a=()=>{if(!n)return;const l=n.document;if(!t.unref(e))o.value=!1;else{const i=t.unref(e).getBoundingClientRect();o.value=i.top<=(n.innerHeight||l.documentElement.clientHeight)&&i.left<=(n.innerWidth||l.documentElement.clientWidth)&&i.bottom>=0&&i.right>=0}};return D(a),n&&D(()=>z(t.unref(r)||n,"scroll",a,{capture:!1,passive:!0})),o}I.mounted+"",t.defineComponent({name:"UseEyeDropper",props:{sRGBHex:String},setup(e,{slots:n}){const r=t.reactive(Di());return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseFullscreen",props:["as"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive(Li(r));return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}}),t.defineComponent({name:"UseGeolocation",props:["enableHighAccuracy","maximumAge","timeout","navigator"],setup(e,{slots:n}){const r=t.reactive(Ai(e));return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseIdle",props:["timeout","events","listenForVisibilityChange","initialState"],setup(e,{slots:n}){const r=t.reactive(ji(e.timeout,e));return()=>{if(n.default)return n.default(r)}}});function Zs(e,n,r){const{immediate:o=!0,delay:a=0,onError:l=V,resetOnExecute:i=!0,shallow:s=!0}=r!=null?r:{},c=s?t.shallowRef(n):t.ref(n),d=t.ref(!1),u=t.ref(!1),h=t.ref(void 0);async function f(p=0,..._){i&&(c.value=n),h.value=void 0,d.value=!1,u.value=!0,p>0&&await Vl(p);const y=typeof e=="function"?e(..._):e;try{const $=await y;c.value=$,d.value=!0}catch($){h.value=$,l($)}finally{u.value=!1}return c.value}return o&&f(a),{state:c,isReady:d,isLoading:u,error:h,execute:f}}var ec=Object.defineProperty,Ot=Object.getOwnPropertySymbols,tc=Object.prototype.hasOwnProperty,nc=Object.prototype.propertyIsEnumerable,Et=(e,n,r)=>n in e?ec(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,rc=(e,n)=>{for(var r in n||(n={}))tc.call(n,r)&&Et(e,r,n[r]);if(Ot)for(var r of Ot(n))nc.call(n,r)&&Et(e,r,n[r]);return e};async function oc(e){return new Promise((n,r)=>{const o=new Image,{src:a,srcset:l,sizes:i}=e;o.src=a,l&&(o.srcset=l),i&&(o.sizes=i),o.onload=()=>n(o),o.onerror=r})}const ac=(e,n={})=>{const r=Zs(()=>oc(t.unref(e)),void 0,rc({resetOnExecute:!0},n));return t.watch(()=>t.unref(e),()=>r.execute(n.delay),{deep:!0}),r};t.defineComponent({name:"UseImage",props:["src","srcset","sizes","as"],setup(e,{slots:n}){const r=t.reactive(ac(e));return()=>r.isLoading&&n.loading?n.loading(r):r.error&&n.error?n.error(r.error):n.default?n.default(r):t.h(e.as||"img",e)}});function ie(e,n={}){const{throttle:r=0,idle:o=200,onStop:a=V,onScroll:l=V,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:s={capture:!1,passive:!0}}=n,c=t.ref(0),d=t.ref(0),u=t.ref(!1),h=t.reactive({left:!0,right:!1,top:!0,bottom:!1}),f=t.reactive({left:!1,right:!1,top:!1,bottom:!1});if(e){const p=Ce(y=>{u.value=!1,f.left=!1,f.right=!1,f.top=!1,f.bottom=!1,a(y)},r+o),_=y=>{const $=y.target===document?y.target.documentElement:y.target,O=$.scrollLeft;f.left=O<c.value,f.right=O>c.value,h.left=O<=0+(i.left||0),h.right=O+$.clientWidth>=$.scrollWidth-(i.right||0),c.value=O;let w=$.scrollTop;y.target===document&&!w&&(w=document.body.scrollTop),f.top=w<d.value,f.bottom=w>d.value,h.top=w<=0+(i.top||0),h.bottom=w+$.clientHeight>=$.scrollHeight-(i.bottom||0),d.value=w,u.value=!0,p(y),l(y)};z(e,"scroll",r?xl(_,r):_,s)}return{x:c,y:d,isScrolling:u,arrivedState:h,directions:f}}var lc=Object.defineProperty,ic=Object.defineProperties,sc=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,cc=Object.prototype.hasOwnProperty,dc=Object.prototype.propertyIsEnumerable,St=(e,n,r)=>n in e?lc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,kt=(e,n)=>{for(var r in n||(n={}))cc.call(n,r)&&St(e,r,n[r]);if(Ct)for(var r of Ct(n))dc.call(n,r)&&St(e,r,n[r]);return e},uc=(e,n)=>ic(e,sc(n));function Vt(e,n,r={}){var o,a;const l=(o=r.direction)!=null?o:"bottom",i=t.reactive(ie(e,uc(kt({},r),{offset:kt({[l]:(a=r.distance)!=null?a:0},r.offset)})));t.watch(()=>i.arrivedState[l],async s=>{var c,d;if(s){const u=t.unref(e),h={height:(c=u==null?void 0:u.scrollHeight)!=null?c:0,width:(d=u==null?void 0:u.scrollWidth)!=null?d:0};await n(i),r.preserveScrollPosition&&u&&t.nextTick(()=>{u.scrollTo({top:u.scrollHeight-h.height,left:u.scrollWidth-h.width})})}})}I.mounted+"";function Pt(e,n,r={}){const{root:o,rootMargin:a="0px",threshold:l=.1,window:i=M}=r,s=i&&"IntersectionObserver"in i;let c=V;const d=s?t.watch(()=>({el:L(e),root:L(o)}),({el:h,root:f})=>{if(c(),!h)return;const p=new IntersectionObserver(n,{root:f,rootMargin:a,threshold:l});p.observe(h),c=()=>{p.disconnect(),c=V}},{immediate:!0,flush:"post"}):V,u=()=>{c(),d()};return B(u),{isSupported:s,stop:u}}I.mounted+"",t.defineComponent({name:"UseMouse",props:["touch","resetOnTouchEnds","initialValue"],setup(e,{slots:n}){const r=t.reactive(Qe(e));return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseMouseElement",props:["handleOutside","as"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive(Hi(r,e));return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}});var fc=Object.defineProperty,pc=Object.defineProperties,mc=Object.getOwnPropertyDescriptors,Bt=Object.getOwnPropertySymbols,hc=Object.prototype.hasOwnProperty,_c=Object.prototype.propertyIsEnumerable,xt=(e,n,r)=>n in e?fc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,gc=(e,n)=>{for(var r in n||(n={}))hc.call(n,r)&&xt(e,r,n[r]);if(Bt)for(var r of Bt(n))_c.call(n,r)&&xt(e,r,n[r]);return e},yc=(e,n)=>pc(e,mc(n));t.defineComponent({name:"UseMousePressed",props:["touch","initialValue","as"],setup(e,{slots:n}){const r=t.ref(),o=t.reactive(Fi(yc(gc({},e),{target:r})));return()=>{if(n.default)return t.h(e.as||"div",{ref:r},n.default(o))}}}),t.defineComponent({name:"UseNetwork",setup(e,{slots:n}){const r=t.reactive(Ze());return()=>{if(n.default)return n.default(r)}}});var $c=Object.defineProperty,vc=Object.defineProperties,wc=Object.getOwnPropertyDescriptors,Mt=Object.getOwnPropertySymbols,bc=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,zt=(e,n,r)=>n in e?$c(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Ec=(e,n)=>{for(var r in n||(n={}))bc.call(n,r)&&zt(e,r,n[r]);if(Mt)for(var r of Mt(n))Oc.call(n,r)&&zt(e,r,n[r]);return e},Cc=(e,n)=>vc(e,wc(n));t.defineComponent({name:"UseNow",props:["interval"],setup(e,{slots:n}){const r=t.reactive(nt(Cc(Ec({},e),{controls:!0})));return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseObjectUrl",props:["object"],setup(e,{slots:n}){const r=t.toRef(e,"object"),o=qi(r);return()=>{if(n.default&&o.value)return n.default(o)}}});var Sc=Object.defineProperty,kc=Object.defineProperties,Vc=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,Pc=Object.prototype.hasOwnProperty,Bc=Object.prototype.propertyIsEnumerable,It=(e,n,r)=>n in e?Sc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,xc=(e,n)=>{for(var r in n||(n={}))Pc.call(n,r)&&It(e,r,n[r]);if(Nt)for(var r of Nt(n))Bc.call(n,r)&&It(e,r,n[r]);return e},Mc=(e,n)=>kc(e,Vc(n));const zc=t.defineComponent({name:"UseOffsetPagination",props:["total","page","pageSize","onPageChange","onPageSizeChange","onPageCountChange"],emits:["page-change","page-size-change","page-count-change"],setup(e,{slots:n,emit:r}){const o=t.reactive(Gi(Mc(xc({},e),{onPageChange(...a){var l;(l=e.onPageChange)==null||l.call(e,...a),r("page-change",...a)},onPageSizeChange(...a){var l;(l=e.onPageSizeChange)==null||l.call(e,...a),r("page-size-change",...a)},onPageCountChange(...a){var l;(l=e.onPageCountChange)==null||l.call(e,...a),r("page-count-change",...a)}})));return()=>{if(n.default)return n.default(o)}}});t.defineComponent({name:"UseOnline",setup(e,{slots:n}){const r=t.reactive({isOnline:Ji()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UsePageLeave",setup(e,{slots:n}){const r=t.reactive({isLeft:Xi()});return()=>{if(n.default)return n.default(r)}}});var Nc=Object.defineProperty,Ic=Object.defineProperties,Dc=Object.getOwnPropertyDescriptors,Dt=Object.getOwnPropertySymbols,Lc=Object.prototype.hasOwnProperty,Ac=Object.prototype.propertyIsEnumerable,Lt=(e,n,r)=>n in e?Nc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Rc=(e,n)=>{for(var r in n||(n={}))Lc.call(n,r)&&Lt(e,r,n[r]);if(Dt)for(var r of Dt(n))Ac.call(n,r)&&Lt(e,r,n[r]);return e},Tc=(e,n)=>Ic(e,Dc(n));t.defineComponent({name:"UsePointer",props:["pointerTypes","initialValue","target"],setup(e,{slots:n}){const r=t.ref(null),o=t.reactive(ls(Tc(Rc({},e),{target:e.target==="self"?r:M})));return()=>{if(n.default)return n.default(o,{ref:r})}}}),t.defineComponent({name:"UsePreferredColorScheme",setup(e,{slots:n}){const r=t.reactive({colorScheme:is()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UsePreferredDark",setup(e,{slots:n}){const r=t.reactive({prefersDark:re()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UsePreferredLanguages",setup(e,{slots:n}){const r=t.reactive({languages:ss()});return()=>{if(n.default)return n.default(r)}}});function K(e,n,{window:r=M,initialValue:o=""}={}){const a=t.ref(o),l=t.computed(()=>{var i;return L(n)||((i=r==null?void 0:r.document)==null?void 0:i.documentElement)});return t.watch([l,()=>t.unref(e)],([i,s])=>{var c;if(i&&r){const d=(c=r.getComputedStyle(i).getPropertyValue(s))==null?void 0:c.trim();a.value=d||o}},{immediate:!0}),t.watch(a,i=>{var s;(s=l.value)!=null&&s.style&&l.value.style.setProperty(t.unref(e),i)}),a}const At="--vueuse-safe-area-top",Rt="--vueuse-safe-area-right",Tt="--vueuse-safe-area-bottom",jt="--vueuse-safe-area-left";function jc(){const e=t.ref(""),n=t.ref(""),r=t.ref(""),o=t.ref("");if(N){const l=K(At),i=K(Rt),s=K(Tt),c=K(jt);l.value="env(safe-area-inset-top, 0px)",i.value="env(safe-area-inset-right, 0px)",s.value="env(safe-area-inset-bottom, 0px)",c.value="env(safe-area-inset-left, 0px)",a(),z("resize",Ce(a))}function a(){e.value=q(At),n.value=q(Rt),r.value=q(Tt),o.value=q(jt)}return{top:e,right:n,bottom:r,left:o,update:a}}function q(e){return getComputedStyle(document.documentElement).getPropertyValue(e)}t.defineComponent({name:"UseScreenSafeArea",props:{top:Boolean,right:Boolean,bottom:Boolean,left:Boolean},setup(e,{slots:n}){const{top:r,right:o,bottom:a,left:l}=jc();return()=>{if(n.default)return t.h("div",{style:{paddingTop:e.top?r.value:"",paddingRight:e.right?o.value:"",paddingBottom:e.bottom?a.value:"",paddingLeft:e.left?l.value:"",boxSizing:"border-box",maxHeight:"100vh",maxWidth:"100vw",overflow:"auto"}},n.default())}}});var Hc=Object.defineProperty,Fc=Object.defineProperties,Uc=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,Yc=Object.prototype.hasOwnProperty,Wc=Object.prototype.propertyIsEnumerable,Ft=(e,n,r)=>n in e?Hc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Kc=(e,n)=>{for(var r in n||(n={}))Yc.call(n,r)&&Ft(e,r,n[r]);if(Ht)for(var r of Ht(n))Wc.call(n,r)&&Ft(e,r,n[r]);return e},qc=(e,n)=>Fc(e,Uc(n));I.mounted+"";function Gc(e){const n=e||window.event;return n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}function Jc(e,n=!1){const r=t.ref(n);let o=null,a;t.watch(()=>t.unref(e),s=>{if(s){const c=s;a=c.style.overflow,r.value&&(c.style.overflow="hidden")}},{immediate:!0});const l=()=>{const s=t.unref(e);!s||r.value||(Oe&&(o=z(s,"touchmove",Gc,{passive:!1})),s.style.overflow="hidden",r.value=!0)},i=()=>{const s=t.unref(e);!s||!r.value||(Oe&&(o==null||o()),s.style.overflow=a,r.value=!1)};return B(i),t.computed({get(){return r.value},set(s){s?l():i()}})}(()=>{let e=!1;const n=t.ref(!1);return(r,o)=>{if(n.value=o.value,e)return;e=!0;const a=Jc(r,o.value);t.watch(n,l=>a.value=l)}})();var Xc=Object.defineProperty,Qc=Object.defineProperties,Zc=Object.getOwnPropertyDescriptors,Ut=Object.getOwnPropertySymbols,ed=Object.prototype.hasOwnProperty,td=Object.prototype.propertyIsEnumerable,Yt=(e,n,r)=>n in e?Xc(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,nd=(e,n)=>{for(var r in n||(n={}))ed.call(n,r)&&Yt(e,r,n[r]);if(Ut)for(var r of Ut(n))td.call(n,r)&&Yt(e,r,n[r]);return e},rd=(e,n)=>Qc(e,Zc(n));t.defineComponent({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages"],setup(e,{slots:n}){const r=t.toRef(e,"time"),o=t.reactive(ms(r,rd(nd({},e),{controls:!0})));return()=>{if(n.default)return n.default(o)}}});var od=Object.defineProperty,ad=Object.defineProperties,ld=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,id=Object.prototype.hasOwnProperty,sd=Object.prototype.propertyIsEnumerable,Kt=(e,n,r)=>n in e?od(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,cd=(e,n)=>{for(var r in n||(n={}))id.call(n,r)&&Kt(e,r,n[r]);if(Wt)for(var r of Wt(n))sd.call(n,r)&&Kt(e,r,n[r]);return e},dd=(e,n)=>ad(e,ld(n));t.defineComponent({name:"UseTimestamp",props:["immediate","interval","offset"],setup(e,{slots:n}){const r=t.reactive($s(dd(cd({},e),{controls:!0})));return()=>{if(n.default)return n.default(r)}}});var ud=Object.defineProperty,qt=Object.getOwnPropertySymbols,fd=Object.prototype.hasOwnProperty,pd=Object.prototype.propertyIsEnumerable,Gt=(e,n,r)=>n in e?ud(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,Jt=(e,n)=>{for(var r in n||(n={}))fd.call(n,r)&&Gt(e,r,n[r]);if(qt)for(var r of qt(n))pd.call(n,r)&&Gt(e,r,n[r]);return e};t.defineComponent({name:"UseVirtualList",props:["list","options","height"],setup(e,{slots:n}){const{list:r}=t.toRefs(e),{list:o,containerProps:a,wrapperProps:l}=vs(r,e.options);return a.style.height=e.height||"300px",()=>t.h("div",Jt({},a),[t.h("div",Jt({},l.value),o.value.map(i=>t.h("div",{style:{overFlow:"hidden",height:i.height}},n.default?n.default(i):"Please set content!")))])}}),t.defineComponent({name:"UseWindowFocus",setup(e,{slots:n}){const r=t.reactive({focused:ws()});return()=>{if(n.default)return n.default(r)}}}),t.defineComponent({name:"UseWindowSize",props:["initialWidth","initialHeight"],setup(e,{slots:n}){const r=t.reactive(bs(e));return()=>{if(n.default)return n.default(r)}}});const md={class:"bg-white flex items-center justify-between"},hd={class:"flex-1 flex justify-between sm:hidden items-center"},_d=["onClick"],gd={class:"text-sm text-gray-500"},yd=["onClick"],$d={class:"hidden sm:flex-1 sm:flex sm:items-center"},vd={"aria-label":"Pagination",class:"relative z-0 inline-flex rounded-base shadow-sm -space-x-px"},wd=["onClick"],bd=["onClick"],Od=["onClick"],Ed=t.defineComponent({__name:"Pagination",props:{page:{type:Number,default:1},size:{type:Number,default:10},total:{type:Number,default:0}},emits:["update:page","update:size","change"],setup(e,{emit:n}){const r=e,{page:o,size:a,total:l}=t.toRefs(r),i=t.ref(Math.random()),s=({currentPage:c,currentPageSize:d})=>{n("change",{page:c,size:d})};return t.watch(()=>l==null?void 0:l.value,()=>{i.value=Math.random()}),(c,d)=>(t.openBlock(),t.createBlock(t.unref(zc),{key:i.value,page:t.unref(o),pageSize:t.unref(a),total:t.unref(l),onPageChange:s,onPageSizeChange:s},{default:t.withCtx(({currentPage:u,next:h,prev:f,pageCount:p})=>[t.createElementVNode("div",md,[t.createElementVNode("div",hd,[t.createElementVNode("span",{class:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 cursor-pointer",onClick:f},[t.createVNode(t.unref(G))],8,_d),t.createElementVNode("span",gd,t.toDisplayString(u)+" / "+t.toDisplayString(p),1),t.createElementVNode("span",{class:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 cursor-pointer",onClick:h},[t.createVNode(t.unref(T))],8,yd)]),t.createElementVNode("div",$d,[t.createElementVNode("nav",vd,[t.createElementVNode("span",{class:"relative inline-flex items-center px-2 py-2 rounded-l-[4px] border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 cursor-pointer",onClick:f},[t.createVNode(t.unref(G))],8,wd),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p,_=>(t.openBlock(),t.createElementBlock("span",{key:_,class:t.normalizeClass([{"z-10 bg-primary/1 border-primary text-primary":_===u,"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":_!==u},"relative inline-flex items-center px-4 py-2 border text-sm font-medium cursor-pointer select-none"]),"aria-current":"page",onClick:y=>u.value=_},t.toDisplayString(_),11,bd))),128)),t.createElementVNode("span",{class:"relative inline-flex items-center px-2 py-2 rounded-r-[4px] border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 cursor-pointer",onClick:h},[t.createVNode(t.unref(T))],8,Od)])])])]),_:1},8,["page","pageSize","total"]))}});return m.IconAddCircle=Ar,m.IconArrowDown=pn,m.IconArrowDownLine=wn,m.IconArrowLeft=G,m.IconArrowRight=T,m.IconArrowUpLine=gn,m.IconBookRead=Cn,m.IconCheckboxCircle=X,m.IconCheckboxFill=eo,m.IconClose=j,m.IconCloseCircle=ce,m.IconComputer=so,m.IconDashboard=nn,m.IconDeleteBin=Nr,m.IconErrorWarning=J,m.IconExchange=Co,m.IconEye=ir,m.IconFolder=ur,m.IconForbidLine=de,m.IconGitBranch=jo,m.IconGitHub=Po,m.IconGrid=Jr,m.IconInformation=H,m.IconList=Wr,m.IconListSettings=jn,m.IconMagic=Yn,m.IconMessage=zn,m.IconMore=hr,m.IconPages=Pn,m.IconPalette=Ln,m.IconPhone=po,m.IconPlug=rr,m.IconSave=Hr,m.IconSearch=oo,m.IconSettings=Zn,m.IconShieldUser=Lo,m.IconStopCircle=Yo,m.IconTablet=go,m.IconUpload=zo,m.IconUserFollow=wo,m.IconUserSettings=Gn,m.VAlert=ea,m.VButton=Q,m.VCard=ua,m.VCheckbox=fe,m.VCheckboxGroup=_a,m.VDialog=ye,m.VDialogProvider=El,m.VInput=Sa,m.VMenu=pe,m.VMenuItem=Z,m.VMenuLabel=me,m.VModal=he,m.VOption=Ja,m.VPageHeader=wa,m.VPagination=Ed,m.VRadio=_e,m.VRadioGroup=Ua,m.VRoutesMenu=Ia,m.VSelect=qa,m.VSpace=Qa,m.VSwitch=_l,m.VTabItem=rl,m.VTabbar=ge,m.VTabs=tl,m.VTag=ul,m.VTextarea=ml,m.useDialog=Cl,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),m}({},Vue,VueRouter);
|
|
1
|
+
var HaloComponents=function(b,h,Lc,Rn,vc){"use strict";var Gx="";const Dc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Ic=[h.createElementVNode("path",{fill:"currentColor",d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2zm0 2a8 8 0 1 0 0 16a8 8 0 0 0 0-16zm3.833 3.337a.595.595 0 0 1 .763.067a.59.59 0 0 1 .063.76c-2.18 3.046-3.38 4.678-3.598 4.897a1.502 1.502 0 0 1-2.122 0a1.502 1.502 0 0 1 0-2.122c.374-.373 2.005-1.574 4.894-3.602zM17.5 11a1 1 0 1 1 0 2a1 1 0 0 1 0-2zm-11 0a1 1 0 1 1 0 2a1 1 0 0 1 0-2zm2.318-3.596a1 1 0 1 1-1.416 1.414a1 1 0 0 1 1.416-1.414zM12 5.5a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function Nc(n,e){return h.openBlock(),h.createElementBlock("svg",Dc,Ic)}var Ec={name:"ri-dashboard-3-line",render:Nc};const Tc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Bc=[h.createElementVNode("path",{fill:"currentColor",d:"m10.828 12l4.95 4.95l-1.414 1.414L8 12l6.364-6.364l1.414 1.414z"},null,-1)];function _c(n,e){return h.openBlock(),h.createElementBlock("svg",Tc,Bc)}var Hn={name:"ri-arrow-left-s-line",render:_c};const Oc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},zc=[h.createElementVNode("path",{fill:"currentColor",d:"m13.172 12l-4.95-4.95l1.414-1.414L16 12l-6.364 6.364l-1.414-1.414z"},null,-1)];function jc(n,e){return h.openBlock(),h.createElementBlock("svg",Oc,zc)}var Ii={name:"ri-arrow-right-s-line",render:jc};const Vc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},$c=[h.createElementVNode("path",{fill:"currentColor",d:"m12 16l-6-6h12z"},null,-1)];function Pc(n,e){return h.openBlock(),h.createElementBlock("svg",Vc,$c)}var Rc={name:"ri-arrow-down-s-fill",render:Pc};const Hc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Fc=[h.createElementVNode("path",{fill:"currentColor",d:"m12 10.828l-4.95 4.95l-1.414-1.414L12 8l6.364 6.364l-1.414 1.414z"},null,-1)];function Wc(n,e){return h.openBlock(),h.createElementBlock("svg",Hc,Fc)}var Uc={name:"ri-arrow-up-s-line",render:Wc};const Yc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Gc=[h.createElementVNode("path",{fill:"currentColor",d:"m12 13.172l4.95-4.95l1.414 1.414L12 16L5.636 9.636L7.05 8.222z"},null,-1)];function Kc(n,e){return h.openBlock(),h.createElementBlock("svg",Yc,Gc)}var qc={name:"ri-arrow-down-s-line",render:Kc};const Qc={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Zc=[h.createElementVNode("path",{fill:"currentColor",d:"M2 3.993A1 1 0 0 1 2.992 3h18.016c.548 0 .992.445.992.993v16.014a1 1 0 0 1-.992.993H2.992A.993.993 0 0 1 2 20.007V3.993zM11 5H4v14h7V5zm2 0v14h7V5h-7zm1 2h5v2h-5V7zm0 3h5v2h-5v-2z"},null,-1)];function Jc(n,e){return h.openBlock(),h.createElementBlock("svg",Qc,Zc)}var Xc={name:"ri-book-read-line",render:Jc};const ef={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},tf=[h.createElementVNode("path",{fill:"currentColor",d:"M5 8v12h14V8H5zm0-2h14V4H5v2zm15 16H4a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1h16a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1zM7 10h4v4H7v-4zm0 6h10v2H7v-2zm6-5h4v2h-4v-2z"},null,-1)];function nf(n,e){return h.openBlock(),h.createElementBlock("svg",ef,tf)}var sf={name:"ri-pages-line",render:nf};const rf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},of=[h.createElementVNode("path",{fill:"currentColor",d:"M2 8.994A5.99 5.99 0 0 1 8 3h8c3.313 0 6 2.695 6 5.994V21H8c-3.313 0-6-2.695-6-5.994V8.994zM20 19V8.994A4.004 4.004 0 0 0 16 5H8a3.99 3.99 0 0 0-4 3.994v6.012A4.004 4.004 0 0 0 8 19h12zm-6-8h2v2h-2v-2zm-6 0h2v2H8v-2z"},null,-1)];function lf(n,e){return h.openBlock(),h.createElementBlock("svg",rf,of)}var af={name:"ri-message-3-line",render:lf};const hf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},cf=[h.createElementVNode("path",{fill:"currentColor",d:"M12 2c5.522 0 10 3.978 10 8.889a5.558 5.558 0 0 1-5.556 5.555h-1.966c-.922 0-1.667.745-1.667 1.667c0 .422.167.811.422 1.1c.267.3.434.689.434 1.122C13.667 21.256 12.9 22 12 22C6.478 22 2 17.522 2 12S6.478 2 12 2zm-1.189 16.111a3.664 3.664 0 0 1 3.667-3.667h1.966A3.558 3.558 0 0 0 20 10.89C20 7.139 16.468 4 12 4a8 8 0 0 0-.676 15.972a3.648 3.648 0 0 1-.513-1.86zM7.5 12a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm9 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zM12 9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3z"},null,-1)];function ff(n,e){return h.openBlock(),h.createElementBlock("svg",hf,cf)}var uf={name:"ri-palette-line",render:ff};const df={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},mf=[h.createElementVNode("path",{fill:"currentColor",d:"M2 18h7v2H2v-2zm0-7h9v2H2v-2zm0-7h20v2H2V4zm18.674 9.025l1.156-.391l1 1.732l-.916.805a4.017 4.017 0 0 1 0 1.658l.916.805l-1 1.732l-1.156-.391c-.41.37-.898.655-1.435.83L19 21h-2l-.24-1.196a3.996 3.996 0 0 1-1.434-.83l-1.156.392l-1-1.732l.916-.805a4.017 4.017 0 0 1 0-1.658l-.916-.805l1-1.732l1.156.391c.41-.37.898-.655 1.435-.83L17 11h2l.24 1.196c.536.174 1.024.46 1.434.83zM18 18a2 2 0 1 0 0-4a2 2 0 0 0 0 4z"},null,-1)];function pf(n,e){return h.openBlock(),h.createElementBlock("svg",df,mf)}var gf={name:"ri-list-settings-line",render:pf};const yf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},wf=[h.createElementVNode("path",{fill:"currentColor",d:"M15.199 9.945a2.6 2.6 0 0 1-.79-1.551l-.403-3.083l-2.73 1.486a2.6 2.6 0 0 1-1.72.273L6.5 6.5l.57 3.056a2.6 2.6 0 0 1-.273 1.72l-1.486 2.73l3.083.403a2.6 2.6 0 0 1 1.55.79l2.138 2.257l1.336-2.807a2.6 2.6 0 0 1 1.23-1.231l2.808-1.336l-2.257-2.137zm.025 5.563l-2.213 4.65a.6.6 0 0 1-.977.155l-3.542-3.739a.6.6 0 0 0-.357-.182l-5.107-.668a.6.6 0 0 1-.449-.881l2.462-4.524a.6.6 0 0 0 .062-.396L4.16 4.86a.6.6 0 0 1 .7-.7l5.063.943a.6.6 0 0 0 .396-.062l4.524-2.462a.6.6 0 0 1 .881.45l.668 5.106a.6.6 0 0 0 .182.357l3.739 3.542a.6.6 0 0 1-.155.977l-4.65 2.213a.6.6 0 0 0-.284.284zm.797 1.927l1.414-1.414l4.243 4.242l-1.415 1.415l-4.242-4.243z"},null,-1)];function xf(n,e){return h.openBlock(),h.createElementBlock("svg",yf,wf)}var bf={name:"ri-magic-line",render:xf};const kf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Cf=[h.createElementVNode("path",{fill:"currentColor",d:"M12 14v2a6 6 0 0 0-6 6H4a8 8 0 0 1 8-8zm0-1c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm2.595 7.812a3.51 3.51 0 0 1 0-1.623l-.992-.573l1-1.732l.992.573A3.496 3.496 0 0 1 17 14.645V13.5h2v1.145c.532.158 1.012.44 1.405.812l.992-.573l1 1.732l-.992.573a3.51 3.51 0 0 1 0 1.622l.992.573l-1 1.732l-.992-.573a3.496 3.496 0 0 1-1.405.812V22.5h-2v-1.145a3.496 3.496 0 0 1-1.405-.812l-.992.573l-1-1.732l.992-.572zM18 19.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3z"},null,-1)];function Mf(n,e){return h.openBlock(),h.createElementBlock("svg",kf,Cf)}var Sf={name:"ri-user-settings-line",render:Mf};const Af={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Lf=[h.createElementVNode("path",{fill:"currentColor",d:"M2 12c0-.865.11-1.703.316-2.504A3 3 0 0 0 4.99 4.867a9.99 9.99 0 0 1 4.335-2.505a3 3 0 0 0 5.348 0a9.99 9.99 0 0 1 4.335 2.505a3 3 0 0 0 2.675 4.63a10.036 10.036 0 0 1 0 5.007a3 3 0 0 0-2.675 4.629a9.99 9.99 0 0 1-4.335 2.505a3 3 0 0 0-5.348 0a9.99 9.99 0 0 1-4.335-2.505a3 3 0 0 0-2.675-4.63A10.056 10.056 0 0 1 2 12zm4.804 3c.63 1.091.81 2.346.564 3.524c.408.29.842.541 1.297.75A4.993 4.993 0 0 1 12 18c1.26 0 2.438.471 3.335 1.274c.455-.209.889-.46 1.297-.75A4.993 4.993 0 0 1 17.196 15a4.993 4.993 0 0 1 2.77-2.25a8.126 8.126 0 0 0 0-1.5A4.993 4.993 0 0 1 17.195 9a4.993 4.993 0 0 1-.564-3.524a7.989 7.989 0 0 0-1.297-.75A4.993 4.993 0 0 1 12 6a4.993 4.993 0 0 1-3.335-1.274a7.99 7.99 0 0 0-1.297.75A4.993 4.993 0 0 1 6.804 9a4.993 4.993 0 0 1-2.77 2.25a8.126 8.126 0 0 0 0 1.5A4.993 4.993 0 0 1 6.805 15zM12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2z"},null,-1)];function vf(n,e){return h.openBlock(),h.createElementBlock("svg",Af,Lf)}var Df={name:"ri-settings-4-line",render:vf};const If={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Nf=[h.createElementVNode("path",{fill:"currentColor",d:"M13 18v2h6v2h-6a2 2 0 0 1-2-2v-2H8a4 4 0 0 1-4-4V7a1 1 0 0 1 1-1h2V2h2v4h6V2h2v4h2a1 1 0 0 1 1 1v7a4 4 0 0 1-4 4h-3zm-5-2h8a2 2 0 0 0 2-2v-3H6v3a2 2 0 0 0 2 2zm10-8H6v1h12V8zm-6 6.5a1 1 0 1 1 0-2a1 1 0 0 1 0 2zM11 2h2v3h-2V2z"},null,-1)];function Ef(n,e){return h.openBlock(),h.createElementBlock("svg",If,Nf)}var Tf={name:"ri-plug-2-line",render:Ef};const Bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},_f=[h.createElementVNode("path",{fill:"currentColor",d:"M12 3c5.392 0 9.878 3.88 10.819 9c-.94 5.12-5.427 9-10.819 9c-5.392 0-9.878-3.88-10.819-9C2.121 6.88 6.608 3 12 3zm0 16a9.005 9.005 0 0 0 8.777-7a9.005 9.005 0 0 0-17.554 0A9.005 9.005 0 0 0 12 19zm0-2.5a4.5 4.5 0 1 1 0-9a4.5 4.5 0 0 1 0 9zm0-2a2.5 2.5 0 1 0 0-5a2.5 2.5 0 0 0 0 5z"},null,-1)];function Of(n,e){return h.openBlock(),h.createElementBlock("svg",Bf,_f)}var zf={name:"ri-eye-line",render:Of};const jf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Vf=[h.createElementVNode("path",{fill:"currentColor",d:"M17.882 19.297A10.949 10.949 0 0 1 12 21c-5.392 0-9.878-3.88-10.819-9a10.982 10.982 0 0 1 3.34-6.066L1.392 2.808l1.415-1.415l19.799 19.8l-1.415 1.414l-3.31-3.31zM5.935 7.35A8.965 8.965 0 0 0 3.223 12a9.005 9.005 0 0 0 13.201 5.838l-2.028-2.028A4.5 4.5 0 0 1 8.19 9.604L5.935 7.35zm6.979 6.978l-3.242-3.242a2.5 2.5 0 0 0 3.241 3.241zm7.893 2.264l-1.431-1.43A8.935 8.935 0 0 0 20.777 12A9.005 9.005 0 0 0 9.552 5.338L7.974 3.76C9.221 3.27 10.58 3 12 3c5.392 0 9.878 3.88 10.819 9a10.947 10.947 0 0 1-2.012 4.592zm-9.084-9.084a4.5 4.5 0 0 1 4.769 4.769l-4.77-4.769z"},null,-1)];function $f(n,e){return h.openBlock(),h.createElementBlock("svg",jf,Vf)}var Pf={name:"ri-eye-off-line",render:$f};const Rf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Hf=[h.createElementVNode("path",{fill:"currentColor",d:"M12.414 5H21a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h7.414l2 2zM20 11H4v8h16v-8zm0-2V7h-8.414l-2-2H4v4h16z"},null,-1)];function Ff(n,e){return h.openBlock(),h.createElementBlock("svg",Rf,Hf)}var Wf={name:"ri-folder-2-line",render:Ff};const Uf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Yf=[h.createElementVNode("path",{fill:"currentColor",d:"M4.5 10.5c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S6 12.825 6 12s-.675-1.5-1.5-1.5zm15 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5S21 12.825 21 12s-.675-1.5-1.5-1.5zm-7.5 0c-.825 0-1.5.675-1.5 1.5s.675 1.5 1.5 1.5s1.5-.675 1.5-1.5s-.675-1.5-1.5-1.5z"},null,-1)];function Gf(n,e){return h.openBlock(),h.createElementBlock("svg",Uf,Yf)}var Rr={name:"ri-more-line",render:Gf};const Kf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},qf=[h.createElementVNode("path",{fill:"currentColor",d:"m12 10.586l4.95-4.95l1.414 1.414l-4.95 4.95l4.95 4.95l-1.414 1.414l-4.95-4.95l-4.95 4.95l-1.414-1.414l4.95-4.95l-4.95-4.95L7.05 5.636z"},null,-1)];function Qf(n,e){return h.openBlock(),h.createElementBlock("svg",Kf,qf)}var Ni={name:"ri-close-line",render:Qf};const Zf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Jf=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)];function Xf(n,e){return h.openBlock(),h.createElementBlock("svg",Zf,Jf)}var Fn={name:"ri-error-warning-line",render:Xf};const eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},tu=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414l2.829 2.829l5.656-5.657l1.415 1.414L11.003 16z"},null,-1)];function iu(n,e){return h.openBlock(),h.createElementBlock("svg",eu,tu)}var Wn={name:"ri-checkbox-circle-line",render:iu};const nu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},su=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM11 7h2v2h-2V7zm0 4h2v6h-2v-6z"},null,-1)];function ru(n,e){return h.openBlock(),h.createElementBlock("svg",nu,su)}var Ei={name:"ri-information-line",render:ru};const ou={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},lu=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm0-9.414l2.828-2.829l1.415 1.415L13.414 12l2.829 2.828l-1.415 1.415L12 13.414l-2.828 2.829l-1.415-1.415L10.586 12L7.757 9.172l1.415-1.415L12 10.586z"},null,-1)];function au(n,e){return h.openBlock(),h.createElementBlock("svg",ou,lu)}var Hr={name:"ri-close-circle-line",render:au};const hu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},cu=[h.createElementVNode("path",{fill:"currentColor",d:"M17 6h5v2h-2v13a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V8H2V6h5V3a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v3zm1 2H6v12h12V8zm-4.586 6l1.768 1.768l-1.414 1.414L12 15.414l-1.768 1.768l-1.414-1.414L10.586 14l-1.768-1.768l1.414-1.414L12 12.586l1.768-1.768l1.414 1.414L13.414 14zM9 4v2h6V4H9z"},null,-1)];function fu(n,e){return h.openBlock(),h.createElementBlock("svg",hu,cu)}var uu={name:"ri-delete-bin-2-line",render:fu};const du={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},mu=[h.createElementVNode("path",{fill:"currentColor",d:"M11 11V7h2v4h4v2h-4v4h-2v-4H7v-2h4zm1 11C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16z"},null,-1)];function pu(n,e){return h.openBlock(),h.createElementBlock("svg",du,mu)}var gu={name:"ri-add-circle-line",render:pu};const yu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},wu=[h.createElementVNode("path",{fill:"currentColor",d:"M7 19v-6h10v6h2V7.828L16.172 5H5v14h2zM4 3h13l4 4v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm5 12v4h6v-4H9z"},null,-1)];function xu(n,e){return h.openBlock(),h.createElementBlock("svg",yu,wu)}var bu={name:"ri-save-line",render:xu};const ku={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Cu=[h.createElementVNode("path",{fill:"currentColor",d:"M8 4h13v2H8V4zM4.5 6.5a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm0 7a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm0 6.9a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zM8 11h13v2H8v-2zm0 7h13v2H8v-2z"},null,-1)];function Mu(n,e){return h.openBlock(),h.createElementBlock("svg",ku,Cu)}var Su={name:"ri-list-unordered",render:Mu};const Au={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Lu=[h.createElementVNode("path",{fill:"currentColor",d:"M14 10h-4v4h4v-4zm2 0v4h3v-4h-3zm-2 9v-3h-4v3h4zm2 0h3v-3h-3v3zM14 5h-4v3h4V5zm2 0v3h3V5h-3zm-8 5H5v4h3v-4zm0 9v-3H5v3h3zM8 5H5v3h3V5zM4 3h16a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1z"},null,-1)];function vu(n,e){return h.openBlock(),h.createElementBlock("svg",Au,Lu)}var Du={name:"ri-grid-line",render:vu};const Iu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Nu=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm-.997-6l7.07-7.071l-1.414-1.414l-5.656 5.657l-2.829-2.829l-1.414 1.414L11.003 16z"},null,-1)];function Eu(n,e){return h.openBlock(),h.createElementBlock("svg",Iu,Nu)}var Tu={name:"ri-checkbox-circle-fill",render:Eu};const Bu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},_u=[h.createElementVNode("path",{fill:"currentColor",d:"M11 2c4.968 0 9 4.032 9 9s-4.032 9-9 9s-9-4.032-9-9s4.032-9 9-9zm0 16c3.867 0 7-3.133 7-7c0-3.868-3.133-7-7-7c-3.868 0-7 3.132-7 7c0 3.867 3.132 7 7 7zm8.485.071l2.829 2.828l-1.415 1.415l-2.828-2.829l1.414-1.414z"},null,-1)];function Ou(n,e){return h.openBlock(),h.createElementBlock("svg",Bu,_u)}var zu={name:"ri-search-2-line",render:Ou};const ju={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Vu=[h.createElementVNode("path",{fill:"currentColor",d:"M4 16h16V5H4v11zm9 2v2h4v2H7v-2h4v-2H2.992A.998.998 0 0 1 2 16.993V4.007C2 3.451 2.455 3 2.992 3h18.016c.548 0 .992.449.992 1.007v12.986c0 .556-.455 1.007-.992 1.007H13z"},null,-1)];function $u(n,e){return h.openBlock(),h.createElementBlock("svg",ju,Vu)}var Pu={name:"ri-computer-line",render:$u};const Ru={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Hu=[h.createElementVNode("path",{fill:"currentColor",d:"M7 4v16h10V4H7zM6 2h12a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm6 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function Fu(n,e){return h.openBlock(),h.createElementBlock("svg",Ru,Hu)}var Wu={name:"ri-smartphone-line",render:Fu};const Uu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Yu=[h.createElementVNode("path",{fill:"currentColor",d:"M6 4v16h12V4H6zM5 2h14a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zm7 15a1 1 0 1 1 0 2a1 1 0 0 1 0-2z"},null,-1)];function Gu(n,e){return h.openBlock(),h.createElementBlock("svg",Uu,Yu)}var Ku={name:"ri-tablet-line",render:Gu};const qu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Qu=[h.createElementVNode("path",{fill:"currentColor",d:"M14 14.252v2.09A6 6 0 0 0 6 22l-2-.001a8 8 0 0 1 10-7.748zM12 13c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4zm5.793 8.914l3.535-3.535l1.415 1.414l-4.95 4.95l-3.536-3.536l1.415-1.414l2.12 2.121z"},null,-1)];function Zu(n,e){return h.openBlock(),h.createElementBlock("svg",qu,Qu)}var Ju={name:"ri-user-follow-line",render:Zu};const Xu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ed=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-5-7h9v2h-4v3l-5-5zm5-4V6l5 5H8V9h4z"},null,-1)];function td(n,e){return h.openBlock(),h.createElementBlock("svg",Xu,ed)}var id={name:"ri-exchange-line",render:td};const nd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},sd=[h.createElementVNode("path",{fill:"currentColor",d:"M12 2C6.475 2 2 6.475 2 12a9.994 9.994 0 0 0 6.838 9.488c.5.087.687-.213.687-.476c0-.237-.013-1.024-.013-1.862c-2.512.463-3.162-.612-3.362-1.175c-.113-.288-.6-1.175-1.025-1.413c-.35-.187-.85-.65-.013-.662c.788-.013 1.35.725 1.538 1.025c.9 1.512 2.338 1.087 2.912.825c.088-.65.35-1.087.638-1.337c-2.225-.25-4.55-1.113-4.55-4.938c0-1.088.387-1.987 1.025-2.688c-.1-.25-.45-1.275.1-2.65c0 0 .837-.262 2.75 1.026a9.28 9.28 0 0 1 2.5-.338c.85 0 1.7.112 2.5.337c1.912-1.3 2.75-1.024 2.75-1.024c.55 1.375.2 2.4.1 2.65c.637.7 1.025 1.587 1.025 2.687c0 3.838-2.337 4.688-4.562 4.938c.362.312.675.912.675 1.85c0 1.337-.013 2.412-.013 2.75c0 .262.188.574.688.474A10.016 10.016 0 0 0 22 12c0-5.525-4.475-10-10-10z"},null,-1)];function rd(n,e){return h.openBlock(),h.createElementBlock("svg",nd,sd)}var od={name:"ri-github-fill",render:rd};const ld={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ad=[h.createElementVNode("path",{fill:"currentColor",d:"m12 12.586l4.243 4.242l-1.415 1.415L13 16.415V22h-2v-5.587l-1.828 1.83l-1.415-1.415L12 12.586zM12 2a7.001 7.001 0 0 1 6.954 6.194a5.5 5.5 0 0 1-.953 10.784v-2.014a3.5 3.5 0 1 0-1.112-6.91a5 5 0 1 0-9.777 0a3.5 3.5 0 0 0-1.292 6.88l.18.03v2.014a5.5 5.5 0 0 1-.954-10.784A7 7 0 0 1 12 2z"},null,-1)];function hd(n,e){return h.openBlock(),h.createElementBlock("svg",ld,ad)}var cd={name:"ri-upload-cloud-2-line",render:hd};const fd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},ud=[h.createElementVNode("path",{fill:"currentColor",d:"M3.783 2.826L12 1l8.217 1.826a1 1 0 0 1 .783.976v9.987a6 6 0 0 1-2.672 4.992L12 23l-6.328-4.219A6 6 0 0 1 3 13.79V3.802a1 1 0 0 1 .783-.976zM5 4.604v9.185a4 4 0 0 0 1.781 3.328L12 20.597l5.219-3.48A4 4 0 0 0 19 13.79V4.604L12 3.05L5 4.604zM12 11a2.5 2.5 0 1 1 0-5a2.5 2.5 0 0 1 0 5zm-4.473 5a4.5 4.5 0 0 1 8.946 0H7.527z"},null,-1)];function dd(n,e){return h.openBlock(),h.createElementBlock("svg",fd,ud)}var md={name:"ri-shield-user-line",render:dd};const pd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},gd=[h.createElementVNode("path",{fill:"currentColor",d:"M7.105 15.21A3.001 3.001 0 1 1 5 15.17V8.83a3.001 3.001 0 1 1 2 0V12c.836-.628 1.874-1 3-1h4a3.001 3.001 0 0 0 2.895-2.21a3.001 3.001 0 1 1 2.032.064A5.001 5.001 0 0 1 14 13h-4a3.001 3.001 0 0 0-2.895 2.21zM6 17a1 1 0 1 0 0 2a1 1 0 0 0 0-2zM6 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2zm12 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2z"},null,-1)];function yd(n,e){return h.openBlock(),h.createElementBlock("svg",pd,gd)}var wd={name:"ri-git-branch-line",render:yd};const xd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},bd=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM9 9h6v6H9V9z"},null,-1)];function kd(n,e){return h.openBlock(),h.createElementBlock("svg",xd,bd)}var Cd={name:"ri-stop-circle-line",render:kd};const Md={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Sd=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zM8.523 7.109l8.368 8.368a6.04 6.04 0 0 1-1.414 1.414L7.109 8.523A6.04 6.04 0 0 1 8.523 7.11z"},null,-1)];function Ad(n,e){return h.openBlock(),h.createElementBlock("svg",Md,Sd)}var Fr={name:"ri-forbid-line",render:Ad};const Ld={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},vd=[h.createElementVNode("path",{fill:"currentColor",d:"M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm16 7l-3.536 3.536l-1.414-1.415L17.172 12L15.05 9.879l1.414-1.415L20 12zM6.828 12l2.122 2.121l-1.414 1.415L4 12l3.536-3.536L8.95 9.88L6.828 12zm4.416 5H9.116l3.64-10h2.128l-3.64 10z"},null,-1)];function Dd(n,e){return h.openBlock(),h.createElementBlock("svg",Ld,vd)}var Id={name:"ri-code-box-line",render:Dd};const Nd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Ed=[h.createElementVNode("path",{fill:"currentColor",d:"M5 12.5c0 .313.461.858 1.53 1.393C7.914 14.585 9.877 15 12 15c2.123 0 4.086-.415 5.47-1.107c1.069-.535 1.53-1.08 1.53-1.393v-2.171C17.35 11.349 14.827 12 12 12s-5.35-.652-7-1.671V12.5zm14 2.829C17.35 16.349 14.827 17 12 17s-5.35-.652-7-1.671V17.5c0 .313.461.858 1.53 1.393C7.914 19.585 9.877 20 12 20c2.123 0 4.086-.415 5.47-1.107c1.069-.535 1.53-1.08 1.53-1.393v-2.171zM3 17.5v-10C3 5.015 7.03 3 12 3s9 2.015 9 4.5v10c0 2.485-4.03 4.5-9 4.5s-9-2.015-9-4.5zm9-7.5c2.123 0 4.086-.415 5.47-1.107C18.539 8.358 19 7.813 19 7.5c0-.313-.461-.858-1.53-1.393C16.086 5.415 14.123 5 12 5c-2.123 0-4.086.415-5.47 1.107C5.461 6.642 5 7.187 5 7.5c0 .313.461.858 1.53 1.393C7.914 9.585 9.877 10 12 10z"},null,-1)];function Td(n,e){return h.openBlock(),h.createElementBlock("svg",Nd,Ed)}var Bd={name:"ri-database-2-line",render:Td};const _d={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Od=[h.createElementVNode("path",{fill:"currentColor",d:"M12 11a5 5 0 0 1 5 5v6H7v-6a5 5 0 0 1 5-5zm-6.712 3.006a6.983 6.983 0 0 0-.28 1.65L5 16v6H2v-4.5a3.5 3.5 0 0 1 3.119-3.48l.17-.014zm13.424 0A3.501 3.501 0 0 1 22 17.5V22h-3v-6c0-.693-.1-1.362-.288-1.994zM5.5 8a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zm13 0a2.5 2.5 0 1 1 0 5a2.5 2.5 0 0 1 0-5zM12 2a4 4 0 1 1 0 8a4 4 0 0 1 0-8z"},null,-1)];function zd(n,e){return h.openBlock(),h.createElementBlock("svg",_d,Od)}var jd={name:"ri-team-fill",render:zd};const Vd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},$d=[h.createElementVNode("path",{fill:"currentColor",d:"M5 15v4h4v2H3v-6h2zm16 0v6h-6v-2h4v-4h2zm-8.001-9l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3H6.6l4.399-11h2zm-1 2.885L10.752 12h2.492l-1.245-3.115zM9 3v2H5v4H3V3h6zm12 0v6h-2V5h-4V3h6z"},null,-1)];function Pd(n,e){return h.openBlock(),h.createElementBlock("svg",Vd,$d)}var Rd={name:"ri-character-recognition-line",render:Pd};const Hd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Fd=[h.createElementVNode("path",{fill:"currentColor",d:"M17 3h4a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h4V1h2v2h6V1h2v2zm-2 2H9v2H7V5H4v4h16V5h-3v2h-2V5zm5 6H4v8h16v-8z"},null,-1)];function Wd(n,e){return h.openBlock(),h.createElementBlock("svg",Hd,Fd)}var Ud={name:"ri-calendar-line",render:Wd};const Yd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Gd=[h.createElementVNode("path",{fill:"currentColor",d:"M18.364 15.536L16.95 14.12l1.414-1.414a5 5 0 1 0-7.071-7.071L9.879 7.05L8.464 5.636L9.88 4.222a7 7 0 0 1 9.9 9.9l-1.415 1.414zm-2.828 2.828l-1.415 1.414a7 7 0 0 1-9.9-9.9l1.415-1.414L7.05 9.88l-1.414 1.414a5 5 0 1 0 7.071 7.071l1.414-1.414l1.415 1.414zm-.708-10.607l1.415 1.415l-7.071 7.07l-1.415-1.414l7.071-7.07z"},null,-1)];function Kd(n,e){return h.openBlock(),h.createElementBlock("svg",Yd,Gd)}var qd={name:"ri-link",render:Kd};const Qd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},Zd=[h.createElementVNode("path",{fill:"currentColor",d:"M4 22a8 8 0 1 1 16 0h-2a6 6 0 1 0-12 0H4zm8-9c-3.315 0-6-2.685-6-6s2.685-6 6-6s6 2.685 6 6s-2.685 6-6 6zm0-2c2.21 0 4-1.79 4-4s-1.79-4-4-4s-4 1.79-4 4s1.79 4 4 4z"},null,-1)];function Jd(n,e){return h.openBlock(),h.createElementBlock("svg",Qd,Zd)}var Wr={name:"ri-user-line",render:Jd};const Xd={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},em=[h.createElementVNode("path",{fill:"currentColor",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10s-4.477 10-10 10zm0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16zm-4-7h8a4 4 0 1 1-8 0zm0-2a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3zm8 0a1.5 1.5 0 1 1 0-3a1.5 1.5 0 0 1 0 3z"},null,-1)];function tm(n,e){return h.openBlock(),h.createElementBlock("svg",Xd,em)}var im={name:"ri-emotion-line",render:tm};const nm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},sm=[h.createElementVNode("path",{fill:"currentColor",d:"M11 20L1 12l10-8v5c5.523 0 10 4.477 10 10c0 .273-.01.543-.032.81a9.003 9.003 0 0 0-7.655-4.805L13 15h-2v5zm-2-7h4.034l.347.007c1.285.043 2.524.31 3.676.766A7.984 7.984 0 0 0 11 11H9V8.161L4.202 12L9 15.839V13z"},null,-1)];function rm(n,e){return h.openBlock(),h.createElementBlock("svg",nm,sm)}var om={name:"ri-reply-line",render:rm};const lm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"},am=[h.createElementVNode("path",{fill:"currentColor",d:"M10 6v2H5v11h11v-5h2v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h6zm11-3v8h-2V6.413l-7.793 7.794l-1.414-1.414L17.585 5H13V3h8z"},null,-1)];function hm(n,e){return h.openBlock(),h.createElementBlock("svg",lm,am)}var cm={name:"ri-external-link-line",render:hm};const fm={key:0,class:"w-full h-full"},um=["src","alt"];var dm=h.defineComponent({__name:"Avatar",props:{src:{default:void 0},alt:{default:void 0},size:{default:void 0},width:{default:void 0},height:{default:void 0},circle:{type:Boolean,default:!1}},setup(n){const e=n,t=h.computed(()=>{const o=[`avatar-${e.circle?"circle":"square"}`];return e.size&&o.push(`avatar-${e.size}`),o}),i=h.computed(()=>{const o={};return e.width&&(o.width=e.width),e.height&&(o.height=e.height),o}),{isLoading:s,error:r}=Lc.useImage({src:e.src});return(o,l)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["avatar-wrapper",h.unref(t)]),style:h.normalizeStyle(h.unref(i))},[h.unref(s)||h.unref(r)?(h.openBlock(),h.createElementBlock("div",fm,[h.createVNode(h.unref(Wr),{class:"w-full h-full"})])):(h.openBlock(),h.createElementBlock("img",{key:1,src:n.src,alt:n.alt},null,8,um))],6))}}),Yb="";const mm={class:"alert-header"},pm={class:"alert-icon"},gm={class:"alert-title"},ym={key:0,class:"alert-description"},wm={key:1,class:"alert-actions"};var xm=h.defineComponent({__name:"Alert",props:{type:{default:"default"},title:{default:""},description:{default:""},closable:{type:Boolean,default:!0}},emits:["close"],setup(n,{emit:e}){const t=n,i={success:Wn,info:Ei,default:Ei,warning:Fn,error:Hr},s=h.computed(()=>[`alert-${t.type}`]),r=()=>{e("close")};return(o,l)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(s),"alert-wrapper"])},[h.createElementVNode("div",mm,[h.createElementVNode("div",pm,[h.renderSlot(o.$slots,"icon",{},()=>[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(i[n.type])))],!0)]),h.createElementVNode("div",gm,h.toDisplayString(n.title),1),n.closable?(h.openBlock(),h.createElementBlock("div",{key:0,class:"alert-close",onClick:r},[h.createVNode(h.unref(Ni))])):h.createCommentVNode("",!0)]),n.description||o.$slots.description?(h.openBlock(),h.createElementBlock("div",ym,[h.renderSlot(o.$slots,"description",{},()=>[h.createTextVNode(h.toDisplayString(n.description),1)],!0)])):h.createCommentVNode("",!0),o.$slots.actions?(h.openBlock(),h.createElementBlock("div",wm,[h.renderSlot(o.$slots,"actions",{},void 0,!0)])):h.createCommentVNode("",!0)],2))}}),Gb="",Ur=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t},bm=Ur(xm,[["__scopeId","data-v-87b3ec5f"]]);const km=["disabled"],Cm={key:0,class:"btn-icon"},Mm={key:0,class:"animate-spin",fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Sm=[h.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),h.createElementVNode("path",{class:"opacity-75",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},null,-1)],Am={class:"btn-content"};var Un=h.defineComponent({__name:"Button",props:{type:{default:"default"},size:{default:"md"},circle:{type:Boolean,default:!1},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},route:{default:void 0}},emits:["click"],setup(n,{emit:e}){const t=n,i=Rn.useRouter(),s=h.computed(()=>[`btn-${t.size}`,`btn-${t.type}`,{"btn-circle":t.circle},{"btn-block":t.block},{"btn-loading":t.loading}]);function r(){t.disabled||t.loading||(t.route&&i.push(t.route),e("click"))}return(o,l)=>(h.openBlock(),h.createElementBlock("button",{class:h.normalizeClass([h.unref(s),"btn"]),disabled:n.disabled,onClick:r},[o.$slots.icon||n.loading?(h.openBlock(),h.createElementBlock("span",Cm,[n.loading?(h.openBlock(),h.createElementBlock("svg",Mm,Sm)):h.renderSlot(o.$slots,"icon",{key:1})])):h.createCommentVNode("",!0),h.createElementVNode("span",Am,[h.renderSlot(o.$slots,"default")])],10,km))}}),Qb="";const Lm={class:"card-wrapper"},vm={key:0,class:"card-header"},Dm={class:"card-header-title"},Im={class:"card-header-actions"},Nm={key:1,class:"card-footer"};var Em=h.defineComponent({__name:"Card",props:{title:null,bodyClass:null},setup(n){return(e,t)=>(h.openBlock(),h.createElementBlock("div",Lm,[n.title||e.$slots.header?(h.openBlock(),h.createElementBlock("div",vm,[h.renderSlot(e.$slots,"header",{},()=>[h.createElementVNode("div",Dm,h.toDisplayString(n.title),1),h.createElementVNode("div",Im,[h.renderSlot(e.$slots,"actions")])])])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass([n.bodyClass,"card-body"])},[h.renderSlot(e.$slots,"default")],2),e.$slots.footer?(h.openBlock(),h.createElementBlock("div",Nm,[h.renderSlot(e.$slots,"footer")])):h.createCommentVNode("",!0)]))}}),Zb="";const Tm={class:"checkbox-inner"},Bm=["id","checked","value"],_m=["for"];var Yr=h.defineComponent({__name:"CheckBox",props:{checked:{type:Boolean,default:!1},value:{type:[String,Number,Boolean,null],default:void 0},label:{default:void 0},name:{default:void 0}},emits:["update:checked","change"],setup(n,{emit:e}){const t=n,i=["checkbox",t.name,t.value].filter(r=>!!r).join("-");function s(r){const{checked:o}=r.target;e("update:checked",o),e("change",r)}return(r,o)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([{"checkbox-wrapper-checked":n.checked},"checkbox-wrapper"])},[h.createElementVNode("div",Tm,[h.createElementVNode("input",{id:h.unref(i),checked:n.checked,value:n.value,type:"checkbox",onChange:s},null,40,Bm)]),n.label?(h.openBlock(),h.createElementBlock("label",{key:0,for:h.unref(i),class:"checkbox-label"},h.toDisplayString(n.label),9,_m)):h.createCommentVNode("",!0)],2))}}),Jb="";const Om={class:"checkbox-group-wrapper"};var zm=h.defineComponent({__name:"CheckBoxGroup",props:{modelValue:{default:()=>[]},options:null,valueKey:{default:"value"},labelKey:{default:"label"},name:{default:void 0}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n;function i(s){const{value:r,checked:o}=s.target,l=[...t.modelValue];o?l.push(r):l.splice(l.indexOf(r),1),e("update:modelValue",l),e("change",l)}return(s,r)=>(h.openBlock(),h.createElementBlock("div",Om,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.options,(o,l)=>(h.openBlock(),h.createBlock(h.unref(Yr),{key:l,checked:n.modelValue.includes(o[n.valueKey]),label:o[n.labelKey],name:n.name,value:o[n.valueKey],onChange:i},null,8,["checked","label","name","value"]))),128))]))}}),Xb="";const jm={class:"flex items-center justify-between bg-white p-4 h-14"},Vm={class:"min-w-0 flex-1 self-center"},$m={class:"flex items-center truncate text-xl font-bold text-gray-800"},Pm={class:"self-center"};var Rm=h.defineComponent({__name:"PageHeader",props:{title:null},setup(n){return(e,t)=>(h.openBlock(),h.createElementBlock("div",jm,[h.createElementVNode("div",Vm,[h.createElementVNode("h2",$m,[h.renderSlot(e.$slots,"icon"),h.createElementVNode("span",null,h.toDisplayString(n.title),1)])]),h.createElementVNode("div",Pm,[h.renderSlot(e.$slots,"actions")])]))}});const Hm={class:"input-wrapper"},Fm={key:0,class:"input-prefix"},Wm=["disabled","placeholder","value"],Um={key:1,class:"input-suffix"};var Ym=h.defineComponent({__name:"Input",props:{modelValue:{default:void 0},size:{default:"md"},disabled:{type:Boolean,default:!1},placeholder:{default:void 0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=h.computed(()=>[`input-${t.size}`]);function s(r){const{value:o}=r.target;e("update:modelValue",o)}return(r,o)=>(h.openBlock(),h.createElementBlock("div",Hm,[r.$slots.prefix?(h.openBlock(),h.createElementBlock("div",Fm,[h.renderSlot(r.$slots,"prefix")])):h.createCommentVNode("",!0),h.createElementVNode("input",{class:h.normalizeClass(h.unref(i)),disabled:n.disabled,placeholder:n.placeholder,value:n.modelValue,type:"text",onInput:s},null,42,Wm),r.$slots.suffix?(h.openBlock(),h.createElementBlock("div",Um,[h.renderSlot(r.$slots,"suffix")])):h.createCommentVNode("",!0)]))}}),ek="";const Gm={class:"menu-container w-full p-3"};var Gr=h.defineComponent({__name:"Menu",props:{openIds:null},setup(n){const e=n;return h.provide("openIds",e.openIds),(t,i)=>(h.openBlock(),h.createElementBlock("div",Gm,[h.createElementVNode("ul",null,[h.renderSlot(t.$slots,"default")])]))}});const Km=["onClick"],qm={key:0,class:"menu-icon mr-3 self-center"},Qm={class:"menu-title flex-1 self-center"},Zm={class:"sub-menu-items transition-all"};var Yn=h.defineComponent({__name:"MenuItem",props:{id:{default:""},title:{default:""},active:{type:Boolean,default:!1}},emits:["select"],setup(n,{emit:e}){const t=n,i=h.useSlots(),s=h.ref(!1),r=h.inject("openIds");r!=null&&r.includes(t.id)&&(s.value=!0);const o=h.computed(()=>i.default&&i.default().length>0);function l(){if(o.value){s.value=!s.value;return}e("select",t.id)}return(a,c)=>(h.openBlock(),h.createElementBlock("li",{class:h.normalizeClass([{"has-submenus":h.unref(o)},"menu-item"]),onClick:h.withModifiers(l,["stop"])},[h.createElementVNode("div",{class:h.normalizeClass([{active:n.active},"menu-item-title"])},[a.$slots.icon?(h.openBlock(),h.createElementBlock("span",qm,[h.renderSlot(a.$slots,"icon")])):h.createCommentVNode("",!0),h.createElementVNode("span",Qm,h.toDisplayString(n.title),1),a.$slots.default?(h.openBlock(),h.createElementBlock("span",{key:1,class:h.normalizeClass([{open:s.value},"menu-icon-collapse self-center transition-all"])},[h.createVNode(h.unref(Ii))],2)):h.createCommentVNode("",!0)],2),h.createVNode(h.Transition,{name:"submenus-show"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("ul",Zm,[h.renderSlot(a.$slots,"default")],512),[[h.vShow,a.$slots.default&&s.value]])]),_:3})],10,Km))}}),tk="",ik="";const Jm={},Xm={class:"menu-label flex flex-col"};function ep(n,e){return h.openBlock(),h.createElementBlock("li",Xm,[h.renderSlot(n.$slots,"default")])}var Kr=Ur(Jm,[["render",ep]]);const tp=h.defineComponent({name:"VRoutesMenu",props:{menus:{type:Object,required:!0}},emits:["select"],setup(n,{emit:e}){const t=Rn.useRoute(),{push:i}=Rn.useRouter(),s=h.computed(()=>t.matched.map(a=>a.path));async function r(a){e("select",a),await i(a)}function o(a){if(!!a)return h.createVNode(a,{height:"20px",width:"20px"},null)}function l(a){return a==null?void 0:a.map(c=>{var f;return h.createVNode(h.Fragment,null,[(f=c.children)!=null&&f.length?h.createVNode(Yn,{key:c.path,id:c.path,title:c.name},{default:()=>[l(c.children)],icon:()=>o(c.icon)}):h.createVNode(Yn,{key:c.path,id:c.path,title:c.name,onSelect:r,active:s.value.includes(c.path)},{icon:()=>o(c.icon)})])})}return()=>h.createVNode(Gr,{openIds:s.value},{default:()=>{var a;return[(a=n.menus)==null?void 0:a.map(c=>{var f;return h.createVNode(h.Fragment,null,[c.name&&h.createVNode(Kr,null,{default:()=>[c.name]}),((f=c.items)==null?void 0:f.length)&&l(c.items)])})]}})}}),ip={key:0,class:"modal-header group"},np={class:"modal-header-title"},sp={class:"modal-header-actions"},rp={key:1,class:"modal-footer"};var qr=h.defineComponent({__name:"Modal",props:{visible:{type:Boolean,default:!1},title:{default:void 0},width:{default:500},height:{default:void 0},fullscreen:{type:Boolean,default:!1},bodyClass:{default:void 0},mountToBody:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i=h.ref(!1),s=h.ref(),r=h.computed(()=>({"modal-wrapper-fullscreen":t.fullscreen})),o=h.computed(()=>({maxWidth:t.width+"px",height:t.height}));function l(){e("update:visible",!1),e("close")}return h.watch(()=>t.visible,()=>{t.visible&&h.nextTick(()=>{var a;(a=s.value)==null||a.focus()})}),(a,c)=>(h.openBlock(),h.createBlock(h.Teleport,{disabled:!n.mountToBody,to:"body"},[h.withDirectives(h.createElementVNode("div",{ref_key:"modelWrapper",ref:s,class:h.normalizeClass([h.unref(r),"modal-wrapper"]),"aria-modal":"true",role:"dialog",tabindex:"0",onKeyup:c[4]||(c[4]=h.withKeys(h.withModifiers(f=>l(),["stop"]),["esc"]))},[h.createVNode(h.Transition,{"enter-active-class":"ease-out duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0",onBeforeEnter:c[1]||(c[1]=f=>i.value=!0),onAfterLeave:c[2]||(c[2]=f=>i.value=!1)},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{class:"modal-layer",onClick:c[0]||(c[0]=h.withModifiers(f=>l(),["stop"]))},null,512),[[h.vShow,n.visible]])]),_:1}),h.createVNode(h.Transition,{"enter-active-class":"ease-out duration-200","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"ease-in duration-100","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:h.withCtx(()=>[h.withDirectives(h.createElementVNode("div",{style:h.normalizeStyle(h.unref(o)),class:"modal-content transform transition-all"},[a.$slots.header||n.title?(h.openBlock(),h.createElementBlock("div",ip,[h.renderSlot(a.$slots,"header",{},()=>[h.createElementVNode("div",np,h.toDisplayString(n.title),1),h.createElementVNode("div",sp,[h.renderSlot(a.$slots,"actions"),h.createElementVNode("span",{class:"bg-gray-50",onClick:c[3]||(c[3]=f=>l())},[h.createVNode(h.unref(Ni))])])])])):h.createCommentVNode("",!0),h.createElementVNode("div",{class:h.normalizeClass([n.bodyClass,"modal-body"])},[h.renderSlot(a.$slots,"default")],2),a.$slots.footer?(h.openBlock(),h.createElementBlock("div",rp,[h.renderSlot(a.$slots,"footer")])):h.createCommentVNode("",!0)],4),[[h.vShow,n.visible]])]),_:3})],34),[[h.vShow,i.value]])],8,["disabled"]))}}),nk="";const op={class:"radio-inner"},lp=["id","checked","name","value"],ap=["for"];var Qr=h.defineComponent({__name:"Radio",props:{modelValue:{type:[String,Number,Boolean]},value:{type:[String,Number,Boolean]},label:null,name:null},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,i=["radio",t.name,t.value].filter(o=>!!o).join("-"),s=h.computed(()=>t.modelValue===t.value);function r(o){const{value:l}=o.target;e("update:modelValue",l),e("change",l)}return(o,l)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([{"radio-wrapper-checked":h.unref(s)},"radio-wrapper"])},[h.createElementVNode("div",op,[h.createElementVNode("input",{id:h.unref(i),checked:h.unref(s),name:n.name,value:n.value,type:"radio",onChange:r},null,40,lp)]),n.label?(h.openBlock(),h.createElementBlock("label",{key:0,for:h.unref(i),class:"radio-label"},h.toDisplayString(n.label),9,ap)):h.createCommentVNode("",!0)],2))}}),sk="";const hp={class:"radio-group-wrapper"};var cp=h.defineComponent({__name:"RadioGroup",props:{modelValue:{type:[String,Number,Boolean],default:void 0},options:{default:void 0},valueKey:{default:"value"},labelKey:{default:"label"},name:{default:void 0}},emits:["update:modelValue","change"],setup(n,{emit:e}){function t(i){e("update:modelValue",i),e("change",i)}return(i,s)=>(h.openBlock(),h.createElementBlock("div",hp,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.options,(r,o)=>(h.openBlock(),h.createBlock(h.unref(Qr),{key:o,label:r[n.labelKey]+"","model-value":n.modelValue,name:n.name,value:r[n.valueKey],onChange:t},null,8,["label","model-value","name","value"]))),128))]))}});const fp={class:"select-wrapper"},up=["disabled","value"],dp={key:"placeholder",disabled:"",hidden:"",value:""};var mp=h.defineComponent({__name:"Select",props:{modelValue:{default:void 0},size:{default:"md"},disabled:{type:Boolean,default:!1},placeholder:{default:void 0}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,i=h.computed(()=>[`select-${t.size}`]);function s(r){const{value:o}=r.target;e("update:modelValue",o)}return(r,o)=>(h.openBlock(),h.createElementBlock("div",fp,[h.createElementVNode("select",{class:h.normalizeClass(h.unref(i)),disabled:n.disabled,value:n.modelValue,onChange:s},[n.placeholder?(h.openBlock(),h.createElementBlock("option",dp,h.toDisplayString(n.placeholder),1)):h.createCommentVNode("",!0),h.renderSlot(r.$slots,"default")],42,up)]))}}),rk="";const pp=["value"];var gp=h.defineComponent({__name:"Option",props:{value:{type:[String,Number,Boolean]}},setup(n){return(e,t)=>(h.openBlock(),h.createElementBlock("option",{value:n.value},[h.renderSlot(e.$slots,"default")],8,pp))}});const yp={xs:10,sm:12,md:16,lg:20};var Zr=h.defineComponent({__name:"Space",props:{spacing:{default:"xs"},direction:{default:"row"},align:{default:"center"}},setup(n){const e=n,t=h.computed(()=>{const{direction:i,align:s}=e;return[`space-direction-${i}`,`space-align-${s}`]});return(i,s)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(t),"space-wrapper"]),style:h.normalizeStyle(`gap: ${h.unref(yp)[n.spacing]}px`)},[h.renderSlot(i.$slots,"default")],6))}}),ok="";const wp={class:"tabs-bar-wrapper"},xp={class:"tabs-items-wrapper"};var bp=h.defineComponent({__name:"Tabs",props:{activeId:{default:void 0},type:{default:"default"},direction:{default:"row"},idKey:{default:"id"},labelKey:{default:"label"}},emits:["update:activeId","change"],setup(n,{emit:e}){const t=n;h.provide("activeId",h.computed(()=>t.activeId));const i=h.useSlots(),s=h.computed(()=>{var l;return(l=i.default)==null?void 0:l.call(i).map(({props:a})=>({id:a==null?void 0:a[t.idKey],label:a==null?void 0:a[t.labelKey]}))}),r=h.computed(()=>[`tabs-direction-${t.direction}`]),o=l=>{e("update:activeId",l),e("change",l)};return(l,a)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(r),"tabs-wrapper"])},[h.createElementVNode("div",wp,[h.createVNode(h.unref(Jr),{"active-id":n.activeId,direction:n.direction,items:h.unref(s),type:n.type,onChange:o},null,8,["active-id","direction","items","type"])]),h.createElementVNode("div",xp,[h.renderSlot(l.$slots,"default")])],2))}}),lk="";const kp={key:0,class:"tabs-item-wrapper"};var Cp=h.defineComponent({__name:"TabItem",props:{id:null,label:null},setup(n){const e=n,t=h.inject("activeId"),i=h.computed(()=>(t==null?void 0:t.value)===e.id);return(s,r)=>h.unref(i)?(h.openBlock(),h.createElementBlock("div",kp,[h.renderSlot(s.$slots,"default")])):h.createCommentVNode("",!0)}});const Mp={class:"tabbar-items"},Sp=["onClick"],Ap={key:0,class:"tabbar-item-icon"},Lp={key:1,class:"tabbar-item-label"};var Jr=h.defineComponent({__name:"Tabbar",props:{activeId:{default:void 0},items:{default:void 0},type:{default:"default"},direction:{default:"row"},idKey:{default:"id"},labelKey:{default:"label"}},emits:["update:activeId","change"],setup(n,{emit:e}){const t=n,i=h.computed(()=>[`tabbar-${t.type}`,`tabbar-direction-${t.direction}`]),s=r=>{e("update:activeId",r),e("change",r)};return(r,o)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(i),"tabbar-wrapper"])},[h.createElementVNode("div",Mp,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,(l,a)=>(h.openBlock(),h.createElementBlock("div",{key:a,class:h.normalizeClass([{"tabbar-item-active":l[n.idKey]===n.activeId},"tabbar-item"]),onClick:c=>s(l[n.idKey])},[l.icon?(h.openBlock(),h.createElementBlock("div",Ap,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(l.icon)))])):h.createCommentVNode("",!0),l[n.labelKey]?(h.openBlock(),h.createElementBlock("div",Lp,h.toDisplayString(l[n.labelKey]),1)):h.createCommentVNode("",!0)],10,Sp))),128))])],2))}}),ak="";const vp={key:0,class:"tag-left-icon"},Dp={class:"tag-content"},Ip={key:1,class:"tag-right-icon"};var Np=h.defineComponent({__name:"Tag",props:{theme:{default:"default"},rounded:{type:Boolean,default:!1},styles:{default:()=>({})}},setup(n){const e=n,t=h.computed(()=>[`tag-${e.theme}`,{"tag-rounded":e.rounded}]);return(i,s)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(t),"tag-wrapper"]),style:h.normalizeStyle(n.styles)},[i.$slots.leftIcon?(h.openBlock(),h.createElementBlock("div",vp,[h.renderSlot(i.$slots,"leftIcon")])):h.createCommentVNode("",!0),h.createElementVNode("span",Dp,[h.renderSlot(i.$slots,"default")]),i.$slots.rightIcon?(h.openBlock(),h.createElementBlock("div",Ip,[h.renderSlot(i.$slots,"rightIcon")])):h.createCommentVNode("",!0)],6))}}),hk="";const Ep={class:"textarea-wrapper"},Tp=["disabled","placeholder","rows","value"];var Bp=h.defineComponent({__name:"Textarea",props:{modelValue:{default:void 0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},rows:{default:3}},emits:["update:modelValue"],setup(n,{emit:e}){function t(i){const{value:s}=i.target;e("update:modelValue",s)}return(i,s)=>(h.openBlock(),h.createElementBlock("div",Ep,[h.createElementVNode("textarea",{disabled:n.disabled,placeholder:n.placeholder,rows:n.rows,value:n.modelValue,onInput:t},`
|
|
2
|
+
`,40,Tp)]))}}),ck="";const _p={class:"switch-wrapper"};var Op=h.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,i=()=>{e("update:modelValue",!t.modelValue),e("change",!t.modelValue)};return(s,r)=>(h.openBlock(),h.createElementBlock("div",_p,[h.createElementVNode("button",{class:h.normalizeClass([{"bg-gray-200":!n.modelValue,"!bg-primary":n.modelValue},"switch-inner"]),"aria-checked":"false",role:"switch",type:"button",onClick:i},[h.createElementVNode("span",{class:h.normalizeClass([{"translate-x-0":!n.modelValue,"translate-x-5":n.modelValue},"switch-indicator"]),"aria-hidden":"true"},[h.renderSlot(s.$slots,"icon")],2)],2)]))}}),fk="";const zp={class:"flex justify-between items-start py-2 mb-2"},jp={class:"flex flex-row items-center gap-3"},Vp={class:"text-base text-gray-900 font-bold"},$p={class:"flex items-center gap-4"},Pp={class:"flex-1 flex items-stretch"},Rp={class:"text-sm text-gray-700"},Hp={class:"flex flex-col sm:flex-row gap-[10px]"};var Xr=h.defineComponent({__name:"Dialog",props:{type:{default:"info"},title:{default:"\u63D0\u793A"},description:{default:""},confirmText:{default:"\u786E\u5B9A"},confirmType:{default:"primary"},cancelText:{default:"\u53D6\u6D88"},visible:{type:Boolean,default:!1},onConfirm:{type:Function,default:()=>{}},onCancel:{type:Function,default:()=>{}}},emits:["update:visible","close"],setup(n,{emit:e}){const t=n,i={success:{icon:Wn,color:"green"},info:{icon:Ei,color:"blue"},warning:{icon:Fn,color:"orange"},error:{icon:Fr,color:"red"}},s=h.computed(()=>i[t.type]),r=h.ref(!1),o=()=>{t.onCancel&&t.onCancel(),a()},l=async()=>{t.onConfirm&&(r.value=!0,await t.onConfirm()),a()},a=()=>{r.value=!1,e("update:visible",!1),e("close")};return(c,f)=>(h.openBlock(),h.createBlock(h.unref(qr),{visible:n.visible,width:450,onClose:f[0]||(f[0]=u=>o())},{footer:h.withCtx(()=>[h.createElementVNode("div",Hp,[h.createVNode(h.unref(Un),{loading:r.value,type:n.confirmType,onClick:l},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.confirmText),1)]),_:1},8,["loading","type"]),h.createVNode(h.unref(Un),{onClick:o},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.cancelText),1)]),_:1})])]),default:h.withCtx(()=>[h.createElementVNode("div",zp,[h.createElementVNode("div",jp,[(h.openBlock(),h.createBlock(h.resolveDynamicComponent(h.unref(s).icon),{class:h.normalizeClass([`text-${h.unref(s).color}-500`,"w-6 h-6"])},null,8,["class"])),h.createElementVNode("div",Vp,h.toDisplayString(n.title),1)]),h.createElementVNode("div",null,[h.createVNode(h.unref(Ni),{class:"cursor-pointer",onClick:o})])]),h.createElementVNode("div",$p,[h.createElementVNode("div",Pp,[h.createElementVNode("div",Rp,h.toDisplayString(n.description),1)])])]),_:1},8,["visible"]))}});const eo="DIALOG_PROVIDER_PROVIDE_KEY";var Fp=h.defineComponent({__name:"DialogProvider",setup(n){const e=h.ref({visible:!1,title:""});return h.provide(eo,e),(t,i)=>(h.openBlock(),h.createElementBlock(h.Fragment,null,[h.renderSlot(t.$slots,"default"),h.createVNode(h.unref(Xr),{visible:e.value.visible,"onUpdate:visible":i[0]||(i[0]=s=>e.value.visible=s),"cancel-text":e.value.cancelText,"confirm-text":e.value.confirmText,"confirm-type":e.value.confirmType,description:e.value.description,"on-cancel":e.value.onCancel,"on-confirm":e.value.onConfirm,title:e.value.title,type:e.value.type},null,8,["visible","cancel-text","confirm-text","confirm-type","description","on-cancel","on-confirm","title","type"])],64))}});function Wp(){const n=h.inject(eo);if(!n)throw new Error("DialogProvider is not mounted");const e=t=>i=>{n.value={title:"",visible:!1},n.value={...n.value,...i},n.value.type=t,n.value.visible=!0};return{success:e("success"),info:e("info"),warning:e("warning"),error:e("error")}}const Up={class:"bg-white flex items-center justify-between"},Yp={class:"flex-1 flex justify-between sm:!hidden items-center"},Gp=["onClick"],Kp={class:"text-sm text-gray-500"},qp=["onClick"],Qp={class:"hidden sm:flex-1 sm:flex sm:items-center"},Zp={"aria-label":"Pagination",class:"relative z-0 inline-flex rounded-base shadow-sm -space-x-px"},Jp=["onClick"],Xp=["onClick"],eg=["onClick"];var tg=h.defineComponent({__name:"Pagination",props:{page:{default:1},size:{default:10},total:{default:0}},emits:["update:page","update:size","change"],setup(n,{emit:e}){const t=n,{page:i,size:s,total:r}=h.toRefs(t),o=h.ref(Math.random()),l=({currentPage:a,currentPageSize:c})=>{e("change",{page:a,size:c})};return h.watch(()=>r==null?void 0:r.value,()=>{o.value=Math.random()}),(a,c)=>(h.openBlock(),h.createBlock(h.unref(vc.UseOffsetPagination),{key:o.value,page:h.unref(i),"page-size":h.unref(s),total:h.unref(r),onPageChange:l,onPageSizeChange:l},{default:h.withCtx(({currentPage:f,next:u,prev:d,pageCount:m})=>[h.createElementVNode("div",Up,[h.createElementVNode("div",Yp,[h.createElementVNode("span",{class:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 cursor-pointer",onClick:d},[h.createVNode(h.unref(Hn))],8,Gp),h.createElementVNode("span",Kp,h.toDisplayString(f)+" / "+h.toDisplayString(m),1),h.createElementVNode("span",{class:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 cursor-pointer",onClick:u},[h.createVNode(h.unref(Ii))],8,qp)]),h.createElementVNode("div",Qp,[h.createElementVNode("nav",Zp,[h.createElementVNode("span",{class:"relative inline-flex items-center px-2 py-2 rounded-l-[4px] border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 cursor-pointer",onClick:d},[h.createVNode(h.unref(Hn))],8,Jp),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m,p=>(h.openBlock(),h.createElementBlock("span",{key:p,class:h.normalizeClass([{"z-10 bg-primary/1 border-primary text-primary":p===f,"bg-white border-gray-300 text-gray-500 hover:bg-gray-50":p!==f},"relative inline-flex items-center px-4 py-2 border text-sm font-medium cursor-pointer select-none"]),"aria-current":"page",onClick:g=>f.value=p},h.toDisplayString(p),11,Xp))),128)),h.createElementVNode("span",{class:"relative inline-flex items-center px-2 py-2 rounded-r-[4px] border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 cursor-pointer",onClick:u},[h.createVNode(h.unref(Ii))],8,eg)])])])]),_:1},8,["page","page-size","total"]))}});class V{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),ze.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),ze.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new Qt(this),r=new Qt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new Qt(this,e)}iterRange(e,t=this.length){return new io(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new no(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?V.empty:e.length<=32?new Q(e):ze.from(Q.split(e,[]))}}class Q extends V{constructor(e,t=ig(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new ng(s,l,i,o);s=l+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Q(to(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),l=Ti(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new Q(l,o.length+r.length));else{let a=l.length>>1;i.push(new Q(l.slice(0,a)),new Q(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Q))return super.replace(e,t,i);let s=Ti(this.text,Ti(i.text,to(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Q(s,r):ze.from(Q.split(s,[]),r)}sliceString(e,t=this.length,i=`
|
|
3
|
+
`){let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new Q(i,s)),i=[],s=-1);return s>-1&&t.push(new Q(i,s)),t}}class ze extends V{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let c=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!c?i.push(l):l.decompose(e-o,t-o,i,c)}o=a+1}}replace(e,t,i){if(i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let f=this.children.slice();return f[s]=a,new ze(f,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
4
|
+
`){let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ze))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],c=e.children[r];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let m of e)i+=m.lines;if(i<32){let m=[];for(let p of e)p.flatten(m);return new Q(m,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,c=-1,f=[];function u(m){let p;if(m.lines>r&&m instanceof ze)for(let g of m.children)u(g);else m.lines>o&&(a>o||!a)?(d(),l.push(m)):m instanceof Q&&a&&(p=f[f.length-1])instanceof Q&&m.lines+p.lines<=32?(a+=m.lines,c+=m.length+1,f[f.length-1]=new Q(p.text.concat(m.text),p.length+1+m.length)):(a+m.lines>s&&d(),a+=m.lines,c+=m.length+1,f.push(m))}function d(){a!=0&&(l.push(f.length==1?f[0]:ze.from(f,c)),c=-1,a=f.length=0)}for(let m of e)u(m);return d(),l.length==1?l[0]:new ze(l,t)}}V.empty=new Q([""],0);function ig(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Ti(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function to(n,e,t){return Ti(n,[""],e,t)}class Qt{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Q?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof Q?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
5
|
+
`,this;e--}else if(s instanceof Q){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Q?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class io{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Qt(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class no{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(V.prototype[Symbol.iterator]=function(){return this.iter()},Qt.prototype[Symbol.iterator]=io.prototype[Symbol.iterator]=no.prototype[Symbol.iterator]=function(){return this});class ng{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let Nt="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(n=>n?parseInt(n,36):1);for(let n=1;n<Nt.length;n++)Nt[n]+=Nt[n-1];function sg(n){for(let e=1;e<Nt.length;e+=2)if(Nt[e]>n)return Nt[e-1]<=n;return!1}function so(n){return n>=127462&&n<=127487}const ro=8205;function ke(n,e,t=!0,i=!0){return(t?oo:rg)(n,e,i)}function oo(n,e,t){if(e==n.length)return e;e&&lo(n.charCodeAt(e))&&ao(n.charCodeAt(e-1))&&e--;let i=ie(n,e);for(e+=Ce(i);e<n.length;){let s=ie(n,e);if(i==ro||s==ro||t&&sg(s))e+=Ce(s),i=s;else if(so(s)){let r=0,o=e-2;for(;o>=0&&so(ie(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function rg(n,e,t){for(;e>0;){let i=oo(n,e-2,t);if(i<e)return i;e--}return 0}function lo(n){return n>=56320&&n<57344}function ao(n){return n>=55296&&n<56320}function ie(n,e){let t=n.charCodeAt(e);if(!ao(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return lo(i)?(t-55296<<10)+(i-56320)+65536:t}function Gn(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Ce(n){return n<65536?1:2}const Kn=/\r\n?|\n/;var de=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(de||(de={}));class je{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){qn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new je(e)}composeDesc(e){return this.empty?e:e.empty?this:ho(this,e)}mapDesc(e,t=!1){return e.empty?this:Qn(this,e,t)}mapPos(e,t=-1,i=de.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=s+l;if(a<0){if(c>e)return r+(e-s);r+=l}else{if(i!=de.Simple&&c>=e&&(i==de.TrackDel&&s<e&&c>e||i==de.TrackBefore&&s<e||i==de.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=c}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new je(e)}static create(e){return new je(e)}}class X extends je{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return qn(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return Qn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s<t.length;s+=2){let o=t[s],l=t[s+1];if(l>=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;i.length<a;)i.push(V.empty);i.push(o?e.slice(r,r+o):V.empty)}r+=o}return new X(t,i)}compose(e){return this.empty?e:e.empty?this:ho(this,e,!0)}map(e,t=!1){return e.empty?this:Qn(this,e,t,!0)}iterChanges(e,t=!1){qn(this,e,t)}get desc(){return je.create(this.sections)}filter(e){let t=[],i=[],s=[],r=new Zt(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break e;let f=Math.min(r.len,a-l);ae(s,f,-1);let u=r.ins==-1?-1:r.off==0?r.ins:0;ae(t,f,u),u>0&&Xe(i,t,r.text),r.forward(f),l+=f}let c=e[o++];for(;l<c;){if(r.done)break e;let f=Math.min(r.len,c-l);ae(t,f,-1),ae(s,f,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(f),l+=f}}return{changes:new X(t,i),filtered:je.create(s)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],s=this.sections[t+1];s<0?e.push(i):s==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,l=null;function a(f=!1){if(!f&&!s.length)return;o<t&&ae(s,t-o,-1);let u=new X(s,r);l=l?l.compose(u.map(l)):u,s=[],r=[],o=0}function c(f){if(Array.isArray(f))for(let u of f)c(u);else if(f instanceof X){if(f.length!=t)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${t})`);a(),l=l?l.compose(f.map(l)):f}else{let{from:u,to:d=u,insert:m}=f;if(u>d||u<0||d>t)throw new RangeError(`Invalid change range ${u} to ${d} (in doc of length ${t})`);let p=m?typeof m=="string"?V.of(m.split(i||Kn)):m:V.empty,g=p.length;if(u==d&&g==0)return;u<o&&a(),u>o&&ae(s,u-o,-1),ae(s,d-u,g),Xe(r,s,p),o=d}}return c(e),a(!l),l}static empty(e){return new X(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")t.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length<s;)i.push(V.empty);i[s]=V.of(r.slice(1)),t.push(r[0],i[s].length)}}}return new X(t,i)}static createSet(e,t){return new X(e,t)}}function ae(n,e,t,i=!1){if(e==0&&t<=0)return;let s=n.length-2;s>=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Xe(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(V.empty);n.push(t)}}function qn(n,e,t){let i=n.inserted;for(let s=0,r=0,o=0;o<n.sections.length;){let l=n.sections[o++],a=n.sections[o++];if(a<0)s+=l,r+=l;else{let c=s,f=r,u=V.empty;for(;c+=l,f+=a,a&&i&&(u=u.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)l=n.sections[o++],a=n.sections[o++];e(s,c,r,f,u),s=c,r=f}}}function Qn(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Zt(n),l=new Zt(e);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);ae(s,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let c=l.len;for(ae(s,l.ins,-1);c;){let f=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=f&&(ae(s,0,o.ins),r&&Xe(r,s,o.text),a=o.i),o.forward(f),c-=f}l.next()}else if(o.ins>=0){let c=0,f=o.len;for(;f;)if(l.ins==-1){let u=Math.min(f,l.len);c+=u,f-=u,l.forward(u)}else if(l.ins==0&&l.len<f)f-=l.len,l.next();else break;ae(s,c,a<o.i?o.ins:0),r&&a<o.i&&Xe(r,s,o.text),a=o.i,o.forward(o.len-f)}else{if(o.done&&l.done)return r?X.createSet(s,r):je.create(s);throw new Error("Mismatched change set lengths")}}function ho(n,e,t=!1){let i=[],s=t?[]:null,r=new Zt(n),o=new Zt(e);for(let l=!1;;){if(r.done&&o.done)return s?X.createSet(i,s):je.create(i);if(r.ins==0)ae(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)ae(i,0,o.ins,l),s&&Xe(s,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),c=i.length;if(r.ins==-1){let f=o.ins==-1?-1:o.off?0:o.ins;ae(i,a,f,l),s&&f&&Xe(s,i,o.text)}else o.ins==-1?(ae(i,r.off?0:r.len,a,l),s&&Xe(s,i,r.textBit(a))):(ae(i,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Xe(s,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),r.forward2(a),o.forward(a)}}}}class Zt{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?V.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?V.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class gt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new gt(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return w.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return w.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return w.range(e.anchor,e.head)}static create(e,t,i){return new gt(e,t,i)}}class w{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:w.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;t<this.ranges.length;t++)if(!this.ranges[t].eq(e.ranges[t]))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new w([this.main],0)}addRange(e,t=!0){return w.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,w.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new w(e.ranges.map(t=>gt.fromJSON(t)),e.main)}static single(e,t=e){return new w([w.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=i:r.from<i)return w.normalized(e.slice(),t);i=r.to}return new w(e,t)}static cursor(e,t=0,i,s){return gt.create(e,e,(t==0?0:t<0?4:8)|(i==null?3:Math.min(2,i))|(s!=null?s:33554431)<<5)}static range(e,t,i){let s=(i!=null?i:33554431)<<5;return t<e?gt.create(t,e,16|s|8):gt.create(e,t,s|(t>e?4:0))}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);s<=t&&t--,e.splice(--s,2,r.anchor>r.head?w.range(a,l):w.range(l,a))}}return new w(e,t)}}function co(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Zn=0;class D{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=Zn++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new D(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Jn),!!e.static,e.enables)}of(e){return new Bi([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bi(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Bi(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Jn(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Bi{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=Zn++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,c=!1,f=[];for(let u of this.dependencies)u=="doc"?a=!0:u=="selection"?c=!0:(((t=e[u.id])!==null&&t!==void 0?t:1)&1)==0&&f.push(e[u.id]);return{create(u){return u.values[o]=i(u),1},update(u,d){if(a&&d.docChanged||c&&(d.docChanged||d.selection)||Xn(u,f)){let m=i(u);if(l?!fo(m,u.values[o],s):!s(m,u.values[o]))return u.values[o]=m,1}return 0},reconfigure:(u,d)=>{let m=i(u),p=d.config.address[r];if(p!=null){let g=zi(d,p);if(this.dependencies.every(y=>y instanceof D?d.facet(y)===u.facet(y):y instanceof ne?d.field(y,!1)==u.field(y,!1):!0)||(l?fo(m,g,s):s(m,g)))return u.values[o]=g,0}return u.values[o]=m,1}}}}function fo(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Xn(n,e){let t=!1;for(let i of e)Xt(n,i)&1&&(t=!0);return t}function og(n,e,t){let i=t.map(a=>n[a.id]),s=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=n[e.id]>>1;function l(a){let c=[];for(let f=0;f<i.length;f++){let u=zi(a,i[f]);if(s[f]==2)for(let d of u)c.push(d);else c.push(u)}return e.combine(c)}return{create(a){for(let c of i)Xt(a,c);return a.values[o]=l(a),1},update(a,c){if(!Xn(a,r))return 0;let f=l(a);return e.compare(f,a.values[o])?0:(a.values[o]=f,1)},reconfigure(a,c){let f=Xn(a,i),u=c.config.facets[e.id],d=c.facet(e);if(u&&!f&&Jn(t,u))return a.values[o]=d,0;let m=l(a);return e.compare(m,d)?(a.values[o]=d,0):(a.values[o]=m,1)}}}const uo=D.define({static:!0});class ne{constructor(e,t,i,s,r){this.id=e,this.createF=t,this.updateF=i,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let t=new ne(Zn++,e.create,e.update,e.compare||((i,s)=>i===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(uo).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,uo.of({field:this,create:e})]}get extension(){return this}}const yt={lowest:4,low:3,default:2,high:1,highest:0};function Jt(n){return e=>new mo(e,n)}const Et={highest:Jt(yt.highest),high:Jt(yt.high),default:Jt(yt.default),low:Jt(yt.low),lowest:Jt(yt.lowest)};class mo{constructor(e,t){this.inner=e,this.prec=t}}class _i{of(e){return new es(this,e)}reconfigure(e){return _i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class es{constructor(e,t){this.compartment=e,this.inner=t}}class Oi{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let d of lg(e,t,o))d instanceof ne?s.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],c=[];for(let d of s)l[d.id]=c.length<<1,c.push(m=>d.slot(m));let f=i==null?void 0:i.config.facets;for(let d in r){let m=r[d],p=m[0].facet,g=f&&f[d]||[];if(m.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,Jn(g,m))a.push(i.facet(p));else{let y=p.combine(m.map(x=>x.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of m)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=c.length<<1,c.push(x=>y.dynamicSlot(x)));l[p.id]=c.length<<1,c.push(y=>og(y,p,m))}}let u=c.map(d=>d(l));return new Oi(e,o,u,l,a,r)}}function lg(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof es&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let c of o)r(c,l);else if(o instanceof es){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),r(c,l)}else if(o instanceof mo)r(o.inner,o.prec);else if(o instanceof ne)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Bi)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,yt.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(c,l)}}return r(n,yt.default),i.reduce((o,l)=>o.concat(l))}function Xt(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function zi(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const po=D.define(),go=D.define({combine:n=>n.some(e=>e),static:!0}),yo=D.define({combine:n=>n.length?n[0]:void 0,static:!0}),wo=D.define(),xo=D.define(),bo=D.define(),ko=D.define({combine:n=>n.length?n[0]:!1});class wt{constructor(e,t){this.type=e,this.value=t}static define(){return new ag}}class ag{of(e){return new wt(this,e)}}class hg{constructor(e){this.map=e}of(e){return new B(this,e)}}class B{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new B(this.type,t)}is(e){return this.type==e}static define(e={}){return new hg(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}B.reconfigure=B.define(),B.appendConfig=B.define();class ee{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&co(i,t.newLength),r.some(l=>l.type==ee.time)||(this.annotations=r.concat(ee.time.of(Date.now())))}static create(e,t,i,s,r,o){return new ee(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ee.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ee.time=wt.define(),ee.userEvent=wt.define(),ee.addToHistory=wt.define(),ee.remote=wt.define();function cg(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i<n.length&&(s==e.length||e[s]>=n[i]))r=n[i++],o=n[i++];else if(s<e.length)r=e[s++],o=e[s++];else return t;!t.length||t[t.length-1]<r?t.push(r,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Co(n,e,t){var i;let s,r,o;return t?(s=e.changes,r=X.empty(e.changes.length),o=n.changes.compose(e.changes)):(s=e.changes.map(n.changes),r=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(i=n.selection)===null||i===void 0?void 0:i.map(s),effects:B.mapEffects(n.effects,s).concat(B.mapEffects(e.effects,r)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ts(n,e,t){let i=e.selection,s=Tt(e.annotations);return e.userEvent&&(s=s.concat(ee.userEvent.of(e.userEvent))),{changes:e.changes instanceof X?e.changes:X.of(e.changes||[],t,n.facet(yo)),selection:i&&(i instanceof w?i:w.single(i.anchor,i.head)),effects:Tt(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function Mo(n,e,t){let i=ts(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(t=!1);let o=!!e[r].sequential;i=Co(i,ts(n,e[r],o?i.changes.newLength:n.doc.length),o)}let s=ee.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return ug(t?fg(s):s)}function fg(n){let e=n.startState,t=!0;for(let s of e.facet(wo)){let r=s(n);if(r===!1){t=!1;break}Array.isArray(r)&&(t=t===!0?r:cg(t,r))}if(t!==!0){let s,r;if(t===!1)r=n.changes.invertedDesc,s=X.empty(e.doc.length);else{let o=n.changes.filter(t);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}n=ee.create(e,s,n.selection&&n.selection.map(r),B.mapEffects(n.effects,r),n.annotations,n.scrollIntoView)}let i=e.facet(xo);for(let s=i.length-1;s>=0;s--){let r=i[s](n);r instanceof ee?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ee?n=r[0]:n=Mo(e,Tt(r),!1)}return n}function ug(n){let e=n.startState,t=e.facet(bo),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=Co(n,ts(e,r,n.changes.newLength),!0))}return i==n?n:ee.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const dg=[];function Tt(n){return n==null?dg:Array.isArray(n)?n:[n]}var me=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(me||(me={}));const mg=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let is;try{is=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pg(n){if(is)return is.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>"\x80"&&(t.toUpperCase()!=t.toLowerCase()||mg.test(t)))return!0}return!1}function gg(n){return e=>{if(!/\S/.test(e))return me.Space;if(pg(e))return me.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return me.Word;return me.Other}}class z{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Xt(this,l<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Xt(this,i),zi(this,i)}update(...e){return Mo(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:s}=t;for(let o of e.effects)o.is(_i.reconfigure)?(t&&(s=new Map,t.compartments.forEach((l,a)=>s.set(a,l)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(B.reconfigure)?(t=null,i=o.value):o.is(B.appendConfig)&&(t=null,i=Tt(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=Oi.resolve(i,s,this),r=new z(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,a)=>a.reconfigure(l,this),null).values),new z(t,e.newDoc,e.newSelection,r,(o,l)=>l.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:w.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Tt(i.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),c=this.changes(a.changes),f=c.map(s);for(let d=0;d<l;d++)r[d]=r[d].map(f);let u=s.mapDesc(c,!0);r.push(a.range.map(u)),s=s.compose(f),o=B.mapEffects(o,f).concat(B.mapEffects(Tt(a.effects),u))}return{changes:s,selection:w.create(r,t.mainIndex),effects:o}}changes(e=[]){return e instanceof X?e:X.of(e,this.doc.length,this.facet(z.lineSeparator))}toText(e){return V.of(e.split(this.facet(z.lineSeparator)||Kn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Xt(this,t),zi(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let s=e[i];s instanceof ne&&this.config.address[s.id]!=null&&(t[i]=s.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(e,r)){let o=i[r],l=e[r];s.push(o.init(a=>o.spec.fromJSON(l,a)))}}return z.create({doc:e.doc,selection:w.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Oi.resolve(e.extensions||[],new Map),i=e.doc instanceof V?e.doc:V.of((e.doc||"").split(t.staticFacet(z.lineSeparator)||Kn)),s=e.selection?e.selection instanceof w?e.selection:w.single(e.selection.anchor,e.selection.head):w.single(0);return co(s,i.length),t.staticFacet(go)||(s=s.asSingle()),new z(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(z.tabSize)}get lineBreak(){return this.facet(z.lineSeparator)||`
|
|
6
|
+
`}get readOnly(){return this.facet(ko)}phrase(e,...t){for(let i of this.facet(z.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(po))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return gg(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=ke(t,o,!1);if(r(t.slice(a,o))!=me.Word)break;o=a}for(;l<s;){let a=ke(t,l);if(r(t.slice(l,a))!=me.Word)break;l=a}return o==l?null:w.range(o+i,l+i)}}z.allowMultipleSelections=go,z.tabSize=D.define({combine:n=>n.length?n[0]:4}),z.lineSeparator=yo,z.readOnly=ko,z.phrases=D.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}}),z.languageData=po,z.changeFilter=wo,z.transactionFilter=xo,z.transactionExtender=bo,_i.reconfigure=B.define();function Ke(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class xt{eq(e){return this==e}range(e,t=e){return ei.create(e,t,this)}}xt.prototype.startSide=xt.prototype.endSide=0,xt.prototype.point=!1,xt.prototype.mapMode=de.TrackDel;class ei{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new ei(e,t,i)}}function ns(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class ss{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,c=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],f=this.from[a]+e,u=this.to[a]+e,d,m;if(f==u){let p=t.mapPos(f,c.startSide,c.mapMode);if(p==null||(d=m=p,c.startSide!=c.endSide&&(m=t.mapPos(f,c.endSide),m<d)))continue}else if(d=t.mapPos(f,c.startSide),m=t.mapPos(u,c.endSide),d>m||d==m&&c.startSide>0&&c.endSide<=0)continue;(m-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(l=Math.max(l,m-d)),i.push(c),s.push(d-o),r.push(m-o))}return{mapped:i.length?new ss(s,r,i,l):null,pos:o}}}class ${constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new $(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(ns)),this.isEmpty)return t.length?$.of(t):this;let l=new Ao(this,null,-1).goto(0),a=0,c=[],f=new et;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let u=t[a++];f.addInner(u.from,u.to,u.value)||c.push(u)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&f.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(f.addInner(l.from,l.to,l.value)||c.push(ei.create(l.from,l.to,l.value))),l.next());return f.finishInner(this.nextLayer.isEmpty&&!c.length?$.empty:this.nextLayer.update({add:c,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)s=Math.max(s,a.maxPoint),t.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:f,pos:u}=a.map(l,e);f&&(s=Math.max(s,f.maxPoint),t.push(f),i.push(u))}}let r=this.nextLayer.map(e);return t.length==0?r:new $(i,t,r||$.empty,s)}between(e,t,i){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(t>=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return ti.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return ti.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=r),l=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=r),a=So(o,l,i),c=new ii(o,a,r),f=new ii(l,a,r);i.iterGaps((u,d,m)=>Lo(c,u,f,d,m,s)),i.empty&&i.length==0&&Lo(c,0,f,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9);let r=e.filter(f=>!f.isEmpty&&t.indexOf(f)<0),o=t.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=So(r,o),a=new ii(r,l,0).goto(i),c=new ii(o,l,0).goto(i);for(;;){if(a.to!=c.to||!os(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>s)return!0;a.next(),c.next()}}static spans(e,t,i,s,r=-1){let o=new ii(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point?(s.point(l,c,o.point,o.activeForPoint(o.to),a,o.pointRank),a=o.openEnd(c)+(o.to>c?1:0)):c>l&&(s.span(l,c,o.active,a),a=o.openEnd(c)),o.to>i)break;l=o.to,o.next()}return a}static of(e,t=!1){let i=new et;for(let s of e instanceof ei?[e]:t?yg(e):e)i.add(s.from,s.to,s.value);return i.finish()}}$.empty=new $([],[],null,-1);function yg(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(ns(e,i)>0)return n.slice().sort(ns);e=i}return n}$.empty.nextLayer=$.empty;class et{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new ss(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new et)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner($.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=$.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function So(n,e,t){let i=new Map;for(let r of n)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(t?t.mapPos(l):l)==r.chunkPos[o]&&!(t!=null&&t.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class Ao{constructor(e,t,i,s=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class ti{constructor(e){this.heap=e}static from(e,t=null,i=-1){let s=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&s.push(new Ao(o,t,i,r));return s.length==1?s[0]:new ti(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)rs(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)rs(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),rs(this.heap,0)}}}function rs(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1<n.length&&s.compare(n[i+1])>=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class ii{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ti.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ji(this.active,e),ji(this.activeTo,e),ji(this.activeRank,e),this.minActive=vo(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t<this.activeRank.length&&this.activeRank[t]<=r;)t++;Vi(this.active,t,i),Vi(this.activeTo,t,s),Vi(this.activeRank,t,r),e&&Vi(e,t,this.cursor.from),this.minActive=vo(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null,s=0;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&ji(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.from<e&&this.cursor.to>e&&s++,this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.from<e&&(s=1),this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){let r=0;for(;r<i.length&&i[r]<e;)r++;this.openStart=r+s}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Lo(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,l=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,f=c<0?n.to+a:t.to,u=Math.min(f,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&os(n.activeForPoint(n.to+a),t.activeForPoint(t.to))||r.comparePoint(l,u,n.point,t.point):u>l&&!os(n.active,t.active)&&r.compareRange(l,u,n.active,t.active),f>o)break;l=f,c<=0&&n.next(),c>=0&&t.next()}}function os(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function ji(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function Vi(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function vo(n,e){let t=-1,i=1e9;for(let s=0;s<e.length;s++)(e[s]-i||n[s].endSide-n[t].endSide)<0&&(t=s,i=e[s]);return t}function ni(n,e,t=n.length){let i=0;for(let s=0;s<t;)n.charCodeAt(s)==9?(i+=e-i%e,s++):(i++,s=ke(n,s));return i}function ls(n,e,t,i){for(let s=0,r=0;;){if(r>=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=ke(n,s)}return i===!0?-1:n.length}const as="\u037C",Do=typeof Symbol>"u"?"__"+as:Symbol.for(as),hs=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Io=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class tt{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,c){let f=[],u=/^@(\w+)\b/.exec(o[0]),d=u&&u[1]=="keyframes";if(u&&l==null)return a.push(o[0]+";");for(let m in l){let p=l[m];if(/&/.test(m))r(m.split(/,\s*/).map(g=>o.map(y=>g.replace(/&/,y))).reduce((g,y)=>g.concat(y)),p,a);else if(p&&typeof p=="object"){if(!u)throw new RangeError("The value of a property ("+m+") should be a primitive value.");r(s(m),p,f,d)}else p!=null&&f.push(m.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(f.length||d)&&a.push((i&&!u&&!c?o.map(i):o).join(", ")+" {"+f.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
7
|
+
`)}static newName(){let e=Io[Do]||1;return Io[Do]=e+1,as+e.toString(36)}static mount(e,t){(e[hs]||new wg(e)).mount(Array.isArray(t)?t:[t])}}let $i=null;class wg{constructor(e){if(!e.head&&e.adoptedStyleSheets&&typeof CSSStyleSheet<"u"){if($i)return e.adoptedStyleSheets=[$i.sheet].concat(e.adoptedStyleSheets),e[hs]=$i;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),$i=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[hs]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r<e.length;r++){let o=e[r],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),t)for(let a=0;a<o.rules.length;a++)t.insertRule(o.rules[a],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(!t){let r="";for(let o=0;o<this.modules.length;o++)r+=this.modules[o].getRules()+`
|
|
8
|
+
`;this.styleTag.textContent=r}}}for(var it={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},si={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},No=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),xg=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),bg=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),Eo=typeof navigator<"u"&&/Mac/.test(navigator.platform),kg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Cg=No&&(Eo||+No[1]<57)||bg&&Eo,se=0;se<10;se++)it[48+se]=it[96+se]=String(se);for(var se=1;se<=24;se++)it[se+111]="F"+se;for(var se=65;se<=90;se++)it[se]=String.fromCharCode(se+32),si[se]=String.fromCharCode(se);for(var cs in it)si.hasOwnProperty(cs)||(si[cs]=it[cs]);function Mg(n){var e=Cg&&(n.ctrlKey||n.altKey||n.metaKey)||(xg||kg)&&n.shiftKey&&n.key&&n.key.length==1,t=!e&&n.key||(n.shiftKey?si:it)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function Pi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Bt(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Sg(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ri(n,e){if(!e.anchorNode)return!1;try{return Bt(n,e.anchorNode)}catch{return!1}}function ri(n){return n.nodeType==3?Ot(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Hi(n,e,t,i){return t?To(n,e,t,i,-1)||To(n,e,t,i,1):!1}function Fi(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function To(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:oi(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Fi(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?oi(n):0}else return!1}}function oi(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}const Bo={left:0,right:0,top:0,bottom:0};function Wi(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Ag(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Lg(n,e,t,i,s,r,o,l){let a=n.ownerDocument,c=a.defaultView;for(let f=n;f;)if(f.nodeType==1){let u,d=f==a.body;if(d)u=Ag(c);else{if(f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let g=f.getBoundingClientRect();u={left:g.left,right:g.left+f.clientWidth,top:g.top,bottom:g.top+f.clientHeight}}let m=0,p=0;if(s=="nearest")e.top<u.top?(p=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+p&&(p=e.bottom-u.bottom+p+o)):e.bottom>u.bottom&&(p=e.bottom-u.bottom+o,t<0&&e.top-p<u.top&&(p=-(u.top+p-e.top+o)));else{let g=e.bottom-e.top,y=u.bottom-u.top;p=(s=="center"&&g<=y?e.top+g/2-y/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-y+o)-u.top}if(i=="nearest"?e.left<u.left?(m=-(u.left-e.left+r),t>0&&e.right>u.right+m&&(m=e.right-u.right+m+r)):e.right>u.right&&(m=e.right-u.right+r,t<0&&e.left<u.left+m&&(m=-(u.left+m-e.left+r))):m=(i=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:i=="start"==l?e.left-r:e.right-(u.right-u.left)+r)-u.left,m||p)if(d)c.scrollBy(m,p);else{let g=0,y=0;if(p){let x=f.scrollTop;f.scrollTop+=p,y=f.scrollTop-x}if(m){let x=f.scrollLeft;f.scrollLeft+=m,g=f.scrollLeft-x}e={left:e.left-g,top:e.top-y,right:e.right-g,bottom:e.bottom-y},g&&Math.abs(g-m)<1&&(i="nearest"),y&&Math.abs(y-p)<1&&(s="nearest")}if(d)break;f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}class vg{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let _t=null;function _o(n){if(n.setActive)return n.setActive();if(_t)return n.focus(_t);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(_t==null?{get preventScroll(){return _t={preventScroll:!0},!0}}:void 0),!_t){_t=!1;for(let t=0;t<e.length;){let i=e[t++],s=e[t++],r=e[t++];i.scrollTop!=s&&(i.scrollTop=s),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let Oo;function Ot(n,e,t=e){let i=Oo||(Oo=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function li(n,e,t){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0},s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,n.dispatchEvent(r),s.defaultPrevented||r.defaultPrevented}function Dg(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function zo(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function Ig(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(;;)if(i){if(t.nodeType!=1)return!1;let s=t.childNodes[i-1];s.contentEditable=="false"?i--:(t=s,i=oi(t))}else{if(t==n)return!0;i=Fi(t),t=t.parentNode}}class he{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new he(e.parentNode,Fi(e),t)}static after(e,t){return new he(e.parentNode,Fi(e)+1,t)}}const fs=[];class H{constructor(){this.parent=null,this.dom=null,this.dirty=2}get editorView(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}coordsAt(e,t){return null}sync(e){if(this.dirty&2){let t=this.dom,i=null,s;for(let r of this.children){if(r.dirty){if(!r.dom&&(s=i?i.nextSibling:t.firstChild)){let o=H.get(s);(!o||!o.parent&&o.constructor==r.constructor)&&r.reuseDOM(s)}r.sync(e),r.dirty=0}if(s=i?i.nextSibling:t.firstChild,e&&!e.written&&e.node==t&&s!=r.dom&&(e.written=!0),r.dom.parentNode==t)for(;s&&s!=r.dom;)s=jo(s);else t.insertBefore(r.dom,s);i=r.dom}for(s=i?i.nextSibling:t.firstChild,s&&e&&e.node==t&&(e.written=!0);s;)s=jo(s)}else if(this.dirty&1)for(let t of this.children)t.dirty&&(t.sync(e),t.dirty=0)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let s=oi(e)==0?0:t==0?-1:1;for(;;){let r=e.parentNode;if(r==this.dom)break;s==0&&r.firstChild!=r.lastChild&&(e==r.firstChild?s=-1:s=1),e=r}s<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!H.get(i);)i=i.nextSibling;if(!i)return this.length;for(let s=0,r=0;;s++){let o=this.children[s];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(e,t,i=0){let s=-1,r=-1,o=-1,l=-1;for(let a=0,c=i,f=i;a<this.children.length;a++){let u=this.children[a],d=c+u.length;if(c<e&&d>t)return u.domBoundsAround(e,t,c);if(d>=e&&s==-1&&(s=a,r=c),c>t&&u.dom.parentNode==this.dom){o=a,l=f;break}f=d,c=d+u.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=fs){this.markDirty();for(let s=e;s<t;s++){let r=this.children[s];r.parent==this&&r.destroy()}this.children.splice(e,t-e,...i);for(let s=0;s<i.length;s++)i[s].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Vo(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}merge(e,t,i,s,r,o){return!1}become(e){return!1}getSide(){return 0}destroy(){this.parent=null}}H.prototype.breakAfter=0;function jo(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Vo{constructor(e,t,i){this.children=e,this.pos=t,this.i=i,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function $o(n,e,t,i,s,r,o,l,a){let{children:c}=n,f=c.length?c[e]:null,u=r.length?r[r.length-1]:null,d=u?u.breakAfter:o;if(!(e==i&&f&&!o&&!d&&r.length<2&&f.merge(t,s,r.length?u:null,t==0,l,a))){if(i<c.length){let m=c[i];m&&s<m.length?(e==i&&(m=m.split(s),s=0),!d&&u&&m.merge(0,s,u,!0,0,a)?r[r.length-1]=m:(s&&m.merge(0,s,null,!1,0,a),r.push(m))):m!=null&&m.breakAfter&&(u?u.breakAfter=1:o=1),i++}for(f&&(f.breakAfter=o,t>0&&(!o&&r.length&&f.merge(t,f.length,r[0],!1,l,0)?f.breakAfter=r.shift().breakAfter:(t<f.length||f.children.length&&f.children[f.children.length-1].length==0)&&f.merge(t,f.length,null,!1,l,0),e++));e<i&&r.length;)if(c[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(c[e].become(r[0]))e++,r.shift(),l=r.length?0:a;else break;!r.length&&e&&i<c.length&&!c[e-1].breakAfter&&c[i].merge(0,0,c[e-1],!1,l,a)&&e--,(e<i||r.length)&&n.replaceChildren(e,i,r)}}function Po(n,e,t,i,s,r){let o=n.childCursor(),{i:l,off:a}=o.findPos(t,1),{i:c,off:f}=o.findPos(e,-1),u=e-t;for(let d of i)u+=d.length;n.length+=u,$o(n,c,f,l,a,i,0,s,r)}let Me=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},us=typeof document<"u"?document:{documentElement:{style:{}}};const ds=/Edge\/(\d+)/.exec(Me.userAgent),Ro=/MSIE \d/.test(Me.userAgent),ms=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Me.userAgent),Ui=!!(Ro||ms||ds),Ho=!Ui&&/gecko\/(\d+)/i.test(Me.userAgent),ps=!Ui&&/Chrome\/(\d+)/.exec(Me.userAgent),Fo="webkitFontSmoothing"in us.documentElement.style,Wo=!Ui&&/Apple Computer/.test(Me.vendor),Uo=Wo&&(/Mobile\/\w+/.test(Me.userAgent)||Me.maxTouchPoints>2);var v={mac:Uo||/Mac/.test(Me.platform),windows:/Win/.test(Me.platform),linux:/Linux|X11/.test(Me.platform),ie:Ui,ie_version:Ro?us.documentMode||6:ms?+ms[1]:ds?+ds[1]:0,gecko:Ho,gecko_version:Ho?+(/Firefox\/(\d+)/.exec(Me.userAgent)||[0,0])[1]:0,chrome:!!ps,chrome_version:ps?+ps[1]:0,ios:Uo,android:/Android\b/.test(Me.userAgent),webkit:Fo,safari:Wo,webkit_version:Fo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:us.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Ng=256;class nt extends H{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof nt)||this.length-(t-e)+i.length>Ng)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new nt(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new he(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return gs(this.dom,e,t)}}class Ve extends H{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(zo(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Ve&&i.mark.eq(this.mark))||e&&r<=0||t<this.length&&o<=0)?!1:(Po(this,e,t,i?i.children:[],r-1,o-1),this.markDirty(),!0)}split(e){let t=[],i=0,s=-1,r=0;for(let l of this.children){let a=i+l.length;a>e&&t.push(i<e?l.split(e-i):l),s<0&&i>=e&&(s=r),i=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Ve(this.mark,t,o)}domAtPos(e){return Ko(this,e)}coordsAt(e,t){return Qo(this,e,t)}}function gs(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?v.chrome||v.gecko||(e?(s--,o=1):r<i&&(r++,o=-1)):t<0?s--:r<i&&r++;let l=Ot(n,s,r).getClientRects();if(!l.length)return Bo;let a=l[(o?o<0:t>=0)?0:l.length-1];return v.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,c=>c.width)||a),o?Wi(a,o<0):a||null}class st extends H{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||st)(e,t,i)}split(e){let t=st.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){(!this.dom||!this.widget.updateDOM(this.dom))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof st)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e.length==this.length&&e instanceof st&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.eq(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return V.empty;let e=this;for(;e.parent;)e=e.parent;let t=e.editorView,i=t&&t.state.doc,s=this.posAtStart;return i?i.slice(s,s+this.length):V.empty}domAtPos(e){return e==0?he.before(this.dom):he.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.dom.getClientRects(),s=null;if(!i.length)return Bo;for(let r=e>0?i.length-1:0;s=i[r],!(e>0?r==0:r==i.length-1||s.top<s.bottom);r+=e>0?-1:1);return e==0&&t>0||e==this.length&&t<=0?s:Wi(s,e==0)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Yo extends st{domAtPos(e){let{topView:t,text:i}=this.widget;return t?ys(e,0,t,i,(s,r)=>s.domAtPos(r),s=>new he(i,Math.min(s,i.nodeValue.length))):new he(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?Go(e,t,i,s):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?ys(e,t,i,s,(r,o,l)=>r.coordsAt(o,l),(r,o)=>gs(s,r,o)):gs(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}}function ys(n,e,t,i,s,r){if(t instanceof Ve){for(let o=t.dom.firstChild;o;o=o.nextSibling){let l=H.get(o);if(!l)return r(n,e);let a=Bt(o,i),c=l.length+(a?i.nodeValue.length:0);if(n<c||n==c&&l.getSide()<=0)return a?ys(n,e,l,i,s,r):s(l,n,e);n-=c}return s(t,t.length,-1)}else return t.dom==i?r(n,e):s(t,n,e)}function Go(n,e,t,i){if(t instanceof Ve)for(let s of t.children){let r=0,o=Bt(s.dom,i);if(Bt(s.dom,n))return r+(o?Go(n,e,s,i):s.localPosFromDOM(n,e));r+=o?i.nodeValue.length:s.length}else if(t.dom==i)return Math.min(e,i.nodeValue.length);return t.localPosFromDOM(n,e)}class zt extends H{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof zt&&e.side==this.side}split(){return new zt(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return he.before(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){let t=this.dom.getBoundingClientRect(),i=Eg(this,this.side>0?-1:1);return i&&i.top<t.bottom&&i.bottom>t.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return V.empty}}nt.prototype.children=st.prototype.children=zt.prototype.children=fs;function Eg(n,e){let t=n.parent,i=t?t.children.indexOf(n):-1;for(;t&&i>=0;)if(e<0?i>0:i<t.children.length){let s=t.children[i+e];if(s instanceof nt){let r=s.coordsAt(e<0?s.length:0,e);if(r)return r}i+=e}else if(t instanceof Ve&&t.parent)i=t.parent.children.indexOf(t)+(e<0?0:1),t=t.parent;else{let s=t.dom.lastChild;if(s&&s.nodeName=="BR")return s.getClientRects()[0];break}}function Ko(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;s<i.length;s++){let o=i[s],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(e>r&&e<l&&o.dom.parentNode==t)return o.domAtPos(e-r);if(e<=r)break;r=l}}for(let r=s;r>0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r<i.length;r++){let o=i[r];if(o.dom.parentNode==t)return o.domAtPos(0)}return new he(t,0)}function qo(n,e,t){let i,{children:s}=n;t>0&&e instanceof Ve&&s.length&&(i=s[s.length-1])instanceof Ve&&i.mark.eq(e.mark)?qo(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Qo(n,e,t){for(let r=0,o=0;o<n.children.length;o++){let l=n.children[o],a=r+l.length,c;if((t<=0||a==n.length||l.getSide()>0?a>=e:a>e)&&(e<a||o+1==n.children.length||(c=n.children[o+1]).length||c.getSide()>0)){let f=0;if(a==r){if(l.getSide()<=0)continue;f=t=-l.getSide()}let u=l.coordsAt(Math.max(0,e-r),t);return f&&u?Wi(u,t<0):u}r=a}let i=n.dom.lastChild;if(!i)return n.dom.getBoundingClientRect();let s=ri(i);return s[s.length-1]||null}function ws(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}function xs(n,e){if(n==e)return!0;if(!n||!e)return!1;let t=Object.keys(n),i=Object.keys(e);if(t.length!=i.length)return!1;for(let s of t)if(i.indexOf(s)==-1||n[s]!==e[s])return!1;return!0}function bs(n,e,t){let i=null;if(e)for(let s in e)t&&s in t||n.removeAttribute(i=s);if(t)for(let s in t)e&&e[s]==t[s]||n.setAttribute(i=s,t[s]);return!!i}class rt{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var R=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(R||(R={}));class E extends xt{constructor(e,t,i,s){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=s}get heightRelevant(){return!1}static mark(e){return new Yi(e)}static widget(e){let t=e.side||0,i=!!e.block;return t+=i?t>0?3e8:-4e8:t>0?1e8:-1e8,new bt(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Zo(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new bt(e,i,s,t,e.widget||null,!0)}static line(e){return new ai(e)}static set(e,t=!1){return $.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}E.none=$.empty;class Yi extends E{constructor(e){let{start:t,end:i}=Zo(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof Yi&&this.tagName==e.tagName&&this.class==e.class&&xs(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Yi.prototype.point=!1;class ai extends E{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ai&&xs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ai.prototype.mapMode=de.TrackBefore,ai.prototype.point=!0;class bt extends E{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?de.TrackBefore:de.TrackAfter:de.TrackDel}get type(){return this.startSide<this.endSide?R.WidgetRange:this.startSide<=0?R.WidgetBefore:R.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&this.widget.estimatedHeight>=5}eq(e){return e instanceof bt&&Tg(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}bt.prototype.point=!0;function Zo(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t!=null?t:e,end:i!=null?i:e}}function Tg(n,e){return n==e||!!(n&&e&&n.compare(e))}function ks(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class pe extends H{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof pe))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),Po(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new pe;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)t.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){!this.dom||(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){xs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){qo(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=ws(t,this.attrs||{})),i&&(this.attrs=ws({class:i},this.attrs||{}))}domAtPos(e){return Ko(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?this.dirty&4&&(zo(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(bs(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let i=this.dom.lastChild;for(;i&&H.get(i)instanceof Ve;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((t=H.get(i))===null||t===void 0?void 0:t.isEditable)==!1&&(!v.ios||!this.children.some(s=>s instanceof nt))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof nt)||/[^ -~]/.test(t.text))return null;let i=ri(t.dom);if(i.length!=1)return null;e+=i[0].width}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}:null}coordsAt(e,t){return Qo(this,e,t)}become(e){return!1}get type(){return R.Text}static find(e,t){for(let i=0,s=0;i<e.children.length;i++){let r=e.children[i],o=s+r.length;if(o>=t){if(r instanceof pe)return r;if(o>t)break}s=o+r.breakAfter}return null}}class kt extends H{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof kt)||!this.widget.compare(i.widget)||e>0&&r<=0||t<this.length&&o<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?he.before(this.dom):he.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new kt(this.widget,t,this.type);return i.breakAfter=this.breakAfter,i}get children(){return fs}sync(){(!this.dom||!this.widget.updateDOM(this.dom))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):V.empty}domBoundsAround(){return null}become(e){return e instanceof kt&&e.type==this.type&&e.widget.constructor==this.widget.constructor?(e.widget.eq(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Cs{constructor(e,t,i,s){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!e.breakAfter&&!(e instanceof kt&&e.type==R.WidgetBefore)}getLine(){return this.curLine||(this.content.push(this.curLine=new pe),this.atCursorPos=!0),this.curLine}flushBuffer(e){this.pendingBuffer&&(this.curLine.append(Gi(new zt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer([]),this.curLine=null,this.content.push(e)}finish(e){e?this.pendingBuffer=0:this.flushBuffer([]),this.posCovered()||this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,i)),this.getLine().append(Gi(new nt(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof bt){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(i instanceof bt)if(i.block){let{type:a}=i;a==R.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new kt(i.widget||new Jo("div"),l,a))}else{let a=st.create(i.widget||new Jo("span"),l,i.startSide),c=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e<t||i.startSide>0),f=!a.isEditable&&(e<t||i.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!c&&(this.pendingBuffer=0),this.flushBuffer(s),c&&(u.append(Gi(new zt(1),s),r),r=s.length+Math.max(0,r-s.length)),u.append(Gi(a,s),r),this.atCursorPos=f,this.pendingBuffer=f?e<t?1:2:0}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Cs(e,t,i,r);return o.openEnd=$.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Gi(n,e){for(let t of e)n=new Ve(t,[n],n.length);return n}class Jo extends rt{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}}const Xo=D.define(),el=D.define(),tl=D.define(),il=D.define(),Ms=D.define(),nl=D.define(),sl=D.define({combine:n=>n.some(e=>e)});class Ki{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new Ki(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const rl=B.define({map:(n,e)=>n.map(e)});function Se(n,e,t){let i=n.facet(il);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const qi=D.define({combine:n=>n.length?n[0]:!0});let Bg=0;const hi=D.define();class Z{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new Z(Bg++,e,i,o=>{let l=[hi.of(o)];return r&&l.push(ci.of(a=>{let c=a.plugin(o);return c?r(c):E.none})),s&&l.push(s(o)),l})}static fromClass(e,t){return Z.define(i=>new e(i),t)}}class Ss{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Se(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Se(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Se(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const ol=D.define(),ll=D.define(),ci=D.define(),al=D.define(),hl=D.define(),fi=D.define();class qe{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new qe(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toA<i.fromA)break;i=i.join(s),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let s=0,r=0,o=0,l=0;;s++){let a=s==e.length?null:e[s],c=o-l,f=a?a.fromB:1e9;for(;r<t.length&&t[r]<f;){let u=t[r],d=t[r+1],m=Math.max(l,u),p=Math.min(f,d);if(m<=p&&new qe(m+c,p+c,m,p).addToSet(i),d>f)break;r+=2}if(!a)return i;new qe(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class Qi{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=X.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let s=[];this.changes.iterChangedRanges((o,l,a,c)=>s.push(new qe(o,l,a,c))),this.changedRanges=s;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}static create(e,t,i){return new Qi(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var U=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(U||(U={}));const As=U.LTR,_g=U.RTL;function cl(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const Og=cl("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),zg=cl("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ls=Object.create(null),$e=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Ls[e]=t,Ls[t]=-e}function jg(n){return n<=247?Og[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?zg[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8203?256:64336<=n&&n<=65023?4:n==8204?256:1}const Vg=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class jt{constructor(e,t,i){this.from=e,this.to=t,this.level=i}get dir(){return this.level%2?_g:As}side(e,t){return this.dir==t==e?this.to:this.from}static find(e,t,i,s){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=t&&l.to>=t){if(l.level==i)return o;(r<0||(s!=0?s<0?l.from<t:l.to>t:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const Y=[];function $g(n,e){let t=n.length,i=e==As?1:2,s=e==As?2:1;if(!n||i==1&&!Vg.test(n))return fl(t);for(let o=0,l=i,a=i;o<t;o++){let c=jg(n.charCodeAt(o));c==512?c=l:c==8&&a==4&&(c=16),Y[o]=c==4?2:c,c&7&&(a=c),l=c}for(let o=0,l=i,a=i;o<t;o++){let c=Y[o];if(c==128)o<t-1&&l==Y[o+1]&&l&24?c=Y[o]=l:Y[o]=256;else if(c==64){let f=o+1;for(;f<t&&Y[f]==64;)f++;let u=o&&l==8||f<t&&Y[f]==8?a==1?1:8:256;for(let d=o;d<f;d++)Y[d]=u;o=f-1}else c==8&&a==1&&(Y[o]=1);l=c,c&7&&(a=c)}for(let o=0,l=0,a=0,c,f,u;o<t;o++)if(f=Ls[c=n.charCodeAt(o)])if(f<0){for(let d=l-3;d>=0;d-=3)if($e[d+1]==-f){let m=$e[d+2],p=m&2?i:m&4?m&1?s:i:0;p&&(Y[o]=Y[$e[d]]=p),l=d;break}}else{if($e.length==189)break;$e[l++]=o,$e[l++]=c,$e[l++]=a}else if((u=Y[o])==2||u==1){let d=u==i;a=d?0:1;for(let m=l-3;m>=0;m-=3){let p=$e[m+2];if(p&2)break;if(d)$e[m+2]|=2;else{if(p&4)break;$e[m+2]|=4}}}for(let o=0;o<t;o++)if(Y[o]==256){let l=o+1;for(;l<t&&Y[l]==256;)l++;let a=(o?Y[o-1]:i)==1,c=(l<t?Y[l]:i)==1,f=a==c?a?1:2:i;for(let u=o;u<l;u++)Y[u]=f;o=l-1}let r=[];if(i==1)for(let o=0;o<t;){let l=o,a=Y[o++]!=1;for(;o<t&&a==(Y[o]!=1);)o++;if(a)for(let c=o;c>l;){let f=c,u=Y[--c]!=2;for(;c>l&&u==(Y[c-1]!=2);)c--;r.push(new jt(c,f,u?2:1))}else r.push(new jt(l,o,0))}else for(let o=0;o<t;){let l=o,a=Y[o++]==2;for(;o<t&&a==(Y[o]==2);)o++;r.push(new jt(l,o,a?1:2))}return r}function fl(n){return[new jt(0,n,0)]}let ul="";function Pg(n,e,t,i,s){var r;let o=i.head-n.from,l=-1;if(o==0){if(!s||!n.length)return null;e[0].level!=t&&(o=e[0].side(!1,t),l=0)}else if(o==n.length){if(s)return null;let d=e[e.length-1];d.level!=t&&(o=d.side(!0,t),l=e.length-1)}l<0&&(l=jt.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc));let a=e[l];o==a.side(s,t)&&(a=e[l+=s?1:-1],o=a.side(!s,t));let c=s==(a.dir==t),f=ke(n.text,o,c);if(ul=n.text.slice(Math.min(o,f),Math.max(o,f)),f!=a.side(s,t))return w.cursor(f+n.from,c?-1:1,a.level);let u=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return!u&&a.level!=t?w.cursor(s?n.to:n.from,s?-1:1,t):u&&u.level<a.level?w.cursor(u.side(!s,t)+n.from,s?1:-1,u.level):w.cursor(f+n.from,s?-1:1,a.level)}const ot="\uFFFF";class dl{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(z.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ot}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s),this.readNode(s);let r=s.nextSibling;if(r==t)break;let o=H.get(s),l=H.get(r);(o&&l?o.breakAfter:(o?o.breakAfter:ml(s))||ml(r)&&(s.nodeName!="BR"||s.cmIgnore))&&this.lineBreak(),s=r}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=H.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function ml(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class pl{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class gl extends H{constructor(e){super(),this.view=e,this.compositionDeco=E.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new pe],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new qe(0,0,0,e.state.doc.length)],0)}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:l})=>l<this.minWidthFrom||o>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=E.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=Hg(this.view,e.changes)),(v.ie||v.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=Yg(i,s,e.changes);return t=qe.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=v.chrome||v.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let r of this.children)r instanceof kt&&r.widget instanceof yl&&s.push(r.dom);i.updateGaps(s)}updateChildren(e,t){let i=this.childCursor(t);for(let s=e.length-1;;s--){let r=s>=0?e[s]:null;if(!r)break;let{fromA:o,toA:l,fromB:a,toB:c}=r,{content:f,breakAtStart:u,openStart:d,openEnd:m}=Cs.build(this.view.state.doc,a,c,this.decorations,this.dynamicDecorationMap),{i:p,off:g}=i.findPos(l,1),{i:y,off:x}=i.findPos(o,-1);$o(this,y,x,p,g,f,u,d,m)}}updateSelection(e=!1,t=!1){if((e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange(),!(t||this.mayControlSelection()))return;let i=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,r=this.domAtPos(s.anchor),o=s.empty?r:this.domAtPos(s.head);if(v.gecko&&s.empty&&Rg(r)){let a=document.createTextNode("");this.view.observer.ignore(()=>r.node.insertBefore(a,r.node.childNodes[r.offset]||null)),r=o=new he(a,0),i=!0}let l=this.view.observer.selectionRange;(i||!l.focusNode||!Hi(r.node,r.offset,l.anchorNode,l.anchorOffset)||!Hi(o.node,o.offset,l.focusNode,l.focusOffset))&&(this.view.observer.ignore(()=>{v.android&&v.chrome&&this.dom.contains(l.focusNode)&&Gg(l.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let a=Pi(this.view.root);if(a)if(s.empty){if(v.gecko){let c=Wg(r.node,r.offset);if(c&&c!=3){let f=xl(r.node,r.offset,c==1?1:-1);f&&(r=new he(f,c==1?0:f.nodeValue.length))}}a.collapse(r.node,r.offset),s.bidiLevel!=null&&l.cursorBidiLevel!=null&&(l.cursorBidiLevel=s.bidiLevel)}else if(a.extend)a.collapse(r.node,r.offset),a.extend(o.node,o.offset);else{let c=document.createRange();s.anchor>s.head&&([r,o]=[o,r]),c.setEnd(o.node,o.offset),c.setStart(r.node,r.offset),a.removeAllRanges(),a.addRange(c)}}),this.view.observer.setSelectionRange(r,o)),this.impreciseAnchor=r.precise?null:new he(l.anchorNode,l.anchorOffset),this.impreciseHead=o.precise?null:new he(l.focusNode,l.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=Pi(this.view.root);if(!t||!e.empty||!e.assoc||!t.modify)return;let i=pe.find(this,e.head);if(!i)return;let s=i.posAtStart;if(e.head==s||e.head==s+i.length)return;let r=this.coordsAt(e.head,-1),o=this.coordsAt(e.head,1);if(!r||!o||r.bottom>o.top)return;let l=this.domAtPos(e.head+e.assoc);t.collapse(l.node,l.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){let e=this.view.root.activeElement;return e==this.dom||Ri(this.dom,this.view.observer.selectionRange)&&!(e&&this.dom.contains(e))}nearest(e){for(let t=e;t;){let i=H.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let s=this.children[t];if(i<s.length||s instanceof pe)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){for(let i=this.length,s=this.children.length-1;;s--){let r=this.children[s],o=i-r.breakAfter-r.length;if(e>o||e==o&&r.type!=R.WidgetBefore&&r.type!=R.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==R.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==U.LTR;for(let c=0,f=0;f<this.children.length;f++){let u=this.children[f],d=c+u.length;if(d>s)break;if(c>=i){let m=u.dom.getBoundingClientRect();if(t.push(m.height),o){let p=u.dom.lastChild,g=p?ri(p):[];if(g.length){let y=g[g.length-1],x=a?y.right-m.left:m.right-y.left;x>l&&(l=x,this.minWidth=r,this.minWidthFrom=c,this.minWidthTo=d)}}}c=d+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?U.RTL:U.LTR}measureTextSize(){for(let s of this.children)if(s instanceof pe){let r=s.measureTextSize();if(r)return r}let e=document.createElement("div"),t,i;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=ri(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,e.remove()}),{lineHeight:t,charWidth:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Vo(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let l=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(E.replace({widget:new yl(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return E.set(e)}updateDeco(){let e=this.view.state.facet(ci).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;t<e.length+3;t++)this.dynamicDecorationMap[t]=!1;return this.decorations=[...e,this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){let{range:t}=e,i=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=0,o=0,l=0,a=0;for(let f of this.view.state.facet(hl).map(u=>u(this.view)))if(f){let{left:u,right:d,top:m,bottom:p}=f;u!=null&&(r=Math.max(r,u)),d!=null&&(o=Math.max(o,d)),m!=null&&(l=Math.max(l,m)),p!=null&&(a=Math.max(a,p))}let c={left:i.left-r,top:i.top-l,right:i.right+o,bottom:i.bottom+a};Lg(this.view.scrollDOM,c,t.head<t.anchor?-1:1,e.x,e.y,e.xMargin,e.yMargin,this.view.textDirection==U.LTR)}}function Rg(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}class yl extends rt{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}function wl(n){let e=n.observer.selectionRange,t=e.focusNode&&xl(e.focusNode,e.focusOffset,0);if(!t)return null;let i=n.docView.nearest(t);if(!i)return null;if(i instanceof pe){let s=t;for(;s.parentNode!=i.dom;)s=s.parentNode;let r=s.previousSibling;for(;r&&!H.get(r);)r=r.previousSibling;let o=r?H.get(r).posAtEnd:i.posAtStart;return{from:o,to:o,node:s,text:t}}else{for(;;){let{parent:r}=i;if(!r)return null;if(r instanceof pe)break;i=r}let s=i.posAtStart;return{from:s,to:s+i.length,node:i.dom,text:t}}}function Hg(n,e){let t=wl(n);if(!t)return E.none;let{from:i,to:s,node:r,text:o}=t,l=e.mapPos(i,1),a=Math.max(l,e.mapPos(s,-1)),{state:c}=n,f=r.nodeType==3?r.nodeValue:new dl([],c).readRange(r.firstChild,null).text;if(a-l<f.length)if(c.doc.sliceString(l,Math.min(c.doc.length,l+f.length),ot)==f)a=l+f.length;else if(c.doc.sliceString(Math.max(0,a-f.length),a,ot)==f)l=a-f.length;else return E.none;else if(c.doc.sliceString(l,a,ot)!=f)return E.none;let u=H.get(r);return u instanceof Yo?u=u.widget.topView:u&&(u.parent=null),E.set(E.replace({widget:new Fg(r,o,u),inclusive:!0}).range(l,a))}class Fg extends rt{constructor(e,t,i){super(),this.top=e,this.text=t,this.topView=i}eq(e){return this.top==e.top&&this.text==e.text}toDOM(){return this.top}ignoreEvent(){return!1}get customView(){return Yo}}function xl(n,e,t){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0&&t<=0)n=n.childNodes[e-1],e=oi(n);else if(n.nodeType==1&&e<n.childNodes.length&&t>=0)n=n.childNodes[e],e=0;else return null}}function Wg(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}class Ug{constructor(){this.changes=[]}compareRange(e,t){ks(e,t,this.changes)}comparePoint(e,t){ks(e,t,this.changes)}}function Yg(n,e,t){let i=new Ug;return $.compare(n,e,t,i),i.changes}function Gg(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Kg(n,e,t=1){let i=n.charCategorizer(e),s=n.doc.lineAt(e),r=e-s.from;if(s.length==0)return w.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=ke(s.text,r,!1):l=ke(s.text,r);let a=i(s.text.slice(o,l));for(;o>0;){let c=ke(s.text,o,!1);if(i(s.text.slice(c,o))!=a)break;o=c}for(;l<s.length;){let c=ke(s.text,l);if(i(s.text.slice(l,c))!=a)break;l=c}return w.range(o+s.from,l+s.from)}function qg(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function Qg(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function vs(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function bl(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function kl(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Ds(n,e,t){let i,s,r,o,l=!1,a,c,f,u;for(let p=n.firstChild;p;p=p.nextSibling){let g=ri(p);for(let y=0;y<g.length;y++){let x=g[y];s&&vs(s,x)&&(x=bl(kl(x,s.bottom),s.top));let A=qg(e,x),L=Qg(t,x);if(A==0&&L==0)return p.nodeType==3?Cl(p,e,t):Ds(p,e,t);(!i||o>L||o==L&&r>A)&&(i=p,s=x,r=A,o=L,l=!A||(A>0?y<g.length-1:y>0)),A==0?t>x.bottom&&(!f||f.bottom<x.bottom)?(a=p,f=x):t<x.top&&(!u||u.top>x.top)&&(c=p,u=x):f&&vs(f,x)?f=kl(f,x.bottom):u&&vs(u,x)&&(u=bl(u,x.top))}}if(f&&f.bottom>=t?(i=a,s=f):u&&u.top<=t&&(i=c,s=u),!i)return{node:n,offset:0};let d=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return Cl(i,d,t);if(l&&i.contentEditable!="false")return Ds(i,d,t);let m=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:m}}function Cl(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Ot(n,l,l+1).getClientRects();for(let c=0;c<a.length;c++){let f=a[c];if(f.top==f.bottom)continue;o||(o=e-f.left);let u=(f.top>t?f.top-t:t-f.bottom)-1;if(f.left-1<=e&&f.right+1>=e&&u<r){let d=e>=(f.left+f.right)/2,m=d;if((v.chrome||v.gecko)&&Ot(n,l).getBoundingClientRect().left==f.right&&(m=!d),u<=0)return{node:n,offset:l+(m?1:0)};s=l+(m?1:0),r=u}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Ml(n,{x:e,y:t},i,s=-1){var r;let o=n.contentDOM.getBoundingClientRect(),l=o.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,f=t-l;if(f<0)return 0;if(f>c)return n.state.doc.length;for(let x=n.defaultLineHeight/2,A=!1;a=n.elementAtHeight(f),a.type!=R.Text;)for(;f=s>0?a.bottom+x:a.top-x,!(f>=0&&f<=c);){if(A)return i?null:0;A=!0,s=-s}t=l+f;let u=a.from;if(u<n.viewport.from)return n.viewport.from==0?0:i?null:Sl(n,o,a,e,t);if(u>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:i?null:Sl(n,o,a,e,t);let d=n.dom.ownerDocument,m=n.root.elementFromPoint?n.root:d,p=m.elementFromPoint(e,t);p&&!n.contentDOM.contains(p)&&(p=null),p||(e=Math.max(o.left+1,Math.min(o.right-1,e)),p=m.elementFromPoint(e,t),p&&!n.contentDOM.contains(p)&&(p=null));let g,y=-1;if(p&&((r=n.docView.nearest(p))===null||r===void 0?void 0:r.isEditable)!=!1){if(d.caretPositionFromPoint){let x=d.caretPositionFromPoint(e,t);x&&({offsetNode:g,offset:y}=x)}else if(d.caretRangeFromPoint){let x=d.caretRangeFromPoint(e,t);x&&({startContainer:g,startOffset:y}=x,(!n.contentDOM.contains(g)||v.safari&&Zg(g,y,e)||v.chrome&&Jg(g,y,e))&&(g=void 0))}}if(!g||!n.docView.dom.contains(g)){let x=pe.find(n.docView,u);if(!x)return f>a.top+a.height/2?a.to:a.from;({node:g,offset:y}=Ds(x.dom,e,t))}return n.docView.posFromDOM(g,y)}function Sl(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);n.lineWrapping&&t.height>n.defaultLineHeight*1.5&&(r+=Math.floor((s-t.top)/n.defaultLineHeight)*n.viewState.heightOracle.lineLength);let o=n.state.sliceDoc(t.from,t.to);return t.from+ls(o,r,n.state.tabSize)}function Zg(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Ot(n,i-1,i).getBoundingClientRect().left>t}function Jg(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():Ot(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Xg(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=!i||!n.lineWrapping?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let a=n.dom.getBoundingClientRect(),c=n.textDirectionAt(s.from),f=n.posAtCoords({x:t==(c==U.LTR)?a.right-1:a.left+1,y:(r.top+r.bottom)/2});if(f!=null)return w.cursor(f,t?-1:1)}let o=pe.find(n.docView,e.head),l=o?t?o.posAtEnd:o.posAtStart:t?s.to:s.from;return w.cursor(l,t?-1:1)}function Al(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let l=e,a=null;;){let c=Pg(s,r,o,l,t),f=ul;if(!c){if(s.number==(t?n.state.doc.lines:1))return l;f=`
|
|
9
|
+
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),c=w.cursor(t?s.from:s.to)}if(a){if(!a(f))return l}else{if(!i)return c;a=i(f)}l=c}}function e0(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==me.Space&&(s=o),s==o}}function t0(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return w.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(s),f=n.documentTop;if(c)o==null&&(o=c.left-a.left),l=r<0?c.top:c.bottom;else{let m=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-m.from))),l=(r<0?m.top:m.bottom)+f}let u=a.left+o,d=i!=null?i:n.defaultLineHeight>>1;for(let m=0;;m+=10){let p=l+(d+m)*r,g=Ml(n,{x:u,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s))return w.cursor(g,e.assoc,void 0,o)}}function Is(n,e,t){let i=n.state.facet(al).map(s=>s(n));for(;;){let s=!1;for(let r of i)r.between(t.from-1,t.from+1,(o,l,a)=>{t.from>o&&t.from<l&&(t=e.head>t.from?w.cursor(o,1):w.cursor(l,-1),s=!0)});if(!s)return t}}class i0{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.chromeScrollHack=-1,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.mouseSelection=null;for(let t in te){let i=te[t];e.contentDOM.addEventListener(t,s=>{!Dl(e,s)||this.ignoreDuringComposition(s)||t=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,s)?s.preventDefault():i(e,s))},Ns[t]),this.registeredEvents.push(t)}v.chrome&&v.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,l=>{!Dl(e,l)||this.runCustomHandlers(o,e,l)&&l.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){Se(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){Se(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(v.android&&v.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return e.observer.delayAndroidKey(t.key,t.keyCode),!0;let i;return v.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((i=Ll.find(s=>s.keyCode==t.keyCode))&&!t.ctrlKey||n0.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,li(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:v.safari&&!v.ios&&Date.now()-this.compositionEndedAt<100?(this.compositionEndedAt=0,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const Ll=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],n0="dthko",vl=[16,17,18,20,91,92,224,225];class s0{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(z.allowMultipleSelections)&&r0(e,t),this.dragMove=o0(e,t),this.dragging=l0(e,t)&&Es(t)==1?null:!1,this.dragging===!1&&(t.preventDefault(),this.select(t))}move(e){if(e.buttons==0)return this.destroy();this.dragging===!1&&this.select(this.lastEvent=e)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);(this.mustSelect||!t.eq(this.view.state.selection)||t.main.assoc!=this.view.state.selection.main.assoc)&&this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function r0(n,e){let t=n.state.facet(Xo);return t.length?t[0](e):v.mac?e.metaKey:e.ctrlKey}function o0(n,e){let t=n.state.facet(el);return t.length?t[0](e):v.mac?!e.altKey:!e.ctrlKey}function l0(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Pi(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Dl(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=H.get(t))&&i.ignoreEvent(e))return!1;return!0}const te=Object.create(null),Ns=Object.create(null),Il=v.ie&&v.ie_version<15||v.ios&&v.webkit_version<604;function a0(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Nl(n,t.value)},50)}function Nl(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Ts!=null&&t.selection.ranges.every(a=>a.empty)&&Ts==r.toString()){let a=-1;i=t.changeByRange(c=>{let f=t.doc.lineAt(c.from);if(f.from==a)return{range:c};a=f.from;let u=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:f.from,insert:u},range:w.cursor(c.from+u.length)}})}else o?i=t.changeByRange(a=>{let c=r.line(s++);return{changes:{from:a.from,to:a.to,insert:c.text},range:w.cursor(a.from+c.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}te.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27?n.inputState.lastEscPress=Date.now():vl.indexOf(e.keyCode)<0&&(n.inputState.lastEscPress=0)},te.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")},te.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")},Ns.touchstart=Ns.touchmove={passive:!0},te.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3&&Es(e)==1)return;let t=null;for(let i of n.state.facet(tl))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=f0(n,e)),t){let i=n.root.activeElement!=n.contentDOM;i&&n.observer.ignore(()=>_o(n.contentDOM)),n.inputState.startMouseSelection(new s0(n,e,t,i))}};function El(n,e,t,i){if(i==1)return w.cursor(e,t);if(i==2)return Kg(n.state,e,t);{let s=pe.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<n.state.doc.length&&l==r.to&&l++,w.range(o,l)}}let Tl=(n,e)=>n>=e.top&&n<=e.bottom,Bl=(n,e,t)=>Tl(e,t)&&n>=t.left&&n<=t.right;function h0(n,e,t,i){let s=pe.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&Bl(t,i,o))return-1;let l=s.coordsAt(r,1);return l&&Bl(t,i,l)?1:o&&Tl(i,o)?-1:1}function _l(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:h0(n,t,e.clientX,e.clientY)}}const c0=v.ie&&v.ie_version<=11;let Ol=null,zl=0,jl=0;function Es(n){if(!c0)return n.detail;let e=Ol,t=jl;return Ol=n,jl=Date.now(),zl=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(zl+1)%3:1}function f0(n,e){let t=_l(n,e),i=Es(e),s=n.state.selection,r=t,o=e;return{update(l){l.docChanged&&(t.pos=l.changes.mapPos(t.pos),s=s.map(l.changes),o=null)},get(l,a,c){let f;o&&l.clientX==o.clientX&&l.clientY==o.clientY?f=r:(f=r=_l(n,l),o=l);let u=El(n,f.pos,f.bias,i);if(t.pos!=f.pos&&!a){let d=El(n,t.pos,t.bias,i),m=Math.min(d.from,u.from),p=Math.max(d.to,u.to);u=m<u.from?w.range(m,p):w.range(p,m)}return a?s.replaceRange(s.main.extend(u.from,u.to)):c&&s.ranges.length>1&&s.ranges.some(d=>d.eq(u))?u0(s,u):c?s.addRange(u):w.create([u])}}}function u0(n,e){for(let t=0;;t++)if(n.ranges[t].eq(e))return w.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}te.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function Vl(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,l={from:s,insert:t},a=n.state.changes(o?[o,l]:l);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}te.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&Vl(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}}else Vl(n,e,e.dataTransfer.getData("Text"),!0)},te.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=Il?null:e.clipboardData;t?(Nl(n,t.getData("text/plain")),e.preventDefault()):a0(n)};function d0(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function m0(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Ts=null;te.copy=te.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=m0(n.state);if(!t&&!s)return;Ts=s?t:null;let r=Il?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):d0(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};function $l(n){setTimeout(()=>{n.hasFocus!=n.inputState.notifiedFocused&&n.update([])},10)}te.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),$l(n)},te.blur=n=>{n.observer.clearSelectionRange(),$l(n)},te.compositionstart=te.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)},te.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionFirstChange=null,v.chrome&&v.android&&n.observer.flushSoon(),setTimeout(()=>{n.inputState.composing<0&&n.docView.compositionDeco.size&&n.update([])},50)},te.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()},te.beforeinput=(n,e)=>{var t;let i;if(v.chrome&&v.android&&(i=Ll.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const Pl=["pre-wrap","normal","pre-line","break-spaces"];class p0{constructor(){this.doc=V.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Pl.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let s=e[i];s<0?i++:this.heightSamples[Math.floor(s*10)]||(t=!0,this.heightSamples[Math.floor(s*10)]=!0)}return t}refresh(e,t,i,s,r){let o=Pl.indexOf(e)>-1,l=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.lineLength=s,l){this.heightSamples={};for(let a=0;a<r.length;a++){let c=r[a];c<0?a++:this.heightSamples[Math.floor(c*10)]=!0}}return l}}class g0{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class lt{constructor(e,t,i,s,r){this.from=e,this.length=t,this.top=i,this.height=s,this.type=r}get to(){return this.from+this.length}get bottom(){return this.top+this.height}join(e){let t=(Array.isArray(this.type)?this.type:[this]).concat(Array.isArray(e.type)?e.type:[e]);return new lt(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var F=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(F||(F={}));const Zi=.001;class ye{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>Zi&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return ye.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this;for(let o=s.length-1;o>=0;o--){let{fromA:l,toA:a,fromB:c,toB:f}=s[o],u=r.lineAt(l,F.ByPosNoHeight,t,0,0),d=u.to>=a?u:r.lineAt(a,F.ByPosNoHeight,t,0,0);for(f+=d.to-a,a=d.to;o>0&&u.from<=s[o-1].toA;)l=s[o-1].fromA,c=s[o-1].fromB,o--,l<u.from&&(u=r.lineAt(l,F.ByPosNoHeight,t,0,0));c+=u.from-l,l=u.from;let m=Bs.build(i,e,c,f);r=r.replace(l,a,m)}return r.updateHeight(i,0)}static empty(){return new Ae(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,s=0,r=0;for(;;)if(t==i)if(s>r*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,s-=l.size}else if(r>s*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[t++];l&&(s+=l.size)}else{let l=e[--i];l&&(r+=l.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new y0(ye.of(e.slice(0,t)),o,ye.of(e.slice(i)))}}ye.prototype.size=1;class Rl extends ye{constructor(e,t,i){super(e,t),this.type=i}blockAt(e,t,i,s){return new lt(s,this.length,i,this.height,this.type)}lineAt(e,t,i,s,r){return this.blockAt(0,i,s,r)}forEachLine(e,t,i,s,r,o){e<=r+this.length&&t>=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ae extends Rl{constructor(e,t){super(e,t,R.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Ae||s instanceof re&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof re?s=new Ae(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):ye.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class re extends ye{constructor(e){super(e,0)}lines(e,t){let i=e.lineAt(t).number,s=e.lineAt(t+this.length).number;return{firstLine:i,lastLine:s,lineHeight:this.height/(s-i+1)}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,lineHeight:l}=this.lines(t,s),a=Math.max(0,Math.min(o-r,Math.floor((e-i)/l))),{from:c,length:f}=t.line(r+a);return new lt(c,f,i+l*a,l,R.Text)}lineAt(e,t,i,s,r){if(t==F.ByHeight)return this.blockAt(e,i,s,r);if(t==F.ByPosNoHeight){let{from:u,to:d}=i.lineAt(e);return new lt(u,d-u,0,0,R.Text)}let{firstLine:o,lineHeight:l}=this.lines(i,r),{from:a,length:c,number:f}=i.lineAt(e);return new lt(a,c,s+l*(f-o),l,R.Text)}forEachLine(e,t,i,s,r,o){let{firstLine:l,lineHeight:a}=this.lines(i,r);for(let c=Math.max(e,r),f=Math.min(r+this.length,t);c<=f;){let u=i.lineAt(c);c==e&&(s+=a*(u.number-l)),o(new lt(u.from,u.length,s,a,R.Text)),s+=a,c=u.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof re?i[i.length-1]=new re(r.length+s):i.push(null,new re(s-1))}if(e>0){let r=i[0];r instanceof re?i[0]=new re(e+r.length):i.unshift(new re(e-1),null)}return ye.of(i)}decomposeLeft(e,t){t.push(new re(e-1),null)}decomposeRight(e,t){t.push(null,new re(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1,c=e.heightChanged;for(s.from>t&&o.push(new re(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let d=s.heights[s.index++];a==-1?a=d:Math.abs(d-a)>=Zi&&(a=-2);let m=new Ae(u,d);m.outdated=!1,o.push(m),l+=u+1}l<=r&&o.push(null,new re(r-l).updateHeight(e,l));let f=ye.of(o);return e.heightChanged=c||a<0||Math.abs(f.height-this.height)>=Zi||Math.abs(a-this.lines(e.doc,t).lineHeight)>=Zi,f}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class y0 extends ye{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return e<r?this.left.blockAt(e,t,i,s):this.right.blockAt(e,t,r,s+this.left.length+this.break)}lineAt(e,t,i,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,a=t==F.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,t,i,s,r):this.right.lineAt(e,t,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let f=t==F.ByPosNoHeight?F.ByPosNoHeight:F.ByPos;return a?c.join(this.right.lineAt(l,f,i,o,l)):this.left.lineAt(l,f,i,s,r).join(c)}forEachLine(e,t,i,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,t,i,s,r,o),t>=a&&this.right.forEachLine(e,t,i,l,a,o);else{let c=this.lineAt(a,F.ByPos,i,s,r);e<c.from&&this.left.forEachLine(e,c.from-1,i,s,r,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,l,a,o)}}replace(e,t,i){let s=this.left.length+this.break;if(t<s)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Hl(r,o-1),t<this.length){let l=r.length;this.decomposeRight(t,r),Hl(r,l)}return ye.of(r)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<s&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ye.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,i,s):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Hl(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof re&&(i=n[e+1])instanceof re&&n.splice(e-1,3,new re(t.length+1+i.length))}const w0=5;class Bs{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ae?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ae(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let s=i.widget?i.widget.estimatedHeight:0;s<0&&(s=this.oracle.lineHeight);let r=t-e;i.block?this.addBlock(new Rl(r,s,i.type)):(r||s>=w0)&&this.addLineDeco(s,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ae(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new re(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ae)return e;let t=new Ae(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type==R.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=R.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ae)&&!this.isCovered?this.nodes.push(new Ae(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let s of this.nodes)s instanceof Ae&&s.updateHeight(this.oracle,i),i+=s?s.length:1;return this.nodes}static build(e,t,i,s){let r=new Bs(i,e);return $.spans(t,i,s,r,0),r.finish(i)}}function x0(n,e,t){let i=new b0;return $.compare(n,e,t,i,0),i.changes}class b0{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,s){(e<t||i&&i.heightRelevant||s&&s.heightRelevant)&&ks(e,t,this.changes,5)}}function k0(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,s=i.defaultView,r=Math.max(0,t.left),o=Math.min(s.innerWidth,t.right),l=Math.max(0,t.top),a=Math.min(s.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=i.body;)if(c.nodeType==1){let f=c,u=window.getComputedStyle(f);if((f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth)&&u.overflow!="visible"){let d=f.getBoundingClientRect();r=Math.max(r,d.left),o=Math.min(o,d.right),l=Math.max(l,d.top),a=c==n.parentNode?d.bottom:Math.min(a,d.bottom)}c=u.position=="absolute"||u.position=="fixed"?f.offsetParent:f.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function C0(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class _s{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let s=e[i],r=t[i];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e){return E.replace({widget:new M0(this.size,e)}).range(this.from,this.to)}}class M0 extends rt{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Fl{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.heightOracle=new p0,this.scaler=Yl,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=U.RTL,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1,this.stateDeco=e.facet(ci).filter(t=>typeof t!="function"),this.heightMap=ye.empty().applyChanges(this.stateDeco,V.empty,this.heightOracle.setDoc(e.doc),[new qe(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=E.set(this.lineGaps.map(t=>t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Ji(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?Yl:new L0(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:ui(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ci).filter(c=>typeof c!="function");let s=e.changedRanges,r=qe.extendWithRanges(s,x0(i,this.stateDeco,e?e.changes:X.empty(this.state.doc.length))),o=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2);let l=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let a=!e.changes.empty||e.flags&2||l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?U.RTL:U.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=o||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight;this.contentDOMHeight=t.clientHeight,this.mustMeasureContent=!1;let a=0,c=0,f=parseInt(i.paddingTop)||0,u=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,a|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8);let d=(this.printing?C0:k0)(t,this.paddingTop),m=d.top-this.pixelViewport.top,p=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(l=!0)),!this.inView&&!this.scrollTarget)return 0;let y=t.clientWidth;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=y,this.editorHeight=e.scrollDOM.clientHeight,a|=8),l){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:L,charWidth:M}=e.docView.measureTextSize();o=s.refresh(r,L,M,y/M,A),o&&(e.docView.minWidth=0,a|=8)}m>0&&p>0?c=Math.max(m,p):m<0&&p<0&&(c=Math.min(m,p)),s.heightChanged=!1;for(let L of this.viewports){let M=L.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(L);this.heightMap=this.heightMap.updateHeight(s,0,o,new g0(L.from,M))}s.heightChanged&&(a|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(a&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.state.doc,{visibleTop:o,visibleBottom:l}=this,a=new Ji(s.lineAt(o-i*1e3,F.ByHeight,r,0,0).from,s.lineAt(l+(1-i)*1e3,F.ByHeight,r,0,0).to);if(t){let{head:c}=t.range;if(c<a.from||c>a.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=s.lineAt(c,F.ByPos,r,0,0),d;t.y=="center"?d=(u.top+u.bottom)/2-f/2:t.y=="start"||t.y=="nearest"&&c<a.from?d=u.top:d=u.bottom-f,a=new Ji(s.lineAt(d-500,F.ByHeight,r,0,0).from,s.lineAt(d+f+500,F.ByHeight,r,0,0).to)}}return a}mapViewport(e,t){let i=t.mapPos(e.from,-1),s=t.mapPos(e.to,1);return new Ji(this.heightMap.lineAt(i,F.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(s,F.ByPos,this.state.doc,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,F.ByPos,this.state.doc,0,0),{bottom:r}=this.heightMap.lineAt(t,F.ByPos,this.state.doc,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&s>o-2e3&&r<l+2e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let s of e)t.touchesRange(s.from,s.to)||i.push(new _s(t.mapPos(s.from),t.mapPos(s.to),s.size));return i}ensureLineGaps(e){let t=[];if(this.defaultTextDirection!=U.LTR)return t;for(let i of this.viewportLines){if(i.length<4e3)continue;let s=S0(i.from,i.to,this.stateDeco);if(s.total<4e3)continue;let r,o;if(this.heightOracle.lineWrapping){let c=2e3/this.heightOracle.lineLength*this.heightOracle.lineHeight;r=Xi(s,(this.visibleTop-i.top-c)/i.height),o=Xi(s,(this.visibleBottom-i.top+c)/i.height)}else{let c=s.total*this.heightOracle.charWidth,f=2e3*this.heightOracle.charWidth;r=Xi(s,(this.pixelViewport.left-f)/c),o=Xi(s,(this.pixelViewport.right+f)/c)}let l=[];r>i.from&&l.push({from:i.from,to:r}),o<i.to&&l.push({from:o,to:i.to});let a=this.state.selection.main;a.from>=i.from&&a.from<=i.to&&Ul(l,a.from-10,a.from+10),!a.empty&&a.to>=i.from&&a.to<=i.to&&Ul(l,a.to-10,a.to+10);for(let{from:c,to:f}of l)f-c>1e3&&t.push(A0(e,u=>u.from>=i.from&&u.to<=i.to&&Math.abs(u.from-c)<1e3&&Math.abs(u.to-f)<1e3)||new _s(c,f,this.gapSize(i,c,f,s)))}return t}gapSize(e,t,i,s){let r=Wl(s,i)-Wl(s,t);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){_s.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=E.set(e.map(t=>t.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];$.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ui(this.heightMap.lineAt(e,F.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return ui(this.heightMap.lineAt(this.scaler.fromDOM(e),F.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return ui(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ji{constructor(e,t){this.from=e,this.to=t}}function S0(n,e,t){let i=[],s=n,r=0;return $.spans(t,n,e,{span(){},point(o,l){o>s&&(i.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(i.push({from:s,to:e}),r+=e-s),{total:r,ranges:i}}function Xi({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(i<=l)return r+i;i-=l}}function Wl(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function Ul(n,e,t){for(let i=0;i<n.length;i++){let s=n[i];if(s.from<t&&s.to>e){let r=[];s.from<e&&r.push({from:s.from,to:e}),s.to>t&&r.push({from:t,to:s.to}),n.splice(i,1,...r),i+=r.length-1}}}function A0(n,e){for(let t of n)if(e(t))return t}const Yl={toDOM(n){return n},fromDOM(n){return n},scale:1};class L0{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=t.lineAt(l,F.ByPos,e,0,0).top,f=t.lineAt(a,F.ByPos,e,0,0).bottom;return s+=f-c,{from:l,to:a,top:c,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.top)return s+(e-i)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);i=r.bottom,s=r.domBottom}}fromDOM(e){for(let t=0,i=0,s=0;;t++){let r=t<this.viewports.length?this.viewports[t]:null;if(!r||e<r.domTop)return i+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);i=r.bottom,s=r.domBottom}}}function ui(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new lt(n.from,n.length,t,i-t,Array.isArray(n.type)?n.type.map(s=>ui(s,e)):n.type)}const en=D.define({combine:n=>n.join(" ")}),Os=D.define({combine:n=>n.indexOf(!0)>-1}),zs=tt.newName(),Gl=tt.newName(),Kl=tt.newName(),ql={"&light":"."+Gl,"&dark":"."+Kl};function js(n,e,t){return new tt(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const v0=js("."+zs,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ql),D0={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Vs=v.ie&&v.ie_version<=11;class I0{constructor(e,t,i){this.view=e,this.onChange=t,this.onScrollChanged=i,this.active=!1,this.selectionRange=new vg,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(s=>{for(let r of s)this.queue.push(r);(v.ie&&v.ie_version<=11||v.ios&&e.composing)&&s.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Vs&&(this.onCharData=s=>{this.queue.push({target:s.target,type:"characterData",oldValue:s.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resize=new ResizeObserver(()=>{this.view.docView.lastUpdate<Date.now()-75&&this.onResize()}),this.resize.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(s=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),s.length>0&&s[s.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(s=>{s.length>0&&s[s.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(qi)?i.root.activeElement!=this.dom:!Ri(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(v.ie&&v.ie_version<=11||v.android&&v.chrome)&&!i.state.selection.main.empty&&s.focusNode&&Hi(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=v.safari&&e.root.nodeType==11&&Sg(this.dom.ownerDocument)==this.dom&&N0(this.view)||Pi(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=Ri(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Ig(this.dom,t)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(t),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,D0),Vs&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){!this.active||(this.active=!1,this.observer.disconnect(),Vs&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;this.delayedAndroidKey||this.view.win.requestAnimationFrame(()=>{let s=this.delayedAndroidKey;this.delayedAndroidKey=null,this.delayedFlush=-1,!this.flush()&&s.force&&li(this.dom,s.key,s.keyCode)}),(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}processRecords(){let e=this.queue;for(let r of this.observer.takeRecords())e.push(r);e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);!o||(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let{from:t,to:i,typeOver:s}=this.processRecords(),r=this.selectionChanged&&Ri(this.dom,this.selectionRange);if(t<0&&!r)return!1;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=this.view.state,l=this.onChange(t,i,s);return this.view.state==o&&this.view.update([]),l}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=Ql(t,e.previousSibling||e.target.previousSibling,-1),s=Ql(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resize)===null||i===void 0||i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function Ql(n,e,t){for(;e;){let i=H.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function N0(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor);return Hi(l.node,l.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}function E0(n,e,t,i){let s,r,o=n.state.selection.main;if(e>-1){let l=n.docView.domBoundsAround(e,t,0);if(!l||n.state.readOnly)return!1;let{from:a,to:c}=l,f=n.docView.impreciseHead||n.docView.impreciseAnchor?[]:B0(n),u=new dl(f,n.state);u.readRange(l.startDOM,l.endDOM);let d=o.from,m=null;(n.inputState.lastKeyCode===8&&n.inputState.lastKeyTime>Date.now()-100||v.android&&u.text.length<c-a)&&(d=o.to,m="end");let p=T0(n.state.doc.sliceString(a,c,ot),u.text,d-a,m);p&&(v.chrome&&n.inputState.lastKeyCode==13&&p.toB==p.from+2&&u.text.slice(p.from,p.toB)==ot+ot&&p.toB--,s={from:a+p.from,to:a+p.toA,insert:V.of(u.text.slice(p.from,p.toB).split(ot))}),r=_0(f,a)}else if(n.hasFocus||!n.state.facet(qi)){let l=n.observer.selectionRange,{impreciseHead:a,impreciseAnchor:c}=n.docView,f=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!Bt(n.contentDOM,l.focusNode)?n.state.selection.main.head:n.docView.posFromDOM(l.focusNode,l.focusOffset),u=c&&c.node==l.anchorNode&&c.offset==l.anchorOffset||!Bt(n.contentDOM,l.anchorNode)?n.state.selection.main.anchor:n.docView.posFromDOM(l.anchorNode,l.anchorOffset);(f!=o.head||u!=o.anchor)&&(r=w.single(u,f))}if(!s&&!r)return!1;if(!s&&i&&!o.empty&&r&&r.main.empty?s={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,o.to)}:s&&s.from>=o.from&&s.to<=o.to&&(s.from!=o.from||s.to!=o.to)&&o.to-o.from-(s.to-s.from)<=4?s={from:o.from,to:o.to,insert:n.state.doc.slice(o.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,o.to))}:(v.mac||v.android)&&s&&s.from==s.to&&s.from==o.head-1&&s.insert.toString()=="."&&(s={from:o.from,to:o.to,insert:V.of([" "])}),s){let l=n.state;if(v.ios&&n.inputState.flushIOSKey(n)||v.android&&(s.from==o.from&&s.to==o.to&&s.insert.length==1&&s.insert.lines==2&&li(n.contentDOM,"Enter",13)||s.from==o.from-1&&s.to==o.to&&s.insert.length==0&&li(n.contentDOM,"Backspace",8)||s.from==o.from&&s.to==o.to+1&&s.insert.length==0&&li(n.contentDOM,"Delete",46)))return!0;let a=s.insert.toString();if(n.state.facet(nl).some(u=>u(n,s.from,s.to,a)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let c;if(s.from>=o.from&&s.to<=o.to&&s.to-s.from>=(o.to-o.from)/3&&(!r||r.main.empty&&r.main.from==s.from+s.insert.length)&&n.inputState.composing<0){let u=o.from<s.from?l.sliceDoc(o.from,s.from):"",d=o.to>s.to?l.sliceDoc(s.to,o.to):"";c=l.replaceSelection(n.state.toText(u+s.insert.sliceString(0,void 0,n.state.lineBreak)+d))}else{let u=l.changes(s),d=r&&!l.selection.main.eq(r.main)&&r.main.to<=u.newLength?r.main:void 0;if(l.selection.ranges.length>1&&n.inputState.composing>=0&&s.to<=o.to&&s.to>=o.to-10){let m=n.state.sliceDoc(s.from,s.to),p=wl(n)||n.state.doc.lineAt(o.head),g=o.to-s.to,y=o.to-o.from;c=l.changeByRange(x=>{if(x.from==o.from&&x.to==o.to)return{changes:u,range:d||x.map(u)};let A=x.to-g,L=A-m.length;if(x.to-x.from!=y||n.state.sliceDoc(L,A)!=m||p&&x.to>=p.from&&x.from<=p.to)return{range:x};let M=l.changes({from:L,to:A,insert:s.insert}),S=x.to-o.to;return{changes:M,range:d?w.range(Math.max(0,d.anchor+S),Math.max(0,d.head+S)):x.map(M)}})}else c={changes:u,selection:d&&l.selection.replaceRange(d)}}let f="input.type";return n.composing&&(f+=".compose",n.inputState.compositionFirstChange&&(f+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(c,{scrollIntoView:!0,userEvent:f}),!0}else if(r&&!r.main.eq(o)){let l=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:l,userEvent:a}),!0}else return!1}function T0(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}return o<r&&n.length<e.length?(r-=t<=r&&t>=o?r-t:0,l=r+(l-o),o=r):l<r&&(r-=t<=r&&t>=l?r-t:0,o=r+(o-l),l=r),{from:r,toA:o,toB:l}}function B0(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new pl(t,i)),(s!=t||r!=i)&&e.push(new pl(s,r))),e}function _0(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?w.single(t+e,i+e):null}class I{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||Dg(e.parent)||document,this.viewState=new Fl(e.state||z.create(e)),this.plugins=this.state.facet(hi).map(t=>new Ss(t));for(let t of this.plugins)t.update(this);this.observer=new I0(this,(t,i,s)=>E0(this,t,i,s),t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new i0(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new gl(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){this._dispatch(e.length==1&&e[0]instanceof ee?e[0]:this.state.update(...e))}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let l of e){if(l.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=l.state}if(this.destroyed){this.viewState.state=r;return}if(this.observer.clear(),r.facet(z.phrases)!=this.state.facet(z.phrases))return this.setState(r);s=Qi.create(this,r,e);let o=this.viewState.scrollTarget;try{this.updateState=2;for(let l of e){if(o&&(o=o.map(l.changes)),l.scrollIntoView){let{main:a}=l.state.selection;o=new Ki(a.empty?a:w.cursor(a.head,a.head>a.anchor?-1:1))}for(let a of l.effects)a.is(rl)&&(o=a.value)}this.viewState.update(s,o),this.bidiCache=tn.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(fi)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(l=>l.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(en)!=s.state.facet(en)&&(this.viewState.mustMeasureContent=!0),(t||i||o||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let l of this.state.facet(Ms))l(s)}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Fl(e),this.plugins=e.facet(hi).map(i=>new Ss(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new gl(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(hi),i=e.state.facet(hi);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new Ss(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this)}measure(e=!0){if(this.destroyed)return;this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,{scrollHeight:i,scrollTop:s,clientHeight:r}=this.scrollDOM,o=s>i-r-4?i:s;try{for(let l=0;;l++){this.updateState=1;let a=this.viewport,c=this.viewState.lineBlockAtHeight(o),f=this.viewState.measure(this);if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];f&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(y=>{try{return y.read(this)}catch(x){return Se(this.state,x),Zl}}),m=Qi.create(this,this.state,[]),p=!1,g=!1;m.flags|=f,t?t.flags|=f:t=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),p=this.docView.update(m));for(let y=0;y<u.length;y++)if(d[y]!=Zl)try{let x=u[y];x.write&&x.write(d[y],this)}catch(x){Se(this.state,x)}if(this.viewState.scrollTarget)this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,g=!0;else{let y=this.viewState.lineBlockAt(c.from).top-c.top;(y>1||y<-1)&&(this.scrollDOM.scrollTop+=y,g=!0)}if(p&&this.docView.updateSelection(!0),this.viewport.from==a.from&&this.viewport.to==a.to&&!g&&this.measureRequests.length==0)break}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ms))l(t)}get themeClasses(){return zs+" "+(this.state.facet(Os)?Kl:Gl)+" "+this.state.facet(en)}updateAttrs(){let e=Jl(this,ol,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(qi)?"true":"false",class:"cm-content",style:`${v.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Jl(this,ll,t);let i=this.observer.ignore(()=>{let s=bs(this.contentDOM,this.contentAttrs,t),r=bs(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(I.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(fi),tt.mount(this.root,this.styleModules.concat(v0).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Is(this,e,Al(this,e,t,i))}moveByGroup(e,t){return Is(this,e,Al(this,e,t,i=>e0(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return Xg(this,e,t,i)}moveVertically(e,t,i){return Is(this,e,t0(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Ml(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[jt.find(r,e-s.from,-1,t)];return Wi(i,o.dir==U.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(sl)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>O0)return fl(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=$g(e.text,t);return this.bidiCache.push(new tn(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||v.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{_o(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return rl.of(new Ki(typeof e=="number"?w.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return Z.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=tt.newName(),s=[en.of(i),fi.of(js(`.${i}`,e))];return t&&t.dark&&s.push(Os.of(!0)),s}static baseTheme(e){return Et.lowest(fi.of(js("."+zs,e,ql)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&H.get(i)||H.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}I.styleModule=fi,I.inputHandler=nl,I.perLineTextDirection=sl,I.exceptionSink=il,I.updateListener=Ms,I.editable=qi,I.mouseSelectionStyle=tl,I.dragMovesSelection=el,I.clickAddsSelectionRange=Xo,I.decorations=ci,I.atomicRanges=al,I.scrollMargins=hl,I.darkTheme=Os,I.contentAttributes=ll,I.editorAttributes=ol,I.lineWrapping=I.contentAttributes.of({class:"cm-lineWrapping"}),I.announce=B.define();const O0=4096,Zl={};class tn{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:U.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!t.touchesRange(o.from,o.to)&&i.push(new tn(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.order))}return i}}function Jl(n,e,t){for(let i=n.state.facet(e),s=i.length-1;s>=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&ws(o,t)}return t}const z0=v.mac?"mac":v.windows?"win":v.linux?"linux":"key";function j0(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,l;for(let a=0;a<t.length-1;++a){const c=t[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))s=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return s&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function nn(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const V0=Et.default(I.domEventHandlers({keydown(n,e){return ta(ea(e.state),n,e,"editor")}})),$s=D.define({enables:V0}),Xl=new WeakMap;function ea(n){let e=n.facet($s),t=Xl.get(e);return t||Xl.set(e,t=R0(e.reduce((i,s)=>i.concat(s),[]))),t}function $0(n,e,t){return ta(ea(n.state),e,n,t)}let at=null;const P0=4e3;function R0(n,e=z0){let t=Object.create(null),i=Object.create(null),s=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,c)=>{let f=t[o]||(t[o]=Object.create(null)),u=l.split(/ (?!$)/).map(p=>j0(p,e));for(let p=1;p<u.length;p++){let g=u.slice(0,p).join(" ");s(g,!0),f[g]||(f[g]={preventDefault:!0,commands:[y=>{let x=at={view:y,prefix:g,scope:o};return setTimeout(()=>{at==x&&(at=null)},P0),!0}]})}let d=u.join(" ");s(d,!1);let m=f[d]||(f[d]={preventDefault:!1,commands:[]});m.commands.push(a),c&&(m.preventDefault=!0)};for(let o of n){let l=o[e]||o.key;if(!!l)for(let a of o.scope?o.scope.split(" "):["editor"])r(a,l,o.run,o.preventDefault),o.shift&&r(a,"Shift-"+l,o.shift,o.preventDefault)}return t}function ta(n,e,t,i){let s=Mg(e),r=ie(s,0),o=Ce(r)==s.length&&s!=" ",l="",a=!1;at&&at.view==t&&at.scope==i&&(l=at.prefix+" ",(a=vl.indexOf(e.keyCode)<0)&&(at=null));let c=m=>{if(m){for(let p of m.commands)if(p(t))return!0;m.preventDefault&&(a=!0)}return!1},f=n[i],u,d;if(f){if(c(f[l+nn(s,e,!o)]))return!0;if(o&&(e.shiftKey||e.altKey||e.metaKey||r>127)&&(u=it[e.keyCode])&&u!=s){if(c(f[l+nn(u,e,!0)]))return!0;if(e.shiftKey&&(d=si[e.keyCode])!=s&&d!=u&&c(f[l+nn(d,e,!1)]))return!0}else if(o&&e.shiftKey&&c(f[l+nn(s,e,!0)]))return!0}return a}const ia=!v.ios,di=D.define({combine(n){return Ke(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function H0(n={}){return[di.of(n),F0,W0]}class na{constructor(e,t,i,s,r){this.left=e,this.top=t,this.width=i,this.height=s,this.className=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const F0=Z.fromClass(class{constructor(n){this.view=n,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=n.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=n.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),n.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(di).cursorBlinkRate+"ms"}update(n){let e=n.startState.facet(di)!=n.state.facet(di);(e||n.selectionSet||n.geometryChanged||n.viewportChanged)&&this.view.requestMeasure(this.measureReq),n.transactions.some(t=>t.scrollIntoView)&&(this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),e&&this.setBlinkRate()}readPos(){let{state:n}=this.view,e=n.facet(di),t=n.selection.ranges.map(s=>s.empty?[]:U0(this.view,s)).reduce((s,r)=>s.concat(r)),i=[];for(let s of n.selection.ranges){let r=s==n.selection.main;if(s.empty?!r||ia:e.drawRangeCursor){let o=Y0(this.view,s,r);o&&i.push(o)}}return{rangePieces:t,cursors:i}}drawSel({rangePieces:n,cursors:e}){if(n.length!=this.rangePieces.length||n.some((t,i)=>!t.eq(this.rangePieces[i]))){this.selectionLayer.textContent="";for(let t of n)this.selectionLayer.appendChild(t.draw());this.rangePieces=n}if(e.length!=this.cursors.length||e.some((t,i)=>!t.eq(this.cursors[i]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(const i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,s)=>i.adjust(t[s]));this.cursors=e}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),sa={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ia&&(sa[".cm-line"].caretColor="transparent !important");const W0=Et.highest(I.theme(sa));function ra(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==U.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function oa(n,e,t){let i=w.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:R.Text}}function la(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==R.Text))return i}return t}function U0(n,e){if(e.to<=n.viewport.from||e.from>=n.viewport.to)return[];let t=Math.max(e.from,n.viewport.from),i=Math.min(e.to,n.viewport.to),s=n.textDirection==U.LTR,r=n.contentDOM,o=r.getBoundingClientRect(),l=ra(n),a=window.getComputedStyle(r.firstChild),c=o.left+parseInt(a.paddingLeft)+Math.min(0,parseInt(a.textIndent)),f=o.right-parseInt(a.paddingRight),u=la(n,t),d=la(n,i),m=u.type==R.Text?u:null,p=d.type==R.Text?d:null;if(n.lineWrapping&&(m&&(m=oa(n,t,m)),p&&(p=oa(n,i,p))),m&&p&&m.from==p.from)return y(x(e.from,e.to,m));{let L=m?x(e.from,null,m):A(u,!1),M=p?x(null,e.to,p):A(d,!0),S=[];return(m||u).to<(p||d).from-1?S.push(g(c,L.bottom,f,M.top)):L.bottom<M.top&&n.elementAtHeight((L.bottom+M.top)/2).type==R.Text&&(L.bottom=M.top=(L.bottom+M.top)/2),y(L).concat(S).concat(y(M))}function g(L,M,S,N){return new na(L-l.left,M-l.top-.01,S-L,N-M+.01,"cm-selectionBackground")}function y({top:L,bottom:M,horizontal:S}){let N=[];for(let T=0;T<S.length;T+=2)N.push(g(S[T],L,S[T+1],M));return N}function x(L,M,S){let N=1e9,T=-1e9,K=[];function j(q,J,ve,ue,ge){let _e=n.coordsAtPos(q,q==S.to?-2:2),le=n.coordsAtPos(ve,ve==S.from?2:-2);N=Math.min(_e.top,le.top,N),T=Math.max(_e.bottom,le.bottom,T),ge==U.LTR?K.push(s&&J?c:_e.left,s&&ue?f:le.right):K.push(!s&&ue?c:le.left,!s&&J?f:_e.right)}let _=L!=null?L:S.from,P=M!=null?M:S.to;for(let q of n.visibleRanges)if(q.to>_&&q.from<P)for(let J=Math.max(q.from,_),ve=Math.min(q.to,P);;){let ue=n.state.doc.lineAt(J);for(let ge of n.bidiSpans(ue)){let _e=ge.from+ue.from,le=ge.to+ue.from;if(_e>=ve)break;le>J&&j(Math.max(_e,J),L==null&&_e<=_,Math.min(le,ve),M==null&&le>=P,ge.dir)}if(J=ue.to+1,J>=ve)break}return K.length==0&&j(_,L==null,P,M==null,n.textDirection),{top:N,bottom:T,horizontal:K}}function A(L,M){let S=o.top+(M?L.top:L.bottom);return{top:S,bottom:S,horizontal:[]}}}function Y0(n,e,t){let i=n.coordsAtPos(e.head,e.assoc||1);if(!i)return null;let s=ra(n);return new na(i.left-s.left,i.top-s.top,-1,i.bottom-i.top,t?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}const aa=B.define({map(n,e){return n==null?null:e.mapPos(n)}}),mi=ne.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(aa)?i.value:t,n)}}),G0=Z.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(mi);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(mi)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(mi),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(mi)!=n&&this.view.dispatch({effects:aa.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function K0(){return[mi,G0]}function ha(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function q0(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class Q0{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,c,f)=>s(f,c,c+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,c,f)=>{let u=i(l,a,c);u&&f(c,c+l[0].length,u)};else if(i)this.addMatch=(l,a,c,f)=>f(c,c+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new et,i=t.add.bind(t);for(let{from:s,to:r}of q0(e,this.maxLength))ha(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>e.view.viewport.from&&l<e.view.viewport.to&&(i=Math.min(l,i),s=Math.max(a,s))}),e.viewportChanged||s-i>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,s);if(l>o){let a=e.state.doc.lineAt(o),c=a.to<l?e.state.doc.lineAt(l):a,f=Math.max(r.from,a.from),u=Math.min(r.to,c.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){f=o;break}for(;l<c.to;l++)if(this.boundary.test(c.text[l-c.from])){u=l;break}}let d=[],m,p=(g,y,x)=>d.push(x.range(g,y));if(a==c)for(this.regexp.lastIndex=f-a.from;(m=this.regexp.exec(a.text))&&m.index<u-a.from;)this.addMatch(m,e,m.index+a.from,p);else ha(e.state.doc,this.regexp,f,u,(g,y)=>this.addMatch(y,e,g,p));t=t.update({filterFrom:f,filterTo:u,filter:(g,y)=>g<f||y>u,add:d})}}return t}}const Ps=/x/.unicode!=null?"gu":"g",Z0=new RegExp(`[\0-\b
|
|
10
|
+
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Ps),J0={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Rs=null;function X0(){var n;if(Rs==null&&typeof document<"u"&&document.body){let e=document.body.style;Rs=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Rs||!1}const sn=D.define({combine(n){let e=Ke(n,{render:null,specialChars:Z0,addSpecialChars:null});return(e.replaceTabs=!X0())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ps)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ps)),e}});function e1(n={}){return[sn.of(n),t1()]}let ca=null;function t1(){return ca||(ca=Z.fromClass(class{constructor(n){this.view=n,this.decorations=E.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(sn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Q0({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ie(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=ni(o.text,l,i-o.from);return E.replace({widget:new r1((l-a%l)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=E.replace({widget:new s1(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(sn);n.startState.facet(sn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const i1="\u2022";function n1(n){return n>=32?i1:n==10?"\u2424":String.fromCharCode(9216+n)}class s1 extends rt{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=n1(this.code),i=e.state.phrase("Control character")+" "+(J0[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class r1 extends rt{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function o1(){return a1}const l1=E.line({class:"cm-activeLine"}),a1=Z.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(l1.range(s.from)),e=s.from)}return E.set(t)}},{decorations:n=>n.decorations}),Hs=2e3;function h1(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Hs||t.off>Hs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let c=n.doc.line(a);c.length<=l&&r.push(w.range(c.from+o,c.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let c=n.doc.line(a),f=ls(c.text,o,n.tabSize,!0);if(f>-1){let u=ls(c.text,l,n.tabSize);r.push(w.range(c.from+f,c.from+u))}}}return r}function c1(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function fa(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Hs?-1:s==i.length?c1(n,e.clientX):ni(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function f1(n,e){let t=fa(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let l=fa(n,s);if(!l)return i;let a=h1(n.state,t,l);return a.length?o?w.create(a.concat(i.ranges)):w.create(a):i}}:null}function u1(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return I.mouseSelectionStyle.of((t,i)=>e(i)?f1(t,i):null)}const d1={Alt:[18,n=>n.altKey],Control:[17,n=>n.ctrlKey],Shift:[16,n=>n.shiftKey],Meta:[91,n=>n.metaKey]},m1={style:"cursor: crosshair"};function p1(n={}){let[e,t]=d1[n.key||"Alt"],i=Z.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventHandlers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)}}});return[i,I.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?m1:null})]}const Fs="-10000px";class ua{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter(r=>r);if(t===this.input){for(let r of this.tooltipViews)r.update&&r.update(e);return!1}let s=[];for(let r=0;r<i.length;r++){let o=i[r],l=-1;if(!!o){for(let a=0;a<this.tooltips.length;a++){let c=this.tooltips[a];c&&c.create==o.create&&(l=a)}if(l<0)s[r]=this.createTooltipView(o);else{let a=s[r]=this.tooltipViews[l];a.update&&a.update(e)}}}for(let r of this.tooltipViews)s.indexOf(r)<0&&r.dom.remove();return this.input=t,this.tooltips=i,this.tooltipViews=s,!0}}function g1(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Ws=D.define({combine:n=>{var e,t,i;return{position:v.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||g1}}}),da=Z.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Ws);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new ua(n,Us,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Ws);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Fs,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n;this.view.win.removeEventListener("resize",this.measureSoon);for(let{dom:e}of this.manager.tooltipViews)e.remove();(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(Ws).tooltipSpace(this.view)}}writeMeasure(n){let{editor:e,space:t}=n,i=[];for(let s=0;s<this.manager.tooltips.length;s++){let r=this.manager.tooltips[s],o=this.manager.tooltipViews[s],{dom:l}=o,a=n.pos[s],c=n.size[s];if(!a||a.bottom<=Math.max(e.top,t.top)||a.top>=Math.min(e.bottom,t.bottom)||a.right<Math.max(e.left,t.left)-.1||a.left>Math.min(e.right,t.right)+.1){l.style.top=Fs;continue}let f=r.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,u=f?7:0,d=c.right-c.left,m=c.bottom-c.top,p=o.offset||w1,g=this.view.textDirection==U.LTR,y=c.width>t.right-t.left?g?t.left:t.right-c.width:g?Math.min(a.left-(f?14:0)+p.x,t.right-d):Math.max(t.left,a.left-d+(f?14:0)-p.x),x=!!r.above;!r.strictSide&&(x?a.top-(c.bottom-c.top)-p.y<t.top:a.bottom+(c.bottom-c.top)+p.y>t.bottom)&&x==t.bottom-a.bottom>a.top-t.top&&(x=!x);let A=x?a.top-m-u-p.y:a.bottom+u+p.y,L=y+d;if(o.overlap!==!0)for(let M of i)M.left<L&&M.right>y&&M.top<A+m&&M.bottom>A&&(A=x?M.top-m-2-u:M.bottom+u+2);this.position=="absolute"?(l.style.top=A-n.parent.top+"px",l.style.left=y-n.parent.left+"px"):(l.style.top=A+"px",l.style.left=y+"px"),f&&(f.style.left=`${a.left+(g?p.x:-p.x)-(y+14-7)}px`),o.overlap!==!0&&i.push({left:y,top:A,right:L,bottom:A+m}),l.classList.toggle("cm-tooltip-above",x),l.classList.toggle("cm-tooltip-below",!x),o.positioned&&o.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Fs}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),y1=I.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),w1={x:0,y:0},Us=D.define({enables:[da,y1]}),rn=D.define();class Ys{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new ua(e,rn,t=>this.createHostedView(t))}static create(e){return new Ys(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned()}update(e){this.manager.update(e)}}const x1=Us.compute([rn],n=>{let e=n.facet(rn).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Ys.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class b1{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{lastMove:e}=this,t=this.view.contentDOM.contains(e.target)?this.view.posAtCoords(e):null;if(t==null)return;let i=this.view.coordsAtPos(t);if(i==null||e.y<i.top||e.y>i.bottom||e.x<i.left-this.view.defaultCharacterWidth||e.x>i.right+this.view.defaultCharacterWidth)return;let s=this.view.bidiSpans(this.view.state.doc.lineAt(t)).find(l=>l.from<=t&&l.to>=t),r=s&&s.dir==U.RTL?-1:1,o=this.source(this.view,t,e.x<i.left?-r:r);if(o!=null&&o.then){let l=this.pending={pos:t};o.then(a=>{this.pending==l&&(this.pending=null,a&&this.view.dispatch({effects:this.setHover.of(a)}))},a=>Se(this.view.state,a,"hover tooltip"))}else o&&this.view.dispatch({effects:this.setHover.of(o)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!k1(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,r=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:s;(s==r?this.view.posAtCoords(this.lastMove)!=s:!C1(this.view,s,r,e.clientX,e.clientY,6))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function k1(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function C1(n,e,t,i,s,r){let o=document.createRange(),l=n.domAtPos(e),a=n.domAtPos(t);o.setEnd(a.node,a.offset),o.setStart(l.node,l.offset);let c=o.getClientRects();o.detach();for(let f=0;f<c.length;f++){let u=c[f];if(Math.max(u.top-s,s-u.bottom,u.left-i,i-u.right)<=r)return!0}return!1}function M1(n,e={}){let t=B.define(),i=ne.define({create(){return null},update(s,r){if(s&&(e.hideOnChange&&(r.docChanged||r.selection)||e.hideOn&&e.hideOn(r,s)))return null;if(s&&r.docChanged){let o=r.changes.mapPos(s.pos,-1,de.TrackDel);if(o==null)return null;let l=Object.assign(Object.create(null),s);l.pos=o,s.end!=null&&(l.end=r.changes.mapPos(s.end)),s=l}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(A1)&&(s=null);return s},provide:s=>rn.from(s)});return[i,Z.define(s=>new b1(s,n,i,t,e.hoverTime||300)),x1]}function S1(n,e){let t=n.plugin(da);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const A1=B.define(),ma=D.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function pi(n,e){let t=n.plugin(pa),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const pa=Z.fromClass(class{constructor(n){this.input=n.state.facet(gi),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(ma);this.top=new on(n,!0,e.topContainer),this.bottom=new on(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(ma);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new on(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new on(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(gi);if(t!=this.input){let i=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),f;c<0?(f=a(n.view),l.push(f)):(f=this.panels[c],f.update&&f.update(n)),s.push(f),(f.top?r:o).push(f)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>I.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class on{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=ga(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=ga(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function ga(n){let e=n.nextSibling;return n.remove(),e}const gi=D.define({enables:pa});class Qe extends xt{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Qe.prototype.elementClass="",Qe.prototype.toDOM=void 0,Qe.prototype.mapMode=de.TrackBefore,Qe.prototype.startSide=Qe.prototype.endSide=-1,Qe.prototype.point=!0;const ln=D.define(),L1={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>$.empty,lineMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},yi=D.define();function v1(n){return[ya(),yi.of(Object.assign(Object.assign({},L1),n))]}const Gs=D.define({combine:n=>n.some(e=>e)});function ya(n){let e=[D1];return n&&n.fixed===!1&&e.push(Gs.of(!0)),e}const D1=Z.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=n.state.facet(yi).map(e=>new ba(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Gs),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Gs)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=$.iter(this.view.state.facet(ln),this.view.viewport.from),i=[],s=this.gutters.map(r=>new I1(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks){let o;if(Array.isArray(r.type)){for(let l of r.type)if(l.type==R.Text){o=l;break}}else o=r.type==R.Text?r:void 0;if(!!o){i.length&&(i=[]),xa(t,i,r.from);for(let l of s)l.line(this.view,o,i)}}for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(yi),t=n.state.facet(yi),i=n.docChanged||n.heightChanged||n.viewportChanged||!$.eq(n.startState.facet(ln),n.state.facet(ln),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new ba(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>I.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==U.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}})});function wa(n){return Array.isArray(n)?n:[n]}function xa(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class I1{constructor(e,t,i){this.gutter=e,this.height=i,this.localMarkers=[],this.i=0,this.cursor=$.iter(e.markers,t.from)}line(e,t,i){this.localMarkers.length&&(this.localMarkers=[]),xa(this.cursor,this.localMarkers,t.from);let s=i.length?this.localMarkers.concat(i):this.localMarkers,r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;if(s.length==0&&!o.config.renderEmptyElements)return;let l=t.top-this.height;if(this.i==o.elements.length){let a=new ka(e,t.height,l,s);o.elements.push(a),o.dom.appendChild(a.dom)}else o.elements[this.i].update(e,t.height,l,s);this.height=t.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ba{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=e.lineBlockAtHeight(s.clientY-e.documentTop);t.domEventHandlers[i](e,r,s)&&s.preventDefault()});this.markers=wa(t.markers(e)),t.initialSpacer&&(this.spacer=new ka(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=wa(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!$.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class ka{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),N1(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<t.length?t[r++]:null,c=!1;if(a){let f=a.elementClass;f&&(i+=" "+f);for(let u=o;u<this.markers.length;u++)if(this.markers[u].compare(a)){l=u,c=!0;break}}else l=this.markers.length;for(;o<l;){let f=this.markers[o++];if(f.toDOM){f.destroy(s);let u=s.nextSibling;s.remove(),s=u}}if(!a)break;a.toDOM&&(c?s=s.nextSibling:this.dom.insertBefore(a.toDOM(e),s)),c&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function N1(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const E1=D.define(),Vt=D.define({combine(n){return Ke(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let s in t){let r=i[s],o=t[s];i[s]=r?(l,a,c)=>r(l,a,c)||o(l,a,c):o}return i}})}});class Ks extends Qe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function qs(n,e){return n.state.facet(Vt).formatNumber(e,n.state)}const T1=yi.compute([Vt],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(E1)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new Ks(qs(e,e.state.doc.lineAt(t.from).number))},lineMarkerChange:e=>e.startState.facet(Vt)!=e.state.facet(Vt),initialSpacer(e){return new Ks(qs(e,Ca(e.state.doc.lines)))},updateSpacer(e,t){let i=qs(t.view,Ca(t.view.state.doc.lines));return i==e.number?e:new Ks(i)},domEventHandlers:n.facet(Vt).domEventHandlers}));function B1(n={}){return[Vt.of(n),ya(),T1]}function Ca(n){let e=9;for(;e<n;)e=e*10+9;return e}const _1=new class extends Qe{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},O1=ln.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(_1.range(s)))}return $.of(e)});function z1(){return O1}const j1=1024;let V1=0;class Qs{constructor(e,t){this.from=e,this.to=t}}class O{constructor(e={}){this.id=V1++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=we.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}O.closedBy=new O({deserialize:n=>n.split(" ")}),O.openedBy=new O({deserialize:n=>n.split(" ")}),O.group=new O({deserialize:n=>n.split(" ")}),O.contextHash=new O({perNode:!0}),O.lookAhead=new O({perNode:!0}),O.mounted=new O({perNode:!0});const $1=Object.create(null);class we{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):$1,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new we(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(O.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(O.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}we.none=new we("",Object.create(null),0,8);class Zs{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let s=null;for(let r of e){let o=r(i);o&&(s||(s=Object.assign({},i.props)),s[o[0].id]=o[1])}t.push(s?new we(i.name,s,i.id,i.flags):i)}return new Zs(t)}}const an=new WeakMap,Ma=new WeakMap;var ce;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(ce||(ce={}));class G{constructor(e,t,i,s,r){if(this.type=e,this.children=t,this.positions=i,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=this.prop(O.mounted);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let s=i.toString();s&&(t&&(t+=","),t+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new fn(this.topNode,e)}cursorAt(e,t=0,i=0){let s=an.get(this)||this.topNode,r=new fn(s);return r.moveTo(e,t),an.set(this,r._tree),r}get topNode(){return new Ze(this,0,0,null)}resolve(e,t=0){let i=$t(an.get(this)||this.topNode,e,t,!1);return an.set(this,i),i}resolveInner(e,t=0){let i=$t(Ma.get(this)||this.topNode,e,t,!0);return Ma.set(this,i),i}iterate(e){let{enter:t,leave:i,from:s=0,to:r=this.length}=e;for(let o=this.cursor((e.mode||0)|ce.IncludeAnonymous);;){let l=!1;if(o.from<=r&&o.to>=s&&(o.type.isAnonymous||t(o)!==!1)){if(o.firstChild())continue;l=!0}for(;l&&i&&!o.type.isAnonymous&&i(o),!o.nextSibling();){if(!o.parent())return;l=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:er(we.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new G(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new G(we.none,t,i,s)))}static build(e){return R1(e)}}G.empty=new G(we.none,[],[],0);class Js{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Js(this.buffer,this.index)}}class Ct{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return we.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],s=this.set.types[t],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,i==e)return r;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,t,i,s,r){let{buffer:o}=this,l=-1;for(let a=e;a!=t&&!(Sa(r,s,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,t,i,s){let r=this.buffer,o=new Uint16Array(t-e);for(let l=e,a=0;l<t;)o[a++]=r[l++],o[a++]=r[l++]-i,o[a++]=r[l++]-i,o[a++]=r[l++]-e;return new Ct(o,s-i,this.set)}}function Sa(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Aa(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function $t(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof Ze&&n.index<0?null:n.parent;if(!o)return n;n=o}let r=i?0:ce.IgnoreOverlays;if(i)for(let o=n,l=o.parent;l;o=l,l=o.parent)o instanceof Ze&&o.index<0&&((s=l.enter(e,t,r))===null||s===void 0?void 0:s.from)!=o.from&&(n=l);for(;;){let o=n.enter(e,t,r);if(!o)return n;n=o}}class Ze{constructor(e,t,i,s){this._tree=e,this.from=t,this.index=i,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,s,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=t>0?l.length:-1;e!=c;e+=t){let f=l[e],u=a[e]+o.from;if(!!Sa(s,i,u,u+f.length)){if(f instanceof Ct){if(r&ce.ExcludeBuffers)continue;let d=f.findChild(0,f.buffer.length,t,i-u,s);if(d>-1)return new ht(new P1(o,f,e,u),null,d)}else if(r&ce.IncludeAnonymous||!f.type.isAnonymous||Xs(f)){let d;if(!(r&ce.IgnoreMounts)&&f.props&&(d=f.prop(O.mounted))&&!d.overlay)return new Ze(d.tree,u,e,o);let m=new Ze(f,u,e,o);return r&ce.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?f.children.length-1:0,t,i,s)}}}if(r&ce.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&ce.IgnoreOverlays)&&(s=this._tree.prop(O.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o<r)&&(t<0?l>=r:l>r))return new Ze(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new fn(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return $t(this,e,t,!1)}resolveInner(e,t=0){return $t(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Aa(this,e)}getChild(e,t=null,i=null){let s=hn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return hn(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return cn(this,e)}}function hn(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function cn(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class P1{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class ht{constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new ht(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&ce.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ht(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ht(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ht(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new fn(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1],l=i.buffer[this.index+2];e.push(i.slice(s,r,o,l)),t.push(0)}return new G(this.type,e,t,this.to-this.from)}resolve(e,t=0){return $t(this,e,t,!1)}resolveInner(e,t=0){return $t(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Aa(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=hn(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return hn(this,e,t,i)}get node(){return this}matchContext(e){return cn(this,e)}}class fn{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ze)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Ze?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&ce.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ce.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ce.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:t,parent:i}=s)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&ce.IncludeAnonymous||l instanceof Ct||!l.type.isAnonymous||Xs(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer){e:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}}for(let s=i;s<this.stack.length;s++)t=new ht(this.buffer,t,this.stack[s]);return this.bufferNode=new ht(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(s=!0)}for(;s&&t&&t(this),s=this.type.isAnonymous,!this.nextSibling();){if(!i)return;this.parent(),i--,s=!0}}}matchContext(e){if(!this.buffer)return cn(this.node,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return cn(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Xs(n){return n.children.some(e=>e instanceof Ct||!e.type.isAnonymous||Xs(e))}function R1(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=j1,reused:r=[],minRepeatType:o=i.types.length}=n,l=Array.isArray(t)?new Js(t,t.length):t,a=i.types,c=0,f=0;function u(M,S,N,T,K){let{id:j,start:_,end:P,size:q}=l,J=f;for(;q<0;)if(l.next(),q==-1){let le=r[j];N.push(le),T.push(_-M);return}else if(q==-3){c=j;return}else if(q==-4){f=j;return}else throw new RangeError(`Unrecognized record size: ${q}`);let ve=a[j],ue,ge,_e=_-M;if(P-_<=s&&(ge=g(l.pos-S,K))){let le=new Uint16Array(ge.size-ge.skip),Oe=l.pos-ge.size,Je=le.length;for(;l.pos>Oe;)Je=y(ge.start,le,Je);ue=new Ct(le,P-ge.start,i),_e=ge.start-M}else{let le=l.pos-q;l.next();let Oe=[],Je=[],It=j>=o?j:-1,qt=0,Pn=P;for(;l.pos>le;)It>=0&&l.id==It&&l.size>=0?(l.end<=Pn-s&&(m(Oe,Je,_,qt,l.end,Pn,It,J),qt=Oe.length,Pn=l.end),l.next()):u(_,le,Oe,Je,It);if(It>=0&&qt>0&&qt<Oe.length&&m(Oe,Je,_,qt,_,Pn,It,J),Oe.reverse(),Je.reverse(),It>-1&&qt>0){let Ac=d(ve);ue=er(ve,Oe,Je,0,Oe.length,0,P-_,Ac,Ac)}else ue=p(ve,Oe,Je,P-_,J-P)}N.push(ue),T.push(_e)}function d(M){return(S,N,T)=>{let K=0,j=S.length-1,_,P;if(j>=0&&(_=S[j])instanceof G){if(!j&&_.type==M&&_.length==T)return _;(P=_.prop(O.lookAhead))&&(K=N[j]+_.length+P)}return p(M,S,N,T,K)}}function m(M,S,N,T,K,j,_,P){let q=[],J=[];for(;M.length>T;)q.push(M.pop()),J.push(S.pop()+N-K);M.push(p(i.types[_],q,J,j-K,P-j)),S.push(K-N)}function p(M,S,N,T,K=0,j){if(c){let _=[O.contextHash,c];j=j?[_].concat(j):[_]}if(K>25){let _=[O.lookAhead,K];j=j?[_].concat(j):[_]}return new G(M,S,N,T,j)}function g(M,S){let N=l.fork(),T=0,K=0,j=0,_=N.end-s,P={size:0,start:0,skip:0};e:for(let q=N.pos-M;N.pos>q;){let J=N.size;if(N.id==S&&J>=0){P.size=T,P.start=K,P.skip=j,j+=4,T+=4,N.next();continue}let ve=N.pos-J;if(J<0||ve<q||N.start<_)break;let ue=N.id>=o?4:0,ge=N.start;for(N.next();N.pos>ve;){if(N.size<0)if(N.size==-3)ue+=4;else break e;else N.id>=o&&(ue+=4);N.next()}K=ge,T+=J,j+=ue}return(S<0||T==M)&&(P.size=T,P.start=K,P.skip=j),P.size>4?P:void 0}function y(M,S,N){let{id:T,start:K,end:j,size:_}=l;if(l.next(),_>=0&&T<o){let P=N;if(_>4){let q=l.pos-(_-4);for(;l.pos>q;)N=y(M,S,N)}S[--N]=P,S[--N]=j-M,S[--N]=K-M,S[--N]=T}else _==-3?c=T:_==-4&&(f=T);return N}let x=[],A=[];for(;l.pos>0;)u(n.start||0,n.bufferStart||0,x,A,-1);let L=(e=n.length)!==null&&e!==void 0?e:x.length?A[0]+x[0].length:0;return new G(a[n.topID],x.reverse(),A.reverse(),L)}const La=new WeakMap;function un(n,e){if(!n.isAnonymous||e instanceof Ct||e.type!=n)return 1;let t=La.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof G)){t=1;break}t+=un(n,i)}La.set(e,t)}return t}function er(n,e,t,i,s,r,o,l,a){let c=0;for(let p=i;p<s;p++)c+=un(n,e[p]);let f=Math.ceil(c*1.5/8),u=[],d=[];function m(p,g,y,x,A){for(let L=y;L<x;){let M=L,S=g[L],N=un(n,p[L]);for(L++;L<x;L++){let T=un(n,p[L]);if(N+T>=f)break;N+=T}if(L==M+1){if(N>f){let T=p[M];m(T.children,T.positions,0,T.children.length,g[M]+A);continue}u.push(p[M])}else{let T=g[L-1]+p[L-1].length-S;u.push(er(n,p,g,M,L,S,T,null,a))}d.push(S+A-r)}}return m(e,t,i,s,0),(l||a)(u,d,o)}class Mt{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new Mt(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let f=l<t.length?t[l]:null,u=f?f.fromA:1e9;if(u-a>=i)for(;o&&o.from<u;){let d=o;if(a>=d.from||u<=d.to||c){let m=Math.max(d.from,a)-c,p=Math.min(d.to,u)-c;d=m>=p?null:new Mt(m,p,d.tree,d.offset+c,l>0,!!f)}if(d&&s.push(d),o.to>u)break;o=r<e.length?e[r++]:null}if(!f)break;a=f.toA,c=f.toA-f.toB}return s}}class va{startParse(e,t,i){return typeof e=="string"&&(e=new H1(e)),i=i?i.length?i.map(s=>new Qs(s.from,s.to)):[new Qs(0,0)]:[new Qs(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class H1{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new O({perNode:!0});let F1=0;class Pe{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=F1++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new Pe([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new dn;return t=>t.modified.indexOf(e)>-1?t:dn.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let W1=0;class dn{constructor(){this.instances=[],this.id=W1++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&U1(t,l.modified));if(i)return i;let s=[],r=new Pe(s,e,t);for(let l of t)l.instances.push(r);let o=Da(t);for(let l of e.set)for(let a of o)s.push(dn.get(l,a));return r}}function U1(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function Da(n){let e=[n];for(let t=0;t<n.length;t++)for(let i of Da(n.slice(0,t).concat(n.slice(t+1))))e.push(i);return e}function Y1(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let u=0;;){if(l=="..."&&u>0&&u+3==s.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!d)throw new RangeError("Invalid path: "+s);if(r.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),u+=d[0].length,u==s.length)break;let m=s[u++];if(u==s.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+s);l=s.slice(u)}let a=r.length-1,c=r[a];if(!c)throw new RangeError("Invalid path: "+s);let f=new G1(i,o,a>0?r.slice(0,a):null);e[c]=f.sort(e[c])}}return Ia.add(e)}const Ia=new O;class G1{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function Na(n,e){let t=Object.create(null);for(let r of n)if(!Array.isArray(r.tag))t[r.tag.id]=r.class;else for(let o of r.tag)t[o.id]=r.class;let{scope:i,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let a of l.set){let c=t[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function K1(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function q1(n,e,t,i=0,s=n.length){let r=new Q1(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class Q1{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(m=>!m.scope||m.scope(o)));let c=s,f=o.prop(Ia),u=!1;for(;f;){if(!f.context||e.matchContext(f.context)){let m=K1(r,f.tags);m&&(c&&(c+=" "),c+=m,f.mode==1?s+=(s?" ":"")+m:f.mode==0&&(u=!0));break}f=f.next}if(this.startSpan(e.from,c),u)return;let d=e.tree&&e.tree.prop(O.mounted);if(d&&d.overlay){let m=e.node.enter(d.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(d.tree.type)),g=e.firstChild();for(let y=0,x=l;;y++){let A=y<d.overlay.length?d.overlay[y]:null,L=A?A.from+l:a,M=Math.max(t,x),S=Math.min(i,L);if(M<S&&g)for(;e.from<S&&(this.highlightRange(e,M,S,s,r),this.startSpan(Math.min(i,e.to),c),!(e.to>=L||!e.nextSibling())););if(!A||L>i)break;x=A.to+l,x>t&&(this.highlightRange(m.cursor(),Math.max(t,A.from+l),Math.min(i,x),s,p),this.startSpan(x,c))}g&&e.parent()}else if(e.firstChild()){do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}const k=Pe.define,mn=k(),ct=k(),Ea=k(ct),Ta=k(ct),ft=k(),pn=k(ft),tr=k(ft),Re=k(),St=k(Re),He=k(),Fe=k(),ir=k(),wi=k(ir),gn=k(),C={comment:mn,lineComment:k(mn),blockComment:k(mn),docComment:k(mn),name:ct,variableName:k(ct),typeName:Ea,tagName:k(Ea),propertyName:Ta,attributeName:k(Ta),className:k(ct),labelName:k(ct),namespace:k(ct),macroName:k(ct),literal:ft,string:pn,docString:k(pn),character:k(pn),attributeValue:k(pn),number:tr,integer:k(tr),float:k(tr),bool:k(ft),regexp:k(ft),escape:k(ft),color:k(ft),url:k(ft),keyword:He,self:k(He),null:k(He),atom:k(He),unit:k(He),modifier:k(He),operatorKeyword:k(He),controlKeyword:k(He),definitionKeyword:k(He),moduleKeyword:k(He),operator:Fe,derefOperator:k(Fe),arithmeticOperator:k(Fe),logicOperator:k(Fe),bitwiseOperator:k(Fe),compareOperator:k(Fe),updateOperator:k(Fe),definitionOperator:k(Fe),typeOperator:k(Fe),controlOperator:k(Fe),punctuation:ir,separator:k(ir),bracket:wi,angleBracket:k(wi),squareBracket:k(wi),paren:k(wi),brace:k(wi),content:Re,heading:St,heading1:k(St),heading2:k(St),heading3:k(St),heading4:k(St),heading5:k(St),heading6:k(St),contentSeparator:k(Re),list:k(Re),quote:k(Re),emphasis:k(Re),strong:k(Re),link:k(Re),monospace:k(Re),strikethrough:k(Re),inserted:k(),deleted:k(),changed:k(),invalid:k(),meta:gn,documentMeta:k(gn),annotation:k(gn),processingInstruction:k(gn),definition:Pe.defineModifier(),constant:Pe.defineModifier(),function:Pe.defineModifier(),standard:Pe.defineModifier(),local:Pe.defineModifier(),special:Pe.defineModifier()};Na([{tag:C.link,class:"tok-link"},{tag:C.heading,class:"tok-heading"},{tag:C.emphasis,class:"tok-emphasis"},{tag:C.strong,class:"tok-strong"},{tag:C.keyword,class:"tok-keyword"},{tag:C.atom,class:"tok-atom"},{tag:C.bool,class:"tok-bool"},{tag:C.url,class:"tok-url"},{tag:C.labelName,class:"tok-labelName"},{tag:C.inserted,class:"tok-inserted"},{tag:C.deleted,class:"tok-deleted"},{tag:C.literal,class:"tok-literal"},{tag:C.string,class:"tok-string"},{tag:C.number,class:"tok-number"},{tag:[C.regexp,C.escape,C.special(C.string)],class:"tok-string2"},{tag:C.variableName,class:"tok-variableName"},{tag:C.local(C.variableName),class:"tok-variableName tok-local"},{tag:C.definition(C.variableName),class:"tok-variableName tok-definition"},{tag:C.special(C.variableName),class:"tok-variableName2"},{tag:C.definition(C.propertyName),class:"tok-propertyName tok-definition"},{tag:C.typeName,class:"tok-typeName"},{tag:C.namespace,class:"tok-namespace"},{tag:C.className,class:"tok-className"},{tag:C.macroName,class:"tok-macroName"},{tag:C.propertyName,class:"tok-propertyName"},{tag:C.operator,class:"tok-operator"},{tag:C.comment,class:"tok-comment"},{tag:C.meta,class:"tok-meta"},{tag:C.invalid,class:"tok-invalid"},{tag:C.punctuation,class:"tok-punctuation"}]);var nr;const xi=new O;function Z1(n){return D.define({combine:n?e=>e.concat(n):void 0})}class Te{constructor(e,t,i=[]){this.data=e,z.prototype.hasOwnProperty("tree")||Object.defineProperty(z.prototype,"tree",{get(){return oe(this)}}),this.parser=t,this.extension=[ut.of(this),z.languageData.of((s,r,o)=>s.facet(Ba(s,r,o)))].concat(i)}isActiveAt(e,t,i=-1){return Ba(e,t,i)==this.data}findRegions(e){let t=e.facet(ut);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(xi)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(O.mounted);if(l){if(l.tree.prop(xi)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(s(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let c=r.children[a];c instanceof G&&s(c,r.positions[a]+o)}};return s(oe(e),0),i}get allowsNesting(){return!0}}Te.setState=B.define();function Ba(n,e,t){let i=n.facet(ut);if(!i)return null;let s=i.data;if(i.allowsNesting)for(let r=oe(n).topNode;r;r=r.enter(e,t,ce.ExcludeBuffers))s=r.type.prop(xi)||s;return s}function oe(n){let e=n.field(Te.state,!1);return e?e.tree:G.empty}class J1{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let bi=null;class Pt{constructor(e,t,i=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Pt(e,t,[],G.empty,0,i,[],null)}startParse(){return this.parser.startParse(new J1(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=G.empty&&this.isDone(t!=null?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(Mt.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(t!=null?t:this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Mt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=bi;bi=this;try{return e()}finally{bi=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=_a(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,f,u,d)=>a.push({fromA:c,toA:f,fromB:u,toB:d})),i=Mt.applyChanges(i,a),s=G.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let f=e.mapPos(c.from,1),u=e.mapPos(c.to,-1);f<u&&l.push({from:f,to:u})}}}return new Pt(this.parser,t,i,s,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:s,to:r}=this.skipped[i];s<e.to&&r>e.from&&(this.fragments=_a(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends va{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=bi;if(a){for(let c of s)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new G(we.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return bi}}function _a(n,e,t){return Mt.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Rt{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new Rt(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Pt.create(e.facet(ut).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Rt(i)}}Te.state=ne.define({create:Rt.init,update(n,e){for(let t of e.effects)if(t.is(Te.setState))return t.value;return e.startState.facet(ut)!=e.state.facet(ut)?Rt.init(e.state):n.apply(e)}});let Oa=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Oa=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const sr=typeof navigator<"u"&&((nr=navigator.scheduling)===null||nr===void 0?void 0:nr.isInputPending)?()=>navigator.scheduling.isInputPending():null,X1=Z.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Te.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Te.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Oa(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:s}}=this.view,r=i.field(Te.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!sr?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&i.doc.length>s+1e3,a=r.context.work(()=>sr&&sr()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Te.setState.of(new Rt(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Se(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ut=D.define({combine(n){return n.length?n[0]:null},enables:[Te.state,X1]}),za=D.define(),rr=D.define({combine:n=>{if(!n.length)return" ";if(!/^(?: +|\t+)$/.test(n[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return n[0]}});function At(n){let e=n.facet(rr);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function ki(n,e){let t="",i=n.tabSize;if(n.facet(rr).charCodeAt(0)==9)for(;e>=i;)t+=" ",e-=i;for(let s=0;s<e;s++)t+=" ";return t}function or(n,e){n instanceof z&&(n=new yn(n));for(let i of n.state.facet(za)){let s=i(n,e);if(s!=null)return s}let t=oe(n.state);return t?t2(n,t,e):null}class yn{constructor(e,t={}){this.state=e,this.options=t,this.unit=At(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s<e:s<=e)?{text:i.text.slice(s-i.from),from:s}:{text:i.text.slice(0,s-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:s}=this.lineAt(e,t);return i.slice(e-s,Math.min(i.length,e+100-s))}column(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.countColumn(i,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return ni(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const e2=new O;function t2(n,e,t){return ja(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function i2(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function n2(n){let e=n.type.prop(e2);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(O.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>l2(o,!0,1,void 0,r&&!i2(o)?s.from:void 0)}return n.parent==null?s2:null}function ja(n,e,t){for(;n;n=n.parent){let i=n2(n);if(i)return i(lr.create(t,e,n))}return null}function s2(){return 0}class lr extends yn{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new lr(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(r2(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?ja(e,this.pos,this.base):0}}function r2(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function o2(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from<o?t:null;l=a.to}}function l2(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||s==n.pos+o,a=e?o2(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const a2=200;function h2(){return z.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+a2)return n;let r=t.sliceString(s.from,i);if(!e.some(c=>c.test(r)))return n;let{state:o}=n,l=-1,a=[];for(let{head:c}of o.selection.ranges){let f=o.doc.lineAt(c);if(f.from==l)continue;l=f.from;let u=or(o,f.from);if(u==null)continue;let d=/^\s*/.exec(f.text)[0],m=ki(o,u);d!=m&&a.push({from:f.from,to:f.from+d.length,insert:m})}return a.length?[n,{changes:a,sequential:!0}]:n})}const c2=D.define(),f2=new O;function u2(n,e,t){let i=oe(n);if(i.length<t)return null;let s=i.resolveInner(t),r=null;for(let o=s;o;o=o.parent){if(o.to<=t||o.from>t)continue;if(r&&o.from<e)break;let l=o.type.prop(f2);if(l&&(o.to<i.length-50||i.length==n.doc.length||!d2(o))){let a=l(o,n);a&&a.from<=t&&a.from>=e&&a.to>t&&(r=a)}}return r}function d2(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function wn(n,e,t){for(let i of n.facet(c2)){let s=i(n,e,t);if(s)return s}return u2(n,e,t)}function Va(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const xn=B.define({map:Va}),Ci=B.define({map:Va});function $a(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Lt=ne.define({create(){return E.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(xn)&&!m2(n,t.value.from,t.value.to)?n=n.update({add:[Wa.range(t.value.from,t.value.to)]}):t.is(Ci)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(s,r)=>{s<i&&r>i&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,r)=>r<=i||s>=i}))}return n},provide:n=>I.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],s=n[t++];if(typeof i!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(Wa.range(i,s))}return E.set(e,!0)}});function bn(n,e,t){var i;let s=null;return(i=n.field(Lt,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function m2(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function Pa(n,e){return n.field(Lt,!1)?e:e.concat(B.appendConfig.of(Fa()))}const p2=n=>{for(let e of $a(n)){let t=wn(n.state,e.from,e.to);if(t)return n.dispatch({effects:Pa(n.state,[xn.of(t),Ra(n,t)])}),!0}return!1},g2=n=>{if(!n.state.field(Lt,!1))return!1;let e=[];for(let t of $a(n)){let i=bn(n.state,t.from,t.to);i&&e.push(Ci.of(i),Ra(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Ra(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return I.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const y2=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:p2},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:g2},{key:"Ctrl-Alt-[",run:n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let s=n.lineBlockAt(i),r=wn(e,s.from,s.to);r&&t.push(xn.of(r)),i=(r?n.lineBlockAt(r.to):s).to+1}return t.length&&n.dispatch({effects:Pa(n.state,t)}),!!t.length}},{key:"Ctrl-Alt-]",run:n=>{let e=n.state.field(Lt,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(Ci.of({from:i,to:s}))}),n.dispatch({effects:t}),!0}}],w2={placeholderDOM:null,placeholderText:"\u2026"},Ha=D.define({combine(n){return Ke(n,w2)}});function Fa(n){let e=[Lt,k2];return n&&e.push(Ha.of(n)),e}const Wa=E.replace({widget:new class extends rt{toDOM(n){let{state:e}=n,t=e.facet(Ha),i=r=>{let o=n.lineBlockAt(n.posAtDOM(r.target)),l=bn(n.state,o.from,o.to);l&&n.dispatch({effects:Ci.of(l)}),r.preventDefault()};if(t.placeholderDOM)return t.placeholderDOM(n,i);let s=document.createElement("span");return s.textContent=t.placeholderText,s.setAttribute("aria-label",e.phrase("folded code")),s.title=e.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}}}),x2={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ar extends Qe{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function b2(n={}){let e=Object.assign(Object.assign({},x2),n),t=new ar(e,!0),i=new ar(e,!1),s=Z.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ut)!=o.state.facet(ut)||o.startState.field(Lt,!1)!=o.state.field(Lt,!1)||oe(o.startState)!=oe(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new et;for(let a of o.viewportLineBlocks){let c=bn(o.state,a.from,a.to)?i:wn(o.state,a.from,a.to)?t:null;c&&l.add(a.from,a.from,c)}return l.finish()}}),{domEventHandlers:r}=e;return[s,v1({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||$.empty},initialSpacer(){return new ar(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let c=bn(o.state,l.from,l.to);if(c)return o.dispatch({effects:Ci.of(c)}),!0;let f=wn(o.state,l.from,l.to);return f?(o.dispatch({effects:xn.of(f)}),!0):!1}})}),Fa()]}const k2=I.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class kn{constructor(e,t){let i;function s(l){let a=tt.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof Te?l=>l.prop(xi)==o.data:o?l=>l==o:void 0,this.style=Na(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new tt(i):null,this.themeType=t.themeType}static define(e,t){return new kn(e,t||{})}}const hr=D.define(),Ua=D.define({combine(n){return n.length?[n[0]]:null}});function cr(n){let e=n.facet(hr);return e.length?e:n.facet(Ua)}function C2(n,e){let t=[S2],i;return n instanceof kn&&(n.module&&t.push(I.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Ua.of(n)):i?t.push(hr.computeN([I.darkTheme],s=>s.facet(I.darkTheme)==(i=="dark")?[n]:[])):t.push(hr.of(n)),t}class M2{constructor(e){this.markCache=Object.create(null),this.tree=oe(e.state),this.decorations=this.buildDeco(e,cr(e.state))}update(e){let t=oe(e.state),i=cr(e.state),s=i!=cr(e.startState);t.length<e.view.viewport.to&&!s&&t.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i))}buildDeco(e,t){if(!t||!this.tree.length)return E.none;let i=new et;for(let{from:s,to:r}of e.visibleRanges)q1(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=E.mark({class:a})))},s,r);return i.finish()}}const S2=Et.high(Z.fromClass(M2,{decorations:n=>n.decorations})),A2=kn.define([{tag:C.meta,color:"#7a757a"},{tag:C.link,textDecoration:"underline"},{tag:C.heading,textDecoration:"underline",fontWeight:"bold"},{tag:C.emphasis,fontStyle:"italic"},{tag:C.strong,fontWeight:"bold"},{tag:C.strikethrough,textDecoration:"line-through"},{tag:C.keyword,color:"#708"},{tag:[C.atom,C.bool,C.url,C.contentSeparator,C.labelName],color:"#219"},{tag:[C.literal,C.inserted],color:"#164"},{tag:[C.string,C.deleted],color:"#a11"},{tag:[C.regexp,C.escape,C.special(C.string)],color:"#e40"},{tag:C.definition(C.variableName),color:"#00f"},{tag:C.local(C.variableName),color:"#30a"},{tag:[C.typeName,C.namespace],color:"#085"},{tag:C.className,color:"#167"},{tag:[C.special(C.variableName),C.macroName],color:"#256"},{tag:C.definition(C.propertyName),color:"#00c"},{tag:C.comment,color:"#940"},{tag:C.invalid,color:"#f00"}]),L2=I.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ya=1e4,Ga="()[]{}",Ka=D.define({combine(n){return Ke(n,{afterCursor:!0,brackets:Ga,maxScanDistance:Ya,renderMatch:I2})}}),v2=E.mark({class:"cm-matchingBracket"}),D2=E.mark({class:"cm-nonmatchingBracket"});function I2(n){let e=[],t=n.matched?v2:D2;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const N2=[ne.define({create(){return E.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Ka);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=We(e.state,s.head,-1,i)||s.head>0&&We(e.state,s.head-1,1,i)||i.afterCursor&&(We(e.state,s.head,1,i)||s.head<e.state.doc.length&&We(e.state,s.head+1,-1,i));r&&(t=t.concat(i.renderMatch(r,e.state)))}return E.set(t,!0)},provide:n=>I.decorations.from(n)}),L2];function E2(n={}){return[Ka.of(n),N2]}function fr(n,e,t){let i=n.prop(e<0?O.openedBy:O.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function We(n,e,t,i={}){let s=i.maxScanDistance||Ya,r=i.brackets||Ga,o=oe(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let c=fr(a.type,t,r);if(c&&a.from<a.to)return T2(n,e,t,a,c,r)}return B2(n,e,t,o,l.type,s,r)}function T2(n,e,t,i,s,r){let o=i.parent,l={from:i.from,to:i.to},a=0,c=o==null?void 0:o.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(a==0&&s.indexOf(c.type.name)>-1&&c.from<c.to)return{start:l,end:{from:c.from,to:c.to},matched:!0};if(fr(c.type,t,r))a++;else if(fr(c.type,-t,r)){if(a==0)return{start:l,end:c.from==c.to?void 0:{from:c.from,to:c.to},matched:!1};a--}}while(t<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}function B2(n,e,t,i,s,r,o){let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},f=n.doc.iterRange(e,t>0?n.doc.length:0),u=0;for(let d=0;!f.next().done&&d<=r;){let m=f.value;t<0&&(d+=m.length);let p=e+d*t;for(let g=t>0?0:m.length-1,y=t>0?m.length:-1;g!=y;g+=t){let x=o.indexOf(m[g]);if(!(x<0||i.resolveInner(p+g,1).type!=s))if(x%2==0==t>0)u++;else{if(u==1)return{start:c,end:{from:p+g,to:p+g+1},matched:x>>1==a>>1};u--}}t>0&&(d+=m.length)}return f.done?{start:c,matched:!1}:null}function qa(n,e,t,i=0,s=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let r=s;for(let o=i;o<e;o++)n.charCodeAt(o)==9?r+=t-r%t:r++;return r}class Qa{constructor(e,t,i){this.string=e,this.tabSize=t,this.indentUnit=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=qa(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){return qa(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let s=o=>i?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return s(r)==s(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function _2(n){return{token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||O2,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||mr}}function O2(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}class ur extends Te{constructor(e){let t=Z1(e.languageData),i=_2(e),s,r=new class extends va{createParse(o,l,a){return new j2(s,o,l,a)}};super(t,r,[za.of((o,l)=>this.getIndent(o,l))]),this.topNode=P2(t),s=this,this.streamParser=i,this.stateAfter=new O({perNode:!0}),this.tokenTable=e.tokenTable?new th(i.tokenTable):$2}static define(e){return new ur(e)}getIndent(e,t){let i=oe(e.state),s=i.resolve(t);for(;s&&s.type!=this.topNode;)s=s.parent;if(!s)return null;let r=dr(this,i,0,s.from,t),o,l;if(r?(l=r.state,o=r.pos+1):(l=this.streamParser.startState(e.unit),o=0),t-o>1e4)return null;for(;o<t;){let c=e.state.doc.lineAt(o),f=Math.min(t,c.to);if(c.length){let u=new Qa(c.text,e.state.tabSize,e.unit);for(;u.pos<f-c.from;)Ja(this.streamParser.token,u,l)}else this.streamParser.blankLine(l,e.unit);if(f==t)break;o=c.to+1}let{text:a}=e.lineAt(t);return this.streamParser.indent(l,/^\s*(.*)/.exec(a)[1],e)}get allowsNesting(){return!1}}function dr(n,e,t,i,s){let r=t>=i&&t+e.length<=s&&e.prop(n.stateAfter);if(r)return{state:n.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],c=l instanceof G&&a<s&&dr(n,l,a,i,s);if(c)return c}return null}function Za(n,e,t,i,s){if(s&&t<=0&&i>=e.length)return e;!s&&e.type==n.topNode&&(s=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(o<i&&l instanceof G){if(!(a=Za(n,l,t-o,i-o,s)))break;return s?new G(e.type,e.children.slice(0,r).concat(a),e.positions.slice(0,r+1),o+a.length):a}}return null}function z2(n,e,t,i){for(let s of e){let r=s.from+(s.openStart?25:0),o=s.to-(s.openEnd?25:0),l=r<=t&&o>t&&dr(n,s.tree,0-s.offset,t,o),a;if(l&&(a=Za(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:a}}return{state:n.streamParser.startState(i?At(i):4),tree:G.empty}}class j2{constructor(e,t,i,s){this.lang=e,this.input=t,this.fragments=i,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let r=Pt.get(),o=s[0].from,{state:l,tree:a}=z2(e,i,o,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let c=0;c<a.children.length;c++)this.chunks.push(a.children[c]),this.chunkPos.push(a.positions[c]);r&&this.parsedPos<r.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(At(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Pt.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+2048);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
11
|
+
`&&(t="");else{let i=t.indexOf(`
|
|
12
|
+
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;t+=this.ranges[++this.rangeIndex].from-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s,r){if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let o=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-o}return this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new Qa(t,e?e.state.tabSize:4,e?At(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Ja(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,4,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=G.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:V2,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new G(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new G(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Ja(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const mr=Object.create(null),Mi=[we.none],V2=new Zs(Mi),Xa=[],eh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])eh[n]=ih(mr,e);class th{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),eh)}resolve(e){return e?this.table[e]||(this.table[e]=ih(this.extra,e)):0}}const $2=new th(mr);function pr(n,e){Xa.indexOf(n)>-1||(Xa.push(n),console.warn(e))}function ih(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||C[r];o?typeof o=="function"?t?t=o(t):pr(r,`Modifier ${r} used at start of tag`):t?pr(r,`Tag ${r} used as modifier`):t=o:pr(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=we.define({id:Mi.length,name:i,props:[Y1({[i]:t})]});return Mi.push(s),s.id}function P2(n){let e=we.define({id:Mi.length,name:"Document",props:[xi.add(()=>n)]});return Mi.push(e),e}const R2=n=>{let e=yr(n.state);return e.line?H2(n):e.block?W2(n):!1};function gr(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const H2=gr(G2,0),F2=gr(nh,0),W2=gr((n,e)=>nh(n,e,Y2(e)),0);function yr(n,e=n.selection.main.head){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const Si=50;function U2(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-Si,i),o=n.sliceDoc(s,s+Si),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,c=r.length-l;if(r.slice(c-e.length,c)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let f,u;s-i<=2*Si?f=u=n.sliceDoc(i,s):(f=n.sliceDoc(i,i+Si),u=n.sliceDoc(s-Si,s));let d=/^\s*/.exec(f)[0].length,m=/\s*$/.exec(u)[0].length,p=u.length-m-t.length;return f.slice(d,d+e.length)==e&&u.slice(p,p+t.length)==t?{open:{pos:i+d+e.length,margin:/\s/.test(f.charAt(d+e.length))?1:0},close:{pos:s-m-t.length,margin:/\s/.test(u.charAt(p-1))?1:0}}:null}function Y2(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from,to:s.to})}return e}function nh(n,e,t=e.selection.ranges){let i=t.map(r=>yr(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>U2(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let a=i[o],{open:c,close:f}=l;r.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:f.pos-f.margin,to:f.pos+a.close.length})}return{changes:r}}return null}function G2(n,e,t=e.selection.ranges){let i=[],s=-1;for(let{from:r,to:o}of t){let l=i.length,a=1e9;for(let c=r;c<=o;){let f=e.doc.lineAt(c);if(f.from>s&&(r==o||o>f.from)){s=f.from;let u=yr(e,c).line;if(!u)continue;let d=/^\s*/.exec(f.text)[0].length,m=d==f.length,p=f.text.slice(d,d+u.length)==u?d:-1;d<f.text.length&&d<a&&(a=d),i.push({line:f,comment:p,token:u,indent:d,empty:m,single:!1})}c=f.to+1}if(a<1e9)for(let c=l;c<i.length;c++)i[c].indent<i[c].line.text.length&&(i[c].indent=a);i.length==l+1&&(i[l].single=!0)}if(n!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:c,empty:f,single:u}of i)(u||!f)&&r.push({from:l.from+c,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,f=c+a.length;o.text[f-o.from]==" "&&f++,r.push({from:c,to:f})}return{changes:r}}return null}const wr=wt.define(),K2=wt.define(),q2=D.define(),sh=D.define({combine(n){return Ke(n,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}});function Q2(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const rh=ne.define({create(){return Ue.empty},update(n,e){let t=e.state.facet(sh),i=e.annotation(wr);if(i){let a=e.docChanged?w.single(Q2(e.changes)):void 0,c=xe.fromTransaction(e,a),f=i.side,u=f==0?n.undone:n.done;return c?u=Mn(u,u.length,t.minDepth,c):u=ah(u,e.startState.selection),new Ue(f==0?i.rest:u,f==0?u:i.rest)}let s=e.annotation(K2);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(ee.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=xe.fromTransaction(e),o=e.annotation(ee.time),l=e.annotation(ee.userEvent);return r?n=n.addChanges(r,o,l,t.newGroupDelay,t.minDepth):e.selection&&(n=n.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Ue(n.done.map(xe.fromJSON),n.undone.map(xe.fromJSON))}});function Z2(n={}){return[rh,sh.of(n),I.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?oh:e.inputType=="historyRedo"?xr:null;return i?(e.preventDefault(),i(t)):!1}})]}function Cn(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(rh,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const oh=Cn(0,!1),xr=Cn(1,!1),J2=Cn(0,!0),X2=Cn(1,!0);class xe{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new xe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new xe(e.changes&&X.fromJSON(e.changes),[],e.mapped&&je.fromJSON(e.mapped),e.startSelection&&w.fromJSON(e.startSelection),e.selectionsAfter.map(w.fromJSON))}static fromTransaction(e,t){let i=De;for(let s of e.startState.facet(q2)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new xe(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,De)}static selection(e){return new xe(void 0,De,void 0,void 0,e)}}function Mn(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function ey(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a<t.length;){let c=t[a++],f=t[a++];l>=c&&o<=f&&(i=!0)}}),i}function ty(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function lh(n,e){return n.length?e.length?n.concat(e):n:e}const De=[],iy=200;function ah(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-iy));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Mn(n,n.length-1,1e9,t.setSelAfter(i)))}else return[xe.selection([e])]}function ny(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function br(n,e){if(!n.length)return n;let t=n.length,i=De;for(;t;){let s=sy(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[xe.selection(i)]:De}function sy(n,e,t){let i=lh(n.selectionsAfter.length?n.selectionsAfter.map(l=>l.map(e)):De,t);if(!n.changes)return xe.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new xe(s,B.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const ry=/^(input\.type|delete)($|\.)/;class Ue{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new Ue(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||ry.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime<s&&ey(l.changes,e.changes)||i=="input.type.compose")?o=Mn(o,o.length-1,r,new xe(e.changes.compose(l.changes),lh(e.effects,l.effects),l.mapped,l.startSelection,De)):o=Mn(o,o.length,r,e),new Ue(o,De,t,i)}addSelection(e,t,i,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:De;return r.length>0&&t-this.prevTime<s&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&ty(r[r.length-1],e)?this:new Ue(ah(this.done,e),this.undone,t,i)}addMapping(e){return new Ue(br(this.done,e),br(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let s=e==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1];if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:wr.of({side:e,rest:ny(s)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let o=s.length==1?De:s.slice(0,s.length-1);return r.mapped&&(o=br(o,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:wr.of({side:e,rest:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ue.empty=new Ue(De,De);const oy=[{key:"Mod-z",run:oh,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:xr,preventDefault:!0},{linux:"Ctrl-Shift-z",run:xr,preventDefault:!0},{key:"Mod-u",run:J2,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:X2,preventDefault:!0}];function Ht(n,e){return w.create(n.ranges.map(e),n.mainIndex)}function Ye(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Be({state:n,dispatch:e},t){let i=Ht(n.selection,t);return i.eq(n.selection)?!1:(e(Ye(n,i)),!0)}function Sn(n,e){return w.cursor(e?n.to:n.from)}function hh(n,e){return Be(n,t=>t.empty?n.moveByChar(t,e):Sn(t,e))}function fe(n){return n.textDirectionAt(n.state.selection.main.head)==U.LTR}const ch=n=>hh(n,!fe(n)),fh=n=>hh(n,fe(n));function uh(n,e){return Be(n,t=>t.empty?n.moveByGroup(t,e):Sn(t,e))}const ly=n=>uh(n,!fe(n)),ay=n=>uh(n,fe(n));function hy(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function An(n,e,t){let i=oe(n).resolveInner(e.head),s=t?O.closedBy:O.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;hy(n,c,s)?i=c:a=t?c.to:c.from}let r=i.type.prop(s),o,l;return r&&(o=t?We(n,i.from,1):We(n,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,w.cursor(l,t?-1:1)}const cy=n=>Be(n,e=>An(n.state,e,!fe(n))),fy=n=>Be(n,e=>An(n.state,e,fe(n)));function dh(n,e){return Be(n,t=>{if(!t.empty)return Sn(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const mh=n=>dh(n,!1),ph=n=>dh(n,!0);function gh(n){return Math.max(n.defaultLineHeight,Math.min(n.dom.clientHeight,innerHeight)-5)}function yh(n,e){let{state:t}=n,i=Ht(t.selection,l=>l.empty?n.moveVertically(l,e,gh(n)):Sn(l,e));if(i.eq(t.selection))return!1;let s=n.coordsAtPos(t.selection.main.head),r=n.scrollDOM.getBoundingClientRect(),o;return s&&s.top>r.top&&s.bottom<r.bottom&&s.top-r.top<=n.scrollDOM.scrollHeight-n.scrollDOM.scrollTop-n.scrollDOM.clientHeight&&(o=I.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-r.top})),n.dispatch(Ye(t,i),{effects:o}),!0}const wh=n=>yh(n,!1),kr=n=>yh(n,!0);function dt(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=w.cursor(i.from+r))}return s}const uy=n=>Be(n,e=>dt(n,e,!0)),dy=n=>Be(n,e=>dt(n,e,!1)),my=n=>Be(n,e=>dt(n,e,!fe(n))),py=n=>Be(n,e=>dt(n,e,fe(n))),gy=n=>Be(n,e=>w.cursor(n.lineBlockAt(e.head).from,1)),yy=n=>Be(n,e=>w.cursor(n.lineBlockAt(e.head).to,-1));function wy(n,e,t){let i=!1,s=Ht(n.selection,r=>{let o=We(n,r.head,-1)||We(n,r.head,1)||r.head>0&&We(n,r.head-1,1)||r.head<n.doc.length&&We(n,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return t?w.range(r.anchor,l):w.cursor(l)});return i?(e(Ye(n,s)),!0):!1}const xy=({state:n,dispatch:e})=>wy(n,e,!1);function Ie(n,e){let t=Ht(n.state.selection,i=>{let s=e(i);return w.range(i.anchor,s.head,s.goalColumn)});return t.eq(n.state.selection)?!1:(n.dispatch(Ye(n.state,t)),!0)}function xh(n,e){return Ie(n,t=>n.moveByChar(t,e))}const bh=n=>xh(n,!fe(n)),kh=n=>xh(n,fe(n));function Ch(n,e){return Ie(n,t=>n.moveByGroup(t,e))}const by=n=>Ch(n,!fe(n)),ky=n=>Ch(n,fe(n)),Cy=n=>Ie(n,e=>An(n.state,e,!fe(n))),My=n=>Ie(n,e=>An(n.state,e,fe(n)));function Mh(n,e){return Ie(n,t=>n.moveVertically(t,e))}const Sh=n=>Mh(n,!1),Ah=n=>Mh(n,!0);function Lh(n,e){return Ie(n,t=>n.moveVertically(t,e,gh(n)))}const vh=n=>Lh(n,!1),Dh=n=>Lh(n,!0),Sy=n=>Ie(n,e=>dt(n,e,!0)),Ay=n=>Ie(n,e=>dt(n,e,!1)),Ly=n=>Ie(n,e=>dt(n,e,!fe(n))),vy=n=>Ie(n,e=>dt(n,e,fe(n))),Dy=n=>Ie(n,e=>w.cursor(n.lineBlockAt(e.head).from)),Iy=n=>Ie(n,e=>w.cursor(n.lineBlockAt(e.head).to)),Ih=({state:n,dispatch:e})=>(e(Ye(n,{anchor:0})),!0),Nh=({state:n,dispatch:e})=>(e(Ye(n,{anchor:n.doc.length})),!0),Eh=({state:n,dispatch:e})=>(e(Ye(n,{anchor:n.selection.main.anchor,head:0})),!0),Th=({state:n,dispatch:e})=>(e(Ye(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Ny=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),Ey=({state:n,dispatch:e})=>{let t=Dn(n).map(({from:i,to:s})=>w.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:w.create(t),userEvent:"select"})),!0},Ty=({state:n,dispatch:e})=>{let t=Ht(n.selection,i=>{var s;let r=oe(n).resolveInner(i.head,1);for(;!(r.from<i.from&&r.to>=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return w.range(r.to,r.from)});return e(Ye(n,t)),!0},By=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=w.create([t.main]):t.main.empty||(i=w.create([w.cursor(t.main.head)])),i?(e(Ye(n,i)),!0):!1};function Ln({state:n,dispatch:e},t){if(n.readOnly)return!1;let i="delete.selection",s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(o);a<o?i="delete.backward":a>o&&(i="delete.forward"),o=Math.min(o,a),l=Math.max(l,a)}return o==l?{range:r}:{changes:{from:o,to:l},range:w.cursor(o)}});return s.changes.empty?!1:(e(n.update(s,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?I.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function vn(n,e,t){if(n instanceof I)for(let i of n.state.facet(I.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{s<e&&r>e&&(e=t?r:s)});return e}const Bh=(n,e)=>Ln(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&t<s.from+200&&!/[^ \t]/.test(r=s.text.slice(0,t-s.from))){if(r[r.length-1]==" ")return t-1;let l=ni(r,i.tabSize),a=l%At(i)||At(i);for(let c=0;c<a&&r[r.length-1-c]==" ";c++)t--;o=t}else o=ke(s.text,t-s.from,e,e)+s.from,o==t&&s.number!=(e?i.doc.lines:1)&&(o+=e?1:-1);return vn(n,o,e)}),Cr=n=>Bh(n,!1),_h=n=>Bh(n,!0),Oh=(n,e)=>Ln(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let a=ke(r.text,i-r.from,e)+r.from,c=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),f=o(c);if(l!=null&&f!=l)break;(c!=" "||i!=t)&&(l=f),i=a}return vn(n,i,e)}),zh=n=>Oh(n,!1),_y=n=>Oh(n,!0),jh=n=>Ln(n,e=>{let t=n.lineBlockAt(e).to;return vn(n,e<t?t:Math.min(n.state.doc.length,e+1),!0)}),Oy=n=>Ln(n,e=>{let t=n.lineBlockAt(e).from;return vn(n,e>t?t:Math.max(0,e-1),!1)}),zy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:V.of(["",""])},range:w.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},jy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:ke(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:ke(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:n.doc.slice(s,l).append(n.doc.slice(o,s))},range:w.cursor(l)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Dn(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function Vh(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of Dn(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let a of r.ranges)s.push(w.range(Math.min(n.doc.length,a.anchor+l),Math.min(n.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let a of r.ranges)s.push(w.range(a.anchor-l,a.head-l))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:w.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Vy=({state:n,dispatch:e})=>Vh(n,e,!1),$y=({state:n,dispatch:e})=>Vh(n,e,!0);function $h(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Dn(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Py=({state:n,dispatch:e})=>$h(n,e,!1),Ry=({state:n,dispatch:e})=>$h(n,e,!0),Hy=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Dn(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),i=Ht(e.selection,s=>n.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Fy(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=oe(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(O.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const Wy=Ph(!1),Uy=Ph(!0);function Ph(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!n&&r==o&&Fy(e,r);n&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new yn(e,{simulateBreak:r,simulateDoubleBreak:!!a}),f=or(c,r);for(f==null&&(f=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let u=["",ki(e,f)];return a&&u.push(ki(e,c.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:V.of(u)},range:w.cursor(r+1+u[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Mr(n,e){let t=-1;return n.changeByRange(i=>{let s=[];for(let o=i.from;o<=i.to;){let l=n.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,s,i),t=l.number),o=l.to+1}let r=n.changes(s);return{changes:s,range:w.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const Yy=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new yn(n,{overrideIndentation:r=>{let o=t[r];return o==null?-1:o}}),s=Mr(n,(r,o,l)=>{let a=or(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let c=/^\s*/.exec(r.text)[0],f=ki(n,a);(c!=f||l.from<r.from+c.length)&&(t[r.from]=a,o.push({from:r.from,to:r.from+c.length,insert:f}))});return s.changes.empty||e(n.update(s,{userEvent:"indent"})),!0},Gy=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Mr(n,(t,i)=>{i.push({from:t.from,insert:n.facet(rr)})}),{userEvent:"input.indent"})),!0),Ky=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Mr(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=ni(s,n.tabSize),o=0,l=ki(n,Math.max(0,r-At(n)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:t.from+o,to:t.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),qy=[{key:"Ctrl-b",run:ch,shift:bh,preventDefault:!0},{key:"Ctrl-f",run:fh,shift:kh},{key:"Ctrl-p",run:mh,shift:Sh},{key:"Ctrl-n",run:ph,shift:Ah},{key:"Ctrl-a",run:gy,shift:Dy},{key:"Ctrl-e",run:yy,shift:Iy},{key:"Ctrl-d",run:_h},{key:"Ctrl-h",run:Cr},{key:"Ctrl-k",run:jh},{key:"Ctrl-Alt-h",run:zh},{key:"Ctrl-o",run:zy},{key:"Ctrl-t",run:jy},{key:"Ctrl-v",run:kr}],Qy=[{key:"ArrowLeft",run:ch,shift:bh,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:ly,shift:by,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:my,shift:Ly,preventDefault:!0},{key:"ArrowRight",run:fh,shift:kh,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:ay,shift:ky,preventDefault:!0},{mac:"Cmd-ArrowRight",run:py,shift:vy,preventDefault:!0},{key:"ArrowUp",run:mh,shift:Sh,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Ih,shift:Eh},{mac:"Ctrl-ArrowUp",run:wh,shift:vh},{key:"ArrowDown",run:ph,shift:Ah,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Nh,shift:Th},{mac:"Ctrl-ArrowDown",run:kr,shift:Dh},{key:"PageUp",run:wh,shift:vh},{key:"PageDown",run:kr,shift:Dh},{key:"Home",run:dy,shift:Ay,preventDefault:!0},{key:"Mod-Home",run:Ih,shift:Eh},{key:"End",run:uy,shift:Sy,preventDefault:!0},{key:"Mod-End",run:Nh,shift:Th},{key:"Enter",run:Wy},{key:"Mod-a",run:Ny},{key:"Backspace",run:Cr,shift:Cr},{key:"Delete",run:_h},{key:"Mod-Backspace",mac:"Alt-Backspace",run:zh},{key:"Mod-Delete",mac:"Alt-Delete",run:_y},{mac:"Mod-Backspace",run:Oy},{mac:"Mod-Delete",run:jh}].concat(qy.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Zy=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cy,shift:Cy},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:fy,shift:My},{key:"Alt-ArrowUp",run:Vy},{key:"Shift-Alt-ArrowUp",run:Py},{key:"Alt-ArrowDown",run:$y},{key:"Shift-Alt-ArrowDown",run:Ry},{key:"Escape",run:By},{key:"Mod-Enter",run:Uy},{key:"Alt-l",mac:"Ctrl-l",run:Ey},{key:"Mod-i",run:Ty,preventDefault:!0},{key:"Mod-[",run:Ky},{key:"Mod-]",run:Gy},{key:"Mod-Alt-\\",run:Yy},{key:"Shift-Mod-k",run:Hy},{key:"Shift-Mod-\\",run:xy},{key:"Mod-/",run:R2},{key:"Alt-A",run:F2}].concat(Qy);function W(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;e<arguments.length;e++)Rh(n,arguments[e]);return n}function Rh(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Rh(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const Hh=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Ft{constructor(e,t,i=0,s=e.length,r){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?o=>r(Hh(o)):Hh,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ie(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Gn(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Ce(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let l=s.charCodeAt(r),a=this.match(l,o);if(a)return this.value=a,this;if(r==s.length-1)break;o==i&&r<t.length&&t.charCodeAt(r)==l&&o++}}}match(e,t){let i=null;for(let s=0;s<this.matches.length;s+=2){let r=this.matches[s],o=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?i={from:this.matches[s+1],to:t+1}:(this.matches[s]++,o=!0)),o||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:t+1}:this.matches.push(1,t)),i}}typeof Symbol<"u"&&(Ft.prototype[Symbol.iterator]=function(){return this});const Fh={from:-1,to:-1,match:/.*/.exec("")},Sr="gm"+(/x/.unicode==null?"":"u");class Wh{constructor(e,t,i,s=0,r=e.length){if(this.to=r,this.curLine="",this.done=!1,this.value=Fh,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Uh(e,t,i,s,r);this.re=new RegExp(t,Sr+(i!=null&&i.ignoreCase?"i":"")),this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=s,this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=s+(i==s?1:0),i==this.curLine.length&&this.nextLine(),i<s||i>this.value.to)return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Ar=new WeakMap;class Wt{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let s=Ar.get(e);if(!s||s.from>=i||s.to<=t){let l=new Wt(t,e.sliceString(t,i));return Ar.set(e,l),l}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to<i&&(r+=e.sliceString(s.to,i)),Ar.set(e,new Wt(o,r)),new Wt(t,r.slice(t-o,i-o))}}class Uh{constructor(e,t,i,s,r){this.text=e,this.to=r,this.done=!1,this.value=Fh,this.matchPos=s,this.re=new RegExp(t,Sr+(i!=null&&i.ignoreCase?"i":"")),this.flat=Wt.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.to<this.to&&t.index+t[0].length>this.flat.text.length-10&&(t=null),t){let i=this.flat.from+t.index,s=i+t[0].length;return this.value={from:i,to:s,match:t},this.matchPos=s+(i==s?1:0),this}else{if(this.flat.to==this.to)return this.done=!0,this;this.flat=Wt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}}typeof Symbol<"u"&&(Wh.prototype[Symbol.iterator]=Uh.prototype[Symbol.iterator]=function(){return this});function Jy(n){try{return new RegExp(n,Sr),!0}catch{return!1}}function Lr(n){let e=W("input",{class:"cm-textfield",name:"line"}),t=W("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:In.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},W("label",n.state.phrase("Go to line"),": ",e)," ",W("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,l,a,c,f]=s,u=c?+c.slice(1):0,d=a?+a:o.number;if(a&&f){let p=d/100;l&&(p=p*(l=="-"?-1:1)+o.number/r.doc.lines),d=Math.round(r.doc.lines*p)}else a&&l&&(d=d*(l=="-"?-1:1)+o.number);let m=r.doc.line(Math.max(1,Math.min(r.doc.lines,d)));n.dispatch({effects:In.of(!1),selection:w.cursor(m.from+Math.max(0,Math.min(u,m.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const In=B.define(),Yh=ne.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(In)&&(n=t.value);return n},provide:n=>gi.from(n,e=>e?Lr:null)}),Xy=n=>{let e=pi(n,Lr);if(!e){let t=[In.of(!0)];n.state.field(Yh,!1)==null&&t.push(B.appendConfig.of([Yh,ew])),n.dispatch({effects:t}),e=pi(n,Lr)}return e&&e.dom.querySelector("input").focus(),!0},ew=I.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tw={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Gh=D.define({combine(n){return Ke(n,tw,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function iw(n){let e=[lw,ow];return n&&e.push(Gh.of(n)),e}const nw=E.mark({class:"cm-selectionMatch"}),sw=E.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Kh(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=me.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=me.Word)}function rw(n,e,t,i){return n(e.sliceDoc(t,t+1))==me.Word&&n(e.sliceDoc(i-1,i))==me.Word}const ow=Z.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(Gh),{state:t}=n,i=t.selection;if(i.ranges.length>1)return E.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return E.none;let a=t.wordAt(s.head);if(!a)return E.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<e.minSelectionLength||a>200)return E.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(Kh(o,t,s.from,s.to)&&rw(o,t,s.from,s.to)))return E.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return E.none}let l=[];for(let a of n.visibleRanges){let c=new Ft(t.doc,r,a.from,a.to);for(;!c.next().done;){let{from:f,to:u}=c.value;if((!o||Kh(o,t,f,u))&&(s.empty&&f<=s.from&&u>=s.to?l.push(sw.range(f,u)):(f>=s.to||u<=s.from)&&l.push(nw.range(f,u)),l.length>e.maxMatches))return E.none}}return E.set(l)}},{decorations:n=>n.decorations}),lw=I.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),aw=({state:n,dispatch:e})=>{let{selection:t}=n,i=w.create(t.ranges.map(s=>n.wordAt(s.head)||w.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function hw(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Ft(n.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Ft(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=n.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const cw=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return aw({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=hw(n,i);return s?(e(n.update({selection:n.selection.addRange(w.range(s.from,s.to),!1),effects:I.scrollIntoView(s.to)})),!0):!1},vr=D.define({combine(n){var e;return{top:n.reduce((t,i)=>t!=null?t:i.top,void 0)||!1,caseSensitive:n.reduce((t,i)=>t!=null?t:i.caseSensitive,void 0)||!1,createPanel:((e=n.find(t=>t.createPanel))===null||e===void 0?void 0:e.createPanel)||(t=>new bw(t))}}});class qh{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||Jy(this.search)),this.unquoted=e.literal?this.search:this.search.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
|
|
13
|
+
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new uw(this):new fw(this)}getCursor(e,t=0,i=e.length){return this.regexp?Yt(this,e,t,i):Ut(this,e,t,i)}}class Qh{constructor(e){this.spec=e}}function Ut(n,e,t,i){return new Ft(e,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase())}class fw extends Qh{constructor(e){super(e)}nextMatch(e,t,i){let s=Ut(this.spec,e,i,e.length).nextOverlapping();return s.done&&(s=Ut(this.spec,e,0,t).nextOverlapping()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Ut(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=Ut(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ut(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Yt(n,e,t,i){return new Wh(e,n.search,n.caseSensitive?void 0:{ignoreCase:!0},t,i)}class uw extends Qh{nextMatch(e,t,i){let s=Yt(this.spec,e,i,e.length).next();return s.done&&(s=Yt(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Yt(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Yt(this.spec,e,0,e.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Yt(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ai=B.define(),Dr=B.define(),mt=ne.define({create(n){return new Ir(Er(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ai)?n=new Ir(t.value.create(),n.panel):t.is(Dr)&&(n=new Ir(n.query,t.value?Nr:null));return n},provide:n=>gi.from(n,e=>e.panel)});class Ir{constructor(e,t){this.query=e,this.panel=t}}const dw=E.mark({class:"cm-searchMatch"}),mw=E.mark({class:"cm-searchMatch cm-searchMatch-selected"}),pw=Z.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(mt))}update(n){let e=n.state.field(mt);(e!=n.startState.field(mt)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return E.none;let{view:t}=this,i=new et;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state.doc,l,a,(c,f)=>{let u=t.state.selection.ranges.some(d=>d.from==c&&d.to==f);i.add(c,f,u?mw:dw)})}return i.finish()}},{decorations:n=>n.decorations});function Li(n){return e=>{let t=e.state.field(mt,!1);return t&&t.query.spec.valid?n(e,t):Jh(e)}}const Nn=Li((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state.doc,t,t);return i?(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:Tr(n,i),userEvent:"select.search"}),!0):!1}),En=Li((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t.doc,i,i);return s?(n.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:Tr(n,s),userEvent:"select.search"}),!0):!1}),gw=Li((n,{query:e})=>{let t=e.matchAll(n.state.doc,1e3);return!t||!t.length?!1:(n.dispatch({selection:w.create(t.map(i=>w.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),yw=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let l=new Ft(n.doc,n.sliceDoc(i,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(w.range(l.value.from,l.value.to))}return e(n.update({selection:w.create(r,o),userEvent:"select.search.matches"})),!0},Zh=Li((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t.doc,i,i);if(!r)return!1;let o=[],l,a,c=[];if(r.from==i&&r.to==s&&(a=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=e.nextMatch(t.doc,r.from,r.to),c.push(I.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let f=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l={anchor:r.from-f,head:r.to-f},c.push(Tr(n,r))}return n.dispatch({changes:o,selection:l,scrollIntoView:!!l,effects:c,userEvent:"input.replace"}),!0}),ww=Li((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state.doc,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:I.announce.of(i),userEvent:"input.replace.all"}),!0});function Nr(n){return n.state.facet(vr).createPanel(n)}function Er(n,e){var t;let i=n.selection.main,s=i.empty||i.to>i.from+100?"":n.sliceDoc(i.from,i.to),r=(t=e==null?void 0:e.caseSensitive)!==null&&t!==void 0?t:n.facet(vr).caseSensitive;return e&&!s?e:new qh({search:s.replace(/\n/g,"\\n"),caseSensitive:r})}const Jh=n=>{let e=n.state.field(mt,!1);if(e&&e.panel){let t=pi(n,Nr);if(!t)return!1;let i=t.dom.querySelector("[main-field]");if(i&&i!=n.root.activeElement){let s=Er(n.state,e.query.spec);s.valid&&n.dispatch({effects:Ai.of(s)}),i.focus(),i.select()}}else n.dispatch({effects:[Dr.of(!0),e?Ai.of(Er(n.state,e.query.spec)):B.appendConfig.of(Cw)]});return!0},Xh=n=>{let e=n.state.field(mt,!1);if(!e||!e.panel)return!1;let t=pi(n,Nr);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Dr.of(!1)}),!0},xw=[{key:"Mod-f",run:Jh,scope:"editor search-panel"},{key:"F3",run:Nn,shift:En,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Nn,shift:En,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Xh,scope:"editor search-panel"},{key:"Mod-Shift-l",run:yw},{key:"Alt-g",run:Xy},{key:"Mod-d",run:cw,preventDefault:!0}];class bw{constructor(e){this.view=e;let t=this.query=e.state.field(mt).query.spec;this.commit=this.commit.bind(this),this.searchField=W("input",{value:t.search,placeholder:Ne(e,"Find"),"aria-label":Ne(e,"Find"),class:"cm-textfield",name:"search","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=W("input",{value:t.replace,placeholder:Ne(e,"Replace"),"aria-label":Ne(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=W("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=W("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit});function i(s,r,o){return W("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=W("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Nn(e),[Ne(e,"next")]),i("prev",()=>En(e),[Ne(e,"previous")]),i("select",()=>gw(e),[Ne(e,"all")]),W("label",null,[this.caseField,Ne(e,"match case")]),W("label",null,[this.reField,Ne(e,"regexp")]),...e.state.readOnly?[]:[W("br"),this.replaceField,i("replace",()=>Zh(e),[Ne(e,"replace")]),i("replaceAll",()=>ww(e),[Ne(e,"replace all")]),W("button",{name:"close",onclick:()=>Xh(e),"aria-label":Ne(e,"close"),type:"button"},["\xD7"])]])}commit(){let e=new qh({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ai.of(e)}))}keydown(e){$0(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?En:Nn)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Zh(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Ai)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(vr).top}}function Ne(n,e){return n.state.phrase(e)}const Tn=30,Bn=/[\s\.,:;?!]/;function Tr(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Tn),o=Math.min(s,t+Tn),l=n.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<Tn;a++)if(!Bn.test(l[a+1])&&Bn.test(l[a])){l=l.slice(a);break}}if(o!=s){for(let a=l.length-1;a>l.length-Tn;a--)if(!Bn.test(l[a-1])&&Bn.test(l[a])){l=l.slice(0,a);break}}return I.announce.of(`${n.state.phrase("current match")}. ${l} ${n.state.phrase("on line")} ${i.number}.`)}const kw=I.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Cw=[mt,Et.lowest(pw),kw];class ec{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=oe(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(nc(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function tc(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Mw(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;r<s.length;r++)t[s[r]]=!0}let i=tc(e)+tc(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Sw(n){let e=n.map(s=>typeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Mw(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}class ic{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function pt(n){return n.selection.main.head}function nc(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}function Aw(n,e,t,i){return Object.assign(Object.assign({},n.changeByRange(s=>{if(s==n.selection.main)return{changes:{from:t,to:i,insert:e},range:w.cursor(t+e.length)};let r=i-t;return!s.empty||r&&n.sliceDoc(s.from-r,s.from)!=n.sliceDoc(t,i)?{range:s}:{changes:{from:s.from-r,to:s.from,insert:e},range:w.cursor(s.from-r+e.length)}})),{userEvent:"input.complete"})}function sc(n,e){const t=e.completion.apply||e.completion.label;let i=e.source;typeof t=="string"?n.dispatch(Aw(n.state,t,i.from,i.to)):t(n,e.completion,i.from,i.to)}const rc=new WeakMap;function Lw(n){if(!Array.isArray(n))return n;let e=rc.get(n);return e||rc.set(n,e=Sw(n)),e}class vw{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t<e.length;){let i=ie(e,t),s=Ce(i);this.chars.push(i);let r=e.slice(t,t+s),o=r.toUpperCase();this.folded.push(ie(o==r?r.toLowerCase():o,0)),t+=s}this.astral=e.length!=this.chars.length}match(e){if(this.pattern.length==0)return[0];if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:s,precise:r,byWord:o}=this;if(t.length==1){let A=ie(e,0);return A==t[0]?[0,0,Ce(A)]:A==i[0]?[-200,0,Ce(A)]:null}let l=e.indexOf(this.pattern);if(l==0)return[0,0,this.pattern.length];let a=t.length,c=0;if(l<0){for(let A=0,L=Math.min(e.length,200);A<L&&c<a;){let M=ie(e,A);(M==t[c]||M==i[c])&&(s[c++]=A),A+=Ce(M)}if(c<a)return null}let f=0,u=0,d=!1,m=0,p=-1,g=-1,y=/[a-z]/.test(e),x=!0;for(let A=0,L=Math.min(e.length,200),M=0;A<L&&u<a;){let S=ie(e,A);l<0&&(f<a&&S==t[f]&&(r[f++]=A),m<a&&(S==t[m]||S==i[m]?(m==0&&(p=A),g=A+1,m++):m=0));let N,T=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(N=Gn(S))!=N.toLowerCase()?1:N!=N.toUpperCase()?2:0;(!A||T==1&&y||M==0&&T!=0)&&(t[u]==S||i[u]==S&&(d=!0)?o[u++]=A:o.length&&(x=!1)),M=T,A+=Ce(S)}return u==a&&o[0]==0&&x?this.result(-100+(d?-200:0),o,e):m==a&&p==0?[-200-e.length,0,g]:l>-1?[-700-e.length,l,l+this.pattern.length]:m==a?[-900-e.length,p,g]:u==a?this.result(-100+(d?-200:0)+-700+(x?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let l=o+(this.astral?Ce(ie(i,o)):1);r>1&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return s}}const Ge=D.define({combine(n){return Ke(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],compareCompletions:(e,t)=>e.label.localeCompare(t.label)},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>i=>Dw(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function Dw(n,e){return n?e?n+" "+e:n:e}function Iw(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,l=0;for(let a=1;a<s.length;){let c=s[a++],f=s[a++];c>l&&r.appendChild(document.createTextNode(o.slice(l,c)));let u=r.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(o.slice(c,f))),u.className="cm-completionMatchedText",l=f}return l<o.length&&r.appendChild(document.createTextNode(o.slice(l))),r},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function oc(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class Nw{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:l=>this.positionInfo(l),key:this};let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(Ge);this.optionContent=Iw(o),this.optionClass=o.optionClass,this.range=oc(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",l=>{for(let a=l.target,c;a&&a!=this.dom;a=a.parentNode)if(a.nodeName=="LI"&&(c=/-(\d+)$/.exec(a.id))&&+c[1]<s.length){sc(e,s[+c[1]]),l.preventDefault();return}}),this.list=this.dom.appendChild(this.createListBox(s,i.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=oc(t.options.length,t.selected,this.view.state.facet(Ge).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>Se(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&Tw(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect();if(s.top>Math.min(innerHeight,t.bottom)-10||s.bottom<Math.max(0,t.top)+10)return null;let r=Math.max(0,Math.min(s.top,innerHeight-i.height))-t.top,o=this.view.textDirection==U.RTL,l=t.left,a=innerWidth-t.right;return o&&l<Math.min(i.width,a)?o=!1:!o&&a<Math.min(i.width,l)&&(o=!0),{top:r,left:o}}positionInfo(e){this.info&&(this.info.style.top=(e?e.top:-1e6)+"px",e&&(this.info.classList.toggle("cm-completionInfo-left",e.left),this.info.classList.toggle("cm-completionInfo-right",!e.left)))}createListBox(e,t,i){const s=document.createElement("ul");s.id=t,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let r=i.from;r<i.to;r++){let{completion:o,match:l}=e[r];const a=s.appendChild(document.createElement("li"));a.id=t+"-"+r,a.setAttribute("role","option");let c=this.optionClass(o);c&&(a.className=c);for(let f of this.optionContent){let u=f(o,this.view.state,l);u&&a.appendChild(u)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}}function Ew(n){return e=>new Nw(e,n)}function Tw(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.top<t.top?n.scrollTop-=t.top-i.top:i.bottom>t.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function lc(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function Bw(n,e){let t=[],i=0;for(let l of n)if(l.hasResult())if(l.result.filter===!1){let a=l.result.getMatch;for(let c of l.result.options){let f=[1e9-i++];if(a)for(let u of a(c))f.push(u);t.push(new ic(c,l,f))}}else{let a=new vw(e.sliceDoc(l.from,l.to)),c;for(let f of l.result.options)(c=a.match(f.label))&&(f.boost!=null&&(c[0]+=f.boost),t.push(new ic(f,l,c)))}let s=[],r=null,o=e.facet(Ge).compareCompletions;for(let l of t.sort((a,c)=>c.match[0]-a.match[0]||o(a.completion,c.completion)))!r||r.label!=l.completion.label||r.detail!=l.completion.detail||r.type!=null&&l.completion.type!=null&&r.type!=l.completion.type||r.apply!=l.completion.apply?s.push(l):lc(l.completion)>lc(r)&&(s[s.length-1]=l),r=l.completion;return s}class vi{constructor(e,t,i,s,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new vi(this.options,ac(t,e),this.tooltip,this.timestamp,e)}static build(e,t,i,s,r){let o=Bw(e,t);if(!o.length)return null;let l=t.facet(Ge).selectOnOpen?0:-1;if(s&&s.selected!=l&&s.selected!=-1){let a=s.options[s.selected].completion;for(let c=0;c<o.length;c++)if(o[c].completion==a){l=c;break}}return new vi(o,ac(i,l),{pos:e.reduce((a,c)=>c.hasResult()?Math.min(a,c.from):a,1e8),create:Ew(Ee),above:r.aboveCursor},s?s.timestamp:Date.now(),l)}map(e){return new vi(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class _n{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new _n(zw,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ge),r=(i.override||t.languageDataAt("autocomplete",pt(t)).map(Lw)).map(l=>(this.active.find(c=>c.source==l)||new be(l,this.active.some(c=>c.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=e.selection||r.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!_w(r,this.active)?vi.build(r,t,this.id,this.open,i):this.open&&e.docChanged?this.open.map(e.changes):this.open;!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new be(l.source,0):l));for(let l of e.effects)l.is(cc)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new _n(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Ow}}function _w(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult;)t++;for(;i<e.length&&!e[i].hasResult;)i++;let s=t==n.length,r=i==e.length;if(s||r)return s==r;if(n[t++].result!=e[i++].result)return!1}}const Ow={"aria-autocomplete":"list"};function ac(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const zw=[];function Br(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class be{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Br(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new be(s.source,0));for(let r of e.effects)if(r.is(_r))s=new be(s.source,1,r.value?pt(e.state):-1);else if(r.is(On))s=new be(s.source,0);else if(r.is(hc))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new be(this.source,1)}handleChange(e){return e.changes.touchesRange(pt(e.startState))?new be(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new be(this.source,this.state,e.mapPos(this.explicitPos))}}class Di extends be{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=pt(e.state);if((this.explicitPos<0?l<=r:l<this.from)||l>o||t=="delete"&&pt(e.startState)==this.from)return new be(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return jw(this.result.validFor,e.state,r,o)?new Di(this.source,a,this.result,r,o):this.result.update&&(c=this.result.update(this.result,r,o,new ec(e.state,l,a>=0)))?new Di(this.source,a,c,c.from,(s=c.to)!==null&&s!==void 0?s:pt(e.state)):new be(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new be(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Di(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function jw(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):nc(n,!0).test(s)}const _r=B.define(),On=B.define(),hc=B.define({map(n,e){return n.map(t=>t.map(e))}}),cc=B.define(),Ee=ne.define({create(){return _n.start()},update(n,e){return n.update(e)},provide:n=>[Us.from(n,e=>e.tooltip),I.contentAttributes.from(n,e=>e.attrs)]}),fc=75;function zn(n,e="option"){return t=>{let i=t.state.field(Ee,!1);if(!i||!i.open||Date.now()-i.open.timestamp<fc)return!1;let s=1,r;e=="page"&&(r=S1(t,i.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(n?1:-1):n?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:cc.of(l)}),!0}}const Vw=n=>{let e=n.state.field(Ee,!1);return n.state.readOnly||!e||!e.open||Date.now()-e.open.timestamp<fc||e.open.selected<0?!1:(sc(n,e.open.options[e.open.selected]),!0)},$w=n=>n.state.field(Ee,!1)?(n.dispatch({effects:_r.of(!0)}),!0):!1,Pw=n=>{let e=n.state.field(Ee,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:On.of(null)}),!0)};class Rw{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const uc=50,Hw=50,Fw=1e3,Ww=Z.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Ee).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Ee);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Ee)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Br(i));for(let i=0;i<this.running.length;i++){let s=this.running[i];if(t||s.updates.length+n.transactions.length>Hw&&Date.now()-s.time>Fw){for(let r of s.context.abortListeners)try{r()}catch(o){Se(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),uc):-1,this.composing!=0)for(let i of n.transactions)Br(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Ee);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=pt(e),i=new ec(e,t,n.explicitPos==t),s=new Rw(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:On.of(null)}),Se(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),uc))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ge);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let o=new Di(s.active.source,s.active.explicitPos,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:pt(s.updates.length?s.updates[0].startState:this.view.state));for(let l of s.updates)o=o.update(l,t);if(o.hasResult()){e.push(o);continue}}let r=this.view.state.field(Ee).active.find(o=>o.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new be(s.active.source,0);for(let l of s.updates)o=o.update(l,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:hc.of(e)})}},{eventHandlers:{blur(){let n=this.view.state.field(Ee,!1);n&&n.tooltip&&this.view.state.facet(Ge).closeOnBlur&&this.view.dispatch({effects:On.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_r.of(!1)}),20),this.composing=0}}}),Uw=I.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),jn={brackets:["(","[","{","'",'"'],before:")]}:;>"},vt=B.define({map(n,e){let t=e.mapPos(n,-1,de.TrackAfter);return t==null?void 0:t}}),Or=B.define({map(n,e){return e.mapPos(n)}}),zr=new class extends xt{};zr.startSide=1,zr.endSide=-1;const dc=ne.define({create(){return $.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=$.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(vt)?n=n.update({add:[zr.range(t.value,t.value+1)]}):t.is(Or)&&(n=n.update({filter:i=>i!=t.value}));return n}});function Yw(){return[Kw,dc]}const jr="()[]{}<>";function mc(n){for(let e=0;e<jr.length;e+=2)if(jr.charCodeAt(e)==n)return jr.charAt(e+1);return Gn(n<128?n:n+1)}function pc(n,e){return n.languageDataAt("closeBrackets",e)[0]||jn}const Gw=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Kw=I.inputHandler.of((n,e,t,i)=>{if((Gw?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Ce(ie(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Qw(n.state,i);return r?(n.dispatch(r),!0):!1}),qw=[{key:"Backspace",run:({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=pc(n,n.selection.main.head).brackets||jn.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let l=Zw(n.doc,o.head);for(let a of i)if(a==l&&Vn(n.doc,o.head)==mc(ie(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:w.cursor(o.head-a.length),userEvent:"delete.backward"}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0})),!s}}];function Qw(n,e){let t=pc(n,n.selection.main.head),i=t.brackets||jn.brackets;for(let s of i){let r=mc(ie(s,0));if(e==s)return r==s?ex(n,s,i.indexOf(s+s+s)>-1):Jw(n,s,r,t.before||jn.before);if(e==r&&gc(n,n.selection.main.from))return Xw(n,s,r)}return null}function gc(n,e){let t=!1;return n.field(dc).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function Vn(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Ce(ie(t,0)))}function Zw(n,e){let t=n.sliceString(e-2,e);return Ce(ie(t,0))==t.length?t:t.slice(1)}function Jw(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:vt.of(o.to+e.length),range:w.range(o.anchor+e.length,o.head+e.length)};let l=Vn(n.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:vt.of(o.head+e.length),range:w.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Xw(n,e,t){let i=null,s=n.selection.ranges.map(r=>r.empty&&Vn(n.doc,r.head)==t?w.cursor(r.head+t.length):i=r);return i?null:n.update({selection:w.create(s,n.selection.mainIndex),scrollIntoView:!0,effects:n.selection.ranges.map(({from:r})=>Or.of(r))})}function ex(n,e,t){let i=null,s=n.changeByRange(r=>{if(!r.empty)return{changes:[{insert:e,from:r.from},{insert:e,from:r.to}],effects:vt.of(r.to+e.length),range:w.range(r.anchor+e.length,r.head+e.length)};let o=r.head,l=Vn(n.doc,o);if(l==e){if(yc(n,o))return{changes:{insert:e+e,from:o},effects:vt.of(o+e.length),range:w.cursor(o+e.length)};if(gc(n,o)){let a=t&&n.sliceDoc(o,o+e.length*3)==e+e+e;return{range:w.cursor(o+e.length*(a?3:1)),effects:Or.of(o)}}}else{if(t&&n.sliceDoc(o-2*e.length,o)==e+e&&yc(n,o-2*e.length))return{changes:{insert:e+e+e+e,from:o},effects:vt.of(o+e.length),range:w.cursor(o+e.length)};if(n.charCategorizer(o)(l)!=me.Word){let a=n.sliceDoc(o-1,o);if(a!=e&&n.charCategorizer(o)(a)!=me.Word&&!tx(n,o,e))return{changes:{insert:e+e,from:o},effects:vt.of(o+e.length),range:w.cursor(o+e.length)}}}return{range:i=r}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function yc(n,e){let t=oe(n).resolveInner(e+1);return t.parent&&t.from==e}function tx(n,e,t){let i=oe(n).resolveInner(e,-1);for(let s=0;s<5;s++){if(n.sliceDoc(i.from,i.from+t.length)==t){let o=i.firstChild;for(;o&&o.from==i.from&&o.to-o.from>t.length;){if(n.sliceDoc(o.to-t.length,o.to)==t)return!1;o=o.firstChild}return!0}let r=i.to==e&&i.parent;if(!r)break;i=r}return!1}function ix(n={}){return[Ee,Ge.of(n),Ww,nx,Uw]}const wc=[{key:"Ctrl-Space",run:$w},{key:"Escape",run:Pw},{key:"ArrowDown",run:zn(!0)},{key:"ArrowUp",run:zn(!1)},{key:"PageDown",run:zn(!0,"page")},{key:"PageUp",run:zn(!1,"page")},{key:"Enter",run:Vw}],nx=Et.highest($s.computeN([Ge],n=>n.facet(Ge).defaultKeymap?[wc]:[]));class sx{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Dt{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,r=i.facet(Kt).markerFilter;r&&(s=r(s));let o=E.set(s.map(l=>l.from==l.to||l.from==l.to-1&&i.doc.lineAt(l.from).to==l.from?E.widget({widget:new dx(l),diagnostic:l}).range(l.from):E.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity},diagnostic:l}).range(l.from,l.to)),!0);return new Dt(o,t,Gt(o))}}function Gt(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostic!=e))return i=new sx(s,r,o.diagnostic),!1}),i}function rx(n,e){return!!(n.effects.some(t=>t.is(Vr))||n.changes.touchesRange(e.pos))}function xc(n,e){return n.field(Le,!1)?e:e.concat(B.appendConfig.of([Le,I.decorations.compute([Le],t=>{let{selected:i,panel:s}=t.field(Le);return!i||!s||i.from==i.to?E.none:E.set([lx.range(i.from,i.to)])}),M1(ax,{hideOn:rx}),px]))}function ox(n,e){return{effects:xc(n,[Vr.of(e)])}}const Vr=B.define(),$r=B.define(),bc=B.define(),Le=ne.define({create(){return new Dt(E.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=Gt(t,n.selected.diagnostic,s)||Gt(t,null,s)}n=new Dt(t,n.panel,i)}for(let t of e.effects)t.is(Vr)?n=Dt.init(t.value,n.panel,e.state):t.is($r)?n=new Dt(n.diagnostics,t.value?$n.open:null,n.selected):t.is(bc)&&(n=new Dt(n.diagnostics,n.panel,t.value));return n},provide:n=>[gi.from(n,e=>e.panel),I.decorations.from(n,e=>e.diagnostics)]}),lx=E.mark({class:"cm-lintRange cm-lintRange-active"});function ax(n,e,t){let{diagnostics:i}=n.state.field(Le),s=[],r=2e8,o=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:f})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(e<c||t<0))&&(s.push(f.diagnostic),r=Math.min(a,r),o=Math.max(c,o))});let l=n.state.facet(Kt).tooltipFilter;return l&&(s=l(s)),s.length?{pos:r,end:o,above:n.state.doc.lineAt(r).to<o,create(){return{dom:hx(n,s)}}}:null}function hx(n,e){return W("ul",{class:"cm-tooltip-lint"},e.map(t=>Mc(n,t,!1)))}const cx=n=>{let e=n.state.field(Le,!1);(!e||!e.panel)&&n.dispatch({effects:xc(n.state,[$r.of(!0)])});let t=pi(n,$n.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},kc=n=>{let e=n.state.field(Le,!1);return!e||!e.panel?!1:(n.dispatch({effects:$r.of(!1)}),!0)},fx=[{key:"Mod-Shift-m",run:cx},{key:"F8",run:n=>{let e=n.state.field(Le,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],ux=Z.fromClass(class{constructor(n){this.view=n,this.timeout=-1,this.set=!0;let{delay:e}=n.state.facet(Kt);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let n=Date.now();if(n<this.lintTime-10)setTimeout(this.run,this.lintTime-n);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(Kt);Promise.all(t.map(i=>Promise.resolve(i(this.view)))).then(i=>{let s=i.reduce((r,o)=>r.concat(o));this.view.state.doc==e.doc&&this.view.dispatch(ox(this.view.state,s))},i=>{Se(this.view.state,i)})}}update(n){let e=n.state.facet(Kt);(n.docChanged||e!=n.startState.facet(Kt))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Kt=D.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},Ke(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null}))},enables:ux});function Cc(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let s=t[i];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Mc(n,e,t){var i;let s=t?Cc(e.actions):[];return W("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},W("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=u=>{u.preventDefault();let d=Gt(n.state.field(Le).diagnostics,e);d&&r.apply(n,d.from,d.to)},{name:a}=r,c=s[o]?a.indexOf(s[o]):-1,f=c<0?a:[a.slice(0,c),W("u",a.slice(c,c+1)),a.slice(c+1)];return W("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${c<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&W("div",{class:"cm-diagnosticSource"},e.source))}class dx extends rt{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return W("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Sc{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Mc(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class $n{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)kc(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=Cc(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let a=Gt(this.view.state.field(Le).diagnostics,r);a&&r.actions[l].apply(e,a.from,a.to)}}else return;s.preventDefault()},i=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=W("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=W("div",{class:"cm-panel-lint"},this.list,W("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>kc(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Le).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Le),i=0,s=!1,r=null;for(e.between(0,this.view.state.doc.length,(o,l,{spec:a})=>{let c=-1,f;for(let u=i;u<this.items.length;u++)if(this.items[u].diagnostic==a.diagnostic){c=u;break}c<0?(f=new Sc(this.view,a.diagnostic),this.items.splice(i,0,f),s=!0):(f=this.items[c],c>i&&(this.items.splice(i,c-i),s=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),r=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),i++});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new Sc(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{o.top<l.top?this.list.scrollTop-=l.top-o.top:o.bottom>l.bottom&&(this.list.scrollTop+=o.bottom-l.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Le),i=Gt(t.diagnostics,this.items[e].diagnostic);!i||this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:bc.of(i)})}static open(e){return new $n(e)}}function mx(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function Pr(n){return mx(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const px=I.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Pr("#d11")},".cm-lintRange-warning":{backgroundImage:Pr("orange")},".cm-lintRange-info":{backgroundImage:Pr("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),gx=(()=>[B1(),z1(),e1(),Z2(),b2(),H0(),K0(),z.allowMultipleSelections.of(!0),h2(),C2(A2,{fallback:!0}),E2(),Yw(),ix(),u1(),p1(),o1(),iw(),$s.of([...qw,...Zy,...xw,...oy,...y2,...wc,...fx])])();var yx=["true","false","on","off","yes","no"],wx=new RegExp("\\b(("+yx.join(")|(")+"))$","i");const xx={token:function(n,e){var t=n.peek(),i=e.escaped;if(e.escaped=!1,t=="#"&&(n.pos==0||/\s/.test(n.string.charAt(n.pos-1))))return n.skipToEnd(),"comment";if(n.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&n.indentation()>e.keyCol)return n.skipToEnd(),"string";if(e.literal&&(e.literal=!1),n.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,n.match("---")||n.match("..."))return"def";if(n.match(/^\s*-\s+/))return"meta"}if(n.match(/^(\{|\}|\[|\])/))return t=="{"?e.inlinePairs++:t=="}"?e.inlinePairs--:t=="["?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&t==",")return n.next(),"meta";if(e.inlinePairs>0&&!i&&t==",")return e.keyCol=0,e.pair=!1,e.pairStart=!1,n.next(),"meta";if(e.pairStart){if(n.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(n.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(e.inlinePairs==0&&n.match(/^\s*-?[0-9\.\,]+\s?$/)||e.inlinePairs>0&&n.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(n.match(wx))return"keyword"}return!e.pair&&n.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=n.indentation(),"atom"):e.pair&&n.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped=t=="\\",n.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}};var bx=h.defineComponent({__name:"Codemirror",props:{modelValue:{default:""},height:{default:"auto"},language:{default:"yaml"},extensions:{default:()=>[]}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,i={yaml:ur.define(xx)},s=I.theme({"&":{height:t.height}}),r=h.shallowRef(),o=h.shallowRef(),l=h.shallowRef(),a=()=>{let c=[gx,I.lineWrapping,s,i[t.language],I.updateListener.of(f=>{if(f.docChanged){const u=f.state.doc.toString();e("update:modelValue",u),e("change",u)}})];t.extensions&&(c=c.concat(t.extensions)),o.value=z.create({doc:t.modelValue,extensions:c}),l.value=new I({state:o.value,parent:r.value})};return h.onMounted(()=>{a(),h.watch(()=>t.modelValue,c=>{var f,u,d;c!==((f=l.value)==null?void 0:f.state.doc.toString())&&((d=l.value)==null||d.dispatch({changes:{from:0,to:(u=l.value)==null?void 0:u.state.doc.length,insert:c}}))})}),h.onBeforeUnmount(()=>{l.value&&l.value.destroy()}),(c,f)=>(h.openBlock(),h.createElementBlock("div",{ref_key:"wrapper",ref:r,class:"codemirror-wrapper contents"},null,512))}}),kx="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1NTguMDk1IDQ3NS43OTgiPgogIDxnPgogICAgPHBhdGgKICAgICAgZD0iTTU1NS41MzYsMzI4LjA0OWMtMTUuMjQzLTc2Ljg2Ni0xMDQuNTQ3LTEzOC4zLTEyMS45NjUtMjE4LjRDNDAxLjkxNCw3Ljc0LDI5Ny41Ny04LjM3MiwyMjkuNzY1LDM1Ljg4N2MtMTA3LjQzNyw3MC4xMjksNy4xNzYsODcuNTMyLTIwMy40NzMsMjUzLjQ1My01Mi4wMTQsNDAuOTY5LTM1LjQ0LDIyMS44MTcsMTI4LjE5MywxODAuMzEzLDg4LjA2LTIyLjMzNiwxMTQuODMtMjUuNDcsMTU0LjQ0LTI5LjE0OEM0MDguNzYzLDQzMS4yMzYsNTgxLjEyMyw0NTcuMDc5LDU1NS41MzYsMzI4LjA0OVoiCiAgICAgIGZpbGw9IiMzNjdjZmYiIG9wYWNpdHk9IjAuMSI+PC9wYXRoPgogICAgPGc+CiAgICAgIDxnPgogICAgICAgIDxwb2x5Z29uIHBvaW50cz0iNDM2LjI2NyAzNDcuMzE0IDI4MS45NTcgNDI4LjgxMyAxMjcuODggMzQ3LjMxNCAxMjcuODggMjI0LjI0NCA0MzYuMjY3IDIyNC4yNDQgNDM2LjI2NyAzNDcuMzE0IgogICAgICAgICAgICAgICAgIGZpbGw9IiNmZmYiPjwvcG9seWdvbj4KICAgICAgICA8cGF0aAogICAgICAgICAgZD0iTTI4MS45NTcsNDMwLjA2M2ExLjIzNywxLjIzNywwLDAsMS0uNTg1LS4xNDZMMTI3LjMsMzQ4LjQxOGExLjI0OSwxLjI0OSwwLDAsMS0uNjY2LTEuMVYyMjQuMjQ0YTEuMjUsMS4yNSwwLDAsMSwxLjI1LTEuMjVINDM2LjI2N2ExLjI1LDEuMjUsMCwwLDEsMS4yNSwxLjI1djEyMy4wN2ExLjI0OSwxLjI0OSwwLDAsMS0uNjY2LDEuMWwtMTU0LjMxLDgxLjVBMS4yNDQsMS4yNDQsMCwwLDEsMjgxLjk1Nyw0MzAuMDYzWm0tMTUyLjgyNy04My41TDI4MS45NTcsNDI3LjRsMTUzLjA2LTgwLjgzOVYyMjUuNDk0SDEyOS4xM1ptMzA3LjEzNy43NTNoMFoiCiAgICAgICAgICBmaWxsPSIjMjYyNjI2Ij48L3BhdGg+CiAgICAgIDwvZz4KICAgICAgPGc+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI0MzYuMjY3IDE5Ny44MzUgMjgxLjk1NyAxMTYuMzM2IDM1MS4yOTggODIuOTEzIDUwNS42MDggMTY0LjQxMyA0MzYuMjY3IDE5Ny44MzUiCiAgICAgICAgICAgICAgICAgZmlsbD0iI2ZmZiI+PC9wb2x5Z29uPgogICAgICAgIDxwYXRoCiAgICAgICAgICBkPSJNNDM2LjI2NywxOTkuMDg1YTEuMjU1LDEuMjU1LDAsMCwxLS41ODQtLjE0NGwtMTU0LjMxLTgxLjVhMS4yNTEsMS4yNTEsMCwwLDEsLjA0MS0yLjIzMmw2OS4zNDEtMzMuNDIzYTEuMjQ0LDEuMjQ0LDAsMCwxLDEuMTI3LjAyMWwxNTQuMzEsODEuNWExLjI1LDEuMjUsMCwwLDEtLjA0MSwyLjIzMUw0MzYuODEsMTk4Ljk2MUExLjI0NiwxLjI0NiwwLDAsMSw0MzYuMjY3LDE5OS4wODVabS0xNTEuNTM3LTgyLjcsMTUxLjU2Myw4MC4wNDgsNjYuNTQyLTMyLjA3M0wzNTEuMjcyLDg0LjMxNFoiCiAgICAgICAgICBmaWxsPSIjMjYyNjI2Ij48L3BhdGg+CiAgICAgIDwvZz4KICAgICAgPGc+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSIxMjcuODggMTk3LjgzNSAyODIuMTkgMTE2LjMzNiAyMTIuODQ5IDgyLjkxMyA1OC41MzkgMTY0LjQxMyAxMjcuODggMTk3LjgzNSIKICAgICAgICAgICAgICAgICBmaWxsPSIjZmZmIj48L3BvbHlnb24+CiAgICAgICAgPHBhdGgKICAgICAgICAgIGQ9Ik0xMjcuODgsMTk5LjA4NWExLjI0OSwxLjI0OSwwLDAsMS0uNTQzLS4xMjRMNTgsMTY1LjUzOGExLjI1LDEuMjUsMCwwLDEtLjA0MS0yLjIzMWwxNTQuMzEtODEuNWExLjI0NCwxLjI0NCwwLDAsMSwxLjEyNy0uMDIxbDY5LjM0MSwzMy40MjNhMS4yNTEsMS4yNTEsMCwwLDEsLjA0MSwyLjIzMmwtMTU0LjMxLDgxLjVBMS4yNTIsMS4yNTIsMCwwLDEsMTI3Ljg4LDE5OS4wODVaTTYxLjMxMiwxNjQuMzYybDY2LjU0MiwzMi4wNzMsMTUxLjU2My04MC4wNDhMMjEyLjg3NSw4NC4zMTRaIgogICAgICAgICAgZmlsbD0iIzI2MjYyNiI+PC9wYXRoPgogICAgICA8L2c+CiAgICAgIDxnPgogICAgICAgIDxwb2x5Z29uIHBvaW50cz0iMTI3Ljg4IDE5Ny44MzUgMjgyLjE5IDI3OS4zMzUgMjAyLjg0OSAzMjIuNzU3IDQ4LjUzOSAyNDEuMjU4IDEyNy44OCAxOTcuODM1IgogICAgICAgICAgICAgICAgIGZpbGw9IiNmZmYiPjwvcG9seWdvbj4KICAgICAgICA8cGF0aAogICAgICAgICAgZD0iTTIwMi44NDksMzI0LjAwN2ExLjI0NCwxLjI0NCwwLDAsMS0uNTg0LS4xNDVsLTE1NC4zMS04MS41YTEuMjUsMS4yNSwwLDAsMS0uMDE2LTIuMmw3OS4zNDEtNDMuNDIzYTEuMjQ2LDEuMjQ2LDAsMCwxLDEuMTg0LS4wMDhsMTU0LjMxLDgxLjVhMS4yNSwxLjI1LDAsMCwxLC4wMTYsMi4ybC03OS4zNDEsNDMuNDIzQTEuMjUxLDEuMjUxLDAsMCwxLDIwMi44NDksMzI0LjAwN1pNNTEuMTc5LDI0MS4yMzhsMTUxLjY1OSw4MC4xLDc2LjcxMy00MS45ODQtMTUxLjY2LTgwLjFaIgogICAgICAgICAgZmlsbD0iIzI2MjYyNiI+PC9wYXRoPgogICAgICA8L2c+CiAgICAgIDxnPgogICAgICAgIDxwb2x5Z29uIHBvaW50cz0iNDM2LjI2NyAxOTcuODM1IDI4MS45NTcgMjc5LjMzNSAzNjEuMjk4IDMyMi43NTcgNTE1LjYwOCAyNDEuMjU4IDQzNi4yNjcgMTk3LjgzNSIKICAgICAgICAgICAgICAgICBmaWxsPSIjZmZmIj48L3BvbHlnb24+CiAgICAgICAgPHBhdGgKICAgICAgICAgIGQ9Ik0zNjEuMywzMjQuMDA3YTEuMjU0LDEuMjU0LDAsMCwxLS42LS4xNTNsLTc5LjM0MS00My40MjNhMS4yNSwxLjI1LDAsMCwxLC4wMTYtMi4ybDE1NC4zMS04MS41YTEuMjQ2LDEuMjQ2LDAsMCwxLDEuMTg0LjAwOGw3OS4zNDEsNDMuNDIzYTEuMjUsMS4yNSwwLDAsMS0uMDE2LDIuMmwtMTU0LjMxLDgxLjVBMS4yNDQsMS4yNDQsMCwwLDEsMzYxLjMsMzI0LjAwN1ptLTc2LjctNDQuNjUzLDc2LjcxMiw0MS45ODQsMTUxLjY2LTgwLjEtNzYuNzEzLTQxLjk4NFoiCiAgICAgICAgICBmaWxsPSIjMjYyNjI2Ij48L3BhdGg+CiAgICAgIDwvZz4KICAgICAgPHBvbHlnb24gcG9pbnRzPSIyODIuMTkgMTE2LjMzNiAxMjcuODggMTk3LjgzNSAyODEuOTU3IDI3OS4zMzUgNDM2LjI2NyAxOTcuODM1IDI4Mi4xOSAxMTYuMzM2IgogICAgICAgICAgICAgICBmaWxsPSIjMjYyNjI2Ij48L3BvbHlnb24+CiAgICAgIDxyZWN0IHg9IjI4MC43MDciIHk9IjI3OS4zMzQiIHdpZHRoPSIyLjUiIGhlaWdodD0iMTQ5LjQ3OSIgZmlsbD0iIzI2MjYyNiI+PC9yZWN0PgogICAgPC9nPgogICAgPGc+CiAgICAgIDxwYXRoCiAgICAgICAgZD0iTTE5NS41LDE5MC40MzZhLjk5Ljk5LDAsMCwxLS41NzctLjE4NSwxLDEsMCwwLDEtLjIzOC0xLjM5NGMuMTg1LS4yNjEsMTguMjU4LTI2LjM4OS0xLjkxOC01MC4yMDlhMzguMDA2LDM4LjAwNiwwLDAsMC0yOS4wOTUtMTMuNTE2SDE2My40YzEuOTE2LDYuNjU2LDEuNTc0LDEyLjU3NC0xLjEzOSwxNy4xMTRhMTIuNjQ1LDEyLjY0NSwwLDAsMS0xMS42OCw2LjQyLDEwLjA0MSwxMC4wNDEsMCwwLDEtOC42NzktNi43NTJjLTIuMjE5LTUuNzg4LjEtMTEuNCw2LjIxMi0xNS4wMTdhMjkuNSwyOS41LDAsMCwxLDEyLjU4OS0zLjYyMSw1My4zLDUzLjMsMCwwLDAtNS41NjYtMTAuODIxYy03LjI4NS0xMS4xMjYtMjAuNTYyLTE4LjgyOC0zNi40MjgtMjEuMTMxLTEzLjQ0Ni0xLjk1MS0yNi4zMzIuMzQ3LTMyLjgzMyw1Ljg1M2ExLDEsMCwwLDEtMS4yOTItMS41MjdjNi45MTgtNS44NTksMjAuNDI1LTguMzM2LDM0LjQxMi02LjMsMTYuNDMzLDIuMzg2LDMwLjIxNSwxMC40MDksMzcuODE1LDIyLjAxNGE1NC4yODUsNTQuMjg1LDAsMCwxLDUuOTY4LDExLjgxNiwzOS45NzYsMzkuOTc2LDAsMCwxLDMxLjUwOSwxNC4xOGMyMS4xOTMsMjUuMDE5LDIuMjE3LDUyLjM4NSwyLjAyMyw1Mi42NTlBMSwxLDAsMCwxLDE5NS41LDE5MC40MzZabS0zNC4xNDgtNjUuMjMxYTI3LjgyNiwyNy44MjYsMCwwLDAtMTIuMjE1LDMuNDE0Yy01LjI3NiwzLjEyMi03LjIzLDcuNzA4LTUuMzYzLDEyLjU4YTguMTA4LDguMTA4LDAsMCwwLDYuOTg0LDUuNDc2LDEwLjY2OSwxMC42NjksMCwwLDAsOS43OTEtNS40NTRDMTYzLjAzOSwxMzcuMDUxLDE2My4yNjcsMTMxLjUwOCwxNjEuMzQ5LDEyNS4yMDVaIgogICAgICAgIGZpbGw9IiMyOTJhMmUiPjwvcGF0aD4KICAgICAgPGc+CiAgICAgICAgPHBhdGgKICAgICAgICAgIGQ9Ik02OC42MTcsMTEzLjNhNi44MDksNi44MDksMCwxLDEsLjY4NC0uMjQ2QTYuNjUyLDYuNjUyLDAsMCwxLDY4LjYxNywxMTMuM1ptLTMuMzI1LTExLjExMmE0LjY4OSw0LjY4OSwwLDAsMC0uNDc3LjE3Miw0Ljc5MSw0Ljc5MSwwLDEsMCwuNDc3LS4xNzJaIgogICAgICAgICAgZmlsbD0iIzI5MmEyZSI+PC9wYXRoPgogICAgICAgIDxwYXRoCiAgICAgICAgICBkPSJNNjguNjA1LDk3LjYzYTYuOCw2LjgsMCwwLDEtOC4yMTYtMy44ODVoMGE2LjgsNi44LDAsMSwxLDguOSwzLjY0QTYuOTY0LDYuOTY0LDAsMCwxLDY4LjYwNSw5Ny42M1pNNjUuMjg0LDg2LjUxN2E0Ljg4OSw0Ljg4OSwwLDAsMC0uNDgzLjE3Myw0LjgsNC44LDAsMCwwLTIuNTY4LDYuMjgxaDBhNC44LDQuOCwwLDEsMCwzLjA1MS02LjQ1NVoiCiAgICAgICAgICBmaWxsPSIjMjkyYTJlIj48L3BhdGg+CiAgICAgICAgPGVsbGlwc2UgY3g9IjY2LjY2NCIgY3k9Ijk4Ljc2MyIgcng9IjguODkyIiByeT0iNS45MzkiIGZpbGw9IiNmZmYiPjwvZWxsaXBzZT4KICAgICAgICA8cGF0aAogICAgICAgICAgZD0iTTcwLjYsMTA1LjEzOWExMy43NTQsMTMuNzU0LDAsMCwxLTMuOTI3LjU2NGMtNS41NDgsMC05LjktMy4wNC05LjktNi45MzFzNC4zMzktNi45NDIsOS44ODUtNi45NDhhMTIuNDI0LDEyLjQyNCwwLDAsMSw2Ljg0NSwxLjksNS42NzYsNS42NzYsMCwwLDEsLjAwOSwxMC4wNjNBMTAuODcyLDEwLjg3MiwwLDAsMSw3MC42LDEwNS4xMzlaTTYzLjMzOCw5NC4zYy0yLjY3Mi44LTQuNTY2LDIuNTI3LTQuNTY1LDQuNDY3LDAsMi42NzcsMy42MTcsNC45MzYsNy45LDQuOTMyYTEwLjQxNywxMC40MTcsMCwwLDAsNS43MzItMS41NzYsMy43MDYsMy43MDYsMCwwLDAtLjAwNi02LjczNSwxMC40LDEwLjQsMCwwLDAtNS43MzQtMS41NjZBMTEuNjA3LDExLjYwNywwLDAsMCw2My4zMzgsOTQuM1oiCiAgICAgICAgICBmaWxsPSIjMjkyYTJlIj48L3BhdGg+CiAgICAgICAgPHBvbHlnb24gcG9pbnRzPSI2OC44NDUgMTA0LjUyMSA2OC42MzUgOTIuOTcxIDY1Ljc2MyA5Mi44NTUgNjUuNTYyIDEwNC42NTYgNjguODQ1IDEwNC41MjEiCiAgICAgICAgICAgICAgICAgZmlsbD0iIzI5MmEyZSI+PC9wb2x5Z29uPgogICAgICAgIDxjaXJjbGUgY3g9IjU0Ljg2NyIgY3k9IjEwMC4zNTgiIHI9IjAuOTE4IiBmaWxsPSIjMjkyYTJlIj48L2NpcmNsZT4KICAgICAgICA8Y2lyY2xlIGN4PSI1NS41ODQiIGN5PSI5NS40NDYiIHI9IjAuOTE4IiBmaWxsPSIjMjkyYTJlIj48L2NpcmNsZT4KICAgICAgPC9nPgogICAgPC9nPgogICAgPGc+CiAgICAgIDxwYXRoCiAgICAgICAgZD0iTTM1Mi42MjUsMTMyLjc2NmExLDEsMCwwLDEtLjk1Ni0uNzA3LDk5LjIzNiw5OS4yMzYsMCwwLDEtMi42MDYtMzguMDIxYzIuNTg1LTE4LjYsMTIuODQzLTQzLjAxMSw0Ny4wMy01My43YTg4LjM2NCw4OC4zNjQsMCwwLDEsMTQuNzQ4LTMuMzgxYzEuNjExLTEwLjA2MSw3LjczOS0yMC45NzUsMjEuNDQ0LTI4LjUwNSwzMi41NjItMTcuODkyLDU0LjU1Ny0xLjgzOSw1NC43NzUtMS42NzVhMSwxLDAsMCwxLTEuMiwxLjZjLS4yMDgtLjE1Ni0yMS4yMjgtMTUuNDE3LTUyLjYxMSwxLjgyOS0xMi44MDYsNy4wMzctMTguNjY4LDE3LjEzNy0yMC4zMzUsMjYuNTEzLDE1LjA3OS0xLjQ4NSwyMi4zLDMuNTQ1LDI1LjU0MSw3LjM0NEExNS40ODgsMTUuNDg4LDAsMCwxLDQ0MC43NjksNjFhMTIuMDk0LDEyLjA5NCwwLDAsMS0xMS44MzUsNi45MDljLTguNDIxLS40OTQtMTUuMzktNy41NzgtMTcuNzUyLTE4LjA0OGEzNC4wMywzNC4wMywwLDAsMS0uNjE0LTEwLjgsODUuNTMzLDg1LjUzMywwLDAsMC0xMy44NzcsMy4xOTFjLTI2LjY0NSw4LjMzMS00MiwyNS44NS00NS42NDgsNTIuMDY3YTk2Ljk4Niw5Ni45ODYsMCwwLDAsMi41MzgsMzcuMTYsMSwxLDAsMCwxLS45NTYsMS4yOTNabTU5Ljk4Mi05My45NTVhMzIuMDE0LDMyLjAxNCwwLDAsMCwuNTI2LDEwLjYwOWMyLjE2MSw5LjU3OCw4LjQwOSwxNi4wNTEsMTUuOTE4LDE2LjQ5MmExMC4xNzgsMTAuMTc4LDAsMCwwLDkuOTI4LTUuOCwxMy40OTQsMTMuNDk0LDAsMCwwLTIuMDQ4LTE0Ljc0OUM0MzIuMjU1LDM5Ljg3Niw0MjMuNzIyLDM3LjY2LDQxMi42MDcsMzguODExWiIKICAgICAgICBmaWxsPSIjMjkyYTJlIj48L3BhdGg+CiAgICAgIDxnPgogICAgICAgIDxwYXRoCiAgICAgICAgICBkPSJNNTEwLjM1NCwxNi44ODRhNy4xNDIsNy4xNDIsMCwxLDEsNi45OTQtOC42NTloMGE3LjE1Niw3LjE1NiwwLDAsMS02Ljk5NCw4LjY1OVpNNTEwLjM2OSw0LjZhNS4xNDEsNS4xNDEsMCwxLDAsNS4wMjQsNC4wNTFBNS4xMTEsNS4xMTEsMCwwLDAsNTEwLjM2OSw0LjZaIgogICAgICAgICAgZmlsbD0iIzI5MmEyZSI+PC9wYXRoPgogICAgICAgIDxwYXRoCiAgICAgICAgICBkPSJNNTA3LjM0MywzMy4yMDVhNy4xNjIsNy4xNjIsMCwxLDEsMS41MjktLjE2NUE3LjE3MSw3LjE3MSwwLDAsMSw1MDcuMzQzLDMzLjIwNVptLjAyNS0xMi4yODVhNS4xNjQsNS4xNjQsMCwwLDAtMS4xLjExOSw1LjExMiw1LjExMiwwLDEsMCwxLjEtLjExOVoiCiAgICAgICAgICBmaWxsPSIjMjkyYTJlIj48L3BhdGg+CiAgICAgICAgPGVsbGlwc2UgY3g9IjUwOC44MjciIGN5PSIxOC4wOTgiIHJ4PSI2LjI4OSIgcnk9IjkuNDE2IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgzOTguNjkyIDUxNS4xOTIpIHJvdGF0ZSgtNzkuNTQ1KSIKICAgICAgICAgICAgICAgICBmaWxsPSIjZmZmIj48L2VsbGlwc2U+CiAgICAgICAgPHBhdGgKICAgICAgICAgIGQ9Ik01MTAuMiwyNS41MTZhMTQuOTY2LDE0Ljk2NiwwLDAsMS0yLjctLjI1LDEzLjEsMTMuMSwwLDAsMS02LjcyOS0zLjI4Niw2LjQxOSw2LjQxOSwwLDAsMS0yLjE5MS01Ljc3Miw2LjQyMiw2LjQyMiwwLDAsMSw0LjEwNy00LjYxLDEzLjk0NiwxMy45NDYsMCwwLDEsMTQuMTg3LDIuNjE4LDYuNDE5LDYuNDE5LDAsMCwxLDIuMTkxLDUuNzcyLDYuNDIyLDYuNDIyLDAsMCwxLTQuMTA3LDQuNjFBMTIuMDg4LDEyLjA4OCwwLDAsMSw1MTAuMiwyNS41MTZabS0yLjc2Mi0xMi44MzhhMTAuMDcyLDEwLjA3MiwwLDAsMC0zLjk2MS43NTcsNC41MDYsNC41MDYsMCwwLDAtMi45MywzLjEzNiw0LjUwNiw0LjUwNiwwLDAsMCwxLjYxOCwzLjk3NSwxMS45NjYsMTEuOTY2LDAsMCwwLDEyLDIuMjE1LDQuNTA2LDQuNTA2LDAsMCwwLDIuOTMtMy4xMzZoMGE0LjUsNC41LDAsMCwwLTEuNjE4LTMuOTc1LDExLjA4NCwxMS4wODQsMCwwLDAtNS43LTIuNzUzQTEyLjk1NywxMi45NTcsMCwwLDAsNTA3LjQ0MiwxMi42NzhaIgogICAgICAgICAgZmlsbD0iIzI5MmEyZSI+PC9wYXRoPgogICAgICAgIDxwb2x5Z29uIHBvaW50cz0iNTA3LjY2OCAxMS42ODIgNTA1LjY1NyAyMy43NDggNTA4LjYyNCAyNC40MjQgNTExLjExMiAxMi4xNzUgNTA3LjY2OCAxMS42ODIiCiAgICAgICAgICAgICAgICAgZmlsbD0iIzI5MmEyZSI+PC9wb2x5Z29uPgogICAgICAgIDxjaXJjbGUgY3g9IjUxOS43MjMiIGN5PSIyMy42OTEiIHI9IjAuOTcyIiBmaWxsPSIjMjkyYTJlIj48L2NpcmNsZT4KICAgICAgICA8Y2lyY2xlIGN4PSI1MjEuNDE3IiBjeT0iMTguNzE1IiByPSIwLjk3MiIgZmlsbD0iIzI5MmEyZSI+PC9jaXJjbGU+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=";const Cx={class:"empty-wrapper"},Mx={class:"empty-image h-32 w-32"},Sx=["src"],Ax={class:"empty-title"},Lx={class:"empty-message"},vx={class:"empty-actions"};var Dx=h.defineComponent({__name:"Empty",props:{title:null,message:null,image:null},setup(n){return(e,t)=>(h.openBlock(),h.createElementBlock("div",Cx,[h.createElementVNode("div",Mx,[h.renderSlot(e.$slots,"image",{},()=>[h.createElementVNode("img",{src:n.image||h.unref(kx),alt:"Empty"},null,8,Sx)])]),h.createElementVNode("div",Ax,h.toDisplayString(n.title),1),h.createElementVNode("div",Lx,[h.renderSlot(e.$slots,"message",{},()=>[h.createTextVNode(h.toDisplayString(n.message),1)])]),h.createElementVNode("div",vx,[h.renderSlot(e.$slots,"actions")])]))}}),yk="";const Ix=h.createElementVNode("div",{class:"status-dot-body"},[h.createElementVNode("span",{class:"status-dot-inner"})],-1),Nx={class:"status-dot-text"};var Ex=h.defineComponent({__name:"StatusDot",props:{state:{default:"success"},animate:{type:Boolean,default:!1},text:{default:void 0}},setup(n){const e=n,t=h.computed(()=>[`status-dot-${e.state}`,{"status-dot-animate":e.animate}]);return(i,s)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["status-dot-wrapper",h.unref(t)])},[Ix,i.$slots.text||n.text?h.renderSlot(i.$slots,"text",{key:0},()=>[h.createElementVNode("span",Nx,h.toDisplayString(n.text),1)]):h.createCommentVNode("",!0)],2))}}),wk="";const Tx={class:"entity-selected-indicator"},Bx={class:"entity-body"},_x={key:0,class:"entity-checkbox"},Ox={class:"entity-start"},zx={class:"entity-end"},jx={key:1,class:"entity-dropdown"},Vx={class:"w-48 p-2"},$x={key:0};var Px=h.defineComponent({__name:"Entity",props:{isSelected:{type:Boolean,default:!1}},setup(n){const e=n,t=h.computed(()=>{const i=[];return e.isSelected&&i.push("entity-selected"),i});return(i,s)=>{const r=h.resolveComponent("FloatingDropdown");return h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass([h.unref(t),"entity-wrapper group"])},[h.withDirectives(h.createElementVNode("div",Tx,null,512),[[h.vShow,n.isSelected]]),h.renderSlot(i.$slots,"prepend"),h.createElementVNode("div",Bx,[i.$slots.checkbox?(h.openBlock(),h.createElementBlock("div",_x,[h.renderSlot(i.$slots,"checkbox")])):h.createCommentVNode("",!0),h.createElementVNode("div",Ox,[h.renderSlot(i.$slots,"start")]),h.createElementVNode("div",zx,[h.renderSlot(i.$slots,"end")]),i.$slots.dropdownItems?(h.openBlock(),h.createElementBlock("div",jx,[h.createVNode(r,null,{popper:h.withCtx(()=>[h.createElementVNode("div",Vx,[h.createVNode(h.unref(Zr),{class:"w-full",direction:"column"},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"dropdownItems")]),_:3})])]),default:h.withCtx(()=>[h.createElementVNode("div",{class:"entity-dropdown-trigger group-hover:bg-gray-100",onClick:s[0]||(s[0]=h.withModifiers(()=>{},["stop"]))},[h.createVNode(h.unref(Rr))])]),_:3})])):h.createCommentVNode("",!0)]),i.$slots.footer?(h.openBlock(),h.createElementBlock("div",$x,[h.renderSlot(i.$slots,"footer")])):h.createCommentVNode("",!0)],2)}}}),xk="";const Rx={class:"entity-field-wrapper"},Hx={key:0,class:"entity-field-title-body"},Fx={key:1},Wx={key:1,class:"entity-field-description-body"},Ux={key:0,class:"entity-field-description"};var Yx=h.defineComponent({__name:"EntityField",props:{title:{default:void 0},description:{default:void 0},route:{default:void 0}},emits:["click"],setup(n,{emit:e}){return(t,i)=>{const s=h.resolveComponent("RouterLink");return h.openBlock(),h.createElementBlock("div",Rx,[n.title||t.$slots.title?(h.openBlock(),h.createElementBlock("div",Hx,[h.renderSlot(t.$slots,"title",{},()=>[h.createElementVNode("div",{class:"entity-field-title",onClick:i[0]||(i[0]=r=>e("click"))},[n.route?(h.openBlock(),h.createBlock(s,{key:0,to:n.route},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.title),1)]),_:1},8,["to"])):(h.openBlock(),h.createElementBlock("span",Fx,h.toDisplayString(n.title),1))]),h.renderSlot(t.$slots,"extra")])])):h.createCommentVNode("",!0),n.description||t.$slots.description?(h.openBlock(),h.createElementBlock("div",Wx,[h.renderSlot(t.$slots,"description",{},()=>[n.description?(h.openBlock(),h.createElementBlock("span",Ux,h.toDisplayString(n.description),1)):h.createCommentVNode("",!0)])])):h.createCommentVNode("",!0)])}}}),bk="";return b.IconAddCircle=gu,b.IconArrowDown=Rc,b.IconArrowDownLine=qc,b.IconArrowLeft=Hn,b.IconArrowRight=Ii,b.IconArrowUpLine=Uc,b.IconBookRead=Xc,b.IconCalendar=Ud,b.IconCharacterRecognition=Rd,b.IconCheckboxCircle=Wn,b.IconCheckboxFill=Tu,b.IconClose=Ni,b.IconCloseCircle=Hr,b.IconCodeBoxLine=Id,b.IconComputer=Pu,b.IconDashboard=Ec,b.IconDatabase2Line=Bd,b.IconDeleteBin=uu,b.IconErrorWarning=Fn,b.IconExchange=id,b.IconExternalLinkLine=cm,b.IconEye=zf,b.IconEyeOff=Pf,b.IconFolder=Wf,b.IconForbidLine=Fr,b.IconGitBranch=wd,b.IconGitHub=od,b.IconGrid=Du,b.IconInformation=Ei,b.IconLink=qd,b.IconList=Su,b.IconListSettings=gf,b.IconMagic=bf,b.IconMessage=af,b.IconMore=Rr,b.IconMotionLine=im,b.IconPages=sf,b.IconPalette=uf,b.IconPhone=Wu,b.IconPlug=Tf,b.IconReplyLine=om,b.IconSave=bu,b.IconSearch=zu,b.IconSettings=Df,b.IconShieldUser=md,b.IconStopCircle=Cd,b.IconTablet=Ku,b.IconTeam=jd,b.IconUpload=cd,b.IconUserFollow=Ju,b.IconUserLine=Wr,b.IconUserSettings=Sf,b.VAlert=bm,b.VAvatar=dm,b.VButton=Un,b.VCard=Em,b.VCheckbox=Yr,b.VCheckboxGroup=zm,b.VCodemirror=bx,b.VDialog=Xr,b.VDialogProvider=Fp,b.VEmpty=Dx,b.VEntity=Px,b.VEntityField=Yx,b.VInput=Ym,b.VMenu=Gr,b.VMenuItem=Yn,b.VMenuLabel=Kr,b.VModal=qr,b.VOption=gp,b.VPageHeader=Rm,b.VPagination=tg,b.VRadio=Qr,b.VRadioGroup=cp,b.VRoutesMenu=tp,b.VSelect=mp,b.VSpace=Zr,b.VStatusDot=Ex,b.VSwitch=Op,b.VTabItem=Cp,b.VTabbar=Jr,b.VTabs=bp,b.VTag=Np,b.VTextarea=Bp,b.useDialog=Wp,Object.defineProperty(b,"__esModule",{value:!0}),b}({},Vue,VueUse,VueRouter,VueUse);
|
|
3
14
|
//# sourceMappingURL=halo-components.iife.js.map
|