@limetech/lime-elements 39.23.0 → 39.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/adapt-color-contrast-Beo1IEl_.js +168 -0
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-email-viewer.cjs.entry.js +9 -2
- package/dist/cjs/limel-form.cjs.entry.js +45 -8
- package/dist/cjs/limel-markdown.cjs.entry.js +25 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/email-viewer/email-viewer.js +9 -2
- package/dist/collection/components/form/form.js +39 -2
- package/dist/collection/components/markdown/markdown.js +46 -1
- package/dist/collection/util/adapt-color-contrast.js +164 -0
- package/dist/esm/adapt-color-contrast-Dgcw_h7C.js +166 -0
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-email-viewer.entry.js +9 -2
- package/dist/esm/limel-form.entry.js +45 -8
- package/dist/esm/limel-markdown.entry.js +25 -1
- package/dist/esm/loader.js +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/p-96ee6090.entry.js +1 -0
- package/dist/lime-elements/{p-29a59535.entry.js → p-9758568e.entry.js} +1 -1
- package/dist/lime-elements/p-Dgcw_h7C.js +1 -0
- package/dist/lime-elements/p-c1c635c1.entry.js +1 -0
- package/dist/types/components/email-viewer/email-viewer.d.ts +2 -0
- package/dist/types/components/form/form.d.ts +14 -0
- package/dist/types/components/markdown/markdown.d.ts +16 -0
- package/dist/types/components.d.ts +15 -0
- package/dist/types/util/adapt-color-contrast.d.ts +38 -0
- package/package.json +1 -1
- package/dist/lime-elements/p-5b31c118.entry.js +0 -1
- package/dist/lime-elements/p-70541fe3.entry.js +0 -1
|
@@ -10,4 +10,4 @@ import{r as e,c as t,h as n,a as r}from"./p-DBTJNfo7.js";import{g as o}from"./p-
|
|
|
10
10
|
* @author RubaXa <trash@rubaxa.org>
|
|
11
11
|
* @author owenm <owen23355@gmail.com>
|
|
12
12
|
* @license MIT
|
|
13
|
-
*/(e,t);const r=function(e,t){let n=e;if(Zh(e)&&(n=e.items),n.$ref){const e=n.$ref.split("/").slice(1).join(".");n=h(t,e)}return n}(t,n);e=function(e,t){if(!t||se(t))return e;const n={};for(const r of Object.keys(t))n[r]=e[r];return n}(e,r.properties);const o=function(e,t){return[["title",e.title],["name",e.name],am(e,t),...Object.entries(e)].find((e=>{const t=e[1];return!!t&&"boolean"!=typeof t}))}(e,r);if(!o)return null;if(!r.properties)return null;const[i,a]=o;return im(a,r.properties[i],n)}function am(e,t){if(!("required"in t))return[null,null];const n=Object.keys(e).find((e=>t.required.includes(e)));return n?[n,e[n]]:[null,null]}function lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lm(Object(n),!0).forEach((function(t){cm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function um(e){return um="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(e)}function cm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fm(){return fm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fm.apply(this,arguments)}function dm(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var hm=dm(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mm=dm(/Edge/i),pm=dm(/firefox/i),vm=dm(/safari/i)&&!dm(/chrome/i)&&!dm(/android/i),ym=dm(/iP(ad|od|hone)/i),bm=dm(/chrome/i)&&dm(/android/i),gm={capture:!1,passive:!1};function wm(e,t,n){e.addEventListener(t,n,!hm&&gm)}function $m(e,t,n){e.removeEventListener(t,n,!hm&&gm)}function km(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Sm(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Em(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&km(e,t):km(e,t))||r&&e===n)return e;if(e===n)break}while(e=Sm(e))}return null}var jm,Om=/\s+/g;function xm(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Om," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(Om," ")}}function _m(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function Cm(e,t){var n="";if("string"==typeof e)n=e;else do{var r=_m(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Dm(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function Im(){return document.scrollingElement||document.documentElement}function Am(e,t,n,r,o){if(e.getBoundingClientRect||e===window){var i,a,l,s,u,c,f;if(e!==window&&e.parentNode&&e!==Im()?(a=(i=e.getBoundingClientRect()).top,l=i.left,s=i.bottom,u=i.right,c=i.height,f=i.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!hm))do{if(o&&o.getBoundingClientRect&&("none"!==_m(o,"transform")||n&&"static"!==_m(o,"position"))){var d=o.getBoundingClientRect();a-=d.top+parseInt(_m(o,"border-top-width")),l-=d.left+parseInt(_m(o,"border-left-width")),s=a+i.height,u=l+i.width;break}}while(o=o.parentNode);if(r&&e!==window){var h=Cm(o||e),m=h&&h.a,p=h&&h.d;h&&(s=(a/=p)+(c/=p),u=(l/=m)+(f/=m))}return{top:a,left:l,bottom:s,right:u,width:f,height:c}}}function Fm(e,t,n){for(var r=Rm(e,!0),o=Am(e)[t];r;){if(!(o>=Am(r)[n]))return r;if(r===Im())break;r=Rm(r,!1)}return!1}function Mm(e,t,n,r){for(var o=0,i=0,a=e.children;i<a.length;){if("none"!==a[i].style.display&&a[i]!==Lp.ghost&&(r||a[i]!==Lp.dragged)&&Em(a[i],n.draggable,e,!1)){if(o===t)return a[i];o++}i++}return null}function Tm(e,t){for(var n=e.lastElementChild;n&&(n===Lp.ghost||"none"===_m(n,"display")||t&&!km(n,t));)n=n.previousElementSibling;return n||null}function Pm(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Lp.clone||t&&!km(e,t)||n++;return n}function Nm(e){var t=0,n=0,r=Im();if(e)do{var o=Cm(e);t+=e.scrollLeft*o.a,n+=e.scrollTop*o.d}while(e!==r&&(e=e.parentNode));return[t,n]}function Rm(e,t){if(!e||!e.getBoundingClientRect)return Im();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=_m(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Im();if(r||t)return n;r=!0}}}while(n=n.parentNode);return Im()}function Um(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function qm(e,t){return function(){if(!jm){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),jm=setTimeout((function(){jm=void 0}),t)}}}function Lm(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function zm(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Bm(e,t,n){var r={};return Array.from(e.children).forEach((function(o){var i,a,l,s;if(Em(o,t.draggable,e,!1)&&!o.animated&&o!==n){var u=Am(o);r.left=Math.min(null!==(i=r.left)&&void 0!==i?i:1/0,u.left),r.top=Math.min(null!==(a=r.top)&&void 0!==a?a:1/0,u.top),r.right=Math.max(null!==(l=r.right)&&void 0!==l?l:-1/0,u.right),r.bottom=Math.max(null!==(s=r.bottom)&&void 0!==s?s:-1/0,u.bottom)}})),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Vm="Sortable"+(new Date).getTime();var Wm=[],Hm={initializeByDefault:!0},Gm={mount:function(e){for(var t in Hm)Hm.hasOwnProperty(t)&&!(t in e)&&(e[t]=Hm[t]);Wm.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),Wm.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=e+"Global";Wm.forEach((function(r){t[r.pluginName]&&(t[r.pluginName][o]&&t[r.pluginName][o](sm({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](sm({sortable:t},n)))}))},initializePlugins:function(e,t,n){for(var r in Wm.forEach((function(r){var o=r.pluginName;if(e.options[o]||r.initializeByDefault){var i=new r(e,t,e.options);i.sortable=e,i.options=e.options,e[o]=i,fm(n,i.defaults)}})),e.options)if(e.options.hasOwnProperty(r)){var o=this.modifyOption(e,r,e.options[r]);void 0!==o&&(e.options[r]=o)}},getEventProperties:function(e,t){var n={};return Wm.forEach((function(r){"function"==typeof r.eventProperties&&fm(n,r.eventProperties.call(t[r.pluginName],e))})),n},modifyOption:function(e,t,n){var r;return Wm.forEach((function(o){e[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[t]&&(r=o.optionListeners[t].call(e[o.pluginName],n))})),r}},Km=["evt"],Jm=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,Km);Gm.pluginEvent.bind(Lp)(e,t,sm({dragEl:Xm,parentEl:Zm,ghostEl:Qm,rootEl:ep,nextEl:tp,lastDownEl:np,cloneEl:rp,cloneHidden:op,dragStarted:yp,putSortable:cp,activeSortable:Lp.active,originalEvent:r,oldIndex:ip,oldDraggableIndex:lp,newIndex:ap,newDraggableIndex:sp,hideGhostForTarget:Np,unhideGhostForTarget:Rp,cloneNowHidden:function(){op=!0},cloneNowShown:function(){op=!1},dispatchSortableEvent:function(e){Ym({sortable:t,name:e,originalEvent:r})}},o))};function Ym(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,f=e.newDraggableIndex,d=e.originalEvent,h=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[Vm]){var p,v=t.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||hm||mm?(p=document.createEvent("Event")).initEvent(r,!0,!0):p=new CustomEvent(r,{bubbles:!0,cancelable:!0}),p.to=a||n,p.from=l||n,p.item=o||n,p.clone=i,p.oldIndex=s,p.newIndex=u,p.oldDraggableIndex=c,p.newDraggableIndex=f,p.originalEvent=d,p.pullMode=h?h.lastPutMode:void 0;var b=sm(sm({},m),Gm.getEventProperties(r,t));for(var g in b)p[g]=b[g];n&&n.dispatchEvent(p),v[y]&&v[y].call(t,p)}}(sm({putSortable:cp,cloneEl:rp,targetEl:Xm,rootEl:ep,oldIndex:ip,oldDraggableIndex:lp,newIndex:ap,newDraggableIndex:sp},e))}var Xm,Zm,Qm,ep,tp,np,rp,op,ip,ap,lp,sp,up,cp,fp,dp,hp,mp,pp,vp,yp,bp,gp,wp,$p,kp=!1,Sp=!1,Ep=[],jp=!1,Op=!1,xp=[],_p=!1,Cp=[],Dp="undefined"!=typeof document,Ip=ym,Ap=mm||hm?"cssFloat":"float",Fp=Dp&&!bm&&!ym&&"draggable"in document.createElement("div"),Mp=function(){if(Dp){if(hm)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Tp=function(e,t){var n=_m(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Mm(e,0,t),i=Mm(e,1,t),a=o&&_m(o),l=i&&_m(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Am(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Am(i).width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":"grid"===n.display?n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":o&&a.float&&"none"!==a.float?!i||"both"!==l.clear&&l.clear!==("left"===a.float?"left":"right")?"horizontal":"vertical":o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=r&&"none"===n[Ap]||i&&"none"===n[Ap]&&s+u>r)?"vertical":"horizontal"},Pp=function(e){function t(e,n){return function(r,o,i,a){if(null==e&&(n||r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,i,a),n)(r,o,i,a);var l=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==um(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Np=function(){!Mp&&Qm&&_m(Qm,"display","none")},Rp=function(){!Mp&&Qm&&_m(Qm,"display","")};Dp&&!bm&&document.addEventListener("click",(function(e){if(Sp)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Sp=!1,!1}),!0);var Up=function(e){if(Xm){var t=function(e,t){var n;return Ep.some((function(r){var o=r[Vm].options.emptyInsertThreshold;if(o&&!Tm(r)){var i=Am(r);return e>=i.left-o&&e<=i.right+o&&t>=i.top-o&&t<=i.bottom+o?n=r:void 0}})),n}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Vm]._onDragOver(n)}}},qp=function(e){Xm&&Xm.parentNode[Vm]._isOutsideThisEl(e.target)};function Lp(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=fm({},t),e[Vm]=this;var n,r,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Tp(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Lp.supportPointer&&"PointerEvent"in window&&(!vm||ym),emptyInsertThreshold:5};for(var i in Gm.initializePlugins(this,e,o),o)!(i in t)&&(t[i]=o[i]);for(var a in Pp(t),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!t.forceFallback&&Fp,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?wm(e,"pointerdown",this._onTapStart):(wm(e,"mousedown",this._onTapStart),wm(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(wm(e,"dragover",this),wm(e,"dragenter",this)),Ep.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),fm(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==_m(e,"display")&&e!==Lp.ghost){r.push({target:e,rect:Am(e)});var t=sm({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=Cm(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,i=0;r.forEach((function(e){var n=0,r=e.target,a=r.fromRect,l=Am(r),s=r.prevFromRect,u=r.prevToRect,c=e.rect,f=Cm(r,!0);f&&(l.top-=f.f,l.left-=f.e),r.toRect=l,r.thisAnimationDuration&&Um(s,l)&&!Um(a,l)&&(c.top-l.top)/(c.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(c,s,u,t.options)),Um(l,a)||(r.prevFromRect=a,r.prevToRect=l,n||(n=t.options.animation),t.animate(r,c,l,n)),n&&(o=!0,i=Math.max(i,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout((function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null}),n),r.thisAnimationDuration=n)})),clearTimeout(n),o?n=setTimeout((function(){"function"==typeof e&&e()}),i):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){_m(e,"transition",""),_m(e,"transform","");var o=Cm(this.el),i=(t.left-n.left)/(o&&o.a||1),a=(t.top-n.top)/(o&&o.d||1);e.animatingX=!!i,e.animatingY=!!a,_m(e,"transform","translate3d("+i+"px,"+a+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),_m(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),_m(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){_m(e,"transition",""),_m(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),r)}}}))}function zp(e,t,n,r,o,i,a,l){var s,u,c=e[Vm],f=c.options.onMove;return!window.CustomEvent||hm||mm?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=o||t,s.relatedRect=i||Am(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),f&&(u=f.call(c,s,a)),u}function Bp(e){e.draggable=!1}function Vp(){_p=!1}function Wp(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Hp(e){return setTimeout(e,0)}function Gp(e){return clearTimeout(e)}Lp.prototype={constructor:Lp,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(bp=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Xm):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,i=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if(function(e){Cp.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Cp.push(r)}}(n),!Xm&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||r.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!vm||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=Em(l,r.draggable,n,!1))&&l.animated||np===l)){if(ip=Pm(l),lp=Pm(l,r.draggable),"function"==typeof u){if(u.call(this,e,l,this))return Ym({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),Jm("filter",t,{evt:e}),void(o&&e.preventDefault())}else if(u&&(u=u.split(",").some((function(r){if(r=Em(s,r.trim(),n,!1))return Ym({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),Jm("filter",t,{evt:e}),!0}))))return void(o&&e.preventDefault());r.handle&&!Em(s,r.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var r,o=this,i=o.el,a=o.options,l=i.ownerDocument;if(n&&!Xm&&n.parentNode===i){var s=Am(n);if(ep=i,Zm=(Xm=n).parentNode,tp=Xm.nextSibling,np=n,up=a.group,Lp.dragged=Xm,pp=(fp={target:Xm,clientX:(t||e).clientX,clientY:(t||e).clientY}).clientX-s.left,vp=fp.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Xm.style["will-change"]="all",r=function(){Jm("delayEnded",o,{evt:e}),Lp.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!pm&&o.nativeDraggable&&(Xm.draggable=!0),o._triggerDragStart(e,t),Ym({sortable:o,name:"choose",originalEvent:e}),xm(Xm,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){Dm(Xm,e.trim(),Bp)})),wm(l,"dragover",Up),wm(l,"mousemove",Up),wm(l,"touchmove",Up),a.supportPointer?(wm(l,"pointerup",o._onDrop),!this.nativeDraggable&&wm(l,"pointercancel",o._onDrop)):(wm(l,"mouseup",o._onDrop),wm(l,"touchend",o._onDrop),wm(l,"touchcancel",o._onDrop)),pm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xm.draggable=!0),Jm("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(mm||hm))r();else{if(Lp.eventCanceled)return void this._onDrop();a.supportPointer?(wm(l,"pointerup",o._disableDelayedDrag),wm(l,"pointercancel",o._disableDelayedDrag)):(wm(l,"mouseup",o._disableDelayedDrag),wm(l,"touchend",o._disableDelayedDrag),wm(l,"touchcancel",o._disableDelayedDrag)),wm(l,"mousemove",o._delayedDragTouchMoveHandler),wm(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&wm(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Xm&&Bp(Xm),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;$m(e,"mouseup",this._disableDelayedDrag),$m(e,"touchend",this._disableDelayedDrag),$m(e,"touchcancel",this._disableDelayedDrag),$m(e,"pointerup",this._disableDelayedDrag),$m(e,"pointercancel",this._disableDelayedDrag),$m(e,"mousemove",this._delayedDragTouchMoveHandler),$m(e,"touchmove",this._delayedDragTouchMoveHandler),$m(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?wm(document,this.options.supportPointer?"pointermove":t?"touchmove":"mousemove",this._onTouchMove):(wm(Xm,"dragend",this),wm(ep,"dragstart",this._onDragStart));try{document.selection?Hp((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(kp=!1,ep&&Xm){Jm("dragStarted",this,{evt:t}),this.nativeDraggable&&wm(document,"dragover",qp);var n=this.options;!e&&xm(Xm,n.dragClass,!1),xm(Xm,n.ghostClass,!0),Lp.active=this,e&&this._appendGhost(),Ym({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(dp){this._lastX=dp.clientX,this._lastY=dp.clientY,Np();for(var e=document.elementFromPoint(dp.clientX,dp.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(dp.clientX,dp.clientY))!==t;)t=e;if(Xm.parentNode[Vm]._isOutsideThisEl(e),t)do{if(t[Vm]&&t[Vm]._onDragOver({clientX:dp.clientX,clientY:dp.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=Sm(t));Rp()}},_onTouchMove:function(e){if(fp){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=Qm&&Cm(Qm,!0),a=Qm&&i&&i.a,l=Qm&&i&&i.d,s=Ip&&$p&&Nm($p),u=(o.clientX-fp.clientX+r.x)/(a||1)+(s?s[0]-xp[0]:0)/(a||1),c=(o.clientY-fp.clientY+r.y)/(l||1)+(s?s[1]-xp[1]:0)/(l||1);if(!Lp.active&&!kp){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Qm){i?(i.e+=u-(hp||0),i.f+=c-(mp||0)):i={a:1,b:0,c:0,d:1,e:u,f:c};var f="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");_m(Qm,"webkitTransform",f),_m(Qm,"mozTransform",f),_m(Qm,"msTransform",f),_m(Qm,"transform",f),hp=u,mp=c,dp=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Qm){var e=this.options.fallbackOnBody?document.body:ep,t=Am(Xm,!0,Ip,!0,e),n=this.options;if(Ip){for($p=e;"static"===_m($p,"position")&&"none"===_m($p,"transform")&&$p!==document;)$p=$p.parentNode;$p!==document.body&&$p!==document.documentElement?($p===document&&($p=Im()),t.top+=$p.scrollTop,t.left+=$p.scrollLeft):$p=Im(),xp=Nm($p)}xm(Qm=Xm.cloneNode(!0),n.ghostClass,!1),xm(Qm,n.fallbackClass,!0),xm(Qm,n.dragClass,!0),_m(Qm,"transition",""),_m(Qm,"transform",""),_m(Qm,"box-sizing","border-box"),_m(Qm,"margin",0),_m(Qm,"top",t.top),_m(Qm,"left",t.left),_m(Qm,"width",t.width),_m(Qm,"height",t.height),_m(Qm,"opacity","0.8"),_m(Qm,"position",Ip?"absolute":"fixed"),_m(Qm,"zIndex","100000"),_m(Qm,"pointerEvents","none"),Lp.ghost=Qm,e.appendChild(Qm),_m(Qm,"transform-origin",pp/parseInt(Qm.style.width)*100+"% "+vp/parseInt(Qm.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,o=n.options;Jm("dragStart",this,{evt:e}),Lp.eventCanceled?this._onDrop():(Jm("setupClone",this),Lp.eventCanceled||((rp=zm(Xm)).removeAttribute("id"),rp.draggable=!1,rp.style["will-change"]="",this._hideClone(),xm(rp,this.options.chosenClass,!1),Lp.clone=rp),n.cloneId=Hp((function(){Jm("clone",n),Lp.eventCanceled||(n.options.removeCloneOnHide||ep.insertBefore(rp,Xm),n._hideClone(),Ym({sortable:n,name:"clone"}))})),!t&&xm(Xm,o.dragClass,!0),t?(Sp=!0,n._loopId=setInterval(n._emulateDragOver,50)):($m(document,"mouseup",n._onDrop),$m(document,"touchend",n._onDrop),$m(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,Xm)),wm(document,"drop",n),_m(Xm,"transform","translateZ(0)")),kp=!0,n._dragStartId=Hp(n._dragStarted.bind(n,t,e)),wm(document,"selectstart",n),yp=!0,window.getSelection().removeAllRanges(),vm&&_m(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,o,i=this.el,a=e.target,l=this.options,s=l.group,u=Lp.active,c=up===s,f=l.sort,d=cp||u,h=this,m=!1;if(!_p){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=Em(a,l.draggable,i,!0),C("dragOver"),Lp.eventCanceled)return m;if(Xm.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||h._ignoreWhileAnimating===a)return I(!1);if(Sp=!1,u&&!l.disabled&&(c?f||(r=Zm!==ep):cp===this||(this.lastPutMode=up.checkPull(this,u,Xm,e))&&s.checkPut(this,u,Xm,e))){if(o="vertical"===this._getDirection(e,a),t=Am(Xm),C("dragOverValid"),Lp.eventCanceled)return m;if(r)return Zm=ep,D(),this._hideClone(),C("revert"),Lp.eventCanceled||(tp?ep.insertBefore(Xm,tp):ep.appendChild(Xm)),I(!0);var p=Tm(i,l.draggable);if(!p||function(e,t,n){var r=Am(Tm(n.el,n.options.draggable)),o=Bm(n.el,n.options,Qm);return t?e.clientX>o.right+10||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+10||e.clientX>r.right&&e.clientY>r.top}(e,o,this)&&!p.animated){if(p===Xm)return I(!1);if(p&&i===e.target&&(a=p),a&&(n=Am(a)),!1!==zp(ep,i,Xm,t,a,n,e,!!a))return D(),p&&p.nextSibling?i.insertBefore(Xm,p.nextSibling):i.appendChild(Xm),Zm=i,A(),I(!0)}else if(p&&function(e,t,n){var r=Am(Mm(n.el,0,n.options,!0)),o=Bm(n.el,n.options,Qm);return t?e.clientX<o.left-10||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-10||e.clientY<r.bottom&&e.clientX<r.left}(e,o,this)){var v=Mm(i,0,l,!0);if(v===Xm)return I(!1);if(n=Am(a=v),!1!==zp(ep,i,Xm,t,a,n,e,!1))return D(),i.insertBefore(Xm,v),Zm=i,A(),I(!0)}else if(a.parentNode===i){n=Am(a);var y,b,g,w=Xm.parentNode!==i,$=!function(e,t,n){var r=n?e.left:e.top,o=n?t.left:t.top;return r===o||(n?e.right:e.bottom)===(n?t.right:t.bottom)||r+(n?e.width:e.height)/2===o+(n?t.width:t.height)/2}(Xm.animated&&Xm.toRect||t,a.animated&&a.toRect||n,o),k=o?"top":"left",S=Fm(a,"top","top")||Fm(Xm,"top","top"),E=S?S.scrollTop:void 0;if(bp!==a&&(b=n[k],jp=!1,Op=!$&&l.invertSwap||w),y=function(e,t,n,r,o,i,a,l){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!a)if(l&&wp<u*o){if(!jp&&(1===gp?s>c+u*i/2:s<f-u*i/2)&&(jp=!0),jp)d=!0;else if(1===gp?s<c+wp:s>f-wp)return-gp}else if(s>c+u*(1-o)/2&&s<f-u*(1-o)/2)return function(e){return Pm(Xm)<Pm(e)?1:-1}(t);return(d=d||a)&&(s<c+u*i/2||s>f-u*i/2)?s>c+u/2?1:-1:0}(e,a,n,o,$?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Op,bp===a),0!==y){var j=Pm(Xm);do{g=Zm.children[j-=y]}while(g&&("none"===_m(g,"display")||g===Qm))}if(0===y||g===a)return I(!1);bp=a,gp=y;var O=a.nextElementSibling,x=!1,_=zp(ep,i,Xm,t,a,n,e,x=1===y);if(!1!==_)return 1!==_&&-1!==_||(x=1===_),_p=!0,setTimeout(Vp,30),D(),x&&!O?i.appendChild(Xm):a.parentNode.insertBefore(Xm,x?O:a),S&&Lm(S,0,E-S.scrollTop),Zm=Xm.parentNode,void 0===b||Op||(wp=Math.abs(b-Am(a)[k])),A(),I(!0)}if(i.contains(Xm))return I(!1)}return!1}function C(l,s){Jm(l,h,sm({evt:e,isOwner:c,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:d,target:a,completed:I,onMove:function(n,r){return zp(ep,i,Xm,t,n,Am(n),e,r)},changed:A},s))}function D(){C("dragOverAnimationCapture"),h.captureAnimationState(),h!==d&&d.captureAnimationState()}function I(t){return C("dragOverCompleted",{insertion:t}),t&&(c?u._hideClone():u._showClone(h),h!==d&&(xm(Xm,cp?cp.options.ghostClass:u.options.ghostClass,!1),xm(Xm,l.ghostClass,!0)),cp!==h&&h!==Lp.active?cp=h:h===Lp.active&&cp&&(cp=null),d===h&&(h._ignoreWhileAnimating=a),h.animateAll((function(){C("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a===Xm&&!Xm.animated||a===i&&!a.animated)&&(bp=null),l.dragoverBubble||e.rootEl||a===document||(Xm.parentNode[Vm]._isOutsideThisEl(e.target),!t&&Up(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function A(){ap=Pm(Xm),sp=Pm(Xm,l.draggable),Ym({sortable:h,name:"change",toEl:i,newIndex:ap,newDraggableIndex:sp,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){$m(document,"mousemove",this._onTouchMove),$m(document,"touchmove",this._onTouchMove),$m(document,"pointermove",this._onTouchMove),$m(document,"dragover",Up),$m(document,"mousemove",Up),$m(document,"touchmove",Up)},_offUpEvents:function(){var e=this.el.ownerDocument;$m(e,"mouseup",this._onDrop),$m(e,"touchend",this._onDrop),$m(e,"pointerup",this._onDrop),$m(e,"pointercancel",this._onDrop),$m(e,"touchcancel",this._onDrop),$m(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ap=Pm(Xm),sp=Pm(Xm,n.draggable),Jm("drop",this,{evt:e}),Zm=Xm&&Xm.parentNode,ap=Pm(Xm),sp=Pm(Xm,n.draggable),Lp.eventCanceled||(kp=!1,Op=!1,jp=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Gp(this.cloneId),Gp(this._dragStartId),this.nativeDraggable&&($m(document,"drop",this),$m(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),vm&&_m(document.body,"user-select",""),_m(Xm,"transform",""),e&&(yp&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Qm&&Qm.parentNode&&Qm.parentNode.removeChild(Qm),(ep===Zm||cp&&"clone"!==cp.lastPutMode)&&rp&&rp.parentNode&&rp.parentNode.removeChild(rp),Xm&&(this.nativeDraggable&&$m(Xm,"dragend",this),Bp(Xm),Xm.style["will-change"]="",yp&&!kp&&xm(Xm,cp?cp.options.ghostClass:this.options.ghostClass,!1),xm(Xm,this.options.chosenClass,!1),Ym({sortable:this,name:"unchoose",toEl:Zm,newIndex:null,newDraggableIndex:null,originalEvent:e}),ep!==Zm?(ap>=0&&(Ym({rootEl:Zm,name:"add",toEl:Zm,fromEl:ep,originalEvent:e}),Ym({sortable:this,name:"remove",toEl:Zm,originalEvent:e}),Ym({rootEl:Zm,name:"sort",toEl:Zm,fromEl:ep,originalEvent:e}),Ym({sortable:this,name:"sort",toEl:Zm,originalEvent:e})),cp&&cp.save()):ap!==ip&&ap>=0&&(Ym({sortable:this,name:"update",toEl:Zm,originalEvent:e}),Ym({sortable:this,name:"sort",toEl:Zm,originalEvent:e})),Lp.active&&(null!=ap&&-1!==ap||(ap=ip,sp=lp),Ym({sortable:this,name:"end",toEl:Zm,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Jm("nulling",this),ep=Xm=Zm=Qm=tp=rp=np=op=fp=dp=yp=ap=sp=ip=lp=bp=gp=cp=up=Lp.dragged=Lp.ghost=Lp.clone=Lp.active=null,Cp.forEach((function(e){e.checked=!0})),Cp.length=hp=mp=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Xm&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,i=this.options;r<o;r++)Em(e=n[r],i.draggable,this.el,!1)&&t.push(e.getAttribute(i.dataIdAttr)||Wp(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach((function(e,t){var o=r.children[t];Em(o,this.options.draggable,r,!1)&&(n[e]=o)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Em(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=Gm.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Pp(n)},destroy:function(){Jm("destroy",this);var e=this.el;e[Vm]=null,$m(e,"mousedown",this._onTapStart),$m(e,"touchstart",this._onTapStart),$m(e,"pointerdown",this._onTapStart),this.nativeDraggable&&($m(e,"dragover",this),$m(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Ep.splice(Ep.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!op){if(Jm("hideClone",this),Lp.eventCanceled)return;_m(rp,"display","none"),this.options.removeCloneOnHide&&rp.parentNode&&rp.parentNode.removeChild(rp),op=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(op){if(Jm("showClone",this),Lp.eventCanceled)return;Xm.parentNode!=ep||this.options.group.revertClone?tp?ep.insertBefore(rp,tp):ep.appendChild(rp):ep.insertBefore(rp,Xm),this.options.group.revertClone&&this.animate(Xm,rp),_m(rp,"display",""),op=!1}}else this._hideClone()}},Dp&&wm(document,"touchmove",(function(e){(Lp.active||kp)&&e.cancelable&&e.preventDefault()})),Lp.utils={on:wm,off:$m,css:_m,find:Dm,is:function(e,t){return!!Em(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:qm,closest:Em,toggleClass:xm,clone:zm,index:Pm,nextTick:Hp,cancelNextTick:Gp,detectDirection:Tp,getChild:Mm,expando:Vm},Lp.get=function(e){return e[Vm]},Lp.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Lp.utils=sm(sm({},Lp.utils),e.utils)),Gm.mount(e)}))},Lp.create=function(e,t){return new Lp(e,t)},Lp.version="1.15.6";var Kp,Jp,Yp,Xp,Zp,Qp,ev=[],tv=!1;function nv(){ev.forEach((function(e){clearInterval(e.pid)})),ev=[]}function rv(){clearInterval(Qp)}var ov=qm((function(e,t,n,r){if(t.scroll){var o,i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,u=Im(),c=!1;Jp!==n&&(Jp=n,nv(),o=t.scrollFn,!0===(Kp=t.scroll)&&(Kp=Rm(n,!0)));var f=0,d=Kp;do{var h=d,m=Am(h),p=m.top,v=m.bottom,y=m.left,b=m.right,g=m.width,w=m.height,$=void 0,k=void 0,S=h.scrollWidth,E=h.scrollHeight,j=_m(h),O=h.scrollLeft,x=h.scrollTop;h===u?($=g<S&&("auto"===j.overflowX||"scroll"===j.overflowX||"visible"===j.overflowX),k=w<E&&("auto"===j.overflowY||"scroll"===j.overflowY||"visible"===j.overflowY)):($=g<S&&("auto"===j.overflowX||"scroll"===j.overflowX),k=w<E&&("auto"===j.overflowY||"scroll"===j.overflowY));var _=$&&(Math.abs(b-i)<=l&&O+g<S)-(Math.abs(y-i)<=l&&!!O),C=k&&(Math.abs(v-a)<=l&&x+w<E)-(Math.abs(p-a)<=l&&!!x);if(!ev[f])for(var D=0;D<=f;D++)ev[D]||(ev[D]={});ev[f].vx==_&&ev[f].vy==C&&ev[f].el===h||(ev[f].el=h,ev[f].vx=_,ev[f].vy=C,clearInterval(ev[f].pid),0==_&&0==C||(c=!0,ev[f].pid=setInterval(function(){r&&0===this.layer&&Lp.active._onTouchMove(Zp);var t=ev[this.layer].vy?ev[this.layer].vy*s:0,n=ev[this.layer].vx?ev[this.layer].vx*s:0;"function"==typeof o&&"continue"!==o.call(Lp.dragged.parentNode[Vm],n,t,e,Zp,ev[this.layer].el)||Lm(ev[this.layer].el,n,t)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&d!==u&&(d=Rm(d,!1)));tv=c}}),30),iv=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.dispatchSortableEvent,i=e.unhideGhostForTarget;if(t){var a=n||e.activeSortable;(0,e.hideGhostForTarget)();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,s=document.elementFromPoint(l.clientX,l.clientY);i(),a&&!a.el.contains(s)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function av(){}function lv(){}av.prototype={startIndex:null,dragStart:function(e){this.startIndex=e.oldDraggableIndex},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Mm(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:iv},fm(av,{pluginName:"revertOnSpill"}),lv.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:iv},fm(lv,{pluginName:"removeOnSpill"}),Lp.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?wm(document,"dragover",this._handleAutoScroll):wm(document,this.options.supportPointer?"pointermove":t.touches?"touchmove":"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?$m(document,"dragover",this._handleAutoScroll):($m(document,"pointermove",this._handleFallbackAutoScroll),$m(document,"touchmove",this._handleFallbackAutoScroll),$m(document,"mousemove",this._handleFallbackAutoScroll)),rv(),nv(),clearTimeout(jm),jm=void 0},nulling:function(){Zp=Jp=Kp=tv=Qp=Yp=Xp=null,ev.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(r,o);if(Zp=e,t||this.options.forceAutoScrollFallback||mm||hm||vm){ov(e,this.options,i,t);var a=Rm(i,!0);!tv||Qp&&r===Yp&&o===Xp||(Qp&&rv(),Qp=setInterval((function(){var i=Rm(document.elementFromPoint(r,o),!0);i!==a&&(a=i,nv()),ov(e,n.options,i,t)}),10),Yp=r,Xp=o)}else{if(!this.options.bubbleScroll||Rm(i,!0)===Im())return void nv();ov(e,this.options,Rm(i,!1),!1)}}},fm(e,{pluginName:"scroll",initializeByDefault:!0})}),Lp.mount(lv,av);const sv=Ot.createContext(null),uv="arrayReorder",cv="[data-drag-handle]",fv='.array-item[data-reorderable="true"]',dv="has-an-item-which-is-being-dragged",hv="is-elevated";class mv extends xt.Component{constructor(e){super(e),this.cachedContextValue=null,this.handleAddClick=e=>{e.stopPropagation(),this.props.onAddClick(e)},this.setContainer=e=>{this.container!==e&&(this.teardownDragController(),this.container=null!=e?e:void 0,this.setupDragController())},this.handleSortStart=e=>{this.canReorderItems()&&(this.dragSnapshot=[...this.state.order],this.draggedItemIndex=this.getReorderId(e.item),this.container&&this.container.classList.add(dv),e.item instanceof HTMLElement&&this.applyDropElevation(e.item))},this.handleSortEnd=e=>{var t;if(!this.canReorderItems())return;this.container&&this.container.classList.remove(dv);const n=this.dragSnapshot,r=this.draggedItemIndex;this.dragSnapshot=void 0,this.draggedItemIndex=void 0,e.item instanceof HTMLElement&&(this.dropElevationTarget=e.item);const o=this.readOrderFromDom();if(this.arraysEqual(this.state.order,o)||this.setState({order:o}),void 0===n||void 0===r||!(e.item instanceof HTMLElement))return void this.scheduleDropElevationRemoval();const i=n.indexOf(r),a=o.indexOf(r);-1!==i&&-1!==a&&i!==a?(null===(t=this.container)||void 0===t||t.dispatchEvent(new CustomEvent(uv,{bubbles:!0,detail:{fromIndex:i,toIndex:a}})),this.scheduleDropElevationRemoval()):this.scheduleDropElevationRemoval()},this.state={order:this.extractIndices(e.items)}}componentWillUnmount(){this.teardownDragController()}componentDidMount(){this.setupDragController()}componentDidUpdate(e){if(e.items!==this.props.items){const e=this.extractIndices(this.props.items);if(!this.arraysEqual(this.state.order,e))return void this.setState({order:e},(()=>{this.setupDragController()}))}e.items===this.props.items&&e.schema===this.props.schema&&e.disabled===this.props.disabled&&e.readonly===this.props.readonly||this.setupDragController()}render(){const e=this.getOrderedItems(),t=this.getContextValue();return xt.createElement(sv.Provider,{value:t},xt.createElement("div",{},rm(this.props.title),om(this.props.schema.description),xt.createElement("div",{className:"array-items",ref:this.setContainer},e),this.renderAddButton()))}renderAddButton(){if(this.props.canAdd)return xt.createElement("limel-button",{label:this.props.title||"Add",onClick:this.handleAddClick,icon:"plus_math",class:"button-add-new"})}getOrderedItems(){var e;const t=null!==(e=this.props.items)&&void 0!==e?e:[];if(0===t.length)return[];const n=new Map;for(const[e,r]of t.entries())n.set(e,r);const r=[],o=new Set;for(const e of this.state.order){const t=n.get(e);t&&(r.push(t),o.add(e))}for(const[e,t]of n.entries())o.has(e)||r.push(t);return r}setupDragController(){if(this.container&&this.canReorderItems())return this.container.querySelectorAll(`:scope > ${fv}`).length<2?void this.teardownDragController():this.sortable?(this.sortable.option("handle",cv),this.sortable.option("draggable",fv),this.sortable.option("disabled",!1),this.sortable.option("delay",200),void this.sortable.option("delayOnTouchOnly",!0)):void(this.sortable=Lp.create(this.container,{animation:150,handle:cv,draggable:fv,delay:200,delayOnTouchOnly:!0,onStart:this.handleSortStart,onEnd:this.handleSortEnd}));this.teardownDragController()}teardownDragController(){this.sortable&&(this.sortable.destroy(),this.sortable=void 0),this.clearDropElevationTimer(),this.dropElevationTarget&&(this.dropElevationTarget.classList.remove(hv),this.dropElevationTarget=void 0),this.container&&this.container.classList.remove(dv),this.dragSnapshot=void 0,this.draggedItemIndex=void 0}canReorderItems(){if(this.props.disabled||this.props.readonly)return!1;const e=this.props.schema;return!1!==((null==e?void 0:e.lime)||{}).allowItemReorder}readOrderFromDom(){if(!this.container)return[];const e=[...this.container.children].filter((e=>{var t,n;return Boolean(null===(n=null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,"array-item"))})),t=[];for(const n of e){const e=this.getReorderId(n);void 0!==e&&t.push(e)}return t}getReorderId(e){var t;if(!e)return;const n=null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.reorderId;if(void 0===n)return;const r=Number.parseInt(n,10);return Number.isNaN(r)?void 0:r}applyDropElevation(e){this.dropElevationTarget&&this.dropElevationTarget!==e&&this.dropElevationTarget.classList.remove(hv),this.clearDropElevationTimer(),e.classList.add(hv),this.dropElevationTarget=e}scheduleDropElevationRemoval(){if(!this.dropElevationTarget)return;const e=this.dropElevationTarget;this.clearDropElevationTimer(),this.dropElevationTimeout=globalThis.setTimeout((()=>{e.classList.remove(hv),this.dropElevationTarget===e&&(this.dropElevationTarget=void 0),this.dropElevationTimeout=void 0}),1e3)}clearDropElevationTimer(){void 0!==this.dropElevationTimeout&&(clearTimeout(this.dropElevationTimeout),this.dropElevationTimeout=void 0)}arraysEqual(e,t){if(e.length!==t.length)return!1;let n=0;for(const r of e){if(r!==t[n])return!1;n+=1}return!0}extractIndices(e=[]){return(null!=e?e:[]).map(((e,t)=>t))}getContextValue(){var e;const t=this.props.schema,n=null!==(e=this.props.formData)&&void 0!==e?e:[];return this.cachedContextValue&&this.cachedSchema===t&&this.cachedFormData===n||(this.cachedSchema=t,this.cachedFormData=n,this.cachedContextValue={arraySchema:t,formData:n}),this.cachedContextValue}}class pv extends xt.Component{constructor(e){super(e),this.props=e,this.state={isOpen:!1},this.handleOpen=()=>{this.setState({isOpen:!0})},this.handleAction=this.handleAction.bind(this),this.isDeepEmpty=this.isDeepEmpty.bind(this),this.state={isOpen:this.isDeepEmpty(e.data)}}componentDidMount(){const e=this.section;e.addEventListener("action",this.handleAction),e.addEventListener("open",this.handleOpen),this.setActions(e)}componentDidUpdate(){this.setActions(this.section)}componentWillUnmount(){const e=this.section;e.removeEventListener("action",this.handleAction),e.removeEventListener("open",this.handleOpen)}render(){const{data:e,schema:t,formSchema:n}=this.props;let r;this.state.isOpen&&(r=this.props.children);const o=this.props.allowItemReorder?xt.createElement("limel-drag-handle",{slot:"header",class:"drag-handle"}):null;return xt.createElement("limel-collapsible-section",{header:im(e,t,n)||"New item",class:"array-item limel-form-array-item--object",ref:e=>{this.section=e},"is-open":this.state.isOpen,"data-reorder-id":String(this.props.index),"data-reorderable":this.props.allowItemReorder?"true":"false"},o,r)}setActions(e){const{buttonsProps:t,allowItemRemoval:n}=this.props,r=[];n&&r.push({id:"remove",icon:"trash",disabled:!t.hasRemove,run:t.onRemoveItem}),e.actions=r}handleAction(e){e.stopPropagation(),e.detail.run(e)}isDeepEmpty(e){return"object"==typeof e&&(!!se(e)||Object.values(e).every(this.isDeepEmpty))}}class vv extends xt.Component{constructor(e){super(e),this.props=e,this.handleRemove=e=>{this.props.buttonsProps.onRemoveItem(e)},this.setRemoveButton=e=>{this.removeButton&&this.removeButton.removeEventListener("click",this.handleRemove),this.removeButton=e||void 0,this.removeButton&&this.removeButton.addEventListener("click",this.handleRemove)}}componentWillUnmount(){this.setRemoveButton(void 0)}render(){const{allowItemReorder:e}=this.props;return xt.createElement("div",{className:"array-item limel-form-array-item--simple","data-reorder-id":String(this.props.index),"data-reorderable":e?"true":"false"},this.props.children,this.renderRemoveButton(),this.renderDragHandle())}renderDragHandle(){if(this.props.allowItemReorder)return xt.createElement("limel-drag-handle",{class:"drag-handle"})}renderRemoveButton(){if(this.props.allowItemRemoval)return xt.createElement("limel-icon-button",{icon:"trash",disabled:!this.props.buttonsProps.hasRemove,ref:this.setRemoveButton})}}const yv=e=>{const t=Ot.useContext(sv),n=null==t?void 0:t.arraySchema,r=null==t?void 0:t.formData,o=e.registry.formContext,i=function(e,t){if(!1===((null==t?void 0:t.lime)||{}).allowItemReorder)return!1;const{buttonsProps:n}=e;return Boolean((null==n?void 0:n.hasMoveDown)||(null==n?void 0:n.hasMoveUp))}(e,n),a=function(e){return!1!==((null==e?void 0:e.lime)||{}).allowItemRemoval}(n);if(n&&Xh(n.items)){const t=Array.isArray(r)?r[e.index]:void 0;return xt.createElement(pv,{key:e.itemKey,buttonsProps:e.buttonsProps,index:e.index,data:t,schema:n,formSchema:null==o?void 0:o.schema,allowItemRemoval:a,allowItemReorder:i},e.children)}return xt.createElement(vv,{key:e.itemKey,buttonsProps:e.buttonsProps,index:e.index,allowItemRemoval:a,allowItemReorder:i},e.children)},bv="--number-of-columns";class gv extends xt.Component{constructor(e){super(e),this.props=e,this.handleResize=this.handleResize.bind(this),this.state={maxColumns:5},this.elementRef=xt.createRef()}componentDidMount(){this.observer=new ResizeObserver(this.handleResize),this.observer.observe(this.elementRef.current),window.addEventListener("resize",this.handleResize,{capture:!0,passive:!0})}componentWillUnmount(){this.observer.unobserve(this.elementRef.current),window.removeEventListener("resize",this.handleResize,{capture:!0})}handleResize(){requestAnimationFrame((()=>{const e=this.elementRef.current;if(!e)return;const t=e.getBoundingClientRect().width,n=Math.min(5,Math.max(1,Math.floor(t/240))),r=this.getColumnCount(n);e.style.getPropertyValue(bv)!==`${r}`&&e.style.setProperty(bv,`${r}`),n!==this.state.maxColumns&&this.setState({maxColumns:n})}))}render(){const e=["limel-form-layout--grid"],t=this.getColumnCount(this.state.maxColumns);return e.push(`layout-${t}-columns`),this.hasAutoFlowDense()&&e.push("auto-reorder-to-avoid-empty-cells"),xt.createElement("div",{className:e.join(" "),ref:this.elementRef},this.props.children)}getColumnCount(e){return Math.min(this.props.options.columns||5,e)}hasAutoFlowDense(){return!1!==this.props.options.dense}}const wv=Ot.createContext(!1);class $v extends xt.Component{constructor(e){super(e),this.props=e}render(){const e=["row"];return this.icon&&e.push("has-icon"),xt.createElement("div",{className:e.join(" ")},this.renderMainInformation(),this.renderDescription())}renderIcon(){if(this.icon)return xt.createElement("limel-icon",{name:this.icon})}renderMainInformation(){return xt.createElement("div",{className:"main-information"},this.renderIcon(),this.renderTitle(),this.renderChildren())}renderTitle(){var e;return xt.createElement("h1",{className:"title"},null===(e=this.schema)||void 0===e?void 0:e.title)}renderDescription(){var e;if(null===(e=this.schema)||void 0===e?void 0:e.description)return xt.createElement("limel-markdown",{class:"description",value:this.schema.description})}renderChildren(){return xt.createElement(wv.Provider,{value:!0},this.props.children)}get schema(){return this.props.children.props.schema}get icon(){var e,t,n;return null===(n=null===(t=null===(e=this.schema)||void 0===e?void 0:e.lime)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.icon}}class kv extends xt.Component{constructor(e){super(e),this.props=e,this.elementRef=xt.createRef()}render(){return xt.createElement("div",{className:["limel-form-row--layout"].join(" "),ref:this.elementRef},this.props.children.map(((e,t)=>xt.createElement($v,{key:t.toString()},e))))}}function Sv(e,t){var n;const r=null===(n=e.lime)||void 0===n?void 0:n.help;if(r)return xt.createElement("limel-help",Object.assign("string"==typeof r?{value:r}:Object.assign({},r),t))}const Ev=e=>{const t=Ot.useContext(sv),n=e.fieldPathId.$id;return t&&"root"!==n?xt.createElement(sv.Provider,{value:null},Ov(e.properties,e.schema)):"root"!==n&&(null===(r=e.schema.lime)||void 0===r?void 0:r.collapsible)?function(e){const t=!(!1!==e.schema.lime.collapsed),n=Sv(e.schema,{slot:"header"});return xt.createElement("limel-collapsible-section",{header:e.title,id:jv(e.registry.formContext.schema,e.fieldPathId),"is-open":t},n,om(e.description),Ov(e.properties,e.schema))}(e):function(e){return xt.createElement(xt.Fragment,{},function(e){const t=Sv(e.schema);return t?xt.createElement(xt.Fragment,{},rm(e.title),t):rm(e.title)}(e),om(e.description),Ov(e.properties,e.schema))}(e);var r};function jv(e,t){var n,r;return`${null!==(r=null===(n=e.$ref)||void 0===n?void 0:n.replace(/\//g,".").slice(2))&&void 0!==r?r:""}${t.path.map((e=>`.properties.${e}`)).join("")}`}function Ov(e,t){var n;return function(e,t){return{default:xv,grid:_v,row:Cv}[(null==t?void 0:t.type)||"default"](e,t)}(e,null===(n=t.lime)||void 0===n?void 0:n.layout)}function xv(e){return xt.createElement("div",{className:"limel-form-layout--default"},e.map((e=>e.content)))}function _v(e,t){return xt.createElement(gv,{options:t},e.map((e=>e.content)))}function Cv(e){return xt.createElement(kv,{},e.map((e=>e.content)))}function Dv(e){return null!=e&&""!==e&&(Array.isArray(e)?e.length>0:e instanceof Date||"object"!=typeof e||!se(e))}function Iv(e){return e.hasErrors&&(e.modified||e.hasValue||!e.required)}function Av(e){return e.required||e.minItems>0}function Fv(e,t,n){return(null==e?void 0:e.length)>0?Ne(i(e[0]).toLowerCase()):n||t}const Mv=Yh({customFormats:{integer:function(e){return Number.isInteger(Number(e))}},ajvOptionsOverrides:{allErrors:!0,multipleOfPrecision:2}}),Tv=(e,t,n,r)=>{if(!$e(t))return t;if(Pv(n))return t;const o=co(Mv,n,r,e),i=((e={},t={})=>mt(Object.keys(e),Object.keys(t)).filter((n=>!fe(t[n],e[n]))))(co(Mv,n,r,t).properties,o.properties);for(const e of i)delete t[e];return t};function Pv(e){return!!e.additionalProperties&&(!("properties"in e)||0===Object.values(e.properties).filter(b(Nv)).length)}function Nv(e){return!0===e[Ht]}const Rv=e=>{const t=null==e?void 0:e.type;return!!t&&(Array.isArray(t)?t.includes("null"):"null"===t)};class Uv extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=e=>{this.props.events.change(e.nativeEvent)},this.handleBlur=this.handleBlur.bind(this)}handleBlur(){this.setState({modified:!0})}getLabel(){if(this.context)return"";const{schema:e,label:t,hideLabel:n}=this.props.widgetProps;return n?"":t||e.title}isInvalid(){const{modified:e}=this.state,{rawErrors:t,required:n,schema:r}=this.props.widgetProps;return Iv({hasErrors:!!t,modified:e,hasValue:Dv(this.getValue()),required:Av({required:n,minItems:r.minItems})})}getHelperText(){const{rawErrors:e,schema:t}=this.props.widgetProps;return this.isInvalid()?Fv(e||[],t.description):this.context?"":t.description}getValue(){const{value:e}=this.props,{value:t}=this.props.widgetProps;return e||t}render(){const{name:e,extraProps:t}=this.props,n=this.isDisabled(),r=this.getValue(),o=this.isReadOnly();return xt.createElement(xt.Fragment,{},xt.createElement(e,Object.assign(Object.assign({value:r,label:this.getLabel(),disabled:n,readonly:o,required:Av({required:this.props.widgetProps.required,minItems:this.props.widgetProps.schema.minItems}),invalid:this.isInvalid(),"helper-text":this.getHelperText()},t),{onChange:this.handleChange,onBlur:this.handleBlur})),Sv(this.props.widgetProps.schema))}isDisabled(){var e,t;const n=this.props.widgetProps,r=n.schema.lime;return n.disabled||(null==r?void 0:r.disabled)||(null===(t=null===(e=null==r?void 0:r.component)||void 0===e?void 0:e.props)||void 0===t?void 0:t.disabled)}isReadOnly(){return this.props.widgetProps.readonly}}Uv.contextType=wv;class qv extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=this.handleChange.bind(this)}render(){var e,t;const n=this.props,{type:r="datetime"}=n,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["type"]);return xt.createElement(Uv,{name:"limel-date-picker",value:this.getValue(),events:{change:this.handleChange},widgetProps:o,extraProps:Object.assign({type:r},null===(t=null===(e=o.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)})}getValue(){return"string"==typeof this.props.value?new Date(this.props.value):this.props.value}handleChange(e){const t=this.props;if(e.stopPropagation(),!t.onChange)return;if(!e.detail)return void t.onChange(null);const n=de(e.detail).format({"date-time":"YYYY-MM-DDTHH:mm:ssZ",date:"YYYY-MM-DD",time:"HH:mm:ss"}[t.schema.format]);t.onChange(n)}}const Lv=e=>{var{value:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["value"]);return"string"==typeof t&&zv.test(t)&&(t=new Date("2000-01-01T"+t)),xt.createElement(qv,Object.assign({type:"time",value:t},n))},zv=/^\d\d:\d\d/,{fields:Bv}=rc(),Vv=Bv.SchemaField,Wv=e=>{if(!customElements.get(e))throw new Error(`Custom form element '${e}' is not defined!`)};class Hv extends xt.Component{constructor(e){super(e),this.state={modified:!1},this.handleChange=this.handleChange.bind(this),this.handleCustomComponentChange=this.handleCustomComponentChange.bind(this)}isInvalid(){const{modified:e}=this.state,{errorSchema:t,required:n,schema:r}=this.props;return Iv({hasErrors:!se(t),modified:e,hasValue:Dv(this.props.formData),required:Av({required:n,minItems:r.minItems})})}getHelperText(){var e,t,n;const{errorSchema:r,schema:o}=this.props,i=!se(r)&&"__errors"in r,a=this.isInvalid()&&i?r.__errors:[],l=null===(n=null===(t=null===(e=o.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)||void 0===n?void 0:n.helperText;return Fv(a,o.description,l)}handleCustomComponentChange(e){const{schema:t}=this.props;e.stopPropagation();let n=e.nativeEvent.detail;((e,t)=>null===e&&!Rv(t))(n,t)&&(n=void 0),this.handleChange(n,this.props.fieldPathId.path)}handleChange(e,t){const{formData:n,schema:r}=this.props,{rootSchema:o}=this.props.registry;if(this.setState({modified:!0}),this.isDeepLeafChange(t))return void this.props.onChange(e,t);const i=Tv(n,e,r,o);this.props.onChange(i,t)}isDeepLeafChange(e){const{fieldPathId:t}=this.props;return!!t&&e.length>t.path.length}buildCustomComponentProps(){const{disabled:e,readonly:t,name:n,registry:r,schema:o,errorSchema:i,fieldPathId:a}=this.props,l=o,s=function(e,t){const n=e.propsFactory;if("function"!=typeof n)return{};return n(t)||{}}(r.formContext,l);return Object.assign(Object.assign({},s),{value:this.props.formData,required:Av({required:this.props.required,minItems:l.minItems}),readonly:t||l.readOnly,disabled:e,invalid:this.isInvalid(),label:this.context?"":l.title,helperText:this.context&&!this.isInvalid()?"":this.getHelperText(),ref:e=>{var t;return e.formInfo={schema:l,rootSchema:r.formContext.schema,errorSchema:i,rootValue:r.formContext.rootValue,name:n,schemaPath:null===(t=null==a?void 0:a.path)||void 0===t?void 0:t.map(String)},()=>{}}})}renderCustomComponent(e){const t=e.schema,{name:n,props:r}=(e=>{var t,n,r,o;return{name:null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.name,props:(null===(o=null===(r=e.lime)||void 0===r?void 0:r.component)||void 0===o?void 0:o.props)||{}}})(t);Wv(n);const o=xt.createElement(n,Object.assign(Object.assign(Object.assign({},r),this.buildCustomComponentProps()),{onChange:this.handleCustomComponentChange}));return xt.createElement(nm,Object.assign(Object.assign({},this.props),{classNames:"rjsf-field rjsf-field-custom"}),o,Sv(t))}render(){var e;if(null===(e=this.props.schema.lime)||void 0===e?void 0:e.hidden)return null;if((()=>{var e,t;const n=null===(t=null===(e=this.props.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.name;if(!n)return!1;try{Wv(n)}catch(e){return console.warn(`Custom component ${n} not defined`),!1}return!0})())return this.renderCustomComponent(this.props);const t=Object.assign(Object.assign({},this.props),{onChange:this.handleChange});return"time"===this.props.schema.format&&(t.uiSchema=Object.assign({"ui:widget":Lv},t.uiSchema)),xt.createElement(Vv,t)}}Hv.contextType=wv;const{fields:Gv}=rc(),Kv=Gv.ArrayField;class Jv extends xt.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleReorder=this.handleReorder.bind(this),this.setWrapper=this.setWrapper.bind(this)}componentWillUnmount(){this.setWrapper(null)}setWrapper(e){this.wrapper&&this.wrapper.removeEventListener(uv,this.handleReorder),this.wrapper=null!=e?e:void 0,this.wrapper&&this.wrapper.addEventListener(uv,this.handleReorder)}handleReorder(e){e.stopPropagation();const{fromIndex:t,toIndex:n}=e.detail,{formData:r,fieldPathId:o}=this.props;if(!Array.isArray(r)||!o)return;const i=[...r],[a]=i.splice(t,1);i.splice(n,0,a),this.props.onChange(i,o.path)}handleChange(e,t){const{formData:n,schema:r}=this.props,{rootSchema:o}=this.props.registry;if(this.isDeepLeafChange(t))return void this.handleDeepLeafChange(e,t);if(!n)return void this.props.onChange(e,t);if(n.length!==e.length)return void this.props.onChange(e,t);const i=[];for(const[t,r]of n.entries())e[t]!==r&&i.push(t);if(1===i.length){const t=i[0];e[t]=Tv(n[t],e[t],r.items,o)}this.props.onChange(e,t)}isDeepLeafChange(e){const{formData:t,fieldPathId:n}=this.props;return Array.isArray(t)&&!!n&&e.length>n.path.length}handleDeepLeafChange(e,t){const{formData:n,fieldPathId:r}=this.props,[o,...i]=t.slice(r.path.length),a=Number(o),l=[...n];l[a]=this.buildResetItem(e,a,i),this.props.onChange(l,r.path)}buildResetItem(e,t,n){const{formData:r,schema:o}=this.props,{rootSchema:i}=this.props.registry,a=Array.isArray(o.items)?o.items[t]:o.items,l=function(e,t){let n=e;for(const e of t){if(!n)return;n=Yv(n,e)}return n}(a,n),s=null!==e||Rv(l)?e:void 0,u=r[t],c=function(e,t,n){if(0===t.length)return n;const r=function(e,t){return Array.isArray(e)||$e(e)?q(e):"number"==typeof t?[]:{}}(e,t[0]);return lt(r,t,n),r}(u,n,s);return Tv(u,c,a,i)}render(){const e=Object.assign(Object.assign({},this.props),{onChange:this.handleChange});return xt.createElement("div",{ref:this.setWrapper},xt.createElement(Kv,e))}}function Yv(e,t){var n;if("number"==typeof t){const n=e.items;return Array.isArray(n)?n[t]:n}return null===(n=e.properties)||void 0===n?void 0:n[t]}class Xv extends xt.Component{constructor(e){super(e),this.state={validationError:"",modified:!1},this.handleChange=this.handleChange.bind(this)}render(){const e=this.props;let t="{}";try{t=JSON.stringify(e.formData,null," ")}catch(e){}const{validationError:n,modified:r}=this.state,{errorSchema:o,formData:i,required:a}=e,l=!se(o)&&(r||null!=i||!a),s=n.length>0||l;let u;return n?u=n:l&&(u=Zv(o)),xt.createElement("limel-code-editor",{value:t,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleChange,invalid:s,helperText:u})}componentDidUpdate(e){e.formData===this.props.formData||""===this.state.validationError&&!this.state.modified||this.setState({validationError:"",modified:!1})}handleChange(e){const t=this.props;if(e.stopPropagation(),!t.onChange)return;let n;try{n=JSON.parse(e.nativeEvent.detail)}catch(e){const t=e instanceof SyntaxError?`Invalid JSON: ${e.message}`:"Should be a valid JSON document";return void this.setState({validationError:t,modified:!0})}t.onChange(n,t.fieldPathId.path),this.setState({validationError:"",modified:!0})}}function Zv(e){if(e&&"object"==typeof e){if("__errors"in e&&Array.isArray(e.__errors)){const t=e.__errors;if(t.length>0)return t[0]}for(const t of Object.keys(e)){if("__errors"===t)continue;const n=e[t];if(n&&"object"==typeof n){const e=Zv(n);if(e)return`${t}: ${e}`}}}}const{fields:Qv}=rc(),ey=Qv.ObjectField;class ty extends xt.Component{render(){return Pv(this.props.schema)?xt.createElement(xt.Fragment,{},rm(this.props.schema.title),om(this.props.schema.description),xt.createElement(Xv,this.props)):xt.createElement(ey,this.props)}}class ny extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props,t=e.schema;let n,r;const o=function(e){var t,n;let r={};return(null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.props)&&(r=Object.assign(Object.assign({},r),e.lime.component.props)),r}(e.schema);return function(e){return e.multipleOf<1&&0===e.minimum&&1===e.maximum}(t)&&(n=100,r="%"),xt.createElement(Uv,{name:"limel-slider",value:e.value,events:{change:this.handleChange},widgetProps:e,extraProps:Object.assign({valuemin:t.minimum,valuemax:t.maximum,step:t.multipleOf,factor:n,unit:r},o)})}handleChange(e){const t=this.props;e.stopPropagation(),t.onChange&&t.onChange(e.detail)}}class ry extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props;if((Qh(t=e.schema)||em(t))&&"minimum"in t&&"maximum"in t&&"multipleOf"in t)return xt.createElement(ny,e);var t;const n=oy(e.schema),r=function(e){return Qh(e)&&e.multipleOf?+e.multipleOf||"any":em(e)?Math.floor(+e.multipleOf)||1:"any"}(e.schema),o=function(e){var t,n;let r={};return e.minimum&&(r.min=e.minimum),e.maximum&&(r.max=e.maximum),e.maxLength&&(r.maxlength=e.maxLength),e.minLength&&(r.minlength=e.minLength),(null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.props)&&(r=Object.assign(Object.assign({},r),e.lime.component.props)),r}(e.schema);return xt.createElement(Uv,{name:"limel-input-field",value:e.value,events:{change:this.handleChange},widgetProps:e,extraProps:Object.assign({step:r,type:n},o)})}handleChange(e){e.stopPropagation();const t=this.props,n=oy(t.schema);if(!t.onChange)return;let r;r=e.detail||"number"==typeof e.detail?e.detail:"number"===n||t.required?null:"",t.onChange(r)}}function oy(e){return Qh(e)||em(e)?"number":"email"===e.format?"email":"text"}function iy(e){var t;return{text:e.label,value:e.value,disabled:!!(null===(t=e.schema)||void 0===t?void 0:t.readOnly)}}const ay={CheckboxWidget:class extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props,t=null!==(o=null===(r=null===(n=e.schema.lime)||void 0===n?void 0:n.component)||void 0===r?void 0:r.props)&&void 0!==o?o:{};var n,r,o;return xt.createElement(Uv,{name:"limel-checkbox",value:e.value,widgetProps:e,extraProps:Object.assign({checked:!!e.value},t),events:{change:this.handleChange}})}handleChange(e){const t=this.props;e.stopPropagation(),t.onChange&&t.onChange(e.detail)}},DateTimeWidget:qv,DateWidget:e=>{var{value:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["value"]);return"string"==typeof t&&/-\d\d$/.test(t)&&(t+="T00:00"),xt.createElement(qv,Object.assign({type:"date",value:t},n))},EmailWidget:ry,TextWidget:ry,SelectWidget:class extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=this.handleChange.bind(this)}render(){var e,t;const n=this.props,r=n.options.enumOptions.map(iy);let o;o=n.multiple?function(e,t){return t.filter((t=>e.includes(t.value)))}(n.value,r):function(e,t){return t.find((t=>t.value===e))}(n.value,r);const i=(null===(t=null===(e=n.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)||{};return xt.createElement(Uv,{name:"limel-select",value:o,events:{change:this.handleChange},widgetProps:n,extraProps:Object.assign({multiple:n.multiple,options:r},i)})}handleChange(e){const t=this.props;if(e.stopPropagation(),t.onChange)if(he(e.detail)){const n=e.detail.map((e=>e.value));t.onChange(n)}else t.onChange(e.detail.value)}},RangeWidget:ny},ly=class{constructor(n){e(this,n),this.change=t(this,"change"),this.validate=t(this,"validate"),this.schema={},this.disabled=!1,this.isValid=!0,this.initialized=!1,this.handleChange=this.handleChange.bind(this),this.getCustomErrorMessages=this.getCustomErrorMessages.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){this.initialized||this.host.shadowRoot.querySelector(".root")&&(this.initialized=!0,this.reactRender(),this.validateFormData())}componentDidUpdate(){this.reactRender(),this.validateFormData()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=void 0),this.initialized=!1}render(){return n("div",{key:"56c9180ab3e5b4ee3282db2c38b5eaf522e8c60f",class:"root"})}reactRender(){if(!this.root){const e=this.host.shadowRoot.querySelector(".root");this.root=qt.createRoot(e)}this.root.render(xt.createElement(ic,{schema:this.schema,formData:this.value,onChange:this.handleChange,widgets:ay,validator:Mv,liveValidate:"onChange",showErrorList:!1,extraErrors:this.getExtraErrors(this.errors),templates:{FieldTemplate:nm,ArrayFieldTemplate:mv,ArrayFieldItemTemplate:yv,ObjectFieldTemplate:Ev},disabled:this.disabled,transformErrors:this.getCustomErrorMessages,formContext:{schema:this.schema,rootValue:this.value,propsFactory:this.propsFactory},fields:{SchemaField:Hv,ArrayField:Jv,ObjectField:ty}},[]))}handleChange(e){this.change.emit(e.formData)}validateFormData(){var e;const{errors:t}=Mv.validateFormData(null!==(e=this.value)&&void 0!==e?e:{},this.schema);this.emitValidationStatus(t)}hasExtraErrors(){return!!this.errors&&Object.keys(this.errors).length>0}emitValidationStatus(e){const t=!(e&&0!==e.length||this.hasExtraErrors()),n=this.mapErrors(null!=e?e:[]);this.isValid===t&&t||this.validate.emit({valid:t,errors:n}),this.isValid=t}mapErrors(e){return e.map((e=>({name:e.name,property:e.property,message:e.message,schemaPath:e.schemaPath,params:e.params})))}getExtraErrors(e){var t,n,r;if(e)return t=e,r={},n=s(n=e=>Array.isArray(e)?{__errors:e}:this.getExtraErrors(e)),B(t,(function(e,t,o){Z(r,t,n(e,t,o))})),r}getCustomErrorMessages(e){if(!this.transformErrors)return e;const t=this.mapErrors(e);return this.transformErrors.call({},t).map((t=>{const n=e.find((e=>t.property===e.property));return Object.assign(Object.assign({},n),{message:t.message})}))}get host(){return r(this)}};ly.style='@charset "UTF-8";.limel-form-row--layout{--limel-form-row-border-radius:0.375rem;--limel-form-row-icon-size:1.75rem;--limel-form-row-main-information-gap:0.5rem;display:flex;flex-direction:column}.limel-form-row--layout .row{display:flex;gap:0.5rem;flex-direction:column;padding:0.5rem 1rem}.limel-form-row--layout .row:nth-child(odd){background-color:var(--form-background-color-of-odd-rows, rgb(var(--contrast-200)))}.limel-form-row--layout .row:nth-child(even){background-color:var(--form-background-color-of-even-rows, transparent)}.limel-form-row--layout .row:first-child{border-radius:var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0}.limel-form-row--layout .row:last-child{border-radius:0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius)}.limel-form-row--layout .main-information{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--limel-form-row-main-information-gap);min-width:0}.limel-form-row--layout .main-information{position:relative}.limel-form-row--layout .main-information>.rjsf-field{position:unset}.limel-form-row--layout .main-information>.rjsf-field limel-help{top:0}.limel-form-row--layout limel-icon{color:rgb(var(--contrast-1200));width:var(--limel-form-row-icon-size);flex-shrink:0;min-width:0}.limel-form-row--layout .title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;font-weight:normal;flex-grow:1;color:var(--limel-theme-on-surface-color);font-size:0.875rem}.limel-form-row--layout .description{margin:0;color:var(--limel-theme-text-secondary-on-background-color);font-size:var(--limel-theme-default-small-font-size);line-height:1.5}.limel-form-row--layout .has-icon .description{padding-left:calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap))}.limel-form-row--layout .rjsf-field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .rjsf-field limel-slider{min-width:8rem;display:block}*,*::after,*::before{box-sizing:border-box}.rjsf-field{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}limel-markdown{display:block;margin-bottom:0.5rem}.rjsf-field{position:relative}.rjsf-field limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.rjsf-field h1{color:rgb(var(--contrast-1400), 0.8)}.rjsf-field h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.rjsf-field .rjsf-field h1:before{content:"";display:block;position:absolute;top:0;bottom:0;margin:auto;left:-0.75rem;background-color:var(--lime-primary-color, var(--limel-theme-primary-color));width:0.125rem;height:1.5rem;border-radius:0.125rem;opacity:0.6}.rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.215rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.138rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.067rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}';export{ly as limel_form}
|
|
13
|
+
*/(e,t);const r=function(e,t){let n=e;if(Zh(e)&&(n=e.items),n.$ref){const e=n.$ref.split("/").slice(1).join(".");n=h(t,e)}return n}(t,n);e=function(e,t){if(!t||se(t))return e;const n={};for(const r of Object.keys(t))n[r]=e[r];return n}(e,r.properties);const o=function(e,t){return[["title",e.title],["name",e.name],am(e,t),...Object.entries(e)].find((e=>{const t=e[1];return!!t&&"boolean"!=typeof t}))}(e,r);if(!o)return null;if(!r.properties)return null;const[i,a]=o;return im(a,r.properties[i],n)}function am(e,t){if(!("required"in t))return[null,null];const n=Object.keys(e).find((e=>t.required.includes(e)));return n?[n,e[n]]:[null,null]}function lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sm(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lm(Object(n),!0).forEach((function(t){cm(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lm(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function um(e){return um="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(e)}function cm(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fm(){return fm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fm.apply(this,arguments)}function dm(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var hm=dm(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),mm=dm(/Edge/i),pm=dm(/firefox/i),vm=dm(/safari/i)&&!dm(/chrome/i)&&!dm(/android/i),ym=dm(/iP(ad|od|hone)/i),bm=dm(/chrome/i)&&dm(/android/i),gm={capture:!1,passive:!1};function wm(e,t,n){e.addEventListener(t,n,!hm&&gm)}function $m(e,t,n){e.removeEventListener(t,n,!hm&&gm)}function km(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function Sm(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Em(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&km(e,t):km(e,t))||r&&e===n)return e;if(e===n)break}while(e=Sm(e))}return null}var jm,Om=/\s+/g;function xm(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Om," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(Om," ")}}function _m(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function Cm(e,t){var n="";if("string"==typeof e)n=e;else do{var r=_m(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Dm(e,t,n){if(e){var r=e.getElementsByTagName(t),o=0,i=r.length;if(n)for(;o<i;o++)n(r[o],o);return r}return[]}function Im(){return document.scrollingElement||document.documentElement}function Am(e,t,n,r,o){if(e.getBoundingClientRect||e===window){var i,a,l,s,u,c,f;if(e!==window&&e.parentNode&&e!==Im()?(a=(i=e.getBoundingClientRect()).top,l=i.left,s=i.bottom,u=i.right,c=i.height,f=i.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,c=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!hm))do{if(o&&o.getBoundingClientRect&&("none"!==_m(o,"transform")||n&&"static"!==_m(o,"position"))){var d=o.getBoundingClientRect();a-=d.top+parseInt(_m(o,"border-top-width")),l-=d.left+parseInt(_m(o,"border-left-width")),s=a+i.height,u=l+i.width;break}}while(o=o.parentNode);if(r&&e!==window){var h=Cm(o||e),m=h&&h.a,p=h&&h.d;h&&(s=(a/=p)+(c/=p),u=(l/=m)+(f/=m))}return{top:a,left:l,bottom:s,right:u,width:f,height:c}}}function Fm(e,t,n){for(var r=Rm(e,!0),o=Am(e)[t];r;){if(!(o>=Am(r)[n]))return r;if(r===Im())break;r=Rm(r,!1)}return!1}function Mm(e,t,n,r){for(var o=0,i=0,a=e.children;i<a.length;){if("none"!==a[i].style.display&&a[i]!==Lp.ghost&&(r||a[i]!==Lp.dragged)&&Em(a[i],n.draggable,e,!1)){if(o===t)return a[i];o++}i++}return null}function Tm(e,t){for(var n=e.lastElementChild;n&&(n===Lp.ghost||"none"===_m(n,"display")||t&&!km(n,t));)n=n.previousElementSibling;return n||null}function Pm(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Lp.clone||t&&!km(e,t)||n++;return n}function Nm(e){var t=0,n=0,r=Im();if(e)do{var o=Cm(e);t+=e.scrollLeft*o.a,n+=e.scrollTop*o.d}while(e!==r&&(e=e.parentNode));return[t,n]}function Rm(e,t){if(!e||!e.getBoundingClientRect)return Im();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=_m(n);if(n.clientWidth<n.scrollWidth&&("auto"==o.overflowX||"scroll"==o.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==o.overflowY||"scroll"==o.overflowY)){if(!n.getBoundingClientRect||n===document.body)return Im();if(r||t)return n;r=!0}}}while(n=n.parentNode);return Im()}function Um(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function qm(e,t){return function(){if(!jm){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),jm=setTimeout((function(){jm=void 0}),t)}}}function Lm(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function zm(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Bm(e,t,n){var r={};return Array.from(e.children).forEach((function(o){var i,a,l,s;if(Em(o,t.draggable,e,!1)&&!o.animated&&o!==n){var u=Am(o);r.left=Math.min(null!==(i=r.left)&&void 0!==i?i:1/0,u.left),r.top=Math.min(null!==(a=r.top)&&void 0!==a?a:1/0,u.top),r.right=Math.max(null!==(l=r.right)&&void 0!==l?l:-1/0,u.right),r.bottom=Math.max(null!==(s=r.bottom)&&void 0!==s?s:-1/0,u.bottom)}})),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var Vm="Sortable"+(new Date).getTime();var Wm=[],Hm={initializeByDefault:!0},Gm={mount:function(e){for(var t in Hm)Hm.hasOwnProperty(t)&&!(t in e)&&(e[t]=Hm[t]);Wm.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),Wm.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=e+"Global";Wm.forEach((function(r){t[r.pluginName]&&(t[r.pluginName][o]&&t[r.pluginName][o](sm({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](sm({sortable:t},n)))}))},initializePlugins:function(e,t,n){for(var r in Wm.forEach((function(r){var o=r.pluginName;if(e.options[o]||r.initializeByDefault){var i=new r(e,t,e.options);i.sortable=e,i.options=e.options,e[o]=i,fm(n,i.defaults)}})),e.options)if(e.options.hasOwnProperty(r)){var o=this.modifyOption(e,r,e.options[r]);void 0!==o&&(e.options[r]=o)}},getEventProperties:function(e,t){var n={};return Wm.forEach((function(r){"function"==typeof r.eventProperties&&fm(n,r.eventProperties.call(t[r.pluginName],e))})),n},modifyOption:function(e,t,n){var r;return Wm.forEach((function(o){e[o.pluginName]&&o.optionListeners&&"function"==typeof o.optionListeners[t]&&(r=o.optionListeners[t].call(e[o.pluginName],n))})),r}},Km=["evt"],Jm=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,Km);Gm.pluginEvent.bind(Lp)(e,t,sm({dragEl:Xm,parentEl:Zm,ghostEl:Qm,rootEl:ep,nextEl:tp,lastDownEl:np,cloneEl:rp,cloneHidden:op,dragStarted:yp,putSortable:cp,activeSortable:Lp.active,originalEvent:r,oldIndex:ip,oldDraggableIndex:lp,newIndex:ap,newDraggableIndex:sp,hideGhostForTarget:Np,unhideGhostForTarget:Rp,cloneNowHidden:function(){op=!0},cloneNowShown:function(){op=!1},dispatchSortableEvent:function(e){Ym({sortable:t,name:e,originalEvent:r})}},o))};function Ym(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,a=e.toEl,l=e.fromEl,s=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,f=e.newDraggableIndex,d=e.originalEvent,h=e.putSortable,m=e.extraEventProperties;if(t=t||n&&n[Vm]){var p,v=t.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||hm||mm?(p=document.createEvent("Event")).initEvent(r,!0,!0):p=new CustomEvent(r,{bubbles:!0,cancelable:!0}),p.to=a||n,p.from=l||n,p.item=o||n,p.clone=i,p.oldIndex=s,p.newIndex=u,p.oldDraggableIndex=c,p.newDraggableIndex=f,p.originalEvent=d,p.pullMode=h?h.lastPutMode:void 0;var b=sm(sm({},m),Gm.getEventProperties(r,t));for(var g in b)p[g]=b[g];n&&n.dispatchEvent(p),v[y]&&v[y].call(t,p)}}(sm({putSortable:cp,cloneEl:rp,targetEl:Xm,rootEl:ep,oldIndex:ip,oldDraggableIndex:lp,newIndex:ap,newDraggableIndex:sp},e))}var Xm,Zm,Qm,ep,tp,np,rp,op,ip,ap,lp,sp,up,cp,fp,dp,hp,mp,pp,vp,yp,bp,gp,wp,$p,kp=!1,Sp=!1,Ep=[],jp=!1,Op=!1,xp=[],_p=!1,Cp=[],Dp="undefined"!=typeof document,Ip=ym,Ap=mm||hm?"cssFloat":"float",Fp=Dp&&!bm&&!ym&&"draggable"in document.createElement("div"),Mp=function(){if(Dp){if(hm)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Tp=function(e,t){var n=_m(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),o=Mm(e,0,t),i=Mm(e,1,t),a=o&&_m(o),l=i&&_m(i),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Am(o).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Am(i).width;return"flex"===n.display?"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal":"grid"===n.display?n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal":o&&a.float&&"none"!==a.float?!i||"both"!==l.clear&&l.clear!==("left"===a.float?"left":"right")?"horizontal":"vertical":o&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=r&&"none"===n[Ap]||i&&"none"===n[Ap]&&s+u>r)?"vertical":"horizontal"},Pp=function(e){function t(e,n){return function(r,o,i,a){if(null==e&&(n||r.options.group.name&&o.options.group.name&&r.options.group.name===o.options.group.name))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,o,i,a),n)(r,o,i,a);var l=(n?r:o).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==um(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Np=function(){!Mp&&Qm&&_m(Qm,"display","none")},Rp=function(){!Mp&&Qm&&_m(Qm,"display","")};Dp&&!bm&&document.addEventListener("click",(function(e){if(Sp)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Sp=!1,!1}),!0);var Up=function(e){if(Xm){var t=function(e,t){var n;return Ep.some((function(r){var o=r[Vm].options.emptyInsertThreshold;if(o&&!Tm(r)){var i=Am(r);return e>=i.left-o&&e<=i.right+o&&t>=i.top-o&&t<=i.bottom+o?n=r:void 0}})),n}((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Vm]._onDragOver(n)}}},qp=function(e){Xm&&Xm.parentNode[Vm]._isOutsideThisEl(e.target)};function Lp(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=fm({},t),e[Vm]=this;var n,r,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Tp(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Lp.supportPointer&&"PointerEvent"in window&&(!vm||ym),emptyInsertThreshold:5};for(var i in Gm.initializePlugins(this,e,o),o)!(i in t)&&(t[i]=o[i]);for(var a in Pp(t),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!t.forceFallback&&Fp,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?wm(e,"pointerdown",this._onTapStart):(wm(e,"mousedown",this._onTapStart),wm(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(wm(e,"dragover",this),wm(e,"dragenter",this)),Ep.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),fm(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==_m(e,"display")&&e!==Lp.ghost){r.push({target:e,rect:Am(e)});var t=sm({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=Cm(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var o=!1,i=0;r.forEach((function(e){var n=0,r=e.target,a=r.fromRect,l=Am(r),s=r.prevFromRect,u=r.prevToRect,c=e.rect,f=Cm(r,!0);f&&(l.top-=f.f,l.left-=f.e),r.toRect=l,r.thisAnimationDuration&&Um(s,l)&&!Um(a,l)&&(c.top-l.top)/(c.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(c,s,u,t.options)),Um(l,a)||(r.prevFromRect=a,r.prevToRect=l,n||(n=t.options.animation),t.animate(r,c,l,n)),n&&(o=!0,i=Math.max(i,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout((function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null}),n),r.thisAnimationDuration=n)})),clearTimeout(n),o?n=setTimeout((function(){"function"==typeof e&&e()}),i):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){_m(e,"transition",""),_m(e,"transform","");var o=Cm(this.el),i=(t.left-n.left)/(o&&o.a||1),a=(t.top-n.top)/(o&&o.d||1);e.animatingX=!!i,e.animatingY=!!a,_m(e,"transform","translate3d("+i+"px,"+a+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),_m(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),_m(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){_m(e,"transition",""),_m(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),r)}}}))}function zp(e,t,n,r,o,i,a,l){var s,u,c=e[Vm],f=c.options.onMove;return!window.CustomEvent||hm||mm?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=o||t,s.relatedRect=i||Am(t),s.willInsertAfter=l,s.originalEvent=a,e.dispatchEvent(s),f&&(u=f.call(c,s,a)),u}function Bp(e){e.draggable=!1}function Vp(){_p=!1}function Wp(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function Hp(e){return setTimeout(e,0)}function Gp(e){return clearTimeout(e)}Lp.prototype={constructor:Lp,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(bp=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Xm):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,o=r.preventOnFilter,i=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,u=r.filter;if(function(e){Cp.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&Cp.push(r)}}(n),!Xm&&!(/mousedown|pointerdown/.test(i)&&0!==e.button||r.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!vm||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=Em(l,r.draggable,n,!1))&&l.animated||np===l)){if(ip=Pm(l),lp=Pm(l,r.draggable),"function"==typeof u){if(u.call(this,e,l,this))return Ym({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),Jm("filter",t,{evt:e}),void(o&&e.preventDefault())}else if(u&&(u=u.split(",").some((function(r){if(r=Em(s,r.trim(),n,!1))return Ym({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),Jm("filter",t,{evt:e}),!0}))))return void(o&&e.preventDefault());r.handle&&!Em(s,r.handle,n,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(e,t,n){var r,o=this,i=o.el,a=o.options,l=i.ownerDocument;if(n&&!Xm&&n.parentNode===i){var s=Am(n);if(ep=i,Zm=(Xm=n).parentNode,tp=Xm.nextSibling,np=n,up=a.group,Lp.dragged=Xm,pp=(fp={target:Xm,clientX:(t||e).clientX,clientY:(t||e).clientY}).clientX-s.left,vp=fp.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Xm.style["will-change"]="all",r=function(){Jm("delayEnded",o,{evt:e}),Lp.eventCanceled?o._onDrop():(o._disableDelayedDragEvents(),!pm&&o.nativeDraggable&&(Xm.draggable=!0),o._triggerDragStart(e,t),Ym({sortable:o,name:"choose",originalEvent:e}),xm(Xm,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){Dm(Xm,e.trim(),Bp)})),wm(l,"dragover",Up),wm(l,"mousemove",Up),wm(l,"touchmove",Up),a.supportPointer?(wm(l,"pointerup",o._onDrop),!this.nativeDraggable&&wm(l,"pointercancel",o._onDrop)):(wm(l,"mouseup",o._onDrop),wm(l,"touchend",o._onDrop),wm(l,"touchcancel",o._onDrop)),pm&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Xm.draggable=!0),Jm("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(mm||hm))r();else{if(Lp.eventCanceled)return void this._onDrop();a.supportPointer?(wm(l,"pointerup",o._disableDelayedDrag),wm(l,"pointercancel",o._disableDelayedDrag)):(wm(l,"mouseup",o._disableDelayedDrag),wm(l,"touchend",o._disableDelayedDrag),wm(l,"touchcancel",o._disableDelayedDrag)),wm(l,"mousemove",o._delayedDragTouchMoveHandler),wm(l,"touchmove",o._delayedDragTouchMoveHandler),a.supportPointer&&wm(l,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(r,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Xm&&Bp(Xm),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;$m(e,"mouseup",this._disableDelayedDrag),$m(e,"touchend",this._disableDelayedDrag),$m(e,"touchcancel",this._disableDelayedDrag),$m(e,"pointerup",this._disableDelayedDrag),$m(e,"pointercancel",this._disableDelayedDrag),$m(e,"mousemove",this._delayedDragTouchMoveHandler),$m(e,"touchmove",this._delayedDragTouchMoveHandler),$m(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?wm(document,this.options.supportPointer?"pointermove":t?"touchmove":"mousemove",this._onTouchMove):(wm(Xm,"dragend",this),wm(ep,"dragstart",this._onDragStart));try{document.selection?Hp((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(kp=!1,ep&&Xm){Jm("dragStarted",this,{evt:t}),this.nativeDraggable&&wm(document,"dragover",qp);var n=this.options;!e&&xm(Xm,n.dragClass,!1),xm(Xm,n.ghostClass,!0),Lp.active=this,e&&this._appendGhost(),Ym({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(dp){this._lastX=dp.clientX,this._lastY=dp.clientY,Np();for(var e=document.elementFromPoint(dp.clientX,dp.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(dp.clientX,dp.clientY))!==t;)t=e;if(Xm.parentNode[Vm]._isOutsideThisEl(e),t)do{if(t[Vm]&&t[Vm]._onDragOver({clientX:dp.clientX,clientY:dp.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=Sm(t));Rp()}},_onTouchMove:function(e){if(fp){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,o=e.touches?e.touches[0]:e,i=Qm&&Cm(Qm,!0),a=Qm&&i&&i.a,l=Qm&&i&&i.d,s=Ip&&$p&&Nm($p),u=(o.clientX-fp.clientX+r.x)/(a||1)+(s?s[0]-xp[0]:0)/(a||1),c=(o.clientY-fp.clientY+r.y)/(l||1)+(s?s[1]-xp[1]:0)/(l||1);if(!Lp.active&&!kp){if(n&&Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Qm){i?(i.e+=u-(hp||0),i.f+=c-(mp||0)):i={a:1,b:0,c:0,d:1,e:u,f:c};var f="matrix(".concat(i.a,",").concat(i.b,",").concat(i.c,",").concat(i.d,",").concat(i.e,",").concat(i.f,")");_m(Qm,"webkitTransform",f),_m(Qm,"mozTransform",f),_m(Qm,"msTransform",f),_m(Qm,"transform",f),hp=u,mp=c,dp=o}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Qm){var e=this.options.fallbackOnBody?document.body:ep,t=Am(Xm,!0,Ip,!0,e),n=this.options;if(Ip){for($p=e;"static"===_m($p,"position")&&"none"===_m($p,"transform")&&$p!==document;)$p=$p.parentNode;$p!==document.body&&$p!==document.documentElement?($p===document&&($p=Im()),t.top+=$p.scrollTop,t.left+=$p.scrollLeft):$p=Im(),xp=Nm($p)}xm(Qm=Xm.cloneNode(!0),n.ghostClass,!1),xm(Qm,n.fallbackClass,!0),xm(Qm,n.dragClass,!0),_m(Qm,"transition",""),_m(Qm,"transform",""),_m(Qm,"box-sizing","border-box"),_m(Qm,"margin",0),_m(Qm,"top",t.top),_m(Qm,"left",t.left),_m(Qm,"width",t.width),_m(Qm,"height",t.height),_m(Qm,"opacity","0.8"),_m(Qm,"position",Ip?"absolute":"fixed"),_m(Qm,"zIndex","100000"),_m(Qm,"pointerEvents","none"),Lp.ghost=Qm,e.appendChild(Qm),_m(Qm,"transform-origin",pp/parseInt(Qm.style.width)*100+"% "+vp/parseInt(Qm.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,o=n.options;Jm("dragStart",this,{evt:e}),Lp.eventCanceled?this._onDrop():(Jm("setupClone",this),Lp.eventCanceled||((rp=zm(Xm)).removeAttribute("id"),rp.draggable=!1,rp.style["will-change"]="",this._hideClone(),xm(rp,this.options.chosenClass,!1),Lp.clone=rp),n.cloneId=Hp((function(){Jm("clone",n),Lp.eventCanceled||(n.options.removeCloneOnHide||ep.insertBefore(rp,Xm),n._hideClone(),Ym({sortable:n,name:"clone"}))})),!t&&xm(Xm,o.dragClass,!0),t?(Sp=!0,n._loopId=setInterval(n._emulateDragOver,50)):($m(document,"mouseup",n._onDrop),$m(document,"touchend",n._onDrop),$m(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",o.setData&&o.setData.call(n,r,Xm)),wm(document,"drop",n),_m(Xm,"transform","translateZ(0)")),kp=!0,n._dragStartId=Hp(n._dragStarted.bind(n,t,e)),wm(document,"selectstart",n),yp=!0,window.getSelection().removeAllRanges(),vm&&_m(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,o,i=this.el,a=e.target,l=this.options,s=l.group,u=Lp.active,c=up===s,f=l.sort,d=cp||u,h=this,m=!1;if(!_p){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=Em(a,l.draggable,i,!0),C("dragOver"),Lp.eventCanceled)return m;if(Xm.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||h._ignoreWhileAnimating===a)return I(!1);if(Sp=!1,u&&!l.disabled&&(c?f||(r=Zm!==ep):cp===this||(this.lastPutMode=up.checkPull(this,u,Xm,e))&&s.checkPut(this,u,Xm,e))){if(o="vertical"===this._getDirection(e,a),t=Am(Xm),C("dragOverValid"),Lp.eventCanceled)return m;if(r)return Zm=ep,D(),this._hideClone(),C("revert"),Lp.eventCanceled||(tp?ep.insertBefore(Xm,tp):ep.appendChild(Xm)),I(!0);var p=Tm(i,l.draggable);if(!p||function(e,t,n){var r=Am(Tm(n.el,n.options.draggable)),o=Bm(n.el,n.options,Qm);return t?e.clientX>o.right+10||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>o.bottom+10||e.clientX>r.right&&e.clientY>r.top}(e,o,this)&&!p.animated){if(p===Xm)return I(!1);if(p&&i===e.target&&(a=p),a&&(n=Am(a)),!1!==zp(ep,i,Xm,t,a,n,e,!!a))return D(),p&&p.nextSibling?i.insertBefore(Xm,p.nextSibling):i.appendChild(Xm),Zm=i,A(),I(!0)}else if(p&&function(e,t,n){var r=Am(Mm(n.el,0,n.options,!0)),o=Bm(n.el,n.options,Qm);return t?e.clientX<o.left-10||e.clientY<r.top&&e.clientX<r.right:e.clientY<o.top-10||e.clientY<r.bottom&&e.clientX<r.left}(e,o,this)){var v=Mm(i,0,l,!0);if(v===Xm)return I(!1);if(n=Am(a=v),!1!==zp(ep,i,Xm,t,a,n,e,!1))return D(),i.insertBefore(Xm,v),Zm=i,A(),I(!0)}else if(a.parentNode===i){n=Am(a);var y,b,g,w=Xm.parentNode!==i,$=!function(e,t,n){var r=n?e.left:e.top,o=n?t.left:t.top;return r===o||(n?e.right:e.bottom)===(n?t.right:t.bottom)||r+(n?e.width:e.height)/2===o+(n?t.width:t.height)/2}(Xm.animated&&Xm.toRect||t,a.animated&&a.toRect||n,o),k=o?"top":"left",S=Fm(a,"top","top")||Fm(Xm,"top","top"),E=S?S.scrollTop:void 0;if(bp!==a&&(b=n[k],jp=!1,Op=!$&&l.invertSwap||w),y=function(e,t,n,r,o,i,a,l){var s=r?e.clientY:e.clientX,u=r?n.height:n.width,c=r?n.top:n.left,f=r?n.bottom:n.right,d=!1;if(!a)if(l&&wp<u*o){if(!jp&&(1===gp?s>c+u*i/2:s<f-u*i/2)&&(jp=!0),jp)d=!0;else if(1===gp?s<c+wp:s>f-wp)return-gp}else if(s>c+u*(1-o)/2&&s<f-u*(1-o)/2)return function(e){return Pm(Xm)<Pm(e)?1:-1}(t);return(d=d||a)&&(s<c+u*i/2||s>f-u*i/2)?s>c+u/2?1:-1:0}(e,a,n,o,$?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Op,bp===a),0!==y){var j=Pm(Xm);do{g=Zm.children[j-=y]}while(g&&("none"===_m(g,"display")||g===Qm))}if(0===y||g===a)return I(!1);bp=a,gp=y;var O=a.nextElementSibling,x=!1,_=zp(ep,i,Xm,t,a,n,e,x=1===y);if(!1!==_)return 1!==_&&-1!==_||(x=1===_),_p=!0,setTimeout(Vp,30),D(),x&&!O?i.appendChild(Xm):a.parentNode.insertBefore(Xm,x?O:a),S&&Lm(S,0,E-S.scrollTop),Zm=Xm.parentNode,void 0===b||Op||(wp=Math.abs(b-Am(a)[k])),A(),I(!0)}if(i.contains(Xm))return I(!1)}return!1}function C(l,s){Jm(l,h,sm({evt:e,isOwner:c,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:d,target:a,completed:I,onMove:function(n,r){return zp(ep,i,Xm,t,n,Am(n),e,r)},changed:A},s))}function D(){C("dragOverAnimationCapture"),h.captureAnimationState(),h!==d&&d.captureAnimationState()}function I(t){return C("dragOverCompleted",{insertion:t}),t&&(c?u._hideClone():u._showClone(h),h!==d&&(xm(Xm,cp?cp.options.ghostClass:u.options.ghostClass,!1),xm(Xm,l.ghostClass,!0)),cp!==h&&h!==Lp.active?cp=h:h===Lp.active&&cp&&(cp=null),d===h&&(h._ignoreWhileAnimating=a),h.animateAll((function(){C("dragOverAnimationComplete"),h._ignoreWhileAnimating=null})),h!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a===Xm&&!Xm.animated||a===i&&!a.animated)&&(bp=null),l.dragoverBubble||e.rootEl||a===document||(Xm.parentNode[Vm]._isOutsideThisEl(e.target),!t&&Up(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function A(){ap=Pm(Xm),sp=Pm(Xm,l.draggable),Ym({sortable:h,name:"change",toEl:i,newIndex:ap,newDraggableIndex:sp,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){$m(document,"mousemove",this._onTouchMove),$m(document,"touchmove",this._onTouchMove),$m(document,"pointermove",this._onTouchMove),$m(document,"dragover",Up),$m(document,"mousemove",Up),$m(document,"touchmove",Up)},_offUpEvents:function(){var e=this.el.ownerDocument;$m(e,"mouseup",this._onDrop),$m(e,"touchend",this._onDrop),$m(e,"pointerup",this._onDrop),$m(e,"pointercancel",this._onDrop),$m(e,"touchcancel",this._onDrop),$m(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;ap=Pm(Xm),sp=Pm(Xm,n.draggable),Jm("drop",this,{evt:e}),Zm=Xm&&Xm.parentNode,ap=Pm(Xm),sp=Pm(Xm,n.draggable),Lp.eventCanceled||(kp=!1,Op=!1,jp=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Gp(this.cloneId),Gp(this._dragStartId),this.nativeDraggable&&($m(document,"drop",this),$m(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),vm&&_m(document.body,"user-select",""),_m(Xm,"transform",""),e&&(yp&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Qm&&Qm.parentNode&&Qm.parentNode.removeChild(Qm),(ep===Zm||cp&&"clone"!==cp.lastPutMode)&&rp&&rp.parentNode&&rp.parentNode.removeChild(rp),Xm&&(this.nativeDraggable&&$m(Xm,"dragend",this),Bp(Xm),Xm.style["will-change"]="",yp&&!kp&&xm(Xm,cp?cp.options.ghostClass:this.options.ghostClass,!1),xm(Xm,this.options.chosenClass,!1),Ym({sortable:this,name:"unchoose",toEl:Zm,newIndex:null,newDraggableIndex:null,originalEvent:e}),ep!==Zm?(ap>=0&&(Ym({rootEl:Zm,name:"add",toEl:Zm,fromEl:ep,originalEvent:e}),Ym({sortable:this,name:"remove",toEl:Zm,originalEvent:e}),Ym({rootEl:Zm,name:"sort",toEl:Zm,fromEl:ep,originalEvent:e}),Ym({sortable:this,name:"sort",toEl:Zm,originalEvent:e})),cp&&cp.save()):ap!==ip&&ap>=0&&(Ym({sortable:this,name:"update",toEl:Zm,originalEvent:e}),Ym({sortable:this,name:"sort",toEl:Zm,originalEvent:e})),Lp.active&&(null!=ap&&-1!==ap||(ap=ip,sp=lp),Ym({sortable:this,name:"end",toEl:Zm,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Jm("nulling",this),ep=Xm=Zm=Qm=tp=rp=np=op=fp=dp=yp=ap=sp=ip=lp=bp=gp=cp=up=Lp.dragged=Lp.ghost=Lp.clone=Lp.active=null,Cp.forEach((function(e){e.checked=!0})),Cp.length=hp=mp=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Xm&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,o=n.length,i=this.options;r<o;r++)Em(e=n[r],i.draggable,this.el,!1)&&t.push(e.getAttribute(i.dataIdAttr)||Wp(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach((function(e,t){var o=r.children[t];Em(o,this.options.draggable,r,!1)&&(n[e]=o)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Em(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=Gm.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Pp(n)},destroy:function(){Jm("destroy",this);var e=this.el;e[Vm]=null,$m(e,"mousedown",this._onTapStart),$m(e,"touchstart",this._onTapStart),$m(e,"pointerdown",this._onTapStart),this.nativeDraggable&&($m(e,"dragover",this),$m(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),Ep.splice(Ep.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!op){if(Jm("hideClone",this),Lp.eventCanceled)return;_m(rp,"display","none"),this.options.removeCloneOnHide&&rp.parentNode&&rp.parentNode.removeChild(rp),op=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(op){if(Jm("showClone",this),Lp.eventCanceled)return;Xm.parentNode!=ep||this.options.group.revertClone?tp?ep.insertBefore(rp,tp):ep.appendChild(rp):ep.insertBefore(rp,Xm),this.options.group.revertClone&&this.animate(Xm,rp),_m(rp,"display",""),op=!1}}else this._hideClone()}},Dp&&wm(document,"touchmove",(function(e){(Lp.active||kp)&&e.cancelable&&e.preventDefault()})),Lp.utils={on:wm,off:$m,css:_m,find:Dm,is:function(e,t){return!!Em(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:qm,closest:Em,toggleClass:xm,clone:zm,index:Pm,nextTick:Hp,cancelNextTick:Gp,detectDirection:Tp,getChild:Mm,expando:Vm},Lp.get=function(e){return e[Vm]},Lp.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Lp.utils=sm(sm({},Lp.utils),e.utils)),Gm.mount(e)}))},Lp.create=function(e,t){return new Lp(e,t)},Lp.version="1.15.6";var Kp,Jp,Yp,Xp,Zp,Qp,ev=[],tv=!1;function nv(){ev.forEach((function(e){clearInterval(e.pid)})),ev=[]}function rv(){clearInterval(Qp)}var ov=qm((function(e,t,n,r){if(t.scroll){var o,i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,u=Im(),c=!1;Jp!==n&&(Jp=n,nv(),o=t.scrollFn,!0===(Kp=t.scroll)&&(Kp=Rm(n,!0)));var f=0,d=Kp;do{var h=d,m=Am(h),p=m.top,v=m.bottom,y=m.left,b=m.right,g=m.width,w=m.height,$=void 0,k=void 0,S=h.scrollWidth,E=h.scrollHeight,j=_m(h),O=h.scrollLeft,x=h.scrollTop;h===u?($=g<S&&("auto"===j.overflowX||"scroll"===j.overflowX||"visible"===j.overflowX),k=w<E&&("auto"===j.overflowY||"scroll"===j.overflowY||"visible"===j.overflowY)):($=g<S&&("auto"===j.overflowX||"scroll"===j.overflowX),k=w<E&&("auto"===j.overflowY||"scroll"===j.overflowY));var _=$&&(Math.abs(b-i)<=l&&O+g<S)-(Math.abs(y-i)<=l&&!!O),C=k&&(Math.abs(v-a)<=l&&x+w<E)-(Math.abs(p-a)<=l&&!!x);if(!ev[f])for(var D=0;D<=f;D++)ev[D]||(ev[D]={});ev[f].vx==_&&ev[f].vy==C&&ev[f].el===h||(ev[f].el=h,ev[f].vx=_,ev[f].vy=C,clearInterval(ev[f].pid),0==_&&0==C||(c=!0,ev[f].pid=setInterval(function(){r&&0===this.layer&&Lp.active._onTouchMove(Zp);var t=ev[this.layer].vy?ev[this.layer].vy*s:0,n=ev[this.layer].vx?ev[this.layer].vx*s:0;"function"==typeof o&&"continue"!==o.call(Lp.dragged.parentNode[Vm],n,t,e,Zp,ev[this.layer].el)||Lm(ev[this.layer].el,n,t)}.bind({layer:f}),24))),f++}while(t.bubbleScroll&&d!==u&&(d=Rm(d,!1)));tv=c}}),30),iv=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,o=e.dispatchSortableEvent,i=e.unhideGhostForTarget;if(t){var a=n||e.activeSortable;(0,e.hideGhostForTarget)();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,s=document.elementFromPoint(l.clientX,l.clientY);i(),a&&!a.el.contains(s)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function av(){}function lv(){}av.prototype={startIndex:null,dragStart:function(e){this.startIndex=e.oldDraggableIndex},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Mm(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:iv},fm(av,{pluginName:"revertOnSpill"}),lv.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:iv},fm(lv,{pluginName:"removeOnSpill"}),Lp.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?wm(document,"dragover",this._handleAutoScroll):wm(document,this.options.supportPointer?"pointermove":t.touches?"touchmove":"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?$m(document,"dragover",this._handleAutoScroll):($m(document,"pointermove",this._handleFallbackAutoScroll),$m(document,"touchmove",this._handleFallbackAutoScroll),$m(document,"mousemove",this._handleFallbackAutoScroll)),rv(),nv(),clearTimeout(jm),jm=void 0},nulling:function(){Zp=Jp=Kp=tv=Qp=Yp=Xp=null,ev.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,i=document.elementFromPoint(r,o);if(Zp=e,t||this.options.forceAutoScrollFallback||mm||hm||vm){ov(e,this.options,i,t);var a=Rm(i,!0);!tv||Qp&&r===Yp&&o===Xp||(Qp&&rv(),Qp=setInterval((function(){var i=Rm(document.elementFromPoint(r,o),!0);i!==a&&(a=i,nv()),ov(e,n.options,i,t)}),10),Yp=r,Xp=o)}else{if(!this.options.bubbleScroll||Rm(i,!0)===Im())return void nv();ov(e,this.options,Rm(i,!1),!1)}}},fm(e,{pluginName:"scroll",initializeByDefault:!0})}),Lp.mount(lv,av);const sv=Ot.createContext(null),uv="arrayReorder",cv="[data-drag-handle]",fv='.array-item[data-reorderable="true"]',dv="has-an-item-which-is-being-dragged",hv="is-elevated";class mv extends xt.Component{constructor(e){super(e),this.cachedContextValue=null,this.handleAddClick=e=>{e.stopPropagation(),this.props.onAddClick(e)},this.setContainer=e=>{this.container!==e&&(this.teardownDragController(),this.container=null!=e?e:void 0,this.setupDragController())},this.handleSortStart=e=>{this.canReorderItems()&&(this.dragSnapshot=[...this.state.order],this.draggedItemIndex=this.getReorderId(e.item),this.container&&this.container.classList.add(dv),e.item instanceof HTMLElement&&this.applyDropElevation(e.item))},this.handleSortEnd=e=>{var t;if(!this.canReorderItems())return;this.container&&this.container.classList.remove(dv);const n=this.dragSnapshot,r=this.draggedItemIndex;this.dragSnapshot=void 0,this.draggedItemIndex=void 0,e.item instanceof HTMLElement&&(this.dropElevationTarget=e.item);const o=this.readOrderFromDom();if(this.arraysEqual(this.state.order,o)||this.setState({order:o}),void 0===n||void 0===r||!(e.item instanceof HTMLElement))return void this.scheduleDropElevationRemoval();const i=n.indexOf(r),a=o.indexOf(r);-1!==i&&-1!==a&&i!==a?(null===(t=this.container)||void 0===t||t.dispatchEvent(new CustomEvent(uv,{bubbles:!0,detail:{fromIndex:i,toIndex:a}})),this.scheduleDropElevationRemoval()):this.scheduleDropElevationRemoval()},this.state={order:this.extractIndices(e.items)}}componentWillUnmount(){this.teardownDragController()}componentDidMount(){this.setupDragController()}componentDidUpdate(e){if(e.items!==this.props.items){const e=this.extractIndices(this.props.items);if(!this.arraysEqual(this.state.order,e))return void this.setState({order:e},(()=>{this.setupDragController()}))}e.items===this.props.items&&e.schema===this.props.schema&&e.disabled===this.props.disabled&&e.readonly===this.props.readonly||this.setupDragController()}render(){const e=this.getOrderedItems(),t=this.getContextValue();return xt.createElement(sv.Provider,{value:t},xt.createElement("div",{},rm(this.props.title),om(this.props.schema.description),xt.createElement("div",{className:"array-items",ref:this.setContainer},e),this.renderAddButton()))}renderAddButton(){if(this.props.canAdd)return xt.createElement("limel-button",{label:this.props.title||"Add",onClick:this.handleAddClick,icon:"plus_math",class:"button-add-new"})}getOrderedItems(){var e;const t=null!==(e=this.props.items)&&void 0!==e?e:[];if(0===t.length)return[];const n=new Map;for(const[e,r]of t.entries())n.set(e,r);const r=[],o=new Set;for(const e of this.state.order){const t=n.get(e);t&&(r.push(t),o.add(e))}for(const[e,t]of n.entries())o.has(e)||r.push(t);return r}setupDragController(){if(this.container&&this.canReorderItems())return this.container.querySelectorAll(`:scope > ${fv}`).length<2?void this.teardownDragController():this.sortable?(this.sortable.option("handle",cv),this.sortable.option("draggable",fv),this.sortable.option("disabled",!1),this.sortable.option("delay",200),void this.sortable.option("delayOnTouchOnly",!0)):void(this.sortable=Lp.create(this.container,{animation:150,handle:cv,draggable:fv,delay:200,delayOnTouchOnly:!0,onStart:this.handleSortStart,onEnd:this.handleSortEnd}));this.teardownDragController()}teardownDragController(){this.sortable&&(this.sortable.destroy(),this.sortable=void 0),this.clearDropElevationTimer(),this.dropElevationTarget&&(this.dropElevationTarget.classList.remove(hv),this.dropElevationTarget=void 0),this.container&&this.container.classList.remove(dv),this.dragSnapshot=void 0,this.draggedItemIndex=void 0}canReorderItems(){if(this.props.disabled||this.props.readonly)return!1;const e=this.props.schema;return!1!==((null==e?void 0:e.lime)||{}).allowItemReorder}readOrderFromDom(){if(!this.container)return[];const e=[...this.container.children].filter((e=>{var t,n;return Boolean(null===(n=null===(t=null==e?void 0:e.classList)||void 0===t?void 0:t.contains)||void 0===n?void 0:n.call(t,"array-item"))})),t=[];for(const n of e){const e=this.getReorderId(n);void 0!==e&&t.push(e)}return t}getReorderId(e){var t;if(!e)return;const n=null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.reorderId;if(void 0===n)return;const r=Number.parseInt(n,10);return Number.isNaN(r)?void 0:r}applyDropElevation(e){this.dropElevationTarget&&this.dropElevationTarget!==e&&this.dropElevationTarget.classList.remove(hv),this.clearDropElevationTimer(),e.classList.add(hv),this.dropElevationTarget=e}scheduleDropElevationRemoval(){if(!this.dropElevationTarget)return;const e=this.dropElevationTarget;this.clearDropElevationTimer(),this.dropElevationTimeout=globalThis.setTimeout((()=>{e.classList.remove(hv),this.dropElevationTarget===e&&(this.dropElevationTarget=void 0),this.dropElevationTimeout=void 0}),1e3)}clearDropElevationTimer(){void 0!==this.dropElevationTimeout&&(clearTimeout(this.dropElevationTimeout),this.dropElevationTimeout=void 0)}arraysEqual(e,t){if(e.length!==t.length)return!1;let n=0;for(const r of e){if(r!==t[n])return!1;n+=1}return!0}extractIndices(e=[]){return(null!=e?e:[]).map(((e,t)=>t))}getContextValue(){var e;const t=this.props.schema,n=null!==(e=this.props.formData)&&void 0!==e?e:[];return this.cachedContextValue&&this.cachedSchema===t&&this.cachedFormData===n||(this.cachedSchema=t,this.cachedFormData=n,this.cachedContextValue={arraySchema:t,formData:n}),this.cachedContextValue}}class pv extends xt.Component{constructor(e){super(e),this.props=e,this.state={isOpen:!1},this.handleOpen=()=>{this.setState({isOpen:!0})},this.handleAction=this.handleAction.bind(this),this.isDeepEmpty=this.isDeepEmpty.bind(this),this.state={isOpen:this.isDeepEmpty(e.data)}}componentDidMount(){const e=this.section;e.addEventListener("action",this.handleAction),e.addEventListener("open",this.handleOpen),this.setActions(e)}componentDidUpdate(){this.setActions(this.section)}componentWillUnmount(){const e=this.section;e.removeEventListener("action",this.handleAction),e.removeEventListener("open",this.handleOpen)}render(){const{data:e,schema:t,formSchema:n}=this.props;let r;this.state.isOpen&&(r=this.props.children);const o=this.props.allowItemReorder?xt.createElement("limel-drag-handle",{slot:"header",class:"drag-handle"}):null;return xt.createElement("limel-collapsible-section",{header:im(e,t,n)||"New item",class:"array-item limel-form-array-item--object",ref:e=>{this.section=e},"is-open":this.state.isOpen,"data-reorder-id":String(this.props.index),"data-reorderable":this.props.allowItemReorder?"true":"false"},o,r)}setActions(e){const{buttonsProps:t,allowItemRemoval:n}=this.props,r=[];n&&r.push({id:"remove",icon:"trash",disabled:!t.hasRemove,run:t.onRemoveItem}),e.actions=r}handleAction(e){e.stopPropagation(),e.detail.run(e)}isDeepEmpty(e){return"object"==typeof e&&(!!se(e)||Object.values(e).every(this.isDeepEmpty))}}class vv extends xt.Component{constructor(e){super(e),this.props=e,this.handleRemove=e=>{this.props.buttonsProps.onRemoveItem(e)},this.setRemoveButton=e=>{this.removeButton&&this.removeButton.removeEventListener("click",this.handleRemove),this.removeButton=e||void 0,this.removeButton&&this.removeButton.addEventListener("click",this.handleRemove)}}componentWillUnmount(){this.setRemoveButton(void 0)}render(){const{allowItemReorder:e}=this.props;return xt.createElement("div",{className:"array-item limel-form-array-item--simple","data-reorder-id":String(this.props.index),"data-reorderable":e?"true":"false"},this.props.children,this.renderRemoveButton(),this.renderDragHandle())}renderDragHandle(){if(this.props.allowItemReorder)return xt.createElement("limel-drag-handle",{class:"drag-handle"})}renderRemoveButton(){if(this.props.allowItemRemoval)return xt.createElement("limel-icon-button",{icon:"trash",disabled:!this.props.buttonsProps.hasRemove,ref:this.setRemoveButton})}}const yv=e=>{const t=Ot.useContext(sv),n=null==t?void 0:t.arraySchema,r=null==t?void 0:t.formData,o=e.registry.formContext,i=function(e,t){if(!1===((null==t?void 0:t.lime)||{}).allowItemReorder)return!1;const{buttonsProps:n}=e;return Boolean((null==n?void 0:n.hasMoveDown)||(null==n?void 0:n.hasMoveUp))}(e,n),a=function(e){return!1!==((null==e?void 0:e.lime)||{}).allowItemRemoval}(n);if(n&&Xh(n.items)){const t=Array.isArray(r)?r[e.index]:void 0;return xt.createElement(pv,{key:e.itemKey,buttonsProps:e.buttonsProps,index:e.index,data:t,schema:n,formSchema:null==o?void 0:o.schema,allowItemRemoval:a,allowItemReorder:i},e.children)}return xt.createElement(vv,{key:e.itemKey,buttonsProps:e.buttonsProps,index:e.index,allowItemRemoval:a,allowItemReorder:i},e.children)},bv="--number-of-columns";class gv extends xt.Component{constructor(e){super(e),this.props=e,this.handleResize=this.handleResize.bind(this),this.state={maxColumns:5},this.elementRef=xt.createRef()}componentDidMount(){this.observer=new ResizeObserver(this.handleResize),this.observer.observe(this.elementRef.current),window.addEventListener("resize",this.handleResize,{capture:!0,passive:!0})}componentWillUnmount(){this.observer.unobserve(this.elementRef.current),window.removeEventListener("resize",this.handleResize,{capture:!0})}handleResize(){requestAnimationFrame((()=>{const e=this.elementRef.current;if(!e)return;const t=e.getBoundingClientRect().width,n=Math.min(5,Math.max(1,Math.floor(t/240))),r=this.getColumnCount(n);e.style.getPropertyValue(bv)!==`${r}`&&e.style.setProperty(bv,`${r}`),n!==this.state.maxColumns&&this.setState({maxColumns:n})}))}render(){const e=["limel-form-layout--grid"],t=this.getColumnCount(this.state.maxColumns);return e.push(`layout-${t}-columns`),this.hasAutoFlowDense()&&e.push("auto-reorder-to-avoid-empty-cells"),xt.createElement("div",{className:e.join(" "),ref:this.elementRef},this.props.children)}getColumnCount(e){return Math.min(this.props.options.columns||5,e)}hasAutoFlowDense(){return!1!==this.props.options.dense}}const wv=Ot.createContext(!1);class $v extends xt.Component{constructor(e){super(e),this.props=e}render(){const e=["row"];return this.icon&&e.push("has-icon"),xt.createElement("div",{className:e.join(" ")},this.renderMainInformation(),this.renderDescription())}renderIcon(){if(this.icon)return xt.createElement("limel-icon",{name:this.icon})}renderMainInformation(){return xt.createElement("div",{className:"main-information"},this.renderIcon(),this.renderTitle(),this.renderChildren())}renderTitle(){var e;return xt.createElement("h1",{className:"title"},null===(e=this.schema)||void 0===e?void 0:e.title)}renderDescription(){var e;if(null===(e=this.schema)||void 0===e?void 0:e.description)return xt.createElement("limel-markdown",{class:"description",value:this.schema.description})}renderChildren(){return xt.createElement(wv.Provider,{value:!0},this.props.children)}get schema(){return this.props.children.props.schema}get icon(){var e,t,n;return null===(n=null===(t=null===(e=this.schema)||void 0===e?void 0:e.lime)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.icon}}class kv extends xt.Component{constructor(e){super(e),this.props=e,this.elementRef=xt.createRef()}render(){return xt.createElement("div",{className:["limel-form-row--layout"].join(" "),ref:this.elementRef},this.props.children.map(((e,t)=>xt.createElement($v,{key:t.toString()},e))))}}function Sv(e,t){var n;const r=null===(n=e.lime)||void 0===n?void 0:n.help;if(r)return xt.createElement("limel-help",Object.assign("string"==typeof r?{value:r}:Object.assign({},r),t))}const Ev=e=>{const t=Ot.useContext(sv),n=e.fieldPathId.$id;return t&&"root"!==n?xt.createElement(sv.Provider,{value:null},Ov(e.properties,e.schema)):"root"!==n&&(null===(r=e.schema.lime)||void 0===r?void 0:r.collapsible)?function(e){const t=!(!1!==e.schema.lime.collapsed),n=Sv(e.schema,{slot:"header"});return xt.createElement("limel-collapsible-section",{header:e.title,id:jv(e.registry.formContext.schema,e.fieldPathId),"is-open":t},n,om(e.description),Ov(e.properties,e.schema))}(e):function(e){return xt.createElement(xt.Fragment,{},function(e){const t=Sv(e.schema);return t?xt.createElement(xt.Fragment,{},rm(e.title),t):rm(e.title)}(e),om(e.description),Ov(e.properties,e.schema))}(e);var r};function jv(e,t){var n,r;return`${null!==(r=null===(n=e.$ref)||void 0===n?void 0:n.replace(/\//g,".").slice(2))&&void 0!==r?r:""}${t.path.map((e=>`.properties.${e}`)).join("")}`}function Ov(e,t){var n;return function(e,t){return{default:xv,grid:_v,row:Cv}[(null==t?void 0:t.type)||"default"](e,t)}(e,null===(n=t.lime)||void 0===n?void 0:n.layout)}function xv(e){return xt.createElement("div",{className:"limel-form-layout--default"},e.map((e=>e.content)))}function _v(e,t){return xt.createElement(gv,{options:t},e.map((e=>e.content)))}function Cv(e){return xt.createElement(kv,{},e.map((e=>e.content)))}function Dv(e){return null!=e&&""!==e&&(Array.isArray(e)?e.length>0:e instanceof Date||"object"!=typeof e||!se(e))}function Iv(e){return e.hasErrors&&(e.modified||e.hasValue||!e.required)}function Av(e){return e.required||e.minItems>0}function Fv(e,t,n){return(null==e?void 0:e.length)>0?Ne(i(e[0]).toLowerCase()):n||t}const Mv=Yh({customFormats:{integer:function(e){return Number.isInteger(Number(e))}},ajvOptionsOverrides:{allErrors:!0,multipleOfPrecision:2}}),Tv=(e,t,n,r)=>{if(!$e(t))return t;if(Pv(n))return t;const o=co(Mv,n,r,e),i=((e={},t={})=>mt(Object.keys(e),Object.keys(t)).filter((n=>!fe(t[n],e[n]))))(co(Mv,n,r,t).properties,o.properties);for(const e of i)delete t[e];return t};function Pv(e){return!!e.additionalProperties&&(!("properties"in e)||0===Object.values(e.properties).filter(b(Nv)).length)}function Nv(e){return!0===e[Ht]}const Rv=e=>{const t=null==e?void 0:e.type;return!!t&&(Array.isArray(t)?t.includes("null"):"null"===t)};class Uv extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=e=>{this.props.events.change(e.nativeEvent)},this.handleBlur=this.handleBlur.bind(this)}handleBlur(){this.setState({modified:!0})}getLabel(){if(this.context)return"";const{schema:e,label:t,hideLabel:n}=this.props.widgetProps;return n?"":t||e.title}isInvalid(){const{modified:e}=this.state,{rawErrors:t,required:n,schema:r}=this.props.widgetProps;return Iv({hasErrors:!!t,modified:e,hasValue:Dv(this.getValue()),required:Av({required:n,minItems:r.minItems})})}getHelperText(){const{rawErrors:e,schema:t}=this.props.widgetProps;return this.isInvalid()?Fv(e||[],t.description):this.context?"":t.description}getValue(){const{value:e}=this.props,{value:t}=this.props.widgetProps;return e||t}render(){const{name:e,extraProps:t}=this.props,n=this.isDisabled(),r=this.getValue(),o=this.isReadOnly();return xt.createElement(xt.Fragment,{},xt.createElement(e,Object.assign(Object.assign({value:r,label:this.getLabel(),disabled:n,readonly:o,required:Av({required:this.props.widgetProps.required,minItems:this.props.widgetProps.schema.minItems}),invalid:this.isInvalid(),"helper-text":this.getHelperText()},t),{onChange:this.handleChange,onBlur:this.handleBlur})),Sv(this.props.widgetProps.schema))}isDisabled(){var e,t;const n=this.props.widgetProps,r=n.schema.lime;return n.disabled||(null==r?void 0:r.disabled)||(null===(t=null===(e=null==r?void 0:r.component)||void 0===e?void 0:e.props)||void 0===t?void 0:t.disabled)}isReadOnly(){return this.props.widgetProps.readonly}}Uv.contextType=wv;class qv extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=this.handleChange.bind(this)}render(){var e,t;const n=this.props,{type:r="datetime"}=n,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(n,["type"]);return xt.createElement(Uv,{name:"limel-date-picker",value:this.getValue(),events:{change:this.handleChange},widgetProps:o,extraProps:Object.assign({type:r},null===(t=null===(e=o.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)})}getValue(){return"string"==typeof this.props.value?new Date(this.props.value):this.props.value}handleChange(e){const t=this.props;if(e.stopPropagation(),!t.onChange)return;if(!e.detail)return void t.onChange(null);const n=de(e.detail).format({"date-time":"YYYY-MM-DDTHH:mm:ssZ",date:"YYYY-MM-DD",time:"HH:mm:ss"}[t.schema.format]);t.onChange(n)}}const Lv=e=>{var{value:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["value"]);return"string"==typeof t&&zv.test(t)&&(t=new Date("2000-01-01T"+t)),xt.createElement(qv,Object.assign({type:"time",value:t},n))},zv=/^\d\d:\d\d/,{fields:Bv}=rc(),Vv=Bv.SchemaField,Wv=e=>{if(!customElements.get(e))throw new Error(`Custom form element '${e}' is not defined!`)};class Hv extends xt.Component{constructor(e){super(e),this.state={modified:!1},this.handleChange=this.handleChange.bind(this),this.handleCustomComponentChange=this.handleCustomComponentChange.bind(this)}isInvalid(){const{modified:e}=this.state,{errorSchema:t,required:n,schema:r}=this.props;return Iv({hasErrors:!se(t),modified:e,hasValue:Dv(this.props.formData),required:Av({required:n,minItems:r.minItems})})}getHelperText(){var e,t,n;const{errorSchema:r,schema:o}=this.props,i=!se(r)&&"__errors"in r,a=this.isInvalid()&&i?r.__errors:[],l=null===(n=null===(t=null===(e=o.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)||void 0===n?void 0:n.helperText;return Fv(a,o.description,l)}handleCustomComponentChange(e){const{schema:t}=this.props;e.stopPropagation();let n=e.nativeEvent.detail;((e,t)=>null===e&&!Rv(t))(n,t)&&(n=void 0),this.handleChange(n,this.props.fieldPathId.path)}handleChange(e,t){const{formData:n,schema:r}=this.props,{rootSchema:o}=this.props.registry;if(this.setState({modified:!0}),this.isDeepLeafChange(t))return void this.props.onChange(e,t);const i=Tv(n,e,r,o);this.props.onChange(i,t)}isDeepLeafChange(e){const{fieldPathId:t}=this.props;return!!t&&e.length>t.path.length}buildCustomComponentProps(){const{disabled:e,readonly:t,name:n,registry:r,schema:o,errorSchema:i,fieldPathId:a}=this.props,l=o,s=function(e,t){const n=e.propsFactory;if("function"!=typeof n)return{};return n(t)||{}}(r.formContext,l);return Object.assign(Object.assign({},s),{value:this.props.formData,required:Av({required:this.props.required,minItems:l.minItems}),readonly:t||l.readOnly,disabled:e,invalid:this.isInvalid(),label:this.context?"":l.title,helperText:this.context&&!this.isInvalid()?"":this.getHelperText(),ref:e=>{var t;return e.formInfo={schema:l,rootSchema:r.formContext.schema,errorSchema:i,rootValue:r.formContext.rootValue,name:n,schemaPath:null===(t=null==a?void 0:a.path)||void 0===t?void 0:t.map(String)},()=>{}}})}renderCustomComponent(e){const t=e.schema,{name:n,props:r}=(e=>{var t,n,r,o;return{name:null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.name,props:(null===(o=null===(r=e.lime)||void 0===r?void 0:r.component)||void 0===o?void 0:o.props)||{}}})(t);Wv(n);const o=xt.createElement(n,Object.assign(Object.assign(Object.assign({},r),this.buildCustomComponentProps()),{onChange:this.handleCustomComponentChange}));return xt.createElement(nm,Object.assign(Object.assign({},this.props),{classNames:"rjsf-field rjsf-field-custom"}),o,Sv(t))}render(){var e;if(null===(e=this.props.schema.lime)||void 0===e?void 0:e.hidden)return null;if((()=>{var e,t;const n=null===(t=null===(e=this.props.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.name;if(!n)return!1;try{Wv(n)}catch(e){return console.warn(`Custom component ${n} not defined`),!1}return!0})())return this.renderCustomComponent(this.props);const t=Object.assign(Object.assign({},this.props),{onChange:this.handleChange});return"time"===this.props.schema.format&&(t.uiSchema=Object.assign({"ui:widget":Lv},t.uiSchema)),xt.createElement(Vv,t)}}Hv.contextType=wv;const{fields:Gv}=rc(),Kv=Gv.ArrayField;class Jv extends xt.Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleReorder=this.handleReorder.bind(this),this.setWrapper=this.setWrapper.bind(this)}componentWillUnmount(){this.setWrapper(null)}setWrapper(e){this.wrapper&&this.wrapper.removeEventListener(uv,this.handleReorder),this.wrapper=null!=e?e:void 0,this.wrapper&&this.wrapper.addEventListener(uv,this.handleReorder)}handleReorder(e){e.stopPropagation();const{fromIndex:t,toIndex:n}=e.detail,{formData:r,fieldPathId:o}=this.props;if(!Array.isArray(r)||!o)return;const i=[...r],[a]=i.splice(t,1);i.splice(n,0,a),this.props.onChange(i,o.path)}handleChange(e,t){const{formData:n,schema:r}=this.props,{rootSchema:o}=this.props.registry;if(this.isDeepLeafChange(t))return void this.handleDeepLeafChange(e,t);if(!n)return void this.props.onChange(e,t);if(n.length!==e.length)return void this.props.onChange(e,t);const i=[];for(const[t,r]of n.entries())e[t]!==r&&i.push(t);if(1===i.length){const t=i[0];e[t]=Tv(n[t],e[t],r.items,o)}this.props.onChange(e,t)}isDeepLeafChange(e){const{formData:t,fieldPathId:n}=this.props;return Array.isArray(t)&&!!n&&e.length>n.path.length}handleDeepLeafChange(e,t){const{formData:n,fieldPathId:r}=this.props,[o,...i]=t.slice(r.path.length),a=Number(o),l=[...n];l[a]=this.buildResetItem(e,a,i),this.props.onChange(l,r.path)}buildResetItem(e,t,n){const{formData:r,schema:o}=this.props,{rootSchema:i}=this.props.registry,a=Array.isArray(o.items)?o.items[t]:o.items,l=function(e,t){let n=e;for(const e of t){if(!n)return;n=Yv(n,e)}return n}(a,n),s=null!==e||Rv(l)?e:void 0,u=r[t],c=function(e,t,n){if(0===t.length)return n;const r=function(e,t){return Array.isArray(e)||$e(e)?q(e):"number"==typeof t?[]:{}}(e,t[0]);return lt(r,t,n),r}(u,n,s);return Tv(u,c,a,i)}render(){const e=Object.assign(Object.assign({},this.props),{onChange:this.handleChange});return xt.createElement("div",{ref:this.setWrapper},xt.createElement(Kv,e))}}function Yv(e,t){var n;if("number"==typeof t){const n=e.items;return Array.isArray(n)?n[t]:n}return null===(n=e.properties)||void 0===n?void 0:n[t]}class Xv extends xt.Component{constructor(e){super(e),this.state={validationError:"",modified:!1},this.handleChange=this.handleChange.bind(this)}render(){const e=this.props;let t="{}";try{t=JSON.stringify(e.formData,null," ")}catch(e){}const{validationError:n,modified:r}=this.state,{errorSchema:o,formData:i,required:a}=e,l=!se(o)&&(r||null!=i||!a),s=n.length>0||l;let u;return n?u=n:l&&(u=Zv(o)),xt.createElement("limel-code-editor",{value:t,language:"json",lineNumbers:!0,fold:!0,lint:!0,onChange:this.handleChange,invalid:s,helperText:u})}componentDidUpdate(e){e.formData===this.props.formData||""===this.state.validationError&&!this.state.modified||this.setState({validationError:"",modified:!1})}handleChange(e){const t=this.props;if(e.stopPropagation(),!t.onChange)return;let n;try{n=JSON.parse(e.nativeEvent.detail)}catch(e){const t=e instanceof SyntaxError?`Invalid JSON: ${e.message}`:"Should be a valid JSON document";return void this.setState({validationError:t,modified:!0})}t.onChange(n,t.fieldPathId.path),this.setState({validationError:"",modified:!0})}}function Zv(e){if(e&&"object"==typeof e){if("__errors"in e&&Array.isArray(e.__errors)){const t=e.__errors;if(t.length>0)return t[0]}for(const t of Object.keys(e)){if("__errors"===t)continue;const n=e[t];if(n&&"object"==typeof n){const e=Zv(n);if(e)return`${t}: ${e}`}}}}const{fields:Qv}=rc(),ey=Qv.ObjectField;class ty extends xt.Component{render(){return Pv(this.props.schema)?xt.createElement(xt.Fragment,{},rm(this.props.schema.title),om(this.props.schema.description),xt.createElement(Xv,this.props)):xt.createElement(ey,this.props)}}class ny extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props,t=e.schema;let n,r;const o=function(e){var t,n;let r={};return(null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.props)&&(r=Object.assign(Object.assign({},r),e.lime.component.props)),r}(e.schema);return function(e){return e.multipleOf<1&&0===e.minimum&&1===e.maximum}(t)&&(n=100,r="%"),xt.createElement(Uv,{name:"limel-slider",value:e.value,events:{change:this.handleChange},widgetProps:e,extraProps:Object.assign({valuemin:t.minimum,valuemax:t.maximum,step:t.multipleOf,factor:n,unit:r},o)})}handleChange(e){const t=this.props;e.stopPropagation(),t.onChange&&t.onChange(e.detail)}}class ry extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props;if((Qh(t=e.schema)||em(t))&&"minimum"in t&&"maximum"in t&&"multipleOf"in t)return xt.createElement(ny,e);var t;const n=oy(e.schema),r=function(e){return Qh(e)&&e.multipleOf?+e.multipleOf||"any":em(e)?Math.floor(+e.multipleOf)||1:"any"}(e.schema),o=function(e){var t,n;let r={};return e.minimum&&(r.min=e.minimum),e.maximum&&(r.max=e.maximum),e.maxLength&&(r.maxlength=e.maxLength),e.minLength&&(r.minlength=e.minLength),(null===(n=null===(t=e.lime)||void 0===t?void 0:t.component)||void 0===n?void 0:n.props)&&(r=Object.assign(Object.assign({},r),e.lime.component.props)),r}(e.schema);return xt.createElement(Uv,{name:"limel-input-field",value:e.value,events:{change:this.handleChange},widgetProps:e,extraProps:Object.assign({step:r,type:n},o)})}handleChange(e){e.stopPropagation();const t=this.props,n=oy(t.schema);if(!t.onChange)return;let r;r=e.detail||"number"==typeof e.detail?e.detail:"number"===n||t.required?null:"",t.onChange(r)}}function oy(e){return Qh(e)||em(e)?"number":"email"===e.format?"email":"text"}function iy(e){var t;return{text:e.label,value:e.value,disabled:!!(null===(t=e.schema)||void 0===t?void 0:t.readOnly)}}const ay={CheckboxWidget:class extends xt.Component{constructor(e){super(e),this.props=e,this.handleChange=this.handleChange.bind(this)}render(){const e=this.props,t=null!==(o=null===(r=null===(n=e.schema.lime)||void 0===n?void 0:n.component)||void 0===r?void 0:r.props)&&void 0!==o?o:{};var n,r,o;return xt.createElement(Uv,{name:"limel-checkbox",value:e.value,widgetProps:e,extraProps:Object.assign({checked:!!e.value},t),events:{change:this.handleChange}})}handleChange(e){const t=this.props;e.stopPropagation(),t.onChange&&t.onChange(e.detail)}},DateTimeWidget:qv,DateWidget:e=>{var{value:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["value"]);return"string"==typeof t&&/-\d\d$/.test(t)&&(t+="T00:00"),xt.createElement(qv,Object.assign({type:"date",value:t},n))},EmailWidget:ry,TextWidget:ry,SelectWidget:class extends xt.Component{constructor(e){super(e),this.props=e,this.state={modified:!1},this.handleChange=this.handleChange.bind(this)}render(){var e,t;const n=this.props,r=n.options.enumOptions.map(iy);let o;o=n.multiple?function(e,t){return t.filter((t=>e.includes(t.value)))}(n.value,r):function(e,t){return t.find((t=>t.value===e))}(n.value,r);const i=(null===(t=null===(e=n.schema.lime)||void 0===e?void 0:e.component)||void 0===t?void 0:t.props)||{};return xt.createElement(Uv,{name:"limel-select",value:o,events:{change:this.handleChange},widgetProps:n,extraProps:Object.assign({multiple:n.multiple,options:r},i)})}handleChange(e){const t=this.props;if(e.stopPropagation(),t.onChange)if(he(e.detail)){const n=e.detail.map((e=>e.value));t.onChange(n)}else t.onChange(e.detail.value)}},RangeWidget:ny};const ly=class{constructor(n){e(this,n),this.change=t(this,"change"),this.validate=t(this,"validate"),this.schema={},this.disabled=!1,this.isValid=!0,this.initialized=!1,this.handleChange=this.handleChange.bind(this),this.getCustomErrorMessages=this.getCustomErrorMessages.bind(this)}connectedCallback(){this.initialize()}componentDidLoad(){this.initialize()}initialize(){this.initialized||this.host.shadowRoot.querySelector(".root")&&(this.initialized=!0,this.reactRender(),this.validateFormData())}componentDidUpdate(){this.reactRender(),this.validateFormData()}disconnectedCallback(){this.root&&(this.root.unmount(),this.root=void 0),this.initialized=!1}render(){return n("div",{key:"56c9180ab3e5b4ee3282db2c38b5eaf522e8c60f",class:"root"})}reactRender(){if(!this.root){const e=this.host.shadowRoot.querySelector(".root");this.root=qt.createRoot(e)}this.root.render(xt.createElement(ic,{schema:this.prepareSchema(this.schema),formData:this.value,onChange:this.handleChange,widgets:ay,validator:Mv,liveValidate:"onChange",showErrorList:!1,extraErrors:this.getExtraErrors(this.errors),templates:{FieldTemplate:nm,ArrayFieldTemplate:mv,ArrayFieldItemTemplate:yv,ObjectFieldTemplate:Ev},disabled:this.disabled,transformErrors:this.getCustomErrorMessages,formContext:{schema:this.schema,rootValue:this.value,propsFactory:this.propsFactory},fields:{SchemaField:Hv,ArrayField:Jv,ObjectField:ty}},[]))}handleChange(e){this.change.emit(e.formData)}validateFormData(){var e;const{errors:t}=Mv.validateFormData(null!==(e=this.value)&&void 0!==e?e:{},this.prepareSchema(this.schema));this.emitValidationStatus(t)}prepareSchema(e){const{$id:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["$id"]),r=JSON.stringify(n);let o=5381;for(let e=0;e<r.length;e++)o=(o<<5)+o+r.codePointAt(e)&4294967295;const i=(o>>>0).toString(36);return Object.assign(Object.assign({},e),{$id:t?`${t}-${i}`:i})}hasExtraErrors(){return!!this.errors&&Object.keys(this.errors).length>0}emitValidationStatus(e){const t=!(e&&0!==e.length||this.hasExtraErrors()),n=this.mapErrors(null!=e?e:[]);this.isValid===t&&t||this.validate.emit({valid:t,errors:n}),this.isValid=t}mapErrors(e){return e.map((e=>({name:e.name,property:e.property,message:e.message,schemaPath:e.schemaPath,params:e.params})))}getExtraErrors(e){var t,n,r;if(e)return t=e,r={},n=s(n=e=>Array.isArray(e)?{__errors:e}:this.getExtraErrors(e)),B(t,(function(e,t,o){Z(r,t,n(e,t,o))})),r}getCustomErrorMessages(e){if(!this.transformErrors)return e;const t=this.mapErrors(e);return this.transformErrors.call({},t).map((t=>{const n=e.find((e=>t.property===e.property));return Object.assign(Object.assign({},n),{message:t.message})}))}get host(){return r(this)}};ly.style='@charset "UTF-8";.limel-form-row--layout{--limel-form-row-border-radius:0.375rem;--limel-form-row-icon-size:1.75rem;--limel-form-row-main-information-gap:0.5rem;display:flex;flex-direction:column}.limel-form-row--layout .row{display:flex;gap:0.5rem;flex-direction:column;padding:0.5rem 1rem}.limel-form-row--layout .row:nth-child(odd){background-color:var(--form-background-color-of-odd-rows, rgb(var(--contrast-200)))}.limel-form-row--layout .row:nth-child(even){background-color:var(--form-background-color-of-even-rows, transparent)}.limel-form-row--layout .row:first-child{border-radius:var(--limel-form-row-border-radius) var(--limel-form-row-border-radius) 0 0}.limel-form-row--layout .row:last-child{border-radius:0 0 var(--limel-form-row-border-radius) var(--limel-form-row-border-radius)}.limel-form-row--layout .main-information{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--limel-form-row-main-information-gap);min-width:0}.limel-form-row--layout .main-information{position:relative}.limel-form-row--layout .main-information>.rjsf-field{position:unset}.limel-form-row--layout .main-information>.rjsf-field limel-help{top:0}.limel-form-row--layout limel-icon{color:rgb(var(--contrast-1200));width:var(--limel-form-row-icon-size);flex-shrink:0;min-width:0}.limel-form-row--layout .title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin:0;font-weight:normal;flex-grow:1;color:var(--limel-theme-on-surface-color);font-size:0.875rem}.limel-form-row--layout .description{margin:0;color:var(--limel-theme-text-secondary-on-background-color);font-size:var(--limel-theme-default-small-font-size);line-height:1.5}.limel-form-row--layout .has-icon .description{padding-left:calc(var(--limel-form-row-icon-size) + var(--limel-form-row-main-information-gap))}.limel-form-row--layout .rjsf-field{flex-shrink:0;display:flex;align-content:center}.limel-form-row--layout .rjsf-field limel-slider{min-width:8rem;display:block}*,*::after,*::before{box-sizing:border-box}.rjsf-field{min-width:0}.limel-form-array-item--simple{display:flex;align-items:center;padding:0.25rem}.limel-form-array-item--simple>*:first-child{flex:1;min-width:0}.array-items{isolation:isolate;display:flex;flex-direction:column;row-gap:var(--form-row-gap, 0.5rem);margin-top:1rem}.array-items.has-an-item-which-is-being-dragged limel-collapsible-section{--limel-cs-grid-template-rows:0fr;--limel-cs-opacity-transition-speed:0.2s;--limel-cs-grid-template-rows-transition-speed:0.2s;--limel-cs-open-header-bottom-border-radius:0.75rem}.array-item:has(limel-drag-handle:hover),.array-item:has(limel-drag-handle:focus-within),.array-item.is-elevated,.array-item.sortable-chosen{will-change:transform, box-shadow, border-radius, background-color}.array-item.sortable-ghost{border-radius:0.5rem;box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}.array-item.sortable-chosen{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color)}.array-item.is-elevated[draggable=false]{animation:sit-here 0.8s forwards}@keyframes sit-here{0%{border-radius:0.5rem;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--shadow-depth-64), 0 0.65rem 0.75rem -0.425rem rgb(var(--color-black), 0.3)}100%{box-shadow:none}}limel-drag-handle{order:10}limel-collapsible-section.is-being-dragged{border-radius:0.75rem !important}.limel-form-layout--default{display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem)}.limel-form-layout--grid{--min-height-of-one-row:2.5rem;display:grid;column-gap:var(--form-column-gap, 1rem);row-gap:var(--form-row-gap, 1rem);padding:var(--form-body-padding, 1rem);grid-template-columns:repeat(var(--number-of-columns), minmax(0, 1fr))}.limel-form-layout--grid.auto-reorder-to-avoid-empty-cells{grid-auto-flow:dense}.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--1,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-1-columns .limel-form-layout-colspan--5{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--2,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-2-columns .limel-form-layout-colspan--5{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--3,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-3-columns .limel-form-layout-colspan--5{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--4,.limel-form-layout--grid.layout-4-columns .limel-form-layout-colspan--5{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--1{grid-column:span 1}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--2{grid-column:span 2}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--3{grid-column:span 3}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--4{grid-column:span 4}.limel-form-layout--grid.layout-5-columns .limel-form-layout-colspan--5{grid-column:span 5}.limel-form-layout--grid .limel-form-layout-colspan--all{grid-column:1/-1}.limel-form-layout--grid limel-checkbox,.limel-form-layout--grid limel-switch{min-height:var(--min-height-of-one-row)}.limel-form-layout--grid limel-checkbox{display:block}.limel-form-layout--grid limel-switch{margin-left:0.5rem}.form-error{color:var(--limel-theme-error-color);font-size:0.6875rem;line-height:1.5;visibility:inherit;padding-right:1rem;padding-left:1rem;padding-top:0.25rem}.button-add-new{margin-top:0.5rem;width:100%}h1{position:relative;margin-top:0;margin-bottom:0;word-break:break-word;hyphens:auto;-webkit-hyphens:auto;text-wrap:balance;font-size:var(--limel-form-h1-font-size);line-height:calc(var(--limel-form-h1-font-size) * 1.42857);letter-spacing:-0.01rem;font-weight:500}limel-markdown{display:block;margin-bottom:0.5rem}.rjsf-field{position:relative}.rjsf-field limel-help{position:absolute;top:calc(var(--form-row-gap, 1rem) * -0.5);left:calc(var(--form-column-gap, 1rem) * -0.5)}.rjsf-field h1{color:rgb(var(--contrast-1400), 0.8)}.rjsf-field h1{--limel-form-h1-font-size:1.476rem;font-weight:800}.rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.383rem;font-weight:700}.rjsf-field .rjsf-field h1:before{content:"";display:block;position:absolute;top:0;bottom:0;margin:auto;left:-0.75rem;background-color:var(--lime-primary-color, var(--limel-theme-primary-color));width:0.125rem;height:1.5rem;border-radius:0.125rem;opacity:0.6}.rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.296rem;font-weight:600}.rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.215rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.138rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1{--limel-form-h1-font-size:1.067rem}.rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field .rjsf-field h1:before{display:none}';export{ly as limel_form}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/i,t={r:255,g:255,b:255};function r(n){if(!n)return;const t=n.querySelectorAll('[style*="color"]');for(const n of t)e(n)}function e(n){const t=n.style.color;if(!t||function(n){const t=n.trim().toLowerCase();return"inherit"===t||"currentcolor"===t||"unset"===t}(t))return;const r=f(getComputedStyle(n).color);if(!r)return;const e=u(n);var o,c;e&&(o=l(a(r,e)),c=l(e),(Math.max(o,c)+.05)/(Math.min(o,c)+.05)>=3||(n.style.removeProperty("color"),n.style.cssText||n.removeAttribute("style")))}function u(n){let t=n;for(;t;){const n=o(t);if("image"===n)return null;if("transparent"!==n)return c(n,i(t));t=i(t)}return s()}function o(n){const t=getComputedStyle(n);if(t.backgroundImage&&"none"!==t.backgroundImage)return"image";const r=f(t.backgroundColor);return r&&0!==r.a?r:"transparent"}function c(n,t){if(n.a>=1)return{r:n.r,g:n.g,b:n.b};if(!t)return a(n,s());const r=u(t);return r?a(n,r):null}function s(){if(!document.body)return t;const n=f(getComputedStyle(document.body).backgroundColor);return n&&n.a>0?{r:n.r,g:n.g,b:n.b}:t}function i(n){if(!n)return null;if(n.parentElement)return n.parentElement;const t=n.getRootNode();return t instanceof ShadowRoot?t.host:null}function f(t){if(!t)return null;if("transparent"===t)return{r:0,g:0,b:0,a:0};const r=n.exec(t);if(!r)return null;const e=void 0===r[4]?1:Number.parseFloat(r[4]);return{r:Number.parseInt(r[1],10),g:Number.parseInt(r[2],10),b:Number.parseInt(r[3],10),a:e}}function a(n,t){const r=n.a;return{r:Math.round(n.r*r+t.r*(1-r)),g:Math.round(n.g*r+t.g*(1-r)),b:Math.round(n.b*r+t.b*(1-r))}}function l(n){const t=n=>{const t=n/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return.2126*t(n.r)+.7152*t(n.g)+.0722*t(n.b)}export{r as a}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,h as a,H as r}from"./p-DBTJNfo7.js";import{t as i}from"./p-Dv3YcsA7.js";import{a as o}from"./p-Dgcw_h7C.js";function l(e){const t=e.trim().toLowerCase();return t.startsWith("https://")||t.startsWith("http://")}function n(e,t,a){return!!t.escapeNext&&(a(e),t.escapeNext=!1,!0)}function s(e,t,a){return!(!t.inQuotes||"\\"!==e||(a(e),t.escapeNext=!0,0))}function d(e,t,a){return'"'===e&&0===t.angleDepth&&(a(e),t.inQuotes=!t.inQuotes,!0)}function m(e,t,a){return!t.inQuotes&&("<"===e?(a(e),t.angleDepth+=1,!0):">"===e&&0!==t.angleDepth&&(a(e),t.angleDepth-=1,!0))}function c(e,t){return","===e&&!t.inQuotes&&0===t.angleDepth}function h(e,t=1){if(null==e||Number.isNaN(e))return"";if(e<0)return"";if(0===e)return"0 B";const a=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.max(0,Math.min(a.length-1,Math.floor(Math.log(e)/Math.log(1024)))),i=e/Math.pow(1024,r),o=Number.isFinite(t)?Math.trunc(t):0,l=i<10?Math.min(100,Math.max(0,o)):0;return`${Number.parseFloat(i.toFixed(l))} ${a[r]}`}const u=class{constructor(r){e(this,r),this.allowRemoteImagesChange=t(this,"allowRemoteImagesChange"),this.language="en",this.allowRemoteImagesState=!1,this.renderAttachment=(e,t)=>{var r,i;const o=(null===(r=e.filename)||void 0===r?void 0:r.trim())||this.getTranslation("file-viewer.email.attachment.unnamed"),l=(null===(i=e.mimeType)||void 0===i?void 0:i.trim())||"";return a("li",{key:`attachment-${t}`},a("span",{class:"attachment-filename"},o),a("span",{class:"attachment-mime-type"}," ",l),this.renderSizeBadge(e.size))},this.renderSizeBadge=e=>{if("number"==typeof e)return a("limel-badge",{class:"attachment-size",label:h(e)})},this.onEnableRemoteImagesClick=e=>{var t;null===(t=null==e?void 0:e.stopPropagation)||void 0===t||t.call(e),this.enableRemoteImages()},this.enableRemoteImages=()=>{void 0===this.allowRemoteImages?this.allowRemoteImagesState=!0:this.allowRemoteImagesChange.emit(!0)}}resetAllowRemoteImages(e,t){e?e.from!==(null==t?void 0:t.from)&&(this.allowRemoteImagesState=!1):this.allowRemoteImagesState=!1}componentDidRender(){var e;(null===(e=this.bodyElement)||void 0===e?void 0:e.isConnected)&&o(this.bodyElement)}render(){return a(r,{key:"25592be91649a98427363488998f461470346f06"},a("div",{key:"e07d2c18bc5ebd7ff922afa4c8becb1f987bb0da",class:"email",part:"email"},this.renderHeaders(),this.renderRemoteImageBanner(),a("section",{key:"aa174224531cbcc77f1b29b0c828d7dc8fab5d7c"},this.renderAttachments(),this.renderBody())))}renderHeaders(){return a("div",{class:"email-headers",part:"email-headers"},["subject","from","to","cc","date"].map((e=>{var t;return this.renderEmailHeader(e,this.getTranslation(`file-viewer.email.${e}`),null===(t=this.email)||void 0===t?void 0:t[e])})))}renderBody(){return this.renderBodyHtml()||this.renderBodyText()||this.renderFallbackUrl()||a("slot",{name:"fallback"})}renderBodyHtml(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyHtml;if(!t)return;const r=function(e,t){if(!t)return e;const a=(new DOMParser).parseFromString(e,"text/html"),r=a.querySelectorAll("img[data-remote-src]");for(const e of r){const t=e.dataset.remoteSrc;t&&l(t)?(e.setAttribute("src",t),delete e.dataset.remoteSrc):delete e.dataset.remoteSrc}return`${[...a.head.querySelectorAll("style")].map((e=>e.outerHTML)).join("")}${a.body.innerHTML}`}(t,this.getAllowRemoteImages());return a("div",{class:"body",innerHTML:r,part:"email-body",ref:e=>this.bodyElement=e})}renderBodyText(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyText;if(t)return a("pre",{class:"body plain-text",part:"email-body"},t)}renderFallbackUrl(){if(this.fallbackUrl)return a("object",{data:this.fallbackUrl,type:"text/plain"},a("slot",{name:"fallback"}))}renderEmailHeader(e,t,r){if(!r)return;const i=this.getHeaderValues(e,r);return a("dl",{class:`headers ${e}`},a("dt",null,t),i.map(((t,r)=>a("dd",{key:`${e}-${r}`},t))))}getHeaderValues(e,t){return"to"===e||"cc"===e?function(e){const t=[];let a="";const r={inQuotes:!1,escapeNext:!1,angleDepth:0},i=e=>{a+=e},o=()=>{const e=a.trim();e&&t.push(e),a=""};for(const t of e)n(t,r,i)||s(t,r,i)||d(t,r,i)||m(t,r,i)||(c(t,r)?o():i(t));return o(),t}(t):[t]}renderAttachments(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.attachments;if(!(null==t?void 0:t.length))return;const r=this.getTranslation("file-viewer.email.attachments");return a("div",{class:"attachments"},a("span",null,r),a("ul",null,t.map(((e,t)=>this.renderAttachment(e,t)))))}getTranslation(e){return i.get(e,this.language)}shouldShowRemoteImagesBanner(){var e;const t=null===(e=this.email)||void 0===e?void 0:e.bodyHtml;return!(!t||this.getAllowRemoteImages())&&(a=t,null!==(new DOMParser).parseFromString(a,"text/html").querySelector("img[data-remote-src]"));var a}renderRemoteImageBanner(){if(!this.shouldShowRemoteImagesBanner())return;const e=this.getTranslation("file-viewer.email.remote-images.warning"),t=this.getTranslation("file-viewer.email.remote-images.warning.description"),r=this.getTranslation("file-viewer.email.remote-images.load");return a("limel-collapsible-section",{header:e,icon:{name:"warning_shield",color:"rgb(var(--color-orange-default))"},language:this.language},a("button",{type:"button",class:"load-images",slot:"header",onClick:this.onEnableRemoteImagesClick},r),a("limel-markdown",{value:t}))}getAllowRemoteImages(){var e;return null!==(e=this.allowRemoteImages)&&void 0!==e?e:this.allowRemoteImagesState}static get watchers(){return{email:[{resetAllowRemoteImages:0}]}}};u.style='@charset "UTF-8";:host(limel-email-viewer){display:block;width:100%;height:100%;box-sizing:border-box}*,*::before,*::after{box-sizing:border-box;min-width:0;min-height:0}.email{display:flex;flex-direction:column;width:100%;height:100%;padding-bottom:0.5rem;box-shadow:var(--shadow-depth-8)}.email-headers{position:relative;flex-shrink:0;display:flex;flex-direction:column}.email-headers dl,.email-headers dt,.email-headers dd{margin:0}.email-headers dl{display:flex;flex-wrap:wrap;gap:0 0.5rem;padding:0.5rem 0.75rem;font-size:0.75rem}.email-headers dl:nth-child(even){background-color:rgb(var(--contrast-800), 0.1)}.email-headers dl dt{opacity:0.6;min-width:3rem}.email-headers dl dt::after{content:":"}.email-headers dl dd:not(:last-child)::after{content:",";opacity:0.6}.email-headers dl.subject dd{font-weight:bold}.email-headers dl.date{position:absolute;right:0.25rem;bottom:0;transform:translateY(50%);font-size:0.625rem;border-radius:9rem;padding:0.125rem 0.25rem;background-color:rgb(var(--contrast-100), 0.8);border:rgb(var(--contrast-600)) solid 1px}.email-headers dl.date dt{position:absolute;width:0;height:0;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0, 0, 0, 0);clip-path:inset(50%);white-space:nowrap}.attachments{flex-shrink:0;padding:0.5rem;border-bottom:1px dashed rga(var(--contrast-700))}.attachments span{padding-left:0.25rem;font-size:0.75rem;opacity:0.6}.attachments span:first-child::after{content:":"}.attachments ul{all:unset;display:grid;grid-template-columns:repeat(auto-fill, minmax(8rem, 1fr));gap:0.5rem;padding:0.5rem 0}.attachments li{all:unset;position:relative;display:flex;flex-direction:column;gap:0.25rem;font-size:0.6875rem;line-height:normal;padding:0.5rem 0.5rem 1rem 0.5rem;border-radius:0.5rem;border:1px solid rgba(var(--contrast-600));background-color:rgba(var(--contrast-400))}.attachments .attachment-filename{font-weight:500}.attachments .attachment-mime-type{opacity:0.7}.attachments limel-badge{--badge-max-width:auto;--badge-background-color:rgb(var(--contrast-1000), 0.7);--badge-text-color:rgb(var(--color-white));position:absolute;bottom:0.125rem;right:0.125rem;box-shadow:var(--shadow-brighten-edges-outside)}section{flex-grow:1;display:flex;flex-direction:column;border-top:1px dashed rgba(var(--contrast-700));min-height:2rem;overflow-y:auto}limel-collapsible-section{--closed-header-background-color:var( --lime-elevated-surface-background-color );flex-grow:1;flex-shrink:0;margin:0.5rem;border-radius:0.75rem;box-shadow:var(--shadow-depth-8)}limel-collapsible-section button{appearance:none;background:none;border:none;padding:0;margin:0;font:inherit;color:inherit;text-align:inherit;flex-shrink:0;border-radius:0.375rem;padding:0.25rem 0.5rem;font-size:var(--limel-theme-small-font-size);margin:0 0.5rem}limel-collapsible-section button.load-images{transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:var(--lime-primary-color, var(--limel-theme-primary-color));background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal)}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:focus,limel-collapsible-section button.load-images:focus-visible{will-change:color, background-color, box-shadow, transform}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:focus-visible{transform:translate3d(0, -0.04rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}limel-collapsible-section button.load-images:active{--limel-clickable-transform-timing-function:cubic-bezier( 0.83, -0.15, 0.49, 1.16 );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}limel-collapsible-section button.load-images:hover,limel-collapsible-section button.load-images:active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}limel-collapsible-section limel-markdown{padding:0.5rem}.body{flex-grow:1;max-width:100%;padding:0.75rem}.body.plain-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit}.body img{max-width:100% !important}';export{u as limel_email_viewer}
|
|
@@ -48,6 +48,8 @@ export declare class EmailViewer {
|
|
|
48
48
|
*/
|
|
49
49
|
allowRemoteImagesChange: EventEmitter<boolean>;
|
|
50
50
|
protected resetAllowRemoteImages(newEmail?: Email, oldEmail?: Email): void;
|
|
51
|
+
private bodyElement?;
|
|
52
|
+
componentDidRender(): void;
|
|
51
53
|
render(): any;
|
|
52
54
|
private renderHeaders;
|
|
53
55
|
private renderBody;
|
|
@@ -72,6 +72,20 @@ export declare class Form {
|
|
|
72
72
|
private reactRender;
|
|
73
73
|
private handleChange;
|
|
74
74
|
private validateFormData;
|
|
75
|
+
/**
|
|
76
|
+
* Returns a copy of the schema with `$id` replaced by a content-based
|
|
77
|
+
* value, so the validator never confuses two schemas that share the
|
|
78
|
+
* same `$id` but differ in content — e.g. a server schema reused with
|
|
79
|
+
* a different subset of properties at runtime.
|
|
80
|
+
*
|
|
81
|
+
* The new `$id` is built from a short numeric fingerprint of the
|
|
82
|
+
* stringified content. A fingerprint (rather than the content itself)
|
|
83
|
+
* keeps the value short and URI-safe — `$id` is parsed as a URI by
|
|
84
|
+
* the validator and must not contain JSON-shaped characters.
|
|
85
|
+
*
|
|
86
|
+
* @param schema - the schema to prepare
|
|
87
|
+
*/
|
|
88
|
+
private prepareSchema;
|
|
75
89
|
private hasExtraErrors;
|
|
76
90
|
private emitValidationStatus;
|
|
77
91
|
private mapErrors;
|
|
@@ -28,6 +28,7 @@ import { CustomElementDefinition } from '../../global/shared-types/custom-elemen
|
|
|
28
28
|
* @exampleComponent limel-example-markdown-custom-component
|
|
29
29
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
30
30
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
31
|
+
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
31
32
|
* @exampleComponent limel-example-markdown-composite
|
|
32
33
|
*/
|
|
33
34
|
export declare class Markdown {
|
|
@@ -69,9 +70,24 @@ export declare class Markdown {
|
|
|
69
70
|
* whitespace (`<br />` or ` `).
|
|
70
71
|
*/
|
|
71
72
|
removeEmptyParagraphs: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Adapt rendered inline `color:` declarations to the surrounding
|
|
75
|
+
* surface. After each markdown re-render the component walks the
|
|
76
|
+
* rendered DOM and removes any inline `color` whose contrast against
|
|
77
|
+
* the resolved background falls below WCAG 3:1, letting the surface's
|
|
78
|
+
* themed text color inherit through. Brand colors that already meet
|
|
79
|
+
* contrast are left alone.
|
|
80
|
+
*
|
|
81
|
+
* Default `false` so the component remains a neutral renderer; turn
|
|
82
|
+
* this on for surfaces that render externally-authored content
|
|
83
|
+
* (e.g. imported email bodies) where the host application's theme
|
|
84
|
+
* drives the surrounding text color.
|
|
85
|
+
*/
|
|
86
|
+
adaptColorContrast: boolean;
|
|
72
87
|
textChanged(): Promise<void>;
|
|
73
88
|
handleWhitelistChange(): Promise<void>;
|
|
74
89
|
handleRemoveEmptyParagraphsChange(): Promise<void>;
|
|
90
|
+
handleAdaptColorContrastChange(): Promise<void>;
|
|
75
91
|
private rootElement;
|
|
76
92
|
private imageIntersectionObserver;
|
|
77
93
|
private cachedConsumerWhitelist?;
|
|
@@ -2480,9 +2480,15 @@ export namespace Components {
|
|
|
2480
2480
|
* @exampleComponent limel-example-markdown-custom-component
|
|
2481
2481
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
2482
2482
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
2483
|
+
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
2483
2484
|
* @exampleComponent limel-example-markdown-composite
|
|
2484
2485
|
*/
|
|
2485
2486
|
interface LimelMarkdown {
|
|
2487
|
+
/**
|
|
2488
|
+
* Adapt rendered inline `color:` declarations to the surrounding surface. After each markdown re-render the component walks the rendered DOM and removes any inline `color` whose contrast against the resolved background falls below WCAG 3:1, letting the surface's themed text color inherit through. Brand colors that already meet contrast are left alone. Default `false` so the component remains a neutral renderer; turn this on for surfaces that render externally-authored content (e.g. imported email bodies) where the host application's theme drives the surrounding text color.
|
|
2489
|
+
* @default false
|
|
2490
|
+
*/
|
|
2491
|
+
"adaptColorContrast": boolean;
|
|
2486
2492
|
/**
|
|
2487
2493
|
* Enable lazy loading for images
|
|
2488
2494
|
* @default false
|
|
@@ -5548,6 +5554,7 @@ declare global {
|
|
|
5548
5554
|
* @exampleComponent limel-example-markdown-custom-component
|
|
5549
5555
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
5550
5556
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
5557
|
+
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
5551
5558
|
* @exampleComponent limel-example-markdown-composite
|
|
5552
5559
|
*/
|
|
5553
5560
|
interface HTMLLimelMarkdownElement extends Components.LimelMarkdown, HTMLStencilElement {
|
|
@@ -9031,9 +9038,15 @@ declare namespace LocalJSX {
|
|
|
9031
9038
|
* @exampleComponent limel-example-markdown-custom-component
|
|
9032
9039
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
9033
9040
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
9041
|
+
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
9034
9042
|
* @exampleComponent limel-example-markdown-composite
|
|
9035
9043
|
*/
|
|
9036
9044
|
interface LimelMarkdown {
|
|
9045
|
+
/**
|
|
9046
|
+
* Adapt rendered inline `color:` declarations to the surrounding surface. After each markdown re-render the component walks the rendered DOM and removes any inline `color` whose contrast against the resolved background falls below WCAG 3:1, letting the surface's themed text color inherit through. Brand colors that already meet contrast are left alone. Default `false` so the component remains a neutral renderer; turn this on for surfaces that render externally-authored content (e.g. imported email bodies) where the host application's theme drives the surrounding text color.
|
|
9047
|
+
* @default false
|
|
9048
|
+
*/
|
|
9049
|
+
"adaptColorContrast"?: boolean;
|
|
9037
9050
|
/**
|
|
9038
9051
|
* Enable lazy loading for images
|
|
9039
9052
|
* @default false
|
|
@@ -11026,6 +11039,7 @@ declare namespace LocalJSX {
|
|
|
11026
11039
|
"value": string;
|
|
11027
11040
|
"lazyLoadImages": boolean;
|
|
11028
11041
|
"removeEmptyParagraphs": boolean;
|
|
11042
|
+
"adaptColorContrast": boolean;
|
|
11029
11043
|
}
|
|
11030
11044
|
interface LimelMasonryLayoutAttributes {
|
|
11031
11045
|
"ordered": boolean;
|
|
@@ -12206,6 +12220,7 @@ declare module "@stencil/core" {
|
|
|
12206
12220
|
* @exampleComponent limel-example-markdown-custom-component
|
|
12207
12221
|
* @exampleComponent limel-example-markdown-custom-component-with-json-props
|
|
12208
12222
|
* @exampleComponent limel-example-markdown-remove-empty-paragraphs
|
|
12223
|
+
* @exampleComponent limel-example-markdown-adapt-color-contrast
|
|
12209
12224
|
* @exampleComponent limel-example-markdown-composite
|
|
12210
12225
|
*/
|
|
12211
12226
|
"limel-markdown": LocalJSX.IntrinsicElements["limel-markdown"] & JSXBase.HTMLAttributes<HTMLLimelMarkdownElement>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
interface RGB {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
}
|
|
6
|
+
interface RGBA extends RGB {
|
|
7
|
+
a: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Walk descendants of `root` and remove inline `color` declarations that
|
|
11
|
+
* fail a 3:1 contrast ratio against their resolved background.
|
|
12
|
+
* @param root - Element or ShadowRoot whose descendants should be evaluated.
|
|
13
|
+
*/
|
|
14
|
+
export declare function adaptColorContrast(root: Element | ShadowRoot): void;
|
|
15
|
+
/**
|
|
16
|
+
* Parse a CSS color string (`rgb(...)`, `rgba(...)`, or `transparent`).
|
|
17
|
+
* @param value - The color string to parse.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseColor(value: string): RGBA | null;
|
|
20
|
+
/**
|
|
21
|
+
* Source-over alpha blend of `fg` onto opaque `bg`.
|
|
22
|
+
* @param fg - Foreground color with alpha in [0..1].
|
|
23
|
+
* @param bg - Opaque background color.
|
|
24
|
+
*/
|
|
25
|
+
export declare function compositeOver(fg: RGBA, bg: RGB): RGB;
|
|
26
|
+
/**
|
|
27
|
+
* Relative luminance of an sRGB color per WCAG 2.x. Returns [0..1].
|
|
28
|
+
* @param rgb - The color to measure.
|
|
29
|
+
*/
|
|
30
|
+
export declare function relativeLuminance(rgb: RGB): number;
|
|
31
|
+
/**
|
|
32
|
+
* WCAG contrast ratio between two relative luminances. Returns [1..21].
|
|
33
|
+
* @param l1 - First luminance.
|
|
34
|
+
* @param l2 - Second luminance.
|
|
35
|
+
*/
|
|
36
|
+
export declare function contrastRatio(l1: number, l2: number): number;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=adapt-color-contrast.d.ts.map
|