@origen-ui/tabs 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Origen UI contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,92 @@
1
+ # @origen-ui/tabs
2
+
3
+ `OgTabs` is a strictly controlled Vue 3 and Element Plus workspace tab component.
4
+ It never creates, reorders, removes, stores, or navigates tabs itself. Every change is emitted as a request; the consuming application decides whether to update `items` and `modelValue`.
5
+
6
+ ```vue
7
+ <script setup lang="ts">
8
+ import type { OgTabItem } from '@origen-ui/tabs'
9
+ import { OgTabs } from '@origen-ui/tabs'
10
+ import { ref } from 'vue'
11
+ import '@origen-ui/tabs/style.css'
12
+
13
+ const active = ref('overview')
14
+ const tabs = ref<OgTabItem[]>([
15
+ { key: 'overview', label: 'Overview', pinned: true },
16
+ { key: 'reports', label: 'Reports', badge: 3, dirty: true },
17
+ ])
18
+ </script>
19
+
20
+ <template>
21
+ <OgTabs
22
+ v-model="active"
23
+ v-model:items="tabs"
24
+ variant="workspace"
25
+ :features="{ pin: true, finder: true }"
26
+ :context-menu="{ hiddenActions: ['close-all'] }"
27
+ @refresh-request="({ tab }) => reload(tab)"
28
+ >
29
+ <template #default="{ tab }">{{ tab.label }} panel</template>
30
+ </OgTabs>
31
+ </template>
32
+ ```
33
+
34
+ ## Controlled contract
35
+
36
+ - `items` is required. `defaultItems`, `defaultActiveKey`, `maxTabs`, `actions`, `add`, `remove`, and internal state are removed.
37
+ - `update:modelValue` and `update:items` carry proposed values only. Leaving props unchanged leaves the UI unchanged.
38
+ - `action-request` is emitted for every accepted operation. Semantic events include `close-request`, `refresh-request`, `pin-change-request`, and `reorder-request`.
39
+ - OgTabs has one navigation implementation: Element Plus `ElTabs` and `ElTabPane`. Closing, pinning, refreshing, dragging, finder, and keyboard actions are configured through `features`; `contextMenu` is the single menu configuration entry.
40
+ - `actionPolicy` uses `{ mode: 'allow' | 'deny', actions }`. It preserves both former whitelist and blacklist outcomes without allowing both policies to create an implicit precedence rule.
41
+ - `dirty` communicates unsaved work in both the tab label and finder. It is presentation state; applications decide whether `beforeAction` permits closing it.
42
+ - The finder is an auxiliary navigator for the same native tab strip. It appears when the strip overflows or reaches `finderThreshold` (default `8`).
43
+ - Use `density="compact"` for dense operational screens, and the default density for general workspaces.
44
+ - The component defaults to Chinese action, finder, status, and accessibility labels. Pass `locale` to override individual entries for another language.
45
+ - The component has no router, store, cache, persistence, or business dependency.
46
+
47
+ ## Styles
48
+
49
+ Import `@origen-ui/tabs/style.css` once in the application entry point. The
50
+ stylesheet is intentionally unscoped so it can style Element Plus descendants;
51
+ all selectors are rooted in the `og-tabs` namespace to limit collisions.
52
+
53
+ ## Application Defaults
54
+
55
+ Install `createOgTabs()` once to supply presentation and feature defaults to every tab surface in one Vue app:
56
+
57
+ ```ts
58
+ import { createOgTabs } from '@origen-ui/tabs'
59
+
60
+ app.use(
61
+ createOgTabs({
62
+ variant: 'workspace',
63
+ density: 'compact',
64
+ features: { finder: true, keyboard: true },
65
+ finderThreshold: 12,
66
+ contextMenu: { hiddenActions: ['close-all'] },
67
+ }),
68
+ )
69
+ ```
70
+
71
+ Built-in values are resolved before app defaults and instance props. `locale`, `features`, `contextMenu`, and `tabsProps` are shallow-merged; arrays and callbacks are atomic. `items`, `modelValue`, `busy`, action policies, and action callbacks remain controlled by each component instance, and separate Vue apps do not share configuration.
72
+
73
+ `tabsProps` is the typed Element Plus Tabs escape hatch for native presentation
74
+ options outside OgTabs-owned state. OgTabs applies `modelValue` and navigation
75
+ guards last. `getNativeTabs()` returns the mounted Element Plus Tabs instance.
76
+
77
+ ## Migration
78
+
79
+ This release is breaking. Replace uncontrolled defaults with `ref` values and own the updates in the parent. Replace `add()` with a parent-side array update. Move former custom actions into the `header` or `extra` slots. Replace `beforeClose`, `beforePin`, and other operation-specific guards with `beforeAction`. Use `action-request` or semantic request events instead of `remove`, `pinChange`, `reorder`, and `limitExceeded`. Locking, favorites, grouping, synchronization, middle/double-click actions, custom shortcuts, virtual navigation, and custom overflow handling are removed.
80
+
81
+ <!-- component-contract:start -->
82
+
83
+ ## 公共契约
84
+
85
+ > 由 `components.v2.json` 自动生成。请先修改公开的 TypeScript 契约,然后运行 `pnpm component-contracts:sync` 同步。
86
+
87
+ - 标准导入:`import { OgTabs } from '@origen-ui/tabs'`
88
+ - 核心 props:`items`, `contextMenu`, `actionPolicy`
89
+ - 事件:`update:modelValue`
90
+ - 暴露的方法:`getNativeTabs`
91
+
92
+ <!-- component-contract:end -->
@@ -0,0 +1,16 @@
1
+ import { inject as i } from "vue";
2
+ const o = Symbol("OgTabsGlobalConfig");
3
+ function e(n = {}) {
4
+ return {
5
+ install(a) {
6
+ a.provide(o, n);
7
+ }
8
+ };
9
+ }
10
+ function l() {
11
+ return i(o, void 0);
12
+ }
13
+ export {
14
+ e as c,
15
+ l as u
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("vue"),o=Symbol("OgTabsGlobalConfig");function s(e={}){return{install(n){n.provide(o,e)}}}function i(){return a.inject(o,void 0)}exports.createOgTabs=s;exports.useOgTabsGlobalConfig=i;
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Mt=require("./config-DbOzZnZx.cjs"),ut=require("./locale.cjs"),r=require("vue"),K=require("@element-plus/icons-vue"),Ln=require("@origen-ui/shared"),ue=require("element-plus"),Vn={key:0,class:"og-tabs-context-menu__divider",role:"separator"},Wn=["disabled","onClick"],Hn=r.defineComponent({__name:"OgTabsContextMenu",props:{visible:{type:Boolean},x:{},y:{},items:{}},emits:["select","close","reposition"],setup(e,{emit:t}){const o=e,n=t,i=r.useTemplateRef("menu");function a(){n("close")}function s(){return[...i.value?.querySelectorAll('[role="menuitem"]:not(:disabled)')??[]]}function l(){const h=i.value;if(!h)return;const m=h.getBoundingClientRect();n("reposition",Math.max(4,Math.min(o.x,window.innerWidth-m.width-4)),Math.max(4,Math.min(o.y,window.innerHeight-m.height-4))),s()[0]?.focus()}function c(h){i.value?.contains(h.target)||a()}function f(h){const m=s(),d=m.indexOf(document.activeElement);if(h.key==="Escape"){h.preventDefault(),a();return}if(!m.length||!["ArrowDown","ArrowUp","Home","End"].includes(h.key))return;h.preventDefault();const p=h.key==="Home"?0:h.key==="End"?m.length-1:(d+(h.key==="ArrowDown"?1:-1)+m.length)%m.length;m[p]?.focus()}return r.watch(()=>o.visible,h=>{h&&r.nextTick(l)}),r.onMounted(()=>window.addEventListener("pointerdown",c)),r.onBeforeUnmount(()=>window.removeEventListener("pointerdown",c)),(h,m)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[e.visible?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menu",ref:i,class:"og-tabs-context-menu",style:r.normalizeStyle({left:`${e.x}px`,top:`${e.y}px`}),role:"menu",onContextmenu:m[0]||(m[0]=r.withModifiers(()=>{},["prevent"])),onKeydown:f},[r.renderSlot(h.$slots,"top",{},void 0,!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.items,d=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:d.operation},[d.dividerBefore?(r.openBlock(),r.createElementBlock("div",Vn)):r.createCommentVNode("",!0),r.createElementVNode("button",{type:"button",role:"menuitem",disabled:d.disabled,onClick:r.withModifiers(p=>h.$emit("select",d.operation),["stop"])},[d.icon?(r.openBlock(),r.createBlock(r.unref(ue.ElIcon),{key:0,"aria-hidden":"true"},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.icon)))]),_:2},1024)):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(d.label),1)],8,Wn)],64))),128)),r.renderSlot(h.$slots,"bottom",{},void 0,!0)],36)):r.createCommentVNode("",!0)]))}}),Rt=(e,t)=>{const o=e.__vccOpts||e;for(const[n,i]of t)o[n]=i;return o},Xn=Rt(Hn,[["__scopeId","data-v-49db788b"]]);function L(e,t){return e.find(o=>o.key===t)}function ae(e){return[...e.filter(t=>t.pinned),...e.filter(t=>!t.pinned)]}function on(e,t){const o=t?.trim().toLocaleLowerCase();return ae(o?e.filter(n=>n.label.toLocaleLowerCase().includes(o)):e)}function Ce(e){return!!(e&&!e.disabled&&!e.readonly&&!e.pinned&&e.closable!==!1)}function Ft(e){return!!(e&&!e.disabled&&!e.readonly&&e.pinnable!==!1)}function Be(e){return!!(e&&!e.disabled&&!e.readonly&&!e.pinned&&e.draggable!==!1)}function rn(e,t,o){const n=L(e,t);if(!n||n.pinned===o)return[...e];const i=ae(e.filter(l=>l.key!==t)),a={...n,pinned:o},s=o?i.filter(l=>l.pinned).length:i.findIndex(l=>!l.pinned);return i.splice(s<0?i.length:s,0,a),i}function kt(e,t){return e.filter(o=>!t.has(o.key))}function $t(e,t,o){if(o==="all")return e.filter(Ce);const n=e.findIndex(i=>i.key===t);if(n<0)return[];if(o==="current"){const i=e[n];return i&&Ce(i)?[i]:[]}return o==="others"?e.filter(i=>i.key!==t&&Ce(i)):(o==="left"?e.slice(0,n):e.slice(n+1)).filter(Ce)}function Pe(e,t,o){const n=e.findIndex(s=>s.key===o),i=s=>s!==void 0&&t.some(l=>l.key===s&&!l.disabled);for(let s=n+1;s<e.length;s+=1){const l=e[s];if(l&&i(l.key))return l.key}for(let s=n-1;s>=0;s-=1){const l=e[s];if(l&&i(l.key))return l.key}const a=t.find(s=>!s.disabled);if(a)return a.key}function Ct(e,t,o){const n=ae(e),i=L(n,t),a=L(n,o);if(!i||!a||i.key===a.key||!Be(i)||!Be(a))return[...e];const s=n.filter(l=>l.key!==t);return s.splice(s.findIndex(l=>l.key===o),0,i),s}function xt(e,t,o){const n=ae(e),i=L(n,t);if(!i||!Be(i))return[...e];const a=n.filter(c=>c.key!==t),s=a.findIndex(c=>!c.pinned),l=o==="top"?s:a.length;return a.splice(l<0?a.length:l,0,i),a}function It(e){return e==="current"?"close":`close-${e}`}function an(e){const t=new Set;return e.some(o=>t.has(o.key)?!0:(t.add(o.key),!1))}const Yn=["aria-label"],qn={class:"og-tabs-finder__content"},zn=["aria-expanded","aria-controls","aria-activedescendant","placeholder"],Gn=["id","aria-label"],jn=["id","aria-selected","disabled","onClick"],Kn={class:"og-tabs-finder__label"},Un={class:"og-tabs-finder__title"},Zn=["aria-label"],Qn=r.defineComponent({__name:"OgTabsFinder",props:{tabs:{},activeKey:{},locale:{}},emits:["activate"],setup(e,{emit:t}){const o=e,n=t,i=r.shallowRef(!1),a=r.shallowRef(""),s=r.shallowRef(-1),l=r.useId(),c=r.useId(),f=r.useTemplateRef("input"),h=r.computed(()=>on(o.tabs,a.value)),m=r.computed(()=>h.value.filter(S=>!S.disabled)),d=r.computed(()=>m.value[s.value]),p=r.computed(()=>h.value.length>0);function v(S){return`og-tabs-finder-option-${c}-${typeof S.key}-${String(S.key)}`}function b(S){const _=m.value.length;_&&(s.value=(s.value+S+_)%_)}function k(S){switch(S.key){case"ArrowDown":S.preventDefault(),b(1);break;case"ArrowUp":S.preventDefault(),b(-1);break;case"Home":S.preventDefault(),s.value=0;break;case"End":S.preventDefault(),s.value=m.value.length-1;break;case"Enter":d.value&&(S.preventDefault(),x(d.value.key));break}}function x(S){i.value=!1,n("activate",S)}function A(){f.value?.focus()}return r.watch(i,S=>{S&&(a.value="",s.value=-1,r.nextTick(()=>{A(),window.setTimeout(A,260)}))},{flush:"sync"}),r.watch(h,()=>{s.value>=m.value.length&&(s.value=m.value.length-1)},{flush:"sync"}),(S,_)=>(r.openBlock(),r.createBlock(r.unref(ue.ElPopover),{visible:i.value,"onUpdate:visible":_[1]||(_[1]=O=>i.value=O),trigger:"click",placement:"bottom-end",width:320,"popper-class":"og-tabs-finder",onAfterEnter:A},{reference:r.withCtx(()=>[r.createElementVNode("button",{type:"button",class:"og-tabs__action","aria-label":e.locale.findTabs},[r.createVNode(r.unref(ue.ElIcon),{"aria-hidden":"true"},{default:r.withCtx(()=>[r.createVNode(r.unref(K.Search))]),_:1})],8,Yn)]),default:r.withCtx(()=>[r.createElementVNode("div",qn,[r.withDirectives(r.createElementVNode("input",{ref_key:"input",ref:f,"onUpdate:modelValue":_[0]||(_[0]=O=>a.value=O),class:"og-tabs-finder__input",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":i.value,"aria-controls":p.value?r.unref(l):void 0,"aria-activedescendant":d.value?v(d.value):void 0,placeholder:e.locale.findTabsPlaceholder,onKeydown:k},null,40,zn),[[r.vModelText,a.value]]),p.value?(r.openBlock(),r.createElementBlock("div",{key:0,id:r.unref(l),class:"og-tabs-finder__list",role:"listbox","aria-label":e.locale.findTabs},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,O=>(r.openBlock(),r.createElementBlock("button",{id:v(O),key:`${typeof O.key}:${String(O.key)}`,type:"button",role:"option","aria-selected":O.key===e.activeKey,class:r.normalizeClass({"is-active":O.key===d.value?.key}),disabled:O.disabled,onClick:q=>x(O.key)},[r.createElementVNode("span",Kn,[r.createElementVNode("span",Un,r.toDisplayString(O.label),1),O.dirty?(r.openBlock(),r.createElementBlock("span",{key:0,class:"og-tabs-finder__dirty","aria-label":e.locale.unsaved},null,8,Zn)):r.createCommentVNode("",!0)])],10,jn))),128))],8,Gn)):(r.openBlock(),r.createBlock(r.unref(ue.ElEmpty),{key:1,description:e.locale.noResults,"image-size":56},null,8,["description"]))])]),_:1},8,["visible"]))}}),Jn=Rt(Qn,[["__scopeId","data-v-884c1955"]]);function Y(e){return`${typeof e=="number"?"n":"s"}:${encodeURIComponent(String(e))}`}const eo=["data-tab-key","data-tab-id","title"],to={class:"og-tabs-label__text"},no=["aria-label"],oo={class:"og-tabs-sr-only"},ro=["aria-label"],io={key:3,class:"og-tabs-label__badge"},ao=r.defineComponent({__name:"OgTabsLabel",props:{tab:{},active:{type:Boolean},minWidth:{},maxWidth:{},locale:{}},setup(e){return(t,o)=>(r.openBlock(),r.createElementBlock("span",{class:"og-tabs-label","data-tab-key":String(e.tab.key),"data-tab-id":r.unref(Y)(e.tab.key),style:r.normalizeStyle({minWidth:e.minWidth,maxWidth:e.maxWidth}),title:e.tab.remark?`${e.tab.label}
2
+ ${e.tab.remark}`:e.tab.label},[r.renderSlot(t.$slots,"before",{tab:e.tab},void 0,!0),e.tab.icon?(r.openBlock(),r.createBlock(r.unref(ue.ElIcon),{key:0,class:"og-tabs-label__icon","aria-hidden":"true"},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.tab.icon)))]),_:1})):r.createCommentVNode("",!0),e.tab.pinned?(r.openBlock(),r.createBlock(r.unref(ue.ElIcon),{key:1,class:"og-tabs-label__pin","aria-label":e.locale.pinned},{default:r.withCtx(()=>[r.createVNode(r.unref(K.CollectionTag))]),_:1},8,["aria-label"])):r.createCommentVNode("",!0),r.createElementVNode("span",to,[r.renderSlot(t.$slots,"default",{tab:e.tab,active:e.active},()=>[r.createTextVNode(r.toDisplayString(e.tab.label),1)],!0)]),e.tab.dirty?(r.openBlock(),r.createElementBlock("span",{key:2,class:"og-tabs-label__dirty","aria-label":e.locale.unsaved},[r.createElementVNode("span",oo,r.toDisplayString(e.locale.unsaved),1)],8,no)):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"status",{tab:e.tab},()=>[e.tab.statusIcon||e.tab.status==="success"||e.tab.status==="warning"||e.tab.status==="error"?(r.openBlock(),r.createBlock(r.unref(ue.ElIcon),{key:0,class:r.normalizeClass(["og-tabs-label__status",[`is-${e.tab.status}`]]),"aria-hidden":"true"},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(e.tab.statusIcon||(e.tab.status==="success"?r.unref(K.CircleCheckFilled):e.tab.status==="error"?r.unref(K.CircleCloseFilled):r.unref(K.WarningFilled)))))]),_:1},8,["class"])):e.tab.status==="loading"?(r.openBlock(),r.createElementBlock("span",{key:1,class:"og-tabs-label__loading","aria-label":e.locale.loading},null,8,ro)):r.createCommentVNode("",!0)],!0),e.tab.badge!==void 0?(r.openBlock(),r.createElementBlock("span",io,r.toDisplayString(e.tab.badge),1)):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"after",{tab:e.tab},void 0,!0)],12,eo))}}),lo=Rt(ao,[["__scopeId","data-v-b81db2ee"]]);function ln(e){const t=r.shallowRef(!1);function o(d,p,v,b={}){const k=e.getItems(),x=e.getActiveKey();return{operation:d,source:p,tab:v,activeKey:x,activeTab:L(k,x),items:k,...b}}async function n(d){const p=t.value?"busy":e.getDeniedReason(d.operation,d.tab);if(p)return e.onDenied(d.operation,d.tab,p),!1;t.value=!0;try{return await e.getProps().beforeAction?.(d)===!1?!1:(e.onRequest(d),!0)}catch(v){return e.onError(d,v),!1}finally{t.value=!1}}function i(d,p="api"){const v=L(e.getItems(),d);return!v||v.disabled?(e.onDenied("activate",v,v?"disabled":"not-found"),Promise.resolve(!1)):d===e.getActiveKey()?Promise.resolve(!0):n(o("activate",p,v,{nextActiveKey:d}))}function a(d,p="api"){const v=e.getItems(),b=L(v,d);if(!Ce(b))return e.onDenied("close",b,b?.pinned?"pinned":b?"readonly":"not-found"),Promise.resolve(!1);const k=kt(v,new Set([d])),x=d===e.getActiveKey()?Pe(ae(v),k,d):e.getActiveKey();return n(o("close",p,b,{targets:[b],nextItems:k,nextActiveKey:x}))}function s(d,p,v="api"){const b=e.getItems(),k=ae(b),x=$t(k,p,d);if(!x.length)return e.onDenied(It(d),L(b,p),"boundary"),Promise.resolve(!1);const A=new Set(x.map(q=>q.key)),S=e.getActiveKey(),_=kt(b,A),O=S!==void 0&&A.has(S)?Pe(k,_,S):S;return n(o(It(d),v,d==="current"?x[0]:L(b,p),{targets:x,nextItems:_,nextActiveKey:O}))}function l(d,p,v="api"){const b=L(e.getItems(),d);return!b||!Ft(b)||b.pinned===p?(e.onDenied(p?"pin":"unpin",b,b?b.pinned===p?"boundary":"readonly":"not-found"),Promise.resolve(!1)):n(o(p?"pin":"unpin",v,b,{nextItems:rn(e.getItems(),d,p)}))}function c(d,p,v="api"){const b=e.getItems(),k=L(b,d),x=L(b,p),A=Ct(b,d,p);return!k||!x||A.every((S,_)=>S.key===b[_]?.key)?(e.onDenied("move",k,k?"boundary":"not-found"),Promise.resolve(!1)):n(o("move",v,k,{nextItems:A,targetTab:x}))}function f(d,p,v="api"){const b=e.getItems(),k=p===void 0?xt(b,d,"bottom"):Ct(b,d,p),x=L(b,d);return!x||k.every((A,S)=>A.key===b[S]?.key)?(e.onDenied("move",x,x?"boundary":"not-found"),Promise.resolve(!1)):n(o("move",v,x,{nextItems:k,targetTab:p===void 0?void 0:L(b,p)}))}function h(d,p,v="api"){const b=e.getItems(),k=L(b,d),x=xt(b,d,p);return!k||x.every((A,S)=>A.key===b[S]?.key)?(e.onDenied(p==="top"?"move-top":"move-bottom",k,k?"boundary":"not-found"),Promise.resolve(!1)):n(o(p==="top"?"move-top":"move-bottom",v,k,{nextItems:x}))}function m(d,p="api"){const v=L(e.getItems(),d);return v?n(o("refresh",p,v)):(e.onDenied("refresh",v,"not-found"),Promise.resolve(!1))}return{pending:t,dispatch:n,activate:i,close:a,closeScope:(d,p="api")=>s(d,e.getActiveKey(),p),closeScopeAt:s,refreshAt:m,pin:(d,p="api")=>l(d,!0,p),unpin:(d,p="api")=>l(d,!1,p),move:c,moveBefore:f,moveTop:(d,p="api")=>h(d,"top",p),moveBottom:(d,p="api")=>h(d,"bottom",p),refresh:(d="api")=>{const p=e.getActiveKey();return p===void 0?Promise.resolve(!1):m(p,d)},scrollTo:e.onScrollTo,getItems:e.getItems}}function so(e,t,o){return(t=ho(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},me.apply(null,arguments)}function jt(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,n)}return o}function de(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?jt(Object(o),!0).forEach(function(n){so(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):jt(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function uo(e,t){if(e==null)return{};var o,n,i=co(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)o=a[n],t.indexOf(o)===-1&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function co(e,t){if(e==null)return{};var o={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;o[n]=e[n]}return o}function fo(e,t){if(typeof e!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ho(e){var t=fo(e,"string");return typeof t=="symbol"?t:t+""}function At(e){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}var mo="1.15.7";function he(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var pe=he(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),je=he(/Edge/i),Kt=he(/firefox/i),Xe=he(/safari/i)&&!he(/chrome/i)&&!he(/android/i),Lt=he(/iP(ad|od|hone)/i),sn=he(/chrome/i)&&he(/android/i),un={capture:!1,passive:!1};function I(e,t,o){e.addEventListener(t,o,!pe&&un)}function C(e,t,o){e.removeEventListener(t,o,!pe&&un)}function rt(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function ie(e,t,o,n){if(e){o=o||document;do{if(t!=null&&(t[0]===">"?e.parentNode===o&&rt(e,t):rt(e,t))||n&&e===o)return e;if(e===o)break}while(e=cn(e))}return null}var Ut=/\s+/g;function ee(e,t,o){if(e&&t)if(e.classList)e.classList[o?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(Ut," ").replace(" "+t+" "," ");e.className=(n+(o?" "+t:"")).replace(Ut," ")}}function w(e,t,o){var n=e&&e.style;if(n){if(o===void 0)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),t===void 0?o:o[t];!(t in n)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),n[t]=o+(typeof o=="string"?"":"px")}}function Ne(e,t){var o="";if(typeof e=="string")o=e;else do{var n=w(e,"transform");n&&n!=="none"&&(o=n+" "+o)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(o)}function dn(e,t,o){if(e){var n=e.getElementsByTagName(t),i=0,a=n.length;if(o)for(;i<a;i++)o(n[i],i);return n}return[]}function ce(){var e=document.scrollingElement;return e||document.documentElement}function $(e,t,o,n,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,s,l,c,f,h,m;if(e!==window&&e.parentNode&&e!==ce()?(a=e.getBoundingClientRect(),s=a.top,l=a.left,c=a.bottom,f=a.right,h=a.height,m=a.width):(s=0,l=0,c=window.innerHeight,f=window.innerWidth,h=window.innerHeight,m=window.innerWidth),(t||o)&&e!==window&&(i=i||e.parentNode,!pe))do if(i&&i.getBoundingClientRect&&(w(i,"transform")!=="none"||o&&w(i,"position")!=="static")){var d=i.getBoundingClientRect();s-=d.top+parseInt(w(i,"border-top-width")),l-=d.left+parseInt(w(i,"border-left-width")),c=s+a.height,f=l+a.width;break}while(i=i.parentNode);if(n&&e!==window){var p=Ne(i||e),v=p&&p.a,b=p&&p.d;p&&(s/=b,l/=v,m/=v,h/=b,c=s+h,f=l+m)}return{top:s,left:l,bottom:c,right:f,width:m,height:h}}}function Zt(e,t,o){for(var n=ye(e,!0),i=$(e)[t];n;){var a=$(n)[o],s=void 0;if(s=i>=a,!s)return n;if(n===ce())break;n=ye(n,!1)}return!1}function Me(e,t,o,n){for(var i=0,a=0,s=e.children;a<s.length;){if(s[a].style.display!=="none"&&s[a]!==E.ghost&&(n||s[a]!==E.dragged)&&ie(s[a],o.draggable,e,!1)){if(i===t)return s[a];i++}a++}return null}function Vt(e,t){for(var o=e.lastElementChild;o&&(o===E.ghost||w(o,"display")==="none"||t&&!rt(o,t));)o=o.previousElementSibling;return o||null}function ne(e,t){var o=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==E.clone&&(!t||rt(e,t))&&o++;return o}function Qt(e){var t=0,o=0,n=ce();if(e)do{var i=Ne(e),a=i.a,s=i.d;t+=e.scrollLeft*a,o+=e.scrollTop*s}while(e!==n&&(e=e.parentNode));return[t,o]}function po(e,t){for(var o in e)if(e.hasOwnProperty(o)){for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[o][n])return Number(o)}return-1}function ye(e,t){if(!e||!e.getBoundingClientRect)return ce();var o=e,n=!1;do if(o.clientWidth<o.scrollWidth||o.clientHeight<o.scrollHeight){var i=w(o);if(o.clientWidth<o.scrollWidth&&(i.overflowX=="auto"||i.overflowX=="scroll")||o.clientHeight<o.scrollHeight&&(i.overflowY=="auto"||i.overflowY=="scroll")){if(!o.getBoundingClientRect||o===document.body)return ce();if(n||t)return o;n=!0}}while(o=o.parentNode);return ce()}function vo(e,t){if(e&&t)for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function gt(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Ye;function fn(e,t){return function(){if(!Ye){var o=arguments,n=this;o.length===1?e.call(n,o[0]):e.apply(n,o),Ye=setTimeout(function(){Ye=void 0},t)}}}function go(){clearTimeout(Ye),Ye=void 0}function hn(e,t,o){e.scrollLeft+=t,e.scrollTop+=o}function mn(e){var t=window.Polymer,o=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):o?o(e).clone(!0)[0]:e.cloneNode(!0)}function pn(e,t,o){var n={};return Array.from(e.children).forEach(function(i){var a,s,l,c;if(!(!ie(i,t.draggable,e,!1)||i.animated||i===o)){var f=$(i);n.left=Math.min((a=n.left)!==null&&a!==void 0?a:1/0,f.left),n.top=Math.min((s=n.top)!==null&&s!==void 0?s:1/0,f.top),n.right=Math.max((l=n.right)!==null&&l!==void 0?l:-1/0,f.right),n.bottom=Math.max((c=n.bottom)!==null&&c!==void 0?c:-1/0,f.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Q="Sortable"+new Date().getTime();function bo(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var n=[].slice.call(this.el.children);n.forEach(function(i){if(!(w(i,"display")==="none"||i===E.ghost)){e.push({target:i,rect:$(i)});var a=de({},e[e.length-1].rect);if(i.thisAnimationDuration){var s=Ne(i,!0);s&&(a.top-=s.f,a.left-=s.e)}i.fromRect=a}})}},addAnimationState:function(n){e.push(n)},removeAnimationState:function(n){e.splice(po(e,{target:n}),1)},animateAll:function(n){var i=this;if(!this.options.animation){clearTimeout(t),typeof n=="function"&&n();return}var a=!1,s=0;e.forEach(function(l){var c=0,f=l.target,h=f.fromRect,m=$(f),d=f.prevFromRect,p=f.prevToRect,v=l.rect,b=Ne(f,!0);b&&(m.top-=b.f,m.left-=b.e),f.toRect=m,f.thisAnimationDuration&&gt(d,m)&&!gt(h,m)&&(v.top-m.top)/(v.left-m.left)===(h.top-m.top)/(h.left-m.left)&&(c=wo(v,d,p,i.options)),gt(m,h)||(f.prevFromRect=h,f.prevToRect=m,c||(c=i.options.animation),i.animate(f,v,m,c)),c&&(a=!0,s=Math.max(s,c),clearTimeout(f.animationResetTimer),f.animationResetTimer=setTimeout(function(){f.animationTime=0,f.prevFromRect=null,f.fromRect=null,f.prevToRect=null,f.thisAnimationDuration=null},c),f.thisAnimationDuration=c)}),clearTimeout(t),a?t=setTimeout(function(){typeof n=="function"&&n()},s):typeof n=="function"&&n(),e=[]},animate:function(n,i,a,s){if(s){w(n,"transition",""),w(n,"transform","");var l=Ne(this.el),c=l&&l.a,f=l&&l.d,h=(i.left-a.left)/(c||1),m=(i.top-a.top)/(f||1);n.animatingX=!!h,n.animatingY=!!m,w(n,"transform","translate3d("+h+"px,"+m+"px,0)"),this.forRepaintDummy=yo(n),w(n,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),w(n,"transform","translate3d(0,0,0)"),typeof n.animated=="number"&&clearTimeout(n.animated),n.animated=setTimeout(function(){w(n,"transition",""),w(n,"transform",""),n.animated=!1,n.animatingX=!1,n.animatingY=!1},s)}}}}function yo(e){return e.offsetWidth}function wo(e,t,o,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-o.top,2)+Math.pow(t.left-o.left,2))*n.animation}var xe=[],bt={initializeByDefault:!0},Ke={mount:function(t){for(var o in bt)bt.hasOwnProperty(o)&&!(o in t)&&(t[o]=bt[o]);xe.forEach(function(n){if(n.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xe.push(t)},pluginEvent:function(t,o,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var a=t+"Global";xe.forEach(function(s){o[s.pluginName]&&(o[s.pluginName][a]&&o[s.pluginName][a](de({sortable:o},n)),o.options[s.pluginName]&&o[s.pluginName][t]&&o[s.pluginName][t](de({sortable:o},n)))})},initializePlugins:function(t,o,n,i){xe.forEach(function(l){var c=l.pluginName;if(!(!t.options[c]&&!l.initializeByDefault)){var f=new l(t,o,t.options);f.sortable=t,f.options=t.options,t[c]=f,me(n,f.defaults)}});for(var a in t.options)if(t.options.hasOwnProperty(a)){var s=this.modifyOption(t,a,t.options[a]);typeof s<"u"&&(t.options[a]=s)}},getEventProperties:function(t,o){var n={};return xe.forEach(function(i){typeof i.eventProperties=="function"&&me(n,i.eventProperties.call(o[i.pluginName],t))}),n},modifyOption:function(t,o,n){var i;return xe.forEach(function(a){t[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[o]=="function"&&(i=a.optionListeners[o].call(t[a.pluginName],n))}),i}};function Eo(e){var t=e.sortable,o=e.rootEl,n=e.name,i=e.targetEl,a=e.cloneEl,s=e.toEl,l=e.fromEl,c=e.oldIndex,f=e.newIndex,h=e.oldDraggableIndex,m=e.newDraggableIndex,d=e.originalEvent,p=e.putSortable,v=e.extraEventProperties;if(t=t||o&&o[Q],!!t){var b,k=t.options,x="on"+n.charAt(0).toUpperCase()+n.substr(1);window.CustomEvent&&!pe&&!je?b=new CustomEvent(n,{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent(n,!0,!0)),b.to=s||o,b.from=l||o,b.item=i||o,b.clone=a,b.oldIndex=c,b.newIndex=f,b.oldDraggableIndex=h,b.newDraggableIndex=m,b.originalEvent=d,b.pullMode=p?p.lastPutMode:void 0;var A=de(de({},v),Ke.getEventProperties(n,t));for(var S in A)b[S]=A[S];o&&o.dispatchEvent(b),k[x]&&k[x].call(t,b)}}var To=["evt"],Z=function(t,o){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=uo(n,To);Ke.pluginEvent.bind(E)(t,o,de({dragEl:g,parentEl:R,ghostEl:T,rootEl:B,nextEl:ke,lastDownEl:et,cloneEl:M,cloneHidden:be,dragStarted:Ve,putSortable:H,activeSortable:E.active,originalEvent:i,oldIndex:Oe,oldDraggableIndex:qe,newIndex:te,newDraggableIndex:ge,hideGhostForTarget:yn,unhideGhostForTarget:wn,cloneNowHidden:function(){be=!0},cloneNowShown:function(){be=!1},dispatchSortableEvent:function(l){j({sortable:o,name:l,originalEvent:i})}},a))};function j(e){Eo(de({putSortable:H,cloneEl:M,targetEl:g,rootEl:B,oldIndex:Oe,oldDraggableIndex:qe,newIndex:te,newDraggableIndex:ge},e))}var g,R,T,B,ke,et,M,be,Oe,te,qe,ge,Ue,H,Ae=!1,it=!1,at=[],_e,re,yt,wt,Jt,en,Ve,Ie,ze,Ge=!1,Ze=!1,tt,X,Et=[],Ot=!1,lt=[],ct=typeof document<"u",Qe=Lt,tn=je||pe?"cssFloat":"float",So=ct&&!sn&&!Lt&&"draggable"in document.createElement("div"),vn=(function(){if(ct){if(pe)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}})(),gn=function(t,o){var n=w(t),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=Me(t,0,o),s=Me(t,1,o),l=a&&w(a),c=s&&w(s),f=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+$(a).width,h=c&&parseInt(c.marginLeft)+parseInt(c.marginRight)+$(s).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&l.float&&l.float!=="none"){var m=l.float==="left"?"left":"right";return s&&(c.clear==="both"||c.clear===m)?"vertical":"horizontal"}return a&&(l.display==="block"||l.display==="flex"||l.display==="table"||l.display==="grid"||f>=i&&n[tn]==="none"||s&&n[tn]==="none"&&f+h>i)?"vertical":"horizontal"},_o=function(t,o,n){var i=n?t.left:t.top,a=n?t.right:t.bottom,s=n?t.width:t.height,l=n?o.left:o.top,c=n?o.right:o.bottom,f=n?o.width:o.height;return i===l||a===c||i+s/2===l+f/2},Do=function(t,o){var n;return at.some(function(i){var a=i[Q].options.emptyInsertThreshold;if(!(!a||Vt(i))){var s=$(i),l=t>=s.left-a&&t<=s.right+a,c=o>=s.top-a&&o<=s.bottom+a;if(l&&c)return n=i}}),n},bn=function(t){function o(a,s){return function(l,c,f,h){var m=l.options.group.name&&c.options.group.name&&l.options.group.name===c.options.group.name;if(a==null&&(s||m))return!0;if(a==null||a===!1)return!1;if(s&&a==="clone")return a;if(typeof a=="function")return o(a(l,c,f,h),s)(l,c,f,h);var d=(s?l:c).options.group.name;return a===!0||typeof a=="string"&&a===d||a.join&&a.indexOf(d)>-1}}var n={},i=t.group;(!i||At(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=o(i.pull,!0),n.checkPut=o(i.put),n.revertClone=i.revertClone,t.group=n},yn=function(){!vn&&T&&w(T,"display","none")},wn=function(){!vn&&T&&w(T,"display","")};ct&&!sn&&document.addEventListener("click",function(e){if(it)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),it=!1,!1},!0);var De=function(t){if(g){t=t.touches?t.touches[0]:t;var o=Do(t.clientX,t.clientY);if(o){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.target=n.rootEl=o,n.preventDefault=void 0,n.stopPropagation=void 0,o[Q]._onDragOver(n)}}},ko=function(t){g&&g.parentNode[Q]._isOutsideThisEl(t.target)};function E(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=me({},t),e[Q]=this;var o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return gn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,l){s.setData("Text",l.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:E.supportPointer!==!1&&"PointerEvent"in window&&(!Xe||Lt),emptyInsertThreshold:5};Ke.initializePlugins(this,e,o);for(var n in o)!(n in t)&&(t[n]=o[n]);bn(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:So,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?I(e,"pointerdown",this._onTapStart):(I(e,"mousedown",this._onTapStart),I(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(I(e,"dragover",this),I(e,"dragenter",this)),at.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),me(this,bo())}E.prototype={constructor:E,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Ie=null)},_getDirection:function(t,o){return typeof this.options.direction=="function"?this.options.direction.call(this,t,o,g):this.options.direction},_onTapStart:function(t){if(t.cancelable){var o=this,n=this.el,i=this.options,a=i.preventOnFilter,s=t.type,l=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,c=(l||t).target,f=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||c,h=i.filter;if(Bo(n),!g&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||i.disabled)&&!f.isContentEditable&&!(!this.nativeDraggable&&Xe&&c&&c.tagName.toUpperCase()==="SELECT")&&(c=ie(c,i.draggable,n,!1),!(c&&c.animated)&&et!==c)){if(Oe=ne(c),qe=ne(c,i.draggable),typeof h=="function"){if(h.call(this,t,c,this)){j({sortable:o,rootEl:f,name:"filter",targetEl:c,toEl:n,fromEl:n}),Z("filter",o,{evt:t}),a&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(m){if(m=ie(f,m.trim(),n,!1),m)return j({sortable:o,rootEl:m,name:"filter",targetEl:c,fromEl:n,toEl:n}),Z("filter",o,{evt:t}),!0}),h)){a&&t.preventDefault();return}i.handle&&!ie(f,i.handle,n,!1)||this._prepareDragStart(t,l,c)}}},_prepareDragStart:function(t,o,n){var i=this,a=i.el,s=i.options,l=a.ownerDocument,c;if(n&&!g&&n.parentNode===a){var f=$(n);if(B=a,g=n,R=g.parentNode,ke=g.nextSibling,et=n,Ue=s.group,E.dragged=g,_e={target:g,clientX:(o||t).clientX,clientY:(o||t).clientY},Jt=_e.clientX-f.left,en=_e.clientY-f.top,this._lastX=(o||t).clientX,this._lastY=(o||t).clientY,g.style["will-change"]="all",c=function(){if(Z("delayEnded",i,{evt:t}),E.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Kt&&i.nativeDraggable&&(g.draggable=!0),i._triggerDragStart(t,o),j({sortable:i,name:"choose",originalEvent:t}),ee(g,s.chosenClass,!0)},s.ignore.split(",").forEach(function(h){dn(g,h.trim(),Tt)}),I(l,"dragover",De),I(l,"mousemove",De),I(l,"touchmove",De),s.supportPointer?(I(l,"pointerup",i._onDrop),!this.nativeDraggable&&I(l,"pointercancel",i._onDrop)):(I(l,"mouseup",i._onDrop),I(l,"touchend",i._onDrop),I(l,"touchcancel",i._onDrop)),Kt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,g.draggable=!0),Z("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||o)&&(!this.nativeDraggable||!(je||pe))){if(E.eventCanceled){this._onDrop();return}s.supportPointer?(I(l,"pointerup",i._disableDelayedDrag),I(l,"pointercancel",i._disableDelayedDrag)):(I(l,"mouseup",i._disableDelayedDrag),I(l,"touchend",i._disableDelayedDrag),I(l,"touchcancel",i._disableDelayedDrag)),I(l,"mousemove",i._delayedDragTouchMoveHandler),I(l,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&I(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(c,s.delay)}else c()}},_delayedDragTouchMoveHandler:function(t){var o=t.touches?t.touches[0]:t;Math.max(Math.abs(o.clientX-this._lastX),Math.abs(o.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){g&&Tt(g),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;C(t,"mouseup",this._disableDelayedDrag),C(t,"touchend",this._disableDelayedDrag),C(t,"touchcancel",this._disableDelayedDrag),C(t,"pointerup",this._disableDelayedDrag),C(t,"pointercancel",this._disableDelayedDrag),C(t,"mousemove",this._delayedDragTouchMoveHandler),C(t,"touchmove",this._delayedDragTouchMoveHandler),C(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,o){o=o||t.pointerType=="touch"&&t,!this.nativeDraggable||o?this.options.supportPointer?I(document,"pointermove",this._onTouchMove):o?I(document,"touchmove",this._onTouchMove):I(document,"mousemove",this._onTouchMove):(I(g,"dragend",this),I(B,"dragstart",this._onDragStart));try{document.selection?nt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,o){if(Ae=!1,B&&g){Z("dragStarted",this,{evt:o}),this.nativeDraggable&&I(document,"dragover",ko);var n=this.options;!t&&ee(g,n.dragClass,!1),ee(g,n.ghostClass,!0),E.active=this,t&&this._appendGhost(),j({sortable:this,name:"start",originalEvent:o})}else this._nulling()},_emulateDragOver:function(){if(re){this._lastX=re.clientX,this._lastY=re.clientY,yn();for(var t=document.elementFromPoint(re.clientX,re.clientY),o=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(re.clientX,re.clientY),t!==o);)o=t;if(g.parentNode[Q]._isOutsideThisEl(t),o)do{if(o[Q]){var n=void 0;if(n=o[Q]._onDragOver({clientX:re.clientX,clientY:re.clientY,target:t,rootEl:o}),n&&!this.options.dragoverBubble)break}t=o}while(o=cn(o));wn()}},_onTouchMove:function(t){if(_e){var o=this.options,n=o.fallbackTolerance,i=o.fallbackOffset,a=t.touches?t.touches[0]:t,s=T&&Ne(T,!0),l=T&&s&&s.a,c=T&&s&&s.d,f=Qe&&X&&Qt(X),h=(a.clientX-_e.clientX+i.x)/(l||1)+(f?f[0]-Et[0]:0)/(l||1),m=(a.clientY-_e.clientY+i.y)/(c||1)+(f?f[1]-Et[1]:0)/(c||1);if(!E.active&&!Ae){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(T){s?(s.e+=h-(yt||0),s.f+=m-(wt||0)):s={a:1,b:0,c:0,d:1,e:h,f:m};var d="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");w(T,"webkitTransform",d),w(T,"mozTransform",d),w(T,"msTransform",d),w(T,"transform",d),yt=h,wt=m,re=a}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!T){var t=this.options.fallbackOnBody?document.body:B,o=$(g,!0,Qe,!0,t),n=this.options;if(Qe){for(X=t;w(X,"position")==="static"&&w(X,"transform")==="none"&&X!==document;)X=X.parentNode;X!==document.body&&X!==document.documentElement?(X===document&&(X=ce()),o.top+=X.scrollTop,o.left+=X.scrollLeft):X=ce(),Et=Qt(X)}T=g.cloneNode(!0),ee(T,n.ghostClass,!1),ee(T,n.fallbackClass,!0),ee(T,n.dragClass,!0),w(T,"transition",""),w(T,"transform",""),w(T,"box-sizing","border-box"),w(T,"margin",0),w(T,"top",o.top),w(T,"left",o.left),w(T,"width",o.width),w(T,"height",o.height),w(T,"opacity","0.8"),w(T,"position",Qe?"absolute":"fixed"),w(T,"zIndex","100000"),w(T,"pointerEvents","none"),E.ghost=T,t.appendChild(T),w(T,"transform-origin",Jt/parseInt(T.style.width)*100+"% "+en/parseInt(T.style.height)*100+"%")}},_onDragStart:function(t,o){var n=this,i=t.dataTransfer,a=n.options;if(Z("dragStart",this,{evt:t}),E.eventCanceled){this._onDrop();return}Z("setupClone",this),E.eventCanceled||(M=mn(g),M.removeAttribute("id"),M.draggable=!1,M.style["will-change"]="",this._hideClone(),ee(M,this.options.chosenClass,!1),E.clone=M),n.cloneId=nt(function(){Z("clone",n),!E.eventCanceled&&(n.options.removeCloneOnHide||B.insertBefore(M,g),n._hideClone(),j({sortable:n,name:"clone"}))}),!o&&ee(g,a.dragClass,!0),o?(it=!0,n._loopId=setInterval(n._emulateDragOver,50)):(C(document,"mouseup",n._onDrop),C(document,"touchend",n._onDrop),C(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",a.setData&&a.setData.call(n,i,g)),I(document,"drop",n),w(g,"transform","translateZ(0)")),Ae=!0,n._dragStartId=nt(n._dragStarted.bind(n,o,t)),I(document,"selectstart",n),Ve=!0,window.getSelection().removeAllRanges(),Xe&&w(document.body,"user-select","none")},_onDragOver:function(t){var o=this.el,n=t.target,i,a,s,l=this.options,c=l.group,f=E.active,h=Ue===c,m=l.sort,d=H||f,p,v=this,b=!1;if(Ot)return;function k(ve,dt){Z(ve,v,de({evt:t,isOwner:h,axis:p?"vertical":"horizontal",revert:s,dragRect:i,targetRect:a,canSort:m,fromSortable:d,target:n,completed:A,onMove:function(Re,Fe){return Je(B,o,g,i,Re,$(Re),t,Fe)},changed:S},dt))}function x(){k("dragOverAnimationCapture"),v.captureAnimationState(),v!==d&&d.captureAnimationState()}function A(ve){return k("dragOverCompleted",{insertion:ve}),ve&&(h?f._hideClone():f._showClone(v),v!==d&&(ee(g,H?H.options.ghostClass:f.options.ghostClass,!1),ee(g,l.ghostClass,!0)),H!==v&&v!==E.active?H=v:v===E.active&&H&&(H=null),d===v&&(v._ignoreWhileAnimating=n),v.animateAll(function(){k("dragOverAnimationComplete"),v._ignoreWhileAnimating=null}),v!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===g&&!g.animated||n===o&&!n.animated)&&(Ie=null),!l.dragoverBubble&&!t.rootEl&&n!==document&&(g.parentNode[Q]._isOutsideThisEl(t.target),!ve&&De(t)),!l.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),b=!0}function S(){te=ne(g),ge=ne(g,l.draggable),j({sortable:v,name:"change",toEl:o,newIndex:te,newDraggableIndex:ge,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),n=ie(n,l.draggable,o,!0),k("dragOver"),E.eventCanceled)return b;if(g.contains(t.target)||n.animated&&n.animatingX&&n.animatingY||v._ignoreWhileAnimating===n)return A(!1);if(it=!1,f&&!l.disabled&&(h?m||(s=R!==B):H===this||(this.lastPutMode=Ue.checkPull(this,f,g,t))&&c.checkPut(this,f,g,t))){if(p=this._getDirection(t,n)==="vertical",i=$(g),k("dragOverValid"),E.eventCanceled)return b;if(s)return R=B,x(),this._hideClone(),k("revert"),E.eventCanceled||(ke?B.insertBefore(g,ke):B.appendChild(g)),A(!0);var _=Vt(o,l.draggable);if(!_||Ao(t,p,this)&&!_.animated){if(_===g)return A(!1);if(_&&o===t.target&&(n=_),n&&(a=$(n)),Je(B,o,g,i,n,a,t,!!n)!==!1)return x(),_&&_.nextSibling?o.insertBefore(g,_.nextSibling):o.appendChild(g),R=o,S(),A(!0)}else if(_&&Io(t,p,this)){var O=Me(o,0,l,!0);if(O===g)return A(!1);if(n=O,a=$(n),Je(B,o,g,i,n,a,t,!1)!==!1)return x(),o.insertBefore(g,O),R=o,S(),A(!0)}else if(n.parentNode===o){a=$(n);var q=0,fe,we=g.parentNode!==o,V=!_o(g.animated&&g.toRect||i,n.animated&&n.toRect||a,p),Ee=p?"top":"left",W=Zt(n,"top","top")||Zt(g,"top","top"),z=W?W.scrollTop:void 0;Ie!==n&&(fe=a[Ee],Ge=!1,Ze=!V&&l.invertSwap||we),q=Oo(t,n,a,p,V?1:l.swapThreshold,l.invertedSwapThreshold==null?l.swapThreshold:l.invertedSwapThreshold,Ze,Ie===n);var N;if(q!==0){var J=ne(g);do J-=q,N=R.children[J];while(N&&(w(N,"display")==="none"||N===T))}if(q===0||N===n)return A(!1);Ie=n,ze=q;var Te=n.nextElementSibling,le=!1;le=q===1;var Se=Je(B,o,g,i,n,a,t,le);if(Se!==!1)return(Se===1||Se===-1)&&(le=Se===1),Ot=!0,setTimeout(xo,30),x(),le&&!Te?o.appendChild(g):n.parentNode.insertBefore(g,le?Te:n),W&&hn(W,0,z-W.scrollTop),R=g.parentNode,fe!==void 0&&!Ze&&(tt=Math.abs(fe-$(n)[Ee])),S(),A(!0)}if(o.contains(g))return A(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){C(document,"mousemove",this._onTouchMove),C(document,"touchmove",this._onTouchMove),C(document,"pointermove",this._onTouchMove),C(document,"dragover",De),C(document,"mousemove",De),C(document,"touchmove",De)},_offUpEvents:function(){var t=this.el.ownerDocument;C(t,"mouseup",this._onDrop),C(t,"touchend",this._onDrop),C(t,"pointerup",this._onDrop),C(t,"pointercancel",this._onDrop),C(t,"touchcancel",this._onDrop),C(document,"selectstart",this)},_onDrop:function(t){var o=this.el,n=this.options;if(te=ne(g),ge=ne(g,n.draggable),Z("drop",this,{evt:t}),R=g&&g.parentNode,te=ne(g),ge=ne(g,n.draggable),E.eventCanceled){this._nulling();return}Ae=!1,Ze=!1,Ge=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Pt(this.cloneId),Pt(this._dragStartId),this.nativeDraggable&&(C(document,"drop",this),C(o,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Xe&&w(document.body,"user-select",""),w(g,"transform",""),t&&(Ve&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),T&&T.parentNode&&T.parentNode.removeChild(T),(B===R||H&&H.lastPutMode!=="clone")&&M&&M.parentNode&&M.parentNode.removeChild(M),g&&(this.nativeDraggable&&C(g,"dragend",this),Tt(g),g.style["will-change"]="",Ve&&!Ae&&ee(g,H?H.options.ghostClass:this.options.ghostClass,!1),ee(g,this.options.chosenClass,!1),j({sortable:this,name:"unchoose",toEl:R,newIndex:null,newDraggableIndex:null,originalEvent:t}),B!==R?(te>=0&&(j({rootEl:R,name:"add",toEl:R,fromEl:B,originalEvent:t}),j({sortable:this,name:"remove",toEl:R,originalEvent:t}),j({rootEl:R,name:"sort",toEl:R,fromEl:B,originalEvent:t}),j({sortable:this,name:"sort",toEl:R,originalEvent:t})),H&&H.save()):te!==Oe&&te>=0&&(j({sortable:this,name:"update",toEl:R,originalEvent:t}),j({sortable:this,name:"sort",toEl:R,originalEvent:t})),E.active&&((te==null||te===-1)&&(te=Oe,ge=qe),j({sortable:this,name:"end",toEl:R,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Z("nulling",this),B=g=R=T=ke=M=et=be=_e=re=Ve=te=ge=Oe=qe=Ie=ze=H=Ue=E.dragged=E.ghost=E.clone=E.active=null;var t=this.el;lt.forEach(function(o){t.contains(o)&&(o.checked=!0)}),lt.length=yt=wt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":g&&(this._onDragOver(t),Co(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],o,n=this.el.children,i=0,a=n.length,s=this.options;i<a;i++)o=n[i],ie(o,s.draggable,this.el,!1)&&t.push(o.getAttribute(s.dataIdAttr)||No(o));return t},sort:function(t,o){var n={},i=this.el;this.toArray().forEach(function(a,s){var l=i.children[s];ie(l,this.options.draggable,i,!1)&&(n[a]=l)},this),o&&this.captureAnimationState(),t.forEach(function(a){n[a]&&(i.removeChild(n[a]),i.appendChild(n[a]))}),o&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,o){return ie(t,o||this.options.draggable,this.el,!1)},option:function(t,o){var n=this.options;if(o===void 0)return n[t];var i=Ke.modifyOption(this,t,o);typeof i<"u"?n[t]=i:n[t]=o,t==="group"&&bn(n)},destroy:function(){Z("destroy",this);var t=this.el;t[Q]=null,C(t,"mousedown",this._onTapStart),C(t,"touchstart",this._onTapStart),C(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(C(t,"dragover",this),C(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(o){o.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),at.splice(at.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!be){if(Z("hideClone",this),E.eventCanceled)return;w(M,"display","none"),this.options.removeCloneOnHide&&M.parentNode&&M.parentNode.removeChild(M),be=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(be){if(Z("showClone",this),E.eventCanceled)return;g.parentNode==B&&!this.options.group.revertClone?B.insertBefore(M,g):ke?B.insertBefore(M,ke):B.appendChild(M),this.options.group.revertClone&&this.animate(g,M),w(M,"display",""),be=!1}}};function Co(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Je(e,t,o,n,i,a,s,l){var c,f=e[Q],h=f.options.onMove,m;return window.CustomEvent&&!pe&&!je?c=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(c=document.createEvent("Event"),c.initEvent("move",!0,!0)),c.to=t,c.from=e,c.dragged=o,c.draggedRect=n,c.related=i||t,c.relatedRect=a||$(t),c.willInsertAfter=l,c.originalEvent=s,e.dispatchEvent(c),h&&(m=h.call(f,c,s)),m}function Tt(e){e.draggable=!1}function xo(){Ot=!1}function Io(e,t,o){var n=$(Me(o.el,0,o.options,!0)),i=pn(o.el,o.options,T),a=10;return t?e.clientX<i.left-a||e.clientY<n.top&&e.clientX<n.right:e.clientY<i.top-a||e.clientY<n.bottom&&e.clientX<n.left}function Ao(e,t,o){var n=$(Vt(o.el,o.options.draggable)),i=pn(o.el,o.options,T),a=10;return t?e.clientX>i.right+a||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+a||e.clientX>n.right&&e.clientY>n.top}function Oo(e,t,o,n,i,a,s,l){var c=n?e.clientY:e.clientX,f=n?o.height:o.width,h=n?o.top:o.left,m=n?o.bottom:o.right,d=!1;if(!s){if(l&&tt<f*i){if(!Ge&&(ze===1?c>h+f*a/2:c<m-f*a/2)&&(Ge=!0),Ge)d=!0;else if(ze===1?c<h+tt:c>m-tt)return-ze}else if(c>h+f*(1-i)/2&&c<m-f*(1-i)/2)return Po(t)}return d=d||s,d&&(c<h+f*a/2||c>m-f*a/2)?c>h+f/2?1:-1:0}function Po(e){return ne(g)<ne(e)?1:-1}function No(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,o=t.length,n=0;o--;)n+=t.charCodeAt(o);return n.toString(36)}function Bo(e){lt.length=0;for(var t=e.getElementsByTagName("input"),o=t.length;o--;){var n=t[o];n.checked&&lt.push(n)}}function nt(e){return setTimeout(e,0)}function Pt(e){return clearTimeout(e)}ct&&I(document,"touchmove",function(e){(E.active||Ae)&&e.cancelable&&e.preventDefault()});E.utils={on:I,off:C,css:w,find:dn,is:function(t,o){return!!ie(t,o,t,!1)},extend:vo,throttle:fn,closest:ie,toggleClass:ee,clone:mn,index:ne,nextTick:nt,cancelNextTick:Pt,detectDirection:gn,getChild:Me,expando:Q};E.get=function(e){return e[Q]};E.mount=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];t[0].constructor===Array&&(t=t[0]),t.forEach(function(n){if(!n.prototype||!n.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));n.utils&&(E.utils=de(de({},E.utils),n.utils)),Ke.mount(n)})};E.create=function(e,t){return new E(e,t)};E.version=mo;var F=[],We,Nt,Bt=!1,St,_t,st,He;function Mo(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(o){var n=o.originalEvent;this.sortable.nativeDraggable?I(document,"dragover",this._handleAutoScroll):this.options.supportPointer?I(document,"pointermove",this._handleFallbackAutoScroll):n.touches?I(document,"touchmove",this._handleFallbackAutoScroll):I(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(o){var n=o.originalEvent;!this.options.dragOverBubble&&!n.rootEl&&this._handleAutoScroll(n)},drop:function(){this.sortable.nativeDraggable?C(document,"dragover",this._handleAutoScroll):(C(document,"pointermove",this._handleFallbackAutoScroll),C(document,"touchmove",this._handleFallbackAutoScroll),C(document,"mousemove",this._handleFallbackAutoScroll)),nn(),ot(),go()},nulling:function(){st=Nt=We=Bt=He=St=_t=null,F.length=0},_handleFallbackAutoScroll:function(o){this._handleAutoScroll(o,!0)},_handleAutoScroll:function(o,n){var i=this,a=(o.touches?o.touches[0]:o).clientX,s=(o.touches?o.touches[0]:o).clientY,l=document.elementFromPoint(a,s);if(st=o,n||this.options.forceAutoScrollFallback||je||pe||Xe){Dt(o,this.options,l,n);var c=ye(l,!0);Bt&&(!He||a!==St||s!==_t)&&(He&&nn(),He=setInterval(function(){var f=ye(document.elementFromPoint(a,s),!0);f!==c&&(c=f,ot()),Dt(o,i.options,f,n)},10),St=a,_t=s)}else{if(!this.options.bubbleScroll||ye(l,!0)===ce()){ot();return}Dt(o,this.options,ye(l,!1),!1)}}},me(e,{pluginName:"scroll",initializeByDefault:!0})}function ot(){F.forEach(function(e){clearInterval(e.pid)}),F=[]}function nn(){clearInterval(He)}var Dt=fn(function(e,t,o,n){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=ce(),f=!1,h;Nt!==o&&(Nt=o,ot(),We=t.scroll,h=t.scrollFn,We===!0&&(We=ye(o,!0)));var m=0,d=We;do{var p=d,v=$(p),b=v.top,k=v.bottom,x=v.left,A=v.right,S=v.width,_=v.height,O=void 0,q=void 0,fe=p.scrollWidth,we=p.scrollHeight,V=w(p),Ee=p.scrollLeft,W=p.scrollTop;p===c?(O=S<fe&&(V.overflowX==="auto"||V.overflowX==="scroll"||V.overflowX==="visible"),q=_<we&&(V.overflowY==="auto"||V.overflowY==="scroll"||V.overflowY==="visible")):(O=S<fe&&(V.overflowX==="auto"||V.overflowX==="scroll"),q=_<we&&(V.overflowY==="auto"||V.overflowY==="scroll"));var z=O&&(Math.abs(A-i)<=s&&Ee+S<fe)-(Math.abs(x-i)<=s&&!!Ee),N=q&&(Math.abs(k-a)<=s&&W+_<we)-(Math.abs(b-a)<=s&&!!W);if(!F[m])for(var J=0;J<=m;J++)F[J]||(F[J]={});(F[m].vx!=z||F[m].vy!=N||F[m].el!==p)&&(F[m].el=p,F[m].vx=z,F[m].vy=N,clearInterval(F[m].pid),(z!=0||N!=0)&&(f=!0,F[m].pid=setInterval((function(){n&&this.layer===0&&E.active._onTouchMove(st);var Te=F[this.layer].vy?F[this.layer].vy*l:0,le=F[this.layer].vx?F[this.layer].vx*l:0;typeof h=="function"&&h.call(E.dragged.parentNode[Q],le,Te,e,st,F[this.layer].el)!=="continue"||hn(F[this.layer].el,le,Te)}).bind({layer:m}),24))),m++}while(t.bubbleScroll&&d!==c&&(d=ye(d,!1)));Bt=f}},30),En=function(t){var o=t.originalEvent,n=t.putSortable,i=t.dragEl,a=t.activeSortable,s=t.dispatchSortableEvent,l=t.hideGhostForTarget,c=t.unhideGhostForTarget;if(o){var f=n||a;l();var h=o.changedTouches&&o.changedTouches.length?o.changedTouches[0]:o,m=document.elementFromPoint(h.clientX,h.clientY);c(),f&&!f.el.contains(m)&&(s("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Wt(){}Wt.prototype={startIndex:null,dragStart:function(t){var o=t.oldDraggableIndex;this.startIndex=o},onSpill:function(t){var o=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=Me(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(o,i):this.sortable.el.appendChild(o),this.sortable.animateAll(),n&&n.animateAll()},drop:En};me(Wt,{pluginName:"revertOnSpill"});function Ht(){}Ht.prototype={onSpill:function(t){var o=t.dragEl,n=t.putSortable,i=n||this.sortable;i.captureAnimationState(),o.parentNode&&o.parentNode.removeChild(o),i.animateAll()},drop:En};me(Ht,{pluginName:"removeOnSpill"});E.mount(new Mo);E.mount(Ht,Wt);function Ro(e){let t,o=[];function n(l){return l?.getAttribute("data-tab-id")??l?.querySelector("[data-tab-id]")?.getAttribute("data-tab-id")??void 0}function i(){t?.destroy(),t=void 0}function a(l){const c=l.map(n),f=e.items().map(h=>Y(h.key));return c.length===f.length&&c.every((h,m)=>h===f[m])}function s(){i();const l=e.element.value;!l||!e.enabled()||(t=E.create(l,{animation:120,draggable:e.selector??'[role="tab"]',direction:"horizontal",scroll:e.scrollElement?.()??!0,scrollSensitivity:36,scrollSpeed:18,onMove(c){const f=n(c.dragged),h=n(c.related),m=e.items(),d=m.find(b=>Y(b.key)===f),p=m.find(b=>Y(b.key)===h),v=!!(d&&p&&e.canDrag(d)&&e.canDrag(p)&&d.pinned===p.pinned);return v||e.onInvalid?.(),v},onStart(c){o=[...c.from.querySelectorAll(e.selector??'[role="tab"]')]},onEnd(c){const f=n(c.item),h=e.items(),m=h.find(v=>Y(v.key)===f),d=c.item.nextElementSibling instanceof HTMLElement?n(c.item.nextElementSibling):void 0,p=h.find(v=>Y(v.key)===d);m&&e.onMove(m.key,p?.key),r.nextTick(()=>{a(o)&&o.forEach(v=>c.from.appendChild(v))})}}))}r.watch([e.element,e.items,e.enabled],s,{immediate:!0,flush:"post"}),r.onBeforeUnmount(i)}function Fo(e,t){const o=r.shallowRef(!1);let n;function i(){const l=t.value,c=l?.parentElement;o.value=!!(l&&c&&l.scrollWidth>c.clientWidth+1)}function a(){n?.disconnect();const l=t.value,c=l?.parentElement;if(!l||!c||typeof ResizeObserver>"u"){i();return}n=new ResizeObserver(i),n.observe(l),n.observe(c),i()}function s(l){r.nextTick(()=>e.value?.querySelector(`[data-tab-id="${l}"]`)?.closest('[role="tab"]')?.focus())}return r.watch([e,t],a,{immediate:!0,flush:"post"}),r.onBeforeUnmount(()=>n?.disconnect()),{overflowed:o,focusTab:s}}const $o=["aria-busy"],Lo={key:0,class:"og-tabs__header"},Vo={key:1,class:"og-tabs__empty"},Wo={key:2,class:"og-tabs__bar"},Ho={class:"og-tabs__actions"},Xo=["aria-label"],Yo=r.defineComponent({inheritAttrs:!1,__name:"OgTabs",props:{modelValue:{},items:{},variant:{},density:{},renderContent:{type:Boolean,default:void 0},features:{},readonly:{type:Boolean},busy:{type:Boolean},tabsProps:{},locale:{},minTabWidth:{},maxTabWidth:{},themeColor:{},sticky:{type:[Boolean,Number],default:void 0},finderThreshold:{},contextMenu:{},actionPolicy:{},beforeAction:{}},emits:["update:modelValue","update:items","action-request","close-request","refresh-request","pin-change-request","reorder-request","operation-denied","operation-error","tab-click","tab-change","tab-remove"],setup(e,{expose:t,emit:o}){const n=e,i=o,a=r.useSlots();function s(u){if(an(u))throw new TypeError("[OgTabs] Duplicate tab keys are not supported.")}s(n.items);const l=Mt.useOgTabsGlobalConfig(),c=r.useTemplateRef("tabsRoot"),f=r.useTemplateRef("nativeTabs"),h=r.ref(),m=r.ref({x:0,y:0}),d=r.ref(!1),p=r.ref(),v=r.ref(),b=r.computed(()=>n.variant??l?.variant??"default"),k=r.computed(()=>n.density??l?.density??"default"),x=r.computed(()=>n.renderContent??l?.renderContent??!0),A=r.computed(()=>({...l?.features,...n.features})),S=r.computed(()=>({...l?.tabsProps,...n.tabsProps})),_=r.computed(()=>Ln.mergeLocale(ut.OG_TABS_LOCALE_ZH_CN,l?.localeSource?.value,l?.locale,n.locale)),O=r.computed(()=>({...l?.contextMenu,...n.contextMenu})),q=r.computed(()=>n.minTabWidth??l?.minTabWidth),fe=r.computed(()=>n.maxTabWidth??l?.maxTabWidth),we=r.computed(()=>n.themeColor??l?.themeColor),V=r.computed(()=>n.sticky??l?.sticky),Ee=r.computed(()=>n.finderThreshold??l?.finderThreshold??8),W=r.computed(()=>(s(n.items),n.items)),z=r.computed(()=>ae(W.value)),N=r.computed(()=>n.modelValue),J=r.computed(()=>L(W.value,N.value)),Te=r.computed(()=>N.value===void 0?void 0:Y(N.value)),le=r.computed(()=>({...S.value,modelValue:Te.value??""})),Se=r.computed(()=>f.value?.tabNavRef?.tabListRef??null),ve=r.computed(()=>O.value.enabled!==!1),dt=r.computed(()=>new Set(O.value.hiddenActions)),ft=r.computed(()=>Xt(q.value)),Re=r.computed(()=>Xt(fe.value)??"240px"),Fe=Fo(c,Se),Tn=r.computed(()=>se("finder")&&(Fe.overflowed.value||z.value.length>=Ee.value));function se(u){return u==="pin"||u==="drag"?A.value[u]===!0:A.value[u]!==!1}function Xt(u){return typeof u=="number"?`${u}px`:u}function $e(u){return W.value.find(y=>Y(y.key)===String(u))?.key}function Sn(u){const y=u.paneName===void 0?void 0:$e(u.paneName);return y===void 0?u:{...u,paneName:y}}function _n(u){i("action-request",u),Object.prototype.hasOwnProperty.call(u,"nextActiveKey")&&i("update:modelValue",u.nextActiveKey),u.nextItems&&i("update:items",u.nextItems),u.operation.startsWith("close")&&i("close-request",u),u.operation==="refresh"&&i("refresh-request",u),(u.operation==="pin"||u.operation==="unpin")&&i("pin-change-request",u),(u.operation==="move"||u.operation==="move-top"||u.operation==="move-bottom")&&i("reorder-request",u)}function ht(u){r.nextTick(()=>c.value?.querySelector(`[data-tab-id="${Y(u)}"]`)?.closest('[role="tab"]')?.scrollIntoView?.({block:"nearest",inline:"nearest"}))}const U=ln({getItems:()=>W.value,getActiveKey:()=>N.value,getProps:()=>n,getDeniedReason:(u,y)=>mt(u,y),onRequest:_n,onDenied:(u,y,D)=>i("operation-denied",u,y,D),onError:(u,y)=>i("operation-error",u,y),onScrollTo:ht});function mt(u,y){if(n.busy||U?.pending.value)return"busy";const D=n.actionPolicy;if(D&&(D.mode==="allow"?!D.actions.includes(u):D.actions.includes(u)))return"policy";if(u==="activate")return y?y.disabled?"disabled":void 0:"not-found";if(!y&&u!=="close-all")return"not-found";if(n.readonly||y?.readonly||y?.disabled)return y?.disabled?"disabled":"readonly";if(u.startsWith("close"))return se("close")?u==="close"&&!Ce(y)?y?.pinned?"pinned":"readonly":void 0:"policy";if(u==="refresh")return se("refresh")?void 0:"policy";if(u==="pin"||u==="unpin")return se("pin")?Ft(y)?void 0:"readonly":"policy";if(u==="move"||u==="move-top"||u==="move-bottom")return se("drag")?Be(y)?void 0:y?.pinned?"pinned":"boundary":"policy"}function Yt(u,y){U.activate(u,y).then(D=>{D&&ht(u)})}function Dn(u){const y=z.value,D=y.filter(G=>G.key!==u),P=Pe(y,D,u);v.value=P===void 0?void 0:Y(P)}function qt(u,y){Dn(u),U.close(u,y).then(D=>{D||(v.value=void 0)})}function kn(u,y,D){const P=z.value,G=$t(P,y,u),oe=N.value;if(oe!==void 0&&G.some(Le=>Le.key===oe)){const Le=P.filter(Fn=>!G.some($n=>$n.key===Fn.key)),Gt=Pe(P,Le,oe);v.value=Gt===void 0?void 0:Y(Gt)}U.closeScopeAt(u,y,D).then(Le=>{Le||(v.value=void 0)})}function pt(u,y,D,P){if(!ve.value)return;const G=y.getBoundingClientRect(),oe=y.closest('[role="tab"]')??y;h.value=u,p.value=oe,m.value={x:D??G.left,y:P??G.bottom+4},d.value=!0}function Cn(u,y){u.preventDefault(),pt(y,u.currentTarget,u.clientX,u.clientY)}function xn(u){J.value&&pt(J.value,u.currentTarget)}function zt(){d.value=!1;const u=p.value;p.value=void 0,r.nextTick(()=>u?.focus())}function In(u,y){m.value={x:u,y}}function An(u){const y=h.value;zt(),y&&(u.startsWith("close")?kn(u==="close"?"current":u.replace("close-",""),y.key,"menu"):u==="refresh"?U.refreshAt(y.key,"menu"):u==="pin"?U.pin(y.key,"menu"):u==="unpin"?U.unpin(y.key,"menu"):u==="move-top"?U.moveTop(y.key,"menu"):u==="move-bottom"&&U.moveBottom(y.key,"menu"))}const On=r.computed(()=>{const u=h.value;return u?[{operation:"refresh",label:_.value.refresh,icon:K.Refresh},{operation:"close",label:_.value.close,icon:K.Close,dividerBefore:!0},{operation:"close-others",label:_.value.closeOthers,icon:K.Close},{operation:"close-left",label:_.value.closeLeft,icon:K.Close},{operation:"close-right",label:_.value.closeRight,icon:K.Close},{operation:"close-all",label:_.value.closeAll,icon:K.Close},{operation:u.pinned?"unpin":"pin",label:u.pinned?_.value.unpin:_.value.pin,icon:K.CollectionTag,dividerBefore:!0},{operation:"move-top",label:_.value.moveTop,icon:K.Top,dividerBefore:!0},{operation:"move-bottom",label:_.value.moveBottom,icon:K.Bottom}].filter(D=>!dt.value.has(D.operation)&&(D.operation!=="refresh"||se("refresh"))&&(!["pin","unpin"].includes(D.operation)||se("pin"))&&(!["move-top","move-bottom"].includes(D.operation)||se("drag"))).map(D=>({...D,disabled:mt(D.operation,u)!==void 0})):[]});function Pn(u){if(!se("keyboard"))return;const y=u.target instanceof HTMLElement?u.target.closest('[role="tab"]'):null;if(!y)return;const D=y.querySelector("[data-tab-id]")?.getAttribute("data-tab-id"),P=z.value.find(G=>Y(G.key)===D);if(P){if(u.key==="Delete"){u.preventDefault(),qt(P.key,"keyboard");return}if(u.key==="Home"||u.key==="End"){u.preventDefault();const G=(u.key==="Home"?z.value:[...z.value].reverse()).find(oe=>!oe.disabled);G&&(Yt(G.key,"keyboard"),Fe.focusTab(Y(G.key)));return}(u.key==="ContextMenu"||u.key==="F10"&&u.shiftKey)&&(u.preventDefault(),pt(P,y))}}async function Nn(u){const y=$e(u);return y===void 0?!1:y===N.value?!0:await U.activate(y,"native")&&N.value===y}function Bn(u,y){i("tab-click",Sn(u),y)}function Mn(u){i("tab-change",$e(u)??u)}function Rn(u){i("tab-remove",$e(u)??u);const y=$e(u);y!==void 0&&qt(y,"native")}Ro({element:Se,selector:'[role="tab"]',enabled:()=>se("drag")&&!n.readonly&&!n.busy,items:()=>z.value,canDrag:Be,onMove:(u,y)=>{U.moveBefore(u,y,"drag")}});let vt="";return r.watch([W,N],([u,y],[D])=>{if(y!==void 0&&L(u,y)){vt="";return}const P=`${String(y)}:${u.map(oe=>String(oe.key)).join("|")}`;if(vt===P)return;vt=P;const G=y===void 0?ae(u).find(oe=>!oe.disabled)?.key:Pe(ae(D||u),u,y);i("update:modelValue",G)},{immediate:!0}),r.watch(N,u=>{u!==void 0&&ht(u),u!==void 0&&v.value===Y(u)&&(Fe.focusTab(v.value),v.value=void 0)}),t({...U,getNativeTabs:()=>f.value??void 0}),(u,y)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({ref_key:"tabsRoot",ref:c},u.$attrs,{class:["og-tabs",[`og-tabs--${b.value}`,`og-tabs--${k.value}`,{"is-sticky":V.value,"is-pending":r.unref(U).pending.value||e.busy}]],style:{"--og-tabs-sticky-top":typeof V.value=="number"?`${V.value}px`:"0px","--og-tabs-theme-color":we.value,"--og-tabs-tab-min-width":ft.value,"--og-tabs-tab-max-width":Re.value},"aria-busy":e.busy||r.unref(U).pending.value,onKeydown:Pn}),[a.header?(r.openBlock(),r.createElementBlock("div",Lo,[r.renderSlot(u.$slots,"header")])):r.createCommentVNode("",!0),W.value.length?(r.openBlock(),r.createElementBlock("div",Wo,[r.createVNode(r.unref(ue.ElTabs),r.mergeProps({ref_key:"nativeTabs",ref:f},le.value,{class:"og-tabs__native","before-leave":Nn,onTabClick:Bn,onTabChange:Mn,onTabRemove:Rn}),{default:r.withCtx(()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(z.value,D=>(r.openBlock(),r.createBlock(r.unref(ue.ElTabPane),{key:r.unref(Y)(D.key),name:r.unref(Y)(D.key),disabled:D.disabled===!0,closable:mt("close",D)===void 0,lazy:D.lazy===!0},{label:r.withCtx(()=>[r.createVNode(lo,{tab:D,active:D.key===N.value,"min-width":ft.value,"max-width":Re.value,locale:_.value,onContextmenu:P=>Cn(P,D)},{default:r.withCtx(P=>[r.renderSlot(u.$slots,"label",r.mergeProps({ref_for:!0},P))]),before:r.withCtx(P=>[r.renderSlot(u.$slots,"tabBefore",r.mergeProps({ref_for:!0},P))]),after:r.withCtx(P=>[r.renderSlot(u.$slots,"tabAfter",r.mergeProps({ref_for:!0},P))]),status:r.withCtx(P=>[r.renderSlot(u.$slots,"status",r.mergeProps({ref_for:!0},P))]),_:3},8,["tab","active","min-width","max-width","locale","onContextmenu"])]),default:r.withCtx(()=>[x.value&&D.key===N.value?r.renderSlot(u.$slots,"default",{tab:D,active:!0},void 0,void 0,0):r.createCommentVNode("",!0)]),_:2},1032,["name","disabled","closable","lazy"]))),128))]),_:3},16),r.createElementVNode("div",Ho,[Tn.value?(r.openBlock(),r.createBlock(Jn,{key:0,tabs:z.value,"active-key":N.value,locale:_.value,onActivate:y[0]||(y[0]=D=>Yt(D,"finder"))},null,8,["tabs","active-key","locale"])):r.createCommentVNode("",!0),ve.value&&J.value?(r.openBlock(),r.createElementBlock("button",{key:1,type:"button",class:"og-tabs__action","aria-label":_.value.tabActions,onClick:xn},[r.createVNode(r.unref(ue.ElIcon),{"aria-hidden":"true"},{default:r.withCtx(()=>[r.createVNode(r.unref(K.MoreFilled))]),_:1})],8,Xo)):r.createCommentVNode("",!0),r.renderSlot(u.$slots,"extra")])])):(r.openBlock(),r.createElementBlock("div",Vo,[r.renderSlot(u.$slots,"empty",{},()=>[r.createTextVNode(r.toDisplayString(_.value.empty),1)])])),r.createVNode(Xn,{visible:d.value,x:m.value.x,y:m.value.y,items:On.value,onSelect:An,onClose:zt,onReposition:In},{top:r.withCtx(()=>[r.renderSlot(u.$slots,"contextMenuTop",r.normalizeProps(r.guardReactiveProps({operation:"refresh",source:"menu",tab:h.value,activeKey:N.value,activeTab:J.value,items:W.value})))]),bottom:r.withCtx(()=>[r.renderSlot(u.$slots,"contextMenuBottom",r.normalizeProps(r.guardReactiveProps({operation:"refresh",source:"menu",tab:h.value,activeKey:N.value,activeTab:J.value,items:W.value})))]),_:3},8,["visible","x","y","items"])],16,$o))}});exports.createOgTabs=Mt.createOgTabs;exports.useOgTabsGlobalConfig=Mt.useOgTabsGlobalConfig;exports.OG_TABS_LOCALE_EN_US=ut.OG_TABS_LOCALE_EN_US;exports.OG_TABS_LOCALE_ZH_CN=ut.OG_TABS_LOCALE_ZH_CN;exports.OG_TABS_LOCALE_ZH_TW=ut.OG_TABS_LOCALE_ZH_TW;exports.OgTabs=Yo;exports.canCloseTab=Ce;exports.canMoveTab=Be;exports.canPinTab=Ft;exports.filterTabs=on;exports.findTab=L;exports.getCloseScopeTabs=$t;exports.hasDuplicateKeys=an;exports.moveTab=Ct;exports.moveTabToEdge=xt;exports.operationForCloseScope=It;exports.orderTabs=ae;exports.removeTabs=kt;exports.resolveNextActive=Pe;exports.setTabPinned=rn;exports.useTabsController=ln;