diff --git a/WORKPLACE_DEPLOYMENT.md b/WORKPLACE_DEPLOYMENT.md index 1b2dffd..2f88d02 100644 --- a/WORKPLACE_DEPLOYMENT.md +++ b/WORKPLACE_DEPLOYMENT.md @@ -1,100 +1,60 @@ -# WidgetWorkbench / Workplace – GlassFish candidate, 2026-11-22 +# Workplace / GlassFish – remote-only correction, 2026-11-23 -## Artifact and scope +## Correction and authority -`backend-1.war` is built for Java EE 8 (`javax.*`), Java 11 bytecode and context root `/backend`. -Use the existing compatible GlassFish/Payara environment (not a Jakarta-only GlassFish 6/7 installation). -Keep the existing `dsCustNJTA`, MES datasource, IMSAPI configuration and role assignments. -No server configuration or deployment has been changed by this build. +The previous build packaged a fixed ZIP snapshot. This can mismatch the running MES backend. +The user confirmed the login works and requires the JARs from the current MES Workplace.jnlp. +This build therefore ALWAYS fetches the configured JNLP from the authenticated IMSAPI target +under `/mes/webstart/clients/`, and the approved manufacturer JARs from that MES server. +There is no ZIP/bundled fallback, including on TLS, network or HTTP failures. +The old `hmi.workplace.source=bundled` setting is no longer consulted. +`Workplace.zip` is reference material only, not a build input or runtime source. -The 129 platform-independent manufacturer JARs from `Workplace.zip` are included byte-for-byte -under `WEB-INF/classes/hmi/workplace-jars/`. They are NOT server libraries in `WEB-INF/lib` -and cannot be downloaded directly through a public static URL. The existing authenticated, -role-checked endpoint serves them with HTTP Range support. JAR hashes were checked in the final WAR. +Each manifest request (widget start/restart) fetches a fresh upstream manifest and invalidates +server-side JAR cache generations, even if all filenames stayed the same. Browser HTTP responses +for manufacturer JARs use `private, no-store, no-transform`. The server still caches downloaded +bytes within a generation to serve CheerpJ's many Range requests efficiently. +Restart/reload Workplace after a backend upgrade; already-loaded Java classes cannot be hot-swapped. +Avoid upgrading the MES during a running client session. No atomic upstream release snapshot is implied. + +The original manifest parser currently accepts flat JAR filenames within the configured MES +clients directory. Unsupported JNLP structures/paths fail explicitly, never substitute ZIP files. +Platform-specific JNI/RXTX dependencies remain unsupported by the browser VM. ## Deployment -1. Back up the existing deployment and retain its server settings. -2. Deploy `backend-1.war` using the GlassFish console, application context root `/backend`. - When using asadmin, select your existing domain/instance explicitly; do not create new datasources. -3. Sign in to `/backend/hmi/` using the existing IMSAPI login. The user requires `hmi-workplace` - or `hmi-admin`; widget editing additionally requires the existing designer/script-editor roles. -4. Add/use `ui.cheerpj-workplace` in the normal runtime page. The browser uses Java 11 / CheerpJ 5.0. -5. For a full-window diagnostic after login, open: - `/backend/hmi/cheerpj-runner.html?standalone=workplace&windows=diagnose` -6. Verify login, window rendering and your read-only test workflow before any production bookings. +Deploy `release/backend-1.war` on the existing Java EE 8 (`javax.*`), Java-11-compatible +GlassFish/Payara instance with context `/backend`. This WAR is not for a Jakarta-only GlassFish 6/7. +Preserve the existing datasources, IMSAPI target and role configuration. No server configuration +or live deployment was changed while creating this artifact. -## Resource source +After redeployment, close the old Workplace tab/iframe and reopen the widget (or hard-reload). +Existing role requirements remain: `hmi-workplace` or `hmi-admin` for runtime/JAR downloads. +The Browser JAAS fix remains: `os.name=CheerpJ Browser` and `user.name=cheerpj-client` passed +via CheerpJ initialization. This does not replace MES authentication. No manufacturer bytecode +or signatures are altered; the old unsigned SysParameter override remains disabled by default. +Window diagnostics default to OFF; explicit diagnostics remain available for troubleshooting. -Default: bundled archive and bundled `Workplace.jnlp`. This is a pinned client version, not an automatic -update from the MES. Ensure this version matches the deployed MES. -For remote manifests/JARs, set `-Dhmi.workplace.source=remote` in the chosen GlassFish domain, -after inspecting existing JVM options. Remote mode still validates TLS and requires a valid CA chain. -Other configured JNLP filenames require remote mode. Bundled mode does not silently mix versions. +The application and MES must be same-origin or MES must allow the Workbench origin via CORS. +GlassFish must trust the TLS chain of the MES host to download the remote manifest/JARs. +The browser separately needs trust and connectivity to all MES-discovered service endpoints. +No TLS bypass or credential forwarding was added. Upstream failure is an error, not an archive fallback. -## Browser network requirements – NOT solved by local JAR packaging +Open `/backend/hmi/` and use the existing Workplace widget. For a full window after HMI login: +`/backend/hmi/cheerpj-runner.html?standalone=workplace` +CheerpJ 5.0 is loaded from its CDN; an appropriate license is required for business use. -Workplace directly calls MES ARTES services from the browser. Deploy Workbench on the SAME HTTPS -origin (scheme, host AND port) as MES, or configure the MES server to allow the actual Workbench -origin. The isolated localhost browser test observed CORS failures for `/mes/artes/settings`, -`/workbench/artes/settings` and `/help/artes/settings` and service discovery calls. -Cluster discovery can also return internal addresses (including 192.168.20.106 in the supplied -partner environment). Every returned endpoint must be reachable and have browser-trusted TLS; -a local WAR cannot fix the remote cluster topology. No TLS or browser security checks are disabled. +## Verification and limits -The shell HTTPS request to the partner JNLP failed certificate validation; Chromium could reach -initial cluster discovery. Browser and GlassFish trust stores need independent verification. +- Vue typecheck/Vite and Maven package: passed. +- New regression: same remote JAR filename changed from v1 to v2; after invalidation v2 is served. +- Missing remote server after invalidation raises an error; no old bytes used as fallback. +- No packaged manufacturer JAR bundle; unsafe XML rejected. +- Existing HTTP Range/cache, manifest and CheerpJ suites passed. +- The user reports the login works with the previous identity fix, retained here. +- No authenticated MES workflow, remote version compatibility or Windows-GlassFish deployment + has been end-to-end tested with this new build. The previous screenshot is NOT a new-build test. -CheerpJ runtime is loaded from `https://cjrtnc.leaningtech.com/5.0/loader.js` (HTTP 200 verified). -Business use requires an appropriate CheerpJ license; no license was purchased or supplied. -Native RXTX/serial drivers are not supported as desktop JNI in a browser. - -## JAAS / signed classes - -The original build enabled an unsigned `SysParameter` replacement before signed vendor JARs. -The archive confirms other signed classes share its package. The replacement is now OFF by default. -`sysparam=on` is an explicit diagnostic opt-in only; it is not a general production fix for signed -packages. The original JAAS native bridge remains. No vendor signatures or class bytes were changed. - -The same-origin browser test reproduced `Missing import: JVM_LoadLibrary` with native identity. -The runner now supplies `os.name=CheerpJ Browser` and `user.name=cheerpj-client` via -`cheerpjInit.javaProperties` and in the library context before vendor main(). Runtime-only -System.setProperty calls did NOT fix the separate application launch in the browser test. Bytecode inspection of the supplied original SysParameter confirms -that unrecognized OS names use its existing user.name fallback instead of loading desktop JAAS. -This is a synthetic local identity, NOT an authenticated MES user or OS SSO. Regular MES login -is still required. `identity=native` restores the old behavior for diagnosis. OS-specific integrations -need separate testing because the application sees a non-desktop operating system. - -## Rebuild and automated validation - -From the project root: - -```sh -bash build-hmi.sh -npm run test:cheerpj --prefix hmi-frontend -bash hmi-scripts/test-workplace-range.sh -bash hmi-scripts/test-workplace-cluster.sh -``` - -Build prerequisites: Python 3, Node/npm, Maven, JDK 11+ (`javac --release 11`). -`prepare-workplace.py` validates and stages the supplied archive; do not put `.workplace-bundle` -in source control. Build scripts work even when archive extraction removed executable bits. -JaCoCo is updated for the installed JDK 25; vendor JAR resources are excluded from application -coverage analysis (they contain duplicate vendor API classes). Application checks remain enabled. - -Verified: Vue typecheck/Vite build, Maven package, 2 new bundle tests, 18 Range/cache checks, -existing CheerpJ contract suites, all 129 final WAR JAR hashes. No authenticated MES login, -booking, full GlassFish deployment or database integration test has been performed. - -## Observed browser result - -Chromium + CheerpJ 5.0 + Java 11 rendered the Workplace main window AND the real MES login -form (user name, password, client 01, Login/Change password/Cancel) after initialization properties -were applied. Screenshot: `workplace-login.png`. The `JVM_LoadLibrary` startup blocker did not -recur in this run. No credentials were entered and no authenticated workflow was exercised. - -Test setup: Playwright locally fulfilled ONLY `/backend/**` from the built WAR/resources while -the page used the partner server origin; actual MES requests used the partner server. This models -same-origin deployment, but it is NOT proof of a GlassFish deployment or of HMI authentication. -The localhost-origin test separately exposed the expected CORS failures. The renderer test does -not certify all native desktop functions, resize behavior, printing or every Workplace module. +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. diff --git a/backend/pom.xml b/backend/pom.xml index 0a80dbc..7dfe973 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -92,7 +92,6 @@ src/main/resources - ../.workplace-bundlehmi/workplace-jars diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceJarCache.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceJarCache.java index f0246d1..7484ae6 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceJarCache.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceJarCache.java @@ -31,28 +31,6 @@ final class HmiWorkplaceJarCache { private HmiWorkplaceJarCache() { } - static Path obtainBundled(String filename) throws IOException { - if(filename==null || !filename.matches("[A-Za-z0-9_.-]{1,180}\\.jar")) - throw new IOException("Invalid bundled JAR name"); - Path destination=ROOT.resolve("bundled-"+filename); - synchronized(LOCKS.computeIfAbsent("bundled-"+filename, unused -> new Object())) { - if(Files.isRegularFile(destination)) return destination; - try(InputStream in=HmiWorkplaceJarCache.class.getResourceAsStream("/hmi/workplace-jars/"+filename)) { - if(in==null) throw new IOException("Bundled Workplace JAR missing: "+filename); - Path temporary=Files.createTempFile(ROOT,"bundle-",".tmp"); - try { - Files.copy(in,temporary,StandardCopyOption.REPLACE_EXISTING); - if(Files.size(temporary)>MAX_JAR_BYTES) throw new IOException("Bundled JAR too large"); - try(ZipFile zip=new ZipFile(temporary.toFile())) { - if(!zip.entries().hasMoreElements()) throw new IOException("Empty bundled JAR"); - } - Files.move(temporary,destination,StandardCopyOption.REPLACE_EXISTING); - } finally {Files.deleteIfExists(temporary);} - } - return destination; - } - } - static Path obtain(URL upstream) throws IOException { String key = sha256(cacheGeneration + ":" + upstream.toExternalForm()); Path destination = ROOT.resolve(key + ".jar"); @@ -89,6 +67,8 @@ final class HmiWorkplaceJarCache { HttpURLConnection connection = (HttpURLConnection) source.openConnection(); try { connection.setInstanceFollowRedirects(false); + connection.setUseCaches(false); + connection.setRequestProperty("Cache-Control", "no-cache"); connection.setConnectTimeout(10000); connection.setReadTimeout(30000); connection.setRequestProperty("Accept-Encoding", "identity"); diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceManifest.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceManifest.java index bfa4446..d846a61 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceManifest.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceManifest.java @@ -31,6 +31,8 @@ final class HmiWorkplaceManifest { HttpURLConnection connection=(HttpURLConnection)url.openConnection(); connection.setConnectTimeout(8000);connection.setReadTimeout(20000); connection.setInstanceFollowRedirects(false); + connection.setUseCaches(false); + connection.setRequestProperty("Cache-Control","no-cache"); connection.setRequestProperty("Accept","application/x-java-jnlp-file, application/xml, text/xml"); byte[] bytes; try { @@ -44,12 +46,6 @@ final class HmiWorkplaceManifest { } finally {connection.disconnect();} return parse(bytes, clusterNodes); } - static HmiWorkplaceManifest bundled(String clusterNodes) throws Exception { - try (InputStream in=HmiWorkplaceManifest.class.getResourceAsStream("/hmi/Workplace.jnlp")) { - if(in==null) throw new IOException("Bundled Workplace manifest missing"); - return parse(in.readAllBytes(), clusterNodes); - } - } static HmiWorkplaceManifest parse(byte[] bytes, String clusterNodes) throws Exception { if(bytes.length>MAX_BYTES) throw new IOException("JNLP too large"); DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance(); diff --git a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceProxyResource.java b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceProxyResource.java index bdbcc29..a52840e 100644 --- a/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceProxyResource.java +++ b/backend/src/main/java/com/workbenchclassic/hmi/HmiWorkplaceProxyResource.java @@ -49,19 +49,15 @@ public class HmiWorkplaceProxyResource { static void invalidateManifestCache() { synchronized(MANIFEST_LOCK) { cachedManifest=null;manifestKey="";manifestLoaded=0; HmiWorkplaceJarCache.invalidateForNewManifest(); } } - private boolean bundled() { - return "bundled".equals(System.getProperty("hmi.workplace.source", "bundled")); - } - private HmiWorkplaceManifest manifestData(String origin,String file) throws Exception { - if (bundled()) { - if (!"Workplace.jnlp".equals(file)) throw new IOException("Bundled mode requires Workplace.jnlp; use hmi.workplace.source=remote for other manifests"); - return HmiWorkplaceManifest.bundled(origin + "/mes"); - } + private HmiWorkplaceManifest manifestData(String origin,String file,boolean fresh) throws Exception { String key=origin+UPSTREAM_PATH+file; synchronized(MANIFEST_LOCK) { - if(cachedManifest!=null && key.equals(manifestKey) + if(!fresh && cachedManifest!=null && key.equals(manifestKey) && System.currentTimeMillis()-manifestLoaded{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 Le={},pi=[],Lt=()=>{},$r=()=>!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,Ae=(t,e)=>xl.call(t,e),de=Array.isArray,ii=t=>ki(t)==="[object Map]",Jt=t=>ki(t)==="[object Set]",Zn=t=>ki(t)==="[object Date]",me=t=>typeof t=="function",Be=t=>typeof t=="string",St=t=>typeof t=="symbol",Pe=t=>t!==null&&typeof t=="object",zr=t=>(Pe(t)||me(t))&&me(t.then)&&me(t.catch),Hr=Object.prototype.toString,ki=t=>Hr.call(t),Pl=t=>ki(t).slice(8,-1),Wr=t=>ki(t)==="[object Object]",Tn=t=>Be(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 er;const Ds=()=>er||(er=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function yt(t){if(de(t)){const e={};for(let i=0;ii.startsWith("/*")?"":i).split(Ul).forEach(i=>{if(i){const s=i.split(Fl);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function xe(t){let e="";if(Be(t))e=t;else if(de(t))for(let i=0;iYt(i,e))}function sr(t){return Object.getPrototypeOf(t)===null&&t[Symbol.toPrimitive]==null&&typeof t.toString!="function"&&typeof t.valueOf!="function"?ki(t):String(t)}const Gr=t=>!!(t&&t.__v_isRef===!0),E=t=>Be(t)?t:t==null?"":de(t)||Pe(t)&&(t.toString===Hr||!me(t.toString))?Gr(t)?E(t.value):JSON.stringify(t,jr,2):String(t),jr=(t,e)=>Gr(e)?jr(t,e.value):ii(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[s,n],r)=>(i[Gs(s,r)+" =>"]=n,i),{})}:Jt(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>Gs(i))}:St(e)?Gs(e):Pe(e)&&!de(e)&&!Wr(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(Fi){let e=Fi;for(Fi=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 Xr(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Qr(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&&(Zr(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Zr(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=De,s=Et;De=t,Et=!0;try{Xr(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{De=i,Et=s,Qr(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 eo=[];function Dt(){eo.push(Et),Et=!1}function Ut(){const t=eo.pop();Et=t===void 0?!0:t}function nr(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=De;De=void 0;try{e()}finally{De=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(!De||!Et||De===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==De)i=this.activeLink=new Jl(De,this),De.deps?(i.prevDep=De.depsTail,De.depsTail.nextDep=i,De.depsTail=i):De.deps=De.depsTail=i,to(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=De.depsTail,i.nextDep=void 0,De.depsTail.nextDep=i,De.depsTail=i,De.deps===i&&(De.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 to(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)to(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&&De){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=de(t),c=u&&Tn(i);if(u&&i==="length"){const d=Number(s);o.forEach((h,v)=>{(v==="length"||v===Gi||!St(v)&&v>=d)&&l(h)})}else switch((i!==void 0||o.has(void 0))&&l(o.get(i)),c&&l(o.get(Gi)),e){case"add":u?c&&l(o.get("length")):(l(o.get(gi)),ii(t)&&l(o.get(an)));break;case"delete":u||(l(o.get(gi)),ii(t)&&l(o.get(an)));break;case"set":ii(t)&&l(o.get(gi));break}}On()}function yi(t){const e=Te(t);return e===t||(tt(e,"iterate",Gi),pt(t))?e:Ft(t)?si(t)?e.map(i=>ri(mt(i))):e.map(ri):e.map(mt)}function Us(t){return tt(t=Te(t),"iterate",Gi),t}function Mt(t,e){return Ft(t)?ri(si(t)?mt(e):e):mt(e)}const Yl={__proto__:null,[Symbol.iterator](){return Js(this,Symbol.iterator,t=>Mt(this,t))},concat(...t){return yi(this).concat(...t.map(e=>de(e)?yi(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 yi(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 or(this,"reduce",t,e)},reduceRight(t,...e){return or(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 yi(this).toReversed()},toSorted(t){return yi(this).toSorted(t)},toSpliced(...t){return yi(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=()=>rr(r.next(),i),n!==io[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=()=>rr(r._next(),i)}return r}function rr(t,e){return t.done||(t.value=e(t.value)),t}const io=Array.prototype;function zt(t,e,i,s,n,r){const o=Us(t),l=o!==t&&!pt(t),u=o[e];if(u!==io[e]){const h=u.apply(t,r);return l?mt(h):h}let c=i;o!==t&&(l?c=function(h,v){return i.call(this,Mt(t,h),v,t)}:i.length>2&&(c=function(h,v){return i.call(this,h,v,t)}));const d=u.call(o,c,s);return l&&n?n(d):d}function or(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(c,d,h){return l&&(l=!1,c=Mt(t,c)),i.call(this,c,Mt(t,d),h,t)}):i.length>3&&(o=function(c,d,h){return i.call(this,c,d,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"),so=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 no{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:ao:r?lo:oo).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const o=de(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)?so.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 ro extends no{constructor(e=!1){super(!1,e)}set(e,i,s,n){let r=e[i];const o=de(e)&&Tn(i);if(!this._isShallow){const c=Ft(r);if(!pt(s)&&!Ft(s)&&(r=Te(r),s=Te(s)),!o&&st(r)&&!st(s))return c||(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=ii(r),l=t==="entries"||t===Symbol.iterator&&o,u=t==="keys"&&o,c=n[t](...s),d=i?un:e?ri:mt;return!e&&tt(r,"iterate",u?an:gi),Ke(Object.create(c),{next(){const{value:h,done:v}=c.next();return v?{value:h,done:v}:{value:l?[d(h[0]),d(h[1])]:d(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),c=e?un:t?ri:mt;if(u.call(o,n))return c(r.get(n));if(u.call(o,l))return c(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),c=e?un:t?ri:mt;return!t&&tt(u,"iterate",gi),l.forEach((d,h)=>n.call(r,c(d),c(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)&&!Ft(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)&&!Ft(r)&&(r=Te(r));const o=Te(this),{has:l,get:u}=os(o);let c=l.call(o,n);c||(n=Te(n),c=l.call(o,n));const d=u.call(o,n);return o.set(n,r),c?Pt(r,d)&&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 c=r.delete(n);return u&&Vt(r,"delete",n,void 0),c},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(Ae(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 oo=new WeakMap,lo=new WeakMap,ao=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 Ft(t)?t:Dn(t,!1,Zl,na,oo)}function ua(t){return Dn(t,!1,ta,ra,lo)}function cn(t){return Dn(t,!0,ea,oa,ao)}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 si(t){return Ft(t)?si(t.__v_raw):!!(t&&t.__v_isReactive)}function Ft(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!Ae(t,"__v_skip")&&Object.isExtensible(t)&&Vr(t,"__v_skip",!0),t}const mt=t=>Pe(t)?Ln(t):t,ri=t=>Pe(t)?cn(t):t;function st(t){return t?t.__v_isRef===!0:!1}function A(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)||Ft(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 uo(t){return si(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)&&De!==this)return qr(this,!0),!0}get value(){const e=this.dep.track();return Zr(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 me(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=Le){const{immediate:s,deep:n,once:r,scheduler:o,augmentJob:l,call:u}=i,c=L=>n?L:pt(L)||n===!1||n===0?Kt(L,1):Kt(L);let d,h,v,S,k=!1,T=!1;if(st(t)?(h=()=>t.value,k=pt(t)):si(t)?(h=()=>c(t),k=!0):de(t)?(T=!0,k=t.some(L=>si(L)||pt(L)),h=()=>t.map(L=>{if(st(L))return L.value;if(si(L))return c(L);if(me(L))return u?u(L,2):L()})):me(t)?e?h=u?()=>u(t,2):t:h=()=>{if(v){Dt();try{v()}finally{Ut()}}const L=di;di=d;try{return u?u(t,3,[S]):t(S)}finally{di=L}}:h=Lt,e&&n){const L=h,se=n===!0?1/0:n;h=()=>Kt(L(),se)}const I=Gl(),F=()=>{d.stop(),I&&I.active&&Cn(I.effects,d)};if(r&&e){const L=e;e=(...se)=>{try{return L(...se)}finally{F()}}}let D=T?new Array(t.length).fill(as):as;const ne=L=>{if(!(!(d.flags&1)||!d.dirty&&!L))if(e){const se=d.run();if(L||n||k||(T?se.some((j,Q)=>Pt(j,D[Q])):Pt(se,D))){const j=di;Dt();try{v&&v(),di=d;const Q=[se,D===as?void 0:T&&D[0]===as?[]:D,S];D=se,u?u(e,3,Q):e(...Q)}finally{di=j,Ut()}}}else d.run()};return l&&l(ne),d=new Jr(h),d.scheduler=o?()=>o(ne,!1):ne,S=L=>ma(L,!1,d),v=d.onStop=()=>{const L=vs.get(d);if(L){if(u)u(L,4);else for(const se of L)se();vs.delete(d)}},e?s?ne(!0):D=d.run():o?o(ne.bind(null,!0),!0):d.run(),F.pause=d.pause.bind(d),F.resume=d.resume.bind(d),F.stop=F,F}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(de(t))for(let s=0;s{Kt(s,e,i)});else if(Wr(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){Fs(n,e,i)}}function Rt(t,e,i,s){if(me(t)){const n=is(t,e,i,s);return n&&zr(n)&&n.catch(r=>{Fs(r,e,i,void 0,!0)}),n}if(de(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,fo()}}function fo(){bs||(bs=co.then(go))}function wa(t){if(!de(t))Qt&&t.id===-1?Qt.splice(wi+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 po(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,Qt){for(let o=0;ot.id==null?t.flags&2?-1:1/0:t.id;function go(t){try{for(bt=0;bt{s._d&&wr(-1);const r=ws(e),o=jt.length;let l;try{l=t(...n)}finally{for(let u=jt.length;u>o;u--)Wn();ws(r),s._d&&wr(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&&me(e)?e.call(s&&s.proxy):e}}const Sa=Symbol.for("v-scx"),Ra=()=>hs(Sa);function nt(t,e,i){return bo(t,e,i)}function bo(t,e,i=Le){const{immediate:s,deep:n,flush:r,once:o}=i,l=Ke({},i),u=e&&s||!e&&r!=="post";let c;if(Xi){if(r==="sync"){const S=Ra();c=S.__watcherHandles||(S.__watcherHandles=[])}else if(!u){const S=()=>{};return S.stop=Lt,S.resume=Lt,S.pause=Lt,S}}const d=it;l.call=(S,k,T)=>Rt(S,d,k,T);let h=!1;r==="post"?l.scheduler=S=>{S.i=d,Ze(S,d&&d.suspense)}:r!=="sync"&&(h=!0,l.scheduler=(S,k)=>{k?S():Fn(S)}),l.augmentJob=S=>{e&&(S.flags|=4),h&&(S.flags|=2,d&&(S.id=d.uid,S.i=d))};const v=va(t,e,l);return Xi&&(c?c.push(v):u&&v()),v}function Aa(t,e,i){const s=this.proxy,n=Be(t)?t.includes(".")?yo(s,t):()=>s[t]:t.bind(s,s);let r;me(e)?r=e:(r=e.handler,i=e);const o=ss(this),l=bo(n,r.bind(s),i);return o(),l}function yo(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===""),lr=t=>typeof SVGElement<"u"&&t instanceof SVGElement,ar=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,dn=(t,e)=>{const i=t&&t.to;return Be(i)?e?e(i):null:i},Ca={name:"Teleport",__isTeleport:!0,process(t,e,i,s,n,r,o,l,u,c){const{mc:d,pc:h,pbc:v,o:{insert:S,querySelector:k,createText:T,createComment:I,parentNode:F}}=c,D=fi(e.props);let{dynamicChildren:ne}=e;const L=(Q,Z,fe)=>{Q.shapeFlag&16&&d(Q.children,Z,fe,n,r,o,l,u)},se=(Q=e)=>{const Z=fi(Q.props),fe=Q.target=dn(Q.props,k),H=fn(fe,Q,T,S);fe&&(o!=="svg"&&lr(fe)?o="svg":o!=="mathml"&&ar(fe)&&(o="mathml"),n&&n.isCE&&(n.ce._teleportTargets||(n.ce._teleportTargets=new Set)).add(fe),Z||(L(Q,fe,H),Pi(Q,!1)))},j=Q=>{const Z=()=>{if(Xt.get(Q)===Z){if(Xt.delete(Q),fi(Q.props)){const fe=F(Q.el)||i;L(Q,fe,Q.anchor),Pi(Q,!0)}se(Q)}};Xt.set(Q,Z),Ze(Z,r)};if(t==null){const Q=e.el=T(""),Z=e.anchor=T("");if(S(Q,i,s),S(Z,i,s),ka(e.props)||r&&r.pendingBranch){j(e);return}D&&(L(e,i,Z),Pi(e,!0)),se()}else{e.el=t.el;const Q=e.anchor=t.anchor,Z=Xt.get(t);if(Z){Z.flags|=8,Xt.delete(t),j(e);return}e.targetStart=t.targetStart;const fe=e.target=t.target,H=e.targetAnchor=t.targetAnchor,N=fi(t.props),te=N?i:fe,Ce=N?Q:H;if(o==="svg"||lr(fe)?o="svg":(o==="mathml"||ar(fe))&&(o="mathml"),ne?(v(t.dynamicChildren,ne,te,n,r,o,l),Hn(t,e,!0)):u||h(t,e,te,Ce,n,r,o,l,!1),D)N?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):us(e,i,Q,c,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const ue=dn(e.props,k);ue&&(e.target=ue,us(e,ue,null,c,0))}else N&&us(e,fe,H,c,1);Pi(e,D)}},remove(t,e,i,{um:s,o:{remove:n}},r){const{shapeFlag:o,children:l,anchor:u,targetStart:c,targetAnchor:d,target:h,props:v}=t,S=fi(v),k=r||!S,T=Xt.get(t);if(T&&(T.flags|=8,Xt.delete(t)),h&&(n(c),n(d)),r&&n(u),!T&&(S||h)&&o&16)for(let I=0;I1){for(const i of t)if(i.type!==vt){e=i;break}}return e}function _o(t){if(!Bn(t))return Bs(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&&me(i.default))return i.default()}}function Bi(t,e){if(t.shapeFlag&6&&t.component){t.transition=e;const i=t.component.subTree;Bi(Bs(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&&Bi(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&&de(t.children)){const i=Oo(t.children,!1);i&&Bi(i,e)}}function hn(t){if(t.component)return hn(t.component.subTree);if(t.type===G){const e=de(t.children)&&Oo(t.children,!1);return e?hn(e):void 0}if(t.type!==vt)return t}function He(t,e){return me(t)?Ke({name:t.name},e,{setup:t}):t}function So(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ur(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(de(t)){t.forEach((T,I)=>$i(T,e&&(de(e)?e[I]:e),i,s,n));return}if(_i(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,c=e&&e.r,d=l.refs===Le?l.refs={}:l.refs,h=l.setupState,v=Te(h),S=h===Le?$r:T=>ur(d,T)?!1:Ae(v,T),k=(T,I)=>!(I&&ur(d,I));if(c!=null&&c!==u){if(cr(e),Be(c))d[c]=null,S(c)&&(h[c]=null);else if(st(c)){const T=e;k(c,T.k)&&(c.value=null),T.k&&(d[T.k]=null)}}if(me(u))is(u,l,12,[o,d]);else{const T=Be(u),I=st(u);if(T||I){const F=()=>{if(t.f){const D=T?S(u)?h[u]:d[u]:k()||!t.k?u.value:d[t.k];if(n)de(D)&&Cn(D,r);else if(de(D))D.includes(r)||D.push(r);else if(T)d[u]=[r],S(u)&&(h[u]=d[u]);else{const ne=[r];k(u,t.k)&&(u.value=ne),t.k&&(d[t.k]=ne)}}else T?(d[u]=o,S(u)&&(h[u]=o)):I&&(k(u,t.k)&&(u.value=o),t.k&&(d[t.k]=o))};if(o){const D=()=>{F(),Es.delete(t)};D.id=-1,Es.set(t,D),Ze(D,i)}else cr(t),F()}}}function cr(t){const e=Es.get(t);e&&(e.flags|=8,Es.delete(t))}Ds().requestIdleCallback;Ds().cancelIdleCallback;const _i=t=>!!t.type.__asyncLoader,Bn=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;)Bn(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 qt=t=>(e,i=it)=>{(!Xi||t==="sp")&&Ji(t,(...s)=>e(...s),i)},Pa=qt("bm"),li=qt("m"),Ia=qt("bu"),La=qt("u"),vi=qt("bum"),Da=qt("um"),Ua=qt("sp"),Fa=qt("rtg"),Ba=qt("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=dr(n[t]||r[t],e)||dr(n.appContext[t],e);return!o&&s?r:o}}function dr(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=de(t);if(o||Be(t)){const l=o&&si(t);let u=!1,c=!1;l&&(u=!pt(t),c=Ft(t),t=Us(t)),n=new Array(t.length);for(let d=0,h=t.length;de(l,u,void 0,r));else{const l=Object.keys(t);n=new Array(l.length);for(let u=0,c=l.length;u0;return g(),Ue(G,null,[gt("slot",c,s)],d?-2:64)}let o=t[e];o&&o._c&&(o._d=!1);const l=jt.length;g();let u;try{const c=o&&ko(o(i)),d=i.key||r||c&&c.key;u=Ue(G,{key:(d&&!St(d)?d:`_${e}`)+(!c&&s?"_fb":"")},c||(s?s():[]),c&&t._===1?64:-2)}catch(c){for(let d=jt.length;d>l;d--)Wn();throw c}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=()=>{Fn(t.update)}),$nextTick:t=>t.n||(t.n=ys.bind(t.proxy)),$watch:t=>Aa.bind(t)}),Qs=(t,e)=>t!==Le&&!t.__isScriptSetup&&Ae(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!==Le&&Ae(n,e))return o[e]=2,n[e];if(Ae(r,e))return o[e]=3,r[e];if(i!==Le&&Ae(i,e))return o[e]=4,i[e];gn&&(o[e]=0)}}const c=zi[e];let d,h;if(c)return e==="$attrs"&&tt(t.attrs,"get",""),c(t);if((d=l.__cssModules)&&(d=d[e]))return d;if(i!==Le&&Ae(i,e))return o[e]=4,i[e];if(h=u.config.globalProperties,Ae(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!==Le&&Ae(s,e)?(s[e]=i,!0):Ae(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!==Le&&l[0]!=="$"&&Ae(t,l)||Qs(e,l)||Ae(r,l)||Ae(s,l)||Ae(zi,l)||Ae(n.config.globalProperties,l)||(u=o.__cssModules)&&u[l])},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Ae(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function fr(t){return de(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&&hr(e.beforeCreate,t,"bc");const{data:n,computed:r,methods:o,watch:l,provide:u,inject:c,created:d,beforeMount:h,mounted:v,beforeUpdate:S,updated:k,activated:T,deactivated:I,beforeDestroy:F,beforeUnmount:D,destroyed:ne,unmounted:L,render:se,renderTracked:j,renderTriggered:Q,errorCaptured:Z,serverPrefetch:fe,expose:H,inheritAttrs:N,components:te,directives:Ce,filters:ue}=e;if(c&&ja(c,s,null),o)for(const _e in o){const ye=o[_e];me(ye)&&(s[_e]=ye.bind(i))}if(n){const _e=n.call(i,i);Pe(_e)&&(t.data=Ln(_e))}if(gn=!0,r)for(const _e in r){const ye=r[_e],Ve=me(ye)?ye.bind(i,i):me(ye.get)?ye.get.bind(i,i):Lt,qe=!me(ye)&&me(ye.set)?ye.set.bind(i):Lt,ee=ie({get:Ve,set:qe});Object.defineProperty(s,_e,{enumerable:!0,configurable:!0,get:()=>ee.value,set:K=>ee.value=K})}if(l)for(const _e in l)Co(l[_e],s,i,_e);if(u){const _e=me(u)?u.call(i):u;Reflect.ownKeys(_e).forEach(ye=>{_a(ye,_e[ye])})}d&&hr(d,t,"c");function q(_e,ye){de(ye)?ye.forEach(Ve=>_e(Ve.bind(i))):ye&&_e(ye.bind(i))}if(q(Pa,h),q(li,v),q(Ia,S),q(La,k),q(Ma,T),q(Oa,I),q($a,Z),q(Ba,j),q(Fa,Q),q(vi,D),q(Da,L),q(Ua,fe),de(H))if(H.length){const _e=t.exposed||(t.exposed={});H.forEach(ye=>{Object.defineProperty(_e,ye,{get:()=>i[ye],set:Ve=>i[ye]=Ve,enumerable:!0})})}else t.exposed||(t.exposed={});se&&t.render===Lt&&(t.render=se),N!=null&&(t.inheritAttrs=N),te&&(t.components=te),Ce&&(t.directives=Ce),fe&&So(t)}function ja(t,e,i=Lt){de(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 hr(t,e,i){Rt(de(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,i)}function Co(t,e,i,s){let n=s.includes(".")?yo(i,s):()=>i[s];if(Be(t)){const r=e[t];me(r)&&nt(n,r)}else if(me(t))nt(n,t.bind(i));else if(Pe(t))if(de(t))t.forEach(r=>Co(r,e,i,s));else{const r=me(t.handler)?t.handler.bind(i):e[t.handler];me(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(c=>_s(u,c,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:pr,props:gr,emits:gr,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:pr,inject:Ya};function pr(t,e){return e?t?function(){return Ke(me(t)?t.call(this,this):t,me(e)?e.call(this,this):e)}:e:t}function Ya(t,e){return Ii(mn(t),mn(e))}function mn(t){if(de(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||Le;let n=i;const r=e.startsWith("update:"),o=r&&Za(s,e.slice(7));o&&(o.trim&&(n=i.map(d=>Be(d)?d.trim():d)),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 c=s[l+"Once"];if(c){if(!t.emitted)t.emitted={};else if(t.emitted[l])return;t.emitted[l]=!0,Rt(c,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(!me(t)){const u=c=>{const d=Mo(c,e,!0);d&&(l=!0,Ke(o,d))};!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):(de(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$/,""),Ae(t,e[0].toLowerCase()+e.slice(1))||Ae(t,mi(e))||Ae(t,e))}function mr(t){const{type:e,vnode:i,proxy:s,withProxy:n,propsOptions:[r],slots:o,attrs:l,emit:u,render:c,renderCache:d,props:h,data:v,setupState:S,ctx:k,inheritAttrs:T}=t,I=ws(t);let F,D;try{if(i.shapeFlag&4){const L=n||s,se=L;F=xt(c.call(se,L,d,h,S,v,k)),D=l}else{const L=e;F=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,Fs(L,t,1),F=gt(vt)}let ne=F;if(D&&T!==!1){const L=Object.keys(D),{shapeFlag:se}=ne;L.length&&se&7&&(r&&L.some(Ps)&&(D=su(D,r)),ne=Ri(ne,D,!1,!0))}if(i.dirs&&(ne=Ri(ne,null,!1,!0),ne.dirs=ne.dirs?ne.dirs.concat(i.dirs):i.dirs),i.transition){const L=Bs(ne.type)&&_o(ne)||ne;Bi(L,i.transition)}return F=ne,ws(I),F}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,c=r.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&u>=0){if(u&1024)return!0;if(u&16)return s?vr(s,o,c):!!o;if(u&8){const d=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 c=!1;if((s||o>0)&&!(o&16)){if(o&8){const d=t.vnode.dynamicProps;for(let h=0;h{u=!0;const[v,S]=Uo(h,e,!0);Ke(o,v),S&&l.push(...S)};!i&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}if(!r&&!u)return Pe(t)&&s.set(t,pi),pi;if(de(r))for(let d=0;dt==="_"||t==="_ctx"||t==="$stable",zn=t=>de(t)?t.map(xt):[xt(t)],uu=(t,e,i)=>{if(e._n)return e;const s=vo((...n)=>zn(e(...n)),i);return s._c=!1,s},Fo=(t,e,i)=>{const s=t._ctx;for(const n in t){if($n(n))continue;const r=t[n];if(me(r))e[n]=uu(n,r,s);else if(r!=null){const o=zn(r);e[n]=()=>o}}},Bo=(t,e)=>{const i=zn(e);t.slots.default=()=>i},$o=(t,e,i)=>{for(const s in e)(i||!$n(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&&Vr(s,"_",n,!0)):Fo(e,s)}else e&&Bo(t,e)},du=(t,e,i)=>{const{vnode:s,slots:n}=t;let r=!0,o=Le;if(s.shapeFlag&32){const l=e._;l?i&&l===1?r=!1:$o(n,e,i):(r=!e.$stable,Fo(e,n)),o=e}else e&&(Bo(t,e),o={default:1});if(r)for(const l in n)!$n(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:c,setElementText:d,parentNode:h,nextSibling:v,setScopeId:S=Lt,insertStaticContent:k}=t,T=(p,y,O,B=null,P=null,U=null,V=void 0,W=null,C=!!y.dynamicChildren)=>{if(p===y)return;p&&!Oi(p,y)&&(B=Ge(p),K(p,P,U,!0),p=null),y.patchFlag===-2&&(C=!1,y.dynamicChildren=null),y.dynamicChildren&&p&&p.dynamicChildren&&p.dynamicChildren.hasOnce&&(y.dynamicChildren===pi&&(y.dynamicChildren=[]),y.dynamicChildren.hasOnce=!0);const{type:b,ref:R,shapeFlag:x}=y;switch(b){case zs:I(p,y,O,B);break;case vt:F(p,y,O,B);break;case ps:p==null&&D(y,O,B,V);break;case G:te(p,y,O,B,P,U,V,W,C);break;default:x&1?se(p,y,O,B,P,U,V,W,C):x&6?Ce(p,y,O,B,P,U,V,W,C):(x&64||x&128)&&b.process(p,y,O,B,P,U,V,W,C,Xe)}R!=null&&P?$i(R,p&&p.ref,U,y||p,!y):R==null&&p&&p.ref!=null&&$i(p.ref,null,U,p,!0)},I=(p,y,O,B)=>{if(p==null)s(y.el=l(y.children),O,B);else{const P=y.el=p.el;y.children!==p.children&&c(P,y.children)}},F=(p,y,O,B)=>{p==null?s(y.el=u(y.children||""),O,B):y.el=p.el},D=(p,y,O,B)=>{[p.el,p.anchor]=k(p.children,y,O,B,p.el,p.anchor)},ne=({el:p,anchor:y},O,B)=>{let P;for(;p&&p!==y;)P=v(p),s(p,O,B),p=P;s(y,O,B)},L=({el:p,anchor:y})=>{let O;for(;p&&p!==y;)O=v(p),n(p),p=O;n(y)},se=(p,y,O,B,P,U,V,W,C)=>{if(y.type==="svg"?V="svg":y.type==="math"&&(V="mathml"),p==null)j(y,O,B,P,U,V,W,C);else{const b=p.el&&p.el._isVueCE?p.el:null;try{b&&b._beginPatch(),fe(p,y,P,U,V,W,C)}finally{b&&b._endPatch()}}},j=(p,y,O,B,P,U,V,W)=>{let C,b;const{props:R,shapeFlag:x,transition:J,dirs:he}=p;if(C=p.el=o(p.type,U,R&&R.is,R),x&8?d(C,p.children):x&16&&Z(p.children,C,null,B,P,Zs(p,U),V,W),he&&ui(p,null,B,"created"),Q(C,p,p.scopeId,V,B),R){for(const pe in R)pe!=="value"&&!Di(pe)&&r(C,pe,null,R[pe],U,B);"value"in R&&r(C,"value",null,R.value,U),(b=R.onVnodeBeforeMount)&&Nt(b,B,p)}he&&ui(p,null,B,"beforeMount");const we=pu(P,J);we?J.beforeEnter(C):J&&!J.persisted&&(C[mu]=!0),s(C,y,O),((b=R&&R.onVnodeMounted)||we||he)&&Ze(()=>{b&&Nt(b,B,p),we&&J.enter(C),he&&ui(p,null,B,"mounted")},P)},Q=(p,y,O,B,P)=>{if(O&&S(p,O),B)for(let U=0;U{for(let b=C;b{const W=y.el=p.el;let{patchFlag:C,dynamicChildren:b,dirs:R}=y;C|=p.patchFlag&16;const x=p.props||Le,J=y.props||Le;let he;if(O&&ci(O,!1),(he=J.onVnodeBeforeUpdate)&&Nt(he,O,y,p),R&&ui(y,p,O,"beforeUpdate"),O&&ci(O,!0),b&&(!p.dynamicChildren||p.dynamicChildren.length!==b.length)&&(C=0,V=!1,b=null),(x.innerHTML&&J.innerHTML==null||x.textContent&&J.textContent==null)&&d(W,""),b?H(p.dynamicChildren,b,W,O,B,Zs(y,P),U):V||ye(p,y,W,null,O,B,Zs(y,P),U,!1),C>0){if(C&16)N(W,x,J,O,P);else if(C&2&&x.class!==J.class&&r(W,"class",null,J.class,P),C&4&&r(W,"style",x.style,J.style,P),C&8){const we=y.dynamicProps;for(let pe=0;pe{he&&Nt(he,O,y,p),R&&ui(y,p,O,"updated")},B)},H=(p,y,O,B,P,U,V)=>{for(let W=0;W{if(y!==O){if(y!==Le)for(const U in y)!Di(U)&&!(U in O)&&r(p,U,y[U],null,P,B);for(const U in O){if(Di(U))continue;const V=O[U],W=y[U];V!==W&&U!=="value"&&r(p,U,W,V,P,B)}"value"in O&&r(p,"value",y.value,O.value,P)}},te=(p,y,O,B,P,U,V,W,C)=>{const b=y.el=p?p.el:l(""),R=y.anchor=p?p.anchor:l("");let{patchFlag:x,dynamicChildren:J,slotScopeIds:he}=y;he&&(W=W?W.concat(he):he),p==null?(s(b,O,B),s(R,O,B),Z(y.children||[],O,R,P,U,V,W,C)):x>0&&x&64&&J&&p.dynamicChildren&&p.dynamicChildren.length===J.length?(H(p.dynamicChildren,J,O,P,U,V,W),(y.key!=null||P&&y===P.subTree)&&Hn(p,y,!0)):ye(p,y,O,R,P,U,V,W,C)},Ce=(p,y,O,B,P,U,V,W,C)=>{y.slotScopeIds=W,p==null?y.shapeFlag&512?P.ctx.activate(y,O,B,V,C):ue(y,O,B,P,U,V,C):re(p,y,C)},ue=(p,y,O,B,P,U,V)=>{const W=p.component=Su(p,B,P);if(Bn(p)&&(W.ctx.renderer=Xe),Au(W,!1,V),W.asyncDep){if(P&&P.registerDep(W,q,V,U),!p.el){const C=W.subTree=gt(vt);F(null,C,y,O),p.placeholder=C.el}}else q(W,p,y,O,P,U,V)},re=(p,y,O)=>{const B=y.component=p.component;if(nu(p,y,O))if(B.asyncDep&&!B.asyncResolved){y.el=p.el,y.placeholder=p.placeholder,_e(B,y,O);return}else B.next=y,B.update();else y.el=p.el,y.placeholder=p.placeholder,B.vnode=y},q=(p,y,O,B,P,U,V)=>{const W=()=>{if(p.isMounted){let{next:x,bu:J,u:he,parent:we,vnode:pe}=p;{const Qe=zo(p);if(Qe){x&&(x.el=pe.el,_e(p,x,V)),Qe.asyncDep.then(()=>{const ut=()=>{p.job.flags&8||(P&&P.pendingBranch?Ze(ut,P):b())};ut.flags=48,Ze(ut,P)});return}}let Ee=x,Se;ci(p,!1),x?(x.el=pe.el,_e(p,x,V)):x=pe,J&&fs(J),(Se=x.props&&x.props.onVnodeBeforeUpdate)&&Nt(Se,we,x,pe),ci(p,!0);const ze=mr(p),Fe=p.subTree;p.subTree=ze,T(Fe,ze,h(Fe.el||Hi(Fe)),Ge(Fe),p,P,U),x.el=ze.el,Ee===null&&ru(p,ze.el),he&&Ze(he,P),(Se=x.props&&x.props.onVnodeUpdated)&&Ze(()=>Nt(Se,we,x,pe),P)}else{let x;const{el:J,props:he}=y,{bm:we,m:pe,parent:Ee,root:Se,type:ze}=p,Fe=_i(y);ci(p,!1),we&&fs(we),!Fe&&(x=he&&he.onVnodeBeforeMount)&&Nt(x,Ee,y),ci(p,!0);{Se.ce&&Se.ce._hasShadowRoot()&&Se.ce._injectChildStyle(ze,p.parent?p.parent.type:void 0);const Qe=p.subTree=mr(p);T(null,Qe,O,B,p,P,U),y.el=Qe.el}if(pe&&Ze(pe,P),!Fe&&(x=he&&he.onVnodeMounted)){const Qe=y;Ze(()=>Nt(x,Ee,Qe),P)}(y.shapeFlag&256||Ee&&_i(Ee.vnode)&&Ee.vnode.shapeFlag&256)&&p.a&&Ze(p.a,P),p.isMounted=!0,y=O=B=null}};p.scope.on();const C=p.effect=new Jr(W);p.scope.off();const b=p.update=C.run.bind(C),R=p.job=C.runIfDirty.bind(C);R.i=p,R.id=p.uid,C.scheduler=()=>Fn(R),ci(p,!0),b()},_e=(p,y,O)=>{y.component=p;const B=p.vnode.props;p.vnode=y,p.next=null,lu(p,y.props,B,O),du(p,y.children,O),Dt(),ho(p),Ut()},ye=(p,y,O,B,P,U,V,W,C=!1)=>{const b=p&&p.children,R=p?p.shapeFlag:0,x=y.children,{patchFlag:J,shapeFlag:he}=y;if(J>0){if(J&128){qe(b,x,O,B,P,U,V,W,C);return}else if(J&256){Ve(b,x,O,B,P,U,V,W,C);return}}he&8?(R&16&&z(b,P,U),x!==b&&d(O,x)):R&16?he&16?qe(b,x,O,B,P,U,V,W,C):z(b,P,U,!0):(R&8&&d(O,""),he&16&&Z(x,O,B,P,U,V,W,C))},Ve=(p,y,O,B,P,U,V,W,C)=>{p=p||pi,y=y||pi;const b=p.length,R=y.length,x=Math.min(b,R);let J;for(J=0;JR?z(p,P,U,!0,!1,x):Z(y,O,B,P,U,V,W,C,x)},qe=(p,y,O,B,P,U,V,W,C)=>{let b=0;const R=y.length;let x=p.length-1,J=R-1;for(;b<=x&&b<=J;){const he=p[b],we=y[b]=C?Wt(y[b]):xt(y[b]);if(Oi(he,we))T(he,we,O,null,P,U,V,W,C);else break;b++}for(;b<=x&&b<=J;){const he=p[x],we=y[J]=C?Wt(y[J]):xt(y[J]);if(Oi(he,we))T(he,we,O,null,P,U,V,W,C);else break;x--,J--}if(b>x){if(b<=J){const he=J+1,we=heJ)for(;b<=x;)K(p[b],P,U,!0),b++;else{const he=b,we=b,pe=new Map;for(b=we;b<=J;b++){const Re=y[b]=C?Wt(y[b]):xt(y[b]);Re.key!=null&&pe.set(Re.key,b)}let Ee,Se=0;const ze=J-we+1;let Fe=!1,Qe=0;const ut=new Array(ze);for(b=0;b=ze){K(Re,P,U,!0);continue}let ve;if(Re.key!=null)ve=pe.get(Re.key);else for(Ee=we;Ee<=J;Ee++)if(ut[Ee-we]===0&&Oi(Re,y[Ee])){ve=Ee;break}ve===void 0?K(Re,P,U,!0):(ut[ve-we]=b+1,ve>=Qe?Qe=ve:Fe=!0,T(Re,y[ve],O,null,P,U,V,W,C),Se++)}const ai=Fe?gu(ut):pi;for(Ee=ai.length-1,b=ze-1;b>=0;b--){const Re=we+b,ve=y[Re],kt=y[Re+1],Ct=Re+1{const{el:U,type:V,transition:W,children:C,shapeFlag:b}=p;if(b&6){ee(p.component.subTree,y,O,B);return}if(b&128){p.suspense.move(y,O,B);return}if(b&64){V.move(p,y,O,Xe);return}if(V===G){s(U,y,O);for(let x=0;xW.enter(U),P));else{const{leave:x,delayLeave:J,afterLeave:he}=W,we=()=>{p.ctx.isUnmounted?n(U):s(U,y,O)},pe=()=>{const Ee=U._isLeaving||!!U[Xs];U._isLeaving&&U[Xs](!0),W.persisted&&!Ee?we():x(U,()=>{we(),he&&he()})};J?J(U,we,pe):pe()}else s(U,y,O)},K=(p,y,O,B=!1,P=!1)=>{const{type:U,props:V,ref:W,children:C,dynamicChildren:b,shapeFlag:R,patchFlag:x,dirs:J,cacheIndex:he,memo:we}=p;if((x===-2||b&&b.hasOnce)&&(P=!1),W!=null&&(Dt(),$i(W,null,O,p,!0),Ut()),he!=null&&(!p.ctx||p.ctx===y)&&(y.renderCache[he]=void 0),R&256&&y.ctx.deactivate(p))return;const pe=R&1&&J,Ee=!_i(p);let Se;if(Ee&&(Se=V&&V.onVnodeBeforeUnmount)&&Nt(Se,y,p),R&6)Me(p.component,O,B);else{if(R&128){p.suspense.unmount(O,B);return}pe&&ui(p,null,y,"beforeUnmount"),R&64?p.type.remove(p,y,O,Xe,B):b&&!b.hasOnce&&(U!==G||x>0&&x&64)?z(b,y,O,!1,!0):(U===G&&x&384||!P&&R&16)&&z(C,y,O),B&&oe(p)}const ze=we!=null&&he==null;(Ee&&(Se=V&&V.onVnodeUnmounted)||pe||ze)&&Ze(()=>{Se&&Nt(Se,y,p),pe&&ui(p,null,y,"unmounted"),ze&&(p.el=null)},O)},oe=p=>{const{type:y,el:O,anchor:B,transition:P}=p,U=y===G;if(U&&!P){$e(O,B);return}if(y===ps){L(p),P&&!P.persisted&&P.afterLeave&&P.afterLeave();return}const V=U?hn(p):p,W=()=>{U?h(O)&&$e(O,B):n(O),P&&!P.persisted&&P.afterLeave&&P.afterLeave()};if(V&&V.shapeFlag&1&&P&&!P.persisted){const{leave:C,delayLeave:b}=P,R=V.el,x=()=>C(R,W);b?b(R,W,x):x()}else W()},$e=(p,y)=>{let O;for(;p!==y;)O=v(p),n(p),p=O;n(y)},Me=(p,y,O)=>{const{bum:B,scope:P,job:U,subTree:V,um:W,m:C,a:b}=p;yr(C),yr(b),B&&fs(B),P.stop(),U?(U.flags|=8,K(V,p,y,O)):V&&(V.transition=p.vnode.transition,K(V,p,y,O)),W&&Ze(W,y);const R=()=>{p.isUnmounted=!0};R.flags=16,Ze(R,y)},z=(p,y,O,B=!1,P=!1,U=0)=>{for(let V=U;V{if(p.shapeFlag&6)return Ge(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=v(p.anchor||p.el),O=y&&y[wo];return O?v(O):y},Ie=(p,y,O)=>{const B=p&&y._vnode?void 0:p&&p.component?p.component.uid:_u();Ea(()=>{p==null?y._vnode&&K(y._vnode,null,null,!0):T(y._vnode||null,p,y,null,null,null,O),y._vnode=p},B)},Xe={p:T,um:K,m:ee,r:oe,mt:ue,mc:Z,pc:ye,pbc:H,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 Hn(t,e,i=!1){const s=t.children,n=e.children;if(de(s)&&de(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 yr(t){if(t)for(let e=0;et.__isSuspense,mu=Symbol("_deferredEnter");function vu(t,e){e&&e.pendingBranch?de(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 g(t=!1){jt.push(ft=t?null:[])}function Wn(){jt.pop(),ft=jt[jt.length-1]||null}let Yi=1;function wr(t,e=!1){Yi+=t,t<0&&ft&&e&&(ft.hasOnce=!0)}function Wo(t){return t.dynamicChildren=Yi>0?ft||pi:null,Wn(),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 Ue(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?Be(t)||st(t)||me(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:mo,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|=Be(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=Ri(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&&!Be(l)&&(e.class=xe(l)),Pe(u)&&(Un(u)&&!de(u)&&(u=Ke({},u)),e.style=yt(u))}const o=Be(t)?1:Ho(t)?128:Bs(t)?64:Pe(t)?4:me(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 Ri(t,e,i=!1,s=!1){const{props:n,ref:r,patchFlag:o,children:l,transition:u}=t,c=e?wu(n||{},e):n,d={__v_isVNode:!0,__v_skip:!0,type:t.type,props:c,key:c&&Vo(c),ref:e&&e.ref?i&&r?de(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&&Ri(t.ssContent),ssFallback:t.ssFallback&&Ri(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce,cacheIndex:t.cacheIndex};return u&&s&&Bi(d,u.clone(d)),d}function X(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 $(t="",e=!1){return e?(g(),Ue(vt,null,t)):gt(vt,null,t)}function xt(t){return t==null||typeof t=="boolean"?gt(vt):de(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:Ri(t)}function Ss(t,e){let i=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(de(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(me(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=[X(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)}},Er=()=>{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=zr(o);if(Ut(),r(),(l||t.sp)&&!_i(t)&&So(t),l){if(o.then(Er,Er),e)return o.then(u=>{qi(!0);try{_r(t,u,e)}finally{qi(!1)}}).catch(u=>{Fs(u,t,0,void 0,!0),t.ssrRender=(c,d)=>d("")});t.asyncDep=o}else _r(t,o)}else Jo(t)}function _r(t,e,i){me(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Pe(e)&&(t.setupState=uo(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(uo(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 me(t)?t.displayName||t.name:t.name||e&&t.__name}function Mu(t){return me(t)&&"__vccOpts"in t}const ie=(t,e)=>ga(t,e,Xi),Ou="3.5.46";let bn;const Sr=typeof window<"u"&&window.trustedTypes;if(Sr)try{bn=Sr.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,Rr=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{Rr.innerHTML=qo(s==="svg"?`${t}`:s==="mathml"?`${t}`:t);const l=Rr.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 Fu=Symbol(""),Bu=/(?:^|;)\s*display\s*:/;function $u(t,e,i){const s=t.style,n=Be(i);let r=!1;if(i&&!n){if(e)if(Be(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,!Be(e)&&e?e[o]:void 0,l)||Li(s,o,l):Li(s,o,"")}}else if(n){if(e!==i){const o=s[Fu];o&&(i+=";"+o),s.cssText=i,r=Bu.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(de(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 Ar=["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(de(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))?(Tr(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Cr(t,e,s,o,r,e!=="value")):t._isVueCE&&(Zu(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!Be(s)))?Tr(t,at(e),s,r,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Cr(t,e,s,o))};function Qu(t,e,i,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Mr(e)&&me(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 Mr(e)&&Be(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 Ai=t=>{const e=t.props["onUpdate:modelValue"]||!1;return de(e)?i=>fs(e,i):e};function ec(t){t.target.composing=!0}function Or(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 ke={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]=Ai(n);const r=s||n.props&&n.props.type==="number";Zt(t,e?"change":"input",o=>{o.target.composing||t[It](sn(t.value,i,r))}),(i||r)&&Zt(t,"change",()=>{t.value=sn(t.value,i,r)}),e||(Zt(t,"compositionstart",ec),Zt(t,"compositionend",Or),Zt(t,"change",Or))},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]=Ai(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 c=t.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===t&&t.type!=="range"&&(s&&e===i||n&&t.value.trim()===u)||(t.value=u)}},ei={deep:!0,created(t,e,i){t[It]=Ai(i),Zt(t,"change",()=>{const s=t._modelValue,n=Qi(t),r=t.checked,o=t[It];if(de(s)){const l=Nn(s,n),u=l!==-1;if(r&&!u)o(s.concat(n));else if(!r&&u){const c=[...s];c.splice(l,1),o(c)}}else if(Jt(s)){const l=new Set(s);r?l.add(n):l.delete(n),o(l)}else o(Qo(t,r))})},mounted:xr,beforeUpdate(t,e,i){t[It]=Ai(i),xr(t,e,i)}};function xr(t,{value:e,oldValue:i},s){t._modelValue=e;let n;if(de(e))n=Nn(e,s.props.value)>-1;else if(Jt(e))n=e.has(s.props.value);else{if(e===i)return;n=Yt(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,Zt(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?Jt(t._modelValue)?new Set(n):n:n[0],l=t._pendingValue=[r,r?de(o)?n.slice():n:o];try{t[It](o)}finally{ys(()=>{t._pendingValue===l&&(t._pendingValue=void 0)})}}),t[It]=Ai(s)},mounted(t,{value:e,modifiers:{number:i}}){Pr(t,e,i)},beforeUpdate(t,{value:e},i){t._modelValue=e,t[It]=Ai(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]))&&Pr(t,e,i)}};function tc(t,e,i){if(!i||de(t))return Yt(t,e);if(Jt(t)){if(t.size!==e.length)return!1;for(const s of e)if(!t.has(s))return!1;return!0}return!1}function Pr(t,e,i=!1){const s=t.multiple,n=de(e);if(!(s&&!n&&!Jt(e))){for(let r=0,o=t.options.length;rString(d)===String(u)):l.selected=Nn(e,u)>-1}else l.selected=e.has(u)||i&&typeof u=="string"&&e.has(ts(u));else if(Yt(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;!me(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 Be(t)?document.querySelector(t):t}class M{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 M.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"&&M.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&&(M.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:M.getScrollElement(e.parentElement)}static updateScrollResize(e,i,s){const n=M.getScrollElement(i),r=n.clientHeight,o=n===M.getScrollElement()?0:n.getBoundingClientRect().top,l=e.clientY-o,u=lr-s;u?n.scrollBy({behavior:"smooth",top:l-s}):c&&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=M.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]=M.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=M.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");M.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 c;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 d={...i,y:s.y+s.h,...l};c=this._loading&&M.samePos(e,d)?!0:this.moveNode(e,d),(s.locked||this._loading)&&c?M.copyPos(i,e):!s.locked&&c&&n.pack&&(this._packNodes(),i.y=s.y+s.h,M.copyPos(e,i)),o=o||c}else c=this.moveNode(s,{...s,y:i.y+i.h,skip:e,...l});if(!c)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&&M.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&&M.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 c=u._rect;let d=Number.MAX_VALUE,h=Number.MAX_VALUE;n.yc.y+c.h&&(d=(c.y+c.h-r.y)/c.h),n.xc.x+c.w&&(h=(c.x+c.w-r.x)/c.w);const v=Math.min(h,d);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=M.isTouching(e,i)))return s();if(n!==!1){if(e.w===i.w&&e.x===i.x&&(n||(n=M.isTouching(e,i)))){if(i.y{let c;o.locked||(o.autoPosition=!0,e==="list"&&l&&(c=u[l-1])),this.addNode(o,!1,c)}),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=M.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 M.defaults(e,n),e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,M.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||M.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),M.samePos(e,s)||(e._dirty=!0),this}getDirtyNodes(e){return e?this.nodes.filter(i=>i._dirty&&!M.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=M.copyPos({},e),delete e._dirty}),this._hasLocked=this.nodes.some(e=>e.locked),this}restoreInitial(){return this.nodes.forEach(e=>{!e._orig||M.samePos(e,e._orig)||(M.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,c=Math.floor(l/s);if(u+e.w>s)continue;const d={x:u,y:c,w:e.w,h:e.h};i.find(h=>M.isIntercepted(d,h))||((e.x!==u||e.y!==c)&&(e._dirty=!0),e.x=u,e.y=c,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&&(M.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=M.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=M.copyPos({},e,!0);if(M.copyPos(r,i),this.nodeBoundFix(r,n),M.copyPos(i,r),!i.forceCollide&&M.samePos(e,i))return!1;const o=M.copyPos({},e),l=this.collideAll(e,r,i.skip);let u=!0;if(l.length){const c=e._moving&&!i.nested;let d=c?this.directionCollideCoverage(e,i,l):l[0];if(c&&d&&e.grid?.opts?.subGridDynamic&&!e.grid._isTemp){const h=M.areaIntercept(i.rect,d._rect),v=M.area(i.rect),S=M.area(d._rect);h/(v.8&&(d.grid.makeSubGrid(d.el,void 0,e),d=void 0)}d?u=!this._fixCollisions(e,r,d,i):(u=!1,s&&delete i.pack)}return u&&!M.samePos(e,r)&&(e._dirty=!0,M.copyPos(e,r)),i.pack&&this._packNodes()._notify(),!M.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(d=>d._id===l._id),c={...l,...u||{}};M.removeInternalForSave(c,!e),i&&i(l,c),o.push(c)}),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(c=>{const d=o.find(h=>h._id===c._id);d&&(!n&&!c.autoPosition&&(d.x=c.x??d.x,d.y=c.y??d.y),d.w=c.w??d.w,(c.x==null||c.y===void 0)&&(d.autoPosition=!0))})),l.forEach(c=>{const d=o.findIndex(h=>h._id===c._id);if(d!==-1){const h=o[d];if(n){h.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,r),c.autoPosition||(h.x=c.x??h.x,h.y=c.y??h.y,h.w=c.w??h.w,r.push(h)),o.splice(d,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",c=s==="scale"||s==="moveScale";o.forEach(d=>{d.x=i===1?0:u?Math.round(d.x*l):Math.min(d.x,i-1),d.w=i===1||e===1?1:c?Math.round(d.w*l)||1:Math.min(d.w,i),r.push(d)}),o=[]}r=M.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(),M.simulateMouseEvent(t.changedTouches[0],e))}function Zo(t,e){t.cancelable&&t.preventDefault(),M.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=!!ce.dragElement;ks(t,"mouseup"),e||ks(t,"click"),dt.touchHandled=!1}function Ms(t){t.pointerType!=="mouse"&&t.target.releasePointerCapture(t.pointerId)}function Lr(t){ce.dragElement&&t.pointerType!=="mouse"&&Zo(t,"mouseenter")}function Dr(t){ce.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 Vn{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 Vn{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),ce.overResizeElement===this&&delete ce.overResizeElement),this}_mouseOver(e){ce.overResizeElement||ce.dragElement||(ce.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(e){ce.overResizeElement===this&&(delete ce.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=M.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=M.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=e,this._setupHelper(),this._applyChange();const i=M.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=M.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=M.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=M.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 c=this.option.rtl;!c&&i.indexOf("e")>-1?n.width+=r:c&&i.indexOf("w")>-1?n.width-=r:!c&&i.indexOf("w")>-1?(n.width-=r,n.left+=r,l=!0):c&&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 d=this._constrainSize(n.width,n.height,l,u);return Math.round(n.width)!==Math.round(d.width)&&(!c&&i.indexOf("w")>-1?n.left+=n.width-d.width:c&&i.indexOf("e")>-1&&(n.right-=n.width-d.width),n.width=d.width),Math.round(n.height)!==Math.round(d.height)&&(i.indexOf("n")>-1&&(n.top+=n.height-d.height),n.height=d.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,c=r.minHeight/this.rectScale.y||i,d=Math.min(o,Math.max(l,e)),h=Math.min(u,Math.max(c,i));return{width:d,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 Vn{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),c=Math.min(u*.5,this._autoScrollMaxSpeed),d=l>0?c:-c,h=o.scrollTop;if(o.scrollTop+=d,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),!ce.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 ce.dragElement,delete ce.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(),ce.mouseHandled=!0),!0}_callDrag(e){if(!this.dragging)return;const i=M.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),ce.pauseDrag){const s=Number.isInteger(ce.pauseDrag)?ce.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,ce.dragElement=this;const s=this.el.gridstackNode?.grid;s?ce.dropElement=s.el.ddElement.ddDroppable:delete ce.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=M.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(e,this.el,this.helperContainment),this._setupHelperStyle(e);const n=M.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),ce.dropElement?.el===this.el.parentElement&&delete ce.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const i=M.initEvent(e,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(i),this.triggerEvent("dragstop",i),ce.dropElement&&ce.dropElement.drop(e)}delete this.helper,delete this.mouseDownEvent,delete ce.dragElement,delete ce.dropElement,delete ce.mouseHandled,e.preventDefault()}_keyEvent(e){const i=this.el.gridstackNode,s=i?.grid||ce.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(!M.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",M.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=M.cloneNode(this.el)),e.parentElement||M.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=M.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 Vn{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",Lr),this.el.addEventListener("pointerleave",Dr)))}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",Lr),this.el.removeEventListener("pointerleave",Dr)))}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(!ce.dragElement||dt.touchHandled&&e.isTrusted||!this._canDrop(ce.dragElement.el))return;e.preventDefault(),e.stopPropagation(),ce.dragElement._stopScrolling(),ce.dropElement&&ce.dropElement!==this&&ce.dropElement._mouseLeave(e,!0),ce.dropElement=this;const i=M.initEvent(e,{target:this.el,type:"dropover"});this.option.over&&this.option.over(i,this._ui(ce.dragElement)),this.triggerEvent("dropover",i),this.el.classList.add("ui-droppable-over")}_mouseLeave(e,i=!1){if(!ce.dragElement||ce.dropElement!==this)return;e.preventDefault(),e.stopPropagation(),i&&ce.dragElement._stopScrolling();const s=M.initEvent(e,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(s,this._ui(ce.dragElement)),this.triggerEvent("dropout",s),ce.dropElement===this&&(delete ce.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=M.initEvent(e,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(i,this._ui(ce.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 Kn{static init(e){return e.ddElement||(e.ddElement=new Kn(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 c=!l.opts.alwaysShowResizeHandle;r.setupResizable({...l.opts.resizable,handles:u,autoHide:c,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,ce.dragElement?ce.dragElement.el:r.target,ce.dragElement?ce.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=M.getElements(e);return n.length?n.map(o=>o.ddElement||(s?Kn.init(o):null)).filter(o=>o):[]}}const rt=new dc;class le{static init(e={},i=".grid-stack"){if(typeof document>"u")return null;const s=le.getGridElement(i);return s?(s.gridstack||(s.gridstack=new le(s,M.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"||(le.getGridElements(i).forEach(n=>{n.gridstack||(n.gridstack=new le(n,M.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")||le.addRemoveCB)&&(le.addRemoveCB?s=le.addRemoveCB(e,i,!0,!0):s=M.createDiv(["grid-stack",i.class],e)),le.init(i,s)}static registerEngine(e){le.engineClass=e}get placeholder(){if(!this._placeholder){this._placeholder=M.createDiv([this.opts.placeholderClass,ct.itemClass,this.opts.itemClass]);const e=M.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=M.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 c=n.breakpoints;!n.columnWidth&&!c?.length?delete i.columnOpts:(n.columnMax=n.columnMax||12,c?.length>1&&c.sort((d,h)=>(h.w||0)-(d.w||0)))}const r={...M.cloneDeep(ct),column:M.toNumber(e.getAttribute("gs-column"))||ct.column,minRow:s||M.toNumber(e.getAttribute("gs-min-row"))||ct.minRow,maxRow:s||M.toNumber(e.getAttribute("gs-max-row"))||ct.maxRow,staticGrid:M.toBool(e.getAttribute("gs-static"))||ct.staticGrid,sizeToContent:M.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=M.toBool(e.getAttribute("gs-animate"))),i=M.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 c=i.cellHeight;delete i.cellHeight,this.cellHeight(c)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=wt),this._setStaticClass();const u=i.engineClass||le.engineClass||Gt;if(this.engine=new u({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:c=>{c.forEach(d=>{const h=d.el;h&&(d._removeDOM?(h&&h.remove(),delete d._removeDOM):this._writePosAttr(h,d))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const c=i.children;delete i.children,c.length&&this.load(c)}this.setAnimation(),i.subGridDynamic&&!ce.pauseDrag&&(ce.pauseDrag=!0),i.draggable?.pause!==void 0&&(ce.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:le.addRemoveCB?i=le.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 M.defaults(e,n),this.engine.prepareNode(e),this.el.appendChild(i),this.makeWidget(i,e),i}createWidgetDivs(e){const i=M.createDiv(["grid-stack-item",this.opts.itemClass]),s=M.createDiv(["grid-stack-item-content"],i);return M.lazyLoad(e)?e.visibleObservable||(e.visibleObservable=new IntersectionObserver(([n])=>{n.isIntersecting&&(e.visibleObservable?.disconnect(),delete e.visibleObservable,le.renderCB(s,e),e.grid?.prepareDragDrop(e.el))}),window.setTimeout(()=>e.visibleObservable?.observe(i))):le.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=M.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 c=r.el.querySelector(".grid-stack-item-content"),d,h;if(n&&(this._removeDD(r.el),h={...r,x:0,y:0},M.removeInternalForSave(h),delete h.subGridOpts,r.content&&(h.content=r.content,delete r.content),le.addRemoveCB?d=le.addRemoveCB(this.el,h,!0,!1):(d=M.createDiv(["grid-stack-item"]),d.appendChild(c),c=M.createDiv(["grid-stack-item-content"],r.el)),this.prepareDragDrop(r.el)),s){const S=u?i.column:r.w,k=r.h+s.h,T=r.el.style;T.transition="none",this.update(r.el,{w:S,h:k}),setTimeout(()=>T.transition=null)}const v=r.subGrid=le.addGrid(c,i);return s?._moving&&(v._isTemp=!0),u&&(v._autoColumn=!0),n&&v.makeWidget(d,h),s&&(s._moving?window.setTimeout(()=>M.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(()=>M.simulateMouseEvent(e._event,"mouseenter",i.el),0))}save(e=!0,i=!1,s=le.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=M.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,M.removeInternalAndSame(o,ct),o.children=r,o}return r}load(e,i=le.addRemoveCB||!0){e.forEach(d=>{d.w=d.w||d.minW||1,d.h=d.h||d.minH||1}),e=M.sort(e),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;e.forEach(d=>{s=Math.max(s,(d.x||0)+d.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=le.addRemoveCB;typeof i=="function"&&(le.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;M.find(e,h.id)||(le.addRemoveCB&&le.addRemoveCB(this.el,h,!1,!1),o.push(h),this.removeWidget(h.el,!0,!1))}),this.engine._loading=!0;const c=[];return this.engine.nodes=this.engine.nodes.filter(d=>M.find(e,d.id)?(c.push(d),!1):!0),e.forEach(d=>{const h=M.find(c,d.id);if(h){if(M.shouldSizeToContent(h)&&(d.h=h.h),this.engine.nodeBoundFix(d),(d.autoPosition||d.x===void 0||d.y===void 0)&&(d.w=d.w||h.w,d.h=d.h||h.h,this.engine.findEmptyPosition(d)),this.engine.nodes.push(h),M.samePos(h,d)&&this.engine.nodes.length>1&&(this.moveNode(h,{...d,forceCollide:!0}),M.copyPos(d,h)),this.update(h.el,d),d.subGridOpts?.children){const v=h.el.querySelector(".grid-stack");v&&v.gridstack&&v.gridstack.load(d.subGridOpts.children)}}else i&&this.addWidget(d)}),delete this.engine._loading,this.engine.removedNodes=o,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,r?le.addRemoveCB=r:delete le.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=M.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=M.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=le.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?(le.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&&le.addRemoveCB&&le.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&&le.addRemoveCB&&le.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 le.getElements(e).forEach(s=>{const n=s?.gridstackNode;if(!n)return;const r={...M.copyPos({},n),...M.cloneDeep(i)};this.engine.nodeBoundFix(r),delete r.autoPosition;const o=["x","y","w","h"];let l;if(o.some(d=>r[d]!==void 0&&r[d]!==n[d])&&(l={},o.forEach(d=>{l[d]=r[d]!==void 0?r[d]:n[d],delete r[d]})),!l&&(r.minW||r.minH||r.maxW||r.maxH)&&(l={}),r.content!==void 0){const d=s.querySelector(".grid-stack-item-content");d&&d.textContent!==r.content&&(n.content=r.content,le.renderCB(d,r),n.subGrid?.el&&(d.appendChild(n.subGrid.el),n.subGrid._updateContainerHeight())),delete r.content}let u=!1,c=!1;for(const d in r)d[0]!=="_"&&n[d]!==r[d]&&(n[d]=r[d],u=!0,c=c||!this.opts.staticGrid&&(d==="noResize"||d==="noMove"||d==="locked"));if(M.sanitizeMinMax(n),l){const d=l.w!==void 0&&l.w!==n.w;this.moveNode(n,l),d&&n.subGrid?n.subGrid.onResize(this.hasAnimationCSS()?n.w:void 0):this.resizeToContentCheck(d,n),delete n._orig}(l||u)&&this._writeAttr(s,n),c&&this.prepareDragDrop(n.el),le.updateCB&&le.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(le.resizeToContentParent)),!o)return;const l=e.clientHeight-o.clientHeight,u=i.h?i.h*n-l:o.clientHeight;let c;if(i.subGrid){c=i.subGrid.getRow()*i.subGrid.getCellHeight(!0);const v=i.subGrid.el.getBoundingClientRect(),S=e.getBoundingClientRect();c+=v.top-S.top}else{if(i.subGridOpts?.children?.length)return;{const v=o.firstElementChild;if(!v){console.error(`Error: GridStack.resizeToContent() widget id:${i.id} '${le.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=v.getBoundingClientRect().height||u}}if(u===c)return;r+=c-u;let d=Math.ceil(r/n);const h=Number.isInteger(i.sizeToContent)?i.sizeToContent:0;h&&d>h&&(d=h,e.classList.add("size-to-content-max")),i.minH&&di.maxH&&(d=i.maxH),d!==i.h&&(s._ignoreLayoutsNodeChange=!0,s.moveNode(i,{h:d}),delete s._ignoreLayoutsNodeChange)}resizeToContentCBCheck(e){le.resizeToContentCB?le.resizeToContentCB(e):this.resizeToContent(e)}rotate(e,i){return le.getElements(e).forEach(s=>{const n=s.gridstackNode;if(!M.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=M.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=M.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=M.toNumber(e.getAttribute("gs-x")),s.y=M.toNumber(e.getAttribute("gs-y")),s.w=M.toNumber(e.getAttribute("gs-w")),s.h=M.toNumber(e.getAttribute("gs-h")),s.autoPosition=M.toBool(e.getAttribute("gs-auto-position")),s.noResize=M.toBool(e.getAttribute("gs-no-resize")),s.noMove=M.toBool(e.getAttribute("gs-no-move")),s.locked=M.toBool(e.getAttribute("gs-locked"));const n=e.getAttribute("gs-size-to-content");n&&(n==="true"||n==="false"?s.sizeToContent=M.toBool(n):s.sizeToContent=parseInt(n,10)),s.id=e.getAttribute("gs-id"),s.maxW=M.toNumber(e.getAttribute("gs-max-w")),s.minW=M.toNumber(e.getAttribute("gs-min-w")),s.maxH=M.toNumber(e.getAttribute("gs-max-h")),s.minH=M.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)M.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(s=>M.shouldSizeToContent(s))){const s=[...this.engine.nodes];this.batchUpdate(),s.forEach(n=>{M.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=M.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 M.getElement(e)}static getElements(e=".grid-stack-item"){return M.getElements(e)}static getGridElement(e){return le.getElement(e)}static getGridElements(e){return M.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=M.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=M.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&&(ce.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof e=="string"?M.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:(le.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:(le.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&&le._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:c}=o.getBoundingClientRect();const d=this.el.getBoundingClientRect();c-=d.left,u-=d.top;const h={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(l._temporaryRemoved){if(l.x=Math.max(0,Math.round(c/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&&(M.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 d=o.getAttribute("data-gs-widget")||o.getAttribute("gridstacknode");if(d){try{l=JSON.parse(d)}catch{console.error("Gridstack dropover: Bad JSON format: ",d)}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,c=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:c,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=c,l._temporaryRemoved=!0),le._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,c=r!==o;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const d=r._gridstackNodeOrig;if(delete r._gridstackNodeOrig,u&&d?.grid&&d.grid!==this){const v=d.grid;v.engine.removeNodeFromLayoutCache(d),v.engine.removedNodes.push(d),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 M.copyPos(l,this._readAttr(this.placeholder)),M.removePositioningStyles(r),c&&(l.content||l.subGridOpts||le.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"},d&&d.grid?d: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)=>le._itemRemoving(s,!0)).on(e,"dropout",(i,s)=>le._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 c=(v,S)=>{this.triggerEvent(v,v.target),l=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(e,v,S,s,l,u)},d=(v,S)=>{this._dragOrResize(e,v,S,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 S=s.w!==s._orig.w,k=v.target;if(!(!k.gridstackNode||k.gridstackNode.grid!==this)){if(s.el=k,s._isAboutToRemove){const T=e.gridstackNode.grid;T._gsEventHandler[v.type]&&T._gsEventHandler[v.type](v,k),T.engine.nodes.push(s),T.removeWidget(e,!0,!0)}else M.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(S,s))}};rt.draggable(e,{start:c,stop:h,drag:d,rtl:this.opts.rtl}).resizable(e,{start:c,stop:h,resize:d,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=M.getValuesFromTransformedElement(e);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const l=this.placeholder.closest(".grid-stack");this.dragTransform=M.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,c=this.opts.marginLeft,d=this.opts.marginRight,h=this.opts.marginTop,v=this.opts.marginBottom;const S=Math.round(o*.1),k=Math.round(r*.1);if(c=Math.min(c,k),d=Math.min(d,k),h=Math.min(h,S),v=Math.min(v,S),i.type==="drag"){if(n._temporaryRemoved)return;n._prevYPix=s.position.top,this.opts.draggable.scroll!==!1&&ce.dragElement?.updateScrollPosition(this.el);const I=s.position.left+(s.position.left>n._lastUiPosition.left?-d:c),F=s.position.top+(s.position.top>n._lastUiPosition.top?-v:h);l.x=Math.round(I/r),l.y=Math.round(F/o);const D=this._extraDragRow;if(this.engine.collide(n,l)){const ne=this.getRow();let L=Math.max(0,l.y+n.h-ne);this.opts.maxRow&&ne+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-ne)),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||(M.updateScrollResize(i,e,o),l.w=Math.round((s.size.width-c)/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 I=s.position.left+c;l.x=Math.round(I/r)}if(i.hasMovedY){const I=s.position.top+h;l.y=Math.round(I/o)}u=!0}n._event=i,n._lastTried=l;const T={x:s.position.left+c,y:s.position.top+h,w:(s.size?s.size.width:n.w*r)-c-d,h:(s.size?s.size.height:n.h*o)-h-v};if(this.engine.moveNodeCheck(n,{...l,cellWidth:r,cellHeight:o,rect:T,resizing:u})){n._lastUiPosition=s.position,this.engine.cacheRects(r,o,h,d,v,c),delete n._skipDown,u&&n.subGrid&&n.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const I=i.target;n._sidebarOrig||this._writePosAttr(I,n),this.triggerEvent(i,I)}}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&&le._itemRemoving(e,!0),e._gridstackNodeOrig?(e.gridstackNode=e._gridstackNodeOrig,delete e._gridstackNodeOrig):s._isExternal&&this.engine.restoreInitial()}}le.renderCB=(t,e)=>{t&&e?.content&&(t.textContent=e.content)};le.resizeToContentParent=".grid-stack-item-content";le.Utils=M;le.Engine=Gt;le.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 oi=null;function tl(){return oi}async function hc(t,e,i){return oi=await be("/security/login","POST",{username:t,password:e,station:i}),oi}async function pc(){try{await be("/security/logout","POST",{})}finally{oi=null}}async function Ur(){return oi=await be("/security/csrf","GET"),oi}async function be(t,e="GET",i){const s={Accept:"application/json"};i!==void 0&&(s["Content-Type"]="application/json"),e!=="GET"&&e!=="HEAD"&&oi&&(s["X-CSRF-Token"]=oi.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 Gn={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(Gn,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=Gn[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"],Fc=["disabled"],Bc=He({__name:"LegacyTableWidget",props:{widget:{},station:{},demo:{type:Boolean}},setup(t){const e=t,i=ie(()=>vc(e.widget.props.source)?e.widget.props.source:"contacts"),s=ie(()=>String(e.station||e.widget.props.station||"")),n=A(""),r=A([]),o=A(!1),l=A(""),u=A(1);let c=null;const d=ie(()=>Math.max(5,Math.min(100,Number(e.widget.props.limit)||20))),h=ie(()=>{const L=r.value,se=i.value==="station-config"?["code_nr","description","code_wert","changedby","timestamp"]:Wi[i.value].fields.map(Q=>Q.toLowerCase()),j=[...new Set(L.flatMap(Q=>Object.keys(Q)))];return[...se.filter(Q=>j.includes(Q)),...j.filter(Q=>!se.includes(Q))].slice(0,18)}),v=ie(()=>r.value.filter(L=>Object.values(L).some(se=>String(se??"").toLocaleLowerCase("de").includes(n.value.toLocaleLowerCase("de"))))),S=ie(()=>Math.max(1,Math.ceil(v.value.length/d.value))),k=ie(()=>v.value.slice((u.value-1)*d.value,u.value*d.value)),T=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 I(L){return L==null||L===""?"—":typeof L=="object"?JSON.stringify(L):String(L)}async function F(){if(c?.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;c=L,o.value=!0;try{const se=await sl(Wi[i.value].path,s.value,L.signal);r.value=bc(se).map(j=>i.value==="station-config"?{...j,description:mc[String(j.code_nr)]||"—"}:j)}catch(se){L.signal.aborted||(l.value=String(se instanceof Error?se.message:se))}finally{c===L&&(o.value=!1)}}nt([i,s,()=>e.demo],F,{immediate:!0}),nt(n,()=>u.value=1),vi(()=>c?.abort());const D=ie(()=>i.value==="users"?"user":i.value==="contacts"?"contact":i.value==="erp-groups"?"erp":(i.value==="stations","station"));function ne(){try{jn(D.value,s.value)}catch(L){l.value=String(L)}}return(L,se)=>(g(),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),se[4]||(se[4]=X(" 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:F},"↻"),a("button",{type:"button",class:"wb-btn wb-btn-icon",disabled:!r.value.length,title:"CSV exportieren",onClick:se[0]||(se[0]=j=>Je(wc)(v.value,"hmi-"+i.value+".csv"))},"⇩",8,kc)])]),a("div",Cc,[se[5]||(se[5]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":se[1]||(se[1]=j=>n.value=j),"aria-label":"Suche in "+Je(Wi)[i.value].title,placeholder:"Suche in allen Spalten ..."},null,8,Tc),[[ke,n.value]])]),l.value?(g(),m("div",Nc,E(l.value),1)):o.value?(g(),m("div",Mc,"Daten werden geladen …")):$("",!0),o.value?$("",!0):(g(),m("div",Oc,[a("table",xc,[a("thead",null,[a("tr",null,[(g(!0),m(G,null,ge(h.value,j=>(g(),m("th",{key:j},E(T(j)),1))),128))])]),a("tbody",null,[(g(!0),m(G,null,ge(k.value,(j,Q)=>(g(),m("tr",{key:Q},[(g(!0),m(G,null,ge(h.value,Z=>(g(),m("td",{key:Z},[Z==="code_wert"&&["TRUE","FALSE"].includes(String(j[Z]).toUpperCase())?(g(),m("span",{key:0,class:xe(["wb-value-pill",String(j[Z]).toUpperCase()==="TRUE"?"on":"off"])},E(String(j[Z]).toUpperCase()==="TRUE"?"Ein":"Aus"),3)):(g(),m("span",{key:1,class:xe({"wb-mono":Z.includes("nr")||Z.includes("id")})},E(I(j[Z])),3))]))),128))]))),128)),k.value.length===0?(g(),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)])):$("",!0)])])])),a("div",Lc,[a("span",null,"Seite "+E(u.value)+" / "+E(S.value),1),a("div",Dc,[a("button",{class:"wb-btn wb-small",disabled:u.value===1,onClick:se[2]||(se[2]=j=>u.value--)},"‹",8,Uc),a("button",{class:"wb-btn wb-small",disabled:u.value>=S.value,onClick:se[3]||(se[3]=j=>u.value++)},"›",8,Fc),a("button",{class:"wb-btn wb-small",onClick:ne},"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)?(g(),m(G,{key:0},[t.node.children?.length?(g(),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,[(g(!0),m(G,null,ge(t.node.children,l=>(g(),Ue(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)):(g(),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)):$("",!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=A([]),s=A(""),n=A(!1),r=A(""),o=A("");let l=null;const u=ie(()=>String(e.station||e.widget.props.station||""));async function c(){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 S=await sl("/backend/api/getStations",u.value,v.signal);if(!Array.isArray(S))throw Error("Ungültige Fertigungsbaum-Antwort");i.value=S}catch(S){v.signal.aborted||(r.value=String(S instanceof Error?S.message:S))}finally{l===v&&(n.value=!1)}}nt([u,()=>e.demo],c,{immediate:!0}),vi(()=>l?.abort());function d(v){o.value=v,sessionStorage.setItem("selectedStation",v);const S="/backend/Config.html?station="+encodeURIComponent(v),k=window.open(S,"_blank");k?k.opener=null:window.location.assign(S)}function h(){try{jn("station",u.value)}catch(v){r.value=String(v)}}return(v,S)=>(g(),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),S[1]||(S[1]=X(" Fertigungslinien",-1))]),a("div",{class:"wb-inline-actions"},[a("button",{class:"wb-btn wb-btn-icon",onClick:c,title:"Aktualisieren"},"↻"),a("button",{class:"wb-btn wb-small",onClick:h},"Vollansicht ↗")])]),a("div",Yc,[S[2]||(S[2]=a("span",{class:"wb-search-icon"},"⌕",-1)),ae(a("input",{"onUpdate:modelValue":S[0]||(S[0]=k=>s.value=k),placeholder:"Station, Linie oder Gruppe suchen ...","aria-label":"Fertigungsbaum durchsuchen"},null,512),[[ke,s.value]])]),r.value?(g(),m("p",qc,E(r.value),1)):n.value?(g(),m("p",Xc,"Fertigungsbaum wird geladen …")):(g(),m("div",Qc,[(g(!0),m(G,null,ge(i.value,k=>(g(),Ue(Kc,{key:k.id,node:k,filter:s.value,level:0,onSelected:d},null,8,["node","filter"]))),128)),i.value.length?$("",!0):(g(),m("p",Zc,"Keine Stationen gefunden"))])),a("div",ed,[S[3]||(S[3]=a("span",null,"Fertigungsbereiche sind anfangs zugeklappt",-1)),o.value?(g(),m("span",td,"Station "+E(o.value)+" gewählt",1)):$("",!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=ie(()=>yc(e.widget.props.module)?e.widget.props.module:"history"),s=ie(()=>Gn[i.value]),n=A(""),r=A("");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)=>(g(),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"?(g(),m("label",ld,[u[1]||(u[1]=X("Seriennummer ",-1)),ae(a("input",{"onUpdate:modelValue":u[0]||(u[0]=c=>n.value=c),maxlength:120,placeholder:"Optional vormerken …",autocomplete:"off"},null,512),[[ke,n.value]])])):$("",!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?(g(),m("p",cd,E(r.value),1)):$("",!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 ni(t){return/^[A-Za-z0-9_.-]{1,120}$/.test(t)}function ti(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(!ni(t)||!ti(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 c=u?"setup":"merge";l.status==="fulfilled"?n[c]=et(l.value[u?"setupResultValues":"mergePartsResultValues"],u?Rn:Sn):o.push(c+": "+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(!ni(t)||!ti(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(c=>Number(c.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"],Fd={class:"wb-mes-check"},Bd=["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=A(e.station),s=A(""),n=A(!1),r=A(""),o=A(""),l=A("booking"),u=A({}),c=A({}),d=A(null),h=A([]),v=A(""),S=A("none"),k=A(null),T=A(""),I=A("2"),F=A(0),D=A(0),ne=A(!0),L=A(!1),se=ie(()=>rn.map(ee=>({id:ee.id,title:ee.title,count:(u.value[ee.id]||[]).length}))),j=ie(()=>rn.find(ee=>ee.id===l.value)||rn[0]),Q=ie(()=>u.value[l.value]||[]),Z=ie(()=>j.value.keys),fe=ie(()=>!e.demo&&!!rl()&&ni(i.value));nt(()=>e.station,ee=>{i.value=ee,d.value=null,u.value={}}),li(()=>{fe.value&&N();const ee=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ti(ee)&&(s.value=ee)});function H(){r.value="",o.value=""}async function N(){if(fe.value)try{d.value=await ms(i.value)}catch(ee){o.value="Aktiver Auftrag nicht verfügbar: "+String(ee)}}async function te(){if(H(),!fe.value){r.value="Workbench-Anmeldung und Station erforderlich";return}if(!ti(s.value)){r.value="Ungültige Seriennummer";return}n.value=!0,u.value={};try{const ee=await ll(i.value,s.value);u.value=ee.sections,c.value=ee.result,o.value=ee.warnings.join(" · ")||"Seriennummer aktualisiert"}catch(ee){ee instanceof ol&&ee.code===-110?(S.value="assign",L.value=!1,await N(),o.value="Seriennummer nicht gefunden. Zuweisung zum aktiven Auftrag möglich."):r.value=String(ee)}finally{n.value=!1}}async function Ce(){H(),n.value=!0;try{h.value=await fd(i.value),S.value="orders"}catch(ee){r.value=String(ee)}finally{n.value=!1}}const ue=ie(()=>{const ee=new Map;for(const K of h.value){const oe=String(K.WORKORDER_NUMBER||"");if(!oe)continue;const $e=ee.get(oe)||{number:oe,part:String(K.PART_DESC||K.PART_NUMBER||""),layers:[]};$e.layers.includes(ht(K.PROCESS_LAYER))||$e.layers.push(ht(K.PROCESS_LAYER)),ee.set(oe,$e)}return[...ee.values()].filter(K=>(K.number+" "+K.part).toLowerCase().includes(v.value.toLowerCase()))});async function re(){if(fe.value&&!(!T.value||!["0","1","2"].includes(I.value))){n.value=!0,H();try{if(await Oe("trActivateWorkOrder",{stationNumber:i.value,workOrderNumber:T.value,serialNumber:"-1",serialNumberPos:"-1",processLayer:I.value,flag:"1"}),await N(),String(d.value?.WORKORDER_NUMBER)!==T.value||ht(d.value?.PROCESS_LAYER)!==I.value)throw new Error("Aktivierung vom MES noch nicht bestätigt");S.value="none",o.value="Auftrag erfolgreich aktiviert"}catch(ee){r.value=String(ee)}finally{n.value=!1}}}function q(ee){if(!ti(String(ee.SERIAL_NUMBER||""))||!ni(String(ee.STATION_NUMBER||""))||!["0","1","2"].includes(ht(ee.PROCESS_LAYER))){r.value="Buchungszeile enthält keine gültige Station, Lage oder Seriennummer";return}k.value=ee,F.value=0,D.value=0,S.value="rebook"}async function _e(){if(!fe.value||!k.value)return;const ee=k.value;n.value=!0,H();try{if(!confirm(`Status ${F.value} für ${ee.SERIAL_NUMBER} an ${ee.STATION_NUMBER} buchen?`))return;await Fr(String(ee.STATION_NUMBER),String(ee.SERIAL_NUMBER),ht(ee.PROCESS_LAYER),F.value,D.value),S.value="none",o.value="Statusbuchung durch MES bestätigt",await te()}catch(K){r.value=String(K)}finally{n.value=!1}}async function ye(){if(fe.value){if(!d.value||!ti(s.value)||!ni(i.value)){r.value="Aktiver Auftrag/Station/Seriennummer fehlen";return}n.value=!0,H();try{const ee=await ms(i.value);if(String(ee?.WORKORDER_NUMBER)!==String(d.value.WORKORDER_NUMBER)||ht(ee?.PROCESS_LAYER)!==ht(d.value.PROCESS_LAYER))throw Error("Auftrag oder Lage haben sich geändert");if(L.value||(await Oe("trAssignSerialNumberForProductOrWorkOrder",{stationNumber:i.value,workOrderNumber:ee?.WORKORDER_NUMBER,partNumber:"-1",bomVersion:"-2",serialNumberRef:s.value,serialNumberRefPos:"1",processLayer:ht(ee?.PROCESS_LAYER),serialNumberArray:[],activateWorkOrder:"1"}),L.value=!0),ne.value){const K=await ms(i.value);if(String(K?.WORKORDER_NUMBER)!==String(ee?.WORKORDER_NUMBER)||ht(K?.PROCESS_LAYER)!==ht(ee?.PROCESS_LAYER))throw Error("Auftrag während Zuweisung geändert");await Fr(i.value,s.value,ht(ee?.PROCESS_LAYER),0,0)}S.value="none",o.value="Seriennummer zugewiesen"+(ne.value?" und gebucht":""),await te()}catch(ee){r.value=(L.value?"Seriennummer bereits zugewiesen. ":"")+String(ee)}finally{n.value=!1}}}const Ve=ie(()=>Z.value.filter(ee=>Q.value.some(K=>K[ee]!==void 0))),qe=ie(()=>Ve.value.length?Ve.value:Z.value);return(ee,K)=>(g(),m("div",hd,[a("div",pd,[a("span",gd,E(i.value||"Station fehlt"),1),a("span",md,[K[8]||(K[8]=X("Auftrag: ",-1)),a("b",null,E(d.value?.WORKORDER_NUMBER||"—"),1),X(" · "+E(Je(hi)(d.value?.PROCESS_LAYER)),1)]),a("button",{class:"wb-btn wb-small",disabled:n.value||!fe.value,onClick:Ce},"Auftrag wählen",8,vd),a("button",{class:"wb-btn wb-small",disabled:n.value||!fe.value,onClick:N},"↻",8,bd)]),a("form",{class:"wb-mes-form",onSubmit:We(te,["prevent"])},[a("label",null,[K[9]||(K[9]=X("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":K[0]||(K[0]=oe=>s.value=oe),autocomplete:"off",placeholder:"Seriennummer scannen",disabled:n.value},null,8,yd),[[ke,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!fe.value},E(n.value?"Lade…":"Daten abrufen"),9,wd)],32),t.demo||!fe.value?(g(),m("p",Ed,E(t.demo?"Designer-Demo – keine MES-Schreibzugriffe":"Bitte zuerst die Workbench-Station anmelden."),1)):$("",!0),r.value?(g(),m("p",_d,E(r.value),1)):$("",!0),o.value?(g(),m("p",Sd,E(o.value),1)):$("",!0),c.value.partNumber||c.value.workOrderNumber?(g(),m("div",Rd,[a("span",null,[K[10]||(K[10]=X("Sachnummer ",-1)),a("b",null,E(c.value.partNumber||"—"),1)]),a("span",null,E(c.value.partDesc),1),a("span",null,[K[11]||(K[11]=X("Auftrag ",-1)),a("b",null,E(c.value.workOrderNumber),1)])])):$("",!0),a("div",Ad,[(g(!0),m(G,null,ge(se.value,oe=>(g(),m("button",{key:oe.id,class:xe(["wb-mes-tab",{selected:l.value===oe.id}]),"aria-selected":l.value===oe.id,role:"tab",onClick:$e=>l.value=oe.id},[X(E(oe.title)+" ",1),a("small",null,E(oe.count),1)],10,kd))),128))]),a("div",Cd,[a("table",Td,[a("thead",null,[a("tr",null,[l.value==="booking"?(g(),m("th",Nd,"Aktion")):$("",!0),(g(!0),m(G,null,ge(qe.value,oe=>(g(),m("th",{key:oe},E(Je(nl)[oe]||oe),1))),128))])]),a("tbody",null,[(g(!0),m(G,null,ge(Q.value,(oe,$e)=>(g(),m("tr",{key:$e},[l.value==="booking"?(g(),m("td",Md,[a("button",{class:"wb-btn wb-small",title:"Statusumbuchung",disabled:n.value||!fe.value,onClick:Me=>q(oe)},"⚒ Umbuchen",8,Od)])):$("",!0),(g(!0),m(G,null,ge(qe.value,Me=>(g(),m("td",{key:Me,title:Je(Os)(oe[Me],Me)},E(Je(Os)(oe[Me],Me)),9,xd))),128))]))),128)),Q.value.length?$("",!0):(g(),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)]))])])]),(g(),Ue(Eo,{to:"body"},[S.value!=="none"?(g(),m("div",{key:0,class:"wb-mes-overlay",onClick:K[7]||(K[7]=We(oe=>!n.value&&(S.value="none"),["self"]))},[a("section",Ld,[a("header",null,[a("strong",null,E(S.value==="rebook"?"Statusumbuchung":S.value==="assign"?"Seriennummer zuweisen":"Auftrag aktivieren"),1),a("button",{class:"wb-btn",disabled:n.value,onClick:K[1]||(K[1]=oe=>S.value="none")},"✕",8,Dd)]),S.value==="rebook"?(g(),m(G,{key:0},[a("p",null,[K[12]||(K[12]=X("Seriennummer: ",-1)),a("b",null,E(k.value?.SERIAL_NUMBER),1),X(" · Lage: "+E(Je(hi)(k.value?.PROCESS_LAYER))+" · Station: "+E(k.value?.STATION_NUMBER),1)]),a("label",null,[K[14]||(K[14]=X("Status",-1)),ae(a("select",{"onUpdate:modelValue":K[2]||(K[2]=oe=>F.value=oe)},[...K[13]||(K[13]=[a("option",{value:0},"0 – Gut",-1),a("option",{value:1},"1 – Nacharbeit",-1),a("option",{value:2},"2 – Ausschuss",-1)])],512),[[_t,F.value,void 0,{number:!0}]])]),a("label",null,[K[16]||(K[16]=X("Nutzen",-1)),ae(a("select",{"onUpdate:modelValue":K[3]||(K[3]=oe=>D.value=oe)},[...K[15]||(K[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:_e},"Status buchen",8,Ud)],64)):S.value==="assign"?(g(),m(G,{key:1},[a("p",null,[K[17]||(K[17]=X("Seriennummer ",-1)),a("b",null,E(s.value),1),K[18]||(K[18]=X(" zum aktiven Auftrag ",-1)),a("b",null,E(d.value?.WORKORDER_NUMBER||"—"),1),K[19]||(K[19]=X(" zuweisen?",-1))]),a("p",null,"Prozesslage: "+E(Je(hi)(d.value?.PROCESS_LAYER)),1),a("label",Fd,[ae(a("input",{type:"checkbox","onUpdate:modelValue":K[4]||(K[4]=oe=>ne.value=oe)},null,512),[[ei,ne.value]]),K[20]||(K[20]=X(" Anschließend Status „Gut“ buchen",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!d.value,onClick:ye},E(L.value?"Zuweisung abschließen":"Zuweisen"),9,Bd)],64)):(g(),m(G,{key:2},[ae(a("input",{"onUpdate:modelValue":K[5]||(K[5]=oe=>v.value=oe),placeholder:"Auftrag filtern"},null,512),[[ke,v.value]]),a("div",$d,[(g(!0),m(G,null,ge(ue.value,oe=>(g(),m("button",{key:oe.number,class:"wb-mes-order",onClick:$e=>{T.value=oe.number,I.value=oe.layers[0]||"2"}},[a("b",null,E(oe.number),1),a("small",null,E(oe.part),1),a("span",null,E(oe.layers.map(Je(hi)).join(" / ")),1)],8,zd))),128))]),T.value?(g(),m("div",Hd,[a("b",null,"Auftrag: "+E(T.value),1),a("label",null,[K[21]||(K[21]=X("Prozesslage",-1)),ae(a("select",{"onUpdate:modelValue":K[6]||(K[6]=oe=>I.value=oe)},[(g(!0),m(G,null,ge(ue.value.find(oe=>oe.number===T.value)?.layers,oe=>(g(),m("option",{key:oe,value:oe},E(Je(hi)(oe)),9,Wd))),128))],512),[[_t,I.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:re},"Aktivieren",8,Vd)])):$("",!0)],64)),r.value?(g(),m("p",Kd,E(r.value),1)):$("",!0)])])):$("",!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=A(null),s=A(!1),n=A(""),r=ie(()=>Math.min(300,Math.max(0,Number(e.widget.props.refreshSeconds??30)||0)));let o,l=0;const u=ie(()=>{const h=i.value||{},v=S=>Os(h[S]);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 c(){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(!ni(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 d(){o&&clearInterval(o),o=void 0,c(),!e.demo&&r.value>0&&(o=setInterval(()=>{c()},r.value*1e3))}return nt([()=>e.station,()=>e.demo,r],d,{immediate:!0}),vi(()=>{l++,o&&clearInterval(o)}),(h,v)=>(g(),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:c},"↻ Aktualisieren",8,Xd)]),n.value?(g(),m("div",Qd,E(n.value),1)):$("",!0),a("div",Zd,[(g(!0),m(G,null,ge(u.value,S=>(g(),m("div",{key:S.label,class:"wb-overview-value"},[a("div",ef,E(S.label),1),a("div",{class:"wb-overview-data",title:S.value},E(S.value),9,tf)]))),128))])],8,jd))}}),Ci=(t,e)=>{const i=t.__vccOpts||t;for(const[s,n]of e)i[s]=n;return i},nf=Ci(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"},Ff=["value"],Bf={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=A(e.station),s=A(""),n=A(!1),r=A(""),o=A(""),l=A([]),u=A([]),c=A({}),d=A([]),h=A([]),v=A([]),S=A([]),k=A(!1),T=A(""),I=A("plan"),F=A("none"),D=A(null),ne=A(0),L=A(0),se=A(-1),j=A(""),Q=A([]),Z=A([]),fe=A(""),H=A(""),N=A(!1),te=A(""),Ce=A("setup"),ue=A(""),re=A(""),q=ie(()=>!e.demo&&!!rl()&&ni(i.value));nt(()=>e.station,C=>{i.value=C,_e()}),li(()=>{const C=new URLSearchParams(location.search).get("serial")||sessionStorage.getItem("hmiLastSerial")||"";ti(C)&&(s.value=C)});function _e(){l.value=[],u.value=[],c.value={},d.value=[],h.value=[],v.value=[],T.value=""}function ye(C){return Object.keys(C)}const Ve=ie(()=>({booking:c.value.booking||[],failure:c.value.failure||[],slip:c.value.slip||[],measure:c.value.measure||[],setup:d.value,setupcheck:h.value,attributes:v.value,plan:l.value})[I.value]||[]),qe=ie(()=>Ve.value.length?ye(Ve.value[0]):[]);function ee(C){r.value=C instanceof Error?C.message:String(C)}function K(){return q.value?!0:(r.value="Buchungsaktionen sind nur im angemeldeten Werker-Modus erlaubt",!1)}function oe(C){return String(C.Arbeitsschritt??"")}function $e(C){const b=oe(C);return[...c.value.booking||[]].filter(R=>String(R.WORKSTEP_NUMBER)===b).sort((R,x)=>Number(x.BOOK_DATE||0)-Number(R.BOOK_DATE||0))[0]}function Me(C){const b=$e(C);if(String(b?.BOOK_STATE)==="2")return{ok:!1,reason:"Arbeitsschritt ist Ausschuss"};const R=l.value.indexOf(C);if(R<=0)return{ok:!0,reason:""};const x=l.value[R-1];return String($e(x)?.BOOK_STATE)!=="0"?{ok:!1,reason:"Vorgänger "+oe(x)+" ist nicht mit Gut (0) gebucht"}:{ok:!0,reason:""}}function z(C){return String(k.value?C.AVO:C.Prozesslage??"2")}const Ge=ie(()=>D.value?u.value.filter(C=>String(C.MEASURE_NAME||"").startsWith(String(D.value?.AVO)+"|")):[]);async function Ie(){if(r.value="",o.value="",!q.value||!ti(s.value)){r.value="Workbench-Anmeldung, Station und gültige Seriennummer erforderlich";return}n.value=!0,_e();try{const C=await ll(i.value,s.value);if(c.value=C.sections,T.value=String(C.result.workOrderNumber||C.sections.booking[0]?.WORKORDER_NUMBER||""),!T.value)throw new Error("Kein Auftrag zur Seriennummer gefunden");const b=[{key:"FUNC_MODE",value:"0"},{key:"WORKORDER_NUMBER",value:T.value},{key:"WORKSTEP_FLAG",value:"1"}];let R=["WORKSTEP_AVO","WORKSTEP_NUMBER","PROCESS_LAYER","WORKSTEP_DESC","OBLIGATORY_CONFIRM_FLAG","PART_NUMBER","SKILL_LEVEL"],x=["AVO","Arbeitsschritt","Prozesslage","Beschreibung","Rueckmeldepflichtig","Artikelnummer","Skill"],J;try{J=await Oe("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:b,workplanDataResultKeys:R})}catch(Re){if(Re?.code!==-368)throw Re;R=R.slice(0,-1),x=x.slice(0,-1),J=await Oe("mdataGetWorkplanData",{stationNumber:i.value,workplanFilter:b,workplanDataResultKeys:R})}l.value=et(J.workplanDataResultValues,R,x);const he=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","MIN_VALUE","MAX_VALUE","NOMINAL","UNIT"],we=["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"],Ee=["COMP_NAME","PART_NUMBER","PART_DESC","PROCESS_LAYER","QUANTITY","PRODUCT_FLAG","SETUP_FLAG","UNIT","WORKSTEP_NUMBER","SETUP_POSITION"],Se=["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:he},[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:Se,componentResultKeys:[]}),Oe("mdataGetBomData",{stationNumber:i.value,bomDataFilter:[{key:"SERIAL_NUMBER",value:s.value}],bomDataResultKeys:Ee}),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:[]})]),Fe=Re=>{const ve=ze[Re];return ve.status==="fulfilled"?ve.value:{}};u.value=et(Fe(0).recipeResultValues,he,we),d.value=et(Fe(1).setupResultValues,pe);const Qe=et(Fe(2).setupResultValues,Se);h.value=et(Fe(3).bomDataResultValues,Ee).map(Re=>({...Re,MATERIAL_BIN_NUMBERS:Qe.filter(ve=>String(ve.PART_NUMBER)===String(Re.PART_NUMBER)).map(ve=>String(ve.MATERIAL_BIN_NUMBER)).join(", ")})),v.value=et(Fe(4).attributeResultValues,["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"]),S.value=et(Fe(5).failureDataResultValues,["FAILURE_TYPE_CODE","FAILURE_TYPE_DESC"]);const ut=Fe(6).stationConfigCodeResultValues||[];k.value=String(ut[0]||"").toUpperCase()==="A"&&["1","TRUE"].includes(String(ut[1]||"").toUpperCase());const ai=ze.map((Re,ve)=>Re.status==="rejected"?`Datenquelle ${ve+1}: ${String(Re.reason)}`:"").filter(Boolean);o.value=ai.length?"Teildaten geladen. "+ai.join(" · "):`Arbeitsplan: ${l.value.length} Schritte · ${u.value.length} Rezeptwerte`}catch(C){ee(C)}finally{n.value=!1}}function Xe(C,b){r.value="",D.value=b,F.value=C,se.value=-1,j.value="",Q.value=[],Z.value=[],fe.value="",H.value="",ne.value=0,L.value=0,N.value=!1}function At(C){se.value=C,j.value=String(Ge.value[C]?.MEASURE_VALUE??"")}function p(){const C=Ge.value[se.value];if(!C){r.value="Messgröße auswählen";return}C.MEASURE_VALUE=j.value,o.value="Messwert lokal vorgemerkt. MES-Buchung über Status-Dialog ausführen.",F.value="none"}function y(){const C=["MEASURE_NAME","FUNCTION","FUNCTION_DESC","FUNCTION_STEP","FUNCTION_STEP_DESC","LOWER_LIMIT","UPPER_LIMIT","MEASURE_VALUE","NOMINAL","UNIT","MEASURE_FAIL_CODE"],R=[...Ge.value].sort((x,J)=>String(x.MEASURE_NAME||"").localeCompare(String(J.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:C,values:R}}async function O(){if(!K()||!D.value)return;const C=Me(D.value);if(!C.ok){r.value=C.reason;return}const b=z(D.value);if(confirm(`Status ${ne.value} an Schritt ${oe(D.value)} buchen?`)){n.value=!0,r.value="";try{const R=y();R.values.length?await Oe("trUploadResultDataAndRecipe",{stationNumber:i.value,processLayer:b,recipeVersionId:-1,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:ne.value,duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,recipeVersionMode:0,resultUploadKeys:R.keys,resultUploadValues:R.values}):await Oe("trUploadState",{stationNumber:i.value,processLayer:b,serialNumberRef:s.value,serialNumberRefPos:"-1",serialNumberState:ne.value,duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,serialNumberUploadKeys:["SERIAL_NUMBER","SERIAL_NUMBER_STATE","ERROR_CODE"],serialNumberUploadValues:[]}),F.value="none",await Ie(),o.value="Statusbuchung durch MES bestätigt"}catch(R){ee(R)}finally{n.value=!1}}}async function B(){if(K()){if(!D.value||!Q.value.length){r.value="Fehlercode auswählen";return}if(confirm("Fehlerbuchung ausführen?")){n.value=!0,r.value="";try{const C=Z.value.length?["COMP_NAME","ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"]:["ERROR_CODE","FAILURE_TYPE_CODE","REPAIRED"],b=(Z.value.length?Z.value:[""]).flatMap(R=>Q.value.flatMap(x=>Z.value.length?[R,"0",x,N.value?"1":"0"]:["0",x,N.value?"1":"0"]));await Oe("trUploadFailureAndResultData",{stationNumber:i.value,processLayer:z(D.value),serialNumberRef:s.value,serialNumberRefPos:"-1",...fe.value?{serialNumberState:Number(fe.value)}:{},duplicateSerialNumber:L.value,bookDate:-1,cycleTime:10,measureKeys:["ERROR_CODE","MEASURE_FAIL_CODE","MEASURE_NAME","MEASURE_VALUE"],measureValues:[],failureKeys:C,failureValues:b,failureSlipKeys:["ERROR_CODE","TESTSTEP_NAME"],failureSlipValues:H.value.trim()?["0",H.value.trim()]:[]}),F.value="none",await Ie(),o.value="Fehlerbuchung erfolgreich"}catch(C){ee(C)}finally{n.value=!1}}}}async function P(C){if(!(!K()||!D.value)&&confirm(`Rüstzustand ${C} für Station ${i.value} ändern?`)){n.value=!0,r.value="";try{const b=["PART_NUMBER","BOM_VERSION_ERP","PROCESS_LAYER","WORKORDER_NUMBER","QUANTITY"],R=await Oe("trGetStationSetting",{stationNumber:i.value,stationSettingResultKeys:b}),x=et(R.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:C}),F.value="none",await Ie()}catch(b){ee(b)}finally{n.value=!1}}}async function U(){if(K()){if(!te.value.trim()||!ni(i.value)){r.value="Materialbehälter fehlt";return}n.value=!0,r.value="";try{const C=te.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,C,C.slice(-6),Ce.value==="setup"?0:1],resultKeys:["COMP_REFERENCE"],resultValues:[]}),F.value="none",await Ie()}catch(C){ee(C)}finally{n.value=!1}}}async function V(){if(K()){if(!ue.value.trim()){r.value="Attributcode fehlt";return}n.value=!0,r.value="";try{const C={stationNumber:i.value,objectType:0,objectNumber:s.value,objectDetail:"-1",bookDate:-1,allowOverWrite:1,attributeUploadKeys:["ATTRIBUTE_CODE","ATTRIBUTE_VALUE","ERROR_CODE"],attributeUploadValues:[ue.value,re.value,0]};let b=!1;try{const x=(await Oe("attribAppendAttributeValues",C,[0,5])).attributeResultValues;Array.isArray(x)&&x.some(J=>String(J)==="-901")&&(b=!0)}catch(R){if(R?.code!==-901)throw R;b=!0}b&&(await Oe("attribCreateAttributeCode",{stationNumber:i.value,codeKeys:["ATTRIBUTE_CODE","DATA_TYPE","OBJECT_TYPE"],codeValues:[ue.value,"STRING","0"]}),await Oe("attribAppendAttributeValues",C)),F.value="none",await Ie()}catch(C){ee(C)}finally{n.value=!1}}}async function W(C){if(K()&&confirm("Auftrag für Arbeitsschritt "+oe(C)+" 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:z(C),flag:"1"}),o.value="Auftrag aktiviert"}catch(b){ee(b)}finally{n.value=!1}}}return(C,b)=>(g(),m("div",rf,[a("div",of,[a("span",lf,E(i.value||"Station fehlt"),1),a("span",null,[b[17]||(b[17]=X("Auftrag: ",-1)),a("b",null,E(T.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]=X("Seriennummer",-1)),ae(a("input",{"onUpdate:modelValue":b[0]||(b[0]=R=>s.value=R),autocomplete:"off",placeholder:"Seriennummer scannen"},null,512),[[ke,s.value,void 0,{trim:!0}]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!q.value},E(n.value?"Lade…":"Arbeitsplan laden"),9,af)],32),q.value?$("",!0):(g(),m("p",uf,E(t.demo?"Demo – keine MES-Aktionen":"Zuerst die Workbench-Station anmelden."),1)),r.value?(g(),m("p",cf,E(r.value),1)):$("",!0),o.value?(g(),m("p",df,E(o.value),1)):$("",!0),a("div",ff,[(g(),m(G,null,ge(["plan","booking","failure","slip","measure","setup","setupcheck","attributes"],R=>a("button",{key:R,class:xe(["wb-mes-tab",{selected:I.value===R}]),onClick:x=>I.value=R},E({plan:"Arbeitsplan",booking:"Buchungen",failure:"Fehler",slip:"Fehlerschein",measure:"Messwerte",setup:"Rüstung",setupcheck:"SetupCheck",attributes:"Attribute"}[R]),11,hf)),64))]),a("div",pf,[a("table",gf,[a("thead",null,[a("tr",null,[I.value==="plan"?(g(),m("th",mf,"Aktionen")):$("",!0),(g(!0),m(G,null,ge(qe.value,R=>(g(),m("th",{key:R},E(Je(nl)[R]||R),1))),128))])]),a("tbody",null,[(g(!0),m(G,null,ge(Ve.value,(R,x)=>(g(),m("tr",{key:x},[I.value==="plan"?(g(),m("td",vf,[a("button",{class:"wb-btn wb-small",title:"Messwerte",disabled:n.value,onClick:J=>Xe("measure",R)},"M",8,bf),a("button",{class:"wb-btn wb-small",title:"Fehler",disabled:n.value,onClick:J=>Xe("failure",R)},"F",8,yf),a("button",{class:"wb-btn wb-small",title:"Rüstung",disabled:n.value,onClick:J=>Xe("setup",R)},"R",8,wf),a("button",{class:"wb-btn wb-small",title:"Attribute",disabled:n.value,onClick:J=>Xe("attribute",R)},"A",8,Ef),a("button",{class:"wb-btn wb-small",title:"Status buchen",disabled:n.value||!q.value||!Me(R).ok,onClick:J=>Xe("status",R)},"✓",8,_f),a("button",{class:"wb-btn wb-small",title:"Auftrag aktivieren",disabled:n.value||!q.value,onClick:J=>W(R)},"↗",8,Sf)])):$("",!0),(g(!0),m(G,null,ge(qe.value,J=>(g(),m("td",{key:J},E(Je(Os)(R[J],J)),1))),128))]))),128)),Ve.value.length?$("",!0):(g(),m("tr",Rf,[a("td",{colspan:qe.value.length+(I.value==="plan"?1:0)||1,class:"wb-empty"},"Keine Daten geladen",8,Af)]))])])]),(g(),Ue(Eo,{to:"body"},[F.value!=="none"?(g(),m("div",{key:0,class:"wb-mes-overlay",onClick:b[16]||(b[16]=We(R=>!n.value&&(F.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:""}[F.value])+" · AVO "+E(D.value?.AVO),1),a("button",{class:"wb-btn",disabled:n.value,onClick:b[1]||(b[1]=R=>F.value="none")},"✕",8,Cf)]),F.value==="status"?(g(),m(G,{key:0},[a("p",null,"Arbeitsschritt "+E(D.value?.Arbeitsschritt)+" · "+E(D.value?.Beschreibung),1),Me(D.value).ok?$("",!0):(g(),m("p",Tf,E(Me(D.value).reason),1)),a("label",null,[b[20]||(b[20]=X("Status",-1)),ae(a("select",{"onUpdate:modelValue":b[2]||(b[2]=R=>ne.value=R)},[...b[19]||(b[19]=[a("option",{value:0},"Gut",-1),a("option",{value:1},"Nacharbeit",-1),a("option",{value:2},"Ausschuss",-1)])],512),[[_t,ne.value,void 0,{number:!0}]])]),a("label",Nf,[ae(a("input",{type:"checkbox","onUpdate:modelValue":b[3]||(b[3]=R=>L.value=R),"true-value":1,"false-value":0},null,512),[[ei,L.value]]),b[21]||(b[21]=X(" 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)):$("",!0),F.value==="measure"?(g(),m(G,{key:1},[a("div",Of,[(g(!0),m(G,null,ge(Ge.value,(R,x)=>(g(),m("button",{key:x,class:xe(["wb-mes-order",{chosen:se.value===x}]),onClick:J=>At(x)},E(R.MEASURE_NAME)+" · "+E(R.UNIT)+" ("+E(R.LOWER_LIMIT)+" … "+E(R.UPPER_LIMIT)+")",11,xf))),128))]),a("label",null,[b[22]||(b[22]=X("Messwert",-1)),ae(a("input",{"onUpdate:modelValue":b[4]||(b[4]=R=>j.value=R),disabled:se.value<0},null,8,Pf),[[ke,j.value]])]),a("button",{class:"wb-btn wb-primary",disabled:se.value<0,onClick:p},"Übernehmen (lokal)",8,If)],64)):$("",!0),F.value==="failure"?(g(),m(G,{key:2},[b[27]||(b[27]=a("p",null,"Fehlerart auswählen",-1)),a("div",Lf,[(g(!0),m(G,null,ge(S.value,R=>(g(),m("label",{key:String(R.FAILURE_TYPE_CODE),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(R.FAILURE_TYPE_CODE),"onUpdate:modelValue":b[5]||(b[5]=x=>Q.value=x)},null,8,Df),[[ei,Q.value]]),X(" "+E(R.FAILURE_TYPE_CODE)+" – "+E(R.FAILURE_TYPE_DESC),1)]))),128))]),b[28]||(b[28]=a("p",null,"Komponenten (optional)",-1)),a("div",Uf,[(g(!0),m(G,null,ge(h.value,R=>(g(),m("label",{key:String(R.COMP_NAME),class:"wb-mes-check"},[ae(a("input",{type:"checkbox",value:String(R.COMP_NAME),"onUpdate:modelValue":b[6]||(b[6]=x=>Z.value=x)},null,8,Ff),[[ei,Z.value]]),X(" "+E(R.COMP_NAME)+" · "+E(R.PART_NUMBER),1)]))),128))]),a("label",null,[b[23]||(b[23]=X("Fehlerscheintext",-1)),ae(a("input",{"onUpdate:modelValue":b[7]||(b[7]=R=>H.value=R)},null,512),[[ke,H.value]])]),a("label",null,[b[25]||(b[25]=X("Status",-1)),ae(a("select",{"onUpdate:modelValue":b[8]||(b[8]=R=>fe.value=R)},[...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,fe.value]])]),a("label",Bf,[ae(a("input",{type:"checkbox","onUpdate:modelValue":b[9]||(b[9]=R=>N.value=R)},null,512),[[ei,N.value]]),b[26]||(b[26]=X(" Repariert",-1))]),a("button",{class:"wb-btn wb-primary",disabled:n.value||!Q.value.length,onClick:B},"Fehler buchen",8,$f)],64)):$("",!0),F.value==="setup"?(g(),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]=R=>P(0))},"Rüstung aktivieren",8,Hf),a("button",{class:"wb-btn",disabled:n.value,onClick:b[11]||(b[11]=R=>P(2))},"Rüstung löschen",8,Wf)]),a("label",null,[b[29]||(b[29]=X("Behälternummer",-1)),ae(a("input",{"onUpdate:modelValue":b[12]||(b[12]=R=>te.value=R)},null,512),[[ke,te.value,void 0,{trim:!0}]])]),a("label",null,[b[31]||(b[31]=X("Modus",-1)),ae(a("select",{"onUpdate:modelValue":b[13]||(b[13]=R=>Ce.value=R)},[...b[30]||(b[30]=[a("option",{value:"setup"},"Einrüsten",-1),a("option",{value:"remove"},"Abrüsten",-1)])],512),[[_t,Ce.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:U},"Behälter übernehmen",8,Vf)],64)):$("",!0),F.value==="attribute"?(g(),m(G,{key:4},[a("label",null,[b[32]||(b[32]=X("Attributcode",-1)),ae(a("input",{"onUpdate:modelValue":b[14]||(b[14]=R=>ue.value=R)},null,512),[[ke,ue.value,void 0,{trim:!0}]])]),a("label",null,[b[33]||(b[33]=X("Wert",-1)),ae(a("input",{"onUpdate:modelValue":b[15]||(b[15]=R=>re.value=R)},null,512),[[ke,re.value]])]),a("button",{class:"wb-btn wb-primary",disabled:n.value,onClick:V},"Attribut speichern",8,Kf)],64)):$("",!0),r.value?(g(),m("p",Gf,E(r.value),1)):$("",!0)])])):$("",!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=A(null),s=A(""),n=A(""),r=Math.random().toString(36).slice(2)+Date.now().toString(36),o=ie(()=>{const d=String(e.widget.props.script||'return {info:"REST-Skript anpassen"};'),h=JSON.stringify(d).replace(/ +Workbench HMI
diff --git a/backend/src/test/java/com/workbenchclassic/hmi/HmiWorkplaceBundleTest.java b/backend/src/test/java/com/workbenchclassic/hmi/HmiWorkplaceBundleTest.java index 108d8f0..41786a5 100644 --- a/backend/src/test/java/com/workbenchclassic/hmi/HmiWorkplaceBundleTest.java +++ b/backend/src/test/java/com/workbenchclassic/hmi/HmiWorkplaceBundleTest.java @@ -1,32 +1,48 @@ package com.workbenchclassic.hmi; +import com.sun.net.httpserver.HttpServer; +import java.net.InetSocketAddress; import java.nio.file.Files; -import java.util.Arrays; -import javax.xml.parsers.DocumentBuilderFactory; +import java.util.concurrent.atomic.AtomicReference; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import java.io.ByteArrayOutputStream; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; +/** Regression: current remote bytes, never an archived vendor bundle. */ class HmiWorkplaceBundleTest { - @Test void bundledManifestAndJarBytes() throws Exception { - HmiWorkplaceManifest m=HmiWorkplaceManifest.bundled("https://example.org/mes"); - assertTrue(m.rewritten.contains("https://example.org/mes")); - assertTrue(m.rewritten.contains(HmiWorkplaceManifest.LOCAL_JARS)); - int checked=0; - for(String name:m.jars) { - try(var in=getClass().getResourceAsStream("/hmi/workplace-jars/"+name)) { - // Platform-only RXTX JARs are intentionally not packaged. - if(in==null) {assertTrue(name.startsWith("net.cloudhopper.rxtx-"));continue;} - var path=HmiWorkplaceJarCache.obtainBundled(name); - assertArrayEquals(in.readAllBytes(),Files.readAllBytes(path)); - assertEquals(path,HmiWorkplaceJarCache.obtainBundled(name)); - checked++; - } + static byte[] jar(String value) throws Exception { + ByteArrayOutputStream bytes=new ByteArrayOutputStream(); + try(ZipOutputStream zip=new ZipOutputStream(bytes)) { + zip.putNextEntry(new ZipEntry("version.txt")); + zip.write(value.getBytes(java.nio.charset.StandardCharsets.UTF_8)); + zip.closeEntry(); } - assertEquals(129,checked); + return bytes.toByteArray(); } - @Test void rejectsTraversalMissingAndUnsafeManifest() throws Exception { - assertThrows(java.io.IOException.class,()->HmiWorkplaceJarCache.obtainBundled("../secret.jar")); - assertThrows(java.io.IOException.class,()->HmiWorkplaceJarCache.obtainBundled("not-present.jar")); + @Test void sameFilenameUpdatedOnNewLaunch() throws Exception { + byte[] first=jar("backend-v1"),second=jar("backend-v2"); + AtomicReference content=new AtomicReference<>(first); + HttpServer server=HttpServer.create(new InetSocketAddress("127.0.0.1",0),0); + server.createContext("/client.jar",exchange->{ + byte[] bytes=content.get();exchange.sendResponseHeaders(200,bytes.length); + try(var out=exchange.getResponseBody()){out.write(bytes);} + }); + server.start(); + try { + var url=new java.net.URL("http://127.0.0.1:"+server.getAddress().getPort()+"/client.jar"); + assertArrayEquals(first,Files.readAllBytes(HmiWorkplaceJarCache.obtain(url))); + content.set(second); + HmiWorkplaceJarCache.invalidateForNewManifest(); + assertArrayEquals(second,Files.readAllBytes(HmiWorkplaceJarCache.obtain(url))); + server.stop(0); + HmiWorkplaceJarCache.invalidateForNewManifest(); + assertThrows(java.io.IOException.class,()->HmiWorkplaceJarCache.obtain(url)); + } finally {server.stop(0);} + } + @Test void noPackagedVendorBundleAndRejectUnsafeManifest() throws Exception { + assertNull(getClass().getResource("/hmi/workplace-jars/com.itac.product-util-common.jar")); assertThrows(Exception.class,()->HmiWorkplaceManifest.parse( "]>&e;".getBytes(),"https://example.org/mes")); } diff --git a/build-hmi.sh b/build-hmi.sh index 1648e07..a15ac59 100644 --- a/build-hmi.sh +++ b/build-hmi.sh @@ -3,7 +3,6 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")" && pwd)" command -v npm >/dev/null || { echo 'Node 20.19+/npm fehlt'; exit 1; } command -v mvn >/dev/null || { echo 'Maven 3.6.3+ fehlt'; exit 1; } -python3 "$ROOT/hmi-scripts/prepare-workplace.py" bash "$ROOT/hmi-scripts/build-jaas-bridge.sh" bash "$ROOT/hmi-scripts/build-sysparameter-fallback.sh" bash "$ROOT/hmi-scripts/build-native-loader-smoke.sh" diff --git a/hmi-docs/CLIENT_MIGRATION_MATRIX.md b/hmi-docs/CLIENT_MIGRATION_MATRIX.md index 2337dd1..c11edf0 100644 --- a/hmi-docs/CLIENT_MIGRATION_MATRIX.md +++ b/hmi-docs/CLIENT_MIGRATION_MATRIX.md @@ -42,3 +42,11 @@ The browser source faithfully supplies the known MES action names and payload sh | Java/Swing | CheerpJ 5.0 / Java 11; Chromium startup test, see deployment report | | MES authentication / writes | Unmodified; no authenticated transaction test performed | | Native serial drivers | Unsupported by browser JVM; platform-specific JARs omitted | + +## 2026-11-23 correction – authoritative current behavior + +The previous ZIP-based runtime source is retired. Current Workplace.jnlp and manufacturer +JARs ALWAYS come from the authenticated MES server. No archived runtime fallback. Every +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. diff --git a/hmi-frontend/public/cheerpj-runner.js b/hmi-frontend/public/cheerpj-runner.js index 8732e77..89f9964 100644 --- a/hmi-frontend/public/cheerpj-runner.js +++ b/hmi-frontend/public/cheerpj-runner.js @@ -257,7 +257,7 @@ async function start(e,data){ const params=new URL(location.href).searchParams; const rawWindowMode=data.windowMode ?? params.get('windows'); const windowMode=isWorkplace && ['off','diagnose','rescue'].includes(rawWindowMode) - ? rawWindowMode : (isWorkplace ? 'diagnose' : 'off'); + ? rawWindowMode : 'off'; boot('JNLP-Abruf'); status(id,'loading','JNLP wird gelesen …'); const r=await fetch(url.href,{credentials:'same-origin',redirect:'follow',cache:'no-store'}); diff --git a/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar b/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar index b583757..73a8131 100644 Binary files a/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar and b/hmi-frontend/public/cheerpj/jaas-identity-bridge.jar differ diff --git a/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar b/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar index 0216c35..62a76b7 100644 Binary files a/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar and b/hmi-frontend/public/cheerpj/jaas-native-loader-smoke.jar differ diff --git a/hmi-frontend/public/cheerpj/sysparameter-jaas-fallback-java11.jar b/hmi-frontend/public/cheerpj/sysparameter-jaas-fallback-java11.jar index b6e2e47..095c7e2 100644 Binary files a/hmi-frontend/public/cheerpj/sysparameter-jaas-fallback-java11.jar and b/hmi-frontend/public/cheerpj/sysparameter-jaas-fallback-java11.jar differ diff --git a/hmi-frontend/src/widgets/CheerpJWidget.vue b/hmi-frontend/src/widgets/CheerpJWidget.vue index bcb1668..eef56db 100644 --- a/hmi-frontend/src/widgets/CheerpJWidget.vue +++ b/hmi-frontend/src/widgets/CheerpJWidget.vue @@ -10,7 +10,7 @@ const autoStartEnabled = computed(()=>shouldAutoStartWidget(props.widget.type,pr const javaVersion = computed(()=>[8,11,17].includes(Number(props.widget.props.javaVersion))?Number(props.widget.props.javaVersion):8); const windowProtocolWarning = window.location.protocol==='http:' && !['localhost','127.0.0.1'].includes(window.location.hostname); const displayMode = computed(()=>['fit','original'].includes(String(props.widget.props.displayMode))?String(props.widget.props.displayMode):'fit'); -const windowMode = ref<'off'|'diagnose'|'rescue'>('diagnose'); // Client-only; no vendor settings changed. +const windowMode = ref<'off'|'diagnose'|'rescue'>('off'); // Client-only; no vendor settings changed. const launchRequested = ref(false); const failure = ref(''); const status = ref(''); @@ -105,7 +105,7 @@ onBeforeUnmount(()=>window.removeEventListener('message',onMessage)); -
Java 11 · „Fenster: Diagnose“ protokolliert virtuelle Bildschirmgrenzen und alle Swing-Dialoge. „Dialoge zurückholen“ korrigiert nur außerhalb liegende sichtbare JDialogs; ein JAAS-Fehler wird dadurch nicht behoben.
+
Java 11 · „Fenster: Diagnose“ protokolliert virtuelle Bildschirmgrenzen und alle Swing-Dialoge. „Dialoge zurückholen“ korrigiert nur außerhalb liegende sichtbare JDialogs; ein JAAS-Fehler wird dadurch nicht behoben.
HTTP aktiv: Anmeldedaten und MES-Daten sind nicht transportverschlüsselt. Nur in geschützten Netzen einsetzen.
☕ CheerpJ-Vorschau: Der Java-Client wird erst im Werker-Modus gestartet.{{url||'JNLP-Adresse noch nicht konfiguriert'}}
☕ JNLP-Anwendung starten{{url||'Bitte eine JNLP-URL im Designer hinterlegen'}}
diff --git a/hmi-frontend/tests/cheerpj-window-runtime.mjs b/hmi-frontend/tests/cheerpj-window-runtime.mjs index 787777b..62989c5 100644 --- a/hmi-frontend/tests/cheerpj-window-runtime.mjs +++ b/hmi-frontend/tests/cheerpj-window-runtime.mjs @@ -14,6 +14,8 @@ assert.match(html, /cjrtnc\.leaningtech\.com/); assert.match(html, /body\.cheerpj-standalone #state/); assert.match(widget, /standalone=workplace&runtime=/); assert.match(widget, /Fensterdiagnose/); +assert.match(widget, /ref<'off'\|'diagnose'\|'rescue'>\('off'\)/); +assert.match(js, /\? rawWindowMode : 'off'/); assert.match(widget, /windowMode:windowMode\.value/); assert.match(html, /id="window-diagnostics"/); assert.match(widget, /rel="noopener noreferrer"/); diff --git a/release/DEPLOYMENT.md b/release/DEPLOYMENT.md index 1b2dffd..2f88d02 100644 --- a/release/DEPLOYMENT.md +++ b/release/DEPLOYMENT.md @@ -1,100 +1,60 @@ -# WidgetWorkbench / Workplace – GlassFish candidate, 2026-11-22 +# Workplace / GlassFish – remote-only correction, 2026-11-23 -## Artifact and scope +## Correction and authority -`backend-1.war` is built for Java EE 8 (`javax.*`), Java 11 bytecode and context root `/backend`. -Use the existing compatible GlassFish/Payara environment (not a Jakarta-only GlassFish 6/7 installation). -Keep the existing `dsCustNJTA`, MES datasource, IMSAPI configuration and role assignments. -No server configuration or deployment has been changed by this build. +The previous build packaged a fixed ZIP snapshot. This can mismatch the running MES backend. +The user confirmed the login works and requires the JARs from the current MES Workplace.jnlp. +This build therefore ALWAYS fetches the configured JNLP from the authenticated IMSAPI target +under `/mes/webstart/clients/`, and the approved manufacturer JARs from that MES server. +There is no ZIP/bundled fallback, including on TLS, network or HTTP failures. +The old `hmi.workplace.source=bundled` setting is no longer consulted. +`Workplace.zip` is reference material only, not a build input or runtime source. -The 129 platform-independent manufacturer JARs from `Workplace.zip` are included byte-for-byte -under `WEB-INF/classes/hmi/workplace-jars/`. They are NOT server libraries in `WEB-INF/lib` -and cannot be downloaded directly through a public static URL. The existing authenticated, -role-checked endpoint serves them with HTTP Range support. JAR hashes were checked in the final WAR. +Each manifest request (widget start/restart) fetches a fresh upstream manifest and invalidates +server-side JAR cache generations, even if all filenames stayed the same. Browser HTTP responses +for manufacturer JARs use `private, no-store, no-transform`. The server still caches downloaded +bytes within a generation to serve CheerpJ's many Range requests efficiently. +Restart/reload Workplace after a backend upgrade; already-loaded Java classes cannot be hot-swapped. +Avoid upgrading the MES during a running client session. No atomic upstream release snapshot is implied. + +The original manifest parser currently accepts flat JAR filenames within the configured MES +clients directory. Unsupported JNLP structures/paths fail explicitly, never substitute ZIP files. +Platform-specific JNI/RXTX dependencies remain unsupported by the browser VM. ## Deployment -1. Back up the existing deployment and retain its server settings. -2. Deploy `backend-1.war` using the GlassFish console, application context root `/backend`. - When using asadmin, select your existing domain/instance explicitly; do not create new datasources. -3. Sign in to `/backend/hmi/` using the existing IMSAPI login. The user requires `hmi-workplace` - or `hmi-admin`; widget editing additionally requires the existing designer/script-editor roles. -4. Add/use `ui.cheerpj-workplace` in the normal runtime page. The browser uses Java 11 / CheerpJ 5.0. -5. For a full-window diagnostic after login, open: - `/backend/hmi/cheerpj-runner.html?standalone=workplace&windows=diagnose` -6. Verify login, window rendering and your read-only test workflow before any production bookings. +Deploy `release/backend-1.war` on the existing Java EE 8 (`javax.*`), Java-11-compatible +GlassFish/Payara instance with context `/backend`. This WAR is not for a Jakarta-only GlassFish 6/7. +Preserve the existing datasources, IMSAPI target and role configuration. No server configuration +or live deployment was changed while creating this artifact. -## Resource source +After redeployment, close the old Workplace tab/iframe and reopen the widget (or hard-reload). +Existing role requirements remain: `hmi-workplace` or `hmi-admin` for runtime/JAR downloads. +The Browser JAAS fix remains: `os.name=CheerpJ Browser` and `user.name=cheerpj-client` passed +via CheerpJ initialization. This does not replace MES authentication. No manufacturer bytecode +or signatures are altered; the old unsigned SysParameter override remains disabled by default. +Window diagnostics default to OFF; explicit diagnostics remain available for troubleshooting. -Default: bundled archive and bundled `Workplace.jnlp`. This is a pinned client version, not an automatic -update from the MES. Ensure this version matches the deployed MES. -For remote manifests/JARs, set `-Dhmi.workplace.source=remote` in the chosen GlassFish domain, -after inspecting existing JVM options. Remote mode still validates TLS and requires a valid CA chain. -Other configured JNLP filenames require remote mode. Bundled mode does not silently mix versions. +The application and MES must be same-origin or MES must allow the Workbench origin via CORS. +GlassFish must trust the TLS chain of the MES host to download the remote manifest/JARs. +The browser separately needs trust and connectivity to all MES-discovered service endpoints. +No TLS bypass or credential forwarding was added. Upstream failure is an error, not an archive fallback. -## Browser network requirements – NOT solved by local JAR packaging +Open `/backend/hmi/` and use the existing Workplace widget. For a full window after HMI login: +`/backend/hmi/cheerpj-runner.html?standalone=workplace` +CheerpJ 5.0 is loaded from its CDN; an appropriate license is required for business use. -Workplace directly calls MES ARTES services from the browser. Deploy Workbench on the SAME HTTPS -origin (scheme, host AND port) as MES, or configure the MES server to allow the actual Workbench -origin. The isolated localhost browser test observed CORS failures for `/mes/artes/settings`, -`/workbench/artes/settings` and `/help/artes/settings` and service discovery calls. -Cluster discovery can also return internal addresses (including 192.168.20.106 in the supplied -partner environment). Every returned endpoint must be reachable and have browser-trusted TLS; -a local WAR cannot fix the remote cluster topology. No TLS or browser security checks are disabled. +## Verification and limits -The shell HTTPS request to the partner JNLP failed certificate validation; Chromium could reach -initial cluster discovery. Browser and GlassFish trust stores need independent verification. +- Vue typecheck/Vite and Maven package: passed. +- New regression: same remote JAR filename changed from v1 to v2; after invalidation v2 is served. +- Missing remote server after invalidation raises an error; no old bytes used as fallback. +- No packaged manufacturer JAR bundle; unsafe XML rejected. +- Existing HTTP Range/cache, manifest and CheerpJ suites passed. +- The user reports the login works with the previous identity fix, retained here. +- No authenticated MES workflow, remote version compatibility or Windows-GlassFish deployment + has been end-to-end tested with this new build. The previous screenshot is NOT a new-build test. -CheerpJ runtime is loaded from `https://cjrtnc.leaningtech.com/5.0/loader.js` (HTTP 200 verified). -Business use requires an appropriate CheerpJ license; no license was purchased or supplied. -Native RXTX/serial drivers are not supported as desktop JNI in a browser. - -## JAAS / signed classes - -The original build enabled an unsigned `SysParameter` replacement before signed vendor JARs. -The archive confirms other signed classes share its package. The replacement is now OFF by default. -`sysparam=on` is an explicit diagnostic opt-in only; it is not a general production fix for signed -packages. The original JAAS native bridge remains. No vendor signatures or class bytes were changed. - -The same-origin browser test reproduced `Missing import: JVM_LoadLibrary` with native identity. -The runner now supplies `os.name=CheerpJ Browser` and `user.name=cheerpj-client` via -`cheerpjInit.javaProperties` and in the library context before vendor main(). Runtime-only -System.setProperty calls did NOT fix the separate application launch in the browser test. Bytecode inspection of the supplied original SysParameter confirms -that unrecognized OS names use its existing user.name fallback instead of loading desktop JAAS. -This is a synthetic local identity, NOT an authenticated MES user or OS SSO. Regular MES login -is still required. `identity=native` restores the old behavior for diagnosis. OS-specific integrations -need separate testing because the application sees a non-desktop operating system. - -## Rebuild and automated validation - -From the project root: - -```sh -bash build-hmi.sh -npm run test:cheerpj --prefix hmi-frontend -bash hmi-scripts/test-workplace-range.sh -bash hmi-scripts/test-workplace-cluster.sh -``` - -Build prerequisites: Python 3, Node/npm, Maven, JDK 11+ (`javac --release 11`). -`prepare-workplace.py` validates and stages the supplied archive; do not put `.workplace-bundle` -in source control. Build scripts work even when archive extraction removed executable bits. -JaCoCo is updated for the installed JDK 25; vendor JAR resources are excluded from application -coverage analysis (they contain duplicate vendor API classes). Application checks remain enabled. - -Verified: Vue typecheck/Vite build, Maven package, 2 new bundle tests, 18 Range/cache checks, -existing CheerpJ contract suites, all 129 final WAR JAR hashes. No authenticated MES login, -booking, full GlassFish deployment or database integration test has been performed. - -## Observed browser result - -Chromium + CheerpJ 5.0 + Java 11 rendered the Workplace main window AND the real MES login -form (user name, password, client 01, Login/Change password/Cancel) after initialization properties -were applied. Screenshot: `workplace-login.png`. The `JVM_LoadLibrary` startup blocker did not -recur in this run. No credentials were entered and no authenticated workflow was exercised. - -Test setup: Playwright locally fulfilled ONLY `/backend/**` from the built WAR/resources while -the page used the partner server origin; actual MES requests used the partner server. This models -same-origin deployment, but it is NOT proof of a GlassFish deployment or of HMI authentication. -The localhost-origin test separately exposed the expected CORS failures. The renderer test does -not certify all native desktop functions, resize behavior, printing or every Workplace module. +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. diff --git a/release/SHA256SUMS b/release/SHA256SUMS index bc561a8..c53bb88 100644 --- a/release/SHA256SUMS +++ b/release/SHA256SUMS @@ -1,3 +1,3 @@ -11d226ce0f80517f8e600dc2d2d3ca0109185ca6ee20bcb71ddfd45642dd0e22 backend-1.war -5e3fbb9ffc98f2f71ea29c0e38ef2f4b261a964efd7ce0571d20276a1fb21a71 WidgetWorkbench-source.zip -be3110d22d069336a0befda19886edb9c61f4c0bf41f3e34b985e72c6aa15f39 workplace-login.png +17e7b0651173237555d011874b248122f6fdcf81073115df9f8fad0efc72ed5b backend-1.war +536e5843a4104ac9466a3fd224de5dcadd973844c88d2ac5910a29ea8fc4ae90 WidgetWorkbench-source.zip +b5f84d0847526e301e08afb31885aed1ec4a009e3573b17b31e29d70f445b75b DEPLOYMENT.md diff --git a/release/WidgetWorkbench-source.zip b/release/WidgetWorkbench-source.zip index 94144f0..3633557 100644 Binary files a/release/WidgetWorkbench-source.zip and b/release/WidgetWorkbench-source.zip differ diff --git a/release/backend-1.war b/release/backend-1.war index 5874fdd..0e68ec9 100644 Binary files a/release/backend-1.war and b/release/backend-1.war differ