@agung_dhewe/webapps 1.1.2 → 1.2.1
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/lib/fgta5js-dist/fgta5js-v1.8.5.min.js +11 -0
- package/lib/fgta5js-dist/fgta5js-v1.8.5.min.js.map +1 -0
- package/{libs → lib}/webmodule/module-edit.css +73 -18
- package/{libs → lib}/webmodule/module-list.css +13 -0
- package/lib/webmodule/module-print.css +28 -0
- package/{libs → lib}/webmodule/module.css +13 -6
- package/{libs → lib}/webmodule/module.js +14 -4
- package/lib/webmodule/pagehelper.mjs +129 -0
- package/modules/generator/appgen-io.mjs +153 -76
- package/modules/generator/appgen-ui.mjs +234 -167
- package/modules/generator/generator-designtemplate-def.html +38 -0
- package/modules/generator/generator-designtemplate.html +11 -1492
- package/modules/generator/generator.css +103 -65
- package/modules/generator/generator.mjs +1 -1
- package/modules/generator/generator.svg +98 -0
- package/modules/generator/generatorEdit.mjs +43 -35
- package/modules/generator/generatorList.mjs +27 -0
- package/modules/generator/tpl-designerinfo.html +100 -0
- package/modules/generator/tpl-field-checkbox.html +200 -0
- package/modules/generator/tpl-field-combobox.html +228 -0
- package/modules/generator/tpl-field-datepicker.html +192 -0
- package/modules/generator/tpl-field-filebox.html +189 -0
- package/modules/generator/tpl-field-numberbox.html +218 -0
- package/modules/generator/tpl-field-textbox.html +255 -0
- package/modules/generator/tpl-field-timepicker.html +192 -0
- package/modules/generator/tpl-searchdesign.html +32 -0
- package/modules/generator/tpl-uniquedesign.html +25 -0
- package/modules/login/login.css +10 -2
- package/package.json +3 -1
- package/percobaan/coba-sequencer.js +16 -0
- package/src/api.js +12 -9
- package/src/apis/generator.api.js +35 -23
- package/src/apis/login.api.js +1 -0
- package/src/db.js +58 -32
- package/src/generator/createApiModule.js +4 -1
- package/src/generator/createIcon.js +24 -2
- package/src/generator/createLayoutCss.js +107 -0
- package/src/generator/createModuleDetilEditHtml.js +12 -1
- package/src/generator/createModuleDetilEditMjs.js +32 -28
- package/src/generator/createModuleDetilListHtml.js +14 -7
- package/src/generator/createModuleDetilListMjs.js +13 -1
- package/src/generator/createModuleHeaderEditHtml.js +13 -1
- package/src/generator/createModuleHeaderEditMjs.js +23 -2
- package/src/generator/createProgramData.js +3 -2
- package/src/generator/createTable.js +45 -38
- package/src/generator/helper.js +45 -27
- package/src/generator/templates/__rollup-module.ejs +1 -1
- package/src/generator/templates/api-module.js.ejs +171 -32
- package/src/generator/templates/layout.css.ejs +24 -0
- package/src/generator/templates/module-ext.html.ejs +1 -1
- package/src/generator/templates/module-ext.mjs.ejs +19 -1
- package/src/generator/templates/module.ejs.ejs +8 -0
- package/src/generator/templates/module.mjs.ejs +42 -5
- package/src/generator/templates/moduleDetilEdit.html.ejs +11 -0
- package/src/generator/templates/moduleDetilEdit.mjs.ejs +135 -30
- package/src/generator/templates/moduleDetilList.html.ejs +2 -1
- package/src/generator/templates/moduleDetilList.mjs.ejs +86 -11
- package/src/generator/templates/moduleHeaderEdit.html.ejs +8 -1
- package/src/generator/templates/moduleHeaderEdit.mjs.ejs +123 -36
- package/src/generator/templates/moduleHeaderList.html.ejs +5 -1
- package/src/generator/templates/moduleHeaderList.mjs.ejs +47 -15
- package/src/generator/trygenerate.js +18 -2
- package/src/generator/worker.js +83 -72
- package/src/logger.js +12 -12
- package/src/notifier.js +29 -0
- package/src/routers/generatorPage.js +3 -1
- package/src/routers/modulePage.js +32 -7
- package/src/sequencerdoc.js +22 -46
- package/src/sequencerline.js +16 -4
- package/src/session.js +69 -33
- package/src/startup.js +47 -10
- package/src/webapps.js +61 -18
- package/templates/_lib_debug.ejs +8 -8
- package/templates/_lib_production.ejs +2 -2
- package/templates/application.page.ejs +39 -6
- package/templates/generator.page.ejs +4 -3
- package/templates/index.page.ejs +2 -2
- package/templates/login.page.ejs +3 -3
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js +0 -11
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js.map +0 -1
- package/libs/webmodule/pagehelper.mjs +0 -45
- package/modules/generator/generator.png +0 -0
- /package/{libs/fgta5js-dist/fgta5js-v1.8.3.min.css → lib/fgta5js-dist/fgta5js-v1.8.5.min.css} +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla.css +0 -0
- /package/{libs → lib}/webmodule/module-footer.css +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! fgta5js 1.8.5
|
|
2
|
+
* https://github.com/fgta5/fgta5js
|
|
3
|
+
* A simple component for FGTA5 framework
|
|
4
|
+
*
|
|
5
|
+
* Agung Nugroho DW
|
|
6
|
+
* https://github.com/agungdhewe
|
|
7
|
+
*
|
|
8
|
+
* build at 2025-10-23
|
|
9
|
+
*/
|
|
10
|
+
let e=0;class t{Id;Element;static get ACTION_SHOWMENU(){return"showmenu"}static get ACTION_SHOWHOME(){return"showhome"}static get ACTION_APPLICATIONLOADED(){return"applicationloaded"}constructor(e){null==e&&console.error("id component belum didefinisikan");const t=document.getElementById(e);null==t&&console.error("element dengan id: '$id' tidak ditemukan di halaman"),this.Id=e,this.Element=t}static createSvgButton(e,t,n){return function(e,t,n){const i=document.createElement("a");i.innerHTML=e,""!=t&&null!=t&&i.classList.add(t);i.setAttribute("tabindex","-1"),i.setAttribute("href","javascript:void(0)"),"function"==typeof n&&i.addEventListener("click",e=>{n(e)});return i}(e,t,n)}static generateId(){return"comp-"+ ++e}static sleep(e){return new Promise(t=>setTimeout(t,e))}static isMobileDevice(){return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent)}static isInContainer(){return window.self!==window.top}}class n extends t{constructor(e){super(e),function(e){const t=document.createElement("div"),n=document.createElement("input");n.setAttribute("type","hidden"),n.classList.add("fgta5-entry-lastvalue"),t.classList.add("fgta5-entry-container"),e.InitialValue="",e.Element.getInputCaption=()=>e.Id,e.Listener=new EventTarget,e.Nodes={Input:e.Element,Container:t,LastValue:n}}(this),this._readValidators()}get type(){return this.constructor.name}get value(){return this.Element.value}set value(e){this.Element.value=e}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e}get placeholder(){return this.Element.getAttribute("placeholder")}set placeholder(e){this.Element.setAttribute("placeholder",e)}#e;get Form(){return this.#e}bindForm(e){this.#e=e}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e}#n={};get InvalidMessages(){return this.#n}_readValidators(){let e=this.Element;var t="invalid-message";Array.from(e.attributes).forEach(e=>{if(e.name.startsWith(t)){var n=e.name===t?"default":e.name.replace(`${t}-`,"");this.#n[n]=e.value}}),s(this)}newData(e){!function(e,t){e.value=t,e.acceptChanges()}(this,e)}acceptChanges(){var e;(e=this)._setLastValue(e.Nodes.Input.value),e.Nodes.Input.removeAttribute("changed"),e.setError(null)}reset(){var e;(e=this).Nodes.Input.value=e.Nodes.LastValue.value,e.acceptChanges()}isChanged(){return(e=this).Nodes.LastValue.value!=e.Nodes.Input.value&&(console.log(`Input '${e.Id}' is changed from '${e.Nodes.LastValue.value}' to '${e.Nodes.Input.value}'`),!0);var e}#i;_setLastError(e){this.#i=e}getLastError(){return this.#i}setError(e){!function(e,t){var n=e.Nodes.Container.querySelector(".fgta5-entry-error");null!==t&&""!==t?(e.Nodes.Input.setAttribute("invalid","true"),n||((n=document.createElement("div")).classList.add("fgta5-entry-error"),e.Nodes.Container.insertBefore(n,e.Nodes.InputWrapper.nextSibling)),n.innerHTML=t,e._setLastError(t)):(e.Nodes.Input.removeAttribute("invalid"),n&&n.remove(),e._setLastError(null))}(this,e)}_setLastValue(e){!function(e,t){e.Nodes.LastValue.value=t}(this,e)}#r;getLastValue(){return this.Nodes.LastValue.value}getBindingData(){var e=this.Element.getAttribute("binding");return null===e?null:e}validate(){return function(e){const t="required";if(null!=e.Validators[t]){if(null!=(n=i(e,t)))return e.setError(n.message),!1}for(const r in e.Validators){var n;if(r!=t)if(null!=(n=i(e,r)))return e.setError(n.message),!1}return e.setError(null),!0}(this)}#s={};get Validators(){return this.#s}addValidator(e,t,n){this.#s[e]={param:t,message:n}}removeValidator(e){void 0!==this.#s[e]&&delete this.#s[e]}clearValidators(){this.#s={}}readValidators(){s(this)}_setupDescription(){var e=this.Element.getAttribute("description");if(null!==e&&""!==e.trim()){e=e.trim();const t=document.createElement("div");t.classList.add("fgta5-entry-description"),t.innerHTML=e,this.Nodes.Container.appendChild(t)}}#a=!1;isRequired(){return this.#a}markAsRequired(e){this.#a=e,function(e,t){var n="required",i=e.Nodes.Label;null!=i&&null!=i&&(t?(e.Nodes.Label.setAttribute(n,""),e.Nodes.Input.setAttribute(n,""),e.addValidator(n,null,e.InvalidMessages[n])):(e.Nodes.Label.removeAttribute(n),e.Nodes.Input.removeAttribute(n),e.removeValidator(n)))}(this,e)}addEventListener(e,t){this.Listener.addEventListener(e,t)}#o={};get Handlers(){return this.#o}handle(e,t){this.#o[e]=t}getErrorValidation(e){return i(this,e)}}function i(e,t){const n=e.Validators[t],i=$validators[t]??$validators.getCustomValidator(t),r=n.param,s=n.message,a=e.Nodes.Input;try{if("function"!=typeof i){var o=new Error(`Validator function '${t}' is not defined or not a function`);throw console.error(o),o}if(!i(a.value,r)){var l=e.InvalidMessages.default;throw null!=s?new Error(s):null!=l?new Error(l):new Error(`Invalid value '${a.value}' for '${a.getInputCaption()}' using validator '${t}(${r??""})'`)}return null}catch(o){return o}}function r(e){e.setHours(0),e.setMinutes(0),e.setSeconds(0)}function s(e){const t=e.Nodes.Input.getAttribute("fgta5-component");var n="";n="minlength";var i=e.Nodes.Input.getAttribute(n);null!=i&&(i=parseInt(i),isNaN(i)||e.addValidator(n,i,e.InvalidMessages[n])),n="maxlength";var s=e.Nodes.Input.getAttribute(n);null!=s&&(s=parseInt(s),isNaN(s)||e.addValidator(n,s,e.InvalidMessages[n])),n="pattern";var o=e.Nodes.Input.getAttribute(n);null!=o&&""!==o.trim()&&e.addValidator("pattern",o,e.InvalidMessages[n]),n="min";var l=e.Nodes.Input.getAttribute(n);if(null!=l){var d=e.InvalidMessages[n];if("Datepicker"==t){var u=new Date(l);r(u),e.addValidator("mindate",u,d)}else if("Timepicker"==t){var c=l;e.addValidator("mintime",c,d)}else l=parseInt(l),isNaN(l)||e.addValidator(n,l,d)}n="max";var m=e.Nodes.Input.getAttribute(n);if(null!=m){d=e.InvalidMessages[n];if("Datepicker"==t){var p=new Date(m);r(p),e.addValidator("maxdate",p,d)}else if("Timepicker"==t){var h=m;e.addValidator("maxtime",h,d)}else m=parseInt(m),isNaN(m)||e.addValidator(n,m,d)}var v=e.Nodes.Input.getAttribute("validator");if(null!=v&&""!==v.trim()){v=v.split(";");for(var g=0;g<v.length;g++){var f=v[g].trim(),{fnName:b,fnParams:w}=a(e,f);e.addValidator(b,w,e.InvalidMessages[b])}}}function a(e,t){const[n,...i]=t.split(":"),r=i.length>0?i.join(":"):null;return{fnName:n,fnParams:null!==r?isNaN(r)?r:Number(r):null}}class o extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.querySelector(`label[for="${t}"]`);r.parentNode.insertBefore(n,r),s.appendChild(r),n.appendChild(s),n.appendChild(i),e.Nodes.InputWrapper=s,e.Nodes.Label=a,n.setAttribute("fgta5-component","Textbox"),n.setAttribute("input-id",t),""!=r.style.width&&(n.style.width=r.style.width);""!=r.style.marginTop&&(n.style.marginTop=r.style.marginTop,r.style.marginTop="");""!=r.style.marginBottom&&(n.style.marginBottom=r.style.marginBottom,r.style.marginBottom="");""!=r.style.marginLeft&&(n.style.marginLeft=r.style.marginLeft,r.style.marginLeft="");""!=r.style.marginRight&&(n.style.marginRight=r.style.marginRight,r.style.marginRight="");s.classList.add("fgta5-entry-input-wrapper"),r.classList.add("fgta5-entry-input"),r.getInputCaption=()=>null!=a?a.innerHTML:r.getAttribute("placeholder");const o=Array.from(r.classList).filter(e=>!e.startsWith("fgta5-"));for(var l of o)r.classList.remove(l),n.classList.add(l);const d=r.getAttribute("data-tabindex");null!=d&&r.setAttribute("tabindex",d);null!=a&&a.classList.add("fgta5-entry-label");e._setLastValue(e.value),e._setupDescription(),""!==r.style.backgroundColor&&(s.style.backgroundColor=r.style.backgroundColor,r.style.backgroundColor="transparent");var u=r.getAttribute("character-case");null!==u&&""!==u.trim()&&(r.charCase=u.trim().toLowerCase());var c=r.getAttribute("required");null!=c&&e.markAsRequired(!0);r.addEventListener("input",t=>{e.Listener.dispatchEvent(new CustomEvent("input",{})),null!=e.Form&&(e.getLastValue()!=e.value?r.setAttribute("changed","true"):r.removeAttribute("changed"))}),r.addEventListener("blur",t=>{!function(e){e.InEditMode&&(e.setError(null),e.validate())}(e),e.Listener.dispatchEvent(new CustomEvent("blur",{}))}),r.addEventListener("keydown",t=>{const n=(i={cancelable:!0,key:t.key,code:t.code,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,srcElement:t.srcElement,target:t.target},new KeyboardEvent("keydown",i));var i;e.Listener.dispatchEvent(n),n.defaultPrevented&&t.preventDefault()})}(this,e)}get value(){return t=(e=this).Nodes.Input,l(e,t.value);var e,t}set value(e){!function(e,t){null==t&&(t="");e.Element.value=l(e,t)}(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=t?"true":"false";e.Nodes.Input.setAttribute("editmode",n),e.Nodes.InputWrapper.setAttribute("editmode",n),t?e.Nodes.Input.removeAttribute("readonly"):(e.Nodes.Input.setAttribute("readonly","true"),e.setError(null))}(this,e)}newData(e){super.newData(e)}getLastValue(){return t=(e=this).Nodes.LastValue.value,l(e,t);var e,t}isChanged(){return t=(e=this).getLastValue(),(n=e.value)!=t&&(console.log(`Textbox '${e.Id}' is changed from '${t}' to '${n}'`),!0);var e,t,n}focus(){this.Nodes.Input.focus()}}function l(e,t){var n=t,i=e.Nodes.Input;return"uppercase"===i.charCase?n=t.toUpperCase():"lowercase"===i.charCase&&(n=t.toLowerCase()),n}const d=e=>new CustomEvent("change",e);class u extends n{constructor(e){super(e),this.formatterFixed=new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2,useGrouping:!0}),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.createElement("input"),o=document.querySelector(`label[for="${t}"]`);r.parentNode.insertBefore(n,r),s.appendChild(a),s.appendChild(r),n.appendChild(s),n.appendChild(i),e.Nodes.InputWrapper=s,e.Nodes.Label=o,e.Nodes.Display=a,n.setAttribute("fgta5-component","Numberbox"),s.classList.add("fgta5-entry-input-wrapper");const{precision:l,step:u}=function(e){null!==e&&""!==e.trim()?(e=parseInt(e.trim()),(isNaN(e)||e<0)&&(e=0)):e=0;var t=Math.pow(10,-e);return{precision:e,step:t}}(e.Element.getAttribute("precision"));e.formatterFixed.minimumFractionDigits=l,e.formatterFixed.maximumFractionDigits=l,r.classList.add("fgta5-entry-input"),r.maxlength=r.getAttribute("maxlength"),r.precision=l,r.setAttribute("type","hidden"),r.setAttribute("step",u),r.getInputCaption=()=>o.innerHTML,a.id=e.Id+"-display",a.min=r.min,a.max=r.max,a.maxlength=r.maxlength,a.required=r.required,a.value=e.formatterFixed.format(r.value),a.classList.add("fgta5-entry-display"),a.setAttribute("precision",l),a.setAttribute("step",u),a.setAttribute("style",r.getAttribute("style")||""),a.setAttribute("type","text"),a.setAttribute("fgta5-component","Numberbox"),a.setAttribute("autocomplete","off");const p=r.getAttribute("data-tabindex");null!=p&&a.setAttribute("tabindex",p);null!=r.getAttribute("disabled")&&c(e,!0);const h=r.getAttribute("digitgrouping");null!=h&&("false"===h.toLowerCase()?e.formatterFixed.useGrouping=!1:e.formatterFixed.useGrouping=!0);o.setAttribute("for",a.id),o.classList.add("fgta5-entry-label");var v=r.getAttribute("required");null!=v&&e.markAsRequired(!0);null!==r.value&&""!==r.value||(r.value=0);e._setLastValue(r.value),e._setupDescription(),a.addEventListener("focus",t=>{!function(e){var t=e.Nodes.Display,n=e.Nodes.Input;if(e.InEditMode){t.setAttribute("type","number");var i=Number(n.value);t.value=i}}(e)}),a.addEventListener("blur",t=>{!function(e){var t=e.Nodes.Display,n=e.Nodes.Input;if(e.InEditMode){var i=Number(t.value);if(isNaN(i))e.Listener.dispatchEvent(d({detail:{invalid:!0}})),e.setError("Invalid number");else{e.setError(null),n.value=i;var r=!e.validate(),s=m(e,i);t.setAttribute("type","text"),t.value=s,e.Listener.dispatchEvent(d({detail:{invalid:r,value:i,formatted:s}}))}}}(e)}),a.addEventListener("input",e=>{a.value!==i.value?a.setAttribute("changed","true"):a.removeAttribute("changed")}),a.addEventListener("keydown",e=>{"number"!==a.type||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()});var g=a.maxlength;null!==g&&""!==g.trim()&&(g=parseInt(g.trim()),!isNaN(g)&&g>0&&a.addEventListener("beforeinput",e=>{e.target.value.length>=g&&"deleteContentBackward"!==e.inputType&&"deleteContentForward"!==e.inputType&&e.preventDefault()}))}(this,e)}get value(){return Number(this.Nodes.Input.value)}set value(e){!function(e,t){e.Nodes.Input.value=t,isNaN(t)&&(t=Number(t));var n=m(e,t);"text"===e.Nodes.Display.type?e.Nodes.Display.value=n:e.Nodes.Display.value=t;!function(e){var t=e.Nodes.Input,n=e.Nodes.Display;e.value!=e.getLastValue()?(t.setAttribute("changed","true"),n.setAttribute("changed","true")):(t.removeAttribute("changed"),n.removeAttribute("changed"))}(e)}(this,e)}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e,c(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=t?"true":"false";e.Nodes.Display.setAttribute("editmode",n),e.Nodes.Input.setAttribute("editmode",n),e.Nodes.InputWrapper.setAttribute("editmode",n),t?(e.Nodes.Input.removeAttribute("readonly"),e.Nodes.Display.removeAttribute("readonly")):(e.Nodes.Input.setAttribute("readonly","true"),e.Nodes.Display.setAttribute("readonly","true"),e.setError(null))}(this,e)}newData(e){null==e&&(e=0),super.newData(e)}acceptChanges(){super.acceptChanges(),this.Nodes.Display.removeAttribute("changed")}reset(){var e;super.reset(),(e=this).value=e.getLastValue()}setError(e){super.setError(e),function(e,t){var n=e.Nodes.Display;null!==t&&""!==t?n.setAttribute("invalid","true"):n.removeAttribute("invalid")}(this,e)}getLastValue(){return Number(this.Nodes.LastValue.value)}focus(){this.Nodes.Display.focus()}}function c(e,t){e.Nodes.Display.disabled=!!t}function m(e,t){return new Intl.NumberFormat("en-US",{minimumFractionDigits:e.formatterFixed.minimumFractionDigits,maximumFractionDigits:e.formatterFixed.minimumFractionDigits,useGrouping:e.formatterFixed.useGrouping}).format(t)}class p extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.querySelector(`label[for="${t}"]`),a=document.createElement("label");r.parentNode.insertBefore(n,r),a.appendChild(r),a.appendChild(document.createTextNode(s.innerHTML)),n.appendChild(a),n.appendChild(i),e.Nodes.Label=s,n.setAttribute("fgta5-component","Checkbox"),r.classList.add("fgta5-checkbox-input");const o=r.getAttribute("data-tabindex");null!=o&&r.setAttribute("tabindex",o);a.classList.add("fgta5-checkbox");var l=document.createElement("div");l.innerHTML=" ",l.style.display="inline-block",l.setAttribute("label",""),s.parentNode.replaceChild(l,s),e._setLastValue(e.Element.checked);null!=r.getAttribute("disabled")&&h(e,!0);r.addEventListener("change",t=>{!function(e){var t=e.Nodes.Input;t.value=t.checked?1:0,e.getLastValue()!=e.value?t.setAttribute("changed","true"):t.removeAttribute("changed");t.checked?e.Listener.dispatchEvent(new CustomEvent("checked",{})):e.Listener.dispatchEvent((e=>new CustomEvent("unchecked",e))({}))}(e)})}(this,e)}get value(){return this.Element.checked}set value(e){!function(e,t){var n=e.Nodes.Input,i=v(t);n.checked=i,n.value=i?1:0;!function(e){var t=e.Nodes.Input;e.value!=e.getLastValue()?t.setAttribute("changed","true"):t.removeAttribute("changed")}(e)}(this,e)}get disabled(){return function(e){var t=e.Nodes.Input.getAttribute("permanent-disabled");if(null===t)return!1;if("true"===t)return!0;return!1}(this)}set disabled(e){this.Element.disabled=e,h(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=e.Nodes.Input,i=t?"true":"false",r=n.getAttribute("permanent-disabled"),s=null!=r&&""!=r&&"false"!=r;n.setAttribute("editmode",i),t?s?n.setAttribute("disabled","true"):n.removeAttribute("disabled"):n.setAttribute("disabled","true")}(this,e)}newData(e){super.newData(e),function(e,t){var n=v(t);e.value=n,e._setLastValue(n)}(this,e)}getLastValue(){return v(this.Nodes.LastValue.value)}isChanged(){return t=(e=this).getLastValue(),e.value!=t;var e,t}reset(){var e,t;t=(e=this).getLastValue(),e.value=t,e._setLastValue(t)}_setLastValue(e){!function(e,t){var n=1;"off"!==t&&"0"!==t&&0!==t&&!1!==t||(n=0);e.Nodes.LastValue.value=n}(this,e)}}function h(e,t){var n=e.Nodes.Input,i=n.getAttribute("editmode"),r=null!=i&&""!=i&&"false"!=i;t?(n.setAttribute("permanent-disabled","true"),n.parentNode.setAttribute("permanent-disabled","true")):(n.removeAttribute("permanent-disabled"),n.parentNode.removeAttribute("permanent-disabled"),r||(n.disabled=!0))}function v(e){return 0!==e&&"0"!==e&&!1!==e&&void 0!==e}const g='<svg transform="translate(0 3)" width="12" height="12" stroke="currentColor" stroke-linecap="round" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n\t\t<rect x="1.3095" y="6.6682" width="21.393" height="1.8579" fill="none" stroke-width="2"/>\n\t\t<rect x=".81949" y="10" width="22.341" height="13.251" fill="none" stroke-width="1.02"/>\n\t\t<rect x="3.8664" y="1.1531" width="2.5776" height="1.4923" fill="none" stroke-width="2"/>\n\t\t<rect x="17.223" y="1.1203" width="2.5776" height="1.6958" fill="none" stroke-width="2"/>\n\t\t<path d="m1.2888 16.278 21.367-0.13566" fill="none" stroke-width="1.02"/>\n\t\t<path d="m8.2775 10.07-0.13566 12.888" fill="none" stroke-width="1.02"/>\n\t\t<path d="m15.799 9.9671-0.13566 12.888" fill="none" stroke-width="1.02"/>\n\t\t</svg>';class f extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.createElement("input"),o=document.createElement("button"),l=document.querySelector(`label[for="${t}"]`);r.parentNode.insertBefore(n,r),s.appendChild(a),s.appendChild(o),o.appendChild(r),n.appendChild(s),n.appendChild(i),e.Nodes.InputWrapper=s,e.Nodes.Label=l,e.Nodes.Display=a,e.Nodes.Button=o,n.setAttribute("fgta5-component","Datepicker"),""!=r.style.width&&(n.style.width=r.style.width);""!=r.style.marginTop&&(n.style.marginTop=r.style.marginTop,r.style.marginTop="");""!=r.style.marginBottom&&(n.style.marginBottom=r.style.marginBottom,r.style.marginBottom="");""!=r.style.marginLeft&&(n.style.marginLeft=r.style.marginLeft,r.style.marginLeft="");""!=r.style.marginRight&&(n.style.marginRight=r.style.marginRight,r.style.marginRight="");s.classList.add("fgta5-entry-input-wrapper"),a.setAttribute("id",`${t}-display`),a.setAttribute("type","text"),a.setAttribute("fgta5-component","Datepicker"),a.setAttribute("readonly","true"),a.classList.add("fgta5-entry-display"),a.classList.add("fgta5-entry-display-datepicker");var d=r.getAttribute("placeholder");null!=d&&""!=d&&a.setAttribute("placeholder",d);const u=r.getAttribute("data-tabindex");null!=u&&a.setAttribute("tabindex",u);const c=Array.from(r.classList).filter(e=>!e.startsWith("fgta5-"));for(var m of(r.setAttribute("type","date"),r.removeAttribute("class"),r.removeAttribute("style"),r.classList.add("fgta5-entry-input"),r.classList.add("fgta5-entry-input-datepicker"),r.getInputCaption=()=>null!=l?l.innerHTML:r.getAttribute("placeholder"),c))r.classList.remove(m),a.classList.remove(m),n.classList.add(m);o.id=e.Id+"-button",o.insertAdjacentHTML("beforeend",g),o.classList.add("fgta5-entry-button-datepicker"),null!=l&&(l.setAttribute("for",o.id),l.classList.add("fgta5-entry-label"));null!=r.getAttribute("disabled")&&b(e,!0);const p=r.getAttribute("required");null!=p&&e.markAsRequired(!0);null!=r.value&&""!=r.value&&(e.value=r.value,e._setLastValue(r.value),e.acceptChanges());e._setupDescription(),r.addEventListener("change",t=>{!function(e){var t=e.Nodes.Input;y(e,t.value);try{e.Listener.dispatchEvent((n={sender:e,detail:{value:t.value,sender:e}},new CustomEvent("change",n)))}catch(e){console.error(e.message)}var n;w(e),e.InEditMode&&(e.setError(null),e.validate())}(e)})}(this,e)}get value(){return""==(n=this).Nodes.Input.value?null:("string"==typeof(e=n.Nodes.Input.value)?t=new Date(e):e instanceof Date&&(t=e),t.toISOString().split("T")[0]);var e,t,n}set value(e){!function(e,t){try{if(null!=t)if(t instanceof Date){const n=t.toISOString().slice(0,10);e.Nodes.Input.value=n}else{const n=t.slice(0,10);e.Nodes.Input.value=n}else e.Nodes.Input.value=null;y(e,t),w(e)}catch(e){throw e}}(this,e)}get min(){return""!=this.Element.min?new Date(this.Element.min):null}set min(e){e instanceof Date?this.Element.min=e.toISOString().split("T")[0]:"string"==typeof e&&(this.Element.min=e)}get max(){return""!=this.Element.max?new Date(this.Element.max):null}set max(e){e instanceof Date?this.Element.max=e.toISOString().split("T")[0]:"string"==typeof e&&(this.Element.max=e)}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e,b(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=t?"true":"false",i=e.Nodes.Input,r=e.Nodes.Display,s=e.Nodes.InputWrapper;r.setAttribute("editmode",n),i.setAttribute("editmode",n),s.setAttribute("editmode",n),t?i.removeAttribute("readonly"):(i.setAttribute("readonly","true"),e.setError(null))}(this,e)}newData(e){null==e&&(e=""),function(e,t){e.value=t,e.acceptChanges()}(this,e)}acceptChanges(){super.acceptChanges(),this.Nodes.Display.removeAttribute("changed")}reset(){var e,t;super.reset(),t=(e=this).getLastValue(),e.value=null==t?"":t}setError(e){super.setError(e),function(e,t){var n=e.Nodes.Display;null!==t&&""!==t?n.setAttribute("invalid","true"):n.removeAttribute("invalid")}(this,e)}getLastValue(){return""==(e=this.Nodes.LastValue.value)?null:e;var e}focus(){this.Nodes.Display.focus()}}function b(e,t){var n=e.Nodes.Display,i=e.Nodes.InputWrapper,r=e.Nodes.Button;t?(n.disabled=!0,i.setAttribute("disabled","true"),r.setAttribute("disabled","true")):(n.disabled=!1,i.removeAttribute("disabled"),r.removeAttribute("disabled"))}function w(e){if(null!=e.Form){var t=e.Nodes.Display;e.value!=e.getLastValue()?t.setAttribute("changed","true"):t.removeAttribute("changed")}}function y(e,t){var n=e.Nodes.Display;if(""==t)n.value="";else{const e={day:"2-digit",month:"short",year:"numeric"},i=new Date(t).toLocaleDateString("en-ID",e).replace(".","");n.value=i}}const E=/^([01]\d|2[0-3]):([0-5]\d)$/,L='<?xml version="1.0" encoding="UTF-8"?>\n<svg transform="translate(0 3)" width="12" height="12" stroke="currentColor" stroke-linecap="round" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="m12.339 12.142 0.01403-6.5322" fill="none" stroke-width="2"/>\n<path d="m8.4232 14.469 3.7103-1.9861" fill="none" stroke-width="2.4"/>\n<ellipse cx="12.004" cy="11.983" rx="10.102" ry="9.9964" fill="none" stroke-width="2.4"/>\n</svg>\n\n';class A extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.createElement("input"),o=document.createElement("button"),l=document.querySelector(`label[for="${t}"]`);r.parentNode.insertBefore(n,r),s.appendChild(a),s.appendChild(o),o.appendChild(r),n.appendChild(s),n.appendChild(i),e.Nodes.InputWrapper=s,e.Nodes.Label=l,e.Nodes.Display=a,e.Nodes.Button=o,n.setAttribute("fgta5-component","Timepicker"),s.classList.add("fgta5-entry-input-wrapper"),a.setAttribute("id",`${t}-display`),a.setAttribute("type","text"),a.setAttribute("picker","time"),a.setAttribute("fgta5-component","Timepicker"),a.setAttribute("readonly","true"),a.classList.add("fgta5-entry-display"),a.classList.add("fgta5-entry-display-datepicker");var d=r.getAttribute("placeholder");null!=d&&""!=d&&a.setAttribute("placeholder",d);var u=r.getAttribute("class");null!=u&&""!=u&&a.setAttribute("class",u);var c=r.getAttribute("style");null!=c&&""!=c&&a.setAttribute("style",c);const m=r.getAttribute("data-tabindex");null!=m&&a.setAttribute("tabindex",m);r.setAttribute("type","time"),r.setAttribute("picker","time"),r.removeAttribute("class"),r.removeAttribute("style"),r.classList.add("fgta5-entry-input"),r.classList.add("fgta5-entry-input-datepicker"),r.getInputCaption=()=>l.innerHTML,o.id=e.Id+"-button",o.insertAdjacentHTML("beforeend",L),o.classList.add("fgta5-entry-button-datepicker"),l.setAttribute("for",o.id),l.classList.add("fgta5-entry-label");var p=r.getAttribute("required");null!=p&&e.markAsRequired(!0);null!=r.value&&""!=r.value||(r.value="00:00");e.value=r.value,e._setLastValue(r.value),e.acceptChanges(),e._setupDescription(),r.addEventListener("change",t=>{!function(e){var t=e.Nodes.Input;C(e,t.value),N(e),e.InEditMode&&(e.setError(null),e.validate())}(e)})}(this,e)}get min(){return this.Element.min}set min(e){this.Element.min=e}get max(){return this.Element.max}set max(e){this.Element.max=e}get value(){return""==(e=this.Nodes.Input).value?null:e.value;var e}set value(e){!function(e,t){if(!E.test(t))throw new Error(`invalid HH:ss format for '${t}'`);e.Nodes.Input.value=t,C(e,t),N(e)}(this,e)}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e,function(e,t){var n=e.Nodes.Display,i=e.Nodes.InputWrapper,r=e.Nodes.Button;t?(n.disabled=!0,i.setAttribute("disabled","true"),r.setAttribute("disabled","true")):(n.disabled=!1,i.removeAttribute("disabled"),r.removeAttribute("disabled"))}(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=t?"true":"false",i=e.Nodes.Input,r=e.Nodes.Display,s=e.Nodes.InputWrapper;r.setAttribute("editmode",n),i.setAttribute("editmode",n),s.setAttribute("editmode",n),t?i.removeAttribute("readonly"):(i.setAttribute("readonly","true"),e.setError(null))}(this,e)}newData(e){""!=e&&null!=e||(e="00:00"),super.newData(e)}acceptChanges(){super.acceptChanges(),this.Nodes.Display.removeAttribute("changed")}reset(){var e,t;super.reset(),t=(e=this).getLastValue(),e.value=null==t?"":t}setError(e){super.setError(e),function(e,t){var n=e.Nodes.Display;null!==t&&""!==t?n.setAttribute("invalid","true"):n.removeAttribute("invalid")}(this,e)}getLastValue(){return""==(e=this.Nodes.LastValue.value)?null:e;var e}focus(){this.Nodes.Display.focus()}}function N(e){var t=e.Nodes.Display;e.value!=e.getLastValue()?t.setAttribute("changed","true"):t.removeAttribute("changed")}function C(e,t){e.Nodes.Display.value=t}const x=e=>new CustomEvent("selecting",e),I='<?xml version="1.0" encoding="UTF-8"?>\n<svg transform="translate(0 3)" width="12" height="12" stroke-linecap="round" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path transform="matrix(.8169 0 0 -.64538 10.987 14.119)" d="m11.299 11.275h-10.157l-10.157-1e-6 10.157-17.593 5.0786 8.7965z"/>\n</svg>\n',k='<?xml version="1.0" encoding="UTF-8"?>\n<svg transform="translate(0 3)" width="12" height="12" stroke="currentColor" stroke-linecap="round" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="m3.5642 20.295 16.853-16.833" fill="none" stroke-width="4"/>\n<path d="m3.5741 3.4523 16.833 16.853" fill="none" stroke-width="4"/>\n</svg>',T="editmode",D="showed",M="removing",S="selected",B="data-index";class _ extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.createElement("input"),o=document.createElement("button"),l=document.querySelector(`label[for="${t}"]`),d=r.parentNode.querySelector(`datalist[for="${t}"]`),u=document.createElement("dialog"),c=document.createElement("input");r.parentNode.insertBefore(n,r),s.appendChild(r),s.appendChild(a),s.appendChild(o),n.appendChild(s),n.appendChild(i),n.appendChild(c),n.appendChild(u),e.Nodes.InputWrapper=s,e.Nodes.Label=l,e.Nodes.Display=a,e.Nodes.Button=o,e.Nodes.Dialog=u,e.Nodes.LastText=c,n.setAttribute("fgta5-component","Combobox"),""!=r.style.width&&(n.style.width=r.style.width);""!=r.style.marginTop&&(n.style.marginTop=r.style.marginTop,r.style.marginTop="");""!=r.style.marginBottom&&(n.style.marginBottom=r.style.marginBottom,r.style.marginBottom="");""!=r.style.marginLeft&&(n.style.marginLeft=r.style.marginLeft,r.style.marginLeft="");""!=r.style.marginRight&&(n.style.marginRight=r.style.marginRight,r.style.marginRight="");s.classList.add("fgta5-entry-input-wrapper"),r.classList.add("fgta5-entry-input"),r.setAttribute("type","hidden"),r.getInputCaption=()=>null!=l?l.innerHTML:r.getAttribute("placeholder");const m=Array.from(r.classList).filter(e=>!e.startsWith("fgta5-"));for(var p of m)r.classList.remove(p),n.classList.add(p);a.id=e.Id+"-display",a.classList.add("fgta5-entry-display"),a.setAttribute("style",r.getAttribute("style")||""),a.setAttribute("type","text"),a.setAttribute("readonly","true"),a.setAttribute("fgta5-component","Combobox"),a.setAttribute("placeholder",r.getAttribute("placeholder")),a.setAttribute("tabindex","-1"),a.required=r.required;null!=r.getAttribute("disabled")&&H(e,!0);const h=r.getAttribute("data-tabindex");null!=h&&o.setAttribute("tabindex",h);o.setAttribute("type","button"),o.classList.add("fgta5-entry-button-combobox"),o.innerHTML=I,o.addEventListener("click",t=>{!function(e){const t=e.Nodes.Dialog;if(null!=e.Form){if("true"!==e.Nodes.Button.getAttribute(T))return}if(e.HasStaticOption)e.Listener.dispatchEvent(x({detail:{sender:e,dialog:t,searchtext:"",limit:0,offset:0,addRow:(t,n,i)=>{var r=$(e,t,n,i);tbody.appendChild(r)}}}));else{z(e,null,30,0),setTimeout(()=>{var e=t.querySelector(".fgta5-combobox-dialog-filter input");null!=e&&(e.value="",e.focus())},100)}setTimeout(()=>{e.isWaiting()&&(t.mask=$fgta5.Modal.createMask())},1e3),t.showModal(),t.setAttribute(D,"true");var n=t.querySelector(".fgta5-combobox-dialog-head > button");null==n.onclick&&(n.onclick=n=>{t.setAttribute(M,"true"),setTimeout(()=>{t.close(),t.removeAttribute(M),t.removeAttribute(D),U(e)},200)})}(e)}),c.setAttribute("type","hidden"),null!=l&&(l.setAttribute("for",a.id),l.classList.add("fgta5-entry-label"));var v=r.getAttribute("required");null!=v&&e.markAsRequired(!0);null!=d&&(e.HasStaticOption=!0);if(function(e,t){t.classList.add("fgta5-combobox-dialog");var n=document.createElement("div");n.classList.add("fgta5-combobox-dialog-head"),n.innerHTML=e.Nodes.Input.getInputCaption(),t.appendChild(n);var i=document.createElement("button");if(i.setAttribute("type","button"),i.innerHTML=k,n.appendChild(i),!e.HasStaticOption){var r=document.createElement("div"),s=document.createElement("input"),a=document.createElement("button"),o=document.createElement("a");s.setAttribute("placeholder","Search"),s.setAttribute("maxlength",30),s.addEventListener("keypress",e=>{"Enter"===e.key&&a.click()}),a.setAttribute("type","type"),a.innerHTML="Submit",a.addEventListener("click",t=>{var n=s.value,i=30,r=0;o.searchtext=n,W(e),z(e,n,i,r)}),r.classList.add("fgta5-combobox-dialog-filter"),r.appendChild(s),r.appendChild(a),t.appendChild(r)}var l=document.createElement("table"),d=document.createElement("thead"),u=document.createElement("tbody"),c=document.createElement("tfoot");t.appendChild(l),l.appendChild(u),l.appendChild(c),l.appendChild(d),e.HasStaticOption?t.setNext=(e,t)=>{console.log("not implemented")}:(o.classList.add("fgta5-combobox-dialog-nextbutton"),o.innerHTML="next data",o.style.display="none",o.setAttribute("href","javascript:void(0)"),o.addEventListener("click",t=>{var n=o.searchtext,i=o.limit,r=o.nextoffset;z(e,n,i,r)}),t.appendChild(o),t.setNext=(e,t)=>{o.nextoffset=e,o.limit=t,o.style.display=null!=e&&0!=e?"inline-block":"none"})}(e,u),u.addEventListener("cancel",t=>{u.setAttribute(M,"true"),t.preventDefault(),setTimeout(()=>{u.close(),u.removeAttribute(M),u.removeAttribute(D),U(e)},200)}),u.addEventListener("close",e=>{}),null!=d){d.remove();var g=function(e,t,n){const i=n.getElementsByTagName("option"),r=t.getElementsByTagName("thead")[0],s=t.getElementsByTagName("tbody")[0],a=t.getElementsByTagName("tfoot")[0];var o=null;if(r.style.display="none",a.style.display="none",!e.isRequired()){(d=$(e,"","none",{})).setAttribute("data-none",""),d.setAttribute(B,0),s.appendChild(d)}var l=0;for(let t of i){l++;let n=t.textContent||t.innerText,i=null==t.value||""==t.value?n:t.value;null!=t.getAttribute("default")&&(o={value:i,text:n});var d,u=s.rows.length-1;(d=$(e,i,n,{option:t})).setAttribute(B,u),s.appendChild(d)}return{count:l,default:o}}(e,u,d);null!=g.default&&(r.value=g.default.value,a.value=g.default.text),g.count>0&&(e.HasStaticOption=!0)}else r.value="",a.value="";e._read,e._setupDescription(),e._setLastValue(r.value,a.value)}(this,e)}get value(){return""==(e=this.Nodes.Input).value?null:e.value;var e}set value(e){throw Error("Value is readonly")}get text(){return this.Nodes.Display.value}set text(e){throw Error("Text is readonly")}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e,H(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=t?"true":"false";e.Nodes.Display.setAttribute(T,n),e.Nodes.Input.setAttribute(T,n),e.Nodes.InputWrapper.setAttribute(T,n),e.Nodes.Button.setAttribute(T,n),t?e.Nodes.Input.removeAttribute("readonly"):(e.Nodes.Input.setAttribute("readonly","true"),e.setError(null))}(this,e)}newData(e){!function(e,t){var n=e.Nodes.Input,i=e.Nodes.Display;void 0===t?(n.value="",i.value=""):"string"==typeof t?(n.value=t,i.value=t):null!=t?(n.value=t.value,i.value=t.text):(n.value="",n.value="");e.Nodes.Display.removeAttribute("changed"),e.setError(null),e.acceptChanges(),W(e)}(this,e)}acceptChanges(){var e;super.acceptChanges(),(e=this).Nodes.Display.removeAttribute("changed"),e._setLastValue(e.value,e.text)}reset(){var e,t,n;t=(e=this).getLastValue(),n=e.getLastText(),console.log("reset:",t,n),e.Nodes.Input.value=t,e.Nodes.Display.value=n,e.Nodes.Display.removeAttribute("changed"),e.acceptChanges()}clear(){this.Nodes.Dialog.querySelectorAll(`table tr[${S}]`).forEach(e=>{e.removeAttribute(S)})}_setLastValue(e,t){super._setLastValue(e),function(e,t,n){e.Nodes.LastValue.value=t,e.Nodes.LastText.value=n}(this,e,t)}getLastValue(){return""==(e=this.Nodes.LastValue.value)?null:e;var e}getLastText(){return this.Nodes.LastText.value}setSelected(e,t){null==t&&(t=e),function(e,t,n){e.Nodes.Input.value=t,e.Nodes.Display.value=n,q(e)}(this,e,t)}getDisplayBinding(){return this.Nodes.Input.getAttribute("data-display")}addOptions(e){P(this,e)}setOptions(e){!function(e,t){const n=e.Nodes.Dialog.getElementsByTagName("tbody")[0];F(e,n),e.isRequired();P(e,t,n)}(this,e)}#l=!1;isWaiting(){return this.#l}wait(e){this.#l=void 0===e||e,function(e,t){const n=e.Nodes.Dialog;var i=n.getElementsByTagName("tbody")[0];if(t=void 0===t||t,t){var r=document.createElement("tr"),s=document.createElement("td");r.setAttribute("data-waiting",""),s.innerHTML="fetching data from server ...",r.appendChild(s),i.appendChild(r)}else{var a=i.querySelector("[data-waiting]");null!=a&&a.remove(),null!=n.mask&&(n.mask.close(),delete n.mask)}}(this,e)}AbortHandler=null;HasStaticOption=null;focus(){this.Nodes.Display.focus()}}function H(e,t){t?(e.Nodes.Display.disabled=!0,e.Nodes.Button.disabled=!0):(e.Nodes.Display.disabled=!1,e.Nodes.Button.disabled=!1)}function O(e,t){t.setAttribute(S,""),setTimeout(()=>{if(""==t.getAttribute("data-none"));else{const n=e.Nodes.Dialog.getElementsByTagName("tbody")[0].querySelector("tr[data-none]");null!=n&&n.after(t)}},100)}function R(){return/Mobi|Android|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent)}function V(e,t,n,i,r,s){W(e),O(e,t),e.Nodes.Input.value=i,""==i&&"none"==r?(console.log("none dipilih"),e.Nodes.Display.value=""):e.Nodes.Display.value=r,function(e,t,n,i){const r=q(e);e.Listener.dispatchEvent((e=>new CustomEvent("selected",e))({sender:e,detail:{value:t,text:n,data:i,changed:r,sender:e}})),e.Nodes.Dialog.removeAttribute(D),setTimeout(()=>{e.Nodes.Dialog.close(),U(e)},200)}(e,i,r,s)}function $(e,t,n,i){let r=document.createElement("tr");var s=document.createElement("td");r.classList.add("fgta-combobox-option-row"),r.setAttribute("value",t),s.setAttribute("option",""),s.setAttribute("value",t),s.innerHTML=n,s.addEventListener("dblclick",s=>{R()||V(e,r,0,t,n,i)}),s.addEventListener("click",s=>{R()&&V(e,r,0,t,n,i)}),r.appendChild(s),e.Listener.dispatchEvent((e=>new CustomEvent("populating",e))({detail:{value:t,text:n,tr:r,data:i}}));var a=e.value??"";return t==a&&O(e,r),r}function q(e){if(null!=e.Form){var t=e.Nodes.Display;return e.value!=e.getLastValue()?(t.setAttribute("changed","true"),!0):(t.removeAttribute("changed"),!1)}}function F(e,t){const n=e.Nodes.Dialog;null!=t&&null!=t||(t=n.getElementsByTagName("tbody")[0]),t.innerHTML=""}function P(e,t,n){if(null==t||null==t)return;const i=e.Nodes.Dialog;null!=n&&null!=n||(n=i.getElementsByTagName("tbody")[0]);for(let i of t)n.appendChild($(e,i.value,i.text,t))}function U(e){"function"==typeof e.abortHandler&&e.abortHandler()}function z(e,t,n,i){const r=e.Nodes.Dialog,s=r.getElementsByTagName("tbody")[0];var a=!0;0==i&&(null!=r.querySelector(`table tr[${S}]`)?a=!1:(a=!0,F(e,s),r.setNext(null)));a&&((()=>{var t=s.querySelector("tr[data-none]");if(e.isRequired())null!=t&&t.remove();else if(null==t){var n=$(e,"","none",{});n.setAttribute("data-none",""),n.setAttribute(B,0),s.prepend(n),console.log("add none")}})(),e.Listener.dispatchEvent(x({detail:{sender:e,dialog:r,searchtext:t,limit:n,offset:i,addRow:(t,n,i)=>{var r=s.rows.length-1,a=$(e,t,n,i);a.setAttribute(B,r),s.appendChild(a)}}})))}function W(e){const t=e.Nodes.Dialog.querySelector(`table tr[${S}]`);if(null!=t){const e=t.getAttribute(B);if(""!=e&&null!=e){const s=Number(e),a=t.closest("tbody").querySelectorAll("tr");for(var n of a){var i=n.getAttribute(B)??0,r=Number(i);if(0!=r&&(r!=s&&s<r)){n.insertAdjacentElement("beforebegin",t);break}}}t.removeAttribute(S)}}const j='<?xml version="1.0" encoding="UTF-8"?>\n<svg transform="translate(0 3)" width="12" height="12" stroke="currentColor" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">\n<path d="m3.0207 17.447v3.9708h18.328v-3.9708" fill="none" stroke-linecap="square" stroke-width="4"/>\n<path d="m18.595 8.3606-6.4542-4.0017-6.3622 4.0017m6.3622-1.8991v7.1708" fill="none" stroke-linecap="square" stroke-width="4"/>\n</svg>\n';class G extends n{constructor(e){super(e),function(e,t){const n=e.Nodes.Container,i=e.Nodes.LastValue,r=e.Nodes.Input,s=document.createElement("div"),a=document.createElement("input"),o=document.createElement("button"),l=document.querySelector(`label[for="${t}"]`),d=document.createElement("a");r.parentNode.insertBefore(n,r),d.innerHTML="download",d.classList.add("fgta5-entry-download-link"),d.classList.add("hidden"),s.appendChild(a),s.appendChild(o),o.appendChild(r),n.appendChild(s),n.appendChild(d),n.appendChild(i),e.Nodes.InputWrapper=s,e.Nodes.Label=l,e.Nodes.Display=a,e.Nodes.Button=o,e.Nodes.DownloadLink=d,n.setAttribute("fgta5-component","Filebox"),s.classList.add("fgta5-entry-input-wrapper"),a.setAttribute("id",`${t}-display`),a.setAttribute("type","text"),a.setAttribute("picker","file"),a.setAttribute("fgta5-component","Filebox"),a.setAttribute("readonly","true"),a.classList.add("fgta5-entry-display"),a.classList.add("fgta5-entry-display-filebox");var u=r.getAttribute("placeholder");null!=u&&""!=u&&a.setAttribute("placeholder",u);var c=r.getAttribute("class");null!=c&&""!=c&&a.setAttribute("class",c);var m=r.getAttribute("style");null!=m&&""!=m&&a.setAttribute("style",m);const p=r.getAttribute("data-tabindex");null!=p&&a.setAttribute("tabindex",p);r.setAttribute("type","file"),r.setAttribute("picker","file"),r.removeAttribute("class"),r.removeAttribute("style"),r.classList.add("fgta5-entry-input"),r.classList.add("fgta5-entry-input-filebox"),r.getInputCaption=()=>null!=l?l.innerHTML:r.getAttribute("placeholder"),o.id=e.Id+"-button",o.insertAdjacentHTML("beforeend",j),o.classList.add("fgta5-entry-button-filebox"),l.setAttribute("for",o.id),l.classList.add("fgta5-entry-label");var h=r.getAttribute("required");null!=h&&e.markAsRequired(!0);e._setLastValue(r.value),e.acceptChanges(),e._setupDescription(),r.addEventListener("change",t=>{!function(e){var t=e.Nodes.Input;if(0===t.files.length)return;e.Nodes.Display.value=t.files[0].name,function(e){var t=e.Nodes.Display;e.value!=e.getLastValue()?t.setAttribute("changed","true"):t.removeAttribute("changed")}(e),e.InEditMode&&(e.setError(null),e.validate())}(e)})}(this,e)}#d="";set value(e){this.#d=e}get value(){return 0===this.Element.files.length?this.#d:this.Element.files[0].name}get file(){return 0===this.Element.files.length?0:this.Element.files[0]}get disabled(){return this.Element.disabled}set disabled(e){this.Element.disabled=e,function(e,t){var n=e.Nodes.Display,i=e.Nodes.Button;t?(n.disabled=!0,i.disabled=!0):(n.disabled=!1,i.disabled=!1)}(this,e)}#t=!0;get InEditMode(){return this.#t}setEditingMode(e){this.#t=e,function(e,t){var n=e.Nodes.Display,i=e.Nodes.Input,r=t?"true":"false";n.setAttribute("editmode",r),i.setAttribute("editmode",r),e.Nodes.InputWrapper.setAttribute("editmode",r),t?i.disabled=!1:(i.disabled=!0,e.setError(null))}(this,e)}newData(){var e;(e=this).Nodes.Input.value="",e.Nodes.Display.value="",e.acceptChanges()}acceptChanges(){!function(e){var t=e.Nodes.Display,n=e.Nodes.Input,i="";n.files.length>0&&(i=n.files[0].name);e._setLastValue(i),n.removeAttribute("changed"),t.removeAttribute("changed"),e.setError(null)}(this)}reset(){!function(e){e.Nodes.Input.value="";var t=e.getLastValue();e.Nodes.Display.value=t,e.acceptChanges()}(this)}isChanged(){return t=(e=this).Nodes.LastValue.value,(n=e.value)!=t&&(console.log(`Input '${e.Id}' is changed from '${t}' to '${n}'`),!0);var e,t,n}setError(e){super.setError(e),function(e,t){var n=e.Nodes.Display;null!==t&&""!==t?n.setAttribute("invalid","true"):n.removeAttribute("invalid")}(this,e)}setDisplay(e){!function(e,t){e.Nodes.Display.value=t}(this,e)}setDownloadLink(e,t){!function(e,t=null,n=null){const i=e.Nodes.DownloadLink;null==t?(i.classList.add("hidden"),i.innerHTML="download",i.onclick=null,i.removeAttribute("href")):(i.classList.remove("hidden"),i.innerHTML=t,"function"==typeof n?(i.removeAttribute("target","_blank"),i.setAttribute("href","javascript:void(0)"),i.onclick=()=>{n()}):(i.setAttribute("target","_blank"),i.setAttribute("href",n),i.onclick=null))}(this,e,t)}validate(){return function(e){if(e.isRequired()){if(""==e.Nodes.Display.value){var t=e.getErrorValidation("required");return null!=t?e.setError(t.message):e.setError("file harus diisi"),!1}return!0}return!0}(this)}focus(){this.Nodes.Display.focus()}}const K=new CustomEvent("locked"),Y=new CustomEvent("unlocked");function J(e,t=!0){var n=e.Element,i=!t;for(var r in e.Inputs){e.Inputs[r].setEditingMode(i)}return t?(n.dispatchEvent(K),n.setAttribute("locked",t)):(n.dispatchEvent(Y),n.removeAttribute("locked")),t}function Z(e){for(var t in e.Inputs){e.Inputs[t].acceptChanges()}}function Q(e,t=!1){var n=e.PrimaryKey,i=e.Inputs[n].getBindingData(),r={};for(var s in e.Inputs){var a=e.Inputs[s],o=a.getBindingData();if(!t||o==i||a.isChanged()){var l=a.getBindingData();l&&(r[l]=a.value)}}return r}const X={info:"fgta5-icon-info",warning:"fgta5-icon-warning",error:"fgta5-icon-error",question:"fgta5-icon-question"},ee='<svg width="32" height="32" version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<path d="m2.6952 0.48756-2.2081 2.1923-0.010649 3.1118 2.193 2.208 3.112 0.010647 2.2075-2.1929 6.415e-4 -0.066396 0.010022-3.0448-2.1924-2.208z" color="#000000" fill="#f00" stroke-width=".32071" style="-inkscape-stroke:none"/>\n<path transform="translate(5.0428e-6 -.019403)" d="m2.582 1.8223a0.33639 0.33639 0 0 0-0.23828 0.097656l-0.43164 0.43164a0.33639 0.33639 0 0 0 0 0.47656l1.4492 1.4492-1.4492 1.4473a0.33639 0.33639 0 0 0 0 0.47656l0.43164 0.43164a0.33639 0.33639 0 0 0 0.47656 0l1.4473-1.4492 1.4492 1.4492a0.33639 0.33639 0 0 0 0.47656 0l0.43164-0.43164a0.33639 0.33639 0 0 0 0-0.47656l-1.4492-1.4473 1.4492-1.4492a0.33639 0.33639 0 0 0 0-0.47656l-0.43164-0.43164a0.33639 0.33639 0 0 0-0.47656 0l-1.4492 1.4492-1.4473-1.4492a0.33639 0.33639 0 0 0-0.23828-0.097656z" fill="#fff" stroke-width=".52389"/>\n</svg>',te='<svg width="32" height="32" version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<path d="m1.6397 0.49839h5.2163c0.63356 0 1.1436 0.51005 1.1436 1.1436v3.83c0 0.63356-0.51005 1.1436-1.1436 1.1436l-2.0655 0.041342-1.8192 1.3427 0.54046-1.384h-1.872c-0.63356 0-1.1436-0.51005-1.1436-1.1436v-3.83c0-0.63356 0.51005-1.1436 1.1436-1.1436z" fill="#ececec" stroke-width=".29427"/>\n<path d="m4.103 1.9561c-0.3426 0-0.62096 0.24685-0.62096 0.55066 0 0.30381 0.27836 0.55066 0.61025 0.55066 0.3533 0 0.63167-0.24685 0.63167-0.55066 0-0.30381-0.27836-0.55066-0.62096-0.55066z" fill="#000080" stroke-width=".25205"/>\n<path d="m4.7552 3.6379-2.191 0.038907v0.15209h0.59436c0.44285 0.00353 0.50112 0.024758 0.50112 0.17685v1.0116c-0.01164 0.053055-0.02332 0.074277-0.06993 0.091962-0.08157 0.031833-0.303 0.045981-0.80413 0.049518h-0.08157v0.12733h3.0184v-0.12733h-0.08157c-0.78082-0.00707-0.88571-0.024759-0.88571-0.15209v-0.15563z" fill="#000080" stroke-width=".16051"/>\n</svg>',ne='<svg width="32" height="32" version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<ellipse cx="4.2374" cy="4.2692" rx="3.6992" ry="3.7484" fill="#000080"/>\n<path d="m4.8395 5.9237q0 0.23059-0.17562 0.3913-0.17562 0.16071-0.42928 0.16071-0.25757 0-0.43709-0.16071-0.17952-0.16071-0.17952-0.3913 0-0.22709 0.17952-0.38431 0.17952-0.15722 0.43709-0.15722 0.25367 0 0.42928 0.15722 0.17562 0.15722 0.17562 0.38431z" fill="#fff" stroke-width=".18906"/>\n<path d="m5.5497 2.9486q0 0.20872-0.10927 0.379-0.10927 0.16753-0.27318 0.31308-0.16001 0.14556-0.32391 0.28013-0.16001 0.13457-0.26928 0.27463-0.10927 0.14006-0.10927 0.29935 0 0.030209 0.01561 0.085137 0.01561 0.054927 0.01561 0.054927l-0.48782-0.0054933q-0.070246-0.10161-0.11708-0.21147-0.042928-0.1126-0.042928-0.27738 0-0.16753 0.093662-0.32407 0.097564-0.15929 0.22245-0.30484 0.12488-0.14556 0.21854-0.26914 0.097564-0.12359 0.097564-0.21971 0-0.14556-0.13659-0.24168-0.13659-0.096122-0.38245-0.096122-0.23415 0-0.33952 0.074151-0.10537 0.074151-0.1483 0.15105h-0.28879q-0.085856-0.054926-0.14049-0.13732-0.050733-0.08239-0.050733-0.14556 0-0.10985 0.12098-0.23344 0.12488-0.12633 0.39416-0.21421 0.26928-0.090629 0.69856-0.090629 0.43319 0 0.73368 0.12633 0.3005 0.12359 0.4527 0.32132 0.1561 0.19499 0.1561 0.41195z" fill="#fff" stroke-width=".16762"/>\n</svg>',ie='<svg width="32" height="32" version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<path transform="matrix(.20595 0 0 .1924 3.8511 -.31824)" d="m1.875 9.1397 18.269 31.643-18.269-1e-6h-18.269l9.1345-15.821z" fill="#ff7f2a"/>\n<path d="m4.751 6.4121q0 0.20413-0.14691 0.34641-0.14691 0.14227-0.35911 0.14227-0.21547 0-0.36564-0.14227-0.15017-0.14227-0.15017-0.34641 0-0.20104 0.15017-0.34022 0.15017-0.13918 0.36564-0.13918 0.2122 0 0.35911 0.13918 0.14691 0.13918 0.14691 0.34022z" fill="#fff" stroke-width=".16269"/>\n<path d="m4.8197 3.7022q0 0.098082-0.022286 0.19403-0.022286 0.093818-0.057939 0.20683l-0.31198 1.0832h-0.43232l-0.2897-1q-0.040112-0.15139-0.075767-0.26013-0.035655-0.11088-0.035655-0.22815 0-0.25373 0.16045-0.37101 0.1649-0.11727 0.46351-0.11727 0.29415 0 0.44569 0.10661 0.15599 0.10661 0.15599 0.38593z" fill="#fff" stroke-width=".15783"/>\n</svg>\n';class re{Text="button";constructor(e){this.Text=e}}class se{static ButtonOkCancel=Object.freeze({ok:new re("Ok"),cancel:new re("Cancel")});static ButtonYesNo=Object.freeze({yes:new re("Yes"),no:new re("No")});static ButtonYesNoCancel=Object.freeze({yes:new re("Yes"),no:new re("No"),cancel:new re("Cancel")});static async show(e,t){return await ae(e,t)}static async error(e){return await async function(e){return await ae(e,{iconSvg:ee})}(e)}static async info(e){return await async function(e){return await ae(e,{iconSvg:te})}(e)}static async warning(e){return await async function(e){return await ae(e,{iconSvg:ie})}(e)}static async confirm(e,t){return await async function(e,t){return t=void 0===t?se.ButtonOkCancel:t,await ae(e,{iconSvg:ne,buttons:t})}(e,t)}}async function ae(e,t){void 0===t&&(t={});var n=function(e,t){const n=document.createElement("dialog");if(n.classList.add("fgta5-messagebox-dialog"),n.addEventListener("close",e=>{n.parentNode.removeChild(n)}),t.title&&(n.divTitle=document.createElement("div"),n.divTitle.classList.add("fgta5-messagebox-title"),n.divTitle.innerHTML=t.title,n.appendChild(n.divTitle)),void 0!==t.iconSvg){var i=X[t.iconcss]?X[t.iconcss]:t.iconcss;n.divIcon=document.createElement("div"),n.divIcon.classList.add("fgta5-messagebox-icon"),n.divIcon.innerHTML=t.iconSvg,n.appendChild(n.divIcon)}else null!=t.iconcss&&(i=X[t.iconcss]?X[t.iconcss]:t.iconcss,n.divIcon=document.createElement("div"),n.divIcon.classList.add("fgta5-messagebox-icon"),n.divIcon.classList.add(i),n.appendChild(n.divIcon));return n.divContent=document.createElement("div"),n.divContent.classList.add("fgta5-messagebox-content"),n.divContent.innerHTML=e,n.appendChild(n.divContent),n.divButtons=document.createElement("div"),n.divButtons.classList.add("fgta5-messagebox-buttonsbar"),n.appendChild(n.divButtons),document.body.appendChild(n),n}(e,t);return new Promise(e=>{if(t.buttons)for(const[i,r]of Object.entries(t.buttons)){const t=document.createElement("button");t.classList.add("fgta5-messagebox-button"),t.innerHTML=r.Text,t.addEventListener("click",()=>{n.close(),e(i)}),n.divButtons.appendChild(t)}else{const t=document.createElement("button");t.classList.add("fgta5-messagebox-button"),t.innerHTML="Ok",t.addEventListener("click",()=>{n.close(),e("ok")}),n.divButtons.appendChild(t)}n.showModal()})}function oe(){const e=document.createElement("dialog");return e.classList.add("fgta5-modal-message"),e.addEventListener("close",t=>{e.parentNode.removeChild(e)}),document.body.appendChild(e),e.showModal(),e}class le{static get MENU(){return'<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <g stroke-linecap="square">\n\t<rect x="19.5" y="19.5" width="12" height="12" fill="currentColor"/>\n\t<rect x="2" y="20" width="12" height="12" fill="currentColor"/>\n\t<rect x="20" y="2" width="12" height="12" fill="currentColor"/>\n\t<rect x="2" y="2" width="12" height="12" fill="currentColor"/>\n </g>\n</svg>'}static get CLOSE(){return'<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">\n <g stroke="currentColor" stroke-linecap="round" stroke-width="5">\n\t<path d="M4 4 L28 28"/>\n\t<path d="M4 28 L28 4"/>\n </g>\n</svg>'}static get BACK(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<path d="m5.5873 1.1684-2.515 3.0773 2.515 3.0773" fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="1.3229"/>\n</svg>'}static get ACTION(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<path d="m3.4777 0.49839-1.3861 4.1094h1.945l-1.2743 3.3919 3.7782-4.663h-1.9226l1.252-2.8383z"/>\n</svg>'}static get USER(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<g stroke="#fff" fill="currentColor" stroke-linecap="round" stroke-width=".223">\n<path d="m4.2633 4.9935c-0.85356-0.0027456-2.0017 0.17383-2.3611 0.28348-0.35939 0.10964-0.71426 0.67396-0.71727 0.93517 0.62166 0.68677 2.0469 1.1278 3.0784 1.3222 1.0315-0.19439 2.4572-0.6354 3.0789-1.3222-0.0030132-0.26121-0.35788-0.82553-0.71727-0.93517-0.35939-0.10964-1.5081-0.28622-2.3616-0.28348z"/>\n<path d="m3.9018 5.7326-0.37517 1.8759 0.69032 0.57026 0.73534-0.55525-0.36016-1.8909z" stroke-linejoin="bevel"/>\n<rect x="3.8568" y="4.9072" width=".76535" height=".76535" stroke-linejoin="bevel"/>\n<circle cx="4.2238" cy="2.7633" r="2.0523"/>\n</g>\n</svg>'}static get LOGOUT(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<g stroke="currentColor" fill="currentColor" stroke-linecap="round" stroke-linejoin="bevel">\n<path d="m5.0725 0.70989h-4.3649v7.0783h4.3649z" fill="none" stroke-width=".423"/>\n<path d="m5.0725 0.70989-3.1237 2.5006 0.021392 4.5776h-1.2627l-2.6e-7 -7.0783z" stroke-width=".423"/>\n<path d="m3.1515 5.0723h3.4527v1.3606l1.3955-1.9759-1.3955-1.9759v1.3606h-3.4527z" stroke-width=".423"/>\n</g>\n</svg>'}static get SEARCH(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<g fill="none" stroke="currentColor" stroke-linecap="square">\n<circle cx="4.9312" cy="3.5669" r="2.7378" stroke-width=".66146"/>\n<path d="m1.1989 7.1728 0.88885-0.80617" stroke-width="1.3229"/>\n</g>\n</svg>'}static get SETTING(){return'<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<g transform="matrix(.82343 0 0 .82343 4.0086 7.2155)" fill="currentColor" stroke-width="1.2144">\n<path d="m0 0h48v48h-48z" fill="none"/>\n<path d="m38.86 25.95c0.08-0.64 0.14-1.29 0.14-1.95s-0.06-1.31-0.14-1.95l4.23-3.31c0.38-0.3 0.49-0.84 0.24-1.28l-4-6.93c-0.25-0.43-0.77-0.61-1.22-0.43l-4.98 2.01c-1.03-0.79-2.16-1.46-3.38-1.97l-0.75-5.3c-0.09-0.47-0.5-0.84-1-0.84h-8c-0.5 0-0.91 0.37-0.99 0.84l-0.75 5.3c-1.22 0.51-2.35 1.17-3.38 1.97l-4.98-2.01c-0.45-0.17-0.97 0-1.22 0.43l-4 6.93c-0.25 0.43-0.14 0.97 0.24 1.28l4.22 3.31c-0.08 0.64-0.14 1.29-0.14 1.95s0.06 1.31 0.14 1.95l-4.22 3.31c-0.38 0.3-0.49 0.84-0.24 1.28l4 6.93c0.25 0.43 0.77 0.61 1.22 0.43l4.98-2.01c1.03 0.79 2.16 1.46 3.38 1.97l0.75 5.3c0.08 0.47 0.49 0.84 0.99 0.84h8c0.5 0 0.91-0.37 0.99-0.84l0.75-5.3c1.22-0.51 2.35-1.17 3.38-1.97l4.98 2.01c0.45 0.17 0.97 0 1.22-0.43l4-6.93c0.25-0.43 0.14-0.97-0.24-1.28zm-14.86 5.05c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"/>\n</g>\n</svg>'}static get HOME(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<g fill="currentColor">\n<rect x="4.2337" y="3.9367" width="3.0541" height="4.063"/>\n<rect x="1.2121" y="3.9367" width=".9332" height="4.0184"/>\n<path d="m4.2479 1.0276 3.7518 3.4383-7.5035-1e-7z"/>\n<rect x="1.6787" y="3.9367" width="3.2135" height="1.4646"/>\n</g>\n</svg>'}static get TRASH(){return'<svg version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg">\n<g fill="currentColor">\n<path d="m6.5113 2.4805h-4.775l0.85705 5.5191h3.0609z" stroke-linecap="square" stroke-width="1.3229"/>\n<path d="m3.2115 0.40101v0.41341h-1.8266v0.86816h5.519v-0.86816h-1.8462v-0.41341z"/>\n</g>\n</svg>'}static get DIRDEF(){return'<svg width="32" height="32" version="1.1" viewBox="0 0 8.4667 8.4667" xmlns="http://www.w3.org/2000/svg"><rect x=".4961" y="3.9307" width="7.5035" height="4.0689"/><path d="m0.4961 3.2521h7.5035l1e-7 -0.71184h-4.2386l-0.87664-1.3525h-2.3883z"/><rect x="5.8727" y="5.303" width="1.2058" height="1.1077" fill="#fff"/></svg>'}static get UNSORT(){return'<?xml version="1.0" encoding="UTF-8"?>\n<svg version="1.1" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">\n<path d="m2.1656 5.2663 3.8057-4.6994 3.8057 4.6994z" fill="currentColor"/>\n<path d="m2.1656 6.6955 3.8057 4.6994 3.8057-4.6994z" fill="currentColor"/>\n</svg>'}static get SORTASC(){return'<?xml version="1.0" encoding="UTF-8"?>\n<svg version="1.1" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">\n<path d="m2.1943 9.1198 3.8057-6.5338 3.8057 6.5338z" fill="currentColor"/>\n</svg>'}static get SORTDESC(){return'<?xml version="1.0" encoding="UTF-8"?>\n<svg version="1.1" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">\n<path d="m2.1943 2.586 3.8057 6.5338 3.8057-6.5338z" fill="currentColor"/>\n</svg>\n'}static get YES(){return'<svg width="1rem" height="1rem" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n<circle cx="15" cy="15" r="12" stroke="currentColor" stroke-width="1" fill="none" />\n<circle cx="15" cy="15" r="8" fill="currentColor" />\n</svg>'}static get NO(){return'<svg width="1rem" height="1rem" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n<circle cx="15" cy="15" r="12" stroke="currentColor" stroke-width="1" fill="none" />\n</svg>'}static get NEWDOCUMENT(){return'<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<g stroke-linecap="round" stroke-linejoin="bevel" stroke-width="2">\n<path d="m40 34.75v-30.75h-30v41h20z" fill="#e6e6e6" stroke="#000"/>\n<circle cx="25" cy="21" r="9" fill="#59f" stroke="#000"/>\n<path d="m30 45v-10h10z"/>\n<path d="m20 21h10" stroke="#fff"/>\n<path d="m25 16v10" stroke="#fff"/>\n</g>\n</svg>'}static get PROGRAM(){return'<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<g fill="currentColor">\n<path d="m20.019 2c-2.9332 0-5.2348 2.3057-5.2348 5.2389v3.1417h-8.3806c-2.3047 0-4.1903 1.8856-4.1903 4.1903v7.9628h3.1417c3.1427 0 5.6567 2.514 5.6567 5.6567 0 3.1427-2.514 5.6567-5.6567 5.6567h-3.3547v7.9628c0 2.3047 1.8856 4.1903 4.1903 4.1903h7.9628v-3.1458c0-3.1427 2.514-5.6567 5.6567-5.6567 3.1427 0 5.6567 2.514 5.6567 5.6567v3.1458h7.9628c2.3047 0 4.1903-1.8856 4.1903-4.1903v-8.3806h3.1417c2.9332 0 5.2389-2.3057 5.2389-5.2389 0-2.9332-2.3057-5.2389-5.2389-5.2389h-3.1417v-8.3806c0-2.3047-1.8856-4.1903-4.1903-4.1903h-8.3806v-3.1417c0.20951-2.9332-2.0968-5.2389-5.03-5.2389z"/>\n</g>\n</svg>'}}const de="rowselector",ue="autonumber",ce="binding",me="sorting",pe="formatter",he="text-align",ve="data-selected",ge="data-name",fe="key",be="keyvalue",we="data-rowprocessing",ye="data-mainrowhead",Ee="linenumber",Le="rowselector",Ae="autonumber",Ne="standard",Ce=e=>new CustomEvent("rowremoving",e);function xe(e,t,n){null!=n&&e.setAttribute(t,n)}function Ie(){var e=document.createElement("label"),t=document.createElement("input"),n=document.createElement("span");return e.classList.add("fgta5-gridview-checkbox"),e.appendChild(t),e.appendChild(n),e.checkbox=t,t.setAttribute("type","checkbox"),n.classList.add("fgta5-gridview-checkmark"),e}function ke(e,t){var n=t.target,i=e.Nodes.Tbody.querySelectorAll("tr");for(var r of i){r.querySelector(`td[${de}] input[type="checkbox"]`).checked=n.checked,n.checked?r.setAttribute(ve,""):r.removeAttribute(ve)}}function Te(e,t){var n=t.target,i=n.closest("tr");n.checked?i.setAttribute(ve,""):(i.removeAttribute(ve),e.Nodes.Thead.querySelector(`tr th[${de}] input[type="checkbox"]`).checked=!1)}function De(e,t,n){void 0===n&&(n=e.Nodes.Tbody);var i=document.createElement("tr");i.classList.add("fgta5-gridview-row");var r=e.Key;if(null!=r){var s=t[r];null!=s&&(i.setAttribute(fe,r),i.setAttribute(be,s))}for(var a of e.Columns){let n=document.createElement("td");if(xe(n,"class",a.cssclass),xe(n,"style",a.cssstyle),xe(n,ge,a.name),xe(n,ce,a.binding),xe(n,pe,a.formatter),xe(n,he,a.textalign),n.classList.add("fgta5-gridview-cell"),a.type==Le){var o=Ie();o.addEventListener("change",t=>{Te(e,t)}),n.appendChild(o),n.setAttribute(de,"")}else if(a.type==Ae){var l=Oe(e);l++,n.setAttribute(ue,""),n.setAttribute(Ee,l),n.innerHTML=l,n.addEventListener("click",t=>{Me(e,n,i)}),n.addEventListener("dblclick",t=>{Se(e,n,i)})}else{let r=t[a.binding];if(n.setAttribute("data-value",r),null!=a.formatter)try{let t=e.Formatters[a.name];void 0===t&&(t=Re(a.formatter),"function"==typeof t&&(e.Formatters[a.name]=t)),"function"==typeof t&&(r=t(r))}catch(e){console.error(e)}n.innerHTML=null!=r?r:"",n.addEventListener("click",t=>{Me(e,n,i)}),n.addEventListener("dblclick",t=>{Se(e,n,i)})}i.appendChild(n)}return Be(e,i),0==n.children.length&&(e.CurrentRow=i),n.appendChild(i),i}function Me(e,t,n){e.CurrentRow=n,e.Listener.dispatchEvent(new CustomEvent("cellclick",{detail:{tr:n,td:t}}))}function Se(e,t,n){e.CurrentRow=n,e.Listener.dispatchEvent(new CustomEvent("celldblclick",{detail:{tr:n,td:t}}))}function Be(e,t){e.Listener.dispatchEvent(new CustomEvent("rowrender",{detail:{tr:t}}))}function _e(e,t){var n=t.getAttribute(me),i=t.getAttribute(ce),r=t.closest("th");r.setAttribute(ce,i),null==n||""==n?(r.setAttribute(me,"asc"),t.setAttribute(me,"asc"),t.innerHTML=le.SORTASC):"asc"==n?(r.setAttribute(me,"desc"),t.setAttribute(me,"desc"),t.innerHTML=le.SORTDESC):(r.removeAttribute(me),t.setAttribute(me,""),t.innerHTML=le.UNSORT);const s=He(e,t.closest("tr")),a=e.Criteria;e.Listener.dispatchEvent(new CustomEvent("sorting",{detail:{sort:s,criteria:a}}))}function He(e,t){null==t&&(t=e.Nodes.Thead.querySelector(`tr[${ye}]`));var n=t.querySelectorAll(`th[${me}]`),i={};for(var r of n){var s=r.getAttribute(me);i[r.getAttribute(ce)]=s}return i}function Oe(e){var t=e.Nodes.Tbody.querySelector("tr:last-child td[autonumber]");if(null==t)return 0;var n=t.getAttribute(Ee);return null==n?0:Number(n)}function Re(e){const t=e.match(/(\w+)\(([^)]+)\)/);if(!t)return null;const[,n,i]=t,r=i.split(",").map(e=>parseFloat(e.trim()));return"decimal"===n?e=>{return t=e,n=r[1],new Intl.NumberFormat("en-US",{minimumFractionDigits:n,maximumFractionDigits:n}).format(t);var t,n}:"int"===n?e=>{return t=e,new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:0,useGrouping:!1}).format(t);var t}:"checkmark"===n?e=>function(e){const t=le.YES,n=le.NO;if(null==e)return n;if(!1===e)return n;if("0"==e||""==e||"-"==e||0==e)return n;return t}(e):"dateiso"===n?e=>function(e){const t=new Date(e);return t.toISOString().split("T")[0]}(e):"datelong"===n?e=>function(e){const t=new Date(e),n={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("en-ID",n).replace(".","")}(e):"dateshort"===n||"date"===n?e=>function(e){const t=new Date(e),n={day:"2-digit",month:"2-digit",year:"numeric"};return t.toLocaleDateString("en-ID",n).replace(".","")}(e):null}class Ve{constructor(e){this.#u=e.name,this.#c=e.title,this.#m=e.disabled,this.#p=e.icon,this.#h=e.url}static get ICON_DEFAULT(){return'<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">\n<g fill="currentColor">\n<path d="m20.019 2c-2.9332 0-5.2348 2.3057-5.2348 5.2389v3.1417h-8.3806c-2.3047 0-4.1903 1.8856-4.1903 4.1903v7.9628h3.1417c3.1427 0 5.6567 2.514 5.6567 5.6567 0 3.1427-2.514 5.6567-5.6567 5.6567h-3.3547v7.9628c0 2.3047 1.8856 4.1903 4.1903 4.1903h7.9628v-3.1458c0-3.1427 2.514-5.6567 5.6567-5.6567 3.1427 0 5.6567 2.514 5.6567 5.6567v3.1458h7.9628c2.3047 0 4.1903-1.8856 4.1903-4.1903v-8.3806h3.1417c2.9332 0 5.2389-2.3057 5.2389-5.2389 0-2.9332-2.3057-5.2389-5.2389-5.2389h-3.1417v-8.3806c0-2.3047-1.8856-4.1903-4.1903-4.1903h-8.3806v-3.1417c0.20951-2.9332-2.0968-5.2389-5.03-5.2389z"/>\n</g>\n</svg>'}#u;get name(){return this.#u}#c;get title(){return this.#c}#m;get disabled(){return!0===this.#m}#p;get icon(){return this.#p}#h;get url(){return this.#h}}const $e="showed",qe="data-module",Fe="data-favourite",Pe="data-openedmodule",Ue="data-currentuser",ze="data-iconcontainer",We="data-iconimage",je="data-icontext",Ge="data-gridarea",Ke="data-icon",Ye="data-title",Je="data-info",Ze="data-buttonclose",Qe="data-dragover",Xe="data-label",et="data-icon",tt="data-mainbutton",nt="draggable",it="fgta5-button-menu",rt="fgta5-button-shorcutclose",st="hidden",at="click",ot="dblclick",lt="dragstart",dt="Favourite Programs",ut="Opened Programs",ct=e=>new CustomEvent("action",e);let mt,pt;function ht(e,n,i){return t.createSvgButton(n,"fgta5-button-head",i)}function vt(e){console.log("show menu");e.Nodes.Nav.setAttribute($e,"")}function gt(e){ft(e),e.Nodes.IFrames.classList.add(st)}function ft(e){e.Nodes.Nav.removeAttribute($e)}function bt(e,t,n){t.classList.remove(st),e.Listener.dispatchEvent(ct({detail:{name:"moduleopened",modulename:n.name,title:n.title,iframe:t}})),xt(e,t,n)}async function wt(e,n){const i=e.Nodes.IFrames,r=n.name;console.log(n);const s=`iframe[${qe}="${r}"]`;if(null==i.querySelector(s)){const s=$fgta5.Modal.createMask("Please wait..."),a=new URL(n.url);a.searchParams.append("prog",n.name);let o=document.createElement("iframe");o.classList.add("fgta5-iframe"),o.classList.add(st),o.setAttribute(qe,r),o.onload=i=>{!function(e,n,i){n.contentWindow.postMessage({action:t.ACTION_APPLICATIONLOADED,module:{title:i.title,name:i.name}},"*"),e.Listener.dispatchEvent(ct({detail:{name:"moduleloaded",modulename:i.name,title:i.title,iframe:n}})),e.Listener.dispatchEvent(ct({detail:{name:"moduleopened",modulename:i.name,title:i.title,iframe:n}})),xt(e,n,i)}(e,o,n),o.classList.remove(st),s.close()},fetch(a).then(t=>{if(!t.ok)throw new Error(`HTTP Error: ${t.status}`);o.src=a,i.appendChild(o),e.Nodes.IFrames.classList.remove(st)}).catch(e=>{console.error(e),$fgta5.MessageBox.error(e),s.close()})}else{var a=i.querySelectorAll("iframe");for(var o of a){o.getAttribute(qe)==r?bt(e,o,n):o.classList.add(st)}e.Nodes.IFrames.classList.remove(st)}}function yt(e,n){const i=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div");i.setAttribute("name",n.name),i.setAttribute(ze,""),n.disabled&&i.setAttribute("disabled",""),r.setAttribute(We,""),null!=n.icon?(r.setAttribute(We,""),r.style.backgroundImage=`url('${n.icon}')`):r.innerHTML=Ve.ICON_DEFAULT,s.innerHTML=n.title,s.setAttribute(je,""),i.appendChild(r),i.appendChild(s);const a=t.isMobileDevice()?at:ot;return r.addEventListener(a,()=>{e.openModule(n),r.style.animation="iconClicked 0.2s forwards",setTimeout(()=>{r.style.animation="unset",ft(e)},300)}),i}function Et(e,t){const n=document.createElement("div"),i=document.createElement("div"),r=document.createElement("div");return n.setAttribute(ze,""),t.disabled&&n.setAttribute("disabled",""),i.setAttribute(We,""),null!=t.icon?i.style.backgroundImage=`url('${t.icon}')`:i.style.backgroundImage=`url('data:image/svg+xml,${encodeURIComponent(le.DIRDEF)}')`,r.innerHTML=t.title,r.setAttribute(je,""),n.appendChild(i),n.appendChild(r),i.addEventListener(at,()=>{i.style.animation="iconClicked 0.4s forwards",setTimeout(()=>{i.style.animation="unset"},400),setTimeout(()=>{Nt(e,t.icons,t.parent)},200)}),n}function Lt(e){Nt(e,e.RootIcons)}function At(e,t){let n=[];for(var i of t)if(i instanceof $fgta5.ModuleData||"program"==i.type){let t=yt(e,i instanceof $fgta5.ModuleData?i:new $fgta5.ModuleData(i));var r;n.push(t),r=null!=i.keyword?`${i.name} : ${i.keyword}`:i.name,e.Modules[i.name]={keyword:r,data:i}}else{var s=At(e,i.items),a=Et(e,{title:i.title,icon:i.icon,icons:s,parent:n});!1!==i.border&&a.classList.add("fgta5-icongroup"),n.push(a)}return n}function Nt(e,t,n){const i=e.Nodes.MenuBoard,r=e.Nodes.MenuResetButton;if(null!=n){if(!0!==t[0].isbackIcon){var s=Et(e,{title:"",icon:`data:image/svg+xml,${encodeURIComponent(le.BACK)}`,icons:n,parent:n.parent});s.isbackIcon=!0,t.unshift(s)}r.classList.remove(st)}else r.classList.add(st);i.style.animation="fadeOutLeft 0.05s forwards",setTimeout(()=>{for(var e of(i.innerHTML="",i.style.animation="fadeInRight 0.3s forwards",t))i.appendChild(e)},50)}async function Ct(e,n){if(""==n.trim()){if(void 0===e.previousSearch)return void(e.previousSearch="");if(n==e.previousSearch)return;return e.previousSearch="",void Lt(e)}e.previousSearch=n;const i=e.Nodes.MenuBoard,r=e.Modules;i.innerHTML="";var s=0;for(var a in r){if(r[a].data.title.toLowerCase().includes(n)){s++;var o=r[a];if(null!=o){var l=yt(e,o.data);l.style.animation="dropped 0.3s forwards",i.appendChild(l),s<10&&await t.sleep(100)}}}}function xt(e,n,i){const r=e.Nodes.Opened,s=`fgta5-sch-mod--${i.name}`,a=document.getElementById(s);if(null==a){const a=function(e,n,i,r){const s=e.Nodes.Opened,a=document.createElement("div"),o=document.createElement("div"),l=document.createElement("div"),d=document.createElement("div"),u=document.createElement("a"),c=t.isMobileDevice()?at:ot;a.id=r,a.classList.add("fgta5-openedmodule-shortcut"),a.setAttribute(nt,"true"),a.appendChild(o),a.appendChild(l),a.appendChild(d),a.appendChild(u),a.addEventListener(c,async t=>{await wt(e,n)}),a.addEventListener(lt,e=>{!function(e,t,n){pt="addtofave",t.dataTransfer.setData("modulename",n.name),mt=n.name}(0,e,n)}),o.setAttribute(Ke,""),null!=n.icon?o.style.backgroundImage=`url('${n.icon}')`:o.innerHTML=Ve.ICON_DEFAULT;l.setAttribute(Ye,""),l.innerHTML=n.title,d.setAttribute(Je,""),d.innerHTML="idle";var m=t.createSvgButton(le.CLOSE,rt,e=>{e.stopPropagation(),i.remove(),a.remove(),0==s.childNodes.length&&s.hide()});return u.setAttribute(Ze,""),u.appendChild(m),a}(e,i,n,s);r.prepend(a)}else r.prepend(a);r.show()}function It(e,t,n,i){const r=e.Nodes.TrashBox,s=r.querySelector(`[${tt}]`);t.setAttribute(nt,"true"),t.addEventListener(lt,e=>{pt="removefromfave",e.dataTransfer.setData("modulename",n),r.classList.remove(st)}),t.addEventListener("dragend",e=>{setTimeout(()=>{r.classList.add(st),s.removeAttribute(Qe)},100)}),s.addEventListener("dragover",e=>{"removefromfave"==pt&&(e.preventDefault(),s.setAttribute(Qe,""))}),s.addEventListener("dragleave",e=>{s.removeAttribute(Qe)}),s.addEventListener("drop",t=>{if("removefromfave"==pt){const r=t.dataTransfer.getData("modulename");if(""==r)return;var n=i.querySelector(`[name="${r}"]`);null!=n&&(n.style.animation="removing 0.3s forwards",setTimeout(()=>{n.remove()},300),e.Listener.dispatchEvent(new CustomEvent("removefavourite",{detail:{modulename:r}}))),t.preventDefault(),pt=""}})}const kt="hidden",Tt="fgta5-app-section",Dt="data-active",Mt="data-title",St="data-topbar",Bt="data-backbutton",_t="backbuttonclick",Ht="sectionshowing";class Ot{#v;#g;#f;#u;#c;#b;#w;#y;#E=new EventTarget;static get ATTR_ACTIVE(){return Dt}static get DIR_LEFT(){return 0}static get DIR_RIGHT(){return 1}static get EVT_BACKBUTTONCLICK(){return _t}static get EVT_SECTIONSHOWING(){return Ht}get Id(){return this.#v}get Index(){return this.#f}get Name(){return this.#u}get Title(){return this.#c}get Element(){return this.#g}get PreviousSection(){return this.#b}get getActiveSection(){return this.#y}get Listener(){return this.#E}get Carousell(){return this.#w}set Title(e){this.#c=e,function(e,t){e.Nodes.Title.innerHTML=t}(this,e)}constructor(e,n){const i=e.id,r=i,s=e.getAttribute(Mt);this.#g=e,this.#v=i,this.#u=r,this.#c=s??"section",null!=n&&(null!=n.index&&(this.#f=n.index),this.#w=n.carousell,"function"==typeof n.fn_getActiveSection?this.#y=n.fn_getActiveSection:this.#y=()=>null),function(e){const n=e.Element;n.setAttribute("name",e.Name),n.classList.add(Tt),0==e.Index?n.setAttribute(Dt,""):n.classList.add(kt);const i=document.createElement("div"),r=document.createElement("div"),s=t.createSvgButton(le.BACK,"",()=>{!function(e){e.Listener.dispatchEvent((t={cancelable:!0,detail:{fn_ShowNextSection:()=>{null!=e.sectionReturn?e.sectionReturn.show({direction:1}):e.PreviousSection.show({direction:1})}}},new CustomEvent(_t,t)));var t}(e)}),a=document.createElement("div");i.setAttribute(St,""),i.appendChild(s),i.appendChild(a),i.appendChild(r),s.setAttribute(Bt,""),0==e.Index&&s.classList.add("hidden");a.classList.add("fgta5-app-section-icondiv"),a.style.display="none",r.setAttribute(Mt,e.Title),r.innerHTML=e.Title,n.prepend(i),e.Nodes={BackButton:s,Title:r,iconDiv:a}}(this)}async show(e,t){const n=this.getActiveSection();this.#b=n,await async function(e,t,n){"function"==typeof n&&await n();let i=0;null!=t&&(i=t.direction??0);let r=[{curr:"fadeOutLeft 0.1s forwards",comming:"fadeInRight 0.3s forwards"},{curr:"fadeOutRight 0.1s forwards",comming:"fadeInLeft 0.3s forwards"}];const s=e,a=s.Element,o=e.PreviousSection;if(null!=o){if(s.Name==o.Name)return;const t=o.Element;e.Carousell.setCurrentSection(s),e.Carousell.dispatchSectionShowing(o,s),e.Listener.dispatchEvent(new CustomEvent(Ht,{data:{detail:{currSection:o,commingSection:s}}})),a.style.animation="unset",t.style.animation=r[i].curr,setTimeout(()=>{t.classList.add(kt),t.style.animation="unset",t.removeAttribute(Dt),a.classList.remove(kt),a.style.animation=r[i].comming,setTimeout(()=>{a.style.animation="unset",a.setAttribute(Dt,"")},300)},100)}else a.classList.remove(kt),a.setAttribute(Dt,"")}(this,e,t)}sectionReturn;setSectionReturn(e){this.sectionReturn=e}setIconUrl(e){!function(e,t){const n=e.Nodes.iconDiv;n.style.display="unset",null==t||""==t?n.innerHTML=le.PROGRAM:(n.style.backgroundImage=`url('${t}')`,n.style.backgroundSize="cover",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="center")}(this,e)}addEventListener(e,t){this.Listener.addEventListener(e,t)}back(){null!=this.sectionReturn&&this.sectionReturn.show({direction:1})}}const Rt="fgta5-button-head",Vt="application-title",$t="data-withfooter";function qt(e,t){document.title=t,document.getElementById(Vt).innerHTML=t}const Ft="sectionshowing";function Pt(e,t){const n=t.querySelector(`section[${Ot.ATTR_ACTIVE}]`).getAttribute("name");return e.Items[n]}class Ut extends EventTarget{#g;constructor(e,t={}){super();const n=document.getElementById(e);null==n&&console.error("element dengan id: '$id' tidak ditemukan di halaman"),this.#g=n,function(e,t){const n=e.element,i=document.createElement("div");i.classList.add("fgta5-dialogbox-container");for(;n.firstChild;)i.appendChild(n.firstChild);if(n.appendChild(i),null!=t.title){const e=document.createElement("div");e.innerHTML=t.title,n.prepend(e)}const r=document.createElement("div");e.btnOk=document.createElement("button"),e.btnCancel=document.createElement("button"),e.btnOk.innerHTML="Ok",e.btnCancel.innerHTML="Cancel",r.appendChild(e.btnOk),r.appendChild(e.btnCancel),n.appendChild(r)}(this,t)}get element(){return this.#g}async dispatchCancelableEvent(e){const t=this._getListeners(e.type);for(const n of t)if(await n(e),e.defaultPrevented)break;return e.defaultPrevented}_getListeners(e){return this._listeners?.[e]||[]}addAsyncEventListener(e,t){this._listeners||(this._listeners={}),this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}async show(){console.log("showing modal dialog");const e=this,t=this.#g;var n=new Event("showing",{});return await e.dispatchCancelableEvent(n),t.showModal(),t.setAttribute("showed",!0),new Promise(t=>{e.btnOk.onclick=async n=>{console.log("btnOk click");var i=new Event("ok",{cancelable:!0});i.result={},await e.dispatchCancelableEvent(i)?console.log("dialog invalid, and was canceled"):(e.close(),t(i.result))},e.btnCancel.onclick=n=>{console.log("btnCancel click"),e.close(),t(null)}})}close(){this.#g.close(),this.btnOk.onclick=null,this.btnCancel.onclick=null}}const zt={};function Wt(e,t){var n=new Date(e);return{dt:new Date(n.getFullYear(),n.getMonth(),n.getDate()),boundary:new Date(t.getFullYear(),t.getMonth(),t.getDate())}}var jt=Object.freeze({__proto__:null,addCustomValidator:function(e,t){zt[e]=t},email:function(e,t){return/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e)},getCustomValidator:function(e){return zt[e]},getInvalidMessage:function(e,t,n){var i=t.getAttribute(`invalid-message-${e}`);return null!=i&&""!==i||(i=n),i},max:function(e,t){return null==t||0===t||!(null==e||e>t)},maxdate:function(e,t){var{dt:n,boundary:i}=Wt(e,t);return!(n>i)},maxlength:function(e,t){return null==t||0===t||!(null==e||e.length>t)},maxtime:function(e,t){return!(e>t)},min:function(e,t){return null==t||0===t||!(null==e||e<t)},mindate:function(e,t){var{dt:n,boundary:i}=Wt(e,t);return!(n<i)},minlength:function(e,t){return null==t||0===t||!(null==e||e.length<t)},mintime:function(e,t){return!(e<t)},pattern:function(e,t){return!0},required:function(e){return null!=e&&""!==e},valueIs:function(e,t){const n=t.replace(/'/g,'"');return!!JSON.parse(n).includes(e)}});const Gt={Component:t,Form:class extends t{#L=!1;#A=!1;#N;Inputs={};constructor(e){super(e),this.#C(),function(e,t){var n=document.getElementById(t);e.Id=t,e.Element=n,e.Inputs={},e.Element.setAttribute("novalidate",""),e.Element.addEventListener("submit",e=>{e.preventDefault()});for(var i=n.querySelectorAll("input"),r=0;r<i.length;r++){var s=i[r],a=s.getAttribute("fgta5-component");null!=a&&null!=s.id&&""!=s.id&&("Textbox"==a?e.Inputs[s.id]=new o(s.id):"Numberbox"==a?e.Inputs[s.id]=new u(s.id):"Datepicker"==a?e.Inputs[s.id]=new f(s.id):"Timepicker"==a?e.Inputs[s.id]=new A(s.id):"Combobox"==a?e.Inputs[s.id]=new _(s.id):"Checkbox"==a?e.Inputs[s.id]=new p(s.id):"Filebox"==a&&(e.Inputs[s.id]=new G(s.id)))}}(this,e)}get AutoID(){return this.#A}get PrimaryKey(){return this.#N}lock(e){this.#L=J(this,e)}isLocked(){return this.#L}#x;isNew(){return this.#x}setAsNewData(){this.#x=!0}reset(){this.#x=!1,function(e){for(var t in e.Inputs){e.Inputs[t].reset()}}(this)}clear(e){!function(e,t=""){e.Element.querySelectorAll('input:not([type="file"]').forEach(e=>{e.value=t})}(this,e)}acceptChanges(){this.#x=!1,Z(this)}isChanged(){return function(e){for(var t in e.Inputs){if(e.Inputs[t].isChanged())return!0}return!1}(this)}#I;_setLastError(e){this.#I=e}getLastError(){return this.#I}getPrimaryInput(){const e=this.PrimaryKey;return this.Inputs[e]}newData(e){this.#x=!0,this.lock(!1),function(e,t){for(var n in t=null!=t?t:{},e.Inputs){var i=e.Inputs[n],r=t[i.getBindingData()];if(i instanceof _){var s=null!=r?r:{value:"",text:""};i.newData({value:s.value,text:s.text})}else i.newData(r)}}(this,e)}render(){!function(e){for(var t in e.Inputs){e.Inputs[t].bindForm(e)}e.isLocked()?J(e,!0):J(e,!1)}(this)}validate(){return function(e){var t=!0;for(var n in e.Inputs){var i=e.Inputs[n];if(t&&=i.validate(),!t){var r=i.getLastError();return e._setLastError(r),!1}}return e._setLastError(null),!0}(this)}getFiles(){return function(e){const t={};for(var n in e.Inputs){var i=e.Inputs[n];if(!(i instanceof G))continue;if(!i.isChanged())continue;const r=i.getBindingData();null!=i.file&&(t[r]=i.file)}return 0===Object.keys(t).length?null:t}(this)}getDataChanged(){return Q(this,!0)}#k;setData(e){this.#k=e,function(e,t){for(var n in e.Inputs){var i=e.Inputs[n],r=t[i.getBindingData()];if(i instanceof _){var s=i.getDisplayBinding();null!=s?i.setSelected(r,t[s]):i.setSelected(r,r)}else i instanceof G?i.setDisplay(r):i.value=r}Z(e)}(this,e)}getData(){return Q(this)}getOriginalData(){return this.#k}addEventListener(e,t){this.Element.addEventListener(e,t)}acceptInput(){const e=document.activeElement;e.blur(),setTimeout(()=>{e.focus()},100)}#C(){var e=this.Element.getAttribute("locked");null==e&&(e="false"),"true"===e.toLowerCase()?this.#L=!0:this.#L=!1;var t=this.Element.getAttribute("autoid");null!=t&&("true"===t.toLowerCase()?this.#A=!0:this.#A=!1);var n=this.Element.getAttribute("primarykey");this.#N=n}},Button:class extends t{constructor(e){var t;super(e),(t=this).Element.classList.add("fgta5-button"),t.Element.setAttribute("type","button")}#T=!1;get disabled(){return this.#T}set disabled(e){var t;this.#T=e,t=e,this.Element.disabled=t}addEventListener(e,t){this.Element.addEventListener(e,t)}click(){this.Element.click()}},Textbox:o,Numberbox:u,Checkbox:p,Datepicker:f,Timepicker:A,Combobox:_,Filebox:G,MessageBox:se,MessageBoxButton:re,Modal:class{static show(e){return oe()}static createMask(e){return function(e){e=void 0===e?"Please wait ...":e;const t=oe();var n=document.createElement("div");n.classList.add("fgta5-modal-loadermask-msg"),t.appendChild(n);var i=document.createElement("div");i.classList.add("fgta5-modal-loadermask-msg-icon"),i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><radialGradient id="a11" cx=".66" fx=".66" cy=".3125" fy=".3125" gradientTransform="scale(1.5)"><stop offset="0" stop-color="#575757"></stop><stop offset=".3" stop-color="#575757" stop-opacity=".9"></stop><stop offset=".6" stop-color="#575757" stop-opacity=".6"></stop><stop offset=".8" stop-color="#575757" stop-opacity=".3"></stop><stop offset="1" stop-color="#575757" stop-opacity="0"></stop></radialGradient><circle transform-origin="center" fill="none" stroke="url(#a11)" stroke-width="30" stroke-linecap="round" stroke-dasharray="200 1000" stroke-dashoffset="0" cx="100" cy="100" r="70"><animateTransform type="rotate" attributeName="transform" calcMode="spline" dur="1.8" values="360;0" keyTimes="0;1" keySplines="0 0 1 1" repeatCount="indefinite"></animateTransform></circle><circle transform-origin="center" fill="none" opacity=".2" stroke="#575757" stroke-width="30" stroke-linecap="round" cx="100" cy="100" r="70"></circle></svg>',n.appendChild(i);var r=document.createElement("div");return r.classList.add("fgta5-modal-loadermask-msg-text"),r.innerHTML=e,n.appendChild(r),t.setText=e=>{r.innerHTML=e},t}(e)}static createProgress(e){return function(e){void 0===e&&(e={});const t=oe();t.IsError=!1;var n=document.createElement("div");t.appendChild(n);var i=document.createElement("div");i.classList.add("fgta5-modal-progressbar-container"),t.appendChild(i);var r=document.createElement("label");r.classList.add("fgta5-modal-progressbar"),i.appendChild(r);var s=document.createElement("div");return s.classList.add("fgta5-modal-progressbar-text"),t.appendChild(s),t.setProgress=function(e,t){e>100&&(e=100),r.innerHTML=`${e}%`,r.style.width=`${e}%`,s.innerHTML=t},t.setError=function(e){t.IsError=!0,n.classList.add("fgta5-icon-error"),n.style.height="32px",n.style.marginBottom="10px",s.innerHTML=e,s.setAttribute("error","true"),r.setAttribute("error","true")},t.finish=function(n,i){if(void 0===n&&(n="Done"),void 0===i&&(i=!0),!0===e.buttonClose||t.IsError){i&&(s.style.display="none",r.style.width="100%",r.innerHTML="100%");var a=document.createElement("div");a.style.textAlign="center",a.style.marginTop="10px",a.style.marginBottom="0";var o=document.createElement("button");o.classList.add("fgta5-modal-button"),o.innerHTML=n,o.addEventListener("click",()=>{t.close()}),a.appendChild(o),t.appendChild(a)}else t.close()},t}(e)}},Dataloader:class{#D;constructor(){this.#D=new AbortController}abort(){this.#D.abort()}dispose(){}async load(e,t,n){const i=this.#D.signal;null==t&&(t={});const r=Object.assign({signal:i},t);try{const i=await fetch(e,r);if(!i.ok){const n=i.status,r=i.statusText;throw new Error(`${n} ${r}: ${t.method} ${e}`)}const s=await i.json();if("function"==typeof n)try{n(null,s)}catch(e){console.error(e)}return s}catch(e){if("AbortError"===e.name)console.log("Request dibatalkan!");else{if("function"!=typeof n)throw e;try{n(e,null)}catch(e){console.error(e)}}}}},Gridview:class extends t{constructor(e){super(e);var t=this.Element;if(null==t)throw new Error(`element id '${e}' for gridview is not defined`);if("table"!=t.tagName.toLowerCase())throw new Error(`element '${e}' is not table`);!function(e){var t=e.Element,n=t.querySelector("thead"),i=document.createElement("tbody"),r=document.createElement("tfoot");t.prepend(r),t.prepend(i),e.Formatters={},e.Listener=new EventTarget,e.Nodes={Table:t,Thead:n,Tbody:i,Tfoot:r},t.classList.add("fgta5-gridview"),t.setAttribute("cellspacing",0);const{headrow:s,columns:a,key:o}=function(e){var t=[],n=e.Nodes.Thead,i=n.querySelector("tr[data-header]"),r=i.querySelectorAll("th");for(var s of r){let e={};var a=s.getAttribute(de),o=s.getAttribute(ue),l=s.getAttribute(ce),d=s.getAttribute(ge),u=s.getAttribute(pe),c=(s.getAttribute(he)??"").toLowerCase(),m="true"===(s.getAttribute(me)??"").toLowerCase(),p=s.getAttribute("class"),h=s.getAttribute("style"),v=s.innerHTML;e.type=null!=a?Le:null!=o?Ae:Ne,e.cssclass=p,e.cssstyle=h,e.binding=l,e.name=d,e.formatter=u,e.textalign=""==c?"left":c,e.sorting=m,e.html=v,t.push(e)}var g=i.getAttribute(fe);return{headrow:i,columns:t,key:g}}(e);e.setColumnData(a),e.setKey(o),s.remove(),function(e,t){var n=document.createElement("tr");n.setAttribute(ye,"");for(let o of t){var i=document.createElement("th");if(xe(i,"class",o.cssclass),xe(i,"style",o.cssstyle),xe(i,ge,o.name),i.classList.add("fgta5-gridview-head"),i.setAttribute(he,o.textalign),o.type==Le){var r=Ie();r.addEventListener("change",t=>{ke(e,t)}),i.appendChild(r),i.setAttribute(de,"")}else if(o.type==Ae)i.setAttribute(ue,""),i.innerHTML=o.html;else if(o.sorting){var s=document.createElement("span");s.setAttribute("container",""),s.setAttribute(he,o.textalign);let t=document.createElement("button");t.innerHTML=le.UNSORT,t.setAttribute(me,""),t.setAttribute(ce,o.binding),t.addEventListener("click",n=>{_e(e,t)}),(a=document.createElement("div")).innerHTML=o.html,s.appendChild(t),s.appendChild(a),i.classList.add("fgta5-gridview-colwithbutton"),i.appendChild(s)}else{var a=document.createTextNode(o.html);i.appendChild(a)}n.appendChild(i)}e.Nodes.Thead.appendChild(n)}(e,a)}(this)}addRow(e){return De(this,e)}addRows(e){!function(e,t){var n=e.Nodes.Tbody;for(var i of t)De(e,i,n)}(this,e)}updateRow(e,t){!function(e,t,n){const i=t.querySelectorAll("td");i.forEach(t=>{const i=t.getAttribute("data-name");if(null!=i&&void 0!==n[i]){let r=n[i];const s=e.Formatters[i];"function"==typeof s&&(r=s(n[i])),t.innerHTML=r}}),Be(e,t)}(this,e,t)}setNext(e,t){}scrollToFooter(){this.Nodes.Tfoot.scrollIntoView({behavior:"smooth"})}#M;get Columns(){return this.#M}setColumnData(e){this.#M=e}#S;get Key(){return this.#S}setKey(e){this.#S=e}rowRender(e){Be(this,e)}removeSelected(e){!function(e,t){var n=e.Nodes.Tbody.querySelectorAll(`tr td[${de}] input[type="checkbox"]:checked`);if(0==n.length)return void("function"==typeof t&&t());for(var i of n){let n=i.closest("tr");n.MarkProcessing=e=>{!0===e||void 0===e?n.setAttribute(we,""):n.removeAttribute(we)};let r=Ce({detail:{tr:n,onFinished:t}});n.MarkProcessing(),e.Listener.dispatchEvent(r),r.handled||(n.MarkProcessing(!1),e.removeRow(n))}}(this,e)}removeRow(e){!function(e,t){const n=e.Nodes.Tbody;t.remove(),0==n.children.length&&(e.CurrentRow=null)}(this,e)}getSelected(){return function(e){var t=e.Nodes.Tbody.querySelectorAll(`tr td[${de}] input[type="checkbox"]:checked`);if(0==t.length)return[];const n=[];for(let e of t){const t=e.closest("tr").getAttribute(be);n.push(t)}return n}(this)}hasRowPendingProcess(){return e=this.Nodes.Tbody.querySelectorAll(`tr[${we}]`),console.log(e.length),e.length>0;var e}addEventListener(e,t){this.Listener.addEventListener(e,t)}clear(){this.Nodes.Tbody.innerHTML=""}setNext(e,t){!function(e,t,n){var i=e.Nodes.Tfoot.querySelector("tr[data-nextoffset]");null!=i&&i.remove();if(null!=t){var r=document.createElement("tr"),s=document.createElement("td"),a=document.createElement("a");a.innerHTML="load next data",a.setAttribute("href","javascript:void(0)"),a.addEventListener("click",i=>{var r;e.Listener.dispatchEvent((r={detail:{criteria:e.Criteria,nextoffset:t,limit:n,sort:e.getSort()}},new CustomEvent("nextdata",r)))});var o=e.Nodes.Tbody.rows[0].cells.length;s.setAttribute("colspan",o),s.setAttribute("align","center"),s.setAttribute("data-nextoffset",""),s.appendChild(a),r.setAttribute("data-nextoffset",""),r.appendChild(s),e.Nodes.Tfoot.appendChild(r)}}(this,e,t)}getSort(){return He(this)}#B={};get Criteria(){return this.#B}setCriteria(e){this.#B=e}#_;get CurrentRow(){return this.#_}set CurrentRow(e){this.#_=e,function(e,t){const n=e.Nodes.Tbody;n.querySelectorAll("tr[data-currentrow]").forEach(e=>{e.removeAttribute("data-currentrow")}),null!=t&&(t.setAttribute("data-currentrow",""),function(e){const t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}(t)||t.scrollIntoView({behavior:"smooth",block:"center"}))}(this,e)}previousRecord(){!function(e){const t=e.CurrentRow;if(null==t){console.log("set current row to first row");const t=e.Nodes.Tbody.querySelector("tr");e.CurrentRow=t}else{const n=t;n.previousElementSibling&&(e.CurrentRow=n.previousElementSibling)}}(this)}nextRecord(){!function(e){const t=e.CurrentRow;if(null==t){console.log("set current row to first row");const t=e.Nodes.Tbody.querySelector("tr");e.CurrentRow=t}else{const n=t;n.nextElementSibling&&(e.CurrentRow=n.nextElementSibling)}}(this)}},AppManager:class extends t{constructor(e){var n;super(e),function(e){console.log("constructiong application manager");const n=document.createElement("span"),i=e.Element,r=document.createElement("header"),s=document.createElement("div"),a=document.createElement("nav"),o=i.querySelector(`div[${Fe}]`),l=document.createElement("div"),d=i.querySelector(`div[${Ue}]`),u=ht(e,le.MENU,()=>{vt(e)});i.after(r),r.after(s),s.after(a),n.innerHTML="Application Manager",r.classList.add("fgta5-app-head"),r.appendChild(n),r.appendChild(u),i.classList.add("fgta5-app-main"),a.classList.add("fgta5-appmanager-nav");const{Opened:c}=function(e,t){const n=t.querySelector(`div[${Pe}]`),i=document.createElement("div");return n.classList.add("fgta5-openedmodule"),i.innerHTML=`${ut} `,i.classList.add("fgta5-appmanager-home-subtitle"),i.classList.add(st),n.classList.add(st),n.before(i),n.hide=()=>{i.classList.add(st),n.classList.add(st)},n.show=()=>{i.classList.remove(st),n.classList.remove(st)},{Opened:n}}(0,i),{MenuBoard:m,MenuFooter:p,ProfileButton:h,LogoutButton:v,MenuResetButton:g}=function(e,n){const i=document.createElement("div"),r=ht(e,le.MENU,()=>{Lt(e)}),s=document.createElement("div"),a=ht(e,le.CLOSE,()=>{ft(e)}),o=document.createElement("div"),l=document.createElement("div"),d=document.createElement("div"),u=document.createElement("div"),c=document.createElement("div"),m=document.createElement("input"),p=document.createElement("button"),h=document.createElement("a"),v=document.createElement("div"),g=document.createElement("div"),f=document.createElement("div");f.appendChild(r),i.setAttribute("header",""),i.appendChild(f),i.appendChild(s),i.appendChild(a),s.innerHTML="Menu",g.classList.add(st),g.classList.add("fgta5-menu-footer"),g.appendChild(h),o.setAttribute("main",""),o.appendChild(l),o.appendChild(v),o.appendChild(g),o.addEventListener("scroll",()=>{o.scrollTop>10?i.classList.add("fgta5-fixheader-scrolled"):i.classList.remove("fgta5-fixheader-scrolled")}),l.classList.add("fgta5-menu-toppanel"),l.appendChild(d),l.appendChild(u),l.appendChild(c);const b=t.createSvgButton(le.HOME,it,()=>{gt(e)}),w=t.createSvgButton(le.SETTING,it,()=>{!async function(e){e.Listener.dispatchEvent((t={detail:{user:e.User}},new CustomEvent("openpreference",t)));var t}(e)}),y=document.createElement("div");y.classList.add("fgta5-menu-search"),y.appendChild(m),y.appendChild(p),m.classList.add("fgta5-menu-search"),m.setAttribute("name","menusearch"),m.setAttribute("placeholder","search module"),m.addEventListener("keydown",t=>{"Enter"==t.key&&Ct(e,m.value)}),p.classList.add("fgta5-menu-search"),p.innerHTML=le.SEARCH,p.addEventListener(at,t=>{m.focus(),Ct(e,m.value)});const E=t.createSvgButton(le.USER,it);return E.classList.add(st),d.setAttribute(Ge,"left"),d.appendChild(b),d.appendChild(w),u.setAttribute(Ge,"center"),u.appendChild(y),c.setAttribute(Ge,"right"),c.appendChild(E),v.classList.add("fgta5-menu"),h.innerHTML=`<div icon>${le.LOGOUT}</div><div>Sign Out</div>`,h.setAttribute("href","javascript:void(0)"),n.appendChild(o),n.appendChild(i),{MenuBoard:v,MenuFooter:g,ProfileButton:E,LogoutButton:h,MenuResetButton:r}}(e,a);e.Listener=new EventTarget,e.Nodes={Head:r,Nav:a,Main:i,IFrames:s,Favourite:o,Opened:c,Currentuser:d,MenuBoard:m,MenuFooter:p,ProfileButton:h,LogoutButton:v,MenuResetButton:g,TrashBox:l,Title:n}}(this),n=this,window.addEventListener("message",e=>{if(null!=e.data.action){var i=e.data.action;if(i==t.ACTION_SHOWMENU)vt(n);else if(i==t.ACTION_SHOWHOME)gt(n);else if(i==t.ACTION_APPLICATIONLOADED);else if("REDIRECT_TO_LOGIN"==i){const t=window.location.href,n=e.data.nexturl,i=`${e.data.href}?nexturl=${t}&nextmodule=${n}`;location.href=i}}}),window.history.pushState(null,"",window.location.href),window.addEventListener("popstate",function(e){e.preventDefault(),window.history.pushState(null,"",window.location.href)})}RootIcons;#H={};get Modules(){return this.#H}#c;get Title(){return this.#c}setTitle(e){this.#c=e,function(e,t){e.Nodes.Title.innerHTML=t}(this,e)}setMenu(e){!function(e,t){e.RootIcons=At(e,t),Nt(e,e.RootIcons)}(this,e)}showMenu(){vt(this)}setFavourite(e){!function(e,t){if(null==e.Nodes.Favourite)return;const n=e.Nodes.Favourite,i=document.createElement("div"),r=e.Nodes.TrashBox,s=document.createElement("div"),a=document.createElement("div"),o=document.createElement("div");i.innerHTML=`${dt} `,i.classList.add("fgta5-appmanager-home-subtitle"),a.setAttribute(et,""),a.innerHTML=le.TRASH,a.setAttribute(Xe,""),o.innerHTML="Delete",s.setAttribute(tt,""),s.appendChild(a),s.appendChild(o),r.classList.add("fgta5-favourite-trashcontainer"),r.classList.add(st),r.appendChild(s),e.Nodes.Head.after(r),n.before(i),n.classList.add("fgta5-menu"),n.classList.add("fgta5-favourite"),n.addEventListener("dragover",e=>{!function(e,t,n){if("addtofave"==pt){null==n.querySelector(`[name="${mt}"]`)&&(t.preventDefault(),n.setAttribute(Qe,""))}}(0,e,n)}),n.addEventListener("dragleave",e=>{!function(e,t,n){n.removeAttribute(Qe)}(0,0,n)}),n.addEventListener("drop",t=>{!function(e,t,n){n.removeAttribute(Qe);const i=t.dataTransfer.getData("modulename");if(""==i)return;var r=n.querySelector(`[name="${i}"]`);if(null==r){t.preventDefault();const r=e.Modules[i];if(null==r)return;let s=yt(e,r.data);It(e,s,i,n),n.prepend(s),e.Listener.dispatchEvent((e=>new CustomEvent("addtofavourite",e))({detail:{modulename:i}}))}}(e,t,n)});for(let i of t){let t=e.Modules[i];if(null!=t){let r=yt(e,t.data);It(e,r,i,n),n.appendChild(r)}}}(this,e)}async openModule(e){await wt(this,e),ft(this)}#O;get User(){return this.#O}setUser(e){this.#O=e,function(e,t){const n=e.Nodes.ProfileButton,i=e.Nodes.LogoutButton;e.Nodes.MenuFooter.classList.remove(st),n.classList.remove(st),n.addEventListener(at,t=>{!function(e){e.Listener.dispatchEvent((e=>new CustomEvent("openprofile",e))({detail:{user:e.User}}))}(e)}),i.addEventListener(at,t=>{!async function(e){"ok"==await $fgta5.MessageBox.confirm("are you sure to log out ?")&&e.Listener.dispatchEvent((e=>new CustomEvent("logout",e))({detail:{user:e.User}}))}(e)}),e.Nodes.Currentuser.innerHTML=t.displayname}(this,e)}addEventListener(e,t){this.Listener.addEventListener(e,t)}},Application:class extends t{constructor(e){super(e),function(e){console.log("constructiong application");const n=e.Element,i=document.createElement("header"),r=document.createElement("footer");n.after(i),i.after(r),i.classList.add("fgta5-app-head"),n.classList.add("fgta5-app-main"),r.classList.add("fgta5-app-footer"),r.classList.add("hidden"),function(e,n){const i=document.createElement("div"),r=document.createElement("span"),s=document.createElement("div"),a=t.createSvgButton(le.HOME,Rt,()=>{window.parent.postMessage({action:t.ACTION_SHOWHOME},"*")}),o=t.createSvgButton(le.MENU,Rt,()=>{window.parent.postMessage({action:t.ACTION_SHOWMENU},"*")});i.appendChild(a),s.appendChild(o),t.isInContainer()||(a.classList.add("hidden"),o.classList.add("hidden"));r.id=Vt,r.innerHTML="loading ...",n.appendChild(i),n.appendChild(r),n.appendChild(s)}(0,i),function(e,t){t.innerHTML="empty footer content"}(0,r),e.Nodes={Head:i,Main:n,Footer:r},window.addEventListener("load",e=>{console.log("application loaded."),window.parent.postMessage({action:t.ACTION_APPLICATIONLOADED},"*")}),window.addEventListener("message",n=>{const i=n.data;if(null!=i.action){var r=i.action;r==t.ACTION_APPLICATIONLOADED?null!=i.module&&null!=i.module.title&&qt(e,i.module.title):"REDIRECT_TO_LOGIN"==r&&console.log("BUAT PROGRAM UNTUK REDIRECT KE LOGIN")}})}(this)}setTitle(e){qt(this,e)}showFooter(e){!function(e,t){const n=e.Nodes.Main,i=e.Nodes.Footer;t?(n.setAttribute($t,""),i.classList.remove("hidden")):(n.removeAttribute($t),i.classList.add("hidden"))}(this,e)}},ModuleData:Ve,Section:Ot,SectionCarousell:class{#R={};#E=new EventTarget;#V;#$;#q;static get EVT_SECTIONSHOWING(){return Ft}constructor(e){!function(e,t){t.classList.add("fgta5-carousellcontainer");const n=t.querySelectorAll('section[class="fgta5-carousell"]');let i=0;for(let r of n){const n=new Ot(r,{index:i,carousell:e,fn_getActiveSection:()=>Pt(e,t)}),s=n.Name;0==i&&e.setFirstSection(n),null==e.CurrentSection&&e.setCurrentSection(n),e.Items[s]=n,++i}}(this,e)}get Items(){return this.#R}get Listener(){return this.#E}get CurrentSection(){return this.#V}get IconUrl(){return this.#$}addEventListener(e,t){this.Listener.addEventListener(e,t)}setCurrentSection(e){this.#V=e}setFirstSection(e){this.#q=e}setIconUrl(e){this.#$=e,this.#q.setIconUrl(e)}dispatchSectionShowing(e,t){this.Listener.dispatchEvent(new CustomEvent(Ft,{detail:{currSection:e,commingSection:t}}))}},Icons:le,ActionButton:class{#F=[];#P=[];constructor(e,t=null){if(this.Listener=new EventTarget,null!=e){const t=document.getElementById(e);null!=t&&this.#P.push(t)}if(null!=t){const n=null==e?`[data-action="${t}"]`:`[data-action="${t}"]:not(#${e})`,i=document.querySelectorAll(n);this.#P=[...this.#P,...Array.from(i)]}this.#P.forEach(e=>{const t=e.id;this.#F.push(t),e.setAttribute("tabindex","-1"),e.addEventListener("click",e=>{(this.#m||this.#U)&&(console.warn("action is not allowed!"),e.stopImmediatePropagation())})})}#m=!1;get disabled(){return this.#m}set disabled(e){e||!this.#z?(this.#m=e,this.#P.forEach(t=>{e?t.setAttribute("disabled",!0):t.removeAttribute("disabled")})):console.warn("suspended action button cannot be enabled!",this.#F)}#U=!1;isHidden(){return this.#U}hide(e=!0){this.#P.forEach(t=>{e?t.classList.add("hidden"):t.classList.remove("hidden")})}setText(e){this.#P.forEach(t=>{t.innerHTML=e})}addEventListener(e,t){this.#P.forEach(n=>{n.addEventListener(e,t)})}click(){this.#m||this.#P[0].click()}#z=!1;suspend(e){e&&(this.disabled=!0),this.#z=e}isSuspended(){return this.#z}},Dialog:Ut,ApiEndpoint:class{#W="POST";#j={"Content-Type":"application/json"};#D;#G;constructor(e){this.#D=new AbortController,this.#G=e}get headers(){return this.#j}get method(){return this.#W}set method(e){this.#W=e}abort(){this.#D.abort()}dispose(){this.#D=null}setHeader(e,t){this.#j[e]=t}async execute(e,t){const n=this.#D.signal,i=this.#G,r=this.#W,s=this.#j;let a;null==e&&(e={}),null==t?a=JSON.stringify(e):(delete s["Content-Type"],t.append("form-body-jsondata",new Blob([JSON.stringify(e)],{type:"application/json"})),a=t);const o={method:r,headers:s,body:a,credentials:"include"},l=Object.assign({signal:n},o);try{const e=await fetch(i,l);if(!e.ok){const t=e.status,n=e.statusText;let i=`${t} ${n}: ${await e.text()}`;401==t&&(sessionStorage.removeItem("login"),sessionStorage.removeItem("login_nexturl"),i="authentication is needed to access resource");const r=new Error(i);throw r.status=t,r.code=e.code||1,r}const t=await e.json();if(0!=t.code){const e=new Error(t.message);throw e.code=t.code,e}return t.result}catch(e){if("AbortError"!==e.name)throw e;console.warn("Request dibatalkan!")}}}};void 0===window.$validators?window.$validators=jt:Object.assign(window.$validators,jt),void 0===window.$fgta5||null===window.$fgta5?window.$fgta5=Gt:Object.assign(window.$fgta5,Gt);
|
|
11
|
+
//# sourceMappingURL=fgta5js-v1.8.5.min.js.map
|