diff --git a/dist/flightkit-v0.0.5/flightkit.min.js b/dist/flightkit-v0.0.5/flightkit.min.js deleted file mode 100644 index 0290665..0000000 --- a/dist/flightkit-v0.0.5/flightkit.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/dist/flightkit-v0.0.5/flightkit.js b/dist/flightkit-v0.0.6/flightkit.js similarity index 99% rename from dist/flightkit-v0.0.5/flightkit.js rename to dist/flightkit-v0.0.6/flightkit.js index 5c32ba0..01824db 100644 --- a/dist/flightkit-v0.0.5/flightkit.js +++ b/dist/flightkit-v0.0.6/flightkit.js @@ -1150,24 +1150,6 @@ this.contents.sort([]); } - if (this.filter.length) { - const filters = []; - - for (const property of this.columnOrder) { - filters.push({ - propertyName: property, - value: this.filter, - operator: 'like', - type: 'or', /** optional, defaults to "and" **/ - ignoreCase: true /** optional, defaults to "false" **/ - }); - } - this.contents.filter(filters); - } - else { - this.contents.filter([]); - } - const tableHead = this.createHead(); tableElement.append(tableHead); @@ -1175,8 +1157,23 @@ tableElement.append(this._createElement('caption')); } - const data = this.contents.execute(); - const tableBody = this.createBody(data); + const orderedData = this.contents.execute(); + let filteredData = []; + if (this.filter.length) { + for (const data of orderedData) { + let valuesInData = Object.values(data).join(" ").toLowerCase(); + + if (valuesInData.includes(this.filter)) { + filteredData.push(data); + } + } + } + else { + filteredData = orderedData; + } + + + const tableBody = this.createBody(filteredData); tableElement.append(tableBody); if (this._templates['tfoot']) { diff --git a/dist/flightkit-v0.0.6/flightkit.min.js b/dist/flightkit-v0.0.6/flightkit.min.js new file mode 100644 index 0000000..330a84f --- /dev/null +++ b/dist/flightkit-v0.0.6/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.6/avian.min.css b/docs/cdn/ibiss-v0.0.6/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/docs/cdn/ibiss-v0.0.6/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.6/flightkit.min.js b/docs/cdn/ibiss-v0.0.6/flightkit.min.js new file mode 100644 index 0000000..330a84f --- /dev/null +++ b/docs/cdn/ibiss-v0.0.6/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js b/docs/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/docs/cdn/ibiss-v0.0.6/rocket.min.js b/docs/cdn/ibiss-v0.0.6/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/docs/cdn/ibiss-v0.0.6/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/docs/js/flightkit.min.js b/docs/js/flightkit.min.js index 0290665..330a84f 100644 --- a/docs/js/flightkit.min.js +++ b/docs/js/flightkit.min.js @@ -1 +1 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.6/avian.min.css b/documentation/public/cdn/ibiss-v0.0.6/avian.min.css new file mode 100644 index 0000000..53c6f0a --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.6/avian.min.css @@ -0,0 +1 @@ +:root{--html-background:#faf9f8;--background:#fff;--code-background:#f3f2f1;--overlay-background:0,0,0;--color-on-black:#c8c6c4;--font-color:#323130;--shadow-color:0,0,0;--hr-color:#d2d0ce;--border-color:#8a8886;--gray-light:#edebe9;--color-on-gray-light:#000;--gray:#a19f9d;--color-on-gray:#000;--gray-dark:#605e5c;--color-on-gray-dark:#faf9f8;--gray-darker:#8a8886;--light:#d2d0ce;--black:#000;--white:#fff;--icon:#605e5c;--icon-disabled:#a19f9d;--icon-error:#a80000;--icon-success:#107c10;--icon-warning:#797673;--primary:#0078d4;--primary-hover:#0068b8;--color-on-primary:#fff;--accent:#fce100;--accent-hover:#e6cf00;--color-on-accent:#000;--danger:#d13438;--danger-hover:#bb2a2f;--color-on-danger:#fff;--warning:#fff4ce;--color-on-warning:#323130;--error:#fde7e9;--color-on-error:#323130;--success:#dff6dd;--color-on-success:#323130;--contrast:#ccc;--contrast-hover:#b2b2b2;--color-on-contrast:#000;--disabled:#d2d0ce;--color-on-disabled:#a19f9d;--button-background:#fff;--button-hover:#e1dfdd;--button-outline-color:#000;--button-color:#000;--disabled-button-background:#f3f2f1;--disabled-button-color:#a19f9d;--colored-disabled-button-color:#d2d0ce;--input-border-color:#605e5c;--input-hover:#c8c6c4;--range-track-color:#c8c6c4;--range-filled-track-color:#605e5c;--range-track-hover-color:#e0f2ff;--switch-border-color:#000;--switch-toggle-off-color:#000;--switch-toggle-on-color:#fff;--table-hover:#e1dfdd;--table-striped-hover:#d2d0ce;--table-stripe:#edebe9;--default-distance:1.5rem;--distance-0:0;--distance-1:0.5rem;--distance-2:1rem;--distance-3:1.5rem;--distance-4:2rem;--distance-5:2.5rem;--h1-font-size:3.2rem;--h2-font-size:3rem;--h3-font-size:2.8rem;--h4-font-size:2.6rem;--h5-font-size:2.4rem;--h6-font-size:2.2rem;--th-font-size:2.2rem;--paragraph-font-size:1.6rem;--label-font-size:1.6rem;--small-font-size:1.2rem;--font-weight-normal:400;--font-weight-semibold:600;--font-weight-bold:700}*,:after,:before{box-sizing:border-box;font:inherit;font-weight:var(--font-weight-normal);margin:0;padding:0}html{font-size:62.5%;hanging-punctuation:first last}body{font-family:Segoe UI,"Segoe UI Web (West European)",-apple-system,BlinkMacSystemFont,Roboto,Helvetica Neue,sans-serif;font-size:1.6rem;height:100svh;line-height:1.5;text-rendering:optimizeSpeed}h1,h2,h3,h4,h5,h6{text-wrap:balance}p{text-wrap:pretty;max-width:75ch}ol,ul{margin-left:2rem}img,picture{display:block;max-width:100%}.lucide{left:2px;position:relative;top:3px}@media (prefers-reduced-motion:reduce){html:focus-within{scroll-behavior:auto}*,:after,:before{animation-duration:.01ms;animation-iteration-count:1;scroll-behavior:auto;transition-duration:.01ms}}@media (prefers-reduced-motion:no-preference){:has(:target),html{scroll-behavior:smooth;scroll-padding-top:3rem}}h1{font-size:var(--h1-font-size)}h1,h2{font-weight:var(--font-weight-bold)}h2{font-size:var(--h2-font-size)}h3{font-size:var(--h3-font-size);font-weight:var(--font-weight-bold)}h4{font-size:var(--h4-font-size)}h4,h5{font-weight:var(--font-weight-semibold)}h5{font-size:var(--h5-font-size)}h6{font-size:var(--h6-font-size);font-weight:var(--font-weight-semibold)}p{font-size:var(--paragraph-font-size)}label{font-size:var(--label-font-size)}small{font-size:var(--small-font-size)}b,strong{font-weight:var(--font-weight-bold)}cite,em,i{font-style:italic}code:not([class*=language]),kbd{background-color:var(--code-background);border:.5px solid var(--border-color);border-radius:.2rem;bottom:.1rem;margin:0 .2rem;padding:.2rem .4rem;position:relative}mark{background-color:var(--accent)}th{font-size:var(--th-font-size);font-weight:var(--font-weight-semibold)}.font-size-68{font-size:6.8rem!important}.font-size-42{font-size:4.2rem!important}.font-size-32{font-size:3.2rem!important}.font-size-28{font-size:2.8rem!important}.font-size-24{font-size:2.4rem!important}.font-size-20{font-size:2rem!important}.font-size-18{font-size:1.8rem!important}.font-size-16{font-size:1.6rem!important}.font-size-14{font-size:1.4rem!important}.font-size-12{font-size:1.2rem!important}.font-size-10{font-size:1rem!important}.font-weight-normal{font-weight:400!important}.font-weight-semibold{font-weight:600!important}.font-weight-bold{font-weight:700!important}.align-center{align-items:center}.align-end{align-items:flex-end}.align-start{align-items:flex-start}.align-stretch{align-items:stretch}.align-between{align-content:space-between}.align-around{align-content:space-around}.align-evenly{align-content:space-evenly}.self-align-stretch{align-self:stretch}.self-align-center{align-self:center}.self-align-start{align-self:flex-start}.self-align-end{align-self:flex-end}.row{display:flex;flex-wrap:wrap}.column{display:flex;flex-direction:column}.no-wrap{flex-wrap:nowrap}.wrap-reverse{flex-wrap:wrap-reverse}.row-reverse{flex-direction:row-reverse}.column-reverse{flex-direction:column-reverse}@media (min-width:993px){.drow-reverse{flex-direction:row-reverse}.dcolumn-reverse{flex-direction:column-reverse}}@media (min-width:768px) and (max-width:992px){.trow-reverse{flex-direction:row-reverse}.tcolumn-reverse{flex-direction:column-reverse}}@media (max-width:767px){.mrow-reverse{flex-direction:row-reverse}.mcolumn-reverse{flex-direction:column-reverse}}.gap-0{gap:var(--distance-0)}.gap-1{gap:var(--distance-1)}.gap-2{gap:var(--distance-2)}.gap-3{gap:var(--distance-3)}.gap-4{gap:var(--distance-4)}.gap-5{gap:var(--distance-5)}.justify-center{justify-content:center}.justify-around{justify-content:space-around}.justify-evenly{justify-content:space-evenly}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.justify-start{justify-content:flex-start}.f-100{flex:1 1 100%}.f-90{flex:0 0 90%}.f-80{flex:0 0 80%}.f-75{flex:0 0 75%}.f-70{flex:0 0 70%}.f-60{flex:0 0 60%}.f-50{flex:0 0 50%}.f-33{flex:0 0 33.33%}.f-30{flex:0 0 30%}.f-25{flex:0 0 25%}.f-20{flex:0 0 20%}.f-16{flex:0 0 16.67%}.f-10{flex:0 0 10%}.f-8{flex:0 0 8.33%}.f-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.f-fill{flex:1;max-width:none;min-width:auto;width:100%}@media (min-width:768px) and (max-width:992px){.tf-100{flex:1 1 100%}.tf-90{flex:0 0 90%}.tf-80{flex:0 0 80%}.tf-75{flex:0 0 75%}.tf-70{flex:0 0 70%}.tf-60{flex:0 0 60%}.tf-50{flex:0 0 50%}.tf-33{flex:0 0 33.33%}.tf-30{flex:0 0 30%}.tf-25{flex:0 0 25%}.tf-20{flex:0 0 20%}.tf-16{flex:0 0 16.67%}.tf-10{flex:0 0 10%}.tf-8{flex:0 0 8.33%}.tf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.tf-fill{flex:1;max-width:none;min-width:auto;width:100%}}@media (max-width:767px){.mf-100{flex:1 1 100%}.mf-90{flex:0 0 90%}.mf-80{flex:0 0 80%}.mf-75{flex:0 0 75%}.mf-70{flex:0 0 70%}.mf-60{flex:0 0 60%}.mf-50{flex:0 0 50%}.mf-33{flex:0 0 33.33%}.mf-30{flex:0 0 30%}.mf-25{flex:0 0 25%}.mf-20{flex:0 0 20%}.mf-16{flex:0 0 16.67%}.mf-10{flex:0 0 10%}.mf-8{flex:0 0 8.33%}.mf-auto{flex:1 1 auto;max-width:fitcontent;min-width:auto;width:auto}.mf-fill{flex:1;max-width:none;min-width:auto;width:100%}}.no-scroll{overflow:hidden}.text-no-wrap{white-space:nowrap}.text-normal{font-weight:400}.sticky{height:auto;position:sticky;position:-webkit-sticky;top:0;z-index:1000}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.block{display:block}.hidden{display:none}@media (min-width:768px){.mobile{display:none!important}}.tablet{display:none}@media (min-width:768px) and (max-width:992px){.tablet{display:inherit!important}}@media (max-width:992px){.desktop{display:none!important}}@media (min-width:769px){.small-screen{display:none!important}}@media (max-width:768px){.large-screen{display:none!important}}.fit-content{max-width:fit-content!important;max-width:-moz-fit-content!important}.list-style-none{list-style:none!important}.m-0{margin:var(--distance-0)!important}.ml-0{margin-left:var(--distance-0)!important}.mr-0{margin-right:var(--distance-0)!important}.mt-0{margin-top:var(--distance-0)!important}.mb-0{margin-bottom:var(--distance-0)!important}.mx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.m-1{margin:var(--distance-1)!important}.m-2{margin:var(--distance-2)!important}.m-3{margin:var(--distance-3)!important}.m-4{margin:var(--distance-4)!important}.m-5{margin:var(--distance-5)!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.mx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.my-auto{margin-bottom:auto!important;margin-top:auto!important}.my-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.my-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.my-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.my-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.my-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.my-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mt-auto{margin-top:auto!important}.mt-1{margin-top:var(--distance-1)!important}.mt-2{margin-top:var(--distance-2)!important}.mt-3{margin-top:var(--distance-3)!important}.mt-4{margin-top:var(--distance-4)!important}.mt-5{margin-top:var(--distance-5)!important}.ml-auto{margin-left:auto!important}.ml-1{margin-left:var(--distance-1)!important}.ml-2{margin-left:var(--distance-2)!important}.ml-3{margin-left:var(--distance-3)!important}.ml-4{margin-left:var(--distance-4)!important}.ml-5{margin-left:var(--distance-5)!important}.mr-auto{margin-right:auto!important}.mr-1{margin-right:var(--distance-1)!important}.mr-2{margin-right:var(--distance-2)!important}.mr-3{margin-right:var(--distance-3)!important}.mr-4{margin-right:var(--distance-4)!important}.mr-5{margin-right:var(--distance-5)!important}.mb-auto{margin-bottom:auto!important}.mb-1{margin-bottom:var(--distance-1)!important}.mb-2{margin-bottom:var(--distance-2)!important}.mb-3{margin-bottom:var(--distance-3)!important}.mb-4{margin-bottom:var(--distance-4)!important}.mb-5{margin-bottom:var(--distance-5)!important}@media (min-width:768px) and (max-width:992px){.tm-0{margin:var(--distance-0)!important}.tml-0{margin-left:var(--distance-0)!important}.tmr-0{margin-right:var(--distance-0)!important}.tmt-0{margin-top:var(--distance-0)!important}.tmb-0{margin-bottom:var(--distance-0)!important}.tmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.tm-1{margin:var(--distance-1)!important}.tm-2{margin:var(--distance-2)!important}.tm-3{margin:var(--distance-3)!important}.tm-4{margin:var(--distance-4)!important}.tm-5{margin:var(--distance-5)!important}.tmx-auto{margin-left:auto!important;margin-right:auto!important}.tmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.tmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.tmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.tmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.tmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.tmy-auto{margin-bottom:auto!important;margin-top:auto!important}.tmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.tmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.tmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.tmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.tmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.tmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.tmt-auto{margin-top:auto!important}.tmt-1{margin-top:var(--distance-1)!important}.tmt-2{margin-top:var(--distance-2)!important}.tmt-3{margin-top:var(--distance-3)!important}.tmt-4{margin-top:var(--distance-4)!important}.tmt-5{margin-top:var(--distance-5)!important}.tml-auto{margin-left:auto!important}.tml-1{margin-left:var(--distance-1)!important}.tml-2{margin-left:var(--distance-2)!important}.tml-3{margin-left:var(--distance-3)!important}.tml-4{margin-left:var(--distance-4)!important}.tml-5{margin-left:var(--distance-5)!important}.tmr-auto{margin-right:auto!important}.tmr-1{margin-right:var(--distance-1)!important}.tmr-2{margin-right:var(--distance-2)!important}.tmr-3{margin-right:var(--distance-3)!important}.tmr-4{margin-right:var(--distance-4)!important}.tmr-5{margin-right:var(--distance-5)!important}.tmb-auto{margin-bottom:auto!important}.tmb-1{margin-bottom:var(--distance-1)!important}.tmb-2{margin-bottom:var(--distance-2)!important}.tmb-3{margin-bottom:var(--distance-3)!important}.tmb-4{margin-bottom:var(--distance-4)!important}.tmb-5{margin-bottom:var(--distance-5)!important}}@media (max-width:767px){.mm-0{margin:var(--distance-0)!important}.mml-0{margin-left:var(--distance-0)!important}.mmr-0{margin-right:var(--distance-0)!important}.mmt-0{margin-top:var(--distance-0)!important}.mmb-0{margin-bottom:var(--distance-0)!important}.mmx-0{margin-left:var(--distance-0)!important;margin-right:var(--distance-0)!important}.mm-1{margin:var(--distance-1)!important}.mm-2{margin:var(--distance-2)!important}.mm-3{margin:var(--distance-3)!important}.mm-4{margin:var(--distance-4)!important}.mm-5{margin:var(--distance-5)!important}.mmx-auto{margin-left:auto!important;margin-right:auto!important}.mmx-1{margin-left:var(--distance-1)!important;margin-right:var(--distance-1)!important}.mmx-2{margin-left:var(--distance-2)!important;margin-right:var(--distance-2)!important}.mmx-3{margin-left:var(--distance-3)!important;margin-right:var(--distance-3)!important}.mmx-4{margin-left:var(--distance-4)!important;margin-right:var(--distance-4)!important}.mmx-5{margin-left:var(--distance-5)!important;margin-right:var(--distance-5)!important}.mmy-auto{margin-bottom:auto!important;margin-top:auto!important}.mmy-0{margin-bottom:var(--distance-0)!important;margin-top:var(--distance-0)!important}.mmy-1{margin-bottom:var(--distance-1)!important;margin-top:var(--distance-1)!important}.mmy-2{margin-bottom:var(--distance-2)!important;margin-top:var(--distance-2)!important}.mmy-3{margin-bottom:var(--distance-3)!important;margin-top:var(--distance-3)!important}.mmy-4{margin-bottom:var(--distance-4)!important;margin-top:var(--distance-4)!important}.mmy-5{margin-bottom:var(--distance-5)!important;margin-top:var(--distance-5)!important}.mmt-auto{margin-top:auto!important}.mmt-1{margin-top:var(--distance-1)!important}.mmt-2{margin-top:var(--distance-2)!important}.mmt-3{margin-top:var(--distance-3)!important}.mmt-4{margin-top:var(--distance-4)!important}.mmt-5{margin-top:var(--distance-5)!important}.mml-auto{margin-left:auto!important}.mml-1{margin-left:var(--distance-1)!important}.mml-2{margin-left:var(--distance-2)!important}.mml-3{margin-left:var(--distance-3)!important}.mml-4{margin-left:var(--distance-4)!important}.mml-5{margin-left:var(--distance-5)!important}.mmr-auto{margin-right:auto!important}.mmr-1{margin-right:var(--distance-1)!important}.mmr-2{margin-right:var(--distance-2)!important}.mmr-3{margin-right:var(--distance-3)!important}.mmr-4{margin-right:var(--distance-4)!important}.mmr-5{margin-right:var(--distance-5)!important}.mmb-auto{margin-bottom:auto!important}.mmb-1{margin-bottom:var(--distance-1)!important}.mmb-2{margin-bottom:var(--distance-2)!important}.mmb-3{margin-bottom:var(--distance-3)!important}.mmb-4{margin-bottom:var(--distance-4)!important}.mmb-5{margin-bottom:var(--distance-5)!important}}.p-0{padding:var(--distance-0)}.pl-0{padding-left:var(--distance-0)}.pr-0{padding-right:var(--distance-0)}.pt-0{padding-top:var(--distance-0)}.pb-0{padding-bottom:var(--distance-0)}.p-1{padding:var(--distance-1)}.p-2{padding:var(--distance-2)}.p-3{padding:var(--distance-3)}.p-4{padding:var(--distance-4)}.p-5{padding:var(--distance-5)}.px-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.px-auto{padding-left:auto;padding-right:auto}.px-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.px-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.px-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.px-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.px-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.py-auto{padding-bottom:auto;padding-top:auto}.py-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.py-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.py-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.py-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.py-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.py-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.pt-auto{padding-top:auto}.pt-1{padding-top:var(--distance-1)}.pt-2{padding-top:var(--distance-2)}.pt-3{padding-top:var(--distance-3)}.pt-4{padding-top:var(--distance-4)}.pt-5{padding-top:var(--distance-5)}.pl-auto{padding-left:auto}.pl-1{padding-left:var(--distance-1)}.pl-2{padding-left:var(--distance-2)}.pl-3{padding-left:var(--distance-3)}.pl-4{padding-left:var(--distance-4)}.pl-5{padding-left:var(--distance-5)}.pr-auto{padding-right:auto}.pr-1{padding-right:var(--distance-1)}.pr-2{padding-right:var(--distance-2)}.pr-3{padding-right:var(--distance-3)}.pr-4{padding-right:var(--distance-4)}.pr-5{padding-right:var(--distance-5)}.pb-auto{padding-bottom:auto}.pb-1{padding-bottom:var(--distance-1)}.pb-2{padding-bottom:var(--distance-2)}.pb-3{padding-bottom:var(--distance-3)}.pb-4{padding-bottom:var(--distance-4)}.pb-5{padding-bottom:var(--distance-5)}@media (min-width:768px) and (max-width:992px){.tp-0{padding:var(--distance-0)}.tpl-0{padding-left:var(--distance-0)}.tpr-0{padding-right:var(--distance-0)}.tpt-0{padding-top:var(--distance-0)}.tpb-0{padding-bottom:var(--distance-0)}.tpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.tp-1{padding:var(--distance-1)}.tp-2{padding:var(--distance-2)}.tp-3{padding:var(--distance-3)}.tp-4{padding:var(--distance-4)}.tp-5{padding:var(--distance-5)}.tpx-auto{padding-left:auto;padding-right:auto}.tpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.tpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.tpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.tpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.tpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.tpy-auto{padding-bottom:auto;padding-top:auto}.tpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.tpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.tpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.tpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.tpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.tpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.tpt-auto{padding-top:auto}.tpt-1{padding-top:var(--distance-1)}.tpt-2{padding-top:var(--distance-2)}.tpt-3{padding-top:var(--distance-3)}.tpt-4{padding-top:var(--distance-4)}.tpt-5{padding-top:var(--distance-5)}.tpl-auto{padding-left:auto}.tpl-1{padding-left:var(--distance-1)}.tpl-2{padding-left:var(--distance-2)}.tpl-3{padding-left:var(--distance-3)}.tpl-4{padding-left:var(--distance-4)}.tpl-5{padding-left:var(--distance-5)}.tpr-auto{padding-right:auto}.tpr-1{padding-right:var(--distance-1)}.tpr-2{padding-right:var(--distance-2)}.tpr-3{padding-right:var(--distance-3)}.tpr-4{padding-right:var(--distance-4)}.tpr-5{padding-right:var(--distance-5)}.tpb-auto{padding-bottom:auto}.tpb-1{padding-bottom:var(--distance-1)}.tpb-2{padding-bottom:var(--distance-2)}.tpb-3{padding-bottom:var(--distance-3)}.tpb-4{padding-bottom:var(--distance-4)}.tpb-5{padding-bottom:var(--distance-5)}}@media (max-width:767px){.mp-0{padding:var(--distance-0)}.mpl-0{padding-left:var(--distance-0)}.mpr-0{padding-right:var(--distance-0)}.mpt-0{padding-top:var(--distance-0)}.mpb-0{padding-bottom:var(--distance-0)}.mpx-0{padding-left:var(--distance-0);padding-right:var(--distance-0)}.mp-1{padding:var(--distance-1)}.mp-2{padding:var(--distance-2)}.mp-3{padding:var(--distance-3)}.mp-4{padding:var(--distance-4)}.mp-5{padding:var(--distance-5)}.mpx-auto{padding-left:auto;padding-right:auto}.mpx-1{padding-left:var(--distance-1);padding-right:var(--distance-1)}.mpx-2{padding-left:var(--distance-2);padding-right:var(--distance-2)}.mpx-3{padding-left:var(--distance-3);padding-right:var(--distance-3)}.mpx-4{padding-left:var(--distance-4);padding-right:var(--distance-4)}.mpx-5{padding-left:var(--distance-5);padding-right:var(--distance-5)}.mpy-auto{padding-bottom:auto;padding-top:auto}.mpy-0{padding-bottom:var(--distance-0);padding-top:var(--distance-0)}.mpy-1{padding-bottom:var(--distance-1);padding-top:var(--distance-1)}.mpy-2{padding-bottom:var(--distance-2);padding-top:var(--distance-2)}.mpy-3{padding-bottom:var(--distance-3);padding-top:var(--distance-3)}.mpy-4{padding-bottom:var(--distance-4);padding-top:var(--distance-4)}.mpy-5{padding-bottom:var(--distance-5);padding-top:var(--distance-5)}.mpt-auto{padding-top:auto}.mpt-1{padding-top:var(--distance-1)}.mpt-2{padding-top:var(--distance-2)}.mpt-3{padding-top:var(--distance-3)}.mpt-4{padding-top:var(--distance-4)}.mpt-5{padding-top:var(--distance-5)}.mpl-auto{padding-left:auto}.mpl-1{padding-left:var(--distance-1)}.mpl-2{padding-left:var(--distance-2)}.mpl-3{padding-left:var(--distance-3)}.mpl-4{padding-left:var(--distance-4)}.mpl-5{padding-left:var(--distance-5)}.mpr-auto{padding-right:auto}.mpr-1{padding-right:var(--distance-1)}.mpr-2{padding-right:var(--distance-2)}.mpr-3{padding-right:var(--distance-3)}.mpr-4{padding-right:var(--distance-4)}.mpr-5{padding-right:var(--distance-5)}.mpb-auto{padding-bottom:auto}.mpb-1{padding-bottom:var(--distance-1)}.mpb-2{padding-bottom:var(--distance-2)}.mpb-3{padding-bottom:var(--distance-3)}.mpb-4{padding-bottom:var(--distance-4)}.mpb-5{padding-bottom:var(--distance-5)}}hr{border-color:var(--hr-color);border-style:solid;border-width:0 0 .5px;margin-bottom:var(--default-distance)}button{background-color:var(--button-background);border:.5px solid var(--border-color);border-radius:2px;padding:.6rem 1.5rem}@supports (-moz-appearance:none){button{padding:.6rem 1.5rem .9rem}}button:active,button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}button.no-border{background-color:transparent!important;border:none!important}button:hover{background-color:var(--button-hover)!important;cursor:pointer}button.icon{color:var(--icon)!important;display:flex;flex-direction:column;padding:0;width:auto}button.icon:disabled{color:var(--icon-disabled)!important}button.icon:disabled:hover{background-color:transparent!important}button.primary{background-color:var(--primary)!important;border:0;color:var(--color-on-primary)!important}button.primary:hover{background-color:var(--primary-hover)!important}button.danger{background-color:var(--danger)!important;border:0;color:var(--color-on-danger)!important}button.danger:hover{background-color:var(--danger-hover)!important}button.accent{background-color:var(--accent)!important;border:0;color:var(--color-on-accent)!important}button.accent:hover{background-color:var(--accent-hover)!important}button.contrast{background-color:var(--contrast)!important;border:0;color:var(--color-on-contrast)!important}button.contrast:hover{background-color:var(--contrast-hover)!important}button.accent:active,button.accent:focus,button.contrast:active,button.contrast:focus,button.danger:active,button.danger:focus,button.primary:active,button.primary:focus{box-shadow:0 0 0 1px var(--button-outline-color)!important}button.accent.disabled,button.accent:disabled,button.contrast.disabled,button.contrast:disabled,button.danger.disabled,button.danger:disabled,button.primary.disabled,button.primary:disabled{color:var(--colored-disabled-button-color)!important;cursor:auto;outline:none}button.accent.disabled:not(.link),button.accent:disabled:not(.link),button.contrast.disabled:not(.link),button.contrast:disabled:not(.link),button.danger.disabled:not(.link),button.danger:disabled:not(.link),button.primary.disabled:not(.link),button.primary:disabled:not(.link){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.outline-hover:hover{background-color:transparent!important;outline:.5px solid var(--button-outline-color)!important}button.link{background-color:transparent!important;border:0;color:var(--primary)!important;padding:0}button.link.accent{color:var(--accent)!important}button.link.contrast{color:var(--contrast)!important}button.link.danger{color:var(--danger)!important}button.link:active,button.link:focus,button.link:hover{background-color:transparent!important;box-shadow:unset!important;text-decoration:underline!important}button.disabled,button:disabled{color:var(--disabled-button-color)!important;cursor:auto}button.disabled:not(.link):not(.icon),button:disabled:not(.link):not(.icon){background-color:var(--disabled-button-background)!important;border-color:var(--disabled-button-background)!important}button.disabled.link,button:disabled.link{color:var(--disabled-button-color)!important}button.disabled:hover,button:disabled:hover{outline:none;text-decoration:none}select{background-color:var(--background);border:.5px solid var(--input-border-color);outline:var(--primary) none 0;padding:.5rem}select:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}select:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-colour);cursor:auto}input,textarea{accent-color:var(--primary);border:.5px solid var(--input-border-color);border-radius:2px;min-height:3rem;outline:0 none currentcolor;padding:0 1rem}input:focus,textarea:focus{border-color:var(--primary);box-shadow:inset 1px 1px 0 var(--primary),inset -1px -1px 0 var(--primary)}input:invalid:not([invalid=false]):not([required]),input[invalid]:not([invalid=false]),textarea:invalid:not([invalid=false]):not([required]),textarea[invalid]:not([invalid=false]){border-color:var(--danger)}input:invalid:not([invalid=false]):not([required]):focus,input:invalid:not([invalid=false]):not([required]):hover,input[invalid]:not([invalid=false]):focus,input[invalid]:not([invalid=false]):hover,textarea:invalid:not([invalid=false]):not([required]):focus,textarea:invalid:not([invalid=false]):not([required]):hover,textarea[invalid]:not([invalid=false]):focus,textarea[invalid]:not([invalid=false]):hover{box-shadow:inset 1px 1px 0 var(--danger),inset -1px -1px 0 var(--danger)}input:disabled,textarea:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=checkbox],input[type=color],input[type=file],input[type=image],input[type=radio],input[type=range],textarea[type=checkbox],textarea[type=color],textarea[type=file],textarea[type=image],textarea[type=radio],textarea[type=range]{border:none;min-height:unset;padding-left:0}input[type=checkbox]:focus-visible,input[type=radio]:focus-visible,textarea[type=checkbox]:focus-visible,textarea[type=radio]:focus-visible{outline:var(--button-outline-color) dashed .1rem;outline-offset:.1rem}input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{border:0;padding:.6rem 1.5rem}@supports (-moz-appearance:none){input[type=button],input[type=reset],input[type=submit],textarea[type=button],textarea[type=reset],textarea[type=submit]{padding:.6rem 1.5rem .9rem}}input[type=button]:hover,input[type=reset]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=reset]:hover,textarea[type=submit]:hover{background-color:var(--button-hover);cursor:pointer}input[type=button]:active,input[type=button]:focus,input[type=reset]:active,input[type=reset]:focus,input[type=submit]:active,input[type=submit]:focus,textarea[type=button]:active,textarea[type=button]:focus,textarea[type=reset]:active,textarea[type=reset]:focus,textarea[type=submit]:active,textarea[type=submit]:focus{box-shadow:0 0 0 2px var(--button-outline-color);cursor:pointer;outline:none}input[type=button]:disabled,input[type=button]:hover:disabled,input[type=reset]:disabled,input[type=reset]:hover:disabled,input[type=submit]:disabled,input[type=submit]:hover:disabled,textarea[type=button]:disabled,textarea[type=button]:hover:disabled,textarea[type=reset]:disabled,textarea[type=reset]:hover:disabled,textarea[type=submit]:disabled,textarea[type=submit]:hover:disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);box-shadow:none;color:var(--disabled-button-color);cursor:auto}input[type=reset],textarea[type=reset]{background-color:var(--background);border:.5px solid var(--border-color)}input[type=reset]:active,input[type=reset]:focus,textarea[type=reset]:active,textarea[type=reset]:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}input[type=button],input[type=submit],textarea[type=button],textarea[type=submit]{background-color:var(--primary);color:var(--color-on-primary)}input[type=button]:hover,input[type=submit]:hover,textarea[type=button]:hover,textarea[type=submit]:hover{background-color:var(--primary-hover)}input[type=color],input[type=file],input[type=range],textarea[type=color],textarea[type=file],textarea[type=range]{border:none}input[type=color]:focus,input[type=file]:focus,input[type=range]:focus,textarea[type=color]:focus,textarea[type=file]:focus,textarea[type=range]:focus{box-shadow:none;outline:var(--primary) solid 2px;outline-offset:2px}input[type=file]::-webkit-file-upload-button,input[type=file]::file-selector-button,textarea[type=file]::-webkit-file-upload-button,textarea[type=file]::file-selector-button{background-color:var(--primary);border:0;border-radius:2px;color:var(--color-on-primary);padding:.6rem 1.5rem}input[type=file]:active::-webkit-file-upload-button,input[type=file]:active::file-selector-button,textarea[type=file]:active::-webkit-file-upload-button,textarea[type=file]:active::file-selector-button{box-shadow:inset 0 0 0 2px var(--button-outline-color)}input[type=file]:hover::-webkit-file-upload-button,input[type=file]:hover::file-selector-button,textarea[type=file]:hover::-webkit-file-upload-button,textarea[type=file]:hover::file-selector-button{background-color:var(--primary-hover);cursor:pointer}input[type=file]:focus,textarea[type=file]:focus{outline:var(--button-outline-color) solid .2rem;outline-offset:.1rem}input[type=color],textarea[type=color]{background-color:transparent;padding:0;width:8rem}input[type=range],textarea[type=range]{appearance:none;-webkit-appearance:none;background:transparent;padding:0}input[type=range]::-moz-range-thumb,textarea[type=range]::-moz-range-thumb{background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.2rem;width:1.2rem}input[type=range]::-moz-range-track,textarea[type=range]::-moz-range-track{background-color:var(--range-track-color);height:.3rem}input[type=range]::-moz-range-progress,textarea[type=range]::-moz-range-progress{background-color:var(--range-filled-track-color);height:.3rem}input[type=range]::-webkit-slider-thumb,textarea[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:var(--background);border:2px solid var(--range-filled-track-color);border-radius:100px;height:1.6rem;margin-top:-6px;width:1.6rem}input[type=range]::-webkit-slider-runnable-track,textarea[type=range]::-webkit-slider-runnable-track{background:var(--range-track-color);border:none;border-radius:3px;height:3px}input[type=range]:focus,input[type=range]:hover,textarea[type=range]:focus,textarea[type=range]:hover{background:transparent;outline:none}input[type=range]:focus::-moz-range-progress,input[type=range]:hover::-moz-range-progress,textarea[type=range]:focus::-moz-range-progress,textarea[type=range]:hover::-moz-range-progress{background-color:var(--primary)}input[type=range]:focus::-moz-range-thumb,input[type=range]:hover::-moz-range-thumb,textarea[type=range]:focus::-moz-range-thumb,textarea[type=range]:hover::-moz-range-thumb{border:2px solid var(--primary)}input[type=range]:focus::-webkit-slider-runnable-track,input[type=range]:hover::-webkit-slider-runnable-track,textarea[type=range]:focus::-webkit-slider-runnable-track,textarea[type=range]:hover::-webkit-slider-runnable-track{background-color:var(--primary)}input[type=range]:focus::-webkit-slider-thumb,input[type=range]:hover::-webkit-slider-thumb,textarea[type=range]:focus::-webkit-slider-thumb,textarea[type=range]:hover::-webkit-slider-thumb{border:2px solid var(--primary)}input[type=range]:disabled:focus,input[type=range]:disabled:hover,textarea[type=range]:disabled:focus,textarea[type=range]:disabled:hover{background:transparent;outline:none}input[type=range]:disabled:focus::-moz-range-progress,input[type=range]:disabled:hover::-moz-range-progress,textarea[type=range]:disabled:focus::-moz-range-progress,textarea[type=range]:disabled:hover::-moz-range-progress{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-moz-range-thumb,input[type=range]:disabled:hover::-moz-range-thumb,textarea[type=range]:disabled:focus::-moz-range-thumb,textarea[type=range]:disabled:hover::-moz-range-thumb{border:2px solid var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-runnable-track,input[type=range]:disabled:hover::-webkit-slider-runnable-track,textarea[type=range]:disabled:focus::-webkit-slider-runnable-track,textarea[type=range]:disabled:hover::-webkit-slider-runnable-track{background-color:var(--range-filled-track-color)}input[type=range]:disabled:focus::-webkit-slider-thumb,input[type=range]:disabled:hover::-webkit-slider-thumb,textarea[type=range]:disabled:focus::-webkit-slider-thumb,textarea[type=range]:disabled:hover::-webkit-slider-thumb{border:2px solid var(--range-filled-track-color)}input.underline,textarea.underline{background-color:transparent;border-left:0;border-radius:0;border-right:0;border-top:0;padding:0}input.underline:focus,textarea.underline:focus{box-shadow:none}input.underline:focus,input.underline:hover,textarea.underline:focus,textarea.underline:hover{border-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}input.underline:disabled:focus,input.underline:disabled:hover,input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover{border-left:0;border-right:0;border-top:0;box-shadow:none}input.underline:invalid:not([invalid=false]):not([required]):focus,input.underline:invalid:not([invalid=false]):not([required]):hover,input.underline[invalid]:not([invalid=false]):focus,input.underline[invalid]:not([invalid=false]):hover,textarea.underline:invalid:not([invalid=false]):not([required]):focus,textarea.underline:invalid:not([invalid=false]):not([required]):hover,textarea.underline[invalid]:not([invalid=false]):focus,textarea.underline[invalid]:not([invalid=false]):hover{border-color:var(--danger);box-shadow:inset 0 -1px 0 var(--danger)}input.underline:disabled:focus,input.underline:disabled:hover,textarea.underline:disabled:focus,textarea.underline:disabled:hover{border-color:var(--disabled-button-background)}a{color:var(--primary)}a:active,a:focus,a:focus-visible,a:hover{outline:unset}a.accent{color:var(--accent)}a.danger{color:var(--danger)}a.contrast{color:var(--contrast)}a.button{background-color:transparent;border-radius:2px;color:var(--button-color);display:inline-block;padding:.9rem 1.5rem;text-align:center;text-decoration:none}a.button.normal{border:.5px solid var(--border-color)}a.button.normal.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--disabled-button-color);cursor:default}a.button:hover{background-color:var(--button-hover);cursor:pointer}a.button:active,a.button:focus{box-shadow:0 0 0 1px var(--button-outline-color);cursor:pointer;outline:none}a.button.primary{background-color:var(--primary);border:0;color:var(--color-on-primary)}a.button.primary:hover{background-color:var(--primary-hover)}a.button.danger{background-color:var(--danger);border:0;color:var(--color-on-danger)}a.button.danger:hover{background-color:var(--danger-hover)}a.button.accent{background-color:var(--accent);border:0;color:var(--color-on-accent)}a.button.accent:hover{background-color:var(--accent-hover)}a.button.contrast{background-color:var(--contrast);border:0;color:var(--color-on-contrast)}a.button.contrast:hover{background-color:var(--contrast-hover)}a.button.accent:active,a.button.accent:focus,a.button.contrast:active,a.button.contrast:focus,a.button.danger:active,a.button.danger:focus,a.button.primary:active,a.button.primary:focus{box-shadow:0 0 0 2px var(--button-outline-color)}a.button.accent.disabled,a.button.contrast.disabled,a.button.danger.disabled,a.button.primary.disabled{background-color:var(--disabled-button-background);border-color:var(--disabled-button-background);color:var(--colored-disabled-button-color);cursor:default}table{border-collapse:collapse}table td,table th{padding:.5rem 2.5rem .6rem .5rem;text-align:left;vertical-align:top}table:not(.no-hover) tbody tr:hover{background-color:var(--table-hover)}table.table tbody tr,table.table thead{border-bottom:.5px solid var(--border-color)}table.table tbody tr{border-color:var(--light)}table.table tfoot{font-size:small;font-style:italic}table.sticky-header>thead{background-color:var(--background);border-bottom:0;-webkit-box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);box-shadow:0 1px 4px 0 rgba(var(--shadow-color),.16),0 1px 4px 0 rgba(var(--shadow-color),.12);position:sticky;position:-webkit-sticky;top:0;white-space:nowrap;z-index:2}table.striped tbody tr:nth-child(odd){background-color:var(--table-stripe)}table.striped tbody tr:hover{background-color:var(--table-striped-hover)}.table-container{border:.5px solid var(--border-color);border-color:var(--light);display:inline-block;overflow-x:hidden;overflow-y:auto;width:fit-content}@-moz-document url-prefix(){.table-container{padding-right:1.7rem}}.cursor-not-allowed:hover{cursor:not-allowed!important}.cursor-pointer{-webkit-user-select:none;-ms-user-select:none;user-select:none}.cursor-pointer:hover{cursor:pointer!important}.cursor-grab:hover{cursor:grab!important}.cursor-grabbing:hover{cursor:grabbing!important}.cursor-zoom-in:hover{cursor:zoom-in!important}.cursor-zoom-out:hover{cursor:zoom-out!important}.cursor-wait:hover{cursor:wait!important}.cursor-help:hover{cursor:help!important}.cursor-default,.cursor-default:hover{cursor:default!important}.cursor-no-select{-webkit-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.border{border:.5px solid var(--border-color)}.border-bottom{border-bottom:.5px solid var(--border-color)}.border-top{border-top:.5px solid var(--border-color)}.border-right{border-right:.5px solid var(--border-color)}.border-left{border-left:.5px solid var(--border-color)}.border-black{border-color:var(--black)}.border-white{border-color:var(--white)}.border-primary{border-color:var(--primary)}.border-accent{border-color:var(--accent)}.border-danger{border-color:var(--danger)}.border-light{border-color:var(--light)}.border-success{border-color:var(--icon-success)}html{background-color:var(--html-background)!important}.bg-gray-light{background-color:var(--gray-light)!important;color:var(--color-on-gray-light)!important}.bg-gray{background-color:var(--gray)!important;color:var(--color-on-gray)!important}.bg-gray-dark{background-color:var(--gray-dark)!important;color:var(--color-on-gray-dark)!important}.bg-black{background-color:var(--black)!important;color:var(--color-on-black)!important}.bg-white{background-color:var(--white)!important;color:var(--font-color)!important}.bg-primary{background-color:var(--primary)!important;color:var(--color-on-primary)!important}.bg-accent{background-color:var(--accent)!important;color:var(--color-on-accent)!important}.bg-danger{background-color:var(--danger)!important;color:var(--color-on-danger)!important}.bg-success{background-color:var(--success)!important;color:var(--color-on-success)!important}.bg-error{background-color:var(--error)!important;color:var(--color-on-error)!important}.bg-warning{background-color:var(--warning)!important;color:var(--color-on-warning)!important}.bg-transparent{background-color:transparent!important}.text-black{color:var(--black)!important}.text-white{color:var(--white)!important}.text-gray{color:var(--gray-darker)!important}.text-primary{color:var(--primary)!important}.text-accent{color:var(--accent)!important}.text-danger{color:var(--danger)!important}.text-success{color:var(--icon-success)!important}.icon-gray{color:var(--gray)!important}.icon-gray-dark{color:var(--gray-dark)!important}.icon-success{color:var(--icon-success)!important}.icon-primary{color:var(--primary)!important}.icon-accent{color:var(--accent)!important}.icon-danger{color:var(--danger)!important}.icon-black{color:var(--black)!important}.icon-white{color:var(--white)!important}.shadow{box-shadow:0 .6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-top{box-shadow:0 -1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 -.3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-left{box-shadow:-1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-right{box-shadow:1.6px 0 3.6px 0 rgba(var(--shadow-color),.132),-.3px 0 .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-bottom{box-shadow:0 1.6px 3.6px 0 rgba(var(--shadow-color),.132),0 .3px .9px 0 rgba(var(--shadow-color),.108)!important}.shadow-lg{box-shadow:0 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-top-lg{box-shadow:0 -3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-bottom-lg{box-shadow:0 3px 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-left-lg{box-shadow:-3px 0 5px 0 rgba(var(--shadow-color),.132)!important}.shadow-right-lg{box-shadow:3px 0 5px 0 rgba(var(--shadow-color),.132)!important} \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.6/flightkit.min.js b/documentation/public/cdn/ibiss-v0.0.6/flightkit.min.js new file mode 100644 index 0000000..330a84f --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.6/flightkit.min.js @@ -0,0 +1 @@ +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js b/documentation/public/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js new file mode 100644 index 0000000..c035056 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.6/htmx-ibiss-ui.min.js @@ -0,0 +1 @@ +!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){"use strict";htmx.defineExtension("ibiss-ui",{onEvent:function(t,e){if("htmx:beforeRequest"===t){const{target:i,detail:n}=e;t=i.getAttribute("ibiss-router");if(window[t]&&"function"==typeof window[t])return window[t](i,n,e),!1}}})}); \ No newline at end of file diff --git a/documentation/public/cdn/ibiss-v0.0.6/rocket.min.js b/documentation/public/cdn/ibiss-v0.0.6/rocket.min.js new file mode 100644 index 0000000..0a7f9d0 --- /dev/null +++ b/documentation/public/cdn/ibiss-v0.0.6/rocket.min.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rocketjs=t()}(this,function(){"use strict";function y(e,t){let r=0,l=e.indexOf(t);for(;-1!==l;)r++,l=e.indexOf(t,l+1);return r}function e(){return{sequence:"",match:!1}}function v(e,t,r){let l=r.sequence;return l.length===t.length&&(l=l.substring(1)),l+=e,r.sequence=l,r.match=l===t,r}class g{static getTemplates(t,r,l){if(r.length!==l.length)throw new Error("Template start is not the same length as template end");var g=t.length;let a=e(),o=e(),n=0,s=0,i=[],p=[];const u=[];for(let e=0;ee.replace(new RegExp(t,"g"),r));return l=l.replace(/if([\s\S]+?)\s|is|not/gm,e=>e.replace(new RegExp(t,"g"),r)),l=l.replace(/(of|in)([\s\S]+?)(?=<|{)/gm,e=>e.replace(new RegExp(t,"g"),r)),l}}class o{static resolvePartials(e,t){let r=e;for(const a of g.getTemplates(e,"{{#","#}}")){var l=g.getInnerTemplate(a),l=g.getPropertyValue(l,t);let e=l?l:"";r=r.replace(a,e)}if(r.includes("{{#")){if(e===r)return r;r=o.resolvePartials(r,t)}return r}}class s{static interpolateTemplate(e,r){let l=e;for(const n of g.getTemplates(e,"{{","}}")){let e=g.getInnerTemplate(n,2);var a="!"===e[0],o=(a&&(e=e.substr(1).trim()),g.getPropertyValue(e,r));let t=o?o:"";t=Array.isArray(t)?t.join(", "):t.toString().trim();o=a?s.escapeHtml(t):t;l=l.replace(n,o)}return l}static escapeHtml(e){return e=(e=(e=(e=(e=e.replace(/&/gm,"&")).replace(//gm,">")).replace(/"/gm,""")).replace(/\//gm,"'")}}class r{static buildTemplate(e,t){e=o.resolvePartials(e,t),e=class{static resolveWrapper(e){let t=e;for(const o of g.getTemplates(e,"{{$","$}}")){var r=g.getWrapperProperty(o),l=g.getTemplates(r.templateToFill,"{{","}}"),l=g.getToplevelTemplates(l);let e=r.templateToFill;for(const n of l){var a=g.getProperty(n);e=e.replace(new RegExp(a,"g"),r.property+"."+a)}t=t.replace(o,e)}return t}}.resolveWrapper(e);return e=c.resolveLoop(e,t),class{static resolveConditional(e,l){let a=e;for(const p of g.getTemplates(e,"{{~","~}}")){const c=g.getConditionalLogic(p);var o=c.property,n=c.logiclessTemplate,s=c.truthy,i=!c.truthy;let e="",t=(c.comparison&&(e=c.comparison),""),r=g.getPropertyValue(o,l);r&&(r=Array.isArray(r)?r:r.toString().trim().toLocaleLowerCase(),e=c.comparison?c.comparison.toLocaleLowerCase():null),e?(s&&(t=r===e?n:""),i&&(t=r!==e?n:"")):t="false"===r||!r||Array.isArray(r)&&!r.length?"":n,a=a.replace(p,t)}return a}}.resolveConditional(e,t)}static interpolateTemplate(e,t){return s.interpolateTemplate(e,t)}static render(e,t){e=r.buildTemplate(e,t);return r.interpolateTemplate(e,t)}}return r}); \ No newline at end of file diff --git a/documentation/public/js/flightkit.min.js b/documentation/public/js/flightkit.min.js index 0290665..330a84f 100644 --- a/documentation/public/js/flightkit.min.js +++ b/documentation/public/js/flightkit.min.js @@ -1 +1 @@ -!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file +!function(){"use strict";var a,c,g,e;(e=a=a||{}).Date="date",e.String="string",e.Float="float",e.Number="number",e.Array="array",e.Object="object",e.Bool="bool",e.Currency="currency",e.Undefined="undefined",e.Null="null";const l={date:/^(\d{1,4}-\d{1,4}-\d{1,4}(T)?)/gim,currency:/^[$|€]\s?[0-9]*(\.|,)?\d*(\.|,)?\d*/gim,float:/\d+[,|.]\d+[,|.]?\d*/gim,currencySign:/\$|€/gim,array:/^\s?[[].[^,]+[\]],?/gi,precision:/[-+$€,.]/gm,string:/[a-zA-Z]/gim},d=e=>{return null===e||"null"===e?a.Null:e||0===e||!1===e?null===new RegExp(l.date).exec(e)||isNaN(Date.parse(e))?new RegExp(l.currency).exec(e)?a.Currency:!new RegExp(l.string).exec(e)&&new RegExp(l.float).exec(e.toString())?a.Float:isNaN(e)&&0!==e?Array.isArray(e)?a.Array:"object"==typeof e?a.Object:a.String:a.Number:a.Date:a.Undefined},h=(t,e)=>{const s={value:void 0,type:e=e||d(t),currencySign:""};switch(s.type){case a.String:s.value=t.toString();break;case a.Float:case a.Currency:var r=(t=t.toString()).match(new RegExp(/(,)/gim)),n=t.match(new RegExp(/(\.)/gim));if(r)for(let e=1;e<=r.length;e++)t=e!==r.length||n?t.replace(",",""):t.replace(",",".");if(s.type===a.Currency){const o=new RegExp(l.currencySign);var i=o.exec(t);s.currencySign=null!==i?i[0]:"",t=t.replace(o,"")}s.value=parseFloat(t).toPrecision(12);break;case a.Number:s.value=Number(t);break;case a.Date:s.value=Date.parse(t);break;case a.Array:t.length?"object"==typeof t[0]?s.value=t.map(e=>JSON.stringify(e)).join(", "):s.value=t.join(", "):s.value="";break;case a.Object:s.value=t;break;case a.Undefined:s.value="";break;case a.Null:s.value=null}return s};function v(e,t){var s;let r;for(s of e.split("."))s=s.trim(),r?"object"!=typeof r||Array.isArray(r)||(r=r[s]):r=t[s];return r}const m=(e,t)=>tet<=e,w=(e,t)=>e<=t,E=(e,t,s)=>s?e.toLowerCase()==t.toLowerCase():e==t,k=(e,t)=>e===t,_=(e,t)=>e!=t,x=(e,t)=>e!==t,L=(e,t)=>null!=t&&"string"==typeof e&&0<=e.toLowerCase().indexOf(t.toString().toLowerCase()),A=(e,t)=>null!=t&&0<=e.toString().toLowerCase().indexOf(t.toString().toLowerCase()),T=(e,t)=>null!=t&&"string"==typeof e&&e.toLowerCase().indexOf(t.toString().toLowerCase())<0;function t(s,r){if(0===r.length)return s;{var n=s;const o=[],a=[];let e=[];for(const l of r)l.type&&l.type!==c.And?(e.length&&a.push(e),e=[l]):e.push(l);a.push(e);let t=[];for(const e of a)t=t.concat(C(n,e));t=[...new Set(t)];var i=n.length;for(let e=0;e":return m;case"<":return f;case">=":return b;case"<=":return w;case"is":case"==":return E;case"!is":case"!=":return _;case"===":return k;case"!==":return x;case"like":case"~":case"contains":return L;case"!contains":case"!like":case"!~":return T;default:return A}}(a.operator);if(!l(i,o,a.ignoreCase)){e=!1;break}}e&&s.push(r)}return s};function s(e,t){if(!t||0===t.length)return e;if(1{if(0===s.length)s=s.concat(o(n,e));else{for(const t of s)r=r.concat(o(t,e));s=r,r=[]}}),s}return o(e,t[0])}function o(e,t){const s=[],r=[];do{if(!e||0===e.length)break;var n=e.shift();if(!n)break;const o=n[t];var i=r.indexOf(o.toString());0<=i?s[i].push(n):(r.push(o.toString()),void 0!==s[r.length-1]?s[r.length-1].push(n):s.push([n]))}while(0{if(t){var s=e;const r={};for(const n of t){let e=s.map(e=>e[n].toString());const i=e.map(e=>d(e));i.some(e=>e===a.Float)?(e=e.map(e=>parseFloat(e)),r[n]=parseFloat(e.reduce((e,t)=>e+t).toFixed(2))):(e=e.map(e=>parseInt(e)),r[n]=e.reduce((e,t)=>e+t))}return r}return{}};class S{model;sortDetails=[];filterDetails=[];selection=[];groupByProperties=[];distinctProperties=[];concatenationToken=", ";constructor(e){this.model=JSON.parse(JSON.stringify(e))}sort(e){return this.sortDetails=e,this}orderBy(e,t){return this.sortDetails.push({propertyName:e,direction:t}),this}thenOrderBy(e,t){return this.orderBy(e,t)}filter(e){return Array.isArray(e)?this.filterDetails=e:this.filterDetails.push(e),this}where(e,t,s,r,n){return this.filterDetails.push({propertyName:e,operator:t,value:s,type:r,ignoreCase:n}),this}andWhere(e,t,s,r){return this.where(e,t,s,c.And,r),this}orWhere(e,t,s,r){return this.where(e,t,s,c.Or,r),this}group(e){return this.groupByProperties=e,this}groupBy(e){return this.groupByProperties.push(e),this}thenGroupBy(e){return this.groupByProperties.push(e),this}select(e){return Array.isArray(e)?this.selection=e:"*"!==e&&(this.selection=[e]),this}distinct(e,t){return t&&(this.concatenationToken=t),Array.isArray(e)?this.distinctProperties=e:e&&(this.distinctProperties=[e]),this}execute(){return s(function(t,s){if(0===s.length)return t;{var r=s;let e=[];for(const n of t){const i={};for(const o of r)i[o]=n[o];e.push(i)}return e}}(function(s,r,d){if(!r||!r.length)return s;const n=[],h=[];for(const m of s){const o={};let t="";for(const e of r){var u=v(e,m);o[e]=u,t+=u}if(!h.includes(t)){let e=s;for(const a of Object.keys(o))e=e.filter(e=>e[a]===o[a]);h.push(t),n.push(e)}}const t=[];for(const f of n){let e={};for(const l of f){var i,p=Object.keys(e);if(p.length)for(const c of p)r.includes(c)||(i=e[c],Array.isArray(i)?(i=l[c],Array.isArray(i)?e[c]=[...new Set(...e[c].concat(l[c]))]:e[c].includes(l[c])||e[c].push(l[c])):isNaN(e[c])&&isNaN(l[c])?e[c]!==l[c]&&(e[c]=[e[c],l[c]]):e[c]=e[c]+l[c]);else e=l}t.push(e)}return t.forEach(e=>{for(const t in e)Array.isArray(e[t])&&(e[t]=e[t].join(d))}),t}(r(t(JSON.parse(JSON.stringify(this.model)),this.filterDetails),this.sortDetails),this.distinctProperties,this.concatenationToken),this.selection),this.groupByProperties)}sum(e,t){e=Array.isArray(e)?e:[e];return i(t||this.model,e)}}function I(e,t){t=t?t.toUpperCase():"FLK-";return e.toUpperCase().includes(t)}function u(e,t){var{timeStamp:s,type:r,x:n,y:i}=e;let o=e.target;do{if(!o||"HTML"===o.tagName||I(o.tagName,t)){"HTML"===o.tagName&&(o=null);break}}while(o=o.parentNode||o.parentElement,!I(o.tagName,t));return{target:o,timeStamp:s,type:r,x:n,y:i}}function N(e,t){let s=e.target,r="";for(;s.dataset[t]?r=s.dataset[t]:s=s.parentNode,!r;);return r}class n{constructor(){}_topLevelClasses=[];_events=[];generateId(){return"flk-"+function e(){const t=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),s=t.split("-")[0];return window.$flightkitUUIDStore||(window.$flightkitUUIDStore=[]),window.$flightkitUUIDStore.some(e=>e===s)?e():(window.$flightkitUUIDStore.push(s),s)}()}render(t){if(!t.component)throw new Error("Component is not assigned! Can't render");t.id=t.id||this.generateId();var e=this._getAllEventAttributes(t);if(e){var s="#"+t.id;for(const i of e){var r="e-"+i;this.addEvent(s,i,t.getAttribute(r))}}var n=Object.keys(t.classList).length;if(n){for(let e=0;e{this._assignToDom(t,t.component),clearTimeout(this._renderTimer)},10)}addEvent(e,t,s){this._events.push({selector:e,eventType:t,callback:s})}_getExternalCallback(e){let t=void 0;for(const s of e.split("."))t=(t||window)[s];return t}_getAllEventAttributes(e){e=e.attributes;const t=Array.from(e).filter(e=>e.name.startsWith("e-"));return t.map(e=>e.name.slice(2))}_isFlightkitElement(e){return e.toUpperCase().includes("FLK-")}_outerEventHandler(e){const t=u(e),s=(t.contents=e.detail,t.target.getAttribute("e-"+t.type));let r=void 0;for(const n of s.split("."))r=(r||window)[n];return e.preventDefault(),e.stopPropagation(),r(t)}_addEvents(e){if(e.isConnected)for(const s of this._events)if(s.selector.startsWith("."))for(const r of document.querySelectorAll(s.selector))this._addEventToElement(s,r);else{var t=document.querySelector(s.selector);this._addEventToElement(s,t)}}_addEventToElement(e,t){t&&("function"==typeof e.callback?(t.removeEventListener(e.eventType,e.callback),t.addEventListener(e.eventType,e.callback)):(t.removeEventListener(e.eventType,this._outerEventHandler),t.addEventListener(e.eventType,this._outerEventHandler)))}removeEvents(){for(const t of this._events)if(t.selector.startsWith("."))for(const s of document.querySelectorAll(t.selector))this._addEventToElement(t,s);else{var e=document.querySelector(t.selector);this._addEventToElement(t,e)}this._events=[]}_removeEventToElement(e,t){t&&("function"==typeof e.callback?t.removeEventListener(e.eventType,e.callback):t.removeEventListener(e.eventType,this._outerEventHandler))}_assignToDom(e,t){e.innerHTML="";for(const r of Array.isArray(t)?t:[t])e.append(r);const s=setTimeout(()=>{this._addEvents(e),clearTimeout(s)},10)}}const p='',B='';function D(e){const t=new DOMParser;return t.parseFromString(e,"image/svg+xml").documentElement}class O extends HTMLElement{base;component=null;_contents=[];_orderBy=[];properties=new Set;_columnOrder=[];_filter="";_selectionProperty="";_selectedIds=new Set;uniqueEntriesByProperties={};propertyLabelDictionary={};_templates={};_templateClasses={};static get observedAttributes(){return["contents","columns","order","filter","selection-property","templates"]}get columnOrder(){return this._columnOrder.length?this._columnOrder:this.properties}set columnOrder(e){let t;"string"==typeof e&&(t=e.split(",")),t=e,this._columnOrder=t}get contents(){return this._contents}set contents(e){this.analyzeData(e),this._contents=new S(e)}get orderBy(){return this._orderBy}set orderBy(e){if(Array.isArray(e))this._orderBy=e;else{const r=[];for(const n of e.split(",")){var t=n.split("|"),s=t[0],t=1e[s._selectionProperty])):new Set;e=t?s.contents.execute():[];s._emit("select",s,{selection:e}),s._updateCheckboxes(s)}emitSelect(e){var t=e.target.checked,s=e.target.dataset.objectId;const r=u(e).target,n=(t?r._selectedIds.add(s):r._selectedIds.delete(s),r._selectionProperty);e=r.contents.execute().filter(e=>r._selectedIds.has(e[n]));r._emit("select",r,{selection:e}),r._updateCheckboxes(r)}sortData(e){const t=u(e).target,s=N(e,"column");s&&(-1<(e=t._orderBy.findIndex(e=>e.propertyName===s))?"asc"===t._orderBy[e].direction?t._orderBy[e].direction="desc":t._orderBy.splice(e,1):t._orderBy.push({propertyName:s,direction:"asc"}),t.createHtml(),t.base.render(t))}setColumnOrder(e){this._columnOrder=e?Array.isArray(e)?e:e.split(","):[]}analyzeData(t){this.properties=new Set;var s=t.length;for(let e=0;e"_"===e?" ":" "+e.toLowerCase()).trim();var s=t.charAt(0).toUpperCase()+t.slice(1);return this.propertyLabelDictionary[e]=s}parseTemplate(e,r){return e.replace(/\{\{([\s\S]+?)\}\}/gim,(e,t)=>{let s="";t=t.trim();t=r[t];return t&&(s=t),Array.isArray(s)?s.join(", "):s.toString().trim()})}createSelectionCheckbox(e){const t=document.createElement("input");return t.setAttribute("type","checkbox"),t.classList.add("flk-selection-checkbox"),e&&(t.dataset.selected=e[this._selectionProperty]),t}createRow(e){const t=document.createElement("tr");if(this._selectionProperty.length){const n=document.createElement("td");var s=this.base.generateId();const i=this.createSelectionCheckbox(e);i.id=s,i.dataset.objectId=e[this._selectionProperty];var r=e[this._selectionProperty];this._selectedIds.has(r)?i.checked=!0:i.checked=!1,this.base.addEvent("#"+s,"change",this.emitSelect),n.append(i),t.append(n)}for(const o of this.columnOrder){const a=document.createElement("td");this._templates[o]?(a.innerHTML=this.parseTemplate(this._templates[o],e),this._templateClasses[o]&&a.classList.add(...this._templateClasses[o])):a.innerText=e[o],t.append(a)}return t}createBody(e){const t=document.createElement("tbody");for(const r of e){var s=this.createRow(r,null);t.append(s)}return t}createHead(){const e=document.createElement("thead"),t=document.createElement("tr");if(t.classList.add("cursor-pointer"),this._selectionProperty.length){const n=document.createElement("th");var s=this.base.generateId();const i=this.createSelectionCheckbox();i.id=s;var d=this.contents.execute().length;0e.propertyName===o);if(r){const c=document.createElement("span");c.innerHTML="asc"===r.direction?'':'',a.append(c)}t.append(a)}return e.append(t),e}addEvent(e,t,s){this.base.addEvent(e,t,s)}init(){this.createHtml(),this.base.render(this)}}class j extends HTMLElement{base;componentId;constructor(){super(),this.base=new n}connectedCallback(){var e=this.getAttribute("top"),t=this.getAttribute("left"),s=this.getAttribute("center"),r=this.getAttribute("zIndex");this.id||(this.id=this.base.generateId()),this.style.display="block",this.style.position="fixed","string"==typeof s?(this.style.top=e||"50%",this.style.left="50%",this.style.transform="translate(-50%, -50%)"):(this.style.top=e||this.clientTop+"px",this.style.left=t||this.clientLeft+"px"),r&&(this.style.zIndex=r),this.componentId=this.getAttribute("handle");const n=document.createElement("div");n.innerHTML=this.innerHTML,this.component=n;s="#"+(this.componentId||this.id);this.base.addEvent(s,"mousedown",this._dragElement),this.base.addEvent(s,"mouseup",this._reset),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this)}_dragElement(e){const s=u(e,"flk-draggable").target;let r,n;function t(e){r=e.clientX-s.offsetLeft,n=e.clientY-s.offsetTop}function i(e){var t=e.clientX-r,e=e.clientY-n;s.style.left=t+"px",s.style.top=e+"px"}function o(e){e.preventDefault()}function a(){s.removeAttribute("draggable"),s.removeEventListener("dragstart",t),s.removeEventListener("dragend",a),document.removeEventListener("dragover",o),document.removeEventListener("drop",i)}s.setAttribute("draggable",!0),s.addEventListener("dragstart",t),s.addEventListener("dragend",a),document.addEventListener("dragover",o),document.addEventListener("drop",i)}}class M extends HTMLElement{_id;base;_draggableId;constructor(){super(),this.base=new n}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}_closeModal(e){e.stopPropagation();const t=u(e,"flk-modal").target;t.classList.add("hidden")}closeModal(e){this.classList.add("hidden")}openModal(e=!0){const t=document.getElementById(this._draggableId);e&&(t.style.top="40%",t.style.left="50%"),this.classList.remove("hidden")}connectedCallback(){this.id||(this.id=this.base.generateId());const e=document.createElement("div");var t=this.base.generateId();const s=document.createElement("flk-draggable"),r=(this._draggableId=this.base.generateId(),s.id=this._draggableId,s.setAttribute("center",""),s.setAttribute("top","40%"),s.setAttribute("handle",t),s.setAttribute("zIndex","1080"),s.classList.add("border","shadow-lg","bg-white"),s.style.width="max-content",document.createElement("div"));var n=this.getAttribute("modal-title");if(n){const c=document.createElement("span");c.innerText=n,c.classList.add("ml-1","mr-auto"),r.append(c)}r.id=t;const i=this.getAttribute("header-class");let o=[];i?o=o.concat(i.split(" ")):o.push("bg-gray-light"),r.classList.add(...o,"border-bottom","row","justify-end","cursor-no-select");n=this.base.generateId();const a=document.createElement("button"),l=(a.classList.add("py-0","px-1","outline-hover","no-border","cursor-default",...o),a.innerText="X",a.id=n,r.append(a),s.append(r),document.createElement("div"));l.innerHTML=this.innerHTML,s.append(l),e.append(s),this.component=e,this.base.addEvent("#"+n,"click",this._closeModal),this.base.render(this),this.classList.add("hidden")}disconnectedCallback(){this.base.removeEvents(this)}}class H extends HTMLElement{base;_buttonId;_drawerId;_iconId;constructor(){super(),this.base=new n}connectedCallback(){this.style.position="relative",this.style.display="flex",this.style.width="fit-content",this._buttonId=this.base.generateId();const e=document.createElement("button"),t=(e.setAttribute("type","button"),e.classList.add("row"),e.id=this._buttonId,document.createElement("span")),s=(t.classList.add("self-align-center"),t.innerText=this.getAttribute("text"),this._iconId=this.base.generateId(),document.createElement("span"));s.classList.add("self-align-center");var r=D('');const n=D(''),i=(n.classList.add("hidden"),s.append(r,n),s.id=this._iconId,e.append(t,s),this._drawerId=this.base.generateId(),document.createElement("div"));i.id=this._drawerId,i.classList.add("shadow","inline-block","bg-white"),i.style.position="absolute",i.style.zIndex="1040";r=this.querySelector("template");r.innerHTML.length?i.innerHTML=r.innerHTML:i.append(r.firstChild),i.style.display="none",this.component=[e,i],this.base.addEvent("#"+this._buttonId,"click",this.toggleMenu);const o=document.querySelector("body");""!==o.getAttribute("flk-close-dropdown")&&(o.setAttribute("flk-close-dropdown",""),o.addEventListener("click",this.closeAllDropdownButtons)),this.base.render(this)}disconnectedCallback(){this.base.removeEvents(this);var e=document.querySelectorAll("flk-dropdown");if(!e||!e.length){const t=document.querySelector("body");t.removeAttribute("flk-close-dropdown"),t.removeEventListener("click",this.closeAllDropdownButtons)}}toggleMenu(e){const t=u(e).target;e=t._drawerId;const s=document.getElementById(e);var e="none"!==s.style.display,r=(s.style.display=e?"none":"block",t.getAttribute("drawer-width")),r=("string"==typeof t.getAttribute("right")&&(s.style.right="0px"),s.style.top=t.offsetHeight+"px",s.style.width=r||t.offsetWidth+"px",t._iconId);const n=document.getElementById(r);e?(n.childNodes[0].classList.remove("hidden"),n.childNodes[1].classList.add("hidden")):(n.childNodes[0].classList.add("hidden"),n.childNodes[1].classList.remove("hidden"))}_closeDropdown(){var e=this._drawerId;const t=document.getElementById(e);if("none"!==t.style.display){e=this._iconId;const s=document.getElementById(e);t.style.display="none",s.childNodes[0].classList.remove("hidden"),s.childNodes[1].classList.add("hidden")}}closeAllDropdownButtons(e){var t,s=u(e,"flk-dropdown").target,e=document.querySelectorAll("flk-dropdown");if(s)for(const r of e)s._buttonId!==r._buttonId&&(t=r._drawerId,"none"!==document.getElementById(t).style.display&&r._closeDropdown());else for(const n of e)n._closeDropdown()}}class P extends HTMLElement{base;contents;component;listType="ul";iconSet;filter={value:"",caseSensitive:!1};selectedElements=[];static get observedAttributes(){return["contents","icon-set","max-depth","filter"]}_jsonToValueArray(e){let t=JSON.stringify(e);t=t.replace(/[\[\]{}\"]/g,"");let s=[];for(const r of t.split(","))s=s.concat(r.split(":"));return[...new Set(s)]}_emit(e,t,s){e=new CustomEvent(e,{detail:s,bubbles:!0,cancelable:!0});t.dispatchEvent(e)}constructor(){super(),this.base=new n,this.setContents(this.getAttribute("contents")),this.iconSet=this.getAttribute("icon-set")?this.getAttribute("icon-type"):"file",this.maxDepth=this.getAttribute("max-depth")?parseInt(this.getAttribute("max-depth")):-1,this.setFilter(this.getAttribute("filter")),this.style.display="block",this.style.maxWidth="fit-content",this.style.margin="0 1rem 0 0",this.base.addEvent(".flk-branch","click",this.emitNodeToggle)}emitNodeToggle(e){if(e.stopPropagation(),["LI","UL"].includes(e.target.tagName))return!1;const t=u(e,"flk-tree-nav").target,s=N(e,"branchKey");let r=t.contents;const d=s.split(".");for(const o of d)if(r[o])r=r[o];else if(null===r[o])r=null;else{let e=[];for(const a of r)a[o]&&e.push(a[o]);r=e}let n,i=e.target;for(;i.dataset&&i.dataset.leafKey?n=i.dataset.leafKey:i=i.parentNode||i.parentElement,!n;);if(t.selectedElements.length)for(const l of t.selectedElements)l.classList.remove("font-weight-bold"),delete l.dataset.selected;t.selectedElements=[],"DETAILS"===i.tagName?(t.selectedElements.push(i.childNodes[0]),i.childNodes.length&&i.childNodes[0].childNodes.length&&"DIV"===i.childNodes[0].childNodes[0].tagName&&(console.log(i.childNodes[0].childNodes),t.selectedElements=i.childNodes[0].childNodes[0].childNodes)):t.selectedElements.push(i);for(const c of t.selectedElements)c.dataset.selected||(c.classList.add("font-weight-bold"),c.dataset.selected=!0);var e=s.substring(s.indexOf(".")+1),h=t.createLeafText(d.reverse()[0]);t._emit("tree-click",t,{path:e,data:r,key:n,label:(h.titleText+" "+h.commentText).trim(),branch:"object"==typeof r})}convertJsonKeyToTitle(e){if(!e)return"";const t=(e="string"!=typeof e?e.toString():e).replace(/([A-Z_])/g,e=>"_"===e?" ":" "+e).trim();return t.charAt(0).toUpperCase()+t.slice(1)}setContents(e){var t=e||this.contents||[];try{switch(typeof t){case"string":this.contents=JSON.parse(t);break;case"object":Array.isArray(t)?this.contents=t:this.contents=[t]}}catch(e){console.log(e)}}applyFilter(e){let t;var s="details"===e.tagName.toLowerCase();t=this.filter.caseSensitive?e.dataset.branchValues.includes(this.filter.value):e.dataset.branchValues.toLowerCase().includes(this.filter.value.toLowerCase()),t?e.parentElement.classList.remove("hidden"):e.parentElement.classList.add("hidden"),s&&t?e.setAttribute("open",""):e.removeAttribute("open")}resetTree(e){e.parentElement.classList.remove("hidden"),e.removeAttribute("open")}filterTree(){let t=setTimeout(()=>{for(const e of this.querySelectorAll("[data-branch-values]"))void 0===this.filter.value||0===this.filter.value.length?this.resetTree(e):this.applyFilter(e);clearTimeout(t)},10)}setFilter(e){const t=e||{};try{switch(typeof t){case"string":t.includes("{")?(this.filter=JSON.parse(t),!1===this.filter.caseSensitive&&(this.filter.value=this.filter.value.toLowerCase())):this.filter.value=e.toLowerCase();break;case"object":this.filter=t}}catch(e){console.log(e)}this.filterTree()}createLeafText(e){var t,s;let r="",n="";return"string"==typeof e&&(e.includes("(")||e.includes("["))?(s=e.indexOf("("),s=-1===(t=e.indexOf("["))?s:t,r=this.convertJsonKeyToTitle(e.substring(0,s)),n=e.substring(s)):r=this.convertJsonKeyToTitle(e),{titleText:r,commentText:n}}createTextTag(r,n){r=this.createLeafText(r);if(r.commentText){let e=document.createElement("div"),t=document.createElement("span"),s=(t.innerText=r.titleText,document.createElement("small"));s.innerText=r.commentText,s.style.marginLeft="1rem",e.append(t,s),e.style.display="inline-flex",e.style.alignItems="center",n.append(e)}else n.innerText=r.titleText}createLeaf(e,t,s,r=[]){let n=document.createElement("li");n.classList.add("cursor-no-select"),n.style.marginTop="0.4rem",n.dataset.branchKey=s;const i="file"===this.iconSet?'':'';n.style.listStyleImage=`url('data:image/svg+xml,${i}')`,n.style.position="relative",n.style.left="2px";let o=document.createElement("span");s=[e].concat(r);if(o.dataset.branchValues=[...new Set(s)].join(),o.dataset.leafKey=s[0],this.createTextTag(e,o),o.style.position="relative",o.style.top="-3px",n.append(o),t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);const i="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${i}')`,e.append(n),t.append(e)}else t.append(n)}createBranch(s,t,r,n){if(n===this.maxDepth&&"object"==typeof s)for(const o of Array.isArray(s)?s:Object.keys(s)){let e;s[o]&&(e=this._jsonToValueArray(s[o])),this.createLeaf(o,t,r+"."+o,e)}else if(Array.isArray(s))for(var e in s){var d=document.createElement(this.listType);t.append(this.createBranch(s[e],d,r+"."+e,n+1))}else if(null!==s&&"object"==typeof s){const a=[];for(const l of Object.keys(s)){let e=document.createElement("li"),t=(e.classList.add("cursor-no-select"),e.style.position="relative",e.style.left="2px",e.dataset.branchKey=r+"."+l,document.createElement("details"));t.classList.add("flk-branch"),t.dataset.branchValues=[l].concat(this._jsonToValueArray(s[l])),t.style.position="relative",t.style.top="-3px",t.classList.add("cursor-default");var i=document.createElement("summary");this.createTextTag(l,i),t.dataset.leafKey=l,t.append(i),e.append(this.createBranch(s[l],t,r+"."+l,n+1)),a.push(e)}if(t.tagName.toLowerCase()!==this.listType){let e=document.createElement(this.listType);var h="file"===this.iconSet?p:B;e.style.listStyleImage=`url('data:image/svg+xml,${h}')`;for(const c of a)e.append(c);t.append(e)}else for(const u of a)t.append(u)}else this.createLeaf(s,t,r);return t}createHtml(){let e=document.createElement(this.listType);var t="file"===this.iconSet?p:'';if(e.style.listStyleImage=`url('data:image/svg+xml,${t}')`,e.style.marginLeft="3rem",this.contents.length){for(const s in this.contents)e=this.createBranch(this.contents[s],e,s,0);this.component=e}else this.component=e}attributeChangedCallback(e,t,s){switch(e){case"contents":this.setContents(s);break;case"icon-set":this.iconSet=s;break;case"max-depth":this.maxDepth="string"==typeof s?parseInt(s):s;break;case"filter":this.setFilter(s)}this.init()}connectedCallback(){this.init()}disconnectedCallback(){this.base.removeEvents(this)}init(){this.createHtml(),this.base.render(this)}}customElements.define("flk-table",O),customElements.define("flk-draggable",j),customElements.define("flk-modal",M),customElements.define("flk-dropdown",H),customElements.define("flk-tree-nav",P)}(); \ No newline at end of file diff --git a/flightkit/components/table.js b/flightkit/components/table.js index 1ef5a61..9aa5edc 100644 --- a/flightkit/components/table.js +++ b/flightkit/components/table.js @@ -176,24 +176,6 @@ export class FlightkitTable extends HTMLElement { this.contents.sort([]); } - if (this.filter.length) { - const filters = []; - - for (const property of this.columnOrder) { - filters.push({ - propertyName: property, - value: this.filter, - operator: 'like', - type: 'or', /** optional, defaults to "and" **/ - ignoreCase: true /** optional, defaults to "false" **/ - }); - } - this.contents.filter(filters); - } - else { - this.contents.filter([]); - } - const tableHead = this.createHead(); tableElement.append(tableHead); @@ -201,8 +183,23 @@ export class FlightkitTable extends HTMLElement { tableElement.append(this._createElement('caption')); } - const data = this.contents.execute(); - const tableBody = this.createBody(data); + const orderedData = this.contents.execute(); + let filteredData = [] + if (this.filter.length) { + for (const data of orderedData) { + let valuesInData = Object.values(data).join(" ").toLowerCase(); + + if (valuesInData.includes(this.filter)) { + filteredData.push(data) + } + } + } + else { + filteredData = orderedData + } + + + const tableBody = this.createBody(filteredData); tableElement.append(tableBody); if (this._templates['tfoot']) { diff --git a/flightkit/index.html b/flightkit/index.html index 326e922..7fbff91 100644 --- a/flightkit/index.html +++ b/flightkit/index.html @@ -20,6 +20,11 @@ +
+ + +
+
@@ -69,6 +74,22 @@ databasesNav.setContents(window.databaseSet); databasesNav.init(); + const dbTable = document.getElementById("db-table") + dbTable.setContents(window.databaseSet.database1.table1); + dbTable.init(); + + let timer; + document.getElementById('table-filter').addEventListener('keyup', (e) => { + if (timer) { + clearTimeout(timer) + } + + timer = setTimeout(() => { + dbTable.filter = e.target.value; + dbTable.init(); + }) + + }) }; diff --git a/package.json b/package.json index c5723ba..3e8efda 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@pennions/ibiss", - "version": "0.0.5", + "version": "0.0.6", "avian_version": "0.0.2", - "flightkit_version": "0.0.5", + "flightkit_version": "0.0.6", "htmx_plugin_version": "0.0.1", "rocketjs_version": "0.0.1", "description": "Frontend library of Pennions",