@mxtommy/kip 4.2.0 → 4.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.yml +84 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
- package/.github/copilot-instructions.md +1 -1
- package/.github/instructions/project.instructions.md +7 -1
- package/.github/workflows/ci.yml +37 -0
- package/CHANGELOG.md +10 -0
- package/package.json +42 -41
- package/plugin/index.js +2 -2
- package/public/3rdpartylicenses.txt +230 -76
- package/public/assets/svg/AtoN/cardinal/east_beacon.svg +21 -0
- package/public/assets/svg/AtoN/cardinal/east_mark.svg +30 -0
- package/public/assets/svg/AtoN/cardinal/north_beacon.svg +20 -0
- package/public/assets/svg/AtoN/cardinal/north_mark.svg +30 -0
- package/public/assets/svg/AtoN/cardinal/south_beacon.svg +20 -0
- package/public/assets/svg/AtoN/cardinal/south_mark.svg +30 -0
- package/public/assets/svg/AtoN/cardinal/west_beacon.svg +21 -0
- package/public/assets/svg/AtoN/cardinal/west_mark.svg +57 -0
- package/public/assets/svg/AtoN/dangerSafe/isolateddanger_beacon.svg +16 -0
- package/public/assets/svg/AtoN/dangerSafe/isolateddanger_mark.svg +30 -0
- package/public/assets/svg/AtoN/dangerSafe/safewater_beacon_.svg +15 -0
- package/public/assets/svg/AtoN/dangerSafe/safewater_mark.svg +43 -0
- package/public/assets/svg/AtoN/lateral/port_beacon.svg +6 -0
- package/public/assets/svg/AtoN/lateral/port_mark.svg +24 -0
- package/public/assets/svg/AtoN/lateral/port_prefered_beacon.svg +15 -0
- package/public/assets/svg/AtoN/lateral/port_prefered_mark.svg +44 -0
- package/public/assets/svg/AtoN/lateral/starboard_beacon.svg +6 -0
- package/public/assets/svg/AtoN/lateral/starboard_mark.svg +24 -0
- package/public/assets/svg/AtoN/lateral/starboard_prefered_beacon.svg +15 -0
- package/public/assets/svg/AtoN/lateral/starboard_prefered_mark.svg +48 -0
- package/public/assets/svg/AtoN/other/aton.svg +78 -0
- package/public/assets/svg/AtoN/other/basestation.svg +91 -0
- package/public/assets/svg/AtoN/other/unknown.svg +22 -0
- package/public/assets/svg/AtoN/special/special_beacon.svg +7 -0
- package/public/assets/svg/AtoN/special/special_mark.svg +20 -0
- package/public/assets/svg/Chart icons.md +28 -0
- package/public/assets/svg/aircraft/ais_sar-aircraft.svg +23 -0
- package/public/assets/svg/icons.svg +6 -0
- package/public/assets/svg/sar-distress-device/sart-eprib-mob.svg +35 -0
- package/public/assets/svg/vessel/buddy.svg +26 -0
- package/public/assets/svg/vessel/cargo.svg +20 -0
- package/public/assets/svg/vessel/diving-ops.svg +31 -0
- package/public/assets/svg/vessel/fishing.svg +20 -0
- package/public/assets/svg/vessel/highspeed.svg +24 -0
- package/public/assets/svg/vessel/law-enforcement.svg +24 -0
- package/public/assets/svg/vessel/military-ops.svg +60 -0
- package/public/assets/svg/vessel/other.svg +20 -0
- package/public/assets/svg/vessel/passenger.svg +20 -0
- package/public/assets/svg/vessel/pilot.svg +82 -0
- package/public/assets/svg/vessel/pleasurecraft.svg +20 -0
- package/public/assets/svg/vessel/sailing.svg +20 -0
- package/public/assets/svg/vessel/sar.svg +25 -0
- package/public/assets/svg/vessel/self.svg +67 -0
- package/public/assets/svg/vessel/stationary.svg +32 -0
- package/public/assets/svg/vessel/tanker.svg +20 -0
- package/public/assets/svg/vessel/tug.svg +20 -0
- package/public/assets/svg/vessel/unknown.svg +22 -0
- package/public/chunk-2KMYPGX4.js +2 -0
- package/public/{chunk-K6B4TD2H.js → chunk-4VUI3CY7.js} +2 -2
- package/public/{chunk-NL5QCOXT.js → chunk-5DLSQ773.js} +2 -2
- package/public/chunk-6OSCSQLJ.js +3 -0
- package/public/{chunk-5SCAJ637.js → chunk-7HLFWAA7.js} +1 -1
- package/public/chunk-BNIQFWQ6.js +62 -0
- package/public/chunk-C4OS6QP6.js +8 -0
- package/public/chunk-F7I3HKNJ.js +9 -0
- package/public/chunk-FGRB3BHZ.js +1 -0
- package/public/{chunk-XWOIVPRO.js → chunk-HJQQWPGC.js} +1 -1
- package/public/{chunk-FHQZULYJ.js → chunk-IWK4FHBL.js} +1 -1
- package/public/{chunk-2VPC34OU.js → chunk-J4IGUIZA.js} +6 -6
- package/public/{chunk-GDL5ORNF.js → chunk-KIR67PZ2.js} +1 -1
- package/public/chunk-KKJXPB75.js +8 -0
- package/public/chunk-MMIOUKLI.js +1 -0
- package/public/{chunk-WON6RAF5.js → chunk-PDYVZHOK.js} +1 -1
- package/public/chunk-PESXPDBT.js +2 -0
- package/public/chunk-PKATAZA2.js +1 -0
- package/public/chunk-PSF2OKKT.js +1 -0
- package/public/chunk-TGGJAGV7.js +15 -0
- package/public/chunk-TKC7ROZ7.js +4 -0
- package/public/{chunk-UUOWRIVR.js → chunk-UVAQADRE.js} +1 -1
- package/public/chunk-VH4ZIU4T.js +4 -0
- package/public/chunk-XEJJOWK6.js +2 -0
- package/public/chunk-YYXDMH5J.js +53 -0
- package/public/index.html +2 -2
- package/public/main-WAAIS2M6.js +1 -0
- package/public/polyfills-L4FJGPOC.js +2 -0
- package/public/{styles-7VM4HXM4.css → styles-DYEO23GZ.css} +1 -1
- package/public/chunk-36RQFRQN.js +0 -4
- package/public/chunk-3KBT35BP.js +0 -3
- package/public/chunk-4NAXE7SZ.js +0 -9
- package/public/chunk-6X3BMVOP.js +0 -8
- package/public/chunk-7SK25B6D.js +0 -1
- package/public/chunk-ATH26UZ7.js +0 -1
- package/public/chunk-CX4O7M4U.js +0 -63
- package/public/chunk-DWMZAC65.js +0 -1
- package/public/chunk-FGMEEOZH.js +0 -5
- package/public/chunk-MOEZSWFX.js +0 -15
- package/public/chunk-PJZLX3XW.js +0 -2
- package/public/chunk-PNFBM2CP.js +0 -1
- package/public/chunk-PVUOCOI5.js +0 -53
- package/public/chunk-SP4UPLYW.js +0 -4
- package/public/chunk-Y5TQMH7M.js +0 -2
- package/public/main-CRPMOYEB.js +0 -4
- package/public/polyfills-GNK4EEYZ.js +0 -2
package/public/chunk-36RQFRQN.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as ui,c as pi,f as hi,g as fi,h as gi,k as _i,m as Je}from"./chunk-FHQZULYJ.js";import{A as ci,d as Ut,w as ai,x as li}from"./chunk-FGMEEOZH.js";import{G as oi,O as di,P as mi,m as qt,q as ri,r as ni,w as si}from"./chunk-PJZLX3XW.js";import{a as $t,i as Me,m as ei,o as ti,p as ii,r as Ye,s as Xe,t as Te}from"./chunk-Y5TQMH7M.js";import{$d as We,Aa as kt,Ab as Ve,Ae as Zt,Ce as ke,Da as he,E as vt,Ea as Mt,Ec as Nt,Fb as te,Fd as zt,Ga as Tt,Gb as O,Gd as Ht,Hb as R,Hd as Vt,Ib as It,Id as Ge,J as ue,Ja as St,K as Fe,Lc as ve,Ld as Kt,Ma as Y,Nc as H,Oc as Be,Od as Bt,Pb as ie,Q as bt,Rb as z,Tb as X,Ub as Et,Ud as Gt,Vb as Ke,Vd as Wt,Wb as At,Wd as jt,Xa as P,Xb as ye,Xd as Q,Yb as L,Yd as Yt,Za as Ue,Zb as F,Zc as be,_d as Xt,a as $,ab as Ot,ae as Jt,ba as Ne,bc as Pt,ca as qe,d as cr,da as k,dc as J,e as dr,eb as Dt,fc as Rt,gc as re,ge as se,hc as ne,ib as fe,ie as je,jb as ge,k as B,kb as ze,la as wt,ma as pe,oa as G,ob as xt,qa as f,sc as Lt,tc as Ft,ud as we,va as q,vd as Ce,wa as U,xa as Ct,xb as _e,ye as Qt,z as Le,za as ee,zb as He}from"./chunk-MOEZSWFX.js";var yi=cr((Qe,Ze)=>{(function(c,S){typeof Qe=="object"&&typeof Ze<"u"?Ze.exports=S():typeof define=="function"&&define.amd?define(S):(c=typeof globalThis<"u"?globalThis:c||self,c.Qty=S())})(Qe,function(){"use strict";function c(t){return typeof t=="string"||t instanceof String}var S=Number.isFinite||window.isFinite;function e(t){return S(t)}function i(t){return t}function n(t){var r={};return t.filter(function(s){return r.hasOwnProperty(s)?!1:r[s]=!0})}function a(t,r){if(r.length!==t.length)return!1;for(var s=0;s<t.length;s++)if(r[s].compareArray&&!r[s].compareArray(t[s])||r[s]!==t[s])return!1;return!0}function d(t,r){Object.keys(r).forEach(function(s){t[s]=r[s]})}function g(){for(var t=1,r=0,s=0;s<arguments.length;s++){var o=arguments[s];r=r+it(o),t*=o}return r!==0?oe(t,r):t}function y(t,r){if(r===0)throw new Error("Divide by zero");var s=Math.pow(10,it(r)),o=s/(s*r);return g(t,o)}function oe(t,r){return Math.round(t*Math.pow(10,r))/Math.pow(10,r)}function it(t){if(!isFinite(t))return 0;for(var r=0;t%1!==0;)t*=10,r++;return r}function h(){var t;if(!this)return t=Object.create(h.prototype),h.apply(t,arguments),t;t=Error.apply(this,arguments),this.name="QtyError",this.message=t.message,this.stack=t.stack}h.prototype=Object.create(Error.prototype,{constructor:{value:h}});function Z(t,r){throw new h("Incompatible units: "+t+" and "+r)}var D={"<googol>":[["googol"],1e100,"prefix"],"<kibi>":[["Ki","Kibi","kibi"],Math.pow(2,10),"prefix"],"<mebi>":[["Mi","Mebi","mebi"],Math.pow(2,20),"prefix"],"<gibi>":[["Gi","Gibi","gibi"],Math.pow(2,30),"prefix"],"<tebi>":[["Ti","Tebi","tebi"],Math.pow(2,40),"prefix"],"<pebi>":[["Pi","Pebi","pebi"],Math.pow(2,50),"prefix"],"<exi>":[["Ei","Exi","exi"],Math.pow(2,60),"prefix"],"<zebi>":[["Zi","Zebi","zebi"],Math.pow(2,70),"prefix"],"<yebi>":[["Yi","Yebi","yebi"],Math.pow(2,80),"prefix"],"<yotta>":[["Y","Yotta","yotta"],1e24,"prefix"],"<zetta>":[["Z","Zetta","zetta"],1e21,"prefix"],"<exa>":[["E","Exa","exa"],1e18,"prefix"],"<peta>":[["P","Peta","peta"],1e15,"prefix"],"<tera>":[["T","Tera","tera"],1e12,"prefix"],"<giga>":[["G","Giga","giga"],1e9,"prefix"],"<mega>":[["M","Mega","mega"],1e6,"prefix"],"<kilo>":[["k","kilo"],1e3,"prefix"],"<hecto>":[["h","Hecto","hecto"],100,"prefix"],"<deca>":[["da","Deca","deca","deka"],10,"prefix"],"<deci>":[["d","Deci","deci"],.1,"prefix"],"<centi>":[["c","Centi","centi"],.01,"prefix"],"<milli>":[["m","Milli","milli"],.001,"prefix"],"<micro>":[["u","\u03BC","\xB5","Micro","mc","micro"],1e-6,"prefix"],"<nano>":[["n","Nano","nano"],1e-9,"prefix"],"<pico>":[["p","Pico","pico"],1e-12,"prefix"],"<femto>":[["f","Femto","femto"],1e-15,"prefix"],"<atto>":[["a","Atto","atto"],1e-18,"prefix"],"<zepto>":[["z","Zepto","zepto"],1e-21,"prefix"],"<yocto>":[["y","Yocto","yocto"],1e-24,"prefix"],"<1>":[["1","<1>"],1,""],"<meter>":[["m","meter","meters","metre","metres"],1,"length",["<meter>"]],"<inch>":[["in","inch","inches",'"'],.0254,"length",["<meter>"]],"<foot>":[["ft","foot","feet","'"],.3048,"length",["<meter>"]],"<yard>":[["yd","yard","yards"],.9144,"length",["<meter>"]],"<mile>":[["mi","mile","miles"],1609.344,"length",["<meter>"]],"<naut-mile>":[["nmi","naut-mile"],1852,"length",["<meter>"]],"<league>":[["league","leagues"],4828,"length",["<meter>"]],"<furlong>":[["furlong","furlongs"],201.2,"length",["<meter>"]],"<rod>":[["rd","rod","rods"],5.029,"length",["<meter>"]],"<mil>":[["mil","mils"],254e-7,"length",["<meter>"]],"<angstrom>":[["ang","angstrom","angstroms"],1e-10,"length",["<meter>"]],"<fathom>":[["fathom","fathoms"],1.829,"length",["<meter>"]],"<pica>":[["pica","picas"],.00423333333,"length",["<meter>"]],"<point>":[["pt","point","points"],.000352777778,"length",["<meter>"]],"<redshift>":[["z","red-shift","redshift"],1302773e20,"length",["<meter>"]],"<AU>":[["AU","astronomical-unit"],1495979e5,"length",["<meter>"]],"<light-second>":[["ls","light-second"],299792500,"length",["<meter>"]],"<light-minute>":[["lmin","light-minute"],1798755e4,"length",["<meter>"]],"<light-year>":[["ly","light-year"],9460528e9,"length",["<meter>"]],"<parsec>":[["pc","parsec","parsecs"],3085678e10,"length",["<meter>"]],"<datamile>":[["DM","datamile"],1828.8,"length",["<meter>"]],"<kilogram>":[["kg","kilogram","kilograms"],1,"mass",["<kilogram>"]],"<AMU>":[["u","AMU","amu"],1660538921e-36,"mass",["<kilogram>"]],"<dalton>":[["Da","Dalton","Daltons","dalton","daltons"],1660538921e-36,"mass",["<kilogram>"]],"<slug>":[["slug","slugs"],14.5939029,"mass",["<kilogram>"]],"<short-ton>":[["tn","ton","short-ton"],907.18474,"mass",["<kilogram>"]],"<metric-ton>":[["t","tonne","metric-ton"],1e3,"mass",["<kilogram>"]],"<carat>":[["ct","carat","carats"],2e-4,"mass",["<kilogram>"]],"<pound>":[["lbs","lb","pound","pounds","#"],.45359237,"mass",["<kilogram>"]],"<ounce>":[["oz","ounce","ounces"],.0283495231,"mass",["<kilogram>"]],"<gram>":[["g","gram","grams","gramme","grammes"],.001,"mass",["<kilogram>"]],"<grain>":[["grain","grains","gr"],6479891e-11,"mass",["<kilogram>"]],"<dram>":[["dram","drams","dr"],.0017718452,"mass",["<kilogram>"]],"<stone>":[["stone","stones","st"],6.35029318,"mass",["<kilogram>"]],"<hectare>":[["hectare"],1e4,"area",["<meter>","<meter>"]],"<acre>":[["acre","acres"],4046.85642,"area",["<meter>","<meter>"]],"<sqft>":[["sqft"],1,"area",["<foot>","<foot>"]],"<liter>":[["l","L","liter","liters","litre","litres"],.001,"volume",["<meter>","<meter>","<meter>"]],"<gallon>":[["gal","gallon","gallons"],.0037854118,"volume",["<meter>","<meter>","<meter>"]],"<gallon-imp>":[["galimp","gallon-imp","gallons-imp"],.00454609,"volume",["<meter>","<meter>","<meter>"]],"<quart>":[["qt","quart","quarts"],.00094635295,"volume",["<meter>","<meter>","<meter>"]],"<pint>":[["pt","pint","pints"],.000473176475,"volume",["<meter>","<meter>","<meter>"]],"<pint-imp>":[["ptimp","pint-imp","pints-imp"],.00056826125,"volume",["<meter>","<meter>","<meter>"]],"<cup>":[["cu","cup","cups"],.000236588238,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce>":[["floz","fluid-ounce","fluid-ounces"],295735297e-13,"volume",["<meter>","<meter>","<meter>"]],"<fluid-ounce-imp>":[["flozimp","floz-imp","fluid-ounce-imp","fluid-ounces-imp"],284130625e-13,"volume",["<meter>","<meter>","<meter>"]],"<tablespoon>":[["tb","tbsp","tbs","tablespoon","tablespoons"],147867648e-13,"volume",["<meter>","<meter>","<meter>"]],"<teaspoon>":[["tsp","teaspoon","teaspoons"],492892161e-14,"volume",["<meter>","<meter>","<meter>"]],"<bushel>":[["bu","bsh","bushel","bushels"],.035239072,"volume",["<meter>","<meter>","<meter>"]],"<oilbarrel>":[["bbl","oilbarrel","oilbarrels","oil-barrel","oil-barrels"],.158987294928,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel>":[["bl","bl-us","beerbarrel","beerbarrels","beer-barrel","beer-barrels"],.1173477658,"volume",["<meter>","<meter>","<meter>"]],"<beerbarrel-imp>":[["blimp","bl-imp","beerbarrel-imp","beerbarrels-imp","beer-barrel-imp","beer-barrels-imp"],.16365924,"volume",["<meter>","<meter>","<meter>"]],"<kph>":[["kph"],.277777778,"speed",["<meter>"],["<second>"]],"<mph>":[["mph"],.44704,"speed",["<meter>"],["<second>"]],"<knot>":[["kt","kn","kts","knot","knots"],.514444444,"speed",["<meter>"],["<second>"]],"<fps>":[["fps"],.3048,"speed",["<meter>"],["<second>"]],"<gee>":[["gee"],9.80665,"acceleration",["<meter>"],["<second>","<second>"]],"<Gal>":[["Gal"],.01,"acceleration",["<meter>"],["<second>","<second>"]],"<kelvin>":[["degK","kelvin"],1,"temperature",["<kelvin>"]],"<celsius>":[["degC","celsius","celsius","centigrade"],1,"temperature",["<kelvin>"]],"<fahrenheit>":[["degF","fahrenheit"],5/9,"temperature",["<kelvin>"]],"<rankine>":[["degR","rankine"],5/9,"temperature",["<kelvin>"]],"<temp-K>":[["tempK","temp-K"],1,"temperature",["<temp-K>"]],"<temp-C>":[["tempC","temp-C"],1,"temperature",["<temp-K>"]],"<temp-F>":[["tempF","temp-F"],5/9,"temperature",["<temp-K>"]],"<temp-R>":[["tempR","temp-R"],5/9,"temperature",["<temp-K>"]],"<second>":[["s","sec","secs","second","seconds"],1,"time",["<second>"]],"<minute>":[["min","mins","minute","minutes"],60,"time",["<second>"]],"<hour>":[["h","hr","hrs","hour","hours"],3600,"time",["<second>"]],"<day>":[["d","day","days"],3600*24,"time",["<second>"]],"<week>":[["wk","week","weeks"],7*3600*24,"time",["<second>"]],"<fortnight>":[["fortnight","fortnights"],1209600,"time",["<second>"]],"<year>":[["y","yr","year","years","annum"],31556926,"time",["<second>"]],"<decade>":[["decade","decades"],315569260,"time",["<second>"]],"<century>":[["century","centuries"],3155692600,"time",["<second>"]],"<pascal>":[["Pa","pascal","Pascal"],1,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<bar>":[["bar","bars"],1e5,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<mmHg>":[["mmHg"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inHg>":[["inHg"],3386.3881472,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<torr>":[["torr"],133.322368,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<atm>":[["atm","ATM","atmosphere","atmospheres"],101325,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<psi>":[["psi"],6894.76,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<cmh2o>":[["cmH2O","cmh2o"],98.0638,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<inh2o>":[["inH2O","inh2o"],249.082052,"pressure",["<kilogram>"],["<meter>","<second>","<second>"]],"<poise>":[["P","poise"],.1,"viscosity",["<kilogram>"],["<meter>","<second>"]],"<stokes>":[["St","stokes"],1e-4,"viscosity",["<meter>","<meter>"],["<second>"]],"<mole>":[["mol","mole"],1,"substance",["<mole>"]],"<molar>":[["M","molar"],1e3,"molar_concentration",["<mole>"],["<meter>","<meter>","<meter>"]],"<wtpercent>":[["wt%","wtpercent"],10,"molar_concentration",["<kilogram>"],["<meter>","<meter>","<meter>"]],"<katal>":[["kat","katal","Katal"],1,"activity",["<mole>"],["<second>"]],"<unit>":[["U","enzUnit","unit"],16667e-19,"activity",["<mole>"],["<second>"]],"<farad>":[["F","farad","Farad"],1,"capacitance",["<second>","<second>","<second>","<second>","<ampere>","<ampere>"],["<meter>","<meter>","<kilogram>"]],"<coulomb>":[["C","coulomb","Coulomb"],1,"charge",["<ampere>","<second>"]],"<Ah>":[["Ah"],3600,"charge",["<ampere>","<second>"]],"<ampere>":[["A","Ampere","ampere","amp","amps"],1,"current",["<ampere>"]],"<siemens>":[["S","Siemens","siemens"],1,"conductance",["<second>","<second>","<second>","<ampere>","<ampere>"],["<kilogram>","<meter>","<meter>"]],"<henry>":[["H","Henry","henry"],1,"inductance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>","<ampere>"]],"<volt>":[["V","Volt","volt","volts"],1,"potential",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>"]],"<ohm>":[["Ohm","ohm","\u03A9","\u2126"],1,"resistance",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<second>","<ampere>","<ampere>"]],"<weber>":[["Wb","weber","webers"],1,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<tesla>":[["T","tesla","teslas"],1,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<gauss>":[["G","gauss"],1e-4,"magnetism",["<kilogram>"],["<second>","<second>","<ampere>"]],"<maxwell>":[["Mx","maxwell","maxwells"],1e-8,"magnetism",["<meter>","<meter>","<kilogram>"],["<second>","<second>","<ampere>"]],"<oersted>":[["Oe","oersted","oersteds"],250/Math.PI,"magnetism",["<ampere>"],["<meter>"]],"<joule>":[["J","joule","Joule","joules","Joules"],1,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<erg>":[["erg","ergs"],1e-7,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<btu>":[["BTU","btu","BTUs"],1055.056,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<calorie>":[["cal","calorie","calories"],4.184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Calorie>":[["Cal","Calorie","Calories"],4184,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<therm-US>":[["th","therm","therms","Therm","therm-US"],105480400,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<Wh>":[["Wh"],3600,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<electronvolt>":[["eV","electronvolt","electronvolts"],1602176634e-28,"energy",["<meter>","<meter>","<kilogram>"],["<second>","<second>"]],"<newton>":[["N","Newton","newton"],1,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<dyne>":[["dyn","dyne"],1e-5,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<pound-force>":[["lbf","pound-force"],4.448222,"force",["<kilogram>","<meter>"],["<second>","<second>"]],"<hertz>":[["Hz","hertz","Hertz"],1,"frequency",["<1>"],["<second>"]],"<radian>":[["rad","radian","radians"],1,"angle",["<radian>"]],"<degree>":[["deg","degree","degrees"],Math.PI/180,"angle",["<radian>"]],"<arcminute>":[["arcmin","arcminute","arcminutes"],Math.PI/10800,"angle",["<radian>"]],"<arcsecond>":[["arcsec","arcsecond","arcseconds"],Math.PI/648e3,"angle",["<radian>"]],"<gradian>":[["gon","grad","gradian","grads"],Math.PI/200,"angle",["<radian>"]],"<steradian>":[["sr","steradian","steradians"],1,"solid_angle",["<steradian>"]],"<rotation>":[["rotation"],2*Math.PI,"angle",["<radian>"]],"<rpm>":[["rpm"],2*Math.PI/60,"angular_velocity",["<radian>"],["<second>"]],"<byte>":[["B","byte","bytes"],1,"information",["<byte>"]],"<bit>":[["b","bit","bits"],.125,"information",["<byte>"]],"<Bps>":[["Bps"],1,"information_rate",["<byte>"],["<second>"]],"<bps>":[["bps"],.125,"information_rate",["<byte>"],["<second>"]],"<dollar>":[["USD","dollar"],1,"currency",["<dollar>"]],"<cents>":[["cents"],.01,"currency",["<dollar>"]],"<candela>":[["cd","candela"],1,"luminosity",["<candela>"]],"<lumen>":[["lm","lumen"],1,"luminous_power",["<candela>","<steradian>"]],"<lux>":[["lux"],1,"illuminance",["<candela>","<steradian>"],["<meter>","<meter>"]],"<watt>":[["W","watt","watts"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere>":[["VA","volt-ampere"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<volt-ampere-reactive>":[["var","Var","VAr","VAR","volt-ampere-reactive"],1,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<horsepower>":[["hp","horsepower"],745.699872,"power",["<kilogram>","<meter>","<meter>"],["<second>","<second>","<second>"]],"<gray>":[["Gy","gray","grays"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<roentgen>":[["R","roentgen"],.00933,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<sievert>":[["Sv","sievert","sieverts"],1,"radiation",["<meter>","<meter>"],["<second>","<second>"]],"<becquerel>":[["Bq","becquerel","becquerels"],1,"radiation",["<1>"],["<second>"]],"<curie>":[["Ci","curie","curies"],37e9,"radiation",["<1>"],["<second>"]],"<cpm>":[["cpm"],1/60,"rate",["<count>"],["<second>"]],"<dpm>":[["dpm"],1/60,"rate",["<count>"],["<second>"]],"<bpm>":[["bpm"],1/60,"rate",["<count>"],["<second>"]],"<dot>":[["dot","dots"],1,"resolution",["<each>"]],"<pixel>":[["pixel","px"],1,"resolution",["<each>"]],"<ppi>":[["ppi"],1,"resolution",["<pixel>"],["<inch>"]],"<dpi>":[["dpi"],1,"typography",["<dot>"],["<inch>"]],"<cell>":[["cells","cell"],1,"counting",["<each>"]],"<each>":[["each"],1,"counting",["<each>"]],"<count>":[["count"],1,"counting",["<each>"]],"<base-pair>":[["bp","base-pair"],1,"counting",["<each>"]],"<nucleotide>":[["nt","nucleotide"],1,"counting",["<each>"]],"<molecule>":[["molecule","molecules"],1,"counting",["<1>"]],"<dozen>":[["doz","dz","dozen"],12,"prefix_only",["<each>"]],"<percent>":[["%","percent"],.01,"prefix_only",["<1>"]],"<ppm>":[["ppm"],1e-6,"prefix_only",["<1>"]],"<ppb>":[["ppb"],1e-9,"prefix_only",["<1>"]],"<ppt>":[["ppt"],1e-12,"prefix_only",["<1>"]],"<ppq>":[["ppq"],1e-15,"prefix_only",["<1>"]],"<gross>":[["gr","gross"],144,"prefix_only",["<dozen>","<dozen>"]],"<decibel>":[["dB","decibel","decibels"],1,"logarithmic",["<decibel>"]]},xi=["<meter>","<kilogram>","<second>","<mole>","<ampere>","<radian>","<kelvin>","<temp-K>","<byte>","<dollar>","<candela>","<each>","<steradian>","<decibel>"],ae="<1>",w=[ae];function Ii(t,r){var s=r[1],o=r[3]||[],l=r[4]||[];if(!e(s))throw new h(t+": Invalid unit definition. 'scalar' must be a number");o.forEach(function(m){if(D[m]===void 0)throw new h(t+": Invalid unit definition. Unit "+m+" in 'numerator' is not recognized")}),l.forEach(function(m){if(D[m]===void 0)throw new h(t+": Invalid unit definition. Unit "+m+" in 'denominator' is not recognized")})}var A={},le={},M={},W={},ce={};for(var N in D)if(D.hasOwnProperty(N)){var x=D[N];if(x[2]==="prefix"){A[N]=x[1];for(var Se=0;Se<x[0].length;Se++)le[x[0][Se]]=N}else{Ii(N,x),M[N]={scalar:x[1],numerator:x[3],denominator:x[4]};for(var Oe=0;Oe<x[0].length;Oe++)W[x[0][Oe]]=N}ce[N]=x[0][0]}function Ei(t){var r,s=[],o=Object.keys(D);if(typeof t>"u")for(r=0;r<o.length;r++)["","prefix"].indexOf(D[o[r]][2])===-1&&s.push(o[r].substr(1,o[r].length-2));else{if(this.getKinds().indexOf(t)===-1)throw new h("Kind not recognized");for(r=0;r<o.length;r++)D[o[r]][2]===t&&s.push(o[r].substr(1,o[r].length-2))}return s.sort(function(l,m){return l.toLowerCase()<m.toLowerCase()?-1:l.toLowerCase()>m.toLowerCase()?1:0})}function Ai(t){if(!W[t])throw new h("Unit not recognized");return D[W[t]][0]}var De=["length","time","temperature","mass","current","substance","luminosity","currency","information","angle"];function Pi(){if(this.signature)return this.signature;for(var t=rt.call(this),r=0;r<t.length;r++)t[r]*=Math.pow(20,r);return t.reduce(function(s,o){return s+o},0)}function rt(){if(!this.isBase())return rt.call(this.toBase());for(var t=new Array(De.length),r=0;r<t.length;r++)t[r]=0;for(var s,o,l=0;l<this.numerator.length;l++)(s=D[this.numerator[l]])&&(o=De.indexOf(s[2]),o>=0&&(t[o]=t[o]+1));for(var m=0;m<this.denominator.length;m++)(s=D[this.denominator[m]])&&(o=De.indexOf(s[2]),o>=0&&(t[o]=t[o]-1));return t}var nt="[+-]",xe="\\d+",Ri=nt+"?"+xe,st="\\."+xe,Li="(?:"+xe+"(?:"+st+")?)|(?:"+st+")",Fi="[Ee]"+Ri,Ni="(?:"+Li+")(?:"+Fi+")?",qi=nt+"?\\s*"+Ni,Ui="("+qi+")?\\s*([^/]*)(?:/(.+))?",zi=new RegExp("^"+Ui+"$"),ot="\\^|\\*{2}",at="[01234]",Hi=new RegExp("([^ \\*\\d]+?)(?:"+ot+")?(-?"+at+"(?![a-zA-Z]))"),Vi=new RegExp("([^ \\*\\d]+?)(?:"+ot+")?("+at+"(?![a-zA-Z]))");function lt(t){c(t)||(t=t.toString()),t=t.trim();var r=zi.exec(t);if(!r)throw new h(t+": Quantity not recognized");var s=r[1];s?(s=s.replace(/\s/g,""),this.scalar=parseFloat(s)):this.scalar=1;for(var o=r[2],l=r[3],m,v,_;r=Hi.exec(o);){if(m=parseFloat(r[2]),isNaN(m))throw new h("Unit exponent is not a number");if(m===0&&!Ie.test(r[1]))throw new h("Unit not recognized");v=r[1]+" ",_="";for(var b=0;b<Math.abs(m);b++)_+=v;m>=0?o=o.replace(r[0],_):(l=l?l+_:_,o=o.replace(r[0],""))}for(;r=Vi.exec(l);){if(m=parseFloat(r[2]),isNaN(m))throw new h("Unit exponent is not a number");if(m===0&&!Ie.test(r[1]))throw new h("Unit not recognized");v=r[1]+" ",_="";for(var T=0;T<m;T++)_+=v;l=l.replace(r[0],_)}o&&(this.numerator=mt(o.trim())),l&&(this.denominator=mt(l.trim()))}var Ki=Object.keys(le).sort(function(t,r){return r.length-t.length}).join("|"),Bi=Object.keys(W).sort(function(t,r){return r.length-t.length}).join("|"),Gi="\\b|$",ct="("+Ki+")??("+Bi+")(?:"+Gi+")",Ie=new RegExp("^\\s*("+ct+"[\\s\\*]*)+$"),Wi=new RegExp(ct,"g"),dt={};function mt(t){var r=dt[t];if(r)return r;var s,o=[];if(!Ie.test(t))throw new h("Unit not recognized");for(;s=Wi.exec(t);)o.push(s.slice(1));return o=o.map(function(l){return le[l[0]]?[le[l[0]],W[l[1]]]:[W[l[1]]]}),o=o.reduce(function(l,m){return l.concat(m)},[]),o=o.filter(function(l){return l}),dt[t]=o,o}function ji(t){if(!c(t))throw new h("Argument should be a string");try{return this(t)}catch{return null}}function de(t){return t instanceof u}function u(t,r){if(Yi.apply(null,arguments),!de(this))return new u(t,r);if(this.scalar=null,this.baseScalar=null,this.signature=null,this._conversionCache={},this.numerator=w,this.denominator=w,ut(t)?(this.scalar=t.scalar,this.numerator=t.numerator&&t.numerator.length!==0?t.numerator:w,this.denominator=t.denominator&&t.denominator.length!==0?t.denominator:w):r?(lt.call(this,r),this.scalar=t):lt.call(this,t),this.denominator.join("*").indexOf("temp")>=0)throw new h("Cannot divide with temperatures");if(this.numerator.join("*").indexOf("temp")>=0){if(this.numerator.length>1)throw new h("Cannot multiply by temperatures");if(!a(this.denominator,w))throw new h("Cannot divide with temperatures")}if(this.initValue=t,Xi.call(this),this.isTemperature()&&this.baseScalar<0)throw new h("Temperatures must not be less than absolute zero")}u.prototype={constructor:u};function Yi(t,r){if(r){if(!(e(t)&&c(r)))throw new h("Only number accepted as initialization value when units are explicitly provided")}else if(!(c(t)||e(t)||de(t)||ut(t)))throw new h("Only string, number or quantity accepted as single initialization value")}function ut(t){return t&&typeof t=="object"&&t.hasOwnProperty("scalar")}function Xi(){if(this.baseScalar)return this.baseScalar;if(this.isBase())this.baseScalar=this.scalar,this.signature=Pi.call(this);else{var t=this.toBase();this.baseScalar=t.scalar,this.signature=t.signature}}var Ee={"-312078":"elastance","-312058":"resistance","-312038":"inductance","-152058":"potential","-152040":"magnetism","-152038":"magnetism","-7997":"specific_volume","-79":"snap","-59":"jolt","-39":"acceleration","-38":"radiation","-20":"frequency","-19":"speed","-18":"viscosity","-17":"volumetric_flow","-1":"wavenumber",0:"unitless",1:"length",2:"area",3:"volume",20:"time",400:"temperature",7941:"yank",7942:"power",7959:"pressure",7961:"force",7962:"energy",7979:"viscosity",7981:"momentum",7982:"angular_momentum",7997:"density",7998:"area_density",8e3:"mass",152020:"radiation_exposure",159999:"magnetism",16e4:"current",160020:"charge",312058:"conductance",312078:"capacitance",3199980:"activity",3199997:"molar_concentration",32e5:"substance",63999998:"illuminance",64e6:"luminous_power",128e7:"currency","25599999980":"information_rate","25600000000":"information","511999999980":"angular_velocity","512000000000":"angle"};function Ji(){return n(Object.keys(Ee).map(function(t){return Ee[t]}))}u.prototype.kind=function(){return Ee[this.signature.toString()]},d(u.prototype,{isDegrees:function(){return(this.signature===null||this.signature===400)&&this.numerator.length===1&&a(this.denominator,w)&&(this.numerator[0].match(/<temp-[CFRK]>/)||this.numerator[0].match(/<(kelvin|celsius|rankine|fahrenheit)>/))},isTemperature:function(){return this.isDegrees()&&this.numerator[0].match(/<temp-[CFRK]>/)}});function Qi(t,r){var s=t.units(),o=r.to(s),l=u(Ae(s));return u({scalar:t.scalar-o.scalar,numerator:l.numerator,denominator:l.denominator})}function Zi(t,r){var s=r.to(Ae(t.units()));return u({scalar:t.scalar-s.scalar,numerator:t.numerator,denominator:t.denominator})}function pt(t,r){var s=r.to(Ae(t.units()));return u({scalar:t.scalar+s.scalar,numerator:t.numerator,denominator:t.denominator})}function Ae(t){if(t==="tempK")return"degK";if(t==="tempC")return"degC";if(t==="tempF")return"degF";if(t==="tempR")return"degR";throw new h("Unknown type for temp conversion from: "+t)}function $i(t,r){var s=er(t),o=r.units(),l;if(o==="degK")l=s.scalar;else if(o==="degC")l=s.scalar;else if(o==="degF")l=s.scalar*9/5;else if(o==="degR")l=s.scalar*9/5;else throw new h("Unknown type for degree conversion to: "+o);return u({scalar:l,numerator:r.numerator,denominator:r.denominator})}function er(t){var r=t.units(),s;if(r.match(/(deg)[CFRK]/))s=t.baseScalar;else if(r==="tempK")s=t.scalar;else if(r==="tempC")s=t.scalar;else if(r==="tempF")s=t.scalar*5/9;else if(r==="tempR")s=t.scalar*5/9;else throw new h("Unknown type for temp conversion from: "+r);return u({scalar:s,numerator:["<kelvin>"],denominator:w})}function tr(t,r){var s=r.units(),o;if(s==="tempK")o=t.baseScalar;else if(s==="tempC")o=t.baseScalar-273.15;else if(s==="tempF")o=t.baseScalar*9/5-459.67;else if(s==="tempR")o=t.baseScalar*9/5;else throw new h("Unknown type for temp conversion to: "+s);return u({scalar:o,numerator:r.numerator,denominator:r.denominator})}function ir(t){var r=t.units(),s;if(r.match(/(deg)[CFRK]/))s=t.baseScalar;else if(r==="tempK")s=t.scalar;else if(r==="tempC")s=t.scalar+273.15;else if(r==="tempF")s=(t.scalar+459.67)*5/9;else if(r==="tempR")s=t.scalar*5/9;else throw new h("Unknown type for temp conversion from: "+r);return u({scalar:s,numerator:["<temp-K>"],denominator:w})}d(u.prototype,{to:function(t){var r,s;if(t==null)return this;if(!c(t))return this.to(t.units());if(r=this._conversionCache[t],r)return r;if(s=u(t),s.units()===this.units())return this;if(!this.isCompatible(s))this.isInverse(s)?s=this.inverse().to(t):Z(this.units(),s.units());else if(s.isTemperature())s=tr(this,s);else if(s.isDegrees())s=$i(this,s);else{var o=y(this.baseScalar,s.baseScalar);s=u({scalar:o,numerator:s.numerator,denominator:s.denominator})}return this._conversionCache[t]=s,s},toBase:function(){if(this.isBase())return this;if(this.isTemperature())return ir(this);var t=ht[this.units()];return t||(t=nr(this.numerator,this.denominator),ht[this.units()]=t),t.mul(this.scalar)},toFloat:function(){if(this.isUnitless())return this.scalar;throw new h("Can't convert to Float unless unitless. Use Unit#scalar")},toPrec:function(t){if(c(t)&&(t=u(t)),e(t)&&(t=u(t+" "+this.units())),this.isUnitless()?t.isUnitless()||Z(this.units(),t.units()):t=t.to(this.units()),t.scalar===0)throw new h("Divide by zero");var r=g(Math.round(this.scalar/t.scalar),t.scalar);return u(r+this.units())}});function rr(t,r){var s=u(t),o=u(r);if(s.eq(o))return i;var l;return s.isTemperature()?l=function(m){return s.mul(m).to(o).scalar}:l=function(m){return m*s.baseScalar/o.baseScalar},function(v){var _,b,T;if(Array.isArray(v)){for(b=v.length,T=[],_=0;_<b;_++)T.push(l(v[_]));return T}else return l(v)}}var ht={};function nr(t,r){for(var s=[],o=[],l=1,m,v=0;v<t.length;v++)m=t[v],A[m]?l=g(l,A[m]):M[m]&&(l*=M[m].scalar,M[m].numerator&&s.push(M[m].numerator),M[m].denominator&&o.push(M[m].denominator));for(var _=0;_<r.length;_++)m=r[_],A[m]?l/=A[m]:M[m]&&(l/=M[m].scalar,M[m].numerator&&o.push(M[m].numerator),M[m].denominator&&s.push(M[m].denominator));return s=s.reduce(function(b,T){return b.concat(T)},[]),o=o.reduce(function(b,T){return b.concat(T)},[]),u({scalar:l,numerator:s,denominator:o})}u.parse=ji,u.getUnits=Ei,u.getAliases=Ai,u.mulSafe=g,u.divSafe=y,u.getKinds=Ji,u.swiftConverter=rr,u.Error=h,d(u.prototype,{add:function(t){if(c(t)&&(t=u(t)),this.isCompatible(t)||Z(this.units(),t.units()),this.isTemperature()&&t.isTemperature())throw new h("Cannot add two temperatures");return this.isTemperature()?pt(this,t):t.isTemperature()?pt(t,this):u({scalar:this.scalar+t.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},sub:function(t){if(c(t)&&(t=u(t)),this.isCompatible(t)||Z(this.units(),t.units()),this.isTemperature()&&t.isTemperature())return Qi(this,t);if(this.isTemperature())return Zi(this,t);if(t.isTemperature())throw new h("Cannot subtract a temperature from a differential degree unit");return u({scalar:this.scalar-t.to(this).scalar,numerator:this.numerator,denominator:this.denominator})},mul:function(t){if(e(t))return u({scalar:g(this.scalar,t),numerator:this.numerator,denominator:this.denominator});if(c(t)&&(t=u(t)),(this.isTemperature()||t.isTemperature())&&!(this.isUnitless()||t.isUnitless()))throw new h("Cannot multiply by temperatures");var r=this,s=t;r.isCompatible(s)&&r.signature!==400&&(s=s.to(r));var o=ft(r.numerator,r.denominator,s.numerator,s.denominator);return u({scalar:g(r.scalar,s.scalar,o[2]),numerator:o[0],denominator:o[1]})},div:function(t){if(e(t)){if(t===0)throw new h("Divide by zero");return u({scalar:this.scalar/t,numerator:this.numerator,denominator:this.denominator})}else c(t)&&(t=u(t));if(t.scalar===0)throw new h("Divide by zero");if(t.isTemperature())throw new h("Cannot divide with temperatures");if(this.isTemperature()&&!t.isUnitless())throw new h("Cannot divide with temperatures");var r=this,s=t;r.isCompatible(s)&&r.signature!==400&&(s=s.to(r));var o=ft(r.numerator,r.denominator,s.denominator,s.numerator);return u({scalar:g(r.scalar,o[2])/s.scalar,numerator:o[0],denominator:o[1]})},inverse:function(){if(this.isTemperature())throw new h("Cannot divide with temperatures");if(this.scalar===0)throw new h("Divide by zero");return u({scalar:1/this.scalar,numerator:this.denominator,denominator:this.numerator})}});function ft(t,r,s,o){function l(I){return I!==ae}t=t.filter(l),s=s.filter(l),r=r.filter(l),o=o.filter(l);var m={};function v(I,V){for(var E,me,Re,K=0;K<I.length;K++)if(A[I[K]]?(E=I[K+1],me=I[K],Re=A[me],K++):(E=I[K],me=null,Re=1),E&&E!==ae)if(m[E]){m[E][0]+=V;var lr=m[E][2]?A[m[E][2]]:1;m[E][V===1?3:4]*=y(Re,lr)}else m[E]=[V,E,me,1,1]}v(t,1),v(r,-1),v(s,1),v(o,-1);var _=[],b=[],T=1;for(var yt in m)if(m.hasOwnProperty(yt)){var C=m[yt],j;if(C[0]>0)for(j=0;j<C[0];j++)_.push(C[2]===null?C[1]:[C[2],C[1]]);else if(C[0]<0)for(j=0;j<-C[0];j++)b.push(C[2]===null?C[1]:[C[2],C[1]]);T*=y(C[3],C[4])}return _.length===0&&(_=w),b.length===0&&(b=w),_=_.reduce(function(I,V){return I.concat(V)},[]),b=b.reduce(function(I,V){return I.concat(V)},[]),[_,b,T]}d(u.prototype,{eq:function(t){return this.compareTo(t)===0},lt:function(t){return this.compareTo(t)===-1},lte:function(t){return this.eq(t)||this.lt(t)},gt:function(t){return this.compareTo(t)===1},gte:function(t){return this.eq(t)||this.gt(t)},compareTo:function(t){if(c(t))return this.compareTo(u(t));if(this.isCompatible(t)||Z(this.units(),t.units()),this.baseScalar<t.baseScalar)return-1;if(this.baseScalar===t.baseScalar)return 0;if(this.baseScalar>t.baseScalar)return 1},same:function(t){return this.scalar===t.scalar&&this.units()===t.units()}}),d(u.prototype,{isUnitless:function(){return[this.numerator,this.denominator].every(function(t){return a(t,w)})},isCompatible:function(t){return c(t)?this.isCompatible(u(t)):de(t)&&t.signature!==void 0?this.signature===t.signature:!1},isInverse:function(t){return this.inverse().isCompatible(t)},isBase:function(){return this._isBase!==void 0?this._isBase:this.isDegrees()&&this.numerator[0].match(/<(kelvin|temp-K)>/)?(this._isBase=!0,this._isBase):(this.numerator.concat(this.denominator).forEach(function(t){t!==ae&&xi.indexOf(t)===-1&&(this._isBase=!1)},this),this._isBase===!1?this._isBase:(this._isBase=!0,this._isBase))}});function Pe(){}Pe.prototype.get=function(t){return arguments.length>1&&(t=Array.apply(null,arguments)),t.reduce(function(r,s,o){if(r){var l=r[s];return o===t.length-1?l?l.data:void 0:l}},this)},Pe.prototype.set=function(t,r){return arguments.length>2&&(t=Array.prototype.slice.call(arguments,0,-1),r=arguments[arguments.length-1]),t.reduce(function(s,o,l){var m=s[o];return m===void 0&&(m=s[o]={}),l===t.length-1?(m.data=r,r):m},this)};function sr(t,r){return(t+" "+r).trim()}u.formatter=sr,d(u.prototype,{units:function(){if(this._units!==void 0)return this._units;var t=a(this.numerator,w),r=a(this.denominator,w);if(t&&r)return this._units="",this._units;var s=_t(this.numerator),o=_t(this.denominator);return this._units=s+(r?"":"/"+o),this._units},toString:function(t,r){var s;if(e(t))s=this.units(),r=t;else if(c(t))s=t;else if(de(t))return this.toPrec(t).toString(r);var o=this.to(s),l=r!==void 0?oe(o.scalar,r):o.scalar;return o=(l+" "+o.units()).trim(),o},format:function(t,r){arguments.length===1&&typeof t=="function"&&(r=t,t=void 0),r=r||u.formatter;var s=this.to(t);return r.call(this,s.scalar,s.units())}});var gt=new Pe;function _t(t){var r=gt.get(t);if(r)return r;var s=a(t,w);return s?r="1":r=ar(or(t)).join("*"),gt.set(t,r),r}function or(t){for(var r=[],s,o,l=0;l<t.length;l++)s=t[l],o=t[l+1],A[s]?(r.push(ce[s]+ce[o]),l++):r.push(ce[s]);return r}function ar(t){var r=t.reduce(function(s,o){var l=s[o];return l||s.push(l=s[o]=[o,0]),l[1]++,s},[]);return r.map(function(s){return s[0]+(s[1]>1?s[1]:"")})}return u.version="1.8.0",u})});var p=dr(yi());var Fr=(()=>{class c{AppSettingsService=f(qt);data=f(Ut);_defaultUnitsSub;_conversionList=[{group:"Unitless",units:[{measure:"unitless",description:"As-Is numeric value"},{measure:" ",description:"No unit label - As-Is numeric value"}]},{group:"Speed",units:[{measure:"knots",description:"Knots - Nautical miles per hour"},{measure:"kph",description:"kph - Kilometers per hour"},{measure:"mph",description:"mph - Miles per hour"},{measure:"m/s",description:"m/s - Meters per second (base)"}]},{group:"Flow",units:[{measure:"m3/s",description:"Cubic meters per second (base)"},{measure:"l/min",description:"Liters per minute"},{measure:"l/h",description:"Liters per hour"},{measure:"g/min",description:"Gallons per minute"},{measure:"g/h",description:"Gallons per hour"}]},{group:"Fuel Distance",units:[{measure:"m/m3",description:"Meters per cubic meter (base)"},{measure:"nm/l",description:"Nautical Miles per liter"},{measure:"nm/g",description:"Nautical Miles per gallon"},{measure:"km/l",description:"Kilometers per liter"},{measure:"mpg",description:"Miles per Gallon"}]},{group:"Energy Distance",units:[{measure:"m/J",description:"Meters per Joule (base)"},{measure:"nm/J",description:"Nautical Miles per Joule"},{measure:"km/J",description:"Kilometers per Joule"},{measure:"nm/kWh",description:"Nautical Miles per Kilowatt-hour"},{measure:"km/kWh",description:"Kilometers per Kilowatt-hour"}]},{group:"Temperature",units:[{measure:"K",description:"Kelvin (base)"},{measure:"celsius",description:"Celsius"},{measure:"fahrenheit",description:"Fahrenheit"}]},{group:"Length",units:[{measure:"m",description:"Meters (base)"},{measure:"mm",description:"Millimeters"},{measure:"fathom",description:"Fathoms"},{measure:"nm",description:"Nautical Miles"},{measure:"km",description:"Kilometers"},{measure:"mi",description:"Miles"},{measure:"feet",description:"Feet"},{measure:"inch",description:"Inches"}]},{group:"Volume",units:[{measure:"liter",description:"Liters (base)"},{measure:"m3",description:"Cubic Meters"},{measure:"gallon",description:"Gallons"}]},{group:"Current",units:[{measure:"A",description:"Amperes (base)"},{measure:"mA",description:"Milliamperes"}]},{group:"Potential",units:[{measure:"V",description:"Volts (base)"},{measure:"mV",description:"Millivolts"}]},{group:"Charge",units:[{measure:"C",description:"Coulomb (base)"},{measure:"Ah",description:"Ampere*Hours"}]},{group:"Power",units:[{measure:"W",description:"Watts (base)"},{measure:"mW",description:"Milliwatts"}]},{group:"Energy",units:[{measure:"J",description:"Joules (base)"},{measure:"kWh",description:"Kilowatt*Hours"}]},{group:"Resistance",units:[{measure:"ohm",description:"\u2126 (base)"},{measure:"kiloohm",description:"k\u2126"}]},{group:"Pressure",units:[{measure:"Pa",description:"Pa (base)"},{measure:"kPa",description:"kPa"},{measure:"hPa",description:"hPa"},{measure:"mbar",description:"mbar"},{measure:"bar",description:"Bars"},{measure:"psi",description:"psi"},{measure:"mmHg",description:"mmHg"},{measure:"inHg",description:"inHg"}]},{group:"Density",units:[{measure:"kg/m3",description:"Air density - kg/cubic meter (base)"}]},{group:"Time",units:[{measure:"s",description:"Seconds (base)"},{measure:"Minutes",description:"Minutes"},{measure:"Hours",description:"Hours"},{measure:"Days",description:"Days"},{measure:"D HH:MM:SS",description:"Day Hour:Minute:sec"}]},{group:"Angular Velocity",units:[{measure:"rad/s",description:"Radians per second (base)"},{measure:"deg/s",description:"Degrees per second"},{measure:"deg/min",description:"Degrees per minute"}]},{group:"Angle",units:[{measure:"rad",description:"Radians (base)"},{measure:"deg",description:"Degrees"},{measure:"grad",description:"Gradians"}]},{group:"Frequency",units:[{measure:"rpm",description:"RPM - Rotations per minute"},{measure:"Hz",description:"Hz - Hertz (base)"},{measure:"KHz",description:"KHz - Kilohertz"},{measure:"MHz",description:"MHz - Megahertz"},{measure:"GHz",description:"GHz - Gigahertz"}]},{group:"Ratio",units:[{measure:"percent",description:"As percentage value"},{measure:"percentraw",description:"As ratio 0-1 with % sign"},{measure:"ratio",description:"Ratio 0-1 (base)"}]},{group:"Position",units:[{measure:"pdeg",description:"Position Degrees"},{measure:"latitudeMin",description:"Latitude in minutes"},{measure:"latitudeSec",description:"Latitude in seconds"},{measure:"longitudeMin",description:"Longitude in minutes"},{measure:"longitudeSec",description:"Longitude in seconds"}]}];skBaseUnits=[{unit:"s",properties:{display:"s",quantity:"Time",quantityDisplay:"t",description:"Elapsed time (interval) in seconds"}},{unit:"Hz",properties:{display:"Hz",quantity:"Frequency",quantityDisplay:"f",description:"Frequency in Hertz"}},{unit:"m3",properties:{display:"m\xB3",quantity:"Volume",quantityDisplay:"V",description:"Volume in cubic meters"}},{unit:"m3/s",properties:{display:"m\xB3/s",quantity:"Flow",quantityDisplay:"Q",description:"Liquid or gas flow in cubic meters per second"}},{unit:"kg/s",properties:{display:"kg/s",quantity:"Mass flow rate",quantityDisplay:"\u1E41",description:"Liquid or gas flow in kilograms per second"}},{unit:"kg/m3",properties:{display:"kg/m\xB3",quantity:"Density",quantityDisplay:"\u03C1",description:"Density in kg per cubic meter"}},{unit:"deg",properties:{display:"Position",quantity:"Angle",quantityDisplay:"\u2220",description:"Latitude or longitude in decimal degrees"}},{unit:"rad",properties:{display:"\xB0",quantity:"Angle",quantityDisplay:"\u2220",description:"Angular arc in radians"}},{unit:"rad/s",properties:{display:"\u33AD/s",quantity:"Rotation",quantityDisplay:"\u03C9",description:"Angular rate in radians per second"}},{unit:"A",properties:{display:"A",quantity:"Current",quantityDisplay:"I",description:"Electrical current in ampere"}},{unit:"C",properties:{display:"C",quantity:"Charge",quantityDisplay:"Q",description:"Electrical charge in Coulomb"}},{unit:"V",properties:{display:"V",quantity:"Voltage",quantityDisplay:"V",description:"Electrical potential in volt"}},{unit:"W",properties:{display:"W",quantity:"Power",quantityDisplay:"P",description:"Power in watt"}},{unit:"Nm",properties:{display:"Nm",quantity:"Torque",quantityDisplay:"\u03C4",description:"Torque in Newton meter"}},{unit:"J",properties:{display:"J",quantity:"Energy",quantityDisplay:"E",description:"Electrical energy in joule"}},{unit:"ohm",properties:{display:"\u2126",quantity:"Resistance",quantityDisplay:"R",description:"Electrical resistance in ohm"}},{unit:"m",properties:{display:"m",quantity:"Distance",quantityDisplay:"d",description:"Distance in meters"}},{unit:"m/s",properties:{display:"m/s",quantity:"Speed",quantityDisplay:"v",description:"Speed in meters per second"}},{unit:"m2",properties:{display:"\u33A1",quantity:"Area",quantityDisplay:"A",description:"(Surface) area in square meters"}},{unit:"K",properties:{display:"K",quantity:"Temperature",quantityDisplay:"T",description:"Temperature in kelvin"}},{unit:"Pa",properties:{display:"Pa",quantity:"Pressure",quantityDisplay:"P",description:"Pressure in pascal"}},{unit:"kg",properties:{display:"kg",quantity:"Mass",quantityDisplay:"m",description:"Mass in kilogram"}},{unit:"ratio",properties:{display:"",quantity:"Ratio",quantityDisplay:"\u03C6",description:"Relative value compared to reference or normal value. 0 = 0%, 1 = 100%, 1e-3 = 1 ppt"}},{unit:"m/s2",properties:{display:"m/s\xB2",quantity:"Acceleration",quantityDisplay:"a",description:"Acceleration in meters per second squared"}},{unit:"rad/s2",properties:{display:"rad/s\xB2",quantity:"Angular acceleration",quantityDisplay:"a",description:"Angular acceleration in radians per second squared"}},{unit:"N",properties:{display:"N",quantity:"Force",quantityDisplay:"F",description:"Force in newton"}},{unit:"T",properties:{display:"T",quantity:"Magnetic field",quantityDisplay:"B",description:"Magnetic field strength in tesla"}},{unit:"Lux",properties:{display:"lx",quantity:"Light Intensity",quantityDisplay:"Ev",description:"Light Intensity in lux"}},{unit:"Pa/s",properties:{display:"Pa/s",quantity:"Pressure rate",quantityDisplay:"R",description:"Pressure change rate in pascal per second"}},{unit:"Pa.s",properties:{display:"Pa s",quantity:"Viscosity",quantityDisplay:"\u03BC",description:"Viscosity in pascal seconds"}}];_defaultUnits=null;constructor(){this._defaultUnitsSub=this.AppSettingsService.getDefaultUnitsAsO().subscribe(e=>{this._defaultUnits=e})}unitConversionFunctions={unitless:function(e){return e}," ":function(e){return e},knots:p.default.swiftConverter("m/s","kn"),kph:p.default.swiftConverter("m/s","kph"),"m/s":function(e){return e},mph:p.default.swiftConverter("m/s","mph"),liter:p.default.swiftConverter("m^3","liter"),gallon:p.default.swiftConverter("m^3","gallon"),m3:function(e){return e},"m3/s":function(e){return e},"l/min":p.default.swiftConverter("m^3/s","liter/minute"),"l/h":p.default.swiftConverter("m^3/s","liter/hour"),"g/min":p.default.swiftConverter("m^3/s","gallon/minute"),"g/h":p.default.swiftConverter("m^3/s","gallon/hour"),"m/m3":function(e){return e},"nm/l":p.default.swiftConverter("m/m^3","naut-mile/liter"),"nm/g":p.default.swiftConverter("m/m^3","naut-mile/gallon"),"km/l":p.default.swiftConverter("m/m^3","km/liter"),mpg:p.default.swiftConverter("m/m^3","mile/gallon"),"m/J":function(e){return e},"nm/J":p.default.swiftConverter("m/J","naut-mile/J"),"km/J":p.default.swiftConverter("km/J","km/J"),"nm/kWh":p.default.swiftConverter("m/J","naut-mile/kWh"),"km/kWh":p.default.swiftConverter("m/J","km/kWh"),K:function(e){return e},celsius:p.default.swiftConverter("tempK","tempC"),fahrenheit:p.default.swiftConverter("tempK","tempF"),m:function(e){return e},mm:function(e){return e*1e3},fathom:p.default.swiftConverter("m","fathom"),feet:p.default.swiftConverter("m","foot"),inch:p.default.swiftConverter("m","in"),km:p.default.swiftConverter("m","km"),nm:p.default.swiftConverter("m","nmi"),mi:p.default.swiftConverter("m","mi"),V:function(e){return e},mV:function(e){return e*1e3},A:function(e){return e},mA:function(e){return e*1e3},C:function(e){return e},Ah:p.default.swiftConverter("C","Ah"),W:function(e){return e},mW:function(e){return e*1e3},J:function(e){return e},kWh:p.default.swiftConverter("J","kWh"),ohm:function(e){return e},kiloohm:function(e){return e/1e3},Pa:function(e){return e},bar:p.default.swiftConverter("Pa","bar"),psi:p.default.swiftConverter("Pa","psi"),mmHg:p.default.swiftConverter("Pa","mmHg"),inHg:p.default.swiftConverter("Pa","inHg"),hPa:p.default.swiftConverter("Pa","hPa"),kPa:p.default.swiftConverter("Pa","kPa"),mbar:p.default.swiftConverter("Pa","millibar"),"kg/m3":function(e){return e},s:function(e){return e},Minutes:p.default.swiftConverter("s","minutes"),Hours:p.default.swiftConverter("s","hours"),Days:p.default.swiftConverter("s","days"),"D HH:MM:SS":function(e){e=parseInt(e,10);let i=e<0;e=Math.abs(e);let n=Math.floor(e/86400),a=Math.floor(e%86400/3600),d=Math.floor(e%3600/60),g=Math.floor(e%60),y=i?"-":"";return n>0?y+=n+"d "+a.toString()+":"+d.toString().padStart(2,"0")+":"+g.toString().padStart(2,"0"):y+=a.toString()+":"+d.toString().padStart(2,"0")+":"+g.toString().padStart(2,"0"),y},"rad/s":function(e){return e},"deg/s":p.default.swiftConverter("rad/s","deg/s"),"deg/min":p.default.swiftConverter("rad/s","deg/min"),rpm:function(e){return e*60},Hz:function(e){return e},KHz:function(e){return e/1e3},MHz:function(e){return e/1e6},GHz:function(e){return e/1e9},rad:function(e){return e},deg:p.default.swiftConverter("rad","deg"),grad:p.default.swiftConverter("rad","grad"),percent:function(e){return e*100},percentraw:function(e){return e},ratio:function(e){return e},pdeg:function(e){return e},latitudeMin:function(e){let i=Math.trunc(e),n="N";e<0&&(n="S",i=i*-1);let a=e%1*60;return n=="S"&&(a=a*-1),i+"\xB0 "+a.toFixed(2).padStart(5,"0")+"' "+n},latitudeSec:function(e){let i=Math.trunc(e),n="N";e<0&&(n="S",i=i*-1);let a=e%1*60;n=="S"&&(a=a*-1);let d=Math.trunc(a),g=a%1*60;return i+"\xB0 "+d+"' "+g.toFixed(2).padStart(5,"0")+'" '+n},longitudeMin:function(e){let i=Math.trunc(e),n="E";e<0&&(n="W",i=i*-1);let a=e%1*60;return n=="W"&&(a=a*-1),i+"\xB0 "+a.toFixed(2).padStart(5,"0")+"' "+n},longitudeSec:function(e){let i=Math.trunc(e),n="E";e<0&&(n="W",i=i*-1);let a=e%1*60;n=="W"&&(a=a*-1);let d=Math.trunc(a),g=a%1*60;return i+"\xB0 "+d+"' "+g.toFixed(2).padStart(5,"0")+'" '+n}};convertToUnit(e,i){if(!(e in this.unitConversionFunctions)||i===null)return null;let n=+i;return this.unitConversionFunctions[e](n)}getDefaults(){return this._defaultUnits}getConversions(){return this._conversionList}getConversionsForPath(e){let i=this.data.getPathUnitType(e),n="unitless",a="unitless";if(i===null||i==="RFC 3339 (UTC)")return{base:n,conversions:this._conversionList};{let d=this._conversionList.filter(g=>g.group=="Position"&&(e.includes("position.latitude")||e.includes("position.longitude"))?!0:g.units.find(oe=>oe.measure==i)?(a=this._defaultUnits[g.group],!0):!1);return d.length>0?{base:a,conversions:d}:(console.log("[Units Service] Unit type: "+i+", found for path: "+e+`
|
|
2
|
-
but Kip does not support it.`),{base:n,conversions:this._conversionList})}}ngOnDestroy(){this._defaultUnitsSub?.unsubscribe()}static \u0275fac=function(i){return new(i||c)};static \u0275prov=wt({token:c,factory:c.\u0275fac})}return c})();var mr=["tooltip"],wi=20;var Ci=new G("mat-tooltip-scroll-strategy",{providedIn:"root",factory:()=>{let c=f(ee);return()=>Me(c,{scrollThrottle:wi})}}),ki=new G("mat-tooltip-default-options",{providedIn:"root",factory:()=>({showDelay:0,hideDelay:0,touchendHideDelay:1500})});var vi="tooltip-panel",bi=Vt({passive:!0}),ur=8,pr=8,hr=24,fr=200,gr=(()=>{class c{_elementRef=f(Y);_ngZone=f(Mt);_platform=f(Ht);_ariaDescriber=f(Jt);_focusMonitor=f(Kt);_dir=f(we);_injector=f(ee);_viewContainerRef=f(Dt);_mediaMatcher=f(Bt);_animationsDisabled=se();_defaultOptions=f(ki,{optional:!0});_overlayRef=null;_tooltipInstance=null;_overlayPanelClass;_portal;_position="below";_positionAtOrigin=!1;_disabled=!1;_tooltipClass;_viewInitialized=!1;_pointerExitEventsInitialized=!1;_tooltipComponent=Mi;_viewportMargin=8;_currentPosition;_cssClassPrefix="mat-mdc";_ariaDescriptionPending=!1;_dirSubscribed=!1;get position(){return this._position}set position(e){e!==this._position&&(this._position=e,this._overlayRef&&(this._updatePosition(this._overlayRef),this._tooltipInstance?.show(0),this._overlayRef.updatePosition()))}get positionAtOrigin(){return this._positionAtOrigin}set positionAtOrigin(e){this._positionAtOrigin=je(e),this._detach(),this._overlayRef=null}get disabled(){return this._disabled}set disabled(e){let i=je(e);this._disabled!==i&&(this._disabled=i,i?this.hide(0):this._setupPointerEnterEventsIfNeeded(),this._syncAriaDescription(this.message))}get showDelay(){return this._showDelay}set showDelay(e){this._showDelay=Ge(e)}_showDelay;get hideDelay(){return this._hideDelay}set hideDelay(e){this._hideDelay=Ge(e),this._tooltipInstance&&(this._tooltipInstance._mouseLeaveHideDelay=this._hideDelay)}_hideDelay;touchGestures="auto";get message(){return this._message}set message(e){let i=this._message;this._message=e!=null?String(e).trim():"",!this._message&&this._isTooltipVisible()?this.hide(0):(this._setupPointerEnterEventsIfNeeded(),this._updateTooltipMessage()),this._syncAriaDescription(i)}_message="";get tooltipClass(){return this._tooltipClass}set tooltipClass(e){this._tooltipClass=e,this._tooltipInstance&&this._setTooltipClass(this._tooltipClass)}_passiveListeners=[];_touchstartTimeout=null;_destroyed=new B;_isDestroyed=!1;constructor(){let e=this._defaultOptions;e&&(this._showDelay=e.showDelay,this._hideDelay=e.hideDelay,e.position&&(this.position=e.position),e.positionAtOrigin&&(this.positionAtOrigin=e.positionAtOrigin),e.touchGestures&&(this.touchGestures=e.touchGestures),e.tooltipClass&&(this.tooltipClass=e.tooltipClass)),this._viewportMargin=ur}ngAfterViewInit(){this._viewInitialized=!0,this._setupPointerEnterEventsIfNeeded(),this._focusMonitor.monitor(this._elementRef).pipe(k(this._destroyed)).subscribe(e=>{e?e==="keyboard"&&this._ngZone.run(()=>this.show()):this._ngZone.run(()=>this.hide(0))})}ngOnDestroy(){let e=this._elementRef.nativeElement;this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this._overlayRef&&(this._overlayRef.dispose(),this._tooltipInstance=null),this._passiveListeners.forEach(([i,n])=>{e.removeEventListener(i,n,bi)}),this._passiveListeners.length=0,this._destroyed.next(),this._destroyed.complete(),this._isDestroyed=!0,this._ariaDescriber.removeDescription(e,this.message,"tooltip"),this._focusMonitor.stopMonitoring(e)}show(e=this.showDelay,i){if(this.disabled||!this.message||this._isTooltipVisible()){this._tooltipInstance?._cancelPendingAnimations();return}let n=this._createOverlay(i);this._detach(),this._portal=this._portal||new $t(this._tooltipComponent,this._viewContainerRef);let a=this._tooltipInstance=n.attach(this._portal).instance;a._triggerElement=this._elementRef.nativeElement,a._mouseLeaveHideDelay=this._hideDelay,a.afterHidden().pipe(k(this._destroyed)).subscribe(()=>this._detach()),this._setTooltipClass(this._tooltipClass),this._updateTooltipMessage(),a.show(e)}hide(e=this.hideDelay){let i=this._tooltipInstance;i&&(i.isVisible()?i.hide(e):(i._cancelPendingAnimations(),this._detach()))}toggle(e){this._isTooltipVisible()?this.hide():this.show(void 0,e)}_isTooltipVisible(){return!!this._tooltipInstance&&this._tooltipInstance.isVisible()}_createOverlay(e){if(this._overlayRef){let d=this._overlayRef.getConfig().positionStrategy;if((!this.positionAtOrigin||!e)&&d._origin instanceof Y)return this._overlayRef;this._detach()}let i=this._injector.get(Qt).getAncestorScrollContainers(this._elementRef),n=`${this._cssClassPrefix}-${vi}`,a=ei(this._injector,this.positionAtOrigin?e||this._elementRef:this._elementRef).withTransformOriginOn(`.${this._cssClassPrefix}-tooltip`).withFlexibleDimensions(!1).withViewportMargin(this._viewportMargin).withScrollableContainers(i).withPopoverLocation("global");return a.positionChanges.pipe(k(this._destroyed)).subscribe(d=>{this._updateCurrentPositionClass(d.connectionPair),this._tooltipInstance&&d.scrollableViewProperties.isOverlayClipped&&this._tooltipInstance.isVisible()&&this._ngZone.run(()=>this.hide(0))}),this._overlayRef=ii(this._injector,{direction:this._dir,positionStrategy:a,panelClass:this._overlayPanelClass?[...this._overlayPanelClass,n]:n,scrollStrategy:this._injector.get(Ci)(),disableAnimations:this._animationsDisabled}),this._updatePosition(this._overlayRef),this._overlayRef.detachments().pipe(k(this._destroyed)).subscribe(()=>this._detach()),this._overlayRef.outsidePointerEvents().pipe(k(this._destroyed)).subscribe(()=>this._tooltipInstance?._handleBodyInteraction()),this._overlayRef.keydownEvents().pipe(k(this._destroyed)).subscribe(d=>{this._isTooltipVisible()&&d.keyCode===27&&!Q(d)&&(d.preventDefault(),d.stopPropagation(),this._ngZone.run(()=>this.hide(0)))}),this._defaultOptions?.disableTooltipInteractivity&&this._overlayRef.addPanelClass(`${this._cssClassPrefix}-tooltip-panel-non-interactive`),this._dirSubscribed||(this._dirSubscribed=!0,this._dir.change.pipe(k(this._destroyed)).subscribe(()=>{this._overlayRef&&this._updatePosition(this._overlayRef)})),this._overlayRef}_detach(){this._overlayRef&&this._overlayRef.hasAttached()&&this._overlayRef.detach(),this._tooltipInstance=null}_updatePosition(e){let i=e.getConfig().positionStrategy,n=this._getOrigin(),a=this._getOverlayPosition();i.withPositions([this._addOffset($($({},n.main),a.main)),this._addOffset($($({},n.fallback),a.fallback))])}_addOffset(e){let i=pr,n=!this._dir||this._dir.value=="ltr";return e.originY==="top"?e.offsetY=-i:e.originY==="bottom"?e.offsetY=i:e.originX==="start"?e.offsetX=n?-i:i:e.originX==="end"&&(e.offsetX=n?i:-i),e}_getOrigin(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"||i=="below"?n={originX:"center",originY:i=="above"?"top":"bottom"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={originX:"start",originY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={originX:"end",originY:"center"});let{x:a,y:d}=this._invertPosition(n.originX,n.originY);return{main:n,fallback:{originX:a,originY:d}}}_getOverlayPosition(){let e=!this._dir||this._dir.value=="ltr",i=this.position,n;i=="above"?n={overlayX:"center",overlayY:"bottom"}:i=="below"?n={overlayX:"center",overlayY:"top"}:i=="before"||i=="left"&&e||i=="right"&&!e?n={overlayX:"end",overlayY:"center"}:(i=="after"||i=="right"&&e||i=="left"&&!e)&&(n={overlayX:"start",overlayY:"center"});let{x:a,y:d}=this._invertPosition(n.overlayX,n.overlayY);return{main:n,fallback:{overlayX:a,overlayY:d}}}_updateTooltipMessage(){this._tooltipInstance&&(this._tooltipInstance.message=this.message,this._tooltipInstance._markForCheck(),Ue(()=>{this._tooltipInstance&&this._overlayRef.updatePosition()},{injector:this._injector}))}_setTooltipClass(e){this._tooltipInstance&&(this._tooltipInstance.tooltipClass=e,this._tooltipInstance._markForCheck())}_invertPosition(e,i){return this.position==="above"||this.position==="below"?i==="top"?i="bottom":i==="bottom"&&(i="top"):e==="end"?e="start":e==="start"&&(e="end"),{x:e,y:i}}_updateCurrentPositionClass(e){let{overlayY:i,originX:n,originY:a}=e,d;if(i==="center"?this._dir&&this._dir.value==="rtl"?d=n==="end"?"left":"right":d=n==="start"?"left":"right":d=i==="bottom"&&a==="top"?"above":"below",d!==this._currentPosition){let g=this._overlayRef;if(g){let y=`${this._cssClassPrefix}-${vi}-`;g.removePanelClass(y+this._currentPosition),g.addPanelClass(y+d)}this._currentPosition=d}}_setupPointerEnterEventsIfNeeded(){this._disabled||!this.message||!this._viewInitialized||this._passiveListeners.length||(this._isTouchPlatform()?this.touchGestures!=="off"&&(this._disableNativeGesturesIfNecessary(),this._passiveListeners.push(["touchstart",e=>{let i=e.targetTouches?.[0],n=i?{x:i.clientX,y:i.clientY}:void 0;this._setupPointerExitEventsIfNeeded(),this._touchstartTimeout&&clearTimeout(this._touchstartTimeout);let a=500;this._touchstartTimeout=setTimeout(()=>{this._touchstartTimeout=null,this.show(void 0,n)},this._defaultOptions?.touchLongPressShowDelay??a)}])):this._passiveListeners.push(["mouseenter",e=>{this._setupPointerExitEventsIfNeeded();let i;e.x!==void 0&&e.y!==void 0&&(i=e),this.show(void 0,i)}]),this._addListeners(this._passiveListeners))}_setupPointerExitEventsIfNeeded(){if(this._pointerExitEventsInitialized)return;this._pointerExitEventsInitialized=!0;let e=[];if(!this._isTouchPlatform())e.push(["mouseleave",i=>{let n=i.relatedTarget;(!n||!this._overlayRef?.overlayElement.contains(n))&&this.hide()}],["wheel",i=>this._wheelListener(i)]);else if(this.touchGestures!=="off"){this._disableNativeGesturesIfNecessary();let i=()=>{this._touchstartTimeout&&clearTimeout(this._touchstartTimeout),this.hide(this._defaultOptions?.touchendHideDelay)};e.push(["touchend",i],["touchcancel",i])}this._addListeners(e),this._passiveListeners.push(...e)}_addListeners(e){e.forEach(([i,n])=>{this._elementRef.nativeElement.addEventListener(i,n,bi)})}_isTouchPlatform(){return this._platform.IOS||this._platform.ANDROID?!0:this._platform.isBrowser?!!this._defaultOptions?.detectHoverCapability&&this._mediaMatcher.matchMedia("(any-hover: none)").matches:!1}_wheelListener(e){if(this._isTooltipVisible()){let i=this._injector.get(kt).elementFromPoint(e.clientX,e.clientY),n=this._elementRef.nativeElement;i!==n&&!n.contains(i)&&this.hide()}}_disableNativeGesturesIfNecessary(){let e=this.touchGestures;if(e!=="off"){let i=this._elementRef.nativeElement,n=i.style;(e==="on"||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA")&&(n.userSelect=n.msUserSelect=n.webkitUserSelect=n.MozUserSelect="none"),(e==="on"||!i.draggable)&&(n.webkitUserDrag="none"),n.touchAction="none",n.webkitTapHighlightColor="transparent"}}_syncAriaDescription(e){this._ariaDescriptionPending||(this._ariaDescriptionPending=!0,this._ariaDescriber.removeDescription(this._elementRef.nativeElement,e,"tooltip"),this._isDestroyed||Ue({write:()=>{this._ariaDescriptionPending=!1,this.message&&!this.disabled&&this._ariaDescriber.describe(this._elementRef.nativeElement,this.message,"tooltip")}},{injector:this._injector}))}static \u0275fac=function(i){return new(i||c)};static \u0275dir=ze({type:c,selectors:[["","matTooltip",""]],hostAttrs:[1,"mat-mdc-tooltip-trigger"],hostVars:2,hostBindings:function(i,n){i&2&&J("mat-mdc-tooltip-disabled",n.disabled)},inputs:{position:[0,"matTooltipPosition","position"],positionAtOrigin:[0,"matTooltipPositionAtOrigin","positionAtOrigin"],disabled:[0,"matTooltipDisabled","disabled"],showDelay:[0,"matTooltipShowDelay","showDelay"],hideDelay:[0,"matTooltipHideDelay","hideDelay"],touchGestures:[0,"matTooltipTouchGestures","touchGestures"],message:[0,"matTooltip","message"],tooltipClass:[0,"matTooltipClass","tooltipClass"]},exportAs:["matTooltip"]})}return c})(),Mi=(()=>{class c{_changeDetectorRef=f(ve);_elementRef=f(Y);_isMultiline=!1;message;tooltipClass;_showTimeoutId;_hideTimeoutId;_triggerElement;_mouseLeaveHideDelay;_animationsDisabled=se();_tooltip;_closeOnInteraction=!1;_isVisible=!1;_onHide=new B;_showAnimation="mat-mdc-tooltip-show";_hideAnimation="mat-mdc-tooltip-hide";constructor(){}show(e){this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=setTimeout(()=>{this._toggleVisibility(!0),this._showTimeoutId=void 0},e)}hide(e){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId=setTimeout(()=>{this._toggleVisibility(!1),this._hideTimeoutId=void 0},e)}afterHidden(){return this._onHide}isVisible(){return this._isVisible}ngOnDestroy(){this._cancelPendingAnimations(),this._onHide.complete(),this._triggerElement=null}_handleBodyInteraction(){this._closeOnInteraction&&this.hide(0)}_markForCheck(){this._changeDetectorRef.markForCheck()}_handleMouseLeave({relatedTarget:e}){(!e||!this._triggerElement.contains(e))&&(this.isVisible()?this.hide(this._mouseLeaveHideDelay):this._finalizeAnimation(!1))}_onShow(){this._isMultiline=this._isTooltipMultiline(),this._markForCheck()}_isTooltipMultiline(){let e=this._elementRef.nativeElement.getBoundingClientRect();return e.height>hr&&e.width>=fr}_handleAnimationEnd({animationName:e}){(e===this._showAnimation||e===this._hideAnimation)&&this._finalizeAnimation(e===this._showAnimation)}_cancelPendingAnimations(){this._showTimeoutId!=null&&clearTimeout(this._showTimeoutId),this._hideTimeoutId!=null&&clearTimeout(this._hideTimeoutId),this._showTimeoutId=this._hideTimeoutId=void 0}_finalizeAnimation(e){e?this._closeOnInteraction=!0:this.isVisible()||this._onHide.next()}_toggleVisibility(e){let i=this._tooltip.nativeElement,n=this._showAnimation,a=this._hideAnimation;if(i.classList.remove(e?a:n),i.classList.add(e?n:a),this._isVisible!==e&&(this._isVisible=e,this._changeDetectorRef.markForCheck()),e&&!this._animationsDisabled&&typeof getComputedStyle=="function"){let d=getComputedStyle(i);(d.getPropertyValue("animation-duration")==="0s"||d.getPropertyValue("animation-name")==="none")&&(this._animationsDisabled=!0)}e&&this._onShow(),this._animationsDisabled&&(i.classList.add("_mat-animation-noopable"),this._finalizeAnimation(e))}static \u0275fac=function(i){return new(i||c)};static \u0275cmp=fe({type:c,selectors:[["mat-tooltip-component"]],viewQuery:function(i,n){if(i&1&&ye(mr,7),i&2){let a;L(a=F())&&(n._tooltip=a.first)}},hostAttrs:["aria-hidden","true"],hostBindings:function(i,n){i&1&&z("mouseleave",function(d){return n._handleMouseLeave(d)})},decls:4,vars:4,consts:[["tooltip",""],[1,"mdc-tooltip","mat-mdc-tooltip",3,"animationend","ngClass"],[1,"mat-mdc-tooltip-surface","mdc-tooltip__surface"]],template:function(i,n){if(i&1){let a=ie();O(0,"div",1,0),z("animationend",function(g){return q(a),U(n._handleAnimationEnd(g))}),O(2,"div",2),re(3),R()()}i&2&&(J("mdc-tooltip--multiline",n._isMultiline),te("ngClass",n.tooltipClass),P(3),ne(n.message))},dependencies:[be],styles:[`.mat-mdc-tooltip{position:relative;transform:scale(0);display:inline-flex}.mat-mdc-tooltip::before{content:"";top:0;right:0;bottom:0;left:0;z-index:-1;position:absolute}.mat-mdc-tooltip-panel-below .mat-mdc-tooltip::before{top:-8px}.mat-mdc-tooltip-panel-above .mat-mdc-tooltip::before{bottom:-8px}.mat-mdc-tooltip-panel-right .mat-mdc-tooltip::before{left:-8px}.mat-mdc-tooltip-panel-left .mat-mdc-tooltip::before{right:-8px}.mat-mdc-tooltip._mat-animation-noopable{animation:none;transform:scale(1)}.mat-mdc-tooltip-surface{word-break:normal;overflow-wrap:anywhere;padding:4px 8px;min-width:40px;max-width:200px;min-height:24px;max-height:40vh;box-sizing:border-box;overflow:hidden;text-align:center;will-change:transform,opacity;background-color:var(--mat-tooltip-container-color, var(--mat-sys-inverse-surface));color:var(--mat-tooltip-supporting-text-color, var(--mat-sys-inverse-on-surface));border-radius:var(--mat-tooltip-container-shape, var(--mat-sys-corner-extra-small));font-family:var(--mat-tooltip-supporting-text-font, var(--mat-sys-body-small-font));font-size:var(--mat-tooltip-supporting-text-size, var(--mat-sys-body-small-size));font-weight:var(--mat-tooltip-supporting-text-weight, var(--mat-sys-body-small-weight));line-height:var(--mat-tooltip-supporting-text-line-height, var(--mat-sys-body-small-line-height));letter-spacing:var(--mat-tooltip-supporting-text-tracking, var(--mat-sys-body-small-tracking))}.mat-mdc-tooltip-surface::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}.mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:left}[dir=rtl] .mdc-tooltip--multiline .mat-mdc-tooltip-surface{text-align:right}.mat-mdc-tooltip-panel{line-height:normal}.mat-mdc-tooltip-panel.mat-mdc-tooltip-panel-non-interactive{pointer-events:none}@keyframes mat-mdc-tooltip-show{0%{opacity:0;transform:scale(0.8)}100%{opacity:1;transform:scale(1)}}@keyframes mat-mdc-tooltip-hide{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(0.8)}}.mat-mdc-tooltip-show{animation:mat-mdc-tooltip-show 150ms cubic-bezier(0, 0, 0.2, 1) forwards}.mat-mdc-tooltip-hide{animation:mat-mdc-tooltip-hide 75ms cubic-bezier(0.4, 0, 1, 1) forwards}
|
|
3
|
-
`],encapsulation:2,changeDetection:0})}return c})();var pn=(()=>{class c{static \u0275fac=function(i){return new(i||c)};static \u0275mod=ge({type:c});static \u0275inj=pe({imports:[Wt,Te,Ce,ke]})}return c})();var br=["trigger"],wr=["panel"],Cr=[[["mat-select-trigger"]],"*"],kr=["mat-select-trigger","*"];function Mr(c,S){if(c&1&&(O(0,"span",4),re(1),R()),c&2){let e=X();P(),ne(e.placeholder)}}function Tr(c,S){c&1&&Ke(0)}function Sr(c,S){if(c&1&&(O(0,"span",11),re(1),R()),c&2){let e=X(2);P(),ne(e.triggerValue)}}function Or(c,S){if(c&1&&(O(0,"span",5),He(1,Tr,1,0)(2,Sr,2,1,"span",11),R()),c&2){let e=X();P(),Ve(e.customTrigger?1:2)}}function Dr(c,S){if(c&1){let e=ie();O(0,"div",12,1),z("keydown",function(n){q(e);let a=X();return U(a._handleKeydown(n))}),Ke(2,1),R()}if(c&2){let e=X();Rt(Lt("mat-mdc-select-panel mdc-menu-surface mdc-menu-surface--open ",e._getPanelTheme())),J("mat-select-panel-animations-enabled",!e._animationsDisabled),te("ngClass",e.panelClass),_e("id",e.id+"-panel")("aria-multiselectable",e.multiple)("aria-label",e.ariaLabel||null)("aria-labelledby",e._getPanelAriaLabelledby())}}var xr=new G("mat-select-scroll-strategy",{providedIn:"root",factory:()=>{let c=f(ee);return()=>Me(c)}}),Ir=new G("MAT_SELECT_CONFIG"),Er=new G("MatSelectTrigger"),tt=class{source;value;constructor(S,e){this.source=S,this.value=e}},Wn=(()=>{class c{_viewportRuler=f(Zt);_changeDetectorRef=f(ve);_elementRef=f(Y);_dir=f(we,{optional:!0});_idGenerator=f(jt);_renderer=f(Ot);_parentFormField=f(li,{optional:!0});ngControl=f(ni,{self:!0,optional:!0});_liveAnnouncer=f(Gt);_defaultOptions=f(Ir,{optional:!0});_animationsDisabled=se();_popoverLocation;_initialized=new B;_cleanupDetach;options;optionGroups;customTrigger;_positions=[{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:"mat-mdc-select-panel-above"}];_scrollOptionIntoView(e){let i=this.options.toArray()[e];if(i){let n=this.panel.nativeElement,a=fi(e,this.options,this.optionGroups),d=i._getHostElement();e===0&&a===1?n.scrollTop=0:n.scrollTop=gi(d.offsetTop,d.offsetHeight,n.scrollTop,n.offsetHeight)}}_positioningSettled(){this._scrollOptionIntoView(this._keyManager.activeItemIndex||0)}_getChangeEvent(e){return new tt(this,e)}_scrollStrategyFactory=f(xr);_panelOpen=!1;_compareWith=(e,i)=>e===i;_uid=this._idGenerator.getId("mat-select-");_triggerAriaLabelledBy=null;_previousControl;_destroy=new B;_errorStateTracker;stateChanges=new B;disableAutomaticLabeling=!0;userAriaDescribedBy;_selectionModel;_keyManager;_preferredOverlayOrigin;_overlayWidth;_onChange=()=>{};_onTouched=()=>{};_valueId=this._idGenerator.getId("mat-select-value-");_scrollStrategy;_overlayPanelClass=this._defaultOptions?.overlayPanelClass||"";get focused(){return this._focused||this._panelOpen}_focused=!1;controlType="mat-select";trigger;panel;_overlayDir;panelClass;disabled=!1;get disableRipple(){return this._disableRipple()}set disableRipple(e){this._disableRipple.set(e)}_disableRipple=Tt(!1);tabIndex=0;get hideSingleSelectionIndicator(){return this._hideSingleSelectionIndicator}set hideSingleSelectionIndicator(e){this._hideSingleSelectionIndicator=e,this._syncParentProperties()}_hideSingleSelectionIndicator=this._defaultOptions?.hideSingleSelectionIndicator??!1;get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.stateChanges.next()}_placeholder;get required(){return this._required??this.ngControl?.control?.hasValidator(ri.required)??!1}set required(e){this._required=e,this.stateChanges.next()}_required;get multiple(){return this._multiple}set multiple(e){this._selectionModel,this._multiple=e}_multiple=!1;disableOptionCentering=this._defaultOptions?.disableOptionCentering??!1;get compareWith(){return this._compareWith}set compareWith(e){this._compareWith=e,this._selectionModel&&this._initializeSelection()}get value(){return this._value}set value(e){this._assignValue(e)&&this._onChange(e)}_value;ariaLabel="";ariaLabelledby;get errorStateMatcher(){return this._errorStateTracker.matcher}set errorStateMatcher(e){this._errorStateTracker.matcher=e}typeaheadDebounceInterval;sortComparator;get id(){return this._id}set id(e){this._id=e||this._uid,this.stateChanges.next()}_id;get errorState(){return this._errorStateTracker.errorState}set errorState(e){this._errorStateTracker.errorState=e}panelWidth=this._defaultOptions&&typeof this._defaultOptions.panelWidth<"u"?this._defaultOptions.panelWidth:"auto";canSelectNullableOptions=this._defaultOptions?.canSelectNullableOptions??!1;optionSelectionChanges=vt(()=>{let e=this.options;return e?e.changes.pipe(Ne(e),qe(()=>ue(...e.map(i=>i.onSelectionChange)))):this._initialized.pipe(qe(()=>this.optionSelectionChanges))});openedChange=new he;_openedStream=this.openedChange.pipe(Fe(e=>e),Le(()=>{}));_closedStream=this.openedChange.pipe(Fe(e=>!e),Le(()=>{}));selectionChange=new he;valueChange=new he;constructor(){let e=f(di),i=f(si,{optional:!0}),n=f(oi,{optional:!0}),a=f(new Nt("tabindex"),{optional:!0}),d=f(ti,{optional:!0});this.ngControl&&(this.ngControl.valueAccessor=this),this._defaultOptions?.typeaheadDebounceInterval!=null&&(this.typeaheadDebounceInterval=this._defaultOptions.typeaheadDebounceInterval),this._errorStateTracker=new mi(e,this.ngControl,n,i,this.stateChanges),this._scrollStrategy=this._scrollStrategyFactory(),this.tabIndex=a==null?0:parseInt(a)||0,this._popoverLocation=d?.usePopover===!1?null:"inline",this.id=this.id}ngOnInit(){this._selectionModel=new _i(this.multiple),this.stateChanges.next(),this._viewportRuler.change().pipe(k(this._destroy)).subscribe(()=>{this.panelOpen&&(this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._changeDetectorRef.detectChanges())})}ngAfterContentInit(){this._initialized.next(),this._initialized.complete(),this._initKeyManager(),this._selectionModel.changed.pipe(k(this._destroy)).subscribe(e=>{e.added.forEach(i=>i.select()),e.removed.forEach(i=>i.deselect())}),this.options.changes.pipe(Ne(null),k(this._destroy)).subscribe(()=>{this._resetOptions(),this._initializeSelection()})}ngDoCheck(){let e=this._getTriggerAriaLabelledby(),i=this.ngControl;if(e!==this._triggerAriaLabelledBy){let n=this._elementRef.nativeElement;this._triggerAriaLabelledBy=e,e?n.setAttribute("aria-labelledby",e):n.removeAttribute("aria-labelledby")}i&&(this._previousControl!==i.control&&(this._previousControl!==void 0&&i.disabled!==null&&i.disabled!==this.disabled&&(this.disabled=i.disabled),this._previousControl=i.control),this.updateErrorState())}ngOnChanges(e){(e.disabled||e.userAriaDescribedBy)&&this.stateChanges.next(),e.typeaheadDebounceInterval&&this._keyManager&&this._keyManager.withTypeAhead(this.typeaheadDebounceInterval)}ngOnDestroy(){this._cleanupDetach?.(),this._keyManager?.destroy(),this._destroy.next(),this._destroy.complete(),this.stateChanges.complete(),this._clearFromModal()}toggle(){this.panelOpen?this.close():this.open()}open(){this._canOpen()&&(this._parentFormField&&(this._preferredOverlayOrigin=this._parentFormField.getConnectedOverlayOrigin()),this._cleanupDetach?.(),this._overlayWidth=this._getOverlayWidth(this._preferredOverlayOrigin),this._applyModalPanelOwnership(),this._panelOpen=!0,this._overlayDir.positionChange.pipe(bt(1)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this._positioningSettled()}),this._overlayDir.attachOverlay(),this._keyManager.withHorizontalOrientation(null),this._highlightCorrectOption(),this._changeDetectorRef.markForCheck(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!0)))}_trackedModal=null;_applyModalPanelOwnership(){let e=this._elementRef.nativeElement.closest('body > .cdk-overlay-container [aria-modal="true"]');if(!e)return;let i=`${this.id}-panel`;this._trackedModal&&We(this._trackedModal,"aria-owns",i),Xt(e,"aria-owns",i),this._trackedModal=e}_clearFromModal(){if(!this._trackedModal)return;let e=`${this.id}-panel`;We(this._trackedModal,"aria-owns",e),this._trackedModal=null}close(){this._panelOpen&&(this._panelOpen=!1,this._exitAndDetach(),this._keyManager.withHorizontalOrientation(this._isRtl()?"rtl":"ltr"),this._changeDetectorRef.markForCheck(),this._onTouched(),this.stateChanges.next(),Promise.resolve().then(()=>this.openedChange.emit(!1)))}_exitAndDetach(){if(this._animationsDisabled||!this.panel){this._detachOverlay();return}this._cleanupDetach?.(),this._cleanupDetach=()=>{i(),clearTimeout(n),this._cleanupDetach=void 0};let e=this.panel.nativeElement,i=this._renderer.listen(e,"animationend",a=>{a.animationName==="_mat-select-exit"&&(this._cleanupDetach?.(),this._detachOverlay())}),n=setTimeout(()=>{this._cleanupDetach?.(),this._detachOverlay()},200);e.classList.add("mat-select-panel-exit")}_detachOverlay(){this._overlayDir.detachOverlay(),this._changeDetectorRef.markForCheck()}writeValue(e){this._assignValue(e)}registerOnChange(e){this._onChange=e}registerOnTouched(e){this._onTouched=e}setDisabledState(e){this.disabled=e,this._changeDetectorRef.markForCheck(),this.stateChanges.next()}get panelOpen(){return this._panelOpen}get selected(){return this.multiple?this._selectionModel?.selected||[]:this._selectionModel?.selected[0]}get triggerValue(){if(this.empty)return"";if(this._multiple){let e=this._selectionModel.selected.map(i=>i.viewValue);return this._isRtl()&&e.reverse(),e.join(", ")}return this._selectionModel.selected[0].viewValue}updateErrorState(){this._errorStateTracker.updateErrorState()}_isRtl(){return this._dir?this._dir.value==="rtl":!1}_handleKeydown(e){this.disabled||(this.panelOpen?this._handleOpenKeydown(e):this._handleClosedKeydown(e))}_handleClosedKeydown(e){let i=e.keyCode,n=i===40||i===38||i===37||i===39,a=i===13||i===32,d=this._keyManager;if(!d.isTyping()&&a&&!Q(e)||(this.multiple||e.altKey)&&n)e.preventDefault(),this.open();else if(!this.multiple){let g=this.selected;d.onKeydown(e);let y=this.selected;y&&g!==y&&this._liveAnnouncer.announce(y.viewValue,1e4)}}_handleOpenKeydown(e){let i=this._keyManager,n=e.keyCode,a=n===40||n===38,d=i.isTyping();if(a&&e.altKey)e.preventDefault(),this.close();else if(!d&&(n===13||n===32)&&i.activeItem&&!Q(e))e.preventDefault(),i.activeItem._selectViaInteraction();else if(!d&&this._multiple&&n===65&&e.ctrlKey){e.preventDefault();let g=this.options.some(y=>!y.disabled&&!y.selected);this.options.forEach(y=>{y.disabled||(g?y.select():y.deselect())})}else{let g=i.activeItemIndex;i.onKeydown(e),this._multiple&&a&&e.shiftKey&&i.activeItem&&i.activeItemIndex!==g&&i.activeItem._selectViaInteraction()}}_handleOverlayKeydown(e){e.keyCode===27&&!Q(e)&&(e.preventDefault(),this.close())}_onFocus(){this.disabled||(this._focused=!0,this.stateChanges.next())}_onBlur(){this._focused=!1,this._keyManager?.cancelTypeahead(),!this.disabled&&!this.panelOpen&&(this._onTouched(),this._changeDetectorRef.markForCheck(),this.stateChanges.next())}_getPanelTheme(){return this._parentFormField?`mat-${this._parentFormField.color}`:""}get empty(){return!this._selectionModel||this._selectionModel.isEmpty()}_initializeSelection(){Promise.resolve().then(()=>{this.ngControl&&(this._value=this.ngControl.value),this._setSelectionByValue(this._value),this.stateChanges.next()})}_setSelectionByValue(e){if(this.options.forEach(i=>i.setInactiveStyles()),this._selectionModel.clear(),this.multiple&&e)Array.isArray(e),e.forEach(i=>this._selectOptionByValue(i)),this._sortValues();else{let i=this._selectOptionByValue(e);i?this._keyManager.updateActiveItem(i):this.panelOpen||this._keyManager.updateActiveItem(-1)}this._changeDetectorRef.markForCheck()}_selectOptionByValue(e){let i=this.options.find(n=>{if(this._selectionModel.isSelected(n))return!1;try{return(n.value!=null||this.canSelectNullableOptions)&&this._compareWith(n.value,e)}catch{return!1}});return i&&this._selectionModel.select(i),i}_assignValue(e){return e!==this._value||this._multiple&&Array.isArray(e)?(this.options&&this._setSelectionByValue(e),this._value=e,!0):!1}_skipPredicate=e=>this.panelOpen?!1:e.disabled;_getOverlayWidth(e){return this.panelWidth==="auto"?(e instanceof Ye?e.elementRef:e||this._elementRef).nativeElement.getBoundingClientRect().width:this.panelWidth===null?"":this.panelWidth}_syncParentProperties(){if(this.options)for(let e of this.options)e._changeDetectorRef.markForCheck()}_initKeyManager(){this._keyManager=new Yt(this.options).withTypeAhead(this.typeaheadDebounceInterval).withVerticalOrientation().withHorizontalOrientation(this._isRtl()?"rtl":"ltr").withHomeAndEnd().withPageUpDown().withAllowedModifierKeys(["shiftKey"]).skipPredicate(this._skipPredicate),this._keyManager.tabOut.subscribe(()=>{this.panelOpen&&(!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction(),this.focus(),this.close())}),this._keyManager.change.subscribe(()=>{this._panelOpen&&this.panel?this._scrollOptionIntoView(this._keyManager.activeItemIndex||0):!this._panelOpen&&!this.multiple&&this._keyManager.activeItem&&this._keyManager.activeItem._selectViaInteraction()})}_resetOptions(){let e=ue(this.options.changes,this._destroy);this.optionSelectionChanges.pipe(k(e)).subscribe(i=>{this._onSelect(i.source,i.isUserInput),i.isUserInput&&!this.multiple&&this._panelOpen&&(this.close(),this.focus())}),ue(...this.options.map(i=>i._stateChanges)).pipe(k(e)).subscribe(()=>{this._changeDetectorRef.detectChanges(),this.stateChanges.next()})}_onSelect(e,i){let n=this._selectionModel.isSelected(e);!this.canSelectNullableOptions&&e.value==null&&!this._multiple?(e.deselect(),this._selectionModel.clear(),this.value!=null&&this._propagateChanges(e.value)):(n!==e.selected&&(e.selected?this._selectionModel.select(e):this._selectionModel.deselect(e)),i&&this._keyManager.setActiveItem(e),this.multiple&&(this._sortValues(),i&&this.focus())),n!==this._selectionModel.isSelected(e)&&this._propagateChanges(),this.stateChanges.next()}_sortValues(){if(this.multiple){let e=this.options.toArray();this._selectionModel.sort((i,n)=>this.sortComparator?this.sortComparator(i,n,e):e.indexOf(i)-e.indexOf(n)),this.stateChanges.next()}}_propagateChanges(e){let i;this.multiple?i=this.selected.map(n=>n.value):i=this.selected?this.selected.value:e,this._value=i,this.valueChange.emit(i),this._onChange(i),this.selectionChange.emit(this._getChangeEvent(i)),this._changeDetectorRef.markForCheck()}_highlightCorrectOption(){if(this._keyManager)if(this.empty){let e=-1;for(let i=0;i<this.options.length;i++)if(!this.options.get(i).disabled){e=i;break}this._keyManager.setActiveItem(e)}else this._keyManager.setActiveItem(this._selectionModel.selected[0])}_canOpen(){return!this._panelOpen&&!this.disabled&&this.options?.length>0&&!!this._overlayDir}focus(e){this._elementRef.nativeElement.focus(e)}_getPanelAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||null,i=e?e+" ":"";return this.ariaLabelledby?i+this.ariaLabelledby:e}_getAriaActiveDescendant(){return this.panelOpen&&this._keyManager&&this._keyManager.activeItem?this._keyManager.activeItem.id:null}_getTriggerAriaLabelledby(){if(this.ariaLabel)return null;let e=this._parentFormField?.getLabelId()||"";return this.ariaLabelledby&&(e+=" "+this.ariaLabelledby),e||(e=this._valueId),e}get describedByIds(){return this._elementRef.nativeElement.getAttribute("aria-describedby")?.split(" ")||[]}setDescribedByIds(e){let i=this._elementRef.nativeElement;e.length?i.setAttribute("aria-describedby",e.join(" ")):i.removeAttribute("aria-describedby")}onContainerClick(e){let i=zt(e);i&&(i.tagName==="MAT-OPTION"||i.classList.contains("cdk-overlay-backdrop")||i.closest(".mat-mdc-select-panel"))||(this.focus(),this.open())}get shouldLabelFloat(){return this.panelOpen||!this.empty||this.focused&&!!this.placeholder}static \u0275fac=function(i){return new(i||c)};static \u0275cmp=fe({type:c,selectors:[["mat-select"]],contentQueries:function(i,n,a){if(i&1&&At(a,Er,5)(a,hi,5)(a,pi,5),i&2){let d;L(d=F())&&(n.customTrigger=d.first),L(d=F())&&(n.options=d),L(d=F())&&(n.optionGroups=d)}},viewQuery:function(i,n){if(i&1&&ye(br,5)(wr,5)(Xe,5),i&2){let a;L(a=F())&&(n.trigger=a.first),L(a=F())&&(n.panel=a.first),L(a=F())&&(n._overlayDir=a.first)}},hostAttrs:["role","combobox","aria-haspopup","listbox",1,"mat-mdc-select"],hostVars:21,hostBindings:function(i,n){i&1&&z("keydown",function(d){return n._handleKeydown(d)})("focus",function(){return n._onFocus()})("blur",function(){return n._onBlur()}),i&2&&(_e("id",n.id)("tabindex",n.disabled?-1:n.tabIndex)("aria-controls",n.panelOpen?n.id+"-panel":null)("aria-expanded",n.panelOpen)("aria-label",n.ariaLabel||null)("aria-required",n.required.toString())("aria-disabled",n.disabled.toString())("aria-invalid",n.errorState)("aria-activedescendant",n._getAriaActiveDescendant()),J("mat-mdc-select-disabled",n.disabled)("mat-mdc-select-invalid",n.errorState)("mat-mdc-select-required",n.required)("mat-mdc-select-empty",n.empty)("mat-mdc-select-multiple",n.multiple)("mat-select-open",n.panelOpen))},inputs:{userAriaDescribedBy:[0,"aria-describedby","userAriaDescribedBy"],panelClass:"panelClass",disabled:[2,"disabled","disabled",H],disableRipple:[2,"disableRipple","disableRipple",H],tabIndex:[2,"tabIndex","tabIndex",e=>e==null?0:Be(e)],hideSingleSelectionIndicator:[2,"hideSingleSelectionIndicator","hideSingleSelectionIndicator",H],placeholder:"placeholder",required:[2,"required","required",H],multiple:[2,"multiple","multiple",H],disableOptionCentering:[2,"disableOptionCentering","disableOptionCentering",H],compareWith:"compareWith",value:"value",ariaLabel:[0,"aria-label","ariaLabel"],ariaLabelledby:[0,"aria-labelledby","ariaLabelledby"],errorStateMatcher:"errorStateMatcher",typeaheadDebounceInterval:[2,"typeaheadDebounceInterval","typeaheadDebounceInterval",Be],sortComparator:"sortComparator",id:"id",panelWidth:"panelWidth",canSelectNullableOptions:[2,"canSelectNullableOptions","canSelectNullableOptions",H]},outputs:{openedChange:"openedChange",_openedStream:"opened",_closedStream:"closed",selectionChange:"selectionChange",valueChange:"valueChange"},exportAs:["matSelect"],features:[Ft([{provide:ai,useExisting:c},{provide:ui,useExisting:c}]),St],ngContentSelectors:kr,decls:11,vars:10,consts:[["fallbackOverlayOrigin","cdkOverlayOrigin","trigger",""],["panel",""],["cdk-overlay-origin","",1,"mat-mdc-select-trigger",3,"click"],[1,"mat-mdc-select-value"],[1,"mat-mdc-select-placeholder","mat-mdc-select-min-line"],[1,"mat-mdc-select-value-text"],[1,"mat-mdc-select-arrow-wrapper"],[1,"mat-mdc-select-arrow"],["viewBox","0 0 24 24","width","24px","height","24px","focusable","false","aria-hidden","true"],["d","M7 10l5 5 5-5z"],["cdk-connected-overlay","","cdkConnectedOverlayLockPosition","","cdkConnectedOverlayHasBackdrop","","cdkConnectedOverlayBackdropClass","cdk-overlay-transparent-backdrop",3,"detach","backdropClick","overlayKeydown","cdkConnectedOverlayDisableClose","cdkConnectedOverlayPanelClass","cdkConnectedOverlayScrollStrategy","cdkConnectedOverlayOrigin","cdkConnectedOverlayPositions","cdkConnectedOverlayWidth","cdkConnectedOverlayFlexibleDimensions","cdkConnectedOverlayUsePopover"],[1,"mat-mdc-select-min-line"],["role","listbox","tabindex","-1",3,"keydown","ngClass"]],template:function(i,n){if(i&1){let a=ie();Et(Cr),O(0,"div",2,0),z("click",function(){return q(a),U(n.open())}),O(3,"div",3),He(4,Mr,2,1,"span",4)(5,Or,3,1,"span",5),R(),O(6,"div",6)(7,"div",7),Ct(),O(8,"svg",8),It(9,"path",9),R()()()(),xt(10,Dr,3,10,"ng-template",10),z("detach",function(){return q(a),U(n.close())})("backdropClick",function(){return q(a),U(n.close())})("overlayKeydown",function(g){return q(a),U(n._handleOverlayKeydown(g))})}if(i&2){let a=Pt(1);P(3),_e("id",n._valueId),P(),Ve(n.empty?4:5),P(6),te("cdkConnectedOverlayDisableClose",!0)("cdkConnectedOverlayPanelClass",n._overlayPanelClass)("cdkConnectedOverlayScrollStrategy",n._scrollStrategy)("cdkConnectedOverlayOrigin",n._preferredOverlayOrigin||a)("cdkConnectedOverlayPositions",n._positions)("cdkConnectedOverlayWidth",n._overlayWidth)("cdkConnectedOverlayFlexibleDimensions",!0)("cdkConnectedOverlayUsePopover",n._popoverLocation)}},dependencies:[Ye,Xe,be],styles:[`@keyframes _mat-select-enter{from{opacity:0;transform:scaleY(0.8)}to{opacity:1;transform:none}}@keyframes _mat-select-exit{from{opacity:1}to{opacity:0}}.mat-mdc-select{display:inline-block;width:100%;outline:none;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;color:var(--mat-select-enabled-trigger-text-color, var(--mat-sys-on-surface));font-family:var(--mat-select-trigger-text-font, var(--mat-sys-body-large-font));line-height:var(--mat-select-trigger-text-line-height, var(--mat-sys-body-large-line-height));font-size:var(--mat-select-trigger-text-size, var(--mat-sys-body-large-size));font-weight:var(--mat-select-trigger-text-weight, var(--mat-sys-body-large-weight));letter-spacing:var(--mat-select-trigger-text-tracking, var(--mat-sys-body-large-tracking))}div.mat-mdc-select-panel{box-shadow:var(--mat-select-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12))}.mat-mdc-select-disabled{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-disabled .mat-mdc-select-placeholder{color:var(--mat-select-disabled-trigger-text-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-mdc-select-trigger{display:inline-flex;align-items:center;cursor:pointer;position:relative;box-sizing:border-box;width:100%}.mat-mdc-select-disabled .mat-mdc-select-trigger{-webkit-user-select:none;user-select:none;cursor:default}.mat-mdc-select-value{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mat-mdc-select-value-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mat-mdc-select-arrow-wrapper{height:24px;flex-shrink:0;display:inline-flex;align-items:center}.mat-form-field-appearance-fill .mdc-text-field--no-label .mat-mdc-select-arrow-wrapper{transform:none}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-invalid .mat-mdc-select-arrow,.mat-form-field-invalid:not(.mat-form-field-disabled) .mat-mdc-form-field-infix::after{color:var(--mat-select-invalid-arrow-color, var(--mat-sys-error))}.mat-mdc-select-arrow{width:10px;height:5px;position:relative;color:var(--mat-select-enabled-arrow-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field.mat-focused .mat-mdc-select-arrow{color:var(--mat-select-focused-arrow-color, var(--mat-sys-primary))}.mat-mdc-form-field .mat-mdc-select.mat-mdc-select-disabled .mat-mdc-select-arrow{color:var(--mat-select-disabled-arrow-color, color-mix(in srgb, var(--mat-sys-on-surface) 38%, transparent))}.mat-select-open .mat-mdc-select-arrow{transform:rotate(180deg)}.mat-form-field-animations-enabled .mat-mdc-select-arrow{transition:transform 80ms linear}.mat-mdc-select-arrow svg{fill:currentColor;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%)}@media(forced-colors: active){.mat-mdc-select-arrow svg{fill:CanvasText}.mat-mdc-select-disabled .mat-mdc-select-arrow svg{fill:GrayText}}div.mat-mdc-select-panel{width:100%;max-height:275px;outline:0;overflow:auto;padding:8px 0;border-radius:4px;box-sizing:border-box;position:relative;background-color:var(--mat-select-panel-background-color, var(--mat-sys-surface-container))}@media(forced-colors: active){div.mat-mdc-select-panel{outline:solid 1px}}.cdk-overlay-pane:not(.mat-mdc-select-panel-above) div.mat-mdc-select-panel{border-top-left-radius:0;border-top-right-radius:0;transform-origin:top center}.mat-mdc-select-panel-above div.mat-mdc-select-panel{border-bottom-left-radius:0;border-bottom-right-radius:0;transform-origin:bottom center}.mat-select-panel-animations-enabled{animation:_mat-select-enter 120ms cubic-bezier(0, 0, 0.2, 1)}.mat-select-panel-animations-enabled.mat-select-panel-exit{animation:_mat-select-exit 100ms linear}.mat-mdc-select-placeholder{transition:color 400ms 133.3333333333ms cubic-bezier(0.25, 0.8, 0.25, 1);color:var(--mat-select-placeholder-text-color, var(--mat-sys-on-surface-variant))}.mat-mdc-form-field:not(.mat-form-field-animations-enabled) .mat-mdc-select-placeholder,._mat-animation-noopable .mat-mdc-select-placeholder{transition:none}.mat-form-field-hide-placeholder .mat-mdc-select-placeholder{color:rgba(0,0,0,0);-webkit-text-fill-color:rgba(0,0,0,0);transition:none;display:block}.mat-mdc-form-field-type-mat-select:not(.mat-form-field-disabled) .mat-mdc-text-field-wrapper{cursor:pointer}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mat-mdc-floating-label{max-width:calc(100% - 18px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-fill .mdc-floating-label--float-above{max-width:calc(100%/0.75 - 24px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-notched-outline__notch{max-width:calc(100% - 60px)}.mat-mdc-form-field-type-mat-select.mat-form-field-appearance-outline .mdc-text-field--label-floating .mdc-notched-outline__notch{max-width:calc(100% - 24px)}.mat-mdc-select-min-line:empty::before{content:" ";white-space:pre;width:1px;display:inline-block;visibility:hidden}.mat-form-field-appearance-fill .mat-mdc-select-arrow-wrapper{transform:var(--mat-select-arrow-transform, translateY(-8px))}
|
|
4
|
-
`],encapsulation:2,changeDetection:0})}return c})();var jn=(()=>{class c{static \u0275fac=function(i){return new(i||c)};static \u0275mod=ge({type:c});static \u0275inj=pe({imports:[Te,Je,Ce,ke,ci,Je]})}return c})();export{Wn as a,jn as b,Fr as c,ki as d,gr as e,pn as f};
|
package/public/chunk-3KBT35BP.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as X,b as Q,c as Ce,d as I,e as Ct,f as xe,g as xt,n as Ee,p as Z,q as De,r as Et,s as tt,t as ke,u as Re}from"./chunk-PVUOCOI5.js";import{a as ve,b as we,d as Dt,e as kt,g as Rt,h as ze,i as zt}from"./chunk-NL5QCOXT.js";import{c as me}from"./chunk-7SK25B6D.js";import{e as wt}from"./chunk-FGMEEOZH.js";import{a as vt,d as W}from"./chunk-PJZLX3XW.js";import{$b as oe,$c as ge,Ab as B,Ad as J,Ba as Qt,Bc as he,Da as N,Db as te,Eb as ee,Fb as V,Ga as ut,Gb as m,Gc as Vt,Ha as F,Hb as b,Hc as ce,Ia as nt,Ib as mt,Jb as Y,Kb as lt,Lb as ie,Ma as at,Ob as se,Pb as L,Rb as x,Rc as ue,Tb as P,Ub as Gt,V as $t,Va as Kt,Vb as _t,Wa as Bt,Wb as re,Xa as H,Xb as ht,Yb as j,Zb as $,a as _,ac as ne,b as E,bb as Wt,cc as bt,db as gt,eb as dt,gc as y,hc as ae,ib as z,ic as de,la as Xt,mb as pt,nb as ft,ob as Jt,oc as le,od as pe,pb as Zt,pc as Ut,pd as fe,qa as w,qc as yt,qe as _e,re as be,te as ye,va as D,wa as k,yb as It,zb as A,zc as Ft,zd as K}from"./chunk-MOEZSWFX.js";var h=class d{static getElements(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(e&&!isNaN(+r[0])){let s=e.getElementById(r);return s?[s]:[]}let i=t.querySelectorAll(r);if(!i.length&&r[0]!=="."&&r[0]!=="#"&&(i=t.querySelectorAll("."+r),i.length||(i=t.querySelectorAll("#"+r)),!i.length)){let s=t.querySelector(`[gs-id="${r}"]`);return s?[s]:[]}return Array.from(i)}return[r]}static getElement(r,t=document){if(typeof r=="string"){let e="getElementById"in t?t:void 0;if(!r.length)return null;if(e&&r[0]==="#")return e.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return t.querySelector(r);if(e&&!isNaN(+r[0]))return e.getElementById(r);let i=t.querySelector(r);return e&&!i&&(i=e.getElementById(r)),i||(i=t.querySelector("."+r)),i}return r}static lazyLoad(r){return r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1}static createDiv(r,t){let e=document.createElement("div");return r.forEach(i=>{i&&e.classList.add(i)}),t?.appendChild(e),e}static shouldSizeToContent(r,t=!1){return r?.grid&&(t?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,t){return!(r.y>=t.y+t.h||r.y+r.h<=t.y||r.x+r.w<=t.x||r.x>=t.x+t.w)}static isTouching(r,t){return d.isIntercepted(r,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(r,t){let e=r.x>t.x?r.x:t.x,i=r.x+r.w<t.x+t.w?r.x+r.w:t.x+t.w;if(i<=e)return 0;let s=r.y>t.y?r.y:t.y,o=r.y+r.h<t.y+t.h?r.y+r.h:t.y+t.h;return o<=s?0:(i-e)*(o-s)}static area(r){return r.w*r.h}static sort(r,t=1){return r.sort((i,s)=>{let o=t*((i.y??1e4)-(s.y??1e4));return o===0?t*((i.x??1e4)-(s.x??1e4)):o})}static find(r,t){return t?r.find(e=>e.id===t):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let t,e="px";if(typeof r=="string")if(r==="auto"||r==="")t=0;else{let i=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!i)throw new Error(`Invalid height val = ${r}`);e=i[2]||"px",t=parseFloat(i[1])}else t=r;return{h:t,unit:e}}static defaults(r,...t){return t.forEach(e=>{for(let i in e){if(!e.hasOwnProperty(i))return;r[i]===null||r[i]===void 0?r[i]=e[i]:typeof e[i]=="object"&&typeof r[i]=="object"&&d.defaults(r[i],e[i])}}),r}static same(r,t){if(typeof r!="object")return r==t;if(typeof r!=typeof t||Object.keys(r).length!==Object.keys(t).length)return!1;for(let e in r)if(r[e]!==t[e])return!1;return!0}static copyPos(r,t,e=!1){return t.x!==void 0&&(r.x=t.x),t.y!==void 0&&(r.y=t.y),t.w!==void 0&&(r.w=t.w),t.h!==void 0&&(r.h=t.h),e&&(t.minW&&(r.minW=t.minW),t.minH&&(r.minH=t.minH),t.maxW&&(r.maxW=t.maxW),t.maxH&&(r.maxH=t.maxH)),r}static samePos(r,t){return r&&t&&r.x===t.x&&r.y===t.y&&(r.w||1)===(t.w||1)&&(r.h||1)===(t.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,t){if(!(typeof r!="object"||typeof t!="object")&&!(Array.isArray(r)||Array.isArray(t)))for(let e in r){let i=r[e],s=t[e];e[0]==="_"||i===s?delete r[e]:i&&typeof i=="object"&&s!==void 0&&(d.removeInternalAndSame(i,s),Object.keys(i).length||delete r[e])}}static removeInternalForSave(r,t=!0){for(let e in r)(e[0]==="_"||r[e]===null||r[e]===void 0)&&delete r[e];delete r.grid,t&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,t){let e=!1;return(...i)=>{e||(e=!0,setTimeout(()=>{r(...i),e=!1},t))}}static removePositioningStyles(r){let t=r.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;let t=getComputedStyle(r);return/(auto|scroll)/.test(t.overflow+t.overflowY)?r:d.getScrollElement(r.parentElement)}static updateScrollPosition(r,t,e){let i=d.getScrollElement(r);if(!i)return;let s=r.getBoundingClientRect(),o=i.getBoundingClientRect(),n=window.innerHeight||document.documentElement.clientHeight,a=s.bottom-Math.min(o.bottom,n),u=s.top-Math.max(o.top,0),c=i.scrollTop;u<0&&e<0?r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=Math.abs(u)>Math.abs(e)?e:u:a>0&&e>0&&(r.offsetHeight>o.height?i.scrollTop+=e:i.scrollTop+=a>e?e:a),t.top+=i.scrollTop-c}static updateScrollResize(r,t,e){let i=d.getScrollElement(t),s=i.clientHeight,o=i===d.getScrollElement()?0:i.getBoundingClientRect().top,n=r.clientY-o,a=n<e,u=n>s-e;a?i.scrollBy({behavior:"smooth",top:n-e}):u&&i.scrollBy({behavior:"smooth",top:e-(s-n)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:_({},r)}static cloneDeep(r){let t=["parentGrid","el","grid","subGrid","engine"],e=d.clone(r);for(let i in e)e.hasOwnProperty(i)&&typeof e[i]=="object"&&i.substring(0,2)!=="__"&&!t.find(s=>s===i)&&(e[i]=d.cloneDeep(r[i]));return e}static cloneNode(r){let t=r.cloneNode(!0);return t.removeAttribute("id"),t}static appendTo(r,t){let e;typeof t=="string"?e=d.getElement(t):e=t,e&&e.appendChild(r)}static addElStyles(r,t){if(t instanceof Object)for(let e in t)t.hasOwnProperty(e)&&(Array.isArray(t[e])?t[e].forEach(i=>{r.style[e]=i}):r.style[e]=t[e])}static initEvent(r,t){let e={type:t.type},i={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:t.target?t.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(s=>e[s]=r[s]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(s=>e[s]=r[s]),_(_({},e),i)}static simulateMouseEvent(r,t,e){let i=r,s=new MouseEvent(t,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:i.ctrlKey??!1,altKey:i.altKey??!1,shiftKey:i.shiftKey??!1,metaKey:i.metaKey??!1,button:0,relatedTarget:r.target});(e||r.target).dispatchEvent(s)}static getValuesFromTransformedElement(r){let t=document.createElement("div");d.addElStyles(t,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(t);let e=t.getBoundingClientRect();return r.removeChild(t),t.remove(),{xScale:1/e.width,yScale:1/e.height,xOffset:e.left,yOffset:e.top}}static swap(r,t,e){if(!r)return;let i=r[t];r[t]=r[e],r[e]=i}static canBeRotated(r){return!(!r||r.w===r.h||r.locked||r.noResize||r.grid?.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}};var qt=(()=>{class d{constructor(t={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=t.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=t.maxRow,this._float=t.float,this.nodes=t.nodes||[],this.onChange=t.onChange}batchUpdate(t=!0,e=!0){return!!this.batchMode===t?this:(this.batchMode=t,t?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,e&&this._packNodes(),this._notify()),this)}_useEntireRowArea(t,e){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!t._moving||t._skipDown||e.y<=t.y)}_fixCollisions(t,e=t,i,s={}){if(this.sortNodes(-1),i=i||this.collide(t,e),!i)return!1;if(t._moving&&!s.nested&&!this.float&&this.swap(t,i))return!0;let o=e;!this._loading&&this._useEntireRowArea(t,e)&&(o={x:0,w:this.column,y:e.y,h:e.h},i=this.collide(t,o,s.skip));let n=!1,a={nested:!0,pack:!1},u=0;for(;i=i||this.collide(t,o,s.skip);){if(u++>this.nodes.length*2)throw new Error("Infinite collide check");let c;if(i.locked||this._loading||t._moving&&!t._skipDown&&e.y>t.y&&!this.float&&(!this.collide(i,E(_({},i),{y:t.y}),t)||!this.collide(i,E(_({},i),{y:e.y-i.h}),t))){t._skipDown=t._skipDown||e.y>t.y;let l=_(E(_({},e),{y:i.y+i.h}),a);c=this._loading&&h.samePos(t,l)?!0:this.moveNode(t,l),(i.locked||this._loading)&&c?h.copyPos(e,t):!i.locked&&c&&s.pack&&(this._packNodes(),e.y=i.y+i.h,h.copyPos(t,e)),n=n||c}else c=this.moveNode(i,_(E(_({},i),{y:e.y+e.h,skip:t}),a));if(!c)return n;i=void 0}return n}collide(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.find(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}collideAll(t,e=t,i){let s=t._id,o=i?._id;return this.nodes.filter(n=>n._id!==s&&n._id!==o&&h.isIntercepted(n,e))}directionCollideCoverage(t,e,i){if(!e.rect||!t._rect)return;let s=t._rect,o=_({},e.rect);o.y>s.y?(o.h+=o.y-s.y,o.y=s.y):o.h+=s.y-o.y,o.x>s.x?(o.w+=o.x-s.x,o.x=s.x):o.w+=s.x-o.x;let n,a=.5;for(let u of i){if(u.locked||!u._rect)break;let c=u._rect,l=Number.MAX_VALUE,g=Number.MAX_VALUE;s.y<c.y?l=(o.y+o.h-c.y)/c.h:s.y+s.h>c.y+c.h&&(l=(c.y+c.h-o.y)/c.h),s.x<c.x?g=(o.x+o.w-c.x)/c.w:s.x+s.w>c.x+c.w&&(g=(c.x+c.w-o.x)/c.w);let p=Math.min(g,l);p>a&&(a=p,n=u)}return e.collide=n,n}cacheRects(t,e,i,s,o,n){return this.nodes.forEach(a=>a._rect={y:a.y*e+i,x:a.x*t+n,w:a.w*t-n-s,h:a.h*e-i-o}),this}swap(t,e){if(!e||e.locked||!t||t.locked)return!1;function i(){let o=e.x,n=e.y;return e.x=t.x,e.y=t.y,t.h!=e.h?(t.x=o,t.y=e.y+e.h):t.w!=e.w?(t.x=e.x+e.w,t.y=n):(t.x=o,t.y=n),t._dirty=e._dirty=!0,!0}let s;if(t.w===e.w&&t.h===e.h&&(t.x===e.x||t.y===e.y)&&(s=h.isTouching(t,e)))return i();if(s!==!1){if(t.w===e.w&&t.x===e.x&&(s||(s=h.isTouching(t,e)))){if(e.y<t.y){let o=t;t=e,e=o}return i()}if(s!==!1){if(t.h===e.h&&t.y===e.y&&(s||(s=h.isTouching(t,e)))){if(e.x<t.x){let o=t;t=e,e=o}return i()}return!1}}}isAreaEmpty(t,e,i,s){let o={x:t||0,y:e||0,w:i||1,h:s||1};return!this.collide(o)}compact(t="compact",e=!0){if(this.nodes.length===0)return this;e&&this.sortNodes();let i=this.batchMode;i||this.batchUpdate();let s=this._inColumnResize;s||(this._inColumnResize=!0);let o=this.nodes;return this.nodes=[],o.forEach((n,a,u)=>{let c;n.locked||(n.autoPosition=!0,t==="list"&&a&&(c=u[a-1])),this.addNode(n,!1,c)}),s||delete this._inColumnResize,i||this.batchUpdate(!1),this}set float(t){this._float!==t&&(this._float=t||!1,t||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(t=1){return this.nodes=h.sort(this.nodes,t),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(t=>{if(t._updating||t._orig===void 0||t.y===t._orig.y)return;let e=t.y;for(;e>t._orig.y;)--e,this.collide(t,{x:t.x,y:e,w:t.w,h:t.h})||(t._dirty=!0,t.y=e)}):this.nodes.forEach((t,e)=>{if(!t.locked)for(;t.y>0;){let i=e===0?0:t.y-1;if(!(e===0||!this.collide(t,{x:t.x,y:i,w:t.w,h:t.h})))break;t._dirty=t.y!==i,t.y=i}}),this)}prepareNode(t,e){t._id=t._id??d._idSeq++;let i=t.id;if(i){let o=1;for(;this.nodes.find(n=>n.id===t.id&&n!==t);)t.id=i+"_"+o++}(t.x===void 0||t.y===void 0||t.x===null||t.y===null)&&(t.autoPosition=!0);let s={x:0,y:0,w:1,h:1};return h.defaults(t,s),t.autoPosition||delete t.autoPosition,t.noResize||delete t.noResize,t.noMove||delete t.noMove,h.sanitizeMinMax(t),typeof t.x=="string"&&(t.x=Number(t.x)),typeof t.y=="string"&&(t.y=Number(t.y)),typeof t.w=="string"&&(t.w=Number(t.w)),typeof t.h=="string"&&(t.h=Number(t.h)),isNaN(t.x)&&(t.x=s.x,t.autoPosition=!0),isNaN(t.y)&&(t.y=s.y,t.autoPosition=!0),isNaN(t.w)&&(t.w=s.w),isNaN(t.h)&&(t.h=s.h),this.nodeBoundFix(t,e),t}nodeBoundFix(t,e){let i=t._orig||h.copyPos({},t);if(t.maxW&&(t.w=Math.min(t.w||1,t.maxW)),t.maxH&&(t.h=Math.min(t.h||1,t.maxH)),t.minW&&(t.w=Math.max(t.w||1,t.minW)),t.minH&&(t.h=Math.max(t.h||1,t.minH)),(t.x||0)+(t.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&t._id!=null&&this.findCacheLayout(t,this.defaultColumn)===-1){let o=_({},t);o.autoPosition||o.x===void 0?(delete o.x,delete o.y):o.x=Math.min(this.defaultColumn-1,o.x),o.w=Math.min(this.defaultColumn,o.w||1),this.cacheOneLayout(o,this.defaultColumn)}return t.w>this.column?t.w=this.column:t.w<1&&(t.w=1),this.maxRow&&t.h>this.maxRow?t.h=this.maxRow:t.h<1&&(t.h=1),t.x<0&&(t.x=0),t.y<0&&(t.y=0),t.x+t.w>this.column&&(e?t.w=this.column-t.x:t.x=this.column-t.w),this.maxRow&&t.y+t.h>this.maxRow&&(e?t.h=this.maxRow-t.y:t.y=this.maxRow-t.h),h.samePos(t,i)||(t._dirty=!0),this}getDirtyNodes(t){return t?this.nodes.filter(e=>e._dirty&&!h.samePos(e,e._orig)):this.nodes.filter(e=>e._dirty)}_notify(t){if(this.batchMode||!this.onChange)return this;let e=(t||[]).concat(this.getDirtyNodes());return this.onChange(e),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(t=>{delete t._dirty,delete t._lastTried}),this)}saveInitial(){return this.nodes.forEach(t=>{t._orig=h.copyPos({},t),delete t._dirty}),this._hasLocked=this.nodes.some(t=>t.locked),this}restoreInitial(){return this.nodes.forEach(t=>{!t._orig||h.samePos(t,t._orig)||(h.copyPos(t,t._orig),t._dirty=!0)}),this._notify(),this}findEmptyPosition(t,e=this.nodes,i=this.column,s){let o=s?s.y*i+(s.x+s.w):0,n=!1;for(let a=o;!n;++a){let u=a%i,c=Math.floor(a/i);if(u+t.w>i)continue;let l={x:u,y:c,w:t.w,h:t.h};e.find(g=>h.isIntercepted(l,g))||((t.x!==u||t.y!==c)&&(t._dirty=!0),t.x=u,t.y=c,delete t.autoPosition,n=!0)}return n}addNode(t,e=!1,i){let s=this.nodes.find(n=>n._id===t._id);if(s)return s;this._inColumnResize?this.nodeBoundFix(t):this.prepareNode(t),delete t._temporaryRemoved,delete t._removeDOM;let o;return t.autoPosition&&this.findEmptyPosition(t,this.nodes,this.column,i)&&(delete t.autoPosition,o=!0),this.nodes.push(t),e&&this.addedNodes.push(t),o||this._fixCollisions(t),this.batchMode||this._packNodes()._notify(),t}removeNode(t,e=!0,i=!1){return this.nodes.find(s=>s._id===t._id)?(i&&this.removedNodes.push(t),e&&(t._removeDOM=!0),this.nodes=this.nodes.filter(s=>s._id!==t._id),t._isAboutToRemove||this._packNodes(),this._notify([t]),this):this}removeAll(t=!0,e=!0){if(delete this._layouts,!this.nodes.length)return this;t&&this.nodes.forEach(s=>s._removeDOM=!0);let i=this.nodes;return this.removedNodes=e?i:[],this.nodes=[],this._notify(i)}moveNodeCheck(t,e){if(!this.changedPosConstrain(t,e))return!1;if(e.pack=!0,!this.maxRow)return this.moveNode(t,e);let i,s=new d({column:this.column,float:this.float,nodes:this.nodes.map(n=>n._id===t._id?(i=_({},n),i):_({},n))});if(!i)return!1;let o=s.moveNode(i,e)&&s.getRow()<=Math.max(this.getRow(),this.maxRow);if(!o&&!e.resizing&&e.collide){let n=e.collide.el.gridstackNode;if(this.swap(t,n))return this._notify(),!0}return o?(s.nodes.filter(n=>n._dirty).forEach(n=>{let a=this.nodes.find(u=>u._id===n._id);a&&(h.copyPos(a,n),a._dirty=!0)}),this._notify(),!0):!1}willItFit(t){if(delete t._willFitPos,!this.maxRow)return!0;let e=new d({column:this.column,float:this.float,nodes:this.nodes.map(s=>_({},s))}),i=_({},t);return this.cleanupNode(i),delete i.el,delete i._id,delete i.content,delete i.grid,e.addNode(i),e.getRow()<=this.maxRow?(t._willFitPos=h.copyPos({},i),!0):!1}changedPosConstrain(t,e){return e.w=e.w||t.w,e.h=e.h||t.h,t.x!==e.x||t.y!==e.y?!0:(t.maxW&&(e.w=Math.min(e.w,t.maxW)),t.maxH&&(e.h=Math.min(e.h,t.maxH)),t.minW&&(e.w=Math.max(e.w,t.minW)),t.minH&&(e.h=Math.max(e.h,t.minH)),t.w!==e.w||t.h!==e.h)}moveNode(t,e){if(!t||!e)return!1;let i;e.pack===void 0&&!this.batchMode&&(i=e.pack=!0),typeof e.x!="number"&&(e.x=t.x),typeof e.y!="number"&&(e.y=t.y),typeof e.w!="number"&&(e.w=t.w),typeof e.h!="number"&&(e.h=t.h);let s=t.w!==e.w||t.h!==e.h,o=h.copyPos({},t,!0);if(h.copyPos(o,e),this.nodeBoundFix(o,s),h.copyPos(e,o),!e.forceCollide&&h.samePos(t,e))return!1;let n=h.copyPos({},t),a=this.collideAll(t,o,e.skip),u=!0;if(a.length){let c=t._moving&&!e.nested,l=c?this.directionCollideCoverage(t,e,a):a[0];if(c&&l&&t.grid?.opts?.subGridDynamic&&!t.grid._isTemp){let g=h.areaIntercept(e.rect,l._rect),p=h.area(e.rect),v=h.area(l._rect);g/(p<v?p:v)>.8&&(l.grid.makeSubGrid(l.el,void 0,t),l=void 0)}l?u=!this._fixCollisions(t,o,l,e):(u=!1,i&&delete e.pack)}return u&&!h.samePos(t,o)&&(t._dirty=!0,h.copyPos(t,o)),e.pack&&this._packNodes()._notify(),!h.samePos(t,n)}getRow(){return this.nodes.reduce((t,e)=>Math.max(t,e.y+e.h),0)}beginUpdate(t){return t._updating||(t._updating=!0,delete t._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){let t=this.nodes.find(e=>e._updating);return t&&(delete t._updating,delete t._skipDown),this}save(t=!0,e,i){let s=this._layouts?.length||0,o;s&&(i?i!==this.column&&(o=this._layouts[i]):this.column!==s-1&&(o=this._layouts[s-1]));let n=[];return this.sortNodes(),this.nodes.forEach(a=>{let u=o?.find(l=>l._id===a._id),c=_(_({},a),u||{});h.removeInternalForSave(c,!t),e&&e(a,c),n.push(c)}),n}layoutsNodesChange(t){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((e,i)=>{if(!e||i===this.column)return this;if(i<this.column)this._layouts[i]=void 0;else{let s=i/this.column;t.forEach(o=>{if(!o._orig)return;let n=e.find(a=>a._id===o._id);n&&(n.y>=0&&o.y!==o._orig.y&&(n.y+=o.y-o._orig.y,n.y<0&&(n.y=0)),o.x!==o._orig.x&&(n.x=Math.round(o.x*s),n.x<0&&(n.x=0)),o.w!==o._orig.w&&(n.w=Math.round(o.w*s),n.w<1&&(n.w=1)))})}}),this)}columnChanged(t,e,i="moveScale"){if(!this.nodes.length||!e||t===e)return this;let s=i==="compact"||i==="list";s&&this.sortNodes(1),e<t&&this.cacheLayout(this.nodes,t),this.batchUpdate();let o=[],n=s?this.nodes:h.sort(this.nodes,-1);if(e>t&&this._layouts){let a=this._layouts[e]||[],u=this._layouts.length-1;!a.length&&t!==u&&this._layouts[u]?.length&&(t=u,this._layouts[u].forEach(c=>{let l=n.find(g=>g._id===c._id);l&&(!s&&!c.autoPosition&&(l.x=c.x??l.x,l.y=c.y??l.y),l.w=c.w??l.w,(c.x==null||c.y===void 0)&&(l.autoPosition=!0))})),a.forEach(c=>{let l=n.findIndex(g=>g._id===c._id);if(l!==-1){let g=n[l];if(s){g.w=c.w;return}(c.autoPosition||isNaN(c.x)||isNaN(c.y))&&this.findEmptyPosition(c,o),c.autoPosition||(g.x=c.x??g.x,g.y=c.y??g.y,g.w=c.w??g.w,o.push(g)),n.splice(l,1)}})}if(s)this.compact(i,!1);else{if(n.length)if(typeof i=="function")i(e,t,o,n);else{let a=s||i==="none"?1:e/t,u=i==="move"||i==="moveScale",c=i==="scale"||i==="moveScale";n.forEach(l=>{l.x=e===1?0:u?Math.round(l.x*a):Math.min(l.x,e-1),l.w=e===1||t===1?1:c?Math.round(l.w*a)||1:Math.min(l.w,e),o.push(l)}),n=[]}o=h.sort(o,-1),this._inColumnResize=!0,this.nodes=[],o.forEach(a=>{this.addNode(a,!1),delete a._orig})}return this.nodes.forEach(a=>delete a._orig),this.batchUpdate(!1,!s),delete this._inColumnResize,this}cacheLayout(t,e,i=!1){let s=[];return t.forEach((o,n)=>{if(o._id===void 0){let a=o.id?this.nodes.find(u=>u.id===o.id):void 0;o._id=a?._id??d._idSeq++}s[n]={x:o.x,y:o.y,w:o.w,_id:o._id}}),this._layouts=i?[]:this._layouts||[],this._layouts[e]=s,this}cacheOneLayout(t,e){t._id=t._id??d._idSeq++;let i={x:t.x,y:t.y,w:t.w,_id:t._id};(t.autoPosition||t.x===void 0)&&(delete i.x,delete i.y,t.autoPosition&&(i.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[e]=this._layouts[e]||[];let s=this.findCacheLayout(t,e);return s===-1?this._layouts[e].push(i):this._layouts[e][s]=i,this}findCacheLayout(t,e){return this._layouts?.[e]?.findIndex(i=>i._id===t._id)??-1}removeNodeFromLayoutCache(t){if(this._layouts)for(let e=0;e<this._layouts.length;e++){let i=this.findCacheLayout(t,e);i!==-1&&this._layouts[e].splice(i,1)}}cleanupNode(t){for(let e in t)e[0]==="_"&&e!=="_id"&&delete t[e];return this}}return d._idSeq=0,d})();var O={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};var f=class{};var S=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0),R=class{};function St(d,r){d.touches.length>1||(d.cancelable&&d.preventDefault(),h.simulateMouseEvent(d.changedTouches[0],r))}function Se(d,r){d.cancelable&&d.preventDefault(),h.simulateMouseEvent(d,r)}function et(d){R.touchHandled||(R.touchHandled=!0,St(d,"mousedown"))}function it(d){R.touchHandled&&St(d,"mousemove")}function st(d){if(!R.touchHandled)return;R.pointerLeaveTimeout&&(window.clearTimeout(R.pointerLeaveTimeout),delete R.pointerLeaveTimeout);let r=!!f.dragElement;St(d,"mouseup"),r||St(d,"click"),R.touchHandled=!1}function rt(d){d.pointerType!=="mouse"&&d.target.releasePointerCapture(d.pointerId)}function Yt(d){f.dragElement&&d.pointerType!=="mouse"&&Se(d,"mouseenter")}function jt(d){f.dragElement&&d.pointerType!=="mouse"&&(R.pointerLeaveTimeout=window.setTimeout(()=>{delete R.pointerLeaveTimeout,Se(d,"mouseleave")},10))}var Me=(()=>{class d{constructor(t,e,i){this.host=t,this.dir=e,this.option=i,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(t){this.option.element=void 0,console.error("Query for resizeable handle failed, falling back",t)}return this.el||(this.el=document.createElement("div"),this.host.appendChild(this.el)),this.el.classList.add("ui-resizable-handle"),this.el.classList.add(`${d.prefix}${this.dir}`),this.el.style.zIndex="100",this.el.style.userSelect="none",this.el.addEventListener("mousedown",this._mouseDown),S&&(this.el.addEventListener("touchstart",et),this.el.addEventListener("pointerdown",rt)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),S&&(this.el.removeEventListener("touchstart",et),this.el.removeEventListener("pointerdown",rt)),this.option.element||this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(t){this.mouseDownEvent=t,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),S&&(this.el.addEventListener("touchmove",it),this.el.addEventListener("touchend",st)),t.stopPropagation(),t.preventDefault()}_mouseMove(t){let e=this.mouseDownEvent;this.moving?this._triggerEvent("move",t):Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",t),document.addEventListener("keydown",this._keyEvent)),t.stopPropagation()}_mouseUp(t){this.moving&&(this._triggerEvent("stop",t),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),S&&(this.el.removeEventListener("touchmove",it),this.el.removeEventListener("touchend",st)),delete this.moving,delete this.mouseDownEvent,t.stopPropagation(),t.preventDefault()}_keyEvent(t){t.key==="Escape"&&(this.host.gridstackNode?.grid?.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(t,e){return this.option[t]&&this.option[t](e),this}}return d.prefix="ui-resizable-",d})();var G=class{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,t){this._eventRegister[r]=t}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,t){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](t)}};var Te=(()=>{class d extends G{constructor(t,e={}){super(),this.el=t,this.option=e,this.rectScale={x:1,y:1},this._ui=()=>{let s=this.el.parentElement.getBoundingClientRect(),o={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},n=this.temporalRect||o;return{position:{left:(n.left-s.left)*this.rectScale.x,top:(n.top-s.top)*this.rectScale.y},size:{width:n.width*this.rectScale.x,height:n.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(t,e){super.on(t,e)}off(t){super.off(t)}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(t){let e=t.handles&&t.handles!==this.option.handles,i=t.autoHide&&t.autoHide!==this.option.autoHide;return Object.keys(t).forEach(s=>this.option[s]=t[s]),e&&(this._removeHandlers(),this._setupHandlers()),i&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(t){return t?(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),f.overResizeElement===this&&delete f.overResizeElement),this}_mouseOver(t){f.overResizeElement||f.dragElement||(f.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(t){f.overResizeElement===this&&(delete f.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(t=>t.trim()).map(t=>new Me(this.el,t,{element:this.option.element,start:e=>this._resizeStart(e),stop:e=>this._resizeStop(e),move:e=>this._resizing(e,t)})),this}_resizeStart(t){this.sizeToContent=h.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=h.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=t,this._setupHelper(),this._applyChange();let e=h.initEvent(t,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(e,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",e),this}_resizing(t,e){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(t,e),this._applyChange();let i=h.initEvent(t,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(i,this._ui()),this.triggerEvent("resize",i),this}_resizeStop(t){let e=h.initEvent(t,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(e),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",e),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=d._originStyleProp.map(i=>this.el.style[i]),this.parentOriginStylePosition=this.el.parentElement.style.position;let t=this.el.parentElement,e=h.getValuesFromTransformedElement(t);return this.rectScale={x:e.xScale,y:e.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 d._originStyleProp.forEach((t,e)=>{this.el.style[t]=this.elOriginStyleVal[e]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(t,e){let i=this.startEvent,s={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},o=t.clientX-i.clientX,n=this.sizeToContent?0:t.clientY-i.clientY,a,u;e.indexOf("e")>-1?s.width+=o:e.indexOf("w")>-1&&(s.width-=o,s.left+=o,a=!0),e.indexOf("s")>-1?s.height+=n:e.indexOf("n")>-1&&(s.height-=n,s.top+=n,u=!0);let c=this._constrainSize(s.width,s.height,a,u);return Math.round(s.width)!==Math.round(c.width)&&(e.indexOf("w")>-1&&(s.left+=s.width-c.width),s.width=c.width),Math.round(s.height)!==Math.round(c.height)&&(e.indexOf("n")>-1&&(s.top+=s.height-c.height),s.height=c.height),s}_constrainSize(t,e,i,s){let o=this.option,n=(i?o.maxWidthMoveLeft:o.maxWidth)||Number.MAX_SAFE_INTEGER,a=o.minWidth/this.rectScale.x||t,u=(s?o.maxHeightMoveUp:o.maxHeight)||Number.MAX_SAFE_INTEGER,c=o.minHeight/this.rectScale.y||e,l=Math.min(n,Math.max(a,t)),g=Math.min(u,Math.max(c,e));return{width:l,height:g}}_applyChange(){let t={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){let e=this.el.parentElement,{left:i,top:s}=e.getBoundingClientRect();t={left:i,top:s,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(e=>{let i=this.temporalRect[e],s=e==="width"||e==="left"?this.rectScale.x:e==="height"||e==="top"?this.rectScale.y:1;this.el.style[e]=(i-t[e])*s+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(t=>t.destroy()),delete this.handlers,this}}return d._originStyleProp=["width","height","position","left","top","opacity","zIndex"],d})();var Ue='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle',He=(()=>{class d extends G{constructor(t,e={}){super(),this.el=t,this.option=e,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};let i=e?.handle?.substring(1),s=t.gridstackNode;this.dragEls=!i||t.classList.contains(i)?[t]:s?.subGrid?[t.querySelector(e.handle)||t]:Array.from(t.querySelectorAll(e.handle)),this.dragEls.length===0&&(this.dragEls=[t]),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()}on(t,e){super.on(t,e)}off(t){super.off(t)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(t=>{t.addEventListener("mousedown",this._mouseDown),S&&(t.addEventListener("touchstart",et),t.addEventListener("pointerdown",rt))}),this.el.classList.remove("ui-draggable-disabled"))}disable(t=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(e=>{e.removeEventListener("mousedown",this._mouseDown),S&&(e.removeEventListener("touchstart",et),e.removeEventListener("pointerdown",rt))}),t||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(t){return Object.keys(t).forEach(e=>this.option[e]=t[e]),this}_mouseDown(t){if(R.touchHandled&&t.isTrusted&&(R.touchHandled=!1),!f.mouseHandled)return t.button!==0||!this.dragEls.find(e=>e===t.target)&&t.target.closest(Ue)||this.option.cancel&&t.target.closest(this.option.cancel)||(this.mouseDownEvent=t,delete this.dragging,delete f.dragElement,delete f.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),S&&(t.currentTarget.addEventListener("touchmove",it),t.currentTarget.addEventListener("touchend",st)),t.preventDefault(),document.activeElement&&document.activeElement.blur(),f.mouseHandled=!0),!0}_callDrag(t){if(!this.dragging)return;let e=h.initEvent(t,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(e,this.ui()),this.triggerEvent("drag",e)}_mouseMove(t){let e=this.mouseDownEvent;if(this.lastDrag=t,this.dragging)if(this._dragFollow(t),f.pauseDrag){let i=Number.isInteger(f.pauseDrag)?f.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(t),i)}else this._callDrag(t);else if(Math.abs(t.x-e.x)+Math.abs(t.y-e.y)>3){this.dragging=!0,f.dragElement=this;let i=this.el.gridstackNode?.grid;i?f.dropElement=i.el.ddElement.ddDroppable:delete f.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=h.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(t,this.el,this.helperContainment),this._setupHelperStyle(t);let s=h.initEvent(t,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(s,this.ui()),this.triggerEvent("dragstart",s),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(t){if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),S&&t.currentTarget&&(t.currentTarget.removeEventListener("touchmove",it,!0),t.currentTarget.removeEventListener("touchend",st,!0)),this.dragging){delete this.dragging,delete this.el.gridstackNode?._origRotate,document.removeEventListener("keydown",this._keyEvent),f.dropElement?.el===this.el.parentElement&&delete f.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();let e=h.initEvent(t,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop(e),this.triggerEvent("dragstop",e),f.dropElement&&f.dropElement.drop(t)}delete this.helper,delete this.mouseDownEvent,delete f.dragElement,delete f.dropElement,delete f.mouseHandled,t.preventDefault()}_keyEvent(t){let e=this.el.gridstackNode,i=e?.grid||f.dropElement?.el?.gridstack;if(t.key==="Escape")e&&e._origRotate&&(e._orig=e._origRotate,delete e._origRotate),i?.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if(e&&i&&(t.key==="r"||t.key==="R")){if(!h.canBeRotated(e))return;e._origRotate=e._origRotate||_({},e._orig),delete e._moving,i.setAnimation(!1).rotate(e.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),e._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,e.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",h.swap(e._orig,"w","h"),delete e._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let t=this.el;return typeof this.option.helper=="function"?t=this.option.helper(this.el):this.option.helper==="clone"&&(t=h.cloneNode(this.el)),t.parentElement||h.appendTo(t,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=d.originStyleProp.map(e=>this.el.style[e]),t}_setupHelperStyle(t){this.helper.classList.add("ui-draggable-dragging"),this.el.gridstackNode?.grid?.el.classList.add("grid-stack-dragging");let e=this.helper.style;return e.pointerEvents="none",e.width=this.dragOffset.width+"px",e.height=this.dragOffset.height+"px",e.willChange="left, top",e.position="fixed",this._dragFollow(t),e.transition="none",setTimeout(()=>{this.helper&&(e.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){let e=this.helper,i=this.dragElementOriginStyle.transition||null;e.style.transition=this.dragElementOriginStyle.transition="none",d.originStyleProp.forEach(s=>e.style[s]=this.dragElementOriginStyle[s]||null),setTimeout(()=>e.style.transition=i,50)}return delete this.dragElementOriginStyle,this}_dragFollow(t){let e={left:0,top:0},i=this.helper.style,s=this.dragOffset;i.left=(t.clientX+s.offsetLeft-e.left)*this.dragTransform.xScale+"px",i.top=(t.clientY+s.offsetTop-e.top)*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(t,e,i){let s=0,o=0;i&&(s=this.dragTransform.xOffset,o=this.dragTransform.yOffset);let n=e.getBoundingClientRect();return{left:n.left,top:n.top,offsetLeft:-t.clientX+n.left-s,offsetTop:-t.clientY+n.top-o,width:n.width*this.dragTransform.xScale,height:n.height*this.dragTransform.yScale}}ui(){let e=this.el.parentElement.getBoundingClientRect(),i=this.helper.getBoundingClientRect();return{position:{top:(i.top-e.top)*this.dragTransform.yScale,left:(i.left-e.left)*this.dragTransform.xScale}}}}return d.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"],d})();var Mt=class extends G{constructor(r,t={}){super(),this.el=r,this.option=t,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,t){super.on(r,t)}off(r){super.off(r)}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),S&&(this.el.addEventListener("pointerenter",Yt),this.el.addEventListener("pointerleave",jt)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),S&&(this.el.removeEventListener("pointerenter",Yt),this.el.removeEventListener("pointerleave",jt)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(t=>this.option[t]=r[t]),this._setupAccept(),this}_mouseEnter(r){if(!f.dragElement||R.touchHandled&&r.isTrusted||!this._canDrop(f.dragElement.el))return;r.preventDefault(),r.stopPropagation(),f.dropElement&&f.dropElement!==this&&f.dropElement._mouseLeave(r,!0),f.dropElement=this;let t=h.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(t,this._ui(f.dragElement)),this.triggerEvent("dropover",t),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,t=!1){if(!f.dragElement||f.dropElement!==this)return;r.preventDefault(),r.stopPropagation();let e=h.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out(e,this._ui(f.dragElement)),this.triggerEvent("dropout",e),f.dropElement===this&&(delete f.dropElement,!t)){let i,s=this.el.parentElement;for(;!i&&s;)i=s.ddElement?.ddDroppable,s=s.parentElement;i&&i._mouseEnter(r)}}drop(r){r.preventDefault();let t=h.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(t,this._ui(f.dragElement)),this.triggerEvent("drop",t)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return _({draggable:r.el},r.ui())}};var Tt=class d{static init(r){return r.ddElement||(r.ddElement=new d(r)),r.ddElement}constructor(r){this.el=r}on(r,t){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,t):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,t):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,t),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new He(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new Te(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new Mt(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}};var Ht=class{resizable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddResizable&&s.ddResizable[t]();else if(t==="destroy")s.ddResizable&&s.cleanResizable();else if(t==="option")s.setupResizable({[e]:i});else{let n=s.el.gridstackNode.grid,a=s.el.getAttribute("gs-resize-handles")||n.opts.resizable.handles||"e,s,se";a==="all"&&(a="n,e,s,w,se,sw,ne,nw");let u=!n.opts.alwaysShowResizeHandle;s.setupResizable(E(_({},n.opts.resizable),{handles:a,autoHide:u,start:t.start,stop:t.stop,resize:t.resize}))}}),this}draggable(r,t,e,i){return this._getDDElements(r,t).forEach(s=>{if(t==="disable"||t==="enable")s.ddDraggable&&s.ddDraggable[t]();else if(t==="destroy")s.ddDraggable&&s.cleanDraggable();else if(t==="option")s.setupDraggable({[e]:i});else{let o=s.el.gridstackNode.grid;s.setupDraggable(E(_({},o.opts.draggable),{start:t.start,stop:t.stop,drag:t.drag}))}}),this}dragIn(r,t){return this._getDDElements(r).forEach(e=>e.setupDraggable(t)),this}droppable(r,t,e,i){return typeof t.accept=="function"&&!t._accept&&(t._accept=t.accept,t.accept=s=>t._accept(s)),this._getDDElements(r,t).forEach(s=>{t==="disable"||t==="enable"?s.ddDroppable&&s.ddDroppable[t]():t==="destroy"?s.ddDroppable&&s.cleanDroppable():t==="option"?s.setupDroppable({[e]:i}):s.setupDroppable(t)}),this}isDroppable(r){return!!(r?.ddElement?.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){return!!(r?.ddElement?.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){return!!(r?.ddElement?.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,t,e){return this._getDDElements(r).forEach(i=>i.on(t,s=>{e(s,f.dragElement?f.dragElement.el:s.target,f.dragElement?f.dragElement.helper:null)})),this}off(r,t){return this._getDDElements(r).forEach(e=>e.off(t)),this}_getDDElements(r,t){let e=r.gridstack||t!=="destroy"&&t!=="disable",i=h.getElements(r);return i.length?i.map(o=>o.ddElement||(e?Tt.init(o):null)).filter(o=>o):[]}};var M=new Ht,U=(()=>{class d{static init(t={},e=".grid-stack"){if(typeof document>"u")return null;let i=d.getGridElement(e);return i?(i.gridstack||(i.gridstack=new d(i,h.cloneDeep(t))),i.gridstack):(console.error(typeof e=="string"?'GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
|
|
2
|
-
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(t={},e=".grid-stack"){let i=[];return typeof document>"u"||(d.getGridElements(e).forEach(s=>{s.gridstack||(s.gridstack=new d(s,h.cloneDeep(t))),i.push(s.gridstack)}),i.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+e+`" - element missing or wrong selector ?
|
|
3
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),i}static addGrid(t,e={}){if(!t)return null;let i=t;if(i.gridstack){let n=i.gridstack;return e&&(n.opts=_(_({},n.opts),e)),e.children!==void 0&&n.load(e.children),n}return(!t.classList.contains("grid-stack")||d.addRemoveCB)&&(d.addRemoveCB?i=d.addRemoveCB(t,e,!0,!0):i=h.createDiv(["grid-stack",e.class],t)),d.init(e,i)}static registerEngine(t){d.engineClass=t}get placeholder(){if(!this._placeholder){this._placeholder=h.createDiv([this.opts.placeholderClass,O.itemClass,this.opts.itemClass]);let t=h.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(t.textContent=this.opts.placeholderText)}return this._placeholder}constructor(t,e={}){this.el=t,this.opts=e,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},t.gridstack=this,this.opts=e=e||{},t.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),e.row&&(e.minRow=e.maxRow=e.row,delete e.row);let i=h.toNumber(t.getAttribute("gs-row"));e.column==="auto"&&delete e.column,e.alwaysShowResizeHandle!==void 0&&(e._alwaysShowResizeHandle=e.alwaysShowResizeHandle);let s=e.columnOpts;if(s){let c=s.breakpoints;!s.columnWidth&&!c?.length?delete e.columnOpts:(s.columnMax=s.columnMax||12,c?.length>1&&c.sort((l,g)=>(g.w||0)-(l.w||0)))}let o=E(_({},h.cloneDeep(O)),{column:h.toNumber(t.getAttribute("gs-column"))||O.column,minRow:i||h.toNumber(t.getAttribute("gs-min-row"))||O.minRow,maxRow:i||h.toNumber(t.getAttribute("gs-max-row"))||O.maxRow,staticGrid:h.toBool(t.getAttribute("gs-static"))||O.staticGrid,sizeToContent:h.toBool(t.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(e.handleClass?"."+e.handleClass:e.handle?e.handle:"")||O.draggable.handle},removableOptions:{accept:e.itemClass||O.removableOptions.accept,decline:O.removableOptions.decline}});t.getAttribute("gs-animate")&&(o.animate=h.toBool(t.getAttribute("gs-animate"))),e=h.defaults(e,o),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(e),e.rtl==="auto"&&(e.rtl=t.style.direction==="rtl"),e.rtl&&this.el.classList.add("grid-stack-rtl");let a=this.el.closest("."+O.itemClass)?.gridstackNode;if(a&&(a.subGrid=this,this.parentGridNode=a,this.el.classList.add("grid-stack-nested"),a.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=e.cellHeight==="auto",this._isAutoCellHeight||e.cellHeight==="initial")this.cellHeight(void 0);else{typeof e.cellHeight=="number"&&e.cellHeightUnit&&e.cellHeightUnit!==O.cellHeightUnit&&(e.cellHeight=e.cellHeight+e.cellHeightUnit,delete e.cellHeightUnit);let c=e.cellHeight;delete e.cellHeight,this.cellHeight(c)}e.alwaysShowResizeHandle==="mobile"&&(e.alwaysShowResizeHandle=S),this._setStaticClass();let u=e.engineClass||d.engineClass||qt;if(this.engine=new u({column:this.getColumn(),float:e.float,maxRow:e.maxRow,onChange:c=>{c.forEach(l=>{let g=l.el;g&&(l._removeDOM?(g&&g.remove(),delete l._removeDOM):this._writePosAttr(g,l))}),this._updateContainerHeight()}}),e.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(c=>this._prepareElement(c)),delete this.engine._loading,this.batchUpdate(!1)),e.children){let c=e.children;delete e.children,c.length&&this.load(c)}this.setAnimation(),e.subGridDynamic&&!f.pauseDrag&&(f.pauseDrag=!0),e.draggable?.pause!==void 0&&(f.pauseDrag=e.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(t=this.opts){this.el.classList.add("gs-"+t.column),typeof t.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/t.column}%`)}addWidget(t){if(!t)return;if(typeof t=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(t.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(t);let e,i=t;if(i.grid=this,i.el?e=i.el:d.addRemoveCB?e=d.addRemoveCB(this.el,t,!0,!1):e=this.createWidgetDivs(i),!e)return;if(i=e.gridstackNode,i&&e.parentElement===this.el&&this.engine.nodes.find(o=>o._id===i._id))return e;let s=this._readAttr(e);return h.defaults(t,s),this.engine.prepareNode(t),this.el.appendChild(e),this.makeWidget(e,t),e}createWidgetDivs(t){let e=h.createDiv(["grid-stack-item",this.opts.itemClass]),i=h.createDiv(["grid-stack-item-content"],e);return h.lazyLoad(t)?t.visibleObservable||(t.visibleObservable=new IntersectionObserver(([s])=>{s.isIntersecting&&(t.visibleObservable?.disconnect(),delete t.visibleObservable,d.renderCB(i,t),t.grid?.prepareDragDrop(t.el))}),window.setTimeout(()=>t.visibleObservable?.observe(e))):d.renderCB(i,t),e}makeSubGrid(t,e,i,s=!0){let o=t.gridstackNode;if(o||(o=this.makeWidget(t).gridstackNode),o.subGrid?.el)return o.subGrid;let n,a=this;for(;a&&!n;)n=a.opts?.subGridOpts,a=a.parentGridNode?.grid;e=h.cloneDeep(_(_(E(_({},this.opts),{id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0}),n||{}),e||o.subGridOpts||{})),o.subGridOpts=e;let u;e.column==="auto"&&(u=!0,e.column=Math.max(o.w||1,i?.w||1),delete e.columnOpts);let c=o.el.querySelector(".grid-stack-item-content"),l,g;if(s&&(this._removeDD(o.el),g=E(_({},o),{x:0,y:0}),h.removeInternalForSave(g),delete g.subGridOpts,o.content&&(g.content=o.content,delete o.content),d.addRemoveCB?l=d.addRemoveCB(this.el,g,!0,!1):(l=h.createDiv(["grid-stack-item"]),l.appendChild(c),c=h.createDiv(["grid-stack-item-content"],o.el)),this.prepareDragDrop(o.el)),i){let v=u?e.column:o.w,C=o.h+i.h,T=o.el.style;T.transition="none",this.update(o.el,{w:v,h:C}),setTimeout(()=>T.transition=null)}let p=o.subGrid=d.addGrid(c,e);return i?._moving&&(p._isTemp=!0),u&&(p._autoColumn=!0),s&&p.makeWidget(l,g),i&&(i._moving?window.setTimeout(()=>h.simulateMouseEvent(i._event,"mouseenter",p.el),0):p.makeWidget(o.el,o)),this.resizeToContentCheck(!1,o),p}removeAsSubGrid(t){let e=this.parentGridNode?.grid;e&&(e.batchUpdate(),e.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(i=>{i.x+=this.parentGridNode.x,i.y+=this.parentGridNode.y,e.makeWidget(i.el,i)}),e.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,t&&window.setTimeout(()=>h.simulateMouseEvent(t._event,"mouseenter",e.el),0))}save(t=!0,e=!1,i=d.saveCB,s){let o=this.engine.save(t,i,s);if(o.forEach(n=>{if(t&&n.el&&!n.subGrid&&!i){let a=n.el.querySelector(".grid-stack-item-content");n.content=a?.innerHTML,n.content||delete n.content}else if(!t&&!i&&delete n.content,n.subGrid?.el){let a=n.w||n.subGrid.getColumn(),u=n.subGrid.save(t,e,i,a);n.subGridOpts=e?u:{children:u},delete n.subGrid}delete n.el}),e){let n=h.cloneDeep(this.opts);n.marginBottom===n.marginTop&&n.marginRight===n.marginLeft&&n.marginTop===n.marginRight&&(n.margin=n.marginTop,delete n.marginTop,delete n.marginRight,delete n.marginBottom,delete n.marginLeft),n.rtl===(this.el.style.direction==="rtl")&&(n.rtl="auto"),this._isAutoCellHeight&&(n.cellHeight="auto"),this._autoColumn&&(n.column="auto");let a=n._alwaysShowResizeHandle;return delete n._alwaysShowResizeHandle,a!==void 0?n.alwaysShowResizeHandle=a:delete n.alwaysShowResizeHandle,h.removeInternalAndSame(n,O),n.children=o,n}return o}load(t,e=d.addRemoveCB||!0){t=h.cloneDeep(t);let i=this.getColumn();t.forEach(l=>{l.w=l.w||l.minW||1,l.h=l.h||l.minH||1}),t=h.sort(t),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let s=0;t.forEach(l=>{s=Math.max(s,(l.x||0)+l.w)}),s>this.engine.defaultColumn&&(this.engine.defaultColumn=s),s>i&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=t,this.engine.columnChanged(s,i,this.responseLayout),t=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(t,s,!0));let o=d.addRemoveCB;typeof e=="function"&&(d.addRemoveCB=e);let n=[];this.batchUpdate();let a=!this.engine.nodes.length,u=a&&this.opts.animate;u&&this.setAnimation(!1),!a&&e&&[...this.engine.nodes].forEach(g=>{if(!g.id)return;h.find(t,g.id)||(d.addRemoveCB&&d.addRemoveCB(this.el,g,!1,!1),n.push(g),this.removeWidget(g.el,!0,!1))}),this.engine._loading=!0;let c=[];return this.engine.nodes=this.engine.nodes.filter(l=>h.find(t,l.id)?(c.push(l),!1):!0),t.forEach(l=>{let g=h.find(c,l.id);if(g){if(h.shouldSizeToContent(g)&&(l.h=g.h),this.engine.nodeBoundFix(l),(l.autoPosition||l.x===void 0||l.y===void 0)&&(l.w=l.w||g.w,l.h=l.h||g.h,this.engine.findEmptyPosition(l)),this.engine.nodes.push(g),h.samePos(g,l)&&this.engine.nodes.length>1&&(this.moveNode(g,E(_({},l),{forceCollide:!0})),h.copyPos(l,g)),this.update(g.el,l),l.subGridOpts?.children){let p=g.el.querySelector(".grid-stack");p&&p.gridstack&&p.gridstack.load(l.subGridOpts.children)}}else e&&this.addWidget(l)}),delete this.engine._loading,this.engine.removedNodes=n,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,o?d.addRemoveCB=o:delete d.addRemoveCB,u&&this.setAnimation(!0,!0),this}batchUpdate(t=!0){return this.engine.batchUpdate(t),t||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(t=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!t||!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;let e=this.el.querySelector("."+this.opts.itemClass);if(e){let s=h.toNumber(e.getAttribute("gs-h"))||1;return Math.round(e.offsetHeight/s)}let i=parseInt(this.el.getAttribute("gs-current-row"));return i?Math.round(this.el.getBoundingClientRect().height/i):this.opts.cellHeight}cellHeight(t){if(t!==void 0&&this._isAutoCellHeight!==(t==="auto")&&(this._isAutoCellHeight=t==="auto",this._updateResizeEvent()),(t==="initial"||t==="auto")&&(t=void 0),t===void 0){let i=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;t=this.cellWidth()+i}let e=h.parseHeight(t);return this.opts.cellHeightUnit===e.unit&&this.opts.cellHeight===e.h?this:(this.opts.cellHeightUnit=e.unit,this.opts.cellHeight=e.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(t=!1){return t&&this.opts.columnOpts?.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){let t=this.opts.columnOpts;if(!t||!t.columnWidth&&!t.breakpoints?.length)return!1;let e=this.getColumn(),i=e,s=this._widthOrContainer(!0);if(t.columnWidth)i=Math.min(Math.round(s/t.columnWidth)||1,t.columnMax);else{i=t.columnMax;let o=0;for(;o<t.breakpoints.length&&s<=t.breakpoints[o].w;)i=t.breakpoints[o++].c||e}if(i!==e){let o=t.breakpoints?.find(n=>n.c===i);return this.column(i,o?.layout||t.layout),!0}return!1}compact(t="compact",e=!0){return this.engine.compact(t,e),this._triggerChangeEvent(),this}column(t,e="moveScale"){if(!t||t<1||this.opts.column===t)return this;let i=this.getColumn();return this.opts.column=t,this.engine?(this.engine.column=t,this.el.classList.remove("gs-"+i),this._updateColumnVar(),this.engine.columnChanged(i,t,e),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=e,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(t=>t.matches("."+this.opts.itemClass)&&!t.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(t=!0){if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),t?this.el.parentNode.removeChild(this.el):(this.removeAll(t),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(t){return this.opts.float!==t&&(this.opts.float=this.engine.float=t,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(t,e=!1){let i=this.el.getBoundingClientRect(),s;e?s={top:i.top+document.documentElement.scrollTop,left:i.left}:s={top:this.el.offsetTop,left:this.el.offsetLeft};let o=t.left-s.left,n=t.top-s.top,a=i.width/this.getColumn(),u=i.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(o/a),y:Math.floor(n/u)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(t,e,i,s){return this.engine.isAreaEmpty(t,e,i,s)}makeWidget(t,e){let i=d.getElement(t);if(!i||i.gridstackNode)return i;i.parentElement||this.el.appendChild(i),this._prepareElement(i,!0,e);let s=i.gridstackNode;this._updateContainerHeight(),s.subGridOpts&&this.makeSubGrid(i,s.subGridOpts,void 0,!1);let o;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(o=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),o&&delete this._ignoreLayoutsNodeChange,i}on(t,e){return t.indexOf(" ")!==-1?(t.split(" ").forEach(s=>this.on(s,e)),this):(t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable"?(t==="enable"||t==="disable"?this._gsEventHandler[t]=s=>e(s):this._gsEventHandler[t]=s=>{s.detail&&e(s,s.detail)},this.el.addEventListener(t,this._gsEventHandler[t])):t==="drag"||t==="dragstart"||t==="dragstop"||t==="resizestart"||t==="resize"||t==="resizestop"||t==="dropped"||t==="resizecontent"?this._gsEventHandler[t]=e:console.error("GridStack.on("+t+") event not supported"),this)}off(t){return t.indexOf(" ")!==-1?(t.split(" ").forEach(i=>this.off(i)),this):((t==="change"||t==="added"||t==="removed"||t==="enable"||t==="disable")&&this._gsEventHandler[t]&&this.el.removeEventListener(t,this._gsEventHandler[t]),delete this._gsEventHandler[t],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(t=>this.off(t)),this}removeWidget(t,e=!0,i=!0){return t?(d.getElements(t).forEach(s=>{if(s.parentElement&&s.parentElement!==this.el)return;let o=s.gridstackNode;o||(o=this.engine.nodes.find(n=>s===n.el)),o&&(e&&d.addRemoveCB&&d.addRemoveCB(this.el,o,!1,!1),delete s.gridstackNode,this._removeDD(s),this.engine.removeNode(o,e,i),e&&s.parentElement&&s.remove())}),i&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(t=!0,e=!0){return this.engine.nodes.forEach(i=>{t&&d.addRemoveCB&&d.addRemoveCB(this.el,i,!1,!1),delete i.el.gridstackNode,this.opts.staticGrid||this._removeDD(i.el)}),this.engine.removeAll(t,e),e&&this._triggerRemoveEvent(),this}setAnimation(t=this.opts.animate,e){return e?setTimeout(()=>{this.opts&&this.setAnimation(t)}):t?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=t,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(t,e=!0,i=!0){return!!this.opts.staticGrid===t?this:(t?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(s=>{this.prepareDragDrop(s.el),s.subGrid&&i&&s.subGrid.setStatic(t,e,i)}),e&&this._setStaticClass(),this)}updateOptions(t){let e=this.opts;return t===e?this:(t.acceptWidgets!==void 0&&(e.acceptWidgets=t.acceptWidgets,this._setupAcceptWidget()),t.animate!==void 0&&this.setAnimation(t.animate),t.cellHeight&&this.cellHeight(t.cellHeight),t.class!==void 0&&t.class!==e.class&&(e.class&&this.el.classList.remove(e.class),t.class&&this.el.classList.add(t.class)),t.columnOpts?(this.opts.columnOpts=t.columnOpts,this.checkDynamicColumn()):t.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof t.column=="number"&&this.column(t.column),t.margin!==void 0&&this.margin(t.margin),t.staticGrid!==void 0&&this.setStatic(t.staticGrid),t.disableDrag!==void 0&&!t.staticGrid&&this.enableMove(!t.disableDrag),t.disableResize!==void 0&&!t.staticGrid&&this.enableResize(!t.disableResize),t.float!==void 0&&this.float(t.float),t.row!==void 0?(e.minRow=e.maxRow=e.row=t.row,this._updateContainerHeight()):(t.minRow!==void 0&&(e.minRow=t.minRow,this._updateContainerHeight()),t.maxRow!==void 0&&(e.maxRow=t.maxRow)),t.lazyLoad!==void 0&&(e.lazyLoad=t.lazyLoad),t.children?.length&&this.load(t.children),this)}update(t,e){return d.getElements(t).forEach(i=>{let s=i?.gridstackNode;if(!s)return;let o=_(_({},h.copyPos({},s)),h.cloneDeep(e));this.engine.nodeBoundFix(o),delete o.autoPosition;let n=["x","y","w","h"],a;if(n.some(l=>o[l]!==void 0&&o[l]!==s[l])&&(a={},n.forEach(l=>{a[l]=o[l]!==void 0?o[l]:s[l],delete o[l]})),!a&&(o.minW||o.minH||o.maxW||o.maxH)&&(a={}),o.content!==void 0){let l=i.querySelector(".grid-stack-item-content");l&&l.textContent!==o.content&&(s.content=o.content,d.renderCB(l,o),s.subGrid?.el&&(l.appendChild(s.subGrid.el),s.subGrid._updateContainerHeight())),delete o.content}let u=!1,c=!1;for(let l in o)l[0]!=="_"&&s[l]!==o[l]&&(s[l]=o[l],u=!0,c=c||!this.opts.staticGrid&&(l==="noResize"||l==="noMove"||l==="locked"));if(h.sanitizeMinMax(s),a){let l=a.w!==void 0&&a.w!==s.w;this.moveNode(s,a),l&&s.subGrid?s.subGrid.onResize(this.hasAnimationCSS()?s.w:void 0):this.resizeToContentCheck(l,s),delete s._orig}(a||u)&&this._writeAttr(i,s),c&&this.prepareDragDrop(s.el),d.updateCB&&d.updateCB(s)}),this}moveNode(t,e){let i=t._updating;i||this.engine.cleanNodes().beginUpdate(t),this.engine.moveNode(t,e),this._updateContainerHeight(),i||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(t){if(!t||(t.classList.remove("size-to-content-max"),!t.clientHeight))return;let e=t.gridstackNode;if(!e)return;let i=e.grid;if(!i||t.parentElement!==i.el)return;let s=i.getCellHeight(!0);if(!s)return;let o=e.h?e.h*s:t.clientHeight,n;if(e.resizeToContentParent&&(n=t.querySelector(e.resizeToContentParent)),n||(n=t.querySelector(d.resizeToContentParent)),!n)return;let a=t.clientHeight-n.clientHeight,u=e.h?e.h*s-a:n.clientHeight,c;if(e.subGrid){c=e.subGrid.getRow()*e.subGrid.getCellHeight(!0);let p=e.subGrid.el.getBoundingClientRect(),v=t.getBoundingClientRect();c+=p.top-v.top}else{if(e.subGridOpts?.children?.length)return;{let p=n.firstElementChild;if(!p){console.error(`Error: GridStack.resizeToContent() widget id:${e.id} '${d.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}c=p.getBoundingClientRect().height||u}}if(u===c)return;o+=c-u;let l=Math.ceil(o/s),g=Number.isInteger(e.sizeToContent)?e.sizeToContent:0;g&&l>g&&(l=g,t.classList.add("size-to-content-max")),e.minH&&l<e.minH?l=e.minH:e.maxH&&l>e.maxH&&(l=e.maxH),l!==e.h&&(i._ignoreLayoutsNodeChange=!0,i.moveNode(e,{h:l}),delete i._ignoreLayoutsNodeChange)}resizeToContentCBCheck(t){d.resizeToContentCB?d.resizeToContentCB(t):this.resizeToContent(t)}rotate(t,e){return d.getElements(t).forEach(i=>{let s=i.gridstackNode;if(!h.canBeRotated(s))return;let o={w:s.h,h:s.w,minH:s.minW,minW:s.minH,maxH:s.maxW,maxW:s.maxH};if(e){let a=e.left>0?Math.floor(e.left/this.cellWidth()):0,u=e.top>0?Math.floor(e.top/this.opts.cellHeight):0;o.x=s.x+a-(s.h-(u+1)),o.y=s.y+u-a}Object.keys(o).forEach(a=>{o[a]===void 0&&delete o[a]});let n=s._orig;this.update(i,o),s._orig=n}),this}margin(t){if(!(typeof t=="string"&&t.split(" ").length>1)){let i=h.parseHeight(t);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=t,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(t){return this.engine.willItFit(t)}_triggerChangeEvent(){if(this.engine.batchMode)return this;let t=this.engine.getDirtyNodes(!0);return t&&t.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(t),this._triggerEvent("change",t)),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(e=>{delete e._dirty});let t=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",t)}return this}_triggerRemoveEvent(){if(this.engine.batchMode)return this;if(this.engine.removedNodes?.length){let t=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",t)}return this}_triggerEvent(t,e){let i=e?new CustomEvent(t,{bubbles:!1,detail:e}):new Event(t),s=this;for(;s.parentGridNode;)s=s.parentGridNode.grid;return s.el.dispatchEvent(i),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;let t=this.parentGridNode,e=this.getRow()+this._extraDragRow,i=this.opts.cellHeight,s=this.opts.cellHeightUnit;if(!i)return this;if(!t&&!this.opts.minRow){let o=h.parseHeight(getComputedStyle(this.el).minHeight);if(o.h>0&&o.unit===s){let n=Math.floor(o.h/i);e<n&&(e=n)}}return this.el.setAttribute("gs-current-row",String(e)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),e&&(this.el.style[t?"minHeight":"height"]=e*i+s),t&&h.shouldSizeToContent(t)&&t.grid.resizeToContentCBCheck(t.el),this}_prepareElement(t,e=!1,i){i=i||this._readAttr(t),t.gridstackNode=i,i.el=t,i.grid=this,i=this.engine.addNode(i,e),this._writeAttr(t,i),t.classList.add(O.itemClass,this.opts.itemClass);let s=h.shouldSizeToContent(i);return s?t.classList.add("size-to-content"):t.classList.remove("size-to-content"),s&&this.resizeToContentCheck(!1,i),h.lazyLoad(i)||this.prepareDragDrop(i.el),this}_writePosAttr(t,e){return(!e._moving&&!e._resizing||this._placeholder===t)&&(t.style.top=e.y?e.y===1?"var(--gs-cell-height)":`calc(${e.y} * var(--gs-cell-height))`:null,t.style.left=e.x?e.x===1?"var(--gs-column-width)":`calc(${e.x} * var(--gs-column-width))`:null,t.style.width=e.w>1?`calc(${e.w} * var(--gs-column-width))`:null,t.style.height=e.h>1?`calc(${e.h} * var(--gs-cell-height))`:null),t.setAttribute("gs-x",String(e.x)),t.setAttribute("gs-y",String(e.y)),e.w>1?t.setAttribute("gs-w",String(e.w)):t.removeAttribute("gs-w"),e.h>1?t.setAttribute("gs-h",String(e.h)):t.removeAttribute("gs-h"),this}_writeAttr(t,e){if(!e)return this;this._writePosAttr(t,e);let i={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(let s in i)e[s]?t.setAttribute(i[s],String(e[s])):t.removeAttribute(i[s]);return this}_readAttr(t,e=!0){let i={};i.x=h.toNumber(t.getAttribute("gs-x")),i.y=h.toNumber(t.getAttribute("gs-y")),i.w=h.toNumber(t.getAttribute("gs-w")),i.h=h.toNumber(t.getAttribute("gs-h")),i.autoPosition=h.toBool(t.getAttribute("gs-auto-position")),i.noResize=h.toBool(t.getAttribute("gs-no-resize")),i.noMove=h.toBool(t.getAttribute("gs-no-move")),i.locked=h.toBool(t.getAttribute("gs-locked"));let s=t.getAttribute("gs-size-to-content");s&&(s==="true"||s==="false"?i.sizeToContent=h.toBool(s):i.sizeToContent=parseInt(s,10)),i.id=t.getAttribute("gs-id"),i.maxW=h.toNumber(t.getAttribute("gs-max-w")),i.minW=h.toNumber(t.getAttribute("gs-min-w")),i.maxH=h.toNumber(t.getAttribute("gs-max-h")),i.minH=h.toNumber(t.getAttribute("gs-min-h")),e&&(i.w===1&&t.removeAttribute("gs-w"),i.h===1&&t.removeAttribute("gs-h"),i.maxW&&t.removeAttribute("gs-max-w"),i.minW&&t.removeAttribute("gs-min-w"),i.maxH&&t.removeAttribute("gs-max-h"),i.minH&&t.removeAttribute("gs-min-h"));for(let o in i){if(!i.hasOwnProperty(o))return;!i[o]&&i[o]!==0&&o!=="sizeToContent"&&delete i[o]}return i}_setStaticClass(){let t=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...t),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...t),this.el.removeAttribute("gs-static")),this}onResize(t=this.el?.clientWidth){if(!t||this.prevWidth===t)return;this.prevWidth=t,this.batchUpdate();let e=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),e=!0):e=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(i=>{i.subGrid&&i.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(e),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(t=!1,e=void 0){if(this.engine){if(t&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,e),this.animationDelay);if(e)h.shouldSizeToContent(e)&&this.resizeToContentCBCheck(e.el);else if(this.engine.nodes.some(i=>h.shouldSizeToContent(i))){let i=[...this.engine.nodes];this.batchUpdate(),i.forEach(s=>{h.shouldSizeToContent(s)&&this.resizeToContentCBCheck(s.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,e?[e]:this.engine.nodes)}}_updateResizeEvent(t=!1){let e=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(i=>i.sizeToContent));return!t&&e&&!this.resizeObserver?(this._sizeThrottle=h.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(t||!e)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(t=".grid-stack-item"){return h.getElement(t)}static getElements(t=".grid-stack-item"){return h.getElements(t)}static getGridElement(t){return d.getElement(t)}static getGridElements(t){return h.getElements(t)}_initMargin(){let t,e=0,i=[];typeof this.opts.margin=="string"&&(i=this.opts.margin.split(" ")),i.length===2?(this.opts.marginTop=this.opts.marginBottom=i[0],this.opts.marginLeft=this.opts.marginRight=i[1]):i.length===4?(this.opts.marginTop=i[0],this.opts.marginRight=i[1],this.opts.marginBottom=i[2],this.opts.marginLeft=i[3]):(t=h.parseHeight(this.opts.margin),this.opts.marginUnit=t.unit,e=this.opts.margin=t.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(n=>{this.opts[n]===void 0?this.opts[n]=e:(t=h.parseHeight(this.opts[n]),this.opts[n]=t.h,delete this.opts.margin)}),this.opts.marginUnit=t.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);let o=this.el.style;return o.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),o.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return M}static setupDragIn(t,e,i,s=document){e?.pause!==void 0&&(f.pauseDrag=e.pause),e=_({appendTo:"body",helper:"clone"},e||{}),(typeof t=="string"?h.getElements(t,s):t).forEach((n,a)=>{M.isDraggable(n)||M.dragIn(n,e),i?.[a]&&(n.gridstackNode=i[a])})}movable(t,e){return this.opts.staticGrid?this:(d.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noMove:s.noMove=!0,this.prepareDragDrop(s.el))}),this)}resizable(t,e){return this.opts.staticGrid?this:(d.getElements(t).forEach(i=>{let s=i.gridstackNode;s&&(e?delete s.noResize:s.noResize=!0,this.prepareDragDrop(s.el))}),this)}disable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!1,t),this.enableResize(!1,t),this._triggerEvent("disable"),this}enable(t=!0){if(!this.opts.staticGrid)return this.enableMove(!0,t),this.enableResize(!0,t),this._triggerEvent("enable"),this}enableMove(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableMove(t,e)}),this)}enableResize(t,e=!0){return this.opts.staticGrid?this:(t?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(i=>{this.prepareDragDrop(i.el),i.subGrid&&e&&i.subGrid.enableResize(t,e)}),this)}cancelDrag(){let t=this._placeholder?.gridstackNode;t&&(t._isExternal?(t._isAboutToRemove=!0,this.engine.removeNode(t)):t._isAboutToRemove&&d._itemRemoving(t.el,!1),this.engine.restoreInitial())}_removeDD(t){return M.draggable(t,"destroy").resizable(t,"destroy"),t.gridstackNode&&delete t.gridstackNode._initDD,delete t.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return M.droppable(this.el,"destroy"),this;let t,e,i=(s,o,n)=>{n=n||o;let a=n.gridstackNode;if(!a)return;if(!a.grid?.el){n.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;let p=n.getBoundingClientRect();n.style.left=p.x+(this.dragTransform.xScale-1)*(s.clientX-p.x)/this.dragTransform.xScale+"px",n.style.top=p.y+(this.dragTransform.yScale-1)*(s.clientY-p.y)/this.dragTransform.yScale+"px",n.style.transformOrigin="0px 0px"}let{top:u,left:c}=n.getBoundingClientRect(),l=this.el.getBoundingClientRect();c-=l.left,u-=l.top;let g={position:{top:u*this.dragTransform.xScale,left:c*this.dragTransform.yScale}};if(a._temporaryRemoved){if(a.x=Math.max(0,Math.round(c/e)),a.y=Math.max(0,Math.round(u/t)),delete a.autoPosition,this.engine.nodeBoundFix(a),!this.engine.willItFit(a)){if(a.autoPosition=!0,!this.engine.willItFit(a)){M.off(o,"drag");return}a._willFitPos&&(h.copyPos(a,a._willFitPos),delete a._willFitPos)}this._onStartMoving(n,s,g,a,e,t)}else this._dragOrResize(n,s,g,a,e,t)};return M.droppable(this.el,{accept:s=>{let o=s.gridstackNode||this._readAttr(s,!1);if(o?.grid===this)return!0;if(!this.opts.acceptWidgets)return!1;let n=!0;if(typeof this.opts.acceptWidgets=="function")n=this.opts.acceptWidgets(s);else{let a=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;n=s.matches(a)}if(n&&o&&this.opts.maxRow){let a={w:o.w,h:o.h,minW:o.minW,minH:o.minH};n=this.engine.willItFit(a)}return n}}).on(this.el,"dropover",(s,o,n)=>{let a=n?.gridstackNode||o.gridstackNode;if(a?.grid===this&&!a._temporaryRemoved)return!1;if(a?._sidebarOrig&&(a.w=a._sidebarOrig.w,a.h=a._sidebarOrig.h),a?.grid&&a.grid!==this&&!a._temporaryRemoved&&a.grid._leave(o,n),n=n||o,e=this.cellWidth(),t=this.getCellHeight(!0),!a){let l=n.getAttribute("data-gs-widget")||n.getAttribute("gridstacknode");if(l){try{a=JSON.parse(l)}catch{console.error("Gridstack dropover: Bad JSON format: ",l)}n.removeAttribute("data-gs-widget"),n.removeAttribute("gridstacknode")}a||(a=this._readAttr(n)),a._sidebarOrig={w:a.w,h:a.h}}a.grid||(a.el||(a=_({},a)),a._isExternal=!0,n.gridstackNode=a);let u=a.w||Math.round(n.offsetWidth/e)||1,c=a.h||Math.round(n.offsetHeight/t)||1;return a.grid&&a.grid!==this?(o._gridstackNodeOrig||(o._gridstackNodeOrig=a),o.gridstackNode=a=E(_({},a),{w:u,h:c,grid:this}),delete a.x,delete a.y,this.engine.cleanupNode(a).nodeBoundFix(a),a._initDD=a._isExternal=a._temporaryRemoved=!0):(a.w=u,a.h=c,a._temporaryRemoved=!0),d._itemRemoving(a.el,!1),M.on(o,"drag",i),i(s,o,n),!1}).on(this.el,"dropout",(s,o,n)=>{let a=n?.gridstackNode||o.gridstackNode;return a&&(!a.grid||a.grid===this)&&(this._leave(o,n),this._isTemp&&this.removeAsSubGrid(a)),!1}).on(this.el,"drop",(s,o,n)=>{let a=n?.gridstackNode||o.gridstackNode;if(a?.grid===this&&!a._isExternal)return!1;let u=!!this.placeholder.parentElement,c=o!==n;this.placeholder.remove(),delete this.placeholder.gridstackNode,u&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));let l=o._gridstackNodeOrig;if(delete o._gridstackNodeOrig,u&&l?.grid&&l.grid!==this){let p=l.grid;p.engine.removeNodeFromLayoutCache(l),p.engine.removedNodes.push(l),p._triggerRemoveEvent()._triggerChangeEvent(),p.parentGridNode&&!p.engine.nodes.length&&p.opts.subGridDynamic&&p.removeAsSubGrid()}if(!a||(u&&(this.engine.cleanupNode(a),a.grid=this),delete a.grid?._isTemp,M.off(o,"drag"),n!==o?(n.remove(),o=n):o.remove(),this._removeDD(o),!u))return!1;let g=a.subGrid?.el?.gridstack;return h.copyPos(a,this._readAttr(this.placeholder)),h.removePositioningStyles(o),c&&(a.content||a.subGridOpts||d.addRemoveCB)?(delete a.el,o=this.addWidget(a)):(this._prepareElement(o,!0,a),this.el.appendChild(o),this.resizeToContentCheck(!1,a),g&&(g.parentGridNode=a),this._updateContainerHeight()),this.engine.addedNodes.push(a),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped(E(_({},s),{type:"dropped"}),l&&l.grid?l:void 0,a),!1}),this}static _itemRemoving(t,e){if(!t)return;let i=t?t.gridstackNode:void 0;!i?.grid||t.classList.contains(i.grid.opts.removableOptions.decline)||(e?i._isAboutToRemove=!0:delete i._isAboutToRemove,e?t.classList.add("grid-stack-item-removing"):t.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;let t=document.querySelector(this.opts.removable);return t?(!this.opts.staticGrid&&!M.isDroppable(t)&&M.droppable(t,this.opts.removableOptions).on(t,"dropover",(e,i)=>d._itemRemoving(i,!0)).on(t,"dropout",(e,i)=>d._itemRemoving(i,!1)),this):this}prepareDragDrop(t,e=!1){let i=t?.gridstackNode;if(!i)return;let s=i.noMove||this.opts.disableDrag,o=i.noResize||this.opts.disableResize,n=this.opts.staticGrid||s&&o;if((e||n)&&(i._initDD&&(this._removeDD(t),delete i._initDD),n&&t.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!e))return this;if(!i._initDD){let a,u,c=(p,v)=>{this.triggerEvent(p,p.target),a=this.cellWidth(),u=this.getCellHeight(!0),this._onStartMoving(t,p,v,i,a,u)},l=(p,v)=>{this._dragOrResize(t,p,v,i,a,u)},g=p=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete i._moving,delete i._resizing,delete i._event,delete i._lastTried;let v=i.w!==i._orig.w,C=p.target;if(!(!C.gridstackNode||C.gridstackNode.grid!==this)){if(i.el=C,i._isAboutToRemove){let T=t.gridstackNode.grid;T._gsEventHandler[p.type]&&T._gsEventHandler[p.type](p,C),T.engine.nodes.push(i),T.removeWidget(t,!0,!0)}else h.removePositioningStyles(C),i._temporaryRemoved?(this._writePosAttr(C,i),this.engine.addNode(i)):this._writePosAttr(C,i),this.triggerEvent(p,C);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),p.type==="resizestop"&&(Number.isInteger(i.sizeToContent)&&(i.sizeToContent=i.h),this.resizeToContentCheck(v,i))}};M.draggable(t,{start:c,stop:g,drag:l}).resizable(t,{start:c,stop:g,resize:l}),i._initDD=!0}return M.draggable(t,s?"disable":"enable").resizable(t,o?"disable":"enable"),this}_onStartMoving(t,e,i,s,o,n){if(this.engine.cleanNodes().beginUpdate(s),this._writePosAttr(this.placeholder,s),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=s,s.grid?.el)this.dragTransform=h.getValuesFromTransformedElement(t);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){let a=this.placeholder.closest(".grid-stack");this.dragTransform=h.getValuesFromTransformedElement(a)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(s.el=this.placeholder,s._lastUiPosition=i.position,s._prevYPix=i.position.top,s._moving=e.type==="dragstart",s._resizing=e.type==="resizestart",delete s._lastTried,e.type==="dropover"&&s._temporaryRemoved&&(this.engine.addNode(s),s._moving=!0),this.engine.cacheRects(o,n,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),e.type==="resizestart"){let a=this.getColumn()-s.x,u=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-s.y;M.resizable(t,"option","minWidth",o*Math.min(s.minW||1,a)).resizable(t,"option","minHeight",n*Math.min(s.minH||1,u)).resizable(t,"option","maxWidth",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,a)).resizable(t,"option","maxWidthMoveLeft",o*Math.min(s.maxW||Number.MAX_SAFE_INTEGER,s.x+s.w)).resizable(t,"option","maxHeight",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,u)).resizable(t,"option","maxHeightMoveUp",n*Math.min(s.maxH||Number.MAX_SAFE_INTEGER,s.y+s.h))}}_dragOrResize(t,e,i,s,o,n){let a=_({},s._orig),u,c=this.opts.marginLeft,l=this.opts.marginRight,g=this.opts.marginTop,p=this.opts.marginBottom,v=Math.round(n*.1),C=Math.round(o*.1);if(c=Math.min(c,C),l=Math.min(l,C),g=Math.min(g,v),p=Math.min(p,v),e.type==="drag"){if(s._temporaryRemoved)return;let q=i.position.top-s._prevYPix;s._prevYPix=i.position.top,this.opts.draggable.scroll!==!1&&h.updateScrollPosition(t,i.position,q);let Pt=i.position.left+(i.position.left>s._lastUiPosition.left?-l:c),Ie=i.position.top+(i.position.top>s._lastUiPosition.top?-p:g);a.x=Math.round(Pt/o),a.y=Math.round(Ie/n);let Ge=this._extraDragRow;if(this.engine.collide(s,a)){let Lt=this.getRow(),At=Math.max(0,a.y+s.h-Lt);this.opts.maxRow&&Lt+At>this.opts.maxRow&&(At=Math.max(0,this.opts.maxRow-Lt)),this._extraDragRow=At}else this._extraDragRow=0;if(this._extraDragRow!==Ge&&this._updateContainerHeight(),s.x===a.x&&s.y===a.y)return}else if(e.type==="resize"){if(a.x<0||(h.updateScrollResize(e,t,n),a.w=Math.round((i.size.width-c)/o),a.h=Math.round((i.size.height-g)/n),s.w===a.w&&s.h===a.h)||s._lastTried&&s._lastTried.w===a.w&&s._lastTried.h===a.h)return;let q=i.position.left+c,Pt=i.position.top+g;a.x=Math.round(q/o),a.y=Math.round(Pt/n),u=!0}s._event=e,s._lastTried=a;let T={x:i.position.left+c,y:i.position.top+g,w:(i.size?i.size.width:s.w*o)-c-l,h:(i.size?i.size.height:s.h*n)-g-p};if(this.engine.moveNodeCheck(s,E(_({},a),{cellWidth:o,cellHeight:n,rect:T,resizing:u}))){s._lastUiPosition=i.position,this.engine.cacheRects(o,n,g,l,p,c),delete s._skipDown,u&&s.subGrid&&s.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();let q=e.target;s._sidebarOrig||this._writePosAttr(q,s),this.triggerEvent(e,q)}}triggerEvent(t,e){let i=this;for(;i.parentGridNode;)i=i.parentGridNode.grid;i._gsEventHandler[t.type]&&i._gsEventHandler[t.type](t,e)}_leave(t,e){e=e||t;let i=e.gridstackNode;if(!i||(e.style.transform=e.style.transformOrigin=null,M.off(t,"drag"),i._temporaryRemoved))return;i._temporaryRemoved=!0,this.engine.removeNode(i),i.el=i._isExternal&&e?e:t;let s=i._sidebarOrig;i._isExternal&&this.engine.cleanupNode(i),i._sidebarOrig=s,this.opts.removable===!0&&d._itemRemoving(t,!0),t._gridstackNodeOrig?(t.gridstackNode=t._gridstackNodeOrig,delete t._gridstackNodeOrig):i._isExternal&&this.engine.restoreInitial()}}return d.renderCB=(r,t)=>{r&&t?.content&&(r.textContent=t.content)},d.resizeToContentParent=".grid-stack-item-content",d.Utils=h,d.Engine=qt,d.GDRev="12.4.2",d})();var Oe=["container"],Fe=["*"];function Ve(d,r){}var qe=["*",[["","empty-content",""]]],Ye=["*","[empty-content]"];function je(d,r){d&1&&_t(0,1,["*ngIf","isEmpty"])}function $e(d,r){}var Ot=(()=>{class d{serialize(){}deserialize(t){this.widgetItem=t,t&&t.input&&Object.assign(this,t.input)}}return d.\u0275fac=function(t){return new(t||d)},d.\u0275prov=Xt({token:d,factory:d.\u0275fac}),d})(),Ne=(()=>{class d{constructor(t){this.elementRef=t,this.el._gridItemComp=this}set options(t){let e=this.el.gridstackNode?.grid;e?e.update(this.el,t):this._options=E(_({},t),{el:this.el})}get options(){return this.el.gridstackNode||this._options||{el:this.el}}get el(){return this.elementRef.nativeElement}clearOptions(){delete this._options}ngOnDestroy(){this.clearOptions(),delete this.childWidget,delete this.el._gridItemComp,delete this.container,delete this.ref}}return d.\u0275fac=function(t){return new(t||d)(Wt(at))},d.\u0275cmp=z({type:d,selectors:[["gridstack-item"]],viewQuery:function(t,e){if(t&1&&ht(Oe,7,dt),t&2){let i;j(i=$())&&(e.container=i.first)}},inputs:{options:"options"},ngContentSelectors:Fe,decls:5,vars:1,consts:[["container",""],[1,"grid-stack-item-content"]],template:function(t,e){t&1&&(Gt(),Y(0,"div",1),Zt(1,Ve,0,0,"ng-template",null,0,Ft),_t(3),y(4),lt()),t&2&&(H(4),de(" ",e.options.content," "))},styles:["[_nghost-%COMP%]{display:block}"]}),d})(),ct=(()=>{class d{constructor(t){this.elementRef=t,this.addedCB=new N,this.changeCB=new N,this.disableCB=new N,this.dragCB=new N,this.dragStartCB=new N,this.dragStopCB=new N,this.droppedCB=new N,this.enableCB=new N,this.removedCB=new N,this.resizeCB=new N,this.resizeStartCB=new N,this.resizeStopCB=new N,U.addRemoveCB||(U.addRemoveCB=Xe),U.saveCB||(U.saveCB=Qe),U.updateCB||(U.updateCB=Ke),this.el._gridComp=this}set options(t){this._grid?this._grid.updateOptions(t):this._options=t}get options(){return this._grid?.opts||this._options||{}}get el(){return this.elementRef.nativeElement}get grid(){return this._grid}static addComponentToSelectorType(t){t.forEach(e=>d.selectorToType[d.getSelector(e)]=e)}static getSelector(t){return ue(t).selector}ngOnInit(){this.loaded=!!this.options?.children?.length,this._grid=U.init(this._options,this.el),delete this._options,this.checkEmpty()}ngAfterContentInit(){this._sub=this.gridstackItems?.changes.subscribe(()=>this.updateAll()),this.loaded||this.updateAll(),this.hookEvents(this.grid)}ngOnDestroy(){this.unhookEvents(this._grid),this._sub?.unsubscribe(),this._grid?.destroy(),delete this._grid,delete this.el._gridComp,delete this.container,delete this.ref}updateAll(){if(!this.grid)return;let t=[];this.gridstackItems?.forEach(e=>{t.push(e.options),e.clearOptions()}),this.grid.load(t)}checkEmpty(){this.grid&&(this.isEmpty=!this.grid.engine.nodes.length)}hookEvents(t){t&&(t.parentGridNode||t.on("added",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.addedCB.emit({event:e,nodes:i})}).on("change",(e,i)=>this.changeCB.emit({event:e,nodes:i})).on("disable",e=>this.disableCB.emit({event:e})).on("drag",(e,i)=>this.dragCB.emit({event:e,el:i})).on("dragstart",(e,i)=>this.dragStartCB.emit({event:e,el:i})).on("dragstop",(e,i)=>this.dragStopCB.emit({event:e,el:i})).on("dropped",(e,i,s)=>this.droppedCB.emit({event:e,previousNode:i,newNode:s})).on("enable",e=>this.enableCB.emit({event:e})).on("removed",(e,i)=>{(i[0].grid?.el._gridComp||this).checkEmpty(),this.removedCB.emit({event:e,nodes:i})}).on("resize",(e,i)=>this.resizeCB.emit({event:e,el:i})).on("resizestart",(e,i)=>this.resizeStartCB.emit({event:e,el:i})).on("resizestop",(e,i)=>this.resizeStopCB.emit({event:e,el:i})))}unhookEvents(t){t&&(t.parentGridNode||t.off("added change disable drag dragstart dragstop dropped enable removed resize resizestart resizestop"))}}return d.selectorToType={},d.\u0275fac=function(t){return new(t||d)(Wt(at))},d.\u0275cmp=z({type:d,selectors:[["gridstack"]],contentQueries:function(t,e,i){if(t&1&&re(i,Ne,4),t&2){let s;j(s=$())&&(e.gridstackItems=s)}},viewQuery:function(t,e){if(t&1&&ht(Oe,7,dt),t&2){let i;j(i=$())&&(e.container=i.first)}},inputs:{options:"options",isEmpty:"isEmpty"},outputs:{addedCB:"addedCB",changeCB:"changeCB",disableCB:"disableCB",dragCB:"dragCB",dragStartCB:"dragStartCB",dragStopCB:"dragStopCB",droppedCB:"droppedCB",enableCB:"enableCB",removedCB:"removedCB",resizeCB:"resizeCB",resizeStartCB:"resizeStartCB",resizeStopCB:"resizeStopCB"},ngContentSelectors:Ye,decls:4,vars:1,consts:[["container",""],[4,"ngIf"]],template:function(t,e){t&1&&(Gt(qe),Jt(0,je,1,0,"ng-content",1)(1,$e,0,0,"ng-template",null,0,Ft),_t(3)),t&2&&V("ngIf",e.isEmpty)},dependencies:[ge],styles:["[_nghost-%COMP%]{display:block}"]}),d})();function Xe(d,r,t,e){if(t){if(!d)return;if(e){let i=d.parentElement?._gridItemComp;if(!i)return;let o=(i.childWidget?.container||i.container)?.createComponent(ct),n=o?.instance;return n?(n.ref=o,n.options=r,n.el):void 0}else{let s=d._gridComp?.container?.createComponent(Ne),o=s?.instance;if(!o)return;o.ref=s;let n=r.selector,a=n?ct.selectorToType[n]:void 0;if(a){let u=()=>{let l=o.container?.createComponent(a)?.instance;l&&typeof l.serialize=="function"&&typeof l.deserialize=="function"&&(o.childWidget=l,l.deserialize(r))};r.lazyLoad||r.grid?.opts?.lazyLoad&&r.lazyLoad!==!1?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([l])=>{l.isIntersecting&&(r.visibleObservable?.disconnect(),delete r.visibleObservable,u())}),window.setTimeout(()=>r.visibleObservable?.observe(o.el))):u()}return o.el}}else if(e){let i=r.el?._gridComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}else{let i=r.el?._gridItemComp;i?.ref?i.ref.destroy():i?.ngOnDestroy()}}function Qe(d,r){let t=d.el?._gridItemComp;if(t){let i=t.childWidget?.serialize();i&&(r.input=i);return}let e=d.el?._gridComp}function Ke(d){let r=d,t=d.el?._gridItemComp;t?.childWidget&&r.input&&t.childWidget.deserialize(r)}var Je=(d,r)=>r.id;function Ze(d,r){if(d&1&&ie(0,"div",4),d&2){let t=r.$index;P(2);let e=yt(0);bt("background-color",e===t?"var(--mat-sys-on-surface)":"var(--mat-sys-inverse-on-surface)")}}function ti(d,r){if(d&1&&(Y(0,"div",0),It("fade-toast"),Y(1,"span",1),y(2),lt()(),Y(3,"div",2),It("fade-toast"),te(4,Ze,1,2,"div",3,Je),lt()),d&2){P();let t=yt(0),e=yt(1);H(2),ae(e[t].name),H(2),ee(e)}}var Pe=(()=>{class d{activePage=Vt();dashboards=Vt();visible=ut(!1);constructor(){F(()=>{let t=this.activePage();if(t==null){this.visible.set(!1);return}this.visible.set(!1),queueMicrotask(()=>this.visible.set(!0))})}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["dashboard-scroller"]],inputs:{activePage:[1,"activePage"],dashboards:[1,"dashboards"]},decls:3,vars:3,consts:[[1,"page-scroll-title","page-scroll-container"],[1,"page-label"],[1,"page-scroll-page-number","page-scroll-container","fade-toast"],[1,"page-marker",3,"background-color"],[1,"page-marker"]],template:function(e,i){e&1&&(le(0)(1),A(2,ti,6,1)),e&2&&(Ut(i.activePage()),H(),Ut(i.dashboards()),H(),B(i.visible()?2:-1))},styles:["[_nghost-%COMP%]{pointer-events:none}.page-scroll-title[_ngcontent-%COMP%]{position:absolute;top:50%;right:54px;transform:translateY(-50%);z-index:100;cursor:default;text-align:center;padding:10px;color:var(--mat-sys-inverse-surface)}.page-scroll-page-number[_ngcontent-%COMP%]{position:absolute;top:50%;right:15px;transform:translateY(-50%);z-index:100;cursor:default;display:grid;padding:0}.page-scroll-container[_ngcontent-%COMP%]{opacity:0;background-color:var(--mat-sys-tertiary-fixed-dim);border-radius:10px;border:1px solid var(--mat-sys-inverse-surface)}.page-label[_ngcontent-%COMP%]{color:var(--mat-sys-on-surface);text-shadow:1px 1px 0 var(--mat-sys-outline),-1px 1px 0 var(--mat-sys-outline),-1px -1px 0 var(--mat-sys-outline),1px -1px 0 var(--mat-sys-outline);font-size:x-large}.page-marker[_ngcontent-%COMP%]{height:20px;width:20px;margin:4px;border-radius:50%;border:1px solid var(--mat-sys-outline)}@keyframes _ngcontent-%COMP%_fadeInHoldFadeOut{0%{opacity:0}7.407%{opacity:1}25.926%{opacity:1}to{opacity:0}}.fade-toast[_ngcontent-%COMP%]{opacity:0;animation:_ngcontent-%COMP%_fadeInHoldFadeOut 1.35s linear forwards}"]})}return d})();function ii(d,r){if(d&1){let t=L();m(0,"button",0),x("click",function(){D(t);let i=P();return k(i.clickAction("cancel"))}),m(1,"mat-icon",1),y(2,"close"),b(),m(3,"span"),y(4,"Close"),b()()}}var Nt=(()=>{class d{_bottomSheetRef=w(Et);data=w(De);showCancel=!!(this.data&&this.data.showCancel);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["widget-host-bottom-sheet"]],decls:22,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(e,i){e&1&&(m(0,"mat-action-list")(1,"button",0),x("click",function(){return i.clickAction("duplicate")}),m(2,"mat-icon",1),y(3,"add_to_photos"),b(),m(4,"span"),y(5,"Duplicate"),b()(),m(6,"button",0),x("click",function(){return i.clickAction("copy")}),m(7,"mat-icon",1),y(8,"content_copy"),b(),m(9,"span"),y(10,"Copy"),b()(),m(11,"button",0),x("click",function(){return i.clickAction("cut")}),m(12,"mat-icon",1),y(13,"content_cut"),b(),m(14,"span"),y(15,"Cut"),b()(),m(16,"button",0),x("click",function(){return i.clickAction("delete")}),m(17,"mat-icon",1),y(18,"delete_forever"),b(),m(19,"span"),y(20,"Delete"),b()(),A(21,ii,5,0,"button",2),b()),e&2&&(H(21),B(i.showCancel?21:-1))},dependencies:[zt,kt,Rt,Dt,J,K],encapsulation:2})}return d})();var ri=["childOutlet"],Ae=(()=>{class d extends Ot{widgetProperties;outlet;_dialog=w(Z);_dashboard=w(Q);_bottomSheet=w(tt);_streams=w(Ct,{optional:!0});_meta=w(xt,{optional:!0});_runtime=w(I,{optional:!0});_widgetService=w(Ee);_app=w(wt);theme=fe(this._app.cssThemeColorRoles$,{requireSync:!0});childRef;compType;_hasInitialized=!1;_sheetOpen=!1;_optionsOpen=!1;isDebugEnabled(){try{return typeof localStorage<"u"&&localStorage.getItem("kip:gesturesDebug")==="1"}catch{return!1}}debug(...t){this.isDebugEnabled()&&console.debug("[Host2]",...t)}constructor(){super(),F(()=>{let t=this._dashboard.layoutEditCanceled();!this._hasInitialized||!t||nt(()=>{this.reinitFromSavedConfig()})})}ngOnInit(){let t=this.widgetProperties.type;if(!t)return;this.compType=this._widgetService.getComponentType(t);let e=this.getDefaultConfig();this._runtime?.initialize?.(e,this.widgetProperties.config);let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i),this.outlet&&this.compType&&(this.childRef=this.outlet.createComponent(this.compType,{bindings:[gt("id",()=>this.widgetProperties.uuid),gt("type",()=>this.widgetProperties.type),gt("theme",this.theme)]})),this._hasInitialized=!0}serialize(){let t=this._runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}applyRuntimeConfig(t){t&&this._runtime?.setRuntimeConfig?.(t);let e=this._runtime.options();e&&(this.widgetProperties.config=e),this._streams?.applyStreamsConfigDiff?.(e),this._meta?.applyMetaConfigDiff?.(e)}reinitFromSavedConfig(){try{let t=this.getSavedConfigForSelf(),e=this.getDefaultConfig();this._runtime?.initialize?.(e,W(t));let i=this._runtime?.options();i&&(this.widgetProperties.config=i),this._streams?.applyStreamsConfigDiff?.(i),this._meta?.applyMetaConfigDiff?.(i)}catch{}}getSavedConfigForSelf(){try{let t=this._dashboard.dashboards(),e=this._dashboard.activeDashboard(),o=(t?.[e]?.configuration??[]).find(n=>n?.id===this.widgetProperties.uuid);return o?.input?.widgetProperties?.config??o?.widgetProperties?.config??void 0}catch{return}}getDefaultConfig(){let t=this.compType&&this.compType.DEFAULT_CONFIG;if(!t&&this.compType&&this.outlet){let e=this.outlet.createComponent(this.compType);t=e.instance.defaultConfig,e.destroy()}return t}openWidgetOptions(t){if(t.stopPropagation(),this.debug("openWidgetOptions invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._optionsOpen){this.debug("options already open; ignoring");return}if(this._optionsOpen=!0,!this.widgetProperties)return;this._dialog.openWidgetOptions({title:"Widget Options",config:this.widgetProperties.config,confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&(this.debug("options saved",{widgetId:this.widgetProperties?.uuid}),this.applyRuntimeConfig(e))})}}openBottomSheet(t){if(t.stopPropagation(),this.debug("openBottomSheet invoked",{widgetId:this.widgetProperties?.uuid,static:this._dashboard.isDashboardStatic()}),!this._dashboard.isDashboardStatic()){if(this._sheetOpen){this.debug("sheet already open; ignoring");return}this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Nt,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,this.debug("bottom sheet dismissed",{widgetId:this.widgetProperties?.uuid,action:s}),s){case"delete":this._dashboard.deleteWidget(this.widgetProperties.uuid);break;case"duplicate":this._dashboard.duplicateWidget(this.widgetProperties.uuid);break;case"copy":this._dashboard.copyWidget(this.widgetProperties.uuid);break;case"cut":this._dashboard.cutWidget(this.widgetProperties.uuid);break;default:break}})}}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["widget-host2"]],viewQuery:function(e,i){if(e&1&&ht(ri,7,dt),e&2){let s;j(s=$())&&(i.outlet=s.first)}},inputs:{widgetProperties:"widgetProperties"},features:[pt([Ct,xt,I]),ft],decls:3,vars:2,consts:[["childOutlet",""],["kipGestures","","mode","press","appearance","raised",1,"widget-container","kip-widget-card-colors",3,"doubletap","press"]],template:function(e,i){if(e&1){let s=L();m(0,"mat-card",1),x("doubletap",function(n){return D(s),k(i.openWidgetOptions(n))})("press",function(n){return D(s),k(i.openBottomSheet(n))}),se(1,null,0),b()}e&2&&bt("border",i._dashboard.isDashboardStatic()?"1px dashed transparent":"1px dashed var(--mat-sys-outline)")},dependencies:[we,ve,ke,X],styles:["[_nghost-%COMP%]{width:100%;height:100%;display:block;overflow:hidden}.widget-container[_ngcontent-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0}.kip-widget-card-colors[_ngcontent-%COMP%]{background-color:var(--kip-widget-card-background-color)}"],changeDetection:0})}return d})();function oi(d,r){if(d&1){let t=L();m(0,"div",2),x("doubletap",function(i){D(t);let s=P();return k(s.openWidgetOptions(i))})("press",function(i){D(t);let s=P();return k(s.openBottomSheet(i))}),b()}}var Be=(()=>{class d extends Ot{widgetProperties;dashboard=w(Q);_dialog=w(Z);_bottomSheet=w(tt);runtime=w(I);static DEFAULT_CONFIG={displayName:"Gauge Label",color:"contrast"};_sheetOpen=!1;_optionsOpen=!1;constructor(){super()}ngOnInit(){this.runtime?.initialize?.(d.DEFAULT_CONFIG,this.widgetProperties.config)}serialize(){let t=this.runtime?.options();return t?this.widgetProperties.config=t:this.widgetProperties.config||(this.widgetProperties.config={}),{widgetProperties:this.widgetProperties}}openWidgetOptions(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._optionsOpen)return;this._optionsOpen=!0,this._dialog.openWidgetOptions({title:"Widget Options",config:W(this.runtime.options()),confirmBtnText:"Save",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{this._optionsOpen=!1,e&&this.runtime.setRuntimeConfig(e)})}}openBottomSheet(t){if(t.stopPropagation(),!this.dashboard.isDashboardStatic()){if(this._sheetOpen)return;this._sheetOpen=!0;let e=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Nt,e?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{this._sheetOpen=!1,s==="delete"&&this.dashboard.deleteWidget(this.widgetProperties.uuid)})}}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["group-widget"]],inputs:{widgetProperties:"widgetProperties"},features:[pt([I]),ft],decls:2,vars:3,consts:[[3,"text","color"],["kipGestures","","mode","press",1,"widgetOverlay"],["kipGestures","","mode","press",1,"widgetOverlay",3,"doubletap","press"]],template:function(e,i){e&1&&(mt(0,"widget-title",0),A(1,oi,1,0,"div",1)),e&2&&(V("text",i.runtime.options().displayName)("color",i.runtime.options().color),H(),B(i.dashboard.isDashboardStatic()?-1:1))},dependencies:[xe,X],styles:["[_nghost-%COMP%]{display:block;height:15%}.widgetOverlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:15%;right:0;top:0;color:transparent;z-index:21}"],changeDetection:0})}return d})();var We=(()=>{class d{_bottomSheetRef=w(Et);clickAction(t){this._bottomSheetRef.dismiss(t)}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["dashboard-clipboard-bottom-sheet"]],decls:20,vars:0,consts:[["mat-subheader",""],["mat-list-item","",3,"click"],["matListItemIcon",""]],template:function(e,i){e&1&&(m(0,"mat-action-list")(1,"div",0),y(2,"Clipboard"),b(),m(3,"button",1),x("click",function(){return i.clickAction("paste")}),m(4,"mat-icon",2),y(5,"content_paste"),b(),m(6,"span"),y(7,"Paste"),b()(),m(8,"button",1),x("click",function(){return i.clickAction("clear")}),m(9,"mat-icon",2),y(10,"clear"),b(),m(11,"span"),y(12,"Clear"),b()(),m(13,"div",0),y(14,"New Widget"),b(),m(15,"button",1),x("click",function(){return i.clickAction("add")}),m(16,"mat-icon",2),y(17,"add_circle"),b(),m(18,"span"),y(19,"Add"),b()()())},dependencies:[zt,kt,Rt,Dt,ze,J,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}return d})();var ni=["grid"];function ai(d,r){d&1&&(m(0,"p",9)(1,"strong"),y(2,"Long press/click and hold anywhere"),b(),y(3," to add widgets"),b(),m(4,"mat-icon",10),y(5,"touch_app"),b())}function di(d,r){if(d&1){let t=L();m(0,"p",9),y(1,"This empty dashboard is ready to be customized."),b(),m(2,"button",11),x("click",function(){D(t);let i=P();return k(i.editDashboard())}),m(3,"mat-icon"),y(4,"lock_open"),b(),y(5," Unlock and Customize "),b()}}function li(d,r){if(d&1){let t=L();m(0,"div",7)(1,"button",12),x("click",function(){D(t);let i=P();return k(i.cancelLayoutChanges())}),m(2,"mat-icon"),y(3,"close"),b()(),m(4,"button",13),x("click",function(){D(t);let i=P();return k(i.saveLayoutChanges())}),m(5,"mat-icon"),y(6,"done"),b()()()}}function hi(d,r){if(d&1&&mt(0,"dashboard-scroller",8),d&2){let t=P();V("activePage",t.dashboard.activeDashboard())("dashboards",t.dashboard.dashboards())}}var Qr=(()=>{class d{_app=w(wt);_dialog=w(Z);_bottomSheet=w(tt);dashboard=w(Q);_destroyRef=w(Qt);_uiEvent=w(Re);_dataset=w(Ce);_router=w(me);_hostEl=w(at);isDashboardStatic=he(()=>this.dashboard.isDashboardStatic());_gridstack=ce.required("grid");_previousIsStaticState=!0;_suppressDrag=!1;subGridOptions={cellHeight:"auto",column:"auto",acceptWidgets:!0,subGridDynamic:!1,class:"group-container"};gridOptions=ut({column:24,row:24,margin:4,float:!0,resizable:{handles:"all"},acceptWidgets:!0,subGridDynamic:!1,subGridOpts:this.subGridOptions,children:[]});_boundHandleKeyDown=this.handleKeyDown.bind(this);_resizeObserver;_pendingResizeRaf=null;_lastContainerHeight=0;_lastCellHeight=0;_addDialogOpen=!1;_clipboardSheetOpen=!1;constructor(){ct.addComponentToSelectorType([Ae,Be]),F(()=>{let t=this.dashboard.isDashboardStatic();nt(()=>{if(this._previousIsStaticState!==t){this._previousIsStaticState=t;try{this._gridstack().grid.setStatic(t)}catch{}}})}),F(()=>{let t=this.dashboard.activeDashboard();nt(()=>{this.loadDashboard(t)})})}ngAfterViewInit(){this._gridstack().grid?.setStatic(this._previousIsStaticState),this.resizeGridColumns(),this.setupResizeObserver(),this._uiEvent.addHotkeyListener(this._boundHandleKeyDown,{ctrlKey:!0,keys:["arrowdown","arrowup"]});try{let t=this._gridstack().grid;t&&typeof t.on=="function"&&(t.on("dragstart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("dragstop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}),t.on("resizestart",()=>{this._uiEvent.isDragging.set(!0)}),t.on("resizestop",()=>{setTimeout(()=>this._uiEvent.isDragging.set(!1),0)}))}catch{}this.dashboard.widgetAction$.pipe(pe(this._destroyRef)).subscribe(t=>{t&&this._gridstack().grid.getGridItems().forEach(e=>{let i={};if(e.gridstackNode.subGridOpts&&(i=e.gridstackNode.subGridOpts),e.gridstackNode.id===t.id)switch(t.operation){case"delete":this.deleteWidget(e);break;case"duplicate":this.duplicateWidget(e);break;case"copy":this.dashboard.setWidgetClipboardFromNode(e.gridstackNode);break;case"cut":this.dashboard.setWidgetClipboardFromNode(e.gridstackNode),this.deleteWidget(e);break;default:break}})})}setupResizeObserver(){if(this._resizeObserver)return;let t=this._hostEl.nativeElement;try{this._resizeObserver=new ResizeObserver(()=>{this._pendingResizeRaf===null&&(this._pendingResizeRaf=requestAnimationFrame(()=>{this._pendingResizeRaf=null,this.resizeGridColumns()}))}),this._resizeObserver.observe(t)}catch{}}handleKeyDown(t){t==="arrowdown"?this.previousDashboard():t==="arrowup"&&this.nextDashboard()}resizeGridColumns(){try{let e=this._gridstack().grid;if(!e)return;let i=e,s=this._hostEl.nativeElement.clientHeight||window.innerHeight;if(s===this._lastContainerHeight&&this._lastCellHeight>0)return;let o=i.getRow?i.getRow():0;if(o>0&&i.cellHeight){let n=Number(o)||0,a=n>0?s/n:1;if(a=Math.max(1,Math.round(a*100)/100),this._lastCellHeight===a&&this._lastContainerHeight===s)return;i.cellHeight(a),i.batchUpdate&&(i.batchUpdate(),i.batchUpdate(!1)),this._lastContainerHeight=s,this._lastCellHeight=a}}catch{}}loadDashboard(t){let e=W(this.dashboard.dashboards()[t]),i=this._gridstack();if(!i?.grid){queueMicrotask(()=>this.loadDashboard(t));return}i.grid.batchUpdate(),i.grid.load(e.configuration),i.grid.batchUpdate(!1)}saveDashboard(){let t=this._gridstack().grid.save(!1,!1)||null;this.dashboard.updateConfiguration(this.dashboard.activeDashboard(),t)}saveLayoutChanges(){this.dashboard.setStaticDashboard(!0),this.saveDashboard(),this.dashboard.notifyLayoutEditSaved()}cancelLayoutChanges(){this.loadDashboard(this.dashboard.activeDashboard()),this.dashboard.setStaticDashboard(!0),this.dashboard.notifyLayoutEditCanceled()}addNewWidget(t){if(!this.dashboard.isDashboardStatic()&&t.detail!==void 0){if(this._addDialogOpen||this._clipboardSheetOpen)return;let e=t.detail||{},i=e.center?.x??e.x??0,s=e.center?.y??e.y??0,o=this._gridstack().grid.getCellFromPixel({left:i,top:s});if(this._gridstack().grid.isAreaEmpty(o.x,o.y,1,2)){if(this.dashboard.widgetClipboard()){this.openClipboardBottomSheet(o.x,o.y);return}this.openAddWidgetDialog(o.x,o.y)}else this._app.sendSnackbarNotification("Error Adding Widget: Not enough free space at the selected location to add a widget. Please reorganize the dashboard to free up space or try a larger empty area.",0)}}openClipboardBottomSheet(t,e){if(this._clipboardSheetOpen)return;this._clipboardSheetOpen=!0,this._bottomSheet.open(We).afterDismissed().subscribe(s=>{switch(this._clipboardSheetOpen=!1,s){case"paste":this.pasteCopiedWidget(t,e);break;case"clear":this.dashboard.clearWidgetClipboard();break;case"add":this.openAddWidgetDialog(t,e);break;default:break}})}openAddWidgetDialog(t,e){this._addDialogOpen=!0,this._dialog.openFrameDialog({title:"Add Widget",component:"select-widget"},!0).pipe($t(()=>{this._addDialogOpen=!1})).subscribe(i=>{if(!i||typeof i!="object")return;let s=i,o=vt.create(),n={};s.selector==="group-widget"?n={x:t,y:e,w:3,h:4,id:o,selector:"group-widget",input:{widgetProperties:{type:s.selector,uuid:o,config:{displayName:"Group Widget",color:"contrast"}}},subGridOpts:{children:[]}}:n={x:t,y:e,w:s.defaultWidth,h:s.defaultHeight,minW:s.minWidth,minH:s.minHeight,id:o,selector:"widget-host2",input:{widgetProperties:{type:s.selector,uuid:o}}};let a=this._gridstack().grid,u=Number(s.minWidth??1),c=Number(s.minHeight??2),l=Number(s.defaultWidth??u),g=Number(s.defaultHeight??c);if(!(a.isAreaEmpty(t,e,l,g)&&a.willItFit({x:t,y:e,w:l,h:g}))){let C=this.findBestWidgetSizeAtCell(a,t,e,u,c,l,g);if(!C){this._app.sendSnackbarNotification(`Error Adding Widget: Not enough free space to add ${s.name} widget at the selected location. Please reorganize the dashboard to free up space or try a larger empty area.`,0);return}n.w=C.w,n.h=C.h}let v=this._gridstack().grid.addWidget(n);v.gridstackNode.subGrid&&(v.gridstackNode.subGridOpts.row=v.gridstackNode.subGridOpts.minRow=v.gridstackNode.subGridOpts.maxRow=v.gridstackNode.h)})}findBestWidgetSizeAtCell(t,e,i,s,o,n,a){let u=Math.max(1,Math.floor(s)),c=Math.max(1,Math.floor(o)),l=Math.max(u,Math.floor(n)),g=Math.max(c,Math.floor(a)),p=null;for(let v=u;v<=l;v++)for(let C=c;C<=g;C++){if(!t.isAreaEmpty(e,i,v,C)||!t.willItFit({x:e,y:i,w:v,h:C}))continue;let T=v*C;(!p||T>p.area||T===p.area&&C>p.h||T===p.area&&C===p.h&&v>p.w)&&(p={w:v,h:C,area:T})}return p?{w:p.w,h:p.h}:null}cancelPointerSequence(){if(!this._suppressDrag){this._suppressDrag=!0;try{this._gridstack().grid.setStatic(!0)}catch{}["pointerup","mouseup","touchend"].forEach(t=>{document.dispatchEvent(new Event(t,{bubbles:!0}))})}}onPointerRelease(){if(this._suppressDrag&&(this._suppressDrag=!1,!this.dashboard.isDashboardStatic()))try{this._gridstack().grid.setStatic(!1)}catch{}}duplicateWidget(t){let e=vt.create(),i=t.gridstackNode,s={w:i.w,h:i.h,id:e,selector:i.selector,input:{widgetProperties:{type:i.input.widgetProperties.type,uuid:e,config:W(i.input.widgetProperties.config)}}},o=this._gridstack();o.grid.willItFit(s)?o.grid.addWidget(s):(s.h=2,s.w=1,o.grid.willItFit(s)?o.grid.addWidget(s):this._app.sendSnackbarNotification("Duplication failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}pasteCopiedWidget(t,e){if(this.dashboard.isDashboardStatic())return;let i=this.dashboard.widgetClipboard(),s=i?.input?.widgetProperties;if(!i||!s?.type)return;let o=vt.create(),n={w:i.w,h:i.h,id:o,selector:i.selector,input:{widgetProperties:{type:s.type,uuid:o,config:W(s.config)}}};typeof t=="number"&&typeof e=="number"&&(n.x=t,n.y=e);let a=this._gridstack();a.grid.willItFit(n)?(a.grid.addWidget(n),this.dashboard.clearWidgetClipboard()):(n.h=2,n.w=1,a.grid.willItFit(n)?(a.grid.addWidget(n),this.dashboard.clearWidgetClipboard()):this._app.sendSnackbarNotification("Paste failed: Insufficient space on the dashboard. Please reorganize to free up space.",0))}deleteWidget(t){let e=t.gridstackNode;switch(this._gridstack().grid.removeWidget(t),e.selector){case"widget-numeric-chart":case"widget-windtrends-chart":{(this._dataset.list()?.filter(o=>o.uuid===e.id||o.uuid?.startsWith(`${e.id}-`))||[]).forEach(o=>this._dataset.remove(o.uuid));break}}}nextDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToNextDashboard()}previousDashboard(){this.dashboard.isDashboardStatic()&&this.dashboard.navigateToPreviousDashboard()}editDashboard(){this.dashboard.isDashboardStatic.set(!1)}navigateToHelp(){this._router.navigate(["/help"])}ngOnDestroy(){let t=this._gridstack();if(t?.grid&&(t.grid.offAll(),t.grid.destroy()),this._resizeObserver){try{this._resizeObserver.disconnect()}catch{}this._resizeObserver=void 0}this._pendingResizeRaf!==null&&(cancelAnimationFrame(this._pendingResizeRaf),this._pendingResizeRaf=null),this._uiEvent.removeHotkeyListener(this._boundHandleKeyDown)}static \u0275fac=function(e){return new(e||d)};static \u0275cmp=z({type:d,selectors:[["dashboard"]],viewQuery:function(e,i){e&1&&oe(i._gridstack,ni,5),e&2&&ne()},hostBindings:function(e,i){e&1&&x("mouseup",function(){return i.onPointerRelease()},Bt)("touchend",function(){return i.onPointerRelease()},Bt)},decls:16,vars:6,consts:[["grid",""],["kipGestures","",3,"swipeup","swipedown","press","resize","mode","enablePress","enableDoubleTap","options"],["empty-content","",1,"dashboard-empty-state-container"],[1,"dashboard-empty-state-action"],[1,"empty-state-icon"],[1,"empty-state-help"],["mat-button","",1,"empty-state-help-button",3,"click"],[1,"edit-layout-close-icon"],[3,"activePage","dashboards"],[1,"empty-state-text"],[1,"touch-icon"],["mat-flat-button","",1,"empty-state-button",3,"click"],["mat-fab","",1,"cancel",2,"margin-right","10px",3,"click"],["mat-fab","",1,"save",3,"click"]],template:function(e,i){if(e&1){let s=L();m(0,"gridstack",1,0),x("swipeup",function(){return D(s),k(i.previousDashboard())})("swipedown",function(){return D(s),k(i.nextDashboard())})("press",function(n){return D(s),k(i.addNewWidget(n))})("resize",function(){return D(s),k(i.resizeGridColumns())},Kt),m(2,"div",2)(3,"div",3)(4,"mat-icon",4),y(5,"dashboard"),b(),A(6,ai,6,0)(7,di,6,0),b(),m(8,"div")(9,"div",5)(10,"button",6),x("click",function(){return D(s),k(i.navigateToHelp())}),m(11,"mat-icon"),y(12,"help"),b(),y(13," Get Help "),b()()()()(),A(14,li,7,0,"div",7)(15,hi,1,2,"dashboard-scroller",8)}if(e&2){let s=i.dashboard.isDashboardStatic();V("mode",s?"dashboard":"editor")("enablePress",!s)("enableDoubleTap",!1)("options",i.gridOptions()),H(6),B(s?7:6),H(8),B(s?15:14)}},dependencies:[ct,Pe,J,K,ye,_e,be,X],styles:["[_nghost-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;height:100%;width:100%;overflow:hidden}.grid-stack[_ngcontent-%COMP%]{width:100%;height:100%;box-sizing:border-box;position:relative} .grid-stack-sub-grid{border:1px solid var(--mat-sys-outline);border-radius:8px} .grid-stack-sub-grid div{display:flex;flex-direction:column} .grid-stack-sub-grid div .grid-stack{flex:1 1 auto;min-height:500px}.edit-layout-close-icon[_ngcontent-%COMP%]{position:absolute;bottom:20px;right:20px;cursor:pointer;z-index:100}.cancel[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary);--mat-fab-foreground-color: var(--mat-sys-background)}.save[_ngcontent-%COMP%]{--mat-fab-container-color: var(--mat-sys-primary-fixed);--mat-fab-foreground-color: var(--mat-sys-background)}.dashboard-empty-state-container[_ngcontent-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:center;justify-content:space-around;padding:1.5rem;text-align:center;box-sizing:border-box;overflow:hidden;pointer-events:auto}@media(orientation:landscape)and (max-height:420px){.dashboard-empty-state-container[_ngcontent-%COMP%]{padding:.75rem}.empty-state-icon[_ngcontent-%COMP%]{font-size:3.25rem;width:3.25rem;height:3.25rem}}.dashboard-empty-state-action[_ngcontent-%COMP%]{max-width:500px;color:var(--mat-sys-outline-variant)}.dashboard-empty-state-action[_ngcontent-%COMP%] .touch-icon[_ngcontent-%COMP%]{font-size:2rem;width:2rem;height:2rem;color:var(--mat-sys-outline-variant);margin-top:.5rem;animation:_ngcontent-%COMP%_bounce 2s infinite}.empty-state-icon[_ngcontent-%COMP%]{font-size:4rem;width:4rem;height:4rem;color:var(--mat-sys-outline-variant);margin-bottom:1rem}.empty-state-button[_ngcontent-%COMP%]{--mat-button-filled-label-text-color: var(--kip-widget-card-background-color);--mat-button-filled-container-color: var(--mat-sys-outline-variant);--mat-button-filled-hover-state-layer-opacity: .7;--mat-button-filled-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-help-button[_ngcontent-%COMP%]{--mat-button-text-label-text-color: var(--mat-sys-outline-variant);--mat-button-text-hover-state-layer-opacity: .7;--mat-button-text-state-layer-color: var(--mat-sys-primary-fixed-dim)}.empty-state-text[_ngcontent-%COMP%]{color:var(--mat-sys-outline-variant);font-style:italic}@keyframes _ngcontent-%COMP%_bounce{0%,20%,50%,80%,to{transform:translateY(0)}40%{transform:translateY(-10px)}60%{transform:translateY(-5px)}}"]})}return d})();export{Qr as a};
|