x4js 2.0.13 → 2.0.14
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/.vscode/launch.json +14 -0
- package/README.md +5 -0
- package/{lib/src/demo → demo}/main.scss +3 -1
- package/{lib/src/demo/main.tsx → demo/main.ts} +37 -36
- package/demo/package.json +26 -0
- package/demo/scss.d.ts +4 -0
- package/demo/svg.d.ts +1 -0
- package/demo/tsconfig.json +14 -0
- package/lib/README.txt +5 -0
- package/lib/cjs/x4.css +1 -1
- package/lib/cjs/x4.js +2 -1
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +2 -1
- package/lib/src/components/boxes/boxes.module.scss +17 -0
- package/lib/src/components/boxes/boxes.ts +162 -13
- package/lib/src/components/breadcrumb/breadcrumb.scss +56 -28
- package/lib/src/components/breadcrumb/breadcrumb.ts +93 -84
- package/lib/src/components/btngroup/btngroup.module.scss +12 -0
- package/lib/src/components/btngroup/btngroup.ts +41 -8
- package/lib/src/components/button/button.module.scss +23 -5
- package/lib/src/components/button/button.ts +72 -4
- package/lib/src/components/canvas/canvas.module.scss +25 -0
- package/lib/src/components/canvas/canvas.ts +189 -0
- package/lib/src/components/canvas/canvas_ex.ts +269 -0
- package/lib/src/components/checkbox/checkbox.ts +18 -4
- package/lib/src/components/combobox/combobox.module.scss +24 -15
- package/lib/src/components/combobox/combobox.ts +107 -24
- package/lib/src/components/components.ts +7 -0
- package/lib/src/components/dialog/dialog.module.scss +37 -3
- package/lib/src/components/dialog/dialog.ts +149 -31
- package/lib/src/components/filedrop/cloud-arrow-up.svg +1 -0
- package/lib/src/components/filedrop/filedrop.module.scss +70 -0
- package/lib/src/components/filedrop/filedrop.ts +131 -0
- package/lib/src/components/form/form.module.scss +4 -0
- package/lib/src/components/form/form.ts +137 -6
- package/lib/src/components/gridview/arrow-down-light.svg +1 -0
- package/lib/src/components/gridview/arrow-up-light.svg +1 -0
- package/lib/src/components/gridview/gridview.module.scss +324 -0
- package/lib/src/components/gridview/gridview.ts +1175 -0
- package/lib/src/components/icon/icon.module.scss +1 -1
- package/lib/src/components/icon/icon.ts +4 -1
- package/lib/src/components/image/image.module.scss +8 -1
- package/lib/src/components/image/image.ts +105 -6
- package/lib/src/components/input/input.module.scss +8 -3
- package/lib/src/components/input/input.ts +137 -14
- package/lib/src/components/keyboard/arrow-up.svg +1 -0
- package/lib/src/components/keyboard/delete-left.svg +1 -0
- package/lib/src/components/keyboard/eye-slash.svg +1 -0
- package/lib/src/components/keyboard/keyboard.module.scss +134 -0
- package/lib/src/components/keyboard/keyboard.ts +525 -0
- package/lib/src/components/label/label.module.scss +22 -4
- package/lib/src/components/label/label.ts +33 -0
- package/lib/src/components/link/link.ts +81 -78
- package/lib/src/components/listbox/listbox.module.scss +61 -3
- package/lib/src/components/listbox/listbox.ts +164 -56
- package/lib/src/components/menu/menu.module.scss +10 -1
- package/lib/src/components/menu/menu.ts +4 -1
- package/lib/src/components/messages/messages.module.scss +44 -0
- package/lib/src/components/messages/messages.ts +164 -18
- package/lib/src/components/messages/pen-field.svg +1 -0
- package/lib/src/components/normalize.scss +5 -0
- package/lib/src/components/notification/notification.module.scss +4 -2
- package/lib/src/components/notification/notification.ts +2 -4
- package/lib/src/components/panel/panel.module.scss +12 -0
- package/lib/src/components/popup/popup.module.scss +4 -2
- package/lib/src/components/popup/popup.ts +136 -92
- package/lib/src/components/propgrid/folder-closed.svg +1 -0
- package/lib/src/components/propgrid/folder-open.svg +1 -0
- package/lib/src/components/propgrid/progrid.module.scss +108 -0
- package/lib/src/components/propgrid/propgrid.ts +271 -0
- package/lib/src/components/propgrid/updown.svg +4 -0
- package/lib/src/components/radio/radio.module.scss +147 -0
- package/lib/src/components/radio/radio.svg +4 -0
- package/lib/src/components/radio/radio.ts +142 -0
- package/lib/src/components/select/select.module.scss +9 -0
- package/lib/src/components/select/select.ts +134 -0
- package/lib/src/components/shared.scss +47 -0
- package/lib/src/components/sizers/sizer.ts +9 -2
- package/lib/src/components/slider/slider.module.scss +77 -30
- package/lib/src/components/slider/slider.ts +72 -22
- package/lib/src/components/tabs/tabs.module.scss +1 -2
- package/lib/src/components/tabs/tabs.ts +43 -12
- package/lib/src/components/textarea/textarea.module.scss +6 -2
- package/lib/src/components/textarea/textarea.ts +73 -8
- package/lib/src/components/textedit/textedit.module.scss +3 -1
- package/lib/src/components/textedit/textedit.ts +31 -4
- package/lib/src/components/themes.scss +7 -0
- package/lib/src/components/tickline/tickline.module.scss +26 -0
- package/lib/src/components/tickline/tickline.ts +82 -0
- package/lib/src/components/tooltips/comments-question.svg +1 -0
- package/lib/src/components/tooltips/tooltips.scss +30 -9
- package/lib/src/components/tooltips/tooltips.ts +10 -5
- package/lib/src/components/treeview/treeview.module.scss +129 -60
- package/lib/src/components/treeview/treeview.ts +47 -12
- package/lib/src/components/viewport/viewport.module.scss +7 -0
- package/lib/src/core/component.ts +102 -32
- package/lib/src/core/core_application.ts +222 -2
- package/lib/src/core/core_colors.ts +2 -2
- package/lib/src/{components/grid/datastore.ts → core/core_data.ts} +261 -250
- package/lib/src/core/core_dragdrop.ts +3 -3
- package/lib/src/core/core_element.ts +13 -1
- package/lib/src/core/core_events.ts +28 -0
- package/lib/src/core/core_i18n.ts +18 -2
- package/lib/src/core/core_react.ts +79 -0
- package/lib/src/core/core_router.ts +23 -7
- package/lib/src/core/core_styles.ts +5 -5
- package/lib/src/core/core_svg.ts +173 -12
- package/lib/src/core/core_tools.ts +305 -87
- package/lib/src/x4tsx.d.ts +25 -0
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +767 -92
- package/package.json +4 -4
- package/scripts/build.mjs +378 -0
- package/scripts/prepack.mjs +346 -0
- package/src/components/base.scss +25 -0
- package/src/components/boxes/boxes.module.scss +54 -0
- package/src/components/boxes/boxes.ts +278 -0
- package/src/components/breadcrumb/breadcrumb.scss +56 -0
- package/src/components/breadcrumb/breadcrumb.ts +93 -0
- package/src/components/breadcrumb/chevron-right.svg +1 -0
- package/src/components/btngroup/btngroup.module.scss +41 -0
- package/src/components/btngroup/btngroup.ts +153 -0
- package/src/components/button/button.module.scss +173 -0
- package/src/components/button/button.ts +185 -0
- package/src/components/calendar/calendar-check-sharp-light.svg +1 -0
- package/src/components/calendar/calendar.module.scss +163 -0
- package/src/components/calendar/calendar.ts +327 -0
- package/src/components/calendar/chevron-left-sharp-light.svg +1 -0
- package/src/components/calendar/chevron-right-sharp-light.svg +1 -0
- package/src/components/canvas/canvas.module.scss +25 -0
- package/src/components/canvas/canvas.ts +189 -0
- package/src/components/canvas/canvas_ex.ts +269 -0
- package/src/components/checkbox/check.svg +4 -0
- package/src/components/checkbox/checkbox.module.scss +142 -0
- package/src/components/checkbox/checkbox.ts +140 -0
- package/src/components/colorinput/colorinput.module.scss +65 -0
- package/src/components/colorinput/colorinput.ts +91 -0
- package/src/components/colorinput/crosshairs-simple-sharp-light.svg +1 -0
- package/src/components/colorpicker/colorpicker.module.scss +133 -0
- package/src/components/colorpicker/colorpicker.ts +482 -0
- package/src/components/combobox/combobox.module.scss +133 -0
- package/src/components/combobox/combobox.ts +275 -0
- package/src/components/combobox/updown.svg +4 -0
- package/src/components/components.ts +41 -0
- package/src/components/dialog/dialog.module.scss +105 -0
- package/src/components/dialog/dialog.ts +212 -0
- package/src/components/dialog/xmark-sharp-light.svg +1 -0
- package/src/components/filedrop/cloud-arrow-up.svg +1 -0
- package/src/components/filedrop/filedrop.module.scss +70 -0
- package/src/components/filedrop/filedrop.ts +131 -0
- package/src/components/form/form.module.scss +38 -0
- package/src/components/form/form.ts +172 -0
- package/src/components/gridview/arrow-down-light.svg +1 -0
- package/src/components/gridview/arrow-up-light.svg +1 -0
- package/src/components/gridview/gridview.module.scss +324 -0
- package/src/components/gridview/gridview.ts +1175 -0
- package/src/components/header/header.module.scss +40 -0
- package/src/components/header/header.ts +130 -0
- package/src/components/icon/icon.module.scss +30 -0
- package/src/components/icon/icon.ts +139 -0
- package/src/components/image/image.module.scss +28 -0
- package/src/components/image/image.ts +168 -0
- package/src/components/input/input.module.scss +74 -0
- package/src/components/input/input.ts +398 -0
- package/src/components/keyboard/arrow-up.svg +1 -0
- package/src/components/keyboard/delete-left.svg +1 -0
- package/src/components/keyboard/eye-slash.svg +1 -0
- package/src/components/keyboard/keyboard.module.scss +134 -0
- package/src/components/keyboard/keyboard.ts +525 -0
- package/src/components/label/label.module.scss +76 -0
- package/src/components/label/label.ts +97 -0
- package/src/components/link/link.ts +81 -0
- package/src/components/listbox/listbox.module.scss +161 -0
- package/src/components/listbox/listbox.ts +539 -0
- package/src/components/menu/caret-right-solid.svg +1 -0
- package/src/components/menu/menu.module.scss +117 -0
- package/src/components/menu/menu.ts +174 -0
- package/src/components/messages/circle-exclamation.svg +1 -0
- package/src/components/messages/messages.module.scss +92 -0
- package/src/components/messages/messages.ts +215 -0
- package/src/components/messages/pen-field.svg +1 -0
- package/src/components/normalize.scss +391 -0
- package/src/components/notification/circle-check-solid.svg +1 -0
- package/src/components/notification/circle-exclamation-solid.svg +1 -0
- package/src/components/notification/circle-notch-light.svg +1 -0
- package/src/components/notification/notification.module.scss +84 -0
- package/src/components/notification/notification.ts +107 -0
- package/src/components/notification/xmark-sharp-light.svg +1 -0
- package/src/components/panel/panel.module.scss +60 -0
- package/src/components/panel/panel.ts +58 -0
- package/src/components/popup/popup.module.scss +45 -0
- package/src/components/popup/popup.ts +440 -0
- package/src/components/progress/progress.module.scss +57 -0
- package/src/components/progress/progress.ts +44 -0
- package/src/components/propgrid/folder-closed.svg +1 -0
- package/src/components/propgrid/folder-open.svg +1 -0
- package/src/components/propgrid/progrid.module.scss +108 -0
- package/src/components/propgrid/propgrid.ts +271 -0
- package/src/components/propgrid/updown.svg +4 -0
- package/src/components/radio/radio.module.scss +147 -0
- package/src/components/radio/radio.svg +4 -0
- package/src/components/radio/radio.ts +142 -0
- package/src/components/rating/rating.module.scss +23 -0
- package/src/components/rating/rating.ts +131 -0
- package/src/components/rating/star-sharp-light.svg +1 -0
- package/src/components/rating/star-sharp-solid.svg +1 -0
- package/src/components/select/select.module.scss +9 -0
- package/src/components/select/select.ts +134 -0
- package/src/components/shared.scss +137 -0
- package/src/components/sizers/sizer.module.scss +90 -0
- package/src/components/sizers/sizer.ts +131 -0
- package/src/components/slider/slider.module.scss +118 -0
- package/src/components/slider/slider.ts +198 -0
- package/src/components/switch/switch.module.scss +127 -0
- package/src/components/switch/switch.ts +62 -0
- package/src/components/tabs/tabs.module.scss +45 -0
- package/src/components/tabs/tabs.ts +199 -0
- package/src/components/textarea/textarea.module.scss +63 -0
- package/src/components/textarea/textarea.ts +125 -0
- package/src/components/textedit/textedit.module.scss +116 -0
- package/src/components/textedit/textedit.ts +110 -0
- package/src/components/themes.scss +88 -0
- package/src/components/tickline/tickline.module.scss +26 -0
- package/src/components/tickline/tickline.ts +82 -0
- package/src/components/tooltips/circle-info-sharp-light.svg +1 -0
- package/src/components/tooltips/comments-question.svg +1 -0
- package/src/components/tooltips/tooltips.scss +72 -0
- package/src/components/tooltips/tooltips.ts +109 -0
- package/src/components/treeview/chevron-down-light.svg +1 -0
- package/src/components/treeview/treeview.module.scss +185 -0
- package/src/components/treeview/treeview.ts +445 -0
- package/src/components/viewport/viewport.module.scss +32 -0
- package/src/components/viewport/viewport.ts +41 -0
- package/src/core/component.ts +1072 -0
- package/src/core/core_application.ts +264 -0
- package/src/core/core_colors.ts +250 -0
- package/src/core/core_data.ts +1309 -0
- package/src/core/core_dom.ts +471 -0
- package/src/core/core_dragdrop.ts +201 -0
- package/src/core/core_element.ts +110 -0
- package/src/core/core_events.ts +177 -0
- package/src/core/core_i18n.ts +393 -0
- package/src/core/core_react.ts +79 -0
- package/src/core/core_router.ts +237 -0
- package/src/core/core_styles.ts +214 -0
- package/src/core/core_svg.ts +711 -0
- package/src/core/core_tools.ts +906 -0
- package/src/types/scss.d.ts +4 -0
- package/src/types/svg.d.ts +1 -0
- package/src/types/x4react.d.ts +9 -0
- package/src/x4.scss +19 -0
- package/src/x4tsx.d.ts +25 -0
- package/tsconfig.json +14 -0
- package/lib/src/components/grid/gridview.ts +0 -1108
- package/lib/src/components/grid/memdb.ts +0 -325
- /package/{lib/src/demo → demo}/assets/house-light.svg +0 -0
- /package/{lib/src/demo → demo}/assets/radio.svg +0 -0
- /package/{lib/src/demo → demo}/index.html +0 -0
package/lib/esm/x4.mjs
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
var Nt=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Ft=s=>{throw TypeError(s)};var i=(s,e)=>Nt(s,"name",{value:e,configurable:!0});var p=(s,e,t,o)=>{for(var r=o>1?void 0:o?Ro(e,t):e,n=s.length-1,a;n>=0;n--)(a=s[n])&&(r=(o?a(e,t,r):a(r))||r);return o&&r&&Nt(e,t,r),r};var Ut=(s,e,t)=>e.has(s)||Ft("Cannot "+t);var D=(s,e,t)=>(Ut(s,e,"read from private field"),t?t.call(s):e.get(s)),Ke=(s,e,t)=>e.has(s)?Ft("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),qe=(s,e,t,o)=>(Ut(s,e,"write to private field"),o?o.call(s,t):e.set(s,t),t);var Vt=Symbol("i18n"),ue={};function Kt(s,e){ue[s]={name:s,base:e,src_translations:{},translations:{}}}i(Kt,"createLanguage");function qt(s){return ue[s]!==void 0}i(qt,"isLanguage");function Gt(s,...e){if(!qt(s))return;let t=ue[s];e.forEach(o=>{Qt(t.src_translations,o)}),t.translations=Wt(t.src_translations,t.base,!0)}i(Gt,"addTranslation");function Qt(s,e){for(let t in e){let o=e[t];typeof o=="string"?s[t]=o:Array.isArray(o)&&(!s[t]||!Array.isArray(s[t]))?s[t]=[...o]:!s[t]||typeof s[t]!="object"?s[t]={...o}:Qt(s[t],e[t])}}i(Qt,"_patch");function Wt(s,e,t){let o={};for(let r in s)typeof s[r]!="string"&&!Array.isArray(s[r])?o[r]=Wt(s[r],e,!1):o[r]=s[r];return Oo(o,e,t)}i(Wt,"_proxyfy");function Oo(s,e,t){return new Proxy(s,{get:i((o,r)=>{t?je=[r]:je.push(r);let n=o[r];return n===void 0&&(e&&(n=Bo(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+je.join("."))),n},"get")})}i(Oo,"_mk_proxy");var je;function Bo(s){for(;s;){let e=ue[s],t=e.translations,o;for(let r of je){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;s=e.base}}i(Bo,"_findBaseTrans");var g={};function zo(s){if(qt(s))return g=ue[s].translations,g[Vt]=s,g}i(zo,"selectLanguage");function fr(){return g[Vt]}i(fr,"getCurrentLanguage");function vr(){return Object.keys(ue)}i(vr,"getAvailableLanguages");var Ho={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller"}},No={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste"}};Kt("fr",null);Gt("fr",Ho);Kt("en","fr");Gt("en",No);zo("fr");function T(s){return typeof s=="string"}i(T,"isString");function U(s){return typeof s=="number"&&isFinite(s)}i(U,"isNumber");function dt(s){return s instanceof Array}i(dt,"isArray");function Er(s){return s instanceof Function}i(Er,"isFunction");var pt=class pt extends String{constructor(e){super(e)}};i(pt,"UnsafeHtml");var xe=pt;function Ze(s){return new xe(s)}i(Ze,"unsafeHtml");function S(s,e,t){return s<e?e:s>t?t:s}i(S,"clamp");var ht=class ht{constructor(e,t,o,r){e!==void 0&&(U(e)?(this.left=e,this.top=t,this.width=o,this.height=r):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}};i(ht,"Rect");var N=ht;function $e(s){switch(s){case"eyedropper":return"EyeDropper"in window}return!1}i($e,"isFeatureAvailable");var mt=class mt{setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let r=setTimeout(o,t);return this._timers.set(e,r),r}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let r=setInterval(o,t);return this._timers.set(e,r),r}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};i(mt,"Timer");var be=mt;function jt(s){return requestAnimationFrame(s)}i(jt,"asap");function H(s,e,t="0"){let o;return T(s)?o=s:o=""+s,e>0?o.padEnd(e,t):o.padStart(-e,t)}i(H,"pad");function ct(s,...e){return s.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}i(ct,"sprintf");function kr(s){let e=s;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}i(kr,"pascalCase");function Cr(s){let e=s.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}i(Cr,"camelCase");var Fo="fr-FR";function Ar(s){Fo=s}i(Ar,"_date_set_locale");function Ir(s,e){return F(s)}i(Ir,"date_format");function Mr(s,e,t){var o=(s.getTime()-e.getTime())/1e3;let r=o;if(r<60)return ct(g.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return ct(g.global.diff_date_minutes,Math.round(n));let a=Math.floor(n/60);return ct(g.global.diff_date_hours,a,n%60)}i(Mr,"date_diff");function Pr(s,e){return e?F(s,"Y-M-D H:I:S"):F(s,"Y-M-D")}i(Pr,"date_to_sql");function Dr(s){return new Date(s+" GMT")}i(Dr,"date_sql_utc");function J(s){return s.getFullYear()<<16|s.getMonth()<<8|s.getDate()}i(J,"date_hash");function ge(s){return new Date(s.getTime())}i(ge,"date_clone");function Yt(s){let e=new Date(s.getFullYear(),0,1),t=(s.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}i(Yt,"date_calc_weeknum");function Tr(s,e=g.global.date_input_formats){var o,r,n,a,l,d;let t=e.split("|");for(let m of t){let b="";for(let _ of m)_=="d"||_=="D"?b+="(?<day>\\d{1,2})":_=="m"||_=="M"?b+="(?<month>\\d{1,2})":_=="y"||_=="Y"?b+="(?<year>\\d{1,4})":_=="h"||_=="H"?b+="(?<hour>\\d{1,2})":_=="i"||_=="I"?b+="(?<min>\\d{1,2})":_=="s"||_=="S"?b+="(?<sec>\\d{1,2})":_==" "?b+="\\s+":b+="\\s*\\"+_+"\\s*";let C=new RegExp("^"+b+"$","m").exec(s);if(C){let _=new Date,Ve=parseInt((o=C.groups.day)!=null?o:"1"),$=parseInt((r=C.groups.month)!=null?r:"1"),X=parseInt((n=C.groups.year)!=null?n:_.getFullYear()+""),We=parseInt((a=C.groups.hour)!=null?a:"0"),Po=parseInt((l=C.groups.min)!=null?l:"0"),Do=parseInt((d=C.groups.sec)!=null?d:"0");X>0&&X<100&&(X+=2e3);let Ye=new Date(X,$-1,Ve,We,Po,Do,0),To=Ye.getFullYear(),Lo=Ye.getMonth()+1,So=Ye.getDate();return To!=X||Lo!=$||So!=Ve?null:Ye}}return null}i(Tr,"parseIntlDate");function F(s,e=g.global.date_format){if(!s)return"";let t={year:s.getFullYear(),month:s.getMonth()+1,day:s.getDate(),wday:s.getDay(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milli:s.getMilliseconds()},o="",r=0;for(let n of e){if(n=="{"){if(++r==1)continue}else if(n=="}"&&--r==0)continue;if(r){o+=n;continue}n=="d"?o+=t.day:n=="D"?o+=H(t.day,-2):n=="j"?o+=g.global.day_short[t.wday]:n=="J"?o+=g.global.day_long[t.wday]:n=="w"?o+=Yt(s):n=="W"?o+=H(Yt(s),-2):n=="m"?o+=t.month:n=="M"?o+=H(t.month,-2):n=="o"?o+=g.global.month_short[t.month-1]:n=="O"?o+=g.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=H(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=H(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=H(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=H(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=H(t.milli,-3):o+=n}return o}i(F,"formatIntlDate");function Lr(s,e){if(e===void 0&&(e=new Date),!s)return 0;let t=e.getFullYear()-s.getFullYear();return(e.getMonth()<s.getMonth()||e.getMonth()==s.getMonth()&&e.getDate()<s.getDate())&&t--,t}i(Lr,"calcAge");function Sr(){new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=").play()}i(Sr,"beep");var Xe=Symbol("class-ns");function h(s){return function(e){e[Xe]=s}}i(h,"class_ns");var Uo=i(function(){this.propagationStopped=!0},"stopPropagation"),Vo=i(function(){this.defaultPrevented=!0},"preventDefault"),ut=class ut{constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let r=this._registry.get(e);r||(r=[],this._registry.set(e,r));let n=t;r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n))}fire(e,t){var r;let o=(r=this._registry)==null?void 0:r.get(e);if(o&&o.length){let n=t;if(n||(n={}),n.source||(n.source=this._source),n.type||(n.type=e),n.preventDefault||(n.preventDefault=Vo),n.stopPropagation||(n.stopPropagation=Uo),o.length==1)o[0](n);else{let a=o.slice();for(let l=0,d=a.length;l<d&&(a[l](n),!n.propagationStopped);l++);}}}};i(ut,"EventSource");var fe=ut;var V,O,xt=class xt{constructor(){Ke(this,V);Ke(this,O)}__startTimer(e,t,o,r){D(this,O)?this.__stopTimer(e):qe(this,O,new Map);let n=(o?setInterval:setTimeout)(r,t);D(this,O).set(e,()=>{(o?clearInterval:clearTimeout)(n),D(this,O).delete(e)})}__stopTimer(e){let t=D(this,O).get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of D(this,O))t();D(this,O).clear()}on(e,t){console.assert(t!=null),D(this,V)||qe(this,V,new fe(this)),D(this,V).addListener(e,t)}fire(e,t){D(this,V)&&D(this,V).fire(e,t)}};V=new WeakMap,O=new WeakMap,i(xt,"CoreElement");var Je=xt;var et={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Xt(s){return!!et[s]}i(Xt,"isUnitLess");var ee=class ee{constructor(){this.m_rules=new Map;function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(i(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(T(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let r in t){let n=r+" { ",a=t[r];for(let l in a){let d=a[l];for(let m=0;m<d.length;m++)n+=l+": "+d[m]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return ee.doc_style||(ee.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),ee.doc_style.getPropertyValue(e)}};i(ee,"Stylesheet"),ee.guid=1;var Zt=ee,bt=class bt{constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};i(bt,"ComputedStyle");var $t=bt;var Ko={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},tt=new WeakMap,gt=null,qo=i((s,e)=>{let t=i((r,n)=>{let a=tt.get(r);a&&a[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=i((r,n)=>{n&&t(r,"created");for(let a=r.firstChild;a;a=a.nextSibling)o(a,n);n||t(r,"removed")},"notify");for(let r of s)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),ft=null;function Go(s){s.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}i(Go,"observeSize");function Qo(s){let e=s.target,t=Ko[s.type]===2;for(;e;){let o=tt.get(e);if(o){let r=o[s.type];if(r&&(Array.isArray(r)?r.some(n=>n(s)):r(s),s.stopPropagation||s.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}i(Qo,"dispatchEvent");function ot(s,e,t,o=!1){e=="removed"||e=="created"?gt||(gt=new MutationObserver(qo),gt.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(ft||(ft=new ResizeObserver(Go)),ft.observe(s));let r=tt.get(s);if(r||(r={},tt.set(s,r)),!r[e])r[e]=t,s.addEventListener(e,Qo);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}i(ot,"addEvent");var Jt=Symbol("fragment"),eo=Symbol("component"),Wo=/^-?\d+(\.\d*)?$/;function Yo(s){let e=[],t=Object.getPrototypeOf(s);for(;t&&t.constructor!==c;){let o=t.constructor.name,r=t.constructor.hasOwnProperty(Xe)?t.constructor[Xe]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}i(Yo,"genClassNames");var jo=1e3,B=i(()=>`x4-${jo++}`,"makeUniqueComponentId"),c=class extends Je{constructor(e){var t,o;if(super(),this.props=e,e.existingDOM)this.dom=e.existingDOM;else{e.ns?this.dom=document.createElementNS(e.ns,(t=e.tag)!=null?t:"div"):this.dom=document.createElement((o=e.tag)!=null?o:"div"),e.attrs&&this.setAttributes(e.attrs),e.cls&&this.addClass(e.cls),e.hidden&&this.show(!1),e.id!==void 0&&this.setAttribute("id",e.id),e.width!==void 0&&this.setStyleValue("width",e.width),e.height!==void 0&&this.setStyleValue("height",e.height),e.tooltip&&this.setAttribute("tooltip",e.tooltip),e.style&&this.setStyle(e.style),e.content&&this.setContent(e.content),e.dom_events&&this.setDOMEvents(e.dom_events);let r=Yo(this);this.dom.classList.add(...r),e.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[eo]=this}hasClass(e){return this.dom.classList.contains(e)}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.add(...t)}else this.dom.classList.add(e)}removeClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this.dom.classList.remove(...t)}else this.dom.classList.remove(e)}removeClassEx(e){Array.from(this.dom.classList).forEach(o=>{o.match(e)&&this.dom.classList.remove(o)})}toggleClass(e){if(!e)return;let t=i(o=>{this.dom.classList.toggle(o)},"toggle");e.indexOf(" ")>=0?e.split(" ").forEach(t):t(e)}setClass(e,t=!0){t?this.addClass(e):this.removeClass(e)}setAttributes(e){for(let t in e){let o=e[t];this.setAttribute(t,o)}}setAttribute(e,t){t==null?this.dom.removeAttribute(e):this.dom.setAttribute(e,""+t)}getAttribute(e){return this.dom.getAttribute(e)}getData(e){return this.getAttribute("data-"+e)}setData(e,t){return this.setAttribute("data-"+e,t)}setInternalData(e,t){return this.store||(this.store=new Map),this.store.set(e,t),this}getInternalData(e){var t;return(t=this.store)==null?void 0:t.get(e)}addDOMEvent(e,t,o=!1){ot(this.dom,e,t,o)}setDOMEvents(e){for(let t in e)this.addDOMEvent(t,e[t])}mapPropEvents(e,...t){let o=e;t.forEach(r=>{o.hasOwnProperty(r)&&this.on(r,o[r])})}clearContent(){let e=this.dom;for(;e.firstChild;)e.removeChild(e.firstChild)}setContent(e){this.clearContent(),this.appendContent(e)}appendContent(e){let t=i((o,r)=>{if(r instanceof c)o.appendChild(r.dom);else if(r instanceof xe)o.insertAdjacentHTML("beforeend",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());o.appendChild(n)}else r&&console.warn("Unknown type to append: ",r)},"set");if(!dt(e))t(this.dom,e);else if(e.length<=8)for(let o of e)t(this.dom,o);else{let o=document.createDocumentFragment();for(let r of e)t(o,r);this.dom.appendChild(o)}}prependContent(e){let t=this.dom,o=i(r=>{if(r instanceof c)t.insertBefore(t.firstChild,r.dom);else if(r instanceof xe)t.insertAdjacentHTML("beforebegin",r.toString());else if(typeof r=="string"||typeof r=="number"){let n=document.createTextNode(r.toString());t.insertBefore(t.firstChild,n)}else console.warn("Unknown type to append: ",r)},"set");if(!dt(e))o(e);else{let r=document.createDocumentFragment();for(let n of e)o(n);t.insertBefore(t.firstChild,r)}}removeChild(e){this.dom.removeChild(e.dom)}queryAll(e){let t=this.dom.querySelectorAll(e),o=new Array(t.length);return t.forEach((r,n)=>o[n]=y(r)),o}query(e){let t=this.dom.querySelector(e);return y(t)}setAria(e,t){return this.setAttribute(e,t),this}setStyle(e){let t=this.dom.style;for(let o in e){let r=e[o];!et[o]&&(U(r)||Wo.test(r))&&(r+="px"),t[o]=r}return this}setStyleValue(e,t){let o=this.dom.style;if(U(t)){let r=t+"";et[e]||(r+="px"),o[e]=r}else o[e]=t;return this}getStyleValue(e){return this.dom.style[e]}setWidth(e){this.setStyleValue("width",U(e)?e+"px":e)}setHeight(e){this.setStyleValue("height",U(e)?e+"px":e)}setStyleVariable(e,t){this.dom.style.setProperty(e,t)}getStyleVariable(e){return this.getComputedStyle().getPropertyValue(e)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(e){this.dom.setPointerCapture(e)}releaseCapture(e){this.dom.releasePointerCapture(e)}getBoundingRect(){let e=this.dom.getBoundingClientRect();return new N(e.x,e.y,e.width,e.height)}focus(){this.dom.focus()}scrollIntoView(e){this.dom.scrollIntoView(e)}isVisible(){return this.dom.offsetParent!==null}show(e=!0){this.setClass("x4hidden",!e)}hide(){this.show(!1)}enable(e=!0){this.setAttribute("disabled",!e),this.enumChildNodes(!0).forEach(o=>{o instanceof HTMLInputElement&&(o.disabled=!e)})}disable(){this.enable(!1)}isDisabled(){return this.getAttribute("disabled")}nextElement(){let e=this.dom.nextElementSibling;return y(e)}prevElement(){let e=this.dom.previousElementSibling;return y(e)}parentElement(e){let t=this.dom;for(;t.parentElement;){let o=y(t.parentElement);if(!e||o&&o instanceof e)return o;t=t.parentElement}return null}firstChild(){let e=this.dom.firstElementChild;return y(e)}lastChild(){let e=this.dom.lastElementChild;return y(e)}enumChildComponents(e){let t=[];return this.enumChildNodes(e).forEach(r=>{let n=y(r);n&&t.push(n)}),t}enumChildNodes(e){return Array.from(e?this.dom.querySelectorAll("*"):this.dom.children)}animate(e,t){this.dom.animate(e,t)}static createElement(e,t,...o){let r;return e==this.createFragment||e===Jt?o:(e instanceof Function?(t=t!=null?t:{},!t.children&&o&&o.length&&(t.content=o),r=new e(t!=null?t:{})):r=new c({tag:e,content:o,...t}),o&&o.length,r)}static createFragment(){return this.createElement(Jt,null)}queryInterface(e){return null}};i(c,"Component"),c=p([h("x4")],c);function y(s){return s?s[eo]:null}i(y,"componentFromDOM");function to(s){let e=y(s);return e||new c({existingDOM:s})}i(to,"wrapDOM");var vt=class vt extends c{constructor(){super({})}};i(vt,"Flex");var ve=vt;function te(s){return s.toString(16).padStart(2,"0")}i(te,"hx");function _e(s){return Math.round(s)}i(_e,"round");var _t=class _t{constructor(...e){this.rgb=[0,0,0,1];this.invalid=!1;T(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,r<<4|r,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),a=parseInt(e[5],16),l=parseInt(e[6],16),d=parseInt(e[7],16),m=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,a<<4|l,(d<<4|m)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let r=o[1].trim(),a=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(a)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,r=1){let n=Math.min(5,Math.floor(e*6)),a=e*6-n,l=o*(1-t),d=o*(1-a*t),m=o*(1-(1-a)*t),b,M,C;switch(n){case 0:b=o,M=m,C=l;break;case 1:b=d,M=o,C=l;break;case 2:b=l,M=o,C=m;break;case 3:b=l,M=d,C=o;break;case 4:b=m,M=l,C=o;break;case 5:b=o,M=l,C=d;break}return this.setRgb(b*255,M*255,C*255,r)}setRgb(e,t,o,r){return this.rgb=[S(e,0,255),S(t,0,255),S(o,0,255),S(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${_e(t[0])},${_e(t[1])},${_e(t[2])})`:`rgba(${_e(t[0])},${_e(t[1])},${_e(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#(${te(e[0])},${te(e[1])},${te(e[2])})`:`rgba(${te(e[0])},${te(e[1])},${te(e[2])},${te(e[3]*255)})`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),r=t-o,n=t===0?0:r/t,a=t,l;if(r===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/r/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/r/6+1/3;break;case e.blue:l=(e.red-e.green)/r/6+2/3;break}return{hue:l,saturation:n,value:a,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=S(e,0,1),this}isInvalid(){return this.invalid}};i(_t,"Color");var L=_t;var wt=Symbol("x-drag-cb"),Et=class Et{registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let r=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}console.log("accepted ",e),d.preventDefault(),d.dataTransfer.dropEffect="copy"},"dragEnter"),n=i(d=>{if(o&&!o(this.dragSource)){console.log("reject ",e),d.dataTransfer.dropEffect="none";return}if(d.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drag",this.dragSource,m)}d.dataTransfer.dropEffect="copy"},"dragOver"),a=i(d=>{this.dropTarget=null,d.preventDefault()},"dragLeave"),l=i(d=>{let m={pt:{x:d.pageX,y:d.pageY},data:d.dataTransfer};t("drop",this.dragSource,m),this.dropTarget=null,e.removeClass("drop-over"),d.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",a),e.addDOMEvent("drop",l),e.setInternalData(wt,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=i(o=>{o.removeClass("drop-over"),o.getInternalData(wt)("leave",this.dragSource)},"leaving"),t=i(o=>{o.addClass("drop-over"),o.getInternalData(wt)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};i(Et,"DragManager");var yt=Et,ln=new yt;function Zo(s,e=!1){if(s instanceof RegExp)return{keys:null,pattern:s};let t=s.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let a=n[0];if(a==="*")o.push("wild"),r+="/(.*)";else if(a===":"){let l=n.indexOf("?",1),d=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:d>=0?d:n.length)),r+=l>=0&&d<0?"(?:/([^/]+?))?":"/([^/]+?)",d>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(d))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}i(Zo,"parseRoute");var kt=class kt extends fe{constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),r=this._find(o);r.handlers.forEach(n=>{n(r.params,o)})})}get(e,t){let{keys:o,pattern:r}=Zo(e);this.m_routes.push({keys:o,pattern:r,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let r=this._find(e);if(!r||r.handlers.length==0){console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"});return}if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers.forEach(n=>{n(r.params,e)})}_find(e){let t=[],o={},r=[];for(let n of this.m_routes)if(n.keys)if(n.keys.length>0){if(t=n.pattern.exec(e),t===null)continue;for(let a=0;a<n.keys.length;)o[n.keys[a]]=t[++a];r=[...r,n.handler]}else n.pattern.test(e)&&(r=[...r,n.handler]);else{if(t=n.pattern.exec(e),!t)continue;if(t.groups)for(let a in t.groups)o[a]=t.groups[a];r=[...r,n.handler]}return{params:o,handlers:r}}};i(kt,"Router");var oo=kt;var ro="http://www.w3.org/2000/svg";function $o(s){return s*Math.PI/180}i($o,"d2r");function no(s,e,t,o){let r=$o(o);return{x:s+t*Math.cos(r),y:e+t*Math.sin(r)}}i(no,"p2c");function P(s){return Math.round(s*1e3)/1e3}i(P,"num");function Ct(s,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?P(t):t),String.raw(s,...e)}i(Ct,"clean");var Pt=class Pt{constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(U(t)){let r=t+"";Xt(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e)if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e)}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){return this.setAttr("transform",e),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return ot(this._dom,e,t,o),this}};i(Pt,"SvgItem");var oe=Pt,Dt=class Dt extends oe{constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}moveTo(e,t){return this._path+=Ct`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=Ct`L${e},${t}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n){let a=no(e,t,o,r-90),l=no(e,t,o,n-90),d=n-r<=180?"0":"1";return this._path+=Ct`M${a.x},${a.y}A${o},${o} 0 ${d} 1 ${l.x},${l.y}`,this._update()}};i(Dt,"SvgPath");var At=Dt,Tt=class Tt extends oe{constructor(e,t,o){super("text"),this.setAttr("x",P(e)+""),this.setAttr("y",P(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};i(Tt,"SvgText");var It=Tt,Lt=class Lt extends oe{constructor(e){super(e)}};i(Lt,"SvgShape");var rt=Lt,we=class we extends oe{constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+we.g_id,we.g_id++,this.setAttr("id",this._id),this.setAttr("x1",T(e)?e:P(e)+""),this.setAttr("x2",T(o)?o:P(o)+""),this.setAttr("y1",T(t)?t:P(t)+""),this.setAttr("y2",T(r)?r:P(r)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};i(we,"SvgGradient"),we.g_id=1;var Mt=we,it=class it extends oe{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}path(){let e=new At;return this.append(e)}text(e,t,o){let r=new It(e,t,o);return this.append(r)}ellipse(e,t,o,r=o){let n=new rt("ellipse");return n.setAttr("cx",P(e)+""),n.setAttr("cy",P(t)+""),n.setAttr("rx",P(o)+""),n.setAttr("ry",P(r)+""),this.append(n)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new rt("rect");return n.setAttr("x",P(e)+""),n.setAttr("y",P(t)+""),n.setAttr("width",P(o)+""),n.setAttr("height",P(r)+""),this.append(n)}group(){let e=new it;return this.append(e)}linear_gradient(e,t,o,r){let n=new Mt(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};i(it,"SvgGroup");var nt=it,Ge=class Ge extends nt{constructor(){super()}addClip(e,t,o,r){let n="c-"+Ge.g_clip_id++,a=new nt("clipPath");return a.setAttr("id",n),a.rect(e,t,o,r),this.append(a),n}};i(Ge,"SvgBuilder"),Ge.g_clip_id=1;var io=Ge,St=class St extends c{constructor(e){super({...e,tag:"svg",ns:ro}),this.setAttribute("xmlns",ro),e.viewbox&&this.setAttribute("viewbox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}};i(St,"SvgComponent");var so=St;var E=class extends c{};i(E,"Box"),E=p([h("x4")],E);var u=class extends E{};i(u,"HBox"),u=p([h("x4")],u);var w=class extends E{constructor(e){super(e)}};i(w,"VBox"),w=p([h("x4")],w);var K=class extends E{constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}select(e){let t=this.query(".selected");t&&t.setClass("selected",!1);let o=this._items.find(r=>r.name==e);o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&t.setClass("selected",!0))}_createPage(e){let t;return t=e.content,t==null||t.setData("stackname",e.name),t}};i(K,"StackBox"),K=p([h("x4")],K);var ao='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M299.3 244.7c6.2 6.2 6.2 16.4 0 22.6l-192 192c-6.2 6.2-16.4 6.2-22.6 0s-6.2-16.4 0-22.6L265.4 256 84.7 75.3c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0l192 192z"/></svg>';var ye=class extends u{constructor(e){var o;super(e),this.mapPropEvents(e,"click");let t=[];(o=e.items)==null||o.map((r,n)=>{t.push(new v({label:r.label,icon:r.icon,click:i(()=>{this.fire("click",{context:r.name})},"click")})),n!=e.items.length-1&&t.push(new f({iconId:ao}))}),this.setContent(t)}};i(ye,"Breadcrumbs"),ye=p([h("x4")],ye);var Bt=class Bt{constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(r=>{console.timeEnd(e),this.cache.set(e,r),this.waiters.get(e).forEach(a=>a(r))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};i(Bt,"SvgLoader");var Rt=Bt,Ot=new Rt,f=class extends c{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?Ot.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new c({tag:"img",attrs:{src:e}}))}else this.clearContent(),this.addClass("empty")}};i(f,"Icon"),f=p([h("x4")],f);var v=class extends c{constructor(e){super({...e,tag:"button",content:null}),this.mapPropEvents(e,"click"),this.addDOMEvent("click",t=>this._on_click(t)),this.setContent([new f({id:"icon",iconId:this.props.icon}),new c({id:"label",content:this.props.label})])}_on_click(e){this.fire("click",{}),e.preventDefault(),e.stopPropagation()}setText(e){this.query("#label").setContent(e)}setIcon(e){this.query("#icon").setIcon(e)}};i(v,"Button"),v=p([h("x4")],v);var q=class extends E{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[];e==null||e.forEach(o=>{if(o==="-")o=new ve;else if(T(o)){let r,n=o,[a,l]=n.split(".");switch(a){case"ok":r=g.global.ok;break;case"cancel":r=g.global.cancel;break;case"abort":r=g.global.abort;break;case"no":r=g.global.no;break;case"yes":r=g.global.yes;break;case"retry":r=g.global.retry;break}o=new v({cls:l,label:r,click:i(()=>{this.fire("btnclick",{button:n})},"click")})}t.push(o)}),super.setContent(t)}};i(q,"BtnGroup"),q=p([h("x4")],q);var Ee,x=class extends c{constructor(t){super({...t,content:null});Ke(this,Ee);this.setContent([new f({id:"icon",iconId:this.props.icon}),qe(this,Ee,new c({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){D(this,Ee).setContent(t),D(this,Ee).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};Ee=new WeakMap,i(x,"Label"),x=p([h("x4")],x);var A=class extends c{constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:y(this.dom.parentElement),this._delta={x:0,y:0};let r=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-r.left:this._delta.x=o.pageX-(r.left+r.width),this._type.includes("top")?this._delta.y=o.pageY-r.top:this._delta.y=o.pageY-(r.top+r.height)}),this.addDOMEvent("pointerup",o=>{this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),r={},n=!0;this._type.includes("top")&&(r.top=t.y,r.height=o.top+o.height-t.y,n=!1),this._type.includes("bottom")&&(r.height=t.y-o.top,n=!1),this._type.includes("left")&&(r.left=t.x,r.width=o.left+o.width-t.x),this._type.includes("right")&&(r.width=t.x-o.left),this._ref.setStyle(r);let a=this._ref.getBoundingRect();this.fire("resize",{size:n?a.width:a.height}),e.preventDefault(),e.stopPropagation()}};i(A,"CSizer"),A=p([h("x4")],A);var ke,lo=0,co=[],R=[],zt=[],I=class extends c{constructor(t){super(t);this._isopen=!1;this._isshown=!1;this._dismiss=i(t=>{R.some(r=>r.dom.contains(t.target))||(t.preventDefault(),t.stopPropagation(),this.dismiss())},"_dismiss");this.props.sizable&&this._createSizers()}displayNear(t,o="top left",r="top left",n={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._show();let a=this.getBoundingRect(),l=t.left,d=t.top;r.indexOf("right")>=0?l=t.left+t.width:r.indexOf("center")>=0&&(l=t.left+t.width/2),r.indexOf("bottom")>=0?d=t.bottom:r.indexOf("middle")>=0&&(d=t.top+t.height/2);let m="l";o.indexOf("right")>=0?l-=a.width:o.indexOf("center")>=0&&(l-=a.width/2);let b="t";o.indexOf("bottom")>=0?d-=a.height:o.indexOf("middle")>=0&&(d-=a.height/2),n&&(l+=n.x,d+=n.y),l+=document.scrollingElement.scrollLeft,d+=document.scrollingElement.scrollTop,this.displayAt(l,d)}displayCenter(){this.displayNear(new N(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(t,o){this.setStyle({left:t+"px",top:o+"px"}),this._show();let r=this.getBoundingRect(),n=window.innerWidth-16,a=window.innerHeight-16;r.right>n&&this.setStyleValue("left",n-r.width),r.bottom>a&&this.setStyleValue("top",a-r.height),this.props.movable&&(this.queryAll(".caption-element").forEach(d=>new st(d,this)),this.hasClass("popup-caption")&&new st(this,this)),this.fire("opened",{})}_show(){this.props.modal&&!this._isshown&&(this._showModalMask(),co.push(this),lo++),this._isshown=!0,this.props.autoClose&&(R.length==0&&document.addEventListener("pointerdown",this._dismiss),R.push(this),this.setData("close",this.props.autoClose===!0?B():this.props.autoClose)),zt.push(this),document.body.appendChild(this.dom),this.show()}show(t=!0){this._isopen=t,super.show(t)}isOpen(){return this._isopen}close(){document.body.removeChild(this.dom);let t=zt.indexOf(this);if(console.assert(t>=0),zt.splice(t,1),this.props.autoClose){let o=R.indexOf(this);o>=0&&(R.splice(o,1),R.length==0&&document.removeEventListener("pointerdown",this._dismiss))}if(this.props.modal){let o=co.pop();console.assert(o==this),this._updateModalMask()}this._isshown=!1,this.fire("closed",{})}dismiss(t=!1){if(R.length==0)return;let o=this.getData("close"),r=[],n=[],a=-1;t&&(a=R.indexOf(this)),R.forEach((d,m)=>{d.getData("close")==o&&m>a?r.push(d):n.push(d)});let l=r.reverse();R=n,R.length==0&&document.removeEventListener("pointerdown",this._dismiss),l.forEach(d=>d.close())}_showModalMask(){ke||(ke=new c({cls:"x4modal-mask",domEvents:{click:this._dismiss}})),ke.show(!0),document.body.insertAdjacentElement("beforeend",ke.dom)}_updateModalMask(){--lo==0?ke.show(!1):this.dom.insertAdjacentElement("beforebegin",ke.dom)}_createSizers(){this.appendContent([new A("top"),new A("bottom"),new A("left"),new A("right"),new A("top-left"),new A("bottom-left"),new A("top-right"),new A("bottom-right")])}};i(I,"Popup"),I=p([h("x4")],I);var Ht=class Ht{constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:y(e.dom.parentElement),this.delta={x:0,y:0};let r=this.ref.getBoundingRect();this.delta.x=o.pageX-r.left,this.delta.y=o.pageY-r.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),r={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};i(Ht,"CMover");var st=Ht;var po=400,re=class extends c{constructor(){super({})}};i(re,"CMenuSep"),re=p([h("x4")],re);var at=new be,G=class extends c{constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new f({id:"icon",iconId:e.icon}),new c({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{at.setTimeout("open",po,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(z);t&&t.dismiss(e)}openSub(e){let t=i(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?at.setTimeout("open",po,t):(at.clearTimeout("open"),t())}closeSub(){at.clearTimeout("open")}};i(G,"CMenuItem"),G=p([h("x4")],G);var z=class extends I{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new re:T(r)?new G({text:r,click:null,cls:"title"}):r instanceof c?r:new G(r));this.setContent(t)}};i(z,"Menu"),z=p([h("x4")],z);var ho='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var uo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var Ce=class extends w{constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?ge(e.date):new Date,this._update()}_update(){let e=ge(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=ge(e),r=J(this.m_date),n=J(new Date),a=ge(this.m_date);a.setDate(1),a.setMonth(a.getMonth()+1),a.setDate(0);let l=J(a),d=[],m=new u({cls:"month-sel",content:[new x({cls:"month",text:F(this.m_date,"O"),dom_events:{click:i(()=>this._choose("month"),"click")}}),new x({cls:"year",text:F(this.m_date,"Y"),dom_events:{click:i(()=>this._choose("year"),"click")}}),new ve,new v({icon:ho,click:i(()=>this._next(!1),"click")}),new v({icon:mo,click:i(()=>this.setDate(new Date),"click"),tooltip:g.global.today}),new v({icon:uo,click:i(()=>this._next(!0),"click")})]});d.push(m);let b=[];b.push(new u({cls:"weeknum cell"}));for(let _=0;_<7;_++)b.push(new x({cls:"cell",text:g.global.day_short[(_+1)%7]}));d.push(new u({cls:"week header",content:b}));let M=this.m_date.getMonth(),C=!0;for(;J(o)<=l;){let _=[new u({cls:"weeknum cell",content:new c({tag:"span",content:F(o,"w")})})];for(let Ve=0;Ve<7;Ve++){let $="cell day";J(o)==r&&($+=" selection"),J(o)==n&&($+=" today"),o.getMonth()!=M&&($+=" out");let X=i(We=>new u({cls:$,flex:1,content:new c({cls:"text",content:Ze(`<span>${F(We,"d")}</span>`)}),dom_events:{click:i(()=>this.select(We),"click")}}),"mkItem");_.push(X(ge(o))),o.setDate(o.getDate()+1),C=!1}d.push(new u({cls:"week",flex:1,content:_}))}this.setContent(d)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var n,a,l,d;let t=[];if(e=="month")for(let m=0;m<12;m++)t.push({text:g.global.month_long[m],click:i(()=>{this.m_date.setMonth(m),this._update()},"click")});else if(e=="year"){let m=(a=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?a:1900,b=(d=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?d:2037;for(let M=b;M>=m;M--)t.push({text:""+M,click:i(()=>{this.m_date.setFullYear(M),this._update()},"click")})}let o=new z({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};i(Ce,"Calendar"),Ce=p([h("x4")],Ce);var k=class extends c{constructor(e){var t;switch(super({tag:"input",...e}),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value+"");break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1);break}}}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e){this.setValue(e+"")}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}queryInterface(e){return e=="form-element"?{getRawValue:i(()=>this.getValue(),"getRawValue"),setRawValue:i(o=>{this.setValue(o)},"setRawValue")}:super.queryInterface(e)}};i(k,"Input"),k=p([h("x4")],k);var xo='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0D%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var Ae=class extends c{constructor(e){super(e);let t=B();this.mapPropEvents(e,"change"),this.setContent([new c({cls:"inner",content:[this._input=new k({type:"checkbox",id:t,checked:e.checked,dom_events:{change:i(()=>this._on_change(),"change")}})]}),new x({tag:"label",text:e.label,labelFor:t,id:void 0})]),Ot.load(xo).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)})}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.dom.checked}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};i(Ae,"Checkbox"),Ae=p([h("x4")],Ae);var bo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var ne=class extends u{constructor(e){super(e);let t,o;this.setContent([t=new c({cls:"swatch"}),o=new k({type:"text",value:"",spellcheck:!1}),$e("eyedropper")?new v({icon:bo,click:i(()=>{new window.EyeDropper().open().then(l=>{n=new L(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let a=o.getValue(),l=new L(a);l.isInvalid()||(n=l,r(n))});let r=i(a=>{t.setStyleValue("backgroundColor",a.toRgbString(!1)),o.setValue(a.toRgbString(!1))},"updateColor"),n;e.color instanceof L?n=e.color:n=new L(e.color),r(n)}};i(ne,"ColorInput"),ne["$cls-ns"]="x4",ne=p([h("x4")],ne);var ie=class extends E{constructor(t,o){super(t);this.mdown=!1;this.hsv={hue:1,saturation:1,value:1,alpha:1};this.setContent([this.color=new c({cls:"overlay"}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new c({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new c({cls:"thumb"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup"),created:i(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width,l=S(t.clientY-o.top,0,o.height)/o.height;this.hsv.saturation=n,this.hsv.value=1-l,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateThumbMarker(){let t=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*t.width+"px",bottom:this.hsv.value*t.height+"px"})}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,1,1,1),this.color.setStyleValue("backgroundColor",o.toRgbString(!1))}move(t,o){switch(t){case"saturation":{this.hsv.saturation+=o,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=o,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};i(ie,"Saturation"),ie=p([h("x4")],ie);var se=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this.mousedown(r),"pointerdown"),pointermove:i(r=>this.mousemove(r),"pointermove"),pointerup:i(r=>this.mouseup(r),"pointerup")}),this.updateHue(o)}mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.hue=n,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateHue(t){this.hsv.hue=t.hue,this.thumb.setStyleValue("left",t.hue*100+"%")}move(t){this.hsv.hue+=t,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};i(se,"HueSlider"),se=p([h("x4")],se);var ae=class extends E{constructor(t,o){super(t);this.hsv={hue:1,saturation:1,value:1,alpha:1};this.mdown=!1;this.setContent([new c({cls:"overlay checkers"}),this.color=new c({cls:"overlay color"}),this.thumb=new c({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:i(r=>this._on_mousedown(r),"pointerdown"),pointermove:i(r=>this._on_mousemove(r),"pointermove"),pointerup:i(r=>this._on_mouseup(r),"pointerup")}),this.updateAlpha(),this.updateBaseColor(o)}_on_mousedown(t){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this.mdown){let o=this.irect,n=S(t.clientX-o.left,0,o.width)/o.width;this.hsv.alpha=n,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(t){this.mdown&&(this.releaseCapture(t.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(t){let o=new L(0,0,0);o.setHsv(t.hue,t.saturation,t.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${o.toRgbString(!1)})`)}setColor(t){this.hsv=t,this.updateBaseColor(t),this.updateAlpha()}move(t){this.hsv.alpha+=t,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};i(ae,"AlphaSlider"),ae=p([h("x4")],ae);var Ie=class extends w{constructor(e){super(e),e.color instanceof L?this._base=e.color:this._base=new L(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new ie({},t),new u({cls:"body",content:[new w({cls:"x4flex",content:[this._hue=new se({},t),this._alpha=new ae({},t)]}),new E({cls:"swatch",content:[new c({cls:"overlay checkers"}),this._swatch=new c({cls:"overlay"})]})]})]),this._sat.on("sat_change",r=>{t.saturation=r.saturation,t.value=r.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",r=>{t.hue=r.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",r=>{t.alpha=r.alpha,o()});let o=i(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");$e("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(a=>{t=new L(a.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",r=>this._onkey(r)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};i(Ie,"ColorPicker"),Ie=p([h("x4")],Ie);var le=class extends c{constructor(e){super(e)}};i(le,"Viewport"),le=p([h("x4")],le);var Q=class extends c{constructor(e){super(e),this.setContent(new le({}))}getViewport(){return this.firstChild()}};i(Q,"ScrollView"),Q=p([h("x4")],Q);var go=(r=>(r[r.first=0]="first",r[r.prev=1]="prev",r[r.next=2]="next",r[r.last=3]="last",r))(go||{}),W=class extends c{constructor(t){super({...t});this.preventFocus=!1;this.setAttribute("tabindex",0);let o=new Q({cls:"body"});this._view=o.getViewport(),this.setContent([o]),this.setDOMEvents({click:i(r=>this._on_click(r),"click"),keydown:i(r=>this._on_key(r),"keydown"),dblclick:i(r=>this._on_click(r),"dblclick"),contextmenu:i(r=>this._on_ctx_menu(r),"contextmenu")}),t.items&&this.setItems(t.items)}_on_key(t){if(!this.isDisabled()){switch(t.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}default:return}t.preventDefault(),t.stopPropagation()}}navigate(t){this._selitem||(t==2?t=0:t=3);let o=i((r,n)=>{for(;r&&!r.isVisible();)r=n?r.nextElement():r.prevElement();return r},"next_visible");if(t==0||t==3){let r=t==0?this._view.firstChild():this._view.lastChild();if(r=o(r,t==0),r){let n=r.getData("id");return this._selectItem(n,r),!0}}else{let r=t==2?this._selitem.nextElement():this._selitem.prevElement();if(r=o(r,t==2),r){let n=r.getData("id");return this._selectItem(n,r),!0}}return!1}_on_click(t){t.stopImmediatePropagation(),t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id"),a={context:n};t.type=="click"?this.fire("click",a):this.fire("dblClick",a),a.defaultPrevented||this._selectItem(n,r);return}o=o.parentElement}this.clearSelection()}_on_ctx_menu(t){t.preventDefault();let o=t.target;for(;o&&o!=this.dom;){let r=y(o);if(r&&r.hasClass("x4item")){let n=r.getData("id");this._selectItem(n,r),this.fire("contextMenu",{uievent:t,context:n});return}o=o.parentElement}this.fire("contextMenu",{uievent:t,context:null})}_selectItem(t,o){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=o,this._selection=t,o&&(o.addClass("selected"),o.scrollIntoView({behavior:"smooth",block:"nearest"}));let r=this._findItem(t);this.fire("selectionChange",{selection:r})}_findItem(t){return this._items.find(o=>o.id==t)}_findItemIndex(t){return this._items.findIndex(o=>o.id==t)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0})}setItems(t){if(this.clearSelection(),this._view.clearContent(),this._items=t,t){let o=t.map(r=>this.renderItem(r));this._view.setContent(o)}}renderItem(t){var n;let r=((n=this.props.renderer)!=null?n:this.defaultRenderer)(t);return r.addClass("x4item"),r.setData("id",t.id+""),r}defaultRenderer(t){return new u({cls:t.cls,content:new x({icon:t.iconId,text:t.text})})}filter(t){let o=this._view.enumChildComponents(!1);if(!t)o.forEach(r=>r.show(!0));else{let r=this._items.filter(n=>n.text.includes(t)).map(n=>n.id+"");o.forEach(n=>{n.show(r.includes(n.getData("id")))})}}appendItem(t,o=!1,r=!0){r&&this.clearSelection();let n=this.renderItem(t);o?(this._items.unshift(t),this._view.prependContent(n)):(this._items.push(t),this._view.appendContent(n)),r&&this._selectItem(t.id,n)}updateItem(t,o){var l;let r=this._findItemIndex(t);if(r<0)return;let n=!1;this._selection&&this._selection===t&&(n=!0),this._items[r]=o;let a=(l=this.query(`[data-id="${o.id}"]`))==null?void 0:l.dom;if(a){let d=this.renderItem(o);this._view.dom.replaceChild(d.dom,a),n&&this._selectItem(o.id,d)}}};i(W,"Listbox"),W=p([h("x4")],W);var fo='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var ce=class extends I{constructor(e,t){super(e),this._list=new W({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};i(ce,"Dropdown"),ce=p([h("x4")],ce);var Me=class extends c{constructor(t){super(t);this._prevent_close=!1;let o=B();this.setContent([new u({id:"label",content:new x({tag:"label",text:t.label,labelFor:o,width:t.labelWidth})}),this._edit=new u({id:"edit",content:[this._input=new k({type:"text",value:"",readonly:t.readonly}),this._button=new v({icon:fo})]})]),this._dropdown=new ce({items:t.items}),this._dropdown.on("selectionChange",r=>{let n=r.selection;this._input.setValue(n?n.text:""),this._prevent_close||this._dropdown.show(!1)}),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",r=>this._on_key(r)),this.setDOMEvents({focusout:i(()=>this._on_focusout(),"focusout"),click:i(()=>this._on_click(),"click")})}_on_key(t){switch(t.key){case"Enter":case"Escape":{this._dropdown.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._dropdown.isOpen()?this._dropdown.getList().navigate(2):this.showDropDown(),this._prevent_close=!1;break;default:return}t.preventDefault(),t.stopPropagation()}_on_input(){this._dropdown.isOpen()||this.showDropDown(),this._dropdown.getList().filter(this._input.getValue())}_on_focusout(){this._dropdown.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let t=this._edit.getBoundingRect();this._dropdown.setStyleValue("width",t.width+"px"),this._dropdown.displayNear(t,"top left","bottom left",{x:0,y:6})}};i(Me,"Combobox"),Me=p([h("x4")],Me);var vo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Y=class extends I{constructor(e){super(e),this.appendContent([new u({cls:"caption",content:[new x({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new v({id:"closebox",icon:vo,click:i(()=>{this.close()},"click")}):null]}),e.form,new q({id:"btnbar",reverse:!0,items:e.buttons,btnclick:i(t=>{this.fire("btnclick",t)},"btnclick")})])}display(){super.displayCenter()}close(){this.fire("close",{}),super.close()}};i(Y,"Dialog"),Y=p([h("x4")],Y);var j=class extends E{setValues(e){let t=this.queryAll("input[name]");console.log(t)}getValues(){return{}}};i(j,"Form"),j=p([h("x4")],j);var Pe=class extends u{constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new x({cls:"cell",text:o.title,icon:o.iconId}),n=new A("right");return o.width>0?(r.setStyleValue("width",o.width+"px"),r.setInternalData("width",o.width)):o.width<0?r.setInternalData("flex",-o.width):r.setInternalData("width",0),n.addDOMEvent("dblclick",a=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",a=>{r.setInternalData("flex",0),r.setInternalData("width",a.size),this._calc_sizes()}),r.appendContent(n),r.setInternalData("data",o),r}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new u({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let d=l.getInternalData("flex");if(d)e+=d;else{let m=l.getInternalData("width");if(m==0){let b=l.getBoundingRect();m=Math.ceil(b.width)+2,l.setInternalData("width",m)}t+=m}});let r=this.getBoundingRect().width-t,n=Math.ceil(r/e);console.log("filled",t),console.log("count",e),console.log("rest",r),console.log("unit",n);let a=0;this._els.forEach(l=>{let d=0,m=l.getInternalData("flex");m?(d=Math.min(n*m,r),r-=d):d=l.getInternalData("width"),l.setWidth(d),a+=d}),this._vwp.setWidth(a)}_on_resize(){this._calc_sizes()}};i(Pe,"Header"),Pe=p([h("x4")],Pe);var De=class extends c{constructor(e){var t;super(e),this._img=new c({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src)}setImage(e){this._img.setAttribute("src",e)}};i(De,"Image"),De=p([h("x4")],De);var Te=class extends c{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),e.text&&this.setContent(e.text),this.addDOMEvent("click",t=>this._on_click(t))}setText(e){this.setContent(e)}_on_click(e){let t={context:this.props.href};this.fire("click",t),t.preventDefault&&(e.preventDefault(),e.stopPropagation())}};i(Te,"Link"),Te=p([h("x4")],Te);var _o='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var de=class extends Y{constructor(e){super(e)}setText(e){this.m_label.setText(e)}static show(e){let t=new de({modal:!0,title:g.global.error,movable:!0,form:new j({content:[new u({content:[new f({iconId:_o}),new x({text:e})]})]}),buttons:["ok.outline","cancel.outline"]});return t.on("btnclick",o=>{jt(()=>t.close())}),t.display(),t}};i(de,"MessageBox"),de=p([h("x4")],de);var wo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var yo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Eo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var ko='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Le=class extends I{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=Eo,this.addClass("")):e.mode=="danger"?t=yo:t=wo),this.addClass(e.mode);let o=new f({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new u({content:[o,new w({cls:"body",content:[new x({cls:"title",text:e.title}),new x({cls:"text",text:e.text})]}),new v({cls:"outline",icon:ko,click:i(()=>{this.close()},"click")})]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new N(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};i(Le,"Notification"),Le=p([h("x4")],Le);var Se=class extends w{constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:w;super.setContent([this._title=new x({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};i(Se,"Panel"),Se=p([h("x4")],Se);var Re=class extends c{constructor(e){super(e),this.setContent(this._bar=new c({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};i(Re,"Progress"),Re=p([h("x4")],Re);var Co='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var Oe=class extends u{constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var r,n;let e=this.props,t=(r=e.icon)!=null?r:Co,o=(n=e.value)!=null?n:0;this.m_input=new k({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",a=>this._on_click(a)),this.m_els=[];for(let a=0;a<e.steps;a++){let l="item";a+1<=o&&(l+=" checked");let d=new f({cls:l,iconId:t});d.setInternalData("value",a),this.m_els.push(d)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=y(e.target);t=t.parentElement(f),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};i(Oe,"Rating"),Oe=p([h("x4")],Oe);var Be=class extends c{constructor(t){super(t);this._mdown=!1;this._irect=null;this._thumb=null;this._bar=null;this._range=null;this.setContent([new u({cls:"track",content:[this._bar=new c({cls:"bar"}),this._thumb=new c({cls:"thumb"})]}),this._range=new k({type:"range",hidden:!0,value:t.value,min:t.min,max:t.max,step:t.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:i(o=>this._on_mousedown(o),"pointerdown"),pointermove:i(o=>this._on_mousemove(o),"pointermove"),pointerup:i(o=>this._on_mouseup(o),"pointerup"),keydown:i(o=>this._on_key(o),"keydown")}),this._range.addDOMEvent("change",o=>{})}_on_mousedown(t){t.stopPropagation(),t.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(t.pointerId)}_on_mousemove(t){if(this._mdown){let o=t.pageX-this._irect.left;o<0?o=0:o>this._irect.width&&(o=this._irect.width);let r=o/this._irect.width*100;this._range.setNumValue(r),this._update()}}_update(){let t=this._range.getNumValue(),o=t/(this.props.max-this.props.min)*100;this._thumb.setStyleValue("left",o+"%"),this._bar.setStyleValue("width",o+"%"),this.fire("change",{value:t})}_on_mouseup(t){this._mdown&&(this.releaseCapture(t.pointerId),this._mdown=!1)}_on_key(t){var n;console.log(t.key);let o=(n=this.props.step)!=null?n:1,r=0;switch(t.key){case"ArrowRight":case"ArrowUp":r=o;break;case"ArrowLeft":case"ArrowDown":r=-o;break}r&&(t.ctrlKey&&(r*=10),this._range.setNumValue(this._range.getNumValue()+r),this._update())}};i(Be,"Slider"),Be=p([h("x4")],Be);var ze=class extends u{constructor(e){super(e);let t=B();this.setContent([new c({cls:"switch",content:[new k({type:"checkbox",id:t,checked:e.checked}),new c({cls:"track"}),new c({cls:"thumb"})]}),new x({tag:"label",text:e.label,labelFor:t})])}};i(ze,"Switch"),ze=p([h("x4")],ze);var pe=class extends v{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};i(pe,"CTab"),pe=p([h("x4")],pe);var he=class extends u{constructor(e,t){super(e);let o=t.map(r=>new pe({click:i(n=>this._on_click(n),"click")},r));this.mapPropEvents(e,"click"),this.setContent(o)}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selection=e,this._selitem&&this._selitem.setClass("selected",!0)}};i(he,"CTabList"),he=p([h("x4")],he);var He=class extends w{constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.tab}));this.setContent([this._list=new he({click:i(r=>this._onclick(r),"click")},e.items),this._stack=new K({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}};i(He,"Tabs"),He=p([h("x4")],He);var Ne=class extends w{constructor(e){super(e),this.setContent([new x({text:e.label}),this._input=new c({tag:"textarea"})]),this._input.setAttribute("name",e.name),this._input.setAttribute("value",e.value+""),e.resize||this._input.setAttribute("resize",!1)}};i(Ne,"TextArea"),Ne=p([h("x4")],Ne);var Fe=class extends u{constructor(e){var o,r;super(e),e.inputId||(e.inputId=B()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new u({id:"label",width:e.labelWidth,content:[new x({tag:"label",text:e.label,labelFor:e.inputId})]}),new u({id:"edit",content:[new k({type:(r=e.type)!=null?r:"text",readonly:e.readonly,value:e.value,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder}),...t]})])}};i(Fe,"TextEdit"),Fe=p([h("x4")],Fe);var Ao='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"> <!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M256 32a224 224 0 1 1 0 448 224 224 0 1 1 0-448zm0 480A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 352v32h16 96 16V352H304 272V240 224H256 216 200v32h16 24v96H208 192zm88-168V136H232v48h48z"/></svg>';var lt=null,Qe=null,Io=new be;function sh(){document.addEventListener("mouseenter",s=>{if(s.target===document)return;let e=to(s.target),t=e.getAttribute("tooltip");if(t){lt=s.target;let o=e.getBoundingRect();mr(t,o,{x:s.pageX,y:s.pageY})}},!0),document.addEventListener("mouseleave",s=>{lt&&s.target==lt&&(lt=null,ur())},!0)}i(sh,"initTooltips");function mr(s,e,t){Qe||(Qe=new me({})),Io.setTimeout(null,300,()=>{Qe.setText(Ze(s)),Qe.displayAt(t.x,t.y)})}i(mr,"showTT");function ur(){Qe.show(!1),Io.clearTimeout(null)}i(ur,"closeTT");var me=class extends I{constructor(e){super(e),this.setContent(new u({content:[new f({iconId:Ao}),new c({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};i(me,"Tooltip"),me=p([h("x4")],me);var Mo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var br=(m=>(m[m.first=0]="first",m[m.prev=1]="prev",m[m.next=2]="next",m[m.last=3]="last",m[m.parent=4]="parent",m[m.child=5]="child",m[m.expand=6]="expand",m[m.collapse=7]="collapse",m[m.toggle=8]="toggle",m))(br||{}),Z=class extends E{constructor(e,t){super({...e}),this._item=t,t?(this._label=new u({cls:"label item",content:[this._icon=new f({iconId:t.children?Mo:t.iconId}),new x({tag:"span",cls:"",text:t.text})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new w({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new w({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new Z({},o));this._childs.setContent(t)}else this._childs.clearContent()}};i(Z,"CTreeViewItem"),Z=p([h("x4")],Z);var Ue=class extends c{constructor(e){super(e),e.items&&this.setItems(e.items),this.setAttribute("tabindex",0),this.setDOMEvents({click:i(t=>this._onclick(t),"click"),keydown:i(t=>this._onkey(t),"keydown")})}setItems(e){this._items=e;let t=new Z({cls:"root"},null);t.setItems(e),this.setContent(t)}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=y(t);if(o&&o.hasClass("item")){let r=o.getData("id");this._selectItem(r,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var r;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(r=this._selitem)==null?void 0:r.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let n=this._flattenOpenItems(),a=n.findIndex(d=>this._selection==d.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(a>=0){if(e==1)a>0&&(l=n[a-1].id);else if(e==2)a<n.length-1&&(l=n[a+1].id);else if(e==4){let d=n[a].level;for(;a>0;)if(a--,n[a].level<d){l=n[a].id;break}}}if(l){let d=this.query(`[data-id="${l}"]`);return this._selectItem(l,d),!0}}return!1}_flattenOpenItems(){let e=[],t=i((o,r)=>{e.push({id:o.id+"",level:r}),o.children&&o.open&&o.children.forEach(n=>t(n,r+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=i(o=>{e.push(o),o.children&&o.children.forEach(r=>t(r))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("change",{selection:o})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("change",{selection:void 0})}};i(Ue,"Treeview"),Ue=p([h("x4")],Ue);export{E as Box,ye as Breadcrumbs,q as BtnGroup,v as Button,A as CSizer,Ce as Calendar,Ae as Checkbox,L as Color,ne as ColorInput,Ie as ColorPicker,Me as Combobox,c as Component,$t as ComputedStyle,Je as CoreElement,Y as Dialog,fe as EventSource,ve as Flex,j as Form,u as HBox,Pe as Header,f as Icon,De as Image,k as Input,x as Label,Te as Link,W as Listbox,z as Menu,de as MessageBox,Le as Notification,Se as Panel,I as Popup,Re as Progress,Oe as Rating,N as Rect,oo as Router,ie as Saturation,Q as ScrollView,Be as Slider,K as StackBox,Zt as Stylesheet,io as SvgBuilder,so as SvgComponent,Mt as SvgGradient,nt as SvgGroup,At as SvgPath,rt as SvgShape,It as SvgText,ze as Switch,He as Tabs,Ne as TextArea,Fe as TextEdit,be as Timer,Ue as Treeview,xe as UnsafeHtml,w as VBox,le as Viewport,Ar as _date_set_locale,g as _tr,ot as addEvent,Gt as addTranslation,jt as asap,Sr as beep,Lr as calcAge,Cr as camelCase,S as clamp,h as class_ns,y as componentFromDOM,Kt as createLanguage,Yt as date_calc_weeknum,ge as date_clone,Mr as date_diff,Ir as date_format,J as date_hash,Dr as date_sql_utc,Pr as date_to_sql,Qo as dispatchEvent,ln as dragManager,F as formatIntlDate,vr as getAvailableLanguages,fr as getCurrentLanguage,sh as initTooltips,dt as isArray,$e as isFeatureAvailable,Er as isFunction,qt as isLanguage,U as isNumber,T as isString,Xt as isUnitLess,go as kbNav,br as kbTreeNav,B as makeUniqueComponentId,H as pad,Tr as parseIntlDate,kr as pascalCase,zo as selectLanguage,ct as sprintf,Ot as svgLoader,Ko as unbubbleEvents,et as unitless,Ze as unsafeHtml,to as wrapDOM,Xe as x4_class_ns_sym};
|
|
1
|
+
var Kt=Object.defineProperty;var Rr=Object.getOwnPropertyDescriptor;var Vo=a=>{throw TypeError(a)};var Fr=(a,e,t)=>e in a?Kt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e)=>Kt(a,"name",{value:e,configurable:!0});var p=(a,e,t,o)=>{for(var r=o>1?void 0:o?Rr(e,t):e,n=a.length-1,i;n>=0;n--)(i=a[n])&&(r=(o?i(e,t,r):i(r))||r);return o&&r&&Kt(e,t,r),r};var L=(a,e,t)=>Fr(a,typeof e!="symbol"?e+"":e,t),Ho=(a,e,t)=>e.has(a)||Vo("Cannot "+t);var M=(a,e,t)=>(Ho(a,e,"read from private field"),t?t.call(a):e.get(a)),j=(a,e,t)=>e.has(a)?Vo("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),Y=(a,e,t,o)=>(Ho(a,e,"write to private field"),o?o.call(a,t):e.set(a,t),t);var No=Symbol("i18n"),Pe={};function Uo(a,e){Pe[a]={name:a,base:e,src_translations:{},translations:{}}}s(Uo,"createLanguage");function qo(a){return Pe[a]!==void 0}s(qo,"isLanguage");function Ko(a,...e){if(!qo(a))return;let t=Pe[a];e.forEach(o=>{Go(t.src_translations,o)}),t.translations=Wo(t.src_translations,t.base,!0)}s(Ko,"addTranslation");function Go(a,e){for(let t in e){let o=e[t];typeof o=="string"?a[t]=o:Array.isArray(o)&&(!a[t]||!Array.isArray(a[t]))?a[t]=[...o]:!a[t]||typeof a[t]!="object"?a[t]={...o}:Go(a[t],e[t])}}s(Go,"_patch");function Wo(a,e,t){let o={};for(let r in a)typeof a[r]!="string"&&!Array.isArray(a[r])?o[r]=Wo(a[r],e,!1):o[r]=a[r];return Or(o,e,t)}s(Wo,"_proxyfy");function Or(a,e,t){return new Proxy(a,{get:s((o,r)=>{t?_t=[r]:_t.push(r);let n=o[r];return n===void 0&&(e&&(n=zr(e)),n===void 0&&console.error("I18N error: unable to find","_tr."+_t.join("."))),n},"get")})}s(Or,"_mk_proxy");var _t;function zr(a){for(;a;){let e=Pe[a],t=e.translations,o;for(let r of _t){if(o=t[r],o===void 0)break;t=o}if(o!==void 0)return t;a=e.base}}s(zr,"_findBaseTrans");var _={};function Br(a){if(qo(a))return _=Pe[a].translations,_[No]=a,_}s(Br,"selectLanguage");function An(){return _[No]}s(An,"getCurrentLanguage");function Mn(){return Object.keys(Pe)}s(Mn,"getAvailableLanguages");var Vr={global:{ok:"OK",cancel:"Annuler",ignore:"Ignorer",yes:"Oui",no:"Non",abort:"Abandonner",retry:"Réessayer",error:"Erreur",today:"Aujourd'hui",open:"Ouvrir",new:"Nouveau",delete:"Supprimer",close:"Fermer",save:"Enregistrer",search:"Rechercher",search_tip:"Saisissez le texte à rechercher. <b>Enter</b> pour lancer la recherche. <b>Esc</b> pour annuler.",required_field:"information requise",invalid_format:"format invalide",invalid_email:"adresse mail invalide",invalid_number:"valeur numérique invalide",diff_date_seconds:"{0} secondes",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} heures",invalid_date:"Date non reconnue ({0})",empty_list:"Liste vide",date_input_formats:"d/m/y|d.m.y|d m y|d-m-y|dmy",date_format:"D/M/Y",day_short:["dim","lun","mar","mer","jeu","ven","sam"],day_long:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],month_short:["jan","fév","mar","avr","mai","jun","jui","aoû","sep","oct","nov","déc"],month_long:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],property:"Propriété",value:"Valeur",err_403:"Vous n'avez pas les droits suffisants pour effectuer cette action",copy:"Copier",cut:"Couper",paste:"Coller",filedrop:"Déposez un fichier",keyboard:{next:"Suivant",numeric:"123",alpha:"Abc"}}},Hr={global:{ok:"OK",cancel:"Cancel",ignore:"Ignore",yes:"Yes",no:"No",abort:"Abort",retry:"Retry",error:"Error",today:"Today",open:"Open",new:"New",delete:"Delete",close:"Close",save:"Save",search:"Search",search_tip:"Type in the text to search. <b>Enter</b> to start the search. <b>Esc</b> to cancel.",required_field:"missing information",invalid_format:"invalid format",invalid_email:"invalid email address",invalid_number:"bad numeric value",diff_date_seconds:"{0} seconds",diff_date_minutes:"{0} minutes",diff_date_hours:"{0} hours",invalid_date:"Unrecognized date({0})",empty_list:"Empty list",date_input_formats:"m/d/y|m.d.y|m d y|m-d-y|mdy",date_format:"M/D/Y",day_short:["sun","mon","tue","wed","thu","fri","sat"],day_long:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],month_short:["jan","feb","mar","apr","may","jun","jui","aug","sep","oct","nov","dec"],month_long:["january","february","march","april","mau","june","jully","august","september","october","november","december"],property:"Property",value:"Value",err_403:"You do not have sufficient rights to do that action",copy:"Copy",cut:"Cut",paste:"Paste",filedrop:"Drop a file",keyboard:{next:"Next",numeric:"123",alpha:"Abc"}}};Uo("fr",null);Ko("fr",Vr);Uo("en","fr");Ko("en",Hr);Br("fr");function D(a){return typeof a=="string"}s(D,"isString");function R(a){return typeof a=="number"&&isFinite(a)}s(R,"isNumber");function U(a){return a instanceof Array}s(U,"isArray");function Yo(a){return a instanceof Function}s(Yo,"isFunction");var Yt=class Yt extends String{constructor(e){super(e)}};s(Yt,"UnsafeHtml");var Te=Yt;function ct(a){return new Te(a)}s(ct,"unsafeHtml");function Sn(a,...e){let t=a.reduce((o,r,n)=>o+r+(e[n]||""),"");return ct(t)}s(Sn,"unsafe");function V(a,e,t){return a<e?e:a>t?t:a}s(V,"clamp");var wt=class wt{left;top;height;width;constructor(e,t,o,r){e!==void 0&&(R(e)?(this.left=e,this.top=t,this.width=o,this.height=r):Object.assign(this,e))}get right(){return this.left+this.width}get bottom(){return this.top+this.height}contains(e){return e instanceof wt?e.left>=this.left&&e.right<=this.right&&e.top>=this.top&&e.bottom<=this.bottom:e.x>=this.left&&e.x<this.right&&e.y>=this.top&&e.y<this.bottom}touches(e){return!(this.left>e.right||this.right<e.left||this.top>e.bottom||this.bottom<e.top)}normalize(){let e=this.width,t=this.height;return e<0&&(this.left+=e,this.width=-e),t<0&&(this.top+=t,this.height=-t),this}};s(wt,"Rect");var J=wt;function Ln(a,e,t=0){let o=e.width-2*t,r=e.height-2*t,n=a.width/a.height,i=o,l=o/n;l>r&&(l=r,i=r*n);let c=e.left+(e.width-i)/2,u=e.top+(e.height-l)/2;return{left:c,top:u,width:i,height:l}}s(Ln,"centerRect");function yt(a){switch(a){case"eyedropper":return"EyeDropper"in window}return!1}s(yt,"isFeatureAvailable");var Qt=class Qt{_timers;setTimeout(e,t,o){this._timers?this.clearTimeout(e):this._timers=new Map;let r=setTimeout(o,t);return this._timers.set(e,r),r}clearTimeout(e){this._timers&&this._timers.has(e)&&(clearTimeout(this._timers.get(e)),this._timers.delete(e))}setInterval(e,t,o){this._timers?this.clearInterval(e):this._timers=new Map;let r=setInterval(o,t);return this._timers.set(e,r),r}clearInterval(e){this._timers&&this._timers.has(e)&&(clearInterval(this._timers.get(e)),this._timers.delete(e))}clearAllTimeouts(){var e;(e=this._timers)==null||e.forEach(t=>{clearTimeout(t)}),this._timers=null}};s(Qt,"Timer");var Se=Qt;function he(a){return requestAnimationFrame(a)}s(he,"asap");function Rn(a,e=0){return setTimeout(a,e)}s(Rn,"oneshot");function Z(a,e,t="0"){let o;return D(a)?o=a:o=""+a,e>0?o.padEnd(e,t):o.padStart(-e,t)}s(Z,"pad");function Gt(a,...e){return a.replace(/{(\d+)}/g,function(t,o){return typeof e[o]<"u"?e[o]:t})}s(Gt,"sprintf");function Fn(a){let e=a;return e=e.replace(/([a-z])([A-Z])/g,"$1 $2"),e=e.toLowerCase(),e=e.replace(/[^- a-z0-9]+/g," "),e.indexOf(" ")<0?e:(e=e.trim(),e.replace(/ /g,"-"))}s(Fn,"pascalCase");function On(a){let e=a.toLowerCase();return e=e.replace(/[^a-zA-Z0-9]+(.)/g,(t,o)=>o.toUpperCase()),e}s(On,"camelCase");var Nr="fr-FR";function zn(a){Nr=a}s(zn,"_date_set_locale");function Bn(a,e){return X(a)}s(Bn,"date_format");function Vn(a,e,t){let r=(a.getTime()-e.getTime())/1e3;if(r<60)return Gt(_.global.diff_date_seconds,Math.round(r));let n=Math.floor(r/60);if(n<60)return Gt(_.global.diff_date_minutes,Math.round(n));let i=Math.floor(n/60);return Gt(_.global.diff_date_hours,i,n%60)}s(Vn,"date_diff");function Hn(a,e){return e?X(a,"Y-M-D H:I:S"):X(a,"Y-M-D")}s(Hn,"date_to_sql");function Nn(a){return new Date(a+" GMT")}s(Nn,"date_sql_utc");function ue(a){return a.getFullYear()<<16|a.getMonth()<<8|a.getDate()}s(ue,"date_hash");function Le(a){return new Date(a.getTime())}s(Le,"date_clone");function jo(a){let e=new Date(a.getFullYear(),0,1),t=(a.valueOf()-e.valueOf())/864e5;return Math.floor((t+e.getDay()+1)/7)}s(jo,"date_calc_weeknum");function Un(a,e=_.global.date_input_formats){var o,r,n,i,l,c;let t=e.split("|");for(let u of t){let f="";for(let b=0;b<u.length;b++){let w=u[b];w=="d"?f+="(?<day>\\d{1,2})":w=="D"?f+="(?<day>\\d{2})":w=="m"?f+="(?<month>\\d{1,2})":w=="M"?f+="(?<month>\\d{2})":w=="y"?f+="(?<year>\\d{1,4})":w=="Y"?u[b+1]=="Y"?(f+="(?<year>\\d{4})",b++):f+="(?<year>\\d{2})":w=="h"?f+="(?<hour>\\d{1,2})":w=="H"?f+="(?<hour>\\d{2})":w=="i"?f+="(?<min>\\d{1,2})":w=="I"?f+="(?<min>\\d{2})":w=="s"?f+="(?<sec>\\d{1,2})":w=="S"?f+="(?<sec>\\d{2})":w==" "?f+="\\s+":f+="\\s*\\"+w+"\\s*"}let x=new RegExp("^"+f+"$","m").exec(a);if(x){let b=new Date,w=parseInt((o=x.groups.day)!=null?o:"1"),de=parseInt((r=x.groups.month)!=null?r:"1"),pe=parseInt((n=x.groups.year)!=null?n:b.getFullYear()+""),bt=parseInt((i=x.groups.hour)!=null?i:"0"),Dr=parseInt((l=x.groups.min)!=null?l:"0"),Pr=parseInt((c=x.groups.sec)!=null?c:"0");pe>0&&pe<100&&(pe+=2e3);let vt=new Date(pe,de-1,w,bt,Dr,Pr,0),Tr=vt.getFullYear(),Sr=vt.getMonth()+1,Lr=vt.getDate();return Tr!=pe||Sr!=de||Lr!=w?null:vt}}return null}s(Un,"parseIntlDate");function X(a,e=_.global.date_format){if(!a)return"";let t={year:a.getFullYear(),month:a.getMonth()+1,day:a.getDate(),wday:a.getDay(),hours:a.getHours(),minutes:a.getMinutes(),seconds:a.getSeconds(),milli:a.getMilliseconds()},o="",r=0;for(let n of e){if(n=="{"){if(++r==1)continue}else if(n=="}"&&--r==0)continue;if(r){o+=n;continue}n=="d"?o+=t.day:n=="D"?o+=Z(t.day,-2):n=="j"?o+=_.global.day_short[t.wday]:n=="J"?o+=_.global.day_long[t.wday]:n=="w"?o+=jo(a):n=="W"?o+=Z(jo(a),-2):n=="m"?o+=t.month:n=="M"?o+=Z(t.month,-2):n=="o"?o+=_.global.month_short[t.month-1]:n=="O"?o+=_.global.month_long[t.month-1]:n=="y"||n=="Y"?o+=Z(t.year,-4):n=="a"||n=="A"?o+=t.hours<12?"am":"pm":n=="h"?o+=t.hours:n=="H"?o+=Z(t.hours,-2):n=="i"?o+=t.minutes:n=="I"?o+=Z(t.minutes,-2):n=="s"?o+=t.seconds:n=="S"?o+=Z(t.seconds,-2):n=="l"?o+=t.milli:n=="L"?o+=Z(t.milli,-3):o+=n}return o}s(X,"formatIntlDate");function qn(a,e){if(e===void 0&&(e=new Date),!a)return 0;let t=e.getFullYear()-a.getFullYear();return(e.getMonth()<a.getMonth()||e.getMonth()==a.getMonth()&&e.getDate()<a.getDate())&&t--,t}s(qn,"calcAge");function Kn(){new Audio("data:audio/wav;base64,//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihwMWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIIIhxGOBAuD7hOfBB3/94gcJ3w+o5/5eIAIAAAVwWgQAVQ2ORaIQwEMAJiDg95G4nQL7mQVWI6GwRcfsZAcsKkJvxgxEjzFUgfHoSQ9Qq7KNwqHwuB13MA4a1q/DmBrHgPcmjiGoh//EwC5nGPEmS4RcfkVKOhJf+WOgoxJclFz3kgn//dBA+ya1GhurNn8zb//9NNutNuhz31f////9vt///z+IdAEAAAK4LQIAKobHItEIYCGAExBwe8jcToF9zIKrEdDYIuP2MgOWFSE34wYiR5iqQPj0JIeoVdlG4VD4XA67mAcNa1fhzA1jwHuTRxDUQ//iYBczjHiTJcIuPyKlHQkv/LHQUYkuSi57yQT//uggfZNajQ3Vmz+Zt//+mm3Wm3Q576v////+32///5/EOgAAADVghQAAAAA//uQZAUAB1WI0PZugAAAAAoQwAAAEk3nRd2qAAAAACiDgAAAAAAABCqEEQRLCgwpBGMlJkIz8jKhGvj4k6jzRnqasNKIeoh5gI7BJaC1A1AoNBjJgbyApVS4IDlZgDU5WUAxEKDNmmALHzZp0Fkz1FMTmGFl1FMEyodIavcCAUHDWrKAIA4aa2oCgILEBupZgHvAhEBcZ6joQBxS76AgccrFlczBvKLC0QI2cBoCFvfTDAo7eoOQInqDPBtvrDEZBNYN5xwNwxQRfw8ZQ5wQVLvO8OYU+mHvFLlDh05Mdg7BT6YrRPpCBznMB2r//xKJjyyOh+cImr2/4doscwD6neZjuZR4AgAABYAAAABy1xcdQtxYBYYZdifkUDgzzXaXn98Z0oi9ILU5mBjFANmRwlVJ3/6jYDAmxaiDG3/6xjQQCCKkRb/6kg/wW+kSJ5//rLobkLSiKmqP/0ikJuDaSaSf/6JiLYLEYnW/+kXg1WRVJL/9EmQ1YZIsv/6Qzwy5qk7/+tEU0nkls3/zIUMPKNX/6yZLf+kFgAfgGyLFAUwY//uQZAUABcd5UiNPVXAAAApAAAAAE0VZQKw9ISAAACgAAAAAVQIygIElVrFkBS+Jhi+EAuu+lKAkYUEIsmEAEoMeDmCETMvfSHTGkF5RWH7kz/ESHWPAq/kcCRhqBtMdokPdM7vil7RG98A2sc7zO6ZvTdM7pmOUAZTnJW+NXxqmd41dqJ6mLTXxrPpnV8avaIf5SvL7pndPvPpndJR9Kuu8fePvuiuhorgWjp7Mf/PRjxcFCPDkW31srioCExivv9lcwKEaHsf/7ow2Fl1T/9RkXgEhYElAoCLFtMArxwivDJJ+bR1HTKJdlEoTELCIqgEwVGSQ+hIm0NbK8WXcTEI0UPoa2NbG4y2K00JEWbZavJXkYaqo9CRHS55FcZTjKEk3NKoCYUnSQ0rWxrZbFKbKIhOKPZe1cJKzZSaQrIyULHDZmV5K4xySsDRKWOruanGtjLJXFEmwaIbDLX0hIPBUQPVFVkQkDoUNfSoDgQGKPekoxeGzA4DUvnn4bxzcZrtJyipKfPNy5w+9lnXwgqsiyHNeSVpemw4bWb9psYeq//uQZBoABQt4yMVxYAIAAAkQoAAAHvYpL5m6AAgAACXDAAAAD59jblTirQe9upFsmZbpMudy7Lz1X1DYsxOOSWpfPqNX2WqktK0DMvuGwlbNj44TleLPQ+Gsfb+GOWOKJoIrWb3cIMeeON6lz2umTqMXV8Mj30yWPpjoSa9ujK8SyeJP5y5mOW1D6hvLepeveEAEDo0mgCRClOEgANv3B9a6fikgUSu/DmAMATrGx7nng5p5iimPNZsfQLYB2sDLIkzRKZOHGAaUyDcpFBSLG9MCQALgAIgQs2YunOszLSAyQYPVC2YdGGeHD2dTdJk1pAHGAWDjnkcLKFymS3RQZTInzySoBwMG0QueC3gMsCEYxUqlrcxK6k1LQQcsmyYeQPdC2YfuGPASCBkcVMQQqpVJshui1tkXQJQV0OXGAZMXSOEEBRirXbVRQW7ugq7IM7rPWSZyDlM3IuNEkxzCOJ0ny2ThNkyRai1b6ev//3dzNGzNb//4uAvHT5sURcZCFcuKLhOFs8mLAAEAt4UWAAIABAAAAAB4qbHo0tIjVkUU//uQZAwABfSFz3ZqQAAAAAngwAAAE1HjMp2qAAAAACZDgAAAD5UkTE1UgZEUExqYynN1qZvqIOREEFmBcJQkwdxiFtw0qEOkGYfRDifBui9MQg4QAHAqWtAWHoCxu1Yf4VfWLPIM2mHDFsbQEVGwyqQoQcwnfHeIkNt9YnkiaS1oizycqJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=").play()}s(Kn,"beep");var Wt=-1;function Gn(){if(Wt<0){let a=document.createElement("div");a.style.cssText="overflow:auto;position:absolute;top:0;width:100px;height:100px";let e=document.createElement("div");e.style.width="200px",e.style.height="200px",a.appendChild(e),document.body.appendChild(a),Wt=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return Wt}s(Gn,"getScrollbarSize");var kt=Symbol("class-ns");function h(a){return function(e){e[kt]=a}}s(h,"class_ns");function jt(a){document.body.style.cursor=a?"wait":"default"}s(jt,"setWaitCursor");function Ct(a){let e=['button:not([tabindex="-1"]):not([disabled])',"[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'];return Array.from(a.querySelectorAll(e.join(","))).filter(o=>o.offsetParent!=null)}s(Ct,"getFocusableElements");var Et=(i=>(i[i.first=0]="first",i[i.prev=1]="prev",i[i.pgdn=2]="pgdn",i[i.pgup=3]="pgup",i[i.next=4]="next",i[i.last=5]="last",i))(Et||{});var Ur=s(function(){this.propagationStopped=!0},"stopPropagation"),qr=s(function(){this.defaultPrevented=!0},"preventDefault"),$t=class $t{_source;_registry;constructor(e=null){this._source=e!=null?e:this}addListener(e,t,o=!1){this._registry||(this._registry=new Map);let r=this._registry.get(e);r||(r=[],this._registry.set(e,r));let n=t;return r.indexOf(n)==-1&&(o?r.unshift(n):r.push(n)),()=>{this.removeListener(e,t)}}removeListener(e,t){if(!this._registry)return;let o=this._registry.get(e);if(!o)return;let r=t,n=o.indexOf(r);n!==-1&&o.splice(n,1)}fire(e,t){var r;let o=(r=this._registry)==null?void 0:r.get(e);if(o&&o.length){let n=t;if(n||(n={}),n.source||(n.source=this._source),n.type||(n.type=e),n.preventDefault||(n.preventDefault=qr),n.stopPropagation||(n.stopPropagation=Ur),o.length==1)o[0](n);else{let i=o.slice();for(let l=0,c=i.length;l<c&&(i[l](n),!n.propagationStopped);l++);}}}};s($t,"EventSource");var me=$t;var q,K,Zt=class Zt{constructor(){j(this,q);j(this,K)}__startTimer(e,t,o,r){M(this,K)?this.__stopTimer(e):Y(this,K,new Map);let n=(o?setInterval:setTimeout)(r,t);M(this,K).set(e,()=>{(o?clearInterval:clearTimeout)(n),M(this,K).delete(e)})}__stopTimer(e){var o;let t=(o=M(this,K))==null?void 0:o.get(e);t&&t()}setTimeout(e,t,o){this.__startTimer(e,t,!1,o)}clearTimeout(e){this.__stopTimer(e)}setInterval(e,t,o){this.__startTimer(e,t,!0,o)}clearInterval(e){this.__stopTimer(e)}clearTimeouts(){for(let[e,t]of M(this,K))t();M(this,K).clear()}on(e,t){console.assert(t!=null),M(this,q)||Y(this,q,new me(this)),M(this,q).addListener(e,t)}off(e,t){console.assert(t!=null),M(this,q)&&M(this,q).removeListener(e,t)}fire(e,t){M(this,q)&&M(this,q).fire(e,t)}};q=new WeakMap,K=new WeakMap,s(Zt,"CoreElement");var ee=Zt;var It={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Zo(a){return!!It[a]}s(Zo,"isUnitLess");var te=class te{m_sheet;m_rules=new Map;constructor(){function e(t){for(let o=0;o<document.styleSheets.length;o++){let r=document.styleSheets[o];if(r.title===t)return r}}if(s(e,"getStyleSheet"),this.m_sheet=e("x4-dynamic-css"),!this.m_sheet){let t=document.createElement("style");t.setAttribute("id","x4-dynamic-css"),document.head.appendChild(t),this.m_sheet=t.sheet}}setRule(e,t){if(D(t)){let o=this.m_rules.get(e);o!==void 0?this.m_sheet.deleteRule(o):o=this.m_sheet.cssRules.length,this.m_rules.set(e,this.m_sheet.insertRule(t,o))}else{let o=1;for(let r in t){let n=r+" { ",i=t[r];for(let l in i){let c=i[l];for(let u=0;u<c.length;u++)n+=l+": "+c[u]+"; "}n+="}",this.setRule(e+"--"+o,n),o++}}}static getVar(e){return te.doc_style||(te.doc_style=getComputedStyle(document.documentElement)),e.startsWith("--")||(e="--"+e),te.doc_style.getPropertyValue(e)}};s(te,"Stylesheet"),L(te,"guid",1),L(te,"doc_style");var Qo=te,Jt=class Jt{m_style;constructor(e){this.m_style=e}value(e){return this.m_style[e]}parse(e){return parseInt(this.m_style[e])}get style(){return this.m_style}};s(Jt,"ComputedStyle");var $o=Jt;var Kr={mouseleave:1,mouseenter:1,load:1,unload:1,scroll:1,focus:1,blur:1,rowexit:1,beforeunload:1,stop:1,dragdrop:1,dragenter:1,dragexit:1,draggesture:1,dragover:1,contextmenu:1,created:2,removed:2,sizechange:2},At=new WeakMap,Xt=null,Gr=s((a,e)=>{let t=s((r,n)=>{let i=At.get(r);i&&i[n]&&r.dispatchEvent(new Event(n,{}))},"sendEvent"),o=s((r,n)=>{n&&t(r,"created");for(let i=r.firstChild;i;i=i.nextSibling)o(i,n);n||t(r,"removed")},"notify");for(let r of a)r.type=="childList"&&(r.addedNodes&&r.addedNodes.forEach(n=>{o(n,!0)}),r.removedNodes&&r.removedNodes.forEach(n=>{o(n,!1)}))},"observeMutation"),eo=null;function Wr(a){a.forEach(e=>{let t=e.target;t.offsetParent!==null&&t.dispatchEvent(new Event("resized"))})}s(Wr,"observeSize");function jr(a){let e=a.target,t=Kr[a.type]===2;for(;e;){let o=At.get(e);if(o){let r=o[a.type];if(r&&(Array.isArray(r)?r.some(n=>n(a)):r(a),a.stopPropagation||a.defaultPrevented||t))break}if(e=e.parentNode,e==document)break}}s(jr,"dispatchEvent");function Mt(a,e,t,o=!1){e=="removed"||e=="created"?Xt||(Xt=new MutationObserver(Gr),Xt.observe(document.body,{childList:!0,subtree:!0})):e=="resized"&&(eo||(eo=new ResizeObserver(Wr)),eo.observe(a));let r=At.get(a);if(r||(r={},At.set(a,r)),!r[e])r[e]=t,a.addEventListener(e,jr);else{let n=r[e];Array.isArray(n)?n.push(t):r[e]=[n,t]}}s(Mt,"addEvent");var Jo=Symbol("fragment"),Xo=Symbol("component"),Yr=/^-?\d+(\.\d*)?$/;function Qr(a){let e=[],t=Object.getPrototypeOf(a);if(t.constructor==d)return["x4-comp"];for(;t&&t.constructor!==d;){let o=t.constructor.name,r=t.constructor.hasOwnProperty(kt)?t.constructor[kt]:"";e.push(r+o.toLowerCase()),t=Object.getPrototypeOf(t)}return e}s(Qr,"genClassNames");var $r=1e3,z=s(()=>`x4-${$r++}`,"makeUniqueComponentId"),fe,d=class extends ee{constructor(t){var o,r;super();L(this,"dom");L(this,"props");L(this,"clsprefix");j(this,fe);if(this.props=t,t.existingDOM)this.dom=t.existingDOM;else{t.ns?this.dom=document.createElementNS(t.ns,(o=t.tag)!=null?o:"div"):this.dom=document.createElement((r=t.tag)!=null?r:"div"),t.attrs&&this.setAttributes(t.attrs),t.cls&&this.addClass(t.cls),t.hidden&&this.show(!1),t.flex===!0?this.addClass("x4flex"):t.flex!==void 0&&this.setStyle({flexGrow:t.flex+""}),t.id!==void 0&&this.setAttribute("id",t.id),t.width!==void 0&&this.setStyleValue("width",t.width),t.height!==void 0&&this.setStyleValue("height",t.height),t.tooltip&&this.setAttribute("tooltip",t.tooltip),t.style&&this.setStyle(t.style),t.content&&this.setContent(t.content),t.dom_events&&this.setDOMEvents(t.dom_events);let n=Qr(this);this.dom.classList.add(...n),t.disabled&&this.addDOMEvent("created",()=>{this.enable(!1)})}this.dom[Xo]=this}hasClass(t){return this.dom.classList.contains(t)}addClass(t){if(t)if(t.indexOf(" ")>=0){t=t.trim();let o=t.split(" ");this.dom.classList.add(...o)}else this.dom.classList.add(t)}removeClass(t){if(t){if(t=="*"){this.dom.classList.value="";return}if(t.indexOf(" ")>=0){let o=t.split(" ");this.dom.classList.remove(...o)}else this.dom.classList.remove(t)}}removeClassEx(t){Array.from(this.dom.classList).forEach(r=>{r.match(t)&&this.dom.classList.remove(r)})}toggleClass(t){if(!t)return;let o=s(r=>{this.dom.classList.toggle(r)},"toggle");t.indexOf(" ")>=0?t.split(" ").forEach(o):o(t)}setClass(t,o=!0){o?this.addClass(t):this.removeClass(t)}setAttributes(t){for(let o in t)this.setAttribute(o,t[o])}setAttribute(t,o){o==null?this.dom.removeAttribute(t):this.dom.setAttribute(t,""+o)}getAttribute(t){return this.dom.getAttribute(t)}getData(t){return this.getAttribute("data-"+t)}getIntData(t){let o=parseInt(this.getAttribute("data-"+t));if(Number.isFinite(o))return o}setData(t,o){return this.setAttribute("data-"+t,o)}setInternalData(t,o){return M(this,fe)||Y(this,fe,new Map),M(this,fe).set(t,o),this}getInternalData(t){var o;return(o=M(this,fe))==null?void 0:o.get(t)}addDOMEvent(t,o,r=!1){Mt(this.dom,t,o,r)}setDOMEvents(t){for(let o in t)this.addDOMEvent(o,t[o])}mapPropEvents(t,...o){let r=t;o.forEach(n=>{r.hasOwnProperty(n)&&r[n]&&this.on(n,r[n])})}clearContent(){let t=this.dom;for(;t.firstChild;)t.removeChild(t.firstChild)}setContent(t){this.clearContent(),this.appendContent(t)}appendContent(t){let o=s((r,n)=>{if(n instanceof d)r.appendChild(n.dom);else if(n instanceof Te)r.insertAdjacentHTML("beforeend",n.toString());else if(typeof n=="string"||typeof n=="number"){let i=document.createTextNode(n.toString());r.appendChild(i)}else n&&console.warn("Unknown type to append: ",n)},"set");if(!U(t))o(this.dom,t);else if(t.length<=8)for(let r of t)o(this.dom,r);else{let r=document.createDocumentFragment();for(let n of t)o(r,n);this.dom.appendChild(r)}}prependContent(t){let o=this.dom,r=s(n=>{n instanceof d?o.insertAdjacentElement("afterbegin",n.dom):n instanceof Te?o.insertAdjacentHTML("afterbegin",n.toString()):typeof n=="string"||typeof n=="number"?o.insertAdjacentText("afterbegin",n.toString()):console.warn("Unknown type to append: ",n)},"set");if(!U(t))r(t);else{let n=document.createDocumentFragment();for(let i of t)r(i);o.insertBefore(o.firstChild,n)}}removeChild(t){this.dom.removeChild(t.dom)}queryAll(t){let o=this.dom.querySelectorAll(t),r=new Array(o.length);return o.forEach((n,i)=>r[i]=to(n)),r}query(t){let o=this.dom.querySelector(t);return P(o)}setAria(t,o){return this.setAttribute(t,o),this}setStyle(t){let o=this.dom.style;for(let r in t){let n=t[r];!It[r]&&(R(n)||Yr.test(n))&&(n+="px"),o[r]=n}return this}setStyleValue(t,o){let r=this.dom.style;if(R(o)){let n=o+"";It[t]||(n+="px"),r[t]=n}else r[t]=o;return this}getStyleValue(t){return this.dom.style[t]}setWidth(t){this.setStyleValue("width",R(t)?t+"px":t)}setHeight(t){this.setStyleValue("height",R(t)?t+"px":t)}setStyleVariable(t,o){this.dom.style.setProperty(t,o)}getStyleVariable(t){return this.getComputedStyle().getPropertyValue(t)}getComputedStyle(){return getComputedStyle(this.dom)}setCapture(t){this.dom.setPointerCapture(t)}releaseCapture(t){this.dom.releasePointerCapture(t)}getBoundingRect(){let t=this.dom.getBoundingClientRect();return new J(t.x,t.y,t.width,t.height)}focus(){return this.dom.focus(),this}hasFocus(){return document.activeElement==this.dom}scrollIntoView(t){this.dom.scrollIntoView(t)}isVisible(){return this.dom.offsetParent!==null}show(t=!0){return this.setClass("x4hidden",!t),this}hide(){return this.show(!1),this}enable(t=!0){return this.setAttribute("disabled",t?null:"true"),(this.dom instanceof HTMLInputElement||this.dom instanceof HTMLButtonElement)&&(this.dom.disabled=!t),this.enumChildNodes(!0).forEach(r=>{(r instanceof HTMLInputElement||r instanceof HTMLButtonElement)&&(r.disabled=!t)}),this}disable(){return this.enable(!1),this}isDisabled(){return this.getAttribute("disabled")}nextElement(){let t=this.dom.nextElementSibling;return P(t)}prevElement(){let t=this.dom.previousElementSibling;return P(t)}parentElement(t){return d.parentElement(this.dom,t)}static parentElement(t,o){for(;t.parentElement;){let r=P(t.parentElement);if(!o||r&&r instanceof o)return r;t=t.parentElement}return null}firstChild(){let t=this.dom.firstElementChild;return P(t)}lastChild(){let t=this.dom.lastElementChild;return P(t)}enumChildComponents(t){let o=[];return this.enumChildNodes(t).forEach(n=>{let i=P(n);i&&o.push(i)}),o}enumChildNodes(t){return Array.from(t?this.dom.querySelectorAll("*"):this.dom.children)}animate(t,o){this.dom.animate(t,o)}static createElement(t,o,...r){let n;return t==this.createFragment||t===Jo?r:(t instanceof Function?(o=o!=null?o:{},!o.children&&r&&r.length&&(o.content=r),n=new t(o!=null?o:{})):n=new d({tag:t,content:r,...o}),r&&r.length,n)}static createFragment(){return this.createElement(Jo,null)}queryInterface(t){return null}};fe=new WeakMap,s(d,"Component"),d=p([h("x4")],d);function P(a){return a?a[Xo]:null}s(P,"componentFromDOM");function to(a){let e=P(a);return e||new d({existingDOM:a})}s(to,"wrapDOM");var oo=class oo extends d{constructor(){super({})}};s(oo,"Flex");var Q=oo,ro=class ro extends d{constructor(e,t){super({width:e,cls:t})}};s(ro,"Space");var Dt=ro;function ge(a){return a.toString(16).padStart(2,"0")}s(ge,"hx");function Re(a){return Math.round(a)}s(Re,"round");var no=class no{rgb=[0,0,0,1];invalid=!1;constructor(...e){D(e[0])?this.setValue(e[0]):this.setRgb(e[0],e[1],e[2],e[3])}setValue(e){if(this.invalid=!1,e.length==4&&/#[0-9a-fA-F]{3}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16);return this.setRgb(t<<4|t,o<<4|o,r<<4|r,1)}if(e.length==7&&/#[0-9a-fA-F]{6}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),i=parseInt(e[5],16),l=parseInt(e[6],16);return this.setRgb(t<<4|o,r<<4|n,i<<4|l,1)}if(e.length==9&&/#[0-9a-fA-F]{8}/.test(e)){let t=parseInt(e[1],16),o=parseInt(e[2],16),r=parseInt(e[3],16),n=parseInt(e[4],16),i=parseInt(e[5],16),l=parseInt(e[6],16),c=parseInt(e[7],16),u=parseInt(e[8],16);return this.setRgb(t<<4|o,r<<4|n,i<<4|l,(c<<4|u)/255)}if(e.startsWith("rgba")){let o=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((\d+)|(\d*\.\d+)|(\.\d+))\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),parseFloat(o[4]))}else if(e.startsWith("rgb")){let o=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(o)return this.setRgb(parseInt(o[1]),parseInt(o[2]),parseInt(o[3]),1)}else if(e.startsWith("var")){let o=/var\s*\(([^)]*)\)/.exec(e);if(o){let r=o[1].trim(),i=getComputedStyle(document.documentElement).getPropertyValue(r);return this.setValue(i)}}return this.invalid=!0,this.setRgb(255,0,0,1)}setHsv(e,t,o,r=1){let n=Math.min(5,Math.floor(e*6)),i=e*6-n,l=o*(1-t),c=o*(1-i*t),u=o*(1-(1-i)*t),f,m,x;switch(n){case 0:f=o,m=u,x=l;break;case 1:f=c,m=o,x=l;break;case 2:f=l,m=o,x=u;break;case 3:f=l,m=c,x=o;break;case 4:f=u,m=l,x=o;break;case 5:f=o,m=l,x=c;break}return this.setRgb(f*255,m*255,x*255,r)}setRgb(e,t,o,r){return this.rgb=[V(e|0,0,255),V(t|0,0,255),V(o|0,0,255),V(r,0,1)],this}toRgbString(e){let t=this.rgb;return e===!1||t[3]==1?`rgb(${Re(t[0])},${Re(t[1])},${Re(t[2])})`:`rgba(${Re(t[0])},${Re(t[1])},${Re(t[2])},${t[3].toFixed(3)})`}toHexString(){let e=this.rgb;return e[3]==1?`#${ge(e[0])}${ge(e[1])}${ge(e[2])}`:`#${ge(e[0])}${ge(e[1])}${ge(e[2])}${ge(e[3]*255|0)}`}toRgb(){let e=this.rgb;return{red:e[0],green:e[1],blue:e[2],alpha:e[3]}}toHsv(){let e=this.toRgb();e.red/=255,e.green/=255,e.blue/=255;let t=Math.max(e.red,e.green,e.blue),o=Math.min(e.red,e.green,e.blue),r=t-o,n=t===0?0:r/t,i=t,l;if(r===0)l=0;else switch(t){case e.red:l=(e.green-e.blue)/r/6+(e.green<e.blue?1:0);break;case e.green:l=(e.blue-e.red)/r/6+1/3;break;case e.blue:l=(e.red-e.green)/r/6+2/3;break}return{hue:l,saturation:n,value:i,alpha:e.alpha}}getAlpha(){return this.rgb[3]}setAlpha(e){return this.rgb[3]=V(e,0,1),this}isInvalid(){return this.invalid}};s(no,"Color");var O=no;var io=Symbol("x-drag-cb"),ao=class ao{dragSource;dragGhost;dropTarget;notified;timer;registerDraggableElement(e){e.addDOMEvent("dragstart",t=>{this.dragSource=e,this.dragGhost=e.dom.cloneNode(!0),this.dragGhost.classList.add("dragged"),document.body.appendChild(this.dragGhost),e.addClass("dragging"),t.dataTransfer.setData("text/string","1"),t.dataTransfer.setDragImage(new Image,0,0),t.stopPropagation()}),e.addDOMEvent("drag",t=>{this.dragGhost.style.left=t.pageX+"px",this.dragGhost.style.top=t.pageY+"px"}),e.addDOMEvent("dragend",t=>{e.removeClass("dragging"),this.dragGhost.remove()}),e.setAttribute("draggable","true")}registerDropTarget(e,t,o){let r=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}console.log("accepted ",e),c.preventDefault(),c.dataTransfer.dropEffect="copy"},"dragEnter"),n=s(c=>{if(o&&!o(this.dragSource,c.dataTransfer)){console.log("reject ",e),c.dataTransfer.dropEffect="none";return}if(c.preventDefault(),this.dropTarget!=e&&(this.dropTarget=e,this._startCheck()),this.dropTarget){let u={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drag",this.dragSource,u)}c.dataTransfer.dropEffect="copy"},"dragOver"),i=s(c=>{this.dropTarget=null,c.preventDefault()},"dragLeave"),l=s(c=>{let u={pt:{x:c.pageX,y:c.pageY},data:c.dataTransfer};t("drop",this.dragSource,u),this.dropTarget=null,e.removeClass("drop-over"),c.preventDefault()},"drop");e.addDOMEvent("dragenter",r),e.addDOMEvent("dragover",n),e.addDOMEvent("dragleave",i),e.addDOMEvent("drop",l),e.setInternalData(io,t)}_startCheck(){this.timer&&(clearInterval(this.timer),this._check()),this.timer=setInterval(()=>this._check(),300)}_check(){let e=s(o=>{o.removeClass("drop-over"),o.getInternalData(io)("leave",this.dragSource)},"leaving"),t=s(o=>{o.addClass("drop-over"),o.getInternalData(io)("enter",this.dragSource)},"entering");this.dropTarget?(!this.notified||this.notified!=this.dropTarget)&&(this.notified&&e(this.notified),this.notified=this.dropTarget,t(this.notified)):this.notified&&(e(this.notified),this.notified=null,clearInterval(this.timer))}};s(ao,"DragManager");var so=ao,Pt=new so;function Zr(a,e=!1){if(a instanceof RegExp)return{keys:null,pattern:a};let t=a.split("/"),o=[],r="";t[0]==""&&t.shift();for(let n of t){let i=n[0];if(i==="*")o.push("wild"),r+="/(.*)";else if(i===":"){let l=n.indexOf("?",1),c=n.indexOf(".",1);o.push(n.substring(1,l>=0?l:c>=0?c:n.length)),r+=l>=0&&c<0?"(?:/([^/]+?))?":"/([^/]+?)",c>=0&&(r+=(l>=0?"?":"")+"\\"+n.substring(c))}else r+="/"+n}return{keys:o,pattern:new RegExp(`^${r}${e?"(?=$|/)":"/?$"}`,"i")}}s(Zr,"parseRoute");var lo=class lo extends me{m_routes;m_useHash;constructor(e=!0){super(),this.m_routes=[],this.m_useHash=e,window.addEventListener("popstate",t=>{let o=this._getLocation(),r=this._find(o);r.handlers.forEach(n=>{n(r.params,o)}),this.fire("change",{value:this._getLocation()})})}get(e,t){let{keys:o,pattern:r}=Zr(e);this.m_routes.push({keys:o,pattern:r,handler:t})}init(){this.navigate(this._getLocation())}_getLocation(){return this.m_useHash?"/"+document.location.hash.substring(1):document.location.pathname}navigate(e,t=!0,o=!1){e.startsWith("/")||(e="/"+e);let r=this._find(e);if(!r||r.handlers.length==0)return console.log("route not found: "+e),this.fire("error",{code:404,message:"route not found"}),!1;if(this.m_useHash){for(;e.at(0)=="/";)e=e.substring(1);e="#"+e}return o?window.history.replaceState({},"",e):window.history.pushState({},"",e),t&&r.handlers[0](r.params,e),this.fire("change",{value:this._getLocation()}),!0}_find(e){let t=[],o={},r=[];for(let n of this.m_routes)if(n.keys)if(n.keys.length>0){if(t=n.pattern.exec(e),t===null)continue;for(let i=0;i<n.keys.length;)o[n.keys[i]]=t[++i];r=[...r,n.handler]}else n.pattern.test(e)&&(r=[...r,n.handler]);else{if(t=n.pattern.exec(e),!t)continue;if(t.groups)for(let i in t.groups)o[i]=t.groups[i];r=[...r,n.handler]}return{params:o,handlers:r}}};s(lo,"Router");var er=lo;var tr="http://www.w3.org/2000/svg";function Jr(a){return a*Math.PI/180}s(Jr,"d2r");function or(a,e,t,o){let r=Jr(o);return{x:a+t*Math.cos(r),y:e+t*Math.sin(r)}}s(or,"p2c");function A(a){return Math.round(a*1e3)/1e3}s(A,"num");function Tt(a,...e){return e=e.map(t=>typeof t=="number"&&isFinite(t)?A(t):t),String.raw(a,...e)}s(Tt,"clean");var mo=class mo{_dom;constructor(e){this._dom=document.createElementNS("http://www.w3.org/2000/svg",e)}getDom(){return this._dom}reset(){let e=this._dom.attributes;for(let t=e.length-1;t>=0;t--)this._dom.removeAttribute(e[t].name);return this}stroke(e,t){return this.setAttr("stroke",e),t!==void 0&&this.setAttr("stroke-width",t+"px"),this}strokeWidth(e){return this.setAttr("stroke-width",e+"px"),this}strokeCap(e){return this.setAttr("stroke-linecap",e)}strokeOpacity(e){return this.setAttr("stroke-opacity",e+"")}antiAlias(e){return this.setAttr("shape-rendering",e?"auto":"crispEdges")}fill(e){return this.setAttr("fill",e),this}no_fill(){return this.setAttr("fill","transparent"),this}getAttr(e){return this._dom.getAttribute(e)}getNumAttr(e){return parseInt(this._dom.getAttribute(e))}setAttr(e,t){return this._dom.setAttribute(e,t),this}setStyle(e,t){let o=this._dom.style;if(R(t)){let r=t+"";Zo(e)||(r+="px"),o[e]=r}else o[e]=t;return this}addClass(e){if(e){if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.add(...t)}else this._dom.classList.add(e);return this}}removeClass(e){if(e){if(e.indexOf(" ")>=0){let t=e.split(" ");this._dom.classList.remove(...t)}else this._dom.classList.remove(e);return this}}clip(e){return this.setAttr("clip-path",`url(#${e})`),this}transform(e){var o;let t=(o=this.getAttr("transform"))!=null?o:"";return this.setAttr("transform",t+" "+e),this}clear_transform(){return this.setAttr("transform",null),this}rotate(e,t,o){return this.transform(`rotate( ${e} ${t} ${o} )`),this}translate(e,t){return this.transform(`translate( ${e} ${t} )`),this}scale(e){return this.transform(`scale( ${e} )`),this}addDOMEvent(e,t,o=!1){return Mt(this._dom,e,t,o),this}};s(mo,"SvgItem");var oe=mo,fo=class fo extends oe{_path;constructor(){super("path"),this._path=""}_update(){return this.setAttr("d",this._path),this}reset(){return this._path="",super.reset(),this}moveTo(e,t){return this._path+=Tt`M${e},${t}`,this._update()}lineTo(e,t){return this._path+=Tt`L${e},${t}`,this._update()}curveTo(e,t,o,r,n,i){return this._path+=Tt`C${e},${t} ${o},${r} ${n},${i}`,this._update()}closePath(){return this._path+="Z",this._update()}arc(e,t,o,r,n,i=!0){let l=or(e,t,o,r-90),c=or(e,t,o,n-90),u=n-r<=180?"0":"1";return this._path+=Tt`M${l.x},${l.y}A${o},${o} 0 ${u} ${i?"1":"0"} ${c.x},${c.y}`,this._update()}};s(fo,"SvgPath");var co=fo,go=class go extends oe{constructor(e,t,o){super("text"),this.setAttr("x",A(e)+""),this.setAttr("y",A(t)+""),this._dom.innerHTML=o}font(e){return this.setAttr("font-family",e)}fontSize(e){return this.setAttr("font-size",e+"")}fontWeight(e){return this.setAttr("font-weight",e)}textAlign(e){let t;switch(e){case"left":t="start";break;case"center":t="middle";break;case"right":t="end";break;default:return this}return this.setAttr("text-anchor",t)}verticalAlign(e){let t;switch(e){case"top":t="hanging";break;case"center":t="middle";break;case"bottom":t="baseline";break;case"baseline":t="mathematical";break;default:return}return this.setAttr("alignment-baseline",t)}};s(go,"SvgText");var po=go,xo=class xo extends oe{constructor(e){super("svg"),e.startsWith("data:image/svg+xml,")&&(e=e.substring(19));let o=new DOMParser().parseFromString(decodeURIComponent(e),"image/svg+xml"),r=o.querySelector("parsererror");r&&console.error(`error while parsing svg:
|
|
2
|
+
`+r.textContent);let n=o.documentElement;for(let i=0;i<n.attributes.length;i++)this._dom.setAttribute(n.attributes[i].name,n.attributes[i].value);for(let i=0;i<n.childNodes.length;i++){let l=n.childNodes[i];l.nodeType===1&&this._dom.appendChild(l)}}};s(xo,"SvgIcon");var ho=xo,bo=class bo extends oe{constructor(e){super(e)}};s(bo,"SvgShape");var dt=bo,Fe=class Fe extends oe{_id;_stops;constructor(e,t,o,r){super("linearGradient"),this._id="gx-"+Fe.g_id,Fe.g_id++,this.setAttr("id",this._id),this.setAttr("x1",D(e)?e:A(e)+""),this.setAttr("x2",D(o)?o:A(o)+""),this.setAttr("y1",D(t)?t:A(t)+""),this.setAttr("y2",D(r)?r:A(r)+""),this._stops=[]}get id(){return"url(#"+this._id+")"}addStop(e,t){return this._dom.insertAdjacentHTML("beforeend",`<stop offset="${e}%" stop-color="${t}"></stop>`),this}};s(Fe,"SvgGradient"),L(Fe,"g_id",1);var uo=Fe,Rt=class Rt extends oe{constructor(e="g"){super(e)}append(e){return this._dom.appendChild(e.getDom()),e}appendItems(e){e.forEach(t=>{this._dom.appendChild(t.getDom())})}path(){let e=new co;return this.append(e)}text(e,t,o){let r=new po(e,t,o);return this.append(r)}ellipse(e,t,o,r){let n=new dt("ellipse");return n.setAttr("cx",A(e)+""),n.setAttr("cy",A(t)+""),n.setAttr("rx",A(o)+""),n.setAttr("ry",A(r)+""),this.append(n)}circle(e,t,o){let r=new dt("ellipse");return r.setAttr("cx",A(e)+""),r.setAttr("cy",A(t)+""),r.setAttr("rx",A(o)+""),r.setAttr("ry",A(o)+""),this.append(r)}icon(e,t,o,r,n){let i=new ho(e);return i.setAttr("x",A(t)+""),i.setAttr("y",A(o)+""),i.setAttr("width",A(r)+""),i.setAttr("height",A(n)+""),this.append(i)}rect(e,t,o,r){r<0&&(t=t+r,r=-r);let n=new dt("rect");return n.setAttr("x",A(e)+""),n.setAttr("y",A(t)+""),n.setAttr("width",A(o)+""),n.setAttr("height",A(r)+""),this.append(n)}group(e){let t=new Rt;return e&&t.setAttr("id",e),this.append(t)}linear_gradient(e,t,o,r){let n=new uo(e,t,o,r);return this.append(n)}clear(){let e=this._dom;for(;e.firstChild;)e.removeChild(e.firstChild)}};s(Rt,"SvgGroup");var pt=Rt,xe=class xe extends pt{constructor(){super()}addClip(e,t,o,r){let n="clip-"+xe.g_clip_id++,i=new pt("clipPath");return i.setAttr("id",n),i.rect(e,t,o,r),this.append(i),{id:n,clip:i}}addPattern(e,t,o,r){let n="pat-"+xe.g_pat_id++,i=new pt("pattern");return i.setAttr("id",n),i.setAttr("x",A(e)+""),i.setAttr("y",A(t)+""),i.setAttr("width",A(o)+""),i.setAttr("height",A(r)+""),i.setAttr("patternUnits","userSpaceOnUse"),this.append(i),{id:n,pat:i}}};s(xe,"SvgBuilder"),L(xe,"g_clip_id",1),L(xe,"g_pat_id",1);var St=xe,vo=class vo extends d{constructor(e){super({...e,tag:"svg",ns:tr}),this.setAttribute("xmlns",tr),e.viewbox&&this.setAttribute("viewBox",e.viewbox),e.svg&&this.dom.appendChild(e.svg.getDom())}setSvg(e){this.clearContent(),this.dom.appendChild(e.getDom())}addItems(...e){e.forEach(t=>this.dom.appendChild(t.getDom()))}};s(vo,"SvgComponent");var Lt=vo;var k=class extends d{};s(k,"Box"),k=p([h("x4")],k);var g=class extends k{};s(g,"HBox"),g=p([h("x4")],g);var y=class extends k{constructor(e){super(e)}};s(y,"VBox"),y=p([h("x4")],y);var re=class extends k{_items;constructor(e){var t;super(e),this._items=(t=e.items)==null?void 0:t.map(o=>({...o,page:null})),e.default?this.select(e.default):this._items.length&&this.select(this._items[0].name)}addItem(e){this._items.push({name:e.name,content:e.content,page:null})}select(e){var r;let t=this.query(":scope > .selected");t&&t.setClass("selected",!1);let o=this._items.find(n=>n.name==e);return o&&(o.page||(o.page=this._createPage(o),this.appendContent(o.page)),t=o.page,t&&((r=t.activate)==null||r.call(t),t.setClass("selected",!0))),o==null?void 0:o.page}_createPage(e){let t;return e.content instanceof Function?(t=e.content(),e.content=t):t=e.content,t==null||t.setData("stackname",e.name),t}getPage(e){let t=this._items.find(o=>o.name==e);return t?t.content:null}};s(re,"StackBox"),re=p([h("x4")],re);var Oe=class extends k{constructor(e){super(e),e.rows!==void 0&&this.setRows(e.rows),e.columns!==void 0&&this.setCols(e.columns)}setRows(e){U(e)?e=e.join(" "):R(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateRows",e)}setCols(e){U(e)?e=e.join(" "):R(e)&&(e=`repeat( ${e}, 1fr )`),this.setStyleValue("gridTemplateColumns",e)}setRowCount(e){this.setStyleValue("gridTemplateRows",`repeat(${e})`)}setColCount(e){this.setStyleValue("gridTemplateColumns",`repeat(${e})`)}setTemplate(e){this.setAttribute("grid-template-area",e.map(t=>'"'+t+'"').join(" "))}};s(Oe,"GridBox"),Oe=p([h("x4")],Oe);var ze=class extends k{constructor(e){super(e),this.addDOMEvent("resized",()=>{this.resizeAllItems()}),e.items&&this.setItems(e.items)}resizeItem(e){let t=this.getComputedStyle(),o=parseInt(t.gridAutoRows),r=parseInt(t.rowGap),n=e.query(".content");if(n||(n=e),n&&o+r){let i=n.getBoundingRect(),l=Math.ceil((i.height+r)/(o+r));e.setStyleValue("gridRowEnd","span "+l)}}resizeAllItems(){this.queryAll(".item").forEach(t=>{this.resizeItem(t)})}setItems(e){let t=e.map(o=>new k({cls:"item",content:o}));this.setContent(t)}};s(ze,"MasonryBox"),ze=p([h("x4")],ze);var Be=class extends g{constructor(e){super(e),this.mapPropEvents(e,"click"),e.items&&this.setItems(e.items)}setItems(e){let t=e.map(o=>new I({label:o.label,icon:o.icon,click:s(()=>{o.click?o.click(o.name):this.fire("click",{context:o.name})},"click")}));this.setContent(t)}};s(Be,"Breadcrumbs"),Be=p([h("x4")],Be);var wo=class wo{cache;waiters;constructor(){this.cache=new Map,this.waiters=new Map}async load(e){return this.cache.has(e)?Promise.resolve(this.cache.get(e)):new Promise((t,o)=>{this.waiters.has(e)?this.waiters.get(e).push(t):(this.waiters.set(e,[t]),this._load(e).then(r=>{console.timeEnd(e),this.cache.set(e,r),this.waiters.get(e).forEach(i=>i(r))}))})}async _load(e){console.time(e);let t=await fetch(e);if(t.ok)return t.text()}};s(wo,"SvgLoader");var _o=wo,ht=new _o,C=class extends d{constructor(e){super(e),this.setIcon(e.iconId)}setIcon(e){if(this.clearContent(),e){if(e.startsWith("var:"))do{let t=e.substring(4);e=document.documentElement.style.getPropertyValue(t)}while(e.startsWith("var:"));e.startsWith("data:image/svg+xml,<svg")?this.dom.insertAdjacentHTML("beforeend",e.substring(19)):e.endsWith(".svg")?ht.load(e).then(t=>{this.clearContent(),this.dom.insertAdjacentHTML("beforeend",t)}):this.setContent(new d({tag:"img",attrs:{src:e}})),this.removeClass("empty")}else this.addClass("empty")}};s(C,"Icon"),C=p([h("x4")],C);var Ve,I=class extends d{constructor(t){super({...t,tag:"button",content:null});j(this,Ve);this.mapPropEvents(t,"click"),t.autorepeat?(this.addDOMEvent("pointerdown",o=>this._on_mouse(o)),this.addDOMEvent("pointerup",o=>this._on_mouse(o))):this.addDOMEvent("click",o=>this._on_click(o)),this.addDOMEvent("keydown",o=>this._on_keydown(o)),this.setContent([new C({id:"icon",iconId:this.props.icon}),Y(this,Ve,new d({id:"label"}))]),this.setText(t.label),t.tabindex!==!1&&this.setAttribute("tabindex",t.tabindex)}_on_click(t){this.fire("click",{}),t.preventDefault(),t.stopPropagation()}_on_mouse(t){let o=0;if(t.type=="pointerdown"){this.dom.setPointerCapture(t.pointerId);let r=this.props.autorepeat===!0?200:this.props.autorepeat;this.setTimeout("repeat",500,()=>{o++,this.fire("click",{}),this.setInterval("repeat",r,()=>{this.fire("click",{})})})}else this.clearTimeout("repeat"),o||this.fire("click",{})}click(){this.dom.click()}_on_keydown(t){t.key=="Enter"&&(this.click(),t.preventDefault())}setText(t){M(this,Ve).setContent(t),M(this,Ve).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};Ve=new WeakMap,s(I,"Button"),I=p([h("x4")],I);var ne=class extends k{constructor(e){super(e),e.align&&this.addClass("align-"+e.align),this.addClass(e.vertical?"x4vbox":"x4hbox"),e.items&&this.setButtons(e.items),this.mapPropEvents(e,"btnclick")}setButtons(e){this.clearContent();let t=[],o=s((r,n)=>{let i=r.indexOf(n);if(i>=0)return r.splice(i,1),!0},"hasOption");e==null||e.forEach(r=>{if(r==="-"||r===">>")r=new Q;else if(r=="~")r=new Dt("1em");else if(D(r)){let n,i=r,[l,...c]=i.split("."),u="";switch(l){case"ok":n=_.global.ok;break;case"cancel":n=_.global.cancel;break;case"abort":n=_.global.abort;break;case"no":n=_.global.no;break;case"yes":n=_.global.yes;break;case"retry":n=_.global.retry;break}r=new I({cls:u,id:l,label:n,click:s(()=>{this.fire("btnclick",{button:l})},"click")}),o(c,"default")&&r.addClass("default"),o(c,"autofocus")&&r.setAttribute("autofocus",!0),o(c,"disabled")&&r.enable(!1),r.addClass(c.join(" "))}t.push(r)}),super.setContent(t)}getButton(e){return this.query("#"+e)}};s(ne,"BtnGroup"),ne=p([h("x4")],ne);var He,v=class extends d{constructor(t){super({...t,content:null});j(this,He);this.setContent([new C({id:"icon",iconId:this.props.icon}),Y(this,He,new d({tag:"span",id:"text"}))]);let o=this.props.text;this.setText(o),t.labelFor&&this.setAttribute("for",t.labelFor)}setText(t){M(this,He).setContent(t),M(this,He).setClass("empty",!t)}setIcon(t){this.query("#icon").setIcon(t)}};He=new WeakMap,s(v,"Label"),v=p([h("x4")],v);var F=class extends d{constructor(e){super({...e}),this.setContent(e.text),e.align&&this.addClass("al-"+e.align)}setText(e){this.setContent(e),this.setClass("empty",!e)}};s(F,"SimpleText"),F=p([h("x4")],F);var T=class extends d{_type;_ref;_delta;constructor(e,t){super({}),this._type=e,this.addClass(e),this.addDOMEvent("pointerdown",o=>{this.setCapture(o.pointerId),this._ref=t!=null?t:P(this.dom.parentElement),this._delta={x:0,y:0};let r=this._ref.getBoundingRect();this._type.includes("left")?this._delta.x=o.pageX-r.left:this._delta.x=o.pageX-(r.left+r.width),this._type.includes("top")?this._delta.y=o.pageY-r.top:this._delta.y=o.pageY-(r.top+r.height),this.fire("start",{})}),this.addDOMEvent("pointerup",o=>{this.fire("stop",{}),this.releaseCapture(o.pointerId),this._ref=null}),this.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this._ref)return;let t={x:e.pageX-this._delta.x,y:e.pageY-this._delta.y},o=this._ref.getBoundingRect(),r={},n=!0;this._type.includes("top")&&(r.top=t.y,r.height=o.top+o.height-t.y,n=!1),this._type.includes("bottom")&&(r.height=t.y-o.top,n=!1),this._type.includes("left")&&(r.left=t.x,r.width=o.left+o.width-t.x),this._type.includes("right")&&(r.width=t.x-o.left),this._ref.setStyle(r);let i=this._ref.getBoundingRect();this.fire("resize",{size:n?i.width:i.height}),e.preventDefault(),e.stopPropagation()}};s(T,"CSizer"),T=p([h("x4")],T);var H=[],yo=[],ut=[],Ne;function Ft(){return document.body}s(Ft,"getRoot");var S=class extends k{_isshown=!1;_ismodal=!1;constructor(e){super(e),this.props.sizable&&this._createSizers(),he(()=>{(this.props.movable===!0||this.props.sizable&&this.props.movable===void 0)&&(this.queryAll(".caption-element").forEach(o=>new Ot(o,this)),this.hasClass("popup-caption")&&new Ot(this,this))})}displayNear(e,t="top left",o="top left",r={x:0,y:0}){this.setStyle({left:"0px",top:"0px"}),this._do_show();let n=this.getBoundingRect(),i=e.left,l=e.top;o.indexOf("right")>=0?i=e.left+e.width:o.indexOf("center")>=0&&(i=e.left+e.width/2),o.indexOf("bottom")>=0?l=e.bottom:o.indexOf("middle")>=0&&(l=e.top+e.height/2),t.indexOf("right")>=0?i-=n.width:t.indexOf("center")>=0&&(i-=n.width/2),t.indexOf("bottom")>=0?l-=n.height:t.indexOf("middle")>=0&&(l-=n.height/2),r&&(i+=r.x,l+=r.y),i+=document.scrollingElement.scrollLeft,l+=document.scrollingElement.scrollTop,this.displayAt(i,l)}displayCenter(){this.displayNear(new J(window.innerWidth/2,window.innerHeight/2,0,0),"center middle")}displayAt(e,t){this.setStyle({left:e+"px",top:t+"px"}),this._do_show();let o=this.getBoundingRect(),r=window.innerWidth-16,n=window.innerHeight-16;o.right>r&&this.setStyleValue("left",r-o.width),o.bottom>n&&this.setStyleValue("top",n-o.height)}isOpen(){return this._isshown}_do_hide(){if(!this._isshown)return;this.__hide(),this.__remove(),this._ismodal&&(ut.pop(),this._hideModalMask());let e=yo.indexOf(this);if(console.assert(e>=0),yo.splice(e,1),this.props.autoClose){let t=H.indexOf(this);t>=0&&(H.splice(t,1),H.length==0&&document.removeEventListener("pointerdown",this._dismiss))}this._isshown=!1,this.fire("closed",{})}_do_show(){this._isshown||(this._isshown=!0,this.__append(),this._ismodal&&(ut.push(this),this._showModalMask()),this.__show(),this.props.autoClose&&(H.length==0&&document.addEventListener("pointerdown",this._dismiss),H.push(this),this.setData("close",this.props.autoClose===!0?z():this.props.autoClose)),yo.push(this),this.fire("opened",{}))}__show(){super.show(!0)}__hide(){super.show(!1)}__append(){Ft().appendChild(this.dom)}__remove(){Ft().removeChild(this.dom)}show(e=!0){return e?this.displayCenter():this._do_hide(),this}close(){this._do_hide()}_dismiss=s(e=>{H.some(o=>o.dom.contains(e.target))||(e.preventDefault(),e.stopPropagation(),this.dismiss())},"_dismiss");dismiss(e=!1){if(H.length==0)return;let t=this.getData("close"),o=[],r=[],n=-1;e&&(n=H.indexOf(this)),H.forEach((l,c)=>{l.getData("close")==t&&c>n?o.push(l):r.push(l)});let i=o.reverse();H=r,H.length==0&&document.removeEventListener("pointerdown",this._dismiss),i.forEach(l=>l.close())}_createSizers(){this.appendContent([new T("top"),new T("bottom"),new T("left"),new T("right"),new T("top-left"),new T("bottom-left"),new T("top-right"),new T("bottom-right")])}_showModalMask(){Ne||(Ne=new d({cls:"x4modal-mask"})),Ft().insertBefore(Ne.dom,this.dom)}_hideModalMask(){if(Ne){let e=Ft();if(ut.length){let t=ut[ut.length-1];e.insertBefore(Ne.dom,t.dom)}else e.removeChild(Ne.dom)}}};s(S,"Popup"),S=p([h("x4")],S);var ko=class ko{ref;delta;self;constructor(e,t){this.self=!!t,e.addDOMEvent("pointerdown",o=>{if(this.self&&o.target!=e.dom)return;e.setCapture(o.pointerId),this.ref=t!=null?t:P(e.dom.parentElement),this.delta={x:0,y:0};let r=this.ref.getBoundingRect();this.delta.x=o.pageX-r.left,this.delta.y=o.pageY-r.top}),e.addDOMEvent("pointerup",o=>{e.releaseCapture(o.pointerId),this.ref=null}),e.addDOMEvent("pointermove",o=>{this._onMouseMove(o)})}_onMouseMove(e){if(!this.ref)return;let t={x:e.pageX-this.delta.x,y:e.pageY-this.delta.y},o=this.ref.getBoundingRect(),r={};this.ref.setStyle({top:t.y+"",left:t.x+""}),e.preventDefault(),e.stopPropagation()}};s(ko,"CMover");var Ot=ko;var rr=400,be=class extends d{constructor(){super({})}};s(be,"CMenuSep"),be=p([h("x4")],be);var zt=new Se,ie=class extends d{menu;constructor(e){super({disabled:e.disabled,cls:e.cls}),e.menu&&this.addClass("popup"),this.setContent([new C({id:"icon",iconId:e.icon}),new d({id:"text",content:e.text})]),e.menu?(this.menu=e.menu,this.addDOMEvent("mouseenter",()=>this.openSub(!0)),this.addDOMEvent("click",()=>this.openSub(!1)),this.addDOMEvent("mouseleave",()=>this.closeSub()),this.menu.on("opened",()=>this.addClass("opened")),this.menu.on("closed",()=>this.removeClass("opened"))):(this.addDOMEvent("mouseenter",()=>{zt.setTimeout("open",rr,()=>{this.dismiss(!0)})}),this.addDOMEvent("click",()=>{this.dismiss(!1),e.click&&e.click(new Event("click"))}))}dismiss(e){let t=this.parentElement(N);t&&t.dismiss(e)}openSub(e){let t=s(()=>{this.dismiss(!0);let o=this.getBoundingRect();this.menu.displayAt(o.right-4,o.top)},"open");e?zt.setTimeout("open",rr,t):(zt.clearTimeout("open"),t())}closeSub(){zt.clearTimeout("open")}};s(ie,"CMenuItem"),ie=p([h("x4")],ie);var N=class extends S{constructor(e){var o;super({...e,autoClose:"menu",modal:!1}),this.addClass("x4vbox");let t=(o=e.items)==null?void 0:o.map(r=>r==="-"?new be:D(r)?new ie({text:r,click:null,cls:"title"}):r instanceof d?r:new ie(r));this.setContent(t)}};s(N,"Menu"),N=p([h("x4")],N);var nr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M9.4 256l11.3-11.3 192-192L224 41.4 246.6 64 235.3 75.3 54.6 256 235.3 436.7 246.6 448 224 470.6l-11.3-11.3-192-192L9.4 256z"/></svg>';var ir='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M128 16l0-16L96 0l0 16 0 48L32 64 0 64 0 96l0 64 0 32L0 480l0 32 32 0 384 0 32 0 0-32 0-288 0-32 0-64 0-32-32 0-64 0 0-48 0-16L320 0l0 16 0 48L128 64l0-48zM32 192l384 0 0 288L32 480l0-288zm0-96l384 0 0 64L32 160l0-64zM331.3 283.3L342.6 272 320 249.4l-11.3 11.3L208 361.4l-52.7-52.7L144 297.4 121.4 320l11.3 11.3 64 64L208 406.6l11.3-11.3 112-112z"/></svg>';var sr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M310.6 256l-11.3 11.3-192 192L96 470.6 73.4 448l11.3-11.3L265.4 256 84.7 75.3 73.4 64 96 41.4l11.3 11.3 192 192L310.6 256z"/></svg>';var Ue=class extends y{m_date;constructor(e){super(e),this.mapPropEvents(e,"change"),this.m_date=e.date?Le(e.date):new Date,this._update()}_update(){let e=Le(this.m_date);e.setDate(1);let t=e.getDay();t==0&&(t=7),e.setDate(-t+1+1);let o=Le(e),r=ue(this.m_date),n=ue(new Date),i=Le(this.m_date);i.setDate(1),i.setMonth(i.getMonth()+1),i.setDate(0);let l=ue(i),c=[],u=new g({cls:"month-sel",content:[new v({cls:"month",text:X(this.m_date,"O"),dom_events:{click:s(()=>this._choose("month"),"click")}}),new v({cls:"year",text:X(this.m_date,"Y"),dom_events:{click:s(()=>this._choose("year"),"click")}}),new Q,new I({icon:nr,click:s(()=>this._next(!1),"click")}),new I({icon:ir,click:s(()=>this.setDate(new Date),"click"),tooltip:_.global.today}),new I({icon:sr,click:s(()=>this._next(!0),"click")})]});c.push(u);let f=[];f.push(new g({cls:"weeknum cell"}));for(let b=0;b<7;b++)f.push(new v({cls:"cell",text:_.global.day_short[(b+1)%7]}));c.push(new g({cls:"week header",content:f}));let m=this.m_date.getMonth(),x=!0;for(;ue(o)<=l;){let b=[new g({cls:"weeknum cell",content:new d({tag:"span",content:X(o,"w")})})];for(let w=0;w<7;w++){let de="cell day";ue(o)==r&&(de+=" selection"),ue(o)==n&&(de+=" today"),o.getMonth()!=m&&(de+=" out");let pe=s(bt=>new g({cls:de,flex:1,content:new d({cls:"text",content:ct(`<span>${X(bt,"d")}</span>`)}),dom_events:{click:s(()=>this.select(bt),"click")}}),"mkItem");b.push(pe(Le(o))),o.setDate(o.getDate()+1),x=!1}c.push(new g({cls:"week",flex:1,content:b}))}this.setContent(c)}select(e){this.m_date=e,this.fire("change",{value:e}),this._update()}_next(e){this.m_date.setMonth(this.m_date.getMonth()+(e?1:-1)),this._update()}_choose(e){var n,i,l,c;let t=[];if(e=="month")for(let u=0;u<12;u++)t.push({text:_.global.month_long[u],click:s(()=>{this.m_date.setMonth(u),this._update()},"click")});else if(e=="year"){let u=(i=(n=this.props.minDate)==null?void 0:n.getFullYear())!=null?i:1900,f=(c=(l=this.props.maxDate)==null?void 0:l.getFullYear())!=null?c:2037;for(let m=f;m>=u;m--)t.push({text:""+m,click:s(()=>{this.m_date.setFullYear(m),this._update()},"click")})}let o=new N({items:t}),r=this.getBoundingRect();o.displayAt(r.left,r.top)}getDate(){return this.m_date}setDate(e){this.m_date=e,this._update()}};s(Ue,"Calendar"),Ue=p([h("x4")],Ue);var E=class extends d{constructor(e){var t;switch(super({tag:"input",...e}),this.mapPropEvents(e,"focus","change"),this.setAttribute("type",(t=e.type)!=null?t:"text"),this.setAttribute("name",e.name),e.autofocus===!0&&this.setAttribute("autofocus",!0),e.type){case"checkbox":case"radio":{let o=this.dom;o.checked=e.checked,o.value=e.value===void 0?"":e.value+"";break}case"range":{this.setAttribute("min",e.min),this.setAttribute("max",e.max),this.setAttribute("step",e.step),this.setAttribute("value",e.value);break}case"number":{let o=this.props;this.setAttribute("required",o.required),this.setAttribute("readonly",o.readonly),this.setAttribute("min",o.min),this.setAttribute("max",o.max),this.setAttribute("step",o.step),this.setNumValue(D(o.value)?parseFloat(o.value):o.value,-2),this.addDOMEvent("wheel",r=>{if(this.hasFocus()){r.preventDefault();let n=this.getNumValue(),i=r.deltaY<0?1:-1;n+=(o.step?o.step:1)*i,this.setNumValue(n,-2),this.dom.dispatchEvent(new Event("input"))}});break}case"date":{this.setAttribute("required",e.required);let o=e.value;o instanceof Date||this.setAttribute("value",o);break}case"file":{let o;Array.isArray(e.accept)?o=e.accept.join(","):o=e.accept,this.setAttribute("accept",o);break}default:{this.setAttribute("required",e.required),this.setAttribute("readonly",e.readonly),e.value!==null&&e.value!==void 0&&this.setAttribute("value",e.value),e.pattern!==null&&e.pattern!==void 0&&this.setAttribute("pattern",e.pattern),e.placeholder!==null&&e.placeholder!==void 0&&this.setAttribute("placeholder",e.placeholder),e.spellcheck===!1&&this.setAttribute("spellcheck",!1),e.minlength!==void 0&&this.setAttribute("minlength",e.minlength),e.maxlength!==void 0&&this.setAttribute("maxlength",e.maxlength);break}}this.addDOMEvent("blur",o=>{this.on_focus(o,!0)}),this.addDOMEvent("focus",o=>{this.on_focus(o,!1)}),this.addDOMEvent("input",o=>{this.on_change(o)})}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}getNumValue(){return parseFloat(this.getValue())}setNumValue(e,t=-1){var o;if(t==-2&&this.props.type=="number"){let r=this.props;if(r.step){let n=-Math.floor(Math.log10((o=r.step)!=null?o:1));return this.setValue(e.toFixed(n))}}else if(t>=0)return this.setValue(e.toFixed(t));this.setValue(e+"")}getCheck(){return this.dom.checked}setCheck(e){let t=this.dom;t.checked=e}setReadOnly(e){let t=this.dom;t.readOnly=e}selectAll(){this.dom.select()}select(e,t=9999){this.dom.setSelectionRange(e,e+t)}getSelection(){let e=this.dom;return{start:e.selectionStart,length:e.selectionEnd-e.selectionStart}}isValid(){return!(this.props.required&&this.getValue()==="")}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getValue(),"getRawValue"),setRawValue:s(o=>{this.setValue(o)},"setRawValue"),isValid:s(()=>this.isValid(),"isValid")}:super.queryInterface(e)}};s(E,"Input"),E=p([h("x4")],E);var Bt='data:image/svg+xml,<svg viewBox="0 0 10 7" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">%0D%0A%09<path d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var qe=class extends d{_input;constructor(e){super(e);let t=z();this.mapPropEvents(e,"change"),this.setContent([new d({cls:"inner",content:[this._input=new E({type:"checkbox",id:t,name:e.name,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),new v({tag:"label",text:e.label,labelFor:t,id:void 0})]),ht.load(Bt).then(o=>{this.query(".inner").dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getCheck()})}getCheck(){return this._input.getCheck()}setCheck(e){this._input.setCheck(e)}setLabel(e){this.query("label").setText(e)}toggle(){this.setCheck(!this.getCheck())}};s(qe,"Checkbox"),qe=p([h("x4")],qe);var ar='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M479.4 240L384 240l-16 0 0 32 16 0 95.4 0C471.6 383 383 471.6 272 479.4l0-95.4 0-16-32 0 0 16 0 95.4C129 471.6 40.4 383 32.6 272l95.4 0 16 0 0-32-16 0-95.4 0C40.4 129 129 40.4 240 32.6l0 95.4 0 16 32 0 0-16 0-95.4C383 40.4 471.6 129 479.4 240zM256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg>';var ve=class extends g{constructor(e){super(e);let t,o;this.setContent([t=new d({cls:"swatch"}),o=new E({type:"text",value:"",spellcheck:!1}),yt("eyedropper")?new I({icon:ar,click:s(()=>{new window.EyeDropper().open().then(l=>{n=new O(l.sRGBHex),r(n)})},"click")}):null]),o.addDOMEvent("input",()=>{let i=o.getValue(),l=new O(i);l.isInvalid()||(n=l,r(n))});let r=s(i=>{t.setStyleValue("backgroundColor",i.toRgbString(!1)),o.setValue(i.toRgbString(!1))},"updateColor"),n;e.color instanceof O?n=e.color:n=new O(e.color),r(n)}};s(ve,"ColorInput"),L(ve,"$cls-ns","x4"),ve=p([h("x4")],ve);var _e=class extends k{mdown=!1;irect;hsv={hue:1,saturation:1,value:1,alpha:1};color;thumb;constructor(e,t){super(e),this.setContent([this.color=new d({cls:"overlay"}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(90deg, rgb(255, 255, 255), transparent)"}}),new d({cls:"overlay",style:{backgroundImage:"linear-gradient(0deg, rgb(0, 0, 0), transparent)"}}),this.thumb=new d({cls:"thumb"})]),this.setDOMEvents({pointerdown:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup"),created:s(()=>this.updateThumbMarker(),"created")}),this.updateBaseColor(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=V(e.clientX-t.left,0,t.width)/t.width,i=V(e.clientY-t.top,0,t.height)/t.height;this.hsv.saturation=r,this.hsv.value=1-i,this.updateThumbMarker(),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateThumbMarker(){let e=this.color.getBoundingRect();this.thumb.setStyle({left:this.hsv.saturation*e.width+"px",bottom:this.hsv.value*e.height+"px"})}updateBaseColor(e){let t=new O(0,0,0);t.setHsv(e.hue,1,1,1),this.color.setStyleValue("backgroundColor",t.toRgbString(!1))}move(e,t){switch(e){case"saturation":{this.hsv.saturation+=t,this.hsv.saturation<0?this.hsv.saturation=0:this.hsv.saturation>1&&(this.hsv.saturation=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}case"value":{this.hsv.value+=t,this.hsv.value<0?this.hsv.value=0:this.hsv.value>1&&(this.hsv.value=1),this.fire("sat_change",{saturation:this.hsv.saturation,value:this.hsv.value}),this.updateThumbMarker();break}}}};s(_e,"Saturation"),_e=p([h("x4")],_e);var we=class extends k{thumb;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),this.setContent([this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:s(o=>this.mousedown(o),"pointerdown"),pointermove:s(o=>this.mousemove(o),"pointermove"),pointerup:s(o=>this.mouseup(o),"pointerup")}),this.updateHue(t)}mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}mousemove(e){if(this.mdown){let t=this.irect,r=V(e.clientX-t.left,0,t.width)/t.width;this.hsv.hue=r,this.updateHue(this.hsv),this.fire("hue_change",{hue:this.hsv.hue})}}mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateHue(e){this.hsv.hue=e.hue,this.thumb.setStyleValue("left",e.hue*100+"%")}move(e){this.hsv.hue+=e,this.hsv.hue<0?this.hsv.hue=0:this.hsv.hue>1&&(this.hsv.hue=1),this.fire("hue_change",{hue:this.hsv.hue}),this.updateHue(this.hsv)}};s(we,"HueSlider"),we=p([h("x4")],we);var ye=class extends k{thumb;color;hsv={hue:1,saturation:1,value:1,alpha:1};mdown=!1;irect;constructor(e,t){super(e),this.setContent([new d({cls:"overlay checkers"}),this.color=new d({cls:"overlay color"}),this.thumb=new d({cls:"thumb",left:"50%"})]),this.setDOMEvents({pointerdown:s(o=>this._on_mousedown(o),"pointerdown"),pointermove:s(o=>this._on_mousemove(o),"pointermove"),pointerup:s(o=>this._on_mouseup(o),"pointerup")}),this.updateAlpha(),this.updateBaseColor(t)}_on_mousedown(e){this.mdown=!0,this.irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_on_mousemove(e){if(this.mdown){let t=this.irect,r=V(e.clientX-t.left,0,t.width)/t.width;this.hsv.alpha=r,this.updateAlpha(),this.fire("alpha_change",{alpha:this.hsv.alpha})}}_on_mouseup(e){this.mdown&&(this.releaseCapture(e.pointerId),this.mdown=!1)}updateAlpha(){this.thumb.setStyleValue("left",this.hsv.alpha*100+"%")}updateBaseColor(e){let t=new O(0,0,0);t.setHsv(e.hue,e.saturation,e.value,1),this.color.setStyleValue("backgroundImage",`linear-gradient(90deg, transparent, ${t.toRgbString(!1)})`)}setColor(e){this.hsv=e,this.updateBaseColor(e),this.updateAlpha()}move(e){this.hsv.alpha+=e,this.hsv.alpha<0?this.hsv.alpha=0:this.hsv.alpha>1&&(this.hsv.alpha=1),this.fire("alpha_change",{alpha:this.hsv.alpha}),this.updateAlpha()}};s(ye,"AlphaSlider"),ye=p([h("x4")],ye);var Ke=class extends y{_base;_sat;_swatch;_hue;_alpha;constructor(e){super(e),e.color instanceof O?this._base=e.color:this._base=new O(e.color);let t=this._base.toHsv();this.setAttribute("tabindex",0),this.setContent([this._sat=new _e({},t),new g({cls:"body",content:[new y({cls:"x4flex",content:[this._hue=new we({},t),this._alpha=new ye({},t)]}),new k({cls:"swatch",content:[new d({cls:"overlay checkers"}),this._swatch=new d({cls:"overlay"})]})]})]),this._sat.on("sat_change",r=>{t.saturation=r.saturation,t.value=r.value,o(),this._alpha.updateBaseColor(t)}),this._hue.on("hue_change",r=>{t.hue=r.hue,this._sat.updateBaseColor(t),this._alpha.updateBaseColor(t),o()}),this._alpha.on("alpha_change",r=>{t.alpha=r.alpha,o()});let o=s(()=>{this._base.setHsv(t.hue,t.saturation,t.value,t.alpha),this._swatch.setStyleValue("backgroundColor",this._base.toRgbString()),this._swatch.setAttribute("tooltip",this._base.toRgbString()),this.fire("change",{color:this._base})},"updateColor");yt("eyedropper")&&this._swatch.addDOMEvent("click",r=>{new window.EyeDropper().open().then(i=>{t=new O(i.sRGBHex).toHsv(),this._alpha.setColor(t),this._sat.updateBaseColor(t),this._hue.updateHue(t),o()})}),this.addDOMEvent("keydown",r=>this._onkey(r)),o()}_onkey(e){switch(e.key){case"ArrowLeft":{e.ctrlKey?this._hue.move(-.01):this._sat.move("saturation",-.01);break}case"ArrowRight":{e.ctrlKey?this._hue.move(.01):this._sat.move("saturation",.01);break}case"ArrowUp":{e.ctrlKey?this._alpha.move(.01):this._sat.move("value",.01);break}case"ArrowDown":{e.ctrlKey?this._alpha.move(-.01):this._sat.move("value",-.01);break}}}};s(Ke,"ColorPicker"),Ke=p([h("x4")],Ke);var $=class extends d{constructor(e){super(e)}};s($,"Viewport"),$=p([h("x4")],$);var G=class extends d{constructor(e){super(e),this.setContent(new $({}))}getViewport(){return this.firstChild()}};s(G,"ScrollView"),G=p([h("x4")],G);var se=class extends d{_view;_lastsel;_multisel;_items;preventFocus=!1;constructor(e){super({...e}),this.setAttribute("tabindex",0),this.mapPropEvents(e,"dblClick","selectionChange","contextMenu");let t=new G({cls:"body"});this._view=t.getViewport(),this._multisel=new Set,this._items=[],e.footer&&e.footer.setAttribute("id","footer"),this.setContent([t,e.footer]),this.setDOMEvents({click:s(o=>this._on_click(o),"click"),keydown:s(o=>this._on_key(o),"keydown"),dblclick:s(o=>this._on_click(o),"dblclick"),contextmenu:s(o=>this._on_ctx_menu(o),"contextmenu")}),e.items&&this.setItems(e.items)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){this._lastsel||(e==4?e=0:e=5);let t=s((o,r)=>{for(;o&&!o.isVisible();)o=r?o.nextElement():o.prevElement();return o},"next_visible");if(e==0||e==5){let o=e==0?this._view.firstChild():this._view.lastChild();if(o=t(o,e==0),o){let r=o.getInternalData("id");return this._selectItem(r,o,"single"),!0}}else{let o=this._itemWithID(this._lastsel),r=e==4?o.nextElement():o.prevElement();if(r=t(r,e==4),r){let n=r.getInternalData("id");return this._selectItem(n,r,"single"),!0}}return!1}_itemWithID(e){return this._view.enumChildComponents(!1).find(o=>o.getInternalData("id")===e)}_on_click(e){let t=e.target;for(;t&&t!=this.dom;){let o=P(t);if(o.dom.tagName==="INPUT")return;if(o&&o.hasClass("x4item")){let r=o.getInternalData("id"),n={context:r};e.type=="click"?this.fire("click",n):this.fire("dblClick",n),n.defaultPrevented||this._selectItem(r,o,e.ctrlKey?"toggle":"single");return}t=t.parentElement}this.clearSelection(),e.stopImmediatePropagation(),e.preventDefault()}_on_ctx_menu(e){e.preventDefault();let t=e.target;for(;t&&t!=this.dom;){let o=P(t);if(o&&o.hasClass("x4item")){let r=o.getInternalData("id");this._selectItem(r,o,"single"),this.fire("contextMenu",{uievent:e,context:r});return}t=t.parentElement}this.fire("contextMenu",{uievent:e,context:null})}_selectItem(e,t,o){if(this.props.multisel||(o="single"),this._lastsel=e,o=="single"){if(this._multisel.has(e))return;this._clearSelection(),t&&(this._multisel.add(e),t.addClass("selected"))}else t&&(this._multisel.has(e)?(t.removeClass("selected"),this._multisel.delete(e)):(this._multisel.add(e),t.addClass("selected")));t&&t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}getItem(e){return this._items.find(t=>t.id===e)}select(e,t=!0){if(U(e)||(e=[e]),!e.length){this._multisel.size&&this.clearSelection();return}if(e.some(o=>!this._multisel.has(o))){this._clearSelection();let o=this._view.enumChildComponents(!1);e.forEach(r=>{let n=o.find(i=>i.getInternalData("id")===r);n&&(this._multisel.add(r),n.addClass("selected"))}),this.fire("selectionChange",{selection:this.getSelection(),empty:this._multisel.size==0})}}_findItemIndex(e){return this._items.findIndex(t=>t.id==e)}_clearSelection(){let e=this._view.enumChildComponents(!1);this._multisel.size&&Array.from(this._multisel).forEach(o=>{let r=e.find(n=>n.getInternalData("id")===o);r&&r.removeClass("selected")}),this._multisel.clear()}clearSelection(){this._multisel.size&&(this._clearSelection(),this.fire("selectionChange",{selection:[],empty:!0}))}setItems(e,t=!1){let o=this.getSelection();if(this.clearSelection(),this._view.clearContent(),this._items=e,e){let r=e.map(n=>this.renderItem(n));this._view.setContent(r),t&&this.select(o)}}renderItem(e){var r;let o=((r=this.props.renderer)!=null?r:this.defaultRenderer)(e);return o.addClass("x4item"),o.setInternalData("id",e.id),o}defaultRenderer(e){return new g({cls:e.cls,content:new v({icon:e.iconId,text:e.text})})}filter(e){let t=this._view.enumChildComponents(!1);if(!e)t.forEach(o=>o.show(!0));else{let o=this._items.filter(r=>r.text.includes(e)).map(r=>r.id+"");t.forEach(r=>{r.show(o.includes(r.getInternalData("id")))})}}appendItem(e,t=!1,o=!0){o&&this._clearSelection();let r=this.renderItem(e);t?(this._items.unshift(e),this._view.prependContent(r)):(this._items.push(e),this._view.appendContent(r)),o&&this._selectItem(e.id,r,"single")}updateItem(e,t){let o=this._findItemIndex(e);if(o<0)return;let r=!1;this._multisel.has(e)&&(r=!0),this._items[o]=t;let n=this._itemWithID(t.id);if(n!=null&&n.dom){let i=this.renderItem(t);r&&i.addClass("selected"),this._view.dom.replaceChild(i.dom,n.dom)}}getSelection(){return Array.from(this._multisel)}};s(se,"Listbox"),se=p([h("x4")],se);var lr='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var ke=class extends S{_list;constructor(e,t){super(e),this._list=new se({items:e.items}),this.setContent(this._list),this.addDOMEvent("mousedown",o=>{console.log("trap"),o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault()},!0),this._list.on("selectionChange",o=>{this.fire("selectionChange",o)})}getList(){return this._list}};s(ke,"DropdownList"),ke=p([h("x4")],ke);var Ge=class extends d{_popup;_input;_button;_prevent_close=!1;_edit;constructor(e){super(e);let t=z();this.mapPropEvents(e,"selectionChange");let o=e.readonly!==!1;this.setContent([new g({id:"label",content:new v({tag:"label",text:e.label,labelFor:t,width:e.labelWidth})}),this._edit=new g({id:"edit",content:[this._input=new E({id:t,type:"text",value:"",readonly:o,required:e.required}),this._button=new I({icon:lr,tabindex:-1})]})]),e.name&&this.setAttribute("name",e.name),e.required&&this.setAttribute("required",!0),this._popup=new ke({items:e.items});let r=this._popup.getList(),n=s(i=>{let l=r.getItem(i);this._input.setValue(l?l.text:""),this._prevent_close||this._popup.show(!1)},"_select");this._popup.on("selectionChange",i=>{let[l]=i.selection;l!==void 0&&(n(l),this.fire("selectionChange",i))}),e.value&&n(e.value),this._button.addDOMEvent("click",()=>this._on_click()),this._input.addDOMEvent("input",()=>this._on_input()),this._input.addDOMEvent("keydown",i=>this._on_key(i)),this.setDOMEvents({focusout:s(()=>this._on_focusout(),"focusout"),click:s(()=>this._on_click(),"click")})}_on_key(e){switch(e.key){case"Enter":case"Escape":{this._popup.show(!1);break}case"ArrowUp":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(1):this.showDropDown(),this._prevent_close=!1;break;case"ArrowDown":this._prevent_close=!0,this._popup.isOpen()?this._popup.getList().navigate(4):this.showDropDown(),this._prevent_close=!1;break;default:return}e.preventDefault(),e.stopPropagation()}_on_input(){this._popup.isOpen()||this.showDropDown(),this._popup.getList().filter(this._input.getValue())}_on_focusout(){this._popup.show(!1)}_on_click(){this.showDropDown()}showDropDown(){if(this.isDisabled())return;let e=this._edit.getBoundingRect();this._popup.setStyleValue("minWidth",e.width+"px"),this._popup.displayNear(e,"top left","bottom left",{x:0,y:6})}setItems(e){this._getList().setItems(e)}getValue(){return this._input.getValue()}setValue(e){this._input.setValue(e)}selectItem(e){this._getList().select(e)}getSelection(){let[e]=this._getList().getSelection();return e}_getList(){return this._popup.getList()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getSelection(),"getRawValue"),setRawValue:s(o=>{this.selectItem(o)},"setRawValue"),isValid:s(()=>this._input.isValid(),"isValid")}:super.queryInterface(e)}};s(Ge,"Combobox"),Ge=p([h("x4")],Ge);var B=class extends k{validator;constructor(e){super({tag:"form",...e}),e.flex===!1&&this.addClass("no-flex"),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}_get_inputs(){return this.queryAll("[name]")}setValues(e){this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");e.hasOwnProperty(n)&&r.setRawValue(e[n])}})}getValues(){let e={};return this._get_inputs().forEach(o=>{let r=o.queryInterface("form-element");if(r){let n=o.getAttribute("name");e[n]=r.getRawValue()}}),e}setAutoComplete(e=!0){this._get_inputs().forEach(o=>{o.setAttribute("autocomplete",e?"on":"off")})}setValidator(e){this.validator||(this.validator=e,this.addDOMEvent("focusout",()=>this.validate()))}validate(){let e=this._get_inputs(),t={},o=!0;for(let r of e){let n=r.queryInterface("form-element");if(n){let i=r.getAttribute("name");t[i]=n.getRawValue(),n.isValid()||(o=!1)}}if(this.validator){let r={...t};if(!this.validator(r,o))return null;for(let n in t)r[n]!=t[n]&&this.query(`input[${n}"]`).queryInterface("form-element").setRawValue(r[n]);t=r}else o||(t=null);return t}};s(B,"Form"),B=p([h("x4")],B);var cr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var W=class extends S{form;constructor(e){super({tag:"dialog",modal:!0,...e}),this._ismodal=this.props.modal,this.mapPropEvents(e,"btnclick"),this.appendContent([new g({cls:"caption",content:[new v({id:"title",cls:"caption-element",icon:e.icon,text:e.title}),e.closable?new I({id:"closebox",icon:cr,tabindex:-1,click:s(()=>{D(e.closable)?this.fire("btnclick",{button:e.closable}):this.close()},"click")}):null]}),this.form=e.form?e.form:new B({}),new ne({id:"btnbar",reverse:!0,items:e.buttons,btnclick:s(t=>{this.fire("btnclick",t)},"btnclick")})]),this.addDOMEvent("keydown",t=>{if(t.key=="Escape")t.preventDefault(),t.stopPropagation();else if(t.key=="Enter"){let o=this.query("button.default");o&&(t.preventDefault(),t.stopPropagation(),o.click())}})}focusNext(e){let t=Ct(this.dom);if(t.length){let o=t[0],r=t[t.length-1],n=document.activeElement,i;if(!e&&n===o)i=r;else if(e&&n===r)i=o;else{let l=t.indexOf(n);e?i=t[l+1]:i=t[l-1]}return i?(i.focus(),!0):!1}else return!1}setContent(e){this.dom.replaceChild(this.form.dom,e.dom),this.form=e}getForm(){return this.form}getValues(){return this.form.getValues()}getButton(e){return this.query("#btnbar").getButton(e)}queryInterface(e){return e=="tab-handler"?{focusNext:s(o=>this.focusNext(o),"focusNext")}:super.queryInterface(e)}};s(W,"Dialog"),W=p([h("x4")],W);var dr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M144 480C64.5 480 0 415.5 0 336c0-62.8 40.2-116.2 96.2-135.9c-.1-2.7-.2-5.4-.2-8.1c0-88.4 71.6-160 160-160c59.3 0 111 32.2 138.7 80.2C409.9 102 428.3 96 448 96c53 0 96 43 96 96c0 12.2-2.3 23.8-6.4 34.6C596 238.4 640 290.1 640 352c0 70.7-57.3 128-128 128l-368 0zm79-217c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l39-39L296 392c0 13.3 10.7 24 24 24s24-10.7 24-24l0-134.1 39 39c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0l-80 80z"/></svg>';var Co=class Co extends d{constructor(e){var t;super({tag:"input",style:{display:"none"},attrs:{type:"file",multiple:(t=e.multiple)!=null?t:!1,accept:e.accept},dom_events:{change:s(()=>{let o=this.dom.files;e.callback(o)},"change")}})}showDialog(){this.dom.click()}};s(Co,"FileDialog");var mt=Co,We=class extends y{constructor(e){var o,r;super(e),this.mapPropEvents(e,"change");let t=new mt({accept:e.accept,multiple:e.multiple,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.setContent([t,new C({iconId:(o=e.icon)!=null?o:dr}),new F({text:(r=e.label)!=null?r:_.global.filedrop})]),this.setAttribute("tabIndex",0),this.addDOMEvent("click",()=>t.showDialog()),this.addDOMEvent("keydown",n=>{n.key==" "&&t.showDialog()}),Pt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}})}};s(We,"FileDrop"),We=p([h("x4")],We);var Mo=class Mo{name;id;fields;constructor(e){this.name=e,this.id=void 0,this.fields=[]}};s(Mo,"MetaInfos");var Eo=Mo,Vt=Symbol("metaField");function Ht(a,e=!0){let t=a.constructor,o=t.hasOwnProperty(Vt)?t[Vt]:void 0;if(o===void 0){e||console.assert(o!==void 0),o=new Eo(t.name);let r=Object.getPrototypeOf(t);if(r!=Io){let n=r[Vt];o.fields=[...n.fields,...o.fields],console.assert(o.id===void 0,"cannot define mutiple record id"),o.id||(o.id=n.id)}a.constructor[Vt]=o}return o}s(Ht,"_getMetas");var pr;(f=>{function a(){return(m,x)=>{let b=Ht(m);b.fields.push({name:x,type:"any",required:!0}),b.id=x}}f.id=a,s(a,"id");function e(m){return(x,b)=>{Ht(x).fields.push({name:b,...m})}}f.field=e,s(e,"field");function t(m){return e({...m,type:"string"})}f.string=t,s(t,"string");function o(m){return e({...m,type:"int"})}f.int=o,s(o,"int");function r(m){return e({...m,type:"float"})}f.float=r,s(r,"float");function n(m){return e({...m,type:"bool"})}f.bool=n,s(n,"bool");function i(m){return e({...m,type:"date"})}f.date=i,s(i,"date");function l(m){return e({...m,type:"calc"})}f.calc=l,s(l,"calc");function c(m,x){return f.field({...x,type:"array",model:m?new m:null})}f.array=c,s(c,"array");function u(m){return e({...m,type:"any"})}f.any=u,s(u,"any")})(pr||(pr={}));var Do=class Do{getFields(){return Ht(this,!1).fields}validate(e){let t=null;return this.getFields().forEach(r=>{r.required&&!this.getField(r.name,e)&&(t&&(t=[]),t.push(new Error(`field ${r.name} is required.`)))}),t}getFieldIndex(e){return this.getFields().findIndex(o=>o.name==e)}serialize(e){let t={};return this.getFields().forEach(o=>{o.calc===void 0&&(t[o.name]=e[o.name])}),t}unSerialize(e,t){let o=this.getFields(),r=new Ao;return o.forEach(n=>{let i=e[n.name];i!==void 0&&(r[n.name]=this._convertField(n,i))}),t!==void 0?r[o[0].name]=t:console.assert(this.getID(r)!==void 0),r}_convertField(e,t){switch(e.type){case"float":{let o=typeof t=="number"?t:parseFloat(t);if(e.prec!==void 0){let r=Math.pow(10,e.prec);o=Math.round(o*r)/r}return o}case"int":return typeof t=="number"?t:parseInt(t);case"date":return D(t)?new Date(t):t;case"array":{debugger;break}}return t}getID(e){if(!e)return null;let t=Ht(this,!1);return e[t.id]}getRaw(e,t){let o,r=this.getFields();if(typeof e=="string"){if(o=r.findIndex(i=>i.name==e),o<0){console.assert(!1,"unknown field: "+e);return}}else if(e<r.length){if(e<0)return;o=e}else{console.assert(!1,"bad field name: "+e);return}let n=r[o];return n.calc!==void 0?n.calc(t):t[n.name]}getField(e,t){let o=this.getRaw(e,t);return o==null?"":""+o}};s(Do,"DataModel");var Io=Do,Gd=Symbol("model"),Po=class Po{};s(Po,"DataRecord");var Ao=Po;var To=class To extends ee{m_index;m_store;m_model;m_sort;m_filter;m_props;constructor(e){super(),this.m_props=e,this.m_store=e.store,this.m_index=null,this.m_filter=null,this.m_sort=null,this.m_model=this.m_store.getModel(),this.filter(e.filter),e.order?D(e.order)?this.sort([{field:e.order,ascending:!0}]):U(e.order)?this.sort(e.order):this.sort([e.order]):this.sort(null),this.m_store.addListener("data_change",t=>this._storeChange(t))}_storeChange(e){this._filter(this.m_filter,e.type!="change"),this._sort(this.m_sort,e.type!="change"),this.fire("view_change",{change_type:"change"})}filter(e){return this.m_index=null,this._filter(e,!0)}_filter(e,t){return this.m_index=this.m_store.createIndex(e),this.m_filter=e,this.m_sort&&this.sort(this.m_sort),t&&this.fire("view_change",{change_type:"filter"}),this.m_index.length}sort(e){this._sort(e,!0)}_sort(e,t){this.m_index=this.m_store.sortIndex(this.m_index,e),this.m_sort=e,t&&this.fire("view_change",{change_type:"sort"})}getStore(){return this.m_store}getCount(){return this.m_index.length}indexOfId(e){let t=this.m_store.indexOfId(e);return this.m_index.findIndex(o=>o===t)}getByIndex(e){if(e>=0&&e<this.m_index.length){let t=this.m_index[e];return this.m_store.getByIndex(t)}return null}getIdByIndex(e){let t=this.getByIndex(e);return this.m_model.getID(t)}getRecId(e){return this.m_model.getID(e)}getById(e){return this.m_store.getById(e)}getModel(){return this.m_model}changed(){this.fire("view_change",{change_type:"change"})}forEach(e){this.m_index.some(t=>{let o=this.m_store.getByIndex(t);if(o&&e(o,t))return t})}};s(To,"DataView");var Nt=To;var ae=class extends d{_img;constructor(e){var t;if(super(e),this._img=new d({tag:"img",attrs:{loading:e.lazy,alt:e.alt,draggable:(t=e.draggable)!=null?t:!1},style:{width:"100%",height:"100%",objectFit:e.fit,objectPosition:e.position}}),this.setContent(this._img),this.setImage(e.src),e.candrop){this.mapPropEvents(e,"change","clear");let o=new mt({accept:e.accept,multiple:!1,callback:s(n=>{this.fire("change",{files:n})},"callback")});this.appendContent(o),this.addDOMEvent("click",()=>o.showDialog());let r=s((n,i)=>{var l;if((l=i.items)!=null&&l.length){let c=i.items[0].type;if(/image\/.*/.test(c))return!0}return!1},"filterInput");Pt.registerDropTarget(this,async(n,i,l)=>{if(n=="enter")this.addClass("hit");else if(n=="leave")this.removeClass("hit");else if(n=="drop"&&l.data.files&&l.data.files.length>0){let c=l.data.files;this.fire("change",{files:c})}},r),this.addDOMEvent("contextmenu",n=>{new N({items:[{text:_.global.cut,click:s(()=>{this.fire("clear",{})},"click")}]}).displayAt(n.pageX,n.pageY),n.stopPropagation(),n.preventDefault()})}}setImage(e){e?this._img.setAttribute("src",e):this.clear()}setBase64(e,t){this.setImage("data:"+e+";base64,"+t)}clear(){this._img.setAttribute("src","data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==")}};s(ae,"Image"),ae=p([h("x4")],ae);var ft=200,je=class extends d{_dataview;_datamodel;_columns;_lock;_dirty;_row_height;_left;_top;_body;_viewport;_fheader;_hheader;_vheader;_ffooter;_footer;_vis_rows;_start;_end;_selection;_num_fmt=new Intl.NumberFormat("fr-FR");_mny_fmt=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"});_dte_fmt=new Intl.DateTimeFormat("fr-FR",{});_has_fixed;_has_footer;constructor(e){super(e),this._lock=0,this._dirty=0,this._row_height=32,this._left=0,this._top=0,this._vis_rows=new Map,this._selection=new Set,this._has_fixed=!1,this._has_footer=e.footer,this._columns=e.columns.map(t=>t),this.mapPropEvents(e,"click","dblClick","contextMenu","selectionChange"),this.lock(!0),this.setAttribute("tabindex",0),this.addDOMEvent("created",()=>{this._init(),this._dirty=1,this.lock(!1)}),this.addDOMEvent("resized",()=>{this._updateFlexs(),this._computeFullSize(),this._update(!0)}),this.addDOMEvent("keydown",t=>{this._on_key(t)}),e.store&&this.setStore(e.store)}_on_key(e){if(!this.isDisabled()){switch(e.key){case"ArrowDown":{this.navigate(4);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(5);break}case"PageDown":{this.navigate(2);break}case"PageUp":{this.navigate(3);break}default:return}e.preventDefault(),e.stopPropagation()}}navigate(e){if(this._selection.size||(e==4||e==2?e=0:e=5),e==0||e==5){let t=e==0?0:this._dataview.getCount()-1;return this._clearSelection(),this._addSelection(t),this._scrollToIndex(t),!0}else if(e==1||e==4){let t=this._selection.values().next().value,o=e==4?t+1:t-1;if(o>=0&&o<this._dataview.getCount())return this._clearSelection(),this._addSelection(o),this._scrollToIndex(o),!0}else if(e==2||e==3){let t=this._vis_rows.size,o=this._selection.values().next().value,r=e==2?t:-t,n=o+r;if(n<0?n=0:n>=this._dataview.getCount()&&(n=this._dataview.getCount()-1),n!=o)return this._clearSelection(),this._addSelection(n),this._dataview.getCount()<ft&&(r*=this._row_height),this._viewport.dom.scrollBy(0,r),!0}return!1}_scrollToIndex(e,t="nearest"){let o=this.queryAll(`.row[data-row="${e}"]`);if(o.length)o.forEach(r=>{r.scrollIntoView({block:t})});else{let r=e;this._dataview.getCount()<ft&&(r*=this._row_height),this._viewport.dom.scrollTo(0,r)}}setStore(e){let t=s(o=>{this._viewport&&(o.change_type=="change"&&this._selection.clear(),this._updateFlexs(),this._computeFullSize(),this._update(!0))},"on_change");this._dataview&&this._dataview.off("view_change",t),e?(this._dataview=new Nt({store:e}),this._datamodel=e.getModel(),this._dataview.on("view_change",t)):(this._dataview=null,this._datamodel=null)}getView(){return this._dataview}lock(e){e?this._lock++:--this._lock==0&&this._dirty&&this._update(!0)}_getColCount(){return this._columns.length}_getCol(e){return this._columns[e]}_buildColHeader(e){var n;let t=[],o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i);if(!!l.fixed!=e)continue;let c=new T("right");c.on("stop",()=>{this._updateFlexs()}),c.on("resize",f=>{l.width=f.size,l.flex=0,this.queryAll(`[data-col="${i}"]`).forEach(b=>{b.setStyleValue("width",f.size+"px")});let x=r.getBoundingRect();e?this.setStyleVariable("--fixed-width",x.width+"px"):this._body.setStyleValue("width",x.width+"px")});let u=new d({cls:"cell",attrs:{"data-col":i},style:{width:l.width?l.width+"px":void 0},content:[new F({text:l.title,align:(n=l.header_align)!=null?n:"left"}),new d({cls:"sorter"}),c]});u.addDOMEvent("touchend",()=>{let f=u.getInternalData("touchend"),m=Date.now(),x=f?m-f:0;x>30&&x<300?this._sortCol(i):u.setInternalData("touchend",m)}),u.addDOMEvent("dblclick",()=>{this._sortCol(i)}),t.push(u)}if(e&&t.length==0)return null;let r=new k({cls:"col-header",content:t});return r.setClass("fixed",e),r}_buildColFooter(e){let t=[],o=this._getColCount();for(let n=0;n<o;n++){let i=this._getCol(n);if(!!i.fixed!=e)continue;let l=new d({cls:"cell",attrs:{"data-col":n},style:{width:i.width?i.width+"px":void 0},content:[new F({text:i.footer_val})]});l.addDOMEvent("dblclick",()=>{this._sortCol(n)}),t.push(l)}if(e&&t.length==0)return null;let r=new k({cls:"col-footer",content:t});return r.setClass("fixed",e),r}_sortCol(e,t){jt(!0),this.setTimeout("sort",50,()=>{let o=!0,r=this.query(`.col-header [data-col="${e}"`);t===void 0?r.hasClass("sorted")?r.hasClass("desc")?o=!0:o=!1:this.queryAll(".sorted").forEach(c=>c.removeClass("sorted asc desc")):o=t,r.setClass("sorted"),r.setClass("desc",!o);let n=this._getCol(e),i=!1;switch(n.type){case"checkbox":case"money":case"number":case"percent":i=!0}this._dataview.sort([{field:n.id,ascending:o,numeric:i}]),this._update(!0),jt(!1)})}sortCol(e,t){let o=this._columns.findIndex(r=>r.id===e);o>=0&&this._sortCol(o,t)}_renderCell(e,t,o){let r=t.id,n=t.type,i=this._datamodel.getRaw(r,e);if(i==null)return null;let l="";if(t.classifier&&o.push(t.classifier(i,e,r)),i instanceof Function)return i(e,r);if(t.formatter)return t.formatter(i);switch(n){case"checkbox":return i?new C({cls:"cell-check"+l,iconId:Bt}):void 0;case"image":return D(i)?new ae({cls:l,src:i,fit:"scale-down"}):void 0;case"number":{if(!R(i))return"NaN";i=this._num_fmt.format(i);break}case"money":{if(!R(i))return"NaN";i=this._mny_fmt.format(i);break}case"percent":return new k({cls:"percent"+l,content:new d({cls:"bar",width:i+"%"})});case"icon":return new C({cls:l,iconId:i+""});case"date":{i=this._dte_fmt.format(i);break}default:{i=i+"";break}}return new d({tag:"span",cls:l,content:i})}_buildRow(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(c.fixed)continue;let u=[],f=this._renderCell(t,c,u),m="start";switch(c.align){default:m="start";break;case"center":m="center";break;case"right":m="end";break}let x=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:m},content:f});u.length&&x.addClass(u.join(" ")),c.type&&x.addClass(c.type),x.setData("col",l+""),x.setData("row",e+""),r.push(x)}let i=new k({cls:"row",style:{top:o.toFixed(2)+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_buildRowHeader(e,t,o){let r=[],n=this._getColCount();for(let l=0;l<n;l++){let c=this._getCol(l);if(!(c!=null&&c.fixed))continue;let u=this._renderCell(t,c.id,[c.type]),f="start";switch(c.align){default:f="start";break;case"center":f="center";break;case"right":f="end";break}let m=new d({cls:"cell",style:{width:c!=null&&c.width?c.width+"px":void 0,justifyContent:f},content:u});c.type&&m.addClass(c.type),m.setData("col",l+""),m.setData("row",e+""),r.push(m)}let i=new k({cls:"row",style:{top:o+"px"},content:r});return i.setData("row",e+""),this._selection.has(e)&&i.addClass("selected"),i}_updateFlexs(){let e=0,t=0,o=this._getColCount();for(let r=0;r<o;r++){let n=this._getCol(r);!n.fixed&&n.flex?t+=n.flex:e+=n.width}if(t){let i=(this._viewport.dom.clientWidth-e)/t;for(let l=0;l<o;l++){let c=this._getCol(l);!c.fixed&&c.flex&&(c.width=Math.max(c.flex*i,32),this.queryAll(`[data-col="${l}"]`).forEach(f=>{f.setStyleValue("width",c.width+"px")}))}}}_computeFullSize(){let e=0,t=0,o=this._getColCount();for(let i=0;i<o;i++){let l=this._getCol(i),c=0;l.fixed&&(this._has_fixed=!0),l.width&&(c+=l.width),l.fixed?t+=c:e+=c}let r=this._dataview.getCount(),n=r;if(r<ft)n*=this._row_height;else{let l=this._body.dom.parentElement.clientHeight/this._row_height;n=r-Math.floor(l)+l*this._row_height}this.setStyleVariable("--fixed-width",t+"px"),this._body.setStyleValue("height",n+"px"),this._body.setStyleValue("width",e+"px"),this._vheader.setStyleValue("height",n+"px")}_init(){this._body=new d({cls:"body"}),this._viewport=new $({content:this._body}),this._has_footer||this.setStyleVariable("--footer-height","0"),this._viewport.addDOMEvent("scroll",t=>{this._left=this._viewport.dom.scrollLeft,this.setStyleVariable("--left",-this._left+"px"),this._top=this._viewport.dom.scrollTop,this.setStyleVariable("--top",-this._top+"px"),this._update()}),this.addDOMEvent("wheel",t=>{if(t.deltaY&&this._dataview.getCount()>=ft&&(this._viewport.dom.scrollBy(0,t.deltaY<0?-1:1),t.stopPropagation(),t.preventDefault()),this._has_fixed&&t.deltaY){let o=t.target;for(;o!=this.dom;){if(o==this._vheader.dom){this._viewport.dom.scrollBy(0,t.deltaY<0?-this._row_height:this._row_height),t.stopPropagation(),t.preventDefault();break}o=o.parentNode}}});let e=s(t=>{let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o)return o.getIntData("row")},"targetRow");this.addDOMEvent("click",t=>{let o=e(t);o!==void 0&&(this._selection.has(o)||(this._clearSelection(),this._addSelection(o)))}),this.addDOMEvent("dblclick",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o)),this._on_dblclk(t,o);let r=this._dataview.getByIndex(o);this.fire("dblClick",{context:r})}}),this.addDOMEvent("contextmenu",t=>{let o=e(t);if(o!==void 0){this._selection.has(o)||(this._clearSelection(),this._addSelection(o));let r=this._dataview.getByIndex(o);this.fire("contextMenu",{uievent:t,context:r})}t.preventDefault(),t.stopPropagation()}),this.addDOMEvent("mouseover",t=>{if(!this._has_fixed)return;let o=d.parentElement(t.target,d);for(;o&&!o.hasClass("row");)o=o.parentElement();if(o){let r=o.getData("row");this.queryAll(".hover").forEach(n=>n.removeClass("hover")),r&&this.queryAll(`.row[data-row="${r}"]`).forEach(i=>i.addClass("hover"))}}),this.addDOMEvent("mouseleave",t=>{this._has_fixed&&this.queryAll(".hover").forEach(o=>o.removeClass("hover"))}),this._updateFlexs(),this._fheader=this._buildColHeader(!0),this._hheader=this._buildColHeader(!1),this._vheader=new k({cls:"row-header"}),this._has_footer&&(this._ffooter=this._buildColFooter(!0),this._footer=this._buildColFooter(!1)),this.setContent([this._viewport,this._fheader,this._hheader,this._ffooter,this._footer,this._vheader]);{let t=this.getStyleVariable("--row-height");this._row_height=parseInt(t)}this._computeFullSize()}_on_dblclk(e,t){}_update(e=!1){if(!this._lock){let t=this.getBoundingRect(),o=this._dataview.getCount(),r=o<ft?this._row_height:1,n=Math.floor(this._top/r),i=n+Math.ceil(t.height/this._row_height),l=this._has_fixed;if(this._start!=n||this._end!=i||e){let c=[],u=[];e&&this._vis_rows.clear();let f=new Map,m=n*r;for(let x=n;x<i&&x<o;x++,m+=this._row_height){let b=this._vis_rows.get(x),w=this._dataview.getByIndex(x);l?(b?(b.h.setStyleValue("top",m+"px"),b.r.setStyleValue("top",m+"px")):b={h:this._buildRowHeader(x,w,m),r:this._buildRow(x,w,m)},u.push(b.h)):b?b.r.setStyleValue("top",m+"px"):b={h:null,r:this._buildRow(x,w,m)},c.push(b.r),f.set(x,b)}l&&u.push(new d({cls:"cell-out",style:{top:m+"px"}})),this._vis_rows=f,this._start=n,this._end=i,this._body.setContent(c),l?(this._vheader.removeClass("@hidden"),this._vheader.setContent(u)):this._vheader.addClass("@hidden")}}}_clearSelection(){for(let e of this._selection.keys())this.queryAll(`.row[data-row="${e}"]`).forEach(o=>{o.removeClass("selected")});this._selection.clear()}_addSelection(e){this._selection.add(e),this.queryAll(`.row[data-row="${e}"]`).forEach(r=>{r.addClass("selected")});let o=this._dataview.getByIndex(e);this.fire("selectionChange",{selection:o,empty:!1})}getSelection(){return this._selection.size==0?null:[...this._selection.values()].map(t=>this._dataview.getByIndex(t))}getFirstSel(){if(this._selection.size==0)return null;let e=this._selection.values().next().value;return this._dataview.getByIndex(e)}selectItem(e){let t=this._dataview.indexOfId(e);t>=0&&this._addSelection(t)}};s(je,"Gridview"),je=p([h("x4")],je);var Ye=class extends g{_els;_vwp;constructor(e){var t;super(e),this._els=(t=e.items)==null?void 0:t.map(o=>{let r=new v({cls:"cell",text:o.title,icon:o.iconId}),n=new T("right");return o.width>0?(r.setStyleValue("width",o.width+"px"),r.setInternalData("width",o.width)):o.width<0?r.setInternalData("flex",-o.width):r.setInternalData("width",0),n.addDOMEvent("dblclick",i=>{r.setInternalData("flex",1),this._calc_sizes()}),n.on("resize",i=>{r.setInternalData("flex",0),r.setInternalData("width",i.size),this._calc_sizes()}),r.appendContent(n),r.setInternalData("data",o),r}),this.addDOMEvent("resized",()=>this._on_resize()),this.addDOMEvent("created",()=>this._calc_sizes()),this._vwp=new g({content:this._els}),this.setContent(this._vwp)}_calc_sizes(){let e=0,t=0;this._els.forEach(l=>{let c=l.getInternalData("flex");if(c)e+=c;else{let u=l.getInternalData("width");if(u==0){let f=l.getBoundingRect();u=Math.ceil(f.width)+2,l.setInternalData("width",u)}t+=u}});let r=this.getBoundingRect().width-t,n=Math.ceil(r/e);console.log("filled",t),console.log("count",e),console.log("rest",r),console.log("unit",n);let i=0;this._els.forEach(l=>{let c=0,u=l.getInternalData("flex");u?(c=Math.min(n*u,r),r-=c):c=l.getInternalData("width"),l.setWidth(c),i+=c}),this._vwp.setWidth(i)}_on_resize(){this._calc_sizes()}};s(Ye,"Header"),Ye=p([h("x4")],Ye);var hr=Symbol("socket"),So=null,Ro=class Ro{getMaxTouchPoints(){return navigator.maxTouchPoints}};s(Ro,"Process");var Lo=Ro,gt=class gt extends ee{env=new Map;mainview;constructor(){super(),console.assert(So==null,"Application must be a singleton."),So=this}setMainView(e){this.mainview=e,document.body.appendChild(e.dom),this._setupKeyboard()}static instance(){return So}getMainView(){return this.mainview}setEnv(e,t){this.env.set(e,t)}getEnv(e,t){var o;return(o=this.env.get(e))!=null?o:t}static fireGlobal(e,t){gt.instance().fire("global",{msg:e,params:t})}_setupKeyboard(){document.addEventListener("keydown",e=>{(e.key=="Tab"||e.key=="Enter")&&this.focusNext(!e.shiftKey)&&e.preventDefault()})}focusNext(e){let t=document.activeElement,o;for(;t!=document.body;){let n=P(t).queryInterface("tab-handler");if(n)return n.focusNext(e);t.classList.contains("x4box")&&(o=t),t=t.parentElement}if(o){let r=Ct(o);if(r.length){let n=r[0],i=r[r.length-1],l;if(!e&&document.activeElement===n?l=i:e&&document.activeElement===i&&(l=n),l)return l.focus(),!0}else return!0}return!1}setupSocketMessaging(e,t){let o=window.location.protocol==="https:"?"wss://":"ws://",r=e?o+e:`${o}${window.location.hostname}:${window.location.port}/ws`,n=0,i=null;this.on("global",l=>{l.hasOwnProperty(hr)||i&&i.send(JSON.stringify({msg:l.msg,params:l.params}))}),i=new WebSocket(r,"messaging"),i.onopen=()=>{console.log("websocket opened"),n=1},i.onmessage=l=>{if(l.data!="ping"){let c=JSON.parse(l.data);c[hr]=!0,this.fire("global",c)}},i.onclose=l=>{console.log("websocket closed:",l),i=null,n&&(t(),n=0)}}getStorage(e){return localStorage.getItem(e)}getStorageJSON(e){try{return JSON.parse(localStorage.getItem(e))}catch{return}}setStorage(e,t){localStorage.setItem(e,t+"")}setStorageJSON(e,t){localStorage.setItem(e,JSON.stringify(t))}};s(gt,"Application"),L(gt,"process",new Lo);var Ut=gt;var ur='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M576 128c0-35.3-28.7-64-64-64L205.3 64c-17 0-33.3 6.7-45.3 18.7L9.4 233.4c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6L160 429.3c12 12 28.3 18.7 45.3 18.7L512 448c35.3 0 64-28.7 64-64l0-256zM271 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"/></svg>';var mr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M214.6 41.4c-12.5-12.5-32.8-12.5-45.3 0l-160 160c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 141.2 160 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-306.7L329.4 246.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-160-160z"/></svg>';var fr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" fill="currentColor"><!--!Font Awesome Free 6.7.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zm151 118.3C226 97.7 269.5 80 320 80c65.2 0 118.8 29.6 159.9 67.7C518.4 183.5 545 226 558.6 256c-12.6 28-36.6 66.8-70.9 100.9l-53.8-42.2c9.1-17.6 14.2-37.5 14.2-58.7c0-70.7-57.3-128-128-128c-32.2 0-61.7 11.9-84.2 31.5l-46.1-36.1zM394.9 284.2l-81.5-63.9c4.2-8.5 6.6-18.2 6.6-28.3c0-5.5-.7-10.9-2-16c.7 0 1.3 0 2 0c44.2 0 80 35.8 80 80c0 9.9-1.8 19.4-5.1 28.2zm9.4 130.3C378.8 425.4 350.7 432 320 432c-65.2 0-118.8-29.6-159.9-67.7C121.6 328.5 95 286 81.4 256c8.3-18.4 21.5-41.5 39.4-64.8L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5l-41.9-33zM192 256c0 70.7 57.3 128 128 128c13.3 0 26.1-2 38.2-5.8L302 334c-23.5-5.4-43.1-21.2-53.7-42.3l-56.1-44.2c-.2 2.8-.3 5.6-.3 8.5z"/></svg>';var pn={"fr-FR":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-GB":{lines:{lower:["1 2 3 4 5 6 7 8 9 0","a z e r t y u i o p {2}","q s d f g h j k l m {3}","{4} w x c v b n , . {4}","{5} {6} ' {7}"],upper:["! @ # $ % ^ & * ( ) _ +","A Z E R T Y U I O P {2}","Q S D F G H J K L M {3}","{4} W X C V B N ? : {4}","{5} {6} ' {7}"],number:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 . {3} {9}"],date:["1 2 3 {2}","4 5 6 {8}","7 8 9 {9}","0 / {3} {9}"]}},"en-US":"en-GB"},gr=/text|password|search|tel|url/i,Qe=class extends g{mode;locale;keyboard;visible;input;constructor(e){super({...e,id:"v-keyboard"}),this.mode="lower",this.locale="fr-FR",this.visible=!1,document.addEventListener("focusin",t=>this.handleFocus(t.target,!0),!1),document.addEventListener("focusout",t=>this.handleFocus(t.target,!1),!1),this.hide(),this.addDOMEvent("mousedown",t=>{this.handleKey(t),t.preventDefault(),t.stopPropagation()})}handleKey(e){let t=e.target,o;for(;t!==this.dom;){if(t.hasAttribute("data-key")){o=parseInt(t.getAttribute("data-key"),10);break}t=t.parentNode}if(o)switch(o){case 2:{this.fireKey(0,this._backspace);break}case 3:{this._focusNext();break}case 4:{this.mode=="lower"?this.mode="upper":this.mode="lower",this._redraw();break}case 5:{this._switchMode("number");break}case 6:{this.fireKey(32,this._insertChar);break}case 7:{this.hide();break}case 8:{this._switchMode("lower");break}default:{this.fireKey(o,this._insertChar);break}}}_focusNext(){Ut.instance().focusNext(!0)}_switchMode(e){this.mode=e,this._redraw()}_redraw(){this.setContent([new Q,this.keyboard=new y({id:"kb",cls:this.mode,content:this._createContent()}),new Q])}_scrollIntoView(e){let t=e.parentElement;for(;t!=document.body;){if(t.style.overflowY!==""){let o=e.getBoundingClientRect(),r=t.getBoundingClientRect();o.top<r.top?e.scrollIntoView(!0):o.bottom>r.bottom&&e.scrollIntoView(!1);break}t=t.parentElement}}_updateVis=s(()=>{if(this.visible){if(this.input){this.show(),this._scrollIntoView(this.input);let e=this.input.type,t=this.input.getAttribute("data-type");e==="number"||t==="number"?this._switchMode("number"):e==="date"||t==="date"?this._switchMode("date"):this._switchMode("lower")}}else this.hide(),this.input=null},"_updateVis");showOn(e){this.handleFocus(e.dom,!0)}handleFocus(e,t){if(t&&e.tagName=="INPUT"&&!e.readOnly){this.input=e,this.visible=!0,this.setTimeout("vis",200,this._updateVis);return}this.visible=!1,this.setTimeout("vis",200,this._updateVis)}_insertChar(e,t,o){return t=t.substring(0,e.start)+o.toString()+t.substring(e.end),e.start+=o.length,e.end=e.start,t}_backspace(e,t){return t=t.substring(0,e.start-1)+t.substring(e.start),e.start-=1,e.end=e.start,t}_getCaret(){if(this.input&&gr.test(this.input.type)){let e={start:this.input.selectionStart||0,end:this.input.selectionEnd||0};return e.end<e.start&&(e.end=e.start),e}else{let e=this.input.value.length;return{start:e,end:e}}}_restoreCaretPos(e){gr.test(this.input.type)&&(this.input.selectionStart=e.start,this.input.selectionEnd=e.end)}fireKey(e,t){let o=this._getCaret(),r=this.input.value;r=t.call(this,o,r,String.fromCharCode(e)),this.input.value=r,this._restoreCaretPos(o)}_createContent(){let e=pn[this.locale].lines[this.mode],t=[];for(let o=0;o<e.length;o++){let r=e[o].split(" "),n=[];for(let i=0;i<r.length;i++){let l="tch c"+i,c=r[i],u,f=null;if(c.length>2&&c[0]=="{"&&c[c.length-1]=="}"){let x=parseInt(c.substring(1,c.length-1),10);switch(x){default:case 0:{c="",l+=" x4hidden";break}case 1:{c="";break}case 2:{c=void 0,f=ur,l+=" cdel";break}case 3:{c=_.global.keyboard.next,l+=" cret";break}case 4:{c=void 0,f=mr,l+=" cshift";break}case 5:{c=_.global.keyboard.numeric,l+=" cnum";break}case 6:{c=" ",l+=" cspace";break}case 7:{c=void 0,f=fr,l+=" chide";break}case 8:{c=_.global.keyboard.alpha,l+=" calpha";break}case 9:{c="",l+=" cplace";break}}u=x}else u=r[i].charCodeAt(0);let m=new I({cls:l,label:c,attrs:{"data-key":u},icon:f});n.push(m)}t.push(new g({cls:"line",content:n}))}return t}};s(Qe,"Keyboard"),Qe=p([h("x4")],Qe);var $e=class extends d{constructor(e){super({tag:"a",...e}),this.setAttribute("href",e.href),this.mapPropEvents(e,"click"),this.setContent(new v({text:e.text,icon:e.icon})),this.addDOMEvent("click",t=>this._on_click(t))}setText(e){this.setContent(e)}_on_click(e){let t={context:this.props.href};this.fire("click",t),t.preventDefault&&(e.preventDefault(),e.stopPropagation())}};s($e,"Link"),$e=p([h("x4")],$e);var xr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24l0 112c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-112c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var Fo='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>';var Ce=class extends W{constructor(e){super(e)}static _create(e,t,o){return new Ce({modal:!0,title:o!=null?o:_.global.error,movable:!0,form:new B({content:[new g({content:[new C({iconId:xr}),new v({text:e})]})]}),buttons:t!=null?t:["ok.outline","cancel.outline"]})}static show(e,t,o){let r=this._create(e,t,o);return r.on("btnclick",n=>{he(()=>{r.close()})}),r.show(),r}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{he(()=>{r(l.button),i.close()})}),i.show()})}};s(Ce,"MessageBox"),Ce=p([h("x4")],Ce);var Ee=class extends W{constructor(e){super(e)}getValue(){return this.query("input").getValue()}static _create(e,t,o){return new Ee({modal:!0,title:o,movable:!0,form:new B({content:[new g({content:[new C({iconId:Fo}),new y({flex:1,content:[new v({text:e}),new E({value:t,type:"text"})]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise((r,n)=>{let i=this._create(e,t,o);i.on("btnclick",l=>{he(()=>{r(l.button=="ok"?i.getValue():null),i.close()})}),i.show()})}};s(Ee,"InputBox"),Ee=p([h("x4")],Ee);var Ie=class extends W{constructor(e){super(e)}static _create(e,t,o){return new Ie({modal:!0,title:o,movable:!0,form:new B({content:[new g({content:[new C({iconId:Fo}),new y({flex:1,cls:"right",content:[new v({text:e}),t]})]})]}),buttons:["ok.outline.default","cancel.outline"]})}static async showAsync(e,t,o){return new Promise(r=>{let n=this._create(e,t,o);n.on("btnclick",i=>{he(()=>{r(i.button),n.close()})}),n.show()})}};s(Ie,"PromptBox"),Ie=p([h("x4")],Ie);var br='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';var vr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"/></svg>';var _r='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M207.4 20.4c2.4 8.5-2.6 17.3-11.2 19.7C101.5 66.2 32 153 32 256c0 123.7 100.3 224 224 224s224-100.3 224-224c0-103-69.5-189.8-164.3-215.9c-8.5-2.4-13.5-11.2-11.2-19.7s11.2-13.5 19.7-11.2C432.5 39.1 512 138.2 512 256c0 141.4-114.6 256-256 256S0 397.4 0 256C0 138.2 79.5 39.1 187.7 9.2c8.5-2.4 17.3 2.6 19.7 11.2z"/></svg>';var wr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M192 233.4L59.5 100.9 36.9 123.5 169.4 256 36.9 388.5l22.6 22.6L192 278.6 324.5 411.1l22.6-22.6L214.6 256 347.1 123.5l-22.6-22.6L192 233.4z"/></svg>';var Ze=class extends S{constructor(e){super({});let t=e.iconId;t||(e.loading?(t=_r,this.addClass("")):e.mode=="danger"?t=vr:t=br),this.addClass(e.mode);let o=new C({iconId:t});e.loading&&(o.addClass("rotate"),this.props.modal=!0),this.setContent(new g({content:[o,new y({cls:"body",content:[e.title?new v({cls:"title",text:e.title}):null,new v({cls:"text",text:e.text})]}),e.closable?new I({cls:"outline",icon:wr,click:s(()=>{this.close()},"click")}):null]}))}close(){this.clearTimeout("close"),super.close()}display(e=0){let t=new J(0,0,window.innerWidth,window.innerHeight);this.displayNear(t,"bottom right","bottom right",{x:-20,y:-10}),e&&this.setTimeout("close",e*1e3,()=>{this.close()})}};s(Ze,"Notification"),Ze=p([h("x4")],Ze);var Je=class extends y{_title;_body;constructor(e){var o;super({...e,content:void 0});let t=(o=e.bodyModel)!=null?o:y;super.setContent([this._title=new v({tag:"legend",text:e.title,icon:e.icon}),this._body=new t({cls:"body",content:e.content})])}setContent(e){this._body.setContent(e)}setTitle(e){this._title.setContent(e)}};s(Je,"Panel"),Je=p([h("x4")],Je);var Xe=class extends d{_bar;constructor(e){super(e),this.setContent(this._bar=new d({cls:"bar"})),this.setValue(e.value)}setValue(e){let t=e/(this.props.max-this.props.min)*100;this._bar.setStyleValue("width",t+"%")}};s(Xe,"Progress"),Xe=p([h("x4")],Xe);var le=class extends d{constructor(e){super({tag:"select",...e}),this.mapPropEvents(e,"focus","change"),e.name&&this.setAttribute("name",e.name),this.setItems(e.items),this.addDOMEvent("blur",t=>{this.on_focus(t,!0)}),this.addDOMEvent("focus",t=>{this.on_focus(t,!1)}),this.addDOMEvent("input",t=>{this.on_change(t)}),e.multiple&&this.setAttribute("multiple",!0),e.value&&this.setValue(e.value)}on_focus(e,t){let o={focus_out:t};this.fire("focus",o),o.defaultPrevented&&e.preventDefault()}on_change(e){let t={value:this.getValue()};this.fire("change",t),t.defaultPrevented&&e.preventDefault()}setItems(e){this.setContent(e.map(t=>new d({tag:"option",attrs:{value:t.id},content:t.text})))}getValue(){return this.dom.value}setValue(e){this.dom.value=e+""}};s(le,"Select"),le=p([h("x4")],le);var yr='data:image/svg+xml,<svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">%0D%0A%09<path class="fa-primary" d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd">%0D%0A%09</path>%0D%0A</svg>';var et=class extends y{root;groups;constructor(e){super(e),this.root=new d({cls:"root"}),this.setContent(this.root),e.groups&&this.setItems(e.groups)}setItems(e){this.groups=e,this.groups.sort((o,r)=>o.title>r.title?1:0);let t=[];for(let o of this.groups)t.push(this.makeGroupHeader(o)),o.items.forEach(r=>{t.push(this.makePropertyRow(r))});this.root.setContent(t)}makeGroupHeader(e){let t=s(r=>{let n;r.hasClass("collapsed")?(r.removeClass("collapsed"),n=!0):(r.addClass("collapsed"),n=!1);let i=r.nextElement();for(;i&&i.hasClass("row");)i.show(n),i=i.nextElement()},"toggle"),o=new g({cls:"group",content:[e.icon?new C({id:"icon",iconId:e.icon}):null,new y({content:[new F({cls:"title",text:e.title}),e.desc?new F({cls:"desc",text:e.desc}):null]}),e.collapsible?new I({icon:yr,click:s(r=>t(o),"click")}):null]});return o.setClass("collapsible",e.collapsible),o}makePropertyRow(e){var r;let t,o=Yo(e.value)?e.value(e.name):e.value;return e.value=o,e.type==="boolean"?t=new E({type:"checkbox",id:e.name,name:e.name,checked:o,dom_events:{change:s(n=>{var i;(i=e.callback)==null||i.call(e,e.name,t.dom.checked)},"change")}}):e.type==="options"?t=new le({value:o,id:e.name,items:e.options,name:e.name,change:s(n=>{var i;debugger;(i=e.callback)==null||i.call(e,e.name,n.value)},"change")}):e.type==="password"?t=new E({type:"password",id:e.name,name:e.name,value:o,focus:s(n=>{var i;n.focus_out&&((i=e.callback)==null||i.call(e,e.name,t.getValue()))},"focus")}):e.type==="number"?t=new E({type:"number",id:e.name,name:e.name,value:o,step:e.step,focus:s(n=>{var i;n.focus_out&&((i=e.callback)==null||i.call(e,e.name,t.getNumValue()))},"focus"),change:s(()=>{var n;e.live&&((n=e.callback)==null||n.call(e,e.name,t.getNumValue()))},"change")}):t=new E({type:"text",id:e.name,name:e.name,value:o,focus:s(n=>{var i;n.focus_out&&((i=e.callback)==null||i.call(e,e.name,t.getValue()))},"focus")}),new g({cls:"row",content:[new d({cls:"cell hdr",content:(r=e.title)!=null?r:e.name,tooltip:e.desc}),new d({cls:"cell",tag:"label",attrs:{labelFor:e.name},content:t})]})}setPropValue(e,t){let r=this.groups.flatMap(n=>[...n.items]).find(n=>n.name==e);if(r)if(r.type==="boolean"){let n=this.root.query("#"+r.name);n&&n.setCheck(t)}else if(r.type==="options"){let n=this.root.query("#"+r.name);n&&n.setValue(t)}else if(r.type==="number"){let n=this.root.query("#"+r.name);n&&n.setNumValue(t,-2)}else{let n=this.root.query("#"+r.name);n&&n.setValue(t)}}};s(et,"PropertyGrid"),et=p([h("x4")],et);var kr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 5 5" aria-hidden="true">%0D%0A%09<circle class="fa-primary" cx="2.5" cy="2.5" r="2.5" ></circle>%0D%0A%09<circle class="fa-secondary" cx="2.5" cy="2.5" r="1.25"></circle>%0D%0A</svg>';var tt=class extends d{_check;_input;_label;constructor(e){super(e),this.mapPropEvents(e,"change");let t=z();this.setContent([this._check=new g({cls:"inner",content:[this._input=new E({type:"radio",id:t,name:e.name,value:e.value,checked:e.checked,dom_events:{change:s(()=>this._on_change(),"change")}})]}),this._label=new v({tag:"label",text:e.label,id:void 0,labelFor:t,icon:e.icon})]),ht.load(kr).then(o=>{this._check.dom.insertAdjacentHTML("beforeend",o)}),this.addDOMEvent("click",o=>this._on_click(o))}_on_click(e){e.target==this.dom&&(this._input.dom.click(),e.preventDefault(),e.stopPropagation())}_on_change(){this.fire("change",{value:this.getValue()})}setCheck(e){let t=this._input.dom;t.checked=e}setLabel(e){this._label.setText(e)}getValue(){return this._input.getValue()}};s(tt,"Radio"),tt=p([h("x4")],tt);var Cr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M288.1 0l86.5 164 182.7 31.6L428 328.5 454.4 512 288.1 430.2 121.7 512l26.4-183.5L18.9 195.6 201.5 164 288.1 0z"/></svg>';var ot=class extends g{m_els;m_input;constructor(e){var t;super(e),e.steps=(t=e.steps)!=null?t:5,this._update()}_update(){var r,n;let e=this.props,t=(r=e.icon)!=null?r:Cr,o=(n=e.value)!=null?n:0;this.m_input=new E({type:"text",hidden:!0,name:e.name,value:""+o}),this.addDOMEvent("click",i=>this._on_click(i)),this.m_els=[];for(let i=0;i<e.steps;i++){let l="item";i+1<=o&&(l+=" checked");let c=new C({cls:l,iconId:t});c.setInternalData("value",i),this.m_els.push(c)}this.m_els.push(this.m_input),this.setContent(this.m_els)}getValue(){var e;return(e=this.props.value)!=null?e:0}setValue(e){this.props.value=e;for(let t=0;t<this.props.steps;t++)this.m_els[t].setClass("checked",this.m_els[t].getInternalData("value")<=e);this.m_input.setValue(""+this.props.value)}setSteps(e){this.props.steps=e,this._update()}setShape(e){this.removeClass(this.props.icon),this.props.icon=e}_on_click(e){let t=P(e.target);t=t.parentElement(C),t&&this.setValue(t.getInternalData("value")),this.fire("change",{value:this.props.value})}};s(ot,"Rating"),ot=p([h("x4")],ot);var Oo=class Oo extends d{constructor(e){super(e),this.addDOMEvent("resized",()=>this.update())}update(){var u,f,m,x;let e=this.props,t=e.values;if(!t.length){this.clearContent();return}let o=this.getBoundingRect(),r=(u=e.min)!=null?u:0,n=(f=e.max)!=null?f:100,i=o.width/t.length,l=o.height/(n-r),c=new St;if(e.background&&c.rect(0,0,o.width,o.height).fill(e.background.toHexString()),r!=0&&c.path().moveTo(0,0-r).lineTo(o.width,0-r).stroke("var(--tickline-axis-color)",1).antiAlias(!1),e.type=="line"){let b=c.path();for(let w=0;w<t.length;w++)w==0?b.moveTo(w*i,(t[w]-r)*l):b.lineTo(w*i,(t[w]-r)*l);b.stroke(e.color?e.color.toHexString():"var(--tickline-color)",1).no_fill()}else for(let b=0;b<t.length;b++)c.rect(b*i,(0-r)*l,i-1,t[b]*l).fill(e.color?e.color.toHexString():"var(--tickline-color)").antiAlias(!1);this.setContent(new Lt({width:"100%",height:"100%",svg:c,attrs:{viewport:`0 ${(m=e.min)!=null?m:0} ${t.length} ${(x=e.max)!=null?x:100}`}}))}};s(Oo,"TickLine");var Er=Oo;var rt=class extends d{_mdown=!1;_irect=null;_thumb=null;_bar=null;_range=null;constructor(e){super(e),this.mapPropEvents(e,"change"),e.vertical&&this.addClass("vertical"),this.setContent([new g({cls:"track",content:[this._bar=new d({cls:"bar"}),this._thumb=new d({cls:"thumb"})]}),this._range=new E({type:"range",hidden:!0,value:e.value,min:e.min,max:e.max,step:e.step})]),this.setAttribute("tabindex",0),this.setDOMEvents({pointerdown:s(t=>this._on_mousedown(t),"pointerdown"),pointermove:s(t=>this._on_mousemove(t),"pointermove"),pointerup:s(t=>this._on_mouseup(t),"pointerup"),keydown:s(t=>this._on_key(t),"keydown")}),this._update()}_on_mousedown(e){e.stopPropagation(),e.preventDefault(),this.focus(),this._mdown=!0,this._irect=this.getBoundingRect(),this.setCapture(e.pointerId)}_getMinMax(){let e=parseInt(this._range.getAttribute("min")),t=parseInt(this._range.getAttribute("max"));return[e,t]}_on_mousemove(e){if(this._mdown){let t,o;this.props.vertical?(t=e.offsetY,o=this._irect.height):(t=e.offsetX,o=this._irect.width);let r=t/o;this.props.vertical&&(r=1-r);let[n,i]=this._getMinMax();this._range.setNumValue(n+r*(i-n)),this._update()}}_update(){let e=this._range.getNumValue(),[t,o]=this._getMinMax(),r=o>t?e/Math.abs(o-t)*100:0;this.props.vertical?(r=100-r,this._thumb.setStyleValue("top",r+"%"),this._bar.setStyleValue("height",r+"%")):(this._thumb.setStyleValue("left",r+"%"),this._bar.setStyleValue("width",r+"%")),this.fire("change",{value:e})}_on_mouseup(e){this._mdown&&(this.releaseCapture(e.pointerId),this._mdown=!1)}_on_key(e){var r;console.log(e.key);let t=(r=this.props.step)!=null?r:1,o=0;switch(e.key){case"ArrowRight":case"ArrowUp":o=t;break;case"ArrowLeft":case"ArrowDown":o=-t;break}o&&(e.ctrlKey&&(o*=10),this._range.setNumValue(this._range.getNumValue()+o),this._update())}setMin(e){this._range.setAttribute("min",e+""),this._update()}setMax(e){this._range.setAttribute("max",e+""),this._update()}setValue(e){this._range.setNumValue(e),this._update()}};s(rt,"Slider"),rt=p([h("x4")],rt);var nt=class extends g{constructor(e){super(e);let t=z();this.setContent([new d({cls:"switch",content:[new E({type:"checkbox",id:t,checked:e.checked}),new d({cls:"track"}),new d({cls:"thumb"})]}),new v({tag:"label",text:e.label,labelFor:t})])}};s(nt,"Switch"),nt=p([h("x4")],nt);var Ae=class extends I{constructor(e,t){super(e),this.addClass("outline"),this.setIcon(t.icon),this.setText(t.title),this.setData("tabname",t.name)}};s(Ae,"CTab"),Ae=p([h("x4")],Ae);var Me=class extends g{_selitem;constructor(e,t){super(e),this.setItems(t),this.mapPropEvents(e,"click")}_on_click(e){let t=e.source.getData("tabname");this.fire("click",{name:t})}select(e){let t=this.query(`[data-tabname="${e}"]`);this._selitem&&this._selitem.setClass("selected",!1),this._selitem=t,this._selitem&&this._selitem.setClass("selected",!0)}setItems(e){this.clearContent(),e.forEach(t=>{this.addItem(t)})}addItem(e){this.appendContent(new Ae({click:s(t=>this._on_click(t),"click")},e))}getTabCount(){return this.dom.children.length}};s(Me,"CTabList"),Me=p([h("x4")],Me);var it=class extends y{_list;_stack;constructor(e){var o;super(e);let t=(o=e.items)==null?void 0:o.map(r=>({name:r.name,content:r.content}));this.setContent([this._list=new Me({click:s(r=>this._onclick(r),"click")},e.items),this._stack=new re({cls:"body x4flex",default:e.default,items:t})]),e.default&&this.selectTab(e.default)}selectTab(e){this._list.select(e),this._stack.select(e)}_onclick(e){this.selectTab(e.name)}getTab(e){return this._stack.getPage(e)}addTab(e){this._list.addItem(e),this._stack.addItem({name:e.name,content:e.content}),this._list.getTabCount()==1&&this.selectTab(e.name)}};s(it,"Tabs"),it=p([h("x4")],it);var Bo=class Bo extends d{constructor(e){super({...e,tag:"textarea"}),this.setAttribute("name",e.name),this.setAttribute("value",e.value+""),e.resize||this.setAttribute("resize",!1),e.readonly&&this.setAttribute("readonly",!0)}setText(e){this.dom.value=e}getText(){return this.dom.value}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(Bo,"SimpleTextArea");var zo=Bo,st=class extends y{_input;constructor(e){super(e),this.setContent([new v({text:e.label}),this._input=new zo(e)])}setText(e){this._input.setText(e)}getText(){return this._input.getText()}queryInterface(e){return e=="form-element"?{getRawValue:s(()=>this.getText(),"getRawValue"),setRawValue:s(o=>{this.setText(o)},"setRawValue"),isValid:s(()=>!0,"isValid")}:super.queryInterface(e)}};s(st,"TextArea"),st=p([h("x4")],st);var at=class extends g{input;constructor(e){var o,r;super(e),e.inputId||(e.inputId=z()),e.required&&this.setAttribute("required",!0);let t=(o=e.inputGadgets)!=null?o:[];this.setContent([new g({id:"label",width:e.labelWidth,content:[new v({tag:"label",text:e.label,labelFor:e.inputId})]}),new g({id:"edit",content:[this.input=new E({type:(r=e.type)!=null?r:"text",readonly:e.readonly,value:e.value,name:e.name,id:e.inputId,required:e.required,disabled:e.disabled,placeholder:e.placeholder,autofocus:e.autofocus,attrs:e.inputAttrs,focus:e.focus,change:e.change}),...t]})])}getValue(){return this.input.getValue()}setValue(e){this.input.setValue(e)}getInput(){return this.input}};s(at,"TextEdit"),at=p([h("x4")],at);var Ir='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 176c0 37.5 13.9 72.3 37.6 100.9L0 352l108.1-21.6C137.7 344.2 171.8 352 208 352c114.9 0 208-78.8 208-176S322.9 0 208 0S0 78.8 0 176zm134.7-52c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40z"/><path class="fa-primary" d="M134.7 124c0-25.8 20.9-46.7 46.7-46.7l47.4 0c29.1 0 52.6 23.6 52.6 52.6c0 18.8-10.1 36.3-26.4 45.6L228 191l0 6.3 0 20-40 0 0-20 0-17.9 0-11.6 10-5.8L235 140.9c3.9-2.3 6.3-6.4 6.3-10.9c0-7-5.7-12.6-12.6-12.6l-47.4 0c-3.7 0-6.7 3-6.7 6.7l0 5.5-40 0 0-5.5zM188 250.7l40 0 0 40-40 0 0-40zM432 512c-95.6 0-176.2-54.6-200.5-129C348.9 372.9 448 288.3 448 176c0-5.2-.2-10.4-.6-15.5C555.1 167.1 640 243.2 640 336c0 37.5-13.9 72.3-37.6 100.9L640 512 531.9 490.4C502.3 504.2 468.2 512 432 512z"/></svg>';var qt=null,xt=null,Ar=new Se;function xg(){document.addEventListener("mouseenter",a=>{if(a.target===document)return;let e=to(a.target),t=e.getAttribute("tooltip"),o=e.queryInterface("tip-handler");if(o&&(t=o.getTip()),t){qt=a.target;let r=e.getBoundingRect();yn(t,r,{x:a.pageX,y:a.pageY})}},!0),document.addEventListener("mouseleave",a=>{qt&&a.target==qt&&(qt=null,kn())},!0)}s(xg,"initTooltips");function yn(a,e,t){xt||(xt=new De({})),Ar.setTimeout(null,300,()=>{xt.setText(ct(a)),xt.displayAt(t.x+17,t.y+17)})}s(yn,"showTT");function kn(){xt.show(!1),Ar.clearTimeout(null)}s(kn,"closeTT");var De=class extends S{constructor(e){super(e),this.setContent(new g({content:[new C({iconId:Ir}),new d({id:"text"})]}))}setText(e){this.query("#text").setContent(e)}};s(De,"Tooltip"),De=p([h("x4")],De);var Mr='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><!--!Font Awesome Pro 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M267.3 395.3c-6.2 6.2-16.4 6.2-22.6 0l-192-192c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L256 361.4 436.7 180.7c6.2-6.2 16.4-6.2 22.6 0s6.2 16.4 0 22.6l-192 192z"/></svg>';var En=(u=>(u[u.first=0]="first",u[u.prev=1]="prev",u[u.next=2]="next",u[u.last=3]="last",u[u.parent=4]="parent",u[u.child=5]="child",u[u.expand=6]="expand",u[u.collapse=7]="collapse",u[u.toggle=8]="toggle",u))(En||{}),ce=class extends k{_item;_label;_icon;_childs;constructor(e,t){super({...e}),this._item=t,t?(this._label=new g({cls:"label item",content:[this._icon=new C({iconId:t.children?Mr:void 0}),new v({tag:"span",cls:"",text:t.text,icon:t.iconId})]}),this._label.setData("id",t.id+""),t.children&&(this._childs=new y({cls:"body"}),t.open===void 0&&(t.open=!1),this.addClass("folder"),this.setClass("open",t.open),this.setItems(t.children),this._icon.addDOMEvent("click",o=>this.toggle(o)))):this._childs=new y({cls:"body"}),this.setContent([this._label,this._childs])}toggle(e){let t=this.hasClass("open");this.open(!t),e&&e.stopPropagation()}open(e=!0){this.setClass("open",e),this._item.open=e}setItems(e){if(e){let t=e.map(o=>new ce({},o));this._childs.setContent(t)}else this._childs.clearContent()}};s(ce,"CTreeViewItem"),ce=p([h("x4")],ce);var lt=class extends d{_view;_selection;_selitem;_items;constructor(e){super(e);let t=new G({cls:"body"});this._view=t.getViewport(),this.setContent([t,e.footer]),e.footer&&e.footer.setAttribute("id","footer"),this.setAttribute("tabindex",0),this.setDOMEvents({click:s(o=>this._onclick(o),"click"),keydown:s(o=>this._onkey(o),"keydown")}),e.items&&this.setItems(e.items)}setItems(e){this.clearSelection(),this._view.clearContent(),this._items=e;let t=new ce({cls:"root"},null);e&&(t.setItems(e),this._view.setContent(t))}_onclick(e){let t=e.target;for(;t&&t!=this.dom;){let o=P(t);if(o&&o.hasClass("item")){let r=o.getData("id");this._selectItem(r,o);return}t=t.parentElement}this.clearSelection()}_onkey(e){switch(e.key){case"ArrowDown":{this.navigate(2);break}case"ArrowUp":{this.navigate(1);break}case"Home":{this.navigate(0);break}case"End":{this.navigate(3);break}case"ArrowRight":{this.navigate(5);break}case"+":{this.navigate(6);break}case"ArrowLeft":{this.navigate(4);break}case"-":{this.navigate(7);break}case" ":{this.navigate(8);break}default:console.log(e.key);return}e.preventDefault(),e.stopPropagation()}navigate(e){var r;if(!this._items||this._items.length==0)return;if(!this._selitem)if(e==2||e==4)e=0;else if(e==1)e=3;else return;let t=(r=this._selitem)==null?void 0:r.parentElement(),o=t==null?void 0:t.hasClass("folder");if(t&&e==4&&o&&t.hasClass("open")?e=7:e==5&&(o?t.hasClass("open")?e=2:e=6:e=2),e==6||e==7||e==8){if(o)return e==8?(t.toggle(),!0):(t.open(e==6),!0)}else{let n=this._flattenOpenItems(),i=n.findIndex(c=>this._selection==c.id),l;if(e==0)l=n[0].id;else if(e==3)l=n[n.length-1].id;else if(i>=0){if(e==1)i>0&&(l=n[i-1].id);else if(e==2)i<n.length-1&&(l=n[i+1].id);else if(e==4){let c=n[i].level;for(;i>0;)if(i--,n[i].level<c){l=n[i].id;break}}}if(l){let c=this.query(`[data-id="${l}"]`);return this._selectItem(l,c),!0}}return!1}_flattenOpenItems(){let e=[],t=s((o,r)=>{e.push({id:o.id+"",level:r}),o.children&&o.open&&o.children.forEach(n=>t(n,r+1))},"build");return this._items.forEach(o=>t(o,0)),e}_flattenItems(){let e=[],t=s(o=>{e.push(o),o.children&&o.children.forEach(r=>t(r))},"build");return this._items.forEach(o=>t(o)),e}_selectItem(e,t){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selitem=t,this._selection=e,t&&(t.addClass("selected"),t.scrollIntoView({behavior:"smooth",block:"nearest"}));let o=this._findItem(e);this.fire("selectionChange",{selection:o,empty:!1})}_findItem(e){return this._flattenItems().find(o=>o.id==e)}clearSelection(){this._selitem&&(this._selitem.removeClass("selected"),this._selitem=void 0),this._selection=void 0,this.fire("selectionChange",{selection:void 0,empty:!0})}getSelection(){return this._selection}};s(lt,"Treeview"),lt=p([h("x4")],lt);export{k as Box,Be as Breadcrumbs,ne as BtnGroup,I as Button,Ot as CMover,T as CSizer,Ue as Calendar,qe as Checkbox,O as Color,ve as ColorInput,Ke as ColorPicker,Ge as Combobox,d as Component,$o as ComputedStyle,ee as CoreElement,W as Dialog,ke as DropdownList,me as EventSource,mt as FileDialog,We as FileDrop,Q as Flex,B as Form,Oe as GridBox,je as Gridview,g as HBox,Ye as Header,C as Icon,ae as Image,E as Input,Ee as InputBox,Qe as Keyboard,v as Label,$e as Link,se as Listbox,ze as MasonryBox,N as Menu,Ce as MessageBox,Ze as Notification,Je as Panel,S as Popup,Xe as Progress,Ie as PromptBox,et as PropertyGrid,tt as Radio,ot as Rating,J as Rect,er as Router,_e as Saturation,G as ScrollView,le as Select,F as SimpleText,rt as Slider,Dt as Space,re as StackBox,Qo as Stylesheet,St as SvgBuilder,Lt as SvgComponent,uo as SvgGradient,pt as SvgGroup,ho as SvgIcon,co as SvgPath,dt as SvgShape,po as SvgText,nt as Switch,it as Tabs,st as TextArea,at as TextEdit,Er as TickLine,Se as Timer,lt as Treeview,Te as UnsafeHtml,y as VBox,$ as Viewport,zn as _date_set_locale,_ as _tr,Mt as addEvent,Ko as addTranslation,he as asap,Kn as beep,qn as calcAge,On as camelCase,Ln as centerRect,V as clamp,h as class_ns,P as componentFromDOM,Uo as createLanguage,jo as date_calc_weeknum,Le as date_clone,Vn as date_diff,Bn as date_format,ue as date_hash,Nn as date_sql_utc,Hn as date_to_sql,jr as dispatchEvent,Pt as dragManager,X as formatIntlDate,Mn as getAvailableLanguages,An as getCurrentLanguage,Ct as getFocusableElements,Gn as getScrollbarSize,xg as initTooltips,U as isArray,yt as isFeatureAvailable,Yo as isFunction,qo as isLanguage,R as isNumber,D as isString,Zo as isUnitLess,Et as kbNav,En as kbTreeNav,z as makeUniqueComponentId,Rn as oneshot,Z as pad,Un as parseIntlDate,Zr as parseRoute,Fn as pascalCase,Br as selectLanguage,jt as setWaitCursor,Gt as sprintf,ht as svgLoader,Kr as unbubbleEvents,It as unitless,Sn as unsafe,ct as unsafeHtml,to as wrapDOM,kt as x4_class_ns_sym};
|