diff --git a/HMI_PAGE_ROLES_FULLSCREEN.md b/HMI_PAGE_ROLES_FULLSCREEN.md new file mode 100644 index 0000000..7182f22 --- /dev/null +++ b/HMI_PAGE_ROLES_FULLSCREEN.md @@ -0,0 +1,39 @@ +# Roles, page access and maximized JNLP – 2026-11-24 + +## Changes + +- Existing role definitions are always shown in the role administrator, even before choosing a person/group. + NULL role descriptions no longer remove role entries from the backend JSON object. + `hmi-workplace` is included in both built-in role catalogs. +- Page Manager loads existing `visibleToRoles`, offers role checkboxes and saves them with the page. + Missing roles on legacy updates preserve the current policy; an explicit empty array removes restrictions. +- Policies use existing CUST/cust `HMI_APP_PREF`, scope `PAGE_ACCESS`, keyed by page ID. + No new tables, columns or destructive schema migrations. Page metadata and policy save in one transaction. +- Server-side navigation filtering and direct effective/layout access enforce operator permissions, + including all parent page policies. Within a page ANY selected role suffices; ancestor policies ALSO apply. + Existing designer/publisher/admin management and preview privileges are preserved and bypass operator + page filtering. This is not a new restriction on administrative editing privileges. +- No policy means the existing unrestricted authenticated page behavior. Invalid stored policies fail closed. +- JNLP widgets auto-start in a body-level overlay occupying the whole browser viewport (`fit`). + “Zur Seite” returns to the existing widget without restarting Java. True browser Fullscreen API is + only requested by a user click. No invented JNLP fullscreen argument is passed to the vendor launcher. +- Window diagnostics remain OFF by default. Remote MES JNLP/JAR source and browser identity fix unchanged. + +## Verification + +Vue typecheck/Vite and Maven build passed. Five Java tests passed, including role matching, parent +restrictions, disabled/missing parents, cycles, invalid input and unrestricted pages. Existing CheerpJ, +widget-package and navigation suites passed. Chromium component smoke test with mocked HTTP endpoints: +role list visible without person selection; stored page role loaded; checkbox change sent in PUT payload; +automatic JNLP overlay measured 1280x800 and returned to page without a new launch. + +No live Oracle/SQL Server connection, authenticated GlassFish role roundtrip or MES booking was tested. +JDBC uses the existing parameterized CLOB/NVARCHAR preference-store pattern for both databases. +The previous Workplace login was not re-tested; no changes to authentication or remote JAR selection. + +## Deployment + +Deploy the updated WAR, hard-reload the Workbench UI, open Pages & Navigation, choose a page, +select “Sichtbar für Rollen” and save. Use the roles administrator to assign those roles to persons/groups. +An ordinary operator needs an allowed role on each restricted ancestor and on the page itself. +Verify with a separate operator account: hidden navigation AND denied direct effective-page access. diff --git a/WORKPLACE_DEPLOYMENT.md b/WORKPLACE_DEPLOYMENT.md index 2f88d02..a1a14cd 100644 --- a/WORKPLACE_DEPLOYMENT.md +++ b/WORKPLACE_DEPLOYMENT.md @@ -58,3 +58,9 @@ CheerpJ 5.0 is loaded from its CDN; an appropriate license is required for busin Rebuild from the project root with `bash build-hmi.sh` (Linux) or `./build-hmi.ps1` (Windows). Neither build requires Workplace.zip. This correction concerns client library selection; it does not change classes or deployments inside the MES server. + +## UI update 2026-11-24 + +This release also includes persistent page-role assignments, an always-visible role catalog and +automatically maximized JNLP browser viewport. Window diagnostics remain off by default. +See `HMI_PAGE_ROLES_FULLSCREEN.md` for authorization semantics and verification limits. diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java index 2659df8..bac7e85 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiApiResource.java @@ -280,7 +280,7 @@ public class HmiApiResource { public Response viewableRoleNames() { Response r=denied(designer()); if(r!=null)return r; JSONArray out=new JSONArray(); java.util.Set seen=new java.util.TreeSet<>(); - java.util.Collections.addAll(seen,"hmi-admin","hmi-designer","hmi-publisher","hmi-script-editor"); + java.util.Collections.addAll(seen,"hmi-admin","hmi-designer","hmi-publisher","hmi-script-editor","hmi-workplace"); try(Connection c=HmiDb.open();PreparedStatement p=c.prepareStatement( "SELECT ROLE_KEY FROM "+schema()+"HMI_APP_ROLE ORDER BY ROLE_KEY");ResultSet rs=p.executeQuery()) { while(rs.next())seen.add(rs.getString(1)); @@ -313,9 +313,10 @@ public class HmiApiResource { JSONObject page=new JSONObject().put("id",rs.getString(1)).put("key",rs.getString(2)).put("title",rs.getString(3)) .put("menuGroup",rs.getString(4)).put("order",rs.getInt(5)).put("enabled",rs.getInt(6)==1) .put("parentPageId",parent==null?JSONObject.NULL:parent); + page.put("visibleToRoles",HmiPageAccess.read(c,schema(),page.getString("id"))); found.put(page.getString("id"),page); } - for(JSONObject page:found.values()) if(designer()||visiblePage(page.getString("id"),found))out.put(page); + for(JSONObject page:found.values()) if(designer()||HmiPageAccess.visible(page.getString("id"),found,HmiAuth.roles(request)))out.put(page); return json(out); }catch(SQLException e){return dbError(e);} } @@ -405,6 +406,7 @@ public class HmiApiResource { ps.setString(1,pageId);ps.setString(2,key);ps.setString(3,title); ps.setString(4,menu);ps.setInt(5,order);ps.setString(6,parent);ps.executeUpdate(); } + HmiPageAccess.save(c,schema(),pageId,input.has("visibleToRoles")?HmiPageAccess.validate(input.getJSONArray("visibleToRoles")):new JSONArray()); audit(c,"page.created",pageId,key);c.commit(); } catch (Exception ex) {c.rollback();throw ex;} } @@ -432,6 +434,7 @@ public class HmiApiResource { ps.setInt(4,enabled?1:0);ps.setString(5,parent);ps.setString(6,pageId); ps.executeUpdate(); } + if(input.has("visibleToRoles"))HmiPageAccess.save(c,schema(),pageId,HmiPageAccess.validate(input.getJSONArray("visibleToRoles"))); updateDescendantMenus(c,pageId,menu); audit(c,"page.updated",pageId,title);c.commit(); }catch(Exception ex){c.rollback();throw ex;} @@ -596,16 +599,7 @@ public class HmiApiResource { try(Connection c=HmiDb.open()){ JSONObject page=fetchPage(c,pageId); if(page==null)return err(404,"Page not found"); - if(!designer()){ - java.util.Set seen=new java.util.HashSet<>(); - JSONObject ancestor=page; - while(ancestor!=null){ - if(!seen.add(ancestor.getString("id"))||!ancestor.getBoolean("enabled"))return err(404,"Page not found"); - String parent=ancestor.isNull("parentPageId")?null:ancestor.optString("parentPageId",null); - ancestor=parent==null?null:fetchPage(c,parent); - if(parent!=null&&ancestor==null)return err(404,"Page not found"); - } - } + if(!runtimePageAllowed(c,pageId))return err(403,"Keine Berechtigung für diese Seite"); List groups=groups(c,user()); JSONObject template=resolveTemplate(c,pageId,station,groups); if(template==null)return err(404,"No published template assigned"); @@ -652,6 +646,7 @@ public class HmiApiResource { JSONObject o=validateOverrides(in.getJSONObject("overrides")); try(Connection c=HmiDb.open()){ if(!pageExists(c,pageId))return err(404,"Page not found"); + if(!runtimePageAllowed(c,pageId))return err(403,"Keine Berechtigung für diese Seite"); // Server enforcement: only published, personalizable widget IDs can be overridden. JSONObject template=resolveTemplate(c,pageId,in.optString("station",""),groups(c,user())); if(template==null)return err(409,"Page has no published template"); @@ -754,10 +749,23 @@ public class HmiApiResource { p.setString(1,pageId);try(ResultSet rs=p.executeQuery()){ return rs.next()?new JSONObject().put("id",rs.getString(1)).put("key",rs.getString(2)).put("title",rs.getString(3)) .put("menuGroup",rs.getString(4)).put("order",rs.getInt(5)).put("enabled",rs.getInt(6)!=0) - .put("parentPageId",rs.getString(7)==null?JSONObject.NULL:rs.getString(7)):null; + .put("parentPageId",rs.getString(7)==null?JSONObject.NULL:rs.getString(7)) + .put("visibleToRoles",HmiPageAccess.read(c,schema(),pageId)):null; } } } + private boolean runtimePageAllowed(Connection c,String pageId)throws SQLException{ + if(designer())return true; // Existing design-preview privileges; operators checked below. + java.util.Map pages=new java.util.HashMap<>(); + String current=pageId; + while(current!=null){ + if(pages.containsKey(current))return false; + JSONObject page=fetchPage(c,current);if(page==null)return false; + pages.put(current,page); + current=page.isNull("parentPageId")?null:page.optString("parentPageId",null); + } + return HmiPageAccess.visible(pageId,pages,HmiAuth.roles(request)); + } private boolean pageExists(Connection c,String pageId)throws SQLException{return fetchPage(c,pageId)!=null;} private JSONObject resolveTemplate(Connection c,String pageId,String station,List groups)throws SQLException{ List ids=new ArrayList<>(); diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiPageAccess.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiPageAccess.java new file mode 100644 index 0000000..26b8fbc --- /dev/null +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiPageAccess.java @@ -0,0 +1,60 @@ +package com.workbenchclassic.hmi; + +import java.sql.*; +import java.io.*; +import java.util.*; +import org.json.*; + +/** Page visibility in the existing CUST preference store; no schema migration. */ +final class HmiPageAccess { + private HmiPageAccess() { } + static JSONArray validate(JSONArray input) { + if(input==null || input.length()>100)throw new JSONException("Seitenrollen müssen ein Array mit maximal 100 Rollen sein"); + Set unique=new LinkedHashSet<>(); + for(int i=0;i20000)throw new SQLException("Page access policy too large");} + return validate(new JSONObject(text.toString()).getJSONArray("visibleToRoles")); + }catch(IOException|JSONException e){throw new SQLException("Invalid page access policy",e);} + } + } + } + static void save(Connection c,String schema,String id,JSONArray roles) throws SQLException { + String json=new JSONObject().put("visibleToRoles",validate(roles)).toString(); + int updated; + try(PreparedStatement p=c.prepareStatement("UPDATE "+schema+"HMI_APP_PREF SET PREFS_JSON=?,UPDATED_AT=? WHERE SCOPE_TYPE=? AND SCOPE_ID=?")){ + p.setCharacterStream(1,new StringReader(json),json.length());p.setTimestamp(2,new Timestamp(System.currentTimeMillis()));p.setString(3,"PAGE_ACCESS");p.setString(4,id);updated=p.executeUpdate(); + } + if(updated==0)try(PreparedStatement p=c.prepareStatement("INSERT INTO "+schema+"HMI_APP_PREF(SCOPE_TYPE,SCOPE_ID,PREFS_JSON,UPDATED_AT) VALUES(?,?,?,?)")){ + p.setString(1,"PAGE_ACCESS");p.setString(2,id);p.setCharacterStream(3,new StringReader(json),json.length());p.setTimestamp(4,new Timestamp(System.currentTimeMillis()));p.executeUpdate(); + } + } + static boolean allows(Set granted,JSONArray required){ + if(granted.contains("hmi-admin")||required.length()==0)return true; + for(int i=0;i pages,Set granted){ + Set seen=new HashSet<>(); + while(id!=null){ + if(!seen.add(id))return false; + JSONObject page=pages.get(id); + if(page==null || !page.getBoolean("enabled") || !allows(granted,page.getJSONArray("visibleToRoles")))return false; + id=page.isNull("parentPageId")?null:page.optString("parentPageId",null); + } + return true; + } +} diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiRolesResource.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiRolesResource.java index e6aa168..f0a1ac4 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiRolesResource.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiRolesResource.java @@ -29,7 +29,7 @@ import org.json.JSONObject; public class HmiRolesResource { @Context private HttpServletRequest request; private static final DBService MES = new DBService("dsMesMiiNJTA"); - private static final String[] BUILTINS = {"hmi-admin", "hmi-designer", "hmi-publisher", "hmi-script-editor"}; + private static final String[] BUILTINS = {"hmi-admin", "hmi-designer", "hmi-publisher", "hmi-script-editor", "hmi-workplace"}; private Response json(Object o) { return Response.ok(o.toString(),MediaType.APPLICATION_JSON).header("Cache-Control","no-store").build(); } private Response fail(int n,String msg) { return Response.status(n).type(MediaType.APPLICATION_JSON).entity(new JSONObject().put("error",msg).toString()).build(); } private Response verify(boolean write) { @@ -98,7 +98,7 @@ public class HmiRolesResource { Response r=verify(false);if(r!=null)return r; JSONObject all=new JSONObject();for(String builtin:BUILTINS)all.put(builtin,builtin); try(Connection c=HmiDb.open();PreparedStatement p=c.prepareStatement("SELECT ROLE_KEY,DESCRIPTION FROM "+pref()+"HMI_APP_ROLE ORDER BY ROLE_KEY");ResultSet rs=p.executeQuery()) { - while(rs.next())all.put(rs.getString(1),rs.getString(2)); + while(rs.next())all.put(rs.getString(1),rs.getString(2)==null?"":rs.getString(2)); JSONArray out=new JSONArray();for(String k:all.keySet())out.put(new JSONObject().put("key",k).put("description",all.getString(k))); return json(out); }catch(SQLException e){return error(e);} diff --git a/backend/src/main/webapp/hmi/assets/index-BJmLIY-E.js b/backend/src/main/webapp/hmi/assets/index-BJmLIY-E.js new file mode 100644 index 0000000..aec603a --- /dev/null +++ b/backend/src/main/webapp/hmi/assets/index-BJmLIY-E.js @@ -0,0 +1,15 @@ +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const r of n)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function i(n){const r={};return n.integrity&&(r.integrity=n.integrity),n.referrerPolicy&&(r.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?r.credentials="include":n.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function s(n){if(n.ep)return;n.ep=!0;const r=i(n);fetch(n.href,r)}})();function kn(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const De={},pi=[],Lt=()=>{},zr=()=>!1,xs=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Ps=t=>t.startsWith("onUpdate:"),Ke=Object.assign,Cn=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},xl=Object.prototype.hasOwnProperty,ke=(t,e)=>xl.call(t,e),ce=Array.isArray,si=t=>Ci(t)==="[object Map]",Yt=t=>Ci(t)==="[object Set]",er=t=>Ci(t)==="[object Date]",ve=t=>typeof t=="function",Fe=t=>typeof t=="string",St=t=>typeof t=="symbol",Pe=t=>t!==null&&typeof t=="object",Hr=t=>(Pe(t)||ve(t))&&ve(t.then)&&ve(t.catch),Wr=Object.prototype.toString,Ci=t=>Wr.call(t),Pl=t=>Ci(t).slice(8,-1),Vr=t=>Ci(t)==="[object Object]",Tn=t=>Fe(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Di=kn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Il=1e4,Is=t=>{let e=Object.create(null),i=0;return(s=>{const n=e[s];return n!==void 0?n:(++i>Il&&(e=Object.create(null),i=1),e[s]=t(s))})},Ll=/-\w/g,at=Is(t=>t.replace(Ll,e=>e.slice(1).toUpperCase())),Dl=/\B([A-Z])/g,mi=Is(t=>t.replace(Dl,"-$1").toLowerCase()),Ls=Is(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ks=Is(t=>t?`on${Ls(t)}`:""),Pt=(t,e)=>!Object.is(t,e),fs=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:i})},ts=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let tr;const Ds=()=>tr||(tr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function yt(t){if(ce(t)){const e={};for(let i=0;ii.startsWith("/*")?"":i).split(Ul).forEach(i=>{if(i){const s=i.split(Bl);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function xe(t){let e="";if(Fe(t))e=t;else if(ce(t))for(let i=0;iqt(i,e))}function nr(t){return Object.getPrototypeOf(t)===null&&t[Symbol.toPrimitive]==null&&typeof t.toString!="function"&&typeof t.valueOf!="function"?Ci(t):String(t)}const jr=t=>!!(t&&t.__v_isRef===!0),E=t=>Fe(t)?t:t==null?"":ce(t)||Pe(t)&&(t.toString===Wr||!ve(t.toString))?jr(t)?E(t.value):JSON.stringify(t,Jr,2):String(t),Jr=(t,e)=>jr(e)?Jr(t,e.value):si(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[s,n],r)=>(i[Gs(s,r)+" =>"]=n,i),{})}:Yt(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>Gs(i))}:St(e)?Gs(e):Pe(e)&&!ce(e)&&!Vr(e)?String(e):e,Gs=(t,e="")=>{var i;return St(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};let je;class Kl{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&je&&(je.active?(this.parent=je,this.index=(je.scopes||(je.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes){const s=this.scopes.slice();for(e=0,i=s.length;e0&&--this._on===0){if(je===this)je=this.prevScope;else{let e=je;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let i,s;for(i=0,s=this.effects.length;i0)return;if(Bi){let e=Bi;for(Bi=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Ui;){let e=Ui;for(Ui=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=i}}if(t)throw t}function Qr(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Zr(t){let e,i=t.depsTail,s=i;for(;s;){const n=s.prevDep;s.version===-1?(s===i&&(i=n),xn(s),jl(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=n}t.deps=e,t.depsTail=i}function on(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(eo(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function eo(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ki)||(t.globalVersion=Ki,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!on(t))))return;t.flags|=2;const e=t.dep,i=Ue,s=Et;Ue=t,Et=!0;try{Qr(t);const n=t.fn(t._value);(e.version===0||Pt(n,t._value))&&(t.flags|=128,t._value=n,e.version++)}catch(n){throw e.version++,n}finally{Ue=i,Et=s,Zr(t),t.flags&=-3}}function xn(t,e=!1){const{dep:i,prevSub:s,nextSub:n}=t;if(s&&(s.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=s,t.nextSub=void 0),i.subs===t&&(i.subs=s,!s&&i.computed)){i.computed.flags&=-5;for(let r=i.computed.deps;r;r=r.nextDep)xn(r,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function jl(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let Et=!0;const to=[];function Dt(){to.push(Et),Et=!1}function Ut(){const t=to.pop();Et=t===void 0?!0:t}function rr(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=Ue;Ue=void 0;try{e()}finally{Ue=i}}}let Ki=0;class Jl{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Pn{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Ue||!Et||Ue===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==Ue)i=this.activeLink=new Jl(Ue,this),Ue.deps?(i.prevDep=Ue.depsTail,Ue.depsTail.nextDep=i,Ue.depsTail=i):Ue.deps=Ue.depsTail=i,io(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const s=i.nextDep;s.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=s),i.prevDep=Ue.depsTail,i.nextDep=void 0,Ue.depsTail.nextDep=i,Ue.depsTail=i,Ue.deps===i&&(Ue.deps=s)}return i}trigger(e){this.version++,Ki++,this.notify(e)}notify(e){Mn();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{On()}}}function io(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)io(s)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const ln=new WeakMap,gi=Symbol(""),an=Symbol(""),Gi=Symbol("");function tt(t,e,i){if(Et&&Ue){let s=ln.get(t);s||ln.set(t,s=new Map);let n=s.get(i);n||(s.set(i,n=new Pn),n.map=s,n.key=i),n.track()}}function Vt(t,e,i,s,n,r){const o=ln.get(t);if(!o){Ki++;return}const l=u=>{u&&u.trigger()};if(Mn(),e==="clear")o.forEach(l);else{const u=ce(t),d=u&&Tn(i);if(u&&i==="length"){const c=Number(s);o.forEach((h,v)=>{(v==="length"||v===Gi||!St(v)&&v>=c)&&l(h)})}else switch((i!==void 0||o.has(void 0))&&l(o.get(i)),d&&l(o.get(Gi)),e){case"add":u?d&&l(o.get("length")):(l(o.get(gi)),si(t)&&l(o.get(an)));break;case"delete":u||(l(o.get(gi)),si(t)&&l(o.get(an)));break;case"set":si(t)&&l(o.get(gi));break}}On()}function wi(t){const e=Te(t);return e===t||(tt(e,"iterate",Gi),pt(t))?e:Bt(t)?ni(t)?e.map(i=>oi(mt(i))):e.map(oi):e.map(mt)}function Us(t){return tt(t=Te(t),"iterate",Gi),t}function Mt(t,e){return Bt(t)?oi(ni(t)?mt(e):e):mt(e)}const Yl={__proto__:null,[Symbol.iterator](){return Js(this,Symbol.iterator,t=>Mt(this,t))},concat(...t){return wi(this).concat(...t.map(e=>ce(e)?wi(e):e))},entries(){return Js(this,"entries",t=>(t[1]=Mt(this,t[1]),t))},every(t,e){return zt(this,"every",t,e,void 0,arguments)},filter(t,e){return zt(this,"filter",t,e,i=>i.map(s=>Mt(this,s)),arguments)},find(t,e){return zt(this,"find",t,e,i=>Mt(this,i),arguments)},findIndex(t,e){return zt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return zt(this,"findLast",t,e,i=>Mt(this,i),arguments)},findLastIndex(t,e){return zt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return zt(this,"forEach",t,e,void 0,arguments)},includes(...t){return Ys(this,"includes",t)},indexOf(...t){return Ys(this,"indexOf",t)},join(t){return wi(this).join(t)},lastIndexOf(...t){return Ys(this,"lastIndexOf",t)},map(t,e){return zt(this,"map",t,e,void 0,arguments)},pop(){return Mi(this,"pop")},push(...t){return Mi(this,"push",t)},reduce(t,...e){return lr(this,"reduce",t,e)},reduceRight(t,...e){return lr(this,"reduceRight",t,e)},shift(){return Mi(this,"shift")},some(t,e){return zt(this,"some",t,e,void 0,arguments)},splice(...t){return Mi(this,"splice",t)},toReversed(){return wi(this).toReversed()},toSorted(t){return wi(this).toSorted(t)},toSpliced(...t){return wi(this).toSpliced(...t)},unshift(...t){return Mi(this,"unshift",t)},values(){return Js(this,"values",t=>Mt(this,t))}};function Js(t,e,i){const s=Us(t),n=s[e],r=n.call(s);if(s!==t&&!pt(t)){if(r[Symbol.toStringTag]==="Array Iterator"){const o=Object.create(Object.getPrototypeOf(r));return o.next=()=>or(r.next(),i),n!==so[e]&&Object.defineProperties(o,{return:{get(){const l=r.return;return typeof l=="function"?l.bind(r):l}},throw:{get(){const l=r.throw;return typeof l=="function"?l.bind(r):l}}}),o}r._next=r.next,r.next=()=>or(r._next(),i)}return r}function or(t,e){return t.done||(t.value=e(t.value)),t}const so=Array.prototype;function zt(t,e,i,s,n,r){const o=Us(t),l=o!==t&&!pt(t),u=o[e];if(u!==so[e]){const h=u.apply(t,r);return l?mt(h):h}let d=i;o!==t&&(l?d=function(h,v){return i.call(this,Mt(t,h),v,t)}:i.length>2&&(d=function(h,v){return i.call(this,h,v,t)}));const c=u.call(o,d,s);return l&&n?n(c):c}function lr(t,e,i,s){const n=Us(t),r=n!==t&&!pt(t);let o=i,l=!1;n!==t&&(r?(l=s.length===0,o=function(d,c,h){return l&&(l=!1,d=Mt(t,d)),i.call(this,d,Mt(t,c),h,t)}):i.length>3&&(o=function(d,c,h){return i.call(this,d,c,h,t)}));const u=n[e](o,...s);return l?Mt(t,u):u}function Ys(t,e,i){const s=Te(t);tt(s,"iterate",Gi);const n=s[e](...i);return(n===-1||n===!1)&&Un(i[0])?(i[0]=Te(i[0]),s[e](...i)):n}function Mi(t,e,i=[]){Dt(),Mn();const s=Te(t)[e].apply(t,i);return On(),Ut(),s}const ql=kn("__proto__,__v_isRef,__isVue"),no=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(St));function Xl(t){St(t)||(t=String(t));const e=Te(this);return tt(e,"has",t),e.hasOwnProperty(t)}class ro{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,s){if(i==="__v_skip")return e.__v_skip;const n=this._isReadonly,r=this._isShallow;if(i==="__v_isReactive")return!n;if(i==="__v_isReadonly")return n;if(i==="__v_isShallow")return r;if(i==="__v_raw")return s===(n?r?la:uo:r?ao:lo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=ce(e);if(!n){let u;if(o&&(u=Yl[i]))return u;if(i==="hasOwnProperty")return Xl}const l=Reflect.get(e,i,st(e)?e:s);if((St(i)?no.has(i):ql(i))||(n||tt(e,"get",i),r))return l;if(st(l)){const u=o&&Tn(i)?l:l.value;return n&&Pe(u)?cn(u):u}return Pe(l)?n?cn(l):Ln(l):l}}class oo extends ro{constructor(e=!1){super(!1,e)}set(e,i,s,n){let r=e[i];const o=ce(e)&&Tn(i);if(!this._isShallow){const d=Bt(r);if(!pt(s)&&!Bt(s)&&(r=Te(r),s=Te(s)),!o&&st(r)&&!st(s))return d||(r.value=s),!0}const l=o?Number(i)t,os=t=>Reflect.getPrototypeOf(t);function ia(t,e,i){return function(...s){const n=this.__v_raw,r=Te(n),o=si(r),l=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,d=n[t](...s),c=i?un:e?oi:mt;return!e&&tt(r,"iterate",u?an:gi),Ke(Object.create(d),{next(){const{value:h,done:v}=d.next();return v?{value:h,done:v}:{value:l?[c(h[0]),c(h[1])]:c(h),done:v}}})}}function ls(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function sa(t,e){const i={get(n){const r=this.__v_raw,o=Te(r),l=Te(n);t||(Pt(n,l)&&tt(o,"get",n),tt(o,"get",l));const{has:u}=os(o),d=e?un:t?oi:mt;if(u.call(o,n))return d(r.get(n));if(u.call(o,l))return d(r.get(l));r!==o&&r.get(n)},get size(){const n=this.__v_raw;return!t&&tt(Te(n),"iterate",gi),n.size},has(n){const r=this.__v_raw,o=Te(r),l=Te(n);return t||(Pt(n,l)&&tt(o,"has",n),tt(o,"has",l)),n===l?r.has(n):r.has(n)||r.has(l)},forEach(n,r){const o=this,l=o.__v_raw,u=Te(l),d=e?un:t?oi:mt;return!t&&tt(u,"iterate",gi),l.forEach((c,h)=>n.call(r,d(c),d(h),o))}};return Ke(i,t?{add:ls("add"),set:ls("set"),delete:ls("delete"),clear:ls("clear")}:{add(n){const r=Te(this),o=os(r),l=Te(n),u=!e&&!pt(n)&&!Bt(n)?l:n;return o.has.call(r,u)||Pt(n,u)&&o.has.call(r,n)||Pt(l,u)&&o.has.call(r,l)||(r.add(u),Vt(r,"add",u,u)),this},set(n,r){!e&&!pt(r)&&!Bt(r)&&(r=Te(r));const o=Te(this),{has:l,get:u}=os(o);let d=l.call(o,n);d||(n=Te(n),d=l.call(o,n));const c=u.call(o,n);return o.set(n,r),d?Pt(r,c)&&Vt(o,"set",n,r):Vt(o,"add",n,r),this},delete(n){const r=Te(this),{has:o,get:l}=os(r);let u=o.call(r,n);u||(n=Te(n),u=o.call(r,n)),l&&l.call(r,n);const d=r.delete(n);return u&&Vt(r,"delete",n,void 0),d},clear(){const n=Te(this),r=n.size!==0,o=n.clear();return r&&Vt(n,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(n=>{i[n]=ia(n,t,e)}),i}function In(t,e){const i=sa(t,e);return(s,n,r)=>n==="__v_isReactive"?!t:n==="__v_isReadonly"?t:n==="__v_isShallow"?e:n==="__v_raw"?s:Reflect.get(ke(i,n)&&n in s?i:s,n,r)}const na={get:In(!1,!1)},ra={get:In(!1,!0)},oa={get:In(!0,!1)};const lo=new WeakMap,ao=new WeakMap,uo=new WeakMap,la=new WeakMap;function aa(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ln(t){return Bt(t)?t:Dn(t,!1,Zl,na,lo)}function ua(t){return Dn(t,!1,ta,ra,ao)}function cn(t){return Dn(t,!0,ea,oa,uo)}function Dn(t,e,i,s,n){if(!Pe(t)||t.__v_raw&&!(e&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const r=n.get(t);if(r)return r;const o=aa(Pl(t));if(o===0)return t;const l=new Proxy(t,o===2?s:i);return n.set(t,l),l}function ni(t){return Bt(t)?ni(t.__v_raw):!!(t&&t.__v_isReactive)}function Bt(t){return!!(t&&t.__v_isReadonly)}function pt(t){return!!(t&&t.__v_isShallow)}function Un(t){return t?!!t.__v_raw:!1}function Te(t){const e=t&&t.__v_raw;return e?Te(e):t}function ca(t){return!ke(t,"__v_skip")&&Object.isExtensible(t)&&Kr(t,"__v_skip",!0),t}const mt=t=>Pe(t)?Ln(t):t,oi=t=>Pe(t)?cn(t):t;function st(t){return t?t.__v_isRef===!0:!1}function S(t){return da(t,!1)}function da(t,e){return st(t)?t:new fa(t,e)}class fa{constructor(e,i){this.dep=new Pn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Te(e),this._value=i?e:mt(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,s=this.__v_isShallow||pt(e)||Bt(e);e=s?e:Te(e),Pt(e,i)&&(this._rawValue=e,this._value=s?e:mt(e),this.dep.trigger())}}function Je(t){return st(t)?t.value:t}const ha={get:(t,e,i)=>e==="__v_raw"?t:Je(Reflect.get(t,e,i)),set:(t,e,i,s)=>{const n=t[e];return st(n)&&!st(i)?(n.value=i,!0):Reflect.set(t,e,i,s)}};function co(t){return ni(t)?t:new Proxy(t,ha)}class pa{constructor(e,i,s){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Pn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ki-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Ue!==this)return Xr(this,!0),!0}get value(){const e=this.dep.track();return eo(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function ga(t,e,i=!1){let s,n;return ve(t)?s=t:(s=t.get,n=t.set),new pa(s,n,i)}const as={},vs=new WeakMap;let di;function ma(t,e=!1,i=di){if(i){let s=vs.get(i);s||vs.set(i,s=[]),s.push(t)}}function va(t,e,i=De){const{immediate:s,deep:n,once:r,scheduler:o,augmentJob:l,call:u}=i,d=L=>n?L:pt(L)||n===!1||n===0?Kt(L,1):Kt(L);let c,h,v,R,k=!1,C=!1;if(st(t)?(h=()=>t.value,k=pt(t)):ni(t)?(h=()=>d(t),k=!0):ce(t)?(C=!0,k=t.some(L=>ni(L)||pt(L)),h=()=>t.map(L=>{if(st(L))return L.value;if(ni(L))return d(L);if(ve(L))return u?u(L,2):L()})):ve(t)?e?h=u?()=>u(t,2):t:h=()=>{if(v){Dt();try{v()}finally{Ut()}}const L=di;di=c;try{return u?u(t,3,[R]):t(R)}finally{di=L}}:h=Lt,e&&n){const L=h,Z=n===!0?1/0:n;h=()=>Kt(L(),Z)}const P=Gl(),B=()=>{c.stop(),P&&P.active&&Cn(P.effects,c)};if(r&&e){const L=e;e=(...Z)=>{try{return L(...Z)}finally{B()}}}let D=C?new Array(t.length).fill(as):as;const re=L=>{if(!(!(c.flags&1)||!c.dirty&&!L))if(e){const Z=c.run();if(L||n||k||(C?Z.some((X,ie)=>Pt(X,D[ie])):Pt(Z,D))){const X=di;Dt();try{v&&v(),di=c;const ie=[Z,D===as?void 0:C&&D[0]===as?[]:D,R];D=Z,u?u(e,3,ie):e(...ie)}finally{di=X,Ut()}}}else c.run()};return l&&l(re),c=new Yr(h),c.scheduler=o?()=>o(re,!1):re,R=L=>ma(L,!1,c),v=c.onStop=()=>{const L=vs.get(c);if(L){if(u)u(L,4);else for(const Z of L)Z();vs.delete(c)}},e?s?re(!0):D=c.run():o?o(re.bind(null,!0),!0):c.run(),B.pause=c.pause.bind(c),B.resume=c.resume.bind(c),B.stop=B,B}function Kt(t,e=1/0,i){if(e<=0||!Pe(t)||t.__v_skip||(i=i||new Map,(i.get(t)||0)>=e))return t;if(i.set(t,e),e--,st(t))Kt(t.value,e,i);else if(ce(t))for(let s=0;s{Kt(s,e,i)});else if(Vr(t)){for(const s in t)Kt(t[s],e,i);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Kt(t[s],e,i)}return t}function is(t,e,i,s){try{return s?t(...s):t()}catch(n){Bs(n,e,i)}}function Rt(t,e,i,s){if(ve(t)){const n=is(t,e,i,s);return n&&Hr(n)&&n.catch(r=>{Bs(r,e,i,void 0,!0)}),n}if(ce(t)){const n=[];for(let r=0;r>>1,n=lt[s],r=ji(n);r=ji(i)?lt.push(t):lt.splice(ya(e),0,t),t.flags|=1,ho()}}function ho(){bs||(bs=fo.then(mo))}function wa(t){if(!ce(t))ei&&t.id===-1?ei.splice(Ei+1,0,t):t.flags&1||(Ot.push(t),t.flags|=1);else for(let e=0;e=e))continue;lt.splice(s,1),s=t?s-1:bt,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function go(t,e,i=0){if(Ot.length){let s=Ot,n=0;if(e){s=[];for(let o=0;oji(o)-ji(l));if(Ot.length=n,ei){for(let o=0;ot.id==null?t.flags&2?-1:1/0:t.id;function mo(t){try{for(bt=0;bt{s._d&&Er(-1);const r=ws(e),o=Jt.length;let l;try{l=t(...n)}finally{for(let u=Jt.length;u>o;u--)Vn();ws(r),s._d&&Er(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function ae(t,e){if(Ye===null)return t;const i=Ws(Ye),s=t.dirs||(t.dirs=[]);for(let n=0;n1)return i&&ve(e)?e.call(s&&s.proxy):e}}const Sa=Symbol.for("v-scx"),Ra=()=>hs(Sa);function nt(t,e,i){return yo(t,e,i)}function yo(t,e,i=De){const{immediate:s,deep:n,flush:r,once:o}=i,l=Ke({},i),u=e&&s||!e&&r!=="post";let d;if(Xi){if(r==="sync"){const R=Ra();d=R.__watcherHandles||(R.__watcherHandles=[])}else if(!u){const R=()=>{};return R.stop=Lt,R.resume=Lt,R.pause=Lt,R}}const c=it;l.call=(R,k,C)=>Rt(R,c,k,C);let h=!1;r==="post"?l.scheduler=R=>{R.i=c,Ze(R,c&&c.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(R,k)=>{k?R():Bn(R)}),l.augmentJob=R=>{e&&(R.flags|=4),h&&(R.flags|=2,c&&(R.id=c.uid,R.i=c))};const v=va(t,e,l);return Xi&&(d?d.push(v):u&&v()),v}function Aa(t,e,i){const s=this.proxy,n=Fe(t)?t.includes(".")?wo(s,t):()=>s[t]:t.bind(s,s);let r;ve(e)?r=e:(r=e.handler,i=e);const o=ss(this),l=yo(n,r.bind(s),i);return o(),l}function wo(t,e){const i=e.split(".");return()=>{let s=t;for(let n=0;nt.__isTeleport,fi=t=>t&&(t.disabled||t.disabled===""),ka=t=>t&&(t.defer||t.defer===""),ar=t=>typeof SVGElement<"u"&&t instanceof SVGElement,ur=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,dn=(t,e)=>{const i=t&&t.to;return Fe(i)?e?e(i):null:i},Ca={name:"Teleport",__isTeleport:!0,process(t,e,i,s,n,r,o,l,u,d){const{mc:c,pc:h,pbc:v,o:{insert:R,querySelector:k,createText:C,createComment:P,parentNode:B}}=d,D=fi(e.props);let{dynamicChildren:re}=e;const L=(ie,ee,le)=>{ie.shapeFlag&16&&c(ie.children,ee,le,n,r,o,l,u)},Z=(ie=e)=>{const ee=fi(ie.props),le=ie.target=dn(ie.props,k),fe=fn(le,ie,C,R);le&&(o!=="svg"&&ar(le)?o="svg":o!=="mathml"&&ur(le)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(le),ee||(L(ie,le,fe),Pi(ie,!1)))},X=ie=>{const ee=()=>{if(Zt.get(ie)===ee){if(Zt.delete(ie),fi(ie.props)){const le=B(ie.el)||i;L(ie,le,ie.anchor),Pi(ie,!0)}Z(ie)}};Zt.set(ie,ee),Ze(ee,r)};if(t==null){const ie=e.el=C(""),ee=e.anchor=C("");if(R(ie,i,s),R(ee,i,s),ka(e.props)||r&&r.pendingBranch){X(e);return}D&&(L(e,i,ee),Pi(e,!0)),Z()}else{e.el=t.el;const ie=e.anchor=t.anchor,ee=Zt.get(t);if(ee){ee.flags|=8,Zt.delete(t),X(e);return}e.targetStart=t.targetStart;const le=e.target=t.target,fe=e.targetAnchor=t.targetAnchor,me=fi(t.props),he=me?i:le,J=me?ie:fe;if(o==="svg"||ar(le)?o="svg":(o==="mathml"||ur(le))&&(o="mathml"),re?(v(t.dynamicChildren,re,he,n,r,o,l),Wn(t,e,!0)):u||h(t,e,he,J,n,r,o,l,!1),D)me?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):us(e,i,ie,d,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const M=dn(e.props,k);M&&(e.target=M,us(e,M,null,d,0))}else me&&us(e,le,fe,d,1);Pi(e,D)}},remove(t,e,i,{um:s,o:{remove:n}},r){const{shapeFlag:o,children:l,anchor:u,targetStart:d,targetAnchor:c,target:h,props:v}=t,R=fi(v),k=r||!R,C=Zt.get(t);if(C&&(C.flags|=8,Zt.delete(t)),h&&(n(d),n(c)),r&&n(u),!C&&(R||h)&&o&16)for(let P=0;P1){for(const i of t)if(i.type!==vt){e=i;break}}return e}function _o(t){if(!$n(t))return Fs(t.type)&&t.children?Na(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&ve(i.default))return i.default()}}function Fi(t,e){if(t.shapeFlag&6&&t.component){t.transition=e;const i=t.component.subTree;Fi(Fs(i.type)&&_o(i)||i,e)}else if(t.shapeFlag&128){const i=t.suspense;if(i){const s=i.isHydrating?i.pendingBranch:i.activeBranch;s&&Fi(s,e.clone(s))}else t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)}else if(t.transition=e,t.type===G&&ce(t.children)){const i=Oo(t.children,!1);i&&Fi(i,e)}}function hn(t){if(t.component)return hn(t.component.subTree);if(t.type===G){const e=ce(t.children)&&Oo(t.children,!1);return e?hn(e):void 0}if(t.type!==vt)return t}function He(t,e){return ve(t)?Ke({name:t.name},e,{setup:t}):t}function So(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function cr(t,e){let i;return!!((i=Object.getOwnPropertyDescriptor(t,e))&&!i.configurable)}const Es=new WeakMap;function $i(t,e,i,s,n=!1){if(ce(t)){t.forEach((C,P)=>$i(C,e&&(ce(e)?e[P]:e),i,s,n));return}if(Si(s)&&!n){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&$i(t,e,i,s.component.subTree);return}const r=s.shapeFlag&4?Ws(s.component):s.el,o=n?null:r,{i:l,r:u}=t,d=e&&e.r,c=l.refs===De?l.refs={}:l.refs,h=l.setupState,v=Te(h),R=h===De?zr:C=>cr(c,C)?!1:ke(v,C),k=(C,P)=>!(P&&cr(c,P));if(d!=null&&d!==u){if(dr(e),Fe(d))c[d]=null,R(d)&&(h[d]=null);else if(st(d)){const C=e;k(d,C.k)&&(d.value=null),C.k&&(c[C.k]=null)}}if(ve(u))is(u,l,12,[o,c]);else{const C=Fe(u),P=st(u);if(C||P){const B=()=>{if(t.f){const D=C?R(u)?h[u]:c[u]:k()||!t.k?u.value:c[t.k];if(n)ce(D)&&Cn(D,r);else if(ce(D))D.includes(r)||D.push(r);else if(C)c[u]=[r],R(u)&&(h[u]=c[u]);else{const re=[r];k(u,t.k)&&(u.value=re),t.k&&(c[t.k]=re)}}else C?(c[u]=o,R(u)&&(h[u]=o)):P&&(k(u,t.k)&&(u.value=o),t.k&&(c[t.k]=o))};if(o){const D=()=>{B(),Es.delete(t)};D.id=-1,Es.set(t,D),Ze(D,i)}else dr(t),B()}}}function dr(t){const e=Es.get(t);e&&(e.flags|=8,Es.delete(t))}Ds().requestIdleCallback;Ds().cancelIdleCallback;const Si=t=>!!t.type.__asyncLoader,$n=t=>t.type.__isKeepAlive;function Ma(t,e){Ro(t,"a",e)}function Oa(t,e){Ro(t,"da",e)}function Ro(t,e,i=it){const s=t.__wdc||(t.__wdc=()=>{let n=i;for(;n;){if(n.isDeactivated)return;n=n.parent}return t()});if(Ji(e,s,i),i){let n=i.parent;for(;n&&n.parent;)$n(n.parent.vnode)&&xa(s,e,i,n),n=n.parent}}function xa(t,e,i,s){const n=Ji(e,t,s,!0),r=Ji("um",()=>Cn(s[e],n),i);r.flags=16}function Ji(t,e,i=it,s=!1){if(i){const n=i[t]||(i[t]=[]),r=e.__weh||(e.__weh=(...o)=>{Dt();const l=ss(i),u=Rt(e,i,t,o);return l(),Ut(),u});return s?n.unshift(r):n.push(r),r}}const Xt=t=>(e,i=it)=>{(!Xi||t==="sp")&&Ji(t,(...s)=>e(...s),i)},Pa=Xt("bm"),Qt=Xt("m"),Ia=Xt("bu"),La=Xt("u"),vi=Xt("bum"),Da=Xt("um"),Ua=Xt("sp"),Ba=Xt("rtg"),Fa=Xt("rtc");function $a(t,e=it){Ji("ec",t,e)}const za="components";function Ao(t,e){return Wa(za,t,!0,e)||t}const Ha=Symbol.for("v-ndc");function Wa(t,e,i=!0,s=!1){const n=Ye||it;if(n){const r=n.type;{const l=Nu(r,!1);if(l&&(l===e||l===at(e)||l===Ls(at(e))))return r}const o=fr(n[t]||r[t],e)||fr(n.appContext[t],e);return!o&&s?r:o}}function fr(t,e){return t&&(t[e]||t[at(e)]||t[Ls(at(e))])}function ge(t,e,i,s){let n;const r=i,o=ce(t);if(o||Fe(t)){const l=o&&ni(t);let u=!1,d=!1;l&&(u=!pt(t),d=Bt(t),t=Us(t)),n=new Array(t.length);for(let c=0,h=t.length;ce(l,u,void 0,r));else{const l=Object.keys(t);n=new Array(l.length);for(let u=0,d=l.length;u0;return p(),Le(G,null,[gt("slot",d,s)],c?-2:64)}let o=t[e];o&&o._c&&(o._d=!1);const l=Jt.length;p();let u;try{const d=o&&ko(o(i)),c=i.key||r||d&&d.key;u=Le(G,{key:(c&&!St(c)?c:`_${e}`)+(!d&&s?"_fb":"")},d||(s?s():[]),d&&t._===1?64:-2)}catch(d){for(let c=Jt.length;c>l;c--)Vn();throw d}finally{o&&o._c&&(o._d=!0)}return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),u}function ko(t){return t.some(e=>Hs(e)?!(e.type===vt||e.type===G&&!ko(e.children)):!0)?t:null}const pn=t=>t?jo(t)?Ws(t):pn(t.parent):null,zi=Ke(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>pn(t.parent),$root:t=>pn(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>To(t),$forceUpdate:t=>t.f||(t.f=()=>{Bn(t.update)}),$nextTick:t=>t.n||(t.n=ys.bind(t.proxy)),$watch:t=>Aa.bind(t)}),Qs=(t,e)=>t!==De&&!t.__isScriptSetup&&ke(t,e),Ka={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:s,data:n,props:r,accessCache:o,type:l,appContext:u}=t;if(e[0]!=="$"){const v=o[e];if(v!==void 0)switch(v){case 1:return s[e];case 2:return n[e];case 4:return i[e];case 3:return r[e]}else{if(Qs(s,e))return o[e]=1,s[e];if(n!==De&&ke(n,e))return o[e]=2,n[e];if(ke(r,e))return o[e]=3,r[e];if(i!==De&&ke(i,e))return o[e]=4,i[e];gn&&(o[e]=0)}}const d=zi[e];let c,h;if(d)return e==="$attrs"&&tt(t.attrs,"get",""),d(t);if((c=l.__cssModules)&&(c=c[e]))return c;if(i!==De&&ke(i,e))return o[e]=4,i[e];if(h=u.config.globalProperties,ke(h,e))return h[e]},set({_:t},e,i){const{data:s,setupState:n,ctx:r}=t;return Qs(n,e)?(n[e]=i,!0):s!==De&&ke(s,e)?(s[e]=i,!0):ke(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(r[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:s,appContext:n,props:r,type:o}},l){let u;return!!(i[l]||t!==De&&l[0]!=="$"&&ke(t,l)||Qs(e,l)||ke(r,l)||ke(s,l)||ke(zi,l)||ke(n.config.globalProperties,l)||(u=o.__cssModules)&&u[l])},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:ke(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function hr(t){return ce(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}let gn=!0;function Ga(t){const e=To(t),i=t.proxy,s=t.ctx;gn=!1,e.beforeCreate&&pr(e.beforeCreate,t,"bc");const{data:n,computed:r,methods:o,watch:l,provide:u,inject:d,created:c,beforeMount:h,mounted:v,beforeUpdate:R,updated:k,activated:C,deactivated:P,beforeDestroy:B,beforeUnmount:D,destroyed:re,unmounted:L,render:Z,renderTracked:X,renderTriggered:ie,errorCaptured:ee,serverPrefetch:le,expose:fe,inheritAttrs:me,components:he,directives:J,filters:M}=e;if(d&&ja(d,s,null),o)for(const we in o){const Ee=o[we];ve(Ee)&&(s[we]=Ee.bind(i))}if(n){const we=n.call(i,i);Pe(we)&&(t.data=Ln(we))}if(gn=!0,r)for(const we in r){const Ee=r[we],Ve=ve(Ee)?Ee.bind(i,i):ve(Ee.get)?Ee.get.bind(i,i):Lt,qe=!ve(Ee)&&ve(Ee.set)?Ee.set.bind(i):Lt,te=se({get:Ve,set:qe});Object.defineProperty(s,we,{enumerable:!0,configurable:!0,get:()=>te.value,set:j=>te.value=j})}if(l)for(const we in l)Co(l[we],s,i,we);if(u){const we=ve(u)?u.call(i):u;Reflect.ownKeys(we).forEach(Ee=>{_a(Ee,we[Ee])})}c&&pr(c,t,"c");function H(we,Ee){ce(Ee)?Ee.forEach(Ve=>we(Ve.bind(i))):Ee&&we(Ee.bind(i))}if(H(Pa,h),H(Qt,v),H(Ia,R),H(La,k),H(Ma,C),H(Oa,P),H($a,ee),H(Fa,X),H(Ba,ie),H(vi,D),H(Da,L),H(Ua,le),ce(fe))if(fe.length){const we=t.exposed||(t.exposed={});fe.forEach(Ee=>{Object.defineProperty(we,Ee,{get:()=>i[Ee],set:Ve=>i[Ee]=Ve,enumerable:!0})})}else t.exposed||(t.exposed={});Z&&t.render===Lt&&(t.render=Z),me!=null&&(t.inheritAttrs=me),he&&(t.components=he),J&&(t.directives=J),le&&So(t)}function ja(t,e,i=Lt){ce(t)&&(t=mn(t));for(const s in t){const n=t[s];let r;Pe(n)?"default"in n?r=hs(n.from||s,n.default,!0):r=hs(n.from||s):r=hs(n),st(r)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[s]=r}}function pr(t,e,i){Rt(ce(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,i)}function Co(t,e,i,s){let n=s.includes(".")?wo(i,s):()=>i[s];if(Fe(t)){const r=e[t];ve(r)&&nt(n,r)}else if(ve(t))nt(n,t.bind(i));else if(Pe(t))if(ce(t))t.forEach(r=>Co(r,e,i,s));else{const r=ve(t.handler)?t.handler.bind(i):e[t.handler];ve(r)&&nt(n,r,t)}}function To(t){const e=t.type,{mixins:i,extends:s}=e,{mixins:n,optionsCache:r,config:{optionMergeStrategies:o}}=t.appContext,l=r.get(e);let u;return l?u=l:!n.length&&!i&&!s?u=e:(u={},n.length&&n.forEach(d=>_s(u,d,o,!0)),_s(u,e,o)),Pe(e)&&r.set(e,u),u}function _s(t,e,i,s=!1){const{mixins:n,extends:r}=e;r&&_s(t,r,i,!0),n&&n.forEach(o=>_s(t,o,i,!0));for(const o in e)if(!(s&&o==="expose")){const l=Ja[o]||i&&i[o];t[o]=l?l(t[o],e[o]):e[o]}return t}const Ja={data:gr,props:mr,emits:mr,methods:Ii,computed:Ii,beforeCreate:ot,created:ot,beforeMount:ot,mounted:ot,beforeUpdate:ot,updated:ot,beforeDestroy:ot,beforeUnmount:ot,destroyed:ot,unmounted:ot,activated:ot,deactivated:ot,errorCaptured:ot,serverPrefetch:ot,components:Ii,directives:Ii,watch:qa,provide:gr,inject:Ya};function gr(t,e){return e?t?function(){return Ke(ve(t)?t.call(this,this):t,ve(e)?e.call(this,this):e)}:e:t}function Ya(t,e){return Ii(mn(t),mn(e))}function mn(t){if(ce(t)){const e={};for(let i=0;ie==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${at(e)}Modifiers`]||t[`${mi(e)}Modifiers`];function eu(t,e,...i){if(t.isUnmounted)return;const s=t.vnode.props||De;let n=i;const r=e.startsWith("update:"),o=r&&Za(s,e.slice(7));o&&(o.trim&&(n=i.map(c=>Fe(c)?c.trim():c)),o.number&&(n=n.map(ts)));let l,u=s[l=Ks(e)]||s[l=Ks(at(e))];!u&&r&&(u=s[l=Ks(mi(e))]),u&&Rt(u,t,6,n);const d=s[l+"Once"];if(d){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,Rt(d,t,6,n)}}const tu=new WeakMap;function Mo(t,e,i=!1){const s=i?tu:e.emitsCache,n=s.get(t);if(n!==void 0)return n;const r=t.emits;let o={},l=!1;if(!ve(t)){const u=d=>{const c=Mo(d,e,!0);c&&(l=!0,Ke(o,c))};!i&&e.mixins.length&&e.mixins.forEach(u),t.extends&&u(t.extends),t.mixins&&t.mixins.forEach(u)}return!r&&!l?(Pe(t)&&s.set(t,null),null):(ce(r)?r.forEach(u=>o[u]=null):Ke(o,r),Pe(t)&&s.set(t,o),o)}function $s(t,e){return!t||!xs(e)?!1:(e=e.slice(2),e=e==="Once"?e:e.replace(/Once$/,""),ke(t,e[0].toLowerCase()+e.slice(1))||ke(t,mi(e))||ke(t,e))}function vr(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:l,emit:u,render:d,renderCache:c,props:h,data:v,setupState:R,ctx:k,inheritAttrs:C}=t,P=ws(t);let B,D;try{if(i.shapeFlag&4){const L=n||s,Z=L;B=xt(d.call(Z,L,c,h,R,v,k)),D=l}else{const L=e;B=xt(L.length>1?L(h,{attrs:l,slots:o,emit:u}):L(h,null)),D=e.props?l:iu(l)}}catch(L){Jt.length=0,Bs(L,t,1),B=gt(vt)}let re=B;if(D&&C!==!1){const L=Object.keys(D),{shapeFlag:Z}=re;L.length&&Z&7&&(r&&L.some(Ps)&&(D=su(D,r)),re=Ai(re,D,!1,!0))}if(i.dirs&&(re=Ai(re,null,!1,!0),re.dirs=re.dirs?re.dirs.concat(i.dirs):i.dirs),i.transition){const L=Fs(re.type)&&_o(re)||re;Fi(L,i.transition)}return B=re,ws(P),B}function Oo(t,e=!0){let i;for(let s=0;s{let e;for(const i in t)(i==="class"||i==="style"||xs(i))&&((e||(e={}))[i]=t[i]);return e},su=(t,e)=>{const i={};for(const s in t)(!Ps(s)||!(s.slice(9)in e))&&(i[s]=t[s]);return i};function nu(t,e,i){const{props:s,children:n,component:r}=t,{props:o,children:l,patchFlag:u}=e,d=r.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&u>=0){if(u&1024)return!0;if(u&16)return s?br(s,o,d):!!o;if(u&8){const c=e.dynamicProps;for(let h=0;hObject.create(Po),Lo=t=>Object.getPrototypeOf(t)===Po;function ou(t,e,i,s=!1){const n={},r=Io();t.propsDefaults=Object.create(null),Do(t,e,n,r);for(const o in t.propsOptions[0])o in n||(n[o]=void 0);i?t.props=s?n:ua(n):t.type.props?t.props=n:t.props=r,t.attrs=r}function lu(t,e,i,s){const{props:n,attrs:r,vnode:{patchFlag:o}}=t,l=Te(n),[u]=t.propsOptions;let d=!1;if((s||o>0)&&!(o&16)){if(o&8){const c=t.vnode.dynamicProps;for(let h=0;h{u=!0;const[v,R]=Uo(h,e,!0);Ke(o,v),R&&l.push(...R)};!i&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}if(!r&&!u)return Pe(t)&&s.set(t,pi),pi;if(ce(r))for(let c=0;ct==="_"||t==="_ctx"||t==="$stable",Hn=t=>ce(t)?t.map(xt):[xt(t)],uu=(t,e,i)=>{if(e._n)return e;const s=bo((...n)=>Hn(e(...n)),i);return s._c=!1,s},Bo=(t,e,i)=>{const s=t._ctx;for(const n in t){if(zn(n))continue;const r=t[n];if(ve(r))e[n]=uu(n,r,s);else if(r!=null){const o=Hn(r);e[n]=()=>o}}},Fo=(t,e)=>{const i=Hn(e);t.slots.default=()=>i},$o=(t,e,i)=>{for(const s in e)(i||!zn(s))&&(t[s]=e[s])},cu=(t,e,i)=>{const s=t.slots=Io();if(t.vnode.shapeFlag&32){const n=e._;n?($o(s,e,i),i&&Kr(s,"_",n,!0)):Bo(e,s)}else e&&Fo(t,e)},du=(t,e,i)=>{const{vnode:s,slots:n}=t;let r=!0,o=De;if(s.shapeFlag&32){const l=e._;l?i&&l===1?r=!1:$o(n,e,i):(r=!e.$stable,Bo(e,n)),o=e}else e&&(Fo(t,e),o={default:1});if(r)for(const l in n)!zn(l)&&o[l]==null&&delete n[l]},Ze=vu;function fu(t){return hu(t)}function hu(t,e){const i=Ds();i.__VUE__=!0;const{insert:s,remove:n,patchProp:r,createElement:o,createText:l,createComment:u,setText:d,setElementText:c,parentNode:h,nextSibling:v,setScopeId:R=Lt,insertStaticContent:k}=t,C=(g,y,O,$=null,I=null,U=null,K=void 0,V=null,T=!!y.dynamicChildren)=>{if(g===y)return;g&&!Oi(g,y)&&($=Ge(g),j(g,I,U,!0),g=null),y.patchFlag===-2&&(T=!1,y.dynamicChildren=null),y.dynamicChildren&&g&&g.dynamicChildren&&g.dynamicChildren.hasOnce&&(y.dynamicChildren===pi&&(y.dynamicChildren=[]),y.dynamicChildren.hasOnce=!0);const{type:b,ref:A,shapeFlag:x}=y;switch(b){case zs:P(g,y,O,$);break;case vt:B(g,y,O,$);break;case ps:g==null&&D(y,O,$,K);break;case G:he(g,y,O,$,I,U,K,V,T);break;default:x&1?Z(g,y,O,$,I,U,K,V,T):x&6?J(g,y,O,$,I,U,K,V,T):(x&64||x&128)&&b.process(g,y,O,$,I,U,K,V,T,Xe)}A!=null&&I?$i(A,g&&g.ref,U,y||g,!y):A==null&&g&&g.ref!=null&&$i(g.ref,null,U,g,!0)},P=(g,y,O,$)=>{if(g==null)s(y.el=l(y.children),O,$);else{const I=y.el=g.el;y.children!==g.children&&d(I,y.children)}},B=(g,y,O,$)=>{g==null?s(y.el=u(y.children||""),O,$):y.el=g.el},D=(g,y,O,$)=>{[g.el,g.anchor]=k(g.children,y,O,$,g.el,g.anchor)},re=({el:g,anchor:y},O,$)=>{let I;for(;g&&g!==y;)I=v(g),s(g,O,$),g=I;s(y,O,$)},L=({el:g,anchor:y})=>{let O;for(;g&&g!==y;)O=v(g),n(g),g=O;n(y)},Z=(g,y,O,$,I,U,K,V,T)=>{if(y.type==="svg"?K="svg":y.type==="math"&&(K="mathml"),g==null)X(y,O,$,I,U,K,V,T);else{const b=g.el&&g.el._isVueCE?g.el:null;try{b&&b._beginPatch(),le(g,y,I,U,K,V,T)}finally{b&&b._endPatch()}}},X=(g,y,O,$,I,U,K,V)=>{let T,b;const{props:A,shapeFlag:x,transition:Y,dirs:de}=g;if(T=g.el=o(g.type,U,A&&A.is,A),x&8?c(T,g.children):x&16&&ee(g.children,T,null,$,I,Zs(g,U),K,V),de&&ui(g,null,$,"created"),ie(T,g,g.scopeId,K,$),A){for(const pe in A)pe!=="value"&&!Di(pe)&&r(T,pe,null,A[pe],U,$);"value"in A&&r(T,"value",null,A.value,U),(b=A.onVnodeBeforeMount)&&Nt(b,$,g)}de&&ui(g,null,$,"beforeMount");const _e=pu(I,Y);_e?Y.beforeEnter(T):Y&&!Y.persisted&&(T[mu]=!0),s(T,y,O),((b=A&&A.onVnodeMounted)||_e||de)&&Ze(()=>{b&&Nt(b,$,g),_e&&Y.enter(T),de&&ui(g,null,$,"mounted")},I)},ie=(g,y,O,$,I)=>{if(O&&R(g,O),$)for(let U=0;U<$.length;U++)R(g,$[U]);if(I){let U=I.subTree;if(y===U||Ho(U.type)&&(U.ssContent===y||U.ssFallback===y)){const K=I.vnode;ie(g,K,K.scopeId,K.slotScopeIds,I.parent)}}},ee=(g,y,O,$,I,U,K,V,T=0)=>{for(let b=T;b{const V=y.el=g.el;let{patchFlag:T,dynamicChildren:b,dirs:A}=y;T|=g.patchFlag&16;const x=g.props||De,Y=y.props||De;let de;if(O&&ci(O,!1),(de=Y.onVnodeBeforeUpdate)&&Nt(de,O,y,g),A&&ui(y,g,O,"beforeUpdate"),O&&ci(O,!0),b&&(!g.dynamicChildren||g.dynamicChildren.length!==b.length)&&(T=0,K=!1,b=null),(x.innerHTML&&Y.innerHTML==null||x.textContent&&Y.textContent==null)&&c(V,""),b?fe(g.dynamicChildren,b,V,O,$,Zs(y,I),U):K||Ee(g,y,V,null,O,$,Zs(y,I),U,!1),T>0){if(T&16)me(V,x,Y,O,I);else if(T&2&&x.class!==Y.class&&r(V,"class",null,Y.class,I),T&4&&r(V,"style",x.style,Y.style,I),T&8){const _e=y.dynamicProps;for(let pe=0;pe<_e.length;pe++){const Se=_e[pe],Re=x[Se],ze=Y[Se];(ze!==Re||Se==="value")&&r(V,Se,Re,ze,I,O)}}T&1&&g.children!==y.children&&c(V,y.children)}else!K&&b==null&&me(V,x,Y,O,I);((de=Y.onVnodeUpdated)||A)&&Ze(()=>{de&&Nt(de,O,y,g),A&&ui(y,g,O,"updated")},$)},fe=(g,y,O,$,I,U,K)=>{for(let V=0;V{if(y!==O){if(y!==De)for(const U in y)!Di(U)&&!(U in O)&&r(g,U,y[U],null,I,$);for(const U in O){if(Di(U))continue;const K=O[U],V=y[U];K!==V&&U!=="value"&&r(g,U,V,K,I,$)}"value"in O&&r(g,"value",y.value,O.value,I)}},he=(g,y,O,$,I,U,K,V,T)=>{const b=y.el=g?g.el:l(""),A=y.anchor=g?g.anchor:l("");let{patchFlag:x,dynamicChildren:Y,slotScopeIds:de}=y;de&&(V=V?V.concat(de):de),g==null?(s(b,O,$),s(A,O,$),ee(y.children||[],O,A,I,U,K,V,T)):x>0&&x&64&&Y&&g.dynamicChildren&&g.dynamicChildren.length===Y.length?(fe(g.dynamicChildren,Y,O,I,U,K,V),(y.key!=null||I&&y===I.subTree)&&Wn(g,y,!0)):Ee(g,y,O,A,I,U,K,V,T)},J=(g,y,O,$,I,U,K,V,T)=>{y.slotScopeIds=V,g==null?y.shapeFlag&512?I.ctx.activate(y,O,$,K,T):M(y,O,$,I,U,K,T):F(g,y,T)},M=(g,y,O,$,I,U,K)=>{const V=g.component=Su(g,$,I);if($n(g)&&(V.ctx.renderer=Xe),Au(V,!1,K),V.asyncDep){if(I&&I.registerDep(V,H,K,U),!g.el){const T=V.subTree=gt(vt);B(null,T,y,O),g.placeholder=T.el}}else H(V,g,y,O,I,U,K)},F=(g,y,O)=>{const $=y.component=g.component;if(nu(g,y,O))if($.asyncDep&&!$.asyncResolved){y.el=g.el,y.placeholder=g.placeholder,we($,y,O);return}else $.next=y,$.update();else y.el=g.el,y.placeholder=g.placeholder,$.vnode=y},H=(g,y,O,$,I,U,K)=>{const V=()=>{if(g.isMounted){let{next:x,bu:Y,u:de,parent:_e,vnode:pe}=g;{const Qe=zo(g);if(Qe){x&&(x.el=pe.el,we(g,x,K)),Qe.asyncDep.then(()=>{const ut=()=>{g.job.flags&8||(I&&I.pendingBranch?Ze(ut,I):b())};ut.flags=48,Ze(ut,I)});return}}let Se=x,Re;ci(g,!1),x?(x.el=pe.el,we(g,x,K)):x=pe,Y&&fs(Y),(Re=x.props&&x.props.onVnodeBeforeUpdate)&&Nt(Re,_e,x,pe),ci(g,!0);const ze=vr(g),Be=g.subTree;g.subTree=ze,C(Be,ze,h(Be.el||Hi(Be)),Ge(Be),g,I,U),x.el=ze.el,Se===null&&ru(g,ze.el),de&&Ze(de,I),(Re=x.props&&x.props.onVnodeUpdated)&&Ze(()=>Nt(Re,_e,x,pe),I)}else{let x;const{el:Y,props:de}=y,{bm:_e,m:pe,parent:Se,root:Re,type:ze}=g,Be=Si(y);ci(g,!1),_e&&fs(_e),!Be&&(x=de&&de.onVnodeBeforeMount)&&Nt(x,Se,y),ci(g,!0);{Re.ce&&Re.ce._hasShadowRoot()&&Re.ce._injectChildStyle(ze,g.parent?g.parent.type:void 0);const Qe=g.subTree=vr(g);C(null,Qe,O,$,g,I,U),y.el=Qe.el}if(pe&&Ze(pe,I),!Be&&(x=de&&de.onVnodeMounted)){const Qe=y;Ze(()=>Nt(x,Se,Qe),I)}(y.shapeFlag&256||Se&&Si(Se.vnode)&&Se.vnode.shapeFlag&256)&&g.a&&Ze(g.a,I),g.isMounted=!0,y=O=$=null}};g.scope.on();const T=g.effect=new Yr(V);g.scope.off();const b=g.update=T.run.bind(T),A=g.job=T.runIfDirty.bind(T);A.i=g,A.id=g.uid,T.scheduler=()=>Bn(A),ci(g,!0),b()},we=(g,y,O)=>{y.component=g;const $=g.vnode.props;g.vnode=y,g.next=null,lu(g,y.props,$,O),du(g,y.children,O),Dt(),po(g),Ut()},Ee=(g,y,O,$,I,U,K,V,T=!1)=>{const b=g&&g.children,A=g?g.shapeFlag:0,x=y.children,{patchFlag:Y,shapeFlag:de}=y;if(Y>0){if(Y&128){qe(b,x,O,$,I,U,K,V,T);return}else if(Y&256){Ve(b,x,O,$,I,U,K,V,T);return}}de&8?(A&16&&W(b,I,U),x!==b&&c(O,x)):A&16?de&16?qe(b,x,O,$,I,U,K,V,T):W(b,I,U,!0):(A&8&&c(O,""),de&16&&ee(x,O,$,I,U,K,V,T))},Ve=(g,y,O,$,I,U,K,V,T)=>{g=g||pi,y=y||pi;const b=g.length,A=y.length,x=Math.min(b,A);let Y;for(Y=0;YA?W(g,I,U,!0,!1,x):ee(y,O,$,I,U,K,V,T,x)},qe=(g,y,O,$,I,U,K,V,T)=>{let b=0;const A=y.length;let x=g.length-1,Y=A-1;for(;b<=x&&b<=Y;){const de=g[b],_e=y[b]=T?Wt(y[b]):xt(y[b]);if(Oi(de,_e))C(de,_e,O,null,I,U,K,V,T);else break;b++}for(;b<=x&&b<=Y;){const de=g[x],_e=y[Y]=T?Wt(y[Y]):xt(y[Y]);if(Oi(de,_e))C(de,_e,O,null,I,U,K,V,T);else break;x--,Y--}if(b>x){if(b<=Y){const de=Y+1,_e=deY)for(;b<=x;)j(g[b],I,U,!0),b++;else{const de=b,_e=b,pe=new Map;for(b=_e;b<=Y;b++){const Ae=y[b]=T?Wt(y[b]):xt(y[b]);Ae.key!=null&&pe.set(Ae.key,b)}let Se,Re=0;const ze=Y-_e+1;let Be=!1,Qe=0;const ut=new Array(ze);for(b=0;b=ze){j(Ae,I,U,!0);continue}let ye;if(Ae.key!=null)ye=pe.get(Ae.key);else for(Se=_e;Se<=Y;Se++)if(ut[Se-_e]===0&&Oi(Ae,y[Se])){ye=Se;break}ye===void 0?j(Ae,I,U,!0):(ut[ye-_e]=b+1,ye>=Qe?Qe=ye:Be=!0,C(Ae,y[ye],O,null,I,U,K,V,T),Re++)}const ai=Be?gu(ut):pi;for(Se=ai.length-1,b=ze-1;b>=0;b--){const Ae=_e+b,ye=y[Ae],kt=y[Ae+1],Ct=Ae+1{const{el:U,type:K,transition:V,children:T,shapeFlag:b}=g;if(b&6){te(g.component.subTree,y,O,$);return}if(b&128){g.suspense.move(y,O,$);return}if(b&64){K.move(g,y,O,Xe);return}if(K===G){s(U,y,O);for(let x=0;xV.enter(U),I));else{const{leave:x,delayLeave:Y,afterLeave:de}=V,_e=()=>{g.ctx.isUnmounted?n(U):s(U,y,O)},pe=()=>{const Se=U._isLeaving||!!U[Xs];U._isLeaving&&U[Xs](!0),V.persisted&&!Se?_e():x(U,()=>{_e(),de&&de()})};Y?Y(U,_e,pe):pe()}else s(U,y,O)},j=(g,y,O,$=!1,I=!1)=>{const{type:U,props:K,ref:V,children:T,dynamicChildren:b,shapeFlag:A,patchFlag:x,dirs:Y,cacheIndex:de,memo:_e}=g;if((x===-2||b&&b.hasOnce)&&(I=!1),V!=null&&(Dt(),$i(V,null,O,g,!0),Ut()),de!=null&&(!g.ctx||g.ctx===y)&&(y.renderCache[de]=void 0),A&256&&y.ctx.deactivate(g))return;const pe=A&1&&Y,Se=!Si(g);let Re;if(Se&&(Re=K&&K.onVnodeBeforeUnmount)&&Nt(Re,y,g),A&6)Me(g.component,O,$);else{if(A&128){g.suspense.unmount(O,$);return}pe&&ui(g,null,y,"beforeUnmount"),A&64?g.type.remove(g,y,O,Xe,$):b&&!b.hasOnce&&(U!==G||x>0&&x&64)?W(b,y,O,!1,!0):(U===G&&x&384||!I&&A&16)&&W(T,y,O),$&&ne(g)}const ze=_e!=null&&de==null;(Se&&(Re=K&&K.onVnodeUnmounted)||pe||ze)&&Ze(()=>{Re&&Nt(Re,y,g),pe&&ui(g,null,y,"unmounted"),ze&&(g.el=null)},O)},ne=g=>{const{type:y,el:O,anchor:$,transition:I}=g,U=y===G;if(U&&!I){$e(O,$);return}if(y===ps){L(g),I&&!I.persisted&&I.afterLeave&&I.afterLeave();return}const K=U?hn(g):g,V=()=>{U?h(O)&&$e(O,$):n(O),I&&!I.persisted&&I.afterLeave&&I.afterLeave()};if(K&&K.shapeFlag&1&&I&&!I.persisted){const{leave:T,delayLeave:b}=I,A=K.el,x=()=>T(A,V);b?b(A,V,x):x()}else V()},$e=(g,y)=>{let O;for(;g!==y;)O=v(g),n(g),g=O;n(y)},Me=(g,y,O)=>{const{bum:$,scope:I,job:U,subTree:K,um:V,m:T,a:b}=g;wr(T),wr(b),$&&fs($),I.stop(),U?(U.flags|=8,j(K,g,y,O)):K&&(K.transition=g.vnode.transition,j(K,g,y,O)),V&&Ze(V,y);const A=()=>{g.isUnmounted=!0};A.flags=16,Ze(A,y)},W=(g,y,O,$=!1,I=!1,U=0)=>{for(let K=U;K{if(g.shapeFlag&6)return Ge(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const y=v(g.anchor||g.el),O=y&&y[Eo];return O?v(O):y},Ie=(g,y,O)=>{const $=g&&y._vnode?void 0:g&&g.component?g.component.uid:_u();Ea(()=>{g==null?y._vnode&&j(y._vnode,null,null,!0):C(y._vnode||null,g,y,null,null,null,O),y._vnode=g},$)},Xe={p:C,um:j,m:te,r:ne,mt:M,mc:ee,pc:Ee,pbc:fe,n:Ge,o:t};return{render:Ie,hydrate:void 0,createApp:Qa(Ie)}}function Zs({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function ci({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function pu(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function Wn(t,e,i=!1){const s=t.children,n=e.children;if(ce(s)&&ce(n))for(let r=0;r>1,t[i[l]]0&&(e[s]=i[r-1]),i[r]=s)}}for(r=i.length,o=i[r-1];r-- >0;)i[r]=o,o=e[o];return i}function zo(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:zo(e)}function wr(t){if(t)for(let e=0;et.__isSuspense,mu=Symbol("_deferredEnter");function vu(t,e){e&&e.pendingBranch?ce(t)?e.effects.push(...t):e.effects.push(t):wa(t)}const G=Symbol.for("v-fgt"),zs=Symbol.for("v-txt"),vt=Symbol.for("v-cmt"),ps=Symbol.for("v-stc"),Jt=[];let ft=null;function p(t=!1){Jt.push(ft=t?null:[])}function Vn(){Jt.pop(),ft=Jt[Jt.length-1]||null}let Yi=1;function Er(t,e=!1){Yi+=t,t<0&&ft&&e&&(ft.hasOnce=!0)}function Wo(t){return t.dynamicChildren=Yi>0?ft||pi:null,Vn(),Yi>0&&ft&&ft.push(t),t}function m(t,e,i,s,n,r){return Wo(a(t,e,i,s,n,r,!0))}function Le(t,e,i,s,n){return Wo(gt(t,e,i,s,n,!0))}function Hs(t){return t?t.__v_isVNode===!0:!1}function Oi(t,e){return t.type===e.type&&t.key===e.key}const Vo=({key:t})=>t??null,gs=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?Fe(t)||st(t)||ve(t)?{i:Ye,r:t,k:e,f:!!i}:t:null);function a(t,e=null,i=null,s=0,n=null,r=t===G?0:1,o=!1,l=!1){const u={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&Vo(e),ref:e&&gs(e),scopeId:vo,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:s,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ye};return l?(Ss(u,i),r&128&&t.normalize(u)):i&&(u.shapeFlag|=Fe(i)?8:16),Yi>0&&!o&&ft&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&ft.push(u),u}const gt=bu;function bu(t,e=null,i=null,s=0,n=null,r=!1){if((!t||t===Ha)&&(t=vt),Hs(t)){const l=Ai(t,e,!0);return i&&Ss(l,i),Yi>0&&!r&&ft&&(l.shapeFlag&6?ft[ft.indexOf(t)]=l:ft.push(l)),l.patchFlag=-2,l}if(Mu(t)&&(t=t.__vccOpts),e){e=yu(e);let{class:l,style:u}=e;l&&!Fe(l)&&(e.class=xe(l)),Pe(u)&&(Un(u)&&!ce(u)&&(u=Ke({},u)),e.style=yt(u))}const o=Fe(t)?1:Ho(t)?128:Fs(t)?64:Pe(t)?4:ve(t)?2:0;return a(t,e,i,s,n,o,r,!0)}function yu(t){return t?Un(t)?Ke({},t):Lo(t)?Ke({},t[Yo]||t):t:null}function Ai(t,e,i=!1,s=!1){const{props:n,ref:r,patchFlag:o,children:l,transition:u}=t,d=e?wu(n||{},e):n,c={__v_isVNode:!0,__v_skip:!0,type:t.type,props:d,key:d&&Vo(d),ref:e&&e.ref?i&&r?ce(r)?r.concat(gs(e)):[r,gs(e)]:gs(e):r,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:l,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==G?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:u,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Ai(t.ssContent),ssFallback:t.ssFallback&&Ai(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce,cacheIndex:t.cacheIndex};return u&&s&&Fi(c,u.clone(c)),c}function Q(t=" ",e=0){return gt(zs,null,t,e)}function Ko(t,e){const i=gt(ps,null,t);return i.staticCount=e,i}function z(t="",e=!1){return e?(p(),Le(vt,null,t)):gt(vt,null,t)}function xt(t){return t==null||typeof t=="boolean"?gt(vt):ce(t)?gt(G,null,t.slice()):Hs(t)?Wt(t):gt(zs,null,String(t))}function Wt(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Ai(t)}function Ss(t,e){let i=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(ce(e))i=16;else if(typeof e=="object")if(s&65){const n=e.default;n&&(n._c&&(n._d=!1),Ss(t,n()),n._c&&(n._d=!0));return}else{i=32;const n=e._;!n&&!Lo(e)?e._ctx=Ye:n===3&&Ye&&(Ye.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else if(ve(e)){if(s&65){Ss(t,{default:e});return}e={default:e,_ctx:Ye},i=32}else e=String(e),s&64?(i=16,e=[Q(e)]):i=8;t.children=e,t.shapeFlag|=i}function wu(...t){const e={};for(let i=0;iit||Ye;let Rs,qi;{const t=Ds(),e=(i,s)=>{let n;return(n=t[i])||(n=t[i]=[]),n.push(s),r=>{n.length>1?n.forEach(o=>o(r)):n[0](r)}};Rs=e("__VUE_INSTANCE_SETTERS__",i=>it=i),qi=e("__VUE_SSR_SETTERS__",i=>Xi=i)}const ss=t=>{const e=it;return Rs(t),t.scope.on(),()=>{t.scope.off(),Rs(e)}},_r=()=>{it&&it.scope.off(),Rs(null)};function jo(t){return t.vnode.shapeFlag&4}let Xi=!1;function Au(t,e=!1,i=!1){e&&qi(e);const{props:s,children:n}=t.vnode,r=jo(t);ou(t,s,r,e),cu(t,n,i||e);const o=r?ku(t,e):void 0;return e&&qi(!1),o}function ku(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Ka);const{setup:s}=i;if(s){Dt();const n=t.setupContext=s.length>1?Tu(t):null,r=ss(t),o=is(s,t,0,[t.props,n]),l=Hr(o);if(Ut(),r(),(l||t.sp)&&!Si(t)&&So(t),l){if(o.then(_r,_r),e)return o.then(u=>{qi(!0);try{Sr(t,u,e)}finally{qi(!1)}}).catch(u=>{Bs(u,t,0,void 0,!0),t.ssrRender=(d,c)=>c("")});t.asyncDep=o}else Sr(t,o)}else Jo(t)}function Sr(t,e,i){ve(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Pe(e)&&(t.setupState=co(e)),Jo(t)}function Jo(t,e,i){const s=t.type;t.render||(t.render=s.render||Lt);{const n=ss(t);Dt();try{Ga(t)}finally{Ut(),n()}}}const Yo=Symbol(),Cu={get(t,e){return tt(t,"get",""),e===Yo?t:t[e]}};function Tu(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,Cu),slots:t.slots,emit:t.emit,expose:e}}function Ws(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(co(ca(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in zi)return zi[i](t)},has(e,i){return i in e||i in zi}})):t.proxy}function Nu(t,e=!0){return ve(t)?t.displayName||t.name:t.name||e&&t.__name}function Mu(t){return ve(t)&&"__vccOpts"in t}const se=(t,e)=>ga(t,e,Xi),Ou="3.5.46";let bn;const Rr=typeof window<"u"&&window.trustedTypes;if(Rr)try{bn=Rr.createPolicy("vue",{createHTML:t=>t})}catch{}const qo=bn?t=>bn.createHTML(t):t=>t,xu="http://www.w3.org/2000/svg",Pu="http://www.w3.org/1998/Math/MathML",Ht=typeof document<"u"?document:null,Ar=Ht&&Ht.createElement("template"),Iu={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,s)=>{const n=e==="svg"?Ht.createElementNS(xu,t):e==="mathml"?Ht.createElementNS(Pu,t):i?Ht.createElement(t,{is:i}):Ht.createElement(t);return t==="select"&&s&&s.multiple!=null&&n.setAttribute("multiple",s.multiple),n},createText:t=>Ht.createTextNode(t),createComment:t=>Ht.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Ht.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,s,n,r){const o=i?i.previousSibling:e.lastChild;if(n&&(n===r||n.nextSibling))for(;e.insertBefore(n.cloneNode(!0),i),!(n===r||!(n=n.nextSibling)););else{Ar.innerHTML=qo(s==="svg"?`${t}`:s==="mathml"?`${t}`:t);const l=Ar.content;if(s==="svg"||s==="mathml"){const u=l.firstChild;for(;u.firstChild;)l.appendChild(u.firstChild);l.removeChild(u)}e.insertBefore(l,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},Lu=Symbol("_vtc");function Du(t,e,i){const s=t[Lu];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const As=Symbol("_vod"),Xo=Symbol("_vsh"),Uu={name:"show",beforeMount(t,{value:e},{transition:i}){t[As]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):xi(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:s}){!e!=!i&&(s?e?(s.beforeEnter(t),xi(t,!0),s.enter(t)):s.leave(t,()=>{xi(t,!1)}):xi(t,e))},beforeUnmount(t,{value:e}){xi(t,e)}};function xi(t,e){t.style.display=e?t[As]:"none",t[Xo]=!e}const Bu=Symbol(""),Fu=/(?:^|;)\s*display\s*:/;function $u(t,e,i){const s=t.style,n=Fe(i);let r=!1;if(i&&!n){if(e)if(Fe(e))for(const o of e.split(";")){const l=o.slice(0,o.indexOf(":")).trim();i[l]==null&&Li(s,l,"")}else for(const o in e)i[o]==null&&Li(s,o,"");for(const o in i){o==="display"&&(r=!0);const l=i[o];l!=null?Hu(t,o,!Fe(e)&&e?e[o]:void 0,l)||Li(s,o,l):Li(s,o,"")}}else if(n){if(e!==i){const o=s[Bu];o&&(i+=";"+o),s.cssText=i,r=Fu.test(i)}}else e&&t.removeAttribute("style");As in t&&((!n||e!==i)&&(t[As]=r?s.display:""),t[Xo]&&(s.display="none"))}const cs=/\s*!important$/;function Li(t,e,i){if(ce(i))i.forEach(s=>Li(t,e,s));else if(i==null&&(i=""),e.startsWith("--"))cs.test(i)?t.setProperty(e,i.replace(cs,""),"important"):t.setProperty(e,i);else{const s=zu(t,e);cs.test(i)?t.setProperty(mi(s),i.replace(cs,""),"important"):t[s]=i}}const kr=["Webkit","Moz","ms"],en={};function zu(t,e){const i=en[e];if(i)return i;let s=at(e);if(s!=="filter"&&s in t)return en[e]=s;s=Ls(s);for(let n=0;ntn||(Ju.then(()=>tn=0),tn=Date.now());function qu(t,e){const i=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=i.attached)return;const n=i.value;if(ce(n)){const r=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{r.call(s),s._stopped=!0};const o=n.slice(),l=[s];for(let u=0;ut.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Xu=(t,e,i,s,n,r)=>{const o=n==="svg";e==="class"?Du(t,s,o):e==="style"?$u(t,i,s):xs(e)?Ps(e)||Vu(t,e,i,s,r):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Qu(t,e,s,o))?(Nr(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Tr(t,e,s,o,r,e!=="value")):t._isVueCE&&(Zu(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Fe(s)))?Nr(t,at(e),s,r,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Tr(t,e,s,o))};function Qu(t,e,i,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Or(e)&&ve(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const n=t.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return Or(e)&&Fe(i)?!1:e in t}function Zu(t,e){const i=t._def.props;if(!i)return!1;const s=at(e);return Array.isArray(i)?i.some(n=>at(n)===s):Object.keys(i).some(n=>at(n)===s)}const ki=t=>{const e=t.props["onUpdate:modelValue"]||!1;return ce(e)?i=>fs(e,i):e};function ec(t){t.target.composing=!0}function xr(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const It=Symbol("_assign"),ds=Symbol("_initialValue");function sn(t,e,i){return e&&(t=t.trim()),i&&(t=ts(t)),t}const Ce={created(t,{modifiers:{lazy:e,trim:i,number:s}},n){t.parentNode&&(t.type==="text"?t[ds]=t.defaultValue.replace(/[\r\n]/g,""):t.type==="textarea"&&(t[ds]=t.defaultValue.replace(/\r\n?/g,` +`))),t[It]=ki(n);const r=s||n.props&&n.props.type==="number";ti(t,e?"change":"input",o=>{o.target.composing||t[It](sn(t.value,i,r))}),(i||r)&&ti(t,"change",()=>{t.value=sn(t.value,i,r)}),e||(ti(t,"compositionstart",ec),ti(t,"compositionend",xr),ti(t,"change",xr))},mounted(t,{value:e,modifiers:{trim:i,number:s}}){const n=e??"",r=t[ds];delete t[ds],r!==void 0&&(t.type==="text"||t.type==="textarea")&&t.value!==r?t[It](sn(t.value,i,s)):t.value=n},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:s,trim:n,number:r}},o){if(t[It]=ki(o),t.composing)return;const l=(r||t.type==="number")&&!/^0\d/.test(t.value)?ts(t.value):t.value,u=e??"";if(l===u)return;const d=t.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===t&&t.type!=="range"&&(s&&e===i||n&&t.value.trim()===u)||(t.value=u)}},jt={deep:!0,created(t,e,i){t[It]=ki(i),ti(t,"change",()=>{const s=t._modelValue,n=Qi(t),r=t.checked,o=t[It];if(ce(s)){const l=Nn(s,n),u=l!==-1;if(r&&!u)o(s.concat(n));else if(!r&&u){const d=[...s];d.splice(l,1),o(d)}}else if(Yt(s)){const l=new Set(s);r?l.add(n):l.delete(n),o(l)}else o(Qo(t,r))})},mounted:Pr,beforeUpdate(t,e,i){t[It]=ki(i),Pr(t,e,i)}};function Pr(t,{value:e,oldValue:i},s){t._modelValue=e;let n;if(ce(e))n=Nn(e,s.props.value)>-1;else if(Yt(e))n=e.has(s.props.value);else{if(e===i)return;n=qt(e,Qo(t,!0))}t.checked!==n&&(t.checked=n)}const _t={deep:!0,created(t,{value:e,modifiers:{number:i}},s){t._modelValue=e,ti(t,"change",()=>{const n=Array.prototype.filter.call(t.options,u=>u.selected).map(u=>i?ts(Qi(u)):Qi(u)),r=t.multiple,o=r?Yt(t._modelValue)?new Set(n):n:n[0],l=t._pendingValue=[r,r?ce(o)?n.slice():n:o];try{t[It](o)}finally{ys(()=>{t._pendingValue===l&&(t._pendingValue=void 0)})}}),t[It]=ki(s)},mounted(t,{value:e,modifiers:{number:i}}){Ir(t,e,i)},beforeUpdate(t,{value:e},i){t._modelValue=e,t[It]=ki(i)},updated(t,{value:e,modifiers:{number:i}}){const s=t._pendingValue;t._pendingValue=void 0,(!s||s[0]!==t.multiple||!tc(e,s[1],s[0]))&&Ir(t,e,i)}};function tc(t,e,i){if(!i||ce(t))return qt(t,e);if(Yt(t)){if(t.size!==e.length)return!1;for(const s of e)if(!t.has(s))return!1;return!0}return!1}function Ir(t,e,i=!1){const s=t.multiple,n=ce(e);if(!(s&&!n&&!Yt(e))){for(let r=0,o=t.options.length;rString(c)===String(u)):l.selected=Nn(e,u)>-1}else l.selected=e.has(u)||i&&typeof u=="string"&&e.has(ts(u));else if(qt(Qi(l),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Qi(t){return"_value"in t?t._value:t.value}function Qo(t,e){const i=e?"_trueValue":"_falseValue";return i in t?t[i]:e}const ic=["ctrl","shift","alt","meta"],sc={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>ic.some(i=>t[`${i}Key`]&&!e.includes(i))},We=(t,e)=>{if(!t)return t;const i=t._withMods||(t._withMods={}),s=e.join(".");return i[s]||(i[s]=((n,...r)=>{for(let o=0;o{const e=rc().createApp(...t),{mount:i}=e;return e.mount=s=>{const n=ac(s);if(!n)return;const r=e._component;!ve(r)&&!r.render&&!r.template&&(r.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const o=i(n,!1,lc(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),o},e});function lc(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function ac(t){return Fe(t)?document.querySelector(t):t}class N{static getElements(e,i=document){if(typeof e=="string"){const s="getElementById"in i?i:void 0;if(s&&!isNaN(+e[0])){const r=s.getElementById(e);return r?[r]:[]}let n=i.querySelectorAll(e);if(!n.length&&e[0]!=="."&&e[0]!=="#"&&(n=i.querySelectorAll("."+e),n.length||(n=i.querySelectorAll("#"+e)),!n.length)){const r=i.querySelector(`[gs-id="${e}"]`);return r?[r]:[]}return Array.from(n)}return[e]}static getElement(e,i=document){if(typeof e=="string"){const s="getElementById"in i?i:void 0;if(!e.length)return null;if(s&&e[0]==="#")return s.getElementById(e.substring(1));if(e[0]==="#"||e[0]==="."||e[0]==="[")return i.querySelector(e);if(s&&!isNaN(+e[0]))return s.getElementById(e);let n=i.querySelector(e);return s&&!n&&(n=s.getElementById(e)),n||(n=i.querySelector("."+e)),n}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&e.lazyLoad!==!1}static createDiv(e,i){const s=document.createElement("div");return e.forEach(n=>{n&&s.classList.add(n)}),i?.appendChild(s),s}static shouldSizeToContent(e,i=!1){return e?.grid&&(i?e.sizeToContent===!0||e.grid.opts.sizeToContent===!0&&e.sizeToContent===void 0:!!e.sizeToContent||e.grid.opts.sizeToContent&&e.sizeToContent!==!1)}static isIntercepted(e,i){return!(e.y>=i.y+i.h||e.y+e.h<=i.y||e.x+e.w<=i.x||e.x>=i.x+i.w)}static isTouching(e,i){return N.isIntercepted(e,{x:i.x-.5,y:i.y-.5,w:i.w+1,h:i.h+1})}static areaIntercept(e,i){const s=e.x>i.x?e.x:i.x,n=e.x+e.wi.y?e.y:i.y,o=e.y+e.h{const o=i*((n.y??1e4)-(r.y??1e4));return o===0?i*((n.x??1e4)-(r.x??1e4)):o})}static find(e,i){return i?e.find(s=>s.id===i):void 0}static toBool(e){return typeof e=="boolean"?e:typeof e=="string"?(e=e.toLowerCase(),!(e===""||e==="no"||e==="false"||e==="0")):!!e}static toNumber(e){return e===null||e.length===0?void 0:Number(e)}static parseHeight(e){let i,s="px";if(typeof e=="string")if(e==="auto"||e==="")i=0;else{const n=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!n)throw new Error(`Invalid height val = ${e}`);s=n[2]||"px",i=parseFloat(n[1])}else i=e;return{h:i,unit:s}}static defaults(e,...i){return i.forEach(s=>{for(const n in s){if(!s.hasOwnProperty(n))return;e[n]===null||e[n]===void 0?e[n]=s[n]:typeof s[n]=="object"&&typeof e[n]=="object"&&N.defaults(e[n],s[n])}}),e}static same(e,i){if(typeof e!="object")return e==i;if(typeof e!=typeof i||Object.keys(e).length!==Object.keys(i).length)return!1;for(const s in e)if(e[s]!==i[s])return!1;return!0}static copyPos(e,i,s=!1){return i.x!==void 0&&(e.x=i.x),i.y!==void 0&&(e.y=i.y),i.w!==void 0&&(e.w=i.w),i.h!==void 0&&(e.h=i.h),s&&(i.minW&&(e.minW=i.minW),i.minH&&(e.minH=i.minH),i.maxW&&(e.maxW=i.maxW),i.maxH&&(e.maxH=i.maxH)),e}static samePos(e,i){return e&&i&&e.x===i.x&&e.y===i.y&&(e.w||1)===(i.w||1)&&(e.h||1)===(i.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,i){if(!(typeof e!="object"||typeof i!="object")&&!(Array.isArray(e)||Array.isArray(i)))for(let s in e){const n=e[s],r=i[s];s[0]==="_"||n===r?delete e[s]:n&&typeof n=="object"&&r!==void 0&&(N.removeInternalAndSame(n,r),Object.keys(n).length||delete e[s])}}static removeInternalForSave(e,i=!0){for(let s in e)(s[0]==="_"||e[s]===null||e[s]===void 0)&&delete e[s];delete e.grid,i&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,(e.w===1||e.w===e.minW)&&delete e.w,(e.h===1||e.h===e.minH)&&delete e.h}static throttle(e,i){let s=!1;return(...n)=>{s||(s=!0,setTimeout(()=>{e(...n),s=!1},i))}}static removePositioningStyles(e){const i=e.style;i.position&&i.removeProperty("position"),i.left&&i.removeProperty("left"),i.top&&i.removeProperty("top"),i.width&&i.removeProperty("width"),i.height&&i.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const i=getComputedStyle(e).overflowY;return(i==="auto"||i==="scroll")&&e.scrollHeight>e.clientHeight?e:N.getScrollElement(e.parentElement)}static updateScrollResize(e,i,s){const n=N.getScrollElement(i),r=n.clientHeight,o=n===N.getScrollElement()?0:n.getBoundingClientRect().top,l=e.clientY-o,u=lr-s;u?n.scrollBy({behavior:"smooth",top:l-s}):d&&n.scrollBy({behavior:"smooth",top:s-(r-l)})}static clone(e){return e==null||typeof e!="object"?e:e instanceof Array?[...e]:{...e}}static cloneDeep(e){const i=["parentGrid","el","grid","subGrid","engine"],s=N.clone(e);for(const n in s)s.hasOwnProperty(n)&&typeof s[n]=="object"&&n.substring(0,2)!=="__"&&!i.find(r=>r===n)&&(s[n]=N.cloneDeep(e[n]));return s}static cloneNode(e){const i=e.cloneNode(!0);return i.removeAttribute("id"),i}static appendTo(e,i){let s;typeof i=="string"?s=N.getElement(i):s=i,s&&s.appendChild(e)}static addElStyles(e,i){if(i instanceof Object)for(const s in i)i.hasOwnProperty(s)&&(Array.isArray(i[s])?i[s].forEach(n=>{e.style[s]=n}):e.style[s]=i[s])}static initEvent(e,i){const s={type:i.type},n={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:i.target?i.target:e.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(r=>s[r]=e[r]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(r=>s[r]=e[r]),{...s,...n}}static simulateMouseEvent(e,i,s){const n=e,r=new MouseEvent(i,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,ctrlKey:n.ctrlKey??!1,altKey:n.altKey??!1,shiftKey:n.shiftKey??!1,metaKey:n.metaKey??!1,button:0,relatedTarget:e.target});(s||e.target).dispatchEvent(r)}static getValuesFromTransformedElement(e){const i=document.createElement("div");N.addElStyles(i,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),e.appendChild(i);const s=i.getBoundingClientRect();return e.removeChild(i),i.remove(),{xScale:1/s.width,yScale:1/s.height,xOffset:s.left,yOffset:s.top}}static swap(e,i,s){if(!e)return;const n=e[i];e[i]=e[s],e[s]=n}static canBeRotated(e){return!(!e||e.w===e.h||e.locked||e.noResize||e.grid?.opts.disableResize||e.minW&&e.minW===e.maxW||e.minH&&e.minH===e.maxH)}}class Gt{constructor(e={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=e.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=e.maxRow,this._float=e.float,this.nodes=e.nodes||[],this.onChange=e.onChange}batchUpdate(e=!0,i=!0){return!!this.batchMode===e?this:(this.batchMode=e,e?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,i&&this._packNodes(),this._notify()),this)}_useEntireRowArea(e,i){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!e._moving||e._skipDown||i.y<=e.y)}_fixCollisions(e,i=e,s,n={}){if(this.sortNodes(-1),s=s||this.collide(e,i),!s)return!1;if(e._moving&&!n.nested&&!this.float&&this.swap(e,s))return!0;let r=i;!this._loading&&this._useEntireRowArea(e,i)&&(r={x:0,w:this.column,y:i.y,h:i.h},s=this.collide(e,r,n.skip));let o=!1;const l={nested:!0,pack:!1};let u=0;for(;s=s||this.collide(e,r,n.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let d;if(s.locked||this._loading||e._moving&&!e._skipDown&&i.y>e.y&&!this.float&&(!this.collide(s,{...s,y:e.y},e)||!this.collide(s,{...s,y:i.y-s.h},e))){e._skipDown=e._skipDown||i.y>e.y;const c={...i,y:s.y+s.h,...l};d=this._loading&&N.samePos(e,c)?!0:this.moveNode(e,c),(s.locked||this._loading)&&d?N.copyPos(i,e):!s.locked&&d&&n.pack&&(this._packNodes(),i.y=s.y+s.h,N.copyPos(e,i)),o=o||d}else d=this.moveNode(s,{...s,y:i.y+i.h,skip:e,...l});if(!d)return o;s=void 0}return o}collide(e,i=e,s){const n=e._id,r=s?._id;return this.nodes.find(o=>o._id!==n&&o._id!==r&&N.isIntercepted(o,i))}collideAll(e,i=e,s){const n=e._id,r=s?._id;return this.nodes.filter(o=>o._id!==n&&o._id!==r&&N.isIntercepted(o,i))}directionCollideCoverage(e,i,s){if(!i.rect||!e._rect)return;const n=e._rect,r={...i.rect};r.y>n.y?(r.h+=r.y-n.y,r.y=n.y):r.h+=n.y-r.y,r.x>n.x?(r.w+=r.x-n.x,r.x=n.x):r.w+=n.x-r.x;let o,l=.5;for(let u of s){if(u.locked||!u._rect)break;const d=u._rect;let c=Number.MAX_VALUE,h=Number.MAX_VALUE;n.yd.y+d.h&&(c=(d.y+d.h-r.y)/d.h),n.xd.x+d.w&&(h=(d.x+d.w-r.x)/d.w);const v=Math.min(h,c);v>l&&(l=v,o=u)}return i.collide=o,o}cacheRects(e,i,s,n,r,o){return this.nodes.forEach(l=>l._rect={y:l.y*i+s,x:l.x*e+o,w:l.w*e-o-n,h:l.h*i-s-r}),this}swap(e,i){if(!i||i.locked||!e||e.locked)return!1;function s(){const r=i.x,o=i.y;return i.x=e.x,i.y=e.y,e.h!=i.h?(e.x=r,e.y=i.y+i.h):e.w!=i.w?(e.x=i.x+i.w,e.y=o):(e.x=r,e.y=o),e._dirty=i._dirty=!0,!0}let n;if(e.w===i.w&&e.h===i.h&&(e.x===i.x||e.y===i.y)&&(n=N.isTouching(e,i)))return s();if(n!==!1){if(e.w===i.w&&e.x===i.x&&(n||(n=N.isTouching(e,i)))){if(i.y{let d;o.locked||(o.autoPosition=!0,e==="list"&&l&&(d=u[l-1])),this.addNode(o,!1,d)}),n||delete this._inColumnResize,s||this.batchUpdate(!1),this}set float(e){this._float!==e&&(this._float=e||!1,e||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(e=1){return this.nodes=N.sort(this.nodes,e),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(e=>{if(e._updating||e._orig===void 0||e.y===e._orig.y)return;let i=e.y;for(;i>e._orig.y;)--i,this.collide(e,{x:e.x,y:i,w:e.w,h:e.h})||(e._dirty=!0,e.y=i)}):this.nodes.forEach((e,i)=>{if(!e.locked)for(;e.y>0;){const s=i===0?0:e.y-1;if(!(i===0||!this.collide(e,{x:e.x,y:s,w:e.w,h:e.h})))break;e._dirty=e.y!==s,e.y=s}}),this)}prepareNode(e,i){e._id=e._id??Gt._idSeq++;const s=e.id;if(s){let r=1;for(;this.nodes.find(o=>o.id===e.id&&o!==e);)e.id=s+"_"+r++}(e.x===void 0||e.y===void 0||e.x===null||e.y===null)&&(e.autoPosition=!0);const n={x:0,y:0,w:1,h:1};return N.defaults(e,n),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,N.sanitizeMinMax(e),typeof e.x=="string"&&(e.x=Number(e.x)),typeof e.y=="string"&&(e.y=Number(e.y)),typeof e.w=="string"&&(e.w=Number(e.w)),typeof e.h=="string"&&(e.h=Number(e.h)),isNaN(e.x)&&(e.x=n.x,e.autoPosition=!0),isNaN(e.y)&&(e.y=n.y,e.autoPosition=!0),isNaN(e.w)&&(e.w=n.w),isNaN(e.h)&&(e.h=n.h),this.nodeBoundFix(e,i),e}nodeBoundFix(e,i){const s=e._orig||N.copyPos({},e);if(e.maxW&&(e.w=Math.min(e.w||1,e.maxW)),e.maxH&&(e.h=Math.min(e.h||1,e.maxH)),e.minW&&(e.w=Math.max(e.w||1,e.minW)),e.minH&&(e.h=Math.max(e.h||1,e.minH)),(e.x||0)+(e.w||1)>this.column&&this.columnthis.column?e.w=this.column:e.w<1&&(e.w=1),this.maxRow&&e.h>this.maxRow?e.h=this.maxRow:e.h<1&&(e.h=1),e.x<0&&(e.x=0),e.y<0&&(e.y=0),e.x+e.w>this.column&&(i?e.w=this.column-e.x:e.x=this.column-e.w),this.maxRow&&e.y+e.h>this.maxRow&&(i?e.h=this.maxRow-e.y:e.y=this.maxRow-e.h),N.samePos(e,s)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(i=>i._dirty&&!N.samePos(i,i._orig)):this.nodes.filter(i=>i._dirty)}_notify(e){if(this.batchMode||!this.onChange)return this;const i=(e||[]).concat(this.getDirtyNodes());return this.onChange(i),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(e=>{delete e._dirty,delete e._lastTried}),this)}saveInitial(){return this.nodes.forEach(e=>{e._orig=N.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||N.samePos(e,e._orig)||(N.copyPos(e,e._orig),e._dirty=!0)}),this._notify(),this}findEmptyPosition(e,i=this.nodes,s=this.column,n){const r=n?n.y*s+(n.x+n.w):0;let o=!1;for(let l=r;!o;++l){const u=l%s,d=Math.floor(l/s);if(u+e.w>s)continue;const c={x:u,y:d,w:e.w,h:e.h};i.find(h=>N.isIntercepted(c,h))||((e.x!==u||e.y!==d)&&(e._dirty=!0),e.x=u,e.y=d,delete e.autoPosition,o=!0)}return o}addNode(e,i=!1,s){const n=this.nodes.find(o=>o._id===e._id);if(n)return n;this._inColumnResize?this.nodeBoundFix(e):this.prepareNode(e),delete e._temporaryRemoved,delete e._removeDOM;let r;return e.autoPosition&&this.findEmptyPosition(e,this.nodes,this.column,s)&&(delete e.autoPosition,r=!0),this.nodes.push(e),i&&this.addedNodes.push(e),r||this._fixCollisions(e),this.batchMode||this._packNodes()._notify(),e}removeNode(e,i=!0,s=!1){return this.nodes.find(n=>n._id===e._id)?(s&&this.removedNodes.push(e),i&&(e._removeDOM=!0),this.nodes=this.nodes.filter(n=>n._id!==e._id),e._isAboutToRemove||this._packNodes(),this._notify([e]),this):this}removeAll(e=!0,i=!0){if(delete this._layouts,!this.nodes.length)return this;e&&this.nodes.forEach(n=>n._removeDOM=!0);const s=this.nodes;return this.removedNodes=i?s:[],this.nodes=[],this._notify(s)}moveNodeCheck(e,i){if(!this.changedPosConstrain(e,i))return!1;if(i.pack=!0,!this.maxRow)return this.moveNode(e,i);let s;const n=new Gt({column:this.column,float:this.float,nodes:this.nodes.map(o=>o._id===e._id?(s={...o},s):{...o})});if(!s)return!1;const r=n.moveNode(s,i)&&n.getRow()<=Math.max(this.getRow(),this.maxRow);if(!r&&!i.resizing&&i.collide){const o=i.collide.el.gridstackNode;if(this.swap(e,o))return this._notify(),!0}return r?(n.nodes.filter(o=>o._dirty).forEach(o=>{const l=this.nodes.find(u=>u._id===o._id);l&&(N.copyPos(l,o),l._dirty=!0)}),this._notify(),!0):!1}willItFit(e){if(delete e._willFitPos,!this.maxRow)return!0;const i=new Gt({column:this.column,float:this.float,nodes:this.nodes.map(n=>({...n}))}),s={...e};return this.cleanupNode(s),delete s.el,delete s._id,delete s.content,delete s.grid,i.addNode(s),i.getRow()<=this.maxRow?(e._willFitPos=N.copyPos({},s),!0):!1}changedPosConstrain(e,i){return i.w=i.w||e.w,i.h=i.h||e.h,e.x!==i.x||e.y!==i.y?!0:(e.maxW&&(i.w=Math.min(i.w,e.maxW)),e.maxH&&(i.h=Math.min(i.h,e.maxH)),e.minW&&(i.w=Math.max(i.w,e.minW)),e.minH&&(i.h=Math.max(i.h,e.minH)),e.w!==i.w||e.h!==i.h)}moveNode(e,i){if(!e||!i)return!1;let s;i.pack===void 0&&!this.batchMode&&(s=i.pack=!0),typeof i.x!="number"&&(i.x=e.x),typeof i.y!="number"&&(i.y=e.y),typeof i.w!="number"&&(i.w=e.w),typeof i.h!="number"&&(i.h=e.h);const n=e.w!==i.w||e.h!==i.h,r=N.copyPos({},e,!0);if(N.copyPos(r,i),this.nodeBoundFix(r,n),N.copyPos(i,r),!i.forceCollide&&N.samePos(e,i))return!1;const o=N.copyPos({},e),l=this.collideAll(e,r,i.skip);let u=!0;if(l.length){const d=e._moving&&!i.nested;let c=d?this.directionCollideCoverage(e,i,l):l[0];if(d&&c&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const h=N.areaIntercept(i.rect,c._rect),v=N.area(i.rect),R=N.area(c._rect);h/(v.8&&(c.grid.makeSubGrid(c.el,void 0,e),c=void 0)}c?u=!this._fixCollisions(e,r,c,i):(u=!1,s&&delete i.pack)}return u&&!N.samePos(e,r)&&(e._dirty=!0,N.copyPos(e,r)),i.pack&&this._packNodes()._notify(),!N.samePos(e,o)}getRow(){return this.nodes.reduce((e,i)=>Math.max(e,i.y+i.h),0)}beginUpdate(e){return e._updating||(e._updating=!0,delete e._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const e=this.nodes.find(i=>i._updating);return e&&(delete e._updating,delete e._skipDown),this}save(e=!0,i,s){const n=this._layouts?.length||0;let r;n&&(s?s!==this.column&&(r=this._layouts[s]):this.column!==n-1&&(r=this._layouts[n-1]));const o=[];return this.sortNodes(),this.nodes.forEach(l=>{const u=r?.find(c=>c._id===l._id),d={...l,...u||{}};N.removeInternalForSave(d,!e),i&&i(l,d),o.push(d)}),o}layoutsNodesChange(e){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((i,s)=>{if(!i||s===this.column)return this;if(s{if(!r._orig)return;const o=i.find(l=>l._id===r._id);o&&(o.y>=0&&r.y!==r._orig.y&&(o.y+=r.y-r._orig.y,o.y<0&&(o.y=0)),r.x!==r._orig.x&&(o.x=Math.round(r.x*n),o.x<0&&(o.x=0)),r.w!==r._orig.w&&(o.w=Math.round(r.w*n),o.w<1&&(o.w=1)))})}}),this)}columnChanged(e,i,s="moveScale"){if(!this.nodes.length||!i||e===i)return this;const n=s==="compact"||s==="list";n&&this.sortNodes(1),ie&&this._layouts){const l=this._layouts[i]||[],u=this._layouts.length-1;!l.length&&e!==u&&this._layouts[u]?.length&&(e=u,this._layouts[u].forEach(d=>{const c=o.find(h=>h._id===d._id);c&&(!n&&!d.autoPosition&&(c.x=d.x??c.x,c.y=d.y??c.y),c.w=d.w??c.w,(d.x==null||d.y===void 0)&&(c.autoPosition=!0))})),l.forEach(d=>{const c=o.findIndex(h=>h._id===d._id);if(c!==-1){const h=o[c];if(n){h.w=d.w;return}(d.autoPosition||isNaN(d.x)||isNaN(d.y))&&this.findEmptyPosition(d,r),d.autoPosition||(h.x=d.x??h.x,h.y=d.y??h.y,h.w=d.w??h.w,r.push(h)),o.splice(c,1)}})}if(n)this.compact(s,!1);else{if(o.length)if(typeof s=="function")s(i,e,r,o);else{const l=n||s==="none"?1:i/e,u=s==="move"||s==="moveScale",d=s==="scale"||s==="moveScale";o.forEach(c=>{c.x=i===1?0:u?Math.round(c.x*l):Math.min(c.x,i-1),c.w=i===1||e===1?1:d?Math.round(c.w*l)||1:Math.min(c.w,i),r.push(c)}),o=[]}r=N.sort(r,-1),this._inColumnResize=!0,this.nodes=[],r.forEach(l=>{this.addNode(l,!1),delete l._orig})}return this.nodes.forEach(l=>delete l._orig),this.batchUpdate(!1,!n),delete this._inColumnResize,this}cacheLayout(e,i,s=!1){const n=[];return e.forEach((r,o)=>{if(r._id===void 0){const l=r.id?this.nodes.find(u=>u.id===r.id):void 0;r._id=l?._id??Gt._idSeq++}n[o]={x:r.x,y:r.y,w:r.w,_id:r._id}}),this._layouts=s?[]:this._layouts||[],this._layouts[i]=n,this}cacheOneLayout(e,i){e._id=e._id??Gt._idSeq++;const s={x:e.x,y:e.y,w:e.w,_id:e._id};(e.autoPosition||e.x===void 0)&&(delete s.x,delete s.y,e.autoPosition&&(s.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[i]=this._layouts[i]||[];const n=this.findCacheLayout(e,i);return n===-1?this._layouts[i].push(s):this._layouts[i][n]=s,this}findCacheLayout(e,i){return this._layouts?.[i]?.findIndex(s=>s._id===e._id)??-1}removeNodeFromLayoutCache(e){if(this._layouts)for(let i=0;i0||navigator.msMaxTouchPoints>0);class dt{}function ks(t,e){t.touches.length>1||(t.cancelable&&t.preventDefault(),N.simulateMouseEvent(t.changedTouches[0],e))}function Zo(t,e){t.cancelable&&t.preventDefault(),N.simulateMouseEvent(t,e)}function Cs(t){dt.touchHandled||(dt.touchHandled=!0,ks(t,"mousedown"))}function Ts(t){dt.touchHandled&&ks(t,"mousemove")}function Ns(t){if(!dt.touchHandled)return;dt.pointerLeaveTimeout&&(window.clearTimeout(dt.pointerLeaveTimeout),delete dt.pointerLeaveTimeout);const e=!!ue.dragElement;ks(t,"mouseup"),e||ks(t,"click"),dt.touchHandled=!1}function Ms(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function Dr(t){ue.dragElement&&t.pointerType!=="mouse"&&Zo(t,"mouseenter")}function Ur(t){ue.dragElement&&t.pointerType!=="mouse"&&(dt.pointerLeaveTimeout=window.setTimeout(()=>{delete dt.pointerLeaveTimeout,Zo(t,"mouseleave")},10))}class Vs{constructor(e,i,s){this.host=e,this.dir=i,this.option=s,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){if(this.option.element)try{this.el=this.option.element instanceof HTMLElement?this.option.element:this.host.querySelector(this.option.element)}catch(e){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",e)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${Vs.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),wt&&(this.el.addEventListener("touchstart",Cs),this.el.addEventListener("pointerdown",Ms)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),wt&&(this.el.removeEventListener("touchstart",Cs),this.el.removeEventListener("pointerdown",Ms)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(e){this.mouseDownEvent=e,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),wt&&(this.el.addEventListener("touchmove",Ts),this.el.addEventListener("touchend",Ns)),e.stopPropagation(),e.preventDefault()}_mouseMove(e){const i=this.mouseDownEvent;this.moving?this._triggerEvent("move",e):Math.abs(e.x-i.x)+Math.abs(e.y-i.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",e),document.addEventListener("keydown",this._keyEvent)),e.stopPropagation()}_mouseUp(e){this.moving&&(this._triggerEvent("stop",e),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),wt&&(this.el.removeEventListener("touchmove",Ts),this.el.removeEventListener("touchend",Ns)),delete this.moving,delete this.mouseDownEvent,e.stopPropagation(),e.preventDefault()}_keyEvent(e){e.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(e,i){return this.option[e]&&this.option[e](i),this}}Vs.prefix="ui-resizable-";class Kn{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(e,i){this._eventRegister[e]=i}off(e){delete this._eventRegister[e]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(e,i){if(!this.disabled&&this._eventRegister&&this._eventRegister[e])return this._eventRegister[e](i)}}class Zi extends Kn{constructor(e,i={}){super(),this.el=e,this.option=i,this.rectScale={x:1,y:1},this._ui=()=>{const n=this.el.parentElement.getBoundingClientRect(),r={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},o=this.temporalRect||r;return{position:{left:this.option.rtl?(n.right-o.right)*this.rectScale.x:(o.left-n.left)*this.rectScale.x,top:(o.top-n.top)*this.rectScale.y},size:{width:o.width*this.rectScale.x,height:o.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(e){const i=e.handles&&e.handles!==this.option.handles,s=e.autoHide&&e.autoHide!==this.option.autoHide;return Object.keys(e).forEach(n=>this.option[n]=e[n]),i&&(this._removeHandlers(),this._setupHandlers()),s&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(e){return e?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),ue.overResizeElement===this&&delete ue.overResizeElement),this}_mouseOver(e){ue.overResizeElement||ue.dragElement||(ue.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){ue.overResizeElement===this&&(delete ue.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(e=>e.trim()).map(e=>new Vs(this.el,e,{element:this.option.element,start:i=>this._resizeStart(i),stop:i=>this._resizeStop(i),move:i=>this._resizing(i,e)})),this}_resizeStart(e){this.sizeToContent=N.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=N.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const i=N.initEvent(e,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(i,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",i),this}_resizing(e,i){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(e,i),this._applyChange();const s=N.initEvent(e,{type:"resize",target:this.el});return s.resizeDir=i,s.hasMovedX=this.option.rtl?i.includes("e"):i.includes("w"),s.hasMovedY=i.includes("n"),this.option.resize&&this.option.resize(s,this._ui()),this.triggerEvent("resize",s),this}_resizeStop(e){const i=N.initEvent(e,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(i),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",i),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=Zi._originStyleProp.map(s=>this.el.style[s]),this.parentOriginStylePosition=this.el.parentElement.style.position;const e=this.el.parentElement,i=N.getValuesFromTransformedElement(e);return this.rectScale={x:i.xScale,y:i.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return Zi._originStyleProp.forEach((e,i)=>{this.el.style[e]=this.elOriginStyleVal[i]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(e,i){const s=this.startEvent,n={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,right:this.originalRect.right,top:this.originalRect.top-this.scrolled},r=e.clientX-s.clientX,o=this.sizeToContent?0:e.clientY-s.clientY;let l,u;const d=this.option.rtl;!d&&i.indexOf("e")>-1?n.width+=r:d&&i.indexOf("w")>-1?n.width-=r:!d&&i.indexOf("w")>-1?(n.width-=r,n.left+=r,l=!0):d&&i.indexOf("e")>-1&&(n.width+=r,n.right+=r,l=!0),i.indexOf("s")>-1?n.height+=o:i.indexOf("n")>-1&&(n.height-=o,n.top+=o,u=!0);const c=this._constrainSize(n.width,n.height,l,u);return Math.round(n.width)!==Math.round(c.width)&&(!d&&i.indexOf("w")>-1?n.left+=n.width-c.width:d&&i.indexOf("e")>-1&&(n.right-=n.width-c.width),n.width=c.width),Math.round(n.height)!==Math.round(c.height)&&(i.indexOf("n")>-1&&(n.top+=n.height-c.height),n.height=c.height),n}_constrainSize(e,i,s,n){const r=this.option,o=(s?r.maxWidthMoveLeft:r.maxWidth)||Number.MAX_SAFE_INTEGER,l=r.minWidth/this.rectScale.x||e,u=(n?r.maxHeightMoveUp:r.maxHeight)||Number.MAX_SAFE_INTEGER,d=r.minHeight/this.rectScale.y||i,c=Math.min(o,Math.max(l,e)),h=Math.min(u,Math.max(d,i));return{width:c,height:h}}_applyChange(){let e={left:0,right:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const i=this.el.parentElement,{left:s,right:n,top:r}=i.getBoundingClientRect();e={left:s,right:n,top:r,width:0,height:0}}return this.temporalRect?(Object.entries(this.temporalRect).forEach(([i,s])=>{if(this.option.rtl?i==="left":i==="right")return;const n=i==="width"||i==="left"||i==="right"?this.rectScale.x:i==="height"||i==="top"?this.rectScale.y:1;let r;i==="right"?r=(e.right-s)*this.rectScale.x+"px":r=(s-e[i])*n+"px",this.el.style[i]=r}),this):this}_removeHandlers(){return this.handlers.forEach(e=>e.destroy()),delete this.handlers,this}}Zi._originStyleProp=["width","height","position","left","right","top","opacity","zIndex"];const uc='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class es extends Kn{constructor(e,i={}){super(),this.el=e,this.option=i,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},this._autoScrollTick=()=>{const r=this.helper,o=this._autoScrollContainer;if(!r||!o){this._stopScrolling();return}const l=this._getClipping(r,o);if(l===0){this._stopScrolling();return}if(!this._autoScrollMaxSpeed){const v=window.innerHeight||document.documentElement.clientHeight;this._autoScrollMaxSpeed=Math.max(v/150,4)}const u=Math.abs(l),d=Math.min(u*.5,this._autoScrollMaxSpeed),c=l>0?d:-d,h=o.scrollTop;if(o.scrollTop+=c,o.scrollTop===h){this._stopScrolling();return}this.dragging&&this.lastDrag&&(this._dragFollow(this.lastDrag),this._callDrag(this.lastDrag)),this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick)};const s=i?.handle?.substring(1),n=e.gridstackNode;this.dragEls=!s||e.classList.contains(s)?[e]:n?.subGrid?[e.querySelector(i.handle)||e]:this.getAllHandles(),this.dragEls.length===0&&(this.dragEls=[e]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}getAllHandles(){return Array.from(this.el.querySelectorAll(this.option.handle)).filter(e=>{if(!(e instanceof HTMLElement))return!1;const i=e.closest(".grid-stack-item");return i===this.el||!i})}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(e=>{e.addEventListener("mousedown",this._mouseDown),wt&&(e.addEventListener("touchstart",Cs),e.addEventListener("pointerdown",Ms))}),this.el.classList.remove("ui-draggable-disabled"))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(i=>{i.removeEventListener("mousedown",this._mouseDown),wt&&(i.removeEventListener("touchstart",Cs),i.removeEventListener("pointerdown",Ms))}),e||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(e){return Object.keys(e).forEach(i=>this.option[i]=e[i]),this}_mouseDown(e){if(dt.touchHandled&&e.isTrusted&&(dt.touchHandled=!1),!ue.mouseHandled)return e.button!==0||!this.dragEls.find(i=>i===e.target)&&e.target.closest(uc)||this.option.cancel&&e.target.closest(this.option.cancel)||(this.mouseDownEvent=e,delete this.dragging,delete ue.dragElement,delete ue.dropElement,delete this._autoScrollMaxSpeed,delete this._autoScrollContainer,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),wt&&(e.currentTarget.addEventListener("touchmove",Ts),e.currentTarget.addEventListener("touchend",Ns)),e.preventDefault(),document.activeElement&&document.activeElement.blur(),ue.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const i=N.initEvent(e,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(i,this.ui()),this.triggerEvent("drag",i)}_mouseMove(e){const i=this.mouseDownEvent;if(this.lastDrag=e,this.dragging)if(this._dragFollow(e),ue.pauseDrag){const s=Number.isInteger(ue.pauseDrag)?ue.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(e),s)}else this._callDrag(e);else if(Math.abs(e.x-i.x)+Math.abs(e.y-i.y)>3){this.dragging=!0,ue.dragElement=this;const s=this.el.gridstackNode?.grid;s?ue.dropElement=s.el.ddElement.ddDroppable:delete ue.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=N.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const n=N.initEvent(e,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(n,this.ui()),this.triggerEvent("dragstart",n),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(e){if(this._stopScrolling(),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),wt&&e.currentTarget&&(e.currentTarget.removeEventListener("touchmove",Ts,!0),e.currentTarget.removeEventListener("touchend",Ns,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),ue.dropElement?.el===this.el.parentElement&&delete ue.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const i=N.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),ue.dropElement&&ue.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete ue.dragElement,delete ue.dropElement,delete ue.mouseHandled,e.preventDefault()}_keyEvent(e){const i=this.el.gridstackNode,s=i?.grid||ue.dropElement?.el?.gridstack;if(e.key==="Escape")i&&i._origRotate&&(i._orig=i._origRotate,delete i._origRotate),s?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(i&&s&&(e.key==="r"||e.key==="R")){if(!N.canBeRotated(i))return;i._origRotate=i._origRotate||{...i._orig},delete i._moving,s.setAnimation(!1).rotate(i.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetX}).setAnimation(),i._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,i.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",N.swap(i._orig,"w","h"),delete i._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let e=this.el;return typeof this.option.helper=="function"?e=this.option.helper(this.el):this.option.helper==="clone"&&(e=N.cloneNode(this.el)),e.parentElement||N.appendTo(e,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=es.originStyleProp.map(i=>this.el.style[i]),e}_setupHelperStyle(e){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");const i=this.helper.style;return i.pointerEvents="none",i.width=this.dragOffset.width+"px",i.height=this.dragOffset.height+"px",i.willChange="left, right, top",i.position="fixed",this._dragFollow(e),i.transition="none",setTimeout(()=>{this.helper&&(i.transition=null)},0),this}_removeHelperStyle(){if(this.helper.classList.remove("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.remove("grid-stack-dragging"),!this.helper?.gridstackNode?._isAboutToRemove&&this.dragElementOriginStyle){const i=this.helper,s=this.dragElementOriginStyle.transition||null;i.style.transition=this.dragElementOriginStyle.transition="none",es.originStyleProp.forEach(n=>i.style[n]=this.dragElementOriginStyle[n]||null),setTimeout(()=>i.style.transition=s,50)}return delete this.dragElementOriginStyle,this}_dragFollow(e){const i=this.helper.style,s=this.dragOffset;this.option.rtl?(i.right=(window.innerWidth-e.clientX+s.offsetX)*this.dragTransform.xScale+"px",i.left&&(i.left="")):(i.left=(e.clientX+s.offsetX)*this.dragTransform.xScale+"px",i.right&&(i.right="")),i.top=(e.clientY+s.offsetTop)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(e,i,s){let n=0,r=0;s&&(n=this.dragTransform.xOffset,r=this.dragTransform.yOffset);const o=i.getBoundingClientRect();let l=this.option.rtl?o.right:o.left,u=this.option.rtl?e.clientX-o.right+n:-e.clientX+o.left-n;return{x:l,top:o.top,offsetX:u,offsetTop:-e.clientY+o.top-r,width:o.width*this.dragTransform.xScale,height:o.height*this.dragTransform.yScale}}updateScrollPosition(e){this._autoScrollContainer=N.getScrollElement(e),this._getClipping(this.helper,this._autoScrollContainer)===0?this._stopScrolling():this._autoScrollAnimId||(this._autoScrollAnimId=requestAnimationFrame(this._autoScrollTick))}_getClipping(e,i){const s=e.getBoundingClientRect(),n=i.getBoundingClientRect(),r=window.innerHeight||document.documentElement.clientHeight;if(s.bottomn.bottom)return 0;const o=s.bottom-Math.min(n.bottom,r),l=s.top-Math.max(n.top,0);return l<0?l:o>0?o:0}_stopScrolling(){this._autoScrollAnimId&&(cancelAnimationFrame(this._autoScrollAnimId),delete this._autoScrollAnimId)}ui(){const i=this.el.parentElement.getBoundingClientRect(),s=this.helper.getBoundingClientRect(),n=this.option.rtl?(i.right-s.right)*this.dragTransform.xScale:(s.left-i.left)*this.dragTransform.xScale;return{position:{top:(s.top-i.top)*this.dragTransform.yScale,left:n}}}}es.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","right","top","minWidth","willChange"];class cc extends Kn{constructor(e,i={}){super(),this.el=e,this.option=i,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(e,i){super.on(e,i)}off(e){super.off(e)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),wt&&(this.el.addEventListener("pointerenter",Dr),this.el.addEventListener("pointerleave",Ur)))}disable(e=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),e||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),wt&&(this.el.removeEventListener("pointerenter",Dr),this.el.removeEventListener("pointerleave",Ur)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(e){return Object.keys(e).forEach(i=>this.option[i]=e[i]),this._setupAccept(),this}_mouseEnter(e){if(!ue.dragElement||dt.touchHandled&&e.isTrusted||!this._canDrop(ue.dragElement.el))return;e.preventDefault(),e.stopPropagation(),ue.dragElement._stopScrolling(),ue.dropElement&&ue.dropElement!==this&&ue.dropElement._mouseLeave(e,!0),ue.dropElement=this;const i=N.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(ue.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,i=!1){if(!ue.dragElement||ue.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),i&&ue.dragElement._stopScrolling();const s=N.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(s,this._ui(ue.dragElement)),this.triggerEvent("dropout",s),ue.dropElement===this&&(delete ue.dropElement,!i)){let n,r=this.el.parentElement;for(;!n&&r;)n=r.ddElement?.ddDroppable,r=r.parentElement;n&&n._mouseEnter(e)}}drop(e){e.preventDefault();const i=N.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(ue.dragElement)),this.triggerEvent("drop",i)}_canDrop(e){return e&&(!this.accept||this.accept(e))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=e=>e.classList.contains(this.option.accept)||e.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(e){return{draggable:e.el,...e.ui()}}}class Gn{static init(e){return e.ddElement||(e.ddElement=new Gn(e)),e.ddElement}constructor(e){this.el=e}on(e,i){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.on(e,i):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.on(e,i):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.on(e,i),this}off(e){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(e)>-1?this.ddDraggable.off(e):this.ddDroppable&&["drop","dropover","dropout"].indexOf(e)>-1?this.ddDroppable.off(e):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(e)>-1&&this.ddResizable.off(e),this}setupDraggable(e){return this.ddDraggable?this.ddDraggable.updateOption(e):this.ddDraggable=new es(this.el,e),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(e){return this.ddResizable?this.ddResizable.updateOption(e):this.ddResizable=new Zi(this.el,e),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(e){return this.ddDroppable?this.ddDroppable.updateOption(e):this.ddDroppable=new cc(this.el,e),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class dc{resizable(e,i,s,n){return this._getDDElements(e,i).forEach(r=>{if(i==="disable"||i==="enable")r.ddResizable&&r.ddResizable[i]();else if(i==="destroy")r.ddResizable&&r.cleanResizable();else if(i==="option")r.setupResizable({[s]:n});else{const l=r.el.gridstackNode.grid;let u=r.el.getAttribute("gs-resize-handles")||l.opts.resizable.handles||"e,s,se";u==="all"&&(u="n,e,s,w,se,sw,ne,nw");const d=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:u,autoHide:d,start:i.start,stop:i.stop,resize:i.resize,rtl:i.rtl})}}),this}draggable(e,i,s,n){return this._getDDElements(e,i).forEach(r=>{if(i==="disable"||i==="enable")r.ddDraggable&&r.ddDraggable[i]();else if(i==="destroy")r.ddDraggable&&r.cleanDraggable();else if(i==="option")r.setupDraggable({[s]:n});else{const o=r.el.gridstackNode.grid;r.setupDraggable({...o.opts.draggable,start:i.start,stop:i.stop,drag:i.drag,rtl:i.rtl})}}),this}dragIn(e,i){return this._getDDElements(e).forEach(s=>s.setupDraggable(i)),this}droppable(e,i,s,n){return typeof i.accept=="function"&&!i._accept&&(i._accept=i.accept,i.accept=r=>i._accept(r)),this._getDDElements(e,i).forEach(r=>{i==="disable"||i==="enable"?r.ddDroppable&&r.ddDroppable[i]():i==="destroy"?r.ddDroppable&&r.cleanDroppable():i==="option"?r.setupDroppable({[s]:n}):r.setupDroppable(i)}),this}isDroppable(e){return!!(e?.ddElement?.ddDroppable&&!e.ddElement.ddDroppable.disabled)}isDraggable(e){return!!(e?.ddElement?.ddDraggable&&!e.ddElement.ddDraggable.disabled)}isResizable(e){return!!(e?.ddElement?.ddResizable&&!e.ddElement.ddResizable.disabled)}on(e,i,s){return this._getDDElements(e).forEach(n=>n.on(i,r=>{s(r,ue.dragElement?ue.dragElement.el:r.target,ue.dragElement?ue.dragElement.helper:null)})),this}off(e,i){return this._getDDElements(e).forEach(s=>s.off(i)),this}_getDDElements(e,i){const s=e.gridstack||i!=="destroy"&&i!=="disable",n=N.getElements(e);return n.length?n.map(o=>o.ddElement||(s?Gn.init(o):null)).filter(o=>o):[]}}const rt=new dc;class oe{static init(e={},i=".grid-stack"){if(typeof document>"u")return null;const s=oe.getGridElement(i);return s?(s.gridstack||(s.gridstack=new oe(s,N.cloneDeep(e))),s.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ? +Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(e={},i=".grid-stack"){const s=[];return typeof document>"u"||(oe.getGridElements(i).forEach(n=>{n.gridstack||(n.gridstack=new oe(n,N.cloneDeep(e))),s.push(n.gridstack)}),s.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ? +Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),s}static addGrid(e,i={}){if(!e)return null;let s=e;if(s.gridstack){const o=s.gridstack;return i&&(o.opts={...o.opts,...i}),i.children!==void 0&&o.load(i.children),o}return(!e.classList.contains("grid-stack")||oe.addRemoveCB)&&(oe.addRemoveCB?s=oe.addRemoveCB(e,i,!0,!0):s=N.createDiv(["grid-stack",i.class],e)),oe.init(i,s)}static registerEngine(e){oe.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=N.createDiv([this.opts.placeholderClass,ct.itemClass,this.opts.itemClass]);const e=N.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(e.textContent=this.opts.placeholderText)}return this._placeholder}constructor(e,i={}){this.el=e,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},e.gridstack=this,this.opts=i=i||{},e.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const s=N.toNumber(e.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const n=i.columnOpts;if(n){const d=n.breakpoints;!n.columnWidth&&!d?.length?delete i.columnOpts:(n.columnMax=n.columnMax||12,d?.length>1&&d.sort((c,h)=>(h.w||0)-(c.w||0)))}const r={...N.cloneDeep(ct),column:N.toNumber(e.getAttribute("gs-column"))||ct.column,minRow:s||N.toNumber(e.getAttribute("gs-min-row"))||ct.minRow,maxRow:s||N.toNumber(e.getAttribute("gs-max-row"))||ct.maxRow,staticGrid:N.toBool(e.getAttribute("gs-static"))||ct.staticGrid,sizeToContent:N.toBool(e.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||ct.draggable.handle},removableOptions:{accept:i.itemClass||ct.removableOptions.accept,decline:ct.removableOptions.decline}};e.getAttribute("gs-animate")&&(r.animate=N.toBool(e.getAttribute("gs-animate"))),i=N.defaults(i,r),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=e.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const l=this.el.closest("."+ct.itemClass)?.gridstackNode;if(l&&(l.subGrid=this,this.parentGridNode=l,this.el.classList.add("grid-stack-nested"),l.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==ct.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const d=i.cellHeight;delete i.cellHeight,this.cellHeight(d)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=wt),this._setStaticClass();const u=i.engineClass||oe.engineClass||Gt;if(this.engine=new u({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:d=>{d.forEach(c=>{const h=c.el;h&&(c._removeDOM?(h&&h.remove(),delete c._removeDOM):this._writePosAttr(h,c))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(d=>this._prepareElement(d)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const d=i.children;delete i.children,d.length&&this.load(d)}this.setAnimation(),i.subGridDynamic&&!ue.pauseDrag&&(ue.pauseDrag=!0),i.draggable?.pause!==void 0&&(ue.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(e=this.opts){this.el.classList.add("gs-"+e.column),typeof e.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/e.column}%`)}addWidget(e){if(!e)return;if(typeof e=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(e.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(e);let i,s=e;if(s.grid=this,s.el?i=s.el:oe.addRemoveCB?i=oe.addRemoveCB(this.el,e,!0,!1):i=this.createWidgetDivs(s),!i)return;if(s=i.gridstackNode,s&&i.parentElement===this.el&&this.engine.nodes.find(r=>r._id===s._id))return i;const n=this._readAttr(i);return N.defaults(e,n),this.engine.prepareNode(e),this.el.appendChild(i),this.makeWidget(i,e),i}createWidgetDivs(e){const i=N.createDiv(["grid-stack-item",this.opts.itemClass]),s=N.createDiv(["grid-stack-item-content"],i);return N.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([n])=>{n.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,oe.renderCB(s,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(i))):oe.renderCB(s,e),i}makeSubGrid(e,i,s,n=!0){let r=e.gridstackNode;if(r||(r=this.makeWidget(e).gridstackNode),r.subGrid?.el)return r.subGrid;let o,l=this;for(;l&&!o;)o=l.opts?.subGridOpts,l=l.parentGridNode?.grid;i=N.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...o||{},...i||r.subGridOpts||{}}),r.subGridOpts=i;let u;i.column==="auto"&&(u=!0,i.column=Math.max(r.w||1,s?.w||1),delete i.columnOpts);let d=r.el.querySelector(".grid-stack-item-content"),c,h;if(n&&(this._removeDD(r.el),h={...r,x:0,y:0},N.removeInternalForSave(h),delete h.subGridOpts,r.content&&(h.content=r.content,delete r.content),oe.addRemoveCB?c=oe.addRemoveCB(this.el,h,!0,!1):(c=N.createDiv(["grid-stack-item"]),c.appendChild(d),d=N.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),s){const R=u?i.column:r.w,k=r.h+s.h,C=r.el.style;C.transition="none",this.update(r.el,{w:R,h:k}),setTimeout(()=>C.transition=null)}const v=r.subGrid=oe.addGrid(d,i);return s?._moving&&(v._isTemp=!0),u&&(v._autoColumn=!0),n&&v.makeWidget(c,h),s&&(s._moving?window.setTimeout(()=>N.simulateMouseEvent(s._event,"mouseenter",v.el),0):v.makeWidget(r.el,r)),this.resizeToContentCheck(!1,r),v}removeAsSubGrid(e){const i=this.parentGridNode?.grid;i&&(i.batchUpdate(),i.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(s=>{s.x+=this.parentGridNode.x,s.y+=this.parentGridNode.y,i.makeWidget(s.el,s)}),i.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,e&&window.setTimeout(()=>N.simulateMouseEvent(e._event,"mouseenter",i.el),0))}save(e=!0,i=!1,s=oe.saveCB,n){const r=this.engine.save(e,s,n);if(r.forEach(o=>{if(e&&o.el&&!o.subGrid&&!s){const l=o.el.querySelector(".grid-stack-item-content");o.content=l?.innerHTML,o.content||delete o.content}else if(!e&&!s&&delete o.content,o.subGrid?.el){const l=o.w||o.subGrid.getColumn(),u=o.subGrid.save(e,i,s,l);o.subGridOpts=i?u:{children:u},delete o.subGrid}delete o.el}),i){const o=N.cloneDeep(this.opts);o.marginBottom===o.marginTop&&o.marginRight===o.marginLeft&&o.marginTop===o.marginRight&&(o.margin=o.marginTop,delete o.marginTop,delete o.marginRight,delete o.marginBottom,delete o.marginLeft),o.rtl===(this.el.style.direction==="rtl")&&(o.rtl="auto"),this._isAutoCellHeight&&(o.cellHeight="auto"),this._autoColumn&&(o.column="auto");const l=o._alwaysShowResizeHandle;return delete o._alwaysShowResizeHandle,l!==void 0?o.alwaysShowResizeHandle=l:delete o.alwaysShowResizeHandle,N.removeInternalAndSame(o,ct),o.children=r,o}return r}load(e,i=oe.addRemoveCB||!0){e.forEach(c=>{c.w=c.w||c.minW||1,c.h=c.h||c.minH||1}),e=N.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(c=>{s=Math.max(s,(c.x||0)+c.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s);const n=this.getColumn();s>n&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=e,this.engine.columnChanged(s,n,this.responseLayout),e=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(e,s,!0));const r=oe.addRemoveCB;typeof i=="function"&&(oe.addRemoveCB=i);const o=[];this.batchUpdate();const l=!this.engine.nodes.length,u=l&&this.opts.animate;u&&this.setAnimation(!1),!l&&i&&[...this.engine.nodes].forEach(h=>{if(!h.id)return;N.find(e,h.id)||(oe.addRemoveCB&&oe.addRemoveCB(this.el,h,!1,!1),o.push(h),this.removeWidget(h.el,!0,!1))}),this.engine._loading=!0;const d=[];return this.engine.nodes=this.engine.nodes.filter(c=>N.find(e,c.id)?(d.push(c),!1):!0),e.forEach(c=>{const h=N.find(d,c.id);if(h){if(N.shouldSizeToContent(h)&&(c.h=h.h),this.engine.nodeBoundFix(c),(c.autoPosition||c.x===void 0||c.y===void 0)&&(c.w=c.w||h.w,c.h=c.h||h.h,this.engine.findEmptyPosition(c)),this.engine.nodes.push(h),N.samePos(h,c)&&this.engine.nodes.length>1&&(this.moveNode(h,{...c,forceCollide:!0}),N.copyPos(c,h)),this.update(h.el,c),c.subGridOpts?.children){const v=h.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(c.subGridOpts.children)}}else i&&this.addWidget(c)}),delete this.engine._loading,this.engine.removedNodes=o,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?oe.addRemoveCB=r:delete oe.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(e=!0){return this.engine.batchUpdate(e),e||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(e=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!e||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const i=this.el.querySelector("."+this.opts.itemClass);if(i){const n=N.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/n)}const s=parseInt(this.el.getAttribute("gs-current-row"));return s?Math.round(this.el.getBoundingClientRect().height/s):this.opts.cellHeight}cellHeight(e){if(e!==void 0&&this._isAutoCellHeight!==(e==="auto")&&(this._isAutoCellHeight=e==="auto",this._updateResizeEvent()),(e==="initial"||e==="auto")&&(e=void 0),e===void 0){const s=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;e=this.cellWidth()+s}const i=N.parseHeight(e);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(e=!1){return e&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){const e=this.opts.columnOpts;if(!e||!e.columnWidth&&!e.breakpoints?.length)return!1;const i=this.getColumn();let s=i;const n=this._widthOrContainer(!0);if(e.columnWidth)s=Math.min(Math.round(n/e.columnWidth)||1,e.columnMax);else{s=e.columnMax;let r=0;for(;ro.c===s);return this.column(s,r?.layout||e.layout),!0}return!1}compact(e="compact",i=!0){return this.engine.compact(e,i),this._triggerChangeEvent(),this}column(e,i="moveScale"){if(!e||e<1||this.opts.column===e)return this;const s=this.getColumn();return this.opts.column=e,this.engine?(this.engine.column=e,this.el.classList.remove("gs-"+s),this._updateColumnVar(),this.engine.columnChanged(s,e,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(e=>e.matches("."+this.opts.itemClass)&&!e.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(e=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),e?this.el.parentNode.removeChild(this.el):(this.removeAll(e),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,delete this._placeholder?.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(e){return this.opts.float!==e&&(this.opts.float=this.engine.float=e,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(e,i=!1){const s=this.el.getBoundingClientRect();let n;i?n={top:s.top+document.documentElement.scrollTop,left:s.left}:n={top:this.el.offsetTop,left:this.el.offsetLeft};const r=e.left-n.left,o=e.top-n.top,l=s.width/this.getColumn(),u=s.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(r/l),y:Math.floor(o/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(e,i,s,n){return this.engine.isAreaEmpty(e,i,s,n)}makeWidget(e,i){const s=oe.getElement(e);if(!s||s.gridstackNode)return s;s.parentElement||this.el.appendChild(s),this._prepareElement(s,!0,i);const n=s.gridstackNode;this._updateContainerHeight(),n.subGridOpts&&this.makeSubGrid(s,n.subGridOpts,void 0,!1);let r;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(r=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),r&&delete this._ignoreLayoutsNodeChange,s}on(e,i){return e.indexOf(" ")!==-1?(e.split(" ").forEach(n=>this.on(n,i)),this):(e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable"?(e==="enable"||e==="disable"?this._gsEventHandler[e]=n=>i(n):this._gsEventHandler[e]=n=>{n.detail&&i(n,n.detail)},this.el.addEventListener(e,this._gsEventHandler[e])):e==="drag"||e==="dragstart"||e==="dragstop"||e==="resizestart"||e==="resize"||e==="resizestop"||e==="dropped"||e==="resizecontent"?this._gsEventHandler[e]=i:console.error("GridStack.on("+e+") event not supported"),this)}off(e){return e.indexOf(" ")!==-1?(e.split(" ").forEach(s=>this.off(s)),this):((e==="change"||e==="added"||e==="removed"||e==="enable"||e==="disable")&&this._gsEventHandler[e]&&this.el.removeEventListener(e,this._gsEventHandler[e]),delete this._gsEventHandler[e],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(e=>this.off(e)),this}removeWidget(e,i=!0,s=!0){return e?(oe.getElements(e).forEach(n=>{if(n.parentElement&&n.parentElement!==this.el)return;let r=n.gridstackNode;r||(r=this.engine.nodes.find(o=>n===o.el)),r&&(i&&oe.addRemoveCB&&oe.addRemoveCB(this.el,r,!1,!1),delete n.gridstackNode,this._removeDD(n),this.engine.removeNode(r,i,s),i&&n.parentElement&&n.remove())}),s&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(e=!0,i=!0){return this.engine.nodes.forEach(s=>{e&&oe.addRemoveCB&&oe.addRemoveCB(this.el,s,!1,!1),delete s.el.gridstackNode,this.opts.staticGrid||this._removeDD(s.el)}),this.engine.removeAll(e,i),i&&this._triggerRemoveEvent(),this}setAnimation(e=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(e)}):e?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=e,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(e,i=!0,s=!0){return!!this.opts.staticGrid===e?this:(e?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(n=>{this.prepareDragDrop(n.el),n.subGrid&&s&&n.subGrid.setStatic(e,i,s)}),i&&this._setStaticClass(),this)}updateOptions(e){const i=this.opts;if(e===i)return this;if(e.acceptWidgets!==void 0&&(i.acceptWidgets=e.acceptWidgets,this._setupAcceptWidget()),e.animate!==void 0&&this.setAnimation(e.animate),e.cellHeight&&this.cellHeight(e.cellHeight),e.class!==void 0&&e.class!==i.class&&(i.class&&this.el.classList.remove(i.class),e.class&&this.el.classList.add(e.class)),e.columnOpts){const s=!!this.opts.columnOpts;this.opts.columnOpts=e.columnOpts,s!==!!this.opts.columnOpts&&this._updateResizeEvent(),this.checkDynamicColumn()}else e.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof e.column=="number"&&this.column(e.column);return e.margin!==void 0&&this.margin(e.margin),e.staticGrid!==void 0&&this.setStatic(e.staticGrid),e.disableDrag!==void 0&&!e.staticGrid&&this.enableMove(!e.disableDrag),e.disableResize!==void 0&&!e.staticGrid&&this.enableResize(!e.disableResize),e.float!==void 0&&this.float(e.float),e.row!==void 0?(i.minRow=i.maxRow=i.row=e.row,this._updateContainerHeight()):(e.minRow!==void 0&&(i.minRow=e.minRow,this._updateContainerHeight()),e.maxRow!==void 0&&(i.maxRow=this.engine.maxRow=e.maxRow)),e.lazyLoad!==void 0&&(i.lazyLoad=e.lazyLoad),e.children?.length&&this.load(e.children),this}update(e,i){return oe.getElements(e).forEach(s=>{const n=s?.gridstackNode;if(!n)return;const r={...N.copyPos({},n),...N.cloneDeep(i)};this.engine.nodeBoundFix(r),delete r.autoPosition;const o=["x","y","w","h"];let l;if(o.some(c=>r[c]!==void 0&&r[c]!==n[c])&&(l={},o.forEach(c=>{l[c]=r[c]!==void 0?r[c]:n[c],delete r[c]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const c=s.querySelector(".grid-stack-item-content");c&&c.textContent!==r.content&&(n.content=r.content,oe.renderCB(c,r),n.subGrid?.el&&(c.appendChild(n.subGrid.el),n.subGrid._updateContainerHeight())),delete r.content}let u=!1,d=!1;for(const c in r)c[0]!=="_"&&n[c]!==r[c]&&(n[c]=r[c],u=!0,d=d||!this.opts.staticGrid&&(c==="noResize"||c==="noMove"||c==="locked"));if(N.sanitizeMinMax(n),l){const c=l.w!==void 0&&l.w!==n.w;this.moveNode(n,l),c&&n.subGrid?n.subGrid.onResize(this.hasAnimationCSS()?n.w:void 0):this.resizeToContentCheck(c,n),delete n._orig}(l||u)&&this._writeAttr(s,n),d&&this.prepareDragDrop(n.el),oe.updateCB&&oe.updateCB(n)}),this}moveNode(e,i){const s=e._updating;s||this.engine.cleanNodes().beginUpdate(e),this.engine.moveNode(e,i),this._updateContainerHeight(),s||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(e){if(!e||(e.classList.remove("size-to-content-max"),!e.clientHeight))return;const i=e.gridstackNode;if(!i)return;const s=i.grid;if(!s||e.parentElement!==s.el)return;const n=s.getCellHeight(!0);if(!n)return;let r=i.h?i.h*n:e.clientHeight,o;if(i.resizeToContentParent&&(o=e.querySelector(i.resizeToContentParent)),o||(o=e.querySelector(oe.resizeToContentParent)),!o)return;const l=e.clientHeight-o.clientHeight,u=i.h?i.h*n-l:o.clientHeight;let d;if(i.subGrid){d=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);const v=i.subGrid.el.getBoundingClientRect(),R=e.getBoundingClientRect();d+=v.top-R.top}else{if(i.subGridOpts?.children?.length)return;{const v=o.firstElementChild;if(!v){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${oe.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}d=v.getBoundingClientRect().height||u}}if(u===d)return;r+=d-u;let c=Math.ceil(r/n);const h=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;h&&c>h&&(c=h,e.classList.add("size-to-content-max")),i.minH&&ci.maxH&&(c=i.maxH),c!==i.h&&(s._ignoreLayoutsNodeChange=!0,s.moveNode(i,{h:c}),delete s._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){oe.resizeToContentCB?oe.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,i){return oe.getElements(e).forEach(s=>{const n=s.gridstackNode;if(!N.canBeRotated(n))return;const r={w:n.h,h:n.w,minH:n.minW,minW:n.minH,maxH:n.maxW,maxW:n.maxH};if(i){const l=i.left>0?Math.floor(i.left/this.cellWidth()):0,u=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;r.x=n.x+l-(n.h-(u+1)),r.y=n.y+u-l}Object.keys(r).forEach(l=>{r[l]===void 0&&delete r[l]});const o=n._orig;this.update(s,r),n._orig=o}),this}margin(e){if(!(typeof e=="string"&&e.split(" ").length>1)){const s=N.parseHeight(e);if(this.opts.marginUnit===s.unit&&this.opts.margin===s.h)return}return this.opts.margin=e,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(e){return this.engine.willItFit(e)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const e=this.engine.getDirtyNodes(!0);return e&&e.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(e),this._triggerEvent("change",e)),this.engine.saveInitial(),this}_triggerAddEvent(){if(this.engine.batchMode)return this;if(this.engine.addedNodes?.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(i=>{delete i._dirty});const e=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",e)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){const e=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",e)}return this}_triggerEvent(e,i){const s=i?new CustomEvent(e,{bubbles:!1,detail:i}):new Event(e);let n=this;for(;n.parentGridNode;)n=n.parentGridNode.grid;return n.el.dispatchEvent(s),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const e=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const s=this.opts.cellHeight,n=this.opts.cellHeightUnit;if(!s)return this;if(!e&&!this.opts.minRow){const r=N.parseHeight(getComputedStyle(this.el).minHeight);if(r.h>0&&r.unit===n){const o=Math.floor(r.h/s);i1?`calc(${i.w} * var(--gs-column-width))`:null,e.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null}return e.setAttribute("gs-x",String(i.x)),e.setAttribute("gs-y",String(i.y)),i.w>1?e.setAttribute("gs-w",String(i.w)):e.removeAttribute("gs-w"),i.h>1?e.setAttribute("gs-h",String(i.h)):e.removeAttribute("gs-h"),this}_writeAttr(e,i){if(!i)return this;this._writePosAttr(e,i);const s={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const n in s)i[n]?e.setAttribute(s[n],String(i[n])):e.removeAttribute(s[n]);return this}_readAttr(e,i=!0){const s={};s.x=N.toNumber(e.getAttribute("gs-x")),s.y=N.toNumber(e.getAttribute("gs-y")),s.w=N.toNumber(e.getAttribute("gs-w")),s.h=N.toNumber(e.getAttribute("gs-h")),s.autoPosition=N.toBool(e.getAttribute("gs-auto-position")),s.noResize=N.toBool(e.getAttribute("gs-no-resize")),s.noMove=N.toBool(e.getAttribute("gs-no-move")),s.locked=N.toBool(e.getAttribute("gs-locked"));const n=e.getAttribute("gs-size-to-content");n&&(n==="true"||n==="false"?s.sizeToContent=N.toBool(n):s.sizeToContent=parseInt(n,10)),s.id=e.getAttribute("gs-id"),s.maxW=N.toNumber(e.getAttribute("gs-max-w")),s.minW=N.toNumber(e.getAttribute("gs-min-w")),s.maxH=N.toNumber(e.getAttribute("gs-max-h")),s.minH=N.toNumber(e.getAttribute("gs-min-h")),i&&(s.w===1&&e.removeAttribute("gs-w"),s.h===1&&e.removeAttribute("gs-h"),s.maxW&&e.removeAttribute("gs-max-w"),s.minW&&e.removeAttribute("gs-min-w"),s.maxH&&e.removeAttribute("gs-max-h"),s.minH&&e.removeAttribute("gs-min-h"));for(const r in s){if(!s.hasOwnProperty(r))return;!s[r]&&s[r]!==0&&r!=="sizeToContent"&&delete s[r]}return s}_setStaticClass(){const e=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...e),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...e),this.el.removeAttribute("gs-static")),this}onResize(e=this.el?.clientWidth){if(!e||this.prevWidth===e)return;this.prevWidth=e,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(s=>{s.subGrid&&s.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(e=!1,i=void 0){if(this.engine){if(e&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)N.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(s=>N.shouldSizeToContent(s))){const s=[...this.engine.nodes];this.batchUpdate(),s.forEach(n=>{N.shouldSizeToContent(n)&&this.resizeToContentCBCheck(n.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(e=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(s=>s.sizeToContent));return!e&&i&&!this.resizeObserver?(this._sizeThrottle=N.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(e||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(e=".grid-stack-item"){return N.getElement(e)}static getElements(e=".grid-stack-item"){return N.getElements(e)}static getGridElement(e){return oe.getElement(e)}static getGridElements(e){return N.getElements(e)}_initMargin(){let e,i=0,s=[];typeof this.opts.margin=="string"&&(s=this.opts.margin.split(" ")),s.length===2?(this.opts.marginTop=this.opts.marginBottom=s[0],this.opts.marginLeft=this.opts.marginRight=s[1]):s.length===4?(this.opts.marginTop=s[0],this.opts.marginRight=s[1],this.opts.marginBottom=s[2],this.opts.marginLeft=s[3]):(e=N.parseHeight(this.opts.margin),this.opts.marginUnit=e.unit,i=this.opts.margin=e.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(o=>{this.opts[o]===void 0?this.opts[o]=i:(e=N.parseHeight(this.opts[o]),this.opts[o]=e.h,delete this.opts.margin)}),this.opts.marginUnit=e.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const r=this.el.style;return r.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),r.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return rt}static setupDragIn(e,i,s,n=document){i?.pause!==void 0&&(ue.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof e=="string"?N.getElements(e,n):e).forEach((o,l)=>{rt.isDraggable(o)||rt.dragIn(o,i),s?.[l]&&(o.gridstackNode=s[l])})}movable(e,i){return this.opts.staticGrid?this:(oe.getElements(e).forEach(s=>{const n=s.gridstackNode;n&&(i?delete n.noMove:n.noMove=!0,this.prepareDragDrop(n.el))}),this)}resizable(e,i){return this.opts.staticGrid?this:(oe.getElements(e).forEach(s=>{const n=s.gridstackNode;n&&(i?delete n.noResize:n.noResize=!0,this.prepareDragDrop(n.el))}),this)}disable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!1,e),this.enableResize(!1,e),this._triggerEvent("disable"),this}enable(e=!0){if(!this.opts.staticGrid)return this.enableMove(!0,e),this.enableResize(!0,e),this._triggerEvent("enable"),this}enableMove(e,i=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.enableMove(e,i)}),this)}enableResize(e,i=!0){return this.opts.staticGrid?this:(e?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.enableResize(e,i)}),this)}cancelDrag(){const e=this._placeholder?.gridstackNode;e&&(e._isExternal?(e._isAboutToRemove=!0,this.engine.removeNode(e)):e._isAboutToRemove&&oe._itemRemoving(e.el,!1),this.engine.restoreInitial())}_removeDD(e){return rt.draggable(e,"destroy").resizable(e,"destroy"),e.gridstackNode&&delete e.gridstackNode._initDD,delete e.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return rt.droppable(this.el,"destroy"),this;let e,i;const s=(n,r,o)=>{o=o||r;const l=o.gridstackNode;if(!l)return;if(!l.grid?.el){o.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const v=o.getBoundingClientRect();o.style.left=v.x+(this.dragTransform.xScale-1)*(n.clientX-v.x)/this.dragTransform.xScale+"px",o.style.top=v.y+(this.dragTransform.yScale-1)*(n.clientY-v.y)/this.dragTransform.yScale+"px",o.style.transformOrigin="0px 0px"}let{top:u,left:d}=o.getBoundingClientRect();const c=this.el.getBoundingClientRect();d-=c.left,u-=c.top;const h={position:{top:u*this.dragTransform.xScale,left:d*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(d/i)),l.y=Math.max(0,Math.round(u/e)),delete l.autoPosition,this.engine.nodeBoundFix(l),!this.engine.willItFit(l)){if(l.autoPosition=!0,!this.engine.willItFit(l)){rt.off(r,"drag");return}l._willFitPos&&(N.copyPos(l,l._willFitPos),delete l._willFitPos)}this._onStartMoving(o,n,h,l,i,e)}else this._dragOrResize(o,n,h,l,i,e)};return rt.droppable(this.el,{accept:n=>{const r=n.gridstackNode||this._readAttr(n,!1);if(r?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let o=!0;if(typeof this.opts.acceptWidgets=="function")o=this.opts.acceptWidgets(n);else{const l=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;o=n.matches(l)}if(o&&r&&this.opts.maxRow){const l={w:r.w,h:r.h,minW:r.minW,minH:r.minH};o=this.engine.willItFit(l)}return o}}).on(this.el,"dropover",(n,r,o)=>{let l=o?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._temporaryRemoved)return!1;if(l?._sidebarOrig&&(l.w=l._sidebarOrig.w,l.h=l._sidebarOrig.h),l?.grid&&l.grid!==this&&!l._temporaryRemoved&&l.grid._leave(r,o),o=o||r,i=this.cellWidth(),e=this.getCellHeight(!0),!l){const c=o.getAttribute("data-gs-widget")||o.getAttribute("gridstacknode");if(c){try{l=JSON.parse(c)}catch{console.error("Gridstack dropover: Bad JSON format: ",c)}o.removeAttribute("data-gs-widget"),o.removeAttribute("gridstacknode")}l||(l=this._readAttr(o)),l._sidebarOrig={w:l.w,h:l.h}}l.grid||(l.el||(l={...l}),l._isExternal=!0,o.gridstackNode=l);const u=l.w||Math.round(o.offsetWidth/i)||1,d=l.h||Math.round(o.offsetHeight/e)||1;return l.grid&&l.grid!==this?(r._gridstackNodeOrig||(r._gridstackNodeOrig=l),r.gridstackNode=l={...l,w:u,h:d,grid:this},delete l.x,delete l.y,this.engine.cleanupNode(l).nodeBoundFix(l),l._initDD=l._isExternal=l._temporaryRemoved=!0):(l.w=u,l.h=d,l._temporaryRemoved=!0),oe._itemRemoving(l.el,!1),rt.on(r,"drag",s),s(n,r,o),!1}).on(this.el,"dropout",(n,r,o)=>{const l=o?.gridstackNode||r.gridstackNode;return l&&(!l.grid||l.grid===this)&&(this._leave(r,o),this._isTemp&&this.removeAsSubGrid(l)),!1}).on(this.el,"drop",(n,r,o)=>{const l=o?.gridstackNode||r.gridstackNode;if(l?.grid===this&&!l._isExternal)return!1;const u=!!this.placeholder.parentElement,d=r!==o;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const c=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&c?.grid&&c.grid!==this){const v=c.grid;v.engine.removeNodeFromLayoutCache(c),v.engine.removedNodes.push(c),v._triggerRemoveEvent()._triggerChangeEvent(),v.parentGridNode&&!v.engine.nodes.length&&v.opts.subGridDynamic&&v.removeAsSubGrid()}if(!l||(u&&(this.engine.cleanupNode(l),l.grid=this),delete l.grid?._isTemp,rt.off(r,"drag"),o!==r?(o.remove(),r=o):r.remove(),this._removeDD(r),!u))return!1;const h=l.subGrid?.el?.gridstack;return N.copyPos(l,this._readAttr(this.placeholder)),N.removePositioningStyles(r),d&&(l.content||l.subGridOpts||oe.addRemoveCB)?(delete l.el,r=this.addWidget(l)):(this._prepareElement(r,!0,l),this.el.appendChild(r),this.resizeToContentCheck(!1,l),h&&(h.parentGridNode=l),this._updateContainerHeight()),this.engine.addedNodes.push(l),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...n,type:"dropped"},c&&c.grid?c:void 0,l),!1}),this}static _itemRemoving(e,i){if(!e)return;const s=e?e.gridstackNode:void 0;!s?.grid||e.classList.contains(s.grid.opts.removableOptions.decline)||(i?s._isAboutToRemove=!0:delete s._isAboutToRemove,i?e.classList.add("grid-stack-item-removing"):e.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const e=document.querySelector(this.opts.removable);return e?(!this.opts.staticGrid&&!rt.isDroppable(e)&&rt.droppable(e,this.opts.removableOptions).on(e,"dropover",(i,s)=>oe._itemRemoving(s,!0)).on(e,"dropout",(i,s)=>oe._itemRemoving(s,!1)),this):this}prepareDragDrop(e,i=!1){const s=e?.gridstackNode;if(!s)return;const n=s.noMove||this.opts.disableDrag,r=s.noResize||this.opts.disableResize,o=this.opts.staticGrid||n&&r;if((i||o)&&(s._initDD&&(this._removeDD(e),delete s._initDD),o))return e.classList.add("ui-draggable-disabled","ui-resizable-disabled"),this;if(!s._initDD){let l,u;const d=(v,R)=>{this.triggerEvent(v,v.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,v,R,s,l,u)},c=(v,R)=>{this._dragOrResize(e,v,R,s,l,u)},h=v=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete s._moving,delete s._resizing,delete s._event,delete s._lastTried;const R=s.w!==s._orig.w,k=v.target;if(!(!k.gridstackNode||k.gridstackNode.grid!==this)){if(s.el=k,s._isAboutToRemove){const C=e.gridstackNode.grid;C._gsEventHandler[v.type]&&C._gsEventHandler[v.type](v,k),C.engine.nodes.push(s),C.removeWidget(e,!0,!0)}else N.removePositioningStyles(k),s._temporaryRemoved?(this._writePosAttr(k,s),this.engine.addNode(s)):this._writePosAttr(k,s),this.triggerEvent(v,k);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),v.type==="resizestop"&&(Number.isInteger(s.sizeToContent)&&(s.sizeToContent=s.h),this.resizeToContentCheck(R,s))}};rt.draggable(e,{start:d,stop:h,drag:c,rtl:this.opts.rtl}).resizable(e,{start:d,stop:h,resize:c,rtl:this.opts.rtl}),s._initDD=!0}return rt.draggable(e,n?"disable":"enable").resizable(e,r?"disable":"enable"),this}_onStartMoving(e,i,s,n,r,o){if(this.engine.cleanNodes().beginUpdate(n),this._writePosAttr(this.placeholder,n),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=n,n.grid?.el)this.dragTransform=N.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=N.getValuesFromTransformedElement(l)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(n.el=this.placeholder,n._lastUiPosition=s.position,n._prevYPix=s.position.top,n._moving=i.type==="dragstart",n._resizing=i.type==="resizestart",delete n._lastTried,i.type==="dropover"&&n._temporaryRemoved&&(this.engine.addNode(n),n._moving=!0),this.engine.cacheRects(r,o,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const l=this.getColumn()-n.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-n.y;rt.resizable(e,"option","minWidth",r*Math.min(n.minW||1,l)).resizable(e,"option","minHeight",o*Math.min(n.minH||1,u)).resizable(e,"option","maxWidth",r*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,l)).resizable(e,"option","maxWidthMoveLeft",r*Math.min(n.maxW||Number.MAX_SAFE_INTEGER,n.x+n.w)).resizable(e,"option","maxHeight",o*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(e,"option","maxHeightMoveUp",o*Math.min(n.maxH||Number.MAX_SAFE_INTEGER,n.y+n.h))}}_dragOrResize(e,i,s,n,r,o){const l={...n._orig};let u,d=this.opts.marginLeft,c=this.opts.marginRight,h=this.opts.marginTop,v=this.opts.marginBottom;const R=Math.round(o*.1),k=Math.round(r*.1);if(d=Math.min(d,k),c=Math.min(c,k),h=Math.min(h,R),v=Math.min(v,R),i.type==="drag"){if(n._temporaryRemoved)return;n._prevYPix=s.position.top,this.opts.draggable.scroll!==!1&&ue.dragElement?.updateScrollPosition(this.el);const P=s.position.left+(s.position.left>n._lastUiPosition.left?-c:d),B=s.position.top+(s.position.top>n._lastUiPosition.top?-v:h);l.x=Math.round(P/r),l.y=Math.round(B/o);const D=this._extraDragRow;if(this.engine.collide(n,l)){const re=this.getRow();let L=Math.max(0,l.y+n.h-re);this.opts.maxRow&&re+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-re)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==D&&this._updateContainerHeight(),n.x===l.x&&n.y===l.y)return}else if(i.type==="resize"){if(l.x<0||(N.updateScrollResize(i,e,o),l.w=Math.round((s.size.width-d)/r),l.h=Math.round((s.size.height-h)/o),n.w===l.w&&n.h===l.h)||n._lastTried&&n._lastTried.w===l.w&&n._lastTried.h===l.h)return;if(i.hasMovedX){const P=s.position.left+d;l.x=Math.round(P/r)}if(i.hasMovedY){const P=s.position.top+h;l.y=Math.round(P/o)}u=!0}n._event=i,n._lastTried=l;const C={x:s.position.left+d,y:s.position.top+h,w:(s.size?s.size.width:n.w*r)-d-c,h:(s.size?s.size.height:n.h*o)-h-v};if(this.engine.moveNodeCheck(n,{...l,cellWidth:r,cellHeight:o,rect:C,resizing:u})){n._lastUiPosition=s.position,this.engine.cacheRects(r,o,h,c,v,d),delete n._skipDown,u&&n.subGrid&&n.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const P=i.target;n._sidebarOrig||this._writePosAttr(P,n),this.triggerEvent(i,P)}}triggerEvent(e,i){let s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;s._gsEventHandler[e.type]&&s._gsEventHandler[e.type](e,i)}_leave(e,i){i=i||e;const s=i.gridstackNode;if(!s||(i.style.transform=i.style.transformOrigin=null,rt.off(e,"drag"),s._temporaryRemoved))return;s._temporaryRemoved=!0,this.engine.removeNode(s),s.el=s._isExternal&&i?i:e;const n=s._sidebarOrig;s._isExternal&&this.engine.cleanupNode(s),s._sidebarOrig=n,this.opts.removable===!0&&oe._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):s._isExternal&&this.engine.restoreInitial()}}oe.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)};oe.resizeToContentParent=".grid-stack-item-content";oe.Utils=N;oe.Engine=Gt;oe.GDRev="12.6.0";const fc="/backend/api/hmi/v1";class el extends Error{constructor(e,i){super(i),this.status=e,this.name="HmiHttpError"}status}let li=null;function tl(){return li}async function hc(t,e,i){return li=await be("/security/login","POST",{username:t,password:e,station:i}),li}async function pc(){try{await be("/security/logout","POST",{})}finally{li=null}}async function Br(){return li=await be("/security/csrf","GET"),li}async function be(t,e="GET",i){const s={Accept:"application/json"};i!==void 0&&(s["Content-Type"]="application/json"),e!=="GET"&&e!=="HEAD"&&li&&(s["X-CSRF-Token"]=li.csrf);const n=await fetch(`${fc}${t}`,{method:e,headers:s,credentials:"same-origin",body:i===void 0?void 0:JSON.stringify(i)}),r=await n.text();let o;try{o=r?JSON.parse(r):{}}catch{o={error:r.slice(0,300)}}if(!n.ok){const l=n.status===401?"Keine IMSAPI-Anmeldung. Bitte Benutzer, Passwort und Station eingeben.":n.status===403?"HMI-Berechtigung fehlt oder CSRF ist ungültig (HTTP 403).":n.status===503?"Datenbank bzw. HMI-Schema nicht bereit (HTTP 503). Siehe Diagnose.":o?.error&&!String(o.error).trim().startsWith("<")?String(o.error)+(typeof o.imsapiReturnValue=="number"?" [IMSAPI "+o.imsapiReturnValue+"]":""):`${e} ${t}: HTTP ${n.status}`;throw new el(n.status,l)}return o}const gc=[{id:"station-tree",type:"wb.station-tree",x:0,y:0,w:7,h:6,mandatory:!1,personalizable:!0,props:{title:"Fertigungsbaum"}},{id:"history",type:"wb.history",x:7,y:0,w:5,h:4,mandatory:!1,personalizable:!0,props:{title:"History & Booking",module:"history"}},{id:"workorder",type:"wb.workorders",x:7,y:4,w:5,h:3,mandatory:!1,personalizable:!0,props:{title:"Auftragsaktivierung",module:"workorder"}},{id:"config",type:"wb.station-config",x:0,y:6,w:7,h:6,mandatory:!1,personalizable:!0,props:{title:"Stationskonfiguration",source:"station-config"}},{id:"activities",type:"wb.activities",x:7,y:7,w:5,h:4,mandatory:!1,personalizable:!0,props:{title:"Manuelle Fertigung",module:"activities"}}],nn={layout:{widgets:gc},preferences:{fontScale:1,theme:"ios",contrast:"normal",accent:"#a40640"}},mc={800:"SMS_MOBIL_PHONE_NR",1e3:"Flag PASS",1001:"Flag REWORK",1002:"Flag SCRAP",1010:"Failure record type",1011:"Channel number",1100:"Supplier type",1101:"Failure type category",1102:"Failure reason category",1103:"Keyboard type",1104:"State type",2e3:"Digitizer type",2001:"X-REF1",2002:"Y-REF1",2003:"X-REF2",2004:"Y-REF2",4001:"RETURN_RJOU_THRESHOLD",4010:"BDE THRESHOLD",4011:"Account TR-BDE conforming to shift(TRUE/FALSE)",4012:"Do TR to RM booking only when previous workstep has enough PASS(TRUE/FALSE)",4015:"Workorder time",4016:"QM-Analyses: Use RM-Good-Bookings (TRUE/FALSE) (Default: TR-bookings are used)",5001:"Password Scrap",6e3:"SCANNER-BARCODE",6001:"SCANNER-BOARD-SNR",7003:"UTILS_PART_DNC_SCHEMA",7004:"UTILS_PART_FILE_ID_SCHEMA",7005:"Target directory Schema",7006:"UTILS_PART_DNC_LAYOUT",7007:"UTILS_PART_FILE_ID_LAYOUT",7008:"Target directory Layout",7010:"Target directory CDB_DATA LAYOUT",7011:"PR Open 2nd view in Layouter(TRUE/FALSE)",7012:"PR File extension for 2nd viewer file",7013:"Paternoster active (TRUE/FALSE)",7020:"Source directory Layout",7021:"Source directory Viewer",7022:"Target directory Viewer",7023:"Call Layout",7024:"Call Viewer",7025:"Start Layouter automatically (TRUE/FALSE)",7026:"BOM Check in PR automatically (TRUE/FALSE)",7027:"BOM check with status (TRUE/FALSE)",7028:"BOM check with quantity (TRUE/FALSE)",7029:"SETUP Tear down locked reels automatically (TRUE/FALSE)",7033:"CopyViewerData (TRUE/FALSE) [TRUE]=Copy, [FALSE] do not copy",7100:"Layouter class",7101:"Layout active (TRUE/FALSE)",7102:"Viewer active (TRUE/FALSE)",7103:"Digitizer active (TRUE/FALSE)",7104:"OPMA_KAP active (TRUE/FALSE)",7105:"OPMA_MAGRP active (TRUE/FALSE)",7106:"Number of opm uploads the server should cache for station",7107:"Reset OPM-A Kap Cache on product change (TRUE/FALSE)",7108:"Reset OPM-A Kap Cache on workorder change (TRUE/FALSE)",7109:"Reset OPM-A Kap Cache on shift change (TRUE/FALSE)",7110:"Cycle time active (TRUE/FALSE)",7120:"(PR) Workstep query serial no (TRUE/FALSE)",7125:"PR Tester dialog always active (TRUE/FALSE)",7126:"PR Setup dialog always active (TRUE/FALSE)",7127:"Register active PR workorder (TRUE/FALSE)",7128:"PR Panel Flag N Snr Register single (TRUE/FALSE)",7129:"PR Check always serial number state (TRUE/FALSE)",7130:"PR Merge to next level (TRUE/FALSE)",7131:"PR Merge with equal serial no (TRUE/FALSE)",7132:"Activated only if BOM-Check ok (TRUE/FALSE)",7133:"Default Position Pattern",7134:"Check expiration (TRUE/FALSE)",7135:"Enable multiple positions for same part (TRUE/FALSE)",7136:"Enable create container in setup dialog (TRUE/FALSE)",7137:"Print label config file",7138:"Print label output",7139:"Maximum number of repairs",7140:"Repair counting for all uploads (TRUE/FALSE)",7141:"Exceeding repairs procedure (0, 1, 2)",7150:"Panel-related setup (TRUE/FALSE)",7160:"PR Setup Station Activate Work Order (TRUE/FALSE)",7200:"ICT Failure type",7201:"FailureCode for checkSerialUnitState book fail",7202:"TR Automatic upload state of previous work step (FALSE/L/W)",7203:"API Check all previous steps concerning uploaded state (TRUE/FALSE)",7204:"API Test Retry counter for CheckState (J/N/D)",7205:"API_GETSNRBYSNRREF_SINGLE_ERROR (TRUE/FALSE)",7206:"API_Check_merge_to_BOM (TRUE/FALSE) TRUE=check BOM Qty",7207:"API_UNMERGEPARTS deactivate (M)aster, (S)lave or (N)othing",7208:"API_IGNORE_SNR_UNIQUE_FOR_MERGE (TRUE/FALSE)",7209:"Loop counter only for active error codes (TRUE/FALSE)",7210:"CHECK_ANOMALY_FOR_RESULT_DATA (TRUE/FALSE)",7211:"CHECK_ANOMALY_ERROR_CODE (Errorcode for attributive error)",7212:"CHECK_ANOMALY_FAILCODE (Failcode for measurecode_wert)",7213:"CHECK_ANOMALY_RESET_TIME (ResetTime in sec)",7214:"CHECK_ANOMALIE_FOR_2ND_UPLOAD_INFLUENCE_code_wertS",7215:"CHECK_ANOMALIE_FOR_2ND_UPLOAD_CHANGE_MODEL",7216:"CHECK_ANOMALIE_PSEUDO_ERROR_CODE",7217:"Check the Batch Quantity in API-Call verifyMerge (TRUE/FALSE)",7218:"CODE_API_CHECK_MERGED_PARTS_COMPLETE (TRUE/FALSE)",7219:"API Check merge to BOM with client version (TRUE/FALSE) TRUE=check BOM Qty",7220:"Report Merge to ERP-System (TRUE/FALSE)",7221:"PR_UNMERGE_EXTENSION free Text(WO actual WorkOrder)",7222:"SWITCH_SERIALNO_AFTER_MERGE (TRUE/FALSE)",7223:"Enable check for consecutive fault (TRUE/FALSE)",7224:"Cancel Upload on station locked (TRUE/FALSE)",7225:"Add Time[min] for Messages :mdcUploadStationCondition endDate = (startDate + X)",7226:"Check code: 16000 to resolve the state of the serial number (TRUE/FALSE)",7227:"Tranfer MDC station conditions to ERP (TRUE/FALSE)",7228:"Max. quantity off registered batches at station",7230:"Correction factor for cycle time",7250:"SPA_FUNCTION_AVAILABLE",7251:"SPA_RESET_TIME (in seconds)",7252:"SPA_SET_REWORK_ON_CP_ERROR",7253:"SPA_REWORK_ON_CPK_ERROR",7254:"SPA_ASSIGN_CP_ERROR_CODE",7255:"SPA_ASSIGN_CP_PSEUDO_ERROR_CODE",7256:"SPA_ASSIGN_CPK_ERROR_CODE",7257:"SPA_ASSIGN_CPK_PSEUDO_ERROR_CODE",7258:"API_ANOMALY_CHECK_RETURN_ENABLED",7260:"CHECK_ORDER_NET_FOR_MERGE",7320:"Refer to Serial no (S), Position (P) or both (-)",7400:"upload->update single mat qty (FALSE, TRUE, KONSI)",7401:"upload->update mat qty for all bookings (FALSE, TRUE)",7402:"update mat qty: 0 = as 7401, 1 = first PASS, 2 = each PASS, 3 = first PASS/SCRAP, 4 = each PASS/SCRAP",7450:"default cost center number used for material booking",7510:"Serialnumber-Generation: Fix part for station",7666:"Derivation Manufacturing type",7777:"Product types of external charges",8e3:"Account state in config management (TRUE/FALSE)",8100:"Check recipes (0, 1, 10)",8101:"Check recipes for trUploadStationResult compatible to trUploadResultDataAndRecipe by configuration parameter 8100 (TRUE/FALSE)",8110:"Check Recipe of completeness (TRUE/FALSE)",8200:"Active Recipe necessary for upload result data (J/N)",8300:"Register user required for upload (TRUE/FALSE)",8310:"API processLayer is workplan Avo or Workstep (L/A/W)",8320:"Keep selected process layer in Shipping-Module (TRUE/FALSE)",8400:"Equipment-Bookings during API-Upload (TRUE/FALSE)",8401:"AssetEquipment-Bookings during API-Upload (TRUE/FALSE)",8402:"Cavity-Bookings during API-Upload (TRUE/FALSE)",8410:"Allow multiple equipment setup on same station (TRUE/FALSE)",8411:"Amount of multiple equipment setup on same station",8500:"Transfer completed batches to ERP",8510:"Transfer serials to ERP: 0 = all, 1 = first PASS, 2 = all PASS, 3 = first PASS/SCRAP, 4 = all PASS/SCRAP",8610:"API-getBinInfo LocationNo Mode (0=OLD, 1=ONLY NUMBER, 2=COMPLETE PATH)",9011:"API-getRecipeDataStrictObjectTypeValidation Mode (0=compatible mode, 1=strict mode)",1e4:"FAILDAT_Z1800",10001:"FAILDAT_Z8000",10002:"FAILDAT_SPEA",10003:"FAILDAT_GENRAD",11e3:"PSEUDO_COMPTYPE_FAILICT",12e3:"CONFIG_NO_COMPTYPE",13e3:"TESTSTEP_MODE (OBJECT_ID, OBJECT_ID&STK_VERS, LP_ID)",13010:"CHECK_ONLY_PREVIOUS_LOOP_COUNTER (TRUE/FALSE)",13011:"CHECK_OWN_STATUS_ON_FIRST_WS (TRUE/FALSE)",13020:"WO_CHECK_NEEDS_RECIPE",13021:"WO_CHECK_NEEDS_CUSTOMER",13100:"Skip BOM-Check (TRUE/FALSE)",13110:"Activate setup immediately (TRUE/FALSE)",13111:"SETUP_ACTIVATION_ON_LAST_USED_WORKORDER (TRUE/FALSE)",13120:"Line based setup activation (TRUE/FALSE)",13125:"Open msl package while setup on smt line automatically (false/activation/setup)",13130:"Refill only same parts at the same setup position (TRUE/FALSE)",13140:"Type for reading setup-data sequences: A = all, F = first, L = last",13145:"BOM Check with additional components (TRUE/FALSE)",13150:"BOM Check for all boards of multi panels (TRUE/FALSE)",13161:"SMT wait for bomCheck timeout in sec",13162:"SMT wait for bomCheck interval in ms",13163:"SMT wait for bomCheck mode(0=off, 1=all machines in one ws, 2=check previous ws)",13170:"SMT book omitted serials (TRUE/FALSE)",13200:"KAP_TYP_M reference",13300:"Always check actual production order (TRUE/FALSE)",13301:"enable ProductionOrder-State check (TRUE/FALSE)",13302:"Finish production order when qty reached (0-No, 1-all..., 2-last..., 3-first workstep)",13310:"Always check actual other orders than production order (TRUE/FALSE)",13311:"enable Order-State check for other orders than ProductionOrder (TRUE/FALSE)",13312:"Finish other orders than production order when qty reached (0-No, 1-all..., 2-last..., 3-first workstep)",13400:"Allow merge multipanel scrap (TRUE/FALSE)",13410:"Override scrap on same workstep (TRUE/FALSE)",13420:"Allow changing serialNumber state to OK (TRUE/FALSE)",13600:"API: attribGetAttributecode_werts -> enable complete check (TRUE/FALSE)",14e3:"Activate OpmMd (TRUE/FALSE)",15e3:"Limit Residual time share of Overhead Costs in Percent",15001:"Storage assignment barcode",15002:"Auto. shift to stock(15001) while setup (0=off, 1=to machine, 2=to machine and back to default)",15003:"Store in transaction type while setup",15004:"Store in transaction type while tear down",15100:"ONLY_MATLABEL_SETUP (TRUE/FALSE)",15200:"Create new failure type from measuring result (TRUE/FALSE)",15201:"Level of new failure type (0, 1, 2)",15210:"Use intervention limit from previous recipe(R), station(K) default code_werts(D)",15211:"Intervention limit Ok (in percent, 0 - 100)",15212:"Intervention limit scrap (in percent, >=100)",15220:"Update recipe-teststeps on upload if measurement-type changes (0 Dont compare measurement-type, 1 Only changes to DYNAMIC...,2 Any change)",15250:"generate pseudo errors for measure code_werts with these failcodes(sep. by [;] )",15260:"no OPM data for measure code_werts with these failcodes(sep. by [;] )",15270:"Size of the returned array size for api functions",15280:"Lock station exclusive (TRUE/FALSE)",15300:"API queryTestData: Fetch data uploaded with -1, (TRUE, FALSE(default)).",16e3:"Rep- or Diag place: Terminate workstep (TRUE/FALSE)",16001:"Ignore booking of repair/diag station when not allowed to close work step (Y/N/A)",16100:"Uploads from this station are Testplan-relevant and count for SampleCaches (TRUE/FALSE)",18e3:"ERP line number for confirmation",18200:"Allow bookings for SerialNumbers that are already set to scrap (off|check|checkAll|-1= Use PlantConfig 18200)",18500:"All Atribute get APIs will use equal(0) or like (1) in case of search condition",18510:"Attribute-Search: Treat empty string as wildcard (TRUE/FALSE)",2e4:"MDE Prod time calculation with station snr booking (0) or with condition (1)",20001:"MDE OEE calculation with Yield (0) or with FPY (1)",20002:"MDE NEE calculation with Yield (0) or with FPY (1)",20003:"MDE Placing performance calculation with component (0) or with unit (1)",20004:"MDE MTBF calculation with operational time (0) or with uptime (1)",20011:"Calculation method (0) overall performance (1) weighted average",20013:"MDE OEE calculation with total availability (0) or with organizatonal (1) or with technical (2) or with system-related (3)",20014:"Cycle time calculation with time range (0) or with productive time acc. to shift timetable (1)",21001:"SNR_MAT_ID of active shipping lot of this station",21002:"object_id of default Lot-Product for Lot in Lot",21003:"object_id of default Lot-Part for serial in Lot",21004:"Default Customer",21005:"SHIPPING: No automatic serial check for addSnrTOLot (TRUE/FALSE)",21010:"Suppress ERP-Feedback Sno <-> Lot (TX: 810,811) (TRUE/FALSE)",21012:"Suppress ERP-Feedback Lot <-> Lot (TX: 820,821,822,823) (TRUE/FALSE)",21016:"Suppress ERP-Feedback Lot Create/Complete/Reopen/Finish (TX: 830,831,832,833) (TRUE/FALSE)",21020:"Lock handling for shipping (I = ignore, F = forbidden, L = locked only)",22e3:"Automatic depaneling of multipanels (FALSE/TRUE)",25001:"Fix API mdataGetBomData: switch off processbased (FALSE/TRUE)",25002:"IMSAPI: trAssignSerialNumberMergeAndUploadState -> book scrap (FALSE/TRUE)",25003:"API: verifyMergeBySnrRef fix errorcode -2 when not finished (FALSE/TRUE)",25004:"API: Allow booking on merged(inactive) serial no (FALSE/TRUE)",25010:"EWAPI: getBomItems suppress BomItems with 0 Quantity in Grouped Mode:2 (TRUE/FALSE)",25020:"IMSAPI: Set mdataGetBomData() compatible to 8.52.00 changes (TRUE/FALSE)",25030:"IMSAPI: Correct trCheckSerialNumberState() in case of scrap and open work steps in multi panel (TRUE/FALSE)",25040:"IMSAPI: Set trGetSerialNumberUploadInfo() compatible to 8.50.01 (TRUE/FALSE)",25050:"Leave packaging information to manufacturing serial number when add to change order (TRUE/FALSE)",25100:"IMSAPI: Send new created material bin immediately to ERP (TRUE/FALSE)",26002:"PFDC booking : User authentication required",27e3:"Transfer Equipment usage for PFDC Booking to ERP",28001:"Publish and subscribe messages for workorders",28002:"Pub/Sub-Messaging for EQUIPMENT (TRUE/FALSE)",28003:"Pub/Sub-Messaging for MATERIAL SETUP (TRUE/FALSE)",28004:"Pub/Sub Messaging for STATION MEASUREMENT (TRUE/FALSE)",28005:"Pub/Sub Messaging for SERIAL NUMBER MEASUREMENT (TRUE/FALSE)",28006:"Pub/Sub Messaging for SERIAL NUMBER FAILURE (TRUE/FALSE)",28007:"Pub/Sub Messaging for STATION CONDITION (TRUE/FALSE)",3e4:"Line attribute"},Wi={contacts:{path:"/backend/api/getContact",title:"Kontakte",fields:["PARTNER_NR","NAME","STREET","CITY"]},"erp-groups":{path:"/backend/api/getERPGroups",title:"ERP-Gruppen",fields:["erp_grp_nr","erp_grp_bez","kap_nr"]},users:{path:"/backend/api/getUsers",title:"Benutzer",fields:["user_id","user_name","user_firstname","gender"]},"station-config":{path:"/backend/api/getStationConfig",title:"Konfiguration",fields:["code_nr","code_wert","timestamp","changedby"]},stations:{path:"/backend/api/getStationExport",title:"Stationen",fields:["kap_nr","kap_bez","ma_grp_nr","ma_grp_bez","line_nr","line_bez"]}};function vc(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(Wi,t)}function il(t){return/^[A-Za-z0-9_.-]{1,100}$/.test(t)}async function sl(t,e,i){const s=Object.entries(Wi).find(([,o])=>o.path===t)?.[0]??(t==="/backend/api/getStations"?"station-tree":"");if(!s)throw new Error("Unbekannte API");if(!il(e))throw new Error("Bitte eine gültige Stationsnummer eingeben");const n=await fetch("/backend/api/hmi/v1/legacy/"+s+"?station="+encodeURIComponent(e),{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"},signal:i,cache:"no-store"}),r=await n.json();if(!n.ok)throw new Error(r&&typeof r=="object"&&"error"in r?String(r.error):"HMI API "+n.status);return r}function bc(t){return Array.isArray(t)?t.filter(e=>e!==null&&typeof e=="object"&&!Array.isArray(e)).map(e=>Object.fromEntries(Object.entries(e).map(([i,s])=>[i.toLowerCase(),s]))):[]}const jn={workorder:{path:"/backend/Workorder.html",heading:"Auftragsaktivierung",detail:"Auftrag und Prozesslage prüfen und aktivieren",action:"Zur Auftragsaktivierung"},history:{path:"/backend/HistoryBooking.html",heading:"History & Booking",detail:"Seriennummern prüfen, Statusumbuchungen und Buchungshistorie",action:"History & Booking öffnen"},activities:{path:"/backend/Activities_rest.html",heading:"Manuelle Fertigung",detail:"Activity-Buchungen, Fehlermeldungen, Messwerte und Setup",action:"Manuelle Fertigung öffnen"},"activity-designer":{path:"/backend/Activity_designer_rest.html",heading:"Activity Designer",detail:"Activities und Rezepte verwalten",action:"Activity Designer öffnen"},bom:{path:"/backend/BOMImport.html",heading:"Stückliste / BOM",detail:"Excel importieren und Stücklisten aktualisieren",action:"BOM-Verwaltung öffnen"},part:{path:"/backend/PARTImport.html",heading:"Material / PART",detail:"Teile und Materialstammdaten importieren",action:"Materialverwaltung öffnen"},station:{path:"/backend/Station.html",heading:"Stationsexport/-import",detail:"Stationsbaum und Excel-Import / Export",action:"Stationsverwaltung öffnen"},erp:{path:"/backend/ErpAdd.html",heading:"ERP-Gruppen",detail:"ERP-Gruppen importieren",action:"ERP-Gruppen öffnen"},contact:{path:"/backend/Contacts.html",heading:"Kontakte",detail:"Kontaktdaten und Excel-Dateien",action:"Kontaktverwaltung öffnen"},user:{path:"/backend/Useradd.html",heading:"Benutzerimport",detail:"Benutzerstammdaten importieren",action:"Benutzerimport öffnen"}};function yc(t){return typeof t=="string"&&Object.prototype.hasOwnProperty.call(jn,t)}function Jn(t,e,i){if(e&&!il(e))throw new Error("Ungültige Stationsnummer");e&&sessionStorage.setItem("stationNumber",e),sessionStorage.setItem("url",window.location.origin),i&&/^[A-Za-z0-9_.:/-]{1,120}$/.test(i)&&sessionStorage.setItem("hmiLastSerial",i);const s=new URLSearchParams;t==="station"&&e&&s.set("station",e),i&&["history","activities"].includes(t)&&s.set("serial",i);const n=jn[t].path+(s.toString()?"?"+s.toString():""),r=window.open(n,"_blank");r?r.opener=null:window.location.assign(n)}function wc(t,e){if(!t.length)return;const i=[...new Set(t.flatMap(l=>Object.keys(l)))],s=l=>'"'+String(l??"").replace(/"/g,'""')+'"',n="\uFEFF"+[i.map(s).join(";"),...t.map(l=>i.map(u=>s(l[u])).join(";"))].join(`\r +`),r=URL.createObjectURL(new Blob([n],{type:"text/csv;charset=utf-8"})),o=document.createElement("a");o.href=r,o.download=e,o.click(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}const Ec={class:"wb-data-table"},_c={class:"wb-toolbar"},Sc={class:"wb-meta"},Rc={class:"wb-hint"},Ac={class:"wb-inline-actions"},kc=["disabled"],Cc={class:"wb-filter"},Tc=["aria-label"],Nc={key:0,class:"wb-alert",role:"alert"},Mc={key:1,class:"wb-placeholder"},Oc={key:2,class:"wb-table-scroll"},xc={class:"wb-table"},Pc={key:0},Ic=["colspan"],Lc={class:"wb-footer"},Dc={class:"wb-inline-actions"},Uc=["disabled"],Bc=["disabled"],Fc=He({__name:"LegacyTableWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=se(()=>vc(e.widget.props.source)?e.widget.props.source:"contacts"),s=se(()=>String(e.station||e.widget.props.station||"")),n=S(""),r=S([]),o=S(!1),l=S(""),u=S(1);let d=null;const c=se(()=>Math.max(5,Math.min(100,Number(e.widget.props.limit)||20))),h=se(()=>{const L=r.value,Z=i.value==="station-config"?["code_nr","description","code_wert","changedby","timestamp"]:Wi[i.value].fields.map(ie=>ie.toLowerCase()),X=[...new Set(L.flatMap(ie=>Object.keys(ie)))];return[...Z.filter(ie=>X.includes(ie)),...X.filter(ie=>!Z.includes(ie))].slice(0,18)}),v=se(()=>r.value.filter(L=>Object.values(L).some(Z=>String(Z??"").toLocaleLowerCase("de").includes(n.value.toLocaleLowerCase("de"))))),R=se(()=>Math.max(1,Math.ceil(v.value.length/c.value))),k=se(()=>v.value.slice((u.value-1)*c.value,u.value*c.value)),C=L=>({description:"Beschreibung",contact_code:"Kontakt-Nr.",contact_name:"Kontakt",artikel:"Artikel",artbez:"Artikelbeschreibung",part_ext:"Teile-Nr.",art_bez_ext:"Teilebeschreibung",is_manufacturer:"Hersteller",is_customer:"Kunde",is_supplier:"Lieferant",code_nr:"Code",code_wert:"Wert",timestamp:"Geändert am",changedby:"Geändert von",user_id:"Benutzer-ID",user_name:"Nachname",user_firstname:"Vorname",gender:"Anrede",erp_grp_nr:"ERP-Gruppe",erp_grp_bez:"Bezeichnung",kap_nr:"Station",kap_bez:"Station Bezeichnung",line_nr:"Linie",line_bez:"Linie Bezeichnung",ma_grp_nr:"Maschinengruppe",ma_grp_bez:"Maschinengruppe Bezeichnung"})[L]||L.replace(/_/g," ");function P(L){return L==null||L===""?"—":typeof L=="object"?JSON.stringify(L):String(L)}async function B(){if(d?.abort(),r.value=[],l.value="",u.value=1,e.demo){r.value=[{code_nr:"1401",code_wert:"1",changedby:"Demo",timestamp:"2026-10-20"},{code_nr:"1402",code_wert:"0",changedby:"Demo",timestamp:"2026-10-20"}];return}if(!s.value){l.value="Stationsnummer im Kopfbereich eingeben";return}const L=new AbortController;d=L,o.value=!0;try{const Z=await sl(Wi[i.value].path,s.value,L.signal);r.value=bc(Z).map(X=>i.value==="station-config"?{...X,description:mc[String(X.code_nr)]||"—"}:X)}catch(Z){L.signal.aborted||(l.value=String(Z instanceof Error?Z.message:Z))}finally{d===L&&(o.value=!1)}}nt([i,s,()=>e.demo],B,{immediate:!0}),nt(n,()=>u.value=1),vi(()=>d?.abort());const D=se(()=>i.value==="users"?"user":i.value==="contacts"?"contact":i.value==="erp-groups"?"erp":(i.value==="stations","station"));function re(){try{Jn(D.value,s.value)}catch(L){l.value=String(L)}}return(L,Z)=>(p(),m("section",Ec,[a("div",_c,[a("div",Sc,[a("span",{class:xe(["wb-live-dot",{inactive:!!l.value}])},null,2),a("b",null,E(v.value.length),1),Z[4]||(Z[4]=Q(" Datensätze ",-1)),a("span",Rc,"· "+E(s.value||"Keine Station"),1)]),a("div",Ac,[a("button",{type:"button",class:"wb-btn wb-btn-icon",title:"Neu laden",onClick:B},"↻"),a("button",{type:"button",class:"wb-btn wb-btn-icon",disabled:!r.value.length,title:"CSV exportieren",onClick:Z[0]||(Z[0]=X=>Je(wc)(v.value,"hmi-"+i.value+".csv"))},"⇩",8,kc)])]),a("div",Cc,[Z[5]||(Z[5]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":Z[1]||(Z[1]=X=>n.value=X),"aria-label":"Suche in "+Je(Wi)[i.value].title,placeholder:"Suche in allen Spalten ..."},null,8,Tc),[[Ce,n.value]])]),l.value?(p(),m("div",Nc,E(l.value),1)):o.value?(p(),m("div",Mc,"Daten werden geladen …")):z("",!0),o.value?z("",!0):(p(),m("div",Oc,[a("table",xc,[a("thead",null,[a("tr",null,[(p(!0),m(G,null,ge(h.value,X=>(p(),m("th",{key:X},E(C(X)),1))),128))])]),a("tbody",null,[(p(!0),m(G,null,ge(k.value,(X,ie)=>(p(),m("tr",{key:ie},[(p(!0),m(G,null,ge(h.value,ee=>(p(),m("td",{key:ee},[ee==="code_wert"&&["TRUE","FALSE"].includes(String(X[ee]).toUpperCase())?(p(),m("span",{key:0,class:xe(["wb-value-pill",String(X[ee]).toUpperCase()==="TRUE"?"on":"off"])},E(String(X[ee]).toUpperCase()==="TRUE"?"Ein":"Aus"),3)):(p(),m("span",{key:1,class:xe({"wb-mono":ee.includes("nr")||ee.includes("id")})},E(P(X[ee])),3))]))),128))]))),128)),k.value.length===0?(p(),m("tr",Pc,[a("td",{colspan:h.value.length||1,class:"wb-empty"},E(r.value.length?"Keine passenden Einträge":"Keine Daten vorhanden"),9,Ic)])):z("",!0)])])])),a("div",Lc,[a("span",null,"Seite "+E(u.value)+" / "+E(R.value),1),a("div",Dc,[a("button",{class:"wb-btn wb-small",disabled:u.value===1,onClick:Z[2]||(Z[2]=X=>u.value--)},"‹",8,Uc),a("button",{class:"wb-btn wb-small",disabled:u.value>=R.value,onClick:Z[3]||(Z[3]=X=>u.value++)},"›",8,Bc),a("button",{class:"wb-btn wb-small",onClick:re},"Vollansicht ↗")])])]))}}),$c=["open"],zc={class:"wb-tree-icon"},Hc={class:"wb-tree-name"},Wc={class:"wb-tree-count"},Vc={class:"wb-tree-children"},Kc=He({__name:"StationTreeNode",props:{node:{},filter:{},level:{}},emits:["selected"],setup(t,{emit:e}){const i=e;function s(n,r){return!r||(n.id+" "+n.text).toLocaleLowerCase("de").includes(r.toLocaleLowerCase("de"))||(n.children||[]).some(o=>s(o,r))}return(n,r)=>{const o=Ao("StationTreeNode",!0);return s(t.node,t.filter)?(p(),m(G,{key:0},[t.node.children?.length?(p(),m("details",{key:0,class:"wb-tree-group",open:t.filter?!0:void 0},[a("summary",null,[a("span",zc,E(t.level===0?"▦":"▤"),1),a("span",Hc,[a("b",null,E(t.node.id),1),a("span",null,E(t.node.text),1)]),a("span",Wc,E(t.node.children.length),1)]),a("div",Vc,[(p(!0),m(G,null,ge(t.node.children,l=>(p(),Le(o,{key:l.id,node:l,filter:t.filter,level:(t.level||0)+1,onSelected:r[0]||(r[0]=u=>i("selected",u))},null,8,["node","filter","level"]))),128))])],8,$c)):(p(),m("button",{key:1,type:"button",class:"wb-tree-leaf",onClick:r[1]||(r[1]=l=>i("selected",t.node.id))},[r[2]||(r[2]=a("span",{class:"wb-tree-icon"},"▣",-1)),a("span",null,[a("b",null,E(t.node.id),1),a("small",null,E(t.node.text),1)]),r[3]||(r[3]=a("span",{class:"wb-tree-arrow"},"›",-1))]))],64)):z("",!0)}}}),Gc={class:"wb-station-tree"},jc={class:"wb-toolbar"},Jc={class:"wb-meta"},Yc={class:"wb-filter"},qc={key:0,class:"wb-alert",role:"alert"},Xc={key:1,class:"wb-placeholder"},Qc={key:2,class:"wb-tree-list"},Zc={key:0,class:"wb-placeholder"},ed={class:"wb-footer"},td={key:0},id=He({__name:"StationTreeWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=S([]),s=S(""),n=S(!1),r=S(""),o=S("");let l=null;const u=se(()=>String(e.station||e.widget.props.station||""));async function d(){if(l?.abort(),r.value="",i.value=[],e.demo){i.value=[{id:"100",text:"Linie Montage",children:[{id:"200",text:"Montagebereich",children:[{id:"J815513",text:"Lagern"},{id:"J816352",text:"Waschen"}]}]}];return}if(!u.value){r.value="Bitte Station auswählen";return}const v=new AbortController;l=v,n.value=!0;try{const R=await sl("/backend/api/getStations",u.value,v.signal);if(!Array.isArray(R))throw Error("Ungültige Fertigungsbaum-Antwort");i.value=R}catch(R){v.signal.aborted||(r.value=String(R instanceof Error?R.message:R))}finally{l===v&&(n.value=!1)}}nt([u,()=>e.demo],d,{immediate:!0}),vi(()=>l?.abort());function c(v){o.value=v,sessionStorage.setItem("selectedStation",v);const R="/backend/Config.html?station="+encodeURIComponent(v),k=window.open(R,"_blank");k?k.opener=null:window.location.assign(R)}function h(){try{Jn("station",u.value)}catch(v){r.value=String(v)}}return(v,R)=>(p(),m("div",Gc,[a("div",jc,[a("span",Jc,[a("span",{class:xe(["wb-live-dot",{inactive:!!r.value}])},null,2),a("b",null,E(i.value.length),1),R[1]||(R[1]=Q(" Fertigungslinien",-1))]),a("div",{class:"wb-inline-actions"},[a("button",{class:"wb-btn wb-btn-icon",onClick:d,title:"Aktualisieren"},"↻"),a("button",{class:"wb-btn wb-small",onClick:h},"Vollansicht ↗")])]),a("div",Yc,[R[2]||(R[2]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":R[0]||(R[0]=k=>s.value=k),placeholder:"Station, Linie oder Gruppe suchen ...","aria-label":"Fertigungsbaum durchsuchen"},null,512),[[Ce,s.value]])]),r.value?(p(),m("p",qc,E(r.value),1)):n.value?(p(),m("p",Xc,"Fertigungsbaum wird geladen …")):(p(),m("div",Qc,[(p(!0),m(G,null,ge(i.value,k=>(p(),Le(Kc,{key:k.id,node:k,filter:s.value,level:0,onSelected:c},null,8,["node","filter"]))),128)),i.value.length?z("",!0):(p(),m("p",Zc,"Keine Stationen gefunden"))])),a("div",ed,[R[3]||(R[3]=a("span",null,"Fertigungsbereiche sind anfangs zugeklappt",-1)),o.value?(p(),m("span",td,"Station "+E(o.value)+" gewählt",1)):z("",!0)])]))}}),sd={class:"wb-module"},nd={class:"wb-module-row"},rd={class:"wb-module-logo","aria-hidden":"true"},od={class:"wb-module-text"},ld={key:0,class:"wb-field"},ad={class:"wb-module-foot"},ud={class:"wb-chip"},cd={key:1,class:"wb-hint",role:"status"},dd=He({__name:"LegacyModuleWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=se(()=>yc(e.widget.props.module)?e.widget.props.module:"history"),s=se(()=>jn[i.value]),n=S(""),r=S("");function o(){if(e.demo){r.value="Vorschau: Live-Anwendungen werden im Demo-Modus nicht gestartet";return}try{Jn(i.value,e.station,n.value),r.value="Originalanwendung in neuem Tab geöffnet"}catch(l){r.value=String(l)}}return(l,u)=>(p(),m("section",sd,[a("div",nd,[a("div",rd,E(["history","activities","activity-designer"].includes(i.value)?"◈":i.value==="workorder"?"▣":"⇄"),1),a("div",od,[a("h3",null,E(s.value.heading),1),a("p",null,E(s.value.detail),1)])]),i.value==="history"||i.value==="activities"?(p(),m("label",ld,[u[1]||(u[1]=Q("Seriennummer ",-1)),ae(a("input",{"onUpdate:modelValue":u[0]||(u[0]=d=>n.value=d),maxlength:120,placeholder:"Optional vormerken …",autocomplete:"off"},null,512),[[Ce,n.value]])])):z("",!0),a("div",ad,[a("span",ud,E(e.station||"Station wählen"),1),a("button",{class:"wb-btn wb-primary",type:"button",onClick:o},E(s.value.action)+" ↗",1)]),r.value?(p(),m("p",cd,E(r.value),1)):z("",!0),u[2]||(u[2]=a("p",{class:"wb-hint wb-module-note"},"Dieser Baustein öffnet die bestehende Workbench-Funktion. Die iTAC-MES-Sitzung muss dort angemeldet sein; Schreibaktionen werden im Widget nicht dupliziert.",-1))]))}}),yn=["SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DESC","STATION_DIAG_NUMBER","STATION_NUMBER","WORKORDER_NUMBER","WORKSTEP_DESC","WORKSTEP_NUMBER","BOOK_DATE","BOOK_STATE","CYCLE_TIME","PROCESS_LAYER"],wn=["BOOK_REFERENCE","COMP_NAME","FAILURE_ACTION_CODE","FAILURE_ACTION_INFO","FAILURE_CAUSE_CODE","FAILURE_CAUSE_DESC","FAILURE_CAUSE_INFO","FAILURE_IMAGE_CODE","FAILURE_IMAGE_DESC","FAILURE_MEASURE_CODE","FAILURE_MEASURE_INFO","FAILURE_SEQUENCE_NUMBER","FAILURE_TYPE_CODE","FAILURE_TYPE_DESC","FAILURE_TYPE_INFO","INFO","INFO_TXT_REPAIR","MAJOR_FAILURE","PART_DESC","PART_NUMBER","REPAIRED","REPAIRED_DATE","SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DIAG_NUMBER","STATION_NUMBER","STATION_REPAIR_DESC","WORKORDER_NUMBER"],En=["BOOK_DATE","BOOK_REFERENCE","COMP_NAME","FAILURE_SLIP_REFERENCE","SEQUENCE_NUMBER","STATION_NUMBER","TEST_STEP_NAME","WORKORDER_NUMBER","WORKSTEP_NUMBER"],_n=["FUNCTION","FUNCTION_DESC","FUNCTION_STEP","LOWER_LIMIT","MEASURE_FAIL_CODE","MEASURE_NAME","MEASURE_TYPE","MEASURE_VALUE","NOMINAL","SEQUENCE_NUMBER","SERIAL_NUMBER","SERIAL_NUMBER_POS","STATION_DESC","STATION_NUMBER","TOLERANCE","UNIT","UPPER_LIMIT","WORKORDER_NUMBER","WORKSTEP_NUMBER"],Sn=["SERIAL_NUMBER","SERIAL_NUMBER_POS","SERIAL_SLAVE_NUMBER","PART_NUMBER","PART_DESC","BOM_VERSION","BOM_VARIANT","STATION_NUMBER","WORKORDER_NUMBER"],Rn=["COMP_NAME","PART_NUMBER","MATERIAL_BIN_NUMBER","BOOK_DATE","PART_PARENT_NUMBER","SETUP_COMP_NAME","SETUP_POSITION","WORKSTEP_NUMBER","STATION_NUMBER","STATION_DESC","WORKORDER_NUMBER"],rn=[{id:"booking",title:"Buchungen",keys:yn},{id:"failure",title:"Fehler",keys:wn},{id:"slip",title:"Fehlerscheine",keys:En},{id:"measure",title:"Messwerte",keys:_n},{id:"merge",title:"Merge Parts",keys:Sn},{id:"setup",title:"Rüstung",keys:Rn}],nl={SERIAL_NUMBER:"Seriennummer",STATION_NUMBER:"Station",WORKORDER_NUMBER:"Auftrag",WORKSTEP_NUMBER:"Schritt",WORKSTEP_AVO:"AVO",WORKSTEP_DESC:"Arbeitsgang",BOOK_DATE:"Datum",BOOK_STATE:"Status",PROCESS_LAYER:"Lage",PART_NUMBER:"Sachnummer",PART_DESC:"Beschreibung",MEASURE_NAME:"Messgröße",MEASURE_VALUE:"Messwert",FAILURE_TYPE_DESC:"Fehlerart",FAILURE_TYPE_CODE:"Fehlercode",MATERIAL_BIN_NUMBER:"MBK",SERIAL_SLAVE_NUMBER:"Verbundteil",COMP_NAME:"Komponente",ATTRIBUTE_CODE:"Attribut",ATTRIBUTE_VALUE:"Wert"};function et(t,e,i=e){if(t==null)return[];if(!Array.isArray(t))throw new Error("IMSAPI liefert kein Array");if(t.length&&typeof t[0]=="object"&&t[0]!==null)return t;if(!e.length||t.length%e.length!==0)throw new Error("IMSAPI Rückgabe passt nicht zu den Ergebnis-Keys");const s=[];for(let n=0;nr[o]=t[n+l]??null),s.push(r)}return s}function ht(t){const e=String(t??"").trim().toUpperCase();return{TOP:"0",BOT:"1",BOTTOM:"1",INDEP:"2","INDEP.":"2",INDEPENDENT:"2"}[e]||e}function hi(t){return{0:"TOP",1:"BOTTOM",2:"INDEPENDENT"}[ht(t)]||String(t??"—")}function Os(t,e=""){if(t==null||t==="")return"—";if(["BOOK_DATE","REPAIRED_DATE"].includes(e)){const i=Number(t);if(Number.isFinite(i)&&i>0)return new Date(i).toLocaleString("de-DE")}return e==="PROCESS_LAYER"?hi(t):String(t)}function ri(t){return/^[A-Za-z0-9_.-]{1,120}$/.test(t)}function ii(t){return/^[A-Za-z0-9_.:/-]{1,120}$/.test(t)}function rl(){return tl()?{sessionId:"server-managed"}:null}class ol extends Error{constructor(e,i,s){super(e),this.action=i,this.code=s}action;code}async function Oe(t,e,i=[0]){if(!/^[A-Za-z][A-Za-z0-9]+$/.test(t))throw new Error("Ungültige IMSAPI-Aktion");if(!tl())throw new Error("Bitte zuerst am HMI über IMSAPI anmelden");const n=(await be("/mes/actions/"+t,"POST",e))?.result;if(!n||n.return_value===void 0)throw new Error(t+": ungültige IMSAPI-Antwort");const r=Number(n.return_value);if(!i.includes(r))throw new ol(t+" ("+r+"): "+(n.customErrorString||n.errorString||"MES-Fehler"),t,r);return n}async function ll(t,e){if(!ri(t)||!ii(e))throw new Error("Station oder Seriennummer ungültig");const i={stationNumber:t,serialNumber:e},s=await Oe("trGetSerialNumberHistoryData",{...i,serialNumberPos:"-1",processLayer:"2",desolvingSerialNumber:"1",desolvingLevel:"0",bookingResultKeys:yn,failureDataResultKeys:wn,failureSlipDataResultKeys:En,measureDataResultKeys:_n}),n={booking:et(s.bookingResultValues,yn),failure:et(s.failureDataResultValues,wn),slip:et(s.failureSlipDataResultValues,En),measure:et(s.measureDataResultValues,_n),merge:[],setup:[]},r=await Promise.allSettled([Oe("trGetMergeParts",{...i,serialNumberPos:"-1",resolveLevel:"2",resolveDirection:"0",mergePartsResultKeys:Sn}),Oe("setupGetSetupDataBySerialNumber",{...i,partNumber:"-1",location:"-1",level:"-1",setupResultKeys:Rn})]),o=[];return r.forEach((l,u)=>{const d=u?"setup":"merge";l.status==="fulfilled"?n[d]=et(l.value[u?"setupResultValues":"mergePartsResultValues"],u?Rn:Sn):o.push(d+": "+String(l.reason))}),{result:s,sections:n,warnings:o}}async function ms(t){const e=["WORKORDER_NUMBER","PART_NUMBER","PART_DESC","PROCESS_LAYER","QUANTITY"],i=await Oe("trGetStationSetting",{stationNumber:t,stationSettingResultKeys:e});return et(i.stationSettingResultValues,e)[0]||null}async function fd(t){const e=["WORKORDER_NUMBER","PART_NUMBER","PART_DESC","PROCESS_LAYER"],i=await Oe("trGetWorkOrderForStation",{stationNumber:t,workorderFilter:[{key:"MAX_ROWS",value:"100"}],workorderResultKeys:e},[0,3]);return et(i.workorderResultValues,e)}async function Fr(t,e,i,s,n,r="1"){if(!ri(t)||!ii(e)||!["0","1","2"].includes(String(s))||![0,1].includes(n))throw new Error("Ungültige Buchungsparameter");const o=["ERROR_CODE","SERIAL_NUMBER","SERIAL_NUMBER_STATE"],l=await Oe("trUploadState",{stationNumber:t,processLayer:i,serialNumberRef:e,serialNumberRefPos:r,serialNumberState:String(s),duplicateSerialNumber:String(n),bookDate:"-1",cycleTime:"5",serialNumberUploadKeys:o,serialNumberUploadValues:[]});if(et(l.serialNumberUploadValues,o).some(d=>Number(d.ERROR_CODE)!==0))throw new Error("Statusbuchung meldet Fehler bei Seriennummer "+e);return l}const hd={class:"wb-mes-client"},pd={class:"wb-mes-strip"},gd={class:"wb-mes-pill"},md={class:"wb-mes-muted"},vd=["disabled"],bd=["disabled"],yd=["disabled"],wd=["disabled"],Ed={key:0,class:"wb-mes-note"},_d={key:1,class:"wb-alert",role:"alert"},Sd={key:2,class:"wb-mes-note",role:"status"},Rd={key:3,class:"wb-mes-strip"},Ad={class:"wb-mes-tabs",role:"tablist"},kd=["aria-selected","onClick"],Cd={class:"wb-table-scroll"},Td={class:"wb-table"},Nd={key:0},Md={key:0},Od=["disabled","onClick"],xd=["title"],Pd={key:0},Id=["colspan"],Ld={class:"wb-mes-dialog",role:"dialog","aria-modal":"true"},Dd=["disabled"],Ud=["disabled"],Bd={class:"wb-mes-check"},Fd=["disabled"],$d={class:"wb-mes-orders"},zd=["onClick"],Hd={key:0},Wd=["value"],Vd=["disabled"],Kd={key:3,class:"wb-alert"},Gd=He({__name:"HistoryBookingWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=S(e.station),s=S(""),n=S(!1),r=S(""),o=S(""),l=S("booking"),u=S({}),d=S({}),c=S(null),h=S([]),v=S(""),R=S("none"),k=S(null),C=S(""),P=S("2"),B=S(0),D=S(0),re=S(!0),L=S(!1),Z=se(()=>rn.map(te=>({id:te.id,title:te.title,count:(u.value[te.id]||[]).length}))),X=se(()=>rn.find(te=>te.id===l.value)||rn[0]),ie=se(()=>u.value[l.value]||[]),ee=se(()=>X.value.keys),le=se(()=>!e.demo&&!!rl()&&ri(i.value));nt(()=>e.station,te=>{i.value=te,c.value=null,u.value={}}),Qt(()=>{le.value&&me();const te=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ii(te)&&(s.value=te)});function fe(){r.value="",o.value=""}async function me(){if(le.value)try{c.value=await ms(i.value)}catch(te){o.value="Aktiver Auftrag nicht verfügbar: "+String(te)}}async function he(){if(fe(),!le.value){r.value="Workbench-Anmeldung und Station erforderlich";return}if(!ii(s.value)){r.value="Ungültige Seriennummer";return}n.value=!0,u.value={};try{const te=await ll(i.value,s.value);u.value=te.sections,d.value=te.result,o.value=te.warnings.join(" · ")||"Seriennummer aktualisiert"}catch(te){te instanceof ol&&te.code===-110?(R.value="assign",L.value=!1,await me(),o.value="Seriennummer nicht gefunden. Zuweisung zum aktiven Auftrag möglich."):r.value=String(te)}finally{n.value=!1}}async function J(){fe(),n.value=!0;try{h.value=await fd(i.value),R.value="orders"}catch(te){r.value=String(te)}finally{n.value=!1}}const M=se(()=>{const te=new Map;for(const j of h.value){const ne=String(j.WORKORDER_NUMBER||"");if(!ne)continue;const $e=te.get(ne)||{number:ne,part:String(j.PART_DESC||j.PART_NUMBER||""),layers:[]};$e.layers.includes(ht(j.PROCESS_LAYER))||$e.layers.push(ht(j.PROCESS_LAYER)),te.set(ne,$e)}return[...te.values()].filter(j=>(j.number+" "+j.part).toLowerCase().includes(v.value.toLowerCase()))});async function F(){if(le.value&&!(!C.value||!["0","1","2"].includes(P.value))){n.value=!0,fe();try{if(await Oe("trActivateWorkOrder",{stationNumber:i.value,workOrderNumber:C.value,serialNumber:"-1",serialNumberPos:"-1",processLayer:P.value,flag:"1"}),await me(),String(c.value?.WORKORDER_NUMBER)!==C.value||ht(c.value?.PROCESS_LAYER)!==P.value)throw new Error("Aktivierung vom MES noch nicht bestätigt");R.value="none",o.value="Auftrag erfolgreich aktiviert"}catch(te){r.value=String(te)}finally{n.value=!1}}}function H(te){if(!ii(String(te.SERIAL_NUMBER||""))||!ri(String(te.STATION_NUMBER||""))||!["0","1","2"].includes(ht(te.PROCESS_LAYER))){r.value="Buchungszeile enthält keine gültige Station, Lage oder Seriennummer";return}k.value=te,B.value=0,D.value=0,R.value="rebook"}async function we(){if(!le.value||!k.value)return;const te=k.value;n.value=!0,fe();try{if(!confirm(`Status ${B.value} für ${te.SERIAL_NUMBER} an ${te.STATION_NUMBER} buchen?`))return;await Fr(String(te.STATION_NUMBER),String(te.SERIAL_NUMBER),ht(te.PROCESS_LAYER),B.value,D.value),R.value="none",o.value="Statusbuchung durch MES bestätigt",await he()}catch(j){r.value=String(j)}finally{n.value=!1}}async function Ee(){if(le.value){if(!c.value||!ii(s.value)||!ri(i.value)){r.value="Aktiver Auftrag/Station/Seriennummer fehlen";return}n.value=!0,fe();try{const te=await ms(i.value);if(String(te?.WORKORDER_NUMBER)!==String(c.value.WORKORDER_NUMBER)||ht(te?.PROCESS_LAYER)!==ht(c.value.PROCESS_LAYER))throw Error("Auftrag oder Lage haben sich geändert");if(L.value||(await Oe("trAssignSerialNumberForProductOrWorkOrder",{stationNumber:i.value,workOrderNumber:te?.WORKORDER_NUMBER,partNumber:"-1",bomVersion:"-2",serialNumberRef:s.value,serialNumberRefPos:"1",processLayer:ht(te?.PROCESS_LAYER),serialNumberArray:[],activateWorkOrder:"1"}),L.value=!0),re.value){const j=await ms(i.value);if(String(j?.WORKORDER_NUMBER)!==String(te?.WORKORDER_NUMBER)||ht(j?.PROCESS_LAYER)!==ht(te?.PROCESS_LAYER))throw Error("Auftrag während Zuweisung geändert");await Fr(i.value,s.value,ht(te?.PROCESS_LAYER),0,0)}R.value="none",o.value="Seriennummer zugewiesen"+(re.value?" und gebucht":""),await he()}catch(te){r.value=(L.value?"Seriennummer bereits zugewiesen. ":"")+String(te)}finally{n.value=!1}}}const Ve=se(()=>ee.value.filter(te=>ie.value.some(j=>j[te]!==void 0))),qe=se(()=>Ve.value.length?Ve.value:ee.value);return(te,j)=>(p(),m("div",hd,[a("div",pd,[a("span",gd,E(i.value||"Station fehlt"),1),a("span",md,[j[8]||(j[8]=Q("Auftrag: ",-1)),a("b",null,E(c.value?.WORKORDER_NUMBER||"—"),1),Q(" · "+E(Je(hi)(c.value?.PROCESS_LAYER)),1)]),a("button",{class:"wb-btn wb-small",disabled:n.value||!le.value,onClick:J},"Auftrag wählen",8,vd),a("button",{class:"wb-btn wb-small",disabled:n.value||!le.value,onClick:me},"↻",8,bd)]),a("form",{class:"wb-mes-form",onSubmit:We(he,["prevent"])},[a("label",null,[j[9]||(j[9]=Q("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":j[0]||(j[0]=ne=>s.value=ne),autocomplete:"off",placeholder:"Seriennummer scannen",disabled:n.value},null,8,yd),[[Ce,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!le.value},E(n.value?"Lade…":"Daten abrufen"),9,wd)],32),t.demo||!le.value?(p(),m("p",Ed,E(t.demo?"Designer-Demo – keine MES-Schreibzugriffe":"Bitte zuerst die Workbench-Station anmelden."),1)):z("",!0),r.value?(p(),m("p",_d,E(r.value),1)):z("",!0),o.value?(p(),m("p",Sd,E(o.value),1)):z("",!0),d.value.partNumber||d.value.workOrderNumber?(p(),m("div",Rd,[a("span",null,[j[10]||(j[10]=Q("Sachnummer ",-1)),a("b",null,E(d.value.partNumber||"—"),1)]),a("span",null,E(d.value.partDesc),1),a("span",null,[j[11]||(j[11]=Q("Auftrag ",-1)),a("b",null,E(d.value.workOrderNumber),1)])])):z("",!0),a("div",Ad,[(p(!0),m(G,null,ge(Z.value,ne=>(p(),m("button",{key:ne.id,class:xe(["wb-mes-tab",{selected:l.value===ne.id}]),"aria-selected":l.value===ne.id,role:"tab",onClick:$e=>l.value=ne.id},[Q(E(ne.title)+" ",1),a("small",null,E(ne.count),1)],10,kd))),128))]),a("div",Cd,[a("table",Td,[a("thead",null,[a("tr",null,[l.value==="booking"?(p(),m("th",Nd,"Aktion")):z("",!0),(p(!0),m(G,null,ge(qe.value,ne=>(p(),m("th",{key:ne},E(Je(nl)[ne]||ne),1))),128))])]),a("tbody",null,[(p(!0),m(G,null,ge(ie.value,(ne,$e)=>(p(),m("tr",{key:$e},[l.value==="booking"?(p(),m("td",Md,[a("button",{class:"wb-btn wb-small",title:"Statusumbuchung",disabled:n.value||!le.value,onClick:Me=>H(ne)},"⚒ Umbuchen",8,Od)])):z("",!0),(p(!0),m(G,null,ge(qe.value,Me=>(p(),m("td",{key:Me,title:Je(Os)(ne[Me],Me)},E(Je(Os)(ne[Me],Me)),9,xd))),128))]))),128)),ie.value.length?z("",!0):(p(),m("tr",Pd,[a("td",{colspan:qe.value.length+(l.value==="booking"?1:0),class:"wb-empty"},E(s.value?"Keine Einträge in dieser Ansicht":"Seriennummer scannen und abrufen"),9,Id)]))])])]),(p(),Le(Fn,{to:"body"},[R.value!=="none"?(p(),m("div",{key:0,class:"wb-mes-overlay",onClick:j[7]||(j[7]=We(ne=>!n.value&&(R.value="none"),["self"]))},[a("section",Ld,[a("header",null,[a("strong",null,E(R.value==="rebook"?"Statusumbuchung":R.value==="assign"?"Seriennummer zuweisen":"Auftrag aktivieren"),1),a("button",{class:"wb-btn",disabled:n.value,onClick:j[1]||(j[1]=ne=>R.value="none")},"✕",8,Dd)]),R.value==="rebook"?(p(),m(G,{key:0},[a("p",null,[j[12]||(j[12]=Q("Seriennummer: ",-1)),a("b",null,E(k.value?.SERIAL_NUMBER),1),Q(" · Lage: "+E(Je(hi)(k.value?.PROCESS_LAYER))+" · Station: "+E(k.value?.STATION_NUMBER),1)]),a("label",null,[j[14]||(j[14]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":j[2]||(j[2]=ne=>B.value=ne)},[...j[13]||(j[13]=[a("option",{value:0},"0 – Gut",-1),a("option",{value:1},"1 – Nacharbeit",-1),a("option",{value:2},"2 – Ausschuss",-1)])],512),[[_t,B.value,void 0,{number:!0}]])]),a("label",null,[j[16]||(j[16]=Q("Nutzen",-1)),ae(a("select",{"onUpdate:modelValue":j[3]||(j[3]=ne=>D.value=ne)},[...j[15]||(j[15]=[a("option",{value:0},"0 – Einzelschaltung",-1),a("option",{value:1},"1 – Nutzen",-1)])],512),[[_t,D.value,void 0,{number:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:we},"Status buchen",8,Ud)],64)):R.value==="assign"?(p(),m(G,{key:1},[a("p",null,[j[17]||(j[17]=Q("Seriennummer ",-1)),a("b",null,E(s.value),1),j[18]||(j[18]=Q(" zum aktiven Auftrag ",-1)),a("b",null,E(c.value?.WORKORDER_NUMBER||"—"),1),j[19]||(j[19]=Q(" zuweisen?",-1))]),a("p",null,"Prozesslage: "+E(Je(hi)(c.value?.PROCESS_LAYER)),1),a("label",Bd,[ae(a("input",{type:"checkbox","onUpdate:modelValue":j[4]||(j[4]=ne=>re.value=ne)},null,512),[[jt,re.value]]),j[20]||(j[20]=Q(" Anschließend Status „Gut“ buchen",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!c.value,onClick:Ee},E(L.value?"Zuweisung abschließen":"Zuweisen"),9,Fd)],64)):(p(),m(G,{key:2},[ae(a("input",{"onUpdate:modelValue":j[5]||(j[5]=ne=>v.value=ne),placeholder:"Auftrag filtern"},null,512),[[Ce,v.value]]),a("div",$d,[(p(!0),m(G,null,ge(M.value,ne=>(p(),m("button",{key:ne.number,class:"wb-mes-order",onClick:$e=>{C.value=ne.number,P.value=ne.layers[0]||"2"}},[a("b",null,E(ne.number),1),a("small",null,E(ne.part),1),a("span",null,E(ne.layers.map(Je(hi)).join(" / ")),1)],8,zd))),128))]),C.value?(p(),m("div",Hd,[a("b",null,"Auftrag: "+E(C.value),1),a("label",null,[j[21]||(j[21]=Q("Prozesslage",-1)),ae(a("select",{"onUpdate:modelValue":j[6]||(j[6]=ne=>P.value=ne)},[(p(!0),m(G,null,ge(M.value.find(ne=>ne.number===C.value)?.layers,ne=>(p(),m("option",{key:ne,value:ne},E(Je(hi)(ne)),9,Wd))),128))],512),[[_t,P.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:F},"Aktivieren",8,Vd)])):z("",!0)],64)),r.value?(p(),m("p",Kd,E(r.value),1)):z("",!0)])])):z("",!0)]))]))}}),jd=["aria-busy"],Jd={class:"wb-overview-top"},Yd={class:"wb-overview-station"},qd={class:"wb-overview-note"},Xd=["disabled"],Qd={key:0,class:"error",role:"alert"},Zd={class:"wb-overview-values"},ef={class:"wb-overview-label"},tf=["title"],sf=He({__name:"ProductionOverviewWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=S(null),s=S(!1),n=S(""),r=se(()=>Math.min(300,Math.max(0,Number(e.widget.props.refreshSeconds??30)||0)));let o,l=0;const u=se(()=>{const h=i.value||{},v=R=>Os(h[R]);return[{label:"Auftragsnummer",value:v("WORKORDER_NUMBER")},{label:"Artikelnummer",value:v("PART_NUMBER")},{label:"Beschreibung",value:v("PART_DESC")},{label:"Lage",value:h.PROCESS_LAYER===null||h.PROCESS_LAYER===void 0?"—":hi(h.PROCESS_LAYER)},{label:"Auftragsmenge",value:v("QUANTITY")}]});async function d(){const h=++l;if(e.demo){i.value={WORKORDER_NUMBER:"47110815",PART_NUMBER:"10004032",PART_DESC:"Musterartikel · Produktionsübersicht",PROCESS_LAYER:"0",QUANTITY:1200},n.value="";return}if(!ri(e.station)){n.value="Bitte eine gültige Station anmelden",i.value=null;return}s.value=!0,n.value="";try{const v=await ms(e.station);if(h!==l)return;i.value=v,(!v||String(v.WORKORDER_NUMBER??"").trim()==="-1")&&(i.value=null)}catch(v){h===l&&(i.value=null,n.value=v instanceof Error?v.message:String(v))}finally{h===l&&(s.value=!1)}}function c(){o&&clearInterval(o),o=void 0,d(),!e.demo&&r.value>0&&(o=setInterval(()=>{d()},r.value*1e3))}return nt([()=>e.station,()=>e.demo,r],c,{immediate:!0}),vi(()=>{l++,o&&clearInterval(o)}),(h,v)=>(p(),m("section",{class:"wb-production-overview","aria-busy":s.value},[a("div",Jd,[a("span",{class:xe(["wb-live-dot",{inactive:!!n.value}])},null,2),a("span",Yd,"Station "+E(t.station||"—"),1),a("span",qd,E(s.value?"Lade Stationsdaten…":i.value?"Aktiver Auftrag":"Kein aktiver Auftrag"),1),a("button",{type:"button",class:"subtle-button",disabled:s.value,onClick:d},"↻ Aktualisieren",8,Xd)]),n.value?(p(),m("div",Qd,E(n.value),1)):z("",!0),a("div",Zd,[(p(!0),m(G,null,ge(u.value,R=>(p(),m("div",{key:R.label,class:"wb-overview-value"},[a("div",ef,E(R.label),1),a("div",{class:"wb-overview-data",title:R.value},E(R.value),9,tf)]))),128))])],8,jd))}}),bi=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},nf=bi(sf,[["__scopeId","data-v-42cc2e76"]]),rf={class:"wb-mes-client"},of={class:"wb-mes-strip"},lf={class:"wb-mes-pill"},af=["disabled"],uf={key:0,class:"wb-mes-note"},cf={key:1,class:"wb-alert",role:"alert"},df={key:2,class:"wb-mes-note",role:"status"},ff={class:"wb-mes-tabs"},hf=["onClick"],pf={class:"wb-table-scroll"},gf={class:"wb-table"},mf={key:0},vf={key:0,class:"wb-mes-actions"},bf=["disabled","onClick"],yf=["disabled","onClick"],wf=["disabled","onClick"],Ef=["disabled","onClick"],_f=["disabled","onClick"],Sf=["disabled","onClick"],Rf={key:0},Af=["colspan"],kf={class:"wb-mes-dialog",role:"dialog","aria-modal":"true"},Cf=["disabled"],Tf={key:0,class:"wb-alert"},Nf={class:"wb-mes-check"},Mf=["disabled"],Of={class:"wb-mes-orders"},xf=["onClick"],Pf=["disabled"],If=["disabled"],Lf={class:"wb-mes-orders"},Df=["value"],Uf={class:"wb-mes-orders"},Bf=["value"],Ff={class:"wb-mes-check"},$f=["disabled"],zf={class:"wb-mes-actions"},Hf=["disabled"],Wf=["disabled"],Vf=["disabled"],Kf=["disabled"],Gf={key:5,class:"wb-alert"},jf=He({__name:"ManualProductionWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=S(e.station),s=S(""),n=S(!1),r=S(""),o=S(""),l=S([]),u=S([]),d=S({}),c=S([]),h=S([]),v=S([]),R=S([]),k=S(!1),C=S(""),P=S("plan"),B=S("none"),D=S(null),re=S(0),L=S(0),Z=S(-1),X=S(""),ie=S([]),ee=S([]),le=S(""),fe=S(""),me=S(!1),he=S(""),J=S("setup"),M=S(""),F=S(""),H=se(()=>!e.demo&&!!rl()&&ri(i.value));nt(()=>e.station,T=>{i.value=T,we()}),Qt(()=>{const T=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ii(T)&&(s.value=T)});function we(){l.value=[],u.value=[],d.value={},c.value=[],h.value=[],v.value=[],C.value=""}function Ee(T){return Object.keys(T)}const Ve=se(()=>({booking:d.value.booking||[],failure:d.value.failure||[],slip:d.value.slip||[],measure:d.value.measure||[],setup:c.value,setupcheck:h.value,attributes:v.value,plan:l.value})[P.value]||[]),qe=se(()=>Ve.value.length?Ee(Ve.value[0]):[]);function te(T){r.value=T instanceof Error?T.message:String(T)}function j(){return H.value?!0:(r.value="Buchungsaktionen sind nur im angemeldeten Werker-Modus erlaubt",!1)}function ne(T){return String(T.Arbeitsschritt??"")}function $e(T){const b=ne(T);return[...d.value.booking||[]].filter(A=>String(A.WORKSTEP_NUMBER)===b).sort((A,x)=>Number(x.BOOK_DATE||0)-Number(A.BOOK_DATE||0))[0]}function Me(T){const b=$e(T);if(String(b?.BOOK_STATE)==="2")return{ok:!1,reason:"Arbeitsschritt ist Ausschuss"};const A=l.value.indexOf(T);if(A<=0)return{ok:!0,reason:""};const x=l.value[A-1];return String($e(x)?.BOOK_STATE)!=="0"?{ok:!1,reason:"Vorgänger "+ne(x)+" ist nicht mit Gut (0) gebucht"}:{ok:!0,reason:""}}function W(T){return String(k.value?T.AVO:T.Prozesslage??"2")}const Ge=se(()=>D.value?u.value.filter(T=>String(T.MEASURE_NAME||"").startsWith(String(D.value?.AVO)+"|")):[]);async function Ie(){if(r.value="",o.value="",!H.value||!ii(s.value)){r.value="Workbench-Anmeldung, Station und gültige Seriennummer erforderlich";return}n.value=!0,we();try{const T=await ll(i.value,s.value);if(d.value=T.sections,C.value=String(T.result.workOrderNumber||T.sections.booking[0]?.WORKORDER_NUMBER||""),!C.value)throw new Error("Kein Auftrag zur Seriennummer gefunden");const b=[{key:"FUNC_MODE",value:"0"},{key:"WORKORDER_NUMBER",value:C.value},{key:"WORKSTEP_FLAG",value:"1"}];let A=["WORKSTEP_AVO","WORKSTEP_NUMBER","PROCESS_LAYER","WORKSTEP_DESC","OBLIGATORY_CONFIRM_FLAG","PART_NUMBER","SKILL_LEVEL"],x=["AVO","Arbeitsschritt","Prozesslage","Beschreibung","Rueckmeldepflichtig","Artikelnummer","Skill"],Y;try{Y=await Oe("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:b,workplanDataResultKeys:A})}catch(Ae){if(Ae?.code!==-368)throw Ae;A=A.slice(0,-1),x=x.slice(0,-1),Y=await Oe("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:b,workplanDataResultKeys:A})}l.value=et(Y.workplanDataResultValues,A,x);const de=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","MIN_VALUE","MAX_VALUE","NOMINAL","UNIT"],_e=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","LOWER_LIMIT","UPPER_LIMIT","NOMINAL","UNIT"],pe=["COMP_NAME","PART_NUMBER","MATERIAL_BIN_NUMBER","BOOK_DATE","SETUP_POSITION","WORKSTEP_NUMBER","STATION_NUMBER","STATION_DESC","WORKORDER_NUMBER"],Se=["COMP_NAME","PART_NUMBER","PART_DESC","PROCESS_LAYER","QUANTITY","PRODUCT_FLAG","SETUP_FLAG","UNIT","WORKSTEP_NUMBER","SETUP_POSITION"],Re=["PART_NUMBER","MATERIAL_BIN_NUMBER","MATERIAL_BIN_QTY_ACTUAL","MATERIAL_BIN_STATE","EXPIRATION_DATE","SETUP_POSITION"],ze=await Promise.allSettled([Oe("mdaGetRecipeData",{stationNumber:i.value,recipeVersionId:-1,function:"-1",functionStep:"-1",measurementName:"-1",sequentialNumber:-1,type:"-1",measurementType:"-1",objectType:1,recipeFilters:[{key:"PART_NUMBER",value:String(l.value[0]?.Artikelnummer||"-1")}],recipeResultKeys:de},[0,-702]),Oe("setupGetSetupDataBySerialNumber",{stationNumber:i.value,serialNumber:s.value,partNumber:"-1",location:"-1",level:"-1",setupResultKeys:pe}),Oe("setupGetMaterialSetup",{stationNumber:i.value,processLayer:-1,setupFlag:0,setupStartDate:-1,setupEndDate:-1,setupResultKeys:Re,componentResultKeys:[]}),Oe("mdataGetBomData",{stationNumber:i.value,bomDataFilter:[{key:"SERIAL_NUMBER",value:s.value}],bomDataResultKeys:Se}),Oe("attribGetAttributeValues",{stationNumber:i.value,objectType:0,objectNumber:s.value,objectDetail:"-1",attributeCodeArray:[],allMergeLevel:1,attributeResultKeys:["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"]}),Oe("mdataGetFailureDataForStation",{stationNumber:i.value,functionMode:0,failureDataResultKeys:["FAILURE_TYPE_CODE","FAILURE_TYPE_DESC"]}),Oe("mdataGetStationConfiguration",{stationNumber:i.value,stationConfigFilter:[{key:"CODE_NUMBER",value:"8310"}],stationConfigCodeResultKeys:["CODE_VALUE","IS_USED"],stationParamResultKeys:[],stationLicenseResultKeys:[]})]),Be=Ae=>{const ye=ze[Ae];return ye.status==="fulfilled"?ye.value:{}};u.value=et(Be(0).recipeResultValues,de,_e),c.value=et(Be(1).setupResultValues,pe);const Qe=et(Be(2).setupResultValues,Re);h.value=et(Be(3).bomDataResultValues,Se).map(Ae=>({...Ae,MATERIAL_BIN_NUMBERS:Qe.filter(ye=>String(ye.PART_NUMBER)===String(Ae.PART_NUMBER)).map(ye=>String(ye.MATERIAL_BIN_NUMBER)).join(", ")})),v.value=et(Be(4).attributeResultValues,["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"]),R.value=et(Be(5).failureDataResultValues,["FAILURE_TYPE_CODE","FAILURE_TYPE_DESC"]);const ut=Be(6).stationConfigCodeResultValues||[];k.value=String(ut[0]||"").toUpperCase()==="A"&&["1","TRUE"].includes(String(ut[1]||"").toUpperCase());const ai=ze.map((Ae,ye)=>Ae.status==="rejected"?`Datenquelle ${ye+1}: ${String(Ae.reason)}`:"").filter(Boolean);o.value=ai.length?"Teildaten geladen. "+ai.join(" · "):`Arbeitsplan: ${l.value.length} Schritte · ${u.value.length} Rezeptwerte`}catch(T){te(T)}finally{n.value=!1}}function Xe(T,b){r.value="",D.value=b,B.value=T,Z.value=-1,X.value="",ie.value=[],ee.value=[],le.value="",fe.value="",re.value=0,L.value=0,me.value=!1}function At(T){Z.value=T,X.value=String(Ge.value[T]?.MEASURE_VALUE??"")}function g(){const T=Ge.value[Z.value];if(!T){r.value="Messgröße auswählen";return}T.MEASURE_VALUE=X.value,o.value="Messwert lokal vorgemerkt. MES-Buchung über Status-Dialog ausführen.",B.value="none"}function y(){const T=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","LOWER_LIMIT","UPPER_LIMIT","MEASURE_VALUE","NOMINAL","UNIT","MEASURE_FAIL_CODE"],A=[...Ge.value].sort((x,Y)=>String(x.MEASURE_NAME||"").localeCompare(String(Y.MEASURE_NAME||""),"de",{numeric:!0})).flatMap(x=>[String(x.MEASURE_NAME||"").split("|")[1]||"",x.FUNCTION||"",x.FUNCTION_DESC||"",x.FUNCTION_STEP||"",x.FUNCTION_STEP_DESC||"",x.LOWER_LIMIT||"",x.UPPER_LIMIT||"",x.MEASURE_VALUE||"",x.NOMINAL||"",x.UNIT||"",0]);return{keys:T,values:A}}async function O(){if(!j()||!D.value)return;const T=Me(D.value);if(!T.ok){r.value=T.reason;return}const b=W(D.value);if(confirm(`Status ${re.value} an Schritt ${ne(D.value)} buchen?`)){n.value=!0,r.value="";try{const A=y();A.values.length?await Oe("trUploadResultDataAndRecipe",{stationNumber:i.value,processLayer:b,recipeVersionId:-1,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:re.value,duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,recipeVersionMode:0,resultUploadKeys:A.keys,resultUploadValues:A.values}):await Oe("trUploadState",{stationNumber:i.value,processLayer:b,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:re.value,duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,serialNumberUploadKeys:["SERIAL_NUMBER","SERIAL_NUMBER_STATE","ERROR_CODE"],serialNumberUploadValues:[]}),B.value="none",await Ie(),o.value="Statusbuchung durch MES bestätigt"}catch(A){te(A)}finally{n.value=!1}}}async function $(){if(j()){if(!D.value||!ie.value.length){r.value="Fehlercode auswählen";return}if(confirm("Fehlerbuchung ausführen?")){n.value=!0,r.value="";try{const T=ee.value.length?["COMP_NAME","ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"]:["ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"],b=(ee.value.length?ee.value:[""]).flatMap(A=>ie.value.flatMap(x=>ee.value.length?[A,"0",x,me.value?"1":"0"]:["0",x,me.value?"1":"0"]));await Oe("trUploadFailureAndResultData",{stationNumber:i.value,processLayer:W(D.value),serialNumberRef:s.value,serialNumberRefPos:"-1",...le.value?{serialNumberState:Number(le.value)}:{},duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,measureKeys:["ERROR_CODE","MEASURE_FAIL_CODE","MEASURE_NAME","MEASURE_VALUE"],measureValues:[],failureKeys:T,failureValues:b,failureSlipKeys:["ERROR_CODE","TESTSTEP_NAME"],failureSlipValues:fe.value.trim()?["0",fe.value.trim()]:[]}),B.value="none",await Ie(),o.value="Fehlerbuchung erfolgreich"}catch(T){te(T)}finally{n.value=!1}}}}async function I(T){if(!(!j()||!D.value)&&confirm(`Rüstzustand ${T} für Station ${i.value} ändern?`)){n.value=!0,r.value="";try{const b=["PART_NUMBER","BOM_VERSION_ERP","PROCESS_LAYER","WORKORDER_NUMBER","QUANTITY"],A=await Oe("trGetStationSetting",{stationNumber:i.value,stationSettingResultKeys:b}),x=et(A.stationSettingResultValues,b)[0];if(!x)throw new Error("Stationseinstellungen fehlen");await Oe("setupStateChange",{stationNumber:i.value,processLayer:x.PROCESS_LAYER,workOrderNumber:x.WORKORDER_NUMBER,serialNumber:"-1",serialNumberPos:"-1",setupState:T}),B.value="none",await Ie()}catch(b){te(b)}finally{n.value=!1}}}async function U(){if(j()){if(!he.value.trim()||!ri(i.value)){r.value="Materialbehälter fehlt";return}n.value=!0,r.value="";try{const T=he.value.trim();await Oe("setupUpdateMaterialSetup",{stationNumber:i.value,materialBinNumber:-1,partNumber:"-1",location:"SMT",setupUploadKeys:["ERROR_CODE","MATERIAL_BIN_NUMBER","SETUP_POSITION","SETUP_STATE"],setupUploadValues:[0,T,T.slice(-6),J.value==="setup"?0:1],resultKeys:["COMP_REFERENCE"],resultValues:[]}),B.value="none",await Ie()}catch(T){te(T)}finally{n.value=!1}}}async function K(){if(j()){if(!M.value.trim()){r.value="Attributcode fehlt";return}n.value=!0,r.value="";try{const T={stationNumber:i.value,objectType:0,objectNumber:s.value,objectDetail:"-1",bookDate:-1,allowOverWrite:1,attributeUploadKeys:["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"],attributeUploadValues:[M.value,F.value,0]};let b=!1;try{const x=(await Oe("attribAppendAttributeValues",T,[0,5])).attributeResultValues;Array.isArray(x)&&x.some(Y=>String(Y)==="-901")&&(b=!0)}catch(A){if(A?.code!==-901)throw A;b=!0}b&&(await Oe("attribCreateAttributeCode",{stationNumber:i.value,codeKeys:["ATTRIBUTE_CODE","DATA_TYPE","OBJECT_TYPE"],codeValues:[M.value,"STRING","0"]}),await Oe("attribAppendAttributeValues",T)),B.value="none",await Ie()}catch(T){te(T)}finally{n.value=!1}}}async function V(T){if(j()&&confirm("Auftrag für Arbeitsschritt "+ne(T)+" aktivieren?")){n.value=!0,r.value="";try{const b=["WORKORDER_NUMBER"],x=(await Oe("trGetSerialNumberInfo",{stationNumber:i.value,serialNumber:s.value,serialNumberPos:"-1",serialNumberResultKeys:b})).serialNumberResultValues?.[0];if(!x)throw Error("Seriennummer hat keinen Auftrag");await Oe("trActivateWorkOrder",{stationNumber:i.value,workOrderNumber:String(x),serialNumber:"-1",serialNumberPos:"-1",processLayer:W(T),flag:"1"}),o.value="Auftrag aktiviert"}catch(b){te(b)}finally{n.value=!1}}}return(T,b)=>(p(),m("div",rf,[a("div",of,[a("span",lf,E(i.value||"Station fehlt"),1),a("span",null,[b[17]||(b[17]=Q("Auftrag: ",-1)),a("b",null,E(C.value||"—"),1)]),a("span",null,E(k.value?"AVO-Steuerung":"Prozesslage"),1)]),a("form",{class:"wb-mes-form",onSubmit:We(Ie,["prevent"])},[a("label",null,[b[18]||(b[18]=Q("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":b[0]||(b[0]=A=>s.value=A),autocomplete:"off",placeholder:"Seriennummer scannen"},null,512),[[Ce,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!H.value},E(n.value?"Lade…":"Arbeitsplan laden"),9,af)],32),H.value?z("",!0):(p(),m("p",uf,E(t.demo?"Demo – keine MES-Aktionen":"Zuerst die Workbench-Station anmelden."),1)),r.value?(p(),m("p",cf,E(r.value),1)):z("",!0),o.value?(p(),m("p",df,E(o.value),1)):z("",!0),a("div",ff,[(p(),m(G,null,ge(["plan","booking","failure","slip","measure","setup","setupcheck","attributes"],A=>a("button",{key:A,class:xe(["wb-mes-tab",{selected:P.value===A}]),onClick:x=>P.value=A},E({plan:"Arbeitsplan",booking:"Buchungen",failure:"Fehler",slip:"Fehlerschein",measure:"Messwerte",setup:"Rüstung",setupcheck:"SetupCheck",attributes:"Attribute"}[A]),11,hf)),64))]),a("div",pf,[a("table",gf,[a("thead",null,[a("tr",null,[P.value==="plan"?(p(),m("th",mf,"Aktionen")):z("",!0),(p(!0),m(G,null,ge(qe.value,A=>(p(),m("th",{key:A},E(Je(nl)[A]||A),1))),128))])]),a("tbody",null,[(p(!0),m(G,null,ge(Ve.value,(A,x)=>(p(),m("tr",{key:x},[P.value==="plan"?(p(),m("td",vf,[a("button",{class:"wb-btn wb-small",title:"Messwerte",disabled:n.value,onClick:Y=>Xe("measure",A)},"M",8,bf),a("button",{class:"wb-btn wb-small",title:"Fehler",disabled:n.value,onClick:Y=>Xe("failure",A)},"F",8,yf),a("button",{class:"wb-btn wb-small",title:"Rüstung",disabled:n.value,onClick:Y=>Xe("setup",A)},"R",8,wf),a("button",{class:"wb-btn wb-small",title:"Attribute",disabled:n.value,onClick:Y=>Xe("attribute",A)},"A",8,Ef),a("button",{class:"wb-btn wb-small",title:"Status buchen",disabled:n.value||!H.value||!Me(A).ok,onClick:Y=>Xe("status",A)},"✓",8,_f),a("button",{class:"wb-btn wb-small",title:"Auftrag aktivieren",disabled:n.value||!H.value,onClick:Y=>V(A)},"↗",8,Sf)])):z("",!0),(p(!0),m(G,null,ge(qe.value,Y=>(p(),m("td",{key:Y},E(Je(Os)(A[Y],Y)),1))),128))]))),128)),Ve.value.length?z("",!0):(p(),m("tr",Rf,[a("td",{colspan:qe.value.length+(P.value==="plan"?1:0)||1,class:"wb-empty"},"Keine Daten geladen",8,Af)]))])])]),(p(),Le(Fn,{to:"body"},[B.value!=="none"?(p(),m("div",{key:0,class:"wb-mes-overlay",onClick:b[16]||(b[16]=We(A=>!n.value&&(B.value="none"),["self"]))},[a("section",kf,[a("header",null,[a("strong",null,E({status:"Statusbuchung",measure:"Messwert erfassen",failure:"Fehler buchen",setup:"Rüstung",attribute:"Attribute",none:""}[B.value])+" · AVO "+E(D.value?.AVO),1),a("button",{class:"wb-btn",disabled:n.value,onClick:b[1]||(b[1]=A=>B.value="none")},"✕",8,Cf)]),B.value==="status"?(p(),m(G,{key:0},[a("p",null,"Arbeitsschritt "+E(D.value?.Arbeitsschritt)+" · "+E(D.value?.Beschreibung),1),Me(D.value).ok?z("",!0):(p(),m("p",Tf,E(Me(D.value).reason),1)),a("label",null,[b[20]||(b[20]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":b[2]||(b[2]=A=>re.value=A)},[...b[19]||(b[19]=[a("option",{value:0},"Gut",-1),a("option",{value:1},"Nacharbeit",-1),a("option",{value:2},"Ausschuss",-1)])],512),[[_t,re.value,void 0,{number:!0}]])]),a("label",Nf,[ae(a("input",{type:"checkbox","onUpdate:modelValue":b[3]||(b[3]=A=>L.value=A),"true-value":1,"false-value":0},null,512),[[jt,L.value]]),b[21]||(b[21]=Q(" Nutzen",-1))]),a("p",null,E(Ge.value.length)+" Messwerte werden mitgebucht.",1),a("button",{class:"wb-btn wb-primary",disabled:n.value||!Me(D.value).ok,onClick:O},"Buchen",8,Mf)],64)):z("",!0),B.value==="measure"?(p(),m(G,{key:1},[a("div",Of,[(p(!0),m(G,null,ge(Ge.value,(A,x)=>(p(),m("button",{key:x,class:xe(["wb-mes-order",{chosen:Z.value===x}]),onClick:Y=>At(x)},E(A.MEASURE_NAME)+" · "+E(A.UNIT)+" ("+E(A.LOWER_LIMIT)+" … "+E(A.UPPER_LIMIT)+")",11,xf))),128))]),a("label",null,[b[22]||(b[22]=Q("Messwert",-1)),ae(a("input",{"onUpdate:modelValue":b[4]||(b[4]=A=>X.value=A),disabled:Z.value<0},null,8,Pf),[[Ce,X.value]])]),a("button",{class:"wb-btn wb-primary",disabled:Z.value<0,onClick:g},"Übernehmen (lokal)",8,If)],64)):z("",!0),B.value==="failure"?(p(),m(G,{key:2},[b[27]||(b[27]=a("p",null,"Fehlerart auswählen",-1)),a("div",Lf,[(p(!0),m(G,null,ge(R.value,A=>(p(),m("label",{key:String(A.FAILURE_TYPE_CODE),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(A.FAILURE_TYPE_CODE),"onUpdate:modelValue":b[5]||(b[5]=x=>ie.value=x)},null,8,Df),[[jt,ie.value]]),Q(" "+E(A.FAILURE_TYPE_CODE)+" – "+E(A.FAILURE_TYPE_DESC),1)]))),128))]),b[28]||(b[28]=a("p",null,"Komponenten (optional)",-1)),a("div",Uf,[(p(!0),m(G,null,ge(h.value,A=>(p(),m("label",{key:String(A.COMP_NAME),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(A.COMP_NAME),"onUpdate:modelValue":b[6]||(b[6]=x=>ee.value=x)},null,8,Bf),[[jt,ee.value]]),Q(" "+E(A.COMP_NAME)+" · "+E(A.PART_NUMBER),1)]))),128))]),a("label",null,[b[23]||(b[23]=Q("Fehlerscheintext",-1)),ae(a("input",{"onUpdate:modelValue":b[7]||(b[7]=A=>fe.value=A)},null,512),[[Ce,fe.value]])]),a("label",null,[b[25]||(b[25]=Q("Status",-1)),ae(a("select",{"onUpdate:modelValue":b[8]||(b[8]=A=>le.value=A)},[...b[24]||(b[24]=[a("option",{value:""},"Ohne Statusänderung",-1),a("option",{value:"0"},"Gut",-1),a("option",{value:"1"},"Nacharbeit",-1),a("option",{value:"2"},"Ausschuss",-1)])],512),[[_t,le.value]])]),a("label",Ff,[ae(a("input",{type:"checkbox","onUpdate:modelValue":b[9]||(b[9]=A=>me.value=A)},null,512),[[jt,me.value]]),b[26]||(b[26]=Q(" Repariert",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!ie.value.length,onClick:$},"Fehler buchen",8,$f)],64)):z("",!0),B.value==="setup"?(p(),m(G,{key:3},[a("p",null,"Rüstzustand und Materialbehälter an Station "+E(i.value),1),a("div",zf,[a("button",{class:"wb-btn",disabled:n.value,onClick:b[10]||(b[10]=A=>I(0))},"Rüstung aktivieren",8,Hf),a("button",{class:"wb-btn",disabled:n.value,onClick:b[11]||(b[11]=A=>I(2))},"Rüstung löschen",8,Wf)]),a("label",null,[b[29]||(b[29]=Q("Behälternummer",-1)),ae(a("input",{"onUpdate:modelValue":b[12]||(b[12]=A=>he.value=A)},null,512),[[Ce,he.value,void 0,{trim:!0}]])]),a("label",null,[b[31]||(b[31]=Q("Modus",-1)),ae(a("select",{"onUpdate:modelValue":b[13]||(b[13]=A=>J.value=A)},[...b[30]||(b[30]=[a("option",{value:"setup"},"Einrüsten",-1),a("option",{value:"remove"},"Abrüsten",-1)])],512),[[_t,J.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:U},"Behälter übernehmen",8,Vf)],64)):z("",!0),B.value==="attribute"?(p(),m(G,{key:4},[a("label",null,[b[32]||(b[32]=Q("Attributcode",-1)),ae(a("input",{"onUpdate:modelValue":b[14]||(b[14]=A=>M.value=A)},null,512),[[Ce,M.value,void 0,{trim:!0}]])]),a("label",null,[b[33]||(b[33]=Q("Wert",-1)),ae(a("input",{"onUpdate:modelValue":b[15]||(b[15]=A=>F.value=A)},null,512),[[Ce,F.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:K},"Attribut speichern",8,Kf)],64)):z("",!0),r.value?(p(),m("p",Gf,E(r.value),1)):z("",!0)])])):z("",!0)]))]))}}),Jf={class:"hmi-script-widget"},Yf=["disabled"],qf={key:0,class:"script-result"},Xf={key:1,class:"error"},Qf=["srcdoc"],Zf=He({__name:"ScriptWidget",props:{widget:{},demo:{type:Boolean},station:{}},setup(t){const e=t,i=S(null),s=S(""),n=S(""),r=Math.random().toString(36).slice(2)+Date.now().toString(36),o=se(()=>{const c=String(e.widget.props.script||'return {info:"REST-Skript anpassen"};'),h=JSON.stringify(c).replace(/ - +Workbench HMI +
diff --git a/backend/src/test/java/com/workbenchclassic/hmi/HmiPageAccessTest.java b/backend/src/test/java/com/workbenchclassic/hmi/HmiPageAccessTest.java new file mode 100644 index 0000000..597f63c --- /dev/null +++ b/backend/src/test/java/com/workbenchclassic/hmi/HmiPageAccessTest.java @@ -0,0 +1,26 @@ +package com.workbenchclassic.hmi; +import org.junit.jupiter.api.Test; +import org.json.*; +import java.util.*; +import static org.junit.jupiter.api.Assertions.*; +class HmiPageAccessTest { + private JSONObject page(String parent,boolean enabled,String...roles){return new JSONObject().put("parentPageId",parent==null?JSONObject.NULL:parent).put("enabled",enabled).put("visibleToRoles",new JSONArray(Arrays.asList(roles)));} + @Test void rolesAndAncestorsAreEnforced(){ + Map pages=new HashMap<>();pages.put("root",page(null,true,"quality"));pages.put("child",page("root",true,"operator")); + assertFalse(HmiPageAccess.visible("child",pages,Set.of("operator"))); + assertFalse(HmiPageAccess.visible("child",pages,Set.of("quality"))); + assertTrue(HmiPageAccess.visible("child",pages,Set.of("operator","quality"))); + assertTrue(HmiPageAccess.visible("child",pages,Set.of("hmi-admin"))); + pages.put("root",page(null,false));assertFalse(HmiPageAccess.visible("child",pages,Set.of("hmi-admin"))); + pages.put("root",page("child",true));assertFalse(HmiPageAccess.visible("child",pages,Set.of("hmi-admin"))); + pages.remove("root");assertFalse(HmiPageAccess.visible("child",pages,Set.of("hmi-admin"))); + } + @Test void validationAndOpenPages(){ + assertTrue(HmiPageAccess.allows(Set.of(),new JSONArray())); + assertFalse(HmiPageAccess.allows(Set.of(),new JSONArray().put("quality"))); + assertEquals(1,HmiPageAccess.validate(new JSONArray().put("quality").put("quality")).length()); + assertThrows(JSONException.class,()->HmiPageAccess.validate(new JSONArray().put("bad role"))); + assertThrows(JSONException.class,()->HmiPageAccess.validate(new JSONArray().put(12))); + assertThrows(JSONException.class,()->HmiPageAccess.validate(null)); + } +} diff --git a/hmi-docs/CLIENT_MIGRATION_MATRIX.md b/hmi-docs/CLIENT_MIGRATION_MATRIX.md index c11edf0..e89476a 100644 --- a/hmi-docs/CLIENT_MIGRATION_MATRIX.md +++ b/hmi-docs/CLIENT_MIGRATION_MATRIX.md @@ -50,3 +50,11 @@ JARs ALWAYS come from the authenticated MES server. No archived runtime fallback launch refreshes the manifest and JAR-cache generation. Browser identity login fix retained; window diagnostics default off. User reports login works; authenticated version compatibility remains to be verified after redeployment. See WORKPLACE_DEPLOYMENT.md. + +## 2026-11-24 – roles / page access / JNLP viewport + +Role catalog displayed independently of person selection; page role policies stored transactionally +in HMI_APP_PREF/PAGE_ACCESS and enforced on operator navigation, effective pages and layout writes. +Ancestor restrictions apply; existing designer/admin management privileges retained. JNLP starts in +full browser viewport; browser fullscreen requires a click; diagnostics remain off. +See HMI_PAGE_ROLES_FULLSCREEN.md for test evidence and live-test limits. diff --git a/hmi-frontend/src/PageManager.vue b/hmi-frontend/src/PageManager.vue index 0bdf6c1..2d1a668 100644 --- a/hmi-frontend/src/PageManager.vue +++ b/hmi-frontend/src/PageManager.vue @@ -1,11 +1,15 @@