lituix 0.1.26 → 0.1.28
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/components.json +3 -15
- package/dist/components/button-group-state.d.ts +0 -5
- package/dist/components/button-group-state.d.ts.map +1 -1
- package/dist/components/lui-button-group-item.d.ts +0 -1
- package/dist/components/lui-button-group-item.d.ts.map +1 -1
- package/dist/components/lui-button-group.d.ts +1 -5
- package/dist/components/lui-button-group.d.ts.map +1 -1
- package/dist/components/lui-tab.d.ts +1 -1
- package/dist/components/lui-tab.d.ts.map +1 -1
- package/dist/index.browser.js +80 -50
- package/dist/index.browser.js.map +2 -2
- package/dist/index.cjs +211 -181
- package/dist/index.cjs.map +2 -2
- package/dist/index.mjs +163 -133
- package/dist/index.mjs.map +2 -2
- package/package.json +89 -89
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDescriptor;var W2=Object.getOwnPropertyNames;var U2=Object.getPrototypeOf,G2=Object.prototype.hasOwnProperty;var dh=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var Y2=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),X2=(i,o)=>{for(var e in o)fs(i,e,{get:o[e],enumerable:!0})},Z2=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of W2(o))!G2.call(i,r)&&r!==e&&fs(i,r,{get:()=>o[r],enumerable:!(t=ch(o,r))||t.enumerable});return i};var da=(i,o,e)=>(e=i!=null?K2(U2(i)):{},Z2(o||!i||!i.__esModule?fs(e,"default",{value:i,enumerable:!0}):e,i));var a=(i,o,e,t)=>{for(var r=t>1?void 0:t?ch(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&fs(o,e,r),r};var uh=(i,o,e)=>o.has(i)||dh("Cannot "+e);var ve=(i,o,e)=>(uh(i,o,"read from private field"),e?e.call(i):o.get(i)),hh=(i,o,e)=>o.has(i)?dh("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),ph=(i,o,e,t)=>(uh(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var Sa,xp=nc(()=>{Sa=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function Oc(i){return i==="horizontal"?"width":"height"}var Fs,wp=nc(()=>{Fs=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[Oc(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Mp={};X2(Mp,{FlowLayout:()=>Ls,flow:()=>wf});function _p(i){return i==="horizontal"?"marginLeft":"marginTop"}function _f(i){return i==="horizontal"?"marginRight":"marginBottom"}function Mf(i){return i==="horizontal"?"xOffset":"yOffset"}function Cf(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var wf,Hc,Ls,Cp=nc(()=>{xp();wp();wf=i=>Object.assign({type:Ls},i);Hc=class{constructor(){this._childSizeCache=new Sa,this._marginSizeCache=new Sa,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][Oc(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[_p(e)]||0,s=this._metricsCache.get(r-1)?.[_f(e)]||0;this._marginSizeCache.set(r,Cf(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[_p(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Ls=class extends Fs{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Hc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[Mf(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var _n=Y2((Lc,Bi)=>{(function(i,o){typeof Lc=="object"&&typeof Bi<"u"?Bi.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Lc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var R=function(c){return!!c&&e(c)==="object"},F=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return R(c)&&c.nodeType===11},object:R,func:F,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return R(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return R(c)&&c.length!==void 0&&F(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function fe(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var Te={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=Te.draggable,l.map.drag=Te,l.methodDict.drag="draggable",m.actions.drag=Te.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":fe,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:fe,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},et=Te,we={init:function(c){var l=c;we.document=l.document,we.DocumentFragment=l.DocumentFragment||no,we.SVGElement=l.SVGElement||no,we.SVGSVGElement=l.SVGSVGElement||no,we.SVGElementInstance=l.SVGElementInstance||no,we.Element=l.Element||no,we.HTMLElement=l.HTMLElement||we.Element,we.Event=l.Event,we.Touch=l.Touch||no,we.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function no(){}var Ne=we,Zt={init:function(c){var l=Ne.Element,u=c.navigator||{};Zt.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&Ne.document instanceof c.DocumentTouch,Zt.supportsPointerEvent=u.pointerEnabled!==!1&&!!Ne.PointerEvent,Zt.isIOS=/iP(hone|od|ad)/.test(u.platform),Zt.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),Zt.isIe9=/MSIE 9/.test(u.userAgent),Zt.isOperaMobile=u.appName==="Opera"&&Zt.supportsTouch&&/Presto/.test(u.userAgent),Zt.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",Zt.pEventTypes=Zt.supportsPointerEvent?Ne.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Zt.wheelEvent=Ne.document&&"onmousewheel"in Ne.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},hr=Zt;function ao(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function sn(c,l){for(;$.element(c);){if(Ao(c,l))return c;c=Yr(c)}return null}function Yr(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function Ao(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[hr.prefixedMatchesSelector](l)}var L=function(c){return c.parentNode||c.host};function J(c,l){for(var u,m=[],g=c;(u=L(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function he(c,l,u){for(;$.element(c);){if(Ao(c,l))return!0;if((c=Yr(c))===u)return Ao(c,l)}return!1}function Oe(c){return c.correspondingUseElement||c}function X(c){var l=c instanceof Ne.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function _e(c){var l,u=X(c);if(!hr.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ae(c){for(var l=[];c;)l.push(c),c=Yr(c);return l}function Ar(c){return!!$.string(c)&&(Ne.document.querySelector(c),!0)}function K(c,l){for(var u in l)c[u]=l[u];return c}function si(c,l,u){return c==="parent"?Yr(u):c==="self"?l.getRect(u):sn(u,c)}function so(c,l,u,m){var g=c;return $.string(g)?g=si(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=_e(g)),g}function Xr(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function lo(c){return!c||"x"in c&&"y"in c||((c=K({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function li(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function Bo(c,l,u){var m=u&&c.options[u];return Xr(so(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function co(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=ln(c)),$.array(c))return c.forEach(function(w){return co(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];co(c,b,u,m)}else if($.object(l))for(var y in l)co(ln(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function ln(c){return c.trim().split(/ +/)}var ea=function(c,l){return Math.sqrt(c*c+l*l)},P0=["webkit","moz"];function os(c,l){c.__set||(c.__set={});var u=function(g){if(P0.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function is(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function ku(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function xu(c){return c instanceof Ne.Event||c instanceof Ne.Touch}function ns(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function wu(c,l){return l=l||{x:0,y:0},hr.isOperaMobile&&xu(c)?(ns("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):ns("page",c,l),l}function ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function j0(c,l,u){var m=l.length>1?_u(l):l[0];wu(m,c.page),function(g,v){v=v||{},hr.isOperaMobile&&xu(g)?ns("screen",g,v):ns("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function _u(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return ea(v,b)}function Nl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Mu(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof Ne.Touch?"touch":"mouse"}function Cu(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Oe(l?l[0]:c.target),Oe(c.currentTarget)]}var as=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(as.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var zu=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Eu=function(c){return zu([],c)},ra=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},oa=function(c,l){return c[ra(c,l)]},cn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=ra(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(as);function Su(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Fl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!Ao(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var j=0,V=_.getAllElements();j<V.length;j++){var I=V[j];I!==b&&y.push({dropzone:_,element:I,rect:_.getRect(I)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function $u(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,j=M.rect,V=_.dropCheck(l,u,g,v,E,j);b.push(V?E:null)}var I=function(D){for(var W,B,G,de=[],ke=0;ke<D.length;ke++){var te=D[ke],pe=D[W];if(te&&ke!==W)if(pe){var mr=L(te),tt=L(pe);if(mr!==te.ownerDocument)if(tt!==te.ownerDocument)if(mr!==tt){de=de.length?de:J(pe);var Nr=void 0;if(pe instanceof Ne.HTMLElement&&te instanceof Ne.SVGElement&&!(te instanceof Ne.SVGSVGElement)){if(te===tt)continue;Nr=te.ownerSVGElement}else Nr=te;for(var uo=J(Nr,pe.ownerDocument),Wo=0;uo[Wo]&&uo[Wo]===de[Wo];)Wo++;var gs=[uo[Wo-1],uo[Wo],de[Wo]];if(gs[0])for(var ca=gs[0].lastChild;ca;){if(ca===gs[1]){W=ke,de=uo;break}if(ca===gs[2])break;ca=ca.previousSibling}}else G=pe,(parseInt(H(B=te).getComputedStyle(B).zIndex,10)||0)>=(parseInt(H(G).getComputedStyle(G).zIndex,10)||0)&&(W=ke);else W=ke}else W=ke}return W}(b);return m.activeDrops[I]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new cn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new cn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new cn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new cn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new cn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new cn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Su(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function Tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Fl(l,u.element));var b=m,y=$u(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var Au={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(et),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=co(y.listeners),M=Object.keys(w).reduce(function(E,j){return E[/^(enter|leave)/.test(j)?"drag".concat(j):/^(activate|deactivate|move)/.test(j)?"drop".concat(j):j]=w[j],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,j,V,I,D,W,B){var G=!1;if(!(B=B||E.getRect(W)))return!!E.options.drop.checker&&E.options.drop.checker(j,V,G,E,W,I,D);var de=E.options.drop.overlap;if(de==="pointer"){var ke=Bo(I,D,"drag"),te=wu(j);te.x+=ke.x,te.y+=ke.y;var pe=te.x>B.left&&te.x<B.right,mr=te.y>B.top&&te.y<B.bottom;G=pe&&mr}var tt=I.getRect(D);if(tt&&de==="center"){var Nr=tt.left+tt.width/2,uo=tt.top+tt.height/2;G=Nr>=B.left&&Nr<=B.right&&uo>=B.top&&uo<=B.bottom}return tt&&$.number(de)&&(G=Math.max(0,Math.min(B.right,tt.right)-Math.max(B.left,tt.left))*Math.max(0,Math.min(B.bottom,tt.bottom)-Math.max(B.top,tt.top))/(tt.width*tt.height)>=de),E.options.drop.checker&&(G=E.options.drop.checker(j,V,G,E,W,I,D)),G}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},K(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=Au.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Fl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Su(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":Tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;Tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Fl,getDrop:$u,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},O0=Au;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Nl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Nl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},H0=Kl;function R0(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:he(m,l,g))}function Pu(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var qo,Pi,Ko={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Ko.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Ko.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Ko,l.methodDict.resize="resizable",g.actions.resize=Ko.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:K({},v),corrected:K({},v),previous:K({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),Pu(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,j=w.previous;if(K(j,_),b){if(K(_,y),v==="reposition"){if(_.top>_.bottom){var V=_.top;_.top=_.bottom,_.bottom=V}if(_.left>_.right){var I=_.left;_.left=_.right,_.right=I}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var D in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[D]=_[D]-j[D];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),Pu(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=K({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=R0(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Ko.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Ko.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Ko.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Ko.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},I0=Ko,V0={id:"actions",install:function(c){c.usePlugin(H0),c.usePlugin(I0),c.usePlugin(et),c.usePlugin(O0)}},ju=0,ci={request:function(c){return qo(c)},cancel:function(c){return Pi(c)},init:function(c){if(qo=c.requestAnimationFrame,Pi=c.cancelAnimationFrame,!qo)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];qo=c["".concat(m,"RequestAnimationFrame")],Pi=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}qo=qo&&qo.bind(c),Pi=Pi&&Pi.bind(c),qo||(qo=function(g){var v=Date.now(),b=Math.max(0,16-(v-ju)),y=c.setTimeout(function(){g(v+b)},b);return ju=v+b,y},Pi=function(g){return clearTimeout(g)})}},re={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){re.isScrolling=!0,ci.cancel(re.i),c.autoScroll=re,re.interaction=c,re.prevTime=re.now(),re.i=ci.request(re.scroll)},stop:function(){re.isScrolling=!1,re.interaction&&(re.interaction.autoScroll=null),ci.cancel(re.i)},scroll:function(){var c=re.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=Ou(g.container,l,u),b=re.now(),y=(b-re.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:re.x*w,y:re.y*w};if(M.x||M.y){var _=Hu(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=Hu(v),j={x:E.x-_.x,y:E.y-_.y};(j.x||j.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:j,interaction:c,container:v})}re.prevTime=b}re.isScrolling&&(ci.cancel(re.i),re.i=ci.request(re.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&re.check(l.interactable,l.prepared.name))if(l.simulation)re.x=re.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=Ou(_.container,y,w);if($.window(E))b=u.clientX<re.margin,m=u.clientY<re.margin,g=u.clientX>E.innerWidth-re.margin,v=u.clientY>E.innerHeight-re.margin;else{var j=X(E);b=u.clientX<j.left+re.margin,m=u.clientY<j.top+re.margin,g=u.clientX>j.right-re.margin,v=u.clientY>j.bottom-re.margin}re.x=g?1:b?-1:0,re.y=v?1:m?-1:0,re.isScrolling||(re.margin=_.margin,re.speed=_.speed,re.start(l))}}};function Ou(c,l,u){return($.string(c)?si(c,l,u):c)||H(u)}function Hu(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var D0={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=re,re.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=re.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,re.stop(),re.interaction&&(re.interaction=null)},"interactions:stop":re.stop,"interactions:action-move":function(c){return re.onInteractionMove(c)}}},N0=D0;function ia(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function F0(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function L0(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var B0={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var j=y.getRect(_),V=w.buttons||{0:1,1:4,3:8,4:16}[w.button],I={action:null,interactable:y,interaction:M,element:_,rect:j,buttons:V};return E.fire("auto-start:check",I),I.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ia(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ia(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=L0,l.prototype.styleCursor=F0}};function Ru(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&ss(l,u,c,g)?c:null}function q0(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var j=Ru(E,M,_,v,b);if(j)return{action:j,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function Iu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=q0(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Yr(y)}return{action:null,interactable:null,element:null}}function Vu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,Nu(c,u),u.fire("autoStart:prepared",{interaction:c})}function ss(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,j=m.interactions.list;E<j.length;E++){var V=j[E],I=V.prepared.name;if(V.interacting()&&(++w>=y||V.interactable===c&&((M+=I===u.name?1:0)>=v||V.element===l&&(_++,I===u.name&&_>=b))))return!1}return y>0}function Du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function Nu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var K0={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(B0),u.base.actionChecker=null,u.base.styleCursor=!0,K(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return Du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:ss,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||Vu(u,Iu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||Vu(g,Iu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!ss(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),Nu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:Du,withinInteractionLimit:ss,validateAction:Ru},Gl=K0,W0={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,j=function(I){if(I!==u.interactable){var D=u.interactable.options.drag;if(!D.manualStart&&I.testIgnoreAllow(D,E,m)){var W=I.getAction(u.downPointer,u.downEvent,u,E);if(W&&W.name==="drag"&&function(B,G){if(!G)return!1;var de=G.options.drag.startAxis;return B==="xy"||de==="xy"||de===B}(_,I)&&Gl.validateAction(W,I,E,m,l))return I}}};$.element(E);){var V=l.interactables.forEachMatch(E,j);if(V){u.prepared.name="drag",u.interactable=V,u.element=E;break}E=Yr(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var U0={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},G0=U0,Y0={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(G0),c.usePlugin(W0)}},X0=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function Z0(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var Fu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=X0,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&Ao(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||ao(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=Z0,c},{})};function ls(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function dn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=dn(m):$.array(m)?l[u]=Eu(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=cs(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(j){var V=_[j];return V&&V.enabled&&{options:V,methods:V._methods}}).filter(function(j){return!!j})}(b);this.prepareStates(y),this.startEdges=K({},b.edges),this.edges=K({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=cs(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=K({},l.pageCoords),l.rect=K({},v),l.edges=K({},b);for(var y=g?this.states.slice(g):this.states,w=cs(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],j=E.options,V=K({},l.coords),I=null;(_=E.methods)!=null&&_.set&&this.shouldDo(j,m,u)&&(l.state=E,I=E.methods.set(l),li(l.edges,l.rect,{x:l.coords.x-V.x,y:l.coords.y-V.y})),w.eventProps.push(I)}K(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var D=this.result.coords,W=this.result.rect;if(D&&W){var B=w.rect.left!==W.left||w.rect.right!==W.right||w.rect.top!==W.top||w.rect.bottom!==W.bottom;w.changed=B||D.x!==w.coords.x||D.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&K(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],j=E[0],V=E[1];j.page.x+=V.x,j.page.y+=V.y,j.client.x+=V.x,j.client.y+=V.y}var I=this.result.rectDelta,D=l.rect||u.rect;D.left+=I.left,D.right+=I.right,D.top+=I.top,D.bottom+=I.bottom,D.width=D.right-D.left,D.height=D.bottom-D.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=K({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var j=E[_],V=j[0],I=j[1];V.page.x-=I.x,V.page.y-=I.y,V.client.x-=I.x,V.client.y-=I.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return dn(u)}),this.result=cs(K({},l.result.coords),K({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function cs(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function di(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function na(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var Q0={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":na,"interactions:action-move":na,"interactions:action-end":na,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},Lu=Q0,Bu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,j=(E&&E.options||Bu).deltaSource,V=Bo(E,y,v),I=b==="start",D=b==="end",W=I?f(_):m.prevEvent,B=I?m.coords.start:D?{page:W.page,client:W.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=K({},B.page),_.client=K({},B.client),_.rect=K({},m.rect),_.timeStamp=B.timeStamp,D||(_.page.x-=V.x,_.page.y-=V.y,_.client.x-=V.x,_.client.y-=V.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=I?m.pointers[m.pointers.length-1].downTime:W.t0,_.x0=m.coords.start.page.x-V.x,_.y0=m.coords.start.page.y-V.y,_.clientX0=m.coords.start.client.x-V.x,_.clientY0=m.coords.start.client.y-V.y,_.delta=I||D?{x:0,y:0}:{x:_[j].x-W[j].x,y:_[j].y-W[j].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=K({},m.coords.velocity[j]),_.speed=ea(_.velocity.x,_.velocity.y),_.swipe=D||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(as);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var J0=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),e2=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),qu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),t2=0,r2=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ia(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=t2++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in e2)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in qu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?K({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ea(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&is(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||ku(this.coords.delta),(l=K({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:ra(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new J0(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),j0(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,os(this.downPointer,l),this.interacting()||(is(this.coords.start,this.coords.cur),is(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(li(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function Ku(c){Wu(c.interaction)}function Wu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),li(c.edges,c.rect,l),l.x=0,l.y=0,!0}function o2(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}qu.offsetBy="";var i2={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=o2},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":Ku,"interactions:before-action-move":Ku,"interactions:before-action-end":function(c){var l=c.interaction;if(Wu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},Uu=i2,n2=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=ds(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=ea(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=ds(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=ci.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=ds(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var j,V=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,j={x:Gu(y=V,l,m,v),y:Gu(y,u,g,b)}):j={x:this.targetOffset.x*V,y:this.targetOffset.y*V};var I={x:j.x-this.currentOffset.x,y:j.y-this.currentOffset.y};this.currentOffset.x+=I.x,this.currentOffset.y+=I.y,M.offsetBy(I),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=ds(u).smoothEndDuration;if(m<g){var v={x:Yu(m,0,this.targetOffset.x,g),y:Yu(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),is(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,ci.cancel(this.timeout)}}]),c}();function ds(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var a2={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(Uu),c.usePlugin(Lu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new n2(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Yr(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":na,"interactions:action-inertiastart":na,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function Gu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function Yu(c,l,u,m){return-u*(c/=m)*(c-2)+l}var s2=a2;function Xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var Zu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=K({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&Xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&Xu(l,u)}},{key:"on",value:function(l,u){var m=co(l,u);for(l in m)this.types[l]=zu(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=co(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),l2=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,os(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function aa(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function us(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var c2={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,j,V,I){var D=aa(I);if(!m[j]){m[j]=[];for(var W=0;W<g.length;W++){var B=g[W];b(B,j,w),b(B,j,M,!0)}}var G=m[j],de=oa(G,function(ke){return ke.selector===_&&ke.context===E});de||(de={selector:_,context:E,listeners:[]},G.push(de)),de.listeners.push({func:V,options:D})},removeDelegate:function(_,E,j,V,I){var D,W=aa(I),B=m[j],G=!1;if(B)for(D=B.length-1;D>=0;D--){var de=B[D];if(de.selector===_&&de.context===E){for(var ke=de.listeners,te=ke.length-1;te>=0;te--){var pe=ke[te];if(pe.func===V&&us(pe.options,W)){ke.splice(te,1),ke.length||(B.splice(D,1),y(E,j,w),y(E,j,M,!0)),G=!0;break}}if(G)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,j,V){if(_.addEventListener){var I=aa(V),D=oa(u,function(W){return W.eventTarget===_});D||(D={eventTarget:_,events:{}},u.push(D)),D.events[E]||(D.events[E]=[]),oa(D.events[E],function(W){return W.func===j&&us(W.options,I)})||(_.addEventListener(E,j,v.supportsOptions?I:I.capture),D.events[E].push({func:j,options:I}))}}function y(_,E,j,V){if(_.addEventListener&&_.removeEventListener){var I=ra(u,function(mr){return mr.eventTarget===_}),D=u[I];if(D&&D.events)if(E!=="all"){var W=!1,B=D.events[E];if(B){if(j==="all"){for(var G=B.length-1;G>=0;G--){var de=B[G];y(_,E,de.func,de.options)}return}for(var ke=aa(V),te=0;te<B.length;te++){var pe=B[te];if(pe.func===j&&us(pe.options,ke)){_.removeEventListener(E,j,v.supportsOptions?ke:ke.capture),B.splice(te,1),B.length===0&&(delete D.events[E],W=!0);break}}}W&&!Object.keys(D.events).length&&u.splice(I,1)}else for(E in D.events)D.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var j=aa(E),V=new l2(_),I=m[_.type],D=Cu(_)[0],W=D;$.element(W);){for(var B=0;B<I.length;B++){var G=I[B],de=G.selector,ke=G.context;if(Ao(W,de)&&ao(ke,D)&&ao(ke,W)){var te=G.listeners;V.currentTarget=W;for(var pe=0;pe<te.length;pe++){var mr=te[pe];us(mr.options,j)&&mr.func(V)}}}W=Yr(W)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Yr(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!Qu(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(Qu(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function Qu(c,l){return c.pointers.some(function(u){return u.id===l})}var d2=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ju(c,l){return function(u){var m=l.interactions.list,g=Mu(u),v=Cu(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],j={pointer:E,pointerId:ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},V=eh(j);w.push([j.pointer,j.eventTarget,j.curEventTarget,V])}}else{var I=!1;if(!hr.supportsPointerEvent&&/mouse/.test(u.type)){for(var D=0;D<m.length&&!I;D++)I=m[D].pointerType!=="mouse"&&m[D].pointerIsDown;I=I||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!I){var W={pointer:u,pointerId:ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},B=eh(W);w.push([W.pointer,W.eventTarget,W.curEventTarget,B])}}for(var G=0;G<w.length;G++){var de=w[G],ke=de[0],te=de[1],pe=de[2];de[3][c](ke,u,te,pe)}}}function eh(c){var l=c.pointerType,u=c.scope,m={interaction:d2.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var u2={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Ju(m,c)}var g,v=hr.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var V=j[E];c.documents.some(function(I){return ao(I.doc,V.downTarget)})||M.removePointer(V.pointer,V.event)},E=0,j=M.pointers;E<j.length;E++)_()}}(g=Ne.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(r2),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(Fu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Ju,methodNames:ec},h2=u2,ui=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(ui||{}),p2=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Zu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(Ar(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&ls(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(ui.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(ui.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Eu(y):$.plainObject(y)?(b[v]=K(b[v]||{},dn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),_e(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=K({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(Ar(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||ao(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?he(m,l,u):!!$.element(l)&&ao(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?he(m,l,u):!!$.element(l)&&ao(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=co(u,m,v);for(var y in b){y==="wheel"&&(y=hr.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];ls(y,this._actions)?this.events[l===ui.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===ui.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===ui.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(ui.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(ui.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=dn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,K(K({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),m2=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=ra(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=K(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return oa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&Ao(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),g2=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=hr,this.defaults=dn(Bu),this.Eventable=Zu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=_u,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Nl,g.getElementRect=_e,g.getElementClientRect=X,g.matchesSelector=Ao,g.closest=sn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return ls(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var j;return ls(v,this.scope.actions)?v in this.globalEvents&&(j=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(j,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return hr.supportsTouch},g.supportsPointerEvent=function(){return hr.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new m2(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(p2)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),Ne.init(m),hr.init(m),ci.init(m),u.window=m,u.document=m.document,u.usePlugin(h2),u.usePlugin(c2),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[th(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[th(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?K({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function th(c){return c&&c.replace(/\/.*$/,"")}var rh=new g2,pr=rh.interactStatic,f2=typeof globalThis<"u"?globalThis:window;rh.init(f2);var v2=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var j=l[E],V=j[0],I=j[1],D=Math.round((m-M.x)/c[V]),W=Math.round((g-M.y)/c[I]);_[V]=Math.max(y.left,Math.min(y.right,D*c[V]+M.x)),_[I]=Math.max(y.top,Math.min(y.bottom,W*c[I]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),b2={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=K(l.snappers||{},v2),l.createSnapGrid=l.snappers.grid}},y2=b2,k2={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=K({},g),l.startRect=K({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var j=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:j,y:j}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&K(m,E),_!=null&&_.length){var V=new Xl(c.interaction);V.copyFrom(c.interaction.modification),V.prepareStates(_),l.subModification=V,V.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=K({},m),b=l.equalDelta?x2:w2;if(K(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=K({},u);li(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),K(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function x2(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function w2(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var _2=di(k2,"aspectRatio"),oh=function(){};oh._defaults={};var hs=oh;function ji(c,l,u){return $.func(c)?so(c,l.interactable,l.element,[u.x,u.y,l]):so(c,l.interactable,l.element)}var ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=K({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=ji(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=ji(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=K({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},M2=di(ps,"restrict"),ih={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nh={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ah(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var sa={noInner:ih,noOuter:nh,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Xr(ji(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=K({},l),w=ji(b.inner,m,y)||{},M=ji(b.outer,m,y)||{};ah(w,ih),ah(M,nh),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},C2=di(sa,"restrictEdges"),z2=K({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},ps.defaults),E2=di({start:ps.start,set:ps.set,defaults:z2},"restrictRect"),S2={width:-1/0,height:-1/0},$2={width:1/0,height:1/0},T2=di({start:function(c){return sa.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=lo(ji(v.min,l,c.coords))||S2,y=lo(ji(v.max,l,c.coords))||$2;u.options={endOnly:v.endOnly,inner:K({},sa.noInner),outer:K({},sa.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),sa.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(j){var V=j.interaction.element,I=Xr(so(j.state.options.origin,null,null,[V])),D=I||Bo(j.interactable,V,j.interaction.prepared.name);return D}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=so(w.offset,m,g,[u]);(l=Xr(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(j,V){return{index:V,relativePoint:j,x:y.left-v.width*j.x+l.x,y:y.top-v.height*j.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=Bo(l.interactable,l.element,l.prepared.name),y=K({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],j=y.x-E.x,V=y.y-E.y,I=0,D=g.targets.length;I<D;I++){var W=g.targets[I],B=void 0;(B=$.func(W)?W(j,V,l._proxy,E,I):W)&&w.push({x:($.number(B.x)?B.x:j)+E.x,y:($.number(B.y)?B.y:V)+E.y,range:$.number(B.range)?B.range:g.range,source:W,index:I,offset:E})}for(var G={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},de=0;de<w.length;de++){var ke=w[de],te=ke.range,pe=ke.x-y.x,mr=ke.y-y.y,tt=ea(pe,mr),Nr=tt<=te;te===1/0&&G.inRange&&G.range!==1/0&&(Nr=!1),G.target&&!(Nr?G.inRange&&te!==1/0?tt/te<G.distance/G.range:te===1/0&&G.range!==1/0||tt<G.distance:!G.inRange&&tt<G.distance)||(G.target=ke,G.distance=tt,G.range=te,G.inRange=Nr,G.delta.x=pe,G.delta.y=mr)}return G.inRange&&(u.x=G.target.x,u.y=G.target.y),m.closest=G,G},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},A2=di(rc,"snap"),ms={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=K({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,j=u.targetFields;E<j.length;E++){var V=j[E],I=V[0],D=V[1];if(I in _||D in _){_.x=_[I],_.y=_[D];break}}u.options.targets.push(_)}}var W=rc.set(c);return u.options=g,W},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},P2=di(ms,"snapSize"),oc={aspectRatio:_2,restrictEdges:C2,restrict:M2,restrictRect:E2,restrictSize:T2,snapEdges:di({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],ms.start(c)):null},set:ms.set,defaults:K(dn(ms.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:A2,snapSize:P2,spring:hs,avoid:hs,transform:hs,rubberband:hs},j2={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(Lu),c.usePlugin(y2),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},O2=j2,sh=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),os(f(M=l.call(this,y)),v),v!==g&&os(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=ta(g),M.pointerType=Mu(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(as),la={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=la,c.defaults.actions.pointerEvents=la.defaults,K(c.actions.phaselessTypes,la.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ae(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},j=0;j<_.length;j++){var V=_[j];E.node=V,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var I=1/0,D=0,W=E.targets;D<W.length;D++){var B=W[D].eventable.options.holdDuration;B<I&&(I=B)}M.duration=I,M.timeout=setTimeout(function(){hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},I)}})(c,l),hi(c,l)},"interactions:up":function(c,l){ic(c),hi(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),hi(c,l)}},PointerEvent:sh,fire:hi,collectEventTargets:lh,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function hi(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?lh(c,l):y,M=new sh(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var j=w[E];for(var V in j.props||{})M[V]=j.props[V];var I=Bo(j.eventable,j.node);if(M._subtractOrigin(I),M.eventable=j.eventable,M.currentTarget=j.node,j.eventable.fire(M),M._addOrigin(I),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var D=M.double?hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=D,u.tapTime=D.timeStamp}return M}function lh(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ae(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var j=M[E];_.node=j,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(V){var I,D;return V.eventable.options.holdDuration===((I=u.pointers[y])==null||(D=I.hold)==null?void 0:D.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var H2=Object.freeze({__proto__:null,default:la});function R2(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var I2={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(la);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=R2,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},V2=I2,D2={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return K(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;K(u.events.options,l.pointerEvents.defaults),K(u.events.options,m.pointerEvents||{})}}},N2=D2,F2={id:"pointer-events",install:function(c){c.usePlugin(H2),c.usePlugin(V2),c.usePlugin(N2)}},L2=F2,B2={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],j=m.getRect(E);if(!j)return 1;var V,I=oa(v.interactions.list,function(B){return B.interacting()&&B.interactable===m&&B.element===E&&B.prepared.name===g.name});if(I)I.move(),w&&(V=I._reflowPromise||new y(function(B){I._reflowResolve=B}));else{var D=lo(j),W=function(B){return{coords:B,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:D.x,y:D.y},client:{x:D.x,y:D.y},timeStamp:v.now()});V=function(B,G,de,ke,te){var pe=B.interactions.new({pointerType:"reflow"}),mr={interaction:pe,event:te,pointer:te,eventTarget:de,phase:"reflow"};pe.interactable=G,pe.element=de,pe.prevEvent=te,pe.updatePointer(te,te,de,!0),ku(pe.coords.delta),Wl(pe.prepared,ke),pe._doPhase(mr);var tt=B.window,Nr=tt.Promise,uo=Nr?new Nr(function(Wo){pe._reflowResolve=Wo}):void 0;return pe._reflowPromise=uo,pe.start(ke,G,de),pe._interacting?(pe.move(mr),pe.end(te)):(pe.stop(),pe._reflowResolve()),pe.removePointer(te,te),uo}(v,m,E,g,W)}w&&w.push(V)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},q2=B2;if(pr.use(Fu),pr.use(Uu),pr.use(L2),pr.use(s2),pr.use(O2),pr.use(Y0),pr.use(V0),pr.use(N0),pr.use(q2),pr.default=pr,(typeof Bi>"u"?"undefined":e(Bi))==="object"&&Bi)try{Bi.exports=pr}catch{}return pr.default=pr,pr})});import{css as gg,html as ka,LitElement as fg,nothing as kc}from"lit";import{customElement as vg,property as po,state as xc}from"lit/decorators.js";import{css as mh}from"lit";var A=mh`
|
|
1
|
+
var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDescriptor;var W2=Object.getOwnPropertyNames;var U2=Object.getPrototypeOf,G2=Object.prototype.hasOwnProperty;var dh=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var Y2=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),X2=(i,o)=>{for(var e in o)fs(i,e,{get:o[e],enumerable:!0})},Z2=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of W2(o))!G2.call(i,r)&&r!==e&&fs(i,r,{get:()=>o[r],enumerable:!(t=ch(o,r))||t.enumerable});return i};var da=(i,o,e)=>(e=i!=null?K2(U2(i)):{},Z2(o||!i||!i.__esModule?fs(e,"default",{value:i,enumerable:!0}):e,i));var a=(i,o,e,t)=>{for(var r=t>1?void 0:t?ch(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&fs(o,e,r),r};var uh=(i,o,e)=>o.has(i)||dh("Cannot "+e);var ve=(i,o,e)=>(uh(i,o,"read from private field"),e?e.call(i):o.get(i)),hh=(i,o,e)=>o.has(i)?dh("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),ph=(i,o,e,t)=>(uh(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var Sa,xp=nc(()=>{Sa=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function Oc(i){return i==="horizontal"?"width":"height"}var Fs,wp=nc(()=>{Fs=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[Oc(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Mp={};X2(Mp,{FlowLayout:()=>Ls,flow:()=>wf});function _p(i){return i==="horizontal"?"marginLeft":"marginTop"}function _f(i){return i==="horizontal"?"marginRight":"marginBottom"}function Mf(i){return i==="horizontal"?"xOffset":"yOffset"}function Cf(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var wf,Hc,Ls,Cp=nc(()=>{xp();wp();wf=i=>Object.assign({type:Ls},i);Hc=class{constructor(){this._childSizeCache=new Sa,this._marginSizeCache=new Sa,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][Oc(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[_p(e)]||0,s=this._metricsCache.get(r-1)?.[_f(e)]||0;this._marginSizeCache.set(r,Cf(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[_p(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Ls=class extends Fs{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Hc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[Mf(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var _n=Y2((Lc,Bi)=>{(function(i,o){typeof Lc=="object"&&typeof Bi<"u"?Bi.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Lc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var R=function(c){return!!c&&e(c)==="object"},F=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return R(c)&&c.nodeType===11},object:R,func:F,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return R(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return R(c)&&c.length!==void 0&&F(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function fe(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var Te={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=Te.draggable,l.map.drag=Te,l.methodDict.drag="draggable",m.actions.drag=Te.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":fe,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:fe,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},et=Te,we={init:function(c){var l=c;we.document=l.document,we.DocumentFragment=l.DocumentFragment||no,we.SVGElement=l.SVGElement||no,we.SVGSVGElement=l.SVGSVGElement||no,we.SVGElementInstance=l.SVGElementInstance||no,we.Element=l.Element||no,we.HTMLElement=l.HTMLElement||we.Element,we.Event=l.Event,we.Touch=l.Touch||no,we.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function no(){}var Ne=we,Zt={init:function(c){var l=Ne.Element,u=c.navigator||{};Zt.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&Ne.document instanceof c.DocumentTouch,Zt.supportsPointerEvent=u.pointerEnabled!==!1&&!!Ne.PointerEvent,Zt.isIOS=/iP(hone|od|ad)/.test(u.platform),Zt.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),Zt.isIe9=/MSIE 9/.test(u.userAgent),Zt.isOperaMobile=u.appName==="Opera"&&Zt.supportsTouch&&/Presto/.test(u.userAgent),Zt.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",Zt.pEventTypes=Zt.supportsPointerEvent?Ne.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Zt.wheelEvent=Ne.document&&"onmousewheel"in Ne.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},hr=Zt;function ao(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function sn(c,l){for(;$.element(c);){if(Ao(c,l))return c;c=Yr(c)}return null}function Yr(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function Ao(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[hr.prefixedMatchesSelector](l)}var L=function(c){return c.parentNode||c.host};function J(c,l){for(var u,m=[],g=c;(u=L(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function he(c,l,u){for(;$.element(c);){if(Ao(c,l))return!0;if((c=Yr(c))===u)return Ao(c,l)}return!1}function Oe(c){return c.correspondingUseElement||c}function X(c){var l=c instanceof Ne.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function _e(c){var l,u=X(c);if(!hr.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ae(c){for(var l=[];c;)l.push(c),c=Yr(c);return l}function Tr(c){return!!$.string(c)&&(Ne.document.querySelector(c),!0)}function K(c,l){for(var u in l)c[u]=l[u];return c}function si(c,l,u){return c==="parent"?Yr(u):c==="self"?l.getRect(u):sn(u,c)}function so(c,l,u,m){var g=c;return $.string(g)?g=si(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=_e(g)),g}function Xr(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function lo(c){return!c||"x"in c&&"y"in c||((c=K({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function li(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function Bo(c,l,u){var m=u&&c.options[u];return Xr(so(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function co(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=ln(c)),$.array(c))return c.forEach(function(w){return co(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];co(c,b,u,m)}else if($.object(l))for(var y in l)co(ln(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function ln(c){return c.trim().split(/ +/)}var ea=function(c,l){return Math.sqrt(c*c+l*l)},P0=["webkit","moz"];function os(c,l){c.__set||(c.__set={});var u=function(g){if(P0.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function is(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function ku(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function xu(c){return c instanceof Ne.Event||c instanceof Ne.Touch}function ns(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function wu(c,l){return l=l||{x:0,y:0},hr.isOperaMobile&&xu(c)?(ns("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):ns("page",c,l),l}function ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function j0(c,l,u){var m=l.length>1?_u(l):l[0];wu(m,c.page),function(g,v){v=v||{},hr.isOperaMobile&&xu(g)?ns("screen",g,v):ns("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function _u(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return ea(v,b)}function Nl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Mu(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof Ne.Touch?"touch":"mouse"}function Cu(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Oe(l?l[0]:c.target),Oe(c.currentTarget)]}var as=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(as.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var zu=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Eu=function(c){return zu([],c)},ra=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},oa=function(c,l){return c[ra(c,l)]},cn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=ra(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(as);function Su(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Fl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!Ao(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var j=0,V=_.getAllElements();j<V.length;j++){var I=V[j];I!==b&&y.push({dropzone:_,element:I,rect:_.getRect(I)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function $u(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,j=M.rect,V=_.dropCheck(l,u,g,v,E,j);b.push(V?E:null)}var I=function(D){for(var W,B,G,de=[],ke=0;ke<D.length;ke++){var te=D[ke],pe=D[W];if(te&&ke!==W)if(pe){var mr=L(te),tt=L(pe);if(mr!==te.ownerDocument)if(tt!==te.ownerDocument)if(mr!==tt){de=de.length?de:J(pe);var Nr=void 0;if(pe instanceof Ne.HTMLElement&&te instanceof Ne.SVGElement&&!(te instanceof Ne.SVGSVGElement)){if(te===tt)continue;Nr=te.ownerSVGElement}else Nr=te;for(var uo=J(Nr,pe.ownerDocument),Wo=0;uo[Wo]&&uo[Wo]===de[Wo];)Wo++;var gs=[uo[Wo-1],uo[Wo],de[Wo]];if(gs[0])for(var ca=gs[0].lastChild;ca;){if(ca===gs[1]){W=ke,de=uo;break}if(ca===gs[2])break;ca=ca.previousSibling}}else G=pe,(parseInt(H(B=te).getComputedStyle(B).zIndex,10)||0)>=(parseInt(H(G).getComputedStyle(G).zIndex,10)||0)&&(W=ke);else W=ke}else W=ke}return W}(b);return m.activeDrops[I]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new cn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new cn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new cn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new cn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new cn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new cn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Su(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function Tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Fl(l,u.element));var b=m,y=$u(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var Au={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(et),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=co(y.listeners),M=Object.keys(w).reduce(function(E,j){return E[/^(enter|leave)/.test(j)?"drag".concat(j):/^(activate|deactivate|move)/.test(j)?"drop".concat(j):j]=w[j],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,j,V,I,D,W,B){var G=!1;if(!(B=B||E.getRect(W)))return!!E.options.drop.checker&&E.options.drop.checker(j,V,G,E,W,I,D);var de=E.options.drop.overlap;if(de==="pointer"){var ke=Bo(I,D,"drag"),te=wu(j);te.x+=ke.x,te.y+=ke.y;var pe=te.x>B.left&&te.x<B.right,mr=te.y>B.top&&te.y<B.bottom;G=pe&&mr}var tt=I.getRect(D);if(tt&&de==="center"){var Nr=tt.left+tt.width/2,uo=tt.top+tt.height/2;G=Nr>=B.left&&Nr<=B.right&&uo>=B.top&&uo<=B.bottom}return tt&&$.number(de)&&(G=Math.max(0,Math.min(B.right,tt.right)-Math.max(B.left,tt.left))*Math.max(0,Math.min(B.bottom,tt.bottom)-Math.max(B.top,tt.top))/(tt.width*tt.height)>=de),E.options.drop.checker&&(G=E.options.drop.checker(j,V,G,E,W,I,D)),G}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},K(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=Au.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Fl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Su(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":Tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;Tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Fl,getDrop:$u,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},O0=Au;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Nl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Nl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},H0=Kl;function R0(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:he(m,l,g))}function Pu(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var qo,Pi,Ko={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Ko.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Ko.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Ko,l.methodDict.resize="resizable",g.actions.resize=Ko.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:K({},v),corrected:K({},v),previous:K({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),Pu(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,j=w.previous;if(K(j,_),b){if(K(_,y),v==="reposition"){if(_.top>_.bottom){var V=_.top;_.top=_.bottom,_.bottom=V}if(_.left>_.right){var I=_.left;_.left=_.right,_.right=I}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var D in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[D]=_[D]-j[D];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),Pu(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=K({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=R0(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Ko.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Ko.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Ko.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Ko.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},I0=Ko,V0={id:"actions",install:function(c){c.usePlugin(H0),c.usePlugin(I0),c.usePlugin(et),c.usePlugin(O0)}},ju=0,ci={request:function(c){return qo(c)},cancel:function(c){return Pi(c)},init:function(c){if(qo=c.requestAnimationFrame,Pi=c.cancelAnimationFrame,!qo)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];qo=c["".concat(m,"RequestAnimationFrame")],Pi=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}qo=qo&&qo.bind(c),Pi=Pi&&Pi.bind(c),qo||(qo=function(g){var v=Date.now(),b=Math.max(0,16-(v-ju)),y=c.setTimeout(function(){g(v+b)},b);return ju=v+b,y},Pi=function(g){return clearTimeout(g)})}},re={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){re.isScrolling=!0,ci.cancel(re.i),c.autoScroll=re,re.interaction=c,re.prevTime=re.now(),re.i=ci.request(re.scroll)},stop:function(){re.isScrolling=!1,re.interaction&&(re.interaction.autoScroll=null),ci.cancel(re.i)},scroll:function(){var c=re.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=Ou(g.container,l,u),b=re.now(),y=(b-re.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:re.x*w,y:re.y*w};if(M.x||M.y){var _=Hu(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=Hu(v),j={x:E.x-_.x,y:E.y-_.y};(j.x||j.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:j,interaction:c,container:v})}re.prevTime=b}re.isScrolling&&(ci.cancel(re.i),re.i=ci.request(re.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&re.check(l.interactable,l.prepared.name))if(l.simulation)re.x=re.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=Ou(_.container,y,w);if($.window(E))b=u.clientX<re.margin,m=u.clientY<re.margin,g=u.clientX>E.innerWidth-re.margin,v=u.clientY>E.innerHeight-re.margin;else{var j=X(E);b=u.clientX<j.left+re.margin,m=u.clientY<j.top+re.margin,g=u.clientX>j.right-re.margin,v=u.clientY>j.bottom-re.margin}re.x=g?1:b?-1:0,re.y=v?1:m?-1:0,re.isScrolling||(re.margin=_.margin,re.speed=_.speed,re.start(l))}}};function Ou(c,l,u){return($.string(c)?si(c,l,u):c)||H(u)}function Hu(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var D0={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=re,re.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=re.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,re.stop(),re.interaction&&(re.interaction=null)},"interactions:stop":re.stop,"interactions:action-move":function(c){return re.onInteractionMove(c)}}},N0=D0;function ia(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function F0(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function L0(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var B0={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var j=y.getRect(_),V=w.buttons||{0:1,1:4,3:8,4:16}[w.button],I={action:null,interactable:y,interaction:M,element:_,rect:j,buttons:V};return E.fire("auto-start:check",I),I.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ia(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ia(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=L0,l.prototype.styleCursor=F0}};function Ru(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&ss(l,u,c,g)?c:null}function q0(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var j=Ru(E,M,_,v,b);if(j)return{action:j,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function Iu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=q0(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Yr(y)}return{action:null,interactable:null,element:null}}function Vu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,Nu(c,u),u.fire("autoStart:prepared",{interaction:c})}function ss(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,j=m.interactions.list;E<j.length;E++){var V=j[E],I=V.prepared.name;if(V.interacting()&&(++w>=y||V.interactable===c&&((M+=I===u.name?1:0)>=v||V.element===l&&(_++,I===u.name&&_>=b))))return!1}return y>0}function Du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function Nu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var K0={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(B0),u.base.actionChecker=null,u.base.styleCursor=!0,K(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return Du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:ss,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||Vu(u,Iu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||Vu(g,Iu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!ss(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),Nu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:Du,withinInteractionLimit:ss,validateAction:Ru},Gl=K0,W0={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,j=function(I){if(I!==u.interactable){var D=u.interactable.options.drag;if(!D.manualStart&&I.testIgnoreAllow(D,E,m)){var W=I.getAction(u.downPointer,u.downEvent,u,E);if(W&&W.name==="drag"&&function(B,G){if(!G)return!1;var de=G.options.drag.startAxis;return B==="xy"||de==="xy"||de===B}(_,I)&&Gl.validateAction(W,I,E,m,l))return I}}};$.element(E);){var V=l.interactables.forEachMatch(E,j);if(V){u.prepared.name="drag",u.interactable=V,u.element=E;break}E=Yr(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var U0={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},G0=U0,Y0={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(G0),c.usePlugin(W0)}},X0=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function Z0(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var Fu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=X0,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&Ao(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||ao(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=Z0,c},{})};function ls(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function dn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=dn(m):$.array(m)?l[u]=Eu(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=cs(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(j){var V=_[j];return V&&V.enabled&&{options:V,methods:V._methods}}).filter(function(j){return!!j})}(b);this.prepareStates(y),this.startEdges=K({},b.edges),this.edges=K({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=cs(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=K({},l.pageCoords),l.rect=K({},v),l.edges=K({},b);for(var y=g?this.states.slice(g):this.states,w=cs(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],j=E.options,V=K({},l.coords),I=null;(_=E.methods)!=null&&_.set&&this.shouldDo(j,m,u)&&(l.state=E,I=E.methods.set(l),li(l.edges,l.rect,{x:l.coords.x-V.x,y:l.coords.y-V.y})),w.eventProps.push(I)}K(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var D=this.result.coords,W=this.result.rect;if(D&&W){var B=w.rect.left!==W.left||w.rect.right!==W.right||w.rect.top!==W.top||w.rect.bottom!==W.bottom;w.changed=B||D.x!==w.coords.x||D.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&K(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],j=E[0],V=E[1];j.page.x+=V.x,j.page.y+=V.y,j.client.x+=V.x,j.client.y+=V.y}var I=this.result.rectDelta,D=l.rect||u.rect;D.left+=I.left,D.right+=I.right,D.top+=I.top,D.bottom+=I.bottom,D.width=D.right-D.left,D.height=D.bottom-D.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=K({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var j=E[_],V=j[0],I=j[1];V.page.x-=I.x,V.page.y-=I.y,V.client.x-=I.x,V.client.y-=I.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return dn(u)}),this.result=cs(K({},l.result.coords),K({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function cs(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function di(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function na(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var Q0={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":na,"interactions:action-move":na,"interactions:action-end":na,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},Lu=Q0,Bu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,j=(E&&E.options||Bu).deltaSource,V=Bo(E,y,v),I=b==="start",D=b==="end",W=I?f(_):m.prevEvent,B=I?m.coords.start:D?{page:W.page,client:W.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=K({},B.page),_.client=K({},B.client),_.rect=K({},m.rect),_.timeStamp=B.timeStamp,D||(_.page.x-=V.x,_.page.y-=V.y,_.client.x-=V.x,_.client.y-=V.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=I?m.pointers[m.pointers.length-1].downTime:W.t0,_.x0=m.coords.start.page.x-V.x,_.y0=m.coords.start.page.y-V.y,_.clientX0=m.coords.start.client.x-V.x,_.clientY0=m.coords.start.client.y-V.y,_.delta=I||D?{x:0,y:0}:{x:_[j].x-W[j].x,y:_[j].y-W[j].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=K({},m.coords.velocity[j]),_.speed=ea(_.velocity.x,_.velocity.y),_.swipe=D||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(as);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var J0=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),e2=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),qu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),t2=0,r2=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ia(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=t2++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in e2)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in qu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?K({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ea(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&is(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||ku(this.coords.delta),(l=K({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:ra(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new J0(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),j0(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,os(this.downPointer,l),this.interacting()||(is(this.coords.start,this.coords.cur),is(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(li(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function Ku(c){Wu(c.interaction)}function Wu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),li(c.edges,c.rect,l),l.x=0,l.y=0,!0}function o2(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}qu.offsetBy="";var i2={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=o2},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":Ku,"interactions:before-action-move":Ku,"interactions:before-action-end":function(c){var l=c.interaction;if(Wu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},Uu=i2,n2=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=ds(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=ea(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=ds(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=ci.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=ds(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var j,V=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,j={x:Gu(y=V,l,m,v),y:Gu(y,u,g,b)}):j={x:this.targetOffset.x*V,y:this.targetOffset.y*V};var I={x:j.x-this.currentOffset.x,y:j.y-this.currentOffset.y};this.currentOffset.x+=I.x,this.currentOffset.y+=I.y,M.offsetBy(I),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=ds(u).smoothEndDuration;if(m<g){var v={x:Yu(m,0,this.targetOffset.x,g),y:Yu(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),is(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,ci.cancel(this.timeout)}}]),c}();function ds(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var a2={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(Uu),c.usePlugin(Lu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new n2(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Yr(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":na,"interactions:action-inertiastart":na,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function Gu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function Yu(c,l,u,m){return-u*(c/=m)*(c-2)+l}var s2=a2;function Xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var Zu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=K({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&Xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&Xu(l,u)}},{key:"on",value:function(l,u){var m=co(l,u);for(l in m)this.types[l]=zu(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=co(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),l2=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,os(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function aa(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function us(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var c2={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,j,V,I){var D=aa(I);if(!m[j]){m[j]=[];for(var W=0;W<g.length;W++){var B=g[W];b(B,j,w),b(B,j,M,!0)}}var G=m[j],de=oa(G,function(ke){return ke.selector===_&&ke.context===E});de||(de={selector:_,context:E,listeners:[]},G.push(de)),de.listeners.push({func:V,options:D})},removeDelegate:function(_,E,j,V,I){var D,W=aa(I),B=m[j],G=!1;if(B)for(D=B.length-1;D>=0;D--){var de=B[D];if(de.selector===_&&de.context===E){for(var ke=de.listeners,te=ke.length-1;te>=0;te--){var pe=ke[te];if(pe.func===V&&us(pe.options,W)){ke.splice(te,1),ke.length||(B.splice(D,1),y(E,j,w),y(E,j,M,!0)),G=!0;break}}if(G)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,j,V){if(_.addEventListener){var I=aa(V),D=oa(u,function(W){return W.eventTarget===_});D||(D={eventTarget:_,events:{}},u.push(D)),D.events[E]||(D.events[E]=[]),oa(D.events[E],function(W){return W.func===j&&us(W.options,I)})||(_.addEventListener(E,j,v.supportsOptions?I:I.capture),D.events[E].push({func:j,options:I}))}}function y(_,E,j,V){if(_.addEventListener&&_.removeEventListener){var I=ra(u,function(mr){return mr.eventTarget===_}),D=u[I];if(D&&D.events)if(E!=="all"){var W=!1,B=D.events[E];if(B){if(j==="all"){for(var G=B.length-1;G>=0;G--){var de=B[G];y(_,E,de.func,de.options)}return}for(var ke=aa(V),te=0;te<B.length;te++){var pe=B[te];if(pe.func===j&&us(pe.options,ke)){_.removeEventListener(E,j,v.supportsOptions?ke:ke.capture),B.splice(te,1),B.length===0&&(delete D.events[E],W=!0);break}}}W&&!Object.keys(D.events).length&&u.splice(I,1)}else for(E in D.events)D.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var j=aa(E),V=new l2(_),I=m[_.type],D=Cu(_)[0],W=D;$.element(W);){for(var B=0;B<I.length;B++){var G=I[B],de=G.selector,ke=G.context;if(Ao(W,de)&&ao(ke,D)&&ao(ke,W)){var te=G.listeners;V.currentTarget=W;for(var pe=0;pe<te.length;pe++){var mr=te[pe];us(mr.options,j)&&mr.func(V)}}}W=Yr(W)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Yr(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!Qu(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(Qu(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function Qu(c,l){return c.pointers.some(function(u){return u.id===l})}var d2=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ju(c,l){return function(u){var m=l.interactions.list,g=Mu(u),v=Cu(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],j={pointer:E,pointerId:ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},V=eh(j);w.push([j.pointer,j.eventTarget,j.curEventTarget,V])}}else{var I=!1;if(!hr.supportsPointerEvent&&/mouse/.test(u.type)){for(var D=0;D<m.length&&!I;D++)I=m[D].pointerType!=="mouse"&&m[D].pointerIsDown;I=I||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!I){var W={pointer:u,pointerId:ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},B=eh(W);w.push([W.pointer,W.eventTarget,W.curEventTarget,B])}}for(var G=0;G<w.length;G++){var de=w[G],ke=de[0],te=de[1],pe=de[2];de[3][c](ke,u,te,pe)}}}function eh(c){var l=c.pointerType,u=c.scope,m={interaction:d2.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var u2={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Ju(m,c)}var g,v=hr.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var V=j[E];c.documents.some(function(I){return ao(I.doc,V.downTarget)})||M.removePointer(V.pointer,V.event)},E=0,j=M.pointers;E<j.length;E++)_()}}(g=Ne.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(r2),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(Fu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Ju,methodNames:ec},h2=u2,ui=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(ui||{}),p2=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Zu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(Tr(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&ls(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(ui.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(ui.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Eu(y):$.plainObject(y)?(b[v]=K(b[v]||{},dn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),_e(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=K({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(Tr(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||ao(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?he(m,l,u):!!$.element(l)&&ao(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?he(m,l,u):!!$.element(l)&&ao(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=co(u,m,v);for(var y in b){y==="wheel"&&(y=hr.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];ls(y,this._actions)?this.events[l===ui.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===ui.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===ui.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(ui.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(ui.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=dn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,K(K({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),m2=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=ra(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=K(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return oa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&Ao(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),g2=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=hr,this.defaults=dn(Bu),this.Eventable=Zu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=_u,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Nl,g.getElementRect=_e,g.getElementClientRect=X,g.matchesSelector=Ao,g.closest=sn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return ls(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var j;return ls(v,this.scope.actions)?v in this.globalEvents&&(j=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(j,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return hr.supportsTouch},g.supportsPointerEvent=function(){return hr.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new m2(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(p2)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),Ne.init(m),hr.init(m),ci.init(m),u.window=m,u.document=m.document,u.usePlugin(h2),u.usePlugin(c2),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[th(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[th(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?K({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function th(c){return c&&c.replace(/\/.*$/,"")}var rh=new g2,pr=rh.interactStatic,f2=typeof globalThis<"u"?globalThis:window;rh.init(f2);var v2=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var j=l[E],V=j[0],I=j[1],D=Math.round((m-M.x)/c[V]),W=Math.round((g-M.y)/c[I]);_[V]=Math.max(y.left,Math.min(y.right,D*c[V]+M.x)),_[I]=Math.max(y.top,Math.min(y.bottom,W*c[I]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),b2={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=K(l.snappers||{},v2),l.createSnapGrid=l.snappers.grid}},y2=b2,k2={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=K({},g),l.startRect=K({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var j=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:j,y:j}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&K(m,E),_!=null&&_.length){var V=new Xl(c.interaction);V.copyFrom(c.interaction.modification),V.prepareStates(_),l.subModification=V,V.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=K({},m),b=l.equalDelta?x2:w2;if(K(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=K({},u);li(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),K(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function x2(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function w2(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var _2=di(k2,"aspectRatio"),oh=function(){};oh._defaults={};var hs=oh;function ji(c,l,u){return $.func(c)?so(c,l.interactable,l.element,[u.x,u.y,l]):so(c,l.interactable,l.element)}var ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=K({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=ji(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=ji(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=K({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},M2=di(ps,"restrict"),ih={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nh={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ah(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var sa={noInner:ih,noOuter:nh,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Xr(ji(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=K({},l),w=ji(b.inner,m,y)||{},M=ji(b.outer,m,y)||{};ah(w,ih),ah(M,nh),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},C2=di(sa,"restrictEdges"),z2=K({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},ps.defaults),E2=di({start:ps.start,set:ps.set,defaults:z2},"restrictRect"),S2={width:-1/0,height:-1/0},$2={width:1/0,height:1/0},T2=di({start:function(c){return sa.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=lo(ji(v.min,l,c.coords))||S2,y=lo(ji(v.max,l,c.coords))||$2;u.options={endOnly:v.endOnly,inner:K({},sa.noInner),outer:K({},sa.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),sa.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(j){var V=j.interaction.element,I=Xr(so(j.state.options.origin,null,null,[V])),D=I||Bo(j.interactable,V,j.interaction.prepared.name);return D}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=so(w.offset,m,g,[u]);(l=Xr(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(j,V){return{index:V,relativePoint:j,x:y.left-v.width*j.x+l.x,y:y.top-v.height*j.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=Bo(l.interactable,l.element,l.prepared.name),y=K({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],j=y.x-E.x,V=y.y-E.y,I=0,D=g.targets.length;I<D;I++){var W=g.targets[I],B=void 0;(B=$.func(W)?W(j,V,l._proxy,E,I):W)&&w.push({x:($.number(B.x)?B.x:j)+E.x,y:($.number(B.y)?B.y:V)+E.y,range:$.number(B.range)?B.range:g.range,source:W,index:I,offset:E})}for(var G={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},de=0;de<w.length;de++){var ke=w[de],te=ke.range,pe=ke.x-y.x,mr=ke.y-y.y,tt=ea(pe,mr),Nr=tt<=te;te===1/0&&G.inRange&&G.range!==1/0&&(Nr=!1),G.target&&!(Nr?G.inRange&&te!==1/0?tt/te<G.distance/G.range:te===1/0&&G.range!==1/0||tt<G.distance:!G.inRange&&tt<G.distance)||(G.target=ke,G.distance=tt,G.range=te,G.inRange=Nr,G.delta.x=pe,G.delta.y=mr)}return G.inRange&&(u.x=G.target.x,u.y=G.target.y),m.closest=G,G},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},A2=di(rc,"snap"),ms={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=K({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,j=u.targetFields;E<j.length;E++){var V=j[E],I=V[0],D=V[1];if(I in _||D in _){_.x=_[I],_.y=_[D];break}}u.options.targets.push(_)}}var W=rc.set(c);return u.options=g,W},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},P2=di(ms,"snapSize"),oc={aspectRatio:_2,restrictEdges:C2,restrict:M2,restrictRect:E2,restrictSize:T2,snapEdges:di({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],ms.start(c)):null},set:ms.set,defaults:K(dn(ms.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:A2,snapSize:P2,spring:hs,avoid:hs,transform:hs,rubberband:hs},j2={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(Lu),c.usePlugin(y2),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},O2=j2,sh=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),os(f(M=l.call(this,y)),v),v!==g&&os(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=ta(g),M.pointerType=Mu(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(as),la={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=la,c.defaults.actions.pointerEvents=la.defaults,K(c.actions.phaselessTypes,la.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ae(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},j=0;j<_.length;j++){var V=_[j];E.node=V,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var I=1/0,D=0,W=E.targets;D<W.length;D++){var B=W[D].eventable.options.holdDuration;B<I&&(I=B)}M.duration=I,M.timeout=setTimeout(function(){hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},I)}})(c,l),hi(c,l)},"interactions:up":function(c,l){ic(c),hi(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),hi(c,l)}},PointerEvent:sh,fire:hi,collectEventTargets:lh,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function hi(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?lh(c,l):y,M=new sh(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var j=w[E];for(var V in j.props||{})M[V]=j.props[V];var I=Bo(j.eventable,j.node);if(M._subtractOrigin(I),M.eventable=j.eventable,M.currentTarget=j.node,j.eventable.fire(M),M._addOrigin(I),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var D=M.double?hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=D,u.tapTime=D.timeStamp}return M}function lh(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ae(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var j=M[E];_.node=j,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(V){var I,D;return V.eventable.options.holdDuration===((I=u.pointers[y])==null||(D=I.hold)==null?void 0:D.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var H2=Object.freeze({__proto__:null,default:la});function R2(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var I2={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(la);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=R2,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},V2=I2,D2={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return K(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;K(u.events.options,l.pointerEvents.defaults),K(u.events.options,m.pointerEvents||{})}}},N2=D2,F2={id:"pointer-events",install:function(c){c.usePlugin(H2),c.usePlugin(V2),c.usePlugin(N2)}},L2=F2,B2={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],j=m.getRect(E);if(!j)return 1;var V,I=oa(v.interactions.list,function(B){return B.interacting()&&B.interactable===m&&B.element===E&&B.prepared.name===g.name});if(I)I.move(),w&&(V=I._reflowPromise||new y(function(B){I._reflowResolve=B}));else{var D=lo(j),W=function(B){return{coords:B,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:D.x,y:D.y},client:{x:D.x,y:D.y},timeStamp:v.now()});V=function(B,G,de,ke,te){var pe=B.interactions.new({pointerType:"reflow"}),mr={interaction:pe,event:te,pointer:te,eventTarget:de,phase:"reflow"};pe.interactable=G,pe.element=de,pe.prevEvent=te,pe.updatePointer(te,te,de,!0),ku(pe.coords.delta),Wl(pe.prepared,ke),pe._doPhase(mr);var tt=B.window,Nr=tt.Promise,uo=Nr?new Nr(function(Wo){pe._reflowResolve=Wo}):void 0;return pe._reflowPromise=uo,pe.start(ke,G,de),pe._interacting?(pe.move(mr),pe.end(te)):(pe.stop(),pe._reflowResolve()),pe.removePointer(te,te),uo}(v,m,E,g,W)}w&&w.push(V)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},q2=B2;if(pr.use(Fu),pr.use(Uu),pr.use(L2),pr.use(s2),pr.use(O2),pr.use(Y0),pr.use(V0),pr.use(N0),pr.use(q2),pr.default=pr,(typeof Bi>"u"?"undefined":e(Bi))==="object"&&Bi)try{Bi.exports=pr}catch{}return pr.default=pr,pr})});import{css as gg,html as ka,LitElement as fg,nothing as kc}from"lit";import{customElement as vg,property as po,state as xc}from"lit/decorators.js";import{css as mh}from"lit";var A=mh`
|
|
2
2
|
:host {
|
|
3
3
|
/* Surfaces (refined workbench light) */
|
|
4
4
|
--lui-color-bg: #ffffff;
|
|
@@ -491,7 +491,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
491
491
|
animation-duration: 2.4s;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
|
-
`],a([Oi({reflect:!0})],Fr.prototype,"variant",2),a([Oi()],Fr.prototype,"size",2),a([Oi()],Fr.prototype,"thickness",2),a([Oi()],Fr.prototype,"color",2),a([Oi()],Fr.prototype,"track",2),a([Oi({type:Boolean,reflect:!0})],Fr.prototype,"decorative",2),a([Oi()],Fr.prototype,"label",2),Fr=a([mg("lui-spinner")],Fr);var
|
|
494
|
+
`],a([Oi({reflect:!0})],Fr.prototype,"variant",2),a([Oi()],Fr.prototype,"size",2),a([Oi()],Fr.prototype,"thickness",2),a([Oi()],Fr.prototype,"color",2),a([Oi()],Fr.prototype,"track",2),a([Oi({type:Boolean,reflect:!0})],Fr.prototype,"decorative",2),a([Oi()],Fr.prototype,"label",2),Fr=a([mg("lui-spinner")],Fr);var xt=class extends fg{constructor(){super(...arguments);this.variant="default";this.size="md";this.radius="md";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.block=!1;this.ripple=!1;this.icon="";this.ariaLabel="";this.type="button";this._ripple=new gi(this);this._hasPrefixSlot=!1;this._hasDefaultSlot=!1;this._hasSuffixSlot=!1;this._explicitAttrs=new Set;this._onPointerDown=e=>{!this.ripple||this.disabled||this.loading||this._ripple.add(e)};this._onPrefixSlotChange=e=>{this._hasPrefixSlot=this._slotHasContent(e.currentTarget)};this._onDefaultSlotChange=e=>{this._hasDefaultSlot=this._slotHasContent(e.currentTarget)};this._onSuffixSlotChange=e=>{this._hasSuffixSlot=this._slotHasContent(e.currentTarget)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=N(this,"button");!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("ripple")&&typeof t.ripple=="boolean"&&this.ripple!==t.ripple&&(this.ripple=t.ripple),!this._explicitAttrs.has("block")&&typeof t.block=="boolean"&&this.block!==t.block&&(this.block=t.block)}_slotHasContent(e){return e.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.TEXT_NODE?!!t.textContent?.trim():t.nodeType===Node.ELEMENT_NODE)}render(){return ka`
|
|
495
495
|
<button
|
|
496
496
|
part="button"
|
|
497
497
|
type=${this.type}
|
|
@@ -520,7 +520,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
520
520
|
></slot>`}
|
|
521
521
|
</span>
|
|
522
522
|
</button>
|
|
523
|
-
`}};
|
|
523
|
+
`}};xt.styles=[A,O,hn,gg`
|
|
524
524
|
:host {
|
|
525
525
|
display: inline-flex;
|
|
526
526
|
/* Radius steps with button height; the md step tracks the token. */
|
|
@@ -745,7 +745,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
745
745
|
lui-spinner {
|
|
746
746
|
--lui-spinner-thickness: 1.75px;
|
|
747
747
|
}
|
|
748
|
-
`],a([po({reflect:!0})],
|
|
748
|
+
`],a([po({reflect:!0})],xt.prototype,"variant",2),a([po({reflect:!0})],xt.prototype,"size",2),a([po({reflect:!0})],xt.prototype,"radius",2),a([po({type:Boolean,reflect:!0})],xt.prototype,"disabled",2),a([po({type:Boolean,reflect:!0})],xt.prototype,"loading",2),a([po({type:Boolean,reflect:!0,attribute:"icon-only"})],xt.prototype,"iconOnly",2),a([po({type:Boolean,reflect:!0})],xt.prototype,"block",2),a([po({type:Boolean,reflect:!0})],xt.prototype,"ripple",2),a([po()],xt.prototype,"icon",2),a([po({attribute:"aria-label"})],xt.prototype,"ariaLabel",2),a([po()],xt.prototype,"type",2),a([xc()],xt.prototype,"_hasPrefixSlot",2),a([xc()],xt.prototype,"_hasDefaultSlot",2),a([xc()],xt.prototype,"_hasSuffixSlot",2),xt=a([vg("lui-button")],xt);import{css as bf,html as kn,LitElement as yf,nothing as yi}from"lit";import{customElement as kf,property as Bt,query as yp,queryAssignedElements as xf,state as kp}from"lit/decorators.js";function oe(i,o){if(!i||!o)return;let{style:e,className:t,class:r,...n}=o;if(Object.assign(i,n),typeof t=="string"&&(i.className=t),typeof r=="string"&&i.setAttribute("class",r),typeof e=="string"){i.setAttribute("style",e);return}if(e&&typeof e=="object"){for(let[s,d]of Object.entries(e))if(d!=null)if(s.includes("-"))i.style.setProperty(s,String(d));else try{i.style[s]=String(d)}catch{i.style.setProperty(s,String(d))}}}function ep(i){let{selection:o,currentValue:e,currentValues:t,nextValue:r}=i;return o==="none"?{value:e,values:t.slice()}:o==="single"?{value:r,values:[r]}:{value:void 0,values:t.includes(r)?t.filter(s=>s!==r):[...t,r]}}function tp(i){let{itemWidths:o,containerWidth:e,overflowTriggerWidth:t,minVisibleItems:r=0}=i;if(!o.length)return{visibleIndexes:[],overflowIndexes:[],needsOverflow:!1};let n=Math.max(0,e),s=Math.max(0,t),d=k=>o.slice(0,k).map((C,S)=>S),h=k=>o.slice(k).map((C,S)=>k+S);if(o.reduce((k,C)=>k+Math.max(0,C),0)<=n)return{visibleIndexes:d(o.length),overflowIndexes:[],needsOverflow:!1};let f=Math.min(Math.max(0,r),o.length),x=o.length;for(;x>f&&!(o.slice(0,x).reduce((C,S)=>C+Math.max(0,S),0)+s<=n);)x-=1;return{visibleIndexes:d(x),overflowIndexes:h(x),needsOverflow:x<o.length}}import{css as bg,html as yg,LitElement as kg}from"lit";import{customElement as xg,property as Ar}from"lit/decorators.js";var wt=class extends kg{constructor(){super(...arguments);this.variant="default";this.size="md";this.radius="md";this.value="";this.pressed=!1;this.disabled=!1;this.grouped=!1;this.first=!1;this.last=!1;this.vertical=!1;this.indicatorSelected=!1;this.dividerHidden=!1;this.interactionActive=!1;this.ripple=!1;this._ripple=new gi(this);this._explicitAttrs=new Set;this._emitActivate=()=>{this.disabled||this.dispatchEvent(new CustomEvent("button-group-item-activate",{detail:{value:this.value,item:this},bubbles:!0,composed:!0}))};this._onKeyDown=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._emitActivate())};this._onPointerDown=e=>{!this.ripple||this.disabled||this._ripple.add(e)}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","presentation"),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=N(this,"button");!this._explicitAttrs.has("ripple")&&typeof e.ripple=="boolean"&&this.ripple!==e.ripple&&(this.ripple=e.ripple)}trigger(){this._emitActivate()}render(){return yg`
|
|
749
749
|
<button
|
|
750
750
|
part="button"
|
|
751
751
|
type="button"
|
|
@@ -762,7 +762,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
762
762
|
<slot name="suffix"></slot>
|
|
763
763
|
</span>
|
|
764
764
|
</button>
|
|
765
|
-
`}};
|
|
765
|
+
`}};wt.styles=[A,O,hn,bg`
|
|
766
766
|
:host {
|
|
767
767
|
display: inline-flex;
|
|
768
768
|
min-width: 0;
|
|
@@ -861,25 +861,25 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
861
861
|
:host([grouped]) button {
|
|
862
862
|
border-color: transparent;
|
|
863
863
|
}
|
|
864
|
-
:host([grouped]
|
|
864
|
+
:host([grouped])::before {
|
|
865
865
|
content: "";
|
|
866
866
|
position: absolute;
|
|
867
867
|
pointer-events: none;
|
|
868
868
|
background: var(--lui-button-group-separator);
|
|
869
869
|
z-index: 2;
|
|
870
870
|
}
|
|
871
|
-
:host([grouped]:not([
|
|
871
|
+
:host([grouped]:not([vertical]):not([first]))::before {
|
|
872
872
|
inset-inline-start: 0;
|
|
873
873
|
inset-block: 1px;
|
|
874
874
|
width: 1px;
|
|
875
875
|
}
|
|
876
|
-
:host([grouped]
|
|
876
|
+
:host([grouped][vertical]:not([first]))::before {
|
|
877
877
|
inset-block-start: 0;
|
|
878
878
|
inset-inline: 1px;
|
|
879
879
|
height: 1px;
|
|
880
880
|
}
|
|
881
|
-
:host([grouped]
|
|
882
|
-
:host([grouped]
|
|
881
|
+
:host([grouped][first])::before,
|
|
882
|
+
:host([grouped][divider-hidden])::before {
|
|
883
883
|
display: none;
|
|
884
884
|
}
|
|
885
885
|
button:hover:not(:disabled) {
|
|
@@ -974,25 +974,25 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
974
974
|
--lui-button-group-item-gap: 9px;
|
|
975
975
|
--lui-button-radius-base: 14px;
|
|
976
976
|
}
|
|
977
|
-
:host([grouped]
|
|
977
|
+
:host([grouped]) {
|
|
978
978
|
--lui-button-group-item-radius: 0px;
|
|
979
979
|
}
|
|
980
|
-
:host([grouped]:not([
|
|
980
|
+
:host([grouped]:not([vertical])[first]:not([last])) {
|
|
981
981
|
--lui-button-group-item-radius: var(--lui-button-radius) 0 0 var(--lui-button-radius);
|
|
982
982
|
}
|
|
983
|
-
:host([grouped]:not([
|
|
983
|
+
:host([grouped]:not([vertical])[last]:not([first])) {
|
|
984
984
|
--lui-button-group-item-radius: 0 var(--lui-button-radius) var(--lui-button-radius) 0;
|
|
985
985
|
}
|
|
986
|
-
:host([grouped]:not([
|
|
986
|
+
:host([grouped]:not([vertical])[first][last]) {
|
|
987
987
|
--lui-button-group-item-radius: var(--lui-button-radius);
|
|
988
988
|
}
|
|
989
|
-
:host([grouped]
|
|
989
|
+
:host([grouped][vertical][first]:not([last])) {
|
|
990
990
|
--lui-button-group-item-radius: var(--lui-button-radius) var(--lui-button-radius) 0 0;
|
|
991
991
|
}
|
|
992
|
-
:host([grouped]
|
|
992
|
+
:host([grouped][vertical][last]:not([first])) {
|
|
993
993
|
--lui-button-group-item-radius: 0 0 var(--lui-button-radius) var(--lui-button-radius);
|
|
994
994
|
}
|
|
995
|
-
:host([grouped]
|
|
995
|
+
:host([grouped][vertical][first][last]) {
|
|
996
996
|
--lui-button-group-item-radius: var(--lui-button-radius);
|
|
997
997
|
}
|
|
998
998
|
|
|
@@ -1033,7 +1033,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
1033
1033
|
overflow: hidden;
|
|
1034
1034
|
text-overflow: ellipsis;
|
|
1035
1035
|
}
|
|
1036
|
-
`],a([
|
|
1036
|
+
`],a([Ar({reflect:!0})],wt.prototype,"variant",2),a([Ar({reflect:!0})],wt.prototype,"size",2),a([Ar({reflect:!0})],wt.prototype,"radius",2),a([Ar({reflect:!0})],wt.prototype,"value",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"pressed",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"disabled",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"grouped",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"first",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"last",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"vertical",2),a([Ar({type:Boolean,attribute:"indicator-selected",reflect:!0})],wt.prototype,"indicatorSelected",2),a([Ar({type:Boolean,attribute:"divider-hidden",reflect:!0})],wt.prototype,"dividerHidden",2),a([Ar({type:Boolean,attribute:"interaction-active",reflect:!0})],wt.prototype,"interactionActive",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"ripple",2),wt=a([xg("lui-button-group-item")],wt);import{css as uf,html as yn,LitElement as hf,nothing as Ds}from"lit";import{customElement as pf,property as rt,query as bp,queryAll as mf,state as gf}from"lit/decorators.js";function wg(i){return i.type??"item"}function _g(i){if(i.items?.length)return i.items;if(i.children?.length)return i.children}function xa(i){return i.filter(o=>!o.hidden).map(o=>{let e=wg(o),t=_g(o),r=o.key??o.value??o.label;return{type:e,key:r,value:o.value??o.key,label:o.label,icon:o.icon,danger:o.danger,disabled:o.disabled,checked:o.checked,active:o.active,selectable:o.selectable,shortcut:o.shortcut,shortcutIcon:o.shortcutIcon,suffix:o.suffix,children:t?.length?xa(t):void 0,command:o.command,commandPayload:o.commandPayload,action:o.action,onSelect:o.onSelect,raw:o}})}function rp(i){return xa(i)}function op(i){return xa(i)}function ip(i,o){let e=i;for(let t of o){let r=e[t];if(!r?.children?.length)return[];e=r.children}return e}function mn(i,o){if(!o.length)return null;let e=i,t=null;for(let r of o){if(t=e[r]??null,!t)return null;e=t.children??[]}return t}function wa(i){return i.type!=="divider"&&i.type!=="group"&&!i.disabled&&!i.children?.length}import{html as Zr,nothing as be}from"lit";function Mg(i){return!!(i&&typeof i=="object")}function Cg(i){return/^<svg[\s>]/i.test(i.trim())}function zg(i){return/^<(path|g|circle|rect|line|polyline|polygon|ellipse)\b/i.test(i.trim())}function Eg(i){let o=i.trim();return/^(https?:\/\/|data:image\/|blob:|\/|\.\/|\.\.\/)/i.test(o)||/\.(svg|png|webp|jpe?g|gif|avif)([?#].*)?$/i.test(o)}function Hi(i,o){if(!i)return be;if(typeof i=="string"){let x=i.trim();return x?Cg(x)?Zr`<lui-icon part=${o??be} type="svg" .svg=${x}></lui-icon>`:zg(x)?Zr`<lui-icon part=${o??be} type="svg" .svgBody=${x}></lui-icon>`:Eg(x)?Zr`<lui-icon part=${o??be} type="img" src=${x}></lui-icon>`:Zr`<lui-icon part=${o??be} name=${x}></lui-icon>`:be}if(!Mg(i))return be;let e=i.svgBody??i["svg-body"]??"",t=i.type??(i.svg||e?"svg":i.src?"img":"builtin"),r=i.name??"",n=i.iconClass??i["icon-class"]??"",s=i.viewBox??i["view-box"]??"0 0 24 24",d=i.preserveAspectRatio??i["preserve-aspect-ratio"]??"xMidYMid meet",h=i.strokeWidth??i["stroke-width"],p=i.strokeLinecap??i["stroke-linecap"],f=i.strokeLinejoin??i["stroke-linejoin"];return Zr`
|
|
1037
1037
|
<lui-icon
|
|
1038
1038
|
part=${o??be}
|
|
1039
1039
|
type=${t}
|
|
@@ -2217,7 +2217,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2217
2217
|
.submenu-chevron lui-icon {
|
|
2218
2218
|
--lui-icon-size: 16px;
|
|
2219
2219
|
}
|
|
2220
|
-
`],a([rt({attribute:!1})],Me.prototype,"items",2),a([rt()],Me.prototype,"placement",2),a([rt()],Me.prototype,"trigger",2),a([rt({type:Boolean,attribute:"close-on-select"})],Me.prototype,"closeOnSelect",2),a([rt({type:Boolean})],Me.prototype,"disabled",2),a([rt()],Me.prototype,"heading",2),a([rt({attribute:"heading-icon"})],Me.prototype,"headingIcon",2),a([rt({type:Boolean,attribute:"show-arrow"})],Me.prototype,"showArrow",2),a([rt({type:Boolean,attribute:"close-on-outside-press"})],Me.prototype,"closeOnOutsidePress",2),a([rt({type:Boolean,attribute:"close-on-esc"})],Me.prototype,"closeOnEsc",2),a([rt({type:Boolean,reflect:!0})],Me.prototype,"open",2),a([rt({type:Number,attribute:"open-delay"})],Me.prototype,"openDelay",2),a([rt({type:Number,attribute:"close-delay"})],Me.prototype,"closeDelay",2),a([rt({type:Number,attribute:"offset"})],Me.prototype,"offsetDistance",2),a([rt({reflect:!0})],Me.prototype,"backdrop",2),a([rt({attribute:"backdrop-style"})],Me.prototype,"backdropStyle",2),a([rt({type:Boolean})],Me.prototype,"portal",2),a([rt({type:Boolean,attribute:"same-width"})],Me.prototype,"sameWidth",2),a([rt({type:Number,attribute:"max-width"})],Me.prototype,"maxWidth",2),a([rt({type:Number,attribute:"max-height"})],Me.prototype,"maxHeight",2),a([rt({attribute:!1})],Me.prototype,"dropdownProps",2),a([rt({attribute:!1})],Me.prototype,"menuProps",2),a([rt({reflect:!0,attribute:"submenu-trigger"})],Me.prototype,"submenuTrigger",2),a([rt({attribute:"submenu-icon"})],Me.prototype,"submenuIcon",2),a([bp("lui-dropdown")],Me.prototype,"_dropdown",2),a([mf("lui-menu")],Me.prototype,"_menus",2),a([bp('slot[name="trigger"]')],Me.prototype,"_triggerSlot",2),a([gf()],Me.prototype,"_submenuPlacements",2),Me=a([pf("lui-dropmenu")],Me);var He=class extends yf{constructor(){super(...arguments);this.selection="none";this.shape="default";this.values=[];this.variant="default";this.size="md";this.radius="md";this.vertical=!1;this.disabled=!1;this.ripple=!1;this.block=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this.overflowPlacement="bottom-end";this.overflowTriggerWidth=0;this.overflowTriggerProps={};this.items=[];this._overflowIndexes=[];this._activeInteractionIndex=-1;this._layoutFrame=0;this._indicatorFrame=0;this._onItemActivate=e=>{let t=e.detail?.item,r=e.detail?.value??t?.value??"";t&&this._commitItemActivation(t,r)};this._onSlotChange=()=>{this.items.length>0||(this._syncItems(),this._scheduleLayout())};this._onOverflowSelect=e=>{let t=Number(e.detail?.value),r=this._collectItems()[t];if(!r||r.item.disabled)return;let n=r.element;n!==r.item&&typeof n.trigger=="function"&&n.trigger(),r.item.trigger()};this._onGroupPointerOver=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:s,item:d})=>t.includes(s)||t.includes(d));this._setInteractionIndex(n)};this._onGroupPointerOut=e=>{let t=e.relatedTarget;t&&this._groupEl?.contains(t)||this._clearInteractionIndex()};this._onGroupPointerDown=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:s,item:d})=>t.includes(s)||t.includes(d));this._setInteractionIndex(n)};this._onGroupPointerUp=()=>{this._clearInteractionIndex()}}_applyInheritedItemProp(e,t,r){let n=`data-lui-button-group-${t}`;e.hasAttribute(t)&&!e.hasAttribute(n)||(e[t]=r,e.setAttribute(n,""))}connectedCallback(){super.connectedCallback(),this.addEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver?.disconnect(),this._observedParent=void 0,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}firstUpdated(){this._groupEl&&this._resizeObserver?.observe(this._groupEl),this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncItems(),this._syncOverflowTriggerProps(),(e.has("items")||e.has("collapse")||e.has("vertical")||e.has("block")||e.has("size")||e.has("radius")||e.has("overflowTriggerWidth"))&&this._scheduleLayout()}_collectItems(){return this.items.length>0?Array.from(this.renderRoot.querySelectorAll('lui-button-group-item[data-lui-generated="true"]')).map(e=>({element:e,item:e})):(this._assignedElements??[]).map(e=>{if(e.tagName.toLowerCase()==="lui-button-group-item")return{element:e,item:e};let t=e.shadowRoot?.querySelector("lui-button-group-item");return t?{element:e,item:t}:null}).filter(e=>!!e)}_syncItems(){let e=this._collectItems(),t=this._resolvedValues(),r=e.map((h,p)=>p).filter(h=>!this._overflowIndexes.includes(h)),n=this._overflowIndexes.length>0,s=this._usesSelectionIndicator(),d=new Set(r.filter(h=>t.includes(e[h]?.item.value??"")));e.forEach(({element:h,item:p},f)=>{let x=r.indexOf(f),k=x>0?r[x-1]:-1;p.grouped=!0,p.segmented=this.shape==="segment",p.first=r[0]===f,p.last=!n&&r[r.length-1]===f,p.vertical=this.vertical,p.dividerHidden=s&&(d.has(f)||d.has(k)),p.interactionActive=this._activeInteractionIndex===f||k===this._activeInteractionIndex,this._applyInheritedItemProp(p,"variant",this.variant),this._applyInheritedItemProp(p,"size",this.size),this._applyInheritedItemProp(p,"radius",this.radius),this._applyInheritedItemProp(p,"ripple",this.ripple),this.disabled?(p.disabled||p.setAttribute("data-lui-button-group-disabled",""),p.disabled=!0):p.hasAttribute("data-lui-button-group-disabled")&&(p.removeAttribute("data-lui-button-group-disabled"),p.disabled=!1),(this.selection!=="none"||!p.hasAttribute("pressed"))&&(p.pressed=t.includes(p.value)),p.indicatorSelected=this._usesSelectionIndicator()&&p.pressed&&!this._overflowIndexes.includes(f),h.toggleAttribute("data-overflow-hidden",this._overflowIndexes.includes(f))})}_resolvedValues(){return this.selection==="single"?this.value?[this.value]:[]:this.selection==="multiple"?this.values.slice():this._collectItems().filter(({item:e})=>e.pressed).map(({item:e})=>e.value)}_readOverflowIcon(e,t){return e.getAttribute("icon")||t.getAttribute("icon")||t.querySelector('lui-icon[slot="prefix"], [slot="prefix"][name]')?.getAttribute("name")||e.shadowRoot?.querySelector('lui-button-group-item lui-icon[slot="prefix"], lui-button-group-item [slot="prefix"][name]')?.getAttribute("name")||void 0||void 0}_syncOverflowTriggerProps(){this._overflowTriggerButton&&oe(this._overflowTriggerButton,this.overflowTriggerProps)}_readOverflowLabel(e,t,r){let n=e.getAttribute("label")||t.getAttribute("label")||e.getAttribute("aria-label")||t.getAttribute("aria-label")||e.getAttribute("title")||t.getAttribute("title"),s=t.textContent?.trim()||e.textContent?.trim();return n||s||t.value||`item-${r}`}_overflowItems(){let e=this._collectItems();return this._overflowIndexes.flatMap(t=>{let r=e[t];if(!r)return[];let{element:n,item:s}=r;return[{key:String(t),value:String(t),label:this._readOverflowLabel(n,s,t),icon:this._readOverflowIcon(n,s),disabled:s.disabled,active:this.selection==="single"&&s.pressed,checked:this.selection!=="single"&&s.pressed}]})}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout(),this._scheduleSelectionIndicatorLayout()})}_usesSelectionIndicator(){return this.selection==="single"&&!this.vertical}_scheduleSelectionIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateSelectionIndicator()})}_updateSelectionIndicator(){let e=this._groupEl;if(!e||!this._usesSelectionIndicator()){e?.style.setProperty("--lui-button-group-indicator-opacity","0");return}let r=this._collectItems().find((d,h)=>d.item.pressed&&!this._overflowIndexes.includes(h));if(!r){e.style.setProperty("--lui-button-group-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.element.getBoundingClientRect();e.style.setProperty("--lui-button-group-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-button-group-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-button-group-indicator-width",`${s.width}px`),e.style.setProperty("--lui-button-group-indicator-height",`${s.height}px`),e.style.setProperty("--lui-button-group-indicator-radius",getComputedStyle(r.item).getPropertyValue("--lui-button-group-item-radius")||"0px"),e.style.setProperty("--lui-button-group-indicator-opacity","1")}_getContainerWidth(){let e=Math.round(this.getBoundingClientRect().width),t=this._groupEl?.clientWidth??0,r=this.parentElement?.getBoundingClientRect(),n=Math.round(r?.width??0),s=r?Math.max(0,Math.round(r.right-this.getBoundingClientRect().left)):0,d=this.style.width.trim().length>0;return this.block||d?e||t||n:s||n||e||t}_defaultOverflowTriggerWidth(){let e=Number.parseFloat(getComputedStyle(this).getPropertyValue("--lui-button-height"));return Number.isFinite(e)&&e>0?Math.round(e):this.overflowTriggerWidth>0?this.overflowTriggerWidth:this.size==="sm"?32:this.size==="lg"?44:38}_readItemWidth(e){let t=e.getBoundingClientRect().width,r=Math.ceil(t||e.scrollWidth||e.offsetWidth||0);return Math.max(0,r)}_setOverflowIndexes(e){if(!(e.length!==this._overflowIndexes.length||e.some((r,n)=>r!==this._overflowIndexes[n]))){this._syncItems(),this._scheduleSelectionIndicatorLayout();return}this._overflowIndexes=e,this._syncItems(),this._scheduleSelectionIndicatorLayout()}_recomputeLayout(){if(this.collapse!=="auto"||this.vertical){this._setOverflowIndexes([]);return}let e=this._collectItems(),t=this._getContainerWidth();if(!e.length||!t){this._setOverflowIndexes([]);return}let r=e.map(({element:s})=>this._readItemWidth(s)),n=tp({itemWidths:r,containerWidth:t,overflowTriggerWidth:this._defaultOverflowTriggerWidth(),minVisibleItems:0});this._setOverflowIndexes(n.overflowIndexes)}_commitItemActivation(e,t=e.value){if(e){if(this.selection!=="none"){let r=ep({selection:this.selection,currentValue:this.value,currentValues:this.values,nextValue:t});this.value=r.value,this.values=r.values,this._syncItems(),this._scheduleSelectionIndicatorLayout()}this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selection==="multiple"?void 0:this.value,values:this._resolvedValues(),item:e},bubbles:!0,composed:!0})),this.items.find(r=>r.value===t)?.onClick?.(this.items.find(r=>r.value===t))}}_setInteractionIndex(e){this._activeInteractionIndex!==e&&(this._activeInteractionIndex=e,this._syncItems())}_clearInteractionIndex(){this._activeInteractionIndex<0||(this._activeInteractionIndex=-1,this._syncItems())}_overflowTriggerRadius(){return this._overflowIndexes.length<this._collectItems().length?"0 var(--lui-button-group-radius) var(--lui-button-group-radius) 0":"var(--lui-button-group-radius)"}_renderDataItems(){return this.items.map(e=>kn`
|
|
2220
|
+
`],a([rt({attribute:!1})],Me.prototype,"items",2),a([rt()],Me.prototype,"placement",2),a([rt()],Me.prototype,"trigger",2),a([rt({type:Boolean,attribute:"close-on-select"})],Me.prototype,"closeOnSelect",2),a([rt({type:Boolean})],Me.prototype,"disabled",2),a([rt()],Me.prototype,"heading",2),a([rt({attribute:"heading-icon"})],Me.prototype,"headingIcon",2),a([rt({type:Boolean,attribute:"show-arrow"})],Me.prototype,"showArrow",2),a([rt({type:Boolean,attribute:"close-on-outside-press"})],Me.prototype,"closeOnOutsidePress",2),a([rt({type:Boolean,attribute:"close-on-esc"})],Me.prototype,"closeOnEsc",2),a([rt({type:Boolean,reflect:!0})],Me.prototype,"open",2),a([rt({type:Number,attribute:"open-delay"})],Me.prototype,"openDelay",2),a([rt({type:Number,attribute:"close-delay"})],Me.prototype,"closeDelay",2),a([rt({type:Number,attribute:"offset"})],Me.prototype,"offsetDistance",2),a([rt({reflect:!0})],Me.prototype,"backdrop",2),a([rt({attribute:"backdrop-style"})],Me.prototype,"backdropStyle",2),a([rt({type:Boolean})],Me.prototype,"portal",2),a([rt({type:Boolean,attribute:"same-width"})],Me.prototype,"sameWidth",2),a([rt({type:Number,attribute:"max-width"})],Me.prototype,"maxWidth",2),a([rt({type:Number,attribute:"max-height"})],Me.prototype,"maxHeight",2),a([rt({attribute:!1})],Me.prototype,"dropdownProps",2),a([rt({attribute:!1})],Me.prototype,"menuProps",2),a([rt({reflect:!0,attribute:"submenu-trigger"})],Me.prototype,"submenuTrigger",2),a([rt({attribute:"submenu-icon"})],Me.prototype,"submenuIcon",2),a([bp("lui-dropdown")],Me.prototype,"_dropdown",2),a([mf("lui-menu")],Me.prototype,"_menus",2),a([bp('slot[name="trigger"]')],Me.prototype,"_triggerSlot",2),a([gf()],Me.prototype,"_submenuPlacements",2),Me=a([pf("lui-dropmenu")],Me);var Re=class extends yf{constructor(){super(...arguments);this.selection="none";this.values=[];this.variant="default";this.size="md";this.radius="md";this.vertical=!1;this.disabled=!1;this.ripple=!1;this.block=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this.overflowPlacement="bottom-end";this.overflowTriggerWidth=0;this.overflowTriggerProps={};this.items=[];this._overflowIndexes=[];this._activeInteractionIndex=-1;this._layoutFrame=0;this._indicatorFrame=0;this._onItemActivate=e=>{let t=e.detail?.item,r=e.detail?.value??t?.value??"";t&&this._commitItemActivation(t,r)};this._onSlotChange=()=>{this.items.length>0||(this._syncItems(),this._scheduleLayout())};this._onOverflowSelect=e=>{let t=Number(e.detail?.value),r=this._collectItems()[t];if(!r||r.item.disabled)return;let n=r.element;n!==r.item&&typeof n.trigger=="function"&&n.trigger(),r.item.trigger()};this._onGroupPointerOver=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:s,item:d})=>t.includes(s)||t.includes(d));this._setInteractionIndex(n)};this._onGroupPointerOut=e=>{let t=e.relatedTarget;t&&this._groupEl?.contains(t)||this._clearInteractionIndex()};this._onGroupPointerDown=e=>{let t=e.composedPath(),n=this._collectItems().findIndex(({element:s,item:d})=>t.includes(s)||t.includes(d));this._setInteractionIndex(n)};this._onGroupPointerUp=()=>{this._clearInteractionIndex()}}_applyInheritedItemProp(e,t,r){let n=`data-lui-button-group-${t}`;e.hasAttribute(t)&&!e.hasAttribute(n)||(e[t]=r,e.setAttribute(n,""))}connectedCallback(){super.connectedCallback(),this.addEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("button-group-item-activate",this._onItemActivate),this._resizeObserver?.disconnect(),this._observedParent=void 0,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}firstUpdated(){this._groupEl&&this._resizeObserver?.observe(this._groupEl),this._resizeObserver?.observe(this),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncItems(),this._syncOverflowTriggerProps(),(e.has("items")||e.has("collapse")||e.has("vertical")||e.has("block")||e.has("size")||e.has("radius")||e.has("overflowTriggerWidth"))&&this._scheduleLayout()}_collectItems(){return this.items.length>0?Array.from(this.renderRoot.querySelectorAll('lui-button-group-item[data-lui-generated="true"]')).map(e=>({element:e,item:e})):(this._assignedElements??[]).map(e=>{if(e.tagName.toLowerCase()==="lui-button-group-item")return{element:e,item:e};let t=e.shadowRoot?.querySelector("lui-button-group-item");return t?{element:e,item:t}:null}).filter(e=>!!e)}_syncItems(){let e=this._collectItems(),t=this._resolvedValues(),r=e.map((h,p)=>p).filter(h=>!this._overflowIndexes.includes(h)),n=this._overflowIndexes.length>0,s=this._usesSelectionIndicator(),d=new Set(r.filter(h=>t.includes(e[h]?.item.value??"")));e.forEach(({element:h,item:p},f)=>{let x=r.indexOf(f),k=x>0?r[x-1]:-1;p.grouped=!0,p.first=r[0]===f,p.last=!n&&r[r.length-1]===f,p.vertical=this.vertical,p.dividerHidden=s&&(d.has(f)||d.has(k)),p.interactionActive=this._activeInteractionIndex===f||k===this._activeInteractionIndex,this._applyInheritedItemProp(p,"variant",this.variant),this._applyInheritedItemProp(p,"size",this.size),this._applyInheritedItemProp(p,"radius",this.radius),this._applyInheritedItemProp(p,"ripple",this.ripple),this.disabled?(p.disabled||p.setAttribute("data-lui-button-group-disabled",""),p.disabled=!0):p.hasAttribute("data-lui-button-group-disabled")&&(p.removeAttribute("data-lui-button-group-disabled"),p.disabled=!1),(this.selection!=="none"||!p.hasAttribute("pressed"))&&(p.pressed=t.includes(p.value)),p.indicatorSelected=this._usesSelectionIndicator()&&p.pressed&&!this._overflowIndexes.includes(f),h.toggleAttribute("data-overflow-hidden",this._overflowIndexes.includes(f))})}_resolvedValues(){return this.selection==="single"?this.value?[this.value]:[]:this.selection==="multiple"?this.values.slice():this._collectItems().filter(({item:e})=>e.pressed).map(({item:e})=>e.value)}_readOverflowIcon(e,t){return e.getAttribute("icon")||t.getAttribute("icon")||t.querySelector('lui-icon[slot="prefix"], [slot="prefix"][name]')?.getAttribute("name")||e.shadowRoot?.querySelector('lui-button-group-item lui-icon[slot="prefix"], lui-button-group-item [slot="prefix"][name]')?.getAttribute("name")||void 0||void 0}_syncOverflowTriggerProps(){this._overflowTriggerButton&&oe(this._overflowTriggerButton,this.overflowTriggerProps)}_readOverflowLabel(e,t,r){let n=e.getAttribute("label")||t.getAttribute("label")||e.getAttribute("aria-label")||t.getAttribute("aria-label")||e.getAttribute("title")||t.getAttribute("title"),s=t.textContent?.trim()||e.textContent?.trim();return n||s||t.value||`item-${r}`}_overflowItems(){let e=this._collectItems();return this._overflowIndexes.flatMap(t=>{let r=e[t];if(!r)return[];let{element:n,item:s}=r;return[{key:String(t),value:String(t),label:this._readOverflowLabel(n,s,t),icon:this._readOverflowIcon(n,s),disabled:s.disabled,active:this.selection==="single"&&s.pressed,checked:this.selection!=="single"&&s.pressed}]})}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout(),this._scheduleSelectionIndicatorLayout()})}_usesSelectionIndicator(){return this.selection==="single"&&!this.vertical}_scheduleSelectionIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateSelectionIndicator()})}_updateSelectionIndicator(){let e=this._groupEl;if(!e||!this._usesSelectionIndicator()){e?.style.setProperty("--lui-button-group-indicator-opacity","0");return}let r=this._collectItems().find((d,h)=>d.item.pressed&&!this._overflowIndexes.includes(h));if(!r){e.style.setProperty("--lui-button-group-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.element.getBoundingClientRect();e.style.setProperty("--lui-button-group-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-button-group-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-button-group-indicator-width",`${s.width}px`),e.style.setProperty("--lui-button-group-indicator-height",`${s.height}px`),e.style.setProperty("--lui-button-group-indicator-radius",getComputedStyle(r.item).getPropertyValue("--lui-button-group-item-radius")||"0px"),e.style.setProperty("--lui-button-group-indicator-opacity","1")}_getContainerWidth(){let e=Math.round(this.getBoundingClientRect().width),t=this._groupEl?.clientWidth??0,r=this.parentElement?.getBoundingClientRect(),n=Math.round(r?.width??0),s=r?Math.max(0,Math.round(r.right-this.getBoundingClientRect().left)):0,d=this.style.width.trim().length>0;return this.block||d?e||t||n:s||n||e||t}_defaultOverflowTriggerWidth(){let e=Number.parseFloat(getComputedStyle(this).getPropertyValue("--lui-button-height"));return Number.isFinite(e)&&e>0?Math.round(e):this.overflowTriggerWidth>0?this.overflowTriggerWidth:this.size==="sm"?32:this.size==="lg"?44:38}_readItemWidth(e){let t=e.getBoundingClientRect().width,r=Math.ceil(t||e.scrollWidth||e.offsetWidth||0);return Math.max(0,r)}_setOverflowIndexes(e){if(!(e.length!==this._overflowIndexes.length||e.some((r,n)=>r!==this._overflowIndexes[n]))){this._syncItems(),this._scheduleSelectionIndicatorLayout();return}this._overflowIndexes=e,this._syncItems(),this._scheduleSelectionIndicatorLayout()}_recomputeLayout(){if(this.collapse!=="auto"||this.vertical){this._setOverflowIndexes([]);return}let e=this._collectItems(),t=this._getContainerWidth();if(!e.length||!t){this._setOverflowIndexes([]);return}let r=e.map(({element:s})=>this._readItemWidth(s)),n=tp({itemWidths:r,containerWidth:t,overflowTriggerWidth:this._defaultOverflowTriggerWidth(),minVisibleItems:0});this._setOverflowIndexes(n.overflowIndexes)}_commitItemActivation(e,t=e.value){if(e){if(this.selection!=="none"){let r=ep({selection:this.selection,currentValue:this.value,currentValues:this.values,nextValue:t});this.value=r.value,this.values=r.values,this._syncItems(),this._scheduleSelectionIndicatorLayout()}this.dispatchEvent(new CustomEvent("change",{detail:{value:this.selection==="multiple"?void 0:this.value,values:this._resolvedValues(),item:e},bubbles:!0,composed:!0})),this.items.find(r=>r.value===t)?.onClick?.(this.items.find(r=>r.value===t))}}_setInteractionIndex(e){this._activeInteractionIndex!==e&&(this._activeInteractionIndex=e,this._syncItems())}_clearInteractionIndex(){this._activeInteractionIndex<0||(this._activeInteractionIndex=-1,this._syncItems())}_overflowTriggerRadius(){return this._overflowIndexes.length<this._collectItems().length?"0 var(--lui-button-group-radius) var(--lui-button-group-radius) 0":"var(--lui-button-group-radius)"}_renderDataItems(){return this.items.map(e=>kn`
|
|
2221
2221
|
<lui-button-group-item
|
|
2222
2222
|
data-lui-generated="true"
|
|
2223
2223
|
value=${e.value}
|
|
@@ -2281,7 +2281,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2281
2281
|
</span>
|
|
2282
2282
|
`:yi}
|
|
2283
2283
|
</div>
|
|
2284
|
-
`}};
|
|
2284
|
+
`}};Re.styles=[A,O,bf`
|
|
2285
2285
|
:host {
|
|
2286
2286
|
display: inline-flex;
|
|
2287
2287
|
min-width: 0;
|
|
@@ -2294,9 +2294,6 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2294
2294
|
--lui-button-group-selected-indicator-border: color-mix(in srgb, var(--lui-color-primary) 42%, transparent);
|
|
2295
2295
|
--lui-button-group-selected-indicator-fg: var(--lui-color-primary);
|
|
2296
2296
|
}
|
|
2297
|
-
:host([shape="segment"]) {
|
|
2298
|
-
--lui-button-group-padding: 3px;
|
|
2299
|
-
}
|
|
2300
2297
|
:host([variant="primary"]) {
|
|
2301
2298
|
--lui-button-group-selected-indicator-bg: color-mix(in srgb, var(--lui-color-primary) 84%, #000);
|
|
2302
2299
|
--lui-button-group-selected-indicator-border: transparent;
|
|
@@ -2354,10 +2351,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2354
2351
|
background: var(--lui-button-group-bg);
|
|
2355
2352
|
padding: var(--lui-button-group-padding);
|
|
2356
2353
|
overflow: hidden;
|
|
2357
|
-
gap:
|
|
2358
|
-
}
|
|
2359
|
-
:host([shape="segment"]) .group {
|
|
2360
|
-
--lui-button-group-gap: 2px;
|
|
2354
|
+
gap: 0;
|
|
2361
2355
|
}
|
|
2362
2356
|
.group::after {
|
|
2363
2357
|
content: "";
|
|
@@ -2480,7 +2474,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2480
2474
|
transition: none;
|
|
2481
2475
|
}
|
|
2482
2476
|
}
|
|
2483
|
-
`],a([Rt({reflect:!0})],He.prototype,"selection",2),a([Rt({reflect:!0})],He.prototype,"shape",2),a([Rt()],He.prototype,"value",2),a([Rt({attribute:!1})],He.prototype,"values",2),a([Rt({reflect:!0})],He.prototype,"variant",2),a([Rt({reflect:!0})],He.prototype,"size",2),a([Rt({reflect:!0})],He.prototype,"radius",2),a([Rt({type:Boolean,reflect:!0})],He.prototype,"vertical",2),a([Rt({type:Boolean,reflect:!0})],He.prototype,"disabled",2),a([Rt({type:Boolean,reflect:!0})],He.prototype,"ripple",2),a([Rt({type:Boolean,reflect:!0})],He.prototype,"block",2),a([Rt({reflect:!0})],He.prototype,"collapse",2),a([Rt({attribute:"overflow-label"})],He.prototype,"overflowLabel",2),a([Rt({attribute:"overflow-icon"})],He.prototype,"overflowIcon",2),a([Rt({attribute:"overflow-placement"})],He.prototype,"overflowPlacement",2),a([Rt({type:Number,attribute:"overflow-trigger-width"})],He.prototype,"overflowTriggerWidth",2),a([Rt({attribute:!1})],He.prototype,"overflowTriggerProps",2),a([Rt({attribute:!1})],He.prototype,"items",2),a([xf({flatten:!0})],He.prototype,"_assignedElements",2),a([yp('[part="group"]')],He.prototype,"_groupEl",2),a([yp(".overflow-trigger")],He.prototype,"_overflowTriggerButton",2),a([kp()],He.prototype,"_overflowIndexes",2),a([kp()],He.prototype,"_activeInteractionIndex",2),He=a([kf("lui-button-group")],He);import{css as Kf,html as fr,LitElement as Wf,nothing as Ta}from"lit";import{customElement as Uf,property as $t,query as Xs,queryAll as Gf,state as Zs}from"lit/decorators.js";import{html as $f,noChange as Tf}from"lit";import{directive as Af,PartType as Pf}from"lit/directive.js";import{AsyncDirective as jf}from"lit/async-directive.js";import{repeat as Of}from"lit/directives/repeat.js";var xn=class i extends Event{constructor(o){super(i.eventName,{bubbles:!1}),this.first=o.first,this.last=o.last}};xn.eventName="rangeChanged";var wn=class i extends Event{constructor(o){super(i.eventName,{bubbles:!1}),this.first=o.first,this.last=o.last}};wn.eventName="visibilityChanged";var Ea=class i extends Event{constructor(){super(i.eventName,{bubbles:!1})}};Ea.eventName="unpinned";var jc=class{constructor(o){this._element=null;let e=o??window;this._node=e,o&&(this._element=o)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},Ns=class extends jc{constructor(o,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let t=this._node;this._originalScrollTo=t.scrollTo,this._originalScrollBy=t.scrollBy,this._originalScroll=t.scroll,this._attach(o)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(o,e){let t=typeof o=="number"&&typeof e=="number"?{left:o,top:e}:o;this._scrollTo(t)}scrollBy(o,e){let t=typeof o=="number"&&typeof e=="number"?{left:o,top:e}:o;t.top!==void 0&&(t.top+=this.scrollTop),t.left!==void 0&&(t.left+=this.scrollLeft),this._scrollTo(t)}_nativeScrollTo(o){this._originalScrollTo.bind(this._element||window)(o)}_scrollTo(o,e=null,t=null){this._end!==null&&this._end(),o.behavior==="smooth"?(this._setDestination(o),this._retarget=e,this._end=t):this._resetScrollState(),this._nativeScrollTo(o)}_setDestination(o){let{top:e,left:t}=o;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),t=t===void 0?void 0:Math.max(0,Math.min(t,this.maxScrollLeft)),this._destination!==null&&t===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:t,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(o){this._destination&&this._setDestination(o)&&this._nativeScrollTo(this._destination)}managedScrollTo(o,e,t){return this._scrollTo(o,e,t),this._updateManagedScrollTo}correctScrollError(o){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(o),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:o,scrollLeft:e}=this,{top:t,left:r}=this._destination;t=Math.min(t||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let n=Math.abs(t-o),s=Math.abs(r-e);n<1&&s<1&&(this._end&&this._end(),this._resetScrollState())}}detach(o){return this._clients.delete(o),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(o){this._clients.add(o),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var zp=typeof window<"u"?window.ResizeObserver:void 0;var Di=Symbol("virtualizerRef"),Bs="virtualizer-sizer",Ep,Ks=class{constructor(o){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!o)throw new Error("Virtualizer constructor requires a configuration object");if(o.hostElement)this._init(o);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(o){Array.isArray(o)&&o!==this._items&&(this._itemsChanged=!0,this._items=o,this._schedule(this._updateLayout))}_init(o){this._isScroller=!!o.scroller,this._initHostElement(o);let e=o.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new zp(()=>this._hostElementSizeChanged()),this._childrenRO=new zp(this._childrenSizeChanged.bind(this))}_initHostElement(o){let e=this._hostElement=o.hostElement;this._applyVirtualizerStyles(),e[Di]=this}connected(){this._initObservers();let o=this._isScroller;this._clippingAncestors=Sf(this._hostElement,o),this._scrollerController=new Ns(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(o=>{o.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(o),this._hostElementRO.observe(o)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(o=>this._childrenRO.observe(o)),this._scrollEventListeners.forEach(o=>o.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(o=>o.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let o=this._hostElement;if(!this._sizer){let e=o.querySelector(`[${Bs}]`);e||(e=document.createElement("div"),e.setAttribute(Bs,""),o.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(Bs,""),this._sizer=e}return this._sizer}async updateLayoutConfig(o){await this._layoutInitialized;let e=o.type||Ep;if(typeof e=="function"&&this._layout instanceof e){let t={...o};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(o){let e,t;if(typeof o.type=="function"){t=o.type;let r={...o};delete r.type,e=r}else e=o;t===void 0&&(Ep=t=(await Promise.resolve().then(()=>(Cp(),Mp))).FlowLayout),this._layout=new t(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let o=window.performance.now(),e=o-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(n=>n.startTime>=this._benchmarkStart&&n.startTime<o).reduce((n,s)=>n+s.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let o={},e=this._children,t=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let n=e[r],s=this._first+r;(this._itemsChanged||this._toBeMeasured.has(n))&&(o[s]=t.call(this,n,this._items[s]))}this._childMeasurements=o,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(o){let{width:e,height:t}=o.getBoundingClientRect();return Object.assign({width:e,height:t},zf(o))}async _schedule(o){this._scheduled.has(o)||(this._scheduled.add(o),await Promise.resolve(),this._scheduled.delete(o),o.call(this))}async _updateDOM(o){this._scrollSize=o.scrollSize,this._adjustRange(o.range),this._childrenPos=o.childPositions,this._scrollError=o.scrollError||null;let{_rangeChanged:e,_itemsChanged:t}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||t)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(o=>this._childrenRO.observe(o)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(o){console.warn("Error measuring performance data: ",o)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(o){switch(o.type){case"scroll":(o.currentTarget===window||this._clippingAncestors.includes(o.currentTarget))&&this._handleScrollEvent();break;default:console.warn("event not handled",o)}}_handleLayoutMessage(o){o.type==="stateChanged"?this._updateDOM(o):o.type==="visibilityChanged"?(this._firstVisible=o.firstVisible,this._lastVisible=o.lastVisible,this._notifyVisibility()):o.type==="unpinned"&&this._hostElement.dispatchEvent(new Ea)}get _children(){let o=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Bs)||o.push(e),e=e.nextElementSibling;return o}_updateView(){let o=this._hostElement,e=this._scrollerController?.element,t=this._layout;if(o&&e&&t){let r,n,s,d,h=o.getBoundingClientRect();r=0,n=0,s=window.innerHeight,d=window.innerWidth;let p=this._clippingAncestors.map(P=>P.getBoundingClientRect());p.unshift(h);for(let P of p)r=Math.max(r,P.top),n=Math.max(n,P.left),s=Math.min(s,P.bottom),d=Math.min(d,P.right);let f=e.getBoundingClientRect(),x={left:h.left-f.left,top:h.top-f.top},k={width:e.scrollWidth,height:e.scrollHeight},C=r-h.top+o.scrollTop,S=n-h.left+o.scrollLeft,z=Math.max(0,s-r),T=Math.max(0,d-n);t.viewportSize={width:T,height:z},t.viewportScroll={top:C,left:S},t.totalScrollSize=k,t.offsetWithinScroller=x}}_sizeHostElement(o){let t=o&&o.width!==null?Math.min(82e5,o.width):0,r=o&&o.height!==null?Math.min(82e5,o.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${t}px, ${r}px)`;else{let n=this._hostElement.style;n.minWidth=t?`${t}px`:"100%",n.minHeight=r?`${r}px`:"100%"}}_positionChildren(o){o&&o.forEach(({top:e,left:t,width:r,height:n,xOffset:s,yOffset:d},h)=>{let p=this._children[h-this._first];p&&(p.style.position="absolute",p.style.boxSizing="border-box",p.style.transform=`translate(${t}px, ${e}px)`,r!==void 0&&(p.style.width=r+"px"),n!==void 0&&(p.style.height=n+"px"),p.style.left=s===void 0?null:s+"px",p.style.top=d===void 0?null:d+"px")})}async _adjustRange(o){let{_first:e,_last:t,_firstVisible:r,_lastVisible:n}=this;this._first=o.first,this._last=o.last,this._firstVisible=o.firstVisible,this._lastVisible=o.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==t,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){let{scrollTop:o,scrollLeft:e}=this._scrollerController,{top:t,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:o-t,left:e-r})}}element(o){return o===1/0&&(o=this._items.length-1),this._items?.[o]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:o})}}_scrollElementIntoView(o){if(o.index>=this._first&&o.index<=this._last)this._children[o.index-this._first].scrollIntoView(o);else if(o.index=Math.min(o.index,this._items.length-1),o.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(o),{behavior:t}=o;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:t}),()=>this._layout.getScrollIntoViewCoordinates(o),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=o}else this._layout.pin=o}_checkScrollIntoViewTarget(o){let{index:e}=this._scrollIntoViewTarget||{};e&&o?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new xn({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new wn({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((o,e)=>{this._layoutCompleteResolver=o,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(o){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(o),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(o){if(this._layout?.measureChildren){for(let e of o)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function zf(i){let o=window.getComputedStyle(i);return{marginTop:qs(o.marginTop),marginRight:qs(o.marginRight),marginBottom:qs(o.marginBottom),marginLeft:qs(o.marginLeft)}}function qs(i){let o=i?parseFloat(i):NaN;return Number.isNaN(o)?0:o}function Sp(i){if(i.assignedSlot!==null)return i.assignedSlot;if(i.parentElement!==null)return i.parentElement;let o=i.parentNode;return o&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&o.host||null}function Ef(i,o=!1){let e=[],t=o?i:Sp(i);for(;t!==null;)e.push(t),t=Sp(t);return e}function Sf(i,o=!1){let e=!1;return Ef(i,o).filter(t=>{if(e)return!1;let r=getComputedStyle(t);return e=r.position==="fixed",r.overflow!=="visible"})}var Ic=i=>i,Vc=(i,o)=>$f`${o}: ${JSON.stringify(i,null,2)}`,Rc=class extends jf{constructor(o){if(super(o),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>Vc(e,t+this._first),this._keyFunction=(e,t)=>Ic(e,t+this._first),this._items=[],o.type!==Pf.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(o){o&&this._setFunctions(o);let e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return Of(e,this._keyFunction,this._renderItem)}update(o,[e]){this._setFunctions(e);let t=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(o,e):this._initialize(o,e),t?Tf:this.render()}async _updateVirtualizerConfig(o,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=o.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(o){let{renderItem:e,keyFunction:t}=o;e&&(this._renderItem=(r,n)=>e(r,n+this._first)),t&&(this._keyFunction=(r,n)=>t(r,n+this._first))}_makeVirtualizer(o,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:t,scroller:r,items:n}=e;this._virtualizer=new Ks({hostElement:o,layout:t,scroller:r}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(o,e){let t=o.parentNode;t&&t.nodeType===1&&(t.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(t,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},ki=Af(Rc);import{css as Hf}from"lit";var Pr=Hf`
|
|
2477
|
+
`],a([Bt({reflect:!0})],Re.prototype,"selection",2),a([Bt()],Re.prototype,"value",2),a([Bt({attribute:!1})],Re.prototype,"values",2),a([Bt({reflect:!0})],Re.prototype,"variant",2),a([Bt({reflect:!0})],Re.prototype,"size",2),a([Bt({reflect:!0})],Re.prototype,"radius",2),a([Bt({type:Boolean,reflect:!0})],Re.prototype,"vertical",2),a([Bt({type:Boolean,reflect:!0})],Re.prototype,"disabled",2),a([Bt({type:Boolean,reflect:!0})],Re.prototype,"ripple",2),a([Bt({type:Boolean,reflect:!0})],Re.prototype,"block",2),a([Bt({reflect:!0})],Re.prototype,"collapse",2),a([Bt({attribute:"overflow-label"})],Re.prototype,"overflowLabel",2),a([Bt({attribute:"overflow-icon"})],Re.prototype,"overflowIcon",2),a([Bt({attribute:"overflow-placement"})],Re.prototype,"overflowPlacement",2),a([Bt({type:Number,attribute:"overflow-trigger-width"})],Re.prototype,"overflowTriggerWidth",2),a([Bt({attribute:!1})],Re.prototype,"overflowTriggerProps",2),a([Bt({attribute:!1})],Re.prototype,"items",2),a([xf({flatten:!0})],Re.prototype,"_assignedElements",2),a([yp('[part="group"]')],Re.prototype,"_groupEl",2),a([yp(".overflow-trigger")],Re.prototype,"_overflowTriggerButton",2),a([kp()],Re.prototype,"_overflowIndexes",2),a([kp()],Re.prototype,"_activeInteractionIndex",2),Re=a([kf("lui-button-group")],Re);import{css as Kf,html as gr,LitElement as Wf,nothing as Ta}from"lit";import{customElement as Uf,property as $t,query as Xs,queryAll as Gf,state as Zs}from"lit/decorators.js";import{html as $f,noChange as Tf}from"lit";import{directive as Af,PartType as Pf}from"lit/directive.js";import{AsyncDirective as jf}from"lit/async-directive.js";import{repeat as Of}from"lit/directives/repeat.js";var xn=class i extends Event{constructor(o){super(i.eventName,{bubbles:!1}),this.first=o.first,this.last=o.last}};xn.eventName="rangeChanged";var wn=class i extends Event{constructor(o){super(i.eventName,{bubbles:!1}),this.first=o.first,this.last=o.last}};wn.eventName="visibilityChanged";var Ea=class i extends Event{constructor(){super(i.eventName,{bubbles:!1})}};Ea.eventName="unpinned";var jc=class{constructor(o){this._element=null;let e=o??window;this._node=e,o&&(this._element=o)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},Ns=class extends jc{constructor(o,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let t=this._node;this._originalScrollTo=t.scrollTo,this._originalScrollBy=t.scrollBy,this._originalScroll=t.scroll,this._attach(o)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(o,e){let t=typeof o=="number"&&typeof e=="number"?{left:o,top:e}:o;this._scrollTo(t)}scrollBy(o,e){let t=typeof o=="number"&&typeof e=="number"?{left:o,top:e}:o;t.top!==void 0&&(t.top+=this.scrollTop),t.left!==void 0&&(t.left+=this.scrollLeft),this._scrollTo(t)}_nativeScrollTo(o){this._originalScrollTo.bind(this._element||window)(o)}_scrollTo(o,e=null,t=null){this._end!==null&&this._end(),o.behavior==="smooth"?(this._setDestination(o),this._retarget=e,this._end=t):this._resetScrollState(),this._nativeScrollTo(o)}_setDestination(o){let{top:e,left:t}=o;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),t=t===void 0?void 0:Math.max(0,Math.min(t,this.maxScrollLeft)),this._destination!==null&&t===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:t,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(o){this._destination&&this._setDestination(o)&&this._nativeScrollTo(this._destination)}managedScrollTo(o,e,t){return this._scrollTo(o,e,t),this._updateManagedScrollTo}correctScrollError(o){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(o),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:o,scrollLeft:e}=this,{top:t,left:r}=this._destination;t=Math.min(t||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let n=Math.abs(t-o),s=Math.abs(r-e);n<1&&s<1&&(this._end&&this._end(),this._resetScrollState())}}detach(o){return this._clients.delete(o),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(o){this._clients.add(o),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var zp=typeof window<"u"?window.ResizeObserver:void 0;var Di=Symbol("virtualizerRef"),Bs="virtualizer-sizer",Ep,Ks=class{constructor(o){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!o)throw new Error("Virtualizer constructor requires a configuration object");if(o.hostElement)this._init(o);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(o){Array.isArray(o)&&o!==this._items&&(this._itemsChanged=!0,this._items=o,this._schedule(this._updateLayout))}_init(o){this._isScroller=!!o.scroller,this._initHostElement(o);let e=o.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new zp(()=>this._hostElementSizeChanged()),this._childrenRO=new zp(this._childrenSizeChanged.bind(this))}_initHostElement(o){let e=this._hostElement=o.hostElement;this._applyVirtualizerStyles(),e[Di]=this}connected(){this._initObservers();let o=this._isScroller;this._clippingAncestors=Sf(this._hostElement,o),this._scrollerController=new Ns(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(o=>{o.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(o),this._hostElementRO.observe(o)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(o=>this._childrenRO.observe(o)),this._scrollEventListeners.forEach(o=>o.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(o=>o.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let o=this._hostElement;if(!this._sizer){let e=o.querySelector(`[${Bs}]`);e||(e=document.createElement("div"),e.setAttribute(Bs,""),o.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(Bs,""),this._sizer=e}return this._sizer}async updateLayoutConfig(o){await this._layoutInitialized;let e=o.type||Ep;if(typeof e=="function"&&this._layout instanceof e){let t={...o};return delete t.type,this._layout.config=t,!0}return!1}async _initLayout(o){let e,t;if(typeof o.type=="function"){t=o.type;let r={...o};delete r.type,e=r}else e=o;t===void 0&&(Ep=t=(await Promise.resolve().then(()=>(Cp(),Mp))).FlowLayout),this._layout=new t(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let o=window.performance.now(),e=o-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(n=>n.startTime>=this._benchmarkStart&&n.startTime<o).reduce((n,s)=>n+s.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let o={},e=this._children,t=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let n=e[r],s=this._first+r;(this._itemsChanged||this._toBeMeasured.has(n))&&(o[s]=t.call(this,n,this._items[s]))}this._childMeasurements=o,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(o){let{width:e,height:t}=o.getBoundingClientRect();return Object.assign({width:e,height:t},zf(o))}async _schedule(o){this._scheduled.has(o)||(this._scheduled.add(o),await Promise.resolve(),this._scheduled.delete(o),o.call(this))}async _updateDOM(o){this._scrollSize=o.scrollSize,this._adjustRange(o.range),this._childrenPos=o.childPositions,this._scrollError=o.scrollError||null;let{_rangeChanged:e,_itemsChanged:t}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||t)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(o=>this._childrenRO.observe(o)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(o){console.warn("Error measuring performance data: ",o)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(o){switch(o.type){case"scroll":(o.currentTarget===window||this._clippingAncestors.includes(o.currentTarget))&&this._handleScrollEvent();break;default:console.warn("event not handled",o)}}_handleLayoutMessage(o){o.type==="stateChanged"?this._updateDOM(o):o.type==="visibilityChanged"?(this._firstVisible=o.firstVisible,this._lastVisible=o.lastVisible,this._notifyVisibility()):o.type==="unpinned"&&this._hostElement.dispatchEvent(new Ea)}get _children(){let o=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Bs)||o.push(e),e=e.nextElementSibling;return o}_updateView(){let o=this._hostElement,e=this._scrollerController?.element,t=this._layout;if(o&&e&&t){let r,n,s,d,h=o.getBoundingClientRect();r=0,n=0,s=window.innerHeight,d=window.innerWidth;let p=this._clippingAncestors.map(P=>P.getBoundingClientRect());p.unshift(h);for(let P of p)r=Math.max(r,P.top),n=Math.max(n,P.left),s=Math.min(s,P.bottom),d=Math.min(d,P.right);let f=e.getBoundingClientRect(),x={left:h.left-f.left,top:h.top-f.top},k={width:e.scrollWidth,height:e.scrollHeight},C=r-h.top+o.scrollTop,S=n-h.left+o.scrollLeft,z=Math.max(0,s-r),T=Math.max(0,d-n);t.viewportSize={width:T,height:z},t.viewportScroll={top:C,left:S},t.totalScrollSize=k,t.offsetWithinScroller=x}}_sizeHostElement(o){let t=o&&o.width!==null?Math.min(82e5,o.width):0,r=o&&o.height!==null?Math.min(82e5,o.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${t}px, ${r}px)`;else{let n=this._hostElement.style;n.minWidth=t?`${t}px`:"100%",n.minHeight=r?`${r}px`:"100%"}}_positionChildren(o){o&&o.forEach(({top:e,left:t,width:r,height:n,xOffset:s,yOffset:d},h)=>{let p=this._children[h-this._first];p&&(p.style.position="absolute",p.style.boxSizing="border-box",p.style.transform=`translate(${t}px, ${e}px)`,r!==void 0&&(p.style.width=r+"px"),n!==void 0&&(p.style.height=n+"px"),p.style.left=s===void 0?null:s+"px",p.style.top=d===void 0?null:d+"px")})}async _adjustRange(o){let{_first:e,_last:t,_firstVisible:r,_lastVisible:n}=this;this._first=o.first,this._last=o.last,this._firstVisible=o.firstVisible,this._lastVisible=o.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==t,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){let{scrollTop:o,scrollLeft:e}=this._scrollerController,{top:t,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:o-t,left:e-r})}}element(o){return o===1/0&&(o=this._items.length-1),this._items?.[o]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:o})}}_scrollElementIntoView(o){if(o.index>=this._first&&o.index<=this._last)this._children[o.index-this._first].scrollIntoView(o);else if(o.index=Math.min(o.index,this._items.length-1),o.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(o),{behavior:t}=o;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:t}),()=>this._layout.getScrollIntoViewCoordinates(o),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=o}else this._layout.pin=o}_checkScrollIntoViewTarget(o){let{index:e}=this._scrollIntoViewTarget||{};e&&o?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new xn({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new wn({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((o,e)=>{this._layoutCompleteResolver=o,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(o){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(o),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(o){if(this._layout?.measureChildren){for(let e of o)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function zf(i){let o=window.getComputedStyle(i);return{marginTop:qs(o.marginTop),marginRight:qs(o.marginRight),marginBottom:qs(o.marginBottom),marginLeft:qs(o.marginLeft)}}function qs(i){let o=i?parseFloat(i):NaN;return Number.isNaN(o)?0:o}function Sp(i){if(i.assignedSlot!==null)return i.assignedSlot;if(i.parentElement!==null)return i.parentElement;let o=i.parentNode;return o&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&o.host||null}function Ef(i,o=!1){let e=[],t=o?i:Sp(i);for(;t!==null;)e.push(t),t=Sp(t);return e}function Sf(i,o=!1){let e=!1;return Ef(i,o).filter(t=>{if(e)return!1;let r=getComputedStyle(t);return e=r.position==="fixed",r.overflow!=="visible"})}var Ic=i=>i,Vc=(i,o)=>$f`${o}: ${JSON.stringify(i,null,2)}`,Rc=class extends jf{constructor(o){if(super(o),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,t)=>Vc(e,t+this._first),this._keyFunction=(e,t)=>Ic(e,t+this._first),this._items=[],o.type!==Pf.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(o){o&&this._setFunctions(o);let e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return Of(e,this._keyFunction,this._renderItem)}update(o,[e]){this._setFunctions(e);let t=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(o,e):this._initialize(o,e),t?Tf:this.render()}async _updateVirtualizerConfig(o,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=o.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(o){let{renderItem:e,keyFunction:t}=o;e&&(this._renderItem=(r,n)=>e(r,n+this._first)),t&&(this._keyFunction=(r,n)=>t(r,n+this._first))}_makeVirtualizer(o,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:t,scroller:r,items:n}=e;this._virtualizer=new Ks({hostElement:o,layout:t,scroller:r}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(o,e){let t=o.parentNode;t&&t.nodeType===1&&(t.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(t,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},ki=Af(Rc);import{css as Hf}from"lit";var Pr=Hf`
|
|
2484
2478
|
.control-shell {
|
|
2485
2479
|
display: inline-flex;
|
|
2486
2480
|
align-items: center;
|
|
@@ -2550,7 +2544,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
2550
2544
|
color: var(--lui-color-fg);
|
|
2551
2545
|
background: color-mix(in srgb, var(--lui-color-fg) 8%, transparent);
|
|
2552
2546
|
}
|
|
2553
|
-
`;var $p={"common.home":"Home","common.more":"More","common.close":"Close","common.cancel":"Cancel","common.confirm":"Confirm","common.create":"Create","common.select":"Select","common.copy":"Copy","common.move":"Move","common.delete":"Delete","common.rename":"Rename","common.download":"Download","common.folder":"Folder","common.new_folder":"New folder","common.upload_files":"Upload files","common.upload_folder":"Upload folder","common.back":"Back","common.forward":"Forward","common.refresh":"Refresh","common.search":"Search","common.sort":"Sort","common.expand":"Expand","common.collapse":"Collapse","common.clear_finished":"Clear finished","card.loading":"Loading\u2026","list.loading":"Loading\u2026","list.empty_folder":"Empty folder","list.opening_folder":"Opening Folder","dialog.close":"Close","dialog.loading_title":"Please wait","dialog.loading_message":"Processing...","dialog.mkdir.title":"New Folder","dialog.mkdir.headline":"Create folder","dialog.mkdir.hint":"This folder will be created in {path}.","dialog.mkdir.label":"Folder name","dialog.mkdir.placeholder":"Folder name","dialog.mkdir.error_name_required":"Name is required","dialog.mkdir.error_failed":"Failed to create folder","dialog.rename.title":"Rename","dialog.rename.headline":"Rename item","dialog.rename.hint_update":"Update {name} to the new name below.","dialog.rename.hint_choose":"Choose a new name for this item.","dialog.rename.label":"New name","dialog.rename.placeholder":"New name","dialog.rename.error_name_required":"Name is required","dialog.rename.error_failed":"Rename failed","dialog.batch_rename.title":"Batch rename","dialog.batch_rename.mode_replace":"Find & replace","dialog.batch_rename.mode_manual":"Manual edit","dialog.batch_rename.find":"Find","dialog.batch_rename.replace":"Replace","dialog.batch_rename.find_placeholder":"Text to replace","dialog.batch_rename.replace_placeholder":"Replacement text","dialog.batch_rename.before":"Before","dialog.batch_rename.after":"After","dialog.batch_rename.error_required":"Name is required","dialog.batch_rename.error_duplicate":'Duplicate name "{name}" in the same folder',"dialog.remove.title":"Delete","dialog.remove.headline_single":"Delete {name}?","dialog.remove.headline_multiple":"Delete {count} items?","dialog.remove.hint_single":"This action removes the selected item and cannot be undone.","dialog.remove.hint_multiple":"This action removes the selected items and cannot be undone.","dialog.remove.more":"...and {count} more","dialog.remove.error_failed":"Delete failed","picker.title":"Pick a folder","picker.confirm":"Select","picker.placeholder":"Select a folder below","upload.title":"Uploads","upload.count_active":"{count} active","upload.count_total":"{count} total","upload.empty":"No uploads yet","upload.state.queued":"Queued","upload.state.hashing":"Hashing\u2026","upload.state.uploading":"Uploading","upload.state.completed":"Completed","upload.state.failed":"Failed","upload.state.cancelled":"Cancelled","upload.state.reused":"Already uploaded","upload.cancel":"Cancel","upload.retry":"Retry","upload.remove":"Remove","action.copy_to_ellipsis":"Copy to\u2026","action.copy_to":"Copy to","action.move_to_ellipsis":"Move to\u2026","action.move_to":"Move to","layout.list":"List","layout.grid":"Grid","layout.cover":"Cover","sort.name":"Name","sort.size":"Size","sort.mtime":"Modified","sort.type":"Type","upload.drop_files":"Drop files to upload","pagination.label":"Pagination","pagination.first":"First page","pagination.prev":"Previous page","pagination.next":"Next page","pagination.last":"Last page","pagination.total":"Total {total}","pagination.page_size":"Page size","pagination.go_to":"Go to","icon_picker.placeholder":"Select icon","icon_picker.search_placeholder":"Search icons","icon_picker.empty":"No matching icons","icon_picker.clear":"Clear selected icon","icon_picker.unselected":"Unselected","select.clear":"Clear selection","select.empty":"No options","qrcode.label":"QR code","qrcode.empty":"Nothing to encode","input.clear":"Clear input","input.show_password":"Show password","input.hide_password":"Hide password","tag.close":"Close","dialog.close_aria":"Close","datepicker.select_date":"Select date","datepicker.select_time":"Select time","datepicker.select_datetime":"Select date and time","datepicker.clear":"Clear","datepicker.open":"Open","field.checkbox":"Checkbox","field.radio":"Radio","field.switch":"Switch"},Ws={"common.home":"\u9996\u9875","common.more":"\u66F4\u591A","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","common.confirm":"\u786E\u5B9A","common.create":"\u521B\u5EFA","common.select":"\u9009\u62E9","common.copy":"\u590D\u5236","common.move":"\u79FB\u52A8","common.delete":"\u5220\u9664","common.rename":"\u91CD\u547D\u540D","common.download":"\u4E0B\u8F7D","common.folder":"\u6587\u4EF6\u5939","common.new_folder":"\u65B0\u5EFA\u6587\u4EF6\u5939","common.upload_files":"\u4E0A\u4F20\u6587\u4EF6","common.upload_folder":"\u4E0A\u4F20\u6587\u4EF6\u5939","common.back":"\u540E\u9000","common.forward":"\u524D\u8FDB","common.refresh":"\u5237\u65B0","common.search":"\u641C\u7D22","common.sort":"\u6392\u5E8F","common.expand":"\u5C55\u5F00","common.collapse":"\u6536\u8D77","common.clear_finished":"\u6E05\u9664\u5DF2\u5B8C\u6210","card.loading":"\u52A0\u8F7D\u4E2D\u2026","list.loading":"\u52A0\u8F7D\u4E2D\u2026","list.empty_folder":"\u7A7A\u6587\u4EF6\u5939","list.opening_folder":"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u5939","dialog.close":"\u5173\u95ED","dialog.loading_title":"\u8BF7\u7A0D\u5019","dialog.loading_message":"\u5904\u7406\u4E2D...","dialog.mkdir.title":"\u65B0\u5EFA\u6587\u4EF6\u5939","dialog.mkdir.headline":"\u521B\u5EFA\u6587\u4EF6\u5939","dialog.mkdir.hint":"\u8BE5\u6587\u4EF6\u5939\u5C06\u521B\u5EFA\u5728 {path} \u4E2D\u3002","dialog.mkdir.label":"\u6587\u4EF6\u5939\u540D\u79F0","dialog.mkdir.placeholder":"\u6587\u4EF6\u5939\u540D\u79F0","dialog.mkdir.error_name_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.mkdir.error_failed":"\u521B\u5EFA\u6587\u4EF6\u5939\u5931\u8D25","dialog.rename.title":"\u91CD\u547D\u540D","dialog.rename.headline":"\u91CD\u547D\u540D\u9879\u76EE","dialog.rename.hint_update":"\u5C06 {name} \u66F4\u65B0\u4E3A\u4E0B\u9762\u7684\u65B0\u540D\u79F0\u3002","dialog.rename.hint_choose":"\u4E3A\u8BE5\u9879\u76EE\u8F93\u5165\u4E00\u4E2A\u65B0\u540D\u79F0\u3002","dialog.rename.label":"\u65B0\u540D\u79F0","dialog.rename.placeholder":"\u65B0\u540D\u79F0","dialog.rename.error_name_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.rename.error_failed":"\u91CD\u547D\u540D\u5931\u8D25","dialog.batch_rename.title":"\u6279\u91CF\u91CD\u547D\u540D","dialog.batch_rename.mode_replace":"\u67E5\u627E\u66FF\u6362","dialog.batch_rename.mode_manual":"\u624B\u52A8\u7F16\u8F91","dialog.batch_rename.find":"\u67E5\u627E","dialog.batch_rename.replace":"\u66FF\u6362\u4E3A","dialog.batch_rename.find_placeholder":"\u8981\u66FF\u6362\u7684\u6587\u672C","dialog.batch_rename.replace_placeholder":"\u66FF\u6362\u540E\u7684\u6587\u672C","dialog.batch_rename.before":"\u4FEE\u6539\u524D","dialog.batch_rename.after":"\u4FEE\u6539\u540E","dialog.batch_rename.error_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.batch_rename.error_duplicate":"\u540C\u4E00\u76EE\u5F55\u4E0B\u540D\u79F0\u201C{name}\u201D\u91CD\u590D","dialog.remove.title":"\u5220\u9664","dialog.remove.headline_single":"\u5220\u9664 {name}\uFF1F","dialog.remove.headline_multiple":"\u5220\u9664 {count} \u4E2A\u9879\u76EE\uFF1F","dialog.remove.hint_single":"\u6B64\u64CD\u4F5C\u4F1A\u5220\u9664\u6240\u9009\u9879\u76EE\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002","dialog.remove.hint_multiple":"\u6B64\u64CD\u4F5C\u4F1A\u5220\u9664\u6240\u9009\u9879\u76EE\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002","dialog.remove.more":"\u2026\u2026\u4EE5\u53CA\u53E6\u5916 {count} \u9879","dialog.remove.error_failed":"\u5220\u9664\u5931\u8D25","picker.title":"\u9009\u62E9\u6587\u4EF6\u5939","picker.confirm":"\u9009\u62E9","picker.placeholder":"\u8BF7\u9009\u62E9\u4E0B\u9762\u7684\u6587\u4EF6\u5939","upload.title":"\u4E0A\u4F20","upload.count_active":"{count} \u4E2A\u8FDB\u884C\u4E2D","upload.count_total":"\u5171 {count} \u4E2A","upload.empty":"\u6682\u65E0\u4E0A\u4F20\u4EFB\u52A1","upload.state.queued":"\u6392\u961F\u4E2D","upload.state.hashing":"\u6821\u9A8C\u4E2D\u2026","upload.state.uploading":"\u4E0A\u4F20\u4E2D","upload.state.completed":"\u5DF2\u5B8C\u6210","upload.state.failed":"\u5931\u8D25","upload.state.cancelled":"\u5DF2\u53D6\u6D88","upload.state.reused":"\u5DF2\u5B58\u5728","upload.cancel":"\u53D6\u6D88","upload.retry":"\u91CD\u8BD5","upload.remove":"\u79FB\u9664","action.copy_to_ellipsis":"\u590D\u5236\u5230\u2026","action.copy_to":"\u590D\u5236\u5230","action.move_to_ellipsis":"\u79FB\u52A8\u5230\u2026","action.move_to":"\u79FB\u52A8\u5230","layout.list":"\u5217\u8868","layout.grid":"\u7F51\u683C","layout.cover":"\u5C01\u9762","sort.name":"\u540D\u79F0","sort.size":"\u5927\u5C0F","sort.mtime":"\u4FEE\u6539\u65F6\u95F4","sort.type":"\u7C7B\u578B","upload.drop_files":"\u62D6\u653E\u6587\u4EF6\u4EE5\u4E0A\u4F20","pagination.label":"\u5206\u9875","pagination.first":"\u7B2C\u4E00\u9875","pagination.prev":"\u4E0A\u4E00\u9875","pagination.next":"\u4E0B\u4E00\u9875","pagination.last":"\u6700\u540E\u4E00\u9875","pagination.total":"\u5171 {total} \u9879","pagination.page_size":"\u6BCF\u9875\u6761\u6570","pagination.go_to":"\u8DF3\u81F3","icon_picker.placeholder":"\u9009\u62E9\u56FE\u6807","icon_picker.search_placeholder":"\u641C\u7D22\u56FE\u6807","icon_picker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u56FE\u6807","icon_picker.clear":"\u6E05\u9664\u5DF2\u9009\u56FE\u6807","icon_picker.unselected":"\u672A\u9009\u62E9","select.clear":"\u6E05\u9664\u9009\u62E9","select.empty":"\u6CA1\u6709\u53EF\u9009\u9879","qrcode.label":"\u4E8C\u7EF4\u7801","qrcode.empty":"\u65E0\u5185\u5BB9","input.clear":"\u6E05\u9664\u8F93\u5165","input.show_password":"\u663E\u793A\u5BC6\u7801","input.hide_password":"\u9690\u85CF\u5BC6\u7801","tag.close":"\u5173\u95ED","dialog.close_aria":"\u5173\u95ED","datepicker.select_date":"\u9009\u62E9\u65E5\u671F","datepicker.select_time":"\u9009\u62E9\u65F6\u95F4","datepicker.select_datetime":"\u9009\u62E9\u65E5\u671F\u65F6\u95F4","datepicker.clear":"\u6E05\u9664","datepicker.open":"\u6253\u5F00","field.checkbox":"\u590D\u9009\u6846","field.radio":"\u5355\u9009\u6846","field.switch":"\u5F00\u5173"},Tp={en:$p,"en-us":$p,zh:Ws,"zh-cn":Ws},$a="zh-cn",Dc=new Map,Us="locale-change";function Rf(i){if(!i)return Ws;let o=i.trim().toLowerCase();return Tp[o]??Tp[o.split("-")[0]]??Ws}function ie(i,o){let e=(i||$a).trim().toLowerCase();return{...Rf(e),...Dc.get(e)??{},...o??{}}}function ne(i,o,e,t){let r=i?.[o]??e;return t?r.replace(/\{(\w+)\}/g,(n,s)=>{let d=t[s];return d==null?"":String(d)}):r}function Q3(){return $a}function Ap(i){let o=i.trim().toLowerCase();!o||o===$a||($a=o,globalThis.dispatchEvent(new CustomEvent(Us,{detail:{locale:o}})))}function Pp(i,o){let e=i.trim().toLowerCase();e&&(Dc.set(e,{...Dc.get(e)??{},...o}),e===$a&&globalThis.dispatchEvent(new CustomEvent(Us,{detail:{locale:e}})))}function ye(i){return globalThis.addEventListener(Us,i),()=>globalThis.removeEventListener(Us,i)}function J3(i,o,e,t,r){return ne(ie(t,r),i,o,e)}import{css as Lf,html as vo,LitElement as Bf,nothing as Li}from"lit";import{customElement as qf,property as It,query as Hp,state as Rp}from"lit/decorators.js";import{css as Nc,html as ct,LitElement as Op}from"lit";import{customElement as Fc,property as Se,query as Gs,state as Ys}from"lit/decorators.js";import{css as If}from"lit";var Ni=If`
|
|
2547
|
+
`;var $p={"common.home":"Home","common.more":"More","common.close":"Close","common.cancel":"Cancel","common.confirm":"Confirm","common.create":"Create","common.select":"Select","common.copy":"Copy","common.move":"Move","common.delete":"Delete","common.rename":"Rename","common.download":"Download","common.folder":"Folder","common.new_folder":"New folder","common.upload_files":"Upload files","common.upload_folder":"Upload folder","common.back":"Back","common.forward":"Forward","common.refresh":"Refresh","common.search":"Search","common.sort":"Sort","common.expand":"Expand","common.collapse":"Collapse","common.clear_finished":"Clear finished","card.loading":"Loading\u2026","list.loading":"Loading\u2026","list.empty_folder":"Empty folder","list.opening_folder":"Opening Folder","dialog.close":"Close","dialog.loading_title":"Please wait","dialog.loading_message":"Processing...","dialog.mkdir.title":"New Folder","dialog.mkdir.headline":"Create folder","dialog.mkdir.hint":"This folder will be created in {path}.","dialog.mkdir.label":"Folder name","dialog.mkdir.placeholder":"Folder name","dialog.mkdir.error_name_required":"Name is required","dialog.mkdir.error_failed":"Failed to create folder","dialog.rename.title":"Rename","dialog.rename.headline":"Rename item","dialog.rename.hint_update":"Update {name} to the new name below.","dialog.rename.hint_choose":"Choose a new name for this item.","dialog.rename.label":"New name","dialog.rename.placeholder":"New name","dialog.rename.error_name_required":"Name is required","dialog.rename.error_failed":"Rename failed","dialog.batch_rename.title":"Batch rename","dialog.batch_rename.mode_replace":"Find & replace","dialog.batch_rename.mode_manual":"Manual edit","dialog.batch_rename.find":"Find","dialog.batch_rename.replace":"Replace","dialog.batch_rename.find_placeholder":"Text to replace","dialog.batch_rename.replace_placeholder":"Replacement text","dialog.batch_rename.before":"Before","dialog.batch_rename.after":"After","dialog.batch_rename.error_required":"Name is required","dialog.batch_rename.error_duplicate":'Duplicate name "{name}" in the same folder',"dialog.remove.title":"Delete","dialog.remove.headline_single":"Delete {name}?","dialog.remove.headline_multiple":"Delete {count} items?","dialog.remove.hint_single":"This action removes the selected item and cannot be undone.","dialog.remove.hint_multiple":"This action removes the selected items and cannot be undone.","dialog.remove.more":"...and {count} more","dialog.remove.error_failed":"Delete failed","picker.title":"Pick a folder","picker.confirm":"Select","picker.placeholder":"Select a folder below","upload.title":"Uploads","upload.count_active":"{count} active","upload.count_total":"{count} total","upload.empty":"No uploads yet","upload.state.queued":"Queued","upload.state.hashing":"Hashing\u2026","upload.state.uploading":"Uploading","upload.state.completed":"Completed","upload.state.failed":"Failed","upload.state.cancelled":"Cancelled","upload.state.reused":"Already uploaded","upload.cancel":"Cancel","upload.retry":"Retry","upload.remove":"Remove","action.copy_to_ellipsis":"Copy to\u2026","action.copy_to":"Copy to","action.move_to_ellipsis":"Move to\u2026","action.move_to":"Move to","layout.list":"List","layout.grid":"Grid","layout.cover":"Cover","sort.name":"Name","sort.size":"Size","sort.mtime":"Modified","sort.type":"Type","upload.drop_files":"Drop files to upload","pagination.label":"Pagination","pagination.first":"First page","pagination.prev":"Previous page","pagination.next":"Next page","pagination.last":"Last page","pagination.total":"Total {total}","pagination.page_size":"Page size","pagination.go_to":"Go to","icon_picker.placeholder":"Select icon","icon_picker.search_placeholder":"Search icons","icon_picker.empty":"No matching icons","icon_picker.clear":"Clear selected icon","icon_picker.unselected":"Unselected","select.clear":"Clear selection","select.empty":"No options","qrcode.label":"QR code","qrcode.empty":"Nothing to encode","input.clear":"Clear input","input.show_password":"Show password","input.hide_password":"Hide password","tag.close":"Close","dialog.close_aria":"Close","datepicker.select_date":"Select date","datepicker.select_time":"Select time","datepicker.select_datetime":"Select date and time","datepicker.clear":"Clear","datepicker.open":"Open","field.checkbox":"Checkbox","field.radio":"Radio","field.switch":"Switch"},Ws={"common.home":"\u9996\u9875","common.more":"\u66F4\u591A","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","common.confirm":"\u786E\u5B9A","common.create":"\u521B\u5EFA","common.select":"\u9009\u62E9","common.copy":"\u590D\u5236","common.move":"\u79FB\u52A8","common.delete":"\u5220\u9664","common.rename":"\u91CD\u547D\u540D","common.download":"\u4E0B\u8F7D","common.folder":"\u6587\u4EF6\u5939","common.new_folder":"\u65B0\u5EFA\u6587\u4EF6\u5939","common.upload_files":"\u4E0A\u4F20\u6587\u4EF6","common.upload_folder":"\u4E0A\u4F20\u6587\u4EF6\u5939","common.back":"\u540E\u9000","common.forward":"\u524D\u8FDB","common.refresh":"\u5237\u65B0","common.search":"\u641C\u7D22","common.sort":"\u6392\u5E8F","common.expand":"\u5C55\u5F00","common.collapse":"\u6536\u8D77","common.clear_finished":"\u6E05\u9664\u5DF2\u5B8C\u6210","card.loading":"\u52A0\u8F7D\u4E2D\u2026","list.loading":"\u52A0\u8F7D\u4E2D\u2026","list.empty_folder":"\u7A7A\u6587\u4EF6\u5939","list.opening_folder":"\u6B63\u5728\u6253\u5F00\u6587\u4EF6\u5939","dialog.close":"\u5173\u95ED","dialog.loading_title":"\u8BF7\u7A0D\u5019","dialog.loading_message":"\u5904\u7406\u4E2D...","dialog.mkdir.title":"\u65B0\u5EFA\u6587\u4EF6\u5939","dialog.mkdir.headline":"\u521B\u5EFA\u6587\u4EF6\u5939","dialog.mkdir.hint":"\u8BE5\u6587\u4EF6\u5939\u5C06\u521B\u5EFA\u5728 {path} \u4E2D\u3002","dialog.mkdir.label":"\u6587\u4EF6\u5939\u540D\u79F0","dialog.mkdir.placeholder":"\u6587\u4EF6\u5939\u540D\u79F0","dialog.mkdir.error_name_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.mkdir.error_failed":"\u521B\u5EFA\u6587\u4EF6\u5939\u5931\u8D25","dialog.rename.title":"\u91CD\u547D\u540D","dialog.rename.headline":"\u91CD\u547D\u540D\u9879\u76EE","dialog.rename.hint_update":"\u5C06 {name} \u66F4\u65B0\u4E3A\u4E0B\u9762\u7684\u65B0\u540D\u79F0\u3002","dialog.rename.hint_choose":"\u4E3A\u8BE5\u9879\u76EE\u8F93\u5165\u4E00\u4E2A\u65B0\u540D\u79F0\u3002","dialog.rename.label":"\u65B0\u540D\u79F0","dialog.rename.placeholder":"\u65B0\u540D\u79F0","dialog.rename.error_name_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.rename.error_failed":"\u91CD\u547D\u540D\u5931\u8D25","dialog.batch_rename.title":"\u6279\u91CF\u91CD\u547D\u540D","dialog.batch_rename.mode_replace":"\u67E5\u627E\u66FF\u6362","dialog.batch_rename.mode_manual":"\u624B\u52A8\u7F16\u8F91","dialog.batch_rename.find":"\u67E5\u627E","dialog.batch_rename.replace":"\u66FF\u6362\u4E3A","dialog.batch_rename.find_placeholder":"\u8981\u66FF\u6362\u7684\u6587\u672C","dialog.batch_rename.replace_placeholder":"\u66FF\u6362\u540E\u7684\u6587\u672C","dialog.batch_rename.before":"\u4FEE\u6539\u524D","dialog.batch_rename.after":"\u4FEE\u6539\u540E","dialog.batch_rename.error_required":"\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A","dialog.batch_rename.error_duplicate":"\u540C\u4E00\u76EE\u5F55\u4E0B\u540D\u79F0\u201C{name}\u201D\u91CD\u590D","dialog.remove.title":"\u5220\u9664","dialog.remove.headline_single":"\u5220\u9664 {name}\uFF1F","dialog.remove.headline_multiple":"\u5220\u9664 {count} \u4E2A\u9879\u76EE\uFF1F","dialog.remove.hint_single":"\u6B64\u64CD\u4F5C\u4F1A\u5220\u9664\u6240\u9009\u9879\u76EE\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002","dialog.remove.hint_multiple":"\u6B64\u64CD\u4F5C\u4F1A\u5220\u9664\u6240\u9009\u9879\u76EE\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002","dialog.remove.more":"\u2026\u2026\u4EE5\u53CA\u53E6\u5916 {count} \u9879","dialog.remove.error_failed":"\u5220\u9664\u5931\u8D25","picker.title":"\u9009\u62E9\u6587\u4EF6\u5939","picker.confirm":"\u9009\u62E9","picker.placeholder":"\u8BF7\u9009\u62E9\u4E0B\u9762\u7684\u6587\u4EF6\u5939","upload.title":"\u4E0A\u4F20","upload.count_active":"{count} \u4E2A\u8FDB\u884C\u4E2D","upload.count_total":"\u5171 {count} \u4E2A","upload.empty":"\u6682\u65E0\u4E0A\u4F20\u4EFB\u52A1","upload.state.queued":"\u6392\u961F\u4E2D","upload.state.hashing":"\u6821\u9A8C\u4E2D\u2026","upload.state.uploading":"\u4E0A\u4F20\u4E2D","upload.state.completed":"\u5DF2\u5B8C\u6210","upload.state.failed":"\u5931\u8D25","upload.state.cancelled":"\u5DF2\u53D6\u6D88","upload.state.reused":"\u5DF2\u5B58\u5728","upload.cancel":"\u53D6\u6D88","upload.retry":"\u91CD\u8BD5","upload.remove":"\u79FB\u9664","action.copy_to_ellipsis":"\u590D\u5236\u5230\u2026","action.copy_to":"\u590D\u5236\u5230","action.move_to_ellipsis":"\u79FB\u52A8\u5230\u2026","action.move_to":"\u79FB\u52A8\u5230","layout.list":"\u5217\u8868","layout.grid":"\u7F51\u683C","layout.cover":"\u5C01\u9762","sort.name":"\u540D\u79F0","sort.size":"\u5927\u5C0F","sort.mtime":"\u4FEE\u6539\u65F6\u95F4","sort.type":"\u7C7B\u578B","upload.drop_files":"\u62D6\u653E\u6587\u4EF6\u4EE5\u4E0A\u4F20","pagination.label":"\u5206\u9875","pagination.first":"\u7B2C\u4E00\u9875","pagination.prev":"\u4E0A\u4E00\u9875","pagination.next":"\u4E0B\u4E00\u9875","pagination.last":"\u6700\u540E\u4E00\u9875","pagination.total":"\u5171 {total} \u9879","pagination.page_size":"\u6BCF\u9875\u6761\u6570","pagination.go_to":"\u8DF3\u81F3","icon_picker.placeholder":"\u9009\u62E9\u56FE\u6807","icon_picker.search_placeholder":"\u641C\u7D22\u56FE\u6807","icon_picker.empty":"\u6CA1\u6709\u5339\u914D\u7684\u56FE\u6807","icon_picker.clear":"\u6E05\u9664\u5DF2\u9009\u56FE\u6807","icon_picker.unselected":"\u672A\u9009\u62E9","select.clear":"\u6E05\u9664\u9009\u62E9","select.empty":"\u6CA1\u6709\u53EF\u9009\u9879","qrcode.label":"\u4E8C\u7EF4\u7801","qrcode.empty":"\u65E0\u5185\u5BB9","input.clear":"\u6E05\u9664\u8F93\u5165","input.show_password":"\u663E\u793A\u5BC6\u7801","input.hide_password":"\u9690\u85CF\u5BC6\u7801","tag.close":"\u5173\u95ED","dialog.close_aria":"\u5173\u95ED","datepicker.select_date":"\u9009\u62E9\u65E5\u671F","datepicker.select_time":"\u9009\u62E9\u65F6\u95F4","datepicker.select_datetime":"\u9009\u62E9\u65E5\u671F\u65F6\u95F4","datepicker.clear":"\u6E05\u9664","datepicker.open":"\u6253\u5F00","field.checkbox":"\u590D\u9009\u6846","field.radio":"\u5355\u9009\u6846","field.switch":"\u5F00\u5173"},Tp={en:$p,"en-us":$p,zh:Ws,"zh-cn":Ws},$a="zh-cn",Dc=new Map,Us="locale-change";function Rf(i){if(!i)return Ws;let o=i.trim().toLowerCase();return Tp[o]??Tp[o.split("-")[0]]??Ws}function ie(i,o){let e=(i||$a).trim().toLowerCase();return{...Rf(e),...Dc.get(e)??{},...o??{}}}function ne(i,o,e,t){let r=i?.[o]??e;return t?r.replace(/\{(\w+)\}/g,(n,s)=>{let d=t[s];return d==null?"":String(d)}):r}function Q3(){return $a}function Ap(i){let o=i.trim().toLowerCase();!o||o===$a||($a=o,globalThis.dispatchEvent(new CustomEvent(Us,{detail:{locale:o}})))}function Pp(i,o){let e=i.trim().toLowerCase();e&&(Dc.set(e,{...Dc.get(e)??{},...o}),e===$a&&globalThis.dispatchEvent(new CustomEvent(Us,{detail:{locale:e}})))}function ye(i){return globalThis.addEventListener(Us,i),()=>globalThis.removeEventListener(Us,i)}function J3(i,o,e,t,r){return ne(ie(t,r),i,o,e)}import{css as Lf,html as vo,LitElement as Bf,nothing as Li}from"lit";import{customElement as qf,property as Rt,query as Hp,state as Rp}from"lit/decorators.js";import{css as Nc,html as ct,LitElement as Op}from"lit";import{customElement as Fc,property as Se,query as Gs,state as Ys}from"lit/decorators.js";import{css as If}from"lit";var Ni=If`
|
|
2554
2548
|
.option-row {
|
|
2555
2549
|
align-items: center;
|
|
2556
2550
|
gap: var(--lui-option-gap);
|
|
@@ -3597,7 +3591,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3597
3591
|
transition: none;
|
|
3598
3592
|
}
|
|
3599
3593
|
}
|
|
3600
|
-
`],a([It({type:Number})],Ie.prototype,"current",2),a([It({type:Number})],Ie.prototype,"total",2),a([It({type:Number,attribute:"page-size"})],Ie.prototype,"pageSize",2),a([It({type:Number,attribute:"max-visible"})],Ie.prototype,"maxVisible",2),a([It({reflect:!0})],Ie.prototype,"size",2),a([It({type:Boolean,attribute:"show-summary"})],Ie.prototype,"showSummary",2),a([It({type:Boolean,attribute:"show-total"})],Ie.prototype,"showTotal",2),a([It({type:Boolean,attribute:"show-jumper"})],Ie.prototype,"showJumper",2),a([It({type:Boolean,attribute:"show-size-changer"})],Ie.prototype,"showSizeChanger",2),a([It({type:Boolean,attribute:"show-first-last"})],Ie.prototype,"showFirstLast",2),a([It({type:Boolean,attribute:"hide-on-single-page"})],Ie.prototype,"hideOnSinglePage",2),a([It({type:Boolean,reflect:!0})],Ie.prototype,"simple",2),a([It({type:Boolean,reflect:!0})],Ie.prototype,"compact",2),a([It({type:Boolean,reflect:!0})],Ie.prototype,"responsive",2),a([It()],Ie.prototype,"locale",2),a([It({attribute:!1})],Ie.prototype,"translations",2),a([It({attribute:!1})],Ie.prototype,"pageSizeOptions",2),a([It({attribute:!1})],Ie.prototype,"selectProps",2),a([Hp("select")],Ie.prototype,"_sizeSelect",2),a([Hp('[part="pager"]')],Ie.prototype,"_pagerNode",2),a([Rp()],Ie.prototype,"_jumperValue",2),a([Rp()],Ie.prototype,"_responsiveMode",2),Ie=a([qf("lui-pagination")],Ie);var Yf=new Set(["folder","folder-open","file","image","search","plus","minus","x","check","copy","download","upload","edit","trash","refresh","eye","eye-off","chevron-down","chevron-up","chevron-left","chevron-right","panel-left-open","panel-left-close","settings","info","warning"]),Xf=new Set(["\u72B6\u6001","\u5176\u4ED6"]),Ip=i=>{let o=i.toLowerCase();return Yf.has(o)?"\u5E38\u7528":/folder|file|image|video|music|audio|archive|clipboard|copy|trash|download|upload|paperclip|scissors|save|hard-drive|file-/.test(o)?"\u6587\u4EF6":/arrow|chevron|caret|corner|move|turn-|up|down|left|right/.test(o)?"\u65B9\u5411":/plus|minus|search|filter|sort|edit|pen|pencil|brush|crop|menu|more|ellipsis|settings|sliders|cog|wand|sparkles/.test(o)?"\u64CD\u4F5C":/check|alert|warning|info|help|badge|shield|lock|unlock|eye|bell|message-circle-warning|triangle-alert|circle-alert|octagon-alert/.test(o)?"\u72B6\u6001":/panel|sidebar|layout|grid|list|table|columns|rows|square|rectangle|align|justify/.test(o)?"\u5E03\u5C40":/monitor|laptop|tablet|smartphone|phone|camera|printer|server|cpu|usb|router|wifi|bluetooth/.test(o)?"\u8BBE\u5907":"\u5176\u4ED6"},Ce=class extends Wf{constructor(){super(...arguments);this.value="";this.placeholder="";this.searchPlaceholder="";this.emptyText="";this.size="md";this.disabled=!1;this.clearable=!0;this.searchable=!0;this.open=!1;this.type="builtin";this.columns=6;this.maxHeight=420;this.pageSize=72;this.source=[];this.triggerProps={};this.dropdownProps={};this.paginationProps={};this._keyword="";this._activeCategory="\u5168\u90E8";this._activeValue="";this._currentPage=1;this._explicitAttrs=new Set;this._handleDropdownOpen=()=>{this.open=!0};this._handleDropdownClose=()=>{this.open=!1,this._keyword&&(this._keyword="")};this._setCategory=e=>{this._activeCategory=e,this._currentPage=1,this._activeValue=this._filteredOptions.find(t=>t.value===this.value)?.value||this._filteredOptions[0]?.value||"",queueMicrotask(()=>this._ensureActiveVisible())};this._onSearchInput=e=>{e.stopPropagation(),this._keyword=e.target.value,this._currentPage=1,this._activeValue=this._filteredOptions.find(t=>t.value===this.value)?.value||this._filteredOptions[0]?.value||"",queueMicrotask(()=>this._ensureActiveVisible())};this._onClear=e=>{e.preventDefault(),e.stopPropagation(),this.value&&this._setValue("",!0)};this._onSelect=e=>{this._setValue(e.value),this._dropdown?.hide()};this._onPanelKeydown=e=>{if(!this.open)return;let t=this._pagedOptions;if(!t.length)return;let r=Math.max(1,this.columns||1);switch(e.key){case"ArrowRight":e.preventDefault(),this._moveActive(1);break;case"ArrowLeft":e.preventDefault(),this._moveActive(-1);break;case"ArrowDown":e.preventDefault(),this._moveActive(r);break;case"ArrowUp":e.preventDefault(),this._moveActive(-r);break;case"Home":e.preventDefault(),this._activeValue=t[0].value,this._ensureActiveVisible();break;case"End":e.preventDefault(),this._activeValue=t[t.length-1].value,this._ensureActiveVisible();break;case"Enter":case" ":e.preventDefault(),this._onSelect(t.find(n=>n.value===this._activeValue)||t[0]);break;case"Escape":e.preventDefault(),this._dropdown?.hide();break;default:break}};this._onPageChange=e=>{let t=e.detail.page??e.detail.current??1;this._currentPage=t;let r=this._pagedOptions;r.length>0&&(this._activeValue=r.find(n=>n.value===this.value)?.value||r[0].value),queueMicrotask(()=>{this._gridWrap?.focus(),this._gridWrap&&(this._gridWrap.scrollTop=0),this._ensureActiveVisible()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t,r){let n=Fe(this,this.locale,this.translations);return ne(ie(n.locale,n.translations),e,t,r)}willUpdate(){let e=N(this,"iconPicker");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("searchable")&&typeof e.searchable=="boolean"&&this.searchable!==e.searchable&&(this.searchable=e.searchable),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder),!this._explicitAttrs.has("search-placeholder")&&typeof e.searchPlaceholder=="string"&&!this.searchPlaceholder&&(this.searchPlaceholder=e.searchPlaceholder),!this._explicitAttrs.has("empty-text")&&typeof e.emptyText=="string"&&!this.emptyText&&(this.emptyText=e.emptyText)}get _options(){return(this.source.length>0?this.source:zs).map(t=>{if(typeof t=="string")return{value:t,label:t,keywords:t.split(/[-:\s]+/g).filter(Boolean),category:Ip(t)};let r=Array.isArray(t.keywords)?t.keywords:t.keywords?[t.keywords]:[];return{value:t.value,label:t.label||t.value,keywords:r,category:t.category||Ip(t.value),type:t.type,name:t.name,src:t.src,svg:t.svg,iconClass:t.iconClass,color:t.color}})}get _selectedOption(){return this._options.find(e=>e.value===this.value)}get _activeOption(){return this._options.find(e=>e.value===this._activeValue)}get _categories(){let e=new Set;for(let t of this._options)e.add(t.category);return["\u5168\u90E8",...e]}get _categoryTabs(){return this._categories.filter(e=>e==="\u5168\u90E8"||!Xf.has(e))}get _filteredOptions(){let e=this._keyword.trim().toLowerCase();return this._options.filter(t=>e?[t.value,t.label,t.category,...t.keywords].join(" ").toLowerCase().includes(e):!0)}get _previewSecondary(){let e=this._selectedOption||this._activeOption;return e&&e.label!==e.value?e.value:""}get _virtualRows(){let e=[],t=Math.max(1,this.columns||1),r=this._pagedOptions;for(let n=0;n<r.length;n+=t){let s=r.slice(n,n+t);for(;s.length<t;)s.push(null);e.push({index:e.length,items:s})}return e}_getRowHeight(){return 46}get _pageCount(){return Math.max(1,Math.ceil(this._filteredOptions.length/Math.max(1,this.pageSize||1)))}get _resolvedPage(){return Math.min(this._pageCount,Math.max(1,this._currentPage||1))}get _pagedOptions(){let e=Math.max(1,this.pageSize||1),t=(this._resolvedPage-1)*e;return this._filteredOptions.slice(t,t+e)}updated(e){let t=N(this,"iconPicker");oe(this._triggerEl,{...t.triggerProps??{},...this.triggerProps??{}}),oe(this._dropdown,{...t.dropdownProps??{},...this.dropdownProps??{}});for(let r of this._paginationEls??[])oe(r,{...t.paginationProps??{},...this.paginationProps??{}});e.has("columns")&&this.style.setProperty("--lui-icon-picker-columns",String(Math.max(1,this.columns||1))),e.has("maxHeight")&&this.style.setProperty("--lui-icon-picker-panel-max-height",`${Math.max(160,this.maxHeight||160)}px`),e.has("source")&&!this._categoryTabs.includes(this._activeCategory)&&(this._activeCategory="\u5168\u90E8"),(e.has("value")||e.has("source"))&&this.value&&this._activeValue!==this.value&&(this._activeValue=this.value),e.has("source")&&this._activeValue&&!this._filteredOptions.some(r=>r.value===this._activeValue)&&(this._activeValue=this._filteredOptions[0]?.value||""),(e.has("source")||e.has("pageSize"))&&(this._currentPage=Math.min(this._resolvedPage,this._pageCount)),e.has("open")&&this.open&&queueMicrotask(()=>{this._activeValue=this.value||this._filteredOptions[0]?.value||"",this._syncPageWithActiveValue(),this._searchInput?this._searchInput.focus():this.renderRoot.querySelector(".grid-wrap")?.focus(),this._ensureActiveVisible()}),(e.has("value")||e.has("columns")||e.has("source")||e.has("open"))&&queueMicrotask(()=>this._ensureActiveVisible())}_setValue(e,t=!1){this.value=e;let r={value:this.value,item:this._selectedOption};this.dispatchEvent(new CustomEvent("change",{detail:r,bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("clear",{detail:r,bubbles:!0,composed:!0}))}_moveActive(e){let t=this._pagedOptions;if(!t.length)return;let r=Math.max(0,t.findIndex(d=>d.value===this._activeValue)),n=Math.min(t.length-1,Math.max(0,r+e)),s=t[n];s&&(this._activeValue=s.value,this._ensureActiveVisible())}_ensureActiveVisible(){let e=this._gridWrap;if(!e||!this.open||!this._activeValue)return;let r=this._pagedOptions.findIndex(k=>k.value===this._activeValue);if(r<0)return;let n=Math.max(1,this.columns||1),s=Math.floor(r/n),d=this._getRowHeight(),h=s*d,p=h+d,f=e.scrollTop,x=f+e.clientHeight;h<f?e.scrollTop=h:p>x&&(e.scrollTop=p-e.clientHeight)}_syncPageWithActiveValue(){if(!this._activeValue)return;let e=this._filteredOptions.findIndex(r=>r.value===this._activeValue);if(e<0)return;let t=Math.max(1,this.pageSize||1);this._currentPage=Math.floor(e/t)+1}_renderOptionIcon(e){return fr`
|
|
3594
|
+
`],a([Rt({type:Number})],Ie.prototype,"current",2),a([Rt({type:Number})],Ie.prototype,"total",2),a([Rt({type:Number,attribute:"page-size"})],Ie.prototype,"pageSize",2),a([Rt({type:Number,attribute:"max-visible"})],Ie.prototype,"maxVisible",2),a([Rt({reflect:!0})],Ie.prototype,"size",2),a([Rt({type:Boolean,attribute:"show-summary"})],Ie.prototype,"showSummary",2),a([Rt({type:Boolean,attribute:"show-total"})],Ie.prototype,"showTotal",2),a([Rt({type:Boolean,attribute:"show-jumper"})],Ie.prototype,"showJumper",2),a([Rt({type:Boolean,attribute:"show-size-changer"})],Ie.prototype,"showSizeChanger",2),a([Rt({type:Boolean,attribute:"show-first-last"})],Ie.prototype,"showFirstLast",2),a([Rt({type:Boolean,attribute:"hide-on-single-page"})],Ie.prototype,"hideOnSinglePage",2),a([Rt({type:Boolean,reflect:!0})],Ie.prototype,"simple",2),a([Rt({type:Boolean,reflect:!0})],Ie.prototype,"compact",2),a([Rt({type:Boolean,reflect:!0})],Ie.prototype,"responsive",2),a([Rt()],Ie.prototype,"locale",2),a([Rt({attribute:!1})],Ie.prototype,"translations",2),a([Rt({attribute:!1})],Ie.prototype,"pageSizeOptions",2),a([Rt({attribute:!1})],Ie.prototype,"selectProps",2),a([Hp("select")],Ie.prototype,"_sizeSelect",2),a([Hp('[part="pager"]')],Ie.prototype,"_pagerNode",2),a([Rp()],Ie.prototype,"_jumperValue",2),a([Rp()],Ie.prototype,"_responsiveMode",2),Ie=a([qf("lui-pagination")],Ie);var Yf=new Set(["folder","folder-open","file","image","search","plus","minus","x","check","copy","download","upload","edit","trash","refresh","eye","eye-off","chevron-down","chevron-up","chevron-left","chevron-right","panel-left-open","panel-left-close","settings","info","warning"]),Xf=new Set(["\u72B6\u6001","\u5176\u4ED6"]),Ip=i=>{let o=i.toLowerCase();return Yf.has(o)?"\u5E38\u7528":/folder|file|image|video|music|audio|archive|clipboard|copy|trash|download|upload|paperclip|scissors|save|hard-drive|file-/.test(o)?"\u6587\u4EF6":/arrow|chevron|caret|corner|move|turn-|up|down|left|right/.test(o)?"\u65B9\u5411":/plus|minus|search|filter|sort|edit|pen|pencil|brush|crop|menu|more|ellipsis|settings|sliders|cog|wand|sparkles/.test(o)?"\u64CD\u4F5C":/check|alert|warning|info|help|badge|shield|lock|unlock|eye|bell|message-circle-warning|triangle-alert|circle-alert|octagon-alert/.test(o)?"\u72B6\u6001":/panel|sidebar|layout|grid|list|table|columns|rows|square|rectangle|align|justify/.test(o)?"\u5E03\u5C40":/monitor|laptop|tablet|smartphone|phone|camera|printer|server|cpu|usb|router|wifi|bluetooth/.test(o)?"\u8BBE\u5907":"\u5176\u4ED6"},Ce=class extends Wf{constructor(){super(...arguments);this.value="";this.placeholder="";this.searchPlaceholder="";this.emptyText="";this.size="md";this.disabled=!1;this.clearable=!0;this.searchable=!0;this.open=!1;this.type="builtin";this.columns=6;this.maxHeight=420;this.pageSize=72;this.source=[];this.triggerProps={};this.dropdownProps={};this.paginationProps={};this._keyword="";this._activeCategory="\u5168\u90E8";this._activeValue="";this._currentPage=1;this._explicitAttrs=new Set;this._handleDropdownOpen=()=>{this.open=!0};this._handleDropdownClose=()=>{this.open=!1,this._keyword&&(this._keyword="")};this._setCategory=e=>{this._activeCategory=e,this._currentPage=1,this._activeValue=this._filteredOptions.find(t=>t.value===this.value)?.value||this._filteredOptions[0]?.value||"",queueMicrotask(()=>this._ensureActiveVisible())};this._onSearchInput=e=>{e.stopPropagation(),this._keyword=e.target.value,this._currentPage=1,this._activeValue=this._filteredOptions.find(t=>t.value===this.value)?.value||this._filteredOptions[0]?.value||"",queueMicrotask(()=>this._ensureActiveVisible())};this._onClear=e=>{e.preventDefault(),e.stopPropagation(),this.value&&this._setValue("",!0)};this._onSelect=e=>{this._setValue(e.value),this._dropdown?.hide()};this._onPanelKeydown=e=>{if(!this.open)return;let t=this._pagedOptions;if(!t.length)return;let r=Math.max(1,this.columns||1);switch(e.key){case"ArrowRight":e.preventDefault(),this._moveActive(1);break;case"ArrowLeft":e.preventDefault(),this._moveActive(-1);break;case"ArrowDown":e.preventDefault(),this._moveActive(r);break;case"ArrowUp":e.preventDefault(),this._moveActive(-r);break;case"Home":e.preventDefault(),this._activeValue=t[0].value,this._ensureActiveVisible();break;case"End":e.preventDefault(),this._activeValue=t[t.length-1].value,this._ensureActiveVisible();break;case"Enter":case" ":e.preventDefault(),this._onSelect(t.find(n=>n.value===this._activeValue)||t[0]);break;case"Escape":e.preventDefault(),this._dropdown?.hide();break;default:break}};this._onPageChange=e=>{let t=e.detail.page??e.detail.current??1;this._currentPage=t;let r=this._pagedOptions;r.length>0&&(this._activeValue=r.find(n=>n.value===this.value)?.value||r[0].value),queueMicrotask(()=>{this._gridWrap?.focus(),this._gridWrap&&(this._gridWrap.scrollTop=0),this._ensureActiveVisible()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t,r){let n=Fe(this,this.locale,this.translations);return ne(ie(n.locale,n.translations),e,t,r)}willUpdate(){let e=N(this,"iconPicker");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("searchable")&&typeof e.searchable=="boolean"&&this.searchable!==e.searchable&&(this.searchable=e.searchable),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder),!this._explicitAttrs.has("search-placeholder")&&typeof e.searchPlaceholder=="string"&&!this.searchPlaceholder&&(this.searchPlaceholder=e.searchPlaceholder),!this._explicitAttrs.has("empty-text")&&typeof e.emptyText=="string"&&!this.emptyText&&(this.emptyText=e.emptyText)}get _options(){return(this.source.length>0?this.source:zs).map(t=>{if(typeof t=="string")return{value:t,label:t,keywords:t.split(/[-:\s]+/g).filter(Boolean),category:Ip(t)};let r=Array.isArray(t.keywords)?t.keywords:t.keywords?[t.keywords]:[];return{value:t.value,label:t.label||t.value,keywords:r,category:t.category||Ip(t.value),type:t.type,name:t.name,src:t.src,svg:t.svg,iconClass:t.iconClass,color:t.color}})}get _selectedOption(){return this._options.find(e=>e.value===this.value)}get _activeOption(){return this._options.find(e=>e.value===this._activeValue)}get _categories(){let e=new Set;for(let t of this._options)e.add(t.category);return["\u5168\u90E8",...e]}get _categoryTabs(){return this._categories.filter(e=>e==="\u5168\u90E8"||!Xf.has(e))}get _filteredOptions(){let e=this._keyword.trim().toLowerCase();return this._options.filter(t=>e?[t.value,t.label,t.category,...t.keywords].join(" ").toLowerCase().includes(e):!0)}get _previewSecondary(){let e=this._selectedOption||this._activeOption;return e&&e.label!==e.value?e.value:""}get _virtualRows(){let e=[],t=Math.max(1,this.columns||1),r=this._pagedOptions;for(let n=0;n<r.length;n+=t){let s=r.slice(n,n+t);for(;s.length<t;)s.push(null);e.push({index:e.length,items:s})}return e}_getRowHeight(){return 46}get _pageCount(){return Math.max(1,Math.ceil(this._filteredOptions.length/Math.max(1,this.pageSize||1)))}get _resolvedPage(){return Math.min(this._pageCount,Math.max(1,this._currentPage||1))}get _pagedOptions(){let e=Math.max(1,this.pageSize||1),t=(this._resolvedPage-1)*e;return this._filteredOptions.slice(t,t+e)}updated(e){let t=N(this,"iconPicker");oe(this._triggerEl,{...t.triggerProps??{},...this.triggerProps??{}}),oe(this._dropdown,{...t.dropdownProps??{},...this.dropdownProps??{}});for(let r of this._paginationEls??[])oe(r,{...t.paginationProps??{},...this.paginationProps??{}});e.has("columns")&&this.style.setProperty("--lui-icon-picker-columns",String(Math.max(1,this.columns||1))),e.has("maxHeight")&&this.style.setProperty("--lui-icon-picker-panel-max-height",`${Math.max(160,this.maxHeight||160)}px`),e.has("source")&&!this._categoryTabs.includes(this._activeCategory)&&(this._activeCategory="\u5168\u90E8"),(e.has("value")||e.has("source"))&&this.value&&this._activeValue!==this.value&&(this._activeValue=this.value),e.has("source")&&this._activeValue&&!this._filteredOptions.some(r=>r.value===this._activeValue)&&(this._activeValue=this._filteredOptions[0]?.value||""),(e.has("source")||e.has("pageSize"))&&(this._currentPage=Math.min(this._resolvedPage,this._pageCount)),e.has("open")&&this.open&&queueMicrotask(()=>{this._activeValue=this.value||this._filteredOptions[0]?.value||"",this._syncPageWithActiveValue(),this._searchInput?this._searchInput.focus():this.renderRoot.querySelector(".grid-wrap")?.focus(),this._ensureActiveVisible()}),(e.has("value")||e.has("columns")||e.has("source")||e.has("open"))&&queueMicrotask(()=>this._ensureActiveVisible())}_setValue(e,t=!1){this.value=e;let r={value:this.value,item:this._selectedOption};this.dispatchEvent(new CustomEvent("change",{detail:r,bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("clear",{detail:r,bubbles:!0,composed:!0}))}_moveActive(e){let t=this._pagedOptions;if(!t.length)return;let r=Math.max(0,t.findIndex(d=>d.value===this._activeValue)),n=Math.min(t.length-1,Math.max(0,r+e)),s=t[n];s&&(this._activeValue=s.value,this._ensureActiveVisible())}_ensureActiveVisible(){let e=this._gridWrap;if(!e||!this.open||!this._activeValue)return;let r=this._pagedOptions.findIndex(k=>k.value===this._activeValue);if(r<0)return;let n=Math.max(1,this.columns||1),s=Math.floor(r/n),d=this._getRowHeight(),h=s*d,p=h+d,f=e.scrollTop,x=f+e.clientHeight;h<f?e.scrollTop=h:p>x&&(e.scrollTop=p-e.clientHeight)}_syncPageWithActiveValue(){if(!this._activeValue)return;let e=this._filteredOptions.findIndex(r=>r.value===this._activeValue);if(e<0)return;let t=Math.max(1,this.pageSize||1);this._currentPage=Math.floor(e/t)+1}_renderOptionIcon(e){return gr`
|
|
3601
3595
|
<lui-icon
|
|
3602
3596
|
.type=${e.type||this.type}
|
|
3603
3597
|
.name=${e.name||e.value}
|
|
@@ -3606,9 +3600,9 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3606
3600
|
.iconClass=${e.iconClass}
|
|
3607
3601
|
.color=${e.color}
|
|
3608
3602
|
></lui-icon>
|
|
3609
|
-
`}_renderSearch(){return this.searchable?
|
|
3603
|
+
`}_renderSearch(){return this.searchable?gr`
|
|
3610
3604
|
<div class="panel-header" part="header">
|
|
3611
|
-
${this.searchable?
|
|
3605
|
+
${this.searchable?gr`
|
|
3612
3606
|
<label class="control-shell search" part="search">
|
|
3613
3607
|
<lui-icon name="search"></lui-icon>
|
|
3614
3608
|
<input
|
|
@@ -3621,7 +3615,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3621
3615
|
</label>
|
|
3622
3616
|
`:Ta}
|
|
3623
3617
|
</div>
|
|
3624
|
-
`:Ta}_renderOptionButton(e){let t=["option",e.value===this.value?"selected":"",e.value===this._activeValue?"active":""].filter(Boolean).join(" ");return
|
|
3618
|
+
`:Ta}_renderOptionButton(e){let t=["option",e.value===this.value?"selected":"",e.value===this._activeValue?"active":""].filter(Boolean).join(" ");return gr`
|
|
3625
3619
|
<button
|
|
3626
3620
|
class=${t}
|
|
3627
3621
|
part="option"
|
|
@@ -3637,11 +3631,11 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3637
3631
|
<lui-icon name="check"></lui-icon>
|
|
3638
3632
|
</span>
|
|
3639
3633
|
</button>
|
|
3640
|
-
`}_renderVirtualRow(e){return
|
|
3634
|
+
`}_renderVirtualRow(e){return gr`
|
|
3641
3635
|
<div class="grid-row" part="row" data-row-index=${e.index}>
|
|
3642
|
-
${e.items.map(t=>t?this._renderOptionButton(t):
|
|
3636
|
+
${e.items.map(t=>t?this._renderOptionButton(t):gr`<span class="option-placeholder" aria-hidden="true"></span>`)}
|
|
3643
3637
|
</div>
|
|
3644
|
-
`}render(){let e=this._selectedOption,t=this._activeOption,r=this._filteredOptions,n=this._virtualRows,s=this.clearable&&!this.disabled&&!!this.value,d=e||t,h=vs(this);return
|
|
3638
|
+
`}render(){let e=this._selectedOption,t=this._activeOption,r=this._filteredOptions,n=this._virtualRows,s=this.clearable&&!this.disabled&&!!this.value,d=e||t,h=vs(this);return gr`
|
|
3645
3639
|
<lui-dropdown
|
|
3646
3640
|
.open=${this.open}
|
|
3647
3641
|
.disabled=${this.disabled}
|
|
@@ -3660,7 +3654,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3660
3654
|
aria-expanded=${this.open?"true":"false"}
|
|
3661
3655
|
>
|
|
3662
3656
|
<span class="preview" part="preview">
|
|
3663
|
-
${e?this._renderOptionIcon(e):
|
|
3657
|
+
${e?this._renderOptionIcon(e):gr`<lui-icon name="search"></lui-icon>`}
|
|
3664
3658
|
</span>
|
|
3665
3659
|
<span class="value" part="value">
|
|
3666
3660
|
<span class="value-text ${e?"":"placeholder"}">
|
|
@@ -3668,7 +3662,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3668
3662
|
</span>
|
|
3669
3663
|
</span>
|
|
3670
3664
|
<span class="suffix" part="suffix">
|
|
3671
|
-
${s?
|
|
3665
|
+
${s?gr`
|
|
3672
3666
|
<button
|
|
3673
3667
|
class="icon-btn"
|
|
3674
3668
|
type="button"
|
|
@@ -3684,7 +3678,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3684
3678
|
|
|
3685
3679
|
<div class="panel" part="panel" @keydown=${this._onPanelKeydown}>
|
|
3686
3680
|
${this._renderSearch()}
|
|
3687
|
-
${r.length>0?
|
|
3681
|
+
${r.length>0?gr`
|
|
3688
3682
|
<div
|
|
3689
3683
|
class="grid-wrap"
|
|
3690
3684
|
part="body"
|
|
@@ -3694,23 +3688,23 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
3694
3688
|
${ki({items:n,renderItem:p=>this._renderVirtualRow(p)})}
|
|
3695
3689
|
</div>
|
|
3696
3690
|
</div>
|
|
3697
|
-
`:
|
|
3691
|
+
`:gr`<div class="empty" part="empty">${(h?.("iconPicker")??this.emptyText)||this._t("icon_picker.empty","\u6CA1\u6709\u5339\u914D\u7684\u56FE\u6807")}</div>`}
|
|
3698
3692
|
<div class="panel-footer" part="footer">
|
|
3699
3693
|
<div class="panel-footer-main">
|
|
3700
3694
|
<span class="panel-footer-start">
|
|
3701
3695
|
<span class="results">${r.length} / ${this._options.length}</span>
|
|
3702
3696
|
</span>
|
|
3703
3697
|
<span class="footer-preview panel-footer-end">
|
|
3704
|
-
${d?
|
|
3698
|
+
${d?gr`
|
|
3705
3699
|
${this._renderOptionIcon(d)}
|
|
3706
3700
|
<span class="footer-copy">
|
|
3707
3701
|
<strong>${d.label}</strong>
|
|
3708
|
-
${this._previewSecondary?
|
|
3702
|
+
${this._previewSecondary?gr`<span>${this._previewSecondary}</span>`:Ta}
|
|
3709
3703
|
</span>
|
|
3710
|
-
`:
|
|
3704
|
+
`:gr`<span>${this._t("icon_picker.unselected","\u672A\u9009\u62E9")}</span>`}
|
|
3711
3705
|
</span>
|
|
3712
3706
|
</div>
|
|
3713
|
-
${r.length>this.pageSize?
|
|
3707
|
+
${r.length>this.pageSize?gr`
|
|
3714
3708
|
<div class="panel-pagination">
|
|
3715
3709
|
<lui-pagination
|
|
3716
3710
|
size="sm"
|
|
@@ -5132,11 +5126,11 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5132
5126
|
min-height: 34px;
|
|
5133
5127
|
padding: 0 12px;
|
|
5134
5128
|
border-radius: var(--lui-radius-full);
|
|
5135
|
-
border: 1px solid var(--lui-color-border);
|
|
5136
5129
|
background: var(--lui-color-bg-elevated, var(--lui-color-bg));
|
|
5137
|
-
box-shadow:
|
|
5130
|
+
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
|
|
5138
5131
|
color: var(--lui-color-fg-muted);
|
|
5139
5132
|
font-size: var(--lui-font-size-sm);
|
|
5133
|
+
font-weight: 500;
|
|
5140
5134
|
}
|
|
5141
5135
|
.loading-pill lui-icon {
|
|
5142
5136
|
--lui-icon-size: 16px;
|
|
@@ -5427,7 +5421,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5427
5421
|
justify-content: flex-end;
|
|
5428
5422
|
margin-top: 12px;
|
|
5429
5423
|
}
|
|
5430
|
-
`],a([Y({attribute:!1})],U.prototype,"columns",2),a([Y({attribute:!1})],U.prototype,"data",2),a([Y({attribute:!1})],U.prototype,"dataSource",2),a([Y({attribute:!1})],U.prototype,"source",2),a([Y({attribute:"row-key"})],U.prototype,"rowKey",2),a([Y({reflect:!0})],U.prototype,"size",2),a([Y({reflect:!0})],U.prototype,"selection",2),a([Y({attribute:!1,hasChanged:(e,t)=>{if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;let r=new Set(t.map(String));return e.some(n=>!r.has(String(n)))}})],U.prototype,"selectedRowKeys",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"bordered",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"border",2),a([Y({type:Boolean,reflect:!0,attribute:"noborder"})],U.prototype,"noBorder",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"striped",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"hoverable",2),a([Y({type:Boolean,reflect:!0,attribute:"sticky-header"})],U.prototype,"stickyHeader",2),a([Y({type:Boolean,attribute:"show-header"})],U.prototype,"showHeader",2),a([Y({type:Boolean,reflect:!0,attribute:"column-resizable"})],U.prototype,"columnResizable",2),a([Y({reflect:!0,attribute:"resize-mode"})],U.prototype,"resizeMode",2),a([Y({type:Boolean,reflect:!0,attribute:"column-reorderable"})],U.prototype,"columnReorderable",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"loading",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"virtual",2),a([Y({attribute:"virtual-height"})],U.prototype,"virtualHeight",2),a([Y({type:Number,attribute:"row-height"})],U.prototype,"rowHeight",2),a([Y({type:Number})],U.prototype,"overscan",2),a([Y({type:Boolean})],U.prototype,"pagination",2),a([Y({type:Boolean,attribute:"remote-pagination"})],U.prototype,"remotePagination",2),a([Y({type:Number})],U.prototype,"current",2),a([Y({type:Number,attribute:"page-size"})],U.prototype,"pageSize",2),a([Y({type:Number})],U.prototype,"total",2),a([Y({type:Boolean,attribute:"show-size-changer"})],U.prototype,"showSizeChanger",2),a([Y({type:Boolean,reflect:!0,attribute:"show-seq"})],U.prototype,"showSeq",2),a([Y({attribute:"seq-label"})],U.prototype,"seqLabel",2),a([Y({attribute:!1})],U.prototype,"footerData",2),a([Y({type:Boolean,attribute:"show-overflow"})],U.prototype,"showOverflow",2),a([Y({type:Boolean,attribute:"show-header-overflow"})],U.prototype,"showHeaderOverflow",2),a([Y({attribute:"column-widths",converter:{fromAttribute(e){if(!(e==null||e===""))try{let t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).filter(([,r])=>Number.isFinite(Number(r))).map(([r,n])=>[r,Math.round(Number(n))]))}catch{}},toAttribute(e){return e==null?null:JSON.stringify(e)}}})],U.prototype,"columnWidths",2),a([Y()],U.prototype,"emptyText",2),a([Y({attribute:"sort-key"})],U.prototype,"sortKey",2),a([Y({attribute:"sort-order"})],U.prototype,"sortOrder",2),a([Y({attribute:!1})],U.prototype,"sorter",2),a([Y({type:Boolean,attribute:"row-clickable"})],U.prototype,"rowClickable",2),a([Y({type:Boolean,reflect:!0,attribute:"select-on-click"})],U.prototype,"selectOnClick",2),a([Y({reflect:!0,attribute:"row-animation"})],U.prototype,"rowAnimation",2),a([Y({attribute:!1})],U.prototype,"onRow",2),a([Y({attribute:!1})],U.prototype,"onCell",2),a([Y({attribute:!1})],U.prototype,"onHeaderRow",2),a([Y({attribute:!1})],U.prototype,"onHeaderCell",2),a([Dp(".scroll")],U.prototype,"_scrollEl",2),a([Dp("lit-virtualizer.table-virtualizer")],U.prototype,"_virtualizerEl",2),a([sv({flatten:!0,selector:"lui-table-column"})],U.prototype,"_slottedColumns",2),a([Qs()],U.prototype,"_responsiveWidth",2),a([Qs()],U.prototype,"_columnWidthOverrides",2),a([Qs()],U.prototype,"_columnOrderKeys",2),a([Qs()],U.prototype,"_virtualStart",2),U=a([Lp("lui-table")],U);import{css as vv,html as tl,LitElement as bv,nothing as yv,nothing as kv}from"lit";import{customElement as xv,property as
|
|
5424
|
+
`],a([Y({attribute:!1})],U.prototype,"columns",2),a([Y({attribute:!1})],U.prototype,"data",2),a([Y({attribute:!1})],U.prototype,"dataSource",2),a([Y({attribute:!1})],U.prototype,"source",2),a([Y({attribute:"row-key"})],U.prototype,"rowKey",2),a([Y({reflect:!0})],U.prototype,"size",2),a([Y({reflect:!0})],U.prototype,"selection",2),a([Y({attribute:!1,hasChanged:(e,t)=>{if(e===t)return!1;if(!e||!t||e.length!==t.length)return!0;let r=new Set(t.map(String));return e.some(n=>!r.has(String(n)))}})],U.prototype,"selectedRowKeys",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"bordered",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"border",2),a([Y({type:Boolean,reflect:!0,attribute:"noborder"})],U.prototype,"noBorder",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"striped",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"hoverable",2),a([Y({type:Boolean,reflect:!0,attribute:"sticky-header"})],U.prototype,"stickyHeader",2),a([Y({type:Boolean,attribute:"show-header"})],U.prototype,"showHeader",2),a([Y({type:Boolean,reflect:!0,attribute:"column-resizable"})],U.prototype,"columnResizable",2),a([Y({reflect:!0,attribute:"resize-mode"})],U.prototype,"resizeMode",2),a([Y({type:Boolean,reflect:!0,attribute:"column-reorderable"})],U.prototype,"columnReorderable",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"loading",2),a([Y({type:Boolean,reflect:!0})],U.prototype,"virtual",2),a([Y({attribute:"virtual-height"})],U.prototype,"virtualHeight",2),a([Y({type:Number,attribute:"row-height"})],U.prototype,"rowHeight",2),a([Y({type:Number})],U.prototype,"overscan",2),a([Y({type:Boolean})],U.prototype,"pagination",2),a([Y({type:Boolean,attribute:"remote-pagination"})],U.prototype,"remotePagination",2),a([Y({type:Number})],U.prototype,"current",2),a([Y({type:Number,attribute:"page-size"})],U.prototype,"pageSize",2),a([Y({type:Number})],U.prototype,"total",2),a([Y({type:Boolean,attribute:"show-size-changer"})],U.prototype,"showSizeChanger",2),a([Y({type:Boolean,reflect:!0,attribute:"show-seq"})],U.prototype,"showSeq",2),a([Y({attribute:"seq-label"})],U.prototype,"seqLabel",2),a([Y({attribute:!1})],U.prototype,"footerData",2),a([Y({type:Boolean,attribute:"show-overflow"})],U.prototype,"showOverflow",2),a([Y({type:Boolean,attribute:"show-header-overflow"})],U.prototype,"showHeaderOverflow",2),a([Y({attribute:"column-widths",converter:{fromAttribute(e){if(!(e==null||e===""))try{let t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).filter(([,r])=>Number.isFinite(Number(r))).map(([r,n])=>[r,Math.round(Number(n))]))}catch{}},toAttribute(e){return e==null?null:JSON.stringify(e)}}})],U.prototype,"columnWidths",2),a([Y()],U.prototype,"emptyText",2),a([Y({attribute:"sort-key"})],U.prototype,"sortKey",2),a([Y({attribute:"sort-order"})],U.prototype,"sortOrder",2),a([Y({attribute:!1})],U.prototype,"sorter",2),a([Y({type:Boolean,attribute:"row-clickable"})],U.prototype,"rowClickable",2),a([Y({type:Boolean,reflect:!0,attribute:"select-on-click"})],U.prototype,"selectOnClick",2),a([Y({reflect:!0,attribute:"row-animation"})],U.prototype,"rowAnimation",2),a([Y({attribute:!1})],U.prototype,"onRow",2),a([Y({attribute:!1})],U.prototype,"onCell",2),a([Y({attribute:!1})],U.prototype,"onHeaderRow",2),a([Y({attribute:!1})],U.prototype,"onHeaderCell",2),a([Dp(".scroll")],U.prototype,"_scrollEl",2),a([Dp("lit-virtualizer.table-virtualizer")],U.prototype,"_virtualizerEl",2),a([sv({flatten:!0,selector:"lui-table-column"})],U.prototype,"_slottedColumns",2),a([Qs()],U.prototype,"_responsiveWidth",2),a([Qs()],U.prototype,"_columnWidthOverrides",2),a([Qs()],U.prototype,"_columnOrderKeys",2),a([Qs()],U.prototype,"_virtualStart",2),U=a([Lp("lui-table")],U);import{css as vv,html as tl,LitElement as bv,nothing as yv,nothing as kv}from"lit";import{customElement as xv,property as It,query as qp,state as Kp}from"lit/decorators.js";import{css as uv,html as hv,LitElement as pv,nothing as mv}from"lit";import{customElement as gv,property as wi,query as fv}from"lit/decorators.js";var fr=class extends pv{constructor(){super(...arguments);this.content="";this.placement="top";this.disabled=!1;this.showArrow=!0;this.openDelay=120;this.closeDelay=80;this.offsetDistance=8;this.popoverProps={}}updated(){if(this._popover){let e=N(this,"tooltip");oe(this._popover,{...e.popoverProps??{},...this.popoverProps??{}})}}render(){let e=this.content.trim().length>0;return hv`
|
|
5431
5425
|
<lui-popover
|
|
5432
5426
|
trigger="hover focus"
|
|
5433
5427
|
.portal=${!0}
|
|
@@ -5448,7 +5442,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5448
5442
|
style="display:block;margin:0;padding:0;color:inherit;white-space:pre-wrap;word-break:break-word;"
|
|
5449
5443
|
>${e?this.content:mv}<slot name="content"></slot></div>
|
|
5450
5444
|
</lui-popover>
|
|
5451
|
-
`}};
|
|
5445
|
+
`}};fr.styles=[A,O,uv`
|
|
5452
5446
|
:host {
|
|
5453
5447
|
display: inline-block;
|
|
5454
5448
|
vertical-align: middle;
|
|
@@ -5491,7 +5485,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5491
5485
|
.tooltip-body {
|
|
5492
5486
|
color: inherit;
|
|
5493
5487
|
}
|
|
5494
|
-
`],a([wi()],
|
|
5488
|
+
`],a([wi()],fr.prototype,"content",2),a([wi({reflect:!0})],fr.prototype,"placement",2),a([wi({type:Boolean,reflect:!0})],fr.prototype,"disabled",2),a([wi({type:Boolean,attribute:"show-arrow"})],fr.prototype,"showArrow",2),a([wi({type:Number,attribute:"open-delay"})],fr.prototype,"openDelay",2),a([wi({type:Number,attribute:"close-delay"})],fr.prototype,"closeDelay",2),a([wi({type:Number,attribute:"offset"})],fr.prototype,"offsetDistance",2),a([wi({attribute:!1})],fr.prototype,"popoverProps",2),a([fv("lui-popover")],fr.prototype,"_popover",2),fr=a([gv("lui-tooltip")],fr);var Ve=class extends bv{constructor(){super(...arguments);this.text="";this.type="default";this.size="md";this.weight="normal";this.block=!1;this.copyable=!1;this.truncate=!1;this.nowrap=!1;this.selectable=!1;this.strikethrough=!1;this.underline=!1;this.italic=!1;this.monospace=!1;this.surface=!1;this.popoverOnHover=!1;this.tooltipProps={};this.tag="span";this._copied=!1;this._overflowing=!1;this._resizeObserver=null;this._observedTextEl=null;this._copy=()=>{navigator.clipboard.writeText(this.text).then(()=>{this._copied=!0,setTimeout(()=>{this._copied=!1},1500)})}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){this._teardownOverflowObserver(),this._resizeObserver=null,super.disconnectedCallback()}firstUpdated(){this._syncOverflowObserver(),this._syncOverflow()}updated(){let e=N(this,"text");oe(this._tooltipEl,{...e.tooltipProps??{},...this.tooltipProps??{}}),this._syncOverflowObserver(),this._syncOverflow()}_needsOverflowObserver(){return this.popoverOnHover&&(this.truncate||this.nowrap)}_ensureOverflowObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver(()=>this._syncOverflow()))}_teardownOverflowObserver(){this._resizeObserver?.disconnect(),this._observedTextEl=null}_syncOverflowObserver(){if(!this._needsOverflowObserver()||!this._textEl){this._teardownOverflowObserver();return}this._ensureOverflowObserver(),this._observedTextEl!==this._textEl&&(this._teardownOverflowObserver(),this._ensureOverflowObserver(),this._resizeObserver?.observe(this._textEl),this._observedTextEl=this._textEl)}_syncOverflow(){let e=this._textEl;if(!e)return;if(!(this.truncate||this.nowrap)){this._overflowing&&(this._overflowing=!1);return}let r=e.scrollWidth-e.clientWidth>1||e.scrollHeight-e.clientHeight>1;r!==this._overflowing&&(this._overflowing=r)}render(){if(!this.text)return yv;let e=["text",`type-${this.type}`,`size-${this.size}`,`weight-${this.weight}`];this.truncate&&e.push("truncated"),this.maxLines&&e.push("clamped"),this.nowrap&&e.push("nowrap"),this.selectable?e.push("selectable"):e.push("unselectable"),this.strikethrough&&e.push("strikethrough"),this.underline&&e.push("underline"),this.italic&&e.push("italic"),this.monospace&&e.push("monospace");let t=this.maxLines?`-webkit-line-clamp:${this.maxLines}`:"",r=tl`<span
|
|
5495
5489
|
class=${e.join(" ")}
|
|
5496
5490
|
style=${t}
|
|
5497
5491
|
>${this.text}</span>`,n=r;if(this.copyable||this.surface){let d=this._copied?"check":"copy";n=tl`
|
|
@@ -5613,7 +5607,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5613
5607
|
--lui-icon-size: 14px;
|
|
5614
5608
|
}
|
|
5615
5609
|
|
|
5616
|
-
`],a([Vt()],Ve.prototype,"text",2),a([Vt({reflect:!0})],Ve.prototype,"type",2),a([Vt({reflect:!0})],Ve.prototype,"size",2),a([Vt()],Ve.prototype,"weight",2),a([Vt({type:Boolean,reflect:!0})],Ve.prototype,"block",2),a([Vt({type:Boolean})],Ve.prototype,"copyable",2),a([Vt({type:Number,attribute:"max-lines"})],Ve.prototype,"maxLines",2),a([Vt({type:Boolean})],Ve.prototype,"truncate",2),a([Vt({type:Boolean})],Ve.prototype,"nowrap",2),a([Vt({type:Boolean})],Ve.prototype,"selectable",2),a([Vt({type:Boolean})],Ve.prototype,"strikethrough",2),a([Vt({type:Boolean})],Ve.prototype,"underline",2),a([Vt({type:Boolean})],Ve.prototype,"italic",2),a([Vt({type:Boolean})],Ve.prototype,"monospace",2),a([Vt({type:Boolean,reflect:!0})],Ve.prototype,"surface",2),a([Vt({type:Boolean,attribute:"popover-on-hover"})],Ve.prototype,"popoverOnHover",2),a([Vt({attribute:!1})],Ve.prototype,"tooltipProps",2),a([Vt()],Ve.prototype,"tag",2),a([Kp()],Ve.prototype,"_copied",2),a([Kp()],Ve.prototype,"_overflowing",2),a([qp(".text")],Ve.prototype,"_textEl",2),a([qp("lui-tooltip")],Ve.prototype,"_tooltipEl",2),Ve=a([xv("lui-text")],Ve);var Up=da(_n(),1);import{css as zv,html as ft,LitElement as Ev,nothing as Oo}from"lit";import{customElement as Sv,property as Re,query as $v,state as _i}from"lit/decorators.js";import{repeat as Tv}from"lit/directives/repeat.js";import{css as wv,html as Wc,LitElement as _v,nothing as En}from"lit";import{customElement as Mv,property as Dt,query as Uc,queryAll as Cv,state as Gc}from"lit/decorators.js";var Ae=class extends _v{constructor(){super(...arguments);this._overlayStackRegistered=!1;this.x=0;this.y=0;this.open=!1;this.items=[];this.heading="";this.headingIcon="";this.trigger="manual";this.placement="bottom-start";this.closeOnSelect=!0;this.closeOnOutsidePress=!0;this.closeOnEscape=!0;this.backdrop="none";this.backdropStyle="";this.submenuTrigger="hover";this.triggerProps={};this.overlayProps={};this.menuProps={};this._context=null;this._activePath=[];this._openPath=[];this._layoutFrame=0;this._anchorMode="point";this._anchorRect=null;this._source="context-menu";this._explicitAttrs=new Set;this._onTriggerClick=e=>{if(this._hasTrigger("click")){if(e.preventDefault(),e.stopPropagation(),this.open&&this._anchorMode==="element"){this.hide();return}this.showFromTrigger(e.currentTarget,{triggerEvent:e,source:"context-menu"})}};this._onTriggerContextMenu=e=>{this._hasTrigger("contextmenu")&&(e.preventDefault(),e.stopPropagation(),this.showAt(e.clientX,e.clientY,{triggerEvent:e,source:"context-menu"}))};this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this.open)return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onOutside=e=>{if(!this.open||this._isEventInsideMenu(e)||this._hasTrigger("click")&&this._isEventOnTrigger(e))return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onKey=e=>{if(this.open){if(e.key==="Escape"&&this.closeOnEscape){e.preventDefault(),this.hide(),this._getTriggerElement()?.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(e.preventDefault(),!this._activePath.length){this._focusFirstItem([]);return}this._moveInMenu(js(this._activePath),e.key==="ArrowDown"?1:-1);return}if(e.key==="Home"){e.preventDefault(),this._moveToBoundary(js(this._activePath),0,1);return}if(e.key==="End"){e.preventDefault();let t=js(this._activePath),r=this._menuItemsAt(t);this._moveToBoundary(t,r.length-1,-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._openActiveSubmenu();return}if(e.key==="ArrowLeft"){if(this._activePath.length>1){e.preventDefault();let t=this._activePath.slice(0,-1);this._activePath=t,this._openPath=t.slice(0,-1)}return}if(e.key==="Enter"||e.key===" "){let t=this._itemAt(this._activePath);t&&wa(t)?(e.preventDefault(),this._select(t)):t?.children?.length&&(e.preventDefault(),this._setActivePath(this._activePath,"click"),this._openActiveSubmenu())}}};this._onBlur=()=>this.hide();this._onResize=()=>this.hide();this._onScroll=()=>{if(this.open&&this._anchorMode==="element"){let e=this._getTriggerElement();e&&(this._anchorRect=e.getBoundingClientRect(),this._scheduleLayout())}}}_registerOverlayStack(){let e=vn(this);e&&(Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0)}_releaseOverlayStack(){this._overlayStackRegistered&&(go(this),this._overlayStackRegistered=!1)}_emitOpenChange(e){this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}get _normalizedItems(){return op(this.items)}show(e,t,r,n){if(typeof e=="object"){this.showAt(e.x,e.y,e);return}this.showAt(e,t??0,r,n)}showAt(e,t,r,n){Array.isArray(r)||r==null?(r!==void 0&&(this.items=r),n!==void 0&&(this._context=n),this._triggerEvent=void 0,this._source="context-menu"):(r.items!==void 0&&(this.items=r.items),r.context!==void 0&&(this._context=r.context),this._triggerEvent=r.triggerEvent,this._source=r.source??"context-menu"),this._anchorMode="point",this._anchorRect=null,this.x=e,this.y=t,this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout()}showFromTrigger(e,t,r){let n=e??this._getTriggerElement();n&&(Array.isArray(t)||t==null?(t!==void 0&&(this.items=t),r!==void 0&&(this._context=r),this._triggerEvent=void 0,this._source="context-menu"):(t.items!==void 0&&(this.items=t.items),t.context!==void 0&&(this._context=t.context),this._triggerEvent=t.triggerEvent,this._source=t.source??"context-menu"),this._anchorMode="element",this._anchorRect=n.getBoundingClientRect(),this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout())}hide(){this.open&&(this.open=!1,this._activePath=[],this._openPath=[],this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this._emitOpenChange(!1))}close(){this.hide()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),document.addEventListener("mousedown",this._onOutside,!0),document.addEventListener("keydown",this._onKey),window.addEventListener("blur",this._onBlur),window.addEventListener("resize",this._onResize),window.addEventListener("scroll",this._onScroll,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),document.removeEventListener("mousedown",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),window.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),window.removeEventListener("scroll",this._onScroll,!0)}updated(e){e.has("open")&&(this.open?(this._registerOverlayStack(),st(this)):this._releaseOverlayStack()),(e.has("open")||e.has("items")||e.has("_openPath")||e.has("_activePath")||e.has("x")||e.has("y")||e.has("placement"))&&this._scheduleLayout(),this._syncElementProps()}willUpdate(){let e=N(this,"contextMenu");!this._explicitAttrs.has("placement")&&typeof e.placement=="string"&&this.placement!==e.placement&&(this.placement=e.placement),!this._explicitAttrs.has("close-on-select")&&typeof e.closeOnSelect=="boolean"&&this.closeOnSelect!==e.closeOnSelect&&(this.closeOnSelect=e.closeOnSelect),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress),!this._explicitAttrs.has("close-on-escape")&&typeof e.closeOnEscape=="boolean"&&this.closeOnEscape!==e.closeOnEscape&&(this.closeOnEscape=e.closeOnEscape),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("submenu-trigger")&&typeof e.submenuTrigger=="string"&&this.submenuTrigger!==e.submenuTrigger&&(this.submenuTrigger=e.submenuTrigger)}_syncElementProps(){let e=N(this,"contextMenu");oe(this._triggerWrapper,{...e.triggerProps??{},...this.triggerProps??{}}),oe(this._overlayEl,{...e.overlayProps??{},...this.overlayProps??{}});for(let t of this._menuEls??[])oe(t,{...e.menuProps??{},...this.menuProps??{}})}_getTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_isEventInsideMenu(e){return e.composedPath().some(r=>r instanceof HTMLElement&&r.getAttribute("part")?.split(/\s+/).includes("menu"))}_isEventOnTrigger(e){let t=e.composedPath(),r=this.renderRoot.querySelector('[part="trigger"]'),n=this._triggerSlot?.assignedElements({flatten:!0})??[];return t.some(s=>s===r||s instanceof HTMLElement&&n.includes(s))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_scheduleLayout(){this.open&&(this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._adjust()}))}_itemAt(e){return mn(this._normalizedItems,e)}_menuItemsAt(e){return ip(this._normalizedItems,e)}_setActivePath(e,t="keyboard"){if(this._activePath=e.slice(),!this._itemAt(e)?.children?.length){this._openPath=e.slice(0,-1);return}if(t==="click"){this._openPath=e.slice();return}if(t==="hover"&&this.submenuTrigger==="hover"){this._openPath=e.slice();return}this._openPath=e.slice(0,-1)}_focusFirstItem(e){let t=this._menuItemsAt(e),r=Mc(t);r>=0&&this._setActivePath([...e,r],"keyboard")}_moveInMenu(e,t){let r=this._menuItemsAt(e);if(!r.length)return;let n=this._activePath.length===e.length+1&&e.every((d,h)=>this._activePath[h]===d)?this._activePath[this._activePath.length-1]:-1,s=lp(r,n,t);s>=0&&this._setActivePath([...e,s],"keyboard")}_moveToBoundary(e,t,r){let n=this._menuItemsAt(e);if(!n.length)return;let s=cp(n,t,r);s>=0&&this._setActivePath([...e,s],"keyboard")}_openActiveSubmenu(){let e=this._itemAt(this._activePath);if(!e?.children?.length)return;let t=Mc(e.children);this._openPath=this._activePath.slice(),t>=0&&(this._activePath=[...this._activePath,t])}_getOverlayRect(){return this._overlayEl?.getBoundingClientRect()??new DOMRect(0,0,window.innerWidth,window.innerHeight)}_getRootPosition(e,t){if(this._anchorMode==="element"&&this._anchorRect){let r=this._anchorRect;switch(this.placement){case"bottom":return{x:r.left-t.left+r.width/2-e.width/2,y:r.bottom-t.top+6,originX:"left",originY:"top"};case"bottom-end":return{x:r.right-t.left-e.width,y:r.bottom-t.top+6,originX:"right",originY:"top"};case"top-start":return{x:r.left-t.left,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top":return{x:r.left-t.left+r.width/2-e.width/2,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top-end":return{x:r.right-t.left-e.width,y:r.top-t.top-e.height-6,originX:"right",originY:"bottom"};case"right-start":return{x:r.right-t.left+6,y:r.top-t.top,originX:"left",originY:"top"};case"right":return{x:r.right-t.left+6,y:r.top-t.top+r.height/2-e.height/2,originX:"left",originY:"top"};case"right-end":return{x:r.right-t.left+6,y:r.bottom-t.top-e.height,originX:"left",originY:"bottom"};case"left-start":return{x:r.left-t.left-e.width-6,y:r.top-t.top,originX:"right",originY:"top"};case"left":return{x:r.left-t.left-e.width-6,y:r.top-t.top+r.height/2-e.height/2,originX:"right",originY:"top"};case"left-end":return{x:r.left-t.left-e.width-6,y:r.bottom-t.top-e.height,originX:"right",originY:"bottom"};case"bottom-start":default:return{x:r.left-t.left,y:r.bottom-t.top+6,originX:"left",originY:"top"}}}return{x:this.x-t.left,y:this.y-t.top,originX:"left",originY:"top"}}_adjust(){let e=this.renderRoot.querySelector(`[data-menu-path="${Ri([])}"]`);if(!e)return;let t=this._getOverlayRect(),r=t.width||window.innerWidth,n=t.height||window.innerHeight,s=e.getBoundingClientRect(),d=this._getRootPosition(s,t),h=d.x,p=d.y,f=d.originX,x=d.originY;h+s.width>r-4&&(h=Math.max(4,r-s.width-4),f="right"),p+s.height>n-4&&(p=Math.max(4,n-s.height-4),x="bottom"),p<4&&(p=4),h<4&&(h=4),e.style.left=`${h}px`,e.style.top=`${p}px`,e.style.setProperty("--lui-menu-origin-x",f),e.style.setProperty("--lui-menu-origin-y",x),_c(this._openPath).slice(1).forEach(k=>{let C=this.renderRoot.querySelector(`[data-menu-path="${Ri(k)}"]`),S=this.renderRoot.querySelector(`[data-item-path="${Ri(k)}"]`);if(!C||!S)return;let z=S.getBoundingClientRect(),T=C.getBoundingClientRect(),P=z.right-t.left-3,H=z.top-t.top-8,R="left",F="top";P+T.width>r-4&&(P=z.left-t.left-T.width+3,R="right"),H+T.height>n-4&&(H=Math.max(4,n-T.height-4),F="bottom"),H<4&&(H=4),C.style.left=`${P}px`,C.style.top=`${H}px`,C.style.setProperty("--lui-menu-origin-x",R),C.style.setProperty("--lui-menu-origin-y",F)})}_createActionDetail(e,t){let r=this._triggerEvent instanceof MouseEvent?this._triggerEvent:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:this._source,triggerEvent:this._triggerEvent,x:r?.clientX??this.x,y:r?.clientY??this.y,context:this._context}}async _select(e,t=this._activePath.slice()){if(!wa(e))return;let r=this._createActionDetail(e,t);this.dispatchEvent(new CustomEvent("select",{detail:r,bubbles:!0,composed:!0})),e.onSelect?.(r),e.action?.(this._context),this.closeOnSelect&&this.hide()}_renderMenu(e){let t=Ri(e),r=e.length?this._menuItemsAt(e):this._normalizedItems,n=e.length===0&&!!this.heading;return Wc`
|
|
5610
|
+
`],a([It()],Ve.prototype,"text",2),a([It({reflect:!0})],Ve.prototype,"type",2),a([It({reflect:!0})],Ve.prototype,"size",2),a([It()],Ve.prototype,"weight",2),a([It({type:Boolean,reflect:!0})],Ve.prototype,"block",2),a([It({type:Boolean})],Ve.prototype,"copyable",2),a([It({type:Number,attribute:"max-lines"})],Ve.prototype,"maxLines",2),a([It({type:Boolean})],Ve.prototype,"truncate",2),a([It({type:Boolean})],Ve.prototype,"nowrap",2),a([It({type:Boolean})],Ve.prototype,"selectable",2),a([It({type:Boolean})],Ve.prototype,"strikethrough",2),a([It({type:Boolean})],Ve.prototype,"underline",2),a([It({type:Boolean})],Ve.prototype,"italic",2),a([It({type:Boolean})],Ve.prototype,"monospace",2),a([It({type:Boolean,reflect:!0})],Ve.prototype,"surface",2),a([It({type:Boolean,attribute:"popover-on-hover"})],Ve.prototype,"popoverOnHover",2),a([It({attribute:!1})],Ve.prototype,"tooltipProps",2),a([It()],Ve.prototype,"tag",2),a([Kp()],Ve.prototype,"_copied",2),a([Kp()],Ve.prototype,"_overflowing",2),a([qp(".text")],Ve.prototype,"_textEl",2),a([qp("lui-tooltip")],Ve.prototype,"_tooltipEl",2),Ve=a([xv("lui-text")],Ve);var Up=da(_n(),1);import{css as zv,html as gt,LitElement as Ev,nothing as Oo}from"lit";import{customElement as Sv,property as He,query as $v,state as _i}from"lit/decorators.js";import{repeat as Tv}from"lit/directives/repeat.js";import{css as wv,html as Wc,LitElement as _v,nothing as En}from"lit";import{customElement as Mv,property as Vt,query as Uc,queryAll as Cv,state as Gc}from"lit/decorators.js";var Ae=class extends _v{constructor(){super(...arguments);this._overlayStackRegistered=!1;this.x=0;this.y=0;this.open=!1;this.items=[];this.heading="";this.headingIcon="";this.trigger="manual";this.placement="bottom-start";this.closeOnSelect=!0;this.closeOnOutsidePress=!0;this.closeOnEscape=!0;this.backdrop="none";this.backdropStyle="";this.submenuTrigger="hover";this.triggerProps={};this.overlayProps={};this.menuProps={};this._context=null;this._activePath=[];this._openPath=[];this._layoutFrame=0;this._anchorMode="point";this._anchorRect=null;this._source="context-menu";this._explicitAttrs=new Set;this._onTriggerClick=e=>{if(this._hasTrigger("click")){if(e.preventDefault(),e.stopPropagation(),this.open&&this._anchorMode==="element"){this.hide();return}this.showFromTrigger(e.currentTarget,{triggerEvent:e,source:"context-menu"})}};this._onTriggerContextMenu=e=>{this._hasTrigger("contextmenu")&&(e.preventDefault(),e.stopPropagation(),this.showAt(e.clientX,e.clientY,{triggerEvent:e,source:"context-menu"}))};this._onBackdropPointerDown=e=>{if(e.preventDefault(),e.stopPropagation(),!this.open)return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onOutside=e=>{if(!this.open||this._isEventInsideMenu(e)||this._hasTrigger("click")&&this._isEventOnTrigger(e))return;this._emitOutsidePress(e)&&this.closeOnOutsidePress&&this.hide()};this._onKey=e=>{if(this.open){if(e.key==="Escape"&&this.closeOnEscape){e.preventDefault(),this.hide(),this._getTriggerElement()?.focus();return}if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(e.preventDefault(),!this._activePath.length){this._focusFirstItem([]);return}this._moveInMenu(js(this._activePath),e.key==="ArrowDown"?1:-1);return}if(e.key==="Home"){e.preventDefault(),this._moveToBoundary(js(this._activePath),0,1);return}if(e.key==="End"){e.preventDefault();let t=js(this._activePath),r=this._menuItemsAt(t);this._moveToBoundary(t,r.length-1,-1);return}if(e.key==="ArrowRight"){e.preventDefault(),this._openActiveSubmenu();return}if(e.key==="ArrowLeft"){if(this._activePath.length>1){e.preventDefault();let t=this._activePath.slice(0,-1);this._activePath=t,this._openPath=t.slice(0,-1)}return}if(e.key==="Enter"||e.key===" "){let t=this._itemAt(this._activePath);t&&wa(t)?(e.preventDefault(),this._select(t)):t?.children?.length&&(e.preventDefault(),this._setActivePath(this._activePath,"click"),this._openActiveSubmenu())}}};this._onBlur=()=>this.hide();this._onResize=()=>this.hide();this._onScroll=()=>{if(this.open&&this._anchorMode==="element"){let e=this._getTriggerElement();e&&(this._anchorRect=e.getBoundingClientRect(),this._scheduleLayout())}}}_registerOverlayStack(){let e=vn(this);e&&(Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0)}_releaseOverlayStack(){this._overlayStackRegistered&&(go(this),this._overlayStackRegistered=!1)}_emitOpenChange(e){this.dispatchEvent(new CustomEvent("open-change",{detail:{open:e},bubbles:!0,composed:!0}))}get _normalizedItems(){return op(this.items)}show(e,t,r,n){if(typeof e=="object"){this.showAt(e.x,e.y,e);return}this.showAt(e,t??0,r,n)}showAt(e,t,r,n){Array.isArray(r)||r==null?(r!==void 0&&(this.items=r),n!==void 0&&(this._context=n),this._triggerEvent=void 0,this._source="context-menu"):(r.items!==void 0&&(this.items=r.items),r.context!==void 0&&(this._context=r.context),this._triggerEvent=r.triggerEvent,this._source=r.source??"context-menu"),this._anchorMode="point",this._anchorRect=null,this.x=e,this.y=t,this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout()}showFromTrigger(e,t,r){let n=e??this._getTriggerElement();n&&(Array.isArray(t)||t==null?(t!==void 0&&(this.items=t),r!==void 0&&(this._context=r),this._triggerEvent=void 0,this._source="context-menu"):(t.items!==void 0&&(this.items=t.items),t.context!==void 0&&(this._context=t.context),this._triggerEvent=t.triggerEvent,this._source=t.source??"context-menu"),this._anchorMode="element",this._anchorRect=n.getBoundingClientRect(),this._activePath=[],this._openPath=[],this.open=!0,this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this._emitOpenChange(!0),this._scheduleLayout())}hide(){this.open&&(this.open=!1,this._activePath=[],this._openPath=[],this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})),this._emitOpenChange(!1))}close(){this.hide()}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),document.addEventListener("mousedown",this._onOutside,!0),document.addEventListener("keydown",this._onKey),window.addEventListener("blur",this._onBlur),window.addEventListener("resize",this._onResize),window.addEventListener("scroll",this._onScroll,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),document.removeEventListener("mousedown",this._onOutside,!0),document.removeEventListener("keydown",this._onKey),window.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),window.removeEventListener("scroll",this._onScroll,!0)}updated(e){e.has("open")&&(this.open?(this._registerOverlayStack(),st(this)):this._releaseOverlayStack()),(e.has("open")||e.has("items")||e.has("_openPath")||e.has("_activePath")||e.has("x")||e.has("y")||e.has("placement"))&&this._scheduleLayout(),this._syncElementProps()}willUpdate(){let e=N(this,"contextMenu");!this._explicitAttrs.has("placement")&&typeof e.placement=="string"&&this.placement!==e.placement&&(this.placement=e.placement),!this._explicitAttrs.has("close-on-select")&&typeof e.closeOnSelect=="boolean"&&this.closeOnSelect!==e.closeOnSelect&&(this.closeOnSelect=e.closeOnSelect),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress),!this._explicitAttrs.has("close-on-escape")&&typeof e.closeOnEscape=="boolean"&&this.closeOnEscape!==e.closeOnEscape&&(this.closeOnEscape=e.closeOnEscape),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("submenu-trigger")&&typeof e.submenuTrigger=="string"&&this.submenuTrigger!==e.submenuTrigger&&(this.submenuTrigger=e.submenuTrigger)}_syncElementProps(){let e=N(this,"contextMenu");oe(this._triggerWrapper,{...e.triggerProps??{},...this.triggerProps??{}}),oe(this._overlayEl,{...e.overlayProps??{},...this.overlayProps??{}});for(let t of this._menuEls??[])oe(t,{...e.menuProps??{},...this.menuProps??{}})}_getTriggerElement(){return(this._triggerSlot?.assignedElements({flatten:!0})??[]).find(t=>t instanceof HTMLElement)??null}_hasTrigger(e){return this.trigger.split(/\s+/).map(t=>t.trim()).filter(Boolean).includes(e)}_isEventInsideMenu(e){return e.composedPath().some(r=>r instanceof HTMLElement&&r.getAttribute("part")?.split(/\s+/).includes("menu"))}_isEventOnTrigger(e){let t=e.composedPath(),r=this.renderRoot.querySelector('[part="trigger"]'),n=this._triggerSlot?.assignedElements({flatten:!0})??[];return t.some(s=>s===r||s instanceof HTMLElement&&n.includes(s))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_scheduleLayout(){this.open&&(this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._adjust()}))}_itemAt(e){return mn(this._normalizedItems,e)}_menuItemsAt(e){return ip(this._normalizedItems,e)}_setActivePath(e,t="keyboard"){if(this._activePath=e.slice(),!this._itemAt(e)?.children?.length){this._openPath=e.slice(0,-1);return}if(t==="click"){this._openPath=e.slice();return}if(t==="hover"&&this.submenuTrigger==="hover"){this._openPath=e.slice();return}this._openPath=e.slice(0,-1)}_focusFirstItem(e){let t=this._menuItemsAt(e),r=Mc(t);r>=0&&this._setActivePath([...e,r],"keyboard")}_moveInMenu(e,t){let r=this._menuItemsAt(e);if(!r.length)return;let n=this._activePath.length===e.length+1&&e.every((d,h)=>this._activePath[h]===d)?this._activePath[this._activePath.length-1]:-1,s=lp(r,n,t);s>=0&&this._setActivePath([...e,s],"keyboard")}_moveToBoundary(e,t,r){let n=this._menuItemsAt(e);if(!n.length)return;let s=cp(n,t,r);s>=0&&this._setActivePath([...e,s],"keyboard")}_openActiveSubmenu(){let e=this._itemAt(this._activePath);if(!e?.children?.length)return;let t=Mc(e.children);this._openPath=this._activePath.slice(),t>=0&&(this._activePath=[...this._activePath,t])}_getOverlayRect(){return this._overlayEl?.getBoundingClientRect()??new DOMRect(0,0,window.innerWidth,window.innerHeight)}_getRootPosition(e,t){if(this._anchorMode==="element"&&this._anchorRect){let r=this._anchorRect;switch(this.placement){case"bottom":return{x:r.left-t.left+r.width/2-e.width/2,y:r.bottom-t.top+6,originX:"left",originY:"top"};case"bottom-end":return{x:r.right-t.left-e.width,y:r.bottom-t.top+6,originX:"right",originY:"top"};case"top-start":return{x:r.left-t.left,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top":return{x:r.left-t.left+r.width/2-e.width/2,y:r.top-t.top-e.height-6,originX:"left",originY:"bottom"};case"top-end":return{x:r.right-t.left-e.width,y:r.top-t.top-e.height-6,originX:"right",originY:"bottom"};case"right-start":return{x:r.right-t.left+6,y:r.top-t.top,originX:"left",originY:"top"};case"right":return{x:r.right-t.left+6,y:r.top-t.top+r.height/2-e.height/2,originX:"left",originY:"top"};case"right-end":return{x:r.right-t.left+6,y:r.bottom-t.top-e.height,originX:"left",originY:"bottom"};case"left-start":return{x:r.left-t.left-e.width-6,y:r.top-t.top,originX:"right",originY:"top"};case"left":return{x:r.left-t.left-e.width-6,y:r.top-t.top+r.height/2-e.height/2,originX:"right",originY:"top"};case"left-end":return{x:r.left-t.left-e.width-6,y:r.bottom-t.top-e.height,originX:"right",originY:"bottom"};case"bottom-start":default:return{x:r.left-t.left,y:r.bottom-t.top+6,originX:"left",originY:"top"}}}return{x:this.x-t.left,y:this.y-t.top,originX:"left",originY:"top"}}_adjust(){let e=this.renderRoot.querySelector(`[data-menu-path="${Ri([])}"]`);if(!e)return;let t=this._getOverlayRect(),r=t.width||window.innerWidth,n=t.height||window.innerHeight,s=e.getBoundingClientRect(),d=this._getRootPosition(s,t),h=d.x,p=d.y,f=d.originX,x=d.originY;h+s.width>r-4&&(h=Math.max(4,r-s.width-4),f="right"),p+s.height>n-4&&(p=Math.max(4,n-s.height-4),x="bottom"),p<4&&(p=4),h<4&&(h=4),e.style.left=`${h}px`,e.style.top=`${p}px`,e.style.setProperty("--lui-menu-origin-x",f),e.style.setProperty("--lui-menu-origin-y",x),_c(this._openPath).slice(1).forEach(k=>{let C=this.renderRoot.querySelector(`[data-menu-path="${Ri(k)}"]`),S=this.renderRoot.querySelector(`[data-item-path="${Ri(k)}"]`);if(!C||!S)return;let z=S.getBoundingClientRect(),T=C.getBoundingClientRect(),P=z.right-t.left-3,H=z.top-t.top-8,R="left",F="top";P+T.width>r-4&&(P=z.left-t.left-T.width+3,R="right"),H+T.height>n-4&&(H=Math.max(4,n-T.height-4),F="bottom"),H<4&&(H=4),C.style.left=`${P}px`,C.style.top=`${H}px`,C.style.setProperty("--lui-menu-origin-x",R),C.style.setProperty("--lui-menu-origin-y",F)})}_createActionDetail(e,t){let r=this._triggerEvent instanceof MouseEvent?this._triggerEvent:null;return{key:e.key,value:e.value??e.key,item:e.raw??e,path:t,source:this._source,triggerEvent:this._triggerEvent,x:r?.clientX??this.x,y:r?.clientY??this.y,context:this._context}}async _select(e,t=this._activePath.slice()){if(!wa(e))return;let r=this._createActionDetail(e,t);this.dispatchEvent(new CustomEvent("select",{detail:r,bubbles:!0,composed:!0})),e.onSelect?.(r),e.action?.(this._context),this.closeOnSelect&&this.hide()}_renderMenu(e){let t=Ri(e),r=e.length?this._menuItemsAt(e):this._normalizedItems,n=e.length===0&&!!this.heading;return Wc`
|
|
5617
5611
|
<div
|
|
5618
5612
|
part="menu"
|
|
5619
5613
|
data-menu-path=${t}
|
|
@@ -5867,7 +5861,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5867
5861
|
[part="title"] + [part="divider"] {
|
|
5868
5862
|
margin-top: 2px;
|
|
5869
5863
|
}
|
|
5870
|
-
`],a([Dt({type:Number})],Ae.prototype,"x",2),a([Dt({type:Number})],Ae.prototype,"y",2),a([Dt({type:Boolean,reflect:!0})],Ae.prototype,"open",2),a([Dt({attribute:!1})],Ae.prototype,"items",2),a([Dt()],Ae.prototype,"heading",2),a([Dt({attribute:"heading-icon"})],Ae.prototype,"headingIcon",2),a([Dt({reflect:!0})],Ae.prototype,"trigger",2),a([Dt({reflect:!0})],Ae.prototype,"placement",2),a([Dt({type:Boolean,attribute:"close-on-select"})],Ae.prototype,"closeOnSelect",2),a([Dt({type:Boolean,attribute:"close-on-outside-press"})],Ae.prototype,"closeOnOutsidePress",2),a([Dt({type:Boolean,attribute:"close-on-escape"})],Ae.prototype,"closeOnEscape",2),a([Dt({reflect:!0})],Ae.prototype,"backdrop",2),a([Dt({attribute:"backdrop-style"})],Ae.prototype,"backdropStyle",2),a([Dt({reflect:!0,attribute:"submenu-trigger"})],Ae.prototype,"submenuTrigger",2),a([Dt({attribute:"submenu-icon"})],Ae.prototype,"submenuIcon",2),a([Dt({attribute:!1})],Ae.prototype,"triggerProps",2),a([Dt({attribute:!1})],Ae.prototype,"overlayProps",2),a([Dt({attribute:!1})],Ae.prototype,"menuProps",2),a([Gc()],Ae.prototype,"_context",2),a([Gc()],Ae.prototype,"_activePath",2),a([Gc()],Ae.prototype,"_openPath",2),a([Uc('slot[name="trigger"]')],Ae.prototype,"_triggerSlot",2),a([Uc('[part="trigger"]')],Ae.prototype,"_triggerWrapper",2),a([Uc('[part="overlay"]')],Ae.prototype,"_overlayEl",2),a([Cv('[part="menu"]')],Ae.prototype,"_menuEls",2),Ae=a([Mv("lui-context-menu")],Ae);var Gp=18,Yp=4,Av=20;function Nt(i){return String(i.key??i.id??i.path??i.label??i.name??i.title??"")}function Ho(i){return String(i.label??i.name??i.title??i.path??i.key??i.id??"")}function Wp(i){return String(i??"").trim().toLowerCase()}function Yc(i){return i*Gp+Yp+Av/2}function Pv(i){return i*Gp+Yp}var se=class extends Ev{constructor(){super(...arguments);this.nodes=[];this.expandedKeys=[];this.defaultExpandedKeys=[];this.selectedKey="";this.selectedKeys=[];this.checkedKeys=[];this.defaultCheckedKeys=[];this.loadingKeys=[];this.size="md";this.label="";this.emptyText="\u6682\u65E0\u6570\u636E";this.expandTrigger="icon";this.showGuides=!0;this.selectionMode="single";this.checkStrictly=!1;this.loadOnExpand=!0;this.filterable=!1;this.filterValue="";this.filterPlaceholder="\u641C\u7D22\u8282\u70B9...";this.draggableNodes=!1;this.dragLeafOnly=!1;this.dropSameLevelOnly=!1;this.dragHandle=!1;this.virtual=!1;this.virtualThreshold=100;this._innerExpanded=new Set;this._innerSelected=new Set;this._innerChecked=new Set;this._innerLoading=new Set;this._activeKey="";this._dragKey="";this._dropKey="";this._dropPosition="";this._treeInteractDisposers=[];this._treeInteractRaf=0;this._dragScrollFrame=0;this._dragScrollTarget=null;this._dragPointerX=0;this._dragPointerY=0;this._dragGhost=null;this._dragAutoExpandTimer=0;this._dragAutoExpandKey="";this._suppressClickUntil=0;this._suppressNextClick=!1;this._dropRejectSignature="";this._contextMenuEntry=null;this._onKeyDown=e=>{let t=this._flatNodes().find(r=>r.key===this._activeKey)??this._flatNodes()[0];t&&(e.key==="ArrowDown"?(e.preventDefault(),this._moveActive(1)):e.key==="ArrowUp"?(e.preventDefault(),this._moveActive(-1)):e.key==="ArrowRight"?(e.preventDefault(),this._isLeaf(t.node)||this._expandedSet.has(t.key)?this._moveActive(1):this._setExpanded(t.key,!0)):e.key==="ArrowLeft"?(e.preventDefault(),this._expandedSet.has(t.key)?this._setExpanded(t.key,!1):this._moveActive(-1)):(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.selectionMode==="checkbox"?this._setChecked(t.node,t.key,this._checkState(t.node,t.key)!=="checked"):this._select(t.node,t.key)))};this._onInternalContextMenuSelect=e=>{e.stopPropagation();let t=e.detail,r=t.context,n=r?.node&&r?.key?{node:r.node,key:r.key}:this._contextMenuEntry;n&&this.dispatchEvent(new CustomEvent("menu-select",{detail:{node:n.node,key:n.key,menuKey:t.key,value:t.value,item:t.item,path:t.path,source:t.source,triggerEvent:t.triggerEvent,x:t.x,y:t.y,context:t.context,menuDetail:t},bubbles:!0,composed:!0}))};this._onFilterInput=e=>{this.filterValue=e.target.value;let t=this._matchedKeys();this._activeKey=this._flatNodes()[0]?.key||"",this.dispatchEvent(new CustomEvent("search",{detail:{value:this.filterValue,matchedKeys:t},bubbles:!0,composed:!0}))}}firstUpdated(){this._innerExpanded=new Set(this.expandedKeys.length?this.expandedKeys:this.defaultExpandedKeys),this._innerSelected=new Set(this.selectedKeys.length?this.selectedKeys:this.selectedKey?[this.selectedKey]:[]),this._innerChecked=new Set(this.checkedKeys.length?this.checkedKeys:this.defaultCheckedKeys),this._innerLoading=new Set(this.loadingKeys),this._activeKey=this.selectedKey||this.selectedKeys[0]||this._flatNodes()[0]?.key||"",this._scheduleTreeInteractions()}updated(e){e.has("expandedKeys")&&(this._innerExpanded=new Set(this.expandedKeys)),e.has("selectedKeys")&&(this._innerSelected=new Set(this.selectedKeys)),e.has("selectedKey")&&this.selectedKey&&(this._innerSelected=new Set(this.selectionMode==="single"?[this.selectedKey]:[this.selectedKey,...this._innerSelected]),this._activeKey=this.selectedKey),e.has("checkedKeys")&&(this._innerChecked=new Set(this.checkedKeys)),e.has("loadingKeys")&&(this._innerLoading=new Set(this.loadingKeys)),(e.has("nodes")||e.has("expandedKeys")||e.has("defaultExpandedKeys")||e.has("selectedKey")||e.has("selectedKeys")||e.has("checkedKeys")||e.has("defaultCheckedKeys")||e.has("loadingKeys")||e.has("selectionMode")||e.has("filterValue")||e.has("filterable")||e.has("draggableNodes")||e.has("dragLeafOnly")||e.has("dropSameLevelOnly")||e.has("dragHandle")||e.has("dragFilter")||e.has("dropFilter")||e.has("virtual")||e.has("virtualThreshold")||e.has("loadOnExpand"))&&this._scheduleTreeInteractions()}disconnectedCallback(){this._teardownTreeInteractions(),this._treeInteractRaf&&cancelAnimationFrame(this._treeInteractRaf),this._dragScrollFrame&&cancelAnimationFrame(this._dragScrollFrame),this._dragAutoExpandTimer&&window.clearTimeout(this._dragAutoExpandTimer),this._treeInteractRaf=0,this._dragScrollFrame=0,this._dragAutoExpandTimer=0,this._clearAutoExpand(),this._removeDragGhost(),super.disconnectedCallback()}expand(e){this._setExpanded(e,!0)}collapse(e){this._setExpanded(e,!1)}toggle(e){this._setExpanded(e,!this._expandedSet.has(e))}select(e){let t=this._flatNodes(!0).find(r=>r.key===e);t&&this._select(t.node,t.key)}get _expandedSet(){return this._innerExpanded}get _selectedSet(){return this._innerSelected}get _checkedSet(){return this._innerChecked}_isLeaf(e){return e.isLeaf===!0?!0:e.hasChildren===!0?!1:!e.children?.length}_isLoading(e,t){return!!(t.loading||this._innerLoading.has(e))}_filterQuery(){return Wp(this.filterValue)}_nodeMatches(e,t=Nt(e)){let r=this._filterQuery();return r?[t,Ho(e),e.description,e.path,e.id].some(n=>Wp(n).includes(r)):!0}_hasMatchingDescendant(e){return!!e.children?.some(t=>this._nodeMatches(t)||this._hasMatchingDescendant(t))}_matchedKeys(){let e=[],t=r=>{r.forEach(n=>{let s=Nt(n);this._nodeMatches(n,s)&&e.push(s),n.children?.length&&t(n.children)})};return t(this.nodes),e}_flatNodes(e=!1){let t=[],r=this._filterQuery(),n=(s,d,h)=>{let p=r?s.filter(f=>this._nodeMatches(f)||this._hasMatchingDescendant(f)):s;p.forEach((f,x)=>{let k=Nt(f)||`${d}-${x}`,C=x===p.length-1;t.push({node:f,key:k,level:d,index:t.length,isLast:C,ancestorGuides:h}),(r||e||this._expandedSet.has(k))&&f.children?.length&&n(f.children,d+1,[...h,!C])})};return n(this.nodes,0,[]),t}_setExpanded(e,t){let n=this._flatNodes(!0).find(h=>h.key===e);if(!n||this._isLeaf(n.node)||n.node.disabled)return;let s=new Set(this._expandedSet);t?s.add(e):s.delete(e),this._innerExpanded=s;let d=[...s];this.expandedKeys=d,this.dispatchEvent(new CustomEvent("toggle",{detail:{node:n.node,key:e,expanded:t,expandedKeys:d},bubbles:!0,composed:!0})),t&&this._maybeLoadChildren(n.node,e),this._emitChange()}_select(e,t){if(e.disabled)return;let r;this.selectionMode==="multiple"?(r=new Set(this._selectedSet),r.has(t)?r.delete(t):r.add(t)):r=new Set([t]),this._innerSelected=r,this.selectedKeys=[...r],this.selectedKey=this.selectedKeys[this.selectedKeys.length-1]||"",this._activeKey=t,this.dispatchEvent(new CustomEvent("select",{detail:{node:e,key:t,selectedKey:this.selectedKey,selectedKeys:this.selectedKeys},bubbles:!0,composed:!0})),this._emitChange()}_setChecked(e,t,r){if(e.disabled)return;let n=new Set(this._checkedSet),s=this.checkStrictly?[t]:this._collectCheckableKeys(e,t);for(let h of s)r?n.add(h):n.delete(h);this._innerChecked=n,this.checkedKeys=[...n];let d=this._halfCheckedKeys(n);this.dispatchEvent(new CustomEvent("check",{detail:{node:e,key:t,checked:r,checkedKeys:this.checkedKeys,halfCheckedKeys:d},bubbles:!0,composed:!0})),this._emitChange()}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{selectedKey:this.selectedKey,selectedKeys:[...this._selectedSet],expandedKeys:[...this._expandedSet],checkedKeys:[...this._checkedSet],halfCheckedKeys:this._halfCheckedKeys(this._checkedSet)},bubbles:!0,composed:!0}))}_collectCheckableKeys(e,t){let r=[],n=(s,d)=>{s.disabled||(r.push(d),s.children?.forEach((h,p)=>n(h,Nt(h)||`${d}-${p}`)))};return n(e,t),r}_checkState(e,t){if(this._checkedSet.has(t))return"checked";if(this.checkStrictly||!e.children?.length)return"none";let r=this._collectCheckableKeys(e,t).filter(s=>s!==t);if(!r.length)return"none";let n=r.filter(s=>this._checkedSet.has(s)).length;return n===r.length?"checked":n>0?"half":"none"}_halfCheckedKeys(e){if(this.checkStrictly)return[];let t=[],r=(n,s)=>{if(n.children?.forEach((h,p)=>r(h,Nt(h)||`${s}-${p}`)),!n.children?.length||n.disabled||e.has(s))return;let d=this._collectCheckableKeys(n,s).filter(h=>h!==s);d.length&&d.some(h=>e.has(h))&&t.push(s)};return this.nodes.forEach((n,s)=>r(n,Nt(n)||`0-${s}`)),t}_setNodeChildren(e,t){let r=n=>n.map(s=>Nt(s)===e?{...s,children:t,hasChildren:t.length>0,loading:!1}:s.children?.length?{...s,children:r(s.children)}:s);this.nodes=r(this.nodes)}async _maybeLoadChildren(e,t){if(!this.loadOnExpand||e.children?.length||!e.hasChildren||this._innerLoading.has(t))return;this._innerLoading=new Set([...this._innerLoading,t]),this.loadingKeys=[...this._innerLoading];let r=()=>{let s=new Set(this._innerLoading);s.delete(t),this._innerLoading=s,this.loadingKeys=[...s]},n=s=>{this._setNodeChildren(t,s),r()};if(this.dispatchEvent(new CustomEvent("load",{detail:{node:e,key:t,setChildren:n,done:r},bubbles:!0,composed:!0})),!!this.childrenLoader)try{n(await this.childrenLoader(e,t))}catch{r()}}_moveActive(e){let t=this._flatNodes().filter(s=>!s.node.disabled);if(!t.length)return;let r=t.findIndex(s=>s.key===this._activeKey),n=t[(r+e+t.length)%t.length];this._activeKey=n.key,requestAnimationFrame(()=>this.renderRoot.querySelector(`[data-key="${CSS.escape(n.key)}"]`)?.scrollIntoView({block:"nearest"}))}_onRowClick(e){if(!e.node.disabled){if(this._suppressNextClick||performance.now()<this._suppressClickUntil){this._suppressNextClick=!1;return}if(this.expandTrigger==="row"&&!this._isLeaf(e.node)&&this._setExpanded(e.key,!this._expandedSet.has(e.key)),this.selectionMode==="checkbox"){this._setChecked(e.node,e.key,this._checkState(e.node,e.key)!=="checked"),this._activeKey=e.key;return}this._select(e.node,e.key)}}_onToggleClick(e,t){e.stopPropagation(),this._setExpanded(t.key,!this._expandedSet.has(t.key))}_resolveContextMenuItems(e,t){return this.contextMenuItems?typeof this.contextMenuItems=="function"?this.contextMenuItems(e,t):this.contextMenuItems:[]}_onContextMenu(e,t){e.preventDefault(),this._activeKey=t.key,this._contextMenuEntry={node:t.node,key:t.key};let r={node:t.node,key:t.key,x:e.clientX,y:e.clientY,originalEvent:e};this.dispatchEvent(new CustomEvent("node-contextmenu",{detail:r,bubbles:!0,composed:!0}));let n=this._resolveContextMenuItems(t.node,t.key);n.length&&this._contextMenuEl?.showAt(e.clientX,e.clientY,{items:n,context:{node:t.node,key:t.key},triggerEvent:e,source:"context-menu"})}_renderHighlighted(e){let t=this._filterQuery();if(!t)return e;let n=e.toLowerCase().indexOf(t);return n<0?e:ft`${e.slice(0,n)}<mark>${e.slice(n,n+t.length)}</mark>${e.slice(n+t.length)}`}_dropPositionFromEvent(e,t){let r=e.currentTarget.getBoundingClientRect(),n=r.height?(e.clientY-r.top)/r.height:.5;return n<.25?"before":n>.75||this._isLeaf(t.node)?"after":"inside"}_normalizeRuleResult(e,t=""){return typeof e=="boolean"?{allowed:e}:e?{allowed:e.allowed,reason:e.reason||t||void 0}:{allowed:!0}}_emitDragReject(e){this.dispatchEvent(new CustomEvent("drag-reject",{detail:e,bubbles:!0,composed:!0}))}_onDragStart(e,t){let r=this._canDragEntry(t);if(!r.allowed){this._emitDragReject({phase:"drag",dragNode:t.node,dragKey:t.key,reason:r.reason,originalEvent:e});return}this._dragKey=t.key,e.dataTransfer?.setData("text/plain",t.key),e.dataTransfer&&(e.dataTransfer.effectAllowed="move"),this.dispatchEvent(new CustomEvent("node-drag-start",{detail:{node:t.node,key:t.key,originalEvent:e},bubbles:!0,composed:!0}))}_onDragOver(e,t){if(!this._dragKey||this._dragKey===t.key)return;let r=this._dragEntryByKey(this._dragKey);if(!r)return;let n=this._dropPositionFromEvent(e,t);if(!this._canDropEntry(r,t,n).allowed){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this._dropKey=t.key,this._dropPosition=n}_onDragLeave(e,t){let r=e.relatedTarget;e.currentTarget.contains(r)||this._dropKey===t.key&&(this._dropKey="",this._dropPosition="")}_onDrop(e,t){if(!this._dragKey||this._dragKey===t.key)return;e.preventDefault();let r=this._flatNodes(!0).find(d=>d.key===this._dragKey),n=this._dropPosition||this._dropPositionFromEvent(e,t),s=r?this._canDropEntry(r,t,n):{allowed:!1};r&&s.allowed?this.dispatchEvent(new CustomEvent("node-drop",{detail:{dragNode:r.node,dragKey:r.key,dropNode:t.node,dropKey:t.key,position:n,originalEvent:e},bubbles:!0,composed:!0})):r&&this._emitDragReject({phase:"drop",dragNode:r.node,dragKey:r.key,dropNode:t.node,dropKey:t.key,position:n,reason:s.reason,originalEvent:e}),this._clearDropState()}_onDragEnd(e,t){this.dispatchEvent(new CustomEvent("node-drag-end",{detail:{node:t.node,key:t.key,originalEvent:e},bubbles:!0,composed:!0})),this._clearDropState()}_clearDropState(){this._dragKey="",this._dropKey="",this._dropPosition="",this._dropRejectSignature=""}_clearDragAutoScroll(){this._dragScrollFrame&&cancelAnimationFrame(this._dragScrollFrame),this._dragScrollFrame=0,this._dragScrollTarget=null,this._dragPointerX=0,this._dragPointerY=0}_createDragGhost(e,t,r){this._removeDragGhost();let n=getComputedStyle(this),s=document.createElement("div"),d=e.icon??(this._isLeaf(e)?"file":"folder");s.setAttribute("aria-hidden","true"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","gap:8px","min-width:180px","max-width:260px","height:30px","padding:0 12px 0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-color-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 16px 36px rgb(0 0 0 / 0.16)","font:600 13px/1.2 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.97","backdrop-filter:blur(8px)","will-change:transform","contain:layout style paint"].join(";");let h=document.createElement("span");h.style.cssText=["width:3px","height:16px","border-radius:999px","background:linear-gradient(180deg,var(--lui-color-primary),color-mix(in srgb,var(--lui-color-primary) 45%,transparent))","flex:0 0 3px"].join(";");let p=document.createElement("span");if(p.style.cssText=["display:inline-flex","align-items:center","justify-content:center","width:18px","height:18px","color:inherit","flex:0 0 18px"].join(";"),yc(d)){let x=document.createElement("img");x.src=d,x.alt="",x.loading="lazy",x.style.cssText="width:18px;height:18px;object-fit:contain;display:block;",p.appendChild(x)}else{let x=document.createElement("lui-icon");x.setAttribute("name",d),p.appendChild(x)}let f=document.createElement("span");f.textContent=Ho(e),f.style.cssText="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;",s.append(h,p,f),document.body.appendChild(s),this._dragGhost=s,this._moveDragGhost(t,r)}_moveDragGhost(e,t){this._dragGhost&&(this._dragGhost.style.transform=`translate3d(${Math.round(e+14)}px, ${Math.round(t+12)}px, 0) scale(.985)`)}_removeDragGhost(){this._dragGhost?.remove(),this._dragGhost=null}_clearAutoExpand(){this._dragAutoExpandTimer&&window.clearTimeout(this._dragAutoExpandTimer),this._dragAutoExpandTimer=0,this._dragAutoExpandKey=""}_dragEntryByKey(e){return this._flatNodes(!0).find(t=>t.key===e)??null}_canDragEntry(e){if(!this.draggableNodes)return{allowed:!1,reason:"\u672A\u542F\u7528\u62D6\u62FD"};if(e.node.disabled)return{allowed:!1,reason:"\u8282\u70B9\u5DF2\u7981\u7528"};if(e.node.draggable===!1)return{allowed:!1,reason:"\u8BE5\u8282\u70B9\u7981\u6B62\u62D6\u62FD"};if(this.dragLeafOnly&&!this._isLeaf(e.node))return{allowed:!1,reason:"\u4EC5\u5141\u8BB8\u53F6\u5B50\u8282\u70B9\u62D6\u62FD"};if(this.dragFilter){let t=this._normalizeRuleResult(this.dragFilter(e.node,e.key,e),"\u81EA\u5B9A\u4E49 dragFilter \u62D2\u7EDD");if(!t.allowed)return{allowed:!1,reason:t.reason||"\u81EA\u5B9A\u4E49 dragFilter \u62D2\u7EDD"}}return{allowed:!0}}_isDescendantOf(e,t){if(e.children?.length){for(let r of e.children)if(Nt(r)===t||this._isDescendantOf(r,t))return!0}return!1}_canDropEntry(e,t,r){if(!this.draggableNodes)return{allowed:!1,reason:"\u672A\u542F\u7528\u62D6\u62FD"};if(e.key===t.key)return{allowed:!1,reason:"\u4E0D\u80FD\u653E\u5230\u81EA\u5DF1\u8EAB\u4E0A"};if(t.node.disabled)return{allowed:!1,reason:"\u76EE\u6807\u8282\u70B9\u5DF2\u7981\u7528"};if(t.node.droppable===!1)return{allowed:!1,reason:"\u8BE5\u8282\u70B9\u7981\u6B62\u653E\u7F6E"};if(this.dropSameLevelOnly){if(e.level!==t.level)return{allowed:!1,reason:"\u4EC5\u5141\u8BB8\u540C\u5C42\u7EA7\u6392\u5E8F"};if(r==="inside")return{allowed:!1,reason:"\u540C\u5C42\u7EA7\u6A21\u5F0F\u4E0D\u5141\u8BB8\u653E\u5165\u5185\u90E8"}}if(this._isDescendantOf(e.node,t.key))return{allowed:!1,reason:"\u4E0D\u80FD\u653E\u5230\u81EA\u8EAB\u5B50\u5B59\u8282\u70B9"};let n={dragNode:e.node,dragKey:e.key,dragLevel:e.level,dropNode:t.node,dropKey:t.key,dropLevel:t.level,position:r};if(this.dropFilter){let s=this._normalizeRuleResult(this.dropFilter(n),"\u81EA\u5B9A\u4E49 dropFilter \u62D2\u7EDD");if(!s.allowed)return{allowed:!1,reason:s.reason||"\u81EA\u5B9A\u4E49 dropFilter \u62D2\u7EDD"}}return{allowed:!0}}_findDragScrollTarget(e){let t=e?.parentElement??null,r=this.renderRoot instanceof ShadowRoot?this.renderRoot.host:null;for(;t&&t!==r;){let n=getComputedStyle(t),s=/(auto|scroll|overlay)/.test(n.overflowY)&&t.scrollHeight>t.clientHeight,d=/(auto|scroll|overlay)/.test(n.overflowX)&&t.scrollWidth>t.clientWidth;if(s||d)return t;t=t.parentElement}return this._flatNodes().length?window:null}_scheduleDragAutoScroll(){this._dragScrollFrame||!this._dragScrollTarget||!this._dragKey||(this._dragScrollFrame=requestAnimationFrame(()=>{this._dragScrollFrame=0;let e=this._dragScrollTarget;if(!e)return;let t=40,r=18,n=e instanceof Window?{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth,height:window.innerHeight,width:window.innerWidth}:e.getBoundingClientRect(),s=0,d=0;this._dragPointerY<n.top+t?s=-Math.max(2,Math.round((n.top+t-this._dragPointerY)/t*r)):this._dragPointerY>n.bottom-t&&(s=Math.max(2,Math.round((this._dragPointerY-(n.bottom-t))/t*r))),this._dragPointerX<n.left+t?d=-Math.max(2,Math.round((n.left+t-this._dragPointerX)/t*r)):this._dragPointerX>n.right-t&&(d=Math.max(2,Math.round((this._dragPointerX-(n.right-t))/t*r))),(d||s)&&(e instanceof Window?e.scrollBy({left:d,top:s,behavior:"auto"}):(e.scrollLeft+=d,e.scrollTop+=s)),this._dragKey&&this._scheduleDragAutoScroll()}))}_teardownTreeInteractions(){for(let e of this._treeInteractDisposers)e();this._treeInteractDisposers=[]}_scheduleTreeInteractions(){this.isConnected&&(this._treeInteractRaf||(this._treeInteractRaf=requestAnimationFrame(()=>{this._treeInteractRaf=0,this._syncTreeInteractions()})))}_syncTreeInteractions(){if(this._teardownTreeInteractions(),!this.draggableNodes)return;let e=Array.from(this.renderRoot.querySelectorAll(".row"));for(let t of e){let r=(0,Up.default)(t).draggable({allowFrom:this.dragHandle?".drag-handle":void 0,ignoreFrom:"button, input, textarea, select, option, a, [data-no-drag]",listeners:{start:n=>{let s=t.dataset.key??"",d=s?this._flatNodes(!0).find(p=>p.key===s):null;if(!d)return;let h=this._canDragEntry(d);if(!h.allowed){this._emitDragReject({phase:"drag",dragNode:d.node,dragKey:d.key,reason:h.reason,originalEvent:n});return}this._dragKey=s,this._dropKey="",this._dropPosition="",this._dragScrollTarget=this._findDragScrollTarget(t),this._dragPointerX=n.clientX??0,this._dragPointerY=n.clientY??0,this.toggleAttribute("dragging-nodes",!0),this._createDragGhost(d.node,this._dragPointerX,this._dragPointerY),this.dispatchEvent(new CustomEvent("node-drag-start",{detail:{node:d.node,key:d.key,originalEvent:n},bubbles:!0,composed:!0}))},move:n=>{this._dragKey&&(this._dragPointerX=n.clientX??this._dragPointerX,this._dragPointerY=n.clientY??this._dragPointerY,this._syncDropTarget(this._dragPointerX,this._dragPointerY),this._scheduleDragAutoScroll())},end:n=>{let s=this._dragKey,d=s?this._flatNodes(!0).find(x=>x.key===s):null,h=this._dropKey?this._flatNodes(!0).find(x=>x.key===this._dropKey):null,p=this._dropPosition||"inside",f=d&&h?this._canDropEntry(d,h,p):{allowed:!1};d&&h&&f.allowed?this.dispatchEvent(new CustomEvent("node-drop",{detail:{dragNode:d.node,dragKey:d.key,dropNode:h.node,dropKey:h.key,position:p,originalEvent:n},bubbles:!0,composed:!0})):d&&h&&this._emitDragReject({phase:"drop",dragNode:d.node,dragKey:d.key,dropNode:h.node,dropKey:h.key,position:p,reason:f.reason,originalEvent:n}),d&&this.dispatchEvent(new CustomEvent("node-drag-end",{detail:{node:d.node,key:d.key,originalEvent:n},bubbles:!0,composed:!0})),this._suppressNextClick=!0,this._suppressClickUntil=performance.now()+180,requestAnimationFrame(()=>{this._suppressNextClick&&(this._suppressNextClick=!1)}),this._clearDropState(),this._clearDragAutoScroll(),this._clearAutoExpand(),this._removeDragGhost(),this.toggleAttribute("dragging-nodes",!1),this._scheduleTreeInteractions()}}});this._treeInteractDisposers.push(()=>r.unset())}}_syncDropTarget(e,t){let r=this._dragEntryByKey(this._dragKey);if(!r){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(S=>S.closest?.(".row")).find(S=>!!S),h=d?.dataset.key??"";if(!d||!h||h===this._dragKey){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let p=this._dragEntryByKey(h);if(!p){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let f=d.getBoundingClientRect(),x=f.height?(t-f.top)/f.height:.5,k=x<.25?"before":x>.75||this._isLeaf(p.node)?"after":"inside",C=this._canDropEntry(r,p,k);if(!C.allowed){let S=`${r.key}->${p.key}:${k}:${C.reason||""}`;this._dropRejectSignature!==S&&(this._dropRejectSignature=S,this._emitDragReject({phase:"drop",dragNode:r.node,dragKey:r.key,dropNode:p.node,dropKey:p.key,position:k,reason:C.reason})),this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}this._dropRejectSignature="",this._dropKey=h,this._dropPosition=k,this._dropPosition==="inside"&&!this._isLeaf(p.node)&&!this._expandedSet.has(h)?this._dragAutoExpandKey!==h&&(this._clearAutoExpand(),this._dragAutoExpandKey=h,this._dragAutoExpandTimer=window.setTimeout(()=>{this._dragKey&&this._dropKey===h&&this._dropPosition==="inside"&&!this._expandedSet.has(h)&&this._setExpanded(h,!0),this._clearAutoExpand()},420)):this._clearAutoExpand()}_renderIcon(e,t,r){let n=e.icon??(r?"file":t?e.openIcon||"folder-open":"folder");return yc(n)?ft`<img src=${n} alt="" loading="lazy" />`:ft`<lui-icon name=${n}></lui-icon>`}_renderRow(e){let{node:t,key:r,level:n,ancestorGuides:s}=e,d=this._expandedSet.has(r),h=this._isLeaf(t),p=this._isLoading(r,t),f=this._selectedSet.has(r),x=this._checkState(t,r),k=this._activeKey===r,C=this._canDragEntry(e),S=n>0?Yc(n):null,z=n>0?Yc(n-1):null,T=this._dragKey===r,P=this._dropKey===r&&this._dropPosition?`drop-${this._dropPosition}`:"",H=["row",f?"selected":"",k?"active":"",C.allowed?"draggable":"",T?"dragging":"",P,t.disabled?"disabled":""].filter(Boolean).join(" ");return ft`
|
|
5864
|
+
`],a([Vt({type:Number})],Ae.prototype,"x",2),a([Vt({type:Number})],Ae.prototype,"y",2),a([Vt({type:Boolean,reflect:!0})],Ae.prototype,"open",2),a([Vt({attribute:!1})],Ae.prototype,"items",2),a([Vt()],Ae.prototype,"heading",2),a([Vt({attribute:"heading-icon"})],Ae.prototype,"headingIcon",2),a([Vt({reflect:!0})],Ae.prototype,"trigger",2),a([Vt({reflect:!0})],Ae.prototype,"placement",2),a([Vt({type:Boolean,attribute:"close-on-select"})],Ae.prototype,"closeOnSelect",2),a([Vt({type:Boolean,attribute:"close-on-outside-press"})],Ae.prototype,"closeOnOutsidePress",2),a([Vt({type:Boolean,attribute:"close-on-escape"})],Ae.prototype,"closeOnEscape",2),a([Vt({reflect:!0})],Ae.prototype,"backdrop",2),a([Vt({attribute:"backdrop-style"})],Ae.prototype,"backdropStyle",2),a([Vt({reflect:!0,attribute:"submenu-trigger"})],Ae.prototype,"submenuTrigger",2),a([Vt({attribute:"submenu-icon"})],Ae.prototype,"submenuIcon",2),a([Vt({attribute:!1})],Ae.prototype,"triggerProps",2),a([Vt({attribute:!1})],Ae.prototype,"overlayProps",2),a([Vt({attribute:!1})],Ae.prototype,"menuProps",2),a([Gc()],Ae.prototype,"_context",2),a([Gc()],Ae.prototype,"_activePath",2),a([Gc()],Ae.prototype,"_openPath",2),a([Uc('slot[name="trigger"]')],Ae.prototype,"_triggerSlot",2),a([Uc('[part="trigger"]')],Ae.prototype,"_triggerWrapper",2),a([Uc('[part="overlay"]')],Ae.prototype,"_overlayEl",2),a([Cv('[part="menu"]')],Ae.prototype,"_menuEls",2),Ae=a([Mv("lui-context-menu")],Ae);var Gp=18,Yp=4,Av=20;function Dt(i){return String(i.key??i.id??i.path??i.label??i.name??i.title??"")}function Ho(i){return String(i.label??i.name??i.title??i.path??i.key??i.id??"")}function Wp(i){return String(i??"").trim().toLowerCase()}function Yc(i){return i*Gp+Yp+Av/2}function Pv(i){return i*Gp+Yp}var se=class extends Ev{constructor(){super(...arguments);this.nodes=[];this.expandedKeys=[];this.defaultExpandedKeys=[];this.selectedKey="";this.selectedKeys=[];this.checkedKeys=[];this.defaultCheckedKeys=[];this.loadingKeys=[];this.size="md";this.label="";this.emptyText="\u6682\u65E0\u6570\u636E";this.expandTrigger="icon";this.showGuides=!0;this.selectionMode="single";this.checkStrictly=!1;this.loadOnExpand=!0;this.filterable=!1;this.filterValue="";this.filterPlaceholder="\u641C\u7D22\u8282\u70B9...";this.draggableNodes=!1;this.dragLeafOnly=!1;this.dropSameLevelOnly=!1;this.dragHandle=!1;this.virtual=!1;this.virtualThreshold=100;this._innerExpanded=new Set;this._innerSelected=new Set;this._innerChecked=new Set;this._innerLoading=new Set;this._activeKey="";this._dragKey="";this._dropKey="";this._dropPosition="";this._treeInteractDisposers=[];this._treeInteractRaf=0;this._dragScrollFrame=0;this._dragScrollTarget=null;this._dragPointerX=0;this._dragPointerY=0;this._dragGhost=null;this._dragAutoExpandTimer=0;this._dragAutoExpandKey="";this._suppressClickUntil=0;this._suppressNextClick=!1;this._dropRejectSignature="";this._contextMenuEntry=null;this._onKeyDown=e=>{let t=this._flatNodes().find(r=>r.key===this._activeKey)??this._flatNodes()[0];t&&(e.key==="ArrowDown"?(e.preventDefault(),this._moveActive(1)):e.key==="ArrowUp"?(e.preventDefault(),this._moveActive(-1)):e.key==="ArrowRight"?(e.preventDefault(),this._isLeaf(t.node)||this._expandedSet.has(t.key)?this._moveActive(1):this._setExpanded(t.key,!0)):e.key==="ArrowLeft"?(e.preventDefault(),this._expandedSet.has(t.key)?this._setExpanded(t.key,!1):this._moveActive(-1)):(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.selectionMode==="checkbox"?this._setChecked(t.node,t.key,this._checkState(t.node,t.key)!=="checked"):this._select(t.node,t.key)))};this._onInternalContextMenuSelect=e=>{e.stopPropagation();let t=e.detail,r=t.context,n=r?.node&&r?.key?{node:r.node,key:r.key}:this._contextMenuEntry;n&&this.dispatchEvent(new CustomEvent("menu-select",{detail:{node:n.node,key:n.key,menuKey:t.key,value:t.value,item:t.item,path:t.path,source:t.source,triggerEvent:t.triggerEvent,x:t.x,y:t.y,context:t.context,menuDetail:t},bubbles:!0,composed:!0}))};this._onFilterInput=e=>{this.filterValue=e.target.value;let t=this._matchedKeys();this._activeKey=this._flatNodes()[0]?.key||"",this.dispatchEvent(new CustomEvent("search",{detail:{value:this.filterValue,matchedKeys:t},bubbles:!0,composed:!0}))}}firstUpdated(){this._innerExpanded=new Set(this.expandedKeys.length?this.expandedKeys:this.defaultExpandedKeys),this._innerSelected=new Set(this.selectedKeys.length?this.selectedKeys:this.selectedKey?[this.selectedKey]:[]),this._innerChecked=new Set(this.checkedKeys.length?this.checkedKeys:this.defaultCheckedKeys),this._innerLoading=new Set(this.loadingKeys),this._activeKey=this.selectedKey||this.selectedKeys[0]||this._flatNodes()[0]?.key||"",this._scheduleTreeInteractions()}updated(e){e.has("expandedKeys")&&(this._innerExpanded=new Set(this.expandedKeys)),e.has("selectedKeys")&&(this._innerSelected=new Set(this.selectedKeys)),e.has("selectedKey")&&this.selectedKey&&(this._innerSelected=new Set(this.selectionMode==="single"?[this.selectedKey]:[this.selectedKey,...this._innerSelected]),this._activeKey=this.selectedKey),e.has("checkedKeys")&&(this._innerChecked=new Set(this.checkedKeys)),e.has("loadingKeys")&&(this._innerLoading=new Set(this.loadingKeys)),(e.has("nodes")||e.has("expandedKeys")||e.has("defaultExpandedKeys")||e.has("selectedKey")||e.has("selectedKeys")||e.has("checkedKeys")||e.has("defaultCheckedKeys")||e.has("loadingKeys")||e.has("selectionMode")||e.has("filterValue")||e.has("filterable")||e.has("draggableNodes")||e.has("dragLeafOnly")||e.has("dropSameLevelOnly")||e.has("dragHandle")||e.has("dragFilter")||e.has("dropFilter")||e.has("virtual")||e.has("virtualThreshold")||e.has("loadOnExpand"))&&this._scheduleTreeInteractions()}disconnectedCallback(){this._teardownTreeInteractions(),this._treeInteractRaf&&cancelAnimationFrame(this._treeInteractRaf),this._dragScrollFrame&&cancelAnimationFrame(this._dragScrollFrame),this._dragAutoExpandTimer&&window.clearTimeout(this._dragAutoExpandTimer),this._treeInteractRaf=0,this._dragScrollFrame=0,this._dragAutoExpandTimer=0,this._clearAutoExpand(),this._removeDragGhost(),super.disconnectedCallback()}expand(e){this._setExpanded(e,!0)}collapse(e){this._setExpanded(e,!1)}toggle(e){this._setExpanded(e,!this._expandedSet.has(e))}select(e){let t=this._flatNodes(!0).find(r=>r.key===e);t&&this._select(t.node,t.key)}get _expandedSet(){return this._innerExpanded}get _selectedSet(){return this._innerSelected}get _checkedSet(){return this._innerChecked}_isLeaf(e){return e.isLeaf===!0?!0:e.hasChildren===!0?!1:!e.children?.length}_isLoading(e,t){return!!(t.loading||this._innerLoading.has(e))}_filterQuery(){return Wp(this.filterValue)}_nodeMatches(e,t=Dt(e)){let r=this._filterQuery();return r?[t,Ho(e),e.description,e.path,e.id].some(n=>Wp(n).includes(r)):!0}_hasMatchingDescendant(e){return!!e.children?.some(t=>this._nodeMatches(t)||this._hasMatchingDescendant(t))}_matchedKeys(){let e=[],t=r=>{r.forEach(n=>{let s=Dt(n);this._nodeMatches(n,s)&&e.push(s),n.children?.length&&t(n.children)})};return t(this.nodes),e}_flatNodes(e=!1){let t=[],r=this._filterQuery(),n=(s,d,h)=>{let p=r?s.filter(f=>this._nodeMatches(f)||this._hasMatchingDescendant(f)):s;p.forEach((f,x)=>{let k=Dt(f)||`${d}-${x}`,C=x===p.length-1;t.push({node:f,key:k,level:d,index:t.length,isLast:C,ancestorGuides:h}),(r||e||this._expandedSet.has(k))&&f.children?.length&&n(f.children,d+1,[...h,!C])})};return n(this.nodes,0,[]),t}_setExpanded(e,t){let n=this._flatNodes(!0).find(h=>h.key===e);if(!n||this._isLeaf(n.node)||n.node.disabled)return;let s=new Set(this._expandedSet);t?s.add(e):s.delete(e),this._innerExpanded=s;let d=[...s];this.expandedKeys=d,this.dispatchEvent(new CustomEvent("toggle",{detail:{node:n.node,key:e,expanded:t,expandedKeys:d},bubbles:!0,composed:!0})),t&&this._maybeLoadChildren(n.node,e),this._emitChange()}_select(e,t){if(e.disabled)return;let r;this.selectionMode==="multiple"?(r=new Set(this._selectedSet),r.has(t)?r.delete(t):r.add(t)):r=new Set([t]),this._innerSelected=r,this.selectedKeys=[...r],this.selectedKey=this.selectedKeys[this.selectedKeys.length-1]||"",this._activeKey=t,this.dispatchEvent(new CustomEvent("select",{detail:{node:e,key:t,selectedKey:this.selectedKey,selectedKeys:this.selectedKeys},bubbles:!0,composed:!0})),this._emitChange()}_setChecked(e,t,r){if(e.disabled)return;let n=new Set(this._checkedSet),s=this.checkStrictly?[t]:this._collectCheckableKeys(e,t);for(let h of s)r?n.add(h):n.delete(h);this._innerChecked=n,this.checkedKeys=[...n];let d=this._halfCheckedKeys(n);this.dispatchEvent(new CustomEvent("check",{detail:{node:e,key:t,checked:r,checkedKeys:this.checkedKeys,halfCheckedKeys:d},bubbles:!0,composed:!0})),this._emitChange()}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:{selectedKey:this.selectedKey,selectedKeys:[...this._selectedSet],expandedKeys:[...this._expandedSet],checkedKeys:[...this._checkedSet],halfCheckedKeys:this._halfCheckedKeys(this._checkedSet)},bubbles:!0,composed:!0}))}_collectCheckableKeys(e,t){let r=[],n=(s,d)=>{s.disabled||(r.push(d),s.children?.forEach((h,p)=>n(h,Dt(h)||`${d}-${p}`)))};return n(e,t),r}_checkState(e,t){if(this._checkedSet.has(t))return"checked";if(this.checkStrictly||!e.children?.length)return"none";let r=this._collectCheckableKeys(e,t).filter(s=>s!==t);if(!r.length)return"none";let n=r.filter(s=>this._checkedSet.has(s)).length;return n===r.length?"checked":n>0?"half":"none"}_halfCheckedKeys(e){if(this.checkStrictly)return[];let t=[],r=(n,s)=>{if(n.children?.forEach((h,p)=>r(h,Dt(h)||`${s}-${p}`)),!n.children?.length||n.disabled||e.has(s))return;let d=this._collectCheckableKeys(n,s).filter(h=>h!==s);d.length&&d.some(h=>e.has(h))&&t.push(s)};return this.nodes.forEach((n,s)=>r(n,Dt(n)||`0-${s}`)),t}_setNodeChildren(e,t){let r=n=>n.map(s=>Dt(s)===e?{...s,children:t,hasChildren:t.length>0,loading:!1}:s.children?.length?{...s,children:r(s.children)}:s);this.nodes=r(this.nodes)}async _maybeLoadChildren(e,t){if(!this.loadOnExpand||e.children?.length||!e.hasChildren||this._innerLoading.has(t))return;this._innerLoading=new Set([...this._innerLoading,t]),this.loadingKeys=[...this._innerLoading];let r=()=>{let s=new Set(this._innerLoading);s.delete(t),this._innerLoading=s,this.loadingKeys=[...s]},n=s=>{this._setNodeChildren(t,s),r()};if(this.dispatchEvent(new CustomEvent("load",{detail:{node:e,key:t,setChildren:n,done:r},bubbles:!0,composed:!0})),!!this.childrenLoader)try{n(await this.childrenLoader(e,t))}catch{r()}}_moveActive(e){let t=this._flatNodes().filter(s=>!s.node.disabled);if(!t.length)return;let r=t.findIndex(s=>s.key===this._activeKey),n=t[(r+e+t.length)%t.length];this._activeKey=n.key,requestAnimationFrame(()=>this.renderRoot.querySelector(`[data-key="${CSS.escape(n.key)}"]`)?.scrollIntoView({block:"nearest"}))}_onRowClick(e){if(!e.node.disabled){if(this._suppressNextClick||performance.now()<this._suppressClickUntil){this._suppressNextClick=!1;return}if(this.expandTrigger==="row"&&!this._isLeaf(e.node)&&this._setExpanded(e.key,!this._expandedSet.has(e.key)),this.selectionMode==="checkbox"){this._setChecked(e.node,e.key,this._checkState(e.node,e.key)!=="checked"),this._activeKey=e.key;return}this._select(e.node,e.key)}}_onToggleClick(e,t){e.stopPropagation(),this._setExpanded(t.key,!this._expandedSet.has(t.key))}_resolveContextMenuItems(e,t){return this.contextMenuItems?typeof this.contextMenuItems=="function"?this.contextMenuItems(e,t):this.contextMenuItems:[]}_onContextMenu(e,t){e.preventDefault(),this._activeKey=t.key,this._contextMenuEntry={node:t.node,key:t.key};let r={node:t.node,key:t.key,x:e.clientX,y:e.clientY,originalEvent:e};this.dispatchEvent(new CustomEvent("node-contextmenu",{detail:r,bubbles:!0,composed:!0}));let n=this._resolveContextMenuItems(t.node,t.key);n.length&&this._contextMenuEl?.showAt(e.clientX,e.clientY,{items:n,context:{node:t.node,key:t.key},triggerEvent:e,source:"context-menu"})}_renderHighlighted(e){let t=this._filterQuery();if(!t)return e;let n=e.toLowerCase().indexOf(t);return n<0?e:gt`${e.slice(0,n)}<mark>${e.slice(n,n+t.length)}</mark>${e.slice(n+t.length)}`}_dropPositionFromEvent(e,t){let r=e.currentTarget.getBoundingClientRect(),n=r.height?(e.clientY-r.top)/r.height:.5;return n<.25?"before":n>.75||this._isLeaf(t.node)?"after":"inside"}_normalizeRuleResult(e,t=""){return typeof e=="boolean"?{allowed:e}:e?{allowed:e.allowed,reason:e.reason||t||void 0}:{allowed:!0}}_emitDragReject(e){this.dispatchEvent(new CustomEvent("drag-reject",{detail:e,bubbles:!0,composed:!0}))}_onDragStart(e,t){let r=this._canDragEntry(t);if(!r.allowed){this._emitDragReject({phase:"drag",dragNode:t.node,dragKey:t.key,reason:r.reason,originalEvent:e});return}this._dragKey=t.key,e.dataTransfer?.setData("text/plain",t.key),e.dataTransfer&&(e.dataTransfer.effectAllowed="move"),this.dispatchEvent(new CustomEvent("node-drag-start",{detail:{node:t.node,key:t.key,originalEvent:e},bubbles:!0,composed:!0}))}_onDragOver(e,t){if(!this._dragKey||this._dragKey===t.key)return;let r=this._dragEntryByKey(this._dragKey);if(!r)return;let n=this._dropPositionFromEvent(e,t);if(!this._canDropEntry(r,t,n).allowed){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move"),this._dropKey=t.key,this._dropPosition=n}_onDragLeave(e,t){let r=e.relatedTarget;e.currentTarget.contains(r)||this._dropKey===t.key&&(this._dropKey="",this._dropPosition="")}_onDrop(e,t){if(!this._dragKey||this._dragKey===t.key)return;e.preventDefault();let r=this._flatNodes(!0).find(d=>d.key===this._dragKey),n=this._dropPosition||this._dropPositionFromEvent(e,t),s=r?this._canDropEntry(r,t,n):{allowed:!1};r&&s.allowed?this.dispatchEvent(new CustomEvent("node-drop",{detail:{dragNode:r.node,dragKey:r.key,dropNode:t.node,dropKey:t.key,position:n,originalEvent:e},bubbles:!0,composed:!0})):r&&this._emitDragReject({phase:"drop",dragNode:r.node,dragKey:r.key,dropNode:t.node,dropKey:t.key,position:n,reason:s.reason,originalEvent:e}),this._clearDropState()}_onDragEnd(e,t){this.dispatchEvent(new CustomEvent("node-drag-end",{detail:{node:t.node,key:t.key,originalEvent:e},bubbles:!0,composed:!0})),this._clearDropState()}_clearDropState(){this._dragKey="",this._dropKey="",this._dropPosition="",this._dropRejectSignature=""}_clearDragAutoScroll(){this._dragScrollFrame&&cancelAnimationFrame(this._dragScrollFrame),this._dragScrollFrame=0,this._dragScrollTarget=null,this._dragPointerX=0,this._dragPointerY=0}_createDragGhost(e,t,r){this._removeDragGhost();let n=getComputedStyle(this),s=document.createElement("div"),d=e.icon??(this._isLeaf(e)?"file":"folder");s.setAttribute("aria-hidden","true"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","gap:8px","min-width:180px","max-width:260px","height:30px","padding:0 12px 0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-color-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 16px 36px rgb(0 0 0 / 0.16)","font:600 13px/1.2 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.97","backdrop-filter:blur(8px)","will-change:transform","contain:layout style paint"].join(";");let h=document.createElement("span");h.style.cssText=["width:3px","height:16px","border-radius:999px","background:linear-gradient(180deg,var(--lui-color-primary),color-mix(in srgb,var(--lui-color-primary) 45%,transparent))","flex:0 0 3px"].join(";");let p=document.createElement("span");if(p.style.cssText=["display:inline-flex","align-items:center","justify-content:center","width:18px","height:18px","color:inherit","flex:0 0 18px"].join(";"),yc(d)){let x=document.createElement("img");x.src=d,x.alt="",x.loading="lazy",x.style.cssText="width:18px;height:18px;object-fit:contain;display:block;",p.appendChild(x)}else{let x=document.createElement("lui-icon");x.setAttribute("name",d),p.appendChild(x)}let f=document.createElement("span");f.textContent=Ho(e),f.style.cssText="min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;",s.append(h,p,f),document.body.appendChild(s),this._dragGhost=s,this._moveDragGhost(t,r)}_moveDragGhost(e,t){this._dragGhost&&(this._dragGhost.style.transform=`translate3d(${Math.round(e+14)}px, ${Math.round(t+12)}px, 0) scale(.985)`)}_removeDragGhost(){this._dragGhost?.remove(),this._dragGhost=null}_clearAutoExpand(){this._dragAutoExpandTimer&&window.clearTimeout(this._dragAutoExpandTimer),this._dragAutoExpandTimer=0,this._dragAutoExpandKey=""}_dragEntryByKey(e){return this._flatNodes(!0).find(t=>t.key===e)??null}_canDragEntry(e){if(!this.draggableNodes)return{allowed:!1,reason:"\u672A\u542F\u7528\u62D6\u62FD"};if(e.node.disabled)return{allowed:!1,reason:"\u8282\u70B9\u5DF2\u7981\u7528"};if(e.node.draggable===!1)return{allowed:!1,reason:"\u8BE5\u8282\u70B9\u7981\u6B62\u62D6\u62FD"};if(this.dragLeafOnly&&!this._isLeaf(e.node))return{allowed:!1,reason:"\u4EC5\u5141\u8BB8\u53F6\u5B50\u8282\u70B9\u62D6\u62FD"};if(this.dragFilter){let t=this._normalizeRuleResult(this.dragFilter(e.node,e.key,e),"\u81EA\u5B9A\u4E49 dragFilter \u62D2\u7EDD");if(!t.allowed)return{allowed:!1,reason:t.reason||"\u81EA\u5B9A\u4E49 dragFilter \u62D2\u7EDD"}}return{allowed:!0}}_isDescendantOf(e,t){if(e.children?.length){for(let r of e.children)if(Dt(r)===t||this._isDescendantOf(r,t))return!0}return!1}_canDropEntry(e,t,r){if(!this.draggableNodes)return{allowed:!1,reason:"\u672A\u542F\u7528\u62D6\u62FD"};if(e.key===t.key)return{allowed:!1,reason:"\u4E0D\u80FD\u653E\u5230\u81EA\u5DF1\u8EAB\u4E0A"};if(t.node.disabled)return{allowed:!1,reason:"\u76EE\u6807\u8282\u70B9\u5DF2\u7981\u7528"};if(t.node.droppable===!1)return{allowed:!1,reason:"\u8BE5\u8282\u70B9\u7981\u6B62\u653E\u7F6E"};if(this.dropSameLevelOnly){if(e.level!==t.level)return{allowed:!1,reason:"\u4EC5\u5141\u8BB8\u540C\u5C42\u7EA7\u6392\u5E8F"};if(r==="inside")return{allowed:!1,reason:"\u540C\u5C42\u7EA7\u6A21\u5F0F\u4E0D\u5141\u8BB8\u653E\u5165\u5185\u90E8"}}if(this._isDescendantOf(e.node,t.key))return{allowed:!1,reason:"\u4E0D\u80FD\u653E\u5230\u81EA\u8EAB\u5B50\u5B59\u8282\u70B9"};let n={dragNode:e.node,dragKey:e.key,dragLevel:e.level,dropNode:t.node,dropKey:t.key,dropLevel:t.level,position:r};if(this.dropFilter){let s=this._normalizeRuleResult(this.dropFilter(n),"\u81EA\u5B9A\u4E49 dropFilter \u62D2\u7EDD");if(!s.allowed)return{allowed:!1,reason:s.reason||"\u81EA\u5B9A\u4E49 dropFilter \u62D2\u7EDD"}}return{allowed:!0}}_findDragScrollTarget(e){let t=e?.parentElement??null,r=this.renderRoot instanceof ShadowRoot?this.renderRoot.host:null;for(;t&&t!==r;){let n=getComputedStyle(t),s=/(auto|scroll|overlay)/.test(n.overflowY)&&t.scrollHeight>t.clientHeight,d=/(auto|scroll|overlay)/.test(n.overflowX)&&t.scrollWidth>t.clientWidth;if(s||d)return t;t=t.parentElement}return this._flatNodes().length?window:null}_scheduleDragAutoScroll(){this._dragScrollFrame||!this._dragScrollTarget||!this._dragKey||(this._dragScrollFrame=requestAnimationFrame(()=>{this._dragScrollFrame=0;let e=this._dragScrollTarget;if(!e)return;let t=40,r=18,n=e instanceof Window?{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth,height:window.innerHeight,width:window.innerWidth}:e.getBoundingClientRect(),s=0,d=0;this._dragPointerY<n.top+t?s=-Math.max(2,Math.round((n.top+t-this._dragPointerY)/t*r)):this._dragPointerY>n.bottom-t&&(s=Math.max(2,Math.round((this._dragPointerY-(n.bottom-t))/t*r))),this._dragPointerX<n.left+t?d=-Math.max(2,Math.round((n.left+t-this._dragPointerX)/t*r)):this._dragPointerX>n.right-t&&(d=Math.max(2,Math.round((this._dragPointerX-(n.right-t))/t*r))),(d||s)&&(e instanceof Window?e.scrollBy({left:d,top:s,behavior:"auto"}):(e.scrollLeft+=d,e.scrollTop+=s)),this._dragKey&&this._scheduleDragAutoScroll()}))}_teardownTreeInteractions(){for(let e of this._treeInteractDisposers)e();this._treeInteractDisposers=[]}_scheduleTreeInteractions(){this.isConnected&&(this._treeInteractRaf||(this._treeInteractRaf=requestAnimationFrame(()=>{this._treeInteractRaf=0,this._syncTreeInteractions()})))}_syncTreeInteractions(){if(this._teardownTreeInteractions(),!this.draggableNodes)return;let e=Array.from(this.renderRoot.querySelectorAll(".row"));for(let t of e){let r=(0,Up.default)(t).draggable({allowFrom:this.dragHandle?".drag-handle":void 0,ignoreFrom:"button, input, textarea, select, option, a, [data-no-drag]",listeners:{start:n=>{let s=t.dataset.key??"",d=s?this._flatNodes(!0).find(p=>p.key===s):null;if(!d)return;let h=this._canDragEntry(d);if(!h.allowed){this._emitDragReject({phase:"drag",dragNode:d.node,dragKey:d.key,reason:h.reason,originalEvent:n});return}this._dragKey=s,this._dropKey="",this._dropPosition="",this._dragScrollTarget=this._findDragScrollTarget(t),this._dragPointerX=n.clientX??0,this._dragPointerY=n.clientY??0,this.toggleAttribute("dragging-nodes",!0),this._createDragGhost(d.node,this._dragPointerX,this._dragPointerY),this.dispatchEvent(new CustomEvent("node-drag-start",{detail:{node:d.node,key:d.key,originalEvent:n},bubbles:!0,composed:!0}))},move:n=>{this._dragKey&&(this._dragPointerX=n.clientX??this._dragPointerX,this._dragPointerY=n.clientY??this._dragPointerY,this._syncDropTarget(this._dragPointerX,this._dragPointerY),this._scheduleDragAutoScroll())},end:n=>{let s=this._dragKey,d=s?this._flatNodes(!0).find(x=>x.key===s):null,h=this._dropKey?this._flatNodes(!0).find(x=>x.key===this._dropKey):null,p=this._dropPosition||"inside",f=d&&h?this._canDropEntry(d,h,p):{allowed:!1};d&&h&&f.allowed?this.dispatchEvent(new CustomEvent("node-drop",{detail:{dragNode:d.node,dragKey:d.key,dropNode:h.node,dropKey:h.key,position:p,originalEvent:n},bubbles:!0,composed:!0})):d&&h&&this._emitDragReject({phase:"drop",dragNode:d.node,dragKey:d.key,dropNode:h.node,dropKey:h.key,position:p,reason:f.reason,originalEvent:n}),d&&this.dispatchEvent(new CustomEvent("node-drag-end",{detail:{node:d.node,key:d.key,originalEvent:n},bubbles:!0,composed:!0})),this._suppressNextClick=!0,this._suppressClickUntil=performance.now()+180,requestAnimationFrame(()=>{this._suppressNextClick&&(this._suppressNextClick=!1)}),this._clearDropState(),this._clearDragAutoScroll(),this._clearAutoExpand(),this._removeDragGhost(),this.toggleAttribute("dragging-nodes",!1),this._scheduleTreeInteractions()}}});this._treeInteractDisposers.push(()=>r.unset())}}_syncDropTarget(e,t){let r=this._dragEntryByKey(this._dragKey);if(!r){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(S=>S.closest?.(".row")).find(S=>!!S),h=d?.dataset.key??"";if(!d||!h||h===this._dragKey){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let p=this._dragEntryByKey(h);if(!p){this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}let f=d.getBoundingClientRect(),x=f.height?(t-f.top)/f.height:.5,k=x<.25?"before":x>.75||this._isLeaf(p.node)?"after":"inside",C=this._canDropEntry(r,p,k);if(!C.allowed){let S=`${r.key}->${p.key}:${k}:${C.reason||""}`;this._dropRejectSignature!==S&&(this._dropRejectSignature=S,this._emitDragReject({phase:"drop",dragNode:r.node,dragKey:r.key,dropNode:p.node,dropKey:p.key,position:k,reason:C.reason})),this._dropKey="",this._dropPosition="",this._clearAutoExpand();return}this._dropRejectSignature="",this._dropKey=h,this._dropPosition=k,this._dropPosition==="inside"&&!this._isLeaf(p.node)&&!this._expandedSet.has(h)?this._dragAutoExpandKey!==h&&(this._clearAutoExpand(),this._dragAutoExpandKey=h,this._dragAutoExpandTimer=window.setTimeout(()=>{this._dragKey&&this._dropKey===h&&this._dropPosition==="inside"&&!this._expandedSet.has(h)&&this._setExpanded(h,!0),this._clearAutoExpand()},420)):this._clearAutoExpand()}_renderIcon(e,t,r){let n=e.icon??(r?"file":t?e.openIcon||"folder-open":"folder");return yc(n)?gt`<img src=${n} alt="" loading="lazy" />`:gt`<lui-icon name=${n}></lui-icon>`}_renderRow(e){let{node:t,key:r,level:n,ancestorGuides:s}=e,d=this._expandedSet.has(r),h=this._isLeaf(t),p=this._isLoading(r,t),f=this._selectedSet.has(r),x=this._checkState(t,r),k=this._activeKey===r,C=this._canDragEntry(e),S=n>0?Yc(n):null,z=n>0?Yc(n-1):null,T=this._dragKey===r,P=this._dropKey===r&&this._dropPosition?`drop-${this._dropPosition}`:"",H=["row",f?"selected":"",k?"active":"",C.allowed?"draggable":"",T?"dragging":"",P,t.disabled?"disabled":""].filter(Boolean).join(" ");return gt`
|
|
5871
5865
|
<div
|
|
5872
5866
|
class=${H}
|
|
5873
5867
|
part="row"
|
|
@@ -5882,14 +5876,14 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5882
5876
|
@click=${()=>this._onRowClick(e)}
|
|
5883
5877
|
@contextmenu=${R=>this._onContextMenu(R,e)}
|
|
5884
5878
|
>
|
|
5885
|
-
${this.draggableNodes&&this.dragHandle?
|
|
5879
|
+
${this.draggableNodes&&this.dragHandle?gt`
|
|
5886
5880
|
<span class="drag-handle" part="drag-handle" aria-hidden="true" data-no-drag>
|
|
5887
5881
|
<span></span>
|
|
5888
5882
|
</span>
|
|
5889
5883
|
`:Oo}
|
|
5890
|
-
${this.showGuides?
|
|
5891
|
-
${s.map((R,F)=>R?
|
|
5892
|
-
${S!=null&&z!=null?
|
|
5884
|
+
${this.showGuides?gt`<span class="guide-layer" aria-hidden="true">
|
|
5885
|
+
${s.map((R,F)=>R?gt`<span class="guide-ancestor" style="left:${Yc(F+1)}px"></span>`:Oo)}
|
|
5886
|
+
${S!=null&&z!=null?gt`<span class="guide-h" style="left:${z}px;width:${S-z}px"></span>`:Oo}
|
|
5893
5887
|
</span>`:Oo}
|
|
5894
5888
|
<button
|
|
5895
5889
|
class=${`toggle ${h?"placeholder":""}`}
|
|
@@ -5898,9 +5892,9 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5898
5892
|
aria-label=${d?"Collapse":"Expand"}
|
|
5899
5893
|
@click=${R=>this._onToggleClick(R,e)}
|
|
5900
5894
|
>
|
|
5901
|
-
${p?
|
|
5895
|
+
${p?gt`<lui-spinner></lui-spinner>`:gt`<lui-icon name=${d?"chevron-down":"chevron-right"}></lui-icon>`}
|
|
5902
5896
|
</button>
|
|
5903
|
-
${this.selectionMode==="checkbox"?
|
|
5897
|
+
${this.selectionMode==="checkbox"?gt`
|
|
5904
5898
|
<button
|
|
5905
5899
|
class=${`check ${x}`}
|
|
5906
5900
|
type="button"
|
|
@@ -5908,23 +5902,23 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5908
5902
|
aria-checked=${x==="half"?"mixed":x==="checked"?"true":"false"}
|
|
5909
5903
|
@click=${R=>{R.stopPropagation(),this._setChecked(t,r,x!=="checked")}}
|
|
5910
5904
|
>
|
|
5911
|
-
${x==="checked"?
|
|
5905
|
+
${x==="checked"?gt`<lui-icon name="check"></lui-icon>`:x==="half"?gt`<lui-icon name="minus"></lui-icon>`:Oo}
|
|
5912
5906
|
</button>
|
|
5913
5907
|
`:Oo}
|
|
5914
5908
|
<span class="icon" part="icon">${this._renderIcon(t,d,h)}</span>
|
|
5915
5909
|
<span class="content" part="content">
|
|
5916
5910
|
<span class="text" part="text">${this._renderHighlighted(Ho(t))}</span>
|
|
5917
|
-
${t.description?
|
|
5911
|
+
${t.description?gt`<span class="description" part="description">${t.description}</span>`:Oo}
|
|
5918
5912
|
</span>
|
|
5919
5913
|
<span class="actions" part="actions"><slot name=${`actions-${r}`}></slot></span>
|
|
5920
5914
|
</div>
|
|
5921
|
-
`}_renderRows(e){return e.length?this.virtual&&e.length>=this.virtualThreshold?
|
|
5915
|
+
`}_renderRows(e){return e.length?this.virtual&&e.length>=this.virtualThreshold?gt`
|
|
5922
5916
|
<div class="virtual-wrap" part="virtual-list">
|
|
5923
5917
|
${ki({items:e,renderItem:t=>this._renderRow(t)})}
|
|
5924
5918
|
</div>
|
|
5925
|
-
`:Tv(e,t=>t.key,t=>this._renderRow(t)):
|
|
5926
|
-
${this.label?
|
|
5927
|
-
${this.filterable?
|
|
5919
|
+
`:Tv(e,t=>t.key,t=>this._renderRow(t)):gt`<div class="empty"><div><lui-icon name="folder-open"></lui-icon><div>${this.emptyText}</div></div></div>`}render(){let e=this._flatNodes();return gt`
|
|
5920
|
+
${this.label?gt`<div part="label">${this.label}</div>`:gt`<slot name="label"></slot>`}
|
|
5921
|
+
${this.filterable?gt`
|
|
5928
5922
|
<label class="search" part="search">
|
|
5929
5923
|
<lui-icon name="search"></lui-icon>
|
|
5930
5924
|
<input .value=${this.filterValue} placeholder=${this.filterPlaceholder} @input=${this._onFilterInput} />
|
|
@@ -5933,7 +5927,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
5933
5927
|
<div part="tree" role="tree" tabindex="0" @keydown=${this._onKeyDown}>
|
|
5934
5928
|
${this._renderRows(e)}
|
|
5935
5929
|
</div>
|
|
5936
|
-
${this.contextMenuItems?
|
|
5930
|
+
${this.contextMenuItems?gt`
|
|
5937
5931
|
<lui-context-menu
|
|
5938
5932
|
class="internal-context-menu"
|
|
5939
5933
|
trigger="manual"
|
|
@@ -6269,7 +6263,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6269
6263
|
margin: 0 auto 8px;
|
|
6270
6264
|
color: var(--lui-color-fg-subtle);
|
|
6271
6265
|
}
|
|
6272
|
-
`],a([
|
|
6266
|
+
`],a([He({attribute:!1})],se.prototype,"nodes",2),a([He({attribute:!1})],se.prototype,"expandedKeys",2),a([He({attribute:!1})],se.prototype,"defaultExpandedKeys",2),a([He({attribute:"selected-key"})],se.prototype,"selectedKey",2),a([He({attribute:!1})],se.prototype,"selectedKeys",2),a([He({attribute:!1})],se.prototype,"checkedKeys",2),a([He({attribute:!1})],se.prototype,"defaultCheckedKeys",2),a([He({attribute:!1})],se.prototype,"loadingKeys",2),a([He({attribute:!1})],se.prototype,"childrenLoader",2),a([He({reflect:!0})],se.prototype,"size",2),a([He()],se.prototype,"label",2),a([He({attribute:"empty-text"})],se.prototype,"emptyText",2),a([He({attribute:"expand-trigger"})],se.prototype,"expandTrigger",2),a([He({type:Boolean,attribute:"show-guides"})],se.prototype,"showGuides",2),a([He({attribute:"selection-mode"})],se.prototype,"selectionMode",2),a([He({type:Boolean,attribute:"check-strictly"})],se.prototype,"checkStrictly",2),a([He({type:Boolean,attribute:"load-on-expand"})],se.prototype,"loadOnExpand",2),a([He({type:Boolean})],se.prototype,"filterable",2),a([He({attribute:"filter-value"})],se.prototype,"filterValue",2),a([He({attribute:"filter-placeholder"})],se.prototype,"filterPlaceholder",2),a([He({type:Boolean,attribute:"draggable-nodes"})],se.prototype,"draggableNodes",2),a([He({type:Boolean,attribute:"drag-leaf-only"})],se.prototype,"dragLeafOnly",2),a([He({type:Boolean,attribute:"drop-same-level-only"})],se.prototype,"dropSameLevelOnly",2),a([He({type:Boolean,attribute:"drag-handle"})],se.prototype,"dragHandle",2),a([He({type:Boolean})],se.prototype,"virtual",2),a([He({type:Number,attribute:"virtual-threshold"})],se.prototype,"virtualThreshold",2),a([He({attribute:!1})],se.prototype,"contextMenuItems",2),a([He({attribute:!1})],se.prototype,"dragFilter",2),a([He({attribute:!1})],se.prototype,"dropFilter",2),a([_i()],se.prototype,"_innerExpanded",2),a([_i()],se.prototype,"_innerSelected",2),a([_i()],se.prototype,"_innerChecked",2),a([_i()],se.prototype,"_innerLoading",2),a([_i()],se.prototype,"_activeKey",2),a([_i()],se.prototype,"_dragKey",2),a([_i()],se.prototype,"_dropKey",2),a([_i()],se.prototype,"_dropPosition",2),a([$v("lui-context-menu.internal-context-menu")],se.prototype,"_contextMenuEl",2),se=a([Sv("lui-tree")],se);import{css as jv,html as vr,LitElement as Ov,nothing as Jt}from"lit";import{customElement as Hv,property as br}from"lit/decorators.js";var ft=class extends Ov{constructor(){super(...arguments);this.title="";this.subtitle="";this.hoverable=!1;this.compact=!1;this.size="md";this.borderless=!1;this.shadow="none";this.clickable=!1;this.ripple=!1;this.selected=!1;this.loading=!1;this.dividerless=!1;this.coverRatio="";this._ripple=new gi(this);this._onPointerDown=e=>{!this.ripple||!this.clickable||this.loading||this._ripple.add(e)};this._onKeyDown=e=>{!this.clickable||this.loading||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.click())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._lightDomObserver=new MutationObserver(()=>this.requestUpdate()),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){this._disposeLocaleChange?.(),this._disposeLocaleChange=void 0,this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,super.disconnectedCallback()}_hasSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}render(){let e=this._hasSlot("header"),t=this._hasSlot("footer"),r=this._hasSlot("cover"),n=this._hasSlot("extra"),s=this._hasSlot("actions"),d=this._hasSlot("media"),h=this._hasSlot("title"),p=e||d||h||!!this.title||!!this.subtitle,f=n||s,x=p||f,k=["cover",r&&this.coverRatio?"ratio":""].filter(Boolean).join(" ");return vr`
|
|
6273
6267
|
<article
|
|
6274
6268
|
class="card"
|
|
6275
6269
|
part="card"
|
|
@@ -6283,25 +6277,25 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6283
6277
|
@pointerdown=${this._onPointerDown}
|
|
6284
6278
|
>
|
|
6285
6279
|
${this._ripple.render()}
|
|
6286
|
-
${r?
|
|
6280
|
+
${r?vr`<div class=${k} part="cover"><slot name="cover"></slot></div>`:Jt}
|
|
6287
6281
|
|
|
6288
|
-
${x?
|
|
6282
|
+
${x?vr`
|
|
6289
6283
|
<div class="header ${p?"":"header-only-side"}" part="header">
|
|
6290
|
-
${p?
|
|
6284
|
+
${p?vr`
|
|
6291
6285
|
<div class="header-main ${e?"custom":""}" part="header-main">
|
|
6292
|
-
${d?
|
|
6286
|
+
${d?vr`<div class="header-media" part="header-media"><slot name="media"></slot></div>`:Jt}
|
|
6293
6287
|
<div class="header-text" part="header-text">
|
|
6294
|
-
${e?
|
|
6295
|
-
${this.title?
|
|
6296
|
-
${this.subtitle?
|
|
6288
|
+
${e?vr`<slot name="header"></slot>`:h?vr`<slot name="title"></slot>`:vr`
|
|
6289
|
+
${this.title?vr`<div class="title" part="title">${this.title}</div>`:Jt}
|
|
6290
|
+
${this.subtitle?vr`<div class="subtitle" part="subtitle">${this.subtitle}</div>`:Jt}
|
|
6297
6291
|
`}
|
|
6298
6292
|
</div>
|
|
6299
6293
|
</div>
|
|
6300
6294
|
`:Jt}
|
|
6301
|
-
${f?
|
|
6295
|
+
${f?vr`
|
|
6302
6296
|
<div class="header-side" part="header-side">
|
|
6303
|
-
${n?
|
|
6304
|
-
${s?
|
|
6297
|
+
${n?vr`<slot name="extra"></slot>`:Jt}
|
|
6298
|
+
${s?vr`
|
|
6305
6299
|
<div class="header-actions" part="actions">
|
|
6306
6300
|
<slot name="actions"></slot>
|
|
6307
6301
|
</div>
|
|
@@ -6315,13 +6309,13 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6315
6309
|
<slot></slot>
|
|
6316
6310
|
</div>
|
|
6317
6311
|
|
|
6318
|
-
${t?
|
|
6312
|
+
${t?vr`
|
|
6319
6313
|
<div class="footer" part="footer">
|
|
6320
6314
|
<slot name="footer"></slot>
|
|
6321
6315
|
</div>
|
|
6322
6316
|
`:Jt}
|
|
6323
6317
|
|
|
6324
|
-
${this.loading?
|
|
6318
|
+
${this.loading?vr`
|
|
6325
6319
|
<div class="loading-overlay" part="loading">
|
|
6326
6320
|
<div class="loading-indicator">
|
|
6327
6321
|
<lui-spinner variant="track"></lui-spinner>
|
|
@@ -6330,7 +6324,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6330
6324
|
</div>
|
|
6331
6325
|
`:Jt}
|
|
6332
6326
|
</article>
|
|
6333
|
-
`}};
|
|
6327
|
+
`}};ft.styles=[A,O,hn,jv`
|
|
6334
6328
|
:host {
|
|
6335
6329
|
display: block;
|
|
6336
6330
|
--lui-card-radius: var(--lui-radius-lg);
|
|
@@ -6583,7 +6577,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6583
6577
|
--lui-spinner-color: var(--lui-color-primary);
|
|
6584
6578
|
--lui-spinner-track: color-mix(in srgb, var(--lui-color-primary) 22%, transparent);
|
|
6585
6579
|
}
|
|
6586
|
-
`],a([
|
|
6580
|
+
`],a([br()],ft.prototype,"title",2),a([br()],ft.prototype,"subtitle",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"hoverable",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"compact",2),a([br({reflect:!0})],ft.prototype,"size",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"borderless",2),a([br({reflect:!0})],ft.prototype,"shadow",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"clickable",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"ripple",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"selected",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"loading",2),a([br({type:Boolean,reflect:!0})],ft.prototype,"dividerless",2),a([br({reflect:!0,attribute:"cover-ratio"})],ft.prototype,"coverRatio",2),a([br()],ft.prototype,"locale",2),a([br({attribute:!1})],ft.prototype,"translations",2),ft=a([Hv("lui-card")],ft);import{css as Rv,html as rl,LitElement as Iv,nothing as Xc}from"lit";import{customElement as Vv,property as er}from"lit/decorators.js";var dt=class extends Iv{constructor(){super(...arguments);this.title="";this.value=0;this.prefix="";this.suffix="";this.description="";this.groupSeparator=",";this.decimalSeparator=".";this.size="md";this.align="start";this.trend="none";this.trendValue="";this.status="default";this.valueColor="";this.loading=!1;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=N(this,"statistic");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("align")&&typeof t.align=="string"&&this.align!==t.align&&(this.align=t.align),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("loading")&&typeof t.loading=="boolean"&&this.loading!==t.loading&&(this.loading=t.loading),!this._explicitAttrs.has("group-separator")&&typeof t.groupSeparator=="string"&&this.groupSeparator!==t.groupSeparator&&(this.groupSeparator=t.groupSeparator),!this._explicitAttrs.has("decimal-separator")&&typeof t.decimalSeparator=="string"&&this.decimalSeparator!==t.decimalSeparator&&(this.decimalSeparator=t.decimalSeparator)}_formatNumber(e){let t=typeof this.precision=="number"&&Number.isFinite(this.precision)?e.toFixed(Math.max(0,this.precision)):String(e),[r,n]=t.split("."),s=r.replace(/\B(?=(\d{3})+(?!\d))/g,this.groupSeparator);return n!=null?`${s}${this.decimalSeparator}${n}`:s}_formattedValue(){if(typeof this.value=="number")return this._formatNumber(this.value);let e=String(this.value??""),t=Number(e);return e.trim()!==""&&Number.isFinite(t)?this._formatNumber(t):e}_trendIcon(){return this.trend==="up"?"trending-up":this.trend==="down"?"trending-down":this.trend==="neutral"?"minus":""}_renderValue(){let e=this._formattedValue();return this.formatter?this.formatter(this.value,{formatted:e,statistic:this}):e}render(){let e=this._trendIcon(),t=this.valueColor?`--lui-statistic-value-color:${this.valueColor}`:Xc;return this.loading?rl`
|
|
6587
6581
|
<div class="statistic" part="statistic" style=${t} aria-busy="true">
|
|
6588
6582
|
<div class="skeleton title-skeleton" part="title-skeleton"></div>
|
|
6589
6583
|
<div class="skeleton value-skeleton" part="value-skeleton"></div>
|
|
@@ -6889,7 +6883,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6889
6883
|
:host([hidden]) {
|
|
6890
6884
|
display: none !important;
|
|
6891
6885
|
}
|
|
6892
|
-
`],a([Kt()],qr.prototype,"key",2),a([Kt()],qr.prototype,"value",2),a([Kt()],qr.prototype,"label",2),a([Kt()],qr.prototype,"icon",2),a([Kt()],qr.prototype,"badge",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"disabled",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"closable",2),qr=a([Jc("lui-tab-panel")],qr);var
|
|
6886
|
+
`],a([Kt()],qr.prototype,"key",2),a([Kt()],qr.prototype,"value",2),a([Kt()],qr.prototype,"label",2),a([Kt()],qr.prototype,"icon",2),a([Kt()],qr.prototype,"badge",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"disabled",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"closable",2),qr=a([Jc("lui-tab-panel")],qr);var vt=class extends Qp{constructor(){super(...arguments);this.activeKey="";this.size="md";this.variant="line";this.placement="top";this.closable=!1;this.disabled=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this._overflowIndexes=[];this._explicitAttrs=new Set;this._observedTabButtons=new Set;this._layoutFrame=0;this._indicatorFrame=0;this._onExtraSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.ELEMENT_NODE?!0:!!n.textContent?.trim());this.toggleAttribute("has-extra",r)};this._onKeyDown=e=>{let t=this._tabs(),r=t.map((k,C)=>({item:k,index:C})).filter(({item:k})=>!k.disabled);if(!r.length)return;let n=this._resolvedActiveKey(t),s=Math.max(0,r.findIndex(({item:k,index:C})=>Zo(k,C)===n)),d=this.placement==="top"||this.placement==="bottom",h=d?"ArrowLeft":"ArrowUp",p=d?"ArrowRight":"ArrowDown",f=s;if(e.key===p)f=(s+1)%r.length;else if(e.key===h)f=(s-1+r.length)%r.length;else if(e.key==="Home")f=0;else if(e.key==="End")f=r.length-1;else return;e.preventDefault();let x=r[f];this._select(x.item,x.index),this.updateComplete.then(()=>{this.renderRoot.querySelector(`button[data-key="${CSS.escape(Zo(x.item,x.index))}"]`)?.focus()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._navEl&&this._resizeObserver?.observe(this._navEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncObservedTabButtons(),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}willUpdate(e){let t=N(this,"tab");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("closable")&&typeof t.closable=="boolean"&&this.closable!==t.closable&&(this.closable=t.closable)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement));let t=this._resolvedActiveKey();t&&this.getAttribute("active-key")!==t&&this.setAttribute("active-key",t),this._syncPanels(),this._syncObservedTabButtons(),(e.has("items")||e.has("size")||e.has("variant")||e.has("placement")||e.has("closable")||e.has("disabled")||e.has("collapse")||e.has("activeKey"))&&this._scheduleLayout(),this._scheduleActiveIndicatorLayout()}_syncObservedTabButtons(){if(!this._resizeObserver)return;let e=new Set(Array.from(this.renderRoot.querySelectorAll(".tab-button, .overflow-trigger")));for(let t of this._observedTabButtons)e.has(t)||this._resizeObserver.unobserve(t);for(let t of e)this._observedTabButtons.has(t)||this._resizeObserver.observe(t);this._observedTabButtons=e}_panelElements(){return(this._defaultSlot?.assignedElements({flatten:!0})??this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-tab-panel")}_itemsFromPanels(){return this._panelElements().map((e,t)=>({key:e.tabKey||String(t),label:e.label||e.getAttribute("label")||e.tabKey||`Tab ${t+1}`,icon:e.icon,badge:e.badge,disabled:e.disabled,closable:e.closable}))}_tabs(){return this.items?.length?this.items:this._itemsFromPanels()}_resolvedActiveKey(e=this._tabs()){let t=e.filter(r=>!r.disabled);return t.length?this.activeKey&&t.some((r,n)=>Zo(r,e.indexOf(r)>=0?e.indexOf(r):n)===this.activeKey)?this.activeKey:Zo(t[0],e.indexOf(t[0])):""}_syncPanels(){if(this.items?.length)return;let e=this._panelElements(),t=this._itemsFromPanels(),r=this._resolvedActiveKey(t);r&&this.activeKey!==r&&(this.activeKey=r),r&&this.getAttribute("active-key")!==r&&this.setAttribute("active-key",r),e.forEach((n,s)=>{let d=n.tabKey||String(s);n.hidden=d!==r})}_select(e,t){if(this.disabled||e.disabled)return;let r=Zo(e,t),n=this._resolvedActiveKey();r===n&&this.activeKey||(this.activeKey=r,this.dispatchEvent(new CustomEvent("change",{detail:{key:r,previousKey:n,item:e,index:t},bubbles:!0,composed:!0})))}_close(e,t,r){e.preventDefault(),e.stopPropagation();let n=Zo(t,r);this.dispatchEvent(new CustomEvent("close",{detail:{key:n,item:t,index:r,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeOverflow(),this._scheduleActiveIndicatorLayout()})}_scheduleActiveIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateActiveIndicator()})}_updateActiveIndicator(){let e=this._navEl;if(!e)return;let t=this._resolvedActiveKey(),r=t?e.querySelector(`button.tab-button[data-key="${CSS.escape(t)}"]`):null;if(!r){e.style.setProperty("--lui-tab-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=r.offsetWidth||s.width,h=r.offsetHeight||s.height;e.style.setProperty("--lui-tab-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-tab-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-tab-indicator-width",`${d}px`),e.style.setProperty("--lui-tab-indicator-height",`${h}px`),e.style.setProperty("--lui-tab-indicator-opacity","1")}_isHorizontal(){return this.placement==="top"||this.placement==="bottom"}_tabWidthBudget(){return Math.floor(this._navEl?.clientWidth??0)}_visibleIndexesForAuto(e){if(this.collapse!=="auto"||!this._isHorizontal()||e.length<=1)return e.map((k,C)=>C);let t=this._tabWidthBudget(),r=Array.from(this.renderRoot.querySelectorAll("[data-measure-tab-index]")),n=this.renderRoot.querySelector("[data-measure-overflow-trigger]");if(!t||r.length!==e.length||!n)return e.map((k,C)=>C);let s=Number.parseFloat(getComputedStyle(this._navEl).columnGap||"0")||0,d=r.map(k=>Math.ceil(k.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width);if(d.reduce((k,C)=>k+C,0)+Math.max(0,e.length-1)*s<=t)return e.map((k,C)=>C);let f=[],x=h;for(let k=0;k<e.length;k+=1){let C=d[k]??0,S=x+(f.length>0?s:0)+C;S<=t&&(f.push(k),x=S)}return f}_recomputeOverflow(){let e=this._tabs(),t=new Set(this._visibleIndexesForAuto(e)),r=e.map((n,s)=>s).filter(n=>!t.has(n));Kv(r,this._overflowIndexes)||(this._overflowIndexes=r)}_overflowMenuItems(e,t){return this._overflowIndexes.flatMap(r=>{let n=e[r];if(!n)return[];let s=Zo(n,r);return[{key:s,value:String(r),label:n.label??s,icon:n.icon,disabled:this.disabled||n.disabled,active:s===t}]})}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];n&&this._select(n,r)}_renderTab(e,t,r){let n=Zo(e,t),s=n===r,d=e.closable??this.closable;return Ro`
|
|
6893
6887
|
<button
|
|
6894
6888
|
class=${`tab-button ${s?"active":""}`}
|
|
6895
6889
|
part="tab"
|
|
@@ -6956,7 +6950,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
6956
6950
|
${this.items?.length?this._renderDataPanel(e,t):Ro`<slot @slotchange=${()=>{this._syncPanels(),this._scheduleLayout(),this.requestUpdate()}}></slot>`}
|
|
6957
6951
|
</div>
|
|
6958
6952
|
</div>
|
|
6959
|
-
`}};
|
|
6953
|
+
`}};vt.styles=[A,O,Zp`
|
|
6960
6954
|
:host {
|
|
6961
6955
|
display: block;
|
|
6962
6956
|
min-width: 0;
|
|
@@ -7241,6 +7235,42 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7241
7235
|
box-shadow: var(--lui-tab-indicator-shadow);
|
|
7242
7236
|
transform: translate3d(var(--lui-tab-indicator-x, 0px), var(--lui-tab-indicator-y, 0px), 0);
|
|
7243
7237
|
}
|
|
7238
|
+
:host([variant="segment"]) .nav-wrap {
|
|
7239
|
+
display: inline-flex;
|
|
7240
|
+
align-self: flex-start;
|
|
7241
|
+
padding: 3px;
|
|
7242
|
+
border: 1px solid var(--lui-tab-border-color);
|
|
7243
|
+
border-radius: 999px;
|
|
7244
|
+
background: var(--lui-tab-pill-bg);
|
|
7245
|
+
}
|
|
7246
|
+
:host([variant="segment"]) .tab-button,
|
|
7247
|
+
:host([variant="segment"]) .overflow-trigger {
|
|
7248
|
+
border-radius: 999px;
|
|
7249
|
+
}
|
|
7250
|
+
:host([variant="segment"]) .tab-button.active,
|
|
7251
|
+
:host([variant="segment"]) .tab-button.active:hover:not(:disabled) {
|
|
7252
|
+
/* 指示块已是底色,active+hover 的文字必须保持高亮色,
|
|
7253
|
+
否则被通用 hover 的 --lui-tab-fg 盖成深色 */
|
|
7254
|
+
color: var(--lui-tab-active-color);
|
|
7255
|
+
background: transparent;
|
|
7256
|
+
box-shadow: none;
|
|
7257
|
+
}
|
|
7258
|
+
:host([variant="segment"]) .active-indicator {
|
|
7259
|
+
left: 0;
|
|
7260
|
+
right: auto;
|
|
7261
|
+
top: 0;
|
|
7262
|
+
bottom: auto;
|
|
7263
|
+
width: var(--lui-tab-indicator-width, 0px);
|
|
7264
|
+
height: var(--lui-tab-indicator-height, 0px);
|
|
7265
|
+
border-radius: 999px;
|
|
7266
|
+
background: var(--lui-tab-indicator-bg);
|
|
7267
|
+
box-shadow: var(--lui-tab-indicator-shadow);
|
|
7268
|
+
transform: translate3d(var(--lui-tab-indicator-x, 0px), var(--lui-tab-indicator-y, 0px), 0);
|
|
7269
|
+
}
|
|
7270
|
+
/* 无面板内容时不占位(拿来做纯分段选择器) */
|
|
7271
|
+
:host([variant="segment"]) .panel:empty {
|
|
7272
|
+
display: none;
|
|
7273
|
+
}
|
|
7244
7274
|
.overflow {
|
|
7245
7275
|
display: inline-flex;
|
|
7246
7276
|
align-items: center;
|
|
@@ -7349,7 +7379,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7349
7379
|
transition: none;
|
|
7350
7380
|
}
|
|
7351
7381
|
}
|
|
7352
|
-
`],a([Kt({attribute:"active-key"})],
|
|
7382
|
+
`],a([Kt({attribute:"active-key"})],vt.prototype,"activeKey",2),a([Kt({attribute:!1})],vt.prototype,"items",2),a([Kt({reflect:!0})],vt.prototype,"size",2),a([Kt({reflect:!0})],vt.prototype,"variant",2),a([Kt({reflect:!0})],vt.prototype,"placement",2),a([Kt({type:Boolean,reflect:!0})],vt.prototype,"closable",2),a([Kt({type:Boolean,reflect:!0})],vt.prototype,"disabled",2),a([Kt({reflect:!0})],vt.prototype,"collapse",2),a([Kt({attribute:"overflow-label"})],vt.prototype,"overflowLabel",2),a([Kt({attribute:"overflow-icon"})],vt.prototype,"overflowIcon",2),a([Bv({flatten:!0})],vt.prototype,"_assignedElements",2),a([Xp("slot:not([name])")],vt.prototype,"_defaultSlot",2),a([Xp(".nav")],vt.prototype,"_navEl",2),a([qv()],vt.prototype,"_overflowIndexes",2),vt=a([Jc("lui-tab")],vt);var ja=class extends vt{};ja=a([Jc("lui-tabs")],ja);import{css as Jp,html as Oa,LitElement as e1,nothing as ed}from"lit";import{customElement as t1,property as kr,state as Wv}from"lit/decorators.js";var yr=class extends e1{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.description="";this.icon="";this.extra="";this.disabled=!1;this.open=!1;this.iconPlacement="end";this._onHeaderClick=()=>{this.dispatchEvent(new CustomEvent("item-toggle-request",{bubbles:!0,composed:!0}))}}get itemKey(){return this.key||this.value}render(){let e="header",t="body";return Oa`
|
|
7353
7383
|
<button
|
|
7354
7384
|
part="header"
|
|
7355
7385
|
id=${e}
|
|
@@ -7374,7 +7404,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7374
7404
|
<div part="body-content"><slot></slot></div>
|
|
7375
7405
|
</div>
|
|
7376
7406
|
</div>
|
|
7377
|
-
`}};
|
|
7407
|
+
`}};yr.styles=[A,O,Jp`
|
|
7378
7408
|
:host {
|
|
7379
7409
|
display: block;
|
|
7380
7410
|
min-width: 0;
|
|
@@ -7466,7 +7496,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7466
7496
|
transition-duration: 0.01ms;
|
|
7467
7497
|
}
|
|
7468
7498
|
}
|
|
7469
|
-
`],a([
|
|
7499
|
+
`],a([kr()],yr.prototype,"key",2),a([kr()],yr.prototype,"value",2),a([kr()],yr.prototype,"label",2),a([kr()],yr.prototype,"description",2),a([kr()],yr.prototype,"icon",2),a([kr()],yr.prototype,"extra",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"disabled",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"open",2),a([kr({reflect:!0,attribute:"icon-placement"})],yr.prototype,"iconPlacement",2),yr=a([t1("lui-collapse-item")],yr);var Kr=class extends e1{constructor(){super(...arguments);this.variant="bordered";this.size="md";this.iconPlacement="end";this.accordion=!1;this.defaultOpenKeys="";this._internalOpen=null;this._items=[];this._onItemRequest=e=>{let t=e.target?.closest?.("lui-collapse-item");if(!t||t.disabled)return;e.stopPropagation();let r=this._items.indexOf(t);r<0||this._toggle(this._keyFor(t,r))};this._onSlotChange=()=>{this._items=Array.from(this.querySelectorAll("lui-collapse-item")),this._syncItems()}}connectedCallback(){super.connectedCallback(),this.addEventListener("item-toggle-request",this._onItemRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("item-toggle-request",this._onItemRequest)}get _openList(){return this.openKeys!==void 0?this.openKeys:this._internalOpen!==null?this._internalOpen:this.defaultOpenKeys.split(",").map(e=>e.trim()).filter(Boolean)}_keyFor(e,t){return e.itemKey||String(t)}_toggle(e){let t=new Set(this._openList),r=!t.has(e),n;this.accordion?n=r?[e]:[]:(r?t.add(e):t.delete(e),n=[...t]);let s={key:e,open:r,openKeys:n},d=new CustomEvent("toggle",{detail:s,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(d)&&(this.openKeys===void 0&&(this._internalOpen=n,this._syncItems(n)),this.dispatchEvent(new CustomEvent("change",{detail:s,bubbles:!0,composed:!0})))}_syncItems(e=this._openList){let t=new Set(e);this._items.forEach((r,n)=>{r.open=t.has(this._keyFor(r,n)),r.iconPlacement=this.iconPlacement})}openAll(){if(this.accordion)return;let e=this._items.map((t,r)=>({item:t,key:this._keyFor(t,r)})).filter(({item:t})=>!t.disabled).map(({key:t})=>t);this._applyExternal(e,!0)}closeAll(){this._applyExternal([],!1)}_applyExternal(e,t){this.openKeys===void 0&&(this._internalOpen=e,this._syncItems(e)),this.dispatchEvent(new CustomEvent("change",{detail:{key:"",open:t,openKeys:e},bubbles:!0,composed:!0}))}updated(){this._syncItems()}render(){let t=N(this,"collapse").variant??this.variant;return Oa`
|
|
7470
7500
|
<div class="root" part="base" data-variant=${t}>
|
|
7471
7501
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
7472
7502
|
</div>
|
|
@@ -7512,7 +7542,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7512
7542
|
:host([variant="plain"]) ::slotted(lui-collapse-item + lui-collapse-item) {
|
|
7513
7543
|
border-top: 1px solid color-mix(in srgb, var(--lui-color-border) 72%, transparent);
|
|
7514
7544
|
}
|
|
7515
|
-
`],a([
|
|
7545
|
+
`],a([kr({reflect:!0})],Kr.prototype,"variant",2),a([kr({reflect:!0})],Kr.prototype,"size",2),a([kr({reflect:!0,attribute:"icon-placement"})],Kr.prototype,"iconPlacement",2),a([kr({type:Boolean,reflect:!0})],Kr.prototype,"accordion",2),a([kr({attribute:!1})],Kr.prototype,"openKeys",2),a([kr({attribute:"default-open-keys"})],Kr.prototype,"defaultOpenKeys",2),a([Wv()],Kr.prototype,"_internalOpen",2),Kr=a([t1("lui-collapse")],Kr);import{css as Uv,html as Sn,LitElement as Gv,nothing as ol}from"lit";import{customElement as Yv,property as xr,state as Xv}from"lit/decorators.js";var r1=[{color:"var(--lui-color-info)",bgMix:18,fgMix:92},{color:"oklch(64% 0.22 295)",bgMix:18,fgMix:88},{color:"var(--lui-color-success)",bgMix:16,fgMix:90},{color:"var(--lui-color-warning)",bgMix:18,fgMix:94},{color:"var(--lui-color-danger)",bgMix:16,fgMix:92},{color:"oklch(70% 0.16 185)",bgMix:16,fgMix:88},{color:"oklch(66% 0.24 310)",bgMix:18,fgMix:90},{color:"var(--lui-color-fg-muted)",bgMix:16,fgMix:88}],ut=class extends Gv{constructor(){super(...arguments);this.src="";this.alt="";this.name="";this.text="";this.icon="user";this.size="md";this.radius="full";this.color="auto";this.status="none";this.statusColor="";this.statusPosition="top-right";this.clickable=!1;this.disabled=!1;this.tooltip="";this.tooltipPlacement="top";this._imageError=!1;this._explicitAttrs=new Set;this._onImageError=()=>{this._imageError=!0};this._onClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())};this._onKeyDown=e=>{!this.clickable||this.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._emitKeyboardClick())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){e.has("src")&&(this._imageError=!1);let t=N(this,"avatar");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("status-position")&&typeof t.statusPosition=="string"&&this.statusPosition!==t.statusPosition&&(this.statusPosition=t.statusPosition),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("clickable")&&typeof t.clickable=="boolean"&&this.clickable!==t.clickable&&(this.clickable=t.clickable)}_getSeed(){return this.text||this.name||this.alt||this.icon||"avatar"}_getInitials(){let e=(this.text||this.name||this.alt||"").trim();if(!e)return"";let t=e.split(/[\s\-_]+/).map(r=>r.trim()).filter(Boolean);return t.length>=2?`${t[0][0]??""}${t[t.length-1][0]??""}`.toUpperCase():e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}_getAutoPaletteStyle(){if(this.color!=="auto"||this.src&&!this._imageError)return"";let e=this._getSeed(),t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;let r=r1[t%r1.length];return`--lui-avatar-bg:color-mix(in srgb, ${r.color} ${r.bgMix}%, var(--lui-color-bg));--lui-avatar-fg:color-mix(in srgb, ${r.color} ${r.fgMix}%, var(--lui-color-fg));--lui-avatar-border:color-mix(in srgb, ${r.color} 24%, transparent);`}_getAvatarStyle(){return[this._getAutoPaletteStyle(),this.statusColor?`--lui-avatar-status-bg:${this.statusColor};`:""].filter(Boolean).join("")||ol}_emitKeyboardClick(){this.disabled||!this.clickable||this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_renderAvatar(){let e=!!this.src&&!this._imageError,t=this._getInitials(),r=this.alt||this.name||this.text||"avatar",n=this.status!=="none"||!!this.statusColor;return Sn`
|
|
7516
7546
|
<span
|
|
7517
7547
|
class="avatar"
|
|
7518
7548
|
part="base"
|
|
@@ -7729,7 +7759,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7729
7759
|
bottom: 0;
|
|
7730
7760
|
left: 0;
|
|
7731
7761
|
}
|
|
7732
|
-
`],a([
|
|
7762
|
+
`],a([xr()],ut.prototype,"src",2),a([xr()],ut.prototype,"alt",2),a([xr()],ut.prototype,"name",2),a([xr()],ut.prototype,"text",2),a([xr()],ut.prototype,"icon",2),a([xr({reflect:!0})],ut.prototype,"size",2),a([xr({reflect:!0})],ut.prototype,"radius",2),a([xr({reflect:!0})],ut.prototype,"color",2),a([xr({reflect:!0})],ut.prototype,"status",2),a([xr({attribute:"status-color"})],ut.prototype,"statusColor",2),a([xr({reflect:!0,attribute:"status-position"})],ut.prototype,"statusPosition",2),a([xr({type:Boolean,reflect:!0})],ut.prototype,"clickable",2),a([xr({type:Boolean,reflect:!0})],ut.prototype,"disabled",2),a([xr()],ut.prototype,"tooltip",2),a([xr({attribute:"tooltip-placement"})],ut.prototype,"tooltipPlacement",2),a([Xv()],ut.prototype,"_imageError",2),ut=a([Yv("lui-avatar")],ut);import{css as Zv,html as Qo,LitElement as Qv,nothing as td}from"lit";import{customElement as Jv,property as bo,queryAssignedElements as eb,state as tb}from"lit/decorators.js";var At=class extends Qv{constructor(){super(...arguments);this.size="md";this.radius="full";this.max=0;this.overlap=10;this.bordered=!0;this.summaryColor="neutral";this.expandTrigger="hover";this.summaryText="";this.statusPosition="top-right";this._slotHiddenCount=0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this.style.setProperty("--lui-avatar-group-overlap",`${this.overlap}px`)}willUpdate(e){let t=N(this,"avatarGroup");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("overlap")&&typeof t.overlap=="number"&&this.overlap!==t.overlap&&(this.overlap=t.overlap),!this._explicitAttrs.has("bordered")&&typeof t.bordered=="boolean"&&this.bordered!==t.bordered&&(this.bordered=t.bordered),!this._explicitAttrs.has("expand-trigger")&&typeof t.expandTrigger=="string"&&this.expandTrigger!==t.expandTrigger&&(this.expandTrigger=t.expandTrigger)}updated(){this.style.setProperty("--lui-avatar-group-overlap",`${this.overlap}px`),this._syncSlottedAvatars()}disconnectedCallback(){super.disconnectedCallback(),this._restoreSlottedAvatars()}_getVisibleCount(e){return!this.max||this.max<1?e:Math.min(this.max,e)}_syncSlottedAvatars(){if(this.items?.length){this._restoreSlottedAvatars(),this._slotHiddenCount=0;return}let e=this._assignedElements.filter(n=>n.tagName.toLowerCase()==="lui-avatar"),t=this._getVisibleCount(e.length),r=0;e.forEach((n,s)=>{let d=s<t;n.style.display=d?"":"none",n.style.marginInlineStart=d&&s>0?"calc(-1 * var(--lui-avatar-group-overlap))":"",n.style.zIndex=d?String(e.length-s):"",n.style.setProperty("--lui-avatar-size",this._sizeValue()),n.style.setProperty("--lui-avatar-radius",this._radiusValue()),n.style.setProperty("--lui-avatar-ring",this.bordered?"var(--lui-avatar-group-ring)":"none"),n.hasAttribute("status-position")||n.setAttribute("status-position",this.statusPosition),d||(r+=1)}),this._slotHiddenCount=r}_restoreSlottedAvatars(){this._assignedElements?.filter(t=>t.tagName.toLowerCase()==="lui-avatar")?.forEach(t=>{t.style.display="",t.style.marginInlineStart="",t.style.zIndex="",t.style.removeProperty("--lui-avatar-size"),t.style.removeProperty("--lui-avatar-radius"),t.style.removeProperty("--lui-avatar-ring")})}_sizeValue(){switch(this.size){case"xs":return"24px";case"sm":return"32px";case"lg":return"48px";case"xl":return"64px";default:return"40px"}}_radiusValue(){switch(this.radius){case"none":return"0px";case"sm":return"6px";case"md":return"var(--lui-radius-sm)";case"lg":return"var(--lui-radius)";default:return"var(--lui-radius-full)"}}_avatarStyle(e,t,r=!0){return[`margin-inline-start:${r&&e>0?"calc(-1 * var(--lui-avatar-group-overlap))":"0"}`,`z-index:${t-e}`,`--lui-avatar-size:${this._sizeValue()}`,`--lui-avatar-radius:${this._radiusValue()}`,`--lui-avatar-ring:${this.bordered?"var(--lui-avatar-group-ring)":"none"}`].join(";")}_itemLabel(e,t="Avatar"){return e.name||e.text||e.alt||e.key?.toString()||t}_renderItemAvatar(e,t,r,n=!0){return Qo`
|
|
7733
7763
|
<lui-avatar
|
|
7734
7764
|
style=${this._avatarStyle(t,r,n)}
|
|
7735
7765
|
.src=${e.src??""}
|
|
@@ -7839,7 +7869,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
7839
7869
|
font-size: var(--lui-font-size-xs);
|
|
7840
7870
|
color: var(--lui-color-muted);
|
|
7841
7871
|
}
|
|
7842
|
-
`],a([bo({reflect:!0})],At.prototype,"size",2),a([bo({reflect:!0})],At.prototype,"radius",2),a([bo({type:Number})],At.prototype,"max",2),a([bo({type:Number})],At.prototype,"overlap",2),a([bo({type:Number})],At.prototype,"total",2),a([bo({attribute:!1})],At.prototype,"items",2),a([bo({type:Boolean})],At.prototype,"bordered",2),a([bo({reflect:!0})],At.prototype,"summaryColor",2),a([bo({reflect:!0,attribute:"expand-trigger"})],At.prototype,"expandTrigger",2),a([bo({attribute:"summary-text"})],At.prototype,"summaryText",2),a([bo({reflect:!0,attribute:"status-position"})],At.prototype,"statusPosition",2),a([eb({flatten:!0})],At.prototype,"_assignedElements",2),a([tb()],At.prototype,"_slotHiddenCount",2),At=a([Jv("lui-avatar-group")],At);import{css as vb,html as Tn,LitElement as bb,nothing as An}from"lit";typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var rb=typeof document<"u"&&!!document.documentMode,rd;function ob(){return rd||(rd=document.createElement("div").style)}var o1=["webkit","moz","ms"],il={};function ld(i){if(il[i])return il[i];let o=ob();if(i in o)return il[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=o1.length;for(;t--;){let r=`${o1[t]}${e}`;if(r in o)return il[i]=r}}function nl(i,o){return parseFloat(o[ld(i)])||0}function al(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:nl(`${o}Left${t}`,e),right:nl(`${o}Right${t}`,e),top:nl(`${o}Top${t}`,e),bottom:nl(`${o}Bottom${t}`,e)}}function $n(i,o,e){i.style[ld(o)]=e}function ib(i,o){let e=ld("transform");$n(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function nb(i,{x:o,y:e,scale:t,isSVG:r},n){if($n(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&rb){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function od(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:al(i,"margin",e),border:al(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:al(o,"padding",t),border:al(o,"border",t)}}}var Ha={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Ha={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Ha={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function id(i,o,e,t){Ha[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function nd(i,o,e){Ha[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function n1(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function sd(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,sd(i,t);return}e=n1(i,o),e>-1&&i.splice(e,1),i.push(o)}function ab(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=n1(i,o);e>-1&&i.splice(e,1)}function i1(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function ad(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function sb(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function lb(i){return(i.getAttribute("class")||"").trim()}function cb(i,o){return i.nodeType===1&&` ${lb(i)} `.indexOf(` ${o} `)>-1}function db(i,o){for(let e=i;e!=null;e=e.parentNode)if(cb(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var ub=/^http:[\w\.\/]+svg$/;function hb(i){return ub.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function pb(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var a1={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function cd(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!sb(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...a1,...o};let e=hb(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,$n(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",$n(i,"transformOrigin","")}function n(L={}){for(let J in L)L.hasOwnProperty(J)&&(o[J]=L[J]);(L.hasOwnProperty("cursor")||L.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),L.hasOwnProperty("overflow")&&(t.style.overflow=L.overflow),L.hasOwnProperty("touchAction")&&(t.style.touchAction=L.touchAction,i.style.touchAction=L.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(L,J,he){if(he.silent)return;let Oe=new CustomEvent(L,{detail:J});i.dispatchEvent(Oe)}function x(L,J,he){let Oe={x:s,y:d,scale:h,isSVG:e,originalEvent:he};return requestAnimationFrame(()=>{typeof J.animate=="boolean"&&(J.animate?ib(i,J):$n(i,"transition","none")),J.setTransform(i,Oe,J),f(L,Oe,J),f("panzoomchange",Oe,J)}),Oe}function k(L,J,he,Oe){let X={...o,...Oe},_e={x:s,y:d,opts:X};if(!Oe?.force&&(X.disablePan||X.panOnlyWhenZoomed&&h===X.startScale))return _e;if(L=parseFloat(L),J=parseFloat(J),X.disableXAxis||(_e.x=(X.relative?s:0)+L),X.disableYAxis||(_e.y=(X.relative?d:0)+J),X.contain){let ae=od(i),Ar=ae.elem.width/h,K=ae.elem.height/h,si=Ar*he,so=K*he,Xr=(si-Ar)/2,lo=(so-K)/2;if(X.contain==="inside"){let li=(-ae.elem.margin.left-ae.parent.padding.left+Xr)/he,Bo=(ae.parent.width-si-ae.parent.padding.left-ae.elem.margin.left-ae.parent.border.left-ae.parent.border.right+Xr)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let co=(-ae.elem.margin.top-ae.parent.padding.top+lo)/he,ln=(ae.parent.height-so-ae.parent.padding.top-ae.elem.margin.top-ae.parent.border.top-ae.parent.border.bottom+lo)/he;_e.y=Math.max(Math.min(_e.y,ln),co)}else if(X.contain==="outside"){let li=(-(si-ae.parent.width)-ae.parent.padding.left-ae.parent.border.left-ae.parent.border.right+Xr)/he,Bo=(Xr-ae.parent.padding.left)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let co=(-(so-ae.parent.height)-ae.parent.padding.top-ae.parent.border.top-ae.parent.border.bottom+lo)/he,ln=(lo-ae.parent.padding.top)/he;_e.y=Math.max(Math.min(_e.y,ln),co)}}return X.roundPixels&&(_e.x=Math.round(_e.x),_e.y=Math.round(_e.y)),_e}function C(L,J){let he={...o,...J},Oe={scale:h,opts:he};if(!J?.force&&he.disableZoom)return Oe;let X=o.minScale,_e=o.maxScale;if(he.contain){let ae=od(i),Ar=ae.elem.width/h,K=ae.elem.height/h;if(Ar>1&&K>1){let si=ae.parent.width-ae.parent.border.left-ae.parent.border.right,so=ae.parent.height-ae.parent.border.top-ae.parent.border.bottom,Xr=si/Ar,lo=so/K;o.contain==="inside"?_e=Math.min(_e,Xr,lo):o.contain==="outside"&&(X=Math.max(X,Xr,lo))}}return Oe.scale=Math.min(Math.max(L,X),_e),Oe}function S(L,J,he,Oe){let X=k(L,J,h,he);return s!==X.x||d!==X.y?(s=X.x,d=X.y,x("panzoompan",X.opts,Oe)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Oe}}function z(L,J,he){let Oe=C(L,J),X=Oe.opts;if(!J?.force&&X.disableZoom)return;L=Oe.scale;let _e=s,ae=d;if(X.focal){let K=X.focal;_e=(K.x/L-K.x/h+s*L)/L,ae=(K.y/L-K.y/h+d*L)/L}let Ar=k(_e,ae,L,{relative:!1,force:!0});return s=Ar.x,d=Ar.y,h=L,x("panzoomzoom",X,he)}function T(L,J){let he={...o,animate:!0,...J};return z(h*Math.exp((L?1:-1)*he.step),he)}function P(L){return T(!0,L)}function H(L){return T(!1,L)}function R(L,J,he,Oe){let X=od(i),_e={width:X.parent.width-X.parent.padding.left-X.parent.padding.right-X.parent.border.left-X.parent.border.right,height:X.parent.height-X.parent.padding.top-X.parent.padding.bottom-X.parent.border.top-X.parent.border.bottom},ae=J.clientX-X.parent.left-X.parent.padding.left-X.parent.border.left-X.elem.margin.left,Ar=J.clientY-X.parent.top-X.parent.padding.top-X.parent.border.top-X.elem.margin.top;e||(ae-=X.elem.width/h/2,Ar-=X.elem.height/h/2);let K={x:ae/_e.width*(_e.width*L),y:Ar/_e.height*(_e.height*L)};return z(L,{...he,animate:!1,focal:K},Oe)}function F(L,J){L.preventDefault();let he={...o,...J,animate:!1},X=(L.deltaY===0&&L.deltaX?L.deltaX:L.deltaY)<0?1:-1,_e=C(h*Math.exp(X*he.step/3),he).scale;return R(_e,L,he,L)}function $(L){let J={...o,animate:!0,force:!0,...L};h=C(J.startScale,J).scale;let he=k(J.startX,J.startY,h,J);return s=he.x,d=he.y,x("panzoomreset",J)}let Q,fe,Te,et,we,no,Ne=[];function Zt(L){if(db(L.target,o))return;sd(Ne,L),p=!0,o.handleStartEvent(L),Q=s,fe=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o);let J=i1(Ne);Te=J.clientX,et=J.clientY,we=h,no=ad(Ne)}function hr(L){if(!p||Q===void 0||fe===void 0||Te===void 0||et===void 0)return;sd(Ne,L);let J=i1(Ne),he=Ne.length>1,Oe=h;if(he){no===0&&(no=ad(Ne));let X=ad(Ne)-no;Oe=C(X*o.step/80+we).scale,R(Oe,J,{animate:!1},L)}(!he||o.pinchAndPan)&&S(Q+(J.clientX-Te)/Oe,fe+(J.clientY-et)/Oe,{animate:!1},L)}function ao(L){Ne.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o),ab(Ne,L),p&&(p=!1,Q=fe=Te=et=void 0)}let sn=!1;function Yr(){sn||(sn=!0,id("down",o.canvas?t:i,Zt),id("move",document,hr,{passive:!0}),id("up",document,ao,{passive:!0}))}function Ao(){sn=!1,nd("down",o.canvas?t:i,Zt),nd("move",document,hr),nd("up",document,ao)}return o.noBind||Yr(),{bind:Yr,destroy:Ao,eventNames:Ha,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>pb(o),handleDown:Zt,handleMove:hr,handleUp:ao,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(L,J)=>$n(i,L,J),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:R,zoomWithWheel:F}}cd.defaultOptions=a1;import{customElement as yb,property as rr,query as dd,state as Pn}from"lit/decorators.js";import{css as mb,html as Ki,LitElement as gb,nothing as s1}from"lit";import{customElement as fb,property as Io}from"lit/decorators.js";var l1={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function sl(i){return i==null||i===""?"":mt(i)}var tr=class extends gb{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=N(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${sl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${sl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):s1}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?sl(r):this.width!=null&&t===1?sl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return Ki`
|
|
7872
|
+
`],a([bo({reflect:!0})],At.prototype,"size",2),a([bo({reflect:!0})],At.prototype,"radius",2),a([bo({type:Number})],At.prototype,"max",2),a([bo({type:Number})],At.prototype,"overlap",2),a([bo({type:Number})],At.prototype,"total",2),a([bo({attribute:!1})],At.prototype,"items",2),a([bo({type:Boolean})],At.prototype,"bordered",2),a([bo({reflect:!0})],At.prototype,"summaryColor",2),a([bo({reflect:!0,attribute:"expand-trigger"})],At.prototype,"expandTrigger",2),a([bo({attribute:"summary-text"})],At.prototype,"summaryText",2),a([bo({reflect:!0,attribute:"status-position"})],At.prototype,"statusPosition",2),a([eb({flatten:!0})],At.prototype,"_assignedElements",2),a([tb()],At.prototype,"_slotHiddenCount",2),At=a([Jv("lui-avatar-group")],At);import{css as vb,html as Tn,LitElement as bb,nothing as An}from"lit";typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var rb=typeof document<"u"&&!!document.documentMode,rd;function ob(){return rd||(rd=document.createElement("div").style)}var o1=["webkit","moz","ms"],il={};function ld(i){if(il[i])return il[i];let o=ob();if(i in o)return il[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=o1.length;for(;t--;){let r=`${o1[t]}${e}`;if(r in o)return il[i]=r}}function nl(i,o){return parseFloat(o[ld(i)])||0}function al(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:nl(`${o}Left${t}`,e),right:nl(`${o}Right${t}`,e),top:nl(`${o}Top${t}`,e),bottom:nl(`${o}Bottom${t}`,e)}}function $n(i,o,e){i.style[ld(o)]=e}function ib(i,o){let e=ld("transform");$n(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function nb(i,{x:o,y:e,scale:t,isSVG:r},n){if($n(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&rb){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function od(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:al(i,"margin",e),border:al(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:al(o,"padding",t),border:al(o,"border",t)}}}var Ha={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Ha={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Ha={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function id(i,o,e,t){Ha[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function nd(i,o,e){Ha[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function n1(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function sd(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,sd(i,t);return}e=n1(i,o),e>-1&&i.splice(e,1),i.push(o)}function ab(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=n1(i,o);e>-1&&i.splice(e,1)}function i1(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function ad(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function sb(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function lb(i){return(i.getAttribute("class")||"").trim()}function cb(i,o){return i.nodeType===1&&` ${lb(i)} `.indexOf(` ${o} `)>-1}function db(i,o){for(let e=i;e!=null;e=e.parentNode)if(cb(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var ub=/^http:[\w\.\/]+svg$/;function hb(i){return ub.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function pb(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var a1={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function cd(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!sb(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...a1,...o};let e=hb(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,$n(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",$n(i,"transformOrigin","")}function n(L={}){for(let J in L)L.hasOwnProperty(J)&&(o[J]=L[J]);(L.hasOwnProperty("cursor")||L.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),L.hasOwnProperty("overflow")&&(t.style.overflow=L.overflow),L.hasOwnProperty("touchAction")&&(t.style.touchAction=L.touchAction,i.style.touchAction=L.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(L,J,he){if(he.silent)return;let Oe=new CustomEvent(L,{detail:J});i.dispatchEvent(Oe)}function x(L,J,he){let Oe={x:s,y:d,scale:h,isSVG:e,originalEvent:he};return requestAnimationFrame(()=>{typeof J.animate=="boolean"&&(J.animate?ib(i,J):$n(i,"transition","none")),J.setTransform(i,Oe,J),f(L,Oe,J),f("panzoomchange",Oe,J)}),Oe}function k(L,J,he,Oe){let X={...o,...Oe},_e={x:s,y:d,opts:X};if(!Oe?.force&&(X.disablePan||X.panOnlyWhenZoomed&&h===X.startScale))return _e;if(L=parseFloat(L),J=parseFloat(J),X.disableXAxis||(_e.x=(X.relative?s:0)+L),X.disableYAxis||(_e.y=(X.relative?d:0)+J),X.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h,si=Tr*he,so=K*he,Xr=(si-Tr)/2,lo=(so-K)/2;if(X.contain==="inside"){let li=(-ae.elem.margin.left-ae.parent.padding.left+Xr)/he,Bo=(ae.parent.width-si-ae.parent.padding.left-ae.elem.margin.left-ae.parent.border.left-ae.parent.border.right+Xr)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let co=(-ae.elem.margin.top-ae.parent.padding.top+lo)/he,ln=(ae.parent.height-so-ae.parent.padding.top-ae.elem.margin.top-ae.parent.border.top-ae.parent.border.bottom+lo)/he;_e.y=Math.max(Math.min(_e.y,ln),co)}else if(X.contain==="outside"){let li=(-(si-ae.parent.width)-ae.parent.padding.left-ae.parent.border.left-ae.parent.border.right+Xr)/he,Bo=(Xr-ae.parent.padding.left)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let co=(-(so-ae.parent.height)-ae.parent.padding.top-ae.parent.border.top-ae.parent.border.bottom+lo)/he,ln=(lo-ae.parent.padding.top)/he;_e.y=Math.max(Math.min(_e.y,ln),co)}}return X.roundPixels&&(_e.x=Math.round(_e.x),_e.y=Math.round(_e.y)),_e}function C(L,J){let he={...o,...J},Oe={scale:h,opts:he};if(!J?.force&&he.disableZoom)return Oe;let X=o.minScale,_e=o.maxScale;if(he.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h;if(Tr>1&&K>1){let si=ae.parent.width-ae.parent.border.left-ae.parent.border.right,so=ae.parent.height-ae.parent.border.top-ae.parent.border.bottom,Xr=si/Tr,lo=so/K;o.contain==="inside"?_e=Math.min(_e,Xr,lo):o.contain==="outside"&&(X=Math.max(X,Xr,lo))}}return Oe.scale=Math.min(Math.max(L,X),_e),Oe}function S(L,J,he,Oe){let X=k(L,J,h,he);return s!==X.x||d!==X.y?(s=X.x,d=X.y,x("panzoompan",X.opts,Oe)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Oe}}function z(L,J,he){let Oe=C(L,J),X=Oe.opts;if(!J?.force&&X.disableZoom)return;L=Oe.scale;let _e=s,ae=d;if(X.focal){let K=X.focal;_e=(K.x/L-K.x/h+s*L)/L,ae=(K.y/L-K.y/h+d*L)/L}let Tr=k(_e,ae,L,{relative:!1,force:!0});return s=Tr.x,d=Tr.y,h=L,x("panzoomzoom",X,he)}function T(L,J){let he={...o,animate:!0,...J};return z(h*Math.exp((L?1:-1)*he.step),he)}function P(L){return T(!0,L)}function H(L){return T(!1,L)}function R(L,J,he,Oe){let X=od(i),_e={width:X.parent.width-X.parent.padding.left-X.parent.padding.right-X.parent.border.left-X.parent.border.right,height:X.parent.height-X.parent.padding.top-X.parent.padding.bottom-X.parent.border.top-X.parent.border.bottom},ae=J.clientX-X.parent.left-X.parent.padding.left-X.parent.border.left-X.elem.margin.left,Tr=J.clientY-X.parent.top-X.parent.padding.top-X.parent.border.top-X.elem.margin.top;e||(ae-=X.elem.width/h/2,Tr-=X.elem.height/h/2);let K={x:ae/_e.width*(_e.width*L),y:Tr/_e.height*(_e.height*L)};return z(L,{...he,animate:!1,focal:K},Oe)}function F(L,J){L.preventDefault();let he={...o,...J,animate:!1},X=(L.deltaY===0&&L.deltaX?L.deltaX:L.deltaY)<0?1:-1,_e=C(h*Math.exp(X*he.step/3),he).scale;return R(_e,L,he,L)}function $(L){let J={...o,animate:!0,force:!0,...L};h=C(J.startScale,J).scale;let he=k(J.startX,J.startY,h,J);return s=he.x,d=he.y,x("panzoomreset",J)}let Q,fe,Te,et,we,no,Ne=[];function Zt(L){if(db(L.target,o))return;sd(Ne,L),p=!0,o.handleStartEvent(L),Q=s,fe=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o);let J=i1(Ne);Te=J.clientX,et=J.clientY,we=h,no=ad(Ne)}function hr(L){if(!p||Q===void 0||fe===void 0||Te===void 0||et===void 0)return;sd(Ne,L);let J=i1(Ne),he=Ne.length>1,Oe=h;if(he){no===0&&(no=ad(Ne));let X=ad(Ne)-no;Oe=C(X*o.step/80+we).scale,R(Oe,J,{animate:!1},L)}(!he||o.pinchAndPan)&&S(Q+(J.clientX-Te)/Oe,fe+(J.clientY-et)/Oe,{animate:!1},L)}function ao(L){Ne.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o),ab(Ne,L),p&&(p=!1,Q=fe=Te=et=void 0)}let sn=!1;function Yr(){sn||(sn=!0,id("down",o.canvas?t:i,Zt),id("move",document,hr,{passive:!0}),id("up",document,ao,{passive:!0}))}function Ao(){sn=!1,nd("down",o.canvas?t:i,Zt),nd("move",document,hr),nd("up",document,ao)}return o.noBind||Yr(),{bind:Yr,destroy:Ao,eventNames:Ha,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>pb(o),handleDown:Zt,handleMove:hr,handleUp:ao,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(L,J)=>$n(i,L,J),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:R,zoomWithWheel:F}}cd.defaultOptions=a1;import{customElement as yb,property as rr,query as dd,state as Pn}from"lit/decorators.js";import{css as mb,html as Ki,LitElement as gb,nothing as s1}from"lit";import{customElement as fb,property as Io}from"lit/decorators.js";var l1={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function sl(i){return i==null||i===""?"":mt(i)}var tr=class extends gb{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=N(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${sl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${sl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):s1}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?sl(r):this.width!=null&&t===1?sl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return Ki`
|
|
7843
7873
|
<div class="text" part="text">
|
|
7844
7874
|
${Array.from({length:t},(r,n)=>Ki`
|
|
7845
7875
|
<div class="piece line" part="line" style=${`width:${this._lineWidth(n,t)}`}></div>
|
|
@@ -8293,7 +8323,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
8293
8323
|
border-radius: var(--lui-radius-lg);
|
|
8294
8324
|
}
|
|
8295
8325
|
}
|
|
8296
|
-
`],a([rr()],Pe.prototype,"src",2),a([rr({attribute:"preview-src"})],Pe.prototype,"previewSrc",2),a([rr()],Pe.prototype,"alt",2),a([rr({attribute:"fallback-src"})],Pe.prototype,"fallbackSrc",2),a([rr()],Pe.prototype,"fallback",2),a([rr({reflect:!0})],Pe.prototype,"fit",2),a([rr({reflect:!0})],Pe.prototype,"radius",2),a([rr()],Pe.prototype,"width",2),a([rr()],Pe.prototype,"height",2),a([rr({attribute:"aspect-ratio"})],Pe.prototype,"aspectRatio",2),a([rr()],Pe.prototype,"position",2),a([rr({reflect:!0})],Pe.prototype,"loading",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"skeleton",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"preview",2),a([rr({type:Boolean,attribute:"show-preview-icon"})],Pe.prototype,"showPreviewIcon",2),a([rr({type:Boolean})],Pe.prototype,"draggablePreview",2),a([Pn()],Pe.prototype,"_loaded",2),a([Pn()],Pe.prototype,"_errored",2),a([Pn()],Pe.prototype,"_previewOpen",2),a([Pn()],Pe.prototype,"_zoom",2),a([Pn()],Pe.prototype,"_rotate",2),a([Pn()],Pe.prototype,"_panning",2),a([dd(".preview-image")],Pe.prototype,"_previewImageEl",2),a([dd(".preview-panzoom")],Pe.prototype,"_previewPanzoomEl",2),a([dd(".preview-stage")],Pe.prototype,"_previewStageEl",2),Pe=a([yb("lui-image")],Pe);import{css as Kb,html as Bn,LitElement as Wb,nothing as Na}from"lit";import{customElement as Ub,property as Mo,query as R1,state as pl}from"lit/decorators.js";var Ra=typeof window<"u"&&typeof window.document<"u",Or=Ra?window:{},ud=Ra?"ontouchstart"in Or.document.documentElement:!1,hd=Ra?"PointerEvent"in Or:!1,Ci="cropper",eo=`${Ci}-canvas`,u1=`${Ci}-crosshair`,h1=`${Ci}-grid`,p1=`${Ci}-handle`,yo=`${Ci}-image`,_r=`${Ci}-selection`,m1=`${Ci}-shade`,g1=`${Ci}-viewer`,jn="select",ll="move",Jo="scale",Ia="rotate",On="transform",ko="none",pd="n-resize",md="e-resize",gd="s-resize",fd="w-resize",Hn="ne-resize",Rn="nw-resize",In="se-resize",Vn="sw-resize",f1="action",kb=ud?"touchend touchcancel":"mouseup",xb=ud?"touchmove":"mousemove",wb=ud?"touchstart":"mousedown",vd=hd?"pointerdown":wb,bd=hd?"pointermove":xb,yd=hd?"pointerup pointercancel":kb,kd="error",xd="keydown",zi="load",wd="resize",_d="wheel",ei="action",xo="actionend",v1="actionmove",wo="actionstart",_o="change",Va="transform";function Dn(i){return typeof i=="string"}var Md=Number.isNaN||Or.isNaN;function ge(i){return typeof i=="number"&&!Md(i)}function or(i){return ge(i)&&i>0&&i<1/0}function b1(i){return typeof i>"u"}function Cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:_b}=Object.prototype;function Nn(i){if(!Cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&_b.call(e,"isPrototypeOf")}catch{return!1}}function Fn(i){return typeof i=="function"}function ti(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Mb=/([a-z\d])([A-Z])/g;function zd(i){return String(i).replace(Mb,"$1-$2").toLowerCase()}var Cb=/-[A-z\d]/g;function Ed(i){return i.replace(Cb,o=>o.slice(1).toUpperCase())}var y1=/\s\s*/;function Be(i,o,e,t){o.trim().split(y1).forEach(r=>{i.removeEventListener(r,e,t)})}function We(i,o,e,t){o.trim().split(y1).forEach(r=>{i.addEventListener(r,e,t)})}function Sd(i,o,e,t){We(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var zb={bubbles:!0,cancelable:!0,composed:!0};function k1(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},zb),{detail:e}),t)))}function x1(i){return typeof i.composedPath=="function"&&i.composedPath().find(ti)||i.target}var c1=Promise.resolve();function w1(i,o){return o?c1.then(i?o.bind(i):o):c1}function cl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function $d(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+(Or.pageXOffset-o.clientLeft),top:e.top+(Or.pageYOffset-o.clientTop)}}var Eb=/deg|g?rad|turn$/i;function dl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(Eb)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var d1="contain",Sb="cover";function Ln(i,o=d1){let{aspectRatio:e}=i,{width:t,height:r}=i,n=or(t),s=or(r);if(n&&s){let d=r*e;o===d1&&d>t||o===Sb&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function Td(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],Td(i,...o.slice(1))}var $b=":host([hidden]){display:none!important}",Tb=/left|top|width|height/i,_1="open",ul=new WeakMap,hl=new WeakMap,M1=new Map,C1=Or.document&&Array.isArray(Or.document.adoptedStyleSheets)&&"replaceSync"in Or.CSSStyleSheet.prototype,Mt=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${$b}`}constructor(){var o,e;super(),this.shadowRootMode=_1,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&M1.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=Ed(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=hl.get(this),h=this.$sharedStyle;d&&h&&(C1?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=zd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":Md(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=Ed(e),r=this[t];b1(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||_1});if(ul.set(this,o),hl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){hl.has(this)&&hl.delete(this),ul.has(this)&&ul.delete(this)}$getTagNameOf(o){var e;return(e=M1.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];ge(t)&&(t!==0&&Tb.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||ul.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return C1?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return k1(this,o,e,t)}$nextTick(o){return w1(this,o)}static $define(o,e){Cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=zd(o),Ra&&Or.customElements&&!Or.customElements.get(o)&&customElements.define(o,this,e)}};Mt.$version="2.1.1";var Ab=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',Wi=class extends Mt{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=Ab,this.$action=ko,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),We(this,vd,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),We(this.ownerDocument,bd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),We(this.ownerDocument,yd,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),We(this,_d,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(Be(this,vd,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(Be(this.ownerDocument,bd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(Be(this.ownerDocument,yd,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(Be(this,_d,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(ge(e)&&e!==1||ge(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=On:ti(o.target)&&(s=o.target.action||o.target.getAttribute(f1)||""),this.$emit(wo,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===ko||t.size===0||this.$emit(v1,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===On){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,R=T.endX-S.endX,F=T.endY-S.endY,$=0,Q=0,fe=0,Te=0;if(P===0?H<0?fe=Math.PI*2:H>0&&(fe=Math.PI):P>0?fe=Math.PI/2+Math.atan(H/P):P<0&&(fe=Math.PI*1.5+Math.atan(H/P)),R===0?F<0?Te=Math.PI*2:F>0&&(Te=Math.PI):R>0?Te=Math.PI/2+Math.atan(F/R):R<0&&(Te=Math.PI*1.5+Math.atan(F/R)),Te>0||fe>0){let et=Te-fe,we=Math.abs(et);we>s&&(s=we,h=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),R=Math.abs(R),F=Math.abs(F),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),R>0&&F>0?Q=Math.sqrt(R*R+F*F):R>0?Q=R:F>0&&(Q=F),$>0&&Q>0){let et=(Q-$)/$,we=Math.abs(et);we>d&&(d=we,p=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=Ia,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Jo,r.scale=p,r.centerX=f,r.centerY=x):r.action=ko}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==ko&&this.$emit(ei,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===ko)&&this.$emit(xo,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=ko)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(ei,{action:Jo,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return Dn(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;Nn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(yo));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,R=p.naturalWidth,F=p.naturalHeight;d!==1&&(P*=d,H*=d,R*=d,F*=d);let $=R/2,Q=F/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Nn(o)&&Fn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,R,F),f.restore()}e(r)}).catch(t)})}};Wi.$name=eo;Wi.$version="2.1.1";var Pb=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",z1=new WeakMap,E1=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Ui=class extends Mt{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=Pb,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){z1.set(this,o)}get $canvas(){return z1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(E1,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),E1.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(eo));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),We(e,wo,this.$onCanvasActionStart),We(e,xo,this.$onCanvasActionEnd),We(e,ei,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),We(o,zi,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(Be(e,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(e,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(e,ei,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(Be(o,zi,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===On&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=Ia:this.scalable?n=Jo:n=ko),n){case ll:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(_r))),s||(s=e.querySelector(this.$getTagNameOf(_r))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(_r)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case Ia:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Jo:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(_r));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case On:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,R,F]=this.$matrix,$=S.width/2,Q=S.height/2,fe=z-$,Te=T-Q,et=(fe*F-R*Te)/(P*F-R*H),we=(Te*P-H*fe)/(P*F-R*H);this.$transform(f,x,k,C,et*(1-f)+we*k,we*(1-C)+et*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{Be(e,kd,h),setTimeout(()=>{r(e)})},h=()=>{Be(e,zi,d),n(s)};Sd(e,zi,d),Sd(e,kd,h)}});return Fn(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=dl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(ge(e)&&ge(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,R=e-P,F=t-H,$=(R*S-C*F)/(x*S-C*k),Q=(F*x-k*R)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,ge(e)&&ge(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=dl(o),r=dl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&ge(o)&&ge(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s)?this.$setTransform(Td(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(Va,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Ui.$name=yo;Ui.$version="2.1.1";var jb=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",S1=new WeakMap,Gi=class extends Mt{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=jb,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){S1.set(this,o)}get $canvas(){return S1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(eo));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(_r));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},We(window,wd,this.$onWindowResize),We(o,wo,this.$onCanvasActionStart),We(o,xo,this.$onCanvasActionEnd),We(o,_o,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(Be(window,wd,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(Be(o,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(Be(o,_o,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!ge(o)||!ge(e)||!ge(t)||!ge(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:Or.innerWidth*Or.devicePixelRatio})}};Gi.$name=m1;Gi.$version="2.1.1";var Ob=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',Yi=class extends Mt{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=Ob,this.action=ko,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};Yi.$name=p1;Yi.$version="2.1.1";var Hb=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',$1=new WeakMap,Xi=class extends Mt{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=Hb,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){$1.set(this,o)}get $canvas(){return $1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{or(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),We(this.ownerDocument,xd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(Be(this.ownerDocument,xd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(_o,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(eo));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),We(o,wo,this.$onCanvasActionStart),We(o,xo,this.$onCanvasActionEnd),We(o,ei,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(Be(o,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(o,ei,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(_r)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(or(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;or(n)&&({width:s,height:d}=Ln({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(_o,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(_o,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?x1(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==jn||this.multiple&&!this.active&&n!==Jo)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!or(x)&&r.shiftKey&&(x=or(d)&&or(h)?d/h:1),n){case jn:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=$d(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=Rn:f>0&&(n=Vn):p>0&&(f<0?n=Hn:f>0&&(n=In)),k&&(k.$action=n)}break;case ll:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Jo:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=$d(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=or(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case pd:h+=t,f-=t,f<0&&(o=gd,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case md:p+=e,p<0&&(o=fd,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case gd:f+=t,f<0&&(o=pd,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case fd:d+=e,p-=e,p<0&&(o=md,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case Hn:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=Vn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Rn,p=-p,d-=p):f<0&&(o=In,f=-f,h-=f);break;case Rn:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=In,p=-p,f=-f,d-=p,h-=f):p<0?(o=Hn,p=-p,d-=p):f<0&&(o=Vn,f=-f,h-=f);break;case In:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=Rn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Vn,p=-p,d-=p):f<0&&(o=Hn,f=-f,h-=f);break;case Vn:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=Hn,p=-p,f=-f,d-=p,h-=f):p<0?(o=In,p=-p,d-=p):f<0&&(o=Rn,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return ge(e)&&ge(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!ge(o)||!ge(e)||!ge(t)||!ge(r)||t<0||r<0?this:(or(n)&&({width:t,height:r}=Ln({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(_o,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(Nn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(yo));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,R=(P*S-C*H)/(x*S-C*k),F=(H*x-k*P)/(x*S-C*k),$=x*R+C*F+z,Q=k*R+S*F+T,fe=p.naturalWidth,Te=p.naturalHeight;d!==1&&($*=d,Q*=d,fe*=d,Te*=d);let et=fe/2,we=Te/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Nn(o)&&Fn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(et,we),f.transform(x,k,C,S,$,Q),f.translate(-et,-we),f.drawImage(p,0,0,fe,Te),f.restore()}e(r)}).catch(t)})}};Xi.$name=_r;Xi.$version="2.1.1";var Rb=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Zi=class extends Mt{constructor(){super(...arguments),this.$style=Rb,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Zi.$name=h1;Zi.$version="2.1.1";var Ib=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',Qi=class extends Mt{constructor(){super(...arguments),this.$style=Ib,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};Qi.$name=u1;Qi.$version="2.1.1";var Vb=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",T1=new WeakMap,A1=new WeakMap,P1=new WeakMap,j1=new WeakMap,Db="both",Nb="horizontal",O1="vertical",Fb="none",Ji=class extends Mt{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=Vb,this.resize=O1,this.selection="",this.slottable=!1}set $image(o){A1.set(this,o)}get $image(){return A1.get(this)}set $sourceImage(o){j1.set(this,o)}get $sourceImage(){return j1.get(this)}set $canvas(o){T1.set(this,o)}get $canvas(){return T1.get(this)}set $selection(o){P1.set(this,o)}get $selection(){return P1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=cl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(_r)),ti(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),We(t,_o,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(eo));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(yo));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),We(n.$image,zi,this.$onSourceImageLoad),We(n,Va,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(Be(o,_o,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(Be(e.$image,zi,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(Be(e,Va,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case Db:S=1,k=d,C=h,p.width=d,p.height=h;break;case Nb:S=h>0?x/h:0,k=d*S,p.width=k;break;case O1:S=d>0?f/d:0,C=h*S,p.height=C;break;case Fb:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Ji.$name=g1;Ji.$version="2.1.1";var Lb='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',Bb=/^img|canvas$/,qb=/<(\/?(?:script|style)[^>]*)>/gi,H1={template:Lb};Wi.$define();Qi.$define();Zi.$define();Yi.$define();Ui.$define();Xi.$define();Gi.$define();Ji.$define();var Da=class{constructor(o,e){var t;if(this.options=H1,Dn(o)&&(o=document.querySelector(o)),!ti(o)||!Bb.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},H1),e),this.options=e;let{container:r}=e;if(r&&(Dn(r)&&(r=(t=cl(o))===null||t===void 0?void 0:t.querySelector(r)),!ti(r)))throw new Error("The `container` option must be an element or a valid selector.");ti(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&Dn(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(qb,"<$1>"),p.appendChild(h.content),Array.from(p.querySelectorAll(yo)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(eo)}getCropperImage(){return this.container.querySelector(yo)}getCropperSelection(){return this.container.querySelector(_r)}getCropperSelections(){return this.container.querySelectorAll(_r)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};Da.version="2.1.1";function Gb(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function Yb(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var nt=class extends Wb{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await Yb(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return Gb(this.aspectRatio)}_template(){let e=this._ratio;return`
|
|
8326
|
+
`],a([rr()],Pe.prototype,"src",2),a([rr({attribute:"preview-src"})],Pe.prototype,"previewSrc",2),a([rr()],Pe.prototype,"alt",2),a([rr({attribute:"fallback-src"})],Pe.prototype,"fallbackSrc",2),a([rr()],Pe.prototype,"fallback",2),a([rr({reflect:!0})],Pe.prototype,"fit",2),a([rr({reflect:!0})],Pe.prototype,"radius",2),a([rr()],Pe.prototype,"width",2),a([rr()],Pe.prototype,"height",2),a([rr({attribute:"aspect-ratio"})],Pe.prototype,"aspectRatio",2),a([rr()],Pe.prototype,"position",2),a([rr({reflect:!0})],Pe.prototype,"loading",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"skeleton",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"preview",2),a([rr({type:Boolean,attribute:"show-preview-icon"})],Pe.prototype,"showPreviewIcon",2),a([rr({type:Boolean})],Pe.prototype,"draggablePreview",2),a([Pn()],Pe.prototype,"_loaded",2),a([Pn()],Pe.prototype,"_errored",2),a([Pn()],Pe.prototype,"_previewOpen",2),a([Pn()],Pe.prototype,"_zoom",2),a([Pn()],Pe.prototype,"_rotate",2),a([Pn()],Pe.prototype,"_panning",2),a([dd(".preview-image")],Pe.prototype,"_previewImageEl",2),a([dd(".preview-panzoom")],Pe.prototype,"_previewPanzoomEl",2),a([dd(".preview-stage")],Pe.prototype,"_previewStageEl",2),Pe=a([yb("lui-image")],Pe);import{css as Kb,html as Bn,LitElement as Wb,nothing as Na}from"lit";import{customElement as Ub,property as Mo,query as R1,state as pl}from"lit/decorators.js";var Ra=typeof window<"u"&&typeof window.document<"u",Or=Ra?window:{},ud=Ra?"ontouchstart"in Or.document.documentElement:!1,hd=Ra?"PointerEvent"in Or:!1,Ci="cropper",eo=`${Ci}-canvas`,u1=`${Ci}-crosshair`,h1=`${Ci}-grid`,p1=`${Ci}-handle`,yo=`${Ci}-image`,wr=`${Ci}-selection`,m1=`${Ci}-shade`,g1=`${Ci}-viewer`,jn="select",ll="move",Jo="scale",Ia="rotate",On="transform",ko="none",pd="n-resize",md="e-resize",gd="s-resize",fd="w-resize",Hn="ne-resize",Rn="nw-resize",In="se-resize",Vn="sw-resize",f1="action",kb=ud?"touchend touchcancel":"mouseup",xb=ud?"touchmove":"mousemove",wb=ud?"touchstart":"mousedown",vd=hd?"pointerdown":wb,bd=hd?"pointermove":xb,yd=hd?"pointerup pointercancel":kb,kd="error",xd="keydown",zi="load",wd="resize",_d="wheel",ei="action",xo="actionend",v1="actionmove",wo="actionstart",_o="change",Va="transform";function Dn(i){return typeof i=="string"}var Md=Number.isNaN||Or.isNaN;function ge(i){return typeof i=="number"&&!Md(i)}function or(i){return ge(i)&&i>0&&i<1/0}function b1(i){return typeof i>"u"}function Cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:_b}=Object.prototype;function Nn(i){if(!Cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&_b.call(e,"isPrototypeOf")}catch{return!1}}function Fn(i){return typeof i=="function"}function ti(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Mb=/([a-z\d])([A-Z])/g;function zd(i){return String(i).replace(Mb,"$1-$2").toLowerCase()}var Cb=/-[A-z\d]/g;function Ed(i){return i.replace(Cb,o=>o.slice(1).toUpperCase())}var y1=/\s\s*/;function Be(i,o,e,t){o.trim().split(y1).forEach(r=>{i.removeEventListener(r,e,t)})}function We(i,o,e,t){o.trim().split(y1).forEach(r=>{i.addEventListener(r,e,t)})}function Sd(i,o,e,t){We(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var zb={bubbles:!0,cancelable:!0,composed:!0};function k1(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},zb),{detail:e}),t)))}function x1(i){return typeof i.composedPath=="function"&&i.composedPath().find(ti)||i.target}var c1=Promise.resolve();function w1(i,o){return o?c1.then(i?o.bind(i):o):c1}function cl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function $d(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+(Or.pageXOffset-o.clientLeft),top:e.top+(Or.pageYOffset-o.clientTop)}}var Eb=/deg|g?rad|turn$/i;function dl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(Eb)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var d1="contain",Sb="cover";function Ln(i,o=d1){let{aspectRatio:e}=i,{width:t,height:r}=i,n=or(t),s=or(r);if(n&&s){let d=r*e;o===d1&&d>t||o===Sb&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function Td(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],Td(i,...o.slice(1))}var $b=":host([hidden]){display:none!important}",Tb=/left|top|width|height/i,_1="open",ul=new WeakMap,hl=new WeakMap,M1=new Map,C1=Or.document&&Array.isArray(Or.document.adoptedStyleSheets)&&"replaceSync"in Or.CSSStyleSheet.prototype,Mt=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${$b}`}constructor(){var o,e;super(),this.shadowRootMode=_1,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&M1.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=Ed(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=hl.get(this),h=this.$sharedStyle;d&&h&&(C1?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=zd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":Md(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=Ed(e),r=this[t];b1(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||_1});if(ul.set(this,o),hl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){hl.has(this)&&hl.delete(this),ul.has(this)&&ul.delete(this)}$getTagNameOf(o){var e;return(e=M1.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];ge(t)&&(t!==0&&Tb.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||ul.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return C1?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return k1(this,o,e,t)}$nextTick(o){return w1(this,o)}static $define(o,e){Cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=zd(o),Ra&&Or.customElements&&!Or.customElements.get(o)&&customElements.define(o,this,e)}};Mt.$version="2.1.1";var Ab=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',Wi=class extends Mt{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=Ab,this.$action=ko,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),We(this,vd,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),We(this.ownerDocument,bd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),We(this.ownerDocument,yd,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),We(this,_d,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(Be(this,vd,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(Be(this.ownerDocument,bd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(Be(this.ownerDocument,yd,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(Be(this,_d,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(ge(e)&&e!==1||ge(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=On:ti(o.target)&&(s=o.target.action||o.target.getAttribute(f1)||""),this.$emit(wo,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===ko||t.size===0||this.$emit(v1,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===On){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,R=T.endX-S.endX,F=T.endY-S.endY,$=0,Q=0,fe=0,Te=0;if(P===0?H<0?fe=Math.PI*2:H>0&&(fe=Math.PI):P>0?fe=Math.PI/2+Math.atan(H/P):P<0&&(fe=Math.PI*1.5+Math.atan(H/P)),R===0?F<0?Te=Math.PI*2:F>0&&(Te=Math.PI):R>0?Te=Math.PI/2+Math.atan(F/R):R<0&&(Te=Math.PI*1.5+Math.atan(F/R)),Te>0||fe>0){let et=Te-fe,we=Math.abs(et);we>s&&(s=we,h=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),R=Math.abs(R),F=Math.abs(F),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),R>0&&F>0?Q=Math.sqrt(R*R+F*F):R>0?Q=R:F>0&&(Q=F),$>0&&Q>0){let et=(Q-$)/$,we=Math.abs(et);we>d&&(d=we,p=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=Ia,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Jo,r.scale=p,r.centerX=f,r.centerY=x):r.action=ko}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==ko&&this.$emit(ei,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===ko)&&this.$emit(xo,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=ko)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(ei,{action:Jo,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return Dn(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;Nn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(yo));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,R=p.naturalWidth,F=p.naturalHeight;d!==1&&(P*=d,H*=d,R*=d,F*=d);let $=R/2,Q=F/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Nn(o)&&Fn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,R,F),f.restore()}e(r)}).catch(t)})}};Wi.$name=eo;Wi.$version="2.1.1";var Pb=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",z1=new WeakMap,E1=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Ui=class extends Mt{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=Pb,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){z1.set(this,o)}get $canvas(){return z1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(E1,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),E1.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(eo));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),We(e,wo,this.$onCanvasActionStart),We(e,xo,this.$onCanvasActionEnd),We(e,ei,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),We(o,zi,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(Be(e,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(e,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(e,ei,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(Be(o,zi,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===On&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=Ia:this.scalable?n=Jo:n=ko),n){case ll:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(wr))),s||(s=e.querySelector(this.$getTagNameOf(wr))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(wr)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case Ia:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Jo:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(wr));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case On:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,R,F]=this.$matrix,$=S.width/2,Q=S.height/2,fe=z-$,Te=T-Q,et=(fe*F-R*Te)/(P*F-R*H),we=(Te*P-H*fe)/(P*F-R*H);this.$transform(f,x,k,C,et*(1-f)+we*k,we*(1-C)+et*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{Be(e,kd,h),setTimeout(()=>{r(e)})},h=()=>{Be(e,zi,d),n(s)};Sd(e,zi,d),Sd(e,kd,h)}});return Fn(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=dl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(ge(e)&&ge(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,R=e-P,F=t-H,$=(R*S-C*F)/(x*S-C*k),Q=(F*x-k*R)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,ge(e)&&ge(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=dl(o),r=dl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&ge(o)&&ge(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s)?this.$setTransform(Td(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(Va,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Ui.$name=yo;Ui.$version="2.1.1";var jb=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",S1=new WeakMap,Gi=class extends Mt{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=jb,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){S1.set(this,o)}get $canvas(){return S1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(eo));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(wr));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},We(window,wd,this.$onWindowResize),We(o,wo,this.$onCanvasActionStart),We(o,xo,this.$onCanvasActionEnd),We(o,_o,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(Be(window,wd,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(Be(o,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(Be(o,_o,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!ge(o)||!ge(e)||!ge(t)||!ge(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:Or.innerWidth*Or.devicePixelRatio})}};Gi.$name=m1;Gi.$version="2.1.1";var Ob=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',Yi=class extends Mt{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=Ob,this.action=ko,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};Yi.$name=p1;Yi.$version="2.1.1";var Hb=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',$1=new WeakMap,Xi=class extends Mt{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=Hb,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){$1.set(this,o)}get $canvas(){return $1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{or(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),We(this.ownerDocument,xd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(Be(this.ownerDocument,xd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(_o,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(eo));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),We(o,wo,this.$onCanvasActionStart),We(o,xo,this.$onCanvasActionEnd),We(o,ei,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(Be(o,wo,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,xo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(o,ei,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(wr)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(or(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;or(n)&&({width:s,height:d}=Ln({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(_o,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(_o,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?x1(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==jn||this.multiple&&!this.active&&n!==Jo)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!or(x)&&r.shiftKey&&(x=or(d)&&or(h)?d/h:1),n){case jn:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=$d(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=Rn:f>0&&(n=Vn):p>0&&(f<0?n=Hn:f>0&&(n=In)),k&&(k.$action=n)}break;case ll:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Jo:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=$d(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=or(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case pd:h+=t,f-=t,f<0&&(o=gd,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case md:p+=e,p<0&&(o=fd,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case gd:f+=t,f<0&&(o=pd,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case fd:d+=e,p-=e,p<0&&(o=md,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case Hn:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=Vn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Rn,p=-p,d-=p):f<0&&(o=In,f=-f,h-=f);break;case Rn:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=In,p=-p,f=-f,d-=p,h-=f):p<0?(o=Hn,p=-p,d-=p):f<0&&(o=Vn,f=-f,h-=f);break;case In:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=Rn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Vn,p=-p,d-=p):f<0&&(o=Hn,f=-f,h-=f);break;case Vn:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=Hn,p=-p,f=-f,d-=p,h-=f):p<0?(o=In,p=-p,d-=p):f<0&&(o=Rn,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return ge(e)&&ge(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!ge(o)||!ge(e)||!ge(t)||!ge(r)||t<0||r<0?this:(or(n)&&({width:t,height:r}=Ln({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(_o,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(Nn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(yo));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,R=(P*S-C*H)/(x*S-C*k),F=(H*x-k*P)/(x*S-C*k),$=x*R+C*F+z,Q=k*R+S*F+T,fe=p.naturalWidth,Te=p.naturalHeight;d!==1&&($*=d,Q*=d,fe*=d,Te*=d);let et=fe/2,we=Te/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Nn(o)&&Fn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(et,we),f.transform(x,k,C,S,$,Q),f.translate(-et,-we),f.drawImage(p,0,0,fe,Te),f.restore()}e(r)}).catch(t)})}};Xi.$name=wr;Xi.$version="2.1.1";var Rb=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Zi=class extends Mt{constructor(){super(...arguments),this.$style=Rb,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Zi.$name=h1;Zi.$version="2.1.1";var Ib=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',Qi=class extends Mt{constructor(){super(...arguments),this.$style=Ib,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};Qi.$name=u1;Qi.$version="2.1.1";var Vb=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",T1=new WeakMap,A1=new WeakMap,P1=new WeakMap,j1=new WeakMap,Db="both",Nb="horizontal",O1="vertical",Fb="none",Ji=class extends Mt{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=Vb,this.resize=O1,this.selection="",this.slottable=!1}set $image(o){A1.set(this,o)}get $image(){return A1.get(this)}set $sourceImage(o){j1.set(this,o)}get $sourceImage(){return j1.get(this)}set $canvas(o){T1.set(this,o)}get $canvas(){return T1.get(this)}set $selection(o){P1.set(this,o)}get $selection(){return P1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=cl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(wr)),ti(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),We(t,_o,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(eo));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(yo));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),We(n.$image,zi,this.$onSourceImageLoad),We(n,Va,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(Be(o,_o,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(Be(e.$image,zi,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(Be(e,Va,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case Db:S=1,k=d,C=h,p.width=d,p.height=h;break;case Nb:S=h>0?x/h:0,k=d*S,p.width=k;break;case O1:S=d>0?f/d:0,C=h*S,p.height=C;break;case Fb:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Ji.$name=g1;Ji.$version="2.1.1";var Lb='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',Bb=/^img|canvas$/,qb=/<(\/?(?:script|style)[^>]*)>/gi,H1={template:Lb};Wi.$define();Qi.$define();Zi.$define();Yi.$define();Ui.$define();Xi.$define();Gi.$define();Ji.$define();var Da=class{constructor(o,e){var t;if(this.options=H1,Dn(o)&&(o=document.querySelector(o)),!ti(o)||!Bb.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},H1),e),this.options=e;let{container:r}=e;if(r&&(Dn(r)&&(r=(t=cl(o))===null||t===void 0?void 0:t.querySelector(r)),!ti(r)))throw new Error("The `container` option must be an element or a valid selector.");ti(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&Dn(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(qb,"<$1>"),p.appendChild(h.content),Array.from(p.querySelectorAll(yo)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(eo)}getCropperImage(){return this.container.querySelector(yo)}getCropperSelection(){return this.container.querySelector(wr)}getCropperSelections(){return this.container.querySelectorAll(wr)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};Da.version="2.1.1";function Gb(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function Yb(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var nt=class extends Wb{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await Yb(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return Gb(this.aspectRatio)}_template(){let e=this._ratio;return`
|
|
8297
8327
|
<cropper-canvas background>
|
|
8298
8328
|
<cropper-image rotatable scalable translatable></cropper-image>
|
|
8299
8329
|
<cropper-shade hidden></cropper-shade>
|
|
@@ -8596,7 +8626,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
8596
8626
|
.content:empty {
|
|
8597
8627
|
display: none;
|
|
8598
8628
|
}
|
|
8599
|
-
`],a([Pt({reflect:!0})],Ue.prototype,"variant",2),a([Pt({type:Number})],Ue.prototype,"gap",2),a([Pt({type:Number})],Ue.prototype,"size",2),a([Pt()],Ue.prototype,"color",2),a([Pt()],Ue.prototype,"background",2),a([Pt({type:Number,attribute:"offset-x"})],Ue.prototype,"offsetX",2),a([Pt({type:Number,attribute:"offset-y"})],Ue.prototype,"offsetY",2),a([Pt({type:Number,attribute:"secondary-gap"})],Ue.prototype,"secondaryGap",2),a([Pt({type:Number,attribute:"secondary-size"})],Ue.prototype,"secondarySize",2),a([Pt({attribute:"secondary-color"})],Ue.prototype,"secondaryColor",2),a([Pt({type:Boolean,reflect:!0})],Ue.prototype,"fullscreen",2),a([Pt({type:Boolean,reflect:!0})],Ue.prototype,"animated",2),a([Pt({reflect:!0})],Ue.prototype,"animation",2),a([Pt({type:Number})],Ue.prototype,"duration",2),a([Pt({type:Number,attribute:"drift-x"})],Ue.prototype,"driftX",2),a([Pt({type:Number,attribute:"drift-y"})],Ue.prototype,"driftY",2),a([Pt({type:Number,attribute:"min-opacity"})],Ue.prototype,"minOpacity",2),a([Pt({type:Number,attribute:"max-opacity"})],Ue.prototype,"maxOpacity",2),a([Pt({type:Boolean,attribute:"pause-when-hidden"})],Ue.prototype,"pauseWhenHidden",2),Ue=a([ey("lui-background")],Ue);import{css as ty,html as Ad,LitElement as ry,nothing as Pd}from"lit";import{customElement as oy,property as Vo,query as iy,state as ml}from"lit/decorators.js";var
|
|
8629
|
+
`],a([Pt({reflect:!0})],Ue.prototype,"variant",2),a([Pt({type:Number})],Ue.prototype,"gap",2),a([Pt({type:Number})],Ue.prototype,"size",2),a([Pt()],Ue.prototype,"color",2),a([Pt()],Ue.prototype,"background",2),a([Pt({type:Number,attribute:"offset-x"})],Ue.prototype,"offsetX",2),a([Pt({type:Number,attribute:"offset-y"})],Ue.prototype,"offsetY",2),a([Pt({type:Number,attribute:"secondary-gap"})],Ue.prototype,"secondaryGap",2),a([Pt({type:Number,attribute:"secondary-size"})],Ue.prototype,"secondarySize",2),a([Pt({attribute:"secondary-color"})],Ue.prototype,"secondaryColor",2),a([Pt({type:Boolean,reflect:!0})],Ue.prototype,"fullscreen",2),a([Pt({type:Boolean,reflect:!0})],Ue.prototype,"animated",2),a([Pt({reflect:!0})],Ue.prototype,"animation",2),a([Pt({type:Number})],Ue.prototype,"duration",2),a([Pt({type:Number,attribute:"drift-x"})],Ue.prototype,"driftX",2),a([Pt({type:Number,attribute:"drift-y"})],Ue.prototype,"driftY",2),a([Pt({type:Number,attribute:"min-opacity"})],Ue.prototype,"minOpacity",2),a([Pt({type:Number,attribute:"max-opacity"})],Ue.prototype,"maxOpacity",2),a([Pt({type:Boolean,attribute:"pause-when-hidden"})],Ue.prototype,"pauseWhenHidden",2),Ue=a([ey("lui-background")],Ue);import{css as ty,html as Ad,LitElement as ry,nothing as Pd}from"lit";import{customElement as oy,property as Vo,query as iy,state as ml}from"lit/decorators.js";var bt=class extends ry{constructor(){super(...arguments);this.orientation="vertical";this.scrollbar="native";this.maxHeight="";this.maxWidth="";this.fade=!1;this.shadow=!1;this.thin=!1;this.hideScrollbar=!1;this.autoHide=!1;this.reachThreshold=2;this._atTop=!0;this._atBottom=!0;this._atLeft=!0;this._atRight=!0;this._explicitAttrs=new Set;this._scrollEndTimer=0;this._lastReach={top:!1,bottom:!1,left:!1,right:!1};this._onSlotChange=()=>{this._updateScrollState(!1)};this._onScroll=()=>{this.autoHide&&(this.toggleAttribute("data-scrolling",!0),window.clearTimeout(this._scrollEndTimer),this._scrollEndTimer=window.setTimeout(()=>this.toggleAttribute("data-scrolling",!1),700)),this._updateScrollState(!0)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=void 0,window.clearTimeout(this._scrollEndTimer),super.disconnectedCallback()}firstUpdated(){this._resizeObserver=new ResizeObserver(()=>this._updateScrollState(!1)),this._viewport&&this._resizeObserver.observe(this._viewport),this._updateScrollState(!1)}willUpdate(e){let t=N(this,"scrollArea");this._applyStringConfig(t,"orientation","orientation"),this._applyStringConfig(t,"scrollbar","scrollbar"),this._applyStringConfig(t,"maxHeight","max-height"),this._applyStringConfig(t,"maxWidth","max-width"),this._applyBooleanConfig(t,"fade","fade"),this._applyBooleanConfig(t,"shadow","shadow"),this._applyBooleanConfig(t,"thin","thin"),this._applyBooleanConfig(t,"hideScrollbar","hide-scrollbar"),this._applyBooleanConfig(t,"autoHide","auto-hide"),!this._explicitAttrs.has("reach-threshold")&&typeof t.reachThreshold=="number"&&this.reachThreshold!==t.reachThreshold&&(this.reachThreshold=t.reachThreshold)}updated(e){(e.has("orientation")||e.has("maxHeight")||e.has("maxWidth")||e.has("reachThreshold"))&&this._updateScrollState(!1)}getScrollElement(){return this._viewport??null}scrollTo(e={top:0},t){let r=this._viewport;if(r){if(typeof e=="number"){r.scrollTo(e,t??0);return}r.scrollTo(e)}}scrollToTop(e="smooth"){this._scrollToEdge({top:0},e)}scrollToBottom(e="smooth"){let t=this._viewport;t&&this._scrollToEdge({top:t.scrollHeight},e)}scrollToLeft(e="smooth"){this._scrollToEdge({left:0},e)}scrollToRight(e="smooth"){let t=this._viewport;t&&this._scrollToEdge({left:t.scrollWidth},e)}_scrollToEdge(e,t){let r=typeof t=="string"?t:t.behavior;this._viewport?.scrollTo({...e,...typeof t=="object"?t:{},behavior:r})}_applyStringConfig(e,t,r){let n=e[t];!this._explicitAttrs.has(r)&&typeof n=="string"&&this[t]!==n&&(this[t]=n)}_applyBooleanConfig(e,t,r){let n=e[t];!this._explicitAttrs.has(r)&&typeof n=="boolean"&&this[t]!==n&&(this[t]=n)}_style(){let e=[this.maxHeight?`--lui-scroll-area-max-height:${this.maxHeight}`:"",this.maxWidth?`--lui-scroll-area-max-width:${this.maxWidth}`:""].filter(Boolean);return e.length?e.join(";"):Pd}_detail(){let e=this._viewport;if(!e)return{scrollTop:0,scrollLeft:0,scrollHeight:0,scrollWidth:0,clientHeight:0,clientWidth:0,atTop:!0,atBottom:!0,atLeft:!0,atRight:!0};let t=Math.max(0,Number(this.reachThreshold)||0),r=Math.max(0,e.scrollHeight-e.clientHeight),n=Math.max(0,e.scrollWidth-e.clientWidth);return{scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth,atTop:e.scrollTop<=t,atBottom:r-e.scrollTop<=t,atLeft:e.scrollLeft<=t,atRight:n-e.scrollLeft<=t}}_updateScrollState(e){let t=this._detail(),r=this._atTop!==t.atTop||this._atBottom!==t.atBottom||this._atLeft!==t.atLeft||this._atRight!==t.atRight;if(this._atTop=t.atTop,this._atBottom=t.atBottom,this._atLeft=t.atLeft,this._atRight=t.atRight,!e){this._lastReach={top:t.atTop,bottom:t.atBottom,left:t.atLeft,right:t.atRight};return}this.dispatchEvent(new CustomEvent("scroll",{detail:t,bubbles:!0,composed:!0})),r&&this._emitReachEvents(t)}_emitReachEvents(e){let t=s=>{this.dispatchEvent(new CustomEvent(s,{detail:e,bubbles:!0,composed:!0}))};e.atTop&&!this._lastReach.top&&t("reach-top"),e.atBottom&&!this._lastReach.bottom&&t("reach-bottom"),e.atLeft&&!this._lastReach.left&&t("reach-left"),e.atRight&&!this._lastReach.right&&t("reach-right");let r=this.orientation==="vertical"||this.orientation==="both",n=this.orientation==="horizontal"||this.orientation==="both";(r?e.atTop:e.atLeft)&&!(r?this._lastReach.top:this._lastReach.left)&&t("reach-start"),(r?e.atBottom:e.atRight)&&!(r?this._lastReach.bottom:this._lastReach.right)&&t("reach-end"),this._lastReach={top:e.atTop,bottom:e.atBottom,left:e.atLeft,right:e.atRight}}_edgeClass(e){let t=e==="top"?!this._atTop:e==="bottom"?!this._atBottom:e==="left"?!this._atLeft:!this._atRight;return`edge ${e}${t?" visible":""}`}render(){let e=this.orientation==="vertical"||this.orientation==="both",t=this.orientation==="horizontal"||this.orientation==="both";return Ad`
|
|
8600
8630
|
<div class="root" part="root" style=${this._style()}>
|
|
8601
8631
|
<div class="viewport" part="viewport" @scroll=${this._onScroll}>
|
|
8602
8632
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
@@ -8604,7 +8634,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
8604
8634
|
${e?Ad`<span class=${this._edgeClass("top")} part="edge top"></span><span class=${this._edgeClass("bottom")} part="edge bottom"></span>`:Pd}
|
|
8605
8635
|
${t?Ad`<span class=${this._edgeClass("left")} part="edge left"></span><span class=${this._edgeClass("right")} part="edge right"></span>`:Pd}
|
|
8606
8636
|
</div>
|
|
8607
|
-
`}};
|
|
8637
|
+
`}};bt.styles=[A,O,ty`
|
|
8608
8638
|
:host {
|
|
8609
8639
|
display: block;
|
|
8610
8640
|
box-sizing: border-box;
|
|
@@ -8803,7 +8833,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
8803
8833
|
:host(:not([fade]):not([shadow])) .edge {
|
|
8804
8834
|
display: none;
|
|
8805
8835
|
}
|
|
8806
|
-
`],a([Vo({reflect:!0})],
|
|
8836
|
+
`],a([Vo({reflect:!0})],bt.prototype,"orientation",2),a([Vo({reflect:!0})],bt.prototype,"scrollbar",2),a([Vo({attribute:"max-height"})],bt.prototype,"maxHeight",2),a([Vo({attribute:"max-width"})],bt.prototype,"maxWidth",2),a([Vo({type:Boolean,reflect:!0})],bt.prototype,"fade",2),a([Vo({type:Boolean,reflect:!0})],bt.prototype,"shadow",2),a([Vo({type:Boolean,reflect:!0})],bt.prototype,"thin",2),a([Vo({type:Boolean,reflect:!0,attribute:"hide-scrollbar"})],bt.prototype,"hideScrollbar",2),a([Vo({type:Boolean,reflect:!0,attribute:"auto-hide"})],bt.prototype,"autoHide",2),a([Vo({type:Number,attribute:"reach-threshold"})],bt.prototype,"reachThreshold",2),a([iy(".viewport")],bt.prototype,"_viewport",2),a([ml()],bt.prototype,"_atTop",2),a([ml()],bt.prototype,"_atBottom",2),a([ml()],bt.prototype,"_atLeft",2),a([ml()],bt.prototype,"_atRight",2),bt=a([oy("lui-scroll-area")],bt);import{css as ny,html as ay,LitElement as sy,nothing as ly}from"lit";import{customElement as cy,property as ri,state as dy}from"lit/decorators.js";var ir=class extends sy{constructor(){super(...arguments);this.orientation="horizontal";this.variant="solid";this.size="md";this.spacing="md";this.labelPlacement="center";this.inset=!1;this.subtle=!1;this.color="";this.thickness="";this._hasLabel=!1;this._explicitAttrs=new Set;this._onSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.TEXT_NODE?!!n.textContent?.trim():n.nodeType===Node.ELEMENT_NODE);this._hasLabel!==r&&(this._hasLabel=r)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=N(this,"divider");!this._explicitAttrs.has("orientation")&&typeof t.orientation=="string"&&this.orientation!==t.orientation&&(this.orientation=t.orientation),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("spacing")&&typeof t.spacing=="string"&&this.spacing!==t.spacing&&(this.spacing=t.spacing),!this._explicitAttrs.has("label-placement")&&typeof t.labelPlacement=="string"&&this.labelPlacement!==t.labelPlacement&&(this.labelPlacement=t.labelPlacement),!this._explicitAttrs.has("inset")&&typeof t.inset=="boolean"&&this.inset!==t.inset&&(this.inset=t.inset),!this._explicitAttrs.has("subtle")&&typeof t.subtle=="boolean"&&this.subtle!==t.subtle&&(this.subtle=t.subtle),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("thickness")&&typeof t.thickness=="string"&&this.thickness!==t.thickness&&(this.thickness=t.thickness)}_style(){let e=[this.color?`--lui-divider-color:${this.color}`:"",this.thickness?`--lui-divider-thickness:${this.thickness}`:""].filter(Boolean);return e.length?e.join(";"):ly}render(){let e=this.orientation==="vertical";return ay`
|
|
8807
8837
|
<div
|
|
8808
8838
|
class=${`divider ${this._hasLabel&&!e?"has-label":"no-label"}`}
|
|
8809
8839
|
part="divider"
|
|
@@ -8974,11 +9004,11 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
8974
9004
|
:host([orientation="vertical"]) .label {
|
|
8975
9005
|
display: none;
|
|
8976
9006
|
}
|
|
8977
|
-
`],a([ri({reflect:!0})],ir.prototype,"orientation",2),a([ri({reflect:!0})],ir.prototype,"variant",2),a([ri({reflect:!0})],ir.prototype,"size",2),a([ri({reflect:!0})],ir.prototype,"spacing",2),a([ri({attribute:"label-placement",reflect:!0})],ir.prototype,"labelPlacement",2),a([ri({type:Boolean,reflect:!0})],ir.prototype,"inset",2),a([ri({type:Boolean,reflect:!0})],ir.prototype,"subtle",2),a([ri()],ir.prototype,"color",2),a([ri()],ir.prototype,"thickness",2),a([dy()],ir.prototype,"_hasLabel",2),ir=a([cy("lui-divider")],ir);import{css as uy,html as hy,LitElement as py}from"lit";import{customElement as my,property as to}from"lit/decorators.js";var
|
|
9007
|
+
`],a([ri({reflect:!0})],ir.prototype,"orientation",2),a([ri({reflect:!0})],ir.prototype,"variant",2),a([ri({reflect:!0})],ir.prototype,"size",2),a([ri({reflect:!0})],ir.prototype,"spacing",2),a([ri({attribute:"label-placement",reflect:!0})],ir.prototype,"labelPlacement",2),a([ri({type:Boolean,reflect:!0})],ir.prototype,"inset",2),a([ri({type:Boolean,reflect:!0})],ir.prototype,"subtle",2),a([ri()],ir.prototype,"color",2),a([ri()],ir.prototype,"thickness",2),a([dy()],ir.prototype,"_hasLabel",2),ir=a([cy("lui-divider")],ir);import{css as uy,html as hy,LitElement as py}from"lit";import{customElement as my,property as to}from"lit/decorators.js";var Nt=class extends py{connectedCallback(){super.connectedCallback(),this._applyRootConfig(),this._notifyDescendants()}updated(){this._applyRootConfig(),this._notifyDescendants()}getConfig(){return{locale:this.locale,translations:this.translations,theme:this.theme,size:this.size,disabled:this.disabled,variant:this.variant,direction:this.direction,popupContainer:this.popupContainer,overlayContainer:this.overlayContainer,zIndexBase:this.zIndexBase,renderEmpty:this.renderEmpty,componentConfig:this.componentConfig}}_notifyDescendants(){queueMicrotask(()=>{let o=this.querySelectorAll("*");for(let e of o){let t=e;typeof t.requestUpdate=="function"&&t.requestUpdate()}})}_applyRootConfig(){this.locale?(Ap(this.locale),this.translations&&Pp(this.locale,this.translations),this.setAttribute("lang",this.locale)):this.removeAttribute("lang"),this.theme?this.setAttribute("theme",this.theme):this.removeAttribute("theme"),this.direction?this.setAttribute("dir",this.direction):this.removeAttribute("dir"),typeof this.zIndexBase=="number"?this.style.setProperty("--lui-z-base",String(this.zIndexBase)):this.style.removeProperty("--lui-z-base")}render(){return hy`<slot></slot>`}};Nt.styles=uy`
|
|
8978
9008
|
:host {
|
|
8979
9009
|
display: contents;
|
|
8980
9010
|
}
|
|
8981
|
-
`,a([to()],
|
|
9011
|
+
`,a([to()],Nt.prototype,"locale",2),a([to({attribute:!1})],Nt.prototype,"translations",2),a([to({reflect:!0})],Nt.prototype,"theme",2),a([to({reflect:!0})],Nt.prototype,"size",2),a([to({type:Boolean,reflect:!0})],Nt.prototype,"disabled",2),a([to({reflect:!0})],Nt.prototype,"variant",2),a([to({reflect:!0,attribute:"direction"})],Nt.prototype,"direction",2),a([to({attribute:!1})],Nt.prototype,"popupContainer",2),a([to({attribute:!1})],Nt.prototype,"overlayContainer",2),a([to({type:Number,attribute:"z-index-base"})],Nt.prototype,"zIndexBase",2),a([to({attribute:!1})],Nt.prototype,"renderEmpty",2),a([to({attribute:!1})],Nt.prototype,"componentConfig",2),Nt=a([my("lui-config-provider")],Nt);import{css as I1,html as Hr,LitElement as V1,nothing as Ei}from"lit";import{customElement as D1,property as ht,query as gy,queryAssignedElements as fy,state as vy}from"lit/decorators.js";function jd(i,o){return String(i.key??i.value??i.href??i.label??o)}function Od(i){return i==="chevron"?Hr`<lui-icon name="chevron-right"></lui-icon>`:i==="dot"?Hr`<span class="dot" aria-hidden="true"></span>`:i==="slash"?"/":i||"/"}function by(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var Wt=class extends V1{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.href="";this.target="";this.rel="";this.icon="";this.disabled=!1;this.current=!1;this.first=!1;this.separator="/";this._onClick=e=>{if(this.disabled||this.current){e.preventDefault(),e.stopPropagation();return}this.dispatchEvent(new CustomEvent("item-click",{detail:{key:this.itemKey,index:-1,originalEvent:e},bubbles:!0,composed:!0}))}}get itemKey(){return this.key||this.value||this.href||this.label}_renderLabel(){return Hr`
|
|
8982
9012
|
${this.icon?Hr`<lui-icon name=${this.icon}></lui-icon>`:Ei}
|
|
8983
9013
|
<span class="label"><slot>${this.label}</slot></span>
|
|
8984
9014
|
`}render(){let e=["link",this.current?"current":"",this.disabled?"disabled":""].filter(Boolean).join(" "),t=this._renderLabel();return Hr`
|
|
@@ -9273,7 +9303,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9273
9303
|
--lui-breadcrumb-font-size: var(--lui-breadcrumb-font-size);
|
|
9274
9304
|
--lui-breadcrumb-link-height: var(--lui-breadcrumb-link-height);
|
|
9275
9305
|
}
|
|
9276
|
-
`],a([ht({attribute:!1})],Ct.prototype,"items",2),a([ht()],Ct.prototype,"separator",2),a([ht({reflect:!0})],Ct.prototype,"size",2),a([ht({attribute:"current-key"})],Ct.prototype,"currentKey",2),a([ht({type:Number,attribute:"max-items"})],Ct.prototype,"maxItems",2),a([ht({reflect:!0})],Ct.prototype,"collapse",2),a([ht({attribute:"collapsed-label"})],Ct.prototype,"collapsedLabel",2),a([ht({attribute:"overflow-icon"})],Ct.prototype,"overflowIcon",2),a([ht({attribute:"overflow-label"})],Ct.prototype,"overflowLabel",2),a([ht({type:Boolean,reflect:!0})],Ct.prototype,"disabled",2),a([ht({attribute:"aria-label"})],Ct.prototype,"ariaLabel",2),a([fy({flatten:!0})],Ct.prototype,"_assignedElements",2),a([gy("ol")],Ct.prototype,"_listEl",2),a([vy()],Ct.prototype,"_overflowIndexes",2),Ct=a([D1("lui-breadcrumb")],Ct);import{css as N1,html as F1,LitElement as L1}from"lit";import{customElement as B1,property as ro,queryAssignedElements as yy}from"lit/decorators.js";var q1=[["xl",1200],["lg",992],["md",768],["sm",576],["xs",0]],ky={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},xy={start:"flex-start",end:"flex-end",center:"center","space-around":"space-around","space-between":"space-between","space-evenly":"space-evenly"};function wy(i){if(!i)return 0;try{let o=JSON.parse(i);return Array.isArray(o)?[Number(o[0])||0,Number(o[1])||0]:Number(o)||0}catch{return Number(i)||0}}function _y(i,o,e){i.getPropertyValue(o)!==e&&i.setProperty(o,e)}function
|
|
9306
|
+
`],a([ht({attribute:!1})],Ct.prototype,"items",2),a([ht()],Ct.prototype,"separator",2),a([ht({reflect:!0})],Ct.prototype,"size",2),a([ht({attribute:"current-key"})],Ct.prototype,"currentKey",2),a([ht({type:Number,attribute:"max-items"})],Ct.prototype,"maxItems",2),a([ht({reflect:!0})],Ct.prototype,"collapse",2),a([ht({attribute:"collapsed-label"})],Ct.prototype,"collapsedLabel",2),a([ht({attribute:"overflow-icon"})],Ct.prototype,"overflowIcon",2),a([ht({attribute:"overflow-label"})],Ct.prototype,"overflowLabel",2),a([ht({type:Boolean,reflect:!0})],Ct.prototype,"disabled",2),a([ht({attribute:"aria-label"})],Ct.prototype,"ariaLabel",2),a([fy({flatten:!0})],Ct.prototype,"_assignedElements",2),a([gy("ol")],Ct.prototype,"_listEl",2),a([vy()],Ct.prototype,"_overflowIndexes",2),Ct=a([D1("lui-breadcrumb")],Ct);import{css as N1,html as F1,LitElement as L1}from"lit";import{customElement as B1,property as ro,queryAssignedElements as yy}from"lit/decorators.js";var q1=[["xl",1200],["lg",992],["md",768],["sm",576],["xs",0]],ky={top:"flex-start",middle:"center",bottom:"flex-end",stretch:"stretch"},xy={start:"flex-start",end:"flex-end",center:"center","space-around":"space-around","space-between":"space-between","space-evenly":"space-evenly"};function wy(i){if(!i)return 0;try{let o=JSON.parse(i);return Array.isArray(o)?[Number(o[0])||0,Number(o[1])||0]:Number(o)||0}catch{return Number(i)||0}}function _y(i,o,e){i.getPropertyValue(o)!==e&&i.setProperty(o,e)}function _r(i,o,e){let t=i;t[o]!==e&&(t[o]=e)}var Co=class extends L1{constructor(){super(...arguments);this.gutter=0;this.align="top";this.justify="start";this.nowrap=!1;this._ro=null;this._layoutFrame=0;this._lastWidth=-1}get _h(){return Array.isArray(this.gutter)?this.gutter[0]:this.gutter}get _v(){return Array.isArray(this.gutter)?this.gutter[1]:0}connectedCallback(){super.connectedCallback(),this._ro=new ResizeObserver(()=>this._layout()),this._ro.observe(this)}disconnectedCallback(){this._ro?.disconnect(),this._ro=null,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),super.disconnectedCallback()}firstUpdated(){this._scheduleLayout()}updated(){this._scheduleLayout()}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._layout()})}_syncCols(e){for(let t of this._assignedElements??[])t.tagName.toLowerCase()==="lui-col"&&t.updateLayout(e)}_layout(){let e=Number(this._h)||0,t=Number(this._v)||0,r=this.style;_r(r,"flexWrap",this.nowrap?"nowrap":"wrap"),_r(r,"alignItems",ky[this.align]??"flex-start"),_r(r,"justifyContent",xy[this.justify]??"flex-start"),_r(r,"marginLeft",e?`-${e/2}px`:""),_r(r,"marginRight",e?`-${e/2}px`:""),_y(r,"--_gutter-h",e?`${e/2}px`:"0px"),_r(r,"rowGap",t?`${t}px`:"");let n=Math.floor(this.getBoundingClientRect().width||this.offsetWidth||0);n!==this._lastWidth?(this._lastWidth=n,this._syncCols(n)):this._syncCols(n)}render(){return F1`<slot @slotchange=${this._scheduleLayout}></slot>`}};Co.styles=[A,N1`
|
|
9277
9307
|
:host {
|
|
9278
9308
|
display: flex;
|
|
9279
9309
|
flex-wrap: wrap;
|
|
@@ -9283,7 +9313,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9283
9313
|
slot {
|
|
9284
9314
|
display: contents;
|
|
9285
9315
|
}
|
|
9286
|
-
`],a([ro({converter:wy})],Co.prototype,"gutter",2),a([ro()],Co.prototype,"align",2),a([ro()],Co.prototype,"justify",2),a([ro({type:Boolean})],Co.prototype,"nowrap",2),a([yy({flatten:!0})],Co.prototype,"_assignedElements",2),Co=a([B1("lui-row")],Co);var Rr=class extends L1{constructor(){super(...arguments);this._parentRo=null;this._layoutFrame=0;this._lastContainerWidth=-1}connectedCallback(){super.connectedCallback();let e=this.closest("lui-row");e&&(this._parentRo=new ResizeObserver(()=>this._applySpan()),this._parentRo.observe(e)),this._scheduleApply()}disconnectedCallback(){this._parentRo?.disconnect(),this._parentRo=null,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),super.disconnectedCallback()}updated(){this._scheduleApply()}updateLayout(e){e!=null&&(this._lastContainerWidth=Math.max(0,Math.floor(e))),this._applySpan()}_scheduleApply(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._applySpan()})}_activeBreakpoint(e){return q1.find(([,t])=>e>=t)?.[0]??"xs"}_resolveSpan(e){return this[e]??this.span??24}_applySpan(){let e=this.closest("lui-row"),t=this._lastContainerWidth>=0?this._lastContainerWidth:Math.floor(e?.getBoundingClientRect().width||e?.offsetWidth||0),r=this._activeBreakpoint(t),n=this._resolveSpan(r),s=this.style;if(!Number.isFinite(n)||n<=0){
|
|
9316
|
+
`],a([ro({converter:wy})],Co.prototype,"gutter",2),a([ro()],Co.prototype,"align",2),a([ro()],Co.prototype,"justify",2),a([ro({type:Boolean})],Co.prototype,"nowrap",2),a([yy({flatten:!0})],Co.prototype,"_assignedElements",2),Co=a([B1("lui-row")],Co);var Rr=class extends L1{constructor(){super(...arguments);this._parentRo=null;this._layoutFrame=0;this._lastContainerWidth=-1}connectedCallback(){super.connectedCallback();let e=this.closest("lui-row");e&&(this._parentRo=new ResizeObserver(()=>this._applySpan()),this._parentRo.observe(e)),this._scheduleApply()}disconnectedCallback(){this._parentRo?.disconnect(),this._parentRo=null,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),super.disconnectedCallback()}updated(){this._scheduleApply()}updateLayout(e){e!=null&&(this._lastContainerWidth=Math.max(0,Math.floor(e))),this._applySpan()}_scheduleApply(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._applySpan()})}_activeBreakpoint(e){return q1.find(([,t])=>e>=t)?.[0]??"xs"}_resolveSpan(e){return this[e]??this.span??24}_applySpan(){let e=this.closest("lui-row"),t=this._lastContainerWidth>=0?this._lastContainerWidth:Math.floor(e?.getBoundingClientRect().width||e?.offsetWidth||0),r=this._activeBreakpoint(t),n=this._resolveSpan(r),s=this.style;if(!Number.isFinite(n)||n<=0){_r(s,"display","none"),_r(s,"flex",""),_r(s,"maxWidth",""),_r(s,"marginLeft","");return}let d=`${Math.min(24,Math.max(0,n))/24*100}%`;_r(s,"display","block"),_r(s,"flex",`0 0 ${d}`),_r(s,"maxWidth",d),_r(s,"marginLeft",this.offset!=null?`${this.offset/24*100}%`:""),_r(s,"order",this.colOrder!=null?String(this.colOrder):"")}render(){return F1`<slot></slot>`}};Rr.styles=[A,N1`
|
|
9287
9317
|
:host {
|
|
9288
9318
|
display: block;
|
|
9289
9319
|
box-sizing: border-box;
|
|
@@ -9492,7 +9522,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9492
9522
|
flex-shrink: 0;
|
|
9493
9523
|
font-size: var(--lui-icon-size, 18px);
|
|
9494
9524
|
}
|
|
9495
|
-
`],a([Ge()],$e.prototype,"value",2),a([Ge()],$e.prototype,"placeholder",2),a([Ge()],$e.prototype,"type",2),a([Ge({reflect:!0})],$e.prototype,"size",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"disabled",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"readonly",2),a([Ge({type:Boolean})],$e.prototype,"autofocus",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"clearable",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"revealable",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"invalid",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"noborder",2),a([Ge()],$e.prototype,"name",2),a([Ge()],$e.prototype,"autocomplete",2),a([Ge()],$e.prototype,"inputmode",2),a([Ge({type:Number,attribute:"maxlength"})],$e.prototype,"maxLength",2),a([Ge({type:Number,attribute:"minlength"})],$e.prototype,"minLength",2),a([Ge()],$e.prototype,"pattern",2),a([Ge()],$e.prototype,"min",2),a([Ge()],$e.prototype,"max",2),a([Ge()],$e.prototype,"step",2),a([Ge()],$e.prototype,"enterkeyhint",2),a([Ge({type:Boolean})],$e.prototype,"spellcheck",2),a([Ge()],$e.prototype,"autocapitalize",2),a([Ge()],$e.prototype,"locale",2),a([Ge({attribute:!1})],$e.prototype,"translations",2),a([Ey("input")],$e.prototype,"_input",2),$e=a([zy("lui-input")],$e);import{css as Sy,html as $y,LitElement as Ty}from"lit";import{customElement as Ay,property as
|
|
9525
|
+
`],a([Ge()],$e.prototype,"value",2),a([Ge()],$e.prototype,"placeholder",2),a([Ge()],$e.prototype,"type",2),a([Ge({reflect:!0})],$e.prototype,"size",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"disabled",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"readonly",2),a([Ge({type:Boolean})],$e.prototype,"autofocus",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"clearable",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"revealable",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"invalid",2),a([Ge({type:Boolean,reflect:!0})],$e.prototype,"noborder",2),a([Ge()],$e.prototype,"name",2),a([Ge()],$e.prototype,"autocomplete",2),a([Ge()],$e.prototype,"inputmode",2),a([Ge({type:Number,attribute:"maxlength"})],$e.prototype,"maxLength",2),a([Ge({type:Number,attribute:"minlength"})],$e.prototype,"minLength",2),a([Ge()],$e.prototype,"pattern",2),a([Ge()],$e.prototype,"min",2),a([Ge()],$e.prototype,"max",2),a([Ge()],$e.prototype,"step",2),a([Ge()],$e.prototype,"enterkeyhint",2),a([Ge({type:Boolean})],$e.prototype,"spellcheck",2),a([Ge()],$e.prototype,"autocapitalize",2),a([Ge()],$e.prototype,"locale",2),a([Ge({attribute:!1})],$e.prototype,"translations",2),a([Ey("input")],$e.prototype,"_input",2),$e=a([zy("lui-input")],$e);import{css as Sy,html as $y,LitElement as Ty}from"lit";import{customElement as Ay,property as Ft,query as Py}from"lit/decorators.js";var Ye=class extends Ty{constructor(){super(...arguments);this.value="";this.placeholder="";this.rows=3;this.size="md";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.noborder=!1;this.autoResize=!1;this.spellcheck=!1;this.autocapitalize="";this._focused=!1;this._explicitAttrs=new Set;this._onInput=e=>{e.stopPropagation(),this.value=e.target.value,this._syncHeight(),this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onChange=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=N(this,"textarea");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("auto-resize")&&typeof e.autoResize=="boolean"&&this.autoResize!==e.autoResize&&(this.autoResize=e.autoResize),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}updated(e){super.updated(e),(e.has("value")||e.has("rows")||e.has("minRows")||e.has("maxRows")||e.has("autoResize")||e.has("size"))&&this._syncHeight()}render(){let e=["wrapper"];return this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid"),$y`
|
|
9496
9526
|
<div class=${e.join(" ")} part="wrapper">
|
|
9497
9527
|
<textarea
|
|
9498
9528
|
part="textarea"
|
|
@@ -9611,7 +9641,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9611
9641
|
font-size: var(--lui-font-size-lg);
|
|
9612
9642
|
padding: 10px 16px;
|
|
9613
9643
|
}
|
|
9614
|
-
`],a([
|
|
9644
|
+
`],a([Ft()],Ye.prototype,"value",2),a([Ft()],Ye.prototype,"placeholder",2),a([Ft({type:Number})],Ye.prototype,"rows",2),a([Ft({type:Number,attribute:"min-rows"})],Ye.prototype,"minRows",2),a([Ft({type:Number,attribute:"max-rows"})],Ye.prototype,"maxRows",2),a([Ft({reflect:!0})],Ye.prototype,"size",2),a([Ft({type:Boolean,reflect:!0})],Ye.prototype,"disabled",2),a([Ft({type:Boolean,reflect:!0})],Ye.prototype,"readonly",2),a([Ft({type:Boolean,reflect:!0})],Ye.prototype,"invalid",2),a([Ft({type:Boolean,reflect:!0})],Ye.prototype,"noborder",2),a([Ft({type:Boolean,reflect:!0,attribute:"auto-resize"})],Ye.prototype,"autoResize",2),a([Ft()],Ye.prototype,"name",2),a([Ft()],Ye.prototype,"autocomplete",2),a([Ft({type:Number,attribute:"maxlength"})],Ye.prototype,"maxLength",2),a([Ft({type:Number,attribute:"minlength"})],Ye.prototype,"minLength",2),a([Ft()],Ye.prototype,"enterkeyhint",2),a([Ft({type:Boolean})],Ye.prototype,"spellcheck",2),a([Ft()],Ye.prototype,"autocapitalize",2),a([Py("textarea")],Ye.prototype,"_textarea",2),Ye=a([Ay("lui-textarea")],Ye);import{css as jy,html as K1,LitElement as Oy}from"lit";import{customElement as Hy,property as en,query as Ry}from"lit/decorators.js";var Ir=class extends Oy{constructor(){super(...arguments);this.checked=!1;this.disabled=!1;this.size="md";this._onKeyDown=e=>{this.disabled||(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this._toggle())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}focus(){this._input?.focus()}blur(){this._input?.blur()}_toggle(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){return K1`
|
|
9615
9645
|
<input
|
|
9616
9646
|
type="checkbox"
|
|
9617
9647
|
role="switch"
|
|
@@ -9920,7 +9950,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9920
9950
|
transition: none;
|
|
9921
9951
|
}
|
|
9922
9952
|
}
|
|
9923
|
-
`],a([Do({type:Boolean,reflect:!0})],Gt.prototype,"checked",2),a([Do({type:Boolean,reflect:!0})],Gt.prototype,"disabled",2),a([Do({reflect:!0})],Gt.prototype,"size",2),a([Do()],Gt.prototype,"name",2),a([Do()],Gt.prototype,"value",2),a([Do()],Gt.prototype,"label",2),a([Do()],Gt.prototype,"description",2),a([Do({attribute:"checked-icon"})],Gt.prototype,"checkedIcon",2),a([Do()],Gt.prototype,"locale",2),a([Do({attribute:!1})],Gt.prototype,"translations",2),a([Ky("input")],Gt.prototype,"_input",2),Gt=a([qy("lui-radio")],Gt);import{css as Wy,html as
|
|
9953
|
+
`],a([Do({type:Boolean,reflect:!0})],Gt.prototype,"checked",2),a([Do({type:Boolean,reflect:!0})],Gt.prototype,"disabled",2),a([Do({reflect:!0})],Gt.prototype,"size",2),a([Do()],Gt.prototype,"name",2),a([Do()],Gt.prototype,"value",2),a([Do()],Gt.prototype,"label",2),a([Do()],Gt.prototype,"description",2),a([Do({attribute:"checked-icon"})],Gt.prototype,"checkedIcon",2),a([Do()],Gt.prototype,"locale",2),a([Do({attribute:!1})],Gt.prototype,"translations",2),a([Ky("input")],Gt.prototype,"_input",2),Gt=a([qy("lui-radio")],Gt);import{css as Wy,html as Mr,LitElement as Uy,nothing as ii}from"lit";import{customElement as Gy,property as nr,state as Vd}from"lit/decorators.js";var Xe=class extends Uy{constructor(){super(...arguments);this.value=0;this.min=0;this.max=100;this.step=1;this.disabled=!1;this.size="md";this.showValue=!0;this.track="normal";this.marks=!1;this.snapToMarks=!1;this.range=!1;this.rangeValue=[20,80];this.valueLabelDisplay="off";this.valuePrefix="";this.valueSuffix="";this._hovered=!1;this._focusedThumb=null;this._draggingThumb=null;this._onGlobalPointerUp=()=>{this._draggingThumb&&(this._draggingThumb=null)}}connectedCallback(){super.connectedCallback(),window.addEventListener("pointerup",this._onGlobalPointerUp,!0),window.addEventListener("pointercancel",this._onGlobalPointerUp,!0)}disconnectedCallback(){window.removeEventListener("pointerup",this._onGlobalPointerUp,!0),window.removeEventListener("pointercancel",this._onGlobalPointerUp,!0),super.disconnectedCallback()}_trackMode(){return this.track===!1?"none":this.track==="inverted"||this.track==="none"?this.track:"normal"}_toPercent(e){let t=this.max-this.min;if(!Number.isFinite(t)||t<=0)return 0;let r=(e-this.min)/t*100;return Math.max(0,Math.min(100,r))}_decimalPlaces(e){let t=String(e),r=t.indexOf(".");return r===-1?0:t.length-r-1}_resolveMarks(){let e=Math.min(this.min,this.max),t=Math.max(this.min,this.max);if(Array.isArray(this.marks)){let r=[...this.marks].filter(s=>Number.isFinite(s?.value)).map(s=>({value:Number(s.value),label:s.label})).filter(s=>s.value>=e&&s.value<=t).sort((s,d)=>s.value-d.value),n=[];for(let s of r)(!n.length||n[n.length-1].value!==s.value)&&n.push(s);return n}if(this.marks===!0){let r=Number(this.step);if(!Number.isFinite(r)||r<=0)return[];let s=Math.min(500,Math.floor((t-e)/r)),d=this._decimalPlaces(r),h=[];for(let p=0;p<=s;p+=1){let f=Number((e+p*r).toFixed(d));h.push({value:f})}return h[h.length-1]?.value!==t&&h.push({value:t}),h}return[]}_snapToNearestMark(e,t){if(!t.length)return e;let r=t[0].value,n=Math.abs(e-r);for(let s=1;s<t.length;s+=1){let d=t[s].value,h=Math.abs(e-d);h<n&&(n=h,r=d)}return r}_normalizeScalar(e,t){let r=Math.min(this.min,this.max),n=Math.max(this.min,this.max);if(!Number.isFinite(e))return r;let s=Math.max(r,Math.min(n,e));if(this.snapToMarks&&t.length)return s=this._snapToNearestMark(s,t),Math.max(r,Math.min(n,s));if(Number.isFinite(this.step)&&this.step>0){let d=Math.round((s-r)/this.step);s=r+d*this.step,s=Number(s.toFixed(this._decimalPlaces(this.step)))}return Math.max(r,Math.min(n,s))}_normalizeRange(e,t,r,n=null){let s=Math.min(this.min,this.max),d=Math.max(this.min,this.max),h=this._normalizeScalar(e,r),p=this._normalizeScalar(t,r);return n==="start"&&h>p?h=p:n==="end"&&p<h?p=h:h>p&&([h,p]=[p,h]),[Math.max(s,Math.min(d,h)),Math.max(s,Math.min(d,p))]}_resolveRangePair(e){let t=this.rangeValue??[this.min,this.max],r=Array.isArray(this.value)?[Number(this.value[0]),Number(this.value[1])]:[Number(t[0]),Number(t[1])];return this._normalizeRange(r[0],r[1],e)}_formatValue(e){let t=Number.isFinite(e)?e:0,r=Number.isInteger(t)?String(t):String(Number(t.toFixed(Math.max(2,this._decimalPlaces(this.step)))));return`${this.valuePrefix}${r}${this.valueSuffix}`}_formatRange(e,t){return`${this._formatValue(e)} - ${this._formatValue(t)}`}_isMarkActive(e,t,r){let n=this._trackMode(),s=Math.max(Math.abs(this.step||1)/1e3,1e-9);if(r){let[d,h]=r;return n==="none"?Math.abs(e.value-d)<=s||Math.abs(e.value-h)<=s:n==="inverted"?e.value<=d+s||e.value>=h-s:e.value>=d-s&&e.value<=h+s}return n==="none"?Math.abs(e.value-t)<=s:n==="inverted"?e.value>=t-s:e.value<=t+s}_emitInput(e,t){this.dispatchEvent(new CustomEvent("input",{detail:{value:e,range:this.range,activeThumb:t},bubbles:!0,composed:!0}))}_emitChange(e,t){this.dispatchEvent(new CustomEvent("change",{detail:{value:e,range:this.range,activeThumb:t},bubbles:!0,composed:!0}))}render(){let e=this._resolveMarks(),t=this._trackMode(),r=this._normalizeScalar(Number(Array.isArray(this.value)?this.value[0]:this.value),e),[n,s]=this._resolveRangePair(e),d=this._toPercent(r),h=this._toPercent(n),p=this._toPercent(s),f=this.valueLabelDisplay==="on"||this.valueLabelDisplay==="auto"&&(this._hovered||this._focusedThumb!==null||this._draggingThumb!==null),x=this.valueLabelDisplay!=="off",k=this.range&&Math.abs(p-h)<8,C=this.range?(h+p)/2:d,S=z=>{let T=["thumb"];return this._hovered&&!this._draggingThumb&&T.push("hovered"),this._draggingThumb===z?T.push("dragging"):this._focusedThumb===z&&this._draggingThumb!==z&&T.push("focused"),T.join(" ")};return Mr`
|
|
9924
9954
|
<div
|
|
9925
9955
|
class=${`slider-shell${e.length?" has-marks":""}${x?" has-label-space":""}`}
|
|
9926
9956
|
@mouseenter=${()=>{this._hovered=!0}}
|
|
@@ -9928,23 +9958,23 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9928
9958
|
>
|
|
9929
9959
|
<div class="rail"></div>
|
|
9930
9960
|
|
|
9931
|
-
${!this.range&&t!=="none"?
|
|
9961
|
+
${!this.range&&t!=="none"?Mr`<div class="track" style=${t==="inverted"?`left:${d}%;width:${100-d}%;`:`left:0%;width:${d}%;`}
|
|
9932
9962
|
></div>`:ii}
|
|
9933
9963
|
|
|
9934
|
-
${this.range&&t==="normal"?
|
|
9964
|
+
${this.range&&t==="normal"?Mr`<div class="track" style=${`left:${h}%;width:${Math.max(0,p-h)}%;`}></div>`:ii}
|
|
9935
9965
|
|
|
9936
|
-
${this.range&&t==="inverted"?
|
|
9966
|
+
${this.range&&t==="inverted"?Mr`
|
|
9937
9967
|
<div class="track" style=${`left:0%;width:${h}%;`}></div>
|
|
9938
9968
|
<div class="track" style=${`left:${p}%;width:${100-p}%;`}></div>
|
|
9939
9969
|
`:ii}
|
|
9940
9970
|
|
|
9941
|
-
${this.range?
|
|
9971
|
+
${this.range?Mr`
|
|
9942
9972
|
<div class=${S("start")} style=${`left:${h}%`}></div>
|
|
9943
9973
|
<div class=${S("end")} style=${`left:${p}%`}></div>
|
|
9944
|
-
`:
|
|
9974
|
+
`:Mr`<div class=${S("single")} style=${`left:${d}%`}></div>`}
|
|
9945
9975
|
|
|
9946
9976
|
<div class="native-wrap">
|
|
9947
|
-
${this.range?
|
|
9977
|
+
${this.range?Mr`
|
|
9948
9978
|
<input
|
|
9949
9979
|
class="native"
|
|
9950
9980
|
style=${`z-index:${this._draggingThumb==="start"||this._focusedThumb==="start"?5:3};clip-path: inset(0 ${Math.max(0,100-C)}% 0 0);`}
|
|
@@ -9977,7 +10007,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9977
10007
|
@input=${z=>{z.stopPropagation();let T=Number(z.target.value),[P,H]=this._normalizeRange(n,T,e,"end"),R=[P,H];this.value=R,this.rangeValue=R,this._emitInput(R,"end")}}
|
|
9978
10008
|
@change=${z=>{z.stopPropagation();let T=Number(z.target.value),[P,H]=this._normalizeRange(n,T,e,"end"),R=[P,H];this.value=R,this.rangeValue=R,this._emitChange(R,"end")}}
|
|
9979
10009
|
/>
|
|
9980
|
-
`:
|
|
10010
|
+
`:Mr`<input
|
|
9981
10011
|
class="native"
|
|
9982
10012
|
type="range"
|
|
9983
10013
|
.value=${String(r)}
|
|
@@ -9994,26 +10024,26 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
9994
10024
|
/>`}
|
|
9995
10025
|
</div>
|
|
9996
10026
|
|
|
9997
|
-
${f&&!this.range?
|
|
10027
|
+
${f&&!this.range?Mr`<div class="value-label" style=${`left:${d}%`}>${this._formatValue(r)}</div>`:ii}
|
|
9998
10028
|
|
|
9999
|
-
${f&&this.range&&!k?
|
|
10029
|
+
${f&&this.range&&!k?Mr`
|
|
10000
10030
|
<div class="value-label" style=${`left:${h}%`}>${this._formatValue(n)}</div>
|
|
10001
10031
|
<div class="value-label" style=${`left:${p}%`}>${this._formatValue(s)}</div>
|
|
10002
10032
|
`:ii}
|
|
10003
10033
|
|
|
10004
|
-
${f&&this.range&&k?
|
|
10034
|
+
${f&&this.range&&k?Mr`<div class="value-label" style=${`left:${(h+p)/2}%`}>${this._formatRange(n,s)}</div>`:ii}
|
|
10005
10035
|
|
|
10006
|
-
${e.length?
|
|
10007
|
-
${e.map(z=>{let T=this._toPercent(z.value),P=this.range?this._isMarkActive(z,s,[n,s]):this._isMarkActive(z,r);return
|
|
10036
|
+
${e.length?Mr`<div class="marks">
|
|
10037
|
+
${e.map(z=>{let T=this._toPercent(z.value),P=this.range?this._isMarkActive(z,s,[n,s]):this._isMarkActive(z,r);return Mr`
|
|
10008
10038
|
<div class=${`mark${P?" active":""}`} style=${`left:${T}%`}>
|
|
10009
10039
|
<span class="mark-dot"></span>
|
|
10010
|
-
${z.label!=null?
|
|
10040
|
+
${z.label!=null?Mr`<span class="mark-label">${z.label}</span>`:ii}
|
|
10011
10041
|
</div>
|
|
10012
10042
|
`})}
|
|
10013
10043
|
</div>`:ii}
|
|
10014
10044
|
</div>
|
|
10015
10045
|
|
|
10016
|
-
${this.showValue?
|
|
10046
|
+
${this.showValue?Mr`<span class="value">${this.range?this._formatRange(n,s):this._formatValue(r)}</span>`:ii}
|
|
10017
10047
|
`}};Xe.styles=[A,O,Wy`
|
|
10018
10048
|
:host {
|
|
10019
10049
|
--_track-h: 6px;
|
|
@@ -10486,7 +10516,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
10486
10516
|
:host([size="lg"]) .separator {
|
|
10487
10517
|
font-size: var(--lui-font-size-xl);
|
|
10488
10518
|
}
|
|
10489
|
-
`],a([ni()],ar.prototype,"value",2),a([ni({type:Number})],ar.prototype,"length",2),a([ni({reflect:!0})],ar.prototype,"size",2),a([ni({type:Boolean})],ar.prototype,"disabled",2),a([ni({type:Boolean})],ar.prototype,"readonly",2),a([ni({type:Boolean,reflect:!0})],ar.prototype,"invalid",2),a([ni()],ar.prototype,"type",2),a([ni()],ar.prototype,"name",2),a([ni()],ar.prototype,"format",2),a([rk(".otp-cell")],ar.prototype,"_cells",2),ar=a([tk("lui-input-opt")],ar);import{css as ok,html as No,LitElement as ik}from"lit";import{customElement as nk,property as
|
|
10519
|
+
`],a([ni()],ar.prototype,"value",2),a([ni({type:Number})],ar.prototype,"length",2),a([ni({reflect:!0})],ar.prototype,"size",2),a([ni({type:Boolean})],ar.prototype,"disabled",2),a([ni({type:Boolean})],ar.prototype,"readonly",2),a([ni({type:Boolean,reflect:!0})],ar.prototype,"invalid",2),a([ni()],ar.prototype,"type",2),a([ni()],ar.prototype,"name",2),a([ni()],ar.prototype,"format",2),a([rk(".otp-cell")],ar.prototype,"_cells",2),ar=a([tk("lui-input-opt")],ar);import{css as ok,html as No,LitElement as ik}from"lit";import{customElement as nk,property as Cr}from"lit/decorators.js";var yt=class extends ik{constructor(){super(...arguments);this.placeholder="";this.size="md";this.controls="split";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.noborder=!1;this.step=1;this.prefix="";this.suffix="";this._focused=!1;this._explicitAttrs=new Set;this._draftValue=null;this._onWheel=e=>{!this._focused||this.disabled||this.readonly||e.deltaY!==0&&(e.preventDefault(),this._stepBy(e.deltaY<0?this.step:-this.step))}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=N(this,"inputNumber");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("controls")&&typeof e.controls=="string"&&this.controls!==e.controls&&(this.controls=e.controls),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this.shadowRoot?.querySelector("input")?.focus()}_clamp(e){if(this.precision!=null){let t=Math.pow(10,this.precision);e=Math.round(e*t)/t}return this.min!=null&&e<this.min&&(e=this.min),this.max!=null&&e>this.max&&(e=this.max),e}_canDec(){return this.disabled||this.readonly?!1:this.min==null?!0:(this.value??0)-this.step>=this.min}_canInc(){return this.disabled||this.readonly?!1:this.max==null?!0:(this.value??0)+this.step<=this.max}_emit(e){this.value=e,this._focused&&(this._draftValue=e!=null?String(e):""),this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}_stepBy(e){let t=this.value??0;this._emit(this._clamp(t+e))}_onInput(e){e.stopPropagation();let r=e.target.value.trim();if(this._draftValue=r,r===""||r==="-"||r==="."||r==="-."){this._emit(void 0);return}let n=Number(r);isNaN(n)||(this.value=this._clamp(n),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))),this.requestUpdate()}_onBlur(e){this._focused=!1;let t=e.target,r=t.value.trim();if(r===""||r==="-"||r==="."||r==="-.")this.value=void 0;else{let n=Number(r);isNaN(n)||(this.value=this._clamp(n))}this._draftValue=null,this.value!=null?t.value=String(this.value):t.value="",this.requestUpdate()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this._focused&&this._draftValue!=null?this._draftValue:this.value!=null?String(this.value):"",r=No`
|
|
10490
10520
|
<input
|
|
10491
10521
|
part="input"
|
|
10492
10522
|
.value=${t}
|
|
@@ -10541,7 +10571,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
10541
10571
|
${this.suffix?No`<span class="suffix">${this.suffix}</span>`:""}
|
|
10542
10572
|
`}
|
|
10543
10573
|
</div>
|
|
10544
|
-
`}};
|
|
10574
|
+
`}};yt.styles=[A,O,ok`
|
|
10545
10575
|
:host {
|
|
10546
10576
|
display: inline-flex;
|
|
10547
10577
|
width: 100%;
|
|
@@ -10715,7 +10745,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
10715
10745
|
:host([size="lg"][controls="stacked"]) input {
|
|
10716
10746
|
padding-inline: 14px 10px;
|
|
10717
10747
|
}
|
|
10718
|
-
`],a([
|
|
10748
|
+
`],a([Cr({type:Number})],yt.prototype,"value",2),a([Cr()],yt.prototype,"placeholder",2),a([Cr({reflect:!0})],yt.prototype,"size",2),a([Cr({reflect:!0})],yt.prototype,"controls",2),a([Cr({type:Boolean})],yt.prototype,"disabled",2),a([Cr({type:Boolean})],yt.prototype,"readonly",2),a([Cr({type:Boolean,reflect:!0})],yt.prototype,"invalid",2),a([Cr({type:Boolean,reflect:!0})],yt.prototype,"noborder",2),a([Cr({type:Number})],yt.prototype,"min",2),a([Cr({type:Number})],yt.prototype,"max",2),a([Cr({type:Number})],yt.prototype,"step",2),a([Cr({type:Number})],yt.prototype,"precision",2),a([Cr()],yt.prototype,"prefix",2),a([Cr()],yt.prototype,"suffix",2),a([Cr()],yt.prototype,"name",2),yt=a([nk("lui-input-number")],yt);import{css as sk,html as Dd,LitElement as lk}from"lit";import{customElement as ck,property as zr,query as G1}from"lit/decorators.js";import dk from"flatpickr";import{Mandarin as uk}from"flatpickr/dist/l10n/zh.js";import"flatpickr/dist/flatpickr.min.css";var le='[theme="dark"], [theme="vscode-dark"]',ce=".flatpickr-calendar.lui-datepicker-calendar",ak=`
|
|
10719
10749
|
:is(${le}) ${ce} {
|
|
10720
10750
|
background: var(--lui-color-bg-elevated, #252526);
|
|
10721
10751
|
color: var(--lui-color-fg, #d4d4d4);
|
|
@@ -10939,7 +10969,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
10939
10969
|
--lui-input-height: var(--lui-control-height-lg, 44px);
|
|
10940
10970
|
--lui-input-font-size: var(--lui-font-size);
|
|
10941
10971
|
}
|
|
10942
|
-
`],a([Er()],at.prototype,"value",2),a([Er({attribute:"selection-mode"})],at.prototype,"selectionMode",2),a([Er()],at.prototype,"placeholder",2),a([Er({reflect:!0})],at.prototype,"size",2),a([Er()],at.prototype,"mode",2),a([Er({attribute:"type"})],at.prototype,"type",2),a([Er({type:Boolean})],at.prototype,"disabled",2),a([Er({type:Boolean})],at.prototype,"readonly",2),a([Er({type:Boolean,reflect:!0})],at.prototype,"invalid",2),a([Er({type:Boolean})],at.prototype,"clearable",2),a([Er()],at.prototype,"min",2),a([Er()],at.prototype,"max",2),a([Er()],at.prototype,"name",2),a([Er()],at.prototype,"locale",2),a([Er({attribute:!1})],at.prototype,"translations",2),a([G1(".input")],at.prototype,"_inputEl",2),a([G1(".wrapper")],at.prototype,"_wrapperEl",2),at=a([ck("lui-datepicker")],at);import{css as hk,html as rn,LitElement as pk,nothing as fl}from"lit";import{customElement as mk,property as Yt,query as Y1,state as gk}from"lit/decorators.js";var fk=["#111827","#6b7280","#ef4444","#f97316","#f59e0b","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899"],De=(i,o,e)=>Math.min(e,Math.max(o,i)),zo=(i,o=0)=>{let e=10**o;return Math.round(i*e)/e},vl=i=>De(Math.round(i),0,255).toString(16).padStart(2,"0"),Ka=i=>(i%360+360)%360;function vk(i){let o=Ka(i.h),e=De(i.s,0,100)/100,t=De(i.v,0,100)/100,r=t*e,n=r*(1-Math.abs(o/60%2-1)),s=t-r,d=0,h=0,p=0;return o<60?[d,h,p]=[r,n,0]:o<120?[d,h,p]=[n,r,0]:o<180?[d,h,p]=[0,r,n]:o<240?[d,h,p]=[0,n,r]:o<300?[d,h,p]=[n,0,r]:[d,h,p]=[r,0,n],{r:Math.round((d+s)*255),g:Math.round((h+s)*255),b:Math.round((p+s)*255),a:De(i.a,0,1)}}function Ba(i){let o=De(i.r,0,255)/255,e=De(i.g,0,255)/255,t=De(i.b,0,255)/255,r=Math.max(o,e,t),n=Math.min(o,e,t),s=r-n,d=0;return s!==0&&(r===o?d=60*((e-t)/s%6):r===e?d=60*((t-o)/s+2):d=60*((o-e)/s+4)),{h:Ka(d),s:r===0?0:s/r*100,v:r*100,a:De(i.a,0,1)}}function bk(i){let o=De(i.r,0,255)/255,e=De(i.g,0,255)/255,t=De(i.b,0,255)/255,r=Math.max(o,e,t),n=Math.min(o,e,t),s=r-n,d=(r+n)/2,h=0,p=0;return s!==0&&(p=s/(1-Math.abs(2*d-1)),r===o?h=60*((e-t)/s%6):r===e?h=60*((t-o)/s+2):h=60*((o-e)/s+4)),{h:Ka(h),s:p*100,l:d*100,a:De(i.a,0,1)}}function X1(i){let o=Ka(i.h),e=De(i.s,0,100)/100,t=De(i.l,0,100)/100,r=(1-Math.abs(2*t-1))*e,n=r*(1-Math.abs(o/60%2-1)),s=t-r/2,d=0,h=0,p=0;return o<60?[d,h,p]=[r,n,0]:o<120?[d,h,p]=[n,r,0]:o<180?[d,h,p]=[0,r,n]:o<240?[d,h,p]=[0,n,r]:o<300?[d,h,p]=[n,0,r]:[d,h,p]=[r,0,n],{r:Math.round((d+s)*255),g:Math.round((h+s)*255),b:Math.round((p+s)*255),a:De(i.a,0,1)}}function qn(i,o=i.a<1){let e=`#${vl(i.r)}${vl(i.g)}${vl(i.b)}`;return o?`${e}${vl(i.a*255)}`:e}function yk(i){let o=i.trim().replace(/^#/,"");if(![3,4,6,8].includes(o.length)||/[^0-9a-f]/i.test(o))return null;let e=o.length<=4?o.split("").map(d=>d+d).join(""):o,t=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),s=e.length===8?parseInt(e.slice(6,8),16)/255:1;return{r:t,g:r,b:n,a:s}}function qa(i){let o=i.trim();if(!o)return null;if(o.startsWith("#")||/^[0-9a-f]{3,8}$/i.test(o))return yk(o);let e=o.match(/^rgba?\((.+)\)$/i);if(e){let r=e[1].split(/[,/\s]+/).filter(Boolean);if(r.length>=3){let n=Number.parseFloat(r[0]),s=Number.parseFloat(r[1]),d=Number.parseFloat(r[2]),h=r[3]==null?1:Number.parseFloat(r[3].replace("%",""))/(r[3].includes("%")?100:1);if([n,s,d,h].every(Number.isFinite))return{r:De(n,0,255),g:De(s,0,255),b:De(d,0,255),a:De(h,0,1)}}}let t=o.match(/^hsla?\((.+)\)$/i);if(t){let r=t[1].split(/[,/\s]+/).filter(Boolean);if(r.length>=3){let n=Number.parseFloat(r[0]),s=Number.parseFloat(r[1].replace("%","")),d=Number.parseFloat(r[2].replace("%","")),h=r[3]==null?1:Number.parseFloat(r[3].replace("%",""))/(r[3].includes("%")?100:1);if([n,s,d,h].every(Number.isFinite))return X1({h:n,s,l:d,a:h})}}return null}var qe=class extends pk{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u989C\u8272";this.size="md";this.format="hex";this.open=!1;this.disabled=!1;this.readonly=!1;this.invalid=!1;this.clearable=!0;this.backdrop="none";this.backdropStyle="";this.closeOnOutsidePress=!0;this.showAlpha=!0;this.placement="bottom-start";this.presetColors=fk.join(",");this._hsv={h:217,s:76,v:96,a:1};this._internalValueUpdate=!1;this._explicitAttrs=new Set;this._onOpen=()=>{this.open=!0};this._onClose=()=>{this.open=!1,this._emitChange()};this._clear=e=>{if(e.preventDefault(),e.stopPropagation(),this.disabled||this.readonly)return;this.value="";let t=this._detail();this.dispatchEvent(new CustomEvent("input",{detail:{...t,value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{...t,value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{...t,value:""},bubbles:!0,composed:!0}))};this._onSvPointerDown=e=>{this.disabled||this.readonly||(e.preventDefault(),this._svEl?.setPointerCapture?.(e.pointerId),this._updateSv(e))};this._onSvPointerMove=e=>{this._svEl?.hasPointerCapture?.(e.pointerId)&&this._updateSv(e)};this._onSvPointerUp=e=>{this._svEl?.hasPointerCapture?.(e.pointerId)&&(this._svEl.releasePointerCapture(e.pointerId),this._emitChange())};this._onHueInput=e=>{let t=Number(e.target.value);this._commit({...this._hsv,h:t},"input")};this._onAlphaInput=e=>{let t=Number(e.target.value)/100;this._commit({...this._hsv,a:t},"input")};this._onRangeChange=()=>this._emitChange();this._onHexChange=e=>{let t=e.target,r=qa(t.value);if(!r){t.value=this._hex;return}this._commit(Ba(r),"input"),this._emitChange()};this._onRgbChange=(e,t)=>{let n={...this._rgb,[e]:De(Number(t.target.value)||0,0,255)};this._commit(Ba(n),"input"),this._emitChange()};this._onHslChange=(e,t)=>{let r=this._hsl,n=e==="h"?360:100,s={...r,[e]:De(Number(t.target.value)||0,0,n)};this._commit(Ba(X1(s)),"input"),this._emitChange()};this._onAlphaFieldChange=e=>{let t=De(Number(e.target.value)||0,0,100)/100;this._commit({...this._hsv,a:t},"input"),this._emitChange()};this._choosePreset=e=>{if(this.disabled||this.readonly)return;let t=qa(e);t&&(this._commit(Ba(t),"input"),this._emitChange())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._syncFromValue(this.value)}willUpdate(){let e=N(this,"colorPicker");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("format")&&typeof e.format=="string"&&this.format!==e.format&&(this.format=e.format),!this._explicitAttrs.has("show-alpha")&&typeof e.showAlpha=="boolean"&&this.showAlpha!==e.showAlpha&&(this.showAlpha=e.showAlpha),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress)}updated(e){e.has("value")&&(this._internalValueUpdate||this._syncFromValue(this.value),this._internalValueUpdate=!1)}focus(){this.shadowRoot?.querySelector(".trigger")?.focus()}blur(){this.shadowRoot?.querySelector(".trigger")?.blur()}show(){this.disabled||this.readonly||this._dropdown?.show()}hide(){this._dropdown?.hide()}toggle(){this.disabled||this.readonly||this._dropdown?.toggle()}get _rgb(){return vk(this._effectiveHsv())}get _hsl(){return bk(this._rgb)}get _hex(){return qn(this._rgb,!1)}get _displayValue(){return this.value?this._formatValue():""}_effectiveHsv(){return{...this._hsv,a:this.showAlpha?De(this._hsv.a,0,1):1}}_syncFromValue(e){let t=qa(e);t&&(this._hsv=Ba({...t,a:this.showAlpha?t.a:1}))}_formatValue(e=this.format){let t=this._rgb,r=this._hsl,n=this.showAlpha?t.a:1;switch(e){case"rgb":return`rgb(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)})`;case"rgba":return`rgba(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)}, ${zo(n,2)})`;case"hsl":return`hsl(${Math.round(r.h)}, ${Math.round(r.s)}%, ${Math.round(r.l)}%)`;case"hsla":return`hsla(${Math.round(r.h)}, ${Math.round(r.s)}%, ${Math.round(r.l)}%, ${zo(n,2)})`;case"hex":default:return qn({...t,a:n},this.showAlpha&&n<1)}}_detail(){let e=this._rgb,t=this._hsl,r=this._effectiveHsv();return{value:this._formatValue(),hex:qn(e,this.showAlpha&&e.a<1),rgb:{r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b),a:zo(e.a,3)},hsl:{h:Math.round(t.h),s:Math.round(t.s),l:Math.round(t.l),a:zo(t.a,3)},hsv:{h:Math.round(r.h),s:Math.round(r.s),v:Math.round(r.v),a:zo(r.a,3)},alpha:zo(e.a,3)}}_commit(e,t="input"){this._hsv={h:Ka(e.h),s:De(e.s,0,100),v:De(e.v,0,100),a:this.showAlpha?De(e.a,0,1):1};let r=this._detail();this._internalValueUpdate=!0,this.value=r.value,this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:this._detail(),bubbles:!0,composed:!0}))}_updateSv(e){let t=this._svEl?.getBoundingClientRect();if(!t)return;let r=De((e.clientX-t.left)/t.width*100,0,100),n=De(100-(e.clientY-t.top)/t.height*100,0,100);this._commit({...this._hsv,s:r,v:n},"input")}async _copyValue(){let e=this._detail();try{await navigator.clipboard?.writeText(e.value),this.dispatchEvent(new CustomEvent("copy",{detail:e,bubbles:!0,composed:!0}))}catch{this.dispatchEvent(new CustomEvent("copy",{detail:{...e,error:!0},bubbles:!0,composed:!0}))}}_presetList(){return(this.swatches??this.presetColors.split(",")).map(t=>t.trim()).filter(Boolean).filter(t=>qa(t))}_panel(){let e=this._rgb,t=this._hsl,r=this._effectiveHsv(),n=this.value?`rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${zo(e.a,3)})`:"transparent",s=`rgb(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)})`,d=`--hue:${zo(r.h,2)};--sat:${zo(r.s,2)}%;--val-y:${zo(100-r.v,2)}%;--current-color:${n};--opaque-color:${s};`,h=this._presetList(),p=qn(e,!1).toLowerCase();return rn`
|
|
10972
|
+
`],a([zr()],at.prototype,"value",2),a([zr({attribute:"selection-mode"})],at.prototype,"selectionMode",2),a([zr()],at.prototype,"placeholder",2),a([zr({reflect:!0})],at.prototype,"size",2),a([zr()],at.prototype,"mode",2),a([zr({attribute:"type"})],at.prototype,"type",2),a([zr({type:Boolean})],at.prototype,"disabled",2),a([zr({type:Boolean})],at.prototype,"readonly",2),a([zr({type:Boolean,reflect:!0})],at.prototype,"invalid",2),a([zr({type:Boolean})],at.prototype,"clearable",2),a([zr()],at.prototype,"min",2),a([zr()],at.prototype,"max",2),a([zr()],at.prototype,"name",2),a([zr()],at.prototype,"locale",2),a([zr({attribute:!1})],at.prototype,"translations",2),a([G1(".input")],at.prototype,"_inputEl",2),a([G1(".wrapper")],at.prototype,"_wrapperEl",2),at=a([ck("lui-datepicker")],at);import{css as hk,html as rn,LitElement as pk,nothing as fl}from"lit";import{customElement as mk,property as Yt,query as Y1,state as gk}from"lit/decorators.js";var fk=["#111827","#6b7280","#ef4444","#f97316","#f59e0b","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#ec4899"],De=(i,o,e)=>Math.min(e,Math.max(o,i)),zo=(i,o=0)=>{let e=10**o;return Math.round(i*e)/e},vl=i=>De(Math.round(i),0,255).toString(16).padStart(2,"0"),Ka=i=>(i%360+360)%360;function vk(i){let o=Ka(i.h),e=De(i.s,0,100)/100,t=De(i.v,0,100)/100,r=t*e,n=r*(1-Math.abs(o/60%2-1)),s=t-r,d=0,h=0,p=0;return o<60?[d,h,p]=[r,n,0]:o<120?[d,h,p]=[n,r,0]:o<180?[d,h,p]=[0,r,n]:o<240?[d,h,p]=[0,n,r]:o<300?[d,h,p]=[n,0,r]:[d,h,p]=[r,0,n],{r:Math.round((d+s)*255),g:Math.round((h+s)*255),b:Math.round((p+s)*255),a:De(i.a,0,1)}}function Ba(i){let o=De(i.r,0,255)/255,e=De(i.g,0,255)/255,t=De(i.b,0,255)/255,r=Math.max(o,e,t),n=Math.min(o,e,t),s=r-n,d=0;return s!==0&&(r===o?d=60*((e-t)/s%6):r===e?d=60*((t-o)/s+2):d=60*((o-e)/s+4)),{h:Ka(d),s:r===0?0:s/r*100,v:r*100,a:De(i.a,0,1)}}function bk(i){let o=De(i.r,0,255)/255,e=De(i.g,0,255)/255,t=De(i.b,0,255)/255,r=Math.max(o,e,t),n=Math.min(o,e,t),s=r-n,d=(r+n)/2,h=0,p=0;return s!==0&&(p=s/(1-Math.abs(2*d-1)),r===o?h=60*((e-t)/s%6):r===e?h=60*((t-o)/s+2):h=60*((o-e)/s+4)),{h:Ka(h),s:p*100,l:d*100,a:De(i.a,0,1)}}function X1(i){let o=Ka(i.h),e=De(i.s,0,100)/100,t=De(i.l,0,100)/100,r=(1-Math.abs(2*t-1))*e,n=r*(1-Math.abs(o/60%2-1)),s=t-r/2,d=0,h=0,p=0;return o<60?[d,h,p]=[r,n,0]:o<120?[d,h,p]=[n,r,0]:o<180?[d,h,p]=[0,r,n]:o<240?[d,h,p]=[0,n,r]:o<300?[d,h,p]=[n,0,r]:[d,h,p]=[r,0,n],{r:Math.round((d+s)*255),g:Math.round((h+s)*255),b:Math.round((p+s)*255),a:De(i.a,0,1)}}function qn(i,o=i.a<1){let e=`#${vl(i.r)}${vl(i.g)}${vl(i.b)}`;return o?`${e}${vl(i.a*255)}`:e}function yk(i){let o=i.trim().replace(/^#/,"");if(![3,4,6,8].includes(o.length)||/[^0-9a-f]/i.test(o))return null;let e=o.length<=4?o.split("").map(d=>d+d).join(""):o,t=parseInt(e.slice(0,2),16),r=parseInt(e.slice(2,4),16),n=parseInt(e.slice(4,6),16),s=e.length===8?parseInt(e.slice(6,8),16)/255:1;return{r:t,g:r,b:n,a:s}}function qa(i){let o=i.trim();if(!o)return null;if(o.startsWith("#")||/^[0-9a-f]{3,8}$/i.test(o))return yk(o);let e=o.match(/^rgba?\((.+)\)$/i);if(e){let r=e[1].split(/[,/\s]+/).filter(Boolean);if(r.length>=3){let n=Number.parseFloat(r[0]),s=Number.parseFloat(r[1]),d=Number.parseFloat(r[2]),h=r[3]==null?1:Number.parseFloat(r[3].replace("%",""))/(r[3].includes("%")?100:1);if([n,s,d,h].every(Number.isFinite))return{r:De(n,0,255),g:De(s,0,255),b:De(d,0,255),a:De(h,0,1)}}}let t=o.match(/^hsla?\((.+)\)$/i);if(t){let r=t[1].split(/[,/\s]+/).filter(Boolean);if(r.length>=3){let n=Number.parseFloat(r[0]),s=Number.parseFloat(r[1].replace("%","")),d=Number.parseFloat(r[2].replace("%","")),h=r[3]==null?1:Number.parseFloat(r[3].replace("%",""))/(r[3].includes("%")?100:1);if([n,s,d,h].every(Number.isFinite))return X1({h:n,s,l:d,a:h})}}return null}var qe=class extends pk{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u989C\u8272";this.size="md";this.format="hex";this.open=!1;this.disabled=!1;this.readonly=!1;this.invalid=!1;this.clearable=!0;this.backdrop="none";this.backdropStyle="";this.closeOnOutsidePress=!0;this.showAlpha=!0;this.placement="bottom-start";this.presetColors=fk.join(",");this._hsv={h:217,s:76,v:96,a:1};this._internalValueUpdate=!1;this._explicitAttrs=new Set;this._onOpen=()=>{this.open=!0};this._onClose=()=>{this.open=!1,this._emitChange()};this._clear=e=>{if(e.preventDefault(),e.stopPropagation(),this.disabled||this.readonly)return;this.value="";let t=this._detail();this.dispatchEvent(new CustomEvent("input",{detail:{...t,value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{...t,value:""},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{...t,value:""},bubbles:!0,composed:!0}))};this._onSvPointerDown=e=>{this.disabled||this.readonly||(e.preventDefault(),this._svEl?.setPointerCapture?.(e.pointerId),this._updateSv(e))};this._onSvPointerMove=e=>{this._svEl?.hasPointerCapture?.(e.pointerId)&&this._updateSv(e)};this._onSvPointerUp=e=>{this._svEl?.hasPointerCapture?.(e.pointerId)&&(this._svEl.releasePointerCapture(e.pointerId),this._emitChange())};this._onHueInput=e=>{let t=Number(e.target.value);this._commit({...this._hsv,h:t},"input")};this._onAlphaInput=e=>{let t=Number(e.target.value)/100;this._commit({...this._hsv,a:t},"input")};this._onRangeChange=()=>this._emitChange();this._onHexChange=e=>{let t=e.target,r=qa(t.value);if(!r){t.value=this._hex;return}this._commit(Ba(r),"input"),this._emitChange()};this._onRgbChange=(e,t)=>{let n={...this._rgb,[e]:De(Number(t.target.value)||0,0,255)};this._commit(Ba(n),"input"),this._emitChange()};this._onHslChange=(e,t)=>{let r=this._hsl,n=e==="h"?360:100,s={...r,[e]:De(Number(t.target.value)||0,0,n)};this._commit(Ba(X1(s)),"input"),this._emitChange()};this._onAlphaFieldChange=e=>{let t=De(Number(e.target.value)||0,0,100)/100;this._commit({...this._hsv,a:t},"input"),this._emitChange()};this._choosePreset=e=>{if(this.disabled||this.readonly)return;let t=qa(e);t&&(this._commit(Ba(t),"input"),this._emitChange())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._syncFromValue(this.value)}willUpdate(){let e=N(this,"colorPicker");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("format")&&typeof e.format=="string"&&this.format!==e.format&&(this.format=e.format),!this._explicitAttrs.has("show-alpha")&&typeof e.showAlpha=="boolean"&&this.showAlpha!==e.showAlpha&&(this.showAlpha=e.showAlpha),!this._explicitAttrs.has("backdrop")&&typeof e.backdrop=="string"&&this.backdrop!==e.backdrop&&(this.backdrop=e.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof e.backdropStyle=="string"&&this.backdropStyle!==e.backdropStyle&&(this.backdropStyle=e.backdropStyle),!this._explicitAttrs.has("close-on-outside-press")&&typeof e.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==e.closeOnOutsidePress&&(this.closeOnOutsidePress=e.closeOnOutsidePress)}updated(e){e.has("value")&&(this._internalValueUpdate||this._syncFromValue(this.value),this._internalValueUpdate=!1)}focus(){this.shadowRoot?.querySelector(".trigger")?.focus()}blur(){this.shadowRoot?.querySelector(".trigger")?.blur()}show(){this.disabled||this.readonly||this._dropdown?.show()}hide(){this._dropdown?.hide()}toggle(){this.disabled||this.readonly||this._dropdown?.toggle()}get _rgb(){return vk(this._effectiveHsv())}get _hsl(){return bk(this._rgb)}get _hex(){return qn(this._rgb,!1)}get _displayValue(){return this.value?this._formatValue():""}_effectiveHsv(){return{...this._hsv,a:this.showAlpha?De(this._hsv.a,0,1):1}}_syncFromValue(e){let t=qa(e);t&&(this._hsv=Ba({...t,a:this.showAlpha?t.a:1}))}_formatValue(e=this.format){let t=this._rgb,r=this._hsl,n=this.showAlpha?t.a:1;switch(e){case"rgb":return`rgb(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)})`;case"rgba":return`rgba(${Math.round(t.r)}, ${Math.round(t.g)}, ${Math.round(t.b)}, ${zo(n,2)})`;case"hsl":return`hsl(${Math.round(r.h)}, ${Math.round(r.s)}%, ${Math.round(r.l)}%)`;case"hsla":return`hsla(${Math.round(r.h)}, ${Math.round(r.s)}%, ${Math.round(r.l)}%, ${zo(n,2)})`;case"hex":default:return qn({...t,a:n},this.showAlpha&&n<1)}}_detail(){let e=this._rgb,t=this._hsl,r=this._effectiveHsv();return{value:this._formatValue(),hex:qn(e,this.showAlpha&&e.a<1),rgb:{r:Math.round(e.r),g:Math.round(e.g),b:Math.round(e.b),a:zo(e.a,3)},hsl:{h:Math.round(t.h),s:Math.round(t.s),l:Math.round(t.l),a:zo(t.a,3)},hsv:{h:Math.round(r.h),s:Math.round(r.s),v:Math.round(r.v),a:zo(r.a,3)},alpha:zo(e.a,3)}}_commit(e,t="input"){this._hsv={h:Ka(e.h),s:De(e.s,0,100),v:De(e.v,0,100),a:this.showAlpha?De(e.a,0,1):1};let r=this._detail();this._internalValueUpdate=!0,this.value=r.value,this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0}))}_emitChange(){this.dispatchEvent(new CustomEvent("change",{detail:this._detail(),bubbles:!0,composed:!0}))}_updateSv(e){let t=this._svEl?.getBoundingClientRect();if(!t)return;let r=De((e.clientX-t.left)/t.width*100,0,100),n=De(100-(e.clientY-t.top)/t.height*100,0,100);this._commit({...this._hsv,s:r,v:n},"input")}async _copyValue(){let e=this._detail();try{await navigator.clipboard?.writeText(e.value),this.dispatchEvent(new CustomEvent("copy",{detail:e,bubbles:!0,composed:!0}))}catch{this.dispatchEvent(new CustomEvent("copy",{detail:{...e,error:!0},bubbles:!0,composed:!0}))}}_presetList(){return(this.swatches??this.presetColors.split(",")).map(t=>t.trim()).filter(Boolean).filter(t=>qa(t))}_panel(){let e=this._rgb,t=this._hsl,r=this._effectiveHsv(),n=this.value?`rgba(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)}, ${zo(e.a,3)})`:"transparent",s=`rgb(${Math.round(e.r)}, ${Math.round(e.g)}, ${Math.round(e.b)})`,d=`--hue:${zo(r.h,2)};--sat:${zo(r.s,2)}%;--val-y:${zo(100-r.v,2)}%;--current-color:${n};--opaque-color:${s};`,h=this._presetList(),p=qn(e,!1).toLowerCase();return rn`
|
|
10943
10973
|
<div class="panel" part="panel" style=${d} @click=${f=>f.stopPropagation()}>
|
|
10944
10974
|
<div class="hero">
|
|
10945
10975
|
<div class="preview" part="preview"><div class="preview-inner"></div></div>
|
|
@@ -11553,7 +11583,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
11553
11583
|
--lui-form-item-control-height: var(--lui-control-height-lg, 44px);
|
|
11554
11584
|
--lui-form-item-gap: 6px;
|
|
11555
11585
|
}
|
|
11556
|
-
`],a([Ur()],jt.prototype,"label",2),a([Ur({type:Boolean})],jt.prototype,"required",2),a([Ur()],jt.prototype,"description",2),a([Ur()],jt.prototype,"help",2),a([Ur()],jt.prototype,"extra",2),a([Ur()],jt.prototype,"tooltip",2),a([Ur({attribute:!1})],jt.prototype,"errors",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"invalid",2),a([Ur({type:Boolean,attribute:"hidden-label"})],jt.prototype,"hiddenLabel",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"inline",2),a([Ur({reflect:!0})],jt.prototype,"size",2),a([Ur({reflect:!0,attribute:"label-placement"})],jt.prototype,"labelPlacement",2),a([Ur({attribute:"label-width"})],jt.prototype,"labelWidth",2),jt=a([wk("lui-form-item")],jt);function Nd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ua=new Map;function Ak(i,o){return Ua.set(i,o),()=>{Ua.get(i)===o&&Ua.delete(i)}}function Pk(i){Ua.delete(i)}function Fd(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Fd(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function kl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function jk(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=kl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ok(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return $k(r)?n=>Tk.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function on(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>on(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...on(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...on(e.fields,o)),Array.from(new Set(t))}return[]}function Wn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(Wn):typeof i=="object"?Object.values(i).some(Wn):!1}function Hk(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var ue,xt=class extends Mk{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";hh(this,ue);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,ue)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,ue).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,ue)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,ue)){for(let[r,n]of Object.entries(e))ve(this,ue).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return kl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,ue)&&(ve(this,ue).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,ue).api.validateField(d,"submit"))),n=await ve(this,ue).api.validate("submit"),s=!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)&&this._getFormErrorMessages(ve(this,ue)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,ue).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,ue)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,ue).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,ue)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,ue)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,ue)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,ue).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return mt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=N(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Fd(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ph(this,ue,new Sk(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Hk(this.schema,n)}catch(s){let d=on(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,ue)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,ue)?.api?.state?.values??{},r=jk(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_isFieldRenderable(e){return e.type==="group"||e.type==="array"||e.type==="button"?!0:this._getFieldCondition(e).visible}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return je;let d={name:e.name},h={...e,required:s.required},p=Ok(h);return p&&(d.validators=p),t.field(d,f=>{let x=on(f.state.meta.errors||[],{includeFieldErrors:!0}),k=f.state.meta.isTouched||ve(this,ue).api.state.submissionAttempts>0,C=k&&x.length>0,S=fe=>{let Te=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,Te)},z={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:k,invalid:x.length>0,formValues:ve(this,ue).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,z)),P=h.hiddenLabel?"":h.label??"",H=Z`
|
|
11586
|
+
`],a([Ur()],jt.prototype,"label",2),a([Ur({type:Boolean})],jt.prototype,"required",2),a([Ur()],jt.prototype,"description",2),a([Ur()],jt.prototype,"help",2),a([Ur()],jt.prototype,"extra",2),a([Ur()],jt.prototype,"tooltip",2),a([Ur({attribute:!1})],jt.prototype,"errors",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"invalid",2),a([Ur({type:Boolean,attribute:"hidden-label"})],jt.prototype,"hiddenLabel",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"inline",2),a([Ur({reflect:!0})],jt.prototype,"size",2),a([Ur({reflect:!0,attribute:"label-placement"})],jt.prototype,"labelPlacement",2),a([Ur({attribute:"label-width"})],jt.prototype,"labelWidth",2),jt=a([wk("lui-form-item")],jt);function Nd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ua=new Map;function Ak(i,o){return Ua.set(i,o),()=>{Ua.get(i)===o&&Ua.delete(i)}}function Pk(i){Ua.delete(i)}function Fd(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Fd(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function kl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function jk(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=kl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ok(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return $k(r)?n=>Tk.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function on(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>on(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...on(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...on(e.fields,o)),Array.from(new Set(t))}return[]}function Wn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(Wn):typeof i=="object"?Object.values(i).some(Wn):!1}function Hk(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var ue,kt=class extends Mk{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";hh(this,ue);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,ue)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,ue).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,ue)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,ue)){for(let[r,n]of Object.entries(e))ve(this,ue).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return kl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,ue)&&(ve(this,ue).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,ue).api.validateField(d,"submit"))),n=await ve(this,ue).api.validate("submit"),s=!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)&&this._getFormErrorMessages(ve(this,ue)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,ue).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,ue)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,ue).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,ue)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,ue)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,ue)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,ue).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return mt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=N(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Fd(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ph(this,ue,new Sk(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Hk(this.schema,n)}catch(s){let d=on(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,ue)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,ue)?.api?.state?.values??{},r=jk(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_isFieldRenderable(e){return e.type==="group"||e.type==="array"||e.type==="button"?!0:this._getFieldCondition(e).visible}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return je;let d={name:e.name},h={...e,required:s.required},p=Ok(h);return p&&(d.validators=p),t.field(d,f=>{let x=on(f.state.meta.errors||[],{includeFieldErrors:!0}),k=f.state.meta.isTouched||ve(this,ue).api.state.submissionAttempts>0,C=k&&x.length>0,S=fe=>{let Te=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,Te)},z={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:k,invalid:x.length>0,formValues:ve(this,ue).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,z)),P=h.hiddenLabel?"":h.label??"",H=Z`
|
|
11557
11587
|
<lui-form-item
|
|
11558
11588
|
data-field-name=${h.name}
|
|
11559
11589
|
.label=${P}
|
|
@@ -11665,7 +11695,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
11665
11695
|
<span class="form-status-title">提交成功</span>
|
|
11666
11696
|
<span class="form-status-message">${this._submitSuccessMessage}</span>
|
|
11667
11697
|
</div>
|
|
11668
|
-
`}_renderFormDescription(){return this.schema?.description?Z`<div class="form-description">${this.schema.description}</div>`:je}_shouldShowActions(){return this.schema?.showActions??this.showActions}_collectVisibleFieldNames(e,t=""){let r=ve(this,ue)?.api?.state?.values??{},n=[];for(let s of e){let d=t?`${t}.${s.name}`:s.name,h=this._getFieldCondition(s);if(!(!h.visible||h.disabled)){if(s.type==="group"&&s.fields){n.push(...this._collectVisibleFieldNames(s.fields,t));continue}if(s.type==="array"){if(n.push(d),s.fields){let p=kl(r,d);if(Array.isArray(p))for(let f=0;f<p.length;f+=1)n.push(...this._collectVisibleFieldNames(s.fields,`${d}[${f}]`))}continue}n.push(d)}}return n}_markFieldsTouched(e){for(let t of e){let r=n=>({...n,isTouched:!0,isBlurred:!0});ve(this,ue).api.setFieldMeta(t,n=>r(n))}}_hasFieldErrors(e){return e.some(t=>(ve(this,ue).api.getFieldMeta(t)?.errors?.length??0)>0)}async _validateStep(e){let t=Array.from(new Set(this._collectVisibleFieldNames(e)));if(!t.length)return!0;this._markFieldsTouched(t);let r=await Promise.all(t.map(s=>ve(this,ue).api.validateField(s,"submit"))),n=this.schema?.validators?.onSubmit||this.schema?.validators?.onSubmitAsync?await ve(this,ue).api.validate("submit"):void 0;return!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)}async _goNextStep(){if(this._isStepPending||ve(this,ue).api.state.isSubmitting||!this.schema?.steps)return;let e=this.schema.steps[this._currentStep];if(e){this._isStepPending=!0;try{await this._validateStep(e.fields)?this._currentStep+=1:this._scrollToFirstError()}finally{this._isStepPending=!1}}}_applyProps(e,t,r){if(!e)return;let n=e;r&&Object.assign(n,r),n.tagName==="LUI-SELECT"&&!n.style.width&&(n.style.width="100%");let s=t,d=
|
|
11698
|
+
`}_renderFormDescription(){return this.schema?.description?Z`<div class="form-description">${this.schema.description}</div>`:je}_shouldShowActions(){return this.schema?.showActions??this.showActions}_collectVisibleFieldNames(e,t=""){let r=ve(this,ue)?.api?.state?.values??{},n=[];for(let s of e){let d=t?`${t}.${s.name}`:s.name,h=this._getFieldCondition(s);if(!(!h.visible||h.disabled)){if(s.type==="group"&&s.fields){n.push(...this._collectVisibleFieldNames(s.fields,t));continue}if(s.type==="array"){if(n.push(d),s.fields){let p=kl(r,d);if(Array.isArray(p))for(let f=0;f<p.length;f+=1)n.push(...this._collectVisibleFieldNames(s.fields,`${d}[${f}]`))}continue}n.push(d)}}return n}_markFieldsTouched(e){for(let t of e){let r=n=>({...n,isTouched:!0,isBlurred:!0});ve(this,ue).api.setFieldMeta(t,n=>r(n))}}_hasFieldErrors(e){return e.some(t=>(ve(this,ue).api.getFieldMeta(t)?.errors?.length??0)>0)}async _validateStep(e){let t=Array.from(new Set(this._collectVisibleFieldNames(e)));if(!t.length)return!0;this._markFieldsTouched(t);let r=await Promise.all(t.map(s=>ve(this,ue).api.validateField(s,"submit"))),n=this.schema?.validators?.onSubmit||this.schema?.validators?.onSubmitAsync?await ve(this,ue).api.validate("submit"):void 0;return!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)}async _goNextStep(){if(this._isStepPending||ve(this,ue).api.state.isSubmitting||!this.schema?.steps)return;let e=this.schema.steps[this._currentStep];if(e){this._isStepPending=!0;try{await this._validateStep(e.fields)?this._currentStep+=1:this._scrollToFirstError()}finally{this._isStepPending=!1}}}_applyProps(e,t,r){if(!e)return;let n=e;r&&Object.assign(n,r),n.tagName==="LUI-SELECT"&&!n.style.width&&(n.style.width="100%");let s=t,d=kt._elEvents.get(e)??new Set;for(let h of Object.keys(s))if(!(kt.FORM_KEYS.has(h)||s[h]==null)){if(typeof s[h]=="function"){if(h.startsWith("on")&&!d.has(h)){let p=h.slice(2).toLowerCase();e.addEventListener(p,s[h]),d.add(h)}continue}n[h]=s[h]}if(t.props)for(let[h,p]of Object.entries(t.props))p!=null&&(typeof p=="function"&&h.startsWith("on")?d.has(h)||(e.addEventListener(h.slice(2).toLowerCase(),p),d.add(h)):n[h]=p);kt._elEvents.set(e,d)}_withProps(e,t,r){return Z`<span style="display:contents" ${yl(n=>{let s=n?.firstElementChild;this._applyProps(s,e,r)})}>${t}</span>`}_renderControl(e,t,r,n,s){if(e.renderControl)return e.renderControl(s);let d=Ua.get(e.type);if(d)return d(s);let h=t.state.value,p=this._effectiveSize(e),f=k=>{s.handleChange(k.detail.value)},x=()=>t.handleBlur();switch(e.type){case"textarea":return Z`<lui-textarea
|
|
11669
11699
|
.value=${h??""}
|
|
11670
11700
|
.size=${p}
|
|
11671
11701
|
?disabled=${r}
|
|
@@ -11867,7 +11897,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
11867
11897
|
</div>`:je}
|
|
11868
11898
|
`}
|
|
11869
11899
|
</form>
|
|
11870
|
-
`)}};ue=new WeakMap,
|
|
11900
|
+
`)}};ue=new WeakMap,kt.styles=[A,O,_k`
|
|
11871
11901
|
:host {
|
|
11872
11902
|
display: block;
|
|
11873
11903
|
}
|
|
@@ -12128,7 +12158,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
12128
12158
|
color: var(--lui-color-fg-muted);
|
|
12129
12159
|
margin-top: 2px;
|
|
12130
12160
|
}
|
|
12131
|
-
`],
|
|
12161
|
+
`],kt.FORM_KEYS=new Set(["name","type","label","required","disabled","readonly","hidden","condition","span","xs","sm","md","lg","xl","offset","order","validators","fields","size","labelPlacement","labelWidth","defaultValue","description","min","max","step","length","source","renderControl","renderField","props","addLabel","removeLabel","itemLabel","minItems","maxItems","collapsible","defaultCollapsed","draggable","hiddenLabel","help","tooltip","extra","validateTrigger","onClick"]),kt._elEvents=new WeakMap,a([Wa({attribute:!1})],kt.prototype,"schema",2),a([Wa({type:Boolean,attribute:"show-actions"})],kt.prototype,"showActions",2),a([Wa({reflect:!0})],kt.prototype,"size",2),a([Wa({reflect:!0,attribute:"label-placement"})],kt.prototype,"labelPlacement",2),a([Wa({attribute:"label-width"})],kt.prototype,"labelWidth",2),a([bl()],kt.prototype,"_currentStep",2),a([bl()],kt.prototype,"_isStepPending",2),a([bl()],kt.prototype,"_submitErrorMessages",2),a([bl()],kt.prototype,"_submitSuccessMessage",2),kt=a([Ck("lui-form")],kt);import{css as Rk,html as Ga,LitElement as Ik,nothing as Ld}from"lit";import{customElement as Vk,property as $i,query as Dk,queryAll as Nk}from"lit/decorators.js";var sr=class extends Ik{constructor(){super(...arguments);this.source=[];this.direction="horizontal";this.size="md";this.disabled=!1;this.radioProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-radio"||this._select(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}firstUpdated(){this._scheduleSync()}willUpdate(){let e=N(this,"radioGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("size")||e.has("name")||e.has("source")||e.has("radioProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedRadios(),this._syncRenderedRadios()})}_getSlottedRadios(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-radio"):[]}_mergedRadioProps(){return{...N(this,"radioGroup").radioProps??{},...this.radioProps??{}}}_syncRenderedRadios(){if(!this.source.length)return;let e=this._mergedRadioProps();for(let t of this._renderedRadios??[])oe(t,e)}_syncSlottedRadios(){if(this.source.length>0)return;let e=this._getSlottedRadios();for(let t of e){let r=t.value??"";t.checked=r===(this.value??""),this.disabled?(t.disabled||t.setAttribute("data-lui-radio-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-radio-group-disabled")&&(t.removeAttribute("data-lui-radio-group-disabled"),t.disabled=!1),t.size=this.size,this.name&&(t.name=this.name)}}_select(e){this.value!==e&&(this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})))}_renderOption(e){let t={...this._mergedRadioProps(),checked:e.value===(this.value??""),value:e.value,label:e.label,description:e.description??"",name:this.name??"",size:e.size??this.size,checkedIcon:e.checkedIcon??this.radioProps.checkedIcon??"",disabled:this.disabled||(e.disabled??!1)};return Ga`
|
|
12132
12162
|
<lui-radio
|
|
12133
12163
|
.checked=${t.checked}
|
|
12134
12164
|
.value=${t.value}
|
|
@@ -12170,7 +12200,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
12170
12200
|
color: var(--lui-color-fg);
|
|
12171
12201
|
margin-bottom: var(--lui-space-1, 4px);
|
|
12172
12202
|
}
|
|
12173
|
-
`],a([$i({attribute:!1})],sr.prototype,"source",2),a([$i()],sr.prototype,"value",2),a([$i({reflect:!0})],sr.prototype,"direction",2),a([$i({reflect:!0})],sr.prototype,"size",2),a([$i()],sr.prototype,"name",2),a([$i()],sr.prototype,"label",2),a([$i({type:Boolean})],sr.prototype,"disabled",2),a([$i({attribute:!1})],sr.prototype,"radioProps",2),a([Dk("slot")],sr.prototype,"_slotEl",2),a([Nk("lui-radio")],sr.prototype,"_renderedRadios",2),sr=a([Vk("lui-radio-group")],sr);import{css as Q1,html as J1,LitElement as e0}from"lit";import{customElement as t0,property as
|
|
12203
|
+
`],a([$i({attribute:!1})],sr.prototype,"source",2),a([$i()],sr.prototype,"value",2),a([$i({reflect:!0})],sr.prototype,"direction",2),a([$i({reflect:!0})],sr.prototype,"size",2),a([$i()],sr.prototype,"name",2),a([$i()],sr.prototype,"label",2),a([$i({type:Boolean})],sr.prototype,"disabled",2),a([$i({attribute:!1})],sr.prototype,"radioProps",2),a([Dk("slot")],sr.prototype,"_slotEl",2),a([Nk("lui-radio")],sr.prototype,"_renderedRadios",2),sr=a([Vk("lui-radio-group")],sr);import{css as Q1,html as J1,LitElement as e0}from"lit";import{customElement as t0,property as Er,query as Z1}from"lit/decorators.js";import Fk from"flatpickr";import{Mandarin as Lk}from"flatpickr/dist/l10n/zh.js";import"flatpickr/dist/flatpickr.min.css";var lr=class extends e0{constructor(){super(...arguments);this.value="";this.selectionMode="single";this.size="md";this.disabled=!1;this.showMonths=1;this.defaultDate="";this._fp=null}firstUpdated(){this._init()}disconnectedCallback(){this._destroy(),super.disconnectedCallback()}updated(e){if(this._fp){if(e.has("value")){let t=this._dateInputValue();t?this._fp.setDate(t,!1):this._fp.clear()}(e.has("selectionMode")||e.has("min")||e.has("max")||e.has("disabled")||e.has("showMonths")||e.has("defaultDate"))&&this._init()}}clear(){this.value="",this._fp?.clear(),this._emitChange([],"")}_destroy(){this._fp?.destroy(),this._fp=null,this._hostEl&&(this._hostEl.innerHTML="")}_dateInputValue(){return this.value?this.selectionMode==="range"?this.value.split(" ~ ").map(e=>e.trim()).filter(Boolean):this.value:this.defaultDate||void 0}_init(){if(!this._inputEl||!this._hostEl)return;this._destroy();let e=Math.max(1,Math.min(3,Math.round(this.showMonths||1)));this._fp=Fk(this._inputEl,{locale:Lk,inline:!0,appendTo:this._hostEl,clickOpens:!1,dateFormat:"Y-m-d",mode:this.selectionMode==="range"?"range":"single",conjunction:" ~ ",...this._dateInputValue()?{defaultDate:this._dateInputValue()}:{},minDate:this.min||void 0,maxDate:this.max||void 0,showMonths:e,disableMobile:!0,onReady:()=>{this._fp?.calendarContainer.classList.add("lui-calendar-panel"),this._forceCalendarVisible()},onChange:(t,r)=>{this.disabled||(this.value=r,this._emitChange(t,r))}}),this._forceCalendarVisible(),this.disabled&&(this._fp.input.disabled=!0,this._fp.calendarContainer.style.pointerEvents="none",this._fp.calendarContainer.style.opacity="0.55")}_forceCalendarVisible(){let e=this._fp?.calendarContainer;e&&(e.style.position="static",e.style.display="block",e.style.opacity="1",e.style.visibility="visible",e.style.pointerEvents=this.disabled?"none":"auto")}_emitChange(e,t){let r=t?t.split(" ~ ").map(n=>n.trim()).filter(Boolean):[];this.dispatchEvent(new CustomEvent("change",{detail:{value:t,values:r,dates:e},bubbles:!0,composed:!0}))}render(){return J1`
|
|
12174
12204
|
<div class="wrap" part="wrap">
|
|
12175
12205
|
<input class="input" aria-hidden="true" tabindex="-1" ?disabled=${this.disabled} />
|
|
12176
12206
|
<div class="host" part="calendar"></div>
|
|
@@ -12476,7 +12506,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
12476
12506
|
.host .numInputWrapper span.arrowDown:after {
|
|
12477
12507
|
border-top-color: var(--lui-color-fg-muted);
|
|
12478
12508
|
}
|
|
12479
|
-
`],a([
|
|
12509
|
+
`],a([Er()],lr.prototype,"value",2),a([Er({attribute:"selection-mode",reflect:!0})],lr.prototype,"selectionMode",2),a([Er({reflect:!0})],lr.prototype,"size",2),a([Er()],lr.prototype,"min",2),a([Er()],lr.prototype,"max",2),a([Er({type:Boolean})],lr.prototype,"disabled",2),a([Er({type:Number,attribute:"show-months"})],lr.prototype,"showMonths",2),a([Er({attribute:"default-date"})],lr.prototype,"defaultDate",2),a([Z1(".input")],lr.prototype,"_inputEl",2),a([Z1(".host")],lr.prototype,"_hostEl",2),lr=a([t0("lui-calendar")],lr);var Gr=class extends e0{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u65E5\u671F\u8303\u56F4";this.size="md";this.disabled=!1;this.clearable=!0;this._onChange=e=>{let t=e.detail;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}}render(){return J1`
|
|
12480
12510
|
<lui-datepicker
|
|
12481
12511
|
type="date"
|
|
12482
12512
|
selection-mode="range"
|
|
@@ -12489,7 +12519,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
12489
12519
|
.clearable=${this.clearable}
|
|
12490
12520
|
@change=${this._onChange}
|
|
12491
12521
|
></lui-datepicker>
|
|
12492
|
-
`}};Gr.styles=[A,O,Q1`:host{display:block;width:100%;}`],a([Sr()],Gr.prototype,"value",2),a([Sr()],Gr.prototype,"placeholder",2),a([Sr({reflect:!0})],Gr.prototype,"size",2),a([Sr()],Gr.prototype,"min",2),a([Sr()],Gr.prototype,"max",2),a([Sr({type:Boolean})],Gr.prototype,"disabled",2),a([Sr({type:Boolean})],Gr.prototype,"clearable",2),Gr=a([t0("lui-date-range-picker")],Gr);import{css as Kk,html as Gn,LitElement as Wk,nothing as nn}from"lit";import{customElement as Uk,property as ot,query as a0,state as wl}from"lit/decorators.js";var r0=da(_n(),1);function Bd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function o0(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,r0.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},Bd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},Bd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&Bd(o,p),k?.notify!==!1&&h?.(p)}}}var qd=da(_n(),1);function xl(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Un(i,o,e){return Math.min(e,Math.max(o,i))}function Bk(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function qk(i,o,e){let r=window.getComputedStyle(i),n=xl(r.minWidth)??o,s=xl(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(xl(r.maxWidth)??d,d),f=Math.min(xl(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function i0(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function n0(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,qd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[qd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Bk(S.edges))},move(S){let z=qk(o,s,d),T=k.left,P=k.top,H=k.width,R=k.height;if(S.edges?.left){let F=k.left+k.width,$=F-z.minWidth;T=Un(k.left+S.deltaRect.left,z.viewportMargin,$),H=Un(F-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=F-H}else S.edges?.right&&(H=Un(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let F=k.top+k.height,$=F-z.minHeight;P=Un(k.top+S.deltaRect.top,z.viewportMargin,$),R=Un(F-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=F-R}else S.edges?.bottom&&(R=Un(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:R},i0(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&i0(o,k),z?.notify!==!1&&f?.({...k})}}}var Gk=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Yk=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),Ya=0,s0={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function _l(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Xk(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Zk(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Gk)?!0:Yk.has(i.tagName.toLowerCase())}function Qk(i,o){if(!(i instanceof HTMLElement)||i===o||!_l(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var xe=class extends Wk{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(fn(h,this)||h.some(p=>Qk(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Xk(this.ownerDocument),n=t.findIndex(h=>h===r||_l(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&_l(this,s))||fn(t,this)||Date.now()<this._suppressBackdropClickUntil||Rs(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&_l(this,d)),s=fn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=N(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),st(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Zk(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(Ya===0&&(this.ownerDocument.body.style.overflow="hidden"),Ya+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(Ya=Math.max(0,Ya-1),Ya===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||Is(this)}_registerOverlayStack(){let e=vn(this);if(!e){this._releaseOverlayStack();return}Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(go(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Qt(this.overlayLayer||"modal",this.container??mi(this)??pi(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=o0({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=n0({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:mt(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):nn}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return Gn`
|
|
12522
|
+
`}};Gr.styles=[A,O,Q1`:host{display:block;width:100%;}`],a([Er()],Gr.prototype,"value",2),a([Er()],Gr.prototype,"placeholder",2),a([Er({reflect:!0})],Gr.prototype,"size",2),a([Er()],Gr.prototype,"min",2),a([Er()],Gr.prototype,"max",2),a([Er({type:Boolean})],Gr.prototype,"disabled",2),a([Er({type:Boolean})],Gr.prototype,"clearable",2),Gr=a([t0("lui-date-range-picker")],Gr);import{css as Kk,html as Gn,LitElement as Wk,nothing as nn}from"lit";import{customElement as Uk,property as ot,query as a0,state as wl}from"lit/decorators.js";var r0=da(_n(),1);function Bd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function o0(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,r0.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},Bd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},Bd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&Bd(o,p),k?.notify!==!1&&h?.(p)}}}var qd=da(_n(),1);function xl(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Un(i,o,e){return Math.min(e,Math.max(o,i))}function Bk(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function qk(i,o,e){let r=window.getComputedStyle(i),n=xl(r.minWidth)??o,s=xl(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(xl(r.maxWidth)??d,d),f=Math.min(xl(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function i0(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function n0(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,qd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[qd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Bk(S.edges))},move(S){let z=qk(o,s,d),T=k.left,P=k.top,H=k.width,R=k.height;if(S.edges?.left){let F=k.left+k.width,$=F-z.minWidth;T=Un(k.left+S.deltaRect.left,z.viewportMargin,$),H=Un(F-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=F-H}else S.edges?.right&&(H=Un(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let F=k.top+k.height,$=F-z.minHeight;P=Un(k.top+S.deltaRect.top,z.viewportMargin,$),R=Un(F-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=F-R}else S.edges?.bottom&&(R=Un(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:R},i0(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&i0(o,k),z?.notify!==!1&&f?.({...k})}}}var Gk=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Yk=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),Ya=0,s0={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function _l(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Xk(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Zk(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Gk)?!0:Yk.has(i.tagName.toLowerCase())}function Qk(i,o){if(!(i instanceof HTMLElement)||i===o||!_l(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var xe=class extends Wk{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(fn(h,this)||h.some(p=>Qk(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Xk(this.ownerDocument),n=t.findIndex(h=>h===r||_l(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&_l(this,s))||fn(t,this)||Date.now()<this._suppressBackdropClickUntil||Rs(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&_l(this,d)),s=fn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=N(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),st(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Zk(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(Ya===0&&(this.ownerDocument.body.style.overflow="hidden"),Ya+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(Ya=Math.max(0,Ya-1),Ya===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||Is(this)}_registerOverlayStack(){let e=vn(this);if(!e){this._releaseOverlayStack();return}Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(go(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Qt(this.overlayLayer||"modal",this.container??mi(this)??pi(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=o0({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=n0({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:mt(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):nn}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return Gn`
|
|
12493
12523
|
<div
|
|
12494
12524
|
part="custom-backdrop"
|
|
12495
12525
|
style=${this.backdropStyle||nn}
|
|
@@ -14011,7 +14041,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14011
14041
|
inset-inline-start: 100%;
|
|
14012
14042
|
}
|
|
14013
14043
|
}
|
|
14014
|
-
`],a([Vr({reflect:!0})],zt.prototype,"type",2),a([Vr({type:Number})],zt.prototype,"percent",2),a([Vr({reflect:!0})],zt.prototype,"status",2),a([Vr({reflect:!0})],zt.prototype,"size",2),a([Vr({reflect:!0})],zt.prototype,"radius",2),a([Vr({type:Number,attribute:"stroke-width"})],zt.prototype,"strokeWidth",2),a([Vr({attribute:"show-text",converter:C4})],zt.prototype,"showText",2),a([Vr({type:Boolean,reflect:!0,attribute:"text-inside"})],zt.prototype,"textInside",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"striped",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"indeterminate",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"disabled",2),a([Vr()],zt.prototype,"label",2),a([Vr({attribute:!1})],zt.prototype,"format",2),a([Vr({type:Boolean,attribute:"pause-when-hidden"})],zt.prototype,"pauseWhenHidden",2),zt=a([M4("lui-progress")],zt);import{css as z4,html as Ti,LitElement as E4,nothing as Yd}from"lit";import{customElement as S4,property as
|
|
14044
|
+
`],a([Vr({reflect:!0})],zt.prototype,"type",2),a([Vr({type:Number})],zt.prototype,"percent",2),a([Vr({reflect:!0})],zt.prototype,"status",2),a([Vr({reflect:!0})],zt.prototype,"size",2),a([Vr({reflect:!0})],zt.prototype,"radius",2),a([Vr({type:Number,attribute:"stroke-width"})],zt.prototype,"strokeWidth",2),a([Vr({attribute:"show-text",converter:C4})],zt.prototype,"showText",2),a([Vr({type:Boolean,reflect:!0,attribute:"text-inside"})],zt.prototype,"textInside",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"striped",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"indeterminate",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"disabled",2),a([Vr()],zt.prototype,"label",2),a([Vr({attribute:!1})],zt.prototype,"format",2),a([Vr({type:Boolean,attribute:"pause-when-hidden"})],zt.prototype,"pauseWhenHidden",2),zt=a([M4("lui-progress")],zt);import{css as z4,html as Ti,LitElement as E4,nothing as Yd}from"lit";import{customElement as S4,property as Sr,query as $4,state as Xd}from"lit/decorators.js";var Ze=class extends E4{constructor(){super(...arguments);this.nodes=[];this.value=[];this.size="md";this.placeholder="";this.separator=" / ";this.expandTrigger="click";this.changeOnSelect=!1;this.disabled=!1;this.clearable=!1;this.invalid=!1;this.portal=!0;this.open=!1;this._activePath=[];this._loadingKey="";this._loaded={};this._onTriggerClick=()=>{this._setOpen(!this.open)};this._onTriggerKeyDown=e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault(),this._setOpen(!this.open);return}if(e.key==="ArrowDown"&&!this.open){e.preventDefault(),this._setOpen(!0);return}e.key==="Escape"&&this.open&&(e.stopPropagation(),this._setOpen(!1))};this._clear=e=>{e.stopPropagation(),this._activePath=[],this._commit([])}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate()),this._activePath=[...this.value]}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}willUpdate(e){e.has("value")&&(this._activePath=[...this.value])}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}_childrenOf(e,t){let r=e.children;return Array.isArray(r)&&r.length?r:this._loaded[t.join("\0")]??[]}_hasChildren(e,t){return this._childrenOf(e,t).length>0?!0:!!e.hasChildren&&!e.isLeaf}get _columns(){let e=[this.nodes],t=this.nodes;for(let r=0;r<this._activePath.length;r+=1){let n=this._activePath[r],s=t.find(h=>Dt(h)===n);if(!s)break;let d=this._childrenOf(s,this._activePath.slice(0,r+1));if(!d.length)break;e.push(d),t=d}return e}_nodesForPath(e){let t=[],r=this.nodes;for(let n of e){let s=r.find(d=>Dt(d)===n);if(!s)break;t.push(s),r=this._childrenOf(s,e.slice(0,t.length))}return t}get _displayLabel(){let e=this._nodesForPath(this.value);return e.length!==this.value.length||!e.length?"":e.map(Ho).join(this.separator)}_setOpen(e){this.disabled||this.open===e||(this.open=e,e?(this._activePath=[...this.value],this._popover?.show()):this._popover?.hide())}_commit(e){this.value=e;let t=this._nodesForPath(e);this.dispatchEvent(new CustomEvent("change",{detail:{value:e,nodes:t,label:t.map(Ho).join(this.separator)},bubbles:!0,composed:!0}))}async _openNode(e,t){this._activePath=t;let r=Dt(e);if(!(this._childrenOf(e,t).length>0||!this.childrenLoader||!this._hasChildren(e,t))){this._loadingKey=r;try{let s=await this.childrenLoader(e,t);this._loaded={...this._loaded,[t.join("\0")]:s}}finally{this._loadingKey=""}}}async _onOptionClick(e,t){if(e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];if(this._hasChildren(e,r)){await this._openNode(e,r),this.changeOnSelect&&this._commit(r);return}this._activePath=r,this._commit(r),this._setOpen(!1)}_onOptionEnter(e,t){if(this.expandTrigger!=="hover"||e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];this._hasChildren(e,r)?this._openNode(e,r):this._activePath=r}render(){let t=N(this,"cascader").size??this.size,r=this._displayLabel,n=r!=="",s=this.clearable&&n&&!this.disabled,d=this._columns;return Ti`
|
|
14015
14045
|
<lui-popover
|
|
14016
14046
|
trigger="manual"
|
|
14017
14047
|
placement="bottom-start"
|
|
@@ -14057,7 +14087,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14057
14087
|
<div slot="content" part="columns">
|
|
14058
14088
|
${d.length&&d[0].length?d.map((h,p)=>Ti`
|
|
14059
14089
|
<div part="column" role="listbox">
|
|
14060
|
-
${h.map(f=>{let x=
|
|
14090
|
+
${h.map(f=>{let x=Dt(f),k=[...this._activePath.slice(0,p),x],C=this._activePath[p]===x,S=this.value.length===k.length&&this.value.every((T,P)=>T===k[P]),z=this._hasChildren(f,k);return Ti`
|
|
14061
14091
|
<div
|
|
14062
14092
|
part="option"
|
|
14063
14093
|
class="option-row"
|
|
@@ -14178,7 +14208,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14178
14208
|
font-size: var(--lui-font-size-sm);
|
|
14179
14209
|
text-align: center;
|
|
14180
14210
|
}
|
|
14181
|
-
`],a([
|
|
14211
|
+
`],a([Sr({attribute:!1})],Ze.prototype,"nodes",2),a([Sr({attribute:!1})],Ze.prototype,"value",2),a([Sr({reflect:!0})],Ze.prototype,"size",2),a([Sr()],Ze.prototype,"placeholder",2),a([Sr()],Ze.prototype,"separator",2),a([Sr({reflect:!0,attribute:"expand-trigger"})],Ze.prototype,"expandTrigger",2),a([Sr({type:Boolean,attribute:"change-on-select"})],Ze.prototype,"changeOnSelect",2),a([Sr({type:Boolean,reflect:!0})],Ze.prototype,"disabled",2),a([Sr({type:Boolean,reflect:!0})],Ze.prototype,"clearable",2),a([Sr({type:Boolean,reflect:!0})],Ze.prototype,"invalid",2),a([Sr({attribute:!1})],Ze.prototype,"childrenLoader",2),a([Sr({type:Boolean})],Ze.prototype,"portal",2),a([Sr({type:Boolean,reflect:!0,attribute:"open"})],Ze.prototype,"open",2),a([Sr({reflect:!0})],Ze.prototype,"locale",2),a([Sr({attribute:!1})],Ze.prototype,"translations",2),a([Xd()],Ze.prototype,"_activePath",2),a([Xd()],Ze.prototype,"_loadingKey",2),a([Xd()],Ze.prototype,"_loaded",2),a([$4("lui-popover")],Ze.prototype,"_popover",2),Ze=a([S4("lui-cascader")],Ze);import{css as T4,html as Ja,LitElement as A4,nothing as P4}from"lit";import{customElement as j4,property as ur,query as d0,state as O4}from"lit/decorators.js";var Qe=class extends A4{constructor(){super(...arguments);this.nodes=[];this.value="";this.mode="single";this.size="md";this.placeholder="";this.disabled=!1;this.clearable=!1;this.invalid=!1;this.filterable=!1;this.checkStrictly=!1;this.portal=!0;this.open=!1;this._keys=[];this._onTreeSelect=e=>{if(this.mode!=="single")return;e.stopPropagation();let t=e.detail;t?.key&&this._commit([t.key],!0)};this._onTreeCheck=e=>{if(this.mode!=="multiple")return;e.stopPropagation();let t=e.detail;this._commit(t?.checkedKeys??[],!0)};this._onTriggerClick=()=>{this._setOpen(!this.open)};this._onTriggerKeyDown=e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault(),this._setOpen(!this.open);return}if(e.key==="ArrowDown"&&!this.open){e.preventDefault(),this._setOpen(!0);return}e.key==="Escape"&&this.open&&(e.stopPropagation(),this._setOpen(!1))};this._clear=e=>{e.stopPropagation(),this._commit([],!1)}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate()),this._keys=this._keysFromValue()}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}willUpdate(e){if(e.has("value")||e.has("mode")){this._keys=this._keysFromValue();let t=this.mode==="multiple"?this._keys:this._keys[0]??"";Array.isArray(t)!==Array.isArray(this.value)&&(this.value=t)}}_keysFromValue(){return Array.isArray(this.value)?this.value.filter(Boolean):this.value?[this.value]:[]}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}_findNodes(e){if(!e.length)return[];let t=new Set(e),r=[],n=s=>{for(let d of s){t.has(Dt(d))&&r.push(d);let h=d.children;Array.isArray(h)&&h.length&&n(h)}};return n(this.nodes),r}get _selectedNodes(){return this._findNodes(this._keys)}_setOpen(e){this.disabled||this.open===e||(this.open=e,e?this._popover?.show():this._popover?.hide())}_shouldCloseAfterPick(){return this.closeOnSelect??this.mode==="single"}_commit(e,t){this._keys=e;let r=this._findNodes(e),n=this.mode==="multiple"?e:e[0]??"";this.value=n,this.dispatchEvent(new CustomEvent("change",{detail:{value:n,keys:e,nodes:r},bubbles:!0,composed:!0})),t&&this._shouldCloseAfterPick()&&this._setOpen(!1)}_removeKey(e,t){t.stopPropagation(),this._commit(this._keys.filter(r=>r!==e),!1)}render(){let t=N(this,"treeSelect").size??this.size,r=this._selectedNodes,n=r.length>0,s=this.clearable&&n&&!this.disabled;return Ja`
|
|
14182
14212
|
<lui-popover
|
|
14183
14213
|
trigger="manual"
|
|
14184
14214
|
placement="bottom-start"
|
|
@@ -14209,7 +14239,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14209
14239
|
part="tag"
|
|
14210
14240
|
size="sm"
|
|
14211
14241
|
closable
|
|
14212
|
-
@close=${h=>this._removeKey(
|
|
14242
|
+
@close=${h=>this._removeKey(Dt(d),h)}
|
|
14213
14243
|
>
|
|
14214
14244
|
${Ho(d)}
|
|
14215
14245
|
</lui-tag>
|
|
@@ -14435,7 +14465,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14435
14465
|
font-size: var(--lui-font-size-sm);
|
|
14436
14466
|
text-align: center;
|
|
14437
14467
|
}
|
|
14438
|
-
`],a([Dr({attribute:!1})],Je.prototype,"options",2),a([Dr()],Je.prototype,"value",2),a([Dr()],Je.prototype,"placeholder",2),a([Dr({reflect:!0})],Je.prototype,"size",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"disabled",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"readonly",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"clearable",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"invalid",2),a([Dr({type:Number,attribute:"min-chars"})],Je.prototype,"minChars",2),a([Dr({type:Number,attribute:"max-items"})],Je.prototype,"maxItems",2),a([Dr({attribute:!1})],Je.prototype,"filter",2),a([Dr({type:Boolean})],Je.prototype,"portal",2),a([Dr({reflect:!0})],Je.prototype,"locale",2),a([Dr({attribute:!1})],Je.prototype,"translations",2),a([Zd()],Je.prototype,"_matches",2),a([Zd()],Je.prototype,"_activeIndex",2),a([Zd()],Je.prototype,"_open",2),a([h0("lui-popover")],Je.prototype,"_popover",2),a([h0("lui-input")],Je.prototype,"_input",2),Je=a([I4("lui-autocomplete")],Je);var Qd=da(_n(),1);import{css as D4,html as p0,LitElement as N4,nothing as F4}from"lit";import{customElement as L4,property as Qn,query as m0,state as B4}from"lit/decorators.js";var
|
|
14468
|
+
`],a([Dr({attribute:!1})],Je.prototype,"options",2),a([Dr()],Je.prototype,"value",2),a([Dr()],Je.prototype,"placeholder",2),a([Dr({reflect:!0})],Je.prototype,"size",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"disabled",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"readonly",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"clearable",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"invalid",2),a([Dr({type:Number,attribute:"min-chars"})],Je.prototype,"minChars",2),a([Dr({type:Number,attribute:"max-items"})],Je.prototype,"maxItems",2),a([Dr({attribute:!1})],Je.prototype,"filter",2),a([Dr({type:Boolean})],Je.prototype,"portal",2),a([Dr({reflect:!0})],Je.prototype,"locale",2),a([Dr({attribute:!1})],Je.prototype,"translations",2),a([Zd()],Je.prototype,"_matches",2),a([Zd()],Je.prototype,"_activeIndex",2),a([Zd()],Je.prototype,"_open",2),a([h0("lui-popover")],Je.prototype,"_popover",2),a([h0("lui-input")],Je.prototype,"_input",2),Je=a([I4("lui-autocomplete")],Je);var Qd=da(_n(),1);import{css as D4,html as p0,LitElement as N4,nothing as F4}from"lit";import{customElement as L4,property as Qn,query as m0,state as B4}from"lit/decorators.js";var $r=class extends N4{constructor(){super(...arguments);this.orientation="horizontal";this.percent=50;this.minFirst=80;this.minSecond=80;this.disabled=!1;this.noGrip=!1;this._dragging=!1;this._interact=null;this._origin={total:0,percent:50};this._onKeyDown=e=>{if(this.disabled)return;let t=this._isHorizontal?"ArrowLeft":"ArrowUp",r=this._isHorizontal?"ArrowRight":"ArrowDown",n=null;if(e.key===t?n=this.percent-(e.shiftKey?10:2):e.key===r?n=this.percent+(e.shiftKey?10:2):e.key==="Home"?n=0:e.key==="End"&&(n=100),n===null)return;e.preventDefault();let s=this._root?.getBoundingClientRect(),d=(this._isHorizontal?s?.width:s?.height)??0,h=this._clampPercent(n,d);h!==this.percent&&(this.percent=h,this._emit("resize"),this._emit("change"))}}disconnectedCallback(){super.disconnectedCallback(),this._teardown()}firstUpdated(){this._setup()}updated(e){(e.has("disabled")||e.has("orientation"))&&(this._teardown(),this._setup())}get _isHorizontal(){return this.orientation!=="vertical"}_pxMin(e,t){let r=mt(e);if(r.endsWith("%")){let s=Number.parseFloat(r)/100;return Number.isFinite(s)?t*s:0}let n=Number.parseFloat(r);return Number.isFinite(n)?n:0}_clampPercent(e,t){if(t<=0)return Math.min(100,Math.max(0,e));let r=this._gutter?.getBoundingClientRect(),n=(this._isHorizontal?r?.width:r?.height)??0,s=Math.max(0,t-n),d=this._pxMin(this.minFirst,s),h=this._pxMin(this.minSecond,s);if(d+h>=s)return 50;let p=d/s*100,f=100-h/s*100;return Math.min(f,Math.max(p,e))}_setup(){let e=this._gutter;!e||this.disabled||(this._interact=(0,Qd.default)(e).draggable({inertia:!1,modifiers:[Qd.default.modifiers.restrict({restriction:"parent"})],listeners:{start:()=>{let t=this._root?.getBoundingClientRect();this._origin={total:(this._isHorizontal?t?.width:t?.height)??0,percent:this.percent},this._dragging=!0,this.toggleAttribute("data-dragging",!0)},move:t=>{let{total:r}=this._origin;if(r<=0)return;let n=this._isHorizontal?t.dx:t.dy,s=this._clampPercent(this.percent+n/r*100,r);s!==this.percent&&(this.percent=s,this._emit("resize"))},end:()=>{this._dragging=!1,this.toggleAttribute("data-dragging",!1),this._emit("change")}}}))}_teardown(){this._interact?.unset(),this._interact=null,this.toggleAttribute("data-dragging",!1)}_emit(e){let t=this._root?.getBoundingClientRect(),r=(this._isHorizontal?t?.width:t?.height)??0;this.dispatchEvent(new CustomEvent(e,{detail:{percent:this.percent,size:r*this.percent/100},bubbles:!0,composed:!0}))}render(){let t=N(this,"splitter").orientation??this.orientation;return p0`
|
|
14439
14469
|
<div class="root" style=${`--lui-splitter-first:${this.percent}%;`}>
|
|
14440
14470
|
<div part="pane first"><slot name="first"></slot></div>
|
|
14441
14471
|
<div
|
|
@@ -14453,7 +14483,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14453
14483
|
</div>
|
|
14454
14484
|
<div part="pane second"><slot name="second"></slot></div>
|
|
14455
14485
|
</div>
|
|
14456
|
-
`}}
|
|
14486
|
+
`}};$r.styles=[A,O,Pr,D4`
|
|
14457
14487
|
:host {
|
|
14458
14488
|
display: block;
|
|
14459
14489
|
width: 100%;
|
|
@@ -14538,7 +14568,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14538
14568
|
user-select: none;
|
|
14539
14569
|
pointer-events: none;
|
|
14540
14570
|
}
|
|
14541
|
-
`],a([Qn({reflect:!0})],Tr.prototype,"orientation",2),a([Qn({type:Number})],Tr.prototype,"percent",2),a([Qn({attribute:"min-first"})],Tr.prototype,"minFirst",2),a([Qn({attribute:"min-second"})],Tr.prototype,"minSecond",2),a([Qn({type:Boolean,reflect:!0})],Tr.prototype,"disabled",2),a([Qn({type:Boolean,attribute:"no-grip",reflect:!0})],Tr.prototype,"noGrip",2),a([B4()],Tr.prototype,"_dragging",2),a([m0('[part="gutter"]')],Tr.prototype,"_gutter",2),a([m0(".root")],Tr.prototype,"_root",2),Tr=a([L4("lui-splitter")],Tr);import{css as i5,html as nu,LitElement as n5,nothing as El,svg as a5}from"lit";import{customElement as s5,property as To,state as l5}from"lit/decorators.js";var g0=["L","M","Q","H"],f0=[[[7,1,19,0,0],[10,1,16,0,0],[13,1,13,0,0],[17,1,9,0,0]],[[10,1,34,0,0],[16,1,28,0,0],[22,1,22,0,0],[28,1,16,0,0]],[[15,1,55,0,0],[26,1,44,0,0],[18,2,17,0,0],[22,2,13,0,0]],[[20,1,80,0,0],[18,2,32,0,0],[26,2,24,0,0],[16,4,9,0,0]],[[26,1,108,0,0],[24,2,43,0,0],[18,2,15,2,16],[22,2,11,2,12]],[[18,2,68,0,0],[16,4,27,0,0],[24,4,19,0,0],[28,4,15,0,0]],[[20,2,78,0,0],[18,4,31,0,0],[18,2,14,4,15],[26,4,13,1,14]],[[24,2,97,0,0],[22,2,38,2,39],[22,4,18,2,19],[26,4,14,2,15]],[[30,2,116,0,0],[22,3,36,2,37],[20,4,16,4,17],[24,4,12,4,13]],[[18,2,68,2,69],[26,4,43,1,44],[24,6,19,2,20],[28,6,15,2,16]],[[20,4,81,0,0],[30,1,50,4,51],[28,4,22,4,23],[24,3,12,8,13]],[[24,2,92,2,93],[22,6,36,2,37],[26,4,20,6,21],[28,7,14,4,15]],[[26,4,107,0,0],[22,8,37,1,38],[24,8,20,4,21],[22,12,11,4,12]],[[30,3,115,1,116],[24,4,40,5,41],[20,11,16,5,17],[24,11,12,5,13]],[[22,5,87,1,88],[24,5,41,5,42],[30,5,24,7,25],[24,11,12,7,13]],[[24,5,98,1,99],[28,7,45,3,46],[24,15,19,2,20],[30,3,15,13,16]],[[28,1,107,5,108],[28,10,46,1,47],[28,1,22,15,23],[28,2,14,17,15]],[[30,5,120,1,121],[26,9,43,4,44],[28,17,22,1,23],[28,2,14,19,15]],[[28,3,113,4,114],[26,3,44,11,45],[26,17,21,4,22],[26,9,13,16,14]],[[28,3,107,5,108],[26,3,41,13,42],[30,15,24,5,25],[28,15,15,10,16]],[[28,4,116,4,117],[26,17,42,0,0],[28,17,22,6,23],[30,19,16,6,17]],[[28,2,111,7,112],[28,17,46,0,0],[30,7,24,16,25],[24,34,13,0,0]],[[30,4,121,5,122],[28,4,47,14,48],[30,11,24,14,25],[30,16,15,14,16]],[[30,6,117,4,118],[28,6,45,14,46],[30,11,24,16,25],[30,30,16,2,17]],[[26,8,106,4,107],[28,8,47,13,48],[30,7,24,22,25],[30,22,15,13,16]],[[28,10,114,2,115],[28,19,46,4,47],[28,28,22,6,23],[30,33,16,4,17]],[[30,8,122,4,123],[28,22,45,3,46],[30,8,23,26,24],[30,12,15,28,16]],[[30,3,117,10,118],[28,3,45,23,46],[30,4,24,31,25],[30,11,15,31,16]],[[30,7,116,7,117],[28,21,45,7,46],[30,1,23,37,24],[30,19,15,26,16]],[[30,5,115,10,116],[28,19,47,10,48],[30,15,24,25,25],[30,23,15,25,16]],[[30,13,115,3,116],[28,2,46,29,47],[30,42,24,1,25],[30,23,15,28,16]],[[30,17,115,0,0],[28,10,46,23,47],[30,10,24,35,25],[30,19,15,35,16]],[[30,17,115,1,116],[28,14,46,21,47],[30,29,24,19,25],[30,11,15,46,16]],[[30,13,115,6,116],[28,14,46,23,47],[30,44,24,7,25],[30,59,16,1,17]],[[30,12,121,7,122],[28,12,47,26,48],[30,39,24,14,25],[30,22,15,41,16]],[[30,6,121,14,122],[28,6,47,34,48],[30,46,24,10,25],[30,2,15,64,16]],[[30,17,122,4,123],[28,29,46,14,47],[30,49,24,10,25],[30,24,15,46,16]],[[30,4,122,18,123],[28,13,46,32,47],[30,48,24,14,25],[30,42,15,32,16]],[[30,20,117,4,118],[28,40,47,7,48],[30,43,24,22,25],[30,10,15,67,16]],[[30,19,118,6,119],[28,18,47,31,48],[30,34,24,34,25],[30,20,15,61,16]]],q4=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],K4=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],W4=21522,U4={L:1,M:0,Q:3,H:2},es=new Uint8Array(512),eu=new Uint8Array(256);{let i=1;for(let o=0;o<255;o+=1)es[o]=i,eu[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o+=1)es[o]=es[o-255]}function v0(i,o){return i===0||o===0?0:es[eu[i]+eu[o]]}function G4(i){let o=new Uint8Array([1]);for(let e=0;e<i;e+=1){let t=new Uint8Array(o.length+1);for(let r=0;r<o.length;r+=1)t[r]^=o[r],t[r+1]^=v0(o[r],es[e]);o=t}return o}function Y4(i,o){let e=G4(o),t=new Uint8Array(o);for(let r of i){let n=r^t[0];t.copyWithin(0,1),t[o-1]=0;for(let s=0;s<o;s+=1)t[s]^=v0(e[s+1],n)}return t}var tu=class{constructor(){this._bits=[]}get length(){return this._bits.length}push(o,e){for(let t=e-1;t>=0;t-=1)this._bits.push(o>>>t&1)}toBytes(){let o=new Uint8Array(Math.ceil(this._bits.length/8));return this._bits.forEach((e,t)=>{e&&(o[t>>>3]|=128>>>(t&7))}),o}};function ru(i,o){let[,e,t,r,n]=f0[i-1][g0.indexOf(o)];return e*t+r*n}function ou(i){return i<10?8:16}function X4(i,o){for(let e=1;e<=40;e+=1)if(4+ou(e)+i*8<=ru(e,o)*8)return e;throw new Error(`qrcode: ${i} bytes exceeds the capacity of a version 40 symbol at error correction level ${o}`)}function Z4(i,o,e){let t=ru(o,e)*8,r=new tu;r.push(4,4),r.push(i.length,ou(o));for(let z of i)r.push(z,8);r.push(0,Math.min(4,t-r.length)),r.length%8!==0&&r.push(0,8-r.length%8);let n=Array.from(r.toBytes());for(let z=0;n.length<t/8;z+=1)n.push(z%2===0?236:17);let[s,d,h,p,f]=f0[o-1][g0.indexOf(e)],x=[],k=0;for(let[z,T]of[[d,h],[p,f]])for(let P=0;P<z;P+=1){let H=new Uint8Array(n.slice(k,k+T));k+=T,x.push({data:H,ec:Y4(H,s)})}let C=[],S=Math.max(...x.map(z=>z.data.length));for(let z=0;z<S;z+=1)for(let T of x)z<T.data.length&&C.push(T.data[z]);for(let z=0;z<s;z+=1)for(let T of x)C.push(T.ec[z]);return new Uint8Array(C)}function Q4(i){let o=i*4+17;return{size:o,modules:Array.from({length:o},()=>Array(o).fill(null)),reserved:Array.from({length:o},()=>Array(o).fill(!1))}}function $o(i,o,e,t){i.modules[e][o]=t,i.reserved[e][o]=!0}function Jd(i,o,e){for(let t=-1;t<=7;t+=1)for(let r=-1;r<=7;r+=1){let n=o+r,s=e+t;if(n<0||s<0||n>=i.size||s>=i.size)continue;let d=r>=0&&r<=6&&t>=0&&t<=6,h=Math.max(Math.abs(r-3),Math.abs(t-3));$o(i,n,s,d&&h!==2)}}function J4(i,o){Jd(i,0,0),Jd(i,i.size-7,0),Jd(i,0,i.size-7);for(let t=8;t<i.size-8;t+=1){let r=t%2===0;$o(i,t,6,r),$o(i,6,t,r)}let e=q4[o-1];for(let t of e)for(let r of e)if(!(r===6&&t===6||r===6&&t===i.size-7||r===i.size-7&&t===6))for(let s=-2;s<=2;s+=1)for(let d=-2;d<=2;d+=1){let h=Math.max(Math.abs(d),Math.abs(s));$o(i,r+d,t+s,h!==1)}for(let t=0;t<9;t+=1)t!==6&&($o(i,t,8,!1),$o(i,8,t,!1));for(let t=0;t<8;t+=1)$o(i,i.size-1-t,8,!1);for(let t=0;t<7;t+=1)$o(i,8,i.size-1-t,!1);if($o(i,8,i.size-8,!0),o>=7){let t=K4[o-7];for(let r=0;r<18;r+=1){let n=(t>>>r&1)===1,s=Math.floor(r/3),d=r%3+i.size-11;$o(i,s,d,n),$o(i,d,s,n)}}}function e5(i,o){let e=0,t=!0;for(let r=i.size-1;r>=1;r-=2){let n=r===6?5:r;for(let s=0;s<i.size;s+=1){let d=t?i.size-1-s:s;for(let h of[n,n-1]){if(i.reserved[d][h])continue;let p=o[e>>>3]??0;i.modules[d][h]=(p>>>7-(e&7)&1)===1,e+=1}}t=!t}}function t5(i,o,e){switch(i){case 0:return(o+e)%2===0;case 1:return e%2===0;case 2:return o%3===0;case 3:return(o+e)%3===0;case 4:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case 5:return o*e%2+o*e%3===0;case 6:return(o*e%2+o*e%3)%2===0;default:return((o+e)%2+o*e%3)%2===0}}function r5(i,o,e){let t=U4[o]<<3|e,r=t;for(let s=0;s<10;s+=1)r=r<<1^(r>>>9)*1335;let n=(t<<10|r)^W4;for(let s=0;s<=5;s+=1)i.modules[8][s]=(n>>>s&1)===1;i.modules[8][7]=(n>>>6&1)===1,i.modules[8][8]=(n>>>7&1)===1,i.modules[7][8]=(n>>>8&1)===1;for(let s=9;s<15;s+=1)i.modules[14-s][8]=(n>>>s&1)===1;for(let s=0;s<7;s+=1)i.modules[i.size-1-s][8]=(n>>>s&1)===1;for(let s=8;s<15;s+=1)i.modules[8][i.size-15+s]=(n>>>s&1)===1}function o5(i){let o=i.length,e=0,t=h=>{let p=0,f=1;for(let x=1;x<o;x+=1)h[x]===h[x-1]?(f+=1,f===5?p+=3:f>5&&(p+=1)):f=1;return p};for(let h=0;h<o;h+=1)e+=t(i[h]),e+=t(i.map(p=>p[h]));for(let h=0;h<o-1;h+=1)for(let p=0;p<o-1;p+=1){let f=i[h][p];f===i[h][p+1]&&f===i[h+1][p]&&f===i[h+1][p+1]&&(e+=3)}let r=[!0,!1,!0,!0,!0,!1,!0],n=(h,p)=>r.every((f,x)=>h[p+x]===f);for(let h=0;h<o;h+=1){let p=i[h],f=i.map(x=>x[h]);for(let x=0;x+7<=o;x+=1)n(p,x)&&(e+=40),n(f,x)&&(e+=40)}let d=i.flat().filter(Boolean).length*100/(o*o);return e+=Math.floor(Math.abs(d-50)/5)*10,e}function iu(i,o={}){let e=o.errorCorrection??"M",t=new TextEncoder().encode(i),r=o.version??X4(t.length,e);if(r<1||r>40||!Number.isInteger(r))throw new Error(`qrcode: version must be an integer from 1 to 40, received ${r}`);if(4+ou(r)+t.length*8>ru(r,e)*8)throw new Error(`qrcode: ${t.length} bytes does not fit a version ${r} symbol at error correction level ${e}`);let s=Z4(t,r,e),d=Q4(r);J4(d,r),e5(d,s);let h=null;for(let p=0;p<8;p+=1){let f=d.modules.map((S,z)=>S.map((T,P)=>d.reserved[z][P]?!!T:!!T!==t5(p,P,z))),x={...d,modules:f};r5(x,e,p);let k=x.modules.map(S=>S.map(Boolean)),C=o5(k);(!h||C<h.score)&&(h={matrix:k,score:C})}return{matrix:h.matrix,size:d.size,version:r,errorCorrection:e}}var Bt=class extends n5{constructor(){super(...arguments);this.value="";this.errorCorrection="M";this.margin=4;this.logo="";this.logoRatio=.2;this._error=""}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}get _effectiveErrorCorrection(){if(!this.logo)return this.errorCorrection;let e=this._cappedLogoRatio>.22?"H":"Q",t=["L","M","Q","H"];return t.indexOf(this.errorCorrection)>=t.indexOf(e)?this.errorCorrection:e}get _cappedLogoRatio(){return Math.min(Math.max(this.logoRatio,0),.3)}get _cssSize(){return this.size===void 0||this.size===""?"":mt(this.size)}toDataUrl(){let e=this._svgMarkup();return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:""}_svgMarkup(){try{let{matrix:e,size:t}=iu(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version}),r=Math.max(0,Math.floor(this.margin)),n=t+r*2,s=this.color||"currentColor",d=this.background||"transparent",h="";return e.forEach((p,f)=>{p.forEach((x,k)=>{x&&(h+=`M${k+r} ${f+r}h1v1h-1z`)})}),[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}"`,' shape-rendering="crispEdges">',`<rect width="${n}" height="${n}" fill="${d}"/>`,`<path d="${h}" fill="${s}"/>`,"</svg>"].join("")}catch{return""}}render(){let e=N(this,"qrcode"),t=Math.max(0,Math.floor(this.margin)),r=this._cssSize||e.size||"",n=null,s="";if(!this.value)s=this._t("qrcode.empty","\u65E0\u5185\u5BB9");else try{n=iu(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version})}catch(p){s=p instanceof Error?p.message:String(p)}s!==this._error&&(this._error=s,s&&this.value&&this.dispatchEvent(new CustomEvent("error",{detail:{message:s},bubbles:!0,composed:!0})));let d=[r?`--lui-qrcode-size:${r}`:"",this.background?`--lui-qrcode-bg:${this.background}`:"",this.color?`--lui-qrcode-fg:${this.color}`:"",this.logo?`--lui-qrcode-logo-size:${this._cappedLogoRatio*100}%`:""].filter(Boolean).join(";");if(!n)return nu`
|
|
14571
|
+
`],a([Qn({reflect:!0})],$r.prototype,"orientation",2),a([Qn({type:Number})],$r.prototype,"percent",2),a([Qn({attribute:"min-first"})],$r.prototype,"minFirst",2),a([Qn({attribute:"min-second"})],$r.prototype,"minSecond",2),a([Qn({type:Boolean,reflect:!0})],$r.prototype,"disabled",2),a([Qn({type:Boolean,attribute:"no-grip",reflect:!0})],$r.prototype,"noGrip",2),a([B4()],$r.prototype,"_dragging",2),a([m0('[part="gutter"]')],$r.prototype,"_gutter",2),a([m0(".root")],$r.prototype,"_root",2),$r=a([L4("lui-splitter")],$r);import{css as i5,html as nu,LitElement as n5,nothing as El,svg as a5}from"lit";import{customElement as s5,property as To,state as l5}from"lit/decorators.js";var g0=["L","M","Q","H"],f0=[[[7,1,19,0,0],[10,1,16,0,0],[13,1,13,0,0],[17,1,9,0,0]],[[10,1,34,0,0],[16,1,28,0,0],[22,1,22,0,0],[28,1,16,0,0]],[[15,1,55,0,0],[26,1,44,0,0],[18,2,17,0,0],[22,2,13,0,0]],[[20,1,80,0,0],[18,2,32,0,0],[26,2,24,0,0],[16,4,9,0,0]],[[26,1,108,0,0],[24,2,43,0,0],[18,2,15,2,16],[22,2,11,2,12]],[[18,2,68,0,0],[16,4,27,0,0],[24,4,19,0,0],[28,4,15,0,0]],[[20,2,78,0,0],[18,4,31,0,0],[18,2,14,4,15],[26,4,13,1,14]],[[24,2,97,0,0],[22,2,38,2,39],[22,4,18,2,19],[26,4,14,2,15]],[[30,2,116,0,0],[22,3,36,2,37],[20,4,16,4,17],[24,4,12,4,13]],[[18,2,68,2,69],[26,4,43,1,44],[24,6,19,2,20],[28,6,15,2,16]],[[20,4,81,0,0],[30,1,50,4,51],[28,4,22,4,23],[24,3,12,8,13]],[[24,2,92,2,93],[22,6,36,2,37],[26,4,20,6,21],[28,7,14,4,15]],[[26,4,107,0,0],[22,8,37,1,38],[24,8,20,4,21],[22,12,11,4,12]],[[30,3,115,1,116],[24,4,40,5,41],[20,11,16,5,17],[24,11,12,5,13]],[[22,5,87,1,88],[24,5,41,5,42],[30,5,24,7,25],[24,11,12,7,13]],[[24,5,98,1,99],[28,7,45,3,46],[24,15,19,2,20],[30,3,15,13,16]],[[28,1,107,5,108],[28,10,46,1,47],[28,1,22,15,23],[28,2,14,17,15]],[[30,5,120,1,121],[26,9,43,4,44],[28,17,22,1,23],[28,2,14,19,15]],[[28,3,113,4,114],[26,3,44,11,45],[26,17,21,4,22],[26,9,13,16,14]],[[28,3,107,5,108],[26,3,41,13,42],[30,15,24,5,25],[28,15,15,10,16]],[[28,4,116,4,117],[26,17,42,0,0],[28,17,22,6,23],[30,19,16,6,17]],[[28,2,111,7,112],[28,17,46,0,0],[30,7,24,16,25],[24,34,13,0,0]],[[30,4,121,5,122],[28,4,47,14,48],[30,11,24,14,25],[30,16,15,14,16]],[[30,6,117,4,118],[28,6,45,14,46],[30,11,24,16,25],[30,30,16,2,17]],[[26,8,106,4,107],[28,8,47,13,48],[30,7,24,22,25],[30,22,15,13,16]],[[28,10,114,2,115],[28,19,46,4,47],[28,28,22,6,23],[30,33,16,4,17]],[[30,8,122,4,123],[28,22,45,3,46],[30,8,23,26,24],[30,12,15,28,16]],[[30,3,117,10,118],[28,3,45,23,46],[30,4,24,31,25],[30,11,15,31,16]],[[30,7,116,7,117],[28,21,45,7,46],[30,1,23,37,24],[30,19,15,26,16]],[[30,5,115,10,116],[28,19,47,10,48],[30,15,24,25,25],[30,23,15,25,16]],[[30,13,115,3,116],[28,2,46,29,47],[30,42,24,1,25],[30,23,15,28,16]],[[30,17,115,0,0],[28,10,46,23,47],[30,10,24,35,25],[30,19,15,35,16]],[[30,17,115,1,116],[28,14,46,21,47],[30,29,24,19,25],[30,11,15,46,16]],[[30,13,115,6,116],[28,14,46,23,47],[30,44,24,7,25],[30,59,16,1,17]],[[30,12,121,7,122],[28,12,47,26,48],[30,39,24,14,25],[30,22,15,41,16]],[[30,6,121,14,122],[28,6,47,34,48],[30,46,24,10,25],[30,2,15,64,16]],[[30,17,122,4,123],[28,29,46,14,47],[30,49,24,10,25],[30,24,15,46,16]],[[30,4,122,18,123],[28,13,46,32,47],[30,48,24,14,25],[30,42,15,32,16]],[[30,20,117,4,118],[28,40,47,7,48],[30,43,24,22,25],[30,10,15,67,16]],[[30,19,118,6,119],[28,18,47,31,48],[30,34,24,34,25],[30,20,15,61,16]]],q4=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],K4=[31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017],W4=21522,U4={L:1,M:0,Q:3,H:2},es=new Uint8Array(512),eu=new Uint8Array(256);{let i=1;for(let o=0;o<255;o+=1)es[o]=i,eu[i]=o,i<<=1,i&256&&(i^=285);for(let o=255;o<512;o+=1)es[o]=es[o-255]}function v0(i,o){return i===0||o===0?0:es[eu[i]+eu[o]]}function G4(i){let o=new Uint8Array([1]);for(let e=0;e<i;e+=1){let t=new Uint8Array(o.length+1);for(let r=0;r<o.length;r+=1)t[r]^=o[r],t[r+1]^=v0(o[r],es[e]);o=t}return o}function Y4(i,o){let e=G4(o),t=new Uint8Array(o);for(let r of i){let n=r^t[0];t.copyWithin(0,1),t[o-1]=0;for(let s=0;s<o;s+=1)t[s]^=v0(e[s+1],n)}return t}var tu=class{constructor(){this._bits=[]}get length(){return this._bits.length}push(o,e){for(let t=e-1;t>=0;t-=1)this._bits.push(o>>>t&1)}toBytes(){let o=new Uint8Array(Math.ceil(this._bits.length/8));return this._bits.forEach((e,t)=>{e&&(o[t>>>3]|=128>>>(t&7))}),o}};function ru(i,o){let[,e,t,r,n]=f0[i-1][g0.indexOf(o)];return e*t+r*n}function ou(i){return i<10?8:16}function X4(i,o){for(let e=1;e<=40;e+=1)if(4+ou(e)+i*8<=ru(e,o)*8)return e;throw new Error(`qrcode: ${i} bytes exceeds the capacity of a version 40 symbol at error correction level ${o}`)}function Z4(i,o,e){let t=ru(o,e)*8,r=new tu;r.push(4,4),r.push(i.length,ou(o));for(let z of i)r.push(z,8);r.push(0,Math.min(4,t-r.length)),r.length%8!==0&&r.push(0,8-r.length%8);let n=Array.from(r.toBytes());for(let z=0;n.length<t/8;z+=1)n.push(z%2===0?236:17);let[s,d,h,p,f]=f0[o-1][g0.indexOf(e)],x=[],k=0;for(let[z,T]of[[d,h],[p,f]])for(let P=0;P<z;P+=1){let H=new Uint8Array(n.slice(k,k+T));k+=T,x.push({data:H,ec:Y4(H,s)})}let C=[],S=Math.max(...x.map(z=>z.data.length));for(let z=0;z<S;z+=1)for(let T of x)z<T.data.length&&C.push(T.data[z]);for(let z=0;z<s;z+=1)for(let T of x)C.push(T.ec[z]);return new Uint8Array(C)}function Q4(i){let o=i*4+17;return{size:o,modules:Array.from({length:o},()=>Array(o).fill(null)),reserved:Array.from({length:o},()=>Array(o).fill(!1))}}function $o(i,o,e,t){i.modules[e][o]=t,i.reserved[e][o]=!0}function Jd(i,o,e){for(let t=-1;t<=7;t+=1)for(let r=-1;r<=7;r+=1){let n=o+r,s=e+t;if(n<0||s<0||n>=i.size||s>=i.size)continue;let d=r>=0&&r<=6&&t>=0&&t<=6,h=Math.max(Math.abs(r-3),Math.abs(t-3));$o(i,n,s,d&&h!==2)}}function J4(i,o){Jd(i,0,0),Jd(i,i.size-7,0),Jd(i,0,i.size-7);for(let t=8;t<i.size-8;t+=1){let r=t%2===0;$o(i,t,6,r),$o(i,6,t,r)}let e=q4[o-1];for(let t of e)for(let r of e)if(!(r===6&&t===6||r===6&&t===i.size-7||r===i.size-7&&t===6))for(let s=-2;s<=2;s+=1)for(let d=-2;d<=2;d+=1){let h=Math.max(Math.abs(d),Math.abs(s));$o(i,r+d,t+s,h!==1)}for(let t=0;t<9;t+=1)t!==6&&($o(i,t,8,!1),$o(i,8,t,!1));for(let t=0;t<8;t+=1)$o(i,i.size-1-t,8,!1);for(let t=0;t<7;t+=1)$o(i,8,i.size-1-t,!1);if($o(i,8,i.size-8,!0),o>=7){let t=K4[o-7];for(let r=0;r<18;r+=1){let n=(t>>>r&1)===1,s=Math.floor(r/3),d=r%3+i.size-11;$o(i,s,d,n),$o(i,d,s,n)}}}function e5(i,o){let e=0,t=!0;for(let r=i.size-1;r>=1;r-=2){let n=r===6?5:r;for(let s=0;s<i.size;s+=1){let d=t?i.size-1-s:s;for(let h of[n,n-1]){if(i.reserved[d][h])continue;let p=o[e>>>3]??0;i.modules[d][h]=(p>>>7-(e&7)&1)===1,e+=1}}t=!t}}function t5(i,o,e){switch(i){case 0:return(o+e)%2===0;case 1:return e%2===0;case 2:return o%3===0;case 3:return(o+e)%3===0;case 4:return(Math.floor(e/2)+Math.floor(o/3))%2===0;case 5:return o*e%2+o*e%3===0;case 6:return(o*e%2+o*e%3)%2===0;default:return((o+e)%2+o*e%3)%2===0}}function r5(i,o,e){let t=U4[o]<<3|e,r=t;for(let s=0;s<10;s+=1)r=r<<1^(r>>>9)*1335;let n=(t<<10|r)^W4;for(let s=0;s<=5;s+=1)i.modules[8][s]=(n>>>s&1)===1;i.modules[8][7]=(n>>>6&1)===1,i.modules[8][8]=(n>>>7&1)===1,i.modules[7][8]=(n>>>8&1)===1;for(let s=9;s<15;s+=1)i.modules[14-s][8]=(n>>>s&1)===1;for(let s=0;s<7;s+=1)i.modules[i.size-1-s][8]=(n>>>s&1)===1;for(let s=8;s<15;s+=1)i.modules[8][i.size-15+s]=(n>>>s&1)===1}function o5(i){let o=i.length,e=0,t=h=>{let p=0,f=1;for(let x=1;x<o;x+=1)h[x]===h[x-1]?(f+=1,f===5?p+=3:f>5&&(p+=1)):f=1;return p};for(let h=0;h<o;h+=1)e+=t(i[h]),e+=t(i.map(p=>p[h]));for(let h=0;h<o-1;h+=1)for(let p=0;p<o-1;p+=1){let f=i[h][p];f===i[h][p+1]&&f===i[h+1][p]&&f===i[h+1][p+1]&&(e+=3)}let r=[!0,!1,!0,!0,!0,!1,!0],n=(h,p)=>r.every((f,x)=>h[p+x]===f);for(let h=0;h<o;h+=1){let p=i[h],f=i.map(x=>x[h]);for(let x=0;x+7<=o;x+=1)n(p,x)&&(e+=40),n(f,x)&&(e+=40)}let d=i.flat().filter(Boolean).length*100/(o*o);return e+=Math.floor(Math.abs(d-50)/5)*10,e}function iu(i,o={}){let e=o.errorCorrection??"M",t=new TextEncoder().encode(i),r=o.version??X4(t.length,e);if(r<1||r>40||!Number.isInteger(r))throw new Error(`qrcode: version must be an integer from 1 to 40, received ${r}`);if(4+ou(r)+t.length*8>ru(r,e)*8)throw new Error(`qrcode: ${t.length} bytes does not fit a version ${r} symbol at error correction level ${e}`);let s=Z4(t,r,e),d=Q4(r);J4(d,r),e5(d,s);let h=null;for(let p=0;p<8;p+=1){let f=d.modules.map((S,z)=>S.map((T,P)=>d.reserved[z][P]?!!T:!!T!==t5(p,P,z))),x={...d,modules:f};r5(x,e,p);let k=x.modules.map(S=>S.map(Boolean)),C=o5(k);(!h||C<h.score)&&(h={matrix:k,score:C})}return{matrix:h.matrix,size:d.size,version:r,errorCorrection:e}}var Lt=class extends n5{constructor(){super(...arguments);this.value="";this.errorCorrection="M";this.margin=4;this.logo="";this.logoRatio=.2;this._error=""}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}get _effectiveErrorCorrection(){if(!this.logo)return this.errorCorrection;let e=this._cappedLogoRatio>.22?"H":"Q",t=["L","M","Q","H"];return t.indexOf(this.errorCorrection)>=t.indexOf(e)?this.errorCorrection:e}get _cappedLogoRatio(){return Math.min(Math.max(this.logoRatio,0),.3)}get _cssSize(){return this.size===void 0||this.size===""?"":mt(this.size)}toDataUrl(){let e=this._svgMarkup();return e?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`:""}_svgMarkup(){try{let{matrix:e,size:t}=iu(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version}),r=Math.max(0,Math.floor(this.margin)),n=t+r*2,s=this.color||"currentColor",d=this.background||"transparent",h="";return e.forEach((p,f)=>{p.forEach((x,k)=>{x&&(h+=`M${k+r} ${f+r}h1v1h-1z`)})}),[`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${n} ${n}"`,' shape-rendering="crispEdges">',`<rect width="${n}" height="${n}" fill="${d}"/>`,`<path d="${h}" fill="${s}"/>`,"</svg>"].join("")}catch{return""}}render(){let e=N(this,"qrcode"),t=Math.max(0,Math.floor(this.margin)),r=this._cssSize||e.size||"",n=null,s="";if(!this.value)s=this._t("qrcode.empty","\u65E0\u5185\u5BB9");else try{n=iu(this.value,{errorCorrection:this._effectiveErrorCorrection,version:this.version})}catch(p){s=p instanceof Error?p.message:String(p)}s!==this._error&&(this._error=s,s&&this.value&&this.dispatchEvent(new CustomEvent("error",{detail:{message:s},bubbles:!0,composed:!0})));let d=[r?`--lui-qrcode-size:${r}`:"",this.background?`--lui-qrcode-bg:${this.background}`:"",this.color?`--lui-qrcode-fg:${this.color}`:"",this.logo?`--lui-qrcode-logo-size:${this._cappedLogoRatio*100}%`:""].filter(Boolean).join(";");if(!n)return nu`
|
|
14542
14572
|
<div class="frame" part="base" style=${d||El}>
|
|
14543
14573
|
<div part="error" role="img" aria-label=${s}>
|
|
14544
14574
|
<lui-icon name="circle-x"></lui-icon>
|
|
@@ -14570,7 +14600,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14570
14600
|
</span>
|
|
14571
14601
|
`:El}
|
|
14572
14602
|
</div>
|
|
14573
|
-
`}};
|
|
14603
|
+
`}};Lt.styles=[A,O,i5`
|
|
14574
14604
|
:host {
|
|
14575
14605
|
display: inline-block;
|
|
14576
14606
|
--lui-qrcode-size: 160px;
|
|
@@ -14637,7 +14667,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14637
14667
|
color: var(--lui-color-danger);
|
|
14638
14668
|
--lui-icon-size: 20px;
|
|
14639
14669
|
}
|
|
14640
|
-
`],a([To()],Bt.prototype,"value",2),a([To()],Bt.prototype,"size",2),a([To({attribute:"error-correction"})],Bt.prototype,"errorCorrection",2),a([To({type:Number})],Bt.prototype,"margin",2),a([To({type:Number})],Bt.prototype,"version",2),a([To()],Bt.prototype,"logo",2),a([To({type:Number,attribute:"logo-ratio"})],Bt.prototype,"logoRatio",2),a([To()],Bt.prototype,"color",2),a([To()],Bt.prototype,"background",2),a([To({reflect:!0})],Bt.prototype,"locale",2),a([To({attribute:!1})],Bt.prototype,"translations",2),a([l5()],Bt.prototype,"_error",2),Bt=a([s5("lui-qrcode")],Bt);import{css as c5,html as Sl,LitElement as d5}from"lit";import{customElement as u5,property as oo,state as h5}from"lit/decorators.js";import{repeat as p5}from"lit/directives/repeat.js";var m5=0,au=new WeakSet,$l=new Map,b0=500,g5=56,y0=12,f5=.048,k0=6,Ht=class extends d5{constructor(){super(...arguments);this.position="top-right";this.radius="lg";this.duration=3e3;this.max=5;this.listen=!0;this.pauseOnHover=!0;this.showProgress=!1;this.stacked=!1;this.stackMaxVisible=4;this.stackGap=k0;this._explicitAttrs=new Set;this._items=[];this._stackExpanded=!1;this._pendingQueue=new Map;this._toastHeights=new Map;this._observedToastElements=new Map;this._progressFrame=0;this._onStackMouseEnter=()=>{this._pauseAllToasts(),this.stacked&&this._setStackExpanded(!0)};this._onStackMouseLeave=()=>{this._resumeAllToasts(),this.stacked&&(this._stackCollapseTimer=setTimeout(()=>{this._stackExpanded=!1,this._stackCollapseTimer=void 0},120))};this._onNotify=e=>{let t=e;if(t.defaultPrevented||au.has(t))return;let r=t.detail;if(!r?.message)return;let n=`${r.type??"info"}:${r.message}`,s=Date.now();for(let[h,p]of $l)s-p>=b0&&$l.delete(h);let d=$l.get(n)??0;if(s-d<b0){au.add(t);return}$l.set(n,s),au.add(t),this.show({level:r.type,message:r.message})}}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this.listen&&document.addEventListener("notify",this._onNotify)}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),document.removeEventListener("notify",this._onNotify),this._items.forEach(e=>{e.timer&&clearTimeout(e.timer)}),this._pendingQueue.forEach(({timer:e})=>clearTimeout(e)),this._pendingQueue.clear(),this._stackCollapseTimer&&clearTimeout(this._stackCollapseTimer),this._cancelProgressTicker(),this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this._observedToastElements.clear(),this._toastHeights.clear()}firstUpdated(){this._resizeObserver=new ResizeObserver(e=>{let t=!1;for(let r of e){let n=r.target,s=Number(n.dataset.id);if(!Number.isFinite(s))continue;let h=(Array.isArray(r.borderBoxSize)?r.borderBoxSize[0]:r.borderBoxSize)?.blockSize||n.getBoundingClientRect().height||r.contentRect.height,p=Math.max(1,Math.ceil(h));this._toastHeights.get(s)!==p&&(this._toastHeights.set(s,p),t=!0)}t&&this.requestUpdate()}),this._syncToastObservers()}willUpdate(){let e=N(this,"toast");!this._explicitAttrs.has("position")&&typeof e.position=="string"&&this.position!==e.position&&(this.position=e.position),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("duration")&&typeof e.duration=="number"&&this.duration!==e.duration&&(this.duration=e.duration),!this._explicitAttrs.has("max")&&typeof e.max=="number"&&this.max!==e.max&&(this.max=e.max),!this._explicitAttrs.has("pause-on-hover")&&typeof e.pauseOnHover=="boolean"&&this.pauseOnHover!==e.pauseOnHover&&(this.pauseOnHover=e.pauseOnHover),!this._explicitAttrs.has("show-progress")&&typeof e.showProgress=="boolean"&&this.showProgress!==e.showProgress&&(this.showProgress=e.showProgress),!this._explicitAttrs.has("stacked")&&typeof e.stacked=="boolean"&&this.stacked!==e.stacked&&(this.stacked=e.stacked),!this._explicitAttrs.has("stack-max-visible")&&typeof e.stackMaxVisible=="number"&&this.stackMaxVisible!==e.stackMaxVisible&&(this.stackMaxVisible=e.stackMaxVisible),!this._explicitAttrs.has("stack-gap")&&typeof e.stackGap=="number"&&this.stackGap!==e.stackGap&&(this.stackGap=e.stackGap)}updated(){this._syncToastObservers(),this._syncProgressTicker()}show(e){let t=++m5,r=()=>{this._pendingQueue.delete(t),e.radius!=null&&(this.radius=e.radius),e.stacked!=null&&(this.stacked=e.stacked),e.stackMaxVisible!=null&&(this.stackMaxVisible=e.stackMaxVisible),e.stackGap!=null&&(this.stackGap=e.stackGap);let d=e.level??e.type??"info",h=e.duration??this.duration,p={id:t,level:d,message:e.message,duration:h,pauseOnHover:e.pauseOnHover??this.pauseOnHover,showProgress:e.showProgress??this.showProgress,action:e.action,startTime:Date.now(),remainingTime:h,paused:!1},f=[...this._items,p];if(f.length>this.max){let x=f.shift();x?.timer&&clearTimeout(x.timer),x&&this._toastHeights.delete(x.id)}this._items=f,this.requestUpdate(),p.duration>0&&this._startTimer(p),this._syncProgressTicker()},n=Math.max(0,e.delay??0),s=setTimeout(r,n);return this._pendingQueue.set(t,{timer:s,payload:{...e}}),t}has(e){return this._items.some(t=>t.id===e)||this._pendingQueue.has(e)}close(e){let t=this._pendingQueue.get(e);return t?(clearTimeout(t.timer),this._pendingQueue.delete(e),this.requestUpdate(),this._emitEmptyIfNeeded(),!0):this._items.some(r=>r.id===e)?(this._dismiss(e),!0):!1}clear(){this._items.forEach(e=>{e.timer&&clearTimeout(e.timer)}),this._pendingQueue.forEach(({timer:e})=>clearTimeout(e)),this._pendingQueue.clear(),this._items=[],this._toastHeights.clear(),this._cancelProgressTicker(),this.requestUpdate(),this._emitEmptyIfNeeded()}updateToast(e,t){let r=this._pendingQueue.get(e);if(r)return r.payload={...r.payload,...t,level:t.level??t.type??r.payload.level},this._pendingQueue.set(e,r),!0;let n=this._items.find(s=>s.id===e);return n?((t.level!=null||t.type!=null)&&(n.level=t.level??t.type),t.message!=null&&(n.message=t.message),t.pauseOnHover!=null&&(n.pauseOnHover=t.pauseOnHover),t.showProgress!=null&&(n.showProgress=t.showProgress),t.action!==void 0&&(n.action=t.action),t.duration!=null&&(n.timer&&(clearTimeout(n.timer),n.timer=void 0),n.duration=t.duration,n.remainingTime=t.duration,n.startTime=Date.now(),n.paused=!1,t.duration>0&&this._startTimer(n)),this._syncProgressTicker(),this.requestUpdate(),!0):!1}_startTimer(e){e.timer&&clearTimeout(e.timer),e.startTime=Date.now(),e.timer=setTimeout(()=>this._dismiss(e.id),Math.max(0,e.remainingTime??0))}_pauseToast(e){return!e.pauseOnHover||e.paused||e.duration===0?!1:(e.paused=!0,e.timer&&(clearTimeout(e.timer),e.timer=void 0),e.remainingTime=Math.max(0,(e.remainingTime??e.duration)-(Date.now()-(e.startTime??Date.now()))),!0)}_resumeToast(e){return!e.pauseOnHover||!e.paused||e.duration===0?!1:(e.paused=!1,e.startTime=Date.now(),this._startTimer(e),!0)}_pauseAllToasts(){let e=!1;for(let t of this._items)e=this._pauseToast(t)||e;e&&(this._syncProgressTicker(),this.requestUpdate())}_resumeAllToasts(){let e=!1;for(let t of this._items)e=this._resumeToast(t)||e;e&&(this._syncProgressTicker(),this.requestUpdate())}_setStackExpanded(e){this._stackCollapseTimer&&(clearTimeout(this._stackCollapseTimer),this._stackCollapseTimer=void 0),this._stackExpanded!==e&&(this._stackExpanded=e)}_dismiss(e){let t=this._items.find(r=>r.id===e);t?.timer&&clearTimeout(t.timer),this._items=this._items.filter(r=>r.id!==e),this._toastHeights.delete(e),this._syncProgressTicker(),this.requestUpdate(),this._emitEmptyIfNeeded()}_hasActiveProgress(){return this._items.some(e=>!!e.showProgress&&e.duration>0&&!e.paused&&this._getRemainingTime(e)>0)}_cancelProgressTicker(){this._progressFrame&&(cancelAnimationFrame(this._progressFrame),this._progressFrame=0)}_syncProgressTicker(){if(!this._hasActiveProgress()){this._cancelProgressTicker();return}if(this._progressFrame)return;let e=()=>{this._progressFrame=0,!(!this.isConnected||!this._hasActiveProgress())&&(this.requestUpdate(),this._progressFrame=requestAnimationFrame(e))};this._progressFrame=requestAnimationFrame(e)}_emitEmptyIfNeeded(){this._items.length>0||this._pendingQueue.size>0||this.dispatchEvent(new CustomEvent("empty",{bubbles:!0,composed:!0}))}_syncToastObservers(){if(!this._resizeObserver)return;let e=Array.from(this.renderRoot.querySelectorAll(".toast[data-id]")),t=new Set;for(let r of e){let n=Number(r.dataset.id);if(!Number.isFinite(n)||(t.add(n),this._observedToastElements.get(n)===r))continue;let s=this._observedToastElements.get(n);s&&this._resizeObserver.unobserve(s),this._observedToastElements.set(n,r),this._resizeObserver.observe(r)}for(let[r,n]of this._observedToastElements)t.has(r)||(this._resizeObserver.unobserve(n),this._observedToastElements.delete(r),this._toastHeights.delete(r))}_getToastHeight(e){return this._toastHeights.get(e)??g5}_resolvedStackGap(){return Math.max(0,Number.isFinite(this.stackGap)?this.stackGap:k0)}_buildLayout(e){let t=this.position.startsWith("top")?1:-1,r=!this.stacked||this._stackExpanded,n=this._resolvedStackGap(),s=Math.max(1,this.stackMaxVisible),d=0;return e.map((h,p)=>{let f=this._getToastHeight(h.id),x=Math.min(p,s-1),k=Math.max(.84,1-x*f5),C=p>=s?0:p===0?1:Math.max(.24,1-x*.18),z=`translateY(${r?t*d:t*x*y0}px) scale(${r?1:k})`,T=r?1:C,P=r||p===0?"auto":"none";return r&&(d+=f+n),{item:h,depth:p,height:f,transform:z,opacity:T,zIndex:1e3-p,pointerEvents:P}})}_getStackHeight(e){if(e.length===0)return 0;if(!this.stacked||this._stackExpanded){let n=this._resolvedStackGap();return e.reduce((s,d,h)=>s+d.height+(h<e.length-1?n:0),0)}let r=Math.min(e.length,Math.max(1,this.stackMaxVisible));return e[0].height+y0*Math.max(0,r-1)}_getRemainingTime(e){if(e.duration<=0)return 0;if(e.paused)return Math.max(0,e.remainingTime??e.duration);let t=e.remainingTime??e.duration,r=Date.now()-(e.startTime??Date.now());return Math.max(0,t-r)}_progressState(e){let t=Math.max(1,e.duration),r=this._getRemainingTime(e);return{ratio:Math.min(1,r/t),remaining:r,paused:!!e.paused}}render(){let e=[...this._items].reverse(),t=this._buildLayout(e),r=this._getStackHeight(t);return Sl`
|
|
14670
|
+
`],a([To()],Lt.prototype,"value",2),a([To()],Lt.prototype,"size",2),a([To({attribute:"error-correction"})],Lt.prototype,"errorCorrection",2),a([To({type:Number})],Lt.prototype,"margin",2),a([To({type:Number})],Lt.prototype,"version",2),a([To()],Lt.prototype,"logo",2),a([To({type:Number,attribute:"logo-ratio"})],Lt.prototype,"logoRatio",2),a([To()],Lt.prototype,"color",2),a([To()],Lt.prototype,"background",2),a([To({reflect:!0})],Lt.prototype,"locale",2),a([To({attribute:!1})],Lt.prototype,"translations",2),a([l5()],Lt.prototype,"_error",2),Lt=a([s5("lui-qrcode")],Lt);import{css as c5,html as Sl,LitElement as d5}from"lit";import{customElement as u5,property as oo,state as h5}from"lit/decorators.js";import{repeat as p5}from"lit/directives/repeat.js";var m5=0,au=new WeakSet,$l=new Map,b0=500,g5=56,y0=12,f5=.048,k0=6,Ht=class extends d5{constructor(){super(...arguments);this.position="top-right";this.radius="lg";this.duration=3e3;this.max=5;this.listen=!0;this.pauseOnHover=!0;this.showProgress=!1;this.stacked=!1;this.stackMaxVisible=4;this.stackGap=k0;this._explicitAttrs=new Set;this._items=[];this._stackExpanded=!1;this._pendingQueue=new Map;this._toastHeights=new Map;this._observedToastElements=new Map;this._progressFrame=0;this._onStackMouseEnter=()=>{this._pauseAllToasts(),this.stacked&&this._setStackExpanded(!0)};this._onStackMouseLeave=()=>{this._resumeAllToasts(),this.stacked&&(this._stackCollapseTimer=setTimeout(()=>{this._stackExpanded=!1,this._stackCollapseTimer=void 0},120))};this._onNotify=e=>{let t=e;if(t.defaultPrevented||au.has(t))return;let r=t.detail;if(!r?.message)return;let n=`${r.type??"info"}:${r.message}`,s=Date.now();for(let[h,p]of $l)s-p>=b0&&$l.delete(h);let d=$l.get(n)??0;if(s-d<b0){au.add(t);return}$l.set(n,s),au.add(t),this.show({level:r.type,message:r.message})}}_t(e,t){let r=Fe(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this.listen&&document.addEventListener("notify",this._onNotify)}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),document.removeEventListener("notify",this._onNotify),this._items.forEach(e=>{e.timer&&clearTimeout(e.timer)}),this._pendingQueue.forEach(({timer:e})=>clearTimeout(e)),this._pendingQueue.clear(),this._stackCollapseTimer&&clearTimeout(this._stackCollapseTimer),this._cancelProgressTicker(),this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this._observedToastElements.clear(),this._toastHeights.clear()}firstUpdated(){this._resizeObserver=new ResizeObserver(e=>{let t=!1;for(let r of e){let n=r.target,s=Number(n.dataset.id);if(!Number.isFinite(s))continue;let h=(Array.isArray(r.borderBoxSize)?r.borderBoxSize[0]:r.borderBoxSize)?.blockSize||n.getBoundingClientRect().height||r.contentRect.height,p=Math.max(1,Math.ceil(h));this._toastHeights.get(s)!==p&&(this._toastHeights.set(s,p),t=!0)}t&&this.requestUpdate()}),this._syncToastObservers()}willUpdate(){let e=N(this,"toast");!this._explicitAttrs.has("position")&&typeof e.position=="string"&&this.position!==e.position&&(this.position=e.position),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("duration")&&typeof e.duration=="number"&&this.duration!==e.duration&&(this.duration=e.duration),!this._explicitAttrs.has("max")&&typeof e.max=="number"&&this.max!==e.max&&(this.max=e.max),!this._explicitAttrs.has("pause-on-hover")&&typeof e.pauseOnHover=="boolean"&&this.pauseOnHover!==e.pauseOnHover&&(this.pauseOnHover=e.pauseOnHover),!this._explicitAttrs.has("show-progress")&&typeof e.showProgress=="boolean"&&this.showProgress!==e.showProgress&&(this.showProgress=e.showProgress),!this._explicitAttrs.has("stacked")&&typeof e.stacked=="boolean"&&this.stacked!==e.stacked&&(this.stacked=e.stacked),!this._explicitAttrs.has("stack-max-visible")&&typeof e.stackMaxVisible=="number"&&this.stackMaxVisible!==e.stackMaxVisible&&(this.stackMaxVisible=e.stackMaxVisible),!this._explicitAttrs.has("stack-gap")&&typeof e.stackGap=="number"&&this.stackGap!==e.stackGap&&(this.stackGap=e.stackGap)}updated(){this._syncToastObservers(),this._syncProgressTicker()}show(e){let t=++m5,r=()=>{this._pendingQueue.delete(t),e.radius!=null&&(this.radius=e.radius),e.stacked!=null&&(this.stacked=e.stacked),e.stackMaxVisible!=null&&(this.stackMaxVisible=e.stackMaxVisible),e.stackGap!=null&&(this.stackGap=e.stackGap);let d=e.level??e.type??"info",h=e.duration??this.duration,p={id:t,level:d,message:e.message,duration:h,pauseOnHover:e.pauseOnHover??this.pauseOnHover,showProgress:e.showProgress??this.showProgress,action:e.action,startTime:Date.now(),remainingTime:h,paused:!1},f=[...this._items,p];if(f.length>this.max){let x=f.shift();x?.timer&&clearTimeout(x.timer),x&&this._toastHeights.delete(x.id)}this._items=f,this.requestUpdate(),p.duration>0&&this._startTimer(p),this._syncProgressTicker()},n=Math.max(0,e.delay??0),s=setTimeout(r,n);return this._pendingQueue.set(t,{timer:s,payload:{...e}}),t}has(e){return this._items.some(t=>t.id===e)||this._pendingQueue.has(e)}close(e){let t=this._pendingQueue.get(e);return t?(clearTimeout(t.timer),this._pendingQueue.delete(e),this.requestUpdate(),this._emitEmptyIfNeeded(),!0):this._items.some(r=>r.id===e)?(this._dismiss(e),!0):!1}clear(){this._items.forEach(e=>{e.timer&&clearTimeout(e.timer)}),this._pendingQueue.forEach(({timer:e})=>clearTimeout(e)),this._pendingQueue.clear(),this._items=[],this._toastHeights.clear(),this._cancelProgressTicker(),this.requestUpdate(),this._emitEmptyIfNeeded()}updateToast(e,t){let r=this._pendingQueue.get(e);if(r)return r.payload={...r.payload,...t,level:t.level??t.type??r.payload.level},this._pendingQueue.set(e,r),!0;let n=this._items.find(s=>s.id===e);return n?((t.level!=null||t.type!=null)&&(n.level=t.level??t.type),t.message!=null&&(n.message=t.message),t.pauseOnHover!=null&&(n.pauseOnHover=t.pauseOnHover),t.showProgress!=null&&(n.showProgress=t.showProgress),t.action!==void 0&&(n.action=t.action),t.duration!=null&&(n.timer&&(clearTimeout(n.timer),n.timer=void 0),n.duration=t.duration,n.remainingTime=t.duration,n.startTime=Date.now(),n.paused=!1,t.duration>0&&this._startTimer(n)),this._syncProgressTicker(),this.requestUpdate(),!0):!1}_startTimer(e){e.timer&&clearTimeout(e.timer),e.startTime=Date.now(),e.timer=setTimeout(()=>this._dismiss(e.id),Math.max(0,e.remainingTime??0))}_pauseToast(e){return!e.pauseOnHover||e.paused||e.duration===0?!1:(e.paused=!0,e.timer&&(clearTimeout(e.timer),e.timer=void 0),e.remainingTime=Math.max(0,(e.remainingTime??e.duration)-(Date.now()-(e.startTime??Date.now()))),!0)}_resumeToast(e){return!e.pauseOnHover||!e.paused||e.duration===0?!1:(e.paused=!1,e.startTime=Date.now(),this._startTimer(e),!0)}_pauseAllToasts(){let e=!1;for(let t of this._items)e=this._pauseToast(t)||e;e&&(this._syncProgressTicker(),this.requestUpdate())}_resumeAllToasts(){let e=!1;for(let t of this._items)e=this._resumeToast(t)||e;e&&(this._syncProgressTicker(),this.requestUpdate())}_setStackExpanded(e){this._stackCollapseTimer&&(clearTimeout(this._stackCollapseTimer),this._stackCollapseTimer=void 0),this._stackExpanded!==e&&(this._stackExpanded=e)}_dismiss(e){let t=this._items.find(r=>r.id===e);t?.timer&&clearTimeout(t.timer),this._items=this._items.filter(r=>r.id!==e),this._toastHeights.delete(e),this._syncProgressTicker(),this.requestUpdate(),this._emitEmptyIfNeeded()}_hasActiveProgress(){return this._items.some(e=>!!e.showProgress&&e.duration>0&&!e.paused&&this._getRemainingTime(e)>0)}_cancelProgressTicker(){this._progressFrame&&(cancelAnimationFrame(this._progressFrame),this._progressFrame=0)}_syncProgressTicker(){if(!this._hasActiveProgress()){this._cancelProgressTicker();return}if(this._progressFrame)return;let e=()=>{this._progressFrame=0,!(!this.isConnected||!this._hasActiveProgress())&&(this.requestUpdate(),this._progressFrame=requestAnimationFrame(e))};this._progressFrame=requestAnimationFrame(e)}_emitEmptyIfNeeded(){this._items.length>0||this._pendingQueue.size>0||this.dispatchEvent(new CustomEvent("empty",{bubbles:!0,composed:!0}))}_syncToastObservers(){if(!this._resizeObserver)return;let e=Array.from(this.renderRoot.querySelectorAll(".toast[data-id]")),t=new Set;for(let r of e){let n=Number(r.dataset.id);if(!Number.isFinite(n)||(t.add(n),this._observedToastElements.get(n)===r))continue;let s=this._observedToastElements.get(n);s&&this._resizeObserver.unobserve(s),this._observedToastElements.set(n,r),this._resizeObserver.observe(r)}for(let[r,n]of this._observedToastElements)t.has(r)||(this._resizeObserver.unobserve(n),this._observedToastElements.delete(r),this._toastHeights.delete(r))}_getToastHeight(e){return this._toastHeights.get(e)??g5}_resolvedStackGap(){return Math.max(0,Number.isFinite(this.stackGap)?this.stackGap:k0)}_buildLayout(e){let t=this.position.startsWith("top")?1:-1,r=!this.stacked||this._stackExpanded,n=this._resolvedStackGap(),s=Math.max(1,this.stackMaxVisible),d=0;return e.map((h,p)=>{let f=this._getToastHeight(h.id),x=Math.min(p,s-1),k=Math.max(.84,1-x*f5),C=p>=s?0:p===0?1:Math.max(.24,1-x*.18),z=`translateY(${r?t*d:t*x*y0}px) scale(${r?1:k})`,T=r?1:C,P=r||p===0?"auto":"none";return r&&(d+=f+n),{item:h,depth:p,height:f,transform:z,opacity:T,zIndex:1e3-p,pointerEvents:P}})}_getStackHeight(e){if(e.length===0)return 0;if(!this.stacked||this._stackExpanded){let n=this._resolvedStackGap();return e.reduce((s,d,h)=>s+d.height+(h<e.length-1?n:0),0)}let r=Math.min(e.length,Math.max(1,this.stackMaxVisible));return e[0].height+y0*Math.max(0,r-1)}_getRemainingTime(e){if(e.duration<=0)return 0;if(e.paused)return Math.max(0,e.remainingTime??e.duration);let t=e.remainingTime??e.duration,r=Date.now()-(e.startTime??Date.now());return Math.max(0,t-r)}_progressState(e){let t=Math.max(1,e.duration),r=this._getRemainingTime(e);return{ratio:Math.min(1,r/t),remaining:r,paused:!!e.paused}}render(){let e=[...this._items].reverse(),t=this._buildLayout(e),r=this._getStackHeight(t);return Sl`
|
|
14641
14671
|
<div
|
|
14642
14672
|
class="stack"
|
|
14643
14673
|
style=${`height:${r}px;`}
|
|
@@ -14864,7 +14894,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
|
|
|
14864
14894
|
@keyframes lui-dialog-loading-spin {
|
|
14865
14895
|
to { transform: rotate(360deg); }
|
|
14866
14896
|
}
|
|
14867
|
-
`,document.head.appendChild(r)}return o}function N5(i){let o=typeof i=="string"?{message:i}:i,e=cu({title:o.title??Jn("dialog.loading_title","\u8BF7\u7A0D\u5019"),message:void 0,noClose:o.noClose??!0,closeOnOutsidePress:o.closeOnOutsidePress??!1,shakeOnOutsideClick:o.shakeOnOutsideClick,placement:o.placement,offset:o.offset,backdrop:o.backdrop,backdropStyle:o.backdropStyle,backdropContent:o.backdropContent,noHeader:o.noHeader,noFooter:o.noFooter,draggable:o.draggable,destroyOnClose:o.destroyOnClose,fullscreen:o.fullscreen,width:o.width,portal:o.portal,overlayLayer:o.overlayLayer,container:o.container}),t=D5(o.message??Jn("dialog.loading_message","\u5904\u7406\u4E2D..."));return e.appendChild(t),e.show(),{close:()=>du(e),update(r){let n=typeof r=="string"?{message:r}:r;n.title!=null&&(e.title=n.title,e.requestUpdate());let s=t.querySelector('[data-role="message"]');n.message!=null&&s&&(s.textContent=n.message)}}}function F5(){[...Al].forEach(i=>i.close?.())}var L5={create:ts,open:uu,alert:R5,confirm:I5,prompt:V5,loading:N5,closeAll:F5};function x0(i,o){let e=ho();return ne(ie(e.locale,e.translations),i,o)}function w0(i,o="default"){let e=document.createElement("lui-button");return oe(e,pt("button")),e.slot="footer",e.variant=o,e.textContent=i,e}function pu(i){return{...i,source:i.source?[...i.source]:void 0,fields:i.fields?i.fields.map(pu):void 0,condition:i.condition?{...i.condition}:void 0}}function B5(i){return{...i,fields:i.fields.map(pu)}}function jl(i,o){return{...i,fields:i.fields?i.fields.map(pu):void 0,steps:i.steps?i.steps.map(B5):void 0,defaultValues:i.defaultValues?{...i.defaultValues}:void 0,onSubmit:o??i.onSubmit}}function mu(i){let o="schema"in i?i.schema:i,e=document.createElement("lui-form");oe(e,pt("form")),e.schema=jl(o);let t=!1;return{el:e,get mounted(){return t&&e.isConnected},get visible(){return!e.hidden},mount(n){return n&&!e.isConnected&&(n.appendChild(e),t=!0),this},unmount(){return e.isConnected&&e.remove(),t=!1,this},show(){return e.hidden=!1,this},hide(){return e.hidden=!0,this},update(n){let s=e.schema??jl(o);return e.schema=jl({...s,...n,onSubmit:n.onSubmit??s.onSubmit}),this},destroy(){this.unmount()},submit(){return Promise.resolve(e.submit())},validate(){return e.validate()},reset(n){e.reset(n)},getValues(){return e.getValues()},setValues(n){e.setValues(n)},getValue(n){return e.getValue(n)},setValue(n,s){e.setValue(n,s)},focusField(n){return e.focusField(n)},scrollToField(n){return e.scrollToField(n)}}}var q5=mu;function _0(i){let o=i.schema.onSubmit,e=jl(i.schema,async x=>{await o?.(x),h(x)}),t=mu(e),r,n=!1,s=new Promise(x=>{r=x}),d=ts({...i,content:t.el,showCancel:!1}),h=x=>{n||(n=!0,r(x),d.destroy())},p=!!e.steps?.length;if(t.el.showActions=p,!p){let x=w0(i.cancelText??e.cancelLabel??x0("common.cancel","\u53D6\u6D88")),k=w0(i.submitText??e.submitLabel??x0("common.submit","\u63D0\u4EA4"),"primary");x.addEventListener("click",()=>h(null),{once:!0}),k.addEventListener("click",()=>t.submit(),{once:!1}),d.el.append(x,k)}return d.el.addEventListener("close",x=>{x.target===d.el&&h(null)}),{el:d.el,form:t,submit(){return t.submit()},validate(){return t.validate()},reset(x){t.reset(x)},getValues(){return t.getValues()},setValues(x){t.setValues(x)},getValue(x){return t.getValue(x)},setValue(x,k){t.setValue(x,k)},focusField(x){return t.focusField(x)},scrollToField(x){return t.scrollToField(x)},get mounted(){return d.mounted},get visible(){return d.visible},get closed(){return s},mount(x){return d.mount(x),this},unmount(){return d.unmount(),this},show(){return d.show(),this},hide(){return d.hide(),this},close(x){h(x??null)},update(x){return d.update(x),this},destroy(){d.destroy()}}}function hu(i){let o=_0(i);return o.show(),o}function K5(i){return"onSubmit"in i?hu({schema:i}):hu(i)}var W5={create:mu,open:hu,prompt:K5};function U5(){let i=document.createElement("lui-context-menu");return oe(i,pt("contextMenu")),i.trigger="manual",i}function gu(i,o){i.heading=o.heading??"",i.headingIcon=o.headingIcon??"",i.placement=o.placement??"bottom-start","items"in o&&o.items!==void 0&&(i.items=o.items),i.closeOnSelect=o.closeOnSelect??!0,i.closeOnOutsidePress=o.closeOnOutsidePress??!0,i.closeOnEscape=o.closeOnEscape??!0,i.submenuTrigger=o.submenuTrigger??"hover",i.backdrop=o.backdrop??"none",i.backdropStyle=o.backdropStyle??""}function Ol(i={}){let o=U5(),e=null,t=!1,r=s=>{e&&(o.removeEventListener("select",e),e=null),s&&(e=d=>{s(d.detail)},o.addEventListener("select",e))},n={el:o,get mounted(){return t&&o.isConnected},get visible(){return o.open},mount(s){if(o.isConnected)return this;let d=Qt("menu",s??i.container??Go()??Uo());return d.appendChild(o),Et(o,d,"menu"),t=!0,this},unmount(){return o.isConnected&&o.remove(),t=!1,this},show(s){o.isConnected||this.mount();let d={...i,...s};gu(o,d),st(o),r(d.onSelect),o.showAt(d.x,d.y,{items:d.items,context:d.context,triggerEvent:d.triggerEvent,source:d.source??"api"})},hide(){return o.hide(),this},update(s){return Object.assign(i,s),gu(o,{x:0,y:0,...i}),this},destroy(){r(void 0),o.hide(),this.unmount()}};return(i.items||i.heading||i.headingIcon||i.placement)&&gu(o,{x:0,y:0,...i}),n}var an=null,M0=new WeakMap;function C0(i){if(i.container){let o=M0.get(i.container);return(!o||!o.el.isConnected)&&(o=Ol({container:i.container}),M0.set(i.container,o)),o.show(i),o}return(!an||!an.el.isConnected)&&(an=Ol()),an.show(i),an}function z0(){document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.()})}function G5(){an?.destroy(),an=null,document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.(),i.remove()})}var Y5={create:Ol,show:C0,hideAll:z0,destroyAll:G5};function rs(i,o,e){if(e==null)return;let t=typeof e=="function"?e():e;if(typeof t=="string"){let n=document.createElement("div");n.slot=o,n.textContent=t,i.appendChild(n);return}if(t instanceof DocumentFragment){let n=document.createElement("div");n.slot=o,n.appendChild(t),i.appendChild(n);return}if(t instanceof HTMLElement||t instanceof SVGElement){t.setAttribute("slot",o),i.appendChild(t);return}let r=document.createElement("div");r.slot=o,r.appendChild(t),i.appendChild(r)}function X5(i){let o=document.createElement("lui-popover");return oe(o,pt("popover")),i.trigger!=null&&(o.trigger=i.trigger),i.placement!=null&&(o.placement=i.placement),i.disabled!=null&&(o.disabled=i.disabled),i.interactive!=null&&(o.interactive=i.interactive),i.showArrow!=null&&(o.showArrow=i.showArrow),i.closeOnOutsidePress!=null&&(o.closeOnOutsidePress=i.closeOnOutsidePress),i.closeOnEsc!=null&&(o.closeOnEsc=i.closeOnEsc),i.openDelay!=null&&(o.openDelay=i.openDelay),i.closeDelay!=null&&(o.closeDelay=i.closeDelay),i.offsetDistance!=null&&(o.offsetDistance=i.offsetDistance),i.autoFlip!=null&&(o.autoFlip=i.autoFlip),i.autoShift!=null&&(o.autoShift=i.autoShift),i.sameWidth!=null&&(o.sameWidth=i.sameWidth),i.maxWidth!=null&&(o.maxWidth=i.maxWidth),i.maxHeight!=null&&(o.maxHeight=i.maxHeight),i.backdrop!=null&&(o.backdrop=i.backdrop),i.backdropStyle!=null&&(o.backdropStyle=i.backdropStyle),i.portal!=null&&(o.portal=i.portal),i.overlayLayer!=null&&(o.overlayLayer=i.overlayLayer),i.container!=null&&(o.container=i.container),rs(o,"trigger",i.triggerContent),rs(o,"header",i.header),rs(o,"content",i.content),rs(o,"footer",i.footer),rs(o,"backdrop",i.backdropContent),o}function fu(i={}){let o=X5(i),e=!1,t=!1,r,n=new Promise(h=>{r=h}),s=()=>{t||(t=!0,r({action:"close"}))};return o.addEventListener("close",h=>{h.target===o&&s()}),{el:o,get mounted(){return e&&o.isConnected},get visible(){return o.open},get closed(){return n},mount(h){return o.isConnected?this:((h??document.body).appendChild(o),e=!0,this)},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.isConnected||this.mount(),o.portal&&o._portalHost&&st(o._portalHost),o.show(),this},hide(){return o.hide(),this},close(){o.hide(),s()},update(h){return Object.assign(o,h),this},destroy(){t||s(),this.unmount()}}}function Z5(i={}){let o=fu({...i,trigger:"manual"});return o.show(),o}function Q5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.()})}function J5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.(),i.remove()})}var ex={create:fu,open:Z5,closeAll:Q5,destroyAll:J5};var io=new Map;function tx(){return Qt("toast",Go()??Uo())}function $0(i){let o=pt("toast"),e=typeof o.position=="string"?o.position:void 0;return i??e??"top-right"}function vu(i){let o=ho();i.locale=o.locale,i.translations=o.translations,oe(i,pt("toast"))}function Rl(){for(let[i,o]of io)o?.isConnected||io.delete(i)}function rx(i){let o=io.get(i);o&&(io.delete(i),o.isConnected&&o.remove())}function ox(i,o,e,t,r,n){Rl();let s=$0(i),d=io.get(s);if(d?.isConnected)return vu(d),st(d),d.position=s,typeof o=="number"&&(d.max=o),typeof e=="string"&&(d.radius=e),typeof t=="boolean"&&(d.stacked=t),typeof r=="number"&&(d.stackMaxVisible=r),typeof n=="number"&&(d.stackGap=n),d;let h=document.createElement("lui-toast");h.listen=!1,vu(h),h.position=s,typeof o=="number"&&(h.max=o),typeof e=="string"&&(h.radius=e),typeof t=="boolean"&&(h.stacked=t),typeof r=="number"&&(h.stackMaxVisible=r),typeof n=="number"&&(h.stackGap=n),h.addEventListener("empty",()=>rx(s));let p=tx();return p.appendChild(h),Et(h,p,"toast"),io.set(s,h),h}function T0(i={}){let o=!1,e=null,t=r=>{if(e?.isConnected)return e;let n=$0(i.position);e=document.createElement("lui-toast"),e.listen=!1,vu(e),e.position=n,typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap);let s=Qt("toast",r??Go()??Uo());return s.appendChild(e),Et(e,s,"toast"),o=!0,e};return{get el(){return t()},get mounted(){return o&&!!e?.isConnected},get visible(){return!!e?.isConnected},mount(r){return t(r),this},unmount(){return e?.isConnected&&e.remove(),o=!1,this},show(r){let n=typeof r=="string"?{message:r}:r;return t().show({level:n.level??i.level,message:n.message,duration:n.duration??i.duration,radius:n.radius??i.radius,pauseOnHover:n.pauseOnHover??i.pauseOnHover,showProgress:n.showProgress??i.showProgress,action:n.action,delay:n.delay,stacked:n.stacked??i.stacked,stackMaxVisible:n.stackMaxVisible??i.stackMaxVisible,stackGap:n.stackGap??i.stackGap})},hide(){return e?.clear(),this},update(r){return Object.assign(i,r),e&&(typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap)),this},destroy(){this.unmount()},close(r){return e?e.close(r):!1},updateToast(r,n){if(!e)return!1;let s=typeof n=="string"?{message:n}:n;return e.updateToast(r,s)},clear(){e?.clear()}}}function ix(){Rl();for(let i of io.values())i.clear()}function bu(i){let o=typeof i=="string"?{message:i}:i;return ox(o.position,o.max,o.radius,o.stacked,o.stackMaxVisible,o.stackGap).show({level:o.level,message:o.message,duration:o.duration,radius:o.radius,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap})}function E0(i){Rl();for(let o of io.values())if(o.has(i))return o;return null}function Hl(i,o,e){let t=typeof o=="string"?{message:o,duration:e}:o;return bu({...t,level:i,duration:t.duration??e})}function S0(i,o,e){return i==null?{message:o}:typeof i=="string"?{message:i}:typeof i=="function"?{message:i(e)}:i}var Ai={create:T0,show:bu,clearAll:ix,close(i){let o=E0(i);return o?o.close(i):!1},update(i,o){let e=E0(i);if(!e)return!1;let t=typeof o=="string"?{message:o}:o;return e.updateToast(i,t)},loading(i){let o=typeof i=="string"?{message:i}:i,e=bu({level:o.level??"info",message:o.message,duration:0,position:o.position,max:o.max,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress??!1,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap});return{id:e,close:()=>Ai.close(e),update:t=>{let r=typeof t=="string"?{message:t}:t;return Ai.update(e,r)},info:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"info",duration:2500,...r})},warning:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"warning",duration:3e3,...r})},success:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"success",duration:2500,...r})},error:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"error",duration:3500,...r})}}},async promise(i,o){let e=Ai.loading(o.loading);try{let t=await(typeof i=="function"?i():i),r=S0(o.success,"Completed successfully",t);return(o.successStrategy??(o.closeOnSuccess?"close":"update"))==="close"?e.close():e.update({level:"success",duration:o.successDuration??2500,...r}),t}catch(t){let r=S0(o.error,t instanceof Error?t.message:"Something went wrong",t);throw(o.errorStrategy??(o.closeOnError?"close":"update"))==="close"?e.close():e.update({level:"error",duration:o.errorDuration??3500,...r}),t}},closeAll(i){if(Rl(),i){let o=io.get(i);if(!o?.isConnected){io.delete(i);return}o.clear();return}for(let[o,e]of io){if(!e?.isConnected){io.delete(o);continue}e.clear()}},info(i,o){return Hl("info",i,o)},success(i,o){return Hl("success",i,o)},warning(i,o){return Hl("warning",i,o)},error(i,o){return Hl("error",i,o)}};function yu(i,o){o.columns!=null&&(i.columns=o.columns),o.data!=null&&(i.data=o.data),o.dataSource!=null&&(i.dataSource=o.dataSource),o.source!=null&&(i.source=o.source),o.rowKey!=null&&(i.rowKey=o.rowKey),o.size!=null&&(i.size=o.size),o.selection!=null&&(i.selection=o.selection),o.selectedRowKeys!=null&&(i.selectedRowKeys=[...o.selectedRowKeys]),o.bordered!=null&&(i.bordered=o.bordered),o.border!=null&&(i.border=o.border),o.noBorder!=null&&(i.noBorder=o.noBorder),o.striped!=null&&(i.striped=o.striped),o.hoverable!=null&&(i.hoverable=o.hoverable),o.stickyHeader!=null&&(i.stickyHeader=o.stickyHeader),o.showHeader!=null&&(i.showHeader=o.showHeader),o.columnResizable!=null&&(i.columnResizable=o.columnResizable),o.columnReorderable!=null&&(i.columnReorderable=o.columnReorderable),o.loading!=null&&(i.loading=o.loading),o.virtual!=null&&(i.virtual=o.virtual),o.virtualHeight!=null&&(i.virtualHeight=o.virtualHeight),o.rowHeight!=null&&(i.rowHeight=o.rowHeight),o.overscan!=null&&(i.overscan=o.overscan),o.pagination!=null&&(i.pagination=o.pagination),o.current!=null&&(i.current=o.current),o.pageSize!=null&&(i.pageSize=o.pageSize),o.total!=null&&(i.total=o.total),o.showSizeChanger!=null&&(i.showSizeChanger=o.showSizeChanger),o.emptyText!=null&&(i.emptyText=o.emptyText),o.sortKey!=null&&(i.sortKey=o.sortKey),o.sortOrder!=null&&(i.sortOrder=o.sortOrder),o.rowClickable!=null&&(i.rowClickable=o.rowClickable),o.selectOnClick!=null&&(i.selectOnClick=o.selectOnClick),o.rowAnimation!=null&&(i.rowAnimation=o.rowAnimation),o.onRow!=null&&(i.onRow=o.onRow),o.onCell!=null&&(i.onCell=o.onCell),o.onHeaderRow!=null&&(i.onHeaderRow=o.onHeaderRow),o.onHeaderCell!=null&&(i.onHeaderCell=o.onHeaderCell)}function A0(i={}){let o=document.createElement("lui-table");oe(o,pt("table")),yu(o,i);let e=!1;return{el:o,get mounted(){return e&&o.isConnected},get visible(){return!o.hidden},mount(r){return r&&!o.isConnected&&(r.appendChild(o),e=!0),this},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.hidden=!1,this},hide(){return o.hidden=!0,this},update(r){return yu(o,r),this},destroy(){this.unmount()},setData(r){return o.dataSource=r,this},setColumns(r){return o.columns=r,this},getData(){return o.dataSource??o.source??o.data??[]},getColumns(){return o.columns??[]},setLoading(r){return o.loading=r,this},getSelectedRowKeys(){return[...o.selectedRowKeys??[]]},setSelectedRowKeys(r){return o.selectedRowKeys=[...r],this},setSelection(r,n=o.selectedRowKeys??[]){return o.selection=r,o.selectedRowKeys=[...n],this},setPagination(r){return yu(o,r),this}}}var nx={create:A0};export{q1 as BP,Xt as LuiAlert,Je as LuiAutocomplete,ut as LuiAvatar,At as LuiAvatarGroup,Ue as LuiBackground,Tt as LuiBadge,Ct as LuiBreadcrumb,Wt as LuiBreadcrumbItem,wt as LuiButton,He as LuiButtonGroup,gt as LuiButtonGroupItem,lr as LuiCalendar,vt as LuiCard,Ze as LuiCascader,_t as LuiCheckbox,Ut as LuiCheckboxGroup,Rr as LuiCol,Kr as LuiCollapse,kr as LuiCollapseItem,qe as LuiColorPicker,Ot as LuiCommandPalette,Ft as LuiConfigProvider,Ae as LuiContextMenu,Gr as LuiDateRangePicker,at as LuiDatepicker,xe as LuiDialog,ir as LuiDivider,Ke as LuiDrawer,bi as LuiDropdown,Me as LuiDropmenu,Qr as LuiEmptyState,Wr as LuiFileInput,xt as LuiForm,jt as LuiFormItem,Ee as LuiIcon,Ce as LuiIconPicker,Pe as LuiImage,nt as LuiImageCropper,$e as LuiInput,kt as LuiInputNumber,ar as LuiInputOpt,fo as LuiMenu,bn as LuiMenuDivider,St as LuiMenuItem,Po as LuiOption,Fi as LuiOptionGroup,_a as LuiOverlayRoot,Ie as LuiPagination,it as LuiPopconfirm,ee as LuiPopover,zt as LuiProgress,Bt as LuiQrcode,Gt as LuiRadio,sr as LuiRadioGroup,Co as LuiRow,yt as LuiScrollArea,me as LuiSelect,tr as LuiSkeleton,Xe as LuiSlider,Fr as LuiSpinner,Tr as LuiSplitter,dt as LuiStatistic,Ir as LuiSwitch,bt as LuiTab,qr as LuiTabPanel,U as LuiTable,qt as LuiTableColumn,ja as LuiTabs,jr as LuiTag,Ve as LuiText,Ye as LuiTextarea,Ht as LuiToast,vr as LuiTooltip,se as LuiTree,Qe as LuiTreeSelect,O as baseStyles,st as bringOverlayStackToFront,bc as builtinIconCollection,zs as builtinIconNames,pn as builtinIconPrefix,Tp as builtinTranslations,x5 as commandPalette,Y5 as contextMenu,su as createCommandPalette,Ol as createContextMenu,ts as createDialog,_0 as createDialogForm,lu as createDrawer,q5 as createForm,fu as createPopover,A0 as createTable,T0 as createToastHost,L5 as dialog,P5 as drawer,iu as encodeQr,Qt as ensureOverlayExternalLayer,zc as ensureOverlayLayer,Cc as ensureOverlayRoot,fn as eventPathContainsOwnedOverlay,W5 as form,Hx as formatDate,Ox as formatSize,Q3 as getLocale,Rs as hasRecentOverlayInteraction,z0 as hideAllContextMenus,yc as isImageIconSource,Is as isOverlayTopmost,Hs as markOverlayInteraction,ie as mergeTranslations,Yn as normalizeStatus,ye as onLocaleChange,ex as popover,Ak as registerFormField,Et as registerOverlayStack,Pp as registerTranslations,ya as resolveBuiltinIcon,Rf as resolveBuiltinTranslations,vn as resolveOverlayLayerRegistration,Ap as setLocale,pp as setOverlayOwner,Es as setupBuiltinIcons,C0 as showContextMenu,h4 as statusColorToken,CE as statusColorVar,ai as statusIcon,zE as statusOrder,J3 as t,nx as table,mt as toCssLength,Ai as toast,A as tokens,ne as translate,Pk as unregisterFormField,go as unregisterOverlayStack};
|
|
14897
|
+
`,document.head.appendChild(r)}return o}function N5(i){let o=typeof i=="string"?{message:i}:i,e=cu({title:o.title??Jn("dialog.loading_title","\u8BF7\u7A0D\u5019"),message:void 0,noClose:o.noClose??!0,closeOnOutsidePress:o.closeOnOutsidePress??!1,shakeOnOutsideClick:o.shakeOnOutsideClick,placement:o.placement,offset:o.offset,backdrop:o.backdrop,backdropStyle:o.backdropStyle,backdropContent:o.backdropContent,noHeader:o.noHeader,noFooter:o.noFooter,draggable:o.draggable,destroyOnClose:o.destroyOnClose,fullscreen:o.fullscreen,width:o.width,portal:o.portal,overlayLayer:o.overlayLayer,container:o.container}),t=D5(o.message??Jn("dialog.loading_message","\u5904\u7406\u4E2D..."));return e.appendChild(t),e.show(),{close:()=>du(e),update(r){let n=typeof r=="string"?{message:r}:r;n.title!=null&&(e.title=n.title,e.requestUpdate());let s=t.querySelector('[data-role="message"]');n.message!=null&&s&&(s.textContent=n.message)}}}function F5(){[...Al].forEach(i=>i.close?.())}var L5={create:ts,open:uu,alert:R5,confirm:I5,prompt:V5,loading:N5,closeAll:F5};function x0(i,o){let e=ho();return ne(ie(e.locale,e.translations),i,o)}function w0(i,o="default"){let e=document.createElement("lui-button");return oe(e,pt("button")),e.slot="footer",e.variant=o,e.textContent=i,e}function pu(i){return{...i,source:i.source?[...i.source]:void 0,fields:i.fields?i.fields.map(pu):void 0,condition:i.condition?{...i.condition}:void 0}}function B5(i){return{...i,fields:i.fields.map(pu)}}function jl(i,o){return{...i,fields:i.fields?i.fields.map(pu):void 0,steps:i.steps?i.steps.map(B5):void 0,defaultValues:i.defaultValues?{...i.defaultValues}:void 0,onSubmit:o??i.onSubmit}}function mu(i){let o="schema"in i?i.schema:i,e=document.createElement("lui-form");oe(e,pt("form")),e.schema=jl(o);let t=!1;return{el:e,get mounted(){return t&&e.isConnected},get visible(){return!e.hidden},mount(n){return n&&!e.isConnected&&(n.appendChild(e),t=!0),this},unmount(){return e.isConnected&&e.remove(),t=!1,this},show(){return e.hidden=!1,this},hide(){return e.hidden=!0,this},update(n){let s=e.schema??jl(o);return e.schema=jl({...s,...n,onSubmit:n.onSubmit??s.onSubmit}),this},destroy(){this.unmount()},submit(){return Promise.resolve(e.submit())},validate(){return e.validate()},reset(n){e.reset(n)},getValues(){return e.getValues()},setValues(n){e.setValues(n)},getValue(n){return e.getValue(n)},setValue(n,s){e.setValue(n,s)},focusField(n){return e.focusField(n)},scrollToField(n){return e.scrollToField(n)}}}var q5=mu;function _0(i){let o=i.schema.onSubmit,e=jl(i.schema,async x=>{await o?.(x),h(x)}),t=mu(e),r,n=!1,s=new Promise(x=>{r=x}),d=ts({...i,content:t.el,showCancel:!1}),h=x=>{n||(n=!0,r(x),d.destroy())},p=!!e.steps?.length;if(t.el.showActions=p,!p){let x=w0(i.cancelText??e.cancelLabel??x0("common.cancel","\u53D6\u6D88")),k=w0(i.submitText??e.submitLabel??x0("common.submit","\u63D0\u4EA4"),"primary");x.addEventListener("click",()=>h(null),{once:!0}),k.addEventListener("click",()=>t.submit(),{once:!1}),d.el.append(x,k)}return d.el.addEventListener("close",x=>{x.target===d.el&&h(null)}),{el:d.el,form:t,submit(){return t.submit()},validate(){return t.validate()},reset(x){t.reset(x)},getValues(){return t.getValues()},setValues(x){t.setValues(x)},getValue(x){return t.getValue(x)},setValue(x,k){t.setValue(x,k)},focusField(x){return t.focusField(x)},scrollToField(x){return t.scrollToField(x)},get mounted(){return d.mounted},get visible(){return d.visible},get closed(){return s},mount(x){return d.mount(x),this},unmount(){return d.unmount(),this},show(){return d.show(),this},hide(){return d.hide(),this},close(x){h(x??null)},update(x){return d.update(x),this},destroy(){d.destroy()}}}function hu(i){let o=_0(i);return o.show(),o}function K5(i){return"onSubmit"in i?hu({schema:i}):hu(i)}var W5={create:mu,open:hu,prompt:K5};function U5(){let i=document.createElement("lui-context-menu");return oe(i,pt("contextMenu")),i.trigger="manual",i}function gu(i,o){i.heading=o.heading??"",i.headingIcon=o.headingIcon??"",i.placement=o.placement??"bottom-start","items"in o&&o.items!==void 0&&(i.items=o.items),i.closeOnSelect=o.closeOnSelect??!0,i.closeOnOutsidePress=o.closeOnOutsidePress??!0,i.closeOnEscape=o.closeOnEscape??!0,i.submenuTrigger=o.submenuTrigger??"hover",i.backdrop=o.backdrop??"none",i.backdropStyle=o.backdropStyle??""}function Ol(i={}){let o=U5(),e=null,t=!1,r=s=>{e&&(o.removeEventListener("select",e),e=null),s&&(e=d=>{s(d.detail)},o.addEventListener("select",e))},n={el:o,get mounted(){return t&&o.isConnected},get visible(){return o.open},mount(s){if(o.isConnected)return this;let d=Qt("menu",s??i.container??Go()??Uo());return d.appendChild(o),Et(o,d,"menu"),t=!0,this},unmount(){return o.isConnected&&o.remove(),t=!1,this},show(s){o.isConnected||this.mount();let d={...i,...s};gu(o,d),st(o),r(d.onSelect),o.showAt(d.x,d.y,{items:d.items,context:d.context,triggerEvent:d.triggerEvent,source:d.source??"api"})},hide(){return o.hide(),this},update(s){return Object.assign(i,s),gu(o,{x:0,y:0,...i}),this},destroy(){r(void 0),o.hide(),this.unmount()}};return(i.items||i.heading||i.headingIcon||i.placement)&&gu(o,{x:0,y:0,...i}),n}var an=null,M0=new WeakMap;function C0(i){if(i.container){let o=M0.get(i.container);return(!o||!o.el.isConnected)&&(o=Ol({container:i.container}),M0.set(i.container,o)),o.show(i),o}return(!an||!an.el.isConnected)&&(an=Ol()),an.show(i),an}function z0(){document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.()})}function G5(){an?.destroy(),an=null,document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.(),i.remove()})}var Y5={create:Ol,show:C0,hideAll:z0,destroyAll:G5};function rs(i,o,e){if(e==null)return;let t=typeof e=="function"?e():e;if(typeof t=="string"){let n=document.createElement("div");n.slot=o,n.textContent=t,i.appendChild(n);return}if(t instanceof DocumentFragment){let n=document.createElement("div");n.slot=o,n.appendChild(t),i.appendChild(n);return}if(t instanceof HTMLElement||t instanceof SVGElement){t.setAttribute("slot",o),i.appendChild(t);return}let r=document.createElement("div");r.slot=o,r.appendChild(t),i.appendChild(r)}function X5(i){let o=document.createElement("lui-popover");return oe(o,pt("popover")),i.trigger!=null&&(o.trigger=i.trigger),i.placement!=null&&(o.placement=i.placement),i.disabled!=null&&(o.disabled=i.disabled),i.interactive!=null&&(o.interactive=i.interactive),i.showArrow!=null&&(o.showArrow=i.showArrow),i.closeOnOutsidePress!=null&&(o.closeOnOutsidePress=i.closeOnOutsidePress),i.closeOnEsc!=null&&(o.closeOnEsc=i.closeOnEsc),i.openDelay!=null&&(o.openDelay=i.openDelay),i.closeDelay!=null&&(o.closeDelay=i.closeDelay),i.offsetDistance!=null&&(o.offsetDistance=i.offsetDistance),i.autoFlip!=null&&(o.autoFlip=i.autoFlip),i.autoShift!=null&&(o.autoShift=i.autoShift),i.sameWidth!=null&&(o.sameWidth=i.sameWidth),i.maxWidth!=null&&(o.maxWidth=i.maxWidth),i.maxHeight!=null&&(o.maxHeight=i.maxHeight),i.backdrop!=null&&(o.backdrop=i.backdrop),i.backdropStyle!=null&&(o.backdropStyle=i.backdropStyle),i.portal!=null&&(o.portal=i.portal),i.overlayLayer!=null&&(o.overlayLayer=i.overlayLayer),i.container!=null&&(o.container=i.container),rs(o,"trigger",i.triggerContent),rs(o,"header",i.header),rs(o,"content",i.content),rs(o,"footer",i.footer),rs(o,"backdrop",i.backdropContent),o}function fu(i={}){let o=X5(i),e=!1,t=!1,r,n=new Promise(h=>{r=h}),s=()=>{t||(t=!0,r({action:"close"}))};return o.addEventListener("close",h=>{h.target===o&&s()}),{el:o,get mounted(){return e&&o.isConnected},get visible(){return o.open},get closed(){return n},mount(h){return o.isConnected?this:((h??document.body).appendChild(o),e=!0,this)},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.isConnected||this.mount(),o.portal&&o._portalHost&&st(o._portalHost),o.show(),this},hide(){return o.hide(),this},close(){o.hide(),s()},update(h){return Object.assign(o,h),this},destroy(){t||s(),this.unmount()}}}function Z5(i={}){let o=fu({...i,trigger:"manual"});return o.show(),o}function Q5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.()})}function J5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.(),i.remove()})}var ex={create:fu,open:Z5,closeAll:Q5,destroyAll:J5};var io=new Map;function tx(){return Qt("toast",Go()??Uo())}function $0(i){let o=pt("toast"),e=typeof o.position=="string"?o.position:void 0;return i??e??"top-right"}function vu(i){let o=ho();i.locale=o.locale,i.translations=o.translations,oe(i,pt("toast"))}function Rl(){for(let[i,o]of io)o?.isConnected||io.delete(i)}function rx(i){let o=io.get(i);o&&(io.delete(i),o.isConnected&&o.remove())}function ox(i,o,e,t,r,n){Rl();let s=$0(i),d=io.get(s);if(d?.isConnected)return vu(d),st(d),d.position=s,typeof o=="number"&&(d.max=o),typeof e=="string"&&(d.radius=e),typeof t=="boolean"&&(d.stacked=t),typeof r=="number"&&(d.stackMaxVisible=r),typeof n=="number"&&(d.stackGap=n),d;let h=document.createElement("lui-toast");h.listen=!1,vu(h),h.position=s,typeof o=="number"&&(h.max=o),typeof e=="string"&&(h.radius=e),typeof t=="boolean"&&(h.stacked=t),typeof r=="number"&&(h.stackMaxVisible=r),typeof n=="number"&&(h.stackGap=n),h.addEventListener("empty",()=>rx(s));let p=tx();return p.appendChild(h),Et(h,p,"toast"),io.set(s,h),h}function T0(i={}){let o=!1,e=null,t=r=>{if(e?.isConnected)return e;let n=$0(i.position);e=document.createElement("lui-toast"),e.listen=!1,vu(e),e.position=n,typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap);let s=Qt("toast",r??Go()??Uo());return s.appendChild(e),Et(e,s,"toast"),o=!0,e};return{get el(){return t()},get mounted(){return o&&!!e?.isConnected},get visible(){return!!e?.isConnected},mount(r){return t(r),this},unmount(){return e?.isConnected&&e.remove(),o=!1,this},show(r){let n=typeof r=="string"?{message:r}:r;return t().show({level:n.level??i.level,message:n.message,duration:n.duration??i.duration,radius:n.radius??i.radius,pauseOnHover:n.pauseOnHover??i.pauseOnHover,showProgress:n.showProgress??i.showProgress,action:n.action,delay:n.delay,stacked:n.stacked??i.stacked,stackMaxVisible:n.stackMaxVisible??i.stackMaxVisible,stackGap:n.stackGap??i.stackGap})},hide(){return e?.clear(),this},update(r){return Object.assign(i,r),e&&(typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap)),this},destroy(){this.unmount()},close(r){return e?e.close(r):!1},updateToast(r,n){if(!e)return!1;let s=typeof n=="string"?{message:n}:n;return e.updateToast(r,s)},clear(){e?.clear()}}}function ix(){Rl();for(let i of io.values())i.clear()}function bu(i){let o=typeof i=="string"?{message:i}:i;return ox(o.position,o.max,o.radius,o.stacked,o.stackMaxVisible,o.stackGap).show({level:o.level,message:o.message,duration:o.duration,radius:o.radius,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap})}function E0(i){Rl();for(let o of io.values())if(o.has(i))return o;return null}function Hl(i,o,e){let t=typeof o=="string"?{message:o,duration:e}:o;return bu({...t,level:i,duration:t.duration??e})}function S0(i,o,e){return i==null?{message:o}:typeof i=="string"?{message:i}:typeof i=="function"?{message:i(e)}:i}var Ai={create:T0,show:bu,clearAll:ix,close(i){let o=E0(i);return o?o.close(i):!1},update(i,o){let e=E0(i);if(!e)return!1;let t=typeof o=="string"?{message:o}:o;return e.updateToast(i,t)},loading(i){let o=typeof i=="string"?{message:i}:i,e=bu({level:o.level??"info",message:o.message,duration:0,position:o.position,max:o.max,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress??!1,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap});return{id:e,close:()=>Ai.close(e),update:t=>{let r=typeof t=="string"?{message:t}:t;return Ai.update(e,r)},info:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"info",duration:2500,...r})},warning:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"warning",duration:3e3,...r})},success:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"success",duration:2500,...r})},error:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"error",duration:3500,...r})}}},async promise(i,o){let e=Ai.loading(o.loading);try{let t=await(typeof i=="function"?i():i),r=S0(o.success,"Completed successfully",t);return(o.successStrategy??(o.closeOnSuccess?"close":"update"))==="close"?e.close():e.update({level:"success",duration:o.successDuration??2500,...r}),t}catch(t){let r=S0(o.error,t instanceof Error?t.message:"Something went wrong",t);throw(o.errorStrategy??(o.closeOnError?"close":"update"))==="close"?e.close():e.update({level:"error",duration:o.errorDuration??3500,...r}),t}},closeAll(i){if(Rl(),i){let o=io.get(i);if(!o?.isConnected){io.delete(i);return}o.clear();return}for(let[o,e]of io){if(!e?.isConnected){io.delete(o);continue}e.clear()}},info(i,o){return Hl("info",i,o)},success(i,o){return Hl("success",i,o)},warning(i,o){return Hl("warning",i,o)},error(i,o){return Hl("error",i,o)}};function yu(i,o){o.columns!=null&&(i.columns=o.columns),o.data!=null&&(i.data=o.data),o.dataSource!=null&&(i.dataSource=o.dataSource),o.source!=null&&(i.source=o.source),o.rowKey!=null&&(i.rowKey=o.rowKey),o.size!=null&&(i.size=o.size),o.selection!=null&&(i.selection=o.selection),o.selectedRowKeys!=null&&(i.selectedRowKeys=[...o.selectedRowKeys]),o.bordered!=null&&(i.bordered=o.bordered),o.border!=null&&(i.border=o.border),o.noBorder!=null&&(i.noBorder=o.noBorder),o.striped!=null&&(i.striped=o.striped),o.hoverable!=null&&(i.hoverable=o.hoverable),o.stickyHeader!=null&&(i.stickyHeader=o.stickyHeader),o.showHeader!=null&&(i.showHeader=o.showHeader),o.columnResizable!=null&&(i.columnResizable=o.columnResizable),o.columnReorderable!=null&&(i.columnReorderable=o.columnReorderable),o.loading!=null&&(i.loading=o.loading),o.virtual!=null&&(i.virtual=o.virtual),o.virtualHeight!=null&&(i.virtualHeight=o.virtualHeight),o.rowHeight!=null&&(i.rowHeight=o.rowHeight),o.overscan!=null&&(i.overscan=o.overscan),o.pagination!=null&&(i.pagination=o.pagination),o.current!=null&&(i.current=o.current),o.pageSize!=null&&(i.pageSize=o.pageSize),o.total!=null&&(i.total=o.total),o.showSizeChanger!=null&&(i.showSizeChanger=o.showSizeChanger),o.emptyText!=null&&(i.emptyText=o.emptyText),o.sortKey!=null&&(i.sortKey=o.sortKey),o.sortOrder!=null&&(i.sortOrder=o.sortOrder),o.rowClickable!=null&&(i.rowClickable=o.rowClickable),o.selectOnClick!=null&&(i.selectOnClick=o.selectOnClick),o.rowAnimation!=null&&(i.rowAnimation=o.rowAnimation),o.onRow!=null&&(i.onRow=o.onRow),o.onCell!=null&&(i.onCell=o.onCell),o.onHeaderRow!=null&&(i.onHeaderRow=o.onHeaderRow),o.onHeaderCell!=null&&(i.onHeaderCell=o.onHeaderCell)}function A0(i={}){let o=document.createElement("lui-table");oe(o,pt("table")),yu(o,i);let e=!1;return{el:o,get mounted(){return e&&o.isConnected},get visible(){return!o.hidden},mount(r){return r&&!o.isConnected&&(r.appendChild(o),e=!0),this},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.hidden=!1,this},hide(){return o.hidden=!0,this},update(r){return yu(o,r),this},destroy(){this.unmount()},setData(r){return o.dataSource=r,this},setColumns(r){return o.columns=r,this},getData(){return o.dataSource??o.source??o.data??[]},getColumns(){return o.columns??[]},setLoading(r){return o.loading=r,this},getSelectedRowKeys(){return[...o.selectedRowKeys??[]]},setSelectedRowKeys(r){return o.selectedRowKeys=[...r],this},setSelection(r,n=o.selectedRowKeys??[]){return o.selection=r,o.selectedRowKeys=[...n],this},setPagination(r){return yu(o,r),this}}}var nx={create:A0};export{q1 as BP,Xt as LuiAlert,Je as LuiAutocomplete,ut as LuiAvatar,At as LuiAvatarGroup,Ue as LuiBackground,Tt as LuiBadge,Ct as LuiBreadcrumb,Wt as LuiBreadcrumbItem,xt as LuiButton,Re as LuiButtonGroup,wt as LuiButtonGroupItem,lr as LuiCalendar,ft as LuiCard,Ze as LuiCascader,_t as LuiCheckbox,Ut as LuiCheckboxGroup,Rr as LuiCol,Kr as LuiCollapse,yr as LuiCollapseItem,qe as LuiColorPicker,Ot as LuiCommandPalette,Nt as LuiConfigProvider,Ae as LuiContextMenu,Gr as LuiDateRangePicker,at as LuiDatepicker,xe as LuiDialog,ir as LuiDivider,Ke as LuiDrawer,bi as LuiDropdown,Me as LuiDropmenu,Qr as LuiEmptyState,Wr as LuiFileInput,kt as LuiForm,jt as LuiFormItem,Ee as LuiIcon,Ce as LuiIconPicker,Pe as LuiImage,nt as LuiImageCropper,$e as LuiInput,yt as LuiInputNumber,ar as LuiInputOpt,fo as LuiMenu,bn as LuiMenuDivider,St as LuiMenuItem,Po as LuiOption,Fi as LuiOptionGroup,_a as LuiOverlayRoot,Ie as LuiPagination,it as LuiPopconfirm,ee as LuiPopover,zt as LuiProgress,Lt as LuiQrcode,Gt as LuiRadio,sr as LuiRadioGroup,Co as LuiRow,bt as LuiScrollArea,me as LuiSelect,tr as LuiSkeleton,Xe as LuiSlider,Fr as LuiSpinner,$r as LuiSplitter,dt as LuiStatistic,Ir as LuiSwitch,vt as LuiTab,qr as LuiTabPanel,U as LuiTable,qt as LuiTableColumn,ja as LuiTabs,jr as LuiTag,Ve as LuiText,Ye as LuiTextarea,Ht as LuiToast,fr as LuiTooltip,se as LuiTree,Qe as LuiTreeSelect,O as baseStyles,st as bringOverlayStackToFront,bc as builtinIconCollection,zs as builtinIconNames,pn as builtinIconPrefix,Tp as builtinTranslations,x5 as commandPalette,Y5 as contextMenu,su as createCommandPalette,Ol as createContextMenu,ts as createDialog,_0 as createDialogForm,lu as createDrawer,q5 as createForm,fu as createPopover,A0 as createTable,T0 as createToastHost,L5 as dialog,P5 as drawer,iu as encodeQr,Qt as ensureOverlayExternalLayer,zc as ensureOverlayLayer,Cc as ensureOverlayRoot,fn as eventPathContainsOwnedOverlay,W5 as form,Hx as formatDate,Ox as formatSize,Q3 as getLocale,Rs as hasRecentOverlayInteraction,z0 as hideAllContextMenus,yc as isImageIconSource,Is as isOverlayTopmost,Hs as markOverlayInteraction,ie as mergeTranslations,Yn as normalizeStatus,ye as onLocaleChange,ex as popover,Ak as registerFormField,Et as registerOverlayStack,Pp as registerTranslations,ya as resolveBuiltinIcon,Rf as resolveBuiltinTranslations,vn as resolveOverlayLayerRegistration,Ap as setLocale,pp as setOverlayOwner,Es as setupBuiltinIcons,C0 as showContextMenu,h4 as statusColorToken,CE as statusColorVar,ai as statusIcon,zE as statusOrder,J3 as t,nx as table,mt as toCssLength,Ai as toast,A as tokens,ne as translate,Pk as unregisterFormField,go as unregisterOverlayStack};
|
|
14868
14898
|
/*! Bundled license information:
|
|
14869
14899
|
|
|
14870
14900
|
@lit-labs/virtualizer/layouts/shared/SizeCache.js:
|